aboutsummaryrefslogtreecommitdiffstats
path: root/view/js
diff options
context:
space:
mode:
Diffstat (limited to 'view/js')
-rw-r--r--view/js/main.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/view/js/main.js b/view/js/main.js
index eb8c78ef4..68a140a33 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -118,6 +118,26 @@
return true;
}
+ function inserteditortag(BBcode) {
+ // allow themes to override this
+ if(typeof(insertEditorFormatting) != 'undefined')
+ return(insertEditorFormatting(BBcode));
+
+ textarea = document.getElementById('profile-jot-text');
+ if (document.selection) {
+ textarea.focus();
+ selected = document.selection.createRange();
+ selected.text = urlprefix+"["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+ } else if (textarea.selectionStart || textarea.selectionStart == "0") {
+ var start = textarea.selectionStart;
+ var end = textarea.selectionEnd;
+ textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+ }
+ return true;
+ }
+
+
+
function insertCommentURL(comment,id) {
reply = prompt(aStr['linkurl']);