mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix forgot password page
This commit is contained in:
parent
9b20e2c860
commit
171f241ac3
18 changed files with 1037 additions and 78 deletions
|
@ -6716,6 +6716,8 @@ this.fire('dom-change');
|
|||
'space:keyup': '_spaceKeyUpHandler',
|
||||
},
|
||||
|
||||
_mouseEventRe: /^mouse/,
|
||||
|
||||
_tapHandler: function() {
|
||||
if (this.toggles) {
|
||||
// a tap is needed to toggle the active state
|
||||
|
@ -6736,7 +6738,33 @@ this.fire('dom-change');
|
|||
this.fire('change');
|
||||
},
|
||||
|
||||
_downHandler: function() {
|
||||
_eventSourceIsPrimaryInput: function(event) {
|
||||
event = event.detail.sourceEvent || event;
|
||||
|
||||
// Always true for non-mouse events....
|
||||
if (!this._mouseEventRe.test(event.type)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// http://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons
|
||||
if ('buttons' in event) {
|
||||
return event.buttons === 1;
|
||||
}
|
||||
|
||||
// http://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/which
|
||||
if (typeof event.which === 'number') {
|
||||
return event.which < 2;
|
||||
}
|
||||
|
||||
// http://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
|
||||
return event.button < 1;
|
||||
},
|
||||
|
||||
_downHandler: function(event) {
|
||||
if (!this._eventSourceIsPrimaryInput(event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._setPointerDown(true);
|
||||
this._setPressed(true);
|
||||
this._setReceivedFocusFromKeyboard(false);
|
||||
|
@ -12315,6 +12343,10 @@ is separate from validation, and `allowed-pattern` does not affect how the input
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</head><body><div hidden="" by-vulcanize=""><dom-module id="paper-material" assetpath="bower_components/paper-material/">
|
||||
<style>
|
||||
:host {
|
||||
|
@ -17711,6 +17743,325 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
</script>
|
||||
|
||||
</dom-module>
|
||||
<dom-module id="paper-radio-button" assetpath="bower_components/paper-radio-button/">
|
||||
|
||||
<style>
|
||||
/*
|
||||
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
|
||||
*/
|
||||
|
||||
:host {
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
:host(:focus) {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#radioContainer {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
cursor: pointer;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
:host #ink {
|
||||
position: absolute;
|
||||
top: -16px;
|
||||
left: -16px;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
color: var(--paper-radio-button-unchecked-ink-color, --primary-text-color);
|
||||
opacity: 0.6;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
:host #ink[checked] {
|
||||
color: var(--paper-radio-button-checked-ink-color, --default-primary-color);
|
||||
}
|
||||
|
||||
:host #offRadio {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
border: solid 2px;
|
||||
background-color: var(--paper-radio-button-unchecked-background-color, transparent);
|
||||
border-color: var(--paper-radio-button-unchecked-color, --primary-text-color);
|
||||
transition: border-color 0.28s;
|
||||
}
|
||||
|
||||
:host #onRadio {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
left: 4px;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background-color: var(--paper-radio-button-checked-color, --default-primary-color);
|
||||
-webkit-transform: scale(0);
|
||||
transform: scale(0);
|
||||
transition: -webkit-transform ease 0.28s;
|
||||
transition: transform ease 0.28s;
|
||||
}
|
||||
|
||||
:host([checked]) #offRadio {
|
||||
border-color: var(--paper-radio-button-checked-color, --default-primary-color);
|
||||
}
|
||||
|
||||
:host([checked]) #onRadio {
|
||||
-webkit-transform: scale(1);
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
#radioLabel {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-left: 10px;
|
||||
white-space: normal;
|
||||
pointer-events: none;
|
||||
color: var(--paper-radio-button-label-color, --primary-text-color);
|
||||
}
|
||||
|
||||
#radioLabel[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* disabled state */
|
||||
:host([disabled]) {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
:host([disabled]) #offRadio {
|
||||
border-color: var(--paper-radio-button-unchecked-color, --primary-text-color);
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
:host([disabled][checked]) #onRadio {
|
||||
background-color: var(--paper-radio-button-unchecked-color, --primary-text-color);
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
:host([disabled]) #radioLabel {
|
||||
/* slightly darker than the button, so that it's readable */
|
||||
opacity: 0.65;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
|
||||
<div id="radioContainer">
|
||||
<div id="offRadio"></div>
|
||||
<div id="onRadio"></div>
|
||||
<paper-ripple id="ink" class="circle" center="" checked$="[[checked]]"></paper-ripple>
|
||||
</div>
|
||||
|
||||
<div id="radioLabel" aria-hidden="true"><content></content></div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
Polymer({
|
||||
is: 'paper-radio-button',
|
||||
|
||||
behaviors: [
|
||||
Polymer.PaperInkyFocusBehavior
|
||||
],
|
||||
|
||||
hostAttributes: {
|
||||
role: 'radio',
|
||||
'aria-checked': false,
|
||||
tabindex: 0
|
||||
},
|
||||
|
||||
properties: {
|
||||
/**
|
||||
* Fired when the checked state changes due to user interaction.
|
||||
*
|
||||
* @event change
|
||||
*/
|
||||
|
||||
/**
|
||||
* Fired when the checked state changes.
|
||||
*
|
||||
* @event iron-change
|
||||
*/
|
||||
|
||||
/**
|
||||
* Gets or sets the state, `true` is checked and `false` is unchecked.
|
||||
*/
|
||||
checked: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
reflectToAttribute: true,
|
||||
notify: true,
|
||||
observer: '_checkedChanged'
|
||||
},
|
||||
|
||||
/**
|
||||
* If true, the button toggles the active state with each tap or press
|
||||
* of the spacebar.
|
||||
*/
|
||||
toggles: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
reflectToAttribute: true
|
||||
}
|
||||
},
|
||||
|
||||
ready: function() {
|
||||
if (Polymer.dom(this).textContent == '') {
|
||||
this.$.radioLabel.hidden = true;
|
||||
} else {
|
||||
this.setAttribute('aria-label', Polymer.dom(this).textContent);
|
||||
}
|
||||
this._isReady = true;
|
||||
},
|
||||
|
||||
_buttonStateChanged: function() {
|
||||
if (this.disabled) {
|
||||
return;
|
||||
}
|
||||
if (this._isReady) {
|
||||
this.checked = this.active;
|
||||
}
|
||||
},
|
||||
|
||||
_checkedChanged: function() {
|
||||
this.setAttribute('aria-checked', this.checked ? 'true' : 'false');
|
||||
this.active = this.checked;
|
||||
this.fire('iron-change');
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
</dom-module>
|
||||
<dom-module name="paper-radio-group">
|
||||
<style>
|
||||
:host {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
:host ::content > * {
|
||||
padding: 12px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<content id="items" select="*"></content>
|
||||
</template>
|
||||
|
||||
</dom-module>
|
||||
|
||||
<script>
|
||||
Polymer({
|
||||
is: 'paper-radio-group',
|
||||
|
||||
behaviors: [
|
||||
Polymer.IronA11yKeysBehavior,
|
||||
Polymer.IronSelectableBehavior
|
||||
],
|
||||
|
||||
hostAttributes: {
|
||||
role: 'radiogroup',
|
||||
tabindex: 0
|
||||
},
|
||||
|
||||
properties: {
|
||||
/**
|
||||
* Overriden from Polymer.IronSelectableBehavior
|
||||
*/
|
||||
attrForSelected: {
|
||||
type: String,
|
||||
value: 'name'
|
||||
},
|
||||
|
||||
/**
|
||||
* Overriden from Polymer.IronSelectableBehavior
|
||||
*/
|
||||
selectedAttribute: {
|
||||
type: String,
|
||||
value: 'checked'
|
||||
},
|
||||
|
||||
/**
|
||||
* Overriden from Polymer.IronSelectableBehavior
|
||||
*/
|
||||
selectable: {
|
||||
type: String,
|
||||
value: 'paper-radio-button'
|
||||
}
|
||||
},
|
||||
|
||||
keyBindings: {
|
||||
'left up': 'selectPrevious',
|
||||
'right down': 'selectNext',
|
||||
},
|
||||
|
||||
/**
|
||||
* Selects the given value.
|
||||
*/
|
||||
select: function(value) {
|
||||
if (this.selected) {
|
||||
var oldItem = this._valueToItem(this.selected);
|
||||
|
||||
// Do not allow unchecking the selected item.
|
||||
if (this.selected == value) {
|
||||
oldItem.checked = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (oldItem)
|
||||
oldItem.checked = false;
|
||||
}
|
||||
|
||||
Polymer.IronSelectableBehavior.select.apply(this, [value]);
|
||||
this.fire('paper-radio-group-changed');
|
||||
},
|
||||
|
||||
/**
|
||||
* Selects the previous item. If the previous item is disabled, then it is
|
||||
* skipped, and its previous item is selected
|
||||
*/
|
||||
selectPrevious: function() {
|
||||
var length = this.items.length;
|
||||
var newIndex = Number(this._valueToIndex(this.selected));
|
||||
|
||||
do {
|
||||
newIndex = (newIndex - 1 + length) % length;
|
||||
} while (this.items[newIndex].disabled)
|
||||
|
||||
this.select(this._indexToValue(newIndex));
|
||||
},
|
||||
|
||||
/**
|
||||
* Selects the next item. If the next item is disabled, then it is
|
||||
* skipped, and the next item after it is selected.
|
||||
*/
|
||||
selectNext: function() {
|
||||
var length = this.items.length;
|
||||
var newIndex = Number(this._valueToIndex(this.selected));
|
||||
|
||||
do {
|
||||
newIndex = (newIndex + 1 + length) % length;
|
||||
} while (this.items[newIndex].disabled)
|
||||
|
||||
this.select(this._indexToValue(newIndex));
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<iron-iconset-svg name="icons" size="24">
|
||||
<svg>
|
||||
<defs>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue