From 3c37cede176663940d397a3c9e674aaaa3eaa251 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 4 Oct 2016 15:17:03 +0300 Subject: [PATCH] feature(bower) smalltalk v2.1.3 --- bower.json | 4 +- modules/promise-polyfill/.bower.json | 5 +-- modules/smalltalk/.bower.json | 13 ++++--- modules/smalltalk/ChangeLog | 8 ++++ modules/smalltalk/css/smalltalk.css | 1 - modules/smalltalk/dist/smalltalk.min.css | 2 +- modules/smalltalk/dist/smalltalk.min.js | 2 +- .../dist/smalltalk.native.poly.min.js | 2 +- modules/smalltalk/dist/smalltalk.poly.min.js | 2 +- modules/smalltalk/lib/smalltalk.js | 37 +++++++++---------- modules/smalltalk/package.json | 6 +-- 11 files changed, 43 insertions(+), 39 deletions(-) diff --git a/bower.json b/bower.json index 8f348ab4..fffdda5c 100644 --- a/bower.json +++ b/bower.json @@ -40,7 +40,7 @@ "philip": "^1.3.3", "jquery": "3.1.0", "jonny": "1.0.1", - "smalltalk": "2.1.2", - "promise-polyfill": "6.0.2" + "promise-polyfill": "6.0.2", + "smalltalk": "2.1.3" } } diff --git a/modules/promise-polyfill/.bower.json b/modules/promise-polyfill/.bower.json index ef717d2e..62510017 100644 --- a/modules/promise-polyfill/.bower.json +++ b/modules/promise-polyfill/.bower.json @@ -32,7 +32,6 @@ "commit": "3591c457e9999ecf5e5c648ed68d4f21a0ad3d11" }, "_source": "https://github.com/taylorhakes/promise-polyfill.git", - "_target": "^6.0.2", - "_originalSource": "promise-polyfill", - "_direct": true + "_target": "6.0.2", + "_originalSource": "promise-polyfill" } \ No newline at end of file diff --git a/modules/smalltalk/.bower.json b/modules/smalltalk/.bower.json index c047e0cc..0385b476 100644 --- a/modules/smalltalk/.bower.json +++ b/modules/smalltalk/.bower.json @@ -24,14 +24,15 @@ "test" ], "dependencies": {}, - "version": "2.1.2", - "_release": "2.1.2", + "version": "2.1.3", + "_release": "2.1.3", "_resolution": { "type": "version", - "tag": "v2.1.2", - "commit": "3347d250e0e5da3b1aa7afcf2b9b3a50d9a48064" + "tag": "v2.1.3", + "commit": "9914a8d9d581af0594e140c2d1af92892a626c94" }, "_source": "https://github.com/coderaiser/smalltalk.git", - "_target": "2.1.2", - "_originalSource": "smalltalk" + "_target": "^2.1.3", + "_originalSource": "smalltalk", + "_direct": true } \ No newline at end of file diff --git a/modules/smalltalk/ChangeLog b/modules/smalltalk/ChangeLog index 59b0ab89..f848459a 100644 --- a/modules/smalltalk/ChangeLog +++ b/modules/smalltalk/ChangeLog @@ -1,3 +1,11 @@ +2016.10.04, v2.1.3 + +feature: +- (smalltalk) showDialog: if -> ternary +- (package) stylelint-config-standard v13.0.0 +- (package) nyc v8.1.0 + + 2016.08.08, v2.1.2 fix: diff --git a/modules/smalltalk/css/smalltalk.css b/modules/smalltalk/css/smalltalk.css index b37af1c9..7f5adc35 100644 --- a/modules/smalltalk/css/smalltalk.css +++ b/modules/smalltalk/css/smalltalk.css @@ -121,7 +121,6 @@ user-select: none; background-image: linear-gradient(#ededed, #ededed 38%, #dedede); - border: 1px solid rgb(0, 0, 0); border: 1px solid rgba(0, 0, 0, 0.25); border-radius: 2px; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), inset 0 1px 2px rgba(255, 255, 255, 0.75); diff --git a/modules/smalltalk/dist/smalltalk.min.css b/modules/smalltalk/dist/smalltalk.min.css index 16376cf0..82c4ed84 100644 --- a/modules/smalltalk/dist/smalltalk.min.css +++ b/modules/smalltalk/dist/smalltalk.min.css @@ -1 +1 @@ -.smalltalk{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-transition:.2s opacity;transition:.2s opacity;bottom:0;left:0;overflow:auto;padding:20px;position:fixed;right:0;top:0;z-index:100}.smalltalk .page .content-area,.smalltalk .page header{overflow:hidden;text-overflow:ellipsis;max-width:500px}.smalltalk+.smalltalk{-webkit-transition:ease 1s;transition:ease 1s;display:none}.smalltalk .page{border-radius:3px;background:#fff;box-shadow:0 4px 23px 5px rgba(0,0,0,.2),0 2px 6px rgba(0,0,0,.15);color:#333;min-width:400px;padding:0;position:relative;z-index:0}@media only screen and (max-width:500px){.smalltalk .page{min-width:0}}.smalltalk .page>.close-button{background-image:url(../img/IDR_CLOSE_DIALOG.png);background-position:center;background-repeat:no-repeat;height:14px;position:absolute;right:7px;top:7px;width:14px;z-index:1}.smalltalk .page>.close-button:hover{background-image:url(../img/IDR_CLOSE_DIALOG_H.png)}.smalltalk .page header{white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#333;font-size:120%;font-weight:700;margin:0;padding:14px 17px;text-shadow:#fff 0 1px 2px}.smalltalk .page .content-area{padding:6px 17px;position:relative}.smalltalk .page .action-area{padding:14px 17px}.smalltalk .page .button-strip{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.smalltalk .page .button-strip>button{margin-left:10px}.smalltalk button:enabled:active{background-image:-webkit-linear-gradient(#e7e7e7,#e7e7e7 38%,#d7d7d7);background-image:linear-gradient(#e7e7e7,#e7e7e7 38%,#d7d7d7);box-shadow:none;text-shadow:none}.smalltalk .smalltalk,.smalltalk button{min-height:2em;min-width:4em}.smalltalk button::-moz-focus-inner{border:0}.smalltalk button{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:-webkit-linear-gradient(#ededed,#ededed 38%,#dedede);background-image:linear-gradient(#ededed,#ededed 38%,#dedede);border:1px solid #000;border:1px solid rgba(0,0,0,.25);border-radius:2px;box-shadow:0 1px 0 rgba(0,0,0,.08),inset 0 1px 2px rgba(255,255,255,.75);color:#444;font:inherit;margin:0 1px 0 0;text-shadow:0 1px 0 #f0f0f0}.smalltalk button:enabled:focus,.smalltalk input:enabled:focus{-webkit-transition:border-color .2s;transition:border-color .2s;border-color:#4d90fe;outline:0}.smalltalk input{width:100%;border:1px solid #bfbfbf;border-radius:2px;box-sizing:border-box;color:#444;font:inherit;margin:0;min-height:2em;padding:3px;outline:0}button{font-family:Ubuntu,Arial,sans-serif} +.smalltalk{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-transition:.2s opacity;transition:.2s opacity;bottom:0;left:0;overflow:auto;padding:20px;position:fixed;right:0;top:0;z-index:100}.smalltalk .page .content-area,.smalltalk .page header{overflow:hidden;text-overflow:ellipsis;max-width:500px}.smalltalk+.smalltalk{-webkit-transition:ease 1s;transition:ease 1s;display:none}.smalltalk .page{border-radius:3px;background:#fff;box-shadow:0 4px 23px 5px rgba(0,0,0,.2),0 2px 6px rgba(0,0,0,.15);color:#333;min-width:400px;padding:0;position:relative;z-index:0}@media only screen and (max-width:500px){.smalltalk .page{min-width:0}}.smalltalk .page>.close-button{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAQAAAC1QeVaAAAAUklEQVR4XqXPYQrAIAhAYW/gXd8NJxTopVqsGEhtf+L9/ERU2k/HSMFQpKcYJeNFI9Be0LCMij8cYyjj5EHIivGBkwLfrbX3IF8PqumVmnDpEG+eDsKibPG2JwAAAABJRU5ErkJggg==);background-position:center;background-repeat:no-repeat;height:14px;position:absolute;right:7px;top:7px;width:14px;z-index:1}.smalltalk .page>.close-button:hover{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAQAAAC1QeVaAAAAnUlEQVR4XoWQQQ6CQAxFewjkJkMCyXgJPMk7AiYczyBeZEAX6AKctGIaN+bt+trk9wtGQc/IkhnoKGxqqiWxOSZalapWFZ6VrIUDExsN0a5JRBq9LoVOR0eEQMoEhKizXhhsn0p1sCWVo7CwOf1RytPL8CPvwuBUoHL6ugeK30CVD1TqK7V/hdpe+VNChhOzV8xWny/+xosHF8578W/Hmc1OOC3wmwAAAABJRU5ErkJggg==)}.smalltalk .page header{white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#333;font-size:120%;font-weight:700;margin:0;padding:14px 17px;text-shadow:#fff 0 1px 2px}.smalltalk .page .content-area{padding:6px 17px;position:relative}.smalltalk .page .action-area{padding:14px 17px}.smalltalk .page .button-strip{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.smalltalk .page .button-strip>button{margin-left:10px}.smalltalk button:enabled:active{background-image:-webkit-linear-gradient(#e7e7e7,#e7e7e7 38%,#d7d7d7);background-image:linear-gradient(#e7e7e7,#e7e7e7 38%,#d7d7d7);box-shadow:none;text-shadow:none}.smalltalk .smalltalk,.smalltalk button{min-height:2em;min-width:4em}.smalltalk button::-moz-focus-inner{border:0}.smalltalk button{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:-webkit-linear-gradient(#ededed,#ededed 38%,#dedede);background-image:linear-gradient(#ededed,#ededed 38%,#dedede);border:1px solid rgba(0,0,0,.25);border-radius:2px;box-shadow:0 1px 0 rgba(0,0,0,.08),inset 0 1px 2px rgba(255,255,255,.75);color:#444;font:inherit;margin:0 1px 0 0;text-shadow:0 1px 0 #f0f0f0}.smalltalk button:enabled:focus,.smalltalk input:enabled:focus{-webkit-transition:border-color .2s;transition:border-color .2s;border-color:#4d90fe;outline:0}.smalltalk input{width:100%;border:1px solid #bfbfbf;border-radius:2px;box-sizing:border-box;color:#444;font:inherit;margin:0;min-height:2em;padding:3px;outline:0}button{font-family:Ubuntu,Arial,sans-serif} diff --git a/modules/smalltalk/dist/smalltalk.min.js b/modules/smalltalk/dist/smalltalk.min.js index dceeeb44..99c89074 100644 --- a/modules/smalltalk/dist/smalltalk.min.js +++ b/modules/smalltalk/dist/smalltalk.min.js @@ -1 +1 @@ -!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.smalltalk=n()}}(function(){return function n(e,t,r){function o(u,i){if(!t[u]){if(!e[u]){var c="function"==typeof require&&require;if(!i&&c)return c(u,!0);if(a)return a(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var l=t[u]={exports:{}};e[u][0].call(l.exports,function(n){var t=e[u][1][n];return o(t?t:n)},l,l.exports,n,e,t,r)}return t[u].exports}for(var a="function"==typeof require&&require,u=0;u\n
\n
'+n+'
\n
\n '+e+"\n "+t+'\n
\n
\n
'+r.map(function(n,e){return""}).join("")+"\n
\n
\n "}function o(n,e,t,o,u){var i=void 0,c=void 0,s=document.createElement("div"),p=["cancel","close","ok"],v=new Promise(function(n,e){var t=u&&!u.cancel,r=function(){};i=n,c=e,t&&(c=r)}),m=r(n,e,t,o);return s.innerHTML=m,s.className="smalltalk",document.body.appendChild(s),l(s,["ok","input"]).forEach(function(n){return n.focus()}),l(s,["input"]).forEach(function(n){n.setSelectionRange(0,t.length)}),d("click",s,p,function(n){return f(n.target,s,i,c)}),["click","contextmenu"].forEach(function(n){return s.addEventListener(n,function(){return l(s,["ok","input"]).forEach(function(n){return n.focus()})})}),s.addEventListener("keydown",a(s,i,c)),v}function a(n,e,t){return function(r){var o={ENTER:13,ESC:27,TAB:9,LEFT:37,UP:38,RIGHT:39,DOWN:40},a=r.keyCode,d=r.target,s=["ok","cancel","input"],p=l(n,s).map(function(n){return u(n)}),m=void 0;switch(a){case o.ENTER:f(d,n,e,t),r.preventDefault();break;case o.ESC:v(),t();break;case o.TAB:r.shiftKey&&c(n,p),c(n,p),r.preventDefault();break;default:m=["left","right","up","down"].some(function(n){return a===o[n.toUpperCase()]}),m&&i(n,p)}r.stopPropagation()}}function u(n){return n.getAttribute("data-name").replace("js-","")}function i(n,e){var t="",r=document.activeElement,o=u(r),a=/ok|cancel/.test(o),i=e.length-1;"input"!==o&&i&&a&&(t="cancel"===o?"ok":"cancel",l(n,[t]).forEach(function(n){n.focus()}))}function c(n,e){var t=document.activeElement,r=u(t),o=e.length-1,a=e.indexOf(r);a===o?a=0:a1?e-1:0),r=1;r';return o(n,e,u,E,r)},t.confirm=function(n,e,t){return o(n,e,"",E,t)}},{}]},{},["smalltalk"])("smalltalk")}); +!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.smalltalk=n()}}(function(){return function n(e,t,r){function o(u,i){if(!t[u]){if(!e[u]){var c="function"==typeof require&&require;if(!i&&c)return c(u,!0);if(a)return a(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var l=t[u]={exports:{}};e[u][0].call(l.exports,function(n){var t=e[u][1][n];return o(t?t:n)},l,l.exports,n,e,t,r)}return t[u].exports}for(var a="function"==typeof require&&require,u=0;u\n
\n
'+n+'
\n
\n '+e+"\n "+t+'\n
\n
\n
'+r.map(function(n,e){return""}).join("")+"\n
\n
\n "}function o(n,e,t,o,u){var i=void 0,c=void 0,s=document.createElement("div"),p=["cancel","close","ok"],v=new Promise(function(n,e){var t=u&&!u.cancel,r=function(){};i=n,c=t?r:e}),m=r(n,e,t,o);return s.innerHTML=m,s.className="smalltalk",document.body.appendChild(s),l(s,["ok","input"]).forEach(function(n){return n.focus()}),l(s,["input"]).forEach(function(n){n.setSelectionRange(0,t.length)}),d("click",s,p,function(n){return f(n.target,s,i,c)}),["click","contextmenu"].forEach(function(n){return s.addEventListener(n,function(){return l(s,["ok","input"]).forEach(function(n){return n.focus()})})}),s.addEventListener("keydown",a(s,i,c)),v}function a(n,e,t){return function(r){var o={ENTER:13,ESC:27,TAB:9,LEFT:37,UP:38,RIGHT:39,DOWN:40},a=r.keyCode,d=r.target,s=["ok","cancel","input"],p=l(n,s).map(function(n){return u(n)}),m=void 0;switch(a){case o.ENTER:f(d,n,e,t),r.preventDefault();break;case o.ESC:v(),t();break;case o.TAB:r.shiftKey&&c(n,p),c(n,p),r.preventDefault();break;default:m=["left","right","up","down"].some(function(n){return a===o[n.toUpperCase()]}),m&&i(n,p)}r.stopPropagation()}}function u(n){return n.getAttribute("data-name").replace("js-","")}function i(n,e){var t="",r=document.activeElement,o=u(r),a=/ok|cancel/.test(o),i=e.length-1;"input"!==o&&i&&a&&(t="cancel"===o?"ok":"cancel",l(n,[t]).forEach(function(n){n.focus()}))}function c(n,e){var t=document.activeElement,r=u(t),o=e.length-1,a=e.indexOf(r);a===o?a=0:a1?e-1:0),r=1;r';return o(n,e,u,E,r)},t.confirm=function(n,e,t){return o(n,e,"",E,t)}},{}]},{},["smalltalk"])("smalltalk")}); diff --git a/modules/smalltalk/dist/smalltalk.native.poly.min.js b/modules/smalltalk/dist/smalltalk.native.poly.min.js index 475310d9..004e08de 100644 --- a/modules/smalltalk/dist/smalltalk.native.poly.min.js +++ b/modules/smalltalk/dist/smalltalk.native.poly.min.js @@ -1 +1 @@ -!function(t){function e(){}function n(t,e){return function(){t.apply(e,arguments)}}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],s(t,this)}function r(t,e){for(;3===t._state;)t=t._value;return 0===t._state?void t._deferreds.push(e):(t._handled=!0,void a(function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null===n)return void(1===t._state?i:f)(e.promise,t._value);var o;try{o=n(t._value)}catch(r){return void f(e.promise,r)}i(e.promise,o)}))}function i(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var r=e.then;if(e instanceof o)return t._state=3,t._value=e,void u(t);if("function"==typeof r)return void s(n(r,e),t)}t._state=1,t._value=e,u(t)}catch(i){f(t,i)}}function f(t,e){t._state=2,t._value=e,u(t)}function u(t){2===t._state&&0===t._deferreds.length&&a(function(){t._handled||d(t._value)});for(var e=0,n=t._deferreds.length;n>e;e++)r(t,t._deferreds[e]);t._deferreds=null}function c(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function s(t,e){var n=!1;try{t(function(t){n||(n=!0,i(e,t))},function(t){n||(n=!0,f(e,t))})}catch(o){if(n)return;n=!0,f(e,o)}}var l=setTimeout,a="function"==typeof setImmediate&&setImmediate||function(t){l(t,0)},d=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};o.prototype["catch"]=function(t){return this.then(null,t)},o.prototype.then=function(t,n){var o=new this.constructor(e);return r(this,new c(t,n,o)),o},o.all=function(t){var e=Array.prototype.slice.call(t);return new o(function(t,n){function o(i,f){try{if(f&&("object"==typeof f||"function"==typeof f)){var u=f.then;if("function"==typeof u)return void u.call(f,function(t){o(i,t)},n)}e[i]=f,0===--r&&t(e)}catch(c){n(c)}}if(0===e.length)return t([]);for(var r=e.length,i=0;io;o++)t[o].then(e,n)})},o._setImmediateFn=function(t){a=t},o._setUnhandledRejectionFn=function(t){d=t},"undefined"!=typeof module&&module.exports?module.exports=o:t.Promise||(t.Promise=o)}(this);!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.smalltalk=e()}}(function(){return function e(n,r,t){function o(i,u){if(!r[i]){if(!n[i]){var l="function"==typeof require&&require;if(!u&&l)return l(i,!0);if(f)return f(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var c=r[i]={exports:{}};n[i][0].call(c.exports,function(e){var r=n[i][1][e];return o(r?r:e)},c,c.exports,e,n,r,t)}return r[i].exports}for(var f="function"==typeof require&&require,i=0;ie;e++)r(t,t._deferreds[e]);t._deferreds=null}function c(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function s(t,e){var n=!1;try{t(function(t){n||(n=!0,i(e,t))},function(t){n||(n=!0,f(e,t))})}catch(o){if(n)return;n=!0,f(e,o)}}var l=setTimeout,a="function"==typeof setImmediate&&setImmediate||function(t){l(t,0)},d=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};o.prototype["catch"]=function(t){return this.then(null,t)},o.prototype.then=function(t,n){var o=new this.constructor(e);return r(this,new c(t,n,o)),o},o.all=function(t){var e=Array.prototype.slice.call(t);return new o(function(t,n){function o(i,f){try{if(f&&("object"==typeof f||"function"==typeof f)){var u=f.then;if("function"==typeof u)return void u.call(f,function(t){o(i,t)},n)}e[i]=f,0===--r&&t(e)}catch(c){n(c)}}if(0===e.length)return t([]);for(var r=e.length,i=0;io;o++)t[o].then(e,n)})},o._setImmediateFn=function(t){a=t},o._setUnhandledRejectionFn=function(t){d=t},"undefined"!=typeof module&&module.exports?module.exports=o:t.Promise||(t.Promise=o)}(this);!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.smalltalk=n()}}(function(){return function n(e,t,r){function o(u,i){if(!t[u]){if(!e[u]){var c="function"==typeof require&&require;if(!i&&c)return c(u,!0);if(a)return a(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var l=t[u]={exports:{}};e[u][0].call(l.exports,function(n){var t=e[u][1][n];return o(t?t:n)},l,l.exports,n,e,t,r)}return t[u].exports}for(var a="function"==typeof require&&require,u=0;u\n
\n
'+n+'
\n
\n '+e+"\n "+t+'\n
\n
\n
'+r.map(function(n,e){return""}).join("")+"\n
\n
\n "}function o(n,e,t,o,u){var i=void 0,c=void 0,s=document.createElement("div"),p=["cancel","close","ok"],v=new Promise(function(n,e){var t=u&&!u.cancel,r=function(){};i=n,c=e,t&&(c=r)}),m=r(n,e,t,o);return s.innerHTML=m,s.className="smalltalk",document.body.appendChild(s),l(s,["ok","input"]).forEach(function(n){return n.focus()}),l(s,["input"]).forEach(function(n){n.setSelectionRange(0,t.length)}),d("click",s,p,function(n){return f(n.target,s,i,c)}),["click","contextmenu"].forEach(function(n){return s.addEventListener(n,function(){return l(s,["ok","input"]).forEach(function(n){return n.focus()})})}),s.addEventListener("keydown",a(s,i,c)),v}function a(n,e,t){return function(r){var o={ENTER:13,ESC:27,TAB:9,LEFT:37,UP:38,RIGHT:39,DOWN:40},a=r.keyCode,d=r.target,s=["ok","cancel","input"],p=l(n,s).map(function(n){return u(n)}),m=void 0;switch(a){case o.ENTER:f(d,n,e,t),r.preventDefault();break;case o.ESC:v(),t();break;case o.TAB:r.shiftKey&&c(n,p),c(n,p),r.preventDefault();break;default:m=["left","right","up","down"].some(function(n){return a===o[n.toUpperCase()]}),m&&i(n,p)}r.stopPropagation()}}function u(n){return n.getAttribute("data-name").replace("js-","")}function i(n,e){var t="",r=document.activeElement,o=u(r),a=/ok|cancel/.test(o),i=e.length-1;"input"!==o&&i&&a&&(t="cancel"===o?"ok":"cancel",l(n,[t]).forEach(function(n){n.focus()}))}function c(n,e){var t=document.activeElement,r=u(t),o=e.length-1,a=e.indexOf(r);a===o?a=0:a1?e-1:0),r=1;r';return o(n,e,u,E,r)},t.confirm=function(n,e,t){return o(n,e,"",E,t)}},{}]},{},["smalltalk"])("smalltalk")}); +!function(e){function n(){}function t(e,n){return function(){e.apply(n,arguments)}}function o(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],s(e,this)}function i(e,n){for(;3===e._state;)e=e._value;return 0===e._state?void e._deferreds.push(n):(e._handled=!0,void o._immediateFn(function(){var t=1===e._state?n.onFulfilled:n.onRejected;if(null===t)return void(1===e._state?r:u)(n.promise,e._value);var o;try{o=t(e._value)}catch(i){return void u(n.promise,i)}r(n.promise,o)}))}function r(e,n){try{if(n===e)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var i=n.then;if(n instanceof o)return e._state=3,e._value=n,void f(e);if("function"==typeof i)return void s(t(i,n),e)}e._state=1,e._value=n,f(e)}catch(r){u(e,r)}}function u(e,n){e._state=2,e._value=n,f(e)}function f(e){2===e._state&&0===e._deferreds.length&&o._immediateFn(function(){e._handled||o._unhandledRejectionFn(e._value)});for(var n=0,t=e._deferreds.length;n\n
\n
'+n+'
\n
\n '+e+"\n "+t+'\n
\n
\n
'+r.map(function(n,e){return""}).join("")+"\n
\n
\n "}function o(n,e,t,o,u){var i=void 0,c=void 0,s=document.createElement("div"),p=["cancel","close","ok"],v=new Promise(function(n,e){var t=u&&!u.cancel,r=function(){};i=n,c=t?r:e}),m=r(n,e,t,o);return s.innerHTML=m,s.className="smalltalk",document.body.appendChild(s),l(s,["ok","input"]).forEach(function(n){return n.focus()}),l(s,["input"]).forEach(function(n){n.setSelectionRange(0,t.length)}),d("click",s,p,function(n){return f(n.target,s,i,c)}),["click","contextmenu"].forEach(function(n){return s.addEventListener(n,function(){return l(s,["ok","input"]).forEach(function(n){return n.focus()})})}),s.addEventListener("keydown",a(s,i,c)),v}function a(n,e,t){return function(r){var o={ENTER:13,ESC:27,TAB:9,LEFT:37,UP:38,RIGHT:39,DOWN:40},a=r.keyCode,d=r.target,s=["ok","cancel","input"],p=l(n,s).map(function(n){return u(n)}),m=void 0;switch(a){case o.ENTER:f(d,n,e,t),r.preventDefault();break;case o.ESC:v(),t();break;case o.TAB:r.shiftKey&&c(n,p),c(n,p),r.preventDefault();break;default:m=["left","right","up","down"].some(function(n){return a===o[n.toUpperCase()]}),m&&i(n,p)}r.stopPropagation()}}function u(n){return n.getAttribute("data-name").replace("js-","")}function i(n,e){var t="",r=document.activeElement,o=u(r),a=/ok|cancel/.test(o),i=e.length-1;"input"!==o&&i&&a&&(t="cancel"===o?"ok":"cancel",l(n,[t]).forEach(function(n){n.focus()}))}function c(n,e){var t=document.activeElement,r=u(t),o=e.length-1,a=e.indexOf(r);a===o?a=0:a1?e-1:0),r=1;r';return o(n,e,u,E,r)},t.confirm=function(n,e,t){return o(n,e,"",E,t)}},{}]},{},["smalltalk"])("smalltalk")}); diff --git a/modules/smalltalk/lib/smalltalk.js b/modules/smalltalk/lib/smalltalk.js index 4b7ecf84..ec9fa937 100644 --- a/modules/smalltalk/lib/smalltalk.js +++ b/modules/smalltalk/lib/smalltalk.js @@ -44,27 +44,24 @@ function getTemplate(title, msg, value, buttons) { function showDialog(title, msg, value, buttons, options) { let ok, cancel; - const dialog = document.createElement('div'), - - closeButtons = [ - 'cancel', - 'close', - 'ok' - ], - - promise = new Promise((resolve, reject) => { - const noCancel = options && !options.cancel; - const empty = () => {}; - - ok = resolve; - cancel = reject; - - if (noCancel) - cancel = empty; - }), - - tmpl = getTemplate(title, msg, value, buttons); + + const dialog = document.createElement('div'); + const closeButtons = [ + 'cancel', + 'close', + 'ok' + ]; + + const promise = new Promise((resolve, reject) => { + const noCancel = options && !options.cancel; + const empty = () => {}; + ok = resolve; + cancel = noCancel ? empty : reject; + }); + + const tmpl = getTemplate(title, msg, value, buttons); + dialog.innerHTML = tmpl; dialog.className = 'smalltalk'; diff --git a/modules/smalltalk/package.json b/modules/smalltalk/package.json index 32395878..1b282916 100644 --- a/modules/smalltalk/package.json +++ b/modules/smalltalk/package.json @@ -1,6 +1,6 @@ { "name": "smalltalk", - "version": "2.1.2", + "version": "2.1.3", "description": "Promise-based Alert, Confirm and Prompt replacement", "homepage": "http://github.com/coderaiser/smalltalk", "repository": { @@ -71,14 +71,14 @@ "jshint": "^2.8.0", "minify": "^2.0.0", "nodemon": "^1.9.2", - "nyc": "^7.0.0", + "nyc": "^8.1.0", "postcss-cli": "^2.5.2", "promise-polyfill": "^6.0.0", "redrun": "^5.0.1", "rimraf": "^2.5.3", "sinon": "^1.17.4", "stylelint": "^7.0.2", - "stylelint-config-standard": "^12.0.0", + "stylelint-config-standard": "^13.0.0", "systemjs": "^0.19.31", "tape": "^4.6.0" }