Update deps, use grunt-connect instead of express, fix jscs errors

This commit is contained in:
jdescottes
2015-12-09 22:38:58 +01:00
parent 8c29afbca6
commit 21d4857b74
10 changed files with 155 additions and 60 deletions

View File

@@ -167,7 +167,7 @@
if (pskl.utils.Environment.detectNodeWebkit() && pskl.utils.UserAgent.isMac) {
var gui = require('nw.gui');
var mb = new gui.Menu({type:'menubar'});
var mb = new gui.Menu({type : 'menubar'});
mb.createMacBuiltin('Piskel');
gui.Window.get().menu = mb;
}

View File

@@ -49,12 +49,18 @@
};
ns.CursorCoordinatesController.prototype.onCursorMoved_ = function (event, x, y) {
this.coordinates = {x:x, y:y};
this.coordinates = {
x : x,
y : y
};
this.redraw();
};
ns.CursorCoordinatesController.prototype.onDragStart_ = function (event, x, y) {
this.origin = {x:x, y:y};
this.origin = {
x : x,
y : y
};
this.redraw();
};

View File

@@ -7,8 +7,8 @@
* @public
*/
ns.PaletteController.prototype.init = function() {
$.subscribe(Events.SELECT_PRIMARY_COLOR, this.onColorSelected_.bind(this, {isPrimary:true}));
$.subscribe(Events.SELECT_SECONDARY_COLOR, this.onColorSelected_.bind(this, {isPrimary:false}));
$.subscribe(Events.SELECT_PRIMARY_COLOR, this.onColorSelected_.bind(this, {isPrimary : true}));
$.subscribe(Events.SELECT_SECONDARY_COLOR, this.onColorSelected_.bind(this, {isPrimary : false}));
var shortcuts = pskl.service.keyboard.Shortcuts;
pskl.app.shortcutService.registerShortcut(shortcuts.COLOR.SWAP, this.swapColors.bind(this));

View File

@@ -24,23 +24,23 @@
};
ns.PaletteImportService.prototype.getReader_ = function (file, onSuccess, onError) {
var readerClass = this.getReaderClass_(file);
if (readerClass) {
return new readerClass(file, onSuccess, onError);
var ReaderClass = this.getReaderClass_(file);
if (ReaderClass) {
return new ReaderClass(file, onSuccess, onError);
} else {
return null;
}
};
ns.PaletteImportService.prototype.getReaderClass_ = function (file) {
var readerClass;
var ReaderClass;
if (this.isImage_(file)) {
readerClass = fileReaders.img;
ReaderClass = fileReaders.img;
} else {
var extension = this.getExtension_(file);
readerClass = fileReaders[extension];
ReaderClass = fileReaders[extension];
}
return readerClass;
return ReaderClass;
};
ns.PaletteImportService.prototype.getExtension_ = function (file) {

View File

@@ -157,7 +157,11 @@
return;
}
var paintedPixels = pskl.PixelUtils.visitConnectedPixels({col:col, row:row}, frame, function (pixel) {
var startPixel = {
col : col,
row : row
};
var paintedPixels = pskl.PixelUtils.visitConnectedPixels(startPixel, frame, function (pixel) {
if (frame.containsPixel(pixel.col, pixel.row) && frame.getPixel(pixel.col, pixel.row) == targetColor) {
frame.setPixel(pixel.col, pixel.row, replacementColor);
return true;

View File

@@ -25,14 +25,14 @@ if (!Function.prototype.bind) {
var bindArgs = Array.prototype.slice.call(arguments, 1);
var fToBind = this;
var fNOP = function () {};
var FNOP = function () {};
var fBound = function () {
var args = bindArgs.concat(Array.prototype.slice.call(arguments));
return fToBind.apply(this instanceof fNOP && oThis ? this : oThis, args);
return fToBind.apply(this instanceof FNOP && oThis ? this : oThis, args);
};
fNOP.prototype = this.prototype;
fBound.prototype = new fNOP();
FNOP.prototype = this.prototype;
fBound.prototype = new FNOP();
return fBound;
};

View File

@@ -105,7 +105,7 @@
var isSelected = (index === this.selectedIndex);
html += pskl.utils.Template.replace(tpl, {
'color' : color, index:index,
'color' : color, index : index,
':selected' : isSelected,
':light-color' : this.isLight_(color)
});