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

update script loading

This commit is contained in:
Luke Pulverenti 2015-12-03 22:59:48 -05:00
parent 31b3061157
commit 22f689e089
65 changed files with 732 additions and 6138 deletions

View file

@ -39,6 +39,6 @@
"commit": "cec8e49744a1e18b14a711eea77e201bb70de544"
},
"_source": "git://github.com/desandro/doc-ready.git",
"_target": "~1.0.4",
"_target": "1.0.x",
"_originalSource": "doc-ready"
}

View file

@ -31,6 +31,6 @@
"commit": "34fc5e4a0f252964ed2790138b8d7d30d04b55c1"
},
"_source": "git://github.com/desandro/get-style-property.git",
"_target": "~1.0.4",
"_target": "1.x",
"_originalSource": "get-style-property"
}

View file

@ -1,6 +1,6 @@
{
"name": "iron-media-query",
"version": "1.0.7",
"version": "1.0.8",
"description": "Lets you bind to a CSS media query",
"authors": [
"The Polymer Authors"
@ -29,11 +29,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"main": "iron-media-query.html",
"_release": "1.0.7",
"_release": "1.0.8",
"_resolution": {
"type": "version",
"tag": "v1.0.7",
"commit": "a78cdbadb6de48857d176b964ab906a12872f2d3"
"tag": "v1.0.8",
"commit": "3f916be171af7a3e03eb019acdfea71055d3c744"
},
"_source": "git://github.com/PolymerElements/iron-media-query.git",
"_target": "^1.0.0",

View file

@ -11,7 +11,7 @@ env:
- secure: LgnZP4BNGBkTZhf8Vr7r9LdrOwq2/58TqqYkFFloEGBRT6HmumNSRwNbIwOh1U9jSTVkqjC2rn4G27u4XlEIs+QTD2PVSSEKy7Vbn0KxSNCvCGaOB1ZaxWTwZa7nkg09ZFRCHGh+WIbuV+BxyzsjOqlN82GSzFNSb3rxhqDM6dU=
node_js: 4
addons:
firefox: '42.0'
firefox: latest
apt:
sources:
- google-chrome

View file

@ -1,6 +1,6 @@
{
"name": "iron-media-query",
"version": "1.0.7",
"version": "1.0.8",
"description": "Lets you bind to a CSS media query",
"authors": [
"The Polymer Authors"

View file

@ -1,11 +1,11 @@
<!doctype html>
<!--
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
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
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>

View file

@ -58,25 +58,26 @@ Example:
type: Boolean,
value: false
},
/**
* @type {function(MediaQueryList)}
*/
*/
_boundMQHandler: {
value: function() {
return this.queryHandler.bind(this);
}
},
/**
* @type {MediaQueryList}
*/
*/
_mq: {
value: null
}
},
attached: function() {
this.style.display = 'none';
this.queryChanged();
},

View file

@ -1,15 +1,11 @@
<!doctype html>
<!--
<!DOCTYPE html><!--
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>
--><html><head>
<meta charset="utf-8">
<title>Tests</title>
@ -19,12 +15,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<body>
<script>
WCT.loadSuites([
'basic.html'
'basic.html',
'basic.html?dom=shadow'
]);
</script>
</body>
</html>
</body></html>

View file

@ -36,7 +36,7 @@
"tag": "v1.0.8",
"commit": "e9a66727f3da0446f04956d4e4f1dcd51cdec2ff"
},
"_source": "git://github.com/polymerelements/iron-selector.git",
"_source": "git://github.com/PolymerElements/iron-selector.git",
"_target": "^1.0.0",
"_originalSource": "polymerelements/iron-selector"
"_originalSource": "PolymerElements/iron-selector"
}

View file

