hugh-obrien 8 лет назад
Родитель
Сommit
a250004036

+ 2 - 0
services/web/app/coffee/infrastructure/Features.coffee

@@ -14,6 +14,8 @@ module.exports = Features =
 				return Settings.enableGithubSync
 			when 'v1-return-message'
 				return Settings.accountMerge? and Settings.overleaf?
+			when 'publish-modal'
+				return Settings.showPublishModal
 			when 'custom-togglers'
 				return Settings.overleaf?
 			else

+ 3 - 1
services/web/app/views/project/editor.pug

@@ -55,6 +55,7 @@ block content
 				include ./editor/header
 
 				include ./editor/share
+				include ./editor/publish
 
 				#ide-body(
 					ng-cloak,
@@ -136,7 +137,8 @@ block requirejs
 				"fineuploader": "libs/#{lib('fineuploader')}",
 				"ide": "#{buildJsPath('ide.js', {hashedPath:settings.useMinifiedJs, removeExtension:true})}",
 				"libraries": "#{buildJsPath('libraries.js', {hashedPath:settings.useMinifiedJs, removeExtension:true})}",
-				!{moduleIncludes("editor:script", locals)}
+				!{moduleIncludes("editor:script", locals)},
+				!{moduleIncludes("publish:script", locals)}
 			},
 			"waitSeconds": 0,
 			"shim": {

+ 3 - 0
services/web/app/views/project/editor/header.pug

@@ -107,6 +107,9 @@ header.toolbar.toolbar-header.toolbar-with-labels(
 		)
 			i.fa.fa-fw.fa-group
 			p.toolbar-label #{translate("share")}
+
+		!= moduleIncludes('publish:button', locals)
+
 		a.btn.btn-full-height(
 			href,
 			ng-click="toggleHistory();",

+ 9 - 0
services/web/app/views/project/editor/publish.pug

@@ -0,0 +1,9 @@
+script(type='text/ng-template', id='publishProjectModalTemplate')
+	.modal-header
+		button.close(
+			type="button"
+			data-dismiss="modal"
+			ng-click="cancel()"
+		) ×
+		h3 Publish}
+	.modal-body.modal-body-publish

+ 1 - 0
services/web/package.json

@@ -72,6 +72,7 @@
     "passport-oauth2-refresh": "^1.0.0",
     "passport-saml": "^0.15.0",
     "pug": "^2.0.0-beta6",
+    "react": "^15.4.2",
     "redis-sharelatex": "git+https://github.com/sharelatex/redis-sharelatex.git#v1.0.4",
     "request": "^2.69.0",
     "requestretry": "^1.13.0",

+ 9 - 1
services/web/webpack.config.js

@@ -59,9 +59,17 @@ module.exports = {
 					cacheDirectory: true
 				}
 			}]
+		}, {
+			// Export React as a global variable from the bundle
+			test: require.resolve('react'),
+			use: [{
+				loader: 'expose-loader',
+				options: 'React'
+			}]
 		}]
 	},
 
 	// TODO
 	// plugins: {}
-}
+}
+