mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 12:34:47 -04:00
Shell packaging now uses passthru.
This commit is contained in:
parent
b3ffd4f621
commit
a87500309a
4 changed files with 90 additions and 41 deletions
|
@ -70,6 +70,25 @@ modulejs.define('ext/download', ['_', '$', 'core/settings', 'core/resource', 'co
|
|||
}
|
||||
},
|
||||
|
||||
onClick = function (event) {
|
||||
|
||||
var exe = settings.execution.toUpperCase();
|
||||
|
||||
if (exe === 'PHP') {
|
||||
|
||||
event.preventDefault();
|
||||
requestArchive(selectedHrefsStr);
|
||||
|
||||
} else if (exe === 'SHELL') {
|
||||
|
||||
var query = '?action=passArchive';
|
||||
query += '&as=' + (settings.packageName || location.getItem().label) + '.' + settings.format;
|
||||
query += '&format=' + settings.format;
|
||||
query += '&hrefs=' + selectedHrefsStr;
|
||||
window.location = query;
|
||||
}
|
||||
},
|
||||
|
||||
init = function () {
|
||||
|
||||
if (!settings.enabled || !server.api) {
|
||||
|
@ -77,11 +96,7 @@ modulejs.define('ext/download', ['_', '$', 'core/settings', 'core/resource', 'co
|
|||
}
|
||||
|
||||
$download = $(downloadBtnTemplate)
|
||||
.find('a').on('click', function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
requestArchive(selectedHrefsStr);
|
||||
}).end()
|
||||
.find('a').on('click', onClick).end()
|
||||
.appendTo('#navbar');
|
||||
$img = $download.find('img');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue