From 41721b0898c521be5f23ff4def0bf206444a67cf Mon Sep 17 00:00:00 2001
From: Kane York
Date: Tue, 15 Sep 2015 12:25:29 -0700
Subject: [PATCH] Rename variables
---
.../javascripts/discourse/lib/screen-track.js.es6 | 12 +++++++-----
.../discourse/templates/components/signup-cta.hbs | 4 ++--
config/locales/client.en.yml | 4 ++--
3 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/app/assets/javascripts/discourse/lib/screen-track.js.es6 b/app/assets/javascripts/discourse/lib/screen-track.js.es6
index 26451f433cd..8fe233401b5 100644
--- a/app/assets/javascripts/discourse/lib/screen-track.js.es6
+++ b/app/assets/javascripts/discourse/lib/screen-track.js.es6
@@ -136,14 +136,14 @@ const ScreenTrack = Ember.Object.extend({
});
} else {
// Anonymous viewer - save to localStorage
- const store = this.get('keyValueStore');
+ const storage = this.get('keyValueStore');
// Save total time
- const existingTime = store.getInt('anon-topic-time');
- store.setItem('anon-topic-time', existingTime + this.get('topicTime'));
+ const existingTime = storage.getInt('anon-topic-time');
+ storage.setItem('anon-topic-time', existingTime + this.get('topicTime'));
// Save unique topic IDs up to a max
- let topicIds = store.get('anon-topic-ids');
+ let topicIds = storage.get('anon-topic-ids');
if (topicIds) {
topicIds = topicIds.split(',').map(e => parseInt(e));
} else {
@@ -151,13 +151,15 @@ const ScreenTrack = Ember.Object.extend({
}
if (topicIds.indexOf(topicId) === -1 && topicIds.length < ANON_MAX_TOPIC_IDS) {
topicIds.push(topicId);
- store.setItem('anon-topic-ids', topicIds.join(','));
+ storage.setItem('anon-topic-ids', topicIds.join(','));
}
// Inform the observer
if (this.get('anonFlushCallback')) {
this.get('anonFlushCallback')();
}
+
+ // No need to call controller.readPosts()
}
this.set('topicTime', 0);
diff --git a/app/assets/javascripts/discourse/templates/components/signup-cta.hbs b/app/assets/javascripts/discourse/templates/components/signup-cta.hbs
index defda14fab6..818f66cd841 100644
--- a/app/assets/javascripts/discourse/templates/components/signup-cta.hbs
+++ b/app/assets/javascripts/discourse/templates/components/signup-cta.hbs
@@ -5,8 +5,8 @@
{{i18n "signup_cta.hide_forever"}}
{{else}}
- {{i18n "signup_cta.line_1"}}
- {{i18n "signup_cta.line_2"}}
+ {{i18n "signup_cta.intro"}}
+ {{i18n "signup_cta.value_prop"}}
{{signupMethodsTranslated}}
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 16940aaa2cf..283b9bdbd19 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -717,8 +717,8 @@ en:
hide_session: "Remind me tomorrow"
hide_forever: "Never show this again"
hidden_for_session: "OK, I'll ask you tomorrow. You can always click the 'Log In' button to create an account, too."
- line_1: Looks like you're enjoying the forum, but you're not signed up for an account.
- line_2: Logged-in users get their last read position in every topic saved, so you come right back where you left off. You can also "Watch" topics so that you get a notification whenever a new post is made, and you can give likes to others' posts.
+ intro: Hey there! Looks like you're enjoying the forum, but you're not signed up for an account.
+ value_prop: Logged-in users get their last read position in every topic saved, so you come right back where you left off. You can also "Watch" topics so that you get a notification whenever a new post is made, and you can give likes to others' posts.
methods:
sso: "Use your account on the main site to log in."
only_email: "Signing up is easy: you just need a valid email account and a password."