diff --git a/dashboard-ui/bower_components/iron-location/.bower.json b/dashboard-ui/bower_components/iron-location/.bower.json index cd5269b48c..73dd0ea15b 100644 --- a/dashboard-ui/bower_components/iron-location/.bower.json +++ b/dashboard-ui/bower_components/iron-location/.bower.json @@ -1,6 +1,6 @@ { "name": "iron-location", - "version": "0.8.2", + "version": "0.8.3", "description": "Bidirectional data binding into the page's URL.", "private": true, "authors": [ @@ -37,11 +37,11 @@ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0", "iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.2.3" }, - "_release": "0.8.2", + "_release": "0.8.3", "_resolution": { "type": "version", - "tag": "v0.8.2", - "commit": "9ab0b3bf4b30e00d1f80dcb1cf9e00bd17cce4a5" + "tag": "v0.8.3", + "commit": "cb124aa740c07d2b65af1d7e05a3cf8fd6a25f87" }, "_source": "git://github.com/PolymerElements/iron-location.git", "_target": "^0.8.0", diff --git a/dashboard-ui/bower_components/iron-location/.github/ISSUE_TEMPLATE.md b/dashboard-ui/bower_components/iron-location/.github/ISSUE_TEMPLATE.md index 51794e19ed..e3b4e289b6 100644 --- a/dashboard-ui/bower_components/iron-location/.github/ISSUE_TEMPLATE.md +++ b/dashboard-ui/bower_components/iron-location/.github/ISSUE_TEMPLATE.md @@ -11,7 +11,7 @@ ### Live Demo - + ### Steps to reproduce diff --git a/dashboard-ui/bower_components/iron-location/CONTRIBUTING.md b/dashboard-ui/bower_components/iron-location/CONTRIBUTING.md index 1343c48b70..cfda1a5542 100644 --- a/dashboard-ui/bower_components/iron-location/CONTRIBUTING.md +++ b/dashboard-ui/bower_components/iron-location/CONTRIBUTING.md @@ -1,4 +1,3 @@ - + # Polymer Elements ## Guide for Contributors @@ -46,7 +46,7 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag 3. Click the `paper-foo` element. ``` - 2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [https://jsbin.com/cagaye/edit?html,output](https://jsbin.com/cagaye/edit?html,output). + 2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [https://jsbin.com/lebawa/edit?html,output](https://jsbin.com/lebawa/edit?html,output). 3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers. diff --git a/dashboard-ui/bower_components/iron-location/bower.json b/dashboard-ui/bower_components/iron-location/bower.json index 5b03c54a48..6eb4fbe7e3 100644 --- a/dashboard-ui/bower_components/iron-location/bower.json +++ b/dashboard-ui/bower_components/iron-location/bower.json @@ -1,6 +1,6 @@ { "name": "iron-location", - "version": "0.8.2", + "version": "0.8.3", "description": "Bidirectional data binding into the page's URL.", "private": true, "authors": [ diff --git a/dashboard-ui/bower_components/iron-location/iron-location.html b/dashboard-ui/bower_components/iron-location/iron-location.html index 4835c1b9a7..58a72580af 100644 --- a/dashboard-ui/bower_components/iron-location/iron-location.html +++ b/dashboard-ui/bower_components/iron-location/iron-location.html @@ -243,10 +243,6 @@ milliseconds. * is clicking on, if we can and should override the resulting full * page navigation. Returns null otherwise. * - * This method is separated away from _globalOnClick for testability, - * as we can't test that a clicked link should have resulted in navigating - * away from the test page. - * * @param {MouseEvent} event . * @return {string?} . */ @@ -261,19 +257,33 @@ milliseconds. return null; } var eventPath = Polymer.dom(event).path; - var href = null; + var anchor = null; for (var i = 0; i < eventPath.length; i++) { var element = eventPath[i]; if (element.tagName === 'A' && element.href) { - href = element.href; + anchor = element; break; } } + // If there's no link there's nothing to do. - if (!href) { - return null; + if (!anchor) { + return; } + // Target blank is a new tab, don't intercept. + if (anchor.target === '_blank') { + return; + } + // If the link is for an existing parent frame, don't intercept. + if ((anchor.target === '_top' || + anchor.target === '_parent') && + window.top !== window) { + return; + } + + var href = anchor.href; + // It only makes sense for us to intercept same-origin navigations. // pushState/replaceState don't work with cross-origin links. var url; diff --git a/dashboard-ui/bower_components/iron-location/test/iron-location.html b/dashboard-ui/bower_components/iron-location/test/iron-location.html index 30eaf9af7a..1952ae0bd3 100644 --- a/dashboard-ui/bower_components/iron-location/test/iron-location.html +++ b/dashboard-ui/bower_components/iron-location/test/iron-location.html @@ -61,10 +61,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }); } + function makeAbsoluteUrl(path) { + return window.location.protocol + '//' + window.location.host + path; + } + // A window.history.replaceState wrapper that's smart about baseURI. - function replaceState(url) { - window.history.replaceState( - {}, '', window.location.protocol + '//' + window.location.host + url); + function replaceState(path) { + window.history.replaceState({}, '', makeAbsoluteUrl(path)); } /** @@ -164,6 +167,77 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN assertHaveSameUrls(urlElem, otherUrlElem); }); }); + suite('when intercepting links', function() { + + /** + * Clicks the given link while an iron-location element with the given + * urlSpaceRegex is in the same document. Returns whether the + * iron-location prevented the default behavior of the click. + * + * No matter what, it prevents the default behavior of the click itself + * to ensure that no navigation occurs (as that would interrupt + * running and reporting these tests!) + */ + function isClickCaptured(anchor, urlSpaceRegex) { + var defaultWasPrevented; + function handler(event) { + expect(event.target).to.be.eq(anchor); + defaultWasPrevented = event.defaultPrevented; + event.preventDefault(); + expect(event.defaultPrevented).to.be.eq(true); + } + window.addEventListener('click', handler); + var ironLocation = fixture('Solo'); + if (urlSpaceRegex != null) { + ironLocation.urlSpaceRegex = urlSpaceRegex; + } + document.body.appendChild(anchor); + anchor.click(); + document.body.removeChild(anchor); + window.removeEventListener('click', handler); + return defaultWasPrevented; + } + + test('simple link to / is intercepted', function() { + var anchor = document.createElement('a'); + if (document.baseURI !== window.location.href) { + anchor.href = makeAbsoluteUrl('/'); + } else { + anchor.href = '/'; + } + + expect(isClickCaptured(anchor)).to.be.eq(true); + }); + + test('link that matches url space is intercepted', function() { + var anchor = document.createElement('a'); + anchor.href = makeAbsoluteUrl('/foo'); + + expect(isClickCaptured(anchor, '/fo+')).to.be.eq(true); + }); + + test('link that doesn\'t match url space isn\'t intercepted', function() { + var anchor = document.createElement('a'); + anchor.href = makeAbsoluteUrl('/bar'); + + expect(isClickCaptured(anchor, '/fo+')).to.be.eq(false); + }); + + test('link to another domain isn\'t intercepted', function() { + var anchor = document.createElement('a'); + anchor.href = 'http://example.com/'; + + expect(isClickCaptured(anchor)).to.be.eq(false); + }); + + test('a link with target=_blank isn\'t intercepted', function() { + var anchor = document.createElement('a'); + anchor.href = makeAbsoluteUrl('/'); + anchor.target = '_blank'; + + expect(isClickCaptured(anchor)).to.be.eq(false); + }) + }); suite('supports doing synchronous redirection', function() { test('of the hash portion of the URL', function() { diff --git a/dashboard-ui/bower_components/iron-range-behavior/.bower.json b/dashboard-ui/bower_components/iron-range-behavior/.bower.json index cb6b1b33f4..76d8b27a18 100644 --- a/dashboard-ui/bower_components/iron-range-behavior/.bower.json +++ b/dashboard-ui/bower_components/iron-range-behavior/.bower.json @@ -1,6 +1,6 @@ { "name": "iron-range-behavior", - "version": "1.0.4", + "version": "1.0.5", "license": "http://polymer.github.io/LICENSE.txt", "description": "Provides a behavior for something with a minimum and maximum value", "authors": "The Polymer Authors", @@ -9,9 +9,7 @@ "polymer", "behavior" ], - "main": [ - "iron-range-behavior.html" - ], + "main": "iron-range-behavior.html", "private": true, "repository": { "type": "git", @@ -24,15 +22,16 @@ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", "iron-input": "PolymerElements/iron-input#^1.0.0", "test-fixture": "PolymerElements/test-fixture#^1.0.0", - "web-component-tester": "*", + "web-component-tester": "^4.0.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, + "ignore": [], "homepage": "https://github.com/PolymerElements/iron-range-behavior", - "_release": "1.0.4", + "_release": "1.0.5", "_resolution": { "type": "version", - "tag": "v1.0.4", - "commit": "71774a7d8a8c377496bfe05e60b754e91216e0b9" + "tag": "v1.0.5", + "commit": "645ffc6b39ae4fb0efd23b97016a9c4aac777978" }, "_source": "git://github.com/PolymerElements/iron-range-behavior.git", "_target": "^1.0.0", diff --git a/dashboard-ui/bower_components/iron-range-behavior/.github/ISSUE_TEMPLATE.md b/dashboard-ui/bower_components/iron-range-behavior/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000000..0273927308 --- /dev/null +++ b/dashboard-ui/bower_components/iron-range-behavior/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,33 @@ + +### Description + + +### Expected outcome + + + +### Actual outcome + + + +### Live Demo + + +### Steps to reproduce + + + +### Browsers Affected + +- [ ] Chrome +- [ ] Firefox +- [ ] Safari 9 +- [ ] Safari 8 +- [ ] Safari 7 +- [ ] Edge +- [ ] IE 11 +- [ ] IE 10 diff --git a/dashboard-ui/bower_components/iron-range-behavior/.travis.yml b/dashboard-ui/bower_components/iron-range-behavior/.travis.yml new file mode 100644 index 0000000000..4da2ba5b7b --- /dev/null +++ b/dashboard-ui/bower_components/iron-range-behavior/.travis.yml @@ -0,0 +1,23 @@ +language: node_js +sudo: required +before_script: + - npm install -g bower polylint web-component-tester + - bower install + - polylint +env: + global: + - secure: IsCzwFlF0UR02RUnxyo+Gk4cdZMLDOVdy3X0qE7JCe3Lo/SJXjULrJMUZmHrKV9yQTu8bke5lhJdMe/8kuO7chLekQv4AF5bR2m3x7Kg4oJGQJE30WpBWXz6XSYuwnmOINmaNqNZKil692W28LFr97N2+TxEbE64lTd5cGcgJDI= + - secure: TmQz2J5KMg/5dOi/7VDMWIxLoHjC5K7yCQAQOkcrq9M8PTBQE2wlCVe4wb6EqfiAofBv5e4heO9B3F0EOWWp2Sasa9ZQIcs0Lg/1SU6wv5Vt9XCONu/ZLI9oqG3SJ8pMMhcexMxmygX0wsytuI6LOI3sMMpOek2cdae1ntPT9IE= +node_js: stable +addons: + firefox: latest + apt: + sources: + - google-chrome + packages: + - google-chrome-stable + sauce_connect: true +script: + - xvfb-run wct + - "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi" +dist: trusty diff --git a/dashboard-ui/bower_components/iron-range-behavior/CONTRIBUTING.md b/dashboard-ui/bower_components/iron-range-behavior/CONTRIBUTING.md new file mode 100644 index 0000000000..093090d435 --- /dev/null +++ b/dashboard-ui/bower_components/iron-range-behavior/CONTRIBUTING.md @@ -0,0 +1,77 @@ + + +# Polymer Elements +## Guide for Contributors + +Polymer Elements are built in the open, and the Polymer authors eagerly encourage any and all forms of community contribution. When contributing, please follow these guidelines: + +### Filing Issues + +**If you are filing an issue to request a feature**, please provide a clear description of the feature. It can be helpful to describe answers to the following questions: + + 1. **Who will use the feature?** _“As someone filling out a form…”_ + 2. **When will they use the feature?** _“When I enter an invalid value…”_ + 3. **What is the user’s goal?** _“I want to be visually notified that the value needs to be corrected…”_ + +**If you are filing an issue to report a bug**, please provide: + + 1. **A clear description of the bug and related expectations.** Consider using the following example template for reporting a bug: + + ```markdown + The `paper-foo` element causes the page to turn pink when clicked. + + ## Expected outcome + + The page stays the same color. + + ## Actual outcome + + The page turns pink. + + ## Steps to reproduce + + 1. Put a `paper-foo` element in the page. + 2. Open the page in a web browser. + 3. Click the `paper-foo` element. + ``` + + 2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [https://jsbin.com/cagaye/edit?html,output](https://jsbin.com/cagaye/edit?html,output). + + 3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers. + +### Submitting Pull Requests + +**Before creating a pull request**, please ensure that an issue exists for the corresponding change in the pull request that you intend to make. **If an issue does not exist, please create one per the guidelines above**. The goal is to discuss the design and necessity of the proposed change with Polymer authors and community before diving into a pull request. + +When submitting pull requests, please provide: + + 1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues in the pull request description using the following syntax: + + ```markdown + (For a single issue) + Fixes #20 + + (For multiple issues) + Fixes #32, fixes #40 + ``` + + 2. **A succinct description of the design** used to fix any related issues. For example: + + ```markdown + This fixes #20 by removing styles that leaked which would cause the page to turn pink whenever `paper-foo` is clicked. + ``` + + 3. **At least one test for each bug fixed or feature added** as part of the pull request. Pull requests that fix bugs or add features without accompanying tests will not be considered. + +If a proposed change contains multiple commits, please [squash commits](https://www.google.com/url?q=http://blog.steveklabnik.com/posts/2012-11-08-how-to-squash-commits-in-a-github-pull-request) to as few as is necessary to succinctly express the change. A Polymer author can help you squash commits, so don’t be afraid to ask us if you need help with that! diff --git a/dashboard-ui/bower_components/iron-range-behavior/bower.json b/dashboard-ui/bower_components/iron-range-behavior/bower.json index b4967a7f56..a58ad63f13 100644 --- a/dashboard-ui/bower_components/iron-range-behavior/bower.json +++ b/dashboard-ui/bower_components/iron-range-behavior/bower.json @@ -1,6 +1,6 @@ { "name": "iron-range-behavior", - "version": "1.0.4", + "version": "1.0.5", "license": "http://polymer.github.io/LICENSE.txt", "description": "Provides a behavior for something with a minimum and maximum value", "authors": "The Polymer Authors", @@ -9,9 +9,7 @@ "polymer", "behavior" ], - "main": [ - "iron-range-behavior.html" - ], + "main": "iron-range-behavior.html", "private": true, "repository": { "type": "git", @@ -24,7 +22,8 @@ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", "iron-input": "PolymerElements/iron-input#^1.0.0", "test-fixture": "PolymerElements/test-fixture#^1.0.0", - "web-component-tester": "*", + "web-component-tester": "^4.0.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" - } + }, + "ignore": [] } diff --git a/dashboard-ui/bower_components/iron-range-behavior/iron-range-behavior.html b/dashboard-ui/bower_components/iron-range-behavior/iron-range-behavior.html index 28469e9eae..96f3c15b02 100644 --- a/dashboard-ui/bower_components/iron-range-behavior/iron-range-behavior.html +++ b/dashboard-ui/bower_components/iron-range-behavior/iron-range-behavior.html @@ -83,18 +83,27 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }, _calcStep: function(value) { - /** - * if we calculate the step using - * `Math.round(value / step) * step` we may hit a precision point issue - * eg. 0.1 * 0.2 = 0.020000000000000004 - * http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html - * - * as a work around we can divide by the reciprocal of `step` - */ // polymer/issues/2493 value = parseFloat(value); - return this.step ? (Math.round((value + this.min) / this.step) - - (this.min / this.step)) / (1 / this.step) : value; + + if (!this.step) { + return value; + } + + var numSteps = Math.round((value - this.min) / this.step); + if (this.step < 1) { + /** + * For small values of this.step, if we calculate the step using + * `Math.round(value / step) * step` we may hit a precision point issue + * eg. 0.1 * 0.2 = 0.020000000000000004 + * http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html + * + * as a work around we can divide by the reciprocal of `step` + */ + return numSteps / (1 / this.step) + this.min; + } else { + return numSteps * this.step + this.min; + } }, _validateValue: function() { diff --git a/dashboard-ui/bower_components/iron-range-behavior/test/basic.html b/dashboard-ui/bower_components/iron-range-behavior/test/basic.html index 37e4317dcc..9a7e41dc5e 100644 --- a/dashboard-ui/bower_components/iron-range-behavior/test/basic.html +++ b/dashboard-ui/bower_components/iron-range-behavior/test/basic.html @@ -103,6 +103,33 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }); }); + test('set large step', function(done) { + // PolymerElements/paper-slider#135 + range.min = 0; + range.max = 2625; + range.step = 875; + range.value = 875; + flush(function() { + assert.equal(range.value, 875); + done(); + }); + }); + + test('set step with min', function(done) { + range.min = -0.9; + range.max = 1.1; + range.step = 0.5; + range.value = -0.5; + flush(function() { + assert.equal(range.value, -0.4); + range.value = 0.7; + flush(function() { + assert.equal(range.value, 0.6); + done(); + }); + }); + }); + test('odd values', function(done) { range.min = 1; range.max = 7; diff --git a/dashboard-ui/bower_components/iron-range-behavior/test/index.html b/dashboard-ui/bower_components/iron-range-behavior/test/index.html index 155baeabed..b66f1defbb 100644 --- a/dashboard-ui/bower_components/iron-range-behavior/test/index.html +++ b/dashboard-ui/bower_components/iron-range-behavior/test/index.html @@ -1,5 +1,4 @@ - - - -
+-->