Added JSCS linter to enforce style conventions

This commit is contained in:
juliandescottes
2015-04-14 18:02:33 +02:00
parent 007e4d4e11
commit b480acc6a0
150 changed files with 847 additions and 848 deletions

View File

@@ -35,12 +35,12 @@
ns.AnchorWidget.prototype.setOrigin = function (origin) {
this.origin = origin;
var previous = document.querySelector('.'+OPTION_CLASSNAME+'.selected');
var previous = document.querySelector('.' + OPTION_CLASSNAME + '.selected');
if (previous) {
previous.classList.remove('selected');
}
var selected = document.querySelector('.'+OPTION_CLASSNAME+'[data-origin="' + origin + '"]');
var selected = document.querySelector('.' + OPTION_CLASSNAME + '[data-origin="' + origin + '"]');
if (selected) {
selected.classList.add('selected');
this.refreshNeighbors_(selected);
@@ -64,7 +64,7 @@
};
ns.AnchorWidget.prototype.refreshNeighbors_ = function (selected) {
var options = document.querySelectorAll('.'+OPTION_CLASSNAME);
var options = document.querySelectorAll('.' + OPTION_CLASSNAME);
for (var i = 0 ; i < options.length ; i++) {
options[i].removeAttribute('data-neighbor');
}
@@ -84,4 +84,4 @@
el.setAttribute('data-neighbor', neighborhood);
}
};
})();
})();

View File

@@ -44,4 +44,4 @@
}
return value;
};
})();
})();

View File

@@ -53,11 +53,10 @@
// propagate savepath to new Piskel
piskel.savePath = pskl.app.piskelController.getSavePath();
pskl.app.piskelController.setPiskel(piskel, true);
$.publish(Events.CLOSE_SETTINGS_DRAWER);
};
ns.ResizeController.prototype.resizeLayer_ = function (layer) {
var resizedFrames = layer.getFrames().map(this.resizeFrame_.bind(this));
return pskl.model.Layer.fromFrames(layer.getName(), resizedFrames);
@@ -98,13 +97,13 @@
value = 0;
}
var height = this.piskelController.getHeight(),
width = this.piskelController.getWidth();
var height = this.piskelController.getHeight();
var width = this.piskelController.getWidth();
if (sizeInput === this.widthInput) {
this.heightInput.value = Math.round(value * height/width);
this.heightInput.value = Math.round(value * height / width);
} else if (sizeInput === this.heightInput) {
this.widthInput.value = Math.round(value * width/height);
this.widthInput.value = Math.round(value * width / height);
}
};
@@ -144,7 +143,7 @@
} else if (origin.indexOf('RIGHT') != -1) {
return x - (width - resizedWidth);
} else {
return x - Math.round((width - resizedWidth)/2);
return x - Math.round((width - resizedWidth) / 2);
}
};
@@ -155,7 +154,7 @@
} else if (origin.indexOf('BOTTOM') != -1) {
return y - (height - resizedHeight);
} else {
return y - Math.round((height - resizedHeight)/2);
return y - Math.round((height - resizedHeight) / 2);
}
};
})();
})();