diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-07-27 10:23:44 +0200 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2022-07-27 10:23:44 +0200 |
commit | 8be9b04981c4f0bdf0a2b8d424f55c797ad90a32 (patch) | |
tree | fb6783d017fc73e0f54435f464eda71ce0ebb169 /apps/files_sharing | |
parent | 97462295587f4016066264edb6eed5d5e17903f3 (diff) | |
download | nextcloud-server-8be9b04981c4f0bdf0a2b8d424f55c797ad90a32.tar.gz nextcloud-server-8be9b04981c4f0bdf0a2b8d424f55c797ad90a32.zip |
Remove legacy #dir element in files list
Removed legacy "#dir" input element in the DOM.
Apps should use OCA.Files.App.currentFileList or
OCA.Sharing.PublicApp.fileList and call getCurrentDirectory() to
retrieve the current directory and changeDirectory() to change it.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/js/public.js | 3 | ||||
-rw-r--r-- | apps/files_sharing/templates/list.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/templates/public.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/tests/js/publicAppSpec.js | 5 |
4 files changed, 6 insertions, 6 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index c08d72d6e05..91883138845 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -45,7 +45,8 @@ OCA.Sharing.PublicApp = { OCA.Files.fileActions = fileActions; this._initialized = true; - this.initialDir = $('#dir').val(); + var urlParams = OC.Util.History.parseUrlQuery(); + this.initialDir = urlParams.path || '/'; var token = $('#sharingToken').val(); var hideDownload = $('#hideDownload').val(); diff --git a/apps/files_sharing/templates/list.php b/apps/files_sharing/templates/list.php index 023726c6833..066736013b9 100644 --- a/apps/files_sharing/templates/list.php +++ b/apps/files_sharing/templates/list.php @@ -2,8 +2,6 @@ <div class="emptyfilelist emptycontent hidden"></div> -<input type="hidden" name="dir" value="" id="dir"> - <div class="nofilterresults emptycontent hidden"> <div class="icon-search"></div> <h2><?php p($l->t('No entries found in this folder')); ?></h2> diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index 0e8f59e9f2a..7e6289784ae 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -10,7 +10,6 @@ <input type="hidden" id="sharingUserId" value="<?php p($_['owner']) ?>"> <input type="hidden" id="filesApp" name="filesApp" value="1"> <input type="hidden" id="isPublic" name="isPublic" value="1"> -<input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir"> <?php if (!$_['hideDownload']): ?> <input type="hidden" name="downloadURL" value="<?php p($_['downloadURL']) ?>" id="downloadURL"> <?php endif; ?> @@ -140,7 +139,6 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size); <?php } ?> <?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] !== true)): ?> - <input type="hidden" name="dir" id="dir" value="" /> <div class="hiddenuploadfield"> <input type="file" id="file_upload_start" class="hiddenuploadfield" name="files[]" data-url="<?php p(\OC::$server->getURLGenerator()->linkTo('files', 'ajax/upload.php')); ?>" /> diff --git a/apps/files_sharing/tests/js/publicAppSpec.js b/apps/files_sharing/tests/js/publicAppSpec.js index e8e5f0a5109..59ac4bd7bbd 100644 --- a/apps/files_sharing/tests/js/publicAppSpec.js +++ b/apps/files_sharing/tests/js/publicAppSpec.js @@ -51,12 +51,12 @@ describe('OCA.Sharing.PublicApp tests', function() { }); describe('File list', function() { + var parseUrlQueryStub // TODO: this should be moved to a separate file once the PublicFileList is extracted from public.js beforeEach(function() { $preview.append( '<div id="app-content-files">' + // init horrible parameters - '<input type="hidden" id="dir" value="/subdir"/>' + '<input type="hidden" id="permissions" value="31"/>' + // dummy controls '<div class="files-controls">' + @@ -88,10 +88,13 @@ describe('OCA.Sharing.PublicApp tests', function() { '</div>' ); + parseUrlQueryStub = sinon.stub(OC.Util.History, 'parseUrlQuery'); + parseUrlQueryStub.returns({path: '/subdir'}); App.initialize($('#preview')); }); afterEach(function() { App._initialized = false; + parseUrlQueryStub.restore(); }); it('Uses public webdav endpoint', function() { |