[Pkg-owncloud-commits] [owncloud] 80/153: Add generic 'share by link' URL generator in share.js

David Prévot taffit at moszumanska.debian.org
Tue May 27 03:05:39 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 9e1d47bd908d589c3dcf5e7d8233ca5cb73f4ebd
Author: libasys <sebastian.doell at libasys.de>
Date:   Fri Mar 14 12:10:05 2014 +0100

    Add generic 'share by link' URL generator in share.js
    
    Some more global definition to autogenerate a "Shared by Link" with token! Why we not add these lines for more global use of the public service feature? At the moment there is a pr for sharing a calendar by Link. With this little mod the calendar can work with the core share api and needs no own js share definition!
---
 core/js/share.js | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/core/js/share.js b/core/js/share.js
index 92db671..583f92d 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -495,6 +495,10 @@ OC.Share={
 	showLink:function(token, password, itemSource) {
 		OC.Share.itemShares[OC.Share.SHARE_TYPE_LINK] = true;
 		$('#linkCheckbox').attr('checked', true);
+		
+		//check itemType
+		var linkSharetype=$('#dropdown').data('item-type');
+		
 		if (! token) {
 			//fallback to pre token link
 			var filename = $('tr').filterAttr('data-id', String(itemSource)).data('file');
@@ -508,7 +512,15 @@ OC.Share={
 			var link = parent.location.protocol+'//'+location.host+OC.linkTo('', 'public.php')+'?service=files&'+type+'='+encodeURIComponent(file);
 		} else {
 			//TODO add path param when showing a link to file in a subfolder of a public link share
-			var link = parent.location.protocol+'//'+location.host+OC.linkTo('', 'public.php')+'?service=files&t='+token;
+			var service='';
+			if(linkSharetype === 'folder' || linkSharetype === 'file'){
+				service='files';
+			}else{
+				service=linkSharetype;
+			}
+			
+			var link = parent.location.protocol+'//'+location.host+OC.linkTo('', 'public.php')+'?service='+service+'&t='+token;
+
 		}
 		$('#linkText').val(link);
 		$('#linkText').show('blind');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list