1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update live tv page

This commit is contained in:
Luke Pulverenti 2015-08-20 17:58:07 -04:00
parent 2a0c84a99d
commit 7e0be1ddca
8 changed files with 100 additions and 56 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "paper-checkbox", "name": "paper-checkbox",
"version": "1.0.6", "version": "1.0.7",
"description": "A material design checkbox", "description": "A material design checkbox",
"authors": [ "authors": [
"The Polymer Authors" "The Polymer Authors"
@ -34,11 +34,11 @@
"paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0", "paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
"polymer": "Polymer/polymer#^1.0.0" "polymer": "Polymer/polymer#^1.0.0"
}, },
"_release": "1.0.6", "_release": "1.0.7",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.6", "tag": "v1.0.7",
"commit": "764d2f12406ac85aa5e66f280163cb3795c16e20" "commit": "129dc6c91e82978b38790061971cbae04f71fc9c"
}, },
"_source": "git://github.com/PolymerElements/paper-checkbox.git", "_source": "git://github.com/PolymerElements/paper-checkbox.git",
"_target": "~1.0.5", "_target": "~1.0.5",

View file

@ -1,6 +1,6 @@
{ {
"name": "paper-checkbox", "name": "paper-checkbox",
"version": "1.0.6", "version": "1.0.7",
"description": "A material design checkbox", "description": "A material design checkbox",
"authors": [ "authors": [
"The Polymer Authors" "The Polymer Authors"

View file

@ -110,15 +110,25 @@ Custom property | Description | Default
}, },
attached: function() { attached: function() {
var trimmedText = Polymer.dom(this).textContent.trim();
if (trimmedText === '') {
this.$.checkboxLabel.hidden = true;
}
// Don't stomp over a user-set aria-label.
if (trimmedText !== '' && !this.getAttribute('aria-label')) {
this.setAttribute('aria-label', trimmedText);
}
this._isReady = true; this._isReady = true;
// Don't stomp over a user-set aria-label.
if (!this.getAttribute('aria-label')) {
this.updateAriaLabel();
}
},
/**
* Update the checkbox aria-label. This is a temporary workaround not
* being able to observe changes in <content>
* (see: https://github.com/Polymer/polymer/issues/1773)
*
* Call this if you manually change the contents of the checkbox
* and want the aria-label to match the new contents.
*/
updateAriaLabel: function() {
this.setAttribute('aria-label', Polymer.dom(this).textContent.trim());
}, },
// button-behavior hook // button-behavior hook

View file

@ -76,6 +76,16 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}); });
MockInteractions.tap(c1); MockInteractions.tap(c1);
}); });
test('checkbox label can be updated', function() {
Polymer.dom(c1).textContent = 'Batman';
c1.updateAriaLabel();
assert.isTrue(c1.getAttribute('aria-label') == 'Batman');
Polymer.dom(c1).textContent = 'Robin';
c1.updateAriaLabel();
assert.isTrue(c1.getAttribute('aria-label') == 'Robin');
});
}); });
suite('a11y', function() { suite('a11y', function() {

View file

@ -185,34 +185,39 @@
var html = ''; var html = '';
html += '<ul data-role="listview" data-inset="true" data-split-icon="delete">'; if (devices.length) {
html += '<div class="paperList">';
for (var i = 0, length = devices.length; i < length; i++) { for (var i = 0, length = devices.length; i < length; i++) {
var device = devices[i]; var device = devices[i];
var href = 'livetvtunerprovider-' + device.Type + '.html?id=' + device.Id; var href = 'livetvtunerprovider-' + device.Type + '.html?id=' + device.Id;
html += '<li>'; html += '<paper-icon-item>';
html += '<a href="' + href + '">';
html += '<h3>'; html += '<paper-fab class="listAvatar" style="background:#52B54B;" icon="live-tv" item-icon></paper-fab>';
html += getTunerName(device.Type);
html += '</h3>';
html += '<p>'; html += '<paper-item-body two-line>';
html += device.Url; html += '<a class="clearLink" href="' + href + '">';
html += '</p>'; html += '<div>';
html += getTunerName(device.Type);
html += '</div>';
html += '</a>'; html += '<div secondary>';
html += '<a href="#" class="btnDeleteDevice" data-id="' + device.Id + '">'; html += device.Url;
html += '</a>'; html += '</div>';
html += '</li>'; html += '</a>';
html += '</paper-item-body>';
html += '<paper-icon-button icon="cancel" data-id="' + device.Id + '" title="' + Globalize.translate('ButtonDelete') + '" class="btnDeleteDevice"></paper-icon-button>';
html += '</paper-icon-item>';
}
html += '</div>';
} }
html += '</ul>'; var elem = $('.devicesList', page).html(html);
var elem = $('.devicesList', page).html(html).trigger('create');
$('.btnDeleteDevice', elem).on('click', function () { $('.btnDeleteDevice', elem).on('click', function () {
@ -287,27 +292,34 @@
var html = ''; var html = '';
html += '<ul data-role="listview" data-inset="true" data-split-icon="delete">'; if (providers.length) {
html += '<div class="paperList">';
for (var i = 0, length = providers.length; i < length; i++) { for (var i = 0, length = providers.length; i < length; i++) {
var provider = providers[i]; var provider = providers[i];
html += '<li>'; html += '<paper-icon-item>';
html += '<a href="' + getProviderConfigurationUrl(provider.Type) + '?id=' + provider.Id + '">';
html += '<h3>'; html += '<paper-fab class="listAvatar" icon="dvr" item-icon></paper-fab>';
html += getProviderName(provider.Type);
html += '</h3>';
html += '</a>'; html += '<paper-item-body two-line>';
html += '<a href="#" class="btnDelete" data-id="' + provider.Id + '">';
html += '</a>'; html += '<a class="clearLink" href="' + getProviderConfigurationUrl(provider.Type) + '?id=' + provider.Id + '">';
html += '</li>';
html += '<div>';
html += getProviderName(provider.Type);
html += '</div>';
html += '</a>';
html += '</paper-item-body>';
html += '<paper-icon-button icon="cancel" data-id="' + provider.Id + '" title="' + Globalize.translate('ButtonDelete') + '" class="btnDelete"></paper-icon-button>';
html += '</paper-icon-item>';
}
html += '</div>';
} }
html += '</ul>'; var elem = $('.providerList', page).html(html);
var elem = $('.providerList', page).html(html).trigger('create');
$('.btnDelete', elem).on('click', function () { $('.btnDelete', elem).on('click', function () {

View file

@ -127,6 +127,7 @@ See [iron-iconset](#iron-iconset) and [iron-iconset-svg](#iron-iconset-svg) for
<g id="open-in-browser"><path d="M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h4v-2H5V8h14v10h-4v2h4c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2zm-7 6l-4 4h3v6h2v-6h3l-4-4z" /></g> <g id="open-in-browser"><path d="M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h4v-2H5V8h14v10h-4v2h4c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2zm-7 6l-4 4h3v6h2v-6h3l-4-4z" /></g>
<g id="cloud-download"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z" /></g> <g id="cloud-download"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z" /></g>
<g id="cancel"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z" /></g> <g id="cancel"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z" /></g>
<g id="dvr"><path d="M21 3H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5c0-1.1-.9-2-2-2zm0 14H3V5h18v12zm-2-9H8v2h11V8zm0 4H8v2h11v-2zM7 8H5v2h2V8zm0 4H5v2h2v-2z" /></g>
</defs> </defs>
</svg> </svg>
</iron-iconset-svg> </iron-iconset-svg>

View file

@ -388,7 +388,7 @@ paper-input label, paper-textarea label {
} }
.ui-page-theme-a paper-input label, .ui-page-theme-a paper-textarea label { .ui-page-theme-a paper-input label, .ui-page-theme-a paper-textarea label {
color: #222 !important; color: #333 !important;
} }
.ui-page-theme-a .label-is-highlighted label { .ui-page-theme-a .label-is-highlighted label {

View file

@ -18417,15 +18417,25 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}, },
attached: function() { attached: function() {
var trimmedText = Polymer.dom(this).textContent.trim();
if (trimmedText === '') {
this.$.checkboxLabel.hidden = true;
}
// Don't stomp over a user-set aria-label.
if (trimmedText !== '' && !this.getAttribute('aria-label')) {
this.setAttribute('aria-label', trimmedText);
}
this._isReady = true; this._isReady = true;
// Don't stomp over a user-set aria-label.
if (!this.getAttribute('aria-label')) {
this.updateAriaLabel();
}
},
/**
* Update the checkbox aria-label. This is a temporary workaround not
* being able to observe changes in <content>
* (see: https://github.com/Polymer/polymer/issues/1773)
*
* Call this if you manually change the contents of the checkbox
* and want the aria-label to match the new contents.
*/
updateAriaLabel: function() {
this.setAttribute('aria-label', Polymer.dom(this).textContent.trim());
}, },
// button-behavior hook // button-behavior hook
@ -18677,6 +18687,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<g id="open-in-browser"><path d="M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h4v-2H5V8h14v10h-4v2h4c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2zm-7 6l-4 4h3v6h2v-6h3l-4-4z"></path></g> <g id="open-in-browser"><path d="M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h4v-2H5V8h14v10h-4v2h4c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2zm-7 6l-4 4h3v6h2v-6h3l-4-4z"></path></g>
<g id="cloud-download"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z"></path></g> <g id="cloud-download"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z"></path></g>
<g id="cancel"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"></path></g> <g id="cancel"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"></path></g>
<g id="dvr"><path d="M21 3H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5c0-1.1-.9-2-2-2zm0 14H3V5h18v12zm-2-9H8v2h11V8zm0 4H8v2h11v-2zM7 8H5v2h2V8zm0 4H5v2h2v-2z"></path></g>
</defs> </defs>
</svg> </svg>
</iron-iconset-svg> </iron-iconset-svg>