aboutsummaryrefslogtreecommitdiffstats
path: root/apps/gallery
diff options
context:
space:
mode:
authorBartek Przybylski <bart.p.pl@gmail.com>2012-03-24 19:26:53 +0100
committerBartek Przybylski <bart.p.pl@gmail.com>2012-03-24 19:26:53 +0100
commit826cb2c650d9a9c1b8d826cba6863dbfacc8b8f4 (patch)
tree5cfade98384bdbac4ed50aa21cb1ae4bd42b15e8 /apps/gallery
parentbe60b451eb7a152f19e31eeaf1b2f009eadb1a6b (diff)
downloadnextcloud-server-826cb2c650d9a9c1b8d826cba6863dbfacc8b8f4.tar.gz
nextcloud-server-826cb2c650d9a9c1b8d826cba6863dbfacc8b8f4.zip
fix sharing address construction in opera and firefox
Diffstat (limited to 'apps/gallery')
-rw-r--r--apps/gallery/js/album_cover.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/gallery/js/album_cover.js b/apps/gallery/js/album_cover.js
index 41a648bec57..061bbcd0b47 100644
--- a/apps/gallery/js/album_cover.js
+++ b/apps/gallery/js/album_cover.js
@@ -30,10 +30,14 @@ function albumClick(title) {
});
}
+function constructSharingPath() {
+ return document.location.protocol + '//' + document.location.host + OC.linkTo('gallery', 'sharing.php') + '?token=' + Albums.token;
+}
+
function shareGallery() {
var existing_token = '';
if (Albums.token)
- existing_token = document.location.origin + OC.linkTo('gallery', 'sharing.php') + '?token=' + Albums.token;
+ existing_token = constructSharingPath();
var form_fields = [{text: 'Share', name: 'share', type: 'checkbox', value: Albums.shared},
{text: 'Share recursive', name: 'recursive', type: 'checkbox', value: Albums.recursive},
{text: 'Shared gallery address', name: 'address', type: 'text', value: existing_token}];
@@ -53,7 +57,7 @@ function shareGallery() {
}
var actual_addr = '';
if (Albums.token)
- actual_addr = document.location.origin + OC.linkTo('gallery', 'sharing.php') + '?token=' + Albums.token;
+ actual_addr = constructSharingPath();
$('input[name="address"]').val(actual_addr);
} else {
OC.dialogs.alert(t('gallery', 'Error: ') + r.cause, t('gallery', 'Internal error'));