diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-09 22:38:16 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-09 22:38:16 +0000 |
commit | d13309e5456f2fd2e938a699de99df76a24234a0 (patch) | |
tree | a2472762769449a0df385cfecdb5d82053592fcb /chrome/common/extensions/docs/js | |
parent | 93b24ab61681da79a73df67aa6647c80798a1110 (diff) | |
download | chromium_src-d13309e5456f2fd2e938a699de99df76a24234a0.zip chromium_src-d13309e5456f2fd2e938a699de99df76a24234a0.tar.gz chromium_src-d13309e5456f2fd2e938a699de99df76a24234a0.tar.bz2 |
Fix the extension doc page titles and flicker a bit.
TBR=rafaelw@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22887 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/docs/js')
-rwxr-xr-x | chrome/common/extensions/docs/js/api_page_generator.js | 5 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/js/bootstrap.js | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/chrome/common/extensions/docs/js/api_page_generator.js b/chrome/common/extensions/docs/js/api_page_generator.js index 0d30c90..7e93aeb 100755 --- a/chrome/common/extensions/docs/js/api_page_generator.js +++ b/chrome/common/extensions/docs/js/api_page_generator.js @@ -58,6 +58,9 @@ function renderPage() { return; } + pageName = pageName.replace(/([A-Z])/g, " $1"); + pageName = pageName.substring(0, 1).toUpperCase() + pageName.substring(1); + // Fetch the api template and insert into the <body>. fetchContent(API_TEMPLATE, function(templateContent) { document.getElementsByTagName("body")[0].innerHTML = templateContent; @@ -165,7 +168,7 @@ function renderTemplate(schemaContent) { jstProcess(input, output); // Show. - document.getElementsByTagName("body")[0].className = ""; + document.getElementsByTagName("body")[0].style.display = "block"; if (parent && parent.done) parent.done(); diff --git a/chrome/common/extensions/docs/js/bootstrap.js b/chrome/common/extensions/docs/js/bootstrap.js index 5282030d..28f21ce 100755 --- a/chrome/common/extensions/docs/js/bootstrap.js +++ b/chrome/common/extensions/docs/js/bootstrap.js @@ -1,11 +1,14 @@ +// Hide body content initially to minimize flashing. +document.write('<style type="text/css">'); +document.write('body { display:none; }'); +document.write('</style>'); + window.onload = function() { // Regenerate page if we are passed the "?regenerate" search param // or if the user-agent is chrome AND the document is being served // from the file:/// scheme. if (window.location.search == "?regenerate" || navigator.userAgent.indexOf("Chrome") > -1) { - // Hide body content initially to minimize flashing. - document.getElementsByTagName("body")[0].className = "hidden"; window.renderPage(); } }
\ No newline at end of file |