Skip to content

Commit f131777

Browse files
committed
Small documentation updates
1 parent c5e72ed commit f131777

File tree

1 file changed

+81
-67
lines changed

1 file changed

+81
-67
lines changed

Samples/Core.Jsom.Navigation/readme.md

+81-67
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ None
1414
### Solution ###
1515
Solution | Author(s)
1616
---------|----------
17-
Core.Jsom.Navigation | Pete Filicetti
17+
Core.Jsom.Navigation | Pete Filicetti (**Microsoft**)
1818

1919
### Version history ###
2020
Version | Date | Comments
2121
---------| -----| --------
22-
1.0 | September 17, 2014 | Initial release
22+
1.0 | September 17th 2014 | Initial release
2323

2424
### Disclaimer ###
2525
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
@@ -38,111 +38,125 @@ The following code shows how to initialize the URLs needed for operation.
3838

3939
Code snippet:
4040

41-
var hostWebUrl = decodeURIComponent(getQueryStringParameter('SPHostUrl'));
42-
var appWebUrl = decodeURIComponent(getQueryStringParameter('SPAppWebUrl'));
41+
```JavaScript
42+
var hostWebUrl = decodeURIComponent(getQueryStringParameter('SPHostUrl'));
43+
var appWebUrl = decodeURIComponent(getQueryStringParameter('SPAppWebUrl'));
4344

44-
coreNavigation.initialize(appWebUrl, hostWebUrl);
45+
coreNavigation.initialize(appWebUrl, hostWebUrl);
46+
```
4547

4648
## Add a node to top navigation ##
4749
Description:
4850
The following code shows how to call the function to add a node to the top level navigation.
4951

5052
Code snippet:
5153

52-
coreNavigation.addNavigationNode("Test", "http://www.microsoft.com", null, false)
53-
.done(
54-
function() {
55-
$("#statusMessage").html('Added top nav node \'Test\'');
56-
})
57-
.fail(
58-
function(message) {
59-
$("#statusMessage").html('Failed to add top nav node \'Test\': ' + message);
60-
});
54+
```JavaScript
55+
coreNavigation.addNavigationNode("Test", "http://www.microsoft.com", null, false)
56+
.done(
57+
function() {
58+
$("#statusMessage").html('Added top nav node \'Test\'');
59+
})
60+
.fail(
61+
function(message) {
62+
$("#statusMessage").html('Failed to add top nav node \'Test\': ' + message);
63+
});
64+
```
6165

6266
## Delete a node from top navigation ##
6367
Description:
6468
The following code shows how to call the function to delete a node from the top level navigation.
6569

6670
Code snippet:
6771

68-
coreNavigation.deleteNavigationNode("Test", null, false)
69-
.done(
70-
function() {
71-
$("#statusMessage").html('Removed top nav node \'Test\'');
72-
})
73-
.fail(
74-
function(message) {
75-
$("#statusMessage").html('Failed to remove top nav node \'Test\': ' + message);
76-
});
72+
```JavaScript
73+
coreNavigation.deleteNavigationNode("Test", null, false)
74+
.done(
75+
function() {
76+
$("#statusMessage").html('Removed top nav node \'Test\'');
77+
})
78+
.fail(
79+
function(message) {
80+
$("#statusMessage").html('Failed to remove top nav node \'Test\': ' + message);
81+
});
82+
```
7783

7884
## Add parent and child nodes to quick launch ##
7985
Description:
8086
The following code shows how to call the function to add parent and child nodes to quick launch.
8187

8288
Code snippet:
8389

