1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 23:48:47 +00:00

Merge pull request #695 from haiwen/IE8

Ie8
This commit is contained in:
Daniel Pan
2015-07-09 11:13:14 +08:00
3 changed files with 22 additions and 3 deletions

View File

@@ -25,7 +25,7 @@
<input type="file" name="file" multiple directory webkitdirectory /> <input type="file" name="file" multiple directory webkitdirectory />
</span> </span>
{% endif %} {% endif %}
<button type="reset" class="cancel vam"> <button type="reset" class="cancel vam" id="cancel-all">
<span class="icon-ban-circle"></span> <span class="icon-ban-circle"></span>
<span>{% trans "Cancel All" %}</span> <span>{% trans "Cancel All" %}</span>
</button> </button>
@@ -57,6 +57,15 @@
{% if not no_quota %} {% if not no_quota %}
{% upload_js %} {% upload_js %}
<script type="text/javascript" src="{{ MEDIA_URL }}js/jquery.fileupload.min.js"></script> <script type="text/javascript" src="{{ MEDIA_URL }}js/jquery.fileupload.min.js"></script>
<!--[if lt IE 8]>
<script type="text/javascript">
$('#add-file')
.html('<button type="button">{% trans "Add Files" %}</button><input type="file" name="file" multiple />')
.css({'border':0, 'padding':0})
.find('input').height($('#add-file').outerHeight());
$('#cancel-all .icon-ban-circle').remove();
</script>
<![endif]-->
<script type="text/javascript"> <script type="text/javascript">
// for file upload // for file upload
window.locale = { window.locale = {
@@ -193,7 +202,7 @@ if ('webkitdirectory' in $('input[type="file"]', $('#add-file'))[0]) {
form.fileupload( form.fileupload(
'option', 'option',
'redirect', 'redirect',
window.location.href.replace(/\/repo\/[-a-z0-9]{36}\/.*/, '{{MEDIA_URL}}cors/result.html?%s') window.location.href.replace(location.pathname, '{{MEDIA_URL}}cors/result.html?%s')
); );
</script> </script>
{% endif %} {% endif %}

View File

@@ -250,7 +250,7 @@ define([
}; };
var path_list = path.substr(1).split('/'); var path_list = path.substr(1).split('/');
var path_list_encoded = path_list.map(function(e) { return encodeURIComponent(e); }); var path_list_encoded = Common.encodePath(path.substr(1)).split('/');
if (path != '/') { if (path != '/') {
$.extend(obj, { $.extend(obj, {
path_list: path_list, path_list: path_list,

View File

@@ -302,9 +302,19 @@ define([
}, },
encodePath: function(path) { encodePath: function(path) {
// IE8 does not support 'map()'
/*
return path.split('/').map(function(e) { return path.split('/').map(function(e) {
return encodeURIComponent(e); return encodeURIComponent(e);
}).join('/'); }).join('/');
*/
var path_arr = path.split('/'),
path_arr_ = [];
for (var i = 0, len = path_arr.length; i < len; i++) {
path_arr_.push(encodeURIComponent(path_arr[i]));
}
return path_arr_.join('/');
}, },
closePopup: function(e, popup, popup_switch) { closePopup: function(e, popup, popup_switch) {