WordPress/wp-includes/js/tinymce/plugins/wplink/plugin.min.js
Andrew Ozz 6f1668c43d TinyMCE:
- Restore the "link" button state to disabled by default and enabled when text or image is selected.
- Remove the (recently added) default `link` plugin, not needed for `wpLink`.
See #27309
Built from https://develop.svn.wordpress.org/trunk@27447


git-svn-id: http://core.svn.wordpress.org/trunk@27293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-07 02:02:13 +00:00

1 line
669 B
JavaScript

tinymce.PluginManager.add("wplink",function(a){a.addCommand("WP_Link",function(){"undefined"!=typeof window.wpLink&&window.wpLink.open(a.id)}),a.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Alt+Shift+A",cmd:"WP_Link",onPostRender:function(){var b=this;a.on("nodechange",function(c){var d=c.element;b.disabled(a.selection.isCollapsed()&&"A"!==d.nodeName),b.active("A"===d.nodeName&&!d.name)})}}),a.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink",stateSelector:"a[href]"}),a.addMenuItem("link",{icon:"link",text:"Insert link",shortcut:"Alt+Shift+A",cmd:"WP_Link",stateSelector:"a[href]",context:"insert",prependToContext:!0})});