From 221a14315b09946db2485036bbf4a80295dc4889 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 2 Jul 2014 16:22:51 -0400 Subject: password reset / username dupe stuff from PH --- views/partials/sign-in.ejs | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) (limited to 'views/partials/sign-in.ejs') diff --git a/views/partials/sign-in.ejs b/views/partials/sign-in.ejs index 3341aec..11b930f 100644 --- a/views/partials/sign-in.ejs +++ b/views/partials/sign-in.ejs @@ -74,4 +74,79 @@ +
+
+
+
  • + Forgot your password? Enter the email address you used to sign up + and we can reset it for you. +
  • +
  • + +
    + +
    +
  • +
  • + +
  • +
    +
    There was a problem with your submission:
    +
    +
    +
    +
    +
    + +
    +
    +
    + + Please reset your password. +

    +
  • + +
    + +
    +
  • +
  • + +
    + +
    +
  • +
  • + +
  • +
    +
    +
    +
    +
    +
    + +
    +
    +
    + We're sorry, the username [[- username ]] is already being used. +

    + Please choose another username. +

    +
  • + +
    + +
    +
  • +
  • + +
  • +
    +
    +
    +
    +
    +
    + [[ } ]] -- cgit v1.2.3-70-g09d2 From 544ee1236d188f1d24654817481abcf8d078facd Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 2 Jul 2014 17:37:13 -0400 Subject: password reset email; also sends email --- package.json | 3 ++- .../assets/javascripts/mx/primitives/mx.youtube.js | 2 +- public/assets/javascripts/ui/_router.js | 21 +++++++++++++++++++++ public/assets/javascripts/ui/site/PasswordForgot.js | 2 +- public/assets/javascripts/ui/site/PasswordReset.js | 6 ++++++ public/assets/javascripts/ui/site/UsernameTaken.js | 6 ++++++ public/assets/stylesheets/app.css | 4 +++- server/index.js | 4 ++-- server/lib/auth/views.js | 2 +- server/lib/util.js | 2 +- views/modal.ejs | 1 + views/partials/sign-in.ejs | 12 ++++++++---- 12 files changed, 53 insertions(+), 12 deletions(-) (limited to 'views/partials/sign-in.ejs') diff --git a/package.json b/package.json index 95af2ab..ca45bff 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,8 @@ "html-entities": "~1.0.10", "multer": "~0.1.0", "body-parser": "1.3.0", - "marked": "~0.3.2" + "marked": "~0.3.2", + "emailjs": "~0.3.6" }, "devDependencies": { "grunt": "~0.4.1", diff --git a/public/assets/javascripts/mx/primitives/mx.youtube.js b/public/assets/javascripts/mx/primitives/mx.youtube.js index 3662d7b..b1d3dfb 100644 --- a/public/assets/javascripts/mx/primitives/mx.youtube.js +++ b/public/assets/javascripts/mx/primitives/mx.youtube.js @@ -120,5 +120,5 @@ MX.Youtube = MX.Object3D.extend({ }) window.onYouTubePlayerAPIReady = function(){ - console.log("youtube ready") + // console.log("youtube ready") } diff --git a/public/assets/javascripts/ui/_router.js b/public/assets/javascripts/ui/_router.js index 6d41d5b..fdeafd5 100644 --- a/public/assets/javascripts/ui/_router.js +++ b/public/assets/javascripts/ui/_router.js @@ -5,6 +5,7 @@ var SiteRouter = Router.extend({ events: { "click [data-role='show-signup-modal']": 'signup', "click [data-role='show-signin-modal']": 'signin', + "click [data-role='forgot-password']": 'passwordForgot', "click [data-role='new-project-modal']": 'newProject', "click [data-role='edit-project-modal']": 'editProject', "click [data-role='edit-profile-modal']": 'editProfile', @@ -18,6 +19,11 @@ var SiteRouter = Router.extend({ routes: { "/login": 'signin', "/signup": 'signup', + + "/auth/usernameTaken": 'usernameTaken', + "/auth/password": 'passwordReset', + "/auth/forgotPassword": 'passwordForgot', + "/profile": 'profile', "/profile/edit": 'editProfile', "/about/:name/edit": 'editDocument', @@ -40,6 +46,7 @@ var SiteRouter = Router.extend({ this.newProjectModal = new NewProjectModal() this.editProjectModal = new EditProjectModal() this.editProfileModal = new EditProfileModal() + this.passwordForgotModal = new PasswordForgot() this.documentModal = new DocumentModal() this.route() @@ -122,6 +129,20 @@ var SiteRouter = Router.extend({ this.signInModal.load() }, + usernameTaken: function(e){ + this.usernameTakenModal = new UsernameTaken () + this.usernameTakenModal.load() + }, + passwordForgot: function(e){ + e && e.preventDefault() + window.history.pushState(null, document.title, "/auth/forgotPassword") + this.passwordForgotModal.load() + }, + passwordReset: function(e){ + this.passwordResetModal = new PasswordReset () + this.passwordResetModal.load() + }, + profile: function(e){ var classes = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', diff --git a/public/assets/javascripts/ui/site/PasswordForgot.js b/public/assets/javascripts/ui/site/PasswordForgot.js index 6ac23c0..ecbfc07 100644 --- a/public/assets/javascripts/ui/site/PasswordForgot.js +++ b/public/assets/javascripts/ui/site/PasswordForgot.js @@ -1,6 +1,6 @@ var PasswordForgot = ModalFormView.extend({ el: ".mediaDrawer.passwordForgot", - action: "/auth/passwordForgot", + action: "/auth/forgotPassword", validate: function(){ var errors = [] diff --git a/public/assets/javascripts/ui/site/PasswordReset.js b/public/assets/javascripts/ui/site/PasswordReset.js index 77e8684..9b87d37 100644 --- a/public/assets/javascripts/ui/site/PasswordReset.js +++ b/public/assets/javascripts/ui/site/PasswordReset.js @@ -2,6 +2,12 @@ var PasswordReset = ModalFormView.extend({ el: ".mediaDrawer.passwordReset", action: "/auth/password", + load: function(){ + var opt = JSON.parse( $("#opt").html() ) + this.$("[name=nonce]").val( opt.nonce ) + this.__super__.load.call(this) + }, + validate: function(){ var errors = [] diff --git a/public/assets/javascripts/ui/site/UsernameTaken.js b/public/assets/javascripts/ui/site/UsernameTaken.js index fc651e3..fc9f50a 100644 --- a/public/assets/javascripts/ui/site/UsernameTaken.js +++ b/public/assets/javascripts/ui/site/UsernameTaken.js @@ -2,6 +2,12 @@ var UsernameTaken = ModalFormView.extend({ el: ".mediaDrawer.usernameTaken", action: "/auth/usernameTaken", + load: function(){ + var opt = JSON.parse( $("#opt").html() ) + this.$("#usernameThatIsTaken").html( opt.username ) + this.__super__.load.call(this) + }, + validate: function(){ var errors = [] diff --git a/public/assets/stylesheets/app.css b/public/assets/stylesheets/app.css index 9c80987..937e5c4 100755 --- a/public/assets/stylesheets/app.css +++ b/public/assets/stylesheets/app.css @@ -729,8 +729,10 @@ h5 { -webkit-transform:translateY(0%); transform:translateY(0%); } +.mediaDrawer.table, .mediaDrawer.error, .mediaDrawer.signin, .mediaDrawer.signup, -.mediaDrawer.alert, .mediaDrawer.confirm, .mediaDrawer.error, +.mediaDrawer.alert, .mediaDrawer.confirm, +.mediaDrawer.passwordForgot, .mediaDrawer.passwordReset, .mediaDrawer.usernameTaken, .mediaDrawer.layouts, .mediaDrawer.projects, .mediaDrawer.newProject { display:table; } diff --git a/server/index.js b/server/index.js index 4b628e4..1db7e04 100644 --- a/server/index.js +++ b/server/index.js @@ -92,8 +92,8 @@ site.route = function () { app.post('/auth/usernameTaken', auth.usernameFixed); app.get('/auth/password', auth.views.resetPassword); app.post('/auth/password', auth.resetPassword); - app.post('/auth/passwordForgot', auth.forgotPassword); - + app.get('/auth/forgotPassword', views.modal); + app.post('/auth/forgotPassword', auth.forgotPassword); app.get('/profile', views.profile) app.get('/profile/edit', views.profile) diff --git a/server/lib/auth/views.js b/server/lib/auth/views.js index 591b06a..cd31248 100644 --- a/server/lib/auth/views.js +++ b/server/lib/auth/views.js @@ -26,7 +26,7 @@ views.resetPassword = function (req, res) { if (err || ! user) { return res.redirect("/") } - res.render("reset-password", { username: user.username, nonce: user.passwordNonce }) + res.render("modal", { opt: { username: user.username, nonce: user.passwordNonce } }) }) } diff --git a/server/lib/util.js b/server/lib/util.js index 6604abe..87e2d54 100644 --- a/server/lib/util.js +++ b/server/lib/util.js @@ -25,7 +25,7 @@ util.capitalize = function (s) { util.capitalizeWord = function (s) { return s.charAt(0).toUpperCase() + s.slice(1); } -util.escapeRegExp: function (s) { +util.escapeRegExp = function (s) { return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") } diff --git a/views/modal.ejs b/views/modal.ejs index 4550aff..6ed3fa1 100644 --- a/views/modal.ejs +++ b/views/modal.ejs @@ -19,5 +19,6 @@ [[ include partials/scripts ]] + diff --git a/views/partials/sign-in.ejs b/views/partials/sign-in.ejs index 11b930f..3f05fff 100644 --- a/views/partials/sign-in.ejs +++ b/views/partials/sign-in.ejs @@ -27,7 +27,8 @@


    - Make a new account + Make a new account
    + Forgot your password? @@ -74,9 +75,11 @@ -
    +
    + X
    +
  • Forgot your password? Enter the email address you used to sign up and we can reset it for you. @@ -98,9 +101,10 @@
  • -
    +
    + Please reset your password.

    @@ -129,7 +133,7 @@
    - We're sorry, the username [[- username ]] is already being used. + We're sorry, the username is already being used.

    Please choose another username.

    -- cgit v1.2.3-70-g09d2 From e17d458b644fddccd522d0475f531b487c4d95ef Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 16 Jul 2014 15:29:10 -0400 Subject: some bugfixes.. info window for builder --- .../assets/javascripts/mx/primitives/mx.video.js | 2 +- .../assets/javascripts/mx/primitives/mx.vimeo.js | 10 ++++++- .../assets/javascripts/mx/primitives/mx.youtube.js | 2 +- .../javascripts/rectangles/engine/rooms/builder.js | 4 +-- .../javascripts/rectangles/engine/rooms/clipper.js | 7 +++-- .../rectangles/engine/scenery/types/video.js | 3 ++ public/assets/javascripts/ui/_router.js | 1 - public/assets/javascripts/ui/reader/ReaderView.js | 3 ++ public/assets/javascripts/ui/site/LayoutsModal.js | 7 +++++ public/assets/stylesheets/app.css | 25 +++++++++++++++- views/builder.ejs | 3 +- views/controls/builder/info.ejs | 35 ++++++++++++++++++++++ views/controls/editor/media-editor.ejs | 4 +-- views/partials/sign-in.ejs | 4 +-- views/projects/layouts-modal.ejs | 8 +++++ views/projects/list-projects.ejs | 2 +- 16 files changed, 105 insertions(+), 15 deletions(-) create mode 100644 views/controls/builder/info.ejs (limited to 'views/partials/sign-in.ejs') diff --git a/public/assets/javascripts/mx/primitives/mx.video.js b/public/assets/javascripts/mx/primitives/mx.video.js index 7f91e34..b28204d 100644 --- a/public/assets/javascripts/mx/primitives/mx.video.js +++ b/public/assets/javascripts/mx/primitives/mx.video.js @@ -20,7 +20,7 @@ MX.Video = MX.Object3D.extend({ this.backface && this.el.classList.add("backface-visible") this.el.classList.add("video") this.paused = !! this.media.autoplay - this.muted = !! this.media.mute + this.muted = app.muted || !! this.media.mute this.load() }, diff --git a/public/assets/javascripts/mx/primitives/mx.vimeo.js b/public/assets/javascripts/mx/primitives/mx.vimeo.js index 0301e64..7a5327e 100644 --- a/public/assets/javascripts/mx/primitives/mx.vimeo.js +++ b/public/assets/javascripts/mx/primitives/mx.vimeo.js @@ -20,7 +20,7 @@ MX.Vimeo = MX.Object3D.extend({ this.backface && this.el.classList.add("backface-visible") this.el.classList.add("video") this.paused = !! this.media.autoplay - this.muted = !! this.media.mute + this.muted = app.muted || !! this.media.mute this.load() }, @@ -82,6 +82,14 @@ MX.Vimeo = MX.Object3D.extend({ }, seek: function(n){ + // defer seek until we have duration + if (! this.duration()) { + setTimeout(function(){ + this.seek(n) + }.bind(this), 300) + return + } + if (n < 1) { n = n * this.duration() } diff --git a/public/assets/javascripts/mx/primitives/mx.youtube.js b/public/assets/javascripts/mx/primitives/mx.youtube.js index 8c11da6..47d5507 100644 --- a/public/assets/javascripts/mx/primitives/mx.youtube.js +++ b/public/assets/javascripts/mx/primitives/mx.youtube.js @@ -20,7 +20,7 @@ MX.Youtube = MX.Object3D.extend({ this.backface && this.el.classList.add("backface-visible") this.el.classList.add("video") this.paused = !! this.media.autoplay - this.muted = !! this.media.mute + this.muted = app.muted || !! this.media.mute this.load() }, diff --git a/public/assets/javascripts/rectangles/engine/rooms/builder.js b/public/assets/javascripts/rectangles/engine/rooms/builder.js index e6625ec..49e55dc 100644 --- a/public/assets/javascripts/rectangles/engine/rooms/builder.js +++ b/public/assets/javascripts/rectangles/engine/rooms/builder.js @@ -20,8 +20,8 @@ Rooms.builder = new function(){ } } function build (){ - Rooms.regions.forEach(function(room){ - build_walls(room).forEach(function(el){ + Rooms.regions.forEach(function(region){ + build_walls(region).forEach(function(el){ els.push(el) scene.add(el) }) diff --git a/public/assets/javascripts/rectangles/engine/rooms/clipper.js b/public/assets/javascripts/rectangles/engine/rooms/clipper.js index eb467cd..e2bb894 100644 --- a/public/assets/javascripts/rectangles/engine/rooms/clipper.js +++ b/public/assets/javascripts/rectangles/engine/rooms/clipper.js @@ -20,12 +20,15 @@ Rooms.clipper = new function(){ // Given a set of overlapping rooms, clip any intersections, then cull any duplicate polygons base.solve_rects = function(){ - if (Rooms.count() == 0) return + if (Rooms.count() == 0) { + Rooms.regions = regions = [] + return + } base.reset_rects() base.clip_rects() base.cull_rects() - + Rooms.regions = sort_rects_by_position(regions) } diff --git a/public/assets/javascripts/rectangles/engine/scenery/types/video.js b/public/assets/javascripts/rectangles/engine/scenery/types/video.js index 8cd5e6b..d3e2e76 100644 --- a/public/assets/javascripts/rectangles/engine/scenery/types/video.js +++ b/public/assets/javascripts/rectangles/engine/scenery/types/video.js @@ -25,6 +25,9 @@ Scenery.types.video = Scenery.types.base.extend(function(base){ this.mxType = MX.Youtube break } + if (app.muted) { + this.media.mute = true + } this.mx = new this.mxType({ media: this.media, scale: this.scale, diff --git a/public/assets/javascripts/ui/_router.js b/public/assets/javascripts/ui/_router.js index b59d838..d070d55 100644 --- a/public/assets/javascripts/ui/_router.js +++ b/public/assets/javascripts/ui/_router.js @@ -160,7 +160,6 @@ var SiteRouter = Router.extend({ profile: function(e){ this.profileView.load() }, - editProfile: function(e){ e && e.preventDefault() window.history.pushState(null, document.title, "/profile/edit") diff --git a/public/assets/javascripts/ui/reader/ReaderView.js b/public/assets/javascripts/ui/reader/ReaderView.js index a2c2983..9d38daa 100644 --- a/public/assets/javascripts/ui/reader/ReaderView.js +++ b/public/assets/javascripts/ui/reader/ReaderView.js @@ -15,6 +15,9 @@ var ReaderView = View.extend({ if (window.location.search.indexOf("noui") !== -1) { $(".logo,.topLinks,#editorView").hide() } + if (window.location.search.indexOf("mute") !== -1) { + app.muted = true + } name = sanitize(name) $.get(this.projectAction + name, this.ready.bind(this)) }, diff --git a/public/assets/javascripts/ui/site/LayoutsModal.js b/public/assets/javascripts/ui/site/LayoutsModal.js index 3b9e6cd..4948b0e 100644 --- a/public/assets/javascripts/ui/site/LayoutsModal.js +++ b/public/assets/javascripts/ui/site/LayoutsModal.js @@ -3,6 +3,8 @@ var LayoutsIndex = View.extend({ initialize: function(){ this.$templates = this.$(".templates") + this.$noTemplates = this.$(".no-templates") + this.$form = this.$("form") }, load: function(type){ @@ -12,6 +14,11 @@ var LayoutsIndex = View.extend({ }, populate: function(data){ + if (! data.length) { + this.$templates.hide() + this.$form.hide() + this.$noTemplates.show() + } data.forEach(function(room){ var $span = $("") // $span.html(JSON.stringify(room)) diff --git a/public/assets/stylesheets/app.css b/public/assets/stylesheets/app.css index 2583284..2e3358a 100755 --- a/public/assets/stylesheets/app.css +++ b/public/assets/stylesheets/app.css @@ -469,6 +469,9 @@ iframe.embed { .templates { } +.no-templates { + display: none; +} .templates span{ background-position: center; @@ -1130,6 +1133,11 @@ input[type="range"]::-webkit-slider-thumb { cursor:pointer; } +.settings.info { + right: auto; + left: 10px; +} + .settings { padding: 20px; bottom: 20px; @@ -1228,8 +1236,23 @@ input[type="range"]::-webkit-slider-thumb { } .setting label { + font-size: 12px; + font-weight: 300; padding-right: 5px; } +.setting.number label { + width: 50px; + display: inline-block; + float: left; + position: relative; + top: 5px; +} +.setting.number input[type=text] { + width: 150px; +} +.setting.number.twoline label { + top: 0px; +} .playButton,.muteButton { color: white; @@ -1485,7 +1508,7 @@ form li textarea { background:lightgreen; } */ -.box b.info { +.box b.signin-tagline { display: inline-block; width: 100%; margin-bottom: 18px; diff --git a/views/builder.ejs b/views/builder.ejs index 61e84c3..afb8c66 100644 --- a/views/builder.ejs +++ b/views/builder.ejs @@ -12,6 +12,7 @@ [[ include partials/header ]]
    + [[ include controls/builder/info ]] [[ include controls/builder/toolbar ]] [[ include controls/builder/settings ]]
    @@ -20,7 +21,6 @@
    - --> + -->
    diff --git a/views/controls/builder/info.ejs b/views/controls/builder/info.ejs new file mode 100644 index 0000000..af0a76d --- /dev/null +++ b/views/controls/builder/info.ejs @@ -0,0 +1,35 @@ +
    +
    + + +
    +
    + + +
    +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + + +
    + +
    diff --git a/views/controls/editor/media-editor.ejs b/views/controls/editor/media-editor.ejs index 65db3ce..5db1fb2 100644 --- a/views/controls/editor/media-editor.ejs +++ b/views/controls/editor/media-editor.ejs @@ -29,9 +29,9 @@
    - Initial Still +
    - +
    diff --git a/views/partials/sign-in.ejs b/views/partials/sign-in.ejs index 3f05fff..8268b2a 100644 --- a/views/partials/sign-in.ejs +++ b/views/partials/sign-in.ejs @@ -6,7 +6,7 @@ - – or the ol' fashion way – +
  • @@ -39,7 +39,7 @@ - – or the ol' fashion way – +
  • diff --git a/views/projects/layouts-modal.ejs b/views/projects/layouts-modal.ejs index 75b2641..97f1e61 100644 --- a/views/projects/layouts-modal.ejs +++ b/views/projects/layouts-modal.ejs @@ -5,6 +5,9 @@

    Edit Room Layouts

    +
    + There are no room layouts available. Please create a new one. +
    @@ -18,6 +21,8 @@

    Your Projects

    +
    +
    @@ -31,6 +36,9 @@

    Choose Room Template

    +
    + There are no room layouts available. Please create a new one. +
    diff --git a/views/projects/list-projects.ejs b/views/projects/list-projects.ejs index 42387ba..2c12af0 100644 --- a/views/projects/list-projects.ejs +++ b/views/projects/list-projects.ejs @@ -6,7 +6,7 @@ [[ projects.forEach(function(project, i) { ]] - + [[ if (profile._id == project.user_id) { ]]
    edit
    [[ } ]] -- cgit v1.2.3-70-g09d2