~michael.nelson/ubuntu-webcatalog/1267731-import-sca-apps-error

« back to all changes in this revision

Viewing changes to src/webcatalog/static/yui/3.10.3/build/pjax-base/pjax-base-coverage.js

  • Committer: Tarmac
  • Author(s): Stephen Stewart
  • Date: 2013-06-26 09:19:32 UTC
  • mfrom: (184.1.4 ubuntu-global-nav)
  • Revision ID: tarmac-20130626091932-8urtuli368k8p7ds
[r=beuno,jonas-drange] add ubuntu global nav to apps.ubuntu.com

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
YUI 3.10.3 (build 2fb5187)
 
3
Copyright 2013 Yahoo! Inc. All rights reserved.
 
4
Licensed under the BSD License.
 
5
http://yuilibrary.com/license/
 
6
*/
 
7
 
 
8
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
 
9
if (!__coverage__['build/pjax-base/pjax-base.js']) {
 
10
   __coverage__['build/pjax-base/pjax-base.js'] = {"path":"build/pjax-base/pjax-base.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0],"28":[0,0],"29":[0,0,0],"30":[0,0],"31":[0,0],"32":[0,0],"33":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":40}}},"2":{"name":"PjaxBase","line":66,"loc":{"start":{"line":66,"column":0},"end":{"line":66,"column":20}}},"3":{"name":"(anonymous_3)","line":97,"loc":{"start":{"line":97,"column":17},"end":{"line":97,"column":29}}},"4":{"name":"(anonymous_4)","line":108,"loc":{"start":{"line":108,"column":16},"end":{"line":108,"column":28}}},"5":{"name":"(anonymous_5)","line":146,"loc":{"start":{"line":146,"column":14},"end":{"line":146,"column":38}}},"6":{"name":"(anonymous_6)","line":178,"loc":{"start":{"line":178,"column":23},"end":{"line":178,"column":39}}},"7":{"name":"(anonymous_7)","line":230,"loc":{"start":{"line":230,"column":15},"end":{"line":230,"column":39}}},"8":{"name":"(anonymous_8)","line":245,"loc":{"start":{"line":245,"column":44},"end":{"line":245,"column":63}}},"9":{"name":"(anonymous_9)","line":292,"loc":{"start":{"line":292,"column":17},"end":{"line":292,"column":29}}},"10":{"name":"(anonymous_10)","line":313,"loc":{"start":{"line":313,"column":20},"end":{"line":313,"column":33}}},"11":{"name":"(anonymous_11)","line":321,"loc":{"start":{"line":321,"column":23},"end":{"line":321,"column":35}}},"12":{"name":"(anonymous_12)","line":345,"loc":{"start":{"line":345,"column":18},"end":{"line":345,"column":31}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":439,"column":82}},"2":{"start":{"line":12,"column":0},"end":{"line":43,"column":30}},"3":{"start":{"line":66,"column":0},"end":{"line":66,"column":22}},"4":{"start":{"line":68,"column":0},"end":{"line":379,"column":2}},"5":{"start":{"line":98,"column":8},"end":{"line":98,"column":69}},"6":{"start":{"line":103,"column":8},"end":{"line":105,"column":9}},"7":{"start":{"line":104,"column":12},"end":{"line":104,"column":31}},"8":{"start":{"line":109,"column":8},"end":{"line":111,"column":9}},"9":{"start":{"line":110,"column":12},"end":{"line":110,"column":38}},"10":{"start":{"line":148,"column":8},"end":{"line":148,"column":36}},"11":{"start":{"line":150,"column":8},"end":{"line":152,"column":9}},"12":{"start":{"line":151,"column":12},"end":{"line":151,"column":24}},"13":{"start":{"line":154,"column":8},"end":{"line":156,"column":9}},"14":{"start":{"line":155,"column":12},"end":{"line":155,"column":98}},"15":{"start":{"line":158,"column":8},"end":{"line":158,"column":21}},"16":{"start":{"line":179,"column":8},"end":{"line":183,"column":21}},"17":{"start":{"line":187,"column":8},"end":{"line":191,"column":9}},"18":{"start":{"line":190,"column":12},"end":{"line":190,"column":25}},"19":{"start":{"line":193,"column":8},"end":{"line":193,"column":58}},"20":{"start":{"line":199,"column":8},"end":{"line":205,"column":9}},"21":{"start":{"line":200,"column":12},"end":{"line":200,"column":40}},"22":{"start":{"line":201,"column":12},"end":{"line":201,"column":40}},"23":{"start":{"line":202,"column":15},"end":{"line":205,"column":9}},"24":{"start":{"line":203,"column":12},"end":{"line":203,"column":41}},"25":{"start":{"line":204,"column":12},"end":{"line":204,"column":41}},"26":{"start":{"line":209,"column":8},"end":{"line":209,"column":33}},"27":{"start":{"line":231,"column":8},"end":{"line":231,"column":36}},"28":{"start":{"line":234,"column":8},"end":{"line":236,"column":9}},"29":{"start":{"line":235,"column":12},"end":{"line":235,"column":25}},"30":{"start":{"line":239,"column":8},"end":{"line":239,"column":47}},"31":{"start":{"line":241,"column":8},"end":{"line":242,"column":30}},"32":{"start":{"line":245,"column":8},"end":{"line":248,"column":11}},"33":{"start":{"line":246,"column":12},"end":{"line":246,"column":21}},"34":{"start":{"line":247,"column":12},"end":{"line":247,"column":34}},"35":{"start":{"line":250,"column":8},"end":{"line":258,"column":9}},"36":{"start":{"line":253,"column":12},"end":{"line":255,"column":13}},"37":{"start":{"line":254,"column":16},"end":{"line":254,"column":29}},"38":{"start":{"line":257,"column":12},"end":{"line":257,"column":32}},"39":{"start":{"line":262,"column":8},"end":{"line":262,"column":71}},"40":{"start":{"line":268,"column":8},"end":{"line":276,"column":9}},"41":{"start":{"line":269,"column":12},"end":{"line":269,"column":45}},"42":{"start":{"line":270,"column":15},"end":{"line":276,"column":9}},"43":{"start":{"line":271,"column":12},"end":{"line":275,"column":13}},"44":{"start":{"line":272,"column":16},"end":{"line":272,"column":42}},"45":{"start":{"line":274,"column":16},"end":{"line":274,"column":35}},"46":{"start":{"line":278,"column":8},"end":{"line":278,"column":20}},"47":{"start":{"line":294,"column":8},"end":{"line":297,"column":9}},"48":{"start":{"line":295,"column":12},"end":{"line":296,"column":67}},"49":{"start":{"line":314,"column":8},"end":{"line":314,"column":52}},"50":{"start":{"line":316,"column":8},"end":{"line":324,"column":9}},"51":{"start":{"line":321,"column":12},"end":{"line":323,"column":18}},"52":{"start":{"line":322,"column":16},"end":{"line":322,"column":33}},"53":{"start":{"line":346,"column":8},"end":{"line":346,"column":33}},"54":{"start":{"line":350,"column":8},"end":{"line":350,"column":65}},"55":{"start":{"line":350,"column":56},"end":{"line":350,"column":63}},"56":{"start":{"line":352,"column":8},"end":{"line":352,"column":31}},"57":{"start":{"line":356,"column":8},"end":{"line":358,"column":9}},"58":{"start":{"line":357,"column":12},"end":{"line":357,"column":19}},"59":{"start":{"line":362,"column":8},"end":{"line":364,"column":9}},"60":{"start":{"line":363,"column":12},"end":{"line":363,"column":19}},"61":{"start":{"line":367,"column":8},"end":{"line":367,"column":31}},"62":{"start":{"line":371,"column":8},"end":{"line":377,"column":9}},"63":{"start":{"line":372,"column":12},"end":{"line":372,"column":62}},"64":{"start":{"line":374,"column":12},"end":{"line":376,"column":13}},"65":{"start":{"line":375,"column":16},"end":{"line":375,"column":35}},"66":{"start":{"line":381,"column":0},"end":{"line":434,"column":2}},"67":{"start":{"line":436,"column":0},"end":{"line":436,"column":22}}},"branchMap":{"1":{"line":103,"type":"if","locations":[{"start":{"line":103,"column":8},"end":{"line":103,"column":8}},{"start":{"line":103,"column":8},"end":{"line":103,"column":8}}]},"2":{"line":109,"type":"if","locations":[{"start":{"line":109,"column":8},"end":{"line":109,"column":8}},{"start":{"line":109,"column":8},"end":{"line":109,"column":8}}]},"3":{"line":150,"type":"if","locations":[{"start":{"line":150,"column":8},"end":{"line":150,"column":8}},{"start":{"line":150,"column":8},"end":{"line":150,"column":8}}]},"4":{"line":154,"type":"if","locations":[{"start":{"line":154,"column":8},"end":{"line":154,"column":8}},{"start":{"line":154,"column":8},"end":{"line":154,"column":8}}]},"5":{"line":182,"type":"binary-expr","locations":[{"start":{"line":182,"column":23},"end":{"line":182,"column":50}},{"start":{"line":182,"column":54},"end":{"line":182,"column":58}}]},"6":{"line":187,"type":"if","locations":[{"start":{"line":187,"column":8},"end":{"line":187,"column":8}},{"start":{"line":187,"column":8},"end":{"line":187,"column":8}}]},"7":{"line":187,"type":"binary-expr","locations":[{"start":{"line":187,"column":12},"end":{"line":187,"column":45}},{"start":{"line":188,"column":16},"end":{"line":188,"column":49}}]},"8":{"line":193,"type":"binary-expr","locations":[{"start":{"line":193,"column":19},"end":{"line":193,"column":49}},{"start":{"line":193,"column":53},"end":{"line":193,"column":57}}]},"9":{"line":199,"type":"if","locations":[{"start":{"line":199,"column":8},"end":{"line":199,"column":8}},{"start":{"line":199,"column":8},"end":{"line":199,"column":8}}]},"10":{"line":200,"type":"binary-expr","locations":[{"start":{"line":200,"column":12},"end":{"line":200,"column":16}},{"start":{"line":200,"column":25},"end":{"line":200,"column":38}}]},"11":{"line":201,"type":"binary-expr","locations":[{"start":{"line":201,"column":12},"end":{"line":201,"column":20}},{"start":{"line":201,"column":25},"end":{"line":201,"column":38}}]},"12":{"line":202,"type":"if","locations":[{"start":{"line":202,"column":15},"end":{"line":202,"column":15}},{"start":{"line":202,"column":15},"end":{"line":202,"column":15}}]},"13":{"line":203,"type":"binary-expr","locations":[{"start":{"line":203,"column":12},"end":{"line":203,"column":16}},{"start":{"line":203,"column":25},"end":{"line":203,"column":39}}]},"14":{"line":204,"type":"binary-expr","locations":[{"start":{"line":204,"column":12},"end":{"line":204,"column":20}},{"start":{"line":204,"column":25},"end":{"line":204,"column":39}}]},"15":{"line":234,"type":"if","locations":[{"start":{"line":234,"column":8},"end":{"line":234,"column":8}},{"start":{"line":234,"column":8},"end":{"line":234,"column":8}}]},"16":{"line":250,"type":"if","locations":[{"start":{"line":250,"column":8},"end":{"line":250,"column":8}},{"start":{"line":250,"column":8},"end":{"line":250,"column":8}}]},"17":{"line":250,"type":"binary-expr","locations":[{"start":{"line":250,"column":12},"end":{"line":250,"column":16}},{"start":{"line":250,"column":20},"end":{"line":250,"column":66}}]},"18":{"line":253,"type":"if","locations":[{"start":{"line":253,"column":12},"end":{"line":253,"column":12}},{"start":{"line":253,"column":12},"end":{"line":253,"column":12}}]},"19":{"line":262,"type":"binary-expr","locations":[{"start":{"line":262,"column":8},"end":{"line":262,"column":28}},{"start":{"line":262,"column":33},"end":{"line":262,"column":69}}]},"20":{"line":268,"type":"if","locations":[{"start":{"line":268,"column":8},"end":{"line":268,"column":8}},{"start":{"line":268,"column":8},"end":{"line":268,"column":8}}]},"21":{"line":268,"type":"binary-expr","locations":[{"start":{"line":268,"column":12},"end":{"line":268,"column":29}},{"start":{"line":268,"column":33},"end":{"line":268,"column":46}}]},"22":{"line":270,"type":"if","locations":[{"start":{"line":270,"column":15},"end":{"line":270,"column":15}},{"start":{"line":270,"column":15},"end":{"line":270,"column":15}}]},"23":{"line":271,"type":"if","locations":[{"start":{"line":271,"column":12},"end":{"line":271,"column":12}},{"start":{"line":271,"column":12},"end":{"line":271,"column":12}}]},"24":{"line":294,"type":"if","locations":[{"start":{"line":294,"column":8},"end":{"line":294,"column":8}},{"start":{"line":294,"column":8},"end":{"line":294,"column":8}}]},"25":{"line":314,"type":"cond-expr","locations":[{"start":{"line":314,"column":25},"end":{"line":314,"column":34}},{"start":{"line":314,"column":37},"end":{"line":314,"column":43}}]},"26":{"line":316,"type":"if","locations":[{"start":{"line":316,"column":8},"end":{"line":316,"column":8}},{"start":{"line":316,"column":8},"end":{"line":316,"column":8}}]},"27":{"line":316,"type":"binary-expr","locations":[{"start":{"line":316,"column":12},"end":{"line":316,"column":15}},{"start":{"line":316,"column":19},"end":{"line":316,"column":42}}]},"28":{"line":350,"type":"if","locations":[{"start":{"line":350,"column":8},"end":{"line":350,"column":8}},{"start":{"line":350,"column":8},"end":{"line":350,"column":8}}]},"29":{"line":350,"type":"binary-expr","locations":[{"start":{"line":350,"column":12},"end":{"line":350,"column":26}},{"start":{"line":350,"column":30},"end":{"line":350,"column":39}},{"start":{"line":350,"column":43},"end":{"line":350,"column":52}}]},"30":{"line":356,"type":"if","locations":[{"start":{"line":356,"column":8},"end":{"line":356,"column":8}},{"start":{"line":356,"column":8},"end":{"line":356,"column":8}}]},"31":{"line":362,"type":"if","locations":[{"start":{"line":362,"column":8},"end":{"line":362,"column":8}},{"start":{"line":362,"column":8},"end":{"line":362,"column":8}}]},"32":{"line":371,"type":"if","locations":[{"start":{"line":371,"column":8},"end":{"line":371,"column":8}},{"start":{"line":371,"column":8},"end":{"line":371,"column":8}}]},"33":{"line":374,"type":"if","locations":[{"start":{"line":374,"column":12},"end":{"line":374,"column":12}},{"start":{"line":374,"column":12},"end":{"line":374,"column":12}}]}},"code":["(function () { YUI.add('pjax-base', function (Y, NAME) {","","/**","`Y.Router` extension that provides the core plumbing for enhanced navigation","implemented using the pjax technique (HTML5 pushState + Ajax).","","@module pjax","@submodule pjax-base","@since 3.5.0","**/","","var win = Y.config.win,","","    // The CSS class name used to filter link clicks from only the links which","    // the pjax enhanced navigation should be used.","    CLASS_PJAX = Y.ClassNameManager.getClassName('pjax'),","","    /**","    Fired when navigating to a URL via Pjax.","","    When the `navigate()` method is called or a pjax link is clicked, this event","    will be fired if the browser supports HTML5 history _and_ the router has a","    route handler for the specified URL.","","    This is a useful event to listen to for adding a visual loading indicator","    while the route handlers are busy handling the URL change.","","    @event navigate","    @param {String} url The URL that the router will dispatch to its route","      handlers in order to fulfill the enhanced navigation \"request\".","    @param {Boolean} [force=false] Whether the enhanced navigation should occur","      even in browsers without HTML5 history.","    @param {String} [hash] The hash-fragment (including \"#\") of the `url`. This","      will be present when the `url` differs from the current URL only by its","      hash and `navigateOnHash` has been set to `true`.","    @param {Event} [originEvent] The event that caused the navigation. Usually","      this would be a click event from a \"pjax\" anchor element.","    @param {Boolean} [replace] Whether or not the current history entry will be","      replaced, or a new entry will be created. Will default to `true` if the","      specified `url` is the same as the current URL.","    @since 3.5.0","    **/","    EVT_NAVIGATE = 'navigate';","","/**","`Y.Router` extension that provides the core plumbing for enhanced navigation","implemented using the pjax technique (HTML5 `pushState` + Ajax).","","This makes it easy to enhance the navigation between the URLs of an application","in HTML5 history capable browsers by delegating to the router to fulfill the","\"request\" and seamlessly falling-back to using standard full-page reloads in","older, less-capable browsers.","","The `PjaxBase` class isn't useful on its own, but can be mixed into a","`Router`-based class to add Pjax functionality to that Router. For a pre-made","standalone Pjax router, see the `Pjax` class.","","    var MyRouter = Y.Base.create('myRouter', Y.Router, [Y.PjaxBase], {","        // ...","    });","","@class PjaxBase","@extensionfor Router","@since 3.5.0","**/","function PjaxBase() {}","","PjaxBase.prototype = {","    // -- Protected Properties -------------------------------------------------","","    /**","    Holds the delegated pjax-link click handler.","","    @property _pjaxEvents","    @type EventHandle","    @protected","    @since 3.5.0","    **/","","    /**","    Regex used to break up a URL string around the URL's path.","","    Subpattern captures:","","      1. Origin, everything before the URL's path-part.","      2. The URL's path-part.","      3. Suffix, everything after the URL's path-part.","","    @property _regexURL","    @type RegExp","    @protected","    @since 3.5.0","    **/","    _regexURL: /^((?:[^\\/#?:]+:\\/\\/|\\/\\/)[^\\/]*)?([^?#]*)(\\?[^#]*)?(#.*)?$/,","","    // -- Lifecycle Methods ----------------------------------------------------","    initializer: function () {","        this.publish(EVT_NAVIGATE, {defaultFn: this._defNavigateFn});","","        // Pjax is all about progressively enhancing the navigation between","        // \"pages\", so by default we only want to handle and route link clicks","        // in HTML5 `pushState`-compatible browsers.","        if (this.get('html5')) {","            this._pjaxBindUI();","        }","    },","","    destructor: function () {","        if (this._pjaxEvents) {","            this._pjaxEvents.detach();","        }","    },","","    // -- Public Methods -------------------------------------------------------","","    /**","    Navigates to the specified URL if there is a route handler that matches. In","    browsers capable of using HTML5 history, the navigation will be enhanced by","    firing the `navigate` event and having the router handle the \"request\".","    Non-HTML5 browsers will navigate to the new URL via manipulation of","    `window.location`.","","    When there is a route handler for the specified URL and it is being","    navigated to, this method will return `true`, otherwise it will return","    `false`.","","    **Note:** The specified URL _must_ be of the same origin as the current URL,","    otherwise an error will be logged and navigation will not occur. This is","    intended as both a security constraint and a purposely imposed limitation as","    it does not make sense to tell the router to navigate to a URL on a","    different scheme, host, or port.","","    @method navigate","    @param {String} url The URL to navigate to. This must be of the same origin","      as the current URL.","    @param {Object} [options] Additional options to configure the navigation.","      These are mixed into the `navigate` event facade.","        @param {Boolean} [options.replace] Whether or not the current history","          entry will be replaced, or a new entry will be created. Will default","          to `true` if the specified `url` is the same as the current URL.","        @param {Boolean} [options.force=false] Whether the enhanced navigation","          should occur even in browsers without HTML5 history.","    @return {Boolean} `true` if the URL was navigated to, `false` otherwise.","    @since 3.5.0","    **/","    navigate: function (url, options) {","        // The `_navigate()` method expects fully-resolved URLs.","        url = this._resolveURL(url);","","        if (this._navigate(url, options)) {","            return true;","        }","","        if (!this._hasSameOrigin(url)) {","            Y.error('Security error: The new URL must be of the same origin as the current URL.');","        }","","        return false;","    },","","    // -- Protected Methods ----------------------------------------------------","","    /**","    Utility method to test whether a specified link/anchor node's `href` is of","    the same origin as the page's current location.","","    This normalize browser inconsistencies with how the `port` is reported for","    anchor elements (IE reports a value for the default port, e.g. \"80\").","","    @method _isLinkSameOrigin","    @param {Node} link The anchor element to test whether its `href` is of the","        same origin as the page's current location.","    @return {Boolean} Whether or not the link's `href` is of the same origin as","        the page's current location.","    @protected","    @since 3.6.0","    **/","    _isLinkSameOrigin: function (link) {","        var location = Y.getLocation(),","            protocol = location.protocol,","            hostname = location.hostname,","            port     = parseInt(location.port, 10) || null,","            linkPort;","","        // Link must have the same `protocol` and `hostname` as the page's","        // currrent location.","        if (link.get('protocol') !== protocol ||","                link.get('hostname') !== hostname) {","","            return false;","        }","","        linkPort = parseInt(link.get('port'), 10) || null;","","        // Normalize ports. In most cases browsers use an empty string when the","        // port is the default port, but IE does weird things with anchor","        // elements, so to be sure, this will re-assign the default ports before","        // they are compared.","        if (protocol === 'http:') {","            port     || (port     = 80);","            linkPort || (linkPort = 80);","        } else if (protocol === 'https:') {","            port     || (port     = 443);","            linkPort || (linkPort = 443);","        }","","        // Finally, to be from the same origin, the link's `port` must match the","        // page's current `port`.","        return linkPort === port;","    },","","    /**","    Underlying implementation for `navigate()`.","","    @method _navigate","    @param {String} url The fully-resolved URL that the router should dispatch","      to its route handlers to fulfill the enhanced navigation \"request\", or use","      to update `window.location` in non-HTML5 history capable browsers.","    @param {Object} [options] Additional options to configure the navigation.","      These are mixed into the `navigate` event facade.","        @param {Boolean} [options.replace] Whether or not the current history","          entry will be replaced, or a new entry will be created. Will default","          to `true` if the specified `url` is the same as the current URL.","        @param {Boolean} [options.force=false] Whether the enhanced navigation","          should occur even in browsers without HTML5 history.","    @return {Boolean} `true` if the URL was navigated to, `false` otherwise.","    @protected","    @since 3.5.0","    **/","    _navigate: function (url, options) {","        url = this._upgradeURL(url);","","        // Navigation can only be enhanced if there is a route-handler.","        if (!this.hasRoute(url)) {","            return false;","        }","","        // Make a copy of `options` before modifying it.","        options = Y.merge(options, {url: url});","","        var currentURL = this._getURL(),","            hash, hashlessURL;","","        // Captures the `url`'s hash and returns a URL without that hash.","        hashlessURL = url.replace(/(#.*)$/, function (u, h, i) {","            hash = h;","            return u.substring(i);","        });","","        if (hash && hashlessURL === currentURL.replace(/#.*$/, '')) {","            // When the specified `url` and current URL only differ by the hash,","            // the browser should handle this in-page navigation normally.","            if (!this.get('navigateOnHash')) {","                return false;","            }","","            options.hash = hash;","        }","","        // When navigating to the same URL as the current URL, behave like a","        // browser and replace the history entry instead of creating a new one.","        'replace' in options || (options.replace = url === currentURL);","","        // The `navigate` event will only fire and therefore enhance the","        // navigation to the new URL in HTML5 history enabled browsers or when","        // forced. Otherwise it will fallback to assigning or replacing the URL","        // on `window.location`.","        if (this.get('html5') || options.force) {","            this.fire(EVT_NAVIGATE, options);","        } else if (win) {","            if (options.replace) {","                win.location.replace(url);","            } else {","                win.location = url;","            }","        }","","        return true;","    },","","    /**","    Binds the delegation of link-click events that match the `linkSelector` to","    the `_onLinkClick()` handler.","","    By default this method will only be called if the browser is capable of","    using HTML5 history.","","    @method _pjaxBindUI","    @protected","    @since 3.5.0","    **/","    _pjaxBindUI: function () {","        // Only bind link if we haven't already.","        if (!this._pjaxEvents) {","            this._pjaxEvents = Y.one('body').delegate('click',","                this._onLinkClick, this.get('linkSelector'), this);","        }","    },","","    // -- Protected Event Handlers ---------------------------------------------","","    /**","    Default handler for the `navigate` event.","","    Adds a new history entry or replaces the current entry for the specified URL","    and will scroll the page to the top if configured to do so.","","    @method _defNavigateFn","    @param {EventFacade} e","    @protected","    @since 3.5.0","    **/","    _defNavigateFn: function (e) {","        this[e.replace ? 'replace' : 'save'](e.url);","","        if (win && this.get('scrollToTop')) {","            // Scroll to the top of the page. The timeout ensures that the","            // scroll happens after navigation begins, so that the current","            // scroll position will be restored if the user clicks the back","            // button.","            setTimeout(function () {","                win.scroll(0, 0);","            }, 1);","        }","    },","","    /**","    Handler for delegated link-click events which match the `linkSelector`.","","    This will attempt to enhance the navigation to the link element's `href` by","    passing the URL to the `_navigate()` method. When the navigation is being","    enhanced, the default action is prevented.","","    If the user clicks a link with the middle/right mouse buttons, or is holding","    down the Ctrl or Command keys, this method's behavior is not applied and","    allows the native behavior to occur. Similarly, if the router is not capable","    or handling the URL because no route-handlers match, the link click will","    behave natively.","","    @method _onLinkClick","    @param {EventFacade} e","    @protected","    @since 3.5.0","    **/","    _onLinkClick: function (e) {","        var link, url, navigated;","","        // Allow the native behavior on middle/right-click, or when Ctrl or","        // Command are pressed.","        if (e.button !== 1 || e.ctrlKey || e.metaKey) { return; }","","        link = e.currentTarget;","","        // Only allow anchor elements because we need access to its `protocol`,","        // `host`, and `href` attributes.","        if (link.get('tagName').toUpperCase() !== 'A') {","            return;","        }","","        // Same origin check to prevent trying to navigate to URLs from other","        // sites or things like mailto links.","        if (!this._isLinkSameOrigin(link)) {","            return;","        }","","        // All browsers fully resolve an anchor's `href` property.","        url = link.get('href');","","        // Try and navigate to the URL via the router, and prevent the default","        // link-click action if we do.","        if (url) {","            navigated = this._navigate(url, {originEvent: e});","","            if (navigated) {","                e.preventDefault();","            }","        }","    }","};","","PjaxBase.ATTRS = {","    /**","    CSS selector string used to filter link click events so that only the links","    which match it will have the enhanced navigation behavior of Pjax applied.","","    When a link is clicked and that link matches this selector, Pjax will","    attempt to dispatch to any route handlers matching the link's `href` URL. If","    HTML5 history is not supported or if no route handlers match, the link click","    will be handled by the browser just like any old link.","","    @attribute linkSelector","    @type String|Function","    @default \"a.yui3-pjax\"","    @initOnly","    @since 3.5.0","    **/","    linkSelector: {","        value    : 'a.' + CLASS_PJAX,","        writeOnce: 'initOnly'","    },","","    /**","    Whether navigating to a hash-fragment identifier on the current page should","    be enhanced and cause the `navigate` event to fire.","","    By default Pjax allows the browser to perform its default action when a user","    is navigating within a page by clicking in-page links","    (e.g. `<a href=\"#top\">Top of page</a>`) and does not attempt to interfere or","    enhance in-page navigation.","","    @attribute navigateOnHash","    @type Boolean","    @default false","    @since 3.5.0","    **/","    navigateOnHash: {","        value: false","    },","","    /**","    Whether the page should be scrolled to the top after navigating to a URL.","","    When the user clicks the browser's back button, the previous scroll position","    will be maintained.","","    @attribute scrollToTop","    @type Boolean","    @default true","    @since 3.5.0","    **/","    scrollToTop: {","        value: true","    }","};","","Y.PjaxBase = PjaxBase;","","","}, '3.10.3', {\"requires\": [\"classnamemanager\", \"node-event-delegate\", \"router\"]});","","}());"]};
 
11
}
 
12
var __cov_G5qgBIkQ4iB0lsIK_8nfFg = __coverage__['build/pjax-base/pjax-base.js'];
 
13
__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['1']++;YUI.add('pjax-base',function(Y,NAME){__cov_G5qgBIkQ4iB0lsIK_8nfFg.f['1']++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['2']++;var win=Y.config.win,CLASS_PJAX=Y.ClassNameManager.getClassName('pjax'),EVT_NAVIGATE='navigate';__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['3']++;function PjaxBase(){__cov_G5qgBIkQ4iB0lsIK_8nfFg.f['2']++;}__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['4']++;PjaxBase.prototype={_regexURL:/^((?:[^\/#?:]+:\/\/|\/\/)[^\/]*)?([^?#]*)(\?[^#]*)?(#.*)?$/,initializer:function(){__cov_G5qgBIkQ4iB0lsIK_8nfFg.f['3']++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['5']++;this.publish(EVT_NAVIGATE,{defaultFn:this._defNavigateFn});__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['6']++;if(this.get('html5')){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['1'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['7']++;this._pjaxBindUI();}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['1'][1]++;}},destructor:function(){__cov_G5qgBIkQ4iB0lsIK_8nfFg.f['4']++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['8']++;if(this._pjaxEvents){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['2'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['9']++;this._pjaxEvents.detach();}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['2'][1]++;}},navigate:function(url,options){__cov_G5qgBIkQ4iB0lsIK_8nfFg.f['5']++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['10']++;url=this._resolveURL(url);__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['11']++;if(this._navigate(url,options)){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['3'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['12']++;return true;}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['3'][1]++;}__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['13']++;if(!this._hasSameOrigin(url)){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['4'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['14']++;Y.error('Security error: The new URL must be of the same origin as the current URL.');}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['4'][1]++;}__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['15']++;return false;},_isLinkSameOrigin:function(link){__cov_G5qgBIkQ4iB0lsIK_8nfFg.f['6']++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['16']++;var location=Y.getLocation(),protocol=location.protocol,hostname=location.hostname,port=(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['5'][0]++,parseInt(location.port,10))||(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['5'][1]++,null),linkPort;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['17']++;if((__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['7'][0]++,link.get('protocol')!==protocol)||(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['7'][1]++,link.get('hostname')!==hostname)){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['6'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['18']++;return false;}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['6'][1]++;}__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['19']++;linkPort=(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['8'][0]++,parseInt(link.get('port'),10))||(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['8'][1]++,null);__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['20']++;if(protocol==='http:'){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['9'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['21']++;(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['10'][0]++,port)||(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['10'][1]++,port=80);__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['22']++;(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['11'][0]++,linkPort)||(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['11'][1]++,linkPort=80);}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['9'][1]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['23']++;if(protocol==='https:'){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['12'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['24']++;(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['13'][0]++,port)||(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['13'][1]++,port=443);__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['25']++;(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['14'][0]++,linkPort)||(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['14'][1]++,linkPort=443);}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['12'][1]++;}}__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['26']++;return linkPort===port;},_navigate:function(url,options){__cov_G5qgBIkQ4iB0lsIK_8nfFg.f['7']++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['27']++;url=this._upgradeURL(url);__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['28']++;if(!this.hasRoute(url)){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['15'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['29']++;return false;}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['15'][1]++;}__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['30']++;options=Y.merge(options,{url:url});__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['31']++;var currentURL=this._getURL(),hash,hashlessURL;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['32']++;hashlessURL=url.replace(/(#.*)$/,function(u,h,i){__cov_G5qgBIkQ4iB0lsIK_8nfFg.f['8']++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['33']++;hash=h;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['34']++;return u.substring(i);});__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['35']++;if((__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['17'][0]++,hash)&&(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['17'][1]++,hashlessURL===currentURL.replace(/#.*$/,''))){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['16'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['36']++;if(!this.get('navigateOnHash')){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['18'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['37']++;return false;}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['18'][1]++;}__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['38']++;options.hash=hash;}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['16'][1]++;}__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['39']++;(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['19'][0]++,'replace'in options)||(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['19'][1]++,options.replace=url===currentURL);__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['40']++;if((__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['21'][0]++,this.get('html5'))||(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['21'][1]++,options.force)){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['20'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['41']++;this.fire(EVT_NAVIGATE,options);}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['20'][1]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['42']++;if(win){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['22'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['43']++;if(options.replace){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['23'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['44']++;win.location.replace(url);}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['23'][1]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['45']++;win.location=url;}}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['22'][1]++;}}__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['46']++;return true;},_pjaxBindUI:function(){__cov_G5qgBIkQ4iB0lsIK_8nfFg.f['9']++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['47']++;if(!this._pjaxEvents){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['24'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['48']++;this._pjaxEvents=Y.one('body').delegate('click',this._onLinkClick,this.get('linkSelector'),this);}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['24'][1]++;}},_defNavigateFn:function(e){__cov_G5qgBIkQ4iB0lsIK_8nfFg.f['10']++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['49']++;this[e.replace?(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['25'][0]++,'replace'):(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['25'][1]++,'save')](e.url);__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['50']++;if((__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['27'][0]++,win)&&(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['27'][1]++,this.get('scrollToTop'))){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['26'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['51']++;setTimeout(function(){__cov_G5qgBIkQ4iB0lsIK_8nfFg.f['11']++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['52']++;win.scroll(0,0);},1);}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['26'][1]++;}},_onLinkClick:function(e){__cov_G5qgBIkQ4iB0lsIK_8nfFg.f['12']++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['53']++;var link,url,navigated;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['54']++;if((__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['29'][0]++,e.button!==1)||(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['29'][1]++,e.ctrlKey)||(__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['29'][2]++,e.metaKey)){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['28'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['55']++;return;}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['28'][1]++;}__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['56']++;link=e.currentTarget;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['57']++;if(link.get('tagName').toUpperCase()!=='A'){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['30'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['58']++;return;}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['30'][1]++;}__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['59']++;if(!this._isLinkSameOrigin(link)){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['31'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['60']++;return;}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['31'][1]++;}__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['61']++;url=link.get('href');__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['62']++;if(url){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['32'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['63']++;navigated=this._navigate(url,{originEvent:e});__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['64']++;if(navigated){__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['33'][0]++;__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['65']++;e.preventDefault();}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['33'][1]++;}}else{__cov_G5qgBIkQ4iB0lsIK_8nfFg.b['32'][1]++;}}};__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['66']++;PjaxBase.ATTRS={linkSelector:{value:'a.'+CLASS_PJAX,writeOnce:'initOnly'},navigateOnHash:{value:false},scrollToTop:{value:true}};__cov_G5qgBIkQ4iB0lsIK_8nfFg.s['67']++;Y.PjaxBase=PjaxBase;},'3.10.3',{'requires':['classnamemanager','node-event-delegate','router']});