Use Javascript strict mode

This commit is contained in:
Chocobo1 2018-11-30 18:30:26 +08:00
parent 1c525d9c19
commit 1cb065edc6
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
27 changed files with 54 additions and 0 deletions

View file

@ -8,6 +8,8 @@
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
<script src="scripts/lib/mootools-1.2-more.js"></script>
<script>
'use strict';
window.addEvent('domready', function() {
var setLocationKeyboardEvents = new Keyboard({
defaultEventType: 'keydown',

View file

@ -8,6 +8,8 @@
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
<script src="scripts/lib/mootools-1.2-more.js"></script>
<script>
'use strict';
var hashes = new URI().getData('hashes').split('|');
window.addEvent('domready', function() {
$('cancelBtn').focus();

View file

@ -135,6 +135,8 @@
</div>
</form>
<script>
'use strict';
var encodedUrls = new URI().getData('urls');
if (encodedUrls) {
var urls = [];

View file

@ -22,6 +22,8 @@
<div class="clear"></div>
</div>
<script>
'use strict';
var hashes = new URI().getData('hashes').split('|');
setDlLimit = function() {
var limit = $("dllimitUpdatevalue").value.toInt() * 1024;

View file

@ -23,6 +23,8 @@
</div>
<script>
'use strict';
var categoriesFilterContextMenu = new CategoriesFilterContextMenu({
targets: '.categoriesFilterContextMenuTarget',
menu: 'categoriesFilterMenu',

View file

@ -9,6 +9,8 @@
<script src="scripts/lib/mootools-1.2-more.js"></script>
<script src="scripts/misc.js?locale=${LANG}"></script>
<script>
'use strict';
var newCategoryKeyboardEvents = new Keyboard({
defaultEventType: 'keydown',
events: {

View file

@ -25,6 +25,8 @@
</div>
<script>
'use strict';
// Tabs
MochaUI.initializeTabs('preferencesTabs');

View file

@ -814,6 +814,8 @@
<div style="text-align: center; margin-top: 1em;"><input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" onclick="applyPreferences();" /></div>
<script>
'use strict';
// Downloads tab
var WatchedFoldersTable = new HtmlTable($("watched_folders_tab"));

View file

@ -152,6 +152,8 @@
</div>
<script>
'use strict';
torrentPeersTable.setup('torrentPeersTableDiv', 'torrentPeersTableFixedHeaderDiv', null);
var selectedTab = $(getLocalStorageItem('selected_tab', 'PropGeneralLink'));
if (selectedTab)

View file

@ -9,6 +9,8 @@
<script src="scripts/lib/mootools-1.2-more.js"></script>
<script src="scripts/misc.js?locale=${LANG}"></script>
<script>
'use strict';
var renameKeyboardEvents = new Keyboard({
defaultEventType: 'keydown',
events: {

View file

@ -22,6 +22,8 @@
* THE SOFTWARE.
*/
'use strict';
torrentsTable = new TorrentsTable();
torrentPeersTable = new TorrentPeersTable();
searchResultsTable = new SearchResultsTable();

View file

@ -1,3 +1,5 @@
'use strict';
var lastShownContexMenu = null;
var ContextMenu = new Class({
//implements

View file

@ -21,6 +21,8 @@
* THE SOFTWARE.
*/
'use strict';
var categories = {};
var defaultSavePath = "";

View file

@ -31,6 +31,8 @@
**************************************************************/
'use strict';
var DynamicTableHeaderContextMenuClass = null;
var ProgressColumnWidth = -1;

View file

@ -1,3 +1,5 @@
'use strict';
/*
* JS counterpart of the function in src/misc.cpp
*/

View file

@ -8,6 +8,8 @@
it in the onContentLoaded function of the new window.
----------------------------------------------------------------- */
'use strict';
/* Define localStorage object for older browsers */
if (typeof localStorage == 'undefined') {
window['localStorage'] = {

View file

@ -1,3 +1,5 @@
'use strict';
var ProgressBar = new Class({
initialize: function(value, parameters) {
var vals = {

View file

@ -1,3 +1,5 @@
'use strict';
var is_seed = true;
var current_hash = "";

View file

@ -1,3 +1,5 @@
'use strict';
var clearData = function() {
$('time_elapsed').set('html', '');
$('eta').set('html', '');

View file

@ -1,3 +1,5 @@
'use strict';
var trackersDynTable = new Class({
initialize: function() {},

View file

@ -1,3 +1,5 @@
'use strict';
var webseedsDynTable = new Class({
initialize: function() {},

View file

@ -9,6 +9,8 @@
<script src="scripts/lib/mootools-1.2-more.js"></script>
<script src="scripts/misc.js?locale=${LANG}"></script>
<script>
'use strict';
var setLocationKeyboardEvents = new Keyboard({
defaultEventType: 'keydown',
events: {

View file

@ -9,6 +9,8 @@
<script src="scripts/lib/mootools-1.2-more.js"></script>
<script src="scripts/misc.js?locale=${LANG}"></script>
<script>
'use strict';
var UseGlobalLimit = -2;
var NoLimit = -1;

View file

@ -16,6 +16,8 @@
</div>
<script>
'use strict';
//create a context menu
var torrentsTableContextMenu = new TorrentsTableContextMenu({
targets: '.torrentsTableContextMenuTarget',

View file

@ -122,6 +122,8 @@
</fieldset>
</form>
<script>
'use strict';
var submitted = false;
$('uploadForm').addEventListener("submit", function() {

View file

@ -22,6 +22,8 @@
<div class="clear"></div>
</div>
<script>
'use strict';
var hashes = new URI().getData('hashes').split('|');
setUpLimit = function() {
var limit = $("uplimitUpdatevalue").value.toInt() * 1024;

View file

@ -8,6 +8,8 @@
<link rel="stylesheet" type="text/css" href="css/login.css" />
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
<script>
'use strict';
window.onload = function() {
$('username').focus();
$('username').select();