Skip to content

Commit

Permalink
[Misc] Fix hosted envs in TS (#9171)
Browse files Browse the repository at this point in the history
(master → master)
  • Loading branch information
webviewer-ui committed Jun 19, 2024
1 parent 6c3505e commit c5650d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
1 change: 1 addition & 0 deletions custom-ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<head>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<script src='./global.js'></script>
<script src='/lib/webviewer.min.js'></script>
</head>

Expand Down
11 changes: 3 additions & 8 deletions custom-ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
const hashFile = `/${(window.location.hash || 'webviewer-demo.pdf').replace('#', '')}`;
// Remove init_timestamp so that the demo doesn't expire
window.localStorage.removeItem('init_timestamp');
// @ts-ignore
const WebViewerConstructor = isWebComponent() ? WebViewer.WebComponent : WebViewer;

const viewerElement = document.getElementById('viewer');
WebViewer.WebComponent({
WebViewerConstructor({
path: '/lib',
initialDoc: hashFile,
enableRedaction: true,
Expand Down Expand Up @@ -546,7 +548,6 @@ WebViewer.WebComponent({

const redactionPanelToggle = new UI.Components.ToggleElementButton(
{
type: 'toggleElementButton',
img: 'icon-redact-panel',
dataElement: 'redactionPanelToggle',
toggleElement: 'redactionPanel',
Expand All @@ -555,7 +556,6 @@ WebViewer.WebComponent({

const fullPageRedactionToggle = new UI.Components.ToggleElementButton(
{
type: 'toggleElementButton',
img: 'icon-tool-page-redact',
dataElement: 'pageRedactionToggleButton',
toggleElement: 'pageRedactionModal',
Expand Down Expand Up @@ -622,15 +622,13 @@ WebViewer.WebComponent({
label: 'View',
title: 'View',
toolbarGroup: 'toolbarGroup-View',
type: 'ribbonItem',
groupedItems: []
});
const annotateRibbonItem = new UI.Components.RibbonItem({
dataElement: 'toolbarGroup-Annotate',
label: 'Annotate',
title: 'Annotate',
toolbarGroup: 'toolbarGroup-Annotate',
type: 'ribbonItem',
groupedItems: ['annotateGroupedItems']
});

Expand All @@ -639,7 +637,6 @@ WebViewer.WebComponent({
label: 'Shapes',
title: 'Shapes',
toolbarGroup: 'toolbarGroup-Shapes',
type: 'ribbonItem',
groupedItems: ['shapesGroupedItems']
});

Expand Down Expand Up @@ -704,8 +701,6 @@ WebViewer.WebComponent({
dataElement: 'default-ribbon-group',
grow: 2,
justifyContent: 'start',
title: 'Default Tools',
type: 'ribbonGroup',
items: [
viewRibbonItem,
annotateRibbonItem,
Expand Down

0 comments on commit c5650d9

Please sign in to comment.