| Index: third_party/polymer/v1_0/components-chromium/carbon-route/carbon-location-extracted.js
|
| diff --git a/third_party/polymer/v1_0/components-chromium/carbon-route/carbon-location-extracted.js b/third_party/polymer/v1_0/components-chromium/carbon-route/carbon-location-extracted.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..881fad1e23096c75b1ebbfbb482a1b5401f9eb62
|
| --- /dev/null
|
| +++ b/third_party/polymer/v1_0/components-chromium/carbon-route/carbon-location-extracted.js
|
| @@ -0,0 +1,93 @@
|
| +'use strict';
|
| +
|
| + Polymer({
|
| + is: 'carbon-location',
|
| +
|
| + properties: {
|
| + /**
|
| + * A model representing the deserialized path through the route tree, as
|
| + * well as the current queryParams.
|
| + */
|
| + route: {
|
| + type: Object,
|
| + notify: true
|
| + },
|
| +
|
| + /**
|
| + * In many scenarios, it is convenient to treat the `hash` as a stand-in
|
| + * alternative to the `path`. For example, if deploying an app to a static
|
| + * web server (e.g., Github Pages) - where one does not have control over
|
| + * server-side routing - it is usually a better experience to use the hash
|
| + * to represent paths through one's app.
|
| + *
|
| + * When this property is set to true, the `hash` will be used in place of
|
| +
|
| + * the `path` for generating a `route`.
|
| + */
|
| + useHashAsPath: {
|
| + type: Boolean,
|
| + value: false
|
| + },
|
| +
|
| + /**
|
| + * A regexp that defines the set of URLs that should be considered part
|
| + * of this web app.
|
| + *
|
| + * Clicking on a link that matches this regex won't result in a full page
|
| + * navigation, but will instead just update the URL state in place.
|
| + *
|
| + * This regexp is given everything after the origin in an absolute
|
| + * URL. So to match just URLs that start with /search/ do:
|
| + * url-space-regex="^/search/"
|
| + *
|
| + * @type {string|RegExp}
|
| + */
|
| + urlSpaceRegex: {
|
| + type: String,
|
| + notify: true
|
| + },
|
| +
|
| + /**
|
| + * A set of key/value pairs that are universally accessible to branches
|
| + * of the route tree.
|
| + */
|
| + __queryParams: {
|
| + type: Object
|
| + },
|
| +
|
| + /**
|
| + * The pathname component of the current URL.
|
| + */
|
| + __path: {
|
| + type: String
|
| + },
|
| +
|
| + /**
|
| + * The query string portion of the current URL.
|
| + */
|
| + __query: {
|
| + type: String
|
| + },
|
| +
|
| + /**
|
| + * The hash portion of the current URL.
|
| + */
|
| + __hash: {
|
| + type: String
|
| + }
|
| + },
|
| +
|
| + __computeRoutePath: function(path, hash, useHashAsPath) {
|
| + return useHashAsPath ? hash : path;
|
| + },
|
| +
|
| + __onPathChanged: function(event) {
|
| + var path = event.detail.value;
|
| +
|
| + if (this.useHashAsPath) {
|
| + this.__hash = path;
|
| + } else {
|
| + this.__path = path;
|
| + }
|
| + }
|
| + });
|
|
|