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

update tabs

This commit is contained in:
Luke Pulverenti 2015-09-01 10:01:59 -04:00
parent 382dea3748
commit 9ea282ff39
129 changed files with 371 additions and 418 deletions

View file

@ -1,7 +1,7 @@
{
"name": "iron-icon",
"private": true,
"version": "1.0.3",
"version": "1.0.4",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "An element that supports displaying an icon",
"main": "iron-icon.html",
@ -31,11 +31,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/polymerelements/iron-icon",
"_release": "1.0.3",
"_release": "1.0.4",
"_resolution": {
"type": "version",
"tag": "v1.0.3",
"commit": "818c2d2af2d3287a444e4cf0a19c2b5717d480e8"
"tag": "v1.0.4",
"commit": "5a5e6cad097561ff9d182ad2b8e20bb822d6f640"
},
"_source": "git://github.com/polymerelements/iron-icon.git",
"_target": "^1.0.0",

View file

@ -1,7 +1,7 @@
{
"name": "iron-icon",
"private": true,
"version": "1.0.3",
"version": "1.0.4",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "An element that supports displaying an icon",
"main": "iron-icon.html",

View file

@ -92,7 +92,6 @@ Custom property | Description | Default
</style>
<template>
<iron-meta id="meta" type="iconset"></iron-meta>
</template>
<script>
@ -129,7 +128,12 @@ Custom property | Description | Default
src: {
type: String,
observer: '_srcChanged'
},
_meta: {
value: Polymer.Base.create('iron-meta', {type: 'iconset'})
}
},
_DEFAULT_ICONSET: 'icons',
@ -153,7 +157,7 @@ Custom property | Description | Default
_updateIcon: function() {
if (this._usesIconset()) {
if (this._iconsetName) {
this._iconset = this.$.meta.byKey(this._iconsetName);
this._iconset = this._meta.byKey(this._iconsetName);
if (this._iconset) {
this._iconset.applyIcon(this, this._iconName, this.theme);
} else {

View file

@ -1,6 +1,6 @@
{
"name": "paper-radio-button",
"version": "1.0.6",
"version": "1.0.7",
"description": "A material design radio button",
"authors": [
"The Polymer Authors"
@ -23,20 +23,21 @@
"paper-ripple": "PolymerElements/paper-ripple#^1.0.0",
"paper-styles": "PolymerLabs/paper-styles#^1.0.0",
"paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
"iron-checked-element-behavior": "PolymerElements/iron-checked-element-behavior#^1.0.0",
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
"web-component-tester": "*",
"web-component-tester": "Polymer/web-component-tester#^3.3.0",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"_release": "1.0.6",
"_release": "1.0.7",
"_resolution": {
"type": "version",
"tag": "v1.0.6",
"commit": "85e8553c117d9ad10e7faa8d94f815455a675bd3"
"tag": "v1.0.7",
"commit": "63a78475ecc28dfbc849e63001f0c8d001811e44"
},
"_source": "git://github.com/PolymerElements/paper-radio-button.git",
"_target": "~1.0.5",

View file

@ -1,6 +1,6 @@
{
"name": "paper-radio-button",
"version": "1.0.6",
"version": "1.0.7",
"description": "A material design radio button",
"authors": [
"The Polymer Authors"
@ -23,10 +23,11 @@
"paper-ripple": "PolymerElements/paper-ripple#^1.0.0",
"paper-styles": "PolymerLabs/paper-styles#^1.0.0",
"paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
"iron-checked-element-behavior": "PolymerElements/iron-checked-element-behavior#^1.0.0",
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
"web-component-tester": "*",
"web-component-tester": "Polymer/web-component-tester#^3.3.0",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",

View file

@ -1,4 +1,5 @@
/*
/**
@license
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
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -11,6 +11,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../paper-ripple/paper-ripple.html">
<link rel="import" href="../paper-styles/default-theme.html">
<link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
<link rel="import" href="../iron-checked-element-behavior/iron-checked-element-behavior.html">
<!--
`paper-radio-button` is a button that can be either checked or unchecked.
@ -56,7 +57,7 @@ Custom property | Description | Default
<paper-ripple id="ink" class="circle" center checked$="[[checked]]"></paper-ripple>
</div>
<div id="radioLabel" aria-hidden="true"><content></content></div>
<div id="radioLabel"><content></content></div>
</template>
@ -65,7 +66,8 @@ Custom property | Description | Default
is: 'paper-radio-button',
behaviors: [
Polymer.PaperInkyFocusBehavior
Polymer.PaperInkyFocusBehavior,
Polymer.IronCheckedElementBehavior
],
hostAttributes: {
@ -87,38 +89,30 @@ Custom property | Description | Default
* @event iron-change
*/
/**
* Gets or sets the state, `true` is checked and `false` is unchecked.
*/
checked: {
type: Boolean,
value: false,
reflectToAttribute: true,
notify: true,
observer: '_checkedChanged'
},
/**
* If true, the button toggles the active state with each tap or press
* of the spacebar.
*/
toggles: {
type: Boolean,
value: true,
reflectToAttribute: true
}
ariaActiveAttribute: {
value: 'aria-checked'
}
},
attached: function() {
var trimmedText = Polymer.dom(this).textContent.trim();
if (trimmedText === '') {
this.$.radioLabel.hidden = true;
}
// Don't stomp over a user-set aria-label.
if (trimmedText !== '' && !this.getAttribute('aria-label')) {
this.setAttribute('aria-label', trimmedText);
}
this._isReady = true;
// Don't stomp over a user-set aria-label.
if (!this.getAttribute('aria-label')) {
this.updateAriaLabel();
}
},
/**
* Update the checkbox aria-label. This is a temporary workaround not
* being able to observe changes in <content>
* (see: https://github.com/Polymer/polymer/issues/1773)
*
* Call this if you manually change the contents of the checkbox
* and want the aria-label to match the new contents.
*/
updateAriaLabel: function() {
this.setAttribute('aria-label', Polymer.dom(this).textContent.trim());
},
_buttonStateChanged: function() {
@ -128,12 +122,6 @@ Custom property | Description | Default
if (this._isReady) {
this.checked = this.active;
}
},
_checkedChanged: function() {
this.setAttribute('aria-checked', this.checked ? 'true' : 'false');
this.active = this.checked;
this.fire('iron-change');
}
})
</script>

View file

@ -50,33 +50,35 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
r1 = fixture('NoLabel');
});
test('check button via click', function() {
test('check button via click', function(done) {
r1.addEventListener('click', function() {
assert.isTrue(r1.getAttribute('aria-checked'));
assert.isTrue(r1.getAttribute('aria-checked') == 'true');
assert.isTrue(r1.checked);
done();
});
MockInteractions.down(r1);
MockInteractions.tap(r1);
});
test('toggle button via click', function() {
test('toggle button via click', function(done) {
r1.checked = true;
r1.addEventListener('click', function() {
assert.isFalse(r1.getAttribute('aria-checked'));
assert.isFalse(r1.getAttribute('aria-checked') == 'true');
assert.isFalse(r1.checked);
done();
});
MockInteractions.down(r1);
MockInteractions.tap(r1);
});
test('disabled button cannot be clicked', function() {
test('disabled button cannot be clicked', function(done) {
r1.disabled = true;
r1.addEventListener('click', function() {
assert.isTrue(r1.getAttribute('aria-checked'));
r1.checked = true;
MockInteractions.tap(r1);
setTimeout(function() {
assert.isTrue(r1.getAttribute('aria-checked') == 'true');
assert.isTrue(r1.checked);
done();
});
MockInteractions.down(r1);
}, 1);
});
});
@ -106,6 +108,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
var c = fixture('AriaLabel');
assert.isTrue(c.getAttribute('aria-label') == "Batman");
});
a11ySuite('NoLabel');
a11ySuite('WithLabel');
a11ySuite('AriaLabel');
});
</script>
</body>

View file

@ -1,6 +1,6 @@
{
"name": "paper-toggle-button",
"version": "1.0.6",
"version": "1.0.7",
"description": "A material design toggle button control",
"authors": [
"The Polymer Authors"
@ -20,24 +20,25 @@
"homepage": "https://github.com/PolymerElements/paper-toggle-button",
"ignore": [],
"dependencies": {
"polymer": "Polymer/polymer#^1.1.0",
"paper-ripple": "PolymerElements/paper-ripple#^1.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
"paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
"polymer": "Polymer/polymer#^1.0.0"
"iron-checked-element-behavior": "PolymerElements/iron-checked-element-behavior#^1.0.0"
},
"devDependencies": {
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"web-component-tester": "Polymer/web-component-tester#^3.3.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0"
},
"_release": "1.0.6",
"_release": "1.0.7",
"_resolution": {
"type": "version",
"tag": "v1.0.6",
"commit": "e0bc6b17079da9487c62aaadeb46e3a199a7a112"
"tag": "v1.0.7",
"commit": "9abc8568d25c83c77394d141b82ff1630649ee7c"
},
"_source": "git://github.com/PolymerElements/paper-toggle-button.git",
"_target": "~1.0.5",

View file

@ -1,6 +1,6 @@
{
"name": "paper-toggle-button",
"version": "1.0.6",
"version": "1.0.7",
"description": "A material design toggle button control",
"authors": [
"The Polymer Authors"
@ -20,17 +20,18 @@
"homepage": "https://github.com/PolymerElements/paper-toggle-button",
"ignore": [],
"dependencies": {
"polymer": "Polymer/polymer#^1.1.0",
"paper-ripple": "PolymerElements/paper-ripple#^1.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
"paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
"polymer": "Polymer/polymer#^1.0.0"
"iron-checked-element-behavior": "PolymerElements/iron-checked-element-behavior#^1.0.0"
},
"devDependencies": {
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"web-component-tester": "Polymer/web-component-tester#^3.3.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0"
}
}

View file

@ -1,113 +0,0 @@
/*
@license
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
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
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
*/
:host {
display: inline-block;
}
:host([disabled]) {
pointer-events: none;
}
:host(:focus) {
outline:none;
}
:host .toggle-bar {
background-color: var(--paper-toggle-button-unchecked-bar-color, #000000);
@apply(--paper-toggle-button-unchecked-bar);
}
:host .toggle-button {
background-color: var(--paper-toggle-button-unchecked-button-color, --paper-grey-50);
@apply(--paper-toggle-button-unchecked-button);
}
:host([checked]) .toggle-bar {
background-color: var(--paper-toggle-button-checked-bar-color, --google-green-500);
@apply(--paper-toggle-button-checked-bar);
}
:host([checked]) .toggle-button {
background-color: var(--paper-toggle-button-checked-button-color, --google-green-500);
@apply(--paper-toggle-button-checked-button);
}
:host .toggle-ink {
color: var(--paper-toggle-button-unchecked-ink-color, --primary-text-color);
}
:host([checked]) .toggle-ink {
color: var(--paper-toggle-button-checked-ink-color, --google-green-500);
}
/* ID selectors should not be overriden by users. */
#toggleContainer {
position: relative;
width: 36px;
height: 14px;
}
#toggleBar {
position: absolute;
height: 100%;
width: 100%;
border-radius: 8px;
pointer-events: none;
opacity: 0.4;
transition: background-color linear .08s;
}
:host([checked]) #toggleBar {
opacity: 0.5;
}
:host([disabled]) #toggleBar {
background-color: #000;
opacity: 0.12;
}
#toggleButton {
position: absolute;
top: -3px;
height: 20px;
width: 20px;
border-radius: 50%;
box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.6);
transition: -webkit-transform linear .08s, background-color linear .08s;
transition: transform linear .08s, background-color linear .08s;
will-change: transform;
}
#toggleButton.dragging {
-webkit-transition: none;
transition: none;
}
:host([checked]) #toggleButton {
-webkit-transform: translate(16px, 0);
transform: translate(16px, 0);
}
:host([disabled]) #toggleButton {
background-color: #bdbdbd;
opacity: 1;
}
#ink {
position: absolute;
top: -14px;
left: -14px;
width: 48px;
height: 48px;
opacity: 0.5;
pointer-events: none;
}

