summaryrefslogtreecommitdiff
path: root/functions.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-11-05 16:16:30 +0300
committerAndrew Dolgov <[email protected]>2010-11-05 16:16:30 +0300
commitf1f3a642d651c2120e52c8df2edc50dc72d0c756 (patch)
tree0604454f9c1878fcf88a58518b619a420eff65c5 /functions.js
parent21884958060f9e21e45e1f8a27c05a5326545a69 (diff)
use JSON for init-params
Diffstat (limited to 'functions.js')
-rw-r--r--functions.js34
1 files changed, 19 insertions, 15 deletions
diff --git a/functions.js b/functions.js
index c0ba5b349..01c3c0508 100644
--- a/functions.js
+++ b/functions.js
@@ -460,7 +460,7 @@ function parse_counters(reply, scheduled_call) {
if (has_img && feed_img) {
if (!feed_img.src.match(id + ".ico")) {
- feed_img.src = getInitParam("icons_location") + "/" + id + ".ico";
+ feed_img.src = getInitParam("icons_url") + "/" + id + ".ico";
}
}
@@ -2167,21 +2167,25 @@ function backend_sanity_check_callback(transport) {
if (params) {
console.log('reading init-params...');
- var param = params.firstChild;
-
- while (param) {
- var k = param.getAttribute("key");
- var v = param.getAttribute("value");
- console.log(k + " => " + v);
- init_params[k] = v;
-
- if (db) {
- db.execute("DELETE FROM init_params WHERE key = ?", [k]);
- db.execute("INSERT INTO init_params (key,value) VALUES (?, ?)",
- [k, v]);
- }
+ //var param = params.firstChild;
+
+ params = JSON.parse(params.firstChild.nodeValue);
- param = param.nextSibling;
+ if (params) {
+ for (var i = 0; i < params.length; i++) {
+
+ var k = params[i].param;
+ var v = params[i].value;
+
+ console.log(k + " => " + v);
+ init_params[k] = v;
+
+ if (db) {
+ db.execute("DELETE FROM init_params WHERE key = ?", [k]);
+ db.execute("INSERT INTO init_params (key,value) VALUES (?, ?)",
+ [k, v]);
+ }
+ }
}
}