Sha256: d9e6850339fff764e148fa6ef79cbb21c44cdf5896e2983cfacf1a6917eea7a4

Contents?: true

Size: 1.24 KB

Versions: 7

Compression:

Stored size: 1.24 KB

Contents

tinymce.PluginManager.add("noneditable",function(e){function t(e){return function(t){return(" "+t.attr("class")+" ").indexOf(e)!==-1}}function n(t){function n(t){var n=arguments,r=n[n.length-2],i=r>0?a.charAt(r-1):"";if('"'===i)return t;if(">"===i){var o=a.lastIndexOf("<",r);if(o!==-1){var l=a.substring(o,r);if(l.indexOf('contenteditable="false"')!==-1)return t}}return'<span class="'+s+'" data-mce-content="'+e.dom.encode(n[0])+'">'+e.dom.encode("string"==typeof n[1]?n[1]:n[0])+"</span>"}var r=o.length,a=t.content,s=tinymce.trim(i);if("raw"!=t.format){for(;r--;)a=a.replace(o[r],n);t.content=a}}var r,i,o,a="contenteditable";r=" "+tinymce.trim(e.getParam("noneditable_editable_class","mceEditable"))+" ",i=" "+tinymce.trim(e.getParam("noneditable_noneditable_class","mceNonEditable"))+" ";var s=t(r),l=t(i);o=e.getParam("noneditable_regexp"),o&&!o.length&&(o=[o]),e.on("PreInit",function(){o&&e.on("BeforeSetContent",n),e.parser.addAttributeFilter("class",function(e){for(var t,n=e.length;n--;)t=e[n],s(t)?t.attr(a,"true"):l(t)&&t.attr(a,"false")}),e.serializer.addAttributeFilter(a,function(e){for(var t,n=e.length;n--;)t=e[n],(s(t)||l(t))&&(o&&t.attr("data-mce-content")?(t.name="#text",t.type=3,t.raw=!0,t.value=t.attr("data-mce-content")):t.attr(a,null))})})});

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tinymce-rails-4.5.7 vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js
tinymce-rails-4.5.6 vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js
tinymce-rails-4.5.5 vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js
tinymce-rails-4.5.4 vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js
tinymce-rails-4.5.3 vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js
tinymce-rails-4.5.2 vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js
tinymce-rails-4.5.1 vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js