display alert in link tab

pull/1/head
David Benqué 5 years ago
parent ff67f8381b
commit 3b7732ceb2

@ -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;
}
}

@ -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);

Loading…
Cancel
Save