commento.js: default to anonymous if only option
Closes https://gitlab.com/commento/commento/-/issues/285
This commit is contained in:
parent
d077241f09
commit
7f64614f60
@ -86,6 +86,7 @@
|
||||
var shownReply = {};
|
||||
var shownEdit = {};
|
||||
var configuredOauths = {};
|
||||
var anonymousOnly = false;
|
||||
var popupBoxType = "login";
|
||||
var oauthButtonsShown = false;
|
||||
var sortPolicy = "score-desc";
|
||||
@ -572,6 +573,11 @@
|
||||
}
|
||||
markdownButton.innerHTML = "<b>M ↓</b> Markdown";
|
||||
|
||||
if (anonymousOnly) {
|
||||
anonymousCheckbox.checked = true;
|
||||
anonymousCheckbox.setAttribute("disabled", true);
|
||||
}
|
||||
|
||||
textarea.oninput = autoExpander(textarea);
|
||||
if (edit === true) {
|
||||
onclick(submitButton, commentEdit, id);
|
||||
@ -661,7 +667,17 @@
|
||||
|
||||
onclick(loginText, global.loginBoxShow, null);
|
||||
|
||||
var numOauthConfigured = 0;
|
||||
Object.keys(configuredOauths).forEach(function(key) {
|
||||
if (configuredOauths[key]) {
|
||||
numOauthConfigured++;
|
||||
}
|
||||
});
|
||||
if (numOauthConfigured > 0) {
|
||||
append(login, loginText);
|
||||
} else if (!requireIdentification) {
|
||||
anonymousOnly = true;
|
||||
}
|
||||
|
||||
if (isLocked || isFrozen) {
|
||||
if (isAuthenticated || chosenAnonymous) {
|
||||
|
Loading…
Reference in New Issue
Block a user