diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-01-24 13:32:31 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-01-24 13:38:39 +0100 |
commit | c6695bbd764be9f43067c09894e36422c2b92b49 (patch) | |
tree | 0d1ad131a1c7f0ff4dd0aa8df09e0f47f4ea93d8 /core | |
parent | 0671c58e361f2ccf2cd23d73a9712c1a31e838ce (diff) | |
download | nextcloud-server-c6695bbd764be9f43067c09894e36422c2b92b49.tar.gz nextcloud-server-c6695bbd764be9f43067c09894e36422c2b92b49.zip |
Fixed download URL in public page
- Refactored download URL building to make it overridable
- Added download URL override in public page
- Added JS unit tests for download URL
- Added OC.redirect() method to facilitate unit testing
Diffstat (limited to 'core')
-rw-r--r-- | core/js/js.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js index 976027dd06b..1c7d89ea055 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -253,6 +253,12 @@ var OC={ return link; }, /** + * Redirect to the target URL, can also be used for downloads. + */ + redirect: function(targetUrl) { + window.location = targetUrl; + }, + /** * get the absolute path to an image file * @param app the app id to which the image belongs * @param file the name of the image file |