I finally figured this out!
- var editor1=document.getElementById('<%=Editor1.ClientID%>');
- if(editor1.IsReady)CuteEditor_OnInitialized(editor);
-
- function selectKeyWord(editor, elementType, keywordStartChar, keywordEndChar) {
- var span = editor.SearchSelectionElement(elementType);
- var v = span.innerHTML;
- if(v.indexOf(keywordStartChar) > -1 && v.indexOf(keywordEndChar) > -1) {
- editor1.SelectElement(span);
- }
- }
-
- function CuteEditor_attachEvents() {
-
- var editdoc = editor1.GetDocument();
-
-
- if(editdoc.attachEvent) {
- editdoc.attachEvent('onclick', CuteEditor_OnClick);
- }
- else if(editdoc.addEventListener) {
- editdoc.addEventListener('click', CuteEditor_OnClick, true);
- }
- }
-
- function CuteEditor_detachEvents() {
-
- var editdoc=editor1.GetDocument();
-
-
- if(editdoc.detachEvent) {
- editdoc.detachEvent('onclick', CuteEditor_OnClick);
- }
- else if(editdoc.removeEventListener) {
- editdoc.removeEventListener('click', CuteEditor_OnClick, true);
- }
- }
- function CuteEditor_OnClick() {
- selectKeyWord(editor1, 'SPAN', '{', '}')
- }
-
- function CuteEditor_OnInitialized(editor) {
- CuteEditor_attachEvents();
- }