mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-08 10:22:46 +00:00
Clean code
This commit is contained in:
@@ -52,18 +52,20 @@
|
|||||||
contentType: 'application/json; charset=utf-8',
|
contentType: 'application/json; charset=utf-8',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
var status = data[0]['status']
|
var status = data[0]['status']
|
||||||
if (status == 'QUEUED') {
|
if (status == 'QUEUED') {
|
||||||
$('#file-view').html('<p class="msg">' + '文档转换任务正在排队,请稍后...' + '</p>');
|
$('#file-view').html('<p class="msg">' + '文档转换任务正在排队,请稍后...' + '</p>');
|
||||||
tid = setTimeout(check_status, 1000); } else if (status == 'PROCESSING') {
|
tid = setTimeout(check_status, 1000);
|
||||||
$('#file-view').html('<p class="msg">' + '文档正在转换,请稍候...' + '</p>');
|
} else if (status == 'PROCESSING') {
|
||||||
tid = setTimeout(check_status, 1000); } else if (status == 'DONE') {
|
$('#file-view').html('<p class="msg">' + '文档正在转换,请稍候...' + '</p>');
|
||||||
$('#file-view').html('<p class="msg">' + '文档转换成功。正在打开...' + '</p>');
|
tid = setTimeout(check_status, 1000);
|
||||||
abortTimer();
|
} else if (status == 'DONE') {
|
||||||
create_session();
|
$('#file-view').html('<p class="msg">' + '文档转换成功。正在打开...' + '</p>');
|
||||||
} else {
|
abortTimer();
|
||||||
abortTimer();
|
create_session();
|
||||||
}
|
} else {
|
||||||
|
abortTimer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function(xhr, ajaxOptions, thrownError) {
|
error: function(xhr, ajaxOptions, thrownError) {
|
||||||
|
2
utils.py
2
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'),
|
'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'),
|
'Image': ('gif', 'jpeg', 'jpg', 'png'),
|
||||||
'SVG': ('svg',),
|
'SVG': ('svg',),
|
||||||
'Document': ('doc', 'docx', 'ppt', 'pptx'),
|
'Document': ('doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'),
|
||||||
}
|
}
|
||||||
|
|
||||||
def go_permission_error(request, msg=None):
|
def go_permission_error(request, msg=None):
|
||||||
|
1
views.py
1
views.py
@@ -884,7 +884,6 @@ def repo_view_file(request, repo_id):
|
|||||||
'protocol': http_or_https,
|
'protocol': http_or_https,
|
||||||
'domain': domain,
|
'domain': domain,
|
||||||
'file_shared_link': file_shared_link,
|
'file_shared_link': file_shared_link,
|
||||||
# 'doc_src': doc_src,
|
|
||||||
}, context_instance=RequestContext(request))
|
}, context_instance=RequestContext(request))
|
||||||
|
|
||||||
def repo_file_get(request, repo_id):
|
def repo_file_get(request, repo_id):
|
||||||
|
Reference in New Issue
Block a user