mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update translations
This commit is contained in:
parent
c71ac12b24
commit
9b20e2c860
90 changed files with 2845 additions and 434 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-behaviors",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"description": "Provides a set of behaviors for the iron elements",
|
||||
"private": true,
|
||||
"authors": [
|
||||
|
@ -28,11 +28,11 @@
|
|||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/PolymerElements/iron-behaviors",
|
||||
"_release": "1.0.4",
|
||||
"_release": "1.0.5",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.4",
|
||||
"commit": "8792edd457de697a74f398c09b67df30adf7d866"
|
||||
"tag": "v1.0.5",
|
||||
"commit": "bdae66f398838eda78c203b3ae979dcb5cd2a60e"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-behaviors.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-behaviors",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"description": "Provides a set of behaviors for the iron elements",
|
||||
"private": true,
|
||||
"authors": [
|
||||
|
|
|
@ -91,6 +91,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
'space:keyup': '_spaceKeyUpHandler',
|
||||
},
|
||||
|
||||
_mouseEventRe: /^mouse/,
|
||||
|
||||
_tapHandler: function() {
|
||||
if (this.toggles) {
|
||||
// a tap is needed to toggle the active state
|
||||
|
@ -111,7 +113,33 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
this.fire('change');
|
||||
},
|
||||
|
||||
_downHandler: function() {
|
||||
_eventSourceIsPrimaryInput: function(event) {
|
||||
event = event.detail.sourceEvent || event;
|
||||
|
||||
// Always true for non-mouse events....
|
||||
if (!this._mouseEventRe.test(event.type)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// http://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons
|
||||
if ('buttons' in event) {
|
||||
return event.buttons === 1;
|
||||
}
|
||||
|
||||
// http://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/which
|
||||
if (typeof event.which === 'number') {
|
||||
return event.which < 2;
|
||||
}
|
||||
|
||||
// http://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
|
||||
return event.button < 1;
|
||||
},
|
||||
|
||||
_downHandler: function(event) {
|
||||
if (!this._eventSourceIsPrimaryInput(event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._setPointerDown(true);
|
||||
this._setPressed(true);
|
||||
this._setReceivedFocusFromKeyboard(false);
|
||||
|
|
|
@ -41,6 +41,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
activeTarget = fixture('TrivialActiveState');
|
||||
});
|
||||
|
||||
suite('non-primary pointer input source', function() {
|
||||
test('does not cause state to change', function() {
|
||||
var rightClickMouseEvent = new CustomEvent('mousedown');
|
||||
rightClickMouseEvent.buttons = 2;
|
||||
activeTarget.dispatchEvent(rightClickMouseEvent);
|
||||
expect(activeTarget.pressed).to.be.equal(false);
|
||||
});
|
||||
});
|
||||
|
||||
suite('active state with toggles attribute', function() {
|
||||
setup(function() {
|
||||
activeTarget = fixture('ToggleActiveState');
|
||||
|
|
|
@ -27,14 +27,14 @@
|
|||
"web-component-tester": "*",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/PolymerElements/iron-resizable-behavior",
|
||||
"homepage": "https://github.com/polymerelements/iron-resizable-behavior",
|
||||
"_release": "1.0.2",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.2",
|
||||
"commit": "85de8ba28be2bf17c81d6436ef1119022b003674"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-resizable-behavior.git",
|
||||
"_source": "git://github.com/polymerelements/iron-resizable-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "PolymerElements/iron-resizable-behavior"
|
||||
"_originalSource": "polymerelements/iron-resizable-behavior"
|
||||
}
|
46
dashboard-ui/bower_components/paper-radio-group/.bower.json
vendored
Normal file
46
dashboard-ui/bower_components/paper-radio-group/.bower.json
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"name": "paper-radio-group",
|
||||
"version": "1.0.4",
|
||||
"description": "A group of material design radio buttons",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"radio",
|
||||
"control"
|
||||
],
|
||||
"private": true,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/paper-radio-group"
|
||||
},
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"homepage": "https://github.com/PolymerElements/paper-radio-group",
|
||||
"ignore": [],
|
||||
"dependencies": {
|
||||
"iron-selector": "PolymerElements/iron-selector#^1.0.0",
|
||||
"iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^1.0.0",
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"web-component-tester": "*",
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
||||
"paper-radio-button": "PolymerElements/paper-radio-button#^1.0.0",
|
||||
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
|
||||
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"_release": "1.0.4",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.4",
|
||||
"commit": "18b94b1ef062d8583cf37c9ccfbb21f70e49ad78"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/paper-radio-group.git",
|
||||
"_target": "~1.0.4",
|
||||
"_originalSource": "PolymerElements/paper-radio-group",
|
||||
"_direct": true
|
||||
}
|
1
dashboard-ui/bower_components/paper-radio-group/.gitignore
vendored
Normal file
1
dashboard-ui/bower_components/paper-radio-group/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
bower_components
|
36
dashboard-ui/bower_components/paper-radio-group/bower.json
vendored
Normal file
36
dashboard-ui/bower_components/paper-radio-group/bower.json
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"name": "paper-radio-group",
|
||||
"version": "1.0.4",
|
||||
"description": "A group of material design radio buttons",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"radio",
|
||||
"control"
|
||||
],
|
||||
"private": true,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/paper-radio-group"
|
||||
},
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"homepage": "https://github.com/PolymerElements/paper-radio-group",
|
||||
"ignore": [],
|
||||
"dependencies": {
|
||||
"iron-selector": "PolymerElements/iron-selector#^1.0.0",
|
||||
"iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^1.0.0",
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"web-component-tester": "*",
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
||||
"paper-radio-button": "PolymerElements/paper-radio-button#^1.0.0",
|
||||
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
|
||||
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
}
|
||||
}
|
107
dashboard-ui/bower_components/paper-radio-group/demo/index.html
vendored
Normal file
107
dashboard-ui/bower_components/paper-radio-group/demo/index.html
vendored
Normal file
|
@ -0,0 +1,107 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
@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
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>paper-radio-group demo</title>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<link rel="import" href="../../paper-radio-button/paper-radio-button.html">
|
||||
<link rel="import" href="../paper-radio-group.html">
|
||||
<link rel="import" href="../../paper-styles/demo-pages.html">
|
||||
|
||||
<style is="custom-style">
|
||||
.horizontal-section {
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
paper-radio-button.blue {
|
||||
--paper-radio-button-checked-color: var(--paper-light-blue-500);
|
||||
--paper-radio-button-checked-ink-color: var(--paper-light-blue-500);
|
||||
--paper-radio-button-unchecked-color: var(--paper-light-blue-900);
|
||||
--paper-radio-button-unchecked-ink-color: var(--paper-light-blue-900);
|
||||
}
|
||||
|
||||
paper-radio-button.red {
|
||||
--paper-radio-button-checked-color: var(--paper-red-500);
|
||||
--paper-radio-button-checked-ink-color: var(--paper-red-500);
|
||||
--paper-radio-button-unchecked-color: var(--paper-red-900);
|
||||
--paper-radio-button-unchecked-ink-color: var(--paper-red-900);
|
||||
}
|
||||
|
||||
paper-radio-button.green {
|
||||
--paper-radio-button-checked-color: var(--paper-green-500);
|
||||
--paper-radio-button-checked-ink-color: var(--paper-green-500);
|
||||
--paper-radio-button-unchecked-color: var(--paper-green-900);
|
||||
--paper-radio-button-unchecked-ink-color: var(--paper-green-900);
|
||||
}
|
||||
|
||||
paper-radio-button.orange {
|
||||
--paper-radio-button-checked-color: var(--paper-orange-500);
|
||||
--paper-radio-button-checked-ink-color: var(--paper-orange-500);
|
||||
--paper-radio-button-unchecked-color: var(--paper-orange-900);
|
||||
--paper-radio-button-unchecked-ink-color: var(--paper-orange-900);
|
||||
}
|
||||
|
||||
paper-radio-button {
|
||||
display: block;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body unresolved>
|
||||
<div class="horizontal-section-container">
|
||||
<div>
|
||||
<h4>Enabled</h4>
|
||||
<div class="horizontal-section">
|
||||
<paper-radio-group selected="c">
|
||||
<paper-radio-button name="o">Oxygen</paper-radio-button>
|
||||
<paper-radio-button name="c">Carbon</paper-radio-button>
|
||||
<paper-radio-button name="h">Hydrogen</paper-radio-button>
|
||||
<paper-radio-button name="n">Nitrogen</paper-radio-button>
|
||||
<paper-radio-button name="ca">Calcium</paper-radio-button>
|
||||
</paper-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4>Disabled</h4>
|
||||
<div class="horizontal-section">
|
||||
<paper-radio-group selected="c">
|
||||
<paper-radio-button name="o">Oxygen</paper-radio-button>
|
||||
<paper-radio-button name="c">Carbon</paper-radio-button>
|
||||
<paper-radio-button name="h" disabled>Hydrogen</paper-radio-button>
|
||||
<paper-radio-button name="n" disabled>Nitrogen</paper-radio-button>
|
||||
<paper-radio-button name="ca">Calcium</paper-radio-button>
|
||||
</paper-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4>Color</h4>
|
||||
<div class="horizontal-section">
|
||||
<paper-radio-group selected="c">
|
||||
<paper-radio-button name="o" class="blue">Oxygen</paper-radio-button>
|
||||
<paper-radio-button name="c" class="red">Carbon</paper-radio-button>
|
||||
<paper-radio-button name="h" class="orange">Hydrogen</paper-radio-button>
|
||||
<paper-radio-button name="n" class="green">Nitrogen</paper-radio-button>
|
||||
<paper-radio-button name="ca" class="blue">Calcium</paper-radio-button>
|
||||
</paper-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
25
dashboard-ui/bower_components/paper-radio-group/hero.svg
vendored
Normal file
25
dashboard-ui/bower_components/paper-radio-group/hero.svg
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 225 126" enable-background="new 0 0 225 126" xml:space="preserve">
|
||||
<g id="background" display="none">
|
||||
<rect display="inline" fill="#B0BEC5" width="225" height="126"/>
|
||||
</g>
|
||||
<g id="label">
|
||||
</g>
|
||||
<g id="art">
|
||||
<g>
|
||||
<circle cx="112.5" cy="41" r="8"/>
|
||||
<path d="M112.5,58c-9.4,0-17-7.6-17-17s7.6-17,17-17s17,7.6,17,17S121.9,58,112.5,58z M112.5,26c-8.3,0-15,6.7-15,15s6.7,15,15,15
|
||||
s15-6.7,15-15S120.8,26,112.5,26z"/>
|
||||
<circle cx="112.5" cy="85" r="8"/>
|
||||
<path d="M112.5,102c-9.4,0-17-7.6-17-17s7.6-17,17-17s17,7.6,17,17S121.9,102,112.5,102z M112.5,70c-8.3,0-15,6.7-15,15
|
||||
s6.7,15,15,15s15-6.7,15-15S120.8,70,112.5,70z"/>
|
||||
</g>
|
||||
<g id="ic_x5F_add_x0D_">
|
||||
</g>
|
||||
</g>
|
||||
<g id="Guides">
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1 KiB |
30
dashboard-ui/bower_components/paper-radio-group/index.html
vendored
Normal file
30
dashboard-ui/bower_components/paper-radio-group/index.html
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
@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
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
||||
|
||||
<title>paper-radio-group</title>
|
||||
|
||||
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<link rel="import" href="../polymer/polymer.html">
|
||||
<link rel="import" href="../iron-component-page/iron-component-page.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<iron-component-page></iron-component-page>
|
||||
|
||||
</body>
|
||||
</html>
|
152
dashboard-ui/bower_components/paper-radio-group/paper-radio-group.html
vendored
Normal file
152
dashboard-ui/bower_components/paper-radio-group/paper-radio-group.html
vendored
Normal file
|
@ -0,0 +1,152 @@
|
|||
<!--
|
||||
@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
|
||||
-->
|
||||
|
||||
<link rel="import" href="../polymer/polymer.html">
|
||||
<link rel="import" href="../iron-selector/iron-selectable.html">
|
||||
<link rel="import" href="../paper-radio-button/paper-radio-button.html">
|
||||
<link rel="import" href="../iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
|
||||
|
||||
<!--
|
||||
`paper-radio-group` allows user to select only one radio button from a set.
|
||||
Checking one radio button that belongs to a radio group unchecks any
|
||||
previously checked radio button within the same group. Use
|
||||
`selected` to get or set the selected radio button.
|
||||
|
||||
Example:
|
||||
|
||||
<paper-radio-group selected="small">
|
||||
<paper-radio-button name="small">Small</paper-radio-button>
|
||||
<paper-radio-button name="medium">Medium</paper-radio-button>
|
||||
<paper-radio-button name="large">Large</paper-radio-button>
|
||||
</paper-radio-group>
|
||||
|
||||
See <a href="paper-radio-button.html">paper-radio-button</a> for more
|
||||
information about `paper-radio-button`.
|
||||
|
||||
@group Paper Elements
|
||||
@element paper-radio-group
|
||||
@hero hero.svg
|
||||
@demo demo/index.html
|
||||
-->
|
||||
|
||||
<dom-module name="paper-radio-group">
|
||||
<style>
|
||||
:host {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
:host ::content > * {
|
||||
padding: 12px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<content id="items" select="*"></content>
|
||||
</template>
|
||||
|
||||
</dom-module>
|
||||
|
||||
<script>
|
||||
Polymer({
|
||||
is: 'paper-radio-group',
|
||||
|
||||
behaviors: [
|
||||
Polymer.IronA11yKeysBehavior,
|
||||
Polymer.IronSelectableBehavior
|
||||
],
|
||||
|
||||
hostAttributes: {
|
||||
role: 'radiogroup',
|
||||
tabindex: 0
|
||||
},
|
||||
|
||||
properties: {
|
||||
/**
|
||||
* Overriden from Polymer.IronSelectableBehavior
|
||||
*/
|
||||
attrForSelected: {
|
||||
type: String,
|
||||
value: 'name'
|
||||
},
|
||||
|
||||
/**
|
||||
* Overriden from Polymer.IronSelectableBehavior
|
||||
*/
|
||||
selectedAttribute: {
|
||||
type: String,
|
||||
value: 'checked'
|
||||
},
|
||||
|
||||
/**
|
||||
* Overriden from Polymer.IronSelectableBehavior
|
||||
*/
|
||||
selectable: {
|
||||
type: String,
|
||||
value: 'paper-radio-button'
|
||||
}
|
||||
},
|
||||
|
||||
keyBindings: {
|
||||
'left up': 'selectPrevious',
|
||||
'right down': 'selectNext',
|
||||
},
|
||||
|
||||
/**
|
||||
* Selects the given value.
|
||||
*/
|
||||
select: function(value) {
|
||||
if (this.selected) {
|
||||
var oldItem = this._valueToItem(this.selected);
|
||||
|
||||
// Do not allow unchecking the selected item.
|
||||
if (this.selected == value) {
|
||||
oldItem.checked = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (oldItem)
|
||||
oldItem.checked = false;
|
||||
}
|
||||
|
||||
Polymer.IronSelectableBehavior.select.apply(this, [value]);
|
||||
this.fire('paper-radio-group-changed');
|
||||
},
|
||||
|
||||
/**
|
||||
* Selects the previous item. If the previous item is disabled, then it is
|
||||
* skipped, and its previous item is selected
|
||||
*/
|
||||
selectPrevious: function() {
|
||||
var length = this.items.length;
|
||||
var newIndex = Number(this._valueToIndex(this.selected));
|
||||
|
||||
do {
|
||||
newIndex = (newIndex - 1 + length) % length;
|
||||
} while (this.items[newIndex].disabled)
|
||||
|
||||
this.select(this._indexToValue(newIndex));
|
||||
},
|
||||
|
||||
/**
|
||||
* Selects the next item. If the next item is disabled, then it is
|
||||
* skipped, and the next item after it is selected.
|
||||
*/
|
||||
selectNext: function() {
|
||||
var length = this.items.length;
|
||||
var newIndex = Number(this._valueToIndex(this.selected));
|
||||
|
||||
do {
|
||||
newIndex = (newIndex + 1 + length) % length;
|
||||
} while (this.items[newIndex].disabled)
|
||||
|
||||
this.select(this._indexToValue(newIndex));
|
||||
},
|
||||
});
|
||||
</script>
|
171
dashboard-ui/bower_components/paper-radio-group/test/basic.html
vendored
Normal file
171
dashboard-ui/bower_components/paper-radio-group/test/basic.html
vendored
Normal file
|
@ -0,0 +1,171 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
@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
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>paper-radio-group basic tests</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
<script src="../../iron-test-helpers/mock-interactions.js"></script>
|
||||
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
<link rel="import" href="../paper-radio-group.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="NoSelection">
|
||||
<template>
|
||||
<paper-radio-group>
|
||||
<paper-radio-button name="r1">r1</paper-radio-button>
|
||||
<paper-radio-button name="r2">r2</paper-radio-button>
|
||||
<paper-radio-button name="r3">r3</paper-radio-button>
|
||||
</paper-radio-group>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="WithSelection">
|
||||
<template>
|
||||
<paper-radio-group selected="r1">
|
||||
<paper-radio-button name="r1">r1</paper-radio-button>
|
||||
<paper-radio-button name="r2">r2</paper-radio-button>
|
||||
<paper-radio-button name="r3">r3</paper-radio-button>
|
||||
</paper-radio-group>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="WithDisabled">
|
||||
<template>
|
||||
<paper-radio-group selected="r1">
|
||||
<paper-radio-button name="r1">r1</paper-radio-button>
|
||||
<paper-radio-button name="r2" disabled>r2</paper-radio-button>
|
||||
<paper-radio-button name="r3">r3</paper-radio-button>
|
||||
</paper-radio-group>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
suite('defaults', function() {
|
||||
var LEFT_ARROW = 37;
|
||||
var RIGHT_ARROW = 39;
|
||||
|
||||
test('group can have no selection', function () {
|
||||
var g = fixture('NoSelection');
|
||||
expect(g.selected).to.not.be.ok;
|
||||
var items = g.items;
|
||||
expect(items.length).to.be.equal(3);
|
||||
expect(items[0].checked).to.be.equal(false);
|
||||
expect(items[1].checked).to.be.equal(false);
|
||||
expect(items[2].checked).to.be.equal(false);
|
||||
});
|
||||
|
||||
test('group can have a selection', function () {
|
||||
var g = fixture('WithSelection');
|
||||
expect(g.selected).to.be.ok;
|
||||
var items = g.items;
|
||||
expect(items.length).to.be.equal(3);
|
||||
|
||||
expect(items[0].checked).to.be.equal(true);
|
||||
expect(items[1].checked).to.be.equal(false);
|
||||
expect(items[2].checked).to.be.equal(false);
|
||||
expect(items[0].getAttribute('name')).to.be.equal(g.selected);
|
||||
});
|
||||
|
||||
test('right arrow advances the selection', function (done) {
|
||||
var g = fixture('WithSelection');
|
||||
var items = g.items;
|
||||
|
||||
expect(items[0].checked).to.be.equal(true);
|
||||
|
||||
g.addEventListener('paper-radio-group-changed', function () {
|
||||
expect(items[0].checked).to.be.equal(false);
|
||||
expect(items[1].checked).to.be.equal(true);
|
||||
expect(items[2].checked).to.be.equal(false);
|
||||
done();
|
||||
});
|
||||
|
||||
MockInteractions.keyDownOn(g, RIGHT_ARROW);
|
||||
});
|
||||
|
||||
test('left arrow reverses the selection', function (done) {
|
||||
var g = fixture('WithSelection');
|
||||
var items = g.items;
|
||||
|
||||
expect(items[0].checked).to.be.equal(true);
|
||||
|
||||
g.addEventListener('paper-radio-group-changed', function () {
|
||||
expect(items[0].checked).to.be.equal(false);
|
||||
expect(items[1].checked).to.be.equal(false);
|
||||
expect(items[2].checked).to.be.equal(true);
|
||||
done();
|
||||
});
|
||||
MockInteractions.keyDownOn(g, LEFT_ARROW);
|
||||
});
|
||||
|
||||
test('selection should skip disabled items', function (done) {
|
||||
var g = fixture('WithDisabled');
|
||||
var items = g.items;
|
||||
|
||||
expect(items[0].checked).to.be.equal(true);
|
||||
|
||||
g.addEventListener('paper-radio-group-changed', function () {
|
||||
expect(items[0].checked).to.be.equal(false);
|
||||
expect(items[1].checked).to.be.equal(false);
|
||||
expect(items[2].checked).to.be.equal(true);
|
||||
done();
|
||||
});
|
||||
MockInteractions.keyDownOn(g, RIGHT_ARROW);
|
||||
});
|
||||
|
||||
test('clicking should change the selection', function (done) {
|
||||
var g = fixture('WithSelection');
|
||||
var items = g.items;
|
||||
|
||||
expect(items[0].checked).to.be.equal(true);
|
||||
|
||||
g.addEventListener('paper-radio-group-changed', function () {
|
||||
expect(items[0].checked).to.be.equal(false);
|
||||
expect(items[1].checked).to.be.equal(true);
|
||||
expect(items[2].checked).to.be.equal(false);
|
||||
done();
|
||||
});
|
||||
|
||||
MockInteractions.tap(items[1]);
|
||||
});
|
||||
|
||||
test('clicking the selected item should not deselect', function (done) {
|
||||
var g = fixture('WithSelection');
|
||||
var items = g.items;
|
||||
|
||||
expect(items[0].checked).to.be.equal(true);
|
||||
MockInteractions.tap(items[0]);
|
||||
|
||||
// The selection should not change, but wait for a little bit just
|
||||
// in case it would and an event would be fired.
|
||||
setTimeout(function() {
|
||||
try {
|
||||
expect(items[0].checked).to.be.equal(true);
|
||||
expect(items[1].checked).to.be.equal(false);
|
||||
expect(items[2].checked).to.be.equal(false);
|
||||
done();
|
||||
} catch (e) {
|
||||
done(e)
|
||||
}
|
||||
}, 200);
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
25
dashboard-ui/bower_components/paper-radio-group/test/index.html
vendored
Normal file
25
dashboard-ui/bower_components/paper-radio-group/test/index.html
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
@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
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
||||
<title>paper-radio-group tests</title>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
WCT.loadSuites([
|
||||
'basic.html'
|
||||
]);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue