Skip to content

Commit

Permalink
eslint check
Browse files Browse the repository at this point in the history
  • Loading branch information
mose committed Feb 23, 2016
1 parent 53a3c11 commit da83fae
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions app/public/js/farms.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ https://fetch.spec.whatwg.org
*/

function ready(fn) {
if (document.readyState != 'loading') {
if (document.readyState !== 'loading') {
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
Expand All @@ -25,7 +25,7 @@ ready( () => {
filterBox(".side .filter input", farms);

function restore_url(list) {
if (window.location.hash != '') {
if (window.location.hash !== '') {
var target = window.location.hash.replace(/#/,'');
var parts = target.split('/');
Array.prototype.forEach.call(list, (item, i) => {
Expand Down Expand Up @@ -86,7 +86,7 @@ ready( () => {
}
removeClass(meat, 'wait');
});
},
}
};

Array.prototype.forEach.call(farms, (item, i) => {
Expand Down
4 changes: 2 additions & 2 deletions app/public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function make_base_auth(user, password) {
}

function addClass(el, className) {
if (el.classList != null)
if (el.classList !== null)
el.classList.add(className);
else
el.className += ' ' + className;
Expand Down Expand Up @@ -62,7 +62,7 @@ function filterBox(input, els) {
filterinput.focus();
filterinput.addEventListener('keyup', (ev) => {
el = ev.target;
if (el.value == '')
if (el.value === '')
Array.prototype.forEach.call(els, (item, i) => {
item.style.display = 'block';
});
Expand Down
24 changes: 12 additions & 12 deletions app/public/js/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ready( () => {
var target = window.location.hash.replace(/#/,'');
var parts = target.split('/');
Array.prototype.forEach.call(list, (item, i) => {
if (item.textContent == parts[0]) {
if (item.textContent === parts[0]) {
if (parts[1] != undefined) {
Node[parts[1]](parts[0]);
} else {
Expand Down Expand Up @@ -50,7 +50,7 @@ ready( () => {

function build_row(top, key, params) {
build_line(top, params['file'], key, params['value'], false);
if (params['overriden'] == true) {
if (params['overriden'] === true) {
Array.prototype.forEach.call(params['found_in'], (values, i) => {
build_line(top, values['file'], key, values['value'], true);
});
Expand Down Expand Up @@ -136,7 +136,7 @@ ready( () => {
fetch(req, auth_header()).
then(res => res.json()).
then(j => {
if (j.error != undefined) {
if (j.error !== undefined) {
show_error(hierachy, j['error']);
} else {
location.reload();
Expand All @@ -152,7 +152,7 @@ ready( () => {
then(res => res.json()).
then(j => {
var hierachy = document.querySelector('div.hierarchy');
if (j.error != undefined) {
if (j.error !== undefined) {
show_error(hierachy, j['error']);
} else {
console.debug(j);
Expand All @@ -171,7 +171,7 @@ ready( () => {
hierarchy.appendChild(nodeinfo);
Array.prototype.forEach.call(Object.keys(j.info), (item, k) => {
var index = j.vars.indexOf(item);
if (index > -1 && (j.facts == null || j.facts[item] == undefined)) {
if (index > -1 && (j.facts === null || j.facts[item] === undefined)) {
addTo(nodeinfo, "<div class=\"var\"><div class=\"label\">"+item+"</div>" +
"<div><input type=\"text\" name=\""+item+"\" value=\""+j.info[item]+"\" disabled></div></div>");
j.vars.splice(index, 1);
Expand All @@ -182,17 +182,17 @@ ready( () => {
var factinfo = document.createElement('div');
factinfo.className = "factinfo";
hierarchy.appendChild(factinfo);
if (j.facts == null) {
if (j.facts === null) {
Array.prototype.forEach.call(Object.keys(j.vars), (item, k) => {
if (j.defaults != null && j.defaults[j.vars[item]] != undefined) {
if (j.defaults !== null && j.defaults[j.vars[item]] !== undefined) {
addTo(factinfo, "<div class=\"var\"><div class=\"label\">"+j.vars[item]+"</div>" +
"<div><input type=\"text\" class=\"userinput\" name=\"" +
j.vars[item]+"\" value=\"" +
j.defaults[j.vars[item]]+"\"></div></div>");
}
});
Array.prototype.forEach.call(Object.keys(j.vars), (item, k) => {
if (j.defaults == null || j.defaults[j.vars[item]] == undefined) {
if (j.defaults === null || j.defaults[j.vars[item]] === undefined) {
addTo(factinfo, "<div class=\"var\"><div class=\"label\">"+j.vars[item]+"</div>" +
"<div><input type=\"text\" class=\"userinput\" name=\"" +
j.vars[item]+"\" value=\"\"></div></div>");
Expand All @@ -201,7 +201,7 @@ ready( () => {
} else {
Array.prototype.forEach.call(Object.keys(j.facts), (item, k) => {
var override = '';
if (j.defaults != null && j.defaults[item] != undefined) {
if (j.defaults !== null && j.defaults[item] !== undefined) {
override = " <i>("+j.defaults[item]+")</i>";
}
addTo(factinfo, "<div class=\"var\"><div class=\"label\">" +
Expand Down Expand Up @@ -294,7 +294,7 @@ ready( () => {
then(j => {
// console.log(auth_header().headers.getAll('x-auth'));
build_top(node);
if (j.error != undefined) {
if (j.error !== undefined) {
show_error(meat, j['error']);
} else {
build_params(meat, node, j);
Expand All @@ -313,7 +313,7 @@ ready( () => {
then(res => res.json()).
then(j => {
build_top(node);
if (j.error != undefined) {
if (j.error !== undefined) {
show_error(meat, j['error']);
} else {
build_info(meat, node, j);
Expand All @@ -332,7 +332,7 @@ ready( () => {
then(res => res.json()).
then(j => {
build_top(node);
if (j.error != undefined) {
if (j.error !== undefined) {
show_error(meat, j['error']);
} else {
build_params(meat, node, j);
Expand Down

0 comments on commit da83fae

Please sign in to comment.