View file

@ -13,6 +13,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../paper-styles/default-theme.html">
<link rel="import" href="../paper-ripple/paper-ripple.html">
<link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
<link rel="import" href="../iron-checked-element-behavior/iron-checked-element-behavior.html">
<!--
`paper-toggle-button` provides a ON/OFF switch that user can toggle the state
@ -31,9 +32,9 @@ Custom property | Description | Default
`--paper-toggle-button-unchecked-bar-color` | Slider color when the input is not checked | `#000000`
`--paper-toggle-button-unchecked-button-color` | Button color when the input is not checked | `--paper-grey-50`
`--paper-toggle-button-unchecked-ink-color` | Selected/focus ripple color when the input is not checked | `--dark-primary-color`
`--paper-toggle-button-checked-bar-color` | Slider button color when the input is checked | `--google-green-500`
`--paper-toggle-button-checked-button-color` | Button color when the input is checked | `--google-green-500`
`--paper-toggle-button-checked-ink-color` | Selected/focus ripple color when the input is checked | `--google-green-500`
`--paper-toggle-button-checked-bar-color` | Slider button color when the input is checked | `--default-primary-color`
`--paper-toggle-button-checked-button-color` | Button color when the input is checked | `--default-primary-color`
`--paper-toggle-button-checked-ink-color` | Selected/focus ripple color when the input is checked | `--default-primary-color`
`--paper-toggle-button-unchecked-bar` | Mixin applied to the slider when the input is not checked | `{}`
`--paper-toggle-button-unchecked-button` | Mixin applied to the slider button when the input is not checked | `{}`
`--paper-toggle-button-checked-bar` | Mixin applied to the slider when the input is checked | `{}`
@ -46,11 +47,114 @@ Custom property | Description | Default
-->
<dom-module id="paper-toggle-button">
<link rel="import" type="css" href="paper-toggle-button.css">
<template>
<style>
:host {
display: inline-block;
}
:host([disabled]) {
pointer-events: none;
}
:host(:focus) {
outline:none;
}
:host .toggle-bar {
background-color: var(--paper-toggle-button-unchecked-bar-color, #000000);
@apply(--paper-toggle-button-unchecked-bar);
}
:host .toggle-button {
background-color: var(--paper-toggle-button-unchecked-button-color, --paper-grey-50);
@apply(--paper-toggle-button-unchecked-button);
}
:host([checked]) .toggle-bar {
background-color: var(--paper-toggle-button-checked-bar-color, --default-primary-color);
@apply(--paper-toggle-button-checked-bar);
}
:host([checked]) .toggle-button {
background-color: var(--paper-toggle-button-checked-button-color, --default-primary-color);
@apply(--paper-toggle-button-checked-button);
}
:host .toggle-ink {
color: var(--paper-toggle-button-unchecked-ink-color, --primary-text-color);
}
:host([checked]) .toggle-ink {
color: var(--paper-toggle-button-checked-ink-color, --default-primary-color);
}
/* ID selectors should not be overriden by users. */
#toggleContainer {
position: relative;
width: 36px;
height: 14px;
}
#toggleBar {
position: absolute;
height: 100%;
width: 100%;
border-radius: 8px;
pointer-events: none;
opacity: 0.4;
transition: background-color linear .08s;
}
:host([checked]) #toggleBar {
opacity: 0.5;
}
:host([disabled]) #toggleBar {
background-color: #000;
opacity: 0.12;
}
#toggleButton {
position: absolute;
top: -3px;
height: 20px;
width: 20px;
border-radius: 50%;
box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.6);
transition: -webkit-transform linear .08s, background-color linear .08s;
transition: transform linear .08s, background-color linear .08s;
will-change: transform;
}
#toggleButton.dragging {
-webkit-transition: none;
transition: none;
}
:host([checked]) #toggleButton {
-webkit-transform: translate(16px, 0);
transform: translate(16px, 0);
}
:host([disabled]) #toggleButton {
background-color: #bdbdbd;
opacity: 1;
}
#ink {
position: absolute;
top: -14px;
left: -14px;
width: 48px;
height: 48px;
opacity: 0.5;
pointer-events: none;
}
</style>
<div id="toggleContainer">
<div id="toggleBar" class="toggle-bar"></div>
<div id="toggleButton" class="toggle-button">
@ -65,7 +169,8 @@ Custom property | Description | Default
is: 'paper-toggle-button',
behaviors: [
Polymer.PaperInkyFocusBehavior
Polymer.PaperInkyFocusBehavior,
Polymer.IronCheckedElementBehavior
],
hostAttributes: {
@ -85,34 +190,6 @@ Custom property | Description | Default
*
* @event iron-change
*/
/**
* Gets or sets the state, `true` is checked and `false` is unchecked.
*
* @attribute checked
* @type boolean
* @default false
*/
checked: {
type: Boolean,
value: false,
reflectToAttribute: true,
notify: true,
observer: '_checkedChanged'
},
/**
* If true, the button toggles the active state with each tap or press
* of the spacebar.
*
* @attribute toggles
* @type boolean
* @default true
*/
toggles: {
type: Boolean,
value: true,
reflectToAttribute: true
}
},
listeners: {
@ -133,11 +210,6 @@ Custom property | Description | Default
}
},
_checkedChanged: function(checked) {
this.active = this.checked;
this.fire('iron-change');
},
_ontrack: function(event) {
var track = event.detail;
if (track.state === 'start') {
@ -174,5 +246,4 @@ Custom property | Description | Default
});
</script>
</dom-module>

