|
|
@@ -1,6 +1,7 @@
|
|
|
module.exports = function(crowi) {
|
|
|
var mongoose = require('mongoose')
|
|
|
, debug = require('debug')('crowi:models:config')
|
|
|
+ , uglifycss = require('uglifycss')
|
|
|
, ObjectId = mongoose.Schema.Types.ObjectId
|
|
|
, configSchema
|
|
|
, Config
|
|
|
@@ -77,6 +78,9 @@ module.exports = function(crowi) {
|
|
|
|
|
|
originalConfig[ns] = newNSConfig;
|
|
|
crowi.setConfig(originalConfig);
|
|
|
+
|
|
|
+ // uglify and store
|
|
|
+ Config.generateUglifiedCustomCss(originalConfig);
|
|
|
};
|
|
|
|
|
|
// Execute only once for installing application
|
|
|
@@ -241,8 +245,7 @@ module.exports = function(crowi) {
|
|
|
configSchema.statics.generateUglifiedCustomCss = function(config)
|
|
|
{
|
|
|
var rawCss = config.crowi['customize:css'] || getArrayForInstalling()['customize:css'];
|
|
|
- // TODO uglify
|
|
|
- this.uglifiedCustomCss = rawCss;
|
|
|
+ this.uglifiedCustomCss = uglifycss.processString(rawCss);
|
|
|
}
|
|
|
|
|
|
configSchema.statics.customCss = function(config)
|