Index: chrome/common/extensions/docs/js/api_page_generator.js |
diff --git a/chrome/common/extensions/docs/js/api_page_generator.js b/chrome/common/extensions/docs/js/api_page_generator.js |
index 25711c516d01fa9649587d5c5ea530548cc95143..f0f864fbfbc5b2c5113a135ee792c075bc212e88 100644 |
--- a/chrome/common/extensions/docs/js/api_page_generator.js |
+++ b/chrome/common/extensions/docs/js/api_page_generator.js |
@@ -18,7 +18,8 @@ |
* |
*/ |
-var API_TEMPLATE = 'template/api_template.html'; |
+var API_TEMPLATE_EXTENSIONS = 'template/api_template.html'; |
+var API_TEMPLATE_APPS = 'template/api_template_apps.html'; |
var MODULE_SCHEMAS = [ |
'../api/alarms.json', // autogenerated |
'../api/bookmarks.json', |
@@ -156,8 +157,17 @@ function renderPage() { |
pageName = pageBase.replace(/([A-Z])/g, ' $1'); |
pageName = pageName.substring(0, 1).toUpperCase() + pageName.substring(1); |
+ // TODO(aa): Ugh, this is horrible. FIXME. |
Yoyo Zhou
2012/06/22 19:05:55
Not sure of the best thing to do here, but one alt
Aaron Boodman
2012/06/22 22:16:48
Won't work. Added additional commentary.
Yoyo Zhou
2012/06/22 22:26:06
Oh, I misread the length - 2 as 2 for some reason.
Aaron Boodman
2012/06/22 22:34:14
It's not the hard-code number that bothers me, but
|
+ var docFamily = location.pathname.split("/"); |
+ docFamily = docFamily[docFamily.length - 2]; |
+ if (docFamily != "extensions" && docFamily != "apps") |
+ docFamily = ""; |
+ |
+ var apiTemplate = docFamily == "extensions" ? |
Yoyo Zhou
2012/06/22 19:05:55
I wonder if there should be an error if it's neith
Aaron Boodman
2012/06/22 22:16:48
Done.
|
+ API_TEMPLATE_EXTENSIONS : API_TEMPLATE_APPS; |
+ |
// Fetch the api template and insert into the <body>. |
- fetchContent(API_TEMPLATE, function(templateContent) { |
+ fetchContent(apiTemplate, function(templateContent) { |
document.getElementsByTagName('body')[0].innerHTML = templateContent; |
fetchStatic(); |
}, function(error) { |