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
'use strict'; | |
var q = require('q'); | |
/** | |
* Constructs a function that proxies to promiseFactory | |
* limiting the count of promises that can run simultaneously. | |
* @param promiseFactory function that returns promises. | |
* @param limit how many promises are allowed to be running at the same time. | |
* @returns function that returns a promise that eventually proxies to promiseFactory. |
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
//lsauer.com , lo sauer 2013 | |
//JavaScript List of selected MIME types | |
//A comprehensive MIME List is available here: https://gist.github.com/lsauer/2838503 | |
var mimeTypes = | |
{ | |
'a' : 'application/octet-stream', | |
'ai' : 'application/postscript', | |
'aif' : 'audio/x-aiff', | |
'aifc' : 'audio/x-aiff', | |
'aiff' : 'audio/x-aiff', |
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
//http://www.scottklarr.com/topic/425/how-to-insert-text-into-a-textarea-where-the-cursor-is/ | |
function insertAtCaret(areaId,text) { | |
var txtarea = document.getElementById(areaId); | |
var scrollPos = txtarea.scrollTop; | |
var strPos = 0; | |
var br = ((txtarea.selectionStart || txtarea.selectionStart == '0') ? | |
"ff" : (document.selection ? "ie" : false ) ); | |
if (br == "ie") { | |
txtarea.focus(); | |
var range = document.selection.createRange(); |
NewerOlder