initial for JS strict mode

master
Andrew Dolgov 6 years ago
parent c9a5e5aa28
commit 3009ecc44f

@ -110,6 +110,7 @@
} ?> } ?>
<script type="text/javascript"> <script type="text/javascript">
'use strict';
require({cache:{}}); require({cache:{}});
<?php <?php
require_once 'lib/jshrink/Minifier.php'; require_once 'lib/jshrink/Minifier.php';

@ -22,7 +22,7 @@ var PluginHost = {
console.warn('PluginHost::run ' + name); console.warn('PluginHost::run ' + name);
if (typeof(this.hooks[name]) != 'undefined') 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; if (!this.hooks[name][i](args)) break;
} }
}; };

@ -164,7 +164,7 @@ function viewfeed(params) {
window.open("backend.php" + query + "&debug=1&csrf_token=" + getInitParam("csrf_token")); 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() { _viewfeed_timeout = setTimeout(function() {
new Ajax.Request("backend.php", { new Ajax.Request("backend.php", {

@ -1117,7 +1117,7 @@ function backend_sanity_check_callback(transport) {
if (params) { if (params) {
console.log('reading init-params...'); console.log('reading init-params...');
for (k in params) { for (var k in params) {
console.log("IP: " + k + " => " + JSON.stringify(params[k])); console.log("IP: " + k + " => " + JSON.stringify(params[k]));
if (k == "label_base_index") _label_base_index = parseInt(params[k]); if (k == "label_base_index") _label_base_index = parseInt(params[k]);
} }

@ -939,7 +939,7 @@ function pref_hotkey_handler(e) {
var hotkey_action = false; var hotkey_action = false;
var hotkeys = getInitParam("hotkeys"); var hotkeys = getInitParam("hotkeys");
for (sequence in hotkeys[1]) { for (var sequence in hotkeys[1]) {
if (sequence == hotkey) { if (sequence == hotkey) {
hotkey_action = hotkeys[1][sequence]; hotkey_action = hotkeys[1][sequence];
break; break;

@ -628,7 +628,7 @@ function init_second_stage() {
var hotkeys = getInitParam("hotkeys"); var hotkeys = getInitParam("hotkeys");
var tmp = []; var tmp = [];
for (sequence in hotkeys[1]) { for (var sequence in hotkeys[1]) {
filtered = sequence.replace(/\|.*$/, ""); filtered = sequence.replace(/\|.*$/, "");
tmp[filtered] = hotkeys[1][sequence]; tmp[filtered] = hotkeys[1][sequence];
} }
@ -752,7 +752,7 @@ function parse_runtime_info(data) {
//console.log("parsing runtime info..."); //console.log("parsing runtime info...");
for (k in data) { for (var k in data) {
var v = data[k]; var v = data[k];
// console.log("RI: " + k + " => " + v); // console.log("RI: " + k + " => " + v);
@ -899,7 +899,7 @@ function hotkey_handler(e) {
var hotkey_action = false; var hotkey_action = false;
var hotkeys = getInitParam("hotkeys"); var hotkeys = getInitParam("hotkeys");
for (sequence in hotkeys[1]) { for (var sequence in hotkeys[1]) {
if (sequence == hotkey) { if (sequence == hotkey) {
hotkey_action = hotkeys[1][sequence]; hotkey_action = hotkeys[1][sequence];
break; break;
@ -1076,11 +1076,11 @@ function update_random_feed() {
} }
function hash_get(key) { function hash_get(key) {
kv = window.location.hash.substring(1).toQueryParams(); var kv = window.location.hash.substring(1).toQueryParams();
return kv[key]; return kv[key];
} }
function hash_set(key, value) { function hash_set(key, value) {
kv = window.location.hash.substring(1).toQueryParams(); var kv = window.location.hash.substring(1).toQueryParams();
kv[key] = value; kv[key] = value;
window.location.hash = $H(kv).toQueryString(); window.location.hash = $H(kv).toQueryString();
} }

@ -470,7 +470,7 @@ function togglePub(id, client_only, no_effects, note) {
imgs.push(fte[i]); imgs.push(fte[i]);
} }
for (i = 0; i < imgs.length; i++) { for (var i = 0; i < imgs.length; i++) {
var img = imgs[i]; var img = imgs[i];
if (!row.hasClassName("published") || note != undefined) { if (!row.hasClassName("published") || note != undefined) {

Loading…
Cancel
Save