diff --git a/README.md b/README.md
index d57d4005..80b0fa33 100644
--- a/README.md
+++ b/README.md
@@ -64,6 +64,10 @@ Wax includes two libraries in `/lib` which are included in builds
## Changelog
+#### 1.0.2
+
+* Bug fixes for Firefox 3
+
#### 1.0.1
* `make ext` added for downloading and installing external libraries needed to use examples.
diff --git a/build/wax.g.js b/build/wax.g.js
index e591726f..e41d5190 100644
--- a/build/wax.g.js
+++ b/build/wax.g.js
@@ -310,7 +310,7 @@ wax.Record = function(obj, context) {
args = args.length ? wax.Record(args) : [];
// real browsers
- if (!$.browser.msie) {
+ if (Object.create) {
obj = Object.create(fn_obj[1].prototype);
fn_obj[1].apply(obj, args);
// lord have mercy on your soul.
@@ -395,19 +395,15 @@ wax.Record = function(obj, context) {
case '@call':
return runFunction(statement.subject, statement.object, null);
}
- } else {
- // Reify object/arrays.
- try {
- var keys = _.keys(obj);
- for (i = 0; i < keys.length; i++) {
- var key = keys[i];
- obj[key] = wax.Record(obj[key], context);
- }
- return obj;
- // Unwrapped scalars
- } catch(e) {
- return obj;
+ } else if (typeof obj === 'object') {
+ var keys = _.keys(obj);
+ for (i = 0; i < keys.length; i++) {
+ var key = keys[i];
+ obj[key] = wax.Record(obj[key], context);
}
+ return obj;
+ } else {
+ return obj;
}
};
// Underscore.js 1.1.4
diff --git a/build/wax.g.min.js b/build/wax.g.min.js
index d4c9aa7e..2b7a083d 100644
--- a/build/wax.g.min.js
+++ b/build/wax.g.min.js
@@ -7,4 +7,4 @@
*
* This document is licensed as free software under the terms of the
* MIT License: http://www.opensource.org/licenses/mit-license.php
- */(function(a,b){function B(m){function P(a){!(M++)&&b(function(){N(),G&&a!=u&&(x[I]=a),f(m.error,m,[m,a]),f(B,m,[m,a])},0)}function O(a){!(M++)&&b(function(){N(),G&&(x[I]={s:[a]}),C&&(a=C.apply(m,[a])),f(m.success,m,[a,t]),f(B,m,[m,t])},0)}m=a.extend({},A,m);var B=m.complete,C=m.dataFilter,D=m.callbackParameter,E=m.callback,F=m.cache,G=m.pageCache,H=m.charset,I=m.url,J=m.data,K=m.timeout,L,M=0,N=c;m.abort=function(){!(M++)&&N()};if(f(m.beforeSend,m,[m])===!1||M)return m;I=I||j,J=J?typeof J=="string"?J:a.param(J,m.traditional):j,I+=J?g(I)+J:j,D&&(I+=g(I)+encodeURIComponent(D)+"=?"),!F&&!G&&(I+=g(I)+"_"+(new Date).getTime()+"="),I=I.replace(/=\?(&|$)/,"="+E+"$1"),G&&(L=x[I])?L.s?O(L.s[0]):P(L):b(function(f,g,j){if(!M){j=K>0&&b(function(){P(u)},K),N=function(){j&&clearTimeout(j),f[q]=f[n]=f[p]=f[o]=null,w[r](f),g&&w[r](g)},window[E]=d,f=a(s)[0],f.id=l+y++,H&&(f[i]=H);function m(a){(f[n]||c)(),a=z,z=undefined,a?O(a[0]):P(k)}v.msie?(f.event=n,f.htmlFor=f.id,f[q]=function(){/loaded|complete/.test(f.readyState)&&m()}):(f[o]=f[p]=m,v.opera?(g=a(s)[0]).text="jQuery('#"+f.id+"')[0]."+o+"()":f[h]=h),f.src=I,e(f),g&&e(g)}},0);return m}function g(a){return/\?/.test(a)?"&":"?"}function f(a,b,c){return a&&a.apply(b.context||b,c)}function e(a){w.insertBefore(a,w.firstChild)}function d(a){z=[a]}function c(){}var h="async",i="charset",j="",k="error",l="_jqjsp",m="on",n=m+"click",o=m+k,p=m+"load",q=m+"readystatechange",r="removeChild",s="",t="success",u="timeout",v=a.browser,w=a("head")[0]||document.documentElement,x={},y=0,z,A={callback:l,url:location.href};B.setup=function(b){a.extend(A,b)},a.jsonp=B})(jQuery,setTimeout);var wax=wax||{};wax.Record=function(a,b){var c=function(a,b){var c=_.reduce(a.split("."),function(a,b){return[a[1]||a[0],a[1]?a[1][b]:a[0][b]]},[b||window,null]);return c},d=function(a,b){var d=c(a),e;b=b.length?wax.Record(b):[];if(!$.browser.msie)e=Object.create(d[1].prototype),d[1].apply(e,b);else switch(b.length){case 0:e=new d[1];break;case 1:e=new d[1](b[0]);break;case 2:e=new d[1](b[0],b[1]);break;case 3:e=new d[1](b[0],b[1],b[2]);break;case 4:e=new d[1](b[0],b[1],b[2],b[3]);break;case 5:e=new d[1](b[0],b[1],b[2],b[3],b[4]);break;default:}return e},e=function(a,b,d){var e=c(a,d),f=b.length?wax.Record(b):[];return d&&a.indexOf(".")===-1?e[1].apply(d,f):e[1].apply(e[0],f)},f=function(a){return _.isString(a)&&_.indexOf(["@new","@call","@literal","@chain","@inject","@group"],a.split(" ")[0])!==-1},g=function(a){return _.isString(a)&&_.indexOf(["@new","@call","@chain"],a.split(" ")[0])!==-1},h=function(a){if(_.isArray(a)&&a[0]&&f(a[0]))return{verb:a[0].split(" ")[0],subject:a[0].split(" ")[1],object:a.slice(1)};return!1},i,j=!1,k=null,l=null,m=h(a);if(m)switch(m.verb){case"@group":for(i=0;i=d.computed&&(d={value:a,computed:g})});return d.value},u.min=function(a,b,c){if(!b&&u.isArray(a))return Math.min.apply(Math,a);var d={computed:Infinity};v(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;gd?1:0}),"value")},u.sortedIndex=function(a,b,c){c=c||u.identity;var d=0,e=a.length;while(d>1;c(a[f])=0})})},u.zip=function(){var a=f.call(arguments),b=u.max(u.pluck(a,"length")),c=Array(b);for(var d=0;d=0;c--)b=[a[c].apply(this,b)];return b[0]}},u.keys=t||function(a){if(u.isArray(a))return u.range(0,a.length);var b=[];for(var c in a)i.call(a,c)&&(b[b.length]=c);return b},u.values=function(a){return u.map(a,u.identity)},u.functions=u.methods=function(a){return u.filter(u.keys(a),function(b){return u.isFunction(a[b])}).sort()},u.extend=function(a){v(f.call(arguments,1),function(b){for(var c in b)a[c]=b[c]});return a},u.clone=function(a){return u.isArray(a)?a.slice():u.extend({},a)},u.tap=function(a,b){b(a);return a},u.isEqual=function(a,b){if(a===b)return!0;var c=typeof a,d=typeof b;if(c!=d)return!1;if(a==b)return!0;if(!a&&b||a&&!b)return!1;a._chain&&(a=a._wrapped),b._chain&&(b=b._wrapped);if(a.isEqual)return a.isEqual(b);if(u.isDate(a)&&u.isDate(b))return a.getTime()===b.getTime();if(u.isNaN(a)&&u.isNaN(b))return!1;if(u.isRegExp(a)&&u.isRegExp(b))return a.source===b.source&&a.global===b.global&&a.ignoreCase===b.ignoreCase&&a.multiline===b.multiline;if(c!=="object")return!1;if(a.length&&a.length!==b.length)return!1;var e=u.keys(a),f=u.keys(b);if(e.length!=f.length)return!1;for(var g in a)if(!(g in b)||!u.isEqual(a[g],b[g]))return!1;return!0},u.isEmpty=function(a){if(u.isArray(a)||u.isString(a))return a.length===0;for(var b in a)if(i.call(a,b))return!1;return!0},u.isElement=function(a){return!!a&&a.nodeType==1},u.isArray=s||function(a){return h.call(a)==="[object Array]"},u.isArguments=function(a){return!!a&&!!i.call(a,"callee")},u.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)},u.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)},u.isNumber=function(a){return!!(a===0||a&&a.toExponential&&a.toFixed)},u.isNaN=function(a){return a!==a},u.isBoolean=function(a){return a===!0||a===!1},u.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)},u.isRegExp=function(a){return!(!(a&&a.test&&a.exec)||!a.ignoreCase&&a.ignoreCase!==!1)},u.isNull=function(a){return a===null},u.isUndefined=function(a){return a===void 0},u.noConflict=function(){a._=b;return this},u.identity=function(a){return a},u.times=function(a,b,c){for(var d=0;d/g,interpolate:/<%=([\s\S]+?)%>/g},u.template=function(a,b){var c=u.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(c.interpolate,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(c.evaluate||null,function(a,b){return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj",d);return b?e(b):e};var z=function(a){this._wrapped=a};u.prototype=z.prototype;var A=function(a,b){return b?u(a).chain():a},B=function(a,b){z.prototype[a]=function(){var a=f.call(arguments);g.call(a,this._wrapped);return A(b.apply(u,a),this._chain)}};u.mixin(u),v(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=d[a];z.prototype[a]=function(){b.apply(this._wrapped,arguments);return A(this._wrapped,this._chain)}}),v(["concat","join","slice"],function(a){var b=d[a];z.prototype[a]=function(){return A(b.apply(this._wrapped,arguments),this._chain)}}),z.prototype.chain=function(){this._chain=!0;return this},z.prototype.value=function(){return this._wrapped}}();var wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(!this.locks[a]){var c=this;this.locks[a]=!0,$.jsonp({url:a,context:this,callback:"grid",callbackParameter:"callback",success:function(b){c.locks[a]=!1,c.cache[a]=b;for(var d=0;d=93&&a--,a>=35&&a--,a-=32;return a},wax.GridInstance.prototype.getFeature=function(a,b,c,d){if(!(Math.floor((b-$(c).offset().top)/this.tileRes)>256||Math.floor((a-$(c).offset().left)/this.tileRes)>256)){var e=this.grid_tile.grid[Math.floor((b-$(c).offset().top)/this.tileRes)].charCodeAt(Math.floor((a-$(c).offset().left)/this.tileRes));e=this.resolveCode(e);if(this.grid_tile.keys[e])return this.formatter.format(d,this.grid_tile.data[this.grid_tile.keys[e]])}},wax.GridManager=function(){this.grid_tiles={},this.key_maps={},this.formatters={},this.locks={}},wax.GridManager.prototype.getGrid=function(a,b){var c=this;c.getFormatter(c.formatterUrl(a),function(d){if(!d)return b(!1);wax.request.get(c.tileDataUrl(a),function(a){b(new wax.GridInstance(a,d))})})},wax.GridManager.prototype.makeEvent=function(a){return{target:a.target||a.srcElement,pX:a.pageX||a.clientX,pY:a.pageY||a.clientY,evt:a}},wax.GridManager.prototype.tileDataUrl=function(a){return a.replace(/(.png|.jpg|.jpeg)(\d*)/,".grid.json")},wax.GridManager.prototype.formatterUrl=function(a){return a.replace(/\d+\/\d+\/\d+\.\w+/,"layer.json")},wax.GridManager.prototype.getFormatter=function(a,b){var c=this;typeof this.formatters[a]!="undefined"?b(this.formatters[a]):wax.request.get(a,function(d){d&&d.formatter?c.formatters[a]=new wax.Formatter(d):c.formatters[a]=!1,b(c.formatters[a])})},wax.Formatter=function(obj){if(obj.formatter&&typeof obj.formatter=="string")try{eval("this.f = "+obj.formatter)}catch(e){console&&console.log(e)}else this.f=function(){}},wax.Formatter.prototype.format=function(a,b){try{return this.f(a,b)}catch(c){console&&console.log(c)}};var wax=wax||{};wax.Legend=function(a,b){!b&&(b=$('')),this.context=a,this.container=b,this.legends={},$(this.context).append(this.container)},wax.Legend.prototype.render=function(a){this.container.empty();var b=this,c=function(a){a?b.legends[e]?b.legends[e].show():(b.legends[e]=$("").append(a),b.container.append(b.legends[e])):b.legends[e]=!1};for(var d=0;d"+"").html(a),$(b).append(d));for(var e=c-1;e>0;e--){var f=$("div.wax-tooltip-"+e+":not(.removed)");f.size()>0&&f.addClass("hidden").hide()}return d},wax.tooltip.click=function(a,b,c){var d=wax.tooltip.getToolTip(a,b,c),e=$('Close');e.click(function(){d.addClass("removed").fadeOut("fast",function(){$(this).remove()});return!1}),d.addClass("wax-popup").html(a).append(e)},wax.tooltip.select=function(a,b,c){!a||(wax.tooltip.getToolTip(a,b,c),$(b).css("cursor","pointer"),$("div",b).css("cursor","pointer"))},wax.tooltip.unselect=function(a,b,c){$(b).css("cursor","default").children("div.wax-tooltip-"+c+":not(.wax-popup)").addClass("removed").fadeOut("fast",function(){$(this).remove()}),$("div",b).css("cursor","default"),$(b).children("div.wax-tooltip:first").removeClass("hidden").show()};var wax=wax||{};wax.g=wax.g||{},wax.g.Controls=function(a){this.map=a},wax.g.Controls.prototype.calculateGrid=function(){if(!this.map.interaction_grid){var a=$(".interactive-div-"+this.map.getZoom()+" img",this.map.d),b=$(this.map.d).offset(),c=$(a).map(function(c){var d=$(a[c]).offset();return{xy:{left:d.left-b.left,top:d.top-b.top},tile:a[c]}});return c}},wax.g.Controls.prototype.inTile=function(a,b){if(b.topa.y&&b.lefta.x)return!0},wax.g.Controls.prototype.Interaction=function(){var a=this,b=new wax.GridManager,c=null,d=function(b,c){var d=!1,e=a.calculateGrid();for(var f=0;f").addClass("interactive-div-"+b).width(256).height(256).append($("").attr("src",this.getTileUrl(a,b)).width(256).height(256))[0]},wax.g.MapType.prototype.releaseTile=function(a){$(a).remove()},wax.g.MapType.prototype.getTileUrl=function(a,b){var c=Math.abs(a.y-(Math.pow(2,b)-1));return a.x>=0&&c>=0?this.baseUrl+"/"+b+"/"+a.x+"/"+c+".png":this.blankImage}
\ No newline at end of file
+ */(function(a,b){function B(m){function P(a){!(M++)&&b(function(){N(),G&&a!=u&&(x[I]=a),f(m.error,m,[m,a]),f(B,m,[m,a])},0)}function O(a){!(M++)&&b(function(){N(),G&&(x[I]={s:[a]}),C&&(a=C.apply(m,[a])),f(m.success,m,[a,t]),f(B,m,[m,t])},0)}m=a.extend({},A,m);var B=m.complete,C=m.dataFilter,D=m.callbackParameter,E=m.callback,F=m.cache,G=m.pageCache,H=m.charset,I=m.url,J=m.data,K=m.timeout,L,M=0,N=c;m.abort=function(){!(M++)&&N()};if(f(m.beforeSend,m,[m])===!1||M)return m;I=I||j,J=J?typeof J=="string"?J:a.param(J,m.traditional):j,I+=J?g(I)+J:j,D&&(I+=g(I)+encodeURIComponent(D)+"=?"),!F&&!G&&(I+=g(I)+"_"+(new Date).getTime()+"="),I=I.replace(/=\?(&|$)/,"="+E+"$1"),G&&(L=x[I])?L.s?O(L.s[0]):P(L):b(function(f,g,j){if(!M){j=K>0&&b(function(){P(u)},K),N=function(){j&&clearTimeout(j),f[q]=f[n]=f[p]=f[o]=null,w[r](f),g&&w[r](g)},window[E]=d,f=a(s)[0],f.id=l+y++,H&&(f[i]=H);function m(a){(f[n]||c)(),a=z,z=undefined,a?O(a[0]):P(k)}v.msie?(f.event=n,f.htmlFor=f.id,f[q]=function(){/loaded|complete/.test(f.readyState)&&m()}):(f[o]=f[p]=m,v.opera?(g=a(s)[0]).text="jQuery('#"+f.id+"')[0]."+o+"()":f[h]=h),f.src=I,e(f),g&&e(g)}},0);return m}function g(a){return/\?/.test(a)?"&":"?"}function f(a,b,c){return a&&a.apply(b.context||b,c)}function e(a){w.insertBefore(a,w.firstChild)}function d(a){z=[a]}function c(){}var h="async",i="charset",j="",k="error",l="_jqjsp",m="on",n=m+"click",o=m+k,p=m+"load",q=m+"readystatechange",r="removeChild",s="",t="success",u="timeout",v=a.browser,w=a("head")[0]||document.documentElement,x={},y=0,z,A={callback:l,url:location.href};B.setup=function(b){a.extend(A,b)},a.jsonp=B})(jQuery,setTimeout);var wax=wax||{};wax.Record=function(a,b){var c=function(a,b){var c=_.reduce(a.split("."),function(a,b){return[a[1]||a[0],a[1]?a[1][b]:a[0][b]]},[b||window,null]);return c},d=function(a,b){var d=c(a),e;b=b.length?wax.Record(b):[];if(Object.create)e=Object.create(d[1].prototype),d[1].apply(e,b);else switch(b.length){case 0:e=new d[1];break;case 1:e=new d[1](b[0]);break;case 2:e=new d[1](b[0],b[1]);break;case 3:e=new d[1](b[0],b[1],b[2]);break;case 4:e=new d[1](b[0],b[1],b[2],b[3]);break;case 5:e=new d[1](b[0],b[1],b[2],b[3],b[4]);break;default:}return e},e=function(a,b,d){var e=c(a,d),f=b.length?wax.Record(b):[];return d&&a.indexOf(".")===-1?e[1].apply(d,f):e[1].apply(e[0],f)},f=function(a){return _.isString(a)&&_.indexOf(["@new","@call","@literal","@chain","@inject","@group"],a.split(" ")[0])!==-1},g=function(a){return _.isString(a)&&_.indexOf(["@new","@call","@chain"],a.split(" ")[0])!==-1},h=function(a){if(_.isArray(a)&&a[0]&&f(a[0]))return{verb:a[0].split(" ")[0],subject:a[0].split(" ")[1],object:a.slice(1)};return!1},i,j=!1,k=null,l=null,m=h(a);if(!m){if(typeof a=="object"){var n=_.keys(a);for(i=0;i=d.computed&&(d={value:a,computed:g})});return d.value},u.min=function(a,b,c){if(!b&&u.isArray(a))return Math.min.apply(Math,a);var d={computed:Infinity};v(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;gd?1:0}),"value")},u.sortedIndex=function(a,b,c){c=c||u.identity;var d=0,e=a.length;while(d>1;c(a[f])=0})})},u.zip=function(){var a=f.call(arguments),b=u.max(u.pluck(a,"length")),c=Array(b);for(var d=0;d=0;c--)b=[a[c].apply(this,b)];return b[0]}},u.keys=t||function(a){if(u.isArray(a))return u.range(0,a.length);var b=[];for(var c in a)i.call(a,c)&&(b[b.length]=c);return b},u.values=function(a){return u.map(a,u.identity)},u.functions=u.methods=function(a){return u.filter(u.keys(a),function(b){return u.isFunction(a[b])}).sort()},u.extend=function(a){v(f.call(arguments,1),function(b){for(var c in b)a[c]=b[c]});return a},u.clone=function(a){return u.isArray(a)?a.slice():u.extend({},a)},u.tap=function(a,b){b(a);return a},u.isEqual=function(a,b){if(a===b)return!0;var c=typeof a,d=typeof b;if(c!=d)return!1;if(a==b)return!0;if(!a&&b||a&&!b)return!1;a._chain&&(a=a._wrapped),b._chain&&(b=b._wrapped);if(a.isEqual)return a.isEqual(b);if(u.isDate(a)&&u.isDate(b))return a.getTime()===b.getTime();if(u.isNaN(a)&&u.isNaN(b))return!1;if(u.isRegExp(a)&&u.isRegExp(b))return a.source===b.source&&a.global===b.global&&a.ignoreCase===b.ignoreCase&&a.multiline===b.multiline;if(c!=="object")return!1;if(a.length&&a.length!==b.length)return!1;var e=u.keys(a),f=u.keys(b);if(e.length!=f.length)return!1;for(var g in a)if(!(g in b)||!u.isEqual(a[g],b[g]))return!1;return!0},u.isEmpty=function(a){if(u.isArray(a)||u.isString(a))return a.length===0;for(var b in a)if(i.call(a,b))return!1;return!0},u.isElement=function(a){return!!a&&a.nodeType==1},u.isArray=s||function(a){return h.call(a)==="[object Array]"},u.isArguments=function(a){return!!a&&!!i.call(a,"callee")},u.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)},u.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)},u.isNumber=function(a){return!!(a===0||a&&a.toExponential&&a.toFixed)},u.isNaN=function(a){return a!==a},u.isBoolean=function(a){return a===!0||a===!1},u.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)},u.isRegExp=function(a){return!(!(a&&a.test&&a.exec)||!a.ignoreCase&&a.ignoreCase!==!1)},u.isNull=function(a){return a===null},u.isUndefined=function(a){return a===void 0},u.noConflict=function(){a._=b;return this},u.identity=function(a){return a},u.times=function(a,b,c){for(var d=0;d/g,interpolate:/<%=([\s\S]+?)%>/g},u.template=function(a,b){var c=u.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(c.interpolate,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(c.evaluate||null,function(a,b){return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj",d);return b?e(b):e};var z=function(a){this._wrapped=a};u.prototype=z.prototype;var A=function(a,b){return b?u(a).chain():a},B=function(a,b){z.prototype[a]=function(){var a=f.call(arguments);g.call(a,this._wrapped);return A(b.apply(u,a),this._chain)}};u.mixin(u),v(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=d[a];z.prototype[a]=function(){b.apply(this._wrapped,arguments);return A(this._wrapped,this._chain)}}),v(["concat","join","slice"],function(a){var b=d[a];z.prototype[a]=function(){return A(b.apply(this._wrapped,arguments),this._chain)}}),z.prototype.chain=function(){this._chain=!0;return this},z.prototype.value=function(){return this._wrapped}}();var wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(!this.locks[a]){var c=this;this.locks[a]=!0,$.jsonp({url:a,context:this,callback:"grid",callbackParameter:"callback",success:function(b){c.locks[a]=!1,c.cache[a]=b;for(var d=0;d=93&&a--,a>=35&&a--,a-=32;return a},wax.GridInstance.prototype.getFeature=function(a,b,c,d){if(!(Math.floor((b-$(c).offset().top)/this.tileRes)>256||Math.floor((a-$(c).offset().left)/this.tileRes)>256)){var e=this.grid_tile.grid[Math.floor((b-$(c).offset().top)/this.tileRes)].charCodeAt(Math.floor((a-$(c).offset().left)/this.tileRes));e=this.resolveCode(e);if(this.grid_tile.keys[e])return this.formatter.format(d,this.grid_tile.data[this.grid_tile.keys[e]])}},wax.GridManager=function(){this.grid_tiles={},this.key_maps={},this.formatters={},this.locks={}},wax.GridManager.prototype.getGrid=function(a,b){var c=this;c.getFormatter(c.formatterUrl(a),function(d){if(!d)return b(!1);wax.request.get(c.tileDataUrl(a),function(a){b(new wax.GridInstance(a,d))})})},wax.GridManager.prototype.makeEvent=function(a){return{target:a.target||a.srcElement,pX:a.pageX||a.clientX,pY:a.pageY||a.clientY,evt:a}},wax.GridManager.prototype.tileDataUrl=function(a){return a.replace(/(.png|.jpg|.jpeg)(\d*)/,".grid.json")},wax.GridManager.prototype.formatterUrl=function(a){return a.replace(/\d+\/\d+\/\d+\.\w+/,"layer.json")},wax.GridManager.prototype.getFormatter=function(a,b){var c=this;typeof this.formatters[a]!="undefined"?b(this.formatters[a]):wax.request.get(a,function(d){d&&d.formatter?c.formatters[a]=new wax.Formatter(d):c.formatters[a]=!1,b(c.formatters[a])})},wax.Formatter=function(obj){if(obj.formatter&&typeof obj.formatter=="string")try{eval("this.f = "+obj.formatter)}catch(e){console&&console.log(e)}else this.f=function(){}},wax.Formatter.prototype.format=function(a,b){try{return this.f(a,b)}catch(c){console&&console.log(c)}};var wax=wax||{};wax.Legend=function(a,b){!b&&(b=$('')),this.context=a,this.container=b,this.legends={},$(this.context).append(this.container)},wax.Legend.prototype.render=function(a){this.container.empty();var b=this,c=function(a){a?b.legends[e]?b.legends[e].show():(b.legends[e]=$("").append(a),b.container.append(b.legends[e])):b.legends[e]=!1};for(var d=0;d"+"").html(a),$(b).append(d));for(var e=c-1;e>0;e--){var f=$("div.wax-tooltip-"+e+":not(.removed)");f.size()>0&&f.addClass("hidden").hide()}return d},wax.tooltip.click=function(a,b,c){var d=wax.tooltip.getToolTip(a,b,c),e=$('Close');e.click(function(){d.addClass("removed").fadeOut("fast",function(){$(this).remove()});return!1}),d.addClass("wax-popup").html(a).append(e)},wax.tooltip.select=function(a,b,c){!a||(wax.tooltip.getToolTip(a,b,c),$(b).css("cursor","pointer"),$("div",b).css("cursor","pointer"))},wax.tooltip.unselect=function(a,b,c){$(b).css("cursor","default").children("div.wax-tooltip-"+c+":not(.wax-popup)").addClass("removed").fadeOut("fast",function(){$(this).remove()}),$("div",b).css("cursor","default"),$(b).children("div.wax-tooltip:first").removeClass("hidden").show()};var wax=wax||{};wax.g=wax.g||{},wax.g.Controls=function(a){this.map=a},wax.g.Controls.prototype.calculateGrid=function(){if(!this.map.interaction_grid){var a=$(".interactive-div-"+this.map.getZoom()+" img",this.map.d),b=$(this.map.d).offset(),c=$(a).map(function(c){var d=$(a[c]).offset();return{xy:{left:d.left-b.left,top:d.top-b.top},tile:a[c]}});return c}},wax.g.Controls.prototype.inTile=function(a,b){if(b.topa.y&&b.lefta.x)return!0},wax.g.Controls.prototype.Interaction=function(){var a=this,b=new wax.GridManager,c=null,d=function(b,c){var d=!1,e=a.calculateGrid();for(var f=0;f").addClass("interactive-div-"+b).width(256).height(256).append($("").attr("src",this.getTileUrl(a,b)).width(256).height(256))[0]},wax.g.MapType.prototype.releaseTile=function(a){$(a).remove()},wax.g.MapType.prototype.getTileUrl=function(a,b){var c=Math.abs(a.y-(Math.pow(2,b)-1));return a.x>=0&&c>=0?this.baseUrl+"/"+b+"/"+a.x+"/"+c+".png":this.blankImage}
\ No newline at end of file
diff --git a/build/wax.ol.js b/build/wax.ol.js
index 55578cae..21506df9 100644
--- a/build/wax.ol.js
+++ b/build/wax.ol.js
@@ -310,7 +310,7 @@ wax.Record = function(obj, context) {
args = args.length ? wax.Record(args) : [];
// real browsers
- if (!$.browser.msie) {
+ if (Object.create) {
obj = Object.create(fn_obj[1].prototype);
fn_obj[1].apply(obj, args);
// lord have mercy on your soul.
@@ -395,19 +395,15 @@ wax.Record = function(obj, context) {
case '@call':
return runFunction(statement.subject, statement.object, null);
}
- } else {
- // Reify object/arrays.
- try {
- var keys = _.keys(obj);
- for (i = 0; i < keys.length; i++) {
- var key = keys[i];
- obj[key] = wax.Record(obj[key], context);
- }
- return obj;
- // Unwrapped scalars
- } catch(e) {
- return obj;
+ } else if (typeof obj === 'object') {
+ var keys = _.keys(obj);
+ for (i = 0; i < keys.length; i++) {
+ var key = keys[i];
+ obj[key] = wax.Record(obj[key], context);
}
+ return obj;
+ } else {
+ return obj;
}
};
// Underscore.js 1.1.4
diff --git a/build/wax.ol.min.js b/build/wax.ol.min.js
index b79b9792..10e41778 100644
--- a/build/wax.ol.min.js
+++ b/build/wax.ol.min.js
@@ -7,4 +7,4 @@
*
* This document is licensed as free software under the terms of the
* MIT License: http://www.opensource.org/licenses/mit-license.php
- */(function(a,b){function B(m){function P(a){!(M++)&&b(function(){N(),G&&a!=u&&(x[I]=a),f(m.error,m,[m,a]),f(B,m,[m,a])},0)}function O(a){!(M++)&&b(function(){N(),G&&(x[I]={s:[a]}),C&&(a=C.apply(m,[a])),f(m.success,m,[a,t]),f(B,m,[m,t])},0)}m=a.extend({},A,m);var B=m.complete,C=m.dataFilter,D=m.callbackParameter,E=m.callback,F=m.cache,G=m.pageCache,H=m.charset,I=m.url,J=m.data,K=m.timeout,L,M=0,N=c;m.abort=function(){!(M++)&&N()};if(f(m.beforeSend,m,[m])===!1||M)return m;I=I||j,J=J?typeof J=="string"?J:a.param(J,m.traditional):j,I+=J?g(I)+J:j,D&&(I+=g(I)+encodeURIComponent(D)+"=?"),!F&&!G&&(I+=g(I)+"_"+(new Date).getTime()+"="),I=I.replace(/=\?(&|$)/,"="+E+"$1"),G&&(L=x[I])?L.s?O(L.s[0]):P(L):b(function(f,g,j){if(!M){j=K>0&&b(function(){P(u)},K),N=function(){j&&clearTimeout(j),f[q]=f[n]=f[p]=f[o]=null,w[r](f),g&&w[r](g)},window[E]=d,f=a(s)[0],f.id=l+y++,H&&(f[i]=H);function m(a){(f[n]||c)(),a=z,z=undefined,a?O(a[0]):P(k)}v.msie?(f.event=n,f.htmlFor=f.id,f[q]=function(){/loaded|complete/.test(f.readyState)&&m()}):(f[o]=f[p]=m,v.opera?(g=a(s)[0]).text="jQuery('#"+f.id+"')[0]."+o+"()":f[h]=h),f.src=I,e(f),g&&e(g)}},0);return m}function g(a){return/\?/.test(a)?"&":"?"}function f(a,b,c){return a&&a.apply(b.context||b,c)}function e(a){w.insertBefore(a,w.firstChild)}function d(a){z=[a]}function c(){}var h="async",i="charset",j="",k="error",l="_jqjsp",m="on",n=m+"click",o=m+k,p=m+"load",q=m+"readystatechange",r="removeChild",s="",t="success",u="timeout",v=a.browser,w=a("head")[0]||document.documentElement,x={},y=0,z,A={callback:l,url:location.href};B.setup=function(b){a.extend(A,b)},a.jsonp=B})(jQuery,setTimeout);var wax=wax||{};wax.Record=function(a,b){var c=function(a,b){var c=_.reduce(a.split("."),function(a,b){return[a[1]||a[0],a[1]?a[1][b]:a[0][b]]},[b||window,null]);return c},d=function(a,b){var d=c(a),e;b=b.length?wax.Record(b):[];if(!$.browser.msie)e=Object.create(d[1].prototype),d[1].apply(e,b);else switch(b.length){case 0:e=new d[1];break;case 1:e=new d[1](b[0]);break;case 2:e=new d[1](b[0],b[1]);break;case 3:e=new d[1](b[0],b[1],b[2]);break;case 4:e=new d[1](b[0],b[1],b[2],b[3]);break;case 5:e=new d[1](b[0],b[1],b[2],b[3],b[4]);break;default:}return e},e=function(a,b,d){var e=c(a,d),f=b.length?wax.Record(b):[];return d&&a.indexOf(".")===-1?e[1].apply(d,f):e[1].apply(e[0],f)},f=function(a){return _.isString(a)&&_.indexOf(["@new","@call","@literal","@chain","@inject","@group"],a.split(" ")[0])!==-1},g=function(a){return _.isString(a)&&_.indexOf(["@new","@call","@chain"],a.split(" ")[0])!==-1},h=function(a){if(_.isArray(a)&&a[0]&&f(a[0]))return{verb:a[0].split(" ")[0],subject:a[0].split(" ")[1],object:a.slice(1)};return!1},i,j=!1,k=null,l=null,m=h(a);if(m)switch(m.verb){case"@group":for(i=0;i=d.computed&&(d={value:a,computed:g})});return d.value},u.min=function(a,b,c){if(!b&&u.isArray(a))return Math.min.apply(Math,a);var d={computed:Infinity};v(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;gd?1:0}),"value")},u.sortedIndex=function(a,b,c){c=c||u.identity;var d=0,e=a.length;while(d>1;c(a[f])=0})})},u.zip=function(){var a=f.call(arguments),b=u.max(u.pluck(a,"length")),c=Array(b);for(var d=0;d=0;c--)b=[a[c].apply(this,b)];return b[0]}},u.keys=t||function(a){if(u.isArray(a))return u.range(0,a.length);var b=[];for(var c in a)i.call(a,c)&&(b[b.length]=c);return b},u.values=function(a){return u.map(a,u.identity)},u.functions=u.methods=function(a){return u.filter(u.keys(a),function(b){return u.isFunction(a[b])}).sort()},u.extend=function(a){v(f.call(arguments,1),function(b){for(var c in b)a[c]=b[c]});return a},u.clone=function(a){return u.isArray(a)?a.slice():u.extend({},a)},u.tap=function(a,b){b(a);return a},u.isEqual=function(a,b){if(a===b)return!0;var c=typeof a,d=typeof b;if(c!=d)return!1;if(a==b)return!0;if(!a&&b||a&&!b)return!1;a._chain&&(a=a._wrapped),b._chain&&(b=b._wrapped);if(a.isEqual)return a.isEqual(b);if(u.isDate(a)&&u.isDate(b))return a.getTime()===b.getTime();if(u.isNaN(a)&&u.isNaN(b))return!1;if(u.isRegExp(a)&&u.isRegExp(b))return a.source===b.source&&a.global===b.global&&a.ignoreCase===b.ignoreCase&&a.multiline===b.multiline;if(c!=="object")return!1;if(a.length&&a.length!==b.length)return!1;var e=u.keys(a),f=u.keys(b);if(e.length!=f.length)return!1;for(var g in a)if(!(g in b)||!u.isEqual(a[g],b[g]))return!1;return!0},u.isEmpty=function(a){if(u.isArray(a)||u.isString(a))return a.length===0;for(var b in a)if(i.call(a,b))return!1;return!0},u.isElement=function(a){return!!a&&a.nodeType==1},u.isArray=s||function(a){return h.call(a)==="[object Array]"},u.isArguments=function(a){return!!a&&!!i.call(a,"callee")},u.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)},u.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)},u.isNumber=function(a){return!!(a===0||a&&a.toExponential&&a.toFixed)},u.isNaN=function(a){return a!==a},u.isBoolean=function(a){return a===!0||a===!1},u.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)},u.isRegExp=function(a){return!(!(a&&a.test&&a.exec)||!a.ignoreCase&&a.ignoreCase!==!1)},u.isNull=function(a){return a===null},u.isUndefined=function(a){return a===void 0},u.noConflict=function(){a._=b;return this},u.identity=function(a){return a},u.times=function(a,b,c){for(var d=0;d/g,interpolate:/<%=([\s\S]+?)%>/g},u.template=function(a,b){var c=u.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(c.interpolate,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(c.evaluate||null,function(a,b){return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj",d);return b?e(b):e};var z=function(a){this._wrapped=a};u.prototype=z.prototype;var A=function(a,b){return b?u(a).chain():a},B=function(a,b){z.prototype[a]=function(){var a=f.call(arguments);g.call(a,this._wrapped);return A(b.apply(u,a),this._chain)}};u.mixin(u),v(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=d[a];z.prototype[a]=function(){b.apply(this._wrapped,arguments);return A(this._wrapped,this._chain)}}),v(["concat","join","slice"],function(a){var b=d[a];z.prototype[a]=function(){return A(b.apply(this._wrapped,arguments),this._chain)}}),z.prototype.chain=function(){this._chain=!0;return this},z.prototype.value=function(){return this._wrapped}}();var wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(!this.locks[a]){var c=this;this.locks[a]=!0,$.jsonp({url:a,context:this,callback:"grid",callbackParameter:"callback",success:function(b){c.locks[a]=!1,c.cache[a]=b;for(var d=0;d=93&&a--,a>=35&&a--,a-=32;return a},wax.GridInstance.prototype.getFeature=function(a,b,c,d){if(!(Math.floor((b-$(c).offset().top)/this.tileRes)>256||Math.floor((a-$(c).offset().left)/this.tileRes)>256)){var e=this.grid_tile.grid[Math.floor((b-$(c).offset().top)/this.tileRes)].charCodeAt(Math.floor((a-$(c).offset().left)/this.tileRes));e=this.resolveCode(e);if(this.grid_tile.keys[e])return this.formatter.format(d,this.grid_tile.data[this.grid_tile.keys[e]])}},wax.GridManager=function(){this.grid_tiles={},this.key_maps={},this.formatters={},this.locks={}},wax.GridManager.prototype.getGrid=function(a,b){var c=this;c.getFormatter(c.formatterUrl(a),function(d){if(!d)return b(!1);wax.request.get(c.tileDataUrl(a),function(a){b(new wax.GridInstance(a,d))})})},wax.GridManager.prototype.makeEvent=function(a){return{target:a.target||a.srcElement,pX:a.pageX||a.clientX,pY:a.pageY||a.clientY,evt:a}},wax.GridManager.prototype.tileDataUrl=function(a){return a.replace(/(.png|.jpg|.jpeg)(\d*)/,".grid.json")},wax.GridManager.prototype.formatterUrl=function(a){return a.replace(/\d+\/\d+\/\d+\.\w+/,"layer.json")},wax.GridManager.prototype.getFormatter=function(a,b){var c=this;typeof this.formatters[a]!="undefined"?b(this.formatters[a]):wax.request.get(a,function(d){d&&d.formatter?c.formatters[a]=new wax.Formatter(d):c.formatters[a]=!1,b(c.formatters[a])})},wax.Formatter=function(obj){if(obj.formatter&&typeof obj.formatter=="string")try{eval("this.f = "+obj.formatter)}catch(e){console&&console.log(e)}else this.f=function(){}},wax.Formatter.prototype.format=function(a,b){try{return this.f(a,b)}catch(c){console&&console.log(c)}};var wax=wax||{};wax.Legend=function(a,b){!b&&(b=$('')),this.context=a,this.container=b,this.legends={},$(this.context).append(this.container)},wax.Legend.prototype.render=function(a){this.container.empty();var b=this,c=function(a){a?b.legends[e]?b.legends[e].show():(b.legends[e]=$("").append(a),b.container.append(b.legends[e])):b.legends[e]=!1};for(var d=0;d"+"").html(a),$(b).append(d));for(var e=c-1;e>0;e--){var f=$("div.wax-tooltip-"+e+":not(.removed)");f.size()>0&&f.addClass("hidden").hide()}return d},wax.tooltip.click=function(a,b,c){var d=wax.tooltip.getToolTip(a,b,c),e=$('Close');e.click(function(){d.addClass("removed").fadeOut("fast",function(){$(this).remove()});return!1}),d.addClass("wax-popup").html(a).append(e)},wax.tooltip.select=function(a,b,c){!a||(wax.tooltip.getToolTip(a,b,c),$(b).css("cursor","pointer"),$("div",b).css("cursor","pointer"))},wax.tooltip.unselect=function(a,b,c){$(b).css("cursor","default").children("div.wax-tooltip-"+c+":not(.wax-popup)").addClass("removed").fadeOut("fast",function(){$(this).remove()}),$("div",b).css("cursor","default"),$(b).children("div.wax-tooltip:first").removeClass("hidden").show()};var wax=wax||{};wax.ol=wax.ol||{},wax.ol.Interaction=OpenLayers.Class(OpenLayers.Control,{feature:{},handlerOptions:null,handlers:null,gm:new wax.GridManager,initialize:function(a){a=a||{},a.handlerOptions=a.handlerOptions||{},OpenLayers.Control.prototype.initialize.apply(this,[a||{}]),this.handlers={hover:new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.getInfoForHover},OpenLayers.Util.extend(this.handlerOptions.hover||{},{delay:$.browser.msie?40:10})),click:new OpenLayers.Handler.Click(this,{click:this.getInfoForClick})},this.callbacks={out:wax.tooltip.unselect,over:wax.tooltip.select,click:wax.tooltip.click}},setMap:function(a){this.handlers.hover.setMap(a),this.handlers.click.setMap(a),OpenLayers.Control.prototype.setMap.apply(this,arguments),this.activate()},activate:function(){this.active||(this.handlers.hover.activate(),this.handlers.click.activate());return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},getTileStack:function(a,b){var c=!1,d={},e=[];for(var f=0;fb.pY&&h.leftb.pX,c&&(d={x:f,y:g})}if(c)for(var i=0;i0&&b(function(){P(u)},K),N=function(){j&&clearTimeout(j),f[q]=f[n]=f[p]=f[o]=null,w[r](f),g&&w[r](g)},window[E]=d,f=a(s)[0],f.id=l+y++,H&&(f[i]=H);function m(a){(f[n]||c)(),a=z,z=undefined,a?O(a[0]):P(k)}v.msie?(f.event=n,f.htmlFor=f.id,f[q]=function(){/loaded|complete/.test(f.readyState)&&m()}):(f[o]=f[p]=m,v.opera?(g=a(s)[0]).text="jQuery('#"+f.id+"')[0]."+o+"()":f[h]=h),f.src=I,e(f),g&&e(g)}},0);return m}function g(a){return/\?/.test(a)?"&":"?"}function f(a,b,c){return a&&a.apply(b.context||b,c)}function e(a){w.insertBefore(a,w.firstChild)}function d(a){z=[a]}function c(){}var h="async",i="charset",j="",k="error",l="_jqjsp",m="on",n=m+"click",o=m+k,p=m+"load",q=m+"readystatechange",r="removeChild",s="",t="success",u="timeout",v=a.browser,w=a("head")[0]||document.documentElement,x={},y=0,z,A={callback:l,url:location.href};B.setup=function(b){a.extend(A,b)},a.jsonp=B})(jQuery,setTimeout);var wax=wax||{};wax.Record=function(a,b){var c=function(a,b){var c=_.reduce(a.split("."),function(a,b){return[a[1]||a[0],a[1]?a[1][b]:a[0][b]]},[b||window,null]);return c},d=function(a,b){var d=c(a),e;b=b.length?wax.Record(b):[];if(Object.create)e=Object.create(d[1].prototype),d[1].apply(e,b);else switch(b.length){case 0:e=new d[1];break;case 1:e=new d[1](b[0]);break;case 2:e=new d[1](b[0],b[1]);break;case 3:e=new d[1](b[0],b[1],b[2]);break;case 4:e=new d[1](b[0],b[1],b[2],b[3]);break;case 5:e=new d[1](b[0],b[1],b[2],b[3],b[4]);break;default:}return e},e=function(a,b,d){var e=c(a,d),f=b.length?wax.Record(b):[];return d&&a.indexOf(".")===-1?e[1].apply(d,f):e[1].apply(e[0],f)},f=function(a){return _.isString(a)&&_.indexOf(["@new","@call","@literal","@chain","@inject","@group"],a.split(" ")[0])!==-1},g=function(a){return _.isString(a)&&_.indexOf(["@new","@call","@chain"],a.split(" ")[0])!==-1},h=function(a){if(_.isArray(a)&&a[0]&&f(a[0]))return{verb:a[0].split(" ")[0],subject:a[0].split(" ")[1],object:a.slice(1)};return!1},i,j=!1,k=null,l=null,m=h(a);if(!m){if(typeof a=="object"){var n=_.keys(a);for(i=0;i=d.computed&&(d={value:a,computed:g})});return d.value},u.min=function(a,b,c){if(!b&&u.isArray(a))return Math.min.apply(Math,a);var d={computed:Infinity};v(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;gd?1:0}),"value")},u.sortedIndex=function(a,b,c){c=c||u.identity;var d=0,e=a.length;while(d>1;c(a[f])=0})})},u.zip=function(){var a=f.call(arguments),b=u.max(u.pluck(a,"length")),c=Array(b);for(var d=0;d=0;c--)b=[a[c].apply(this,b)];return b[0]}},u.keys=t||function(a){if(u.isArray(a))return u.range(0,a.length);var b=[];for(var c in a)i.call(a,c)&&(b[b.length]=c);return b},u.values=function(a){return u.map(a,u.identity)},u.functions=u.methods=function(a){return u.filter(u.keys(a),function(b){return u.isFunction(a[b])}).sort()},u.extend=function(a){v(f.call(arguments,1),function(b){for(var c in b)a[c]=b[c]});return a},u.clone=function(a){return u.isArray(a)?a.slice():u.extend({},a)},u.tap=function(a,b){b(a);return a},u.isEqual=function(a,b){if(a===b)return!0;var c=typeof a,d=typeof b;if(c!=d)return!1;if(a==b)return!0;if(!a&&b||a&&!b)return!1;a._chain&&(a=a._wrapped),b._chain&&(b=b._wrapped);if(a.isEqual)return a.isEqual(b);if(u.isDate(a)&&u.isDate(b))return a.getTime()===b.getTime();if(u.isNaN(a)&&u.isNaN(b))return!1;if(u.isRegExp(a)&&u.isRegExp(b))return a.source===b.source&&a.global===b.global&&a.ignoreCase===b.ignoreCase&&a.multiline===b.multiline;if(c!=="object")return!1;if(a.length&&a.length!==b.length)return!1;var e=u.keys(a),f=u.keys(b);if(e.length!=f.length)return!1;for(var g in a)if(!(g in b)||!u.isEqual(a[g],b[g]))return!1;return!0},u.isEmpty=function(a){if(u.isArray(a)||u.isString(a))return a.length===0;for(var b in a)if(i.call(a,b))return!1;return!0},u.isElement=function(a){return!!a&&a.nodeType==1},u.isArray=s||function(a){return h.call(a)==="[object Array]"},u.isArguments=function(a){return!!a&&!!i.call(a,"callee")},u.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)},u.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)},u.isNumber=function(a){return!!(a===0||a&&a.toExponential&&a.toFixed)},u.isNaN=function(a){return a!==a},u.isBoolean=function(a){return a===!0||a===!1},u.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)},u.isRegExp=function(a){return!(!(a&&a.test&&a.exec)||!a.ignoreCase&&a.ignoreCase!==!1)},u.isNull=function(a){return a===null},u.isUndefined=function(a){return a===void 0},u.noConflict=function(){a._=b;return this},u.identity=function(a){return a},u.times=function(a,b,c){for(var d=0;d/g,interpolate:/<%=([\s\S]+?)%>/g},u.template=function(a,b){var c=u.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(c.interpolate,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(c.evaluate||null,function(a,b){return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj",d);return b?e(b):e};var z=function(a){this._wrapped=a};u.prototype=z.prototype;var A=function(a,b){return b?u(a).chain():a},B=function(a,b){z.prototype[a]=function(){var a=f.call(arguments);g.call(a,this._wrapped);return A(b.apply(u,a),this._chain)}};u.mixin(u),v(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=d[a];z.prototype[a]=function(){b.apply(this._wrapped,arguments);return A(this._wrapped,this._chain)}}),v(["concat","join","slice"],function(a){var b=d[a];z.prototype[a]=function(){return A(b.apply(this._wrapped,arguments),this._chain)}}),z.prototype.chain=function(){this._chain=!0;return this},z.prototype.value=function(){return this._wrapped}}();var wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(!this.locks[a]){var c=this;this.locks[a]=!0,$.jsonp({url:a,context:this,callback:"grid",callbackParameter:"callback",success:function(b){c.locks[a]=!1,c.cache[a]=b;for(var d=0;d=93&&a--,a>=35&&a--,a-=32;return a},wax.GridInstance.prototype.getFeature=function(a,b,c,d){if(!(Math.floor((b-$(c).offset().top)/this.tileRes)>256||Math.floor((a-$(c).offset().left)/this.tileRes)>256)){var e=this.grid_tile.grid[Math.floor((b-$(c).offset().top)/this.tileRes)].charCodeAt(Math.floor((a-$(c).offset().left)/this.tileRes));e=this.resolveCode(e);if(this.grid_tile.keys[e])return this.formatter.format(d,this.grid_tile.data[this.grid_tile.keys[e]])}},wax.GridManager=function(){this.grid_tiles={},this.key_maps={},this.formatters={},this.locks={}},wax.GridManager.prototype.getGrid=function(a,b){var c=this;c.getFormatter(c.formatterUrl(a),function(d){if(!d)return b(!1);wax.request.get(c.tileDataUrl(a),function(a){b(new wax.GridInstance(a,d))})})},wax.GridManager.prototype.makeEvent=function(a){return{target:a.target||a.srcElement,pX:a.pageX||a.clientX,pY:a.pageY||a.clientY,evt:a}},wax.GridManager.prototype.tileDataUrl=function(a){return a.replace(/(.png|.jpg|.jpeg)(\d*)/,".grid.json")},wax.GridManager.prototype.formatterUrl=function(a){return a.replace(/\d+\/\d+\/\d+\.\w+/,"layer.json")},wax.GridManager.prototype.getFormatter=function(a,b){var c=this;typeof this.formatters[a]!="undefined"?b(this.formatters[a]):wax.request.get(a,function(d){d&&d.formatter?c.formatters[a]=new wax.Formatter(d):c.formatters[a]=!1,b(c.formatters[a])})},wax.Formatter=function(obj){if(obj.formatter&&typeof obj.formatter=="string")try{eval("this.f = "+obj.formatter)}catch(e){console&&console.log(e)}else this.f=function(){}},wax.Formatter.prototype.format=function(a,b){try{return this.f(a,b)}catch(c){console&&console.log(c)}};var wax=wax||{};wax.Legend=function(a,b){!b&&(b=$('')),this.context=a,this.container=b,this.legends={},$(this.context).append(this.container)},wax.Legend.prototype.render=function(a){this.container.empty();var b=this,c=function(a){a?b.legends[e]?b.legends[e].show():(b.legends[e]=$("").append(a),b.container.append(b.legends[e])):b.legends[e]=!1};for(var d=0;d"+"").html(a),$(b).append(d));for(var e=c-1;e>0;e--){var f=$("div.wax-tooltip-"+e+":not(.removed)");f.size()>0&&f.addClass("hidden").hide()}return d},wax.tooltip.click=function(a,b,c){var d=wax.tooltip.getToolTip(a,b,c),e=$('Close');e.click(function(){d.addClass("removed").fadeOut("fast",function(){$(this).remove()});return!1}),d.addClass("wax-popup").html(a).append(e)},wax.tooltip.select=function(a,b,c){!a||(wax.tooltip.getToolTip(a,b,c),$(b).css("cursor","pointer"),$("div",b).css("cursor","pointer"))},wax.tooltip.unselect=function(a,b,c){$(b).css("cursor","default").children("div.wax-tooltip-"+c+":not(.wax-popup)").addClass("removed").fadeOut("fast",function(){$(this).remove()}),$("div",b).css("cursor","default"),$(b).children("div.wax-tooltip:first").removeClass("hidden").show()};var wax=wax||{};wax.ol=wax.ol||{},wax.ol.Interaction=OpenLayers.Class(OpenLayers.Control,{feature:{},handlerOptions:null,handlers:null,gm:new wax.GridManager,initialize:function(a){a=a||{},a.handlerOptions=a.handlerOptions||{},OpenLayers.Control.prototype.initialize.apply(this,[a||{}]),this.handlers={hover:new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.getInfoForHover},OpenLayers.Util.extend(this.handlerOptions.hover||{},{delay:$.browser.msie?40:10})),click:new OpenLayers.Handler.Click(this,{click:this.getInfoForClick})},this.callbacks={out:wax.tooltip.unselect,over:wax.tooltip.select,click:wax.tooltip.click}},setMap:function(a){this.handlers.hover.setMap(a),this.handlers.click.setMap(a),OpenLayers.Control.prototype.setMap.apply(this,arguments),this.activate()},activate:function(){this.active||(this.handlers.hover.activate(),this.handlers.click.activate());return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},getTileStack:function(a,b){var c=!1,d={},e=[];for(var f=0;fb.pY&&h.leftb.pX,c&&(d={x:f,y:g})}if(c)for(var i=0;i