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

update translations

This commit is contained in:
Luke Pulverenti 2015-08-12 17:39:02 -04:00
parent d65219f9f8
commit dbf135beac
114 changed files with 3331 additions and 93 deletions

View file

@ -0,0 +1,53 @@
{
"name": "paper-dropdown-menu",
"version": "1.0.1",
"description": "An element that works similarly to a native browser select",
"authors": [
"The Polymer Authors"
],
"keywords": [
"web-components",
"web-component",
"polymer",
"dropdown",
"select"
],
"main": "paper-dropdown-menu.html",
"private": true,
"repository": {
"type": "git",
"url": "git://github.com/PolymerElements/paper-dropdown-menu"
},
"license": "http://polymer.github.io/LICENSE.txt",
"homepage": "https://github.com/PolymerElements/paper-dropdown-menu",
"dependencies": {
"polymer": "polymer/polymer#^1.0.0",
"iron-a11y-keys-behavior": "polymerelements/iron-a11y-keys-behavior#^1.0.0",
"iron-icon": "polymerelements/iron-icon#^1.0.0",
"iron-icons": "polymerelements/iron-icons#^1.0.0",
"paper-input": "polymerelements/paper-input#^1.0.9",
"paper-menu-button": "polymerelements/paper-menu-button#^1.0.0",
"paper-ripple": "polymerelements/paper-ripple#^1.0.0",
"paper-styles": "polymerelements/paper-styles#^1.0.0"
},
"devDependencies": {
"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",
"paper-item": "polymerelements/paper-item#^1.0.0",
"paper-menu": "polymerelements/paper-menu#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"web-component-tester": "*",
"paper-tabs": "polymerelements/paper-tabs#^1.0.0"
},
"_release": "1.0.1",
"_resolution": {
"type": "version",
"tag": "v1.0.1",
"commit": "c16e6087ce4b770938b96647e80c78765eea41fa"
},
"_source": "git://github.com/PolymerElements/paper-dropdown-menu.git",
"_target": "~1.0.1",
"_originalSource": "PolymerElements/paper-dropdown-menu",
"_direct": true
}

View file

@ -0,0 +1 @@
bower_components

View file

@ -0,0 +1,43 @@
{
"name": "paper-dropdown-menu",
"version": "1.0.1",
"description": "An element that works similarly to a native browser select",
"authors": [
"The Polymer Authors"
],
"keywords": [
"web-components",
"web-component",
"polymer",
"dropdown",
"select"
],
"main": "paper-dropdown-menu.html",
"private": true,
"repository": {
"type": "git",
"url": "git://github.com/PolymerElements/paper-dropdown-menu"
},
"license": "http://polymer.github.io/LICENSE.txt",
"homepage": "https://github.com/PolymerElements/paper-dropdown-menu",
"dependencies": {
"polymer": "polymer/polymer#^1.0.0",
"iron-a11y-keys-behavior": "polymerelements/iron-a11y-keys-behavior#^1.0.0",
"iron-icon": "polymerelements/iron-icon#^1.0.0",
"iron-icons": "polymerelements/iron-icons#^1.0.0",
"paper-input": "polymerelements/paper-input#^1.0.9",
"paper-menu-button": "polymerelements/paper-menu-button#^1.0.0",
"paper-ripple": "polymerelements/paper-ripple#^1.0.0",
"paper-styles": "polymerelements/paper-styles#^1.0.0"
},
"devDependencies": {
"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",
"paper-item": "polymerelements/paper-item#^1.0.0",
"paper-menu": "polymerelements/paper-menu#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"web-component-tester": "*",
"paper-tabs": "polymerelements/paper-tabs#^1.0.0"
}
}

View file

