4 tinymce.create('tinymce.plugins.wpLink', {
6 * Initializes the plugin, this will be executed after the plugin has been created.
7 * This call is done before the editor instance has finished its initialization so use the onInit event
8 * of the editor instance to intercept that event.
10 * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
11 * @param {string} url Absolute URL to where the plugin is located.
13 init : function(ed, url) {
16 // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
17 ed.addCommand('WP_Link', function() {
20 ed.windowManager.open({
25 title : ed.getLang('advlink.link_desc')
27 plugin_url : url // Plugin absolute URL
31 // Register example button
32 ed.addButton('link', {
33 title : 'advanced.link_desc',
37 ed.onNodeChange.add(function(ed, cm, n, co) {
38 disabled = co && n.nodeName != 'A';
42 * Returns information about the plugin as a name/value array.
43 * The current keys are longname, author, authorurl, infourl and version.
45 * @return {Object} Name/value array containing information about the plugin.
47 getInfo : function() {
49 longname : 'WordPress Link Dialog',
51 authorurl : 'http://wordpress.org',
59 tinymce.PluginManager.add('wplink', tinymce.plugins.wpLink);