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

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

View File

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

View File

@@ -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() {
@@ -51,4 +51,4 @@
</script>
</body>
</html>
</html>

View File

@@ -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,
},

View File

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

View File

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

View File

@@ -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() {
@@ -51,4 +51,4 @@
</script>
</body>
</html>
</html>