diff --git a/customize.dist/src/less2/include/alertify.less b/customize.dist/src/less2/include/alertify.less index 9cd904c45..26cffc827 100644 --- a/customize.dist/src/less2/include/alertify.less +++ b/customize.dist/src/less2/include/alertify.less @@ -229,7 +229,7 @@ &[readonly] { background-color: @alertify-light-bg; color: @cryptpad_text_col; - border-color: @alertify-input-fg; + border-color: @alertify-light-bg; } } @@ -509,5 +509,11 @@ overflow-x: auto; } } + .alert { + margin:5px 0px; + font-size:12px; + padding:5px; + border-radius:0px; + } } diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index b8ae705a2..e448688f5 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1068,6 +1068,16 @@ define([ UI.createCheckbox('cp-share-embed', Messages.share_linkEmbed, false, { mark: {tabindex:1} }), h('br'), ]; + // check if the pad is password protection + var hash = hashes.editHash || hashes.viewHash; + var href = origin + pathname + '#' + hash; + var parsedHref = Hash.parsePadUrl(href); + var hasPassword = parsedHref.hashData.password; + if (hasPassword) { + linkContent.push(h('div.alert.alert-danger', [h('i.fa.fa-lock'), + ' ', 'has password'])) + }; + linkContent.push(UI.dialog.selectable('', { id: 'cp-share-link-preview', tabindex: 1 })); var link = h('div.cp-share-modal', linkContent);