|
5 | 5 | CLICK: 'click', |
6 | 6 | ROOMS: 'rooms', |
7 | 7 | ADMIN: 'admin', |
| 8 | + CONNECT: 'connect' |
8 | 9 | }; |
9 | 10 |
|
10 | 11 | let processJSONData = function () { |
|
121 | 122 | case API_TYPES.MONITOR: |
122 | 123 | return "meg"; |
123 | 124 | case API_TYPES.ESIGNATURE: |
124 | | - return "eg" |
| 125 | + return "eg"; |
| 126 | + case API_TYPES.CONNECT: |
| 127 | + return "con"; |
125 | 128 | } |
126 | 129 | } |
127 | 130 |
|
|
156 | 159 | $("#filtered_code_examples").append("<p>" + example.ExampleDescription + "</p>"); |
157 | 160 |
|
158 | 161 | $("#filtered_code_examples").append("<p>"); |
159 | | - |
160 | | - if (example.LinksToAPIMethod.length == 1) { |
161 | | - $("#filtered_code_examples").append(processJSONData().SupportingTexts.APIMethodUsed); |
162 | | - } |
163 | | - else { |
164 | | - $("#filtered_code_examples").append(processJSONData().SupportingTexts.APIMethodUsedPlural); |
165 | | - } |
166 | | - |
167 | | - for (let index = 0; index < example.LinksToAPIMethod.length; index++) { |
168 | | - $("#filtered_code_examples").append( |
169 | | - " <a target='_blank' href='" |
170 | | - + example.LinksToAPIMethod[index].Path |
171 | | - + "'>" |
172 | | - + example.LinksToAPIMethod[index].PathName |
173 | | - + "</a>" |
174 | | - ); |
175 | | - |
176 | | - if (index + 1 === example.LinksToAPIMethod.length) { |
177 | | - $("#filtered_code_examples").append("<span></span>"); |
178 | | - } |
179 | | - else if (index + 1 === example.LinksToAPIMethod.length - 1) { |
180 | | - $("#filtered_code_examples").append("<span> and </span>"); |
| 162 | + if (example.LinksToAPIMethod.length !== 0) { |
| 163 | + if (example.LinksToAPIMethod.length == 1) { |
| 164 | + $("#filtered_code_examples").append(processJSONData().SupportingTexts.APIMethodUsed); |
181 | 165 | } |
182 | 166 | else { |
183 | | - $("#filtered_code_examples").append("<span>, </span>"); |
| 167 | + $("#filtered_code_examples").append(processJSONData().SupportingTexts.APIMethodUsedPlural); |
184 | 168 | } |
185 | 169 |
|
| 170 | + for (let index = 0; index < example.LinksToAPIMethod.length; index++) { |
| 171 | + $("#filtered_code_examples").append( |
| 172 | + " <a target='_blank' href='" |
| 173 | + + example.LinksToAPIMethod[index].Path |
| 174 | + + "'>" |
| 175 | + + example.LinksToAPIMethod[index].PathName |
| 176 | + + "</a>" |
| 177 | + ); |
| 178 | + |
| 179 | + if (index + 1 === example.LinksToAPIMethod.length) { |
| 180 | + $("#filtered_code_examples").append("<span></span>"); |
| 181 | + } |
| 182 | + else if (index + 1 === example.LinksToAPIMethod.length - 1) { |
| 183 | + $("#filtered_code_examples").append("<span> and </span>"); |
| 184 | + } |
| 185 | + else { |
| 186 | + $("#filtered_code_examples").append("<span>, </span>"); |
| 187 | + } |
| 188 | + |
| 189 | + } |
186 | 190 | } |
187 | 191 |
|
188 | 192 | $("#filtered_code_examples").append("</p> "); |
|
0 commit comments