From ef6fbc3d9191ccede8fd86e265f2b24aee1e7a5a Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 6 Apr 2011 23:50:58 +0200 Subject: [PATCH] replace json parser by jquery --- htdocs/frontend/javascripts/functions.js | 3 +- htdocs/frontend/javascripts/json.js | 38 ------------------------ 2 files changed, 1 insertion(+), 40 deletions(-) delete mode 100644 htdocs/frontend/javascripts/json.js diff --git a/htdocs/frontend/javascripts/functions.js b/htdocs/frontend/javascripts/functions.js index 6bc6d25..5c9e9aa 100644 --- a/htdocs/frontend/javascripts/functions.js +++ b/htdocs/frontend/javascripts/functions.js @@ -34,7 +34,7 @@ vz.load = function(args) { error: function(xhr) { try { if (xhr.getResponseHeader('Content-type') == 'application/json') { - var json = JSON.parse(xhr.responseText); + var json = $.parseJSON(xhr.responseText); if (json.exception) { throw new Exception(json.exception.type, json.exception.message, (json.exception.code) ? json.exception.code : xhr.status); @@ -93,7 +93,6 @@ vz.parseUrlParams = function() { vz.capabilities.load = function() { return vz.load({ controller: 'capabilities', - identifier: 'definitions', success: function(json) { $.extend(true, vz.capabilities, json.capabilities); } diff --git a/htdocs/frontend/javascripts/json.js b/htdocs/frontend/javascripts/json.js deleted file mode 100644 index 4782e97..0000000 --- a/htdocs/frontend/javascripts/json.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * JSON parser and stringifier - * - * http://www.JSON.org/json2.js (2010-08-25) - * - * Public Domain. - * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. - * - * See http://www.JSON.org/js.html - */ -if(!this.JSON){this.JSON={};} -(function(){function f(n){return n<10?'0'+n:n;} -if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+ -f(this.getUTCMonth()+1)+'-'+ -f(this.getUTCDate())+'T'+ -f(this.getUTCHours())+':'+ -f(this.getUTCMinutes())+':'+ -f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};} -var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';} -function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);} -if(typeof rep==='function'){value=rep.call(holder,key,value);} -switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';} -gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i