voterunner

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

commit
f5e79d90f3dfbebcb31ac86e8cc20986ade1df6c
parent
afb6bf24c6aa70a5873ad119f90a170d49a48f07
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2020-10-17 19:20
rm mock i18n

Diffstat

M static/src/voterunner.js 16 ++++++----------

1 files changed, 6 insertions, 10 deletions


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

@@ -5,10 +5,6 @@ var io = require('socket.io-client');
    5     5 
    6     6 var md = new MarkdownIt();
    7     7 
    8    -1 var _ = function(s) {
    9    -1 	return s;
   10    -1 };
   11    -1 
   12     8 var throttle = function(fn, timeout) {
   13     9 	var called, blocked;
   14    10 
@@ -68,7 +64,7 @@ var getDelegationChain = function(nodes, node) {
   68    64 };
   69    65 
   70    66 var getName = function(node) {
   71    -1 	return node.name || _('anonymous');
   -1    67 	return node.name || 'anonymous';
   72    68 };
   73    69 
   74    70 var tplFollowers = function(nodes, id, ID) {
@@ -107,11 +103,11 @@ var tplNode = function(nodes, node, ID) {
  107   103 			}, [
  108   104 				h('button', {
  109   105 					className: 'node__expand bar__item bar__item--button bar__item--left',
  110    -1 					title: _(node.expanded ? 'collapse' : 'expand'),
   -1   106 					title: node.expanded ? 'collapse' : 'expand',
  111   107 				}, node.expanded ? '\u25BC' : '\u25B6'),
  112   108 				h('button', {
  113   109 					className: 'node__delegate bar__item bar__item--button bar__item--right',
  114    -1 					title: _('delegate to ') + getName(node),
   -1   110 					title: 'delegate to ' + getName(node),
  115   111 					attributes: delegateAttrs,
  116   112 				}, '\u2795'),
  117   113 				h('div', {className: 'node__votes bar__item bar__item--right'}, '' + getVotes(nodes, node)),
@@ -217,9 +213,9 @@ document.addEventListener('DOMContentLoaded', function() {
  217   213 
  218   214 		if (user && user.delegate) {
  219   215 			var delegatee = getNode(user.delegate);
  220    -1 			document.querySelector('.user__delegation').textContent = _('delegated to: ') + getName(delegatee);
   -1   216 			document.querySelector('.user__delegation').textContent = 'delegated to: ' + getName(delegatee);
  221   217 		} else {
  222    -1 			document.querySelector('.user__delegation').textContent = _('(no delegation)');
   -1   218 			document.querySelector('.user__delegation').textContent = '(no delegation)';
  223   219 		}
  224   220 	};
  225   221 
@@ -242,7 +238,7 @@ document.addEventListener('DOMContentLoaded', function() {
  242   238 	});
  243   239 
  244   240 	on(document, 'click', '.user__rm', function() {
  245    -1 		if (confirm(_('Do you really want to delete this opinion?'))) {
   -1   241 		if (confirm('Do you really want to delete this opinion?')) {
  246   242 			socket.emit('rmNode');
  247   243 			document.querySelector('.user__name input').value = '';
  248   244 			document.querySelector('.user__comment textarea').value = '';