diff --git a/dashboard-ui/apiclient/fileupload.js b/dashboard-ui/apiclient/fileupload.js index 36c2f995f6..5eec9412ba 100644 --- a/dashboard-ui/apiclient/fileupload.js +++ b/dashboard-ui/apiclient/fileupload.js @@ -6,11 +6,10 @@ self.upload = function (file, name, url) { - var deferred = DeferredBuilder.Deferred(); + return new Promise(function (resolve, reject) { - deferred.reject(); - - return deferred.promise(); + reject(); + }); }; } diff --git a/dashboard-ui/bower_components/get-style-property/.bower.json b/dashboard-ui/bower_components/get-style-property/.bower.json index 973f1966c0..d943fa3b04 100644 --- a/dashboard-ui/bower_components/get-style-property/.bower.json +++ b/dashboard-ui/bower_components/get-style-property/.bower.json @@ -31,6 +31,6 @@ "commit": "34fc5e4a0f252964ed2790138b8d7d30d04b55c1" }, "_source": "git://github.com/desandro/get-style-property.git", - "_target": "1.x", + "_target": "~1.0.4", "_originalSource": "get-style-property" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/paper-checkbox/.bower.json b/dashboard-ui/bower_components/paper-checkbox/.bower.json index 38bde5f534..6c870bb87c 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.15", + "version": "1.0.16", "description": "A material design checkbox", "authors": [ "The Polymer Authors" @@ -29,18 +29,19 @@ }, "devDependencies": { "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0", - "web-component-tester": "*", + "web-component-tester": "polymer/web-component-tester#^3.4.0", "test-fixture": "PolymerElements/test-fixture#^1.0.0", "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", + "iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0", "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0", "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0" }, "main": "paper-checkbox.html", - "_release": "1.0.15", + "_release": "1.0.16", "_resolution": { "type": "version", - "tag": "v1.0.15", - "commit": "fe884a3da56b03998731d5ae299dd2fe893b3b8a" + "tag": "v1.0.16", + "commit": "5bfe12e9a096664c3f199d654c890d2a8d2def31" }, "_source": "git://github.com/PolymerElements/paper-checkbox.git", "_target": "~1.0.5", diff --git a/dashboard-ui/bower_components/paper-checkbox/.travis.yml b/dashboard-ui/bower_components/paper-checkbox/.travis.yml index 08de35926d..2b6f5a46f4 100644 --- a/dashboard-ui/bower_components/paper-checkbox/.travis.yml +++ b/dashboard-ui/bower_components/paper-checkbox/.travis.yml @@ -5,13 +5,15 @@ before_script: - npm install bower - 'export PATH=$PWD/node_modules/.bin:$PATH' - bower install + - npm install polylint + - polylint env: global: - secure: PkxMaBcKe8HD1Jv8O6qiyQ4Nux6DfaVyN/ss9opajX9Oqa2ECJRI/OCsjDSrgXKhuAc2dw0L/KwSb/j4hg3/9BzHlJYQmeR9b9+MsO377TseNw5aKlywgVRu2bj8ODv2naQ4pB4B/Us/n9K7J0vlHIwM8UAJJwGjYm2oYTQxCAw= - secure: WQNRMEQEm6k5e+rzN08Lg0IBC83AZLz1QLP89z59JHLrAOeBu7CBh/LFG0OkhUnTC+dG2JdfIZbdQVCEciDyONjSIKzmM4ze9/LrGzFpROE8bU0ylYSLqX+3CK/6i7VMR3pJo79e1KOeprppHiJSRLVBJfhG+5uNgwAXws/sLQ4= node_js: 4 addons: - firefox: '42.0' + firefox: latest apt: sources: - google-chrome diff --git a/dashboard-ui/bower_components/paper-checkbox/bower.json b/dashboard-ui/bower_components/paper-checkbox/bower.json index f8ce1f213f..6233cb9131 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.15", + "version": "1.0.16", "description": "A material design checkbox", "authors": [ "The Polymer Authors" @@ -29,9 +29,10 @@ }, "devDependencies": { "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0", - "web-component-tester": "*", + "web-component-tester": "polymer/web-component-tester#^3.4.0", "test-fixture": "PolymerElements/test-fixture#^1.0.0", "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", + "iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0", "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0", "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0" }, diff --git a/dashboard-ui/bower_components/paper-checkbox/demo/index.html b/dashboard-ui/bower_components/paper-checkbox/demo/index.html index a8dad0f057..46199828c4 100644 --- a/dashboard-ui/bower_components/paper-checkbox/demo/index.html +++ b/dashboard-ui/bower_components/paper-checkbox/demo/index.html @@ -17,86 +17,66 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN - + + - -
-
-

