Sha256: 124a3d76094beb920168fb1f902ff0095c91392cfbeb0745076d6cc1f4863e59

Contents?: true

Size: 957 Bytes

Versions: 2

Compression:

Stored size: 957 Bytes

Contents

tinymce.PluginManager.add("anchor",function(e){var t=function(e){return!e.attr("href")&&(e.attr("id")||e.attr("name"))&&!e.firstChild},n=function(e){return function(n){for(var r=0;r<n.length;r++)t(n[r])&&n[r].attr("contenteditable",e)}},r=function(){var t=e.selection.getNode(),n="A"==t.tagName&&""===e.dom.getAttrib(t,"href"),r="";n&&(r=t.id||t.name||""),e.windowManager.open({title:"Anchor",body:{type:"textbox",name:"id",size:40,label:"Id",value:r},onsubmit:function(r){var i=r.data.id;n?(t.removeAttribute("name"),t.id=i):(e.selection.collapse(!0),e.execCommand("mceInsertContent",!1,e.dom.createHTML("a",{id:i})))}})};tinymce.Env.ceFalse&&e.on("PreInit",function(){e.parser.addNodeFilter("a",n("false")),e.serializer.addNodeFilter("a",n(null))}),e.addCommand("mceAnchor",r),e.addButton("anchor",{icon:"anchor",tooltip:"Anchor",onclick:r,stateSelector:"a:not([href])"}),e.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",onclick:r})});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tinymce-rails-4.5.2 vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js
tinymce-rails-4.5.1 vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js