- md5
- 76bd5bbf6dd69ef9a02cf6c0ed45453d
- sha1
- 1eba55f136f8e279941dcf74b711426543e56fb9
- sha256
- 9d6a97f6768632cf1885765cdab0d4f895498cdced14d4f74e78ca13978e2e83
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
/* global tinymce */
(function() {
tinymce.create('tinymce.plugins.wpLink', {
/**
* Initializes the plugin, this will be executed after the plugin has been created.
* This call is done before the editor instance has finished its initialization so use the onInit event
* of the editor instance to intercept that event.
*
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
* @param {string} url Absolute URL to where the plugin is located.
*/
init : function(ed, url) {
var disabled = true;
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
ed.addCommand('WP_Link', function() {
if ( disabled )
return;
ed.windowManager.open({
id : 'wp-link',
width : 480,
height : 'auto',
wpDialog : true,
title : ed.getLang('advlink.link_desc')
}, {
plugin_url : url // Plugin absolute URL
});
});
// Register example button
ed.addButton('link', {
title : 'advanced.link_desc',
cmd : 'WP_Link'
});
ed.onNodeChange.add(function(ed, cm, n, co) {
disabled = co && n.nodeName != 'A';
});
},
/**
* Returns information about the plugin as a name/value array.
* The current keys are longname, author, authorurl, infourl and version.
*
* @return {Object} Name/value array containing information about the plugin.
*/
getInfo : function() {
return {
longname : 'WordPress Link Dialog',
author : 'WordPress',
authorurl : 'http://wordpress.org',
infourl : '',
version : '1.0'
};
}
});
// Register plugin
tinymce.PluginManager.add('wplink', tinymce.plugins.wpLink);
})();
The same content is in 46 releases, WordPress 3.8-beta-1 to 3.8.41. See them all, or every version of this file.