mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-10 22:58:33 +02:00
Built from https://develop.svn.wordpress.org/trunk@31714 git-svn-id: http://core.svn.wordpress.org/trunk@31695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 line
745 B
JavaScript
1 line
745 B
JavaScript
tinymce.PluginManager.add("wplink",function(a){a.addCommand("WP_Link",function(){window.wpLink&&window.wpLink.open(a.id)}),a.addShortcut("Alt+Shift+A","","WP_Link"),a.addShortcut("Meta+K","","WP_Link"),a.addButton("link",{icon:"link",tooltip:"Insert/edit link",cmd:"WP_Link",stateSelector:"a[href]"}),a.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink"}),a.addMenuItem("link",{icon:"link",text:"Insert link",cmd:"WP_Link",stateSelector:"a[href]",context:"insert",prependToContext:!0}),a.on("pastepreprocess",function(b){var c=b.content;a.selection.isCollapsed()||(c=c.replace(/<[^>]+>/g,""),c=tinymce.trim(c),/^(?:https?:)?\/\/\S+$/i.test(c)&&(a.execCommand("mceInsertLink",!1,{href:a.dom.decode(c)}),b.preventDefault()))})}); |