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

This commit is contained in:
Henry Oswald 2014-07-21 13:14:08 +01:00
commit 82914b6fe5
13 changed files with 44 additions and 30 deletions

View file

@ -86,6 +86,7 @@ block content
window.userSettings = !{JSON.stringify(userSettings).replace(/\//g, '\\/')};
window.user = !{JSON.stringify(user).replace(/\//g, '\\/')};
window.csrfToken = "!{csrfToken}";
window.anonymous = #{anonymous};
window.requirejs = {
"paths" : {
"mathjax": "https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML",

View file

@ -1,5 +1,6 @@
aside.chat(
ng-controller="ChatController"
ng-controller="ChatController",
ng-if="!anonymous"
)
.messages(
infinite-scroll="loadMoreMessages()"
@ -12,6 +13,12 @@ aside.chat(
.loading(ng-show="chat.loading")
i.fa.fa-fw.fa-spin.fa-refresh
|   Loading...
.no-messages.text-center.small(ng-show='!chat.loading && chat.messages.length == 0')
| No messages
.first-message.text-center(ng-show='!chat.loading && chat.messages.length == 0')
| Send your first message
br
i.fa.fa-arrow-down
ul.list-unstyled(
ng-click="resetUnreadMessages()"
)

View file

@ -33,7 +33,7 @@ div.full-size(
include ./pdf
.ui-layout-resizer-controls.synctex-controls(
ng-show="!!pdf.url && settings.pdfViewer == 'pdfjs' && showControls"
ng-show="!!pdf.url && settings.pdfViewer == 'pdfjs'"
ng-controller="PdfSynctexController"
)
a.btn.btn-default.btn-xs(

View file

@ -3,13 +3,15 @@ header.toolbar.toolbar-header(ng-cloak, ng-hide="state.loading")
href,
ng-click="ui.leftMenuShown = true"
tooltip="Menu",
tooltip-placement="bottom"
tooltip-placement="bottom",
tooltip-append-to-body="true"
)
i.fa.fa-fw.fa-bars
a(
href="/project"
tooltip="Back to projects",
tooltip-placement="bottom"
tooltip-placement="bottom",
tooltip-append-to-body="true"
)
i.fa.fa-fw.fa-level-up
@ -76,7 +78,8 @@ header.toolbar.toolbar-header(ng-cloak, ng-hide="state.loading")
tooltip-placement="bottom",
ng-class="{ active: ui.chatOpen }",
ng-click="toggleChat()",
ng-controller="ChatButtonController"
ng-controller="ChatButtonController",
ng-show="!anonymous"
)
i.fa.fa-fw.fa-comment(
ng-class="{ 'bounce': unreadMessages > 0 }"

View file

@ -53,6 +53,7 @@ define [
}
$scope.user = window.user
$scope.settings = window.userSettings
$scope.anonymous = window.anonymous
$scope.chat = {}

View file

@ -11,7 +11,7 @@ define [
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
processEscapes: true
skipStartupTypeset: true
MathJax.Hub.Config(mathjaxConfig);

View file

@ -72,15 +72,20 @@ define [
repositionControls = () ->
state = element.layout().readState()
if state.east?
element.find("> .ui-layout-resizer-controls").css({
position: "absolute"
right: state.east.size
"z-index": 10
})
controls = element.find("> .ui-layout-resizer-controls")
if state.east.initClosed
controls.hide()
else
controls.show()
controls.css({
position: "absolute"
right: state.east.size
"z-index": 10
})
resetOpenStates = () ->
state = element.layout().readState()
if attrs.openEast?
if attrs.openEast? and state.east?
openEast = $parse(attrs.openEast)
openEast.assign(scope, !state.east.initClosed)

View file

@ -9,7 +9,6 @@ define [
sharejs_doc: null
open_doc_id: null
opening: true
gotoLine: null
}
@$scope.$on "entity:selected", (event, entity) =>

View file

@ -33,7 +33,6 @@ define [
highlights: "="
text: "="
readOnly: "="
gotoLine: "="
annotations: "="
navigateHighlights: "="
}

View file

@ -27,7 +27,7 @@ define [], () ->
if value?
setTimeout () =>
@gotoLine(value)
, 0
, 10 # Hack: Must happen after @gotoStoredPosition
storeScrollTopPosition: (session) ->
if @doc_id?

View file

@ -3,9 +3,6 @@ define [
], (App) ->
App.directive "droppable", () ->
return {
scope: {
onDropCallback: "="
}
link: (scope, element, attrs) ->
scope.$watch attrs.droppable, (droppable) ->
if droppable
@ -13,5 +10,5 @@ define [
greedy: true
hoverClass: "droppable-hover"
accept: attrs.accept
drop: scope.onDropCallback
drop: scope.$eval(attrs.onDropCallback)
}

View file

@ -223,17 +223,6 @@ define [
]
App.controller "PdfSynctexController", ["$scope", "synctex", "ide", ($scope, synctex, ide) ->
$scope.showControls = true
$scope.$on "layout:pdf:resize", (event, data) ->
if data.east.initClosed
$scope.showControls = false
else
$scope.showControls = true
setTimeout () ->
$scope.$digest()
, 0
@cursorPosition = null
ide.$scope.$on "cursor:editor:update", (event, @cursorPosition) =>

View file

@ -7,6 +7,17 @@
text-align: center;
}
.no-messages {
padding: @line-height-computed / 2;
}
.first-message {
position: absolute;
bottom: 0;
width: 100%;
padding: @line-height-computed / 2;
}
.messages {
position: absolute;
top: 0;
@ -104,6 +115,8 @@
padding: @line-height-computed / 4;
border-top: 1px solid @toolbar-border-color;
textarea {
overflow: auto;
resize: none;
border-radius: @border-radius-base;
border: 1px solid @toolbar-border-color;
height: 100%;