@@ -88,6 +88,15 @@ export interface EditorSettings {
88
88
* Additional messages to show in the "about" dialog.
89
89
*/
90
90
notices : AboutDialogEntry [ ] ,
91
+
92
+ /**
93
+ * Information about the app/website js-draw is running within
94
+ * to show at the beginning of the about dialog.
95
+ */
96
+ appInfo : {
97
+ name : string ,
98
+ version ?: string ,
99
+ } | null ,
91
100
}
92
101
93
102
/**
@@ -242,6 +251,7 @@ export class Editor {
242
251
keyboardShortcutOverrides : settings . keyboardShortcutOverrides ?? { } ,
243
252
iconProvider : settings . iconProvider ?? new IconProvider ( ) ,
244
253
notices : [ ] ,
254
+ appInfo : settings . appInfo ? { ...settings . appInfo } : null ,
245
255
} ;
246
256
247
257
// Validate settings
@@ -1514,16 +1524,36 @@ export class Editor {
1514
1524
const iconLicenseText = this . icons . licenseInfo ( ) ;
1515
1525
1516
1526
const notices : AboutDialogEntry [ ] = [ ] ;
1527
+
1528
+ if ( this . settings . appInfo ) {
1529
+ const versionLines = [ ] ;
1530
+ if ( this . settings . appInfo . version ) {
1531
+ versionLines . push ( `v${ this . settings . appInfo . version } ` , '' ) ;
1532
+ }
1533
+
1534
+ notices . push ( {
1535
+ heading : `${ this . settings . appInfo . name } ` ,
1536
+ text : [
1537
+ ...versionLines ,
1538
+ `Powered by js-draw v${ version . number } .` ,
1539
+ ] . join ( '\n' ) ,
1540
+ } ) ;
1541
+ } else {
1542
+ notices . push ( {
1543
+ heading : 'js-draw' ,
1544
+ text : `v${ version . number } ` ,
1545
+ } ) ;
1546
+ }
1547
+
1517
1548
notices . push ( {
1518
- heading : 'js-draw ' ,
1549
+ heading : 'Developer information ' ,
1519
1550
text : [
1520
- `v${ version . number } ` ,
1521
- '' ,
1522
1551
'Image debug information (from when this dialog was opened):' ,
1523
1552
` ${ this . viewport . getScaleFactor ( ) } x zoom, ${ 180 / Math . PI * this . viewport . getRotationAngle ( ) } rotation` ,
1524
1553
` ${ this . image . estimateNumElements ( ) } components` ,
1525
1554
` ${ this . getImportExportRect ( ) . w } x${ this . getImportExportRect ( ) . h } size` ,
1526
1555
] . join ( '\n' ) ,
1556
+ minimized : true ,
1527
1557
} ) ;
1528
1558
1529
1559
notices . push ( {
0 commit comments