|
|
@@ -124,9 +124,9 @@ module.exports = function(crowi) {
|
|
|
originalConfig[ns] = newNSConfig;
|
|
|
crowi.setConfig(originalConfig);
|
|
|
|
|
|
- // uglify and store
|
|
|
- Config.generateUglifiedCustomCss(originalConfig);
|
|
|
- Config.generateTranspiledCustomScript(originalConfig);
|
|
|
+ // initialize custom css/script
|
|
|
+ Config.initCustomCss(originalConfig);
|
|
|
+ Config.initCustomScript(originalConfig);
|
|
|
};
|
|
|
|
|
|
// Execute only once for installing application
|
|
|
@@ -227,9 +227,9 @@ module.exports = function(crowi) {
|
|
|
|
|
|
debug('Config loaded', config);
|
|
|
|
|
|
- // uglify and store
|
|
|
- Config.generateUglifiedCustomCss(config);
|
|
|
- Config.generateTranspiledCustomScript(config);
|
|
|
+ // initialize custom css/script
|
|
|
+ Config.initCustomCss(config);
|
|
|
+ Config.initCustomScript(config);
|
|
|
|
|
|
return callback(null, config);
|
|
|
});
|
|
|
@@ -291,34 +291,32 @@ module.exports = function(crowi) {
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
- * uglify and store custom css strings
|
|
|
+ * initialize custom css strings
|
|
|
*/
|
|
|
- configSchema.statics.generateUglifiedCustomCss = function(config)
|
|
|
+ configSchema.statics.initCustomCss = function(config)
|
|
|
{
|
|
|
const key = 'customize:css';
|
|
|
const rawCss = getValueForCrowiNS(config, key);
|
|
|
- this.uglifiedCustomCss = uglifycss.processString(rawCss);
|
|
|
+ // uglify and store
|
|
|
+ this._customCss = uglifycss.processString(rawCss);
|
|
|
}
|
|
|
|
|
|
configSchema.statics.customCss = function(config)
|
|
|
{
|
|
|
- return this.uglifiedCustomCss;
|
|
|
+ return this._customCss;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * transpile, uglify and store custom script strings
|
|
|
- */
|
|
|
- configSchema.statics.generateTranspiledCustomScript = function(config)
|
|
|
+ configSchema.statics.initCustomScript = function(config)
|
|
|
{
|
|
|
const key = 'customize:script';
|
|
|
const rawScript = getValueForCrowiNS(config, key);
|
|
|
- // TODO transpile and Uglify
|
|
|
- this.transpiledCustomScript = rawScript;
|
|
|
+ // store as is
|
|
|
+ this._customScript = rawScript;
|
|
|
}
|
|
|
|
|
|
configSchema.statics.customScript = function(config)
|
|
|
{
|
|
|
- return this.transpiledCustomScript;
|
|
|
+ return this._customScript;
|
|
|
}
|
|
|
|
|
|
configSchema.statics.behaviorType = function(config)
|