feature(bower) smalltalk v1.6.4

This commit is contained in:
coderaiser 2015-12-09 15:03:49 -05:00
parent 32f2779a6c
commit 582fbb3125
11 changed files with 26 additions and 18 deletions

View file

@ -31,6 +31,6 @@
"emitify": "~1.3.0",
"execon": "~1.2.8",
"philip": "~1.3.1",
"smalltalk": "~1.6.3"
"smalltalk": "~1.6.4"
}
}

View file

@ -1,6 +1,6 @@
{
"name": "smalltalk",
"version": "1.6.3",
"version": "1.6.4",
"homepage": "https://github.com/coderaiser/smalltalk",
"authors": [
"coderaiser <mnemonic.enemy@gmail.com>"
@ -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
}

View file

@ -1,3 +1,9 @@
2015.12.09, v1.6.4
feature:
- (smalltalk) bind: slice -> rest
2015.12.05, v1.6.3
fix:

View file

@ -1,6 +1,6 @@
{
"name": "smalltalk",
"version": "1.6.3",
"version": "1.6.4",
"homepage": "https://github.com/coderaiser/smalltalk",
"authors": [
"coderaiser <mnemonic.enemy@gmail.com>"

View file

@ -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'<div class="page">\n <div data-name="js-close" class="close-button"></div>\n <header>'+n+'</header>\n <div class="content-area">\n '+t+"\n "+e+'\n </div>\n <div class="action-area">\n <div class="button-strip"> '+r.map(function(n,t){return"<button tabindex="+t+' data-name="js-'+n.toLowerCase()+'">'+n+"</button>"}).join("")+"\n </div>\n </div>\n </div>"}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='<input type="text" value="'+o+'" data-name="js-input">';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'<div class="page">\n <div data-name="js-close" class="close-button"></div>\n <header>'+n+'</header>\n <div class="content-area">\n '+t+"\n "+e+'\n </div>\n <div class="action-area">\n <div class="button-strip"> '+r.map(function(n,t){return"<button tabindex="+t+' data-name="js-'+n.toLowerCase()+'">'+n+"</button>"}).join("")+"\n </div>\n </div>\n </div>"}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='<input type="text" value="'+o+'" data-name="js-input">';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);

View file

@ -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);

View file

@ -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;f<a.length;f++)d(f,a[f])})},c.resolve=function(a){return a&&"object"==typeof a&&a.constructor===c?a:new c(function(b){b(a)})},c.reject=function(a){return new c(function(b,c){c(a)})},c.race=function(a){return new c(function(b,c){for(var d=0,e=a.length;e>d;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;f<a.length;f++)d(f,a[f])})},c.resolve=function(a){return a&&"object"==typeof a&&a.constructor===c?a:new c(function(b){b(a)})},c.reject=function(a){return new c(function(b,c){c(a)})},c.race=function(a){return new c(function(b,c){for(var d=0,e=a.length;e>d;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);

File diff suppressed because one or more lines are too long

View file

@ -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);

View file

@ -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": {

View file

@ -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);
}
}