OLD | NEW |
1 /** | 1 /** |
2 * @fileoverview This file is the controller for generating extension | 2 * @fileoverview This file is the controller for generating extension |
3 * doc pages. | 3 * doc pages. |
4 * | 4 * |
5 * It expects to have available via XHR (relative path): | 5 * It expects to have available via XHR (relative path): |
6 * 1) API_TEMPLATE which is the main template for the api pages. | 6 * 1) API_TEMPLATE which is the main template for the api pages. |
7 * 2) A file located at SCHEMA which is shared with the extension system and | 7 * 2) A file located at SCHEMA which is shared with the extension system and |
8 * defines the methods and events contained in one api. | 8 * defines the methods and events contained in one api. |
9 * 3) (Possibly) A static version of the current page url in /static/. I.e. | 9 * 3) (Possibly) A static version of the current page url in /static/. I.e. |
10 * if called as ../foo.html, it will look for ../static/foo.html. | 10 * if called as ../foo.html, it will look for ../static/foo.html. |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 } | 366 } |
367 | 367 |
368 function getModuleName() { | 368 function getModuleName() { |
369 return "chrome." + module.namespace; | 369 return "chrome." + module.namespace; |
370 } | 370 } |
371 | 371 |
372 function getFullyQualifiedFunctionName(func) { | 372 function getFullyQualifiedFunctionName(func) { |
373 return getModuleName() + "." + func.name; | 373 return getModuleName() + "." + func.name; |
374 } | 374 } |
375 | 375 |
| 376 function isExperimentalAPIPage() { |
| 377 return (getPageName().indexOf('.experimental.') >= 0 && |
| 378 getPageName().indexOf('.experimental.*') < 0); |
| 379 } |
| 380 |
376 function hasCallback(parameters) { | 381 function hasCallback(parameters) { |
377 return (parameters.length > 0 && | 382 return (parameters.length > 0 && |
378 parameters[parameters.length - 1].type == "function"); | 383 parameters[parameters.length - 1].type == "function"); |
379 } | 384 } |
380 | 385 |
381 function getCallbackParameters(parameters) { | 386 function getCallbackParameters(parameters) { |
382 return parameters[parameters.length - 1]; | 387 return parameters[parameters.length - 1]; |
383 } | 388 } |
384 | 389 |
385 function shouldExpandObject(object) { | 390 function shouldExpandObject(object) { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 | 434 |
430 function sortByName(a, b) { | 435 function sortByName(a, b) { |
431 if (a.name < b.name) { | 436 if (a.name < b.name) { |
432 return -1; | 437 return -1; |
433 } | 438 } |
434 if (a.name > b.name) { | 439 if (a.name > b.name) { |
435 return 1; | 440 return 1; |
436 } | 441 } |
437 return 0; | 442 return 0; |
438 } | 443 } |
OLD | NEW |