summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-09-09 13:59:19 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-09-09 13:59:19 +0200
commitfd92fc7c472dfcd787dd02c2a537e86bacd1afc4 (patch)
tree77a048577fe5b109e5ffb6f634af712662245a95 /core/js
parent3d4f77c8f1f34351a8484e294b17eae4aee60a78 (diff)
parente3c99a8505da671f7721d5058ecc6ca296e87003 (diff)
downloadnextcloud-server-fd92fc7c472dfcd787dd02c2a537e86bacd1afc4.tar.gz
nextcloud-server-fd92fc7c472dfcd787dd02c2a537e86bacd1afc4.zip
Merge pull request #9753 from owncloud/filepath-css
Remove special case for css in OC.filePath
Diffstat (limited to 'core/js')
-rw-r--r--core/js/js.js2
-rw-r--r--core/js/tests/specs/coreSpec.js20
2 files changed, 21 insertions, 1 deletions
diff --git a/core/js/js.js b/core/js/js.js
index bf33e3f2e48..89682e3013f 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -260,7 +260,7 @@ var OC={
filePath:function(app,type,file){
var isCore=OC.coreApps.indexOf(app)!==-1,
link=OC.webroot;
- if((file.substring(file.length-3) === 'php' || file.substring(file.length-3) === 'css') && !isCore){
+ if(file.substring(file.length-3) === 'php' && !isCore){
link+='/index.php/apps/' + app;
if (file != 'index.php') {
link+='/';
diff --git a/core/js/tests/specs/coreSpec.js b/core/js/tests/specs/coreSpec.js
index 3af56c490e6..c61528f6686 100644
--- a/core/js/tests/specs/coreSpec.js
+++ b/core/js/tests/specs/coreSpec.js
@@ -134,6 +134,26 @@ describe('Core base tests', function() {
expect(escapeHTML('This is a good string without HTML.')).toEqual('This is a good string without HTML.');
});
});
+ describe('filePath', function() {
+ beforeEach(function() {
+ OC.webroot = 'http://localhost';
+ OC.appswebroots['files'] = OC.webroot + '/apps3/files';
+ });
+ afterEach(function() {
+ delete OC.appswebroots['files'];
+ });
+
+ it('Uses a direct link for css and images,' , function() {
+ expect(OC.filePath('core', 'css', 'style.css')).toEqual('http://localhost/core/css/style.css');
+ expect(OC.filePath('files', 'css', 'style.css')).toEqual('http://localhost/apps3/files/css/style.css');
+ expect(OC.filePath('core', 'img', 'image.png')).toEqual('http://localhost/core/img/image.png');
+ expect(OC.filePath('files', 'img', 'image.png')).toEqual('http://localhost/apps3/files/img/image.png');
+ });
+ it('Routes PHP files via index.php,' , function() {
+ expect(OC.filePath('core', 'ajax', 'test.php')).toEqual('http://localhost/index.php/core/ajax/test.php');
+ expect(OC.filePath('files', 'ajax', 'test.php')).toEqual('http://localhost/index.php/apps/files/ajax/test.php');
+ });
+ });
describe('Link functions', function() {
var TESTAPP = 'testapp';
var TESTAPP_ROOT = OC.webroot + '/appsx/testapp';