1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update components

This commit is contained in:
Luke Pulverenti 2016-02-24 16:18:53 -05:00
parent 669a2e46d4
commit 3c9e6e0374
10 changed files with 109 additions and 50 deletions

View file

@ -30,14 +30,14 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"ignore": [], "ignore": [],
"homepage": "https://github.com/polymerelements/iron-a11y-keys-behavior", "homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior",
"_release": "1.1.1", "_release": "1.1.1",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.1.1", "tag": "v1.1.1",
"commit": "12af7cb19b2c6b3887e37a5ea1501ffe676d1e8a" "commit": "12af7cb19b2c6b3887e37a5ea1501ffe676d1e8a"
}, },
"_source": "git://github.com/polymerelements/iron-a11y-keys-behavior.git", "_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "polymerelements/iron-a11y-keys-behavior" "_originalSource": "PolymerElements/iron-a11y-keys-behavior"
} }

View file

@ -1,6 +1,6 @@
{ {
"name": "iron-fit-behavior", "name": "iron-fit-behavior",
"version": "1.0.5", "version": "1.0.6",
"license": "http://polymer.github.io/LICENSE.txt", "license": "http://polymer.github.io/LICENSE.txt",
"description": "Fits an element inside another element", "description": "Fits an element inside another element",
"private": true, "private": true,
@ -24,16 +24,16 @@
"paper-styles": "polymerelements/paper-styles#^1.0.2", "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0", "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0", "test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "polymer/web-component-tester#^3.4.0", "web-component-tester": "^4.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"ignore": [], "ignore": [],
"homepage": "https://github.com/PolymerElements/iron-fit-behavior", "homepage": "https://github.com/PolymerElements/iron-fit-behavior",
"_release": "1.0.5", "_release": "1.0.6",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.5", "tag": "v1.0.6",
"commit": "18dec1eb5c7217be4d360c0fb9101fe899136f92" "commit": "f2e868af4fad643ffb7fea3501e1429acc4ec0f0"
}, },
"_source": "git://github.com/PolymerElements/iron-fit-behavior.git", "_source": "git://github.com/PolymerElements/iron-fit-behavior.git",
"_target": "^1.0.0", "_target": "^1.0.0",

View file

@ -1,22 +1,25 @@
language: node_js language: node_js
sudo: false sudo: false
before_script: before_script:
- npm install web-component-tester - npm install -g bower polylint web-component-tester
- npm install bower
- 'export PATH=$PWD/node_modules/.bin:$PATH'
- bower install - bower install
- polylint
env: env:
global: global:
- secure: QL2j7nfSA/40iIPMKLMosv9hj8q7eGBbPQXVQmCL3uXD5qoMPTqo1qronKKX+bi3Rh7W104ufV4CzzbWvBwQh8gipx+4REGijzc77Fro2y3v3/wUp9H/UEWnbhAWPDsqEoAD8xQXFHkVv7874/VwOlubQyXDGlvqh0fzYbUNUQo= - secure: QL2j7nfSA/40iIPMKLMosv9hj8q7eGBbPQXVQmCL3uXD5qoMPTqo1qronKKX+bi3Rh7W104ufV4CzzbWvBwQh8gipx+4REGijzc77Fro2y3v3/wUp9H/UEWnbhAWPDsqEoAD8xQXFHkVv7874/VwOlubQyXDGlvqh0fzYbUNUQo=
- secure: ajBo8YcSzi4kNuCHcmajCirWQKf5Mj4OZ3tQjNAcJJAy0UtyrAgTenayWN2ijKqD5V8wfTK66jUXGYMZkoJV4EpknrUliqRgRqKHHfULXYWRSC7lDGxf835ReFxstkPun4HmNtxraAWJgmgFz7mylntTVKm46Ce4INj3n8reWaY= - secure: ajBo8YcSzi4kNuCHcmajCirWQKf5Mj4OZ3tQjNAcJJAy0UtyrAgTenayWN2ijKqD5V8wfTK66jUXGYMZkoJV4EpknrUliqRgRqKHHfULXYWRSC7lDGxf835ReFxstkPun4HmNtxraAWJgmgFz7mylntTVKm46Ce4INj3n8reWaY=
node_js: 4 - CXX=g++-4.8
node_js: stable
addons: addons:
firefox: '42.0' firefox: latest
apt: apt:
sources: sources:
- google-chrome - google-chrome
- ubuntu-toolchain-r-test
packages: packages:
- google-chrome-stable - google-chrome-stable
- g++-4.8
sauce_connect: true
script: script:
- xvfb-run wct - xvfb-run wct
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi" - "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"

View file

