From bb2557c38974bea38dcc48185723b33781412cbd Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 22 Jul 2022 16:11:01 +0200 Subject: Replace files app ids to classes Replaced ids to classes for the following: - #filestable -> .files-filestable - #fileList -> .files-fileList - #controls -> .files-controls - #emptycontent -> .emptyfilelist.emptycontent Signed-off-by: Vincent Petry --- apps/files_external/css/external.css | 2 +- apps/files_external/js/mountsfilelist.js | 6 +++--- apps/files_external/js/settings.js | 2 +- apps/files_external/js/statusmanager.js | 12 ++++++------ apps/files_external/templates/list.php | 14 +++++++------- apps/files_external/templates/settings.php | 2 +- apps/files_external/tests/appSpec.js | 2 +- apps/files_external/tests/js/mountsfilelistSpec.js | 12 ++++++------ 8 files changed, 26 insertions(+), 26 deletions(-) (limited to 'apps/files_external') diff --git a/apps/files_external/css/external.css b/apps/files_external/css/external.css index 122459c9624..489cd630fb9 100644 --- a/apps/files_external/css/external.css +++ b/apps/files_external/css/external.css @@ -1,3 +1,3 @@ -#filestable tbody tr.externalErroredRow { +.files-filestable tbody tr.externalErroredRow { background-color: #F2DEDE; } diff --git a/apps/files_external/js/mountsfilelist.js b/apps/files_external/js/mountsfilelist.js index c5817a916f6..58cd356ccff 100644 --- a/apps/files_external/js/mountsfilelist.js +++ b/apps/files_external/js/mountsfilelist.js @@ -18,7 +18,7 @@ * Displays a list of mount points visible * for the current user. * - * @param $el container element with existing markup for the #controls + * @param $el container element with existing markup for the .files-controls * and a table * @param [options] map of options, see other parameters **/ @@ -65,8 +65,8 @@ var dir = this.getCurrentDirectory(); if (dir === '/') { // root has special permissions - this.$el.find('#emptycontent').toggleClass('hidden', !this.isEmpty); - this.$el.find('#filestable thead th').toggleClass('hidden', this.isEmpty); + this.$el.find('.emptyfilelist.emptycontent').toggleClass('hidden', !this.isEmpty); + this.$el.find('.files-filestable thead th').toggleClass('hidden', this.isEmpty); } else { OCA.Files.FileList.prototype.updateEmptyContent.apply(this, arguments); diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js index 9bf7339a3bb..0a791001f63 100644 --- a/apps/files_external/js/settings.js +++ b/apps/files_external/js/settings.js @@ -972,7 +972,7 @@ MountConfigListView.prototype = _.extend({ if (result.length === 0 && mainForm.attr('data-can-create') === 'false') { mainForm.hide(); $('a[href="#external-storage"]').parent().hide(); - $('#emptycontent').show(); + $('.emptycontent').show(); } onCompletion.resolve(); onLoaded1.resolve(); diff --git a/apps/files_external/js/statusmanager.js b/apps/files_external/js/statusmanager.js index e80d764baa7..0ffaad9fe40 100644 --- a/apps/files_external/js/statusmanager.js +++ b/apps/files_external/js/statusmanager.js @@ -239,7 +239,7 @@ OCA.Files_External.StatusManager = { processMountList: function (mountList) { var elementList = null; $.each(mountList, function (name, value) { - var trElement = $('#fileList tr[data-file=\"' + OCA.Files_External.StatusManager.Utils.jqSelEscape(value.mount_point) + '\"]'); //FileList.findFileEl(OCA.Files_External.StatusManager.Utils.jqSelEscape(value.mount_point)); + var trElement = $('.files-fileList tr[data-file=\"' + OCA.Files_External.StatusManager.Utils.jqSelEscape(value.mount_point) + '\"]'); //FileList.findFileEl(OCA.Files_External.StatusManager.Utils.jqSelEscape(value.mount_point)); trElement.attr('data-external-backend', value.backend); if (elementList) { elementList = elementList.add(trElement); @@ -460,7 +460,7 @@ OCA.Files_External.StatusManager.Utils = { showIconError: function (folder, clickAction, errorImageUrl) { var imageUrl = "url(" + errorImageUrl + ")"; - var trFolder = $('#fileList tr[data-file=\"' + OCA.Files_External.StatusManager.Utils.jqSelEscape(folder) + '\"]'); //FileList.findFileEl(OCA.Files_External.StatusManager.Utils.jqSelEscape(folder)); + var trFolder = $('.files-fileList tr[data-file=\"' + OCA.Files_External.StatusManager.Utils.jqSelEscape(folder) + '\"]'); //FileList.findFileEl(OCA.Files_External.StatusManager.Utils.jqSelEscape(folder)); this.changeFolderIcon(folder, imageUrl); this.toggleLink(folder, false, clickAction); trFolder.addClass('externalErroredRow'); @@ -474,7 +474,7 @@ OCA.Files_External.StatusManager.Utils = { if (folder instanceof $) { trFolder = folder; } else { - trFolder = $('#fileList tr[data-file=\"' + OCA.Files_External.StatusManager.Utils.jqSelEscape(folder) + '\"]'); //FileList.findFileEl(OCA.Files_External.StatusManager.Utils.jqSelEscape(folder)); //$('#fileList tr[data-file=\"' + OCA.Files_External.StatusManager.Utils.jqSelEscape(folder) + '\"]'); + trFolder = $('.files-fileList tr[data-file=\"' + OCA.Files_External.StatusManager.Utils.jqSelEscape(folder) + '\"]'); //FileList.findFileEl(OCA.Files_External.StatusManager.Utils.jqSelEscape(folder)); //$('.files-fileList tr[data-file=\"' + OCA.Files_External.StatusManager.Utils.jqSelEscape(folder) + '\"]'); } trFolder.each(function () { var thisElement = $(this); @@ -501,7 +501,7 @@ OCA.Files_External.StatusManager.Utils = { trFolder = folder; } else { // can't use here FileList.findFileEl(OCA.Files_External.StatusManager.Utils.jqSelEscape(folder)); return incorrect instance of filelist - trFolder = $('#fileList tr[data-file=\"' + OCA.Files_External.StatusManager.Utils.jqSelEscape(folder) + '\"]'); + trFolder = $('.files-fileList tr[data-file=\"' + OCA.Files_External.StatusManager.Utils.jqSelEscape(folder) + '\"]'); } var tdChilds = trFolder.find("td.filename div.thumbnail"); tdChilds.each(function () { @@ -525,7 +525,7 @@ OCA.Files_External.StatusManager.Utils = { $(this).find('td.filename div.thumbnail').css('background-image', "url(" + route + ")").css('display', 'none').css('display', 'inline'); }); } else { - file = $("#fileList tr[data-file=\"" + this.jqSelEscape(filename) + "\"] > td.filename div.thumbnail"); + file = $(".files-fileList tr[data-file=\"" + this.jqSelEscape(filename) + "\"] > td.filename div.thumbnail"); var parentTr = file.parents('tr:first'); route = OCA.Files_External.StatusManager.Utils.getIconRoute(parentTr); parentTr.attr("data-icon", route); @@ -563,7 +563,7 @@ OCA.Files_External.StatusManager.Utils = { if (filename instanceof $) { link = filename; } else { - link = $("#fileList tr[data-file=\"" + this.jqSelEscape(filename) + "\"] > td.filename a.name"); + link = $(".files-fileList tr[data-file=\"" + this.jqSelEscape(filename) + "\"] > td.filename a.name"); } if (active) { link.off('click.connectivity'); diff --git a/apps/files_external/templates/list.php b/apps/files_external/templates/list.php index 1d4f6993168..576dbdcf3f5 100644 --- a/apps/files_external/templates/list.php +++ b/apps/files_external/templates/list.php @@ -1,21 +1,21 @@ -
-
+
+
-