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
| /** | |
| * Converts a value to a string appropriate for entry into a CSV table. E.g., a string value will be surrounded by quotes. | |
| * @param {string|number|object} theValue | |
| * @param {string} sDelimiter The string delimiter. Defaults to a double quote (") if omitted. | |
| */ | |
| function toCsvValue(theValue, sDelimiter) { | |
| var t = typeof (theValue), output; | |
| if (typeof (sDelimiter) === "undefined" || sDelimiter === null) { | |
| sDelimiter = '"'; |
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
| /** | |
| * the HTML5 autofocus property can be finicky when it comes to dynamically loaded | |
| * templates and such with AngularJS. Use this simple directive to | |
| * tame this beast once and for all. | |
| * | |
| * Usage: | |
| * <input type="text" autofocus="true"> | |
| * | |
| * License: MIT | |
| */ |
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
| .filter("timeago", function () { | |
| //time: the time | |
| //local: compared to what time? default: now | |
| //raw: wheter you want in a format of "5 minutes ago", or "5 minutes" | |
| return function (time, local, raw) { | |
| if (!time) | |
| return "never"; | |
| if (!local) { | |
| local = Date.now(); |