Przeglądaj źródła

Merge branch 'master' of github.com:sharelatex/web-sharelatex

Henry Oswald 12 lat temu
rodzic
commit
aa0d26d5ab

+ 19 - 0
services/web/.travis.yml

@@ -0,0 +1,19 @@
+language: node_js
+
+node_js:
+    - "0.10"
+
+before_install:
+    - npm install -g grunt-cli
+
+install:
+    - npm install
+    - grunt install
+
+script:
+    - grunt test:unit
+
+services:
+    - redis-server
+    - mongodb
+    

+ 5 - 0
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
 -------------------
 

+ 4 - 0
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(err) if err?
 			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(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(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(err) if err?
 			res.redirect('/user/settings#dropboxSettings')
 
 	deleteUser: (req, res)->

+ 3 - 3
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},

+ 4 - 0
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

+ 1 - 1
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

+ 4 - 4
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" })

+ 2 - 0
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")

+ 6 - 4
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

+ 3 - 3
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",

+ 1 - 0
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...

+ 3 - 3
services/web/public/coffee/project-members/ProjectMembersManager.coffee

@@ -252,7 +252,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: ->
@@ -264,10 +264,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(

+ 1 - 1
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 {

+ 7 - 2
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;