[Pkg-mozext-commits] [wot] 66/226: Added setting up the time of the add-on's first launch, which will be used in several cases (FBL, gradually changing min conf level, etc)

David Prévot taffit at moszumanska.debian.org
Fri May 1 00:35:35 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository wot.

commit 36d1d2e03d4b6b2a30981940fac8a2da4f293f5e
Author: Sergey Andryukhin <sorgoz at yandex.com>
Date:   Mon Jan 7 11:44:49 2013 +0200

    Added setting up the time of the add-on's first launch, which will be used in several cases (FBL, gradually changing min conf level, etc)
---
 content/config.js   |  1 +
 content/firstrun.js | 13 +++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/content/config.js b/content/config.js
index aaba65d..80e70a0 100644
--- a/content/config.js
+++ b/content/config.js
@@ -243,6 +243,7 @@ const wot_prefs_char = [
 	[ "cookie_updated",				"0"	],
 	[ "extension_id",				""	],
 	[ "firstrun_guide",				"0"	],
+	[ "firstrun_time",				""	],
 	[ "last_message",				""	],
 	[ "last_version",				""	],
 	[ "norepsfor",					""	],
diff --git a/content/firstrun.js b/content/firstrun.js
index 7d5db30..2df960c 100644
--- a/content/firstrun.js
+++ b/content/firstrun.js
@@ -64,8 +64,21 @@ var wot_firstrun =
 			}
 
 			if (this.opentab(WOT_FIRSTRUN_WELCOME, wot_url.getprefurl(tab))) {
+
+				// not a first time launch, but...
+				// check it the date of first time is set, otherwise set it to 2 weeks ago date
+				if (!wot_prefs.getChar("firstrun_time", "")) {
+					var d = new Date();
+					var past_date = new Date(d.getFullYear(), d.getMonth(), d.getDay() - 14);
+					wot_prefs.setChar("firstrun_time", past_date);
+				}
+
 				this.opentab(WOT_FIRSTRUN_CURRENT,
 					wot_url.getprefurl(partner, false, WOT_UPDATE_PATH));
+			} else {
+				// the add-on is launched first time
+				// remember the date/time of the first launch
+				wot_prefs.setChar("firstrun_time", new Date());
 			}
 		} catch (e) {
 			dump("wot_firstrun.load: failed with " + e + "\n");

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/wot.git



More information about the Pkg-mozext-commits mailing list