Added parameter for overriding the config.
Change-Id: I2606dcc855e0e6fc053b7337f7de9fd1787f6888
diff --git a/client/catalog-dev/js/catalog.js b/client/catalog-dev/js/catalog.js
index 1e4866c..84a62c5 100644
--- a/client/catalog-dev/js/catalog.js
+++ b/client/catalog-dev/js/catalog.js
@@ -24,6 +24,22 @@
});
})
]).then(function(){
+
+ var getParameterByName = function(name){
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
+ var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
+ results = regex.exec(location.search);
+ return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
+ }
+
+ //Overwrite config if present. Any failure will just cause this to be skipped.
+ try{
+ var configParam = JSON.parse(getParameterByName('config'));
+ config = jQuery.extend(true, config, configParam);
+ } catch(e){
+ console.warn("Failure in config overwrite, skipping.", e);
+ }
+
new Atmos(config);
}, function(){
console.error("Failed to initialize!");