File tree 4 files changed +18
-1
lines changed
4 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 55
55
"type" : " boolean" ,
56
56
"default" : false
57
57
},
58
+ "altTextLearnMoreUrl" : {
59
+ "type" : " string" ,
60
+ "default" : " "
61
+ },
58
62
"enableUpdatedAddImage" : {
59
63
"type" : " boolean" ,
60
64
"default" : false
Original file line number Diff line number Diff line change @@ -209,6 +209,7 @@ const PDFViewerApplication = {
209
209
// We want to load the image-to-text AI engine as soon as possible.
210
210
this . mlManager = new MLManager ( {
211
211
enableAltText : AppOptions . get ( "enableAltText" ) ,
212
+ altTextLearnMoreUrl : AppOptions . get ( "altTextLearnMoreUrl" ) ,
212
213
} ) ;
213
214
}
214
215
Original file line number Diff line number Diff line change @@ -117,6 +117,14 @@ const defaultOptions = {
117
117
kind : OptionKind . BROWSER + OptionKind . EVENT_DISPATCH ,
118
118
} ,
119
119
120
+ altTextLearnMoreUrl : {
121
+ /** @type {string } */
122
+ value :
123
+ typeof PDFJSDev !== "undefined" && PDFJSDev . test ( "MOZCENTRAL" )
124
+ ? "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/pdf-alt-text"
125
+ : "" ,
126
+ kind : OptionKind . VIEWER + OptionKind . PREFERENCE ,
127
+ } ,
120
128
annotationEditorMode : {
121
129
/** @type {number } */
122
130
value : 0 ,
Original file line number Diff line number Diff line change @@ -324,10 +324,14 @@ class MLManager {
324
324
return FirefoxCom . requestAsync ( "mlGuess" , data ) ;
325
325
}
326
326
327
- enable ( { enableAltText, listenToProgress } ) {
327
+ enable ( { altTextLearnMoreUrl , enableAltText, listenToProgress } ) {
328
328
if ( enableAltText ) {
329
329
this . #loadAltTextEngine( listenToProgress ) ;
330
330
}
331
+ // The `altTextLearnMoreUrl` is used to provide a link to the user to learn
332
+ // more about the "alt text" feature.
333
+ // The link is used in the Alt Text dialog or in the Image Settings.
334
+ this . altTextLearnMoreUrl = altTextLearnMoreUrl ;
331
335
}
332
336
333
337
async #loadAltTextEngine( listenToProgress ) {
You can’t perform that action at this time.
0 commit comments