fixed jshint complaints

This commit is contained in:
juliandescottes 2012-09-11 00:52:09 +02:00
parent 5666733f98
commit a8394d22b1
7 changed files with 216 additions and 226 deletions

View File

@ -1,2 +1,2 @@
test:
jshint js/*.js --config js/.jshintrc
jshint js/*.js

View File

@ -21,7 +21,7 @@ pskl.LocalStorageService = (function() {
var persistToLocalStorageRequest_ = function() {
// Persist to localStorage when drawing. We throttle localStorage accesses
// for high frequency drawing (eg mousemove).
if(localStorageThrottler_ != null) {
if(localStorageThrottler_ !== null) {
window.clearTimeout(localStorageThrottler_);
}
localStorageThrottler_ = window.setTimeout(function() {
@ -34,30 +34,30 @@ pskl.LocalStorageService = (function() {
* @private
*/
var persistToLocalStorage_ = function() {
console.log('[LocalStorage service]: Snapshot stored')
window.localStorage['snapShot'] = frameSheet_.serialize();
console.log('[LocalStorage service]: Snapshot stored');
window.localStorage.snapShot = frameSheet_.serialize();
};
/**
* @private
*/
var restoreFromLocalStorage_ = function() {
frameSheet_.deserialize(window.localStorage['snapShot']);
frameSheet_.deserialize(window.localStorage.snapShot);
};
/**
* @private
*/
var cleanLocalStorage_ = function() {
console.log('[LocalStorage service]: Snapshot removed')
delete window.localStorage['snapShot'];
console.log('[LocalStorage service]: Snapshot removed');
delete window.localStorage.snapShot;
};
return {
init: function(frameSheet) {
if(frameSheet == undefined) {
throw "Bad LocalStorageService initialization: <undefined frameSheet>"
if(frameSheet === undefined) {
throw "Bad LocalStorageService initialization: <undefined frameSheet>";
}
frameSheet_ = frameSheet;

View File

@ -77,7 +77,7 @@ pskl.Palette = (function() {
} else {
colorPicker[0].color.fromString(color);
}
}
};
return {
init: function(framesheet) {

View File

@ -20,16 +20,6 @@ pskl.ToolSelector = (function() {
var currentSelectedTool = toolInstances.simplePen;
var previousSelectedTool = toolInstances.simplePen;
var selectTool_ = function(tool) {
var maincontainer = $("body");
var previousSelectedToolClass = maincontainer.data("selected-tool-class");
if(previousSelectedToolClass) {
maincontainer.removeClass(previousSelectedToolClass);
}
maincontainer.addClass(toolBehavior.toolId);
$("#drawing-canvas-container").data("selected-tool-class", toolBehavior.toolId);
};
var activateToolOnStage_ = function(tool) {
var stage = $("body");
var previousSelectedToolClass = stage.data("selected-tool-class");
@ -56,7 +46,7 @@ pskl.ToolSelector = (function() {
if(clickedTool.length) {
for(var tool in toolInstances) {
if (toolInstances[tool].toolId == clickedTool.data()["toolId"]) {
if (toolInstances[tool].toolId == clickedTool.data().toolId) {
selectTool_(toolInstances[tool]);
// Show tool as selected:

View File

@ -16,7 +16,7 @@ jQuery.namespace = function() {
*
* @require Constants
*/
(function(ns) { // namespace: pskl.utils
(function() { // namespace: pskl.utils
var ns = $.namespace("pskl.utils");
@ -35,5 +35,5 @@ jQuery.namespace = function() {
//prototypeskl.ToolBehavior.Eraser.prototype.constructor = pskl.ToolBehavior.Eraser;
};
})()
})();