diff options
Diffstat (limited to 'public/javascripts/tiny_mce/plugins/noneditable')
| -rw-r--r-- | public/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js | 1 | ||||
| -rw-r--r-- | public/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js | 87 |
2 files changed, 0 insertions, 88 deletions
diff --git a/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js b/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js deleted file mode 100644 index 9945cd8..0000000 --- a/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){var a=tinymce.dom.Event;tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(d,e){var f=this,c,b;f.editor=d;c=d.getParam("noneditable_editable_class","mceEditable");b=d.getParam("noneditable_noneditable_class","mceNonEditable");d.onNodeChange.addToTop(function(h,g,k){var j,i;j=h.dom.getParent(h.selection.getStart(),function(l){return h.dom.hasClass(l,b)});i=h.dom.getParent(h.selection.getEnd(),function(l){return h.dom.hasClass(l,b)});if(j||i){f._setDisabled(1);return false}else{f._setDisabled(0)}})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_block:function(c,d){var b=d.keyCode;if((b>32&&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)}else{b.onKeyDown.remove(c._block);b.onKeyPress.remove(c._block);b.onKeyUp.remove(c._block);b.onPaste.remove(c._block)}c.disabled=d}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js deleted file mode 100644 index 77db577..0000000 --- a/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,87 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 743 2008-03-23 17:47:33Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var Event = tinymce.dom.Event; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.NonEditablePlugin', { | ||
| 12 | init : function(ed, url) { | ||
| 13 | var t = this, editClass, nonEditClass; | ||
| 14 | |||
| 15 | t.editor = ed; | ||
| 16 | editClass = ed.getParam("noneditable_editable_class", "mceEditable"); | ||
| 17 | nonEditClass = ed.getParam("noneditable_noneditable_class", "mceNonEditable"); | ||
| 18 | |||
| 19 | ed.onNodeChange.addToTop(function(ed, cm, n) { | ||
| 20 | var sc, ec; | ||
| 21 | |||
| 22 | // Block if start or end is inside a non editable element | ||
| 23 | sc = ed.dom.getParent(ed.selection.getStart(), function(n) { | ||
| 24 | return ed.dom.hasClass(n, nonEditClass); | ||
| 25 | }); | ||
| 26 | |||
| 27 | ec = ed.dom.getParent(ed.selection.getEnd(), function(n) { | ||
| 28 | return ed.dom.hasClass(n, nonEditClass); | ||
| 29 | }); | ||
| 30 | |||
| 31 | // Block or unblock | ||
| 32 | if (sc || ec) { | ||
| 33 | t._setDisabled(1); | ||
| 34 | return false; | ||
| 35 | } else | ||
| 36 | t._setDisabled(0); | ||
| 37 | }); | ||
| 38 | }, | ||
| 39 | |||
| 40 | getInfo : function() { | ||
| 41 | return { | ||
| 42 | longname : 'Non editable elements', | ||
| 43 | author : 'Moxiecode Systems AB', | ||
| 44 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 45 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable', | ||
| 46 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 47 | }; | ||
| 48 | }, | ||
| 49 | |||
| 50 | _block : function(ed, e) { | ||
| 51 | var k = e.keyCode; | ||
| 52 | |||
| 53 | // Don't block arrow keys, pg up/down, and F1-F12 | ||
| 54 | if ((k > 32 && k < 41) || (k > 111 && k < 124)) | ||
| 55 | return; | ||
| 56 | |||
| 57 | return Event.cancel(e); | ||
| 58 | }, | ||
| 59 | |||
| 60 | _setDisabled : function(s) { | ||
| 61 | var t = this, ed = t.editor; | ||
| 62 | |||
| 63 | tinymce.each(ed.controlManager.controls, function(c) { | ||
| 64 | c.setDisabled(s); | ||
| 65 | }); | ||
| 66 | |||
| 67 | if (s !== t.disabled) { | ||
| 68 | if (s) { | ||
| 69 | ed.onKeyDown.addToTop(t._block); | ||
| 70 | ed.onKeyPress.addToTop(t._block); | ||
| 71 | ed.onKeyUp.addToTop(t._block); | ||
| 72 | ed.onPaste.addToTop(t._block); | ||
| 73 | } else { | ||
| 74 | ed.onKeyDown.remove(t._block); | ||
| 75 | ed.onKeyPress.remove(t._block); | ||
| 76 | ed.onKeyUp.remove(t._block); | ||
| 77 | ed.onPaste.remove(t._block); | ||
| 78 | } | ||
| 79 | |||
| 80 | t.disabled = s; | ||
| 81 | } | ||
| 82 | } | ||
| 83 | }); | ||
| 84 | |||
| 85 | // Register plugin | ||
| 86 | tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin); | ||
| 87 | })(); \ No newline at end of file | ||
