2018-10-22 02:42:56 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="${LANG}">
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8" />
|
|
|
|
<title>QBT_TR(Tracker editing)QBT_TR[CONTEXT=TrackerListWidget]</title>
|
2019-04-17 15:09:03 +03:00
|
|
|
<link rel="stylesheet" href="css/style.css?v=${CACHEID}" type="text/css" />
|
2018-10-22 02:42:56 +03:00
|
|
|
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
|
|
|
|
<script src="scripts/lib/mootools-1.2-more.js"></script>
|
|
|
|
<script>
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
window.addEvent('domready', function() {
|
2019-01-11 02:49:35 +03:00
|
|
|
new Keyboard({
|
2018-10-22 02:42:56 +03:00
|
|
|
defaultEventType: 'keydown',
|
|
|
|
events: {
|
2019-01-14 09:02:07 +03:00
|
|
|
'Enter': function(event) {
|
2018-10-22 02:42:56 +03:00
|
|
|
$('editTrackerButton').click();
|
|
|
|
event.preventDefault();
|
2019-01-11 02:49:35 +03:00
|
|
|
},
|
|
|
|
'Escape': function(event) {
|
|
|
|
window.parent.closeWindows();
|
|
|
|
event.preventDefault();
|
|
|
|
},
|
|
|
|
'Esc': function(event) {
|
|
|
|
window.parent.closeWindows();
|
|
|
|
event.preventDefault();
|
2018-10-22 02:42:56 +03:00
|
|
|
}
|
|
|
|
}
|
2019-01-11 02:49:35 +03:00
|
|
|
}).activate();
|
2018-10-22 02:42:56 +03:00
|
|
|
|
2019-05-30 09:05:16 +03:00
|
|
|
const currentUrl = new URI().getData('url');
|
2018-10-22 02:42:56 +03:00
|
|
|
if (!currentUrl)
|
|
|
|
return false;
|
|
|
|
|
2019-05-30 09:05:16 +03:00
|
|
|
const decodedUrl = decodeURIComponent(currentUrl);
|
2018-10-22 02:42:56 +03:00
|
|
|
$('trackerUrl').value = decodedUrl;
|
|
|
|
$('trackerUrl').focus();
|
|
|
|
|
|
|
|
$('editTrackerButton').addEvent('click', function(e) {
|
|
|
|
new Event(e).stop();
|
2019-05-30 09:05:16 +03:00
|
|
|
const hash = new URI().getData('hash');
|
2018-10-22 02:42:56 +03:00
|
|
|
new Request({
|
|
|
|
url: 'api/v2/torrents/editTracker',
|
|
|
|
method: 'post',
|
|
|
|
data: {
|
|
|
|
hash: hash,
|
|
|
|
origUrl: decodedUrl,
|
|
|
|
newUrl: $('trackerUrl').value
|
|
|
|
},
|
|
|
|
onComplete: function() {
|
|
|
|
window.parent.closeWindows();
|
|
|
|
}
|
|
|
|
}).send();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
<div style="text-align: center;">
|
|
|
|
<br/>
|
|
|
|
<h2 class="vcenter">QBT_TR(Tracker URL:)QBT_TR[CONTEXT=TrackerListWidget]</h2>
|
|
|
|
<div style="text-align: center; padding-top: 10px;">
|
|
|
|
<input id="trackerUrl" style="width: 90%;" />
|
|
|
|
</div>
|
|
|
|
<br/>
|
|
|
|
<input type="button" value="QBT_TR(Edit)QBT_TR[CONTEXT=HttpServer]" id="editTrackerButton" />
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|