diff --git a/templates/repo_file_get.html b/templates/repo_file_get.html index 9fe9b4437c..cbdb580220 100644 --- a/templates/repo_file_get.html +++ b/templates/repo_file_get.html @@ -52,18 +52,20 @@ contentType: 'application/json; charset=utf-8', success: function(data) { if (data.length > 0) { - var status = data[0]['status'] - if (status == 'QUEUED') { - $('#file-view').html('

' + '文档转换任务正在排队,请稍后...' + '

'); - tid = setTimeout(check_status, 1000); } else if (status == 'PROCESSING') { - $('#file-view').html('

' + '文档正在转换,请稍候...' + '

'); - tid = setTimeout(check_status, 1000); } else if (status == 'DONE') { - $('#file-view').html('

' + '文档转换成功。正在打开...' + '

'); - abortTimer(); - create_session(); - } else { - abortTimer(); - } + var status = data[0]['status'] + if (status == 'QUEUED') { + $('#file-view').html('

' + '文档转换任务正在排队,请稍后...' + '

'); + tid = setTimeout(check_status, 1000); + } else if (status == 'PROCESSING') { + $('#file-view').html('

' + '文档正在转换,请稍候...' + '

'); + tid = setTimeout(check_status, 1000); + } else if (status == 'DONE') { + $('#file-view').html('

' + '文档转换成功。正在打开...' + '

'); + abortTimer(); + create_session(); + } else { + abortTimer(); + } } }, error: function(xhr, ajaxOptions, thrownError) { diff --git a/utils.py b/utils.py index 2a09b1df6e..2ddc15cc5a 100644 --- a/utils.py +++ b/utils.py @@ -22,7 +22,7 @@ PREVIEW_FILEEXT = { 'Text': ('ac', 'am', 'bat', 'c', 'cc', 'cmake', 'cpp', 'css', 'diff', 'h', 'html', 'java', 'js', 'json', 'less', 'make', 'markdown', 'org', 'php', 'properties', 'py', 'rb', 'scala', 'script', 'sh', 'sql', 'txt','text', 'vi', 'vim'), 'Image': ('gif', 'jpeg', 'jpg', 'png'), 'SVG': ('svg',), - 'Document': ('doc', 'docx', 'ppt', 'pptx'), + 'Document': ('doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'), } def go_permission_error(request, msg=None): diff --git a/views.py b/views.py index a5b9df0d6c..1fe5fac2fd 100644 --- a/views.py +++ b/views.py @@ -884,7 +884,6 @@ def repo_view_file(request, repo_id): 'protocol': http_or_https, 'domain': domain, 'file_shared_link': file_shared_link, - # 'doc_src': doc_src, }, context_instance=RequestContext(request)) def repo_file_get(request, repo_id):