nicer toggles
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 21 Dec 2012 14:11:29 +0000 (15:11 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 21 Dec 2012 14:11:29 +0000 (15:11 +0100)
engine/static/js/plugin.js
engine/templates/plugin.html
plugins/templates/verticallayout.html

index c5a9de8..7c22af6 100644 (file)
@@ -2,14 +2,19 @@
  * and configure their behaviour 
  */
 $(document).ready(function() {
+    window.console.log("Setting plugin toggle behaviour");
     $('.plugin-hide').each(function() {
+       window.console.log("Setting plugin toggle behaviour on hide "+$(this).attr('id'));
        $(this).click(function () { 
+           window.console.log("click on a HIDE button");
            var plugin='#'+$(this).attr('id').replace('hide-',''); 
            var show='#'+$(this).attr('id').replace('hide-','show-'); 
            jQuery(plugin).hide(); jQuery(show).show(); $(this).hide();});
        })
     $('.plugin-show').each(function() {
+       window.console.log("Setting plugin toggle behaviour on show "+$(this).attr('id'));
        $(this).click(function () { 
+           window.console.log("click on a SHOW button");
            var plugin='#'+$(this).attr('id').replace('show-',''); 
            var hide='#'+$(this).attr('id').replace('show-','hide-'); 
            jQuery(plugin).show(); jQuery(hide).show(); $(this).hide();});
index 8f9518d..d4b5cf1 100644 (file)
@@ -3,16 +3,16 @@
 <div class='plugin-toggle' id='toggle-{{ domid }}'>
 {% if togglable %}
   {% if not toggled %}
-<p id='show-{{ domid }}' class='plugin-show'><a href='#'><span>&raquo; Show {{ classname }} "{{ title }}"</span></a></p>
-<p id='hide-{{ domid }}' class='plugin-hide' style='display:none;'><a href='#'><span>&laquo; Hide {{ classname }} "{{ title }}"</span></a></p>
+<p id='show-{{ domid }}' class='plugin-show'><i class="icon-hand-right"></i> Show {{ title }} ({{ classname }})</p>
+<p id='hide-{{ domid }}' class='plugin-hide' style='display:none;'><i class="icon-hand-down"></i> Hide {{ title }} ({{ classname }})</p>
   {% else %}
-<p id='show-{{ domid }}' class='plugin-show' style='display:none;'><a href='#'><span>&raquo; Show {{ classname }} "{{ title }}"</span></a></p>
-<p id='hide-{{ domid }}' class='plugin-hide'><a href='#'><span>&laquo; Hide {{ classname }} "{{ title }}"</span></a></p>
+<p id='show-{{ domid }}' class='plugin-show' style='display:none;'><i class="icon-hand-right"></i> Show {{ title }} ({{ classname }})</p>
+<p id='hide-{{ domid }}' class='plugin-hide'><i class="icon-hand-down"></i> Hide {{ title }} ({{ classname }})</p>
   {% endif %}{# toggled #}
 {% endif %}{# togglable #}
 {% endif %}{# visible #}
 
-<div class='plugin {{ classname }}' id='{{ domid }}' {% if not toggled %}style='display:none;'{% endif %}>
+<div class='plugin {{ classname }}' id='{{ domid }}'{% if not toggled %} style='display:none;'{% endif %}>
 {{ plugin_content|safe }}
 </div><!--plugin {{ classname }}{{ domid }}-->
 
index 53ce590..f765cd1 100644 (file)
@@ -1,6 +1,6 @@
 <div id='div-{{ domid }}'>
 {% for son in sons %}
-<h3>{{ son.title }}</h3>
+{#<h3>{{ son.title }}</h3>#}
 <div id='tab-{{ son.domid }}'>
 {{ son.rendered }}
 </div>