summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/federatedfilesharing/tests/js/externalSpec.js6
-rw-r--r--apps/files/js/filelist.js2
-rw-r--r--apps/files/tests/js/favoritesfilelistspec.js2
-rw-r--r--apps/files/tests/js/fileactionsSpec.js2
-rw-r--r--apps/files/tests/js/fileactionsmenuSpec.js4
-rw-r--r--apps/files/tests/js/filelistSpec.js60
-rw-r--r--apps/files/tests/js/filesSpec.js6
-rw-r--r--apps/files_external/js/statusmanager.js2
-rw-r--r--apps/files_external/tests/js/mountsfilelistSpec.js4
-rw-r--r--apps/files_external/tests/js/settingsSpec.js2
-rw-r--r--apps/files_sharing/js/public.js2
-rw-r--r--apps/files_sharing/tests/js/publicAppSpec.js12
-rw-r--r--apps/files_sharing/tests/js/sharedfilelistSpec.js20
-rw-r--r--apps/files_trashbin/tests/js/filelistSpec.js16
-rw-r--r--apps/systemtags/js/filesplugin.js4
-rw-r--r--apps/systemtags/js/systemtagsinfoviewtoggleview.js1
16 files changed, 73 insertions, 72 deletions
diff --git a/apps/federatedfilesharing/tests/js/externalSpec.js b/apps/federatedfilesharing/tests/js/externalSpec.js
index 596c0ae60ac..d8c0d36432b 100644
--- a/apps/federatedfilesharing/tests/js/externalSpec.js
+++ b/apps/federatedfilesharing/tests/js/externalSpec.js
@@ -138,7 +138,7 @@ describe('OCA.Sharing external tests', function() {
var req = fakeServer.requests[0];
expect(req.method).toEqual('GET');
- expect(req.url).toEqual(OC.webroot + '/index.php/apps/files_sharing/api/externalShares');
+ expect(req.url).toEqual(OC.getRootPath() + '/index.php/apps/files_sharing/api/externalShares');
req.respond(
200,
@@ -178,7 +178,7 @@ describe('OCA.Sharing external tests', function() {
expect(request.method).toEqual('POST');
expect(query).toEqual({id: '123'});
expect(request.url).toEqual(
- OC.webroot + '/index.php/apps/files_sharing/api/externalShares'
+ OC.getRootPath() + '/index.php/apps/files_sharing/api/externalShares'
);
expect(plugin.filesApp.fileList.reload.notCalled).toEqual(true);
@@ -202,7 +202,7 @@ describe('OCA.Sharing external tests', function() {
var request = fakeServer.requests[1];
expect(request.method).toEqual('DELETE');
expect(request.url).toEqual(
- OC.webroot + '/index.php/apps/files_sharing/api/externalShares/123'
+ OC.getRootPath() + '/index.php/apps/files_sharing/api/externalShares/123'
);
expect(plugin.filesApp.fileList.reload.notCalled).toEqual(true);
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index ab3607e3db9..94052b10b33 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -3432,7 +3432,7 @@
$(document).ready(function() {
// FIXME: unused ?
OCA.Files.FileList.useUndo = (window.onbeforeunload)?true:false;
- $(window).bind('beforeunload', function () {
+ $(window).on('beforeunload', function () {
if (OCA.Files.FileList.lastAction) {
OCA.Files.FileList.lastAction();
}
diff --git a/apps/files/tests/js/favoritesfilelistspec.js b/apps/files/tests/js/favoritesfilelistspec.js
index db890927ed4..d1421c84ee2 100644
--- a/apps/files/tests/js/favoritesfilelistspec.js
+++ b/apps/files/tests/js/favoritesfilelistspec.js
@@ -90,7 +90,7 @@ describe('OCA.Files.FavoritesFileList tests', function() {
expect($tr.attr('data-mime')).toEqual('text/plain');
expect($tr.attr('data-mtime')).toEqual('11111000');
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot +
+ OC.getRootPath() +
'/remote.php/webdav/somedir/test.txt'
);
expect($tr.find('.nametext').text().trim()).toEqual('test.txt');
diff --git a/apps/files/tests/js/fileactionsSpec.js b/apps/files/tests/js/fileactionsSpec.js
index 2dc8bb50920..00d13859b5b 100644
--- a/apps/files/tests/js/fileactionsSpec.js
+++ b/apps/files/tests/js/fileactionsSpec.js
@@ -716,7 +716,7 @@ describe('OCA.Files.FileActions tests', function() {
expect(busyStub.calledWith('testName.txt', true)).toEqual(true);
expect(handleDownloadStub.calledOnce).toEqual(true);
expect(handleDownloadStub.getCall(0).args[0]).toEqual(
- OC.webroot + '/remote.php/webdav/subdir/testName.txt'
+ OC.getRootPath() + '/remote.php/webdav/subdir/testName.txt'
);
busyStub.reset();
handleDownloadStub.yield();
diff --git a/apps/files/tests/js/fileactionsmenuSpec.js b/apps/files/tests/js/fileactionsmenuSpec.js
index c678d166153..f171f2848f8 100644
--- a/apps/files/tests/js/fileactionsmenuSpec.js
+++ b/apps/files/tests/js/fileactionsmenuSpec.js
@@ -281,7 +281,7 @@ describe('OCA.Files.FileActionsMenu tests', function() {
expect(redirectStub.calledOnce).toEqual(true);
expect(redirectStub.getCall(0).args[0]).toContain(
- OC.webroot +
+ OC.getRootPath() +
'/remote.php/webdav/subdir/testName.txt'
);
redirectStub.restore();
@@ -315,7 +315,7 @@ describe('OCA.Files.FileActionsMenu tests', function() {
expect(redirectStub.calledOnce).toEqual(true);
expect(redirectStub.getCall(0).args[0]).toContain(
- OC.webroot + '/remote.php/webdav/anotherpath/there/testName.txt'
+ OC.getRootPath() + '/remote.php/webdav/anotherpath/there/testName.txt'
);
redirectStub.restore();
});
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index 50b336902b9..04102a84754 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -62,8 +62,8 @@ describe('OCA.Files.FileList tests', function() {
filesClient = new OC.Files.Client({
host: 'localhost',
port: 80,
- // FIXME: uncomment after fixing the test OC.webroot
- //root: OC.webroot + '/remote.php/webdav',
+ // FIXME: uncomment after fixing the test OC.getRootPath()
+ //root: OC.getRootPath() + '/remote.php/webdav',
root: '/remote.php/webdav',
useHTTPS: false
});
@@ -232,7 +232,7 @@ describe('OCA.Files.FileList tests', function() {
expect($tr.attr('data-mtime')).toEqual('123456');
expect($tr.attr('data-e2eencrypted')).toEqual('false');
expect($tr.find('a.name').attr('href'))
- .toEqual(OC.webroot + '/remote.php/webdav/subdir/testName.txt');
+ .toEqual(OC.getRootPath() + '/remote.php/webdav/subdir/testName.txt');
expect($tr.find('.nametext').text().trim()).toEqual('testName.txt');
expect($tr.find('.filesize').text()).toEqual('1 KB');
@@ -725,7 +725,7 @@ describe('OCA.Files.FileList tests', function() {
$tr = fileList.findFileEl('Tu_after_three.txt');
expect($tr.find('a.name').attr('href'))
- .toEqual(OC.webroot + '/remote.php/webdav/some/subdir/Tu_after_three.txt');
+ .toEqual(OC.getRootPath() + '/remote.php/webdav/some/subdir/Tu_after_three.txt');
});
it('Triggers "fileActionsReady" event after rename', function() {
var handler = sinon.stub();
@@ -1412,7 +1412,7 @@ describe('OCA.Files.FileList tests', function() {
};
var $tr = fileList.add(fileData);
var $imgDiv = $tr.find('td.filename .thumbnail');
- expect(OC.TestUtil.getImageUrl($imgDiv)).toEqual(OC.webroot + '/core/img/filetypes/file.svg');
+ expect(OC.TestUtil.getImageUrl($imgDiv)).toEqual(OC.getRootPath() + '/core/img/filetypes/file.svg');
// tries to load preview
expect(previewLoadStub.calledOnce).toEqual(true);
});
@@ -1424,7 +1424,7 @@ describe('OCA.Files.FileList tests', function() {
var $tr = fileList.add(fileData);
var $imgDiv = $tr.find('td.filename .thumbnail');
- expect(OC.TestUtil.getImageUrl($imgDiv)).toEqual(OC.webroot + '/core/img/filetypes/folder.svg');
+ expect(OC.TestUtil.getImageUrl($imgDiv)).toEqual(OC.getRootPath() + '/core/img/filetypes/folder.svg');
// no preview since it's a directory
expect(previewLoadStub.notCalled).toEqual(true);
});
@@ -1432,24 +1432,24 @@ describe('OCA.Files.FileList tests', function() {
var fileData = new FileInfo({
type: 'file',
name: 'test file',
- icon: OC.webroot + '/core/img/filetypes/application-pdf.svg',
+ icon: OC.getRootPath() + '/core/img/filetypes/application-pdf.svg',
mimetype: 'application/pdf'
});
var $tr = fileList.add(fileData);
var $imgDiv = $tr.find('td.filename .thumbnail');
- expect(OC.TestUtil.getImageUrl($imgDiv)).toEqual(OC.webroot + '/core/img/filetypes/application-pdf.svg');
+ expect(OC.TestUtil.getImageUrl($imgDiv)).toEqual(OC.getRootPath() + '/core/img/filetypes/application-pdf.svg');
// try loading preview
expect(previewLoadStub.calledOnce).toEqual(true);
});
it('renders provided icon for file when provided', function() {
var fileData = new FileInfo({
name: 'somefile.pdf',
- icon: OC.webroot + '/core/img/filetypes/application-pdf.svg'
+ icon: OC.getRootPath() + '/core/img/filetypes/application-pdf.svg'
});
var $tr = fileList.add(fileData);
var $imgDiv = $tr.find('td.filename .thumbnail');
- expect(OC.TestUtil.getImageUrl($imgDiv)).toEqual(OC.webroot + '/core/img/filetypes/application-pdf.svg');
+ expect(OC.TestUtil.getImageUrl($imgDiv)).toEqual(OC.getRootPath() + '/core/img/filetypes/application-pdf.svg');
// try loading preview
expect(previewLoadStub.calledOnce).toEqual(true);
});
@@ -1457,12 +1457,12 @@ describe('OCA.Files.FileList tests', function() {
var fileData = new FileInfo({
name: 'some folder',
mimetype: 'httpd/unix-directory',
- icon: OC.webroot + '/core/img/filetypes/folder-alt.svg'
+ icon: OC.getRootPath() + '/core/img/filetypes/folder-alt.svg'
});
var $tr = fileList.add(fileData);
var $imgDiv = $tr.find('td.filename .thumbnail');
- expect(OC.TestUtil.getImageUrl($imgDiv)).toEqual(OC.webroot + '/core/img/filetypes/folder-alt.svg');
+ expect(OC.TestUtil.getImageUrl($imgDiv)).toEqual(OC.getRootPath() + '/core/img/filetypes/folder-alt.svg');
// do not load preview for folders
expect(previewLoadStub.notCalled).toEqual(true);
});
@@ -1474,11 +1474,11 @@ describe('OCA.Files.FileList tests', function() {
var $tr = fileList.add(fileData);
var $td = $tr.find('td.filename');
expect(OC.TestUtil.getImageUrl($td.find('.thumbnail')))
- .toEqual(OC.webroot + '/core/img/filetypes/file.svg');
+ .toEqual(OC.getRootPath() + '/core/img/filetypes/file.svg');
expect(previewLoadStub.calledOnce).toEqual(true);
// third argument is callback
- previewLoadStub.getCall(0).args[0].callback(OC.webroot + '/somepath.png');
- expect(OC.TestUtil.getImageUrl($td.find('.thumbnail'))).toEqual(OC.webroot + '/somepath.png');
+ previewLoadStub.getCall(0).args[0].callback(OC.getRootPath() + '/somepath.png');
+ expect(OC.TestUtil.getImageUrl($td.find('.thumbnail'))).toEqual(OC.getRootPath() + '/somepath.png');
});
it('does not render preview for directories', function() {
var fileData = {
@@ -1488,7 +1488,7 @@ describe('OCA.Files.FileList tests', function() {
};
var $tr = fileList.add(fileData);
var $td = $tr.find('td.filename');
- expect(OC.TestUtil.getImageUrl($td.find('.thumbnail'))).toEqual(OC.webroot + '/core/img/filetypes/folder.svg');
+ expect(OC.TestUtil.getImageUrl($td.find('.thumbnail'))).toEqual(OC.getRootPath() + '/core/img/filetypes/folder.svg');
expect(previewLoadStub.notCalled).toEqual(true);
});
it('render encrypted folder icon for encrypted root', function() {
@@ -1500,7 +1500,7 @@ describe('OCA.Files.FileList tests', function() {
};
var $tr = fileList.add(fileData);
var $td = $tr.find('td.filename');
- expect(OC.TestUtil.getImageUrl($td.find('.thumbnail'))).toEqual(OC.webroot + '/core/img/filetypes/folder-encrypted.svg');
+ expect(OC.TestUtil.getImageUrl($td.find('.thumbnail'))).toEqual(OC.getRootPath() + '/core/img/filetypes/folder-encrypted.svg');
expect(previewLoadStub.notCalled).toEqual(true);
});
it('render encrypted folder icon for encrypted subdir', function() {
@@ -1512,10 +1512,10 @@ describe('OCA.Files.FileList tests', function() {
};
var $tr = fileList.add(fileData);
var $td = $tr.find('td.filename');
- expect(OC.TestUtil.getImageUrl($td.find('.thumbnail'))).toEqual(OC.webroot + '/core/img/filetypes/folder-encrypted.svg');
+ expect(OC.TestUtil.getImageUrl($td.find('.thumbnail'))).toEqual(OC.getRootPath() + '/core/img/filetypes/folder-encrypted.svg');
expect(previewLoadStub.notCalled).toEqual(true);
// default icon override
- expect($tr.attr('data-icon')).toEqual(OC.webroot + '/core/img/filetypes/folder-encrypted.svg');
+ expect($tr.attr('data-icon')).toEqual(OC.getRootPath() + '/core/img/filetypes/folder-encrypted.svg');
});
it('render external storage icon for external storage root', function() {
var fileData = {
@@ -1526,7 +1526,7 @@ describe('OCA.Files.FileList tests', function() {
};
var $tr = fileList.add(fileData);
var $td = $tr.find('td.filename');
- expect(OC.TestUtil.getImageUrl($td.find('.thumbnail'))).toEqual(OC.webroot + '/core/img/filetypes/folder-external.svg');
+ expect(OC.TestUtil.getImageUrl($td.find('.thumbnail'))).toEqual(OC.getRootPath() + '/core/img/filetypes/folder-external.svg');
expect(previewLoadStub.notCalled).toEqual(true);
});
it('render external storage icon for external storage subdir', function() {
@@ -1538,10 +1538,10 @@ describe('OCA.Files.FileList tests', function() {
};
var $tr = fileList.add(fileData);
var $td = $tr.find('td.filename');
- expect(OC.TestUtil.getImageUrl($td.find('.thumbnail'))).toEqual(OC.webroot + '/core/img/filetypes/folder-external.svg');
+ expect(OC.TestUtil.getImageUrl($td.find('.thumbnail'))).toEqual(OC.getRootPath() + '/core/img/filetypes/folder-external.svg');
expect(previewLoadStub.notCalled).toEqual(true);
// default icon override
- expect($tr.attr('data-icon')).toEqual(OC.webroot + '/core/img/filetypes/folder-external.svg');
+ expect($tr.attr('data-icon')).toEqual(OC.getRootPath() + '/core/img/filetypes/folder-external.svg');
});
});
@@ -1811,20 +1811,20 @@ describe('OCA.Files.FileList tests', function() {
describe('Download Url', function() {
it('returns correct download URL for single files', function() {
expect(fileList.getDownloadUrl('some file.txt'))
- .toEqual(OC.webroot + '/remote.php/webdav/subdir/some%20file.txt');
+ .toEqual(OC.getRootPath() + '/remote.php/webdav/subdir/some%20file.txt');
expect(fileList.getDownloadUrl('some file.txt', '/anotherpath/abc'))
- .toEqual(OC.webroot + '/remote.php/webdav/anotherpath/abc/some%20file.txt');
+ .toEqual(OC.getRootPath() + '/remote.php/webdav/anotherpath/abc/some%20file.txt');
$('#dir').val('/');
expect(fileList.getDownloadUrl('some file.txt'))
- .toEqual(OC.webroot + '/remote.php/webdav/some%20file.txt');
+ .toEqual(OC.getRootPath() + '/remote.php/webdav/some%20file.txt');
});
it('returns correct download URL for multiple files', function() {
expect(fileList.getDownloadUrl(['a b c.txt', 'd e f.txt']))
- .toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=%5B%22a%20b%20c.txt%22%2C%22d%20e%20f.txt%22%5D');
+ .toEqual(OC.getRootPath() + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=%5B%22a%20b%20c.txt%22%2C%22d%20e%20f.txt%22%5D');
});
it('returns the correct ajax URL', function() {
expect(fileList.getAjaxUrl('test', {a:1, b:'x y'}))
- .toEqual(OC.webroot + '/index.php/apps/files/ajax/test.php?a=1&b=x%20y');
+ .toEqual(OC.getRootPath() + '/index.php/apps/files/ajax/test.php?a=1&b=x%20y');
});
});
describe('File selection', function() {
@@ -2239,7 +2239,7 @@ describe('OCA.Files.FileList tests', function() {
it('Opens download URL when clicking "Download"', function() {
$('.selectedActions .filesSelectMenu .download').click();
expect(redirectStub.calledOnce).toEqual(true);
- expect(redirectStub.getCall(0).args[0]).toContain(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=%5B%22One.txt%22%2C%22Three.pdf%22%2C%22somedir%22%5D');
+ expect(redirectStub.getCall(0).args[0]).toContain(OC.getRootPath() + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=%5B%22One.txt%22%2C%22Three.pdf%22%2C%22somedir%22%5D');
redirectStub.restore();
});
it('Downloads root folder when all selected in root folder', function() {
@@ -2247,13 +2247,13 @@ describe('OCA.Files.FileList tests', function() {
$('.select-all').click();
$('.selectedActions .filesSelectMenu .download').click();
expect(redirectStub.calledOnce).toEqual(true);
- expect(redirectStub.getCall(0).args[0]).toContain(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2F&files=');
+ expect(redirectStub.getCall(0).args[0]).toContain(OC.getRootPath() + '/index.php/apps/files/ajax/download.php?dir=%2F&files=');
});
it('Downloads parent folder when all selected in subfolder', function() {
$('.select-all').click();
$('.selectedActions .filesSelectMenu .download').click();
expect(redirectStub.calledOnce).toEqual(true);
- expect(redirectStub.getCall(0).args[0]).toContain(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2F&files=subdir');
+ expect(redirectStub.getCall(0).args[0]).toContain(OC.getRootPath() + '/index.php/apps/files/ajax/download.php?dir=%2F&files=subdir');
});
afterEach(function() {
diff --git a/apps/files/tests/js/filesSpec.js b/apps/files/tests/js/filesSpec.js
index 5c3f68b2ba4..bd4bae65102 100644
--- a/apps/files/tests/js/filesSpec.js
+++ b/apps/files/tests/js/filesSpec.js
@@ -78,15 +78,15 @@ describe('OCA.Files.Files tests', function() {
describe('getDownloadUrl', function() {
it('returns the ajax download URL when filename and dir specified', function() {
var url = Files.getDownloadUrl('test file.txt', '/subdir');
- expect(url).toEqual(OC.webroot + '/remote.php/webdav/subdir/test%20file.txt');
+ expect(url).toEqual(OC.getRootPath() + '/remote.php/webdav/subdir/test%20file.txt');
});
it('returns the webdav download URL when filename and root dir specified', function() {
var url = Files.getDownloadUrl('test file.txt', '/');
- expect(url).toEqual(OC.webroot + '/remote.php/webdav/test%20file.txt');
+ expect(url).toEqual(OC.getRootPath() + '/remote.php/webdav/test%20file.txt');
});
it('returns the ajax download URL when multiple files specified', function() {
var url = Files.getDownloadUrl(['test file.txt', 'abc.txt'], '/subdir');
- expect(url).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=%5B%22test%20file.txt%22%2C%22abc.txt%22%5D');
+ expect(url).toEqual(OC.getRootPath() + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=%5B%22test%20file.txt%22%2C%22abc.txt%22%5D');
});
});
describe('handleDownload', function() {
diff --git a/apps/files_external/js/statusmanager.js b/apps/files_external/js/statusmanager.js
index 563f8a76493..a65988353af 100644
--- a/apps/files_external/js/statusmanager.js
+++ b/apps/files_external/js/statusmanager.js
@@ -79,7 +79,7 @@ OCA.External.StatusManager = {
} else {
defObj = $.ajax({
type: 'GET',
- url: OC.webroot + '/index.php/apps/files_external/' + ((mountData.type === 'personal') ? 'userstorages' : 'userglobalstorages') + '/' + mountData.id,
+ url: OC.getRootPath() + '/index.php/apps/files_external/' + ((mountData.type === 'personal') ? 'userstorages' : 'userglobalstorages') + '/' + mountData.id,
data: {'testOnly' : false},
success: function (response) {
if (response && response.status === 0) {
diff --git a/apps/files_external/tests/js/mountsfilelistSpec.js b/apps/files_external/tests/js/mountsfilelistSpec.js
index c7ea819d2fe..feea68cf346 100644
--- a/apps/files_external/tests/js/mountsfilelistSpec.js
+++ b/apps/files_external/tests/js/mountsfilelistSpec.js
@@ -123,7 +123,7 @@ describe('OCA.External.FileList tests', function() {
expect($tr.attr('data-size')).not.toBeDefined();
expect($tr.attr('data-permissions')).toEqual('1'); // read only
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot +
+ OC.getRootPath() +
'/index.php/apps/files' +
'?dir=/another%20mount%20points/sftp%20mount'
);
@@ -139,7 +139,7 @@ describe('OCA.External.FileList tests', function() {
expect($tr.attr('data-size')).not.toBeDefined();
expect($tr.attr('data-permissions')).toEqual('9'); // read and delete
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot +
+ OC.getRootPath() +
'/index.php/apps/files' +
'?dir=/mount%20points/smb%20mount'
);
diff --git a/apps/files_external/tests/js/settingsSpec.js b/apps/files_external/tests/js/settingsSpec.js
index 78136fc6bf6..57ad4550993 100644
--- a/apps/files_external/tests/js/settingsSpec.js
+++ b/apps/files_external/tests/js/settingsSpec.js
@@ -215,7 +215,7 @@ describe('OCA.External.Settings tests', function() {
expect(fakeServer.requests.length).toEqual(1);
var request = fakeServer.requests[0];
- expect(request.url).toEqual(OC.webroot + '/index.php/apps/files_external/globalstorages');
+ expect(request.url).toEqual(OC.getRootPath() + '/index.php/apps/files_external/globalstorages');
expect(JSON.parse(request.requestBody)).toEqual({
backend: '\\OC\\TestBackend',
authMechanism: 'mechanism1',
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 3328b1663d1..2b7cea8d0dc 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -343,7 +343,7 @@ OCA.Sharing.PublicApp = {
_legacyCreateFederatedShare: function (remote, token, owner, ownerDisplayName, name, isProtected) {
var self = this;
- var location = window.location.protocol + '//' + window.location.host + OC.webroot;
+ var location = window.location.protocol + '//' + window.location.host + OC.getRootPath();
if(remote.substr(-1) !== '/') {
remote += '/'
diff --git a/apps/files_sharing/tests/js/publicAppSpec.js b/apps/files_sharing/tests/js/publicAppSpec.js
index 8ea339fd9de..dc9000af152 100644
--- a/apps/files_sharing/tests/js/publicAppSpec.js
+++ b/apps/files_sharing/tests/js/publicAppSpec.js
@@ -110,24 +110,24 @@ describe('OCA.Sharing.PublicApp tests', function() {
it('returns correct download URL for single files', function() {
expect(fileList.getDownloadUrl('some file.txt'))
- .toEqual(OC.webroot + '/index.php/s/sh4tok/download?path=%2Fsubdir&files=some%20file.txt');
+ .toEqual(OC.getRootPath() + '/index.php/s/sh4tok/download?path=%2Fsubdir&files=some%20file.txt');
expect(fileList.getDownloadUrl('some file.txt', '/anotherpath/abc'))
- .toEqual(OC.webroot + '/index.php/s/sh4tok/download?path=%2Fanotherpath%2Fabc&files=some%20file.txt');
+ .toEqual(OC.getRootPath() + '/index.php/s/sh4tok/download?path=%2Fanotherpath%2Fabc&files=some%20file.txt');
fileList.changeDirectory('/');
expect(fileList.getDownloadUrl('some file.txt'))
- .toEqual(OC.webroot + '/index.php/s/sh4tok/download?path=%2F&files=some%20file.txt');
+ .toEqual(OC.getRootPath() + '/index.php/s/sh4tok/download?path=%2F&files=some%20file.txt');
});
it('returns correct download URL for multiple files', function() {
expect(fileList.getDownloadUrl(['a b c.txt', 'd e f.txt']))
- .toEqual(OC.webroot + '/index.php/s/sh4tok/download?path=%2Fsubdir&files=%5B%22a%20b%20c.txt%22%2C%22d%20e%20f.txt%22%5D');
+ .toEqual(OC.getRootPath() + '/index.php/s/sh4tok/download?path=%2Fsubdir&files=%5B%22a%20b%20c.txt%22%2C%22d%20e%20f.txt%22%5D');
});
it('returns the correct ajax URL', function() {
expect(fileList.getAjaxUrl('test', {a:1, b:'x y'}))
- .toEqual(OC.webroot + '/index.php/apps/files_sharing/ajax/test.php?a=1&b=x%20y&t=sh4tok');
+ .toEqual(OC.getRootPath() + '/index.php/apps/files_sharing/ajax/test.php?a=1&b=x%20y&t=sh4tok');
});
it('returns correct download URL for downloading everything', function() {
expect(fileList.getDownloadUrl())
- .toEqual(OC.webroot + '/index.php/s/sh4tok/download?path=%2Fsubdir');
+ .toEqual(OC.getRootPath() + '/index.php/s/sh4tok/download?path=%2Fsubdir');
});
});
describe('Upload Url', function() {
diff --git a/apps/files_sharing/tests/js/sharedfilelistSpec.js b/apps/files_sharing/tests/js/sharedfilelistSpec.js
index 0897e9c956d..c9e2bafcc23 100644
--- a/apps/files_sharing/tests/js/sharedfilelistSpec.js
+++ b/apps/files_sharing/tests/js/sharedfilelistSpec.js
@@ -173,7 +173,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).toEqual('true');
expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot +
+ OC.getRootPath() +
'/remote.php/webdav/local%20path/local%20name.txt'
);
expect($tr.find('.nametext').text().trim()).toEqual('local name.txt');
@@ -193,7 +193,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).not.toBeDefined();
expect($tr.attr('data-tags')).toEqual('');
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot +
+ OC.getRootPath() +
'/remote.php/webdav/b.txt'
);
expect($tr.find('.nametext').text().trim()).toEqual('b.txt');
@@ -251,7 +251,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).toEqual('true');
expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot +
+ OC.getRootPath() +
'/index.php/apps/files' +
'?dir=/local%20path/local%20name'
);
@@ -272,7 +272,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).not.toBeDefined();
expect($tr.attr('data-tags')).toEqual('');
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot +
+ OC.getRootPath() +
'/index.php/apps/files' +
'?dir=/b'
);
@@ -352,7 +352,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).toEqual('true');
expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot +
+ OC.getRootPath() +
'/remote.php/webdav/local%20path/local%20name.txt'
);
expect($tr.find('.nametext').text().trim()).toEqual('local name.txt');
@@ -394,7 +394,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).toEqual('true');
expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot +
+ OC.getRootPath() +
'/index.php/apps/files' +
'?dir=/local%20path/local%20name'
);
@@ -448,7 +448,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).toEqual('true');
expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot + '/remote.php/webdav/local%20path/local%20name.txt'
+ OC.getRootPath() + '/remote.php/webdav/local%20path/local%20name.txt'
);
expect($tr.find('.nametext').text().trim()).toEqual('local name.txt');
@@ -519,7 +519,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).toEqual('true');
expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot + '/remote.php/webdav/local%20path/local%20name.txt'
+ OC.getRootPath() + '/remote.php/webdav/local%20path/local%20name.txt'
);
expect($tr.find('.nametext').text().trim()).toEqual('local name.txt');
});
@@ -634,7 +634,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).toEqual('true');
expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot + '/remote.php/webdav/local%20path/local%20name.txt'
+ OC.getRootPath() + '/remote.php/webdav/local%20path/local%20name.txt'
);
expect($tr.attr('data-expiration')).toEqual('0');
expect($tr.find('td:last-child span').text()).toEqual('');
@@ -687,7 +687,7 @@ describe('OCA.Sharing.FileList tests', function() {
expect($tr.attr('data-favorite')).toEqual('true');
expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
- OC.webroot +
+ OC.getRootPath() +
'/remote.php/webdav/local%20path/local%20name.txt');
expect($tr.find('.nametext').text().trim()).toEqual('local name.txt');
diff --git a/apps/files_trashbin/tests/js/filelistSpec.js b/apps/files_trashbin/tests/js/filelistSpec.js
index e9b519ad1fe..e650a2f2d28 100644
--- a/apps/files_trashbin/tests/js/filelistSpec.js
+++ b/apps/files_trashbin/tests/js/filelistSpec.js
@@ -158,10 +158,10 @@ describe('OCA.Trashbin.FileList tests', function () {
expect($crumbs.length).toEqual(3);
expect($crumbs.eq(1).find('a').text()).toEqual('Home');
expect($crumbs.eq(1).find('a').attr('href'))
- .toEqual(OC.webroot + '/index.php/apps/files?view=trashbin&dir=/');
+ .toEqual(OC.getRootPath() + '/index.php/apps/files?view=trashbin&dir=/');
expect($crumbs.eq(2).find('a').text()).toEqual('subdir');
expect($crumbs.eq(2).find('a').attr('href'))
- .toEqual(OC.webroot + '/index.php/apps/files?view=trashbin&dir=/subdir');
+ .toEqual(OC.getRootPath() + '/index.php/apps/files?view=trashbin&dir=/subdir');
});
});
describe('Rendering rows', function () {
@@ -326,7 +326,7 @@ describe('OCA.Trashbin.FileList tests', function () {
expect(fakeServer.requests.length).toEqual(files.length);
for (var i = 0; i < files.length; i++) {
request = fakeServer.requests[i];
- expect(request.url).toEqual(OC.webroot + '/remote.php/dav/trashbin/user/trash/' + files[i]);
+ expect(request.url).toEqual(OC.getRootPath() + '/remote.php/dav/trashbin/user/trash/' + files[i]);
request.respond(200);
}
return promise.then(function () {
@@ -345,7 +345,7 @@ describe('OCA.Trashbin.FileList tests', function () {
});
expect(fakeServer.requests.length).toEqual(1);
request = fakeServer.requests[0];
- expect(request.url).toEqual(OC.webroot + '/remote.php/dav/trashbin/user/trash');
+ expect(request.url).toEqual(OC.getRootPath() + '/remote.php/dav/trashbin/user/trash');
request.respond(200);
return promise.then(function () {
expect(fileList.isEmpty).toEqual(true);
@@ -363,8 +363,8 @@ describe('OCA.Trashbin.FileList tests', function () {
expect(fakeServer.requests.length).toEqual(files.length);
for (var i = 0; i < files.length; i++) {
request = fakeServer.requests[i];
- expect(request.url).toEqual(OC.webroot + '/remote.php/dav/trashbin/user/trash/' + files[i]);
- expect(request.requestHeaders.Destination).toEqual(OC.webroot + '/remote.php/dav/trashbin/user/restore/' + files[i]);
+ expect(request.url).toEqual(OC.getRootPath() + '/remote.php/dav/trashbin/user/trash/' + files[i]);
+ expect(request.requestHeaders.Destination).toEqual(OC.getRootPath() + '/remote.php/dav/trashbin/user/restore/' + files[i]);
request.respond(200);
}
return promise.then(function() {
@@ -385,8 +385,8 @@ describe('OCA.Trashbin.FileList tests', function () {
expect(fakeServer.requests.length).toEqual(files.length);
for (var i = 0; i < files.length; i++) {
request = fakeServer.requests[i];
- expect(request.url).toEqual(OC.webroot + '/remote.php/dav/trashbin/user/trash/' + files[i]);
- expect(request.requestHeaders.Destination).toEqual(OC.webroot + '/remote.php/dav/trashbin/user/restore/' + files[i]);
+ expect(request.url).toEqual(OC.getRootPath() + '/remote.php/dav/trashbin/user/trash/' + files[i]);
+ expect(request.requestHeaders.Destination).toEqual(OC.getRootPath() + '/remote.php/dav/trashbin/user/restore/' + files[i]);
request.respond(200);
}
return promise.then(function() {
diff --git a/apps/systemtags/js/filesplugin.js b/apps/systemtags/js/filesplugin.js
index ca706775121..fc2a227b5be 100644
--- a/apps/systemtags/js/filesplugin.js
+++ b/apps/systemtags/js/filesplugin.js
@@ -49,10 +49,10 @@
systemTagsInfoViewToggleView.$el.detach();
});
systemTagsInfoViewToggleView.listenTo(detailView, 'post-render', function() {
- var clicker = _.bind(systemTagsInfoViewToggleView.click, systemTagsInfoViewToggleView);
- systemTagsInfoViewToggleView.$el.click(clicker);
detailView.$el.find('.file-details').append(systemTagsInfoViewToggleView.$el);
});
+
+ return;
}
});
}
diff --git a/apps/systemtags/js/systemtagsinfoviewtoggleview.js b/apps/systemtags/js/systemtagsinfoviewtoggleview.js
index ec9ac1a216b..a3261e7994d 100644
--- a/apps/systemtags/js/systemtagsinfoviewtoggleview.js
+++ b/apps/systemtags/js/systemtagsinfoviewtoggleview.js
@@ -56,6 +56,7 @@
* references the SystemTagsInfoView to associate to this toggle view.
*/
initialize: function(options) {
+ var self = this;
options = options || {};
this._systemTagsInfoView = options.systemTagsInfoView;