-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Add Annotations bundling changes back (#95)
- Reverts the commit (176ad13) which reverted the annotations bundling changes - No longer emit extra 'load' event on 'textlayerrendered' - Replacing fileVersionID with fileVersionId (same with fileID)
- Loading branch information
Showing
32 changed files
with
941 additions
and
892 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import DocAnnotator from './doc/DocAnnotator'; | ||
import ImageAnnotator from './image/ImageAnnotator'; | ||
|
||
const ANNOTATORS = [ | ||
{ | ||
NAME: 'Document', | ||
CONSTRUCTOR: DocAnnotator, | ||
VIEWER: ['Document', 'Presentation'], | ||
TYPE: ['point', 'highlight'] | ||
}, | ||
{ | ||
NAME: 'Image', | ||
CONSTRUCTOR: ImageAnnotator, | ||
VIEWER: ['Image'], | ||
TYPE: ['point'] | ||
} | ||
]; | ||
|
||
class BoxAnnotations { | ||
|
||
/** | ||
* [constructor] | ||
* | ||
* @return {BoxAnnotations} BoxAnnotations instance | ||
*/ | ||
constructor() { | ||
this.annotators = ANNOTATORS; | ||
} | ||
|
||
/** | ||
* Returns the available annotators | ||
* | ||
* @return {Array} List of supported annotators | ||
*/ | ||
getAnnotators() { | ||
return Array.isArray(this.annotators) ? this.annotators : []; | ||
} | ||
|
||
/** | ||
* Chooses a annotator based on file extension. | ||
* | ||
* @param {Object} file - Box file | ||
* @param {Array} [disabledAnnotators] - List of disabled annotators | ||
* @return {Object} The annotator to use | ||
*/ | ||
determineAnnotator(viewer, disabledAnnotators = []) { | ||
return this.annotators.find((annotator) => | ||
!(disabledAnnotators.includes(annotator.NAME)) && annotator.VIEWER.includes(viewer) | ||
); | ||
} | ||
} | ||
|
||
global.BoxAnnotations = BoxAnnotations; | ||
export default BoxAnnotations; |
Oops, something went wrong.