-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c32033
commit b3d9a8e
Showing
5 changed files
with
41 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters