Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorVinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>2016-08-30 01:37:17 +0300
committerGitHub <noreply@github.com>2016-08-30 01:37:17 +0300
commit329f52e0d4fb2426c57b065071e8b8c6bd1b266c (patch)
tree9d0f961b8086f70a3b93bdd638af8181848749c9 /js
parent6bfb4072b827721ac47175cfa45c59b346d1f6c3 (diff)
parent327c2474d160bd5135c519baae1307baf8f514d4 (diff)
Merge pull request #83 from v1r0x/anonymous-comments
allow anonymous comments
Diffstat (limited to 'js')
-rw-r--r--js/vote.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/js/vote.js b/js/vote.js
index ff959dde..186e4268 100644
--- a/js/vote.js
+++ b/js/vote.js
@@ -51,6 +51,15 @@ $(document).ready(function () {
$('#submit_send_comment').click(function(e) {
e.preventDefault();
var form = document.send_comment;
+ var ac = document.getElementById('user_name_comm');
+ if (ac != null) {
+ if(ac.value.length >= 3){
+ form.elements['userId'].value = ac.value;
+ } else {
+ alert(t('polls', 'You are not registered.\nPlease enter your name to vote\n(at least 3 characters).'));
+ return;
+ }
+ }
var comm = document.getElementById('commentBox');
if(comm.value.trim().length <= 0) {
alert(t('polls', 'Please add some text to your comment before submitting it.'));