mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 09:44:34 +08:00
Fix browser-update.js so it doesn't depend on jQuery
This commit is contained in:
parent
3442d3adb2
commit
8a9bef944f
|
@ -11,7 +11,6 @@
|
||||||
//= require bootstrap-dropdown.js
|
//= require bootstrap-dropdown.js
|
||||||
//= require bootstrap-modal.js
|
//= require bootstrap-modal.js
|
||||||
//= require bootstrap-transition.js
|
//= require bootstrap-transition.js
|
||||||
//= require browser-update.js
|
|
||||||
//= require chosen.jquery.js
|
//= require chosen.jquery.js
|
||||||
//= require ember-renderspeed.js
|
//= require ember-renderspeed.js
|
||||||
//= require favcount.js
|
//= require favcount.js
|
||||||
|
@ -70,5 +69,3 @@
|
||||||
//= require_tree ./discourse/helpers
|
//= require_tree ./discourse/helpers
|
||||||
//= require_tree ./discourse/templates
|
//= require_tree ./discourse/templates
|
||||||
//= require_tree ./discourse/routes
|
//= require_tree ./discourse/routes
|
||||||
|
|
||||||
//= require browser-update.js
|
|
||||||
|
|
|
@ -20,3 +20,5 @@
|
||||||
Discourse.Router.map(function() { Discourse.routeBuilder.call(this); });
|
Discourse.Router.map(function() { Discourse.routeBuilder.call(this); });
|
||||||
Discourse.start()
|
Discourse.start()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<%= javascript_include_tag 'browser-update' %>
|
||||||
|
|
|
@ -11,7 +11,7 @@ var $buo = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// retrieve localized browser upgrade text
|
// retrieve localized browser upgrade text
|
||||||
var t = I18n.t('js.browser_update');
|
var t = <%= "'" + I18n.t('js.browser_update') + "'" %>;
|
||||||
|
|
||||||
// create the notification div HTML
|
// create the notification div HTML
|
||||||
var div = document.createElement("div");
|
var div = document.createElement("div");
|
||||||
|
@ -30,10 +30,12 @@ var $buo = function() {
|
||||||
sheet.innerHTML = style;
|
sheet.innerHTML = style;
|
||||||
}
|
}
|
||||||
catch(e) {
|
catch(e) {
|
||||||
|
console.log(e);
|
||||||
try {
|
try {
|
||||||
sheet.styleSheet.cssText = style;
|
sheet.styleSheet.cssText = style;
|
||||||
}
|
}
|
||||||
catch(ex) {
|
catch(ex) {
|
||||||
|
console.log('failed to add the css');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,8 +45,6 @@ var $buo = function() {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$(function() {
|
$bu=$buo();
|
||||||
$bu=$buo();
|
|
||||||
});
|
|
||||||
|
|
||||||
})(this);
|
})(this);
|
Loading…
Reference in New Issue
Block a user