Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorBartek Przybylski <bart.p.pl@gmail.com>2012-06-08 22:27:08 +0400
committerBartek Przybylski <bart.p.pl@gmail.com>2012-06-10 15:20:49 +0400
commit31d48d4ba4652dc46f83825f1d9efe8cd408167f (patch)
treebe0f96111c487a3963a9290c45c3424f4abb690c /apps
parentde6b683b501795be1717ecfa57fd683ae8270c4b (diff)
adding missing file
Diffstat (limited to 'apps')
-rw-r--r--apps/gallery/js/pictures.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/apps/gallery/js/pictures.js b/apps/gallery/js/pictures.js
new file mode 100644
index 00000000000..678c9bcbf55
--- /dev/null
+++ b/apps/gallery/js/pictures.js
@@ -0,0 +1,37 @@
+
+function constructSharingPath() {
+ return document.location.protocol + '//' + document.location.host + OC.linkTo('', 'public.php') + '?service=gallery&token=' + Albums.token;
+}
+
+function shareGallery() {
+ var existing_token = '';
+ //if (Albums.token)
+ // existing_token = constructSharingPath();
+ var form_fields = [{text: 'Share', name: 'share', type: 'checkbox', value: false},
+ {text: 'Share recursive', name: 'recursive', type: 'checkbox', value: false},
+ {text: 'Shared gallery address', name: 'address', type: 'text', value: ''}];
+ OC.dialogs.form(form_fields, t('gallery', 'Share gallery'), function(values){
+ var p = '';
+ for (var i in paths) p += paths[i]+'/';
+ if (p == '') p = '/';
+ alert(p);
+ $.getJSON(OC.filePath('gallery', 'ajax', 'galleryOp.php'), {operation: 'share', path: p, share: values[0].value, recursive: values[1].value}, function(r) {
+ if (r.status == 'success') {
+ Albums.shared = r.sharing;
+ if (Albums.shared) {
+ Albums.token = r.token;
+ Albums.recursive = r.recursive;
+ } else {
+ Albums.token = '';
+ Albums.recursive = false;
+ }
+ var actual_addr = '';
+ if (Albums.token)
+ actual_addr = constructSharingPath();
+ $('input[name="address"]').val(actual_addr);
+ } else {
+ OC.dialogs.alert(t('gallery', 'Error: ') + r.cause, t('gallery', 'Internal error'));
+ }
+ });
+ });
+}