@ -0,0 +1,176 @@
<!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 http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>paper-dropdown-menu demo</title>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../../iron-icons/iron-icons.html">
<link rel="import" href="../../iron-icon/iron-icon.html">
<link rel="import" href="../../paper-menu/paper-menu.html">
<link rel="import" href="../../paper-item/paper-item.html">
<link rel="import" href="../../paper-button/paper-button.html">
<link rel="import" href="../../paper-styles/demo-pages.html">
<link rel="import" href="../../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-dropdown-menu.html">
<style>
paper-menu {
display: block;
}
paper-dropdown-menu {
text-align: left;
margin: auto;
width: 180px;
}
paper-dropdown-menu.letters {
width: 90px;
}
paper-tabs {
width: 400px;
}
.horizontal-section {
text-align: center;
}
</style>
</head>
<body>
<template id="Demo" is="dom-bind">
<div class="horizontal-section-container">
<div>
<h4>Basic Menu</h4>
<div class="horizontal-section">
<paper-dropdown-menu label="Dinosaurs">
<paper-menu class="dropdown-content">
<template is="dom-repeat" items="[[dinosaurs]]" as="dinosaur">
<paper-item>[[dinosaur]]</paper-item>
</template>
</paper-menu>
</paper-dropdown-menu>
</div>
</div>
</div>
<div class="horizontal-section-container">
<div>
<h4>Disabled</h4>
<div class="horizontal-section">
<paper-dropdown-menu disabled label="Disabled">
<paper-menu class="dropdown-content">
<template is="dom-repeat" items="[[letters]]" as="letter">
<paper-item>[[letter]]</paper-item>
</template>
</paper-menu>
</paper-dropdown-menu>
</div>
</div>
</div>
<div class="horizontal-section-container">
<div>
<h4>Alternative Content</h4>
<div class="horizontal-section">
<paper-dropdown-menu label="Menu tabs!?">
<paper-tabs class="dropdown-content">
<template is="dom-repeat" items="[[letters]]" as="letter">
<paper-tab>[[letter]]</paper-tab>
</template>
</paper-tabs>
</paper-dropdown-menu>
</div>
</div>
</div>
<div class="horizontal-section-container">
<div>
<h4>No Label Float</h4>
<div class="horizontal-section">
<paper-dropdown-menu class="letters" label="Letters" no-label-float>
<paper-menu class="dropdown-content">
<template is="dom-repeat" items="[[letters]]" as="letter">
<paper-item>[[letter]]</paper-item>
</template>
</paper-menu>
</paper-dropdown-menu>
</div>
</div>
</div>
<div class="horizontal-section-container">
<div>
<h4>No Ripple, No Animations</h4>
<div class="horizontal-section">
<paper-dropdown-menu label="Dinosaurs" noink no-animations>
<paper-menu class="dropdown-content">
<template is="dom-repeat" items="[[dinosaurs]]" as="dinosaur">
<paper-item>[[dinosaur]]</paper-item>
</template>
</paper-menu>
</paper-dropdown-menu>
</div>
</div>
</div>
</template>
<script>
Demo.letters = [
'alpha',
'beta',
'gamma',
'delta',
'epsilon'
];
Demo.dinosaurs = [
'allosaurus',
'brontosaurus',
'carcharodontosaurus',
'diplodocus',
'ekrixinatosaurus',
'fukuiraptor',
'gallimimus',
'hadrosaurus',
'iguanodon',
'jainosaurus',
'kritosaurus',
'liaoceratops',
'megalosaurus',
'nemegtosaurus',
'ornithomimus',
'protoceratops',
'quetecsaurus',
'rajasaurus',
'stegosaurus',
'triceratops',
'utahraptor',
'vulcanodon',
'wannanosaurus',
'xenoceratops',
'yandusaurus',
'zephyrosaurus'
];
</script>
</body>
</html>

View file

@ -0,0 +1,24 @@
<!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
The complete set of authors may be found at http://polymer.github.io/AUTHORS
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
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
-->
<html>
<head>
<title>paper-dropdown-menu</title>
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../iron-component-page/iron-component-page.html">
</head>
<body>
<iron-component-page></iron-component-page>
</body>
</html>

View file

@ -0,0 +1,332 @@
<!--
@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="../paper-styles/default-theme.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../paper-menu-button/paper-menu-button.html">
<link rel="import" href="../paper-ripple/paper-ripple.html">
<link rel="import" href="../iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
<link rel="import" href="../iron-behaviors/iron-control-state.html">
<link rel="import" href="../iron-behaviors/iron-button-state.html">
<link rel="import" href="../iron-icons/iron-icons.html">
<link rel="import" href="../iron-icon/iron-icon.html">
<link rel="import" href="../iron-selector/iron-selectable.html">
<!--
`paper-dropdown-menu` is similar to a native browser select element.
`paper-dropdown-menu` works with selectable content. The currently selected
item is displayed in the control. If no item is selected, the `label` is
displayed instead.
The child element with the class `dropdown-content` will be used as the dropdown
menu. It could be a `paper-menu` or element that triggers `iron-activate` when
selecting its children.
Example:
<paper-dropdown-menu label="Your favourite pastry">
<paper-menu class="dropdown-content">
<paper-item>Croissant</paper-item>
<paper-item>Donut</paper-item>
<paper-item>Financier</paper-item>
<paper-item>Madeleine</paper-item>
</paper-menu>
</paper-dropdown-menu>
This example renders a dropdown menu with 4 options.
### Styling
The following custom properties and mixins are also available for styling:
Custom property | Description | Default
----------------|-------------|----------
`--paper-dropdown-menu` | A mixin that is applied to the element host | `{}`
`--paper-dropdown-menu-disabled` | A mixin that is applied to the element host when disabled | `{}`
`--paper-dropdown-menu-ripple` | A mixin that is applied to the internal ripple | `{}`
`--paper-dropdown-menu-button` | A mixin that is applied to the internal menu button | `{}`
`--paper-dropdown-menu-input` | A mixin that is applied to the internal paper input | `{}`
`--paper-dropdown-menu-icon` | A mixin that is applied to the internal icon | `{}`
You can also use any of the `paper-input-container` and `paper-menu-button`
style mixins and custom properties to style the internal input and menu button
respectively.
@group Paper Elements
@element paper-dropdown-menu
@hero hero.svg
@demo demo/index.html
-->
<dom-module id="paper-dropdown-menu">
<style>
:host {
display: inline-block;
position: relative;
text-align: left;
cursor: pointer;
--paper-input-container-input: {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 100%;
box-sizing: border-box;
cursor: pointer;
};
@apply(--paper-dropdown-menu);
}
:host([disabled]) {
@apply(--paper-dropdown-menu-disabled);
}
:host([noink]) paper-ripple {
display: none;
}
:host([no-label-float]) paper-ripple {
top: 8px;
}
paper-ripple {
top: 20px;
left: 8px;
bottom: 16px;
right: 8px;
@apply(--paper-dropdown-menu-ripple);
}
paper-menu-button {
@apply(--paper-dropdown-menu-button);
}
paper-input {
@apply(--paper-dropdown-menu-input);
}
iron-icon {
color: var(--disabled-text-color);
@apply(--paper-dropdown-menu-icon);
}
</style>
<template>
<paper-menu-button
id="menuButton"
vertical-align="top"
horizontal-align="right"
vertical-offset="[[_computeMenuVerticalOffset(noLabelFloat)]]"
disabled="[[disabled]]"
no-animations="[[noAnimations]]"
on-iron-activate="_onIronActivate"
opened="{{opened}}">
<div class="dropdown-trigger">
<paper-ripple></paper-ripple>
<paper-input
readonly
disabled="[[disabled]]"
value="[[selectedItemLabel]]"
placeholder="[[placeholder]]"
always-float-label="[[alwaysFloatLabel]]"
no-label-float="[[noLabelFloat]]"
label="[[label]]">
<iron-icon icon="arrow-drop-down" suffix></iron-icon>
</paper-input>
</div>
<div class="dropdown-content">
<content select=".dropdown-content"></content>
</div>
</paper-menu-button>
</template>
</dom-module>
<script>
(function() {
'use strict';
Polymer({
is: 'paper-dropdown-menu',
/**
* Fired when the dropdown opens.
*
* @event paper-dropdown-open
*/
/**
* Fired when the dropdown closes.
*
* @event paper-dropdown-close
*/
behaviors: [
Polymer.IronControlState,
Polymer.IronButtonState
],
properties: {
/**
* The derived "label" of the currently selected item. This value
* is the `label` property on the selected item if set, or else the
* trimmed text content of the selected item.
*/
selectedItemLabel: {
type: String,
notify: true,
computed: '_computeSelectedItemLabel(selectedItem)'
},
/**
* The last selected item. An item is selected if the dropdown menu has
* a child with class `dropdown-content`, and that child triggers an
* `iron-activate` event with the selected `item` in the `detail`.
*/
selectedItem: {
type: Object,
notify: true,
readOnly: true
},
/**
* The label for the dropdown.
*/
label: {
type: String
},
/**
* The placeholder for the dropdown.
*/
placeholder: {
type: String
},
/**
* True if the dropdown is open. Otherwise, false.
*/
opened: {
type: Boolean,
notify: true,
value: false
},
/**
* Set to true to disable the floating label. Bind this to the
* `<paper-input-container>`'s `noLabelFloat` property.
*/
noLabelFloat: {
type: Boolean,
value: false,
reflectToAttribute: true
},
/**
* Set to true to always float the label. Bind this to the
* `<paper-input-container>`'s `alwaysFloatLabel` property.
*/
alwaysFloatLabel: {
type: Boolean,
value: false
},
/**
* Set to true to disable animations when opening and closing the
* dropdown.
*/
noAnimations: {
type: Boolean,
value: false
}
},
listeners: {
'tap': '_onTap'
},
keyBindings: {
'up down': 'open',
'esc': 'close'
},
hostAttributes: {
role: 'group',
'aria-haspopup': 'true'
},
/**
* Show the dropdown content.
*/
open: function() {
this.$.menuButton.open();
},
/**
* Hide the dropdown content.
*/
close: function() {
this.$.menuButton.close();
},
/**
* A handler that is called when `iron-activate` is fired.
*
* @param {CustomEvent} event An `iron-activate` event.
*/
_onIronActivate: function(event) {
this._setSelectedItem(event.detail.item);
},
/**
* A handler that is called when the dropdown is tapped.
*
* @param {CustomEvent} event A tap event.
*/
_onTap: function(event) {
if (Polymer.Gestures.findOriginalTarget(event) === this) {
this.open();
}
},
/**
* Compute the label for the dropdown given a selected item.
*
* @param {Element} selectedItem A selected Element item, with an
* optional `label` property.
*/
_computeSelectedItemLabel: function(selectedItem) {
if (!selectedItem) {
return '';
}
return selectedItem.label || selectedItem.textContent.trim();
},
/**
* Compute the vertical offset of the menu based on the value of
* `noLabelFloat`.
*
* @param {boolean} noLabelFloat True if the label should not float
* above the input, otherwise false.
*/
_computeMenuVerticalOffset: function(noLabelFloat) {
// NOTE(cdata): These numbers are somewhat magical because they are
// derived from the metrics of elements internal to `paper-input`'s
// template. The metrics will change depending on whether or not the
// input has a floating label.
return noLabelFloat ? -4 : 16;
}
});
})();
</script>

