Class: HtmlScreen

HtmlScreen


new HtmlScreen()

Screen class that perform a request and extracts surface contents from the response content.

Extends

Members


<protected, static> permanentResourcesInDoc :object

Caches permanent resource keys.
Type:
  • object

<protected, static> selectors :object

Helper selectors for tracking resources.
Type:
  • object

<protected, non-null> cache :Object

Holds the cached data.
Type:
  • Object
Inherited From:
Default Value:
  • null

<protected> cacheable :boolean

Holds whether class is cacheable.
Type:
  • boolean
Inherited From:
Default Value:
  • false

<protected, nullable> httpHeaders :Object

Holds default http headers to set on request.
Type:
  • Object
Inherited From:
Default Value:
  • { 'X-PJAX': 'true', 'X-Requested-With': 'XMLHttpRequest' }

<protected, non-null> httpMethod :string

Holds default http method to perform the request.
Type:
  • string
Inherited From:
Default Value:
  • RequestScreen.GET

<protected> id :string

Holds the screen id.
Type:
  • string
Inherited From:

<protected> request :XMLHttpRequest

Holds the XHR object responsible for the request.
Type:
  • XMLHttpRequest
Inherited From:
Default Value:
  • null

<protected, non-null> timeout :number

Holds the request timeout in milliseconds.
Type:
  • number
Inherited From:
Default Value:
  • 30000

<protected, nullable> title :string

Holds the screen title. Relevant when the page title should be upadated when screen is rendered.
Type:
  • string
Inherited From:
Default Value:
  • null

<protected, non-null> titleSelector :string

