stub out channel mapping

This commit is contained in:
Luke Pulverenti 2016-06-09 12:13:25 -04:00
parent 1da301d7e5
commit 59b4199fc0
13 changed files with 253 additions and 53 deletions

View File

@ -15,12 +15,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.4.34",
"_release": "1.4.34",
"version": "1.4.35",
"_release": "1.4.35",
"_resolution": {
"type": "version",
"tag": "1.4.34",
"commit": "412b8b2523dd3d55952f1caeb0c2cb97b51d3781"
"tag": "1.4.35",
"commit": "bcbcfaeee154165b27ee748bf3816ea713d3caec"
},
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.0",

View File

@ -5,23 +5,6 @@
var self = this;
var items = {};
self.refresh = function () {
reloadPage(options.element);
};
self.destroy = function () {
events.off(serverNotifications, 'TimerCreated', onTimerCreated);
events.off(serverNotifications, 'SeriesTimerCreated', onSeriesTimerCreated);
events.off(serverNotifications, 'TimerCancelled', onTimerCancelled);
events.off(serverNotifications, 'SeriesTimerCancelled', onSeriesTimerCancelled);
clearCurrentTimeUpdateInterval();
itemShortcuts.off(options.element);
items = {};
};
self.options = options;
// 30 mins
@ -40,6 +23,24 @@
var channelsPromise;
self.refresh = function () {
currentDate = null;
reloadPage(options.element);
};
self.destroy = function () {
events.off(serverNotifications, 'TimerCreated', onTimerCreated);
events.off(serverNotifications, 'SeriesTimerCreated', onSeriesTimerCreated);
events.off(serverNotifications, 'TimerCancelled', onTimerCancelled);
events.off(serverNotifications, 'SeriesTimerCancelled', onSeriesTimerCancelled);
clearCurrentTimeUpdateInterval();
itemShortcuts.off(options.element);
items = {};
};
function normalizeDateToTimeslot(date) {
var minutesOffset = date.getMinutes() - cellCurationMinutes;
@ -128,7 +129,7 @@
var limit = 5;
context.querySelector('.guideRequiresUnlock').classList.remove('hide');
context.querySelector('.unlockText').innerHTML = globalize.translate('LiveTvGuideRequiresUnlock', limit);
context.querySelector('.unlockText').innerHTML = globalize.translate('sharedcomponents#LiveTvGuideRequiresUnlock', limit);
return limit;
});
@ -797,7 +798,7 @@
require(['text!./tvguide.template.html'], function (template) {
var context = options.element;
context.innerHTML = globalize.translateDocument(template, 'core');
context.innerHTML = globalize.translateDocument(template, 'sharedcomponents');
var programGrid = context.querySelector('.programGrid');
var timeslotHeaders = context.querySelector('.timeslotHeaders');

View File

@ -27,7 +27,7 @@ button.listItem {
.listItemBody {
flex-grow: 1;
padding: .35em 1.25em;
padding: .85em 1.25em;
overflow: hidden;
text-overflow: ellipsis;
}
@ -78,6 +78,10 @@ button.listItem {
right: 0;
}
.listItem .secondary {
color: #737373;
}
.listItem:focus .secondary {
color: inherit !important;
}

View File

@ -1,7 +1,7 @@
{
"name": "prism-element",
"description": "Prism.js import and syntax highlighting",
"version": "1.0.4",
"version": "1.1.0",
"authors": [
"The Polymer Project Authors (https://polymer.github.io/AUTHORS.txt)"
],
@ -25,7 +25,7 @@
],
"dependencies": {
"prism": "*",
"polymer": "Polymer/polymer#^1.0.0"
"polymer": "Polymer/polymer#^1.5.0"
},
"devDependencies": {
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
@ -33,11 +33,11 @@
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
"web-component-tester": "^4.0.0"
},
"_release": "1.0.4",
"_release": "1.1.0",
"_resolution": {
"type": "version",
"tag": "1.0.4",
"commit": "f5786216574e6ab9ef52434e588d37e9f3785b9e"
"tag": "v1.1.0",
"commit": "4c9366c79db87cb5eee3263452875b951b9741ed"
},
"_source": "git://github.com/PolymerElements/prism-element.git",
"_target": "^1.0.0",

View File

@ -1,7 +1,7 @@
{
"name": "prism-element",
"description": "Prism.js import and syntax highlighting",
"version": "1.0.4",
"version": "1.1.0",
"authors": [
"The Polymer Project Authors (https://polymer.github.io/AUTHORS.txt)"
],
@ -25,7 +25,7 @@
],
"dependencies": {
"prism": "*",
"polymer": "Polymer/polymer#^1.0.0"
"polymer": "Polymer/polymer#^1.5.0"
},
"devDependencies": {
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",

View File

@ -24,6 +24,9 @@ containing the source to highlight. The event detail can optionally contain a
`lang` property, containing a string like `"html"`, `"js"`, etc.
This flow is supported by [`<marked-element>`](https://github.com/PolymerElements/marked-element).
@element prism-highlighter
@demo demo/index.html
-->
<script>
(function() {
@ -55,10 +58,12 @@ This flow is supported by [`<marked-element>`](https://github.com/PolymerElement
*/
_highlight: function(event) {
if (!event.detail || !event.detail.code) {
console.warn('Malformed', HIGHLIGHT_EVENT, 'event:', event.detail);
Polymer.Base._warn('Malformed', HIGHLIGHT_EVENT, 'event:', event.detail);
return;
}
event.stopPropagation();
var detail = event.detail;
detail.code = Prism.highlight(detail.code, this._detectLang(detail.code, detail.lang));
},

View File

@ -0,0 +1,151 @@
<!--
@license
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<dom-module id="prism-theme-default">
<template>
<style>
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #a67f59;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
</style>
</template>
</dom-module>

View File

@ -1,23 +1,71 @@
define(['dialogHelper', 'loading', 'connectionManager', 'globalize', 'paper-checkbox', 'emby-input', 'paper-icon-button-light', 'emby-select', 'emby-button'],
define(['dialogHelper', 'loading', 'connectionManager', 'globalize', 'paper-checkbox', 'emby-input', 'paper-icon-button-light', 'emby-select', 'emby-button', 'listViewStyle'],
function (dialogHelper, loading, connectionManager, globalize) {
var currentServerId;
function getChannelMappingOptions(serverId, providerId) {
return connectionManager.getApiClient(serverId).getJSON(ApiClient.getUrl('LiveTv/ChannelMappingOptions', {
providerId: providerId
}));
}
function getTunerChannelHtml(channel, providerName) {
var html = '';
html += '<div class="listItem">';
html += '<button is="emby-button" type="button" class="fab listItemIcon mini" style="background:#52B54B;"><iron-icon icon="dvr"></iron-icon></button>';
html += '<div class="listItemBody">';
html += '<h3>';
html += channel.Name;
html += '</h3>';
if (channel.ProviderChannelNumber || channel.ProviderChannelName) {
html += '<div class="secondary">';
html += (channel.ProviderChannelNumber || '') + ' ' + (channel.ProviderChannelName || '') + ' - ' + providerName;
html += '</div>';
}
html += '</div>';
html += '<button is="paper-icon-button-light" type="button" onclick="alert(\'coming soon.\');"><iron-icon icon="mode-edit"></iron-icon></button>';
html += '</div>';
return html;
}
function getEditorHtml() {
var html = '';
html += '<div class="dialogContent">';
html += '<div class="dialogContentInner centeredContent">';
html += 'coming soon';
html += '<form style="margin:auto;">';
html += '<h1>' + globalize.translate('HeaderChannels') + '</h1>';
html += '<div class="channels paperList">';
html += '</div>';
html += '</form>';
html += '</div>';
html += '</div>';
return html;
}
function initEditor(content, items) {
function initEditor(dlg, options) {
getChannelMappingOptions(options.serverId, options.providerId).then(function (result) {
dlg.querySelector('.channels').innerHTML = result.TunerChannels.map(function (channel) {
return getTunerChannelHtml(channel, result.ProviderName);
}).join('');
});
}
return function () {
@ -26,7 +74,6 @@ function (dialogHelper, loading, connectionManager, globalize) {
self.show = function (options) {
var items = options.items || {};
currentServerId = options.serverId;
var dialogOptions = {
@ -57,7 +104,7 @@ function (dialogHelper, loading, connectionManager, globalize) {
dlg.innerHTML = html;
document.body.appendChild(dlg);
initEditor(dlg, items);
initEditor(dlg, options);
dlg.querySelector('.btnCancel').addEventListener('click', function () {

View File

@ -1108,15 +1108,7 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
}
}
@media all and (max-height: 650px) {
.vertical.alphabetPicker .alphaPickerButton {
padding-top: 2px !important;
padding-bottom: 2px !important;
}
}
@media all and (max-height: 600px) {
@media all and (max-height: 700px) {
.vertical.alphabetPicker .alphaPickerButton {
padding-top: 1px !important;
@ -1124,7 +1116,7 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
}
}
@media all and (max-height: 550px) {
@media all and (max-height: 600px) {
.vertical.alphabetPicker .alphaPickerButton {
padding-top: 0 !important;

View File

@ -446,7 +446,7 @@
display: none !important;
}
.dashboardDocument .btnCast {
.dashboardDocument .btnCast, .dashboardDocument .headerSelectedPlayer {
display: none !important;
}

View File

@ -943,7 +943,7 @@
case 'playlist':
require(['playlistEditor'], function (playlistEditor) {
new playlistEditor().show({
items: items,
items: [itemId],
serverId: serverId
});
});

View File

@ -33,7 +33,7 @@
html += '<button is="paper-icon-button-light" class="headerButton headerButtonRight headerVoiceButton hide"><iron-icon icon="mic"></iron-icon></button>';
html += '<button is="paper-icon-button-light" class="headerButton headerButtonRight btnNotifications clearButton"><div class="btnNotificationsInner">0</div></button>';
html += '<button is="paper-icon-button-light" class="headerButton headerButtonRight btnNotifications"><div class="btnNotificationsInner">0</div></button>';
html += '<button is="paper-icon-button-light" class="headerButton headerButtonRight headerUserButton"><iron-icon icon="person"></iron-icon></button>';

View File

@ -333,7 +333,7 @@
});
}
function showProviderOptions(page, id, button) {
function showProviderOptions(page, providerId, button) {
var items = [];
@ -358,10 +358,10 @@
switch (id) {
case 'delete':
deleteProvider(page, id);
deleteProvider(page, providerId);
break;
case 'map':
mapChannels(page, id);
mapChannels(page, providerId);
break;
default:
break;