Commit 7f64614f authored by Adhityaa Chandrasekar's avatar Adhityaa Chandrasekar

commento.js: default to anonymous if only option

Closes #285
parent d077241f
......@@ -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 &#8595;</b> &nbsp; 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);
append(login, loginText);
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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment