4d8346db80724847da687d3353eecda528f8a96e
[unfold.git] / static / js / plugin.js
1 /* upon document completion, we locate all the hide and show areas, 
2  * and configure their behaviour 
3  */
4 /* xxx missing - see plugin.php 
5  * if (typeof jQuery('#$uuid').$title != 'undefined') {
6  * jQuery('#$uuid').$title('show');
7  * }; 
8  */
9
10 $(document).ready(function() {
11     $('.plugin-hide').each(function() {
12         window.console.log ('@load: id='+$(this).attr('id'));
13         $(this).click(function () { 
14             var plugin='#'+$(this).attr('id').replace('hide-','plugin-'); 
15             var show='#'+$(this).attr('id').replace('hide-','show-'); 
16             window.console.log ("Hiding:"+$(this).attr('id')+' plugin='+plugin+' show='+show);
17             jQuery(plugin).hide(); jQuery(show).show(); $(this).hide();});
18         })
19     $('.plugin-show').each(function() {
20         window.console.log ('@load: id='+$(this).attr('id'));
21         $(this).click(function () { 
22             var plugin='#'+$(this).attr('id').replace('show-','plugin-'); 
23             var hide='#'+$(this).attr('id').replace('show-','hide-'); 
24             window.console.log ("Showing:"+$(this).attr('id')+' plugin='+plugin+' hide='+hide);
25             jQuery(plugin).show(); jQuery(hide).show(); $(this).hide();});
26         })
27     })