+ {% if filetype == 'Text' or filetype == 'Image' or filetype == 'SVG' or filetype == 'Markdown' %}
+ {% endif %}
{% if not view_history and request.user.is_authenticated %}
@@ -104,9 +106,6 @@ $('#view-original, #download').click(function() {
window.open($(this).attr('data'));
});
{% if not view_history %}
-{% if filetype == 'PDF' %}
-$('#pdf-op-bar').append($('#history'));
-{% endif %}
$('#edit, #history').click(function() {
location.href = $(this).attr('data');
});
diff --git a/templates/snippets/repo_file_get.html b/templates/snippets/repo_file_get.html
index e78e6e4847..81d90a75a1 100644
--- a/templates/snippets/repo_file_get.html
+++ b/templates/snippets/repo_file_get.html
@@ -20,12 +20,10 @@
{% if err %}
$('#file-view').html('
{{ err }}
').addClass('file-view-tip');
{% endif %}
- $('#file-op').removeClass('hide');
{% endif %}
{% if filetype == 'Image' %}
$('#file-view').html('

').css({'text-align':'center', 'padding':'30px 0'});
- $('#file-op').removeClass('hide');
{% endif %}
{% if filetype == 'SVG' %}
@@ -34,7 +32,6 @@
} else {
$('#file-view').html('
');
}
- $('#file-op').removeClass('hide');
{% endif %}
{% if filetype == 'Document' %}
@@ -104,17 +101,15 @@ if (!$.browser.mozilla && !$.browser.safari) {
}
});
}
-$('#file-op').removeClass('hide');
{% endif %}
{% if filetype == 'PDF' %}
-$('#view-original').addClass('hide');
if (!$.browser.mozilla && !$.browser.safari) {
$('#file-view').html('
在线查看:请使用firefox 或 chrome。
').addClass('file-view-tip');
} else {
PDFJS.workerSrc = '{{MEDIA_URL}}js/pdf.js';
$('#file-view').html('
').css({'text-align':'center'});
- $('#pdf-op-bar').append($('#download'));
+ $('#pdf-op-bar').append($('#file-op').html());
var seahub_getPage = function (pdf, page_number) {
pdf.getPage(page_number).then(function(page) {
var scale = 1.5;
@@ -134,7 +129,7 @@ if (!$.browser.mozilla && !$.browser.safari) {
$('#page-nums').html(pdf.numPages);
$('#page-number').attr('max', pdf.numPages).css('width', String(pdf.numPages).length * 6 + 10);
seahub_getPage(pdf, 1);
- $('#pdf-loading').addClass('hide');
+ $('#file-op, #pdf-loading').addClass('hide');
$('#pdf-op-bar, #pdf-view').removeClass('vh');
$('#page-number').change(function() {
@@ -174,10 +169,8 @@ if (!$.browser.mozilla && !$.browser.safari) {
{% if err %}
$('#file-view').html('
{{ err }}
').addClass('file-view-tip');
{% endif %}
- $('#file-op').removeClass('hide');
{% endif %}
{% if filetype == 'Unknown' %}
$('#file-view').html('
该类型文件无法在线查看。
').addClass('file-view-tip');
- $('#file-op').removeClass('hide');
{% endif %}
diff --git a/templates/view_shared_file.html b/templates/view_shared_file.html
index a14f6d7f70..4c02668ae3 100644
--- a/templates/view_shared_file.html
+++ b/templates/view_shared_file.html
@@ -5,7 +5,7 @@
{{ file_name }}
共享者:{{ username }}