forked from Wavyzz/dolibarr
Fix: add iframe transport for compatibility with all browser
This commit is contained in:
@@ -44,6 +44,8 @@ $(function () {
|
|||||||
|
|
||||||
// Options
|
// Options
|
||||||
$('#fileupload').fileupload('option', {
|
$('#fileupload').fileupload('option', {
|
||||||
|
// Enable iframe cross-domain access via redirect option
|
||||||
|
reidrect: window.location.href.replace(/\/[^\/]*$/,'<?php echo DOL_URL_ROOT; ?>/includes/jquery/plugins/fileupload/cors/result.html?%s'),
|
||||||
maxFileSize: '<?php echo $max_file_size; ?>'
|
maxFileSize: '<?php echo $max_file_size; ?>'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
20
htdocs/includes/jquery/plugins/fileupload/cors/result.html
Normal file
20
htdocs/includes/jquery/plugins/fileupload/cors/result.html
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<!--
|
||||||
|
/*
|
||||||
|
* jQuery Iframe Transport Plugin Redirect Page 2.0
|
||||||
|
* https://github.com/blueimp/jQuery-File-Upload
|
||||||
|
*
|
||||||
|
* Copyright 2010, Sebastian Tschan
|
||||||
|
* https://blueimp.net
|
||||||
|
*
|
||||||
|
* Licensed under the MIT license:
|
||||||
|
* http://www.opensource.org/licenses/MIT
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>jQuery Iframe Transport Plugin Redirect Page</title>
|
||||||
|
</head>
|
||||||
|
<body><script>document.body.innerHTML=decodeURIComponent(window.location.search.slice(1));</script></body>
|
||||||
|
</html>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* jQuery File Upload User Interface Plugin 6.9
|
* jQuery File Upload User Interface Plugin 6.9.1
|
||||||
* https://github.com/blueimp/jQuery-File-Upload
|
* https://github.com/blueimp/jQuery-File-Upload
|
||||||
*
|
*
|
||||||
* Copyright 2010, Sebastian Tschan
|
* Copyright 2010, Sebastian Tschan
|
||||||
@@ -530,8 +530,8 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
_forceReflow: function (node) {
|
_forceReflow: function (node) {
|
||||||
this._reflow = $.support.transition &&
|
return $.support.transition && node.length &&
|
||||||
node.length && node[0].offsetWidth;
|
node[0].offsetWidth;
|
||||||
},
|
},
|
||||||
|
|
||||||
_transition: function (node) {
|
_transition: function (node) {
|
||||||
|
|||||||
@@ -989,11 +989,13 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD))
|
if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD))
|
||||||
{
|
{
|
||||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/template/tmpl.min.js"></script>'."\n";
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/template/tmpl.min.js"></script>'."\n";
|
||||||
//print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.iframe-transport.js"></script>'."\n";
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.iframe-transport.js"></script>'."\n";
|
||||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload.js"></script>'."\n";
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload.js"></script>'."\n";
|
||||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload-fp.js"></script>'."\n";
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload-fp.js"></script>'."\n";
|
||||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload-ui.js"></script>'."\n";
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload-ui.js"></script>'."\n";
|
||||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload-jui.js"></script>'."\n";
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/jquery.fileupload-jui.js"></script>'."\n";
|
||||||
|
print '<!-- The XDomainRequest Transport is included for cross-domain file deletion for IE8+ -->'."\n";
|
||||||
|
'<!--[if gte IE 8]><script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/js/cors/jquery.xdr-transport.js"></script><![endif]-->'."\n";
|
||||||
}
|
}
|
||||||
// jQuery DataTables
|
// jQuery DataTables
|
||||||
if (! empty($conf->global->MAIN_USE_JQUERY_DATATABLES))
|
if (! empty($conf->global->MAIN_USE_JQUERY_DATATABLES))
|
||||||
|
|||||||
Reference in New Issue
Block a user