Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 956c84e6 authored by echicken's avatar echicken 🐔

Use require() and 'request'.

parent c10eaeae
<!--Files-->
<?xjs
load(settings.web_lib + 'request.js');
var request = require({}, settings.web_lib + 'request.js', 'request');
load(settings.web_lib + 'files.js');
locale.section = 'page_files';
if (Request.has_param('dir') && file_area.dir[Request.get_param('dir')]) {
if (request.has_param('dir') && file_area.dir[request.get_param('dir')]) {
?>
<ol class="breadcrumb">
<li>
<a href="./?page=<? Request.write_param('page'); ?>">
<a href="./?page=<? request.write_param('page'); ?>">
<? locale.write('title'); ?>
</a>
</li>
<li>
<a href="./?page=<? Request.write_param('page'); ?>&amp;library=<? write(file_area.dir[Request.get_param('dir')].lib_index); ?>">
<? write(file_area.dir[Request.get_param('dir')].lib_name); ?>
<a href="./?page=<? request.write_param('page'); ?>&amp;library=<? write(file_area.dir[request.get_param('dir')].lib_index); ?>">
<? write(file_area.dir[request.get_param('dir')].lib_name); ?>
</a>
</li>
<li>
<a href="./?page=<? Request.write_param('page'); ?>&amp;dir=<? Request.write_param('dir'); ?>">
<? Request.write_param('dir'); ?>
<a href="./?page=<? request.write_param('page'); ?>&amp;dir=<? request.write_param('dir'); ?>">
<? request.write_param('dir'); ?>
</a>
</li>
</ol>
<? function writeFileDetails(file) { ?>
<? const cd = file_area.dir[Request.get_param('dir')].can_download && user.compare_ars(file_area.dir[Request.get_param('dir')].download_ars); ?>
<? const cd = file_area.dir[request.get_param('dir')].can_download && user.compare_ars(file_area.dir[request.get_param('dir')].download_ars); ?>
<? if (cd) { ?>
<a href="./api/files.ssjs?call=download-file&amp;dir=<? Request.write_param('dir'); ?>&amp;file=<? write(file.name); ?>" target="_blank" class="list-group-item striped" data-file-list-element data-size="<? write(file._size); ?>" data-uploaded="<? write(file.uldate); ?>" data-name="<? write(file.name); ?>">
<a href="./api/files.ssjs?call=download-file&amp;dir=<? request.write_param('dir'); ?>&amp;file=<? write(file.name); ?>" target="_blank" class="list-group-item striped" data-file-list-element data-size="<? write(file._size); ?>" data-uploaded="<? write(file.uldate); ?>" data-name="<? write(file.name); ?>">
<? } else { ?>
<li class="list-group-item striped" data-file-list-element data-size="<? write(file._size); ?>" data-uploaded="<? write(file.uldate); ?>" data-name="<? write(file.name); ?>">
<? } ?>
......@@ -63,27 +63,27 @@
</div>
</div>
<div id="file-list-container" class="list-group">
<?xjs listFiles(Request.get_param('dir')).forEach(writeFileDetails); ?>
<?xjs listFiles(request.get_param('dir')).forEach(writeFileDetails); ?>
</div>
<?xjs } else if (Request.has_param('library') && file_area.lib_list[Request.get_param('library')]) { ?>
<?xjs } else if (request.has_param('library') && file_area.lib_list[request.get_param('library')]) { ?>
<ol class="breadcrumb">
<li>
<a href="./?page=<? Request.write_param('page'); ?>">
<a href="./?page=<? request.write_param('page'); ?>">
<? locale.write('title'); ?>
</a>
</li>
<li>
<a href="./?page=<? Request.write_param('page'); ?>&amp;library=<? Request.write_param('library'); ?>">
<? write(file_area.lib_list[Request.get_param('library')].name); ?>
<a href="./?page=<? request.write_param('page'); ?>&amp;library=<? request.write_param('library'); ?>">
<? write(file_area.lib_list[request.get_param('library')].name); ?>
</a>
</li>
</ol>
<?xjs function writeDirectory(dir) { ?>
<a href="./?page=<? Request.write_param('page'); ?>&amp;dir=<? write(dir.dir.code); ?>" class="list-group-item striped">
<a href="./?page=<? request.write_param('page'); ?>&amp;dir=<? write(dir.dir.code); ?>" class="list-group-item striped">
<h4><strong><? write(dir.dir.name); ?></strong></h4>
<p>
<? write(dir.dir.description); ?>:
......@@ -94,19 +94,19 @@
<?xjs } ?>
<div id="file-list-container" class="list-group">
<?xjs listDirectories(Request.get_param('library')).forEach(writeDirectory); ?>
<?xjs listDirectories(request.get_param('library')).forEach(writeDirectory); ?>
</div>
<?xjs } else { ?>
<ol class="breadcrumb">
<li>
<a href="./?page=<? Request.write_param('page'); ?>"><? locale.write('title'); ?></a>
<a href="./?page=<? request.write_param('page'); ?>"><? locale.write('title'); ?></a>
</li>
</ol>
<?xjs function writeLibrary(library) { ?>
<a href="./?page=<? Request.write_param('page'); ?>&amp;library=<? write(library.index); ?>" class="list-group-item striped">
<a href="./?page=<? request.write_param('page'); ?>&amp;library=<? write(library.index); ?>" class="list-group-item striped">
<h3><strong><? write(library.name); ?></strong></h3>
<p>
<? write(library.description); ?>:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment