mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-24 21:07:17 +00:00
[pdf/doc] added tip for 'only 50 pages shown'
This commit is contained in:
@@ -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
|
||||
|
@@ -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':
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user