bitovi/canjs — pull request #652 by stevenvachon (2014-01-08 03:38:57+00:00)
Title: links parent to pushstate root now non-routes

if you have a pushstate root of "/app/" and you have a link within your app pointing to "/other/", it should not be treated as a route, even if on the same host.

```javascript
function test()
{
var pushStateRoot = can.route.bindings.pushstate.root;

console.log(pushStateRoot);

$("a").each(function()
{
// from https://github.com/bitovi/canjs/blob/v2.0.4/route/pushstate/pushstate.js#L93
var sameHost = (window.location.host == this.host);

var isDescendant = (this.pathname.indexOf(pushStateRoot) == 0);

var log = {
href: this.href,

IS_ROUTE_OLD: sameHost,
IS_ROUTE_NEW: (sameHost && isDescendant)
};

if (log.IS_ROUTE_NEW)
{
log.params = can.route.deparam(this.pathname)
}

console.log(log);
});

console.log("===========================");
}

$("body").append('')	// should pass test1 and 2
.append('')	// should pass test1
.append('')	// should always fail
.append('');	// should pass test1

can.route("", {parent:""});
can.route(":parent/");
can.route(":parent/:child/");

// TEST 1
can.route.bindings.pushstate.root = "/app/";
can.route.ready();
test();

// TEST 2
can.route.bindings.pushstate.root = "/app/app/";
can.route.ready();
test();
```

I still have to learn how to use the official `test()`.