View 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-dropdown-menu tests</title>
<script src="../../web-component-tester/browser.js"></script>
</head>
<body>
<script>
WCT.loadSuites([
'paper-dropdown-menu.html'
]);
</script>
</body>
</html>

View file

@ -0,0 +1,104 @@
<!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-dropdown-menu 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="../../paper-menu/paper-menu.html">
<link rel="import" href="../../paper-item/paper-item.html">
<link rel="import" href="../../test-fixture/test-fixture.html">
<link rel="import" href="../paper-dropdown-menu.html">
</head>
<body>
<test-fixture id="TrivialDropdownMenu">
<template>
<paper-dropdown-menu no-animations>
<paper-menu class="dropdown-content">
<paper-item>Foo</paper-item>
<paper-item>Bar</paper-item>
</paper-menu>
</paper-dropdown-menu>
</template>
</test-fixture>
<script>
suite('<paper-dropdown-menu>', function() {
var dropdownMenu;
setup(function() {
dropdownMenu = fixture('TrivialDropdownMenu');
content = Polymer.dom(dropdownMenu).querySelector('.dropdown-content');
});
test('opens when tapped', function(done) {
var contentRect = content.getBoundingClientRect();
expect(contentRect.width).to.be.equal(0);
expect(contentRect.height).to.be.equal(0);
MockInteractions.tap(dropdownMenu);
expect(dropdownMenu.opened).to.be.equal(true);
Polymer.Base.async(function() {
contentRect = content.getBoundingClientRect();
expect(dropdownMenu.opened).to.be.equal(true);
expect(contentRect.width).to.be.greaterThan(0);
expect(contentRect.height).to.be.greaterThan(0);
done();
});
});
test('closes when an item is activated', function(done) {
MockInteractions.tap(dropdownMenu);
Polymer.Base.async(function() {
var firstItem = Polymer.dom(content).querySelector('paper-item');
MockInteractions.tap(firstItem);
Polymer.Base.async(function() {
expect(dropdownMenu.opened).to.be.equal(false);
done();
});
});
});
test('sets selected item to the activated item', function(done) {
MockInteractions.tap(dropdownMenu);
Polymer.Base.async(function() {
var firstItem = Polymer.dom(content).querySelector('paper-item');
MockInteractions.tap(firstItem);
Polymer.Base.async(function() {
expect(dropdownMenu.selectedItem).to.be.equal(firstItem);
done();
});
});
});
});
</script>
</body>
</html>