Merge branch 'master' into pdfng
This commit is contained in:
@@ -2,8 +2,23 @@ define [
|
||||
"base"
|
||||
"libs/md5"
|
||||
], (App) ->
|
||||
|
||||
oldKeys = [
|
||||
"sl_abt_multi_currency_editor_eu-eu"
|
||||
"sl_abt_multi_currency_eu-eu"
|
||||
"sl_abt_multi_currency_editor_eu-usd"
|
||||
"sl_abt_multi_currency_eu-usd"
|
||||
"sl_abt_trial_len_14d"
|
||||
"sl_abt_trial_len_7d"
|
||||
"sl_abt_trial_len_30d"
|
||||
"sl_utt"
|
||||
"sl_utt_trial_len"
|
||||
"sl_utt_multi_currency"
|
||||
]
|
||||
|
||||
App.factory "abTestManager", ($http, ipCookie) ->
|
||||
|
||||
_.each oldKeys, (oldKey)->
|
||||
ipCookie.remove(oldKey)
|
||||
|
||||
_buildCookieKey = (testName, bucket)->
|
||||
key = "sl_abt_#{testName}_#{bucket}"
|
||||
|
||||
@@ -27,6 +27,7 @@ define [
|
||||
"directives/rightClick"
|
||||
"filters/formatDate"
|
||||
"main/event-tracking"
|
||||
"main/account-upgrade"
|
||||
], (
|
||||
App
|
||||
FileTreeManager
|
||||
@@ -38,7 +39,8 @@ define [
|
||||
PdfManager
|
||||
BinaryFilesManager
|
||||
) ->
|
||||
App.controller "IdeController", ($scope, $timeout, ide, abTestManager) ->
|
||||
|
||||
App.controller "IdeController", ($scope, $timeout, ide) ->
|
||||
# Don't freak out if we're already in an apply callback
|
||||
$scope.$originalApply = $scope.$apply
|
||||
$scope.$apply = (fn = () ->) ->
|
||||
@@ -64,11 +66,7 @@ define [
|
||||
|
||||
$scope.chat = {}
|
||||
|
||||
$scope.startFreeTrial = (source) ->
|
||||
ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)
|
||||
window.open("/user/subscription/new?planCode=student_free_trial_7_days")
|
||||
$scope.startedFreeTrial = true
|
||||
|
||||
|
||||
window._ide = ide
|
||||
|
||||
ide.project_id = $scope.project_id = window.project_id
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
define [
|
||||
"base"
|
||||
], (App) ->
|
||||
App.controller "FreeTrialModalController", ($scope, abTestManager)->
|
||||
|
||||
buttonColorBuckets = [
|
||||
{ bucketName:"red", btnClass:"primary"}
|
||||
{ bucketName:"blue", btnClass:"info"}
|
||||
]
|
||||
|
||||
buttonColorBucket = abTestManager.getABTestBucket "button_color", buttonColorBuckets
|
||||
abTestManager.processTestWithStep("button_color", buttonColorBucket.bucketName, 0)
|
||||
$scope.buttonClass = "btn-#{buttonColorBucket.btnClass}"
|
||||
|
||||
|
||||
$scope.startFreeTrial = (source) ->
|
||||
|
||||
testBuckets = [
|
||||
{ bucketName:"student_control", planName:"student"}
|
||||
{ bucketName:"collab_test", planName:"collaborator"}
|
||||
]
|
||||
|
||||
editorPlanBucket = abTestManager.getABTestBucket "editor_plan", testBuckets
|
||||
abTestManager.processTestWithStep("editor_plan", editorPlanBucket.bucketName, 0)
|
||||
ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)
|
||||
window.open("/user/subscription/new?planCode=#{editorPlanBucket.planName}_free_trial_7_days&ssp=#{editorPlanBucket.planName == 'collaborator'}")
|
||||
$scope.startedFreeTrial = true
|
||||
@@ -7,16 +7,8 @@ define [
|
||||
$scope.currencyCode = MultiCurrencyPricing.currencyCode
|
||||
$scope.plans = MultiCurrencyPricing.plans
|
||||
|
||||
|
||||
if MultiCurrencyPricing.currencyCode != "USD"
|
||||
currencyBuckets = [
|
||||
{ bucketName:"eu-eu", currency:MultiCurrencyPricing.currencyCode}
|
||||
{ bucketName:"eu-usd", currency:"USD"}
|
||||
]
|
||||
multiCurrencyBucket = abTestManager.getABTestBucket "multi_currency", currencyBuckets
|
||||
$scope.currencyCode = multiCurrencyBucket.currency
|
||||
abTestManager.processTestWithStep("multi_currency_editor", multiCurrencyBucket.bucketName, 0)
|
||||
|
||||
|
||||
$scope.changeCurrency = (newCurrency)->
|
||||
window.location = "/user/subscription/new?planCode=#{window.plan_code}¤cy=#{newCurrency}"
|
||||
window.location = "/user/subscription/new?planCode=#{window.plan_code}¤cy=#{newCurrency}"
|
||||
|
||||
$scope.switchToStudent = ()->
|
||||
window.location = "/user/subscription/new?planCode=student¤cy=#{$scope.currencyCode}"
|
||||
@@ -46,29 +46,111 @@ define [
|
||||
professional:
|
||||
monthly: "£24"
|
||||
annual: "£288"
|
||||
|
||||
SEK:
|
||||
symbol: "kr"
|
||||
student:
|
||||
monthly: "60 kr"
|
||||
annual: "600 kr"
|
||||
collaborator:
|
||||
monthly: "110 kr"
|
||||
annual: "1320 kr"
|
||||
professional:
|
||||
monthly: "220 kr"
|
||||
annual: "2640 kr"
|
||||
CAD:
|
||||
symbol: "$"
|
||||
student:
|
||||
monthly: "$9"
|
||||
annual: "$90"
|
||||
collaborator:
|
||||
monthly: "$17"
|
||||
annual: "$204"
|
||||
professional:
|
||||
monthly: "$34"
|
||||
annual: "$408"
|
||||
|
||||
NOK:
|
||||
symbol: "kr"
|
||||
student:
|
||||
monthly: "60 kr"
|
||||
annual: "600 kr"
|
||||
collaborator:
|
||||
monthly: "110 kr"
|
||||
annual: "1320 kr"
|
||||
professional:
|
||||
monthly: "220 kr"
|
||||
annual: "2640 kr"
|
||||
|
||||
DKK:
|
||||
symbol: "kr"
|
||||
student:
|
||||
monthly: "50 kr"
|
||||
annual: "500 kr"
|
||||
collaborator:
|
||||
monthly: "90 kr"
|
||||
annual: "1080 kr"
|
||||
professional:
|
||||
monthly: "180 kr"
|
||||
annual: "2160 kr"
|
||||
|
||||
AUD:
|
||||
symbol: "$"
|
||||
student:
|
||||
monthly: "$10"
|
||||
annual: "$100"
|
||||
collaborator:
|
||||
monthly: "$18"
|
||||
annual: "$216"
|
||||
professional:
|
||||
monthly: "$35"
|
||||
annual: "$420"
|
||||
|
||||
NZD:
|
||||
symbol: "$"
|
||||
student:
|
||||
monthly: "$10"
|
||||
annual: "$100"
|
||||
collaborator:
|
||||
monthly: "$18"
|
||||
annual: "$216"
|
||||
professional:
|
||||
monthly: "$35"
|
||||
annual: "$420"
|
||||
|
||||
CHF:
|
||||
symbol: "Fr"
|
||||
student:
|
||||
monthly: "Fr 8"
|
||||
annual: "Fr 80"
|
||||
collaborator:
|
||||
monthly: "Fr 15"
|
||||
annual: "Fr 180"
|
||||
professional:
|
||||
monthly: "Fr 30"
|
||||
annual: "Fr 360"
|
||||
|
||||
SGD:
|
||||
symbol: "$"
|
||||
student:
|
||||
monthly: "$12"
|
||||
annual: "$120"
|
||||
collaborator:
|
||||
monthly: "$20"
|
||||
annual: "$240"
|
||||
professional:
|
||||
monthly: "$40"
|
||||
annual: "$480"
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
App.controller "PlansController", ($scope, $modal, event_tracking, abTestManager, MultiCurrencyPricing, $http) ->
|
||||
|
||||
|
||||
$scope.plans = MultiCurrencyPricing.plans
|
||||
$scope.currencyCode = MultiCurrencyPricing.currencyCode
|
||||
|
||||
|
||||
|
||||
if MultiCurrencyPricing.currencyCode != "USD"
|
||||
currencyBuckets = [
|
||||
{ bucketName:"eu-eu", currency:MultiCurrencyPricing.currencyCode}
|
||||
{ bucketName:"eu-usd", currency:"USD"}
|
||||
]
|
||||
multiCurrencyBucket = abTestManager.getABTestBucket "multi_currency", currencyBuckets
|
||||
$scope.currencyCode = multiCurrencyBucket.currency
|
||||
|
||||
|
||||
|
||||
$scope.trial_len = 7
|
||||
$scope.planQueryString = '_free_trial_7_days'
|
||||
|
||||
@@ -76,14 +158,10 @@ define [
|
||||
view: "monthly"
|
||||
|
||||
|
||||
|
||||
$scope.changeCurreny = (newCurrency)->
|
||||
$scope.currencyCode = newCurrency
|
||||
|
||||
$scope.signUpNowClicked = (plan, annual)->
|
||||
if multiCurrencyBucket?
|
||||
abTestManager.processTestWithStep("multi_currency", multiCurrencyBucket.bucketName, 0)
|
||||
|
||||
if $scope.ui.view == "annual"
|
||||
plan = "#{plan}_annual"
|
||||
|
||||
|
||||
@@ -91,6 +91,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
.plansPageStudentLink {
|
||||
margin-left: 20px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user