You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A calref-specific extension to allow uploading files to files.calref directly through the chat. The user would most likely interface with this by drag-dropping a file into inputField, which would trigger a function similar to that used on files.calref (shown below). The bulk of this code is for rendering a progress bar, but strip that away and it should work perfectly well.
// Assuming #filesCalref has an <input type="file" name="pic" /> in it.(function(){varbar=$('#progress');$('#filesCalref').ajaxForm({beforeSend: function(){varpercentVal='0%';bar.addClass("active progress-bar-striped").removeClass("progress-bar-success progress-bar-danger");},uploadProgress: function(event,position,total,percentComplete){varpercentVal=percentComplete+'%';bar.css("width",percentVal);bar.html(percentVal);},success: function(){varpercentVal='100%';bar.css("width",percentVal);bar.html(percentVal);},complete: function(xhr){varpayload=$.parseJSON(xhr.responseText);if(payload[0]==1){bar.html("Complete");bar.removeClass("active progress-bar-striped progress-bar-danger").addClass("progress-bar-success");$("#regURL").val("https://c312441.ssl.cf1.rackcdn.com/files.calref/"+payload[1]).css("cursor","default");$("#lURL").val("https://c312441.ssl.cf1.rackcdn.com/files.calref/"+payload[1]).css("cursor","default");$("#urls").css("display","");}else{bar.html("Failure :(");bar.removeClass("active progress-bar-striped progress-bar-success").addClass("progress-bar-danger");}}});})();
A calref-specific extension to allow uploading files to files.calref directly through the chat. The user would most likely interface with this by drag-dropping a file into inputField, which would trigger a function similar to that used on files.calref (shown below). The bulk of this code is for rendering a progress bar, but strip that away and it should work perfectly well.
The above code would require a new submodule to https://github.com/malsup/form/
The text was updated successfully, but these errors were encountered: