diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-08-25 18:32:14 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-08-25 18:32:14 -0400 |
| commit | 630c08b712a2ace833217428f1ef20bddc0b975d (patch) | |
| tree | 196f58ec99ace6e348148b6d5bc0408a11319fae /public/assets/javascripts/ui/_router.js | |
| parent | a9bf197a6e8f91cc91d772238168d9be1beb3c4d (diff) | |
blueprint integration into project editor
Diffstat (limited to 'public/assets/javascripts/ui/_router.js')
| -rw-r--r-- | public/assets/javascripts/ui/_router.js | 65 |
1 files changed, 41 insertions, 24 deletions
diff --git a/public/assets/javascripts/ui/_router.js b/public/assets/javascripts/ui/_router.js index e5e46e5..61b1d1b 100644 --- a/public/assets/javascripts/ui/_router.js +++ b/public/assets/javascripts/ui/_router.js @@ -18,35 +18,36 @@ var SiteRouter = Router.extend({ }, routes: { - "/": 'home', - "/home": 'home', - "/login": 'signin', - "/signin": 'signin', - "/signup": 'signup', + "/": 'home', + "/home": 'home', + "/login": 'signin', + "/signin": 'signin', + "/signup": 'signup', - "/auth/usernameTaken": 'usernameTaken', - "/auth/password": 'passwordReset', - "/auth/forgotPassword": 'passwordForgot', + "/auth/usernameTaken": 'usernameTaken', + "/auth/password": 'passwordReset', + "/auth/forgotPassword": 'passwordForgot', - "/profile": 'profile', - "/profile/edit": 'editProfile', - "/profile/billing": 'editSubscription', - "/profile/:name": 'profile', - "/about/:name/edit": 'editDocument', - "/about/new": 'newDocument', + "/profile": 'profile', + "/profile/edit": 'editProfile', + "/profile/billing": 'editSubscription', + "/profile/:name": 'profile', + "/about/:name/edit": 'editDocument', + "/about/new": 'newDocument', - "/layout": 'layoutPicker', - "/layout/:name": 'layoutEditor', + "/layout": 'layoutPicker', + "/layout/:name": 'layoutEditor', - "/blueprint": 'blueprintEditor', - "/blueprint/:name": 'blueprintEditor', + "/blueprint": 'blueprintEditor', + "/blueprint/:name": 'blueprintEditor', - "/project": 'projectPicker', - "/project/new": 'newProject', - "/project/new/:layout": 'projectNewWithLayout', - "/project/:name": 'projectViewer', - "/project/:name/edit": 'projectEditor', - "/project/:name/view": 'projectViewer', + "/project": 'projectPicker', + "/project/new": 'newProject', + "/project/blueprint/:blueprint": 'projectNewWithBlueprint', + "/project/new/:layout": 'projectNewWithLayout', + "/project/:name": 'projectViewer', + "/project/:name/edit": 'projectEditor', + "/project/:name/view": 'projectViewer', "/test/blueprint": 'blueprintEditor', }, @@ -123,6 +124,22 @@ var SiteRouter = Router.extend({ window.history.pushState(null, document.title, "/project/new") this.newProjectModal.load() }, + + projectNewWithBlueprint: function(e, blueprint){ + e && e.preventDefault() + + Rooms.shapesMode = true + + app.mode.editor = true + app.launch() + if (app.unsupported) return + + blueprint = slugify(blueprint) + + window.history.pushState(null, document.title, "/project/blueprint/" + blueprint) + this.editorView = app.controller = new EditorView() + this.editorView.loadBlueprint(blueprint) + }, projectNewWithLayout: function(e, layout){ e && e.preventDefault() |