84-
coreNavigation.addNavigationNode("Parent", "#", null, true)
85-
.then(
86-
function() {
87-
return coreNavigation.addNavigationNode("Child", "http://www.microsoft.com", 'Parent', true);
88-
})
89-
.done(
90-
function() {
91-
$("#statusMessage").html('Added quick launch nodes \'Parent\' and \'Child\'');
92-
})
93-
.fail(
94-
function(message) {
95-
$("#statusMessage").html('Failed to add quick launch nodes \'Parent\' and \'Child\': ' + message);
96-
});
90+
```JavaScript
91+
coreNavigation.addNavigationNode("Parent", "#", null, true)
92+
.then(
93+
function() {
94+
return coreNavigation.addNavigationNode("Child", "http://www.microsoft.com", 'Parent', true);
95+
})
96+
.done(
97+
function() {
98+
$("#statusMessage").html('Added quick launch nodes \'Parent\' and \'Child\'');
99+
})
100+
.fail(
101+
function(message) {
102+
$("#statusMessage").html('Failed to add quick launch nodes \'Parent\' and \'Child\': ' + message);
103+
});
104+
```
97105

98106
## Delete parent and child nodes from quick launch ##
99107
Description:
100108
The following code shows how to call the function to delete parent and child nodes from quick launch.
101109

102110
Code snippet:
103111

104-
coreNavigation.deleteNavigationNode("Child", "Parent", true)
105-
.then(
106-
function() {
107-
return coreNavigation.deleteNavigationNode("Parent", null, true);
108-
})
109-
.done(
110-
function() {
111-
$("#statusMessage").html('Deleted quick launch nodes \'Parent\' and \'Child\'');
112-
})
113-
.fail(
114-
function(message) {
115-
$("#statusMessage").html('Failed to delete quick launch nodes \'Parent\' and \'Child\': ' + message);
116-
});
112+
```JavaScript
113+
coreNavigation.deleteNavigationNode("Child", "Parent", true)
114+
.then(
115+
function() {
116+
return coreNavigation.deleteNavigationNode("Parent", null, true);
117+
})
118+
.done(
119+
function() {
120+
$("#statusMessage").html('Deleted quick launch nodes \'Parent\' and \'Child\'');
121+
})
122+
.fail(
123+
function(message) {
124+
$("#statusMessage").html('Failed to delete quick launch nodes \'Parent\' and \'Child\': ' + message);
125+
});
126+
```
117127

118128
## Delete all quick launch nodes ##
119129
Description:
120130
The following code shows how to call the function to delete all quick launch nodes.
121131

122132
Code snippet:
123133

124-
coreNavigation.deleteAllQuickLaunchNodes()
125-
.done(
126-
function() {
127-
$("#statusMessage").html('Deleted all quick launch nodes');
128-
})
129-
.fail(
130-
function(message) {
131-
$("#statusMessage").html('Failed to delete all quick launch nodes: ' + message);
132-
});
134+
```JavaScript
135+
coreNavigation.deleteAllQuickLaunchNodes()
136+
.done(
137+
function() {
138+
$("#statusMessage").html('Deleted all quick launch nodes');
139+
})
140+
.fail(
141+
function(message) {
142+
$("#statusMessage").html('Failed to delete all quick launch nodes: ' + message);
143+
});
144+
```
133145

134146
## Update navigation inheritance ##
135147
Description:
136148
The following code shows how to call the function to update navigation inheritance. *Note: the example shows how to set inheritance to true, passing false to the function sets inheritance to false.*
137149

138150
Code snippet:
139151

140-
coreNavigation.updateNavigationInheritance(true)
141-
.done(
142-
function() {
143-
$("#statusMessage").html('Navigation inheritance set to true');
144-
})
145-
.fail(
146-
function(message) {
147-
$("#statusMessage").html('Failed to set navigation inheritance to true: ' + message);
148-
});
152+
```JavaScript
153+
coreNavigation.updateNavigationInheritance(true)
154+
.done(
155+
function() {
156+
$("#statusMessage").html('Navigation inheritance set to true');
157+
})
158+
.fail(
159+
function(message) {
160+
$("#statusMessage").html('Failed to set navigation inheritance to true: ' + message);
161+
});
162+
```

0 commit comments

Comments
 (0)