diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-10-16 11:55:23 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-10-26 17:45:21 +0100 |
commit | 0d98e5e456ed9f5ea05a6e8213b0a71da7b84075 (patch) | |
tree | 8d98ae371b37b2bd0369543363a6a3c6051af916 /core | |
parent | 40ba8d267f57eae983f53dfa4b9195b5f134ff4a (diff) | |
download | nextcloud-server-0d98e5e456ed9f5ea05a6e8213b0a71da7b84075.tar.gz nextcloud-server-0d98e5e456ed9f5ea05a6e8213b0a71da7b84075.zip |
[IE9] Don't send link share password placeholder
When exiting the password field in the share dialog, IE9 would
mistakenly think that the password has changed and would send the
placeholder.
This fix prevents changing the password whenever the placeholder is set
as value.
Diffstat (limited to 'core')
-rw-r--r-- | core/js/sharedialoglinkshareview.js | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js index 74afbc9fe02..29dce21486c 100644 --- a/core/js/sharedialoglinkshareview.js +++ b/core/js/sharedialoglinkshareview.js @@ -13,6 +13,9 @@ OC.Share = {}; } + var PASSWORD_PLACEHOLDER = '**********'; + var PASSWORD_PLACEHOLDER_MESSAGE = t('core', 'Choose a password for the public link'); + var TEMPLATE = '{{#if shareAllowed}}' + '<span class="icon-loading-small hidden"></span>' + @@ -133,11 +136,6 @@ this.model.saveLinkShare(); } else { this.$el.find('.linkPass').slideToggle(OC.menuSpeed); - // TODO drop with IE8 drop - if($('html').hasClass('ie8')) { - this.$el.find('.linkPassText').attr('placeholder', null); - this.$el.find('.linkPassText').val(''); - } this.$el.find('.linkPassText').focus(); } } else { @@ -182,7 +180,8 @@ var $input = this.$el.find('.linkPassText'); $input.removeClass('error'); var password = $input.val(); - if(password === '') { + // in IE9 the password might be the placeholder due to bugs in the placeholders polyfill + if(password === '' || password === PASSWORD_PLACEHOLDER || password === PASSWORD_PLACEHOLDER_MESSAGE) { return; } @@ -276,7 +275,7 @@ urlLabel: t('core', 'Link'), enablePasswordLabel: t('core', 'Password protect'), passwordLabel: t('core', 'Password'), - passwordPlaceholder: isPasswordSet ? '**********' : t('core', 'Choose a password for the public link'), + passwordPlaceholder: isPasswordSet ? PASSWORD_PLACEHOLDER : PASSWORD_PLACEHOLDER_MESSAGE, isPasswordSet: isPasswordSet, showPasswordCheckBox: showPasswordCheckBox, publicUpload: publicUpload && isLinkShare, @@ -314,6 +313,12 @@ }; } + // TODO drop with IE8 drop + if($('html').hasClass('ie8')) { + this.$el.find('#linkPassText').removeAttr('placeholder'); + this.$el.find('#linkPassText').val(''); + } + this.delegateEvents(); return this; |