Enabled

-
- Oxygen - Carbon - Hydrogen - Nitrogen - Calcium -
-
-
-

Disabled

-
- Oxygen - Carbon - Hydrogen - Nitrogen - Calcium -
-
-
-

Color

-
- Oxygen - Carbon - Hydrogen - Nitrogen - Calcium -
-
-
-

Noink

-
- Oxygen - Carbon - Hydrogen - Nitrogen - Calcium -
-
+
+

Checkboxes can be checked or unchecked, or disabled entirely

+ + + + +

Checkboxes can hide the ripple effect using the noink attribute

+ + + + +

Checkboxes can be styled using custom properties

+ + +
diff --git a/dashboard-ui/bower_components/paper-checkbox/test/basic.html b/dashboard-ui/bower_components/paper-checkbox/test/basic.html index 5461266388..5ce5ed29c3 100644 --- a/dashboard-ui/bower_components/paper-checkbox/test/basic.html +++ b/dashboard-ui/bower_components/paper-checkbox/test/basic.html @@ -15,12 +15,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN - - - diff --git a/dashboard-ui/bower_components/paper-checkbox/test/index.html b/dashboard-ui/bower_components/paper-checkbox/test/index.html index ac9a12c5e9..6ef4ca96b5 100644 --- a/dashboard-ui/bower_components/paper-checkbox/test/index.html +++ b/dashboard-ui/bower_components/paper-checkbox/test/index.html @@ -1,14 +1,11 @@ - - - - +--> paper-checkbox tests @@ -17,8 +14,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN - - + + + diff --git a/dashboard-ui/cordova/android/iap.js b/dashboard-ui/cordova/android/iap.js index 9d205a8fc0..1e1f28664a 100644 --- a/dashboard-ui/cordova/android/iap.js +++ b/dashboard-ui/cordova/android/iap.js @@ -110,7 +110,7 @@ function isUnlockedOverride(feature) { - if (feature == 'playback' || feature == 'livetv') { + if (feature == 'playback') { return isPlaybackUnlockedViaOldApp(); } else { return new Promise(function (resolve, reject) { diff --git a/dashboard-ui/cordova/fileupload.js b/dashboard-ui/cordova/fileupload.js index 1e7a3df228..5c0d85f4c6 100644 --- a/dashboard-ui/cordova/fileupload.js +++ b/dashboard-ui/cordova/fileupload.js @@ -6,57 +6,56 @@ self.upload = function (path, name, url) { - var deferred = DeferredBuilder.Deferred(); + return new Promise(function (resolve, reject) { - resolveLocalFileSystemURL(path, function (fileEntry) { + resolveLocalFileSystemURL(path, function (fileEntry) { - fileEntry.file(function (file) { + fileEntry.file(function (file) { - var mimeType = (file.type || ''); + var mimeType = (file.type || ''); - if (mimeType.indexOf('image/') != 0) { - Logger.log('Skipping upload because file is not an image. path: ' + path + ' mimeType: ' + mimeType); - deferred.reject(); - return; - } + if (mimeType.indexOf('image/') != 0) { + Logger.log('Skipping upload because file is not an image. path: ' + path + ' mimeType: ' + mimeType); + reject(); + return; + } - Logger.log('mimeType for file ' + path + ' is ' + file); + Logger.log('mimeType for file ' + path + ' is ' + file); - var onSuccess = function (r) { - console.log("Code = " + r.responseCode); - console.log("Response = " + r.response); - console.log("Sent = " + r.bytesSent); - deferred.resolve(); - } + var onSuccess = function (r) { + console.log("Code = " + r.responseCode); + console.log("Response = " + r.response); + console.log("Sent = " + r.bytesSent); + resolve(); + } - var onFail = function (error) { - console.log("upload error source " + error.source); - console.log("upload error target " + error.target); - deferred.reject(); - } + var onFail = function (error) { + console.log("upload error source " + error.source); + console.log("upload error target " + error.target); + reject(); + } - var options = new FileUploadOptions(); - options.fileKey = "file"; - options.fileName = name; - options.mimeType = mimeType; + var options = new FileUploadOptions(); + options.fileKey = "file"; + options.fileName = name; + options.mimeType = mimeType; - var params = {}; - options.params = params; + var params = {}; + options.params = params; - new FileTransfer().upload(path, url, onSuccess, onFail, options); + new FileTransfer().upload(path, url, onSuccess, onFail, options); + + }, function () { + Logger.log('File upload failed. fileEntry.file returned an error'); + reject(); + }); }, function () { - Logger.log('File upload failed. fileEntry.file returned an error'); - deferred.reject(); + + Logger.log('File upload failed. resolveLocalFileSystemURL returned an error'); + reject(); }); - - }, function () { - - Logger.log('File upload failed. resolveLocalFileSystemURL returned an error'); - deferred.reject(); }); - - return deferred.promise(); }; } diff --git a/dashboard-ui/cordova/iap.js b/dashboard-ui/cordova/iap.js index c91fd61190..010cab924a 100644 --- a/dashboard-ui/cordova/iap.js +++ b/dashboard-ui/cordova/iap.js @@ -124,7 +124,7 @@ } else { promise = fetch("http://mb3admin.com/admin/service/appstore/register", { - + method: 'POST', body: JSON.stringify(postData), headers: { @@ -250,35 +250,37 @@ } function getSubscriptionOptions() { - var deferred = DeferredBuilder.Deferred(); - var options = []; + return new Promise(function (resolve, reject) { - options.push({ - feature: 'embypremieremonthly', - buttonText: 'EmbyPremiereMonthlyWithPrice' + var options = []; + + options.push({ + feature: 'embypremieremonthly', + buttonText: 'EmbyPremiereMonthlyWithPrice' + }); + + options = options.filter(function (o) { + return getProduct(o.feature) != null; + + }).map(function (o) { + + o.id = getStoreFeatureId(o.feature); + o.buttonText = Globalize.translate(o.buttonText, getProduct(o.feature).price); + o.owned = getProduct(o.feature).owned; + return o; + }); + + resolve(options); }); - - options = options.filter(function (o) { - return getProduct(o.feature) != null; - - }).map(function (o) { - - o.id = getStoreFeatureId(o.feature); - o.buttonText = Globalize.translate(o.buttonText, getProduct(o.feature).price); - o.owned = getProduct(o.feature).owned; - return o; - }); - - deferred.resolveWith(null, [options]); - return deferred.promise(); } function isUnlockedOverride(feature) { - var deferred = DeferredBuilder.Deferred(); - deferred.resolveWith(null, [false]); - return deferred.promise(); + return new Promise(function (resolve, reject) { + + resolve(false); + }); } window.IapManager = { diff --git a/dashboard-ui/scripts/htmlmediarenderer.js b/dashboard-ui/scripts/htmlmediarenderer.js index fa876d5b97..ac0078c160 100644 --- a/dashboard-ui/scripts/htmlmediarenderer.js +++ b/dashboard-ui/scripts/htmlmediarenderer.js @@ -586,20 +586,16 @@ self.init = function () { - var deferred = DeferredBuilder.Deferred(); + return new Promise(function (resolve, reject) { - if (options.type == 'video' && enableHlsPlayer()) { + if (options.type == 'video' && enableHlsPlayer()) { - requireHlsPlayer(function () { + requireHlsPlayer(resolve); - deferred.resolve(); - }); - - } else { - deferred.resolve(); - } - - return deferred.promise(); + } else { + resolve(); + } + }); }; if (options.type == 'audio') { diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js index c6732b392b..9784395224 100644 --- a/dashboard-ui/scripts/librarylist.js +++ b/dashboard-ui/scripts/librarylist.js @@ -851,6 +851,7 @@ function disableEvent(e) { e.preventDefault(); + e.stopPropagation(); return false; } @@ -879,6 +880,8 @@ chkItemSelect.checked = !chkItemSelect.checked; } } + e.preventDefault(); + return false; } } @@ -896,6 +899,7 @@ } e.preventDefault(); + e.stopPropagation(); return false; } diff --git a/dashboard-ui/scripts/searchmenu.js b/dashboard-ui/scripts/searchmenu.js index 5b61c29090..67b0e62ac6 100644 --- a/dashboard-ui/scripts/searchmenu.js +++ b/dashboard-ui/scripts/searchmenu.js @@ -6,16 +6,17 @@ self.show = function () { - require(['css!css/search.css']); - $('.headerSearchInput').val(''); + require(['css!css/search.css'], function() { + $('.headerSearchInput').val(''); - $('.btnCloseSearch').hide(); - var elem = $('.viewMenuSearch').removeClass('hide')[0]; + $('.btnCloseSearch').hide(); + var elem = $('.viewMenuSearch').removeClass('hide')[0]; - fadeIn(elem, 1).onfinish = function () { - $('.headerSearchInput').focus(); - $('.btnCloseSearch').show(); - }; + fadeIn(elem, 1).onfinish = function () { + $('.headerSearchInput').focus(); + $('.btnCloseSearch').show(); + }; + }); }; function fadeIn(elem, iterations) { diff --git a/dashboard-ui/thirdparty/jquery.unveil-custom.js b/dashboard-ui/thirdparty/jquery.unveil-custom.js index 9100861a20..0af25ae071 100644 --- a/dashboard-ui/thirdparty/jquery.unveil-custom.js +++ b/dashboard-ui/thirdparty/jquery.unveil-custom.js @@ -23,6 +23,7 @@ var thresholdX = Math.max(screen.availWidth); var thresholdY = Math.max(screen.availHeight); + var wheelEvent = (document.implementation.hasFeature('Event.wheel', '3.0') ? 'wheel' : 'mousewheel'); function visibleInViewport(elem, partial) { @@ -58,7 +59,7 @@ } } - function unveilElements(elems, parent) { + function unveilElements(elems) { if (!elems.length) { return; @@ -68,14 +69,6 @@ unveilId++; - var parents = []; - if (parent) { - parents = parent.querySelectorAll('.itemsContainer'); - if (!parents.length) { - parents = [parent]; - } - } - function unveil() { var remaining = []; @@ -93,17 +86,14 @@ if (!images.length) { document.removeEventListener('scroll', unveil); + document.removeEventListener(wheelEvent, unveil); window.removeEventListener('resize', unveil); - bindEvent(parents, 'removeEventListener', 'scroll', unveil); } } - document.addEventListener('scroll', unveil); - window.addEventListener('resize', unveil); - - if (parents.length) { - bindEvent(parents, 'addEventListener', 'scroll', unveil); - } + document.addEventListener('scroll', unveil, true); + document.addEventListener(wheelEvent, unveil, true); + window.addEventListener('resize', unveil, true); unveil(); }