|
|
@ -31,16 +31,17 @@ |
|
|
|
|
|
|
|
|
|
|
|
window.addEvent('domready', function() { |
|
|
|
window.addEvent('domready', function() { |
|
|
|
const path = new URI().getData('path'); |
|
|
|
const path = new URI().getData('path'); |
|
|
|
|
|
|
|
|
|
|
|
// set text field to current value |
|
|
|
// set text field to current value |
|
|
|
if (path) |
|
|
|
if (path) |
|
|
|
$('setLocation').value = window.qBittorrent.Misc.escapeHtml(path); |
|
|
|
$('setLocation').value = decodeURIComponent(path); |
|
|
|
|
|
|
|
|
|
|
|
$('setLocation').focus(); |
|
|
|
$('setLocation').focus(); |
|
|
|
$('setLocationButton').addEvent('click', function(e) { |
|
|
|
$('setLocationButton').addEvent('click', function(e) { |
|
|
|
new Event(e).stop(); |
|
|
|
new Event(e).stop(); |
|
|
|
// check field |
|
|
|
// check field |
|
|
|
const location = $('setLocation').value.trim(); |
|
|
|
const location = $('setLocation').value.trim(); |
|
|
|
if (location === null || location === "") { |
|
|
|
if ((location === null) || (location === "")) { |
|
|
|
$('error_div').set('text', 'QBT_TR(Save path is empty)QBT_TR[CONTEXT=TorrentsController]'); |
|
|
|
$('error_div').set('text', 'QBT_TR(Save path is empty)QBT_TR[CONTEXT=TorrentsController]'); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|