aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/js
diff options
context:
space:
mode:
authorGravatar KillyMXI2017-06-02 19:07:56 +0300
committerGravatar Vitaly Takmazov2017-06-03 15:08:20 +0300
commit7817d34a3f012f6c2cd446b70f97d6dcc72e6170 (patch)
treec91b1f4b0c734c8065772341ef2b77f5c27c7afe /juick-www/src/main/js
parent1fc31d9d94696be3a3c34e2652ad90ee95f76481 (diff)
eslint rules
Diffstat (limited to 'juick-www/src/main/js')
-rw-r--r--juick-www/src/main/js/killy/index.js26
1 files changed, 13 insertions, 13 deletions
diff --git a/juick-www/src/main/js/killy/index.js b/juick-www/src/main/js/killy/index.js
index 4d2331b66..bb8e21f94 100644
--- a/juick-www/src/main/js/killy/index.js
+++ b/juick-www/src/main/js/killy/index.js
@@ -8,18 +8,18 @@ function insertAfter(newNode, referenceNode) {
}
function moveAll(fromNode, toNode) {
- for (let c; (c = fromNode.firstChild) != null; ) { toNode.appendChild(c); }
+ for (let c; c = fromNode.firstChild; ) { toNode.appendChild(c); }
}
function removeAllFrom(fromNode) {
- for (let c; (c = fromNode.lastChild) != null; ) { fromNode.removeChild(c); }
+ for (let c; c = fromNode.lastChild; ) { fromNode.removeChild(c); }
}
function turnIntoCts(node, makeNodeCallback) {
node.onclick = function(e){
e.preventDefault();
let newNode = makeNodeCallback();
- if(newNode !== node) {
+ if (newNode !== node) {
removeAllFrom(node);
moveAll(newNode, node);
node.className = newNode.className;
@@ -161,7 +161,7 @@ function getEmbedableLinkTypes() {
return wrapIntoTag(makeIframe('//player.vimeo.com/video/' + reResult[1], 640, 360), 'div', 'vimeo');
}
}
- ]
+ ];
}
function embedLink(aNode, linkTypes, container, alwaysCts, afterNode) {
@@ -175,7 +175,7 @@ function embedLink(aNode, linkTypes, container, alwaysCts, afterNode) {
if (reResult !== null) {
if ((linkType.match !== undefined) && (linkType.match(aNode, reResult) === false)) { return false; }
let newNode;
- let isCts = alwaysCts /* || TODO user click-to-show setting */;
+ let isCts = alwaysCts; /* || TODO user click-to-show setting */
if (isCts) {
let linkTitle = (linkType.makeTitle !== undefined) ? linkType.makeTitle(aNode, reResult) : naiveEllipsis(aNode.href, 55);
newNode = makeCts(() => linkType.makeNode(aNode, reResult, newNode), 'Click to show: ' + linkTitle);
@@ -240,7 +240,7 @@ function embedLinksToX(x, beforeNodeSelector, allLinksSelector, ctsUsers, ctsTag
}
function embedLinksToArticles() {
- let ctsUsers = [], ctsTags = [] // TODO click-to-show users and tags
+ let ctsUsers = [], ctsTags = []; // TODO click-to-show users and tags
let beforeNodeSelector = 'nav.l';
let allLinksSelector = 'p:not(.ir) a, pre a';
Array.from(document.querySelectorAll('#content > article')).forEach(article => {
@@ -249,7 +249,7 @@ function embedLinksToArticles() {
}
function embedLinksToPost() {
- let ctsUsers = [], ctsTags = [] // TODO click-to-show users and tags
+ let ctsUsers = [], ctsTags = []; // TODO click-to-show users and tags
let beforeNodeSelector = '.msg-txt + *';
let allLinksSelector = '.msg-txt a';
Array.from(document.querySelectorAll('#content .msg-cont')).forEach(msg => {
@@ -258,9 +258,9 @@ function embedLinksToPost() {
}
exports.embed = function() {
- if (document.querySelectorAll('#content > article').length) {
- embedLinksToArticles();
- } else {
- embedLinksToPost();
- }
-}
+ if (document.querySelectorAll('#content > article').length) {
+ embedLinksToArticles();
+ } else {
+ embedLinksToPost();
+ }
+};