|
|
@@ -68,6 +68,7 @@ module.exports = function(crowi) {
|
|
|
'plugin:isEnabledPlugins' : true,
|
|
|
|
|
|
'customize:css' : '',
|
|
|
+ 'customize:script' : '',
|
|
|
'customize:behavior' : 'crowi',
|
|
|
'customize:layout' : 'crowi',
|
|
|
'customize:isEnabledTimeline' : true,
|
|
|
@@ -125,6 +126,7 @@ module.exports = function(crowi) {
|
|
|
|
|
|
// uglify and store
|
|
|
Config.generateUglifiedCustomCss(originalConfig);
|
|
|
+ Config.generateTranspiledCustomScript(originalConfig);
|
|
|
};
|
|
|
|
|
|
// Execute only once for installing application
|
|
|
@@ -227,6 +229,7 @@ module.exports = function(crowi) {
|
|
|
|
|
|
// uglify and store
|
|
|
Config.generateUglifiedCustomCss(config);
|
|
|
+ Config.generateTranspiledCustomScript(config);
|
|
|
|
|
|
return callback(null, config);
|
|
|
});
|
|
|
@@ -288,7 +291,7 @@ module.exports = function(crowi) {
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
- * uglify store custom css strings
|
|
|
+ * uglify and store custom css strings
|
|
|
*/
|
|
|
configSchema.statics.generateUglifiedCustomCss = function(config)
|
|
|
{
|
|
|
@@ -302,6 +305,22 @@ module.exports = function(crowi) {
|
|
|
return this.uglifiedCustomCss;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * transpile, uglify and store custom script strings
|
|
|
+ */
|
|
|
+ configSchema.statics.generateTranspiledCustomScript = function(config)
|
|
|
+ {
|
|
|
+ const key = 'customize:script';
|
|
|
+ const rawScript = getValueForCrowiNS(config, key);
|
|
|
+ // TODO transpile and Uglify
|
|
|
+ this.transpiledCustomScript = rawScript;
|
|
|
+ }
|
|
|
+
|
|
|
+ configSchema.statics.customScript = function(config)
|
|
|
+ {
|
|
|
+ return this.transpiledCustomScript;
|
|
|
+ }
|
|
|
+
|
|
|
configSchema.statics.behaviorType = function(config)
|
|
|
{
|
|
|
const key = 'customize:behavior';
|