# . title: is used visually for displaying the widget
# . name: a simple id suitable for forging css names
#### optional
- # . hidable: whether it can be turned on and off from the UI
+ # . togglable: whether it can be turned on and off from the UI
# like e.g. PleKitToggle
- # . hidden_by_default: if hidable, what's the initial status
+ # . toggled: if togglable, what's the initial status
# . visible: if not set the plugin does not show up at all,
# not quite sure what this was for
#### internal data
# which will result in 'foo' being accessible to the template engine
#
def __init__ (self, title, name,
- visible=True, hidable=True, hidden_by_default=False, **settings):
+ visible=True, togglable=True, toggled=True, **settings):
# what is in this dictionary will get exposed to template and to javascript
self._settings=settings
self.title=title
self.classname=self._classname()
self.add_to_settings ( [ 'uuid', 'classname' ] )
self.visible=visible
- self.hidable=hidable
- self.hidden_by_default=hidden_by_default
- self.add_to_settings( ['visible','hidable','hidden_by_default'] )
+ self.togglable=togglable
+ self.toggled=toggled
+ self.add_to_settings( ['visible','togglable','toggled'] )
# we store as a dictionary the arguments passed to constructor
# e.g. SimpleList (list=[1,2,3]) => _settings = { 'list':[1,2,3] }
# our own settings are not made part of _settings but could be..
settings_json = json.dumps (js_env, separators=(',',':'))
env ['settings_json' ] = settings_json
# compute plugin-specific initialization
- js_init = render_to_string ( 'init_plugin.js', env )
+ js_init = render_to_string ( 'plugin_setenv.js', env )
print 'js_init',js_init
self.add_js_chunks (request, js_init)