mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
Web UI: Stop using absolute URLs in ajax requests (closes #1011226)
This commit is contained in:
parent
55a6bc3855
commit
81e4e39878
@ -12,7 +12,7 @@
|
||||
$('addTrackersButton').addEvent('click', function(e){
|
||||
new Event(e).stop();
|
||||
var hash = new URI().getData('hash');
|
||||
new Request({url: '/command/addTrackers', method: 'post', data: {hash: hash, urls: $('trackersUrls').value},
|
||||
new Request({url: 'command/addTrackers', method: 'post', data: {hash: hash, urls: $('trackersUrls').value},
|
||||
onComplete: function() {
|
||||
window.parent.document.getElementById('trackersPage').parentNode.removeChild(window.parent.document.getElementById('trackersPage'));
|
||||
}
|
||||
|
@ -45,9 +45,9 @@ window.addEvent('domready', function(){
|
||||
});
|
||||
$('confirmBtn').addEvent('click', function(e){
|
||||
new Event(e).stop();
|
||||
var cmd = '/command/delete';
|
||||
var cmd = 'command/delete';
|
||||
if($('deleteFromDiskCB').get('checked'))
|
||||
cmd = '/command/deletePerm';
|
||||
cmd = 'command/deletePerm';
|
||||
new Request({url: cmd,
|
||||
method: 'post',
|
||||
data: {hashes: hashes.join('|')},
|
||||
|
@ -25,7 +25,7 @@
|
||||
setDlLimit = function() {
|
||||
var limit = $("dllimitUpdatevalue").get('html').toInt() * 1024;
|
||||
if(hash == "global") {
|
||||
new Request({url: '/command/setGlobalDlLimit',
|
||||
new Request({url: 'command/setGlobalDlLimit',
|
||||
method: 'post',
|
||||
data: {'limit': limit},
|
||||
onComplete: function() {
|
||||
@ -33,7 +33,7 @@
|
||||
}
|
||||
}).send();
|
||||
} else {
|
||||
new Request({url: '/command/setTorrentDlLimit',
|
||||
new Request({url: 'command/setTorrentDlLimit',
|
||||
method: 'post',
|
||||
data: {'hash': hash, 'limit': limit},
|
||||
onComplete: function() {
|
||||
|
@ -1043,7 +1043,7 @@ applyPreferences = function() {
|
||||
// Send it to qBT
|
||||
var json_str = JSON.encode(settings);
|
||||
|
||||
new Request({url: '/command/setPreferences',
|
||||
new Request({url: 'command/setPreferences',
|
||||
method: 'post',
|
||||
data: {'json': json_str,
|
||||
},
|
||||
|
@ -88,7 +88,7 @@ var allCBUnchecked = function() {
|
||||
|
||||
var setFilePriority = function(id, priority) {
|
||||
if(current_hash == "") return;
|
||||
new Request({url: '/command/setFilePrio', method: 'post', data: {'hash': current_hash, 'id': id, 'priority': priority}}).send();
|
||||
new Request({url: 'command/setFilePrio', method: 'post', data: {'hash': current_hash, 'id': id, 'priority': priority}}).send();
|
||||
// Display or add combobox
|
||||
if(priority > 0) {
|
||||
$('comboPrio'+id).set("value", 1);
|
||||
|
@ -15,7 +15,7 @@ function hideAll() {
|
||||
<iframe id="upload_frame" name="upload_frame" style="width:1px;height:1px;border:0px;" src="javascript:false;"></iframe>
|
||||
<center>
|
||||
<h1 class="vcenter"><img class="vcenter" title="Download local torrent" src="theme/list-add"/>_(Download local torrent)</h1>
|
||||
<form action="/command/upload" enctype="multipart/form-data" method="post" id="uploadForm" target="upload_frame">
|
||||
<form action="command/upload" enctype="multipart/form-data" method="post" id="uploadForm" target="upload_frame">
|
||||
<input type="file" name="torrentfile" id="torrentfile" size="40"/><br/><br/>
|
||||
<input type="submit" value="_(Download)" id="upButton"/>
|
||||
</form>
|
||||
|
@ -25,7 +25,7 @@
|
||||
setUpLimit = function() {
|
||||
var limit = $("uplimitUpdatevalue").get('html').toInt() * 1024;
|
||||
if(hash == "global") {
|
||||
new Request({url: '/command/setGlobalUpLimit',
|
||||
new Request({url: 'command/setGlobalUpLimit',
|
||||
method: 'post',
|
||||
data: {'limit': limit},
|
||||
onComplete: function() {
|
||||
@ -33,7 +33,7 @@
|
||||
}
|
||||
}).send();
|
||||
}else {
|
||||
new Request({url: '/command/setTorrentUpLimit',
|
||||
new Request({url: 'command/setTorrentUpLimit',
|
||||
method: 'post',
|
||||
data: {'hash': hash, 'limit': limit},
|
||||
onComplete: function() {
|
||||
|
@ -25,7 +25,7 @@ window.addEvent('domready', function(){
|
||||
$('urls').focus();
|
||||
$('downButton').addEvent('click', function(e){
|
||||
new Event(e).stop();
|
||||
new Request({url: '/command/download', method: 'post', data: {urls: $('urls').value},
|
||||
new Request({url: 'command/download', method: 'post', data: {urls: $('urls').value},
|
||||
onComplete: function() {
|
||||
window.parent.document.getElementById('downloadPage').parentNode.removeChild(window.parent.document.getElementById('downloadPage'));
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ initializeWindows = function(){
|
||||
var h = myTable.selectedIds();
|
||||
/*if(h.length && confirm('_(Are you sure you want to delete the selected torrents from the transfer list?)')) {
|
||||
h.each(function(item, index){
|
||||
new Request({url: '/command/delete', method: 'post', data: {hash: item}}).send();
|
||||
new Request({url: 'command/delete', method: 'post', data: {hash: item}}).send();
|
||||
});
|
||||
}*/
|
||||
if(h.length) {
|
||||
@ -180,7 +180,7 @@ initializeWindows = function(){
|
||||
var h = myTable.selectedIds();
|
||||
if(h.length){
|
||||
h.each(function(hash, index){
|
||||
new Request({url: '/command/pause', method: 'post', data: {hash: hash}}).send();
|
||||
new Request({url: 'command/pause', method: 'post', data: {hash: hash}}).send();
|
||||
});
|
||||
}
|
||||
};
|
||||
@ -189,7 +189,7 @@ initializeWindows = function(){
|
||||
var h = myTable.selectedIds();
|
||||
if(h.length){
|
||||
h.each(function(hash, index){
|
||||
new Request({url: '/command/resume', method: 'post', data: {hash: hash}}).send();
|
||||
new Request({url: 'command/resume', method: 'post', data: {hash: hash}}).send();
|
||||
});
|
||||
}
|
||||
};
|
||||
@ -198,7 +198,7 @@ initializeWindows = function(){
|
||||
var h = myTable.selectedIds();
|
||||
if(h.length){
|
||||
h.each(function(hash, index){
|
||||
new Request({url: '/command/recheck', method: 'post', data: {hash: hash}}).send();
|
||||
new Request({url: 'command/recheck', method: 'post', data: {hash: hash}}).send();
|
||||
});
|
||||
}
|
||||
};
|
||||
@ -209,14 +209,14 @@ initializeWindows = function(){
|
||||
var h = myTable.selectedIds();
|
||||
if(h.length){
|
||||
h.each(function(hash, index){
|
||||
new Request({url: '/command/'+item, method: 'post', data: {hash: hash}}).send();
|
||||
new Request({url: 'command/'+item, method: 'post', data: {hash: hash}}).send();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
addClickEvent(item+'All', function(e){
|
||||
new Event(e).stop();
|
||||
new Request({url: '/command/'+item+'all'}).send();
|
||||
new Request({url: 'command/'+item+'all'}).send();
|
||||
});
|
||||
});
|
||||
|
||||
@ -230,7 +230,7 @@ initializeWindows = function(){
|
||||
setPriorityFN = function(cmd) {
|
||||
var h = myTable.selectedIds();
|
||||
if(h.length) {
|
||||
new Request({url: '/command/'+cmd, method: 'post', data: {hashes: h.join("|")}}).send();
|
||||
new Request({url: 'command/'+cmd, method: 'post', data: {hashes: h.join("|")}}).send();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ MochaUI.extend({
|
||||
// Get global upload limit
|
||||
var maximum = 500;
|
||||
var req = new Request({
|
||||
url: '/command/getGlobalUpLimit',
|
||||
url: 'command/getGlobalUpLimit',
|
||||
method: 'post',
|
||||
data: {},
|
||||
onSuccess: function(data) {
|
||||
@ -64,7 +64,7 @@ MochaUI.extend({
|
||||
}
|
||||
} else {
|
||||
var req = new Request({
|
||||
url: '/command/getTorrentUpLimit',
|
||||
url: 'command/getTorrentUpLimit',
|
||||
method: 'post',
|
||||
data: {hash: hash},
|
||||
onSuccess: function(data) {
|
||||
@ -109,7 +109,7 @@ MochaUI.extend({
|
||||
// Get global upload limit
|
||||
var maximum = 500;
|
||||
var req = new Request({
|
||||
url: '/command/getGlobalDlLimit',
|
||||
url: 'command/getGlobalDlLimit',
|
||||
method: 'post',
|
||||
data: {},
|
||||
onSuccess: function(data) {
|
||||
@ -151,7 +151,7 @@ MochaUI.extend({
|
||||
}
|
||||
} else {
|
||||
var req = new Request({
|
||||
url: '/command/getTorrentDlLimit',
|
||||
url: 'command/getTorrentDlLimit',
|
||||
method: 'post',
|
||||
data: {hash: hash},
|
||||
onSuccess: function(data) {
|
||||
|
Loading…
Reference in New Issue
Block a user