Skip to content
Snippets Groups Projects
Commit 1dd79cc8 authored by Björn Schießle's avatar Björn Schießle
Browse files

set password for shared links when the user press enter and when he leaves the password field

parent b0532c63
No related branches found
No related tags found
No related merge requests found
......@@ -520,16 +520,26 @@ $(document).ready(function() {
$('#linkPass').toggle('blind');
});
$('#linkPassText').live('focusout', function(event) {
var itemType = $('#dropdown').data('item-type');
var itemSource = $('#dropdown').data('item-source');
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('placeholder', t('core', 'Password protected'));
$('#linkPassText').live('focusout keyup', function(event) {
if ( 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');
});
}
}
});
$('#linkPassText').live('focusout keyup', function(event) {
if ( event.keyCode != 13 ) {
$('#linkPassText').attr('passwordChanged', 'true');
}
});
$('#expirationCheckbox').live('click', function() {
if (this.checked) {
OC.Share.showExpirationDate('');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment