mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
fe7276b4e4
commit
301033336a
18 changed files with 306 additions and 216 deletions
|
@ -30,6 +30,6 @@
|
||||||
"commit": "14d2ca3df97da64c820829a8310f9198fbafbcfa"
|
"commit": "14d2ca3df97da64c820829a8310f9198fbafbcfa"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/desandro/eventie.git",
|
"_source": "git://github.com/desandro/eventie.git",
|
||||||
"_target": "^1",
|
"_target": "~1.0.3",
|
||||||
"_originalSource": "eventie"
|
"_originalSource": "eventie"
|
||||||
}
|
}
|
|
@ -31,6 +31,6 @@
|
||||||
"commit": "34fc5e4a0f252964ed2790138b8d7d30d04b55c1"
|
"commit": "34fc5e4a0f252964ed2790138b8d7d30d04b55c1"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/desandro/get-style-property.git",
|
"_source": "git://github.com/desandro/get-style-property.git",
|
||||||
"_target": "1.x",
|
"_target": "~1.0.4",
|
||||||
"_originalSource": "get-style-property"
|
"_originalSource": "get-style-property"
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "iron-a11y-keys-behavior",
|
"name": "iron-a11y-keys-behavior",
|
||||||
"version": "1.0.9",
|
"version": "1.1.0",
|
||||||
"description": "A behavior that enables keybindings for greater a11y.",
|
"description": "A behavior that enables keybindings for greater a11y.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"web-components",
|
"web-components",
|
||||||
|
@ -31,11 +31,11 @@
|
||||||
},
|
},
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior",
|
"homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior",
|
||||||
"_release": "1.0.9",
|
"_release": "1.1.0",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v1.0.9",
|
"tag": "v1.1.0",
|
||||||
"commit": "63dd1ce94223ae6a226e653ef5a458a66c950e79"
|
"commit": "cd8c972278c0d916bef57209d7dce5b81e67687c"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git",
|
"_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git",
|
||||||
"_target": "^1.0.0",
|
"_target": "^1.0.0",
|
||||||
|
|
|
@ -11,7 +11,7 @@ env:
|
||||||
- secure: vIs86+z7s1QwihkHtLBRQzlmJRSIWIadq3SlDdZHS4HOivH7fNV0d4hm8QnZYZ9X8yvSvxFCzEFdLuX1TpU0H3oy5wgYky7DnfJtsEhuOfW8dobHHZeCNi/t2FQAXpobqpRwojC3A+1b1lNrY1XNpYRz7aEialO4Yr8e1SQSLex5zw/pqm7g9Vz6PnQwobDQcGXKc6ZWc84+DqOo9qfkSlnEJC/1vQxHYpUa172UnnAnmHJ7gZKdhf9aLWJSZcSpPcoKEnvslRFmeDyRMNRDWVzcg2vHnV+tc1aYzp1wsrRW3P+oqwYlvGlxo+5U92QLXKIcKZhGblVWxe8BtXgiVzgS1sz5D11vKs61Xe46onbguG/XK3UxX9bPRK5uklkC5fwAY2hhvOTGXqimTb2YrlyEWO3BCKGBk6Is3KGyCe7c2nNEmXPUSun9X1JLGRPivJb9iBR4/WSEFvibYHl6/gIke9LdXPOCHuJ3+Iu14lCz+pwi8ADIWVuGpDIxFcorG8a3BCoxQo5VouUbSe0mcNttAvSzBNxhljaaBuFs56DLDpLRr0sGhqvfA1JzdCyzVyrk4WECfZw26pAnYCyTczVXmu5msVdKnjPJKtDqWazvIhHk2G1mk8CKb14lrN58u/Kh6PQ3miJ+61c1stBWhRDlp2QffOkBJiOATKHF+AA=
|
- secure: vIs86+z7s1QwihkHtLBRQzlmJRSIWIadq3SlDdZHS4HOivH7fNV0d4hm8QnZYZ9X8yvSvxFCzEFdLuX1TpU0H3oy5wgYky7DnfJtsEhuOfW8dobHHZeCNi/t2FQAXpobqpRwojC3A+1b1lNrY1XNpYRz7aEialO4Yr8e1SQSLex5zw/pqm7g9Vz6PnQwobDQcGXKc6ZWc84+DqOo9qfkSlnEJC/1vQxHYpUa172UnnAnmHJ7gZKdhf9aLWJSZcSpPcoKEnvslRFmeDyRMNRDWVzcg2vHnV+tc1aYzp1wsrRW3P+oqwYlvGlxo+5U92QLXKIcKZhGblVWxe8BtXgiVzgS1sz5D11vKs61Xe46onbguG/XK3UxX9bPRK5uklkC5fwAY2hhvOTGXqimTb2YrlyEWO3BCKGBk6Is3KGyCe7c2nNEmXPUSun9X1JLGRPivJb9iBR4/WSEFvibYHl6/gIke9LdXPOCHuJ3+Iu14lCz+pwi8ADIWVuGpDIxFcorG8a3BCoxQo5VouUbSe0mcNttAvSzBNxhljaaBuFs56DLDpLRr0sGhqvfA1JzdCyzVyrk4WECfZw26pAnYCyTczVXmu5msVdKnjPJKtDqWazvIhHk2G1mk8CKb14lrN58u/Kh6PQ3miJ+61c1stBWhRDlp2QffOkBJiOATKHF+AA=
|
||||||
node_js: 4
|
node_js: 4
|
||||||
addons:
|
addons:
|
||||||
firefox: '42.0'
|
firefox: latest
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
- google-chrome
|
- google-chrome
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "iron-a11y-keys-behavior",
|
"name": "iron-a11y-keys-behavior",
|
||||||
"version": "1.0.9",
|
"version": "1.1.0",
|
||||||
"description": "A behavior that enables keybindings for greater a11y.",
|
"description": "A behavior that enables keybindings for greater a11y.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"web-components",
|
"web-components",
|
||||||
|
|
|
@ -37,6 +37,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
</style>
|
</style>
|
||||||
<template>
|
<template>
|
||||||
<h4>Press any of these keys</h4>
|
<h4>Press any of these keys</h4>
|
||||||
|
<input type="checkbox" checked="{{preventDefault::change}}"> prevent default = {{preventDefault}}
|
||||||
<p class="keys">
|
<p class="keys">
|
||||||
<template is="dom-repeat" items="[[boundKeys]]">
|
<template is="dom-repeat" items="[[boundKeys]]">
|
||||||
<span>{{item}}</span>
|
<span>{{item}}</span>
|
||||||
|
@ -68,6 +69,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
preventDefault: {
|
||||||
|
type: Boolean,
|
||||||
|
value: true,
|
||||||
|
notify: true
|
||||||
|
},
|
||||||
|
|
||||||
keyEventTarget: {
|
keyEventTarget: {
|
||||||
type: Object,
|
type: Object,
|
||||||
value: function() {
|
value: function() {
|
||||||
|
@ -77,12 +84,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
},
|
},
|
||||||
|
|
||||||
keyBindings: {
|
keyBindings: {
|
||||||
'* pageup pagedown left right down up shift+a alt+a home end space enter': '_updatePressed'
|
'* pageup pagedown left right down up home end space enter @ ~ " $ ? ! \\ + : # backspace': '_updatePressed',
|
||||||
|
'a': '_updatePressed',
|
||||||
|
'shift+a alt+a': '_updatePressed'
|
||||||
},
|
},
|
||||||
|
|
||||||
_updatePressed: function(event) {
|
_updatePressed: function(event) {
|
||||||
console.log(event.detail);
|
console.log(event.detail);
|
||||||
|
|
||||||
|
if (this.preventDefault) {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
this._setPressed(
|
this._setPressed(
|
||||||
this.pressed + event.detail.combo + ' pressed!\n'
|
this.pressed + event.detail.combo + ' pressed!\n'
|
||||||
);
|
);
|
||||||
|
|
|
@ -21,46 +21,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
* Values taken from: http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/keyset.html#KeySet-Set
|
* Values taken from: http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/keyset.html#KeySet-Set
|
||||||
*/
|
*/
|
||||||
var KEY_IDENTIFIER = {
|
var KEY_IDENTIFIER = {
|
||||||
|
'U+0008': 'backspace',
|
||||||
'U+0009': 'tab',
|
'U+0009': 'tab',
|
||||||
'U+001B': 'esc',
|
'U+001B': 'esc',
|
||||||
'U+0020': 'space',
|
'U+0020': 'space',
|
||||||
'U+002A': '*',
|
|
||||||
'U+0030': '0',
|
|
||||||
'U+0031': '1',
|
|
||||||
'U+0032': '2',
|
|
||||||
'U+0033': '3',
|
|
||||||
'U+0034': '4',
|
|
||||||
'U+0035': '5',
|
|
||||||
'U+0036': '6',
|
|
||||||
'U+0037': '7',
|
|
||||||
'U+0038': '8',
|
|
||||||
'U+0039': '9',
|
|
||||||
'U+0041': 'a',
|
|
||||||
'U+0042': 'b',
|
|
||||||
'U+0043': 'c',
|
|
||||||
'U+0044': 'd',
|
|
||||||
'U+0045': 'e',
|
|
||||||
'U+0046': 'f',
|
|
||||||
'U+0047': 'g',
|
|
||||||
'U+0048': 'h',
|
|
||||||
'U+0049': 'i',
|
|
||||||
'U+004A': 'j',
|
|
||||||
'U+004B': 'k',
|
|
||||||
'U+004C': 'l',
|
|
||||||
'U+004D': 'm',
|
|
||||||
'U+004E': 'n',
|
|
||||||
'U+004F': 'o',
|
|
||||||
'U+0050': 'p',
|
|
||||||
'U+0051': 'q',
|
|
||||||
'U+0052': 'r',
|
|
||||||
'U+0053': 's',
|
|
||||||
'U+0054': 't',
|
|
||||||
'U+0055': 'u',
|
|
||||||
'U+0056': 'v',
|
|
||||||
'U+0057': 'w',
|
|
||||||
'U+0058': 'x',
|
|
||||||
'U+0059': 'y',
|
|
||||||
'U+005A': 'z',
|
|
||||||
'U+007F': 'del'
|
'U+007F': 'del'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -72,6 +36,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
* Values from: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent.keyCode#Value_of_keyCode
|
* Values from: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent.keyCode#Value_of_keyCode
|
||||||
*/
|
*/
|
||||||
var KEY_CODE = {
|
var KEY_CODE = {
|
||||||
|
8: 'backspace',
|
||||||
9: 'tab',
|
9: 'tab',
|
||||||
13: 'enter',
|
13: 'enter',
|
||||||
27: 'esc',
|
27: 'esc',
|
||||||
|
@ -100,16 +65,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
'meta': 'metaKey'
|
'meta': 'metaKey'
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* KeyboardEvent.key is mostly represented by printable character made by
|
|
||||||
* the keyboard, with unprintable keys labeled nicely.
|
|
||||||
*
|
|
||||||
* However, on OS X, Alt+char can make a Unicode character that follows an
|
|
||||||
* Apple-specific mapping. In this case, we
|
|
||||||
* fall back to .keyCode.
|
|
||||||
*/
|
|
||||||
var KEY_CHAR = /[a-z0-9*]/;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Matches a keyIdentifier string.
|
* Matches a keyIdentifier string.
|
||||||
*/
|
*/
|
||||||
|
@ -130,14 +85,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
var validKey = '';
|
var validKey = '';
|
||||||
if (key) {
|
if (key) {
|
||||||
var lKey = key.toLowerCase();
|
var lKey = key.toLowerCase();
|
||||||
if (lKey.length == 1) {
|
if (lKey === ' ' || SPACE_KEY.test(lKey)) {
|
||||||
if (KEY_CHAR.test(lKey)) {
|
validKey = 'space';
|
||||||
validKey = lKey;
|
} else if (lKey.length == 1) {
|
||||||
}
|
validKey = lKey;
|
||||||
} else if (ARROW_KEY.test(lKey)) {
|
} else if (ARROW_KEY.test(lKey)) {
|
||||||
validKey = lKey.replace('arrow', '');
|
validKey = lKey.replace('arrow', '');
|
||||||
} else if (SPACE_KEY.test(lKey)) {
|
|
||||||
validKey = 'space';
|
|
||||||
} else if (lKey == 'multiply') {
|
} else if (lKey == 'multiply') {
|
||||||
// numpad '*' can map to Multiply on IE/Windows
|
// numpad '*' can map to Multiply on IE/Windows
|
||||||
validKey = '*';
|
validKey = '*';
|
||||||
|
@ -151,8 +104,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
function transformKeyIdentifier(keyIdent) {
|
function transformKeyIdentifier(keyIdent) {
|
||||||
var validKey = '';
|
var validKey = '';
|
||||||
if (keyIdent) {
|
if (keyIdent) {
|
||||||
if (IDENT_CHAR.test(keyIdent)) {
|
if (keyIdent in KEY_IDENTIFIER) {
|
||||||
validKey = KEY_IDENTIFIER[keyIdent];
|
validKey = KEY_IDENTIFIER[keyIdent];
|
||||||
|
} else if (IDENT_CHAR.test(keyIdent)) {
|
||||||
|
keyIdent = parseInt(keyIdent.replace('U+', '0x'), 16);
|
||||||
|
validKey = String.fromCharCode(keyIdent).toLowerCase();
|
||||||
} else {
|
} else {
|
||||||
validKey = keyIdent.toLowerCase();
|
validKey = keyIdent.toLowerCase();
|
||||||
}
|
}
|
||||||
|
@ -192,15 +148,24 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
transformKey(keyEvent.detail.key) || '';
|
transformKey(keyEvent.detail.key) || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function keyComboMatchesEvent(keyCombo, keyEvent) {
|
function keyComboMatchesEvent(keyCombo, event, eventKey) {
|
||||||
return normalizedKeyForEvent(keyEvent) === keyCombo.key &&
|
return eventKey === keyCombo.key &&
|
||||||
!!keyEvent.shiftKey === !!keyCombo.shiftKey &&
|
(!keyCombo.hasModifiers || (
|
||||||
!!keyEvent.ctrlKey === !!keyCombo.ctrlKey &&
|
!!event.shiftKey === !!keyCombo.shiftKey &&
|
||||||
!!keyEvent.altKey === !!keyCombo.altKey &&
|
!!event.ctrlKey === !!keyCombo.ctrlKey &&
|
||||||
!!keyEvent.metaKey === !!keyCombo.metaKey;
|
!!event.altKey === !!keyCombo.altKey &&
|
||||||
|
!!event.metaKey === !!keyCombo.metaKey)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseKeyComboString(keyComboString) {
|
function parseKeyComboString(keyComboString) {
|
||||||
|
if (keyComboString.length === 1) {
|
||||||
|
return {
|
||||||
|
combo: keyComboString,
|
||||||
|
key: keyComboString,
|
||||||
|
event: 'keydown'
|
||||||
|
};
|
||||||
|
}
|
||||||
return keyComboString.split('+').reduce(function(parsedKeyCombo, keyComboPart) {
|
return keyComboString.split('+').reduce(function(parsedKeyCombo, keyComboPart) {
|
||||||
var eventParts = keyComboPart.split(':');
|
var eventParts = keyComboPart.split(':');
|
||||||
var keyName = eventParts[0];
|
var keyName = eventParts[0];
|
||||||
|
@ -208,6 +173,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
|
|
||||||
if (keyName in MODIFIER_KEYS) {
|
if (keyName in MODIFIER_KEYS) {
|
||||||
parsedKeyCombo[MODIFIER_KEYS[keyName]] = true;
|
parsedKeyCombo[MODIFIER_KEYS[keyName]] = true;
|
||||||
|
parsedKeyCombo.hasModifiers = true;
|
||||||
} else {
|
} else {
|
||||||
parsedKeyCombo.key = keyName;
|
parsedKeyCombo.key = keyName;
|
||||||
parsedKeyCombo.event = event || 'keydown';
|
parsedKeyCombo.event = event || 'keydown';
|
||||||
|
@ -220,12 +186,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseEventString(eventString) {
|
function parseEventString(eventString) {
|
||||||
return eventString.split(' ').map(function(keyComboString) {
|
return eventString.trim().split(' ').map(function(keyComboString) {
|
||||||
return parseKeyComboString(keyComboString);
|
return parseKeyComboString(keyComboString);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* `Polymer.IronA11yKeysBehavior` provides a normalized interface for processing
|
* `Polymer.IronA11yKeysBehavior` provides a normalized interface for processing
|
||||||
* keyboard commands that pertain to [WAI-ARIA best practices](http://www.w3.org/TR/wai-aria-practices/#kbd_general_binding).
|
* keyboard commands that pertain to [WAI-ARIA best practices](http://www.w3.org/TR/wai-aria-practices/#kbd_general_binding).
|
||||||
|
@ -321,14 +286,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
|
|
||||||
keyboardEventMatchesKeys: function(event, eventString) {
|
keyboardEventMatchesKeys: function(event, eventString) {
|
||||||
var keyCombos = parseEventString(eventString);
|
var keyCombos = parseEventString(eventString);
|
||||||
var index;
|
var eventKey = normalizedKeyForEvent(event);
|
||||||
|
for (var i = 0; i < keyCombos.length; ++i) {
|
||||||
for (index = 0; index < keyCombos.length; ++index) {
|
if (keyComboMatchesEvent(keyCombos[i], event, eventKey)) {
|
||||||
if (keyComboMatchesEvent(keyCombos[index], event)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -356,6 +319,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
for (var eventString in this._imperativeKeyBindings) {
|
for (var eventString in this._imperativeKeyBindings) {
|
||||||
this._addKeyBinding(eventString, this._imperativeKeyBindings[eventString]);
|
this._addKeyBinding(eventString, this._imperativeKeyBindings[eventString]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Give precedence to combos with modifiers to be checked first.
|
||||||
|
for (var eventName in this._keyBindings) {
|
||||||
|
this._keyBindings[eventName].sort(function (kb1, kb2) {
|
||||||
|
var b1 = kb1[0].hasModifiers;
|
||||||
|
var b2 = kb2[0].hasModifiers;
|
||||||
|
return (b1 === b2) ? 0 : b1 ? -1 : 1;
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_addKeyBinding: function(eventString, handlerName) {
|
_addKeyBinding: function(eventString, handlerName) {
|
||||||
|
@ -411,14 +383,23 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
}
|
}
|
||||||
|
|
||||||
keyBindings.forEach(function(keyBinding) {
|
// if event has been already prevented, don't do anything
|
||||||
var keyCombo = keyBinding[0];
|
if (event.defaultPrevented) {
|
||||||
var handlerName = keyBinding[1];
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!event.defaultPrevented && keyComboMatchesEvent(keyCombo, event)) {
|
var eventKey = normalizedKeyForEvent(event);
|
||||||
|
for (var i = 0; i < keyBindings.length; i++) {
|
||||||
|
var keyCombo = keyBindings[i][0];
|
||||||
|
var handlerName = keyBindings[i][1];
|
||||||
|
if (keyComboMatchesEvent(keyCombo, event, eventKey)) {
|
||||||
this._triggerKeyHandler(keyCombo, handlerName, event);
|
this._triggerKeyHandler(keyCombo, handlerName, event);
|
||||||
|
// exit the loop if eventDefault was prevented
|
||||||
|
if (event.defaultPrevented) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, this);
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_triggerKeyHandler: function(keyCombo, handlerName, keyboardEvent) {
|
_triggerKeyHandler: function(keyCombo, handlerName, keyboardEvent) {
|
||||||
|
|
|
@ -52,6 +52,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||||
</template>
|
</template>
|
||||||
</test-fixture>
|
</test-fixture>
|
||||||
|
|
||||||
|
<test-fixture id="PreventKeys">
|
||||||
|
<template>
|
||||||
|
<x-a11y-prevent-keys></x-a11y-prevent-keys>
|
||||||
|
</template>
|
||||||
|
</test-fixture>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
suite('Polymer.IronA11yKeysBehavior', function() {
|
suite('Polymer.IronA11yKeysBehavior', function() {
|
||||||
var keys;
|
var keys;
|
||||||
|
@ -69,8 +75,17 @@ suite('Polymer.IronA11yKeysBehavior', function() {
|
||||||
this.keyCount++;
|
this.keyCount++;
|
||||||
this.lastEvent = event;
|
this.lastEvent = event;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Same as _keyHandler, used to distinguish who's called before who.
|
||||||
|
_keyHandler2: function(event) {
|
||||||
|
this.keyCount++;
|
||||||
|
this.lastEvent = event;
|
||||||
|
},
|
||||||
|
|
||||||
_preventDefaultHandler: function(event) {
|
_preventDefaultHandler: function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
this.keyCount++;
|
||||||
|
this.lastEvent = event;
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
@ -94,7 +109,8 @@ suite('Polymer.IronA11yKeysBehavior', function() {
|
||||||
],
|
],
|
||||||
|
|
||||||
keyBindings: {
|
keyBindings: {
|
||||||
'ctrl+shift+a': '_keyHandler'
|
'enter': '_keyHandler2',
|
||||||
|
'ctrl+shift+a shift+enter': '_keyHandler'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -125,8 +141,21 @@ suite('Polymer.IronA11yKeysBehavior', function() {
|
||||||
],
|
],
|
||||||
|
|
||||||
keyBindings: {
|
keyBindings: {
|
||||||
'space': '_keyHandler',
|
'enter': '_keyHandler'
|
||||||
'enter': '_preventDefaultHandler'
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Polymer({
|
||||||
|
is: 'x-a11y-prevent-keys',
|
||||||
|
|
||||||
|
behaviors: [
|
||||||
|
KeysTestBehavior,
|
||||||
|
XA11yBehavior
|
||||||
|
],
|
||||||
|
|
||||||
|
keyBindings: {
|
||||||
|
'space a': '_keyHandler',
|
||||||
|
'enter shift+a': '_preventDefaultHandler'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -142,6 +171,14 @@ suite('Polymer.IronA11yKeysBehavior', function() {
|
||||||
expect(keys.keyCount).to.be.equal(1);
|
expect(keys.keyCount).to.be.equal(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('trigger the handler when the specified key is pressed together with a modifier', function() {
|
||||||
|
var event = new CustomEvent('keydown');
|
||||||
|
event.ctrlKey = true;
|
||||||
|
event.keyCode = event.code = 32;
|
||||||
|
keys.dispatchEvent(event);
|
||||||
|
expect(keys.keyCount).to.be.equal(1);
|
||||||
|
});
|
||||||
|
|
||||||
test('do not trigger the handler for non-specified keys', function() {
|
test('do not trigger the handler for non-specified keys', function() {
|
||||||
MockInteractions.pressEnter(keys);
|
MockInteractions.pressEnter(keys);
|
||||||
|
|
||||||
|
@ -184,6 +221,24 @@ suite('Polymer.IronA11yKeysBehavior', function() {
|
||||||
event.key = 'spacebar';
|
event.key = 'spacebar';
|
||||||
expect(keys.keyboardEventMatchesKeys(event, 'space')).to.be.equal(true);
|
expect(keys.keyboardEventMatchesKeys(event, 'space')).to.be.equal(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('handles `+`', function() {
|
||||||
|
var event = new CustomEvent('keydown');
|
||||||
|
event.key = '+';
|
||||||
|
expect(keys.keyboardEventMatchesKeys(event, '+')).to.be.equal(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('handles `:`', function() {
|
||||||
|
var event = new CustomEvent('keydown');
|
||||||
|
event.key = ':';
|
||||||
|
expect(keys.keyboardEventMatchesKeys(event, ':')).to.be.equal(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('handles ` ` (space)', function() {
|
||||||
|
var event = new CustomEvent('keydown');
|
||||||
|
event.key = ' ';
|
||||||
|
expect(keys.keyboardEventMatchesKeys(event, 'space')).to.be.equal(true);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
suite('matching keyboard events to keys', function() {
|
suite('matching keyboard events to keys', function() {
|
||||||
|
@ -228,6 +283,28 @@ suite('Polymer.IronA11yKeysBehavior', function() {
|
||||||
|
|
||||||
expect(keys.keyCount).to.be.equal(1);
|
expect(keys.keyCount).to.be.equal(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('trigger also bindings without modifiers', function() {
|
||||||
|
var event = new CustomEvent('keydown');
|
||||||
|
// Combo `shift+enter`.
|
||||||
|
event.shiftKey = true;
|
||||||
|
event.keyCode = event.code = 13;
|
||||||
|
keys.dispatchEvent(event);
|
||||||
|
expect(keys.keyCount).to.be.equal(2);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('give precendence to combos with modifiers', function() {
|
||||||
|
var enterSpy = sinon.spy(keys, '_keyHandler2');
|
||||||
|
var shiftEnterSpy = sinon.spy(keys, '_keyHandler');
|
||||||
|
var event = new CustomEvent('keydown');
|
||||||
|
// Combo `shift+enter`.
|
||||||
|
event.shiftKey = true;
|
||||||
|
event.keyCode = event.code = 13;
|
||||||
|
keys.dispatchEvent(event);
|
||||||
|
expect(enterSpy.called).to.be.true;
|
||||||
|
expect(shiftEnterSpy.called).to.be.true;
|
||||||
|
expect(enterSpy.calledAfter(shiftEnterSpy)).to.be.true;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
suite('alternative event keys', function() {
|
suite('alternative event keys', function() {
|
||||||
|
@ -253,8 +330,6 @@ suite('Polymer.IronA11yKeysBehavior', function() {
|
||||||
|
|
||||||
test('bindings in other behaviors are transitive', function() {
|
test('bindings in other behaviors are transitive', function() {
|
||||||
MockInteractions.pressEnter(keys);
|
MockInteractions.pressEnter(keys);
|
||||||
MockInteractions.pressSpace(keys);
|
|
||||||
|
|
||||||
expect(keys.keyCount).to.be.equal(2);
|
expect(keys.keyCount).to.be.equal(2);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -277,16 +352,28 @@ suite('Polymer.IronA11yKeysBehavior', function() {
|
||||||
|
|
||||||
suite('prevent default behavior of event', function() {
|
suite('prevent default behavior of event', function() {
|
||||||
setup(function() {
|
setup(function() {
|
||||||
keys = fixture('BehaviorKeys');
|
keys = fixture('PreventKeys');
|
||||||
});
|
});
|
||||||
test('defaultPrevented is correctly set', function() {
|
|
||||||
var keySpy = sinon.spy();
|
|
||||||
|
|
||||||
document.addEventListener('keydown', keySpy);
|
|
||||||
|
|
||||||
|
test('`defaultPrevented` is correctly set', function() {
|
||||||
MockInteractions.pressEnter(keys);
|
MockInteractions.pressEnter(keys);
|
||||||
|
expect(keys.lastEvent.defaultPrevented).to.be.equal(true);
|
||||||
|
});
|
||||||
|
|
||||||
expect(keySpy.getCall(0).args[0].defaultPrevented).to.be.equal(true);
|
test('only 1 handler is invoked', function() {
|
||||||
|
var aSpy = sinon.spy(keys, '_keyHandler');
|
||||||
|
var shiftASpy = sinon.spy(keys, '_preventDefaultHandler');
|
||||||
|
var event = new CustomEvent('keydown', {
|
||||||
|
cancelable: true
|
||||||
|
});
|
||||||
|
// Combo `shift+a`.
|
||||||
|
event.shiftKey = true;
|
||||||
|
event.keyCode = event.code = 65;
|
||||||
|
keys.dispatchEvent(event);
|
||||||
|
|
||||||
|
expect(keys.keyCount).to.be.equal(1);
|
||||||
|
expect(shiftASpy.called).to.be.true;
|
||||||
|
expect(aSpy.called).to.be.false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,7 @@
|
||||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.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
|
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
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||||
-->
|
--><!DOCTYPE html><html><head>
|
||||||
<!doctype html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
||||||
<title>Tests</title>
|
<title>Tests</title>
|
||||||
|
@ -23,7 +20,9 @@
|
||||||
// Load and run all tests (.html, .js) as one suite:
|
// Load and run all tests (.html, .js) as one suite:
|
||||||
WCT.loadSuites([
|
WCT.loadSuites([
|
||||||
'basic-test.html',
|
'basic-test.html',
|
||||||
|
'basic-test.html?dom=shadow'
|
||||||
]);
|
]);
|
||||||
</script>
|
</script>
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
</body></html>
|
||||||
|
|
|
@ -29,14 +29,14 @@
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||||
},
|
},
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"homepage": "https://github.com/polymerelements/iron-behaviors",
|
"homepage": "https://github.com/PolymerElements/iron-behaviors",
|
||||||
"_release": "1.0.11",
|
"_release": "1.0.11",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v1.0.11",
|
"tag": "v1.0.11",
|
||||||
"commit": "084fbc7f60343d717bb2208f350774f4c9899777"
|
"commit": "084fbc7f60343d717bb2208f350774f4c9899777"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/polymerelements/iron-behaviors.git",
|
"_source": "git://github.com/PolymerElements/iron-behaviors.git",
|
||||||
"_target": "^1.0.0",
|
"_target": "^1.0.0",
|
||||||
"_originalSource": "polymerelements/iron-behaviors"
|
"_originalSource": "PolymerElements/iron-behaviors"
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "iron-flex-layout",
|
"name": "iron-flex-layout",
|
||||||
"version": "1.2.0",
|
"version": "1.2.1",
|
||||||
"description": "Provide flexbox-based layouts",
|
"description": "Provide flexbox-based layouts",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"web-components",
|
"web-components",
|
||||||
|
@ -27,12 +27,13 @@
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||||
"iron-component-page": "polymerelements/iron-component-page#^1.0.0"
|
"iron-component-page": "polymerelements/iron-component-page#^1.0.0"
|
||||||
},
|
},
|
||||||
|
"ignore": [],
|
||||||
"homepage": "https://github.com/PolymerElements/iron-flex-layout",
|
"homepage": "https://github.com/PolymerElements/iron-flex-layout",
|
||||||
"_release": "1.2.0",
|
"_release": "1.2.1",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v1.2.0",
|
"tag": "v1.2.1",
|
||||||
"commit": "4bf53ba623140d0d2663a404e91ee45b96299118"
|
"commit": "ebda425d92e20af300e2e175e5ef234b89a32486"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/PolymerElements/iron-flex-layout.git",
|
"_source": "git://github.com/PolymerElements/iron-flex-layout.git",
|
||||||
"_target": "^1.0.0",
|
"_target": "^1.0.0",
|
||||||
|
|
|
@ -1,28 +1,22 @@
|
||||||
language: node_js
|
language: node_js
|
||||||
sudo: false
|
sudo: false
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- node_js: stable
|
|
||||||
script: true || xvfb-run wct
|
|
||||||
addons:
|
|
||||||
firefox: latest
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- google-chrome
|
|
||||||
packages:
|
|
||||||
- google-chrome-stable
|
|
||||||
- node_js: node
|
|
||||||
script:
|
|
||||||
- |
|
|
||||||
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
|
|
||||||
true || wct -s 'default'
|
|
||||||
fi
|
|
||||||
before_script:
|
before_script:
|
||||||
- npm install web-component-tester
|
- npm install web-component-tester
|
||||||
- npm install bower
|
- npm install bower
|
||||||
- export PATH=$PWD/node_modules/.bin:$PATH
|
- 'export PATH=$PWD/node_modules/.bin:$PATH'
|
||||||
- bower install
|
- bower install
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- secure: jFaXkmco40NlJT4VyFYM34Zv9D1XVfLXgixobnyHQyJDBKSXrNLcwDuvrGUpJx/pwBCxEhKAbvxeJ+PBMUv8QV08MAdw2S6QOsIe3CUxAehoNoOMJw5duhE8faWlz8qzmCWEowHVFUeVsd0ZUsgOu6RTspj2A51D/CztQuW0Ljw=
|
- secure: jFaXkmco40NlJT4VyFYM34Zv9D1XVfLXgixobnyHQyJDBKSXrNLcwDuvrGUpJx/pwBCxEhKAbvxeJ+PBMUv8QV08MAdw2S6QOsIe3CUxAehoNoOMJw5duhE8faWlz8qzmCWEowHVFUeVsd0ZUsgOu6RTspj2A51D/CztQuW0Ljw=
|
||||||
- secure: fKrO5yMx8kZM1WQ3k0bzo6MCREKGW2WkCl2suDjuEtb1SQ/SaZa9Tun0fcqIHVJqg9+jOS1Romt/+MN27Nc6IT1tv/NdLd+uWjtMA+OzLyv48gzcdu8Ls/TISUGm5Wb7XHkcvMAb1tRoBs5BOvQ/85FilZLEq1km8snG9ZsOOWI=
|
- secure: fKrO5yMx8kZM1WQ3k0bzo6MCREKGW2WkCl2suDjuEtb1SQ/SaZa9Tun0fcqIHVJqg9+jOS1Romt/+MN27Nc6IT1tv/NdLd+uWjtMA+OzLyv48gzcdu8Ls/TISUGm5Wb7XHkcvMAb1tRoBs5BOvQ/85FilZLEq1km8snG9ZsOOWI=
|
||||||
|
node_js: 4
|
||||||
|
addons:
|
||||||
|
firefox: latest
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- google-chrome
|
||||||
|
packages:
|
||||||
|
- google-chrome-stable
|
||||||
|
script:
|
||||||
|
- 'true || xvfb-run wct'
|
||||||
|
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then true || wct -s 'default'; fi"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "iron-flex-layout",
|
"name": "iron-flex-layout",
|
||||||
"version": "1.2.0",
|
"version": "1.2.1",
|
||||||
"description": "Provide flexbox-based layouts",
|
"description": "Provide flexbox-based layouts",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"web-components",
|
"web-components",
|
||||||
|
@ -26,5 +26,6 @@
|
||||||
"prism-element": "PolymerElements/prism-element#^1.0.0",
|
"prism-element": "PolymerElements/prism-element#^1.0.0",
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||||
"iron-component-page": "polymerelements/iron-component-page#^1.0.0"
|
"iron-component-page": "polymerelements/iron-component-page#^1.0.0"
|
||||||
}
|
},
|
||||||
|
"ignore": []
|
||||||
}
|
}
|
||||||
|
|
|
@ -298,7 +298,7 @@ A complete [guide](https://elements.polymer-project.org/guides/flex-layout) to `
|
||||||
--layout-fullbleed: {
|
--layout-fullbleed: {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
};
|
||||||
|
|
||||||
/* fixed position */
|
/* fixed position */
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,29 @@
|
||||||
(function () {
|
(function () {
|
||||||
|
|
||||||
Dashboard.importCss('devices/ie/ie.css');
|
Dashboard.importCss('devices/ie/ie.css');
|
||||||
|
var browserSwitchKey = "ieswitchbrowser";
|
||||||
|
|
||||||
|
function getWeek(date) {
|
||||||
|
|
||||||
|
var onejan = new Date(date.getFullYear(), 0, 1);
|
||||||
|
return Math.ceil((((date - onejan) / 86400000) + onejan.getDay() + 1) / 7);
|
||||||
|
}
|
||||||
|
|
||||||
function onPageShow() {
|
function onPageShow() {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
var expectedValue;
|
||||||
|
var msg;
|
||||||
|
|
||||||
if (navigator.userAgent.toLowerCase().indexOf('windows nt 10.') != -1) {
|
if (navigator.userAgent.toLowerCase().indexOf('windows nt 10.') != -1) {
|
||||||
|
|
||||||
var expectedValue = new Date().toDateString() + "1";
|
expectedValue = new Date().toDateString() + "1";
|
||||||
if (appStorage.getItem("ieswitchtoedge") == expectedValue) {
|
if (appStorage.getItem(browserSwitchKey) == expectedValue) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var msg = Globalize.translate('MessageTryMicrosoftEdge');
|
msg = Globalize.translate('MessageTryMicrosoftEdge');
|
||||||
|
|
||||||
msg += "<br/><br/>";
|
msg += "<br/><br/>";
|
||||||
msg += '<a href="https://www.microsoft.com/en-us/windows/microsoft-edge" target="_blank">' + Globalize.translate('ButtonLearnMore') + '</a>';
|
msg += '<a href="https://www.microsoft.com/en-us/windows/microsoft-edge" target="_blank">' + Globalize.translate('ButtonLearnMore') + '</a>';
|
||||||
|
@ -23,10 +33,31 @@
|
||||||
title: Globalize.translate('HeaderTryMicrosoftEdge')
|
title: Globalize.translate('HeaderTryMicrosoftEdge')
|
||||||
});
|
});
|
||||||
|
|
||||||
appStorage.setItem("ieswitchtoedge", expectedValue);
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
expectedValue = getWeek(new Date()) + "_7";
|
||||||
|
|
||||||
|
if (appStorage.getItem(browserSwitchKey) == expectedValue) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!appStorage.getItem(browserSwitchKey)) {
|
||||||
|
appStorage.setItem(browserSwitchKey, expectedValue);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
msg = Globalize.translate('MessageTryModernBrowser');
|
||||||
|
|
||||||
|
msg += "<br/><br/>";
|
||||||
|
msg += '<a href="https://www.google.com/chrome" target="_blank">' + Globalize.translate('ButtonLearnMore') + '</a>';
|
||||||
|
|
||||||
|
Dashboard.alert({
|
||||||
|
message: msg,
|
||||||
|
title: Globalize.translate('HeaderTryModernBrowser')
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
appStorage.setItem(browserSwitchKey, expectedValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
pageClassOn('pageshow', "libraryPage", onPageShow);
|
pageClassOn('pageshow', "libraryPage", onPageShow);
|
||||||
|
|
|
@ -912,6 +912,8 @@
|
||||||
"TryDragAndDropMessage": "To re-arrange playlist items, just drag and drop. Try it!",
|
"TryDragAndDropMessage": "To re-arrange playlist items, just drag and drop. Try it!",
|
||||||
"HeaderTryMicrosoftEdge": "Try Microsoft Edge",
|
"HeaderTryMicrosoftEdge": "Try Microsoft Edge",
|
||||||
"MessageTryMicrosoftEdge": "For a better experience on Windows 10, try the new Microsoft Edge Browser.",
|
"MessageTryMicrosoftEdge": "For a better experience on Windows 10, try the new Microsoft Edge Browser.",
|
||||||
|
"HeaderTryModernBrowser": "Try a Modern Web Browser",
|
||||||
|
"MessageTryModernBrowser": "For a better experience on Windows, try a modern web browser such as Google Chrome, Firefox, or Opera.",
|
||||||
"ErrorAddingListingsToSchedulesDirect": "There was an error adding the lineup to your Schedules Direct account. Schedules Direct only allows a limited number of lineups per account. You may need to log into the Schedules Direct website and remove others listings from your account before proceeeding.",
|
"ErrorAddingListingsToSchedulesDirect": "There was an error adding the lineup to your Schedules Direct account. Schedules Direct only allows a limited number of lineups per account. You may need to log into the Schedules Direct website and remove others listings from your account before proceeeding.",
|
||||||
"PleaseAddAtLeastOneFolder": "Please add at least one folder to this library by clicking the Add button.",
|
"PleaseAddAtLeastOneFolder": "Please add at least one folder to this library by clicking the Add button.",
|
||||||
"ErrorAddingMediaPathToVirtualFolder": "There was an error adding the media path. Please ensure the path is valid and the Emby Server process has access to that location.",
|
"ErrorAddingMediaPathToVirtualFolder": "There was an error adding the media path. Please ensure the path is valid and the Emby Server process has access to that location.",
|
||||||
|
|
|
@ -922,6 +922,8 @@
|
||||||
"TryDragAndDropMessage": "To re-arrange playlist items, just drag and drop. Try it!",
|
"TryDragAndDropMessage": "To re-arrange playlist items, just drag and drop. Try it!",
|
||||||
"HeaderTryMicrosoftEdge": "Try Microsoft Edge",
|
"HeaderTryMicrosoftEdge": "Try Microsoft Edge",
|
||||||
"MessageTryMicrosoftEdge": "For a better experience on Windows 10, try the new Microsoft Edge Browser.",
|
"MessageTryMicrosoftEdge": "For a better experience on Windows 10, try the new Microsoft Edge Browser.",
|
||||||
|
"HeaderTryModernBrowser": "Try a Modern Web Browser",
|
||||||
|
"MessageTryModernBrowser": "For a better experience on Windows, try a modern web browser such as Google Chrome, Firefox, or Opera.",
|
||||||
"ErrorAddingListingsToSchedulesDirect": "There was an error adding the lineup to your Schedules Direct account. Schedules Direct only allows a limited number of lineups per account. You may need to log into the Schedules Direct website and remove others listings from your account before proceeeding.",
|
"ErrorAddingListingsToSchedulesDirect": "There was an error adding the lineup to your Schedules Direct account. Schedules Direct only allows a limited number of lineups per account. You may need to log into the Schedules Direct website and remove others listings from your account before proceeeding.",
|
||||||
"PleaseAddAtLeastOneFolder": "Please add at least one folder to this library by clicking the Add button.",
|
"PleaseAddAtLeastOneFolder": "Please add at least one folder to this library by clicking the Add button.",
|
||||||
"ErrorAddingMediaPathToVirtualFolder": "There was an error adding the media path. Please ensure the path is valid and the Emby Server process has access to that location.",
|
"ErrorAddingMediaPathToVirtualFolder": "There was an error adding the media path. Please ensure the path is valid and the Emby Server process has access to that location.",
|
||||||
|
|
|
@ -7352,46 +7352,10 @@ this.fire('dom-change');
|
||||||
* Values taken from: http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/keyset.html#KeySet-Set
|
* Values taken from: http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/keyset.html#KeySet-Set
|
||||||
*/
|
*/
|
||||||
var KEY_IDENTIFIER = {
|
var KEY_IDENTIFIER = {
|
||||||
|
'U+0008': 'backspace',
|
||||||
'U+0009': 'tab',
|
'U+0009': 'tab',
|
||||||
'U+001B': 'esc',
|
'U+001B': 'esc',
|
||||||
'U+0020': 'space',
|
'U+0020': 'space',
|
||||||
'U+002A': '*',
|
|
||||||
'U+0030': '0',
|
|
||||||
'U+0031': '1',
|
|
||||||
'U+0032': '2',
|
|
||||||
'U+0033': '3',
|
|
||||||
'U+0034': '4',
|
|
||||||
'U+0035': '5',
|
|
||||||
'U+0036': '6',
|
|
||||||
'U+0037': '7',
|
|
||||||
'U+0038': '8',
|
|
||||||
'U+0039': '9',
|
|
||||||
'U+0041': 'a',
|
|
||||||
'U+0042': 'b',
|
|
||||||
'U+0043': 'c',
|
|
||||||
'U+0044': 'd',
|
|
||||||
'U+0045': 'e',
|
|
||||||
'U+0046': 'f',
|
|
||||||
'U+0047': 'g',
|
|
||||||
'U+0048': 'h',
|
|
||||||
'U+0049': 'i',
|
|
||||||
'U+004A': 'j',
|
|
||||||
'U+004B': 'k',
|
|
||||||
'U+004C': 'l',
|
|
||||||
'U+004D': 'm',
|
|
||||||
'U+004E': 'n',
|
|
||||||
'U+004F': 'o',
|
|
||||||
'U+0050': 'p',
|
|
||||||
'U+0051': 'q',
|
|
||||||
'U+0052': 'r',
|
|
||||||
'U+0053': 's',
|
|
||||||
'U+0054': 't',
|
|
||||||
'U+0055': 'u',
|
|
||||||
'U+0056': 'v',
|
|
||||||
'U+0057': 'w',
|
|
||||||
'U+0058': 'x',
|
|
||||||
'U+0059': 'y',
|
|
||||||
'U+005A': 'z',
|
|
||||||
'U+007F': 'del'
|
'U+007F': 'del'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -7403,6 +7367,7 @@ this.fire('dom-change');
|
||||||
* Values from: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent.keyCode#Value_of_keyCode
|
* Values from: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent.keyCode#Value_of_keyCode
|
||||||
*/
|
*/
|
||||||
var KEY_CODE = {
|
var KEY_CODE = {
|
||||||
|
8: 'backspace',
|
||||||
9: 'tab',
|
9: 'tab',
|
||||||
13: 'enter',
|
13: 'enter',
|
||||||
27: 'esc',
|
27: 'esc',
|
||||||
|
@ -7431,16 +7396,6 @@ this.fire('dom-change');
|
||||||
'meta': 'metaKey'
|
'meta': 'metaKey'
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* KeyboardEvent.key is mostly represented by printable character made by
|
|
||||||
* the keyboard, with unprintable keys labeled nicely.
|
|
||||||
*
|
|
||||||
* However, on OS X, Alt+char can make a Unicode character that follows an
|
|
||||||
* Apple-specific mapping. In this case, we
|
|
||||||
* fall back to .keyCode.
|
|
||||||
*/
|
|
||||||
var KEY_CHAR = /[a-z0-9*]/;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Matches a keyIdentifier string.
|
* Matches a keyIdentifier string.
|
||||||
*/
|
*/
|
||||||
|
@ -7461,14 +7416,12 @@ this.fire('dom-change');
|
||||||
var validKey = '';
|
var validKey = '';
|
||||||
if (key) {
|
if (key) {
|
||||||
var lKey = key.toLowerCase();
|
var lKey = key.toLowerCase();
|
||||||
if (lKey.length == 1) {
|
if (lKey === ' ' || SPACE_KEY.test(lKey)) {
|
||||||
if (KEY_CHAR.test(lKey)) {
|
validKey = 'space';
|
||||||
validKey = lKey;
|
} else if (lKey.length == 1) {
|
||||||
}
|
validKey = lKey;
|
||||||
} else if (ARROW_KEY.test(lKey)) {
|
} else if (ARROW_KEY.test(lKey)) {
|
||||||
validKey = lKey.replace('arrow', '');
|
validKey = lKey.replace('arrow', '');
|
||||||
} else if (SPACE_KEY.test(lKey)) {
|
|
||||||
validKey = 'space';
|
|
||||||
} else if (lKey == 'multiply') {
|
} else if (lKey == 'multiply') {
|
||||||
// numpad '*' can map to Multiply on IE/Windows
|
// numpad '*' can map to Multiply on IE/Windows
|
||||||
validKey = '*';
|
validKey = '*';
|
||||||
|
@ -7482,8 +7435,11 @@ this.fire('dom-change');
|
||||||
function transformKeyIdentifier(keyIdent) {
|
function transformKeyIdentifier(keyIdent) {
|
||||||
var validKey = '';
|
var validKey = '';
|
||||||
if (keyIdent) {
|
if (keyIdent) {
|
||||||
if (IDENT_CHAR.test(keyIdent)) {
|
if (keyIdent in KEY_IDENTIFIER) {
|
||||||
validKey = KEY_IDENTIFIER[keyIdent];
|
validKey = KEY_IDENTIFIER[keyIdent];
|
||||||
|
} else if (IDENT_CHAR.test(keyIdent)) {
|
||||||
|
keyIdent = parseInt(keyIdent.replace('U+', '0x'), 16);
|
||||||
|
validKey = String.fromCharCode(keyIdent).toLowerCase();
|
||||||
} else {
|
} else {
|
||||||
validKey = keyIdent.toLowerCase();
|
validKey = keyIdent.toLowerCase();
|
||||||
}
|
}
|
||||||
|
@ -7523,15 +7479,24 @@ this.fire('dom-change');
|
||||||
transformKey(keyEvent.detail.key) || '';
|
transformKey(keyEvent.detail.key) || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function keyComboMatchesEvent(keyCombo, keyEvent) {
|
function keyComboMatchesEvent(keyCombo, event, eventKey) {
|
||||||
return normalizedKeyForEvent(keyEvent) === keyCombo.key &&
|
return eventKey === keyCombo.key &&
|
||||||
!!keyEvent.shiftKey === !!keyCombo.shiftKey &&
|
(!keyCombo.hasModifiers || (
|
||||||
!!keyEvent.ctrlKey === !!keyCombo.ctrlKey &&
|
!!event.shiftKey === !!keyCombo.shiftKey &&
|
||||||
!!keyEvent.altKey === !!keyCombo.altKey &&
|
!!event.ctrlKey === !!keyCombo.ctrlKey &&
|
||||||
!!keyEvent.metaKey === !!keyCombo.metaKey;
|
!!event.altKey === !!keyCombo.altKey &&
|
||||||
|
!!event.metaKey === !!keyCombo.metaKey)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseKeyComboString(keyComboString) {
|
function parseKeyComboString(keyComboString) {
|
||||||
|
if (keyComboString.length === 1) {
|
||||||
|
return {
|
||||||
|
combo: keyComboString,
|
||||||
|
key: keyComboString,
|
||||||
|
event: 'keydown'
|
||||||
|
};
|
||||||
|
}
|
||||||
return keyComboString.split('+').reduce(function(parsedKeyCombo, keyComboPart) {
|
return keyComboString.split('+').reduce(function(parsedKeyCombo, keyComboPart) {
|
||||||
var eventParts = keyComboPart.split(':');
|
var eventParts = keyComboPart.split(':');
|
||||||
var keyName = eventParts[0];
|
var keyName = eventParts[0];
|
||||||
|
@ -7539,6 +7504,7 @@ this.fire('dom-change');
|
||||||
|
|
||||||
if (keyName in MODIFIER_KEYS) {
|
if (keyName in MODIFIER_KEYS) {
|
||||||
parsedKeyCombo[MODIFIER_KEYS[keyName]] = true;
|
parsedKeyCombo[MODIFIER_KEYS[keyName]] = true;
|
||||||
|
parsedKeyCombo.hasModifiers = true;
|
||||||
} else {
|
} else {
|
||||||
parsedKeyCombo.key = keyName;
|
parsedKeyCombo.key = keyName;
|
||||||
parsedKeyCombo.event = event || 'keydown';
|
parsedKeyCombo.event = event || 'keydown';
|
||||||
|
@ -7551,12 +7517,11 @@ this.fire('dom-change');
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseEventString(eventString) {
|
function parseEventString(eventString) {
|
||||||
return eventString.split(' ').map(function(keyComboString) {
|
return eventString.trim().split(' ').map(function(keyComboString) {
|
||||||
return parseKeyComboString(keyComboString);
|
return parseKeyComboString(keyComboString);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* `Polymer.IronA11yKeysBehavior` provides a normalized interface for processing
|
* `Polymer.IronA11yKeysBehavior` provides a normalized interface for processing
|
||||||
* keyboard commands that pertain to [WAI-ARIA best practices](http://www.w3.org/TR/wai-aria-practices/#kbd_general_binding).
|
* keyboard commands that pertain to [WAI-ARIA best practices](http://www.w3.org/TR/wai-aria-practices/#kbd_general_binding).
|
||||||
|
@ -7652,14 +7617,12 @@ this.fire('dom-change');
|
||||||
|
|
||||||
keyboardEventMatchesKeys: function(event, eventString) {
|
keyboardEventMatchesKeys: function(event, eventString) {
|
||||||
var keyCombos = parseEventString(eventString);
|
var keyCombos = parseEventString(eventString);
|
||||||
var index;
|
var eventKey = normalizedKeyForEvent(event);
|
||||||
|
for (var i = 0; i < keyCombos.length; ++i) {
|
||||||
for (index = 0; index < keyCombos.length; ++index) {
|
if (keyComboMatchesEvent(keyCombos[i], event, eventKey)) {
|
||||||
if (keyComboMatchesEvent(keyCombos[index], event)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -7687,6 +7650,15 @@ this.fire('dom-change');
|
||||||
for (var eventString in this._imperativeKeyBindings) {
|
for (var eventString in this._imperativeKeyBindings) {
|
||||||
this._addKeyBinding(eventString, this._imperativeKeyBindings[eventString]);
|
this._addKeyBinding(eventString, this._imperativeKeyBindings[eventString]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Give precedence to combos with modifiers to be checked first.
|
||||||
|
for (var eventName in this._keyBindings) {
|
||||||
|
this._keyBindings[eventName].sort(function (kb1, kb2) {
|
||||||
|
var b1 = kb1[0].hasModifiers;
|
||||||
|
var b2 = kb2[0].hasModifiers;
|
||||||
|
return (b1 === b2) ? 0 : b1 ? -1 : 1;
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_addKeyBinding: function(eventString, handlerName) {
|
_addKeyBinding: function(eventString, handlerName) {
|
||||||
|
@ -7742,14 +7714,23 @@ this.fire('dom-change');
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
}
|
}
|
||||||
|
|
||||||
keyBindings.forEach(function(keyBinding) {
|
// if event has been already prevented, don't do anything
|
||||||
var keyCombo = keyBinding[0];
|
if (event.defaultPrevented) {
|
||||||
var handlerName = keyBinding[1];
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!event.defaultPrevented && keyComboMatchesEvent(keyCombo, event)) {
|
var eventKey = normalizedKeyForEvent(event);
|
||||||
|
for (var i = 0; i < keyBindings.length; i++) {
|
||||||
|
var keyCombo = keyBindings[i][0];
|
||||||
|
var handlerName = keyBindings[i][1];
|
||||||
|
if (keyComboMatchesEvent(keyCombo, event, eventKey)) {
|
||||||
this._triggerKeyHandler(keyCombo, handlerName, event);
|
this._triggerKeyHandler(keyCombo, handlerName, event);
|
||||||
|
// exit the loop if eventDefault was prevented
|
||||||
|
if (event.defaultPrevented) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, this);
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_triggerKeyHandler: function(keyCombo, handlerName, keyboardEvent) {
|
_triggerKeyHandler: function(keyCombo, handlerName, keyboardEvent) {
|
||||||
|
@ -8558,7 +8539,7 @@ this.fire('dom-change');
|
||||||
--layout-fullbleed: {
|
--layout-fullbleed: {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
};
|
||||||
|
|
||||||
/* fixed position */
|
/* fixed position */
|
||||||
|
|
||||||
|
@ -16788,7 +16769,7 @@ is separate from validation, and `allowed-pattern` does not affect how the input
|
||||||
<iron-media-query id="mq" on-query-matches-changed="_onQueryMatchesChanged" query="[[_computeMediaQuery(forceNarrow, responsiveWidth)]]">
|
<iron-media-query id="mq" on-query-matches-changed="_onQueryMatchesChanged" query="[[_computeMediaQuery(forceNarrow, responsiveWidth)]]">
|
||||||
</iron-media-query>
|
</iron-media-query>
|
||||||
|
|
||||||
<iron-selector attr-for-selected="id" class$="[[_computeIronSelectorClass(narrow, transition, dragging, rightDrawer, peeking)]]" activate-event="" selected="[[selected]]">
|
<iron-selector attr-for-selected="id" class$="[[_computeIronSelectorClass(narrow, _transition, dragging, rightDrawer, peeking)]]" activate-event="" selected="[[selected]]">
|
||||||
|
|
||||||
<div id="main" style$="[[_computeMainStyle(narrow, rightDrawer, drawerWidth)]]" on-transitionend="_onMainTransitionEnd">
|
<div id="main" style$="[[_computeMainStyle(narrow, rightDrawer, drawerWidth)]]" on-transitionend="_onMainTransitionEnd">
|
||||||
<content select="[main]"></content>
|
<content select="[main]"></content>
|
||||||
|
@ -16996,7 +16977,7 @@ is separate from validation, and `allowed-pattern` does not affect how the input
|
||||||
/**
|
/**
|
||||||
* Whether the transition is enabled.
|
* Whether the transition is enabled.
|
||||||
*/
|
*/
|
||||||
transition: {
|
_transition: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
value: false
|
value: false
|
||||||
},
|
},
|
||||||
|
@ -17048,7 +17029,7 @@ is separate from validation, and `allowed-pattern` does not affect how the input
|
||||||
ready: function() {
|
ready: function() {
|
||||||
// Avoid transition at the beginning e.g. page loads and enable
|
// Avoid transition at the beginning e.g. page loads and enable
|
||||||
// transitions only after the element is rendered and ready.
|
// transitions only after the element is rendered and ready.
|
||||||
this.transition = true;
|
this._transition = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
_onMainTransitionEnd: function (e) {
|
_onMainTransitionEnd: function (e) {
|
||||||
|
@ -17199,7 +17180,7 @@ is separate from validation, and `allowed-pattern` does not affect how the input
|
||||||
|
|
||||||
if (this.dragging) {
|
if (this.dragging) {
|
||||||
this.width = this.$.drawer.offsetWidth;
|
this.width = this.$.drawer.offsetWidth;
|
||||||
this.transition = false;
|
this._transition = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -17225,13 +17206,13 @@ is separate from validation, and `allowed-pattern` does not affect how the input
|
||||||
}
|
}
|
||||||
this._setPeeking(false);
|
this._setPeeking(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
var dy = event.detail.dy;
|
var dy = event.detail.dy;
|
||||||
var absDy = Math.abs(dy);
|
var absDy = Math.abs(dy);
|
||||||
if (absDy >= 70) {
|
if (absDy >= 70) {
|
||||||
// Ignore trackx until we move past the edge peek.
|
// Ignore trackx until we move past the edge peek.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._moveDrawer(this._translateXForDeltaX(dx));
|
this._moveDrawer(this._translateXForDeltaX(dx));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -17241,10 +17222,9 @@ is separate from validation, and `allowed-pattern` does not affect how the input
|
||||||
var xDirection = event.detail.dx > 0;
|
var xDirection = event.detail.dx > 0;
|
||||||
|
|
||||||
this._setDragging(false);
|
this._setDragging(false);
|
||||||
this.transition = true;
|
this._transition = true;
|
||||||
sharedPanel = null;
|
sharedPanel = null;
|
||||||
this._moveDrawer(null);
|
this._moveDrawer(null);
|
||||||
|
|
||||||
var dx = event.detail.dx;
|
var dx = event.detail.dx;
|
||||||
var dy = event.detail.dy;
|
var dy = event.detail.dy;
|
||||||
var absDy = Math.abs(dy);
|
var absDy = Math.abs(dy);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue