Skip to content

Commit

Permalink
Added new widget JavaScript.
Browse files Browse the repository at this point in the history
  • Loading branch information
tHerrmann authored Sep 27, 2016
1 parent f977c1a commit 37a9c6a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions workshop-tools/src/main/resources/OPENCMS/myWidget/myWidget.js
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
}
}

0 comments on commit 37a9c6a

Please sign in to comment.