diff --git a/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json b/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json index f0a9c76d51..4072b4af76 100644 --- a/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json +++ b/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json @@ -29,14 +29,14 @@ "web-component-tester": "*", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, - "homepage": "https://github.com/polymerelements/iron-a11y-keys-behavior", + "homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior", "_release": "1.0.5", "_resolution": { "type": "version", "tag": "v1.0.5", "commit": "cf833eab5c55a26c5aa92e56d3fcb079120ce66a" }, - "_source": "git://github.com/polymerelements/iron-a11y-keys-behavior.git", + "_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git", "_target": "^1.0.0", - "_originalSource": "polymerelements/iron-a11y-keys-behavior" + "_originalSource": "PolymerElements/iron-a11y-keys-behavior" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/iron-behaviors/.bower.json b/dashboard-ui/bower_components/iron-behaviors/.bower.json index aaeba48e4d..bf8b6cf30f 100644 --- a/dashboard-ui/bower_components/iron-behaviors/.bower.json +++ b/dashboard-ui/bower_components/iron-behaviors/.bower.json @@ -27,14 +27,14 @@ "web-component-tester": "*", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, - "homepage": "https://github.com/polymerelements/iron-behaviors", + "homepage": "https://github.com/PolymerElements/iron-behaviors", "_release": "1.0.4", "_resolution": { "type": "version", "tag": "v1.0.4", "commit": "8792edd457de697a74f398c09b67df30adf7d866" }, - "_source": "git://github.com/polymerelements/iron-behaviors.git", + "_source": "git://github.com/PolymerElements/iron-behaviors.git", "_target": "^1.0.0", - "_originalSource": "polymerelements/iron-behaviors" + "_originalSource": "PolymerElements/iron-behaviors" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/iron-selector/.bower.json b/dashboard-ui/bower_components/iron-selector/.bower.json index 68996d04d0..31050826e9 100644 --- a/dashboard-ui/bower_components/iron-selector/.bower.json +++ b/dashboard-ui/bower_components/iron-selector/.bower.json @@ -28,14 +28,14 @@ "web-component-tester": "*", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, - "homepage": "https://github.com/polymerelements/iron-selector", + "homepage": "https://github.com/PolymerElements/iron-selector", "_release": "1.0.2", "_resolution": { "type": "version", "tag": "v1.0.2", "commit": "ea22d91d11ba6f72c01faa952d5e600f9d1773cf" }, - "_source": "git://github.com/polymerelements/iron-selector.git", + "_source": "git://github.com/PolymerElements/iron-selector.git", "_target": "^1.0.0", - "_originalSource": "polymerelements/iron-selector" + "_originalSource": "PolymerElements/iron-selector" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/paper-styles/.bower.json b/dashboard-ui/bower_components/paper-styles/.bower.json index f16c89e87a..32205aaa01 100644 --- a/dashboard-ui/bower_components/paper-styles/.bower.json +++ b/dashboard-ui/bower_components/paper-styles/.bower.json @@ -34,7 +34,7 @@ "tag": "v1.0.7", "commit": "c65f5ce6b898bb756fca35cedaa53c3e8011abeb" }, - "_source": "git://github.com/polymerelements/paper-styles.git", + "_source": "git://github.com/PolymerElements/paper-styles.git", "_target": "^1.0.0", - "_originalSource": "polymerelements/paper-styles" + "_originalSource": "PolymerElements/paper-styles" } \ No newline at end of file diff --git a/dashboard-ui/cordova/android/androidcredentials.js b/dashboard-ui/cordova/android/androidcredentials.js index 364c02f32b..6b9563b416 100644 --- a/dashboard-ui/cordova/android/androidcredentials.js +++ b/dashboard-ui/cordova/android/androidcredentials.js @@ -27,7 +27,103 @@ ApiClientBridge.init(AppInfo.appName, AppInfo.appVersion, AppInfo.deviceId, AppInfo.deviceName, JSON.stringify(capabilities)); - //initAjax(); + initAjax(); + } + + var baseAjaxMethod; + var currentId = 0; + function getNewRequestId() { + var id = currentId++; + return id.toString(); + } + function initAjax() { + baseAjaxMethod = AjaxApi.ajax; + AjaxApi.ajax = sendRequest; + } + + function sendRequest(request) { + + // For now, we can only handle json responses + if (request.dataType) { + if (request.dataType != 'json') { + return baseAjaxMethod(request); + } + } + + if (request.data) { + // For now, we can only handle request bodies that are strings + if (typeof (request.data) != 'string') { + return baseAjaxMethod(request); + } + } + + var deferred = DeferredBuilder.Deferred(); + + var id = getNewRequestId(); + + request.headers = request.headers || {}; + + if (request.dataType == 'json') { + request.headers.accept = 'application/json'; + } + + var javaRequest = { + Method: request.type || "GET", + Url: request.url, + RequestHeaders: request.headers + }; + + if (request.timeout) { + javaRequest.Timeout = request.timeout; + } + + if (request.data) { + javaRequest.RequestContent = request.data; + } + + if (request.contentType) { + javaRequest.RequestContentType = request.contentType; + } + + Logger.log("Sending request: " + JSON.stringify(javaRequest)); + + ApiClientBridge.sendRequest(JSON.stringify(javaRequest), request.dataType, id); + + Events.on(AndroidAjax, 'response' + id, function (e, isSuccess, status, response) { + + Events.off(AndroidAjax, 'response' + id); + + if (isSuccess) { + + if (response) { + deferred.resolveWith(null, [response]); + } else { + deferred.resolve(); + } + } + else { + + // Need to mimic the jquery ajax error response + deferred.rejectWith(request, [getErrorResponse(response)]); + } + + }); + + return deferred.promise(); + } + + function getErrorResponse(response) { + + var error = {}; + + error.status = response.StatusCode; + error.ResponseHeaders = response.ResponseHeaders || {}; + + error.getResponseHeader = function (name) { + return error.ResponseHeaders[name]; + }; + + return error; } Events.on(ConnectionManager.credentialProvider(), 'credentialsupdated', updateCredentials); @@ -39,7 +135,11 @@ onResponse: function (id, status, response) { - Events.trigger(AndroidAjax, 'response' + id, [status, response]); + Events.trigger(AndroidAjax, 'response' + id, [true, status, response]); + }, + onError: function (id, status, response) { + + Events.trigger(AndroidAjax, 'response' + id, [false, status, response]); } }; diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index 4884247583..90dabee371 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -1383,11 +1383,6 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { text-decoration: none; } - -.itemsContainer:not(.fullWidthItemsContainer) .itemsListview { - max-width: 800px; -} - .itemsListview { margin: 0 auto !important; } diff --git a/dashboard-ui/css/nowplaying.css b/dashboard-ui/css/nowplaying.css index 6bb0eb78b4..c269a9fa52 100644 --- a/dashboard-ui/css/nowplaying.css +++ b/dashboard-ui/css/nowplaying.css @@ -151,6 +151,11 @@ margin-top: -1.5em; padding: 0 60px; } + + .nowPlayingPage .btnCommand, .nowPlayingPage .btnPlayStateCommand { + width: 60px; + height: 60px; + } } @media (orientation: portrait) and (max-height: 600px) { @@ -158,6 +163,11 @@ margin-top: -1.5em; padding: 0 60px; } + + .nowPlayingPage .btnCommand, .nowPlayingPage .btnPlayStateCommand { + width: 60px; + height: 60px; + } } .nowPlayingSelectedPlayer { @@ -172,4 +182,4 @@ .nowPlayingSelectedPlayer { display: none; } -} \ No newline at end of file +} diff --git a/dashboard-ui/css/nowplayingbar.css b/dashboard-ui/css/nowplayingbar.css index 95b5d661fe..4bf02129c2 100644 --- a/dashboard-ui/css/nowplayingbar.css +++ b/dashboard-ui/css/nowplayingbar.css @@ -5,6 +5,10 @@ /*box-shadow: 0 0 8px rgba(255,255,255,.4);*/ } +.hiddenNowPlayingBar .nowPlayingBar { + display: none!important; +} + .mediaButton, .nowPlayingBarUserDataButtons .btnUserItemRating { vertical-align: middle; color: #e8e8e8; @@ -83,12 +87,13 @@ @media (min-width: 800px) { .nowPlayingBarText { max-width: 300px; + margin-right: 30px; } } -@media (min-width: 800px) { +@media (min-width: 900px) { .nowPlayingBarText { - margin-right: 30px; + max-width: 400px; } } @@ -106,8 +111,12 @@ z-index: 1; } +.noMediaProgress .nowPlayingBarPositionContainer { + display: none; +} + .nowPlayingBarPositionSlider paper-progress { - height: 4px !important; + height: 3px !important; } .nowPlayingBarPositionSlider #sliderBar { @@ -120,7 +129,7 @@ } .nowPlayingBarPositionSlider #sliderKnob { - top: -14px !important; + top: -15px !important; } .nowPlayingBarPositionSlider #progressContainer { @@ -128,8 +137,8 @@ } .nowPlayingBarPositionSlider #sliderKnobInner { - width: 18px; - height: 18px; + width: 16px; + height: 16px; } .nowPlayingBarRight { diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index a22662d442..b88e17708d 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -915,7 +915,7 @@ h1 .imageLink { z-index: 1097; color: #fff; border: 0 !important; - background-color: rgba(26,26,26,.93); + background-color: rgba(26,26,26,.94); } .footerOverBottomTabs { diff --git a/dashboard-ui/scripts/nowplayingbar.js b/dashboard-ui/scripts/nowplayingbar.js index 894bef842f..066e43aa99 100644 --- a/dashboard-ui/scripts/nowplayingbar.js +++ b/dashboard-ui/scripts/nowplayingbar.js @@ -175,6 +175,11 @@ elem = $(getNowPlayingBarHtml()).insertBefore('#footerNotifications').trigger('create'); + if ($.browser.safari && $.browser.mobile) { + // Not handled well here. The wrong elements receive events, bar doesn't update quickly enough, etc. + elem.addClass('noMediaProgress'); + } + bindEvents(elem); return elem; @@ -190,7 +195,7 @@ function updatePlayerState(state) { - if (state.NowPlayingItem && !$($.mobile.activePage).hasClass('nowPlayingPage')) { + if (state.NowPlayingItem) { showNowPlayingBar(); } else { hideNowPlayingBar(); @@ -383,6 +388,8 @@ ApiClient.getItem(Dashboard.getCurrentUserId(), nowPlayingItem.Id).done(function (item) { nowPlayingUserData.html(LibraryBrowser.getUserDataIconsHtml(item, false)); }); + } else { + nowPlayingUserData.html(''); } } diff --git a/dashboard-ui/scripts/nowplayingpage.js b/dashboard-ui/scripts/nowplayingpage.js index 7fab748fc6..ebc0d0e0bf 100644 --- a/dashboard-ui/scripts/nowplayingpage.js +++ b/dashboard-ui/scripts/nowplayingpage.js @@ -745,7 +745,7 @@ }).on('pagebeforeshowready', "#nowPlayingPage", function () { - $(document.body).addClass('hiddenViewMenuBar'); + $(document.body).addClass('hiddenViewMenuBar').addClass('hiddenNowPlayingBar'); var page = this; currentImgUrl = null; @@ -776,7 +776,7 @@ $(MediaController).off('playerchange.nowplayingpage'); lastPlayerState = null; - $(document.body).removeClass('hiddenViewMenuBar'); + $(document.body).removeClass('hiddenViewMenuBar').removeClass('hiddenNowPlayingBar'); }); window.NowPlayingPage = { diff --git a/dashboard-ui/songs.html b/dashboard-ui/songs.html index 8d7a168bf0..6fed7b5c72 100644 --- a/dashboard-ui/songs.html +++ b/dashboard-ui/songs.html @@ -19,7 +19,7 @@