From b3a9433df3d904e56410ef2878ea7364c6b28a70 Mon Sep 17 00:00:00 2001 From: "kathyw@google.com" Date: Thu, 27 Aug 2009 20:20:13 +0000 Subject: Miscellaneous doc changes, nothing earthshaking. TBR=aa,rafaelw Review URL: http://codereview.chromium.org/173586 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24652 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/extensions/docs/api_other.html | 34 +++++++++++++ chrome/common/extensions/docs/css/ApiRefStyles.css | 2 +- .../common/extensions/docs/static/api_index.html | 9 ++++ .../common/extensions/docs/static/api_other.html | 56 ++++++++++++++++++++++ .../extensions/docs/static/background_pages.html | 7 ++- .../common/extensions/docs/static/getstarted.html | 36 +++++++++++--- .../common/extensions/docs/static/toolstrip.html | 12 +++-- .../extensions/docs/static/tut_debugging.html | 10 ++-- .../extensions/docs/template/api_template.html | 4 +- 9 files changed, 149 insertions(+), 21 deletions(-) create mode 100755 chrome/common/extensions/docs/api_other.html create mode 100755 chrome/common/extensions/docs/static/api_other.html (limited to 'chrome/common') diff --git a/chrome/common/extensions/docs/api_other.html b/chrome/common/extensions/docs/api_other.html new file mode 100755 index 0000000..ed40a76 --- /dev/null +++ b/chrome/common/extensions/docs/api_other.html @@ -0,0 +1,34 @@ + + + + + + + + pageTitle + + + + + + + + + diff --git a/chrome/common/extensions/docs/css/ApiRefStyles.css b/chrome/common/extensions/docs/css/ApiRefStyles.css index 4ff0172..083a7e5 100755 --- a/chrome/common/extensions/docs/css/ApiRefStyles.css +++ b/chrome/common/extensions/docs/css/ApiRefStyles.css @@ -42,7 +42,7 @@ div.summary div { margin-bottom: 0.5em; } -pre .newCode { +pre b { background-color: rgb(255, 255, 0); } diff --git a/chrome/common/extensions/docs/static/api_index.html b/chrome/common/extensions/docs/static/api_index.html index 5cd885d..53e8e96 100755 --- a/chrome/common/extensions/docs/static/api_index.html +++ b/chrome/common/extensions/docs/static/api_index.html @@ -17,3 +17,12 @@ Here are the supported chrome.* APIs:
  • windows
  • +

    +Unless the doc says otherwise, +methods in the chrome.* APIs are asynchronous: +they return immediately, +without waiting for the operation to finish. +If you need to know the outcome of an operation, +then you pass a callback function into the method. +[PENDING: update/elaborate on that] +

    diff --git a/chrome/common/extensions/docs/static/api_other.html b/chrome/common/extensions/docs/static/api_other.html new file mode 100755 index 0000000..260141c --- /dev/null +++ b/chrome/common/extensions/docs/static/api_other.html @@ -0,0 +1,56 @@ +
    Other APIs
    + +

    +In addition to the +chrome.* APIs, +extensions can use all the APIs +that the browser provides +to web pages and apps. +If the browser doesn't support an API you want to use, +you can bundle additional API libraries into your extension. +

    + +

    Here's a sampling of the APIs that extensions can use:

    + +
    +
    Standard JavaScript APIs
    +
    [PENDING: define, explain; link to complete list] +
    +
    XMLHttpRequest
    +
    + Lets the extension request data from one or more servers. + The manifest specifies + which domains the extension can send requests to. + [PENDING: link to doc]
    +
    WebKit APIs
    +
    + Because Google Chrome is built upon WebKit, + your extensions can use WebKit APIs. + Especially useful are the experimental CSS features + such as filters, animations, and transformations. + Here's an example of using WebKit styles + to make the UI spin: +
    <style>
    +  div:hover {
    +    -webkit-transform: rotate(360deg);
    +    -webkit-transition: all sl ease-out;
    +  }
    +</style>
    +
    +

    [PENDING: link to complete list of webkit apis]

    +
    +
    V8 APIs, such as JSON
    +
    JSON is in V8, so you don't need to include a JSON library to use JSON functions. [PENDING: what other APIs are in v8? link to complete list]
    +
    HTML5 APIs, such as localStorage and Web Workers
    +
    HTML5 is still being defined and implemented, but one crucial feature it will provide is local storage... [PENDING: mention Web Workers, too. Other important API? link to complete list]
    +
    APIs in bundled libraries
    +
    If you want to use a library that the browser doesn't provide +(for example, jQuery), +you can bundle that library's JavaScript files with your extension. +Bundled libraries work in extensions +just as they would in any other web pages. +
    +
    + diff --git a/chrome/common/extensions/docs/static/background_pages.html b/chrome/common/extensions/docs/static/background_pages.html index b412635..79ec203 100755 --- a/chrome/common/extensions/docs/static/background_pages.html +++ b/chrome/common/extensions/docs/static/background_pages.html @@ -1,4 +1,5 @@
    Background Pages
    +
    true

    A common need for extensions is to have @@ -16,7 +17,7 @@ The difference is that the background page exists for the lifetime of your extension, and only one instance of it at a time is active.

    -

    Details

    +

    Manifest

    Register your background page in the extension manifest, like this: @@ -26,10 +27,12 @@ Register your background page in the extension manifest, like this: "name": "My First Extension", "version": "1.0", "description": "The first extension that I made.", - "background_page": "background.html", + "background_page": "background.html", "toolstrips": ["toolstrip.html"] } +

    Details

    +

    Your toolstrip will likely contain only the necessary code to display the toolstrip UI, diff --git a/chrome/common/extensions/docs/static/getstarted.html b/chrome/common/extensions/docs/static/getstarted.html index fdf05a6..381eacf 100755 --- a/chrome/common/extensions/docs/static/getstarted.html +++ b/chrome/common/extensions/docs/static/getstarted.html @@ -1,4 +1,4 @@ -

    Tutorial: Getting Started
    +
    Tutorial: Getting Started (Hello, World!)
    true

    @@ -70,7 +70,7 @@ at the bottom of the Google Chrome window. --load-extension flag. For example, if your extension is at c:\myext, your shortcut might look something like this: -

    chrome.exe --load-extension="c:\myext"
    +
    chrome.exe --load-extension="c:\myext"
  • Exit Google Chrome. If you have a separate profile for testing, @@ -138,7 +138,7 @@ You should see the UI for your extension at the bottom left of the browser, look
  • Edit my_toolstrip.html, so that it has the following code:

    -
    <div class="toolstrip-button" onclick="window.open('hello_world.html')">
    +    
    <div class="toolstrip-button" onclick="window.open('hello_world.html')">
       <span>Hello, World!</span>
     </div>
  • @@ -157,11 +157,35 @@ following them exactly. Don't try loading an HTML file that isn't in the extension's folder — it won't work!

    -

    Summary

    +

    Now what?

    [PENDING: Summarize what we did, what it means, what else we would've done if this were a real extension (e.g. package it), -and where to find more information. -Suggest where to go next.]

    +and where to find more information.]

    + + diff --git a/chrome/common/extensions/docs/static/toolstrip.html b/chrome/common/extensions/docs/static/toolstrip.html index 8921918..60ff1bb 100755 --- a/chrome/common/extensions/docs/static/toolstrip.html +++ b/chrome/common/extensions/docs/static/toolstrip.html @@ -9,27 +9,29 @@ so anything you can do with HTML/CSS/JavaScript, you can do with toolstrips.

    -

    Details

    -

    Register your toolstrips in the extension manifest, like this:

    +

    Manifest

    +

    Register your toolstrips in the extension manifest like this:

    {
       "name": "My First Extension",
       "version": "1.0",
       "description": "The first extension that I made.",
    -  "toolstrips": [
    +  "toolstrips": [
         "one_toolstrip.html",
         "two_toolstrip.html"
    -  ]
    +  ]
     }
    +

    Creating buttons

    You can create buttons that look like the bookmark bar buttons using this template:

    <div class="toolstrip-button">
       <!-- Image is optional and should be a 16x16 icon. -->
    -  <img src="path/to/some_icon.png">
    +  <img src="path/to/some_icon.png">
       <span>My Button</span>
     </div>
    +

    Debugging tips

  • chrome.* APIs
  • -
  • Other APIs
  • +
  • Other APIs
  • -
  • Samples
  • +
  • Samples
  • -- cgit v1.1