Move all editor manager binding logic into the managers

This commit is contained in:
James Allen 2014-07-02 10:59:18 +01:00
parent f5e5e55457
commit f86c9cf853
6 changed files with 40 additions and 7 deletions

View file

@ -8,7 +8,7 @@ block vars
block scripts
//- Only use the native bootstrap on the editor page,
//- 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.storage.js')

View file

@ -2,6 +2,20 @@ aside#left-menu.full-size(
ng-class="{ 'shown': ui.leftMenuShown }"
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
form.settings(ng-controller="SettingsController")
.containter-fluid

View file

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

View file

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

View file

@ -31,6 +31,24 @@
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 {
label {
font-weight: normal;

View file

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