diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-22 23:50:11 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-22 23:50:11 +0000 |
commit | 156f0c678513cc85d6a194a235126fa283ece115 (patch) | |
tree | 125150c66af03ad8cbcc758ec41c1378451a7e59 /chrome/common/extensions/docs/events.html | |
parent | 9ba14056e51e361ba14f529151fb7c24cf3a4267 (diff) | |
download | chromium_src-156f0c678513cc85d6a194a235126fa283ece115.zip chromium_src-156f0c678513cc85d6a194a235126fa283ece115.tar.gz chromium_src-156f0c678513cc85d6a194a235126fa283ece115.tar.bz2 |
Basic setup for generating apps docs.
It turns out that we don't need to tag anything. Putting the page shell inside extensions/ or apps/ works better with the current state of the code.
In order to do the transition, I propose:
1) Land and push a change to the appengine server to make it look in /docs/extensions, then fall back to /docs.
2) Land this CL (without any apps files fleshed out)
3) Add support to app engine server to know about the apps folder too (can test by going to its app engine URL)
4) Flesh out the apps docs
5) Apply the new template
6) Fix the one-off things like generation of experimental.html that need to be fixed for apps-specific.
[3-6 can be done in parallel]
Review URL: https://chromiumcodereview.appspot.com/10642015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143742 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/docs/events.html')
-rw-r--r-- | chrome/common/extensions/docs/events.html | 1588 |
1 files changed, 0 insertions, 1588 deletions
diff --git a/chrome/common/extensions/docs/events.html b/chrome/common/extensions/docs/events.html deleted file mode 100644 index d19c7b5..0000000 --- a/chrome/common/extensions/docs/events.html +++ /dev/null @@ -1,1588 +0,0 @@ -<!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc. Note: - 1) The <head> information in this page is significant, should be uniform - across api docs and should be edited only with knowledge of the - templating mechanism. - 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a - browser, it will be re-generated from the template, json schema and - authored overview content. - 4) The <body>.innerHTML is also generated by an offline step so that this - page may easily be indexed by search engines. ---><html xmlns="http://www.w3.org/1999/xhtml"><head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> - <link href="css/print.css" rel="stylesheet" type="text/css" media="print"> - <script type="text/javascript" src="../../../third_party/jstemplate/jstemplate_compiled.js"> - </script> - <script type="text/javascript" src="../../../../third_party/json_minify/minify-sans-regexp.js"> - </script> - <script type="text/javascript" src="js/api_page_generator.js"></script> - <script type="text/javascript" src="js/bootstrap.js"></script> - <script type="text/javascript" src="js/sidebar.js"></script> - <meta name="description" content="Documentation for the chrome.events module, which is part of the Google Chrome extension APIs."><title>chrome.events - Google Chrome Extensions - Google Code</title></head> - <body> <div id="devModeWarning" class="displayModeWarning"> - You are viewing extension docs in chrome via the 'file:' scheme: are you expecting to see local changes when you refresh? You'll need run chrome with --allow-file-access-from-files. - </div> - <div id="branchWarning" class="displayModeWarning"> - <span>WARNING: This is the <span id="branchName">BETA</span> documentation. - It may not work with the stable release of Chrome.</span> - <select id="branchChooser"> - <option>Choose a different version... - </option><option value="">Stable - </option><option value="beta">Beta - </option><option value="dev">Dev - </option><option value="trunk">Trunk - </option></select> - </div> - <div id="unofficialWarning" class="displayModeWarning"> - <span>WARNING: This is unofficial documentation. It may not work with the - current release of Chrome.</span> - <button id="goToOfficialDocs">Go to the official docs</button> - </div> - <div id="gc-container" class="labs"> - <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION --> - <!-- In particular, sub-templates that recurse, must be used by allowing - jstemplate to make a copy of the template in this section which - are not operated on by way of the jsskip="true" --> - <!-- /SUBTEMPLATES --> - <a id="top"></a> - <div id="skipto"> - <a href="#gc-pagecontent">Skip to page content</a> - <a href="#gc-toc">Skip to main navigation</a> - </div> - <!-- API HEADER --> - <table id="header" width="100%" cellspacing="0" border="0"> - <tbody><tr> - <td valign="middle"><a href="http://code.google.com/"><img src="images/code_labs_logo.gif" height="43" width="161" alt="Google Code Labs" style="border:0; margin:0;"></a></td> - <td valign="middle" width="100%" style="padding-left:0.6em;"> - <form action="http://www.google.com/cse" id="cse" style="margin-top:0.5em"> - <div id="gsc-search-box"> - <input type="hidden" name="cx" value="002967670403910741006:61_cvzfqtno"> - <input type="hidden" name="ie" value="UTF-8"> - <input type="text" name="q" value="" size="55"> - <input class="gsc-search-button" type="submit" name="sa" value="Search"> - <br> - <span class="greytext">e.g. "page action" or "tabs"</span> - </div> - </form> - <script type="text/javascript" src="https://www.google.com/jsapi"></script> - <script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script> - <script type="text/javascript" src="https://www.google.com/coop/cse/t13n?form=cse&t13n_langs=en"></script> - <script type="text/javascript" src="https://www.google.com/coop/cse/brand?form=cse&lang=en"></script> - </td> - </tr> - </tbody></table> - <div id="codesiteContent" class=""> - <a id="gc-topnav-anchor"></a> - <div id="gc-topnav"> - <h1>Google Chrome Extensions (<a href="http://code.google.com/labs/">Labs</a>)</h1> - <ul id="home" class="gc-topnav-tabs"> - <li id="home_link"> - <a href="index.html" title="Google Chrome Extensions home page">Home</a> - </li> - <li id="docs_link"> - <a href="docs.html" title="Official Google Chrome Extensions documentation">Docs</a> - </li> - <li id="faq_link"> - <a href="faq.html" title="Answers to frequently asked questions about Google Chrome Extensions">FAQ</a> - </li> - <li id="samples_link"> - <a href="samples.html" title="Sample extensions (with source code)">Samples</a> - </li> - <li id="group_link"> - <a href="http://groups.google.com/a/chromium.org/group/chromium-extensions" title="Google Chrome Extensions developer forum">Group</a> - </li> - <li id="so_link"> - <a href="http://stackoverflow.com/questions/tagged/google-chrome-extension" title="[google-chrome-extension] tag on Stack Overflow">Questions?</a> - </li> - </ul> - </div> <!-- end gc-topnav --> - <div class="g-section g-tpl-170"> - <!-- SIDENAV --> - <div class="g-unit g-first" id="gc-toc"> - <ul> - <li><a href="getstarted.html">Getting Started</a></li> - <li><a href="overview.html">Overview</a></li> - <li><a href="whats_new.html">What's New?</a></li> - <li><h2><a href="devguide.html">Developer's Guide</a></h2> - <ul> - <li>Browser UI - <ul> - <li><a href="browserAction.html">Browser Actions</a></li> - <li><a href="contextMenus.html">Context Menus</a></li> - <li><a href="notifications.html">Desktop Notifications</a></li> - <li><a href="omnibox.html">Omnibox</a></li> - <li><a href="options.html">Options Pages</a></li> - <li><a href="override.html">Override Pages</a></li> - <li><a href="pageAction.html">Page Actions</a></li> - </ul> - </li> - <li>Browser Interaction - <ul> - <li><a href="bookmarks.html">Bookmarks</a></li> - <li><a href="cookies.html">Cookies</a></li> - <li><a href="devtools.html">Developer Tools</a></li> - <li class="leftNavSelected">Events</li> - <li><a href="history.html">History</a></li> - <li><a href="management.html">Management</a></li> - <li><a href="tabs.html">Tabs</a></li> - <li><a href="windows.html">Windows</a></li> - </ul> - </li> - <li>Implementation - <ul> - <li><a href="a11y.html">Accessibility</a></li> - <li><a href="background_pages.html">Background Pages</a></li> - <li><a href="content_scripts.html">Content Scripts</a></li> - <li><a href="xhr.html">Cross-Origin XHR</a></li> - <li><a href="i18n.html">Internationalization</a></li> - <li><a href="messaging.html">Message Passing</a></li> - <li><a href="permissions.html">Optional Permissions</a></li> - <li><a href="npapi.html">NPAPI Plugins</a></li> - </ul> - </li> - <li>Finishing - <ul> - <li><a href="hosting.html">Hosting</a></li> - <li><a href="external_extensions.html">Other Deployment Options</a></li> - </ul> - </li> - </ul> - </li> - <li><h2><a href="apps.html">Packaged Apps</a></h2></li> - <li><h2><a href="tutorials.html">Tutorials</a></h2> - <ul> - <li><a href="tut_debugging.html">Debugging</a></li> - <li><a href="tut_analytics.html">Google Analytics</a></li> - <li><a href="tut_oauth.html">OAuth</a></li> - </ul> - </li> - <li><h2>Reference</h2> - <ul> - <li>Formats - <ul> - <li><a href="manifest.html">Manifest Files</a></li> - <li><a href="match_patterns.html">Match Patterns</a></li> - </ul> - </li> - <li><a href="permission_warnings.html">Permission Warnings</a></li> - <li><a href="api_index.html">chrome.* APIs</a></li> - <li><a href="api_other.html">Other APIs</a></li> - </ul> - </li> - <li><h2><a href="samples.html">Samples</a></h2></li> - <div class="line"> </div> - <li><h2>More</h2> - <ul> - <li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li> - <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li> - <li><a href="themes.html">Themes</a></li> - </ul> - </li> - </ul> - </div> - <script> - initToggles(); - </script> - <div class="g-unit" id="gc-pagecontent"> - <div id="pageTitle"> - <h1 class="page_title">chrome.events</h1> - </div> - <!-- TABLE OF CONTENTS --> - <div id="toc"> - <h2>Contents</h2> - <ol> - <li> - <a href="#declarative">Declarative Event Handlers</a> - <ol> - <li> - <a href="#rules">Rules</a> - </li><li> - <a href="#eventobjects">Event objects</a> - </li><li> - <a href="#addingrules">Adding rules</a> - </li><li> - <a href="#removingrules">Removing rules</a> - </li><li> - <a href="#retrievingrules">Retrieving rules</a> - </li> - </ol> - </li> - <li> - <a href="#apiReference">API reference: chrome.events</a> - <ol> - <li> - <a href="#types">Types</a> - <ol> - <li> - <a href="#type-events.Event">Event</a> - <ol> - <li> - <a href="#global-events.Event-methods">Methods</a> - <ol> - <li> - <a href="#method-events.Event-addListener">addListener</a> - </li><li> - <a href="#method-events.Event-addRules">addRules</a> - </li><li> - <a href="#method-events.Event-getRules">getRules</a> - </li><li> - <a href="#method-events.Event-hasListener">hasListener</a> - </li><li> - <a href="#method-events.Event-hasListeners">hasListeners</a> - </li><li> - <a href="#method-events.Event-removeListener">removeListener</a> - </li><li> - <a href="#method-events.Event-removeRules">removeRules</a> - </li> - </ol> - </li> - </ol> - </li><li> - <a href="#type-events.Rule">Rule</a> - <ol> - </ol> - </li><li> - <a href="#type-events.UrlFilter">UrlFilter</a> - <ol> - </ol> - </li> - </ol> - </li> - </ol> - </li> - </ol> - </div> - <!-- /TABLE OF CONTENTS --> - <!-- Standard content lead-in for experimental API pages --> - <!-- STATIC CONTENT PLACEHOLDER --> - <div id="static"><p> -An <code>Event</code> is an object -that allows you to be notified -when something interesting happens. -Here's an example of using the -<code>chrome.tabs.onCreated</code> event -to be notified whenever there's a new tab: -</p> -<pre>chrome.tabs.onCreated.<b>addListener(function(</b>tab<b>) {</b> - appendToLog('tabs.onCreated --' - + ' window: ' + tab.windowId - + ' tab: ' + tab.id - + ' index: ' + tab.index - + ' url: ' + tab.url); -<b>});</b> -</pre> -<p> -As the example shows, -you register for notification using <code>addListener()</code>. -The argument to <code>addListener()</code> -is always a function that you define to handle the event, -but the parameters to the function depend on -which event you're handling. -Checking the documentation for -<a href="tabs.html#event-onCreated"><code>chrome.tabs.onCreated</code></a>, -you can see that the function has a single parameter: -a <a href="tabs.html#type-tabs.Tab">Tab</a> object -that has details about the newly created tab. -</p> -<h2 id="declarative">Declarative Event Handlers</h2> -<p> -The declarative event handlers provide a means to define rules consisting of -declarative conditions and actions. Conditions are evaluated in the browser -rather than the JavaScript engine which reduces roundtrip latencies and allows -for very high efficiency. -</p> -<p>Declarative event handlers are used for example in the <a href="declarativeWebRequest.html">Declarative Web Request API</a> and possibly -further extension APIs in the future. This page describes the underlying -concepts of all declarative event handlers. -</p> -<h3 id="rules">Rules</h3> -<p>The simplest possible rule consists of one or more conditions and one or more -actions:</p> -<pre>var rule = { - conditions: [ /* my conditions */ ], - actions: [ /* my actions */ ] -}; -</pre> -<p>If any of the conditions is fulfilled, all actions are executed.</p> -<p>In addition to conditions and actions you may give each rule an identifier, -which simplifies unregistering previously registered rules, and a priority to -define precedences among rules. Priorities are only considered if rules conflict -each other or need to be executed in a specific order.</p> -<pre>var rule = { - id: "my rule", // optional, will be generated if not set. - priority: 100, // optional, defaults to 100. - conditions: [ /* my conditions */ ], - actions: [ /* my actions */ ] -}; -</pre> -<h3 id="eventobjects">Event objects</h3> -<p> -<a href="events.html">Event objects</a> may support rules. These event objects -don't call a callback function when events happer but test whether any -registered rule has at least one fulfilled condition and execute the actions -associated with this rule. Event objects supporting the declarative API have -three relevant methods: <a href="#method-addRules"><code>addRules()</code></a>, -<a href="#method-removeRules"><code>removeRules()</code></a>, and -<a href="#method-getRules"><code>getRules()</code></a>. -</p> -<h3 id="addingrules">Adding rules</h3> -<p> -To add rules call the <code>addRules()</code> function of the event object. It -takes an array of rule instances as its first parameter and a callback function -that is called on completion. -</p> -<pre>var rule_list = [rule1, rule2, ...]; -function addRules(rule_list, function callback(details) {...}); -</pre> -<p> -If the rules were inserted successfully, the <code>details</code> parameter -contains an array of inserted rules appearing in the same order as in the passed -<code>rule_list</code> where the optional parameters <code>id</code> and -<code>priority</code> were filled with the generated values. If any rule is -invalid, e.g., because it contained an invalid condition or action, none of the -rules are added and the <a href="extension.html#property-lastError">lastError</a> variable is set when -the callback function is called. Each rule in <code>rule_list</code> must -contain a unique identifier that is not currently used by another rule or an -empty identifier. -</p> -<h3 id="removingrules">Removing rules</h3> -<p> -To remove rules call the <code>removeRules()</code> function. It accepts an -optional array of rule identifiers as its first parameter and a callback -function as its second parameter. -</p> -<pre>var rule_ids = ["id1", "id2", ...]; -function removeRules(rule_ids, function callback() {...}); -</pre> -<p> -If <code>rule_ids</code> is an array of identifiers, all rules having -identifiers listed in the array are removed. If <code>rule_ids</code> lists an -identifier, that is unknown, this identifier is silently ignored. If -<code>rule_ids</code> is <code>undefined</code>, all registered rules of this -extension are removed. The <code>callback()</code> function is called when the -rules were removed. -</p> -<h3 id="retrievingrules">Retrieving rules</h3> -<p> -To retrieve a list of currently registered rules, call the -<code>getRules()</code> function. It accepts an optional array of rule -identifiers with the same semantics as <code>removeRules</code> and a callback -function. -</p><p> -</p><pre>var rule_ids = ["id1", "id2", ...]; -function getRules(rule_ids, function callback(details) {...}); -</pre> -<p> -The <code>details</code> parameter passed to the <code>calback()</code> function -refers to an array of rules including filled optional parameters. -</p> -</div> - <!-- API PAGE --> - <div class="apiPage"> - <a name="apiReference"></a> - <h2>API reference: chrome.events</h2> - <!-- PROPERTIES --> - <!-- /apiGroup --> - <!-- METHODS --> - <!-- /apiGroup --> - <!-- EVENTS --> - <!-- /apiGroup --> - <!-- TYPES --> - <div class="apiGroup"> - <a name="types"></a> - <h3 id="types">Types</h3> - <!-- iterates over all types --> - <div class="apiItem"> - <a name="type-events.Event"></a> - <h4>events.Event</h4> - <div> - <dt> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span id="typeTemplate"> - <span> - <span>object</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>An object which allows the addition and removal of listeners for a Chrome event.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <dd> - <div class="apiGroup"> - <a name="global-events.Event-methods"></a> - <h3>Methods of events.Event</h3> - <!-- iterates over all functions --> - <div class="apiItem"> - <a name="method-events.Event-addListener"></a> <!-- method-anchor --> - <h4>addListener</h4> - <div class="summary"> - <!-- Note: intentionally longer 80 columns --> - <span>events.Event.addListener</span>(<span class="null"><span>function</span> - <var><span>callback</span></var></span>)</div> - <div class="description"> - <p>Registers an event listener <em>callback</em> to an event.</p> - <!-- PARAMETERS --> - <h4>Parameters</h4> - <dl> - <div> - <div> - <dt> - <var>callback</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span id="typeTemplate"> - <span> - <span>function</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Called when an event occurs. The parameters of this function depend on the type of event.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div> - </dl> - <!-- RETURNS --> - <dl> - </dl> - <!-- CALLBACK --> - <!-- MIN_VERSION --> - </div> <!-- /description --> - </div><div class="apiItem"> - <a name="method-events.Event-addRules"></a> <!-- method-anchor --> - <h4>addRules</h4> - <div class="summary"> - <!-- Note: intentionally longer 80 columns --> - <span>events.Event.addRules</span>(<span class="null"><span>array of events.Rule</span> - <var><span>rules</span></var></span><span class="optional"><span>, </span><span>function</span> - <var><span>callback</span></var></span>)</div> - <div class="description"> - <p>Registers rules to handle events.</p> - <!-- PARAMETERS --> - <h4>Parameters</h4> - <dl> - <div> - <div> - <dt> - <var>rules</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span id="typeTemplate"> - <span> - <span> - array of <span><span> - <span> - <a href="events.html#type-events.Rule">events.Rule</a> - </span> - </span></span> - </span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Rules to be registered. These do not replace previously registered rules.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>callback</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>function</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Called with registered rules.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div> - </dl> - <!-- RETURNS --> - <dl> - </dl> - <!-- CALLBACK --> - <div> - <div> - <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>array of events.Rule rules</span>) <span class="subdued">{...}</span>;</pre> - <dl> - <div> - <div> - <dt> - <var>rules</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span id="typeTemplate"> - <span> - <span> - array of <span><span> - <span> - <a href="events.html#type-events.Rule">events.Rule</a> - </span> - </span></span> - </span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Rules that were registered, the optional parameters are filled with values.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div> - </dl> - </div> - </div> - <!-- MIN_VERSION --> - </div> <!-- /description --> - </div><div class="apiItem"> - <a name="method-events.Event-getRules"></a> <!-- method-anchor --> - <h4>getRules</h4> - <div class="summary"> - <!-- Note: intentionally longer 80 columns --> - <span>events.Event.getRules</span>(<span class="optional"><span>array of string</span> - <var><span>ruleIdentifiers</span></var></span><span class="null"><span>, </span><span>function</span> - <var><span>callback</span></var></span>)</div> - <div class="description"> - <p>Returns currently registered rules.</p> - <!-- PARAMETERS --> - <h4>Parameters</h4> - <dl> - <div> - <div> - <dt> - <var>ruleIdentifiers</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span> - array of <span><span> - <span> - <span>string</span> - </span> - </span></span> - </span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>If an array is passed, only rules with identifiers contained in this array are returned.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>callback</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span id="typeTemplate"> - <span> - <span>function</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Called with registered rules.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div> - </dl> - <!-- RETURNS --> - <dl> - </dl> - <!-- CALLBACK --> - <div> - <div> - <h4>Callback function</h4> - <p> - The <em>callback</em> parameter should specify a function - that looks like this: - </p> - <!-- Note: intentionally longer 80 columns --> - <pre>function(<span>array of events.Rule rules</span>) <span class="subdued">{...}</span>;</pre> - <dl> - <div> - <div> - <dt> - <var>rules</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span id="typeTemplate"> - <span> - <span> - array of <span><span> - <span> - <a href="events.html#type-events.Rule">events.Rule</a> - </span> - </span></span> - </span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Rules that were registered, the optional parameters are filled with values.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div> - </dl> - </div> - </div> - <!-- MIN_VERSION --> - </div> <!-- /description --> - </div><div class="apiItem"> - <a name="method-events.Event-hasListener"></a> <!-- method-anchor --> - <h4>hasListener</h4> - <div class="summary"><span>boolean</span> - <!-- Note: intentionally longer 80 columns --> - <span>events.Event.hasListener</span>(<span class="null"><span>function</span> - <var><span>callback</span></var></span>)</div> - <div class="description"> - <!-- PARAMETERS --> - <h4>Parameters</h4> - <dl> - <div> - <div> - <dt> - <var>callback</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span id="typeTemplate"> - <span> - <span>function</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Listener whose registration status shall be tested.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div> - </dl> - <!-- RETURNS --> - <h4>Returns</h4> - <dl> - <div> - <div> - <dt> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span id="typeTemplate"> - <span> - <span>boolean</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>True if <em>callback</em> is registered to the event.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div> - </dl> - <!-- CALLBACK --> - <!-- MIN_VERSION --> - </div> <!-- /description --> - </div><div class="apiItem"> - <a name="method-events.Event-hasListeners"></a> <!-- method-anchor --> - <h4>hasListeners</h4> - <div class="summary"><span>boolean</span> - <!-- Note: intentionally longer 80 columns --> - <span>events.Event.hasListeners</span>()</div> - <div class="description"> - <!-- PARAMETERS --> - <dl> - </dl> - <!-- RETURNS --> - <h4>Returns</h4> - <dl> - <div> - <div> - <dt> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span id="typeTemplate"> - <span> - <span>boolean</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>True if any event listeners are registered to the event.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div> - </dl> - <!-- CALLBACK --> - <!-- MIN_VERSION --> - </div> <!-- /description --> - </div><div class="apiItem"> - <a name="method-events.Event-removeListener"></a> <!-- method-anchor --> - <h4>removeListener</h4> - <div class="summary"> - <!-- Note: intentionally longer 80 columns --> - <span>events.Event.removeListener</span>(<span class="null"><span>function</span> - <var><span>callback</span></var></span>)</div> - <div class="description"> - <p>Deregisters an event listener <em>callback</em> from an event.</p> - <!-- PARAMETERS --> - <h4>Parameters</h4> - <dl> - <div> - <div> - <dt> - <var>callback</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span id="typeTemplate"> - <span> - <span>function</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Listener that shall be unregistered.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div> - </dl> - <!-- RETURNS --> - <dl> - </dl> - <!-- CALLBACK --> - <!-- MIN_VERSION --> - </div> <!-- /description --> - </div><div class="apiItem"> - <a name="method-events.Event-removeRules"></a> <!-- method-anchor --> - <h4>removeRules</h4> - <div class="summary"> - <!-- Note: intentionally longer 80 columns --> - <span>events.Event.removeRules</span>(<span class="optional"><span>array of string</span> - <var><span>ruleIdentifiers</span></var></span><span class="optional"><span>, </span><span>function</span> - <var><span>callback</span></var></span>)</div> - <div class="description"> - <p>Unregisters currently registered rules.</p> - <!-- PARAMETERS --> - <h4>Parameters</h4> - <dl> - <div> - <div> - <dt> - <var>ruleIdentifiers</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span> - array of <span><span> - <span> - <span>string</span> - </span> - </span></span> - </span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>If an array is passed, only rules with identifiers contained in this array are unregistered.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>callback</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>function</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Called when rules were unregistered.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div> - </dl> - <!-- RETURNS --> - <dl> - </dl> - <!-- CALLBACK --> - <div> - <div> - <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></span>) <span class="subdued">{...}</span>;</pre> - <dl> - </dl> - </div> - </div> - <!-- MIN_VERSION --> - </div> <!-- /description --> - </div> <!-- /apiItem --> - </div> - </dd> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div class="apiItem"> - <a name="type-events.Rule"></a> - <h4>events.Rule</h4> - <div> - <dt> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span id="typeTemplate"> - <span> - <span>object</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Description of a declarative rule for handling events.</dd> - <!-- OBJECT PROPERTIES --> - <dd> - <dl> - <div> - <div> - <dt> - <var>id</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>string</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Optional identifier that allows referencing this rule.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>conditions</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span id="typeTemplate"> - <span> - <span> - array of <span><span> - <span> - <span>any</span> - </span> - </span></span> - </span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>List of conditions that can trigger the actions.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>actions</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span id="typeTemplate"> - <span> - <span> - array of <span><span> - <span> - <span>any</span> - </span> - </span></span> - </span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>List of actions that are triggered if one of the condtions is fulfilled.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>priority</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>integer</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Optional priority of this rule. Defaults to 100.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div> - </dl> - </dd> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div class="apiItem"> - <a name="type-events.UrlFilter"></a> - <h4>events.UrlFilter</h4> - <div> - <dt> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span id="typeTemplate"> - <span> - <span>object</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Filters URLs for various criteria</dd> - <!-- OBJECT PROPERTIES --> - <dd> - <dl> - <div> - <div> - <dt> - <var>hostContains</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>string</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Matches if the host name of the URL contains a specified string.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>hostEquals</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>string</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Matches if the host name of the URL is equal to a specified string.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>hostPrefix</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>string</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Matches if the host name of the URL starts with a specified string.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>hostSuffix</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>string</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Matches if the host name of the URL ends with a specified string.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>pathContains</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>string</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Matches if the path segment of the URL contains a specified string.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>pathEquals</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>string</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Matches if the path segment of the URL is equal to a specified string.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>pathPrefix</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>string</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Matches if the path segment of the URL starts with a specified string.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>pathSuffix</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>string</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Matches if the path segment of the URL ends with a specified string.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>queryContains</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>string</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Matches if the query segment of the URL contains a specified string.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>queryEquals</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>string</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Matches if the query segment of the URL is equal to a specified string.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>queryPrefix</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>string</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Matches if the query segment of the URL starts with a specified string.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>querySuffix</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>string</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Matches if the query segment of the URL ends with a specified string.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>urlContains</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>string</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Matches if the URL contains a specified string.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>urlEquals</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>string</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Matches if the URL is equal to a specified string.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>urlPrefix</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>string</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Matches if the URL starts with a specified string.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>urlSuffix</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span>string</span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Matches if the URL ends with a specified string.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>schemes</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span> - array of <span><span> - <span> - <span>string</span> - </span> - </span></span> - </span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Matches if the scheme of the URL is equal to any of the schemes specified in the array.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div><div> - <div> - <dt> - <var>ports</var> - <em> - <!-- TYPE --> - <div style="display:inline"> - ( - <span class="optional">optional</span> - <span id="typeTemplate"> - <span> - <span> - array of <span><span> - <span> - <span>integer or array of integer</span> - </span> - </span></span> - </span> - </span> - </span> - ) - </div> - </em> - </dt> - <dd>Matches if the port of the URL is contained in any of the specified port lists. For example <code>[80, 443, [1000, 1200]]</code> matches all requests on port 80, 443 and in the range 1000-1200.</dd> - <!-- OBJECT PROPERTIES --> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div> - </dl> - </dd> - <!-- OBJECT METHODS --> - <!-- OBJECT EVENT FIELDS --> - <!-- FUNCTION PARAMETERS --> - </div> - </div> <!-- /apiItem --> - </div> <!-- /apiGroup --> - </div> <!-- /apiPage --> - </div> <!-- /gc-pagecontent --> - </div> <!-- /g-section --> - </div> <!-- /codesiteContent --> - <div id="gc-footer" --=""> - <div class="text"> - <p> - Except as otherwise <a href="http://code.google.com/policies.html#restrictions">noted</a>, - the content of this page is licensed under the <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons - Attribution 3.0 License</a>, and code samples are licensed under the - <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD License</a>. - </p> - <p> - ©2011 Google - </p> -<!-- begin analytics --> -<script src="https://www.google-analytics.com/urchin.js" type="text/javascript"></script> -<script src="https://www.google-analytics.com/ga.js" type="text/javascript"></script> -<script type="text/javascript"> - // chrome doc tracking - try { - var engdocs = _gat._getTracker("YT-10763712-2"); - engdocs._trackPageview(); - } catch(err) {} - // code.google.com site-wide tracking - try { - _uacct="UA-18071-1"; - _uanchor=1; - _uff=0; - urchinTracker(); - } - catch(e) {/* urchinTracker not available. */} -</script> -<!-- end analytics --> - </div> - </div> <!-- /gc-footer --> - </div> <!-- /gc-container --> -</body></html> |