diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-22 22:23:27 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-22 22:23:27 +0000 |
commit | 7d42233b59568d140afc3ded2c4bc8745892a734 (patch) | |
tree | 54735f749f4a4907e09aa2df28d51c0b081e44a5 | |
parent | 842301e204be1f9b5675aba0d1b64e7632f3ae68 (diff) | |
download | chromium_src-7d42233b59568d140afc3ded2c4bc8745892a734.zip chromium_src-7d42233b59568d140afc3ded2c4bc8745892a734.tar.gz chromium_src-7d42233b59568d140afc3ded2c4bc8745892a734.tar.bz2 |
revert r21327, which broke MessagingExtensionTab
<http://build.chromium.org/buildbot/waterfall/waterfall?builder=Vista%20Tests>
tbr=rafaelw
Review URL: http://codereview.chromium.org/155955
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21334 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/common/common_resources.grd | 2 | ||||
-rwxr-xr-x | chrome/common/extensions/api/bookmarks.json | 99 | ||||
-rwxr-xr-x | chrome/common/extensions/api/extension_api.json | 195 | ||||
-rwxr-xr-x | chrome/common/extensions/api/tabs.json | 50 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/css/ApiRefStyles.css | 66 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/js/api_page_generator.js | 102 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/template/api_template.html | 403 |
7 files changed, 341 insertions, 576 deletions
diff --git a/chrome/common/common_resources.grd b/chrome/common/common_resources.grd index e13c7c1..2597d14 100644 --- a/chrome/common/common_resources.grd +++ b/chrome/common/common_resources.grd @@ -1,6 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- This comment is only here because changes to resources are not picked up -without changes to the corresponding grd file. --> <grit latest_public_release="0" current_release="1"> <outputs> <output filename="grit/common_resources.h" type="rc_header"> diff --git a/chrome/common/extensions/api/bookmarks.json b/chrome/common/extensions/api/bookmarks.json new file mode 100755 index 0000000..8f3bf07 --- /dev/null +++ b/chrome/common/extensions/api/bookmarks.json @@ -0,0 +1,99 @@ +{ + "namespace": "chrome.bookmarks", + "types": [ + { + "id": "BookmarkTreeNode", + "properties": { + "id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "parentId": { + "type": "integer" + }, + "url": { + "type": "string" + }, + "children": { + "type": "array", + "items": { + "$ref": "BookmarkTreeNode" + } + }, + "dateAdded": { + "type": "integer" + }, + "dateGroupModified": { + "type": "integer" + } + } + } + ], + "functions": [ + { + "name": "create", + "description": "<p>Creates a new bookmark. To get the newly created bookmark (or just find out whether its creation succeeded), you need to specify a callback function.</p><p>If you specify a <code>url</code> </span>in the <var>bookmark</var> parameter, the new bookmark represents a URL; otherwise, it represents a group.</p><p>For more information about bookmark properties, see the <a href='#TOC-Description'>Description</a> section.</p>", + "parameters": [ + { + "name": "parentId", + "description": "The requested value of the new bookmark's <code>parentId</code> property.", + "type": "integer", + "minimum": 0, + "optional": true + }, + { + "name": "index", + "description": "The desired <code>index</code> position (0-based) at which this bookmark should be created. If absent, it will be placed at the end.", + "type": "integer", + "minimum": 0, + "optional": true + }, + { + "name": "title", + "description": "The <code>title</code> string to be displayed to the user on in the bookmarks system.", + "type": "string", + "optional": true + }, + { + "name": "url", + "description": "The destination URL of this bookmark.", + "type": "string", + "optional": true + }, + { + "name": "callback", + "description": "Function to callback upon completion.", + "type": "function", + "optional": true + } + ], + "callbackParameters" : [ + { + "name": "result", + "$ref": "BookmarkTreeNode", + "description": "The BookmarkTreeNode that was created in the bookmarks system." + } + ] + } + ], + "events": [ + { + "name": "onAdded", + "description": "Sent whenever a bookmark is added.", + "parameters": [ + { + "name": "id", + "type": "integer", + "description": "The id of the BookmarkTreeNode that was added." + }, + { + "name": "node", + "$ref": "BookmarkTreeNode", + "description": "The properties of the BookmarkTreeNode that was added." + } + ] + } + ] +}
\ No newline at end of file diff --git a/chrome/common/extensions/api/extension_api.json b/chrome/common/extensions/api/extension_api.json index 759d17a..b2c30a3 100755 --- a/chrome/common/extensions/api/extension_api.json +++ b/chrome/common/extensions/api/extension_api.json @@ -1,75 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/* - * This file defines the extensions api functions, events and types. It is - * json-structured list of api "modules". Each module has - * - * namespace: "<apiname>", // i.e. "windows" which becomes visible to - * // extensions as chrome.windows. - * - * types: [], // a list of json schemas which define "types" - * // that are common to that module. i.e. "Tab" or - * // "BookmarkTreeNode". - * - * functions: [], // a list of json schemas which define the - * // functions in the current module. i.e. - * // chrome.tabs.getCurrent(). - * - * events: [], // a list of json schemas which define the events - * // which this module defines. i.e. - * // chrome.windows.onCreated. - * - * --Functions Schemas-- - * Each function schema is required to have a - * - * name: "<function name>" - * type: "function" - * description: "..." // this appears in the docs. - * parameters: [] - * - * |parameters| is a list of json schemas which define the list of parameters - * this function requires and will be validated against. Each parameter - * should define a "name" property, and "description" property, both of which - * will appear in the docs. The final parameter may be a type: "function" - * which is expected to be the callback for this call. That parameter, should - * itself be named ("name": "callback"), have a "parameters" member that - * is a list of the json schemas that define the types that the callback - * sends. Callback parameters should also have "name" and "description" - * properties. - * - * --Event Schemas-- - * Each event schema is also a type: "function" schema that is named. It's - * structure is the same as the callback functions for module Functions. - * It should have a "name", "description", and a "parameters" describing - * the set of arguments it sends. - * - * --Referenced Types-- - * The "types": [] list may contain a list of types that are common to the - * current api module. Each type should have an "id" member ("id": "Tab"). - * These types can be referenced from a schema with "$ref": "<idName>". - * i.e. - * - * ... - * type: "function", - * parameters: [ - * {$ref: "BookmarkTreeNode", name: "node"} - * ] - * - * WARNING: Do not use these referenced types in module function parameters. - * They are not yet properly validated. They are currently safe to use in - * callback parameters and event parameters. - * - * TODO(rafaelw): Validate callback arguments in debug and unittests - * TODO(rafaelw): Validate event arguments in debug and unittests - * TODO(rafaelw): Support $ref for json_schema validation. - */ - [ - /** - * chrome.windows - */ { namespace: "windows", types: [], @@ -184,27 +113,9 @@ } ] }, - - /** - * chrome.tabs - */ { namespace: "tabs", - types: [ - { - id: "Tab", - type: "object", - properties: { - id: {type: "integer", minimum: 0}, - index: {type: "integer", minimum: 0}, - windowId: {type: "integer", minimum: 0}, - selected: {type: "boolean"}, - url: {type: "string"}, - title: {type: "string", optional: true}, - favIconUrl: {type: "string", optional: true} - } - } - ], + types: [], functions: [ { name: "get", @@ -212,13 +123,7 @@ description: "", parameters: [ {type: "integer", name: "tabId", minimum: 0}, - { - type: "function", - name: "callback", - parameters: [ - {name: "tab", $ref: "Tab"} - ] - } + {type: "function", name: "callback"} ] }, { @@ -227,13 +132,7 @@ description: "", parameters: [ {type: "integer", name: "windowId", minimum: 0, optional: true}, - { - type: "function", - name: "callback", - parameters: [ - {name: "tab", $ref: "Tab"} - ] - } + {type: "function", name: "callback"} ] }, { @@ -260,14 +159,7 @@ selected: {type: "boolean", optional: true} } }, - { - type: "function", - name: "callback", - optional: true, - parameters: [ - {name: "tab", $ref: "Tab"} - ] - } + {type: "function", name: "callback", optional: true} ] }, { @@ -284,7 +176,7 @@ selected: {type: "boolean", optional: true} } }, - {type: "function", name: "callback", optional: true, parameters: []} + {type: "function", name: "callback", optional: true} ] }, { @@ -301,7 +193,7 @@ index: {type: "integer", minimum: 0} } }, - {type: "function", name: "callback", optional: true, parameters: []} + {type: "function", name: "callback", optional: true} ] }, { @@ -310,7 +202,7 @@ description: "", parameters: [ {type: "integer", name: "tabId", minimum: 0, optional: true}, - {type: "function", name: "callback", optional: true, parameters: []} + {type: "function", name: "callback", optional: true} ] }, { @@ -319,13 +211,7 @@ description: "detect language of tab.", parameters: [ {type: "integer", name: "tabId", minimum: 0, optional: true}, - { - type: "function", - name: "callback", - parameters: [ - {type: "string", name: "language"} - ] - } + {type: "function", name: "callback"} ] } ], @@ -335,7 +221,7 @@ type: "function", description: "", parameters: [ - {$ref: "Tab", name: "tab"} + {type: "Object", name: "Tab"} ] }, { @@ -344,15 +230,7 @@ description: "", parameters: [ {type: "integer", name: "tabId", minimum: 0}, - { - type: "object", - name: "ChangedProps", - properties: { - tabId: {type: "integer", name: "tabId", minimum: 0}, - status: {type: "string"}, - url: {type: "string", optional: true} - } - } + {type: "Object", name: "ChangedProps"} ] }, { @@ -361,15 +239,7 @@ description: "", parameters: [ {type: "integer", name: "tabId", minimum: 0}, - { - type: "object", - name: "MoveInfo", - properties: { - windowId: {type: "integer", minimum: 0}, - fromIndex: {type: "integer", minimum: 0}, - toIndex: {type: "integer", minimum: 0} - } - } + {type: "Object", name: "MoveInfo"} ] }, { @@ -378,12 +248,7 @@ description: "", parameters: [ {type: "integer", name: "tabId", minimum: 0}, - { - type: "object", name: "SelectInfo", - properties: { - windowId: {type: "integer", minimum: 0}, - } - } + {type: "Object", name: "SelectionInfo"} ] }, { @@ -392,14 +257,7 @@ description: "", parameters: [ {type: "integer", name: "tabId", minimum: 0}, - { - type: "object", - name: "AttachInfo", - properties: { - newWindowId: {type: "integer", minimum: 0}, - newPosition: {type: "integer", minimum: 0} - } - } + {type: "Object", name: "AttachInfo"} ] }, { @@ -408,14 +266,7 @@ description: "", parameters: [ {type: "integer", name: "tabId", minimum: 0}, - { - type: "object", - name: "DetachInfo", - properties: { - oldWindowId: {type: "integer", minimum: 0}, - oldPosition: {type: "integer", minimum: 0} - } - } + {type: "Object", name: "DetachInfo"} ] }, { @@ -428,10 +279,6 @@ } ] }, - - /** - * chrome.pageActions - */ { namespace: "pageActions", types: [], @@ -476,10 +323,6 @@ events: [ ] }, - - /** - * chrome.bookmarks - */ { namespace: "bookmarks", types: [], @@ -585,7 +428,7 @@ parameters: [ {type: "integer", name: "id", minimum: 0}, { - type: "object", + type: "Object", name: "bookmark", } ] @@ -597,7 +440,7 @@ parameters: [ {type: "integer", name: "id", minimum: 0}, { - type: "object", + type: "Object", name: "RemoveInfo", } ] @@ -609,7 +452,7 @@ parameters: [ {type: "integer", name: "id", minimum: 0}, { - type: "object", + type: "Object", name: "ChangeInfo", } ] @@ -621,7 +464,7 @@ parameters: [ {type: "integer", name: "id", minimum: 0}, { - type: "object", + type: "Object", name: "MoveInfo", } ] @@ -633,7 +476,7 @@ parameters: [ {type: "integer", name: "id", minimum: 0}, { - type: "object", + type: "Object", name: "childIds", } ] diff --git a/chrome/common/extensions/api/tabs.json b/chrome/common/extensions/api/tabs.json new file mode 100755 index 0000000..e09f105 --- /dev/null +++ b/chrome/common/extensions/api/tabs.json @@ -0,0 +1,50 @@ +{ + "namespace": "chrome.tabs", + "types": [], + "functions": [ + { + "name": "getLanguage", + "description": "Attempts to determine the language of the content of the tab with id <var>tabId</var>", + "parameters": [ + { + "name": "tabId", + "description": "The id of the tab whose contents should be evaluated for it's source language", + "type": "integer", + "minimum": 0, + "optional": true + }, + { + "name": "callback", + "description": "Function to callback upon completion.", + "type": "function", + "optional": true + } + ], + "callbackParameters" : [ + { + "name": "result", + "type": "string", + "description": "The language of the content found in specified tab." + } + ] + } + ], + "events": [ + { + "name": "onMoved", + "description": "Sent whenever a tab is moved.", + "parameters": [ + { + "name": "tabId", + "type": "integer", + "description": "The id of the tab that was moved." + }, + { + "name": "TabMoveDetails", + "type": "object", + "description": "Properties describing the tab move event." + } + ] + } + ] +}
\ No newline at end of file diff --git a/chrome/common/extensions/docs/css/ApiRefStyles.css b/chrome/common/extensions/docs/css/ApiRefStyles.css index 37bd248..2626359 100755 --- a/chrome/common/extensions/docs/css/ApiRefStyles.css +++ b/chrome/common/extensions/docs/css/ApiRefStyles.css @@ -1,12 +1,12 @@ -.todo { - color: red; -} - body { font-family:Arial, Helvetica, sans-serif; font-size: 13px; } +.todo { + color: red; +} + h2,h3 { margin-top: 2em; } @@ -88,60 +88,4 @@ p#classSummary { .hidden { display: none; -} - -#container { - height:auto !important; - margin:0; - max-width:1160px; - min-height:100%; - padding:0; - position:relative; -} - -#pageHeader { - margin:9px 0 12px; - padding:7px 0 0; -} - -#pageTitle { -} - -#pageContent { -} - -#leftNav { - clear:left; - padding:0.5em 0 140px !important; - display:block; - float:left; - margin:0; - width:171px; -} - -#leftNav ul { - line-height:120%; - margin:0; - padding:0.6em 0 0; -} - -#leftNav ul li { - list-style-image:none; - list-style-position:outside; - list-style-type:none; - margin:0; - padding:0.2em 0 0.2em 1em; -} - -#mainColumn { - border-left:3px solid #E5ECF9; - padding-left:24px; - display:block; - float:none; - margin:0 0 0 171px; - position:relative; - width:auto; -} - -#pageFooter { -} +}
\ No newline at end of file diff --git a/chrome/common/extensions/docs/js/api_page_generator.js b/chrome/common/extensions/docs/js/api_page_generator.js index dcef86f..01ff9e2d 100755 --- a/chrome/common/extensions/docs/js/api_page_generator.js +++ b/chrome/common/extensions/docs/js/api_page_generator.js @@ -32,12 +32,6 @@ Array.prototype.each = function(f) { } } -Object.prototype.extends = function(obj) { - for (var k in obj) { - this[k] = obj[k]; - } -} - // name of the api this reference page is describing. i.e. "bookmarks", "tabs". var apiName; @@ -106,21 +100,15 @@ function fetchContent(url, onSuccess) { * <body>. * This uses the root <html> element (the entire document) as the template. */ -function renderTemplate(schemaContent) { +function renderTemplate(schema) { var apiDefinition; - var schema = JSON.parse(schemaContent); - schema.each(function(module) { + JSON.parse(schema).each(function(module) { if (module.namespace == apiName) apiDefinition = module; }); - types = {}; - apiDefinition.types.each(function(t) { - types[t.id] = t; - }); - - preprocessApi(apiDefinition, schema, types); + preprocessApi(apiDefinition); // Render to template var input = new JsEvalContext(apiDefinition); @@ -132,91 +120,36 @@ function renderTemplate(schemaContent) { } /** - * Augment the |module| with additional values that are required by the - * template. |schema| is the full schema (including all modules). |types| is an - * array of typeId -> typeSchema. + * Augment the |schema| with additional values that are required by the + * template. */ -function preprocessApi(module, schema, types) { - module.functions.each(function(f) { - f.fullName = "chrome." + module.namespace + "." + f.name; - linkTypeReferences(f.parameters, types); - assignTypeNames(f.parameters); +function preprocessApi(schema) { + schema.functions.each(function(f) { + f.fullName = "chrome." + schema.namespace + "." + f.name; + assignTypeNames(f); // Look for a callback that defines parameters. if (f.parameters.length > 0) { var lastParam = f.parameters[f.parameters.length - 1]; if (lastParam.type == "function" && lastParam.parameters) { - linkTypeReferences(lastParam.parameters, types); - assignTypeNames(lastParam.parameters); + assignTypeNames(lastParam); f.callbackParameters = lastParam.parameters; f.callbackSignature = generateSignatureString(lastParam.parameters); - f.callbackParameters.each(function(p) { - addPropertyListIfObject(p); - }); } } - - // Setup any type: "object" pameters to have an array of params (rather than - // named properties). - f.parameters.each(function(param) { - addPropertyListIfObject(param); - }); }); - - module.events.each(function(e) { - linkTypeReferences(e.parameters, types); - assignTypeNames(e.parameters); + + schema.events.each(function(e) { + assignTypeNames(e); e.callSignature = generateSignatureString(e.parameters); - e.parameters.each(function(p) { - addPropertyListIfObject(p); - }); }); - - // Add a list of modules for the master TOC. - module.apiModules = []; - schema.each(function(s) { - var m = {}; - m.module = s.namespace; - m.name = s.namespace.substring(0, 1).toUpperCase() + - s.namespace.substring(1); - module.apiModules.push(m); - }); - module.apiModules.sort(function(a, b) { return a.name > b.name; }); -} - -/* - * For function, callback and event parameters, we want to document the - * properties of any "object" type. This takes an param, and if it is an - * "object" type, creates a "_parameterList" property in the form as - * |parameters| list used by the template. - */ -function addPropertyListIfObject(object) { - if (object.type != "object" || !object.properties) - return; - - var propertyList = []; - for (var p in object.properties) { - var prop = object.properties[p]; - prop.name = p; - propertyList.push(prop); - } - assignTypeNames(propertyList); - object._propertyList = propertyList; } -function linkTypeReferences(parameters, types) { - parameters.each(function(p) { - if (p.$ref) { - p.extends(types[p.$ref]); - } - }); -} - /** - * Assigns a typeName(param) to each of the |parameters|. + * Assigns a typeName(param) to each of the parameters of |f|. */ -function assignTypeNames(parameters) { - parameters.each(function(p) { +function assignTypeNames(f) { + f.parameters.each(function(p) { p.typeName = typeName(p); }); } @@ -225,6 +158,9 @@ function assignTypeNames(parameters) { * Generates a short text summary of the |schema| type */ function typeName(schema) { + if (schema.$ref) + return schema.$ref; + if (schema.choice) { var typeNames = []; schema.choice.each(function(c) { diff --git a/chrome/common/extensions/docs/template/api_template.html b/chrome/common/extensions/docs/template/api_template.html index fb96a77..0aa613d 100755 --- a/chrome/common/extensions/docs/template/api_template.html +++ b/chrome/common/extensions/docs/template/api_template.html @@ -1,273 +1,168 @@ - <div id="container"> - <a name="top"> </a> + <!-- BREADCRUMB --> + <!-- TODO: Fix these hrefs --> + <div id="breadcrumbs"><a href="../index.html">Chrome Extensions</a> > + <a href="./index.html">Reference</a> > + <a href="chrome-api-index.html">chrome.* API</a></div> <!-- API HEADER --> - <div id="pageHeader"> - <!-- BREADCRUMB --> - <!-- TODO: Fix these hrefs --> - <div id="breadcrumbs"> - <a href="../index.html">Chrome Extensions</a> > - <a href="./index.html">Reference</a> > - <a href="chrome-api-index.html">chrome.* API</a> - </div> - <div id="pageTitle"> - <h1 jscontent="namespace">chrome.apiname</h1> - </div> - </div> <!-- /pageHeader --> - - <div id="pageContent"> - <!-- SIDENAV --> - <div id="leftNav"> - <ul> - <li> Overview </li> - <li> Programmer's Guide - <ul> - <li> Getting Started </li> - <li> ... </li> - </ul> - </li> - <li> Reference - <ul> - <li> chrome.* APIs - <ul> - <li jsselect="apiModules"> - <a jscontent="name" jsvalues=".href:module + '.html'">Foo</a> - </li> - </ul> - </li> - </ul> - </li> - </ul> - </div> - - <div id="mainColumn"> - <!-- TABLE OF CONTENTS --> - <div id="toc"> - <p>Contents</p> + <h1 jscontent="namespace">chrome.apiname</h1> + + <!-- TABLE OF CONTENTS --> + <div id="toc"> + <p>Contents</p> + <ol> + <li> + <a href="#overview">Description</a> <ol> - <li> - <a href="#overview">Description</a> - <ol> - <li><a href="#overview-properties">Properties</a></li> - <li><a href="#overview-examples">Examples</a></li> - </ol> - </li> - <li> - <a href="#methods">Methods</a> - <ol> - <li jsselect="functions"> - <a jscontent="name" - jsvalues=".href:'#method-' + name" - href="#method-anchor">methodName</a> - </li> - </ol> - </li> - <li> - <a href="#events">Events</a> - <ol> - <li jsselect="events"> - <a jscontent="name" - jsvalues=".href:'#event-' + name" - href="#event-anchor">eventName</a> - </li> - </ol> + <li><a href="#overview-properties">Properties</a></li> + <li><a href="#overview-examples">Examples</a></li> + </ol> + </li> + <li> + <a href="#methods">Methods</a> + <ol> + <li jsselect="functions"> + <a jscontent="name" + jsvalues=".href:'#method-' + name" + href="#method-anchor">methodName</a> </li> - <!-- TODO: What do we do about structs/types? --> - <li> - <a href="#structs">TODO: Structs</a> - <ol> - <li><a href="#struct-BookmarkTreeNode"></a></li> - </ol> + </ol> + </li> + <li> + <a href="#events">Events</a> + <ol> + <li jsselect="events"> + <a jscontent="name" + jsvalues=".href:'#event-' + name" + href="#event-anchor">eventName</a> </li> </ol> - [PENDING: links to all h2s and h3s should go here -- would it be possible - to link to overview h3s, as well? if so, how should we create their - anchor/id values?] - </div> - <!-- /TABLE OF CONTENTS --> - - - <!-- OVERVIEW PLACEHOLDER -- THIS GET REPLACED AUTHORED CONTENT --> - <div id="overview"></div> - - - <!-- METHODS --> - <div class="apiGroup" id="methods"> - <a name="#methods"></a> - <h2>Methods</h2> - - <!-- iterates over all functions --> - <div class="apiItem" jsselect="functions"> - <a jsvalues=".name:'method-' + name"></a> <!-- method-anchor --> - <h3 jscontent="name">method name</h3> - - <div class="summary">void - <!-- Note: intentionally longer 80 columns --> - <span jscontent="fullName">chrome.module.methodName</span>(<span jsselect="parameters" jsvalues="class:optional ? 'optional' : ''"><span jsdisplay="$index">, </span><span jscontent="typeName"></span> - <var><span jscontent="name"></span></var></span>)</div> - - <div class="description"> - <p class="todo" jsdisplay="!description">Undocumented.</p> - <p jsdisplay="description" jsvalues=".innerHTML:description"> - A description from the json schema def of the function goes here. - </p> - - <!-- PARAMETERS --> - <h4>Parameters</h4> - <dl> - <div jsselect="parameters"> - <dt> - <!-- Note: intentionally longer 80 columns --> - <var jscontent="name">paramName</var><em> - (<span class="optional" jsdisplay="optional">optional </span><span jscontent="typeName">paramType</span>)</em> - </dt> - <dd class="todo" jsdisplay="!$this.description"> - Undocumented. - </dd> - <dd jsdisplay="$this.description" - jsvalues=".innerHTML:$this.description"> - Description of this parameter from the json schema. - </dd> - - <!-- OBJECT PROPERTIES --> - <dd jsdisplay="_propertyList"> - <dl> - <div jsselect="_propertyList"> - <dt> - <!-- Note: intentionally longer 80 columns --> - <var jscontent="name">paramName</var><em> - (<span class="optional" jsdisplay="optional">optional </span><span jscontent="typeName">paramType</span>)</em> - </dt> - <dd class="todo" jsdisplay="!$this.description"> - Undocumented. - </dd> - <dd jsdisplay="$this.description" - jsvalues=".innerHTML:$this.description"> - Description of this parameter from the json schema. - </dd> - </div> - </dl> - </dd> - </div> - </dl> - - <!-- CALLBACK --> - <div jsdisplay="callbackParameters"> - <h4>Callback function</h4> - <p> - If you specify the <em>callback</em> parameter, - it should specify a function that looks like this: - </p> - + </li> + <!-- TODO: What do we do about structs/types? --> + <li> + <a href="#structs">TODO: Structs</a> + <ol> + <li><a href="#struct-BookmarkTreeNode"></a></li> + </ol> + </li> + </ol> + [PENDING: links to all h2s and h3s should go here -- would it be possible + to link to overview h3s, as well? if so, how should we create their + anchor/id values?] + </div> + <!-- /TABLE OF CONTENTS --> + + + <!-- OVERVIEW PLACEHOLDER -- THIS GET REPLACED AUTHORED CONTENT --> + <div id="overview"></div> + + + <!-- METHODS --> + <div class="apiGroup" id="methods"> + <a name="#methods"></a> + <h2>Methods</h2> + + <!-- iterates over all functions --> + <div class="apiItem" jsselect="functions"> + <a jsvalues=".name:'method-' + name"></a> <!-- method-anchor --> + <h3 jscontent="name">method name</h3> + + <div class="summary">void + <!-- Note: intentionally longer 80 columns --> + <span jscontent="fullName">chrome.module.methodName</span>(<span jsselect="parameters" jsvalues="class:optional ? 'optional' : ''"><span jsdisplay="$index">, </span><span jscontent="typeName"></span> + <var><span jscontent="name"></span></var></span>)</div> + + <div class="description"> + <p class="todo" jsdisplay="!description">Undocumented.</p> + <p jsdisplay="description" jsvalues=".innerHTML:description"> + A description from the json schema def of the function goes here. + </p> + + <!-- PARAMETERS --> + <h4>Parameters</h4> + <dl> + <div jsselect="parameters"> + <dt> <!-- Note: intentionally longer 80 columns --> - <pre>function(<span jscontent="callbackSignature">Type param1, Type param2</span>) <span class="subdued">{...}</span>);</pre> - <dl> - <div jsselect="callbackParameters"> - <dt> - <!-- Note: intentionally longer 80 columns --> - <var jscontent="name">paramName</var><em> - (<span jscontent="typeName">paramType</span>)</em> - </dt> - <dd class="todo" jsdisplay="!$this.description"> - Undocumented. - </dd> - <dd jsdisplay="$this.description" - jsvalues=".innerHTML:$this.description"> - Description of this parameter from the json schema. - </dd> - <!-- OBJECT PROPERTIES --> - <dd jsdisplay="_propertyList"> - <dl> - <div jsselect="_propertyList"> - <dt> - <!-- Note: intentionally longer 80 columns --> - <var jscontent="name">paramName</var><em> - (<span class="optional" jsdisplay="optional">optional </span><span jscontent="typeName">paramType</span>)</em> - </dt> - <dd class="todo" jsdisplay="!$this.description"> - Undocumented. - </dd> - <dd jsdisplay="$this.description" - jsvalues=".innerHTML:$this.description"> - Description of this parameter from the json schema. - </dd> - </div> - </dl> - </dd> - </div> - </dl> + <var jscontent="name">paramName</var><em> + (<span class="optional" jsdisplay="optional">optional </span><span jscontent="typeName">paramType</span>)</em> + </dt> + <dd class="todo" jsdisplay="!$this.description">Undocumented.</dd> + <dd jsdisplay="$this.description" jsvalues=".innerHTML:$this.description"> + Description of this parameter from the json schema. + </dd> + </div> + </dl> + + <!-- CALLBACK --> + <div jsdisplay="callbackParameters"> + <h4>Callback function</h4> + <p> + If you specify the <em>callback</em> parameter, + it should specify a function that looks like this: + </p> + + <!-- Note: intentionally longer 80 columns --> + <pre>function(<span jscontent="callbackSignature">Type param1, Type param2</span>) <span class="subdued">{...}</span>);</pre> + <dl> + <div jsselect="callbackParameters"> + <dt> + <!-- Note: intentionally longer 80 columns --> + <var jscontent="name">paramName</var><em> + (<span jscontent="typeName">paramType</span>)</em> + </dt> + <dd class="todo" jsdisplay="!$this.description">Undocumented.</dd> + <dd jsdisplay="$this.description" jsvalues=".innerHTML:$this.description"> + Description of this parameter from the json schema. + </dd> </div> + </dl> + </div> - </div> <!-- /description --> + </div> <!-- /description --> - </div> <!-- /apiItem --> + </div> <!-- /apiItem --> - </div> <!-- /apiGroup --> + </div> <!-- /apiGroup --> - <!-- EVENTS --> - <div class="apiGroup" id="events"> - <a name="#events"></a> - <h2 id="events">Events</h2> + <!-- EVENTS --> + <div class="apiGroup" id="events"> + <a name="#events"></a> + <h2 id="events">Events</h2> - <!-- iterates over all events --> - <div jsselect="events" class="apiItem" jsselect="functions"> - <a jsvalues=".name:'event-' + name"></a> - <h3 jscontent="name">event name</h3> + <!-- iterates over all events --> + <div jsselect="events" class="apiItem" jsselect="functions"> + <a jsvalues=".name:'event-' + name"></a> + <h3 jscontent="name">event name</h3> - <div class="summary"> - <!-- Note: intentionally longer 80 columns --> - <span class="subdued">chrome.bookmarks.</span><span jscontent="name">onEvent</span><span class="subdued">.addListener</span>(function(<span jscontent="callSignature">Type param1, Type param2</span>) <span class="subdued">{...}</span>); - </div> + <div class="summary"> + <!-- Note: intentionally longer 80 columns --> + <span class="subdued">chrome.bookmarks.</span><span jscontent="name">onEvent</span><span class="subdued">.addListener</span>(function(<span jscontent="callSignature">Type param1, Type param2</span>) <span class="subdued">{...}</span>); + </div> - <div class="description"> - <p class="todo" jsdisplay="!description">Undocumented.</p> - <p jsdisplay="description" jsvalues=".innerHTML:description"> - A description from the json schema def of the event goes here. - </p> + <div class="description"> + <p class="todo" jsdisplay="!description">Undocumented.</p> + <p jsdisplay="description" jsvalues=".innerHTML:description"> + A description from the json schema def of the event goes here. + </p> - <!-- PARAMETERS --> - <h4>Parameters</h4> - <dl> - <div jsselect="parameters"> - <dt> - <!-- Note: intentionally longer 80 columns --> - <var jscontent="name">paramName</var><em> (<span jscontent="typeName">paramType</span>)</em> - </dt> - <dd class="todo" jsdisplay="!$this.description">Undocumented.</dd> - <dd jsdisplay="$this.description" jsvalues=".innerHTML:$this.description"> - Description of this parameter from the json schema. - </dd> - - <!-- OBJECT PROPERTIES --> - <dd jsdisplay="_propertyList"> - <dl> - <div jsselect="_propertyList"> - <dt> - <!-- Note: intentionally longer 80 columns --> - <var jscontent="name">paramName</var><em> - (<span class="optional" jsdisplay="optional">optional </span><span jscontent="typeName">paramType</span>)</em> - </dt> - <dd class="todo" jsdisplay="!$this.description"> - Undocumented. - </dd> - <dd jsdisplay="$this.description" - jsvalues=".innerHTML:$this.description"> - Description of this parameter from the json schema. - </dd> - </div> - </dl> - </dd> - </div> - </dl> + <!-- PARAMETERS --> + <h4>Parameters</h4> + <dl> + <div jsselect="parameters"> + <dt> + <!-- Note: intentionally longer 80 columns --> + <var jscontent="name">paramName</var><em> (<span jscontent="typeName">paramType</span>)</em> + </dt> + <dd class="todo" jsdisplay="!$this.description">Undocumented.</dd> + <dd jsdisplay="$this.description" jsvalues=".innerHTML:$this.description"> + Description of this parameter from the json schema. + </dd> + </div> + </dl> - </div> <!-- /decription --> + </div> <!-- /decription --> - </div> <!-- /apiItem --> + </div> <!-- /apiItem --> - </div> <!-- /apiGroup --> - </div> <!-- /mainColumn --> - </div> <!-- /pageContent --> - <div id="pageFooter" --> - TBD: copyright/license goes here - </div> <!-- /pageFooter --> - </div> <!-- /container -->
\ No newline at end of file + </div> <!-- /apiGroup -->
\ No newline at end of file |