Permalink
Browse files

Correct for jshint

  • Loading branch information...
1 parent 37335d1 commit c1e11c49b64aee18bf7d05141b3b3333d55ea7c2 @dsimard committed Dec 4, 2012
View
15 minified/jskata.js
@@ -1,15 +1,6 @@
/* jskata.nofreeze.js */
-(function(){var j={sleepFor:1,chunkSize:10,stops:[],forLoop:function(b,e,d,c,a){var f,g=c&&c.sleepFor?c.sleepFor:this.sleepFor,k=c&&c.chunkSize?c.chunkSize:this.chunkSize,h=function(){a&&a();clearTimeout(f)},i=function(){h&&h();h=null};this.stops.push(i);(function l(){for(var m=0;b()&&m++<k;){d();e&&e()}if(b())f=setTimeout(l,g);else i()})();return{stop:i}},forCount:function(b,e,d,c){var a=d&&d.beginAt||0;return this.forloop(function(){return a<=b},function(){a++},function(){e(a)},d,c)},infinite:function(b,
-e,d){return this.forloop(function(){return true},null,b,e,d)},each:function(b,e,d,c){var a=0;if(Object.prototype.toString.call(b)=="[object Array]"){a=0;return this.forloop(function(){return a<b.length},function(){a++},function(){e.call(b[a],a,b[a])},d,c)}else{var f=[],g;for(g in b)f.push(g);a=0;return this.forloop(function(){return a<f.length},function(){a++},function(){e.call(b[f[a]],f[a],b[f[a]])},d,c)}},stop:function(){for(var b=0;b<this.stops.length;b++)this.stops[b]();this.onStop&&this.onStop()}};
-j.forloop=j.forLoop;if(window.javascriptKataDotCom===undefined)window.javascriptKataDotCom={};if(window.jsKata===undefined)window.jsKata=window.javascriptKataDotCom;if(window.jsk===undefined)window.jsk=window.javascriptKataDotCom;if(window._===undefined)window._=window.javascriptKataDotCom;window.javascriptKataDotCom.nofreeze=j;window.javascriptKataDotCom.nf=window.javascriptKataDotCom.nofreeze})();
-
+(function(){var a={sleepFor:1,chunkSize:10,stops:[],forLoop:function(b,c,d,e,f){var g=this,h,i=e&&e.sleepFor?e.sleepFor:this.sleepFor,j=e&&e.chunkSize?e.chunkSize:this.chunkSize,k=function(){f&&f(),clearTimeout(h)},l=function(){k&&k(),k=null};g.stops.push(l);var m=function n(){var a=0;while(b()&&a++<j)d(),c&&c();b()?h=setTimeout(n,i):l()};return m(),{stop:l}},forCount:function(b,c,d,e){var f=d&&d.beginAt||0,g=function(){c(f)};return this.forloop(function(){return f<=b},function(){f++},g,d,e)},infinite:function(b,c,d){return this.forloop(function(){return!0},null,b,c,d)},each:function(a,b,c,d){var e=0;if(Object.prototype.toString.call(a)=="[object Array]")return e=0,this.forloop(function(){return e<a.length},function(){e++},function(){b.call(a[e],e,a[e])},c,d);var f=[];for(var g in a)f.push(g);return e=0,this.forloop(function(){return e<f.length},function(){e++},function(){b.call(a[f[e]],f[e],a[f[e]])},c,d)},stop:function(){for(var a=0;a<this.stops.length;a++)this.stops[a]();this.onStop&&this.onStop()}};a.forloop=a.forLoop,window.javascriptKataDotCom===undefined&&(window.javascriptKataDotCom={}),window.jsKata===undefined&&(window.jsKata=window.javascriptKataDotCom),window.jsk===undefined&&(window.jsk=window.javascriptKataDotCom),window._===undefined&&(window._=window.javascriptKataDotCom),window.javascriptKataDotCom.nofreeze=a,window.javascriptKataDotCom.nf=window.javascriptKataDotCom.nofreeze})()
/* jskata.timezone.js */
-(function(){var a={breakingMonth:0,testMonth0Offset:null,testMonth6Offset:null,timeSepator:"",getDateOffset:function(b){return(new Date((new Date).getFullYear(),b,0)).getTimezoneOffset()},getMonth0Offset:function(){return a.testMonth0Offset!==null?a.testMonth0Offset:a.getDateOffset(a.breakingMonth)},getMonth6Offset:function(){return a.testMonth6Offset!==null?a.testMonth6Offset:a.getDateOffset(a.breakingMonth+6)},offsetToString:function(b,d){d=d||a.timeSeparator||"";var e=[],c=b/60;e.push(c>=0?"+":
-"-");var f=Math.floor(Math.abs(c));e.push((f<=9?"0":"")+f);e.push(d);c=Math.abs(c%1)*60;e.push((c<=9?"0":"")+c);return e.join("")},testOffset:function(b,d){a.testMonth0Offset=b;a.testMonth6Offset=d},hasDst:function(){return a.st()!=a.dst()},invertedSt:function(){return Math.max(a.getMonth0Offset(),a.getMonth6Offset())},invertedDst:function(){return Math.min(a.getMonth0Offset(),a.getMonth6Offset())},st:function(){return 0-a.invertedSt()},stToString:function(b){return a.offsetToString(a.st(),b)},dst:function(){return 0-
-a.invertedDst()},dstToString:function(b){return a.offsetToString(a.dst(),b)},iHateTheLastComma:true};if(window.javascriptKataDotCom===undefined)window.javascriptKataDotCom={};if(window.jsKata===undefined)window.jsKata=window.javascriptKataDotCom;if(window.jsk===undefined)window.jsk=window.javascriptKataDotCom;if(window._===undefined)window._=window.javascriptKataDotCom;window.javascriptKataDotCom.timezone=a;window.javascriptKataDotCom.tz=a})();
-
+(function(){var a={breakingMonth:0,testMonth0Offset:null,testMonth6Offset:null,timeSepator:"",getDateOffset:function(b){return(new Date((new Date).getFullYear(),b,0)).getTimezoneOffset()},getMonth0Offset:function(){return a.testMonth0Offset!==null?a.testMonth0Offset:a.getDateOffset(a.breakingMonth)},getMonth6Offset:function(){return a.testMonth6Offset!==null?a.testMonth6Offset:a.getDateOffset(a.breakingMonth+6)},offsetToString:function(b,c){c=c||a.timeSeparator||"";var d=[],e=b/60;d.push(e>=0?"+":"-");var f=Math.floor(Math.abs(e));d.push((f<=9?"0":"")+f),d.push(c);var g=Math.abs(e%1)*60;return d.push((g<=9?"0":"")+g),d.join("")},testOffset:function(c,d){a.testMonth0Offset=c,a.testMonth6Offset=d},hasDst:function(){return a.st()!=a.dst()},invertedSt:function(){return Math.max(a.getMonth0Offset(),a.getMonth6Offset())},invertedDst:function(){return Math.min(a.getMonth0Offset(),a.getMonth6Offset())},st:function(){return 0-a.invertedSt()},stToString:function(b){return a.offsetToString(a.st(),b)},dst:function(){return 0-a.invertedDst()},dstToString:function(b){return a.offsetToString(a.dst(),b)},iHateTheLastComma:!0};typeof window!="undefined"?(window.javascriptKataDotCom===undefined&&(window.javascriptKataDotCom={}),window.jsKata===undefined&&(window.jsKata=window.javascriptKataDotCom),window.jsk===undefined&&(window.jsk=window.javascriptKataDotCom),window._===undefined&&(window._=window.javascriptKataDotCom),window.javascriptKataDotCom.timezone=a,window.javascriptKataDotCom.tz=a):typeof module!="undefined"&&typeof module.exports!="undefined"&&(module.exports=a)})()
/* jskata.undo.js */
-(function(){var d={dids:[],undids:[],canUndo:function(){return this.dids.length>0},canRedo:function(){return this.undids.length>0},push:function(a){this.execute(null,a)},execute:function(a,c,b){var e;if(b===undefined||b===null)b={};if(this.isFct(a)&&b.async!==true)e=a();if(d.isInAsyncRedo!==true)this.undids=[];d.isInAsyncRedo=false;if(b.data)e=b.data;this.dids.push({redo:a,undo:c,wrappedUndo:function(){c(e)},options:b});this.fireEvents();return e},undo:function(){var a=this.dids&&this.dids.length>
-0?this.dids.pop():null;if(this.isFct(a.wrappedUndo)){a.wrappedUndo();this.isFct(a.redo)&&this.undids.push({redo:a.redo,undo:a.undo,options:a.options})}this.fireEvents()},redo:function(){var a=this.undids&&this.undids.length>0?this.undids.pop():null;if(this.isFct(a.redo)){d.isInAsyncRedo=a.options.async;var c=a.redo();if(a.options.data)c=a.options.data;var b=function(){a.undo(c)};a.options.async!==true&&this.dids.push({redo:a.redo,undo:a.undo,wrappedUndo:b,options:a.options})}this.fireEvents()},onChange:function(){return false},
-onEmpty:function(){return false},fireEvents:function(){this.onChange&&this.onChange();this.dids.length===0&&this.undids.length===0&&this.onEmpty()},isFct:function(a){return a&&typeof a=="function"}};if(window.javascriptKataDotCom===undefined)window.javascriptKataDotCom={};if(window.jsKata===undefined)window.jsKata=window.javascriptKataDotCom;if(window.jsk===undefined)window.jsk=window.javascriptKataDotCom;if(window._===undefined)window._=window.javascriptKataDotCom;window.javascriptKataDotCom.undo=
-d;window.javascriptKataDotCom.u=d;window.jskataUndo=window.javascriptKataDotCom.undo})();
+(function(){var a={dids:[],undids:[],canUndo:function(){return this.dids.length>0},canRedo:function(){return this.undids.length>0},push:function(a){this.execute(null,a)},execute:function(c,d,e){var f;if(e===undefined||e===null)e={};this.isFct(c)&&e.async!==!0&&(f=c()),a.isInAsyncRedo!==!0&&(this.undids=[]),a.isInAsyncRedo=!1,e.data&&(f=e.data);var g=function(){d(f)};return this.dids.push({redo:c,undo:d,wrappedUndo:g,options:e}),this.fireEvents(),f},undo:function(){var b=this.dids&&this.dids.length>0?this.dids.pop():null;this.isFct(b.wrappedUndo)&&(b.wrappedUndo(),this.isFct(b.redo)&&this.undids.push({redo:b.redo,undo:b.undo,options:b.options})),this.fireEvents()},redo:function(){var c=this.undids&&this.undids.length>0?this.undids.pop():null;if(this.isFct(c.redo)){a.isInAsyncRedo=c.options.async;var d=c.redo();c.options.data&&(d=c.options.data);var e=function(){c.undo(d)};c.options.async!==!0&&this.dids.push({redo:c.redo,undo:c.undo,wrappedUndo:e,options:c.options})}this.fireEvents()},onChange:function(){return!1},onEmpty:function(){return!1},fireEvents:function(){this.onChange&&this.onChange(),this.dids.length===0&&this.undids.length===0&&this.onEmpty()},isFct:function(a){return a&&typeof a=="function"}};window.javascriptKataDotCom===undefined&&(window.javascriptKataDotCom={}),window.jsKata===undefined&&(window.jsKata=window.javascriptKataDotCom),window.jsk===undefined&&(window.jsk=window.javascriptKataDotCom),window._===undefined&&(window._=window.javascriptKataDotCom),window.javascriptKataDotCom.undo=a,window.javascriptKataDotCom.u=a,window.jskataUndo=window.javascriptKataDotCom.undo})()
View
4 minified/jskata.nofreeze.min.js
@@ -1,3 +1 @@
-(function(){var j={sleepFor:1,chunkSize:10,stops:[],forLoop:function(b,e,d,c,a){var f,g=c&&c.sleepFor?c.sleepFor:this.sleepFor,k=c&&c.chunkSize?c.chunkSize:this.chunkSize,h=function(){a&&a();clearTimeout(f)},i=function(){h&&h();h=null};this.stops.push(i);(function l(){for(var m=0;b()&&m++<k;){d();e&&e()}if(b())f=setTimeout(l,g);else i()})();return{stop:i}},forCount:function(b,e,d,c){var a=d&&d.beginAt||0;return this.forloop(function(){return a<=b},function(){a++},function(){e(a)},d,c)},infinite:function(b,
-e,d){return this.forloop(function(){return true},null,b,e,d)},each:function(b,e,d,c){var a=0;if(Object.prototype.toString.call(b)=="[object Array]"){a=0;return this.forloop(function(){return a<b.length},function(){a++},function(){e.call(b[a],a,b[a])},d,c)}else{var f=[],g;for(g in b)f.push(g);a=0;return this.forloop(function(){return a<f.length},function(){a++},function(){e.call(b[f[a]],f[a],b[f[a]])},d,c)}},stop:function(){for(var b=0;b<this.stops.length;b++)this.stops[b]();this.onStop&&this.onStop()}};
-j.forloop=j.forLoop;if(window.javascriptKataDotCom===undefined)window.javascriptKataDotCom={};if(window.jsKata===undefined)window.jsKata=window.javascriptKataDotCom;if(window.jsk===undefined)window.jsk=window.javascriptKataDotCom;if(window._===undefined)window._=window.javascriptKataDotCom;window.javascriptKataDotCom.nofreeze=j;window.javascriptKataDotCom.nf=window.javascriptKataDotCom.nofreeze})();
+(function(){var a={sleepFor:1,chunkSize:10,stops:[],forLoop:function(b,c,d,e,f){var g=this,h,i=e&&e.sleepFor?e.sleepFor:this.sleepFor,j=e&&e.chunkSize?e.chunkSize:this.chunkSize,k=function(){f&&f(),clearTimeout(h)},l=function(){k&&k(),k=null};g.stops.push(l);var m=function n(){var a=0;while(b()&&a++<j)d(),c&&c();b()?h=setTimeout(n,i):l()};return m(),{stop:l}},forCount:function(b,c,d,e){var f=d&&d.beginAt||0,g=function(){c(f)};return this.forloop(function(){return f<=b},function(){f++},g,d,e)},infinite:function(b,c,d){return this.forloop(function(){return!0},null,b,c,d)},each:function(a,b,c,d){var e=0;if(Object.prototype.toString.call(a)=="[object Array]")return e=0,this.forloop(function(){return e<a.length},function(){e++},function(){b.call(a[e],e,a[e])},c,d);var f=[];for(var g in a)f.push(g);return e=0,this.forloop(function(){return e<f.length},function(){e++},function(){b.call(a[f[e]],f[e],a[f[e]])},c,d)},stop:function(){for(var a=0;a<this.stops.length;a++)this.stops[a]();this.onStop&&this.onStop()}};a.forloop=a.forLoop,window.javascriptKataDotCom===undefined&&(window.javascriptKataDotCom={}),window.jsKata===undefined&&(window.jsKata=window.javascriptKataDotCom),window.jsk===undefined&&(window.jsk=window.javascriptKataDotCom),window._===undefined&&(window._=window.javascriptKataDotCom),window.javascriptKataDotCom.nofreeze=a,window.javascriptKataDotCom.nf=window.javascriptKataDotCom.nofreeze})()
View
4 minified/jskata.timezone.min.js
@@ -1,3 +1 @@
-(function(){var a={breakingMonth:0,testMonth0Offset:null,testMonth6Offset:null,timeSepator:"",getDateOffset:function(b){return(new Date((new Date).getFullYear(),b,0)).getTimezoneOffset()},getMonth0Offset:function(){return a.testMonth0Offset!==null?a.testMonth0Offset:a.getDateOffset(a.breakingMonth)},getMonth6Offset:function(){return a.testMonth6Offset!==null?a.testMonth6Offset:a.getDateOffset(a.breakingMonth+6)},offsetToString:function(b,d){d=d||a.timeSeparator||"";var e=[],c=b/60;e.push(c>=0?"+":
-"-");var f=Math.floor(Math.abs(c));e.push((f<=9?"0":"")+f);e.push(d);c=Math.abs(c%1)*60;e.push((c<=9?"0":"")+c);return e.join("")},testOffset:function(b,d){a.testMonth0Offset=b;a.testMonth6Offset=d},hasDst:function(){return a.st()!=a.dst()},invertedSt:function(){return Math.max(a.getMonth0Offset(),a.getMonth6Offset())},invertedDst:function(){return Math.min(a.getMonth0Offset(),a.getMonth6Offset())},st:function(){return 0-a.invertedSt()},stToString:function(b){return a.offsetToString(a.st(),b)},dst:function(){return 0-
-a.invertedDst()},dstToString:function(b){return a.offsetToString(a.dst(),b)},iHateTheLastComma:true};if(window.javascriptKataDotCom===undefined)window.javascriptKataDotCom={};if(window.jsKata===undefined)window.jsKata=window.javascriptKataDotCom;if(window.jsk===undefined)window.jsk=window.javascriptKataDotCom;if(window._===undefined)window._=window.javascriptKataDotCom;window.javascriptKataDotCom.timezone=a;window.javascriptKataDotCom.tz=a})();
+(function(){var a={breakingMonth:0,testMonth0Offset:null,testMonth6Offset:null,timeSepator:"",getDateOffset:function(b){return(new Date((new Date).getFullYear(),b,0)).getTimezoneOffset()},getMonth0Offset:function(){return a.testMonth0Offset!==null?a.testMonth0Offset:a.getDateOffset(a.breakingMonth)},getMonth6Offset:function(){return a.testMonth6Offset!==null?a.testMonth6Offset:a.getDateOffset(a.breakingMonth+6)},offsetToString:function(b,c){c=c||a.timeSeparator||"";var d=[],e=b/60;d.push(e>=0?"+":"-");var f=Math.floor(Math.abs(e));d.push((f<=9?"0":"")+f),d.push(c);var g=Math.abs(e%1)*60;return d.push((g<=9?"0":"")+g),d.join("")},testOffset:function(c,d){a.testMonth0Offset=c,a.testMonth6Offset=d},hasDst:function(){return a.st()!=a.dst()},invertedSt:function(){return Math.max(a.getMonth0Offset(),a.getMonth6Offset())},invertedDst:function(){return Math.min(a.getMonth0Offset(),a.getMonth6Offset())},st:function(){return 0-a.invertedSt()},stToString:function(b){return a.offsetToString(a.st(),b)},dst:function(){return 0-a.invertedDst()},dstToString:function(b){return a.offsetToString(a.dst(),b)},iHateTheLastComma:!0};typeof window!="undefined"?(window.javascriptKataDotCom===undefined&&(window.javascriptKataDotCom={}),window.jsKata===undefined&&(window.jsKata=window.javascriptKataDotCom),window.jsk===undefined&&(window.jsk=window.javascriptKataDotCom),window._===undefined&&(window._=window.javascriptKataDotCom),window.javascriptKataDotCom.timezone=a,window.javascriptKataDotCom.tz=a):typeof module!="undefined"&&typeof module.exports!="undefined"&&(module.exports=a)})()
View
5 minified/jskata.undo.min.js
@@ -1,4 +1 @@
-(function(){var d={dids:[],undids:[],canUndo:function(){return this.dids.length>0},canRedo:function(){return this.undids.length>0},push:function(a){this.execute(null,a)},execute:function(a,c,b){var e;if(b===undefined||b===null)b={};if(this.isFct(a)&&b.async!==true)e=a();if(d.isInAsyncRedo!==true)this.undids=[];d.isInAsyncRedo=false;if(b.data)e=b.data;this.dids.push({redo:a,undo:c,wrappedUndo:function(){c(e)},options:b});this.fireEvents();return e},undo:function(){var a=this.dids&&this.dids.length>
-0?this.dids.pop():null;if(this.isFct(a.wrappedUndo)){a.wrappedUndo();this.isFct(a.redo)&&this.undids.push({redo:a.redo,undo:a.undo,options:a.options})}this.fireEvents()},redo:function(){var a=this.undids&&this.undids.length>0?this.undids.pop():null;if(this.isFct(a.redo)){d.isInAsyncRedo=a.options.async;var c=a.redo();if(a.options.data)c=a.options.data;var b=function(){a.undo(c)};a.options.async!==true&&this.dids.push({redo:a.redo,undo:a.undo,wrappedUndo:b,options:a.options})}this.fireEvents()},onChange:function(){return false},
-onEmpty:function(){return false},fireEvents:function(){this.onChange&&this.onChange();this.dids.length===0&&this.undids.length===0&&this.onEmpty()},isFct:function(a){return a&&typeof a=="function"}};if(window.javascriptKataDotCom===undefined)window.javascriptKataDotCom={};if(window.jsKata===undefined)window.jsKata=window.javascriptKataDotCom;if(window.jsk===undefined)window.jsk=window.javascriptKataDotCom;if(window._===undefined)window._=window.javascriptKataDotCom;window.javascriptKataDotCom.undo=
-d;window.javascriptKataDotCom.u=d;window.jskataUndo=window.javascriptKataDotCom.undo})();
+(function(){var a={dids:[],undids:[],canUndo:function(){return this.dids.length>0},canRedo:function(){return this.undids.length>0},push:function(a){this.execute(null,a)},execute:function(c,d,e){var f;if(e===undefined||e===null)e={};this.isFct(c)&&e.async!==!0&&(f=c()),a.isInAsyncRedo!==!0&&(this.undids=[]),a.isInAsyncRedo=!1,e.data&&(f=e.data);var g=function(){d(f)};return this.dids.push({redo:c,undo:d,wrappedUndo:g,options:e}),this.fireEvents(),f},undo:function(){var b=this.dids&&this.dids.length>0?this.dids.pop():null;this.isFct(b.wrappedUndo)&&(b.wrappedUndo(),this.isFct(b.redo)&&this.undids.push({redo:b.redo,undo:b.undo,options:b.options})),this.fireEvents()},redo:function(){var c=this.undids&&this.undids.length>0?this.undids.pop():null;if(this.isFct(c.redo)){a.isInAsyncRedo=c.options.async;var d=c.redo();c.options.data&&(d=c.options.data);var e=function(){c.undo(d)};c.options.async!==!0&&this.dids.push({redo:c.redo,undo:c.undo,wrappedUndo:e,options:c.options})}this.fireEvents()},onChange:function(){return!1},onEmpty:function(){return!1},fireEvents:function(){this.onChange&&this.onChange(),this.dids.length===0&&this.undids.length===0&&this.onEmpty()},isFct:function(a){return a&&typeof a=="function"}};window.javascriptKataDotCom===undefined&&(window.javascriptKataDotCom={}),window.jsKata===undefined&&(window.jsKata=window.javascriptKataDotCom),window.jsk===undefined&&(window.jsk=window.javascriptKataDotCom),window._===undefined&&(window._=window.javascriptKataDotCom),window.javascriptKataDotCom.undo=a,window.javascriptKataDotCom.u=a,window.jskataUndo=window.javascriptKataDotCom.undo})()
View
1 ready.js.config
@@ -1,5 +1,6 @@
// See http://github.com/dsimard/ready.js for more information
{
+ analyze: false,
src : "./src",
dest : "./minified", // the destination of your minified files
compiledExtension : "min", // extension of the minified file
View
8 src/jskata.nofreeze.js
@@ -89,7 +89,13 @@
} else {
// Create an array of properties
var props = [];
- for(var prop in obj) {props.push(prop); }
+
+ for(var prop in obj) {
+ if (true) { // for jshint
+ props.push(prop);
+ }
+ }
+
i = 0;
return this.forloop(
function() { return i < props.length; },
View
160 src/jskata.undo.js
@@ -1,31 +1,31 @@
(function() {
var jsk = {
///// PROPERTIES
- dids : [],
- undids : [],
- // Can undo
- canUndo : function() {
- return this.dids.length > 0;
- },
- // Can Redo
- canRedo : function() {
- return this.undids.length > 0;
- },
- ///// FUNCTIONS
- // deprecated : Push an undo function
- push : function(undoFunction) {
- this.execute(null, undoFunction);
- },
- // Do something that can be undone
- execute : function execute(doFunction, undoFunction, options) {
- // If in async, it will not execute the do when calling redo
- // (see redoFunction)
- var data;
+ dids : [],
+ undids : [],
+ // Can undo
+ canUndo : function() {
+ return this.dids.length > 0;
+ },
+ // Can Redo
+ canRedo : function() {
+ return this.undids.length > 0;
+ },
+ ///// FUNCTIONS
+ // deprecated : Push an undo function
+ push : function(undoFunction) {
+ this.execute(null, undoFunction);
+ },
+ // Do something that can be undone
+ execute : function execute(doFunction, undoFunction, options) {
+ // If in async, it will not execute the do when calling redo
+ // (see redoFunction)
+ var data;
- if (options === undefined || options === null) { options = {}; }
-
- if (this.isFct(doFunction) && options.async !== true) {
- data = doFunction();
+ if (options === undefined || options === null) { options = {}; }
+
+ if (this.isFct(doFunction) && options.async !== true) {
+ data = doFunction();
}
// This causes me problem on async
@@ -49,64 +49,64 @@
this.fireEvents();
return data;
- },
- // Undo
- undo : function undo() {
- var fct = this.dids && this.dids.length > 0 ? this.dids.pop() : null;
- if (this.isFct(fct.wrappedUndo)) {
- fct.wrappedUndo();
-
- // There can be no "do" so don't push a redo
- if (this.isFct(fct.redo)) {
- this.undids.push({redo:fct.redo, undo:fct.undo,
- options : fct.options});
- }
- }
+ },
+ // Undo
+ undo : function undo() {
+ var fct = this.dids && this.dids.length > 0 ? this.dids.pop() : null;
+ if (this.isFct(fct.wrappedUndo)) {
+ fct.wrappedUndo();
+
+ // There can be no "do" so don't push a redo
+ if (this.isFct(fct.redo)) {
+ this.undids.push({redo:fct.redo, undo:fct.undo,
+ options : fct.options});
+ }
+ }
this.fireEvents();
- },
- // Redo
- redo : function redo() {
- var fct = this.undids && this.undids.length > 0 ? this.undids.pop() : null;
- if (this.isFct(fct.redo)) {
- jsk.isInAsyncRedo = fct.options.async;
- var data = fct.redo();
-
- // If there's data in options, use them
- if (fct.options.data) { data = fct.options.data; }
-
- var wrappedUndo = function wrappedUndo() {
- fct.undo(data);
- };
-
- // Put the redo in dids (if in async, skip this)
- if (fct.options.async !== true) {
- this.dids.push({redo:fct.redo,undo:fct.undo,
- wrappedUndo:wrappedUndo, options:fct.options});
- }
- }
-
- this.fireEvents();
- },
- ///// EVENTS
- // When there's a change
- onChange : function() {
- return false;
- },
- // deprecated : when all the do/undo are empty
- onEmpty : function() {
- return false;
- },
- ///// PRIVATE
- // fired when something changes
- fireEvents : function() {
- if (this.onChange) { this.onChange(); }
- if (this.dids.length === 0 && this.undids.length === 0) { this.onEmpty(); }
- },
- // is Function
- isFct : function(fct) {
- return fct && typeof fct == "function";
- }
+ },
+ // Redo
+ redo : function redo() {
+ var fct = this.undids && this.undids.length > 0 ? this.undids.pop() : null;
+ if (this.isFct(fct.redo)) {
+ jsk.isInAsyncRedo = fct.options.async;
+ var data = fct.redo();
+
+ // If there's data in options, use them
+ if (fct.options.data) { data = fct.options.data; }
+
+ var wrappedUndo = function wrappedUndo() {
+ fct.undo(data);
+ };
+
+ // Put the redo in dids (if in async, skip this)
+ if (fct.options.async !== true) {
+ this.dids.push({redo:fct.redo,undo:fct.undo,
+ wrappedUndo:wrappedUndo, options:fct.options});
+ }
+ }
+
+ this.fireEvents();
+ },
+ ///// EVENTS
+ // When there's a change
+ onChange : function() {
+ return false;
+ },
+ // deprecated : when all the do/undo are empty
+ onEmpty : function() {
+ return false;
+ },
+ ///// PRIVATE
+ // fired when something changes
+ fireEvents : function() {
+ if (this.onChange) { this.onChange(); }
+ if (this.dids.length === 0 && this.undids.length === 0) { this.onEmpty(); }
+ },
+ // is Function
+ isFct : function(fct) {
+ return fct && typeof fct == "function";
+ }
};
// Creates the base namespaces

0 comments on commit c1e11c4

Please sign in to comment.