Skip to content
Browse files

Event handling improvements. Fixes #161

  • Loading branch information...
1 parent 19b8979 commit 1a85c12a924d9d0a71a1c8df855547f3432c23fd @asual committed Jan 26, 2013
View
41 samples/accordion/jquery.address-1.6.min.js
@@ -6,25 +6,24 @@
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
- * Date: 2013-01-22 02:04:06 +0200 (Tue, 22 Jan 2013)
+ * Date: 2013-01-26 19:43:30 +0200 (Sat, 26 Jan 2013)
*/
-(function(c){c.address=function(){var r=function(a){a=c.extend(c.Event(a),function(){for(var b={},f=c.address.parameterNames(),l=0,o=f.length;l<o;l++)b[f[l]]=c.address.parameter(f[l]);return{value:c.address.value(),path:c.address.path(),pathNames:c.address.pathNames(),parameterNames:f,parameters:b,queryString:c.address.queryString()}}.call(c.address));c(c.address).trigger(a);return a},p=function(a){return Array.prototype.slice.call(a)},g=function(){c().bind.apply(c(c.address),Array.prototype.slice.call(arguments));
-return c.address},D=function(){c().unbind.apply(c(c.address),Array.prototype.slice.call(arguments));return c.address},E=function(){return y.pushState&&d.state!==h},U=function(){return("/"+j.pathname.replace(new RegExp(d.state),"")+j.search+(L()?"#"+L():"")).replace(T,"/")},L=function(){var a=j.href.indexOf("#");return a!=-1?j.href.substr(a+1):""},s=function(){return E()?U():L()},V=function(){return"javascript"},O=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},u=function(a,
-b){return parseInt(a.css(b),10)},H=function(){if(!w){var a=s();if(decodeURI(e)!=decodeURI(a))if(v&&z<7)j.reload();else{v&&!F&&d.history&&q(M,50);_old=e;e=a;G(m)}}},G=function(a){var b=r(W);a=r(a?X:Y);q(ea,10);if(b.isDefaultPrevented()||a.isDefaultPrevented())fa()},fa=function(){e=_old;if(E())y.popState({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=t;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=s())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!F&&d.history&&q(M,50);
-if(A)q(function(){w=m},1);else w=m}},ea=function(){if(d.tracker!=="null"&&d.tracker!==I){var a=c.isFunction(d.tracker)?d.tracker:i[d.tracker],b=(j.pathname+j.search+(c.address&&!E()?c.address.value():"")).replace(/\/\//,"/").replace(/^\/$/,"");if(c.isFunction(a))a(b);else if(c.isFunction(i.urchinTracker))i.urchinTracker(b);else if(i.pageTracker!==h&&c.isFunction(i.pageTracker._trackPageview))i.pageTracker._trackPageview(b);else i._gaq!==h&&c.isFunction(i._gaq.push)&&i._gaq.push(["_trackPageview",
-decodeURI(b)])}},M=function(){var a=V()+":"+m+";document.open();document.writeln('<html><head><title>"+n.title.replace(/\'/g,"\\'")+"</title><script>var "+B+' = "'+encodeURIComponent(s()).replace(/\'/g,"\\'")+(n.domain!=j.hostname?'";document.domain="'+n.domain:"")+"\";<\/script></head></html>');document.close();";if(z<7)k.src=a;else k.contentWindow.location.replace(a)},$=function(){if(J&&Z!=-1){var a,b,f=J.substr(Z+1).split("&");for(a=0;a<f.length;a++){b=f[a].split("=");if(/^(autoUpdate|history|strict|wrap)$/.test(b[0]))d[b[0]]=
-isNaN(b[1])?/^(true|yes)$/i.test(b[1]):parseInt(b[1],10)!==0;if(/^(state|tracker)$/.test(b[0]))d[b[0]]=b[1]}J=I}_old=e;e=s()},ba=function(){if(!aa){aa=t;$();var a=c("body"),b=function(){ga.call(this)};c(document).ajaxComplete(b);b();if(d.wrap){c("body > *").wrapAll('<div style="padding:'+(u(a,"marginTop")+u(a,"paddingTop"))+"px "+(u(a,"marginRight")+u(a,"paddingRight"))+"px "+(u(a,"marginBottom")+u(a,"paddingBottom"))+"px "+(u(a,"marginLeft")+u(a,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+
-B+'" style="height:100%;overflow:auto;position:relative;'+(A&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});A&&c('<style type="text/css" />').appendTo("head").text("#"+B+"::-webkit-resizer { background-color: #fff; }")}if(v&&!F){a=n.getElementsByTagName("frameset")[0];k=n.createElement((a?"":"i")+"frame");k.src=V()+":"+m;if(a){a.insertAdjacentElement("beforeEnd",k);a[a.cols?"cols":"rows"]+=",0";k.noResize=t;k.frameBorder=
-k.frameSpacing=0}else{k.style.display="none";k.style.width=k.style.height=0;k.tabIndex=-1;n.body.insertAdjacentElement("afterBegin",k)}q(function(){c(k).bind("load",function(){var f=k.contentWindow;_old=e;e=f[B]!==h?f[B]:"";if(e!=s()){G(m);j.hash=e}});k.contentWindow[B]===h&&M()},50)}q(function(){r("init");G(m)},1);if(!E())if(v&&z>7||!v&&F)if(i.addEventListener)i.addEventListener(K,H,m);else i.attachEvent&&i.attachEvent("on"+K,H);else ha(H,50);"state"in window.history&&c(window).trigger("popstate")}},
-ga=function(){var a,b=c("a"),f=b.size(),l=-1,o=function(){if(++l!=f){a=c(b.get(l));a.is('[rel*="address:"]')&&a.address('[rel*="address:"]');q(o,1)}};q(o,1)},ia=function(a){a=a.toLowerCase();a=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},h,I=null,B="jQueryAddress",K="hashchange",W="change",X=
-"internalChange",Y="externalChange",t=true,m=false,d={autoUpdate:t,history:t,strict:t,wrap:m},C=function(){var a={},b=ia(navigator.userAgent);if(b.browser){a[b.browser]=true;a.version=b.version}if(a.chrome)a.webkit=true;else if(a.webkit)a.safari=true;return a}(),z=parseFloat(C.version),A=C.webkit||C.safari,v=!c.support.opacity,i=function(){try{return top.document!==h&&top.document.title!==h?top:window}catch(a){return window}}(),n=i.document,y=i.history,j=i.location,ha=setInterval,q=setTimeout,T=/\/{2,9}/g;
-C=navigator.userAgent;var F="on"+K in i,k,J=c("script:last").attr("src"),Z=J?J.indexOf("?"):-1,P=n.title,w=m,aa=m,ca=t,N=m,e=s();_old=e;if(v){z=parseFloat(C.substr(C.indexOf("MSIE")+4));if(n.documentMode&&n.documentMode!=z)z=n.documentMode!=8?7:8;var da=n.onpropertychange;n.onpropertychange=function(){da&&da.call(n);if(n.title!=P&&n.title.indexOf("#"+s())!=-1)n.title=P}}if(y.navigationMode)y.navigationMode="compatible";if(document.readyState=="complete")var ja=setInterval(function(){if(c.address){ba();
-clearInterval(ja)}},50);else{$();c(ba)}c(window).bind("popstate",function(){if(decodeURI(e)!=decodeURI(s())){_old=e;e=s();G(m)}}).bind("unload",function(){if(i.removeEventListener)i.removeEventListener(K,H,m);else i.detachEvent&&i.detachEvent("on"+K,H)});return{bind:function(){return g.apply(this,p(arguments))},unbind:function(){return D.apply(this,p(arguments))},init:function(){return g.apply(this,["init"].concat(p(arguments)))},change:function(){return g.apply(this,[W].concat(p(arguments)))},internalChange:function(){return g.apply(this,
-[X].concat(p(arguments)))},externalChange:function(){return g.apply(this,[Y].concat(p(arguments)))},baseURL:function(){var a=j.href;if(a.indexOf("#")!=-1)a=a.substr(0,a.indexOf("#"));if(/\/$/.test(a))a=a.substr(0,a.length-1);return a},autoUpdate:function(a){if(a!==h){d.autoUpdate=a;return this}return d.autoUpdate},history:function(a){if(a!==h){d.history=a;return this}return d.history},state:function(a){if(a!==h){d.state=a;var b=U();if(d.state!==h)if(y.pushState)b.substr(0,3)=="/#/"&&j.replace(d.state.replace(/^\/$/,
-"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=L()&&q(function(){j.replace(d.state.replace(/^\/$/,"")+"/#"+b)},1);return this}return d.state},strict:function(a){if(a!==h){d.strict=a;return this}return d.strict},tracker:function(a){if(a!==h){d.tracker=a;return this}return d.tracker},wrap:function(a){if(a!==h){d.wrap=a;return this}return d.wrap},update:function(){N=t;this.value(e);N=m;return this},title:function(a){if(a!==h){q(function(){P=n.title=a;if(ca&&k&&k.contentWindow&&k.contentWindow.document){k.contentWindow.document.title=
-a;ca=m}},50);return this}return n.title},value:function(a){if(a!==h){a=O(a);if(a=="/")a="";if(e==a&&!N)return;_old=e;e=a;if(d.autoUpdate||N){G(t);if(E())y[d.history?"pushState":"replaceState"]({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=t;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=s())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!F&&d.history&&q(M,50);if(A)q(function(){w=m},1);else w=m}}return this}return O(e)},path:function(a){if(a!==h){var b=this.queryString(),
-f=this.hash();this.value(a+(b?"?"+b:"")+(f?"#"+f:""));return this}return O(e).split("#")[0].split("?")[0]},pathNames:function(){var a=this.path(),b=a.replace(T,"/").split("/");if(a.substr(0,1)=="/"||a.length===0)b.splice(0,1);a.substr(a.length-1,1)=="/"&&b.splice(b.length-1,1);return b},queryString:function(a){if(a!==h){var b=this.hash();this.value(this.path()+(a?"?"+a:"")+(b?"#"+b:""));return this}a=e.split("?");return a.slice(1,a.length).join("?").split("#")[0]},parameter:function(a,b,f){var l,
-o;if(b!==h){var Q=this.parameterNames();o=[];b=b===h||b===I?"":b.toString();for(l=0;l<Q.length;l++){var R=Q[l],x=this.parameter(R);if(typeof x=="string")x=[x];if(R==a)x=b===I||b===""?[]:f?x.concat([b]):[b];for(var S=0;S<x.length;S++)o.push(R+"="+x[S])}c.inArray(a,Q)==-1&&b!==I&&b!==""&&o.push(a+"="+b);this.queryString(o.join("&"));return this}if(b=this.queryString()){f=[];o=b.split("&");for(l=0;l<o.length;l++){b=o[l].split("=");b[0]==a&&f.push(b.slice(1).join("="))}if(f.length!==0)return f.length!=
-1?f:f[0]}},parameterNames:function(){var a=this.queryString(),b=[];if(a&&a.indexOf("=")!=-1){a=a.split("&");for(var f=0;f<a.length;f++){var l=a[f].split("=")[0];c.inArray(l,b)==-1&&b.push(l)}}return b},hash:function(a){if(a!==h){this.value(e.split("#")[0]+(a?"#"+a:""));return this}a=e.split("#");return a.slice(1,a.length).join("#")}}}();c.fn.address=function(r){var p;if(typeof r=="string"){p=r;r=undefined}c(this).attr("address")||c(document).on("click",p?p:this.selector,function(g){if(g.shiftKey||
-g.ctrlKey||g.metaKey||g.which==2)return true;if(c(g.target).is("a")){g.preventDefault();g=r?r.call(g.target):/address:/.test(c(g.target).attr("rel"))?c(g.target).attr("rel").split("address:")[1].split(" ")[0]:c.address.state()!==undefined&&!/^\/?$/.test(c.address.state())?c(g.target).attr("href").replace(new RegExp("^(.*"+c.address.state()+"|\\.)"),""):c(g.target).attr("href").replace(/^(#\!?|\.)/,"");c.address.value(g)}}).on("submit",p?p:this.selector,function(g){if(c(g.target).is("form")){g.preventDefault();
-var D=c(g.target).attr("action");g=r?r.call(g.target):(D.indexOf("?")!=-1?D.replace(/&$/,""):D+"?")+c(g.target).serialize();c.address.value(g)}}).attr("address",true);return this}})(jQuery);
+(function(c){c.address=function(){var t=function(a){a=c.extend(c.Event(a),function(){for(var b={},f=c.address.parameterNames(),o=0,s=f.length;o<s;o++)b[f[o]]=c.address.parameter(f[o]);return{value:c.address.value(),path:c.address.path(),pathNames:c.address.pathNames(),parameterNames:f,parameters:b,queryString:c.address.queryString()}}.call(c.address));c(c.address).trigger(a);return a},g=function(a){return Array.prototype.slice.call(a)},l=function(){c().bind.apply(c(c.address),Array.prototype.slice.call(arguments));
+return c.address},da=function(){c().unbind.apply(c(c.address),Array.prototype.slice.call(arguments));return c.address},D=function(){return y.pushState&&d.state!==h},T=function(){return("/"+j.pathname.replace(new RegExp(d.state),"")+j.search+(K()?"#"+K():"")).replace(S,"/")},K=function(){var a=j.href.indexOf("#");return a!=-1?j.href.substr(a+1):""},p=function(){return D()?T():K()},U=function(){return"javascript"},N=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},u=function(a,
+b){return parseInt(a.css(b),10)},G=function(){if(!w){var a=p();if(decodeURI(e)!=decodeURI(a))if(v&&z<7)j.reload();else{v&&!E&&d.history&&q(L,50);_old=e;e=a;F(m)}}},F=function(a){var b=t(V);a=t(a?W:X);q(ea,10);if(b.isDefaultPrevented()||a.isDefaultPrevented())fa()},fa=function(){e=_old;if(D())y.popState({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=r;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=p())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!E&&d.history&&q(L,50);
+if(A)q(function(){w=m},1);else w=m}},ea=function(){if(d.tracker!=="null"&&d.tracker!==H){var a=c.isFunction(d.tracker)?d.tracker:i[d.tracker],b=(j.pathname+j.search+(c.address&&!D()?c.address.value():"")).replace(/\/\//,"/").replace(/^\/$/,"");if(c.isFunction(a))a(b);else if(c.isFunction(i.urchinTracker))i.urchinTracker(b);else if(i.pageTracker!==h&&c.isFunction(i.pageTracker._trackPageview))i.pageTracker._trackPageview(b);else i._gaq!==h&&c.isFunction(i._gaq.push)&&i._gaq.push(["_trackPageview",
+decodeURI(b)])}},L=function(){var a=U()+":"+m+";document.open();document.writeln('<html><head><title>"+n.title.replace(/\'/g,"\\'")+"</title><script>var "+B+' = "'+encodeURIComponent(p()).replace(/\'/g,"\\'")+(n.domain!=j.hostname?'";document.domain="'+n.domain:"")+"\";<\/script></head></html>');document.close();";if(z<7)k.src=a;else k.contentWindow.location.replace(a)},Z=function(){if(I&&Y!=-1){var a,b,f=I.substr(Y+1).split("&");for(a=0;a<f.length;a++){b=f[a].split("=");if(/^(autoUpdate|history|strict|wrap)$/.test(b[0]))d[b[0]]=
+isNaN(b[1])?/^(true|yes)$/i.test(b[1]):parseInt(b[1],10)!==0;if(/^(state|tracker)$/.test(b[0]))d[b[0]]=b[1]}I=H}_old=e;e=p()},aa=function(){if(!$){$=r;Z();c('a[rel*="address:"]').address();if(d.wrap){var a=c("body");c("body > *").wrapAll('<div style="padding:'+(u(a,"marginTop")+u(a,"paddingTop"))+"px "+(u(a,"marginRight")+u(a,"paddingRight"))+"px "+(u(a,"marginBottom")+u(a,"paddingBottom"))+"px "+(u(a,"marginLeft")+u(a,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+B+'" style="height:100%;overflow:auto;position:relative;'+
+(A&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});A&&c('<style type="text/css" />').appendTo("head").text("#"+B+"::-webkit-resizer { background-color: #fff; }")}if(v&&!E){a=n.getElementsByTagName("frameset")[0];k=n.createElement((a?"":"i")+"frame");k.src=U()+":"+m;if(a){a.insertAdjacentElement("beforeEnd",k);a[a.cols?"cols":"rows"]+=",0";k.noResize=r;k.frameBorder=k.frameSpacing=0}else{k.style.display="none";k.style.width=
+k.style.height=0;k.tabIndex=-1;n.body.insertAdjacentElement("afterBegin",k)}q(function(){c(k).bind("load",function(){var b=k.contentWindow;_old=e;e=b[B]!==h?b[B]:"";if(e!=p()){F(m);j.hash=e}});k.contentWindow[B]===h&&L()},50)}q(function(){t("init");F(m)},1);if(!D())if(v&&z>7||!v&&E)if(i.addEventListener)i.addEventListener(J,G,m);else i.attachEvent&&i.attachEvent("on"+J,G);else ga(G,50);"state"in window.history&&c(window).trigger("popstate")}},ha=function(a){a=a.toLowerCase();a=/(chrome)[ \/]([\w.]+)/.exec(a)||
+/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},h,H=null,B="jQueryAddress",J="hashchange",V="change",W="internalChange",X="externalChange",r=true,m=false,d={autoUpdate:r,history:r,strict:r,wrap:m},C=function(){var a={},b=ha(navigator.userAgent);if(b.browser){a[b.browser]=true;a.version=b.version}if(a.chrome)a.webkit=true;else if(a.webkit)a.safari=
+true;return a}(),z=parseFloat(C.version),A=C.webkit||C.safari,v=!c.support.opacity,i=function(){try{return top.document!==h&&top.document.title!==h?top:window}catch(a){return window}}(),n=i.document,y=i.history,j=i.location,ga=setInterval,q=setTimeout,S=/\/{2,9}/g;C=navigator.userAgent;var E="on"+J in i,k,I=c("script:last").attr("src"),Y=I?I.indexOf("?"):-1,O=n.title,w=m,$=m,ba=r,M=m,e=p();_old=e;if(v){z=parseFloat(C.substr(C.indexOf("MSIE")+4));if(n.documentMode&&n.documentMode!=z)z=n.documentMode!=
+8?7:8;var ca=n.onpropertychange;n.onpropertychange=function(){ca&&ca.call(n);if(n.title!=O&&n.title.indexOf("#"+p())!=-1)n.title=O}}if(y.navigationMode)y.navigationMode="compatible";if(document.readyState=="complete")var ia=setInterval(function(){if(c.address){aa();clearInterval(ia)}},50);else{Z();c(aa)}c(window).bind("popstate",function(){if(decodeURI(e)!=decodeURI(p())){_old=e;e=p();F(m)}}).bind("unload",function(){if(i.removeEventListener)i.removeEventListener(J,G,m);else i.detachEvent&&i.detachEvent("on"+
+J,G)});return{bind:function(){return l.apply(this,g(arguments))},unbind:function(){return da.apply(this,g(arguments))},init:function(){return l.apply(this,["init"].concat(g(arguments)))},change:function(){return l.apply(this,[V].concat(g(arguments)))},internalChange:function(){return l.apply(this,[W].concat(g(arguments)))},externalChange:function(){return l.apply(this,[X].concat(g(arguments)))},baseURL:function(){var a=j.href;if(a.indexOf("#")!=-1)a=a.substr(0,a.indexOf("#"));if(/\/$/.test(a))a=a.substr(0,
+a.length-1);return a},autoUpdate:function(a){if(a!==h){d.autoUpdate=a;return this}return d.autoUpdate},history:function(a){if(a!==h){d.history=a;return this}return d.history},state:function(a){if(a!==h){d.state=a;var b=T();if(d.state!==h)if(y.pushState)b.substr(0,3)=="/#/"&&j.replace(d.state.replace(/^\/$/,"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=K()&&q(function(){j.replace(d.state.replace(/^\/$/,"")+"/#"+b)},1);return this}return d.state},strict:function(a){if(a!==h){d.strict=a;return this}return d.strict},
+tracker:function(a){if(a!==h){d.tracker=a;return this}return d.tracker},wrap:function(a){if(a!==h){d.wrap=a;return this}return d.wrap},update:function(){M=r;this.value(e);M=m;return this},title:function(a){if(a!==h){q(function(){O=n.title=a;if(ba&&k&&k.contentWindow&&k.contentWindow.document){k.contentWindow.document.title=a;ba=m}},50);return this}return n.title},value:function(a){if(a!==h){a=N(a);if(a=="/")a="";if(e==a&&!M)return;_old=e;e=a;if(d.autoUpdate||M){F(r);if(D())y[d.history?"pushState":
+"replaceState"]({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=r;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=p())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!E&&d.history&&q(L,50);if(A)q(function(){w=m},1);else w=m}}return this}return N(e)},path:function(a){if(a!==h){var b=this.queryString(),f=this.hash();this.value(a+(b?"?"+b:"")+(f?"#"+f:""));return this}return N(e).split("#")[0].split("?")[0]},pathNames:function(){var a=this.path(),b=a.replace(S,"/").split("/");
+if(a.substr(0,1)=="/"||a.length===0)b.splice(0,1);a.substr(a.length-1,1)=="/"&&b.splice(b.length-1,1);return b},queryString:function(a){if(a!==h){var b=this.hash();this.value(this.path()+(a?"?"+a:"")+(b?"#"+b:""));return this}a=e.split("?");return a.slice(1,a.length).join("?").split("#")[0]},parameter:function(a,b,f){var o,s;if(b!==h){var P=this.parameterNames();s=[];b=b===h||b===H?"":b.toString();for(o=0;o<P.length;o++){var Q=P[o],x=this.parameter(Q);if(typeof x=="string")x=[x];if(Q==a)x=b===H||
+b===""?[]:f?x.concat([b]):[b];for(var R=0;R<x.length;R++)s.push(Q+"="+x[R])}c.inArray(a,P)==-1&&b!==H&&b!==""&&s.push(a+"="+b);this.queryString(s.join("&"));return this}if(b=this.queryString()){f=[];s=b.split("&");for(o=0;o<s.length;o++){b=s[o].split("=");b[0]==a&&f.push(b.slice(1).join("="))}if(f.length!==0)return f.length!=1?f:f[0]}},parameterNames:function(){var a=this.queryString(),b=[];if(a&&a.indexOf("=")!=-1){a=a.split("&");for(var f=0;f<a.length;f++){var o=a[f].split("=")[0];c.inArray(o,b)==
+-1&&b.push(o)}}return b},hash:function(a){if(a!==h){this.value(e.split("#")[0]+(a?"#"+a:""));return this}a=e.split("#");return a.slice(1,a.length).join("#")}}}();c.fn.address=function(t){this.data("address")||this.on("click",function(g){if(g.shiftKey||g.ctrlKey||g.metaKey||g.which==2)return true;var l=g.currentTarget;if(c(l).is("a")){g.preventDefault();g=t?t.call(l):/address:/.test(c(l).attr("rel"))?c(l).attr("rel").split("address:")[1].split(" ")[0]:c.address.state()!==undefined&&!/^\/?$/.test(c.address.state())?
+c(l).attr("href").replace(new RegExp("^(.*"+c.address.state()+"|\\.)"),""):c(l).attr("href").replace(/^(#\!?|\.)/,"");c.address.value(g)}}).on("submit",function(g){var l=g.currentTarget;if(c(l).is("form")){g.preventDefault();g=c(l).attr("action");l=t?t.call(l):(g.indexOf("?")!=-1?g.replace(/&$/,""):g+"?")+c(l).serialize();c.address.value(l)}}).data("address",true);return this}})(jQuery);
View
41 samples/api/jquery.address-1.6.min.js
@@ -6,25 +6,24 @@
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
- * Date: 2013-01-22 02:04:06 +0200 (Tue, 22 Jan 2013)
+ * Date: 2013-01-26 19:43:30 +0200 (Sat, 26 Jan 2013)
*/
-(function(c){c.address=function(){var r=function(a){a=c.extend(c.Event(a),function(){for(var b={},f=c.address.parameterNames(),l=0,o=f.length;l<o;l++)b[f[l]]=c.address.parameter(f[l]);return{value:c.address.value(),path:c.address.path(),pathNames:c.address.pathNames(),parameterNames:f,parameters:b,queryString:c.address.queryString()}}.call(c.address));c(c.address).trigger(a);return a},p=function(a){return Array.prototype.slice.call(a)},g=function(){c().bind.apply(c(c.address),Array.prototype.slice.call(arguments));
-return c.address},D=function(){c().unbind.apply(c(c.address),Array.prototype.slice.call(arguments));return c.address},E=function(){return y.pushState&&d.state!==h},U=function(){return("/"+j.pathname.replace(new RegExp(d.state),"")+j.search+(L()?"#"+L():"")).replace(T,"/")},L=function(){var a=j.href.indexOf("#");return a!=-1?j.href.substr(a+1):""},s=function(){return E()?U():L()},V=function(){return"javascript"},O=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},u=function(a,
-b){return parseInt(a.css(b),10)},H=function(){if(!w){var a=s();if(decodeURI(e)!=decodeURI(a))if(v&&z<7)j.reload();else{v&&!F&&d.history&&q(M,50);_old=e;e=a;G(m)}}},G=function(a){var b=r(W);a=r(a?X:Y);q(ea,10);if(b.isDefaultPrevented()||a.isDefaultPrevented())fa()},fa=function(){e=_old;if(E())y.popState({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=t;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=s())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!F&&d.history&&q(M,50);
-if(A)q(function(){w=m},1);else w=m}},ea=function(){if(d.tracker!=="null"&&d.tracker!==I){var a=c.isFunction(d.tracker)?d.tracker:i[d.tracker],b=(j.pathname+j.search+(c.address&&!E()?c.address.value():"")).replace(/\/\//,"/").replace(/^\/$/,"");if(c.isFunction(a))a(b);else if(c.isFunction(i.urchinTracker))i.urchinTracker(b);else if(i.pageTracker!==h&&c.isFunction(i.pageTracker._trackPageview))i.pageTracker._trackPageview(b);else i._gaq!==h&&c.isFunction(i._gaq.push)&&i._gaq.push(["_trackPageview",
-decodeURI(b)])}},M=function(){var a=V()+":"+m+";document.open();document.writeln('<html><head><title>"+n.title.replace(/\'/g,"\\'")+"</title><script>var "+B+' = "'+encodeURIComponent(s()).replace(/\'/g,"\\'")+(n.domain!=j.hostname?'";document.domain="'+n.domain:"")+"\";<\/script></head></html>');document.close();";if(z<7)k.src=a;else k.contentWindow.location.replace(a)},$=function(){if(J&&Z!=-1){var a,b,f=J.substr(Z+1).split("&");for(a=0;a<f.length;a++){b=f[a].split("=");if(/^(autoUpdate|history|strict|wrap)$/.test(b[0]))d[b[0]]=
-isNaN(b[1])?/^(true|yes)$/i.test(b[1]):parseInt(b[1],10)!==0;if(/^(state|tracker)$/.test(b[0]))d[b[0]]=b[1]}J=I}_old=e;e=s()},ba=function(){if(!aa){aa=t;$();var a=c("body"),b=function(){ga.call(this)};c(document).ajaxComplete(b);b();if(d.wrap){c("body > *").wrapAll('<div style="padding:'+(u(a,"marginTop")+u(a,"paddingTop"))+"px "+(u(a,"marginRight")+u(a,"paddingRight"))+"px "+(u(a,"marginBottom")+u(a,"paddingBottom"))+"px "+(u(a,"marginLeft")+u(a,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+
-B+'" style="height:100%;overflow:auto;position:relative;'+(A&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});A&&c('<style type="text/css" />').appendTo("head").text("#"+B+"::-webkit-resizer { background-color: #fff; }")}if(v&&!F){a=n.getElementsByTagName("frameset")[0];k=n.createElement((a?"":"i")+"frame");k.src=V()+":"+m;if(a){a.insertAdjacentElement("beforeEnd",k);a[a.cols?"cols":"rows"]+=",0";k.noResize=t;k.frameBorder=
-k.frameSpacing=0}else{k.style.display="none";k.style.width=k.style.height=0;k.tabIndex=-1;n.body.insertAdjacentElement("afterBegin",k)}q(function(){c(k).bind("load",function(){var f=k.contentWindow;_old=e;e=f[B]!==h?f[B]:"";if(e!=s()){G(m);j.hash=e}});k.contentWindow[B]===h&&M()},50)}q(function(){r("init");G(m)},1);if(!E())if(v&&z>7||!v&&F)if(i.addEventListener)i.addEventListener(K,H,m);else i.attachEvent&&i.attachEvent("on"+K,H);else ha(H,50);"state"in window.history&&c(window).trigger("popstate")}},
-ga=function(){var a,b=c("a"),f=b.size(),l=-1,o=function(){if(++l!=f){a=c(b.get(l));a.is('[rel*="address:"]')&&a.address('[rel*="address:"]');q(o,1)}};q(o,1)},ia=function(a){a=a.toLowerCase();a=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},h,I=null,B="jQueryAddress",K="hashchange",W="change",X=
-"internalChange",Y="externalChange",t=true,m=false,d={autoUpdate:t,history:t,strict:t,wrap:m},C=function(){var a={},b=ia(navigator.userAgent);if(b.browser){a[b.browser]=true;a.version=b.version}if(a.chrome)a.webkit=true;else if(a.webkit)a.safari=true;return a}(),z=parseFloat(C.version),A=C.webkit||C.safari,v=!c.support.opacity,i=function(){try{return top.document!==h&&top.document.title!==h?top:window}catch(a){return window}}(),n=i.document,y=i.history,j=i.location,ha=setInterval,q=setTimeout,T=/\/{2,9}/g;
-C=navigator.userAgent;var F="on"+K in i,k,J=c("script:last").attr("src"),Z=J?J.indexOf("?"):-1,P=n.title,w=m,aa=m,ca=t,N=m,e=s();_old=e;if(v){z=parseFloat(C.substr(C.indexOf("MSIE")+4));if(n.documentMode&&n.documentMode!=z)z=n.documentMode!=8?7:8;var da=n.onpropertychange;n.onpropertychange=function(){da&&da.call(n);if(n.title!=P&&n.title.indexOf("#"+s())!=-1)n.title=P}}if(y.navigationMode)y.navigationMode="compatible";if(document.readyState=="complete")var ja=setInterval(function(){if(c.address){ba();
-clearInterval(ja)}},50);else{$();c(ba)}c(window).bind("popstate",function(){if(decodeURI(e)!=decodeURI(s())){_old=e;e=s();G(m)}}).bind("unload",function(){if(i.removeEventListener)i.removeEventListener(K,H,m);else i.detachEvent&&i.detachEvent("on"+K,H)});return{bind:function(){return g.apply(this,p(arguments))},unbind:function(){return D.apply(this,p(arguments))},init:function(){return g.apply(this,["init"].concat(p(arguments)))},change:function(){return g.apply(this,[W].concat(p(arguments)))},internalChange:function(){return g.apply(this,
-[X].concat(p(arguments)))},externalChange:function(){return g.apply(this,[Y].concat(p(arguments)))},baseURL:function(){var a=j.href;if(a.indexOf("#")!=-1)a=a.substr(0,a.indexOf("#"));if(/\/$/.test(a))a=a.substr(0,a.length-1);return a},autoUpdate:function(a){if(a!==h){d.autoUpdate=a;return this}return d.autoUpdate},history:function(a){if(a!==h){d.history=a;return this}return d.history},state:function(a){if(a!==h){d.state=a;var b=U();if(d.state!==h)if(y.pushState)b.substr(0,3)=="/#/"&&j.replace(d.state.replace(/^\/$/,
-"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=L()&&q(function(){j.replace(d.state.replace(/^\/$/,"")+"/#"+b)},1);return this}return d.state},strict:function(a){if(a!==h){d.strict=a;return this}return d.strict},tracker:function(a){if(a!==h){d.tracker=a;return this}return d.tracker},wrap:function(a){if(a!==h){d.wrap=a;return this}return d.wrap},update:function(){N=t;this.value(e);N=m;return this},title:function(a){if(a!==h){q(function(){P=n.title=a;if(ca&&k&&k.contentWindow&&k.contentWindow.document){k.contentWindow.document.title=
-a;ca=m}},50);return this}return n.title},value:function(a){if(a!==h){a=O(a);if(a=="/")a="";if(e==a&&!N)return;_old=e;e=a;if(d.autoUpdate||N){G(t);if(E())y[d.history?"pushState":"replaceState"]({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=t;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=s())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!F&&d.history&&q(M,50);if(A)q(function(){w=m},1);else w=m}}return this}return O(e)},path:function(a){if(a!==h){var b=this.queryString(),
-f=this.hash();this.value(a+(b?"?"+b:"")+(f?"#"+f:""));return this}return O(e).split("#")[0].split("?")[0]},pathNames:function(){var a=this.path(),b=a.replace(T,"/").split("/");if(a.substr(0,1)=="/"||a.length===0)b.splice(0,1);a.substr(a.length-1,1)=="/"&&b.splice(b.length-1,1);return b},queryString:function(a){if(a!==h){var b=this.hash();this.value(this.path()+(a?"?"+a:"")+(b?"#"+b:""));return this}a=e.split("?");return a.slice(1,a.length).join("?").split("#")[0]},parameter:function(a,b,f){var l,
-o;if(b!==h){var Q=this.parameterNames();o=[];b=b===h||b===I?"":b.toString();for(l=0;l<Q.length;l++){var R=Q[l],x=this.parameter(R);if(typeof x=="string")x=[x];if(R==a)x=b===I||b===""?[]:f?x.concat([b]):[b];for(var S=0;S<x.length;S++)o.push(R+"="+x[S])}c.inArray(a,Q)==-1&&b!==I&&b!==""&&o.push(a+"="+b);this.queryString(o.join("&"));return this}if(b=this.queryString()){f=[];o=b.split("&");for(l=0;l<o.length;l++){b=o[l].split("=");b[0]==a&&f.push(b.slice(1).join("="))}if(f.length!==0)return f.length!=
-1?f:f[0]}},parameterNames:function(){var a=this.queryString(),b=[];if(a&&a.indexOf("=")!=-1){a=a.split("&");for(var f=0;f<a.length;f++){var l=a[f].split("=")[0];c.inArray(l,b)==-1&&b.push(l)}}return b},hash:function(a){if(a!==h){this.value(e.split("#")[0]+(a?"#"+a:""));return this}a=e.split("#");return a.slice(1,a.length).join("#")}}}();c.fn.address=function(r){var p;if(typeof r=="string"){p=r;r=undefined}c(this).attr("address")||c(document).on("click",p?p:this.selector,function(g){if(g.shiftKey||
-g.ctrlKey||g.metaKey||g.which==2)return true;if(c(g.target).is("a")){g.preventDefault();g=r?r.call(g.target):/address:/.test(c(g.target).attr("rel"))?c(g.target).attr("rel").split("address:")[1].split(" ")[0]:c.address.state()!==undefined&&!/^\/?$/.test(c.address.state())?c(g.target).attr("href").replace(new RegExp("^(.*"+c.address.state()+"|\\.)"),""):c(g.target).attr("href").replace(/^(#\!?|\.)/,"");c.address.value(g)}}).on("submit",p?p:this.selector,function(g){if(c(g.target).is("form")){g.preventDefault();
-var D=c(g.target).attr("action");g=r?r.call(g.target):(D.indexOf("?")!=-1?D.replace(/&$/,""):D+"?")+c(g.target).serialize();c.address.value(g)}}).attr("address",true);return this}})(jQuery);
+(function(c){c.address=function(){var t=function(a){a=c.extend(c.Event(a),function(){for(var b={},f=c.address.parameterNames(),o=0,s=f.length;o<s;o++)b[f[o]]=c.address.parameter(f[o]);return{value:c.address.value(),path:c.address.path(),pathNames:c.address.pathNames(),parameterNames:f,parameters:b,queryString:c.address.queryString()}}.call(c.address));c(c.address).trigger(a);return a},g=function(a){return Array.prototype.slice.call(a)},l=function(){c().bind.apply(c(c.address),Array.prototype.slice.call(arguments));
+return c.address},da=function(){c().unbind.apply(c(c.address),Array.prototype.slice.call(arguments));return c.address},D=function(){return y.pushState&&d.state!==h},T=function(){return("/"+j.pathname.replace(new RegExp(d.state),"")+j.search+(K()?"#"+K():"")).replace(S,"/")},K=function(){var a=j.href.indexOf("#");return a!=-1?j.href.substr(a+1):""},p=function(){return D()?T():K()},U=function(){return"javascript"},N=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},u=function(a,
+b){return parseInt(a.css(b),10)},G=function(){if(!w){var a=p();if(decodeURI(e)!=decodeURI(a))if(v&&z<7)j.reload();else{v&&!E&&d.history&&q(L,50);_old=e;e=a;F(m)}}},F=function(a){var b=t(V);a=t(a?W:X);q(ea,10);if(b.isDefaultPrevented()||a.isDefaultPrevented())fa()},fa=function(){e=_old;if(D())y.popState({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=r;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=p())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!E&&d.history&&q(L,50);
+if(A)q(function(){w=m},1);else w=m}},ea=function(){if(d.tracker!=="null"&&d.tracker!==H){var a=c.isFunction(d.tracker)?d.tracker:i[d.tracker],b=(j.pathname+j.search+(c.address&&!D()?c.address.value():"")).replace(/\/\//,"/").replace(/^\/$/,"");if(c.isFunction(a))a(b);else if(c.isFunction(i.urchinTracker))i.urchinTracker(b);else if(i.pageTracker!==h&&c.isFunction(i.pageTracker._trackPageview))i.pageTracker._trackPageview(b);else i._gaq!==h&&c.isFunction(i._gaq.push)&&i._gaq.push(["_trackPageview",
+decodeURI(b)])}},L=function(){var a=U()+":"+m+";document.open();document.writeln('<html><head><title>"+n.title.replace(/\'/g,"\\'")+"</title><script>var "+B+' = "'+encodeURIComponent(p()).replace(/\'/g,"\\'")+(n.domain!=j.hostname?'";document.domain="'+n.domain:"")+"\";<\/script></head></html>');document.close();";if(z<7)k.src=a;else k.contentWindow.location.replace(a)},Z=function(){if(I&&Y!=-1){var a,b,f=I.substr(Y+1).split("&");for(a=0;a<f.length;a++){b=f[a].split("=");if(/^(autoUpdate|history|strict|wrap)$/.test(b[0]))d[b[0]]=
+isNaN(b[1])?/^(true|yes)$/i.test(b[1]):parseInt(b[1],10)!==0;if(/^(state|tracker)$/.test(b[0]))d[b[0]]=b[1]}I=H}_old=e;e=p()},aa=function(){if(!$){$=r;Z();c('a[rel*="address:"]').address();if(d.wrap){var a=c("body");c("body > *").wrapAll('<div style="padding:'+(u(a,"marginTop")+u(a,"paddingTop"))+"px "+(u(a,"marginRight")+u(a,"paddingRight"))+"px "+(u(a,"marginBottom")+u(a,"paddingBottom"))+"px "+(u(a,"marginLeft")+u(a,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+B+'" style="height:100%;overflow:auto;position:relative;'+
+(A&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});A&&c('<style type="text/css" />').appendTo("head").text("#"+B+"::-webkit-resizer { background-color: #fff; }")}if(v&&!E){a=n.getElementsByTagName("frameset")[0];k=n.createElement((a?"":"i")+"frame");k.src=U()+":"+m;if(a){a.insertAdjacentElement("beforeEnd",k);a[a.cols?"cols":"rows"]+=",0";k.noResize=r;k.frameBorder=k.frameSpacing=0}else{k.style.display="none";k.style.width=
+k.style.height=0;k.tabIndex=-1;n.body.insertAdjacentElement("afterBegin",k)}q(function(){c(k).bind("load",function(){var b=k.contentWindow;_old=e;e=b[B]!==h?b[B]:"";if(e!=p()){F(m);j.hash=e}});k.contentWindow[B]===h&&L()},50)}q(function(){t("init");F(m)},1);if(!D())if(v&&z>7||!v&&E)if(i.addEventListener)i.addEventListener(J,G,m);else i.attachEvent&&i.attachEvent("on"+J,G);else ga(G,50);"state"in window.history&&c(window).trigger("popstate")}},ha=function(a){a=a.toLowerCase();a=/(chrome)[ \/]([\w.]+)/.exec(a)||
+/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},h,H=null,B="jQueryAddress",J="hashchange",V="change",W="internalChange",X="externalChange",r=true,m=false,d={autoUpdate:r,history:r,strict:r,wrap:m},C=function(){var a={},b=ha(navigator.userAgent);if(b.browser){a[b.browser]=true;a.version=b.version}if(a.chrome)a.webkit=true;else if(a.webkit)a.safari=
+true;return a}(),z=parseFloat(C.version),A=C.webkit||C.safari,v=!c.support.opacity,i=function(){try{return top.document!==h&&top.document.title!==h?top:window}catch(a){return window}}(),n=i.document,y=i.history,j=i.location,ga=setInterval,q=setTimeout,S=/\/{2,9}/g;C=navigator.userAgent;var E="on"+J in i,k,I=c("script:last").attr("src"),Y=I?I.indexOf("?"):-1,O=n.title,w=m,$=m,ba=r,M=m,e=p();_old=e;if(v){z=parseFloat(C.substr(C.indexOf("MSIE")+4));if(n.documentMode&&n.documentMode!=z)z=n.documentMode!=
+8?7:8;var ca=n.onpropertychange;n.onpropertychange=function(){ca&&ca.call(n);if(n.title!=O&&n.title.indexOf("#"+p())!=-1)n.title=O}}if(y.navigationMode)y.navigationMode="compatible";if(document.readyState=="complete")var ia=setInterval(function(){if(c.address){aa();clearInterval(ia)}},50);else{Z();c(aa)}c(window).bind("popstate",function(){if(decodeURI(e)!=decodeURI(p())){_old=e;e=p();F(m)}}).bind("unload",function(){if(i.removeEventListener)i.removeEventListener(J,G,m);else i.detachEvent&&i.detachEvent("on"+
+J,G)});return{bind:function(){return l.apply(this,g(arguments))},unbind:function(){return da.apply(this,g(arguments))},init:function(){return l.apply(this,["init"].concat(g(arguments)))},change:function(){return l.apply(this,[V].concat(g(arguments)))},internalChange:function(){return l.apply(this,[W].concat(g(arguments)))},externalChange:function(){return l.apply(this,[X].concat(g(arguments)))},baseURL:function(){var a=j.href;if(a.indexOf("#")!=-1)a=a.substr(0,a.indexOf("#"));if(/\/$/.test(a))a=a.substr(0,
+a.length-1);return a},autoUpdate:function(a){if(a!==h){d.autoUpdate=a;return this}return d.autoUpdate},history:function(a){if(a!==h){d.history=a;return this}return d.history},state:function(a){if(a!==h){d.state=a;var b=T();if(d.state!==h)if(y.pushState)b.substr(0,3)=="/#/"&&j.replace(d.state.replace(/^\/$/,"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=K()&&q(function(){j.replace(d.state.replace(/^\/$/,"")+"/#"+b)},1);return this}return d.state},strict:function(a){if(a!==h){d.strict=a;return this}return d.strict},
+tracker:function(a){if(a!==h){d.tracker=a;return this}return d.tracker},wrap:function(a){if(a!==h){d.wrap=a;return this}return d.wrap},update:function(){M=r;this.value(e);M=m;return this},title:function(a){if(a!==h){q(function(){O=n.title=a;if(ba&&k&&k.contentWindow&&k.contentWindow.document){k.contentWindow.document.title=a;ba=m}},50);return this}return n.title},value:function(a){if(a!==h){a=N(a);if(a=="/")a="";if(e==a&&!M)return;_old=e;e=a;if(d.autoUpdate||M){F(r);if(D())y[d.history?"pushState":
+"replaceState"]({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=r;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=p())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!E&&d.history&&q(L,50);if(A)q(function(){w=m},1);else w=m}}return this}return N(e)},path:function(a){if(a!==h){var b=this.queryString(),f=this.hash();this.value(a+(b?"?"+b:"")+(f?"#"+f:""));return this}return N(e).split("#")[0].split("?")[0]},pathNames:function(){var a=this.path(),b=a.replace(S,"/").split("/");
+if(a.substr(0,1)=="/"||a.length===0)b.splice(0,1);a.substr(a.length-1,1)=="/"&&b.splice(b.length-1,1);return b},queryString:function(a){if(a!==h){var b=this.hash();this.value(this.path()+(a?"?"+a:"")+(b?"#"+b:""));return this}a=e.split("?");return a.slice(1,a.length).join("?").split("#")[0]},parameter:function(a,b,f){var o,s;if(b!==h){var P=this.parameterNames();s=[];b=b===h||b===H?"":b.toString();for(o=0;o<P.length;o++){var Q=P[o],x=this.parameter(Q);if(typeof x=="string")x=[x];if(Q==a)x=b===H||
+b===""?[]:f?x.concat([b]):[b];for(var R=0;R<x.length;R++)s.push(Q+"="+x[R])}c.inArray(a,P)==-1&&b!==H&&b!==""&&s.push(a+"="+b);this.queryString(s.join("&"));return this}if(b=this.queryString()){f=[];s=b.split("&");for(o=0;o<s.length;o++){b=s[o].split("=");b[0]==a&&f.push(b.slice(1).join("="))}if(f.length!==0)return f.length!=1?f:f[0]}},parameterNames:function(){var a=this.queryString(),b=[];if(a&&a.indexOf("=")!=-1){a=a.split("&");for(var f=0;f<a.length;f++){var o=a[f].split("=")[0];c.inArray(o,b)==
+-1&&b.push(o)}}return b},hash:function(a){if(a!==h){this.value(e.split("#")[0]+(a?"#"+a:""));return this}a=e.split("#");return a.slice(1,a.length).join("#")}}}();c.fn.address=function(t){this.data("address")||this.on("click",function(g){if(g.shiftKey||g.ctrlKey||g.metaKey||g.which==2)return true;var l=g.currentTarget;if(c(l).is("a")){g.preventDefault();g=t?t.call(l):/address:/.test(c(l).attr("rel"))?c(l).attr("rel").split("address:")[1].split(" ")[0]:c.address.state()!==undefined&&!/^\/?$/.test(c.address.state())?
+c(l).attr("href").replace(new RegExp("^(.*"+c.address.state()+"|\\.)"),""):c(l).attr("href").replace(/^(#\!?|\.)/,"");c.address.value(g)}}).on("submit",function(g){var l=g.currentTarget;if(c(l).is("form")){g.preventDefault();g=c(l).attr("action");l=t?t.call(l):(g.indexOf("?")!=-1?g.replace(/&$/,""):g+"?")+c(l).serialize();c.address.value(l)}}).data("address",true);return this}})(jQuery);
View
41 samples/events/jquery.address-1.6.min.js
@@ -6,25 +6,24 @@
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
- * Date: 2013-01-22 02:04:06 +0200 (Tue, 22 Jan 2013)
+ * Date: 2013-01-26 19:43:30 +0200 (Sat, 26 Jan 2013)
*/
-(function(c){c.address=function(){var r=function(a){a=c.extend(c.Event(a),function(){for(var b={},f=c.address.parameterNames(),l=0,o=f.length;l<o;l++)b[f[l]]=c.address.parameter(f[l]);return{value:c.address.value(),path:c.address.path(),pathNames:c.address.pathNames(),parameterNames:f,parameters:b,queryString:c.address.queryString()}}.call(c.address));c(c.address).trigger(a);return a},p=function(a){return Array.prototype.slice.call(a)},g=function(){c().bind.apply(c(c.address),Array.prototype.slice.call(arguments));
-return c.address},D=function(){c().unbind.apply(c(c.address),Array.prototype.slice.call(arguments));return c.address},E=function(){return y.pushState&&d.state!==h},U=function(){return("/"+j.pathname.replace(new RegExp(d.state),"")+j.search+(L()?"#"+L():"")).replace(T,"/")},L=function(){var a=j.href.indexOf("#");return a!=-1?j.href.substr(a+1):""},s=function(){return E()?U():L()},V=function(){return"javascript"},O=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},u=function(a,
-b){return parseInt(a.css(b),10)},H=function(){if(!w){var a=s();if(decodeURI(e)!=decodeURI(a))if(v&&z<7)j.reload();else{v&&!F&&d.history&&q(M,50);_old=e;e=a;G(m)}}},G=function(a){var b=r(W);a=r(a?X:Y);q(ea,10);if(b.isDefaultPrevented()||a.isDefaultPrevented())fa()},fa=function(){e=_old;if(E())y.popState({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=t;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=s())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!F&&d.history&&q(M,50);
-if(A)q(function(){w=m},1);else w=m}},ea=function(){if(d.tracker!=="null"&&d.tracker!==I){var a=c.isFunction(d.tracker)?d.tracker:i[d.tracker],b=(j.pathname+j.search+(c.address&&!E()?c.address.value():"")).replace(/\/\//,"/").replace(/^\/$/,"");if(c.isFunction(a))a(b);else if(c.isFunction(i.urchinTracker))i.urchinTracker(b);else if(i.pageTracker!==h&&c.isFunction(i.pageTracker._trackPageview))i.pageTracker._trackPageview(b);else i._gaq!==h&&c.isFunction(i._gaq.push)&&i._gaq.push(["_trackPageview",
-decodeURI(b)])}},M=function(){var a=V()+":"+m+";document.open();document.writeln('<html><head><title>"+n.title.replace(/\'/g,"\\'")+"</title><script>var "+B+' = "'+encodeURIComponent(s()).replace(/\'/g,"\\'")+(n.domain!=j.hostname?'";document.domain="'+n.domain:"")+"\";<\/script></head></html>');document.close();";if(z<7)k.src=a;else k.contentWindow.location.replace(a)},$=function(){if(J&&Z!=-1){var a,b,f=J.substr(Z+1).split("&");for(a=0;a<f.length;a++){b=f[a].split("=");if(/^(autoUpdate|history|strict|wrap)$/.test(b[0]))d[b[0]]=
-isNaN(b[1])?/^(true|yes)$/i.test(b[1]):parseInt(b[1],10)!==0;if(/^(state|tracker)$/.test(b[0]))d[b[0]]=b[1]}J=I}_old=e;e=s()},ba=function(){if(!aa){aa=t;$();var a=c("body"),b=function(){ga.call(this)};c(document).ajaxComplete(b);b();if(d.wrap){c("body > *").wrapAll('<div style="padding:'+(u(a,"marginTop")+u(a,"paddingTop"))+"px "+(u(a,"marginRight")+u(a,"paddingRight"))+"px "+(u(a,"marginBottom")+u(a,"paddingBottom"))+"px "+(u(a,"marginLeft")+u(a,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+
-B+'" style="height:100%;overflow:auto;position:relative;'+(A&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});A&&c('<style type="text/css" />').appendTo("head").text("#"+B+"::-webkit-resizer { background-color: #fff; }")}if(v&&!F){a=n.getElementsByTagName("frameset")[0];k=n.createElement((a?"":"i")+"frame");k.src=V()+":"+m;if(a){a.insertAdjacentElement("beforeEnd",k);a[a.cols?"cols":"rows"]+=",0";k.noResize=t;k.frameBorder=
-k.frameSpacing=0}else{k.style.display="none";k.style.width=k.style.height=0;k.tabIndex=-1;n.body.insertAdjacentElement("afterBegin",k)}q(function(){c(k).bind("load",function(){var f=k.contentWindow;_old=e;e=f[B]!==h?f[B]:"";if(e!=s()){G(m);j.hash=e}});k.contentWindow[B]===h&&M()},50)}q(function(){r("init");G(m)},1);if(!E())if(v&&z>7||!v&&F)if(i.addEventListener)i.addEventListener(K,H,m);else i.attachEvent&&i.attachEvent("on"+K,H);else ha(H,50);"state"in window.history&&c(window).trigger("popstate")}},
-ga=function(){var a,b=c("a"),f=b.size(),l=-1,o=function(){if(++l!=f){a=c(b.get(l));a.is('[rel*="address:"]')&&a.address('[rel*="address:"]');q(o,1)}};q(o,1)},ia=function(a){a=a.toLowerCase();a=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},h,I=null,B="jQueryAddress",K="hashchange",W="change",X=
-"internalChange",Y="externalChange",t=true,m=false,d={autoUpdate:t,history:t,strict:t,wrap:m},C=function(){var a={},b=ia(navigator.userAgent);if(b.browser){a[b.browser]=true;a.version=b.version}if(a.chrome)a.webkit=true;else if(a.webkit)a.safari=true;return a}(),z=parseFloat(C.version),A=C.webkit||C.safari,v=!c.support.opacity,i=function(){try{return top.document!==h&&top.document.title!==h?top:window}catch(a){return window}}(),n=i.document,y=i.history,j=i.location,ha=setInterval,q=setTimeout,T=/\/{2,9}/g;
-C=navigator.userAgent;var F="on"+K in i,k,J=c("script:last").attr("src"),Z=J?J.indexOf("?"):-1,P=n.title,w=m,aa=m,ca=t,N=m,e=s();_old=e;if(v){z=parseFloat(C.substr(C.indexOf("MSIE")+4));if(n.documentMode&&n.documentMode!=z)z=n.documentMode!=8?7:8;var da=n.onpropertychange;n.onpropertychange=function(){da&&da.call(n);if(n.title!=P&&n.title.indexOf("#"+s())!=-1)n.title=P}}if(y.navigationMode)y.navigationMode="compatible";if(document.readyState=="complete")var ja=setInterval(function(){if(c.address){ba();
-clearInterval(ja)}},50);else{$();c(ba)}c(window).bind("popstate",function(){if(decodeURI(e)!=decodeURI(s())){_old=e;e=s();G(m)}}).bind("unload",function(){if(i.removeEventListener)i.removeEventListener(K,H,m);else i.detachEvent&&i.detachEvent("on"+K,H)});return{bind:function(){return g.apply(this,p(arguments))},unbind:function(){return D.apply(this,p(arguments))},init:function(){return g.apply(this,["init"].concat(p(arguments)))},change:function(){return g.apply(this,[W].concat(p(arguments)))},internalChange:function(){return g.apply(this,
-[X].concat(p(arguments)))},externalChange:function(){return g.apply(this,[Y].concat(p(arguments)))},baseURL:function(){var a=j.href;if(a.indexOf("#")!=-1)a=a.substr(0,a.indexOf("#"));if(/\/$/.test(a))a=a.substr(0,a.length-1);return a},autoUpdate:function(a){if(a!==h){d.autoUpdate=a;return this}return d.autoUpdate},history:function(a){if(a!==h){d.history=a;return this}return d.history},state:function(a){if(a!==h){d.state=a;var b=U();if(d.state!==h)if(y.pushState)b.substr(0,3)=="/#/"&&j.replace(d.state.replace(/^\/$/,
-"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=L()&&q(function(){j.replace(d.state.replace(/^\/$/,"")+"/#"+b)},1);return this}return d.state},strict:function(a){if(a!==h){d.strict=a;return this}return d.strict},tracker:function(a){if(a!==h){d.tracker=a;return this}return d.tracker},wrap:function(a){if(a!==h){d.wrap=a;return this}return d.wrap},update:function(){N=t;this.value(e);N=m;return this},title:function(a){if(a!==h){q(function(){P=n.title=a;if(ca&&k&&k.contentWindow&&k.contentWindow.document){k.contentWindow.document.title=
-a;ca=m}},50);return this}return n.title},value:function(a){if(a!==h){a=O(a);if(a=="/")a="";if(e==a&&!N)return;_old=e;e=a;if(d.autoUpdate||N){G(t);if(E())y[d.history?"pushState":"replaceState"]({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=t;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=s())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!F&&d.history&&q(M,50);if(A)q(function(){w=m},1);else w=m}}return this}return O(e)},path:function(a){if(a!==h){var b=this.queryString(),
-f=this.hash();this.value(a+(b?"?"+b:"")+(f?"#"+f:""));return this}return O(e).split("#")[0].split("?")[0]},pathNames:function(){var a=this.path(),b=a.replace(T,"/").split("/");if(a.substr(0,1)=="/"||a.length===0)b.splice(0,1);a.substr(a.length-1,1)=="/"&&b.splice(b.length-1,1);return b},queryString:function(a){if(a!==h){var b=this.hash();this.value(this.path()+(a?"?"+a:"")+(b?"#"+b:""));return this}a=e.split("?");return a.slice(1,a.length).join("?").split("#")[0]},parameter:function(a,b,f){var l,
-o;if(b!==h){var Q=this.parameterNames();o=[];b=b===h||b===I?"":b.toString();for(l=0;l<Q.length;l++){var R=Q[l],x=this.parameter(R);if(typeof x=="string")x=[x];if(R==a)x=b===I||b===""?[]:f?x.concat([b]):[b];for(var S=0;S<x.length;S++)o.push(R+"="+x[S])}c.inArray(a,Q)==-1&&b!==I&&b!==""&&o.push(a+"="+b);this.queryString(o.join("&"));return this}if(b=this.queryString()){f=[];o=b.split("&");for(l=0;l<o.length;l++){b=o[l].split("=");b[0]==a&&f.push(b.slice(1).join("="))}if(f.length!==0)return f.length!=
-1?f:f[0]}},parameterNames:function(){var a=this.queryString(),b=[];if(a&&a.indexOf("=")!=-1){a=a.split("&");for(var f=0;f<a.length;f++){var l=a[f].split("=")[0];c.inArray(l,b)==-1&&b.push(l)}}return b},hash:function(a){if(a!==h){this.value(e.split("#")[0]+(a?"#"+a:""));return this}a=e.split("#");return a.slice(1,a.length).join("#")}}}();c.fn.address=function(r){var p;if(typeof r=="string"){p=r;r=undefined}c(this).attr("address")||c(document).on("click",p?p:this.selector,function(g){if(g.shiftKey||
-g.ctrlKey||g.metaKey||g.which==2)return true;if(c(g.target).is("a")){g.preventDefault();g=r?r.call(g.target):/address:/.test(c(g.target).attr("rel"))?c(g.target).attr("rel").split("address:")[1].split(" ")[0]:c.address.state()!==undefined&&!/^\/?$/.test(c.address.state())?c(g.target).attr("href").replace(new RegExp("^(.*"+c.address.state()+"|\\.)"),""):c(g.target).attr("href").replace(/^(#\!?|\.)/,"");c.address.value(g)}}).on("submit",p?p:this.selector,function(g){if(c(g.target).is("form")){g.preventDefault();
-var D=c(g.target).attr("action");g=r?r.call(g.target):(D.indexOf("?")!=-1?D.replace(/&$/,""):D+"?")+c(g.target).serialize();c.address.value(g)}}).attr("address",true);return this}})(jQuery);
+(function(c){c.address=function(){var t=function(a){a=c.extend(c.Event(a),function(){for(var b={},f=c.address.parameterNames(),o=0,s=f.length;o<s;o++)b[f[o]]=c.address.parameter(f[o]);return{value:c.address.value(),path:c.address.path(),pathNames:c.address.pathNames(),parameterNames:f,parameters:b,queryString:c.address.queryString()}}.call(c.address));c(c.address).trigger(a);return a},g=function(a){return Array.prototype.slice.call(a)},l=function(){c().bind.apply(c(c.address),Array.prototype.slice.call(arguments));
+return c.address},da=function(){c().unbind.apply(c(c.address),Array.prototype.slice.call(arguments));return c.address},D=function(){return y.pushState&&d.state!==h},T=function(){return("/"+j.pathname.replace(new RegExp(d.state),"")+j.search+(K()?"#"+K():"")).replace(S,"/")},K=function(){var a=j.href.indexOf("#");return a!=-1?j.href.substr(a+1):""},p=function(){return D()?T():K()},U=function(){return"javascript"},N=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},u=function(a,
+b){return parseInt(a.css(b),10)},G=function(){if(!w){var a=p();if(decodeURI(e)!=decodeURI(a))if(v&&z<7)j.reload();else{v&&!E&&d.history&&q(L,50);_old=e;e=a;F(m)}}},F=function(a){var b=t(V);a=t(a?W:X);q(ea,10);if(b.isDefaultPrevented()||a.isDefaultPrevented())fa()},fa=function(){e=_old;if(D())y.popState({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=r;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=p())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!E&&d.history&&q(L,50);
+if(A)q(function(){w=m},1);else w=m}},ea=function(){if(d.tracker!=="null"&&d.tracker!==H){var a=c.isFunction(d.tracker)?d.tracker:i[d.tracker],b=(j.pathname+j.search+(c.address&&!D()?c.address.value():"")).replace(/\/\//,"/").replace(/^\/$/,"");if(c.isFunction(a))a(b);else if(c.isFunction(i.urchinTracker))i.urchinTracker(b);else if(i.pageTracker!==h&&c.isFunction(i.pageTracker._trackPageview))i.pageTracker._trackPageview(b);else i._gaq!==h&&c.isFunction(i._gaq.push)&&i._gaq.push(["_trackPageview",
+decodeURI(b)])}},L=function(){var a=U()+":"+m+";document.open();document.writeln('<html><head><title>"+n.title.replace(/\'/g,"\\'")+"</title><script>var "+B+' = "'+encodeURIComponent(p()).replace(/\'/g,"\\'")+(n.domain!=j.hostname?'";document.domain="'+n.domain:"")+"\";<\/script></head></html>');document.close();";if(z<7)k.src=a;else k.contentWindow.location.replace(a)},Z=function(){if(I&&Y!=-1){var a,b,f=I.substr(Y+1).split("&");for(a=0;a<f.length;a++){b=f[a].split("=");if(/^(autoUpdate|history|strict|wrap)$/.test(b[0]))d[b[0]]=
+isNaN(b[1])?/^(true|yes)$/i.test(b[1]):parseInt(b[1],10)!==0;if(/^(state|tracker)$/.test(b[0]))d[b[0]]=b[1]}I=H}_old=e;e=p()},aa=function(){if(!$){$=r;Z();c('a[rel*="address:"]').address();if(d.wrap){var a=c("body");c("body > *").wrapAll('<div style="padding:'+(u(a,"marginTop")+u(a,"paddingTop"))+"px "+(u(a,"marginRight")+u(a,"paddingRight"))+"px "+(u(a,"marginBottom")+u(a,"paddingBottom"))+"px "+(u(a,"marginLeft")+u(a,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+B+'" style="height:100%;overflow:auto;position:relative;'+
+(A&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});A&&c('<style type="text/css" />').appendTo("head").text("#"+B+"::-webkit-resizer { background-color: #fff; }")}if(v&&!E){a=n.getElementsByTagName("frameset")[0];k=n.createElement((a?"":"i")+"frame");k.src=U()+":"+m;if(a){a.insertAdjacentElement("beforeEnd",k);a[a.cols?"cols":"rows"]+=",0";k.noResize=r;k.frameBorder=k.frameSpacing=0}else{k.style.display="none";k.style.width=
+k.style.height=0;k.tabIndex=-1;n.body.insertAdjacentElement("afterBegin",k)}q(function(){c(k).bind("load",function(){var b=k.contentWindow;_old=e;e=b[B]!==h?b[B]:"";if(e!=p()){F(m);j.hash=e}});k.contentWindow[B]===h&&L()},50)}q(function(){t("init");F(m)},1);if(!D())if(v&&z>7||!v&&E)if(i.addEventListener)i.addEventListener(J,G,m);else i.attachEvent&&i.attachEvent("on"+J,G);else ga(G,50);"state"in window.history&&c(window).trigger("popstate")}},ha=function(a){a=a.toLowerCase();a=/(chrome)[ \/]([\w.]+)/.exec(a)||
+/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},h,H=null,B="jQueryAddress",J="hashchange",V="change",W="internalChange",X="externalChange",r=true,m=false,d={autoUpdate:r,history:r,strict:r,wrap:m},C=function(){var a={},b=ha(navigator.userAgent);if(b.browser){a[b.browser]=true;a.version=b.version}if(a.chrome)a.webkit=true;else if(a.webkit)a.safari=
+true;return a}(),z=parseFloat(C.version),A=C.webkit||C.safari,v=!c.support.opacity,i=function(){try{return top.document!==h&&top.document.title!==h?top:window}catch(a){return window}}(),n=i.document,y=i.history,j=i.location,ga=setInterval,q=setTimeout,S=/\/{2,9}/g;C=navigator.userAgent;var E="on"+J in i,k,I=c("script:last").attr("src"),Y=I?I.indexOf("?"):-1,O=n.title,w=m,$=m,ba=r,M=m,e=p();_old=e;if(v){z=parseFloat(C.substr(C.indexOf("MSIE")+4));if(n.documentMode&&n.documentMode!=z)z=n.documentMode!=
+8?7:8;var ca=n.onpropertychange;n.onpropertychange=function(){ca&&ca.call(n);if(n.title!=O&&n.title.indexOf("#"+p())!=-1)n.title=O}}if(y.navigationMode)y.navigationMode="compatible";if(document.readyState=="complete")var ia=setInterval(function(){if(c.address){aa();clearInterval(ia)}},50);else{Z();c(aa)}c(window).bind("popstate",function(){if(decodeURI(e)!=decodeURI(p())){_old=e;e=p();F(m)}}).bind("unload",function(){if(i.removeEventListener)i.removeEventListener(J,G,m);else i.detachEvent&&i.detachEvent("on"+
+J,G)});return{bind:function(){return l.apply(this,g(arguments))},unbind:function(){return da.apply(this,g(arguments))},init:function(){return l.apply(this,["init"].concat(g(arguments)))},change:function(){return l.apply(this,[V].concat(g(arguments)))},internalChange:function(){return l.apply(this,[W].concat(g(arguments)))},externalChange:function(){return l.apply(this,[X].concat(g(arguments)))},baseURL:function(){var a=j.href;if(a.indexOf("#")!=-1)a=a.substr(0,a.indexOf("#"));if(/\/$/.test(a))a=a.substr(0,
+a.length-1);return a},autoUpdate:function(a){if(a!==h){d.autoUpdate=a;return this}return d.autoUpdate},history:function(a){if(a!==h){d.history=a;return this}return d.history},state:function(a){if(a!==h){d.state=a;var b=T();if(d.state!==h)if(y.pushState)b.substr(0,3)=="/#/"&&j.replace(d.state.replace(/^\/$/,"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=K()&&q(function(){j.replace(d.state.replace(/^\/$/,"")+"/#"+b)},1);return this}return d.state},strict:function(a){if(a!==h){d.strict=a;return this}return d.strict},
+tracker:function(a){if(a!==h){d.tracker=a;return this}return d.tracker},wrap:function(a){if(a!==h){d.wrap=a;return this}return d.wrap},update:function(){M=r;this.value(e);M=m;return this},title:function(a){if(a!==h){q(function(){O=n.title=a;if(ba&&k&&k.contentWindow&&k.contentWindow.document){k.contentWindow.document.title=a;ba=m}},50);return this}return n.title},value:function(a){if(a!==h){a=N(a);if(a=="/")a="";if(e==a&&!M)return;_old=e;e=a;if(d.autoUpdate||M){F(r);if(D())y[d.history?"pushState":
+"replaceState"]({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=r;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=p())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!E&&d.history&&q(L,50);if(A)q(function(){w=m},1);else w=m}}return this}return N(e)},path:function(a){if(a!==h){var b=this.queryString(),f=this.hash();this.value(a+(b?"?"+b:"")+(f?"#"+f:""));return this}return N(e).split("#")[0].split("?")[0]},pathNames:function(){var a=this.path(),b=a.replace(S,"/").split("/");
+if(a.substr(0,1)=="/"||a.length===0)b.splice(0,1);a.substr(a.length-1,1)=="/"&&b.splice(b.length-1,1);return b},queryString:function(a){if(a!==h){var b=this.hash();this.value(this.path()+(a?"?"+a:"")+(b?"#"+b:""));return this}a=e.split("?");return a.slice(1,a.length).join("?").split("#")[0]},parameter:function(a,b,f){var o,s;if(b!==h){var P=this.parameterNames();s=[];b=b===h||b===H?"":b.toString();for(o=0;o<P.length;o++){var Q=P[o],x=this.parameter(Q);if(typeof x=="string")x=[x];if(Q==a)x=b===H||
+b===""?[]:f?x.concat([b]):[b];for(var R=0;R<x.length;R++)s.push(Q+"="+x[R])}c.inArray(a,P)==-1&&b!==H&&b!==""&&s.push(a+"="+b);this.queryString(s.join("&"));return this}if(b=this.queryString()){f=[];s=b.split("&");for(o=0;o<s.length;o++){b=s[o].split("=");b[0]==a&&f.push(b.slice(1).join("="))}if(f.length!==0)return f.length!=1?f:f[0]}},parameterNames:function(){var a=this.queryString(),b=[];if(a&&a.indexOf("=")!=-1){a=a.split("&");for(var f=0;f<a.length;f++){var o=a[f].split("=")[0];c.inArray(o,b)==
+-1&&b.push(o)}}return b},hash:function(a){if(a!==h){this.value(e.split("#")[0]+(a?"#"+a:""));return this}a=e.split("#");return a.slice(1,a.length).join("#")}}}();c.fn.address=function(t){this.data("address")||this.on("click",function(g){if(g.shiftKey||g.ctrlKey||g.metaKey||g.which==2)return true;var l=g.currentTarget;if(c(l).is("a")){g.preventDefault();g=t?t.call(l):/address:/.test(c(l).attr("rel"))?c(l).attr("rel").split("address:")[1].split(" ")[0]:c.address.state()!==undefined&&!/^\/?$/.test(c.address.state())?
+c(l).attr("href").replace(new RegExp("^(.*"+c.address.state()+"|\\.)"),""):c(l).attr("href").replace(/^(#\!?|\.)/,"");c.address.value(g)}}).on("submit",function(g){var l=g.currentTarget;if(c(l).is("form")){g.preventDefault();g=c(l).attr("action");l=t?t.call(l):(g.indexOf("?")!=-1?g.replace(/&$/,""):g+"?")+c(l).serialize();c.address.value(l)}}).data("address",true);return this}})(jQuery);
View
41 samples/express/public/jquery.address-1.6.min.js
@@ -6,25 +6,24 @@
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
- * Date: 2013-01-22 02:04:06 +0200 (Tue, 22 Jan 2013)
+ * Date: 2013-01-26 19:43:30 +0200 (Sat, 26 Jan 2013)
*/
-(function(c){c.address=function(){var r=function(a){a=c.extend(c.Event(a),function(){for(var b={},f=c.address.parameterNames(),l=0,o=f.length;l<o;l++)b[f[l]]=c.address.parameter(f[l]);return{value:c.address.value(),path:c.address.path(),pathNames:c.address.pathNames(),parameterNames:f,parameters:b,queryString:c.address.queryString()}}.call(c.address));c(c.address).trigger(a);return a},p=function(a){return Array.prototype.slice.call(a)},g=function(){c().bind.apply(c(c.address),Array.prototype.slice.call(arguments));
-return c.address},D=function(){c().unbind.apply(c(c.address),Array.prototype.slice.call(arguments));return c.address},E=function(){return y.pushState&&d.state!==h},U=function(){return("/"+j.pathname.replace(new RegExp(d.state),"")+j.search+(L()?"#"+L():"")).replace(T,"/")},L=function(){var a=j.href.indexOf("#");return a!=-1?j.href.substr(a+1):""},s=function(){return E()?U():L()},V=function(){return"javascript"},O=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},u=function(a,
-b){return parseInt(a.css(b),10)},H=function(){if(!w){var a=s();if(decodeURI(e)!=decodeURI(a))if(v&&z<7)j.reload();else{v&&!F&&d.history&&q(M,50);_old=e;e=a;G(m)}}},G=function(a){var b=r(W);a=r(a?X:Y);q(ea,10);if(b.isDefaultPrevented()||a.isDefaultPrevented())fa()},fa=function(){e=_old;if(E())y.popState({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=t;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=s())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!F&&d.history&&q(M,50);
-if(A)q(function(){w=m},1);else w=m}},ea=function(){if(d.tracker!=="null"&&d.tracker!==I){var a=c.isFunction(d.tracker)?d.tracker:i[d.tracker],b=(j.pathname+j.search+(c.address&&!E()?c.address.value():"")).replace(/\/\//,"/").replace(/^\/$/,"");if(c.isFunction(a))a(b);else if(c.isFunction(i.urchinTracker))i.urchinTracker(b);else if(i.pageTracker!==h&&c.isFunction(i.pageTracker._trackPageview))i.pageTracker._trackPageview(b);else i._gaq!==h&&c.isFunction(i._gaq.push)&&i._gaq.push(["_trackPageview",
-decodeURI(b)])}},M=function(){var a=V()+":"+m+";document.open();document.writeln('<html><head><title>"+n.title.replace(/\'/g,"\\'")+"</title><script>var "+B+' = "'+encodeURIComponent(s()).replace(/\'/g,"\\'")+(n.domain!=j.hostname?'";document.domain="'+n.domain:"")+"\";<\/script></head></html>');document.close();";if(z<7)k.src=a;else k.contentWindow.location.replace(a)},$=function(){if(J&&Z!=-1){var a,b,f=J.substr(Z+1).split("&");for(a=0;a<f.length;a++){b=f[a].split("=");if(/^(autoUpdate|history|strict|wrap)$/.test(b[0]))d[b[0]]=
-isNaN(b[1])?/^(true|yes)$/i.test(b[1]):parseInt(b[1],10)!==0;if(/^(state|tracker)$/.test(b[0]))d[b[0]]=b[1]}J=I}_old=e;e=s()},ba=function(){if(!aa){aa=t;$();var a=c("body"),b=function(){ga.call(this)};c(document).ajaxComplete(b);b();if(d.wrap){c("body > *").wrapAll('<div style="padding:'+(u(a,"marginTop")+u(a,"paddingTop"))+"px "+(u(a,"marginRight")+u(a,"paddingRight"))+"px "+(u(a,"marginBottom")+u(a,"paddingBottom"))+"px "+(u(a,"marginLeft")+u(a,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+
-B+'" style="height:100%;overflow:auto;position:relative;'+(A&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});A&&c('<style type="text/css" />').appendTo("head").text("#"+B+"::-webkit-resizer { background-color: #fff; }")}if(v&&!F){a=n.getElementsByTagName("frameset")[0];k=n.createElement((a?"":"i")+"frame");k.src=V()+":"+m;if(a){a.insertAdjacentElement("beforeEnd",k);a[a.cols?"cols":"rows"]+=",0";k.noResize=t;k.frameBorder=
-k.frameSpacing=0}else{k.style.display="none";k.style.width=k.style.height=0;k.tabIndex=-1;n.body.insertAdjacentElement("afterBegin",k)}q(function(){c(k).bind("load",function(){var f=k.contentWindow;_old=e;e=f[B]!==h?f[B]:"";if(e!=s()){G(m);j.hash=e}});k.contentWindow[B]===h&&M()},50)}q(function(){r("init");G(m)},1);if(!E())if(v&&z>7||!v&&F)if(i.addEventListener)i.addEventListener(K,H,m);else i.attachEvent&&i.attachEvent("on"+K,H);else ha(H,50);"state"in window.history&&c(window).trigger("popstate")}},
-ga=function(){var a,b=c("a"),f=b.size(),l=-1,o=function(){if(++l!=f){a=c(b.get(l));a.is('[rel*="address:"]')&&a.address('[rel*="address:"]');q(o,1)}};q(o,1)},ia=function(a){a=a.toLowerCase();a=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},h,I=null,B="jQueryAddress",K="hashchange",W="change",X=
-"internalChange",Y="externalChange",t=true,m=false,d={autoUpdate:t,history:t,strict:t,wrap:m},C=function(){var a={},b=ia(navigator.userAgent);if(b.browser){a[b.browser]=true;a.version=b.version}if(a.chrome)a.webkit=true;else if(a.webkit)a.safari=true;return a}(),z=parseFloat(C.version),A=C.webkit||C.safari,v=!c.support.opacity,i=function(){try{return top.document!==h&&top.document.title!==h?top:window}catch(a){return window}}(),n=i.document,y=i.history,j=i.location,ha=setInterval,q=setTimeout,T=/\/{2,9}/g;
-C=navigator.userAgent;var F="on"+K in i,k,J=c("script:last").attr("src"),Z=J?J.indexOf("?"):-1,P=n.title,w=m,aa=m,ca=t,N=m,e=s();_old=e;if(v){z=parseFloat(C.substr(C.indexOf("MSIE")+4));if(n.documentMode&&n.documentMode!=z)z=n.documentMode!=8?7:8;var da=n.onpropertychange;n.onpropertychange=function(){da&&da.call(n);if(n.title!=P&&n.title.indexOf("#"+s())!=-1)n.title=P}}if(y.navigationMode)y.navigationMode="compatible";if(document.readyState=="complete")var ja=setInterval(function(){if(c.address){ba();
-clearInterval(ja)}},50);else{$();c(ba)}c(window).bind("popstate",function(){if(decodeURI(e)!=decodeURI(s())){_old=e;e=s();G(m)}}).bind("unload",function(){if(i.removeEventListener)i.removeEventListener(K,H,m);else i.detachEvent&&i.detachEvent("on"+K,H)});return{bind:function(){return g.apply(this,p(arguments))},unbind:function(){return D.apply(this,p(arguments))},init:function(){return g.apply(this,["init"].concat(p(arguments)))},change:function(){return g.apply(this,[W].concat(p(arguments)))},internalChange:function(){return g.apply(this,
-[X].concat(p(arguments)))},externalChange:function(){return g.apply(this,[Y].concat(p(arguments)))},baseURL:function(){var a=j.href;if(a.indexOf("#")!=-1)a=a.substr(0,a.indexOf("#"));if(/\/$/.test(a))a=a.substr(0,a.length-1);return a},autoUpdate:function(a){if(a!==h){d.autoUpdate=a;return this}return d.autoUpdate},history:function(a){if(a!==h){d.history=a;return this}return d.history},state:function(a){if(a!==h){d.state=a;var b=U();if(d.state!==h)if(y.pushState)b.substr(0,3)=="/#/"&&j.replace(d.state.replace(/^\/$/,
-"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=L()&&q(function(){j.replace(d.state.replace(/^\/$/,"")+"/#"+b)},1);return this}return d.state},strict:function(a){if(a!==h){d.strict=a;return this}return d.strict},tracker:function(a){if(a!==h){d.tracker=a;return this}return d.tracker},wrap:function(a){if(a!==h){d.wrap=a;return this}return d.wrap},update:function(){N=t;this.value(e);N=m;return this},title:function(a){if(a!==h){q(function(){P=n.title=a;if(ca&&k&&k.contentWindow&&k.contentWindow.document){k.contentWindow.document.title=
-a;ca=m}},50);return this}return n.title},value:function(a){if(a!==h){a=O(a);if(a=="/")a="";if(e==a&&!N)return;_old=e;e=a;if(d.autoUpdate||N){G(t);if(E())y[d.history?"pushState":"replaceState"]({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=t;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=s())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!F&&d.history&&q(M,50);if(A)q(function(){w=m},1);else w=m}}return this}return O(e)},path:function(a){if(a!==h){var b=this.queryString(),
-f=this.hash();this.value(a+(b?"?"+b:"")+(f?"#"+f:""));return this}return O(e).split("#")[0].split("?")[0]},pathNames:function(){var a=this.path(),b=a.replace(T,"/").split("/");if(a.substr(0,1)=="/"||a.length===0)b.splice(0,1);a.substr(a.length-1,1)=="/"&&b.splice(b.length-1,1);return b},queryString:function(a){if(a!==h){var b=this.hash();this.value(this.path()+(a?"?"+a:"")+(b?"#"+b:""));return this}a=e.split("?");return a.slice(1,a.length).join("?").split("#")[0]},parameter:function(a,b,f){var l,
-o;if(b!==h){var Q=this.parameterNames();o=[];b=b===h||b===I?"":b.toString();for(l=0;l<Q.length;l++){var R=Q[l],x=this.parameter(R);if(typeof x=="string")x=[x];if(R==a)x=b===I||b===""?[]:f?x.concat([b]):[b];for(var S=0;S<x.length;S++)o.push(R+"="+x[S])}c.inArray(a,Q)==-1&&b!==I&&b!==""&&o.push(a+"="+b);this.queryString(o.join("&"));return this}if(b=this.queryString()){f=[];o=b.split("&");for(l=0;l<o.length;l++){b=o[l].split("=");b[0]==a&&f.push(b.slice(1).join("="))}if(f.length!==0)return f.length!=
-1?f:f[0]}},parameterNames:function(){var a=this.queryString(),b=[];if(a&&a.indexOf("=")!=-1){a=a.split("&");for(var f=0;f<a.length;f++){var l=a[f].split("=")[0];c.inArray(l,b)==-1&&b.push(l)}}return b},hash:function(a){if(a!==h){this.value(e.split("#")[0]+(a?"#"+a:""));return this}a=e.split("#");return a.slice(1,a.length).join("#")}}}();c.fn.address=function(r){var p;if(typeof r=="string"){p=r;r=undefined}c(this).attr("address")||c(document).on("click",p?p:this.selector,function(g){if(g.shiftKey||
-g.ctrlKey||g.metaKey||g.which==2)return true;if(c(g.target).is("a")){g.preventDefault();g=r?r.call(g.target):/address:/.test(c(g.target).attr("rel"))?c(g.target).attr("rel").split("address:")[1].split(" ")[0]:c.address.state()!==undefined&&!/^\/?$/.test(c.address.state())?c(g.target).attr("href").replace(new RegExp("^(.*"+c.address.state()+"|\\.)"),""):c(g.target).attr("href").replace(/^(#\!?|\.)/,"");c.address.value(g)}}).on("submit",p?p:this.selector,function(g){if(c(g.target).is("form")){g.preventDefault();
-var D=c(g.target).attr("action");g=r?r.call(g.target):(D.indexOf("?")!=-1?D.replace(/&$/,""):D+"?")+c(g.target).serialize();c.address.value(g)}}).attr("address",true);return this}})(jQuery);
+(function(c){c.address=function(){var t=function(a){a=c.extend(c.Event(a),function(){for(var b={},f=c.address.parameterNames(),o=0,s=f.length;o<s;o++)b[f[o]]=c.address.parameter(f[o]);return{value:c.address.value(),path:c.address.path(),pathNames:c.address.pathNames(),parameterNames:f,parameters:b,queryString:c.address.queryString()}}.call(c.address));c(c.address).trigger(a);return a},g=function(a){return Array.prototype.slice.call(a)},l=function(){c().bind.apply(c(c.address),Array.prototype.slice.call(arguments));
+return c.address},da=function(){c().unbind.apply(c(c.address),Array.prototype.slice.call(arguments));return c.address},D=function(){return y.pushState&&d.state!==h},T=function(){return("/"+j.pathname.replace(new RegExp(d.state),"")+j.search+(K()?"#"+K():"")).replace(S,"/")},K=function(){var a=j.href.indexOf("#");return a!=-1?j.href.substr(a+1):""},p=function(){return D()?T():K()},U=function(){return"javascript"},N=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},u=function(a,
+b){return parseInt(a.css(b),10)},G=function(){if(!w){var a=p();if(decodeURI(e)!=decodeURI(a))if(v&&z<7)j.reload();else{v&&!E&&d.history&&q(L,50);_old=e;e=a;F(m)}}},F=function(a){var b=t(V);a=t(a?W:X);q(ea,10);if(b.isDefaultPrevented()||a.isDefaultPrevented())fa()},fa=function(){e=_old;if(D())y.popState({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=r;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=p())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!E&&d.history&&q(L,50);
+if(A)q(function(){w=m},1);else w=m}},ea=function(){if(d.tracker!=="null"&&d.tracker!==H){var a=c.isFunction(d.tracker)?d.tracker:i[d.tracker],b=(j.pathname+j.search+(c.address&&!D()?c.address.value():"")).replace(/\/\//,"/").replace(/^\/$/,"");if(c.isFunction(a))a(b);else if(c.isFunction(i.urchinTracker))i.urchinTracker(b);else if(i.pageTracker!==h&&c.isFunction(i.pageTracker._trackPageview))i.pageTracker._trackPageview(b);else i._gaq!==h&&c.isFunction(i._gaq.push)&&i._gaq.push(["_trackPageview",
+decodeURI(b)])}},L=function(){var a=U()+":"+m+";document.open();document.writeln('<html><head><title>"+n.title.replace(/\'/g,"\\'")+"</title><script>var "+B+' = "'+encodeURIComponent(p()).replace(/\'/g,"\\'")+(n.domain!=j.hostname?'";document.domain="'+n.domain:"")+"\";<\/script></head></html>');document.close();";if(z<7)k.src=a;else k.contentWindow.location.replace(a)},Z=function(){if(I&&Y!=-1){var a,b,f=I.substr(Y+1).split("&");for(a=0;a<f.length;a++){b=f[a].split("=");if(/^(autoUpdate|history|strict|wrap)$/.test(b[0]))d[b[0]]=
+isNaN(b[1])?/^(true|yes)$/i.test(b[1]):parseInt(b[1],10)!==0;if(/^(state|tracker)$/.test(b[0]))d[b[0]]=b[1]}I=H}_old=e;e=p()},aa=function(){if(!$){$=r;Z();c('a[rel*="address:"]').address();if(d.wrap){var a=c("body");c("body > *").wrapAll('<div style="padding:'+(u(a,"marginTop")+u(a,"paddingTop"))+"px "+(u(a,"marginRight")+u(a,"paddingRight"))+"px "+(u(a,"marginBottom")+u(a,"paddingBottom"))+"px "+(u(a,"marginLeft")+u(a,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+B+'" style="height:100%;overflow:auto;position:relative;'+
+(A&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});A&&c('<style type="text/css" />').appendTo("head").text("#"+B+"::-webkit-resizer { background-color: #fff; }")}if(v&&!E){a=n.getElementsByTagName("frameset")[0];k=n.createElement((a?"":"i")+"frame");k.src=U()+":"+m;if(a){a.insertAdjacentElement("beforeEnd",k);a[a.cols?"cols":"rows"]+=",0";k.noResize=r;k.frameBorder=k.frameSpacing=0}else{k.style.display="none";k.style.width=
+k.style.height=0;k.tabIndex=-1;n.body.insertAdjacentElement("afterBegin",k)}q(function(){c(k).bind("load",function(){var b=k.contentWindow;_old=e;e=b[B]!==h?b[B]:"";if(e!=p()){F(m);j.hash=e}});k.contentWindow[B]===h&&L()},50)}q(function(){t("init");F(m)},1);if(!D())if(v&&z>7||!v&&E)if(i.addEventListener)i.addEventListener(J,G,m);else i.attachEvent&&i.attachEvent("on"+J,G);else ga(G,50);"state"in window.history&&c(window).trigger("popstate")}},ha=function(a){a=a.toLowerCase();a=/(chrome)[ \/]([\w.]+)/.exec(a)||
+/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},h,H=null,B="jQueryAddress",J="hashchange",V="change",W="internalChange",X="externalChange",r=true,m=false,d={autoUpdate:r,history:r,strict:r,wrap:m},C=function(){var a={},b=ha(navigator.userAgent);if(b.browser){a[b.browser]=true;a.version=b.version}if(a.chrome)a.webkit=true;else if(a.webkit)a.safari=
+true;return a}(),z=parseFloat(C.version),A=C.webkit||C.safari,v=!c.support.opacity,i=function(){try{return top.document!==h&&top.document.title!==h?top:window}catch(a){return window}}(),n=i.document,y=i.history,j=i.location,ga=setInterval,q=setTimeout,S=/\/{2,9}/g;C=navigator.userAgent;var E="on"+J in i,k,I=c("script:last").attr("src"),Y=I?I.indexOf("?"):-1,O=n.title,w=m,$=m,ba=r,M=m,e=p();_old=e;if(v){z=parseFloat(C.substr(C.indexOf("MSIE")+4));if(n.documentMode&&n.documentMode!=z)z=n.documentMode!=
+8?7:8;var ca=n.onpropertychange;n.onpropertychange=function(){ca&&ca.call(n);if(n.title!=O&&n.title.indexOf("#"+p())!=-1)n.title=O}}if(y.navigationMode)y.navigationMode="compatible";if(document.readyState=="complete")var ia=setInterval(function(){if(c.address){aa();clearInterval(ia)}},50);else{Z();c(aa)}c(window).bind("popstate",function(){if(decodeURI(e)!=decodeURI(p())){_old=e;e=p();F(m)}}).bind("unload",function(){if(i.removeEventListener)i.removeEventListener(J,G,m);else i.detachEvent&&i.detachEvent("on"+
+J,G)});return{bind:function(){return l.apply(this,g(arguments))},unbind:function(){return da.apply(this,g(arguments))},init:function(){return l.apply(this,["init"].concat(g(arguments)))},change:function(){return l.apply(this,[V].concat(g(arguments)))},internalChange:function(){return l.apply(this,[W].concat(g(arguments)))},externalChange:function(){return l.apply(this,[X].concat(g(arguments)))},baseURL:function(){var a=j.href;if(a.indexOf("#")!=-1)a=a.substr(0,a.indexOf("#"));if(/\/$/.test(a))a=a.substr(0,
+a.length-1);return a},autoUpdate:function(a){if(a!==h){d.autoUpdate=a;return this}return d.autoUpdate},history:function(a){if(a!==h){d.history=a;return this}return d.history},state:function(a){if(a!==h){d.state=a;var b=T();if(d.state!==h)if(y.pushState)b.substr(0,3)=="/#/"&&j.replace(d.state.replace(/^\/$/,"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=K()&&q(function(){j.replace(d.state.replace(/^\/$/,"")+"/#"+b)},1);return this}return d.state},strict:function(a){if(a!==h){d.strict=a;return this}return d.strict},
+tracker:function(a){if(a!==h){d.tracker=a;return this}return d.tracker},wrap:function(a){if(a!==h){d.wrap=a;return this}return d.wrap},update:function(){M=r;this.value(e);M=m;return this},title:function(a){if(a!==h){q(function(){O=n.title=a;if(ba&&k&&k.contentWindow&&k.contentWindow.document){k.contentWindow.document.title=a;ba=m}},50);return this}return n.title},value:function(a){if(a!==h){a=N(a);if(a=="/")a="";if(e==a&&!M)return;_old=e;e=a;if(d.autoUpdate||M){F(r);if(D())y[d.history?"pushState":
+"replaceState"]({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=r;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=p())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!E&&d.history&&q(L,50);if(A)q(function(){w=m},1);else w=m}}return this}return N(e)},path:function(a){if(a!==h){var b=this.queryString(),f=this.hash();this.value(a+(b?"?"+b:"")+(f?"#"+f:""));return this}return N(e).split("#")[0].split("?")[0]},pathNames:function(){var a=this.path(),b=a.replace(S,"/").split("/");
+if(a.substr(0,1)=="/"||a.length===0)b.splice(0,1);a.substr(a.length-1,1)=="/"&&b.splice(b.length-1,1);return b},queryString:function(a){if(a!==h){var b=this.hash();this.value(this.path()+(a?"?"+a:"")+(b?"#"+b:""));return this}a=e.split("?");return a.slice(1,a.length).join("?").split("#")[0]},parameter:function(a,b,f){var o,s;if(b!==h){var P=this.parameterNames();s=[];b=b===h||b===H?"":b.toString();for(o=0;o<P.length;o++){var Q=P[o],x=this.parameter(Q);if(typeof x=="string")x=[x];if(Q==a)x=b===H||
+b===""?[]:f?x.concat([b]):[b];for(var R=0;R<x.length;R++)s.push(Q+"="+x[R])}c.inArray(a,P)==-1&&b!==H&&b!==""&&s.push(a+"="+b);this.queryString(s.join("&"));return this}if(b=this.queryString()){f=[];s=b.split("&");for(o=0;o<s.length;o++){b=s[o].split("=");b[0]==a&&f.push(b.slice(1).join("="))}if(f.length!==0)return f.length!=1?f:f[0]}},parameterNames:function(){var a=this.queryString(),b=[];if(a&&a.indexOf("=")!=-1){a=a.split("&");for(var f=0;f<a.length;f++){var o=a[f].split("=")[0];c.inArray(o,b)==
+-1&&b.push(o)}}return b},hash:function(a){if(a!==h){this.value(e.split("#")[0]+(a?"#"+a:""));return this}a=e.split("#");return a.slice(1,a.length).join("#")}}}();c.fn.address=function(t){this.data("address")||this.on("click",function(g){if(g.shiftKey||g.ctrlKey||g.metaKey||g.which==2)return true;var l=g.currentTarget;if(c(l).is("a")){g.preventDefault();g=t?t.call(l):/address:/.test(c(l).attr("rel"))?c(l).attr("rel").split("address:")[1].split(" ")[0]:c.address.state()!==undefined&&!/^\/?$/.test(c.address.state())?
+c(l).attr("href").replace(new RegExp("^(.*"+c.address.state()+"|\\.)"),""):c(l).attr("href").replace(/^(#\!?|\.)/,"");c.address.value(g)}}).on("submit",function(g){var l=g.currentTarget;if(c(l).is("form")){g.preventDefault();g=c(l).attr("action");l=t?t.call(l):(g.indexOf("?")!=-1?g.replace(/&$/,""):g+"?")+c(l).serialize();c.address.value(l)}}).data("address",true);return this}})(jQuery);
View
41 samples/form/jquery.address-1.6.min.js
@@ -6,25 +6,24 @@
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
- * Date: 2013-01-22 02:04:06 +0200 (Tue, 22 Jan 2013)
+ * Date: 2013-01-26 19:43:30 +0200 (Sat, 26 Jan 2013)
*/
-(function(c){c.address=function(){var r=function(a){a=c.extend(c.Event(a),function(){for(var b={},f=c.address.parameterNames(),l=0,o=f.length;l<o;l++)b[f[l]]=c.address.parameter(f[l]);return{value:c.address.value(),path:c.address.path(),pathNames:c.address.pathNames(),parameterNames:f,parameters:b,queryString:c.address.queryString()}}.call(c.address));c(c.address).trigger(a);return a},p=function(a){return Array.prototype.slice.call(a)},g=function(){c().bind.apply(c(c.address),Array.prototype.slice.call(arguments));
-return c.address},D=function(){c().unbind.apply(c(c.address),Array.prototype.slice.call(arguments));return c.address},E=function(){return y.pushState&&d.state!==h},U=function(){return("/"+j.pathname.replace(new RegExp(d.state),"")+j.search+(L()?"#"+L():"")).replace(T,"/")},L=function(){var a=j.href.indexOf("#");return a!=-1?j.href.substr(a+1):""},s=function(){return E()?U():L()},V=function(){return"javascript"},O=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},u=function(a,
-b){return parseInt(a.css(b),10)},H=function(){if(!w){var a=s();if(decodeURI(e)!=decodeURI(a))if(v&&z<7)j.reload();else{v&&!F&&d.history&&q(M,50);_old=e;e=a;G(m)}}},G=function(a){var b=r(W);a=r(a?X:Y);q(ea,10);if(b.isDefaultPrevented()||a.isDefaultPrevented())fa()},fa=function(){e=_old;if(E())y.popState({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=t;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=s())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!F&&d.history&&q(M,50);
-if(A)q(function(){w=m},1);else w=m}},ea=function(){if(d.tracker!=="null"&&d.tracker!==I){var a=c.isFunction(d.tracker)?d.tracker:i[d.tracker],b=(j.pathname+j.search+(c.address&&!E()?c.address.value():"")).replace(/\/\//,"/").replace(/^\/$/,"");if(c.isFunction(a))a(b);else if(c.isFunction(i.urchinTracker))i.urchinTracker(b);else if(i.pageTracker!==h&&c.isFunction(i.pageTracker._trackPageview))i.pageTracker._trackPageview(b);else i._gaq!==h&&c.isFunction(i._gaq.push)&&i._gaq.push(["_trackPageview",
-decodeURI(b)])}},M=function(){var a=V()+":"+m+";document.open();document.writeln('<html><head><title>"+n.title.replace(/\'/g,"\\'")+"</title><script>var "+B+' = "'+encodeURIComponent(s()).replace(/\'/g,"\\'")+(n.domain!=j.hostname?'";document.domain="'+n.domain:"")+"\";<\/script></head></html>');document.close();";if(z<7)k.src=a;else k.contentWindow.location.replace(a)},$=function(){if(J&&Z!=-1){var a,b,f=J.substr(Z+1).split("&");for(a=0;a<f.length;a++){b=f[a].split("=");if(/^(autoUpdate|history|strict|wrap)$/.test(b[0]))d[b[0]]=
-isNaN(b[1])?/^(true|yes)$/i.test(b[1]):parseInt(b[1],10)!==0;if(/^(state|tracker)$/.test(b[0]))d[b[0]]=b[1]}J=I}_old=e;e=s()},ba=function(){if(!aa){aa=t;$();var a=c("body"),b=function(){ga.call(this)};c(document).ajaxComplete(b);b();if(d.wrap){c("body > *").wrapAll('<div style="padding:'+(u(a,"marginTop")+u(a,"paddingTop"))+"px "+(u(a,"marginRight")+u(a,"paddingRight"))+"px "+(u(a,"marginBottom")+u(a,"paddingBottom"))+"px "+(u(a,"marginLeft")+u(a,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+
-B+'" style="height:100%;overflow:auto;position:relative;'+(A&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});A&&c('<style type="text/css" />').appendTo("head").text("#"+B+"::-webkit-resizer { background-color: #fff; }")}if(v&&!F){a=n.getElementsByTagName("frameset")[0];k=n.createElement((a?"":"i")+"frame");k.src=V()+":"+m;if(a){a.insertAdjacentElement("beforeEnd",k);a[a.cols?"cols":"rows"]+=",0";k.noResize=t;k.frameBorder=
-k.frameSpacing=0}else{k.style.display="none";k.style.width=k.style.height=0;k.tabIndex=-1;n.body.insertAdjacentElement("afterBegin",k)}q(function(){c(k).bind("load",function(){var f=k.contentWindow;_old=e;e=f[B]!==h?f[B]:"";if(e!=s()){G(m);j.hash=e}});k.contentWindow[B]===h&&M()},50)}q(function(){r("init");G(m)},1);if(!E())if(v&&z>7||!v&&F)if(i.addEventListener)i.addEventListener(K,H,m);else i.attachEvent&&i.attachEvent("on"+K,H);else ha(H,50);"state"in window.history&&c(window).trigger("popstate")}},
-ga=function(){var a,b=c("a"),f=b.size(),l=-1,o=function(){if(++l!=f){a=c(b.get(l));a.is('[rel*="address:"]')&&a.address('[rel*="address:"]');q(o,1)}};q(o,1)},ia=function(a){a=a.toLowerCase();a=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},h,I=null,B="jQueryAddress",K="hashchange",W="change",X=
-"internalChange",Y="externalChange",t=true,m=false,d={autoUpdate:t,history:t,strict:t,wrap:m},C=function(){var a={},b=ia(navigator.userAgent);if(b.browser){a[b.browser]=true;a.version=b.version}if(a.chrome)a.webkit=true;else if(a.webkit)a.safari=true;return a}(),z=parseFloat(C.version),A=C.webkit||C.safari,v=!c.support.opacity,i=function(){try{return top.document!==h&&top.document.title!==h?top:window}catch(a){return window}}(),n=i.document,y=i.history,j=i.location,ha=setInterval,q=setTimeout,T=/\/{2,9}/g;
-C=navigator.userAgent;var F="on"+K in i,k,J=c("script:last").attr("src"),Z=J?J.indexOf("?"):-1,P=n.title,w=m,aa=m,ca=t,N=m,e=s();_old=e;if(v){z=parseFloat(C.substr(C.indexOf("MSIE")+4));if(n.documentMode&&n.documentMode!=z)z=n.documentMode!=8?7:8;var da=n.onpropertychange;n.onpropertychange=function(){da&&da.call(n);if(n.title!=P&&n.title.indexOf("#"+s())!=-1)n.title=P}}if(y.navigationMode)y.navigationMode="compatible";if(document.readyState=="complete")var ja=setInterval(function(){if(c.address){ba();
-clearInterval(ja)}},50);else{$();c(ba)}c(window).bind("popstate",function(){if(decodeURI(e)!=decodeURI(s())){_old=e;e=s();G(m)}}).bind("unload",function(){if(i.removeEventListener)i.removeEventListener(K,H,m);else i.detachEvent&&i.detachEvent("on"+K,H)});return{bind:function(){return g.apply(this,p(arguments))},unbind:function(){return D.apply(this,p(arguments))},init:function(){return g.apply(this,["init"].concat(p(arguments)))},change:function(){return g.apply(this,[W].concat(p(arguments)))},internalChange:function(){return g.apply(this,
-[X].concat(p(arguments)))},externalChange:function(){return g.apply(this,[Y].concat(p(arguments)))},baseURL:function(){var a=j.href;if(a.indexOf("#")!=-1)a=a.substr(0,a.indexOf("#"));if(/\/$/.test(a))a=a.substr(0,a.length-1);return a},autoUpdate:function(a){if(a!==h){d.autoUpdate=a;return this}return d.autoUpdate},history:function(a){if(a!==h){d.history=a;return this}return d.history},state:function(a){if(a!==h){d.state=a;var b=U();if(d.state!==h)if(y.pushState)b.substr(0,3)=="/#/"&&j.replace(d.state.replace(/^\/$/,
-"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=L()&&q(function(){j.replace(d.state.replace(/^\/$/,"")+"/#"+b)},1);return this}return d.state},strict:function(a){if(a!==h){d.strict=a;return this}return d.strict},tracker:function(a){if(a!==h){d.tracker=a;return this}return d.tracker},wrap:function(a){if(a!==h){d.wrap=a;return this}return d.wrap},update:function(){N=t;this.value(e);N=m;return this},title:function(a){if(a!==h){q(function(){P=n.title=a;if(ca&&k&&k.contentWindow&&k.contentWindow.document){k.contentWindow.document.title=
-a;ca=m}},50);return this}return n.title},value:function(a){if(a!==h){a=O(a);if(a=="/")a="";if(e==a&&!N)return;_old=e;e=a;if(d.autoUpdate||N){G(t);if(E())y[d.history?"pushState":"replaceState"]({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=t;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=s())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!F&&d.history&&q(M,50);if(A)q(function(){w=m},1);else w=m}}return this}return O(e)},path:function(a){if(a!==h){var b=this.queryString(),
-f=this.hash();this.value(a+(b?"?"+b:"")+(f?"#"+f:""));return this}return O(e).split("#")[0].split("?")[0]},pathNames:function(){var a=this.path(),b=a.replace(T,"/").split("/");if(a.substr(0,1)=="/"||a.length===0)b.splice(0,1);a.substr(a.length-1,1)=="/"&&b.splice(b.length-1,1);return b},queryString:function(a){if(a!==h){var b=this.hash();this.value(this.path()+(a?"?"+a:"")+(b?"#"+b:""));return this}a=e.split("?");return a.slice(1,a.length).join("?").split("#")[0]},parameter:function(a,b,f){var l,
-o;if(b!==h){var Q=this.parameterNames();o=[];b=b===h||b===I?"":b.toString();for(l=0;l<Q.length;l++){var R=Q[l],x=this.parameter(R);if(typeof x=="string")x=[x];if(R==a)x=b===I||b===""?[]:f?x.concat([b]):[b];for(var S=0;S<x.length;S++)o.push(R+"="+x[S])}c.inArray(a,Q)==-1&&b!==I&&b!==""&&o.push(a+"="+b);this.queryString(o.join("&"));return this}if(b=this.queryString()){f=[];o=b.split("&");for(l=0;l<o.length;l++){b=o[l].split("=");b[0]==a&&f.push(b.slice(1).join("="))}if(f.length!==0)return f.length!=
-1?f:f[0]}},parameterNames:function(){var a=this.queryString(),b=[];if(a&&a.indexOf("=")!=-1){a=a.split("&");for(var f=0;f<a.length;f++){var l=a[f].split("=")[0];c.inArray(l,b)==-1&&b.push(l)}}return b},hash:function(a){if(a!==h){this.value(e.split("#")[0]+(a?"#"+a:""));return this}a=e.split("#");return a.slice(1,a.length).join("#")}}}();c.fn.address=function(r){var p;if(typeof r=="string"){p=r;r=undefined}c(this).attr("address")||c(document).on("click",p?p:this.selector,function(g){if(g.shiftKey||
-g.ctrlKey||g.metaKey||g.which==2)return true;if(c(g.target).is("a")){g.preventDefault();g=r?r.call(g.target):/address:/.test(c(g.target).attr("rel"))?c(g.target).attr("rel").split("address:")[1].split(" ")[0]:c.address.state()!==undefined&&!/^\/?$/.test(c.address.state())?c(g.target).attr("href").replace(new RegExp("^(.*"+c.address.state()+"|\\.)"),""):c(g.target).attr("href").replace(/^(#\!?|\.)/,"");c.address.value(g)}}).on("submit",p?p:this.selector,function(g){if(c(g.target).is("form")){g.preventDefault();
-var D=c(g.target).attr("action");g=r?r.call(g.target):(D.indexOf("?")!=-1?D.replace(/&$/,""):D+"?")+c(g.target).serialize();c.address.value(g)}}).attr("address",true);return this}})(jQuery);
+(function(c){c.address=function(){var t=function(a){a=c.extend(c.Event(a),function(){for(var b={},f=c.address.parameterNames(),o=0,s=f.length;o<s;o++)b[f[o]]=c.address.parameter(f[o]);return{value:c.address.value(),path:c.address.path(),pathNames:c.address.pathNames(),parameterNames:f,parameters:b,queryString:c.address.queryString()}}.call(c.address));c(c.address).trigger(a);return a},g=function(a){return Array.prototype.slice.call(a)},l=function(){c().bind.apply(c(c.address),Array.prototype.slice.call(arguments));
+return c.address},da=function(){c().unbind.apply(c(c.address),Array.prototype.slice.call(arguments));return c.address},D=function(){return y.pushState&&d.state!==h},T=function(){return("/"+j.pathname.replace(new RegExp(d.state),"")+j.search+(K()?"#"+K():"")).replace(S,"/")},K=function(){var a=j.href.indexOf("#");return a!=-1?j.href.substr(a+1):""},p=function(){return D()?T():K()},U=function(){return"javascript"},N=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},u=function(a,
+b){return parseInt(a.css(b),10)},G=function(){if(!w){var a=p();if(decodeURI(e)!=decodeURI(a))if(v&&z<7)j.reload();else{v&&!E&&d.history&&q(L,50);_old=e;e=a;F(m)}}},F=function(a){var b=t(V);a=t(a?W:X);q(ea,10);if(b.isDefaultPrevented()||a.isDefaultPrevented())fa()},fa=function(){e=_old;if(D())y.popState({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=r;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=p())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!E&&d.history&&q(L,50);
+if(A)q(function(){w=m},1);else w=m}},ea=function(){if(d.tracker!=="null"&&d.tracker!==H){var a=c.isFunction(d.tracker)?d.tracker:i[d.tracker],b=(j.pathname+j.search+(c.address&&!D()?c.address.value():"")).replace(/\/\//,"/").replace(/^\/$/,"");if(c.isFunction(a))a(b);else if(c.isFunction(i.urchinTracker))i.urchinTracker(b);else if(i.pageTracker!==h&&c.isFunction(i.pageTracker._trackPageview))i.pageTracker._trackPageview(b);else i._gaq!==h&&c.isFunction(i._gaq.push)&&i._gaq.push(["_trackPageview",
+decodeURI(b)])}},L=function(){var a=U()+":"+m+";document.open();document.writeln('<html><head><title>"+n.title.replace(/\'/g,"\\'")+"</title><script>var "+B+' = "'+encodeURIComponent(p()).replace(/\'/g,"\\'")+(n.domain!=j.hostname?'";document.domain="'+n.domain:"")+"\";<\/script></head></html>');document.close();";if(z<7)k.src=a;else k.contentWindow.location.replace(a)},Z=function(){if(I&&Y!=-1){var a,b,f=I.substr(Y+1).split("&");for(a=0;a<f.length;a++){b=f[a].split("=");if(/^(autoUpdate|history|strict|wrap)$/.test(b[0]))d[b[0]]=
+isNaN(b[1])?/^(true|yes)$/i.test(b[1]):parseInt(b[1],10)!==0;if(/^(state|tracker)$/.test(b[0]))d[b[0]]=b[1]}I=H}_old=e;e=p()},aa=function(){if(!$){$=r;Z();c('a[rel*="address:"]').address();if(d.wrap){var a=c("body");c("body > *").wrapAll('<div style="padding:'+(u(a,"marginTop")+u(a,"paddingTop"))+"px "+(u(a,"marginRight")+u(a,"paddingRight"))+"px "+(u(a,"marginBottom")+u(a,"paddingBottom"))+"px "+(u(a,"marginLeft")+u(a,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+B+'" style="height:100%;overflow:auto;position:relative;'+
+(A&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});A&&c('<style type="text/css" />').appendTo("head").text("#"+B+"::-webkit-resizer { background-color: #fff; }")}if(v&&!E){a=n.getElementsByTagName("frameset")[0];k=n.createElement((a?"":"i")+"frame");k.src=U()+":"+m;if(a){a.insertAdjacentElement("beforeEnd",k);a[a.cols?"cols":"rows"]+=",0";k.noResize=r;k.frameBorder=k.frameSpacing=0}else{k.style.display="none";k.style.width=
+k.style.height=0;k.tabIndex=-1;n.body.insertAdjacentElement("afterBegin",k)}q(function(){c(k).bind("load",function(){var b=k.contentWindow;_old=e;e=b[B]!==h?b[B]:"";if(e!=p()){F(m);j.hash=e}});k.contentWindow[B]===h&&L()},50)}q(function(){t("init");F(m)},1);if(!D())if(v&&z>7||!v&&E)if(i.addEventListener)i.addEventListener(J,G,m);else i.attachEvent&&i.attachEvent("on"+J,G);else ga(G,50);"state"in window.history&&c(window).trigger("popstate")}},ha=function(a){a=a.toLowerCase();a=/(chrome)[ \/]([\w.]+)/.exec(a)||
+/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},h,H=null,B="jQueryAddress",J="hashchange",V="change",W="internalChange",X="externalChange",r=true,m=false,d={autoUpdate:r,history:r,strict:r,wrap:m},C=function(){var a={},b=ha(navigator.userAgent);if(b.browser){a[b.browser]=true;a.version=b.version}if(a.chrome)a.webkit=true;else if(a.webkit)a.safari=
+true;return a}(),z=parseFloat(C.version),A=C.webkit||C.safari,v=!c.support.opacity,i=function(){try{return top.document!==h&&top.document.title!==h?top:window}catch(a){return window}}(),n=i.document,y=i.history,j=i.location,ga=setInterval,q=setTimeout,S=/\/{2,9}/g;C=navigator.userAgent;var E="on"+J in i,k,I=c("script:last").attr("src"),Y=I?I.indexOf("?"):-1,O=n.title,w=m,$=m,ba=r,M=m,e=p();_old=e;if(v){z=parseFloat(C.substr(C.indexOf("MSIE")+4));if(n.documentMode&&n.documentMode!=z)z=n.documentMode!=
+8?7:8;var ca=n.onpropertychange;n.onpropertychange=function(){ca&&ca.call(n);if(n.title!=O&&n.title.indexOf("#"+p())!=-1)n.title=O}}if(y.navigationMode)y.navigationMode="compatible";if(document.readyState=="complete")var ia=setInterval(function(){if(c.address){aa();clearInterval(ia)}},50);else{Z();c(aa)}c(window).bind("popstate",function(){if(decodeURI(e)!=decodeURI(p())){_old=e;e=p();F(m)}}).bind("unload",function(){if(i.removeEventListener)i.removeEventListener(J,G,m);else i.detachEvent&&i.detachEvent("on"+
+J,G)});return{bind:function(){return l.apply(this,g(arguments))},unbind:function(){return da.apply(this,g(arguments))},init:function(){return l.apply(this,["init"].concat(g(arguments)))},change:function(){return l.apply(this,[V].concat(g(arguments)))},internalChange:function(){return l.apply(this,[W].concat(g(arguments)))},externalChange:function(){return l.apply(this,[X].concat(g(arguments)))},baseURL:function(){var a=j.href;if(a.indexOf("#")!=-1)a=a.substr(0,a.indexOf("#"));if(/\/$/.test(a))a=a.substr(0,
+a.length-1);return a},autoUpdate:function(a){if(a!==h){d.autoUpdate=a;return this}return d.autoUpdate},history:function(a){if(a!==h){d.history=a;return this}return d.history},state:function(a){if(a!==h){d.state=a;var b=T();if(d.state!==h)if(y.pushState)b.substr(0,3)=="/#/"&&j.replace(d.state.replace(/^\/$/,"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=K()&&q(function(){j.replace(d.state.replace(/^\/$/,"")+"/#"+b)},1);return this}return d.state},strict:function(a){if(a!==h){d.strict=a;return this}return d.strict},
+tracker:function(a){if(a!==h){d.tracker=a;return this}return d.tracker},wrap:function(a){if(a!==h){d.wrap=a;return this}return d.wrap},update:function(){M=r;this.value(e);M=m;return this},title:function(a){if(a!==h){q(function(){O=n.title=a;if(ba&&k&&k.contentWindow&&k.contentWindow.document){k.contentWindow.document.title=a;ba=m}},50);return this}return n.title},value:function(a){if(a!==h){a=N(a);if(a=="/")a="";if(e==a&&!M)return;_old=e;e=a;if(d.autoUpdate||M){F(r);if(D())y[d.history?"pushState":
+"replaceState"]({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=r;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=p())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!E&&d.history&&q(L,50);if(A)q(function(){w=m},1);else w=m}}return this}return N(e)},path:function(a){if(a!==h){var b=this.queryString(),f=this.hash();this.value(a+(b?"?"+b:"")+(f?"#"+f:""));return this}return N(e).split("#")[0].split("?")[0]},pathNames:function(){var a=this.path(),b=a.replace(S,"/").split("/");
+if(a.substr(0,1)=="/"||a.length===0)b.splice(0,1);a.substr(a.length-1,1)=="/"&&b.splice(b.length-1,1);return b},queryString:function(a){if(a!==h){var b=this.hash();this.value(this.path()+(a?"?"+a:"")+(b?"#"+b:""));return this}a=e.split("?");return a.slice(1,a.length).join("?").split("#")[0]},parameter:function(a,b,f){var o,s;if(b!==h){var P=this.parameterNames();s=[];b=b===h||b===H?"":b.toString();for(o=0;o<P.length;o++){var Q=P[o],x=this.parameter(Q);if(typeof x=="string")x=[x];if(Q==a)x=b===H||
+b===""?[]:f?x.concat([b]):[b];for(var R=0;R<x.length;R++)s.push(Q+"="+x[R])}c.inArray(a,P)==-1&&b!==H&&b!==""&&s.push(a+"="+b);this.queryString(s.join("&"));return this}if(b=this.queryString()){f=[];s=b.split("&");for(o=0;o<s.length;o++){b=s[o].split("=");b[0]==a&&f.push(b.slice(1).join("="))}if(f.length!==0)return f.length!=1?f:f[0]}},parameterNames:function(){var a=this.queryString(),b=[];if(a&&a.indexOf("=")!=-1){a=a.split("&");for(var f=0;f<a.length;f++){var o=a[f].split("=")[0];c.inArray(o,b)==
+-1&&b.push(o)}}return b},hash:function(a){if(a!==h){this.value(e.split("#")[0]+(a?"#"+a:""));return this}a=e.split("#");return a.slice(1,a.length).join("#")}}}();c.fn.address=function(t){this.data("address")||this.on("click",function(g){if(g.shiftKey||g.ctrlKey||g.metaKey||g.which==2)return true;var l=g.currentTarget;if(c(l).is("a")){g.preventDefault();g=t?t.call(l):/address:/.test(c(l).attr("rel"))?c(l).attr("rel").split("address:")[1].split(" ")[0]:c.address.state()!==undefined&&!/^\/?$/.test(c.address.state())?
+c(l).attr("href").replace(new RegExp("^(.*"+c.address.state()+"|\\.)"),""):c(l).attr("href").replace(/^(#\!?|\.)/,"");c.address.value(g)}}).on("submit",function(g){var l=g.currentTarget;if(c(l).is("form")){g.preventDefault();g=c(l).attr("action");l=t?t.call(l):(g.indexOf("?")!=-1?g.replace(/&$/,""):g+"?")+c(l).serialize();c.address.value(l)}}).data("address",true);return this}})(jQuery);
View
41 samples/state/jquery.address-1.6.min.js
@@ -6,25 +6,24 @@
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
- * Date: 2013-01-22 02:04:06 +0200 (Tue, 22 Jan 2013)
+ * Date: 2013-01-26 19:43:30 +0200 (Sat, 26 Jan 2013)
*/
-(function(c){c.address=function(){var r=function(a){a=c.extend(c.Event(a),function(){for(var b={},f=c.address.parameterNames(),l=0,o=f.length;l<o;l++)b[f[l]]=c.address.parameter(f[l]);return{value:c.address.value(),path:c.address.path(),pathNames:c.address.pathNames(),parameterNames:f,parameters:b,queryString:c.address.queryString()}}.call(c.address));c(c.address).trigger(a);return a},p=function(a){return Array.prototype.slice.call(a)},g=function(){c().bind.apply(c(c.address),Array.prototype.slice.call(arguments));
-return c.address},D=function(){c().unbind.apply(c(c.address),Array.prototype.slice.call(arguments));return c.address},E=function(){return y.pushState&&d.state!==h},U=function(){return("/"+j.pathname.replace(new RegExp(d.state),"")+j.search+(L()?"#"+L():"")).replace(T,"/")},L=function(){var a=j.href.indexOf("#");return a!=-1?j.href.substr(a+1):""},s=function(){return E()?U():L()},V=function(){return"javascript"},O=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},u=function(a,
-b){return parseInt(a.css(b),10)},H=function(){if(!w){var a=s();if(decodeURI(e)!=decodeURI(a))if(v&&z<7)j.reload();else{v&&!F&&d.history&&q(M,50);_old=e;e=a;G(m)}}},G=function(a){var b=r(W);a=r(a?X:Y);q(ea,10);if(b.isDefaultPrevented()||a.isDefaultPrevented())fa()},fa=function(){e=_old;if(E())y.popState({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=t;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=s())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!F&&d.history&&q(M,50);
-if(A)q(function(){w=m},1);else w=m}},ea=function(){if(d.tracker!=="null"&&d.tracker!==I){var a=c.isFunction(d.tracker)?d.tracker:i[d.tracker],b=(j.pathname+j.search+(c.address&&!E()?c.address.value():"")).replace(/\/\//,"/").replace(/^\/$/,"");if(c.isFunction(a))a(b);else if(c.isFunction(i.urchinTracker))i.urchinTracker(b);else if(i.pageTracker!==h&&c.isFunction(i.pageTracker._trackPageview))i.pageTracker._trackPageview(b);else i._gaq!==h&&c.isFunction(i._gaq.push)&&i._gaq.push(["_trackPageview",
-decodeURI(b)])}},M=function(){var a=V()+":"+m+";document.open();document.writeln('<html><head><title>"+n.title.replace(/\'/g,"\\'")+"</title><script>var "+B+' = "'+encodeURIComponent(s()).replace(/\'/g,"\\'")+(n.domain!=j.hostname?'";document.domain="'+n.domain:"")+"\";<\/script></head></html>');document.close();";if(z<7)k.src=a;else k.contentWindow.location.replace(a)},$=function(){if(J&&Z!=-1){var a,b,f=J.substr(Z+1).split("&");for(a=0;a<f.length;a++){b=f[a].split("=");if(/^(autoUpdate|history|strict|wrap)$/.test(b[0]))d[b[0]]=
-isNaN(b[1])?/^(true|yes)$/i.test(b[1]):parseInt(b[1],10)!==0;if(/^(state|tracker)$/.test(b[0]))d[b[0]]=b[1]}J=I}_old=e;e=s()},ba=function(){if(!aa){aa=t;$();var a=c("body"),b=function(){ga.call(this)};c(document).ajaxComplete(b);b();if(d.wrap){c("body > *").wrapAll('<div style="padding:'+(u(a,"marginTop")+u(a,"paddingTop"))+"px "+(u(a,"marginRight")+u(a,"paddingRight"))+"px "+(u(a,"marginBottom")+u(a,"paddingBottom"))+"px "+(u(a,"marginLeft")+u(a,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+
-B+'" style="height:100%;overflow:auto;position:relative;'+(A&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});A&&c('<style type="text/css" />').appendTo("head").text("#"+B+"::-webkit-resizer { background-color: #fff; }")}if(v&&!F){a=n.getElementsByTagName("frameset")[0];k=n.createElement((a?"":"i")+"frame");k.src=V()+":"+m;if(a){a.insertAdjacentElement("beforeEnd",k);a[a.cols?"cols":"rows"]+=",0";k.noResize=t;k.frameBorder=
-k.frameSpacing=0}else{k.style.display="none";k.style.width=k.style.height=0;k.tabIndex=-1;n.body.insertAdjacentElement("afterBegin",k)}q(function(){c(k).bind("load",function(){var f=k.contentWindow;_old=e;e=f[B]!==h?f[B]:"";if(e!=s()){G(m);j.hash=e}});k.contentWindow[B]===h&&M()},50)}q(function(){r("init");G(m)},1);if(!E())if(v&&z>7||!v&&F)if(i.addEventListener)i.addEventListener(K,H,m);else i.attachEvent&&i.attachEvent("on"+K,H);else ha(H,50);"state"in window.history&&c(window).trigger("popstate")}},
-ga=function(){var a,b=c("a"),f=b.size(),l=-1,o=function(){if(++l!=f){a=c(b.get(l));a.is('[rel*="address:"]')&&a.address('[rel*="address:"]');q(o,1)}};q(o,1)},ia=function(a){a=a.toLowerCase();a=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},h,I=null,B="jQueryAddress",K="hashchange",W="change",X=
-"internalChange",Y="externalChange",t=true,m=false,d={autoUpdate:t,history:t,strict:t,wrap:m},C=function(){var a={},b=ia(navigator.userAgent);if(b.browser){a[b.browser]=true;a.version=b.version}if(a.chrome)a.webkit=true;else if(a.webkit)a.safari=true;return a}(),z=parseFloat(C.version),A=C.webkit||C.safari,v=!c.support.opacity,i=function(){try{return top.document!==h&&top.document.title!==h?top:window}catch(a){return window}}(),n=i.document,y=i.history,j=i.location,ha=setInterval,q=setTimeout,T=/\/{2,9}/g;
-C=navigator.userAgent;var F="on"+K in i,k,J=c("script:last").attr("src"),Z=J?J.indexOf("?"):-1,P=n.title,w=m,aa=m,ca=t,N=m,e=s();_old=e;if(v){z=parseFloat(C.substr(C.indexOf("MSIE")+4));if(n.documentMode&&n.documentMode!=z)z=n.documentMode!=8?7:8;var da=n.onpropertychange;n.onpropertychange=function(){da&&da.call(n);if(n.title!=P&&n.title.indexOf("#"+s())!=-1)n.title=P}}if(y.navigationMode)y.navigationMode="compatible";if(document.readyState=="complete")var ja=setInterval(function(){if(c.address){ba();
-clearInterval(ja)}},50);else{$();c(ba)}c(window).bind("popstate",function(){if(decodeURI(e)!=decodeURI(s())){_old=e;e=s();G(m)}}).bind("unload",function(){if(i.removeEventListener)i.removeEventListener(K,H,m);else i.detachEvent&&i.detachEvent("on"+K,H)});return{bind:function(){return g.apply(this,p(arguments))},unbind:function(){return D.apply(this,p(arguments))},init:function(){return g.apply(this,["init"].concat(p(arguments)))},change:function(){return g.apply(this,[W].concat(p(arguments)))},internalChange:function(){return g.apply(this,
-[X].concat(p(arguments)))},externalChange:function(){return g.apply(this,[Y].concat(p(arguments)))},baseURL:function(){var a=j.href;if(a.indexOf("#")!=-1)a=a.substr(0,a.indexOf("#"));if(/\/$/.test(a))a=a.substr(0,a.length-1);return a},autoUpdate:function(a){if(a!==h){d.autoUpdate=a;return this}return d.autoUpdate},history:function(a){if(a!==h){d.history=a;return this}return d.history},state:function(a){if(a!==h){d.state=a;var b=U();if(d.state!==h)if(y.pushState)b.substr(0,3)=="/#/"&&j.replace(d.state.replace(/^\/$/,
-"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=L()&&q(function(){j.replace(d.state.replace(/^\/$/,"")+"/#"+b)},1);return this}return d.state},strict:function(a){if(a!==h){d.strict=a;return this}return d.strict},tracker:function(a){if(a!==h){d.tracker=a;return this}return d.tracker},wrap:function(a){if(a!==h){d.wrap=a;return this}return d.wrap},update:function(){N=t;this.value(e);N=m;return this},title:function(a){if(a!==h){q(function(){P=n.title=a;if(ca&&k&&k.contentWindow&&k.contentWindow.document){k.contentWindow.document.title=
-a;ca=m}},50);return this}return n.title},value:function(a){if(a!==h){a=O(a);if(a=="/")a="";if(e==a&&!N)return;_old=e;e=a;if(d.autoUpdate||N){G(t);if(E())y[d.history?"pushState":"replaceState"]({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=t;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=s())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!F&&d.history&&q(M,50);if(A)q(function(){w=m},1);else w=m}}return this}return O(e)},path:function(a){if(a!==h){var b=this.queryString(),
-f=this.hash();this.value(a+(b?"?"+b:"")+(f?"#"+f:""));return this}return O(e).split("#")[0].split("?")[0]},pathNames:function(){var a=this.path(),b=a.replace(T,"/").split("/");if(a.substr(0,1)=="/"||a.length===0)b.splice(0,1);a.substr(a.length-1,1)=="/"&&b.splice(b.length-1,1);return b},queryString:function(a){if(a!==h){var b=this.hash();this.value(this.path()+(a?"?"+a:"")+(b?"#"+b:""));return this}a=e.split("?");return a.slice(1,a.length).join("?").split("#")[0]},parameter:function(a,b,f){var l,
-o;if(b!==h){var Q=this.parameterNames();o=[];b=b===h||b===I?"":b.toString();for(l=0;l<Q.length;l++){var R=Q[l],x=this.parameter(R);if(typeof x=="string")x=[x];if(R==a)x=b===I||b===""?[]:f?x.concat([b]):[b];for(var S=0;S<x.length;S++)o.push(R+"="+x[S])}c.inArray(a,Q)==-1&&b!==I&&b!==""&&o.push(a+"="+b);this.queryString(o.join("&"));return this}if(b=this.queryString()){f=[];o=b.split("&");for(l=0;l<o.length;l++){b=o[l].split("=");b[0]==a&&f.push(b.slice(1).join("="))}if(f.length!==0)return f.length!=
-1?f:f[0]}},parameterNames:function(){var a=this.queryString(),b=[];if(a&&a.indexOf("=")!=-1){a=a.split("&");for(var f=0;f<a.length;f++){var l=a[f].split("=")[0];c.inArray(l,b)==-1&&b.push(l)}}return b},hash:function(a){if(a!==h){this.value(e.split("#")[0]+(a?"#"+a:""));return this}a=e.split("#");return a.slice(1,a.length).join("#")}}}();c.fn.address=function(r){var p;if(typeof r=="string"){p=r;r=undefined}c(this).attr("address")||c(document).on("click",p?p:this.selector,function(g){if(g.shiftKey||
-g.ctrlKey||g.metaKey||g.which==2)return true;if(c(g.target).is("a")){g.preventDefault();g=r?r.call(g.target):/address:/.test(c(g.target).attr("rel"))?c(g.target).attr("rel").split("address:")[1].split(" ")[0]:c.address.state()!==undefined&&!/^\/?$/.test(c.address.state())?c(g.target).attr("href").replace(new RegExp("^(.*"+c.address.state()+"|\\.)"),""):c(g.target).attr("href").replace(/^(#\!?|\.)/,"");c.address.value(g)}}).on("submit",p?p:this.selector,function(g){if(c(g.target).is("form")){g.preventDefault();
-var D=c(g.target).attr("action");g=r?r.call(g.target):(D.indexOf("?")!=-1?D.replace(/&$/,""):D+"?")+c(g.target).serialize();c.address.value(g)}}).attr("address",true);return this}})(jQuery);
+(function(c){c.address=function(){var t=function(a){a=c.extend(c.Event(a),function(){for(var b={},f=c.address.parameterNames(),o=0,s=f.length;o<s;o++)b[f[o]]=c.address.parameter(f[o]);return{value:c.address.value(),path:c.address.path(),pathNames:c.address.pathNames(),parameterNames:f,parameters:b,queryString:c.address.queryString()}}.call(c.address));c(c.address).trigger(a);return a},g=function(a){return Array.prototype.slice.call(a)},l=function(){c().bind.apply(c(c.address),Array.prototype.slice.call(arguments));
+return c.address},da=function(){c().unbind.apply(c(c.address),Array.prototype.slice.call(arguments));return c.address},D=function(){return y.pushState&&d.state!==h},T=function(){return("/"+j.pathname.replace(new RegExp(d.state),"")+j.search+(K()?"#"+K():"")).replace(S,"/")},K=function(){var a=j.href.indexOf("#");return a!=-1?j.href.substr(a+1):""},p=function(){return D()?T():K()},U=function(){return"javascript"},N=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},u=function(a,
+b){return parseInt(a.css(b),10)},G=function(){if(!w){var a=p();if(decodeURI(e)!=decodeURI(a))if(v&&z<7)j.reload();else{v&&!E&&d.history&&q(L,50);_old=e;e=a;F(m)}}},F=function(a){var b=t(V);a=t(a?W:X);q(ea,10);if(b.isDefaultPrevented()||a.isDefaultPrevented())fa()},fa=function(){e=_old;if(D())y.popState({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=r;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=p())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!E&&d.history&&q(L,50);
+if(A)q(function(){w=m},1);else w=m}},ea=function(){if(d.tracker!=="null"&&d.tracker!==H){var a=c.isFunction(d.tracker)?d.tracker:i[d.tracker],b=(j.pathname+j.search+(c.address&&!D()?c.address.value():"")).replace(/\/\//,"/").replace(/^\/$/,"");if(c.isFunction(a))a(b);else if(c.isFunction(i.urchinTracker))i.urchinTracker(b);else if(i.pageTracker!==h&&c.isFunction(i.pageTracker._trackPageview))i.pageTracker._trackPageview(b);else i._gaq!==h&&c.isFunction(i._gaq.push)&&i._gaq.push(["_trackPageview",
+decodeURI(b)])}},L=function(){var a=U()+":"+m+";document.open();document.writeln('<html><head><title>"+n.title.replace(/\'/g,"\\'")+"</title><script>var "+B+' = "'+encodeURIComponent(p()).replace(/\'/g,"\\'")+(n.domain!=j.hostname?'";document.domain="'+n.domain:"")+"\";<\/script></head></html>');document.close();";if(z<7)k.src=a;else k.contentWindow.location.replace(a)},Z=function(){if(I&&Y!=-1){var a,b,f=I.substr(Y+1).split("&");for(a=0;a<f.length;a++){b=f[a].split("=");if(/^(autoUpdate|history|strict|wrap)$/.test(b[0]))d[b[0]]=
+isNaN(b[1])?/^(true|yes)$/i.test(b[1]):parseInt(b[1],10)!==0;if(/^(state|tracker)$/.test(b[0]))d[b[0]]=b[1]}I=H}_old=e;e=p()},aa=function(){if(!$){$=r;Z();c('a[rel*="address:"]').address();if(d.wrap){var a=c("body");c("body > *").wrapAll('<div style="padding:'+(u(a,"marginTop")+u(a,"paddingTop"))+"px "+(u(a,"marginRight")+u(a,"paddingRight"))+"px "+(u(a,"marginBottom")+u(a,"paddingBottom"))+"px "+(u(a,"marginLeft")+u(a,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+B+'" style="height:100%;overflow:auto;position:relative;'+
+(A&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});A&&c('<style type="text/css" />').appendTo("head").text("#"+B+"::-webkit-resizer { background-color: #fff; }")}if(v&&!E){a=n.getElementsByTagName("frameset")[0];k=n.createElement((a?"":"i")+"frame");k.src=U()+":"+m;if(a){a.insertAdjacentElement("beforeEnd",k);a[a.cols?"cols":"rows"]+=",0";k.noResize=r;k.frameBorder=k.frameSpacing=0}else{k.style.display="none";k.style.width=
+k.style.height=0;k.tabIndex=-1;n.body.insertAdjacentElement("afterBegin",k)}q(function(){c(k).bind("load",function(){var b=k.contentWindow;_old=e;e=b[B]!==h?b[B]:"";if(e!=p()){F(m);j.hash=e}});k.contentWindow[B]===h&&L()},50)}q(function(){t("init");F(m)},1);if(!D())if(v&&z>7||!v&&E)if(i.addEventListener)i.addEventListener(J,G,m);else i.attachEvent&&i.attachEvent("on"+J,G);else ga(G,50);"state"in window.history&&c(window).trigger("popstate")}},ha=function(a){a=a.toLowerCase();a=/(chrome)[ \/]([\w.]+)/.exec(a)||
+/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},h,H=null,B="jQueryAddress",J="hashchange",V="change",W="internalChange",X="externalChange",r=true,m=false,d={autoUpdate:r,history:r,strict:r,wrap:m},C=function(){var a={},b=ha(navigator.userAgent);if(b.browser){a[b.browser]=true;a.version=b.version}if(a.chrome)a.webkit=true;else if(a.webkit)a.safari=
+true;return a}(),z=parseFloat(C.version),A=C.webkit||C.safari,v=!c.support.opacity,i=function(){try{return top.document!==h&&top.document.title!==h?top:window}catch(a){return window}}(),n=i.document,y=i.history,j=i.location,ga=setInterval,q=setTimeout,S=/\/{2,9}/g;C=navigator.userAgent;var E="on"+J in i,k,I=c("script:last").attr("src"),Y=I?I.indexOf("?"):-1,O=n.title,w=m,$=m,ba=r,M=m,e=p();_old=e;if(v){z=parseFloat(C.substr(C.indexOf("MSIE")+4));if(n.documentMode&&n.documentMode!=z)z=n.documentMode!=
+8?7:8;var ca=n.onpropertychange;n.onpropertychange=function(){ca&&ca.call(n);if(n.title!=O&&n.title.indexOf("#"+p())!=-1)n.title=O}}if(y.navigationMode)y.navigationMode="compatible";if(document.readyState=="complete")var ia=setInterval(function(){if(c.address){aa();clearInterval(ia)}},50);else{Z();c(aa)}c(window).bind("popstate",function(){if(decodeURI(e)!=decodeURI(p())){_old=e;e=p();F(m)}}).bind("unload",function(){if(i.removeEventListener)i.removeEventListener(J,G,m);else i.detachEvent&&i.detachEvent("on"+
+J,G)});return{bind:function(){return l.apply(this,g(arguments))},unbind:function(){return da.apply(this,g(arguments))},init:function(){return l.apply(this,["init"].concat(g(arguments)))},change:function(){return l.apply(this,[V].concat(g(arguments)))},internalChange:function(){return l.apply(this,[W].concat(g(arguments)))},externalChange:function(){return l.apply(this,[X].concat(g(arguments)))},baseURL:function(){var a=j.href;if(a.indexOf("#")!=-1)a=a.substr(0,a.indexOf("#"));if(/\/$/.test(a))a=a.substr(0,
+a.length-1);return a},autoUpdate:function(a){if(a!==h){d.autoUpdate=a;return this}return d.autoUpdate},history:function(a){if(a!==h){d.history=a;return this}return d.history},state:function(a){if(a!==h){d.state=a;var b=T();if(d.state!==h)if(y.pushState)b.substr(0,3)=="/#/"&&j.replace(d.state.replace(/^\/$/,"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=K()&&q(function(){j.replace(d.state.replace(/^\/$/,"")+"/#"+b)},1);return this}return d.state},strict:function(a){if(a!==h){d.strict=a;return this}return d.strict},
+tracker:function(a){if(a!==h){d.tracker=a;return this}return d.tracker},wrap:function(a){if(a!==h){d.wrap=a;return this}return d.wrap},update:function(){M=r;this.value(e);M=m;return this},title:function(a){if(a!==h){q(function(){O=n.title=a;if(ba&&k&&k.contentWindow&&k.contentWindow.document){k.contentWindow.document.title=a;ba=m}},50);return this}return n.title},value:function(a){if(a!==h){a=N(a);if(a=="/")a="";if(e==a&&!M)return;_old=e;e=a;if(d.autoUpdate||M){F(r);if(D())y[d.history?"pushState":
+"replaceState"]({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{w=r;if(A)if(d.history)j.hash="#"+e;else j.replace("#"+e);else if(e!=p())if(d.history)j.hash="#"+e;else j.replace("#"+e);v&&!E&&d.history&&q(L,50);if(A)q(function(){w=m},1);else w=m}}return this}return N(e)},path:function(a){if(a!==h){var b=this.queryString(),f=this.hash();this.value(a+(b?"?"+b:"")+(f?"#"+f:""));return this}return N(e).split("#")[0].split("?")[0]},pathNames:function(){var a=this.path(),b=a.replace(S,"/").split("/");
+if(a.substr(0,1)=="/"||a.length===0)b.splice(0,1);a.substr(a.length-1,1)=="/"&&b.splice(b.length-1,1);return b},queryString:function(a){if(a!==h){var b=this.hash();this.value(this.path()+(a?"?"+a:"")+(b?"#"+b:""));return this}a=e.split("?");return a.slice(1,a.length).join("?").split("#")[0]},parameter:function(a,b,f){var o,s;if(b!==h){var P=this.parameterNames();s=[];b=b===h||b===H?"":b.toString();for(o=0;o<P.length;o++){var Q=P[o],x=this.parameter(Q);if(typeof x=="string")x=[x];if(Q==a)x=b===H||
+b===""?[]:f?x.concat([b]):[b];for(var R=0;R<x.length;R++)s.push(Q+"="+x[R])}c.inArray(a,P)==-1&&b!==H&&b!==""&&s.push(a+"="+b);this.queryString(s.join("&"));return this}if(b=this.queryString()){f=[];s=b.split("&");for(o=