From 7e0be1ddcaa7cd0aead95ae892e529750939372f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 20 Aug 2015 17:58:07 -0400 Subject: [PATCH] update live tv page --- .../paper-checkbox/.bower.json | 8 +- .../paper-checkbox/bower.json | 2 +- .../paper-checkbox/paper-checkbox.html | 26 ++++-- .../paper-checkbox/test/basic.html | 10 +++ dashboard-ui/scripts/livetvstatus.js | 80 +++++++++++-------- dashboard-ui/thirdparty/emby-icons.html | 1 + .../thirdparty/paper-button-style.css | 2 +- dashboard-ui/vulcanize-out.html | 27 +++++-- 8 files changed, 100 insertions(+), 56 deletions(-) diff --git a/dashboard-ui/bower_components/paper-checkbox/.bower.json b/dashboard-ui/bower_components/paper-checkbox/.bower.json index 099821466..6a69f2cd3 100644 --- a/dashboard-ui/bower_components/paper-checkbox/.bower.json +++ b/dashboard-ui/bower_components/paper-checkbox/.bower.json @@ -1,6 +1,6 @@ { "name": "paper-checkbox", - "version": "1.0.6", + "version": "1.0.7", "description": "A material design checkbox", "authors": [ "The Polymer Authors" @@ -34,11 +34,11 @@ "paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0", "polymer": "Polymer/polymer#^1.0.0" }, - "_release": "1.0.6", + "_release": "1.0.7", "_resolution": { "type": "version", - "tag": "v1.0.6", - "commit": "764d2f12406ac85aa5e66f280163cb3795c16e20" + "tag": "v1.0.7", + "commit": "129dc6c91e82978b38790061971cbae04f71fc9c" }, "_source": "git://github.com/PolymerElements/paper-checkbox.git", "_target": "~1.0.5", diff --git a/dashboard-ui/bower_components/paper-checkbox/bower.json b/dashboard-ui/bower_components/paper-checkbox/bower.json index 656a55bae..5f52473ab 100644 --- a/dashboard-ui/bower_components/paper-checkbox/bower.json +++ b/dashboard-ui/bower_components/paper-checkbox/bower.json @@ -1,6 +1,6 @@ { "name": "paper-checkbox", - "version": "1.0.6", + "version": "1.0.7", "description": "A material design checkbox", "authors": [ "The Polymer Authors" diff --git a/dashboard-ui/bower_components/paper-checkbox/paper-checkbox.html b/dashboard-ui/bower_components/paper-checkbox/paper-checkbox.html index 652382717..1d598f4ff 100644 --- a/dashboard-ui/bower_components/paper-checkbox/paper-checkbox.html +++ b/dashboard-ui/bower_components/paper-checkbox/paper-checkbox.html @@ -110,15 +110,25 @@ Custom property | Description | Default }, 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; + + // 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 + * (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 diff --git a/dashboard-ui/bower_components/paper-checkbox/test/basic.html b/dashboard-ui/bower_components/paper-checkbox/test/basic.html index f5cbf5c93..f4ee7d644 100644 --- a/dashboard-ui/bower_components/paper-checkbox/test/basic.html +++ b/dashboard-ui/bower_components/paper-checkbox/test/basic.html @@ -76,6 +76,16 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }); 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() { diff --git a/dashboard-ui/scripts/livetvstatus.js b/dashboard-ui/scripts/livetvstatus.js index 846fdf665..f699bdd26 100644 --- a/dashboard-ui/scripts/livetvstatus.js +++ b/dashboard-ui/scripts/livetvstatus.js @@ -185,34 +185,39 @@ var html = ''; - html += ''; - - var elem = $('.devicesList', page).html(html).trigger('create'); + var elem = $('.devicesList', page).html(html); $('.btnDeleteDevice', elem).on('click', function () { @@ -287,27 +292,34 @@ var html = ''; - html += ''; - - var elem = $('.providerList', page).html(html).trigger('create'); + var elem = $('.providerList', page).html(html); $('.btnDelete', elem).on('click', function () { diff --git a/dashboard-ui/thirdparty/emby-icons.html b/dashboard-ui/thirdparty/emby-icons.html index a68af9f3e..dd74fa69c 100644 --- a/dashboard-ui/thirdparty/emby-icons.html +++ b/dashboard-ui/thirdparty/emby-icons.html @@ -127,6 +127,7 @@ See [iron-iconset](#iron-iconset) and [iron-iconset-svg](#iron-iconset-svg) for + diff --git a/dashboard-ui/thirdparty/paper-button-style.css b/dashboard-ui/thirdparty/paper-button-style.css index eeae7acef..ac392b809 100644 --- a/dashboard-ui/thirdparty/paper-button-style.css +++ b/dashboard-ui/thirdparty/paper-button-style.css @@ -388,7 +388,7 @@ paper-input label, 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 { diff --git a/dashboard-ui/vulcanize-out.html b/dashboard-ui/vulcanize-out.html index 4926828ef..106a0830d 100644 --- a/dashboard-ui/vulcanize-out.html +++ b/dashboard-ui/vulcanize-out.html @@ -18417,15 +18417,25 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }, 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; + + // 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 + * (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 @@ -18677,6 +18687,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN +