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
// grab your file object from a file input | |
$('#fileInput').change(function () { | |
sendFile(this.files[0]); | |
}); | |
// can also be from a drag-from-desktop drop | |
$('dropZone')[0].ondrop = function (e) { | |
e.preventDefault(); | |
sendFile(e.dataTransfer.files[0]); | |
}; |
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
define(['jquery'], function ($) { | |
var topics = {}, | |
topic = function (id) { | |
var fn = this.toString(), | |
args = [].slice.call(arguments, 1); | |
(topics[id] = topics[id] || $.Callbacks())[fn].apply(null, args); | |
}; | |
return { | |
pub: function () { topic.apply('fire', arguments); }, |
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
/* For modern browsers */ | |
.cf:before, | |
.cf:after { | |
content:""; | |
display:table; | |
} | |
.cf:after { | |
clear:both; | |
} |
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 ($, window, undefined) { | |
$(function () { | |
// your js code here | |
}); | |
})(jQuery, window); |