Merge pull request #2098 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-08-25 01:24:44 -04:00 committed by GitHub
commit b6f5064969
28 changed files with 231 additions and 131 deletions

View file

@ -14,12 +14,12 @@
}, },
"devDependencies": {}, "devDependencies": {},
"ignore": [], "ignore": [],
"version": "1.4.183", "version": "1.4.186",
"_release": "1.4.183", "_release": "1.4.186",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "1.4.183", "tag": "1.4.186",
"commit": "0548902d94131fb45ba17c421186014b0bed5e18" "commit": "58f6ba7c53f72e861456632e6c278b6d9da2bf9b"
}, },
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.1", "_target": "^1.2.1",

View file

@ -702,11 +702,11 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
return html; return html;
} }
function getCardFooterText(item, options, showTitle, forceName, imgUrl, footerClass, progressHtml, isOuterFooter) { function getCardFooterText(item, options, showTitle, forceName, overlayText, imgUrl, footerClass, progressHtml, isOuterFooter) {
var html = ''; var html = '';
var showOtherText = isOuterFooter ? !options.overlayText : options.overlayText; var showOtherText = isOuterFooter ? !overlayText : overlayText;
if (isOuterFooter && options.cardLayout && !layoutManager.tv) { if (isOuterFooter && options.cardLayout && !layoutManager.tv) {
var moreIcon = appHost.moreIcon == 'dots-horiz' ? '' : ''; var moreIcon = appHost.moreIcon == 'dots-horiz' ? '' : '';
@ -719,7 +719,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
if (showOtherText) { if (showOtherText) {
var parentTitleUnderneath = item.Type == 'MusicAlbum' || item.Type == 'Audio' || item.Type == 'MusicVideo'; var parentTitleUnderneath = item.Type == 'MusicAlbum' || item.Type == 'Audio' || item.Type == 'MusicVideo';
if (options.showParentTitle && !parentTitleUnderneath) { if ((options.showParentTitle || options.showParentTitleOrTitle) && !parentTitleUnderneath) {
if (isOuterFooter && item.Type == 'Episode' && item.SeriesName && item.SeriesId) { if (isOuterFooter && item.Type == 'Episode' && item.SeriesName && item.SeriesId) {
@ -732,12 +732,16 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
} }
else { else {
lines.push(item.EpisodeTitle ? item.Name : (item.SeriesName || item.Album || item.AlbumArtist || item.GameSystem || "")); var parentTitle = item.EpisodeTitle ? item.Name : (item.SeriesName || item.Album || item.AlbumArtist || item.GameSystem || "");
if (parentTitle || options.showParentTitle) {
lines.push(parentTitle);
}
} }
} }
} }
if (showTitle) { if (showTitle || forceName || (options.showParentTitleOrTitle && !lines.length)) {
var name = options.showTitle == 'auto' && !item.IsFolder && item.MediaType == 'Photo' ? '' : itemHelper.getDisplayName(item); var name = options.showTitle == 'auto' && !item.IsFolder && item.MediaType == 'Photo' ? '' : itemHelper.getDisplayName(item);
@ -834,7 +838,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
lines.push(airTimeText || ''); lines.push(airTimeText || '');
} }
if (item.Type == 'TvChannel') { if (options.showCurrentProgram && item.Type == 'TvChannel') {
if (item.CurrentProgram) { if (item.CurrentProgram) {
lines.push(itemHelper.getDisplayName(item.CurrentProgram)); lines.push(itemHelper.getDisplayName(item.CurrentProgram));
@ -869,7 +873,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
} }
} }
if (showTitle && forceName && lines.length == 1) { if (showTitle && forceName && overlayText && lines.length == 1) {
lines = []; lines = [];
} }
@ -1022,7 +1026,6 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
var overlayText = options.overlayText; var overlayText = options.overlayText;
if (forceName && !options.cardLayout) { if (forceName && !options.cardLayout) {
showTitle = imgUrl;
if (overlayText == null) { if (overlayText == null) {
overlayText = true; overlayText = true;
@ -1061,7 +1064,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
if (overlayText) { if (overlayText) {
footerCssClass = progressHtml ? 'innerCardFooter fullInnerCardFooter' : 'innerCardFooter'; footerCssClass = progressHtml ? 'innerCardFooter fullInnerCardFooter' : 'innerCardFooter';
innerCardFooter += getCardFooterText(item, options, showTitle, forceName, imgUrl, footerCssClass, progressHtml, false); innerCardFooter += getCardFooterText(item, options, showTitle, forceName, overlayText, imgUrl, footerCssClass, progressHtml, false);
footerOverlayed = true; footerOverlayed = true;
} }
else if (progressHtml) { else if (progressHtml) {
@ -1080,7 +1083,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
var outerCardFooter = ''; var outerCardFooter = '';
if (!overlayText && !footerOverlayed) { if (!overlayText && !footerOverlayed) {
footerCssClass = options.cardLayout ? 'cardFooter visualCardBox-cardFooter' : 'cardFooter transparent'; footerCssClass = options.cardLayout ? 'cardFooter visualCardBox-cardFooter' : 'cardFooter transparent';
outerCardFooter = getCardFooterText(item, options, showTitle, forceName, imgUrl, footerCssClass, progressHtml, true); outerCardFooter = getCardFooterText(item, options, showTitle, forceName, overlayText, imgUrl, footerCssClass, progressHtml, true);
} }
if (outerCardFooter && !options.cardLayout && options.allowBottomPadding !== false) { if (outerCardFooter && !options.cardLayout && options.allowBottomPadding !== false) {
@ -1208,9 +1211,10 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
var mediaTypeData = item.MediaType ? (' data-mediatype="' + item.MediaType + '"') : ''; var mediaTypeData = item.MediaType ? (' data-mediatype="' + item.MediaType + '"') : '';
var collectionTypeData = item.CollectionType ? (' data-collectiontype="' + item.CollectionType + '"') : ''; var collectionTypeData = item.CollectionType ? (' data-collectiontype="' + item.CollectionType + '"') : '';
var channelIdData = item.ChannelId ? (' data-channelid="' + item.ChannelId + '"') : ''; var channelIdData = item.ChannelId ? (' data-channelid="' + item.ChannelId + '"') : '';
var contextData = options.context ? (' data-context="' + options.context + '"') : '';
return '\ return '\
<' + tagName + ' data-index="' + index + '"' + timerAttributes + actionAttribute + ' data-isfolder="' + (item.IsFolder || false) + '" data-serverid="' + (item.ServerId) + '" data-id="' + (item.Id || item.ItemId) + '" data-type="' + item.Type + '"' + mediaTypeData + collectionTypeData + channelIdData + positionTicksData + collectionIdData + playlistIdData + ' data-prefix="' + prefix + '" class="' + className + '"> \ <' + tagName + ' data-index="' + index + '"' + timerAttributes + actionAttribute + ' data-isfolder="' + (item.IsFolder || false) + '" data-serverid="' + (item.ServerId) + '" data-id="' + (item.Id || item.ItemId) + '" data-type="' + item.Type + '"' + mediaTypeData + collectionTypeData + channelIdData + positionTicksData + collectionIdData + playlistIdData + contextData + ' data-prefix="' + prefix + '" class="' + className + '"> \
' + cardImageContainerOpen + innerCardFooter + cardImageContainerClose + cardContentClose + overlayButtons + cardScalableClose + outerCardFooter + cardBoxClose + '\ ' + cardImageContainerOpen + innerCardFooter + cardImageContainerClose + cardContentClose + overlayButtons + cardScalableClose + outerCardFooter + cardBoxClose + '\
</' + tagName + '>'; </' + tagName + '>';
} }

View file

@ -104,7 +104,7 @@
}(); }();
function toLocaleDateString(date) { function toLocaleDateString(date) {
var currentLocale = globalize.getCurrentLocale(); var currentLocale = globalize.getCurrentLocale();
return currentLocale && toLocaleTimeStringSupportsLocales ? return currentLocale && toLocaleTimeStringSupportsLocales ?
@ -160,10 +160,20 @@
return time; 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 { return {
parseISO8601Date: parseISO8601Date, parseISO8601Date: parseISO8601Date,
getDisplayRunningTime: getDisplayRunningTime, getDisplayRunningTime: getDisplayRunningTime,
toLocaleDateString: toLocaleDateString, toLocaleDateString: toLocaleDateString,
getDisplayTime: getDisplayTime getDisplayTime: getDisplayTime,
isRelativeDay: isRelativeDay
}; };
}); });

View file

@ -254,6 +254,10 @@
height: 4em; height: 4em;
} }
.channelPrograms-tv, .channelHeaderCell-tv {
height: 3.2em;
}
.channelTimeslotHeader { .channelTimeslotHeader {
border-right-color: transparent; border-right-color: transparent;
} }

View file

@ -294,7 +294,9 @@
return curr.ChannelId == channel.Id; return curr.ChannelId == channel.Id;
}); });
html += '<div class="channelPrograms" data-channelid="' + channel.Id + '">'; var cssClass = layoutManager.tv ? 'channelPrograms channelPrograms-tv' : 'channelPrograms';
html += '<div class="' + cssClass + '" data-channelid="' + channel.Id + '">';
for (var i = 0, length = programs.length; i < length; i++) { for (var i = 0, length = programs.length; i < length; i++) {
@ -450,6 +452,10 @@
var cssClass = 'channelHeaderCell clearButton itemAction lazy'; var cssClass = 'channelHeaderCell clearButton itemAction lazy';
if (layoutManager.tv) {
cssClass += ' channelHeaderCell-tv';
}
html += '<button type="button" class="' + cssClass + '"' + dataSrc + ' data-action="link" data-isfolder="' + channel.IsFolder + '" data-id="' + channel.Id + '" data-serverid="' + channel.ServerId + '" data-type="' + channel.Type + '">'; html += '<button type="button" class="' + cssClass + '"' + dataSrc + ' data-action="link" data-isfolder="' + channel.IsFolder + '" data-id="' + channel.Id + '" data-serverid="' + channel.ServerId + '" data-type="' + channel.Type + '">';
cssClass = 'guideChannelNumber'; cssClass = 'guideChannelNumber';

View file

@ -154,6 +154,13 @@
return html; return html;
} }
function onCardOverlayButtonsClick(e) {
var button = dom.parentWithTag(e.target, 'BUTTON');
if (button) {
e.stopPropagation();
}
}
function onShowTimerExpired(elem) { function onShowTimerExpired(elem) {
@ -164,6 +171,10 @@
innerElem.classList.add('hide'); innerElem.classList.add('hide');
innerElem.classList.add('cardOverlayTarget'); innerElem.classList.add('cardOverlayTarget');
// allow the overlay to be clicked to view the item
innerElem.classList.add('itemAction');
innerElem.setAttribute('data-action', 'link');
var appendTo = elem.querySelector('div.cardContent') || elem.querySelector('.cardScalable') || elem.querySelector('.cardBox'); var appendTo = elem.querySelector('div.cardContent') || elem.querySelector('.cardScalable') || elem.querySelector('.cardBox');
//if (appendTo && appendTo.tagName == 'BUTTON') { //if (appendTo && appendTo.tagName == 'BUTTON') {
@ -203,6 +214,8 @@
var user = responses[1]; var user = responses[1];
innerElem.innerHTML = getOverlayHtml(apiClient, item, user, dataElement); innerElem.innerHTML = getOverlayHtml(apiClient, item, user, dataElement);
innerElem.querySelector('.cardOverlayButtons').addEventListener('click', onCardOverlayButtonsClick);
}); });
slideUpToShow(innerElem); slideUpToShow(innerElem);

