Javascript for Episerver 7.5 cms

ContentAreaEditor (constructor)


Editor for ContentArea to be able to edit my content area property in forms mode This should be a simple, non WYSIWYG listing of the inner content blocks with possibilities to add, remove and rearrange the content.







Path to a blank 1x1 image. Used by <img> nodes in templates that really get their image via CSS background-image.






A fallback to preserve the 1.0 - 1.3 behavior of children in templates having their startup called before the parent widget fires postCreate. Defaults to 'false', causing child widgets to have their .startup() called immediately before a parent widget .startup(), but always after the parent .postCreate(). Set to 'true' to re-enable to previous, arguably broken, behavior.








startup() has completed.



The resource of actions link


True if mouse was pressed while over this widget, and hasn't been released yet


Deprecated. Instead of attributeMap, widget should have a _setXXXAttr attribute for each XXX attribute to be mapped to the DOM.

attributeMap sets up a "binding" between attributes (aka properties) of the widget and the widget's DOM. Changes to widget attributes listed in attributeMap will be reflected into the DOM.

For example, calling set('title', 'hello') on a TitlePane will automatically cause the TitlePane's DOM to update with the new title.

attributeMap is a hash where the key is an attribute of the widget, and the value reflects a binding to a:

  • DOM node attribute

    focus: {node: "focusNode", type: "attribute"} Maps this.focus to this.focusNode.focus

  • DOM node innerHTML

    title: { node: "titleNode", type: "innerHTML" } Maps this.title to this.titleNode.innerHTML

  • DOM node innerText

    title: { node: "titleNode", type: "innerText" } Maps this.title to this.titleNode.innerText

  • DOM node CSS class

    myClass: { node: "domNode", type: "class" } Maps this.myClass to this.domNode.className

If the value is an array, then each element in the array matches one of the formats of the above list.

There are also some shorthands for backwards compatibility:

  • string --> { node: string, type: "attribute" }, for example:
"focusNode" ---> { node: "focusNode", type: "attribute" }
  • "" --> { node: "domNode", type: "attribute" }


The widget's base CSS class.




Designates where children of the source DOM node will be placed. "Children" in this case refers to both DOM nodes and widgets. For example, for myWidget:

<div data-dojo-type=myWidget>
    <b> here's a plain DOM node
    <span data-dojo-type=subWidget>and a widget</span>
    <i> and another plain DOM node </i>

containerNode would point to:

<b> here's a plain DOM node
<span data-dojo-type=subWidget>and a widget</span>
<i> and another plain DOM node </i>

In templated widgets, "containerNode" is set via a data-dojo-attach-point assignment.

containerNode must be defined for any widget that accepts innerHTML (like ContentPane or BorderContainer or even Button), and conversely is null for widgets that don't, like TextBox.



List of sub-nodes within the widget that need CSS classes applied on mouse hover/press and focus

Each entry in the hash is a an attachpoint names (like "upArrowButton") mapped to a CSS class names (like "dijitUpArrowButton"). Example:

    "upArrowButton": "dijitUpArrowButton",
    "downArrowButton": "dijitDownArrowButton"

The above will set the CSS class dijitUpArrowButton to the this.upArrowButton DOMNode when it

is hovered, etc.


Bi-directional support, as defined by the HTML DIR attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's default direction.


This is our visible representation of the widget! Other DOM Nodes may by assigned to other properties, usually through the template system's data-dojo-attach-point syntax, but the domNode property is the canonical "top level" node in widget UI.


Flags to detect page edit mode (On page edit or Form edit mode or Create content mode)


This widget or a widget it contains has focus, or is "active" because it was recently clicked.


True if cursor is over this widget


A unique, opaque ID string that can be assigned by users or by the system. If the developer passes an ID which is known not to be unique, the specified ID is ignored and the system-generated ID is used instead.



Inherited from editor interface


Indicates whether a child dialog window is currently being displayed.


Rarely used. Overrides the default Dojo locale used to render this widget, as defined by the HTML LANG attribute. Value must be among the list of locales specified during by the Dojo bootstrap, formatted according to RFC 3066 (like en-us).



Content area editor view model


Value must be true, otherwise dijit.Form will trea the value as an object instead of an array


Source overlay of the content area in on page edit mode


The document this widget belongs to. If not specified to constructor, will default to srcNodeRef.ownerDocument, or if no sourceRef specified, then to dojo/_base/window::doc


Editor wrapper object containe the editor



Language resource


pointer to original DOM node


HTML style attributes as cssText string or name/value hash


Path to template (HTML file) for this widget relative to dojo.baseUrl. Deprecated: use templateString with require([... "dojo/text!..."], ...) instead


UI template for content area editor


Bi-directional support, the main variable which is responsible for the direction of the text. The text direction can be different than the GUI direction by using this parameter in creation of a widget.

