Merge pull request #15339 from Snuffleupagus/enable-editor
[api-major] Enable editing by default
This commit is contained in:
commit
5e5aa9fb69
@ -156,7 +156,13 @@
|
|||||||
},
|
},
|
||||||
"annotationEditorMode": {
|
"annotationEditorMode": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"default": -1
|
"enum": [
|
||||||
|
-1,
|
||||||
|
0,
|
||||||
|
3,
|
||||||
|
15
|
||||||
|
],
|
||||||
|
"default": 0
|
||||||
},
|
},
|
||||||
"enablePermissions": {
|
"enablePermissions": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
|
@ -585,11 +585,12 @@ const PDFViewerApplication = {
|
|||||||
appConfig.annotationEditorParams,
|
appConfig.annotationEditorParams,
|
||||||
eventBus
|
eventBus
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
for (const element of [
|
for (const element of [
|
||||||
document.getElementById("editorModeButtons"),
|
document.getElementById("editorModeButtons"),
|
||||||
document.getElementById("editorModeSeparator"),
|
document.getElementById("editorModeSeparator"),
|
||||||
]) {
|
]) {
|
||||||
element.classList.remove("hidden");
|
element.hidden = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,11 +54,8 @@ const OptionKind = {
|
|||||||
*/
|
*/
|
||||||
const defaultOptions = {
|
const defaultOptions = {
|
||||||
annotationEditorMode: {
|
annotationEditorMode: {
|
||||||
/** @type {boolean} */
|
/** @type {number} */
|
||||||
value:
|
value: 0,
|
||||||
typeof PDFJSDev === "undefined" || PDFJSDev.test("!PRODUCTION || TESTING")
|
|
||||||
? 0
|
|
||||||
: -1,
|
|
||||||
kind: OptionKind.VIEWER + OptionKind.PREFERENCE,
|
kind: OptionKind.VIEWER + OptionKind.PREFERENCE,
|
||||||
},
|
},
|
||||||
annotationMode: {
|
annotationMode: {
|
||||||
|
@ -121,7 +121,7 @@ function isValidAnnotationEditorMode(mode) {
|
|||||||
* The default value is `AnnotationMode.ENABLE_FORMS`.
|
* The default value is `AnnotationMode.ENABLE_FORMS`.
|
||||||
* @property {number} [annotationEditorMode] - Enables the creation and editing
|
* @property {number} [annotationEditorMode] - Enables the creation and editing
|
||||||
* of new Annotations. The constants from {@link AnnotationEditorType} should
|
* of new Annotations. The constants from {@link AnnotationEditorType} should
|
||||||
* be used. The default value is `AnnotationEditorType.DISABLE`.
|
* be used. The default value is `AnnotationEditorType.NONE`.
|
||||||
* @property {string} [imageResourcesPath] - Path for image resources, mainly
|
* @property {string} [imageResourcesPath] - Path for image resources, mainly
|
||||||
* mainly for annotation icons. Include trailing slash.
|
* mainly for annotation icons. Include trailing slash.
|
||||||
* @property {boolean} [enablePrintAutoRotate] - Enables automatic rotation of
|
* @property {boolean} [enablePrintAutoRotate] - Enables automatic rotation of
|
||||||
@ -219,7 +219,7 @@ class PDFPageViewBuffer {
|
|||||||
class PDFViewer {
|
class PDFViewer {
|
||||||
#buffer = null;
|
#buffer = null;
|
||||||
|
|
||||||
#annotationEditorMode = AnnotationEditorType.DISABLE;
|
#annotationEditorMode = AnnotationEditorType.NONE;
|
||||||
|
|
||||||
#annotationEditorUIManager = null;
|
#annotationEditorUIManager = null;
|
||||||
|
|
||||||
@ -277,7 +277,7 @@ class PDFViewer {
|
|||||||
this.#annotationMode =
|
this.#annotationMode =
|
||||||
options.annotationMode ?? AnnotationMode.ENABLE_FORMS;
|
options.annotationMode ?? AnnotationMode.ENABLE_FORMS;
|
||||||
this.#annotationEditorMode =
|
this.#annotationEditorMode =
|
||||||
options.annotationEditorMode ?? AnnotationEditorType.DISABLE;
|
options.annotationEditorMode ?? AnnotationEditorType.NONE;
|
||||||
this.imageResourcesPath = options.imageResourcesPath || "";
|
this.imageResourcesPath = options.imageResourcesPath || "";
|
||||||
this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
|
this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
|
||||||
if (
|
if (
|
||||||
|
@ -316,7 +316,7 @@ See https://github.com/adobe-type-tools/cmap-resources
|
|||||||
|
|
||||||
<div class="verticalToolbarSeparator hiddenMediumView"></div>
|
<div class="verticalToolbarSeparator hiddenMediumView"></div>
|
||||||
|
|
||||||
<div id="editorModeButtons" class="splitToolbarButton toggled hidden" role="radiogroup">
|
<div id="editorModeButtons" class="splitToolbarButton toggled" role="radiogroup">
|
||||||
<button id="editorFreeText" class="toolbarButton" disabled="disabled" title="Text" role="radio" aria-checked="false" tabindex="34" data-l10n-id="editor_free_text2">
|
<button id="editorFreeText" class="toolbarButton" disabled="disabled" title="Text" role="radio" aria-checked="false" tabindex="34" data-l10n-id="editor_free_text2">
|
||||||
<span data-l10n-id="editor_free_text2_label">Text</span>
|
<span data-l10n-id="editor_free_text2_label">Text</span>
|
||||||
</button>
|
</button>
|
||||||
@ -325,8 +325,7 @@ See https://github.com/adobe-type-tools/cmap-resources
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Should be visible when the "editorModeButtons" are visible. -->
|
<div id="editorModeSeparator" class="verticalToolbarSeparator"></div>
|
||||||
<div id="editorModeSeparator" class="verticalToolbarSeparator hidden"></div>
|
|
||||||
|
|
||||||
<button id="secondaryToolbarToggle" class="toolbarButton" title="Tools" tabindex="48" data-l10n-id="tools" aria-expanded="false" aria-controls="secondaryToolbar">
|
<button id="secondaryToolbarToggle" class="toolbarButton" title="Tools" tabindex="48" data-l10n-id="tools" aria-expanded="false" aria-controls="secondaryToolbar">
|
||||||
<span data-l10n-id="tools_label">Tools</span>
|
<span data-l10n-id="tools_label">Tools</span>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user