This sample shows how to format different aspects of a chart.
-
Set up
-
Try it out
language: html
style:
- content: |
+ content: |-
section.samples {
margin-top: 20px;
}
@@ -593,15 +593,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/excel/20-data-types/data-types-error-values.yaml b/samples/excel/20-data-types/data-types-error-values.yaml
index ec1c9eeb6..bcf1d28f6 100644
--- a/samples/excel/20-data-types/data-types-error-values.yaml
+++ b/samples/excel/20-data-types/data-types-error-values.yaml
@@ -6,10 +6,10 @@ host: EXCEL
api_set:
ExcelApi: '1.16'
script:
- content: |
- $("#setup").on("click", () => tryCatch(setup));
- $("#set-busy-error").on("click", () => tryCatch(setBusyError));
- $("#change-busy-error").on("click", () => tryCatch(changeBusyError));
+ content: |-
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
+ document.getElementById("set-busy-error").addEventListener("click", () => tryCatch(setBusyError));
+ document.getElementById("change-busy-error").addEventListener("click", () => tryCatch(changeBusyError));
async function setBusyError() {
// This function sets the value of cell A1 to a #BUSY! error using data types.
@@ -105,15 +105,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/excel/20-data-types/data-types-formatted-number.yaml b/samples/excel/20-data-types/data-types-formatted-number.yaml
index a8ca4bc9c..dd362a38a 100644
--- a/samples/excel/20-data-types/data-types-formatted-number.yaml
+++ b/samples/excel/20-data-types/data-types-formatted-number.yaml
@@ -6,11 +6,11 @@ host: EXCEL
api_set:
ExcelApi: '1.16'
script:
- content: |
- $("#setup").on("click", () => tryCatch(setup));
- $("#set-formatted-number-date").on("click", () => tryCatch(setFormattedNumberDate));
- $("#set-formatted-number-currency").on("click", () => tryCatch(setFormattedNumberCurrency));
- $("#get-formatted-number").on("click", () => tryCatch(getFormattedNumber));
+ content: |-
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
+ document.getElementById("set-formatted-number-date").addEventListener("click", () => tryCatch(setFormattedNumberDate));
+ document.getElementById("set-formatted-number-currency").addEventListener("click", () => tryCatch(setFormattedNumberCurrency));
+ document.getElementById("get-formatted-number").addEventListener("click", () => tryCatch(getFormattedNumber));
async function setFormattedNumberDate() {
// This function creates a formatted number data type,
@@ -143,15 +143,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/excel/20-data-types/data-types-references.yaml b/samples/excel/20-data-types/data-types-references.yaml
index 37f5673fd..89a45c742 100644
--- a/samples/excel/20-data-types/data-types-references.yaml
+++ b/samples/excel/20-data-types/data-types-references.yaml
@@ -6,9 +6,9 @@ host: EXCEL
api_set:
ExcelApi: '1.16'
script:
- content: |
- $("#setup").on("click", () => tryCatch(setup));
- $("#add-entities-to-table").on("click", () => tryCatch(addEntitiesToTable));
+ content: |-
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
+ document.getElementById("add-entities-to-table").addEventListener("click", () => tryCatch(addEntitiesToTable));
async function addEntitiesToTable() {
// This function creates entity values with references to other entity values.
@@ -292,7 +292,7 @@ script:
];
language: typescript
template:
- content: |
+ content: |-
This sample shows how to create entity values with references to other entity values. An entity value is a container for data, and this container can reference (or contain) other entities within the original entity. One entity can contain multiple additional entities.
@@ -316,10 +316,10 @@ template:
To navigate back to the original Andrew Fuller entity, select the Back arrow in the top left corner of the entity card.
You can also use the Extract to grid button in the card modal window, to the right of the Manager or Direct Reports fields, to add the referenced entities to the table in new columns.
-
+
language: html
style:
- content: |
+ content: |-
section.samples {
margin-top: 20px;
}
@@ -331,15 +331,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/excel/20-data-types/data-types-web-image.yaml b/samples/excel/20-data-types/data-types-web-image.yaml
index 3a6d8134d..9beed0017 100644
--- a/samples/excel/20-data-types/data-types-web-image.yaml
+++ b/samples/excel/20-data-types/data-types-web-image.yaml
@@ -6,12 +6,12 @@ host: EXCEL
api_set:
ExcelApi: '1.16'
script:
- content: |
- $("#setup").on("click", () => tryCatch(setup));
- $("#insert-image").on("click", () => tryCatch(insertImage));
- $("#retrieve-image-info").on("click", () => tryCatch(retrieveImageInfo));
- $("#open-image").on("click", () => tryCatch(openImage));
- $("#clear-form").on("click", () => tryCatch(clearForm));
+ content: |-
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
+ document.getElementById("insert-image").addEventListener("click", () => tryCatch(insertImage));
+ document.getElementById("retrieve-image-info").addEventListener("click", () => tryCatch(retrieveImageInfo));
+ document.getElementById("open-image").addEventListener("click", () => tryCatch(openImage));
+ document.getElementById("clear-form").addEventListener("click", () => tryCatch(clearForm));
async function insertImage() {
// This function inserts a web image into the currently selected cell.
@@ -125,7 +125,6 @@ template:
This sample shows how to work with the web image data type. Insert an image into the selected cell and then
retrieve information about that image.
-
Set up
Add a new worksheet and then enter the URL and alt text for an image of your choice.
@@ -137,24 +136,20 @@ template:
-
Try it out
Select the cell you want to insert the web image into, and then select the Insert image button.
Insert image
-
Select the cell containing the web image that you want to view the details of, and then select the Retrieve image details button. The image details will display here in the task pane, in the preceding Image URL and Alt text fields.
Retrieve image details
-
Select the cell with the image you want to view and then select the Open image in browser button. The image will open in a new web browser tab.
Open image in browser
-
Clear the Image URL and Alt text fields in the task pane.
This sample shows how to get the Base64-encoded string that represents the current document. It uses the getFileAsync() method to read the file in slices and then joins all slices back together to form the complete file.
This sample shows how to register and use handlers for the column and row sorting events.
-
Set up
Add sample data
-
Try it out
@@ -194,15 +192,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/excel/30-events/event-worksheet-single-click.yaml b/samples/excel/30-events/event-worksheet-single-click.yaml
index dda6ab02e..b6b7c3c03 100644
--- a/samples/excel/30-events/event-worksheet-single-click.yaml
+++ b/samples/excel/30-events/event-worksheet-single-click.yaml
@@ -7,7 +7,7 @@ api_set:
ExcelApi: '1.10'
script:
content: |-
- $("#register-click-handler").on("click", () => tryCatch(registerClickHandler));
+ document.getElementById("register-click-handler").addEventListener("click", () => tryCatch(registerClickHandler));
async function registerClickHandler() {
await Excel.run(async (context) => {
@@ -40,7 +40,6 @@ template:
This sample shows how to register and use a handler for the single-click event.
-
Try it out
Use the button below to register the event handler. Then, left-click around the worksheet and check the console.
@@ -63,15 +62,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/excel/30-events/events-chart-activated.yaml b/samples/excel/30-events/events-chart-activated.yaml
index 26e0b06c4..6ac14fd45 100644
--- a/samples/excel/30-events/events-chart-activated.yaml
+++ b/samples/excel/30-events/events-chart-activated.yaml
@@ -7,10 +7,10 @@ api_set:
ExcelApi: '1.8'
script:
content: |-
- $("#setup").on("click", () => tryCatch(setup));
- $("#register-onactivated-deactivated-handlers").on("click", () => tryCatch(registerActivationHandlers));
- $("#create-pie-chart").on("click", () => tryCatch(createPieChart));
- $("#create-cylinder-chart").on("click", () => tryCatch(createCylinderChart));
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
+ document.getElementById("register-onactivated-deactivated-handlers").addEventListener("click", () => tryCatch(registerActivationHandlers));
+ document.getElementById("create-pie-chart").addEventListener("click", () => tryCatch(createPieChart));
+ document.getElementById("create-cylinder-chart").addEventListener("click", () => tryCatch(createCylinderChart));
async function registerActivationHandlers() {
await Excel.run(async (context) => {
@@ -139,14 +139,12 @@ template:
This sample shows how to register and use handlers for the Chart onActivated and onDeactivated events.
-
Set up
Setup
-
Try it out
Click the button to register handlers for the pie chart's activated and deactivated events. Then click the chart to activate it. Watch the console. Finally, click the cylinder chart to deactivate the pie chart.
Once the event handler is registered, a notification prints to the console when the workbook is activated. Try
switching to another application and then switching back to Excel to see the console notification.
This sample shows how to register and use handlers for when a worksheet is added, activated, or deactivated, or when the settings of a workbook are changed.
This sample shows how to register and use event handlers for table onChanged and onSelectionChanged events.
-
Set up
@@ -122,19 +121,15 @@ template:
WorksheetCollection
-
Try it out
-
The console will log the addresses reported by the different onSelectionChanged events. Change the cell or cells selected in the worksheet to see the results. Try selecting single cells, multiple cells, and multiple discontiguous cells.
This sample shows how to get PivotTables in the workbook. You can get them through PivotTableCollection objects
or by querying a Range object containing PivotTable data.
-
Set up
This creates a data sheet and two PivotTables in two different worksheets.
@@ -151,11 +150,9 @@ template:
Set up sample
This sample shows how to apply actions simultaneously to multiple, discontiguous ranges. Some of these ranges are found using the Range object's getSpecialCells method.
This sample shows how to add, apply, get and delete styles.
-
Set up
Add sample data
-
Try it out
Add new style will throw an error if the style has already been added.
@@ -175,31 +170,26 @@ template:
Add new style
-
Apply new style
-
Apply built-in style
-
Get style font properties
-
Get style alignment properties
-
Clean up
Delete new style throws an error if the style doesn't exist (that is, hasn't been added). Deleting the style also causes the other buttons using the style to fail.
This sample shows how to use and nest the built-in Excel functions VLOOKUP and SUM. The sample uses VLOOKUP to return data, and then it uses SUM to combine data returned by VLOOKUP.
This sample shows how to change the visbility of a worksheet.
-
Set up
Ensure two worksheets
-
Try it out
@@ -105,7 +103,7 @@ template:
language: html
style:
- content: |
+ content: |-
section.samples {
margin-top: 20px;
}
@@ -117,15 +115,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/excel/90-scenarios/currency-converter.yaml b/samples/excel/90-scenarios/currency-converter.yaml
index f5cf82a87..a8ba2aa1b 100644
--- a/samples/excel/90-scenarios/currency-converter.yaml
+++ b/samples/excel/90-scenarios/currency-converter.yaml
@@ -7,7 +7,7 @@ host: EXCEL
api_set:
ExcelApi: '1.4'
script:
- content: |
+ content: |-
/*
* Copyright (c) Riwut Libinuko. All rights reserved. Licensed under the MIT license.
*/
@@ -17,8 +17,8 @@ script:
let tableSetup: Record = {};
- $("#convert").on("click", () => tryCatch(convert));
- $("#setup").on("click", () => tryCatch(setupSample));
+ document.getElementById("convert").addEventListener("click", () => tryCatch(convert));
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setupSample));
/** Main converting function **/
async function convert() {
@@ -141,25 +141,22 @@ script:
}
language: typescript
template:
- content: |
+ content: |-
Simple Currency Converter
-
Simple currency converter shows how to read data from a transaction table, and uses currency converter API to
calculate the amount in base currency.
The code also performs table validation and identify if the table has predefined headers. You can try to to rearrange the the
column, and see by yourself!
Check whether there is a path from left to right, moving forward one cell at a time (and only straight or diagonally).
-
Set up
Circle density (%)
@@ -191,14 +190,12 @@ template:
-
Find the path:
Prune all at once
-
Prune step-by-step
@@ -221,15 +218,9 @@ style:
margin-bottom: 0;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/excel/99-just-for-fun/patterns.yaml b/samples/excel/99-just-for-fun/patterns.yaml
index e29e1f0a0..8e0f74ec5 100644
--- a/samples/excel/99-just-for-fun/patterns.yaml
+++ b/samples/excel/99-just-for-fun/patterns.yaml
@@ -8,9 +8,9 @@ api_set:
ExcelApi: '1.4'
script:
content: |-
- $("#squares").on("click", () => tryCatch(drawSquares));
- $("#spiral").on("click", () => tryCatch(drawSpiral));
- $("#decoration").on("click", () => tryCatch(drawDecoration));
+ document.getElementById("squares").addEventListener("click", () => tryCatch(drawSquares));
+ document.getElementById("spiral").addEventListener("click", () => tryCatch(drawSpiral));
+ document.getElementById("decoration").addEventListener("click", () => tryCatch(drawDecoration));
async function drawSquares() {
await Excel.run(async (context) => {
@@ -156,30 +156,26 @@ script:
template:
content: |-
Draw colorful patterns
-
Choose size:
-
Concentric Squares
-
Spiral
-
Decoration
language: html
style:
- content: |
+ content: |-
h2:not(:first-child) {
margin-top: 35px;
}
@@ -188,15 +184,9 @@ style:
width: 100%;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/excel/99-just-for-fun/tetrominos.yaml b/samples/excel/99-just-for-fun/tetrominos.yaml
index 7f025bfd2..20b36299b 100644
--- a/samples/excel/99-just-for-fun/tetrominos.yaml
+++ b/samples/excel/99-just-for-fun/tetrominos.yaml
@@ -14,7 +14,7 @@ script:
});
$("#selectedFile").on("change", () => tryCatch(readImageFromFile));
- $("#focusButton").on("click", () => tryCatch(focus));
+ document.getElementById("focusButton").addEventListener("click", () => tryCatch(focus));
let backgroundPicture = getDefaultBackgroundPicture();
@@ -649,7 +649,6 @@ template:
This sample lets you repeatedly stack tetrominos, which are represented by Shapes. Select a background image (or leave blank for the default) and Start!. The controls will then be displayed.
@@ -93,15 +92,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/outlook/20-item-body/append-text-on-send.yaml b/samples/outlook/20-item-body/append-text-on-send.yaml
index e768d32a4..b077e266a 100644
--- a/samples/outlook/20-item-body/append-text-on-send.yaml
+++ b/samples/outlook/20-item-body/append-text-on-send.yaml
@@ -6,8 +6,8 @@ host: OUTLOOK
api_set:
Mailbox: '1.9'
script:
- content: |
- $("#append-on-send").on("click", appendOnSend);
+ content: |-
+ document.getElementById("append-on-send").addEventListener("click", appendOnSend);
function appendOnSend() {
// This snippet appends text to the end of the message or appointment's body once it's sent.
@@ -38,7 +38,6 @@ template:
This sample appends text to the end of the message or appointment's body once it's sent.
Required mode: Compose
-
Try it out
Important: To use appendOnSendAsync, you must set AppendOnSend as an extended permission in the ExtendedPermissions manifest element. To learn more about append-on-send and its configuration, see Implement append-on-send in your Outlook add-in.
@@ -65,15 +64,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/outlook/20-item-body/get-body-format.yaml b/samples/outlook/20-item-body/get-body-format.yaml
index af52a05ae..b1cbc7506 100644
--- a/samples/outlook/20-item-body/get-body-format.yaml
+++ b/samples/outlook/20-item-body/get-body-format.yaml
@@ -6,8 +6,8 @@ host: OUTLOOK
api_set:
Mailbox: '1.1'
script:
- content: |
- $("#get-body-format").on("click", getBodyFormat);
+ content: |-
+ document.getElementById("get-body-format").addEventListener("click", getBodyFormat);
function getBodyFormat() {
// Get the mail item's body format (plain text or HTML) and log it to the console.
@@ -27,7 +27,6 @@ template:
This sample gets the message or appointment's body format (plain text or HTML).
Required mode: Compose
-
Try it out
@@ -48,15 +47,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/outlook/20-item-body/get-selected-data.yaml b/samples/outlook/20-item-body/get-selected-data.yaml
index 0aee0b8f7..8334e9509 100644
--- a/samples/outlook/20-item-body/get-selected-data.yaml
+++ b/samples/outlook/20-item-body/get-selected-data.yaml
@@ -6,8 +6,8 @@ host: OUTLOOK
api_set:
Mailbox: '1.1'
script:
- content: |
- $("#get-selected-data").on("click", getSelectedData);
+ content: |-
+ document.getElementById("get-selected-data").addEventListener("click", getSelectedData);
function getSelectedData() {
Office.context.mailbox.item.getSelectedDataAsync(Office.CoercionType.Text, function(asyncResult) {
@@ -27,7 +27,6 @@ template:
This sample shows how to get the selected text in the item body or subject/title.
Required mode: Compose
-
Try it out
Select text in the item body or subject then push the Get selected text button.
@@ -49,15 +48,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/outlook/20-item-body/prepend-text-on-send.yaml b/samples/outlook/20-item-body/prepend-text-on-send.yaml
index f20f8639d..32cb1a236 100644
--- a/samples/outlook/20-item-body/prepend-text-on-send.yaml
+++ b/samples/outlook/20-item-body/prepend-text-on-send.yaml
@@ -6,8 +6,8 @@ host: OUTLOOK
api_set:
Mailbox: '1.13'
script:
- content: |
- $("#prepend-on-send").on("click", prependOnSend);
+ content: |-
+ document.getElementById("prepend-on-send").addEventListener("click", prependOnSend);
function prependOnSend() {
// This snippet prepends text to the beginning of the message or appointment's body once it's sent.
@@ -38,7 +38,6 @@ template:
This sample prepends text to the beginning of the message or appointment's body once it's sent.
Required mode: Compose
-
Try it out
Important: To use prependOnSendAsync, you must set AppendOnSend as an extended permission in the ExtendedPermissions manifest element. appendOnSendAsync and prependOnSendAsync both use the AppendOnSend extended permission. To learn more about prepend-on-send, see Prepend or append content to a message or appointment body on send.
@@ -65,15 +64,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/outlook/20-item-body/prepend-text-to-item-body.yaml b/samples/outlook/20-item-body/prepend-text-to-item-body.yaml
index ab8438edf..eae94ef5a 100644
--- a/samples/outlook/20-item-body/prepend-text-to-item-body.yaml
+++ b/samples/outlook/20-item-body/prepend-text-to-item-body.yaml
@@ -6,8 +6,8 @@ host: OUTLOOK
api_set:
Mailbox: '1.1'
script:
- content: |
- $("#prepend").on("click", prependText);
+ content: |-
+ document.getElementById("prepend").addEventListener("click", prependText);
function prependText() {
/* This snippet adds text to the beginning of the message or appointment's body.
@@ -41,7 +41,6 @@ template:
This sample adds text to the beginning of the message or appointment's body.
Required mode: Compose
-
Try it out
@@ -67,15 +66,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/outlook/20-item-body/replace-selected-text.yaml b/samples/outlook/20-item-body/replace-selected-text.yaml
index 06ea6cb38..cdd8b6b04 100644
--- a/samples/outlook/20-item-body/replace-selected-text.yaml
+++ b/samples/outlook/20-item-body/replace-selected-text.yaml
@@ -6,8 +6,8 @@ host: OUTLOOK
api_set:
Mailbox: '1.1'
script:
- content: |
- $("#replace-selection").on("click", replaceSelection);
+ content: |-
+ document.getElementById("replace-selection").addEventListener("click", replaceSelection);
function replaceSelection() {
/* This snippet replaces selected text in a message or appointment's body with specified text.
@@ -41,7 +41,6 @@ template:
This sample replaces selected text in a message or appointment's body with specified text.
Required mode: Compose
-
Try it out
@@ -71,15 +70,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/outlook/25-item-save-and-close/close-async.yaml b/samples/outlook/25-item-save-and-close/close-async.yaml
index 674ab7b12..109be2bbd 100644
--- a/samples/outlook/25-item-save-and-close/close-async.yaml
+++ b/samples/outlook/25-item-save-and-close/close-async.yaml
@@ -6,8 +6,8 @@ host: OUTLOOK
api_set:
Mailbox: '1.14'
script:
- content: |
- $("#close-async").on("click", closeAsync);
+ content: |-
+ document.getElementById("close-async").addEventListener("click", closeAsync);
function closeAsync() {
// This snippet closes the current message being composed and discards any unsaved changes when the optional property, discardItem, is set to true.
@@ -24,12 +24,11 @@ script:
}
language: typescript
template:
- content: |
+ content: |-
This sample shows how to close the current message being composed and discard any unsaved changes.
Required mode: Message Compose
-
Try it out
@@ -50,15 +49,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/outlook/25-item-save-and-close/close.yaml b/samples/outlook/25-item-save-and-close/close.yaml
index daec136ae..f1d570d82 100644
--- a/samples/outlook/25-item-save-and-close/close.yaml
+++ b/samples/outlook/25-item-save-and-close/close.yaml
@@ -6,19 +6,18 @@ host: OUTLOOK
api_set:
Mailbox: '1.3'
script:
- content: |
- $("#run").on("click", run);
+ content: |-
+ document.getElementById("run").addEventListener("click", run);
function run() {
Office.context.mailbox.item.close();
}
language: typescript
template:
- content: |
+ content: |-
This sample shows how to close the item in compose mode.
This sample shows how to get the appointment organizer.
Required mode: Appointment Organizer
-
Try it out
@@ -47,15 +46,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/outlook/30-recipients-and-attendees/get-required-attendees-appointment-attendee.yaml b/samples/outlook/30-recipients-and-attendees/get-required-attendees-appointment-attendee.yaml
index 74b2f4227..2766205fe 100644
--- a/samples/outlook/30-recipients-and-attendees/get-required-attendees-appointment-attendee.yaml
+++ b/samples/outlook/30-recipients-and-attendees/get-required-attendees-appointment-attendee.yaml
@@ -6,8 +6,8 @@ host: OUTLOOK
api_set:
Mailbox: '1.1'
script:
- content: |
- $("#get-required-attendees").on("click", getRequiredAttendees);
+ content: |-
+ document.getElementById("get-required-attendees").addEventListener("click", getRequiredAttendees);
function getRequiredAttendees() {
const apptRequiredAttendees = Office.context.mailbox.item.requiredAttendees;
@@ -29,7 +29,6 @@ template:
This sample shows how to get the required attendees.
Required mode: Appointment Attendee
-
Try it out
@@ -50,15 +49,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/outlook/30-recipients-and-attendees/get-sender-message-read.yaml b/samples/outlook/30-recipients-and-attendees/get-sender-message-read.yaml
index 4d92516ef..ccabbe93a 100644
--- a/samples/outlook/30-recipients-and-attendees/get-sender-message-read.yaml
+++ b/samples/outlook/30-recipients-and-attendees/get-sender-message-read.yaml
@@ -6,8 +6,8 @@ host: OUTLOOK
api_set:
Mailbox: '1.1'
script:
- content: |
- $("#get-sender").on("click", getSender);
+ content: |-
+ document.getElementById("get-sender").addEventListener("click", getSender);
function getSender() {
const msgSender = Office.context.mailbox.item.sender;
@@ -20,7 +20,6 @@ template:
This sample shows how to get the email sender. In a delegate access scenario, the sender is the delegate. Tip: Use the from property to get the delegator.
Required mode: Message Read
-
Try it out
@@ -41,15 +40,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/outlook/30-recipients-and-attendees/get-set-bcc-message-compose.yaml b/samples/outlook/30-recipients-and-attendees/get-set-bcc-message-compose.yaml
index 7f945e4ab..1847b5e2c 100644
--- a/samples/outlook/30-recipients-and-attendees/get-set-bcc-message-compose.yaml
+++ b/samples/outlook/30-recipients-and-attendees/get-set-bcc-message-compose.yaml
@@ -6,9 +6,9 @@ host: OUTLOOK
api_set:
Mailbox: '1.1'
script:
- content: |
- $("#get-bcc").on("click", getBcc);
- $("#set-bcc").on("click", setBcc);
+ content: |-
+ document.getElementById("get-bcc").addEventListener("click", getBcc);
+ document.getElementById("set-bcc").addEventListener("click", setBcc);
function getBcc() {
Office.context.mailbox.item.bcc.getAsync(function(asyncResult) {
@@ -44,7 +44,6 @@ template:
This sample shows how to get and set the Bcc line recipients of the email.
Required mode: Message Compose
-
Try it out
@@ -72,15 +71,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/outlook/30-recipients-and-attendees/get-set-cc-message-compose.yaml b/samples/outlook/30-recipients-and-attendees/get-set-cc-message-compose.yaml
index 5d183929f..a550e0b14 100644
--- a/samples/outlook/30-recipients-and-attendees/get-set-cc-message-compose.yaml
+++ b/samples/outlook/30-recipients-and-attendees/get-set-cc-message-compose.yaml
@@ -6,9 +6,9 @@ host: OUTLOOK
api_set:
Mailbox: '1.1'
script:
- content: |
- $("#get-cc").on("click", getCc);
- $("#set-cc").on("click", setCc);
+ content: |-
+ document.getElementById("get-cc").addEventListener("click", getCc);
+ document.getElementById("set-cc").addEventListener("click", setCc);
function getCc() {
Office.context.mailbox.item.cc.getAsync(function(asyncResult) {
@@ -44,7 +44,6 @@ template:
This sample shows how to get and set the Cc line recipients of the email.
Required mode: Message Compose
-
Try it out
@@ -72,15 +71,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/outlook/30-recipients-and-attendees/get-set-optional-attendees-appointment-organizer.yaml b/samples/outlook/30-recipients-and-attendees/get-set-optional-attendees-appointment-organizer.yaml
index 6b487a1d6..e8f961373 100644
--- a/samples/outlook/30-recipients-and-attendees/get-set-optional-attendees-appointment-organizer.yaml
+++ b/samples/outlook/30-recipients-and-attendees/get-set-optional-attendees-appointment-organizer.yaml
@@ -6,9 +6,9 @@ host: OUTLOOK
api_set:
Mailbox: '1.1'
script:
- content: |
- $("#get-optional-attendees").on("click", getOptionalAttendees);
- $("#set-optional-attendees").on("click", setOptionalAttendees);
+ content: |-
+ document.getElementById("get-optional-attendees").addEventListener("click", getOptionalAttendees);
+ document.getElementById("set-optional-attendees").addEventListener("click", setOptionalAttendees);
function getOptionalAttendees() {
Office.context.mailbox.item.optionalAttendees.getAsync(function(asyncResult) {
@@ -50,7 +50,6 @@ template:
This sample shows how to get and set the optional attendees.
Required mode: Appointment Organizer
-
Try it out
@@ -78,15 +77,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/outlook/30-recipients-and-attendees/get-set-required-attendees-appointment-organizer.yaml b/samples/outlook/30-recipients-and-attendees/get-set-required-attendees-appointment-organizer.yaml
index c6d80e8e3..c7deebc20 100644
--- a/samples/outlook/30-recipients-and-attendees/get-set-required-attendees-appointment-organizer.yaml
+++ b/samples/outlook/30-recipients-and-attendees/get-set-required-attendees-appointment-organizer.yaml
@@ -6,9 +6,9 @@ host: OUTLOOK
api_set:
Mailbox: '1.1'
script:
- content: |
- $("#get-required-attendees").on("click", getRequiredAttendees);
- $("#set-required-attendees").on("click", setRequiredAttendees);
+ content: |-
+ document.getElementById("get-required-attendees").addEventListener("click", getRequiredAttendees);
+ document.getElementById("set-required-attendees").addEventListener("click", setRequiredAttendees);
function getRequiredAttendees() {
Office.context.mailbox.item.requiredAttendees.getAsync(function(asyncResult) {
@@ -50,7 +50,6 @@ template:
This sample shows how to get and set the required attendees.
Required mode: Appointment Organizer
-
Try it out
@@ -78,15 +77,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/outlook/30-recipients-and-attendees/get-set-to-message-compose.yaml b/samples/outlook/30-recipients-and-attendees/get-set-to-message-compose.yaml
index beba09e5e..3164d9d20 100644
--- a/samples/outlook/30-recipients-and-attendees/get-set-to-message-compose.yaml
+++ b/samples/outlook/30-recipients-and-attendees/get-set-to-message-compose.yaml
@@ -6,9 +6,9 @@ host: OUTLOOK
api_set:
Mailbox: '1.1'
script:
- content: |
- $("#get-to").on("click", getTo);
- $("#set-to").on("click", setTo);
+ content: |-
+ document.getElementById("get-to").addEventListener("click", getTo);
+ document.getElementById("set-to").addEventListener("click", setTo);
function getTo() {
Office.context.mailbox.item.to.getAsync(function(asyncResult) {
@@ -44,7 +44,6 @@ template:
This sample shows how to get and set the To line recipients of the email.
Required mode: Message Compose
-
Try it out
@@ -72,15 +71,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/outlook/30-recipients-and-attendees/get-to-message-read.yaml b/samples/outlook/30-recipients-and-attendees/get-to-message-read.yaml
index 67512875c..37807769a 100644
--- a/samples/outlook/30-recipients-and-attendees/get-to-message-read.yaml
+++ b/samples/outlook/30-recipients-and-attendees/get-to-message-read.yaml
@@ -6,8 +6,8 @@ host: OUTLOOK
api_set:
Mailbox: '1.1'
script:
- content: |
- $("#get-to").on("click", getTo);
+ content: |-
+ document.getElementById("get-to").addEventListener("click", getTo);
function getTo() {
const msgTo = Office.context.mailbox.item.to;
@@ -58,7 +58,6 @@ template:
This sample shows how to get the To line recipients of the email.
This sample uses Exchange Web Services (EWS) to get an appointment's iCalUId value if the user is an attendee.
Important: Exchange user identity and callback tokens are only supported in Exchange on-premises environments.
@@ -50,7 +50,6 @@ template:
to get an access token. Then, use Microsoft Graph to get the iCalUId property.
This sample uses Exchange Web Services (EWS) to get an appointment's iCalUId value if the user is the organizer.
Important: Exchange user identity and callback tokens are only supported in Exchange on-premises environments.
@@ -57,7 +57,6 @@ template:
to get an access token. Then, use Microsoft Graph to get the iCalUId property.
-
Get iCalUId property
@@ -75,15 +74,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/outlook/85-tokens-and-service-calls/ids-and-urls.yaml b/samples/outlook/85-tokens-and-service-calls/ids-and-urls.yaml
index d7b4df2ac..7b05c488c 100644
--- a/samples/outlook/85-tokens-and-service-calls/ids-and-urls.yaml
+++ b/samples/outlook/85-tokens-and-service-calls/ids-and-urls.yaml
@@ -6,8 +6,8 @@ host: OUTLOOK
api_set:
Mailbox: '1.5'
script:
- content: |
- $("#run").on("click", run);
+ content: |-
+ document.getElementById("run").addEventListener("click", run);
function run() {
// Get the EWS URL and EWS item ID.
@@ -25,7 +25,7 @@ script:
}
language: typescript
template:
- content: |
+ content: |-
This sample shows how to retrieve the EWS endpoint URL and item IDs, and convert item IDs for different protocols.
Important: Exchange user identity and callback tokens are only supported in Exchange on-premises environments.
@@ -33,7 +33,6 @@ template:
to get an access token.
This sample shows how to get a message using EWS, without any back-end code.
Important: This API is only supported in Exchange on-premises environments.
@@ -39,7 +39,6 @@ template:
to get an access token. Then, use Microsoft Graph to get the message.
This sample shows how to send a message using EWS, without any back-end code.
Important: This API is only supported in Exchange on-premises environments.
@@ -42,7 +42,6 @@ template:
to get an access token. Then, use Microsoft Graph to send the message.
This sample shows how to get a callback token to call Outlook services from an add-in's backend service.
Important: Exchange user identity and callback tokens are only supported in Exchange on-premises environments.
@@ -30,7 +30,6 @@ template:
to get an access token instead.
-
Create line
-
Create text box
-
Create shape with text
-
language: html
style:
@@ -216,15 +207,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/powerpoint/slide-management/add-slides.yaml b/samples/powerpoint/slide-management/add-slides.yaml
index e69f9354f..74e68bd1e 100644
--- a/samples/powerpoint/slide-management/add-slides.yaml
+++ b/samples/powerpoint/slide-management/add-slides.yaml
@@ -6,9 +6,9 @@ host: POWERPOINT
api_set:
PowerPointApi: '1.3'
script:
- content: |
- $("#slide-masters").on("click", () => tryCatch(logSlideMasters));
- $("#add-slide").on("click", () => tryCatch(addSlide));
+ content: |-
+ document.getElementById("slide-masters").addEventListener("click", () => tryCatch(logSlideMasters));
+ document.getElementById("add-slide").addEventListener("click", () => tryCatch(addSlide));
async function addSlide() {
const chosenMaster = $("#master-id").val() as string;
@@ -60,31 +60,26 @@ template:
This sample shows how to add a slide and optionally to specify the slide master and layout of the slide.
-
Try it out
On the Home ribbon, open the New Slide drop down menu to see the slide masters and slide layouts in the presentation. Be sure there are at least two slide masters. To add a master, see Use
multiple slide masters in one presentation. The page will open in your browser.
-
Press Add slide to add a slide with the default layout of the default slide master to the end of the presentation.
Add slide
-
Press Log slide masters info to log to the console a list of all the slide masters, their child layouts, and the IDs of the masters and the layouts.
Log slide masters info
-
Copy one of the slide master IDs from the console and enter it in the Master ID text box. (Example: 6147483651#7142061614)
-
Copy one of the layout IDs from the console, under the same master you choose above, and enter it in the Layout ID text box. (Example: 2147483651#3142061614)
-
Press Add slide again to add a slide with the corresponding master and layout.
These snippets show how to use tags with the presentation and its slides and shapes.
-
Try it out
-
1. Add several slides to the deck. Add content to each so they are visually distinct in the thumbnail pane.
-
2. Select a single slide and press Add tag to tag the slide to be shown only to premium customers.
Add tag
-
3. Repeat step 2 for another slide.
-
4. Press Delete premium customer slides to remove from the presentation slides that should only be shown to premium customers.
Delete premium customer slides
-
5. Press Add slide tags to add mulitiple tags to the first slide of the presentation.
Add slide tags
-
6. Select the first slide and on the ribbon, navigate Insert > Illustrations > Shapes to add a shape to it. Press Add shape tag.
Add shape tag
-
7. Press Add presentation tag.
Add presentation tag
-
8. Press Delete presentation tag.
Delete presentation tag
@@ -205,15 +196,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/powerpoint/text/get-set-textrange.yaml b/samples/powerpoint/text/get-set-textrange.yaml
index 74659b759..2cfed52fb 100644
--- a/samples/powerpoint/text/get-set-textrange.yaml
+++ b/samples/powerpoint/text/get-set-textrange.yaml
@@ -6,12 +6,12 @@ host: POWERPOINT
api_set:
PowerPointApi: '1.5'
script:
- content: |
- $("#getSelectedTextRange").on("click", () => tryCatch(getSelectedTextRange));
- $("#setSelectedTextRange").on("click", () => tryCatch(setSelectedTextRange));
- $("#changeColor").on("click", () => tryCatch(changeColor));
- $("#saveTextSelection").on("click", () => tryCatch(saveTextSelection));
- $("#loadTextSelection").on("click", () => tryCatch(loadTextSelection));
+ content: |-
+ document.getElementById("getSelectedTextRange").addEventListener("click", () => tryCatch(getSelectedTextRange));
+ document.getElementById("setSelectedTextRange").addEventListener("click", () => tryCatch(setSelectedTextRange));
+ document.getElementById("changeColor").addEventListener("click", () => tryCatch(changeColor));
+ document.getElementById("saveTextSelection").addEventListener("click", () => tryCatch(saveTextSelection));
+ document.getElementById("loadTextSelection").addEventListener("click", () => tryCatch(loadTextSelection));
async function getSelectedTextRange() {
// Gets the selected text range and prints data about the range on the task pane.
@@ -148,7 +148,7 @@ script:
}
language: typescript
template:
- content: |
+ content: |-
This sample shows how to get selected text, and how to select specific text.
@@ -163,7 +163,7 @@ template:
language: html
style:
- content: |
+ content: |-
section.samples {
margin-top: 20px;
}
@@ -182,15 +182,9 @@ style:
transition: max-height 0.2s ease-out;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
-
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/project/basics/basic-common-api-call.yaml b/samples/project/basics/basic-common-api-call.yaml
index e069060b8..f8d4d189a 100644
--- a/samples/project/basics/basic-common-api-call.yaml
+++ b/samples/project/basics/basic-common-api-call.yaml
@@ -7,8 +7,8 @@ host: PROJECT
api_set:
Selection: 1.1
script:
- content: |
- $("#run").on("click", run);
+ content: |-
+ document.getElementById("run").addEventListener("click", run);
function run() {
Office.context.document.getSelectedDataAsync(Office.CoercionType.Text, (asyncResult) => {
@@ -21,24 +21,17 @@ script:
}
language: typescript
template:
- content: |
+ content: |-
Run
language: html
style:
- content: |
- /* Your style goes here */
+ content: /* Your style goes here */
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
-
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/project/default.yaml b/samples/project/default.yaml
index 7f5b087a5..c73af1eeb 100644
--- a/samples/project/default.yaml
+++ b/samples/project/default.yaml
@@ -5,8 +5,8 @@ author: OfficeDev
host: PROJECT
api_set: {}
script:
- content: |
- $("#run").on("click", run);
+ content: |-
+ document.getElementById("run").addEventListener("click", run);
function run() {
Office.context.document.getSelectedDataAsync(Office.CoercionType.Text, (asyncResult) => {
@@ -19,7 +19,7 @@ script:
}
language: typescript
template:
- content: |
+ content: |-
Run
@@ -37,15 +37,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/web/default.yaml b/samples/web/default.yaml
index 12d365a1d..dba053526 100644
--- a/samples/web/default.yaml
+++ b/samples/web/default.yaml
@@ -5,15 +5,15 @@ author: OfficeDev
host: WEB
api_set: {}
script:
- content: |
- $("#run").on("click", run);
+ content: |-
+ document.getElementById("run").addEventListener("click", run);
function run() {
console.log("Your code goes here");
}
language: typescript
template:
- content: |
+ content: |-
Run
@@ -31,12 +31,6 @@ style:
min-width: 80px;
}
language: css
-libraries: |
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
-
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+libraries: |-
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
diff --git a/samples/word/01-basics/basic-api-call-es5.yaml b/samples/word/01-basics/basic-api-call-es5.yaml
index 0886ad057..a9cdf506b 100644
--- a/samples/word/01-basics/basic-api-call-es5.yaml
+++ b/samples/word/01-basics/basic-api-call-es5.yaml
@@ -8,7 +8,7 @@ api_set:
WordApi: '1.1'
script:
content: |-
- $("#run").on("click", () => tryCatch(run));
+ document.getElementById("run").addEventListener("click", () => tryCatch(run));
function run() {
return Word.run(function (context) {
@@ -55,15 +55,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
-
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/01-basics/basic-api-call.yaml b/samples/word/01-basics/basic-api-call.yaml
index 4128b7967..6aab3ed8e 100644
--- a/samples/word/01-basics/basic-api-call.yaml
+++ b/samples/word/01-basics/basic-api-call.yaml
@@ -8,7 +8,7 @@ api_set:
WordApi: '1.1'
script:
content: |-
- $("#run").on("click", () => tryCatch(run));
+ document.getElementById("run").addEventListener("click", () => tryCatch(run));
async function run() {
// Gets the current selection and changes the font color to red.
@@ -56,15 +56,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
-
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/01-basics/basic-common-api-call.yaml b/samples/word/01-basics/basic-common-api-call.yaml
index c71ebb2e5..d1b374d41 100644
--- a/samples/word/01-basics/basic-common-api-call.yaml
+++ b/samples/word/01-basics/basic-common-api-call.yaml
@@ -7,8 +7,8 @@ host: WORD
api_set:
Selection: 1.1
script:
- content: |
- $("#run").on("click", run);
+ content: |-
+ document.getElementById("run").addEventListener("click", run);
function run() {
Office.context.document.getSelectedDataAsync(Office.CoercionType.Text, (asyncResult) => {
@@ -21,7 +21,7 @@ script:
}
language: typescript
template:
- content: |
+ content: |-
This sample executes a code snippet that prints the selected text to the console. Make sure to enter and select text before clicking "Print selection".
@@ -42,15 +42,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/10-content-controls/content-control-onadded-event.yaml b/samples/word/10-content-controls/content-control-onadded-event.yaml
index 47fd52025..2ee82194f 100644
--- a/samples/word/10-content-controls/content-control-onadded-event.yaml
+++ b/samples/word/10-content-controls/content-control-onadded-event.yaml
@@ -6,11 +6,11 @@ host: WORD
api_set:
WordApi: '1.5'
script:
- content: |
- $("#register-event-handler").on("click", () => tryCatch(registerEventHandler));
- $("#insert-content-controls").on("click", () => tryCatch(insertContentControls));
- $("#deregister-event-handler").on("click", () => tryCatch(deregisterEventHandler));
- $("#setup").on("click", () => tryCatch(setup));
+ content: |-
+ document.getElementById("register-event-handler").addEventListener("click", () => tryCatch(registerEventHandler));
+ document.getElementById("insert-content-controls").addEventListener("click", () => tryCatch(insertContentControls));
+ document.getElementById("deregister-event-handler").addEventListener("click", () => tryCatch(deregisterEventHandler));
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
let eventContext;
@@ -93,14 +93,12 @@ template:
This sample demonstrates how to use the onAdded event with content controls.
-
Set up
Setup
-
Try it out
Register event handler.
@@ -132,13 +130,7 @@ style:
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/10-content-controls/content-control-ondatachanged-event.yaml b/samples/word/10-content-controls/content-control-ondatachanged-event.yaml
index 8e7df83e6..976769d1a 100644
--- a/samples/word/10-content-controls/content-control-ondatachanged-event.yaml
+++ b/samples/word/10-content-controls/content-control-ondatachanged-event.yaml
@@ -6,11 +6,11 @@ host: WORD
api_set:
WordApi: '1.5'
script:
- content: |
- $("#insert-content-controls").on("click", () => tryCatch(insertContentControls));
- $("#register-event-handlers").on("click", () => tryCatch(registerEventHandlers));
- $("#deregister-event-handlers").on("click", () => tryCatch(deregisterEventHandlers));
- $("#setup").on("click", () => tryCatch(setup));
+ content: |-
+ document.getElementById("insert-content-controls").addEventListener("click", () => tryCatch(insertContentControls));
+ document.getElementById("register-event-handlers").addEventListener("click", () => tryCatch(registerEventHandlers));
+ document.getElementById("deregister-event-handlers").addEventListener("click", () => tryCatch(deregisterEventHandlers));
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
let eventContexts = [];
@@ -110,14 +110,12 @@ template:
This sample demonstrates how to use the onDataChanged event on content controls.
-
Set up
Setup
-
Try it out
1. Insert content controls.
@@ -150,13 +148,7 @@ style:
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/10-content-controls/content-control-ondeleted-event.yaml b/samples/word/10-content-controls/content-control-ondeleted-event.yaml
index 535ecd315..e98eec7af 100644
--- a/samples/word/10-content-controls/content-control-ondeleted-event.yaml
+++ b/samples/word/10-content-controls/content-control-ondeleted-event.yaml
@@ -6,12 +6,12 @@ host: WORD
api_set:
WordApi: '1.5'
script:
- content: |
- $("#insert-content-controls").on("click", () => tryCatch(insertContentControls));
- $("#register-event-handlers").on("click", () => tryCatch(registerEventHandlers));
- $("#delete-content-control").on("click", () => tryCatch(deleteContentControl));
- $("#deregister-event-handlers").on("click", () => tryCatch(deregisterEventHandlers));
- $("#setup").on("click", () => tryCatch(setup));
+ content: |-
+ document.getElementById("insert-content-controls").addEventListener("click", () => tryCatch(insertContentControls));
+ document.getElementById("register-event-handlers").addEventListener("click", () => tryCatch(registerEventHandlers));
+ document.getElementById("delete-content-control").addEventListener("click", () => tryCatch(deleteContentControl));
+ document.getElementById("deregister-event-handlers").addEventListener("click", () => tryCatch(deregisterEventHandlers));
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
let eventContexts = [];
@@ -127,14 +127,12 @@ template:
This sample demonstrates how to use the onDeleted event on content controls.
-
Set up
Setup
-
Try it out
Insert content controls.
@@ -170,13 +168,7 @@ style:
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/10-content-controls/content-control-onentered-event.yaml b/samples/word/10-content-controls/content-control-onentered-event.yaml
index a1e2e93cb..4c7128dc0 100644
--- a/samples/word/10-content-controls/content-control-onentered-event.yaml
+++ b/samples/word/10-content-controls/content-control-onentered-event.yaml
@@ -6,11 +6,11 @@ host: WORD
api_set:
WordApi: '1.5'
script:
- content: |
- $("#insert-content-controls").on("click", () => tryCatch(insertContentControls));
- $("#register-event-handlers").on("click", () => tryCatch(registerEventHandlers));
- $("#deregister-event-handlers").on("click", () => tryCatch(deregisterEventHandlers));
- $("#setup").on("click", () => tryCatch(setup));
+ content: |-
+ document.getElementById("insert-content-controls").addEventListener("click", () => tryCatch(insertContentControls));
+ document.getElementById("register-event-handlers").addEventListener("click", () => tryCatch(registerEventHandlers));
+ document.getElementById("deregister-event-handlers").addEventListener("click", () => tryCatch(deregisterEventHandlers));
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
let eventContexts = [];
@@ -110,14 +110,12 @@ template:
This sample demonstrates how to use the onEntered event on content controls.
-
Set up
Setup
-
Try it out
1. Insert content controls.
@@ -150,13 +148,7 @@ style:
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/10-content-controls/content-control-onexited-event.yaml b/samples/word/10-content-controls/content-control-onexited-event.yaml
index 242550f03..c2e5b4eab 100644
--- a/samples/word/10-content-controls/content-control-onexited-event.yaml
+++ b/samples/word/10-content-controls/content-control-onexited-event.yaml
@@ -6,11 +6,11 @@ host: WORD
api_set:
WordApi: '1.5'
script:
- content: |
- $("#insert-content-controls").on("click", () => tryCatch(insertContentControls));
- $("#register-event-handlers").on("click", () => tryCatch(registerEventHandlers));
- $("#deregister-event-handlers").on("click", () => tryCatch(deregisterEventHandlers));
- $("#setup").on("click", () => tryCatch(setup));
+ content: |-
+ document.getElementById("insert-content-controls").addEventListener("click", () => tryCatch(insertContentControls));
+ document.getElementById("register-event-handlers").addEventListener("click", () => tryCatch(registerEventHandlers));
+ document.getElementById("deregister-event-handlers").addEventListener("click", () => tryCatch(deregisterEventHandlers));
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
let eventContexts = [];
@@ -110,14 +110,12 @@ template:
This sample demonstrates how to use the onExited event on content controls.
-
Set up
Setup
-
Try it out
1. Insert content controls.
@@ -151,13 +149,7 @@ style:
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/10-content-controls/content-control-onselectionchanged-event.yaml b/samples/word/10-content-controls/content-control-onselectionchanged-event.yaml
index 7f04b743d..989a07ac1 100644
--- a/samples/word/10-content-controls/content-control-onselectionchanged-event.yaml
+++ b/samples/word/10-content-controls/content-control-onselectionchanged-event.yaml
@@ -6,11 +6,11 @@ host: WORD
api_set:
WordApi: '1.5'
script:
- content: |
- $("#insert-content-controls").on("click", () => tryCatch(insertContentControls));
- $("#register-event-handlers").on("click", () => tryCatch(registerEventHandlers));
- $("#deregister-event-handlers").on("click", () => tryCatch(deregisterEventHandlers));
- $("#setup").on("click", () => tryCatch(setup));
+ content: |-
+ document.getElementById("insert-content-controls").addEventListener("click", () => tryCatch(insertContentControls));
+ document.getElementById("register-event-handlers").addEventListener("click", () => tryCatch(registerEventHandlers));
+ document.getElementById("deregister-event-handlers").addEventListener("click", () => tryCatch(deregisterEventHandlers));
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
let eventContexts = [];
@@ -109,14 +109,12 @@ template:
This sample demonstrates how to use the onSelectionChanged event on content controls.
-
Set up
Setup
-
Try it out
1. Insert content controls.
@@ -149,13 +147,7 @@ style:
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/10-content-controls/get-change-tracking-states.yaml b/samples/word/10-content-controls/get-change-tracking-states.yaml
index 59c3e7901..b59d84146 100644
--- a/samples/word/10-content-controls/get-change-tracking-states.yaml
+++ b/samples/word/10-content-controls/get-change-tracking-states.yaml
@@ -7,13 +7,13 @@ host: WORD
api_set:
WordApi: '1.5'
script:
- content: |
- $("#turn-on-change-tracking").on("click", () => tryCatch(turnOnChangeTracking));
- $("#insert-content-control").on("click", () => tryCatch(insertContentControlOnLastParagraph));
- $("#delete-content-control").on("click", () => tryCatch(deleteFirstContentControl));
- $("#turn-off-change-tracking").on("click", () => tryCatch(turnOffChangeTracking));
- $("#log-change-tracking-states").on("click", () => tryCatch(logChangeTrackingStates));
- $("#setup").on("click", () => tryCatch(setup));
+ content: |-
+ document.getElementById("turn-on-change-tracking").addEventListener("click", () => tryCatch(turnOnChangeTracking));
+ document.getElementById("insert-content-control").addEventListener("click", () => tryCatch(insertContentControlOnLastParagraph));
+ document.getElementById("delete-content-control").addEventListener("click", () => tryCatch(deleteFirstContentControl));
+ document.getElementById("turn-off-change-tracking").addEventListener("click", () => tryCatch(turnOffChangeTracking));
+ document.getElementById("log-change-tracking-states").addEventListener("click", () => tryCatch(logChangeTrackingStates));
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
async function turnOnChangeTracking() {
// Turns on change tracking.
@@ -121,14 +121,12 @@ template:
This sample demonstrates how to insert and delete control controls then get their change tracking state.
-
Set up
Setup
-
Try it out
@@ -163,13 +161,7 @@ style:
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/10-content-controls/insert-and-change-checkbox-content-control.yaml b/samples/word/10-content-controls/insert-and-change-checkbox-content-control.yaml
index b0c0589e3..2cda8dcd1 100644
--- a/samples/word/10-content-controls/insert-and-change-checkbox-content-control.yaml
+++ b/samples/word/10-content-controls/insert-and-change-checkbox-content-control.yaml
@@ -6,12 +6,12 @@ host: WORD
api_set:
WordApi: '1.7'
script:
- content: |
- $("#insert-controls").on("click", () => tryCatch(insertCheckboxContentControls));
- $("#toggle-control").on("click", () => tryCatch(toggleCheckboxContentControl));
- $("#change-controls").on("click", () => tryCatch(toggleCheckboxContentControls));
- $("#delete-control").on("click", () => tryCatch(deleteCheckboxContentControl));
- $("#setup").on("click", () => tryCatch(setup));
+ content: |-
+ document.getElementById("insert-controls").addEventListener("click", () => tryCatch(insertCheckboxContentControls));
+ document.getElementById("toggle-control").addEventListener("click", () => tryCatch(toggleCheckboxContentControl));
+ document.getElementById("change-controls").addEventListener("click", () => tryCatch(toggleCheckboxContentControls));
+ document.getElementById("delete-control").addEventListener("click", () => tryCatch(deleteCheckboxContentControl));
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
async function insertCheckboxContentControls() {
// Traverses each paragraph of the document and places a checkbox content control at the beginning of each.
@@ -185,14 +185,12 @@ template:
This sample demonstrates how to insert, change, and delete checkbox content controls.
-
Set up
Setup
-
Try it out
@@ -236,13 +234,7 @@ style:
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/10-content-controls/insert-and-change-combo-box-content-control.yaml b/samples/word/10-content-controls/insert-and-change-combo-box-content-control.yaml
index a0660bfaf..a0fee9f6f 100644
--- a/samples/word/10-content-controls/insert-and-change-combo-box-content-control.yaml
+++ b/samples/word/10-content-controls/insert-and-change-combo-box-content-control.yaml
@@ -6,14 +6,14 @@ host: WORD
api_set:
WordApi: '1.9'
script:
- content: |
- $("#insert-control").on("click", () => tryCatch(insertComboBoxContentControl));
- $("#add-item").on("click", () => tryCatch(addItemToComboBoxContentControl));
- $("#get-items").on("click", () => tryCatch(getListFromComboBoxContentControl));
- $("#delete-item").on("click", () => tryCatch(deleteItemFromComboBoxContentControl));
- $("#delete-list").on("click", () => tryCatch(deleteListFromComboBoxContentControl));
- $("#delete-control").on("click", () => tryCatch(deleteComboBoxContentControl));
- $("#setup").on("click", () => tryCatch(setup));
+ content: |-
+ document.getElementById("insert-control").addEventListener("click", () => tryCatch(insertComboBoxContentControl));
+ document.getElementById("add-item").addEventListener("click", () => tryCatch(addItemToComboBoxContentControl));
+ document.getElementById("get-items").addEventListener("click", () => tryCatch(getListFromComboBoxContentControl));
+ document.getElementById("delete-item").addEventListener("click", () => tryCatch(deleteItemFromComboBoxContentControl));
+ document.getElementById("delete-list").addEventListener("click", () => tryCatch(deleteListFromComboBoxContentControl));
+ document.getElementById("delete-control").addEventListener("click", () => tryCatch(deleteComboBoxContentControl));
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
async function insertComboBoxContentControl() {
// Places a combo box content control at the end of the selection.
@@ -247,14 +247,12 @@ template:
This sample demonstrates how to insert, change, and delete combo box content controls.
-
Set up
Setup
-
Try it out
@@ -318,13 +316,7 @@ style:
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/10-content-controls/insert-and-change-content-controls.yaml b/samples/word/10-content-controls/insert-and-change-content-controls.yaml
index ae89ef06a..961b5d982 100644
--- a/samples/word/10-content-controls/insert-and-change-content-controls.yaml
+++ b/samples/word/10-content-controls/insert-and-change-content-controls.yaml
@@ -7,10 +7,10 @@ host: WORD
api_set:
WordApi: '1.1'
script:
- content: |
- $("#insert-controls").on("click", () => tryCatch(insertContentControls));
- $("#change-controls").on("click", () => tryCatch(modifyContentControls));
- $("#setup").on("click", () => tryCatch(setup));
+ content: |-
+ document.getElementById("insert-controls").addEventListener("click", () => tryCatch(insertContentControls));
+ document.getElementById("change-controls").addEventListener("click", () => tryCatch(modifyContentControls));
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
async function insertContentControls() {
// Traverses each paragraph of the document and wraps a content control on each with either a even or odd tags.
@@ -104,14 +104,12 @@ template:
This sample demonstrates how to insert and change content control properties.
-
Set up
Setup
-
Try it out
Insert content controls on each paragraph.
@@ -139,13 +137,7 @@ style:
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/10-content-controls/insert-and-change-dropdown-list-content-control.yaml b/samples/word/10-content-controls/insert-and-change-dropdown-list-content-control.yaml
index cb99d13e3..36532629e 100644
--- a/samples/word/10-content-controls/insert-and-change-dropdown-list-content-control.yaml
+++ b/samples/word/10-content-controls/insert-and-change-dropdown-list-content-control.yaml
@@ -6,14 +6,14 @@ host: WORD
api_set:
WordApi: '1.9'
script:
- content: |
- $("#insert-control").on("click", () => tryCatch(insertDropdownListContentControl));
- $("#add-item").on("click", () => tryCatch(addItemToDropdownListContentControl));
- $("#get-items").on("click", () => tryCatch(getListFromDropdownListContentControl));
- $("#delete-item").on("click", () => tryCatch(deleteItemFromDropdownListContentControl));
- $("#delete-list").on("click", () => tryCatch(deleteListFromDropdownListContentControl));
- $("#delete-control").on("click", () => tryCatch(deleteDropdownListContentControl));
- $("#setup").on("click", () => tryCatch(setup));
+ content: |-
+ document.getElementById("insert-control").addEventListener("click", () => tryCatch(insertDropdownListContentControl));
+ document.getElementById("add-item").addEventListener("click", () => tryCatch(addItemToDropdownListContentControl));
+ document.getElementById("get-items").addEventListener("click", () => tryCatch(getListFromDropdownListContentControl));
+ document.getElementById("delete-item").addEventListener("click", () => tryCatch(deleteItemFromDropdownListContentControl));
+ document.getElementById("delete-list").addEventListener("click", () => tryCatch(deleteListFromDropdownListContentControl));
+ document.getElementById("delete-control").addEventListener("click", () => tryCatch(deleteDropdownListContentControl));
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
async function insertDropdownListContentControl() {
// Places a dropdown list content control at the end of the selection.
@@ -249,14 +249,12 @@ template:
This sample demonstrates how to insert, change, and delete dropdown list content controls.
-
Set up
Setup
-
Try it out
@@ -320,13 +318,7 @@ style:
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/15-images/insert-and-get-pictures.yaml b/samples/word/15-images/insert-and-get-pictures.yaml
index 1c3c3e08a..ee39795ab 100644
--- a/samples/word/15-images/insert-and-get-pictures.yaml
+++ b/samples/word/15-images/insert-and-get-pictures.yaml
@@ -6,10 +6,10 @@ host: WORD
api_set:
WordApiDesktop: '1.1'
script:
- content: |
- $("#setup").on("click", () => tryCatch(setup));
- $("#insert").on("click", () => tryCatch(insertImage));
- $("#get").on("click", () => tryCatch(getImage));
+ content: |-
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
+ document.getElementById("insert").addEventListener("click", () => tryCatch(insertImage));
+ document.getElementById("get").addEventListener("click", () => tryCatch(getImage));
async function insertImage() {
// Inserts an image anchored to the last paragraph.
@@ -75,14 +75,12 @@ template:
This sample demonstrates how to insert and get inline pictures in a document.
-
Set up
Setup
-
Try it out
@@ -106,15 +104,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/20-lists/insert-list.yaml b/samples/word/20-lists/insert-list.yaml
index 22237ea74..c899c16df 100644
--- a/samples/word/20-lists/insert-list.yaml
+++ b/samples/word/20-lists/insert-list.yaml
@@ -7,9 +7,9 @@ host: WORD
api_set:
WordApi: '1.3'
script:
- content: |
- $("#insert-list").on("click", () => tryCatch(insertList));
- $("#setup").on("click", () => tryCatch(setup));
+ content: |-
+ document.getElementById("insert-list").addEventListener("click", () => tryCatch(insertList));
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
async function insertList() {
// This example starts a new list with the second paragraph.
@@ -79,14 +79,12 @@ template:
This sample demonstrates how to insert and change lists.
-
Set up
Add text
-
Try it out
@@ -109,13 +107,7 @@ style:
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/20-lists/manage-list-styles.yaml b/samples/word/20-lists/manage-list-styles.yaml
index 7816bab24..99e7eab68 100644
--- a/samples/word/20-lists/manage-list-styles.yaml
+++ b/samples/word/20-lists/manage-list-styles.yaml
@@ -7,9 +7,9 @@ host: WORD
api_set:
WordApiDesktop: '1.1'
script:
- content: |
- $("#count").on("click", () => tryCatch(getCount));
- $("#properties").on("click", () => tryCatch(getProperties));
+ content: |-
+ document.getElementById("count").addEventListener("click", () => tryCatch(getCount));
+ document.getElementById("properties").addEventListener("click", () => tryCatch(getProperties));
async function getCount() {
// Gets the available list styles stored with the document.
@@ -76,7 +76,6 @@ template:
This sample shows how to get the list styles in the current document.
-
Try it out
@@ -89,7 +88,6 @@ template:
Get properties
-
language: html
style:
@@ -107,10 +105,6 @@ style:
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
- core-js@2.4.1/client/core.min.js
- @types/core-js
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/20-lists/organize-list.yaml b/samples/word/20-lists/organize-list.yaml
index 28eaa77ab..ccfef74ef 100644
--- a/samples/word/20-lists/organize-list.yaml
+++ b/samples/word/20-lists/organize-list.yaml
@@ -7,10 +7,10 @@ host: WORD
api_set:
WordApi: '1.3'
script:
- content: |
- $("#insert-list").on("click", () => tryCatch(insertOrganizeList));
- $("#get-list-props").on("click", () => tryCatch(getListProps));
- $("#setup").on("click", () => tryCatch(setup));
+ content: |-
+ document.getElementById("insert-list").addEventListener("click", () => tryCatch(insertOrganizeList));
+ document.getElementById("get-list-props").addEventListener("click", () => tryCatch(getListProps));
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
async function insertOrganizeList() {
// Inserts a list starting with the first paragraph then set numbering and bullet types of the list items.
@@ -104,14 +104,12 @@ template:
This sample demonstrates how to create and organize a list.
-
Set up
Add text
-
Try it out
@@ -137,13 +135,7 @@ style:
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/25-paragraph/get-paragraph-on-insertion-point.yaml b/samples/word/25-paragraph/get-paragraph-on-insertion-point.yaml
index 19cc3ced4..e58e52ac5 100644
--- a/samples/word/25-paragraph/get-paragraph-on-insertion-point.yaml
+++ b/samples/word/25-paragraph/get-paragraph-on-insertion-point.yaml
@@ -7,10 +7,10 @@ host: WORD
api_set:
WordApi: '1.1'
script:
- content: |
- $("#get-paragraph").on("click", () => tryCatch(getParagraph));
- $("#get-sentences").on("click", () => tryCatch(getSentences));
- $("#setup").on("click", () => tryCatch(setup));
+ content: |-
+ document.getElementById("get-paragraph").addEventListener("click", () => tryCatch(getParagraph));
+ document.getElementById("get-sentences").addEventListener("click", () => tryCatch(getSentences));
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
async function getParagraph() {
await Word.run(async (context) => {
@@ -83,14 +83,12 @@ template:
This sample demonstrates how to get the paragraph and paragraph sentences associated with the current insertion point.
-
Set up
Setup
-
Try it out
Select an insertion point in the document.
@@ -117,13 +115,7 @@ style:
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/25-paragraph/get-text.yaml b/samples/word/25-paragraph/get-text.yaml
index ebd2d19e3..06c427331 100644
--- a/samples/word/25-paragraph/get-text.yaml
+++ b/samples/word/25-paragraph/get-text.yaml
@@ -7,9 +7,9 @@ host: WORD
api_set:
WordApi: '1.7'
script:
- content: |
- $("#run").on("click", () => tryCatch(run));
- $("#setup").on("click", () => tryCatch(setup));
+ content: |-
+ document.getElementById("run").addEventListener("click", () => tryCatch(run));
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
async function run() {
await Word.run(async (context) => {
@@ -67,14 +67,12 @@ template:
Word.
-
Set up
Setup
-
Try it out
@@ -95,15 +93,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/25-paragraph/get-word-count.yaml b/samples/word/25-paragraph/get-word-count.yaml
index 91478aa3f..00d26a8e6 100644
--- a/samples/word/25-paragraph/get-word-count.yaml
+++ b/samples/word/25-paragraph/get-word-count.yaml
@@ -7,9 +7,9 @@ host: WORD
api_set:
WordApi: '1.1'
script:
- content: |
- $("#setup").on("click", () => tryCatch(setup));
- $("#count").on("click", () => tryCatch(run));
+ content: |-
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
+ document.getElementById("count").addEventListener("click", () => tryCatch(run));
async function run() {
// Counts how many times each term appears in the document.
@@ -91,14 +91,12 @@ template:
This sample demonstrates how to get the count for words and terms in the document body.
-
Set up
Setup
-
Try it out
Get the word/term count.
@@ -122,15 +120,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/word/25-paragraph/insert-formatted-text.yaml b/samples/word/25-paragraph/insert-formatted-text.yaml
index fc7c89344..66b2fe227 100644
--- a/samples/word/25-paragraph/insert-formatted-text.yaml
+++ b/samples/word/25-paragraph/insert-formatted-text.yaml
@@ -8,9 +8,9 @@ api_set:
WordApi: '1.1'
script:
content: |-
- $("#add-text").on("click", () => tryCatch(addFormattedText));
- $("#add-paragraph").on("click", () => tryCatch(addFormattedParagraph));
- $("#add-preset").on("click", () => tryCatch(addPreStyledFormattedText));
+ document.getElementById("add-text").addEventListener("click", () => tryCatch(addFormattedText));
+ document.getElementById("add-paragraph").addEventListener("click", () => tryCatch(addFormattedParagraph));
+ document.getElementById("add-preset").addEventListener("click", () => tryCatch(addPreStyledFormattedText));
async function addFormattedText() {
await Word.run(async (context) => {
@@ -79,7 +79,6 @@ template:
This sample shows how to insert basic formatted text and apply built-in styles.
-