From 225b1ddc452730bc63bd4b4fd9031690980e9521 Mon Sep 17 00:00:00 2001 From: dilanua Date: Fri, 22 Jul 2016 17:08:55 +0530 Subject: [PATCH] Refactoring device-mgt-props --- .../devicemgt/app/conf/devicemgt-props.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/devicemgt-props.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/devicemgt-props.js index 9200130ab02..39a7c2eb513 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/devicemgt-props.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/devicemgt-props.js @@ -17,23 +17,23 @@ */ var config = function () { - var conf = application.get("PINCH_CONFIG"); + var conf = application.get("UI_CONFIG"); if (!conf) { - var pinch = require('/app/modules/pinch.min.js').pinch; - var server = require('carbon').server; - var config = require('/app/conf/config.json'); + var pinch = require("/app/modules/pinch.min.js")["pinch"]; + var server = require("carbon")["server"]; + var config = require("/app/conf/config.json"); pinch(config, /^/, function (path, key, value) { - if ((typeof value === 'string') && value.indexOf('%https.ip%') > -1) { - return value.replace('%https.ip%', server.address("https")); - } else if ((typeof value === 'string') && value.indexOf('%http.ip%') > -1) { - return value.replace('%http.ip%', server.address("http")); - } else if ((typeof value === 'string') && value.indexOf('%date-year%') > -1) { + if ((typeof value === "string") && value.indexOf("%https.ip%") > -1) { + return value.replace("%https.ip%", server.address("https")); + } else if ((typeof value === "string") && value.indexOf("%http.ip%") > -1) { + return value.replace("%http.ip%", server.address("http")); + } else if ((typeof value === "string") && value.indexOf("%date-year%") > -1) { var year = new Date().getFullYear(); return value.replace("%date-year%", year); } return value; }); - application.put("PINCH_CONFIG", config); + application.put("UI_CONFIG", config); conf = config; } return conf;