This file contains hidden or 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
| var isnode = (typeof module !== 'undefined' && module.exports); |
This file contains hidden or 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
| /*global define*/ | |
| define(function() { | |
| 'use strict'; | |
| /** | |
| * @module my/amd/path | |
| */ | |
| /** |
This file contains hidden or 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
| { | |
| /** | |
| * module prologue comment | |
| * | |
| * @module my/amd/path | |
| * | |
| * if private | |
| * @private | |
| */ |
This file contains hidden or 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
| /* | |
| Call pagerList with the page number and count. | |
| Alter pageLink to modify page link HTML. | |
| Alter the name, or remove the page link function that gets placed into the | |
| global namespace. Alternatively, implement its behaviour. |
This file contains hidden or 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
| // String format function | |
| String.prototype.format = function() { | |
| var args = arguments; | |
| return this.replace(/{(\d+)}/g, function(match, number) { | |
| return typeof args[number] != 'undefined' | |
| ? args[number] | |
| : match | |
| ; | |
| }); | |
| }; |
This file contains hidden or 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
| function asyncForEach(array, cb) { | |
| var queue = array.slice(); | |
| var out = []; | |
| function next() { | |
| if (queue.length > 0) { | |
| var item = queue.shift(); | |
| someAsyncFunc(item, function(o) { | |
| out.push(o); | |
| next(); | |
| }); |
This file contains hidden or 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
| //clamp(x,a,b) will return the value in the range [a,b] that's closest to x. With just two arguments, clip(x,a) will use the range [-a,a]. | |
| function clamp(x,a,b){return b===undefined?x>a?a:x<-a?-a:x:x>b?b:x<a?a:x} |
This file contains hidden or 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
| function objqstring (obj) { | |
| var a = [] | |
| for (var s in obj) { | |
| a.push(s + "=" + encodeURIComponent(JSON.stringify(obj[s]))) | |
| } | |
| return a.join("&") | |
| } | |
| function qstringobj (qstring) { | |
| var obj = {} |
This file contains hidden or 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
| window.open(canvas.toDataURL()) |
OlderNewer