@ -0,0 +1,46 @@
{
"name": "paper-collapse-item",
"version": "1.0.5",
"authors": [
"collaborne"
],
"description": "A Material Design item with header and collapsible content (Polymer 1.x)",
"main": "paper-collapse-item.html",
"keywords": [
"web-components",
"polymer",
"paper",
"material design",
"lists",
"item"
],
"license": "Apache 2",
"homepage": "http://www.apache.org/licenses/LICENSE-2.0",
"ignore": [
"**/.*"
],
"dependencies": {
"polymer": "Polymer/polymer#^1.0.0",
"iron-icon": "PolymerElements/iron-icon#^1.0.0",
"iron-icons": "PolymerElements/iron-icons#^1.0.0",
"iron-collapse": "PolymerElements/iron-collapse#^1.0.0",
"paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0",
"paper-item": "PolymerElements/paper-item#^1.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0"
},
"devDependencies": {
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"_release": "1.0.5",
"_resolution": {
"type": "version",
"tag": "1.0.5",
"commit": "26aef07fcfd1c09265916f6a384cb2adfbb34727"
},
"_source": "git://github.com/Collaborne/paper-collapse-item.git",
"_target": "~1.0.5",
"_originalSource": "paper-collapse-item",
"_direct": true
}

View file

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -0,0 +1,36 @@
{
"name": "paper-collapse-item",
"version": "1.0.5",
"authors": [
"collaborne"
],
"description": "A Material Design item with header and collapsible content (Polymer 1.x)",
"main": "paper-collapse-item.html",
"keywords": [
"web-components",
"polymer",
"paper",
"material design",
"lists",
"item"
],
"license": "Apache 2",
"homepage": "http://www.apache.org/licenses/LICENSE-2.0",
"ignore": [
"**/.*"
],
"dependencies": {
"polymer": "Polymer/polymer#^1.0.0",
"iron-icon": "PolymerElements/iron-icon#^1.0.0",
"iron-icons": "PolymerElements/iron-icons#^1.0.0",
"iron-collapse": "PolymerElements/iron-collapse#^1.0.0",
"paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0",
"paper-item": "PolymerElements/paper-item#^1.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0"
},
"devDependencies": {
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}
}

View file

@ -0,0 +1,19 @@
<html>
<head>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../../iron-icons/iron-icons.html">
<link rel="import" href="../paper-collapse-item.html">
</head>
<body>
<paper-collapse-item icon="icons:favorite" header="Item 1" opened>
Lots of very interesting content.
</paper-collapse-item>
<paper-collapse-item icon="icons:info" header="Item 2">
Lots of very interesting content.
</paper-collapse-item>
<paper-collapse-item icon="icons:help" header="Item 3">
Lots of very interesting content.
</paper-collapse-item>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View file

@ -0,0 +1,83 @@
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../iron-icon/iron-icon.html">
<link rel="import" href="../iron-collapse/iron-collapse.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../paper-item/paper-item.html">
<link rel="import" href="../paper-item/paper-item-body.html">
<link rel="import" href="../paper-styles/paper-styles.html">
<dom-module id='paper-collapse-item'>
<template>
<style>
.header {
min-height: 48px;
opacity: var(--dark-primary-opacity);
@apply(--layout-horizontal);
@apply(--layout-center-center);
@apply(--paper-font-subhead);
}
.icon {
margin-right: 24px;
--iron-icon-height: 32px;
--iron-icon-width: 32px;
}
.icon,.toogle {
opacity: var(--dark-disabled-opacity);
}
.content {
opacity: var(--dark-primary-opacity);
@apply(--paper-font-body1);
}
</style>
<paper-item on-tap="_toggleOpened">
<paper-item-body>
<div class="header">
<iron-icon class='icon' icon=[[icon]]></iron-icon>
<div class="flex">[[header]]</div>
<paper-icon-button class='toogle' icon=[[_toggleIcon]]></paper-icon-button>
</div>
<iron-collapse class="content" opened={{opened}}>
<content></content>
</iron-collapse>
</paper-item-body>
</paper-item>
</template>
</dom-module>
<script>
(function() {
Polymer({
is: 'paper-collapse-item',
properties: {
header: String,
icon: String,
opened: Boolean,
_toggleIcon: {
type: String,
computed: '_computeToggleIcon(opened)'
}
},
// Private methods
_toggleOpened: function(e) {
this.opened = !this.opened;
},
_computeToggleIcon: function(opened) {
return opened ? "icons:expand-less" : "icons:expand-more";
}
});
})();
</script>

View file

@ -0,0 +1,13 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Tests</title>
<script src="../../web-component-tester/browser.js"></script>
</head>
<body>
<script>
WCT.loadSuites([ 'paper-collapse-item.html' ]);
</script>
</body>
</html>

View file

@ -0,0 +1,50 @@
<!doctype html>
<html>
<head>
<title>paper-collapse-item</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-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>
<link rel="import" href="../paper-collapse-item.html">
<link rel="import" href="../../test-fixture/test-fixture.html">
</head>
<body>
<test-fixture id="TrivialElement">
<template>
<paper-collapse-item></paper-collapse-item>
</template>
</test-fixture>
<script>
suite('<paper-collapse-item>', function() {
suite('open/close behavior', function() {
var element;
setup(function() {
element = fixture('TrivialElement');
});
test('defaults to closed', function() {
expect(element.opened).to.be.eql(false);
});
test('shows open toggle icon when closed', function() {
element.opened = false;
expect(element._toggleIcon).to.be.eql('icons:expand-more');
});
test('shows open toggle icon when opened', function() {
element.opened = true;
expect(element._toggleIcon).to.be.eql('icons:expand-less');
});
});
});
</script>
</body>
</html>

View file

@ -1,6 +1,6 @@
{
"name": "paper-input",
"version": "1.1.1",
"version": "1.1.2",
"description": "Material design text fields",
"authors": [
"The Polymer Authors"
@ -32,7 +32,8 @@
"iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
"iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0",
"iron-input": "PolymerElements/iron-input#^1.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0"
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
"iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^1.0.0"
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
@ -44,11 +45,11 @@
"web-component-tester": "Polymer/web-component-tester#^3.3.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"_release": "1.1.1",
"_release": "1.1.2",
"_resolution": {
"type": "version",
"tag": "v1.1.1",
"commit": "1bbce220b027dc030b294163f7da6f3e9052ab13"
"tag": "v1.1.2",
"commit": "6c6ba4b5e3e4b18ee387d2b922e00e3edfe0e347"
},
"_source": "git://github.com/polymerelements/paper-input.git",
"_target": "^1.0.9",

View file

@ -11,7 +11,7 @@ env:
- secure: nh65tvhnhOrK05qKvDJKMV7Jm9yiCoG1wFkP3ZnqOHix9Ny+KmcTa41Bl6NXQdvYaMTFtzS7lMZX5cqIziyKyGWHVN30LzGMHJNz12fhcMi3nJ84trhQGcu/9qR9yDv16q9ouGlcz1VxnDOHaRAHnIKjLIbhN3aJtMtZBbnWihA=
node_js: 4
addons:
firefox: '42.0'
firefox: latest
apt:
sources:
- google-chrome

View file

@ -1,6 +1,6 @@
{
"name": "paper-input",
"version": "1.1.1",
"version": "1.1.2",
"description": "Material design text fields",
"authors": [
"The Polymer Authors"
@ -32,7 +32,8 @@
"iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
"iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0",
"iron-input": "PolymerElements/iron-input#^1.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0"
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
"iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^1.0.0"
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",

View file

@ -56,6 +56,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<div class="vertical center-justified layout">
<h4>Text input</h4>
<div class="vertical-section">
<paper-input label="label"></paper-input>
@ -90,7 +91,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<paper-textarea label="textarea" char-counter></paper-textarea>
<paper-textarea label="textarea with maxlength" char-counter maxlength="10"></paper-textarea>
<paper-textarea label="textarea with maxlength" maxlength="10" char-counter></paper-textarea>
<paper-textarea label="text area with rows and max-rows" rows="3" max-rows="4"></paper-textarea>
</div>
@ -108,7 +109,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<paper-input class="short" label="icons and buttons" id="inputWithButton">
<iron-icon icon="search" prefix></iron-icon>
<paper-icon-button suffix onclick="clearInput()"
icon="clear" alt="clear" title="clear" tabindex="0">
icon="clear" alt="clear" title="clear">
</paper-icon-button>
</paper-input>
</div>

View file

@ -9,6 +9,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
-->
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../iron-behaviors/iron-control-state.html">
<link rel="import" href="../iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
<script>
@ -32,7 +33,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
*/
/**
* The label for this input. Bind this to `<paper-input-container>`'s `label` property.
* The label for this input. Bind this to `<label>`'s content and `hidden` property, e.g.
* `<label hidden$="[[!label]]">[[label]]</label>` in your `template`
*/
label: {
type: String
@ -287,21 +289,21 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
/**
* Bind this to the `<input is="iron-input">`'s `results` property, , used with type=search.
* Bind this to the `<input is="iron-input">`'s `results` property, used with type=search.
*/
results: {
type: Number
},
/**
* Bind this to the `<input is="iron-input">`'s `accept` property, , used with type=file.
* Bind this to the `<input is="iron-input">`'s `accept` property, used with type=file.
*/
accept: {
type: String
},
/**
* Bind this to the `<input is="iron-input">`'s `multiple` property, , used with type=file.
* Bind this to the `<input is="iron-input">`'s `multiple` property, used with type=file.
*/
multiple: {
type: Boolean
@ -320,13 +322,22 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
listeners: {
'addon-attached': '_onAddonAttached'
'addon-attached': '_onAddonAttached',
'focus': '_onFocus'
},
observers: [
'_focusedControlStateChanged(focused)'
],
keyBindings: {
'shift+tab:keydown': '_onShiftTabDown'
},
hostAttributes: {
tabindex: 0
},
/**
* Returns a reference to the input element.
*/
@ -334,6 +345,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
return this.$.input;
},
/**
* Returns a reference to the focusable element.
*/
get _focusableElement() {
return this.inputElement;
},
attached: function() {
this._updateAriaLabelledBy();
},
@ -367,6 +385,29 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
return this.inputElement.validate();
},
/**
* Forward focus to inputElement
*/
_onFocus: function() {
if (!this._shiftTabPressed) {
this._focusableElement.focus();
}
},
/**
* Handler that is called when a shift+tab keypress is detected by the menu.
*
* @param {CustomEvent} event A key combination event.
*/
_onShiftTabDown: function(event) {
var oldTabIndex = this.getAttribute('tabindex');
this._shiftTabPressed = true;
this.setAttribute('tabindex', '-1');
this.async(function() {
this.setAttribute('tabindex', oldTabIndex);
this._shiftTabPressed = false;
}, 1);
},
/**
* If `autoValidate` is true, then validates the element.
*/
@ -451,6 +492,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
};
/** @polymerBehavior */
Polymer.PaperInputBehavior = [Polymer.IronControlState, Polymer.PaperInputBehaviorImpl];
Polymer.PaperInputBehavior = [
Polymer.IronControlState,
Polymer.IronA11yKeysBehavior,
Polymer.PaperInputBehaviorImpl
];
</script>

View file

@ -83,7 +83,7 @@ Custom property | Description | Default
`--paper-input-container-label-focus` | Mixin applied to the label when the input is focused | `{}`
`--paper-input-container-input` | Mixin applied to the input | `{}`
`--paper-input-container-underline` | Mixin applied to the underline | `{}`
`--paper-input-container-underline-focus` | Mixin applied to the underline when the input is focued | `{}`
`--paper-input-container-underline-focus` | Mixin applied to the underline when the input is focused | `{}`
`--paper-input-container-underline-disabled` | Mixin applied to the underline when the input is disabled | `{}`
`--paper-input-prefix` | Mixin applied to the input prefix | `{}`
`--paper-input-suffix` | Mixin applied to the input suffix | `{}`
@ -179,7 +179,7 @@ This element is `display:block` by default, but you can set the `inline` attribu
.input-content {
position: relative;
@apply(--layout-horizontal);
@apply(--layout-end);
@apply(--layout-center);
}
.input-content ::content label,

View file

@ -48,11 +48,17 @@ as to not overlap the native UI (search icon, file button, etc.).
See `Polymer.PaperInputBehavior` for more API docs.
### Focus
To focus a paper-input, you can call the native `focus()` method as long as the
paper input has a tab index.
### Styling
See `Polymer.PaperInputContainer` for a list of custom properties used to
style this element.
@group Paper Elements
@element paper-input
@hero hero.svg
@ -118,6 +124,7 @@ style this element.
autocapitalize$="[[autocapitalize]]"
autocorrect$="[[autocorrect]]"
on-change="_onChange"
tabindex$="[[tabindex]]"
autosave$="[[autosave]]"
results$="[[results]]"
accept$="[[accept]]"
@ -144,8 +151,7 @@ style this element.
behaviors: [
Polymer.IronFormElementBehavior,
Polymer.PaperInputBehavior,
Polymer.IronControlState
Polymer.PaperInputBehavior
]
});
</script>

View file

@ -123,6 +123,10 @@ style this element.
_ariaDescribedByChanged: function(ariaDescribedBy) {
this.$.input.textarea.setAttribute('aria-describedby', ariaDescribedBy);
}
},
get _focusableElement() {
return this.$.input.textarea;
},
});
</script>

