From 582fbb3125e1bb8df5c8b41682586d7bac866ff4 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 9 Dec 2015 15:03:49 -0500 Subject: [PATCH] feature(bower) smalltalk v1.6.4 --- bower.json | 2 +- modules/smalltalk/.bower.json | 10 +++++----- modules/smalltalk/ChangeLog | 6 ++++++ modules/smalltalk/bower.json | 2 +- modules/smalltalk/dist/smalltalk.min.js | 2 +- modules/smalltalk/dist/smalltalk.native.min.js | 2 +- modules/smalltalk/dist/smalltalk.native.poly.min.js | 2 +- modules/smalltalk/dist/smalltalk.poly.min.js | 2 +- modules/smalltalk/lib/smalltalk.js | 8 ++++++-- modules/smalltalk/package.json | 2 +- modules/smalltalk/src/smalltalk.js | 6 ++---- 11 files changed, 26 insertions(+), 18 deletions(-) diff --git a/bower.json b/bower.json index 06d9f216..40bef949 100644 --- a/bower.json +++ b/bower.json @@ -31,6 +31,6 @@ "emitify": "~1.3.0", "execon": "~1.2.8", "philip": "~1.3.1", - "smalltalk": "~1.6.3" + "smalltalk": "~1.6.4" } } diff --git a/modules/smalltalk/.bower.json b/modules/smalltalk/.bower.json index 68695024..c3b6f2c6 100644 --- a/modules/smalltalk/.bower.json +++ b/modules/smalltalk/.bower.json @@ -1,6 +1,6 @@ { "name": "smalltalk", - "version": "1.6.3", + "version": "1.6.4", "homepage": "https://github.com/coderaiser/smalltalk", "authors": [ "coderaiser " @@ -28,14 +28,14 @@ "screen" ], "dependencies": {}, - "_release": "1.6.3", + "_release": "1.6.4", "_resolution": { "type": "version", - "tag": "v1.6.3", - "commit": "80b4bdc5bd21a81b10cad4f8f7b9da9b7970aac8" + "tag": "v1.6.4", + "commit": "ba875e8ee6a3dc75fea1873cccd874f8757c0d9c" }, "_source": "git://github.com/coderaiser/smalltalk.git", - "_target": "~1.6.3", + "_target": "~1.6.4", "_originalSource": "smalltalk", "_direct": true } \ No newline at end of file diff --git a/modules/smalltalk/ChangeLog b/modules/smalltalk/ChangeLog index 85c2f3e8..9568b152 100644 --- a/modules/smalltalk/ChangeLog +++ b/modules/smalltalk/ChangeLog @@ -1,3 +1,9 @@ +2015.12.09, v1.6.4 + +feature: +- (smalltalk) bind: slice -> rest + + 2015.12.05, v1.6.3 fix: diff --git a/modules/smalltalk/bower.json b/modules/smalltalk/bower.json index b432bcef..cc0ce84c 100644 --- a/modules/smalltalk/bower.json +++ b/modules/smalltalk/bower.json @@ -1,6 +1,6 @@ { "name": "smalltalk", - "version": "1.6.3", + "version": "1.6.4", "homepage": "https://github.com/coderaiser/smalltalk", "authors": [ "coderaiser " diff --git a/modules/smalltalk/dist/smalltalk.min.js b/modules/smalltalk/dist/smalltalk.min.js index 090cf1ae..96414fa3 100644 --- a/modules/smalltalk/dist/smalltalk.min.js +++ b/modules/smalltalk/dist/smalltalk.min.js @@ -1 +1 @@ -"use strict";!function(n){function t(n){function e(n,t,e,r){if(!Array.isArray(r))throw Error("buttons should be array!");return'
\n
\n
'+n+'
\n
\n '+t+"\n "+e+'\n
\n
\n
'+r.map(function(n,t){return""}).join("")+"\n
\n
\n
"}function r(n,t,r,o,u){var c=document.createElement("div"),s=["cancel","close","ok"],d=void 0,v=void 0,m=new Promise(function(n,t){var e=u&&!u.cancel,r=function(){};d=n,v=t,e&&(v=r)}),p=e(n,t,r,o);return c.innerHTML=p,c.className="smalltalk",document.body.appendChild(c),l(c,["ok","input"]).forEach(function(n){return n.focus()}),l(c,["input"]).forEach(function(n){n.setSelectionRange(0,r.length)}),f("click",c,s,function(n){return i(n.target,c,d,v)}),["click","contextmenu"].forEach(function(n){return c.addEventListener(n,function(){return l(c,["ok","input"]).forEach(function(n){return n.focus()})})}),c.addEventListener("keydown",a(c,d,v)),m}function a(n,t,e){return function(r){var a={ENTER:13,ESC:27,TAB:9,LEFT:37,UP:38,RIGHT:39,DOWN:40},f=r.keyCode,s=r.target,d=["ok","cancel","input"],m=l(n,d).map(function(n){return o(n)});switch(f){case a.ENTER:i(s,n,t,e),r.preventDefault();break;case a.ESC:v(),e();break;case a.TAB:r.shiftKey&&c(n,m),c(n,m),r.preventDefault();break;default:var p=["left","right","up","down"].some(function(n){return f===a[n.toUpperCase()]});p&&u(n,m)}r.stopPropagation()}}function o(n){return n.getAttribute("data-name").replace("js-","")}function u(n,t){var e="",r=document.activeElement,a=o(r),u=/ok|cancel/.test(a),c=t.length-1;"input"!==a&&c&&u&&(e="cancel"===a?"ok":"cancel",l(n,[e]).forEach(function(n){return n.focus()}))}function c(n,t){var e=document.activeElement,r=o(e),a=t.length-1,u=t.indexOf(r);u===a?u=0:a>u&&++u;var c=t[u];l(n,[c]).forEach(function(n){return n.focus()})}function i(n,t,e,r){var a=void 0,o=n.getAttribute("data-name").replace("js-","");/close|cancel/.test(o)?r():(a=l(t,["input"]).reduce(function(n,t){return t.value},null),e(a)),v()}function l(n,t){var e=t.map(function(t){return n.querySelector('[data-name="js-'+t+'"]')}).filter(function(n){return n});return e}function f(n,t,e,r){l(t,e).forEach(function(t){return t.addEventListener(n,r)})}function s(n){var t=document.querySelector(n);t.parentElement.removeChild(t)}function d(n){var t=[].slice.call(arguments,1);return n.bind(null,t)}if(!(this instanceof t))return new t(n);var v=d(s,".smalltalk"),m=["OK"],p=["OK","Cancel"];this.alert=function(n,t,e){return r(n,t,"",m,e)},this.prompt=function(n,t,e,a){var o=e||"",u='';return r(n,t,u,p,a)},this.confirm=function(n,t,e){return r(n,t,"",p,e)}}"undefined"!=typeof module&&module.exports?module.exports=t():n.smalltalk=t()}("undefined"!=typeof window&&window); +"use strict";!function(n){function t(n){function e(n,t,e,r){if(!Array.isArray(r))throw Error("buttons should be array!");return'
\n
\n
'+n+'
\n
\n '+t+"\n "+e+'\n
\n
\n
'+r.map(function(n,t){return""}).join("")+"\n
\n
\n
"}function r(n,t,r,o,u){var c=document.createElement("div"),l=["cancel","close","ok"],d=void 0,v=void 0,p=new Promise(function(n,t){var e=u&&!u.cancel,r=function(){};d=n,v=t,e&&(v=r)}),m=e(n,t,r,o);return c.innerHTML=m,c.className="smalltalk",document.body.appendChild(c),f(c,["ok","input"]).forEach(function(n){return n.focus()}),f(c,["input"]).forEach(function(n){n.setSelectionRange(0,r.length)}),s("click",c,l,function(n){return i(n.target,c,d,v)}),["click","contextmenu"].forEach(function(n){return c.addEventListener(n,function(){return f(c,["ok","input"]).forEach(function(n){return n.focus()})})}),c.addEventListener("keydown",a(c,d,v)),p}function a(n,t,e){return function(r){var a={ENTER:13,ESC:27,TAB:9,LEFT:37,UP:38,RIGHT:39,DOWN:40},s=r.keyCode,l=r.target,d=["ok","cancel","input"],p=f(n,d).map(function(n){return o(n)});switch(s){case a.ENTER:i(l,n,t,e),r.preventDefault();break;case a.ESC:v(),e();break;case a.TAB:r.shiftKey&&c(n,p),c(n,p),r.preventDefault();break;default:var m=["left","right","up","down"].some(function(n){return s===a[n.toUpperCase()]});m&&u(n,p)}r.stopPropagation()}}function o(n){return n.getAttribute("data-name").replace("js-","")}function u(n,t){var e="",r=document.activeElement,a=o(r),u=/ok|cancel/.test(a),c=t.length-1;"input"!==a&&c&&u&&(e="cancel"===a?"ok":"cancel",f(n,[e]).forEach(function(n){return n.focus()}))}function c(n,t){var e=document.activeElement,r=o(e),a=t.length-1,u=t.indexOf(r);u===a?u=0:a>u&&++u;var c=t[u];f(n,[c]).forEach(function(n){return n.focus()})}function i(n,t,e,r){var a=void 0,o=n.getAttribute("data-name").replace("js-","");/close|cancel/.test(o)?r():(a=f(t,["input"]).reduce(function(n,t){return t.value},null),e(a)),v()}function f(n,t){var e=t.map(function(t){return n.querySelector('[data-name="js-'+t+'"]')}).filter(function(n){return n});return e}function s(n,t,e,r){f(t,e).forEach(function(t){return t.addEventListener(n,r)})}function l(n){var t=document.querySelector(n);t.parentElement.removeChild(t)}function d(n){for(var t=arguments.length,e=Array(t>1?t-1:0),r=1;t>r;r++)e[r-1]=arguments[r];return function(){return n.apply(void 0,e)}}if(!(this instanceof t))return new t(n);var v=d(l,".smalltalk"),p=["OK"],m=["OK","Cancel"];this.alert=function(n,t,e){return r(n,t,"",p,e)},this.prompt=function(n,t,e,a){var o=e||"",u='';return r(n,t,u,m,a)},this.confirm=function(n,t,e){return r(n,t,"",m,e)}}"undefined"!=typeof module&&module.exports?module.exports=t():n.smalltalk=t()}("undefined"!=typeof window&&window); diff --git a/modules/smalltalk/dist/smalltalk.native.min.js b/modules/smalltalk/dist/smalltalk.native.min.js index 6c27dfbb..82ffbb1f 100644 --- a/modules/smalltalk/dist/smalltalk.native.min.js +++ b/modules/smalltalk/dist/smalltalk.native.min.js @@ -1 +1 @@ -!function(n){"use strict";function e(){return this instanceof e?(this.alert=function(n,e){var t=new Promise(function(n){alert(e),n()});return t},this.prompt=function(n,e,t,o){var r=o,i=new Promise(function(n,o){var i=r&&!r.cancel,u=prompt(e,t);null!==u?n(u):i||o()});return i},void(this.confirm=function(n,e,t){var o=t,r=o&&!o.noCancel,i=new Promise(function(n,t){var o=confirm(e);o?n():r||t()});return i})):new e}"undefined"!=typeof module&&module.exports?module.exports=e():n.smalltalk=e()}("undefined"!=typeof window&&window); +"use strict";!function(n){function e(){return this instanceof e?(this.alert=function(n,e){var t=new Promise(function(n){alert(e),n()});return t},this.prompt=function(n,e,t,o){var r=o,i=new Promise(function(n,o){var i=r&&!r.cancel,u=prompt(e,t);null!==u?n(u):i||o()});return i},void(this.confirm=function(n,e,t){var o=t,r=o&&!o.noCancel,i=new Promise(function(n,t){var o=confirm(e);o?n():r||t()});return i})):new e}"undefined"!=typeof module&&module.exports?module.exports=e():n.smalltalk=e()}("undefined"!=typeof window&&window); diff --git a/modules/smalltalk/dist/smalltalk.native.poly.min.js b/modules/smalltalk/dist/smalltalk.native.poly.min.js index 484470f1..3e4bb7ec 100644 --- a/modules/smalltalk/dist/smalltalk.native.poly.min.js +++ b/modules/smalltalk/dist/smalltalk.native.poly.min.js @@ -1,2 +1,2 @@ /*! promise-polyfill 2.1.0 */ -!function(a){function b(a,b){return function(){a.apply(b,arguments)}}function c(a){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],i(a,b(e,this),b(f,this))}function d(a){var b=this;return null===this._state?void this._deferreds.push(a):void j(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function e(a){try{if(a===this)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void i(b(c,a),b(e,this),b(f,this))}this._state=!0,this._value=a,g.call(this)}catch(d){f.call(this,d)}}function f(a){this._state=!1,this._value=a,g.call(this)}function g(){for(var a=0,b=this._deferreds.length;b>a;a++)d.call(this,this._deferreds[a]);this._deferreds=null}function h(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function i(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var j="function"==typeof setImmediate&&setImmediate||function(a){setTimeout(a,1)},k=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};c.prototype["catch"]=function(a){return this.then(null,a)},c.prototype.then=function(a,b){var e=this;return new c(function(c,f){d.call(e,new h(a,b,c,f))})},c.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&k(arguments[0])?arguments[0]:arguments);return new c(function(b,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;fd;d++)a[d].then(b,c)})},c._setImmediateFn=function(a){j=a},"undefined"!=typeof module&&module.exports?module.exports=c:a.Promise||(a.Promise=c)}(this);!function(n){"use strict";function e(){return this instanceof e?(this.alert=function(n,e){var t=new Promise(function(n){alert(e),n()});return t},this.prompt=function(n,e,t,o){var r=o,i=new Promise(function(n,o){var i=r&&!r.cancel,u=prompt(e,t);null!==u?n(u):i||o()});return i},void(this.confirm=function(n,e,t){var o=t,r=o&&!o.noCancel,i=new Promise(function(n,t){var o=confirm(e);o?n():r||t()});return i})):new e}"undefined"!=typeof module&&module.exports?module.exports=e():n.smalltalk=e()}("undefined"!=typeof window&&window); +!function(a){function b(a,b){return function(){a.apply(b,arguments)}}function c(a){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],i(a,b(e,this),b(f,this))}function d(a){var b=this;return null===this._state?void this._deferreds.push(a):void j(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function e(a){try{if(a===this)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void i(b(c,a),b(e,this),b(f,this))}this._state=!0,this._value=a,g.call(this)}catch(d){f.call(this,d)}}function f(a){this._state=!1,this._value=a,g.call(this)}function g(){for(var a=0,b=this._deferreds.length;b>a;a++)d.call(this,this._deferreds[a]);this._deferreds=null}function h(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function i(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var j="function"==typeof setImmediate&&setImmediate||function(a){setTimeout(a,1)},k=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};c.prototype["catch"]=function(a){return this.then(null,a)},c.prototype.then=function(a,b){var e=this;return new c(function(c,f){d.call(e,new h(a,b,c,f))})},c.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&k(arguments[0])?arguments[0]:arguments);return new c(function(b,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;fd;d++)a[d].then(b,c)})},c._setImmediateFn=function(a){j=a},"undefined"!=typeof module&&module.exports?module.exports=c:a.Promise||(a.Promise=c)}(this);"use strict";!function(n){function e(){return this instanceof e?(this.alert=function(n,e){var t=new Promise(function(n){alert(e),n()});return t},this.prompt=function(n,e,t,o){var r=o,i=new Promise(function(n,o){var i=r&&!r.cancel,u=prompt(e,t);null!==u?n(u):i||o()});return i},void(this.confirm=function(n,e,t){var o=t,r=o&&!o.noCancel,i=new Promise(function(n,t){var o=confirm(e);o?n():r||t()});return i})):new e}"undefined"!=typeof module&&module.exports?module.exports=e():n.smalltalk=e()}("undefined"!=typeof window&&window); diff --git a/modules/smalltalk/dist/smalltalk.poly.min.js b/modules/smalltalk/dist/smalltalk.poly.min.js index 01f02eeb..933b054b 100644 --- a/modules/smalltalk/dist/smalltalk.poly.min.js +++ b/modules/smalltalk/dist/smalltalk.poly.min.js @@ -1,2 +1,2 @@ /*! promise-polyfill 2.1.0 */ -!function(a){function b(a,b){return function(){a.apply(b,arguments)}}function c(a){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],i(a,b(e,this),b(f,this))}function d(a){var b=this;return null===this._state?void this._deferreds.push(a):void j(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function e(a){try{if(a===this)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void i(b(c,a),b(e,this),b(f,this))}this._state=!0,this._value=a,g.call(this)}catch(d){f.call(this,d)}}function f(a){this._state=!1,this._value=a,g.call(this)}function g(){for(var a=0,b=this._deferreds.length;b>a;a++)d.call(this,this._deferreds[a]);this._deferreds=null}function h(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function i(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var j="function"==typeof setImmediate&&setImmediate||function(a){setTimeout(a,1)},k=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};c.prototype["catch"]=function(a){return this.then(null,a)},c.prototype.then=function(a,b){var e=this;return new c(function(c,f){d.call(e,new h(a,b,c,f))})},c.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&k(arguments[0])?arguments[0]:arguments);return new c(function(b,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;fd;d++)a[d].then(b,c)})},c._setImmediateFn=function(a){j=a},"undefined"!=typeof module&&module.exports?module.exports=c:a.Promise||(a.Promise=c)}(this);"use strict";!function(n){function t(n){function e(n,t,e,r){if(!Array.isArray(r))throw Error("buttons should be array!");return'
\n
\n
'+n+'
\n
\n '+t+"\n "+e+'\n
\n
\n
'+r.map(function(n,t){return""}).join("")+"\n
\n
\n
"}function r(n,t,r,o,u){var c=document.createElement("div"),s=["cancel","close","ok"],d=void 0,v=void 0,m=new Promise(function(n,t){var e=u&&!u.cancel,r=function(){};d=n,v=t,e&&(v=r)}),p=e(n,t,r,o);return c.innerHTML=p,c.className="smalltalk",document.body.appendChild(c),l(c,["ok","input"]).forEach(function(n){return n.focus()}),l(c,["input"]).forEach(function(n){n.setSelectionRange(0,r.length)}),f("click",c,s,function(n){return i(n.target,c,d,v)}),["click","contextmenu"].forEach(function(n){return c.addEventListener(n,function(){return l(c,["ok","input"]).forEach(function(n){return n.focus()})})}),c.addEventListener("keydown",a(c,d,v)),m}function a(n,t,e){return function(r){var a={ENTER:13,ESC:27,TAB:9,LEFT:37,UP:38,RIGHT:39,DOWN:40},f=r.keyCode,s=r.target,d=["ok","cancel","input"],m=l(n,d).map(function(n){return o(n)});switch(f){case a.ENTER:i(s,n,t,e),r.preventDefault();break;case a.ESC:v(),e();break;case a.TAB:r.shiftKey&&c(n,m),c(n,m),r.preventDefault();break;default:var p=["left","right","up","down"].some(function(n){return f===a[n.toUpperCase()]});p&&u(n,m)}r.stopPropagation()}}function o(n){return n.getAttribute("data-name").replace("js-","")}function u(n,t){var e="",r=document.activeElement,a=o(r),u=/ok|cancel/.test(a),c=t.length-1;"input"!==a&&c&&u&&(e="cancel"===a?"ok":"cancel",l(n,[e]).forEach(function(n){return n.focus()}))}function c(n,t){var e=document.activeElement,r=o(e),a=t.length-1,u=t.indexOf(r);u===a?u=0:a>u&&++u;var c=t[u];l(n,[c]).forEach(function(n){return n.focus()})}function i(n,t,e,r){var a=void 0,o=n.getAttribute("data-name").replace("js-","");/close|cancel/.test(o)?r():(a=l(t,["input"]).reduce(function(n,t){return t.value},null),e(a)),v()}function l(n,t){var e=t.map(function(t){return n.querySelector('[data-name="js-'+t+'"]')}).filter(function(n){return n});return e}function f(n,t,e,r){l(t,e).forEach(function(t){return t.addEventListener(n,r)})}function s(n){var t=document.querySelector(n);t.parentElement.removeChild(t)}function d(n){var t=[].slice.call(arguments,1);return n.bind(null,t)}if(!(this instanceof t))return new t(n);var v=d(s,".smalltalk"),m=["OK"],p=["OK","Cancel"];this.alert=function(n,t,e){return r(n,t,"",m,e)},this.prompt=function(n,t,e,a){var o=e||"",u='';return r(n,t,u,p,a)},this.confirm=function(n,t,e){return r(n,t,"",p,e)}}"undefined"!=typeof module&&module.exports?module.exports=t():n.smalltalk=t()}("undefined"!=typeof window&&window); +!function(a){function b(a,b){return function(){a.apply(b,arguments)}}function c(a){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],i(a,b(e,this),b(f,this))}function d(a){var b=this;return null===this._state?void this._deferreds.push(a):void j(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function e(a){try{if(a===this)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void i(b(c,a),b(e,this),b(f,this))}this._state=!0,this._value=a,g.call(this)}catch(d){f.call(this,d)}}function f(a){this._state=!1,this._value=a,g.call(this)}function g(){for(var a=0,b=this._deferreds.length;b>a;a++)d.call(this,this._deferreds[a]);this._deferreds=null}function h(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function i(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var j="function"==typeof setImmediate&&setImmediate||function(a){setTimeout(a,1)},k=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};c.prototype["catch"]=function(a){return this.then(null,a)},c.prototype.then=function(a,b){var e=this;return new c(function(c,f){d.call(e,new h(a,b,c,f))})},c.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&k(arguments[0])?arguments[0]:arguments);return new c(function(b,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;fd;d++)a[d].then(b,c)})},c._setImmediateFn=function(a){j=a},"undefined"!=typeof module&&module.exports?module.exports=c:a.Promise||(a.Promise=c)}(this);"use strict";!function(n){function t(n){function e(n,t,e,r){if(!Array.isArray(r))throw Error("buttons should be array!");return'
\n
\n
'+n+'
\n
\n '+t+"\n "+e+'\n
\n
\n
'+r.map(function(n,t){return""}).join("")+"\n
\n
\n
"}function r(n,t,r,o,u){var c=document.createElement("div"),l=["cancel","close","ok"],d=void 0,v=void 0,p=new Promise(function(n,t){var e=u&&!u.cancel,r=function(){};d=n,v=t,e&&(v=r)}),m=e(n,t,r,o);return c.innerHTML=m,c.className="smalltalk",document.body.appendChild(c),f(c,["ok","input"]).forEach(function(n){return n.focus()}),f(c,["input"]).forEach(function(n){n.setSelectionRange(0,r.length)}),s("click",c,l,function(n){return i(n.target,c,d,v)}),["click","contextmenu"].forEach(function(n){return c.addEventListener(n,function(){return f(c,["ok","input"]).forEach(function(n){return n.focus()})})}),c.addEventListener("keydown",a(c,d,v)),p}function a(n,t,e){return function(r){var a={ENTER:13,ESC:27,TAB:9,LEFT:37,UP:38,RIGHT:39,DOWN:40},s=r.keyCode,l=r.target,d=["ok","cancel","input"],p=f(n,d).map(function(n){return o(n)});switch(s){case a.ENTER:i(l,n,t,e),r.preventDefault();break;case a.ESC:v(),e();break;case a.TAB:r.shiftKey&&c(n,p),c(n,p),r.preventDefault();break;default:var m=["left","right","up","down"].some(function(n){return s===a[n.toUpperCase()]});m&&u(n,p)}r.stopPropagation()}}function o(n){return n.getAttribute("data-name").replace("js-","")}function u(n,t){var e="",r=document.activeElement,a=o(r),u=/ok|cancel/.test(a),c=t.length-1;"input"!==a&&c&&u&&(e="cancel"===a?"ok":"cancel",f(n,[e]).forEach(function(n){return n.focus()}))}function c(n,t){var e=document.activeElement,r=o(e),a=t.length-1,u=t.indexOf(r);u===a?u=0:a>u&&++u;var c=t[u];f(n,[c]).forEach(function(n){return n.focus()})}function i(n,t,e,r){var a=void 0,o=n.getAttribute("data-name").replace("js-","");/close|cancel/.test(o)?r():(a=f(t,["input"]).reduce(function(n,t){return t.value},null),e(a)),v()}function f(n,t){var e=t.map(function(t){return n.querySelector('[data-name="js-'+t+'"]')}).filter(function(n){return n});return e}function s(n,t,e,r){f(t,e).forEach(function(t){return t.addEventListener(n,r)})}function l(n){var t=document.querySelector(n);t.parentElement.removeChild(t)}function d(n){for(var t=arguments.length,e=Array(t>1?t-1:0),r=1;t>r;r++)e[r-1]=arguments[r];return function(){return n.apply(void 0,e)}}if(!(this instanceof t))return new t(n);var v=d(l,".smalltalk"),p=["OK"],m=["OK","Cancel"];this.alert=function(n,t,e){return r(n,t,"",p,e)},this.prompt=function(n,t,e,a){var o=e||"",u='';return r(n,t,u,m,a)},this.confirm=function(n,t,e){return r(n,t,"",m,e)}}"undefined"!=typeof module&&module.exports?module.exports=t():n.smalltalk=t()}("undefined"!=typeof window&&window); diff --git a/modules/smalltalk/lib/smalltalk.js b/modules/smalltalk/lib/smalltalk.js index 843f2ba2..3cfd3441 100644 --- a/modules/smalltalk/lib/smalltalk.js +++ b/modules/smalltalk/lib/smalltalk.js @@ -209,9 +209,13 @@ } function bind(fn) { - var args = [].slice.call(arguments, 1); + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } - return fn.bind(null, args); + return function () { + return fn.apply(undefined, args); + }; } } })(typeof window !== 'undefined' && window); \ No newline at end of file diff --git a/modules/smalltalk/package.json b/modules/smalltalk/package.json index 32d05bc8..fa5d666e 100644 --- a/modules/smalltalk/package.json +++ b/modules/smalltalk/package.json @@ -1,6 +1,6 @@ { "name": "smalltalk", - "version": "1.6.3", + "version": "1.6.4", "description": "Promise-based Alert, Confirm and Prompt replacement", "homepage": "http://github.com/coderaiser/smalltalk", "repository": { diff --git a/modules/smalltalk/src/smalltalk.js b/modules/smalltalk/src/smalltalk.js index ddbe56f8..a5f06b24 100644 --- a/modules/smalltalk/src/smalltalk.js +++ b/modules/smalltalk/src/smalltalk.js @@ -245,10 +245,8 @@ el.parentElement.removeChild(el); } - function bind(fn) { - var args = [].slice.call(arguments, 1); - - return fn.bind(null, args); + function bind(fn, ...args) { + return () => fn(...args); } }