View file

@ -39,33 +39,35 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
b1 = fixture('Basic');
});
test('check button via click', function() {
test('check button via click', function(done) {
b1.addEventListener('click', function() {
assert.isTrue(b1.getAttribute('aria-checked'));
assert.isTrue(b1.getAttribute('aria-pressed') == 'true');
assert.isTrue(b1.checked);
done();
});
MockInteractions.down(b1);
MockInteractions.tap(b1);
});
test('toggle button via click', function() {
test('toggle button via click', function(done) {
b1.checked = true;
b1.addEventListener('click', function() {
assert.isFalse(b1.getAttribute('aria-checked'));
assert.isFalse(b1.getAttribute('aria-pressed') == 'true');
assert.isFalse(b1.checked);
done();
});
MockInteractions.down(b1);
MockInteractions.tap(b1);
});
test('disabled button cannot be clicked', function() {
test('disabled button cannot be clicked', function(done) {
b1.disabled = true;
b1.addEventListener('click', function() {
assert.isTrue(b1.getAttribute('aria-checked'));
b1.checked = true;
MockInteractions.tap(b1);
setTimeout(function() {
assert.isTrue(b1.getAttribute('aria-pressed') == 'true');
assert.isTrue(b1.checked);
done();
});
MockInteractions.down(b1);
}, 1);
});
});
@ -80,6 +82,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
console.log(b1.getAttribute('role'));
assert.isTrue(b1.getAttribute('role') == 'button');
});
a11ySuite('Basic');
});
</script>
</body>