start to move stuff around where it belongs
[myslice.git] / engine / static / js / plugin.js
diff --git a/engine/static/js/plugin.js b/engine/static/js/plugin.js
new file mode 100644 (file)
index 0000000..ae21642
--- /dev/null
@@ -0,0 +1,17 @@
+/* upon document completion, we locate all the hide and show areas, 
+ * and configure their behaviour 
+ */
+$(document).ready(function() {
+    $('.plugin-hide').each(function() {
+       $(this).click(function () { 
+           var plugin='#'+$(this).attr('id').replace('hide-','plugin-'); 
+           var show='#'+$(this).attr('id').replace('hide-','show-'); 
+           jQuery(plugin).hide(); jQuery(show).show(); $(this).hide();});
+       })
+    $('.plugin-show').each(function() {
+       $(this).click(function () { 
+           var plugin='#'+$(this).attr('id').replace('show-','plugin-'); 
+           var hide='#'+$(this).attr('id').replace('show-','hide-'); 
+           jQuery(plugin).show(); jQuery(hide).show(); $(this).hide();});
+       })
+    })