Skip to content

Commit 51f90cb

Browse files
committed
Update js fenced code blocs to javascript
- references SharePoint#5926
1 parent d34707e commit 51f90cb

File tree

33 files changed

+161
-161
lines changed

33 files changed

+161
-161
lines changed

docs/general-development/social-feed-rest-api-reference-for-sharepoint.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3048,7 +3048,7 @@ The following response example represents the unlocked thread. The **Attributes*
30483048
> [!NOTE]
30493049
> The values of thread and post **Id** properties are too long to send in a URL, so you have to send them in the request body. As a result, even read-only operations that are logically **GET** requests must be sent as **POST** requests. For example, to get a thread, you have to send a **POST** request and pass the thread **Id** as an entity in the request body.
30503050
3051-
```js
3051+
```javascript
30523052
var endpoint = siteUrl + '/_api/social.feed/post';
30533053
var postId = '1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602';
30543054

@@ -3083,7 +3083,7 @@ $.ajax({
30833083

30843084

30853085

3086-
```js
3086+
```javascript
30873087
var endpoint = <site url> + '/_api/social.feed/my/feed/post';
30883088
var postContent = 'Posted with REST.';
30893089

docs/solution-guidance/Localize-UI-elements-sample-app-for-SharePoint.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ The following figure shows the start page for Scenario 1.
119119
120120
The **AddJSLink** method is part of the JavaScriptExtensions.cs file in **OfficeDevPnP.Core**. **AddJSLink** requires that you supply a string representing the identifier to assign to the custom action, and a string containing a semicolon delimited list of URLs to the JavaScript files that you want to add to the host web. Note that this code sample adds a reference to Scripts\scenario1.js, which adds a status bar message to the host web.
121121

122-
```js
122+
```javascript
123123
protected void btnSubmit_Click(object sender, EventArgs e)
124124
{
125125
var spContext = SharePointContextProvider.Current.GetSharePointContext(Context);
@@ -135,7 +135,7 @@ protected void btnSubmit_Click(object sender, EventArgs e)
135135
> [!NOTE]
136136
> SharePoint uses Minimal Download Strategy to reduce the amount of data the browser downloads when users navigate between pages on a SharePoint site. In scenario1.js, the following code ensures that whether Minimal Download Strategy is used on your SharePoint site, the **RemoteManager_Inject** method is always called to run the JavaScript code to add the status bar message to the host web. For more information, see [Minimal Download Strategy overview](../general-development/minimal-download-strategy-overview.md).
137137
>
138-
> ```js
138+
> ```javascript
139139
if ("undefined" != typeof g_MinimalDownload &amp;&amp; g_MinimalDownload &amp;&amp; (window.___location.pathname.toLowerCase()).endsWith("/_layouts/15/start.aspx") &amp;&amp; "undefined" != typeof asyncDeltaManager) {
140140
// Register script for MDS if possible.
141141
RegisterModuleInit("scenario1.js", RemoteManager_Inject); //MDS registration
@@ -150,7 +150,7 @@ protected void btnSubmit_Click(object sender, EventArgs e)
150150
> [!NOTE]
151151
> Some JavaScript files may depend on other JavaScript files to be loaded first before they can run and complete successfully. The following code construct from **RemoteManager_Inject** uses the **loadScript** function in scenario1.js to first load jQuery, and then continue running the remaining JavaScript code.
152152
>
153-
> ```js
153+
> ```javascript
154154
var jQuery = "https://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.0.2.min.js";
155155
// Load jQuery first, and then continue running the rest of the code.
156156
loadScript(jQuery, function () {
@@ -195,7 +195,7 @@ Similar to Scenario 1, **btnSubmit\_Click** in scenario2.aspx.cs calls **AddJsLi
195195
196196
- Replaces **my quicklaunch entry** with the value of the **quickLauch\_Scenario2** variable read from the JavaScript resource file.
197197
198-
```js
198+
```javascript
199199
function RemoteManager_Inject() {
200200
201201
var jQuery = "https://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.0.2.min.js";

docs/solution-guidance/create-ux-controls-by-using-sharepoint-provider-hosted-add-ins.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The Scripts folder of the Core.PeoplePickerWeb project contains app.js and peopl
5151

5252
The app.js file then creates and configures a people picker control.
5353

54-
```js
54+
```javascript
5555
//Make a people picker control.
5656
//1. context = SharePoint Client Context object
5757
//2. $('#spanAdministrators') = SPAN that will 'host' the people picker control
@@ -70,7 +70,7 @@ peoplePicker.Initialize();
7070

7171
The people picker control queries the **ClientPeoplePickerWebServiceInterface** object in the JSOM library to initiate searches for users whose names match the character strings entered.
7272

73-
```js
73+
```javascript
7474
if (searchText.length >= parent.GetMinimalCharactersBeforeSearching()) {
7575
resultDisplay = 'Searching...';
7676
if (typeof resultsSearching != 'undefined') {
@@ -122,7 +122,7 @@ When you choose the **Setup term store** button, the add-in:
122122
123123
The following code in the **TaxonomyHelper** class verifies that the required languages are enabled, and if they're not, it enables them.
124124
125-
```js
125+
```javascript
126126
var languages = new int[] { 1031, 1033, 1036, 1053 };
127127
Array.ForEach(languages, l => {
128128
if (!termStore.Languages.Contains(l))
@@ -142,7 +142,7 @@ termGroup = termStore.CreateGroup("Taxonomy Navigation", groupId);
142142
143143
Finally, the following code in the same **TaxonomyHelper** class creates each new term, along with labels for the German, French, and Swedish languages. It also sets a value for the **\_Sys\_Nav\_SimpleLinkUrl** property, which is equivalent to the **Simple Link or Header** property in the Term Store Management Tool. In this case, the URL for each term points back to the root site.
144144
145-
```js
145+
```javascript
146146
var term = termSet.CreateTerm(termName, 1033, Guid.NewGuid());
147147
term.CreateLabel(termNameGerman, 1031, false);
148148
term.CreateLabel(termNameFrench, 1036, false);
@@ -156,7 +156,7 @@ Next, the add-in inserts the topnav.js file into the root folder of the host sit
156156
157157
The following code in the topnav.js file uses JSOM to check for the user's preferred language.
158158
159-
```js
159+
```javascript
160160
var targetUser = "i:0#.f|membership|" + _spPageContextInfo.userLoginName;
161161
context = new SP.ClientContext.get_current();
162162
var peopleManager = new SP.UserProfiles.PeopleManager(context);
@@ -167,7 +167,7 @@ var userProperty = peopleManager.getUserProfilePropertyFor(targetUser, "SPS-MUIL
167167
168168
The add-in then determines whether the user's language preference matches one of the enabled languages. If it finds a match, the following code gets the terms and the associated labels for the user's preferred language.
169169
170-
```js
170+
```javascript
171171
while (termEnumerator.moveNext()) {
172172
var currentTerm = termEnumerator.get_current();
173173
var label = currentTerm.getDefaultLabel(lcid);
@@ -181,7 +181,7 @@ while (termEnumerator.moveNext()) {
181181
182182
Finally, the following code in the topnav.js file inserts links that contain the terms into the top navigational element of the host site.
183183
184-
```js
184+
```javascript
185185
html += "<ul style='margin-top: 0px; margin-bottom: 0px;'>"
186186
for (var i in termItems) {
187187
var term = termItems[i];
@@ -230,7 +230,7 @@ The Scripts folder of the Core.TaxonomyPicker project contains app.js and taxono
230230
231231
The app.js file then creates and configures a taxonomy picker control.
232232
233-
```js
233+
```javascript
234234
// Load scripts for calling taxonomy APIs.
235235
$.getScript(layoutsRoot + 'init.js',
236236
function () {
@@ -247,7 +247,7 @@ The app.js file then creates and configures a taxonomy picker control.
247247
248248
The taxonomy picker control uses the following code to open a **TaxonomySession** instance in the JSOM to load all the terms from the term store.
249249
250-
```js
250+
```javascript
251251
// Get the taxonomy session by using CSOM.
252252
var taxSession = SP.Taxonomy.TaxonomySession.getTaxonomySession(spContext);
253253
//Use the default term store...this could be extended here to support additional term stores.

0 commit comments

Comments
 (0)