[ Index ]
 

Code source de FCKeditor 2.4

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/editor/_source/internals/ -> fckcommands.js (source)

   1  /*
   2   * FCKeditor - The text editor for Internet - http://www.fckeditor.net
   3   * Copyright (C) 2003-2007 Frederico Caldeira Knabben
   4   * 
   5   * == BEGIN LICENSE ==
   6   * 
   7   * Licensed under the terms of any of the following licenses at your
   8   * choice:
   9   * 
  10   *  - GNU General Public License Version 2 or later (the "GPL")
  11   *    http://www.gnu.org/licenses/gpl.html
  12   * 
  13   *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
  14   *    http://www.gnu.org/licenses/lgpl.html
  15   * 
  16   *  - Mozilla Public License Version 1.1 or later (the "MPL")
  17   *    http://www.mozilla.org/MPL/MPL-1.1.html
  18   * 
  19   * == END LICENSE ==
  20   * 
  21   * File Name: fckcommands.js
  22   *     Define all commands available in the editor.
  23   * 
  24   * File Authors:
  25   *         Frederico Caldeira Knabben (www.fckeditor.net)
  26   */
  27  
  28  var FCKCommands = FCK.Commands = new Object() ;
  29  FCKCommands.LoadedCommands = new Object() ;
  30  
  31  FCKCommands.RegisterCommand = function( commandName, command )
  32  {
  33      this.LoadedCommands[ commandName ] = command ;
  34  }
  35  
  36  FCKCommands.GetCommand = function( commandName )
  37  {
  38      var oCommand = FCKCommands.LoadedCommands[ commandName ] ;
  39      
  40      if ( oCommand )
  41          return oCommand ;
  42  
  43      switch ( commandName )
  44      {
  45          case 'DocProps'        : oCommand = new FCKDialogCommand( 'DocProps'    , FCKLang.DocProps                , 'dialog/fck_docprops.html'    , 400, 390, FCKCommands.GetFullPageState ) ; break ;
  46          case 'Templates'    : oCommand = new FCKDialogCommand( 'Templates'    , FCKLang.DlgTemplatesTitle        , 'dialog/fck_template.html'    , 380, 450 ) ; break ;
  47          case 'Link'            : oCommand = new FCKDialogCommand( 'Link'        , FCKLang.DlgLnkWindowTitle        , 'dialog/fck_link.html'        , 400, 330 ) ; break ;
  48          case 'Unlink'        : oCommand = new FCKUnlinkCommand() ; break ;
  49          case 'Anchor'        : oCommand = new FCKDialogCommand( 'Anchor'        , FCKLang.DlgAnchorTitle        , 'dialog/fck_anchor.html'        , 370, 170 ) ; break ;
  50          case 'BulletedList'    : oCommand = new FCKDialogCommand( 'BulletedList', FCKLang.BulletedListProp        , 'dialog/fck_listprop.html?UL'    , 370, 170 ) ; break ;
  51          case 'NumberedList'    : oCommand = new FCKDialogCommand( 'NumberedList', FCKLang.NumberedListProp        , 'dialog/fck_listprop.html?OL'    , 370, 170 ) ; break ;
  52          case 'About'        : oCommand = new FCKDialogCommand( 'About'        , FCKLang.About                    , 'dialog/fck_about.html'        , 400, 330 ) ; break ;
  53  
  54          case 'Find'            : oCommand = new FCKDialogCommand( 'Find'        , FCKLang.DlgFindTitle            , 'dialog/fck_find.html'        , 340, 170 ) ; break ;
  55          case 'Replace'        : oCommand = new FCKDialogCommand( 'Replace'    , FCKLang.DlgReplaceTitle        , 'dialog/fck_replace.html'        , 340, 200 ) ; break ;
  56  
  57          case 'Image'        : oCommand = new FCKDialogCommand( 'Image'        , FCKLang.DlgImgTitle            , 'dialog/fck_image.html'        , 450, 400 ) ; break ;
  58          case 'Flash'        : oCommand = new FCKDialogCommand( 'Flash'        , FCKLang.DlgFlashTitle            , 'dialog/fck_flash.html'        , 450, 400 ) ; break ;
  59          case 'SpecialChar'    : oCommand = new FCKDialogCommand( 'SpecialChar', FCKLang.DlgSpecialCharTitle    , 'dialog/fck_specialchar.html'    , 400, 320 ) ; break ;
  60          case 'Smiley'        : oCommand = new FCKDialogCommand( 'Smiley'        , FCKLang.DlgSmileyTitle        , 'dialog/fck_smiley.html'        , FCKConfig.SmileyWindowWidth, FCKConfig.SmileyWindowHeight ) ; break ;
  61          case 'Table'        : oCommand = new FCKDialogCommand( 'Table'        , FCKLang.DlgTableTitle            , 'dialog/fck_table.html'        , 450, 250 ) ; break ;
  62          case 'TableProp'    : oCommand = new FCKDialogCommand( 'Table'        , FCKLang.DlgTableTitle            , 'dialog/fck_table.html?Parent', 400, 250 ) ; break ;
  63          case 'TableCellProp': oCommand = new FCKDialogCommand( 'TableCell'    , FCKLang.DlgCellTitle            , 'dialog/fck_tablecell.html'    , 550, 250 ) ; break ;
  64  
  65          case 'Style'        : oCommand = new FCKStyleCommand() ; break ;
  66  
  67          case 'FontName'        : oCommand = new FCKFontNameCommand() ; break ;
  68          case 'FontSize'        : oCommand = new FCKFontSizeCommand() ; break ;
  69          case 'FontFormat'    : oCommand = new FCKFormatBlockCommand() ; break ;
  70  
  71          case 'Source'        : oCommand = new FCKSourceCommand() ; break ;
  72          case 'Preview'        : oCommand = new FCKPreviewCommand() ; break ;
  73          case 'Save'            : oCommand = new FCKSaveCommand() ; break ;
  74          case 'NewPage'        : oCommand = new FCKNewPageCommand() ; break ;
  75          case 'PageBreak'    : oCommand = new FCKPageBreakCommand() ; break ;
  76  
  77          case 'TextColor'    : oCommand = new FCKTextColorCommand('ForeColor') ; break ;
  78          case 'BGColor'        : oCommand = new FCKTextColorCommand('BackColor') ; break ;
  79  
  80          case 'PasteText'    : oCommand = new FCKPastePlainTextCommand() ; break ;
  81          case 'PasteWord'    : oCommand = new FCKPasteWordCommand() ; break ;
  82  
  83          case 'TableInsertRow'        : oCommand = new FCKTableCommand('TableInsertRow') ; break ;
  84          case 'TableDeleteRows'        : oCommand = new FCKTableCommand('TableDeleteRows') ; break ;
  85          case 'TableInsertColumn'    : oCommand = new FCKTableCommand('TableInsertColumn') ; break ;
  86          case 'TableDeleteColumns'    : oCommand = new FCKTableCommand('TableDeleteColumns') ; break ;
  87          case 'TableInsertCell'        : oCommand = new FCKTableCommand('TableInsertCell') ; break ;
  88          case 'TableDeleteCells'        : oCommand = new FCKTableCommand('TableDeleteCells') ; break ;
  89          case 'TableMergeCells'        : oCommand = new FCKTableCommand('TableMergeCells') ; break ;
  90          case 'TableSplitCell'        : oCommand = new FCKTableCommand('TableSplitCell') ; break ;
  91          case 'TableDelete'            : oCommand = new FCKTableCommand('TableDelete') ; break ;
  92  
  93          case 'Form'            : oCommand = new FCKDialogCommand( 'Form'        , FCKLang.Form            , 'dialog/fck_form.html'        , 380, 230 ) ; break ;
  94          case 'Checkbox'        : oCommand = new FCKDialogCommand( 'Checkbox'    , FCKLang.Checkbox        , 'dialog/fck_checkbox.html'    , 380, 230 ) ; break ;
  95          case 'Radio'        : oCommand = new FCKDialogCommand( 'Radio'        , FCKLang.RadioButton    , 'dialog/fck_radiobutton.html'    , 380, 230 ) ; break ;
  96          case 'TextField'    : oCommand = new FCKDialogCommand( 'TextField'    , FCKLang.TextField        , 'dialog/fck_textfield.html'    , 380, 230 ) ; break ;
  97          case 'Textarea'        : oCommand = new FCKDialogCommand( 'Textarea'    , FCKLang.Textarea        , 'dialog/fck_textarea.html'    , 380, 230 ) ; break ;
  98          case 'HiddenField'    : oCommand = new FCKDialogCommand( 'HiddenField', FCKLang.HiddenField    , 'dialog/fck_hiddenfield.html'    , 380, 230 ) ; break ;
  99          case 'Button'        : oCommand = new FCKDialogCommand( 'Button'        , FCKLang.Button        , 'dialog/fck_button.html'        , 380, 230 ) ; break ;
 100          case 'Select'        : oCommand = new FCKDialogCommand( 'Select'        , FCKLang.SelectionField, 'dialog/fck_select.html'        , 400, 380 ) ; break ;
 101          case 'ImageButton'    : oCommand = new FCKDialogCommand( 'ImageButton', FCKLang.ImageButton    , 'dialog/fck_image.html?ImageButton', 450, 400 ) ; break ;
 102  
 103          case 'SpellCheck'    : oCommand = new FCKSpellCheckCommand() ; break ;
 104          case 'FitWindow'    : oCommand = new FCKFitWindow() ; break ;
 105  
 106          case 'Undo'    : oCommand = new FCKUndoCommand() ; break ;
 107          case 'Redo'    : oCommand = new FCKRedoCommand() ; break ;
 108          
 109          case 'SelectAll' : oCommand = new FCKSelectAllCommand() ; break ;
 110  
 111          // Generic Undefined command (usually used when a command is under development).
 112          case 'Undefined'    : oCommand = new FCKUndefinedCommand() ; break ;
 113          
 114          // By default we assume that it is a named command.
 115          default:
 116              if ( FCKRegexLib.NamedCommands.test( commandName ) )
 117                  oCommand = new FCKNamedCommand( commandName ) ;
 118              else
 119              {
 120                  alert( FCKLang.UnknownCommand.replace( /%1/g, commandName ) ) ;
 121                  return null ;
 122              }
 123      }
 124      
 125      FCKCommands.LoadedCommands[ commandName ] = oCommand ;
 126      
 127      return oCommand ;
 128  }
 129  
 130  // Gets the state of the "Document Properties" button. It must be enabled only
 131  // when "Full Page" editing is available.
 132  FCKCommands.GetFullPageState = function()
 133  {
 134      return FCKConfig.FullPage ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
 135  }


Généré le : Sun Feb 25 15:28:05 2007 par Balluche grâce à PHPXref 0.7