ui.editor.DefaultToolbar

Classes


Public Protected Private

Global Functions

goog.ui.editor.DefaultToolbar.addDefaultFontSizes(button)
Initializes the given font size menu button by adding default font sizes to it.
Arguments:
button : !goog.ui.Select
Font size menu button.
code »
goog.ui.editor.DefaultToolbar.addDefaultFonts(button)
Initializes the given font menu button by adding default fonts to the menu. If goog.ui.editor.DefaultToolbar.setLocale was called to specify a locale for which locale-specific default fonts exist, those are added before common fonts.
Arguments:
button : !goog.ui.Select
Font menu button.
code »
goog.ui.editor.DefaultToolbar.addDefaultFormatOptions(button)
Initializes the given "Format block" menu button by adding default format options to the menu.
Arguments:
button : !goog.ui.Select
"Format block" menu button.
code »
goog.ui.editor.DefaultToolbar.backgroundColorFactory_(idtooltipcaptionopt_classNamesopt_rendereropt_domHelper) !goog.ui.Button
Creates a toolbar button with the given ID, tooltip, and caption. Applies any custom CSS class names to the button's caption element. Use to create a font background color button.
Arguments:
id : string
Button ID; must equal a goog.editor.Command for built-in buttons, anything else for custom buttons.
tooltip : string
Tooltip to be shown on hover.
caption : goog.ui.ControlContent
Button caption.
opt_classNames : string=
CSS class name(s) to apply to the caption element.
opt_renderer : goog.ui.ColorMenuButtonRenderer=
Button renderer; defaults to goog.ui.ToolbarColorMenuButtonRenderer if unspecified.
opt_domHelper : goog.dom.DomHelper=
DOM helper, used for DOM creation; defaults to the current document if unspecified.
Returns: !goog.ui.Button  A toolbar button.
code »
goog.ui.editor.DefaultToolbar.colorUpdateFromValue_(buttoncolor)
Function to update the state of a color menu button.
Arguments:
button : goog.ui.ToolbarColorMenuButton
The button to which the color menu is attached.
color : number
Color value to update to.
code »
goog.ui.editor.DefaultToolbar.fontColorFactory_(idtooltipcaptionopt_classNamesopt_rendereropt_domHelper) !goog.ui.Button
Creates a toolbar button with the given ID, tooltip, and caption. Applies any custom CSS class names to the button's caption element. Use to create a font color button.
Arguments:
id : string
Button ID; must equal a goog.editor.Command for built-in buttons, anything else for custom buttons.
tooltip : string
Tooltip to be shown on hover.
caption : goog.ui.ControlContent
Button caption.
opt_classNames : string=
CSS class name(s) to apply to the caption element.
opt_renderer : goog.ui.ColorMenuButtonRenderer=
Button renderer; defaults to goog.ui.ToolbarColorMenuButtonRenderer if unspecified.
opt_domHelper : goog.dom.DomHelper=
DOM helper, used for DOM creation; defaults to the current document if unspecified.
Returns: !goog.ui.Button  A toolbar button.
code »
goog.ui.editor.DefaultToolbar.fontFaceFactory_(idtooltipcaptionopt_classNamesopt_rendereropt_domHelper) !goog.ui.Button
Creates a toolbar button with the given ID, tooltip, and caption. Applies any custom CSS class names to the button's caption element. Used to create a font face button, filled with default fonts.
Arguments:
id : string
Button ID; must equal a goog.editor.Command for built-in buttons, anything else for custom buttons.
tooltip : string
Tooltip to be shown on hover.
caption : goog.ui.ControlContent
Button caption.
opt_classNames : string=
CSS class name(s) to apply to the caption element.
opt_renderer : goog.ui.MenuButtonRenderer=
Button renderer; defaults to goog.ui.ToolbarMenuButtonRenderer if unspecified.
opt_domHelper : goog.dom.DomHelper=
DOM helper, used for DOM creation; defaults to the current document if unspecified.
Returns: !goog.ui.Button  A toolbar button.
code »
goog.ui.editor.DefaultToolbar.fontSizeFactory_(idtooltipcaptionopt_classNamesopt_rendereropt_domHelper) !goog.ui.Button
Creates a toolbar button with the given ID, tooltip, and caption. Applies any custom CSS class names to the button's caption element. Use to create a font size button, filled with default font sizes.
Arguments:
id : string
Button ID; must equal a goog.editor.Command for built-in buttons, anything else for custom buttons.
tooltip : string
Tooltip to be shown on hover.
caption : goog.ui.ControlContent
Button caption.
opt_classNames : string=
CSS class name(s) to apply to the caption element.
opt_renderer : goog.ui.MenuButtonRenderer=
Button renderer; defaults to goog.ui.ToolbarMebuButtonRenderer if unspecified.
opt_domHelper : goog.dom.DomHelper=
DOM helper, used for DOM creation; defaults to the current document if unspecified.
Returns: !goog.ui.Button  A toolbar button.
code »
goog.ui.editor.DefaultToolbar.formatBlockFactory_(idtooltipcaptionopt_classNamesopt_rendereropt_domHelper) !goog.ui.Button
Creates a toolbar button with the given ID, tooltip, and caption. Applies any custom CSS class names to the button's caption element. Use to create the format menu, prefilled with default formats.
Arguments:
id : string
Button ID; must equal a goog.editor.Command for built-in buttons, anything else for custom buttons.
tooltip : string
Tooltip to be shown on hover.
caption : goog.ui.ControlContent
Button caption.
opt_classNames : string=
CSS class name(s) to apply to the caption element.
opt_renderer : goog.ui.MenuButtonRenderer=
Button renderer; defaults to goog.ui.ToolbarMenuButtonRenderer if unspecified.
opt_domHelper : goog.dom.DomHelper=
DOM helper, used for DOM creation; defaults to the current document if unspecified.
Returns: !goog.ui.Button  A toolbar button.
code »
goog.ui.editor.DefaultToolbar.makeBuiltInToolbarButton(commandopt_domHelper) goog.ui.Button
Creates an instance of a subclass of goog.ui.Button for the given goog.editor.Command, or null if no built-in button exists for the command. Note that this function is only intended to create built-in buttons; please don't try to hack it!
Arguments:
command : string
Editor command ID.
opt_domHelper : goog.dom.DomHelper=
DOM helper, used for DOM creation; defaults to the current document if unspecified.
Returns: goog.ui.Button  Toolbar button (null if no built-in button exists for the command).
code »
goog.ui.editor.DefaultToolbar.makeDefaultToolbar(elemopt_isRightToLeft) !goog.ui.Toolbar
Creates a goog.ui.Toolbar containing a default set of editor toolbar buttons, and renders it into the given parent element.
Arguments:
elem : !Element
Toolbar parent element.
opt_isRightToLeft : boolean=
Whether the editor chrome is right-to-left; defaults to the directionality of the toolbar parent element.
Returns: !goog.ui.Toolbar  Default editor toolbar, rendered into the given parent element.
code »
goog.ui.editor.DefaultToolbar.makeToolbar(itemselemopt_isRightToLeft) !goog.ui.Toolbar
Creates a goog.ui.Toolbar containing the specified set of toolbar buttons, and renders it into the given parent element. Each item in the items array must either be a goog.editor.Command (to create a built-in button) or a subclass of goog.ui.Control (to create a custom control).
Arguments:
items : !Array.<string | goog.ui.Control>
Toolbar items; each must be a goog.editor.Command or a goog.ui.Control.
elem : !Element
Toolbar parent element.
opt_isRightToLeft : boolean=
Whether the editor chrome is right-to-left; defaults to the directionality of the toolbar parent element.
Returns: !goog.ui.Toolbar  Editor toolbar, rendered into the given parent element.
code »
goog.ui.editor.DefaultToolbar.rtlButtonFactory_(idtooltipcaptionopt_classNamesopt_rendereropt_domHelper) !goog.ui.Button
Creates a toolbar button with the given ID, tooltip, and caption. Applies any custom CSS class names to the button's caption element. This button is designed to be used as the RTL button.
Arguments:
id : string
Button ID; must equal a goog.editor.Command for built-in buttons, anything else for custom buttons.
tooltip : string
Tooltip to be shown on hover.
caption : goog.ui.ControlContent
Button caption.
opt_classNames : string=
CSS class name(s) to apply to the caption element.
opt_renderer : goog.ui.ButtonRenderer=
Button renderer; defaults to goog.ui.ToolbarButtonRenderer if unspecified.
opt_domHelper : goog.dom.DomHelper=
DOM helper, used for DOM creation; defaults to the current document if unspecified.
Returns: !goog.ui.Button  A toolbar button.
code »
goog.ui.editor.DefaultToolbar.setLocale(locale)
Sets the locale for the font names. If not set, defaults to 'en-us'. Used only for default creation of font names name. Must be set before font name menu is created.
Arguments:
locale : string
Locale to use for the toolbar font names.
code »
goog.ui.editor.DefaultToolbar.undoRedoButtonFactory_(idtooltipcaptionopt_classNamesopt_rendereropt_domHelper) !goog.ui.Button
Creates a toolbar button with the given ID, tooltip, and caption. Applies any custom CSS class names to the button's caption element. Designed to be used to create undo and redo buttons.
Arguments:
id : string
Button ID; must equal a goog.editor.Command for built-in buttons, anything else for custom buttons.
tooltip : string
Tooltip to be shown on hover.
caption : goog.ui.ControlContent
Button caption.
opt_classNames : string=
CSS class name(s) to apply to the caption element.
opt_renderer : goog.ui.ButtonRenderer=
Button renderer; defaults to goog.ui.ToolbarButtonRenderer if unspecified.
opt_domHelper : goog.dom.DomHelper=
DOM helper, used for DOM creation; defaults to the current document if unspecified.
Returns: !goog.ui.Button  A toolbar button.
code »

