diff --git a/dist/pager.min.js b/dist/pager.min.js index 33dad23..ee6a7b6 100644 --- a/dist/pager.min.js +++ b/dist/pager.min.js @@ -1,4 +1,4 @@ /*! pager.js - v0.7.0 - 2013-03-23 * http://oscar.finnsson.nu/pagerjs/ * Copyright (c) 2013 Oscar Finnsson; Licensed MIT */ -(function(e){var t=function(t,n){"use strict";var r=function(e,t){return function(){var r=arguments;return n.computed(function(){return e.apply(t,r)})}},i={};i.page=null,i.now=function(){return Date.now?Date.now():(new Date).valueOf()},i.extendWithPage=function(e){var t=new i.Page;e.$__page__=t,i.page=t};var s=function(e,t,n){n=n||{},n.page=e,i[t].fire(n),e.val(t)&&e.val(t)(n)};t.each(["onBindingError","onSourceError","onNoMatch","beforeRemove","afterRemove","beforeHide","afterHide","beforeShow","afterShow"],function(e,n){i[n]=t.Callbacks()}),i.showChild=function(e){var t=e&&e.length===1&&e[0]===""?[]:e;i.page.showPage(t)},i.getParentPage=function(e){while(e){if(e.$page&&e.$page.val("urlToggle")!=="none")return e.$page;if(e.$data&&e.$data.$__page__)return e.$data.$__page__;e=e.$parentContext}return null};var o=null,u=null,a=function(e){u&&u.reject({cancel:!0}),o=null,e.substring(0,i.Href.hash.length)===i.Href.hash&&(e=e.slice(i.Href.hash.length));var t=f(e);i.showChild(t)};i.goTo=a,i.navigate=function(e){i.useHTML5history?i.Href5.history.pushState(null,null,e):location.hash=e};var f=function(e){return t.map(e.replace(/\+/g," ").split("/"),decodeURIComponent)},l={};l.value=n.utils.unwrapObservable,l.arrayValue=function(e){return t.map(e,function(e){return l.value(e)})};var c=function(e){var t,n={},r=/([^&=]+)=?([^&]*)/g;while(t=r.exec(e))n[t[1]]=t[2];return n},h=function(e){if(!e)return{name:null,params:{}};var t=e.split("?"),n=t[0],r=t[1],i={};return r&&(i=c(r)),{name:n,params:i}};i.ChildManager=function(e,r){this.currentChildO=n.observable(null);var o=this;this.page=r,this.timeStamp=i.now(),this.hideChild=function(){o.currentChild&&o.currentChild.getId()!=="start"&&(o.currentChild.hidePage(function(){}),o.currentChild=null,o.currentChildO(null))},this.showChild=function(n){var r=n.length===0;this.timeStamp=i.now();var u=this.timeStamp,a=o.currentChild;o.currentChild=null;var f=!1,c=h(n[0]),p=c.name,d=null;t.each(e(),function(e,t){if(!f){var n=t.getId(),r=t.getRole();if(n===p||(p===""||p==null)&&(n==="start"||r==="start"))f=!0,o.currentChild=t;n==="?"&&(d=t)}});var v=!1,m=o,g=function(e,t){if(!f){var n=t.getId(),r=t.getValue().modal;if(r){if(n===p||(p===""||p==null)&&n==="start")f=!0,o.currentChild=t,v=!0;n==="?"&&!d&&(d=t,v=!0)}}};while(!o.currentChild&&m.page.parentPage&&!m.page.getValue().modal){var y=m.page.parentPage.children;t.each(y(),g),o.currentChild||(m=m.page.parentPage.childManager)}!o.currentChild&&d&&!r&&(o.currentChild=d),o.currentChild&&(o.currentChildO(o.currentChild),v?o.currentChild.currentParentPage(o.page):o.currentChild.currentParentPage(null));var b=function(){s(o.page,"onNoMatch",{route:n})},w=function(){var e=l.value(o.currentChild.getValue().guard);e?e(o.currentChild,n,function(){o.timeStamp===u&&o.currentChild.showPage(n.slice(1),c,n[0])},a):o.currentChild.showPage(n.slice(1),c,n[0])};a&&a===o.currentChild?w():a?a.hidePage(function(){o.currentChild?w():b()}):o.currentChild?w():b()}},i.Page=function(e,t,r,s,o){this.element=e,this.valueAccessor=t,this.allBindingsAccessor=r,this.viewModel=s,this.bindingContext=o,this.children=n.observableArray([]),this.childManager=new i.ChildManager(this.children,this),this.parentPage=null,this.currentId=null,this.getCurrentId=n.observable(),this.ctx=null,this.currentParentPage=n.observable(null),this.isVisible=n.observable(!1),this.originalRoute=n.observable(null),this.route=null};var p=i.Page.prototype;p.val=function(e){return l.value(this.getValue()[e])},p.currentChildPage=function(){return this.childManager.currentChildO},p.find=function(e){var n=l.value(e),r=this;if(n.substring(0,1)==="/")r=i.page,n=n.slice(1);else while(n.substring(0,3)==="../")r=r.currentParentPage&&r.currentParentPage()?r.currentParentPage():r.parentPage,n=n.slice(3);var s=f(n);return t.each(s,function(e,t){r=r.child(t)()}),r},p.find$=function(e){return r(this.find,this)(e)},p.path=function(e){var n=this,r=l.value(e);if(r&&typeof r=="object"&&r.path&&r.params&&!(r instanceof i.Page)){var s=r.path,o=r.params;return n.path(s)+"?"+t.param(o)}var u;if(r==null||r==="")u=n;else{if(!(r instanceof i.Page)){if(r.substring(0,1)==="/")return i.page.getFullRoute()()+r.substring(1);var a=0;while(r.substring(0,3)==="../")a++,r=r.slice(3);var f=n.getFullRoute()(),c=f.slice(0,f.length-a).join("/"),h=(c===""?"":c+"/")+r;return i.useHTML5history?t("base").attr("href")+h:i.Href.hash+h}u=r}var p=u.getFullRoute()().join("/");return i.useHTML5history?t("base").attr("href")+p:i.Href.hash+p},p.path$=function(e){return r(this.path,this)(e)},p.async=function(e,t,n,r){var s=this;return function(){u&&u.reject({cancel:!0});var a=e();u=a,r&&r(a.state());var f=Math.random();o=f,a.done(function(){r&&r(a.state()),f===o&&i.navigate(s.path(t))}),a.fail(function(e){r&&r(a.state());var t=e&&e.cancel;f===o&&!t&&n&&i.navigate(s.path(n))})}},p.showPage=function(e,t,n){var r=this,i=r.currentId,s=r.pageRoute?r.pageRoute.params:null,o=r.isVisible();r.currentId=t?t.name||"":"",r.getCurrentId(r.currentId),r.isVisible(!0),n&&r.originalRoute(n),r.route=e,r.pageRoute=t,o?(r.getId()==="?"&&i!==r.currentId&&r.show(),t&&s!==t.params&&r.setParams()):(r.setParams(),r.show()),r.childManager.showChild(e)},p.setParams=function(){if(this.pageRoute&&this.pageRoute.params){var e=this.pageRoute.params,r=this.ctx,i=this.val("params")||{};t.isArray(i)?t.each(i,function(t,i){var s=e[i];r[i]?r[i](s):r[i]=n.observable(s)}):t.each(i,function(t,i){var s=e[t],o;s==null?o=l.value(i):o=s,r[t]?r[t](o):r[t]=n.observable(o)})}if(this.pageRoute){var s=this.getValue().nameParam;s&&(typeof s=="string"?this.ctx[s]?this.ctx[s](this.currentId):this.ctx[s]=n.observable(this.currentId):s(this.currentId))}},p.hidePage=function(e){var t=this;"show"!==t.val("urlToggle")?(t.hideElementWrapper(e),t.childManager.hideChild()):e&&e()};var d=function(e){try{n.applyBindingsToDescendants(e.childBindingContext,e.element)}catch(t){s(e,"onBindingError",{error:t})}};p.init=function(){var e=this,r=e.val("urlToggle"),i=e.val("id");i!=="?"&&e.getCurrentId(i);var o=n.utils.domData.get(e.element,"__ko_pagerjsBindingData");if(o)return{controlsDescendantBindings:!0};n.utils.domData.set(e.element,"__ko_pagerjsBindingData",e),n.utils.domNodeDisposal.addDisposeCallback(e.element,function(){s(e,"beforeRemove"),e.parentPage&&e.parentPage.children.remove(e),s(e,"afterRemove")});var u=e.getValue();r!=="none"&&(e.parentPage=e.getParentPage(),e.parentPage.children.push(this),e.hideElement()),e.val("source")&&e.loadSource(e.val("source")),e.ctx=null;if(u.withOnShow)e.ctx={},e.childBindingContext=e.bindingContext.createChildContext(e.ctx),n.utils.extend(e.childBindingContext,{$page:this});else{var a=u["with"]||e.bindingContext.$observableData||e.viewModel;e.ctx=l.value(a),e.augmentContext();if(n.isObservable(a)){var f=n.observable(e.ctx);e.childBindingContext=e.bindingContext.createChildContext(f),n.utils.extend(e.childBindingContext,{$page:this,$observableData:a}),d(e),a.subscribe(function(){f(l.value(a))})}else e.childBindingContext=e.bindingContext.createChildContext(e.ctx),n.utils.extend(e.childBindingContext,{$page:this,$observableData:undefined}),d(e)}if(r!=="none")e.parentPage.route&&e.parentPage.route[0]===e.getId()&&setTimeout(function(){e.parentPage.showPage(e.parentPage.route)},0);else{var c=function(){t(e.element).is(":visible")&&e.showPage([])};setTimeout(c,0),e.getParentPage().isVisible.subscribe(function(e){e&&setTimeout(c,0)})}var h=e.getValue().bind;return n.isObservable(h)&&h(e),{controlsDescendantBindings:!0}},p.augmentContext=function(){var e=this,r=e.val("params");r&&(t.isArray(r)?t.each(r,function(t,r){e.ctx[r]||(e.ctx[r]=n.observable())}):t.each(r,function(t,i){e.ctx[t]||(n.isObservable(i)?e.ctx[t]=i:i===null?(r[t]=n.observable(null),e.ctx[t]=n.observable(null)):e.ctx[t]=n.observable(i))})),this.val("vars")&&t.each(this.val("vars"),function(t,r){n.isObservable(r)?e.ctx[t]=r:e.ctx[t]=n.observable(r)});var i=this.getValue().nameParam;i&&typeof i=="string"&&(e.ctx[i]=n.observable(null)),this.setParams()},p.getValue=function(){return this.valueAccessor?l.value(this.valueAccessor()):{}},p.getParentPage=function(){return i.getParentPage(this.bindingContext)},p.getId=function(){return this.val("id")},p.id=function(){var e=this.getCurrentId();return e==null||e===""?this.getId():e},p.sourceUrl=function(e){var t=this;return this.getId()==="?"?n.computed(function(){var n;return t.val("deep")?n=[t.currentId].concat(t.route).join("/"):n=t.currentId,l.value(e).replace("{1}",n)}):n.computed(function(){return l.value(e)})},p.loadWithOnShow=function(){var e=this;if(!e.withOnShowLoaded||e.val("sourceCache")!==!0)e.withOnShowLoaded=!0,e.val("withOnShow")(function(t){var r=e.bindingContext.createChildContext(t);e.ctx=t,e.childBindingContext=r,e.augmentContext(),n.utils.extend(r,{$page:e}),d(e)},e)},p.loadSource=function(e){var r=this.getValue(),s=this,o=this.element,u=null,a=r.loader||i.loader;if(r.frame==="iframe"){var f=t("iframe",t(o));f.length===0&&(f=t(""),t(o).append(f)),a&&(u=l.value(a)(s,f),u.load()),f.one("load",function(){u&&u.unload(),r.sourceLoaded&&r.sourceLoaded(s)}),n.applyBindingsToNode(f[0],{attr:{src:this.sourceUrl(e)}})}else{a&&(u=l.value(a)(s,s.element),u.load());var c=function(){u&&u.unload(),s.val("withOnShow")?s.val("withOnShow")&&s.loadWithOnShow():d(s),r.sourceLoaded&&r.sourceLoaded(s),s.route&&s.childManager.showChild(s.route)};if(typeof l.value(e)=="string"){var h=l.value(this.sourceUrl(e));m(o,h,function(){c()},s)}else{var p=t(o).children();l.value(e)(this,function(){t.each(p,function(e,t){n.utils.domNodeDisposal.removeNode(t)}),c()})}}};var v=/)<[^<]*)*<\/script>/gi,m=function(e,r,i,o){var u,a,f,l=t(e),c=r.indexOf(" ");c>=0&&(u=r.slice(c,r.length),r=r.slice(0,c));var h=jQuery.ajax({url:r,type:"GET",dataType:"html",complete:function(e,t){i&&l.each(i,f||[e.responseText,t,e])}}).done(function(e){f=arguments,t.each(l.children(),function(e,t){n.utils.domNodeDisposal.removeNode(t)}),l.html(u?jQuery("
").append(e.replace(v,"")).find(u):e)});return h.fail(function(){s(o,"onSourceError",{url:r,xhrPromise:h})}),l};p.show=function(t){var n=this.element,r=this;r.showElementWrapper(t),r.val("title")&&(e.document.title=r.val("title"));if(r.val("sourceOnShow")){if(!r.val("sourceCache")||!n.__pagerLoaded__||typeof r.val("sourceCache")=="number"&&n.__pagerLoaded__+r.val("sourceCache")*1e3"),t(o).append(f)),a&&(u=l.value(a)(s,f),u.load()),f.one("load",function(){u&&u.unload(),r.sourceLoaded&&r.sourceLoaded(s)}),n.applyBindingsToNode(f[0],{attr:{src:this.sourceUrl(e)}})}else{a&&(u=l.value(a)(s,s.element),u.load());var c=function(){u&&u.unload(),s.val("withOnShow")?s.val("withOnShow")&&s.loadWithOnShow():d(s),r.sourceLoaded&&r.sourceLoaded(s),s.route&&s.childManager.showChild(s.route)};if(typeof l.value(e)=="string"){var h=l.value(this.sourceUrl(e));m(o,h,function(){c()},s)}else{var p=t(o).children();l.value(e)(this,function(){t.each(p,function(e,t){n.utils.domNodeDisposal.removeNode(t)}),c()})}}};var v=/)<[^<]*)*<\/script>/gi,m=function(e,r,i,o){var u,a,f,l=t(e),c=r.indexOf(" ");c>=0&&(u=r.slice(c,r.length),r=r.slice(0,c));var h=jQuery.ajax({url:r,type:"GET",dataType:"html",complete:function(e,t){i&&l.each(i,f||[e.responseText,t,e])}}).done(function(e){f=arguments,t.each(l.children(),function(e,t){n.utils.domNodeDisposal.removeNode(t)}),l.html(u?jQuery("
").append(e.replace(v,"")).find(u):e)});return h.fail(function(){s(o,"onSourceError",{url:r,xhrPromise:h})}),l};p.show=function(t){var n=this.element,r=this;r.showElementWrapper(t),r.val("title")&&(e.document.title=r.val("title"));if(r.val("sourceOnShow")){if(!r.val("sourceCache")||!n.__pagerLoaded__||typeof r.val("sourceCache")=="number"&&n.__pagerLoaded__+r.val("sourceCache")*1e3"),t(o).append(f)),a&&(u=l.value(a)(s,f),u.load()),f.one("load",function(){u&&u.unload(),r.sourceLoaded&&r.sourceLoaded(s)}),n.applyBindingsToNode(f[0],{attr:{src:this.sourceUrl(e)}})}else{a&&(u=l.value(a)(s,s.element),u.load());var c=function(){u&&u.unload(),s.val("withOnShow")?s.val("withOnShow")&&s.loadWithOnShow():d(s),r.sourceLoaded&&r.sourceLoaded(s),s.route&&s.childManager.showChild(s.route)};if(typeof l.value(e)=="string"){var h=l.value(this.sourceUrl(e));m(o,h,function(){c()},s)}else{var p=t(o).children();l.value(e)(this,function(){t.each(p,function(e,t){n.utils.domNodeDisposal.removeNode(t)}),c()})}}};var v=/)<[^<]*)*<\/script>/gi,m=function(e,r,i,o){var u,a,f,l=t(e),c=r.indexOf(" ");c>=0&&(u=r.slice(c,r.length),r=r.slice(0,c));var h=jQuery.ajax({url:r,type:"GET",dataType:"html",complete:function(e,t){i&&l.each(i,f||[e.responseText,t,e])}}).done(function(e){f=arguments,t.each(l.children(),function(e,t){n.utils.domNodeDisposal.removeNode(t)}),l.html(u?jQuery("
").append(e.replace(v,"")).find(u):e)});return h.fail(function(){s(o,"onSourceError",{url:r,xhrPromise:h})}),l};p.show=function(t){var n=this.element,r=this;r.showElementWrapper(t),r.val("title")&&(e.document.title=r.val("title"));if(r.val("sourceOnShow")){if(!r.val("sourceCache")||!n.__pagerLoaded__||typeof r.val("sourceCache")=="number"&&n.__pagerLoaded__+r.val("sourceCache")*1e3"),t(o).append(f)),a&&(u=l.value(a)(s,f),u.load()),f.one("load",function(){u&&u.unload(),r.sourceLoaded&&r.sourceLoaded(s)}),n.applyBindingsToNode(f[0],{attr:{src:this.sourceUrl(e)}})}else{a&&(u=l.value(a)(s,s.element),u.load());var c=function(){u&&u.unload(),s.val("withOnShow")?s.val("withOnShow")&&s.loadWithOnShow():d(s),r.sourceLoaded&&r.sourceLoaded(s),s.route&&s.childManager.showChild(s.route)};if(typeof l.value(e)=="string"){var h=l.value(this.sourceUrl(e));m(o,h,function(){c()},s)}else{var p=t(o).children();l.value(e)(this,function(){t.each(p,function(e,t){n.utils.domNodeDisposal.removeNode(t)}),c()})}}};var v=/)<[^<]*)*<\/script>/gi,m=function(e,r,i,o){var u,a,f,l=t(e),c=r.indexOf(" ");c>=0&&(u=r.slice(c,r.length),r=r.slice(0,c));var h=jQuery.ajax({url:r,type:"GET",dataType:"html",complete:function(e,t){i&&l.each(i,f||[e.responseText,t,e])}}).done(function(e){f=arguments,t.each(l.children(),function(e,t){n.utils.domNodeDisposal.removeNode(t)}),l.html(u?jQuery("
").append(e.replace(v,"")).find(u):e)});return h.fail(function(){s(o,"onSourceError",{url:r,xhrPromise:h})}),l};p.show=function(t){var n=this.element,r=this;r.showElementWrapper(t),r.val("title")&&(e.document.title=r.val("title"));if(r.val("sourceOnShow")){if(!r.val("sourceCache")||!n.__pagerLoaded__||typeof r.val("sourceCache")=="number"&&n.__pagerLoaded__+r.val("sourceCache")*1e3 diff --git a/test/should_access_uri_parameters_as_object.html b/test/should_access_uri_parameters_as_object.html index caf770d..2244dd3 100644 --- a/test/should_access_uri_parameters_as_object.html +++ b/test/should_access_uri_parameters_as_object.html @@ -31,7 +31,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_allow_params_in_href.html b/test/should_allow_params_in_href.html index 91d0a61..a772dbf 100644 --- a/test/should_allow_params_in_href.html +++ b/test/should_allow_params_in_href.html @@ -41,7 +41,7 @@ ko.applyBindings(viewModel, $('#a')[0]); ko.applyBindings(vm2, $('#b')[0]); - pager.startHashChange(); + pager.start(); } catch (e) { console.error(e); } diff --git a/test/should_apply_nameParam_to_new_context.html b/test/should_apply_nameParam_to_new_context.html index 9553ab8..864d3c4 100644 --- a/test/should_apply_nameParam_to_new_context.html +++ b/test/should_apply_nameParam_to_new_context.html @@ -44,7 +44,7 @@

Page is visible

pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_be_possible_to_do_deep_navigation.html b/test/should_be_possible_to_do_deep_navigation.html index b24542b..6a24bab 100644 --- a/test/should_be_possible_to_do_deep_navigation.html +++ b/test/should_be_possible_to_do_deep_navigation.html @@ -32,7 +32,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_be_possible_to_load_content_info_iframes.html b/test/should_be_possible_to_load_content_info_iframes.html index daf0d80..65a4af4 100644 --- a/test/should_be_possible_to_load_content_info_iframes.html +++ b/test/should_be_possible_to_load_content_info_iframes.html @@ -37,7 +37,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_be_possible_to_prevent_navigation.html b/test/should_be_possible_to_prevent_navigation.html index 8483baa..79d821f 100644 --- a/test/should_be_possible_to_prevent_navigation.html +++ b/test/should_be_possible_to_prevent_navigation.html @@ -34,7 +34,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_bind_page_in_view_model.html b/test/should_bind_page_in_view_model.html index 257fd2d..6d2d825 100644 --- a/test/should_bind_page_in_view_model.html +++ b/test/should_bind_page_in_view_model.html @@ -41,7 +41,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); VM = viewModel; diff --git a/test/should_bind_page_using_bind.html b/test/should_bind_page_using_bind.html index f629940..a364939 100644 --- a/test/should_bind_page_using_bind.html +++ b/test/should_bind_page_using_bind.html @@ -31,7 +31,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_bind_wildcard_to_observable.html b/test/should_bind_wildcard_to_observable.html index f13a27b..2d2a2d0 100644 --- a/test/should_bind_wildcard_to_observable.html +++ b/test/should_bind_wildcard_to_observable.html @@ -32,7 +32,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_cache_lazy_loaded_content_when_sourcecache_true.html b/test/should_cache_lazy_loaded_content_when_sourcecache_true.html index 849ab2f..5e5a8d5 100644 --- a/test/should_cache_lazy_loaded_content_when_sourcecache_true.html +++ b/test/should_cache_lazy_loaded_content_when_sourcecache_true.html @@ -32,7 +32,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_change_binding_context_using_with.html b/test/should_change_binding_context_using_with.html index bad484b..e0bab95 100644 --- a/test/should_change_binding_context_using_with.html +++ b/test/should_change_binding_context_using_with.html @@ -35,7 +35,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_change_binding_context_using_with_workaround.html b/test/should_change_binding_context_using_with_workaround.html index 492851d..ce45592 100644 --- a/test/should_change_binding_context_using_with_workaround.html +++ b/test/should_change_binding_context_using_with_workaround.html @@ -37,7 +37,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_deep_load_content.html b/test/should_deep_load_content.html index def8865..103cf77 100644 --- a/test/should_deep_load_content.html +++ b/test/should_deep_load_content.html @@ -42,7 +42,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_deep_route_external_content.html b/test/should_deep_route_external_content.html index 857c647..92d251d 100644 --- a/test/should_deep_route_external_content.html +++ b/test/should_deep_route_external_content.html @@ -27,7 +27,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_display_multiple_pages_using_url_toggle_none.html b/test/should_display_multiple_pages_using_url_toggle_none.html index c34ae36..8dc823e 100644 --- a/test/should_display_multiple_pages_using_url_toggle_none.html +++ b/test/should_display_multiple_pages_using_url_toggle_none.html @@ -48,7 +48,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_display_multiple_pages_using_url_toggle_show.html b/test/should_display_multiple_pages_using_url_toggle_show.html index 8f01f04..33b33d4 100644 --- a/test/should_display_multiple_pages_using_url_toggle_show.html +++ b/test/should_display_multiple_pages_using_url_toggle_show.html @@ -39,7 +39,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_display_page_with_id_start_by_default.html b/test/should_display_page_with_id_start_by_default.html index c253ae5..c7cfb2e 100644 --- a/test/should_display_page_with_id_start_by_default.html +++ b/test/should_display_page_with_id_start_by_default.html @@ -24,7 +24,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_display_role_start.html b/test/should_display_role_start.html index f5498b4..304d019 100644 --- a/test/should_display_role_start.html +++ b/test/should_display_role_start.html @@ -39,7 +39,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); VM = viewModel; diff --git a/test/should_dispose_page_before_loading_new.html b/test/should_dispose_page_before_loading_new.html index 471e311..318cb37 100644 --- a/test/should_dispose_page_before_loading_new.html +++ b/test/should_dispose_page_before_loading_new.html @@ -31,7 +31,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_dispose_page_before_loading_new_with_lazy_vm.html b/test/should_dispose_page_before_loading_new_with_lazy_vm.html index 2bc107d..d166652 100644 --- a/test/should_dispose_page_before_loading_new_with_lazy_vm.html +++ b/test/should_dispose_page_before_loading_new_with_lazy_vm.html @@ -42,7 +42,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_do_deep_navigation_with_wildcards.html b/test/should_do_deep_navigation_with_wildcards.html index ae9e160..9c26028 100644 --- a/test/should_do_deep_navigation_with_wildcards.html +++ b/test/should_do_deep_navigation_with_wildcards.html @@ -36,7 +36,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_find_relative_and_absolute_page.html b/test/should_find_relative_and_absolute_page.html index 53d96aa..eb4746f 100644 --- a/test/should_find_relative_and_absolute_page.html +++ b/test/should_find_relative_and_absolute_page.html @@ -56,7 +56,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_introduce_view_observables_using_var.html b/test/should_introduce_view_observables_using_var.html index dcb8c97..9567a2c 100644 --- a/test/should_introduce_view_observables_using_var.html +++ b/test/should_introduce_view_observables_using_var.html @@ -52,7 +52,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_lazy_load_an_external_content_into_a_page_if_sourceonshow_is_declared.html b/test/should_lazy_load_an_external_content_into_a_page_if_sourceonshow_is_declared.html index 0a2e735..81ae0ab 100644 --- a/test/should_lazy_load_an_external_content_into_a_page_if_sourceonshow_is_declared.html +++ b/test/should_lazy_load_an_external_content_into_a_page_if_sourceonshow_is_declared.html @@ -28,7 +28,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_lazy_load_child.html b/test/should_lazy_load_child.html index 0be2f55..0ccf53a 100644 --- a/test/should_lazy_load_child.html +++ b/test/should_lazy_load_child.html @@ -39,7 +39,7 @@ var viewModel = {}; pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_lazy_load_child_with_lazy_view_model.html b/test/should_lazy_load_child_with_lazy_view_model.html index 2bceff2..2476189 100644 --- a/test/should_lazy_load_child_with_lazy_view_model.html +++ b/test/should_lazy_load_child_with_lazy_view_model.html @@ -58,7 +58,7 @@ var viewModel = {}; pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_load_external_content_into_a_page_using_source_and_trigger_sourceloaded_event.html b/test/should_load_external_content_into_a_page_using_source_and_trigger_sourceloaded_event.html index 2abdb94..da7bde6 100644 --- a/test/should_load_external_content_into_a_page_using_source_and_trigger_sourceloaded_event.html +++ b/test/should_load_external_content_into_a_page_using_source_and_trigger_sourceloaded_event.html @@ -35,7 +35,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_load_wildcard_dolor_then_ipsum_on_load.html b/test/should_load_wildcard_dolor_then_ipsum_on_load.html index 22c3f95..c3babbd 100644 --- a/test/should_load_wildcard_dolor_then_ipsum_on_load.html +++ b/test/should_load_wildcard_dolor_then_ipsum_on_load.html @@ -27,7 +27,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_match_wildcard_ids_if_no_other_id_can_match_exactly.html b/test/should_match_wildcard_ids_if_no_other_id_can_match_exactly.html index 3c9c50d..3bbe9d9 100644 --- a/test/should_match_wildcard_ids_if_no_other_id_can_match_exactly.html +++ b/test/should_match_wildcard_ids_if_no_other_id_can_match_exactly.html @@ -24,7 +24,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_navigate_to_id_supplied_to_start.html b/test/should_navigate_to_id_supplied_to_start.html index c71a22b..053af94 100644 --- a/test/should_navigate_to_id_supplied_to_start.html +++ b/test/should_navigate_to_id_supplied_to_start.html @@ -28,7 +28,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange('test'); + pager.start('test'); diff --git a/test/should_navigate_to_page_using_scoped_ids.html b/test/should_navigate_to_page_using_scoped_ids.html index 5a4eb30..21523aa 100644 --- a/test/should_navigate_to_page_using_scoped_ids.html +++ b/test/should_navigate_to_page_using_scoped_ids.html @@ -24,7 +24,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_not_bind_multiple_times.html b/test/should_not_bind_multiple_times.html index cc2f15d..7482a11 100644 --- a/test/should_not_bind_multiple_times.html +++ b/test/should_not_bind_multiple_times.html @@ -65,7 +65,7 @@ pager.extendWithPage(vm); ko.applyBindings(vm); - pager.startHashChange(); + pager.start(); diff --git a/test/should_not_trigger_aftershow_on_child.html b/test/should_not_trigger_aftershow_on_child.html index 84b5625..2401035 100644 --- a/test/should_not_trigger_aftershow_on_child.html +++ b/test/should_not_trigger_aftershow_on_child.html @@ -47,7 +47,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_parse_hash_with_slash.html b/test/should_parse_hash_with_slash.html index e2cdf7f..d570ca6 100644 --- a/test/should_parse_hash_with_slash.html +++ b/test/should_parse_hash_with_slash.html @@ -32,7 +32,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_react_to_added_and_removed_child_page.html b/test/should_react_to_added_and_removed_child_page.html index 0124678..8c0a917 100644 --- a/test/should_react_to_added_and_removed_child_page.html +++ b/test/should_react_to_added_and_removed_child_page.html @@ -39,7 +39,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_remove_children.html b/test/should_remove_children.html index 86ecdf0..f3e65ba 100644 --- a/test/should_remove_children.html +++ b/test/should_remove_children.html @@ -28,7 +28,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_resolve_wildcards_in_parents.html b/test/should_resolve_wildcards_in_parents.html index 7f057c5..850abf6 100644 --- a/test/should_resolve_wildcards_in_parents.html +++ b/test/should_resolve_wildcards_in_parents.html @@ -42,7 +42,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_send_wildcard_id_on_load.html b/test/should_send_wildcard_id_on_load.html index b67775b..ca0d646 100644 --- a/test/should_send_wildcard_id_on_load.html +++ b/test/should_send_wildcard_id_on_load.html @@ -28,7 +28,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_send_wildcards_to_source.html b/test/should_send_wildcards_to_source.html index dd8ce5a..d0a4ccf 100644 --- a/test/should_send_wildcards_to_source.html +++ b/test/should_send_wildcards_to_source.html @@ -36,7 +36,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_show_child_that is_data_bound_later.html b/test/should_show_child_that is_data_bound_later.html index 989e354..4fd0851 100644 --- a/test/should_show_child_that is_data_bound_later.html +++ b/test/should_show_child_that is_data_bound_later.html @@ -29,7 +29,7 @@

pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_show_modal.html b/test/should_show_modal.html index 7460cf0..d1d4926 100644 --- a/test/should_show_modal.html +++ b/test/should_show_modal.html @@ -37,7 +37,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_specify_relative_page_paths_using_page_href.html b/test/should_specify_relative_page_paths_using_page_href.html index 1f02105..10027bc 100644 --- a/test/should_specify_relative_page_paths_using_page_href.html +++ b/test/should_specify_relative_page_paths_using_page_href.html @@ -33,7 +33,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_support_async_jump.html b/test/should_support_async_jump.html index 89f4cbc..c73643c 100644 --- a/test/should_support_async_jump.html +++ b/test/should_support_async_jump.html @@ -80,7 +80,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_take_page_instance_in_page_href_binding.html b/test/should_take_page_instance_in_page_href_binding.html index e8f1a0e..f24ff87 100644 --- a/test/should_take_page_instance_in_page_href_binding.html +++ b/test/should_take_page_instance_in_page_href_binding.html @@ -49,7 +49,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_trigger_before_after_hide_show.html b/test/should_trigger_before_after_hide_show.html index df01417..54f1c20 100644 --- a/test/should_trigger_before_after_hide_show.html +++ b/test/should_trigger_before_after_hide_show.html @@ -55,7 +55,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_trigger_before_remove_and_after_remove.html b/test/should_trigger_before_remove_and_after_remove.html index 2acd3c0..da8d8b0 100644 --- a/test/should_trigger_before_remove_and_after_remove.html +++ b/test/should_trigger_before_remove_and_after_remove.html @@ -38,7 +38,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); VM = viewModel; diff --git a/test/should_trigger_hide_in_sub_pages.html b/test/should_trigger_hide_in_sub_pages.html index dd39f5a..db3b5f0 100644 --- a/test/should_trigger_hide_in_sub_pages.html +++ b/test/should_trigger_hide_in_sub_pages.html @@ -48,7 +48,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); asyncTest("Should trigger hide in sub pages", function () { diff --git a/test/should_trigger_navigation_failed.html b/test/should_trigger_navigation_failed.html index 84f27c0..ae69f93 100644 --- a/test/should_trigger_navigation_failed.html +++ b/test/should_trigger_navigation_failed.html @@ -75,7 +75,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); pager.onNoMatch.add(function(op) { var page = op.page; diff --git a/test/should_trigger_onbindingerror.html b/test/should_trigger_onbindingerror.html index e25c7b5..96e6c63 100644 --- a/test/should_trigger_onbindingerror.html +++ b/test/should_trigger_onbindingerror.html @@ -37,7 +37,7 @@ }); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_trigger_onsourceerror.html b/test/should_trigger_onsourceerror.html index a623ac7..049a6ba 100644 --- a/test/should_trigger_onsourceerror.html +++ b/test/should_trigger_onsourceerror.html @@ -37,7 +37,7 @@ }); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_update_withOnShow_binding_when_vm_is_changed.html b/test/should_update_withOnShow_binding_when_vm_is_changed.html index 7bf31ad..f8115d8 100644 --- a/test/should_update_withOnShow_binding_when_vm_is_changed.html +++ b/test/should_update_withOnShow_binding_when_vm_is_changed.html @@ -32,7 +32,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_update_with_binding_when_vm_is_changed.html b/test/should_update_with_binding_when_vm_is_changed.html index 8c668e8..8055739 100644 --- a/test/should_update_with_binding_when_vm_is_changed.html +++ b/test/should_update_with_binding_when_vm_is_changed.html @@ -35,7 +35,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/should_use_hash_bang.html b/test/should_use_hash_bang.html index 608ddbb..ef95f92 100644 --- a/test/should_use_hash_bang.html +++ b/test/should_use_hash_bang.html @@ -27,7 +27,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); diff --git a/test/withonshow_should_lazy_bind_a_new_view_model_to_the_page.html b/test/withonshow_should_lazy_bind_a_new_view_model_to_the_page.html index 711aed4..22cb98a 100644 --- a/test/withonshow_should_lazy_bind_a_new_view_model_to_the_page.html +++ b/test/withonshow_should_lazy_bind_a_new_view_model_to_the_page.html @@ -50,7 +50,7 @@ pager.extendWithPage(viewModel); ko.applyBindings(viewModel); - pager.startHashChange(); + pager.start(); });