X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=templates%2Fwidget-plugin.html;h=540cb4a680dc7a4f5bad8da131e73ac5f68d149e;hb=d708608645cb4904964e624116ffa944fc06891e;hp=fe9dcbaa621de45f2322290724394a7d5bec4a14;hpb=704bebbe43202925f468656e1a91ac574af2fcf2;p=unfold.git diff --git a/templates/widget-plugin.html b/templates/widget-plugin.html index fe9dcbaa..540cb4a6 100644 --- a/templates/widget-plugin.html +++ b/templates/widget-plugin.html @@ -19,13 +19,12 @@ {% endif %} +{% insert prelude_js %} {% if visible and hidable %} {# xxx sounds like this could be optimized by a single call performed on document.ready #} {# that would do that on all DOM elements that require it #} -{% insert prelude_js %} /* Show / hide plugin */ - jQuery('#show_{{ uuid }}').click(function() { jQuery('#{{ uuid }}').show(); if (typeof jQuery('#{{ uuid }}').{{ title }} != 'undefined') { @@ -44,6 +43,10 @@ event.preventDefault(); {% if hidden %} jQuery('#{{ uuid }}').hide() {% endif %} -/* {{ optionstr }} optionstr needs more work */ -{% endinsert %} {% endif %} +/* Plugin initialization (if the plugin has the right structure) - from plugin.php */ +if (typeof jQuery('#{{ uuid }}').$title != 'undefined') { + jQuery('#{{ uuid }}').$title({ {{ settings }} plugin_uuid: '{{ uuid }}' }); + //jQuery('#{{ uuid }}').$title('show'); + }; +{% endinsert %}