Global Properties

goog.ui.editor.DefaultToolbar.BUTTONS_ :
Built-in toolbar button descriptors. See goog.ui.editor.DefaultToolbar.buttons_ for details on button descriptor objects. This array is processed at JS parse time; each item is inserted into goog.ui.editor.DefaultToolbar.buttons_, and the array itself is deleted and (hopefully) garbage-collected.
Code »
goog.ui.editor.DefaultToolbar.DEFAULT_BUTTONS :
A set of built-in buttons to display in the default editor toolbar.
Code »
goog.ui.editor.DefaultToolbar.DEFAULT_BUTTONS_RTL :
A set of built-in buttons to display in the default editor toolbar when the editor chrome is right-to-left (BiDi mode only).
Code »
goog.ui.editor.DefaultToolbar.FONTS_ :
Common font descriptors for all locales. Each descriptor has the following attributes:
  • caption - Caption to show in the font menu (e.g. 'Tahoma')
  • value - Value for the corresponding 'font-family' CSS style (e.g. 'Tahoma, Arial, sans-serif')
Code »
goog.ui.editor.DefaultToolbar.FONT_SIZES_ :
Font size descriptors, each with the following attributes:
  • caption - Caption to show in the font size menu (e.g. 'Huge')
  • value - Value for the corresponding HTML font size (e.g. 6)
