mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-01 15:23:05 +00:00
improved pdf, docu file view for ie
This commit is contained in:
parent
14874cb389
commit
02c47e1662
@ -118,6 +118,10 @@ if (!$.browser.mozilla && !$.browser.safari && !($.browser.msie && parseInt($.br
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!$.browser.mozilla && !$.browser.safari) {
|
||||
$('#file-view').html('<p>在线查看:请使用firefox 或 chrome。</p>');
|
||||
} else {
|
||||
$.ajax({
|
||||
url: '{{ SITE_ROOT }}crocodoc/upload/?raw_path={{ raw_path|urlencode }}',
|
||||
cache: false,
|
||||
@ -135,10 +139,11 @@ if (!$.browser.mozilla && !$.browser.safari && !($.browser.msie && parseInt($.br
|
||||
$('#file-view').html('<p class="error">' + jsonVal[0]['error'] + '</p>');
|
||||
}
|
||||
});
|
||||
}
|
||||
{% endif %}
|
||||
{% if filetype == 'PDF' %}
|
||||
if (!$.browser.mozilla && !$.browser.safari && !($.browser.msie && parseInt($.browser.version) > 8)) {
|
||||
$('#file-view').html('<p>在线查看:请使用firefox, chrome 或 IE 9。</p>');
|
||||
if (!$.browser.mozilla && !$.browser.safari) {
|
||||
$('#file-view').html('<p>在线查看:请使用firefox 或 chrome。</p>');
|
||||
} else {
|
||||
PDFJS.workerSrc = '{{MEDIA_URL}}js/pdf.js';
|
||||
$('#file-view').html('<div id="pdf"><img src="{{ MEDIA_URL }}pdf_full_view/images/loading-icon.gif" alt="加载中..." id="pdf-loading" style="margin-top:20px;" /><div id="pdf-op-bar" class="vh"><button id="prev">上一页</button><button id="next">下一页</button><span id="pdf-page"><label for="page-number">第</label> <input type="number" id="page-number" value="1" min="1"></input> / <span id="page-nums"></span> 页</span><button id="full-screen">全屏</button></div><canvas data="{{ raw_path }}" id="pdf-view" class="vh"></canvas></div>').css({'text-align':'center'});
|
||||
|
Loading…
Reference in New Issue
Block a user