diff --git a/app/assets/javascripts/main_include.js b/app/assets/javascripts/main_include.js index e33a5628dc0..108ea4a3ace 100644 --- a/app/assets/javascripts/main_include.js +++ b/app/assets/javascripts/main_include.js @@ -11,7 +11,6 @@ //= require bootstrap-dropdown.js //= require bootstrap-modal.js //= require bootstrap-transition.js -//= require browser-update.js //= require chosen.jquery.js //= require ember-renderspeed.js //= require favcount.js @@ -70,5 +69,3 @@ //= require_tree ./discourse/helpers //= require_tree ./discourse/templates //= require_tree ./discourse/routes - -//= require browser-update.js diff --git a/app/views/common/_discourse_javascript.html.erb b/app/views/common/_discourse_javascript.html.erb index 63ca917259a..2fd712a69c8 100644 --- a/app/views/common/_discourse_javascript.html.erb +++ b/app/views/common/_discourse_javascript.html.erb @@ -20,3 +20,5 @@ Discourse.Router.map(function() { Discourse.routeBuilder.call(this); }); Discourse.start() + +<%= javascript_include_tag 'browser-update' %> diff --git a/vendor/assets/javascripts/browser-update.js b/vendor/assets/javascripts/browser-update.js.erb similarity index 91% rename from vendor/assets/javascripts/browser-update.js rename to vendor/assets/javascripts/browser-update.js.erb index 2ff05307f59..0b87e67684d 100644 --- a/vendor/assets/javascripts/browser-update.js +++ b/vendor/assets/javascripts/browser-update.js.erb @@ -11,7 +11,7 @@ var $buo = function() { } // retrieve localized browser upgrade text - var t = I18n.t('js.browser_update'); + var t = <%= "'" + I18n.t('js.browser_update') + "'" %>; // create the notification div HTML var div = document.createElement("div"); @@ -30,10 +30,12 @@ var $buo = function() { sheet.innerHTML = style; } catch(e) { + console.log(e); try { sheet.styleSheet.cssText = style; } catch(ex) { + console.log('failed to add the css'); return; } } @@ -43,8 +45,6 @@ var $buo = function() { }; -$(function() { - $bu=$buo(); -}); +$bu=$buo(); })(this); \ No newline at end of file