View file

@ -522,17 +522,21 @@ define(['loading', 'viewManager', 'skinManager', 'pluginManager', 'backdrop', 'b
return show(pluginManager.mapRoute(skin, homeRoute)); return show(pluginManager.mapRoute(skin, homeRoute));
} }
function showItem(item, serverId) { function showItem(item, serverId, options) {
if (typeof (item) === 'string') { if (typeof (item) === 'string') {
require(['connectionManager'], function (connectionManager) { require(['connectionManager'], function (connectionManager) {
var apiClient = serverId ? connectionManager.getApiClient(serverId) : connectionManager.currentApiClient(); var apiClient = serverId ? connectionManager.getApiClient(serverId) : connectionManager.currentApiClient();
apiClient.getItem(apiClient.getCurrentUserId(), item).then(function (item) { apiClient.getItem(apiClient.getCurrentUserId(), item).then(function (item) {
embyRouter.showItem(item); embyRouter.showItem(item, options);
}); });
}); });
} else { } else {
skinManager.getCurrentSkin().showItem(item);
if (arguments.length == 2) {
options = arguments[1];
}
skinManager.getCurrentSkin().showItem(item, options);
} }
} }

View file

@ -79,15 +79,15 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
}); });
} }
function showItem(options) { function showItem(item, options) {
if (options.Type == 'Photo') { if (item.Type == 'Photo') {
showSlideshow(options.Id, options.ServerId); showSlideshow(item.Id, item.ServerId);
return; return;
} }
embyRouter.showItem(options); embyRouter.showItem(item, options);
} }
function getItem(button) { function getItem(button) {
@ -210,7 +210,10 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
var type = item.Type; var type = item.Type;
if (action == 'link') { if (action == 'link') {
showItem(item);
showItem(item, {
context: card.getAttribute('data-context')
});
} }
else if (action == 'instantmix') { else if (action == 'instantmix') {

View file

@ -1,6 +1,6 @@
{ {
"name": "iron-meta", "name": "iron-meta",
"version": "1.1.1", "version": "1.1.2",
"keywords": [ "keywords": [
"web-components", "web-components",
"polymer" "polymer"
@ -22,16 +22,17 @@
"paper-styles": "polymerelements/paper-styles#^1.0.4", "paper-styles": "polymerelements/paper-styles#^1.0.4",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0", "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0", "test-fixture": "polymerelements/test-fixture#^1.0.0",
"web-component-tester": "*", "web-component-tester": "^4.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"main": "iron-meta.html", "main": "iron-meta.html",
"ignore": [],
"homepage": "https://github.com/PolymerElements/iron-meta", "homepage": "https://github.com/PolymerElements/iron-meta",
"_release": "1.1.1", "_release": "1.1.2",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.1.1", "tag": "v1.1.2",
"commit": "e171ee234b482219c9514e6f9551df48ef48bd9f" "commit": "bae96531b63ea6d4ce982f5592248aea849c0f5a"
}, },
"_source": "git://github.com/PolymerElements/iron-meta.git", "_source": "git://github.com/PolymerElements/iron-meta.git",
"_target": "^1.0.0", "_target": "^1.0.0",

View file

@ -0,0 +1,33 @@
<!-- Instructions: https://github.com/PolymerElements/iron-meta/CONTRIBUTING.md#filing-issues -->
### Description
<!-- Example: The `paper-foo` element causes the page to turn pink when clicked. -->
### Expected outcome
<!-- Example: The page stays the same color. -->
### Actual outcome
<!-- Example: The page turns pink. -->
### Live Demo
<!-- Example: https://jsbin.com/cagaye/edit?html,output -->
### Steps to reproduce
<!-- Example
1. Put a `paper-foo` element in the page.
2. Open the page in a web browser.
3. Click the `paper-foo` element.
-->
### Browsers Affected
<!-- Check all that apply -->
- [ ] Chrome
- [ ] Firefox
- [ ] Safari 9
- [ ] Safari 8
- [ ] Safari 7
- [ ] Edge
- [ ] IE 11
- [ ] IE 10

View file

@ -1,28 +1,23 @@
language: node_js language: node_js
sudo: false sudo: required
matrix:
include:
- node_js: stable
script: xvfb-run wct
addons:
firefox: latest
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
- node_js: node
script:
- |
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
wct -s 'default'
fi
before_script: before_script:
- npm install web-component-tester - npm install -g bower polylint web-component-tester
- npm install bower
- export PATH=$PWD/node_modules/.bin:$PATH
- bower install - bower install
- polylint
env: env:
global: global:
- secure: eGcuDAJt+1GPrC6u95vHufjnSXWbVBZpW7oKQhZjcHrN19l9COdOb7RVkTPsZzEanHaH/D6Psr4WJKyd72Wx5wj+bqGh4nPHTFSnK3+gNT4eJAgLvsxLwHxW8QkYYHEdZe8Wd6sOdal9geeLZ8fG9xELYEtuJR6lww5uLvFv/cw= - secure: mjikUCoN+UpTbFHwbGXUoKp4vtZ2qNN1JYW79WcOik7fCFmvdFzfYQPDa6y9aJvU3kgkDndGdR/ynLG4kejZjmqTS5fYtdHEwpPVPapbVYnquJvCJKbMN4S2QpGCoq51pjKQ8U3Ys6G5HkmdcDfw3SKk1uMgVzKV7fEI+6WnZ/M=
- secure: DoBz8LDaS4/lQ9sTXE5pnp8fqEvG47mmdQaQ14EnHQ+wLbajIaLk59vRfau5c7mIef8dEgaT40r/kVP5QRr3OiH5UJY3jLnCMVIxWJ3ZTkuGGuU6QDQvoGSSBhdA+b+G94bbK6LtHQxRBrkiyT9d0IzT5ZiHlDlteGbjdDWAgw0= - secure: LHDnBtwK7yO2X4GNmIaAl7t85WWc1U189OiPqemD27+jTcKml0by1n9Mu/yrg94jYgeXab9mHgU3uMtIdQstNNwTDu8CgmmIP4H2EWopHrTi3KM7Z7aeofPgMJsVFXwg+WhNlcCfhEsygHZWTxjJXM4fcGOrFPDa4+BTgRa2hEE=
node_js: stable
addons:
firefox: '46.0'
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
sauce_connect: true
script:
- xvfb-run wct
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct -s 'default'; fi
dist: trusty

View file

@ -1,11 +1,16 @@
<!-- <!--
This file is autogenerated based on This file is autogenerated based on
https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md
If you edit that file, it will get updated everywhere else. If you edit that file, it will get updated everywhere else.
If you edit this file, your changes will get overridden :) If you edit this file, your changes will get overridden :)
You can however override the jsbin link with one that's customized to this
specific element:
jsbin=https://jsbin.com/cagaye/edit?html,output
--> -->
# Polymer Elements # Polymer Elements
## Guide for Contributors ## Guide for Contributors
@ -41,7 +46,7 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag
3. Click the `paper-foo` element. 3. Click the `paper-foo` element.
``` ```
2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [http://jsbin.com/cagaye](http://jsbin.com/cagaye/edit?html,output). 2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [https://jsbin.com/cagaye/edit?html,output](https://jsbin.com/cagaye/edit?html,output).
3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers. 3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers.
@ -51,14 +56,14 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag
When submitting pull requests, please provide: When submitting pull requests, please provide:
1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues using the following syntax: 1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues in the pull request description using the following syntax:
```markdown ```markdown
(For a single issue) (For a single issue)
Fixes #20 Fixes #20
(For multiple issues) (For multiple issues)
Fixes #32, #40 Fixes #32, fixes #40
``` ```
2. **A succinct description of the design** used to fix any related issues. For example: 2. **A succinct description of the design** used to fix any related issues. For example:

View file

@ -1,6 +1,6 @@
{ {
"name": "iron-meta", "name": "iron-meta",
"version": "1.1.1", "version": "1.1.2",
"keywords": [ "keywords": [
"web-components", "web-components",
"polymer" "polymer"
@ -22,8 +22,9 @@
"paper-styles": "polymerelements/paper-styles#^1.0.4", "paper-styles": "polymerelements/paper-styles#^1.0.4",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0", "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0", "test-fixture": "polymerelements/test-fixture#^1.0.0",
"web-component-tester": "*", "web-component-tester": "^4.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"main": "iron-meta.html" "main": "iron-meta.html",
"ignore": []
} }

View file

@ -22,22 +22,52 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</head> </head>
<body> <body>
<div class="vertical-section vertical-section-container centered"> <div class="vertical-section centered">
<h1>&lt;iron-meta&gt;</h1> <h1>&lt;iron-meta&gt;</h1>
<h2>Key Query</h2>
<iron-meta key="info" value="foo/bar"></iron-meta> <iron-meta key="info" value="foo/bar"></iron-meta>
The <code>value</code> stored at <code>key="info"</code> is <code><meta-test></meta-test></code>. The <code>value</code> stored at <code>key="info"</code> is <code><meta-test></meta-test></code>.
</div> </div>
<div class="vertical-section centered">
<h2>Type Query</h2>
<iron-meta type="type1" key="a" value="Polymer"></iron-meta>
<iron-meta type="type1" key="b" value="is"></iron-meta>
<iron-meta type="type2" key="a" value="wonderful"></iron-meta>
<iron-meta type="type2" key="b" value="<3"></iron-meta>
The <code>value(s)</code> stored at <code>type="type1"</code> are:<br><code><type-one></type-one></code>.<br><br>The <code>value(s)</code> stored at <code>type="type2"</code> are:<br><code><type-two></type-two></code>.
</div>
<script> <script>
document.addEventListener('WebComponentsReady', function() {
Polymer({
is: 'meta-test',
ready: function() {
this.textContent = new Polymer.IronMetaQuery({key: 'info'}).value;
}
});
});
Polymer({ Polymer({
is: 'type-one',
is: 'meta-test',
ready: function() { ready: function() {
this.textContent = new Polymer.IronMetaQuery({key: 'info'}).value; var resultList = new Polymer.IronMetaQuery({type: "type1"}).list;
this.textContent = JSON.stringify(resultList);
} }
});
Polymer({
is: 'type-two',
ready: function() {
var resultList = new Polymer.IronMetaQuery({type: "type2"}).list;
this.textContent = JSON.stringify(resultList);
}
}); });
</script> </script>

View file

@ -2,11 +2,11 @@
<!-- <!--
@license @license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved. Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
--> -->
<html> <html>
<head> <head>

View file

@ -33,17 +33,17 @@ attributes or use child nodes to define additional metadata.
Now I can access that element (and it's metadata) from any iron-meta instance Now I can access that element (and it's metadata) from any iron-meta instance
via the byKey method, e.g. via the byKey method, e.g.
meta.byKey('info').getAttribute('value'); meta.byKey('info');
Pure imperative form would be like: Pure imperative form would be like:
document.createElement('iron-meta').byKey('info').getAttribute('value'); document.createElement('iron-meta').byKey('info');
Or, in a Polymer element, you can include a meta in your template: Or, in a Polymer element, you can include a meta in your template:
<iron-meta id="meta"></iron-meta> <iron-meta id="meta"></iron-meta>
... ...
this.$.meta.byKey('info').getAttribute('value'); this.$.meta.byKey('info');
@group Iron Elements @group Iron Elements
@demo demo/index.html @demo demo/index.html

View file

@ -1,5 +1,4 @@
<!doctype html> <!DOCTYPE html><!--
<!--
@license @license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved. Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
@ -7,10 +6,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
--> --><html><head>
<html>
<head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Tests</title> <title>Tests</title>
@ -22,9 +18,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<script> <script>
WCT.loadSuites([ WCT.loadSuites([
'basic.html', 'basic.html',
'iron-meta.html' 'iron-meta.html',
'basic.html?dom=shadow',
'iron-meta.html?dom=shadow'
]); ]);
</script> </script>
</body>
</html>
</body></html>

View file

@ -40,6 +40,6 @@
"commit": "1f197d9d7874b1e5808b2a5c26f34446a7d912fc" "commit": "1f197d9d7874b1e5808b2a5c26f34446a7d912fc"
}, },
"_source": "git://github.com/Polymer/polymer.git", "_source": "git://github.com/Polymer/polymer.git",
"_target": "^1.1.0", "_target": "^1.2.0",
"_originalSource": "Polymer/polymer" "_originalSource": "Polymer/polymer"
} }

View file

@ -38,19 +38,14 @@
} else { } else {
parent.querySelector('.chkEnablePhotosContainer').classList.add('hide'); parent.querySelector('.chkEnablePhotosContainer').classList.add('hide');
} }
if (contentType == 'music' || contentType == 'tvshows' || contentType == 'movies' || contentType == 'homevideos' || contentType == 'musicvideos' || contentType == 'mixed') {
parent.classList.remove('hide');
} else {
parent.classList.add('hide');
}
} }
function getLibraryOptions(parent) { function getLibraryOptions(parent) {
var options = { var options = {
EnableArchiveMediaFiles: parent.querySelector('.chkArhiveAsMedia').checked, EnableArchiveMediaFiles: parent.querySelector('.chkArhiveAsMedia').checked,
EnablePhotos: parent.querySelector('.chkEnablePhotos').checked EnablePhotos: parent.querySelector('.chkEnablePhotos').checked,
EnableRealtimeMonitor: parent.querySelector('.chkEnableRealtimeMonitor').checked
}; };
return options; return options;
@ -60,6 +55,7 @@
parent.querySelector('.chkArhiveAsMedia').checked = options.EnableArchiveMediaFiles; parent.querySelector('.chkArhiveAsMedia').checked = options.EnableArchiveMediaFiles;
parent.querySelector('.chkEnablePhotos').checked = options.EnablePhotos; parent.querySelector('.chkEnablePhotos').checked = options.EnablePhotos;
parent.querySelector('.chkEnableRealtimeMonitor').checked = options.EnableRealtimeMonitor;
} }
return { return {

View file

@ -6,6 +6,14 @@
</label> </label>
<div class="fieldDescription checkboxFieldDescription">${EnablePhotosHelp}</div> <div class="fieldDescription checkboxFieldDescription">${EnablePhotosHelp}</div>
</div> </div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label>
<input type="checkbox" is="emby-checkbox" class="chkEnableRealtimeMonitor" checked />
<span>${LabelEnableRealtimeMonitor}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${LabelEnableRealtimeMonitorHelp}</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription chkArhiveAsMediaContainer"> <div class="checkboxContainer checkboxContainer-withDescription chkArhiveAsMediaContainer">
<label> <label>
<input type="checkbox" is="emby-checkbox" class="chkArhiveAsMedia" /> <input type="checkbox" is="emby-checkbox" class="chkArhiveAsMedia" />

View file

@ -10,8 +10,6 @@
$('#txtSeasonZeroName', page).val(config.SeasonZeroDisplayName); $('#txtSeasonZeroName', page).val(config.SeasonZeroDisplayName);
$('#selectEnableRealtimeMonitor', page).val(config.EnableLibraryMonitor);
$('#chkSaveMetadataHidden', page).checked(config.SaveMetadataHidden); $('#chkSaveMetadataHidden', page).checked(config.SaveMetadataHidden);
$('#txtMetadataPath', page).val(config.MetadataPath || ''); $('#txtMetadataPath', page).val(config.MetadataPath || '');
@ -91,8 +89,6 @@
config.SeasonZeroDisplayName = $('#txtSeasonZeroName', form).val(); config.SeasonZeroDisplayName = $('#txtSeasonZeroName', form).val();
config.EnableLibraryMonitor = $('#selectEnableRealtimeMonitor', form).val();
config.SaveMetadataHidden = $('#chkSaveMetadataHidden', form).checked(); config.SaveMetadataHidden = $('#chkSaveMetadataHidden', form).checked();
config.EnableTvDbUpdates = $('#chkEnableTvdbUpdates', form).checked(); config.EnableTvDbUpdates = $('#chkEnableTvdbUpdates', form).checked();
@ -169,15 +165,6 @@
$('.librarySettingsForm').off('submit', onSubmit).on('submit', onSubmit); $('.librarySettingsForm').off('submit', onSubmit).on('submit', onSubmit);
ApiClient.getSystemInfo().then(function (systemInfo) {
if (systemInfo.SupportsLibraryMonitor) {
view.querySelector('.fldLibraryMonitor').classList.remove('hide');
} else {
view.querySelector('.fldLibraryMonitor').classList.add('hide');
}
});
view.addEventListener('viewshow', function () { view.addEventListener('viewshow', function () {
LibraryMenu.setTabs('librarysetup', 3, getTabs); LibraryMenu.setTabs('librarysetup', 3, getTabs);
Dashboard.showLoadingMsg(); Dashboard.showLoadingMsg();

View file

@ -16,7 +16,8 @@
<div class="fieldDescription">${LabelHardwareAccelerationTypeHelp}</div> <div class="fieldDescription">${LabelHardwareAccelerationTypeHelp}</div>
</div> </div>
<div class="inputContainer hide fldVaapiDevice"> <div class="inputContainer hide fldVaapiDevice">
<input is="emby-input" type="text" id="txtVaapiDevice" label="${LabelVaapiDevice}" /> <input is="emby-input" type="text" id="txtVaapiDevice" label="${LabelVaapiDevice}"/>
<div class="fieldDescription">${LabelVaapiDeviceHelp}</div>
</div> </div>
<div class="selectContainer"> <div class="selectContainer">
<select is="emby-select" id="selectThreadCount" label="${LabelTranscodingThreadCount}"> <select is="emby-select" id="selectThreadCount" label="${LabelTranscodingThreadCount}">

View file

@ -4,16 +4,6 @@
<div class="content-primary"> <div class="content-primary">
<form class="librarySettingsForm"> <form class="librarySettingsForm">
<div class="selectContainer fldLibraryMonitor hide">
<select is="emby-select" id="selectEnableRealtimeMonitor" data-mini="true" label="${LabelEnableRealtimeMonitor}">
<option value="Auto">${OptionAuto}</option>
<option value="Enabled">${OptionYes}</option>
<option value="Disabled">${OptionNo}</option>
</select>
<div class="fieldDescription">
${LabelEnableRealtimeMonitorHelp}
</div>
</div>
<div class="selectContainer"> <div class="selectContainer">
<select is="emby-select" id="selectDateAdded" data-mini="true" label="${LabelDateAddedBehavior}"> <select is="emby-select" id="selectDateAdded" data-mini="true" label="${LabelDateAddedBehavior}">
<option value="0">${OptionDateAddedImportTime}</option> <option value="0">${OptionDateAddedImportTime}</option>

View file

@ -64,7 +64,7 @@
var premiereDate = datetime.parseISO8601Date(item.PremiereDate, true); var premiereDate = datetime.parseISO8601Date(item.PremiereDate, true);
if (premiereDate.getDate() == new Date().getDate() - 1) { if (datetime.isRelativeDay(premiereDate, -1)) {
dateText = Globalize.translate('Yesterday'); dateText = Globalize.translate('Yesterday');
} else { } else {
dateText = LibraryBrowser.getFutureDateText(premiereDate, true); dateText = LibraryBrowser.getFutureDateText(premiereDate, true);

View file

@ -60,6 +60,7 @@
itemsContainer.classList.remove('vertical-list'); itemsContainer.classList.remove('vertical-list');
itemsContainer.classList.add('vertical-wrap'); itemsContainer.classList.add('vertical-wrap');
itemsContainer.classList.add('centered');
} }
itemsContainer.innerHTML = ''; itemsContainer.innerHTML = '';
} }
@ -109,18 +110,11 @@
shape: "auto", shape: "auto",
centerText: true, centerText: true,
lazy: true, lazy: true,
coverImage: item.Type == 'PhotoAlbum' coverImage: item.Type == 'PhotoAlbum',
context: 'folders'
}; };
if (viewStyle == "Backdrop") { if (viewStyle == "PosterCard") {
posterOptions.shape = 'backdrop';
posterOptions.showTitle = true;
posterOptions.preferBackdrop = true;
html = cardBuilder.getCardsHtml(posterOptions);
}
else if (viewStyle == "PosterCard") {
posterOptions.showTitle = true; posterOptions.showTitle = true;
posterOptions.showYear = true; posterOptions.showYear = true;
@ -137,9 +131,11 @@
}); });
} }
else if (viewStyle == "Thumb") { else if (viewStyle == "Thumb") {
posterOptions.preferThumb = true; posterOptions.preferThumb = true;
posterOptions.showTitle = true;
posterOptions.shape = "backdrop"; posterOptions.shape = "backdrop";
posterOptions.centerText = true;
posterOptions.overlayText = false;
html = cardBuilder.getCardsHtml(posterOptions); html = cardBuilder.getCardsHtml(posterOptions);
} else { } else {

View file

@ -1625,14 +1625,22 @@ var AppInfo = {};
Dashboard.navigate('home.html?tab=3'); Dashboard.navigate('home.html?tab=3');
}; };
function showItem(item) { function showItem(item, serverId, options) {
if (typeof (item) === 'string') { if (typeof (item) === 'string') {
require(['connectionManager'], function (connectionManager) { require(['connectionManager'], function (connectionManager) {
var apiClient = connectionManager.currentApiClient(); var apiClient = connectionManager.currentApiClient();
apiClient.getItem(apiClient.getCurrentUserId(), item).then(showItem); apiClient.getItem(apiClient.getCurrentUserId(), item).then(function (item) {
embyRouter.showItem(item, options);
});
}); });
} else { } else {
Emby.Page.show('/' + LibraryBrowser.getHref(item), { item: item });
if (arguments.length == 2) {
options = arguments[1];
}
var context = options ? options.context : null;
Emby.Page.show('/' + LibraryBrowser.getHref(item, context), { item: item });
} }
} }
@ -1954,6 +1962,7 @@ var AppInfo = {};
dependencies: ['emby-button', 'emby-input'], dependencies: ['emby-button', 'emby-input'],
autoFocus: false, autoFocus: false,
anonymous: true, anonymous: true,
startup: true,
controller: 'scripts/connectlogin' controller: 'scripts/connectlogin'
}); });
@ -2053,6 +2062,7 @@ var AppInfo = {};
path: '/forgotpassword.html', path: '/forgotpassword.html',
dependencies: ['emby-input', 'emby-button'], dependencies: ['emby-input', 'emby-button'],
anonymous: true, anonymous: true,
startup: true,
controller: 'scripts/forgotpassword' controller: 'scripts/forgotpassword'
}); });
@ -2061,6 +2071,7 @@ var AppInfo = {};
dependencies: ['emby-input', 'emby-button'], dependencies: ['emby-input', 'emby-button'],
autoFocus: false, autoFocus: false,
anonymous: true, anonymous: true,
startup: true,
controller: 'scripts/forgotpasswordpin' controller: 'scripts/forgotpasswordpin'
}); });
@ -2242,6 +2253,7 @@ var AppInfo = {};
dependencies: ['emby-button', 'humanedate', 'emby-input'], dependencies: ['emby-button', 'humanedate', 'emby-input'],
autoFocus: false, autoFocus: false,
anonymous: true, anonymous: true,
startup: true,
controller: 'scripts/loginpage' controller: 'scripts/loginpage'
}); });
@ -2471,6 +2483,7 @@ var AppInfo = {};
dependencies: ['listViewStyle', 'emby-button'], dependencies: ['listViewStyle', 'emby-button'],
autoFocus: false, autoFocus: false,
anonymous: true, anonymous: true,
startup: true,
controller: 'scripts/selectserver' controller: 'scripts/selectserver'
}); });

