parent
0843db468e
commit
126ced4383
2 changed files with 18 additions and 3 deletions
|
|
@ -21,9 +21,14 @@ app.Router = Backbone.Router.extend({
|
|||
"people/:id/photos": "photos",
|
||||
|
||||
"people/:id": "stream",
|
||||
"u/:name": "stream",
|
||||
|
||||
"bookmarklet": "bookmarklet"
|
||||
"u/:name": "stream"
|
||||
},
|
||||
|
||||
initialize: function() {
|
||||
// To support encoded linefeeds (%0A) we need to specify
|
||||
// our own internal router.route call with the correct regexp.
|
||||
// see: https://github.com/diaspora/diaspora/issues/4994#issuecomment-46431124
|
||||
this.route(/^bookmarklet(?:\?(.*))?/, "bookmarklet");
|
||||
},
|
||||
|
||||
help: function() {
|
||||
|
|
|
|||
|
|
@ -69,4 +69,14 @@ describe('app.Router', function () {
|
|||
expect(hideFollowedTags).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe("bookmarklet", function() {
|
||||
it('routes to bookmarklet even if params have linefeeds', function() {
|
||||
router = new app.Router();
|
||||
var route = jasmine.createSpy('bookmarklet route');
|
||||
router.on('route:bookmarklet', route);
|
||||
router.navigate("/bookmarklet?\n\nfeefwefwewef\n", {trigger: true});
|
||||
expect(route).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue