' +
diff --git a/apps/files/tests/js/fileactionsSpec.js b/apps/files/tests/js/fileactionsSpec.js
index 536688d291dfb..7ec9efc43d02d 100644
--- a/apps/files/tests/js/fileactionsSpec.js
+++ b/apps/files/tests/js/fileactionsSpec.js
@@ -33,7 +33,6 @@ describe('OCA.Files.FileActions tests', function() {
clock = sinon.useFakeTimers();
// init horrible parameters
var $body = $('#testArea');
- $body.append('
');
// dummy files table
@@ -66,13 +65,14 @@ describe('OCA.Files.FileActions tests', function() {
fileList = new OCA.Files.FileList($body, {
fileActions: fileActions
});
+ fileList.changeDirectory('/subdir', false, true);
});
afterEach(function() {
fileActions = null;
fileList.destroy();
fileList = undefined;
clock.restore();
- $('#dir, #permissions, .files-filestable').remove();
+ $('#permissions, .files-filestable').remove();
});
it('calling clear() clears file actions', function() {
fileActions.clear();
diff --git a/apps/files/tests/js/fileactionsmenuSpec.js b/apps/files/tests/js/fileactionsmenuSpec.js
index 4ede99dc333a5..a252e75c5e250 100644
--- a/apps/files/tests/js/fileactionsmenuSpec.js
+++ b/apps/files/tests/js/fileactionsmenuSpec.js
@@ -31,7 +31,6 @@ describe('OCA.Files.FileActionsMenu tests', function() {
beforeEach(function() {
// init horrible parameters
var $body = $('#testArea');
- $body.append('
');
// dummy files table
actionStub = sinon.stub();
@@ -39,6 +38,7 @@ describe('OCA.Files.FileActionsMenu tests', function() {
fileList = new OCA.Files.FileList($body, {
fileActions: fileActions
});
+ fileList.changeDirectory('/subdir', false, true);
fileActions.registerAction({
name: 'Testdropdown',
@@ -100,7 +100,7 @@ describe('OCA.Files.FileActionsMenu tests', function() {
fileList.destroy();
fileList = undefined;
menu.remove();
- $('#dir, #permissions, .files-filestable').remove();
+ $('#permissions, .files-filestable').remove();
});
describe('rendering', function() {
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index 9b7c785ca44cb..e69a62c0c3eba 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -104,7 +104,6 @@ describe('OCA.Files.FileList tests', function() {
$('#testArea').append(
'
' +
// init horrible parameters
- '
' +
'
' +
// dummy controls
'
' +
@@ -186,6 +185,7 @@ describe('OCA.Files.FileList tests', function() {
fileList = new OCA.Files.FileList($('#app-content-files'), {
filesClient: filesClient,
config: filesConfig,
+ dir: '/subdir',
enableUpload: true,
multiSelectMenu: [{
name: 'copyMove',
@@ -218,7 +218,7 @@ describe('OCA.Files.FileList tests', function() {
});
describe('Getters', function() {
it('Returns the current directory', function() {
- $('#dir').val('/one/two/three');
+ fileList.changeDirectory('/one/two/three', false, true);
expect(fileList.getCurrentDirectory()).toEqual('/one/two/three');
});
it('Returns the directory permissions as int', function() {
@@ -553,7 +553,7 @@ describe('OCA.Files.FileList tests', function() {
$summary = $('.files-filestable .summary');
expect($summary.hasClass('hidden')).toEqual(true);
expect($('.files-filestable thead th').hasClass('hidden')).toEqual(true);
- expect($('.emptycontent').hasClass('hidden')).toEqual(false);
+ expect($('.emptyfilelist.emptycontent').hasClass('hidden')).toEqual(false);
expect(fileList.isEmpty).toEqual(true);
});
});
@@ -612,7 +612,7 @@ describe('OCA.Files.FileList tests', function() {
expect($summary.find('.filesize').text()).toEqual('57 KB');
expect(fileList.isEmpty).toEqual(false);
expect($('.files-filestable thead th').hasClass('hidden')).toEqual(false);
- expect($('.emptycontent').hasClass('hidden')).toEqual(true);
+ expect($('.emptyfilelist.emptycontent').hasClass('hidden')).toEqual(true);
expect(notificationStub.notCalled).toEqual(true);
}).then(done, done);
@@ -682,7 +682,7 @@ describe('OCA.Files.FileList tests', function() {
expect(fileList.isEmpty).toEqual(true);
expect(fileList.files.length).toEqual(0);
expect($('.files-filestable thead th').hasClass('hidden')).toEqual(true);
- expect($('.emptycontent').hasClass('hidden')).toEqual(false);
+ expect($('.emptyfilelist.emptycontent').hasClass('hidden')).toEqual(false);
}).then(done, done);
});
it('bring back deleted item when delete call failed', function(done) {
@@ -1143,22 +1143,22 @@ describe('OCA.Files.FileList tests', function() {
it('shows headers, summary and hide empty content message after setting files', function(){
fileList.setFiles(testFiles);
expect($('.files-filestable thead th').hasClass('hidden')).toEqual(false);
- expect($('.emptycontent').hasClass('hidden')).toEqual(true);
+ expect($('.emptyfilelist.emptycontent').hasClass('hidden')).toEqual(true);
expect(fileList.$el.find('.summary').hasClass('hidden')).toEqual(false);
});
it('hides headers, summary and show empty content message after setting empty file list', function(){
fileList.setFiles([]);
expect($('.files-filestable thead th').hasClass('hidden')).toEqual(true);
- expect($('.emptycontent').hasClass('hidden')).toEqual(false);
- expect($('.emptycontent .uploadmessage').hasClass('hidden')).toEqual(false);
+ expect($('.emptyfilelist.emptycontent').hasClass('hidden')).toEqual(false);
+ expect($('.emptyfilelist.emptycontent .uploadmessage').hasClass('hidden')).toEqual(false);
expect(fileList.$el.find('.summary').hasClass('hidden')).toEqual(true);
});
it('hides headers, upload message, and summary when list is empty and user has no creation permission', function(){
$('#permissions').val(0);
fileList.setFiles([]);
expect($('.files-filestable thead th').hasClass('hidden')).toEqual(true);
- expect($('.emptycontent').hasClass('hidden')).toEqual(false);
- expect($('.emptycontent .uploadmessage').hasClass('hidden')).toEqual(true);
+ expect($('.emptyfilelist.emptycontent').hasClass('hidden')).toEqual(false);
+ expect($('.emptyfilelist.emptycontent .uploadmessage').hasClass('hidden')).toEqual(true);
expect(fileList.$el.find('.summary').hasClass('hidden')).toEqual(true);
});
it('calling findFileEl() can find existing file element', function() {
@@ -1170,7 +1170,7 @@ describe('OCA.Files.FileList tests', function() {
expect(fileList.findFileEl('unexist.dat').length).toEqual(0);
});
it('only add file if in same current directory', function() {
- $('#dir').val('/current dir');
+ fileList.changeDirectory('/current dir', false, true);
var fileData = {
type: 'file',
name: 'testFile.txt',
@@ -1313,7 +1313,7 @@ describe('OCA.Files.FileList tests', function() {
expect(fileList.files).toEqual([]);
fileList.setFiles([]);
var $summary = $('.files-filestable .summary');
- var $emptycontent = fileList.$el.find(".emptycontent");
+ var $emptycontent = fileList.$el.find(".emptyfilelist.emptycontent");
var $nofilterresults = fileList.$el.find(".nofilterresults");
expect($emptycontent.length).toEqual(1);
expect($nofilterresults.length).toEqual(1);
@@ -1343,7 +1343,7 @@ describe('OCA.Files.FileList tests', function() {
expect(fileList.files).toEqual([]);
fileList.showMask();
fileList.setFiles(testFiles);
- var $emptycontent = fileList.$el.find(".emptycontent");
+ var $emptycontent = fileList.$el.find(".emptyfilelist.emptycontent");
var $nofilterresults = fileList.$el.find(".nofilterresults");
expect($emptycontent.length).toEqual(1);
expect($nofilterresults.length).toEqual(1);
@@ -1942,7 +1942,7 @@ describe('OCA.Files.FileList tests', function() {
.toEqual(OC.getRootPath() + '/remote.php/webdav/subdir/some%20file.txt');
expect(fileList.getDownloadUrl('some file.txt', '/anotherpath/abc'))
.toEqual(OC.getRootPath() + '/remote.php/webdav/anotherpath/abc/some%20file.txt');
- $('#dir').val('/');
+ fileList.changeDirectory('/', false, true);
expect(fileList.getDownloadUrl('some file.txt'))
.toEqual(OC.getRootPath() + '/remote.php/webdav/some%20file.txt');
});
@@ -2346,7 +2346,7 @@ describe('OCA.Files.FileList tests', function() {
redirectStub.restore();
});
it('Downloads root folder when all selected in root folder', function() {
- $('#dir').val('/');
+ fileList.changeDirectory('/', false, true);
$('.select-all').click();
$('.selectedActions .filesSelectMenu .download').click();
expect(redirectStub.calledOnce).toEqual(true);
diff --git a/apps/files_external/js/statusmanager.js b/apps/files_external/js/statusmanager.js
index 0ffaad9fe40ad..5f94192ea3535 100644
--- a/apps/files_external/js/statusmanager.js
+++ b/apps/files_external/js/statusmanager.js
@@ -584,7 +584,7 @@ OCA.Files_External.StatusManager.Utils = {
isCorrectViewAndRootFolder: function () {
// correct views = files & extstoragemounts
if (OCA.Files.App.getActiveView() === 'files' || OCA.Files.App.getActiveView() === 'extstoragemounts') {
- return OCA.Files.App.getCurrentAppContainer().find('#dir').val() === '/';
+ return OCA.Files.App.currentFileList.getCurrentDirectory() === '/';
}
return false;
},
diff --git a/apps/files_external/templates/list.php b/apps/files_external/templates/list.php
index cccf667f7c32e..8f68157652ba1 100644
--- a/apps/files_external/templates/list.php
+++ b/apps/files_external/templates/list.php
@@ -8,8 +8,6 @@
t('No external storage configured or you don\'t have the permission to configure them')); ?>
-
-
diff --git a/apps/files_external/tests/js/mountsfilelistSpec.js b/apps/files_external/tests/js/mountsfilelistSpec.js
index ec6ebe1bf1145..598eff25d8934 100644
--- a/apps/files_external/tests/js/mountsfilelistSpec.js
+++ b/apps/files_external/tests/js/mountsfilelistSpec.js
@@ -33,7 +33,6 @@ describe('OCA.Files_External.FileList tests', function() {
$('#testArea').append(
'' +
// init horrible parameters
- '
' +
'
' +
// dummy controls
'
' +
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index c08d72d6e0532..918831388457c 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 023726c6833ed..066736013b931 100644
--- a/apps/files_sharing/templates/list.php
+++ b/apps/files_sharing/templates/list.php
@@ -2,8 +2,6 @@
-
-
t('No entries found in this folder')); ?>
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index 0e8f59e9f2a34..7e6289784ae6c 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -10,7 +10,6 @@
-
@@ -140,7 +139,6 @@ class="emptycontent has-note">
-
diff --git a/apps/files_sharing/tests/js/publicAppSpec.js b/apps/files_sharing/tests/js/publicAppSpec.js
index e8e5f0a5109a6..59ac4bd7bbd04 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(
'
' +
// init horrible parameters
- '
' +
'
' +
// dummy controls
'
' +
@@ -88,10 +88,13 @@ describe('OCA.Sharing.PublicApp tests', function() {
'
'
);
+ 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() {
diff --git a/apps/files_trashbin/templates/index.php b/apps/files_trashbin/templates/index.php
index 441768288feee..5fe2fab43332f 100644
--- a/apps/files_trashbin/templates/index.php
+++ b/apps/files_trashbin/templates/index.php
@@ -9,8 +9,6 @@
t('You will be able to recover deleted files from here')); ?>
-
-
t('No entries found in this folder')); ?>
diff --git a/apps/files_trashbin/tests/js/filelistSpec.js b/apps/files_trashbin/tests/js/filelistSpec.js
index 4b75e2a14fd41..90eba960196d2 100644
--- a/apps/files_trashbin/tests/js/filelistSpec.js
+++ b/apps/files_trashbin/tests/js/filelistSpec.js
@@ -43,8 +43,6 @@ describe('OCA.Trashbin.FileList tests', function () {
// init parameters and test table elements
$('#testArea').append(
'
' +
- // init horrible parameters
- ' ' +
// set this but it shouldn't be used (could be the one from the
// files app)
' ' +
@@ -129,7 +127,6 @@ describe('OCA.Trashbin.FileList tests', function () {
fileList.destroy();
fileList = undefined;
- $('#dir').remove();
notificationStub.restore();
alertStub.restore();
});
@@ -174,7 +171,6 @@ describe('OCA.Trashbin.FileList tests', function () {
describe('Rendering rows', function () {
it('renders rows with the correct data when in root', function () {
// dir listing is false when in root
- $('#dir').val('/');
fileList.setFiles(testFiles);
var $rows = fileList.$el.find('tbody tr');
var $tr = $rows.eq(0);
@@ -195,7 +191,6 @@ describe('OCA.Trashbin.FileList tests', function () {
});
it('renders rows with the correct data when in root after calling setFiles with the same data set', function () {
// dir listing is false when in root
- $('#dir').val('/');
fileList.setFiles(testFiles);
fileList.setFiles(fileList.files);
var $rows = fileList.$el.find('tbody tr');
@@ -216,9 +211,6 @@ describe('OCA.Trashbin.FileList tests', function () {
expect(fileList.findFileEl('One.txt.d11111')[0]).toEqual($tr[0]);
});
it('renders rows with the correct data when in subdirectory', function () {
- // dir listing is true when in a subdir
- $('#dir').val('/subdir');
-
fileList.setFiles(testFiles.map(function (file) {
file.name = file.displayName;
return file;
diff --git a/apps/systemtags/templates/list.php b/apps/systemtags/templates/list.php
index b6298ef2d2388..6e4ef04ee8b75 100644
--- a/apps/systemtags/templates/list.php
+++ b/apps/systemtags/templates/list.php
@@ -34,5 +34,4 @@
-
diff --git a/apps/systemtags/tests/js/systemtagsfilelistSpec.js b/apps/systemtags/tests/js/systemtagsfilelistSpec.js
index 66272320e1d66..ab831e7f849e1 100644
--- a/apps/systemtags/tests/js/systemtagsfilelistSpec.js
+++ b/apps/systemtags/tests/js/systemtagsfilelistSpec.js
@@ -30,7 +30,6 @@ describe('OCA.SystemTags.FileList tests', function() {
$('#testArea').append(
'
' +
// init horrible parameters
- '
' +
'
' +
'
' +
// dummy table