Skip to content

Fixes for ruTorrent jQuery & Utility commits #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions getConf.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
$autodlPort = $config['gui-server-port'];
$autodlPassword = $config['gui-server-password'];
} catch (Exception $e) {
eval(getPluginConf('autodl-irssi'));
eval(FileUtil::getPluginConf('autodl-irssi'));
}

function attemptZeroConfig() {
if (!isLocalMode()) {
if (!User::isLocalMode()) {
throw new Exception('Zeroconfig is not available for remote connections');
}

Expand Down
5 changes: 2 additions & 3 deletions init.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,10 @@ function()
this.addSeparatorToToolbar(beforeId);

var this_ = this;
$("#mnu_autodl-tb").click(function(e)
$("#mnu_autodl-tb").on('click', function(e)
{
this_._onClickToolbarButton(e);
}).
mouseup(function(e)
}).on('mouseup', function(e)
{
// Prevent ruTorrent from closing the popup menu
e.stopPropagation();
Expand Down
14 changes: 7 additions & 7 deletions js/AutodlIrssiTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function AutodlIrssiTab(dialogManager, plugin)
'</div>'
).get(0), "autodl-irssi", "lcont");

$("#autodl-restore").submit(function()
$("#autodl-restore").on('submit', function()
{
if ($("#autodl-restore-file").val() == "")
{
Expand All @@ -113,31 +113,31 @@ function AutodlIrssiTab(dialogManager, plugin)
dialogManager.clearConfigFileCache();
return true;
});
$("#autodl-log-backup-button").click(function()
$("#autodl-log-backup-button").on('click', function()
{
backupIframe.attr("src", "plugins/autodl-irssi/getfile.php?file=autodl.cfg");
});
$("#autodl-log-update-button").click(function()
$("#autodl-log-update-button").on('click', function()
{
this_._sendAutodlCommand("update");
});
$("#autodl-log-whatsnew-button").click(function()
$("#autodl-log-whatsnew-button").on('click', function()
{
this_._sendAutodlCommand("whatsnew");
});
$("#autodl-log-version-button").click(function()
$("#autodl-log-version-button").on('click', function()
{
this_._sendAutodlCommand("version");
});
$("#autodl-log-reload-trackers-button").click(function()
$("#autodl-log-reload-trackers-button").on('click', function()
{
this_._sendAutodlCommand("reloadtrackers");
});

this._initResizeBottom();
this._initOnShow();

$("#autodl-log-clear-button").click(function(e)
$("#autodl-log-clear-button").on('click', function(e)
{
$("#autodl-log-tbody").empty();
});
Expand Down
6 changes: 3 additions & 3 deletions js/DialogUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ function DropDownBox(id)
this.selectedIndex = -1;

var this_ = this;
$(this.selectElem).change(function(e) { this_._onChange(); })
$(this.selectElem).on('change', function(e) { this_._onChange(); })
// selectedIndex should be updated when we get a keyup event
.keyup(function(e) { this_._onChange(); });
.on('keyup', function(e) { this_._onChange(); });
}

DropDownBox.prototype._onChange =
Expand Down Expand Up @@ -286,7 +286,7 @@ function SyncTextBoxes(ids)
(function(i, textbox)
{
this_.textboxElems.push(textbox);
$(textbox).keyup(function(e) { this_.setNewValue(i); })
$(textbox).on('keyup', function(e) { this_.setNewValue(i); })
})(i, document.getElementById(ids[i]));
}
}
Expand Down
152 changes: 76 additions & 76 deletions js/Filters.js

Large diffs are not rendered by default.

66 changes: 33 additions & 33 deletions js/IrcServers.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ function(multiSelectDlgBox, okHandler)
theDialogManager.make("autodl-ircsrvs", theUILang.autodlIrcServers,
'<div id="autodl-ircsrvs">' +
'<div id="autodl-ircsrvs-left">' +
'<div id="autodl-ircsrvs-list" />' +
'<div id="autodl-ircsrvs-list"></div>' +
'<div id="autodl-ircsrvs-list-buttons" align="center">' +
'<div>' +
'<input type="button" class="Button" id="autodl-ircsrvs-new-button" value="' + theUILang.autodlNew + '" />' +
'<input type="button" class="Button" id="autodl-ircsrvs-remove-button" value="' + theUILang.autodlRemove + '" />' +
'<input type="button" class="Button" id="autodl-ircsrvs-new-button" value="' + theUILang.autodlNew + '"></input>' +
'<input type="button" class="Button" id="autodl-ircsrvs-remove-button" value="' + theUILang.autodlRemove + '"></input>' +
'</div>' +
'<div>' +
'<input type="button" class="Button" id="autodl-ircsrvs-announce-channels-button" value="' + theUILang.autodlServers2 + '" />' +
'<input type="button" class="Button" id="autodl-ircsrvs-announce-channels-button" value="' + theUILang.autodlServers2 + '"></input>' +
'</div>' +
'</div>' +
'</div>' +
Expand All @@ -48,65 +48,65 @@ function(multiSelectDlgBox, okHandler)
'<legend>' + theUILang.autodlIrcsrvs1 + '</legend>' +
'<div>' +
'<label for="autodl-ircsrvs-server">' + theUILang.autodlIrcsrvs2 + '</label>' +
'<input type="text" class="textbox-12" id="autodl-ircsrvs-server" title="' + theUILang.autodlIrcsrvs3 + '" placeholder="' + theUILang.autodlIrcsrvs4 + '"/>' +
'<input type="text" class="textbox-12" id="autodl-ircsrvs-server" title="' + theUILang.autodlIrcsrvs3 + '" placeholder="' + theUILang.autodlIrcsrvs4 + '"></input>' +
'<label for="autodl-ircsrvs-port">' + theUILang.autodlIrcsrvs5 + '</label>' +
'<input type="text" class="textbox-5" id="autodl-ircsrvs-port" title="' + theUILang.autodlIrcsrvs6 + '" placeholder="' + theUILang.autodlIrcsrvs7 + '"/>' +
'<input type="checkbox" id="autodl-ircsrvs-ssl" title="' + theUILang.autodlIrcsrvs8 + '"/>' +
'<input type="text" class="textbox-5" id="autodl-ircsrvs-port" title="' + theUILang.autodlIrcsrvs6 + '" placeholder="' + theUILang.autodlIrcsrvs7 + '"></input>' +
'<input type="checkbox" id="autodl-ircsrvs-ssl" title="' + theUILang.autodlIrcsrvs8 + '"></input>' +
'<label for="autodl-ircsrvs-ssl" title="' + theUILang.autodlIrcsrvs9 + '">' + theUILang.autodlIrcsrvs10 + '</label>' +
'</div>' +
'<div>' +
'<label for="autodl-ircsrvs-nick">' + theUILang.autodlIrcsrvs11 + '</label>' +
'<input type="text" class="textbox-5" id="autodl-ircsrvs-nick" title="' + theUILang.autodlIrcsrvs12 + '"/>' +
'<input type="text" class="textbox-5" id="autodl-ircsrvs-nick" title="' + theUILang.autodlIrcsrvs12 + '"></input>' +
'<label for="autodl-ircsrvs-identpass">' + theUILang.autodlPassword + '</label>' +
'<input type="password" class="textbox-5" id="autodl-ircsrvs-identpass" title="' + theUILang.autodlIrcsrvs14 + '"/>' +
'<input type="password" class="textbox-5" id="autodl-ircsrvs-identpass" title="' + theUILang.autodlIrcsrvs14 + '"></input>' +
'<label for="autodl-ircsrvs-identemail">' + theUILang.autodlIrcsrvs15 + '</label>' +
'<input type="text" class="textbox-7" id="autodl-ircsrvs-identemail" title="' + theUILang.autodlIrcsrvs16 + '"/>' +
'<input type="text" class="textbox-7" id="autodl-ircsrvs-identemail" title="' + theUILang.autodlIrcsrvs16 + '"></input>' +
'</div>' +
'<div>' +
'<label for="autodl-ircsrvs-server-password">' + theUILang.autodlIrcsrvs32 + '</label>' +
'<input type="text" class="textbox-12" id="autodl-ircsrvs-server-password" title="' + theUILang.autodlIrcsrvs33 + '"/>' +
'<input type="checkbox" id="autodl-ircsrvs-bnc" title="' + theUILang.autodlIrcsrvs34 + '"/>' +
'<input type="text" class="textbox-12" id="autodl-ircsrvs-server-password" title="' + theUILang.autodlIrcsrvs33 + '"></input>' +
'<input type="checkbox" id="autodl-ircsrvs-bnc" title="' + theUILang.autodlIrcsrvs34 + '"></input>' +
'<label for="autodl-ircsrvs-bnc" title="' + theUILang.autodlIrcsrvs35 + '">' + theUILang.autodlIrcsrvs36 + '</label>' +
'</div>' +
'</fieldset>' +
'<fieldset id="autodl-ircsrvs-channels-fieldset">' +
'<legend>' + theUILang.autodlIrcsrvs17 + '</legend>' +
'<div>' +
'<select id="autodl-ircsrvs-channels"/>' +
'<input type="button" class="Button" id="autodl-ircsrvs-new-channel-button" value="' + theUILang.autodlNew + '" />' +
'<input type="button" class="Button" id="autodl-ircsrvs-remove-channel-button" value="' + theUILang.autodlRemove + '" />' +
'<select id="autodl-ircsrvs-channels"></select>' +
'<input type="button" class="Button" id="autodl-ircsrvs-new-channel-button" value="' + theUILang.autodlNew + '"></input>' +
'<input type="button" class="Button" id="autodl-ircsrvs-remove-channel-button" value="' + theUILang.autodlRemove + '"></input>' +
'</div>' +
'<div>' +
'<label for="autodl-ircsrvs-channel">' + theUILang.autodlIrcsrvs18 + '</label>' +
'<input type="text" class="textbox-11" id="autodl-ircsrvs-channel" title="' + theUILang.autodlIrcsrvs19 + '" placeholder="' + theUILang.autodlIrcsrvs20 + '"/>' +
'<input type="text" class="textbox-11" id="autodl-ircsrvs-channel" title="' + theUILang.autodlIrcsrvs19 + '" placeholder="' + theUILang.autodlIrcsrvs20 + '"></input>' +
'<label for="autodl-ircsrvs-channelpass">' + theUILang.autodlPassword + '</label>' +
'<input type="password" class="textbox-8" id="autodl-ircsrvs-channelpass" title="' + theUILang.autodlIrcsrvs22 + '"/>' +
'<input type="password" class="textbox-8" id="autodl-ircsrvs-channelpass" title="' + theUILang.autodlIrcsrvs22 + '"></input>' +
'</div>' +
'<table>' +
'<tbody>' +
'<tr>' +
'<td><label for="autodl-ircsrvs-chaninvite">' + theUILang.autodlIrcsrvs23 + '</label></td>' +
'<td><input type="text" class="textbox-20" id="autodl-ircsrvs-chaninvite" title="' + theUILang.autodlIrcsrvs24 + '" placeholder="' + theUILang.autodlIrcsrvs25 + '"/></td>' +
'<td><input type="text" class="textbox-20" id="autodl-ircsrvs-chaninvite" title="' + theUILang.autodlIrcsrvs24 + '" placeholder="' + theUILang.autodlIrcsrvs25 + '"></input></td>' +
'</tr>' +
'<tr>' +
'<td><label for="autodl-ircsrvs-httpurl">' + theUILang.autodlIrcsrvs26 + '</label></td>' +
'<td><input type="text" class="textbox-20" id="autodl-ircsrvs-httpurl" title="' + theUILang.autodlIrcsrvs27 + '"/></td>' +
'<td><input type="text" class="textbox-20" id="autodl-ircsrvs-httpurl" title="' + theUILang.autodlIrcsrvs27 + '"></input></td>' +
'</tr>' +
'<tr>' +
'<td><label for="autodl-ircsrvs-httpheader">' + theUILang.autodlIrcsrvs28 + '</label></td>' +
'<td><input type="text" class="textbox-20" id="autodl-ircsrvs-httpheader" title="' + theUILang.autodlIrcsrvs29 + '"/></td>' +
'<td><input type="text" class="textbox-20" id="autodl-ircsrvs-httpheader" title="' + theUILang.autodlIrcsrvs29 + '"></input></td>' +
'</tr>' +
'<tr>' +
'<td><label for="autodl-ircsrvs-httpdata">' + theUILang.autodlIrcsrvs30 + '</label></td>' +
'<td><input type="text" class="textbox-20" id="autodl-ircsrvs-httpdata" title="' + theUILang.autodlIrcsrvs31 + '"/></td>' +
'<td><input type="text" class="textbox-20" id="autodl-ircsrvs-httpdata" title="' + theUILang.autodlIrcsrvs31 + '"></input></td>' +
'</tr>' +
'</tbody>' +
'</table>' +
'</fieldset>' +
'</div>' +
'<div class="aright buttons-list dialog-buttons">' +
'<input type="button" id="autodl-ircsrvs-ok-button" value="' + theUILang.ok + '" class="OK Button" />' +
'<input type="button" value="' + theUILang.Cancel + '" class="Cancel Button" />' +
'<input type="button" id="autodl-ircsrvs-ok-button" value="' + theUILang.ok + '" class="OK Button"></input>' +
'<input type="button" value="' + theUILang.Cancel + '" class="Cancel Button"></input>' +
'</div>' +
'</div>'
);
Expand All @@ -132,31 +132,31 @@ function(multiSelectDlgBox, okHandler)
new DialogOptionText("autodl-ircsrvs-httpdata", "invite-http-data", "")
];

$("#autodl-ircsrvs-new-button").click(function()
$("#autodl-ircsrvs-new-button").on('click', function()
{
this_._onNewServerClicked();
});
$("#autodl-ircsrvs-remove-button").click(function()
$("#autodl-ircsrvs-remove-button").on('click', function()
{
this_._onRemoveServerClicked();
});
$("#autodl-ircsrvs-announce-channels-button").click(function()
$("#autodl-ircsrvs-announce-channels-button").on('click', function()
{
theDialogManager.show("autodl-servers");
});
$("#autodl-ircsrvs-new-channel-button").click(function()
$("#autodl-ircsrvs-new-channel-button").on('click', function()
{
this_._onNewChannelClicked();
});
$("#autodl-ircsrvs-remove-channel-button").click(function()
$("#autodl-ircsrvs-remove-channel-button").on('click', function()
{
this_._onRemoveChannelClicked();
});
$("#autodl-ircsrvs-server").keyup(function(e)
$("#autodl-ircsrvs-server").on('keyup', function(e)
{
this_._onServerNameModified();
});
$("#autodl-ircsrvs-channel").keyup(function(e)
$("#autodl-ircsrvs-channel").on('keyup', function(e)
{
this_._onChannelNameModified();
});
Expand All @@ -170,7 +170,7 @@ function(multiSelectDlgBox, okHandler)
this_.onChannelsDropDownChange(oldValue, newValue);
};

$("#autodl-ircsrvs-ok-button").click(function(e) { okHandler() });
$("#autodl-ircsrvs-ok-button").on('click', function(e) { okHandler() });
}

IrcServers.prototype.onBeforeShow =
Expand Down Expand Up @@ -253,8 +253,8 @@ function(serverInfo)
{
serverInfo: serverInfo
};
obj.checkboxElem = $('<input type="checkbox" />')[0];
obj.labelElem = $('<label />').text(this._fixName(serverInfo.serverSection.name))[0];
obj.checkboxElem = $('<input type="checkbox"></input>')[0];
obj.labelElem = $('<label></label>').text(this._fixName(serverInfo.serverSection.name))[0];

if (serverInfo.serverSection.getOption("enabled", "true", "bool").getValue())
$(obj.checkboxElem).attr("checked", "checked");
Expand Down
2 changes: 1 addition & 1 deletion js/ListBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function(elem, data)
$(this.lbElem).append(obj.elem);

var this_ = this;
$(obj.elem).click(function(e)
$(obj.elem).on('click', function(e)
{
this_.select(this_._findIndex(obj));
});
Expand Down
12 changes: 6 additions & 6 deletions js/MultiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ function MultiSelect()
{
theDialogManager.make("autodl-multiselect", theUILang.autodlSelect,
'<div id="autodl-multiselect">' +
'<div id="autodl-multiselect-title" />' +
'<div id="autodl-multiselect-title"></div>' +
'<div id="autodl-multiselect-content">' +
'<select multiple="multiple" id="autodl-multiselect-select" />' +
'<select multiple="multiple" id="autodl-multiselect-select"></select>' +
'</div>' +
'<div class="aright buttons-list dialog-buttons">' +
'<input type="button" id="autodl-multiselect-ok-button" value="' + theUILang.ok + '" class="OK Button" />' +
'<input type="button" value="' + theUILang.Cancel + '" class="Cancel Button" />' +
'<input type="button" id="autodl-multiselect-ok-button" value="' + theUILang.ok + '" class="OK Button"></input>' +
'<input type="button" value="' + theUILang.Cancel + '" class="Cancel Button"></input>' +
'</div>' +
'</div>', true
);
Expand All @@ -50,7 +50,7 @@ function MultiSelect()
this_.onAfterHide();
});

$("#autodl-multiselect-ok-button").click(function(e)
$("#autodl-multiselect-ok-button").on('click', function(e)
{
this_._onClickOk();
});
Expand Down Expand Up @@ -103,7 +103,7 @@ function()

for (var i = 0; i < this.data.listboxData.length; i++)
{
var option = $('<option />').text(this.data.listboxData[i].displayName);
var option = $('<option></option>').text(this.data.listboxData[i].displayName);
if (isSelected(this.data.listboxData[i].validNames))
option.attr("selected", "selected");
$(this.selectElem).append(option);
Expand Down
Loading