From 3f6e2404010c159c56fe8d002afecf176fac3fa9 Mon Sep 17 00:00:00 2001 From: Charley Peng Date: Thu, 1 Mar 2007 16:53:59 +1100 Subject: [PATCH 01/12] adding callback on error --- services/web/app/coffee/controllers/UserController.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/web/app/coffee/controllers/UserController.coffee b/services/web/app/coffee/controllers/UserController.coffee index 92e8fe0d2d..b2d5e97ceb 100644 --- a/services/web/app/coffee/controllers/UserController.coffee +++ b/services/web/app/coffee/controllers/UserController.coffee @@ -170,6 +170,7 @@ module.exports = metrics.inc "user.password-change" oldPass = req.body.currentPassword AuthenticationManager.authenticate _id: req.session.user._id, oldPass, (err, user)-> + return callback(error) if error? if(user) logger.log user: req.session.user, "changing password" newPassword1 = req.body.newPassword1 @@ -198,17 +199,20 @@ module.exports = redirectUserToDropboxAuth: (req, res)-> user_id = req.session.user._id dropboxHandler.getDropboxRegisterUrl user_id, (err, url)-> + return callback(error) if error? logger.log url:url, "redirecting user for dropbox auth" res.redirect url completeDropboxRegistration: (req, res)-> user_id = req.session.user._id dropboxHandler.completeRegistration user_id, (err, success)-> + return callback(error) if error? res.redirect('/user/settings#dropboxSettings') unlinkDropbox: (req, res)-> user_id = req.session.user._id dropboxHandler.unlinkAccount user_id, (err, success)-> + return callback(error) if error? res.redirect('/user/settings#dropboxSettings') deleteUser: (req, res)-> From b4482ab41f0ac5adae1a59e6912f91519048d285 Mon Sep 17 00:00:00 2001 From: goodbest Date: Fri, 21 Feb 2014 23:08:19 +0800 Subject: [PATCH 02/12] change repo URL from git+ssh:// to git+https:// --- services/web/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/web/package.json b/services/web/package.json index 6de023e4df..1261713176 100644 --- a/services/web/package.json +++ b/services/web/package.json @@ -26,9 +26,9 @@ "mimelib": "~0.2.8", "bufferedstream": "~1.4.1", "mixpanel": "0.0.18", - "settings-sharelatex": "git+ssh://git@github.com:sharelatex/settings-sharelatex.git#master", - "logger-sharelatex": "git+ssh://git@github.com:sharelatex/logger-sharelatex.git#master", - "soa-req-id": "git+ssh://git@github.com:sharelatex/soa-req-id.git#master", + "settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#master", + "logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#master", + "soa-req-id": "git+https://github.com/sharelatex/soa-req-id.git#master", "fairy": "0.0.2", "node-uuid": "~1.4.0", "mongojs": "0.9.8", From ca1ebd041345452727982a3dbdce3c449506a36a Mon Sep 17 00:00:00 2001 From: James Allen Date: Sat, 22 Feb 2014 10:50:59 +0000 Subject: [PATCH 03/12] Take default features from settings --- services/web/app/coffee/models/User.coffee | 6 +++--- services/web/config/settings.development.coffee | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/services/web/app/coffee/models/User.coffee b/services/web/app/coffee/models/User.coffee index 2d8e980954..a4141880a0 100644 --- a/services/web/app/coffee/models/User.coffee +++ b/services/web/app/coffee/models/User.coffee @@ -26,9 +26,9 @@ UserSchema = new Schema pdfViewer : {type : String, default: "pdfjs"} } features : { - collaborators: {type:Number, default:1} - versioning: {type:Boolean, default:false} - dropbox: {type:Boolean, default:false} + collaborators: { type:Number, default: Settings.defaultFeatures.collaborators } + versioning: { type:Boolean, default: Settings.defaultFeatures.versioning } + dropbox: { type:Boolean, default: Settings.defaultFeatures.dropbox } } featureSwitches : { dropbox: {type:Boolean, default:true}, diff --git a/services/web/config/settings.development.coffee b/services/web/config/settings.development.coffee index 8404481f40..bbd5296671 100644 --- a/services/web/config/settings.development.coffee +++ b/services/web/config/settings.development.coffee @@ -112,14 +112,16 @@ module.exports = # # You can select the features that are enabled by default for new # new users. + defaultFeatures: defaultFeatures = + collaborators: -1 + dropbox: true + versioning: true + plans: plans = [{ planCode: "personal" name: "Personal" price: 0 - features: - collaborators: -1 - dropbox: true - versioning: true + features: defaultFeatures }] # Spelling languages From c824c2e7b7a1dca0cacbd3cf3712b5c8b6386226 Mon Sep 17 00:00:00 2001 From: James Allen Date: Sat, 22 Feb 2014 11:09:10 +0000 Subject: [PATCH 04/12] Use siteUrl for share links, not hardcoded www.sharelatex.com --- .../coffee/project-members/ProjectMembersManager.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/web/public/coffee/project-members/ProjectMembersManager.coffee b/services/web/public/coffee/project-members/ProjectMembersManager.coffee index 9181c83466..73be55cee2 100644 --- a/services/web/public/coffee/project-members/ProjectMembersManager.coffee +++ b/services/web/public/coffee/project-members/ProjectMembersManager.coffee @@ -207,7 +207,7 @@ define [ @ide = @options.ide url: (medium) -> - "https://www.sharelatex.com/project/#{@ide.project.get("id")}" + + "#{window.sharelatex.siteUrl}/project/#{@ide.project.get("id")}" + "?r=#{@ide.user.get("referal_id")}&rs=ps&rm=#{medium}" # Referal source = public share render: -> @@ -219,10 +219,10 @@ define [ url = "https://www.facebook.com/dialog/feed?link=#{encodeURIComponent(@url("fb"))}&" + "app_id=148710621956179&" + - "picture=https://www.sharelatex.com/brand/logo/logo-128.png&" + + "picture=#{window.sharelatex.siteUrl}/brand/logo/logo-128.png&" + "name=#{@ide.project.get("name")}&" + "caption=My LaTeX project (#{@ide.project.get("name")}) is available online on ShareLaTeX&" + - "redirect_uri=http://www.sharelatex.com&" + + "redirect_uri=#{window.sharelatex.siteUrl}&" + "display=popup" mixpanel?.track("Project Shared", { method: "facebook" }) window.open( From 128c982ba23cc075e63af182a02e0a0f235f45f8 Mon Sep 17 00:00:00 2001 From: James Allen Date: Sat, 22 Feb 2014 11:26:36 +0000 Subject: [PATCH 05/12] Add open source banner to footer --- services/web/app/views/general/small-footer.jade | 4 ++++ services/web/app/views/subscriptions/plans.jade | 8 ++++---- services/web/app/views/user/settings.jade | 2 ++ services/web/public/stylesheets/less/footer.less | 9 +++++++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/services/web/app/views/general/small-footer.jade b/services/web/app/views/general/small-footer.jade index 4ae3ea67c6..f6a2d3f4df 100644 --- a/services/web/app/views/general/small-footer.jade +++ b/services/web/app/views/general/small-footer.jade @@ -1,4 +1,8 @@ .row-fluid + .span12 + div.alert.alert-success.open-source + | ShareLaTeX is open source. + a(href="https://github.com/sharelatex/sharelatex") Fork us on GitHub. .span12 .small-footer ul diff --git a/services/web/app/views/subscriptions/plans.jade b/services/web/app/views/subscriptions/plans.jade index 1eed30d050..31f46a9170 100644 --- a/services/web/app/views/subscriptions/plans.jade +++ b/services/web/app/views/subscriptions/plans.jade @@ -150,8 +150,8 @@ block content mixin plan(plans.groupAnnualPlans[2], "", false) .tab-pane.student-pricing - include ../general/small-footer - link(rel='stylesheet', href='/brand/plans.css?fingerprint='+fingerprint('/brand/mainStyle.css')) + include ../general/small-footer + link(rel='stylesheet', href='/brand/plans.css?fingerprint='+fingerprint('/brand/mainStyle.css')) - script - mixpanel.track("Page Viewed", { name: "plans" }) + script + mixpanel.track("Page Viewed", { name: "plans" }) diff --git a/services/web/app/views/user/settings.jade b/services/web/app/views/user/settings.jade index 8640ce3a1d..c7349bbc13 100644 --- a/services/web/app/views/user/settings.jade +++ b/services/web/app/views/user/settings.jade @@ -152,6 +152,8 @@ block content p Every few months we send a news letter out summarizing the new features available, if you would prefer to not receive this email then you are free to unsubscribe below at any time a#unsubscribeFromNewsletter.btn.btn-danger(data-csrf=csrfToken) Unsubscribe + include ../general/small-footer + #changePasswordModal(style='display: none') .modal form#changePasswordForm(method="post", action="/user/password/update") diff --git a/services/web/public/stylesheets/less/footer.less b/services/web/public/stylesheets/less/footer.less index e78d1845df..becd4cd589 100644 --- a/services/web/public/stylesheets/less/footer.less +++ b/services/web/public/stylesheets/less/footer.less @@ -1,6 +1,11 @@ - +.open-source { + text-align: center; + width: 300px; + margin: auto; + margin-top: 6px; +} .small-footer { - margin-top: 20px; + margin-top: 12px; margin-bottom: 20px; text-align:center; font-size: 0.9em; From 283338a26d0b2e766fc4db2f05e671ecab77b836 Mon Sep 17 00:00:00 2001 From: palkan Date: Mon, 24 Feb 2014 13:24:01 +0400 Subject: [PATCH 06/12] fix log wrap --- services/web/public/stylesheets/less/editor.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/public/stylesheets/less/editor.less b/services/web/public/stylesheets/less/editor.less index e41592a08e..3cf8b012b9 100644 --- a/services/web/public/stylesheets/less/editor.less +++ b/services/web/public/stylesheets/less/editor.less @@ -299,7 +299,7 @@ body.editor { .small { color: #666; margin-top: 6px; - white-space: pre; + white-space: pre-wrap; } } #rawLogArea { From ace74c8d7c60762e44153e7808d4ea76e89278b9 Mon Sep 17 00:00:00 2001 From: James Allen Date: Mon, 24 Feb 2014 13:50:55 +0000 Subject: [PATCH 07/12] Create .travis.yml --- services/web/.travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 services/web/.travis.yml diff --git a/services/web/.travis.yml b/services/web/.travis.yml new file mode 100644 index 0000000000..0aeb190fc8 --- /dev/null +++ b/services/web/.travis.yml @@ -0,0 +1,12 @@ +language: node_js + +install: + - npm install + - grunt install + +script: grunt test:unit + +services: + - redis-server + - mongodb + From 11b908f2767ddd66ab9cb4b72475a2206fc47ad2 Mon Sep 17 00:00:00 2001 From: James Allen Date: Mon, 24 Feb 2014 14:05:09 +0000 Subject: [PATCH 08/12] Install grunt-cli before running install --- services/web/.travis.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/services/web/.travis.yml b/services/web/.travis.yml index 0aeb190fc8..d97f744899 100644 --- a/services/web/.travis.yml +++ b/services/web/.travis.yml @@ -1,10 +1,17 @@ language: node_js +node_js: + - "0.10" + +before_install: + - npm install -g grunt-cli + install: - npm install - grunt install -script: grunt test:unit +script: + - grunt test:unit services: - redis-server From 2c69cbbb785bafd94edacb1294f357856c9a6c16 Mon Sep 17 00:00:00 2001 From: James Allen Date: Mon, 24 Feb 2014 14:14:09 +0000 Subject: [PATCH 09/12] Add travis badge --- services/web/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/web/README.md b/services/web/README.md index dd4469db6a..b74e61b983 100644 --- a/services/web/README.md +++ b/services/web/README.md @@ -9,6 +9,11 @@ a lot of logic around creating and editing projects, and account management. The rest of the ShareLaTeX stack, along with information about contributing can be found in the [sharelatex/sharelatex](https://github.com/sharelatex/sharelatex) repository. +Unit test status +---------------- + +[![Unit test status](https://travis-ci.org/sharelatex/web-sharelatex.png?branch=master)](https://travis-ci.org/sharelatex/web-sharelatex) + License and Credits ------------------- From c723fbb789a2fc3aee6b27348824ff06ff7a16fe Mon Sep 17 00:00:00 2001 From: James Allen Date: Tue, 25 Feb 2014 10:58:25 +0000 Subject: [PATCH 10/12] Remove fold all command which interferes with typing } on Danish keyboards --- services/web/public/coffee/editor/Editor.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/services/web/public/coffee/editor/Editor.coffee b/services/web/public/coffee/editor/Editor.coffee index e3e60f79d9..15f5307995 100644 --- a/services/web/public/coffee/editor/Editor.coffee +++ b/services/web/public/coffee/editor/Editor.coffee @@ -141,6 +141,7 @@ define [ readOnly: true aceEditor.commands.removeCommand "transposeletters" aceEditor.commands.removeCommand "showSettingsMenu" + aceEditor.commands.removeCommand "foldall" aceEditor.showCommandLine = (args...) => @trigger "showCommandLine", aceEditor, args... From fa80b0c3d2d6810227372a20b87af27a5cbf34ae Mon Sep 17 00:00:00 2001 From: Charley Peng Date: Wed, 26 Feb 2014 08:58:51 +1100 Subject: [PATCH 11/12] fixing incorrectly written variable --- services/web/app/coffee/controllers/UserController.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/web/app/coffee/controllers/UserController.coffee b/services/web/app/coffee/controllers/UserController.coffee index b2d5e97ceb..2f2979fa59 100644 --- a/services/web/app/coffee/controllers/UserController.coffee +++ b/services/web/app/coffee/controllers/UserController.coffee @@ -170,7 +170,7 @@ module.exports = metrics.inc "user.password-change" oldPass = req.body.currentPassword AuthenticationManager.authenticate _id: req.session.user._id, oldPass, (err, user)-> - return callback(error) if error? + return callback(err) if err? if(user) logger.log user: req.session.user, "changing password" newPassword1 = req.body.newPassword1 @@ -199,20 +199,20 @@ module.exports = redirectUserToDropboxAuth: (req, res)-> user_id = req.session.user._id dropboxHandler.getDropboxRegisterUrl user_id, (err, url)-> - return callback(error) if error? + return callback(err) if err? logger.log url:url, "redirecting user for dropbox auth" res.redirect url completeDropboxRegistration: (req, res)-> user_id = req.session.user._id dropboxHandler.completeRegistration user_id, (err, success)-> - return callback(error) if error? + return callback(err) if err? res.redirect('/user/settings#dropboxSettings') unlinkDropbox: (req, res)-> user_id = req.session.user._id dropboxHandler.unlinkAccount user_id, (err, success)-> - return callback(error) if error? + return callback(err) if err? res.redirect('/user/settings#dropboxSettings') deleteUser: (req, res)-> From cad8e0eb1c5b0eca629957651bebba285f887623 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Wed, 26 Feb 2014 08:52:57 +0000 Subject: [PATCH 12/12] Update bonus.jade - remove extra comma --- services/web/app/views/referal/bonus.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/app/views/referal/bonus.jade b/services/web/app/views/referal/bonus.jade index e9cb732e19..e3fae568f8 100644 --- a/services/web/app/views/referal/bonus.jade +++ b/services/web/app/views/referal/bonus.jade @@ -34,7 +34,7 @@ block content .row .span4.offset4.bonus-banner .title - a(href='mailto:?subject=Online LaTeX editor you may like, &body=Hey, I have been using the online LaTeX editor ShareLaTeX recently and thought you might like to check it out. #{encodeURIComponent(buildReferalUrl("e"))}', title='Share by Email').email Email us to your friends + a(href='mailto:?subject=Online LaTeX editor you may like &body=Hey, I have been using the online LaTeX editor ShareLaTeX recently and thought you might like to check it out. #{encodeURIComponent(buildReferalUrl("e"))}', title='Share by Email').email Email us to your friends .row .span4.offset4.bonus-banner