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