Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tests now use relative urls.

  • Loading branch information...
commit b8d7c0a6ce807bf4945de98f4c11e6838e1ff972 1 parent 8b30581
@balupton authored
Showing with 137 additions and 73 deletions.
  1. +1 −1  scripts/compressed/history.html4.js
  2. +1 −1  scripts/compressed/history.js
  3. +1 −1  tests.src/_header.php
  4. +1 −2  tests.src/all.php
  5. +4 −3 tests.src/each.php
  6. +4 −2 tests/compressed-html4-nonpersistant-jquery.html
  7. +4 −2 tests/compressed-html4-nonpersistant-mootools.html
  8. +4 −2 tests/compressed-html4-nonpersistant-prototype.html
  9. +4 −2 tests/compressed-html4-nonpersistant-zepto.html
  10. +4 −2 tests/compressed-html4-persistant-jquery.html
  11. +4 −2 tests/compressed-html4-persistant-mootools.html
  12. +4 −2 tests/compressed-html4-persistant-prototype.html
  13. +4 −2 tests/compressed-html4-persistant-zepto.html
  14. +4 −2 tests/compressed-html5-nonpersistant-jquery.html
  15. +4 −2 tests/compressed-html5-nonpersistant-mootools.html
  16. +4 −2 tests/compressed-html5-nonpersistant-prototype.html
  17. +4 −2 tests/compressed-html5-nonpersistant-zepto.html
  18. +4 −2 tests/compressed-html5-persistant-jquery.html
  19. +4 −2 tests/compressed-html5-persistant-mootools.html
  20. +4 −2 tests/compressed-html5-persistant-prototype.html
  21. +4 −2 tests/compressed-html5-persistant-zepto.html
  22. +1 −1  tests/index.html
  23. +4 −2 tests/uncompressed-html4-nonpersistant-jquery.html
  24. +4 −2 tests/uncompressed-html4-nonpersistant-mootools.html
  25. +4 −2 tests/uncompressed-html4-nonpersistant-prototype.html
  26. +4 −2 tests/uncompressed-html4-nonpersistant-zepto.html
  27. +4 −2 tests/uncompressed-html4-persistant-jquery.html
  28. +4 −2 tests/uncompressed-html4-persistant-mootools.html
  29. +4 −2 tests/uncompressed-html4-persistant-prototype.html
  30. +4 −2 tests/uncompressed-html4-persistant-zepto.html
  31. +4 −2 tests/uncompressed-html5-nonpersistant-jquery.html
  32. +4 −2 tests/uncompressed-html5-nonpersistant-mootools.html
  33. +4 −2 tests/uncompressed-html5-nonpersistant-prototype.html
  34. +4 −2 tests/uncompressed-html5-nonpersistant-zepto.html
  35. +4 −2 tests/uncompressed-html5-persistant-jquery.html
  36. +4 −2 tests/uncompressed-html5-persistant-mootools.html
  37. +4 −2 tests/uncompressed-html5-persistant-prototype.html
  38. +4 −2 tests/uncompressed-html5-persistant-zepto.html
