1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-25 06:33:48 +00:00

[pdf/doc] added tip for 'only 50 pages shown'

This commit is contained in:
llj
2016-08-12 12:05:37 +08:00
parent c4ffca620e
commit e69433e620
3 changed files with 12 additions and 0 deletions

View File

@@ -96,6 +96,10 @@ try {
PDFJS.workerSrc = '{{MEDIA_URL}}js/pdf.worker.js';
$('#file-view').html('<div id="pdf"><span class="loading-icon loading-tip"></span></div>');
PDFJS.getDocument("{{ raw_path|escapejs }}").then(function(pdf) {
if (pdf.numPages > 50) {
feedback("{% trans "This file has more than 50 pages, and only the first 50 will be shown here." %}", 'info');
}
var $loadingTip = $('#pdf .loading-tip');
// show at most 50 pages

View File

@@ -63,6 +63,10 @@ OfficePreviewer.prototype.check_page_status = function() {
cache: false,
dataType: 'json',
success: function(data) {
if (data.info.pages > data.info.final_pages) { // total pages > shown pages
feedback("{% trans "This file has more than 50 pages, and only the first 50 will be shown here." %}", 'info');
}
var status = data['status'];
switch (status) {
case 'PROCESSING':

View File

@@ -30,6 +30,10 @@ try {
PDFJS.workerSrc = '{{MEDIA_URL}}js/pdf.worker.js';
$('#file-view').html('<div id="pdf"><span class="loading-icon loading-tip"></span></div>');
PDFJS.getDocument("{{ raw_path|escapejs }}").then(function(pdf) {
if (pdf.numPages > 50) {
feedback("{% trans "This file has more than 50 pages, and only the first 50 will be shown here." %}", 'info');
}
var $loadingTip = $('#pdf .loading-tip');
// show at most 50 pages