Skip to content

Commit

Permalink
added support for excel and powerpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
hschell-cortado committed Jul 6, 2022
1 parent 6a5d9c3 commit 4064e63
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 14 deletions.
78 changes: 78 additions & 0 deletions manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
</AppDomains>
<Hosts>
<Host Name="Document"/>
<Host Name="Workbook"/>
<Host Name="Presentation"/>
</Hosts>
<DefaultSettings>
<SourceLocation DefaultValue="https://localhost:3000/taskpane.html"/>
Expand Down Expand Up @@ -65,6 +67,82 @@
</ExtensionPoint>
</DesktopFormFactor>
</Host>
<Host xsi:type="Workbook">
<DesktopFormFactor>
<GetStarted>
<Title resid="GetStarted.Title"/>
<Description resid="GetStarted.Description"/>
<LearnMoreUrl resid="GetStarted.LearnMoreUrl"/>
</GetStarted>
<FunctionFile resid="Commands.Url"/>
<ExtensionPoint xsi:type="PrimaryCommandSurface">
<OfficeTab id="TabHome">
<Group id="CommandsGroup">
<Label resid="CommandsGroup.Label"/>
<Icon>
<bt:Image size="16" resid="Icon.16x16"/>
<bt:Image size="32" resid="Icon.32x32"/>
<bt:Image size="80" resid="Icon.80x80"/>
</Icon>
<Control xsi:type="Button" id="TaskpaneButton">
<Label resid="TaskpaneButton.Label"/>
<Supertip>
<Title resid="TaskpaneButton.Label"/>
<Description resid="TaskpaneButton.Tooltip"/>
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16"/>
<bt:Image size="32" resid="Icon.32x32"/>
<bt:Image size="80" resid="Icon.80x80"/>
</Icon>
<Action xsi:type="ShowTaskpane">
<TaskpaneId>ButtonId1</TaskpaneId>
<SourceLocation resid="Taskpane.Url"/>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
<Host xsi:type="Presentation">
<DesktopFormFactor>
<GetStarted>
<Title resid="GetStarted.Title"/>
<Description resid="GetStarted.Description"/>
<LearnMoreUrl resid="GetStarted.LearnMoreUrl"/>
</GetStarted>
<FunctionFile resid="Commands.Url"/>
<ExtensionPoint xsi:type="PrimaryCommandSurface">
<OfficeTab id="TabHome">
<Group id="CommandsGroup">
<Label resid="CommandsGroup.Label"/>
<Icon>
<bt:Image size="16" resid="Icon.16x16"/>
<bt:Image size="32" resid="Icon.32x32"/>
<bt:Image size="80" resid="Icon.80x80"/>
</Icon>
<Control xsi:type="Button" id="TaskpaneButton">
<Label resid="TaskpaneButton.Label"/>
<Supertip>
<Title resid="TaskpaneButton.Label"/>
<Description resid="TaskpaneButton.Tooltip"/>
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16"/>
<bt:Image size="32" resid="Icon.32x32"/>
<bt:Image size="80" resid="Icon.80x80"/>
</Icon>
<Action xsi:type="ShowTaskpane">
<TaskpaneId>ButtonId1</TaskpaneId>
<SourceLocation resid="Taskpane.Url"/>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
Expand Down
18 changes: 9 additions & 9 deletions src/taskpane/taskpane.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
<div class="ezp-panel">
<div class="ezp-hero">
<img
src="https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.27/assets/hero.png"
srcset="https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.27/assets/hero.png 1x, https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.27/assets/[email protected] 2x"
src="https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.28/assets/hero.png"
srcset="https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.28/assets/hero.png 1x, https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.28/assets/[email protected] 2x"
alt="ezeep Hero"
/>
</div>
<div class="ezp-logo">
<img
src="https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.27/assets/logo.png"
srcset="https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.27/assets/logo.png 1x, https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.27/assets/[email protected] 2x"
src="https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.28/assets/logo.png"
srcset="https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.28/assets/logo.png 1x, https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.28/assets/[email protected] 2x"
alt="ezeep Logo"
/>
</div>
Expand All @@ -56,7 +56,7 @@
</div>
<ezp-printing
clientid="WnjHlEm0TYYJDt8dovTqUDJMa4ifB2C9eehABA1U"
redirecturi="https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.27/authRedirect.html"
redirecturi="https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.28/authRedirect.html"
trigger="custom"
filetype="pdf"
appearance="light"
Expand All @@ -76,15 +76,15 @@
<div class="ezp-panel">
<div class="ezp-hero">
<img
src="https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.27/assets/hero.png"
srcset="https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.27/assets/hero.png 1x, https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.27/assets/[email protected] 2x"
src="https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.28/assets/hero.png"
srcset="https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.28/assets/hero.png 1x, https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.28/assets/[email protected] 2x"
alt="ezeep Hero"
/>
</div>
<div class="ezp-logo">
<img
src="https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.27/assets/logo.png"
srcset="https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.27/assets/logo.png 1x, https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.27/assets/[email protected] 2x"
src="https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.28/assets/logo.png"
srcset="https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.28/assets/logo.png 1x, https://cdn.ezeep.com/ezeep-msoffice-addin/v1.0.28/assets/[email protected] 2x"
alt="ezeep Logo"
/>
</div>
Expand Down
16 changes: 11 additions & 5 deletions src/taskpane/taskpane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@ Office.onReady(async (info) => {
language = Office.context.displayLanguage.toLowerCase();
await initi18n(language);
translate();

if (info.host === Office.HostType.Word) {
authorized = await ezpPrinting.checkAuth();
authSection.style.display = authorized ? "none" : "block";

authorized = await ezpPrinting.checkAuth();
authSection.style.display = authorized ? "none" : "block";

if (
info.host === Office.HostType.Word ||
info.host === Office.HostType.Excel ||
info.host === Office.HostType.PowerPoint
) {
getFile().then(() => {
if (authorized) {
authSection.style.display = "none";
Expand All @@ -65,6 +68,8 @@ Office.onReady(async (info) => {
loadingSection.style.display = "none";
}
});
} else if (info.host === Office.HostType.Outlook) {
// get email file
}
});

Expand Down Expand Up @@ -133,6 +138,7 @@ async function onGotAllSlices(docdataSlices) {
fileData = docdata;
const filearray = new Uint8Array(fileData);
const filestring = filearray.toString();
// console.log(filestring);
ezpPrinting.setAttribute("filedata", filestring);
ezpPrinting.setAttribute("filename", "test.pdf");
if (authorized) ezpPrinting.open().then(() => (loadingSection.style.display = "none"));
Expand Down

0 comments on commit 4064e63

Please sign in to comment.