Merge branch 'master' of github.com:travis-ci/travis-web

This commit is contained in:
Sven Fuchs 2012-11-16 17:43:39 +01:00
commit 6d0cf9d5e6
2 changed files with 29 additions and 18 deletions

View File

@ -77,6 +77,7 @@ Travis.Router = Ember.Router.extend
auth: Ember.Route.extend auth: Ember.Route.extend
route: '/auth' route: '/auth'
customRegexp: /^\/?auth($|\/)/
connectOutlets: (router) -> connectOutlets: (router) ->
router.get('applicationView').connectLayout 'simple' router.get('applicationView').connectLayout 'simple'
$('body').attr('id', 'auth') $('body').attr('id', 'auth')
@ -88,6 +89,7 @@ Travis.Router = Ember.Router.extend
stats: Ember.Route.extend stats: Ember.Route.extend
route: '/stats' route: '/stats'
customRegexp: /^\/?stats($|\/)/
connectOutlets: (router) -> connectOutlets: (router) ->
router.get('applicationView').connectLayout 'simple' router.get('applicationView').connectLayout 'simple'
$('body').attr('id', 'stats') $('body').attr('id', 'stats')

View File

@ -17772,7 +17772,8 @@ Ember.Routable = Ember.Mixin.create({
return Ember._RouteMatcher.create({ return Ember._RouteMatcher.create({
route: route, route: route,
dynamicSegmentPattern: get(this, 'dynamicSegmentPattern'), dynamicSegmentPattern: get(this, 'dynamicSegmentPattern'),
dynamicSegmentTerminators: get(this, 'dynamicSegmentTerminators') dynamicSegmentTerminators: get(this, 'dynamicSegmentTerminators'),
customRegexp: get(this, 'customRegexp')
}); });
} }
}), }),
@ -18160,18 +18161,24 @@ Ember._RouteMatcher = Ember.Object.extend({
state: null, state: null,
init: function() { init: function() {
var route = this.route, var route = this.route;
dynamicSegmentPattern = this.dynamicSegmentPattern || "([^/]+)",
// Strip off leading slash if present
if (route.charAt(0) === '/') {
route = this.route = route.substr(1);
}
if(this.customRegexp) {
this.identifiers = [];
this.regex = this.customRegexp;
} else {
var dynamicSegmentPattern = this.dynamicSegmentPattern || "([^/]+)",
terminators = this.dynamicSegmentTerminators || [], terminators = this.dynamicSegmentTerminators || [],
identifiers = [], identifiers = [],
count = 1, count = 1,
escaped, escaped,
segmentRegexp; segmentRegexp;
// Strip off leading slash if present
if (route.charAt(0) === '/') {
route = this.route = route.substr(1);
}
escaped = escapeForRegex(route); escaped = escapeForRegex(route);
@ -18185,9 +18192,11 @@ Ember._RouteMatcher = Ember.Object.extend({
this.identifiers = identifiers; this.identifiers = identifiers;
this.regex = new RegExp("^/?" + regex); this.regex = new RegExp("^/?" + regex);
}
}, },
match: function(path) { match: function(path) {
console.log(path, this.regex);
var match = path.match(this.regex); var match = path.match(this.regex);
if (match) { if (match) {