29:716c65abb699
Anton Shestakov <engored@ya.ru>, Fri, 11 Jan 2013 17:34:22 +0900
Added tag 0.2.2 for changeset ccae9f5abc14

next change 148:7a236aa969f8
previous change 8:39ac2486b9d3

static/js/framework/router.js

Permissions: -rw-r--r--

Other formats: Feeds:
var Router = Backbone.Router.extend({
routes: {
'': 'randomize',
':workspace': 'setWorkspace'
},
makeRandomString: function(length) {
return _.map(_.range(length), function() {
return (Math.random()*16|0).toString(16);
}).join('');
},
randomize: function() {
var randomString = this.makeRandomString(8);
this.navigate(randomString, {trigger: true, replace: true});
},
setWorkspace: function(workspace) {
fruitbar.trigger('workspace', workspace);
}
});