Show
Ignore:
Timestamp:
12/17/07 19:19:56 (13 months ago)
Author:
cho45
Message:

lang/javascript/jsdeferred/trunk/jsdeferred.mini.js,
lang/javascript/jsdeferred/trunk/jsdeferred.jquery.js,
lang/javascript/jsdeferred/trunk/jsdeferred.nodoc.js,
lang/javascript/jsdeferred/trunk/jsdeferred.userscript.js:

rake しわすれた

Location:
lang/javascript/jsdeferred/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/jsdeferred/trunk/jsdeferred.jquery.js

    r3042 r3214  
    4040d.canceller=function(){try{clearTimeout(id)}catch(e){}};return d;};Deferred.next=function(fun){ 
    4141var d=new Deferred();var id=setTimeout(function(){clearTimeout(id);d.call()},0);if(fun)d.callback.ok=fun;d.canceller=function(){try{clearTimeout(id)}catch(e){}};return d;};Deferred.call=function(f,args){ 
    42 args=Array.prototype.slice.call(arguments);f=args.shift();return next(function(){ 
     42args=Array.prototype.slice.call(arguments);f=args.shift();return Deferred.next(function(){ 
    4343return f.apply(this,args);});};Deferred.loop=function(n,fun){ 
    4444var o={ 
     
    4848last:false, 
    4949prev:null 
    50 };var ret,step=o.step;return next(function(){ 
     50};var ret,step=o.step;return Deferred.next(function(){ 
    5151function _loop(i){ 
    5252if(i<=o.end){ 
     
    5555o.prev=ret;ret=fun.call(this,i,o);if(ret instanceof Deferred){ 
    5656return ret.next(function(r){ 
    57 ret=r;return call(_loop,i+step);});}else{ 
    58 return call(_loop,i+step);} 
     57ret=r;return Deferred.call(_loop,i+step);});}else{ 
     58return Deferred.call(_loop,i+step);} 
    5959}else{ 
    6060return ret;} 
    6161} 
    62 return call(_loop,o.begin);});};Deferred.register=function(name,fun){ 
     62return Deferred.call(_loop,o.begin);});};Deferred.register=function(name,fun){ 
    6363this.prototype[name]=function(){ 
    6464return this.next(Deferred.wrap(fun).apply(null,arguments));};};Deferred.wrap=function(dfun){ 
  • lang/javascript/jsdeferred/trunk/jsdeferred.mini.js

    r3042 r3214  
    4040d.canceller=function(){try{clearTimeout(id)}catch(e){}};return d;};Deferred.next=function(fun){ 
    4141var d=new Deferred();var id=setTimeout(function(){clearTimeout(id);d.call()},0);if(fun)d.callback.ok=fun;d.canceller=function(){try{clearTimeout(id)}catch(e){}};return d;};Deferred.call=function(f,args){ 
    42 args=Array.prototype.slice.call(arguments);f=args.shift();return next(function(){ 
     42args=Array.prototype.slice.call(arguments);f=args.shift();return Deferred.next(function(){ 
    4343return f.apply(this,args);});};Deferred.loop=function(n,fun){ 
    4444var o={ 
     
    4848last:false, 
    4949prev:null 
    50 };var ret,step=o.step;return next(function(){ 
     50};var ret,step=o.step;return Deferred.next(function(){ 
    5151function _loop(i){ 
    5252if(i<=o.end){ 
     
    5555o.prev=ret;ret=fun.call(this,i,o);if(ret instanceof Deferred){ 
    5656return ret.next(function(r){ 
    57 ret=r;return call(_loop,i+step);});}else{ 
    58 return call(_loop,i+step);} 
     57ret=r;return Deferred.call(_loop,i+step);});}else{ 
     58return Deferred.call(_loop,i+step);} 
    5959}else{ 
    6060return ret;} 
    6161} 
    62 return call(_loop,o.begin);});};Deferred.register=function(name,fun){ 
     62return Deferred.call(_loop,o.begin);});};Deferred.register=function(name,fun){ 
    6363this.prototype[name]=function(){ 
    6464return this.next(Deferred.wrap(fun).apply(null,arguments));};};Deferred.wrap=function(dfun){ 
  • lang/javascript/jsdeferred/trunk/jsdeferred.nodoc.js

    r3042 r3214  
    8989        args = Array.prototype.slice.call(arguments); 
    9090        f    = args.shift(); 
    91         return next(function () { 
     91        return Deferred.next(function () { 
    9292                return f.apply(this, args); 
    9393        }); 
     
    103103        }; 
    104104        var ret, step = o.step; 
    105         return next(function () { 
     105        return Deferred.next(function () { 
    106106                function _loop (i) { 
    107107                        if (i <= o.end) { 
     
    115115                                        return ret.next(function (r) { 
    116116                                                ret = r; 
    117                                                 return call(_loop, i + step); 
     117                                                return Deferred.call(_loop, i + step); 
    118118                                        }); 
    119119                                } else { 
    120                                         return call(_loop, i + step); 
     120                                        return Deferred.call(_loop, i + step); 
    121121                                } 
    122122                        } else { 
     
    124124                        } 
    125125                } 
    126                 return call(_loop, o.begin); 
     126                return Deferred.call(_loop, o.begin); 
    127127        }); 
    128128}; 
  • lang/javascript/jsdeferred/trunk/jsdeferred.userscript.js

    r3042 r3214  
    9393        args = Array.prototype.slice.call(arguments); 
    9494        f    = args.shift(); 
    95         return next(function () { 
     95        return Deferred.next(function () { 
    9696                return f.apply(this, args); 
    9797        }); 
     
    107107        }; 
    108108        var ret, step = o.step; 
    109         return next(function () { 
     109        return Deferred.next(function () { 
    110110                function _loop (i) { 
    111111                        if (i <= o.end) { 
     
    119119                                        return ret.next(function (r) { 
    120120                                                ret = r; 
    121                                                 return call(_loop, i + step); 
     121                                                return Deferred.call(_loop, i + step); 
    122122                                        }); 
    123123                                } else { 
    124                                         return call(_loop, i + step); 
     124                                        return Deferred.call(_loop, i + step); 
    125125                                } 
    126126                        } else { 
     
    128128                        } 
    129129                } 
    130                 return call(_loop, o.begin); 
     130                return Deferred.call(_loop, o.begin); 
    131131        }); 
    132132}; 
     
    176176} 
    177177xhttp.get  = function (url)       { return xhttp({method:"get", url:url}) } 
    178 xhttp.post = function (url, data) { return xhttp({method:"post", url:url, data:data}) } 
     178xhttp.post = function (url, data) { return xhttp({method:"post", url:url, data:data, headers:{"Content-Type":"application/x-www-form-urlencoded"}}) } 
     179 
    179180 
    180181function http (opts) {