|
|
|
@ -330,6 +330,7 @@ var fs = require('fs'),
|
|
|
|
|
Meta.css = {};
|
|
|
|
|
Meta.css.cache = undefined;
|
|
|
|
|
Meta.css.branding = {};
|
|
|
|
|
Meta.css.defaultBranding = {};
|
|
|
|
|
|
|
|
|
|
Meta.css.minify = function() {
|
|
|
|
|
winston.info('[meta/css] Minifying LESS/CSS');
|
|
|
|
@ -370,6 +371,8 @@ var fs = require('fs'),
|
|
|
|
|
cleancss: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Meta.css.cache = css;
|
|
|
|
|
|
|
|
|
|
var re = /.brand-([\S]*?)[ ]*?{[\s\S]*?color:([\S\s]*?)}/gi,
|
|
|
|
|
match;
|
|
|
|
|
|
|
|
|
@ -377,24 +380,27 @@ var fs = require('fs'),
|
|
|
|
|
Meta.css.branding[match[1]] = match[2];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (typeof Meta.config.branding !== 'undefined') {
|
|
|
|
|
Meta.css.updateBranding(Meta.config.branding);
|
|
|
|
|
}
|
|
|
|
|
Meta.css.defaultBranding = Meta.css.branding;
|
|
|
|
|
Meta.css.updateBranding();
|
|
|
|
|
|
|
|
|
|
Meta.css.cache = css;
|
|
|
|
|
winston.info('[meta/css] Done.');
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Meta.css.updateBranding = function(branding) {
|
|
|
|
|
for (var b in branding) {
|
|
|
|
|
if (branding.hasOwnProperty(b)) {
|
|
|
|
|
Meta.css.replace(new RegExp(Meta.css.branding[b], 'g'), branding[b]);
|
|
|
|
|
Meta.css.updateBranding = function() {
|
|
|
|
|
var Settings = require('./settings');
|
|
|
|
|
var branding = new Settings('branding', '0', {}, function() {
|
|
|
|
|
branding = branding.cfg._;
|
|
|
|
|
|
|
|
|
|
for (var b in branding) {
|
|
|
|
|
if (branding.hasOwnProperty(b)) {
|
|
|
|
|
Meta.css.cache = Meta.css.cache.replace(new RegExp(Meta.css.branding[b], 'g'), branding[b]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Meta.css.branding = branding;
|
|
|
|
|
Meta.css.branding = branding;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* Sounds */
|
|
|
|
|