mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-08-14 01:04:13 +02:00
Fixes some packaging issues.
This commit is contained in:
@@ -63,7 +63,7 @@ modulejs.define('ext/download', ['_', '$', 'core/settings', 'core/resource', 'co
|
|||||||
selectedHrefsStr = _.map(items, function (item) {
|
selectedHrefsStr = _.map(items, function (item) {
|
||||||
|
|
||||||
return item.absHref;
|
return item.absHref;
|
||||||
}).join(':');
|
}).join('|:|');
|
||||||
$download.appendTo('#navbar').show();
|
$download.appendTo('#navbar').show();
|
||||||
} else {
|
} else {
|
||||||
$download.hide();
|
$download.hide();
|
||||||
@@ -82,9 +82,9 @@ modulejs.define('ext/download', ['_', '$', 'core/settings', 'core/resource', 'co
|
|||||||
} else if (exe === 'SHELL') {
|
} else if (exe === 'SHELL') {
|
||||||
|
|
||||||
var query = '?action=passArchive';
|
var query = '?action=passArchive';
|
||||||
query += '&as=' + (settings.packageName || location.getItem().label) + '.' + settings.format;
|
query += '&as=' + encodeURIComponent((settings.packageName || location.getItem().label) + '.' + settings.format);
|
||||||
query += '&format=' + settings.format;
|
query += '&format=' + settings.format;
|
||||||
query += '&hrefs=' + selectedHrefsStr;
|
query += '&hrefs=' + encodeURIComponent(selectedHrefsStr);
|
||||||
window.location = query;
|
window.location = query;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -105,7 +105,7 @@ Options
|
|||||||
*/
|
*/
|
||||||
"download": {
|
"download": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"execution": "php",
|
"execution": "shell",
|
||||||
"format": "tar",
|
"format": "tar",
|
||||||
"packageName": null
|
"packageName": null
|
||||||
},
|
},
|
||||||
|
@@ -109,7 +109,7 @@ class Api {
|
|||||||
normalized_require_once("/server/php/inc/Archive.php");
|
normalized_require_once("/server/php/inc/Archive.php");
|
||||||
$archive = new Archive($this->app);
|
$archive = new Archive($this->app);
|
||||||
|
|
||||||
$hrefs = explode(":", trim($hrefs));
|
$hrefs = explode("|:|", trim($hrefs));
|
||||||
$target = $archive->create($format, $hrefs);
|
$target = $archive->create($format, $hrefs);
|
||||||
|
|
||||||
if (!is_string($target)) {
|
if (!is_string($target)) {
|
||||||
@@ -160,7 +160,7 @@ class Api {
|
|||||||
normalized_require_once("/server/php/inc/Archive.php");
|
normalized_require_once("/server/php/inc/Archive.php");
|
||||||
$archive = new Archive($this->app);
|
$archive = new Archive($this->app);
|
||||||
|
|
||||||
$hrefs = explode(":", trim($hrefs));
|
$hrefs = explode("|:|", trim($hrefs));
|
||||||
|
|
||||||
header("Content-Type: application/octet-stream");
|
header("Content-Type: application/octet-stream");
|
||||||
header("Content-Disposition: attachment; filename=\"$as\"");
|
header("Content-Disposition: attachment; filename=\"$as\"");
|
||||||
@@ -206,7 +206,7 @@ class Api {
|
|||||||
|
|
||||||
list($hrefs) = use_request_params(array("hrefs"));
|
list($hrefs) = use_request_params(array("hrefs"));
|
||||||
|
|
||||||
$hrefs = explode(":", trim($hrefs));
|
$hrefs = explode("|:|", trim($hrefs));
|
||||||
$errors = array();
|
$errors = array();
|
||||||
|
|
||||||
foreach ($hrefs as $href) {
|
foreach ($hrefs as $href) {
|
||||||
|
Reference in New Issue
Block a user