public
Fork of halorgium/mephisto
Description: A refactored Mephisto that has multiple spam detection engines.
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/francois/mephisto.git
Use JavaScript to show/hide the different settings for the spam detection 
engines.
francois (author)
Mon Mar 03 06:35:54 -0800 2008
commit  68df6ed6545e816dca2d56eefd499928f4337233
tree    8c147fd4e10167d0aa9a021d24afbc4bb9caf5ea
parent  e029e461363c853091c7498d614b2cc2d1640db4
...
6
7
8
9
 
10
11
...
6
7
8
 
9
10
11
0
@@ -6,6 +6,6 @@ module Admin::SettingsHelper
0
       style = "display:none"
0
     end
0
 
0
- content_tag(:div, klass_name.constantize.settings_template(@site), :id => File.basename(klass_name.underscore), :style => style)
0
+ content_tag(:div, klass_name.constantize.settings_template(@site), :id => klass_name.split("::").last + "Settings", :class => "settings", :style => style)
0
   end
0
 end
...
53
54
55
56
 
57
58
59
...
53
54
55
 
56
57
58
59
0
@@ -53,7 +53,7 @@
0
     <dt><label for="site_spam_detection_engine">Spam Detection Engine</label></dt>
0
     <dd><%= f.select :spam_detection_engine, Site.spam_detection_engines %></dd>
0
   </dl>
0
- <div id="spam_detection_engines">
0
+ <div id="spam_detection_engine_settings">
0
     <%- Site.spam_detection_engines.map(&:last).each do |klass_name| -%>
0
       <%= spam_engine_settings_for(klass_name) %>
0
     <%- end -%>
...
609
610
611
 
 
 
 
 
 
 
 
612
613
614
...
609
610
611
612
613
614
615
616
617
618
619
620
621
622
0
@@ -609,6 +609,14 @@ Event.addBehavior({
0
     var pieces = img.src.split('/');
0
     new Dialog.Rjs();
0
     new Ajax.Request(Mephisto.root + '/admin/themes/show/' + pieces[pieces.length-1]);
0
+ },
0
+
0
+ '#site_spam_detection_engine:change': function() {
0
+ var entry = this.options[this.selectedIndex];
0
+ var id = entry.value.split("::").last() + "Settings";
0
+ var panel = $(id);
0
+ $$("#spam_detection_engine_settings .settings").each(Element.hide);
0
+ panel.show();
0
   }
0
   
0
   //'.theme': function() {

Comments

    No one has commented yet.