Skip to content

Instantly share code, notes, and snippets.

@revelation
Created August 14, 2009 18:00
Show Gist options
  • Save revelation/167993 to your computer and use it in GitHub Desktop.
Save revelation/167993 to your computer and use it in GitHub Desktop.
(function($) {
$.fn.video_uploader = function(options) {
YAHOO.widget.Uploader.SWFURL = "/uploader.swf";
return this.each(function() {
var video_uploader_div = $(this);
var video_uploader = new YAHOO.widget.Uploader(uploader_ui.attr('id'), '/images/uploadButton.png');
function onUploadError(event) {
var error_text = "There was an error with the upload: <br/>" + event.type + "<br/>" + event.status;
Revelation.videos.display_error(video_uploader_div, error_text);
};
video_uploader.addListener('uploadError', onUploadError);
});
}
})(jQuery);
if (typeof Revelation == "undefined" || !Revelation) {
var Revelation = {};
}
Revelation.video = {
display_error: function(error_div, error_message) {
error_div.append("<br/>" + error_message);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment