I hereby claim:
- I am philfreo on github.
- I am philfreo (https://keybase.io/philfreo) on keybase.
- I have a public key whose fingerprint is 1F81 B578 6E87 8A29 B28B 4578 2DCA C2F7 8DAA 538B
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Log management / analysis
Log collection:
// Keep track of when a file is dragged onto the page. | |
// Adding a 'filedragging' class to <body> when one is. | |
(function() { | |
// Since dragenter & dragleave get fired for children elements, need some workaround | |
// to tell when file is started & stopped being dragged onto page. | |
// Ideas extracted from https://github.com/bensmithett/dragster | |
var klass = 'filedragging', | |
first = false, | |
second = false; | |
$(document).on({ |
// Safari, in Private Browsing Mode, looks like it supports localStorage but all calls to setItem | |
// throw QuotaExceededError. We're going to detect this and just silently drop any calls to setItem | |
// to avoid the entire page breaking, without having to do a check at each usage of Storage. | |
if (typeof localStorage === 'object') { | |
try { | |
localStorage.setItem('localStorage', 1); | |
localStorage.removeItem('localStorage'); | |
} catch (e) { | |
Storage.prototype._setItem = Storage.prototype.setItem; | |
Storage.prototype.setItem = function() {}; |
// Queue of Backbone.Model save()s so that we don't issue multiple POSTs while waiting for | |
// the first one to come back. The first save() will always POST and the second will always PUT now. | |
// https://github.com/documentcloud/backbone/issues/345 | |
// http://stackoverflow.com/a/6122530/137067 | |
// https://gist.github.com/1037984 | |
Backbone.Model.prototype._save = Backbone.Model.prototype.save; | |
Backbone.Model.prototype.save = function(attrs, options) { | |
// Queue up consecutive requests if the model is new and the initial | |
// POST request hasn't finished yet (xhr.readyState === 4 if the | |
// "request finished and response is ready"). |
The syntax below works currently (November 2014) however is not officially supported. It may stop working at any time without warning.
For a list of documented / support template tags and syntax, see: http://help.close.io/customer/portal/articles/823937-email-templates
// Make faux dropdowns show their new value, when it's changed. | |
$(document.body).on('change', '.faux-select-wrapper select', function(e) { | |
var select = $(e.target); | |
$.fn.fauxSelect.refresh(select); | |
}); | |
$.fn.fauxSelect = function(method) { | |
var select = this; | |
// if fauxSelect is being called again on an already-handled element, then just update the | |
// visible text |