mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-25 14:50:29 +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';
|
PDFJS.workerSrc = '{{MEDIA_URL}}js/pdf.worker.js';
|
||||||
$('#file-view').html('<div id="pdf"><span class="loading-icon loading-tip"></span></div>');
|
$('#file-view').html('<div id="pdf"><span class="loading-icon loading-tip"></span></div>');
|
||||||
PDFJS.getDocument("{{ raw_path|escapejs }}").then(function(pdf) {
|
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');
|
var $loadingTip = $('#pdf .loading-tip');
|
||||||
|
|
||||||
// show at most 50 pages
|
// show at most 50 pages
|
||||||
|
@@ -63,6 +63,10 @@ OfficePreviewer.prototype.check_page_status = function() {
|
|||||||
cache: false,
|
cache: false,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function(data) {
|
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'];
|
var status = data['status'];
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 'PROCESSING':
|
case 'PROCESSING':
|
||||||
|
@@ -30,6 +30,10 @@ try {
|
|||||||
PDFJS.workerSrc = '{{MEDIA_URL}}js/pdf.worker.js';
|
PDFJS.workerSrc = '{{MEDIA_URL}}js/pdf.worker.js';
|
||||||
$('#file-view').html('<div id="pdf"><span class="loading-icon loading-tip"></span></div>');
|
$('#file-view').html('<div id="pdf"><span class="loading-icon loading-tip"></span></div>');
|
||||||
PDFJS.getDocument("{{ raw_path|escapejs }}").then(function(pdf) {
|
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');
|
var $loadingTip = $('#pdf .loading-tip');
|
||||||
|
|
||||||
// show at most 50 pages
|
// show at most 50 pages
|
||||||
|
Reference in New Issue
Block a user