I'm working on themeing/skining of website using Absurd.js. I have theme data stored in data1.js, data2.js, data3.js and so on which passes data to the controller.js file. Changing the variable values affects the entire site with the values. Moreover we are using MultiTenant platform, where controller is one common file and data is dependent on instance of main branch. Each instance is for each client and have their own skinning (skin comes from data file).
Challenge I'm facing is, if I add a new parameter to one data file, I have to update/add all the data.js file with that parameter. Add it to the function call and as well update my contoller.js file to receive that new parameter. Its becoming tedious.
Question: Is there any tool out there to help with the file synchronization
To be more clear here is the sample file
data1.js
========
var primaryThemeColor = "#343344";
/* Primary Button Theme Colors*/
var primaryBtnBgColor = "#1A7483";
var primaryBtnBgHoverColor = "#0e233b";
var primaryBtnBorderColor = "#0093D2";
var primaryBtnFontColor = "#1A3567";
var primaryBtnFontHoverColor = "#D1ECF2";
skinComponent(primaryThemeColor,
primaryBtnBgColor,
primaryBtnBgHoverColor,
primaryBtnBorderColor,
primaryBtnFontColor,
primaryBtnFontHoverColor);
data2.js
var primaryThemeColor = "#413098";
/* Primary Button Theme Colors*/
var primaryBtnBgColor = "#38471A";
var primaryBtnBgHoverColor = "#b332e0";
var primaryBtnBorderColor = "#2d3300";
var primaryBtnFontColor = "#671A33";
var primaryBtnFontHoverColor = "#D3D3D3";
skinComponent(primaryThemeColor,
primaryBtnBgColor,
primaryBtnBgHoverColor,
primaryBtnBorderColor,
primaryBtnFontColor,
primaryBtnFontHoverColor);
data3.js, data4.js and so on... Here is my controller file
contoller.js
============
constructor: function(primaryThemeColor,
primaryBtnBgColor,
primaryBtnBgHoverColor,
primaryBtnBorderColor,
primaryBtnFontColor,
primaryBtnFontHoverColor){
this.primaryThemeColor = primaryThemeColor;
this.primaryBtnBgColor = primaryBtnBgColor;
this.primaryBtnBgHoverColor = primaryBtnBgHoverColor;
this.primaryBtnBorderColor = primaryBtnBorderColor;
this.primaryBtnFontColor = primaryBtnFontColor;
this.primaryBtnFontHoverColor = primaryBtnFontHoverColor;
});
You could do something like this. Although I feel like this is ill suited for a large amount of variations... I would imagine serving them with a persistant storage solution with a DB would be the best if these became too numerous.