diff --git a/dashboard-ui/bower_components/eventie/.bower.json b/dashboard-ui/bower_components/eventie/.bower.json index 917d217ea8..6b5b662fdc 100644 --- a/dashboard-ui/bower_components/eventie/.bower.json +++ b/dashboard-ui/bower_components/eventie/.bower.json @@ -30,6 +30,6 @@ "commit": "14d2ca3df97da64c820829a8310f9198fbafbcfa" }, "_source": "git://github.com/desandro/eventie.git", - "_target": "^1", + "_target": "~1.0.3", "_originalSource": "eventie" } \ 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 52d44c1907..ebb18c5b7b 100644 --- a/dashboard-ui/bower_components/iron-selector/.bower.json +++ b/dashboard-ui/bower_components/iron-selector/.bower.json @@ -36,7 +36,7 @@ "tag": "v1.0.8", "commit": "e9a66727f3da0446f04956d4e4f1dcd51cdec2ff" }, - "_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/cordova/android/androidcredentials.js b/dashboard-ui/cordova/android/androidcredentials.js index 0310c2b558..2776ed5a95 100644 --- a/dashboard-ui/cordova/android/androidcredentials.js +++ b/dashboard-ui/cordova/android/androidcredentials.js @@ -26,109 +26,6 @@ var capabilities = ConnectionManager.capabilities(); ApiClientBridge.init(AppInfo.appName, AppInfo.appVersion, AppInfo.deviceId, AppInfo.deviceName, JSON.stringify(capabilities)); - - //initAjax(); - } - - var baseAjaxMethod; - var currentId = 0; - function getNewRequestId() { - var id = currentId++; - return id.toString(); - } - function initAjax() { - baseAjaxMethod = HttpClient.send; - HttpClient.send = 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 method = request.type || "GET"; - - var javaRequest = { - Method: method, - 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, 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 = {}; - - if (response.StatusCode) { - error.status = response.StatusCode; - } - - error.ResponseHeaders = response.ResponseHeaders || {}; - - error.getResponseHeader = function (name) { - return error.ResponseHeaders[name]; - }; - - return error; } function getDownloadSpeed(bytes, url) { diff --git a/dashboard-ui/css/nowplayingbar.css b/dashboard-ui/css/nowplayingbar.css index afcc137438..1786918536 100644 --- a/dashboard-ui/css/nowplayingbar.css +++ b/dashboard-ui/css/nowplayingbar.css @@ -54,6 +54,14 @@ /* Now playing bar */ .nowPlayingBar { + position: fixed; + bottom: 0; + left: 0; + right: 0; + /* Above everything, except for the video player and popup overlays */ + z-index: 1097; + color: #fff; + background-color: rgba(26,26,26,.94); border-top: 1px solid #444; text-align: center; /*box-shadow: 0 0 8px rgba(255,255,255,.4);*/ diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js index 7ca124fff8..b9486ba2c2 100644 --- a/dashboard-ui/scripts/librarylist.js +++ b/dashboard-ui/scripts/librarylist.js @@ -1340,18 +1340,15 @@ $('.hasrefreshtime').removeClass('hasrefreshtime').removeAttr('data-lastrefresh'); } - Dashboard.ready(function () { + if (window.ApiClient) { + initializeApiClient(window.ApiClient); + } - if (window.ApiClient) { - initializeApiClient(window.ApiClient); - } - - $(ConnectionManager).on('apiclientcreated', function (e, apiClient) { - initializeApiClient(apiClient); - }); - - Events.on(ConnectionManager, 'localusersignedin', clearRefreshTimes); - Events.on(ConnectionManager, 'localusersignedout', clearRefreshTimes); + $(ConnectionManager).on('apiclientcreated', function (e, apiClient) { + initializeApiClient(apiClient); }); + Events.on(ConnectionManager, 'localusersignedin', clearRefreshTimes); + Events.on(ConnectionManager, 'localusersignedout', clearRefreshTimes); + })(jQuery, document, window); \ No newline at end of file diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js index 24a276885b..65ca09e34e 100644 --- a/dashboard-ui/scripts/librarymenu.js +++ b/dashboard-ui/scripts/librarymenu.js @@ -133,13 +133,7 @@ var mainDrawerButton = document.querySelector('.mainDrawerButton'); if (mainDrawerButton) { - if (AppInfo.isTouchPreferred || $.browser.mobile) { - - mainDrawerButton.addEventListener('click', openMainDrawer); - - } else { - $(mainDrawerButton).createHoverTouch().on('hovertouch', openMainDrawer); - } + mainDrawerButton.addEventListener('click', openMainDrawer); } var headerBackButton = document.querySelector('.headerBackButton'); @@ -312,7 +306,6 @@ var userHeader = drawer.querySelector('.userheader'); userHeader.innerHTML = html; - ImageLoader.fillImages(userHeader.getElementsByClassName('lazy')); } @@ -341,10 +334,6 @@ drawer.querySelector('.dashboardDrawerContent').innerHTML = html; } - function replaceAll(string, find, replace) { - return string.replace(new RegExp(escapeRegExp(find), 'g'), replace); - } - function refreshBottomUserInfoInDrawer(user, drawer) { var html = ''; @@ -582,7 +571,7 @@ } else { Dashboard.navigate(link.href); } - }, 400); + }, 350); }, 50); } @@ -599,7 +588,7 @@ setTimeout(function () { Dashboard.logout(); - }, 400); + }, 350); } return false; @@ -807,7 +796,7 @@ } } - pageClassOn('pagebeforeshow', 'page', function () { + pageClassOn('pageinit', 'page', function () { var page = this; @@ -815,7 +804,7 @@ requiresDashboardDrawerRefresh = true; } - onPageBeforeShowDocumentReady(page); + onPageBeforeShow(page); }); @@ -823,20 +812,15 @@ var page = this; - onPageShowDocumentReady(page); + if (!NavHelper.isBack()) { + // Scroll back up so in case vertical scroll was messed with + window.scrollTo(0, 0); + } + updateTabLinks(page); }); - //pageClassOn('pagebeforehide', 'page', function () { - - // var headroomEnabled = document.querySelectorAll('.headroomEnabled'); - // for (var i = 0, length = headroomEnabled.length; i < length; i++) { - // headroomEnabled[i].classList.add('headroomDisabled'); - // } - - //}); - - function onPageBeforeShowDocumentReady(page) { + function onPageBeforeShow(page) { buildViewMenuBar(page); @@ -934,15 +918,6 @@ } } - function onPageShowDocumentReady(page) { - - if (!NavHelper.isBack()) { - // Scroll back up so in case vertical scroll was messed with - window.scrollTo(0, 0); - } - updateTabLinks(page); - } - function initHeadRoom(elem) { if (!AppInfo.enableHeadRoom) { @@ -1006,59 +981,6 @@ })(window, document, jQuery, window.devicePixelRatio); -$.fn.createHoverTouch = function () { - - var preventHover = false; - var timerId; - - function startTimer(elem) { - - stopTimer(); - - timerId = setTimeout(function () { - - Events.trigger(elem, 'hovertouch'); - }, 300); - } - - function stopTimer(elem) { - - if (timerId) { - clearTimeout(timerId); - timerId = null; - } - } - - return $(this).on('mouseenter', function () { - - if (preventHover === true) { - preventHover = false; - return; - } - - startTimer(this); - - }).on('mouseleave', function () { - - stopTimer(this); - - }).on('touchstart', function () { - - preventHover = true; - - }).on('click', function () { - - preventHover = true; - - if (preventHover) { - Events.trigger(this, 'hovertouch'); - stopTimer(this); - preventHover = false; - } - }); - -}; - (function () { var isCurrentNavBack = false; diff --git a/dashboard-ui/scripts/mediaplayer-video.js b/dashboard-ui/scripts/mediaplayer-video.js index 04e8541a9c..62350261c9 100644 --- a/dashboard-ui/scripts/mediaplayer-video.js +++ b/dashboard-ui/scripts/mediaplayer-video.js @@ -34,6 +34,10 @@ self.resetEnhancements = function () { + if (!initComplete) { + return; + } + fadeOut(document.querySelector('#mediaPlayer')); $('#videoPlayer').removeClass('fullscreenVideo').removeClass('idlePlayer'); $('.hiddenOnIdle').removeClass("inactive"); @@ -676,6 +680,9 @@ Dashboard.importCss('css/mediaplayer-video.css'); + // TODO: remove dependency on this file + Dashboard.importCss('css/nowplayingbar.css'); + var html = '