Please find the source code at
JSBIN
.
See my blog:
Code and Copy
.