[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/tinymce/plugins/wplink/ -> editor_plugin.dev.js (source)

   1  (function() {
   2      tinymce.create('tinymce.plugins.wpLink', {
   3          /**
   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 it's initialization so use the onInit event
   6           * of the editor instance to intercept that event.
   7           *
   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.
  10           */
  11          init : function(ed, url) {
  12              var disabled = true;
  13  
  14              // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
  15              ed.addCommand('WP_Link', function() {
  16                  if ( disabled )
  17                      return;
  18                  ed.windowManager.open({
  19                      id : 'wp-link',
  20                      width : 480,
  21                      height : "auto",
  22                      wpDialog : true,
  23                      title : ed.getLang('advlink.link_desc')
  24                  }, {
  25                      plugin_url : url // Plugin absolute URL
  26                  });
  27              });
  28  
  29              // Register example button
  30              ed.addButton('link', {
  31                  title : ed.getLang('advanced.link_desc'),
  32                  cmd : 'WP_Link'
  33              });
  34  
  35              ed.addShortcut('alt+shift+a', ed.getLang('advanced.link_desc'), 'WP_Link');
  36  
  37              ed.onNodeChange.add(function(ed, cm, n, co) {
  38                  disabled = co && n.nodeName != 'A';
  39              });
  40          },
  41          /**
  42           * Returns information about the plugin as a name/value array.
  43           * The current keys are longname, author, authorurl, infourl and version.
  44           *
  45           * @return {Object} Name/value array containing information about the plugin.
  46           */
  47          getInfo : function() {
  48              return {
  49                  longname : 'WordPress Link Dialog',
  50                  author : 'WordPress',
  51                  authorurl : 'http://wordpress.org',
  52                  infourl : '',
  53                  version : "1.0"
  54              };
  55          }
  56      });
  57  
  58      // Register plugin
  59      tinymce.PluginManager.add('wplink', tinymce.plugins.wpLink);
  60  })();


Generated: Sat Feb 18 03:55:58 2012 Hosted by follow the white rabbit.