Переглянути джерело

Move all editor manager binding logic into the managers

James Allen 12 роки тому
батько
коміт
f86c9cf853

+ 1 - 1
services/web/app/views/project/editor.jade

@@ -8,7 +8,7 @@ block vars
 block scripts
 block scripts
 	//- Only use the native bootstrap on the editor page,
 	//- Only use the native bootstrap on the editor page,
 	//- since we use the Angular-based bootstrap elsewhere.
 	//- since we use the Angular-based bootstrap elsewhere.
-	script(src=jsPath+'libs/bootstrap-3.1.1.js')
+	//- script(src=jsPath+'libs/bootstrap-3.1.1.js')
 	script(src=jsPath+'libs/jquery-layout.js')
 	script(src=jsPath+'libs/jquery-layout.js')
 	script(src=jsPath+'libs/jquery.storage.js')
 	script(src=jsPath+'libs/jquery.storage.js')
 
 

+ 14 - 0
services/web/app/views/project/editor/left-menu.jade

@@ -2,6 +2,20 @@ aside#left-menu.full-size(
 	ng-class="{ 'shown': ui.leftMenuShown }"
 	ng-class="{ 'shown': ui.leftMenuShown }"
 	ng-cloak
 	ng-cloak
 )
 )
+	h4 Download
+
+	ul.unformatted-list.nav.nav-downloads
+		li
+			a(ng-href="/project/{{project_id}}/download/zip")
+				i.fa.fa-file-archive-o.fa-2x
+				br
+				| Source
+		li
+			a(ng-href="/project/{{project_id}}/output/output.pdf")
+				i.fa.fa-file-pdf-o.fa-2x
+				br
+				| PDF
+
 	h4 Settings
 	h4 Settings
 	form.settings(ng-controller="SettingsController")
 	form.settings(ng-controller="SettingsController")
 		.containter-fluid
 		.containter-fluid

+ 2 - 5
services/web/public/coffee/app/ide/editor/directives/aceEditor.coffee

@@ -10,7 +10,7 @@ define [
 	"ace/keyboard/emacs"
 	"ace/keyboard/emacs"
 	"ace/mode/latex"
 	"ace/mode/latex"
 	"ace/edit_session"
 	"ace/edit_session"
-], (App, Ace, UndoManager, AutoCompleteManager, SpellCheckManager, AnnotationsManager, CursorPositionManager) ->
+], (App, Ace, UndoManager, AutoCompleteManager, SpellCheckManager, HighlightsManager, CursorPositionManager) ->
 	LatexMode = require("ace/mode/latex").Mode
 	LatexMode = require("ace/mode/latex").Mode
 	EditSession = require('ace/edit_session').EditSession
 	EditSession = require('ace/edit_session').EditSession
 
 
@@ -49,7 +49,7 @@ define [
 				autoCompleteManager   = new AutoCompleteManager(scope, editor, element)
 				autoCompleteManager   = new AutoCompleteManager(scope, editor, element)
 				spellCheckManager     = new SpellCheckManager(scope, editor, element)
 				spellCheckManager     = new SpellCheckManager(scope, editor, element)
 				undoManager           = new UndoManager(scope, editor, element)
 				undoManager           = new UndoManager(scope, editor, element)
-				annotationsManager    = new AnnotationsManager(scope, editor, element)
+				highlightsManager     = new HighlightsManager(scope, editor, element)
 				cursorPositionManager = new CursorPositionManager(scope, editor, element)
 				cursorPositionManager = new CursorPositionManager(scope, editor, element)
 
 
 				# Prevert Ctrl|Cmd-S from triggering save dialog
 				# Prevert Ctrl|Cmd-S from triggering save dialog
@@ -119,9 +119,6 @@ define [
 					resetSession()
 					resetSession()
 					session = editor.getSession()
 					session = editor.getSession()
 
 
-					autoCompleteManager.bindToSession(session)
-					annotationsManager.redrawAnnotations()
-
 					doc = session.getDocument()
 					doc = session.getDocument()
 					doc.on "change", () ->
 					doc.on "change", () ->
 						scope.$apply () ->
 						scope.$apply () ->

+ 3 - 0
services/web/public/coffee/app/ide/editor/highlights/HighlightsManager.coffee

@@ -29,6 +29,9 @@ define [
 				e.position = position
 				e.position = position
 				@showAnnotationLabels(position)
 				@showAnnotationLabels(position)
 
 
+			@editor.on "changeSession", () =>
+				@redrawAnnotations()
+
 		redrawAnnotations: () ->
 		redrawAnnotations: () ->
 			@_clearMarkers()
 			@_clearMarkers()
 			@_clearLabels()
 			@_clearLabels()

+ 18 - 0
services/web/public/stylesheets/app/editor/left-menu.less

@@ -31,6 +31,24 @@
 		margin-top: 0;
 		margin-top: 0;
 	}
 	}
 
 
+	ul.nav-downloads {
+		li {
+			display: inline-block;
+			text-align: center;
+			width: 100px;
+			a {
+				color: @gray-dark;
+				&:hover, &:active {
+					background-color: @link-color;
+					color: white;
+				}
+				i {
+					margin-bottom: (@line-height-computed / 4);
+				}
+			}
+		}
+	}
+
 	form.settings {
 	form.settings {
 		label {
 		label {
 			font-weight: normal;
 			font-weight: normal;

+ 2 - 1
services/web/public/stylesheets/app/editor/toolbar.less

@@ -25,7 +25,8 @@
 		border-radius: 0;
 		border-radius: 0;
 		border-right: 1px solid @toolbar-border-color;
 		border-right: 1px solid @toolbar-border-color;
 		color: @link-color;
 		color: @link-color;
-		padding: 6px 12px 8px;
+		padding: 3px 10px 5px;
+		font-size: 20px;
 		&:hover {
 		&:hover {
 			text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
 			text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
 			background-color: darken(white, 10%);
 			background-color: darken(white, 10%);