diff --git a/dashboard-ui/apiclient/apiclient.js b/dashboard-ui/apiclient/apiclient.js index bff043df18..e301143cb2 100644 --- a/dashboard-ui/apiclient/apiclient.js +++ b/dashboard-ui/apiclient/apiclient.js @@ -166,7 +166,7 @@ var accessToken = currentServerInfo.AccessToken; if (accessToken) { - headers['X-Emby-Token'] = accessToken; + headers['X-MediaBrowser-Token'] = accessToken; } }; diff --git a/dashboard-ui/bower_components/iron-media-query/.bower.json b/dashboard-ui/bower_components/iron-media-query/.bower.json index ce3268073c..4441523809 100644 --- a/dashboard-ui/bower_components/iron-media-query/.bower.json +++ b/dashboard-ui/bower_components/iron-media-query/.bower.json @@ -1,6 +1,6 @@ { "name": "iron-media-query", - "version": "1.0.2", + "version": "1.0.3", "description": "Lets you bind to a CSS media query", "authors": [ "The Polymer Authors" @@ -28,11 +28,11 @@ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, - "_release": "1.0.2", + "_release": "1.0.3", "_resolution": { "type": "version", - "tag": "v1.0.2", - "commit": "34abf0a3b8bf9e9e478352dbb3d9e6a76bf3669a" + "tag": "v1.0.3", + "commit": "80e921f58e7688a840a0cf29e9e2aaaee72a66b2" }, "_source": "git://github.com/PolymerElements/iron-media-query.git", "_target": "^1.0.0", diff --git a/dashboard-ui/bower_components/iron-media-query/bower.json b/dashboard-ui/bower_components/iron-media-query/bower.json index 48c342af80..67670a1dbe 100644 --- a/dashboard-ui/bower_components/iron-media-query/bower.json +++ b/dashboard-ui/bower_components/iron-media-query/bower.json @@ -1,6 +1,6 @@ { "name": "iron-media-query", - "version": "1.0.2", + "version": "1.0.3", "description": "Lets you bind to a CSS media query", "authors": [ "The Polymer Authors" diff --git a/dashboard-ui/bower_components/iron-media-query/iron-media-query.html b/dashboard-ui/bower_components/iron-media-query/iron-media-query.html index 8325eb2f7f..a0619622eb 100644 --- a/dashboard-ui/bower_components/iron-media-query/iron-media-query.html +++ b/dashboard-ui/bower_components/iron-media-query/iron-media-query.html @@ -48,23 +48,47 @@ Example: query: { type: String, observer: 'queryChanged' + }, + + _boundMQHandler: { + value: function() { + return this.queryHandler.bind(this); + } } - }, - created: function() { - this._mqHandler = this.queryHandler.bind(this); + attached: function() { + this.queryChanged(); }, - queryChanged: function(query) { + detached: function() { + this._remove(); + }, + + _add: function() { if (this._mq) { - this._mq.removeListener(this._mqHandler); + this._mq.addListener(this._boundMQHandler); + } + }, + + _remove: function() { + if (this._mq) { + this._mq.removeListener(this._boundMQHandler); + } + this._mq = null; + }, + + queryChanged: function() { + this._remove(); + var query = this.query; + if (!query) { + return; } if (query[0] !== '(') { query = '(' + query + ')'; } this._mq = window.matchMedia(query); - this._mq.addListener(this._mqHandler); + this._add(); this.queryHandler(this._mq); }, diff --git a/dashboard-ui/bower_components/iron-media-query/test/basic.html b/dashboard-ui/bower_components/iron-media-query/test/basic.html index 34346c290d..c2db515dde 100644 --- a/dashboard-ui/bower_components/iron-media-query/test/basic.html +++ b/dashboard-ui/bower_components/iron-media-query/test/basic.html @@ -61,6 +61,42 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN assert.equal(mq.queryMatches, true); }); + test('automatically wrap with parens', function() { + mq.query = 'min-width: 1px'; + assert.equal(mq.queryMatches, true); + }); + + suite('query does not activate on empty string or null', function() { + + test('empty string', function() { + mq.query = ''; + assert.notOk(mq._mq); + }); + + test('null', function() { + mq.query = null; + assert.notOk(mq._mq); + }); + + }); + + test('media query destroys on detach', function() { + mq.query = '(max-width: 800px)'; + mq.parentNode.removeChild(mq); + Polymer.dom.flush(); + assert.notOk(mq._mq); + }); + + test('media query re-enables on attach', function() { + mq.query = '(max-width: 800px)'; + var parent = mq.parentNode; + parent.removeChild(mq); + Polymer.dom.flush(); + parent.appendChild(mq); + Polymer.dom.flush(); + assert.ok(mq._mq); + }); + }); }); diff --git a/dashboard-ui/bower_components/iron-selector/.bower.json b/dashboard-ui/bower_components/iron-selector/.bower.json index f5249f57ac..8c65ba5e1a 100644 --- a/dashboard-ui/bower_components/iron-selector/.bower.json +++ b/dashboard-ui/bower_components/iron-selector/.bower.json @@ -1,6 +1,6 @@ { "name": "iron-selector", - "version": "1.0.6", + "version": "1.0.7", "description": "Manages a set of elements that can be selected", "private": true, "license": "http://polymer.github.io/LICENSE.txt", @@ -32,11 +32,11 @@ "web-component-tester": "*", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, - "_release": "1.0.6", + "_release": "1.0.7", "_resolution": { "type": "version", - "tag": "v1.0.6", - "commit": "08fa18c70b79abdee8a02486223ab9a4f0acc72c" + "tag": "v1.0.7", + "commit": "0b2f484ac3b1b03400da2d38b0f543f3688150a4" }, "_source": "git://github.com/PolymerElements/iron-selector.git", "_target": "^1.0.0", diff --git a/dashboard-ui/bower_components/iron-selector/bower.json b/dashboard-ui/bower_components/iron-selector/bower.json index aaff8b87d8..ff00842fb9 100644 --- a/dashboard-ui/bower_components/iron-selector/bower.json +++ b/dashboard-ui/bower_components/iron-selector/bower.json @@ -1,6 +1,6 @@ { "name": "iron-selector", - "version": "1.0.6", + "version": "1.0.7", "description": "Manages a set of elements that can be selected", "private": true, "license": "http://polymer.github.io/LICENSE.txt", diff --git a/dashboard-ui/bower_components/iron-selector/iron-selectable.html b/dashboard-ui/bower_components/iron-selector/iron-selectable.html index d8689f674d..eb1fb5fd43 100644 --- a/dashboard-ui/bower_components/iron-selector/iron-selectable.html +++ b/dashboard-ui/bower_components/iron-selector/iron-selectable.html @@ -128,6 +128,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN created: function() { this._bindFilterItem = this._filterItem.bind(this); this._selection = new Polymer.IronSelection(this._applySelection.bind(this)); + // TODO(cdata): When polymer/polymer#2535 lands, we do not need to do this + // book keeping anymore: + this.__listeningForActivate = false; }, attached: function() { @@ -136,6 +139,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN if (!this.selectedItem && this.selected) { this._updateSelected(this.attrForSelected,this.selected) } + this._addListener(this.activateEvent); }, detached: function() { @@ -202,11 +206,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }, _addListener: function(eventName) { + if (!this.isAttached || this.__listeningForActivate) { + return; + } + + this.__listeningForActivate = true; this.listen(this, eventName, '_activateHandler'); }, _removeListener: function(eventName) { this.unlisten(this, eventName, '_activateHandler'); + this.__listeningForActivate = false; }, _activateEventChanged: function(eventName, old) { diff --git a/dashboard-ui/bower_components/iron-selector/test/activate-event.html b/dashboard-ui/bower_components/iron-selector/test/activate-event.html index 8390548f46..9b47eb09b9 100644 --- a/dashboard-ui/bower_components/iron-selector/test/activate-event.html +++ b/dashboard-ui/bower_components/iron-selector/test/activate-event.html @@ -130,6 +130,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN assert.equal(s.selected, '0'); }); + test('activates after detach and re-attach', function() { + // Detach and re-attach + var parent = s.parentNode; + parent.removeChild(s); + parent.appendChild(s); + + // select Item 2 + s.children[2].dispatchEvent(new CustomEvent('tap', {bubbles: true})); + assert.equal(s.selected, '2'); + }); + }); diff --git a/dashboard-ui/cordova/iap.js b/dashboard-ui/cordova/iap.js index ee18d271eb..4dad7d6fe1 100644 --- a/dashboard-ui/cordova/iap.js +++ b/dashboard-ui/cordova/iap.js @@ -54,6 +54,7 @@ // product attributes: // https://github.com/j3k0/cordova-plugin-purchase/blob/master/doc/api.md#validation-error-codes + alert(JSON.stringify(product)); alert(JSON.stringify(product.transaction)); callback(true, { @@ -86,11 +87,12 @@ // show some logs and finish the transaction. store.when(id).approved(function (product) { - if (product.type == store.PAID_SUBSCRIPTION) { - product.verify(); - } else { - product.finish(); - } + product.finish(); + //if (product.type == store.PAID_SUBSCRIPTION) { + // product.verify(); + //} else { + // product.finish(); + //} }); store.when(id).verified(function (p) { diff --git a/dashboard-ui/cordova/registrationservices.js b/dashboard-ui/cordova/registrationservices.js index b46ee1638d..f98a975133 100644 --- a/dashboard-ui/cordova/registrationservices.js +++ b/dashboard-ui/cordova/registrationservices.js @@ -183,6 +183,13 @@ PaperDialogHelper.close(dlg); }); + $(dlg).on('iron-overlay-closed', function () { + + if (window.TabBar) { + TabBar.show(); + } + }); + dlg.classList.add('inAppPurchaseOverlay'); } @@ -222,6 +229,10 @@ require(['components/paperdialoghelper'], function () { + if (window.TabBar) { + TabBar.hide(); + } + showInAppPurchaseElement(subscriptionOptions, unlockableProductInfo, dialogOptions, deferred); currentDisplayingDeferred = deferred; diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index 55f899492d..4bfd1ee808 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -1015,7 +1015,7 @@ renderCollectionItemType(page, parentItem, { name: Globalize.translate('HeaderItems') }, items, user); } - $('.collectionItems', page).createCardMenus(); + $('.collectionItems .itemsContainer', page).createCardMenus(); } function renderCollectionItemType(page, parentItem, type, items, user, context) { @@ -1029,7 +1029,7 @@ html += ''; - html += '
'; + html += '
'; var shape = type.type == 'MusicAlbum' ? 'detailPageSquare' : 'detailPagePortrait'; @@ -1114,7 +1114,9 @@ var reviews = result.Items; - html += '
'; + if (reviews.length) { + html += '
'; + } for (var i = 0, length = reviews.length; i < length; i++) { @@ -1171,7 +1173,9 @@ html += ''; } - html += '
'; + if (reviews.length) { + html += '
'; + } if (limit && result.TotalRecordCount > limit) { html += '

' + Globalize.translate('ButtonMore') + '

'; diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js index f7f5b7e9c9..a967abb94c 100644 --- a/dashboard-ui/scripts/librarylist.js +++ b/dashboard-ui/scripts/librarylist.js @@ -174,7 +174,11 @@ var card = parentWithClass(e.target, 'card'); if (card) { - showContextMenu(card, {}); + var itemSelectionPanel = card.querySelector('.itemSelectionPanel'); + + if (!itemSelectionPanel) { + showContextMenu(card, {}); + } e.preventDefault(); return false; @@ -1364,6 +1368,10 @@ playAllFromHere(index, itemsContainer, 'play'); } + else if (action == 'instantmix') { + + MediaController.instantMix(itemId); + } return false; } diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index b41e58bfe4..298f1cd594 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -1517,27 +1517,18 @@ self.instantMix = function (id) { - var userId = Dashboard.getCurrentUserId(); + var itemLimit = 100; - ApiClient.getItem(userId, id).done(function (item) { + ApiClient.getInstantMixFromItem(id, { + UserId: Dashboard.getCurrentUserId(), + Fields: getItemFields, + Limit: itemLimit - var promise; - var itemLimit = 100; + }).done(function (result) { - promise = ApiClient.getInstantMixFromItem(id, { - UserId: Dashboard.getCurrentUserId(), - Fields: getItemFields, - Limit: itemLimit - }); - - promise.done(function (result) { - - self.play({ items: result.Items }); - - }); + self.play({ items: result.Items }); }); - }; self.stop = function (destroyRenderer) { diff --git a/dashboard-ui/scripts/musicrecommended.js b/dashboard-ui/scripts/musicrecommended.js index 2ff595c13f..1f05dd2f9a 100644 --- a/dashboard-ui/scripts/musicrecommended.js +++ b/dashboard-ui/scripts/musicrecommended.js @@ -87,7 +87,7 @@ shape: getSquareShape(), showTitle: true, showParentTitle: true, - defaultAction: 'play', + defaultAction: 'instantmix', lazy: true, centerText: true, overlayMoreButton: true @@ -132,7 +132,7 @@ shape: getSquareShape(), showTitle: true, showParentTitle: true, - defaultAction: 'play', + defaultAction: 'instantmix', lazy: true, centerText: true, overlayMoreButton: true diff --git a/dashboard-ui/themes/ios.css b/dashboard-ui/themes/ios.css index fb4a859e2d..275575449a 100644 --- a/dashboard-ui/themes/ios.css +++ b/dashboard-ui/themes/ios.css @@ -33,7 +33,7 @@ body { } .background-theme-b, paper-dialog.background-theme-b { - background: radial-gradient(circle, #303030, #101010); + background: radial-gradient(circle, #282828, #101010); } .backdropContainer .pageBackground { diff --git a/dashboard-ui/vulcanize-out.html b/dashboard-ui/vulcanize-out.html index 1e9452607c..310224c81d 100644 --- a/dashboard-ui/vulcanize-out.html +++ b/dashboard-ui/vulcanize-out.html @@ -10915,6 +10915,9 @@ The `aria-labelledby` attribute will be set to the header element, if one exists created: function() { this._bindFilterItem = this._filterItem.bind(this); this._selection = new Polymer.IronSelection(this._applySelection.bind(this)); + // TODO(cdata): When polymer/polymer#2535 lands, we do not need to do this + // book keeping anymore: + this.__listeningForActivate = false; }, attached: function() { @@ -10923,6 +10926,7 @@ The `aria-labelledby` attribute will be set to the header element, if one exists if (!this.selectedItem && this.selected) { this._updateSelected(this.attrForSelected,this.selected) } + this._addListener(this.activateEvent); }, detached: function() { @@ -10989,11 +10993,17 @@ The `aria-labelledby` attribute will be set to the header element, if one exists }, _addListener: function(eventName) { + if (!this.isAttached || this.__listeningForActivate) { + return; + } + + this.__listeningForActivate = true; this.listen(this, eventName, '_activateHandler'); }, _removeListener: function(eventName) { this.unlisten(this, eventName, '_activateHandler'); + this.__listeningForActivate = false; }, _activateEventChanged: function(eventName, old) { @@ -11174,23 +11184,47 @@ The `aria-labelledby` attribute will be set to the header element, if one exists query: { type: String, observer: 'queryChanged' + }, + + _boundMQHandler: { + value: function() { + return this.queryHandler.bind(this); + } } - }, - created: function() { - this._mqHandler = this.queryHandler.bind(this); + attached: function() { + this.queryChanged(); }, - queryChanged: function(query) { + detached: function() { + this._remove(); + }, + + _add: function() { if (this._mq) { - this._mq.removeListener(this._mqHandler); + this._mq.addListener(this._boundMQHandler); + } + }, + + _remove: function() { + if (this._mq) { + this._mq.removeListener(this._boundMQHandler); + } + this._mq = null; + }, + + queryChanged: function() { + this._remove(); + var query = this.query; + if (!query) { + return; } if (query[0] !== '(') { query = '(' + query + ')'; } this._mq = window.matchMedia(query); - this._mq.addListener(this._mqHandler); + this._add(); this.queryHandler(this._mq); },