[Pkg-mozext-commits] [wot] 215/226: Fixed code validation issues and added "use strict" mode;
David Prévot
taffit at moszumanska.debian.org
Fri May 1 00:35:53 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 0dd5aea4031f99cfd77e0b860f60c983ddbda829
Author: Sergey Andryukhin <sorgoz at yandex.com>
Date: Fri May 9 14:24:17 2014 +0300
Fixed code validation issues and added "use strict" mode;
---
content/api.js | 2 ++
content/cache.js | 2 ++
content/categories.js | 4 +++-
content/commands.js | 2 ++
content/config.js | 2 ++
content/cookies.js | 2 ++
content/core.js | 6 ++++--
content/firstrun.js | 2 ++
content/injections/ga_init.js | 1 +
content/injections/wot_proxy.js | 2 ++
content/my.js | 2 ++
content/partner.js | 2 ++
content/popup.js | 2 ++
content/prefs.js | 2 ++
content/ratingwindow.js | 2 ++
content/rw/proxies.js | 4 +++-
content/rw/ratingwindow.js | 4 +++-
content/rw/wot.js | 5 ++++-
content/search.js | 8 +++++---
content/settings.js | 2 ++
content/shared.js | 4 +++-
content/storage.js | 2 ++
content/surveys.js | 2 ++
content/tools.js | 1 +
content/ui.js | 2 ++
content/util.js | 2 ++
content/warning.js | 3 ++-
content/wg.js | 2 ++
28 files changed, 65 insertions(+), 11 deletions(-)
diff --git a/content/api.js b/content/api.js
index 6e479a6..6d140e3 100644
--- a/content/api.js
+++ b/content/api.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
var wot_api_link =
{
call: function(rule, content, batch, retrycount)
diff --git a/content/cache.js b/content/cache.js
index 08591e7..3285513 100644
--- a/content/cache.js
+++ b/content/cache.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
var wot_hashtable =
{
load: function()
diff --git a/content/categories.js b/content/categories.js
index b316725..c971bc5 100644
--- a/content/categories.js
+++ b/content/categories.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
var wot_categories = {
PREF_CATEGORY: "category",
@@ -161,7 +163,7 @@ var wot_categories = {
this.cat_combinations = {};
this.cat_combinations_prio = ["6a"]; // first default value
- for (i = 0; i < conflicts.length; i++) {
+ for (var i = 0; i < conflicts.length; i++) {
var conflict = conflicts[i],
rule = String(conflict.rule).toLowerCase();
diff --git a/content/commands.js b/content/commands.js
index bc59b52..07263d5 100644
--- a/content/commands.js
+++ b/content/commands.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
var wot_commands =
{
load_delayed: function()
diff --git a/content/config.js b/content/config.js
index b2fc49f..1abb81e 100644
--- a/content/config.js
+++ b/content/config.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
const WOT_PLATFORM = "firefox";
const WOT_VERSION = "20140422";
diff --git a/content/cookies.js b/content/cookies.js
index 3f479da..582d4e8 100644
--- a/content/cookies.js
+++ b/content/cookies.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
const WOT_COOKIE_TIMEOUT = 10000;
const WOT_COOKIE_TOPIC = "http-on-modify-request";
diff --git a/content/core.js b/content/core.js
index 75af7b4..8097c35 100644
--- a/content/core.js
+++ b/content/core.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
function wot_listener(browser)
{
this.browser = browser;
@@ -121,8 +123,8 @@ var wot_core =
try {
this.detect_environment();
- window.addEventListener("load", function(e) {
- window.removeEventListener("load", arguments.callee, true);
+ window.addEventListener("load", function on_load (e) {
+ window.removeEventListener("load", on_load, true);
wot_core.load();
}, false);
diff --git a/content/firstrun.js b/content/firstrun.js
index 8206999..7dfc736 100644
--- a/content/firstrun.js
+++ b/content/firstrun.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
var wot_firstrun =
{
opentab: function(version, url)
diff --git a/content/injections/ga_init.js b/content/injections/ga_init.js
index 17d4de8..bea08b8 100644
--- a/content/injections/ga_init.js
+++ b/content/injections/ga_init.js
@@ -18,6 +18,7 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
// for analytics
(function() {
diff --git a/content/injections/wot_proxy.js b/content/injections/wot_proxy.js
index 43e66d6..5290359 100644
--- a/content/injections/wot_proxy.js
+++ b/content/injections/wot_proxy.js
@@ -23,6 +23,8 @@
* wot_proxy helps with it by providing the same interface of wot object but using config.js values.
* */
+"use strict";
+
var wot = {
version: "20140113", // TODO: init this value from the add-on core code
platform: "firefox",
diff --git a/content/my.js b/content/my.js
index 0a36dd9..d4c1f3f 100644
--- a/content/my.js
+++ b/content/my.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
var wot_my_session =
{
last_reset: null,
diff --git a/content/partner.js b/content/partner.js
index 2a00371..5947b1f 100644
--- a/content/partner.js
+++ b/content/partner.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
var wot_partner =
{
partner: null,
diff --git a/content/popup.js b/content/popup.js
index c3cd906..918406e 100644
--- a/content/popup.js
+++ b/content/popup.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
const WOT_POPUP_HTML =
'<div id="wot-logo">{POPUPHEADERTEXT}</div>' +
'<div id="wot-ratings{ID}" class="wot-ratings">' +
diff --git a/content/prefs.js b/content/prefs.js
index 7d8ebc1..e45089a 100644
--- a/content/prefs.js
+++ b/content/prefs.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
/* Observes extension preferences */
var wot_prefs =
{
diff --git a/content/ratingwindow.js b/content/ratingwindow.js
index efbf042..5a74ec8 100644
--- a/content/ratingwindow.js
+++ b/content/ratingwindow.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
var wot_rw = {
RW_URL: "chrome://wot/content/rw/ratingwindow.html",
diff --git a/content/rw/proxies.js b/content/rw/proxies.js
index 7ebdf08..e27386a 100644
--- a/content/rw/proxies.js
+++ b/content/rw/proxies.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
// The purpose of this file is to handle objects and methods that exist in Chrome browser but doesn't in Firefox
var wot_bg = {
@@ -122,7 +124,7 @@ $.extend(wot_bg.wot, wot, {
popular_tags: [ ],
popular_tags_updated: null,
- POPULARTAGS_UPD_INTERVAL: 30 * 60 * 1000,
+ POPULARTAGS_UPD_INTERVAL: 30 * 60 * 1000
}
},
diff --git a/content/rw/ratingwindow.js b/content/rw/ratingwindow.js
index e1a5e2c..aafee1c 100644
--- a/content/rw/ratingwindow.js
+++ b/content/rw/ratingwindow.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
$.extend(wot, { ratingwindow: {
MAX_VOTED_VISIBLE: 4, // how many voted categories we can show in one line
sliderwidth: 154,
@@ -934,7 +936,7 @@ $.extend(wot, { ratingwindow: {
// At least one category must be voted as YES since user gives a rating
var _rw = wot.ratingwindow,
votes = votes_obj || _rw.cat_selector.get_user_votes(true); // get votes as object {cat_id : vote }
- for(i in votes) {
+ for(var i in votes) {
if (votes[i] == 1) {
return true;
}
diff --git a/content/rw/wot.js b/content/rw/wot.js
index 229a72a..45982e9 100644
--- a/content/rw/wot.js
+++ b/content/rw/wot.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
var wot = {
version: 20140317,
platform: "firefox",
@@ -728,7 +730,8 @@ var wot = {
// copies and validates categories from saved preferences (actually prefs['update:state'])
init_categories: function (_prefs) {
try {
- var update_state = (typeof _prefs.get == "function") ? _prefs.get("update:state") : _prefs["update:state"];
+ var cat,
+ update_state = (typeof _prefs.get == "function") ? _prefs.get("update:state") : _prefs["update:state"];
if (update_state && !wot.utils.isEmptyObject(update_state) &&
update_state.categories && update_state.categories.length > 0) {
diff --git a/content/search.js b/content/search.js
index 9f357d8..cb53186 100644
--- a/content/search.js
+++ b/content/search.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
var wot_search =
{
attrstr: [
@@ -598,11 +600,11 @@ var wot_search =
visibility = null;
// clojure
- function set_visibility() {
+ var set_visibility = function set_visibility() {
elem.setAttribute("class", visibility);
- }
+ };
- function do_ninja(event) {
+ var do_ninja = function do_ninja(event) {
// It needs to be called as clojure to access "elem"
if (ninja_timer) clearTimeout(ninja_timer);
diff --git a/content/settings.js b/content/settings.js
index 5b4858b..e78c9f9 100644
--- a/content/settings.js
+++ b/content/settings.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
var wot_settings =
{
disallowed: {
diff --git a/content/shared.js b/content/shared.js
index 746188b..29a5e2f 100644
--- a/content/shared.js
+++ b/content/shared.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
const WOT_PREFIX_SHARED = "wot_shared";
var wot_shared =
@@ -311,7 +313,7 @@ var wot_shared =
}
return null;
- },
+ }
};
wot_modules.push({ name: "wot_shared", obj: wot_shared });
diff --git a/content/storage.js b/content/storage.js
index 8cadbcb..039b0a9 100644
--- a/content/storage.js
+++ b/content/storage.js
@@ -20,6 +20,8 @@
// Stores the data from server in the local JSON file in the profile directory. Kind of persistent cache.
+"use strict";
+
var wot_storage =
{
_FILENAME: "storage.json",
diff --git a/content/surveys.js b/content/surveys.js
index 5eb58c7..e72af06 100644
--- a/content/surveys.js
+++ b/content/surveys.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
const WOT_PREFIX_ASKED = "wot_asked";
const WOT_FBL_ASKED_RE = new RegExp(WOT_PREFIX_ASKED + "\:(.+)\:(.+)\:status");
const WOT_FBL_ASKED_LOADED = "wot_asked_loaded";
diff --git a/content/tools.js b/content/tools.js
index d110cc3..3d8cd85 100644
--- a/content/tools.js
+++ b/content/tools.js
@@ -18,6 +18,7 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
var wot_modules = [];
diff --git a/content/ui.js b/content/ui.js
index 51a138f..3e332f9 100644
--- a/content/ui.js
+++ b/content/ui.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
var wot_status = {
set: function(status, description)
{
diff --git a/content/util.js b/content/util.js
index f95066c..98c896d 100644
--- a/content/util.js
+++ b/content/util.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
var wot_util =
{
reportError: function(params)
diff --git a/content/warning.js b/content/warning.js
index fb60bba..bc9becb 100644
--- a/content/warning.js
+++ b/content/warning.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
const WOT_WARNING_CSS = "@import \"chrome://wot/skin/include/warning.css\";";
var wot_warning =
@@ -372,7 +374,6 @@ var wot_warning =
}
var warning_width = this.width,
- width = container.clientWidth;
height = container.clientHeight;
return {
diff --git a/content/wg.js b/content/wg.js
index cf75378..2cdb25d 100644
--- a/content/wg.js
+++ b/content/wg.js
@@ -18,6 +18,8 @@
along with WOT. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
var wot_wg = {
/* WOT Groups core functionality */
--
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