Skip to content

Commit

Permalink
feat: add version in window property
Browse files Browse the repository at this point in the history
On html-viewer demo
  • Loading branch information
xjiang-at-wiris authored and carla-at-wiris committed Mar 11, 2024
1 parent 1593102 commit 99e59fe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Last release of this project was 5th of February 2024.

### Unreleased
- fix: Error when open a plain text with MT/CT editor. #KB-44250
- feat: Add version text on html-viewer window property. #KB-43186

### 8.8.2 2024-02-05

Expand Down
6 changes: 5 additions & 1 deletion packages/viewer/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import { Properties } from './properties';
import { renderLatex } from './latex';
import { renderMathML } from './mathml';
import { bypassEncapsulation } from './retro';
import packageInformation from '../../../node_modules/@wiris/mathtype-viewer/package.json'

declare global {
interface Window {
viewer: {
properties: Properties,
isLoaded: boolean
isLoaded: boolean,
version: string
};
}
}
Expand All @@ -30,10 +32,12 @@ async function main(w: Window): Promise<void> {
w.viewer = {
properties,
isLoaded: false,
version: packageInformation.version
};
} else {
w.viewer.properties = properties;
w.viewer.isLoaded = false;
w.viewer.version = packageInformation.version;
}

const document = w.document;
Expand Down
1 change: 1 addition & 0 deletions packages/viewer/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
/* Experimental Options */
"experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
"resolveJsonModule": true
},
"exclude": [
"node_modules", // would be the default
Expand Down

0 comments on commit 99e59fe

Please sign in to comment.