aboutsummaryrefslogtreecommitdiff
path: root/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/noneditable
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-29 01:53:43 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-29 01:53:43 +0000
commited7371ca5fa32bb14d23b105789c46c9bdf36756 (patch)
treee47f703f0b4214ecc3ee1be5406170d9f4fde090 /mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/noneditable
parent34fecd6b801f2e52b7165ecf87b6a07ee8a3b420 (diff)
downloadelgg-ed7371ca5fa32bb14d23b105789c46c9bdf36756.tar.gz
elgg-ed7371ca5fa32bb14d23b105789c46c9bdf36756.tar.bz2
Upgraded TinyMCE to 3.3.6.
git-svn-id: http://code.elgg.org/elgg/trunk@6281 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/noneditable')
-rw-r--r--mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js1
-rw-r--r--mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js90
2 files changed, 91 insertions, 0 deletions
diff --git a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js
new file mode 100644
index 000000000..9945cd858
--- /dev/null
+++ b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js
@@ -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/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js
new file mode 100644
index 000000000..656c971b8
--- /dev/null
+++ b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js
@@ -0,0 +1,90 @@
+/**
+ * editor_plugin_src.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+(function() {
+ var Event = tinymce.dom.Event;
+
+ tinymce.create('tinymce.plugins.NonEditablePlugin', {
+ init : function(ed, url) {
+ var t = this, editClass, nonEditClass;
+
+ t.editor = ed;
+ editClass = ed.getParam("noneditable_editable_class", "mceEditable");
+ nonEditClass = ed.getParam("noneditable_noneditable_class", "mceNonEditable");
+
+ ed.onNodeChange.addToTop(function(ed, cm, n) {
+ var sc, ec;
+
+ // Block if start or end is inside a non editable element
+ sc = ed.dom.getParent(ed.selection.getStart(), function(n) {
+ return ed.dom.hasClass(n, nonEditClass);
+ });
+
+ ec = ed.dom.getParent(ed.selection.getEnd(), function(n) {
+ return ed.dom.hasClass(n, nonEditClass);
+ });
+
+ // Block or unblock
+ if (sc || ec) {
+ t._setDisabled(1);
+ return false;
+ } else
+ t._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(ed, e) {
+ var k = e.keyCode;
+
+ // Don't block arrow keys, pg up/down, and F1-F12
+ if ((k > 32 && k < 41) || (k > 111 && k < 124))
+ return;
+
+ return Event.cancel(e);
+ },
+
+ _setDisabled : function(s) {
+ var t = this, ed = t.editor;
+
+ tinymce.each(ed.controlManager.controls, function(c) {
+ c.setDisabled(s);
+ });
+
+ if (s !== t.disabled) {
+ if (s) {
+ ed.onKeyDown.addToTop(t._block);
+ ed.onKeyPress.addToTop(t._block);
+ ed.onKeyUp.addToTop(t._block);
+ ed.onPaste.addToTop(t._block);
+ } else {
+ ed.onKeyDown.remove(t._block);
+ ed.onKeyPress.remove(t._block);
+ ed.onKeyUp.remove(t._block);
+ ed.onPaste.remove(t._block);
+ }
+
+ t.disabled = s;
+ }
+ }
+ });
+
+ // Register plugin
+ tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin);
+})(); \ No newline at end of file