antonglv/custombuttons — pull request #8 by Infocatcher (2014-08-06 18:00:59+00:00)
Title: Add ability to run code as generator aka sleep() support

Added functions: sleep(), next().
Added "fn" argument (link to function itself) + fn.__generator (if available).

Usage examples:
```js
// Some code
yield sleep(2000); // Pause
alert("Done");
yield 0; // Prevent StopIteration exception
```
```js
yield setTimeout(function() {
fn.__generator.next(); // Continue execution
}, 1000);
alert("Done");
yield 0; // Prevent StopIteration exception
```
```js
yield setTimeout(function() { // Anything async
next(); // Continue execution
}, 1000);
alert("Done");
yield 0; // Prevent StopIteration exception
```