[ Index ]
 

Code source de Joomla 1.0.13

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/ -> editor_plugin_src.js (source)

   1  /**

   2   * $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $

   3   *

   4   * @author Moxiecode

   5   * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.

   6   */
   7  
   8  /* Import plugin specific language pack */

   9  tinyMCE.importPluginLanguagePack('style');
  10  
  11  var TinyMCE_StylePlugin = {
  12      getInfo : function() {
  13          return {
  14              longname : 'Style',
  15              author : 'Moxiecode Systems AB',
  16              authorurl : 'http://tinymce.moxiecode.com',
  17              infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_style.html',
  18              version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
  19          };
  20      },
  21  
  22      getControlHTML : function(cn) {
  23          switch (cn) {
  24              case "styleprops":
  25                  return tinyMCE.getButtonHTML(cn, 'lang_style_styleinfo_desc', '{$pluginurl}/images/styleprops.gif', 'mceStyleProps', true);
  26          }
  27  
  28          return "";
  29      },
  30  
  31      execCommand : function(editor_id, element, command, user_interface, value) {
  32          var e, inst;
  33  
  34          // Handle commands

  35          switch (command) {
  36              case "mceStyleProps":
  37                  TinyMCE_StylePlugin._styleProps();
  38                  return true;
  39  
  40              case "mceSetElementStyle":
  41                  inst = tinyMCE.getInstanceById(editor_id);
  42                  e = inst.selection.getFocusElement();
  43  
  44                  if (e) {
  45                      e.style.cssText = value;
  46                      inst.repaint();
  47                  }
  48  
  49                  return true;
  50          }
  51  
  52          // Pass to next handler in chain

  53          return false;
  54      },
  55  
  56      handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
  57      },
  58  
  59      // Private plugin specific methods

  60  
  61      _styleProps : function() {
  62          var e = tinyMCE.selectedInstance.selection.getFocusElement();
  63  
  64          if (!e)
  65              return;
  66  
  67          tinyMCE.openWindow({
  68              file : '../../plugins/style/props.htm',
  69              width : 480 + tinyMCE.getLang('lang_style_props_delta_width', 0),
  70              height : 320 + tinyMCE.getLang('lang_style_props_delta_height', 0)
  71          }, {
  72              editor_id : tinyMCE.selectedInstance.editorId,
  73              inline : "yes",
  74              style_text : e.style.cssText
  75          });
  76      }
  77  };
  78  
  79  tinyMCE.addPlugin("style", TinyMCE_StylePlugin);


Généré le : Wed Nov 21 14:43:32 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics