Browse files

Optimizes the header

  • Loading branch information...
1 parent 436af93 commit 60007ac94b581837c09e8924dccd94b9fdad129a @asual committed Jan 27, 2013
View
59 build.xml
@@ -41,54 +41,35 @@
<copy todir="${dist.dir}">
<fileset dir="${src.dir}"/>
</copy>
- <antcall target="process">
- <param name="file" value="${dist.dir}/${name}" />
- </antcall>
- <antcall target="compress">
- <param name="file" value="${dist.dir}/${name}-${version}.min.js" />
- </antcall>
- </target>
-
- <target name="validate">
- <java classpath="lib/js.jar"
- classname="org.mozilla.javascript.tools.shell.Main"
- failonerror="true" fork="true">
- <arg line="${lib.dir}/rhino.js ${file}.js" />
- </java>
- </target>
-
- <target name="process">
- <tstamp>
- <format property="timestamp" pattern="yyyy-MM-dd HH:mm:ss Z (EEE, dd MMM yyyy)" />
- </tstamp>
- <replaceregexp match="\$\{version\}" file="${file}.js">
+ <replaceregexp match="\$\{version\}" file="${dist.dir}/${name}.js">
<substitution expression="${version}"/>
</replaceregexp>
- <replaceregexp match="\$\{timestamp\}" file="${file}.js">
- <substitution expression="${timestamp}"/>
- </replaceregexp>
- <copy file="${file}.js" tofile="${file}-${version}.min.js" />
- <move file="${file}.js" tofile="${file}-${version}.js" />
- </target>
-
- <target name="compress">
- <java jar="${lib.dir}/compiler.jar"
- failonerror="true" fork="true">
- <arg line="--js=${file} --js_output_file=${file}.tmp" />
- </java>
- <concat destfile="${file}.lic">
- <filelist files="${file}" />
+ <move file="${dist.dir}/${name}.js" tofile="${dist.dir}/${name}-${version}.js" />
+ <concat destfile="${dist.dir}/${name}-${version}.lic">
+ <filelist files="${dist.dir}/${name}-${version}.js" />
<filterchain>
- <headfilter lines="10" />
+ <headfilter lines="1" />
</filterchain>
</concat>
- <concat destfile="${file}">
- <filelist files="${file}.lic,${file}.tmp" />
+ <java jar="${lib.dir}/compiler.jar"
+ failonerror="true" fork="true">
+ <arg line="--js=${dist.dir}/${name}-${version}.js --js_output_file=${dist.dir}/${name}-${version}.tmp" />
+ </java>
+ <concat destfile="${dist.dir}/${name}-${version}.min.js">
+ <filelist files="${dist.dir}/${name}-${version}.lic,${dist.dir}/${name}-${version}.tmp" />
</concat>
<delete>
- <filelist files="${file}.lic,${file}.tmp" />
+ <filelist files="${dist.dir}/${name}-${version}.lic,${dist.dir}/${name}-${version}.tmp" />
</delete>
</target>
+
+ <target name="validate">
+ <java classpath="lib/js.jar"
+ classname="org.mozilla.javascript.tools.shell.Main"
+ failonerror="true" fork="true">
+ <arg line="${lib.dir}/rhino.js ${file}.js" />
+ </java>
+ </target>
<target name="sample">
<delete>
View
49 samples/accordion/jquery.address-1.6.min.js
@@ -1,29 +1,20 @@
-/*
- * jQuery Address Plugin v1.6
- * http://www.asual.com/jquery/address/
- *
- * Copyright (c) 2009-2013 Rostislav Hristov
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Date: 2013-01-26 19:43:30 +0200 (Sat, 26 Jan 2013)
- */
-(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);
+/*! jQuery Address v1.6 | (c) 2009, 2013 Rostislav Hristov | jquery.org/license */
+(function(c){c.address=function(){var s=function(a){a=c.extend(c.Event(a),function(){for(var b={},f=c.address.parameterNames(),m=0,p=f.length;m<p;m++)b[f[m]]=c.address.parameter(f[m]);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)},k=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},G=function(){return A.pushState&&d.state!==h},T=function(){return("/"+n.pathname.replace(new RegExp(d.state),"")+n.search+(H()?"#"+H():"")).replace(S,"/")},H=function(){var a=n.href.indexOf("#");return a!=-1?n.href.substr(a+1):""},q=function(){return G()?T():H()},U=function(){return"javascript"},M=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},t=function(a,
+b){return parseInt(a.css(b),10)},C=function(){if(!I){var a=q();if(decodeURI(e)!=decodeURI(a))if(v&&x<7)n.reload();else{v&&!J&&d.history&&u(N,50);e=a;B(o)}}},B=function(a){u(ea,10);return s(V).isDefaultPrevented()||s(a?W:X).isDefaultPrevented()},ea=function(){if(d.tracker!=="null"&&d.tracker!==D){var a=c.isFunction(d.tracker)?d.tracker:i[d.tracker],b=(n.pathname+n.search+(c.address&&!G()?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)])}},N=function(){var a=U()+":"+o+";document.open();document.writeln('<html><head><title>"+l.title.replace(/\'/g,"\\'")+"</title><script>var "+y+' = "'+encodeURIComponent(q()).replace(/\'/g,"\\'")+(l.domain!=n.hostname?'";document.domain="'+l.domain:"")+"\";<\/script></head></html>');document.close();";if(x<7)j.src=
+a;else j.contentWindow.location.replace(a)},Z=function(){if(E&&Y!=-1){var a,b,f=E.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]}E=D}e=q()},aa=function(){if(!$){$=r;Z();c('a[rel*="address:"]').address();if(d.wrap){var a=c("body");c("body > *").wrapAll('<div style="padding:'+(t(a,"marginTop")+t(a,"paddingTop"))+"px "+
+(t(a,"marginRight")+t(a,"paddingRight"))+"px "+(t(a,"marginBottom")+t(a,"paddingBottom"))+"px "+(t(a,"marginLeft")+t(a,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+y+'" style="height:100%;overflow:auto;position:relative;'+(K&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});K&&c('<style type="text/css" />').appendTo("head").text("#"+y+"::-webkit-resizer { background-color: #fff; }")}if(v&&!J){a=l.getElementsByTagName("frameset")[0];
+j=l.createElement((a?"":"i")+"frame");j.src=U()+":"+o;if(a){a.insertAdjacentElement("beforeEnd",j);a[a.cols?"cols":"rows"]+=",0";j.noResize=r;j.frameBorder=j.frameSpacing=0}else{j.style.display="none";j.style.width=j.style.height=0;j.tabIndex=-1;l.body.insertAdjacentElement("afterBegin",j)}u(function(){c(j).bind("load",function(){var b=j.contentWindow;e=b[y]!==h?b[y]:"";if(e!=q()){B(o);n.hash=e}});j.contentWindow[y]===h&&N()},50)}u(function(){s("init");B(o)},1);if(!G())if(v&&x>7||!v&&J)if(i.addEventListener)i.addEventListener(F,
+C,o);else i.attachEvent&&i.attachEvent("on"+F,C);else fa(C,50);"state"in window.history&&c(window).trigger("popstate")}},ga=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,D=null,y="jQueryAddress",F="hashchange",V="change",W="internalChange",X="externalChange",
+r=true,o=false,d={autoUpdate:r,history:r,strict:r,wrap:o},z=function(){var a={},b=ga(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}(),x=parseFloat(z.version),K=z.webkit||z.safari,v=!c.support.opacity,i=function(){try{return top.document!==h&&top.document.title!==h?top:window}catch(a){return window}}(),l=i.document,A=i.history,n=i.location,fa=setInterval,u=setTimeout,S=/\/{2,9}/g;z=navigator.userAgent;var J=
+"on"+F in i,j,E=c("script:last").attr("src"),Y=E?E.indexOf("?"):-1,O=l.title,I=o,$=o,ba=r,L=o,e=q();if(v){x=parseFloat(z.substr(z.indexOf("MSIE")+4));if(l.documentMode&&l.documentMode!=x)x=l.documentMode!=8?7:8;var ca=l.onpropertychange;l.onpropertychange=function(){ca&&ca.call(l);if(l.title!=O&&l.title.indexOf("#"+q())!=-1)l.title=O}}if(A.navigationMode)A.navigationMode="compatible";if(document.readyState=="complete")var ha=setInterval(function(){if(c.address){aa();clearInterval(ha)}},50);else{Z();
+c(aa)}c(window).bind("popstate",function(){if(decodeURI(e)!=decodeURI(q())){e=q();B(o)}}).bind("unload",function(){if(i.removeEventListener)i.removeEventListener(F,C,o);else i.detachEvent&&i.detachEvent("on"+F,C)});return{bind:function(){return k.apply(this,g(arguments))},unbind:function(){return da.apply(this,g(arguments))},init:function(){return k.apply(this,["init"].concat(g(arguments)))},change:function(){return k.apply(this,[V].concat(g(arguments)))},internalChange:function(){return k.apply(this,
+[W].concat(g(arguments)))},externalChange:function(){return k.apply(this,[X].concat(g(arguments)))},baseURL:function(){var a=n.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(A.pushState)b.substr(0,3)=="/#/"&&n.replace(d.state.replace(/^\/$/,
+"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=H()&&u(function(){n.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(){L=r;this.value(e);L=o;return this},title:function(a){if(a!==h){u(function(){O=l.title=a;if(ba&&j&&j.contentWindow&&j.contentWindow.document){j.contentWindow.document.title=
+a;ba=o}},50);return this}return l.title},value:function(a){if(a!==h){a=M(a);if(a=="/")a="";if(e==a&&!L)return;e=a;if(d.autoUpdate||L){if(B(r))return this;if(G())A[d.history?"pushState":"replaceState"]({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{I=r;if(K)if(d.history)n.hash="#"+e;else n.replace("#"+e);else if(e!=q())if(d.history)n.hash="#"+e;else n.replace("#"+e);v&&!J&&d.history&&u(N,50);if(K)u(function(){I=o},1);else I=o}}return this}return M(e)},path:function(a){if(a!==h){var b=this.queryString(),
+f=this.hash();this.value(a+(b?"?"+b:"")+(f?"#"+f:""));return this}return M(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 m,
+p;if(b!==h){var P=this.parameterNames();p=[];b=b===h||b===D?"":b.toString();for(m=0;m<P.length;m++){var Q=P[m],w=this.parameter(Q);if(typeof w=="string")w=[w];if(Q==a)w=b===D||b===""?[]:f?w.concat([b]):[b];for(var R=0;R<w.length;R++)p.push(Q+"="+w[R])}c.inArray(a,P)==-1&&b!==D&&b!==""&&p.push(a+"="+b);this.queryString(p.join("&"));return this}if(b=this.queryString()){f=[];p=b.split("&");for(m=0;m<p.length;m++){b=p[m].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 m=a[f].split("=")[0];c.inArray(m,b)==-1&&b.push(m)}}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(s){this.data("address")||this.on("click",function(g){if(g.shiftKey||g.ctrlKey||g.metaKey||g.which==2)return true;var k=g.currentTarget;if(c(k).is("a")){g.preventDefault();
+g=s?s.call(k):/address:/.test(c(k).attr("rel"))?c(k).attr("rel").split("address:")[1].split(" ")[0]:c.address.state()!==undefined&&!/^\/?$/.test(c.address.state())?c(k).attr("href").replace(new RegExp("^(.*"+c.address.state()+"|\\.)"),""):c(k).attr("href").replace(/^(#\!?|\.)/,"");c.address.value(g)}}).on("submit",function(g){var k=g.currentTarget;if(c(k).is("form")){g.preventDefault();g=c(k).attr("action");k=s?s.call(k):(g.indexOf("?")!=-1?g.replace(/&$/,""):g+"?")+c(k).serialize();c.address.value(k)}}).data("address",
+true);return this}})(jQuery);
View
49 samples/api/jquery.address-1.6.min.js
@@ -1,29 +1,20 @@
-/*
- * jQuery Address Plugin v1.6
- * http://www.asual.com/jquery/address/
- *
- * Copyright (c) 2009-2013 Rostislav Hristov
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Date: 2013-01-26 19:43:30 +0200 (Sat, 26 Jan 2013)
- */
-(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);
+/*! jQuery Address v1.6 | (c) 2009, 2013 Rostislav Hristov | jquery.org/license */
+(function(c){c.address=function(){var s=function(a){a=c.extend(c.Event(a),function(){for(var b={},f=c.address.parameterNames(),m=0,p=f.length;m<p;m++)b[f[m]]=c.address.parameter(f[m]);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)},k=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},G=function(){return A.pushState&&d.state!==h},T=function(){return("/"+n.pathname.replace(new RegExp(d.state),"")+n.search+(H()?"#"+H():"")).replace(S,"/")},H=function(){var a=n.href.indexOf("#");return a!=-1?n.href.substr(a+1):""},q=function(){return G()?T():H()},U=function(){return"javascript"},M=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},t=function(a,
+b){return parseInt(a.css(b),10)},C=function(){if(!I){var a=q();if(decodeURI(e)!=decodeURI(a))if(v&&x<7)n.reload();else{v&&!J&&d.history&&u(N,50);e=a;B(o)}}},B=function(a){u(ea,10);return s(V).isDefaultPrevented()||s(a?W:X).isDefaultPrevented()},ea=function(){if(d.tracker!=="null"&&d.tracker!==D){var a=c.isFunction(d.tracker)?d.tracker:i[d.tracker],b=(n.pathname+n.search+(c.address&&!G()?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)])}},N=function(){var a=U()+":"+o+";document.open();document.writeln('<html><head><title>"+l.title.replace(/\'/g,"\\'")+"</title><script>var "+y+' = "'+encodeURIComponent(q()).replace(/\'/g,"\\'")+(l.domain!=n.hostname?'";document.domain="'+l.domain:"")+"\";<\/script></head></html>');document.close();";if(x<7)j.src=
+a;else j.contentWindow.location.replace(a)},Z=function(){if(E&&Y!=-1){var a,b,f=E.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]}E=D}e=q()},aa=function(){if(!$){$=r;Z();c('a[rel*="address:"]').address();if(d.wrap){var a=c("body");c("body > *").wrapAll('<div style="padding:'+(t(a,"marginTop")+t(a,"paddingTop"))+"px "+
+(t(a,"marginRight")+t(a,"paddingRight"))+"px "+(t(a,"marginBottom")+t(a,"paddingBottom"))+"px "+(t(a,"marginLeft")+t(a,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+y+'" style="height:100%;overflow:auto;position:relative;'+(K&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});K&&c('<style type="text/css" />').appendTo("head").text("#"+y+"::-webkit-resizer { background-color: #fff; }")}if(v&&!J){a=l.getElementsByTagName("frameset")[0];
+j=l.createElement((a?"":"i")+"frame");j.src=U()+":"+o;if(a){a.insertAdjacentElement("beforeEnd",j);a[a.cols?"cols":"rows"]+=",0";j.noResize=r;j.frameBorder=j.frameSpacing=0}else{j.style.display="none";j.style.width=j.style.height=0;j.tabIndex=-1;l.body.insertAdjacentElement("afterBegin",j)}u(function(){c(j).bind("load",function(){var b=j.contentWindow;e=b[y]!==h?b[y]:"";if(e!=q()){B(o);n.hash=e}});j.contentWindow[y]===h&&N()},50)}u(function(){s("init");B(o)},1);if(!G())if(v&&x>7||!v&&J)if(i.addEventListener)i.addEventListener(F,
+C,o);else i.attachEvent&&i.attachEvent("on"+F,C);else fa(C,50);"state"in window.history&&c(window).trigger("popstate")}},ga=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,D=null,y="jQueryAddress",F="hashchange",V="change",W="internalChange",X="externalChange",
+r=true,o=false,d={autoUpdate:r,history:r,strict:r,wrap:o},z=function(){var a={},b=ga(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}(),x=parseFloat(z.version),K=z.webkit||z.safari,v=!c.support.opacity,i=function(){try{return top.document!==h&&top.document.title!==h?top:window}catch(a){return window}}(),l=i.document,A=i.history,n=i.location,fa=setInterval,u=setTimeout,S=/\/{2,9}/g;z=navigator.userAgent;var J=
+"on"+F in i,j,E=c("script:last").attr("src"),Y=E?E.indexOf("?"):-1,O=l.title,I=o,$=o,ba=r,L=o,e=q();if(v){x=parseFloat(z.substr(z.indexOf("MSIE")+4));if(l.documentMode&&l.documentMode!=x)x=l.documentMode!=8?7:8;var ca=l.onpropertychange;l.onpropertychange=function(){ca&&ca.call(l);if(l.title!=O&&l.title.indexOf("#"+q())!=-1)l.title=O}}if(A.navigationMode)A.navigationMode="compatible";if(document.readyState=="complete")var ha=setInterval(function(){if(c.address){aa();clearInterval(ha)}},50);else{Z();
+c(aa)}c(window).bind("popstate",function(){if(decodeURI(e)!=decodeURI(q())){e=q();B(o)}}).bind("unload",function(){if(i.removeEventListener)i.removeEventListener(F,C,o);else i.detachEvent&&i.detachEvent("on"+F,C)});return{bind:function(){return k.apply(this,g(arguments))},unbind:function(){return da.apply(this,g(arguments))},init:function(){return k.apply(this,["init"].concat(g(arguments)))},change:function(){return k.apply(this,[V].concat(g(arguments)))},internalChange:function(){return k.apply(this,
+[W].concat(g(arguments)))},externalChange:function(){return k.apply(this,[X].concat(g(arguments)))},baseURL:function(){var a=n.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(A.pushState)b.substr(0,3)=="/#/"&&n.replace(d.state.replace(/^\/$/,
+"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=H()&&u(function(){n.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(){L=r;this.value(e);L=o;return this},title:function(a){if(a!==h){u(function(){O=l.title=a;if(ba&&j&&j.contentWindow&&j.contentWindow.document){j.contentWindow.document.title=
+a;ba=o}},50);return this}return l.title},value:function(a){if(a!==h){a=M(a);if(a=="/")a="";if(e==a&&!L)return;e=a;if(d.autoUpdate||L){if(B(r))return this;if(G())A[d.history?"pushState":"replaceState"]({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{I=r;if(K)if(d.history)n.hash="#"+e;else n.replace("#"+e);else if(e!=q())if(d.history)n.hash="#"+e;else n.replace("#"+e);v&&!J&&d.history&&u(N,50);if(K)u(function(){I=o},1);else I=o}}return this}return M(e)},path:function(a){if(a!==h){var b=this.queryString(),
+f=this.hash();this.value(a+(b?"?"+b:"")+(f?"#"+f:""));return this}return M(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 m,
+p;if(b!==h){var P=this.parameterNames();p=[];b=b===h||b===D?"":b.toString();for(m=0;m<P.length;m++){var Q=P[m],w=this.parameter(Q);if(typeof w=="string")w=[w];if(Q==a)w=b===D||b===""?[]:f?w.concat([b]):[b];for(var R=0;R<w.length;R++)p.push(Q+"="+w[R])}c.inArray(a,P)==-1&&b!==D&&b!==""&&p.push(a+"="+b);this.queryString(p.join("&"));return this}if(b=this.queryString()){f=[];p=b.split("&");for(m=0;m<p.length;m++){b=p[m].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 m=a[f].split("=")[0];c.inArray(m,b)==-1&&b.push(m)}}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(s){this.data("address")||this.on("click",function(g){if(g.shiftKey||g.ctrlKey||g.metaKey||g.which==2)return true;var k=g.currentTarget;if(c(k).is("a")){g.preventDefault();
+g=s?s.call(k):/address:/.test(c(k).attr("rel"))?c(k).attr("rel").split("address:")[1].split(" ")[0]:c.address.state()!==undefined&&!/^\/?$/.test(c.address.state())?c(k).attr("href").replace(new RegExp("^(.*"+c.address.state()+"|\\.)"),""):c(k).attr("href").replace(/^(#\!?|\.)/,"");c.address.value(g)}}).on("submit",function(g){var k=g.currentTarget;if(c(k).is("form")){g.preventDefault();g=c(k).attr("action");k=s?s.call(k):(g.indexOf("?")!=-1?g.replace(/&$/,""):g+"?")+c(k).serialize();c.address.value(k)}}).data("address",
+true);return this}})(jQuery);
View
49 samples/events/jquery.address-1.6.min.js
@@ -1,29 +1,20 @@
-/*
- * jQuery Address Plugin v1.6
- * http://www.asual.com/jquery/address/
- *
- * Copyright (c) 2009-2013 Rostislav Hristov
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Date: 2013-01-26 19:43:30 +0200 (Sat, 26 Jan 2013)
- */
-(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);
+/*! jQuery Address v1.6 | (c) 2009, 2013 Rostislav Hristov | jquery.org/license */
+(function(c){c.address=function(){var s=function(a){a=c.extend(c.Event(a),function(){for(var b={},f=c.address.parameterNames(),m=0,p=f.length;m<p;m++)b[f[m]]=c.address.parameter(f[m]);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)},k=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},G=function(){return A.pushState&&d.state!==h},T=function(){return("/"+n.pathname.replace(new RegExp(d.state),"")+n.search+(H()?"#"+H():"")).replace(S,"/")},H=function(){var a=n.href.indexOf("#");return a!=-1?n.href.substr(a+1):""},q=function(){return G()?T():H()},U=function(){return"javascript"},M=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},t=function(a,
+b){return parseInt(a.css(b),10)},C=function(){if(!I){var a=q();if(decodeURI(e)!=decodeURI(a))if(v&&x<7)n.reload();else{v&&!J&&d.history&&u(N,50);e=a;B(o)}}},B=function(a){u(ea,10);return s(V).isDefaultPrevented()||s(a?W:X).isDefaultPrevented()},ea=function(){if(d.tracker!=="null"&&d.tracker!==D){var a=c.isFunction(d.tracker)?d.tracker:i[d.tracker],b=(n.pathname+n.search+(c.address&&!G()?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)])}},N=function(){var a=U()+":"+o+";document.open();document.writeln('<html><head><title>"+l.title.replace(/\'/g,"\\'")+"</title><script>var "+y+' = "'+encodeURIComponent(q()).replace(/\'/g,"\\'")+(l.domain!=n.hostname?'";document.domain="'+l.domain:"")+"\";<\/script></head></html>');document.close();";if(x<7)j.src=
+a;else j.contentWindow.location.replace(a)},Z=function(){if(E&&Y!=-1){var a,b,f=E.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]}E=D}e=q()},aa=function(){if(!$){$=r;Z();c('a[rel*="address:"]').address();if(d.wrap){var a=c("body");c("body > *").wrapAll('<div style="padding:'+(t(a,"marginTop")+t(a,"paddingTop"))+"px "+
+(t(a,"marginRight")+t(a,"paddingRight"))+"px "+(t(a,"marginBottom")+t(a,"paddingBottom"))+"px "+(t(a,"marginLeft")+t(a,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+y+'" style="height:100%;overflow:auto;position:relative;'+(K&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});K&&c('<style type="text/css" />').appendTo("head").text("#"+y+"::-webkit-resizer { background-color: #fff; }")}if(v&&!J){a=l.getElementsByTagName("frameset")[0];
+j=l.createElement((a?"":"i")+"frame");j.src=U()+":"+o;if(a){a.insertAdjacentElement("beforeEnd",j);a[a.cols?"cols":"rows"]+=",0";j.noResize=r;j.frameBorder=j.frameSpacing=0}else{j.style.display="none";j.style.width=j.style.height=0;j.tabIndex=-1;l.body.insertAdjacentElement("afterBegin",j)}u(function(){c(j).bind("load",function(){var b=j.contentWindow;e=b[y]!==h?b[y]:"";if(e!=q()){B(o);n.hash=e}});j.contentWindow[y]===h&&N()},50)}u(function(){s("init");B(o)},1);if(!G())if(v&&x>7||!v&&J)if(i.addEventListener)i.addEventListener(F,
+C,o);else i.attachEvent&&i.attachEvent("on"+F,C);else fa(C,50);"state"in window.history&&c(window).trigger("popstate")}},ga=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,D=null,y="jQueryAddress",F="hashchange",V="change",W="internalChange",X="externalChange",
+r=true,o=false,d={autoUpdate:r,history:r,strict:r,wrap:o},z=function(){var a={},b=ga(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}(),x=parseFloat(z.version),K=z.webkit||z.safari,v=!c.support.opacity,i=function(){try{return top.document!==h&&top.document.title!==h?top:window}catch(a){return window}}(),l=i.document,A=i.history,n=i.location,fa=setInterval,u=setTimeout,S=/\/{2,9}/g;z=navigator.userAgent;var J=
+"on"+F in i,j,E=c("script:last").attr("src"),Y=E?E.indexOf("?"):-1,O=l.title,I=o,$=o,ba=r,L=o,e=q();if(v){x=parseFloat(z.substr(z.indexOf("MSIE")+4));if(l.documentMode&&l.documentMode!=x)x=l.documentMode!=8?7:8;var ca=l.onpropertychange;l.onpropertychange=function(){ca&&ca.call(l);if(l.title!=O&&l.title.indexOf("#"+q())!=-1)l.title=O}}if(A.navigationMode)A.navigationMode="compatible";if(document.readyState=="complete")var ha=setInterval(function(){if(c.address){aa();clearInterval(ha)}},50);else{Z();
+c(aa)}c(window).bind("popstate",function(){if(decodeURI(e)!=decodeURI(q())){e=q();B(o)}}).bind("unload",function(){if(i.removeEventListener)i.removeEventListener(F,C,o);else i.detachEvent&&i.detachEvent("on"+F,C)});return{bind:function(){return k.apply(this,g(arguments))},unbind:function(){return da.apply(this,g(arguments))},init:function(){return k.apply(this,["init"].concat(g(arguments)))},change:function(){return k.apply(this,[V].concat(g(arguments)))},internalChange:function(){return k.apply(this,
+[W].concat(g(arguments)))},externalChange:function(){return k.apply(this,[X].concat(g(arguments)))},baseURL:function(){var a=n.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(A.pushState)b.substr(0,3)=="/#/"&&n.replace(d.state.replace(/^\/$/,
+"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=H()&&u(function(){n.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(){L=r;this.value(e);L=o;return this},title:function(a){if(a!==h){u(function(){O=l.title=a;if(ba&&j&&j.contentWindow&&j.contentWindow.document){j.contentWindow.document.title=
+a;ba=o}},50);return this}return l.title},value:function(a){if(a!==h){a=M(a);if(a=="/")a="";if(e==a&&!L)return;e=a;if(d.autoUpdate||L){if(B(r))return this;if(G())A[d.history?"pushState":"replaceState"]({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{I=r;if(K)if(d.history)n.hash="#"+e;else n.replace("#"+e);else if(e!=q())if(d.history)n.hash="#"+e;else n.replace("#"+e);v&&!J&&d.history&&u(N,50);if(K)u(function(){I=o},1);else I=o}}return this}return M(e)},path:function(a){if(a!==h){var b=this.queryString(),
+f=this.hash();this.value(a+(b?"?"+b:"")+(f?"#"+f:""));return this}return M(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 m,
+p;if(b!==h){var P=this.parameterNames();p=[];b=b===h||b===D?"":b.toString();for(m=0;m<P.length;m++){var Q=P[m],w=this.parameter(Q);if(typeof w=="string")w=[w];if(Q==a)w=b===D||b===""?[]:f?w.concat([b]):[b];for(var R=0;R<w.length;R++)p.push(Q+"="+w[R])}c.inArray(a,P)==-1&&b!==D&&b!==""&&p.push(a+"="+b);this.queryString(p.join("&"));return this}if(b=this.queryString()){f=[];p=b.split("&");for(m=0;m<p.length;m++){b=p[m].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 m=a[f].split("=")[0];c.inArray(m,b)==-1&&b.push(m)}}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(s){this.data("address")||this.on("click",function(g){if(g.shiftKey||g.ctrlKey||g.metaKey||g.which==2)return true;var k=g.currentTarget;if(c(k).is("a")){g.preventDefault();
+g=s?s.call(k):/address:/.test(c(k).attr("rel"))?c(k).attr("rel").split("address:")[1].split(" ")[0]:c.address.state()!==undefined&&!/^\/?$/.test(c.address.state())?c(k).attr("href").replace(new RegExp("^(.*"+c.address.state()+"|\\.)"),""):c(k).attr("href").replace(/^(#\!?|\.)/,"");c.address.value(g)}}).on("submit",function(g){var k=g.currentTarget;if(c(k).is("form")){g.preventDefault();g=c(k).attr("action");k=s?s.call(k):(g.indexOf("?")!=-1?g.replace(/&$/,""):g+"?")+c(k).serialize();c.address.value(k)}}).data("address",
+true);return this}})(jQuery);
View
49 samples/express/public/jquery.address-1.6.min.js
@@ -1,29 +1,20 @@
-/*
- * jQuery Address Plugin v1.6
- * http://www.asual.com/jquery/address/
- *
- * Copyright (c) 2009-2013 Rostislav Hristov
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Date: 2013-01-26 19:43:30 +0200 (Sat, 26 Jan 2013)
- */
-(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);
+/*! jQuery Address v1.6 | (c) 2009, 2013 Rostislav Hristov | jquery.org/license */
+(function(c){c.address=function(){var s=function(a){a=c.extend(c.Event(a),function(){for(var b={},f=c.address.parameterNames(),m=0,p=f.length;m<p;m++)b[f[m]]=c.address.parameter(f[m]);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)},k=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},G=function(){return A.pushState&&d.state!==h},T=function(){return("/"+n.pathname.replace(new RegExp(d.state),"")+n.search+(H()?"#"+H():"")).replace(S,"/")},H=function(){var a=n.href.indexOf("#");return a!=-1?n.href.substr(a+1):""},q=function(){return G()?T():H()},U=function(){return"javascript"},M=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},t=function(a,
+b){return parseInt(a.css(b),10)},C=function(){if(!I){var a=q();if(decodeURI(e)!=decodeURI(a))if(v&&x<7)n.reload();else{v&&!J&&d.history&&u(N,50);e=a;B(o)}}},B=function(a){u(ea,10);return s(V).isDefaultPrevented()||s(a?W:X).isDefaultPrevented()},ea=function(){if(d.tracker!=="null"&&d.tracker!==D){var a=c.isFunction(d.tracker)?d.tracker:i[d.tracker],b=(n.pathname+n.search+(c.address&&!G()?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)])}},N=function(){var a=U()+":"+o+";document.open();document.writeln('<html><head><title>"+l.title.replace(/\'/g,"\\'")+"</title><script>var "+y+' = "'+encodeURIComponent(q()).replace(/\'/g,"\\'")+(l.domain!=n.hostname?'";document.domain="'+l.domain:"")+"\";<\/script></head></html>');document.close();";if(x<7)j.src=
+a;else j.contentWindow.location.replace(a)},Z=function(){if(E&&Y!=-1){var a,b,f=E.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]}E=D}e=q()},aa=function(){if(!$){$=r;Z();c('a[rel*="address:"]').address();if(d.wrap){var a=c("body");c("body > *").wrapAll('<div style="padding:'+(t(a,"marginTop")+t(a,"paddingTop"))+"px "+
+(t(a,"marginRight")+t(a,"paddingRight"))+"px "+(t(a,"marginBottom")+t(a,"paddingBottom"))+"px "+(t(a,"marginLeft")+t(a,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+y+'" style="height:100%;overflow:auto;position:relative;'+(K&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});K&&c('<style type="text/css" />').appendTo("head").text("#"+y+"::-webkit-resizer { background-color: #fff; }")}if(v&&!J){a=l.getElementsByTagName("frameset")[0];
+j=l.createElement((a?"":"i")+"frame");j.src=U()+":"+o;if(a){a.insertAdjacentElement("beforeEnd",j);a[a.cols?"cols":"rows"]+=",0";j.noResize=r;j.frameBorder=j.frameSpacing=0}else{j.style.display="none";j.style.width=j.style.height=0;j.tabIndex=-1;l.body.insertAdjacentElement("afterBegin",j)}u(function(){c(j).bind("load",function(){var b=j.contentWindow;e=b[y]!==h?b[y]:"";if(e!=q()){B(o);n.hash=e}});j.contentWindow[y]===h&&N()},50)}u(function(){s("init");B(o)},1);if(!G())if(v&&x>7||!v&&J)if(i.addEventListener)i.addEventListener(F,
+C,o);else i.attachEvent&&i.attachEvent("on"+F,C);else fa(C,50);"state"in window.history&&c(window).trigger("popstate")}},ga=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,D=null,y="jQueryAddress",F="hashchange",V="change",W="internalChange",X="externalChange",
+r=true,o=false,d={autoUpdate:r,history:r,strict:r,wrap:o},z=function(){var a={},b=ga(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}(),x=parseFloat(z.version),K=z.webkit||z.safari,v=!c.support.opacity,i=function(){try{return top.document!==h&&top.document.title!==h?top:window}catch(a){return window}}(),l=i.document,A=i.history,n=i.location,fa=setInterval,u=setTimeout,S=/\/{2,9}/g;z=navigator.userAgent;var J=
+"on"+F in i,j,E=c("script:last").attr("src"),Y=E?E.indexOf("?"):-1,O=l.title,I=o,$=o,ba=r,L=o,e=q();if(v){x=parseFloat(z.substr(z.indexOf("MSIE")+4));if(l.documentMode&&l.documentMode!=x)x=l.documentMode!=8?7:8;var ca=l.onpropertychange;l.onpropertychange=function(){ca&&ca.call(l);if(l.title!=O&&l.title.indexOf("#"+q())!=-1)l.title=O}}if(A.navigationMode)A.navigationMode="compatible";if(document.readyState=="complete")var ha=setInterval(function(){if(c.address){aa();clearInterval(ha)}},50);else{Z();
+c(aa)}c(window).bind("popstate",function(){if(decodeURI(e)!=decodeURI(q())){e=q();B(o)}}).bind("unload",function(){if(i.removeEventListener)i.removeEventListener(F,C,o);else i.detachEvent&&i.detachEvent("on"+F,C)});return{bind:function(){return k.apply(this,g(arguments))},unbind:function(){return da.apply(this,g(arguments))},init:function(){return k.apply(this,["init"].concat(g(arguments)))},change:function(){return k.apply(this,[V].concat(g(arguments)))},internalChange:function(){return k.apply(this,
+[W].concat(g(arguments)))},externalChange:function(){return k.apply(this,[X].concat(g(arguments)))},baseURL:function(){var a=n.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(A.pushState)b.substr(0,3)=="/#/"&&n.replace(d.state.replace(/^\/$/,
+"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=H()&&u(function(){n.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(){L=r;this.value(e);L=o;return this},title:function(a){if(a!==h){u(function(){O=l.title=a;if(ba&&j&&j.contentWindow&&j.contentWindow.document){j.contentWindow.document.title=
+a;ba=o}},50);return this}return l.title},value:function(a){if(a!==h){a=M(a);if(a=="/")a="";if(e==a&&!L)return;e=a;if(d.autoUpdate||L){if(B(r))return this;if(G())A[d.history?"pushState":"replaceState"]({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{I=r;if(K)if(d.history)n.hash="#"+e;else n.replace("#"+e);else if(e!=q())if(d.history)n.hash="#"+e;else n.replace("#"+e);v&&!J&&d.history&&u(N,50);if(K)u(function(){I=o},1);else I=o}}return this}return M(e)},path:function(a){if(a!==h){var b=this.queryString(),
+f=this.hash();this.value(a+(b?"?"+b:"")+(f?"#"+f:""));return this}return M(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 m,
+p;if(b!==h){var P=this.parameterNames();p=[];b=b===h||b===D?"":b.toString();for(m=0;m<P.length;m++){var Q=P[m],w=this.parameter(Q);if(typeof w=="string")w=[w];if(Q==a)w=b===D||b===""?[]:f?w.concat([b]):[b];for(var R=0;R<w.length;R++)p.push(Q+"="+w[R])}c.inArray(a,P)==-1&&b!==D&&b!==""&&p.push(a+"="+b);this.queryString(p.join("&"));return this}if(b=this.queryString()){f=[];p=b.split("&");for(m=0;m<p.length;m++){b=p[m].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 m=a[f].split("=")[0];c.inArray(m,b)==-1&&b.push(m)}}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(s){this.data("address")||this.on("click",function(g){if(g.shiftKey||g.ctrlKey||g.metaKey||g.which==2)return true;var k=g.currentTarget;if(c(k).is("a")){g.preventDefault();
+g=s?s.call(k):/address:/.test(c(k).attr("rel"))?c(k).attr("rel").split("address:")[1].split(" ")[0]:c.address.state()!==undefined&&!/^\/?$/.test(c.address.state())?c(k).attr("href").replace(new RegExp("^(.*"+c.address.state()+"|\\.)"),""):c(k).attr("href").replace(/^(#\!?|\.)/,"");c.address.value(g)}}).on("submit",function(g){var k=g.currentTarget;if(c(k).is("form")){g.preventDefault();g=c(k).attr("action");k=s?s.call(k):(g.indexOf("?")!=-1?g.replace(/&$/,""):g+"?")+c(k).serialize();c.address.value(k)}}).data("address",
+true);return this}})(jQuery);
View
49 samples/form/jquery.address-1.6.min.js
@@ -1,29 +1,20 @@
-/*
- * jQuery Address Plugin v1.6
- * http://www.asual.com/jquery/address/
- *
- * Copyright (c) 2009-2013 Rostislav Hristov
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Date: 2013-01-26 19:43:30 +0200 (Sat, 26 Jan 2013)
- */
-(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);
+/*! jQuery Address v1.6 | (c) 2009, 2013 Rostislav Hristov | jquery.org/license */
+(function(c){c.address=function(){var s=function(a){a=c.extend(c.Event(a),function(){for(var b={},f=c.address.parameterNames(),m=0,p=f.length;m<p;m++)b[f[m]]=c.address.parameter(f[m]);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)},k=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},G=function(){return A.pushState&&d.state!==h},T=function(){return("/"+n.pathname.replace(new RegExp(d.state),"")+n.search+(H()?"#"+H():"")).replace(S,"/")},H=function(){var a=n.href.indexOf("#");return a!=-1?n.href.substr(a+1):""},q=function(){return G()?T():H()},U=function(){return"javascript"},M=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},t=function(a,
+b){return parseInt(a.css(b),10)},C=function(){if(!I){var a=q();if(decodeURI(e)!=decodeURI(a))if(v&&x<7)n.reload();else{v&&!J&&d.history&&u(N,50);e=a;B(o)}}},B=function(a){u(ea,10);return s(V).isDefaultPrevented()||s(a?W:X).isDefaultPrevented()},ea=function(){if(d.tracker!=="null"&&d.tracker!==D){var a=c.isFunction(d.tracker)?d.tracker:i[d.tracker],b=(n.pathname+n.search+(c.address&&!G()?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)])}},N=function(){var a=U()+":"+o+";document.open();document.writeln('<html><head><title>"+l.title.replace(/\'/g,"\\'")+"</title><script>var "+y+' = "'+encodeURIComponent(q()).replace(/\'/g,"\\'")+(l.domain!=n.hostname?'";document.domain="'+l.domain:"")+"\";<\/script></head></html>');document.close();";if(x<7)j.src=
+a;else j.contentWindow.location.replace(a)},Z=function(){if(E&&Y!=-1){var a,b,f=E.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]}E=D}e=q()},aa=function(){if(!$){$=r;Z();c('a[rel*="address:"]').address();if(d.wrap){var a=c("body");c("body > *").wrapAll('<div style="padding:'+(t(a,"marginTop")+t(a,"paddingTop"))+"px "+
+(t(a,"marginRight")+t(a,"paddingRight"))+"px "+(t(a,"marginBottom")+t(a,"paddingBottom"))+"px "+(t(a,"marginLeft")+t(a,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+y+'" style="height:100%;overflow:auto;position:relative;'+(K&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});K&&c('<style type="text/css" />').appendTo("head").text("#"+y+"::-webkit-resizer { background-color: #fff; }")}if(v&&!J){a=l.getElementsByTagName("frameset")[0];
+j=l.createElement((a?"":"i")+"frame");j.src=U()+":"+o;if(a){a.insertAdjacentElement("beforeEnd",j);a[a.cols?"cols":"rows"]+=",0";j.noResize=r;j.frameBorder=j.frameSpacing=0}else{j.style.display="none";j.style.width=j.style.height=0;j.tabIndex=-1;l.body.insertAdjacentElement("afterBegin",j)}u(function(){c(j).bind("load",function(){var b=j.contentWindow;e=b[y]!==h?b[y]:"";if(e!=q()){B(o);n.hash=e}});j.contentWindow[y]===h&&N()},50)}u(function(){s("init");B(o)},1);if(!G())if(v&&x>7||!v&&J)if(i.addEventListener)i.addEventListener(F,
+C,o);else i.attachEvent&&i.attachEvent("on"+F,C);else fa(C,50);"state"in window.history&&c(window).trigger("popstate")}},ga=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,D=null,y="jQueryAddress",F="hashchange",V="change",W="internalChange",X="externalChange",
+r=true,o=false,d={autoUpdate:r,history:r,strict:r,wrap:o},z=function(){var a={},b=ga(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}(),x=parseFloat(z.version),K=z.webkit||z.safari,v=!c.support.opacity,i=function(){try{return top.document!==h&&top.document.title!==h?top:window}catch(a){return window}}(),l=i.document,A=i.history,n=i.location,fa=setInterval,u=setTimeout,S=/\/{2,9}/g;z=navigator.userAgent;var J=
+"on"+F in i,j,E=c("script:last").attr("src"),Y=E?E.indexOf("?"):-1,O=l.title,I=o,$=o,ba=r,L=o,e=q();if(v){x=parseFloat(z.substr(z.indexOf("MSIE")+4));if(l.documentMode&&l.documentMode!=x)x=l.documentMode!=8?7:8;var ca=l.onpropertychange;l.onpropertychange=function(){ca&&ca.call(l);if(l.title!=O&&l.title.indexOf("#"+q())!=-1)l.title=O}}if(A.navigationMode)A.navigationMode="compatible";if(document.readyState=="complete")var ha=setInterval(function(){if(c.address){aa();clearInterval(ha)}},50);else{Z();
+c(aa)}c(window).bind("popstate",function(){if(decodeURI(e)!=decodeURI(q())){e=q();B(o)}}).bind("unload",function(){if(i.removeEventListener)i.removeEventListener(F,C,o);else i.detachEvent&&i.detachEvent("on"+F,C)});return{bind:function(){return k.apply(this,g(arguments))},unbind:function(){return da.apply(this,g(arguments))},init:function(){return k.apply(this,["init"].concat(g(arguments)))},change:function(){return k.apply(this,[V].concat(g(arguments)))},internalChange:function(){return k.apply(this,
+[W].concat(g(arguments)))},externalChange:function(){return k.apply(this,[X].concat(g(arguments)))},baseURL:function(){var a=n.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(A.pushState)b.substr(0,3)=="/#/"&&n.replace(d.state.replace(/^\/$/,
+"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=H()&&u(function(){n.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(){L=r;this.value(e);L=o;return this},title:function(a){if(a!==h){u(function(){O=l.title=a;if(ba&&j&&j.contentWindow&&j.contentWindow.document){j.contentWindow.document.title=
+a;ba=o}},50);return this}return l.title},value:function(a){if(a!==h){a=M(a);if(a=="/")a="";if(e==a&&!L)return;e=a;if(d.autoUpdate||L){if(B(r))return this;if(G())A[d.history?"pushState":"replaceState"]({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{I=r;if(K)if(d.history)n.hash="#"+e;else n.replace("#"+e);else if(e!=q())if(d.history)n.hash="#"+e;else n.replace("#"+e);v&&!J&&d.history&&u(N,50);if(K)u(function(){I=o},1);else I=o}}return this}return M(e)},path:function(a){if(a!==h){var b=this.queryString(),
+f=this.hash();this.value(a+(b?"?"+b:"")+(f?"#"+f:""));return this}return M(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 m,
+p;if(b!==h){var P=this.parameterNames();p=[];b=b===h||b===D?"":b.toString();for(m=0;m<P.length;m++){var Q=P[m],w=this.parameter(Q);if(typeof w=="string")w=[w];if(Q==a)w=b===D||b===""?[]:f?w.concat([b]):[b];for(var R=0;R<w.length;R++)p.push(Q+"="+w[R])}c.inArray(a,P)==-1&&b!==D&&b!==""&&p.push(a+"="+b);this.queryString(p.join("&"));return this}if(b=this.queryString()){f=[];p=b.split("&");for(m=0;m<p.length;m++){b=p[m].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 m=a[f].split("=")[0];c.inArray(m,b)==-1&&b.push(m)}}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(s){this.data("address")||this.on("click",function(g){if(g.shiftKey||g.ctrlKey||g.metaKey||g.which==2)return true;var k=g.currentTarget;if(c(k).is("a")){g.preventDefault();
+g=s?s.call(k):/address:/.test(c(k).attr("rel"))?c(k).attr("rel").split("address:")[1].split(" ")[0]:c.address.state()!==undefined&&!/^\/?$/.test(c.address.state())?c(k).attr("href").replace(new RegExp("^(.*"+c.address.state()+"|\\.)"),""):c(k).attr("href").replace(/^(#\!?|\.)/,"");c.address.value(g)}}).on("submit",function(g){var k=g.currentTarget;if(c(k).is("form")){g.preventDefault();g=c(k).attr("action");k=s?s.call(k):(g.indexOf("?")!=-1?g.replace(/&$/,""):g+"?")+c(k).serialize();c.address.value(k)}}).data("address",
+true);return this}})(jQuery);
View
49 samples/state/jquery.address-1.6.min.js
@@ -1,29 +1,20 @@
-/*
- * jQuery Address Plugin v1.6
- * http://www.asual.com/jquery/address/
- *
- * Copyright (c) 2009-2013 Rostislav Hristov
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Date: 2013-01-26 19:43:30 +0200 (Sat, 26 Jan 2013)
- */
-(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);
+/*! jQuery Address v1.6 | (c) 2009, 2013 Rostislav Hristov | jquery.org/license */
+(function(c){c.address=function(){var s=function(a){a=c.extend(c.Event(a),function(){for(var b={},f=c.address.parameterNames(),m=0,p=f.length;m<p;m++)b[f[m]]=c.address.parameter(f[m]);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)},k=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},G=function(){return A.pushState&&d.state!==h},T=function(){return("/"+n.pathname.replace(new RegExp(d.state),"")+n.search+(H()?"#"+H():"")).replace(S,"/")},H=function(){var a=n.href.indexOf("#");return a!=-1?n.href.substr(a+1):""},q=function(){return G()?T():H()},U=function(){return"javascript"},M=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},t=function(a,
+b){return parseInt(a.css(b),10)},C=function(){if(!I){var a=q();if(decodeURI(e)!=decodeURI(a))if(v&&x<7)n.reload();else{v&&!J&&d.history&&u(N,50);e=a;B(o)}}},B=function(a){u(ea,10);return s(V).isDefaultPrevented()||s(a?W:X).isDefaultPrevented()},ea=function(){if(d.tracker!=="null"&&d.tracker!==D){var a=c.isFunction(d.tracker)?d.tracker:i[d.tracker],b=(n.pathname+n.search+(c.address&&!G()?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)])}},N=function(){var a=U()+":"+o+";document.open();document.writeln('<html><head><title>"+l.title.replace(/\'/g,"\\'")+"</title><script>var "+y+' = "'+encodeURIComponent(q()).replace(/\'/g,"\\'")+(l.domain!=n.hostname?'";document.domain="'+l.domain:"")+"\";<\/script></head></html>');document.close();";if(x<7)j.src=
+a;else j.contentWindow.location.replace(a)},Z=function(){if(E&&Y!=-1){var a,b,f=E.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]}E=D}e=q()},aa=function(){if(!$){$=r;Z();c('a[rel*="address:"]').address();if(d.wrap){var a=c("body");c("body > *").wrapAll('<div style="padding:'+(t(a,"marginTop")+t(a,"paddingTop"))+"px "+
+(t(a,"marginRight")+t(a,"paddingRight"))+"px "+(t(a,"marginBottom")+t(a,"paddingBottom"))+"px "+(t(a,"marginLeft")+t(a,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+y+'" style="height:100%;overflow:auto;position:relative;'+(K&&!window.statusbar.visible?"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});K&&c('<style type="text/css" />').appendTo("head").text("#"+y+"::-webkit-resizer { background-color: #fff; }")}if(v&&!J){a=l.getElementsByTagName("frameset")[0];
+j=l.createElement((a?"":"i")+"frame");j.src=U()+":"+o;if(a){a.insertAdjacentElement("beforeEnd",j);a[a.cols?"cols":"rows"]+=",0";j.noResize=r;j.frameBorder=j.frameSpacing=0}else{j.style.display="none";j.style.width=j.style.height=0;j.tabIndex=-1;l.body.insertAdjacentElement("afterBegin",j)}u(function(){c(j).bind("load",function(){var b=j.contentWindow;e=b[y]!==h?b[y]:"";if(e!=q()){B(o);n.hash=e}});j.contentWindow[y]===h&&N()},50)}u(function(){s("init");B(o)},1);if(!G())if(v&&x>7||!v&&J)if(i.addEventListener)i.addEventListener(F,
+C,o);else i.attachEvent&&i.attachEvent("on"+F,C);else fa(C,50);"state"in window.history&&c(window).trigger("popstate")}},ga=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,D=null,y="jQueryAddress",F="hashchange",V="change",W="internalChange",X="externalChange",
+r=true,o=false,d={autoUpdate:r,history:r,strict:r,wrap:o},z=function(){var a={},b=ga(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}(),x=parseFloat(z.version),K=z.webkit||z.safari,v=!c.support.opacity,i=function(){try{return top.document!==h&&top.document.title!==h?top:window}catch(a){return window}}(),l=i.document,A=i.history,n=i.location,fa=setInterval,u=setTimeout,S=/\/{2,9}/g;z=navigator.userAgent;var J=
+"on"+F in i,j,E=c("script:last").attr("src"),Y=E?E.indexOf("?"):-1,O=l.title,I=o,$=o,ba=r,L=o,e=q();if(v){x=parseFloat(z.substr(z.indexOf("MSIE")+4));if(l.documentMode&&l.documentMode!=x)x=l.documentMode!=8?7:8;var ca=l.onpropertychange;l.onpropertychange=function(){ca&&ca.call(l);if(l.title!=O&&l.title.indexOf("#"+q())!=-1)l.title=O}}if(A.navigationMode)A.navigationMode="compatible";if(document.readyState=="complete")var ha=setInterval(function(){if(c.address){aa();clearInterval(ha)}},50);else{Z();
+c(aa)}c(window).bind("popstate",function(){if(decodeURI(e)!=decodeURI(q())){e=q();B(o)}}).bind("unload",function(){if(i.removeEventListener)i.removeEventListener(F,C,o);else i.detachEvent&&i.detachEvent("on"+F,C)});return{bind:function(){return k.apply(this,g(arguments))},unbind:function(){return da.apply(this,g(arguments))},init:function(){return k.apply(this,["init"].concat(g(arguments)))},change:function(){return k.apply(this,[V].concat(g(arguments)))},internalChange:function(){return k.apply(this,
+[W].concat(g(arguments)))},externalChange:function(){return k.apply(this,[X].concat(g(arguments)))},baseURL:function(){var a=n.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(A.pushState)b.substr(0,3)=="/#/"&&n.replace(d.state.replace(/^\/$/,
+"")+b.substr(2));else b!="/"&&b.replace(/^\/#/,"")!=H()&&u(function(){n.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(){L=r;this.value(e);L=o;return this},title:function(a){if(a!==h){u(function(){O=l.title=a;if(ba&&j&&j.contentWindow&&j.contentWindow.document){j.contentWindow.document.title=
+a;ba=o}},50);return this}return l.title},value:function(a){if(a!==h){a=M(a);if(a=="/")a="";if(e==a&&!L)return;e=a;if(d.autoUpdate||L){if(B(r))return this;if(G())A[d.history?"pushState":"replaceState"]({},"",d.state.replace(/\/$/,"")+(e===""?"/":e));else{I=r;if(K)if(d.history)n.hash="#"+e;else n.replace("#"+e);else if(e!=q())if(d.history)n.hash="#