[Pkg-owncloud-commits] [owncloud] 230/394: autofocus to password input after clicking the checkbox; code restructured; debug output added

David Prévot taffit at alioth.debian.org
Fri Nov 8 23:12:12 UTC 2013


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

taffit pushed a commit to annotated tag v4.5.10
in repository owncloud.

commit 73666ae1236f79e62794aff84b79f3e9fe783c4c
Author: Björn Schießle <schiessle at owncloud.com>
Date:   Fri Dec 14 13:13:01 2012 +0100

    autofocus to password input after clicking the checkbox; code restructured; debug output added
---
 core/js/share.js |   22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/core/js/share.js b/core/js/share.js
index 086883f..5242202 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -487,29 +487,23 @@ $(document).ready(function() {
 			var itemType = $('#dropdown').data('item-type');
 			var itemSource = $('#dropdown').data('item-source');
 			OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, '', OC.PERMISSION_READ);
+		} else {
+			$('#linkPassText').focus();
 		}
 	});
 
 	$('#linkPassText').live('focusout keyup', function(event) {
-		if ( event.type == 'focusout' || event.keyCode == 13 ) {
+		if ( $('#linkPassText').val() != '' && (event.type == 'focusout' || event.keyCode == 13) ) {
 			var itemType = $('#dropdown').data('item-type');
 			var itemSource = $('#dropdown').data('item-source');
-			if ( $('#linkPassText').attr('passwordChanged') == 'true' ) {
-				OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, $(this).val(), OC.PERMISSION_READ, function() {
-					$('#linkPassText').val('');
-					$('#linkPassText').attr('placeholder', t('core', 'Password protected'));
-					$('#linkPassText').attr('passwordChanged', 'false');
-				});
-			}
+			OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, $(this).val(), OC.PERMISSION_READ, function() {
+				console.log("password set to: '" + $('#linkPassText').val() +"' by event: " + event.type);
+				$('#linkPassText').val('');
+				$('#linkPassText').attr('placeholder', t('core', 'Password protected'));
+			});
 		}
 	});
 
-	$('#linkPassText').live('focusout keyup', function(event) {
-		if ( event.keyCode != 13 ) {
-			$('#linkPassText').attr('passwordChanged', 'true');	
-		}
-	});
-	
 	$('#expirationCheckbox').live('click', function() {
 		if (this.checked) {
 			OC.Share.showExpirationDate('');

-- 
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