diff --git a/services/web/app/views/project/editor.jade b/services/web/app/views/project/editor.jade index f8c7311205..e5161b3809 100644 --- a/services/web/app/views/project/editor.jade +++ b/services/web/app/views/project/editor.jade @@ -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", diff --git a/services/web/app/views/project/editor/chat.jade b/services/web/app/views/project/editor/chat.jade index ae68d6a5ef..85d08d147a 100644 --- a/services/web/app/views/project/editor/chat.jade +++ b/services/web/app/views/project/editor/chat.jade @@ -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()" ) diff --git a/services/web/app/views/project/editor/editor.jade b/services/web/app/views/project/editor/editor.jade index e0f4160e95..aeeda6acfb 100644 --- a/services/web/app/views/project/editor/editor.jade +++ b/services/web/app/views/project/editor/editor.jade @@ -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( diff --git a/services/web/app/views/project/editor/header.jade b/services/web/app/views/project/editor/header.jade index 216818018a..a119c561db 100644 --- a/services/web/app/views/project/editor/header.jade +++ b/services/web/app/views/project/editor/header.jade @@ -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 }" diff --git a/services/web/public/coffee/ide.coffee b/services/web/public/coffee/ide.coffee index 15983a05dd..2ea76ea57d 100644 --- a/services/web/public/coffee/ide.coffee +++ b/services/web/public/coffee/ide.coffee @@ -53,6 +53,7 @@ define [ } $scope.user = window.user $scope.settings = window.userSettings + $scope.anonymous = window.anonymous $scope.chat = {} diff --git a/services/web/public/coffee/ide/chat/directives/mathjax.coffee b/services/web/public/coffee/ide/chat/directives/mathjax.coffee index c2c211717a..1a0b0c45c2 100644 --- a/services/web/public/coffee/ide/chat/directives/mathjax.coffee +++ b/services/web/public/coffee/ide/chat/directives/mathjax.coffee @@ -11,7 +11,7 @@ define [ inlineMath: [ ['$','$'], ["\\(","\\)"] ], displayMath: [ ['$$','$$'], ["\\[","\\]"] ], processEscapes: true - + skipStartupTypeset: true MathJax.Hub.Config(mathjaxConfig); diff --git a/services/web/public/coffee/ide/directives/layout.coffee b/services/web/public/coffee/ide/directives/layout.coffee index f67f5a61f4..891d04f647 100644 --- a/services/web/public/coffee/ide/directives/layout.coffee +++ b/services/web/public/coffee/ide/directives/layout.coffee @@ -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) diff --git a/services/web/public/coffee/ide/editor/EditorManager.coffee b/services/web/public/coffee/ide/editor/EditorManager.coffee index 1298d837e6..57f4f63091 100644 --- a/services/web/public/coffee/ide/editor/EditorManager.coffee +++ b/services/web/public/coffee/ide/editor/EditorManager.coffee @@ -9,7 +9,6 @@ define [ sharejs_doc: null open_doc_id: null opening: true - gotoLine: null } @$scope.$on "entity:selected", (event, entity) => diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee index 06315f917d..26cb5ced1e 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee @@ -33,7 +33,6 @@ define [ highlights: "=" text: "=" readOnly: "=" - gotoLine: "=" annotations: "=" navigateHighlights: "=" } diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/cursor-position/CursorPositionManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/cursor-position/CursorPositionManager.coffee index ee35af07df..b058620c47 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/cursor-position/CursorPositionManager.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/cursor-position/CursorPositionManager.coffee @@ -27,7 +27,7 @@ define [], () -> if value? setTimeout () => @gotoLine(value) - , 0 + , 10 # Hack: Must happen after @gotoStoredPosition storeScrollTopPosition: (session) -> if @doc_id? diff --git a/services/web/public/coffee/ide/file-tree/directives/droppable.coffee b/services/web/public/coffee/ide/file-tree/directives/droppable.coffee index ea68630a21..890e345c23 100644 --- a/services/web/public/coffee/ide/file-tree/directives/droppable.coffee +++ b/services/web/public/coffee/ide/file-tree/directives/droppable.coffee @@ -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) } \ No newline at end of file diff --git a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee index 73c9190d49..82e9048dbb 100644 --- a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee +++ b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee @@ -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) => diff --git a/services/web/public/stylesheets/app/editor/chat.less b/services/web/public/stylesheets/app/editor/chat.less index 717dc37309..f46e438801 100644 --- a/services/web/public/stylesheets/app/editor/chat.less +++ b/services/web/public/stylesheets/app/editor/chat.less @@ -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%;