Allowed values:

  1. "ltr"
  2. "rtl"
  3. "auto" - contextual the direction of a text defined by first strong letter.

By default is as the page direction.


The text with link area


HTML title attribute.

For form widgets this specifies a tooltip to display when hovering over the widget (just like the native HTML title attribute).

For TitlePane or for when this widget is a child of a TabContainer, AccordionContainer, etc., it's used to specify the tab label, accordion pane title, etc.


When this widget's title attribute is used to for a tab label, accordion pane title, etc., this specifies the tooltip to appear when the mouse is hovered over that text.


Value of the content area


Should we parse the template to find widgets that might be declared in markup inside it? (Remove for 2.0 and assume true)


public inherited method _beforeFillContent ( )

public inherited method _changeAttrValue ( name , value )

Internal helper for directly changing an attribute value.


public method _checkAcceptance ( source , nodes )

Customize checkAcceptance func


public inherited method _compareUris ( obj1 , obj2 )

Checks if the URI:s are equal


public inherited method _contextChanged ( _11 , _12 )


public inherited method _cssMouseEvent ( event )

Handler for CSS event on this.domNode. Sets hovering and active properties depending on mouse state, which triggers _setStateClass() to set appropriate CSS classes for this.domNode.


public inherited method _fillContent ( source )

Relocate source contents to templated container node. this.containerNode must be able to receive children, or exceptions will be thrown.


public inherited method _get ( name , names )

Private function that does a get based off a hash of names


public method _handleModelChange ( value )

Called when the value in the model changes.


public inherited method _initialContextChanged ( _13 , _14 )


public inherited method _isContentContext ( ctx )

Verifies that the context has content data


public inherited method _isSameAsCurrentContentContext ( ctx )

Checks if the content context has Id and PreferredLanguage the same as the already loaded current content context.


public inherited method _isSameAsCurrentContext ( uri )

Checks if the URI is the same as the already loaded context.


public method _onBlur ( )

Override base to prevent the onBlur from being called when the _preventOnBlur flag is set.

public inherited method _onFocus ( )

This is where widgets do processing for when they are active, such as changing CSS classes. See onFocus() for more details.

public inherited method _onMap ( type )

Maps on() type parameter (ex: "mousemove") to method name (ex: "onMouseMove"). If type is a synthetic event like then returns undefined.


public inherited method _onPopupClosed ( popup )

Called when a popup dialog has been closed


public inherited method _onPopupOpen ( openArgs )

Called before a popup is opened. Checks id the popup is opened for a descendant of


public method _selectFromOverlay ( overlayModel )


public inherited method _set ( name , value )

Helper function to set new value for specified attribute, and call handlers registered with watch() if the value has changed.


public inherited method _setOwnerDocumentAttr ( val )


public method _setReadOnlyAttr ( readOnly )


public inherited method _setStateClass ( )

Update the visual state of the widget by setting the css classes on this.domNode (or this.stateNode if defined) by combining this.baseClass with various suffixes that represent the current widget state(s).

public inherited method _setStyleAttr ( value )

Sets the style attribute of the widget according to value, which is either a hash like {height: "5px", width: "3px"} or a plain string


public method _setValueAttr ( value )


public method _startDrag ( source , nodes , copy )


public inherited method _subnodeCssMouseEvent ( node , clazz , evt )

Handler for hover/active mouse event on widget's subnode


public inherited method _trackMouseState ( node , clazz )

Track mouse/focus events on specified node and set CSS class on that node to indicate current state. Usually not called directly, but via cssStateNodes attribute.


public inherited method _waitForFocus ( )

public inherited method add ( _5 , _6 )


public inherited method applyTextDir ( element , text )

The function overridden in the _BidiSupport module, originally used for setting element.dir according to this.textDir. In this case does nothing.


public method buildRendering ( )

public inherited method connect ( obj , event , method )

Deprecated, will be removed in 2.0, use this.own(on(...)) or this.own(aspect.after(...)) instead.

Connects specified obj/event to specified method of this object and registers for disconnect() on widget destroy.

Provide widget-specific analog to dojo.connect, except with the implicit use of this widget as the target object. Events connected with this.connect are disconnected upon destruction.

