- Migrated from https://github.com/Yetangitu/owncloud-apps
- substantial bit rot accrued in 4 years of non-maintenance which made Reader unusable - Reader now works reliably on public pages - or at least it _Works For Me™_ - Refactored a substantial part of the code to comply to the "current" (ha ha) Nextcloud API - Dropped Owncloud compatibility for lack of a testing installation - Dropped IE (<11) support - Dropped compatibility with older (<20) Nextcloud versions - Dropped app-specific ajax code, now handled by SettingsController - Updated dependencies where applicable
This commit is contained in:
parent
16afbe45fe
commit
b190e180ef
137 changed files with 30984 additions and 2 deletions
59
vendor/pdfjs/controllers/annotationlayer_controller.js
vendored
Normal file
59
vendor/pdfjs/controllers/annotationlayer_controller.js
vendored
Normal file
|
@ -0,0 +1,59 @@
|
|||
PDFJS.Reader.AnnotationLayerController = function (options, reader) {
|
||||
|
||||
this.reader = reader;
|
||||
this.annotationDiv = options.annotationDiv;
|
||||
this.pdfPage = options.pdfPage;
|
||||
this.renderInteractiveForms = options.renderInteractiveForms;
|
||||
this.linkService = options.linkService;
|
||||
this.downloadManager = options.downloadManager;
|
||||
|
||||
this.div = null;
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
PDFJS.Reader.AnnotationLayerController.prototype.render = function (viewport, intent) {
|
||||
var self = this;
|
||||
var parameters = {
|
||||
intent: (intent === undefined ? 'display' : intent),
|
||||
};
|
||||
|
||||
this.pdfPage.getAnnotations(parameters).then(function (annotations) {
|
||||
viewport = viewport.clone({ dontFlip: true });
|
||||
parameters = {
|
||||
viewport: viewport,
|
||||
div: self.div,
|
||||
annotations: annotations,
|
||||
page: self.pdfPage,
|
||||
renderInteractiveForms: self.renderInteractiveForms,
|
||||
linkService: self.linkService,
|
||||
downloadManager: self.downloadManager,
|
||||
};
|
||||
|
||||
if (self.div) {
|
||||
// If an annotationLayer already exists, refresh its children's
|
||||
// transformation matrices.
|
||||
PDFJS.AnnotationLayer.update(parameters);
|
||||
} else {
|
||||
// Create an annotation layer div and render the annotations
|
||||
// if there is at least one annotation.
|
||||
if (annotations.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.div = self.annotationDiv;
|
||||
parameters.div = self.div;
|
||||
|
||||
PDFJS.AnnotationLayer.render(parameters);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
PDFJS.Reader.AnnotationLayerController.prototype.hide = function () {
|
||||
|
||||
if (!this.div) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.div.setAttribute('hidden', 'true');
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue