Skip to content
This repository
Browse code

removed use of rails js helpers to prevent issues with jrails. thank …

…you Chris Zelenak
  • Loading branch information...
commit 5715182f2c6b48fa7b0558f334011361c2826be0 1 parent 21c8e68
Eric Falcao authored
2  CHANGELOG
... ...
@@ -1,3 +1,5 @@
  1
+v0.8.14. Removed use of all Rails JS helpers, this fixes an issue when jrails is used in the app (Thanks, Chris Zelenak) 
  2
+
1 3
 v0.8.12. Added some inline branding.
2 4
 
3 5
 v0.8.11. Signup and login for the TuneUp hosted service is now only required if the user wants to share a run (privately or publicly).
2  CONTRIBUTORS
... ...
@@ -1,3 +1,5 @@
  1
+* 2008-09-03: Chris Zelenak; pointed us in the right direction: a bug with tuneup + jrails
  2
+
1 3
 * 2008-07-21: Bryan Liles; merged fallback log dir code from git://github.com/bryanl/fiveruns_tuneup.git (master:e5838f47f)
2 4
 
3 5
 * 2008-06-14: Howard Rauscher; merged javascript sandboxing code from git://github.com/howardr/fiveruns_tuneup.git (master:8cc558dbe)
2  lib/fiveruns/tuneup/version.rb
@@ -75,7 +75,7 @@ def to_a
75 75
 
76 76
       MAJOR = 0
77 77
       MINOR = 8
78  
-      TINY  = 13
  78
+      TINY  = 14
79 79
 
80 80
       # The current version as a Version instance
81 81
       CURRENT = new(MAJOR, MINOR, TINY)
12  lib/tuneup_controller.rb
@@ -31,9 +31,9 @@ def update
31 31
   end
32 32
   
33 33
   def register
34  
-    render(:update) do |p| 
35  
-      p['tuneup-panel'].hide
36  
-      p.insert_html(:bottom, 'tuneup-content', :partial => 'tuneup/panel/register.html.erb')
  34
+    render :update do |page| 
  35
+      page << "$('tuneup-panel').hide();"
  36
+      page << %[new Insertion.Bottom('tuneup-content', "#{escape_javascript(render(:partial => 'tuneup/panel/register.html.erb'))}");]
37 37
     end
38 38
   end
39 39
   
@@ -45,7 +45,7 @@ def signin
45 45
     end
46 46
     render :update do |page|
47 47
       if api_key
48  
-        page.replace('tuneup-save-link', link_to_upload)
  48
+        page << "$('tuneup-save-link').replace('#{escape_javascript(link_to_upload)}');"
49 49
         page << redisplay_last_run(false)
50 50
       else
51 51
         page << tuneup_show_flash(:error,
@@ -103,7 +103,9 @@ def log_processing
103 103
   
104 104
   def collect(state)
105 105
     Fiveruns::Tuneup.collecting = state
106  
-    render(:update) { |p| p['tuneup-panel'].replace(render(:partial => 'tuneup/panel/show.html.erb')) }
  106
+    render :update do |page|
  107
+      page << %[$('tuneup-panel').update("#{escape_javascript(render(:partial => 'tuneup/panel/show.html.erb'))}")]
  108
+    end
107 109
   end
108 110
 
109 111
   def find_config
12  lib/tuneup_helper.rb
@@ -172,8 +172,8 @@ def tuneup_open_run(token)
172 172
   
173 173
   def tuneup_reload_panel
174 174
     update_page do |page|
175  
-      page['tuneup-flash'].removeClassName('tuneup-show');
176  
-      page['tuneup-content'].replace_html(render(:partial => "tuneup/panel/show.html.erb"))
  175
+      page << "$('tuneup-flash').removeClassName('tuneup-show');"
  176
+      page << %[$('tuneup-content').update("#{escape_javascript(render(:partial => 'tuneup/panel/show.html.erb'))}");]
177 177
       page << 'TuneUp.adjustAbsoluteElements(_document.body);'
178 178
       page << 'TuneUp.adjustFixedElements();'
179 179
     end
@@ -182,12 +182,12 @@ def tuneup_reload_panel
182 182
   def tuneup_show_flash(type, locals)
183 183
     types = [:error, :notice].reject { |t| t == type }
184 184
     update_page do |page|
185  
-      page['tuneup-flash'].replace_html(render(:partial => 'flash.html.erb', :locals => locals.merge(:type => type)))
186  
-      page['tuneup-flash'].addClassName('tuneup-show');
  185
+      page << %[$('tuneup-flash').update("#{escape_javascript(render(:partial => 'flash.html.erb', :locals => locals.merge(:type => type)))}");]
  186
+      page << "$('tuneup-flash').addClassName('tuneup-show')"
187 187
       types.each do |other_type|
188  
-        page['tuneup-flash'].removeClassName("tuneup-#{other_type}")
  188
+        page << "$('tuneup-flash').removeClassName('tuneup-#{other_type}')"
189 189
       end
190  
-      page['tuneup-flash'].addClassName("tuneup-#{type}");
  190
+      page << "$('tuneup-flash').addClassName('tuneup-#{type}')"
191 191
       page << 'TuneUp.adjustAbsoluteElements(_document.body);'
192 192
       page << 'TuneUp.adjustFixedElements();'
193 193
     end

0 notes on commit 5715182

Please sign in to comment.
Something went wrong with that request. Please try again.