From d1a3ff4b73e48b6cc0634c2696f4182e4a943343 Mon Sep 17 00:00:00 2001 From: James Allen Date: Thu, 17 Nov 2016 15:33:34 +0000 Subject: [PATCH] Refactor callout and background styles and don't show in overview --- .../track-changes/TrackChangesManager.coffee | 8 ++--- .../web/public/stylesheets/app/editor.less | 31 ---------------- .../stylesheets/app/editor/review-panel.less | 35 +++++++++++++++++++ 3 files changed, 39 insertions(+), 35 deletions(-) diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/track-changes/TrackChangesManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/track-changes/TrackChangesManager.coffee index e2a8e1f3ae..7d2e47b76c 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/track-changes/TrackChangesManager.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/track-changes/TrackChangesManager.coffee @@ -332,7 +332,7 @@ define [ callout_range = @_makeZeroWidthRange(position) markerLayer = @editor.renderer.$markerBack callout_marker_id = session.addMarker callout_range, klass, (html, range, left, top, config) -> - markerLayer.drawSingleLineMarker(html, range, "#{klass} ace_start", config, 0, "width: auto; right: 0;") + markerLayer.drawSingleLineMarker(html, range, "track-changes-marker-callout #{klass} ace_start", config, 0, "width: auto; right: 0;") _onInsertAdded: (change) -> start = @_shareJsOffsetToAcePosition(change.op.p) @@ -340,7 +340,7 @@ define [ session = @editor.getSession() doc = session.getDocument() background_range = new Range(start.row, start.column, end.row, end.column) - background_marker_id = session.addMarker background_range, "track-changes-added-marker", "text" + background_marker_id = session.addMarker background_range, "track-changes-marker track-changes-added-marker", "text" callout_marker_id = @_createCalloutMarker(start, "track-changes-added-marker-callout") @changeIdToMarkerIdMap[change.id] = { background_marker_id, callout_marker_id } @updateReviewEntriesScope() @@ -351,7 +351,7 @@ define [ doc = session.getDocument() markerLayer = @editor.renderer.$markerBack - klass = "track-changes-deleted-marker" + klass = "track-changes-marker track-changes-deleted-marker" background_range = @_makeZeroWidthRange(position) background_marker_id = session.addMarker background_range, klass, (html, range, left, top, config) -> markerLayer.drawSingleLineMarker(html, range, "#{klass} ace_start", config, 0, "") @@ -380,7 +380,7 @@ define [ session = @editor.getSession() doc = session.getDocument() background_range = new Range(start.row, start.column, end.row, end.column) - background_marker_id = session.addMarker background_range, "track-changes-comment-marker", "text" + background_marker_id = session.addMarker background_range, "track-changes-marker track-changes-comment-marker", "text" callout_marker_id = @_createCalloutMarker(start, "track-changes-comment-marker-callout") @changeIdToMarkerIdMap[comment.id] = { background_marker_id, callout_marker_id } @updateReviewEntriesScope() diff --git a/services/web/public/stylesheets/app/editor.less b/services/web/public/stylesheets/app/editor.less index d702106ddd..885ed20f89 100644 --- a/services/web/public/stylesheets/app/editor.less +++ b/services/web/public/stylesheets/app/editor.less @@ -141,37 +141,6 @@ background-repeat: repeat-x; background-position: bottom left; } - .track-changes-added-marker { - border-radius: 0; - position: absolute; - background-color: hsl(100, 70%, 85%); - } - .track-changes-added-marker-callout { - border-radius: 0; - position: absolute; - border-bottom: 1px dashed green; - } - .track-changes-comment-marker { - border-radius: 0; - position: absolute; - background-color: #fde5b7; - } - .track-changes-comment-marker-callout { - border-radius: 0; - position: absolute; - border-bottom: 1px dashed orange; - } - .track-changes-deleted-marker { - border-radius: 0; - position: absolute; - border-left: 2px dotted red; - margin-left: -1px; - } - .track-changes-deleted-marker-callout { - border-radius: 0; - position: absolute; - border-bottom: 1px dashed red; - } .remote-cursor { position: absolute; border-left: 2px solid transparent; diff --git a/services/web/public/stylesheets/app/editor/review-panel.less b/services/web/public/stylesheets/app/editor/review-panel.less index 2a7b89c612..8ff90cf086 100644 --- a/services/web/public/stylesheets/app/editor/review-panel.less +++ b/services/web/public/stylesheets/app/editor/review-panel.less @@ -512,3 +512,38 @@ } } } + +.ace-editor-wrapper { + .track-changes-marker-callout { + border-radius: 0; + position: absolute; + .rp-state-overview & { + display: none; + } + } + .track-changes-added-marker-callout { + border-bottom: 1px dashed @rp-green; + } + .track-changes-comment-marker-callout { + border-bottom: 1px dashed @rp-yellow; + } + .track-changes-deleted-marker-callout { + border-bottom: 1px dashed @rp-red; + } + + .track-changes-marker { + border-radius: 0; + position: absolute; + } + + .track-changes-comment-marker { + background-color: @rp-dim-yellow; + } + .track-changes-added-marker { + background-color: @rp-dim-green; + } + .track-changes-deleted-marker { + border-left: 2px dotted @rp-red; + margin-left: -1px; + } +}