Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
143428 | Mar 19,2019 07:11 PM UTC | Mar 21,2019 10:30 AM UTC | jQuery | 3 |
![]() |
Tags: ejRTE |
keydown: function(args) {
var loc = this._getRange();
offset = loc.startOffset; //get cursor position
var texto = this.getHtml();
var nuevotexto = texto.replace(/{:(.*?)\}/g, '<span style="color:blue">{:$1}</span>');
txt = $(this.getDocument()).find("body p")[0]; // get the first paragraph in RTE content
if (txt.children[0] && txt.children[0].nodeName == "SPAN" && txt.children[0].style.color == "blue") {
return;
}
else {
this.setHtml(nuevotexto);
range = this.createRange();
range.setStart(txt.lastChild, offset);
range.setEnd(txt.lastChild, offset);
this.selectRange(range); //set cursror position
}
} |
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.