View
2  scripts/compressed/history.html4.js
@@ -1 +1 @@
-(function(a,b){"use strict";var c=a.document,d=a.History=a.History||{};if(typeof d.initHtml4!="undefined")throw new Error("History.js HTML4 Support has already been loaded...");d.initHtml4=function(){if(typeof d.initHtml4.initialized!="undefined")return!1;d.initHtml4.initialized=!0,d.savedHashes=[],d.isLastHash=function(a){var b=d.getHashByIndex(),c=a===b;return c},d.saveHash=function(a){if(d.isLastHash(a))return!1;d.savedHashes.push(a);return!0},d.getHashByIndex=function(a){var b=null;typeof a=="undefined"?b=d.savedHashes[d.savedHashes.length-1]:a<0?b=d.savedHashes[d.savedHashes.length+a]:b=d.savedHashes[a];return b},d.discardedHashes={},d.discardedStates={},d.discardState=function(a,b,c){var e=d.getHashByState(a),f={discardedState:a,backState:c,forwardState:b};d.discardedStates[e]=f;return!0},d.discardHash=function(a,b,c){var e={discardedHash:a,backState:c,forwardState:b};d.discardedHashes[a]=e;return!0},d.discardedState=function(a){var b=d.getHashByState(a),c=d.discardedStates[b]||!1;return c},d.discardedHash=function(a){var b=d.discardedHashes[a]||!1;return b},d.recycleState=function(a){var b=d.getHashByState(a);d.discardedState(a)&&delete d.discardedStates[b];return!0},d.emulated.hashChange&&(d.hashChangeInit=function(){d.checkerFunction=null;var b="";if(d.isInternetExplorer()){var e="historyjs-iframe",f=c.createElement("iframe");f.setAttribute("id",e),f.style.display="none",c.body.appendChild(f),f.contentWindow.document.open(),f.contentWindow.document.close();var g="",h=!1;d.checkerFunction=function(){if(h)return!1;h=!0;var c=d.getHash()||"",e=d.unescapeHash(f.contentWindow.document.location.hash)||"";c!==b?(b=c,e!==c&&(g=e=c,f.contentWindow.document.open(),f.contentWindow.document.close(),f.contentWindow.document.location.hash=d.escapeHash(c)),d.Adapter.trigger(a,"hashchange")):e!==g&&(g=e,d.setHash(e,!1)),h=!1;return!0}}else d.checkerFunction=function(){var c=d.getHash();c!==b&&(b=c,d.Adapter.trigger(a,"hashchange"));return!0};setInterval(d.checkerFunction,d.options.hashChangeInterval);return!0},d.Adapter.onDomLoad(d.hashChangeInit)),d.emulated.pushState&&(d.onHashChange=function(b){var e=b&&b.newURL||c.location.href,f=d.getHashByUrl(e),g=null,h=null,i=null;if(d.isLastHash(f)){d.busy(!1);return!1}d.doubleCheckComplete(),d.saveHash(f),g=d.extractState(f||c.location.href);if(!g){d.Adapter.trigger(a,"anchorchange"),d.busy(!1);return!1}if(d.isLastSavedState(g)){d.busy(!1);return!1}h=d.getHashByState(g);var j=d.discardedState(g);if(j){d.getHashByIndex(-2)===d.getHashByState(j.forwardState)?d.back(!1):d.forward(!1),d.busy(!1);return!1}d.pushState(g.data,g.title,g.url,!1);return!0},d.Adapter.bind(a,"hashchange",d.onHashChange),d.pushState=function(b,e,f,g){if(d.getHashByUrl(f))throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(g!==!1&&d.busy()){d.pushQueue({scope:d,callback:d.pushState,args:arguments,queue:g});return!1}d.busy(!0);var h=d.createStateObject(b,e,f),i=d.getHashByState(h),j=d.getState(!1),k=d.getHashByState(j),l=d.getHash();d.storeState(h),d.expectedStateId=h.id,d.recycleState(h),d.setTitle(h);if(i===k){d.busy(!1);return!1}if(i!==l&&i!==d.getShortUrl(c.location.href)){d.setHash(i,!1);return!1}d.saveState(h),d.Adapter.trigger(a,"statechange"),d.busy(!1);return!0},d.replaceState=function(a,b,c,e){if(d.getHashByUrl(c))throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&d.busy()){d.pushQueue({scope:d,callback:d.replaceState,args:arguments,queue:e});return!1}d.busy(!0);var f=d.createStateObject(a,b,c),g=d.getState(!1),h=d.getStateByIndex(-2);d.discardState(g,f,h),d.pushState(f.data,f.title,f.url,!1);return!0},d.saveState(d.storeState(d.createStateObject({},"",c.location.href))),d.getHash()&&!d.emulated.hashChange&&d.Adapter.onDomLoad(function(){d.Adapter.trigger(a,"hashchange")}))},d.init()})(window)
+(function(a,b){"use strict";var c=a.document,d=a.History=a.History||{};if(typeof d.initHtml4!="undefined")throw new Error("History.js HTML4 Support has already been loaded...");d.initHtml4=function(){if(typeof d.initHtml4.initialized!="undefined")return!1;d.initHtml4.initialized=!0,d.enabled=!0,d.savedHashes=[],d.isLastHash=function(a){var b=d.getHashByIndex(),c=a===b;return c},d.saveHash=function(a){if(d.isLastHash(a))return!1;d.savedHashes.push(a);return!0},d.getHashByIndex=function(a){var b=null;typeof a=="undefined"?b=d.savedHashes[d.savedHashes.length-1]:a<0?b=d.savedHashes[d.savedHashes.length+a]:b=d.savedHashes[a];return b},d.discardedHashes={},d.discardedStates={},d.discardState=function(a,b,c){var e=d.getHashByState(a),f={discardedState:a,backState:c,forwardState:b};d.discardedStates[e]=f;return!0},d.discardHash=function(a,b,c){var e={discardedHash:a,backState:c,forwardState:b};d.discardedHashes[a]=e;return!0},d.discardedState=function(a){var b=d.getHashByState(a),c=d.discardedStates[b]||!1;return c},d.discardedHash=function(a){var b=d.discardedHashes[a]||!1;return b},d.recycleState=function(a){var b=d.getHashByState(a);d.discardedState(a)&&delete d.discardedStates[b];return!0},d.emulated.hashChange&&(d.hashChangeInit=function(){d.checkerFunction=null;var b="";if(d.isInternetExplorer()){var e="historyjs-iframe",f=c.createElement("iframe");f.setAttribute("id",e),f.style.display="none",c.body.appendChild(f),f.contentWindow.document.open(),f.contentWindow.document.close();var g="",h=!1;d.checkerFunction=function(){if(h)return!1;h=!0;var c=d.getHash()||"",e=d.unescapeHash(f.contentWindow.document.location.hash)||"";c!==b?(b=c,e!==c&&(g=e=c,f.contentWindow.document.open(),f.contentWindow.document.close(),f.contentWindow.document.location.hash=d.escapeHash(c)),d.Adapter.trigger(a,"hashchange")):e!==g&&(g=e,d.setHash(e,!1)),h=!1;return!0}}else d.checkerFunction=function(){var c=d.getHash();c!==b&&(b=c,d.Adapter.trigger(a,"hashchange"));return!0};setInterval(d.checkerFunction,d.options.hashChangeInterval);return!0},d.Adapter.onDomLoad(d.hashChangeInit)),d.emulated.pushState&&(d.onHashChange=function(b){var e=b&&b.newURL||c.location.href,f=d.getHashByUrl(e),g=null,h=null,i=null;if(d.isLastHash(f)){d.busy(!1);return!1}d.doubleCheckComplete(),d.saveHash(f),g=d.extractState(f||c.location.href);if(!g){d.Adapter.trigger(a,"anchorchange"),d.busy(!1);return!1}if(d.isLastSavedState(g)){d.busy(!1);return!1}h=d.getHashByState(g);var j=d.discardedState(g);if(j){d.getHashByIndex(-2)===d.getHashByState(j.forwardState)?d.back(!1):d.forward(!1);return!1}d.pushState(g.data,g.title,g.url,!1);return!0},d.Adapter.bind(a,"hashchange",d.onHashChange),d.pushState=function(b,e,f,g){if(d.getHashByUrl(f))throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(g!==!1&&d.busy()){d.pushQueue({scope:d,callback:d.pushState,args:arguments,queue:g});return!1}d.busy(!0);var h=d.createStateObject(b,e,f),i=d.getHashByState(h),j=d.getState(!1),k=d.getHashByState(j),l=d.getHash();d.storeState(h),d.expectedStateId=h.id,d.recycleState(h),d.setTitle(h);if(i===k){d.busy(!1);return!1}if(i!==l&&i!==d.getShortUrl(c.location.href)){d.setHash(i,!1);return!1}d.saveState(h),d.Adapter.trigger(a,"statechange"),d.busy(!1);return!0},d.replaceState=function(a,b,c,e){if(d.getHashByUrl(c))throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&d.busy()){d.pushQueue({scope:d,callback:d.replaceState,args:arguments,queue:e});return!1}d.busy(!0);var f=d.createStateObject(a,b,c),g=d.getState(!1),h=d.getStateByIndex(-2);d.discardState(g,f,h),d.pushState(f.data,f.title,f.url,!1);return!0},d.saveState(d.storeState(d.createStateObject({},"",c.location.href))),d.getHash()&&!d.emulated.hashChange&&d.Adapter.onDomLoad(function(){d.Adapter.trigger(a,"hashchange")}))},d.init()})(window)
View
2  scripts/compressed/history.js
@@ -1 +1 @@
-(function(a,b){"use strict";var c=a.console||b,d=a.document,e=a.navigator,f=a.amplify||!1,g=a.History=a.History||{},h=a.history;if(typeof g.init!="undefined")throw new Error("History.js Core has already been loaded...");g.init=function(){if(typeof g.Adapter=="undefined")return!1;typeof g.initCore!="undefined"&&g.initCore(),typeof g.initHtml4!="undefined"&&g.initHtml4();return!0},g.initCore=function(){if(typeof g.initCore.initialized!="undefined")return!1;g.initCore.initialized=!0,g.options=g.options||{},g.options.hashChangeInterval=g.options.hashChangeInterval||100,g.options.safariPollInterval=g.options.safariPollInterval||500,g.options.doubleCheckInterval=g.options.doubleCheckInterval||500,g.options.busyDelay=g.options.busyDelay||250,g.options.debug=g.options.debug||!1,g.options.initialTitle=g.options.initialTitle||d.title,g.debug=function(){(g.options.debug||!1)&&g.log.apply(g,arguments)},g.log=function(){var a=typeof c!="undefined"&&typeof c.log!="undefined"&&typeof c.log.apply!="undefined",b=d.getElementById("log"),e,f,g;if(a){var h=Array.prototype.slice.call(arguments);e=h.shift(),typeof c.debug!="undefined"?c.debug.apply(c,[e,h]):c.log.apply(c,[e,h])}else e="\n"+arguments[0]+"\n";for(f=1,g=arguments.length;f<g;++f){var i=arguments[f];if(typeof i=="object"&&typeof JSON!="undefined")try{i=JSON.stringify(i)}catch(j){}e+="\n"+i+"\n"}b?(b.value+=e+"\n-----\n",b.scrollTop=b.scrollHeight-b.clientHeight):a||alert(e);return!0},g.getInternetExplorerMajorVersion=function(){var a=g.getInternetExplorerMajorVersion.cached=typeof g.getInternetExplorerMajorVersion.cached!="undefined"?g.getInternetExplorerMajorVersion.cached:function(){var a=3,b=d.createElement("div"),c=b.getElementsByTagName("i");while((b.innerHTML="<!--[if gt IE "+ ++a+"]><i></i><![endif]-->")&&c[0]);return a>4?a:!1}();return a},g.isInternetExplorer=function(){var a=g.isInternetExplorer.cached=typeof g.isInternetExplorer.cached!="undefined"?g.isInternetExplorer.cached:Boolean(g.getInternetExplorerMajorVersion());return a},g.emulated={pushState:!Boolean(a.history&&a.history.pushState&&a.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(e.userAgent)),hashChange:Boolean(!("onhashchange"in a||"onhashchange"in d)||g.isInternetExplorer()&&g.getInternetExplorerMajorVersion()<8)},g.bugs={setHash:Boolean(!g.emulated.pushState&&e.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2][0-9]|3[0-3])/.test(e.userAgent)),safariPoll:Boolean(!g.emulated.pushState&&e.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2][0-9]|3[0-3])/.test(e.userAgent)),ieDoubleCheck:Boolean(g.isInternetExplorer()&&g.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(g.isInternetExplorer()&&g.getInternetExplorerMajorVersion()<7)},g.isEmptyObject=function(a){for(var b in a)return!1;return!0},g.cloneObject=function(a){var b,c;a?(b=JSON.stringify(a),c=JSON.parse(b)):c={};return c},g.getRootUrl=function(){var a=d.location.protocol+"//"+(d.location.hostname||d.location.host);if(d.location.port||!1)a+=":"+d.location.port;a+="/";return a},g.getBaseHref=function(){var a=d.getElementsByTagName("base"),b=null,c="";a.length===1&&(b=a[0],c=b.href.replace(/[^\/]+$/,"")),c=c.replace(/\/+$/,""),c&&(c+="/");return c},g.getBaseUrl=function(){var a=g.getBaseHref()||g.getBasePageUrl()||g.getRootUrl();return a},g.getPageUrl=function(){var a=g.getState(),b=a.url||d.location.href,c=b.replace(/\/+$/,"").replace(/[^\/]+$/,function(a,b,c){return/\./.test(a)?a:a+"/"});return c},g.getBasePageUrl=function(){var a=d.location.href.replace(/[#\?].*/,"").replace(/[^\/]+$/,function(a,b,c){return/\./.test(a)?"":a}).replace(/\/+$/,"")+"/";return a},g.getFullUrl=function(a){var b=a,c=a.substring(0,1);/[a-z]+\:\/\//.test(a)||(c==="/"?b=g.getRootUrl()+a.replace(/^\/+/,""):c==="#"?b=g.getPageUrl().replace(/#.*/,"")+a:c==="?"?b=g.getPageUrl().replace(/[\?#].*/,"")+a:b=g.getBaseUrl()+a);return b.replace(/\#$/,"")},g.getShortUrl=function(a){var b,c=g.getRootUrl();b=a.replace(c,"/");return b.replace(/\#$/,"")},g.store=f?f.store("History.store")||{}:{},g.store.idToState=g.store.idToState||{},g.store.urlToId=g.store.urlToId||{},g.idToState=g.idToState||{},g.stateToId=g.stateToId||{},g.urlToId=g.urlToId||{},g.storedStates=g.storedStates||[],g.savedStates=g.savedStates||[],g.getState=function(a){typeof a=="undefined"&&(a=!0);var b=g.getLastSavedState()||g.createStateObject();a&&(b=g.cloneObject(b),b.url=b.cleanUrl||b.url);return b},g.getIdByState=function(a){var b=g.extractId(a.url);if(!b){var c=g.getStateString(a);if(typeof g.stateToId[c]!="undefined")b=g.stateToId[c];else{for(;;){b=String(Math.floor(Math.random()*1e3));if(typeof g.idToState[b]=="undefined"&&typeof g.store.idToState[b]=="undefined")break}g.stateToId[c]=b,g.idToState[b]=a}}return b},g.normalizeState=function(a){if(!a||typeof a!="object")a={};if(typeof a.normalized!="undefined")return a;if(!a.data||typeof a.data!="object")a.data={};var b={};b.normalized=!0,b.title=a.title||"",b.url=g.getFullUrl(a.url||d.location.href),b.hash=g.getShortUrl(b.url),b.data=g.cloneObject(a.data),b.id=g.getIdByState(b),b.cleanUrl=b.url.replace(/\&_suid.*/,""),b.url=b.cleanUrl;var c=!g.isEmptyObject(b.data);if(b.title||c)b.hash=g.getShortUrl(b.url).replace(/\&_suid.*/,""),/\?/.test(b.hash)||(b.hash+="?"),b.hash+="&_suid="+b.id;b.hashedUrl=g.getFullUrl(b.hash),(g.emulated.pushState||g.bugs.safariPoll)&&g.hasUrlDuplicate(b)&&(b.url=b.hashedUrl);return b},g.createStateObject=function(a,b,c){var d={data:a,title:b,url:c};d=g.normalizeState(d);return d},g.getStateById=function(a){a=String(a);var c=g.idToState[a]||g.store.idToState[a]||b;return c},g.getStateString=function(a){var b=g.normalizeState(a),c={data:b.data,title:a.title,url:a.url},d=JSON.stringify(c);return d},g.getStateId=function(a){var b=g.normalizeState(a),c=b.id;return c},g.getHashByState=function(a){var b,c=g.normalizeState(a);b=c.hash;return b},g.extractId=function(a){var b,c,d;c=/(.*)\&_suid=([0-9]+)$/.exec(a),d=c?c[1]||a:a,b=c?String(c[2]||""):"";return b||!1},g.extractState=function(a,b){var c=null;b=b||!1;var d=g.extractId(a);d&&(c=g.getStateById(d));if(!c){var e=g.getFullUrl(a);d=g.getIdByUrl(e)||!1,d&&(c=g.getStateById(d)),!c&&b&&/\//.test(a)&&(c=g.createStateObject(null,null,e))}return c},g.getIdByUrl=function(a){var c=g.urlToId[a]||g.store.urlToId[a]||b;return c},g.getLastSavedState=function(){return g.savedStates[g.savedStates.length-1]||b},g.getLastStoredState=function(){return g.storedStates[g.storedStates.length-1]||b},g.hasUrlDuplicate=function(a){var b=!1,c=g.extractState(a.url);b=c&&c.id!==a.id;return b},g.storeState=function(a){g.urlToId[a.url]=a.id,g.storedStates.push(g.cloneObject(a));return a},g.isLastSavedState=function(a){var b=!1;if(g.savedStates.length){var c=a.id,d=g.getLastSavedState(),e=d.id;b=c===e}return b},g.saveState=function(a){if(g.isLastSavedState(a))return!1;g.savedStates.push(g.cloneObject(a));return!0},g.getStateByIndex=function(a){var b=null;typeof a=="undefined"?b=g.savedStates[g.savedStates.length-1]:a<0?b=g.savedStates[g.savedStates.length+a]:b=g.savedStates[a];return b},g.getHash=function(){var a=g.unescapeHash(d.location.hash);return a},g.unescapeHash=function(b){var c=g.normalizeHash(b);/\%[^2][^5]/.test(c)&&(c=a.unescape(c));return c},g.normalizeHash=function(a){var b=a.replace(/[^#]*#/,"").replace(/#.*/,"");return b},g.setHash=function(a,b){if(b!==!1&&g.busy()){g.pushQueue({scope:g,callback:g.setHash,args:arguments,queue:b});return!1}var c=g.escapeHash(a);g.busy(!0);var e=g.extractState(a,!0);if(e&&!g.emulated.pushState)g.pushState(e.data,e.title,e.url,!1);else if(d.location.hash!==c)if(g.bugs.setHash){var f=g.getPageUrl();g.pushState(null,null,f+"#"+c,!1)}else d.location.hash=c;return g},g.escapeHash=function(b){var c=g.normalizeHash(b);c=a.escape(c),g.bugs.hashEscape||(c=c.replace("%21","!").replace("%26","&").replace("%3D","=").replace("%3F","?"));return c},g.getHashByUrl=function(a){var b=String(a).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");b=g.unescapeHash(b);return b},g.isTraditionalAnchor=function(a){var b=g.getHashByUrl(a),c=d.getElementById(b),e=typeof c!="undefined";return e},g.setTitle=function(a){var b=a.title;if(!b){var c=g.getStateByIndex(0);c&&c.url===a.url&&(b=c.title||g.options.initialTitle)}try{d.getElementsByTagName("title")[0].innerHTML=b.replace("<","&lt;").replace(">","&gt;").replace(" & "," &amp; ")}catch(e){}d.title=b;return g},g.queues=[],g.busy=function(a){typeof a!="undefined"?g.busy.flag=a:typeof g.busy.flag=="undefined"&&(g.busy.flag=!1);if(!g.busy.flag){clearTimeout(g.busy.timeout);var b=function(){if(!g.busy.flag)for(var a=g.queues.length-1;a>=0;--a){var c=g.queues[a];if(c.length===0)continue;var d=c.shift();g.fireQueueItem(d),g.busy.timeout=setTimeout(b,g.options.busyDelay)}};g.busy.timeout=setTimeout(b,g.options.busyDelay)}return g.busy.flag},g.fireQueueItem=function(a){return a.callback.apply(a.scope||g,a.args||[])},g.pushQueue=function(a){g.queues[a.queue||0]=g.queues[a.queue||0]||[],g.queues[a.queue||0].push(a);return g},g.queue=function(a,b){typeof a=="function"&&(a={callback:a}),typeof b!="undefined"&&(a.queue=b),g.busy()?g.pushQueue(a):g.fireQueueItem(a);return g},g.clearQueue=function(){g.busy.flag=!1,g.queues=[];return g},g.stateChanged=!1,g.doubleChecker=!1,g.doubleCheckComplete=function(){g.stateChanged=!0,g.doubleCheckClear();return g},g.doubleCheckClear=function(){g.doubleChecker&&(clearTimeout(g.doubleChecker),g.doubleChecker=!1);return g},g.doubleCheck=function(a){g.stateChanged=!1,g.doubleCheckClear(),g.bugs.ieDoubleCheck&&(g.doubleChecker=setTimeout(function(){g.doubleCheckClear(),g.stateChanged||a();return!0},g.options.doubleCheckInterval));return g},g.safariStatePoll=function(){var b=g.extractState(d.location.href),c;if(!g.isLastSavedState(b))c=b;else return;c||(c=g.createStateObject()),g.Adapter.trigger(a,"popstate");return g},g.back=function(a){if(a!==!1&&g.busy()){g.pushQueue({scope:g,callback:g.back,args:arguments,queue:a});return!1}g.busy(!0),g.doubleCheck(function(){g.back(!1)}),h.go(-1);return!0},g.forward=function(a){if(a!==!1&&g.busy()){g.pushQueue({scope:g,callback:g.forward,args:arguments,queue:a});return!1}g.busy(!0),g.doubleCheck(function(){g.forward(!1)}),h.go(1);return!0},g.go=function(a,b){var c;if(a>0)for(c=1;c<=a;++c)g.forward(b);else{if(!(a<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(c=-1;c>=a;--c)g.back(b)}return g};if(g.emulated.pushState){var i=function(){};g.pushState=g.pushState||i,g.replaceState=g.replaceState||i}else{g.onPopState=function(b){g.doubleCheckComplete();var c=g.getHash();if(c){var e=g.extractState(c||d.location.href,!0);e?g.replaceState(e.data,e.title,e.url,!1):(g.Adapter.trigger(a,"anchorchange"),g.busy(!1)),g.expectedStateId=!1;return!1}var f=!1;b=b||{},typeof b.state=="undefined"&&(typeof b.originalEvent!="undefined"&&typeof b.originalEvent.state!="undefined"?b.state=b.originalEvent.state||!1:typeof b.event!="undefined"&&typeof b.event.state!="undefined"&&(b.state=b.event.state||!1)),b.state=b.state||!1,b.state?f=g.getStateById(b.state):g.expectedStateId?f=g.getStateById(g.expectedStateId):f=g.extractState(d.location.href),f||(f=g.createStateObject(null,null,d.location.href)),g.expectedStateId=!1;if(g.isLastSavedState(f)){g.busy(!1);return!1}g.storeState(f),g.saveState(f),g.setTitle(f),g.Adapter.trigger(a,"statechange"),g.busy(!1);return!0},g.Adapter.bind(a,"popstate",g.onPopState),g.pushState=function(b,c,d,e){if(g.getHashByUrl(d)&&g.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&g.busy()){g.pushQueue({scope:g,callback:g.pushState,args:arguments,queue:e});return!1}g.busy(!0);var f=g.createStateObject(b,c,d);g.isLastSavedState(f)?g.busy(!1):(g.storeState(f),g.expectedStateId=f.id,h.pushState(f.id,f.title,f.url),g.Adapter.trigger(a,"popstate"));return!0},g.replaceState=function(b,c,d,e){if(g.getHashByUrl(d)&&g.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&g.busy()){g.pushQueue({scope:g,callback:g.replaceState,args:arguments,queue:e});return!1}g.busy(!0);var f=g.createStateObject(b,c,d);g.isLastSavedState(f)?g.busy(!1):(g.storeState(f),g.expectedStateId=f.id,h.replaceState(f.id,f.title,f.url),g.Adapter.trigger(a,"popstate"));return!0},g.Adapter.bind(a,"unload",function(){f.store("History.store",{idToState:g.idToState,urlToId:g.urlToId})}),g.saveState(g.storeState(g.extractState(d.location.href,!0))),g.bugs.safariPoll&&setInterval(g.safariStatePoll,g.options.safariPollInterval);if(e.vendor==="Apple Computer, Inc."||(e.appCodeName||"")==="Mozilla")g.Adapter.bind(a,"hashchange",function(){g.Adapter.trigger(a,"popstate")}),g.getHash()&&g.Adapter.onDomLoad(function(){g.Adapter.trigger(a,"hashchange")})}},g.init()})(window)
+(function(a,b){"use strict";var c=a.console||b,d=a.document,e=a.navigator,f=a.amplify||!1,g=a.History=a.History||{},h=a.history;if(typeof g.init!="undefined")throw new Error("History.js Core has already been loaded...");g.init=function(){if(typeof g.Adapter=="undefined")return!1;typeof g.initCore!="undefined"&&g.initCore(),typeof g.initHtml4!="undefined"&&g.initHtml4();return!0},g.initCore=function(){if(typeof g.initCore.initialized!="undefined")return!1;g.initCore.initialized=!0,g.options=g.options||{},g.options.hashChangeInterval=g.options.hashChangeInterval||100,g.options.safariPollInterval=g.options.safariPollInterval||500,g.options.doubleCheckInterval=g.options.doubleCheckInterval||500,g.options.busyDelay=g.options.busyDelay||250,g.options.debug=g.options.debug||!1,g.options.initialTitle=g.options.initialTitle||d.title,g.debug=function(){(g.options.debug||!1)&&g.log.apply(g,arguments)},g.log=function(){var a=typeof c!="undefined"&&typeof c.log!="undefined"&&typeof c.log.apply!="undefined",b=d.getElementById("log"),e,f,g;if(a){var h=Array.prototype.slice.call(arguments);e=h.shift(),typeof c.debug!="undefined"?c.debug.apply(c,[e,h]):c.log.apply(c,[e,h])}else e="\n"+arguments[0]+"\n";for(f=1,g=arguments.length;f<g;++f){var i=arguments[f];if(typeof i=="object"&&typeof JSON!="undefined")try{i=JSON.stringify(i)}catch(j){}e+="\n"+i+"\n"}b?(b.value+=e+"\n-----\n",b.scrollTop=b.scrollHeight-b.clientHeight):a||alert(e);return!0},g.getInternetExplorerMajorVersion=function(){var a=g.getInternetExplorerMajorVersion.cached=typeof g.getInternetExplorerMajorVersion.cached!="undefined"?g.getInternetExplorerMajorVersion.cached:function(){var a=3,b=d.createElement("div"),c=b.getElementsByTagName("i");while((b.innerHTML="<!--[if gt IE "+ ++a+"]><i></i><![endif]-->")&&c[0]);return a>4?a:!1}();return a},g.isInternetExplorer=function(){var a=g.isInternetExplorer.cached=typeof g.isInternetExplorer.cached!="undefined"?g.isInternetExplorer.cached:Boolean(g.getInternetExplorerMajorVersion());return a},g.emulated={pushState:!Boolean(a.history&&a.history.pushState&&a.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(e.userAgent)),hashChange:Boolean(!("onhashchange"in a||"onhashchange"in d)||g.isInternetExplorer()&&g.getInternetExplorerMajorVersion()<8)},g.enabled=!g.emulated.pushState,g.bugs={setHash:Boolean(!g.emulated.pushState&&e.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2][0-9]|3[0-3])/.test(e.userAgent)),safariPoll:Boolean(!g.emulated.pushState&&e.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2][0-9]|3[0-3])/.test(e.userAgent)),ieDoubleCheck:Boolean(g.isInternetExplorer()&&g.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(g.isInternetExplorer()&&g.getInternetExplorerMajorVersion()<7)},g.isEmptyObject=function(a){for(var b in a)return!1;return!0},g.cloneObject=function(a){var b,c;a?(b=JSON.stringify(a),c=JSON.parse(b)):c={};return c},g.getRootUrl=function(){var a=d.location.protocol+"//"+(d.location.hostname||d.location.host);if(d.location.port||!1)a+=":"+d.location.port;a+="/";return a},g.getBaseHref=function(){var a=d.getElementsByTagName("base"),b=null,c="";a.length===1&&(b=a[0],c=b.href.replace(/[^\/]+$/,"")),c=c.replace(/\/+$/,""),c&&(c+="/");return c},g.getBaseUrl=function(){var a=g.getBaseHref()||g.getBasePageUrl()||g.getRootUrl();return a},g.getPageUrl=function(){var a=g.getState(),b=a.url||d.location.href,c=b.replace(/\/+$/,"").replace(/[^\/]+$/,function(a,b,c){return/\./.test(a)?a:a+"/"});return c},g.getBasePageUrl=function(){var a=d.location.href.replace(/[#\?].*/,"").replace(/[^\/]+$/,function(a,b,c){return/[^\/]$/.test(a)?"":a}).replace(/\/+$/,"")+"/";return a},g.getFullUrl=function(a){var b=a,c=a.substring(0,1);/[a-z]+\:\/\//.test(a)||(c==="/"?b=g.getRootUrl()+a.replace(/^\/+/,""):c==="#"?b=g.getPageUrl().replace(/#.*/,"")+a:c==="?"?b=g.getPageUrl().replace(/[\?#].*/,"")+a:b=g.getBaseUrl()+a);return b.replace(/\#$/,"")},g.getShortUrl=function(a){var b,c=g.getRootUrl();b=a.replace(c,"/");return b.replace(/\#$/,"")},g.store=f?f.store("History.store")||{}:{},g.store.idToState=g.store.idToState||{},g.store.urlToId=g.store.urlToId||{},g.idToState=g.idToState||{},g.stateToId=g.stateToId||{},g.urlToId=g.urlToId||{},g.storedStates=g.storedStates||[],g.savedStates=g.savedStates||[],g.getState=function(a){typeof a=="undefined"&&(a=!0);var b=g.getLastSavedState()||g.createStateObject();a&&(b=g.cloneObject(b),b.url=b.cleanUrl||b.url);return b},g.getIdByState=function(a){var b=g.extractId(a.url);if(!b){var c=g.getStateString(a);if(typeof g.stateToId[c]!="undefined")b=g.stateToId[c];else{for(;;){b=String(Math.floor(Math.random()*1e3));if(typeof g.idToState[b]=="undefined"&&typeof g.store.idToState[b]=="undefined")break}g.stateToId[c]=b,g.idToState[b]=a}}return b},g.normalizeState=function(a){if(!a||typeof a!="object")a={};if(typeof a.normalized!="undefined")return a;if(!a.data||typeof a.data!="object")a.data={};var b={};b.normalized=!0,b.title=a.title||"",b.url=g.getFullUrl(a.url||d.location.href),b.hash=g.getShortUrl(b.url),b.data=g.cloneObject(a.data),b.id=g.getIdByState(b),b.cleanUrl=b.url.replace(/\&_suid.*/,""),b.url=b.cleanUrl;var c=!g.isEmptyObject(b.data);if(b.title||c)b.hash=g.getShortUrl(b.url).replace(/\&_suid.*/,""),/\?/.test(b.hash)||(b.hash+="?"),b.hash+="&_suid="+b.id;b.hashedUrl=g.getFullUrl(b.hash),(g.emulated.pushState||g.bugs.safariPoll)&&g.hasUrlDuplicate(b)&&(b.url=b.hashedUrl);return b},g.createStateObject=function(a,b,c){var d={data:a,title:b,url:c};d=g.normalizeState(d);return d},g.getStateById=function(a){a=String(a);var c=g.idToState[a]||g.store.idToState[a]||b;return c},g.getStateString=function(a){var b=g.normalizeState(a),c={data:b.data,title:a.title,url:a.url},d=JSON.stringify(c);return d},g.getStateId=function(a){var b=g.normalizeState(a),c=b.id;return c},g.getHashByState=function(a){var b,c=g.normalizeState(a);b=c.hash;return b},g.extractId=function(a){var b,c,d;c=/(.*)\&_suid=([0-9]+)$/.exec(a),d=c?c[1]||a:a,b=c?String(c[2]||""):"";return b||!1},g.extractState=function(a,b){var c=null;b=b||!1;var d=g.extractId(a);d&&(c=g.getStateById(d));if(!c){var e=g.getFullUrl(a);d=g.getIdByUrl(e)||!1,d&&(c=g.getStateById(d)),!c&&b&&/\//.test(a)&&(c=g.createStateObject(null,null,e))}return c},g.getIdByUrl=function(a){var c=g.urlToId[a]||g.store.urlToId[a]||b;return c},g.getLastSavedState=function(){return g.savedStates[g.savedStates.length-1]||b},g.getLastStoredState=function(){return g.storedStates[g.storedStates.length-1]||b},g.hasUrlDuplicate=function(a){var b=!1,c=g.extractState(a.url);b=c&&c.id!==a.id;return b},g.storeState=function(a){g.urlToId[a.url]=a.id,g.storedStates.push(g.cloneObject(a));return a},g.isLastSavedState=function(a){var b=!1;if(g.savedStates.length){var c=a.id,d=g.getLastSavedState(),e=d.id;b=c===e}return b},g.saveState=function(a){if(g.isLastSavedState(a))return!1;g.savedStates.push(g.cloneObject(a));return!0},g.getStateByIndex=function(a){var b=null;typeof a=="undefined"?b=g.savedStates[g.savedStates.length-1]:a<0?b=g.savedStates[g.savedStates.length+a]:b=g.savedStates[a];return b},g.getHash=function(){var a=g.unescapeHash(d.location.hash);return a},g.unescapeHash=function(b){var c=g.normalizeHash(b);/\%[^2][^5]/.test(c)&&(c=a.unescape(c));return c},g.normalizeHash=function(a){var b=a.replace(/[^#]*#/,"").replace(/#.*/,"");return b},g.setHash=function(a,b){if(b!==!1&&g.busy()){g.pushQueue({scope:g,callback:g.setHash,args:arguments,queue:b});return!1}var c=g.escapeHash(a);g.busy(!0);var e=g.extractState(a,!0);if(e&&!g.emulated.pushState)g.pushState(e.data,e.title,e.url,!1);else if(d.location.hash!==c)if(g.bugs.setHash){var f=g.getPageUrl();g.pushState(null,null,f+"#"+c,!1)}else d.location.hash=c;return g},g.escapeHash=function(b){var c=g.normalizeHash(b);c=a.escape(c),g.bugs.hashEscape||(c=c.replace("%21","!").replace("%26","&").replace("%3D","=").replace("%3F","?"));return c},g.getHashByUrl=function(a){var b=String(a).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");b=g.unescapeHash(b);return b},g.isTraditionalAnchor=function(a){var b=g.getHashByUrl(a),c=d.getElementById(b),e=typeof c!="undefined";return e},g.setTitle=function(a){var b=a.title;if(!b){var c=g.getStateByIndex(0);c&&c.url===a.url&&(b=c.title||g.options.initialTitle)}try{d.getElementsByTagName("title")[0].innerHTML=b.replace("<","&lt;").replace(">","&gt;").replace(" & "," &amp; ")}catch(e){}d.title=b;return g},g.queues=[],g.busy=function(a){typeof a!="undefined"?g.busy.flag=a:typeof g.busy.flag=="undefined"&&(g.busy.flag=!1);if(!g.busy.flag){clearTimeout(g.busy.timeout);var b=function(){if(!g.busy.flag)for(var a=g.queues.length-1;a>=0;--a){var c=g.queues[a];if(c.length===0)continue;var d=c.shift();g.fireQueueItem(d),g.busy.timeout=setTimeout(b,g.options.busyDelay)}};g.busy.timeout=setTimeout(b,g.options.busyDelay)}return g.busy.flag},g.fireQueueItem=function(a){return a.callback.apply(a.scope||g,a.args||[])},g.pushQueue=function(a){g.queues[a.queue||0]=g.queues[a.queue||0]||[],g.queues[a.queue||0].push(a);return g},g.queue=function(a,b){typeof a=="function"&&(a={callback:a}),typeof b!="undefined"&&(a.queue=b),g.busy()?g.pushQueue(a):g.fireQueueItem(a);return g},g.clearQueue=function(){g.busy.flag=!1,g.queues=[];return g},g.stateChanged=!1,g.doubleChecker=!1,g.doubleCheckComplete=function(){g.stateChanged=!0,g.doubleCheckClear();return g},g.doubleCheckClear=function(){g.doubleChecker&&(clearTimeout(g.doubleChecker),g.doubleChecker=!1);return g},g.doubleCheck=function(a){g.stateChanged=!1,g.doubleCheckClear(),g.bugs.ieDoubleCheck&&(g.doubleChecker=setTimeout(function(){g.doubleCheckClear(),g.stateChanged||a();return!0},g.options.doubleCheckInterval));return g},g.safariStatePoll=function(){var b=g.extractState(d.location.href),c;if(!g.isLastSavedState(b))c=b;else return;c||(c=g.createStateObject()),g.Adapter.trigger(a,"popstate");return g},g.back=function(a){if(a!==!1&&g.busy()){g.pushQueue({scope:g,callback:g.back,args:arguments,queue:a});return!1}g.busy(!0),g.doubleCheck(function(){g.back(!1)}),h.go(-1);return!0},g.forward=function(a){if(a!==!1&&g.busy()){g.pushQueue({scope:g,callback:g.forward,args:arguments,queue:a});return!1}g.busy(!0),g.doubleCheck(function(){g.forward(!1)}),h.go(1);return!0},g.go=function(a,b){var c;if(a>0)for(c=1;c<=a;++c)g.forward(b);else{if(!(a<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(c=-1;c>=a;--c)g.back(b)}return g};if(g.emulated.pushState){var i=function(){};g.pushState=g.pushState||i,g.replaceState=g.replaceState||i}else{g.onPopState=function(b){g.doubleCheckComplete();var c=g.getHash();if(c){var e=g.extractState(c||d.location.href,!0);e?g.replaceState(e.data,e.title,e.url,!1):(g.Adapter.trigger(a,"anchorchange"),g.busy(!1)),g.expectedStateId=!1;return!1}var f=!1;b=b||{},typeof b.state=="undefined"&&(typeof b.originalEvent!="undefined"&&typeof b.originalEvent.state!="undefined"?b.state=b.originalEvent.state||!1:typeof b.event!="undefined"&&typeof b.event.state!="undefined"&&(b.state=b.event.state||!1)),b.state=b.state||!1,b.state?f=g.getStateById(b.state):g.expectedStateId?f=g.getStateById(g.expectedStateId):f=g.extractState(d.location.href),f||(f=g.createStateObject(null,null,d.location.href)),g.expectedStateId=!1;if(g.isLastSavedState(f)){g.busy(!1);return!1}g.storeState(f),g.saveState(f),g.setTitle(f),g.Adapter.trigger(a,"statechange"),g.busy(!1);return!0},g.Adapter.bind(a,"popstate",g.onPopState),g.pushState=function(b,c,d,e){if(g.getHashByUrl(d)&&g.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&g.busy()){g.pushQueue({scope:g,callback:g.pushState,args:arguments,queue:e});return!1}g.busy(!0);var f=g.createStateObject(b,c,d);g.isLastSavedState(f)?g.busy(!1):(g.storeState(f),g.expectedStateId=f.id,h.pushState(f.id,f.title,f.url),g.Adapter.trigger(a,"popstate"));return!0},g.replaceState=function(b,c,d,e){if(g.getHashByUrl(d)&&g.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&g.busy()){g.pushQueue({scope:g,callback:g.replaceState,args:arguments,queue:e});return!1}g.busy(!0);var f=g.createStateObject(b,c,d);g.isLastSavedState(f)?g.busy(!1):(g.storeState(f),g.expectedStateId=f.id,h.replaceState(f.id,f.title,f.url),g.Adapter.trigger(a,"popstate"));return!0},g.Adapter.bind(a,"unload",function(){f.store("History.store",{idToState:g.idToState,urlToId:g.urlToId})}),g.saveState(g.storeState(g.extractState(d.location.href,!0))),g.bugs.safariPoll&&setInterval(g.safariStatePoll,g.options.safariPollInterval);if(e.vendor==="Apple Computer, Inc."||(e.appCodeName||"")==="Mozilla")g.Adapter.bind(a,"hashchange",function(){g.Adapter.trigger(a,"popstate")}),g.getHash()&&g.Adapter.onDomLoad(function(){g.Adapter.trigger(a,"hashchange")})}},g.init()})(window)
View
2  tests.src/_header.php
@@ -11,7 +11,7 @@
# Base URL
$relative_url = $_SERVER['REQUEST_URI'];
$relative_url = substr($relative_url,0,strpos($relative_url,'/history.js')).'/history.js/';
- $base_url = 'http://'.$_SERVER['HTTP_HOST'].$relative_url;
+ $base_url = '/'.$relative_url;
$tests_url = $base_url.'tests';
# Compress
View
3  tests.src/all.php
@@ -36,7 +36,6 @@
# Url
$filename = "${compression}-${support}-${persist}-${adapter}.html";
- $test_url = $tests_url."/${filename}";
# Title
$Support = strtoupper($support);
@@ -46,7 +45,7 @@
$title = "History.js ${Compression} ${Support} ${Persist} ${Adapter} Test Suite";
# Render
- ?><a href="<?=$test_url?>"><?=$title?></a><?php
+ ?><a href="<?=$filename?>"><?=$title?></a><?php
echo '</div>';
endforeach;
echo '</div>';
View
7 tests.src/each.php
@@ -1,7 +1,6 @@
<?php
# Url
$filename = "${compression}-${support}-${persist}-${adapter}.html";
- $test_url = $tests_url."/${filename}";
# Titles
$Support = strtoupper($support);
@@ -20,8 +19,10 @@
<!-- Check -->
<script>
- var test_url = "<?=$test_url?>";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/compressed-html4-nonpersistant-jquery.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/compressed-html4-nonpersistant-jquery.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/compressed-html4-nonpersistant-mootools.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/compressed-html4-nonpersistant-mootools.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/compressed-html4-nonpersistant-prototype.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/compressed-html4-nonpersistant-prototype.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/compressed-html4-nonpersistant-zepto.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/compressed-html4-nonpersistant-zepto.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/compressed-html4-persistant-jquery.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/compressed-html4-persistant-jquery.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/compressed-html4-persistant-mootools.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/compressed-html4-persistant-mootools.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/compressed-html4-persistant-prototype.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/compressed-html4-persistant-prototype.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/compressed-html4-persistant-zepto.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/compressed-html4-persistant-zepto.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/compressed-html5-nonpersistant-jquery.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/compressed-html5-nonpersistant-jquery.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/compressed-html5-nonpersistant-mootools.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/compressed-html5-nonpersistant-mootools.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/compressed-html5-nonpersistant-prototype.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/compressed-html5-nonpersistant-prototype.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/compressed-html5-nonpersistant-zepto.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/compressed-html5-nonpersistant-zepto.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/compressed-html5-persistant-jquery.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/compressed-html5-persistant-jquery.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/compressed-html5-persistant-mootools.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/compressed-html5-persistant-mootools.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/compressed-html5-persistant-prototype.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/compressed-html5-persistant-prototype.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/compressed-html5-persistant-zepto.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/compressed-html5-persistant-zepto.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
2  tests/index.html
@@ -24,5 +24,5 @@
<h1>History.js Test Suite</h1>
<p>HTML5 Browsers - should pass the HTML4 and HTML5 tests</p>
<p>HTML4 Browsers - should pass the HTML4 tests and fail the HTML5 tests</p>
- <div class="compress"><div class="support"><div class="persist"><div class="adapter"><a href="http://localhost/products/history.js/tests/uncompressed-html5-persistant-jquery.html">History.js Uncompressed HTML5 Persistant Jquery Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/uncompressed-html5-persistant-mootools.html">History.js Uncompressed HTML5 Persistant Mootools Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/uncompressed-html5-persistant-prototype.html">History.js Uncompressed HTML5 Persistant Prototype Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/uncompressed-html5-persistant-zepto.html">History.js Uncompressed HTML5 Persistant Zepto Test Suite</a></div></div><div class="persist"><div class="adapter"><a href="http://localhost/products/history.js/tests/uncompressed-html5-nonpersistant-jquery.html">History.js Uncompressed HTML5 Nonpersistant Jquery Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/uncompressed-html5-nonpersistant-mootools.html">History.js Uncompressed HTML5 Nonpersistant Mootools Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/uncompressed-html5-nonpersistant-prototype.html">History.js Uncompressed HTML5 Nonpersistant Prototype Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/uncompressed-html5-nonpersistant-zepto.html">History.js Uncompressed HTML5 Nonpersistant Zepto Test Suite</a></div></div></div><div class="support"><div class="persist"><div class="adapter"><a href="http://localhost/products/history.js/tests/uncompressed-html4-persistant-jquery.html">History.js Uncompressed HTML4 Persistant Jquery Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/uncompressed-html4-persistant-mootools.html">History.js Uncompressed HTML4 Persistant Mootools Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/uncompressed-html4-persistant-prototype.html">History.js Uncompressed HTML4 Persistant Prototype Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/uncompressed-html4-persistant-zepto.html">History.js Uncompressed HTML4 Persistant Zepto Test Suite</a></div></div><div class="persist"><div class="adapter"><a href="http://localhost/products/history.js/tests/uncompressed-html4-nonpersistant-jquery.html">History.js Uncompressed HTML4 Nonpersistant Jquery Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/uncompressed-html4-nonpersistant-mootools.html">History.js Uncompressed HTML4 Nonpersistant Mootools Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/uncompressed-html4-nonpersistant-prototype.html">History.js Uncompressed HTML4 Nonpersistant Prototype Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/uncompressed-html4-nonpersistant-zepto.html">History.js Uncompressed HTML4 Nonpersistant Zepto Test Suite</a></div></div></div></div><div class="compress"><div class="support"><div class="persist"><div class="adapter"><a href="http://localhost/products/history.js/tests/compressed-html5-persistant-jquery.html">History.js Compressed HTML5 Persistant Jquery Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/compressed-html5-persistant-mootools.html">History.js Compressed HTML5 Persistant Mootools Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/compressed-html5-persistant-prototype.html">History.js Compressed HTML5 Persistant Prototype Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/compressed-html5-persistant-zepto.html">History.js Compressed HTML5 Persistant Zepto Test Suite</a></div></div><div class="persist"><div class="adapter"><a href="http://localhost/products/history.js/tests/compressed-html5-nonpersistant-jquery.html">History.js Compressed HTML5 Nonpersistant Jquery Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/compressed-html5-nonpersistant-mootools.html">History.js Compressed HTML5 Nonpersistant Mootools Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/compressed-html5-nonpersistant-prototype.html">History.js Compressed HTML5 Nonpersistant Prototype Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/compressed-html5-nonpersistant-zepto.html">History.js Compressed HTML5 Nonpersistant Zepto Test Suite</a></div></div></div><div class="support"><div class="persist"><div class="adapter"><a href="http://localhost/products/history.js/tests/compressed-html4-persistant-jquery.html">History.js Compressed HTML4 Persistant Jquery Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/compressed-html4-persistant-mootools.html">History.js Compressed HTML4 Persistant Mootools Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/compressed-html4-persistant-prototype.html">History.js Compressed HTML4 Persistant Prototype Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/compressed-html4-persistant-zepto.html">History.js Compressed HTML4 Persistant Zepto Test Suite</a></div></div><div class="persist"><div class="adapter"><a href="http://localhost/products/history.js/tests/compressed-html4-nonpersistant-jquery.html">History.js Compressed HTML4 Nonpersistant Jquery Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/compressed-html4-nonpersistant-mootools.html">History.js Compressed HTML4 Nonpersistant Mootools Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/compressed-html4-nonpersistant-prototype.html">History.js Compressed HTML4 Nonpersistant Prototype Test Suite</a></div><div class="adapter"><a href="http://localhost/products/history.js/tests/compressed-html4-nonpersistant-zepto.html">History.js Compressed HTML4 Nonpersistant Zepto Test Suite</a></div></div></div></div></body>
+ <div class="compress"><div class="support"><div class="persist"><div class="adapter"><a href="uncompressed-html5-persistant-jquery.html">History.js Uncompressed HTML5 Persistant Jquery Test Suite</a></div><div class="adapter"><a href="uncompressed-html5-persistant-mootools.html">History.js Uncompressed HTML5 Persistant Mootools Test Suite</a></div><div class="adapter"><a href="uncompressed-html5-persistant-prototype.html">History.js Uncompressed HTML5 Persistant Prototype Test Suite</a></div><div class="adapter"><a href="uncompressed-html5-persistant-zepto.html">History.js Uncompressed HTML5 Persistant Zepto Test Suite</a></div></div><div class="persist"><div class="adapter"><a href="uncompressed-html5-nonpersistant-jquery.html">History.js Uncompressed HTML5 Nonpersistant Jquery Test Suite</a></div><div class="adapter"><a href="uncompressed-html5-nonpersistant-mootools.html">History.js Uncompressed HTML5 Nonpersistant Mootools Test Suite</a></div><div class="adapter"><a href="uncompressed-html5-nonpersistant-prototype.html">History.js Uncompressed HTML5 Nonpersistant Prototype Test Suite</a></div><div class="adapter"><a href="uncompressed-html5-nonpersistant-zepto.html">History.js Uncompressed HTML5 Nonpersistant Zepto Test Suite</a></div></div></div><div class="support"><div class="persist"><div class="adapter"><a href="uncompressed-html4-persistant-jquery.html">History.js Uncompressed HTML4 Persistant Jquery Test Suite</a></div><div class="adapter"><a href="uncompressed-html4-persistant-mootools.html">History.js Uncompressed HTML4 Persistant Mootools Test Suite</a></div><div class="adapter"><a href="uncompressed-html4-persistant-prototype.html">History.js Uncompressed HTML4 Persistant Prototype Test Suite</a></div><div class="adapter"><a href="uncompressed-html4-persistant-zepto.html">History.js Uncompressed HTML4 Persistant Zepto Test Suite</a></div></div><div class="persist"><div class="adapter"><a href="uncompressed-html4-nonpersistant-jquery.html">History.js Uncompressed HTML4 Nonpersistant Jquery Test Suite</a></div><div class="adapter"><a href="uncompressed-html4-nonpersistant-mootools.html">History.js Uncompressed HTML4 Nonpersistant Mootools Test Suite</a></div><div class="adapter"><a href="uncompressed-html4-nonpersistant-prototype.html">History.js Uncompressed HTML4 Nonpersistant Prototype Test Suite</a></div><div class="adapter"><a href="uncompressed-html4-nonpersistant-zepto.html">History.js Uncompressed HTML4 Nonpersistant Zepto Test Suite</a></div></div></div></div><div class="compress"><div class="support"><div class="persist"><div class="adapter"><a href="compressed-html5-persistant-jquery.html">History.js Compressed HTML5 Persistant Jquery Test Suite</a></div><div class="adapter"><a href="compressed-html5-persistant-mootools.html">History.js Compressed HTML5 Persistant Mootools Test Suite</a></div><div class="adapter"><a href="compressed-html5-persistant-prototype.html">History.js Compressed HTML5 Persistant Prototype Test Suite</a></div><div class="adapter"><a href="compressed-html5-persistant-zepto.html">History.js Compressed HTML5 Persistant Zepto Test Suite</a></div></div><div class="persist"><div class="adapter"><a href="compressed-html5-nonpersistant-jquery.html">History.js Compressed HTML5 Nonpersistant Jquery Test Suite</a></div><div class="adapter"><a href="compressed-html5-nonpersistant-mootools.html">History.js Compressed HTML5 Nonpersistant Mootools Test Suite</a></div><div class="adapter"><a href="compressed-html5-nonpersistant-prototype.html">History.js Compressed HTML5 Nonpersistant Prototype Test Suite</a></div><div class="adapter"><a href="compressed-html5-nonpersistant-zepto.html">History.js Compressed HTML5 Nonpersistant Zepto Test Suite</a></div></div></div><div class="support"><div class="persist"><div class="adapter"><a href="compressed-html4-persistant-jquery.html">History.js Compressed HTML4 Persistant Jquery Test Suite</a></div><div class="adapter"><a href="compressed-html4-persistant-mootools.html">History.js Compressed HTML4 Persistant Mootools Test Suite</a></div><div class="adapter"><a href="compressed-html4-persistant-prototype.html">History.js Compressed HTML4 Persistant Prototype Test Suite</a></div><div class="adapter"><a href="compressed-html4-persistant-zepto.html">History.js Compressed HTML4 Persistant Zepto Test Suite</a></div></div><div class="persist"><div class="adapter"><a href="compressed-html4-nonpersistant-jquery.html">History.js Compressed HTML4 Nonpersistant Jquery Test Suite</a></div><div class="adapter"><a href="compressed-html4-nonpersistant-mootools.html">History.js Compressed HTML4 Nonpersistant Mootools Test Suite</a></div><div class="adapter"><a href="compressed-html4-nonpersistant-prototype.html">History.js Compressed HTML4 Nonpersistant Prototype Test Suite</a></div><div class="adapter"><a href="compressed-html4-nonpersistant-zepto.html">History.js Compressed HTML4 Nonpersistant Zepto Test Suite</a></div></div></div></div></body>
</html>
View
6 tests/uncompressed-html4-nonpersistant-jquery.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/uncompressed-html4-nonpersistant-jquery.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/uncompressed-html4-nonpersistant-mootools.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/uncompressed-html4-nonpersistant-mootools.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/uncompressed-html4-nonpersistant-prototype.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/uncompressed-html4-nonpersistant-prototype.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/uncompressed-html4-nonpersistant-zepto.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/uncompressed-html4-nonpersistant-zepto.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/uncompressed-html4-persistant-jquery.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/uncompressed-html4-persistant-jquery.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/uncompressed-html4-persistant-mootools.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/uncompressed-html4-persistant-mootools.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/uncompressed-html4-persistant-prototype.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/uncompressed-html4-persistant-prototype.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/uncompressed-html4-persistant-zepto.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/uncompressed-html4-persistant-zepto.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/uncompressed-html5-nonpersistant-jquery.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/uncompressed-html5-nonpersistant-jquery.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/uncompressed-html5-nonpersistant-mootools.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/uncompressed-html5-nonpersistant-mootools.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/uncompressed-html5-nonpersistant-prototype.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/uncompressed-html5-nonpersistant-prototype.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/uncompressed-html5-nonpersistant-zepto.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/uncompressed-html5-nonpersistant-zepto.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/uncompressed-html5-persistant-jquery.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/uncompressed-html5-persistant-jquery.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/uncompressed-html5-persistant-mootools.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/uncompressed-html5-persistant-mootools.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/uncompressed-html5-persistant-prototype.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/uncompressed-html5-persistant-prototype.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
View
6 tests/uncompressed-html5-persistant-zepto.html
@@ -9,8 +9,10 @@
<!-- Check -->
<script>
- var test_url = "http://localhost/products/history.js/tests/uncompressed-html5-persistant-zepto.html";
- if ( window.document.location.href !== test_url && window.document.location.href !== test_url.replace(/\.html/,'') ) {
+ var
+ href = window.document.location.href,
+ test_url = href.replace(/(history\.js\/tests\/[^\/\?\#]+).*/,'$1');
+ if ( test_url !== href ) {
window.document.location.href = test_url;
}
</script>
Please sign in to comment.
Something went wrong with that request. Please try again.