Holds the title selector. Relevant to extract the </code> element from request fragments to use as the screen title. </div> <h5>Type:</h5> <ul> <li> <span class="param-type">string</span> </li> </ul> <dl class="details"> <dt class="tag-default method-doc-label method-doc-details-label">Default Value:</dt> <dd class="tag-default"> <ul class="dummy"> <li>title</li> </ul> </dd> </dl> </dd> </dl> <h3 class="subsection-title">Methods</h3> <dl> <hr> <dt> <h4 class="name" id="activate"><span class="type-signature"></span>activate()</h4> </dt> <dd> <div class="description"> Fires when the screen is active. Allows a screen to perform any setup that requires its DOM to be visible. Lifecycle. </div> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Screen.html#activate">Screen#activate</a> </li> </ul> </dd> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="RequestScreen.html#activate">RequestScreen#activate</a> </li></ul></dd> </dl> </dd> <hr> <dt> <h4 class="name" id="addCache"><span class="type-signature"></span>addCache(content)</h4> </dt> <dd> <div class="description"> Adds content to the cache. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>content</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Content to be cached.</td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Cacheable.html#addCache">Cacheable#addCache</a> </li> </ul> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="allocateVirtualDocumentForContent"><span class="type-signature"></span>allocateVirtualDocumentForContent(htmlString)</h4> </dt> <dd> <div class="description"> Allocates virtual document for content. After allocated virtual document can be accessed by <code>this.virtualDocument</code>. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>htmlString</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> </dd> <hr> <dt> <h4 class="name" id="appendStyleIntoDocument_"><span class="type-signature"></span>appendStyleIntoDocument_(newStyle)</h4> </dt> <dd> <div class="description"> Customizes logic to append styles into document. Relevant to when tracking a style by id make sure to re-positions the new style in the same dom order. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>newStyle</code></td> <td class="type"> <span class="param-type">Element</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> </dd> <hr> <dt> <h4 class="name" id="assertSameBodyIdInVirtualDocument"><span class="type-signature"></span>assertSameBodyIdInVirtualDocument()</h4> </dt> <dd> <div class="description"> If body is used as surface forces the requested documents to have same id of the initial page. </div> <dl class="details"> </dl> </dd> <hr> <dt> <h4 class="name" id="assertValidResponseStatusCode"><span class="type-signature"><protected> </span>assertValidResponseStatusCode(status)</h4> </dt> <dd> <div class="description"> Asserts that response status code is valid. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>status</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="RequestScreen.html#assertValidResponseStatusCode">RequestScreen#assertValidResponseStatusCode</a> </li> </ul> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="beforeDeactivate"><span class="type-signature"></span>beforeDeactivate()</h4> </dt> <dd> <div class="description"> Gives the Screen a chance to cancel the navigation and stop itself from being deactivated. Can be used, for example, if the screen has unsaved state. Lifecycle. Clean-up should not be preformed here, since the navigation may still be cancelled. Do clean-up in deactivate. </div> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Screen.html#beforeDeactivate">Screen#beforeDeactivate</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> If returns true, the current screen is locked and the next nagivation interrupted. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">boolean</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="beforeUpdateHistoryPath"><span class="type-signature"></span>beforeUpdateHistoryPath()</h4> </dt> <dd> <div class="description"> Gives the Screen a chance format the path before history update. </div> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Screen.html#beforeUpdateHistoryPath">Screen#beforeUpdateHistoryPath</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Navigation path to use on history. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="beforeUpdateHistoryState"><span class="type-signature"></span>beforeUpdateHistoryState()</h4> </dt> <dd> <div class="description"> Gives the Screen a chance format the state before history update. </div> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Screen.html#beforeUpdateHistoryState">Screen#beforeUpdateHistoryState</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> History state to use on history. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">object</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="clearCache"><span class="type-signature"></span>clearCache()</h4> </dt> <dd> <div class="description"> Clears the cache. </div> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Cacheable.html#clearCache">Cacheable#clearCache</a> </li> </ul> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="copyNodeAttributesFromContent_"><span class="type-signature"></span>copyNodeAttributesFromContent_()</h4> </dt> <dd> <div class="description"> Copies attributes from the <html> tag of content to the given node. </div> <dl class="details"> </dl> </dd> <hr> <dt> <h4 class="name" id="deactivate"><span class="type-signature"></span>deactivate()</h4> </dt> <dd> <div class="description"> Allows a screen to do any cleanup necessary after it has been deactivated, for example cancelling outstanding requests or stopping timers. Lifecycle. </div> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Screen.html#deactivate">Screen#deactivate</a> </li> </ul> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="disposeInternal"><span class="type-signature"></span>disposeInternal()</h4> </dt> <dd> <div class="description"> Dispose a screen, either after it is deactivated (in the case of a non-cacheable view) or when the App is itself disposed for whatever reason. Lifecycle. </div> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Screen.html#disposeInternal">Screen#disposeInternal</a> </li> </ul> </dd> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="RequestScreen.html#disposeInternal">RequestScreen#disposeInternal</a> </li></ul></dd> </dl> </dd> <hr> <dt> <h4 class="name" id="disposePendingStyles"><span class="type-signature"></span>disposePendingStyles()</h4> </dt> <dd> <div class="description"> Disposes pending styles if screen get disposed prior to its loading. </div> <dl class="details"> </dl> </dd> <hr> <dt> <h4 class="name" id="evaluateScripts"><span class="type-signature"></span>evaluateScripts(surfaces)</h4> </dt> <dd> <div class="description"> Allows a screen to evaluate scripts before the element is made visible. Lifecycle. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>surfaces</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Map of surfaces to flip keyed by surface id.</td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Screen.html#evaluateScripts">Screen#evaluateScripts</a> </li> </ul> </dd> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="RequestScreen.html#evaluateScripts">RequestScreen#evaluateScripts</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> This can return a promise, which will pause the navigation until it is resolved. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">CancellablePromise</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="evaluateStyles"><span class="type-signature"></span>evaluateStyles(surfaces)</h4> </dt> <dd> <div class="description"> Allows a screen to evaluate styles before the element is made visible. Lifecycle. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>surfaces</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Map of surfaces to flip keyed by surface id.</td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Screen.html#evaluateStyles">Screen#evaluateStyles</a> </li> </ul> </dd> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="RequestScreen.html#evaluateStyles">RequestScreen#evaluateStyles</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> This can return a promise, which will pause the navigation until it is resolved. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">CancellablePromise</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="flip"><span class="type-signature"></span>flip(surfaces)</h4> </dt> <dd> <div class="description"> Allows a screen to perform any setup immediately before the element is made visible. Lifecycle. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>surfaces</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Map of surfaces to flip keyed by surface id.</td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Screen.html#flip">Screen#flip</a> </li> </ul> </dd> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="RequestScreen.html#flip">RequestScreen#flip</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> This can return a promise, which will pause the navigation until it is resolved. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">CancellablePromise</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="formatLoadPath"><span class="type-signature"><protected> </span>formatLoadPath(path)</h4> </dt> <dd> <div class="description"> Formats load path before invoking ajax call. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>path</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="RequestScreen.html#formatLoadPath">RequestScreen#formatLoadPath</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Formatted path; </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="getCache"><span class="type-signature"><protected> </span>getCache()</h4> </dt> <dd> <div class="description"> Gets the cached content. </div> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Cacheable.html#getCache">Cacheable#getCache</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Cached content. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Object</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="getHttpHeaders"><span class="type-signature"></span>getHttpHeaders()</h4> </dt> <dd> <div class="description"> Gets the http headers. </div> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="RequestScreen.html#getHttpHeaders">RequestScreen#getHttpHeaders</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Object</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="getHttpMethod"><span class="type-signature"></span>getHttpMethod()</h4> </dt> <dd> <div class="description"> Gets the http method. </div> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="RequestScreen.html#getHttpMethod">RequestScreen#getHttpMethod</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="getId"><span class="type-signature"></span>getId()</h4> </dt> <dd> <div class="description"> Gets the screen id. </div> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Screen.html#getId">Screen#getId</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="getRequest"><span class="type-signature"></span>getRequest()</h4> </dt> <dd> <div class="description"> Gets the request object. </div> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="RequestScreen.html#getRequest">RequestScreen#getRequest</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Object</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="getRequestPath"><span class="type-signature"></span>getRequestPath()</h4> </dt> <dd> <div class="description"> Gets request path. </div> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="RequestScreen.html#getRequestPath">RequestScreen#getRequestPath</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="getResourceKey_"><span class="type-signature"></span>getResourceKey_(resource)</h4> </dt> <dd> <div class="description"> Extracts a key to identify the resource based on its attributes. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>resource</code></td> <td class="type"> <span class="param-type">Element</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> Extracted key based on resource attributes in order of preference: id, href, src. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="getSurfaceContent"><span class="type-signature"></span>getSurfaceContent(surfaceId)</h4> </dt> <dd> <div class="description"> Returns the content for the given surface, or null if the surface isn't used by this screen. This will be called when a screen is initially constructed or, if a screen is non-cacheable, when navigated. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>surfaceId</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The id of the surface DOM element.</td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Screen.html#getSurfaceContent">Screen#getSurfaceContent</a> </li> </ul> </dd> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="RequestScreen.html#getSurfaceContent">RequestScreen#getSurfaceContent</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> This can return a string or node representing the content of the surface. If returns falsy values surface default content is restored. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> | <span class="param-type">Element</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="getTimeout"><span class="type-signature"></span>getTimeout()</h4> </dt> <dd> <div class="description"> Gets the request timeout. </div> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="RequestScreen.html#getTimeout">RequestScreen#getTimeout</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="getTitle"><span class="type-signature"></span>getTitle()</h4> </dt> <dd> <div class="description"> Gets the screen title. </div> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Screen.html#getTitle">Screen#getTitle</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="getTitleSelector"><span class="type-signature"></span>getTitleSelector()</h4> </dt> <dd> <div class="description"> Gets the title selector. </div> <dl class="details"> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="isCacheable"><span class="type-signature"></span>isCacheable()</h4> </dt> <dd> <div class="description"> Whether the class is cacheable. </div> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Cacheable.html#isCacheable">Cacheable#isCacheable</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Returns true when class is cacheable, false otherwise. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">boolean</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="isValidResponseStatusCode"><span class="type-signature"></span>isValidResponseStatusCode(statusCode)</h4> </dt> <dd> <div class="description"> Checks if response succeeded. Any status code 2xx or 3xx is considered valid. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>statusCode</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="RequestScreen.html#isValidResponseStatusCode">RequestScreen#isValidResponseStatusCode</a> </li> </ul> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="load"><span class="type-signature"></span>load( [path])</h4> </dt> <dd> <div class="description"> Returns all contents for the surfaces. This will pass the loaded content to <code>Screen.load</code> with all information you need to fulfill the surfaces. Lifecycle. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>path</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> <optional><br> </td> <td class="description last">The requested path.</td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Screen.html#load">Screen#load</a> </li> </ul> </dd> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="RequestScreen.html#load">RequestScreen#load</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> This can return a string representing the contents of the surfaces or a promise, which will pause the navigation until it is resolved. This is useful for loading async content. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">CancellablePromise</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="maybeExtractResponseUrlFromRequest"><span class="type-signature"></span>maybeExtractResponseUrlFromRequest(request)</h4> </dt> <dd> <div class="description"> The following method tries to extract the response url value by checking the custom response header 'X-Request-URL' if proper value is not present in XMLHttpRequest. The value of responseURL will be the final URL obtained after any redirects. Internet Explorer, Edge and Safari <= 7 does not yet support the feature. For more information see: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseURL https://xhr.spec.whatwg.org/#the-responseurl-attribute </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>request</code></td> <td class="type"> <span class="param-type">XMLHttpRequest</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="RequestScreen.html#maybeExtractResponseUrlFromRequest">RequestScreen#maybeExtractResponseUrlFromRequest</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Response url best match. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="querySelectorAll_"><span class="type-signature"></span>querySelectorAll_(selector)</h4> </dt> <dd> <div class="description"> Queries elements from document and returns an array of elements. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>selector</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">array.<Element></span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="releaseVirtualDocument"><span class="type-signature"></span>releaseVirtualDocument()</h4> </dt> <dd> <div class="description"> Releases virtual document allocated for content. </div> <dl class="details"> </dl> </dd> <hr> <dt> <h4 class="name" id="resolveTitleFromVirtualDocument"><span class="type-signature"></span>resolveTitleFromVirtualDocument()</h4> </dt> <dd> <div class="description"> Resolves title from allocated virtual document. </div> <dl class="details"> </dl> </dd> <hr> <dt> <h4 class="name" id="setCacheable"><span class="type-signature"></span>setCacheable(cacheable)</h4> </dt> <dd> <div class="description"> Sets whether the class is cacheable. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>cacheable</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Cacheable.html#setCacheable">Cacheable#setCacheable</a> </li> </ul> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="setHttpHeaders"><span class="type-signature"></span>setHttpHeaders( [httpHeaders])</h4> </dt> <dd> <div class="description"> Sets the http headers. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>httpHeaders</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="attributes"> <optional><br> <nullable><br> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="RequestScreen.html#setHttpHeaders">RequestScreen#setHttpHeaders</a> </li> </ul> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="setHttpMethod"><span class="type-signature"></span>setHttpMethod(httpMethod)</h4> </dt> <dd> <div class="description"> Sets the http method. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>httpMethod</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="RequestScreen.html#setHttpMethod">RequestScreen#setHttpMethod</a> </li> </ul> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="setId"><span class="type-signature"></span>setId(id)</h4> </dt> <dd> <div class="description"> Sets the screen id. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>id</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Screen.html#setId">Screen#setId</a> </li> </ul> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="setRequest"><span class="type-signature"></span>setRequest(request)</h4> </dt> <dd> <div class="description"> Sets the request object. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>request</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="attributes"> <nullable><br> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="RequestScreen.html#setRequest">RequestScreen#setRequest</a> </li> </ul> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="setTimeout"><span class="type-signature"></span>setTimeout(timeout)</h4> </dt> <dd> <div class="description"> Sets the request timeout in milliseconds. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>timeout</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="RequestScreen.html#setTimeout">RequestScreen#setTimeout</a> </li> </ul> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="setTitle"><span class="type-signature"></span>setTitle( [title])</h4> </dt> <dd> <div class="description"> Sets the screen title. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>title</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> <optional><br> <nullable><br> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Screen.html#setTitle">Screen#setTitle</a> </li> </ul> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="setTitleSelector"><span class="type-signature"></span>setTitleSelector(titleSelector)</h4> </dt> <dd> <div class="description"> Sets the title selector. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>titleSelector</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> </dd> <hr> <dt> <h4 class="name" id="toString"><span class="type-signature"></span>toString()</h4> </dt> <dd> <dl class="details"> <dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="Screen.html#toString">Screen#toString</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id="virtualQuerySelectorAll_"><span class="type-signature"></span>virtualQuerySelectorAll_(selector)</h4> </dt> <dd> <div class="description"> Queries elements from virtual document and returns an array of elements. </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>selector</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">array.<Element></span> </dd> </dl> </dd> </dl> </article> </section> </div> </div> <div class="clearfix"></div> <div class="col-md-3"> <div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div> </div> </div> </div> <div class="modal fade" id="searchResults"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title">Search results</h4> </div> <div class="modal-body"></div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div> <footer> <span class="jsdoc-message"> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on 2016-07-28T11:16:23-07:00 using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>. </span> </footer> <script src="scripts/docstrap.lib.js"></script> <script src="scripts/toc.js"></script> <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script> <script> $( function () { $( "[id*='$']" ).each( function () { var $this = $( this ); $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) ); } ); $( ".tutorial-section pre, .readme-section pre" ).each( function () { var $this = $( this ); var example = $this.find( "code" ); exampleText = example.html(); var lang = /{@lang (.*?)}/.exec( exampleText ); if ( lang && lang[1] ) { exampleText = exampleText.replace( lang[0], "" ); example.html( exampleText ); lang = lang[1]; } else { var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/); lang = langClassMatch ? langClassMatch[1] : "javascript"; } if ( lang ) { $this .addClass( "sunlight-highlight-" + lang ) .addClass( "linenums" ) .html( example.html() ); } } ); Sunlight.highlightAll( { lineNumbers : false, showMenu : true, enableDoclinks : true } ); $.catchAnchorLinks( { navbarOffset: 10 } ); $( "#toc" ).toc( { anchorName : function ( i, heading, prefix ) { var id = $( heading ).attr( "id" ); return id && id.replace(/\~/g, '-inner-').replace(/\./g, '-static-') || ( prefix + i ); }, selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4", showAndHide : false, smoothScrolling: true } ); $( "#main span[id^='toc']" ).addClass( "toc-shim" ); $( '.dropdown-toggle' ).dropdown(); $( "table" ).each( function () { var $this = $( this ); $this.addClass('table'); } ); } ); </script> <!--Navigation and Symbol Display--> <!--Google Analytics--> <script type="text/javascript"> $(document).ready(function() { SearcherDisplay.init(); }); </script> </body> </html>