]> git.wh0rd.org - tt-rss.git/commitdiff
initial for JS strict mode
authorAndrew Dolgov <noreply@fakecake.org>
Thu, 8 Mar 2018 15:33:42 +0000 (18:33 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Thu, 8 Mar 2018 15:33:42 +0000 (18:33 +0300)
index.php
js/PluginHost.js
js/feedlist.js
js/functions.js
js/prefs.js
js/tt-rss.js
js/viewfeed.js

index a1bcd5643570549dbcf34ee1d8dff41f8541b609..31d7670386f1886dc9a86d2cac0b540fe728f611 100644 (file)
--- a/index.php
+++ b/index.php
        } ?>
 
        <script type="text/javascript">
+               'use strict';
                require({cache:{}});
        <?php
                require_once 'lib/jshrink/Minifier.php';
index ae89ba48137cfcfe9de33ca1d680ebab8abe6283..88e2660ed37582a5844c212594c23fddc75df60c 100644 (file)
@@ -22,7 +22,7 @@ var PluginHost = {
                console.warn('PluginHost::run ' + name);
 
                if (typeof(this.hooks[name]) != 'undefined')
-                       for (i = 0; i < this.hooks[name].length; i++)
+                       for (var i = 0; i < this.hooks[name].length; i++)
                                if (!this.hooks[name][i](args)) break;
        }
 };
index 1e783f3b37f0e215a66143bbad08c9d9852b7cac..028c8737d8db0665ea36a03d2d41a18af16ffdf7 100644 (file)
@@ -164,7 +164,7 @@ function viewfeed(params) {
                window.open("backend.php" + query + "&debug=1&csrf_token=" + getInitParam("csrf_token"));
        }
 
-       timeout_ms = can_wait ? 250 : 0;
+       var timeout_ms = can_wait ? 250 : 0;
        _viewfeed_timeout = setTimeout(function() {
 
                new Ajax.Request("backend.php", {
index 9ae205cb3d7a770084326ac24e775fef22d8afb2..46b9958ea602cb20c440f7dbda25648603ddf7ce 100755 (executable)
@@ -1117,7 +1117,7 @@ function backend_sanity_check_callback(transport) {
        if (params) {
                console.log('reading init-params...');
 
-               for (k in params) {
+               for (var k in params) {
                        console.log("IP: " + k + " => " + JSON.stringify(params[k]));
                        if (k == "label_base_index") _label_base_index = parseInt(params[k]);
                }
index a3f32dcbc46c12bd6d10fcb87ba1d22339453497..aa06674df485279da5e3021316f595199fd90dd1 100755 (executable)
@@ -939,7 +939,7 @@ function pref_hotkey_handler(e) {
        var hotkey_action = false;
        var hotkeys = getInitParam("hotkeys");
 
-       for (sequence in hotkeys[1]) {
+       for (var sequence in hotkeys[1]) {
                if (sequence == hotkey) {
                        hotkey_action = hotkeys[1][sequence];
                        break;
index 4df1b04eeded6bf503477494b069c2f6d9e7b72e..d5d31cfed2001ed72291b7d87bdad8eb155e61e3 100644 (file)
@@ -628,7 +628,7 @@ function init_second_stage() {
        var hotkeys = getInitParam("hotkeys");
        var tmp = [];
 
-       for (sequence in hotkeys[1]) {
+       for (var sequence in hotkeys[1]) {
                filtered = sequence.replace(/\|.*$/, "");
                tmp[filtered] = hotkeys[1][sequence];
        }
@@ -752,7 +752,7 @@ function parse_runtime_info(data) {
 
        //console.log("parsing runtime info...");
 
-       for (k in data) {
+       for (var k in data) {
                var v = data[k];
 
 //             console.log("RI: " + k + " => " + v);
@@ -899,7 +899,7 @@ function hotkey_handler(e) {
        var hotkey_action = false;
        var hotkeys = getInitParam("hotkeys");
 
-       for (sequence in hotkeys[1]) {
+       for (var sequence in hotkeys[1]) {
                if (sequence == hotkey) {
                        hotkey_action = hotkeys[1][sequence];
                        break;
@@ -1076,11 +1076,11 @@ function update_random_feed() {
 }
 
 function hash_get(key) {
-       kv = window.location.hash.substring(1).toQueryParams();
+       var kv = window.location.hash.substring(1).toQueryParams();
        return kv[key];
 }
 function hash_set(key, value) {
-       kv = window.location.hash.substring(1).toQueryParams();
+       var kv = window.location.hash.substring(1).toQueryParams();
        kv[key] = value;
        window.location.hash = $H(kv).toQueryString();
 }
index ffd8fcf4674b4ffae7c37a10332f14f577c483da..925d7137981e82fdf61945fd442037c4f4c49c86 100755 (executable)
@@ -470,7 +470,7 @@ function togglePub(id, client_only, no_effects, note) {
                        imgs.push(fte[i]);
        }
 
-       for (i = 0; i < imgs.length; i++) {
+       for (var i = 0; i < imgs.length; i++) {
                var img = imgs[i];
 
                if (!row.hasClassName("published") || note != undefined) {