webbuild.js: fixes

This commit is contained in:
Silvan Calarco 2016-07-03 19:58:41 +02:00
parent 81153435c1
commit 61960704b0
2 changed files with 21 additions and 15 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
WEBBUILD_HOST=mambanana WEBBUILD_HOST=mambanana
if [ "$QUERY_STRING" ]; then if [ "$QUERY_STRING" ]; then
# get (download, preserve content-type and content-disposition headrs) # get (download, preserve content-type and content-disposition headers)
contentdisposition=`curl -4 --connect-timeout 40 -sI "http://$WEBBUILD_HOST/cgi-bin/webbuild?$QUERY_STRING" -H "Content-Type: $CONTENT_TYPE" | grep Content-Disposition` contentdisposition=`curl -4 --connect-timeout 40 -sI "http://$WEBBUILD_HOST/cgi-bin/webbuild?$QUERY_STRING" -H "Content-Type: $CONTENT_TYPE" | grep Content-Disposition`
echo "\ echo "\
$contentdisposition $contentdisposition

View File

@ -186,7 +186,14 @@ function getDownload(request) {
jQuery.extend({ jQuery.extend({
handleError: function( s, xhr, status, e ) {
// If a local callback was specified, fire it
if ( s.error )
s.error( xhr, status, e );
// If we have some XML response text (e.g. from an AJAX call) then log it in the console
else if(xhr.responseText)
console.log(xhr.responseText);
},
createUploadIframe: function(id, uri) createUploadIframe: function(id, uri)
{ {
//create frame //create frame
@ -240,7 +247,7 @@ jQuery.extend({
ajaxFileUpload: function(s) { ajaxFileUpload: function(s) {
// TODO introduce global settings, allowing the client to modify them for all requests, not only timeout // TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
s = jQuery.extend({}, jQuery.ajaxSettings, s); s = jQuery.extend({}, jQuery.ajaxSettings, s);
var id = new Date().getTime() var id = new Date().getTime();
var form = $.createUploadForm(id, s.fileElementId, (typeof(s.data)=='undefined'?false:s.data)); var form = $.createUploadForm(id, s.fileElementId, (typeof(s.data)=='undefined'?false:s.data));
var io = $.createUploadIframe(id, s.secureuri); var io = $.createUploadIframe(id, s.secureuri);
var frameId = 'jUploadFrame' + id; var frameId = 'jUploadFrame' + id;
@ -265,7 +272,6 @@ jQuery.extend({
{ {
xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null; xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document; xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
}else if(io.contentDocument) }else if(io.contentDocument)
{ {
xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null; xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;