+// xxx NOTE : pending move towards a more elaborate mode for 'toggled'
+// for now it's just True or False and most of this code is not in action yet
+// init_all_plugins does kick in though
var plugin = {
debug:true,
if (debug) console.log ("Applying retrieved status " + retrieved + " to " + domid);
set_visible(domid,retrieved);
},
- // triggered upon $(document).ready
- init_all_plugins: function() {
- $('.plugin-hide').each(function() {
- $(this).click(function () {
- var plugin='#'+this.id.replace('hide-','');
- var show='#'+this.id.replace('hide-','show-');
- $(plugin).slideUp(); $(show).show(); $(this).hide();});
- });
- $('.plugin-show').each(function() {
- $(this).click(function () {
- var plugin='#'+this.id.replace('show-','');
- var hide='#'+this.id.replace('show-','hide-');
- $(plugin).slideDown(); $(hide).show(); $(this).hide();});
- });
- $('.plugin-tooltip').each(function(){ $(this).tooltip({'selector':'','placement':'right'}); });
- },
toggle : function (domid) {
var plugin=$('#'+domid);
plugin.toggle();
plugin.toggle (domid);
}
},
+ // triggered upon $(document).ready
+ init_all_plugins: function() {
+ $('.plugin-hide').each(function() {
+ $(this).click(function () {
+ var plugin='#'+this.id.replace('hide-','');
+ var show='#'+this.id.replace('hide-','show-');
+ $(plugin).slideUp(); $(show).show(); $(this).hide();});
+ });
+ $('.plugin-show').each(function() {
+ $(this).click(function () {
+ var plugin='#'+this.id.replace('show-','');
+ var hide='#'+this.id.replace('show-','hide-');
+ $(plugin).slideDown(); $(hide).show(); $(this).hide();});
+ });
+ $('.plugin-tooltip').each(function(){ $(this).tooltip({'selector':'','placement':'right'}); });
+ },
} // global unfold
/* upon document completion, we locate all the hide and show areas,
# . page: the context of the request being served
# . title: is used visually for displaying the widget
#### optional
- # . togglable: whether it can be turned on and off (like PleKitToggle)
- # . 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)
+ # . togglable: whether it can be turned on and off by clicking on the title (like PleKitToggle)
+ # . toggled: whether the plugin should startup open/shown or closed/hidden
+ #### xxx NOTE : pending move towards a more elaborate mode for 'toggled'
+ # . toggled: if togglable, what's the initial status; possible values are
+ # .. True : start up open/hidden
+ # .. False : start up closed/shown
+ # .. 'last' : start up as it was the last time that browser showed it (based on 'domid')
+ # .. None : if not passed to __init__ at all, then the DefaultTaggled() method is called
+ # .. : anything else, defaults to True
+ #### xxx NOTE : pending move towards a more elaborate mode for 'toggled'
+ #
#### internal data
# . domid: created internally, but can be set at creation time if needed
# useful for hand-made css, or for selecting an active plugin in a composite