Commit 9a5247d3 authored by Marc Duez's avatar Marc Duez
Browse files

main.js : init config info

parent c98b85c3
...@@ -46,7 +46,7 @@ Builder.prototype = { ...@@ -46,7 +46,7 @@ Builder.prototype = {
} }
}, },
updateElem: function () {}, updateElem: function () {},
updateElemStyle: function () {}, updateElemStyle: function () {},
......
var DB_ADDRESS = "http://134.206.11.64:8000/Vidjil/default/"; var DB_ADDRESS = "http://134.206.11.64:8000/Vidjil/default/";
var CGI_ADDRESS = "http://127.0.1.1/cgi-bin/"; var CGI_ADDRESS = "http://127.0.1.1/cgi-bin/";
/*load user config if exist
*
* */
if (typeof config != 'undefined' && config.cgi_address){
if (config.cgi_address) CGI_ADDRESS = config.cgi_address
if (config.db_address) DB_ADDRESS = config.db_address
}
/* Model /* Model
* *
* */ * */
...@@ -30,4 +22,44 @@ var builder = new Builder(m); ...@@ -30,4 +22,44 @@ var builder = new Builder(m);
* */ * */
var db = new Database("plop!", DB_ADDRESS); var db = new Database("plop!", DB_ADDRESS);
initTag();//TODO a enlever
\ No newline at end of file
/*load user config if exist
*
* */
if (typeof config != 'undefined') {
if (config.cgi_address){
if (config.cgi_address) CGI_ADDRESS = config.cgi_address
if (config.db_address) DB_ADDRESS = config.db_address
}
if (config.use_database){
$('#database_menu').css("display", "")
}
if (config.demo_file && config.demo_file.length != 0){
$('#demo_file_menu').css("display", "")
var demo_file = document.getElementById("demoSelector")
for (var i = 0; i < tagName.length; i++) {
(function (i) {
var path = config.demo_file[i].split("/")
var a = document.createElement('a');
a.className = "buttonSelector"
a.onclick = function () {
m.loadDataUrl(config.demo_file[i])
}
a.appendChild(document.createTextNode(path[path.length-1]))
demo_file.appendChild(a);
})(i)
}
}
}
initTag();//TODO a enlever
...@@ -130,7 +130,6 @@ Model.prototype = { ...@@ -130,7 +130,6 @@ Model.prototype = {
} }
}, //end load }, //end load
parseJsonData: function (data, limit) { parseJsonData: function (data, limit) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment