X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=webcit%2Ftiny_mce%2Fplugins%2Fnoneditable%2Feditor_plugin.js;h=2d60138eecdea6c6ee1b6ea9f8b77c073695f52b;hp=37beb47c13ab192371d7ae30d7fab0e1f9cda7a2;hb=b05f4eef4014db3885787ef15107cba93c932ac9;hpb=3cedf3f420a1c9316773aa7423689a4f501a3bf8 diff --git a/webcit/tiny_mce/plugins/noneditable/editor_plugin.js b/webcit/tiny_mce/plugins/noneditable/editor_plugin.js index 37beb47c1..2d60138ee 100644 --- a/webcit/tiny_mce/plugins/noneditable/editor_plugin.js +++ b/webcit/tiny_mce/plugins/noneditable/editor_plugin.js @@ -1 +1 @@ -function TinyMCE_noneditable_getInfo(){return{longname:'Non editable elements',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_noneditable.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};function TinyMCE_noneditable_initInstance(inst){tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/plugins/noneditable/css/noneditable.css");if(tinyMCE.isMSIE5_0)tinyMCE.settings['plugins']=tinyMCE.settings['plugins'].replace(/noneditable/gi,'Noneditable');if(tinyMCE.isGecko){tinyMCE.addEvent(inst.getDoc(),"keyup",TinyMCE_noneditable_fixKeyUp);}}function TinyMCE_noneditable_fixKeyUp(e){var inst=tinyMCE.selectedInstance;var sel=inst.getSel();var rng=inst.getRng();var an=sel.anchorNode;if((e.keyCode==38||e.keyCode==37||e.keyCode==40||e.keyCode==39)&&(elm=TinyMCE_noneditable_isNonEditable(an))!=null){rng=inst.getDoc().createRange();rng.selectNode(elm);rng.collapse(true);sel.removeAllRanges();sel.addRange(rng);tinyMCE.cancelEvent(e);}}function TinyMCE_noneditable_selectAll(e){var inst=tinyMCE.selectedInstance;var sel=inst.getSel();var doc=inst.getDoc();if((elm=TinyMCE_noneditable_isNonEditable(sel.focusNode))!=null){inst.selectNode(elm,false);tinyMCE.cancelEvent(e);return;}if((elm=TinyMCE_noneditable_isNonEditable(sel.anchorNode))!=null){inst.selectNode(elm,false);tinyMCE.cancelEvent(e);return;}}function TinyMCE_noneditable_isNonEditable(elm){var editClass=tinyMCE.getParam("noneditable_editable_class","mceItemEditable");var nonEditClass=tinyMCE.getParam("noneditable_noneditable_class","mceItemNonEditable");if(!elm)return;do{var className=elm.className?elm.className:"";if(className.indexOf(editClass)!=-1)return null;if(className.indexOf(nonEditClass)!=-1)return elm;}while(elm=elm.parentNode);return null;}function TinyMCE_noneditable_cleanup(type,content,inst){switch(type){case "insert_to_editor_dom":var nodes=tinyMCE.getNodeTree(content,new Array(),1);var editClass=tinyMCE.getParam("noneditable_editable_class","mceItemEditable");var nonEditClass=tinyMCE.getParam("noneditable_noneditable_class","mceItemNonEditable");for(var i=0;i","gi"),'<$1class="$2$3$4" contenteditable="true"$5>');content=content.replace(new RegExp("<(.*?)class=\"(.*?)("+nonEditClass+")(.*?)\"(.*?)>","gi"),'<$1class="$2$3$4" contenteditable="false"$5>');}break;case "get_from_editor_dom":if(tinyMCE.getParam("noneditable_leave_contenteditable",false)){var nodes=tinyMCE.getNodeTree(content,new Array(),1);for(var i=0;i32&&b<41)||(b>111&&b<124)){return}return a.cancel(d)},_setDisabled:function(d){var c=this,b=c.editor;tinymce.each(b.controlManager.controls,function(e){e.setDisabled(d)});if(d!==c.disabled){if(d){b.onKeyDown.addToTop(c._block);b.onKeyPress.addToTop(c._block);b.onKeyUp.addToTop(c._block);b.onPaste.addToTop(c._block);b.onContextMenu.addToTop(c._block)}else{b.onKeyDown.remove(c._block);b.onKeyPress.remove(c._block);b.onKeyUp.remove(c._block);b.onPaste.remove(c._block);b.onContextMenu.remove(c._block)}c.disabled=d}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})(); \ No newline at end of file