Code »
goog.ui.editor.DefaultToolbar.FORMAT_OPTIONS_ :
Format option descriptors, each with the following attributes:
  • caption - Caption to show in the menu (e.g. 'Minor heading')
  • command - Corresponding goog.dom.TagName (e.g. 'H4')
Code »
goog.ui.editor.DefaultToolbar.I18N_FONTS_ :
Locale-specific font descriptors. The object is a map of locale strings to arrays of font descriptors.
Code »
goog.ui.editor.DefaultToolbar.MSG_ALIGN_CENTER_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_ALIGN_LEFT_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_ALIGN_RIGHT_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_BACKGROUND_COLOR_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_BLOCKQUOTE_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_BOLD_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_DIR_LTR_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_DIR_RTL_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_EDIT_HTML_CAPTION :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_EDIT_HTML_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_FONT_COLOR_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_FONT_FACE_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_FONT_NORMAL :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_FONT_NORMAL_SERIF :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_FONT_SIZE_HUGE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_FONT_SIZE_LARGE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_FONT_SIZE_NORMAL :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_FONT_SIZE_SMALL :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_FONT_SIZE_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_FORMAT_BLOCK_CAPTION :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_FORMAT_BLOCK_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_FORMAT_HEADING :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_FORMAT_MINOR_HEADING :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_FORMAT_NORMAL :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_FORMAT_SUBHEADING :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_IMAGE_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_INDENT_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_ITALIC_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_JUSTIFY_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_LINK_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_ORDERED_LIST_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_OUTDENT_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_REDO_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_REMOVE_FORMAT_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_STRIKE_THROUGH_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_SUBSCRIPT :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_SUPERSCRIPT :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_UNDERLINE_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_UNDO_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.MSG_UNORDERED_LIST_TITLE :
No description.
Code »
goog.ui.editor.DefaultToolbar.buttons_ :
Map of goog.editor.Commands to toolbar button descriptor objects, each of which has the following attributes:
  • command - The command corresponding to the button (mandatory)
  • tooltip - Tooltip text (optional); if unspecified, the button has no hover text
  • caption - Caption to display on the button (optional); if unspecified, the button has no text caption
  • classes - CSS class name(s) to be applied to the button's element when rendered (optional); if unspecified, defaults to 'tr-icon' plus 'tr-' followed by the command ID, but without any leading '+' character (e.g. if the command ID is '+undo', then classes defaults to 'tr-icon tr-undo')
  • factory - factory function used to create the button, which must accept id, tooltip, caption, and classes as arguments, and must return an instance of goog.ui.Button or an appropriate subclass (optional); if unspecified, defaults to goog.ui.editor.DefaultToolbar.makeToggleButton, since most built-in toolbar buttons are toggle buttons
  • (@code queryable} - Whether the button's state should be queried when updating the toolbar (optional).
Note that this object is only used for creating toolbar buttons for built-in editor commands; custom buttons aren't listed here. Please don't try to hack this!
Code »
goog.ui.editor.DefaultToolbar.locale_ :
Default locale for font names.
Code »

Package ui.editor

Package Reference