X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=www%2Fiphone%2Fiphone.js;h=93008b187b9cd20bc9afd85c42535f85ab8a8660;hb=9b8a842cb328ac45bff04dae8f7e564ba1fc3b3e;hp=65c7d1e93549418e299dc9989a99c7bc8101c8da;hpb=280fb8002349827f12b55c6a735317a58beee324;p=pazpar2-moved-to-github.git diff --git a/www/iphone/iphone.js b/www/iphone/iphone.js index 65c7d1e..93008b1 100644 --- a/www/iphone/iphone.js +++ b/www/iphone/iphone.js @@ -1,6 +1,5 @@ var count = 0; var termlist = {}; -var JSON = JSON || {}; var inApp = false; var callback = {}; @@ -35,33 +34,12 @@ callback.send = function() var message = "myapp:" + args.join(":"); if (this.type == 'iphone') document.location = message; - else - document.getElementById("log").innerHTML = message; + else { + // Debug communication with Web View + // document.getElementById("log").innerHTML = message; + } } -// implement JSON.stringify serialization -JSON.stringify = JSON.stringify || function(obj) { - var t = typeof (obj); - if (t != "object" || obj === null) { - // simple data type - if (t == "string") - obj = '"' + obj + '"'; - return String(obj); - } else { - // recurse array or object - var n, v, json = [], arr = (obj && obj.constructor == Array); - for (n in obj) { - v = obj[n]; - t = typeof (v); - if (t == "string") - v = '"' + v + '"'; - else if (t == "object" && v !== null) - v = JSON.stringify(v); - json.push((arr ? "" : '"' + n + '":') + String(v)); - } - return (arr ? "[" : "{") + String(json) + (arr ? "]" : "}"); - } -}; function search(message) { document.search.query.value = message;