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

This commit is contained in:
Henry Oswald 2014-07-22 13:42:37 +01:00
commit c95730dd63
8 changed files with 103 additions and 7 deletions

View file

@ -1,6 +1,7 @@
div.full-size(
ng-show="ui.view == 'editor'"
layout="pdf"
layout-disabled="ui.pdfLayout != 'sideBySide'"
resize-on="layout:main:resize"
resize-proportionally="true"
initial-size-east="'50%'"
@ -31,6 +32,7 @@ div.full-size(
)
.ui-layout-east
div(ng-if="ui.pdfLayout == 'sideBySide'")
include ./pdf
.ui-layout-resizer-controls.synctex-controls(
@ -52,3 +54,10 @@ div.full-size(
ng-click="syncToCode()"
)
i.fa.fa-long-arrow-left
div.full-size(
ng-if="ui.pdfLayout == 'flat'"
ng-show="ui.view == 'pdf'"
)
include ./pdf

View file

@ -73,6 +73,20 @@ aside#file-tree(ng-controller="FileTreeController")
span {{ entity.name }}
div(ng-show="ui.pdfLayout == 'flat' && (ui.view == 'editor' || ui.view == 'pdf')")
ul.list-unstyled.file-tree-list
li(
ng-class="{ 'selected': ui.view == 'pdf' }"
)
.entity
.entity-name(
ng-click="ui.view = 'pdf'"
)
i.fa.fa-fw.toggle
i.fa.fa-fw.fa-file-pdf-o
| PDF
script(type='text/ng-template', id='entityListItemTemplate')
li(
ng-class="{ 'selected': entity.selected }",

View file

@ -1,4 +1,4 @@
div.full-size(ng-controller="PdfController")
div.full-size.pdf(ng-controller="PdfController")
.toolbar.toolbar-tall
a.btn.btn-info(
href,
@ -27,6 +27,27 @@ div.full-size(ng-controller="PdfController")
}"
) {{ pdf.logEntries.errors.length + pdf.logEntries.warnings.length }}
.toolbar-right
a(
href,
ng-click="switchToFlatLayout()"
ng-show="ui.pdfLayout == 'sideBySide'"
tooltip="Full screen"
tooltip-placement="bottom"
tooltip-append-to-body="true"
)
i.full-screen
a(
href,
ng-click="switchToSideBySideLayout()"
ng-show="ui.pdfLayout == 'flat'"
tooltip="Split screen"
tooltip-placement="bottom"
tooltip-append-to-body="true"
)
i.split-screen
i.split-screen
.pdf-viewer(ng-show="pdf.url && pdf.view == 'pdf' && !pdf.failure && !pdf.timeout && !pdf.error")
div(
pdfjs

View file

@ -50,6 +50,7 @@ define [
leftMenuShown: false
view: "editor"
chatOpen: false
pdfLayout: 'sideBySide'
}
$scope.user = window.user
$scope.settings = window.userSettings

View file

@ -102,5 +102,12 @@ define [
resetOpenStates()
onInternalResize()
scope.$watch attrs.layoutDisabled, (value) ->
if value
element.layout().hide("east")
else
element.layout().show("east")
}
]

View file

@ -4,7 +4,7 @@ define [
], (App, LogParser) ->
App.controller "PdfController", ["$scope", "$http", "ide", "$modal", "synctex", ($scope, $http, ide, $modal, synctex) ->
autoCompile = true
$scope.$on "doc:opened", () ->
$scope.$on "project:joined", () ->
return if !autoCompile
autoCompile = false
$scope.recompile(isAutoCompile: true)
@ -148,6 +148,21 @@ define [
{doc, line} = data
ide.editorManager.openDoc(doc, gotoLine: line)
$scope.switchToFlatLayout = () ->
$scope.ui.pdfLayout = 'flat'
$scope.ui.view = 'pdf'
$.localStorage "pdf.layout", "flat"
$scope.switchToSideBySideLayout = () ->
$scope.ui.pdfLayout = 'sideBySide'
$scope.ui.view = 'editor'
$.localStorage "pdf.layout", "split"
if pdfLayout = $.localStorage("pdf.layout")
$scope.switchToSideBySideLayout() if pdfLayout == "split"
$scope.switchToFlatLayout() if pdfLayout == "flat"
else
$scope.switchToSideBySideLayout()
]
App.factory "synctex", ["ide", "$http", "$q", (ide, $http, $q) ->

View file

@ -54,7 +54,7 @@ aside#file-tree {
font-size: 14px;
}
i.fa-file, i.fa-image {
i.fa-file, i.fa-image, i.fa-file-pdf-o {
color: @gray-light;
font-size: 14px;
}

View file

@ -73,7 +73,7 @@
}
}
.toolbar {
.pdf .toolbar {
.log-btn {
&.active, &:active {
.label {
@ -87,6 +87,35 @@
}
}
}
.toolbar-right {
margin-right: @line-height-computed / 2;
a {
&:hover {
i {
box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.25);
border-color: @gray-dark;
}
}
i {
display: inline-block;
width: 16px;
height: 16px;
border: 1px solid @gray-light;
margin-top: 5px;
}
i.full-screen {
border-top-width: 3px;
border-radius: 2px;
}
i.split-screen {
width: 7px;
border-top-width: 3px;
border-radius: 2px;
margin-left: 2px;
}
}
}
}
.pdf-logs {