File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -779,3 +779,7 @@ pdfjs-views-manager-paste-button-before =
779779# $page (Number) - the page number after which the paste button is.
780780pdfjs-views-manager-paste-button-after =
781781 .title = Paste after page { $page }
782+
783+ # Badge used to promote a new feature in the UI, keep it as short as possible.
784+ # It's spelled uppercase for English, but it can be translated as usual.
785+ pdfjs-new-badge-content = NEW
Original file line number Diff line number Diff line change @@ -600,6 +600,7 @@ const PDFViewerApplication = {
600600 pageColors,
601601 abortSignal,
602602 enableSplitMerge,
603+ enableNewBadge : AppOptions . get ( "enableNewBadge" ) ,
603604 statusBar : viewsManager . viewsManagerStatusBar ,
604605 undoBar : viewsManager . viewsManagerUndoBar ,
605606 manageMenu : viewsManager . manageMenu ,
Original file line number Diff line number Diff line change @@ -250,6 +250,11 @@ const defaultOptions = {
250250 value : true ,
251251 kind : OptionKind . VIEWER + OptionKind . PREFERENCE ,
252252 } ,
253+ enableNewBadge : {
254+ /** @type {boolean } */
255+ value : typeof PDFJSDev === "undefined" || PDFJSDev . test ( "MOZCENTRAL" ) ,
256+ kind : OptionKind . VIEWER + OptionKind . PREFERENCE ,
257+ } ,
253258 enableOptimizedPartialRendering : {
254259 /** @type {boolean } */
255260 value : false ,
Original file line number Diff line number Diff line change @@ -64,6 +64,8 @@ const SPACE_FOR_DRAG_MARKER_WHEN_NO_NEXT_ELEMENT = 15;
6464 * mode.
6565 * @property {AbortSignal } [abortSignal] - The AbortSignal for the window
6666 * events.
67+ * @property {boolean } [enableNewBadge] - Enables the "new" badge for the split
68+ * and merge features.
6769 * @property {boolean } [enableSplitMerge] - Enables split and merge features.
6870 * The default value is `false`.
6971 * @property {Object } [statusBar] - The status bar elements to manage the status
@@ -170,6 +172,7 @@ class PDFThumbnailViewer {
170172 pageColors,
171173 abortSignal,
172174 enableSplitMerge,
175+ enableNewBadge,
173176 statusBar,
174177 undoBar,
175178 manageMenu,
@@ -205,6 +208,14 @@ class PDFThumbnailViewer {
205208 delete : del ,
206209 exportSelected,
207210 } = manageMenu ;
211+
212+ if ( enableNewBadge ) {
213+ const newSpan = document . createElement ( "span" ) ;
214+ newSpan . setAttribute ( "data-l10n-id" , "pdfjs-new-badge-content" ) ;
215+ newSpan . classList . add ( "newBadge" ) ;
216+ button . parentElement . before ( newSpan ) ;
217+ }
218+
208219 this . eventBus . on (
209220 "pagesloaded" ,
210221 ( ) => {
Original file line number Diff line number Diff line change 3636 --loading-icon-delay : 400ms ;
3737 --focus-ring-color : light-dark (# 0060df, # 0df );
3838 --focus-ring-outline : 2px solid var (--focus-ring-color );
39+ --new-badge-bg : light-dark (# 070, # 37b847 );
40+ --new-badge-color : light-dark (# fff, # 15141a );
41+ --new-badge-border-color : light-dark (# fbfbfe / 40% , # 15141a / 40% );
3942
4043 @media screen and (forced-colors : active) {
4144 --pdfViewer-padding-bottom : 9px ;
4245 --page-margin : 8px auto -1px ;
4346 --page-border : 1px solid CanvasText;
4447 --spreadHorizontalWrapped-margin-LR : 3.5px ;
4548 --focus-ring-color : CanvasText;
49+ --new-badge-bg : AccentColor;
50+ --new-badge-color : ButtonFace;
51+ --new-badge-border-color : CanvasText;
4652 }
4753}
4854
55+ .newBadge {
56+ background-color : var (--new-badge-bg );
57+ color : var (--new-badge-color );
58+ border-radius : 4px ;
59+ border : 1px solid var (--new-badge-border-color );
60+ padding-inline : 4px ;
61+ margin-inline : 4px ;
62+ font : menu;
63+ font-size : 12px ;
64+ font-style : normal;
65+ font-weight : 400 ;
66+ line-height : normal;
67+ flex : 0 0 fit-content;
68+ user-select : none;
69+ }
70+
4971[data-main-rotation = "90" ] {
5072 transform : rotate (90deg ) translateY (-100% );
5173}
You can’t perform that action at this time.
0 commit comments