Web UI: Stop using absolute URLs in ajax requests (closes #1011226)

This commit is contained in:
Christophe Dumez
2012-06-10 20:15:57 +03:00
parent 55a6bc3855
commit 81e4e39878
10 changed files with 24 additions and 24 deletions

View File

@@ -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'));
}

View File

@@ -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();
}
}

View File

@@ -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) {