(abstract) new AbstractPlugin($element)
Abstarct plugin class.
Parameters:
Name | Type | Description |
---|---|---|
$element |
jQuery | The element. |
Members
(static) editor :ICE.Editor
The ICE Editor instance
Type:
- ICE.Editor
(static) filter :function
Filters elements for which plugin won't be attached.
The function must return true for editable elements by plugin.
Type:
- function
(static) nodeName :String
The human readable name of node represented by plugin.
Type:
- String
(static) selector :String
The jQuery selector for elements handled by this plugin.
Type:
- String
(static) type :Number
The plugin type.
Type:
- Number
editor :ICE.Editor
The editor instance.
Type:
- ICE.Editor
Methods
(static) getType(plugin) → {ICE.PluginType}
Returns plugin type.
Parameters:
Name | Type | Description |
---|---|---|
plugin |
String | ICE.AbstractPlugin | The plugin or its name. |
Returns:
The plugin type.
- Type
- ICE.PluginType
addContainer(content, $afteropt, beforeopt)
Adds container to layout.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
content |
string | jQuery | The initial content. | |
$after |
jQuery |
<optional> |
The container after which content to add. |
before |
boolean |
<optional> |
The flag whether container should be added before given container. Default value is false. |
attach()
Attaches plugin.
Invoked when plugin is being attached to an element.
busy()
Turns on element's busy status.
changeBgColor(colornullable)
Changes background color of an element.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
color |
nge.Color |
<nullable> |
The color to set. |
changeBorderColor(colornullable)
Changes border color of an element.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
color |
nge.Color |
<nullable> |
The color to set. |
changeFgColor(colornullable)
Changes text color of an element.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
color |
nge.Color |
<nullable> |
The color to set. |
changeStyle(prop, valueopt)
Changes CSS style of an element.
If the element has XTL properties, then it will have 'style' property
updated as well.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
prop |
String | Object | The proparty name or object containing property/value pairs. | |
value |
String |
<optional> |
The value of CSS property. Used only when 'prop' argument is a string. |
changeStyleClass(newClass, oldClassopt, noClassopt)
Changes CSS style class of an element.
If the element has XTL styleClass property, then it will be updated
as well.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
newClass |
String | The new class to set. | |
oldClass |
String |
<optional> |
The old class to unset. |
noClass |
String |
<optional> |
The "no class" pseudo class. If defined, an attempt to set newClass with value of noClass will lead to not setting any class, and attempt to unset noClass will lead to not unsetting anything. |
encode(standalonenullable) → (nullable) {Object}
Encodes element into XTL entity.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
standalone |
Boolean |
<nullable> |
The flag whether element's referenced entity is being encoded. |
Returns:
The XTL entity or null.
- Type
- Object
entityOf(element, childrenopt, excludeopt) → (nullable) {Object}
Returns generic XTL entity of an element.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
element |
string | The element class name. | |
children |
boolean |
<optional> |
The flag whether children should be encoded. |
exclude |
string |
<optional> |
The jQuery selector of children to be excluded. |
Returns:
The XTL entity or null.
- Type
- Object
groups() → {ICE.UI.Content}
Returns content model of groups for Edit tab.
Returns:
Content model or empty object if none.
- Type
- ICE.UI.Content
groupsAdd() → {ICE.UI.Content}
Returns content model of groups for Add tab.
Returns:
Content model or empty object if none.
- Type
- ICE.UI.Content
idle()
Turns off element's busy status.
isBusy() → {boolean}
Determines wheter element is busy.
Returns:
true if element is busy, false otherwise.
- Type
- boolean
isModified() → {boolean}
Returns modification status of an element.
Returns:
true if modified, false otherwise.
- Type
- boolean
isObstructive() → {boolean}
Determines whether element is obstructive.
Returns:
true if element is obstructive, false otherwise.
- Type
- boolean
modified()
Updates modification status of an element.
modifiedDocument()
Updates modification status of an element's document.
popup() → {ICE.UI.Content|null}
Returns content model of popup.
Returns:
Content model or null if none.
- Type
- ICE.UI.Content | null
(abstract) properties(chg)
Invoked when one ore more properties are changed.
Parameters:
Name | Type | Description |
---|---|---|
chg |
Object | The changed properties. |
rescan()
Attaches or detaches plugins based on element's current CSS class.
save() → (nullable) {Boolean}
Saves element content.
Returns:
Returns false on failure.
- Type
- Boolean
typeOf() → {ICE.PluginType}
Returns plugin type.
Returns:
The plugin type.
- Type
- ICE.PluginType
xtl(props) → (nullable) {Object}
Sets or gets XTL poperties of the element.
Parameters:
Name | Type | Description |
---|---|---|
props |
Object | The XTL properties to set. |
Returns:
The XTL properties or null if there are none.
- Type
- Object