var btn = new Button();
// when is called, call the listener we're going to
// provide in the scope of btn
btn.connect(foo, "bar", function(){

public method constructor ( )

public inherited method contentContextChanged ( ctx , callerData )

Called when the currently loaded content changes. I.e. a new content data object is loaded into the preview area.


public inherited method contentContextUpdated ( ctx , callerData )

Called when the currently loaded content updated.


public inherited method contextChanged ( ctx , callerData )


public inherited method contextChangeFailed ( ctx , _10 )


public inherited method contextUpdated ( ctx , callerData )


public inherited method defer ( fcn , delay )

Wrapper to setTimeout to avoid deferred functions executing after the originating widget has been destroyed. Returns an object handle with a remove method (that returns null) (replaces clearTimeout).


public inherited method destroy ( preserveDom )

Destroy this widget, but not its descendants. This method will, however, destroy internal widgets such as those used within a template.


public inherited method destroyDescendants ( preserveDom )

Recursively destroy the children of this widget and their descendants.


public inherited method destroyRecursive ( preserveDom )

Destroy this widget and its descendants


public inherited method destroyRendering ( preserveDom )

Destroys the DOM nodes associated with this widget


public inherited method disconnect ( handle )

Deprecated, will be removed in 2.0, use handle.remove() instead.

Disconnects handle created by connect.


public inherited method displayMessage ( _8 )


public inherited method emit ( type , eventObj , callbackArgs )

Used by widgets to signal that a synthetic event occurred, ex:

myWidget.emit("attrmodified-selectedChildWidget", {}).

Emits an event on this.domNode named type.toLowerCase(), based on eventObj. Also calls onType() method, if present, and returns value from that method. By default passes eventObj to callback, but will pass callbackArgs instead, if specified. Modifies eventObj by adding missing parameters (bubbles, cancelable, widget).


public method executeAction ( actionName )

Overridden mixin class executing click actions from textWithLinks widget


public method focus ( )

Focus the tree if there is a value, else focus the create block text.

public inherited method get ( name )

Get a property from a widget.


public inherited method getChildren ( )

Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode. Does not return nested widgets, nor widgets that are part of this widget's template.

public inherited method getContentDataStore ( )

Gets the content data store from store registry if it's not already cached

public inherited method getCurrentContent ( )

Returns either the current content or a deferred which will resolve a content data as soon as it becomes available.

public inherited method getCurrentContext ( )

public inherited method getErrorMessage ( _a )


public inherited method getParent ( )

Returns the parent widget of this widget

public inherited method getTemplateString ( )

Them template string to build actions area

public inherited method getTextDir ( text , originalDir )

Return direction of the text. The function overridden in the _BidiSupport module, its main purpose is to calculate the direction of the text, if was defined by the programmer through textDir.


public method isCreateLinkVisible ( )

Overidden mixin class, depend on currentMode will show/not create link

public inherited method isFocusable ( )

Return true if this widget can currently be focused and false if not

public inherited method isLeftToRight ( )

Return this widget's explicit or implicit orientation (true for LTR, false for RTL)

public method isValid ( )

Check if widget's value is valid.

public inherited method itemChanged ( id , item )

Notification event when an item has been patched or reloaded.


public inherited method on ( type , func )

Call specified function when event occurs, ex: myWidget.on("click", function(){ ... }).


public inherited method onBlur ( )

Called when the widget stops being "active" because focus moved to something outside of it, or the user clicked somewhere outside of it, or the widget was hidden.

public method onChange ( value )

Called when the value in the widget changes.


public inherited method onFocus ( )

Called when the widget becomes "active" because it or a widget inside of it either has focus, or has recently been clicked.

public inherited method own ( )

Track specified handles and remove/destroy them when this instance is destroyed, unless they were already removed/destroyed manually.

public inherited method placeAt ( reference , position )

Place this widget somewhere in the DOM based on standard conventions.

// create a Button with no srcNodeRef, and place it in the body:
var button = new Button({ label:"click" }).placeAt(win.body());
// now, 'button' is still the widget reference to the newly created button
button.on("click", function(e){ console.log('click'); }));
// create a button out of a node with id="src" and append it to id="wrapper":
var button = new Button({},"src").placeAt("wrapper");
// place a new button as the first element of some div
var button = new Button({ label:"click" }).placeAt("wrapper","first");
// create a contentpane and add it to a TabContainer
var tc = dijit.byId("myTabs");
new ContentPane({ href:"foo.html", title:"Wow!" }).placeAt(tc)

public method postCreate ( )

public method postMixInProperties ( )

public inherited method remove ( _9 , _a )


public inherited method set ( name , value )

Set a property on a widget


public inherited method setupActionLinks ( container )

Initial new text with action links of content area, and depend on context are create will show template without create, otherwise


public method startup ( )

public inherited method subscribe ( t , method )

Deprecated, will be removed in 2.0, use this.own(topic.subscribe()) instead.

Subscribes to the specified topic and calls the specified method of this object and registers for unsubscribe() on widget destroy.

Provide widget-specific analog to dojo.subscribe, except with the implicit use of this widget as the target object.

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);

public inherited method toString ( )

Returns a string that represents the widget

public inherited method uninitialize ( )

Deprecated. Override destroy() instead to implement custom widget tear-down behavior.

public inherited method unsubscribe ( handle )

Deprecated, will be removed in 2.0, use handle.remove() instead.

Unsubscribes handle created by this.subscribe. Also removes handle from this widget's list of subscriptions


public inherited method updateCommandModel ( _4 )


public inherited method validate ( _5 )


public inherited method watch ( name , callback )

Watches a property for changes