summaryrefslogtreecommitdiff
path: root/data/js
diff options
context:
space:
mode:
authormorkt <morkt@users.noreply.github.com>2015-10-18 12:31:16 +0400
committermorkt <morkt@users.noreply.github.com>2015-10-18 12:31:16 +0400
commit710df2e42bb5558a611577ee6f374b4450b37f84 (patch)
tree05b8989b21fe25137a7524a584c6dc782018d39a /data/js
parent61251790bd1da10eebee3c56a70a9711e7680ce8 (diff)
discussion board polls.
Diffstat (limited to 'data/js')
-rw-r--r--data/js/polls.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/data/js/polls.js b/data/js/polls.js
new file mode 100644
index 00000000..b34f0f7b
--- /dev/null
+++ b/data/js/polls.js
@@ -0,0 +1,26 @@
+function addPoll() {
+ var a = byId('poll_add');
+ setClass(a, 'hidden', false);
+ var parentNode = function(n, tag) {
+ while(n && n.nodeName.toLowerCase() != tag)
+ n = n.parentNode;
+ return n;
+ };
+ var show = function(v) {
+ setClass(parentNode(byId('poll_q'), 'tr'), 'hidden', !v);
+ setClass(parentNode(byId('poll_opt'), 'tr'), 'hidden', !v);
+ setClass(parentNode(byId('poll_max'), 'tr'), 'hidden', !v);
+ setClass(parentNode(byId('poll_preview'),'tr'), 'hidden', !v);
+ setClass(parentNode(byId('poll_recast'), 'tr'), 'hidden', !v);
+ setClass(parentNode(a, 'tr'), 'hidden', v);
+ };
+ a.onclick = function() {
+ show(true);
+ return true;
+ };
+ show(false);
+}
+
+// Discussion board polls
+if(byId('poll_add'))
+ addPoll();