\ No newline at end of file
diff --git a/src/availableplugins.html b/src/availableplugins.html
new file mode 100644
index 0000000000..ea1147fbfd
--- /dev/null
+++ b/src/availableplugins.html
@@ -0,0 +1,8 @@
+
+
+
+
${MessageNoAvailablePlugins}
+
+
+
+
\ No newline at end of file
diff --git a/src/bower_components/emby-apiclient/apiclientex.js b/src/bower_components/apiclient/apiclient.js
similarity index 98%
rename from src/bower_components/emby-apiclient/apiclientex.js
rename to src/bower_components/apiclient/apiclient.js
index b6a0c1bb14..98aaed75e3 100644
--- a/src/bower_components/emby-apiclient/apiclientex.js
+++ b/src/bower_components/apiclient/apiclient.js
@@ -1,6 +1,11 @@
-define(["apiclientcore", "localassetmanager"], function(ApiClient, localassetmanager) {
+//TODO: (vitorsemeano) modify this lines for webpack
+define(["bower_components/apiclient/apiclientcore", "localassetmanager"], function(ApiClient, localassetmanager) {
"use strict";
+ if ("cordova" !== window.appMode && "android" !== window.appMode) {
+ return ApiClient;
+ }
+
function isLocalId(str) {
return startsWith(str, localPrefix)
}
diff --git a/src/bower_components/emby-apiclient/apiclient.js b/src/bower_components/apiclient/apiclientcore.js
similarity index 100%
rename from src/bower_components/emby-apiclient/apiclient.js
rename to src/bower_components/apiclient/apiclientcore.js
diff --git a/src/bower_components/apiclient/appStorage.js b/src/bower_components/apiclient/appStorage.js
new file mode 100644
index 0000000000..6083bb4953
--- /dev/null
+++ b/src/bower_components/apiclient/appStorage.js
@@ -0,0 +1,53 @@
+define([], function() {
+ "use strict";
+
+ function onCachePutFail(e) {
+ console.log(e);
+ }
+
+ function updateCache(instance) {
+ if (instance.cache) {
+ instance.cache.put("data", new Response(JSON.stringify(instance.localData))).catch(onCachePutFail);
+ }
+ }
+
+ function onCacheOpened(result) {
+ this.cache = result;
+ this.localData = {};
+ }
+
+ function MyStore() {
+
+ this.setItem = function(name, value) {
+ localStorage.setItem(name, value);
+
+ if (this.localData && this.localData[name] !== value) {
+ this.localData[name] = value;
+ updateCache(this);
+ }
+ };
+
+ this.getItem = function(name) {
+ return localStorage.getItem(name);
+ };
+
+ this.removeItem = function(name) {
+ localStorage.removeItem(name);
+
+ if (this.localData) {
+ delete this.localData[name];
+ updateCache(this);
+ }
+ };
+
+ try {
+ if (self.caches) {
+ self.caches.open("embydata").then(onCacheOpened.bind(this));
+ }
+ } catch (err) {
+ console.log("Error opening cache: " + err);
+ }
+ }
+
+ return new MyStore;
+});
\ No newline at end of file
diff --git a/src/bower_components/emby-apiclient/connectionmanager.js b/src/bower_components/apiclient/connectionmanager.js
similarity index 99%
rename from src/bower_components/emby-apiclient/connectionmanager.js
rename to src/bower_components/apiclient/connectionmanager.js
index 39824d31f7..93e9673a46 100644
--- a/src/bower_components/emby-apiclient/connectionmanager.js
+++ b/src/bower_components/apiclient/connectionmanager.js
@@ -269,12 +269,15 @@ define(["events", "apiclient", "appStorage"], function(events, apiClientFactory,
});
resolve(servers)
};
- require(["serverdiscovery"], function(serverDiscovery) {
- serverDiscovery.findServers(1e3).then(onFinish, function() {
+
+ if (window.NativeShell && typeof window.NativeShell.findServers === 'function') {
+ window.NativeShell.findServers(1e3).then(onFinish, function() {
onFinish([])
- })
- })
- })
+ });
+ } else {
+ resolve([]);
+ }
+ });
}
function convertEndpointAddressToManualAddress(info) {
diff --git a/src/bower_components/emby-apiclient/credentials.js b/src/bower_components/apiclient/credentials.js
similarity index 100%
rename from src/bower_components/emby-apiclient/credentials.js
rename to src/bower_components/apiclient/credentials.js
diff --git a/src/bower_components/emby-apiclient/events.js b/src/bower_components/apiclient/events.js
similarity index 100%
rename from src/bower_components/emby-apiclient/events.js
rename to src/bower_components/apiclient/events.js
diff --git a/src/bower_components/emby-apiclient/localassetmanager.js b/src/bower_components/apiclient/localassetmanager.js
similarity index 100%
rename from src/bower_components/emby-apiclient/localassetmanager.js
rename to src/bower_components/apiclient/localassetmanager.js
diff --git a/src/bower_components/apiclient/package.json b/src/bower_components/apiclient/package.json
new file mode 100644
index 0000000000..0069cfc6bf
--- /dev/null
+++ b/src/bower_components/apiclient/package.json
@@ -0,0 +1,3 @@
+{
+ "main": "apiclient.js"
+}
\ No newline at end of file
diff --git a/src/bower_components/emby-apiclient/sync/filerepository.js b/src/bower_components/apiclient/sync/filerepository.js
similarity index 100%
rename from src/bower_components/emby-apiclient/sync/filerepository.js
rename to src/bower_components/apiclient/sync/filerepository.js
diff --git a/src/bower_components/emby-apiclient/sync/itemrepository.js b/src/bower_components/apiclient/sync/itemrepository.js
similarity index 100%
rename from src/bower_components/emby-apiclient/sync/itemrepository.js
rename to src/bower_components/apiclient/sync/itemrepository.js
diff --git a/src/bower_components/emby-apiclient/sync/localsync.js b/src/bower_components/apiclient/sync/localsync.js
similarity index 100%
rename from src/bower_components/emby-apiclient/sync/localsync.js
rename to src/bower_components/apiclient/sync/localsync.js
diff --git a/src/bower_components/emby-apiclient/sync/mediasync.js b/src/bower_components/apiclient/sync/mediasync.js
similarity index 100%
rename from src/bower_components/emby-apiclient/sync/mediasync.js
rename to src/bower_components/apiclient/sync/mediasync.js
diff --git a/src/bower_components/emby-apiclient/sync/multiserversync.js b/src/bower_components/apiclient/sync/multiserversync.js
similarity index 100%
rename from src/bower_components/emby-apiclient/sync/multiserversync.js
rename to src/bower_components/apiclient/sync/multiserversync.js
diff --git a/src/bower_components/emby-apiclient/sync/serversync.js b/src/bower_components/apiclient/sync/serversync.js
similarity index 100%
rename from src/bower_components/emby-apiclient/sync/serversync.js
rename to src/bower_components/apiclient/sync/serversync.js
diff --git a/src/bower_components/emby-apiclient/sync/transfermanager.js b/src/bower_components/apiclient/sync/transfermanager.js
similarity index 100%
rename from src/bower_components/emby-apiclient/sync/transfermanager.js
rename to src/bower_components/apiclient/sync/transfermanager.js
diff --git a/src/bower_components/emby-apiclient/sync/useractionrepository.js b/src/bower_components/apiclient/sync/useractionrepository.js
similarity index 100%
rename from src/bower_components/emby-apiclient/sync/useractionrepository.js
rename to src/bower_components/apiclient/sync/useractionrepository.js
diff --git a/src/bower_components/emby-apiclient/appstorage-cache.js b/src/bower_components/emby-apiclient/appstorage-cache.js
deleted file mode 100644
index 1f584f2a2b..0000000000
--- a/src/bower_components/emby-apiclient/appstorage-cache.js
+++ /dev/null
@@ -1,23 +0,0 @@
-define([], function() {
- "use strict";
-
- function MyStore() {}
-
- function updateCache(instance) {
- instance.cache.put("data", new Response(JSON.stringify(instance.localData)))
- }
- return MyStore.prototype.init = function() {
- var instance = this;
- return caches.open("embydata").then(function(result) {
- instance.cache = result, instance.localData = {}
- })
- }, MyStore.prototype.setItem = function(name, value) {
- if (this.localData) {
- this.localData[name] !== value && (this.localData[name] = value, updateCache(this))
- }
- }, MyStore.prototype.getItem = function(name) {
- if (this.localData) return this.localData[name]
- }, MyStore.prototype.removeItem = function(name) {
- this.localData && (this.localData[name] = null, delete this.localData[name], updateCache(this))
- }, new MyStore
-});
\ No newline at end of file
diff --git a/src/bower_components/emby-apiclient/appstorage-localstorage.js b/src/bower_components/emby-apiclient/appstorage-localstorage.js
deleted file mode 100644
index 4baa82618e..0000000000
--- a/src/bower_components/emby-apiclient/appstorage-localstorage.js
+++ /dev/null
@@ -1,37 +0,0 @@
-define([], function() {
- "use strict";
-
- function onCachePutFail(e) {
- console.log(e)
- }
-
- function updateCache(instance) {
- var cache = instance.cache;
- cache && cache.put("data", new Response(JSON.stringify(instance.localData))).catch(onCachePutFail)
- }
-
- function onCacheOpened(result) {
- this.cache = result, this.localData = {}
- }
-
- function MyStore() {
- try {
- self.caches && caches.open("embydata").then(onCacheOpened.bind(this))
- } catch (err) {
- console.log("Error opening cache: " + err)
- }
- }
- return MyStore.prototype.setItem = function(name, value) {
- localStorage.setItem(name, value);
- var localData = this.localData;
- if (localData) {
- localData[name] !== value && (localData[name] = value, updateCache(this))
- }
- }, MyStore.prototype.getItem = function(name) {
- return localStorage.getItem(name)
- }, MyStore.prototype.removeItem = function(name) {
- localStorage.removeItem(name);
- var localData = this.localData;
- localData && (localData[name] = null, delete localData[name], updateCache(this))
- }, new MyStore
-});
\ No newline at end of file
diff --git a/src/bower_components/emby-apiclient/appstorage-memory.js b/src/bower_components/emby-apiclient/appstorage-memory.js
deleted file mode 100644
index 75aab19923..0000000000
--- a/src/bower_components/emby-apiclient/appstorage-memory.js
+++ /dev/null
@@ -1,14 +0,0 @@
-define([], function() {
- "use strict";
-
- function MyStore() {
- this.localData = {}
- }
- return MyStore.prototype.setItem = function(name, value) {
- this.localData[name] = value
- }, MyStore.prototype.getItem = function(name) {
- return this.localData[name]
- }, MyStore.prototype.removeItem = function(name) {
- this.localData[name] = null
- }, new MyStore
-});
\ No newline at end of file
diff --git a/src/bower_components/emby-apiclient/fileupload.js b/src/bower_components/emby-apiclient/fileupload.js
deleted file mode 100644
index 91f77395e6..0000000000
--- a/src/bower_components/emby-apiclient/fileupload.js
+++ /dev/null
@@ -1,8 +0,0 @@
-define([], function() {
- "use strict";
-
- function FileUpload() {}
- return FileUpload.prototype.upload = function(file, url) {
- return Promise.reject()
- }, FileUpload
-});
\ No newline at end of file
diff --git a/src/bower_components/emby-apiclient/serverdiscovery.js b/src/bower_components/emby-apiclient/serverdiscovery.js
deleted file mode 100644
index 4f18505ecc..0000000000
--- a/src/bower_components/emby-apiclient/serverdiscovery.js
+++ /dev/null
@@ -1,8 +0,0 @@
-define([], function() {
- "use strict";
- return {
- findServers: function(timeoutMs) {
- return Promise.resolve([])
- }
- }
-});
\ No newline at end of file
diff --git a/src/bower_components/emby-apiclient/wakeonlan.js b/src/bower_components/emby-apiclient/wakeonlan.js
deleted file mode 100644
index 58c01e61a5..0000000000
--- a/src/bower_components/emby-apiclient/wakeonlan.js
+++ /dev/null
@@ -1,15 +0,0 @@
-define([], function() {
- "use strict";
-
- function send(info) {
- return Promise.reject()
- }
-
- function isSupported() {
- return !1
- }
- return {
- send: send,
- isSupported: isSupported
- }
-});
\ No newline at end of file
diff --git a/src/bower_components/emby-webcomponents/alert/alert.js b/src/bower_components/emby-webcomponents/alert/alert.js
deleted file mode 100644
index ce434bac8a..0000000000
--- a/src/bower_components/emby-webcomponents/alert/alert.js
+++ /dev/null
@@ -1,34 +0,0 @@
-define(['dialog', 'globalize'], function (dialog, globalize) {
- 'use strict';
-
- return function (text, title) {
-
- var options;
- if (typeof text === 'string') {
- options = {
- title: title,
- text: text
- };
- } else {
- options = text;
- }
-
- var items = [];
-
- items.push({
- name: globalize.translate('ButtonGotIt'),
- id: 'ok',
- type: 'submit'
- });
-
- options.buttons = items;
-
- return dialog(options).then(function (result) {
- if (result === 'ok') {
- return Promise.resolve();
- }
-
- return Promise.reject();
- });
- };
-});
\ No newline at end of file
diff --git a/src/bower_components/emby-webcomponents/alert/nativealert.js b/src/bower_components/emby-webcomponents/alert/nativealert.js
deleted file mode 100644
index f565e802c7..0000000000
--- a/src/bower_components/emby-webcomponents/alert/nativealert.js
+++ /dev/null
@@ -1,23 +0,0 @@
-define([], function () {
- 'use strict';
-
- function replaceAll(str, find, replace) {
-
- return str.split(find).join(replace);
- }
-
- return function (options) {
-
- if (typeof options === 'string') {
- options = {
- text: options
- };
- }
-
- var text = replaceAll(options.text || '', ' ', '\n');
-
- alert(text);
-
- return Promise.resolve();
- };
-});
\ No newline at end of file
diff --git a/src/bower_components/emby-webcomponents/filedownloader.js b/src/bower_components/emby-webcomponents/filedownloader.js
deleted file mode 100644
index c8e3011be2..0000000000
--- a/src/bower_components/emby-webcomponents/filedownloader.js
+++ /dev/null
@@ -1,12 +0,0 @@
-define(['multi-download'], function (multiDownload) {
- 'use strict';
-
- return {
- download: function (items) {
-
- multiDownload(items.map(function (item) {
- return item.url;
- }));
- }
- };
-});
\ No newline at end of file
diff --git a/src/bower_components/emby-webcomponents/filesystem.js b/src/bower_components/emby-webcomponents/filesystem.js
deleted file mode 100644
index 4489d2921f..0000000000
--- a/src/bower_components/emby-webcomponents/filesystem.js
+++ /dev/null
@@ -1,12 +0,0 @@
-define([], function () {
- 'use strict';
-
- return {
- fileExists: function (path) {
- return Promise.reject();
- },
- directoryExists: function (path) {
- return Promise.reject();
- }
- };
-});
\ No newline at end of file
diff --git a/src/bower_components/emby-webcomponents/fullscreen/fullscreen-dc.js b/src/bower_components/emby-webcomponents/fullscreen/fullscreen-dc.js
deleted file mode 100644
index bc12a6a76d..0000000000
--- a/src/bower_components/emby-webcomponents/fullscreen/fullscreen-dc.js
+++ /dev/null
@@ -1,26 +0,0 @@
-define(['dom', 'fullscreenManager'], function (dom, fullscreenManager) {
- 'use strict';
-
- function isTargetValid(target) {
-
- if (dom.parentWithTag(target, ['BUTTON', 'INPUT', 'TEXTAREA'])) {
- return false;
- }
-
- return true;
- }
-
- dom.addEventListener(window, 'dblclick', function (e) {
-
- if (isTargetValid(e.target)) {
- if (fullscreenManager.isFullScreen()) {
- fullscreenManager.exitFullscreen();
- } else {
- fullscreenManager.requestFullscreen();
- }
- }
-
- }, {
- passive: true
- });
-});
\ No newline at end of file
diff --git a/src/bower_components/emby-webcomponents/notifications/badge.png b/src/bower_components/emby-webcomponents/notifications/badge.png
deleted file mode 100644
index 372343f5c9..0000000000
Binary files a/src/bower_components/emby-webcomponents/notifications/badge.png and /dev/null differ
diff --git a/src/bower_components/emby-webcomponents/notifications/notificationicon.png b/src/bower_components/emby-webcomponents/notifications/notificationicon.png
deleted file mode 100644
index 372343f5c9..0000000000
Binary files a/src/bower_components/emby-webcomponents/notifications/notificationicon.png and /dev/null differ
diff --git a/src/bower_components/emby-webcomponents/playback/playbackvalidation.js b/src/bower_components/emby-webcomponents/playback/playbackvalidation.js
deleted file mode 100644
index c36d5c1b5a..0000000000
--- a/src/bower_components/emby-webcomponents/playback/playbackvalidation.js
+++ /dev/null
@@ -1,80 +0,0 @@
-define(['playbackManager', 'itemHelper'], function (playbackManager, itemHelper) {
- "use strict";
-
- function getRequirePromise(deps) {
-
- return new Promise(function (resolve, reject) {
-
- require(deps, resolve);
- });
- }
-
- function validatePlayback(options) {
-
- var feature = 'playback';
- if (options.item && (options.item.Type === 'TvChannel' || options.item.Type === 'Recording')) {
- feature = 'livetv';
- }
-
- if (feature === 'playback') {
- var player = playbackManager.getCurrentPlayer();
- if (player && !player.isLocalPlayer) {
- return Promise.resolve();
- }
- }
-
- return getRequirePromise(["registrationServices"]).then(function (registrationServices) {
-
- return registrationServices.validateFeature(feature, options).then(function (result) {
-
- if (result && result.enableTimeLimit) {
- startAutoStopTimer();
- }
- });
- });
- }
-
- var autoStopTimeout;
- function startAutoStopTimer() {
- stopAutoStopTimer();
- autoStopTimeout = setTimeout(onAutoStopTimeout, 63000);
- }
-
- function onAutoStopTimeout() {
- stopAutoStopTimer();
- playbackManager.stop();
- }
-
- function stopAutoStopTimer() {
-
- var timeout = autoStopTimeout;
- if (timeout) {
- clearTimeout(timeout);
- autoStopTimeout = null;
- }
- }
-
- function PlaybackValidation() {
-
- this.name = 'Playback validation';
- this.type = 'preplayintercept';
- this.id = 'playbackvalidation';
- this.order = -1;
- }
-
- PlaybackValidation.prototype.intercept = function (options) {
-
- // Don't care about video backdrops, or theme music or any kind of non-fullscreen playback
- if (!options.fullscreen) {
- return Promise.resolve();
- }
-
- if (options.item && itemHelper.isLocalItem(options.item)) {
- return Promise.resolve();
- }
-
- return validatePlayback(options);
- };
-
- return PlaybackValidation;
-});
\ No newline at end of file
diff --git a/src/bower_components/emby-webcomponents/polyfills/array.js b/src/bower_components/emby-webcomponents/polyfills/array.js
deleted file mode 100644
index 5caea62e3b..0000000000
--- a/src/bower_components/emby-webcomponents/polyfills/array.js
+++ /dev/null
@@ -1,25 +0,0 @@
-if (!Array.prototype.filter) {
- Array.prototype.filter = function (fun /*, thisp*/) {
- "use strict";
-
- if (this == null)
- throw new TypeError();
-
- var t = Object(this);
- var len = t.length >>> 0;
- if (typeof fun != "function")
- throw new TypeError();
-
- var res = [];
- var thisp = arguments[1];
- for (var i = 0; i < len; i++) {
- if (i in t) {
- var val = t[i]; // in case fun mutates this
- if (fun.call(thisp, val, i, t))
- res.push(val);
- }
- }
-
- return res;
- };
-}
\ No newline at end of file
diff --git a/src/bower_components/emby-webcomponents/polyfills/bind.js b/src/bower_components/emby-webcomponents/polyfills/bind.js
deleted file mode 100644
index 82495aa103..0000000000
--- a/src/bower_components/emby-webcomponents/polyfills/bind.js
+++ /dev/null
@@ -1,27 +0,0 @@
-if (!Function.prototype.bind) {
- Function.prototype.bind = function (oThis) {
- if (typeof this !== 'function') {
- // closest thing possible to the ECMAScript 5
- // internal IsCallable function
- throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
- }
-
- var aArgs = Array.prototype.slice.call(arguments, 1),
- fToBind = this,
- fNOP = function () { },
- fBound = function () {
- return fToBind.apply(this instanceof fNOP
- ? this
- : oThis,
- aArgs.concat(Array.prototype.slice.call(arguments)));
- };
-
- if (this.prototype) {
- // Function.prototype doesn't have a prototype property
- fNOP.prototype = this.prototype;
- }
- fBound.prototype = new fNOP();
-
- return fBound;
- };
-}
\ No newline at end of file
diff --git a/src/bower_components/emby-webcomponents/polyfills/objectassign.js b/src/bower_components/emby-webcomponents/polyfills/objectassign.js
deleted file mode 100644
index 2ea96b188d..0000000000
--- a/src/bower_components/emby-webcomponents/polyfills/objectassign.js
+++ /dev/null
@@ -1,23 +0,0 @@
-if (typeof Object.assign != 'function') {
- (function () {
- Object.assign = function (target) {
- 'use strict';
- if (target === undefined || target === null) {
- throw new TypeError('Cannot convert undefined or null to object');
- }
-
- var output = Object(target);
- for (var index = 1; index < arguments.length; index++) {
- var source = arguments[index];
- if (source !== undefined && source !== null) {
- for (var nextKey in source) {
- if (source.hasOwnProperty(nextKey)) {
- output[nextKey] = source[nextKey];
- }
- }
- }
- }
- return output;
- };
- })();
-}
\ No newline at end of file
diff --git a/src/bower_components/emby-webcomponents/polyfills/raf.js b/src/bower_components/emby-webcomponents/polyfills/raf.js
deleted file mode 100644
index 2c7c433329..0000000000
--- a/src/bower_components/emby-webcomponents/polyfills/raf.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
-// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
-
-// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
-
-// MIT license
-
-(function () {
- var lastTime = 0;
- var vendors = ['ms', 'moz', 'webkit', 'o'];
- for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
- window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
- window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame']
- || window[vendors[x] + 'CancelRequestAnimationFrame'];
- }
-
- if (!window.requestAnimationFrame)
- window.requestAnimationFrame = function (callback, element) {
- var currTime = new Date().getTime();
- var timeToCall = Math.max(0, 16 - (currTime - lastTime));
- var id = window.setTimeout(function () { callback(currTime + timeToCall); },
- timeToCall);
- lastTime = currTime + timeToCall;
- return id;
- };
-
- if (!window.cancelAnimationFrame)
- window.cancelAnimationFrame = function (id) {
- clearTimeout(id);
- };
-}());
\ No newline at end of file
diff --git a/src/bower_components/emby-webcomponents/registrationservices/registrationservices.js b/src/bower_components/emby-webcomponents/registrationservices/registrationservices.js
deleted file mode 100644
index f5b4094213..0000000000
--- a/src/bower_components/emby-webcomponents/registrationservices/registrationservices.js
+++ /dev/null
@@ -1,16 +0,0 @@
-define(['appSettings', 'loading', 'apphost', 'events', 'shell', 'globalize', 'dialogHelper', 'connectionManager', 'layoutManager', 'emby-button', 'emby-linkbutton'], function (appSettings, loading, appHost, events, shell, globalize, dialogHelper, connectionManager, layoutManager) {
- 'use strict';
-
- function validateFeature(feature, options) {
- return Promise.resolve();
- }
-
- function showPremiereInfo() {
- return Promise.resolve();
- }
-
- return {
- validateFeature: validateFeature,
- showPremiereInfo: showPremiereInfo
- };
-});
\ No newline at end of file
diff --git a/src/bower_components/emby-webcomponents/serviceworker/sync.js b/src/bower_components/emby-webcomponents/serviceworker/sync.js
deleted file mode 100644
index 3dcff8f363..0000000000
--- a/src/bower_components/emby-webcomponents/serviceworker/sync.js
+++ /dev/null
@@ -1,6 +0,0 @@
-self.addEventListener('sync', function (event) {
- 'use strict';
-
- if (event.tag === 'emby-sync') {
- }
-});
\ No newline at end of file
diff --git a/src/bower_components/emby-webcomponents/shell.js b/src/bower_components/emby-webcomponents/shell.js
deleted file mode 100644
index 0083404e19..0000000000
--- a/src/bower_components/emby-webcomponents/shell.js
+++ /dev/null
@@ -1,21 +0,0 @@
-define([], function () {
- 'use strict';
-
- return {
- openUrl: function (url) {
- window.open(url, '_blank');
- },
- canExec: false,
- exec: function (options) {
- // options.path
- // options.arguments
- return Promise.reject();
- },
- enableFullscreen: function () {
- // do nothing since this is for native apps
- },
- disableFullscreen: function () {
- // do nothing since this is for native apps
- }
- };
-});
\ No newline at end of file
diff --git a/src/bower_components/emby-webcomponents/skinmanager.js b/src/bower_components/emby-webcomponents/skinmanager.js
deleted file mode 100644
index 48820512cf..0000000000
--- a/src/bower_components/emby-webcomponents/skinmanager.js
+++ /dev/null
@@ -1,355 +0,0 @@
-define(['apphost', 'userSettings', 'browser', 'events', 'pluginManager', 'backdrop', 'globalize', 'require', 'appSettings'], function (appHost, userSettings, browser, events, pluginManager, backdrop, globalize, require, appSettings) {
- 'use strict';
-
- var currentSkin;
-
- function getCurrentSkin() {
- return currentSkin;
- }
-
- function getRequirePromise(deps) {
- return new Promise(function (resolve, reject) {
-
- require(deps, resolve);
- });
- }
-
- function loadSkin(id) {
-
- var newSkin = pluginManager.plugins().filter(function (p) {
- return p.id === id;
- })[0];
-
- if (!newSkin) {
- newSkin = pluginManager.plugins().filter(function (p) {
- return p.id === 'defaultskin';
- })[0];
- }
-
- var unloadPromise;
-
- if (currentSkin) {
-
- if (currentSkin.id === newSkin.id) {
- // Nothing to do, it's already the active skin
- return Promise.resolve(currentSkin);
- }
- unloadPromise = unloadSkin(currentSkin);
- } else {
- unloadPromise = Promise.resolve();
- }
-
- return unloadPromise.then(function () {
- var deps = newSkin.getDependencies();
-
- console.log('Loading skin dependencies');
-
- return getRequirePromise(deps).then(function () {
-
- console.log('Skin dependencies loaded');
-
- var strings = newSkin.getTranslations ? newSkin.getTranslations() : [];
-
- return globalize.loadStrings({
-
- name: newSkin.id,
- strings: strings
-
- }).then(function () {
-
- globalize.defaultModule(newSkin.id);
- return loadSkinHeader(newSkin);
- });
- });
- });
- }
-
- function unloadSkin(skin) {
-
- unloadTheme();
- backdrop.clear();
-
- console.log('Unloading skin: ' + skin.name);
-
- // TODO: unload css
-
- return skin.unload().then(function () {
- document.dispatchEvent(new CustomEvent("skinunload", {
- detail: {
- name: skin.name
- }
- }));
- });
- }
-
- function loadSkinHeader(skin) {
-
- return getSkinHeader(skin).then(function (headerHtml) {
-
- document.querySelector('.skinHeader').innerHTML = headerHtml;
-
- currentSkin = skin;
- skin.load();
-
- return skin;
- });
- }
-
- var cacheParam = new Date().getTime();
-
- function getSkinHeader(skin) {
-
- return new Promise(function (resolve, reject) {
-
- if (!skin.getHeaderTemplate) {
- resolve('');
- return;
- }
-
- var xhr = new XMLHttpRequest();
-
- var url = skin.getHeaderTemplate();
- url += url.indexOf('?') === -1 ? '?' : '&';
- url += 'v=' + cacheParam;
-
- xhr.open('GET', url, true);
-
- xhr.onload = function (e) {
- if (this.status < 400) {
- resolve(this.response);
- } else {
- resolve('');
- }
- };
-
- xhr.send();
- });
- }
-
- function loadUserSkin(options) {
-
- var skin = userSettings.get('skin', false) || 'defaultskin';
-
- loadSkin(skin).then(function (skin) {
-
- options = options || {};
- if (options.start) {
- Emby.Page.invokeShortcut(options.start);
- } else {
- Emby.Page.goHome();
- }
- });
- }
-
- events.on(userSettings, 'change', function (e, name) {
- if (name === 'skin' || name === 'language') {
- loadUserSkin();
- }
- });
-
- var themeStyleElement;
- var currentThemeId;
- function unloadTheme() {
- var elem = themeStyleElement;
- if (elem) {
-
- elem.parentNode.removeChild(elem);
- themeStyleElement = null;
- currentThemeId = null;
- }
- }
-
- function getThemes() {
-
- if (currentSkin.getThemes) {
- return currentSkin.getThemes();
- }
-
- return [];
- }
-
- var skinManager = {
- getCurrentSkin: getCurrentSkin,
- loadSkin: loadSkin,
- loadUserSkin: loadUserSkin,
- getThemes: getThemes
- };
-
- function onRegistrationSuccess() {
- appSettings.set('appthemesregistered', 'true');
- }
-
- function onRegistrationFailure() {
- appSettings.set('appthemesregistered', 'false');
- }
-
- function isRegistered() {
-
- getRequirePromise(['registrationServices']).then(function (registrationServices) {
- registrationServices.validateFeature('themes', {
-
- showDialog: false
-
- }).then(onRegistrationSuccess, onRegistrationFailure);
- });
-
- return appSettings.get('appthemesregistered') !== 'false';
- }
-
- function getThemeStylesheetInfo(id, requiresRegistration, isDefaultProperty) {
-
- var themes = skinManager.getThemes();
- var defaultTheme;
- var selectedTheme;
-
- for (var i = 0, length = themes.length; i < length; i++) {
-
- var theme = themes[i];
- if (theme[isDefaultProperty]) {
- defaultTheme = theme;
- }
- if (id === theme.id) {
- selectedTheme = theme;
- }
- }
-
- selectedTheme = selectedTheme || defaultTheme;
-
- if (selectedTheme.id !== defaultTheme.id && requiresRegistration && !isRegistered()) {
- selectedTheme = defaultTheme;
- }
-
- var embyWebComponentsBowerPath = 'bower_components/emby-webcomponents';
-
- return {
- stylesheetPath: require.toUrl(embyWebComponentsBowerPath + '/themes/' + selectedTheme.id + '/theme.css'),
- themeId: selectedTheme.id
- };
- }
-
- var themeResources = {};
- var lastSound = 0;
- var currentSound;
-
- function loadThemeResources(id) {
-
- lastSound = 0;
-
- if (currentSound) {
- currentSound.stop();
- currentSound = null;
- }
-
- backdrop.clear();
- }
-
- function onThemeLoaded() {
- document.documentElement.classList.remove('preload');
-
-
- try {
- var color = getComputedStyle(document.querySelector('.skinHeader')).getPropertyValue("background-color");
-
- if (color) {
- appHost.setThemeColor(color);
- }
- }
- catch (err) {
- console.log('Error setting theme color: ' + err);
- }
- }
-
- skinManager.setTheme = function (id, context) {
-
- return new Promise(function (resolve, reject) {
-
- var requiresRegistration = true;
-
- if (currentThemeId && currentThemeId === id) {
- resolve();
- return;
- }
-
- var isDefaultProperty = context === 'serverdashboard' ? 'isDefaultServerDashboard' : 'isDefault';
- var info = getThemeStylesheetInfo(id, requiresRegistration, isDefaultProperty);
-
- if (currentThemeId && currentThemeId === info.themeId) {
- resolve();
- return;
- }
-
- var linkUrl = info.stylesheetPath;
-
- unloadTheme();
-
- var link = document.createElement('link');
-
- link.setAttribute('rel', 'stylesheet');
- link.setAttribute('type', 'text/css');
- link.onload = function () {
-
- onThemeLoaded();
- resolve();
- };
-
- link.setAttribute('href', linkUrl);
- document.head.appendChild(link);
- themeStyleElement = link;
- currentThemeId = info.themeId;
- loadThemeResources(info.themeId);
-
- onViewBeforeShow({});
- });
- };
-
- function onViewBeforeShow(e) {
-
- if (e.detail && e.detail.type === 'video-osd') {
- return;
- }
-
- if (themeResources.backdrop) {
-
- backdrop.setBackdrop(themeResources.backdrop);
- }
-
- if (!browser.mobile && userSettings.enableThemeSongs()) {
- if (lastSound === 0) {
-
- if (themeResources.themeSong) {
- playSound(themeResources.themeSong);
- }
-
- } else if ((new Date().getTime() - lastSound) > 30000) {
- if (themeResources.effect) {
- playSound(themeResources.effect);
- }
- }
- }
- }
-
- document.addEventListener('viewshow', onViewBeforeShow);
-
- function playSound(path, volume) {
-
- lastSound = new Date().getTime();
-
- require(['howler'], function (howler) {
-
- try {
- var sound = new Howl({
- src: [path],
- volume: volume || 0.1
- });
-
- sound.play();
- currentSound = sound;
- }
- catch (err) {
- console.log('Error playing sound: ' + err);
- }
- });
- }
-
- return skinManager;
-});
diff --git a/src/bower_components/emby-webcomponents/sync/emby-downloadbutton.js b/src/bower_components/emby-webcomponents/sync/emby-downloadbutton.js
deleted file mode 100644
index 74a9f6b3bb..0000000000
--- a/src/bower_components/emby-webcomponents/sync/emby-downloadbutton.js
+++ /dev/null
@@ -1,188 +0,0 @@
-define(['connectionManager', 'serverNotifications', 'events', 'globalize', 'emby-button'], function (connectionManager, serverNotifications, events, globalize, EmbyButtonPrototype) {
- 'use strict';
-
- function onClick(e) {
-
- var button = this;
- var id = button.getAttribute('data-id');
- var serverId = button.getAttribute('data-serverid');
- var apiClient = connectionManager.getApiClient(serverId);
-
- if (!button.classList.contains('downloadbutton-on')) {
-
- require(['syncDialog'], function (syncDialog) {
- syncDialog.showMenu({
-
- items: [id],
- mode: 'download',
- serverId: serverId
-
- }).then(function () {
-
- button.dispatchEvent(new CustomEvent('download', {
- cancelable: false
- }));
-
- });
- });
-
- } else {
-
- require(['confirm'], function (confirm) {
-
- confirm({
-
- text: globalize.translate('ConfirmRemoveDownload'),
- confirmText: globalize.translate('RemoveDownload'),
- cancelText: globalize.translate('KeepDownload'),
- primary: 'cancel'
-
- }).then(function () {
- apiClient.cancelSyncItems([id]);
-
- button.dispatchEvent(new CustomEvent('download-cancel', {
- cancelable: false
- }));
- });
- });
- }
- }
-
- function updateSyncStatus(button, syncPercent) {
-
- var icon = button.iconElement;
- if (!icon) {
- button.iconElement = button.querySelector('i');
- icon = button.iconElement;
- }
-
- if (syncPercent != null) {
- button.classList.add('downloadbutton-on');
-
- if (icon) {
- icon.classList.add('downloadbutton-icon-on');
- }
-
- } else {
- button.classList.remove('downloadbutton-on');
-
- if (icon) {
- icon.classList.remove('downloadbutton-icon-on');
- }
- }
-
- if ((syncPercent || 0) >= 100) {
- button.classList.add('downloadbutton-complete');
-
- if (icon) {
- icon.classList.add('downloadbutton-icon-complete');
- }
- } else {
- button.classList.remove('downloadbutton-complete');
-
- if (icon) {
- icon.classList.remove('downloadbutton-icon-complete');
- }
- }
-
- var text;
- if ((syncPercent || 0) >= 100) {
- text = globalize.translate('Downloaded');
- } else if (syncPercent != null) {
- text = globalize.translate('Downloading');
- } else {
- text = globalize.translate('Download');
- }
-
- var textElement = button.querySelector('.emby-downloadbutton-downloadtext');
- if (textElement) {
- textElement.innerHTML = text;
- }
-
- button.title = text;
- }
-
- function clearEvents(button) {
-
- button.removeEventListener('click', onClick);
- }
-
- function bindEvents(button) {
-
- clearEvents(button);
-
- button.addEventListener('click', onClick);
- }
-
- var EmbyDownloadButtonPrototype = Object.create(EmbyButtonPrototype);
-
- EmbyDownloadButtonPrototype.createdCallback = function () {
-
- // base method
- if (EmbyButtonPrototype.createdCallback) {
- EmbyButtonPrototype.createdCallback.call(this);
- }
- };
-
- EmbyDownloadButtonPrototype.attachedCallback = function () {
-
- // base method
- if (EmbyButtonPrototype.attachedCallback) {
- EmbyButtonPrototype.attachedCallback.call(this);
- }
-
- var itemId = this.getAttribute('data-id');
- var serverId = this.getAttribute('data-serverid');
- if (itemId && serverId) {
-
- bindEvents(this);
- }
- };
-
- EmbyDownloadButtonPrototype.detachedCallback = function () {
-
- // base method
- if (EmbyButtonPrototype.detachedCallback) {
- EmbyButtonPrototype.detachedCallback.call(this);
- }
-
- clearEvents(this);
-
- this.iconElement = null;
- };
-
- function fetchAndUpdate(button, item) {
-
- connectionManager.getApiClient(item.ServerId).getSyncStatus(item.Id).then(function (result) {
-
- updateSyncStatus(button, result.Progress);
-
- }, function () {
-
- });
- }
-
- EmbyDownloadButtonPrototype.setItem = function (item) {
-
- if (item) {
-
- this.setAttribute('data-id', item.Id);
- this.setAttribute('data-serverid', item.ServerId);
-
- fetchAndUpdate(this, item);
-
- bindEvents(this);
-
- } else {
-
- this.removeAttribute('data-id');
- this.removeAttribute('data-serverid');
- clearEvents(this);
- }
- };
-
- document.registerElement('emby-downloadbutton', {
- prototype: EmbyDownloadButtonPrototype,
- extends: 'button'
- });
-});
\ No newline at end of file
diff --git a/src/bower_components/emby-webcomponents/sync/sync.js b/src/bower_components/emby-webcomponents/sync/sync.js
deleted file mode 100644
index e7c51e3dc5..0000000000
--- a/src/bower_components/emby-webcomponents/sync/sync.js
+++ /dev/null
@@ -1,736 +0,0 @@
-define(['apphost', 'globalize', 'connectionManager', 'layoutManager', 'focusManager', 'scrollHelper', 'appSettings', 'registrationServices', 'dialogHelper', 'paper-icon-button-light', 'formDialogStyle'], function (appHost, globalize, connectionManager, layoutManager, focusManager, scrollHelper, appSettings, registrationServices, dialogHelper) {
- 'use strict';
-
- var currentDialogOptions;
-
- function submitJob(dlg, apiClient, userId, syncOptions, form) {
-
- if (!userId) {
- throw new Error('userId cannot be null');
- }
-
- if (!syncOptions) {
- throw new Error('syncOptions cannot be null');
- }
-
- if (!form) {
- throw new Error('form cannot be null');
- }
-
- var selectSyncTarget = form.querySelector('#selectSyncTarget');
- var target = selectSyncTarget ? selectSyncTarget.value : null;
-
- if (!target) {
-
- require(['toast'], function (toast) {
- toast(globalize.translate('PleaseSelectDeviceToSyncTo'));
- });
- return false;
- }
-
- var options = {
-
- userId: userId,
- TargetId: target,
-
- ParentId: syncOptions.ParentId,
- Category: syncOptions.Category
- };
-
- setJobValues(options, form);
-
- if (syncOptions.items && syncOptions.items.length) {
- options.ItemIds = (syncOptions.items || []).map(function (i) {
- return i.Id || i;
- }).join(',');
- }
-
- apiClient.ajax({
-
- type: "POST",
- url: apiClient.getUrl("Sync/Jobs"),
- data: JSON.stringify(options),
- contentType: "application/json",
- dataType: 'json'
-
- }).then(function () {
-
- dialogHelper.close(dlg);
- require(['toast'], function (toast) {
-
- showSubmissionToast(target, apiClient);
-
- if (syncOptions.mode === 'download') {
- syncNow();
- }
- });
- });
-
- return true;
- }
-
-
- function showSubmissionToast(targetId, apiClient) {
-
- require(['toast'], function (toast) {
-
- var msg = targetId === apiClient.deviceId() ?
- globalize.translate('DownloadingDots') :
- globalize.translate('SyncingDots');
-
- toast(msg);
- });
- }
-
- function syncNow() {
- require(['localsync'], function (localSync) {
- localSync.sync();
- });
- }
-
- function submitQuickSyncJob(apiClient, userId, targetId, syncOptions) {
-
- if (!userId) {
- throw new Error('userId cannot be null');
- }
-
- if (!syncOptions) {
- throw new Error('syncOptions cannot be null');
- }
-
- if (!targetId) {
- throw new Error('targetId cannot be null');
- }
-
- var options = {
-
- userId: userId,
- TargetId: targetId,
-
- ParentId: syncOptions.ParentId,
- Category: syncOptions.Category,
- Quality: syncOptions.Quality,
- Bitrate: syncOptions.Bitrate
- };
-
- if (syncOptions.items && syncOptions.items.length) {
- options.ItemIds = (syncOptions.items || []).map(function (i) {
- return i.Id || i;
- }).join(',');
- }
-
- return apiClient.ajax({
-
- type: "POST",
- url: apiClient.getUrl("Sync/Jobs"),
- data: JSON.stringify(options),
- contentType: "application/json",
- dataType: 'json'
-
- }).then(function () {
-
- require(['toast'], function (toast) {
-
- showSubmissionToast(targetId, apiClient);
-
- if (syncOptions.mode === 'download') {
- syncNow();
- }
- });
- });
- }
-
- function setJobValues(job, form) {
-
- var txtBitrate = form.querySelector('#txtBitrate');
- var bitrate = txtBitrate ? txtBitrate.value : null;
-
- if (bitrate) {
- bitrate = parseFloat(bitrate) * 1000000;
- }
- job.Bitrate = bitrate;
-
- var selectQuality = form.querySelector('#selectQuality');
- if (selectQuality) {
- job.Quality = selectQuality.value;
-
- appSettings.set('sync-lastquality', job.Quality || '');
- }
-
- var selectProfile = form.querySelector('#selectProfile');
- if (selectProfile) {
- job.Profile = selectProfile.value;
- }
-
- var txtItemLimit = form.querySelector('#txtItemLimit');
- if (txtItemLimit) {
- job.ItemLimit = txtItemLimit.value || null;
- }
-
- var chkSyncNewContent = form.querySelector('#chkSyncNewContent');
- if (chkSyncNewContent) {
- job.SyncNewContent = chkSyncNewContent.checked;
- }
-
- var chkUnwatchedOnly = form.querySelector('#chkUnwatchedOnly');
- if (chkUnwatchedOnly) {
- job.UnwatchedOnly = chkUnwatchedOnly.checked;
- }
- }
-
- function renderForm(options) {
-
- return new Promise(function (resolve, reject) {
-
- require(['emby-checkbox', 'emby-input', 'emby-select'], function () {
-
- renderFormInternal(options, connectionManager.deviceId(), resolve);
- });
- });
- }
-
- function renderFormInternal(options, defaultTargetId, resolve) {
-
- var elem = options.elem;
- var dialogOptions = options.dialogOptions;
-
- var targets = dialogOptions.Targets;
-
- var html = '';
-
- var mode = options.mode;
- var targetContainerClass = mode === 'download' ? ' hide' : '';
-
- var syncTargetLabel = mode === 'convert' ? globalize.translate('LabelConvertTo') : globalize.translate('LabelSyncTo');
-
- if (options.readOnlySyncTarget) {
- html += '
';
- html += '';
- html += '
';
- } else {
- html += '
';
- html += '';
- if (!targets.length) {
- html += '