mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-04 14:42:29 -06:00
Add WebUI Trackers context menu
This commit is contained in:
committed by
sledgehammer999
parent
e273c777c7
commit
86bde47a06
65
src/webui/www/private/edittracker.html
Normal file
65
src/webui/www/private/edittracker.html
Normal file
@@ -0,0 +1,65 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="${LANG}">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>QBT_TR(Tracker editing)QBT_TR[CONTEXT=TrackerListWidget]</title>
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
||||
<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() {
|
||||
var setLocationKeyboardEvents = new Keyboard({
|
||||
defaultEventType: 'keydown',
|
||||
events: {
|
||||
'enter': function(event) {
|
||||
$('editTrackerButton').click();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
setLocationKeyboardEvents.activate();
|
||||
|
||||
var currentUrl = new URI().getData('url');
|
||||
if (!currentUrl)
|
||||
return false;
|
||||
|
||||
var decodedUrl = decodeURIComponent(currentUrl);
|
||||
$('trackerUrl').value = decodedUrl;
|
||||
$('trackerUrl').focus();
|
||||
|
||||
$('editTrackerButton').addEvent('click', function(e) {
|
||||
new Event(e).stop();
|
||||
var hash = new URI().getData('hash');
|
||||
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>
|
||||
Reference in New Issue
Block a user