mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-24 05:25:37 +00:00
Add ability to pass urls to the webui download page
This commit is contained in:
parent
a97543d258
commit
b2f454399c
@ -7,7 +7,9 @@
|
|||||||
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="css/Window.css" type="text/css" />
|
<link rel="stylesheet" href="css/Window.css" type="text/css" />
|
||||||
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
|
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
|
||||||
|
<script src="scripts/lib/mootools-1.2-more.js"></script>
|
||||||
<script src="scripts/download.js"></script>
|
<script src="scripts/download.js"></script>
|
||||||
|
<script src="scripts/misc.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@ -71,6 +73,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
|
var encodedUrls = new URI().getData('urls');
|
||||||
|
if (encodedUrls) {
|
||||||
|
var urls = [];
|
||||||
|
encodedUrls.split('|').each(function(url) {
|
||||||
|
urls.push(decodeURIComponent(url));
|
||||||
|
});
|
||||||
|
|
||||||
|
if (urls.length)
|
||||||
|
$('urls').set('value', escapeHtml(urls.join("\n")));
|
||||||
|
}
|
||||||
|
|
||||||
var submitted = false;
|
var submitted = false;
|
||||||
|
|
||||||
$('downloadForm').addEventListener("submit", function() {
|
$('downloadForm').addEventListener("submit", function() {
|
||||||
|
@ -59,12 +59,20 @@ initializeWindows = function() {
|
|||||||
|
|
||||||
addClickEvent('download', function(e) {
|
addClickEvent('download', function(e) {
|
||||||
new Event(e).stop();
|
new Event(e).stop();
|
||||||
|
showDownloadPage();
|
||||||
|
});
|
||||||
|
|
||||||
|
showDownloadPage = function(urls) {
|
||||||
var id = 'downloadPage';
|
var id = 'downloadPage';
|
||||||
|
var contentUrl = 'download.html';
|
||||||
|
if (urls && urls.length)
|
||||||
|
contentUrl += '?urls=' + urls.join("|");
|
||||||
|
|
||||||
new MochaUI.Window({
|
new MochaUI.Window({
|
||||||
id: id,
|
id: id,
|
||||||
title: "QBT_TR(Download from URLs)QBT_TR[CONTEXT=downloadFromURL]",
|
title: "QBT_TR(Download from URLs)QBT_TR[CONTEXT=downloadFromURL]",
|
||||||
loadMethod: 'iframe',
|
loadMethod: 'iframe',
|
||||||
contentURL: 'download.html',
|
contentURL: contentUrl,
|
||||||
addClass: 'windowFrame', // fixes iframe scrolling on iOS Safari
|
addClass: 'windowFrame', // fixes iframe scrolling on iOS Safari
|
||||||
scrollbars: true,
|
scrollbars: true,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
@ -78,7 +86,7 @@ initializeWindows = function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
updateMainData();
|
updateMainData();
|
||||||
});
|
};
|
||||||
|
|
||||||
addClickEvent('preferences', function(e) {
|
addClickEvent('preferences', function(e) {
|
||||||
new Event(e).stop();
|
new Event(e).stop();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user