voterunner

quick and dirty votes and discussions
git clone https://git.ce9e.org/voterunner.git

commit
1e4fe6b0e45c5dc80f0c824e78bbf5b251292619
parent
38c06d6ff610c468e394d2a83f895d8555bb146f
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2020-10-17 19:06
Gardening

Diffstat

M static/src/voterunner.js 8 ++++----
M static/test/test.js 9 +++++----

2 files changed, 9 insertions, 8 deletions


diff --git a/static/src/voterunner.js b/static/src/voterunner.js

@@ -94,7 +94,7 @@ var tplNode = function(nodes, node, ID) {
   94    94 	}
   95    95 
   96    96 	var delegateAttrs = {};
   97    -1 	if (node.id === ID || getDelegationChain(nodes, node).indexOf(ID) !== -1) {
   -1    97 	if (node.id === ID || getDelegationChain(nodes, node).includes(ID)) {
   98    98 		delegateAttrs.disabled = true;
   99    99 	}
  100   100 
@@ -127,7 +127,7 @@ var tplNode = function(nodes, node, ID) {
  127   127 			node.expanded && h('div', {
  128   128 				className: 'node__comment',
  129   129 				dangerouslySetInnerHTML: {
  130    -1 					__html: md.render(node.comment || '')
   -1   130 					__html: md.render(node.comment || ''),
  131   131 				},
  132   132 			}),
  133   133 		]),
@@ -162,7 +162,7 @@ var uid = function() {
  162   162 	// just enough uniqueness
  163   163 	var a = Math.random() * Date.now() * 0x1000;
  164   164 	return Math.floor(a).toString(36);
  165    -1 }
   -1   165 };
  166   166 var setCookie = function(key, value, days) {
  167   167 	localStorage[key] = value;
  168   168 };
@@ -260,7 +260,7 @@ document.addEventListener('DOMContentLoaded', function() {
  260   260 	});
  261   261 
  262   262 	document.querySelector('.user__rm').addEventListener('click', function(event) {
  263    -1 		if (confirm(_("Do you really want to delete this opinion?"))) {
   -1   263 		if (confirm(_('Do you really want to delete this opinion?'))) {
  264   264 			socket.emit('rmNode');
  265   265 			document.querySelector('.user__name input').value = '';
  266   266 			document.querySelector('.user__comment textarea').value = '';

diff --git a/static/test/test.js b/static/test/test.js

@@ -1,7 +1,9 @@
   -1     1 /* global describe, before, after, it, expect */
   -1     2 
    1     3 var TIMEOUT = 400;
    2    -1 var ID = 'testID'
   -1     4 var ID = 'testID';
    3     5 
    4    -1 setUp = function(url, fn) {
   -1     6 var setUp = function(url, fn) {
    5     7 	var iframe = document.createElement('iframe');
    6     8 	iframe.onload = function() {fn(iframe)};
    7     9 	iframe.url = url;
@@ -107,7 +109,7 @@ describe('setComment', function() {
  107   109 	var test = 'setComment';
  108   110 	var comment = 'testComment';
  109   111 	var browser;
  110    -1 	var d, userComment, node, nodeComment;
   -1   112 	var d, userComment, node, nodeComment, nodeExpand;
  111   113 
  112   114 	before(function(done) {
  113   115 		setUp('/test' + test + '/' + ID, function(b) {
@@ -170,7 +172,6 @@ describe('removeDelegate', function() {
  170   172 
  171   173 describe('remove', function() {
  172   174 	var test = 'remove';
  173    -1 	var comment = 'testComment';
  174   175 	var browser;
  175   176 	var d, userName, userComment, userRemove;
  176   177