-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
workshop-tools/src/main/resources/OPENCMS/myWidget/myWidget.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
function initializeMyWidget(){ | ||
return { | ||
"getElement": function(){}, // returns the widget DOM element | ||
"getValue": function(){}, // returns the widget value | ||
"isActive": function(){}, // returns whether the widget is set active | ||
"onAttachWidget": function(){}, // called once the widget element is attached to the DOM | ||
"setActive": function(isActive){}, // sets the widget active / deactivated | ||
"setValue": function(value, fireEvent){}, // sets the widget value and optionally fires the value change event | ||
"setWidgetInfo": function(label, help){} // sets the widget label and help text | ||
|
||
// the functions onChangeCommand and onFocusCommand will be added to the widget object on initialization | ||
// call them on value change and on focus to notify the editor | ||
} | ||
} |