Path: blob/trunk/third_party/closure/goog/editor/command.js
2868 views
// Copyright 2009 The Closure Library Authors. All Rights Reserved.1//2// Licensed under the Apache License, Version 2.0 (the "License");3// you may not use this file except in compliance with the License.4// You may obtain a copy of the License at5//6// http://www.apache.org/licenses/LICENSE-2.07//8// Unless required by applicable law or agreed to in writing, software9// distributed under the License is distributed on an "AS-IS" BASIS,10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.11// See the License for the specific language governing permissions and12// limitations under the License.1314/**15* @fileoverview Commands that the editor can execute.16* @see ../demos/editor/editor.html17*/18goog.provide('goog.editor.Command');192021/**22* Commands that the editor can excute via execCommand or queryCommandValue.23* @enum {string}24*/25goog.editor.Command = {26// Prepend all the strings of built in execCommands with a plus to ensure27// that there's no conflict if a client wants to use the28// browser's execCommand.29UNDO: '+undo',30REDO: '+redo',31LINK: '+link',32FORMAT_BLOCK: '+formatBlock',33INDENT: '+indent',34OUTDENT: '+outdent',35REMOVE_FORMAT: '+removeFormat',36STRIKE_THROUGH: '+strikeThrough',37HORIZONTAL_RULE: '+insertHorizontalRule',38SUBSCRIPT: '+subscript',39SUPERSCRIPT: '+superscript',40UNDERLINE: '+underline',41BOLD: '+bold',42ITALIC: '+italic',43FONT_SIZE: '+fontSize',44FONT_FACE: '+fontName',45FONT_COLOR: '+foreColor',46EMOTICON: '+emoticon',47EQUATION: '+equation',48BACKGROUND_COLOR: '+backColor',49ORDERED_LIST: '+insertOrderedList',50UNORDERED_LIST: '+insertUnorderedList',51TABLE: '+table',52JUSTIFY_CENTER: '+justifyCenter',53JUSTIFY_FULL: '+justifyFull',54JUSTIFY_RIGHT: '+justifyRight',55JUSTIFY_LEFT: '+justifyLeft',56BLOCKQUOTE: '+BLOCKQUOTE', // This is a nodename. Should be all caps.57DIR_LTR: 'ltr', // should be exactly 'ltr' as it becomes dir attribute value58DIR_RTL: 'rtl', // same here59IMAGE: 'image',60EDIT_HTML: 'editHtml',61UPDATE_LINK_BUBBLE: 'updateLinkBubble',6263// queryCommandValue only: returns the default tag name used in the field.64// DIV should be considered the default if no plugin responds.65DEFAULT_TAG: '+defaultTag',6667// TODO(nicksantos): Try to give clients an API so that they don't need68// these execCommands.69CLEAR_LOREM: 'clearlorem',70UPDATE_LOREM: 'updatelorem',71USING_LOREM: 'usinglorem',7273// Modal editor commands (usually dialogs).74MODAL_LINK_EDITOR: 'link'75};767778