2015-01-20 01:53:18 -05:00
|
|
|
var FFZ = window.FrankerFaceZ,
|
2015-11-11 02:06:02 -05:00
|
|
|
utils = require('../utils'),
|
2015-11-07 22:56:15 -05:00
|
|
|
constants = require('../constants');
|
2015-11-11 16:03:27 -05:00
|
|
|
styles = require('../compiled_styles');
|
2015-01-20 01:53:18 -05:00
|
|
|
|
|
|
|
FFZ.prototype.setup_css = function() {
|
2015-10-17 18:05:44 -04:00
|
|
|
document.body.classList.toggle('ffz-flip-dashboard', this.settings.flip_dashboard);
|
|
|
|
|
2015-01-20 01:53:18 -05:00
|
|
|
this.log("Injecting main FrankerFaceZ CSS.");
|
|
|
|
|
2015-11-07 22:56:15 -05:00
|
|
|
var s = this._main_style = document.createElement('link');
|
|
|
|
s.id = "ffz-main-css";
|
|
|
|
s.setAttribute('rel', 'stylesheet');
|
|
|
|
s.setAttribute('href', constants.DIRECT_SERVER + "script/style.css?_=" + (constants.DEBUG ? Date.now() : FFZ.version_info));
|
|
|
|
document.head.appendChild(s);
|
|
|
|
|
2015-11-11 02:06:02 -05:00
|
|
|
this.log("Readying toggleable styles.");
|
|
|
|
this._toggle_style_state = {};
|
|
|
|
|
|
|
|
s = this._toggle_style = document.createElement('style');
|
|
|
|
s.type = "text/css";
|
|
|
|
s.id = "ffz-toggle-css";
|
|
|
|
document.head.appendChild(s);
|
|
|
|
|
2015-11-07 22:56:15 -05:00
|
|
|
/*var s = this._main_style = document.createElement('style');
|
2015-01-20 01:53:18 -05:00
|
|
|
|
2015-11-01 17:28:19 -05:00
|
|
|
s.textContent = styles.style;
|
2015-11-10 21:37:30 -05:00
|
|
|
s.id = "ffz-main-css";
|
2015-10-27 21:22:54 -04:00
|
|
|
|
2015-11-07 22:56:15 -05:00
|
|
|
document.head.appendChild(s);*/
|
2015-01-20 01:53:18 -05:00
|
|
|
|
2015-10-17 18:05:44 -04:00
|
|
|
if ( window.jQuery && jQuery.noty )
|
|
|
|
jQuery.noty.themes.ffzTheme = {
|
|
|
|
name: "ffzTheme",
|
|
|
|
style: function() {
|
|
|
|
this.$bar.removeClass().addClass("noty_bar").addClass("ffz-noty").addClass(this.options.type);
|
|
|
|
},
|
|
|
|
callback: {
|
|
|
|
onShow: function() {},
|
|
|
|
onClose: function() {}
|
|
|
|
}
|
|
|
|
};
|
2015-11-11 02:06:02 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FFZ.prototype.toggle_style = function(key, enabled) {
|
|
|
|
var state = this._toggle_style_state[key];
|
|
|
|
if ( (enabled && state) || (!enabled && !state) )
|
|
|
|
return;
|
|
|
|
|
|
|
|
this._toggle_style_state[key] = enabled;
|
2015-11-11 16:03:27 -05:00
|
|
|
|
2015-11-11 02:06:02 -05:00
|
|
|
utils.update_css(this._toggle_style, key, enabled ? styles[key] || null : null);
|
2015-01-12 17:58:07 -05:00
|
|
|
}
|