From 19a3b28898d1e5c390d76dca49ae32b02def1806 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 5 Jan 2011 09:39:36 -0800 Subject: [PATCH] Remove json2 author's "don't hotlink my script pls" alert line from our local copy of json2.js :D Added json2.min.js to the makefile so it can be updated easily when json2.js changes. --- js/Makefile | 9 ++++++--- js/json2.js | 1 - js/json2.min.js | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/js/Makefile b/js/Makefile index e7ae44e421..2f3dfcdf70 100644 --- a/js/Makefile +++ b/js/Makefile @@ -1,12 +1,15 @@ .fake: all clean -TARGETS=util.min.js -SOURCES=util.js xbImportNode.js geometa.js +TARGETS=util.min.js json2.min.js +UTIL_SOURCES=util.js xbImportNode.js geometa.js all: $(TARGETS) clean: rm -f $(TARGETS) -util.min.js: $(SOURCES) +util.min.js: $(UTIL_SOURCES) cat $+ | yui-compressor --type js > $@ + +json2.min.js: json2.js + yui-compressor $+ > $@ diff --git a/js/json2.js b/js/json2.js index e9ccc0d376..6bdea10e51 100644 --- a/js/json2.js +++ b/js/json2.js @@ -1,4 +1,3 @@ -alert('IMPORTANT: Remove this line from json2.js before deployment.'); /* http://www.JSON.org/json2.js 2010-08-25 diff --git a/js/json2.min.js b/js/json2.min.js index e84c5f70fc..08977b590c 100644 --- a/js/json2.min.js +++ b/js/json2.min.js @@ -1 +1 @@ -alert("IMPORTANT: Remove this line from json2.js before deployment.");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