Skip to content

Commit c9ed765

Browse files
[All hosts] Remove library dependencies from snippets (#970)
* Run script to remove library dependencies * Run yarn script
1 parent 7cdbf47 commit c9ed765

File tree

345 files changed

+2672
-5973
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

345 files changed

+2672
-5973
lines changed

samples/excel/01-basics/basic-api-call-es5.yaml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ host: EXCEL
77
api_set:
88
ExcelApi: '1.1'
99
script:
10-
content: |
11-
$("#run").on("click", () => tryCatch(run));
10+
content: |-
11+
document.getElementById("run").addEventListener("click", () => tryCatch(run));
1212
1313
function run() {
1414
return Excel.run(function (context) {
@@ -33,11 +33,10 @@ script:
3333
}
3434
language: typescript
3535
template:
36-
content: |
36+
content: |-
3737
<section class="ms-Fabric ms-font-m">
3838
<p class="ms-font-m">This sample demonstrates basic Excel API calls.</p>
3939
</section>
40-
4140
<section class="ms-Fabric samples ms-font-m">
4241
<h3>Try it out</h3>
4342
<p class="ms-font-m">Select some cells in the worksheet, then press <b>Highlight selected range</b>.</p>
@@ -59,15 +58,9 @@ style:
5958
min-width: 80px;
6059
}
6160
language: css
62-
libraries: |
61+
libraries: |-
6362
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
64-
@types/office-js
65-
66-
[email protected]/dist/css/fabric.min.css
67-
[email protected]/dist/css/fabric.components.min.css
68-
69-
[email protected]/client/core.min.js
70-
@types/core-js
63+
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
7164
72-
jquery@3.1.1
73-
65+
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
66+
https://unpkg.com/[email protected]/dist/css/fabric.components.min.css

samples/excel/01-basics/basic-api-call.yaml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ host: EXCEL
77
api_set:
88
ExcelApi: '1.1'
99
script:
10-
content: |
11-
$("#run").on("click", () => tryCatch(run));
10+
content: |-
11+
document.getElementById("run").addEventListener("click", () => tryCatch(run));
1212
1313
async function run() {
1414
await Excel.run(async (context) => {
@@ -38,7 +38,6 @@ template:
3838
<section class="ms-Fabric ms-font-m">
3939
<p class="ms-font-m">This sample demonstrates basic Excel API calls.</p>
4040
</section>
41-
4241
<section class="ms-Fabric samples ms-font-m">
4342
<h3>Try it out</h3>
4443
<p class="ms-font-m">Select some cells in the worksheet, then press <b>Highlight selected range</b>.</p>
@@ -60,15 +59,9 @@ style:
6059
min-width: 80px;
6160
}
6261
language: css
63-
libraries: |
62+
libraries: |-
6463
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
65-
@types/office-js
66-
67-
[email protected]/dist/css/fabric.min.css
68-
[email protected]/dist/css/fabric.components.min.css
69-
70-
[email protected]/client/core.min.js
71-
@types/core-js
64+
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
7265
73-
jquery@3.1.1
74-
66+
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
67+
https://unpkg.com/[email protected]/dist/css/fabric.components.min.css

samples/excel/01-basics/basic-common-api-call.yaml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ host: EXCEL
77
api_set:
88
Selection: 1.1
99
script:
10-
content: |
11-
$("#run").on("click", run);
10+
content: |-
11+
document.getElementById("run").addEventListener("click", run);
1212
1313
function run() {
1414
Office.context.document.getSelectedDataAsync(
@@ -24,11 +24,10 @@ script:
2424
}
2525
language: typescript
2626
template:
27-
content: |
27+
content: |-
2828
<section class="ms-Fabric ms-font-m">
2929
<p>This sample uses the Common APIs compatible with Office 2013.</p>
3030
</section>
31-
3231
<section class="ms-Fabric samples ms-font-m">
3332
<h3>Try it out</h3>
3433
<p>Select a cell in the worksheet and press <b>Write to console</b> to see the contents of that cell in the console.</p>
@@ -39,7 +38,7 @@ template:
3938
</section>
4039
language: html
4140
style:
42-
content: |
41+
content: |-
4342
section.samples {
4443
margin-top: 20px;
4544
}
@@ -51,15 +50,9 @@ style:
5150
min-width: 80px;
5251
}
5352
language: css
54-
libraries: |
53+
libraries: |-
5554
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
56-
@types/office-js
57-
58-
[email protected]/dist/css/fabric.min.css
59-
[email protected]/dist/css/fabric.components.min.css
60-
61-
[email protected]/client/core.min.js
62-
@types/core-js
55+
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
6356
64-
jquery@3.1.1
65-
57+
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
58+
https://unpkg.com/[email protected]/dist/css/fabric.components.min.css

samples/excel/10-chart/chart-axis-formatting.yaml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ host: EXCEL
66
api_set:
77
ExcelApi: '1.8'
88
script:
9-
content: |
10-
$("#setup").on("click", () => tryCatch(setup));
11-
$("#format-horizontal-axis").on("click", () => tryCatch(formatHorizontalAxis));
12-
$("#format-vertical-axis").on("click", () => tryCatch(formatVerticalAxis));
9+
content: |-
10+
document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
11+
document.getElementById("format-horizontal-axis").addEventListener("click", () => tryCatch(formatHorizontalAxis));
12+
document.getElementById("format-vertical-axis").addEventListener("click", () => tryCatch(formatVerticalAxis));
1313
1414
async function formatHorizontalAxis() {
1515
await Excel.run(async (context) => {
@@ -118,33 +118,29 @@ script:
118118
language: typescript
119119
template:
120120
content: |-
121-
122121
<section class="ms-Fabric ms-font-m">
123122
<p>This sample shows how to format the vertical and horizontal axis in a chart.</p>
124123
</section>
125-
126124
<section class="ms-Fabric setup ms-font-m">
127125
<h3>Set up</h3>
128126
<button id="setup" class="ms-Button">
129127
<span class="ms-Button-label">Add sample data</span>
130128
</button>
131129
</section>
132-
133130
<section class="ms-Fabric samples ms-font-m">
134131
<h3>Try it out</h3>
135132
<button id="format-horizontal-axis" class="ms-Button">
136133
<span class="ms-Button-label">Format horizontal axis</span>
137134
</button>
138135
</section>
139-
140136
<section class="ms-Fabric samples ms-font-m">
141137
<button id="format-vertical-axis" class="ms-Button">
142138
<span class="ms-Button-label">Format vertical axis</span>
143139
</button>
144140
</section>
145141
language: html
146142
style:
147-
content: |
143+
content: |-
148144
section.samples {
149145
margin-top: 20px;
150146
}
@@ -158,13 +154,7 @@ style:
158154
language: css
159155
libraries: |-
160156
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
161-
@types/office-js
162-
163-
[email protected]/dist/css/fabric.min.css
164-
[email protected]/dist/css/fabric.components.min.css
165-
166-
[email protected]/client/core.min.js
167-
@types/core-js
157+
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
168158
169-
jquery@3.1.1
170-
159+
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
160+
https://unpkg.com/[email protected]/dist/css/fabric.components.min.css

samples/excel/10-chart/chart-axis.yaml

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ api_set:
77
ExcelApi: '1.7'
88
script:
99
content: |-
10-
$("#setup").on("click", () => tryCatch(setup));
11-
$("#get-axis-unit").on("click", () => tryCatch(getAxisUnit));
12-
$("#change-axis-unit").on("click", () => tryCatch(changeAxisUnit));
13-
$("#remove-axis-label").on("click", () => tryCatch(removeAxisLabel));
14-
$("#show-axis-label").on("click", () => tryCatch(showAxisLabel));
15-
$("#set-axis-title").on("click", () => tryCatch(setAxisTitle));
10+
document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
11+
document.getElementById("get-axis-unit").addEventListener("click", () => tryCatch(getAxisUnit));
12+
document.getElementById("change-axis-unit").addEventListener("click", () => tryCatch(changeAxisUnit));
13+
document.getElementById("remove-axis-label").addEventListener("click", () => tryCatch(removeAxisLabel));
14+
document.getElementById("show-axis-label").addEventListener("click", () => tryCatch(showAxisLabel));
15+
document.getElementById("set-axis-title").addEventListener("click", () => tryCatch(setAxisTitle));
1616
1717
async function getAxisUnit() {
1818
await Excel.run(async (context) => {
@@ -173,47 +173,41 @@ template:
173173
<section class="ms-Fabric ms-font-m">
174174
<p>This sample shows how to get, set, and remove axis unit, label and title in a chart.</p>
175175
</section>
176-
177176
<section class="ms-Fabric setup ms-font-m">
178177
<h3>Set up</h3>
179178
<button id="setup" class="ms-Button">
180179
<span class="ms-Button-label">Add sample data</span>
181180
</button>
182181
</section>
183-
184182
<section class="ms-Fabric samples ms-font-m">
185183
<h3>Try it out</h3>
186184
<button id="get-axis-unit" class="ms-Button">
187185
<span class="ms-Button-label">Get axis unit</span>
188186
</button>
189187
</section>
190-
191188
<section class="ms-Fabric samples ms-font-m">
192189
<button id="change-axis-unit" class="ms-Button">
193190
<span class="ms-Button-label">Change axis unit</span>
194191
</button>
195192
</section>
196-
197193
<section class="ms-Fabric samples ms-font-m">
198194
<button id="remove-axis-label" class="ms-Button">
199195
<span class="ms-Button-label">Remove axis label</span>
200196
</button>
201197
</section>
202-
203198
<section class="ms-Fabric samples ms-font-m">
204199
<button id="show-axis-label" class="ms-Button">
205200
<span class="ms-Button-label">Show axis label</span>
206201
</button>
207202
</section>
208-
209203
<section class="ms-Fabric samples ms-font-m">
210204
<button id="set-axis-title" class="ms-Button">
211205
<span class="ms-Button-label">Set axis title</span>
212206
</button>
213207
</section>
214208
language: html
215209
style:
216-
content: |
210+
content: |-
217211
section.samples {
218212
margin-top: 20px;
219213
}
@@ -225,15 +219,9 @@ style:
225219
min-width: 80px;
226220
}
227221
language: css
228-
libraries: |
222+
libraries: |-
229223
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
230-
@types/office-js
231-
232-
[email protected]/dist/css/fabric.min.css
233-
[email protected]/dist/css/fabric.components.min.css
234-
235-
[email protected]/client/core.min.js
236-
@types/core-js
224+
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
237225
238-
jquery@3.1.1
239-
226+
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
227+
https://unpkg.com/[email protected]/dist/css/fabric.components.min.css

samples/excel/10-chart/chart-bubble-chart.yaml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ host: EXCEL
77
api_set:
88
ExcelApi: '1.12'
99
script:
10-
content: |
11-
$("#setup").on("click", () => tryCatch(setup));
12-
$("#create-bubble-chart").on("click", () => tryCatch(createBubbleChart));
13-
$("#get-chart-series-dimension-values").on("click", () => tryCatch(getChartSeriesDimensionValues));
10+
content: |-
11+
document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
12+
document.getElementById("create-bubble-chart").addEventListener("click", () => tryCatch(createBubbleChart));
13+
document.getElementById("get-chart-series-dimension-values").addEventListener("click", () => tryCatch(getChartSeriesDimensionValues));
14+
1415
async function createBubbleChart() {
1516
await Excel.run(async (context) => {
1617
/*
@@ -57,6 +58,7 @@ script:
5758
await context.sync();
5859
});
5960
}
61+
6062
async function getChartSeriesDimensionValues() {
6163
await Excel.run(async (context) => {
6264
const sheet = context.workbook.worksheets.getItem("Sample");
@@ -120,14 +122,12 @@ template:
120122
<section class="ms-Fabric ms-font-m">
121123
<p>This sample shows how to create a bubble chart, with each chart series (or bubble) representing a single table row.</p>
122124
</section>
123-
124125
<section class="ms-Fabric setup ms-font-m">
125126
<h3>Set up</h3>
126127
<button id="setup" class="ms-Button">
127128
<span class="ms-Button-label">Create table</span>
128129
</button>
129130
</section>
130-
131131
<section class="ms-Fabric samples ms-font-m">
132132
<h3>Try it out</h3>
133133
<button id="create-bubble-chart" class="ms-Button">
@@ -140,7 +140,7 @@ template:
140140
</section>
141141
language: html
142142
style:
143-
content: |
143+
content: |-
144144
section.samples {
145145
margin-top: 20px;
146146
}
@@ -152,15 +152,9 @@ style:
152152
min-width: 80px;
153153
}
154154
language: css
155-
libraries: |
155+
libraries: |-
156156
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
157-
@types/office-js
158-
159-
[email protected]/dist/css/fabric.min.css
160-
[email protected]/dist/css/fabric.components.min.css
161-
162-
[email protected]/client/core.min.js
163-
@types/core-js
157+
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
164158
165-
jquery@3.1.1
166-
159+
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
160+
https://unpkg.com/[email protected]/dist/css/fabric.components.min.css

0 commit comments

Comments
 (0)