Skip to content

Commit

Permalink
Added demo upload server check.
Browse files Browse the repository at this point in the history
  • Loading branch information
blueimp committed Feb 9, 2012
1 parent 38a7a11 commit 6ff2650
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions js/main.js
Expand Up @@ -20,14 +20,16 @@ $(function () {

if (window.location.hostname === 'blueimp.github.com') {
// Demo settings:
$('#fileupload').prop(
'action',
'//jquery-file-upload.appspot.com'
);
$('#fileupload').fileupload('option', {
url: '//jquery-file-upload.appspot.com',
maxFileSize: 5000000,
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i
});
$.get('//jquery-file-upload.appspot.com').fail(function () {
$('<span class="alert alert-error"/>')
.text('Upload server currently unavailable - ' + new Date())
.appendTo('#fileupload');
});
} else {
// Load existing files:
$.getJSON($('#fileupload').prop('action'), function (files) {
Expand All @@ -37,7 +39,7 @@ $(function () {
template = fu._renderDownload(files)
.appendTo($('#fileupload .files'));
// Force reflow:
fu._reflow = fu._transition && template.length &&
fu._reflow = $.support.transition && template.length &&
template[0].offsetWidth;
template.addClass('in');
});
Expand Down

0 comments on commit 6ff2650

Please sign in to comment.