View file

@ -66,7 +66,7 @@
var premiereDate = datetime.parseISO8601Date(item.PremiereDate, true); var premiereDate = datetime.parseISO8601Date(item.PremiereDate, true);
if (premiereDate.getDate() == new Date().getDate() - 1) { if (datetime.isRelativeDay(premiereDate, -1)) {
dateText = Globalize.translate('Yesterday'); dateText = Globalize.translate('Yesterday');
} else { } else {
dateText = libraryBrowser.getFutureDateText(premiereDate, true); dateText = libraryBrowser.getFutureDateText(premiereDate, true);

View file

@ -2300,7 +2300,7 @@
"LabelffmpegVersion": "FFmpeg version:", "LabelffmpegVersion": "FFmpeg version:",
"LabelffmpegPathHelp": "The path to your downloaded FFmpeg application, or folder containing FFmpeg.", "LabelffmpegPathHelp": "The path to your downloaded FFmpeg application, or folder containing FFmpeg.",
"SetupFFmpeg": "Setup FFmpeg", "SetupFFmpeg": "Setup FFmpeg",
"SetupFFmpegHelp": "FFmpeg is a required component and needs to be configured.", "SetupFFmpegHelp": "Emby may require a library or application to convert certain media types. There are many different applications available, however, Emby has been tested to work with ffmpeg. Emby is in no way affiliated with ffmpeg, its ownership, code or distribution.",
"EnterFFmpegLocation": "Enter FFmpeg path", "EnterFFmpegLocation": "Enter FFmpeg path",
"DownloadFFmpeg": "Download FFmpeg", "DownloadFFmpeg": "Download FFmpeg",
"FFmpegSuggestedDownload": "Suggested download: {0}", "FFmpegSuggestedDownload": "Suggested download: {0}",
@ -2323,5 +2323,6 @@
"HeaderOfflineSync": "Offline Sync", "HeaderOfflineSync": "Offline Sync",
"LabelMaxAudioFileBitrate": "Max audio file bitrate:", "LabelMaxAudioFileBitrate": "Max audio file bitrate:",
"LabelMaxAudioFileBitrateHelp": "Audio files with a higher bitrate will be converted by Emby Server. Select a higher value for better quality, or a lower value to conserve local storage space.", "LabelMaxAudioFileBitrateHelp": "Audio files with a higher bitrate will be converted by Emby Server. Select a higher value for better quality, or a lower value to conserve local storage space.",
"LabelVaapiDevice": "VA API Device:" "LabelVaapiDevice": "VA API Device:",
"LabelVaapiDeviceHelp": "This is the render node that is used for hardware acceleration."
} }