mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-10 17:35:00 -06:00
* Add option to set torrent location from webui context menu (addresses #6815) * Update debug messages * Use logger * Remove redundant curly braces * Remove message * Use log message from transferlistwidget * Use QDir * Remove unused import * Check if newLocation is an empty string
This commit is contained in:
committed by
Mike Tzou
parent
145641ac41
commit
07a85a1018
55
src/webui/www/public/setlocation.html
Normal file
55
src/webui/www/public/setlocation.html
Normal file
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>QBT_TR(Set location)QBT_TR[CONTEXT=TransferListWidget]</title>
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
||||
<script type="text/javascript" src="scripts/mootools-1.2-core-yc.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="scripts/mootools-1.2-more.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var setLocationKeyboardEvents = new Keyboard({
|
||||
defaultEventType: 'keydown',
|
||||
events: {
|
||||
'enter': function (event) {
|
||||
$('setLocationButton').click();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
setLocationKeyboardEvents.activate();
|
||||
|
||||
window.addEvent('domready', function() {
|
||||
$('setLocation').focus();
|
||||
$('setLocationButton').addEvent('click', function(e) {
|
||||
new Event(e).stop();
|
||||
// check field
|
||||
var location = $('setLocation').value.trim();
|
||||
if (location === null || location === "")
|
||||
return false;
|
||||
|
||||
var hashesList = new URI().getData('hashes');
|
||||
new Request({
|
||||
url: 'command/setLocation',
|
||||
method: 'post',
|
||||
data: {
|
||||
hashes: hashesList,
|
||||
location: location
|
||||
},
|
||||
onComplete: function () {
|
||||
window.parent.closeWindows();
|
||||
}
|
||||
}).send();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="padding: 10px 10px 0px 10px;">
|
||||
<p style="font-weight: bold;">QBT_TR(Location)QBT_TR[CONTEXT=TransferListWidget]:</p>
|
||||
<input type="text" id="setLocation" value="" maxlength="100" style="width: 220px;"/>
|
||||
<div style="text-align: center; padding-top: 10px;">
|
||||
<input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" id="setLocationButton"/>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user