View file

@ -1,14 +1,11 @@
<!doctype html>
<!--
<!DOCTYPE html><!--
Copyright (c) 2014 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>
--><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-input tests</title>
@ -21,8 +18,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
'paper-textarea.html',
'paper-input-container.html',
'paper-input-error.html',
'paper-input-char-counter.html'
'paper-input-char-counter.html',
'paper-input.html?dom=shadow',
'paper-textarea.html?dom=shadow',
'paper-input-container.html?dom=shadow',
'paper-input-error.html?dom=shadow',
'paper-input-char-counter.html?dom=shadow'
]);
</script>
</body>
</html>
</body></html>

View file

@ -37,6 +37,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</template>
</test-fixture>
<test-fixture id="has-tabindex">
<template>
<paper-input tabindex="0"></paper-input>
</template>
</test-fixture>
<test-fixture id="label">
<template>
<paper-input label="foo"></paper-input>
@ -211,7 +217,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
suite('validation', function() {
test('invalid attribute updated after calling validate()', function() {
@ -255,6 +260,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
assert.equal(input.inputElement.getAttribute('aria-describedby'), Polymer.dom(input.root).querySelector('paper-input-error').id + ' ' + Polymer.dom(input.root).querySelector('paper-input-char-counter').id, 'aria-describedby points to the error message and character counter');
});
test('focus an input with tabindex', function(done) {
var input = fixture('has-tabindex');
flush(function() {
MockInteractions.focus(input);
flush(function() {
assert.equal(input.shadowRoot ? input.shadowRoot.activeElement :
document.activeElement, input._focusableElement);
done();
});
});
});
});
</script>

View file

@ -36,6 +36,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</template>
</test-fixture>
<test-fixture id="has-tabindex">
<template>
<paper-textarea tabindex="0"></paper-input>
</template>
</test-fixture>
<test-fixture id="label">
<template>
<paper-textarea label="foo"></paper-textarea>
@ -128,7 +134,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
var inputContent = Polymer.dom(container.root).querySelector('.input-content');
assert.isTrue(inputContent.classList.contains('label-is-floating'), 'label is floating');
});
});
suite('focus/blur events', function() {
@ -155,6 +160,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
assert.isTrue(nBlurEvents >= 1, 'blur event fired')
});
test('focus a textarea with tabindex', function(done) {
var input = fixture('has-tabindex');
flush(function() {
assert.notEqual(document.activeElement, input._focusableElement);
MockInteractions.focus(input);
setTimeout(function() {
assert.equal(document.activeElement, input.shadowRoot ? input : input._focusableElement);
done();
}, 1);
})
});
});
suite('a11y', function() {
@ -186,7 +202,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
assert.equal(input.inputElement.textarea.getAttribute('aria-describedby'), Polymer.dom(input.root).querySelector('paper-input-error').id + ' ' + Polymer.dom(input.root).querySelector('paper-input-char-counter').id, 'aria-describedby points to the error message and character counter');
});
});

View file

@ -32,14 +32,14 @@
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0"
},
"ignore": [],
"homepage": "https://github.com/PolymerElements/paper-ripple",
"homepage": "https://github.com/polymerelements/paper-ripple",
"_release": "1.0.5",
"_resolution": {
"type": "version",
"tag": "v1.0.5",
"commit": "d72e7a9a8ab518b901ed18dde492df3b87a93be5"
},
"_source": "git://github.com/PolymerElements/paper-ripple.git",
"_source": "git://github.com/polymerelements/paper-ripple.git",
"_target": "^1.0.0",
"_originalSource": "PolymerElements/paper-ripple"
"_originalSource": "polymerelements/paper-ripple"
}