mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 13:04:23 +00:00
Merge pull request #9959 from Chocobo1/strict
Use Javascript strict mode
This commit is contained in:
commit
25cefee0f8
@ -8,6 +8,8 @@
|
|||||||
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
|
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
|
||||||
<script src="scripts/lib/mootools-1.2-more.js"></script>
|
<script src="scripts/lib/mootools-1.2-more.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
'use strict';
|
||||||
|
|
||||||
window.addEvent('domready', function() {
|
window.addEvent('domready', function() {
|
||||||
var setLocationKeyboardEvents = new Keyboard({
|
var setLocationKeyboardEvents = new Keyboard({
|
||||||
defaultEventType: 'keydown',
|
defaultEventType: 'keydown',
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
|
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
|
||||||
<script src="scripts/lib/mootools-1.2-more.js"></script>
|
<script src="scripts/lib/mootools-1.2-more.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var hashes = new URI().getData('hashes').split('|');
|
var hashes = new URI().getData('hashes').split('|');
|
||||||
window.addEvent('domready', function() {
|
window.addEvent('domready', function() {
|
||||||
$('cancelBtn').focus();
|
$('cancelBtn').focus();
|
||||||
|
@ -135,6 +135,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var encodedUrls = new URI().getData('urls');
|
var encodedUrls = new URI().getData('urls');
|
||||||
if (encodedUrls) {
|
if (encodedUrls) {
|
||||||
var urls = [];
|
var urls = [];
|
||||||
|
@ -22,8 +22,10 @@
|
|||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var hashes = new URI().getData('hashes').split('|');
|
var hashes = new URI().getData('hashes').split('|');
|
||||||
setDlLimit = function() {
|
var setDlLimit = function() {
|
||||||
var limit = $("dllimitUpdatevalue").value.toInt() * 1024;
|
var limit = $("dllimitUpdatevalue").value.toInt() * 1024;
|
||||||
if (hashes[0] == "global") {
|
if (hashes[0] == "global") {
|
||||||
new Request({
|
new Request({
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var categoriesFilterContextMenu = new CategoriesFilterContextMenu({
|
var categoriesFilterContextMenu = new CategoriesFilterContextMenu({
|
||||||
targets: '.categoriesFilterContextMenuTarget',
|
targets: '.categoriesFilterContextMenuTarget',
|
||||||
menu: 'categoriesFilterMenu',
|
menu: 'categoriesFilterMenu',
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
line-height: 2em;
|
line-height: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id="installSearchPluginContainer">
|
<div id="installSearchPluginContainer">
|
||||||
@ -20,7 +21,7 @@
|
|||||||
<input type="text" id="newPluginPath" placeholder="QBT_TR(URL or local directory)QBT_TR[CONTEXT=PluginSourceDlg]" autocorrect="off" autocapitalize="none" />
|
<input type="text" id="newPluginPath" placeholder="QBT_TR(URL or local directory)QBT_TR[CONTEXT=PluginSourceDlg]" autocorrect="off" autocapitalize="none" />
|
||||||
<div style="margin-top: 10px; text-align: center;">
|
<div style="margin-top: 10px; text-align: center;">
|
||||||
<button id="newPluginCancel" onclick="closeSearchWindow('installSearchPlugin');">QBT_TR(Cancel)QBT_TR[CONTEXT=PluginSourceDlg]</button>
|
<button id="newPluginCancel" onclick="closeSearchWindow('installSearchPlugin');">QBT_TR(Cancel)QBT_TR[CONTEXT=PluginSourceDlg]</button>
|
||||||
<button id="newPluginOk" onclick="newPluginOk();">QBT_TR(Ok)QBT_TR[CONTEXT=PluginSourceDlg]</button></div>
|
<button id="newPluginOk" onclick="newPluginOk();">QBT_TR(Ok)QBT_TR[CONTEXT=PluginSourceDlg]</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -32,7 +33,7 @@
|
|||||||
var installSearchPluginKeyboardEvents = new Keyboard({
|
var installSearchPluginKeyboardEvents = new Keyboard({
|
||||||
defaultEventType: 'keydown',
|
defaultEventType: 'keydown',
|
||||||
events: {
|
events: {
|
||||||
'enter': function (e) {
|
'enter': function(e) {
|
||||||
// accept enter key as a click
|
// accept enter key as a click
|
||||||
new Event(e).stop();
|
new Event(e).stop();
|
||||||
|
|
||||||
@ -59,7 +60,7 @@
|
|||||||
data: {
|
data: {
|
||||||
sources: path,
|
sources: path,
|
||||||
},
|
},
|
||||||
onRequest: function(){
|
onRequest: function() {
|
||||||
closeSearchWindow('installSearchPlugin');
|
closeSearchWindow('installSearchPlugin');
|
||||||
}
|
}
|
||||||
}).send();
|
}).send();
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
<script src="scripts/lib/mootools-1.2-more.js"></script>
|
<script src="scripts/lib/mootools-1.2-more.js"></script>
|
||||||
<script src="scripts/misc.js?locale=${LANG}"></script>
|
<script src="scripts/misc.js?locale=${LANG}"></script>
|
||||||
<script>
|
<script>
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var newCategoryKeyboardEvents = new Keyboard({
|
var newCategoryKeyboardEvents = new Keyboard({
|
||||||
defaultEventType: 'keydown',
|
defaultEventType: 'keydown',
|
||||||
events: {
|
events: {
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
'use strict';
|
||||||
|
|
||||||
// Tabs
|
// Tabs
|
||||||
MochaUI.initializeTabs('preferencesTabs');
|
MochaUI.initializeTabs('preferencesTabs');
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" id="temppath_checkbox" onclick="updateTempDirEnabled();" />
|
<input type="checkbox" id="temppath_checkbox" onclick="updateTempDirEnabled();" />
|
||||||
<label for="temppath_checkbox" >QBT_TR(Keep incomplete torrents in:)QBT_TR[CONTEXT=OptionsDialog]</label>
|
<label for="temppath_checkbox">QBT_TR(Keep incomplete torrents in:)QBT_TR[CONTEXT=OptionsDialog]</label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" id="temppath_text" />
|
<input type="text" id="temppath_text" />
|
||||||
@ -95,7 +95,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" id="exportdir_checkbox" onclick="updateExportDirEnabled();" />
|
<input type="checkbox" id="exportdir_checkbox" onclick="updateExportDirEnabled();" />
|
||||||
<label for="exportdir_checkbox" >QBT_TR(Copy .torrent files to:)QBT_TR[CONTEXT=OptionsDialog]</label>
|
<label for="exportdir_checkbox">QBT_TR(Copy .torrent files to:)QBT_TR[CONTEXT=OptionsDialog]</label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" id="exportdir_text" />
|
<input type="text" id="exportdir_text" />
|
||||||
@ -104,7 +104,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" id="exportdirfin_checkbox" onclick="updateExportDirFinEnabled();" />
|
<input type="checkbox" id="exportdirfin_checkbox" onclick="updateExportDirFinEnabled();" />
|
||||||
<label for="exportdirfin_checkbox" >QBT_TR(Copy .torrent files for finished downloads to:)QBT_TR[CONTEXT=OptionsDialog]</label>
|
<label for="exportdirfin_checkbox">QBT_TR(Copy .torrent files for finished downloads to:)QBT_TR[CONTEXT=OptionsDialog]</label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" id="exportdirfin_text" />
|
<input type="text" id="exportdirfin_text" />
|
||||||
@ -814,15 +814,17 @@
|
|||||||
<div style="text-align: center; margin-top: 1em;"><input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" onclick="applyPreferences();" /></div>
|
<div style="text-align: center; margin-top: 1em;"><input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" onclick="applyPreferences();" /></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
'use strict';
|
||||||
|
|
||||||
// Downloads tab
|
// Downloads tab
|
||||||
var WatchedFoldersTable = new HtmlTable($("watched_folders_tab"));
|
var WatchedFoldersTable = new HtmlTable($("watched_folders_tab"));
|
||||||
|
|
||||||
updateTempDirEnabled = function() {
|
var updateTempDirEnabled = function() {
|
||||||
var isTempDirEnabled = $('temppath_checkbox').getProperty('checked');
|
var isTempDirEnabled = $('temppath_checkbox').getProperty('checked');
|
||||||
$('temppath_text').setProperty('disabled', !isTempDirEnabled);
|
$('temppath_text').setProperty('disabled', !isTempDirEnabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
addWatchFolder = function() {
|
var addWatchFolder = function() {
|
||||||
var new_folder = $('new_watch_folder_txt').getProperty('value').trim();
|
var new_folder = $('new_watch_folder_txt').getProperty('value').trim();
|
||||||
if (new_folder.length <= 0) return;
|
if (new_folder.length <= 0) return;
|
||||||
|
|
||||||
@ -842,7 +844,7 @@
|
|||||||
$('new_watch_folder_other_txt').setProperty('value', text);
|
$('new_watch_folder_other_txt').setProperty('value', text);
|
||||||
};
|
};
|
||||||
|
|
||||||
changeWatchFolderSelect = function(item) {
|
var changeWatchFolderSelect = function(item) {
|
||||||
if (item.value == "other") {
|
if (item.value == "other") {
|
||||||
item.nextElementSibling.hidden = false;
|
item.nextElementSibling.hidden = false;
|
||||||
item.nextElementSibling.value = 'QBT_TR(Type folder here)QBT_TR[CONTEXT=HttpServer]';
|
item.nextElementSibling.value = 'QBT_TR(Type folder here)QBT_TR[CONTEXT=HttpServer]';
|
||||||
@ -855,7 +857,7 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
pushWatchFolder = function(pos, folder, sel, other) {
|
var pushWatchFolder = function(pos, folder, sel, other) {
|
||||||
var myinput = "<input id='text_watch_" + pos + "' type='text' value='" + folder + "'>";
|
var myinput = "<input id='text_watch_" + pos + "' type='text' value='" + folder + "'>";
|
||||||
var disableInput = (sel != "other");
|
var disableInput = (sel != "other");
|
||||||
var mycb = "<div class='select-watched-folder-editable'>"
|
var mycb = "<div class='select-watched-folder-editable'>"
|
||||||
@ -875,7 +877,7 @@
|
|||||||
$('cb_watch_txt_' + pos).setProperty('value', other);
|
$('cb_watch_txt_' + pos).setProperty('value', other);
|
||||||
};
|
};
|
||||||
|
|
||||||
getWatchedFolders = function() {
|
var getWatchedFolders = function() {
|
||||||
var nb_folders = $("watched_folders_tab").getChildren("tbody")[0].getChildren("tr").length;
|
var nb_folders = $("watched_folders_tab").getChildren("tbody")[0].getChildren("tr").length;
|
||||||
var folders = new Hash();
|
var folders = new Hash();
|
||||||
for (var i = 0; i < nb_folders; ++i) {
|
for (var i = 0; i < nb_folders; ++i) {
|
||||||
@ -895,17 +897,17 @@
|
|||||||
return folders;
|
return folders;
|
||||||
};
|
};
|
||||||
|
|
||||||
updateExportDirEnabled = function() {
|
var updateExportDirEnabled = function() {
|
||||||
var isExportDirEnabled = $('exportdir_checkbox').getProperty('checked');
|
var isExportDirEnabled = $('exportdir_checkbox').getProperty('checked');
|
||||||
$('exportdir_text').setProperty('disabled', !isExportDirEnabled);
|
$('exportdir_text').setProperty('disabled', !isExportDirEnabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
updateExportDirFinEnabled = function() {
|
var updateExportDirFinEnabled = function() {
|
||||||
var isExportDirFinEnabled = $('exportdirfin_checkbox').getProperty('checked');
|
var isExportDirFinEnabled = $('exportdirfin_checkbox').getProperty('checked');
|
||||||
$('exportdirfin_text').setProperty('disabled', !isExportDirFinEnabled);
|
$('exportdirfin_text').setProperty('disabled', !isExportDirFinEnabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
updateMailNotification = function() {
|
var updateMailNotification = function() {
|
||||||
var isMailNotificationEnabled = $('mail_notification_checkbox').getProperty('checked');
|
var isMailNotificationEnabled = $('mail_notification_checkbox').getProperty('checked');
|
||||||
$('src_email_txt').setProperty('disabled', !isMailNotificationEnabled);
|
$('src_email_txt').setProperty('disabled', !isMailNotificationEnabled);
|
||||||
$('dest_email_txt').setProperty('disabled', !isMailNotificationEnabled);
|
$('dest_email_txt').setProperty('disabled', !isMailNotificationEnabled);
|
||||||
@ -919,39 +921,39 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
updateMailAuthSettings = function() {
|
var updateMailAuthSettings = function() {
|
||||||
var isMailAuthEnabled = $('mail_auth_checkbox').getProperty('checked');
|
var isMailAuthEnabled = $('mail_auth_checkbox').getProperty('checked');
|
||||||
$('mail_username_text').setProperty('disabled', !isMailAuthEnabled);
|
$('mail_username_text').setProperty('disabled', !isMailAuthEnabled);
|
||||||
$('mail_password_text').setProperty('disabled', !isMailAuthEnabled);
|
$('mail_password_text').setProperty('disabled', !isMailAuthEnabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
updateAutoRun = function() {
|
var updateAutoRun = function() {
|
||||||
var isAutoRunEnabled = $('autorun_checkbox').getProperty('checked');
|
var isAutoRunEnabled = $('autorun_checkbox').getProperty('checked');
|
||||||
$('autorunProg_txt').setProperty('disabled', !isAutoRunEnabled);
|
$('autorunProg_txt').setProperty('disabled', !isAutoRunEnabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Connection tab
|
// Connection tab
|
||||||
updateMaxConnecEnabled = function() {
|
var updateMaxConnecEnabled = function() {
|
||||||
var isMaxConnecEnabled = $('max_connec_checkbox').getProperty('checked');
|
var isMaxConnecEnabled = $('max_connec_checkbox').getProperty('checked');
|
||||||
$('max_connec_value').setProperty('disabled', !isMaxConnecEnabled);
|
$('max_connec_value').setProperty('disabled', !isMaxConnecEnabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
updateMaxConnecPerTorrentEnabled = function() {
|
var updateMaxConnecPerTorrentEnabled = function() {
|
||||||
var isMaxConnecPerTorrentEnabled = $('max_connec_per_torrent_checkbox').getProperty('checked');
|
var isMaxConnecPerTorrentEnabled = $('max_connec_per_torrent_checkbox').getProperty('checked');
|
||||||
$('max_connec_per_torrent_value').setProperty('disabled', !isMaxConnecPerTorrentEnabled);
|
$('max_connec_per_torrent_value').setProperty('disabled', !isMaxConnecPerTorrentEnabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
updateMaxUploadsEnabled = function() {
|
var updateMaxUploadsEnabled = function() {
|
||||||
var isMaxUploadsEnabled = $('max_uploads_checkbox').getProperty('checked');
|
var isMaxUploadsEnabled = $('max_uploads_checkbox').getProperty('checked');
|
||||||
$('max_uploads_value').setProperty('disabled', !isMaxUploadsEnabled);
|
$('max_uploads_value').setProperty('disabled', !isMaxUploadsEnabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
updateMaxUploadsPerTorrentEnabled = function() {
|
var updateMaxUploadsPerTorrentEnabled = function() {
|
||||||
var isMaxUploadsPerTorrentEnabled = $('max_uploads_per_torrent_checkbox').getProperty('checked');
|
var isMaxUploadsPerTorrentEnabled = $('max_uploads_per_torrent_checkbox').getProperty('checked');
|
||||||
$('max_uploads_per_torrent_value').setProperty('disabled', !isMaxUploadsPerTorrentEnabled);
|
$('max_uploads_per_torrent_value').setProperty('disabled', !isMaxUploadsPerTorrentEnabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
updatePeerProxySettings = function() {
|
var updatePeerProxySettings = function() {
|
||||||
var isPeerProxyTypeSelected = $('peer_proxy_type_select').getProperty('value') != "none";
|
var isPeerProxyTypeSelected = $('peer_proxy_type_select').getProperty('value') != "none";
|
||||||
$('peer_proxy_host_text').setProperty('disabled', !isPeerProxyTypeSelected);
|
$('peer_proxy_host_text').setProperty('disabled', !isPeerProxyTypeSelected);
|
||||||
$('peer_proxy_port_value').setProperty('disabled', !isPeerProxyTypeSelected);
|
$('peer_proxy_port_value').setProperty('disabled', !isPeerProxyTypeSelected);
|
||||||
@ -977,19 +979,19 @@
|
|||||||
updateForceProxySettings();
|
updateForceProxySettings();
|
||||||
};
|
};
|
||||||
|
|
||||||
updateForceProxySettings = function() {
|
var updateForceProxySettings = function() {
|
||||||
var isForceProxyEnabled = (!$('force_proxy_checkbox').getProperty('disabled')) && ($('force_proxy_checkbox').getProperty('checked'));
|
var isForceProxyEnabled = (!$('force_proxy_checkbox').getProperty('disabled')) && ($('force_proxy_checkbox').getProperty('checked'));
|
||||||
$('upnp_checkbox').setProperty('disabled', isForceProxyEnabled);
|
$('upnp_checkbox').setProperty('disabled', isForceProxyEnabled);
|
||||||
$('lsd_checkbox').setProperty('disabled', isForceProxyEnabled);
|
$('lsd_checkbox').setProperty('disabled', isForceProxyEnabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
updatePeerProxyAuthSettings = function() {
|
var updatePeerProxyAuthSettings = function() {
|
||||||
var isPeerProxyAuthEnabled = $('peer_proxy_auth_checkbox').getProperty('checked');
|
var isPeerProxyAuthEnabled = $('peer_proxy_auth_checkbox').getProperty('checked');
|
||||||
$('peer_proxy_username_text').setProperty('disabled', !isPeerProxyAuthEnabled);
|
$('peer_proxy_username_text').setProperty('disabled', !isPeerProxyAuthEnabled);
|
||||||
$('peer_proxy_password_text').setProperty('disabled', !isPeerProxyAuthEnabled);
|
$('peer_proxy_password_text').setProperty('disabled', !isPeerProxyAuthEnabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
updateFilterSettings = function() {
|
var updateFilterSettings = function() {
|
||||||
var isIPFilterEnabled = $('ipfilter_enabled_checkbox').getProperty('checked');
|
var isIPFilterEnabled = $('ipfilter_enabled_checkbox').getProperty('checked');
|
||||||
$('ipfilter_text').setProperty('disabled', !isIPFilterEnabled);
|
$('ipfilter_text').setProperty('disabled', !isIPFilterEnabled);
|
||||||
$('ipfilter_trackers_checkbox').setProperty('disabled', !isIPFilterEnabled);
|
$('ipfilter_trackers_checkbox').setProperty('disabled', !isIPFilterEnabled);
|
||||||
@ -997,7 +999,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Speed tab
|
// Speed tab
|
||||||
updateSchedulingEnabled = function() {
|
var updateSchedulingEnabled = function() {
|
||||||
var isLimitSchedulingEnabled = $('limit_sheduling_checkbox').getProperty('checked');
|
var isLimitSchedulingEnabled = $('limit_sheduling_checkbox').getProperty('checked');
|
||||||
$('schedule_from_hour').setProperty('disabled', !isLimitSchedulingEnabled);
|
$('schedule_from_hour').setProperty('disabled', !isLimitSchedulingEnabled);
|
||||||
$('schedule_from_min').setProperty('disabled', !isLimitSchedulingEnabled);
|
$('schedule_from_min').setProperty('disabled', !isLimitSchedulingEnabled);
|
||||||
@ -1007,7 +1009,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Bittorrent tab
|
// Bittorrent tab
|
||||||
updateQueueingSystem = function() {
|
var updateQueueingSystem = function() {
|
||||||
var isQueueingEnabled = $('queueing_checkbox').getProperty('checked');
|
var isQueueingEnabled = $('queueing_checkbox').getProperty('checked');
|
||||||
$('max_active_dl_value').setProperty('disabled', !isQueueingEnabled);
|
$('max_active_dl_value').setProperty('disabled', !isQueueingEnabled);
|
||||||
$('max_active_up_value').setProperty('disabled', !isQueueingEnabled);
|
$('max_active_up_value').setProperty('disabled', !isQueueingEnabled);
|
||||||
@ -1016,14 +1018,14 @@
|
|||||||
updateSlowTorrentsSettings();
|
updateSlowTorrentsSettings();
|
||||||
};
|
};
|
||||||
|
|
||||||
updateSlowTorrentsSettings = function() {
|
var updateSlowTorrentsSettings = function() {
|
||||||
var isDontCountSlowTorrentsEnabled = (!$('dont_count_slow_torrents_checkbox').getProperty('disabled')) && $('dont_count_slow_torrents_checkbox').getProperty('checked');
|
var isDontCountSlowTorrentsEnabled = (!$('dont_count_slow_torrents_checkbox').getProperty('disabled')) && $('dont_count_slow_torrents_checkbox').getProperty('checked');
|
||||||
$('dl_rate_threshold').setProperty('disabled', !isDontCountSlowTorrentsEnabled);
|
$('dl_rate_threshold').setProperty('disabled', !isDontCountSlowTorrentsEnabled);
|
||||||
$('ul_rate_threshold').setProperty('disabled', !isDontCountSlowTorrentsEnabled);
|
$('ul_rate_threshold').setProperty('disabled', !isDontCountSlowTorrentsEnabled);
|
||||||
$('torrent_inactive_timer').setProperty('disabled', !isDontCountSlowTorrentsEnabled);
|
$('torrent_inactive_timer').setProperty('disabled', !isDontCountSlowTorrentsEnabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
updateMaxRatioTimeEnabled = function() {
|
var updateMaxRatioTimeEnabled = function() {
|
||||||
var isMaxRatioEnabled = $('max_ratio_checkbox').getProperty('checked');
|
var isMaxRatioEnabled = $('max_ratio_checkbox').getProperty('checked');
|
||||||
$('max_ratio_value').setProperty('disabled', !isMaxRatioEnabled);
|
$('max_ratio_value').setProperty('disabled', !isMaxRatioEnabled);
|
||||||
|
|
||||||
@ -1033,34 +1035,34 @@
|
|||||||
$('max_ratio_act').setProperty('disabled', !(isMaxRatioEnabled || isMaxSeedingTimeEnabled));
|
$('max_ratio_act').setProperty('disabled', !(isMaxRatioEnabled || isMaxSeedingTimeEnabled));
|
||||||
};
|
};
|
||||||
|
|
||||||
updateAddTrackersEnabled = function() {
|
var updateAddTrackersEnabled = function() {
|
||||||
var isAddTrackersEnabled = $('add_trackers_checkbox').getProperty('checked');
|
var isAddTrackersEnabled = $('add_trackers_checkbox').getProperty('checked');
|
||||||
$('add_trackers_textarea').setProperty('disabled', !isAddTrackersEnabled);
|
$('add_trackers_textarea').setProperty('disabled', !isAddTrackersEnabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Web UI tab
|
// Web UI tab
|
||||||
updateHttpsSettings = function() {
|
var updateHttpsSettings = function() {
|
||||||
var isUseHttpsEnabled = $('use_https_checkbox').getProperty('checked');
|
var isUseHttpsEnabled = $('use_https_checkbox').getProperty('checked');
|
||||||
$('ssl_key_textarea').setProperty('disabled', !isUseHttpsEnabled);
|
$('ssl_key_textarea').setProperty('disabled', !isUseHttpsEnabled);
|
||||||
$('ssl_cert_textarea').setProperty('disabled', !isUseHttpsEnabled);
|
$('ssl_cert_textarea').setProperty('disabled', !isUseHttpsEnabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
updateBypasssAuthSettings = function() {
|
var updateBypasssAuthSettings = function() {
|
||||||
var isBypassAuthSubnetWhitelistEnabled = $('bypass_auth_subnet_whitelist_checkbox').getProperty('checked');
|
var isBypassAuthSubnetWhitelistEnabled = $('bypass_auth_subnet_whitelist_checkbox').getProperty('checked');
|
||||||
$('bypass_auth_subnet_whitelist_textarea').setProperty('disabled', !isBypassAuthSubnetWhitelistEnabled);
|
$('bypass_auth_subnet_whitelist_textarea').setProperty('disabled', !isBypassAuthSubnetWhitelistEnabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
updateAlternativeWebUISettings = function() {
|
var updateAlternativeWebUISettings = function() {
|
||||||
var isUseAlternativeWebUIEnabled = $('use_alt_webui_checkbox').getProperty('checked');
|
var isUseAlternativeWebUIEnabled = $('use_alt_webui_checkbox').getProperty('checked');
|
||||||
$('webui_files_location_textarea').setProperty('disabled', !isUseAlternativeWebUIEnabled);
|
$('webui_files_location_textarea').setProperty('disabled', !isUseAlternativeWebUIEnabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
updateHostHeaderValidationSettings = function() {
|
var updateHostHeaderValidationSettings = function() {
|
||||||
var isHostHeaderValidationEnabled = $('host_header_validation_checkbox').getProperty('checked');
|
var isHostHeaderValidationEnabled = $('host_header_validation_checkbox').getProperty('checked');
|
||||||
$('webui_domain_textarea').setProperty('disabled', !isHostHeaderValidationEnabled);
|
$('webui_domain_textarea').setProperty('disabled', !isHostHeaderValidationEnabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
updateDynDnsSettings = function() {
|
var updateDynDnsSettings = function() {
|
||||||
var isDynDnsEnabled = $('use_dyndns_checkbox').getProperty('checked');
|
var isDynDnsEnabled = $('use_dyndns_checkbox').getProperty('checked');
|
||||||
$('dyndns_select').setProperty('disabled', !isDynDnsEnabled);
|
$('dyndns_select').setProperty('disabled', !isDynDnsEnabled);
|
||||||
$('dyndns_domain_text').setProperty('disabled', !isDynDnsEnabled);
|
$('dyndns_domain_text').setProperty('disabled', !isDynDnsEnabled);
|
||||||
@ -1068,7 +1070,7 @@
|
|||||||
$('dyndns_password_text').setProperty('disabled', !isDynDnsEnabled);
|
$('dyndns_password_text').setProperty('disabled', !isDynDnsEnabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
registerDynDns = function() {
|
var registerDynDns = function() {
|
||||||
if ($('dyndns_select').getProperty('value').toInt() == 1) {
|
if ($('dyndns_select').getProperty('value').toInt() == 1) {
|
||||||
window.open("http://www.no-ip.com/services/managed_dns/free_dynamic_dns.html", "NO-IP Registration");
|
window.open("http://www.no-ip.com/services/managed_dns/free_dynamic_dns.html", "NO-IP Registration");
|
||||||
}
|
}
|
||||||
@ -1077,21 +1079,21 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
generateRandomPort = function() {
|
var generateRandomPort = function() {
|
||||||
var min = 1024;
|
var min = 1024;
|
||||||
var max = 65535;
|
var max = 65535;
|
||||||
var port = Math.floor(Math.random() * (max - min + 1) + min);
|
var port = Math.floor(Math.random() * (max - min + 1) + min);
|
||||||
$('port_value').setProperty('value', port);
|
$('port_value').setProperty('value', port);
|
||||||
};
|
};
|
||||||
|
|
||||||
time_padding = function(val) {
|
var time_padding = function(val) {
|
||||||
var ret = val.toString();
|
var ret = val.toString();
|
||||||
if (ret.length == 1)
|
if (ret.length == 1)
|
||||||
ret = '0' + ret;
|
ret = '0' + ret;
|
||||||
return ret;
|
return ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
loadPreferences = function() {
|
var loadPreferences = function() {
|
||||||
var url = 'api/v2/app/preferences';
|
var url = 'api/v2/app/preferences';
|
||||||
new Request.JSON({
|
new Request.JSON({
|
||||||
url: url,
|
url: url,
|
||||||
@ -1362,7 +1364,7 @@
|
|||||||
}).send();
|
}).send();
|
||||||
};
|
};
|
||||||
|
|
||||||
applyPreferences = function() {
|
var applyPreferences = function() {
|
||||||
var settings = new Hash();
|
var settings = new Hash();
|
||||||
// Validate form data
|
// Validate form data
|
||||||
// Downloads tab
|
// Downloads tab
|
||||||
|
@ -152,6 +152,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
'use strict';
|
||||||
|
|
||||||
torrentPeersTable.setup('torrentPeersTableDiv', 'torrentPeersTableFixedHeaderDiv', null);
|
torrentPeersTable.setup('torrentPeersTableDiv', 'torrentPeersTableFixedHeaderDiv', null);
|
||||||
var selectedTab = $(getLocalStorageItem('selected_tab', 'PropGeneralLink'));
|
var selectedTab = $(getLocalStorageItem('selected_tab', 'PropGeneralLink'));
|
||||||
if (selectedTab)
|
if (selectedTab)
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
<script src="scripts/lib/mootools-1.2-more.js"></script>
|
<script src="scripts/lib/mootools-1.2-more.js"></script>
|
||||||
<script src="scripts/misc.js?locale=${LANG}"></script>
|
<script src="scripts/misc.js?locale=${LANG}"></script>
|
||||||
<script>
|
<script>
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var renameKeyboardEvents = new Keyboard({
|
var renameKeyboardEvents = new Keyboard({
|
||||||
defaultEventType: 'keydown',
|
defaultEventType: 'keydown',
|
||||||
events: {
|
events: {
|
||||||
|
@ -22,10 +22,12 @@
|
|||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
torrentsTable = new TorrentsTable();
|
'use strict';
|
||||||
torrentPeersTable = new TorrentPeersTable();
|
|
||||||
searchResultsTable = new SearchResultsTable();
|
var torrentsTable = new TorrentsTable();
|
||||||
searchPluginsTable = new SearchPluginsTable();
|
var torrentPeersTable = new TorrentPeersTable();
|
||||||
|
var searchResultsTable = new SearchResultsTable();
|
||||||
|
var searchPluginsTable = new SearchPluginsTable();
|
||||||
|
|
||||||
var updatePropertiesPanel = function() {};
|
var updatePropertiesPanel = function() {};
|
||||||
|
|
||||||
@ -322,7 +324,7 @@ window.addEvent('load', function() {
|
|||||||
if (!categoryList)
|
if (!categoryList)
|
||||||
return;
|
return;
|
||||||
var childrens = categoryList.childNodes;
|
var childrens = categoryList.childNodes;
|
||||||
for (var i in childrens) {
|
for (var i = 0; i < childrens.length; ++i) {
|
||||||
if (childrens[i].id == selected_category)
|
if (childrens[i].id == selected_category)
|
||||||
childrens[i].className = "selectedFilter";
|
childrens[i].className = "selectedFilter";
|
||||||
else
|
else
|
||||||
@ -643,20 +645,20 @@ window.addEvent('load', function() {
|
|||||||
|
|
||||||
var addSearchPanel = function() {
|
var addSearchPanel = function() {
|
||||||
new MochaUI.Panel({
|
new MochaUI.Panel({
|
||||||
id : 'SearchPanel',
|
id: 'SearchPanel',
|
||||||
title : 'Search',
|
title: 'Search',
|
||||||
header : false,
|
header: false,
|
||||||
padding : {
|
padding: {
|
||||||
top : 0,
|
top: 0,
|
||||||
right : 0,
|
right: 0,
|
||||||
bottom : 0,
|
bottom: 0,
|
||||||
left : 0
|
left: 0
|
||||||
},
|
},
|
||||||
loadMethod : 'xhr',
|
loadMethod: 'xhr',
|
||||||
contentURL : 'search.html',
|
contentURL: 'search.html',
|
||||||
content: '',
|
content: '',
|
||||||
column : 'searchTabColumn',
|
column: 'searchTabColumn',
|
||||||
height : null
|
height: null
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
var lastShownContexMenu = null;
|
var lastShownContexMenu = null;
|
||||||
var ContextMenu = new Class({
|
var ContextMenu = new Class({
|
||||||
//implements
|
//implements
|
||||||
@ -404,7 +406,7 @@ var CategoriesFilterContextMenu = new Class({
|
|||||||
var SearchPluginsTableContextMenu = new Class({
|
var SearchPluginsTableContextMenu = new Class({
|
||||||
Extends: ContextMenu,
|
Extends: ContextMenu,
|
||||||
|
|
||||||
updateMenuItems: function () {
|
updateMenuItems: function() {
|
||||||
var enabledColumnIndex = function(text) {
|
var enabledColumnIndex = function(text) {
|
||||||
var columns = $("searchPluginsTableFixedHeaderRow").getChildren("th");
|
var columns = $("searchPluginsTableFixedHeaderRow").getChildren("th");
|
||||||
for (var i = 0; i < columns.length; ++i)
|
for (var i = 0; i < columns.length; ++i)
|
||||||
|
@ -21,10 +21,12 @@
|
|||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var categories = {};
|
var categories = {};
|
||||||
var defaultSavePath = "";
|
var defaultSavePath = "";
|
||||||
|
|
||||||
getCategories = function() {
|
var getCategories = function() {
|
||||||
new Request.JSON({
|
new Request.JSON({
|
||||||
url: 'api/v2/torrents/categories',
|
url: 'api/v2/torrents/categories',
|
||||||
noCache: true,
|
noCache: true,
|
||||||
@ -44,7 +46,7 @@ getCategories = function() {
|
|||||||
}).send();
|
}).send();
|
||||||
};
|
};
|
||||||
|
|
||||||
getPreferences = function() {
|
var getPreferences = function() {
|
||||||
new Request.JSON({
|
new Request.JSON({
|
||||||
url: 'api/v2/app/preferences',
|
url: 'api/v2/app/preferences',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
@ -71,7 +73,7 @@ getPreferences = function() {
|
|||||||
}).send();
|
}).send();
|
||||||
};
|
};
|
||||||
|
|
||||||
changeCategorySelect = function(item) {
|
var changeCategorySelect = function(item) {
|
||||||
if (item.value == "\\other") {
|
if (item.value == "\\other") {
|
||||||
item.nextElementSibling.hidden = false;
|
item.nextElementSibling.hidden = false;
|
||||||
item.nextElementSibling.value = "";
|
item.nextElementSibling.value = "";
|
||||||
@ -96,7 +98,7 @@ changeCategorySelect = function(item) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
changeTMM = function(item) {
|
var changeTMM = function(item) {
|
||||||
if (item.selectedIndex == 1) {
|
if (item.selectedIndex == 1) {
|
||||||
$('savepath').disabled = true;
|
$('savepath').disabled = true;
|
||||||
|
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
**************************************************************/
|
**************************************************************/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var DynamicTableHeaderContextMenuClass = null;
|
var DynamicTableHeaderContextMenuClass = null;
|
||||||
var ProgressColumnWidth = -1;
|
var ProgressColumnWidth = -1;
|
||||||
|
|
||||||
@ -1402,164 +1404,164 @@ var TorrentPeersTable = new Class({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var SearchResultsTable = new Class({
|
var SearchResultsTable = new Class({
|
||||||
Extends: DynamicTable,
|
Extends: DynamicTable,
|
||||||
|
|
||||||
initColumns: function () {
|
initColumns: function() {
|
||||||
this.newColumn('fileName', '', 'QBT_TR(Name)QBT_TR[CONTEXT=SearchResultsTable]', 500, true);
|
this.newColumn('fileName', '', 'QBT_TR(Name)QBT_TR[CONTEXT=SearchResultsTable]', 500, true);
|
||||||
this.newColumn('fileSize', '', 'QBT_TR(Size)QBT_TR[CONTEXT=SearchResultsTable]', 100, true);
|
this.newColumn('fileSize', '', 'QBT_TR(Size)QBT_TR[CONTEXT=SearchResultsTable]', 100, true);
|
||||||
this.newColumn('nbSeeders', '', 'QBT_TR(Seeders)QBT_TR[CONTEXT=SearchResultsTable]', 100, true);
|
this.newColumn('nbSeeders', '', 'QBT_TR(Seeders)QBT_TR[CONTEXT=SearchResultsTable]', 100, true);
|
||||||
this.newColumn('nbLeechers', '', 'QBT_TR(Leechers)QBT_TR[CONTEXT=SearchResultsTable]', 100, true);
|
this.newColumn('nbLeechers', '', 'QBT_TR(Leechers)QBT_TR[CONTEXT=SearchResultsTable]', 100, true);
|
||||||
this.newColumn('siteUrl', '', 'QBT_TR(Search engine)QBT_TR[CONTEXT=SearchResultsTable]', 250, true);
|
this.newColumn('siteUrl', '', 'QBT_TR(Search engine)QBT_TR[CONTEXT=SearchResultsTable]', 250, true);
|
||||||
|
|
||||||
this.initColumnsFunctions();
|
this.initColumnsFunctions();
|
||||||
},
|
},
|
||||||
|
|
||||||
initColumnsFunctions: function () {
|
initColumnsFunctions: function() {
|
||||||
var displayText = function (td, row) {
|
var displayText = function(td, row) {
|
||||||
var value = this.getRowValue(row);
|
var value = this.getRowValue(row);
|
||||||
td.set('html', escapeHtml(value));
|
td.set('html', escapeHtml(value));
|
||||||
}
|
|
||||||
var displaySize = function(td, row) {
|
|
||||||
var size = this.getRowValue(row);
|
|
||||||
td.set('html', friendlyUnit(size, false));
|
|
||||||
}
|
|
||||||
var displayNum = function (td, row) {
|
|
||||||
var value = escapeHtml(this.getRowValue(row));
|
|
||||||
td.set('html', (value === "-1") ? "Unknown" : value);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.columns['fileName'].updateTd = displayText;
|
|
||||||
this.columns['fileSize'].updateTd = displaySize;
|
|
||||||
this.columns['nbSeeders'].updateTd = displayNum;
|
|
||||||
this.columns['nbLeechers'].updateTd = displayNum;
|
|
||||||
this.columns['siteUrl'].updateTd = displayText;
|
|
||||||
},
|
|
||||||
|
|
||||||
getFilteredAndSortedRows: function () {
|
|
||||||
var containsAll = function(text, searchTerms) {
|
|
||||||
text = text.toLowerCase();
|
|
||||||
for (var i = 0; i < searchTerms.length; ++i) {
|
|
||||||
if (text.indexOf(searchTerms[i].toLowerCase()) === -1)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
var getSizeFilters = function() {
|
|
||||||
var minSize = (searchSizeFilter.min > 0.00) ? (searchSizeFilter.min * Math.pow(1024, searchSizeFilter.minUnit)) : 0.00;
|
|
||||||
var maxSize = (searchSizeFilter.max > 0.00) ? (searchSizeFilter.max * Math.pow(1024, searchSizeFilter.maxUnit)) : 0.00;
|
|
||||||
|
|
||||||
if ((minSize > maxSize) && (maxSize > 0.00)) {
|
|
||||||
var tmp = minSize;
|
|
||||||
minSize = maxSize;
|
|
||||||
maxSize = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
min: minSize,
|
|
||||||
max: maxSize
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var getSeedsFilters = function() {
|
|
||||||
var minSeeds = (searchSeedsFilter.min > 0) ? searchSeedsFilter.min : 0;
|
|
||||||
var maxSeeds = (searchSeedsFilter.max > 0) ? searchSeedsFilter.max : 0;
|
|
||||||
|
|
||||||
if ((minSeeds > maxSeeds) && (maxSeeds > 0)) {
|
|
||||||
var tmp = minSeeds;
|
|
||||||
minSeeds = maxSeeds;
|
|
||||||
maxSeeds = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
min: minSeeds,
|
|
||||||
max: maxSeeds
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var filteredRows = [];
|
|
||||||
var rows = this.rows.getValues();
|
|
||||||
var searchTerms = searchPattern.toLowerCase().split(" ");
|
|
||||||
var filterTerms = searchFilterPattern.toLowerCase().split(" ");
|
|
||||||
var sizeFilters = getSizeFilters();
|
|
||||||
var seedsFilters = getSeedsFilters();
|
|
||||||
var searchInTorrentName = $('searchInTorrentName').get('value') === "names";
|
|
||||||
|
|
||||||
if (searchInTorrentName || filterTerms.length || (searchSizeFilter.min > 0.00) || (searchSizeFilter.max > 0.00)) {
|
|
||||||
for (var i = 0; i < rows.length; ++i) {
|
|
||||||
var row = rows[i];
|
|
||||||
|
|
||||||
if (searchInTorrentName && !containsAll(row.full_data.fileName, searchTerms)) continue;
|
|
||||||
if (filterTerms.length && !containsAll(row.full_data.fileName, filterTerms)) continue;
|
|
||||||
if ((sizeFilters.min > 0.00) && (row.full_data.fileSize < sizeFilters.min)) continue;
|
|
||||||
if ((sizeFilters.max > 0.00) && (row.full_data.fileSize > sizeFilters.max)) continue;
|
|
||||||
if ((seedsFilters.min > 0) && (row.full_data.nbSeeders < seedsFilters.min)) continue;
|
|
||||||
if ((seedsFilters.max > 0) && (row.full_data.nbSeeders > seedsFilters.max)) continue;
|
|
||||||
|
|
||||||
filteredRows.push(row);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
filteredRows = rows;
|
|
||||||
}
|
|
||||||
|
|
||||||
filteredRows.sort(function (row1, row2) {
|
|
||||||
var column = this.columns[this.sortedColumn];
|
|
||||||
var res = column.compareRows(row1, row2);
|
|
||||||
if (this.reverseSort == '0')
|
|
||||||
return res;
|
|
||||||
else
|
|
||||||
return -res;
|
|
||||||
}.bind(this));
|
|
||||||
|
|
||||||
return filteredRows;
|
|
||||||
},
|
|
||||||
|
|
||||||
setupTr: function (tr) {
|
|
||||||
tr.addClass("searchTableRow");
|
|
||||||
}
|
}
|
||||||
});
|
var displaySize = function(td, row) {
|
||||||
|
var size = this.getRowValue(row);
|
||||||
|
td.set('html', friendlyUnit(size, false));
|
||||||
|
}
|
||||||
|
var displayNum = function(td, row) {
|
||||||
|
var value = escapeHtml(this.getRowValue(row));
|
||||||
|
td.set('html', (value === "-1") ? "Unknown" : value);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.columns['fileName'].updateTd = displayText;
|
||||||
|
this.columns['fileSize'].updateTd = displaySize;
|
||||||
|
this.columns['nbSeeders'].updateTd = displayNum;
|
||||||
|
this.columns['nbLeechers'].updateTd = displayNum;
|
||||||
|
this.columns['siteUrl'].updateTd = displayText;
|
||||||
|
},
|
||||||
|
|
||||||
|
getFilteredAndSortedRows: function() {
|
||||||
|
var containsAll = function(text, searchTerms) {
|
||||||
|
text = text.toLowerCase();
|
||||||
|
for (var i = 0; i < searchTerms.length; ++i) {
|
||||||
|
if (text.indexOf(searchTerms[i].toLowerCase()) === -1)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
var getSizeFilters = function() {
|
||||||
|
var minSize = (searchSizeFilter.min > 0.00) ? (searchSizeFilter.min * Math.pow(1024, searchSizeFilter.minUnit)) : 0.00;
|
||||||
|
var maxSize = (searchSizeFilter.max > 0.00) ? (searchSizeFilter.max * Math.pow(1024, searchSizeFilter.maxUnit)) : 0.00;
|
||||||
|
|
||||||
|
if ((minSize > maxSize) && (maxSize > 0.00)) {
|
||||||
|
var tmp = minSize;
|
||||||
|
minSize = maxSize;
|
||||||
|
maxSize = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
min: minSize,
|
||||||
|
max: maxSize
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var getSeedsFilters = function() {
|
||||||
|
var minSeeds = (searchSeedsFilter.min > 0) ? searchSeedsFilter.min : 0;
|
||||||
|
var maxSeeds = (searchSeedsFilter.max > 0) ? searchSeedsFilter.max : 0;
|
||||||
|
|
||||||
|
if ((minSeeds > maxSeeds) && (maxSeeds > 0)) {
|
||||||
|
var tmp = minSeeds;
|
||||||
|
minSeeds = maxSeeds;
|
||||||
|
maxSeeds = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
min: minSeeds,
|
||||||
|
max: maxSeeds
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var filteredRows = [];
|
||||||
|
var rows = this.rows.getValues();
|
||||||
|
var searchTerms = searchPattern.toLowerCase().split(" ");
|
||||||
|
var filterTerms = searchFilterPattern.toLowerCase().split(" ");
|
||||||
|
var sizeFilters = getSizeFilters();
|
||||||
|
var seedsFilters = getSeedsFilters();
|
||||||
|
var searchInTorrentName = $('searchInTorrentName').get('value') === "names";
|
||||||
|
|
||||||
|
if (searchInTorrentName || filterTerms.length || (searchSizeFilter.min > 0.00) || (searchSizeFilter.max > 0.00)) {
|
||||||
|
for (var i = 0; i < rows.length; ++i) {
|
||||||
|
var row = rows[i];
|
||||||
|
|
||||||
|
if (searchInTorrentName && !containsAll(row.full_data.fileName, searchTerms)) continue;
|
||||||
|
if (filterTerms.length && !containsAll(row.full_data.fileName, filterTerms)) continue;
|
||||||
|
if ((sizeFilters.min > 0.00) && (row.full_data.fileSize < sizeFilters.min)) continue;
|
||||||
|
if ((sizeFilters.max > 0.00) && (row.full_data.fileSize > sizeFilters.max)) continue;
|
||||||
|
if ((seedsFilters.min > 0) && (row.full_data.nbSeeders < seedsFilters.min)) continue;
|
||||||
|
if ((seedsFilters.max > 0) && (row.full_data.nbSeeders > seedsFilters.max)) continue;
|
||||||
|
|
||||||
|
filteredRows.push(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
filteredRows = rows;
|
||||||
|
}
|
||||||
|
|
||||||
|
filteredRows.sort(function(row1, row2) {
|
||||||
|
var column = this.columns[this.sortedColumn];
|
||||||
|
var res = column.compareRows(row1, row2);
|
||||||
|
if (this.reverseSort == '0')
|
||||||
|
return res;
|
||||||
|
else
|
||||||
|
return -res;
|
||||||
|
}.bind(this));
|
||||||
|
|
||||||
|
return filteredRows;
|
||||||
|
},
|
||||||
|
|
||||||
|
setupTr: function(tr) {
|
||||||
|
tr.addClass("searchTableRow");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var SearchPluginsTable = new Class({
|
var SearchPluginsTable = new Class({
|
||||||
Extends: DynamicTable,
|
Extends: DynamicTable,
|
||||||
|
|
||||||
initColumns: function () {
|
initColumns: function() {
|
||||||
this.newColumn('fullName', '', 'QBT_TR(Name)QBT_TR[CONTEXT=SearchPluginsTable]', 175, true);
|
this.newColumn('fullName', '', 'QBT_TR(Name)QBT_TR[CONTEXT=SearchPluginsTable]', 175, true);
|
||||||
this.newColumn('version', '', 'QBT_TR(Version)QBT_TR[CONTEXT=SearchPluginsTable]', 100, true);
|
this.newColumn('version', '', 'QBT_TR(Version)QBT_TR[CONTEXT=SearchPluginsTable]', 100, true);
|
||||||
this.newColumn('url', '', 'QBT_TR(Url)QBT_TR[CONTEXT=SearchPluginsTable]', 175, true);
|
this.newColumn('url', '', 'QBT_TR(Url)QBT_TR[CONTEXT=SearchPluginsTable]', 175, true);
|
||||||
this.newColumn('enabled', '', 'QBT_TR(Enabled)QBT_TR[CONTEXT=SearchPluginsTable]', 100, true);
|
this.newColumn('enabled', '', 'QBT_TR(Enabled)QBT_TR[CONTEXT=SearchPluginsTable]', 100, true);
|
||||||
|
|
||||||
this.initColumnsFunctions();
|
this.initColumnsFunctions();
|
||||||
},
|
},
|
||||||
|
|
||||||
initColumnsFunctions: function () {
|
initColumnsFunctions: function() {
|
||||||
var displayText = function (td, row) {
|
var displayText = function(td, row) {
|
||||||
var value = this.getRowValue(row);
|
var value = this.getRowValue(row);
|
||||||
td.set('html', escapeHtml(value));
|
td.set('html', escapeHtml(value));
|
||||||
}
|
|
||||||
|
|
||||||
this.columns['fullName'].updateTd = displayText;
|
|
||||||
this.columns['version'].updateTd = displayText;
|
|
||||||
this.columns['url'].updateTd = displayText;
|
|
||||||
this.columns['enabled'].updateTd = function(td, row) {
|
|
||||||
var value = this.getRowValue(row);
|
|
||||||
if (value) {
|
|
||||||
td.set('html', "Yes");
|
|
||||||
td.getParent("tr").addClass("green");
|
|
||||||
td.getParent("tr").removeClass("red");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
td.set('html', "No");
|
|
||||||
td.getParent("tr").addClass("red");
|
|
||||||
td.getParent("tr").removeClass("green");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
setupTr: function (tr) {
|
|
||||||
tr.addClass("searchPluginsTableRow");
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
this.columns['fullName'].updateTd = displayText;
|
||||||
|
this.columns['version'].updateTd = displayText;
|
||||||
|
this.columns['url'].updateTd = displayText;
|
||||||
|
this.columns['enabled'].updateTd = function(td, row) {
|
||||||
|
var value = this.getRowValue(row);
|
||||||
|
if (value) {
|
||||||
|
td.set('html', "Yes");
|
||||||
|
td.getParent("tr").addClass("green");
|
||||||
|
td.getParent("tr").removeClass("red");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
td.set('html', "No");
|
||||||
|
td.getParent("tr").addClass("red");
|
||||||
|
td.getParent("tr").removeClass("green");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
setupTr: function(tr) {
|
||||||
|
tr.addClass("searchPluginsTableRow");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/*************************************************************/
|
/*************************************************************/
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* JS counterpart of the function in src/misc.cpp
|
* JS counterpart of the function in src/misc.cpp
|
||||||
*/
|
*/
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
it in the onContentLoaded function of the new window.
|
it in the onContentLoaded function of the new window.
|
||||||
|
|
||||||
----------------------------------------------------------------- */
|
----------------------------------------------------------------- */
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/* Define localStorage object for older browsers */
|
/* Define localStorage object for older browsers */
|
||||||
if (typeof localStorage == 'undefined') {
|
if (typeof localStorage == 'undefined') {
|
||||||
window['localStorage'] = {
|
window['localStorage'] = {
|
||||||
@ -29,12 +31,43 @@ function getLocalStorageItem(name, defaultVal) {
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var saveWindowSize = function() {};
|
||||||
|
var loadWindowWidth = function() {};
|
||||||
|
var loadWindowHeight = function() {};
|
||||||
|
var showDownloadPage = function() {};
|
||||||
|
var globalUploadLimitFN = function() {};
|
||||||
|
var uploadLimitFN = function() {};
|
||||||
|
var shareRatioFN = function() {};
|
||||||
|
var toggleSequentialDownloadFN = function() {};
|
||||||
|
var toggleFirstLastPiecePrioFN = function() {};
|
||||||
|
var setSuperSeedingFN = function() {};
|
||||||
|
var setForceStartFN = function() {};
|
||||||
|
var globalDownloadLimitFN = function() {};
|
||||||
|
var StatisticsLinkFN = function() {};
|
||||||
|
var downloadLimitFN = function() {};
|
||||||
var deleteFN = function() {};
|
var deleteFN = function() {};
|
||||||
var startFN = function() {};
|
|
||||||
var pauseFN = function() {};
|
var pauseFN = function() {};
|
||||||
|
var startFN = function() {};
|
||||||
|
var autoTorrentManagementFN = function() {};
|
||||||
|
var recheckFN = function() {};
|
||||||
|
var reannounceFN = function() {};
|
||||||
|
var setLocationFN = function() {};
|
||||||
|
var renameFN = function() {};
|
||||||
|
var torrentNewCategoryFN = function() {};
|
||||||
|
var torrentSetCategoryFN = function() {};
|
||||||
|
var createCategoryFN = function() {};
|
||||||
|
var editCategoryFN = function() {};
|
||||||
|
var removeCategoryFN = function() {};
|
||||||
|
var deleteUnusedCategoriesFN = function() {};
|
||||||
|
var startTorrentsByCategoryFN = function() {};
|
||||||
|
var pauseTorrentsByCategoryFN = function() {};
|
||||||
|
var deleteTorrentsByCategoryFN = function() {};
|
||||||
|
var copyNameFN = function() {};
|
||||||
|
var copyMagnetLinkFN = function() {};
|
||||||
|
var copyHashFN = function() {};
|
||||||
|
var setPriorityFN = function() {};
|
||||||
|
|
||||||
initializeWindows = function() {
|
var initializeWindows = function() {
|
||||||
|
|
||||||
saveWindowSize = function(windowId) {
|
saveWindowSize = function(windowId) {
|
||||||
var size = $(windowId).getSize();
|
var size = $(windowId).getSize();
|
||||||
localStorage.setItem('window_' + windowId + '_width', size.x);
|
localStorage.setItem('window_' + windowId + '_width', size.x);
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
var ProgressBar = new Class({
|
var ProgressBar = new Class({
|
||||||
initialize: function(value, parameters) {
|
initialize: function(value, parameters) {
|
||||||
var vals = {
|
var vals = {
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
var is_seed = true;
|
var is_seed = true;
|
||||||
var current_hash = "";
|
var current_hash = "";
|
||||||
|
|
||||||
@ -350,5 +352,5 @@ var updateTorrentFilesData = function() {
|
|||||||
loadTorrentFilesData();
|
loadTorrentFilesData();
|
||||||
};
|
};
|
||||||
|
|
||||||
fTable = new filesDynTable();
|
var fTable = new filesDynTable();
|
||||||
fTable.setup($('filesTable'));
|
fTable.setup($('filesTable'));
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
var clearData = function() {
|
var clearData = function() {
|
||||||
$('time_elapsed').set('html', '');
|
$('time_elapsed').set('html', '');
|
||||||
$('eta').set('html', '');
|
$('eta').set('html', '');
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
var trackersDynTable = new Class({
|
var trackersDynTable = new Class({
|
||||||
|
|
||||||
initialize: function() {},
|
initialize: function() {},
|
||||||
@ -230,7 +232,7 @@ var removeTrackerFN = function(element) {
|
|||||||
}).send();
|
}).send();
|
||||||
};
|
};
|
||||||
|
|
||||||
torrentTrackersTable = new trackersDynTable();
|
var torrentTrackersTable = new trackersDynTable();
|
||||||
torrentTrackersTable.setup($('trackersTable'), torrentTrackersContextMenu);
|
torrentTrackersTable.setup($('trackersTable'), torrentTrackersContextMenu);
|
||||||
|
|
||||||
new ClipboardJS('#CopyTrackerUrl', {
|
new ClipboardJS('#CopyTrackerUrl', {
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
var webseedsDynTable = new Class({
|
var webseedsDynTable = new Class({
|
||||||
|
|
||||||
initialize: function() {},
|
initialize: function() {},
|
||||||
@ -105,5 +107,5 @@ var updateWebSeedsData = function() {
|
|||||||
loadWebSeedsData();
|
loadWebSeedsData();
|
||||||
};
|
};
|
||||||
|
|
||||||
wsTable = new webseedsDynTable();
|
var wsTable = new webseedsDynTable();
|
||||||
wsTable.setup($('webseedsTable'));
|
wsTable.setup($('webseedsTable'));
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
line-height: 1.5em;
|
line-height: 1.5em;
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id="searchResults">
|
<div id="searchResults">
|
||||||
@ -201,7 +202,7 @@
|
|||||||
var searchKeyboardEvents = new Keyboard({
|
var searchKeyboardEvents = new Keyboard({
|
||||||
defaultEventType: 'keydown',
|
defaultEventType: 'keydown',
|
||||||
events: {
|
events: {
|
||||||
'enter': function (e) {
|
'enter': function(e) {
|
||||||
// accept enter key as a click
|
// accept enter key as a click
|
||||||
new Event(e).stop();
|
new Event(e).stop();
|
||||||
|
|
||||||
@ -453,7 +454,7 @@
|
|||||||
$('searchResultsTableContainer').style.display = "block";
|
$('searchResultsTableContainer').style.display = "block";
|
||||||
|
|
||||||
// sort plugins alphabetically
|
// sort plugins alphabetically
|
||||||
var allPlugins = searchPlugins.sort(function(pluginA, pluginB){
|
var allPlugins = searchPlugins.sort(function(pluginA, pluginB) {
|
||||||
var a = pluginA.fullName.toLowerCase();
|
var a = pluginA.fullName.toLowerCase();
|
||||||
var b = pluginB.fullName.toLowerCase();
|
var b = pluginB.fullName.toLowerCase();
|
||||||
if (a < b) return -1;
|
if (a < b) return -1;
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
#searchPlugins_content {
|
#searchPlugins_content {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id="searchPluginsContainer">
|
<div id="searchPluginsContainer">
|
||||||
@ -90,7 +91,7 @@
|
|||||||
Enabled: enablePlugin,
|
Enabled: enablePlugin,
|
||||||
Uninstall: uninstallPlugin
|
Uninstall: uninstallPlugin
|
||||||
},
|
},
|
||||||
offsets : calculateContextMenuOffsets()
|
offsets: calculateContextMenuOffsets()
|
||||||
});
|
});
|
||||||
searchPluginsTable.setup('searchPluginsTableDiv', 'searchPluginsTableFixedHeaderDiv', searchPluginsTableContextMenu);
|
searchPluginsTable.setup('searchPluginsTableDiv', 'searchPluginsTableFixedHeaderDiv', searchPluginsTableContextMenu);
|
||||||
updateSearchPluginsTable();
|
updateSearchPluginsTable();
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
<script src="scripts/lib/mootools-1.2-more.js"></script>
|
<script src="scripts/lib/mootools-1.2-more.js"></script>
|
||||||
<script src="scripts/misc.js?locale=${LANG}"></script>
|
<script src="scripts/misc.js?locale=${LANG}"></script>
|
||||||
<script>
|
<script>
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var setLocationKeyboardEvents = new Keyboard({
|
var setLocationKeyboardEvents = new Keyboard({
|
||||||
defaultEventType: 'keydown',
|
defaultEventType: 'keydown',
|
||||||
events: {
|
events: {
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
<script src="scripts/lib/mootools-1.2-more.js"></script>
|
<script src="scripts/lib/mootools-1.2-more.js"></script>
|
||||||
<script src="scripts/misc.js?locale=${LANG}"></script>
|
<script src="scripts/misc.js?locale=${LANG}"></script>
|
||||||
<script>
|
<script>
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var UseGlobalLimit = -2;
|
var UseGlobalLimit = -2;
|
||||||
var NoLimit = -1;
|
var NoLimit = -1;
|
||||||
|
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
'use strict';
|
||||||
|
|
||||||
//create a context menu
|
//create a context menu
|
||||||
var torrentsTableContextMenu = new TorrentsTableContextMenu({
|
var torrentsTableContextMenu = new TorrentsTableContextMenu({
|
||||||
targets: '.torrentsTableContextMenuTarget',
|
targets: '.torrentsTableContextMenuTarget',
|
||||||
@ -61,7 +63,7 @@
|
|||||||
UploadLimit: function(element, ref) {
|
UploadLimit: function(element, ref) {
|
||||||
uploadLimitFN();
|
uploadLimitFN();
|
||||||
},
|
},
|
||||||
ShareRatio : function (element, ref) {
|
ShareRatio: function(element, ref) {
|
||||||
shareRatioFN();
|
shareRatioFN();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -122,6 +122,8 @@
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var submitted = false;
|
var submitted = false;
|
||||||
|
|
||||||
$('uploadForm').addEventListener("submit", function() {
|
$('uploadForm').addEventListener("submit", function() {
|
||||||
|
@ -22,8 +22,10 @@
|
|||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var hashes = new URI().getData('hashes').split('|');
|
var hashes = new URI().getData('hashes').split('|');
|
||||||
setUpLimit = function() {
|
var setUpLimit = function() {
|
||||||
var limit = $("uplimitUpdatevalue").value.toInt() * 1024;
|
var limit = $("uplimitUpdatevalue").value.toInt() * 1024;
|
||||||
if (hashes[0] == "global") {
|
if (hashes[0] == "global") {
|
||||||
new Request({
|
new Request({
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="css/login.css" />
|
<link rel="stylesheet" type="text/css" href="css/login.css" />
|
||||||
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
|
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
'use strict';
|
||||||
|
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
$('username').focus();
|
$('username').focus();
|
||||||
$('username').select();
|
$('username').select();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user