diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6d30d2632..78346a2c1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -75,4 +75,11 @@ module ApplicationHelper def popover_with_close_html(without_close_html) without_close_html + link_to(image_tag('deletelabel.png'), "#", :class => 'close') end + + def jquery_include_tag + javascript_include_tag('//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js') + + content_tag(:script) do + "!window.jQuery && document.write(unescape(\"#{escape_javascript(include_javascripts(:jquery))}\"))".html_safe + end + end end diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 7a27f05a5..8283cc228 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -37,10 +37,7 @@ = javascript_include_tag "/javascripts/ie.js" - %script{:type => "text/javascript", :src => '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'} - :javascript - !window.jQuery && document.write(unescape("#{escape_javascript(include_javascripts(:jquery))}")) - + = jquery_include_tag - unless @landing_page = include_javascripts :main :javascript diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml index 13d3c9253..89601a4c5 100644 --- a/app/views/layouts/application.mobile.haml +++ b/app/views/layouts/application.mobile.haml @@ -61,6 +61,7 @@ = render :partial =>'shared/footer' / javascripts at the bottom + = jquery_include_tag = include_javascripts :mobile :javascript diff --git a/config/assets.yml b/config/assets.yml index b9ca4d9a1..7417168a0 100644 --- a/config/assets.yml +++ b/config/assets.yml @@ -46,7 +46,6 @@ javascripts: login: - public/javascripts/login.js mobile: - - public/javascripts/vendor/jquery162.min.js - public/javascripts/vendor/jquery.charcount.js - public/javascripts/rails.js # we only include this to hijack ajax requests - public/javascripts/vendor/mbp-helper.js