Merge branch 'master' into node-6.9

This commit is contained in:
Shane Kilkelly 2017-04-11 11:34:53 +01:00
commit f398e87e6f
8 changed files with 25 additions and 58 deletions

View file

@ -20,7 +20,6 @@ div.full-size(
'rp-size-expanded': ui.reviewPanelOpen,\
'rp-layout-left': reviewPanel.layoutToLeft,\
'rp-loading-threads': reviewPanel.loadingThreads,\
'rp-new-comment-ui': reviewPanel.newAddCommentUI\
}"
)
.loading-panel(ng-show="!editor.sharejs_doc || editor.opening")

View file

@ -8,7 +8,7 @@
) !{translate("track_changes_is_on")}
a.rp-add-comment-btn(
href
ng-if="reviewPanel.newAddCommentUI && reviewPanel.entries[editor.open_doc_id]['add-comment'] != null"
ng-if="reviewPanel.entries[editor.open_doc_id]['add-comment'] != null"
ng-click="addNewComment();"
)
i.fa.fa-comment
@ -81,8 +81,6 @@
on-start-new="startNewComment();"
on-submit="submitNewComment(content);"
on-cancel="cancelNewComment();"
on-indicator-click="toggleReviewPanel();"
layout-to-left="reviewPanel.layoutToLeft"
)
.rp-entry-list(
@ -322,14 +320,6 @@ script(type='text/ng-template', id='resolvedCommentEntryTemplate')
script(type='text/ng-template', id='addCommentEntryTemplate')
div
.rp-entry-callout.rp-entry-callout-add-comment
.rp-entry-indicator.rp-entry-indicator-add-comment(
ng-if="!commentState.adding"
ng-click="startNewComment(); onIndicatorClick();"
tooltip=translate("add_comment")
tooltip-placement="{{ layoutToLeft ? 'left' : 'right' }}"
tooltip-append-to-body="true"
)
i.fa.fa-commenting
.rp-entry.rp-entry-add-comment(
ng-class="[ (state.isAdding ? 'rp-entry-adding-comment' : ''), (entry.focused ? 'rp-entry-focused' : '')]"
)

View file

@ -3,15 +3,11 @@ extends ../layout
block content
//- We need to do .replace(/\//g, '\\/') do that '</script>' -> '<\/script>'
//- and doesn't prematurely end the script tag.
script#data(type="application/json").
!{JSON.stringify({ projects: projects, tags: tags, notifications: notifications }).replace(/\//g, '\\/')}
script(type="text/javascript").
window.data = {
projects: !{JSON.stringify(projects).replace(/\//g, '\\/')},
tags: !{JSON.stringify(tags).replace(/\//g, '\\/')},
notifications: !{JSON.stringify(notifications).replace(/\//g, '\\/')}
};
window.data = JSON.parse($("#data").text());
window.algolia = {
institutions: {
app_id: '#{algolia_app_id}',

View file

@ -4,7 +4,7 @@ define [
"ide/colors/ColorManager"
"ide/review-panel/RangesTracker"
], (App, EventEmitter, ColorManager, RangesTracker) ->
App.controller "ReviewPanelController", ($scope, $element, ide, $timeout, $http, $modal, event_tracking, sixpack, localStorage) ->
App.controller "ReviewPanelController", ($scope, $element, ide, $timeout, $http, $modal, event_tracking, localStorage) ->
$reviewPanelEl = $element.find "#review-panel"
$scope.SubViews =
@ -24,17 +24,8 @@ define [
loading: false
commentThreads: {}
resolvedThreadIds: {}
layoutToLeft: false
rendererData: {}
loadingThreads: false
newAddCommentUI: false # Test new UI for adding comments; remove afterwards.
$scope.shouldABAddCommentBtn = false
if $scope.user.signUpDate >= '2017-03-27'
sixpack.participate "add-comment-btn", [ "default", "editor-corner" ], (variation) ->
$scope.shouldABAddCommentBtn = true
$scope.variationABAddCommentBtn = variation
$scope.reviewPanel.newAddCommentUI = (variation == "editor-corner")
window.addEventListener "beforeunload", () ->
collapsedStates = {}
@ -45,11 +36,9 @@ define [
localStorage("docs_collapsed_state:#{$scope.project_id}", valToStore)
$scope.$on "layout:pdf:linked", (event, state) ->
$scope.reviewPanel.layoutToLeft = (state.east?.size < 220 || state.east?.initClosed)
$scope.$broadcast "review-panel:layout"
$scope.$on "layout:pdf:resize", (event, state) ->
$scope.reviewPanel.layoutToLeft = (state.east?.size < 220 || state.east?.initClosed)
$scope.$broadcast "review-panel:layout", false
$scope.$on "expandable-text-area:resize", (event) ->
@ -58,9 +47,6 @@ define [
$scope.$on "review-panel:sizes", (e, sizes) ->
$scope.$broadcast "editor:set-scroll-size", sizes
$scope.$watch "ui.pdfLayout", (layout) ->
$scope.reviewPanel.layoutToLeft = (layout == "flat")
$scope.$watch "project.features.trackChangesVisible", (visible) ->
return if !visible?
@ -173,7 +159,7 @@ define [
entries = $scope.reviewPanel.entries[$scope.editor.open_doc_id] or {}
permEntries = {}
for entry, entryData of entries
if entry != "add-comment" or !$scope.reviewPanel.newAddCommentUI
if entry != "add-comment"
permEntries[entry] = entryData
Object.keys(permEntries).length
), (nEntries) ->
@ -336,8 +322,6 @@ define [
$scope.$broadcast "comment:select_line"
$timeout () ->
$scope.$broadcast "review-panel:layout"
if $scope.shouldABAddCommentBtn and !$scope.ui.reviewPanelOpen
sixpack.convert "add-comment-btn"
$scope.submitNewComment = (content) ->
return if !content? or content == ""

View file

@ -8,8 +8,6 @@ define [
onStartNew: "&"
onSubmit: "&"
onCancel: "&"
onIndicatorClick: "&"
layoutToLeft: "="
link: (scope, element, attrs) ->
scope.state =
isAdding: false

View file

@ -127,15 +127,13 @@ define [
ace.require("ace/lib/event").addMouseWheelListener scroller[0], (e) ->
deltaY = e.wheelY
old_top = parseInt(list.css("top"))
top = Math.min(0, old_top - deltaY * 4)
list.css(top: top)
top = old_top - deltaY * 4
scrollAce(-top)
e.preventDefault()
# Use these to avoid unnecessary updates. Scrolling one
# panel causes us to scroll the other panel, but there's no
# need to trigger the event back to the original panel.
ignoreNextPanelEvent = false
# We always scroll by telling Ace to scroll and then updating the
# review panel. This lets Ace manage the size of the scroller and
# when it overflows.
ignoreNextAceEvent = false
scrollPanel = (scrollTop, height) ->
@ -148,11 +146,7 @@ define [
list.css(top: - scrollTop)
scrollAce = (scrollTop) ->
if ignoreNextPanelEvent
ignoreNextPanelEvent = false
else
ignoreNextAceEvent = true
scope.reviewPanelEventsBridge.emit "externalScroll", scrollTop
scope.reviewPanelEventsBridge.emit "externalScroll", scrollTop
scope.reviewPanelEventsBridge.on "aceScroll", scrollPanel
scope.$on "$destroy", () ->

View file

@ -2283,9 +2283,13 @@ var TextInput = function(parentNode, host) {
if (e.type == "compositionend" && c.range) {
host.selection.setRange(c.range);
}
// WORKAROUND: Accent keys and Korean keys don't work in Chrome >53.
// https://github.com/ajaxorg/ace/issues/3045
if (useragent.isChrome >= 53) onInput();
var needsOnInput =
(!!useragent.isChrome && useragent.isChrome >= 53) ||
(!!useragent.isWebKit && useragent.isWebKit >= 603);
if (needsOnInput) {
onInput();
}
};

View file

@ -96,10 +96,12 @@
flex-direction: column;
width: @review-panel-width;
overflow: visible;
border-left-width: 1px;
}
.rp-size-mini & {
width: @review-off-width;
z-index: 6;
border-left-width: 1px;
}
position: absolute;
@ -107,7 +109,7 @@
bottom: 0px;
right: 0px;
background-color: @rp-bg-blue;
border-left: solid 1px @rp-border-grey;
border-left: solid 0px @rp-border-grey;
font-size: @rp-base-font-size;
color: @rp-type-blue;
z-index: 6;
@ -181,6 +183,9 @@
.rp-size-mini & {
display: block;
}
.rp-size-mini &-add-comment {
display: none;
}
position: absolute;
left: 2px;
right: 2px;
@ -200,9 +205,6 @@
z-index: 1;
}
.rp-new-comment-ui &-add-comment {
display: none;
}
}
.rp-entry-wrapper {
@ -576,7 +578,7 @@
}
}
.rp-size-mini.rp-new-comment-ui &-add-comment {
.rp-size-mini &-add-comment {
display: none;
}
}