Lines Matching defs:text
63 * Inserts the given text at the current cursor position or replaces the current
67 * @param {string} text the new text to be pasted
71 * @param {boolean} opts.nosel set true if new text should not be selected
73 function pasteText(selection,text,opts){
78 selection.obj.value.substring(0, selection.start) + text +
83 // Opera replaces \n by \r\n when inserting text.
84 selection.end = selection.start + text.replace(/\r?\n/g, '\r\n').length;
86 selection.end = selection.start + text.length;
113 var text = selection.getText();
117 if(text.charAt(text.length - 1) == ' '){
119 text = selection.getText();
122 if(!text){
123 // nothing selected, use the sample text and select it
124 text = sampleText;
137 text = tagOpen + text + tagClose;
140 pasteText(selection,text,opts);
148 function insertAtCarret(textAreaID, text){
151 pasteText(selection,text,{nosel: true});