mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
minify
This commit is contained in:
parent
82bcca376f
commit
8a6884abef
494 changed files with 256 additions and 120180 deletions
|
@ -1,27 +0,0 @@
|
|||
{
|
||||
"name": "emby-webcomponents",
|
||||
"authors": [
|
||||
"The Emby Authors"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/MediaBrowser/emby-webcomponents.git"
|
||||
},
|
||||
"license": "https://github.com/MediaBrowser/emby-webcomponents/blob/master/LICENSE",
|
||||
"homepage": "https://github.com/MediaBrowser/emby-webcomponents",
|
||||
"dependencies": {
|
||||
"requirejs": "requirejs#^2.1.22"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"ignore": [],
|
||||
"version": "1.4.490",
|
||||
"_release": "1.4.490",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.4.490",
|
||||
"commit": "d0ee6da0b7661ff97d3501ea7633d113d3cb5a99"
|
||||
},
|
||||
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
||||
"_target": "^1.2.1",
|
||||
"_originalSource": "emby-webcomponents"
|
||||
}
|
|
@ -1,339 +0,0 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
{{description}}
|
||||
Copyright (C) {{year}} {{fullname}}
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
{signature of Ty Coon}, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
|
@ -1,118 +1 @@
|
|||
.actionSheet {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 0;
|
||||
border: none;
|
||||
max-height: 84%;
|
||||
border-radius: 1px !important;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.actionsheet-not-fullscreen {
|
||||
background-color: #121314;
|
||||
max-width: 90%;
|
||||
max-height: 90%;
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
.actionSheetMenuItem:hover {
|
||||
background-color: #222;
|
||||
}
|
||||
|
||||
.actionsheet-fullscreen {
|
||||
max-height: none;
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
.actionSheetContent-centered {
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.actionSheetContent {
|
||||
margin: 0 !important;
|
||||
padding: .4em 0 !important;
|
||||
flex-direction: column;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-grow: 1;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.actionSheetMenuItem {
|
||||
padding: 0 1.6em;
|
||||
margin: 0;
|
||||
text-transform: none;
|
||||
text-align: inherit;
|
||||
display: flex;
|
||||
font-weight: inherit;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.actionSheetMenuItem:focus {
|
||||
transform: none !important;
|
||||
}
|
||||
|
||||
.actionSheetMenuItem-noflex {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.actionSheetItemText {
|
||||
padding: .7em 0;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.actionSheetItemText-extraspacing {
|
||||
padding: .9em 0;
|
||||
}
|
||||
|
||||
.emby-button-noflex .actionSheetItemText {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.actionSheetItemIcon {
|
||||
margin-right: 1.5em !important;
|
||||
}
|
||||
|
||||
.actionSheetScroller {
|
||||
/* Override default style being applied by polymer */
|
||||
margin-bottom: 0 !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.layout-tv .actionSheetScroller {
|
||||
max-height: 64%;
|
||||
max-width: 60%;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.actionSheetTitle {
|
||||
margin: .5em 0 !important;
|
||||
padding: 0 1em;
|
||||
flex-grow: 0;
|
||||
}
|
||||
|
||||
.actionSheetText {
|
||||
padding: 0 1em;
|
||||
flex-grow: 0;
|
||||
}
|
||||
|
||||
.actionsheet-extraSpacing {
|
||||
font-size: 112%;
|
||||
}
|
||||
|
||||
.btnCloseActionSheet {
|
||||
position: fixed;
|
||||
top: .75em;
|
||||
left: .5em;
|
||||
}
|
||||
.actionSheet,.actionSheetContent{display:-webkit-box;display:-webkit-flex}.actionSheetContent,.actionSheetScroller{-webkit-box-orient:vertical;-webkit-box-direction:normal}.actionSheet{display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;padding:0;border:none;max-height:84%;-webkit-border-radius:1px!important;border-radius:1px!important;color:#fff}.actionsheet-not-fullscreen{background-color:#121314;max-width:90%;max-height:90%;color:#eee}.actionSheetMenuItem:hover{background-color:#222}.actionsheet-fullscreen{max-height:none;-webkit-border-radius:0!important;border-radius:0!important}.actionSheetContent-centered{text-align:center;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.actionSheetContent{margin:0!important;padding:.4em 0!important;-webkit-flex-direction:column;flex-direction:column;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;-webkit-box-align:center;-webkit-align-items:center;align-items:center;text-align:center;overflow:hidden}.actionSheetMenuItem{padding:0 1.6em;margin:0;text-transform:none;text-align:inherit;display:-webkit-box;display:-webkit-flex;display:flex;font-weight:inherit;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-flex-shrink:0;flex-shrink:0;background:0 0;-webkit-box-shadow:none;box-shadow:none}.actionSheetMenuItem:focus{-webkit-transform:none!important;transform:none!important}.actionSheetMenuItem-noflex{display:block}.actionSheetItemText{padding:.7em 0;white-space:nowrap;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;vertical-align:middle}.actionSheetItemText-extraspacing{padding:.9em 0}.emby-button-noflex .actionSheetItemText{display:inline-block}.actionSheetItemIcon{margin-right:1.5em!important}.actionSheetScroller{margin-bottom:0!important;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;width:100%}.layout-tv .actionSheetScroller{max-height:64%;max-width:60%;width:auto}.actionSheetTitle{margin:.5em 0!important;padding:0 1em;-webkit-box-flex:0;-webkit-flex-grow:0;flex-grow:0}.actionSheetText{padding:0 1em;-webkit-box-flex:0;-webkit-flex-grow:0;flex-grow:0}.actionsheet-extraSpacing{font-size:112%}.btnCloseActionSheet{position:fixed;top:.75em;left:.5em}
|
File diff suppressed because one or more lines are too long
|
@ -1,34 +1 @@
|
|||
define(['dialog', 'globalize'], function (dialog, globalize) {
|
||||
'use strict';
|
||||
|
||||
return function (text, title) {
|
||||
|
||||
var options;
|
||||
if (typeof text === 'string') {
|
||||
options = {
|
||||
title: title,
|
||||
text: text
|
||||
};
|
||||
} else {
|
||||
options = text;
|
||||
}
|
||||
|
||||
var items = [];
|
||||
|
||||
items.push({
|
||||
name: globalize.translate('sharedcomponents#ButtonGotIt'),
|
||||
id: 'ok',
|
||||
type: 'submit'
|
||||
});
|
||||
|
||||
options.buttons = items;
|
||||
|
||||
return dialog(options).then(function (result) {
|
||||
if (result === 'ok') {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
return Promise.reject();
|
||||
});
|
||||
};
|
||||
});
|
||||
define(["dialog","globalize"],function(dialog,globalize){"use strict";return function(text,title){var options;options="string"==typeof text?{title:title,text:text}:text;var items=[];return items.push({name:globalize.translate("sharedcomponents#ButtonGotIt"),id:"ok",type:"submit"}),options.buttons=items,dialog(options).then(function(result){return"ok"===result?Promise.resolve():Promise.reject()})}});
|
|
@ -1,23 +1 @@
|
|||
define([], function () {
|
||||
'use strict';
|
||||
|
||||
function replaceAll(str, find, replace) {
|
||||
|
||||
return str.split(find).join(replace);
|
||||
}
|
||||
|
||||
return function (options) {
|
||||
|
||||
if (typeof options === 'string') {
|
||||
options = {
|
||||
text: options
|
||||
};
|
||||
}
|
||||
|
||||
var text = replaceAll(options.text || '', '<br/>', '\n');
|
||||
|
||||
alert(text);
|
||||
|
||||
return Promise.resolve();
|
||||
};
|
||||
});
|
||||
define([],function(){"use strict";function replaceAll(str,find,replace){return str.split(find).join(replace)}return function(options){"string"==typeof options&&(options={text:options});var text=replaceAll(options.text||"","<br/>","\n");return alert(text),Promise.resolve()}});
|
File diff suppressed because one or more lines are too long
|
@ -1,56 +1 @@
|
|||
.alphaPicker {
|
||||
text-align: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.alphaPickerRow {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.alphaPicker-vertical .alphaPickerRow {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.alphaPickerButton {
|
||||
background: transparent;
|
||||
border: 0 !important;
|
||||
cursor: pointer;
|
||||
outline: none !important;
|
||||
color: inherit;
|
||||
vertical-align: middle;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
min-width: initial;
|
||||
margin: 0;
|
||||
padding: .1em .4em;
|
||||
width: auto;
|
||||
border-radius: .1em;
|
||||
font-weight: normal;
|
||||
opacity: .6;
|
||||
}
|
||||
|
||||
.alphaPicker-vertical .alphaPickerButton {
|
||||
padding: .2em .4em;
|
||||
}
|
||||
|
||||
.alphaPickerButtonIcon {
|
||||
width: 3.3vh;
|
||||
height: 3.3vh;
|
||||
font-size: 3.3vh;
|
||||
}
|
||||
|
||||
.alphaPickerButton-selected {
|
||||
color: #000;
|
||||
background-color: #bbb;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.layout-tv .alphaPickerButton:focus {
|
||||
background-color: #52B54B;
|
||||
opacity: 1;
|
||||
color: #fff;
|
||||
}
|
||||
.alphaPicker,.alphaPickerRow{-webkit-box-direction:normal}.alphaPicker{text-align:center;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-flex-direction:column;flex-direction:column}.alphaPickerRow{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-orient:horizontal;-webkit-flex-direction:row;flex-direction:row}.alphaPicker-vertical .alphaPickerRow{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column}.alphaPickerButton{background:0 0;border:0!important;cursor:pointer;outline:0!important;color:inherit;vertical-align:middle;font-family:inherit;font-size:inherit;min-width:initial;margin:0;padding:.1em .4em;width:auto;-webkit-border-radius:.1em;border-radius:.1em;font-weight:400;opacity:.6}.alphaPicker-vertical .alphaPickerButton{padding:.2em .4em}.alphaPickerButtonIcon{width:3.3vh;height:3.3vh;font-size:3.3vh}.alphaPickerButton-selected{color:#000;background-color:#bbb;opacity:1}.layout-tv .alphaPickerButton:focus{background-color:#52B54B;opacity:1;color:#fff}
|
|
@ -1,116 +1 @@
|
|||
define(['appStorage', 'events'], function (appStorage, events) {
|
||||
'use strict';
|
||||
|
||||
function getKey(name, userId) {
|
||||
|
||||
if (userId) {
|
||||
name = userId + '-' + name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
function AppSettings() {
|
||||
|
||||
var self = this;
|
||||
|
||||
self.enableAutoLogin = function (val) {
|
||||
|
||||
if (val != null) {
|
||||
self.set('enableAutoLogin', val.toString());
|
||||
}
|
||||
|
||||
return self.get('enableAutoLogin') !== 'false';
|
||||
};
|
||||
|
||||
self.enableAutomaticBitrateDetection = function (val) {
|
||||
|
||||
if (val != null) {
|
||||
self.set('enableAutomaticBitrateDetection', val.toString());
|
||||
}
|
||||
|
||||
return self.get('enableAutomaticBitrateDetection') !== 'false';
|
||||
};
|
||||
|
||||
self.maxStreamingBitrate = function (val) {
|
||||
|
||||
if (val != null) {
|
||||
self.set('preferredVideoBitrate', val);
|
||||
}
|
||||
|
||||
return parseInt(self.get('preferredVideoBitrate') || '0') || 1500000;
|
||||
};
|
||||
|
||||
self.maxStaticMusicBitrate = function (val) {
|
||||
|
||||
if (val !== undefined) {
|
||||
self.set('maxStaticMusicBitrate', val);
|
||||
}
|
||||
|
||||
var defaultValue = 384000;
|
||||
return parseInt(self.get('maxStaticMusicBitrate') || defaultValue.toString()) || defaultValue;
|
||||
};
|
||||
|
||||
self.maxChromecastBitrate = function (val) {
|
||||
|
||||
if (val != null) {
|
||||
self.set('chromecastBitrate1', val);
|
||||
}
|
||||
|
||||
val = self.get('chromecastBitrate1');
|
||||
|
||||
return val ? parseInt(val) : null;
|
||||
};
|
||||
|
||||
self.syncOnlyOnWifi = function (val) {
|
||||
|
||||
if (val != null) {
|
||||
self.set('syncOnlyOnWifi', val.toString());
|
||||
}
|
||||
|
||||
return self.get('syncOnlyOnWifi') !== 'false';
|
||||
};
|
||||
|
||||
self.syncPath = function (val) {
|
||||
|
||||
if (val != null) {
|
||||
self.set('syncPath', val);
|
||||
}
|
||||
|
||||
return self.get('syncPath');
|
||||
};
|
||||
|
||||
self.cameraUploadServers = function (val) {
|
||||
|
||||
if (val != null) {
|
||||
self.set('cameraUploadServers', val.join(','));
|
||||
}
|
||||
|
||||
val = self.get('cameraUploadServers');
|
||||
|
||||
if (val) {
|
||||
return val.split(',');
|
||||
}
|
||||
|
||||
return [];
|
||||
};
|
||||
|
||||
self.set = function (name, value, userId) {
|
||||
|
||||
var currentValue = self.get(name, userId);
|
||||
|
||||
appStorage.setItem(getKey(name, userId), value);
|
||||
|
||||
if (currentValue !== value) {
|
||||
events.trigger(self, 'change', [name]);
|
||||
}
|
||||
};
|
||||
|
||||
self.get = function (name, userId) {
|
||||
|
||||
return appStorage.getItem(getKey(name, userId));
|
||||
};
|
||||
}
|
||||
|
||||
return new AppSettings();
|
||||
});
|
||||
define(["appStorage","events"],function(appStorage,events){"use strict";function getKey(name,userId){return userId&&(name=userId+"-"+name),name}function AppSettings(){var self=this;self.enableAutoLogin=function(val){return null!=val&&self.set("enableAutoLogin",val.toString()),"false"!==self.get("enableAutoLogin")},self.enableAutomaticBitrateDetection=function(val){return null!=val&&self.set("enableAutomaticBitrateDetection",val.toString()),"false"!==self.get("enableAutomaticBitrateDetection")},self.maxStreamingBitrate=function(val){return null!=val&&self.set("preferredVideoBitrate",val),parseInt(self.get("preferredVideoBitrate")||"0")||15e5},self.maxStaticMusicBitrate=function(val){void 0!==val&&self.set("maxStaticMusicBitrate",val);var defaultValue=384e3;return parseInt(self.get("maxStaticMusicBitrate")||defaultValue.toString())||defaultValue},self.maxChromecastBitrate=function(val){return null!=val&&self.set("chromecastBitrate1",val),val=self.get("chromecastBitrate1"),val?parseInt(val):null},self.syncOnlyOnWifi=function(val){return null!=val&&self.set("syncOnlyOnWifi",val.toString()),"false"!==self.get("syncOnlyOnWifi")},self.syncPath=function(val){return null!=val&&self.set("syncPath",val),self.get("syncPath")},self.cameraUploadServers=function(val){return null!=val&&self.set("cameraUploadServers",val.join(",")),val=self.get("cameraUploadServers"),val?val.split(","):[]},self.set=function(name,value,userId){var currentValue=self.get(name,userId);appStorage.setItem(getKey(name,userId),value),currentValue!==value&&events.trigger(self,"change",[name])},self.get=function(name,userId){return appStorage.getItem(getKey(name,userId))}}return new AppSettings});
|
File diff suppressed because one or more lines are too long
|
@ -1,30 +1 @@
|
|||
.backdropContainer {
|
||||
contain: layout style;
|
||||
}
|
||||
|
||||
.backdropImage {
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: cover;
|
||||
background-attachment: fixed;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
contain: layout style;
|
||||
}
|
||||
|
||||
.backdropImageFadeIn {
|
||||
animation: backdrop-fadein 800ms ease-in normal both;
|
||||
}
|
||||
|
||||
@keyframes backdrop-fadein {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
.backdropContainer,.backdropImage{contain:layout style}.backdropImage{background-repeat:no-repeat;background-position:center center;-webkit-background-size:cover;background-size:cover;background-attachment:fixed;position:absolute;top:0;left:0;right:0;bottom:0}.backdropImageFadeIn{-webkit-animation:backdrop-fadein .8s ease-in normal both;animation:backdrop-fadein .8s ease-in normal both}@-webkit-keyframes backdrop-fadein{from{opacity:0}to{opacity:1}}@keyframes backdrop-fadein{from{opacity:0}to{opacity:1}}
|
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"name": "emby-webcomponents",
|
||||
"authors": [
|
||||
"The Emby Authors"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/MediaBrowser/emby-webcomponents.git"
|
||||
},
|
||||
"license": "https://github.com/MediaBrowser/emby-webcomponents/blob/master/LICENSE",
|
||||
"homepage": "https://github.com/MediaBrowser/emby-webcomponents",
|
||||
"dependencies": {
|
||||
"requirejs": "requirejs#^2.1.22"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
},
|
||||
"ignore": []
|
||||
}
|
|
@ -1,298 +1 @@
|
|||
define([], function () {
|
||||
'use strict';
|
||||
|
||||
function isTv() {
|
||||
|
||||
// This is going to be really difficult to get right
|
||||
var userAgent = navigator.userAgent.toLowerCase();
|
||||
|
||||
if (userAgent.indexOf('tv') !== -1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (userAgent.indexOf('samsungbrowser') !== -1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (userAgent.indexOf('nintendo') !== -1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (userAgent.indexOf('viera') !== -1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (userAgent.indexOf('webos') !== -1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function isMobile(userAgent) {
|
||||
|
||||
var terms = [
|
||||
'mobi',
|
||||
'ipad',
|
||||
'iphone',
|
||||
'ipod',
|
||||
'silk',
|
||||
'gt-p1000',
|
||||
'nexus 7',
|
||||
'kindle fire',
|
||||
'opera mini'
|
||||
];
|
||||
|
||||
var lower = userAgent.toLowerCase();
|
||||
|
||||
for (var i = 0, length = terms.length; i < length; i++) {
|
||||
if (lower.indexOf(terms[i]) !== -1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function isStyleSupported(prop, value) {
|
||||
|
||||
if (typeof window === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If no value is supplied, use "inherit"
|
||||
value = arguments.length === 2 ? value : 'inherit';
|
||||
// Try the native standard method first
|
||||
if ('CSS' in window && 'supports' in window.CSS) {
|
||||
return window.CSS.supports(prop, value);
|
||||
}
|
||||
// Check Opera's native method
|
||||
if ('supportsCSS' in window) {
|
||||
return window.supportsCSS(prop, value);
|
||||
}
|
||||
|
||||
// need try/catch because it's failing on tizen
|
||||
|
||||
try {
|
||||
// Convert to camel-case for DOM interactions
|
||||
var camel = prop.replace(/-([a-z]|[0-9])/ig, function (all, letter) {
|
||||
return (letter + '').toUpperCase();
|
||||
});
|
||||
// Check if the property is supported
|
||||
var support = (camel in el.style);
|
||||
// Create test element
|
||||
var el = document.createElement('div');
|
||||
// Assign the property and value to invoke
|
||||
// the CSS interpreter
|
||||
el.style.cssText = prop + ':' + value;
|
||||
// Ensure both the property and value are
|
||||
// supported and return
|
||||
return support && (el.style[camel] !== '');
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function hasKeyboard(browser) {
|
||||
|
||||
if (browser.touch) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (browser.xboxOne) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (browser.ps4) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (browser.edgeUwp) {
|
||||
// This is OK for now, but this won't always be true
|
||||
// Should we use this?
|
||||
// https://gist.github.com/wagonli/40d8a31bd0d6f0dd7a5d
|
||||
return true;
|
||||
}
|
||||
|
||||
if (browser.tv) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
var _supportsCssAnimation;
|
||||
var _supportsCssAnimationWithPrefix;
|
||||
function supportsCssAnimation(allowPrefix) {
|
||||
|
||||
if (allowPrefix) {
|
||||
if (_supportsCssAnimationWithPrefix === true || _supportsCssAnimationWithPrefix === false) {
|
||||
return _supportsCssAnimationWithPrefix;
|
||||
}
|
||||
} else {
|
||||
if (_supportsCssAnimation === true || _supportsCssAnimation === false) {
|
||||
return _supportsCssAnimation;
|
||||
}
|
||||
}
|
||||
|
||||
var animation = false,
|
||||
animationstring = 'animation',
|
||||
keyframeprefix = '',
|
||||
domPrefixes = ['Webkit', 'O', 'Moz'],
|
||||
pfx = '',
|
||||
elm = document.createElement('div');
|
||||
|
||||
if (elm.style.animationName !== undefined) { animation = true; }
|
||||
|
||||
if (animation === false && allowPrefix) {
|
||||
for (var i = 0; i < domPrefixes.length; i++) {
|
||||
if (elm.style[domPrefixes[i] + 'AnimationName'] !== undefined) {
|
||||
pfx = domPrefixes[i];
|
||||
animationstring = pfx + 'Animation';
|
||||
keyframeprefix = '-' + pfx.toLowerCase() + '-';
|
||||
animation = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (allowPrefix) {
|
||||
_supportsCssAnimationWithPrefix = animation;
|
||||
return _supportsCssAnimationWithPrefix;
|
||||
} else {
|
||||
_supportsCssAnimation = animation;
|
||||
return _supportsCssAnimation;
|
||||
}
|
||||
}
|
||||
|
||||
var uaMatch = function (ua) {
|
||||
ua = ua.toLowerCase();
|
||||
|
||||
var match = /(edge)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(opr)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(chrome)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(safari)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(firefox)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(msie) ([\w.]+)/.exec(ua) ||
|
||||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
|
||||
[];
|
||||
|
||||
var versionMatch = /(version)[ \/]([\w.]+)/.exec(ua);
|
||||
|
||||
var platform_match = /(ipad)/.exec(ua) ||
|
||||
/(iphone)/.exec(ua) ||
|
||||
/(android)/.exec(ua) ||
|
||||
[];
|
||||
|
||||
var browser = match[1] || "";
|
||||
|
||||
if (browser === "edge") {
|
||||
platform_match = [""];
|
||||
} else {
|
||||
if (ua.indexOf("windows phone") !== -1 || ua.indexOf("iemobile") !== -1) {
|
||||
|
||||
// http://www.neowin.net/news/ie11-fakes-user-agent-to-fool-gmail-in-windows-phone-81-gdr1-update
|
||||
browser = "msie";
|
||||
}
|
||||
else if (ua.indexOf("like gecko") !== -1 && ua.indexOf('webkit') === -1 && ua.indexOf('opera') === -1 && ua.indexOf('chrome') === -1 && ua.indexOf('safari') === -1) {
|
||||
browser = "msie";
|
||||
}
|
||||
}
|
||||
|
||||
if (browser === 'opr') {
|
||||
browser = 'opera';
|
||||
}
|
||||
|
||||
var version;
|
||||
if (versionMatch && versionMatch.length > 2) {
|
||||
version = versionMatch[2];
|
||||
}
|
||||
|
||||
version = version || match[2] || "0";
|
||||
|
||||
var versionMajor = parseInt(version.split('.')[0]);
|
||||
|
||||
if (isNaN(versionMajor)) {
|
||||
versionMajor = 0;
|
||||
}
|
||||
|
||||
return {
|
||||
browser: browser,
|
||||
version: version,
|
||||
platform: platform_match[0] || "",
|
||||
versionMajor: versionMajor
|
||||
};
|
||||
};
|
||||
|
||||
var userAgent = navigator.userAgent;
|
||||
var matched = uaMatch(userAgent);
|
||||
var browser = {};
|
||||
|
||||
if (matched.browser) {
|
||||
browser[matched.browser] = true;
|
||||
browser.version = matched.version;
|
||||
browser.versionMajor = matched.versionMajor;
|
||||
}
|
||||
|
||||
if (matched.platform) {
|
||||
browser[matched.platform] = true;
|
||||
}
|
||||
|
||||
if (!browser.chrome && !browser.msie && !browser.edge && !browser.opera && userAgent.toLowerCase().indexOf("webkit") !== -1) {
|
||||
browser.safari = true;
|
||||
}
|
||||
|
||||
if (userAgent.toLowerCase().indexOf("playstation 4") !== -1) {
|
||||
browser.ps4 = true;
|
||||
browser.tv = true;
|
||||
}
|
||||
|
||||
if (userAgent.toLowerCase().indexOf("embytheaterpi") !== -1) {
|
||||
browser.slow = true;
|
||||
browser.noAnimation = true;
|
||||
}
|
||||
|
||||
if (isMobile(userAgent)) {
|
||||
browser.mobile = true;
|
||||
}
|
||||
|
||||
browser.xboxOne = userAgent.toLowerCase().indexOf('xbox') !== -1;
|
||||
browser.animate = typeof document !== 'undefined' && document.documentElement.animate != null;
|
||||
browser.tizen = userAgent.toLowerCase().indexOf('tizen') !== -1 || self.tizen != null;
|
||||
browser.web0s = userAgent.toLowerCase().indexOf('Web0S'.toLowerCase()) !== -1;
|
||||
browser.edgeUwp = browser.edge && userAgent.toLowerCase().indexOf('msapphost') !== -1;
|
||||
|
||||
if (!browser.tizen) {
|
||||
browser.orsay = userAgent.toLowerCase().indexOf('smarthub') !== -1;
|
||||
}
|
||||
|
||||
if (browser.edgeUwp) {
|
||||
browser.edge = true;
|
||||
}
|
||||
|
||||
browser.tv = isTv();
|
||||
browser.operaTv = browser.tv && userAgent.toLowerCase().indexOf('opr/') !== -1;
|
||||
|
||||
if (!isStyleSupported('display', 'flex')) {
|
||||
browser.noFlex = true;
|
||||
}
|
||||
|
||||
if (browser.mobile || browser.tv) {
|
||||
browser.slow = true;
|
||||
}
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
if (('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
|
||||
browser.touch = true;
|
||||
}
|
||||
}
|
||||
|
||||
browser.keyboard = hasKeyboard(browser);
|
||||
browser.supportsCssAnimation = supportsCssAnimation;
|
||||
|
||||
browser.osx = userAgent.toLowerCase().indexOf('os x') !== -1;
|
||||
browser.iOS = browser.ipad || browser.iphone || browser.ipod;
|
||||
|
||||
return browser;
|
||||
});
|
||||
define([],function(){"use strict";function isTv(){var userAgent=navigator.userAgent.toLowerCase();return userAgent.indexOf("tv")!==-1||(userAgent.indexOf("samsungbrowser")!==-1||(userAgent.indexOf("nintendo")!==-1||(userAgent.indexOf("viera")!==-1||userAgent.indexOf("webos")!==-1)))}function isMobile(userAgent){for(var terms=["mobi","ipad","iphone","ipod","silk","gt-p1000","nexus 7","kindle fire","opera mini"],lower=userAgent.toLowerCase(),i=0,length=terms.length;i<length;i++)if(lower.indexOf(terms[i])!==-1)return!0;return!1}function isStyleSupported(prop,value){if("undefined"==typeof window)return!1;if(value=2===arguments.length?value:"inherit","CSS"in window&&"supports"in window.CSS)return window.CSS.supports(prop,value);if("supportsCSS"in window)return window.supportsCSS(prop,value);try{var camel=prop.replace(/-([a-z]|[0-9])/gi,function(all,letter){return(letter+"").toUpperCase()}),support=camel in el.style,el=document.createElement("div");return el.style.cssText=prop+":"+value,support&&""!==el.style[camel]}catch(err){return!1}}function hasKeyboard(browser){return!!browser.touch||(!!browser.xboxOne||(!!browser.ps4||(!!browser.edgeUwp||!!browser.tv)))}function supportsCssAnimation(allowPrefix){if(allowPrefix){if(_supportsCssAnimationWithPrefix===!0||_supportsCssAnimationWithPrefix===!1)return _supportsCssAnimationWithPrefix}else if(_supportsCssAnimation===!0||_supportsCssAnimation===!1)return _supportsCssAnimation;var animation=!1,animationstring="animation",keyframeprefix="",domPrefixes=["Webkit","O","Moz"],pfx="",elm=document.createElement("div");if(void 0!==elm.style.animationName&&(animation=!0),animation===!1&&allowPrefix)for(var i=0;i<domPrefixes.length;i++)if(void 0!==elm.style[domPrefixes[i]+"AnimationName"]){pfx=domPrefixes[i],animationstring=pfx+"Animation",keyframeprefix="-"+pfx.toLowerCase()+"-",animation=!0;break}return allowPrefix?_supportsCssAnimationWithPrefix=animation:_supportsCssAnimation=animation}var _supportsCssAnimation,_supportsCssAnimationWithPrefix,uaMatch=function(ua){ua=ua.toLowerCase();var match=/(edge)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua)||/(opr)(?:.*version|)[ \/]([\w.]+)/.exec(ua)||/(chrome)[ \/]([\w.]+)/.exec(ua)||/(safari)[ \/]([\w.]+)/.exec(ua)||/(firefox)[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||ua.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)||[],versionMatch=/(version)[ \/]([\w.]+)/.exec(ua),platform_match=/(ipad)/.exec(ua)||/(iphone)/.exec(ua)||/(android)/.exec(ua)||[],browser=match[1]||"";"edge"===browser?platform_match=[""]:ua.indexOf("windows phone")!==-1||ua.indexOf("iemobile")!==-1?browser="msie":ua.indexOf("like gecko")!==-1&&ua.indexOf("webkit")===-1&&ua.indexOf("opera")===-1&&ua.indexOf("chrome")===-1&&ua.indexOf("safari")===-1&&(browser="msie"),"opr"===browser&&(browser="opera");var version;versionMatch&&versionMatch.length>2&&(version=versionMatch[2]),version=version||match[2]||"0";var versionMajor=parseInt(version.split(".")[0]);return isNaN(versionMajor)&&(versionMajor=0),{browser:browser,version:version,platform:platform_match[0]||"",versionMajor:versionMajor}},userAgent=navigator.userAgent,matched=uaMatch(userAgent),browser={};return matched.browser&&(browser[matched.browser]=!0,browser.version=matched.version,browser.versionMajor=matched.versionMajor),matched.platform&&(browser[matched.platform]=!0),browser.chrome||browser.msie||browser.edge||browser.opera||userAgent.toLowerCase().indexOf("webkit")===-1||(browser.safari=!0),userAgent.toLowerCase().indexOf("playstation 4")!==-1&&(browser.ps4=!0,browser.tv=!0),userAgent.toLowerCase().indexOf("embytheaterpi")!==-1&&(browser.slow=!0,browser.noAnimation=!0),isMobile(userAgent)&&(browser.mobile=!0),browser.xboxOne=userAgent.toLowerCase().indexOf("xbox")!==-1,browser.animate="undefined"!=typeof document&&null!=document.documentElement.animate,browser.tizen=userAgent.toLowerCase().indexOf("tizen")!==-1||null!=self.tizen,browser.web0s=userAgent.toLowerCase().indexOf("Web0S".toLowerCase())!==-1,browser.edgeUwp=browser.edge&&userAgent.toLowerCase().indexOf("msapphost")!==-1,browser.tizen||(browser.orsay=userAgent.toLowerCase().indexOf("smarthub")!==-1),browser.edgeUwp&&(browser.edge=!0),browser.tv=isTv(),browser.operaTv=browser.tv&&userAgent.toLowerCase().indexOf("opr/")!==-1,isStyleSupported("display","flex")||(browser.noFlex=!0),(browser.mobile||browser.tv)&&(browser.slow=!0),"undefined"!=typeof document&&("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&(browser.touch=!0),browser.keyboard=hasKeyboard(browser),browser.supportsCssAnimation=supportsCssAnimation,browser.osx=userAgent.toLowerCase().indexOf("os x")!==-1,browser.iOS=browser.ipad||browser.iphone||browser.ipod,browser});
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,127 +1 @@
|
|||
define(['datetime', 'imageLoader', 'connectionManager', 'layoutManager'], function (datetime, imageLoader, connectionManager, layoutManager) {
|
||||
'use strict';
|
||||
|
||||
function buildChapterCardsHtml(item, chapters, options) {
|
||||
|
||||
var className = 'card scalableCard itemAction chapterCard';
|
||||
|
||||
var mediaStreams = ((item.MediaSources || [])[0] || {}).MediaStreams || [];
|
||||
var videoStream = mediaStreams.filter(function (i) {
|
||||
return i.Type === 'Video';
|
||||
})[0] || {};
|
||||
|
||||
var shape = (options.backdropShape || 'backdrop');
|
||||
|
||||
if (videoStream.Width && videoStream.Height) {
|
||||
|
||||
if ((videoStream.Width / videoStream.Height) <= 1.34) {
|
||||
shape = (options.squareShape || 'square');
|
||||
}
|
||||
}
|
||||
|
||||
className += ' ' + shape + 'Card';
|
||||
className += ' ' + shape + 'Card-scalable';
|
||||
|
||||
if (options.block || options.rows) {
|
||||
className += ' block';
|
||||
}
|
||||
|
||||
var html = '';
|
||||
var itemsInRow = 0;
|
||||
|
||||
var apiClient = connectionManager.getApiClient(item.ServerId);
|
||||
|
||||
for (var i = 0, length = chapters.length; i < length; i++) {
|
||||
|
||||
if (options.rows && itemsInRow === 0) {
|
||||
html += '<div class="cardColumn">';
|
||||
}
|
||||
|
||||
var chapter = chapters[i];
|
||||
|
||||
html += buildChapterCard(item, apiClient, chapter, i, options, className, shape);
|
||||
itemsInRow++;
|
||||
|
||||
if (options.rows && itemsInRow >= options.rows) {
|
||||
itemsInRow = 0;
|
||||
html += '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
function getImgUrl(item, chapter, index, maxWidth, apiClient) {
|
||||
|
||||
if (chapter.ImageTag) {
|
||||
|
||||
return apiClient.getScaledImageUrl(item.Id, {
|
||||
|
||||
maxWidth: maxWidth,
|
||||
tag: chapter.ImageTag,
|
||||
type: "Chapter",
|
||||
index: index
|
||||
});
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function buildChapterCard(item, apiClient, chapter, index, options, className, shape) {
|
||||
|
||||
var imgUrl = getImgUrl(item, chapter, index, options.width || 400, apiClient);
|
||||
|
||||
var cardImageContainerClass = 'cardImageContainer chapterCardImageContainer';
|
||||
if (options.coverImage) {
|
||||
cardImageContainerClass += ' coveredImage';
|
||||
}
|
||||
var dataAttributes = ' data-action="play" data-isfolder="' + item.IsFolder + '" data-id="' + item.Id + '" data-serverid="' + item.ServerId + '" data-type="' + item.Type + '" data-mediatype="' + item.MediaType + '" data-positionticks="' + chapter.StartPositionTicks + '"';
|
||||
var cardImageContainer = imgUrl ? ('<div class="' + cardImageContainerClass + ' lazy" data-src="' + imgUrl + '">') : ('<div class="' + cardImageContainerClass + '">');
|
||||
|
||||
if (!imgUrl) {
|
||||
cardImageContainer += '<i class="md-icon cardImageIcon">local_movies</i>';
|
||||
}
|
||||
|
||||
var nameHtml = '';
|
||||
nameHtml += '<div class="cardText">' + chapter.Name + '</div>';
|
||||
nameHtml += '<div class="cardText">' + datetime.getDisplayRunningTime(chapter.StartPositionTicks) + '</div>';
|
||||
|
||||
var cardBoxCssClass = 'cardBox';
|
||||
|
||||
if (layoutManager.tv) {
|
||||
cardBoxCssClass += ' cardBox-focustransform';
|
||||
}
|
||||
|
||||
var html = '<button type="button" class="' + className + '"' + dataAttributes + '><div class="' + cardBoxCssClass + '"><div class="cardScalable"><div class="cardPadder-' + shape + '"></div><div class="cardContent">' + cardImageContainer + '</div><div class="innerCardFooter">' + nameHtml + '</div></div></div></div></button>';
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
function buildChapterCards(item, chapters, options) {
|
||||
|
||||
if (options.parentContainer) {
|
||||
// Abort if the container has been disposed
|
||||
if (!document.body.contains(options.parentContainer)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (chapters.length) {
|
||||
options.parentContainer.classList.remove('hide');
|
||||
} else {
|
||||
options.parentContainer.classList.add('hide');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var html = buildChapterCardsHtml(item, chapters, options);
|
||||
|
||||
options.itemsContainer.innerHTML = html;
|
||||
|
||||
imageLoader.lazyChildren(options.itemsContainer);
|
||||
}
|
||||
|
||||
return {
|
||||
buildChapterCards: buildChapterCards
|
||||
};
|
||||
|
||||
});
|
||||
define(["datetime","imageLoader","connectionManager","layoutManager"],function(datetime,imageLoader,connectionManager,layoutManager){"use strict";function buildChapterCardsHtml(item,chapters,options){var className="card scalableCard itemAction chapterCard",mediaStreams=((item.MediaSources||[])[0]||{}).MediaStreams||[],videoStream=mediaStreams.filter(function(i){return"Video"===i.Type})[0]||{},shape=options.backdropShape||"backdrop";videoStream.Width&&videoStream.Height&&videoStream.Width/videoStream.Height<=1.34&&(shape=options.squareShape||"square"),className+=" "+shape+"Card",className+=" "+shape+"Card-scalable",(options.block||options.rows)&&(className+=" block");for(var html="",itemsInRow=0,apiClient=connectionManager.getApiClient(item.ServerId),i=0,length=chapters.length;i<length;i++){options.rows&&0===itemsInRow&&(html+='<div class="cardColumn">');var chapter=chapters[i];html+=buildChapterCard(item,apiClient,chapter,i,options,className,shape),itemsInRow++,options.rows&&itemsInRow>=options.rows&&(itemsInRow=0,html+="</div>")}return html}function getImgUrl(item,chapter,index,maxWidth,apiClient){return chapter.ImageTag?apiClient.getScaledImageUrl(item.Id,{maxWidth:maxWidth,tag:chapter.ImageTag,type:"Chapter",index:index}):null}function buildChapterCard(item,apiClient,chapter,index,options,className,shape){var imgUrl=getImgUrl(item,chapter,index,options.width||400,apiClient),cardImageContainerClass="cardImageContainer chapterCardImageContainer";options.coverImage&&(cardImageContainerClass+=" coveredImage");var dataAttributes=' data-action="play" data-isfolder="'+item.IsFolder+'" data-id="'+item.Id+'" data-serverid="'+item.ServerId+'" data-type="'+item.Type+'" data-mediatype="'+item.MediaType+'" data-positionticks="'+chapter.StartPositionTicks+'"',cardImageContainer=imgUrl?'<div class="'+cardImageContainerClass+' lazy" data-src="'+imgUrl+'">':'<div class="'+cardImageContainerClass+'">';imgUrl||(cardImageContainer+='<i class="md-icon cardImageIcon">local_movies</i>');var nameHtml="";nameHtml+='<div class="cardText">'+chapter.Name+"</div>",nameHtml+='<div class="cardText">'+datetime.getDisplayRunningTime(chapter.StartPositionTicks)+"</div>";var cardBoxCssClass="cardBox";layoutManager.tv&&(cardBoxCssClass+=" cardBox-focustransform");var html='<button type="button" class="'+className+'"'+dataAttributes+'><div class="'+cardBoxCssClass+'"><div class="cardScalable"><div class="cardPadder-'+shape+'"></div><div class="cardContent">'+cardImageContainer+'</div><div class="innerCardFooter">'+nameHtml+"</div></div></div></div></button>";return html}function buildChapterCards(item,chapters,options){if(options.parentContainer){if(!document.body.contains(options.parentContainer))return;if(!chapters.length)return void options.parentContainer.classList.add("hide");options.parentContainer.classList.remove("hide")}var html=buildChapterCardsHtml(item,chapters,options);options.itemsContainer.innerHTML=html,imageLoader.lazyChildren(options.itemsContainer)}return{buildChapterCards:buildChapterCards}});
|
|
@ -1,21 +1 @@
|
|||
define(['cardBuilder'], function (cardBuilder) {
|
||||
'use strict';
|
||||
|
||||
function buildPeopleCards(items, options) {
|
||||
|
||||
options = Object.assign(options || {}, {
|
||||
cardLayout: true,
|
||||
centerText: true,
|
||||
showTitle: true,
|
||||
cardFooterAside: 'none',
|
||||
showPersonRoleOrType: true,
|
||||
cardCssClass: 'personCard'
|
||||
});
|
||||
cardBuilder.buildCards(items, options);
|
||||
}
|
||||
|
||||
return {
|
||||
buildPeopleCards: buildPeopleCards
|
||||
};
|
||||
|
||||
});
|
||||
define(["cardBuilder"],function(cardBuilder){"use strict";function buildPeopleCards(items,options){options=Object.assign(options||{},{cardLayout:!0,centerText:!0,showTitle:!0,cardFooterAside:"none",showPersonRoleOrType:!0,cardCssClass:"personCard"}),cardBuilder.buildCards(items,options)}return{buildPeopleCards:buildPeopleCards}});
|
|
@ -1,29 +1 @@
|
|||
.cardBox-round {
|
||||
border: .7em solid transparent !important;
|
||||
}
|
||||
|
||||
.cardBox-focustransform {
|
||||
transition: transform 180ms ease-out !important;
|
||||
-webkit-transform-origin: center center;
|
||||
transform-origin: center center;
|
||||
}
|
||||
|
||||
.cardImageContainer-round {
|
||||
border: .15em solid transparent;
|
||||
}
|
||||
|
||||
.cardImageContainer-round, .card-round:focus .cardImageContainer {
|
||||
border-color: #fff;
|
||||
}
|
||||
|
||||
.card-round:focus > .cardBox-focustransform {
|
||||
transform: scale(1.34, 1.34);
|
||||
}
|
||||
|
||||
.cardContent-round {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.cardImageContainer-round, .card-round .cardImage {
|
||||
border-radius: 1000px;
|
||||
}
|
||||
.cardBox-round{border:.7em solid transparent!important}.cardBox-focustransform{-webkit-transition:-webkit-transform 180ms ease-out!important;-o-transition:transform 180ms ease-out!important;transition:transform 180ms ease-out!important;-webkit-transform-origin:center center;transform-origin:center center}.cardImageContainer-round{border:.15em solid transparent}.card-round:focus .cardImageContainer,.cardImageContainer-round{border-color:#fff}.card-round:focus>.cardBox-focustransform{-webkit-transform:scale(1.34,1.34);transform:scale(1.34,1.34)}.cardContent-round{overflow:visible}.card-round .cardImage,.cardImageContainer-round{-webkit-border-radius:1000px;border-radius:1000px}
|
File diff suppressed because one or more lines are too long
|
@ -1,12 +1 @@
|
|||
.clearButton {
|
||||
background: transparent;
|
||||
border: 0 !important;
|
||||
padding: 0 !important;
|
||||
cursor: pointer;
|
||||
outline: none !important;
|
||||
color: inherit;
|
||||
width: 100%;
|
||||
vertical-align: middle;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
}
|
||||
.clearButton{background:0 0;border:0!important;padding:0!important;cursor:pointer;outline:0!important;color:inherit;width:100%;vertical-align:middle;font-family:inherit;font-size:inherit}
|
File diff suppressed because one or more lines are too long
|
@ -1,40 +1 @@
|
|||
define(['dialog', 'globalize'], function (dialog, globalize) {
|
||||
'use strict';
|
||||
|
||||
return function (text, title) {
|
||||
|
||||
var options;
|
||||
if (typeof text === 'string') {
|
||||
options = {
|
||||
title: title,
|
||||
text: text
|
||||
};
|
||||
} else {
|
||||
options = text;
|
||||
}
|
||||
|
||||
var items = [];
|
||||
|
||||
items.push({
|
||||
name: options.cancelText || globalize.translate('sharedcomponents#ButtonCancel'),
|
||||
id: 'cancel',
|
||||
type: options.primary === 'cancel' ? 'submit' : 'cancel'
|
||||
});
|
||||
|
||||
items.push({
|
||||
name: options.confirmText || globalize.translate('sharedcomponents#ButtonOk'),
|
||||
id: 'ok',
|
||||
type: options.primary === 'cancel' ? 'cancel' : 'submit'
|
||||
});
|
||||
|
||||
options.buttons = items;
|
||||
|
||||
return dialog(options).then(function (result) {
|
||||
if (result === 'ok') {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
return Promise.reject();
|
||||
});
|
||||
};
|
||||
});
|
||||
define(["dialog","globalize"],function(dialog,globalize){"use strict";return function(text,title){var options;options="string"==typeof text?{title:title,text:text}:text;var items=[];return items.push({name:options.cancelText||globalize.translate("sharedcomponents#ButtonCancel"),id:"cancel",type:"cancel"===options.primary?"submit":"cancel"}),items.push({name:options.confirmText||globalize.translate("sharedcomponents#ButtonOk"),id:"ok",type:"cancel"===options.primary?"cancel":"submit"}),options.buttons=items,dialog(options).then(function(result){return"ok"===result?Promise.resolve():Promise.reject()})}});
|
|
@ -1,27 +1 @@
|
|||
define([], function () {
|
||||
'use strict';
|
||||
|
||||
function replaceAll(str, find, replace) {
|
||||
|
||||
return str.split(find).join(replace);
|
||||
}
|
||||
|
||||
return function (options) {
|
||||
|
||||
if (typeof options === 'string') {
|
||||
options = {
|
||||
title: '',
|
||||
text: options
|
||||
};
|
||||
}
|
||||
|
||||
var text = replaceAll(options.text || '', '<br/>', '\n');
|
||||
var result = confirm(text);
|
||||
|
||||
if (result) {
|
||||
return Promise.resolve();
|
||||
} else {
|
||||
return Promise.reject();
|
||||
}
|
||||
};
|
||||
});
|
||||
define([],function(){"use strict";function replaceAll(str,find,replace){return str.split(find).join(replace)}return function(options){"string"==typeof options&&(options={title:"",text:options});var text=replaceAll(options.text||"","<br/>","\n"),result=confirm(text);return result?Promise.resolve():Promise.reject()}});
|
|
@ -1,251 +1 @@
|
|||
define(['globalize'], function (globalize) {
|
||||
'use strict';
|
||||
|
||||
function parseISO8601Date(s, toLocal) {
|
||||
|
||||
// parenthese matches:
|
||||
// year month day hours minutes seconds
|
||||
// dotmilliseconds
|
||||
// tzstring plusminus hours minutes
|
||||
var re = /(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d+)?(Z|([+-])(\d{2}):(\d{2}))?/;
|
||||
|
||||
var d = s.match(re);
|
||||
|
||||
// "2010-12-07T11:00:00.000-09:00" parses to:
|
||||
// ["2010-12-07T11:00:00.000-09:00", "2010", "12", "07", "11",
|
||||
// "00", "00", ".000", "-09:00", "-", "09", "00"]
|
||||
// "2010-12-07T11:00:00.000Z" parses to:
|
||||
// ["2010-12-07T11:00:00.000Z", "2010", "12", "07", "11",
|
||||
// "00", "00", ".000", "Z", undefined, undefined, undefined]
|
||||
|
||||
if (!d) {
|
||||
|
||||
throw "Couldn't parse ISO 8601 date string '" + s + "'";
|
||||
}
|
||||
|
||||
// parse strings, leading zeros into proper ints
|
||||
var a = [1, 2, 3, 4, 5, 6, 10, 11];
|
||||
for (var i in a) {
|
||||
d[a[i]] = parseInt(d[a[i]], 10);
|
||||
}
|
||||
d[7] = parseFloat(d[7]);
|
||||
|
||||
// Date.UTC(year, month[, date[, hrs[, min[, sec[, ms]]]]])
|
||||
// note that month is 0-11, not 1-12
|
||||
// see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/UTC
|
||||
var ms = Date.UTC(d[1], d[2] - 1, d[3], d[4], d[5], d[6]);
|
||||
|
||||
// if there are milliseconds, add them
|
||||
if (d[7] > 0) {
|
||||
ms += Math.round(d[7] * 1000);
|
||||
}
|
||||
|
||||
// if there's a timezone, calculate it
|
||||
if (d[8] !== "Z" && d[10]) {
|
||||
var offset = d[10] * 60 * 60 * 1000;
|
||||
if (d[11]) {
|
||||
offset += d[11] * 60 * 1000;
|
||||
}
|
||||
if (d[9] === "-") {
|
||||
ms -= offset;
|
||||
} else {
|
||||
ms += offset;
|
||||
}
|
||||
} else if (toLocal === false) {
|
||||
ms += new Date().getTimezoneOffset() * 60000;
|
||||
}
|
||||
|
||||
return new Date(ms);
|
||||
}
|
||||
|
||||
function getDisplayRunningTime(ticks) {
|
||||
var ticksPerHour = 36000000000;
|
||||
var ticksPerMinute = 600000000;
|
||||
var ticksPerSecond = 10000000;
|
||||
|
||||
var parts = [];
|
||||
|
||||
var hours = ticks / ticksPerHour;
|
||||
hours = Math.floor(hours);
|
||||
|
||||
if (hours) {
|
||||
parts.push(hours);
|
||||
}
|
||||
|
||||
ticks -= (hours * ticksPerHour);
|
||||
|
||||
var minutes = ticks / ticksPerMinute;
|
||||
minutes = Math.floor(minutes);
|
||||
|
||||
ticks -= (minutes * ticksPerMinute);
|
||||
|
||||
if (minutes < 10 && hours) {
|
||||
minutes = '0' + minutes;
|
||||
}
|
||||
parts.push(minutes);
|
||||
|
||||
var seconds = ticks / ticksPerSecond;
|
||||
seconds = Math.floor(seconds);
|
||||
|
||||
if (seconds < 10) {
|
||||
seconds = '0' + seconds;
|
||||
}
|
||||
parts.push(seconds);
|
||||
|
||||
return parts.join(':');
|
||||
}
|
||||
|
||||
var toLocaleTimeStringSupportsLocales = function toLocaleTimeStringSupportsLocales() {
|
||||
try {
|
||||
new Date().toLocaleTimeString('i');
|
||||
} catch (e) {
|
||||
return e.name === 'RangeError';
|
||||
}
|
||||
return false;
|
||||
}();
|
||||
|
||||
function getCurrentLocale() {
|
||||
var locale = globalize.getCurrentLocale();
|
||||
|
||||
return locale;
|
||||
}
|
||||
|
||||
function getOptionList(options) {
|
||||
|
||||
var list = [];
|
||||
|
||||
for (var i in options) {
|
||||
list.push({
|
||||
name: i,
|
||||
value: options[i]
|
||||
});
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
function toLocaleString(date, options) {
|
||||
options = options || {};
|
||||
|
||||
var currentLocale = getCurrentLocale();
|
||||
|
||||
if (currentLocale && toLocaleTimeStringSupportsLocales) {
|
||||
return date.toLocaleString(currentLocale, options);
|
||||
}
|
||||
|
||||
return date.toLocaleString();
|
||||
}
|
||||
|
||||
function toLocaleDateString(date, options) {
|
||||
|
||||
options = options || {};
|
||||
|
||||
var currentLocale = getCurrentLocale();
|
||||
|
||||
if (currentLocale && toLocaleTimeStringSupportsLocales) {
|
||||
return date.toLocaleDateString(currentLocale, options);
|
||||
}
|
||||
|
||||
// This is essentially a hard-coded polyfill
|
||||
var optionList = getOptionList(options);
|
||||
if (optionList.length === 1 && optionList[0].name === 'weekday') {
|
||||
var weekday = [];
|
||||
weekday[0] = "Sun";
|
||||
weekday[1] = "Mon";
|
||||
weekday[2] = "Tue";
|
||||
weekday[3] = "Wed";
|
||||
weekday[4] = "Thu";
|
||||
weekday[5] = "Fri";
|
||||
weekday[6] = "Sat";
|
||||
return weekday[date.getDay()];
|
||||
}
|
||||
|
||||
return date.toLocaleDateString();
|
||||
}
|
||||
|
||||
function toLocaleTimeString(date, options) {
|
||||
|
||||
options = options || {};
|
||||
|
||||
var currentLocale = getCurrentLocale();
|
||||
|
||||
if (currentLocale && toLocaleTimeStringSupportsLocales) {
|
||||
return date.toLocaleTimeString(currentLocale, options);
|
||||
}
|
||||
|
||||
return date.toLocaleTimeString();
|
||||
}
|
||||
|
||||
function getDisplayTime(date) {
|
||||
|
||||
if ((typeof date).toString().toLowerCase() === 'string') {
|
||||
try {
|
||||
|
||||
date = parseISO8601Date(date, true);
|
||||
|
||||
} catch (err) {
|
||||
return date;
|
||||
}
|
||||
}
|
||||
|
||||
if (toLocaleTimeStringSupportsLocales) {
|
||||
return toLocaleTimeString(date, {
|
||||
|
||||
hour: 'numeric',
|
||||
minute: '2-digit'
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
var time = toLocaleTimeString(date);
|
||||
|
||||
var timeLower = time.toLowerCase();
|
||||
|
||||
if (timeLower.indexOf('am') !== -1 || timeLower.indexOf('pm') !== -1) {
|
||||
|
||||
time = timeLower;
|
||||
var hour = date.getHours() % 12;
|
||||
var suffix = date.getHours() > 11 ? 'pm' : 'am';
|
||||
if (!hour) {
|
||||
hour = 12;
|
||||
}
|
||||
var minutes = date.getMinutes();
|
||||
|
||||
if (minutes < 10) {
|
||||
minutes = '0' + minutes;
|
||||
}
|
||||
|
||||
minutes = ':' + minutes;
|
||||
time = hour + minutes + suffix;
|
||||
} else {
|
||||
|
||||
var timeParts = time.split(':');
|
||||
|
||||
// Trim off seconds
|
||||
if (timeParts.length > 2) {
|
||||
timeParts.length -= 1;
|
||||
time = timeParts.join(':');
|
||||
}
|
||||
}
|
||||
|
||||
return time;
|
||||
}
|
||||
|
||||
function isRelativeDay(date, offsetInDays) {
|
||||
var yesterday = new Date();
|
||||
var day = yesterday.getDate() + offsetInDays;
|
||||
|
||||
yesterday.setDate(day); // automatically adjusts month/year appropriately
|
||||
|
||||
return date.getFullYear() === yesterday.getFullYear() && date.getMonth() === yesterday.getMonth() && date.getDate() === day;
|
||||
}
|
||||
|
||||
return {
|
||||
parseISO8601Date: parseISO8601Date,
|
||||
getDisplayRunningTime: getDisplayRunningTime,
|
||||
toLocaleDateString: toLocaleDateString,
|
||||
toLocaleString: toLocaleString,
|
||||
getDisplayTime: getDisplayTime,
|
||||
isRelativeDay: isRelativeDay
|
||||
};
|
||||
});
|
||||
define(["globalize"],function(globalize){"use strict";function parseISO8601Date(s,toLocal){var re=/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d+)?(Z|([+-])(\d{2}):(\d{2}))?/,d=s.match(re);if(!d)throw"Couldn't parse ISO 8601 date string '"+s+"'";var a=[1,2,3,4,5,6,10,11];for(var i in a)d[a[i]]=parseInt(d[a[i]],10);d[7]=parseFloat(d[7]);var ms=Date.UTC(d[1],d[2]-1,d[3],d[4],d[5],d[6]);if(d[7]>0&&(ms+=Math.round(1e3*d[7])),"Z"!==d[8]&&d[10]){var offset=60*d[10]*60*1e3;d[11]&&(offset+=60*d[11]*1e3),"-"===d[9]?ms-=offset:ms+=offset}else toLocal===!1&&(ms+=6e4*(new Date).getTimezoneOffset());return new Date(ms)}function getDisplayRunningTime(ticks){var ticksPerHour=36e9,ticksPerMinute=6e8,ticksPerSecond=1e7,parts=[],hours=ticks/ticksPerHour;hours=Math.floor(hours),hours&&parts.push(hours),ticks-=hours*ticksPerHour;var minutes=ticks/ticksPerMinute;minutes=Math.floor(minutes),ticks-=minutes*ticksPerMinute,minutes<10&&hours&&(minutes="0"+minutes),parts.push(minutes);var seconds=ticks/ticksPerSecond;return seconds=Math.floor(seconds),seconds<10&&(seconds="0"+seconds),parts.push(seconds),parts.join(":")}function getCurrentLocale(){var locale=globalize.getCurrentLocale();return locale}function getOptionList(options){var list=[];for(var i in options)list.push({name:i,value:options[i]});return list}function toLocaleString(date,options){options=options||{};var currentLocale=getCurrentLocale();return currentLocale&&toLocaleTimeStringSupportsLocales?date.toLocaleString(currentLocale,options):date.toLocaleString()}function toLocaleDateString(date,options){options=options||{};var currentLocale=getCurrentLocale();if(currentLocale&&toLocaleTimeStringSupportsLocales)return date.toLocaleDateString(currentLocale,options);var optionList=getOptionList(options);if(1===optionList.length&&"weekday"===optionList[0].name){var weekday=[];return weekday[0]="Sun",weekday[1]="Mon",weekday[2]="Tue",weekday[3]="Wed",weekday[4]="Thu",weekday[5]="Fri",weekday[6]="Sat",weekday[date.getDay()]}return date.toLocaleDateString()}function toLocaleTimeString(date,options){options=options||{};var currentLocale=getCurrentLocale();return currentLocale&&toLocaleTimeStringSupportsLocales?date.toLocaleTimeString(currentLocale,options):date.toLocaleTimeString()}function getDisplayTime(date){if("string"===(typeof date).toString().toLowerCase())try{date=parseISO8601Date(date,!0)}catch(err){return date}if(toLocaleTimeStringSupportsLocales)return toLocaleTimeString(date,{hour:"numeric",minute:"2-digit"});var time=toLocaleTimeString(date),timeLower=time.toLowerCase();if(timeLower.indexOf("am")!==-1||timeLower.indexOf("pm")!==-1){time=timeLower;var hour=date.getHours()%12,suffix=date.getHours()>11?"pm":"am";hour||(hour=12);var minutes=date.getMinutes();minutes<10&&(minutes="0"+minutes),minutes=":"+minutes,time=hour+minutes+suffix}else{var timeParts=time.split(":");timeParts.length>2&&(timeParts.length-=1,time=timeParts.join(":"))}return time}function isRelativeDay(date,offsetInDays){var yesterday=new Date,day=yesterday.getDate()+offsetInDays;return yesterday.setDate(day),date.getFullYear()===yesterday.getFullYear()&&date.getMonth()===yesterday.getMonth()&&date.getDate()===day}var toLocaleTimeStringSupportsLocales=function(){try{(new Date).toLocaleTimeString("i")}catch(e){return"RangeError"===e.name}return!1}();return{parseISO8601Date:parseISO8601Date,getDisplayRunningTime:getDisplayRunningTime,toLocaleDateString:toLocaleDateString,toLocaleString:toLocaleString,getDisplayTime:getDisplayTime,isRelativeDay:isRelativeDay}});
|
|
@ -1,40 +1 @@
|
|||
define(['connectionManager', 'confirm', 'embyRouter', 'globalize'], function (connectionManager, confirm, embyRouter, globalize) {
|
||||
'use strict';
|
||||
|
||||
function deleteItem(options) {
|
||||
|
||||
var item = options.item;
|
||||
var itemId = item.Id;
|
||||
var parentId = item.SeasonId || item.SeriesId || item.ParentId;
|
||||
var serverId = item.ServerId;
|
||||
|
||||
var msg = globalize.translate('sharedcomponents#ConfirmDeleteItem');
|
||||
var title = globalize.translate('sharedcomponents#HeaderDeleteItem');
|
||||
var apiClient = connectionManager.getApiClient(item.ServerId);
|
||||
|
||||
return confirm({
|
||||
|
||||
title: title,
|
||||
text: msg,
|
||||
confirmText: globalize.translate('sharedcomponents#Delete'),
|
||||
primary: 'cancel'
|
||||
|
||||
}).then(function () {
|
||||
|
||||
return apiClient.deleteItem(itemId).then(function () {
|
||||
|
||||
if (options.navigate) {
|
||||
if (parentId) {
|
||||
embyRouter.showItem(parentId, serverId);
|
||||
} else {
|
||||
embyRouter.goHome();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
deleteItem: deleteItem
|
||||
};
|
||||
});
|
||||
define(["connectionManager","confirm","embyRouter","globalize"],function(connectionManager,confirm,embyRouter,globalize){"use strict";function deleteItem(options){var item=options.item,itemId=item.Id,parentId=item.SeasonId||item.SeriesId||item.ParentId,serverId=item.ServerId,msg=globalize.translate("sharedcomponents#ConfirmDeleteItem"),title=globalize.translate("sharedcomponents#HeaderDeleteItem"),apiClient=connectionManager.getApiClient(item.ServerId);return confirm({title:title,text:msg,confirmText:globalize.translate("sharedcomponents#Delete"),primary:"cancel"}).then(function(){return apiClient.deleteItem(itemId).then(function(){options.navigate&&(parentId?embyRouter.showItem(parentId,serverId):embyRouter.goHome())})})}return{deleteItem:deleteItem}});
|
|
@ -1,33 +1 @@
|
|||
.promptDialog {
|
||||
border-radius: .25em !important;
|
||||
}
|
||||
|
||||
.promptDialogContent {
|
||||
padding: 1em 1.6em;
|
||||
}
|
||||
|
||||
.promptDialogButtons {
|
||||
position: relative;
|
||||
padding: 0 !important;
|
||||
margin: 1em 0;
|
||||
display: -ms-flexbox;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
-ms-flex-direction: row;
|
||||
-webkit-flex-direction: row;
|
||||
flex-direction: row;
|
||||
-ms-flex-pack: end;
|
||||
-webkit-justify-content: flex-end;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.promptDialogButton {
|
||||
color: #52B54B;
|
||||
padding: 0.35em 1em;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.promptDialogButton:focus {
|
||||
color: #fff;
|
||||
background-color: #52B54B;
|
||||
}
|
||||
.promptDialog{-webkit-border-radius:.25em!important;border-radius:.25em!important}.promptDialogContent{padding:1em 1.6em}.promptDialogButtons{position:relative;padding:0!important;margin:1em 0;display:-webkit-flex;display:-webkit-box;display:flex;-webkit-flex-direction:row;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-justify-content:flex-end;-webkit-box-pack:end;justify-content:flex-end}.promptDialogButton{color:#52B54B;padding:.35em 1em;margin:0}.promptDialogButton:focus{color:#fff;background-color:#52B54B}
|
|
@ -1,110 +1 @@
|
|||
define(['dialogHelper', 'dom', 'layoutManager', 'scrollHelper', 'globalize', 'require', 'material-icons', 'emby-button', 'paper-icon-button-light', 'emby-input', 'formDialogStyle'], function (dialogHelper, dom, layoutManager, scrollHelper, globalize, require) {
|
||||
'use strict';
|
||||
|
||||
function showDialog(options, template) {
|
||||
|
||||
var dialogOptions = {
|
||||
removeOnClose: true,
|
||||
scrollY: false
|
||||
};
|
||||
|
||||
var enableTvLayout = layoutManager.tv;
|
||||
|
||||
if (enableTvLayout) {
|
||||
dialogOptions.size = 'fullscreen';
|
||||
}
|
||||
|
||||
var dlg = dialogHelper.createDialog(dialogOptions);
|
||||
|
||||
dlg.classList.add('formDialog');
|
||||
|
||||
dlg.innerHTML = globalize.translateHtml(template, 'sharedcomponents');
|
||||
|
||||
dlg.style['align-items'] = 'center';
|
||||
dlg.style['justify-content'] = 'center';
|
||||
var formDialogContent = dlg.querySelector('.formDialogContent');
|
||||
formDialogContent.style['flex-grow'] = 'initial';
|
||||
|
||||
if (enableTvLayout) {
|
||||
formDialogContent.style['max-width'] = '50%';
|
||||
formDialogContent.style['max-height'] = '60%';
|
||||
scrollHelper.centerFocus.on(formDialogContent, false);
|
||||
} else {
|
||||
formDialogContent.style.maxWidth = (Math.min((options.buttons.length * 150) + 200, dom.getWindowSize().innerWidth - 50)) + 'px';
|
||||
dlg.classList.add('dialog-fullscreen-lowres');
|
||||
}
|
||||
|
||||
//dlg.querySelector('.btnCancel').addEventListener('click', function (e) {
|
||||
// dialogHelper.close(dlg);
|
||||
//});
|
||||
|
||||
if (options.title) {
|
||||
dlg.querySelector('.formDialogHeaderTitle').innerHTML = options.title || '';
|
||||
} else {
|
||||
dlg.querySelector('.formDialogHeaderTitle').classList.add('hide');
|
||||
}
|
||||
|
||||
dlg.querySelector('.text').innerHTML = options.html || options.text || '';
|
||||
|
||||
var i, length;
|
||||
var html = '';
|
||||
for (i = 0, length = options.buttons.length; i < length; i++) {
|
||||
|
||||
var item = options.buttons[i];
|
||||
var autoFocus = i === 0 ? ' autofocus' : '';
|
||||
|
||||
var buttonClass = 'btnOption raised formDialogFooterItem formDialogFooterItem-autosize';
|
||||
|
||||
if (item.type) {
|
||||
buttonClass += ' button-' + item.type;
|
||||
}
|
||||
|
||||
html += '<button is="emby-button" type="button" class="' + buttonClass + '" data-id="' + item.id + '"' + autoFocus + '>' + item.name + '</button>';
|
||||
}
|
||||
|
||||
dlg.querySelector('.formDialogFooter').innerHTML = html;
|
||||
|
||||
var dialogResult;
|
||||
function onButtonClick() {
|
||||
dialogResult = this.getAttribute('data-id');
|
||||
dialogHelper.close(dlg);
|
||||
}
|
||||
|
||||
var buttons = dlg.querySelectorAll('.btnOption');
|
||||
for (i = 0, length = buttons.length; i < length; i++) {
|
||||
buttons[i].addEventListener('click', onButtonClick);
|
||||
}
|
||||
|
||||
return dialogHelper.open(dlg).then(function () {
|
||||
|
||||
if (enableTvLayout) {
|
||||
scrollHelper.centerFocus.off(dlg.querySelector('.formDialogContent'), false);
|
||||
}
|
||||
|
||||
if (dialogResult) {
|
||||
return dialogResult;
|
||||
} else {
|
||||
return Promise.reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return function (text, title) {
|
||||
|
||||
var options;
|
||||
if (typeof text === 'string') {
|
||||
options = {
|
||||
title: title,
|
||||
text: text
|
||||
};
|
||||
} else {
|
||||
options = text;
|
||||
}
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
require(['text!./dialog.template.html'], function (template) {
|
||||
showDialog(options, template).then(resolve, reject);
|
||||
});
|
||||
});
|
||||
};
|
||||
});
|
||||
define(["dialogHelper","dom","layoutManager","scrollHelper","globalize","require","material-icons","emby-button","paper-icon-button-light","emby-input","formDialogStyle"],function(dialogHelper,dom,layoutManager,scrollHelper,globalize,require){"use strict";function showDialog(options,template){function onButtonClick(){dialogResult=this.getAttribute("data-id"),dialogHelper.close(dlg)}var dialogOptions={removeOnClose:!0,scrollY:!1},enableTvLayout=layoutManager.tv;enableTvLayout&&(dialogOptions.size="fullscreen");var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog"),dlg.innerHTML=globalize.translateHtml(template,"sharedcomponents"),dlg.style["align-items"]="center",dlg.style["justify-content"]="center";var formDialogContent=dlg.querySelector(".formDialogContent");formDialogContent.style["flex-grow"]="initial",enableTvLayout?(formDialogContent.style["max-width"]="50%",formDialogContent.style["max-height"]="60%",scrollHelper.centerFocus.on(formDialogContent,!1)):(formDialogContent.style.maxWidth=Math.min(150*options.buttons.length+200,dom.getWindowSize().innerWidth-50)+"px",dlg.classList.add("dialog-fullscreen-lowres")),options.title?dlg.querySelector(".formDialogHeaderTitle").innerHTML=options.title||"":dlg.querySelector(".formDialogHeaderTitle").classList.add("hide"),dlg.querySelector(".text").innerHTML=options.html||options.text||"";var i,length,html="";for(i=0,length=options.buttons.length;i<length;i++){var item=options.buttons[i],autoFocus=0===i?" autofocus":"",buttonClass="btnOption raised formDialogFooterItem formDialogFooterItem-autosize";item.type&&(buttonClass+=" button-"+item.type),html+='<button is="emby-button" type="button" class="'+buttonClass+'" data-id="'+item.id+'"'+autoFocus+">"+item.name+"</button>"}dlg.querySelector(".formDialogFooter").innerHTML=html;var dialogResult,buttons=dlg.querySelectorAll(".btnOption");for(i=0,length=buttons.length;i<length;i++)buttons[i].addEventListener("click",onButtonClick);return dialogHelper.open(dlg).then(function(){return enableTvLayout&&scrollHelper.centerFocus.off(dlg.querySelector(".formDialogContent"),!1),dialogResult?dialogResult:Promise.reject()})}return function(text,title){var options;return options="string"==typeof text?{title:title,text:text}:text,new Promise(function(resolve,reject){require(["text!./dialog.template.html"],function(template){showDialog(options,template).then(resolve,reject)})})}});
|
|
@ -1,167 +1 @@
|
|||
.dialogContainer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 999999 !important;
|
||||
contain: strict;
|
||||
}
|
||||
|
||||
.dialog {
|
||||
margin: 0;
|
||||
border-radius: 4px;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
will-change: transform;
|
||||
/* Strict does not work well with actionsheet */
|
||||
contain: style;
|
||||
box-shadow: 0 16px 24px 2px rgba(0, 0, 0, 0.14), 0 6px 30px 5px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.dialog-fixedSize {
|
||||
border-radius: 0;
|
||||
max-height: none;
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.dialog-fullscreen {
|
||||
/* Needed due to formDialog style */
|
||||
position: fixed !important;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
@keyframes scaledown {
|
||||
from {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 0;
|
||||
transform: scale(0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes scaleup {
|
||||
from {
|
||||
transform: scale(0);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadein {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadeout {
|
||||
|
||||
from {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slideup {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate3d(0, 30%, 0);
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slidedown {
|
||||
|
||||
from {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 0;
|
||||
transform: translate3d(0, 30%, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (max-width: 1280px), all and (max-height: 720px) {
|
||||
|
||||
.dialog-fixedSize, .dialog-fullscreen-lowres {
|
||||
position: fixed !important;
|
||||
top: 0 !important;
|
||||
bottom: 0 !important;
|
||||
left: 0 !important;
|
||||
right: 0 !important;
|
||||
margin: 0 !important;
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (min-width: 1280px) and (min-height: 720px) {
|
||||
|
||||
.dialog-medium {
|
||||
width: 80%;
|
||||
height: 80%;
|
||||
}
|
||||
|
||||
.dialog-medium-tall {
|
||||
width: 80%;
|
||||
height: 90%;
|
||||
}
|
||||
|
||||
.dialog-small {
|
||||
width: 60%;
|
||||
height: 80%;
|
||||
}
|
||||
|
||||
.dialog-fullscreen-border {
|
||||
width: 90%;
|
||||
height: 90%;
|
||||
}
|
||||
}
|
||||
|
||||
.noScroll {
|
||||
overflow-x: hidden !important;
|
||||
overflow-y: hidden !important;
|
||||
}
|
||||
|
||||
.dialogBackdrop {
|
||||
background-color: #000;
|
||||
opacity: 0;
|
||||
position: fixed !important;
|
||||
top: 0 !important;
|
||||
bottom: 0 !important;
|
||||
left: 0 !important;
|
||||
right: 0 !important;
|
||||
margin: 0 !important;
|
||||
z-index: 999999 !important;
|
||||
transition: opacity ease-out 0.2s;
|
||||
}
|
||||
|
||||
.dialogBackdropOpened {
|
||||
opacity: .6;
|
||||
}
|
||||
.dialogContainer{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;position:fixed;top:0;left:0;right:0;bottom:0;z-index:999999!important;contain:strict}.dialog{margin:0;-webkit-border-radius:4px;border-radius:4px;-webkit-font-smoothing:antialiased;border:0;padding:0;will-change:transform;contain:style;-webkit-box-shadow:0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.4);box-shadow:0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.4)}.dialog-fixedSize{-webkit-border-radius:0;border-radius:0;max-height:none;max-width:none}.dialog-fullscreen{position:fixed!important;top:0;bottom:0;left:0;right:0;margin:0;-webkit-box-shadow:none;box-shadow:none}@-webkit-keyframes scaledown{from{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:scale(0);transform:scale(0)}}@keyframes scaledown{from{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:scale(0);transform:scale(0)}}@-webkit-keyframes scaleup{from{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:none;transform:none}}@keyframes scaleup{from{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:none;transform:none}}@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@keyframes fadein{from{opacity:0}to{opacity:1}}@-webkit-keyframes fadeout{from{opacity:1}to{opacity:0}}@keyframes fadeout{from{opacity:1}to{opacity:0}}@-webkit-keyframes slideup{from{opacity:0;-webkit-transform:translate3d(0,30%,0);transform:translate3d(0,30%,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes slideup{from{opacity:0;-webkit-transform:translate3d(0,30%,0);transform:translate3d(0,30%,0)}to{opacity:1;-webkit-transform:none;transform:none}}@-webkit-keyframes slidedown{from{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:translate3d(0,30%,0);transform:translate3d(0,30%,0)}}@keyframes slidedown{from{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:translate3d(0,30%,0);transform:translate3d(0,30%,0)}}@media all and (max-width:1280px),all and (max-height:720px){.dialog-fixedSize,.dialog-fullscreen-lowres{position:fixed!important;top:0!important;bottom:0!important;left:0!important;right:0!important;margin:0!important;-webkit-box-shadow:none;box-shadow:none}}@media all and (min-width:1280px) and (min-height:720px){.dialog-medium{width:80%;height:80%}.dialog-medium-tall{width:80%;height:90%}.dialog-small{width:60%;height:80%}.dialog-fullscreen-border{width:90%;height:90%}}.noScroll{overflow-x:hidden!important;overflow-y:hidden!important}.dialogBackdrop{background-color:#000;opacity:0;position:fixed!important;top:0!important;bottom:0!important;left:0!important;right:0!important;margin:0!important;z-index:999999!important;-webkit-transition:opacity ease-out .2s;-o-transition:opacity ease-out .2s;transition:opacity ease-out .2s}.dialogBackdropOpened{opacity:.6}
|
File diff suppressed because one or more lines are too long
|
@ -1,158 +1 @@
|
|||
define([], function () {
|
||||
'use strict';
|
||||
|
||||
function parentWithAttribute(elem, name, value) {
|
||||
|
||||
while ((value ? elem.getAttribute(name) !== value : !elem.getAttribute(name))) {
|
||||
elem = elem.parentNode;
|
||||
|
||||
if (!elem || !elem.getAttribute) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return elem;
|
||||
}
|
||||
|
||||
function parentWithTag(elem, tagNames) {
|
||||
|
||||
// accept both string and array passed in
|
||||
if (!Array.isArray(tagNames)) {
|
||||
tagNames = [tagNames];
|
||||
}
|
||||
|
||||
while (tagNames.indexOf(elem.tagName || '') === -1) {
|
||||
elem = elem.parentNode;
|
||||
|
||||
if (!elem) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return elem;
|
||||
}
|
||||
|
||||
function parentWithClass(elem, className) {
|
||||
|
||||
while (!elem.classList || !elem.classList.contains(className)) {
|
||||
elem = elem.parentNode;
|
||||
|
||||
if (!elem) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return elem;
|
||||
}
|
||||
|
||||
var supportsCaptureOption = false;
|
||||
try {
|
||||
var opts = Object.defineProperty({}, 'capture', {
|
||||
get: function () {
|
||||
supportsCaptureOption = true;
|
||||
}
|
||||
});
|
||||
window.addEventListener("test", null, opts);
|
||||
} catch (e) { }
|
||||
|
||||
function addEventListenerWithOptions(target, type, handler, options) {
|
||||
var optionsOrCapture = options;
|
||||
if (!supportsCaptureOption) {
|
||||
optionsOrCapture = options.capture;
|
||||
}
|
||||
target.addEventListener(type, handler, optionsOrCapture);
|
||||
}
|
||||
|
||||
function removeEventListenerWithOptions(target, type, handler, options) {
|
||||
var optionsOrCapture = options;
|
||||
if (!supportsCaptureOption) {
|
||||
optionsOrCapture = options.capture;
|
||||
}
|
||||
target.removeEventListener(type, handler, optionsOrCapture);
|
||||
}
|
||||
|
||||
var windowSize;
|
||||
var windowSizeEventsBound;
|
||||
function clearWindowSize() {
|
||||
windowSize = null;
|
||||
}
|
||||
|
||||
function getWindowSize() {
|
||||
if (!windowSize) {
|
||||
windowSize = {
|
||||
innerHeight: window.innerHeight,
|
||||
innerWidth: window.innerWidth
|
||||
};
|
||||
|
||||
if (!windowSizeEventsBound) {
|
||||
windowSizeEventsBound = true;
|
||||
addEventListenerWithOptions(window, "orientationchange", clearWindowSize, { passive: true });
|
||||
addEventListenerWithOptions(window, 'resize', clearWindowSize, { passive: true });
|
||||
}
|
||||
}
|
||||
|
||||
return windowSize;
|
||||
}
|
||||
|
||||
var _animationEvent;
|
||||
function whichAnimationEvent() {
|
||||
|
||||
if (_animationEvent) {
|
||||
return _animationEvent;
|
||||
}
|
||||
|
||||
var t,
|
||||
el = document.createElement("div");
|
||||
var animations = {
|
||||
"animation": "animationend",
|
||||
"OAnimation": "oAnimationEnd",
|
||||
"MozAnimation": "animationend",
|
||||
"WebkitAnimation": "webkitAnimationEnd"
|
||||
};
|
||||
for (t in animations) {
|
||||
if (el.style[t] !== undefined) {
|
||||
_animationEvent = animations[t];
|
||||
return animations[t];
|
||||
}
|
||||
}
|
||||
|
||||
_animationEvent = 'animationend';
|
||||
return _animationEvent;
|
||||
}
|
||||
|
||||
var _transitionEvent;
|
||||
function whichTransitionEvent() {
|
||||
if (_transitionEvent) {
|
||||
return _transitionEvent;
|
||||
}
|
||||
|
||||
var t,
|
||||
el = document.createElement("div");
|
||||
var transitions = {
|
||||
"transition": "transitionend",
|
||||
"OTransition": "oTransitionEnd",
|
||||
"MozTransition": "transitionend",
|
||||
"WebkitTransition": "webkitTransitionEnd"
|
||||
};
|
||||
for (t in transitions) {
|
||||
if (el.style[t] !== undefined) {
|
||||
_transitionEvent = transitions[t];
|
||||
return transitions[t];
|
||||
}
|
||||
}
|
||||
|
||||
_transitionEvent = 'transitionend';
|
||||
return _transitionEvent;
|
||||
}
|
||||
|
||||
return {
|
||||
parentWithAttribute: parentWithAttribute,
|
||||
parentWithClass: parentWithClass,
|
||||
parentWithTag: parentWithTag,
|
||||
addEventListener: addEventListenerWithOptions,
|
||||
removeEventListener: removeEventListenerWithOptions,
|
||||
getWindowSize: getWindowSize,
|
||||
whichTransitionEvent: whichTransitionEvent,
|
||||
whichAnimationEvent: whichAnimationEvent
|
||||
};
|
||||
});
|
||||
define([],function(){"use strict";function parentWithAttribute(elem,name,value){for(;value?elem.getAttribute(name)!==value:!elem.getAttribute(name);)if(elem=elem.parentNode,!elem||!elem.getAttribute)return null;return elem}function parentWithTag(elem,tagNames){for(Array.isArray(tagNames)||(tagNames=[tagNames]);tagNames.indexOf(elem.tagName||"")===-1;)if(elem=elem.parentNode,!elem)return null;return elem}function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function addEventListenerWithOptions(target,type,handler,options){var optionsOrCapture=options;supportsCaptureOption||(optionsOrCapture=options.capture),target.addEventListener(type,handler,optionsOrCapture)}function removeEventListenerWithOptions(target,type,handler,options){var optionsOrCapture=options;supportsCaptureOption||(optionsOrCapture=options.capture),target.removeEventListener(type,handler,optionsOrCapture)}function clearWindowSize(){windowSize=null}function getWindowSize(){return windowSize||(windowSize={innerHeight:window.innerHeight,innerWidth:window.innerWidth},windowSizeEventsBound||(windowSizeEventsBound=!0,addEventListenerWithOptions(window,"orientationchange",clearWindowSize,{passive:!0}),addEventListenerWithOptions(window,"resize",clearWindowSize,{passive:!0}))),windowSize}function whichAnimationEvent(){if(_animationEvent)return _animationEvent;var t,el=document.createElement("div"),animations={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(t in animations)if(void 0!==el.style[t])return _animationEvent=animations[t],animations[t];return _animationEvent="animationend"}function whichTransitionEvent(){if(_transitionEvent)return _transitionEvent;var t,el=document.createElement("div"),transitions={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in transitions)if(void 0!==el.style[t])return _transitionEvent=transitions[t],transitions[t];return _transitionEvent="transitionend"}var supportsCaptureOption=!1;try{var opts=Object.defineProperty({},"capture",{get:function(){supportsCaptureOption=!0}});window.addEventListener("test",null,opts)}catch(e){}var windowSize,windowSizeEventsBound,_animationEvent,_transitionEvent;return{parentWithAttribute:parentWithAttribute,parentWithClass:parentWithClass,parentWithTag:parentWithTag,addEventListener:addEventListenerWithOptions,removeEventListener:removeEventListenerWithOptions,getWindowSize:getWindowSize,whichTransitionEvent:whichTransitionEvent,whichAnimationEvent:whichAnimationEvent}});
|
|
@ -1,244 +1 @@
|
|||
.emby-button {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
margin: 0 .29em;
|
||||
text-align: center;
|
||||
font-size: inherit;
|
||||
font-family: inherit;
|
||||
color: inherit;
|
||||
outline-width: 0;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
z-index: 0;
|
||||
padding: 1em .7em;
|
||||
font-weight: normal;
|
||||
vertical-align: middle;
|
||||
border: 0;
|
||||
vertical-align: middle;
|
||||
border-radius: 2px;
|
||||
/* These are getting an outline in opera tv browsers, which run chrome 30 */
|
||||
outline: none !important;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
font-weight: 500;
|
||||
/* Disable webkit tap highlighting */
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
}
|
||||
|
||||
.emby-button::-moz-focus-inner {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.button-flat {
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.emby-button-focusscale {
|
||||
transition: transform 180ms ease-out !important;
|
||||
-webkit-transform-origin: center center;
|
||||
transform-origin: center center;
|
||||
}
|
||||
|
||||
.emby-button-focusscale:focus {
|
||||
transform: scale(1.16);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.emby-button > i {
|
||||
/* For non-fab buttons that have icons */
|
||||
font-size: 1.36em;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
}
|
||||
|
||||
.fab {
|
||||
display: inline-flex;
|
||||
border-radius: 50%;
|
||||
background-color: rgba(170,170,190, .4);
|
||||
padding: .6em;
|
||||
box-sizing: border-box;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.fab > i {
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
vertical-align: middle;
|
||||
font-size: 2.85em;
|
||||
}
|
||||
|
||||
.emby-button-noflex {
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.fab.mini {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.fab.mini > i {
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
font-size: 1.72em;
|
||||
}
|
||||
|
||||
.emby-button.block {
|
||||
display: block;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: .25em 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.raised:focus {
|
||||
box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.4);
|
||||
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.emby-button > i + span {
|
||||
margin-left: .5em;
|
||||
}
|
||||
|
||||
.emby-button > span + i {
|
||||
margin-left: .5em;
|
||||
}
|
||||
|
||||
.paper-icon-button-light {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
margin: 0 .29em;
|
||||
background: transparent;
|
||||
text-align: center;
|
||||
font-size: inherit;
|
||||
font-family: inherit;
|
||||
color: inherit;
|
||||
outline-width: 0;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
z-index: 0;
|
||||
min-width: initial;
|
||||
min-height: initial;
|
||||
width: auto;
|
||||
height: auto;
|
||||
padding: 8px;
|
||||
font-weight: normal;
|
||||
vertical-align: middle;
|
||||
border: 0;
|
||||
vertical-align: middle;
|
||||
/* These are getting an outline in opera tv browsers, which run chrome 30 */
|
||||
outline: none !important;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
font-weight: 500;
|
||||
border-radius: 50%;
|
||||
/* Disable webkit tap highlighting */
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.paper-icon-button-light::-moz-focus-inner {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.paper-icon-button-light[disabled] {
|
||||
opacity: .3;
|
||||
}
|
||||
|
||||
.paper-icon-button-light > i {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
font-size: 1.6em;
|
||||
/* Make sure its on top of the ripple */
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.paper-icon-button-light > img {
|
||||
width: 1.72em;
|
||||
/* Can't use 100% height or it will stretch past the boundaries in safari */
|
||||
/*height: 100%;*/
|
||||
max-height: 100%;
|
||||
/* Make sure its on top of the ripple */
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.paper-icon-button-light:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
transition: opacity .3s ease-out;
|
||||
background: currentcolor;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.paper-icon-button-light:focus {
|
||||
color: #52B54B;
|
||||
}
|
||||
|
||||
.paper-icon-button-light:focus:after {
|
||||
opacity: .2;
|
||||
}
|
||||
|
||||
.emby-button-ripple-effect, .paper-icon-button-light-ripple-effect {
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
background: currentcolor;
|
||||
animation: ripple-animation .8s;
|
||||
opacity: 0.25;
|
||||
transform-origin: center center;
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
|
||||
@keyframes ripple-animation {
|
||||
from {
|
||||
transform: none;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
to {
|
||||
transform: scale(20);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.emby-button-foreground {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.icon-button-focusscale {
|
||||
transition: transform 180ms ease-out !important;
|
||||
-webkit-transform-origin: center center;
|
||||
transform-origin: center center;
|
||||
}
|
||||
|
||||
.icon-button-focusscale:focus {
|
||||
transform: scale(1.3);
|
||||
z-index: 1;
|
||||
}
|
||||
.emby-button,.fab{-webkit-box-sizing:border-box}.emby-button,.paper-icon-button-light{text-align:center;outline:0!important;overflow:hidden;font-weight:500;-webkit-tap-highlight-color:transparent}.emby-button,.paper-icon-button-light,.paper-icon-button-light>i,.paper-icon-button-light>img{position:relative;vertical-align:middle}.emby-button{display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;box-sizing:border-box;margin:0 .29em;font-size:inherit;font-family:inherit;color:inherit;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none;cursor:pointer;z-index:0;padding:1em .7em;border:0;-webkit-border-radius:2px;border-radius:2px}.emby-button.block,.fab{-webkit-box-align:center}.emby-button::-moz-focus-inner{border:0}.button-flat{background:0 0;-webkit-box-shadow:none;box-shadow:none;text-transform:uppercase}.emby-button-focusscale{-webkit-transition:-webkit-transform 180ms ease-out!important;-o-transition:transform 180ms ease-out!important;transition:transform 180ms ease-out!important;-webkit-transform-origin:center center;transform-origin:center center}.emby-button-focusscale:focus{-webkit-transform:scale(1.16);transform:scale(1.16);z-index:1}.emby-button>i{font-size:1.36em;width:1em;height:1em}.fab{display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-border-radius:50%;border-radius:50%;background-color:rgba(170,170,190,.4);padding:.6em;box-sizing:border-box;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;text-align:center;color:#fff;margin:0}.fab>i{height:1em;width:1em;vertical-align:middle;font-size:2.85em}.emby-button-noflex{display:inline-block;white-space:nowrap}.fab.mini{padding:8px}.fab.mini>i{height:1em;width:1em;font-size:1.72em}.emby-button.block{display:block;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;margin:.25em 0;width:100%}.raised:focus{-webkit-box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);-webkit-transition:-webkit-box-shadow .28s cubic-bezier(.4,0,.2,1);-o-transition:box-shadow .28s cubic-bezier(.4,0,.2,1);transition:box-shadow .28s cubic-bezier(.4,0,.2,1)}.emby-button>i+span,.emby-button>span+i{margin-left:.5em}.paper-icon-button-light{display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 .29em;background:0 0;font-size:inherit;font-family:inherit;color:inherit;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none;cursor:pointer;z-index:0;min-width:initial;min-height:initial;width:auto;height:auto;padding:8px;border:0;-webkit-border-radius:50%;border-radius:50%;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.paper-icon-button-light::-moz-focus-inner{border:0}.paper-icon-button-light[disabled]{opacity:.3}.paper-icon-button-light>i{width:1em;height:1em;font-size:1.6em;z-index:1}.paper-icon-button-light>img{width:1.72em;max-height:100%;z-index:1}.paper-icon-button-light:after{content:'';position:absolute;top:0;left:0;right:0;bottom:0;-webkit-transition:opacity .3s ease-out;-o-transition:opacity .3s ease-out;transition:opacity .3s ease-out;background:currentcolor;opacity:0}.paper-icon-button-light:focus{color:#52B54B}.paper-icon-button-light:focus:after{opacity:.2}.emby-button-ripple-effect,.paper-icon-button-light-ripple-effect{position:absolute;-webkit-border-radius:50%;border-radius:50%;width:50px;height:50px;top:50%;left:50%;background:currentcolor;-webkit-animation:ripple-animation .8s;animation:ripple-animation .8s;opacity:.25;-webkit-transform-origin:center center;transform-origin:center center;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}@-webkit-keyframes ripple-animation{from{-webkit-transform:none;transform:none;opacity:.5}to{-webkit-transform:scale(20);transform:scale(20);opacity:0}}@keyframes ripple-animation{from{-webkit-transform:none;transform:none;opacity:.5}to{-webkit-transform:scale(20);transform:scale(20);opacity:0}}.emby-button-foreground{position:relative;z-index:1}.icon-button-focusscale{-webkit-transition:-webkit-transform 180ms ease-out!important;-o-transition:transform 180ms ease-out!important;transition:transform 180ms ease-out!important;-webkit-transform-origin:center center;transform-origin:center center}.icon-button-focusscale:focus{-webkit-transform:scale(1.3);transform:scale(1.3);z-index:1}
|
|
@ -1,106 +1 @@
|
|||
define(['browser', 'dom', 'layoutManager', 'css!./emby-button', 'registerElement'], function (browser, dom, layoutManager) {
|
||||
'use strict';
|
||||
|
||||
var EmbyButtonPrototype = Object.create(HTMLButtonElement.prototype);
|
||||
|
||||
function animateButtonInternal(e, btn) {
|
||||
|
||||
var div = document.createElement('div');
|
||||
|
||||
for (var i = 0, length = btn.classList.length; i < length; i++) {
|
||||
div.classList.add(btn.classList[i] + '-ripple-effect');
|
||||
}
|
||||
|
||||
var offsetX = e.offsetX || 0;
|
||||
var offsetY = e.offsetY || 0;
|
||||
|
||||
if (offsetX > 0 && offsetY > 0) {
|
||||
div.style.left = offsetX + 'px';
|
||||
div.style.top = offsetY + 'px';
|
||||
}
|
||||
|
||||
var firstChild = btn.firstChild;
|
||||
if (firstChild) {
|
||||
btn.insertBefore(div, btn.firstChild);
|
||||
} else {
|
||||
btn.appendChild(div);
|
||||
}
|
||||
|
||||
div.addEventListener(dom.whichAnimationEvent(), function () {
|
||||
div.parentNode.removeChild(div);
|
||||
}, false);
|
||||
}
|
||||
|
||||
function animateButton(e, btn) {
|
||||
|
||||
requestAnimationFrame(function () {
|
||||
animateButtonInternal(e, btn);
|
||||
});
|
||||
}
|
||||
|
||||
function onKeyDown(e) {
|
||||
|
||||
if (e.keyCode === 13) {
|
||||
animateButton(e, this);
|
||||
}
|
||||
}
|
||||
|
||||
function onMouseDown(e) {
|
||||
|
||||
if (e.button === 0) {
|
||||
animateButton(e, this);
|
||||
}
|
||||
}
|
||||
|
||||
function onClick(e) {
|
||||
|
||||
animateButton(e, this);
|
||||
}
|
||||
|
||||
function enableAnimation() {
|
||||
if (browser.tv) {
|
||||
// too slow
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
EmbyButtonPrototype.createdCallback = function () {
|
||||
|
||||
if (this.classList.contains('emby-button')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.classList.add('emby-button');
|
||||
|
||||
// Even though they support flex, it doesn't quite work with button elements
|
||||
if (browser.firefox || browser.safari) {
|
||||
this.classList.add('emby-button-noflex');
|
||||
}
|
||||
|
||||
if (layoutManager.tv) {
|
||||
this.classList.add('emby-button-focusscale');
|
||||
}
|
||||
|
||||
if (enableAnimation()) {
|
||||
dom.addEventListener(this, 'keydown', onKeyDown, {
|
||||
passive: true
|
||||
});
|
||||
if (browser.safari) {
|
||||
dom.addEventListener(this, 'click', onClick, {
|
||||
passive: true
|
||||
});
|
||||
} else {
|
||||
dom.addEventListener(this, 'mousedown', onMouseDown, {
|
||||
passive: true
|
||||
});
|
||||
//this.addEventListener('touchstart', animateButton);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
document.registerElement('emby-button', {
|
||||
prototype: EmbyButtonPrototype,
|
||||
extends: 'button'
|
||||
});
|
||||
});
|
||||
define(["browser","dom","layoutManager","css!./emby-button","registerElement"],function(browser,dom,layoutManager){"use strict";function animateButtonInternal(e,btn){for(var div=document.createElement("div"),i=0,length=btn.classList.length;i<length;i++)div.classList.add(btn.classList[i]+"-ripple-effect");var offsetX=e.offsetX||0,offsetY=e.offsetY||0;offsetX>0&&offsetY>0&&(div.style.left=offsetX+"px",div.style.top=offsetY+"px");var firstChild=btn.firstChild;firstChild?btn.insertBefore(div,btn.firstChild):btn.appendChild(div),div.addEventListener(dom.whichAnimationEvent(),function(){div.parentNode.removeChild(div)},!1)}function animateButton(e,btn){requestAnimationFrame(function(){animateButtonInternal(e,btn)})}function onKeyDown(e){13===e.keyCode&&animateButton(e,this)}function onMouseDown(e){0===e.button&&animateButton(e,this)}function onClick(e){animateButton(e,this)}function enableAnimation(){return!browser.tv}var EmbyButtonPrototype=Object.create(HTMLButtonElement.prototype);EmbyButtonPrototype.createdCallback=function(){this.classList.contains("emby-button")||(this.classList.add("emby-button"),(browser.firefox||browser.safari)&&this.classList.add("emby-button-noflex"),layoutManager.tv&&this.classList.add("emby-button-focusscale"),enableAnimation()&&(dom.addEventListener(this,"keydown",onKeyDown,{passive:!0}),browser.safari?dom.addEventListener(this,"click",onClick,{passive:!0}):dom.addEventListener(this,"mousedown",onMouseDown,{passive:!0})))},document.registerElement("emby-button",{prototype:EmbyButtonPrototype,extends:"button"})});
|
|
@ -1,82 +1 @@
|
|||
define(['browser', 'dom', 'layoutManager', 'css!./emby-button', 'registerElement'], function (browser, dom, layoutManager) {
|
||||
'use strict';
|
||||
|
||||
var EmbyButtonPrototype = Object.create(HTMLButtonElement.prototype);
|
||||
|
||||
function enableAnimation() {
|
||||
if (browser.tv) {
|
||||
// too slow
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function animateButtonInternal(e, btn) {
|
||||
|
||||
var div = document.createElement('div');
|
||||
|
||||
for (var i = 0, length = btn.classList.length; i < length; i++) {
|
||||
div.classList.add(btn.classList[i] + '-ripple-effect');
|
||||
}
|
||||
|
||||
var offsetX = e.offsetX || 0;
|
||||
var offsetY = e.offsetY || 0;
|
||||
|
||||
if (offsetX > 0 && offsetY > 0) {
|
||||
div.style.left = offsetX + 'px';
|
||||
div.style.top = offsetY + 'px';
|
||||
}
|
||||
|
||||
btn.appendChild(div);
|
||||
|
||||
div.addEventListener(dom.whichAnimationEvent(), function () {
|
||||
div.parentNode.removeChild(div);
|
||||
}, false);
|
||||
}
|
||||
|
||||
function animateButton(e, btn) {
|
||||
|
||||
requestAnimationFrame(function () {
|
||||
animateButtonInternal(e, btn);
|
||||
});
|
||||
}
|
||||
|
||||
function onKeyDown(e) {
|
||||
|
||||
if (e.keyCode === 13) {
|
||||
animateButton(e, this);
|
||||
}
|
||||
}
|
||||
|
||||
function onClick(e) {
|
||||
|
||||
animateButton(e, this);
|
||||
}
|
||||
|
||||
EmbyButtonPrototype.createdCallback = function () {
|
||||
|
||||
if (this.classList.contains('paper-icon-button-light')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.classList.add('paper-icon-button-light');
|
||||
|
||||
if (layoutManager.tv) {
|
||||
this.classList.add('icon-button-focusscale');
|
||||
}
|
||||
|
||||
if (enableAnimation()) {
|
||||
dom.addEventListener(this, 'keydown', onKeyDown, {
|
||||
passive: true
|
||||
});
|
||||
dom.addEventListener(this, 'click', onClick, {
|
||||
passive: true
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
document.registerElement('paper-icon-button-light', {
|
||||
prototype: EmbyButtonPrototype,
|
||||
extends: 'button'
|
||||
});
|
||||
});
|
||||
define(["browser","dom","layoutManager","css!./emby-button","registerElement"],function(browser,dom,layoutManager){"use strict";function enableAnimation(){return!browser.tv}function animateButtonInternal(e,btn){for(var div=document.createElement("div"),i=0,length=btn.classList.length;i<length;i++)div.classList.add(btn.classList[i]+"-ripple-effect");var offsetX=e.offsetX||0,offsetY=e.offsetY||0;offsetX>0&&offsetY>0&&(div.style.left=offsetX+"px",div.style.top=offsetY+"px"),btn.appendChild(div),div.addEventListener(dom.whichAnimationEvent(),function(){div.parentNode.removeChild(div)},!1)}function animateButton(e,btn){requestAnimationFrame(function(){animateButtonInternal(e,btn)})}function onKeyDown(e){13===e.keyCode&&animateButton(e,this)}function onClick(e){animateButton(e,this)}var EmbyButtonPrototype=Object.create(HTMLButtonElement.prototype);EmbyButtonPrototype.createdCallback=function(){this.classList.contains("paper-icon-button-light")||(this.classList.add("paper-icon-button-light"),layoutManager.tv&&this.classList.add("icon-button-focusscale"),enableAnimation()&&(dom.addEventListener(this,"keydown",onKeyDown,{passive:!0}),dom.addEventListener(this,"click",onClick,{passive:!0})))},document.registerElement("paper-icon-button-light",{prototype:EmbyButtonPrototype,extends:"button"})});
|
|
@ -1,139 +1 @@
|
|||
.mdl-checkbox {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
vertical-align: middle;
|
||||
display: inline-flex;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
padding-left: 2.6em;
|
||||
align-items: center;
|
||||
height: 2.3em;
|
||||
}
|
||||
|
||||
.checkboxFieldDescription {
|
||||
padding-left: 2.6em;
|
||||
}
|
||||
|
||||
.checkboxContainer {
|
||||
margin-bottom: 1.8em;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.checkboxContainer-withDescription {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.mdl-checkbox__input {
|
||||
position: absolute;
|
||||
/* 1px is for focusing purposes, so the focusManager doesn't skip over it */
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
opacity: 0;
|
||||
-ms-appearance: none;
|
||||
-moz-appearance: none;
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.checkboxOutline {
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
left: 0;
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
width: 1.83em;
|
||||
height: 1.83em;
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
border: 2px solid currentcolor;
|
||||
border-radius: 2px;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.mdl-checkbox__input:checked + span + span + .checkboxOutline {
|
||||
border-color: #52B54B;
|
||||
}
|
||||
|
||||
.mdl-checkbox__input[disabled] + span + span + .checkboxOutline {
|
||||
border-color: rgba(0, 0, 0, 0.26);
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.mdl-checkbox__focus-helper {
|
||||
position: absolute;
|
||||
top: -0.915em;
|
||||
left: -0.915em;
|
||||
width: 3.66em;
|
||||
height: 3.66em;
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
margin: 3px 0 0 0;
|
||||
border-radius: 50%;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.mdl-checkbox__input:focus + span + .mdl-checkbox__focus-helper {
|
||||
background-color: rgba(82, 181, 75, 0.26);
|
||||
}
|
||||
|
||||
.mdl-checkbox__tick-outline {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background: transparent;
|
||||
transition-duration: 0.28s;
|
||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition-property: background;
|
||||
}
|
||||
|
||||
.mdl-checkbox__input:checked + span + span + .checkboxOutline .mdl-checkbox__tick-outline {
|
||||
background: #52B54B url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmVyc2lvbj0iMS4xIgogICB2aWV3Qm94PSIwIDAgMSAxIgogICBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWluWU1pbiBtZWV0Ij4KICA8cGF0aAogICAgIGQ9Ik0gMC4wNDAzODA1OSwwLjYyNjc3NjcgMC4xNDY0NDY2MSwwLjUyMDcxMDY4IDAuNDI5Mjg5MzIsMC44MDM1NTMzOSAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IE0gMC4yMTcxNTcyOSwwLjgwMzU1MzM5IDAuODUzNTUzMzksMC4xNjcxNTcyOSAwLjk1OTYxOTQxLDAuMjczMjIzMyAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IgogICAgIGlkPSJyZWN0Mzc4MCIKICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lIiAvPgo8L3N2Zz4K");
|
||||
}
|
||||
|
||||
.mdl-checkbox__input:checked[disabled] + span + span + .checkboxOutline .mdl-checkbox__tick-outline {
|
||||
background: rgba(0, 0, 0, 0.26) url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmVyc2lvbj0iMS4xIgogICB2aWV3Qm94PSIwIDAgMSAxIgogICBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWluWU1pbiBtZWV0Ij4KICA8cGF0aAogICAgIGQ9Ik0gMC4wNDAzODA1OSwwLjYyNjc3NjcgMC4xNDY0NDY2MSwwLjUyMDcxMDY4IDAuNDI5Mjg5MzIsMC44MDM1NTMzOSAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IE0gMC4yMTcxNTcyOSwwLjgwMzU1MzM5IDAuODUzNTUzMzksMC4xNjcxNTcyOSAwLjk1OTYxOTQxLDAuMjczMjIzMyAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IgogICAgIGlkPSJyZWN0Mzc4MCIKICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lIiAvPgo8L3N2Zz4K");
|
||||
}
|
||||
|
||||
.checkboxLabel {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.mdl-checkbox__input[disabled] + .checkboxLabel {
|
||||
color: rgba(0, 0, 0, 0.26);
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.checkboxList > .mdl-checkbox {
|
||||
display: flex;
|
||||
margin: .5em 0;
|
||||
}
|
||||
|
||||
.checkboxList-paperList {
|
||||
padding: 1em !important;
|
||||
margin: .75em 0 !important;
|
||||
}
|
||||
|
||||
.checkboxListLabel {
|
||||
opacity: .7;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
@-webkit-keyframes repaintChrome {
|
||||
from {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
to {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
.mdl-checkbox{position:relative;z-index:1;vertical-align:middle;display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;margin:0;padding:0 0 0 2.6em;-webkit-box-align:center;-webkit-align-items:center;align-items:center;height:2.3em}.checkboxFieldDescription{padding-left:2.6em}.checkboxContainer{margin-bottom:1.8em;display:-webkit-box;display:-webkit-flex;display:flex}.checkboxContainer-withDescription{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column}.mdl-checkbox__input{position:absolute;width:1px;height:1px;margin:0;padding:0;opacity:0;-ms-appearance:none;-moz-appearance:none;-webkit-appearance:none;appearance:none;border:none}.checkboxOutline{position:absolute;top:3px;left:0;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;width:1.83em;height:1.83em;margin:0;cursor:pointer;overflow:hidden;border:2px solid currentcolor;-webkit-border-radius:2px;border-radius:2px;z-index:2}.mdl-checkbox__input:checked+span+span+.checkboxOutline{border-color:#52B54B}.mdl-checkbox__input[disabled]+span+span+.checkboxOutline{border-color:rgba(0,0,0,.26);cursor:auto}.mdl-checkbox__focus-helper{position:absolute;top:-.915em;left:-.915em;width:3.66em;height:3.66em;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;margin:3px 0 0;-webkit-border-radius:50%;border-radius:50%;background-color:transparent}.mdl-checkbox__input:focus+span+.mdl-checkbox__focus-helper{background-color:rgba(82,181,75,.26)}.mdl-checkbox__tick-outline{position:absolute;top:0;left:0;height:100%;width:100%;background:0 0;-webkit-transition-duration:.28s;-o-transition-duration:.28s;transition-duration:.28s;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);-o-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-transition-property:background;-o-transition-property:background;transition-property:background}.mdl-checkbox__input:checked+span+span+.checkboxOutline .mdl-checkbox__tick-outline{background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmVyc2lvbj0iMS4xIgogICB2aWV3Qm94PSIwIDAgMSAxIgogICBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWluWU1pbiBtZWV0Ij4KICA8cGF0aAogICAgIGQ9Ik0gMC4wNDAzODA1OSwwLjYyNjc3NjcgMC4xNDY0NDY2MSwwLjUyMDcxMDY4IDAuNDI5Mjg5MzIsMC44MDM1NTMzOSAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IE0gMC4yMTcxNTcyOSwwLjgwMzU1MzM5IDAuODUzNTUzMzksMC4xNjcxNTcyOSAwLjk1OTYxOTQxLDAuMjczMjIzMyAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IgogICAgIGlkPSJyZWN0Mzc4MCIKICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lIiAvPgo8L3N2Zz4K) #52B54B}.mdl-checkbox__input:checked[disabled]+span+span+.checkboxOutline .mdl-checkbox__tick-outline{background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmVyc2lvbj0iMS4xIgogICB2aWV3Qm94PSIwIDAgMSAxIgogICBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWluWU1pbiBtZWV0Ij4KICA8cGF0aAogICAgIGQ9Ik0gMC4wNDAzODA1OSwwLjYyNjc3NjcgMC4xNDY0NDY2MSwwLjUyMDcxMDY4IDAuNDI5Mjg5MzIsMC44MDM1NTMzOSAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IE0gMC4yMTcxNTcyOSwwLjgwMzU1MzM5IDAuODUzNTUzMzksMC4xNjcxNTcyOSAwLjk1OTYxOTQxLDAuMjczMjIzMyAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IgogICAgIGlkPSJyZWN0Mzc4MCIKICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lIiAvPgo8L3N2Zz4K) rgba(0,0,0,.26)}.checkboxLabel{position:relative;cursor:pointer;margin:0}.mdl-checkbox__input[disabled]+.checkboxLabel{color:rgba(0,0,0,.26);cursor:auto}.checkboxList>.mdl-checkbox{display:-webkit-box;display:-webkit-flex;display:flex;margin:.5em 0}.checkboxList-paperList{padding:1em!important;margin:.75em 0!important}.checkboxListLabel{opacity:.7;margin-bottom:0}@-webkit-keyframes repaintChrome{from,to{padding:0}}
|
|
@ -1,89 +1 @@
|
|||
define(['browser', 'dom', 'css!./emby-checkbox', 'registerElement'], function (browser, dom) {
|
||||
'use strict';
|
||||
|
||||
var EmbyCheckboxPrototype = Object.create(HTMLInputElement.prototype);
|
||||
|
||||
function onKeyDown(e) {
|
||||
|
||||
// Don't submit form on enter
|
||||
if (e.keyCode === 13) {
|
||||
e.preventDefault();
|
||||
|
||||
this.checked = !this.checked;
|
||||
|
||||
this.dispatchEvent(new CustomEvent('change', {
|
||||
bubbles: true
|
||||
}));
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var enableRefreshHack = browser.tizen || browser.orsay || browser.operaTv || browser.web0s ? true : false;
|
||||
|
||||
function forceRefresh(loading) {
|
||||
|
||||
var elem = this.parentNode;
|
||||
|
||||
elem.style.webkitAnimationName = 'repaintChrome';
|
||||
elem.style.webkitAnimationDelay = (loading === true ? '500ms' : '');
|
||||
elem.style.webkitAnimationDuration = '10ms';
|
||||
elem.style.webkitAnimationIterationCount = '1';
|
||||
|
||||
setTimeout(function () {
|
||||
elem.style.webkitAnimationName = '';
|
||||
}, (loading === true ? 520 : 20));
|
||||
}
|
||||
|
||||
EmbyCheckboxPrototype.attachedCallback = function () {
|
||||
|
||||
if (this.getAttribute('data-embycheckbox') === 'true') {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setAttribute('data-embycheckbox', 'true');
|
||||
|
||||
this.classList.add('mdl-checkbox__input');
|
||||
|
||||
var labelElement = this.parentNode;
|
||||
labelElement.classList.add('mdl-checkbox');
|
||||
labelElement.classList.add('mdl-js-checkbox');
|
||||
|
||||
var labelTextElement = labelElement.querySelector('span');
|
||||
|
||||
var outlineClass = 'checkboxOutline';
|
||||
|
||||
var customClass = this.getAttribute('data-outlineclass');
|
||||
if (customClass) {
|
||||
outlineClass += ' ' + customClass;
|
||||
}
|
||||
|
||||
labelElement.insertAdjacentHTML('beforeend', '<span class="mdl-checkbox__focus-helper"></span><span class="' + outlineClass + '"><span class="mdl-checkbox__tick-outline"></span></span>');
|
||||
|
||||
labelTextElement.classList.add('checkboxLabel');
|
||||
|
||||
this.addEventListener('keydown', onKeyDown);
|
||||
|
||||
if (enableRefreshHack) {
|
||||
|
||||
forceRefresh.call(this, true);
|
||||
dom.addEventListener(this, 'click', forceRefresh, {
|
||||
passive: true
|
||||
});
|
||||
dom.addEventListener(this, 'blur', forceRefresh, {
|
||||
passive: true
|
||||
});
|
||||
dom.addEventListener(this, 'focus', forceRefresh, {
|
||||
passive: true
|
||||
});
|
||||
dom.addEventListener(this, 'change', forceRefresh, {
|
||||
passive: true
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
document.registerElement('emby-checkbox', {
|
||||
prototype: EmbyCheckboxPrototype,
|
||||
extends: 'input'
|
||||
});
|
||||
});
|
||||
define(["browser","dom","css!./emby-checkbox","registerElement"],function(browser,dom){"use strict";function onKeyDown(e){if(13===e.keyCode)return e.preventDefault(),this.checked=!this.checked,this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),!1}function forceRefresh(loading){var elem=this.parentNode;elem.style.webkitAnimationName="repaintChrome",elem.style.webkitAnimationDelay=loading===!0?"500ms":"",elem.style.webkitAnimationDuration="10ms",elem.style.webkitAnimationIterationCount="1",setTimeout(function(){elem.style.webkitAnimationName=""},loading===!0?520:20)}var EmbyCheckboxPrototype=Object.create(HTMLInputElement.prototype),enableRefreshHack=!!(browser.tizen||browser.orsay||browser.operaTv||browser.web0s);EmbyCheckboxPrototype.attachedCallback=function(){if("true"!==this.getAttribute("data-embycheckbox")){this.setAttribute("data-embycheckbox","true"),this.classList.add("mdl-checkbox__input");var labelElement=this.parentNode;labelElement.classList.add("mdl-checkbox"),labelElement.classList.add("mdl-js-checkbox");var labelTextElement=labelElement.querySelector("span"),outlineClass="checkboxOutline",customClass=this.getAttribute("data-outlineclass");customClass&&(outlineClass+=" "+customClass),labelElement.insertAdjacentHTML("beforeend",'<span class="mdl-checkbox__focus-helper"></span><span class="'+outlineClass+'"><span class="mdl-checkbox__tick-outline"></span></span>'),labelTextElement.classList.add("checkboxLabel"),this.addEventListener("keydown",onKeyDown),enableRefreshHack&&(forceRefresh.call(this,!0),dom.addEventListener(this,"click",forceRefresh,{passive:!0}),dom.addEventListener(this,"blur",forceRefresh,{passive:!0}),dom.addEventListener(this,"focus",forceRefresh,{passive:!0}),dom.addEventListener(this,"change",forceRefresh,{passive:!0}))}},document.registerElement("emby-checkbox",{prototype:EmbyCheckboxPrototype,extends:"input"})});
|
|
@ -1,45 +1 @@
|
|||
.emby-collapse {
|
||||
margin: .5em 0;
|
||||
}
|
||||
|
||||
.collapseContent {
|
||||
border-width: 0;
|
||||
padding: 1.25em 1.25em;
|
||||
height: 0;
|
||||
transition-property: height;
|
||||
transition-duration: 300ms;
|
||||
overflow: hidden;
|
||||
background: #222;
|
||||
}
|
||||
|
||||
.emby-collapsible-button {
|
||||
margin: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-transform: none;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
border: 0;
|
||||
text-transform: none;
|
||||
border-bottom: 1px solid #333;
|
||||
padding-left: .1em;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.emby-collapse-expandIcon {
|
||||
transform-origin: 50% 50%;
|
||||
transition: transform 180ms ease-out;
|
||||
position: absolute;
|
||||
right: .5em;
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
.emby-collapse-expandIconExpanded {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.emby-collapsible-title {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.emby-collapse{margin:.5em 0}.collapseContent{border-width:0;padding:1.25em;height:0;-webkit-transition-property:height;-o-transition-property:height;transition-property:height;-webkit-transition-duration:.3s;-o-transition-duration:.3s;transition-duration:.3s;overflow:hidden;background:#222}.emby-collapsible-button{margin:0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;width:100%;text-align:left;border:0;text-transform:none;border-bottom:1px solid #333;padding-left:.1em;background:0 0;-webkit-box-shadow:none;box-shadow:none}.emby-collapse-expandIcon{-webkit-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-transition:-webkit-transform 180ms ease-out;-o-transition:transform 180ms ease-out;transition:transform 180ms ease-out;position:absolute;right:.5em;font-size:1.5em}.emby-collapse-expandIconExpanded{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.emby-collapsible-title{margin:0;padding:0}
|
|
@ -1,100 +1 @@
|
|||
define(['browser', 'css!./emby-collapse', 'registerElement'], function (browser) {
|
||||
'use strict';
|
||||
|
||||
var EmbyButtonPrototype = Object.create(HTMLDivElement.prototype);
|
||||
|
||||
function slideDownToShow(button, elem) {
|
||||
|
||||
elem.classList.remove('hide');
|
||||
elem.classList.add('expanded');
|
||||
elem.style.height = 'auto';
|
||||
var height = elem.offsetHeight + 'px';
|
||||
elem.style.height = '0';
|
||||
|
||||
// trigger reflow
|
||||
var newHeight = elem.offsetHeight;
|
||||
elem.style.height = height;
|
||||
|
||||
setTimeout(function () {
|
||||
if (elem.classList.contains('expanded')) {
|
||||
elem.classList.remove('hide');
|
||||
} else {
|
||||
elem.classList.add('hide');
|
||||
}
|
||||
elem.style.height = 'auto';
|
||||
}, 300);
|
||||
|
||||
var icon = button.querySelector('i');
|
||||
//icon.innerHTML = 'expand_less';
|
||||
icon.classList.add('emby-collapse-expandIconExpanded');
|
||||
}
|
||||
|
||||
function slideUpToHide(button, elem) {
|
||||
|
||||
elem.style.height = elem.offsetHeight + 'px';
|
||||
// trigger reflow
|
||||
var newHeight = elem.offsetHeight;
|
||||
|
||||
elem.classList.remove('expanded');
|
||||
elem.style.height = '0';
|
||||
|
||||
setTimeout(function () {
|
||||
if (elem.classList.contains('expanded')) {
|
||||
elem.classList.remove('hide');
|
||||
} else {
|
||||
elem.classList.add('hide');
|
||||
}
|
||||
}, 300);
|
||||
|
||||
var icon = button.querySelector('i');
|
||||
//icon.innerHTML = 'expand_more';
|
||||
icon.classList.remove('emby-collapse-expandIconExpanded');
|
||||
}
|
||||
|
||||
function onButtonClick(e) {
|
||||
|
||||
var button = this;
|
||||
var collapseContent = button.parentNode.querySelector('.collapseContent');
|
||||
|
||||
if (collapseContent.expanded) {
|
||||
collapseContent.expanded = false;
|
||||
slideUpToHide(button, collapseContent);
|
||||
} else {
|
||||
collapseContent.expanded = true;
|
||||
slideDownToShow(button, collapseContent);
|
||||
}
|
||||
}
|
||||
|
||||
EmbyButtonPrototype.attachedCallback = function () {
|
||||
|
||||
if (this.classList.contains('emby-collapse')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.classList.add('emby-collapse');
|
||||
|
||||
var collapseContent = this.querySelector('.collapseContent');
|
||||
if (collapseContent) {
|
||||
collapseContent.classList.add('hide');
|
||||
}
|
||||
|
||||
var title = this.getAttribute('title');
|
||||
|
||||
var html = '<button is="emby-button" type="button" on-click="toggleExpand" id="expandButton" class="emby-collapsible-button iconRight"><h3 class="emby-collapsible-title" title="' + title + '">' + title + '</h3><i class="md-icon emby-collapse-expandIcon">expand_more</i></button>';
|
||||
|
||||
this.insertAdjacentHTML('afterbegin', html);
|
||||
|
||||
var button = this.querySelector('.emby-collapsible-button');
|
||||
|
||||
button.addEventListener('click', onButtonClick);
|
||||
|
||||
if (this.getAttribute('data-expanded') === 'true') {
|
||||
onButtonClick.call(button);
|
||||
}
|
||||
};
|
||||
|
||||
document.registerElement('emby-collapse', {
|
||||
prototype: EmbyButtonPrototype,
|
||||
extends: 'div'
|
||||
});
|
||||
});
|
||||
define(["browser","css!./emby-collapse","registerElement"],function(browser){"use strict";function slideDownToShow(button,elem){elem.classList.remove("hide"),elem.classList.add("expanded"),elem.style.height="auto";var height=elem.offsetHeight+"px";elem.style.height="0";elem.offsetHeight;elem.style.height=height,setTimeout(function(){elem.classList.contains("expanded")?elem.classList.remove("hide"):elem.classList.add("hide"),elem.style.height="auto"},300);var icon=button.querySelector("i");icon.classList.add("emby-collapse-expandIconExpanded")}function slideUpToHide(button,elem){elem.style.height=elem.offsetHeight+"px";elem.offsetHeight;elem.classList.remove("expanded"),elem.style.height="0",setTimeout(function(){elem.classList.contains("expanded")?elem.classList.remove("hide"):elem.classList.add("hide")},300);var icon=button.querySelector("i");icon.classList.remove("emby-collapse-expandIconExpanded")}function onButtonClick(e){var button=this,collapseContent=button.parentNode.querySelector(".collapseContent");collapseContent.expanded?(collapseContent.expanded=!1,slideUpToHide(button,collapseContent)):(collapseContent.expanded=!0,slideDownToShow(button,collapseContent))}var EmbyButtonPrototype=Object.create(HTMLDivElement.prototype);EmbyButtonPrototype.attachedCallback=function(){if(!this.classList.contains("emby-collapse")){this.classList.add("emby-collapse");var collapseContent=this.querySelector(".collapseContent");collapseContent&&collapseContent.classList.add("hide");var title=this.getAttribute("title"),html='<button is="emby-button" type="button" on-click="toggleExpand" id="expandButton" class="emby-collapsible-button iconRight"><h3 class="emby-collapsible-title" title="'+title+'">'+title+'</h3><i class="md-icon emby-collapse-expandIcon">expand_more</i></button>';this.insertAdjacentHTML("afterbegin",html);var button=this.querySelector(".emby-collapsible-button");button.addEventListener("click",onButtonClick),"true"===this.getAttribute("data-expanded")&&onButtonClick.call(button)}},document.registerElement("emby-collapse",{prototype:EmbyButtonPrototype,extends:"div"})});
|
|
@ -1,180 +1 @@
|
|||
define(['globalize', 'loading', 'alert'], function (globalize, loading, alert) {
|
||||
'use strict';
|
||||
|
||||
function showNewUserInviteMessage(result) {
|
||||
|
||||
if (!result.IsNewUserInvitation && !result.IsPending) {
|
||||
|
||||
// It was immediately approved
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
var message = result.IsNewUserInvitation ?
|
||||
globalize.translate('MessageInvitationSentToNewUser', result.GuestDisplayName) :
|
||||
globalize.translate('MessageInvitationSentToUser', result.GuestDisplayName);
|
||||
|
||||
alert({
|
||||
text: message,
|
||||
title: globalize.translate('HeaderInvitationSent')
|
||||
});
|
||||
}
|
||||
|
||||
function inviteGuest(options) {
|
||||
|
||||
var apiClient = options.apiClient;
|
||||
|
||||
loading.show();
|
||||
|
||||
// Add/Update connect info
|
||||
return apiClient.ajax({
|
||||
|
||||
type: "POST",
|
||||
url: apiClient.getUrl('Connect/Invite'),
|
||||
dataType: 'json',
|
||||
data: options.guestOptions || {}
|
||||
|
||||
}).then(function (result) {
|
||||
|
||||
loading.hide();
|
||||
return showNewUserInviteMessage(result);
|
||||
|
||||
}, function (response) {
|
||||
|
||||
loading.hide();
|
||||
|
||||
if (response.status === 404) {
|
||||
// User doesn't exist
|
||||
alert({
|
||||
text: globalize.translate('GuestUserNotFound')
|
||||
});
|
||||
|
||||
} else if ((response.status || 0) >= 500) {
|
||||
|
||||
// Unable to reach connect server ?
|
||||
alert({
|
||||
text: globalize.translate('ErrorReachingEmbyConnect')
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
// status 400 = account not activated
|
||||
|
||||
// General error
|
||||
showGuestGeneralErrorMessage();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showGuestGeneralErrorMessage() {
|
||||
|
||||
var html = globalize.translate('ErrorAddingGuestAccount1', '<a href="https://emby.media/connect" target="_blank">https://emby.media/connect</a>');
|
||||
html += '<br/><br/>' + globalize.translate('ErrorAddingGuestAccount2', 'apps@emby.media');
|
||||
|
||||
var text = globalize.translate('ErrorAddingGuestAccount1', 'https://emby.media/connect');
|
||||
text += '\n\n' + globalize.translate('ErrorAddingGuestAccount2', 'apps@emby.media');
|
||||
|
||||
alert({
|
||||
text: text,
|
||||
html: html
|
||||
});
|
||||
}
|
||||
|
||||
function showLinkUserMessage(username) {
|
||||
|
||||
var html;
|
||||
var text;
|
||||
|
||||
if (username) {
|
||||
|
||||
html = globalize.translate('ErrorAddingEmbyConnectAccount1', '<a href="https://emby.media/connect" target="_blank">https://emby.media/connect</a>');
|
||||
html += '<br/><br/>' + globalize.translate('ErrorAddingEmbyConnectAccount2', 'apps@emby.media');
|
||||
|
||||
text = globalize.translate('ErrorAddingEmbyConnectAccount1', 'https://emby.media/connect');
|
||||
text += '\n\n' + globalize.translate('ErrorAddingEmbyConnectAccount2', 'apps@emby.media');
|
||||
|
||||
} else {
|
||||
html = text = globalize.translate('DefaultErrorMessage');
|
||||
}
|
||||
|
||||
return alert({
|
||||
text: text,
|
||||
html: html
|
||||
});
|
||||
}
|
||||
|
||||
function updateUserLink(apiClient, user, newConnectUsername) {
|
||||
var currentConnectUsername = user.ConnectUserName || '';
|
||||
var enteredConnectUsername = newConnectUsername;
|
||||
|
||||
var linkUrl = apiClient.getUrl('Users/' + user.Id + '/Connect/Link');
|
||||
|
||||
if (currentConnectUsername && !enteredConnectUsername) {
|
||||
|
||||
// Remove connect info
|
||||
// Add/Update connect info
|
||||
return apiClient.ajax({
|
||||
|
||||
type: "DELETE",
|
||||
url: linkUrl
|
||||
|
||||
}).then(function () {
|
||||
|
||||
return alert({
|
||||
text: globalize.translate('MessageEmbyAccontRemoved'),
|
||||
title: globalize.translate('HeaderEmbyAccountRemoved'),
|
||||
|
||||
}).catch(function () {
|
||||
return Promise.resolve();
|
||||
});
|
||||
|
||||
}, function () {
|
||||
|
||||
return alert({
|
||||
text: globalize.translate('ErrorRemovingEmbyConnectAccount')
|
||||
|
||||
}).then(function () {
|
||||
return Promise.reject();
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
else if (currentConnectUsername !== enteredConnectUsername) {
|
||||
|
||||
// Add/Update connect info
|
||||
return apiClient.ajax({
|
||||
type: "POST",
|
||||
url: linkUrl,
|
||||
data: {
|
||||
ConnectUsername: enteredConnectUsername
|
||||
},
|
||||
dataType: 'json'
|
||||
|
||||
}).then(function (result) {
|
||||
|
||||
var msgKey = result.IsPending ? 'MessagePendingEmbyAccountAdded' : 'MessageEmbyAccountAdded';
|
||||
|
||||
return alert({
|
||||
text: globalize.translate(msgKey),
|
||||
title: globalize.translate('HeaderEmbyAccountAdded'),
|
||||
|
||||
}).catch(function () {
|
||||
return Promise.resolve();
|
||||
});
|
||||
|
||||
}, function () {
|
||||
|
||||
return showLinkUserMessage('.').then(function () {
|
||||
return Promise.reject();
|
||||
});
|
||||
});
|
||||
|
||||
} else {
|
||||
return Promise.reject();
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
inviteGuest: inviteGuest,
|
||||
updateUserLink: updateUserLink
|
||||
};
|
||||
});
|
||||
define(["globalize","loading","alert"],function(globalize,loading,alert){"use strict";function showNewUserInviteMessage(result){if(!result.IsNewUserInvitation&&!result.IsPending)return Promise.resolve();var message=result.IsNewUserInvitation?globalize.translate("MessageInvitationSentToNewUser",result.GuestDisplayName):globalize.translate("MessageInvitationSentToUser",result.GuestDisplayName);alert({text:message,title:globalize.translate("HeaderInvitationSent")})}function inviteGuest(options){var apiClient=options.apiClient;return loading.show(),apiClient.ajax({type:"POST",url:apiClient.getUrl("Connect/Invite"),dataType:"json",data:options.guestOptions||{}}).then(function(result){return loading.hide(),showNewUserInviteMessage(result)},function(response){loading.hide(),404===response.status?alert({text:globalize.translate("GuestUserNotFound")}):(response.status||0)>=500?alert({text:globalize.translate("ErrorReachingEmbyConnect")}):showGuestGeneralErrorMessage()})}function showGuestGeneralErrorMessage(){var html=globalize.translate("ErrorAddingGuestAccount1",'<a href="https://emby.media/connect" target="_blank">https://emby.media/connect</a>');html+="<br/><br/>"+globalize.translate("ErrorAddingGuestAccount2","apps@emby.media");var text=globalize.translate("ErrorAddingGuestAccount1","https://emby.media/connect");text+="\n\n"+globalize.translate("ErrorAddingGuestAccount2","apps@emby.media"),alert({text:text,html:html})}function showLinkUserMessage(username){var html,text;return username?(html=globalize.translate("ErrorAddingEmbyConnectAccount1",'<a href="https://emby.media/connect" target="_blank">https://emby.media/connect</a>'),html+="<br/><br/>"+globalize.translate("ErrorAddingEmbyConnectAccount2","apps@emby.media"),text=globalize.translate("ErrorAddingEmbyConnectAccount1","https://emby.media/connect"),text+="\n\n"+globalize.translate("ErrorAddingEmbyConnectAccount2","apps@emby.media")):html=text=globalize.translate("DefaultErrorMessage"),alert({text:text,html:html})}function updateUserLink(apiClient,user,newConnectUsername){var currentConnectUsername=user.ConnectUserName||"",enteredConnectUsername=newConnectUsername,linkUrl=apiClient.getUrl("Users/"+user.Id+"/Connect/Link");return currentConnectUsername&&!enteredConnectUsername?apiClient.ajax({type:"DELETE",url:linkUrl}).then(function(){return alert({text:globalize.translate("MessageEmbyAccontRemoved"),title:globalize.translate("HeaderEmbyAccountRemoved")}).catch(function(){return Promise.resolve()})},function(){return alert({text:globalize.translate("ErrorRemovingEmbyConnectAccount")}).then(function(){return Promise.reject()})}):currentConnectUsername!==enteredConnectUsername?apiClient.ajax({type:"POST",url:linkUrl,data:{ConnectUsername:enteredConnectUsername},dataType:"json"}).then(function(result){var msgKey=result.IsPending?"MessagePendingEmbyAccountAdded":"MessageEmbyAccountAdded";return alert({text:globalize.translate(msgKey),title:globalize.translate("HeaderEmbyAccountAdded")}).catch(function(){return Promise.resolve()})},function(){return showLinkUserMessage(".").then(function(){return Promise.reject()})}):Promise.reject()}return{inviteGuest:inviteGuest,updateUserLink:updateUserLink}});
|
|
@ -1,60 +1 @@
|
|||
.emby-input {
|
||||
display: block;
|
||||
margin: 0;
|
||||
margin-bottom: 0 !important;
|
||||
background: none;
|
||||
border: 1px solid #383838;
|
||||
border-width: 0 0 1px 0;
|
||||
/* Prefixed box-sizing rules necessary for older browsers */
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
/* Remove select styling */
|
||||
/* Font size must the 16px or larger to prevent iOS page zoom on focus */
|
||||
font-size: 110%;
|
||||
/* General select styles: change as needed */
|
||||
font-family: inherit;
|
||||
font-weight: inherit;
|
||||
color: inherit;
|
||||
padding: .35em 0 .3em 0;
|
||||
outline: none !important;
|
||||
width: 100%;
|
||||
background-color: transparent;
|
||||
border-radius: 0;
|
||||
/* Ensure it is over the label so that it can be clicked */
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.inputContainer {
|
||||
margin-bottom: 1.8em;
|
||||
}
|
||||
|
||||
.inputLabel {
|
||||
display: inline-block;
|
||||
transition: all .2s ease-out;
|
||||
}
|
||||
|
||||
.inputLabel-float {
|
||||
transform-origin: left top;
|
||||
transform: scale(1.25,1.25) translateY(94%);
|
||||
}
|
||||
|
||||
.inputLabelFocused {
|
||||
color: #52B54B;
|
||||
}
|
||||
|
||||
.emby-input-selectionbar {
|
||||
height: 2px;
|
||||
transform: scale(.01, 1);
|
||||
transition: transform .25s ease-out;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
margin-bottom: .5em;
|
||||
-webkit-transform-origin: center center;
|
||||
transform-origin: center center;
|
||||
}
|
||||
|
||||
.emby-input:focus + .emby-input-selectionbar {
|
||||
background-color: #52B54B;
|
||||
transform: none;
|
||||
}
|
||||
.emby-input{display:block;margin:0;margin-bottom:0!important;background:0 0;border:1px solid #383838;border-width:0 0 1px;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:110%;font-family:inherit;font-weight:inherit;color:inherit;padding:.35em 0 .3em;outline:0!important;width:100%;-webkit-border-radius:0;border-radius:0;position:relative}.inputContainer{margin-bottom:1.8em}.inputLabel{display:inline-block;-webkit-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}.inputLabel-float{-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:scale(1.25,1.25) translateY(94%);transform:scale(1.25,1.25) translateY(94%)}.inputLabelFocused{color:#52B54B}.emby-input-selectionbar{height:2px;-webkit-transform:scale(.01,1);transform:scale(.01,1);-webkit-transition:-webkit-transform .25s ease-out;-o-transition:transform .25s ease-out;transition:transform .25s ease-out;position:relative;top:-1px;margin-bottom:.5em;-webkit-transform-origin:center center;transform-origin:center center}.emby-input:focus+.emby-input-selectionbar{background-color:#52B54B;-webkit-transform:none;transform:none}
|
|
@ -1,113 +1 @@
|
|||
define(['layoutManager', 'browser', 'dom', 'css!./emby-input', 'registerElement'], function (layoutManager, browser, dom) {
|
||||
'use strict';
|
||||
|
||||
var EmbyInputPrototype = Object.create(HTMLInputElement.prototype);
|
||||
|
||||
var inputId = 0;
|
||||
var supportsFloatingLabel = false;
|
||||
|
||||
if (Object.getOwnPropertyDescriptor && Object.defineProperty) {
|
||||
|
||||
var descriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
|
||||
|
||||
// descriptor returning null in webos
|
||||
if (descriptor && descriptor.configurable) {
|
||||
var baseSetMethod = descriptor.set;
|
||||
descriptor.set = function (value) {
|
||||
baseSetMethod.call(this, value);
|
||||
|
||||
this.dispatchEvent(new CustomEvent('valueset', {
|
||||
bubbles: false,
|
||||
cancelable: false
|
||||
}));
|
||||
};
|
||||
|
||||
Object.defineProperty(HTMLInputElement.prototype, 'value', descriptor);
|
||||
supportsFloatingLabel = true;
|
||||
}
|
||||
}
|
||||
|
||||
EmbyInputPrototype.createdCallback = function () {
|
||||
|
||||
if (!this.id) {
|
||||
this.id = 'embyinput' + inputId;
|
||||
inputId++;
|
||||
} if (this.classList.contains('emby-input')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.classList.add('emby-input');
|
||||
|
||||
var parentNode = this.parentNode;
|
||||
var document = this.ownerDocument;
|
||||
var label = document.createElement('label');
|
||||
label.innerHTML = this.getAttribute('label') || '';
|
||||
label.classList.add('inputLabel');
|
||||
label.classList.add('inputLabelUnfocused');
|
||||
|
||||
label.htmlFor = this.id;
|
||||
parentNode.insertBefore(label, this);
|
||||
this.labelElement = label;
|
||||
|
||||
var div = document.createElement('div');
|
||||
div.classList.add('emby-input-selectionbar');
|
||||
parentNode.insertBefore(div, this.nextSibling);
|
||||
|
||||
dom.addEventListener(this, 'focus', function () {
|
||||
onChange.call(this);
|
||||
label.classList.add('inputLabelFocused');
|
||||
label.classList.remove('inputLabelUnfocused');
|
||||
}, {
|
||||
passive: true
|
||||
});
|
||||
|
||||
dom.addEventListener(this, 'blur', function () {
|
||||
onChange.call(this);
|
||||
label.classList.remove('inputLabelFocused');
|
||||
label.classList.add('inputLabelUnfocused');
|
||||
}, {
|
||||
passive: true
|
||||
});
|
||||
|
||||
dom.addEventListener(this, 'change', onChange, {
|
||||
passive: true
|
||||
});
|
||||
dom.addEventListener(this, 'input', onChange, {
|
||||
passive: true
|
||||
});
|
||||
dom.addEventListener(this, 'valueset', onChange, {
|
||||
passive: true
|
||||
});
|
||||
};
|
||||
|
||||
function onChange() {
|
||||
|
||||
var label = this.labelElement;
|
||||
if (this.value) {
|
||||
label.classList.remove('inputLabel-float');
|
||||
} else {
|
||||
|
||||
var instanceSupportsFloat = supportsFloatingLabel && this.type !== 'date' && this.type !== 'time';
|
||||
|
||||
if (instanceSupportsFloat) {
|
||||
label.classList.add('inputLabel-float');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EmbyInputPrototype.attachedCallback = function () {
|
||||
|
||||
this.labelElement.htmlFor = this.id;
|
||||
|
||||
onChange.call(this);
|
||||
};
|
||||
|
||||
EmbyInputPrototype.label = function (text) {
|
||||
this.labelElement.innerHTML = text;
|
||||
};
|
||||
|
||||
document.registerElement('emby-input', {
|
||||
prototype: EmbyInputPrototype,
|
||||
extends: 'input'
|
||||
});
|
||||
});
|
||||
define(["layoutManager","browser","dom","css!./emby-input","registerElement"],function(layoutManager,browser,dom){"use strict";function onChange(){var label=this.labelElement;if(this.value)label.classList.remove("inputLabel-float");else{var instanceSupportsFloat=supportsFloatingLabel&&"date"!==this.type&&"time"!==this.type;instanceSupportsFloat&&label.classList.add("inputLabel-float")}}var EmbyInputPrototype=Object.create(HTMLInputElement.prototype),inputId=0,supportsFloatingLabel=!1;if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var descriptor=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");if(descriptor&&descriptor.configurable){var baseSetMethod=descriptor.set;descriptor.set=function(value){baseSetMethod.call(this,value),this.dispatchEvent(new CustomEvent("valueset",{bubbles:!1,cancelable:!1}))},Object.defineProperty(HTMLInputElement.prototype,"value",descriptor),supportsFloatingLabel=!0}}EmbyInputPrototype.createdCallback=function(){if(this.id||(this.id="embyinput"+inputId,inputId++),!this.classList.contains("emby-input")){this.classList.add("emby-input");var parentNode=this.parentNode,document=this.ownerDocument,label=document.createElement("label");label.innerHTML=this.getAttribute("label")||"",label.classList.add("inputLabel"),label.classList.add("inputLabelUnfocused"),label.htmlFor=this.id,parentNode.insertBefore(label,this),this.labelElement=label;var div=document.createElement("div");div.classList.add("emby-input-selectionbar"),parentNode.insertBefore(div,this.nextSibling),dom.addEventListener(this,"focus",function(){onChange.call(this),label.classList.add("inputLabelFocused"),label.classList.remove("inputLabelUnfocused")},{passive:!0}),dom.addEventListener(this,"blur",function(){onChange.call(this),label.classList.remove("inputLabelFocused"),label.classList.add("inputLabelUnfocused")},{passive:!0}),dom.addEventListener(this,"change",onChange,{passive:!0}),dom.addEventListener(this,"input",onChange,{passive:!0}),dom.addEventListener(this,"valueset",onChange,{passive:!0})}},EmbyInputPrototype.attachedCallback=function(){this.labelElement.htmlFor=this.id,onChange.call(this)},EmbyInputPrototype.label=function(text){this.labelElement.innerHTML=text},document.registerElement("emby-input",{prototype:EmbyInputPrototype,extends:"input"})});
|
File diff suppressed because one or more lines are too long
|
@ -1,107 +1 @@
|
|||
.mdl-radio {
|
||||
position: relative;
|
||||
line-height: 24px;
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.radio-label-block {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: .5em;
|
||||
margin-bottom: .5em;
|
||||
}
|
||||
|
||||
.mdl-radio {
|
||||
padding-left: 24px;
|
||||
}
|
||||
|
||||
.mdl-radio__button {
|
||||
line-height: 24px;
|
||||
position: absolute;
|
||||
/* 1px is for focusing purposes, so the focusManager doesn't skip over it */
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
opacity: 0;
|
||||
-ms-appearance: none;
|
||||
-moz-appearance: none;
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.mdl-radio__outer-circle {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
left: 0;
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
border: 2px solid currentcolor;
|
||||
border-radius: 50%;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.mdl-radio__button:checked + .mdl-radio__label + .mdl-radio__outer-circle {
|
||||
border: 2px solid rgb(82, 181, 75);
|
||||
}
|
||||
|
||||
.mdl-radio__button:disabled + .mdl-radio__label + .mdl-radio__outer-circle {
|
||||
border: 2px solid rgba(0,0,0, 0.26);
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.mdl-radio__inner-circle {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
margin: 0;
|
||||
top: 8px;
|
||||
left: 4px;
|
||||
box-sizing: border-box;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
cursor: pointer;
|
||||
transition-duration: 0.28s;
|
||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition-property: -webkit-transform;
|
||||
transition-property: transform;
|
||||
transition-property: transform, -webkit-transform;
|
||||
-webkit-transform: scale3d(0, 0, 0);
|
||||
transform: scale3d(0, 0, 0);
|
||||
border-radius: 50%;
|
||||
background: rgb(82, 181, 75);
|
||||
}
|
||||
|
||||
.mdl-radio__button:checked + .mdl-radio__label + .mdl-radio__outer-circle + .mdl-radio__inner-circle {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1);
|
||||
}
|
||||
|
||||
.mdl-radio__button:disabled + .mdl-radio__label + .mdl-radio__outer-circle + .mdl-radio__inner-circle {
|
||||
background: rgba(0,0,0, 0.26);
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.mdl-radio__button:focus + .mdl-radio__label + .mdl-radio__outer-circle + .mdl-radio__inner-circle {
|
||||
box-shadow: 0 0 0px 10px rgba(255, 255, 255, 0.76);
|
||||
}
|
||||
|
||||
.mdl-radio__button:checked:focus + .mdl-radio__label + .mdl-radio__outer-circle + .mdl-radio__inner-circle {
|
||||
box-shadow: 0 0 0px 10px rgba(82, 181, 75, 0.26);
|
||||
}
|
||||
|
||||
.mdl-radio__label {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.mdl-radio__button:disabled + .mdl-radio__label {
|
||||
color: rgba(0,0,0, 0.26);
|
||||
cursor: auto;
|
||||
}
|
||||
.mdl-radio{position:relative;line-height:24px;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding-left:24px}.radio-label-block{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;margin-top:.5em;margin-bottom:.5em}.mdl-radio__button{line-height:24px;position:absolute;width:1px;height:1px;margin:0;padding:0;opacity:0;-ms-appearance:none;-moz-appearance:none;-webkit-appearance:none;appearance:none;border:none}.mdl-radio__outer-circle{position:absolute;top:4px;left:0;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;width:16px;height:16px;margin:0;cursor:pointer;border:2px solid currentcolor;-webkit-border-radius:50%;border-radius:50%;z-index:2}.mdl-radio__button:checked+.mdl-radio__label+.mdl-radio__outer-circle{border:2px solid #52b54b}.mdl-radio__button:disabled+.mdl-radio__label+.mdl-radio__outer-circle{border:2px solid rgba(0,0,0,.26);cursor:auto}.mdl-radio__inner-circle{position:absolute;z-index:1;margin:0;top:8px;left:4px;-webkit-box-sizing:border-box;box-sizing:border-box;width:8px;height:8px;cursor:pointer;-webkit-transition-duration:.28s;-o-transition-duration:.28s;transition-duration:.28s;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);-o-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-o-transition-property:transform;-webkit-transition-property:-webkit-transform,-webkit-transform;transition-property:transform,-webkit-transform;-webkit-transform:scale3d(0,0,0);transform:scale3d(0,0,0);-webkit-border-radius:50%;border-radius:50%;background:#52b54b}.mdl-radio__button:checked+.mdl-radio__label+.mdl-radio__outer-circle+.mdl-radio__inner-circle{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}.mdl-radio__button:disabled+.mdl-radio__label+.mdl-radio__outer-circle+.mdl-radio__inner-circle{background:rgba(0,0,0,.26);cursor:auto}.mdl-radio__button:focus+.mdl-radio__label+.mdl-radio__outer-circle+.mdl-radio__inner-circle{-webkit-box-shadow:0 0 0 10px rgba(255,255,255,.76);box-shadow:0 0 0 10px rgba(255,255,255,.76)}.mdl-radio__button:checked:focus+.mdl-radio__label+.mdl-radio__outer-circle+.mdl-radio__inner-circle{-webkit-box-shadow:0 0 0 10px rgba(82,181,75,.26);box-shadow:0 0 0 10px rgba(82,181,75,.26)}.mdl-radio__label{cursor:pointer}.mdl-radio__button:disabled+.mdl-radio__label{color:rgba(0,0,0,.26);cursor:auto}
|
|
@ -1,48 +1 @@
|
|||
define(['css!./emby-radio', 'registerElement'], function () {
|
||||
'use strict';
|
||||
|
||||
var EmbyRadioPrototype = Object.create(HTMLInputElement.prototype);
|
||||
|
||||
function onKeyDown(e) {
|
||||
|
||||
// Don't submit form on enter
|
||||
if (e.keyCode === 13) {
|
||||
e.preventDefault();
|
||||
|
||||
this.checked = true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
EmbyRadioPrototype.attachedCallback = function () {
|
||||
|
||||
if (this.getAttribute('data-radio') === 'true') {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setAttribute('data-radio', 'true');
|
||||
|
||||
this.classList.add('mdl-radio__button');
|
||||
|
||||
var labelElement = this.parentNode;
|
||||
//labelElement.classList.add('"mdl-radio mdl-js-radio mdl-js-ripple-effect');
|
||||
labelElement.classList.add('mdl-radio');
|
||||
labelElement.classList.add('mdl-js-radio');
|
||||
labelElement.classList.add('mdl-js-ripple-effect');
|
||||
|
||||
var labelTextElement = labelElement.querySelector('span');
|
||||
|
||||
labelTextElement.classList.add('radioButtonLabel');
|
||||
labelTextElement.classList.add('mdl-radio__label');
|
||||
|
||||
labelElement.insertAdjacentHTML('beforeend', '<span class="mdl-radio__outer-circle"></span><span class="mdl-radio__inner-circle"></span>');
|
||||
|
||||
this.addEventListener('keydown', onKeyDown);
|
||||
};
|
||||
|
||||
document.registerElement('emby-radio', {
|
||||
prototype: EmbyRadioPrototype,
|
||||
extends: 'input'
|
||||
});
|
||||
});
|
||||
define(["css!./emby-radio","registerElement"],function(){"use strict";function onKeyDown(e){if(13===e.keyCode)return e.preventDefault(),this.checked=!0,!1}var EmbyRadioPrototype=Object.create(HTMLInputElement.prototype);EmbyRadioPrototype.attachedCallback=function(){if("true"!==this.getAttribute("data-radio")){this.setAttribute("data-radio","true"),this.classList.add("mdl-radio__button");var labelElement=this.parentNode;labelElement.classList.add("mdl-radio"),labelElement.classList.add("mdl-js-radio"),labelElement.classList.add("mdl-js-ripple-effect");var labelTextElement=labelElement.querySelector("span");labelTextElement.classList.add("radioButtonLabel"),labelTextElement.classList.add("mdl-radio__label"),labelElement.insertAdjacentHTML("beforeend",'<span class="mdl-radio__outer-circle"></span><span class="mdl-radio__inner-circle"></span>'),this.addEventListener("keydown",onKeyDown)}},document.registerElement("emby-radio",{prototype:EmbyRadioPrototype,extends:"input"})});
|
|
@ -1,73 +1 @@
|
|||
.emby-select {
|
||||
display: block;
|
||||
margin: 0;
|
||||
margin-bottom: 0 !important;
|
||||
border: 1px solid #383838;
|
||||
border-width: 0 0 1px 0;
|
||||
/* Prefixed box-sizing rules necessary for older browsers */
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
/* Remove select styling */
|
||||
/* Font size must the 16px or larger to prevent iOS page zoom on focus */
|
||||
font-size: 110%;
|
||||
/* General select styles: change as needed */
|
||||
font-family: inherit;
|
||||
font-weight: inherit;
|
||||
padding: .35em .8em .3em 0;
|
||||
cursor: pointer;
|
||||
outline: none !important;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.emby-select-withoptioncolor {
|
||||
color: inherit;
|
||||
background: none;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
.emby-select-withoptioncolor > option {
|
||||
color: initial;
|
||||
}
|
||||
|
||||
.selectContainer {
|
||||
margin-bottom: 1.8em;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.selectArrowContainer {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: .25em;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.selectArrow {
|
||||
margin-top: .35em;
|
||||
}
|
||||
|
||||
.selectLabel {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.selectLabelFocused {
|
||||
color: #52B54B;
|
||||
}
|
||||
|
||||
.emby-select-selectionbar {
|
||||
height: 2px;
|
||||
transform: scale(.01, 1);
|
||||
transition: transform .25s ease-out;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
margin-bottom: .5em;
|
||||
-webkit-transform-origin: center center;
|
||||
transform-origin: center center;
|
||||
}
|
||||
|
||||
.emby-select:focus + .emby-select-selectionbar {
|
||||
background-color: #52B54B;
|
||||
transform: none;
|
||||
}
|
||||
.emby-select,.selectLabel{display:block}.emby-select{margin:0;margin-bottom:0!important;border:1px solid #383838;border-width:0 0 1px;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:110%;font-family:inherit;font-weight:inherit;padding:.35em .8em .3em 0;cursor:pointer;outline:0!important;width:100%}.emby-select-withoptioncolor{color:inherit;background:0 0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.emby-select-withoptioncolor>option{color:initial}.selectContainer{margin-bottom:1.8em;position:relative}.selectArrowContainer{position:absolute;right:0;top:.25em;color:inherit}.selectArrow{margin-top:.35em}.selectLabelFocused{color:#52B54B}.emby-select-selectionbar{height:2px;-webkit-transform:scale(.01,1);transform:scale(.01,1);-webkit-transition:-webkit-transform .25s ease-out;-o-transition:transform .25s ease-out;transition:transform .25s ease-out;position:relative;top:-1px;margin-bottom:.5em;-webkit-transform-origin:center center;transform-origin:center center}.emby-select:focus+.emby-select-selectionbar{background-color:#52B54B;-webkit-transform:none;transform:none}
|
|
@ -1,174 +1 @@
|
|||
define(['layoutManager', 'browser', 'actionsheet', 'css!./emby-select', 'registerElement'], function (layoutManager, browser, actionsheet) {
|
||||
'use strict';
|
||||
|
||||
var EmbySelectPrototype = Object.create(HTMLSelectElement.prototype);
|
||||
|
||||
function enableNativeMenu() {
|
||||
|
||||
if (browser.edgeUwp || browser.xboxOne) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Doesn't seem to work at all
|
||||
if (browser.tizen) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Take advantage of the native input methods
|
||||
if (browser.tv) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (layoutManager.tv) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function triggerChange(select) {
|
||||
var evt = document.createEvent("HTMLEvents");
|
||||
evt.initEvent("change", false, true);
|
||||
select.dispatchEvent(evt);
|
||||
}
|
||||
|
||||
function setValue(select, value) {
|
||||
|
||||
select.value = value;
|
||||
}
|
||||
|
||||
function showActionSheet(select) {
|
||||
|
||||
var labelElem = getLabel(select);
|
||||
var title = labelElem ? (labelElem.textContent || labelElem.innerText) : null;
|
||||
|
||||
actionsheet.show({
|
||||
items: select.options,
|
||||
positionTo: select,
|
||||
title: title
|
||||
|
||||
}).then(function (value) {
|
||||
setValue(select, value);
|
||||
triggerChange(select);
|
||||
});
|
||||
}
|
||||
|
||||
function getLabel(select) {
|
||||
var elem = select.previousSibling;
|
||||
while (elem && elem.tagName !== 'LABEL') {
|
||||
elem = elem.previousSibling;
|
||||
}
|
||||
return elem;
|
||||
}
|
||||
|
||||
function onFocus(e) {
|
||||
var label = getLabel(this);
|
||||
if (label) {
|
||||
label.classList.add('selectLabelFocused');
|
||||
label.classList.remove('selectLabelUnfocused');
|
||||
}
|
||||
}
|
||||
|
||||
function onBlur(e) {
|
||||
var label = getLabel(this);
|
||||
if (label) {
|
||||
label.classList.add('selectLabelUnfocused');
|
||||
label.classList.remove('selectLabelFocused');
|
||||
}
|
||||
}
|
||||
|
||||
function onMouseDown(e) {
|
||||
|
||||
// e.button=0 for primary (left) mouse button click
|
||||
if (!e.button && !enableNativeMenu()) {
|
||||
e.preventDefault();
|
||||
showActionSheet(this);
|
||||
}
|
||||
}
|
||||
|
||||
function onKeyDown(e) {
|
||||
|
||||
switch (e.keyCode) {
|
||||
|
||||
case 13:
|
||||
if (!enableNativeMenu()) {
|
||||
e.preventDefault();
|
||||
showActionSheet(this);
|
||||
}
|
||||
return;
|
||||
case 37:
|
||||
case 38:
|
||||
case 39:
|
||||
case 40:
|
||||
if (layoutManager.tv) {
|
||||
e.preventDefault();
|
||||
}
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var inputId = 0;
|
||||
|
||||
EmbySelectPrototype.createdCallback = function () {
|
||||
|
||||
if (!this.id) {
|
||||
this.id = 'embyselect' + inputId;
|
||||
inputId++;
|
||||
}
|
||||
|
||||
if (!browser.firefox) {
|
||||
this.classList.add('emby-select-withoptioncolor');
|
||||
}
|
||||
|
||||
this.addEventListener('mousedown', onMouseDown);
|
||||
this.addEventListener('keydown', onKeyDown);
|
||||
|
||||
this.addEventListener('focus', onFocus);
|
||||
this.addEventListener('blur', onBlur);
|
||||
};
|
||||
|
||||
EmbySelectPrototype.attachedCallback = function () {
|
||||
|
||||
if (this.classList.contains('emby-select')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.classList.add('emby-select');
|
||||
|
||||
var label = this.ownerDocument.createElement('label');
|
||||
label.innerHTML = this.getAttribute('label') || '';
|
||||
label.classList.add('selectLabel');
|
||||
label.classList.add('selectLabelUnfocused');
|
||||
label.htmlFor = this.id;
|
||||
this.parentNode.insertBefore(label, this);
|
||||
|
||||
var div = document.createElement('div');
|
||||
div.classList.add('emby-select-selectionbar');
|
||||
this.parentNode.insertBefore(div, this.nextSibling);
|
||||
|
||||
var arrowContainer = document.createElement('div');
|
||||
arrowContainer.classList.add('selectArrowContainer');
|
||||
arrowContainer.innerHTML = '<div style="visibility:hidden;">0</div>';
|
||||
this.parentNode.appendChild(arrowContainer);
|
||||
|
||||
var arrow = document.createElement('i');
|
||||
arrow.classList.add('md-icon');
|
||||
arrow.classList.add('selectArrow');
|
||||
arrow.innerHTML = '';
|
||||
arrowContainer.appendChild(arrow);
|
||||
};
|
||||
|
||||
EmbySelectPrototype.setLabel = function (text) {
|
||||
|
||||
var label = this.parentNode.querySelector('label');
|
||||
|
||||
label.innerHTML = text;
|
||||
};
|
||||
|
||||
document.registerElement('emby-select', {
|
||||
prototype: EmbySelectPrototype,
|
||||
extends: 'select'
|
||||
});
|
||||
});
|
||||
define(["layoutManager","browser","actionsheet","css!./emby-select","registerElement"],function(layoutManager,browser,actionsheet){"use strict";function enableNativeMenu(){return!(!browser.edgeUwp&&!browser.xboxOne)||!browser.tizen&&(!!browser.tv||!layoutManager.tv)}function triggerChange(select){var evt=document.createEvent("HTMLEvents");evt.initEvent("change",!1,!0),select.dispatchEvent(evt)}function setValue(select,value){select.value=value}function showActionSheet(select){var labelElem=getLabel(select),title=labelElem?labelElem.textContent||labelElem.innerText:null;actionsheet.show({items:select.options,positionTo:select,title:title}).then(function(value){setValue(select,value),triggerChange(select)})}function getLabel(select){for(var elem=select.previousSibling;elem&&"LABEL"!==elem.tagName;)elem=elem.previousSibling;return elem}function onFocus(e){var label=getLabel(this);label&&(label.classList.add("selectLabelFocused"),label.classList.remove("selectLabelUnfocused"))}function onBlur(e){var label=getLabel(this);label&&(label.classList.add("selectLabelUnfocused"),label.classList.remove("selectLabelFocused"))}function onMouseDown(e){e.button||enableNativeMenu()||(e.preventDefault(),showActionSheet(this))}function onKeyDown(e){switch(e.keyCode){case 13:return void(enableNativeMenu()||(e.preventDefault(),showActionSheet(this)));case 37:case 38:case 39:case 40:return void(layoutManager.tv&&e.preventDefault())}}var EmbySelectPrototype=Object.create(HTMLSelectElement.prototype),inputId=0;EmbySelectPrototype.createdCallback=function(){this.id||(this.id="embyselect"+inputId,inputId++),browser.firefox||this.classList.add("emby-select-withoptioncolor"),this.addEventListener("mousedown",onMouseDown),this.addEventListener("keydown",onKeyDown),this.addEventListener("focus",onFocus),this.addEventListener("blur",onBlur)},EmbySelectPrototype.attachedCallback=function(){if(!this.classList.contains("emby-select")){this.classList.add("emby-select");var label=this.ownerDocument.createElement("label");label.innerHTML=this.getAttribute("label")||"",label.classList.add("selectLabel"),label.classList.add("selectLabelUnfocused"),label.htmlFor=this.id,this.parentNode.insertBefore(label,this);var div=document.createElement("div");div.classList.add("emby-select-selectionbar"),this.parentNode.insertBefore(div,this.nextSibling);var arrowContainer=document.createElement("div");arrowContainer.classList.add("selectArrowContainer"),arrowContainer.innerHTML='<div style="visibility:hidden;">0</div>',this.parentNode.appendChild(arrowContainer);var arrow=document.createElement("i");arrow.classList.add("md-icon"),arrow.classList.add("selectArrow"),arrow.innerHTML="",arrowContainer.appendChild(arrow)}},EmbySelectPrototype.setLabel=function(text){var label=this.parentNode.querySelector("label");label.innerHTML=text},document.registerElement("emby-select",{prototype:EmbySelectPrototype,extends:"select"})});
|
|
@ -1,236 +1 @@
|
|||
_:-ms-input-placeholder, :root .mdl-slider {
|
||||
-ms-appearance: none;
|
||||
height: 32px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.mdl-slider {
|
||||
width: 100%;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
height: .15em;
|
||||
background: transparent;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
outline: 0;
|
||||
padding: 1em 0;
|
||||
color: #52B54B;
|
||||
-webkit-align-self: center;
|
||||
-ms-flex-item-align: center;
|
||||
align-self: center;
|
||||
z-index: 1;
|
||||
cursor: pointer;
|
||||
margin: 0;
|
||||
/* Disable webkit tap highlighting */
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
display: block;
|
||||
/**************************** Tracks ****************************/
|
||||
/**************************** Thumbs ****************************/
|
||||
/**************************** 0-value ****************************/
|
||||
/**************************** Disabled ****************************/
|
||||
}
|
||||
|
||||
.mdl-slider::-moz-focus-outer {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.mdl-slider::-ms-tooltip {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mdl-slider::-webkit-slider-runnable-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.mdl-slider::-moz-range-track {
|
||||
background: #444;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.mdl-slider::-moz-range-progress {
|
||||
background: #52B54B;
|
||||
}
|
||||
|
||||
.mdl-slider::-ms-track {
|
||||
background: none;
|
||||
color: transparent;
|
||||
height: .15em;
|
||||
width: 100%;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.mdl-slider::-ms-fill-lower {
|
||||
padding: 0;
|
||||
background: linear-gradient(to right, transparent, transparent 16px, #52B54B 16px, #52B54B 0);
|
||||
}
|
||||
|
||||
.mdl-slider::-ms-fill-upper {
|
||||
padding: 0;
|
||||
background: linear-gradient(to left, transparent, transparent 16px, #444 16px, #444 0);
|
||||
}
|
||||
|
||||
.mdl-slider::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
box-sizing: border-box;
|
||||
border-radius: 50%;
|
||||
background: #52B54B;
|
||||
border: none;
|
||||
transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), border 0.18s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1), background 0.28s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.slider-no-webkit-thumb::-webkit-slider-thumb {
|
||||
opacity: 0 !important;
|
||||
}
|
||||
|
||||
.mdl-slider::-moz-range-thumb {
|
||||
-moz-appearance: none;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
box-sizing: border-box;
|
||||
border-radius: 50%;
|
||||
background-image: none;
|
||||
background: #52B54B;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.mdl-slider:active::-webkit-slider-thumb {
|
||||
background-image: none;
|
||||
background: #52B54B;
|
||||
-webkit-transform: scale(1.5);
|
||||
transform: scale(1.5);
|
||||
}
|
||||
|
||||
.mdl-slider:active::-moz-range-thumb {
|
||||
background-image: none;
|
||||
background: #52B54B;
|
||||
transform: scale(1.5);
|
||||
}
|
||||
|
||||
.mdl-slider:focus::-webkit-slider-thumb {
|
||||
box-shadow: 0 0 0 10px rgba(82, 181, 75, 0.26);
|
||||
}
|
||||
|
||||
.mdl-slider:focus::-moz-range-thumb {
|
||||
box-shadow: 0 0 0 10px rgba(82, 181, 75, 0.26);
|
||||
}
|
||||
|
||||
.mdl-slider::-ms-thumb {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
background: #52B54B;
|
||||
}
|
||||
|
||||
.mdl-slider[disabled]::-ms-thumb {
|
||||
background: gray;
|
||||
}
|
||||
|
||||
.mdl-slider:disabled:focus::-webkit-slider-thumb, .mdl-slider:disabled:active::-webkit-slider-thumb, .mdl-slider:disabled::-webkit-slider-thumb {
|
||||
-webkit-transform: scale(0.667);
|
||||
transform: scale(0.667);
|
||||
background: rgba(0,0,0, 0.26);
|
||||
}
|
||||
|
||||
.mdl-slider:disabled:focus::-moz-range-thumb, .mdl-slider:disabled:active::-moz-range-thumb, .mdl-slider:disabled::-moz-range-thumb {
|
||||
transform: scale(0.667);
|
||||
background: rgba(0,0,0, 0.26);
|
||||
}
|
||||
|
||||
.mdl-slider:disabled + .mdl-slider__background-flex > .mdl-slider__background-lower {
|
||||
background-color: #444;
|
||||
left: -6px;
|
||||
}
|
||||
|
||||
.mdl-slider:disabled + .mdl-slider__background-flex > .mdl-slider__background-upper {
|
||||
left: 6px;
|
||||
}
|
||||
|
||||
.mdl-slider:disabled::-ms-fill-lower {
|
||||
margin-right: 6px;
|
||||
background: linear-gradient(to right, transparent, transparent 25px, rgba(30,30,30, 0.7) 25px, rgba(30,30,30, 0.7) 0);
|
||||
}
|
||||
|
||||
.mdl-slider:disabled::-ms-fill-upper {
|
||||
margin-left: 6px;
|
||||
}
|
||||
|
||||
.mdl-slider__ie-container {
|
||||
height: 18px;
|
||||
overflow: visible;
|
||||
border: none;
|
||||
margin: none;
|
||||
padding: none;
|
||||
}
|
||||
|
||||
.mdl-slider__container {
|
||||
height: 18px;
|
||||
position: relative;
|
||||
background: none;
|
||||
display: -webkit-flex;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-flex-direction: row;
|
||||
-ms-flex-direction: row;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.mdl-slider__background-flex {
|
||||
background: transparent;
|
||||
position: absolute;
|
||||
height: .15em;
|
||||
width: 100%;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
display: -webkit-flex;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
-webkit-transform: translate(0, -1px);
|
||||
transform: translate(0, -1px);
|
||||
}
|
||||
|
||||
.mdl-slider__background-lower {
|
||||
background: #52B54B;
|
||||
-webkit-flex: 0;
|
||||
-ms-flex: 0;
|
||||
flex: 0;
|
||||
position: relative;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.mdl-slider__background-upper {
|
||||
background: #444;
|
||||
-webkit-flex: 0;
|
||||
-ms-flex: 0;
|
||||
flex: 0;
|
||||
position: relative;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
transition: left 0.18s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.sliderBubble {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
transform: translate3d(-48%, -120%, 0);
|
||||
background: #282828;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.sliderBubbleText {
|
||||
margin: 0;
|
||||
padding: .5em .75em;
|
||||
}
|
||||
:root .mdl-slider,_:-ms-input-placeholder{-ms-appearance:none;height:32px;margin:0}.mdl-slider{width:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;height:.15em;background:0 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:0;padding:1em 0;color:#52B54B;-webkit-align-self:center;align-self:center;z-index:1;cursor:pointer;margin:0;-webkit-tap-highlight-color:transparent;display:block}.mdl-slider::-moz-focus-outer{border:0}.mdl-slider::-ms-tooltip{display:none}.mdl-slider::-webkit-slider-runnable-track{background:0 0}.mdl-slider::-moz-range-track{background:#444;border:none}.mdl-slider::-moz-range-progress{background:#52B54B}.mdl-slider::-ms-track{background:0 0;color:transparent;height:.15em;width:100%;border:none}.mdl-slider::-ms-fill-lower{padding:0;background:linear-gradient(to right,transparent,transparent 16px,#52B54B 16px,#52B54B 0)}.mdl-slider::-ms-fill-upper{padding:0;background:linear-gradient(to left,transparent,transparent 16px,#444 16px,#444 0)}.mdl-slider::-webkit-slider-thumb{-webkit-appearance:none;width:1em;height:1em;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:50%;border-radius:50%;background:#52B54B;border:none;-webkit-transition:-webkit-transform .18s cubic-bezier(.4,0,.2,1),border .18s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .18s cubic-bezier(.4,0,.2,1),background .28s cubic-bezier(.4,0,.2,1);transition:transform .18s cubic-bezier(.4,0,.2,1),border .18s cubic-bezier(.4,0,.2,1),box-shadow .18s cubic-bezier(.4,0,.2,1),background .28s cubic-bezier(.4,0,.2,1)}.slider-no-webkit-thumb::-webkit-slider-thumb{opacity:0!important}.mdl-slider::-moz-range-thumb{-moz-appearance:none;width:1em;height:1em;box-sizing:border-box;border-radius:50%;background:#52B54B;border:none}.mdl-slider:active::-webkit-slider-thumb{background:#52B54B;-webkit-transform:scale(1.5);transform:scale(1.5)}.mdl-slider:active::-moz-range-thumb{background:#52B54B;transform:scale(1.5)}.mdl-slider:focus::-webkit-slider-thumb{-webkit-box-shadow:0 0 0 10px rgba(82,181,75,.26);box-shadow:0 0 0 10px rgba(82,181,75,.26)}.mdl-slider:focus::-moz-range-thumb{box-shadow:0 0 0 10px rgba(82,181,75,.26)}.mdl-slider::-ms-thumb{width:16px;height:16px;border:none;border-radius:50%;background:#52B54B}.mdl-slider[disabled]::-ms-thumb{background:gray}.mdl-slider:disabled::-webkit-slider-thumb,.mdl-slider:disabled:active::-webkit-slider-thumb,.mdl-slider:disabled:focus::-webkit-slider-thumb{-webkit-transform:scale(.667);transform:scale(.667);background:rgba(0,0,0,.26)}.mdl-slider:disabled::-moz-range-thumb,.mdl-slider:disabled:active::-moz-range-thumb,.mdl-slider:disabled:focus::-moz-range-thumb{transform:scale(.667);background:rgba(0,0,0,.26)}.mdl-slider:disabled+.mdl-slider__background-flex>.mdl-slider__background-lower{background-color:#444;left:-6px}.mdl-slider:disabled+.mdl-slider__background-flex>.mdl-slider__background-upper{left:6px}.mdl-slider:disabled::-ms-fill-lower{margin-right:6px;background:linear-gradient(to right,transparent,transparent 25px,rgba(30,30,30,.7) 25px,rgba(30,30,30,.7) 0)}.mdl-slider__background-flex,.mdl-slider__container{background:0 0;display:-webkit-flex;display:-webkit-box}.mdl-slider:disabled::-ms-fill-upper{margin-left:6px}.mdl-slider__ie-container{height:18px;overflow:visible;border:none;margin:none;padding:none}.mdl-slider__container{height:18px;position:relative;display:flex;-webkit-flex-direction:row;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}.mdl-slider__background-flex{position:absolute;height:.15em;width:100%;top:50%;left:0;display:flex;overflow:hidden;border:0;padding:0;-webkit-transform:translate(0,-1px);transform:translate(0,-1px)}.mdl-slider__background-lower{background:#52B54B;-webkit-flex:0;-webkit-box-flex:0;flex:0;position:relative;border:0;padding:0}.mdl-slider__background-upper{background:#444;-webkit-flex:0;-webkit-box-flex:0;flex:0;position:relative;border:0;padding:0;-webkit-transition:left .18s cubic-bezier(.4,0,.2,1);-o-transition:left .18s cubic-bezier(.4,0,.2,1);transition:left .18s cubic-bezier(.4,0,.2,1)}.sliderBubble{position:absolute;top:0;left:0;-webkit-transform:translate3d(-48%,-120%,0);transform:translate3d(-48%,-120%,0);background:#282828;color:#fff;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.sliderBubbleText{margin:0;padding:.5em .75em}
|
|
@ -1,179 +1 @@
|
|||
define(['browser', 'dom', 'css!./emby-slider', 'registerElement', 'emby-input'], function (browser, dom) {
|
||||
'use strict';
|
||||
|
||||
var EmbySliderPrototype = Object.create(HTMLInputElement.prototype);
|
||||
|
||||
var supportsNativeProgressStyle = browser.firefox || browser.edge || browser.msie;
|
||||
var supportsValueSetOverride = false;
|
||||
|
||||
if (Object.getOwnPropertyDescriptor && Object.defineProperty) {
|
||||
|
||||
var descriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
|
||||
// descriptor returning null in webos
|
||||
if (descriptor && descriptor.configurable) {
|
||||
supportsValueSetOverride = true;
|
||||
}
|
||||
}
|
||||
|
||||
function updateValues(range, backgroundLower, backgroundUpper) {
|
||||
|
||||
var value = range.value;
|
||||
requestAnimationFrame(function () {
|
||||
|
||||
if (backgroundLower) {
|
||||
var fraction = (value - range.min) / (range.max - range.min);
|
||||
|
||||
if (browser.noFlex) {
|
||||
backgroundLower.style['-webkit-flex'] = fraction;
|
||||
backgroundUpper.style['-webkit-flex'] = 1 - fraction;
|
||||
backgroundLower.style['-webkit-box-flex'] = fraction;
|
||||
backgroundUpper.style['-webkit-box-flex'] = 1 - fraction;
|
||||
}
|
||||
|
||||
backgroundLower.style.flex = fraction;
|
||||
backgroundUpper.style.flex = 1 - fraction;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateBubble(range, value, bubble, bubbleText) {
|
||||
|
||||
bubble.style.left = value + '%';
|
||||
|
||||
if (range.getBubbleHtml) {
|
||||
value = range.getBubbleHtml(value);
|
||||
} else {
|
||||
if (range.getBubbleText) {
|
||||
value = range.getBubbleText(value);
|
||||
} else {
|
||||
value = Math.round(value);
|
||||
}
|
||||
value = '<h1 class="sliderBubbleText">' + value + '</h1>';
|
||||
}
|
||||
|
||||
bubble.innerHTML = value;
|
||||
}
|
||||
|
||||
EmbySliderPrototype.attachedCallback = function () {
|
||||
|
||||
if (this.getAttribute('data-embyslider') === 'true') {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setAttribute('data-embyslider', 'true');
|
||||
|
||||
this.classList.add('mdl-slider');
|
||||
this.classList.add('mdl-js-slider');
|
||||
|
||||
if (browser.noFlex) {
|
||||
this.classList.add('slider-no-webkit-thumb');
|
||||
}
|
||||
|
||||
var containerElement = this.parentNode;
|
||||
containerElement.classList.add('mdl-slider__container');
|
||||
|
||||
var htmlToInsert = '';
|
||||
|
||||
if (!supportsNativeProgressStyle) {
|
||||
htmlToInsert += '<div class="mdl-slider__background-flex"><div class="mdl-slider__background-lower"></div><div class="mdl-slider__background-upper"></div></div>';
|
||||
}
|
||||
|
||||
htmlToInsert += '<div class="sliderBubble hide"></div>';
|
||||
|
||||
containerElement.insertAdjacentHTML('beforeend', htmlToInsert);
|
||||
|
||||
var backgroundLower = containerElement.querySelector('.mdl-slider__background-lower');
|
||||
var backgroundUpper = containerElement.querySelector('.mdl-slider__background-upper');
|
||||
var sliderBubble = containerElement.querySelector('.sliderBubble');
|
||||
|
||||
var hasHideClass = sliderBubble.classList.contains('hide');
|
||||
|
||||
dom.addEventListener(this, 'input', function (e) {
|
||||
this.dragging = true;
|
||||
|
||||
updateBubble(this, this.value, sliderBubble);
|
||||
|
||||
if (hasHideClass) {
|
||||
sliderBubble.classList.remove('hide');
|
||||
hasHideClass = false;
|
||||
}
|
||||
}, {
|
||||
passive: true
|
||||
});
|
||||
|
||||
dom.addEventListener(this, 'change', function () {
|
||||
this.dragging = false;
|
||||
updateValues(this, backgroundLower, backgroundUpper);
|
||||
|
||||
sliderBubble.classList.add('hide');
|
||||
hasHideClass = true;
|
||||
|
||||
}, {
|
||||
passive: true
|
||||
});
|
||||
|
||||
// In firefox this feature disrupts the ability to move the slider
|
||||
if (!browser.firefox) {
|
||||
dom.addEventListener(this, 'mousemove', function (e) {
|
||||
|
||||
if (!this.dragging) {
|
||||
var rect = this.getBoundingClientRect();
|
||||
var clientX = e.clientX;
|
||||
var bubbleValue = (clientX - rect.left) / rect.width;
|
||||
bubbleValue *= 100;
|
||||
updateBubble(this, bubbleValue, sliderBubble);
|
||||
|
||||
if (hasHideClass) {
|
||||
sliderBubble.classList.remove('hide');
|
||||
hasHideClass = false;
|
||||
}
|
||||
}
|
||||
|
||||
}, {
|
||||
passive: true
|
||||
});
|
||||
|
||||
dom.addEventListener(this, 'mouseleave', function () {
|
||||
sliderBubble.classList.add('hide');
|
||||
hasHideClass = true;
|
||||
}, {
|
||||
passive: true
|
||||
});
|
||||
}
|
||||
|
||||
if (!supportsNativeProgressStyle) {
|
||||
|
||||
if (supportsValueSetOverride) {
|
||||
this.addEventListener('valueset', function () {
|
||||
updateValues(this, backgroundLower, backgroundUpper);
|
||||
});
|
||||
} else {
|
||||
startInterval(this, backgroundLower, backgroundUpper);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function startInterval(range, backgroundLower, backgroundUpper) {
|
||||
var interval = range.interval;
|
||||
if (interval) {
|
||||
clearInterval(interval);
|
||||
}
|
||||
range.interval = setInterval(function () {
|
||||
updateValues(range, backgroundLower, backgroundUpper);
|
||||
}, 100);
|
||||
}
|
||||
|
||||
EmbySliderPrototype.detachedCallback = function () {
|
||||
|
||||
var interval = this.interval;
|
||||
if (interval) {
|
||||
clearInterval(interval);
|
||||
}
|
||||
this.interval = null;
|
||||
};
|
||||
|
||||
document.registerElement('emby-slider', {
|
||||
prototype: EmbySliderPrototype,
|
||||
extends: 'input'
|
||||
});
|
||||
});
|
||||
define(["browser","dom","css!./emby-slider","registerElement","emby-input"],function(browser,dom){"use strict";function updateValues(range,backgroundLower,backgroundUpper){var value=range.value;requestAnimationFrame(function(){if(backgroundLower){var fraction=(value-range.min)/(range.max-range.min);browser.noFlex&&(backgroundLower.style["-webkit-flex"]=fraction,backgroundUpper.style["-webkit-flex"]=1-fraction,backgroundLower.style["-webkit-box-flex"]=fraction,backgroundUpper.style["-webkit-box-flex"]=1-fraction),backgroundLower.style.flex=fraction,backgroundUpper.style.flex=1-fraction}})}function updateBubble(range,value,bubble,bubbleText){bubble.style.left=value+"%",range.getBubbleHtml?value=range.getBubbleHtml(value):(value=range.getBubbleText?range.getBubbleText(value):Math.round(value),value='<h1 class="sliderBubbleText">'+value+"</h1>"),bubble.innerHTML=value}function startInterval(range,backgroundLower,backgroundUpper){var interval=range.interval;interval&&clearInterval(interval),range.interval=setInterval(function(){updateValues(range,backgroundLower,backgroundUpper)},100)}var EmbySliderPrototype=Object.create(HTMLInputElement.prototype),supportsNativeProgressStyle=browser.firefox||browser.edge||browser.msie,supportsValueSetOverride=!1;if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var descriptor=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");descriptor&&descriptor.configurable&&(supportsValueSetOverride=!0)}EmbySliderPrototype.attachedCallback=function(){if("true"!==this.getAttribute("data-embyslider")){this.setAttribute("data-embyslider","true"),this.classList.add("mdl-slider"),this.classList.add("mdl-js-slider"),browser.noFlex&&this.classList.add("slider-no-webkit-thumb");var containerElement=this.parentNode;containerElement.classList.add("mdl-slider__container");var htmlToInsert="";supportsNativeProgressStyle||(htmlToInsert+='<div class="mdl-slider__background-flex"><div class="mdl-slider__background-lower"></div><div class="mdl-slider__background-upper"></div></div>'),htmlToInsert+='<div class="sliderBubble hide"></div>',containerElement.insertAdjacentHTML("beforeend",htmlToInsert);var backgroundLower=containerElement.querySelector(".mdl-slider__background-lower"),backgroundUpper=containerElement.querySelector(".mdl-slider__background-upper"),sliderBubble=containerElement.querySelector(".sliderBubble"),hasHideClass=sliderBubble.classList.contains("hide");dom.addEventListener(this,"input",function(e){this.dragging=!0,updateBubble(this,this.value,sliderBubble),hasHideClass&&(sliderBubble.classList.remove("hide"),hasHideClass=!1)},{passive:!0}),dom.addEventListener(this,"change",function(){this.dragging=!1,updateValues(this,backgroundLower,backgroundUpper),sliderBubble.classList.add("hide"),hasHideClass=!0},{passive:!0}),browser.firefox||(dom.addEventListener(this,"mousemove",function(e){if(!this.dragging){var rect=this.getBoundingClientRect(),clientX=e.clientX,bubbleValue=(clientX-rect.left)/rect.width;bubbleValue*=100,updateBubble(this,bubbleValue,sliderBubble),hasHideClass&&(sliderBubble.classList.remove("hide"),hasHideClass=!1)}},{passive:!0}),dom.addEventListener(this,"mouseleave",function(){sliderBubble.classList.add("hide"),hasHideClass=!0},{passive:!0})),supportsNativeProgressStyle||(supportsValueSetOverride?this.addEventListener("valueset",function(){updateValues(this,backgroundLower,backgroundUpper)}):startInterval(this,backgroundLower,backgroundUpper))}},EmbySliderPrototype.detachedCallback=function(){var interval=this.interval;interval&&clearInterval(interval),this.interval=null},document.registerElement("emby-slider",{prototype:EmbySliderPrototype,extends:"input"})});
|
|
@ -1,69 +1 @@
|
|||
.emby-tab-button {
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
border: 2px solid transparent;
|
||||
border-width: 0 0 2px 0;
|
||||
cursor: pointer;
|
||||
outline: none !important;
|
||||
width: auto;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
color: #aaa;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
flex-shrink: 0;
|
||||
margin: 0;
|
||||
padding: 1.2em .9em;
|
||||
position: relative;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
height: auto;
|
||||
min-width: initial;
|
||||
line-height: initial;
|
||||
border-radius: 0 !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.emby-tab-button:focus {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.emby-tab-button-active {
|
||||
color: #52B54B;
|
||||
border-color: #52B54B;
|
||||
}
|
||||
|
||||
.emby-tabs-slider {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.emby-tabs-selection-bar {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
/* Need this or it will be partially covered by the drop-shadow on android */
|
||||
bottom: 0;
|
||||
height: 2px;
|
||||
z-index: 1000;
|
||||
background: #52B54B;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.emby-tab-button-selection-bar {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
border: 0;
|
||||
/* Need this or it will be partially covered by the drop-shadow on android */
|
||||
bottom: 1px;
|
||||
height: 2px;
|
||||
right: 0;
|
||||
border-radius: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.emby-tab-button-selection-bar-active {
|
||||
background: #52B54B;
|
||||
}
|
||||
|
||||
.emby-tab-button-ripple-effect {
|
||||
background: #141414 !important;
|
||||
}
|
||||
.emby-tab-button,.emby-tabs-slider{position:relative}.emby-tab-button{background:0 0;-webkit-box-shadow:none;box-shadow:none;border:2px solid transparent;border-width:0 0 2px;cursor:pointer;outline:0!important;width:auto;font-family:inherit;font-size:inherit;color:#aaa;display:inline-block;vertical-align:middle;-webkit-flex-shrink:0;flex-shrink:0;margin:0;padding:1.2em .9em;text-transform:uppercase;font-weight:700;height:auto;min-width:initial;line-height:initial;-webkit-border-radius:0!important;border-radius:0!important;overflow:hidden}.emby-tab-button:focus{font-weight:700}.emby-tab-button-active{color:#52B54B;border-color:#52B54B}.emby-tabs-selection-bar{position:absolute;left:0;bottom:0;height:2px;z-index:1000;background:#52B54B;width:0}.emby-tab-button-selection-bar{position:absolute;left:0;border:0;bottom:1px;height:2px;right:0;-webkit-border-radius:0;border-radius:0;z-index:1000}.emby-tab-button-selection-bar-active{background:#52B54B}.emby-tab-button-ripple-effect{background:#141414!important}
|
File diff suppressed because one or more lines are too long
|
@ -1,54 +1 @@
|
|||
.emby-textarea {
|
||||
display: block;
|
||||
margin: 0;
|
||||
margin-bottom: 0 !important;
|
||||
background: none;
|
||||
border: 1px solid #383838;
|
||||
border-width: 0 0 1px 0;
|
||||
/* Prefixed box-sizing rules necessary for older browsers */
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
/* Remove select styling */
|
||||
/* Font size must the 16px or larger to prevent iOS page zoom on focus */
|
||||
font-size: inherit;
|
||||
/* General select styles: change as needed */
|
||||
font-family: inherit;
|
||||
font-weight: inherit;
|
||||
color: inherit;
|
||||
padding: .35em 0 .3em 0;
|
||||
cursor: pointer;
|
||||
outline: none !important;
|
||||
width: 100%;
|
||||
background-color: transparent;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.inputContainer {
|
||||
margin-bottom: 1.8em;
|
||||
}
|
||||
|
||||
.textareaLabel {
|
||||
display: inline-block;
|
||||
transition: all .2s ease-out;
|
||||
}
|
||||
|
||||
.textareaLabelFocused {
|
||||
color: #52B54B;
|
||||
}
|
||||
|
||||
.emby-textarea-selectionbar {
|
||||
height: 2px;
|
||||
transform: scale(.01, 1);
|
||||
transition: transform .25s ease-out;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
margin-bottom: .5em;
|
||||
-webkit-transform-origin: center center;
|
||||
transform-origin: center center;
|
||||
}
|
||||
|
||||
.emby-textarea:focus + .emby-textarea-selectionbar {
|
||||
background-color: #52B54B;
|
||||
transform: none;
|
||||
}
|
||||
.emby-textarea{display:block;margin:0;margin-bottom:0!important;background:0 0;border:1px solid #383838;border-width:0 0 1px;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:inherit;font-family:inherit;font-weight:inherit;color:inherit;padding:.35em 0 .3em;cursor:pointer;outline:0!important;width:100%;-webkit-border-radius:0;border-radius:0}.inputContainer{margin-bottom:1.8em}.textareaLabel{display:inline-block;-webkit-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}.textareaLabelFocused{color:#52B54B}.emby-textarea-selectionbar{height:2px;-webkit-transform:scale(.01,1);transform:scale(.01,1);-webkit-transition:-webkit-transform .25s ease-out;-o-transition:transform .25s ease-out;transition:transform .25s ease-out;position:relative;top:-1px;margin-bottom:.5em;-webkit-transform-origin:center center;transform-origin:center center}.emby-textarea:focus+.emby-textarea-selectionbar{background-color:#52B54B;-webkit-transform:none;transform:none}
|
|
@ -1,148 +1 @@
|
|||
define(['layoutManager', 'browser', 'css!./emby-textarea', 'registerElement'], function (layoutManager, browser) {
|
||||
'use strict';
|
||||
|
||||
function autoGrow(textarea, maxLines) {
|
||||
var self = this;
|
||||
|
||||
if (maxLines === undefined) {
|
||||
maxLines = 999;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the vertical padding of the element
|
||||
* @param textarea
|
||||
* @returns {number}
|
||||
*/
|
||||
self.getOffset = function (textarea) {
|
||||
var style = window.getComputedStyle(textarea, null),
|
||||
props = ['paddingTop', 'paddingBottom'],
|
||||
offset = 0;
|
||||
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
offset += parseInt(style[props[i]]);
|
||||
}
|
||||
return offset;
|
||||
};
|
||||
|
||||
var offset;
|
||||
function reset() {
|
||||
textarea.rows = 1;
|
||||
offset = self.getOffset(textarea);
|
||||
self.rows = textarea.rows || 1;
|
||||
self.lineHeight = (textarea.scrollHeight / self.rows) - (offset / self.rows);
|
||||
self.maxAllowedHeight = (self.lineHeight * maxLines) - offset;
|
||||
}
|
||||
|
||||
function autogrowFn() {
|
||||
if (!self.lineHeight || self.lineHeight <= 0) {
|
||||
reset();
|
||||
}
|
||||
if (self.lineHeight <= 0) {
|
||||
textarea.style.overflowY = 'scroll';
|
||||
textarea.style.height = 'auto';
|
||||
textarea.rows = 3;
|
||||
return;
|
||||
}
|
||||
var newHeight = 0, hasGrown = false;
|
||||
|
||||
if ((textarea.scrollHeight - offset) > self.maxAllowedHeight) {
|
||||
textarea.style.overflowY = 'scroll';
|
||||
newHeight = self.maxAllowedHeight;
|
||||
}
|
||||
else {
|
||||
textarea.style.overflowY = 'hidden';
|
||||
textarea.style.height = 'auto';
|
||||
newHeight = textarea.scrollHeight/* - offset*/;
|
||||
hasGrown = true;
|
||||
}
|
||||
textarea.style.height = newHeight + 'px';
|
||||
}
|
||||
|
||||
// Call autogrowFn() when textarea's value is changed
|
||||
textarea.addEventListener('input', autogrowFn);
|
||||
textarea.addEventListener('focus', autogrowFn);
|
||||
textarea.addEventListener('valueset', autogrowFn);
|
||||
|
||||
autogrowFn();
|
||||
}
|
||||
|
||||
var EmbyTextAreaPrototype = Object.create(HTMLTextAreaElement.prototype);
|
||||
|
||||
var elementId = 0;
|
||||
var supportsFloatingLabel = false;
|
||||
|
||||
if (Object.getOwnPropertyDescriptor && Object.defineProperty) {
|
||||
|
||||
var descriptor = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, 'value');
|
||||
|
||||
// descriptor returning null in webos
|
||||
if (descriptor && descriptor.configurable) {
|
||||
var baseSetMethod = descriptor.set;
|
||||
descriptor.set = function (value) {
|
||||
baseSetMethod.call(this, value);
|
||||
|
||||
this.dispatchEvent(new CustomEvent('valueset', {
|
||||
bubbles: false,
|
||||
cancelable: false
|
||||
}));
|
||||
};
|
||||
|
||||
Object.defineProperty(HTMLTextAreaElement.prototype, 'value', descriptor);
|
||||
supportsFloatingLabel = true;
|
||||
}
|
||||
}
|
||||
|
||||
EmbyTextAreaPrototype.createdCallback = function () {
|
||||
|
||||
if (!this.id) {
|
||||
this.id = 'embytextarea' + elementId;
|
||||
elementId++;
|
||||
}
|
||||
};
|
||||
|
||||
EmbyTextAreaPrototype.attachedCallback = function () {
|
||||
|
||||
if (this.classList.contains('emby-textarea')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.rows = 1;
|
||||
this.classList.add('emby-textarea');
|
||||
|
||||
var parentNode = this.parentNode;
|
||||
var label = this.ownerDocument.createElement('label');
|
||||
label.innerHTML = this.getAttribute('label') || '';
|
||||
label.classList.add('textareaLabel');
|
||||
|
||||
if (!supportsFloatingLabel || this.type === 'date') {
|
||||
label.classList.add('nofloat');
|
||||
}
|
||||
|
||||
label.htmlFor = this.id;
|
||||
parentNode.insertBefore(label, this);
|
||||
|
||||
var div = document.createElement('div');
|
||||
div.classList.add('emby-textarea-selectionbar');
|
||||
parentNode.insertBefore(div, this.nextSibling);
|
||||
|
||||
this.addEventListener('focus', function () {
|
||||
label.classList.add('textareaLabelFocused');
|
||||
label.classList.remove('textareaLabelUnfocused');
|
||||
});
|
||||
this.addEventListener('blur', function () {
|
||||
label.classList.remove('textareaLabelFocused');
|
||||
label.classList.add('textareaLabelUnfocused');
|
||||
});
|
||||
|
||||
this.label = function (text) {
|
||||
label.innerHTML = text;
|
||||
};
|
||||
|
||||
new autoGrow(this);
|
||||
};
|
||||
|
||||
document.registerElement('emby-textarea', {
|
||||
prototype: EmbyTextAreaPrototype,
|
||||
extends: 'textarea'
|
||||
});
|
||||
});
|
||||
define(["layoutManager","browser","css!./emby-textarea","registerElement"],function(layoutManager,browser){"use strict";function autoGrow(textarea,maxLines){function reset(){textarea.rows=1,offset=self.getOffset(textarea),self.rows=textarea.rows||1,self.lineHeight=textarea.scrollHeight/self.rows-offset/self.rows,self.maxAllowedHeight=self.lineHeight*maxLines-offset}function autogrowFn(){if((!self.lineHeight||self.lineHeight<=0)&&reset(),self.lineHeight<=0)return textarea.style.overflowY="scroll",textarea.style.height="auto",void(textarea.rows=3);var newHeight=0,hasGrown=!1;textarea.scrollHeight-offset>self.maxAllowedHeight?(textarea.style.overflowY="scroll",newHeight=self.maxAllowedHeight):(textarea.style.overflowY="hidden",textarea.style.height="auto",newHeight=textarea.scrollHeight,hasGrown=!0),textarea.style.height=newHeight+"px"}var self=this;void 0===maxLines&&(maxLines=999),self.getOffset=function(textarea){for(var style=window.getComputedStyle(textarea,null),props=["paddingTop","paddingBottom"],offset=0,i=0;i<props.length;i++)offset+=parseInt(style[props[i]]);return offset};var offset;textarea.addEventListener("input",autogrowFn),textarea.addEventListener("focus",autogrowFn),textarea.addEventListener("valueset",autogrowFn),autogrowFn()}var EmbyTextAreaPrototype=Object.create(HTMLTextAreaElement.prototype),elementId=0,supportsFloatingLabel=!1;if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var descriptor=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value");if(descriptor&&descriptor.configurable){var baseSetMethod=descriptor.set;descriptor.set=function(value){baseSetMethod.call(this,value),this.dispatchEvent(new CustomEvent("valueset",{bubbles:!1,cancelable:!1}))},Object.defineProperty(HTMLTextAreaElement.prototype,"value",descriptor),supportsFloatingLabel=!0}}EmbyTextAreaPrototype.createdCallback=function(){this.id||(this.id="embytextarea"+elementId,elementId++)},EmbyTextAreaPrototype.attachedCallback=function(){if(!this.classList.contains("emby-textarea")){this.rows=1,this.classList.add("emby-textarea");var parentNode=this.parentNode,label=this.ownerDocument.createElement("label");label.innerHTML=this.getAttribute("label")||"",label.classList.add("textareaLabel"),supportsFloatingLabel&&"date"!==this.type||label.classList.add("nofloat"),label.htmlFor=this.id,parentNode.insertBefore(label,this);var div=document.createElement("div");div.classList.add("emby-textarea-selectionbar"),parentNode.insertBefore(div,this.nextSibling),this.addEventListener("focus",function(){label.classList.add("textareaLabelFocused"),label.classList.remove("textareaLabelUnfocused")}),this.addEventListener("blur",function(){label.classList.remove("textareaLabelFocused"),label.classList.add("textareaLabelUnfocused")}),this.label=function(text){label.innerHTML=text},new autoGrow(this)}},document.registerElement("emby-textarea",{prototype:EmbyTextAreaPrototype,extends:"textarea"})});
|
|
@ -1,137 +1 @@
|
|||
.mdl-switch {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
vertical-align: middle;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: visible;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
flex-direction: row-reverse;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.toggleContainer {
|
||||
margin-bottom: 1.8em;
|
||||
}
|
||||
|
||||
.mdl-switch__input {
|
||||
width: 0;
|
||||
height: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
opacity: 0;
|
||||
-ms-appearance: none;
|
||||
-moz-appearance: none;
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.mdl-switch__trackContainer {
|
||||
position: relative;
|
||||
width: 2.9em;
|
||||
}
|
||||
|
||||
.mdl-switch__track {
|
||||
background: rgba(255,255,255, 0.26);
|
||||
height: 1em;
|
||||
border-radius: 1em;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.mdl-switch__input:checked + .mdl-switch__label + .mdl-switch__trackContainer > .mdl-switch__track {
|
||||
background: rgba(82,181,75, 0.5);
|
||||
}
|
||||
|
||||
.mdl-switch__input.red:checked + .mdl-switch__label + .mdl-switch__trackContainer > .mdl-switch__track {
|
||||
background: rgba(204,51,51, 0.5);
|
||||
}
|
||||
|
||||
.mdl-switch__input[disabled] + .mdl-switch__label + .mdl-switch__trackContainer > .mdl-switch__track {
|
||||
background: rgba(0,0,0, 0.12);
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.mdl-switch__thumb {
|
||||
background: #999;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: -.25em;
|
||||
height: 1.44em;
|
||||
width: 1.44em;
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
|
||||
transition-duration: 0.28s;
|
||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition-property: left;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.mdl-switch__input:checked + .mdl-switch__label + .mdl-switch__trackContainer > .mdl-switch__thumb {
|
||||
background: rgb(82,181,75);
|
||||
left: 1.466em;
|
||||
box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.14), 0 3px 3px -2px rgba(0, 0, 0, 0.2), 0 1px 8px 0 rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
.mdl-switch__input.red:checked + .mdl-switch__label + .mdl-switch__trackContainer > .mdl-switch__thumb {
|
||||
background: rgb(204,51,51);
|
||||
box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.14), 0 3px 3px -2px rgba(0, 0, 0, 0.2), 0 1px 8px 0 rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
.mdl-switch__input[disabled] + .mdl-switch__label + .mdl-switch__trackContainer > .mdl-switch__thumb {
|
||||
background: rgb(189,189,189);
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.mdl-switch__focus-helper {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
-webkit-transform: translate(-50%, -50%);
|
||||
transform: translate(-50%, -50%);
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
width: .6em;
|
||||
height: .6em;
|
||||
border-radius: 50%;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.mdl-switch__input:focus + .mdl-switch__label + .mdl-switch__trackContainer .mdl-switch__focus-helper {
|
||||
box-shadow: 0 0 0px 20px rgba(255,255,255, 0.26);
|
||||
background-color: rgba(255,255,255, 0.26);
|
||||
}
|
||||
|
||||
.mdl-switch__input:checked:focus + .mdl-switch__label + .mdl-switch__trackContainer .mdl-switch__focus-helper {
|
||||
box-shadow: 0 0 0px 20px rgba(82,181,75, 0.26);
|
||||
background-color: rgba(82,181,75, 0.26);
|
||||
}
|
||||
|
||||
.mdl-switch__input.red:checked:focus + .mdl-switch__label + .mdl-switch__trackContainer .mdl-switch__focus-helper {
|
||||
box-shadow: 0 0 0px 20px rgba(204,51,51, 0.26);
|
||||
background-color: rgba(204,51,51, 0.26);
|
||||
}
|
||||
|
||||
.mdl-switch__label {
|
||||
cursor: pointer;
|
||||
margin: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
margin-left: .7em;
|
||||
}
|
||||
|
||||
.mdl-switch__input[disabled] .mdl-switch__label {
|
||||
color: rgb(189,189,189);
|
||||
cursor: auto;
|
||||
}
|
||||
.mdl-switch{position:relative;z-index:1;vertical-align:middle;display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;margin:0;padding:0;overflow:visible;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-webkit-flex-direction:row-reverse;flex-direction:row-reverse;-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end}.toggleContainer{margin-bottom:1.8em}.mdl-switch__input{width:0;height:0;margin:0;padding:0;opacity:0;-ms-appearance:none;-moz-appearance:none;-webkit-appearance:none;appearance:none;border:none}.mdl-switch__trackContainer{position:relative;width:2.9em}.mdl-switch__track{background:rgba(255,255,255,.26);height:1em;-webkit-border-radius:1em;border-radius:1em;cursor:pointer}.mdl-switch__input:checked+.mdl-switch__label+.mdl-switch__trackContainer>.mdl-switch__track{background:rgba(82,181,75,.5)}.mdl-switch__input.red:checked+.mdl-switch__label+.mdl-switch__trackContainer>.mdl-switch__track{background:rgba(204,51,51,.5)}.mdl-switch__input[disabled]+.mdl-switch__label+.mdl-switch__trackContainer>.mdl-switch__track{background:rgba(0,0,0,.12);cursor:auto}.mdl-switch__thumb{background:#999;position:absolute;left:0;top:-.25em;height:1.44em;width:1.44em;-webkit-border-radius:50%;border-radius:50%;cursor:pointer;-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);-webkit-transition-duration:.28s;-o-transition-duration:.28s;transition-duration:.28s;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);-o-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-transition-property:left;-o-transition-property:left;transition-property:left;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.mdl-switch__input:checked+.mdl-switch__label+.mdl-switch__trackContainer>.mdl-switch__thumb{background:#52b54b;left:1.466em;-webkit-box-shadow:0 3px 4px 0 rgba(0,0,0,.14),0 3px 3px -2px rgba(0,0,0,.2),0 1px 8px 0 rgba(0,0,0,.12);box-shadow:0 3px 4px 0 rgba(0,0,0,.14),0 3px 3px -2px rgba(0,0,0,.2),0 1px 8px 0 rgba(0,0,0,.12)}.mdl-switch__input.red:checked+.mdl-switch__label+.mdl-switch__trackContainer>.mdl-switch__thumb{background:#c33;-webkit-box-shadow:0 3px 4px 0 rgba(0,0,0,.14),0 3px 3px -2px rgba(0,0,0,.2),0 1px 8px 0 rgba(0,0,0,.12);box-shadow:0 3px 4px 0 rgba(0,0,0,.14),0 3px 3px -2px rgba(0,0,0,.2),0 1px 8px 0 rgba(0,0,0,.12)}.mdl-switch__input[disabled]+.mdl-switch__label+.mdl-switch__trackContainer>.mdl-switch__thumb{background:#bdbdbd;cursor:auto}.mdl-switch__focus-helper{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;width:.6em;height:.6em;-webkit-border-radius:50%;border-radius:50%;background-color:transparent}.mdl-switch__input:focus+.mdl-switch__label+.mdl-switch__trackContainer .mdl-switch__focus-helper{-webkit-box-shadow:0 0 0 20px rgba(255,255,255,.26);box-shadow:0 0 0 20px rgba(255,255,255,.26);background-color:rgba(255,255,255,.26)}.mdl-switch__input:checked:focus+.mdl-switch__label+.mdl-switch__trackContainer .mdl-switch__focus-helper{-webkit-box-shadow:0 0 0 20px rgba(82,181,75,.26);box-shadow:0 0 0 20px rgba(82,181,75,.26);background-color:rgba(82,181,75,.26)}.mdl-switch__input.red:checked:focus+.mdl-switch__label+.mdl-switch__trackContainer .mdl-switch__focus-helper{-webkit-box-shadow:0 0 0 20px rgba(204,51,51,.26);box-shadow:0 0 0 20px rgba(204,51,51,.26);background-color:rgba(204,51,51,.26)}.mdl-switch__label{cursor:pointer;margin:0 0 0 .7em;display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.mdl-switch__input[disabled] .mdl-switch__label{color:#bdbdbd;cursor:auto}
|
|
@ -1,50 +1 @@
|
|||
define(['css!./emby-toggle', 'registerElement'], function () {
|
||||
'use strict';
|
||||
|
||||
var EmbyTogglePrototype = Object.create(HTMLInputElement.prototype);
|
||||
|
||||
function onKeyDown(e) {
|
||||
|
||||
// Don't submit form on enter
|
||||
if (e.keyCode === 13) {
|
||||
e.preventDefault();
|
||||
|
||||
this.checked = !this.checked;
|
||||
|
||||
this.dispatchEvent(new CustomEvent('change', {
|
||||
bubbles: true
|
||||
}));
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
EmbyTogglePrototype.attachedCallback = function () {
|
||||
|
||||
if (this.getAttribute('data-embytoggle') === 'true') {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setAttribute('data-embytoggle', 'true');
|
||||
|
||||
this.classList.add('mdl-switch__input');
|
||||
|
||||
var labelElement = this.parentNode;
|
||||
labelElement.classList.add('mdl-switch');
|
||||
labelElement.classList.add('mdl-js-switch');
|
||||
|
||||
var labelTextElement = labelElement.querySelector('span');
|
||||
|
||||
labelElement.insertAdjacentHTML('beforeend', '<div class="mdl-switch__trackContainer"><div class="mdl-switch__track"></div><div class="mdl-switch__thumb"><span class="mdl-switch__focus-helper"></span></div></div>');
|
||||
|
||||
labelTextElement.classList.add('toggleButtonLabel');
|
||||
labelTextElement.classList.add('mdl-switch__label');
|
||||
|
||||
this.addEventListener('keydown', onKeyDown);
|
||||
};
|
||||
|
||||
document.registerElement('emby-toggle', {
|
||||
prototype: EmbyTogglePrototype,
|
||||
extends: 'input'
|
||||
});
|
||||
});
|
||||
define(["css!./emby-toggle","registerElement"],function(){"use strict";function onKeyDown(e){if(13===e.keyCode)return e.preventDefault(),this.checked=!this.checked,this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),!1}var EmbyTogglePrototype=Object.create(HTMLInputElement.prototype);EmbyTogglePrototype.attachedCallback=function(){if("true"!==this.getAttribute("data-embytoggle")){this.setAttribute("data-embytoggle","true"),this.classList.add("mdl-switch__input");var labelElement=this.parentNode;labelElement.classList.add("mdl-switch"),labelElement.classList.add("mdl-js-switch");var labelTextElement=labelElement.querySelector("span");labelElement.insertAdjacentHTML("beforeend",'<div class="mdl-switch__trackContainer"><div class="mdl-switch__track"></div><div class="mdl-switch__thumb"><span class="mdl-switch__focus-helper"></span></div></div>'),labelTextElement.classList.add("toggleButtonLabel"),labelTextElement.classList.add("mdl-switch__label"),this.addEventListener("keydown",onKeyDown)}},document.registerElement("emby-toggle",{prototype:EmbyTogglePrototype,extends:"input"})});
|
|
@ -1,132 +1 @@
|
|||
define([], function () {
|
||||
'use strict';
|
||||
|
||||
function getFetchPromise(request) {
|
||||
|
||||
var headers = request.headers || {};
|
||||
|
||||
if (request.dataType === 'json') {
|
||||
headers.accept = 'application/json';
|
||||
}
|
||||
|
||||
var fetchRequest = {
|
||||
headers: headers,
|
||||
method: request.type,
|
||||
credentials: 'same-origin'
|
||||
};
|
||||
|
||||
var contentType = request.contentType;
|
||||
|
||||
if (request.data) {
|
||||
|
||||
if (typeof request.data === 'string') {
|
||||
fetchRequest.body = request.data;
|
||||
} else {
|
||||
fetchRequest.body = paramsToString(request.data);
|
||||
|
||||
contentType = contentType || 'application/x-www-form-urlencoded; charset=UTF-8';
|
||||
}
|
||||
}
|
||||
|
||||
if (contentType) {
|
||||
|
||||
headers['Content-Type'] = contentType;
|
||||
}
|
||||
|
||||
var url = request.url;
|
||||
|
||||
if (request.query) {
|
||||
var paramString = paramsToString(request.query);
|
||||
if (paramString) {
|
||||
url += '?' + paramString;
|
||||
}
|
||||
}
|
||||
|
||||
if (!request.timeout) {
|
||||
return fetch(url, fetchRequest);
|
||||
}
|
||||
|
||||
return fetchWithTimeout(url, fetchRequest, request.timeout);
|
||||
}
|
||||
|
||||
function fetchWithTimeout(url, options, timeoutMs) {
|
||||
|
||||
console.log('fetchWithTimeout: timeoutMs: ' + timeoutMs + ', url: ' + url);
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
var timeout = setTimeout(reject, timeoutMs);
|
||||
|
||||
options = options || {};
|
||||
options.credentials = 'same-origin';
|
||||
|
||||
fetch(url, options).then(function (response) {
|
||||
clearTimeout(timeout);
|
||||
|
||||
console.log('fetchWithTimeout: succeeded connecting to url: ' + url);
|
||||
|
||||
resolve(response);
|
||||
}, function (error) {
|
||||
|
||||
clearTimeout(timeout);
|
||||
|
||||
console.log('fetchWithTimeout: timed out connecting to url: ' + url);
|
||||
|
||||
reject();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function paramsToString(params) {
|
||||
|
||||
var values = [];
|
||||
|
||||
for (var key in params) {
|
||||
|
||||
var value = params[key];
|
||||
|
||||
if (value !== null && value !== undefined && value !== '') {
|
||||
values.push(encodeURIComponent(key) + "=" + encodeURIComponent(value));
|
||||
}
|
||||
}
|
||||
return values.join('&');
|
||||
}
|
||||
|
||||
function ajax(request) {
|
||||
|
||||
if (!request) {
|
||||
throw new Error("Request cannot be null");
|
||||
}
|
||||
|
||||
request.headers = request.headers || {};
|
||||
|
||||
console.log('requesting url: ' + request.url);
|
||||
|
||||
return getFetchPromise(request).then(function (response) {
|
||||
|
||||
console.log('response status: ' + response.status + ', url: ' + request.url);
|
||||
|
||||
if (response.status < 400) {
|
||||
|
||||
if (request.dataType === 'json' || request.headers.accept === 'application/json') {
|
||||
return response.json();
|
||||
} else if (request.dataType === 'text' || (response.headers.get('Content-Type') || '').toLowerCase().indexOf('text/') === 0) {
|
||||
return response.text();
|
||||
} else {
|
||||
return response;
|
||||
}
|
||||
} else {
|
||||
return Promise.reject(response);
|
||||
}
|
||||
|
||||
}, function (err) {
|
||||
|
||||
console.log('request failed to url: ' + request.url);
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
return {
|
||||
getFetchPromise: getFetchPromise,
|
||||
ajax: ajax
|
||||
};
|
||||
});
|
||||
define([],function(){"use strict";function getFetchPromise(request){var headers=request.headers||{};"json"===request.dataType&&(headers.accept="application/json");var fetchRequest={headers:headers,method:request.type,credentials:"same-origin"},contentType=request.contentType;request.data&&("string"==typeof request.data?fetchRequest.body=request.data:(fetchRequest.body=paramsToString(request.data),contentType=contentType||"application/x-www-form-urlencoded; charset=UTF-8")),contentType&&(headers["Content-Type"]=contentType);var url=request.url;if(request.query){var paramString=paramsToString(request.query);paramString&&(url+="?"+paramString)}return request.timeout?fetchWithTimeout(url,fetchRequest,request.timeout):fetch(url,fetchRequest)}function fetchWithTimeout(url,options,timeoutMs){return console.log("fetchWithTimeout: timeoutMs: "+timeoutMs+", url: "+url),new Promise(function(resolve,reject){var timeout=setTimeout(reject,timeoutMs);options=options||{},options.credentials="same-origin",fetch(url,options).then(function(response){clearTimeout(timeout),console.log("fetchWithTimeout: succeeded connecting to url: "+url),resolve(response)},function(error){clearTimeout(timeout),console.log("fetchWithTimeout: timed out connecting to url: "+url),reject()})})}function paramsToString(params){var values=[];for(var key in params){var value=params[key];null!==value&&void 0!==value&&""!==value&&values.push(encodeURIComponent(key)+"="+encodeURIComponent(value))}return values.join("&")}function ajax(request){if(!request)throw new Error("Request cannot be null");return request.headers=request.headers||{},console.log("requesting url: "+request.url),getFetchPromise(request).then(function(response){return console.log("response status: "+response.status+", url: "+request.url),response.status<400?"json"===request.dataType||"application/json"===request.headers.accept?response.json():"text"===request.dataType||0===(response.headers.get("Content-Type")||"").toLowerCase().indexOf("text/")?response.text():response:Promise.reject(response)},function(err){throw console.log("request failed to url: "+request.url),err})}return{getFetchPromise:getFetchPromise,ajax:ajax}});
|
|
@ -1,12 +1 @@
|
|||
define(['multi-download'], function (multiDownload) {
|
||||
'use strict';
|
||||
|
||||
return {
|
||||
download: function (items) {
|
||||
|
||||
multiDownload(items.map(function (item) {
|
||||
return item.url;
|
||||
}));
|
||||
}
|
||||
};
|
||||
});
|
||||
define(["multi-download"],function(multiDownload){"use strict";return{download:function(items){multiDownload(items.map(function(item){return item.url}))}}});
|
|
@ -1,12 +1 @@
|
|||
define([], function () {
|
||||
'use strict';
|
||||
|
||||
return {
|
||||
fileExists: function (path) {
|
||||
return Promise.reject();
|
||||
},
|
||||
directoryExists: function (path) {
|
||||
return Promise.reject();
|
||||
}
|
||||
};
|
||||
});
|
||||
define([],function(){"use strict";return{fileExists:function(path){return Promise.reject()},directoryExists:function(path){return Promise.reject()}}});
|
File diff suppressed because one or more lines are too long
|
@ -1,25 +1 @@
|
|||
@font-face {
|
||||
font-family: 'Material Icons';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Material Icons'), local('MaterialIcons-Regular'), url(2fcryfnatjcs6g4u3t-y5zjzjt5fdej140u2djyc3my.woff2) format('woff2'), url(2fcryfnatjcs6g4u3t-y5ewrjpiaoeww8aihgqwrjao.woff) format('woff');
|
||||
}
|
||||
|
||||
.md-icon {
|
||||
font-family: 'Material Icons';
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
letter-spacing: normal;
|
||||
text-transform: none;
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
word-wrap: normal;
|
||||
direction: ltr;
|
||||
-webkit-font-feature-settings: 'liga';
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-rendering: optimizeLegibility;
|
||||
font-feature-settings: "liga" 1;
|
||||
line-height: 1;
|
||||
overflow: hidden;
|
||||
vertical-align: middle;
|
||||
}
|
||||
@font-face{font-family:'Material Icons';font-style:normal;font-weight:400;src:local('Material Icons'),local('MaterialIcons-Regular'),url(2fcryfnatjcs6g4u3t-y5zjzjt5fdej140u2djyc3my.woff2) format('woff2'),url(2fcryfnatjcs6g4u3t-y5ewrjpiaoeww8aihgqwrjao.woff) format('woff')}.md-icon{font-family:'Material Icons';font-weight:400;font-style:normal;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-webkit-font-feature-settings:"liga" 1;-moz-font-feature-settings:"liga" 1;font-feature-settings:"liga" 1;line-height:1;overflow:hidden;vertical-align:middle}
|
File diff suppressed because one or more lines are too long
|
@ -1,106 +1 @@
|
|||
.formDialog {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.formDialogHeader {
|
||||
padding: 1em .5em;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.formDialogHeader, .formDialogFooter {
|
||||
background-color: #222326;
|
||||
}
|
||||
|
||||
.formDialogHeader-clear, .formDialogFooter-clear {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.formDialogHeaderTitle {
|
||||
margin-left: .25em;
|
||||
/* In case of h1, h2, h3 */
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.formDialogContent {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.dialogContentInner {
|
||||
padding: .5em 1em 20em 1em;
|
||||
}
|
||||
|
||||
.dialogContentInner-mini {
|
||||
padding-bottom: 10em;
|
||||
}
|
||||
|
||||
.dialog-content-centered {
|
||||
margin: 0 auto;
|
||||
max-width: 53em;
|
||||
}
|
||||
|
||||
.dialogContentTitle {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.formDialogFooter {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
padding: 1.25em 1em;
|
||||
/* Without this emby-checkbox is able to appear on top */
|
||||
z-index: 1;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.formDialogFooter-flex {
|
||||
position: static;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.formDialogFooterItem {
|
||||
margin-left: .5em !important;
|
||||
margin-right: .5em !important;
|
||||
flex-grow: 1;
|
||||
text-align: center;
|
||||
flex-basis: 0;
|
||||
}
|
||||
|
||||
.formDialogFooterItem-autosize {
|
||||
flex-basis: initial;
|
||||
flex-grow: initial;
|
||||
padding-left: 2em;
|
||||
padding-right: 2em;
|
||||
}
|
||||
|
||||
@media all and (min-width: 800px) {
|
||||
|
||||
.formDialogFooterItem {
|
||||
max-width: 80%;
|
||||
}
|
||||
|
||||
.dialogContentInner {
|
||||
padding-left: 1.5em;
|
||||
padding-right: 1.5em;
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (min-width: 1280px) {
|
||||
|
||||
.formDialogFooterItem {
|
||||
max-width: 70%;
|
||||
}
|
||||
|
||||
.dialogContentInner {
|
||||
padding-left: 2em;
|
||||
padding-right: 2em;
|
||||
}
|
||||
}
|
||||
.formDialog,.formDialogHeader{display:-webkit-box;display:-webkit-flex}.formDialog{display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;position:relative}.formDialogHeader{padding:1em .5em;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-flex-shrink:0;flex-shrink:0}.formDialogFooter,.formDialogHeader{background-color:#222326}.formDialogFooter-clear,.formDialogHeader-clear{background-color:transparent}.formDialogHeaderTitle{margin-left:.25em;margin-top:0;margin-bottom:0}.formDialogContent{-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1}.dialogContentInner{padding:.5em 1em 20em}.dialogContentInner-mini{padding-bottom:10em}.dialog-content-centered{margin:0 auto;max-width:53em}.dialogContentTitle{margin-top:1em}.formDialogFooter{bottom:0;left:0;right:0;display:-webkit-box;display:-webkit-flex;display:flex;position:absolute;padding:1.25em 1em;z-index:1;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-flex-wrap:wrap;flex-wrap:wrap}.formDialogFooter-flex{position:static;width:100%}.formDialogFooterItem{margin-left:.5em!important;margin-right:.5em!important;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;text-align:center;-webkit-flex-basis:0;flex-basis:0}.formDialogFooterItem-autosize{-webkit-flex-basis:initial;flex-basis:initial;-webkit-box-flex:initial;-webkit-flex-grow:initial;flex-grow:initial;padding-left:2em;padding-right:2em}@media all and (min-width:800px){.formDialogFooterItem{max-width:80%}.dialogContentInner{padding-left:1.5em;padding-right:1.5em}}@media all and (min-width:1280px){.formDialogFooterItem{max-width:70%}.dialogContentInner{padding-left:2em;padding-right:2em}}
|
|
@ -1,26 +1 @@
|
|||
define(['dom', 'fullscreenManager'], function (dom, fullscreenManager) {
|
||||
'use strict';
|
||||
|
||||
function isTargetValid(target) {
|
||||
|
||||
if (dom.parentWithTag(target, ['BUTTON', 'INPUT', 'TEXTAREA'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
dom.addEventListener(window, 'dblclick', function (e) {
|
||||
|
||||
if (isTargetValid(e.target)) {
|
||||
if (fullscreenManager.isFullScreen()) {
|
||||
fullscreenManager.exitFullscreen();
|
||||
} else {
|
||||
fullscreenManager.requestFullscreen();
|
||||
}
|
||||
}
|
||||
|
||||
}, {
|
||||
passive: true
|
||||
});
|
||||
});
|
||||
define(["dom","fullscreenManager"],function(dom,fullscreenManager){"use strict";function isTargetValid(target){return!dom.parentWithTag(target,["BUTTON","INPUT","TEXTAREA"])}dom.addEventListener(window,"dblclick",function(e){isTargetValid(e.target)&&(fullscreenManager.isFullScreen()?fullscreenManager.exitFullscreen():fullscreenManager.requestFullscreen())},{passive:!0})});
|
|
@ -1,60 +1 @@
|
|||
define(['events', 'dom'], function (events, dom) {
|
||||
'use strict';
|
||||
|
||||
function fullscreenManager() {
|
||||
|
||||
}
|
||||
|
||||
fullscreenManager.prototype.requestFullscreen = function (element) {
|
||||
|
||||
element = element || document.documentElement;
|
||||
|
||||
if (element.requestFullscreen) {
|
||||
element.requestFullscreen();
|
||||
} else if (element.mozRequestFullScreen) {
|
||||
element.mozRequestFullScreen();
|
||||
} else if (element.webkitRequestFullscreen) {
|
||||
element.webkitRequestFullscreen();
|
||||
} else if (element.msRequestFullscreen) {
|
||||
element.msRequestFullscreen();
|
||||
}
|
||||
};
|
||||
|
||||
fullscreenManager.prototype.exitFullscreen = function () {
|
||||
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
} else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen();
|
||||
} else if (document.webkitExitFullscreen) {
|
||||
document.webkitExitFullscreen();
|
||||
} else if (document.webkitCancelFullscreen) {
|
||||
document.webkitCancelFullscreen();
|
||||
}
|
||||
};
|
||||
|
||||
fullscreenManager.prototype.isFullScreen = function () {
|
||||
|
||||
return document.fullscreen || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement ? true : false;
|
||||
};
|
||||
|
||||
var manager = new fullscreenManager();
|
||||
|
||||
function onFullScreenChange() {
|
||||
events.trigger(manager, 'fullscreenchange');
|
||||
}
|
||||
|
||||
dom.addEventListener(document, 'fullscreenchange', onFullScreenChange, {
|
||||
passive: true
|
||||
});
|
||||
|
||||
dom.addEventListener(document, 'webkitfullscreenchange', onFullScreenChange, {
|
||||
passive: true
|
||||
});
|
||||
|
||||
dom.addEventListener(document, 'mozfullscreenchange', onFullScreenChange, {
|
||||
passive: true
|
||||
});
|
||||
|
||||
return manager;
|
||||
});
|
||||
define(["events","dom"],function(events,dom){"use strict";function fullscreenManager(){}function onFullScreenChange(){events.trigger(manager,"fullscreenchange")}fullscreenManager.prototype.requestFullscreen=function(element){element=element||document.documentElement,element.requestFullscreen?element.requestFullscreen():element.mozRequestFullScreen?element.mozRequestFullScreen():element.webkitRequestFullscreen?element.webkitRequestFullscreen():element.msRequestFullscreen&&element.msRequestFullscreen()},fullscreenManager.prototype.exitFullscreen=function(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.webkitCancelFullscreen&&document.webkitCancelFullscreen()},fullscreenManager.prototype.isFullScreen=function(){return!!(document.fullscreen||document.mozFullScreen||document.webkitIsFullScreen||document.msFullscreenElement)};var manager=new fullscreenManager;return dom.addEventListener(document,"fullscreenchange",onFullScreenChange,{passive:!0}),dom.addEventListener(document,"webkitfullscreenchange",onFullScreenChange,{passive:!0}),dom.addEventListener(document,"mozfullscreenchange",onFullScreenChange,{passive:!0}),manager});
|
|
@ -1,275 +1 @@
|
|||
define(['connectionManager', 'userSettings', 'events'], function (connectionManager, userSettings, events) {
|
||||
'use strict';
|
||||
|
||||
var allTranslations = {};
|
||||
var currentCulture;
|
||||
|
||||
function getCurrentLocale() {
|
||||
|
||||
return currentCulture;
|
||||
}
|
||||
|
||||
function getDefaultLanguage() {
|
||||
|
||||
var culture = document.documentElement.getAttribute('data-culture');
|
||||
|
||||
if (culture) {
|
||||
return culture;
|
||||
}
|
||||
|
||||
if (navigator.language) {
|
||||
return navigator.language;
|
||||
}
|
||||
if (navigator.userLanguage) {
|
||||
return navigator.userLanguage;
|
||||
}
|
||||
if (navigator.languages && navigator.languages.length) {
|
||||
return navigator.languages[0];
|
||||
}
|
||||
|
||||
return 'en-us';
|
||||
}
|
||||
|
||||
function updateCurrentCulture() {
|
||||
|
||||
var culture;
|
||||
try {
|
||||
culture = userSettings.get('language');
|
||||
} catch (err) {
|
||||
|
||||
}
|
||||
culture = culture || getDefaultLanguage();
|
||||
|
||||
currentCulture = normalizeLocaleName(culture);
|
||||
|
||||
ensureTranslations(currentCulture);
|
||||
}
|
||||
|
||||
function ensureTranslations(culture) {
|
||||
|
||||
for (var i in allTranslations) {
|
||||
ensureTranslation(allTranslations[i], culture);
|
||||
}
|
||||
}
|
||||
|
||||
function ensureTranslation(translationInfo, culture) {
|
||||
|
||||
if (translationInfo.dictionaries[culture]) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
return loadTranslation(translationInfo.translations, culture).then(function (dictionary) {
|
||||
|
||||
translationInfo.dictionaries[culture] = dictionary;
|
||||
});
|
||||
}
|
||||
|
||||
function normalizeLocaleName(culture) {
|
||||
|
||||
culture = culture.replace('_', '-');
|
||||
|
||||
// If it's de-DE, convert to just de
|
||||
var parts = culture.split('-');
|
||||
if (parts.length === 2) {
|
||||
if (parts[0].toLowerCase() === parts[1].toLowerCase()) {
|
||||
culture = parts[0].toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
var lower = culture.toLowerCase();
|
||||
|
||||
if (lower === 'ca-es') {
|
||||
return 'ca';
|
||||
}
|
||||
|
||||
// normalize Swedish
|
||||
if (lower === 'sv-se') {
|
||||
return 'sv';
|
||||
}
|
||||
|
||||
return lower;
|
||||
}
|
||||
|
||||
function getDictionary(module) {
|
||||
|
||||
if (!module) {
|
||||
module = defaultModule();
|
||||
}
|
||||
|
||||
var translations = allTranslations[module];
|
||||
|
||||
if (!translations) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return translations.dictionaries[getCurrentLocale()];
|
||||
}
|
||||
|
||||
function register(options) {
|
||||
|
||||
allTranslations[options.name] = {
|
||||
translations: options.strings || options.translations,
|
||||
dictionaries: {}
|
||||
};
|
||||
}
|
||||
|
||||
function loadStrings(options) {
|
||||
|
||||
var locale = getCurrentLocale();
|
||||
|
||||
if (typeof options === 'string') {
|
||||
return ensureTranslation(allTranslations[options], locale);
|
||||
} else {
|
||||
register(options);
|
||||
return ensureTranslation(allTranslations[options.name], locale);
|
||||
}
|
||||
}
|
||||
|
||||
var cacheParam = new Date().getTime();
|
||||
function loadTranslation(translations, lang) {
|
||||
|
||||
lang = normalizeLocaleName(lang);
|
||||
|
||||
var filtered = translations.filter(function (t) {
|
||||
return normalizeLocaleName(t.lang) === lang;
|
||||
});
|
||||
|
||||
if (!filtered.length) {
|
||||
filtered = translations.filter(function (t) {
|
||||
return normalizeLocaleName(t.lang) === 'en-us';
|
||||
});
|
||||
}
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
if (!filtered.length) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
var url = filtered[0].path;
|
||||
|
||||
url += url.indexOf('?') === -1 ? '?' : '&';
|
||||
url += 'v=' + cacheParam;
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', url, true);
|
||||
|
||||
xhr.onload = function (e) {
|
||||
if (this.status < 400) {
|
||||
resolve(JSON.parse(this.response));
|
||||
} else {
|
||||
resolve({});
|
||||
}
|
||||
};
|
||||
|
||||
xhr.onerror = function () {
|
||||
resolve({});
|
||||
};
|
||||
xhr.send();
|
||||
});
|
||||
}
|
||||
|
||||
function translateKey(key) {
|
||||
|
||||
var parts = key.split('#');
|
||||
var module;
|
||||
|
||||
if (parts.length > 1) {
|
||||
module = parts[0];
|
||||
key = parts[1];
|
||||
}
|
||||
|
||||
return translateKeyFromModule(key, module);
|
||||
}
|
||||
|
||||
function translateKeyFromModule(key, module) {
|
||||
|
||||
var dictionary = getDictionary(module);
|
||||
|
||||
if (!dictionary) {
|
||||
return key;
|
||||
}
|
||||
|
||||
return dictionary[key] || key;
|
||||
}
|
||||
|
||||
function replaceAll(str, find, replace) {
|
||||
|
||||
return str.split(find).join(replace);
|
||||
}
|
||||
|
||||
function translate(key) {
|
||||
|
||||
var val = translateKey(key);
|
||||
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
|
||||
val = replaceAll(val, '{' + (i - 1) + '}', arguments[i]);
|
||||
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
function translateHtml(html, module) {
|
||||
|
||||
if (!module) {
|
||||
module = defaultModule();
|
||||
}
|
||||
|
||||
if (!module) {
|
||||
throw new Error('module cannot be null or empty');
|
||||
}
|
||||
|
||||
var startIndex = html.indexOf('${');
|
||||
|
||||
if (startIndex === -1) {
|
||||
return html;
|
||||
}
|
||||
|
||||
startIndex += 2;
|
||||
var endIndex = html.indexOf('}', startIndex);
|
||||
|
||||
if (endIndex === -1) {
|
||||
return html;
|
||||
}
|
||||
|
||||
var key = html.substring(startIndex, endIndex);
|
||||
var val = translateKeyFromModule(key, module);
|
||||
|
||||
html = html.replace('${' + key + '}', val);
|
||||
return translateHtml(html, module);
|
||||
}
|
||||
|
||||
var _defaultModule;
|
||||
function defaultModule(val) {
|
||||
|
||||
if (val) {
|
||||
|
||||
_defaultModule = val;
|
||||
}
|
||||
|
||||
return _defaultModule;
|
||||
}
|
||||
|
||||
updateCurrentCulture();
|
||||
|
||||
events.on(connectionManager, 'localusersignedin', updateCurrentCulture);
|
||||
events.on(userSettings, 'change', function (e, name) {
|
||||
if (name === 'language') {
|
||||
updateCurrentCulture();
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
getString: translate,
|
||||
translate: translate,
|
||||
translateDocument: translateHtml,
|
||||
translateHtml: translateHtml,
|
||||
loadStrings: loadStrings,
|
||||
defaultModule: defaultModule,
|
||||
getCurrentLocale: getCurrentLocale,
|
||||
register: register
|
||||
};
|
||||
});
|
||||
define(["connectionManager","userSettings","events"],function(connectionManager,userSettings,events){"use strict";function getCurrentLocale(){return currentCulture}function getDefaultLanguage(){var culture=document.documentElement.getAttribute("data-culture");return culture?culture:navigator.language?navigator.language:navigator.userLanguage?navigator.userLanguage:navigator.languages&&navigator.languages.length?navigator.languages[0]:"en-us"}function updateCurrentCulture(){var culture;try{culture=userSettings.get("language")}catch(err){}culture=culture||getDefaultLanguage(),currentCulture=normalizeLocaleName(culture),ensureTranslations(currentCulture)}function ensureTranslations(culture){for(var i in allTranslations)ensureTranslation(allTranslations[i],culture)}function ensureTranslation(translationInfo,culture){return translationInfo.dictionaries[culture]?Promise.resolve():loadTranslation(translationInfo.translations,culture).then(function(dictionary){translationInfo.dictionaries[culture]=dictionary})}function normalizeLocaleName(culture){culture=culture.replace("_","-");var parts=culture.split("-");2===parts.length&&parts[0].toLowerCase()===parts[1].toLowerCase()&&(culture=parts[0].toLowerCase());var lower=culture.toLowerCase();return"ca-es"===lower?"ca":"sv-se"===lower?"sv":lower}function getDictionary(module){module||(module=defaultModule());var translations=allTranslations[module];return translations?translations.dictionaries[getCurrentLocale()]:{}}function register(options){allTranslations[options.name]={translations:options.strings||options.translations,dictionaries:{}}}function loadStrings(options){var locale=getCurrentLocale();return"string"==typeof options?ensureTranslation(allTranslations[options],locale):(register(options),ensureTranslation(allTranslations[options.name],locale))}function loadTranslation(translations,lang){lang=normalizeLocaleName(lang);var filtered=translations.filter(function(t){return normalizeLocaleName(t.lang)===lang});return filtered.length||(filtered=translations.filter(function(t){return"en-us"===normalizeLocaleName(t.lang)})),new Promise(function(resolve,reject){if(!filtered.length)return void resolve();var url=filtered[0].path;url+=url.indexOf("?")===-1?"?":"&",url+="v="+cacheParam;var xhr=new XMLHttpRequest;xhr.open("GET",url,!0),xhr.onload=function(e){resolve(this.status<400?JSON.parse(this.response):{})},xhr.onerror=function(){resolve({})},xhr.send()})}function translateKey(key){var module,parts=key.split("#");return parts.length>1&&(module=parts[0],key=parts[1]),translateKeyFromModule(key,module)}function translateKeyFromModule(key,module){var dictionary=getDictionary(module);return dictionary?dictionary[key]||key:key}function replaceAll(str,find,replace){return str.split(find).join(replace)}function translate(key){for(var val=translateKey(key),i=1;i<arguments.length;i++)val=replaceAll(val,"{"+(i-1)+"}",arguments[i]);return val}function translateHtml(html,module){if(module||(module=defaultModule()),!module)throw new Error("module cannot be null or empty");var startIndex=html.indexOf("${");if(startIndex===-1)return html;startIndex+=2;var endIndex=html.indexOf("}",startIndex);if(endIndex===-1)return html;var key=html.substring(startIndex,endIndex),val=translateKeyFromModule(key,module);return html=html.replace("${"+key+"}",val),translateHtml(html,module)}function defaultModule(val){return val&&(_defaultModule=val),_defaultModule}var currentCulture,_defaultModule,allTranslations={},cacheParam=(new Date).getTime();return updateCurrentCulture(),events.on(connectionManager,"localusersignedin",updateCurrentCulture),events.on(userSettings,"change",function(e,name){"language"===name&&updateCurrentCulture()}),{getString:translate,translate:translate,translateDocument:translateHtml,translateHtml:translateHtml,loadStrings:loadStrings,defaultModule:defaultModule,getCurrentLocale:getCurrentLocale,register:register}});
|
|
@ -1,172 +1 @@
|
|||
define(['dialogHelper', 'globalize', 'userSettings', 'layoutManager', 'connectionManager', 'require', 'loading', 'scrollHelper', 'emby-checkbox', 'emby-radio', 'css!./../formdialog', 'material-icons'], function (dialogHelper, globalize, userSettings, layoutManager, connectionManager, require, loading, scrollHelper) {
|
||||
'use strict';
|
||||
|
||||
function saveCategories(context, options) {
|
||||
|
||||
var categories = [];
|
||||
|
||||
var chkCategorys = context.querySelectorAll('.chkCategory');
|
||||
for (var i = 0, length = chkCategorys.length; i < length; i++) {
|
||||
|
||||
var type = chkCategorys[i].getAttribute('data-type');
|
||||
|
||||
if (chkCategorys[i].checked) {
|
||||
categories.push(type);
|
||||
}
|
||||
}
|
||||
|
||||
if (categories.length >= 4) {
|
||||
categories.push('series');
|
||||
}
|
||||
|
||||
// differentiate between none and all
|
||||
categories.push('all');
|
||||
options.categories = categories;
|
||||
}
|
||||
|
||||
function loadCategories(context, options) {
|
||||
|
||||
var selectedCategories = options.categories || [];
|
||||
|
||||
var chkCategorys = context.querySelectorAll('.chkCategory');
|
||||
for (var i = 0, length = chkCategorys.length; i < length; i++) {
|
||||
|
||||
var type = chkCategorys[i].getAttribute('data-type');
|
||||
|
||||
chkCategorys[i].checked = !selectedCategories.length || selectedCategories.indexOf(type) !== -1;
|
||||
}
|
||||
}
|
||||
|
||||
function save(context) {
|
||||
|
||||
var i, length;
|
||||
|
||||
var chkIndicators = context.querySelectorAll('.chkIndicator');
|
||||
for (i = 0, length = chkIndicators.length; i < length; i++) {
|
||||
|
||||
var type = chkIndicators[i].getAttribute('data-type');
|
||||
userSettings.set('guide-indicator-' + type, chkIndicators[i].checked);
|
||||
}
|
||||
|
||||
userSettings.set('guide-colorcodedbackgrounds', context.querySelector('.chkColorCodedBackgrounds').checked);
|
||||
userSettings.set('livetv-favoritechannelsattop', context.querySelector('.chkFavoriteChannelsAtTop').checked);
|
||||
|
||||
var sortBys = context.querySelectorAll('.chkSortOrder');
|
||||
for (i = 0, length = sortBys.length; i < length; i++) {
|
||||
if (sortBys[i].checked) {
|
||||
userSettings.set('livetv-channelorder', sortBys[i].value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function load(context) {
|
||||
|
||||
var i, length;
|
||||
|
||||
var chkIndicators = context.querySelectorAll('.chkIndicator');
|
||||
for (i = 0, length = chkIndicators.length; i < length; i++) {
|
||||
|
||||
var type = chkIndicators[i].getAttribute('data-type');
|
||||
|
||||
if (chkIndicators[i].getAttribute('data-default') === 'true') {
|
||||
chkIndicators[i].checked = userSettings.get('guide-indicator-' + type) !== 'false';
|
||||
} else {
|
||||
chkIndicators[i].checked = userSettings.get('guide-indicator-' + type) === 'true';
|
||||
}
|
||||
}
|
||||
|
||||
context.querySelector('.chkColorCodedBackgrounds').checked = userSettings.get('guide-colorcodedbackgrounds') === 'true';
|
||||
context.querySelector('.chkFavoriteChannelsAtTop').checked = userSettings.get('livetv-favoritechannelsattop') !== 'false';
|
||||
|
||||
var sortByValue = userSettings.get('livetv-channelorder') || 'Number';
|
||||
|
||||
var sortBys = context.querySelectorAll('.chkSortOrder');
|
||||
for (i = 0, length = sortBys.length; i < length; i++) {
|
||||
sortBys[i].checked = sortBys[i].value === sortByValue;
|
||||
}
|
||||
}
|
||||
|
||||
function onSortByChange() {
|
||||
var newValue = this.value;
|
||||
if (this.checked) {
|
||||
var changed = options.query.SortBy !== newValue;
|
||||
|
||||
options.query.SortBy = newValue.replace('_', ',');
|
||||
options.query.StartIndex = 0;
|
||||
|
||||
if (options.callback && changed) {
|
||||
options.callback();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function showEditor(options) {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
var settingsChanged = false;
|
||||
|
||||
require(['text!./guide-settings.template.html'], function (template) {
|
||||
|
||||
var dialogOptions = {
|
||||
removeOnClose: true,
|
||||
scrollY: false
|
||||
};
|
||||
|
||||
if (layoutManager.tv) {
|
||||
dialogOptions.size = 'fullscreen';
|
||||
} else {
|
||||
dialogOptions.size = 'small';
|
||||
}
|
||||
|
||||
var dlg = dialogHelper.createDialog(dialogOptions);
|
||||
|
||||
dlg.classList.add('formDialog');
|
||||
|
||||
var html = '';
|
||||
|
||||
html += globalize.translateDocument(template, 'sharedcomponents');
|
||||
|
||||
dlg.innerHTML = html;
|
||||
|
||||
dlg.addEventListener('change', function () {
|
||||
|
||||
settingsChanged = true;
|
||||
});
|
||||
|
||||
dlg.addEventListener('close', function () {
|
||||
|
||||
if (layoutManager.tv) {
|
||||
scrollHelper.centerFocus.off(dlg.querySelector('.formDialogContent'), false);
|
||||
}
|
||||
|
||||
save(dlg);
|
||||
saveCategories(dlg, options);
|
||||
|
||||
if (settingsChanged) {
|
||||
resolve();
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
});
|
||||
|
||||
dlg.querySelector('.btnCancel').addEventListener('click', function () {
|
||||
dialogHelper.close(dlg);
|
||||
});
|
||||
|
||||
if (layoutManager.tv) {
|
||||
scrollHelper.centerFocus.on(dlg.querySelector('.formDialogContent'), false);
|
||||
}
|
||||
|
||||
load(dlg);
|
||||
loadCategories(dlg, options);
|
||||
dialogHelper.open(dlg);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
show: showEditor
|
||||
};
|
||||
});
|
||||
define(["dialogHelper","globalize","userSettings","layoutManager","connectionManager","require","loading","scrollHelper","emby-checkbox","emby-radio","css!./../formdialog","material-icons"],function(dialogHelper,globalize,userSettings,layoutManager,connectionManager,require,loading,scrollHelper){"use strict";function saveCategories(context,options){for(var categories=[],chkCategorys=context.querySelectorAll(".chkCategory"),i=0,length=chkCategorys.length;i<length;i++){var type=chkCategorys[i].getAttribute("data-type");chkCategorys[i].checked&&categories.push(type)}categories.length>=4&&categories.push("series"),categories.push("all"),options.categories=categories}function loadCategories(context,options){for(var selectedCategories=options.categories||[],chkCategorys=context.querySelectorAll(".chkCategory"),i=0,length=chkCategorys.length;i<length;i++){var type=chkCategorys[i].getAttribute("data-type");chkCategorys[i].checked=!selectedCategories.length||selectedCategories.indexOf(type)!==-1}}function save(context){var i,length,chkIndicators=context.querySelectorAll(".chkIndicator");for(i=0,length=chkIndicators.length;i<length;i++){var type=chkIndicators[i].getAttribute("data-type");userSettings.set("guide-indicator-"+type,chkIndicators[i].checked)}userSettings.set("guide-colorcodedbackgrounds",context.querySelector(".chkColorCodedBackgrounds").checked),userSettings.set("livetv-favoritechannelsattop",context.querySelector(".chkFavoriteChannelsAtTop").checked);var sortBys=context.querySelectorAll(".chkSortOrder");for(i=0,length=sortBys.length;i<length;i++)if(sortBys[i].checked){userSettings.set("livetv-channelorder",sortBys[i].value);break}}function load(context){var i,length,chkIndicators=context.querySelectorAll(".chkIndicator");for(i=0,length=chkIndicators.length;i<length;i++){var type=chkIndicators[i].getAttribute("data-type");"true"===chkIndicators[i].getAttribute("data-default")?chkIndicators[i].checked="false"!==userSettings.get("guide-indicator-"+type):chkIndicators[i].checked="true"===userSettings.get("guide-indicator-"+type)}context.querySelector(".chkColorCodedBackgrounds").checked="true"===userSettings.get("guide-colorcodedbackgrounds"),context.querySelector(".chkFavoriteChannelsAtTop").checked="false"!==userSettings.get("livetv-favoritechannelsattop");var sortByValue=userSettings.get("livetv-channelorder")||"Number",sortBys=context.querySelectorAll(".chkSortOrder");for(i=0,length=sortBys.length;i<length;i++)sortBys[i].checked=sortBys[i].value===sortByValue}function showEditor(options){return new Promise(function(resolve,reject){var settingsChanged=!1;require(["text!./guide-settings.template.html"],function(template){var dialogOptions={removeOnClose:!0,scrollY:!1};layoutManager.tv?dialogOptions.size="fullscreen":dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog");var html="";html+=globalize.translateDocument(template,"sharedcomponents"),dlg.innerHTML=html,dlg.addEventListener("change",function(){settingsChanged=!0}),dlg.addEventListener("close",function(){layoutManager.tv&&scrollHelper.centerFocus.off(dlg.querySelector(".formDialogContent"),!1),save(dlg),saveCategories(dlg,options),settingsChanged?resolve():reject()}),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),layoutManager.tv&&scrollHelper.centerFocus.on(dlg.querySelector(".formDialogContent"),!1),load(dlg),loadCategories(dlg,options),dialogHelper.open(dlg)})})}return{show:showEditor}});
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,15 +1 @@
|
|||
.newTvProgram {
|
||||
background: #64A239;
|
||||
}
|
||||
|
||||
.liveTvProgram {
|
||||
background: #EC407A;
|
||||
}
|
||||
|
||||
.premiereTvProgram {
|
||||
background: #EF6C00;
|
||||
}
|
||||
|
||||
.repeatTvProgram {
|
||||
background: #009688;
|
||||
}
|
||||
.newTvProgram{background:#64A239}.liveTvProgram{background:#EC407A}.premiereTvProgram{background:#EF6C00}.repeatTvProgram{background:#009688}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,44 +1 @@
|
|||
.videoPlayerContainer {
|
||||
position: fixed !important;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.videoPlayerContainer:not(.videoPlayerContainer-withBackdrop) {
|
||||
background: #000 !important;
|
||||
}
|
||||
|
||||
.videoPlayerContainer-withBackdrop {
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: cover;
|
||||
background-attachment: fixed;
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
.videoPlayerContainer-onTop {
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.htmlvideoplayer {
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.htmlvideoplayer::-webkit-media-text-track-display {
|
||||
/*Style the text itself*/
|
||||
margin-top: -2.5em;
|
||||
}
|
||||
|
||||
.htmlvideoplayer::cue {
|
||||
background-color: transparent;
|
||||
text-shadow: 2px 2px 2px rgba(0, 0, 0, 1);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font-family: inherit;
|
||||
}
|
||||
.videoPlayerContainer{position:fixed!important;top:0;bottom:0;left:0;right:0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.videoPlayerContainer:not(.videoPlayerContainer-withBackdrop){background:#000!important}.videoPlayerContainer-withBackdrop{background-repeat:no-repeat;background-position:center center;-webkit-background-size:cover;background-size:cover;background-attachment:fixed;background-color:#000}.videoPlayerContainer-onTop{z-index:1000}.htmlvideoplayer{margin:0!important;padding:0!important;width:100%;height:100%}.htmlvideoplayer::-webkit-media-text-track-display{margin-top:-2.5em}.htmlvideoplayer::cue{background-color:transparent;text-shadow:2px 2px 2px rgba(0,0,0,1);-webkit-font-smoothing:antialiased;font-family:inherit}
|
File diff suppressed because one or more lines are too long
|
@ -1,16 +1 @@
|
|||
.imageEditor-buttons {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 1em 0 1em;
|
||||
}
|
||||
|
||||
.first-imageEditor-buttons {
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
||||
@media all and (min-width: 1200px) {
|
||||
|
||||
.imageEditorCard {
|
||||
width: 20%;
|
||||
}
|
||||
}
|
||||
.imageEditor-buttons{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;margin:1em 0}.first-imageEditor-buttons{margin-top:2em}@media all and (min-width:1200px){.imageEditorCard{width:20%}}
|
File diff suppressed because one or more lines are too long
|
@ -1,29 +1 @@
|
|||
define(['dom'], function (dom) {
|
||||
'use strict';
|
||||
|
||||
function loadImage(elem, url) {
|
||||
|
||||
if (elem.tagName !== "IMG") {
|
||||
|
||||
elem.style.backgroundImage = "url('" + url + "')";
|
||||
return Promise.resolve();
|
||||
|
||||
}
|
||||
return loadImageIntoImg(elem, url);
|
||||
}
|
||||
|
||||
function loadImageIntoImg(elem, url) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
dom.addEventListener(elem, 'load', resolve, {
|
||||
once: true
|
||||
});
|
||||
elem.setAttribute("src", url);
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
loadImage: loadImage
|
||||
};
|
||||
|
||||
});
|
||||
define(["dom"],function(dom){"use strict";function loadImage(elem,url){return"IMG"!==elem.tagName?(elem.style.backgroundImage="url('"+url+"')",Promise.resolve()):loadImageIntoImg(elem,url)}function loadImageIntoImg(elem,url){return new Promise(function(resolve,reject){dom.addEventListener(elem,"load",resolve,{once:!0}),elem.setAttribute("src",url)})}return{loadImage:loadImage}});
|
|
@ -1,292 +1 @@
|
|||
define(['lazyLoader', 'imageFetcher', 'layoutManager', 'browser', 'appSettings', 'require'], function (lazyLoader, imageFetcher, layoutManager, browser, appSettings, require) {
|
||||
'use strict';
|
||||
|
||||
var requestIdleCallback = window.requestIdleCallback || function (fn) {
|
||||
fn();
|
||||
};
|
||||
|
||||
//var imagesWorker = new Worker(require.toUrl('.').split('?')[0] + '/imagesworker.js');
|
||||
|
||||
var self = {};
|
||||
|
||||
var enableFade = browser.animate && !browser.slow;
|
||||
|
||||
function fillImage(elem, source, enableEffects) {
|
||||
|
||||
if (!source) {
|
||||
source = elem.getAttribute('data-src');
|
||||
}
|
||||
|
||||
if (!source) {
|
||||
return;
|
||||
}
|
||||
|
||||
fillImageElement(elem, source, enableEffects);
|
||||
}
|
||||
|
||||
function fillImageElement(elem, source, enableEffects) {
|
||||
imageFetcher.loadImage(elem, source).then(function () {
|
||||
|
||||
var fillingVibrant = fillVibrant(elem, source);
|
||||
|
||||
if (enableFade && !layoutManager.tv && enableEffects !== false && !fillingVibrant) {
|
||||
fadeIn(elem);
|
||||
}
|
||||
|
||||
elem.removeAttribute("data-src");
|
||||
});
|
||||
}
|
||||
|
||||
//var placeholder = document.createElement('div');
|
||||
//imagesWorker.onmessage = function (evt) {
|
||||
// placeholder.dispatchEvent(new CustomEvent('decoded', {
|
||||
// detail: evt.data,
|
||||
// bubbles: false,
|
||||
// cancellable: false
|
||||
// }));
|
||||
//};
|
||||
|
||||
//var uniqueId = 0;
|
||||
|
||||
//function fillCanvas(elem, source) {
|
||||
|
||||
// var newUniqueId = (++uniqueId);
|
||||
|
||||
// imagesWorker.postMessage({
|
||||
// url: source,
|
||||
// id: newUniqueId
|
||||
// });
|
||||
|
||||
// placeholder.addEventListener('decoded', function (e) {
|
||||
|
||||
// if (e.detail.id == newUniqueId) {
|
||||
|
||||
// var imageBitmap = e.detail.imageBitmap;
|
||||
// var canvas = document.createElement('canvas');
|
||||
// var canvasContext = canvas.getContext('2d');
|
||||
|
||||
// //drawWidth *= ratio;
|
||||
// //drawHeight *= ratio;
|
||||
|
||||
// // https://stackoverflow.com/questions/21961839/simulation-background-size-cover-in-canvas/21961894#21961894
|
||||
// canvasContext.imageSmoothingEnabled = false;
|
||||
// var width = canvas.width = elem.offsetWidth;
|
||||
// var height = canvas.height = elem.offsetHeight;
|
||||
// canvasContext.drawImage(imageBitmap, 0, 0, imageBitmap.width, imageBitmap.height, 0, 0, width, height);
|
||||
|
||||
// fillVibrant(elem, source, canvas, canvasContext);
|
||||
|
||||
// elem.insertBefore(canvas, elem.firstChild);
|
||||
// elem.removeAttribute("data-src");
|
||||
// }
|
||||
// });
|
||||
//}
|
||||
|
||||
function fillVibrant(img, url, canvas, canvasContext) {
|
||||
|
||||
var vibrantElement = img.getAttribute('data-vibrant');
|
||||
if (!vibrantElement) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (window.Vibrant) {
|
||||
fillVibrantOnLoaded(img, url, vibrantElement, canvas, canvasContext);
|
||||
return true;
|
||||
}
|
||||
|
||||
require(['vibrant'], function () {
|
||||
fillVibrantOnLoaded(img, url, vibrantElement, canvas, canvasContext);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
function fillVibrantOnLoaded(img, url, vibrantElement) {
|
||||
|
||||
vibrantElement = document.getElementById(vibrantElement);
|
||||
if (!vibrantElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
requestIdleCallback(function () {
|
||||
|
||||
//var now = new Date().getTime();
|
||||
getVibrantInfoFromElement(img, url).then(function (vibrantInfo) {
|
||||
|
||||
var swatch = vibrantInfo.split('|');
|
||||
//console.log('vibrant took ' + (new Date().getTime() - now) + 'ms');
|
||||
if (swatch.length) {
|
||||
|
||||
var index = 0;
|
||||
vibrantElement.style.backgroundColor = swatch[index];
|
||||
vibrantElement.style.color = swatch[index + 1];
|
||||
}
|
||||
});
|
||||
});
|
||||
/*
|
||||
* Results into:
|
||||
* Vibrant #7a4426
|
||||
* Muted #7b9eae
|
||||
* DarkVibrant #348945
|
||||
* DarkMuted #141414
|
||||
* LightVibrant #f3ccb4
|
||||
*/
|
||||
}
|
||||
|
||||
function getVibrantInfoFromElement(elem, url) {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
require(['vibrant'], function () {
|
||||
|
||||
if (elem.tagName === 'IMG') {
|
||||
resolve(getVibrantInfo(elem, url));
|
||||
return;
|
||||
}
|
||||
|
||||
var img = new Image();
|
||||
img.onload = function () {
|
||||
resolve(getVibrantInfo(img, url));
|
||||
};
|
||||
img.src = url;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function getSettingsKey(url) {
|
||||
|
||||
var parts = url.split('://');
|
||||
url = parts[parts.length - 1];
|
||||
|
||||
url = url.substring(url.indexOf('/') + 1);
|
||||
|
||||
url = url.split('?')[0];
|
||||
|
||||
var cacheKey = 'vibrant31';
|
||||
//cacheKey = 'vibrant' + new Date().getTime();
|
||||
return cacheKey + url;
|
||||
}
|
||||
|
||||
function getCachedVibrantInfo(url) {
|
||||
|
||||
return appSettings.get(getSettingsKey(url));
|
||||
}
|
||||
|
||||
function getVibrantInfo(img, url) {
|
||||
|
||||
var value = getCachedVibrantInfo(url);
|
||||
if (value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
var vibrant = new Vibrant(img);
|
||||
var swatches = vibrant.swatches();
|
||||
|
||||
value = '';
|
||||
var swatch = swatches.DarkVibrant;
|
||||
value += getSwatchString(swatch);
|
||||
|
||||
appSettings.set(getSettingsKey(url), value);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
function getSwatchString(swatch) {
|
||||
|
||||
if (swatch) {
|
||||
return swatch.getHex() + '|' + swatch.getBodyTextColor() + '|' + swatch.getTitleTextColor();
|
||||
}
|
||||
return '||';
|
||||
}
|
||||
|
||||
function fadeIn(elem) {
|
||||
|
||||
var duration = layoutManager.tv ? 160 : 300;
|
||||
|
||||
var keyframes = [
|
||||
{ opacity: '0', offset: 0 },
|
||||
{ opacity: '1', offset: 1 }];
|
||||
var timing = { duration: duration, iterations: 1 };
|
||||
elem.animate(keyframes, timing);
|
||||
}
|
||||
|
||||
function lazyChildren(elem) {
|
||||
|
||||
lazyLoader.lazyChildren(elem, fillImage);
|
||||
}
|
||||
|
||||
function getPrimaryImageAspectRatio(items) {
|
||||
|
||||
var values = [];
|
||||
|
||||
for (var i = 0, length = items.length; i < length; i++) {
|
||||
|
||||
var ratio = items[i].PrimaryImageAspectRatio || 0;
|
||||
|
||||
if (!ratio) {
|
||||
continue;
|
||||
}
|
||||
|
||||
values[values.length] = ratio;
|
||||
}
|
||||
|
||||
if (!values.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Use the median
|
||||
values.sort(function (a, b) { return a - b; });
|
||||
|
||||
var half = Math.floor(values.length / 2);
|
||||
|
||||
var result;
|
||||
|
||||
if (values.length % 2) {
|
||||
result = values[half];
|
||||
}
|
||||
else {
|
||||
result = (values[half - 1] + values[half]) / 2.0;
|
||||
}
|
||||
|
||||
// If really close to 2:3 (poster image), just return 2:3
|
||||
var aspect2x3 = 2 / 3;
|
||||
if (Math.abs(aspect2x3 - result) <= 0.15) {
|
||||
return aspect2x3;
|
||||
}
|
||||
|
||||
// If really close to 16:9 (episode image), just return 16:9
|
||||
var aspect16x9 = 16 / 9;
|
||||
if (Math.abs(aspect16x9 - result) <= 0.2) {
|
||||
return aspect16x9;
|
||||
}
|
||||
|
||||
// If really close to 1 (square image), just return 1
|
||||
if (Math.abs(1 - result) <= 0.15) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// If really close to 4:3 (poster image), just return 2:3
|
||||
var aspect4x3 = 4 / 3;
|
||||
if (Math.abs(aspect4x3 - result) <= 0.15) {
|
||||
return aspect4x3;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function fillImages(elems) {
|
||||
|
||||
for (var i = 0, length = elems.length; i < length; i++) {
|
||||
var elem = elems[0];
|
||||
fillImage(elem);
|
||||
}
|
||||
}
|
||||
|
||||
self.fillImages = fillImages;
|
||||
self.lazyImage = fillImage;
|
||||
self.lazyChildren = lazyChildren;
|
||||
self.getPrimaryImageAspectRatio = getPrimaryImageAspectRatio;
|
||||
self.getCachedVibrantInfo = getCachedVibrantInfo;
|
||||
self.getVibrantInfoFromElement = getVibrantInfoFromElement;
|
||||
|
||||
return self;
|
||||
});
|
||||
define(["lazyLoader","imageFetcher","layoutManager","browser","appSettings","require"],function(lazyLoader,imageFetcher,layoutManager,browser,appSettings,require){"use strict";function fillImage(elem,source,enableEffects){source||(source=elem.getAttribute("data-src")),source&&fillImageElement(elem,source,enableEffects)}function fillImageElement(elem,source,enableEffects){imageFetcher.loadImage(elem,source).then(function(){var fillingVibrant=fillVibrant(elem,source);!enableFade||layoutManager.tv||enableEffects===!1||fillingVibrant||fadeIn(elem),elem.removeAttribute("data-src")})}function fillVibrant(img,url,canvas,canvasContext){var vibrantElement=img.getAttribute("data-vibrant");return!!vibrantElement&&(window.Vibrant?(fillVibrantOnLoaded(img,url,vibrantElement,canvas,canvasContext),!0):(require(["vibrant"],function(){fillVibrantOnLoaded(img,url,vibrantElement,canvas,canvasContext)}),!0))}function fillVibrantOnLoaded(img,url,vibrantElement){vibrantElement=document.getElementById(vibrantElement),vibrantElement&&requestIdleCallback(function(){getVibrantInfoFromElement(img,url).then(function(vibrantInfo){var swatch=vibrantInfo.split("|");if(swatch.length){var index=0;vibrantElement.style.backgroundColor=swatch[index],vibrantElement.style.color=swatch[index+1]}})})}function getVibrantInfoFromElement(elem,url){return new Promise(function(resolve,reject){require(["vibrant"],function(){if("IMG"===elem.tagName)return void resolve(getVibrantInfo(elem,url));var img=new Image;img.onload=function(){resolve(getVibrantInfo(img,url))},img.src=url})})}function getSettingsKey(url){var parts=url.split("://");url=parts[parts.length-1],url=url.substring(url.indexOf("/")+1),url=url.split("?")[0];var cacheKey="vibrant31";return cacheKey+url}function getCachedVibrantInfo(url){return appSettings.get(getSettingsKey(url))}function getVibrantInfo(img,url){var value=getCachedVibrantInfo(url);if(value)return value;var vibrant=new Vibrant(img),swatches=vibrant.swatches();value="";var swatch=swatches.DarkVibrant;return value+=getSwatchString(swatch),appSettings.set(getSettingsKey(url),value),value}function getSwatchString(swatch){return swatch?swatch.getHex()+"|"+swatch.getBodyTextColor()+"|"+swatch.getTitleTextColor():"||"}function fadeIn(elem){var duration=layoutManager.tv?160:300,keyframes=[{opacity:"0",offset:0},{opacity:"1",offset:1}],timing={duration:duration,iterations:1};elem.animate(keyframes,timing)}function lazyChildren(elem){lazyLoader.lazyChildren(elem,fillImage)}function getPrimaryImageAspectRatio(items){for(var values=[],i=0,length=items.length;i<length;i++){var ratio=items[i].PrimaryImageAspectRatio||0;ratio&&(values[values.length]=ratio)}if(!values.length)return null;values.sort(function(a,b){return a-b});var result,half=Math.floor(values.length/2);result=values.length%2?values[half]:(values[half-1]+values[half])/2;var aspect2x3=2/3;if(Math.abs(aspect2x3-result)<=.15)return aspect2x3;var aspect16x9=16/9;if(Math.abs(aspect16x9-result)<=.2)return aspect16x9;if(Math.abs(1-result)<=.15)return 1;var aspect4x3=4/3;return Math.abs(aspect4x3-result)<=.15?aspect4x3:result}function fillImages(elems){for(var i=0,length=elems.length;i<length;i++){var elem=elems[0];fillImage(elem)}}var requestIdleCallback=window.requestIdleCallback||function(fn){fn()},self={},enableFade=browser.animate&&!browser.slow;return self.fillImages=fillImages,self.lazyImage=fillImage,self.lazyChildren=lazyChildren,self.getPrimaryImageAspectRatio=getPrimaryImageAspectRatio,self.getCachedVibrantInfo=getCachedVibrantInfo,self.getVibrantInfoFromElement=getVibrantInfoFromElement,self});
|
|
@ -1,177 +1 @@
|
|||
define(['cryptojs-md5'], function () {
|
||||
'use strict';
|
||||
|
||||
var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.OIndexedDB || window.msIndexedDB;
|
||||
var dbVersion = 1;
|
||||
var imagesTableName = "images";
|
||||
var db;
|
||||
|
||||
function createObjectStore(dataBase) {
|
||||
|
||||
dataBase.createObjectStore(imagesTableName, { keyPath: "id" });
|
||||
db = dataBase;
|
||||
}
|
||||
|
||||
// Create/open database
|
||||
var request = indexedDB.open("imagesDb2", dbVersion);
|
||||
|
||||
request.onupgradeneeded = function () {
|
||||
createObjectStore(request.result);
|
||||
};
|
||||
|
||||
request.onsuccess = function (event) {
|
||||
|
||||
console.log("Success creating/accessing IndexedDB database");
|
||||
|
||||
var localDb = request.result;
|
||||
|
||||
localDb.onerror = function (event) {
|
||||
console.log("Error creating/accessing IndexedDB database");
|
||||
};
|
||||
|
||||
// Interim solution for Google Chrome to create an objectStore. Will be deprecated
|
||||
if (localDb.setVersion) {
|
||||
if (localDb.version !== dbVersion) {
|
||||
var setVersion = localDb.setVersion(dbVersion);
|
||||
setVersion.onsuccess = function () {
|
||||
createObjectStore(localDb);
|
||||
};
|
||||
} else {
|
||||
db = localDb;
|
||||
}
|
||||
} else {
|
||||
db = localDb;
|
||||
}
|
||||
};
|
||||
|
||||
function revoke(url) {
|
||||
|
||||
//URL.revokeObjectURL(url);
|
||||
|
||||
}
|
||||
|
||||
function loadImage(elem, url) {
|
||||
|
||||
if (elem.tagName !== "IMG") {
|
||||
|
||||
elem.style.backgroundImage = "url('" + url + "')";
|
||||
revoke(url);
|
||||
return Promise.resolve(elem);
|
||||
|
||||
} else {
|
||||
elem.setAttribute("src", url);
|
||||
revoke(url);
|
||||
return Promise.resolve(elem);
|
||||
}
|
||||
}
|
||||
|
||||
function getCacheKey(url) {
|
||||
|
||||
// Try to strip off the domain to share the cache between local and remote connections
|
||||
var index = url.indexOf('://');
|
||||
|
||||
if (index !== -1) {
|
||||
url = url.substring(index + 3);
|
||||
|
||||
index = url.indexOf('/');
|
||||
|
||||
if (index !== -1) {
|
||||
url = url.substring(index + 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return CryptoJS.MD5(url).toString();
|
||||
}
|
||||
|
||||
function getFromDb(key) {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
var transaction = db.transaction(imagesTableName, "read");
|
||||
|
||||
// Retrieve the file that was just stored
|
||||
var request = transaction.objectStore(imagesTableName).get(key);
|
||||
|
||||
request.onsuccess = function (event) {
|
||||
var imgFile = event.target.result;
|
||||
|
||||
// Get window.URL object
|
||||
var URL = window.URL || window.webkitURL;
|
||||
|
||||
// Create and revoke ObjectURL
|
||||
var imgURL = URL.createObjectURL(imgFile);
|
||||
|
||||
resolve(imgURL);
|
||||
};
|
||||
|
||||
request.onerror = reject;
|
||||
});
|
||||
}
|
||||
|
||||
function saveImageToDb(blob, key, resolve) {
|
||||
|
||||
// Open a transaction to the database
|
||||
var transaction = db.transaction(imagesTableName, "readwrite");
|
||||
|
||||
// Put the blob into the dabase
|
||||
var put = transaction.objectStore(imagesTableName).put({ id: key, data: blob });
|
||||
|
||||
// Get window.URL object
|
||||
var URL = window.URL || window.webkitURL;
|
||||
|
||||
var imgURL = URL.createObjectURL(blob);
|
||||
|
||||
resolve(imgURL);
|
||||
}
|
||||
|
||||
function getImageUrl(originalUrl) {
|
||||
|
||||
var key = getCacheKey(originalUrl);
|
||||
|
||||
return getFromDb(key).catch(function () {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
|
||||
xhr.open("GET", originalUrl, true);
|
||||
// Set the responseType to blob
|
||||
xhr.responseType = "blob";
|
||||
|
||||
xhr.addEventListener("load", function () {
|
||||
if (xhr.status === 200) {
|
||||
|
||||
// Put the received blob into IndexedDB
|
||||
saveImageToDb(xhr.response, key, resolve);
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
}, false);
|
||||
|
||||
xhr.onerror = reject;
|
||||
|
||||
// Send XHR
|
||||
xhr.send();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
loadImage: function (elem, url) {
|
||||
|
||||
if (!db) {
|
||||
return loadImage(elem, url);
|
||||
}
|
||||
|
||||
return getImageUrl(url).then(function (localUrl) {
|
||||
|
||||
return loadImage(elem, localUrl);
|
||||
|
||||
}, function () {
|
||||
return loadImage(elem, url);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
define(["cryptojs-md5"],function(){"use strict";function createObjectStore(dataBase){dataBase.createObjectStore(imagesTableName,{keyPath:"id"}),db=dataBase}function revoke(url){}function loadImage(elem,url){return"IMG"!==elem.tagName?(elem.style.backgroundImage="url('"+url+"')",revoke(url),Promise.resolve(elem)):(elem.setAttribute("src",url),revoke(url),Promise.resolve(elem))}function getCacheKey(url){var index=url.indexOf("://");return index!==-1&&(url=url.substring(index+3),index=url.indexOf("/"),index!==-1&&(url=url.substring(index+1))),CryptoJS.MD5(url).toString()}function getFromDb(key){return new Promise(function(resolve,reject){var transaction=db.transaction(imagesTableName,"read"),request=transaction.objectStore(imagesTableName).get(key);request.onsuccess=function(event){var imgFile=event.target.result,URL=window.URL||window.webkitURL,imgURL=URL.createObjectURL(imgFile);resolve(imgURL)},request.onerror=reject})}function saveImageToDb(blob,key,resolve){var transaction=db.transaction(imagesTableName,"readwrite"),URL=(transaction.objectStore(imagesTableName).put({id:key,data:blob}),window.URL||window.webkitURL),imgURL=URL.createObjectURL(blob);resolve(imgURL)}function getImageUrl(originalUrl){var key=getCacheKey(originalUrl);return getFromDb(key).catch(function(){return new Promise(function(resolve,reject){var xhr=new XMLHttpRequest;xhr.open("GET",originalUrl,!0),xhr.responseType="blob",xhr.addEventListener("load",function(){200===xhr.status?saveImageToDb(xhr.response,key,resolve):reject()},!1),xhr.onerror=reject,xhr.send()})})}var db,indexedDB=window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB||window.OIndexedDB||window.msIndexedDB,dbVersion=1,imagesTableName="images",request=indexedDB.open("imagesDb2",dbVersion);return request.onupgradeneeded=function(){createObjectStore(request.result)},request.onsuccess=function(event){console.log("Success creating/accessing IndexedDB database");var localDb=request.result;if(localDb.onerror=function(event){console.log("Error creating/accessing IndexedDB database")},localDb.setVersion)if(localDb.version!==dbVersion){var setVersion=localDb.setVersion(dbVersion);setVersion.onsuccess=function(){createObjectStore(localDb)}}else db=localDb;else db=localDb},{loadImage:function(elem,url){return db?getImageUrl(url).then(function(localUrl){return loadImage(elem,localUrl)},function(){return loadImage(elem,url)}):loadImage(elem,url)}}});
|
|
@ -1,248 +1 @@
|
|||
define(['cryptojs-md5'], function () {
|
||||
'use strict';
|
||||
|
||||
function loadImage(elem, url) {
|
||||
|
||||
if (elem.tagName !== "IMG") {
|
||||
|
||||
elem.style.backgroundImage = "url('" + url + "')";
|
||||
return Promise.resolve(elem);
|
||||
|
||||
} else {
|
||||
elem.setAttribute("src", url);
|
||||
return Promise.resolve(elem);
|
||||
}
|
||||
}
|
||||
|
||||
// Request Quota (only for File System API)
|
||||
var requestedBytes = 1024 * 1024 * 1500;
|
||||
var imageCacheDirectoryEntry;
|
||||
var imageCacheFolder = 'images';
|
||||
|
||||
function createDir(rootDirEntry, folders, callback, errorCallback) {
|
||||
// Throw out './' or '/' and move on to prevent something like '/foo/.//bar'.
|
||||
if (folders[0] === '.' || folders[0] === '') {
|
||||
folders = folders.slice(1);
|
||||
}
|
||||
rootDirEntry.getDirectory(folders[0], { create: true }, function (dirEntry) {
|
||||
// Recursively add the new subfolder (if we still have another to create).
|
||||
if (folders.length > 1) {
|
||||
createDir(dirEntry, folders.slice(1), callback, errorCallback);
|
||||
} else {
|
||||
callback(dirEntry);
|
||||
}
|
||||
}, errorCallback);
|
||||
}
|
||||
|
||||
navigator.webkitPersistentStorage.requestQuota(
|
||||
requestedBytes, function (grantedBytes) {
|
||||
|
||||
var requestMethod = window.webkitRequestFileSystem || window.requestFileSystem;
|
||||
|
||||
requestMethod(PERSISTENT, grantedBytes, function (fs) {
|
||||
|
||||
fileSystem = fs;
|
||||
|
||||
createDir(fileSystem.root, imageCacheFolder.split('/'), function (dirEntry) {
|
||||
|
||||
imageCacheDirectoryEntry = dirEntry;
|
||||
|
||||
// TODO: find a better time to schedule this
|
||||
setTimeout(cleanCache, 60000);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function toArray(list) {
|
||||
return Array.prototype.slice.call(list || [], 0);
|
||||
}
|
||||
|
||||
function cleanCache() {
|
||||
|
||||
var dirReader = imageCacheDirectoryEntry.createReader();
|
||||
var entries = [];
|
||||
|
||||
var onReadFail = function () {
|
||||
console.log('dirReader.readEntries failed');
|
||||
};
|
||||
|
||||
// Keep calling readEntries() until no more results are returned.
|
||||
var readEntries = function () {
|
||||
dirReader.readEntries(function (results) {
|
||||
if (!results.length) {
|
||||
entries.forEach(cleanFile);
|
||||
} else {
|
||||
entries = entries.concat(toArray(results));
|
||||
readEntries();
|
||||
}
|
||||
}, onReadFail);
|
||||
};
|
||||
|
||||
// Start reading the directory.
|
||||
readEntries();
|
||||
}
|
||||
|
||||
function cleanFile(fileEntry) {
|
||||
if (!fileEntry.isFile) {
|
||||
return;
|
||||
}
|
||||
|
||||
fileEntry.file(function (file) {
|
||||
|
||||
getLastModified(file, fileEntry).then(function (lastModifiedDate) {
|
||||
|
||||
var elapsed = new Date().getTime() - lastModifiedDate;
|
||||
// 40 days
|
||||
var maxElapsed = 3456000000;
|
||||
if (elapsed >= maxElapsed) {
|
||||
|
||||
var fullPath = fileEntry.fullPath;
|
||||
console.log('deleting file: ' + fullPath);
|
||||
|
||||
fileEntry.remove(function () {
|
||||
console.log('File deleted: ' + fullPath);
|
||||
}, function () {
|
||||
console.log('Failed to delete file: ' + fullPath);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function getLastModified(file, fileEntry) {
|
||||
|
||||
var lastModifiedDate = file.lastModified || file.lastModifiedDate || file.modificationTime;
|
||||
if (lastModifiedDate) {
|
||||
if (lastModifiedDate.getTime) {
|
||||
lastModifiedDate = lastModifiedDate.getTime();
|
||||
}
|
||||
return Promise.resolve(lastModifiedDate);
|
||||
}
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
fileEntry.getMetadata(function (metadata) {
|
||||
var lastModifiedDate = metadata.lastModified || metadata.lastModifiedDate || metadata.modificationTime;
|
||||
if (lastModifiedDate) {
|
||||
if (lastModifiedDate.getTime) {
|
||||
lastModifiedDate = lastModifiedDate.getTime();
|
||||
}
|
||||
}
|
||||
resolve(lastModifiedDate);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function getCacheKey(url) {
|
||||
|
||||
// Try to strip off the domain to share the cache between local and remote connections
|
||||
var index = url.indexOf('://');
|
||||
|
||||
if (index !== -1) {
|
||||
url = url.substring(index + 3);
|
||||
|
||||
index = url.indexOf('/');
|
||||
|
||||
if (index !== -1) {
|
||||
url = url.substring(index + 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return CryptoJS.MD5(url).toString();
|
||||
}
|
||||
|
||||
function downloadToFile(url, dir, filename, callback, errorCallback) {
|
||||
|
||||
console.log('Downloading ' + url);
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', url, true);
|
||||
xhr.responseType = "arraybuffer";
|
||||
|
||||
xhr.onload = function (e) {
|
||||
if (this.status === 200) {
|
||||
writeData(dir, filename, this.getResponseHeader('Content-Type'), this.response, callback, errorCallback);
|
||||
} else {
|
||||
errorCallback();
|
||||
}
|
||||
};
|
||||
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
function writeData(dir, filename, fileType, data, callback, errorCallback) {
|
||||
|
||||
dir.getFile(filename, { create: true }, function (fileEntry) {
|
||||
|
||||
// Create a FileWriter object for our FileEntry (log.txt).
|
||||
fileEntry.createWriter(function (fileWriter) {
|
||||
|
||||
fileWriter.onwriteend = function (e) {
|
||||
callback(fileEntry);
|
||||
};
|
||||
|
||||
fileWriter.onerror = errorCallback;
|
||||
|
||||
// Create a new Blob and write it to log.txt.
|
||||
var blob = new Blob([data], { type: fileType });
|
||||
|
||||
fileWriter.write(blob);
|
||||
|
||||
}, errorCallback);
|
||||
|
||||
}, errorCallback);
|
||||
}
|
||||
|
||||
function getImageUrl(originalUrl) {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
if (originalUrl.indexOf('tag=') !== -1) {
|
||||
originalUrl += "&accept=webp";
|
||||
}
|
||||
|
||||
var key = getCacheKey(originalUrl);
|
||||
|
||||
var fileEntryCallback = function (fileEntry) {
|
||||
resolve(fileEntry.toURL());
|
||||
};
|
||||
|
||||
var errorCallback = function (e) {
|
||||
console.log('Imagestore error: ' + e.name);
|
||||
reject();
|
||||
};
|
||||
|
||||
if (!fileSystem || !imageCacheDirectoryEntry) {
|
||||
errorCallback('');
|
||||
return;
|
||||
}
|
||||
|
||||
var path = '/' + imageCacheFolder + "/" + key;
|
||||
|
||||
fileSystem.root.getFile(path, { create: false }, fileEntryCallback, function () {
|
||||
|
||||
downloadToFile(originalUrl, imageCacheDirectoryEntry, key, fileEntryCallback, errorCallback);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var fileSystem;
|
||||
|
||||
return {
|
||||
loadImage: function (elem, url) {
|
||||
|
||||
return getImageUrl(url).then(function (localUrl) {
|
||||
|
||||
return loadImage(elem, localUrl);
|
||||
|
||||
}, function () {
|
||||
return loadImage(elem, url);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
define(["cryptojs-md5"],function(){"use strict";function loadImage(elem,url){return"IMG"!==elem.tagName?(elem.style.backgroundImage="url('"+url+"')",Promise.resolve(elem)):(elem.setAttribute("src",url),Promise.resolve(elem))}function createDir(rootDirEntry,folders,callback,errorCallback){"."!==folders[0]&&""!==folders[0]||(folders=folders.slice(1)),rootDirEntry.getDirectory(folders[0],{create:!0},function(dirEntry){folders.length>1?createDir(dirEntry,folders.slice(1),callback,errorCallback):callback(dirEntry)},errorCallback)}function toArray(list){return Array.prototype.slice.call(list||[],0)}function cleanCache(){var dirReader=imageCacheDirectoryEntry.createReader(),entries=[],onReadFail=function(){console.log("dirReader.readEntries failed")},readEntries=function(){dirReader.readEntries(function(results){results.length?(entries=entries.concat(toArray(results)),readEntries()):entries.forEach(cleanFile)},onReadFail)};readEntries()}function cleanFile(fileEntry){fileEntry.isFile&&fileEntry.file(function(file){getLastModified(file,fileEntry).then(function(lastModifiedDate){var elapsed=(new Date).getTime()-lastModifiedDate,maxElapsed=3456e6;if(elapsed>=maxElapsed){var fullPath=fileEntry.fullPath;console.log("deleting file: "+fullPath),fileEntry.remove(function(){console.log("File deleted: "+fullPath)},function(){console.log("Failed to delete file: "+fullPath)})}})})}function getLastModified(file,fileEntry){var lastModifiedDate=file.lastModified||file.lastModifiedDate||file.modificationTime;return lastModifiedDate?(lastModifiedDate.getTime&&(lastModifiedDate=lastModifiedDate.getTime()),Promise.resolve(lastModifiedDate)):new Promise(function(resolve,reject){fileEntry.getMetadata(function(metadata){var lastModifiedDate=metadata.lastModified||metadata.lastModifiedDate||metadata.modificationTime;lastModifiedDate&&lastModifiedDate.getTime&&(lastModifiedDate=lastModifiedDate.getTime()),resolve(lastModifiedDate)})})}function getCacheKey(url){var index=url.indexOf("://");return index!==-1&&(url=url.substring(index+3),index=url.indexOf("/"),index!==-1&&(url=url.substring(index+1))),CryptoJS.MD5(url).toString()}function downloadToFile(url,dir,filename,callback,errorCallback){console.log("Downloading "+url);var xhr=new XMLHttpRequest;xhr.open("GET",url,!0),xhr.responseType="arraybuffer",xhr.onload=function(e){200===this.status?writeData(dir,filename,this.getResponseHeader("Content-Type"),this.response,callback,errorCallback):errorCallback()},xhr.send()}function writeData(dir,filename,fileType,data,callback,errorCallback){dir.getFile(filename,{create:!0},function(fileEntry){fileEntry.createWriter(function(fileWriter){fileWriter.onwriteend=function(e){callback(fileEntry)},fileWriter.onerror=errorCallback;var blob=new Blob([data],{type:fileType});fileWriter.write(blob)},errorCallback)},errorCallback)}function getImageUrl(originalUrl){return new Promise(function(resolve,reject){originalUrl.indexOf("tag=")!==-1&&(originalUrl+="&accept=webp");var key=getCacheKey(originalUrl),fileEntryCallback=function(fileEntry){resolve(fileEntry.toURL())},errorCallback=function(e){console.log("Imagestore error: "+e.name),reject()};if(!fileSystem||!imageCacheDirectoryEntry)return void errorCallback("");var path="/"+imageCacheFolder+"/"+key;fileSystem.root.getFile(path,{create:!1},fileEntryCallback,function(){downloadToFile(originalUrl,imageCacheDirectoryEntry,key,fileEntryCallback,errorCallback)})})}var imageCacheDirectoryEntry,requestedBytes=1572864e3,imageCacheFolder="images";navigator.webkitPersistentStorage.requestQuota(requestedBytes,function(grantedBytes){var requestMethod=window.webkitRequestFileSystem||window.requestFileSystem;requestMethod(PERSISTENT,grantedBytes,function(fs){fileSystem=fs,createDir(fileSystem.root,imageCacheFolder.split("/"),function(dirEntry){imageCacheDirectoryEntry=dirEntry,setTimeout(cleanCache,6e4)})})});var fileSystem;return{loadImage:function(elem,url){return getImageUrl(url).then(function(localUrl){return loadImage(elem,localUrl)},function(){return loadImage(elem,url)})}}});
|
|
@ -1,77 +1 @@
|
|||
.itemProgressBar {
|
||||
background: rgba(0,0,0,.5);
|
||||
position: relative;
|
||||
height: .35em;
|
||||
}
|
||||
|
||||
.itemProgressBarForeground {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
background-color: #52B54B;
|
||||
}
|
||||
|
||||
.indicator {
|
||||
border-radius: 500px;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: 500;
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
}
|
||||
|
||||
.timerIndicator {
|
||||
color: #CB272A;
|
||||
}
|
||||
|
||||
.timerIndicator-inactive {
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.indicator + .indicator {
|
||||
margin-left: .25em;
|
||||
}
|
||||
|
||||
.indicatorIcon {
|
||||
width: auto;
|
||||
height: auto;
|
||||
font-size: 1.6em;
|
||||
}
|
||||
|
||||
.countIndicator {
|
||||
background: rgba(82,181,75,1);
|
||||
border-radius: 500px;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: 500;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.playedIndicator {
|
||||
background: rgba(82,181,75,1);
|
||||
border-radius: 500px;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.syncIndicator {
|
||||
color: #fff;
|
||||
border-radius: 500px;
|
||||
}
|
||||
|
||||
.emptySyncIndicator {
|
||||
background: #ccc;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.fullSyncIndicator {
|
||||
background: rgba(82,181,75,1);
|
||||
}
|
||||
.countIndicator,.indicator{display:-webkit-flex;display:-webkit-box;-webkit-box-align:center;font-weight:500}.itemProgressBar{background:rgba(0,0,0,.5);position:relative;height:.35em}.itemProgressBarForeground{position:absolute;top:0;left:0;bottom:0;background-color:#52B54B}.indicator{-webkit-border-radius:500px;border-radius:500px;display:flex;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;width:2em;height:2em}.countIndicator,.playedIndicator{background:rgba(82,181,75,1);-webkit-border-radius:500px}.timerIndicator{color:#CB272A}.timerIndicator-inactive{color:#888}.indicator+.indicator{margin-left:.25em}.indicatorIcon{width:auto;height:auto;font-size:1.6em}.countIndicator{border-radius:500px;display:flex;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;color:#fff}.playedIndicator{border-radius:500px;display:-webkit-flex;display:-webkit-box;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;color:#fff}.syncIndicator{color:#fff;-webkit-border-radius:500px;border-radius:500px}.emptySyncIndicator{background:#ccc;color:#333}.fullSyncIndicator{background:rgba(82,181,75,1)}
|
|
@ -1,172 +1 @@
|
|||
define(['css!./indicators.css', 'material-icons'], function () {
|
||||
'use strict';
|
||||
|
||||
function enableProgressIndicator(item) {
|
||||
|
||||
if (item.MediaType === 'Video') {
|
||||
if (item.Type !== 'TvChannel') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (item.Type === 'AudioBook' || item.Type === 'AudioPodcast') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function getProgressHtml(pct, options) {
|
||||
|
||||
var containerClass = 'itemProgressBar';
|
||||
|
||||
if (options) {
|
||||
if (options.containerClass) {
|
||||
containerClass += ' ' + options.containerClass;
|
||||
}
|
||||
}
|
||||
|
||||
return '<div class="' + containerClass + '"><div class="itemProgressBarForeground" style="width:' + pct + '%;"></div></div>';
|
||||
}
|
||||
|
||||
function getProgressBarHtml(item, options) {
|
||||
|
||||
if (enableProgressIndicator(item)) {
|
||||
if (item.Type === "Recording" && item.CompletionPercentage) {
|
||||
|
||||
return getProgressHtml(item.CompletionPercentage, options);
|
||||
}
|
||||
|
||||
var userData = options ? (options.userData || item.UserData) : item.UserData;
|
||||
if (userData) {
|
||||
var pct = userData.PlayedPercentage;
|
||||
|
||||
if (pct && pct < 100) {
|
||||
|
||||
return getProgressHtml(pct, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
function enablePlayedIndicator(item) {
|
||||
|
||||
if (item.MediaType === 'Video') {
|
||||
if (item.Type !== 'TvChannel') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (item.MediaType === 'Audio') {
|
||||
if (item.Type === 'AudioPodcast') {
|
||||
return true;
|
||||
}
|
||||
if (item.Type === 'AudioBook') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (item.Type === "Series" ||
|
||||
item.Type === "Season" ||
|
||||
item.Type === "BoxSet" ||
|
||||
item.MediaType === "Game" ||
|
||||
item.MediaType === "Book" ||
|
||||
item.MediaType === "Recording") {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function getPlayedIndicator(item) {
|
||||
|
||||
if (enablePlayedIndicator(item)) {
|
||||
|
||||
var userData = item.UserData || {};
|
||||
|
||||
if (userData.UnplayedItemCount) {
|
||||
return '<div class="countIndicator indicator">' + userData.UnplayedItemCount + '</div>';
|
||||
}
|
||||
|
||||
if (userData.PlayedPercentage && userData.PlayedPercentage >= 100 || (userData.Played)) {
|
||||
return '<div class="playedIndicator indicator"><i class="md-icon indicatorIcon"></i></div>';
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
function getCountIndicatorHtml(count) {
|
||||
|
||||
return '<div class="countIndicator indicator">' + count + '</div>';
|
||||
}
|
||||
|
||||
function getChildCountIndicatorHtml(item, options) {
|
||||
|
||||
var minCount = 0;
|
||||
|
||||
if (options) {
|
||||
minCount = options.minCount || minCount;
|
||||
}
|
||||
|
||||
if (item.ChildCount && item.ChildCount > minCount) {
|
||||
return getCountIndicatorHtml(item.ChildCount);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
function getTimerIndicator(item) {
|
||||
|
||||
var status;
|
||||
|
||||
if (item.Type === 'SeriesTimer') {
|
||||
return '<i class="md-icon timerIndicator indicatorIcon"></i>';
|
||||
}
|
||||
else if (item.TimerId || item.SeriesTimerId) {
|
||||
|
||||
status = item.Status || 'Cancelled';
|
||||
}
|
||||
else if (item.Type === 'Timer') {
|
||||
|
||||
status = item.Status;
|
||||
}
|
||||
else {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (item.SeriesTimerId) {
|
||||
|
||||
if (status !== 'Cancelled') {
|
||||
return '<i class="md-icon timerIndicator indicatorIcon"></i>';
|
||||
}
|
||||
|
||||
return '<i class="md-icon timerIndicator timerIndicator-inactive indicatorIcon"></i>';
|
||||
}
|
||||
|
||||
return '<i class="md-icon timerIndicator indicatorIcon"></i>';
|
||||
}
|
||||
|
||||
function getSyncIndicator(item) {
|
||||
|
||||
if (item.SyncPercent === 100) {
|
||||
return '<div class="syncIndicator indicator fullSyncIndicator"><i class="md-icon indicatorIcon">file_download</i></div>';
|
||||
} else if (item.SyncPercent != null) {
|
||||
return '<div class="syncIndicator indicator emptySyncIndicator"><i class="md-icon indicatorIcon">file_download</i></div>';
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
return {
|
||||
getProgressBarHtml: getProgressBarHtml,
|
||||
getPlayedIndicatorHtml: getPlayedIndicator,
|
||||
getChildCountIndicatorHtml: getChildCountIndicatorHtml,
|
||||
enableProgressIndicator: enableProgressIndicator,
|
||||
getTimerIndicator: getTimerIndicator,
|
||||
enablePlayedIndicator: enablePlayedIndicator,
|
||||
getSyncIndicator: getSyncIndicator
|
||||
};
|
||||
});
|
||||
define(["css!./indicators.css","material-icons"],function(){"use strict";function enableProgressIndicator(item){return"Video"===item.MediaType&&"TvChannel"!==item.Type||("AudioBook"===item.Type||"AudioPodcast"===item.Type)}function getProgressHtml(pct,options){var containerClass="itemProgressBar";return options&&options.containerClass&&(containerClass+=" "+options.containerClass),'<div class="'+containerClass+'"><div class="itemProgressBarForeground" style="width:'+pct+'%;"></div></div>'}function getProgressBarHtml(item,options){if(enableProgressIndicator(item)){if("Recording"===item.Type&&item.CompletionPercentage)return getProgressHtml(item.CompletionPercentage,options);var userData=options?options.userData||item.UserData:item.UserData;if(userData){var pct=userData.PlayedPercentage;if(pct&&pct<100)return getProgressHtml(pct,options)}}return""}function enablePlayedIndicator(item){if("Video"===item.MediaType&&"TvChannel"!==item.Type)return!0;if("Audio"===item.MediaType){if("AudioPodcast"===item.Type)return!0;if("AudioBook"===item.Type)return!0}return"Series"===item.Type||"Season"===item.Type||"BoxSet"===item.Type||"Game"===item.MediaType||"Book"===item.MediaType||"Recording"===item.MediaType}function getPlayedIndicator(item){if(enablePlayedIndicator(item)){var userData=item.UserData||{};if(userData.UnplayedItemCount)return'<div class="countIndicator indicator">'+userData.UnplayedItemCount+"</div>";if(userData.PlayedPercentage&&userData.PlayedPercentage>=100||userData.Played)return'<div class="playedIndicator indicator"><i class="md-icon indicatorIcon"></i></div>'}return""}function getCountIndicatorHtml(count){return'<div class="countIndicator indicator">'+count+"</div>"}function getChildCountIndicatorHtml(item,options){var minCount=0;return options&&(minCount=options.minCount||minCount),item.ChildCount&&item.ChildCount>minCount?getCountIndicatorHtml(item.ChildCount):""}function getTimerIndicator(item){var status;if("SeriesTimer"===item.Type)return'<i class="md-icon timerIndicator indicatorIcon"></i>';if(item.TimerId||item.SeriesTimerId)status=item.Status||"Cancelled";else{if("Timer"!==item.Type)return"";status=item.Status}return item.SeriesTimerId?"Cancelled"!==status?'<i class="md-icon timerIndicator indicatorIcon"></i>':'<i class="md-icon timerIndicator timerIndicator-inactive indicatorIcon"></i>':'<i class="md-icon timerIndicator indicatorIcon"></i>'}function getSyncIndicator(item){return 100===item.SyncPercent?'<div class="syncIndicator indicator fullSyncIndicator"><i class="md-icon indicatorIcon">file_download</i></div>':null!=item.SyncPercent?'<div class="syncIndicator indicator emptySyncIndicator"><i class="md-icon indicatorIcon">file_download</i></div>':""}return{getProgressBarHtml:getProgressBarHtml,getPlayedIndicatorHtml:getPlayedIndicator,getChildCountIndicatorHtml:getChildCountIndicatorHtml,enableProgressIndicator:enableProgressIndicator,getTimerIndicator:getTimerIndicator,enablePlayedIndicator:enablePlayedIndicator,getSyncIndicator:getSyncIndicator}});
|
|
@ -1,206 +1 @@
|
|||
define(['connectionManager', 'playbackManager', 'events', 'inputManager', 'focusManager', 'embyRouter'], function (connectionManager, playbackManager, events, inputManager, focusManager, embyRouter) {
|
||||
'use strict';
|
||||
|
||||
function notifyApp() {
|
||||
|
||||
inputManager.notify();
|
||||
}
|
||||
|
||||
function displayMessage(cmd) {
|
||||
|
||||
var args = cmd.Arguments;
|
||||
|
||||
if (args.TimeoutMs) {
|
||||
|
||||
require(['toast'], function (toast) {
|
||||
toast({ title: args.Header, text: args.Text });
|
||||
});
|
||||
|
||||
}
|
||||
else {
|
||||
require(['alert'], function (alert) {
|
||||
alert({ title: args.Header, text: args.Text });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function displayContent(cmd, apiClient) {
|
||||
|
||||
apiClient.getItem(apiClient.getCurrentUserId(), cmd.ItemId).then(function (item) {
|
||||
embyRouter.showItem(item);
|
||||
});
|
||||
}
|
||||
|
||||
function processGeneralCommand(cmd, apiClient) {
|
||||
|
||||
// Full list
|
||||
// https://github.com/MediaBrowser/MediaBrowser/blob/master/MediaBrowser.Model/Session/GeneralCommand.cs#L23
|
||||
//console.log('Received command: ' + cmd.Name);
|
||||
|
||||
switch (cmd.Name) {
|
||||
|
||||
case 'Select':
|
||||
inputManager.trigger('select');
|
||||
return;
|
||||
case 'Back':
|
||||
inputManager.trigger('back');
|
||||
return;
|
||||
case 'MoveUp':
|
||||
inputManager.trigger('up');
|
||||
return;
|
||||
case 'MoveDown':
|
||||
inputManager.trigger('down');
|
||||
return;
|
||||
case 'MoveLeft':
|
||||
inputManager.trigger('left');
|
||||
return;
|
||||
case 'MoveRight':
|
||||
inputManager.trigger('right');
|
||||
return;
|
||||
case 'PageUp':
|
||||
inputManager.trigger('pageup');
|
||||
return;
|
||||
case 'PageDown':
|
||||
inputManager.trigger('pagedown');
|
||||
return;
|
||||
case 'SetRepeatMode':
|
||||
playbackManager.setRepeatMode(cmd.Arguments.RepeatMode);
|
||||
break;
|
||||
case 'VolumeUp':
|
||||
inputManager.trigger('volumeup');
|
||||
return;
|
||||
case 'VolumeDown':
|
||||
inputManager.trigger('volumedown');
|
||||
return;
|
||||
case 'ChannelUp':
|
||||
inputManager.trigger('channelup');
|
||||
return;
|
||||
case 'ChannelDown':
|
||||
inputManager.trigger('channeldown');
|
||||
return;
|
||||
case 'Mute':
|
||||
inputManager.trigger('mute');
|
||||
return;
|
||||
case 'Unmute':
|
||||
inputManager.trigger('unmute');
|
||||
return;
|
||||
case 'ToggleMute':
|
||||
inputManager.trigger('togglemute');
|
||||
return;
|
||||
case 'SetVolume':
|
||||
notifyApp();
|
||||
playbackManager.setVolume(cmd.Arguments.Volume);
|
||||
break;
|
||||
case 'SetAudioStreamIndex':
|
||||
notifyApp();
|
||||
playbackManager.setAudioStreamIndex(parseInt(cmd.Arguments.Index));
|
||||
break;
|
||||
case 'SetSubtitleStreamIndex':
|
||||
notifyApp();
|
||||
playbackManager.setSubtitleStreamIndex(parseInt(cmd.Arguments.Index));
|
||||
break;
|
||||
case 'ToggleFullscreen':
|
||||
inputManager.trigger('togglefullscreen');
|
||||
return;
|
||||
case 'GoHome':
|
||||
inputManager.trigger('home');
|
||||
return;
|
||||
case 'GoToSettings':
|
||||
inputManager.trigger('settings');
|
||||
return;
|
||||
case 'DisplayContent':
|
||||
displayContent(cmd, apiClient);
|
||||
break;
|
||||
case 'GoToSearch':
|
||||
inputManager.trigger('search');
|
||||
return;
|
||||
case 'DisplayMessage':
|
||||
displayMessage(cmd);
|
||||
break;
|
||||
case 'ToggleOsd':
|
||||
// todo
|
||||
break;
|
||||
case 'ToggleContextMenu':
|
||||
// todo
|
||||
break;
|
||||
case 'TakeScreenShot':
|
||||
// todo
|
||||
break;
|
||||
case 'SendKey':
|
||||
// todo
|
||||
break;
|
||||
case 'SendString':
|
||||
// todo
|
||||
focusManager.sendText(cmd.Arguments.String);
|
||||
break;
|
||||
default:
|
||||
console.log('processGeneralCommand does not recognize: ' + cmd.Name);
|
||||
break;
|
||||
}
|
||||
|
||||
notifyApp();
|
||||
}
|
||||
|
||||
function onWebSocketMessageReceived(e, msg) {
|
||||
|
||||
var apiClient = this;
|
||||
|
||||
if (msg.MessageType === "Play") {
|
||||
|
||||
notifyApp();
|
||||
var serverId = apiClient.serverInfo().Id;
|
||||
|
||||
if (msg.Data.PlayCommand === "PlayNext") {
|
||||
playbackManager.queueNext({ ids: msg.Data.ItemIds, serverId: serverId });
|
||||
}
|
||||
else if (msg.Data.PlayCommand === "PlayLast") {
|
||||
playbackManager.queue({ ids: msg.Data.ItemIds, serverId: serverId });
|
||||
}
|
||||
else {
|
||||
playbackManager.play({ ids: msg.Data.ItemIds, startPositionTicks: msg.Data.StartPositionTicks, serverId: serverId });
|
||||
}
|
||||
|
||||
}
|
||||
else if (msg.MessageType === "Playstate") {
|
||||
|
||||
if (msg.Data.Command === 'Stop') {
|
||||
inputManager.trigger('stop');
|
||||
}
|
||||
else if (msg.Data.Command === 'Pause') {
|
||||
inputManager.trigger('pause');
|
||||
}
|
||||
else if (msg.Data.Command === 'Unpause') {
|
||||
inputManager.trigger('play');
|
||||
}
|
||||
else if (msg.Data.Command === 'Seek') {
|
||||
playbackManager.seek(msg.Data.SeekPositionTicks);
|
||||
}
|
||||
else if (msg.Data.Command === 'NextTrack') {
|
||||
inputManager.trigger('next');
|
||||
}
|
||||
else if (msg.Data.Command === 'PreviousTrack') {
|
||||
inputManager.trigger('previous');
|
||||
} else {
|
||||
notifyApp();
|
||||
}
|
||||
}
|
||||
else if (msg.MessageType === "GeneralCommand") {
|
||||
var cmd = msg.Data;
|
||||
processGeneralCommand(cmd, apiClient);
|
||||
}
|
||||
}
|
||||
|
||||
function bindEvents(apiClient) {
|
||||
|
||||
events.off(apiClient, "websocketmessage", onWebSocketMessageReceived);
|
||||
events.on(apiClient, "websocketmessage", onWebSocketMessageReceived);
|
||||
}
|
||||
|
||||
connectionManager.getApiClients().forEach(bindEvents);
|
||||
|
||||
events.on(connectionManager, 'apiclientcreated', function (e, newApiClient) {
|
||||
|
||||
bindEvents(newApiClient);
|
||||
});
|
||||
|
||||
});
|
||||
define(["connectionManager","playbackManager","events","inputManager","focusManager","embyRouter"],function(connectionManager,playbackManager,events,inputManager,focusManager,embyRouter){"use strict";function notifyApp(){inputManager.notify()}function displayMessage(cmd){var args=cmd.Arguments;args.TimeoutMs?require(["toast"],function(toast){toast({title:args.Header,text:args.Text})}):require(["alert"],function(alert){alert({title:args.Header,text:args.Text})})}function displayContent(cmd,apiClient){apiClient.getItem(apiClient.getCurrentUserId(),cmd.ItemId).then(function(item){embyRouter.showItem(item)})}function processGeneralCommand(cmd,apiClient){switch(cmd.Name){case"Select":return void inputManager.trigger("select");case"Back":return void inputManager.trigger("back");case"MoveUp":return void inputManager.trigger("up");case"MoveDown":return void inputManager.trigger("down");case"MoveLeft":return void inputManager.trigger("left");case"MoveRight":return void inputManager.trigger("right");case"PageUp":return void inputManager.trigger("pageup");case"PageDown":return void inputManager.trigger("pagedown");case"SetRepeatMode":playbackManager.setRepeatMode(cmd.Arguments.RepeatMode);break;case"VolumeUp":return void inputManager.trigger("volumeup");case"VolumeDown":return void inputManager.trigger("volumedown");case"ChannelUp":return void inputManager.trigger("channelup");case"ChannelDown":return void inputManager.trigger("channeldown");case"Mute":return void inputManager.trigger("mute");case"Unmute":return void inputManager.trigger("unmute");case"ToggleMute":return void inputManager.trigger("togglemute");case"SetVolume":notifyApp(),playbackManager.setVolume(cmd.Arguments.Volume);break;case"SetAudioStreamIndex":notifyApp(),playbackManager.setAudioStreamIndex(parseInt(cmd.Arguments.Index));break;case"SetSubtitleStreamIndex":notifyApp(),playbackManager.setSubtitleStreamIndex(parseInt(cmd.Arguments.Index));break;case"ToggleFullscreen":return void inputManager.trigger("togglefullscreen");case"GoHome":return void inputManager.trigger("home");case"GoToSettings":return void inputManager.trigger("settings");case"DisplayContent":displayContent(cmd,apiClient);break;case"GoToSearch":return void inputManager.trigger("search");case"DisplayMessage":displayMessage(cmd);break;case"ToggleOsd":break;case"ToggleContextMenu":break;case"TakeScreenShot":break;case"SendKey":break;case"SendString":focusManager.sendText(cmd.Arguments.String);break;default:console.log("processGeneralCommand does not recognize: "+cmd.Name)}notifyApp()}function onWebSocketMessageReceived(e,msg){var apiClient=this;if("Play"===msg.MessageType){notifyApp();var serverId=apiClient.serverInfo().Id;"PlayNext"===msg.Data.PlayCommand?playbackManager.queueNext({ids:msg.Data.ItemIds,serverId:serverId}):"PlayLast"===msg.Data.PlayCommand?playbackManager.queue({ids:msg.Data.ItemIds,serverId:serverId}):playbackManager.play({ids:msg.Data.ItemIds,startPositionTicks:msg.Data.StartPositionTicks,serverId:serverId})}else if("Playstate"===msg.MessageType)"Stop"===msg.Data.Command?inputManager.trigger("stop"):"Pause"===msg.Data.Command?inputManager.trigger("pause"):"Unpause"===msg.Data.Command?inputManager.trigger("play"):"Seek"===msg.Data.Command?playbackManager.seek(msg.Data.SeekPositionTicks):"NextTrack"===msg.Data.Command?inputManager.trigger("next"):"PreviousTrack"===msg.Data.Command?inputManager.trigger("previous"):notifyApp();else if("GeneralCommand"===msg.MessageType){var cmd=msg.Data;processGeneralCommand(cmd,apiClient)}}function bindEvents(apiClient){events.off(apiClient,"websocketmessage",onWebSocketMessageReceived),events.on(apiClient,"websocketmessage",onWebSocketMessageReceived)}connectionManager.getApiClients().forEach(bindEvents),events.on(connectionManager,"apiclientcreated",function(e,newApiClient){bindEvents(newApiClient)})});
|
File diff suppressed because one or more lines are too long
|
@ -1,113 +1 @@
|
|||
define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'dom'], function (inputmanager, focusManager, browser, layoutManager, events, dom) {
|
||||
'use strict';
|
||||
|
||||
var self = {};
|
||||
|
||||
var lastMouseInputTime = new Date().getTime();
|
||||
var isMouseIdle;
|
||||
|
||||
function mouseIdleTime() {
|
||||
return new Date().getTime() - lastMouseInputTime;
|
||||
}
|
||||
|
||||
function notifyApp() {
|
||||
|
||||
inputmanager.notifyMouseMove();
|
||||
}
|
||||
|
||||
var lastMouseMoveData;
|
||||
dom.addEventListener(document, 'mousemove', function (e) {
|
||||
|
||||
var eventX = e.screenX;
|
||||
var eventY = e.screenY;
|
||||
|
||||
// if coord don't exist how could it move
|
||||
if (typeof eventX === "undefined" && typeof eventY === "undefined") {
|
||||
return;
|
||||
}
|
||||
|
||||
var obj = lastMouseMoveData;
|
||||
if (!obj) {
|
||||
lastMouseMoveData = {
|
||||
x: eventX,
|
||||
y: eventY
|
||||
};
|
||||
return;
|
||||
}
|
||||
|
||||
// if coord are same, it didn't move
|
||||
if (Math.abs(eventX - obj.x) < 10 && Math.abs(eventY - obj.y) < 10) {
|
||||
return;
|
||||
}
|
||||
|
||||
obj.x = eventX;
|
||||
obj.y = eventY;
|
||||
|
||||
lastMouseInputTime = new Date().getTime();
|
||||
notifyApp();
|
||||
|
||||
if (isMouseIdle) {
|
||||
isMouseIdle = false;
|
||||
document.body.classList.remove('mouseIdle');
|
||||
events.trigger(self, 'mouseactive');
|
||||
}
|
||||
}, {
|
||||
passive: true
|
||||
});
|
||||
|
||||
function onMouseEnter(e) {
|
||||
|
||||
var parent = focusManager.focusableParent(e.target);
|
||||
if (parent) {
|
||||
focusManager.focus(e.target);
|
||||
}
|
||||
}
|
||||
|
||||
function enableFocusWithMouse() {
|
||||
|
||||
if (!layoutManager.tv) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (browser.xboxOne) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (browser.tv) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function initMouseFocus() {
|
||||
|
||||
dom.removeEventListener(document, 'mouseenter', onMouseEnter, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
|
||||
if (enableFocusWithMouse()) {
|
||||
dom.addEventListener(document, 'mouseenter', onMouseEnter, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
initMouseFocus();
|
||||
|
||||
events.on(layoutManager, 'modechange', initMouseFocus);
|
||||
|
||||
setInterval(function () {
|
||||
|
||||
if (mouseIdleTime() >= 5000) {
|
||||
isMouseIdle = true;
|
||||
document.body.classList.add('mouseIdle');
|
||||
events.trigger(self, 'mouseidle');
|
||||
}
|
||||
|
||||
}, 5000);
|
||||
|
||||
return self;
|
||||
});
|
||||
define(["inputManager","focusManager","browser","layoutManager","events","dom"],function(inputmanager,focusManager,browser,layoutManager,events,dom){"use strict";function mouseIdleTime(){return(new Date).getTime()-lastMouseInputTime}function notifyApp(){inputmanager.notifyMouseMove()}function onMouseEnter(e){var parent=focusManager.focusableParent(e.target);parent&&focusManager.focus(e.target)}function enableFocusWithMouse(){return!!layoutManager.tv&&(!!browser.xboxOne||!!browser.tv)}function initMouseFocus(){dom.removeEventListener(document,"mouseenter",onMouseEnter,{capture:!0,passive:!0}),enableFocusWithMouse()&&dom.addEventListener(document,"mouseenter",onMouseEnter,{capture:!0,passive:!0})}var isMouseIdle,lastMouseMoveData,self={},lastMouseInputTime=(new Date).getTime();return dom.addEventListener(document,"mousemove",function(e){var eventX=e.screenX,eventY=e.screenY;if("undefined"!=typeof eventX||"undefined"!=typeof eventY){var obj=lastMouseMoveData;return obj?void(Math.abs(eventX-obj.x)<10&&Math.abs(eventY-obj.y)<10||(obj.x=eventX,obj.y=eventY,lastMouseInputTime=(new Date).getTime(),notifyApp(),isMouseIdle&&(isMouseIdle=!1,document.body.classList.remove("mouseIdle"),events.trigger(self,"mouseactive")))):void(lastMouseMoveData={x:eventX,y:eventY})}},{passive:!0}),initMouseFocus(),events.on(layoutManager,"modechange",initMouseFocus),setInterval(function(){mouseIdleTime()>=5e3&&(isMouseIdle=!0,document.body.classList.add("mouseIdle"),events.trigger(self,"mouseidle"))},5e3),self});
|
|
@ -1,254 +1 @@
|
|||
define(['playbackManager', 'focusManager', 'embyRouter', 'dom'], function (playbackManager, focusManager, embyRouter, dom) {
|
||||
'use strict';
|
||||
|
||||
var lastInputTime = new Date().getTime();
|
||||
|
||||
function notify() {
|
||||
lastInputTime = new Date().getTime();
|
||||
|
||||
handleCommand('unknown');
|
||||
}
|
||||
|
||||
function notifyMouseMove() {
|
||||
lastInputTime = new Date().getTime();
|
||||
}
|
||||
|
||||
function idleTime() {
|
||||
return new Date().getTime() - lastInputTime;
|
||||
}
|
||||
|
||||
function select(sourceElement) {
|
||||
|
||||
sourceElement.click();
|
||||
}
|
||||
|
||||
var eventListenerCount = 0;
|
||||
function on(scope, fn) {
|
||||
eventListenerCount++;
|
||||
scope.addEventListener('command', fn);
|
||||
}
|
||||
|
||||
function off(scope, fn) {
|
||||
|
||||
if (eventListenerCount) {
|
||||
eventListenerCount--;
|
||||
}
|
||||
|
||||
scope.removeEventListener('command', fn);
|
||||
}
|
||||
|
||||
var commandTimes = {};
|
||||
|
||||
function checkCommandTime(command) {
|
||||
|
||||
var last = commandTimes[command] || 0;
|
||||
var now = new Date().getTime();
|
||||
|
||||
if ((now - last) < 1000) {
|
||||
return false;
|
||||
}
|
||||
|
||||
commandTimes[command] = now;
|
||||
return true;
|
||||
}
|
||||
|
||||
function handleCommand(name, options) {
|
||||
|
||||
lastInputTime = new Date().getTime();
|
||||
|
||||
var sourceElement = (options ? options.sourceElement : null);
|
||||
|
||||
if (sourceElement) {
|
||||
sourceElement = focusManager.focusableParent(sourceElement);
|
||||
}
|
||||
|
||||
sourceElement = sourceElement || document.activeElement || window;
|
||||
|
||||
if (eventListenerCount) {
|
||||
var customEvent = new CustomEvent("command", {
|
||||
detail: {
|
||||
command: name
|
||||
},
|
||||
bubbles: true,
|
||||
cancelable: true
|
||||
});
|
||||
|
||||
var eventResult = sourceElement.dispatchEvent(customEvent);
|
||||
if (!eventResult) {
|
||||
// event cancelled
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
switch (name) {
|
||||
|
||||
case 'up':
|
||||
focusManager.moveUp(sourceElement);
|
||||
break;
|
||||
case 'down':
|
||||
focusManager.moveDown(sourceElement);
|
||||
break;
|
||||
case 'left':
|
||||
focusManager.moveLeft(sourceElement);
|
||||
break;
|
||||
case 'right':
|
||||
focusManager.moveRight(sourceElement);
|
||||
break;
|
||||
case 'home':
|
||||
embyRouter.goHome();
|
||||
break;
|
||||
case 'settings':
|
||||
embyRouter.showSettings();
|
||||
break;
|
||||
case 'back':
|
||||
embyRouter.back();
|
||||
break;
|
||||
case 'forward':
|
||||
// TODO
|
||||
break;
|
||||
case 'select':
|
||||
select(sourceElement);
|
||||
break;
|
||||
case 'pageup':
|
||||
// TODO
|
||||
break;
|
||||
case 'pagedown':
|
||||
// TODO
|
||||
break;
|
||||
case 'end':
|
||||
// TODO
|
||||
break;
|
||||
case 'menu':
|
||||
case 'info':
|
||||
// TODO
|
||||
break;
|
||||
case 'next':
|
||||
if (playbackManager.isPlaying()) {
|
||||
playbackManager.nextChapter();
|
||||
}
|
||||
break;
|
||||
case 'previous':
|
||||
|
||||
if (playbackManager.isPlaying()) {
|
||||
playbackManager.previousChapter();
|
||||
}
|
||||
break;
|
||||
case 'guide':
|
||||
embyRouter.showGuide();
|
||||
break;
|
||||
case 'recordedtv':
|
||||
embyRouter.showRecordedTV();
|
||||
break;
|
||||
case 'record':
|
||||
// TODO
|
||||
break;
|
||||
case 'livetv':
|
||||
embyRouter.showLiveTV();
|
||||
break;
|
||||
case 'mute':
|
||||
playbackManager.setMute(true);
|
||||
break;
|
||||
case 'unmute':
|
||||
playbackManager.setMute(false);
|
||||
break;
|
||||
case 'togglemute':
|
||||
playbackManager.toggleMute();
|
||||
break;
|
||||
case 'channelup':
|
||||
playbackManager.nextTrack();
|
||||
break;
|
||||
case 'channeldown':
|
||||
playbackManager.previousTrack();
|
||||
break;
|
||||
case 'volumedown':
|
||||
playbackManager.volumeDown();
|
||||
break;
|
||||
case 'volumeup':
|
||||
playbackManager.volumeUp();
|
||||
break;
|
||||
case 'play':
|
||||
playbackManager.unpause();
|
||||
break;
|
||||
case 'pause':
|
||||
playbackManager.pause();
|
||||
break;
|
||||
case 'playpause':
|
||||
playbackManager.playPause();
|
||||
break;
|
||||
case 'stop':
|
||||
if (checkCommandTime('stop')) {
|
||||
playbackManager.stop();
|
||||
}
|
||||
break;
|
||||
case 'changezoom':
|
||||
// TODO
|
||||
break;
|
||||
case 'changeaudiotrack':
|
||||
// TODO
|
||||
break;
|
||||
case 'changesubtitletrack':
|
||||
break;
|
||||
case 'search':
|
||||
embyRouter.showSearch();
|
||||
break;
|
||||
case 'favorites':
|
||||
embyRouter.showFavorites();
|
||||
break;
|
||||
case 'fastforward':
|
||||
playbackManager.fastForward();
|
||||
break;
|
||||
case 'rewind':
|
||||
playbackManager.rewind();
|
||||
break;
|
||||
case 'togglefullscreen':
|
||||
// TODO
|
||||
break;
|
||||
case 'disabledisplaymirror':
|
||||
playbackManager.enableDisplayMirroring(false);
|
||||
break;
|
||||
case 'enabledisplaymirror':
|
||||
playbackManager.enableDisplayMirroring(true);
|
||||
break;
|
||||
case 'toggledisplaymirror':
|
||||
playbackManager.toggleDisplayMirroring();
|
||||
break;
|
||||
case 'movies':
|
||||
// TODO
|
||||
break;
|
||||
case 'music':
|
||||
// TODO
|
||||
break;
|
||||
case 'tv':
|
||||
// TODO
|
||||
break;
|
||||
case 'latestepisodes':
|
||||
// TODO
|
||||
break;
|
||||
case 'nowplaying':
|
||||
// TODO
|
||||
break;
|
||||
case 'upcomingtv':
|
||||
// TODO
|
||||
break;
|
||||
case 'nextup':
|
||||
// TODO
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
dom.addEventListener(document, 'click', notify, {
|
||||
passive: true
|
||||
});
|
||||
|
||||
return {
|
||||
trigger: handleCommand,
|
||||
handle: handleCommand,
|
||||
notify: notify,
|
||||
notifyMouseMove: notifyMouseMove,
|
||||
idleTime: idleTime,
|
||||
on: on,
|
||||
off: off
|
||||
};
|
||||
});
|
||||
define(["playbackManager","focusManager","embyRouter","dom"],function(playbackManager,focusManager,embyRouter,dom){"use strict";function notify(){lastInputTime=(new Date).getTime(),handleCommand("unknown")}function notifyMouseMove(){lastInputTime=(new Date).getTime()}function idleTime(){return(new Date).getTime()-lastInputTime}function select(sourceElement){sourceElement.click()}function on(scope,fn){eventListenerCount++,scope.addEventListener("command",fn)}function off(scope,fn){eventListenerCount&&eventListenerCount--,scope.removeEventListener("command",fn)}function checkCommandTime(command){var last=commandTimes[command]||0,now=(new Date).getTime();return!(now-last<1e3)&&(commandTimes[command]=now,!0)}function handleCommand(name,options){lastInputTime=(new Date).getTime();var sourceElement=options?options.sourceElement:null;if(sourceElement&&(sourceElement=focusManager.focusableParent(sourceElement)),sourceElement=sourceElement||document.activeElement||window,eventListenerCount){var customEvent=new CustomEvent("command",{detail:{command:name},bubbles:!0,cancelable:!0}),eventResult=sourceElement.dispatchEvent(customEvent);if(!eventResult)return}switch(name){case"up":focusManager.moveUp(sourceElement);break;case"down":focusManager.moveDown(sourceElement);break;case"left":focusManager.moveLeft(sourceElement);break;case"right":focusManager.moveRight(sourceElement);break;case"home":embyRouter.goHome();break;case"settings":embyRouter.showSettings();break;case"back":embyRouter.back();break;case"forward":break;case"select":select(sourceElement);break;case"pageup":break;case"pagedown":break;case"end":break;case"menu":case"info":break;case"next":playbackManager.isPlaying()&&playbackManager.nextChapter();break;case"previous":playbackManager.isPlaying()&&playbackManager.previousChapter();break;case"guide":embyRouter.showGuide();break;case"recordedtv":embyRouter.showRecordedTV();break;case"record":break;case"livetv":embyRouter.showLiveTV();break;case"mute":playbackManager.setMute(!0);break;case"unmute":playbackManager.setMute(!1);break;case"togglemute":playbackManager.toggleMute();break;case"channelup":playbackManager.nextTrack();break;case"channeldown":playbackManager.previousTrack();break;case"volumedown":playbackManager.volumeDown();break;case"volumeup":playbackManager.volumeUp();break;case"play":playbackManager.unpause();break;case"pause":playbackManager.pause();break;case"playpause":playbackManager.playPause();break;case"stop":checkCommandTime("stop")&&playbackManager.stop();break;case"changezoom":break;case"changeaudiotrack":break;case"changesubtitletrack":break;case"search":embyRouter.showSearch();break;case"favorites":embyRouter.showFavorites();break;case"fastforward":playbackManager.fastForward();break;case"rewind":playbackManager.rewind();break;case"togglefullscreen":break;case"disabledisplaymirror":playbackManager.enableDisplayMirroring(!1);break;case"enabledisplaymirror":playbackManager.enableDisplayMirroring(!0);break;case"toggledisplaymirror":playbackManager.toggleDisplayMirroring();break;case"movies":break;case"music":break;case"tv":break;case"latestepisodes":break;case"nowplaying":break;case"upcomingtv":break;case"nextup":}}var lastInputTime=(new Date).getTime(),eventListenerCount=0,commandTimes={};return dom.addEventListener(document,"click",notify,{passive:!0}),{trigger:handleCommand,handle:handleCommand,notify:notify,notifyMouseMove:notifyMouseMove,idleTime:idleTime,on:on,off:off}});
|
File diff suppressed because one or more lines are too long
|
@ -1,209 +1 @@
|
|||
define(['apphost'], function (appHost) {
|
||||
'use strict';
|
||||
|
||||
function getDisplayName(item, options) {
|
||||
|
||||
if (!item) {
|
||||
throw new Error("null item passed into getDisplayName");
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
|
||||
if (item.Type === 'Timer') {
|
||||
item = item.ProgramInfo || item;
|
||||
}
|
||||
|
||||
var name = ((item.Type === 'Program' || item.Type === 'Recording') && (item.IsSeries || item.EpisodeTitle) ? item.EpisodeTitle : item.Name) || '';
|
||||
|
||||
if (item.Type === "TvChannel") {
|
||||
|
||||
if (item.Number) {
|
||||
return item.Number + ' ' + name;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
if (/*options.isInlineSpecial &&*/ item.Type === "Episode" && item.ParentIndexNumber === 0) {
|
||||
|
||||
name = Globalize.translate('sharedcomponents#ValueSpecialEpisodeName', name);
|
||||
|
||||
} else if ((item.Type === "Episode" || item.Type === 'Program') && item.IndexNumber != null && item.ParentIndexNumber != null) {
|
||||
|
||||
var displayIndexNumber = item.IndexNumber;
|
||||
|
||||
var number = displayIndexNumber;
|
||||
|
||||
if (options.includeParentInfo !== false) {
|
||||
number = "S" + item.ParentIndexNumber + ", E" + number;
|
||||
}
|
||||
|
||||
if (item.IndexNumberEnd) {
|
||||
|
||||
displayIndexNumber = item.IndexNumberEnd;
|
||||
number += "-" + displayIndexNumber;
|
||||
}
|
||||
|
||||
name = name ? (number + " - " + name) : number;
|
||||
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
function supportsAddingToCollection(item) {
|
||||
|
||||
if (item.Type === 'Timer' || item.Type === 'SeriesTimer') {
|
||||
return false;
|
||||
}
|
||||
|
||||
var invalidTypes = ['Person', 'Genre', 'MusicGenre', 'Studio', 'GameGenre', 'BoxSet', 'Playlist', 'UserView', 'CollectionFolder', 'Audio', 'TvChannel', 'Program', 'MusicAlbum', 'Timer'];
|
||||
|
||||
if (item.Type === 'Recording') {
|
||||
if (item.Status !== 'Completed') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return !item.CollectionType && invalidTypes.indexOf(item.Type) === -1 && item.MediaType !== 'Photo';
|
||||
}
|
||||
|
||||
function supportsAddingToPlaylist(item) {
|
||||
|
||||
if (item.Type === 'Program') {
|
||||
return false;
|
||||
}
|
||||
if (item.Type === 'TvChannel') {
|
||||
return false;
|
||||
}
|
||||
if (item.Type === 'Timer') {
|
||||
return false;
|
||||
}
|
||||
if (item.Type === 'SeriesTimer') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (item.Type === 'Recording') {
|
||||
if (item.Status !== 'Completed') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return item.MediaType || item.IsFolder || item.Type === "Genre" || item.Type === "MusicGenre" || item.Type === "MusicArtist";
|
||||
}
|
||||
|
||||
function canEdit(user, item) {
|
||||
|
||||
var itemType = item.Type;
|
||||
|
||||
if (itemType === "UserRootFolder" || /*itemType == "CollectionFolder" ||*/ itemType === "UserView") {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (itemType === 'Program') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (item.Type === 'Recording') {
|
||||
if (item.Status !== 'Completed') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return user.Policy.IsAdministrator;
|
||||
}
|
||||
|
||||
function isLocalItem(item) {
|
||||
|
||||
if (item && item.Id && item.Id.indexOf('local') === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return {
|
||||
getDisplayName: getDisplayName,
|
||||
supportsAddingToCollection: supportsAddingToCollection,
|
||||
supportsAddingToPlaylist: supportsAddingToPlaylist,
|
||||
isLocalItem: isLocalItem,
|
||||
|
||||
canIdentify: function (user, itemType) {
|
||||
|
||||
if (itemType === "Movie" ||
|
||||
itemType === "Trailer" ||
|
||||
itemType === "Series" ||
|
||||
itemType === "Game" ||
|
||||
itemType === "BoxSet" ||
|
||||
itemType === "Person" ||
|
||||
itemType === "Book" ||
|
||||
itemType === "MusicAlbum" ||
|
||||
itemType === "MusicArtist") {
|
||||
|
||||
if (user.Policy.IsAdministrator) {
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
canEdit: canEdit,
|
||||
|
||||
canEditImages: function (user, item) {
|
||||
|
||||
var itemType = item.Type;
|
||||
|
||||
if (itemType === 'UserView') {
|
||||
if (user.Policy.IsAdministrator) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (item.Type === 'Recording') {
|
||||
if (item.Status !== 'Completed') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return itemType !== 'Timer' && itemType !== 'SeriesTimer' && canEdit(user, item);
|
||||
},
|
||||
|
||||
canSync: function (user, item) {
|
||||
|
||||
if (user && !user.Policy.EnableSync) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return item.SupportsSync;
|
||||
},
|
||||
|
||||
canShare: function (user, item) {
|
||||
|
||||
if (item.Type === 'Program') {
|
||||
return false;
|
||||
}
|
||||
if (item.Type === 'TvChannel') {
|
||||
return false;
|
||||
}
|
||||
if (item.Type === 'Timer') {
|
||||
return false;
|
||||
}
|
||||
if (item.Type === 'SeriesTimer') {
|
||||
return false;
|
||||
}
|
||||
if (item.Type === 'Recording') {
|
||||
if (item.Status !== 'Completed') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return user.Policy.EnablePublicSharing && appHost.supports('sharing');
|
||||
},
|
||||
|
||||
enableDateAddedDisplay: function(item) {
|
||||
return !item.IsFolder && item.MediaType && item.Type !== 'Program' && item.Type !== 'TvChannel' && item.Type !== 'Trailer';
|
||||
}
|
||||
};
|
||||
});
|
||||
define(["apphost"],function(appHost){"use strict";function getDisplayName(item,options){if(!item)throw new Error("null item passed into getDisplayName");options=options||{},"Timer"===item.Type&&(item=item.ProgramInfo||item);var name=("Program"!==item.Type&&"Recording"!==item.Type||!item.IsSeries&&!item.EpisodeTitle?item.Name:item.EpisodeTitle)||"";if("TvChannel"===item.Type)return item.Number?item.Number+" "+name:name;if("Episode"===item.Type&&0===item.ParentIndexNumber)name=Globalize.translate("sharedcomponents#ValueSpecialEpisodeName",name);else if(("Episode"===item.Type||"Program"===item.Type)&&null!=item.IndexNumber&&null!=item.ParentIndexNumber){var displayIndexNumber=item.IndexNumber,number=displayIndexNumber;options.includeParentInfo!==!1&&(number="S"+item.ParentIndexNumber+", E"+number),item.IndexNumberEnd&&(displayIndexNumber=item.IndexNumberEnd,number+="-"+displayIndexNumber),name=name?number+" - "+name:number}return name}function supportsAddingToCollection(item){if("Timer"===item.Type||"SeriesTimer"===item.Type)return!1;var invalidTypes=["Person","Genre","MusicGenre","Studio","GameGenre","BoxSet","Playlist","UserView","CollectionFolder","Audio","TvChannel","Program","MusicAlbum","Timer"];return("Recording"!==item.Type||"Completed"===item.Status)&&(!item.CollectionType&&invalidTypes.indexOf(item.Type)===-1&&"Photo"!==item.MediaType)}function supportsAddingToPlaylist(item){return"Program"!==item.Type&&("TvChannel"!==item.Type&&("Timer"!==item.Type&&("SeriesTimer"!==item.Type&&(("Recording"!==item.Type||"Completed"===item.Status)&&(item.MediaType||item.IsFolder||"Genre"===item.Type||"MusicGenre"===item.Type||"MusicArtist"===item.Type)))))}function canEdit(user,item){var itemType=item.Type;return"UserRootFolder"!==itemType&&"UserView"!==itemType&&("Program"!==itemType&&(("Recording"!==item.Type||"Completed"===item.Status)&&user.Policy.IsAdministrator))}function isLocalItem(item){return!(!item||!item.Id||0!==item.Id.indexOf("local"))}return{getDisplayName:getDisplayName,supportsAddingToCollection:supportsAddingToCollection,supportsAddingToPlaylist:supportsAddingToPlaylist,isLocalItem:isLocalItem,canIdentify:function(user,itemType){return!("Movie"!==itemType&&"Trailer"!==itemType&&"Series"!==itemType&&"Game"!==itemType&&"BoxSet"!==itemType&&"Person"!==itemType&&"Book"!==itemType&&"MusicAlbum"!==itemType&&"MusicArtist"!==itemType||!user.Policy.IsAdministrator)},canEdit:canEdit,canEditImages:function(user,item){var itemType=item.Type;return"UserView"===itemType?!!user.Policy.IsAdministrator:("Recording"!==item.Type||"Completed"===item.Status)&&("Timer"!==itemType&&"SeriesTimer"!==itemType&&canEdit(user,item))},canSync:function(user,item){return!(user&&!user.Policy.EnableSync)&&item.SupportsSync},canShare:function(user,item){return"Program"!==item.Type&&("TvChannel"!==item.Type&&("Timer"!==item.Type&&("SeriesTimer"!==item.Type&&(("Recording"!==item.Type||"Completed"===item.Status)&&(user.Policy.EnablePublicSharing&&appHost.supports("sharing"))))))},enableDateAddedDisplay:function(item){return!item.IsFolder&&item.MediaType&&"Program"!==item.Type&&"TvChannel"!==item.Type&&"Trailer"!==item.Type}}});
|
|
@ -1,49 +1 @@
|
|||
.cardOverlayTarget {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
background-color: rgba(0, 0, 0, .85);
|
||||
/* Just enough to cover poster overlay buttons */
|
||||
z-index: 1;
|
||||
line-height: initial;
|
||||
font-size: initial;
|
||||
}
|
||||
|
||||
.cardOverlayInner {
|
||||
padding: .5em;
|
||||
color: #fff;
|
||||
text-align: left;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
.cardOverlayMediaInfo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
margin: 1em 0;
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.cardOverlayButtons {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.cardOverlayFab {
|
||||
margin-right: .25em !important;
|
||||
}
|
||||
|
||||
.withHoverMenu {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@media all and (max-width: 1200px) {
|
||||
|
||||
.cardOverlayInner {
|
||||
padding-left: 7px;
|
||||
padding-right: 7px;
|
||||
}
|
||||
}
|
||||
.cardOverlayTarget{position:absolute;right:0;left:0;bottom:0;top:0;background-color:rgba(0,0,0,.85);z-index:1;line-height:initial;font-size:initial}.cardOverlayInner{padding:.5em;color:#fff;text-align:left;font-size:90%}.cardOverlayMediaInfo{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-flex-wrap:wrap;flex-wrap:wrap;margin:1em 0;color:#ddd}.cardOverlayButtons{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-flex-wrap:wrap;flex-wrap:wrap}.cardOverlayFab{margin-right:.25em!important}.withHoverMenu{overflow:hidden}@media all and (max-width:1200px){.cardOverlayInner{padding-left:7px;padding-right:7px}}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,68 +1 @@
|
|||
define(['browser', 'appSettings', 'events'], function (browser, appSettings, events) {
|
||||
'use strict';
|
||||
|
||||
function setLayout(self, layout, selectedLayout) {
|
||||
|
||||
if (layout === selectedLayout) {
|
||||
self[layout] = true;
|
||||
document.documentElement.classList.add('layout-' + layout);
|
||||
} else {
|
||||
self[layout] = false;
|
||||
document.documentElement.classList.remove('layout-' + layout);
|
||||
}
|
||||
}
|
||||
|
||||
function LayoutManager() {
|
||||
|
||||
var self = this;
|
||||
|
||||
self.setLayout = function (layout, save) {
|
||||
|
||||
if (!layout || layout === 'auto') {
|
||||
self.autoLayout();
|
||||
|
||||
if (save !== false) {
|
||||
appSettings.set('layout', '');
|
||||
}
|
||||
} else {
|
||||
setLayout(self, 'mobile', layout);
|
||||
setLayout(self, 'tv', layout);
|
||||
setLayout(self, 'desktop', layout);
|
||||
|
||||
if (save !== false) {
|
||||
appSettings.set('layout', layout);
|
||||
}
|
||||
}
|
||||
|
||||
events.trigger(self, 'modechange');
|
||||
};
|
||||
|
||||
self.getSavedLayout = function (layout) {
|
||||
|
||||
return appSettings.get('layout');
|
||||
};
|
||||
|
||||
self.autoLayout = function () {
|
||||
|
||||
// Take a guess at initial layout. The consuming app can override
|
||||
if (browser.mobile) {
|
||||
self.setLayout('mobile', false);
|
||||
} else if (browser.tv || browser.xboxOne) {
|
||||
self.setLayout('tv', false);
|
||||
} else {
|
||||
self.setLayout(self.undetectedAutoLayout || 'desktop', false);
|
||||
}
|
||||
};
|
||||
|
||||
self.init = function () {
|
||||
var saved = self.getSavedLayout();
|
||||
if (saved) {
|
||||
self.setLayout(saved, false);
|
||||
} else {
|
||||
self.autoLayout();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return new LayoutManager();
|
||||
});
|
||||
define(["browser","appSettings","events"],function(browser,appSettings,events){"use strict";function setLayout(self,layout,selectedLayout){layout===selectedLayout?(self[layout]=!0,document.documentElement.classList.add("layout-"+layout)):(self[layout]=!1,document.documentElement.classList.remove("layout-"+layout))}function LayoutManager(){var self=this;self.setLayout=function(layout,save){layout&&"auto"!==layout?(setLayout(self,"mobile",layout),setLayout(self,"tv",layout),setLayout(self,"desktop",layout),save!==!1&&appSettings.set("layout",layout)):(self.autoLayout(),save!==!1&&appSettings.set("layout","")),events.trigger(self,"modechange")},self.getSavedLayout=function(layout){return appSettings.get("layout")},self.autoLayout=function(){browser.mobile?self.setLayout("mobile",!1):browser.tv||browser.xboxOne?self.setLayout("tv",!1):self.setLayout(self.undetectedAutoLayout||"desktop",!1)},self.init=function(){var saved=self.getSavedLayout();saved?self.setLayout(saved,!1):self.autoLayout()}}return new LayoutManager});
|
|
@ -1,94 +1 @@
|
|||
define([], function () {
|
||||
'use strict';
|
||||
|
||||
function LazyLoader(options) {
|
||||
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
LazyLoader.prototype.createObserver = function () {
|
||||
|
||||
var observerOptions = {};
|
||||
var options = this.options;
|
||||
var loadedCount = 0;
|
||||
var callback = options.callback;
|
||||
|
||||
//options.rootMargin = "300%";
|
||||
|
||||
var observerId = 'obs' + new Date().getTime();
|
||||
|
||||
var self = this;
|
||||
var observer = new IntersectionObserver(function (entries) {
|
||||
for (var j = 0, length2 = entries.length; j < length2; j++) {
|
||||
var entry = entries[j];
|
||||
var target = entry.target;
|
||||
|
||||
observer.unobserve(target);
|
||||
|
||||
if (!target[observerId]) {
|
||||
target[observerId] = 1;
|
||||
callback(target);
|
||||
loadedCount++;
|
||||
|
||||
if (loadedCount >= self.elementCount) {
|
||||
self.destroyObserver();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
observerOptions
|
||||
);
|
||||
|
||||
this.observer = observer;
|
||||
};
|
||||
|
||||
LazyLoader.prototype.addElements = function (elements) {
|
||||
|
||||
var observer = this.observer;
|
||||
|
||||
if (!observer) {
|
||||
this.createObserver();
|
||||
observer = this.observer;
|
||||
}
|
||||
|
||||
this.elementCount = (this.elementCount || 0) + elements.length;
|
||||
|
||||
for (var i = 0, length = elements.length; i < length; i++) {
|
||||
observer.observe(elements[i]);
|
||||
}
|
||||
};
|
||||
|
||||
LazyLoader.prototype.destroyObserver = function (elements) {
|
||||
|
||||
var observer = this.observer;
|
||||
|
||||
if (observer) {
|
||||
observer.disconnect();
|
||||
this.observer = null;
|
||||
}
|
||||
};
|
||||
|
||||
LazyLoader.prototype.destroy = function (elements) {
|
||||
|
||||
this.destroyObserver();
|
||||
this.options = null;
|
||||
};
|
||||
|
||||
function unveilElements(elements, root, callback) {
|
||||
|
||||
if (!elements.length) {
|
||||
return;
|
||||
}
|
||||
var lazyLoader = new LazyLoader({
|
||||
callback: callback
|
||||
});
|
||||
lazyLoader.addElements(elements);
|
||||
}
|
||||
|
||||
LazyLoader.lazyChildren = function (elem, callback) {
|
||||
|
||||
unveilElements(elem.getElementsByClassName('lazy'), elem, callback);
|
||||
};
|
||||
|
||||
return LazyLoader;
|
||||
});
|
||||
define([],function(){"use strict";function LazyLoader(options){this.options=options}function unveilElements(elements,root,callback){if(elements.length){var lazyLoader=new LazyLoader({callback:callback});lazyLoader.addElements(elements)}}return LazyLoader.prototype.createObserver=function(){var observerOptions={},options=this.options,loadedCount=0,callback=options.callback,observerId="obs"+(new Date).getTime(),self=this,observer=new IntersectionObserver(function(entries){for(var j=0,length2=entries.length;j<length2;j++){var entry=entries[j],target=entry.target;observer.unobserve(target),target[observerId]||(target[observerId]=1,callback(target),loadedCount++,loadedCount>=self.elementCount&&self.destroyObserver())}},observerOptions);this.observer=observer},LazyLoader.prototype.addElements=function(elements){var observer=this.observer;observer||(this.createObserver(),observer=this.observer),this.elementCount=(this.elementCount||0)+elements.length;for(var i=0,length=elements.length;i<length;i++)observer.observe(elements[i])},LazyLoader.prototype.destroyObserver=function(elements){var observer=this.observer;observer&&(observer.disconnect(),this.observer=null)},LazyLoader.prototype.destroy=function(elements){this.destroyObserver(),this.options=null},LazyLoader.lazyChildren=function(elem,callback){unveilElements(elem.getElementsByClassName("lazy"),elem,callback)},LazyLoader});
|
|
@ -1,185 +1 @@
|
|||
define(['visibleinviewport', 'browser', 'dom'], function (visibleinviewport, browser, dom) {
|
||||
'use strict';
|
||||
|
||||
var thresholdX;
|
||||
var thresholdY;
|
||||
|
||||
var requestIdleCallback = window.requestIdleCallback || function (fn) {
|
||||
fn();
|
||||
};
|
||||
|
||||
function resetThresholds() {
|
||||
|
||||
var x = screen.availWidth;
|
||||
var y = screen.availHeight;
|
||||
|
||||
if (browser.touch) {
|
||||
x *= 1.5;
|
||||
y *= 1.5;
|
||||
}
|
||||
|
||||
thresholdX = x;
|
||||
thresholdY = y;
|
||||
}
|
||||
|
||||
dom.addEventListener(window, "orientationchange", resetThresholds, { passive: true });
|
||||
dom.addEventListener(window, 'resize', resetThresholds, { passive: true });
|
||||
resetThresholds();
|
||||
|
||||
function isVisible(elem) {
|
||||
return visibleinviewport(elem, true, thresholdX, thresholdY);
|
||||
}
|
||||
|
||||
var wheelEvent = (document.implementation.hasFeature('Event.wheel', '3.0') ? 'wheel' : 'mousewheel');
|
||||
var self = {};
|
||||
|
||||
function cancelAll(tokens) {
|
||||
for (var i = 0, length = tokens.length; i < length; i++) {
|
||||
|
||||
tokens[i] = true;
|
||||
}
|
||||
}
|
||||
|
||||
function unveilElementsInternal(instance, callback) {
|
||||
|
||||
var unveiledElements = [];
|
||||
var cancellationTokens = [];
|
||||
var loadedCount = 0;
|
||||
|
||||
function unveilInternal(tokenIndex) {
|
||||
|
||||
var anyFound = false;
|
||||
var out = false;
|
||||
|
||||
var elements = instance.elements;
|
||||
// TODO: This out construct assumes left to right, top to bottom
|
||||
|
||||
for (var i = 0, length = elements.length; i < length; i++) {
|
||||
|
||||
if (cancellationTokens[tokenIndex]) {
|
||||
return;
|
||||
}
|
||||
if (unveiledElements[i]) {
|
||||
continue;
|
||||
}
|
||||
var elem = elements[i];
|
||||
if (!out && isVisible(elem)) {
|
||||
anyFound = true;
|
||||
unveiledElements[i] = true;
|
||||
callback(elem);
|
||||
loadedCount++;
|
||||
} else {
|
||||
|
||||
if (anyFound) {
|
||||
out = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (loadedCount >= elements.length) {
|
||||
dom.removeEventListener(document, 'focus', unveil, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
dom.removeEventListener(document, 'scroll', unveil, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
dom.removeEventListener(document, wheelEvent, unveil, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
dom.removeEventListener(window, 'resize', unveil, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function unveil() {
|
||||
|
||||
cancelAll(cancellationTokens);
|
||||
|
||||
var index = cancellationTokens.length;
|
||||
cancellationTokens.length++;
|
||||
|
||||
setTimeout(function () {
|
||||
unveilInternal(index);
|
||||
}, 1);
|
||||
}
|
||||
|
||||
dom.addEventListener(document, 'focus', unveil, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
dom.addEventListener(document, 'scroll', unveil, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
dom.addEventListener(document, wheelEvent, unveil, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
dom.addEventListener(window, 'resize', unveil, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
|
||||
unveil();
|
||||
}
|
||||
|
||||
function LazyLoader(options) {
|
||||
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
LazyLoader.prototype.createObserver = function () {
|
||||
|
||||
unveilElementsInternal(this, this.options.callback);
|
||||
this.observer = 1;
|
||||
};
|
||||
|
||||
LazyLoader.prototype.addElements = function (elements) {
|
||||
|
||||
this.elements = this.elements || [];
|
||||
|
||||
for (var i = 0, length = elements.length; i < length; i++) {
|
||||
this.elements.push(elements[i]);
|
||||
}
|
||||
|
||||
var observer = this.observer;
|
||||
|
||||
if (!observer) {
|
||||
this.createObserver();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
LazyLoader.prototype.destroyObserver = function (elements) {
|
||||
|
||||
};
|
||||
|
||||
LazyLoader.prototype.destroy = function (elements) {
|
||||
|
||||
this.destroyObserver();
|
||||
this.options = null;
|
||||
};
|
||||
|
||||
function unveilElements(elements, root, callback) {
|
||||
|
||||
if (!elements.length) {
|
||||
return;
|
||||
}
|
||||
var lazyLoader = new LazyLoader({
|
||||
callback: callback
|
||||
});
|
||||
lazyLoader.addElements(elements);
|
||||
}
|
||||
|
||||
LazyLoader.lazyChildren = function (elem, callback) {
|
||||
|
||||
unveilElements(elem.getElementsByClassName('lazy'), elem, callback);
|
||||
};
|
||||
|
||||
return LazyLoader;
|
||||
});
|
||||
define(["visibleinviewport","browser","dom"],function(visibleinviewport,browser,dom){"use strict";function resetThresholds(){var x=screen.availWidth,y=screen.availHeight;browser.touch&&(x*=1.5,y*=1.5),thresholdX=x,thresholdY=y}function isVisible(elem){return visibleinviewport(elem,!0,thresholdX,thresholdY)}function cancelAll(tokens){for(var i=0,length=tokens.length;i<length;i++)tokens[i]=!0}function unveilElementsInternal(instance,callback){function unveilInternal(tokenIndex){for(var anyFound=!1,out=!1,elements=instance.elements,i=0,length=elements.length;i<length;i++){if(cancellationTokens[tokenIndex])return;if(!unveiledElements[i]){var elem=elements[i];!out&&isVisible(elem)?(anyFound=!0,unveiledElements[i]=!0,callback(elem),loadedCount++):anyFound&&(out=!0)}}loadedCount>=elements.length&&(dom.removeEventListener(document,"focus",unveil,{capture:!0,passive:!0}),dom.removeEventListener(document,"scroll",unveil,{capture:!0,passive:!0}),dom.removeEventListener(document,wheelEvent,unveil,{capture:!0,passive:!0}),dom.removeEventListener(window,"resize",unveil,{capture:!0,passive:!0}))}function unveil(){cancelAll(cancellationTokens);var index=cancellationTokens.length;cancellationTokens.length++,setTimeout(function(){unveilInternal(index)},1)}var unveiledElements=[],cancellationTokens=[],loadedCount=0;dom.addEventListener(document,"focus",unveil,{capture:!0,passive:!0}),dom.addEventListener(document,"scroll",unveil,{capture:!0,passive:!0}),dom.addEventListener(document,wheelEvent,unveil,{capture:!0,passive:!0}),dom.addEventListener(window,"resize",unveil,{capture:!0,passive:!0}),unveil()}function LazyLoader(options){this.options=options}function unveilElements(elements,root,callback){if(elements.length){var lazyLoader=new LazyLoader({callback:callback});lazyLoader.addElements(elements)}}var thresholdX,thresholdY;window.requestIdleCallback||function(fn){fn()};dom.addEventListener(window,"orientationchange",resetThresholds,{passive:!0}),dom.addEventListener(window,"resize",resetThresholds,{passive:!0}),resetThresholds();var wheelEvent=document.implementation.hasFeature("Event.wheel","3.0")?"wheel":"mousewheel";return LazyLoader.prototype.createObserver=function(){unveilElementsInternal(this,this.options.callback),this.observer=1},LazyLoader.prototype.addElements=function(elements){this.elements=this.elements||[];for(var i=0,length=elements.length;i<length;i++)this.elements.push(elements[i]);var observer=this.observer;observer||this.createObserver()},LazyLoader.prototype.destroyObserver=function(elements){},LazyLoader.prototype.destroy=function(elements){this.destroyObserver(),this.options=null},LazyLoader.lazyChildren=function(elem,callback){unveilElements(elem.getElementsByClassName("lazy"),elem,callback)},LazyLoader});
|
|
@ -1,191 +1 @@
|
|||
.listItem {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
outline: none !important;
|
||||
color: inherit;
|
||||
vertical-align: middle;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
margin: 0;
|
||||
display: block;
|
||||
align-items: center;
|
||||
text-align: left;
|
||||
padding: .25em 1.15em;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.listItem-button {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.listItem-largeImage {
|
||||
padding: .5em !important;
|
||||
}
|
||||
|
||||
.listItemImage, .listItemIcon, .listItemAside {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.listItemBody, .listItemImage, .listItemIcon {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.listItemButton {
|
||||
margin: 0;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
flex-shrink: 0;
|
||||
contain: layout style;
|
||||
}
|
||||
|
||||
.listViewDragHandle {
|
||||
margin-left: -.25em !important;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
.listItemBody {
|
||||
flex-grow: 1;
|
||||
padding: .8em 1em;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
flex-direction: column;
|
||||
vertical-align: middle;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.listItemBody-noleftpadding {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.listItem-odd {
|
||||
}
|
||||
|
||||
.listItem-shaded:nth-child(even) {
|
||||
background: #1c1c1c;
|
||||
background: rgba(30, 30, 30, .9);
|
||||
}
|
||||
|
||||
.three-line {
|
||||
min-height: 6.3em;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.listItemBodyText {
|
||||
margin: 0;
|
||||
padding: .25em 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.listItemBodyText-nowrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.listItemImage {
|
||||
width: 7.4vh;
|
||||
height: 7.4vh;
|
||||
min-width: 40px;
|
||||
min-height: 40px;
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
flex-shrink: 0;
|
||||
background-position: center center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.listItemImage-large {
|
||||
width: 45vh;
|
||||
height: 30vh;
|
||||
background-position: center center;
|
||||
margin-right: 2%;
|
||||
margin-left: 1%;
|
||||
}
|
||||
|
||||
.listItemIcon {
|
||||
width: 1em !important;
|
||||
height: 1em !important;
|
||||
font-size: 143%;
|
||||
border-radius: 500px;
|
||||
padding: .5em;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.listItemIcon:not(.listItemIcon-transparent) {
|
||||
background-color: #52B54B;
|
||||
}
|
||||
|
||||
.listItemProgressBar {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.listItem .secondary {
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.listItem:focus .secondary {
|
||||
color: inherit !important;
|
||||
}
|
||||
|
||||
.listItem-focusscale {
|
||||
transition: transform .2s ease-out;
|
||||
}
|
||||
|
||||
.listItem-focusscale:focus {
|
||||
transform: scale(1.025, 1.025);
|
||||
}
|
||||
|
||||
.paperList {
|
||||
padding: .5em 0;
|
||||
margin: 1em auto;
|
||||
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.paperList-clear {
|
||||
box-shadow: none !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.listItemMediaInfo {
|
||||
/* Don't display if flex not supported */
|
||||
display: none;
|
||||
align-items: center;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
.listGroupHeader {
|
||||
margin: 2em 0 1em;
|
||||
}
|
||||
|
||||
.listGroupHeader-first {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.listItemIndicators {
|
||||
right: .5vh;
|
||||
top: .5vh;
|
||||
position: absolute;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.listItem, .listItemBody, .listItemMediaInfo {
|
||||
display: flex;
|
||||
contain: layout style;
|
||||
}
|
||||
|
||||
@media all and (max-width: 800px) {
|
||||
|
||||
.listItem .endsAt, .listItem .criticRating {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.listItemCheckboxContainer {
|
||||
width: auto !important;
|
||||
}
|
||||
.listItemBody,.listItemButton,.listItemIcon,.listItemImage{display:inline-block;vertical-align:middle}.listItem,.listItemBody,.listItemButton{vertical-align:middle}.listItemBody,.listItemBodyText{overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis}.listItem{background:0 0;border:0;outline:0!important;color:inherit;font-family:inherit;font-size:inherit;margin:0;-webkit-box-align:center;-webkit-align-items:center;align-items:center;text-align:left;padding:.25em 1.15em;cursor:pointer;overflow:hidden}.listItem-button{width:100%}.listItem-largeImage{padding:.5em!important}.listItemAside,.listItemIcon,.listItemImage{-webkit-flex-shrink:0;flex-shrink:0}.listItemButton{margin:0;-webkit-flex-shrink:0;flex-shrink:0;contain:layout style}.listViewDragHandle{margin-left:-.25em!important;touch-action:none}.listItemBody{-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;padding:.8em 1em;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.listItemBody-noleftpadding{padding-left:0}.listItem-shaded:nth-child(even){background:#1c1c1c;background:rgba(30,30,30,.9)}.three-line{min-height:6.3em;padding-top:0;padding-bottom:0}.listItemBodyText{margin:0;padding:.25em 0}.listItemBodyText-nowrap{white-space:nowrap}.listItemImage{width:7.4vh;height:7.4vh;min-width:40px;min-height:40px;background-repeat:no-repeat;-webkit-background-size:contain;background-size:contain;-webkit-flex-shrink:0;flex-shrink:0;background-position:center center;position:relative}.listItemImage-large{width:45vh;height:30vh;background-position:center center;margin-right:2%;margin-left:1%}.listItemIcon{width:1em!important;height:1em!important;font-size:143%;-webkit-border-radius:500px;border-radius:500px;padding:.5em;color:#fff}.listItemIcon:not(.listItemIcon-transparent){background-color:#52B54B}.listItemProgressBar{position:absolute;bottom:0;left:0;right:0}.listItem .secondary{color:#888}.listItem:focus .secondary{color:inherit!important}.listItem-focusscale{-webkit-transition:-webkit-transform .2s ease-out;-o-transition:transform .2s ease-out;transition:transform .2s ease-out}.listItem-focusscale:focus{-webkit-transform:scale(1.025,1.025);transform:scale(1.025,1.025)}.paperList{padding:.5em 0;margin:1em auto;-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2)}.paperList-clear{-webkit-box-shadow:none!important;box-shadow:none!important;background-color:transparent!important}.listItemMediaInfo{-webkit-box-align:center;-webkit-align-items:center;align-items:center;margin-right:1em}.listGroupHeader{margin:2em 0 1em}.listGroupHeader-first{margin-top:0}.listItemIndicators{right:.5vh;top:.5vh;position:absolute;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.listItem,.listItemBody,.listItemMediaInfo{display:-webkit-box;display:-webkit-flex;display:flex;contain:layout style}@media all and (max-width:800px){.listItem .criticRating,.listItem .endsAt{display:none!important}}.listItemCheckboxContainer{width:auto!important}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,37 +1 @@
|
|||
define(['css!./loading-legacy'], function () {
|
||||
'use strict';
|
||||
|
||||
var loadingElem;
|
||||
|
||||
return {
|
||||
show: function () {
|
||||
var elem = loadingElem;
|
||||
|
||||
if (!elem) {
|
||||
|
||||
elem = document.createElement("div");
|
||||
loadingElem = elem;
|
||||
|
||||
elem.classList.add('docspinner');
|
||||
elem.classList.add('mdl-spinner');
|
||||
elem.classList.add('mdl-js-spinner');
|
||||
|
||||
elem.innerHTML = '<div class="mdl-spinner__layer mdl-spinner__layer-1"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__gap-patch"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle"></div></div></div><div class="mdl-spinner__layer mdl-spinner__layer-2"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__gap-patch"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle"></div></div></div><div class="mdl-spinner__layer mdl-spinner__layer-3"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__gap-patch"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle"></div></div></div><div class="mdl-spinner__layer mdl-spinner__layer-4"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__gap-patch"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle"></div></div></div>';
|
||||
|
||||
document.body.appendChild(elem);
|
||||
}
|
||||
|
||||
elem.classList.add('is-active');
|
||||
elem.classList.remove('loadingHide');
|
||||
},
|
||||
hide: function () {
|
||||
var elem = loadingElem;
|
||||
|
||||
if (elem) {
|
||||
|
||||
elem.classList.remove('is-active');
|
||||
elem.classList.add('loadingHide');
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
define(["css!./loading-legacy"],function(){"use strict";var loadingElem;return{show:function(){var elem=loadingElem;elem||(elem=document.createElement("div"),loadingElem=elem,elem.classList.add("docspinner"),elem.classList.add("mdl-spinner"),elem.classList.add("mdl-js-spinner"),elem.innerHTML='<div class="mdl-spinner__layer mdl-spinner__layer-1"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__gap-patch"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle"></div></div></div><div class="mdl-spinner__layer mdl-spinner__layer-2"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__gap-patch"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle"></div></div></div><div class="mdl-spinner__layer mdl-spinner__layer-3"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__gap-patch"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle"></div></div></div><div class="mdl-spinner__layer mdl-spinner__layer-4"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__gap-patch"><div class="mdl-spinner__circle"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle"></div></div></div>',document.body.appendChild(elem)),elem.classList.add("is-active"),elem.classList.remove("loadingHide")},hide:function(){var elem=loadingElem;elem&&(elem.classList.remove("is-active"),elem.classList.add("loadingHide"))}}});
|
File diff suppressed because one or more lines are too long
|
@ -1,34 +1 @@
|
|||
define(['css!./loading-lite'], function () {
|
||||
'use strict';
|
||||
|
||||
var loadingElem;
|
||||
|
||||
return {
|
||||
show: function () {
|
||||
var elem = loadingElem;
|
||||
|
||||
if (!elem) {
|
||||
|
||||
elem = document.createElement("div");
|
||||
loadingElem = elem;
|
||||
|
||||
elem.classList.add('docspinner');
|
||||
elem.classList.add('mdl-spinner');
|
||||
|
||||
elem.innerHTML = '<div class="mdl-spinner__layer mdl-spinner__layer-1"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle mdl-spinner__circleLeft"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle mdl-spinner__circleRight"></div></div></div><div class="mdl-spinner__layer mdl-spinner__layer-2"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle mdl-spinner__circleLeft"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle mdl-spinner__circleRight"></div></div></div><div class="mdl-spinner__layer mdl-spinner__layer-3"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle mdl-spinner__circleLeft"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle mdl-spinner__circleRight"></div></div></div><div class="mdl-spinner__layer mdl-spinner__layer-4"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle mdl-spinner__circleLeft"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle mdl-spinner__circleRight"></div></div></div>';
|
||||
|
||||
document.body.appendChild(elem);
|
||||
}
|
||||
|
||||
elem.classList.add('mdlSpinnerActive');
|
||||
},
|
||||
hide: function () {
|
||||
var elem = loadingElem;
|
||||
|
||||
if (elem) {
|
||||
|
||||
elem.classList.remove('mdlSpinnerActive');
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
define(["css!./loading-lite"],function(){"use strict";var loadingElem;return{show:function(){var elem=loadingElem;elem||(elem=document.createElement("div"),loadingElem=elem,elem.classList.add("docspinner"),elem.classList.add("mdl-spinner"),elem.innerHTML='<div class="mdl-spinner__layer mdl-spinner__layer-1"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle mdl-spinner__circleLeft"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle mdl-spinner__circleRight"></div></div></div><div class="mdl-spinner__layer mdl-spinner__layer-2"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle mdl-spinner__circleLeft"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle mdl-spinner__circleRight"></div></div></div><div class="mdl-spinner__layer mdl-spinner__layer-3"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle mdl-spinner__circleLeft"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle mdl-spinner__circleRight"></div></div></div><div class="mdl-spinner__layer mdl-spinner__layer-4"><div class="mdl-spinner__circle-clipper mdl-spinner__left"><div class="mdl-spinner__circle mdl-spinner__circleLeft"></div></div><div class="mdl-spinner__circle-clipper mdl-spinner__right"><div class="mdl-spinner__circle mdl-spinner__circleRight"></div></div></div>',document.body.appendChild(elem)),elem.classList.add("mdlSpinnerActive")},hide:function(){var elem=loadingElem;elem&&elem.classList.remove("mdlSpinnerActive")}}});
|
|
@ -1,79 +1 @@
|
|||
.mediaInfoItem {
|
||||
margin: 0 1em 0 0;
|
||||
}
|
||||
|
||||
.mediaInfoText {
|
||||
background: rgba(31,31,31,.7);
|
||||
padding: .2em .5em;
|
||||
border-radius: .25em;
|
||||
color: #ddd;
|
||||
font-size: 84%;
|
||||
background: rgba(170,170,190, .2);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.mediaInfoIconItem {
|
||||
width: auto;
|
||||
height: auto;
|
||||
font-size: 1.6em;
|
||||
margin-right: .6em;
|
||||
}
|
||||
|
||||
.mediaInfoItem:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.starRatingContainer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
vertical-align: middle;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.starIcon {
|
||||
color: #CB272A;
|
||||
width: auto !important;
|
||||
height: auto !important;
|
||||
font-size: 1.4em;
|
||||
}
|
||||
|
||||
.mediaInfoCriticRating {
|
||||
padding-left: 1.5em;
|
||||
background-position: left center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: auto 1.2em;
|
||||
min-height: 1.2em;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.mediaInfoCriticRatingFresh {
|
||||
background-image: url(fresh.png);
|
||||
}
|
||||
|
||||
.mediaInfoCriticRatingRotten {
|
||||
background-image: url(rotten.png);
|
||||
}
|
||||
|
||||
.mediaInfoTimerIcon {
|
||||
color: #CB272A;
|
||||
}
|
||||
|
||||
.mediaInfoProgramAttribute {
|
||||
color: #fff;
|
||||
text-transform: uppercase;
|
||||
padding: .16em .6em;
|
||||
border-radius: .15em;
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
.closedCaptionMediaInfoText {
|
||||
/*padding: .24em .4em;*/
|
||||
font-weight: 700;
|
||||
/*font-size: inherit;*/
|
||||
/*background: rgba(81, 81, 81, .7);*/
|
||||
}
|
||||
.mediaInfoText,.starRatingContainer{display:-webkit-box;display:-webkit-flex;-webkit-box-align:center}.mediaInfoItem{margin:0 1em 0 0}.mediaInfoText{padding:.2em .5em;-webkit-border-radius:.25em;border-radius:.25em;color:#ddd;font-size:84%;background:rgba(170,170,190,.2);display:flex;-webkit-align-items:center;align-items:center;white-space:nowrap}.mediaInfoTimerIcon,.starIcon{color:#CB272A}.mediaInfoIconItem{width:auto;height:auto;font-size:1.6em;margin-right:.6em}.mediaInfoItem:last-child{margin-right:0}.starRatingContainer{display:flex;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;vertical-align:middle;padding-top:0;padding-bottom:0}.starIcon{width:auto!important;height:auto!important;font-size:1.4em}.mediaInfoCriticRating{padding-left:1.5em;background-position:left center;background-repeat:no-repeat;-webkit-background-size:auto 1.2em;background-size:auto 1.2em;min-height:1.2em;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.mediaInfoCriticRatingFresh{background-image:url(fresh.png)}.mediaInfoCriticRatingRotten{background-image:url(rotten.png)}.mediaInfoProgramAttribute{color:#fff;text-transform:uppercase;padding:.16em .6em;-webkit-border-radius:.15em;border-radius:.15em;font-size:80%}.closedCaptionMediaInfoText{font-weight:700}
|
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue