update components

This commit is contained in:
Luke Pulverenti 2016-03-10 15:07:23 -05:00
parent 411b85f351
commit 709f0726da
8 changed files with 108 additions and 58 deletions

View File

@ -16,12 +16,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.1.31",
"_release": "1.1.31",
"version": "1.1.32",
"_release": "1.1.32",
"_resolution": {
"type": "version",
"tag": "1.1.31",
"commit": "23e283143ce4f084d28a5af10048d53caa23e9be"
"tag": "1.1.32",
"commit": "0aa9676c2790f9ac6cb32f259d750079cf89ae0c"
},
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "~1.1.5",

View File

@ -95,6 +95,8 @@
browser.xboxOne = userAgent.toLowerCase().indexOf('xbox') != -1;
browser.animate = document.documentElement.animate != null;
browser.tizen = userAgent.toLowerCase().indexOf('tizen') != -1;
browser.webos = userAgent.toLowerCase().indexOf('webos') != -1;
browser.tv = isTv();

View File

@ -91,9 +91,7 @@ define(['browser'], function (browser) {
return true;
}
var userAgent = navigator.userAgent.toLowerCase();
if (userAgent.indexOf('samsungbrowser') != -1) {
if (browser.tizen) {
return true;
}
@ -102,47 +100,66 @@ define(['browser'], function (browser) {
function testCanPlayTs() {
// Unfortunately there's no real way to detect mkv support
var userAgent = navigator.userAgent.toLowerCase();
if (userAgent.indexOf('webos') != -1) {
return true;
}
if (userAgent.indexOf('samsungbrowser') != -1) {
return true;
}
return false;
return browser.tizen || browser.webos;
}
function testCanPlayWmv() {
function getDirectPlayProfileForVideoContainer(container) {
// Unfortunately there's no real way to detect mkv support
var userAgent = navigator.userAgent.toLowerCase();
var supported = false;
if (userAgent.indexOf('webos') != -1) {
return true;
switch (container) {
case '3gp':
case 'avi':
case 'asf':
case 'flv':
case 'mpg':
case 'mpeg':
case 'mts':
case 'trp':
case 'vob':
case 'vro':
supported = browser.tizen;
break;
case 'm2ts':
case 'wmv':
supported = browser.tizen || browser.webos;
break;
default:
break;
}
return false;
if (!supported) {
return null;
}
return {
Container: container,
Type: 'Video'
};
}
function testCanPlayM2ts() {
function getMaxBitrate() {
// Unfortunately there's no real way to detect mkv support
var userAgent = navigator.userAgent.toLowerCase();
if (userAgent.indexOf('webos') != -1) {
return true;
if (browser.tizen) {
// 2015 models
if (userAgent.indexOf('tizen 2.3') != -1) {
return 20000000;
}
// 2016 models
return 40000000;
}
return false;
return 100000000;
}
return function () {
var bitrateSetting = 100000000;
var bitrateSetting = getMaxBitrate();
var videoTestElement = document.createElement('video');
@ -223,22 +240,14 @@ define(['browser'], function (browser) {
});
}
if (testCanPlayWmv()) {
profile.DirectPlayProfiles.push({
Container: 'wmv',
Type: 'Video',
VideoCodec: 'h264'
});
}
// These are formats we can't test for but some devices will support
['m2ts', 'wmv'].map(getDirectPlayProfileForVideoContainer).filter(function (i) {
return i != null;
if (testCanPlayM2ts()) {
profile.DirectPlayProfiles.push({
Container: 'm2ts',
Type: 'Video',
VideoCodec: 'h264',
AudioCodec: videoAudioCodecs.join(',')
});
}
}).forEach(function (i) {
profile.DirectPlayProfiles.push(i);
});
['opus', 'mp3', 'aac', 'flac', 'webma'].filter(canPlayAudioFormat).forEach(function (audioFormat) {

View File

@ -1,6 +1,6 @@
{
"name": "paper-input",
"version": "1.1.9",
"version": "1.1.10",
"description": "Material design text fields",
"authors": [
"The Polymer Authors"
@ -39,6 +39,7 @@
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"iron-icon": "PolymerElements/iron-icon#^1.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
"iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
@ -47,11 +48,11 @@
"web-component-tester": "^4.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"_release": "1.1.9",
"_release": "1.1.10",
"_resolution": {
"type": "version",
"tag": "v1.1.9",
"commit": "4cb91098977573135b74121d6f4a2a301f44ce93"
"tag": "v1.1.10",
"commit": "d8e201099b4b2987bea1dbcf5804c0383544bbfd"
},
"_source": "git://github.com/polymerelements/paper-input.git",
"_target": "^1.0.9",

View File

@ -1,6 +1,6 @@
{
"name": "paper-input",
"version": "1.1.9",
"version": "1.1.10",
"description": "Material design text fields",
"authors": [
"The Polymer Authors"
@ -39,6 +39,7 @@
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"iron-icon": "PolymerElements/iron-icon#^1.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
"iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",

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-input/iron-input.html">
<link rel="import" href="../../iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="ssn-validator.html">
<dom-module id="ssn-input">
@ -27,15 +28,23 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
width: auto;
text-align: center;
}
.container {
@apply(--layout-horizontal);
}
</style>
<ssn-validator></ssn-validator>
<input is="iron-input" maxlength="3" bind-value="{{_ssn1}}" size="3" aria-label="First 3 digits of social security number">
-
<input is="iron-input" maxlength="2" bind-value="{{_ssn2}}" size="2" aria-label="Middle 2 digits of social security number">
-
<input is="iron-input" maxlength="4" bind-value="{{_ssn3}}" size="4" aria-label="Last 4 digits of social security number">
<div class="container">
<input is="iron-input" maxlength="3" bind-value="{{_ssn1}}" size="3" aria-label="First 3 digits of social security number">
-
<input is="iron-input" maxlength="2" bind-value="{{_ssn2}}" size="2" aria-label="Middle 2 digits of social security number">
-
<input is="iron-input" maxlength="4" bind-value="{{_ssn3}}" size="4" aria-label="Last 4 digits of social security number">
</div>
</template>
</dom-module>

View File

@ -25,6 +25,9 @@ For example:
<input is="iron-input">
</paper-input-container>
Do not wrap <paper-input-contanter> around elements that already include it, such as <paper-input>.
Doing so may cause events to bounce infintely between the container and its contained element.
### Listening for input changes
By default, it listens for changes on the `bind-value` attribute on its children nodes and perform
@ -43,6 +46,11 @@ compound input field like a social security number input. The custom input eleme
<ssn-input class="paper-input-input"></ssn-input>
</paper-input-container>
If you're using a `<paper-input-container>` imperatively, it's important to make sure
that you attach its children (the `iron-input` and the optional `label`) before you
attach the `<paper-input-container>` itself, so that it can be set up correctly.
### Validation
If the `auto-validate` attribute is set, the input container will validate the input and update
@ -457,14 +465,15 @@ This element is `display:block` by default, but you can set the `inline` attribu
}
this.addEventListener('focus', this._boundOnFocus, true);
this.addEventListener('blur', this._boundOnBlur, true);
},
attached: function() {
if (this.attrForValue) {
this._inputElement.addEventListener(this._valueChangedEvent, this._boundValueChanged);
} else {
this.addEventListener('input', this._onInput);
}
},
attached: function() {
// Only validate when attached if the input already has a value.
if (this._inputElementValue != '') {
this._handleValueAndAutoValidate(this._inputElement);

View File

@ -129,6 +129,25 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
return style.transform || style.webkitTransform;
}
suite('basic', function() {
test('can be created imperatively', function() {
var container = document.createElement('paper-input-container');
var input = document.createElement('input', 'iron-input');
input.className = 'paper-input-input';
input.id = 'input';
var label = document.createElement('label');
label.innerHTML = 'label';
Polymer.dom(container).appendChild(label);
Polymer.dom(container).appendChild(input);
document.body.appendChild(container);
assert.isOk(container);
document.body.removeChild(container);
});
});
suite('label position', function() {
test('label is visible by default', function() {