Additional methods for CKEditor plugins.
- CKEditor version 4.11.3 or greater
SMethods has the same browser compatibility as CKEditor.
- Put the plugin into the CKEditor
plugins
folder. - Require smethods in
plugin.js
where you want to use its functionality:
requires: 'smethods';
Returns a copy of the array
with all instances of the values
removed.
- array (Array): The original array.
- values (...*): The values that should be removed.
- (Array): The new array.
Gets the current page id.
- (String): The current page id.
Adds one or more commands from the specified definition object to the editor instance.
- definitions (Object): Object where keys are used as
commandName
and corresponding values as the definition for an addCommand call.
Gets the element class names that match a regular expression.
- regexp (RegExp)
- (Array|Boolean)
Removes a CSS class name from the element classes. Other classes remain untouched.
- remove (RegExp|Array)
- element: this.
Adds a CSS class to the element or removes it if it exists.
- name (String): The class name.
- remove (RegExp|Array): The regular expression or array of the class names that should be removed.
- element: this.
Adds an attribute to the element or removes it if it exists.
- name (String): The name of the attribute.
- value (String): The value of the attribute.
- element: this.
Gets the element attribute name(s) that matches a regular expression.
- regexp (RegExp): The regular expression.
- (Array)
Gets the element's real name (real tag name).
- (String): The element's real name.
Checks if the element's real name matches the specified criteria.
- name (...String): One or more names to be checked.
- (Boolean)
Returns the first parent element of this element that matches the specified selector
.
- selector (String): A valid CSS selector.
Adds a menu button definition to the UI elements list.
- name (String): The menu button name.
- definition (Object): The menu button definition.
Gets all values of this dialog UI object.
- (Array)
Determines whether a UI element is focused or not.
- (Boolean)
Toggle disable/enable UI element.
Determines whether a UI element is on the current tab or not.
- (Boolean)