@ -5,6 +5,11 @@ https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md
If you edit that file, it will get updated everywhere else. If you edit that file, it will get updated everywhere else.
If you edit this file, your changes will get overridden :) If you edit this file, your changes will get overridden :)
You can however override the jsbin link with one that's customized to this
specific element:
jsbin=https://jsbin.com/cagaye/edit?html,output
--> -->
# Polymer Elements # Polymer Elements
## Guide for Contributors ## Guide for Contributors
@ -41,7 +46,7 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag
3. Click the `paper-foo` element. 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: [http://jsbin.com/cagaye](http://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/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. 3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers.
@ -51,14 +56,14 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag
When submitting pull requests, please provide: 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 using the following syntax: 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 ```markdown
(For a single issue) (For a single issue)
Fixes #20 Fixes #20
(For multiple issues) (For multiple issues)
Fixes #32, #40 Fixes #32, fixes #40
``` ```
2. **A succinct description of the design** used to fix any related issues. For example: 2. **A succinct description of the design** used to fix any related issues. For example:

View file

@ -1,6 +1,6 @@
{ {
"name": "iron-fit-behavior", "name": "iron-fit-behavior",
"version": "1.0.5", "version": "1.0.6",
"license": "http://polymer.github.io/LICENSE.txt", "license": "http://polymer.github.io/LICENSE.txt",
"description": "Fits an element inside another element", "description": "Fits an element inside another element",
"private": true, "private": true,
@ -24,7 +24,7 @@
"paper-styles": "polymerelements/paper-styles#^1.0.2", "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0", "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0", "test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "polymer/web-component-tester#^3.4.0", "web-component-tester": "^4.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"ignore": [] "ignore": []

View file

@ -24,8 +24,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<style> <style>
.sized { .sized {
width: 50%; max-width: 50%;
height: 50%; max-height: 50%;
padding: 20px;
} }
</style> </style>
@ -33,8 +34,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</head> </head>
<body unresolved> <body unresolved>
<simple-fit auto-fit-on-attach class="sized"> <simple-fit id="myFit" auto-fit-on-attach class="sized" onclick="myFit.refit()">
centered in window Centered in window.<br><br>
Resize the window and click here to refit.
</simple-fit> </simple-fit>
</body> </body>

View file

@ -171,14 +171,14 @@ CSS properties | Action
* the memoized data. * the memoized data.
*/ */
resetFit: function() { resetFit: function() {
if (!this._fitInfo || !this._fitInfo.sizedBy.height) {
this.sizingTarget.style.maxHeight = '';
this.style.top = this._fitInfo ? this._fitInfo.inlineStyle.top : '';
}
if (!this._fitInfo || !this._fitInfo.sizedBy.width) { if (!this._fitInfo || !this._fitInfo.sizedBy.width) {
this.sizingTarget.style.maxWidth = ''; this.sizingTarget.style.maxWidth = '';
this.style.left = this._fitInfo ? this._fitInfo.inlineStyle.left : '';
} }
if (!this._fitInfo || !this._fitInfo.sizedBy.height) {
this.sizingTarget.style.maxHeight = '';
}
this.style.top = this._fitInfo ? this._fitInfo.inlineStyle.top : '';
this.style.left = this._fitInfo ? this._fitInfo.inlineStyle.left : '';
if (this._fitInfo) { if (this._fitInfo) {
this.style.position = this._fitInfo.positionedBy.css; this.style.position = this._fitInfo.positionedBy.css;
} }
@ -239,18 +239,30 @@ CSS properties | Action
* `position:fixed`. * `position:fixed`.
*/ */
center: function() { center: function() {
if (!this._fitInfo.positionedBy.vertically || !this._fitInfo.positionedBy.horizontally) { var positionedBy = this._fitInfo.positionedBy;
// need position:fixed to center if (positionedBy.vertically && positionedBy.horizontally) {
this.style.position = 'fixed'; // Already positioned.
return;
} }
if (!this._fitInfo.positionedBy.vertically) { // Need position:fixed to center
var top = (this._fitHeight - this.offsetHeight) / 2 + this._fitTop; this.style.position = 'fixed';
top -= this._fitInfo.margin.top; // Take into account the offset caused by parents that create stacking
// contexts (e.g. with transform: translate3d). Translate to 0,0 and
// measure the bounding rect.
if (!positionedBy.vertically) {
this.style.top = '0px';
}
if (!positionedBy.horizontally) {
this.style.left = '0px';
}
// It will take in consideration margins and transforms
var rect = this.getBoundingClientRect();
if (!positionedBy.vertically) {
var top = this._fitTop - rect.top + (this._fitHeight - rect.height) / 2;
this.style.top = top + 'px'; this.style.top = top + 'px';
} }
if (!this._fitInfo.positionedBy.horizontally) { if (!positionedBy.horizontally) {
var left = (this._fitWidth - this.offsetWidth) / 2 + this._fitLeft; var left = this._fitLeft - rect.left + (this._fitWidth - rect.width) / 2;
left -= this._fitInfo.margin.left;
this.style.left = left + 'px'; this.style.left = left + 'px';
} }
} }

View file

@ -1,5 +1,4 @@
<!doctype html> <!DOCTYPE html><!--
<!--
@license @license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved. Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
@ -7,9 +6,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
--> --><html><head>
<html>
<head>
<title>iron-fit-behavior tests</title> <title>iron-fit-behavior tests</title>
@ -23,12 +20,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<body> <body>
<script> <script>
WCT.loadSuites([ WCT.loadSuites([
'iron-fit-behavior.html' 'iron-fit-behavior.html',
'iron-fit-behavior.html?dom=shadow'
]); ]);
</script> </script>
</body>
</html>
</body></html>

View file

@ -46,6 +46,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
height: 200px; height: 200px;
} }
.sized-xy {
width: 200px;
height: 200px;
}
.positioned-left { .positioned-left {
position: absolute; position: absolute;
left: 100px; left: 100px;
@ -83,6 +88,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</head> </head>
<body> <body>
<test-fixture id="absolute"> <test-fixture id="absolute">
<template> <template>
<test-fit auto-fit-on-attach class="absolute"> <test-fit auto-fit-on-attach class="absolute">
@ -107,6 +113,16 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</template> </template>
</test-fixture> </test-fixture>
<test-fixture id="with-max-width">
<template>
<div class="constrain" style="position: fixed; top: 20px; left: 100px; width: 50vw; height: 50vh; border: 1px solid black;">
<test-fit auto-fit-on-attach class="with-max-width el">
with-max-width, auto center/center
</test-fit>
</div>
</template>
</test-fixture>
<test-fixture id="positioned-xy"> <test-fixture id="positioned-xy">
<template> <template>
<test-fit auto-fit-on-attach class="sized-x positioned-left positioned-top"> <test-fit auto-fit-on-attach class="sized-x positioned-left positioned-top">
@ -137,7 +153,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<test-fixture id="constrain-target"> <test-fixture id="constrain-target">
<template> <template>
<div class="constrain" style="position: fixed; top: 20px; left: 100px; width: 50vw; height: 50vh; border: 1px solid black;"> <div class="constrain" style="position: fixed; top: 20px; left: 100px; width: 50vw; height: 50vh; border: 1px solid black;">
<test-fit auto-fit-on-attach class="el"> <test-fit auto-fit-on-attach class="el sized-xy">
<div> <div>
Auto center/center to parent element Auto center/center to parent element
</div> </div>
@ -223,6 +239,19 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
assert.closeTo(rect.top - (window.innerHeight - rect.bottom), 0, 5, 'centered vertically'); assert.closeTo(rect.top - (window.innerHeight - rect.bottom), 0, 5, 'centered vertically');
}); });
test('sized element with transformed parent is centered in viewport', function() {
var constrain = fixture('constrain-target');
var el = Polymer.dom(constrain).querySelector('.el');
var rectBefore = el.getBoundingClientRect();
constrain.style.transform = 'translate3d(5px, 5px, 0)';
el.center();
var rectAfter = el.getBoundingClientRect();
assert.equal(rectBefore.top, rectAfter.top, 'top ok');
assert.equal(rectBefore.bottom, rectAfter.bottom, 'bottom ok');
assert.equal(rectBefore.left, rectAfter.left, 'left ok');
assert.equal(rectBefore.right, rectAfter.right, 'right ok');
});
test('scrolling element is centered in viewport', function() { test('scrolling element is centered in viewport', function() {
var el = fixture('sized-x'); var el = fixture('sized-x');
makeScrolling(el); makeScrolling(el);
@ -361,6 +390,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
assert.closeTo(rect.top - crect.top - (crect.bottom - rect.bottom), 0, 5, 'centered vertically in fitInto'); assert.closeTo(rect.top - crect.top - (crect.bottom - rect.bottom), 0, 5, 'centered vertically in fitInto');
}); });
test('element with max-width centers in another element', function() {
var constrain = fixture('with-max-width');
var el = Polymer.dom(constrain).querySelector('.el');
el.fitInto = constrain;
el.refit();
var rect = el.getBoundingClientRect();
var crect = constrain.getBoundingClientRect();
assert.closeTo(rect.left - crect.left - (crect.right - rect.right), 0, 5, 'centered horizontally in fitInto');
assert.closeTo(rect.top - crect.top - (crect.bottom - rect.bottom), 0, 5, 'centered vertically in fitInto');
});
}); });
</script> </script>

View file

@ -31,14 +31,14 @@
"web-component-tester": "*", "web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"homepage": "https://github.com/PolymerElements/iron-icon", "homepage": "https://github.com/polymerelements/iron-icon",
"_release": "1.0.7", "_release": "1.0.7",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.7", "tag": "v1.0.7",
"commit": "6f4d152dc3998a6cc12a5a585a654f893dc99381" "commit": "6f4d152dc3998a6cc12a5a585a654f893dc99381"
}, },
"_source": "git://github.com/PolymerElements/iron-icon.git", "_source": "git://github.com/polymerelements/iron-icon.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-icon" "_originalSource": "polymerelements/iron-icon"
} }