Pulling out strings into consts.
This commit is contained in:
Родитель
7201b00b9b
Коммит
21a46851cc
|
@ -1,5 +1,10 @@
|
|||
"use strict";
|
||||
|
||||
const SHOW_RECOMMENDATIONS_TAB = "Show Recommendations Tab";
|
||||
const HIDE_RECOMMENDATIONS_TAB = "Hide Recommendations Tab";
|
||||
const PROCESSING_BLURB = "Analyzing your history...";
|
||||
const ID_LINK = "https://www.mozilla.org/en-US/firefox/interest-dashboard/";
|
||||
|
||||
let table, tour;
|
||||
|
||||
let DataService = function($rootScope) {
|
||||
|
@ -27,7 +32,7 @@ aboutYou.controller("vizCtrl", function($scope, dataService) {
|
|||
$scope.daysLeft = null;
|
||||
$scope.daysLeftStart = null;
|
||||
$scope.percentProcessed = null;
|
||||
$scope.recommenderTabToggle = "Show Recommendations Tab";
|
||||
$scope.recommenderTabToggle = SHOW_RECOMMENDATIONS_TAB;
|
||||
dataService.send("chart_data_request");
|
||||
}
|
||||
$scope.safeApply = function(fn) {
|
||||
|
@ -69,7 +74,7 @@ aboutYou.controller("vizCtrl", function($scope, dataService) {
|
|||
};
|
||||
|
||||
$scope.updateProgressBar = function(value) {
|
||||
$scope.processingBlurb = "Analyzing your history...";
|
||||
$scope.processingBlurb = PROCESSING_BLURB;
|
||||
|
||||
let val = value ? value : (100 - Math.round($scope.daysLeft / $scope.daysLeftStart * 100));
|
||||
$scope.percentProcessed = val + "%"
|
||||
|
@ -82,10 +87,10 @@ aboutYou.controller("vizCtrl", function($scope, dataService) {
|
|||
|
||||
$scope.setRecommendationTabVisibility = function() {
|
||||
let displayVal = "initial";
|
||||
$scope.recommenderTabToggle = "Hide Recommendations Tab";
|
||||
$scope.recommenderTabToggle = HIDE_RECOMMENDATIONS_TAB;
|
||||
if ($('#recommend_tab').css("display") == "block") {
|
||||
displayVal = "none";
|
||||
$scope.recommenderTabToggle = "Show Recommendations Tab";
|
||||
$scope.recommenderTabToggle = SHOW_RECOMMENDATIONS_TAB;
|
||||
|
||||
// Switching focus to recommendations bubble content
|
||||
$('#yourInterests').addClass("active");
|
||||
|
@ -216,7 +221,7 @@ BrowserTour.prototype.bindEvents = function () {
|
|||
this.$closeButton.on('click', this.closeTour.bind(this));
|
||||
$('.cta button').on('click', () => {
|
||||
this.closeTour();
|
||||
window.open("https://www.mozilla.org/en-US/firefox/interest-dashboard/", '_blank');
|
||||
window.open(ID_LINK, '_blank');
|
||||
});
|
||||
$('button.step').on('click', this.onStepClick.bind(this));
|
||||
this.$tourControls.on('mouseenter focus', 'button.step', this.onStepHover.bind(this));
|
||||
|
|
Загрузка…
Ссылка в новой задаче