Skip to content

Commit

Permalink
chore(package) v1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Sep 29, 2015
1 parent 3c32033 commit b3d9a8e
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 45 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2015.09.29, v1.5.1

feature:
- (smalltalk) add es6 native


2015.09.28, v1.5.0

feature:
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "smalltalk",
"version": "1.5.0",
"version": "1.5.1",
"homepage": "https://github.com/coderaiser/smalltalk",
"authors": [
"coderaiser <mnemonic.enemy@gmail.com>"
Expand Down
2 changes: 1 addition & 1 deletion dist/smalltalk.native.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 32 additions & 42 deletions lib/smalltalk.native.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,44 @@
(function(global) {
'use strict';

(function (global) {
'use strict';

if (typeof module !== 'undefined' && module.exports)
module.exports = Smalltalk();
else
global.smalltalk = Smalltalk();



if (typeof module !== 'undefined' && module.exports) module.exports = Smalltalk();else global.smalltalk = Smalltalk();

function Smalltalk() {
if (!(this instanceof Smalltalk))
return new Smalltalk();

this.alert = function(title, message) {
var promise = new Promise(function(resolve) {
if (!(this instanceof Smalltalk)) return new Smalltalk();

this.alert = function (title, message) {
var promise = new Promise(function (resolve) {
alert(message);
resolve();
});

return promise;
};

this.prompt = function(title, message, value, options) {
var o = options,
promise = new Promise(function(resolve, reject) {
var noCancel = o && !o.cancel,
result = prompt(message, value);

if (result !== null)
resolve(result);
else if (!noCancel)
reject();
});


this.prompt = function (title, message, value, options) {
var o = options,
promise = new Promise(function (resolve, reject) {
var noCancel = o && !o.cancel,
result = prompt(message, value);

if (result !== null) resolve(result);else if (!noCancel) reject();
});

return promise;
};

this.confirm = function(title, message, options) {
var o = options,
noCancel = o && !o.noCancel,
promise = new Promise(function(resolve, reject) {
var is = confirm(message);

if (is)
resolve();
else if (!noCancel)
reject();
});


this.confirm = function (title, message, options) {
var o = options,
noCancel = o && !o.noCancel,
promise = new Promise(function (resolve, reject) {
var is = confirm(message);

if (is) resolve();else if (!noCancel) reject();
});

return promise;
};
}

})(this);
})(typeof window !== 'undefined' && window);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "smalltalk",
"version": "1.5.0",
"version": "1.5.1",
"description": "Promise-based Alert, Confirm and Prompt replacement",
"homepage": "http://github.com/coderaiser/smalltalk",
"repository": {
Expand Down

0 comments on commit b3d9a8e

Please sign in to comment.