public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
Fixed show/hide stuff for articles and section.  The newest Prototype 
breaks the previous functionality

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2197 
567b1171-46fb-0310-a4c9-b4bef9110e78
Caged (author)
Sun Sep 17 18:07:29 -0700 2006
commit  9beb8db52d83155e5126634234ffa68438ea0de4
tree    7ec2897ccddbbf43b4260e5413b570298db6bbbb
parent  2953c1600672f5309bc1a23c3d6e6301179c1720
...
5
6
7
8
 
9
10
 
11
12
13
...
5
6
7
 
8
9
 
10
11
12
13
0
@@ -5,9 +5,9 @@
0
   <dl>
0
     <dt><label for="article_title">Title</label></dt>
0
     <dd><%= form.text_field :title, :class => 'big' %></dd>
0
- <dt id="x-lbl" style="display:none;"><%= form.label_for :excerpt %> <span class="hint">(<%= link_to_function 'Cancel', %(Element.toggle('x-lbl', 'x-body')) %>)</span></dt>
0
+ <dt id="x-lbl" style="display:none;"><%= form.label_for :excerpt %> <span class="hint">(<%= link_to_function 'Cancel', %(['x-lbl', 'x-body'].each(Element.toggle)) %>)</span></dt>
0
     <dd id="x-body" style="display:none"><%= form.text_area :excerpt, :rows => '8', :class => 'fat' %></dd>
0
- <dt><label for="article_body">Write your article</label> <span class="hint">(<%= link_to_function 'Add an excerpt', %(Element.toggle('x-lbl', 'x-body')) %>)</span></dt>
0
+ <dt><label for="article_body">Write your article</label> <span class="hint">(<%= link_to_function 'Add an excerpt', %(['x-lbl', 'x-body'].each(Element.toggle)) %>)</span></dt>
0
     <dd><%= form.text_area :body, :class => 'fat', :rows => 25 %></dd>
0
     <dt><label for="article_tag">Tags</label> <span class="hint">Enter one or more tags separated by a comma.</span></dt>
0
     <dd><%= form.text_field :tag %></dd>
...
2
3
4
5
 
6
7
8
...
2
3
4
 
5
6
7
8
0
@@ -2,7 +2,7 @@
0
      :url => { :action => (@section.new_record? ? 'create' : 'update'), :id => @section }, :html => { :id => 'section-form' } do |f| %>
0
 <div class="group">
0
   <dl>
0
- <dt><label for="section_name">Section name <span class="hint">(<%= link_to_function 'Customize path', %(Element.toggle('sec-lbl', 'sec-input')) %>)</span></label></dt>
0
+ <dt><label for="section_name">Section name <span class="hint">(<%= link_to_function 'Customize path', %(['sec-lbl', 'sec-input'].each(Element.toggle)) %>)</span></label></dt>
0
     <dd><%= f.text_field :name, :class => 'big' %></dd>
0
     <dt id="sec-lbl" style="display:none">
0
       <label for="section_path">Section path</label>
...
77
78
79
80
81
 
82
83
84
...
87
88
89
90
91
92
93
94
 
95
96
97
...
77
78
79
 
80
81
82
83
84
...
87
88
89
 
90
91
92
93
94
95
96
97
0
@@ -77,8 +77,8 @@ ActiveRecord::Schema.define(:version => 59) do
0
     t.column "author_email", :string
0
     t.column "author_ip", :string, :limit => 100
0
     t.column "comments_count", :integer, :default => 0
0
- t.column "updater_id", :integer
0
     t.column "version", :integer
0
+ t.column "updater_id", :integer
0
     t.column "site_id", :integer
0
     t.column "approved", :boolean, :default => false
0
     t.column "comment_age", :integer, :default => 0
0
@@ -87,11 +87,11 @@ ActiveRecord::Schema.define(:version => 59) do
0
 
0
   create_table "events", :force => true do |t|
0
     t.column "mode", :string
0
- t.column "user_id", :integer
0
     t.column "article_id", :integer
0
     t.column "title", :text
0
     t.column "body", :text
0
     t.column "created_at", :datetime
0
+ t.column "user_id", :integer
0
     t.column "author", :string, :limit => 100
0
     t.column "comment_id", :integer
0
     t.column "site_id", :integer
...
286
287
288
289
290
 
 
291
292
293
...
286
287
288
 
 
289
290
291
292
293
0
@@ -286,8 +286,8 @@ var Flash = {
0
 var ArticleForm = {
0
   saveDraft: function() {
0
     var isDraft = $F(this);
0
- if(isDraft) Element.hide('publish-date-lbl', 'publish-date');
0
- else Element.show('publish-date-lbl', 'publish-date');
0
+ if(isDraft) ['publish-date-lbl', 'publish-date'].each(Element.hide);
0
+ else ['publish-date-lbl', 'publish-date'].each(Element.show);
0
   },
0
 
0
   getAvailableComments: function() {

Comments

    No one has commented yet.