mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Refactor AB test participation code; add conversion code.
This commit is contained in:
@@ -81,12 +81,6 @@ define [
|
||||
if $scope.user.signUpDate >= '2016-10-27'
|
||||
$scope.shouldABTestPlans = true
|
||||
|
||||
$scope.shouldABAddCommentBtn = false
|
||||
if $scope.user.signUpDate >= '2016-03-22'
|
||||
$scope.shouldABAddCommentBtn = true
|
||||
sixpack.participate "add-comment-btn", [ "default", "editor-corner" ], (variation) ->
|
||||
$scope.variationABAddCommentBtn = variation
|
||||
|
||||
$scope.settings = window.userSettings
|
||||
$scope.anonymous = window.anonymous
|
||||
|
||||
|
||||
+10
-9
@@ -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, localStorage) ->
|
||||
App.controller "ReviewPanelController", ($scope, $element, ide, $timeout, $http, $modal, event_tracking, sixpack, localStorage) ->
|
||||
$reviewPanelEl = $element.find "#review-panel"
|
||||
|
||||
$scope.SubViews =
|
||||
@@ -29,13 +29,12 @@ define [
|
||||
loadingThreads: false
|
||||
newAddCommentUI: false # Test new UI for adding comments; remove afterwards.
|
||||
|
||||
if $scope.shouldABAddCommentBtn and $scope.variationABAddCommentBtn? == "editor-corner"
|
||||
$scope.reviewPanel.newAddCommentUI = true
|
||||
console.log "editor corner"
|
||||
else
|
||||
console.log "default"
|
||||
|
||||
console.log $scope.shouldABAddCommentBtn
|
||||
$scope.shouldABAddCommentBtn = false
|
||||
if $scope.user.signUpDate >= '2016-03-22'
|
||||
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 = {}
|
||||
@@ -344,7 +343,9 @@ 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 == ""
|
||||
doc_id = $scope.editor.open_doc_id
|
||||
|
||||
Reference in New Issue
Block a user