summaryrefslogtreecommitdiff
path: root/lib/scripts/textselection.js
diff options
context:
space:
mode:
authorAdrian Lang <mail@adrianlang.de>2011-11-10 15:43:15 +0100
committerAdrian Lang <mail@adrianlang.de>2011-11-10 15:43:15 +0100
commit16a774a8a61756df2d8fb813bfbaed98b42e3e65 (patch)
tree3a48d311e74ccbf4017330cef8af00003b0ddb34 /lib/scripts/textselection.js
parent662a7b3fcc22d8327026bc1ef161a096683f1580 (diff)
parenta5a71ecfcc1ed6bfca1995b39cd0abe4b8dd9eeb (diff)
downloadrpg-16a774a8a61756df2d8fb813bfbaed98b42e3e65.tar.gz
rpg-16a774a8a61756df2d8fb813bfbaed98b42e3e65.tar.bz2
Merge branch 'master' into stable
Conflicts: doku.php
Diffstat (limited to 'lib/scripts/textselection.js')
-rw-r--r--lib/scripts/textselection.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/scripts/textselection.js b/lib/scripts/textselection.js
index 742338785..bd80e9341 100644
--- a/lib/scripts/textselection.js
+++ b/lib/scripts/textselection.js
@@ -22,8 +22,7 @@ function selection_class(){
};
this.getText = function(){
- if(!this.obj) return '';
- return this.obj.value.substring(this.start,this.end);
+ return (!this.obj) ? '' : this.obj.value.substring(this.start,this.end);
};
}
@@ -188,7 +187,7 @@ function pasteText(selection,text,opts){
* @author Andreas Gohr <andi@splitbrain.org>
*/
function insertTags(textAreaID, tagOpen, tagClose, sampleText){
- var txtarea = $(textAreaID);
+ var txtarea = jQuery('#' + textAreaID)[0];
var selection = getSelection(txtarea);
var text = selection.getText();
@@ -227,7 +226,7 @@ function insertTags(textAreaID, tagOpen, tagClose, sampleText){
* @author Andreas Gohr <andi@splitbrain.org>
*/
function insertAtCarret(textAreaID, text){
- var txtarea = $(textAreaID);
+ var txtarea = jQuery('#' + textAreaID)[0];
var selection = getSelection(txtarea);
pasteText(selection,text,{nosel: true});
}