Skip to content

Instantly share code, notes, and snippets.

@chengtie
Created June 20, 2017 14:38
Show Gist options
  • Save chengtie/777d4a849cdbec134d8500e2fa2cf47b to your computer and use it in GitHub Desktop.
Save chengtie/777d4a849cdbec134d8500e2fa2cf47b to your computer and use it in GitHub Desktop.
Shared with Script Lab
name: Blank snippet
description: ''
author: chengtie
host: EXCEL
api_set: {}
script:
content: |
$("#openSite").click(openSite);
$("#getLocalMessageFromSiteToHost").click(getLocalMessageFromSiteToHost);
async function openSite() {
Office.context.ui.displayDialogAsync("https://www.google.fr", {}, function (result) {
console.log("done");
}
)
}
async function getLocalMessageFromSiteToHost() {
var x = localStorage.getItem("messageLocalFromSiteToHost")
document.getElementById("console").innerHTML = x
document.getElementById("console").innerHTML = "lalala"
}
language: typescript
template:
content: |
<button id="openSite" class="ms-Button">
<span class="ms-Button-label">openSite</span>
</button>
<br/><br/>
<button id="getLocalMessageFromSiteToHost" class="ms-Button">
<span class="ms-Button-label">getLocalMessageFromSiteToHost</span>
</button>
<div id="console"></id>
language: html
style:
content: "/* Your style goes here */\r\n"
language: css
libraries: |
# Office.js
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
# CSS Libraries
[email protected]/dist/css/fabric.min.css
[email protected]/dist/css/fabric.components.min.css
# NPM libraries
[email protected]/client/core.min.js
@microsoft/[email protected]/dist/office.helpers.min.js
[email protected]
# IntelliSense: @types/library or node_modules paths or URL to d.ts files
@types/office-js
@types/core-js
@microsoft/[email protected]/dist/office.helpers.d.ts
@types/jquery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment