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