minify resources

This commit is contained in:
Luke Pulverenti 2017-01-27 22:16:59 -05:00
parent 8a6884abef
commit 661eeac16e
201 changed files with 203 additions and 52376 deletions

View File

@ -1,114 +1 @@
define(['dialogHelper', 'datetime', 'emby-select', 'paper-icon-button-light', 'formDialogStyle'], function (dialogHelper, datetime) {
'use strict';
function getDisplayTime(hours) {
var minutes = 0;
var pct = hours % 1;
if (pct) {
minutes = parseInt(pct * 60);
}
return datetime.getDisplayTime(new Date(2000, 1, 1, hours, minutes, 0, 0));
}
function populateHours(context) {
var html = '';
for (var i = 0; i < 24; i++) {
html += '<option value="' + i + '">' + getDisplayTime(i) + '</option>';
}
html += '<option value="24">' + getDisplayTime(0) + '</option>';
context.querySelector('#selectStart').innerHTML = html;
context.querySelector('#selectEnd').innerHTML = html;
}
function loadSchedule(context, schedule) {
context.querySelector('#selectDay').value = schedule.DayOfWeek || 'Sunday';
context.querySelector('#selectStart').value = schedule.StartHour || 0;
context.querySelector('#selectEnd').value = schedule.EndHour || 0;
}
function submitSchedule(context, options) {
var updatedSchedule = {
DayOfWeek: context.querySelector('#selectDay').value,
StartHour: context.querySelector('#selectStart').value,
EndHour: context.querySelector('#selectEnd').value
};
if (parseFloat(updatedSchedule.StartHour) >= parseFloat(updatedSchedule.EndHour)) {
alert(Globalize.translate('ErrorMessageStartHourGreaterThanEnd'));
return;
}
context.submitted = true;
options.schedule = Object.assign(options.schedule, updatedSchedule);
dialogHelper.close(context);
}
return {
show: function (options) {
return new Promise(function (resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'components/accessschedule/accessschedule.template.html', true);
xhr.onload = function (e) {
var template = this.response;
var dlg = dialogHelper.createDialog({
removeOnClose: true,
size: 'small'
});
dlg.classList.add('formDialog');
var html = '';
html += Globalize.translateDocument(template);
dlg.innerHTML = html;
populateHours(dlg);
loadSchedule(dlg, options.schedule);
dialogHelper.open(dlg);
dlg.addEventListener('close', function () {
if (dlg.submitted) {
resolve(options.schedule);
} else {
reject();
}
});
dlg.querySelector('.btnCancel').addEventListener('click', function (e) {
dialogHelper.close(dlg);
});
dlg.querySelector('form').addEventListener('submit', function (e) {
submitSchedule(dlg, options);
e.preventDefault();
return false;
});
}
xhr.send();
});
}
};
});
define(["dialogHelper","datetime","emby-select","paper-icon-button-light","formDialogStyle"],function(dialogHelper,datetime){"use strict";function getDisplayTime(hours){var minutes=0,pct=hours%1;return pct&&(minutes=parseInt(60*pct)),datetime.getDisplayTime(new Date(2e3,1,1,hours,minutes,0,0))}function populateHours(context){for(var html="",i=0;i<24;i++)html+='<option value="'+i+'">'+getDisplayTime(i)+"</option>";html+='<option value="24">'+getDisplayTime(0)+"</option>",context.querySelector("#selectStart").innerHTML=html,context.querySelector("#selectEnd").innerHTML=html}function loadSchedule(context,schedule){context.querySelector("#selectDay").value=schedule.DayOfWeek||"Sunday",context.querySelector("#selectStart").value=schedule.StartHour||0,context.querySelector("#selectEnd").value=schedule.EndHour||0}function submitSchedule(context,options){var updatedSchedule={DayOfWeek:context.querySelector("#selectDay").value,StartHour:context.querySelector("#selectStart").value,EndHour:context.querySelector("#selectEnd").value};return parseFloat(updatedSchedule.StartHour)>=parseFloat(updatedSchedule.EndHour)?void alert(Globalize.translate("ErrorMessageStartHourGreaterThanEnd")):(context.submitted=!0,options.schedule=Object.assign(options.schedule,updatedSchedule),void dialogHelper.close(context))}return{show:function(options){return new Promise(function(resolve,reject){var xhr=new XMLHttpRequest;xhr.open("GET","components/accessschedule/accessschedule.template.html",!0),xhr.onload=function(e){var template=this.response,dlg=dialogHelper.createDialog({removeOnClose:!0,size:"small"});dlg.classList.add("formDialog");var html="";html+=Globalize.translateDocument(template),dlg.innerHTML=html,populateHours(dlg),loadSchedule(dlg,options.schedule),dialogHelper.open(dlg),dlg.addEventListener("close",function(){dlg.submitted?resolve(options.schedule):reject()}),dlg.querySelector(".btnCancel").addEventListener("click",function(e){dialogHelper.close(dlg)}),dlg.querySelector("form").addEventListener("submit",function(e){return submitSchedule(dlg,options),e.preventDefault(),!1})},xhr.send()})}}});

View File

@ -1,20 +1 @@
.appfooter {
background: #1c1c1c;
position: fixed;
left: 0;
right: 0;
z-index: 1;
bottom: 0;
transition: transform 180ms linear;
contain: layout style;
}
.appfooter-blurred {
background: rgba(28,28,28,.92);
-webkit-backdrop-filter: blur(5px);
backdrop-filter: blur(5px);
}
.appfooter.headroom--unpinned {
transform: translateY(100%);
}
.appfooter{background:#1c1c1c;position:fixed;left:0;right:0;z-index:1;bottom:0;-webkit-transition:-webkit-transform 180ms linear;-o-transition:transform 180ms linear;transition:transform 180ms linear;contain:layout style}.appfooter-blurred{background:rgba(28,28,28,.92);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}.appfooter.headroom--unpinned{-webkit-transform:translateY(100%);transform:translateY(100%)}

View File

@ -1,61 +1 @@
define(['browser', 'css!./appfooter'], function (browser) {
'use strict';
function render(options) {
var elem = document.createElement('div');
elem.classList.add('appfooter');
if (browser.safari) {
elem.classList.add('appfooter-blurred');
}
document.body.appendChild(elem);
return elem;
}
function initHeadRoom(instance, elem) {
require(["headroom-window"], function (headroom) {
self.headroom = headroom;
headroom.add(elem);
});
}
function appFooter(options) {
var self = this;
self.element = render(options);
self.add = function (elem) {
self.element.appendChild(elem);
};
self.insert = function (elem) {
if (typeof elem === 'string') {
self.element.insertAdjacentHTML('afterbegin', elem);
} else {
self.element.insertBefore(elem, self.element.firstChild);
}
};
initHeadRoom(self, self.element);
}
appFooter.prototype.destroy = function () {
var self = this;
if (self.headroom) {
self.headroom.remove(self.element);
self.headroom = null;
}
self.element = null;
};
return appFooter;
});
define(["browser","css!./appfooter"],function(browser){"use strict";function render(options){var elem=document.createElement("div");return elem.classList.add("appfooter"),browser.safari&&elem.classList.add("appfooter-blurred"),document.body.appendChild(elem),elem}function initHeadRoom(instance,elem){require(["headroom-window"],function(headroom){self.headroom=headroom,headroom.add(elem)})}function appFooter(options){var self=this;self.element=render(options),self.add=function(elem){self.element.appendChild(elem)},self.insert=function(elem){"string"==typeof elem?self.element.insertAdjacentHTML("afterbegin",elem):self.element.insertBefore(elem,self.element.firstChild)},initHeadRoom(self,self.element)}return appFooter.prototype.destroy=function(){var self=this;self.headroom&&(self.headroom.remove(self.element),self.headroom=null),self.element=null},appFooter});

View File

@ -1,245 +1 @@
define(['appStorage', 'browser'], function (appStorage, browser) {
'use strict';
function getDeviceProfile() {
// TODO
return null;
}
function getCapabilities() {
var caps = {
PlayableMediaTypes: ['Audio', 'Video'],
SupportsPersistentIdentifier: false,
DeviceProfile: getDeviceProfile()
};
return caps;
}
function generateDeviceId() {
return new Promise(function (resolve, reject) {
require(["cryptojs-sha1"], function () {
var keys = [];
keys.push(navigator.userAgent);
keys.push(new Date().getTime());
resolve(CryptoJS.SHA1(keys.join('|')).toString());
});
});
}
function getDeviceId() {
var key = '_deviceId2';
var deviceId = appStorage.getItem(key);
if (deviceId) {
return Promise.resolve(deviceId);
} else {
return generateDeviceId().then(function (deviceId) {
appStorage.setItem(key, deviceId);
return deviceId;
});
}
}
function getDeviceName() {
var deviceName;
if (browser.tizen) {
deviceName = "Samsung Smart TV";
} else if (browser.web0S) {
deviceName = "LG Smart TV";
} else if (browser.operaTv) {
deviceName = "Opera TV";
} else if (browser.xboxOne) {
deviceName = "Xbox One";
} else if (browser.ps4) {
deviceName = "Sony PS4";
} else if (browser.chrome) {
deviceName = "Chrome";
} else if (browser.edge) {
deviceName = "Edge";
} else if (browser.firefox) {
deviceName = "Firefox";
} else if (browser.msie) {
deviceName = "Internet Explorer";
} else {
deviceName = "Web Browser";
}
if (browser.version) {
deviceName += " " + browser.version;
}
if (browser.ipad) {
deviceName += " Ipad";
} else if (browser.iphone) {
deviceName += " Iphone";
} else if (browser.android) {
deviceName += " Android";
}
return deviceName;
}
function supportsVoiceInput() {
if (browser.tv) {
return false;
}
return window.SpeechRecognition ||
window.webkitSpeechRecognition ||
window.mozSpeechRecognition ||
window.oSpeechRecognition ||
window.msSpeechRecognition;
}
function supportsFullscreen() {
if (browser.tv) {
return false;
};
var element = document.documentElement;
return element.requestFullscreen ||
element.mozRequestFullScreen ||
element.webkitRequestFullscreen ||
element.msRequestFullscreen;
}
function getSyncProfile() {
return new Promise(function (resolve, reject) {
require(['browserdeviceprofile', 'qualityoptions', 'appSettings'], function (profileBuilder, qualityoptions, appSettings) {
var profile = profileBuilder();
profile.MaxStaticMusicBitrate = appSettings.maxStaticMusicBitrate();
resolve(profile);
});
});
}
var supportedFeatures = function () {
var features = [
'filedownload',
'sharing',
'externalpremium'
];
if (browser.operaTv || browser.tizen || browser.web0s) {
features.push('exit');
} else {
features.push('exitmenu');
}
if (!browser.operaTv) {
features.push('externallinks');
}
if (supportsVoiceInput()) {
features.push('voiceinput');
}
if (!browser.mobile || browser.edgeUwp) {
features.push('htmlaudioautoplay');
features.push('htmlvideoautoplay');
}
if (window.SyncRegistered) {
//features.push('sync');
}
if (supportsFullscreen()) {
features.push('fullscreenchange');
}
if (browser.chrome || (browser.edge && !browser.slow)) {
features.push('imageanalysis');
}
if (Dashboard.isConnectMode()) {
features.push('multiserver');
}
if (browser.tv || browser.xboxOne || browser.ps4 || browser.mobile) {
features.push('physicalvolumecontrol');
}
if (!browser.tv && !browser.xboxOne && !browser.ps4) {
features.push('remotecontrol');
}
return features;
}();
var appInfo;
var version = window.dashboardVersion || '3.0';
return {
getWindowState: function () {
return document.windowState || 'Normal';
},
setWindowState: function (state) {
alert('setWindowState is not supported and should not be called');
},
exit: function () {
if (browser.tizen) {
try {
tizen.application.getCurrentApplication().exit();
} catch (err) {
console.log('error closing application: ' + err);
}
return;
}
window.close();
},
supports: function (command) {
return supportedFeatures.indexOf(command.toLowerCase()) != -1;
},
unlockedFeatures: function () {
var features = [];
features.push('playback');
features.push('livetv');
return features;
},
appInfo: function () {
if (appInfo) {
return Promise.resolve(appInfo);
}
return getDeviceId().then(function (deviceId) {
appInfo = {
deviceId: deviceId,
deviceName: getDeviceName(),
appName: 'Emby Mobile',
appVersion: version
};
return appInfo;
});
},
capabilities: getCapabilities,
preferVisualCards: browser.android || browser.chrome,
moreIcon: browser.safari || browser.edge ? 'dots-horiz' : 'dots-vert',
getSyncProfile: getSyncProfile
};
});
define(["appStorage","browser"],function(appStorage,browser){"use strict";function getDeviceProfile(){return null}function getCapabilities(){var caps={PlayableMediaTypes:["Audio","Video"],SupportsPersistentIdentifier:!1,DeviceProfile:getDeviceProfile()};return caps}function generateDeviceId(){return new Promise(function(resolve,reject){require(["cryptojs-sha1"],function(){var keys=[];keys.push(navigator.userAgent),keys.push((new Date).getTime()),resolve(CryptoJS.SHA1(keys.join("|")).toString())})})}function getDeviceId(){var key="_deviceId2",deviceId=appStorage.getItem(key);return deviceId?Promise.resolve(deviceId):generateDeviceId().then(function(deviceId){return appStorage.setItem(key,deviceId),deviceId})}function getDeviceName(){var deviceName;return deviceName=browser.tizen?"Samsung Smart TV":browser.web0S?"LG Smart TV":browser.operaTv?"Opera TV":browser.xboxOne?"Xbox One":browser.ps4?"Sony PS4":browser.chrome?"Chrome":browser.edge?"Edge":browser.firefox?"Firefox":browser.msie?"Internet Explorer":"Web Browser",browser.version&&(deviceName+=" "+browser.version),browser.ipad?deviceName+=" Ipad":browser.iphone?deviceName+=" Iphone":browser.android&&(deviceName+=" Android"),deviceName}function supportsVoiceInput(){return!browser.tv&&(window.SpeechRecognition||window.webkitSpeechRecognition||window.mozSpeechRecognition||window.oSpeechRecognition||window.msSpeechRecognition)}function supportsFullscreen(){if(browser.tv)return!1;var element=document.documentElement;return element.requestFullscreen||element.mozRequestFullScreen||element.webkitRequestFullscreen||element.msRequestFullscreen}function getSyncProfile(){return new Promise(function(resolve,reject){require(["browserdeviceprofile","qualityoptions","appSettings"],function(profileBuilder,qualityoptions,appSettings){var profile=profileBuilder();profile.MaxStaticMusicBitrate=appSettings.maxStaticMusicBitrate(),resolve(profile)})})}var appInfo,supportedFeatures=function(){var features=["filedownload","sharing","externalpremium"];return browser.operaTv||browser.tizen||browser.web0s?features.push("exit"):features.push("exitmenu"),browser.operaTv||features.push("externallinks"),supportsVoiceInput()&&features.push("voiceinput"),browser.mobile&&!browser.edgeUwp||(features.push("htmlaudioautoplay"),features.push("htmlvideoautoplay")),window.SyncRegistered,supportsFullscreen()&&features.push("fullscreenchange"),(browser.chrome||browser.edge&&!browser.slow)&&features.push("imageanalysis"),Dashboard.isConnectMode()&&features.push("multiserver"),(browser.tv||browser.xboxOne||browser.ps4||browser.mobile)&&features.push("physicalvolumecontrol"),browser.tv||browser.xboxOne||browser.ps4||features.push("remotecontrol"),features}(),version=window.dashboardVersion||"3.0";return{getWindowState:function(){return document.windowState||"Normal"},setWindowState:function(state){alert("setWindowState is not supported and should not be called")},exit:function(){if(browser.tizen)try{tizen.application.getCurrentApplication().exit()}catch(err){console.log("error closing application: "+err)}else window.close()},supports:function(command){return supportedFeatures.indexOf(command.toLowerCase())!=-1},unlockedFeatures:function(){var features=[];return features.push("playback"),features.push("livetv"),features},appInfo:function(){return appInfo?Promise.resolve(appInfo):getDeviceId().then(function(deviceId){return appInfo={deviceId:deviceId,deviceName:getDeviceName(),appName:"Emby Mobile",appVersion:version}})},capabilities:getCapabilities,preferVisualCards:browser.android||browser.chrome,moreIcon:browser.safari||browser.edge?"dots-horiz":"dots-vert",getSyncProfile:getSyncProfile}});

View File

@ -1,50 +1 @@
define(['itemHelper'], function (itemHelper) {
'use strict';
function initSyncButtons(view) {
var apiClient = window.ApiClient;
if (!apiClient || !apiClient.getCurrentUserId()) {
return;
}
apiClient.getCurrentUser().then(function (user) {
var item = {
SupportsSync: true
};
var categorySyncButtons = view.querySelectorAll('.categorySyncButton');
for (var i = 0, length = categorySyncButtons.length; i < length; i++) {
categorySyncButtons[i].addEventListener('click', onCategorySyncButtonClick);
if (itemHelper.canSync(user, item)) {
categorySyncButtons[i].classList.remove('hide');
} else {
categorySyncButtons[i].classList.add('hide');
}
}
});
}
function onCategorySyncButtonClick(e) {
var button = this;
var category = button.getAttribute('data-category');
var parentId = LibraryMenu.getTopParentId();
require(['syncDialog'], function (syncDialog) {
syncDialog.showMenu({
ParentId: parentId,
Category: category,
serverId: ApiClient.serverId()
});
});
}
return {
init: function (view) {
initSyncButtons(view);
}
};
});
define(["itemHelper"],function(itemHelper){"use strict";function initSyncButtons(view){var apiClient=window.ApiClient;apiClient&&apiClient.getCurrentUserId()&&apiClient.getCurrentUser().then(function(user){for(var item={SupportsSync:!0},categorySyncButtons=view.querySelectorAll(".categorySyncButton"),i=0,length=categorySyncButtons.length;i<length;i++)categorySyncButtons[i].addEventListener("click",onCategorySyncButtonClick),itemHelper.canSync(user,item)?categorySyncButtons[i].classList.remove("hide"):categorySyncButtons[i].classList.add("hide")})}function onCategorySyncButtonClick(e){var button=this,category=button.getAttribute("data-category"),parentId=LibraryMenu.getTopParentId();require(["syncDialog"],function(syncDialog){syncDialog.showMenu({ParentId:parentId,Category:category,serverId:ApiClient.serverId()})})}return{init:function(view){initSyncButtons(view)}}});

View File

@ -1,200 +1 @@
define(['dialogHelper', 'loading', 'connectionManager', 'globalize', 'actionsheet', 'emby-input', 'paper-icon-button-light', 'emby-button', 'listViewStyle', 'material-icons', 'formDialogStyle'],
function (dialogHelper, loading, connectionManager, globalize, actionsheet) {
'use strict';
return function (options) {
var self = this;
var currentMappingOptions;
function parentWithClass(elem, className) {
while (!elem.classList || !elem.classList.contains(className)) {
elem = elem.parentNode;
if (!elem) {
return null;
}
}
return elem;
}
function mapChannel(button, tunerChannelNumber, providerChannelNumber) {
loading.show();
var providerId = options.providerId;
var apiClient = connectionManager.getApiClient(options.serverId);
apiClient.ajax({
type: 'POST',
url: ApiClient.getUrl('LiveTv/ChannelMappings'),
data: {
providerId: providerId,
tunerChannelNumber: tunerChannelNumber,
providerChannelNumber: providerChannelNumber
},
dataType: 'json'
}).then(function (mapping) {
var listItem = parentWithClass(button, 'listItem');
button.setAttribute('data-providernumber', mapping.ProviderChannelNumber);
listItem.querySelector('.secondary').innerHTML = getMappingSecondaryName(mapping, currentMappingOptions.ProviderName);
loading.hide();
});
}
function onChannelsElementClick(e) {
var btnMap = parentWithClass(e.target, 'btnMap');
if (!btnMap) {
return;
}
var tunerChannelNumber = btnMap.getAttribute('data-number');
var providerChannelNumber = btnMap.getAttribute('data-providernumber');
var menuItems = currentMappingOptions.ProviderChannels.map(function (m) {
return {
name: m.Name,
id: m.Id,
selected: m.Id.toLowerCase() == providerChannelNumber.toLowerCase()
};
});
actionsheet.show({
positionTo: btnMap,
items: menuItems
}).then(function (newChannelNumber) {
mapChannel(btnMap, tunerChannelNumber, newChannelNumber);
});
}
function getChannelMappingOptions(serverId, providerId) {
var apiClient = connectionManager.getApiClient(serverId);
return apiClient.getJSON(apiClient.getUrl('LiveTv/ChannelMappingOptions', {
providerId: providerId
}));
}
function getMappingSecondaryName(mapping, providerName) {
return (mapping.ProviderChannelNumber || '') + ' ' + (mapping.ProviderChannelName || '') + ' - ' + providerName;
}
function getTunerChannelHtml(channel, providerName) {
var html = '';
html += '<div class="listItem">';
html += '<i class="md-icon listItemIcon">dvr</i>';
html += '<div class="listItemBody two-line">';
html += '<h3 class="listItemBodyText">';
html += channel.Name;
html += '</h3>';
html += '<div class="secondary listItemBodyText">';
if (channel.ProviderChannelNumber || channel.ProviderChannelName) {
html += getMappingSecondaryName(channel, providerName);
}
html += '</div>';
html += '</div>';
html += '<button class="btnMap autoSize" is="paper-icon-button-light" type="button" data-number="' + channel.Number + '" data-providernumber="' + channel.ProviderChannelNumber + '"><i class="md-icon">mode_edit</i></button>';
html += '</div>';
return html;
}
function getEditorHtml() {
var html = '';
html += '<div class="formDialogContent">';
html += '<div class="dialogContentInner dialog-content-centered">';
html += '<form style="margin:auto;">';
html += '<h1>' + globalize.translate('HeaderChannels') + '</h1>';
html += '<div class="channels paperList">';
html += '</div>';
html += '</form>';
html += '</div>';
html += '</div>';
return html;
}
function initEditor(dlg, options) {
getChannelMappingOptions(options.serverId, options.providerId).then(function (result) {
currentMappingOptions = result;
var channelsElement = dlg.querySelector('.channels');
channelsElement.innerHTML = result.TunerChannels.map(function (channel) {
return getTunerChannelHtml(channel, result.ProviderName);
}).join('');
channelsElement.addEventListener('click', onChannelsElementClick);
});
}
self.show = function () {
var dialogOptions = {
removeOnClose: true
};
dialogOptions.size = 'small';
var dlg = dialogHelper.createDialog(dialogOptions);
dlg.classList.add('formDialog');
dlg.classList.add('ui-body-a');
dlg.classList.add('background-theme-a');
var html = '';
var title = globalize.translate('MapChannels');
html += '<div class="formDialogHeader">';
html += '<button is="paper-icon-button-light" class="btnCancel autoSize" tabindex="-1"><i class="md-icon">&#xE5C4;</i></button>';
html += '<h3 class="formDialogHeaderTitle">';
html += title;
html += '</h3>';
html += '</div>';
html += getEditorHtml();
dlg.innerHTML = html;
initEditor(dlg, options);
dlg.querySelector('.btnCancel').addEventListener('click', function () {
dialogHelper.close(dlg);
});
return new Promise(function (resolve, reject) {
dlg.addEventListener('close', resolve);
dialogHelper.open(dlg);
});
};
};
});
define(["dialogHelper","loading","connectionManager","globalize","actionsheet","emby-input","paper-icon-button-light","emby-button","listViewStyle","material-icons","formDialogStyle"],function(dialogHelper,loading,connectionManager,globalize,actionsheet){"use strict";return function(options){function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function mapChannel(button,tunerChannelNumber,providerChannelNumber){loading.show();var providerId=options.providerId,apiClient=connectionManager.getApiClient(options.serverId);apiClient.ajax({type:"POST",url:ApiClient.getUrl("LiveTv/ChannelMappings"),data:{providerId:providerId,tunerChannelNumber:tunerChannelNumber,providerChannelNumber:providerChannelNumber},dataType:"json"}).then(function(mapping){var listItem=parentWithClass(button,"listItem");button.setAttribute("data-providernumber",mapping.ProviderChannelNumber),listItem.querySelector(".secondary").innerHTML=getMappingSecondaryName(mapping,currentMappingOptions.ProviderName),loading.hide()})}function onChannelsElementClick(e){var btnMap=parentWithClass(e.target,"btnMap");if(btnMap){var tunerChannelNumber=btnMap.getAttribute("data-number"),providerChannelNumber=btnMap.getAttribute("data-providernumber"),menuItems=currentMappingOptions.ProviderChannels.map(function(m){return{name:m.Name,id:m.Id,selected:m.Id.toLowerCase()==providerChannelNumber.toLowerCase()}});actionsheet.show({positionTo:btnMap,items:menuItems}).then(function(newChannelNumber){mapChannel(btnMap,tunerChannelNumber,newChannelNumber)})}}function getChannelMappingOptions(serverId,providerId){var apiClient=connectionManager.getApiClient(serverId);return apiClient.getJSON(apiClient.getUrl("LiveTv/ChannelMappingOptions",{providerId:providerId}))}function getMappingSecondaryName(mapping,providerName){return(mapping.ProviderChannelNumber||"")+" "+(mapping.ProviderChannelName||"")+" - "+providerName}function getTunerChannelHtml(channel,providerName){var html="";return html+='<div class="listItem">',html+='<i class="md-icon listItemIcon">dvr</i>',html+='<div class="listItemBody two-line">',html+='<h3 class="listItemBodyText">',html+=channel.Name,html+="</h3>",html+='<div class="secondary listItemBodyText">',(channel.ProviderChannelNumber||channel.ProviderChannelName)&&(html+=getMappingSecondaryName(channel,providerName)),html+="</div>",html+="</div>",html+='<button class="btnMap autoSize" is="paper-icon-button-light" type="button" data-number="'+channel.Number+'" data-providernumber="'+channel.ProviderChannelNumber+'"><i class="md-icon">mode_edit</i></button>',html+="</div>"}function getEditorHtml(){var html="";return html+='<div class="formDialogContent">',html+='<div class="dialogContentInner dialog-content-centered">',html+='<form style="margin:auto;">',html+="<h1>"+globalize.translate("HeaderChannels")+"</h1>",html+='<div class="channels paperList">',html+="</div>",html+="</form>",html+="</div>",html+="</div>"}function initEditor(dlg,options){getChannelMappingOptions(options.serverId,options.providerId).then(function(result){currentMappingOptions=result;var channelsElement=dlg.querySelector(".channels");channelsElement.innerHTML=result.TunerChannels.map(function(channel){return getTunerChannelHtml(channel,result.ProviderName)}).join(""),channelsElement.addEventListener("click",onChannelsElementClick)})}var currentMappingOptions,self=this;self.show=function(){var dialogOptions={removeOnClose:!0};dialogOptions.size="small";var dlg=dialogHelper.createDialog(dialogOptions);dlg.classList.add("formDialog"),dlg.classList.add("ui-body-a"),dlg.classList.add("background-theme-a");var html="",title=globalize.translate("MapChannels");return html+='<div class="formDialogHeader">',html+='<button is="paper-icon-button-light" class="btnCancel autoSize" tabindex="-1"><i class="md-icon">&#xE5C4;</i></button>',html+='<h3 class="formDialogHeaderTitle">',html+=title,html+="</h3>",html+="</div>",html+=getEditorHtml(),dlg.innerHTML=html,initEditor(dlg,options),dlg.querySelector(".btnCancel").addEventListener("click",function(){dialogHelper.close(dlg)}),new Promise(function(resolve,reject){dlg.addEventListener("close",resolve),dialogHelper.open(dlg)})}}});

View File

@ -1,234 +1 @@
define(['events'], function (events) {
'use strict';
// LinkParser
//
// https://github.com/ravisorg/LinkParser
//
// Locate and extract almost any URL within a string. Handles protocol-less domains, IPv4 and
// IPv6, unrecognised TLDs, and more.
//
// This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
// http://creativecommons.org/licenses/by-sa/4.0/
(function () {
// Original URL regex from the Android android.text.util.Linkify function, found here:
// http://stackoverflow.com/a/19696443
//
// However there were problems with it, most probably related to the fact it was
// written in 2007, and it's been highly modified.
//
// 1) I didn't like the fact that it was tied to specific TLDs, since new ones
// are being added all the time it wouldn't be reasonable to expect developer to
// be continually updating their regular expressions.
//
// 2) It didn't allow unicode characters in the domains which are now allowed in
// many languages, (including some IDN TLDs). Again these are constantly being
// added to and it doesn't seem reasonable to hard-code them. Note this ended up
// not being possible in standard JS due to the way it handles multibyte strings.
// It is possible using XRegExp, however a big performance hit results. Disabled
// for now.
//
// 3) It didn't allow for IPv6 hostnames
// IPv6 regex from http://stackoverflow.com/a/17871737
//
// 4) It was very poorly commented
//
// 5) It wasn't as smart as it could have been about what should be part of a
// URL and what should be part of human language.
var protocols = "(?:(?:http|https|rtsp|ftp):\\/\\/)";
var credentials = "(?:(?:[a-z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-f0-9]{2})){1,64}" // username (1-64 normal or url escaped characters)
+ "(?:\\:(?:[a-z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-f0-9]{2})){1,25})?" // followed by optional password (: + 1-25 normal or url escaped characters)
+ "\\@)";
// IPv6 Regex http://forums.intermapper.com/viewtopic.php?t=452
// by Dartware, LLC is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
// http://intermapper.com/
var ipv6 = "("
+ "(([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))"
+ "|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))"
+ "|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))"
+ "|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))"
+ "|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))"
+ "|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))"
+ "|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))"
+ "|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))"
+ ")(%.+)?";
var ipv4 = "(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\."
+ "(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\."
+ "(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\."
+ "(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[0-9])";
// This would have been a lot cleaner if JS RegExp supported conditionals...
var linkRegExpString =
// begin match for protocol / username / password / host
"(?:"
// ============================
// If we have a recognized protocol at the beginning of the URL, we're
// more relaxed about what we accept, because we assume the user wants
// this to be a URL, and we're not accidentally matching human language
+ protocols + "?"
// optional username:password@
+ credentials + "?"
// IP address (both v4 and v6)
+ "(?:"
// IPv6
+ ipv6
// IPv4
+ "|" + ipv4
+ ")"
// end match for protocol / username / password / host
+ ")"
// optional port number
+ "(?:\\:\\d{1,5})?"
// plus optional path and query params (no unicode allowed here?)
+ "(?:"
+ "\\/(?:"
// some characters we'll accept because it's unlikely human language
// would use them after a URL unless they were part of the url
+ "(?:[a-z0-9\\/\\@\\&\\#\\~\\*\\_\\-\\+])"
+ "|(?:\\%[a-f0-9]{2})"
// some characters are much more likely to be used AFTER a url and
// were not intended to be included in the url itself. Mostly end
// of sentence type things. It's also likely that the URL would
// still work if any of these characters were missing from the end
// because we parsed it incorrectly. For these characters to be accepted
// they must be followed by another character that we're reasonably
// sure is part of the url
+ "|(?:[\\;\\?\\:\\.\\!\\'\\(\\)\\,\\=]+(?=(?:[a-z0-9\\/\\@\\&\\#\\~\\*\\_\\-\\+])|(?:\\%[a-f0-9]{2})))"
+ ")*"
+ "|\\b|\$"
+ ")";
// regex = XRegExp(regex,'gi');
var linkRegExp = RegExp(linkRegExpString, 'gi');
var protocolRegExp = RegExp('^' + protocols, 'i');
// if url doesn't begin with a known protocol, add http by default
function ensureProtocol(url) {
if (!url.match(protocolRegExp)) {
url = "http://" + url;
}
return url;
}
// look for links in the text
var LinkParser = {
parse: function (text) {
var links = [];
var match;
while (match = linkRegExp.exec(text)) {
// console.log(matches);
var txt = match[0];
var pos = match['index'];
var len = txt.length;
var url = ensureProtocol(text);
links.push({ 'pos': pos, 'text': txt, 'len': len, 'url': url });
}
return links;
}
}
window.LinkParser = LinkParser;
})();
var cache = {};
function getEndpointInfo(apiClient) {
return apiClient.getJSON(apiClient.getUrl('System/Endpoint'));
}
function isValidIpAddress(address) {
var links = LinkParser.parse(address);
return links.length == 1;
}
function isLocalIpAddress(address) {
address = address.toLowerCase();
if (address.indexOf('127.0.0.1') != -1) {
return true;
}
if (address.indexOf('localhost') != -1) {
return true;
}
return false;
}
function getServerAddress(apiClient) {
var serverAddress = apiClient.serverAddress();
if (isValidIpAddress(serverAddress) && !isLocalIpAddress(serverAddress)) {
return Promise.resolve(serverAddress);
}
var cachedValue = getCachedValue(serverAddress);
if (cachedValue) {
return Promise.resolve(cachedValue);
}
return apiClient.getJSON(apiClient.getUrl('System/Endpoint')).then(function (endpoint) {
if (endpoint.IsInNetwork) {
return apiClient.getPublicSystemInfo().then(function (info) {
addToCache(serverAddress, info.LocalAddress);
return info.LocalAddress;
});
} else {
addToCache(serverAddress, serverAddress);
return serverAddress;
}
});
}
function clearCache() {
cache = {};
}
function addToCache(key, value) {
cache[key] = {
value: value,
time: new Date().getTime()
};
}
function getCachedValue(key) {
var obj = cache[key];
if (obj && (new Date().getTime() - obj.time) < 180000) {
return obj.value;
}
return null;
}
events.on(ConnectionManager, 'localusersignedin', clearCache);
events.on(ConnectionManager, 'localusersignedout', clearCache);
return {
getServerAddress: getServerAddress
};
});
define(["events"],function(events){"use strict";function isValidIpAddress(address){var links=LinkParser.parse(address);return 1==links.length}function isLocalIpAddress(address){return address=address.toLowerCase(),address.indexOf("127.0.0.1")!=-1||address.indexOf("localhost")!=-1}function getServerAddress(apiClient){var serverAddress=apiClient.serverAddress();if(isValidIpAddress(serverAddress)&&!isLocalIpAddress(serverAddress))return Promise.resolve(serverAddress);var cachedValue=getCachedValue(serverAddress);return cachedValue?Promise.resolve(cachedValue):apiClient.getJSON(apiClient.getUrl("System/Endpoint")).then(function(endpoint){return endpoint.IsInNetwork?apiClient.getPublicSystemInfo().then(function(info){return addToCache(serverAddress,info.LocalAddress),info.LocalAddress}):(addToCache(serverAddress,serverAddress),serverAddress)})}function clearCache(){cache={}}function addToCache(key,value){cache[key]={value:value,time:(new Date).getTime()}}function getCachedValue(key){var obj=cache[key];return obj&&(new Date).getTime()-obj.time<18e4?obj.value:null}!function(){function ensureProtocol(url){return url.match(protocolRegExp)||(url="http://"+url),url}var protocols="(?:(?:http|https|rtsp|ftp):\\/\\/)",credentials="(?:(?:[a-z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-f0-9]{2})){1,64}(?:\\:(?:[a-z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-f0-9]{2})){1,25})?\\@)",ipv6="((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?",ipv4="(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[0-9])",linkRegExpString="(?:"+protocols+"?"+credentials+"?(?:"+ipv6+"|"+ipv4+"))(?:\\:\\d{1,5})?(?:\\/(?:(?:[a-z0-9\\/\\@\\&\\#\\~\\*\\_\\-\\+])|(?:\\%[a-f0-9]{2})|(?:[\\;\\?\\:\\.\\!\\'\\(\\)\\,\\=]+(?=(?:[a-z0-9\\/\\@\\&\\#\\~\\*\\_\\-\\+])|(?:\\%[a-f0-9]{2}))))*|\\b|$)",linkRegExp=RegExp(linkRegExpString,"gi"),protocolRegExp=RegExp("^"+protocols,"i"),LinkParser={parse:function(text){for(var match,links=[];match=linkRegExp.exec(text);){var txt=match[0],pos=match.index,len=txt.length,url=ensureProtocol(text);links.push({pos:pos,text:txt,len:len,url:url})}return links}};window.LinkParser=LinkParser}();var cache={};return events.on(ConnectionManager,"localusersignedin",clearCache),events.on(ConnectionManager,"localusersignedout",clearCache),{getServerAddress:getServerAddress}});

View File

@ -1,16 +1 @@
#ulDirectoryPickerList a {
padding-top: .4em;
padding-bottom: .4em;
}
.lblDirectoryPickerPath {
white-space: nowrap;
}
.directoryPickerHeadline {
color: #000;
background: #fff3a5;
padding: 1em;
border-radius: 5px;
margin-bottom: 1.5em;
}
#ulDirectoryPickerList a{padding-top:.4em;padding-bottom:.4em}.lblDirectoryPickerPath{white-space:nowrap}.directoryPickerHeadline{color:#000;background:#fff3a5;padding:1em;-webkit-border-radius:5px;border-radius:5px;margin-bottom:1.5em}

File diff suppressed because one or more lines are too long

View File

@ -1,44 +1 @@
.dockedtabs-tabs {
flex-grow: 1;
display: flex;
padding: .5em 0;
/* Override size from librarymenu */
font-size: inherit;
font-size: 13px;
}
.dockedtabs-tab-button {
flex-grow: 1;
align-items: center;
justify-content: center;
text-transform: none !important;
font-size: 12.4px !important;
padding: 0 !important;
margin: 0 !important;
text-align: center;
border-color: transparent !important;
border-width: 0 !important;
}
.dockedtabs-tab-button {
display: flex;
}
.dockedtabs-tab-button-noflex {
display: block;
}
.dockedtabs-tab-button, .dockedtabs-tab-button-foreground {
font-weight: normal !important;
}
.dockedtabs-tab-button-icon {
margin-bottom: .25em;
font-size: 22px;
}
@media all and (max-width: 800px) {
.dockedtab-midsize {
display: none !important;
}
}
.dockedtabs-tabs{-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;display:-webkit-box;display:-webkit-flex;display:flex;padding:.5em 0;font-size:inherit;font-size:13px}.dockedtabs-tab-button{-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;text-transform:none!important;font-size:12.4px!important;padding:0!important;margin:0!important;text-align:center;border-color:transparent!important;border-width:0!important;display:-webkit-box;display:-webkit-flex;display:flex}.dockedtabs-tab-button-noflex{display:block}.dockedtabs-tab-button,.dockedtabs-tab-button-foreground{font-weight:400!important}.dockedtabs-tab-button-icon{margin-bottom:.25em;font-size:22px}@media all and (max-width:800px){.dockedtab-midsize{display:none!important}}

File diff suppressed because one or more lines are too long

View File

@ -1,175 +1 @@
define(['libraryBrowser', 'cardBuilder', 'dom', 'apphost', 'imageLoader', 'scrollStyles', 'emby-itemscontainer'], function (libraryBrowser, cardBuilder, dom, appHost, imageLoader) {
'use strict';
function enableScrollX() {
return browserInfo.mobile;
}
function getThumbShape() {
return enableScrollX() ? 'overflowBackdrop' : 'backdrop';
}
function getPosterShape() {
return enableScrollX() ? 'overflowPortrait' : 'portrait';
}
function getSquareShape() {
return enableScrollX() ? 'overflowSquare' : 'square';
}
function getSections() {
return [
{ name: 'HeaderFavoriteMovies', types: "Movie", id: "favoriteMovies", shape: getPosterShape(), showTitle: false, overlayPlayButton: true },
{ name: 'HeaderFavoriteShows', types: "Series", id: "favoriteShows", shape: getPosterShape(), showTitle: false, overlayPlayButton: true },
{ name: 'HeaderFavoriteEpisodes', types: "Episode", id: "favoriteEpisode", shape: getThumbShape(), preferThumb: false, showTitle: true, showParentTitle: true, overlayPlayButton: true, overlayText: false, centerText: true },
{ name: 'HeaderFavoriteGames', types: "Game", id: "favoriteGames", shape: getSquareShape(), preferThumb: false, showTitle: true },
{ name: 'HeaderFavoriteArtists', types: "MusicArtist", id: "favoriteArtists", shape: getSquareShape(), preferThumb: false, showTitle: true, overlayText: false, showParentTitle: true, centerText: true, overlayPlayButton: true },
{ name: 'HeaderFavoriteAlbums', types: "MusicAlbum", id: "favoriteAlbums", shape: getSquareShape(), preferThumb: false, showTitle: true, overlayText: false, showParentTitle: true, centerText: true, overlayPlayButton: true },
{ name: 'HeaderFavoriteSongs', types: "Audio", id: "favoriteSongs", shape: getSquareShape(), preferThumb: false, showTitle: true, overlayText: false, showParentTitle: true, centerText: true, overlayMoreButton: true, action: 'instantmix' }
];
}
function loadSection(elem, userId, topParentId, section, isSingleSection) {
var screenWidth = dom.getWindowSize().innerWidth;
var options = {
SortBy: "SortName",
SortOrder: "Ascending",
Filters: "IsFavorite",
Recursive: true,
Fields: "PrimaryImageAspectRatio,BasicSyncInfo",
CollapseBoxSetItems: false,
ExcludeLocationTypes: "Virtual",
EnableTotalRecordCount: false
};
if (topParentId) {
options.ParentId = topParentId;
}
if (!isSingleSection) {
options.Limit = screenWidth >= 1920 ? 10 : (screenWidth >= 1440 ? 8 : 6);
if (enableScrollX()) {
options.Limit = 20;
}
}
var promise;
if (section.types == 'MusicArtist') {
promise = ApiClient.getArtists(userId, options);
} else {
options.IncludeItemTypes = section.types;
promise = ApiClient.getItems(userId, options);
}
return promise.then(function (result) {
var html = '';
if (result.Items.length) {
html += '<div>';
html += '<h1 style="display:inline-block; vertical-align:middle;" class="listHeader">' + Globalize.translate(section.name) + '</h1>';
if (options.Limit && result.Items.length >= options.Limit) {
var href = "secondaryitems.html?type=" + section.types + "&filters=IsFavorite";
html += '<a class="clearLink" href="' + href + '" style="margin-left:2em;"><button is="emby-button" type="button" class="raised more mini">' + Globalize.translate('ButtonMore') + '</button></a>';
}
html += '</div>';
if (enableScrollX()) {
html += '<div is="emby-itemscontainer" class="itemsContainer hiddenScrollX">';
} else {
html += '<div is="emby-itemscontainer" class="itemsContainer vertical-wrap">';
}
var supportsImageAnalysis = appHost.supports('imageanalysis');
var cardLayout = (appHost.preferVisualCards || supportsImageAnalysis) && section.showTitle;
html += cardBuilder.getCardsHtml(result.Items, {
preferThumb: section.preferThumb,
shape: section.shape,
centerText: section.centerText && !cardLayout,
overlayText: section.overlayText !== false,
showTitle: section.showTitle,
showParentTitle: section.showParentTitle,
scalable: true,
overlayPlayButton: section.overlayPlayButton,
overlayMoreButton: section.overlayMoreButton && !cardLayout,
action: section.action,
allowBottomPadding: !enableScrollX(),
cardLayout: cardLayout,
vibrant: supportsImageAnalysis && cardLayout
});
html += '</div>';
}
elem.innerHTML = html;
imageLoader.lazyChildren(elem);
});
}
function loadSections(page, userId, topParentId, types) {
Dashboard.showLoadingMsg();
var sections = getSections();
var sectionid = getParameterByName('sectionid');
if (sectionid) {
sections = sections.filter(function (s) {
return s.id == sectionid;
});
}
if (types) {
sections = sections.filter(function (s) {
return types.indexOf(s.id) != -1;
});
}
var i, length;
var elem = page.querySelector('.favoriteSections');
if (!elem.innerHTML) {
var html = '';
for (i = 0, length = sections.length; i < length; i++) {
html += '<div class="homePageSection section' + sections[i].id + '"></div>';
}
elem.innerHTML = html;
}
var promises = [];
for (i = 0, length = sections.length; i < length; i++) {
var section = sections[i];
elem = page.querySelector('.section' + section.id);
promises.push(loadSection(elem, userId, topParentId, section, sections.length == 1));
}
Promise.all(promises).then(function () {
Dashboard.hideLoadingMsg();
});
}
return {
render: loadSections
};
});
define(["libraryBrowser","cardBuilder","dom","apphost","imageLoader","scrollStyles","emby-itemscontainer"],function(libraryBrowser,cardBuilder,dom,appHost,imageLoader){"use strict";function enableScrollX(){return browserInfo.mobile}function getThumbShape(){return enableScrollX()?"overflowBackdrop":"backdrop"}function getPosterShape(){return enableScrollX()?"overflowPortrait":"portrait"}function getSquareShape(){return enableScrollX()?"overflowSquare":"square"}function getSections(){return[{name:"HeaderFavoriteMovies",types:"Movie",id:"favoriteMovies",shape:getPosterShape(),showTitle:!1,overlayPlayButton:!0},{name:"HeaderFavoriteShows",types:"Series",id:"favoriteShows",shape:getPosterShape(),showTitle:!1,overlayPlayButton:!0},{name:"HeaderFavoriteEpisodes",types:"Episode",id:"favoriteEpisode",shape:getThumbShape(),preferThumb:!1,showTitle:!0,showParentTitle:!0,overlayPlayButton:!0,overlayText:!1,centerText:!0},{name:"HeaderFavoriteGames",types:"Game",id:"favoriteGames",shape:getSquareShape(),preferThumb:!1,showTitle:!0},{name:"HeaderFavoriteArtists",types:"MusicArtist",id:"favoriteArtists",shape:getSquareShape(),preferThumb:!1,showTitle:!0,overlayText:!1,showParentTitle:!0,centerText:!0,overlayPlayButton:!0},{name:"HeaderFavoriteAlbums",types:"MusicAlbum",id:"favoriteAlbums",shape:getSquareShape(),preferThumb:!1,showTitle:!0,overlayText:!1,showParentTitle:!0,centerText:!0,overlayPlayButton:!0},{name:"HeaderFavoriteSongs",types:"Audio",id:"favoriteSongs",shape:getSquareShape(),preferThumb:!1,showTitle:!0,overlayText:!1,showParentTitle:!0,centerText:!0,overlayMoreButton:!0,action:"instantmix"}]}function loadSection(elem,userId,topParentId,section,isSingleSection){var screenWidth=dom.getWindowSize().innerWidth,options={SortBy:"SortName",SortOrder:"Ascending",Filters:"IsFavorite",Recursive:!0,Fields:"PrimaryImageAspectRatio,BasicSyncInfo",CollapseBoxSetItems:!1,ExcludeLocationTypes:"Virtual",EnableTotalRecordCount:!1};topParentId&&(options.ParentId=topParentId),isSingleSection||(options.Limit=screenWidth>=1920?10:screenWidth>=1440?8:6,enableScrollX()&&(options.Limit=20));var promise;return"MusicArtist"==section.types?promise=ApiClient.getArtists(userId,options):(options.IncludeItemTypes=section.types,promise=ApiClient.getItems(userId,options)),promise.then(function(result){var html="";if(result.Items.length){if(html+="<div>",html+='<h1 style="display:inline-block; vertical-align:middle;" class="listHeader">'+Globalize.translate(section.name)+"</h1>",options.Limit&&result.Items.length>=options.Limit){var href="secondaryitems.html?type="+section.types+"&filters=IsFavorite";html+='<a class="clearLink" href="'+href+'" style="margin-left:2em;"><button is="emby-button" type="button" class="raised more mini">'+Globalize.translate("ButtonMore")+"</button></a>"}html+="</div>",html+=enableScrollX()?'<div is="emby-itemscontainer" class="itemsContainer hiddenScrollX">':'<div is="emby-itemscontainer" class="itemsContainer vertical-wrap">';var supportsImageAnalysis=appHost.supports("imageanalysis"),cardLayout=(appHost.preferVisualCards||supportsImageAnalysis)&&section.showTitle;html+=cardBuilder.getCardsHtml(result.Items,{preferThumb:section.preferThumb,shape:section.shape,centerText:section.centerText&&!cardLayout,overlayText:section.overlayText!==!1,showTitle:section.showTitle,showParentTitle:section.showParentTitle,scalable:!0,overlayPlayButton:section.overlayPlayButton,overlayMoreButton:section.overlayMoreButton&&!cardLayout,action:section.action,allowBottomPadding:!enableScrollX(),cardLayout:cardLayout,vibrant:supportsImageAnalysis&&cardLayout}),html+="</div>"}elem.innerHTML=html,imageLoader.lazyChildren(elem)})}function loadSections(page,userId,topParentId,types){Dashboard.showLoadingMsg();var sections=getSections(),sectionid=getParameterByName("sectionid");sectionid&&(sections=sections.filter(function(s){return s.id==sectionid})),types&&(sections=sections.filter(function(s){return types.indexOf(s.id)!=-1}));var i,length,elem=page.querySelector(".favoriteSections");if(!elem.innerHTML){var html="";for(i=0,length=sections.length;i<length;i++)html+='<div class="homePageSection section'+sections[i].id+'"></div>';elem.innerHTML=html}var promises=[];for(i=0,length=sections.length;i<length;i++){var section=sections[i];elem=page.querySelector(".section"+section.id),promises.push(loadSection(elem,userId,topParentId,section,1==sections.length))}Promise.all(promises).then(function(){Dashboard.hideLoadingMsg()})}return{render:loadSections}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,38 +1 @@
.dynamicFilterDialog {
position: fixed !important;
top: 5% !important;
bottom: 5% !important;
margin-top: 0 !important;
margin-bottom: 0 !important;
margin-right: 0 !important;
border-radius: 0 !important;
max-height: none !important;
max-width: none !important;
}
@media all and (min-height: 600px) {
.dynamicFilterDialog {
top: 10% !important;
bottom: 10% !important;
}
}
@media all and (max-width: 400px) {
.dynamicFilterDialog {
width: auto;
left: 10vw !important;
right: 10vw !important;
margin-left: 0 !important;
}
}
@media all and (min-width: 400px) {
.dynamicFilterDialog {
width: 300px;
margin-left: -150px !important;
left: 50% !important;
}
}
.dynamicFilterDialog{position:fixed!important;top:5%!important;bottom:5%!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;-webkit-border-radius:0!important;border-radius:0!important;max-height:none!important;max-width:none!important}@media all and (min-height:600px){.dynamicFilterDialog{top:10%!important;bottom:10%!important}}@media all and (max-width:400px){.dynamicFilterDialog{width:auto;left:10vw!important;right:10vw!important;margin-left:0!important}}@media all and (min-width:400px){.dynamicFilterDialog{width:300px;margin-left:-150px!important;left:50%!important}}

View File

@ -1,54 +1 @@
define(['dom'], function (dom) {
'use strict';
function onGroupedCardClick(e, card) {
var itemId = card.getAttribute('data-id');
var userId = Dashboard.getCurrentUserId();
var playedIndicator = card.querySelector('.playedIndicator');
var playedIndicatorHtml = playedIndicator ? playedIndicator.innerHTML : null;
var options = {
Limit: parseInt(playedIndicatorHtml || '10'),
Fields: "PrimaryImageAspectRatio,DateCreated",
ParentId: itemId,
GroupItems: false
};
var actionableParent = dom.parentWithTag(e.target, ['A', 'BUTTON', 'INPUT']);
if (actionableParent && !actionableParent.classList.contains('cardContent')) {
return;
}
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
if (items.length == 1) {
Dashboard.navigate(LibraryBrowser.getHref(items[0]));
return;
}
var url = 'itemdetails.html?id=' + itemId;
Dashboard.navigate(url);
});
e.stopPropagation();
e.preventDefault();
return false;
}
function onItemsContainerClick(e) {
var groupedCard = dom.parentWithClass(e.target, 'groupedCard');
if (groupedCard) {
onGroupedCardClick(e, groupedCard);
}
}
return {
onItemsContainerClick: onItemsContainerClick
};
});
define(["dom"],function(dom){"use strict";function onGroupedCardClick(e,card){var itemId=card.getAttribute("data-id"),userId=Dashboard.getCurrentUserId(),playedIndicator=card.querySelector(".playedIndicator"),playedIndicatorHtml=playedIndicator?playedIndicator.innerHTML:null,options={Limit:parseInt(playedIndicatorHtml||"10"),Fields:"PrimaryImageAspectRatio,DateCreated",ParentId:itemId,GroupItems:!1},actionableParent=dom.parentWithTag(e.target,["A","BUTTON","INPUT"]);if(!actionableParent||actionableParent.classList.contains("cardContent"))return ApiClient.getJSON(ApiClient.getUrl("Users/"+userId+"/Items/Latest",options)).then(function(items){if(1==items.length)return void Dashboard.navigate(LibraryBrowser.getHref(items[0]));var url="itemdetails.html?id="+itemId;Dashboard.navigate(url)}),e.stopPropagation(),e.preventDefault(),!1}function onItemsContainerClick(e){var groupedCard=dom.parentWithClass(e.target,"groupedCard");groupedCard&&onGroupedCardClick(e,groupedCard)}return{onItemsContainerClick:onItemsContainerClick}});

View File

@ -1,66 +1 @@
define(['dialogHelper', 'connectHelper', 'emby-input', 'emby-button', 'emby-collapse', 'paper-icon-button-light', 'formDialogStyle'], function (dialogHelper, connectHelper) {
'use strict';
return {
show: function () {
return new Promise(function (resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'components/guestinviter/connectlink.template.html', true);
xhr.onload = function (e) {
var template = this.response;
var dlg = dialogHelper.createDialog({
removeOnClose: true,
size: 'small'
});
dlg.classList.add('ui-body-a');
dlg.classList.add('background-theme-a');
dlg.classList.add('formDialog');
var html = '';
html += Globalize.translateDocument(template);
dlg.innerHTML = html;
dialogHelper.open(dlg);
dlg.addEventListener('close', function () {
if (dlg.submitted) {
resolve();
} else {
reject();
}
});
dlg.querySelector('.btnCancel').addEventListener('click', function (e) {
dialogHelper.close(dlg);
});
dlg.querySelector('form').addEventListener('submit', function (e) {
ApiClient.getCurrentUser().then(function (user) {
connectHelper.updateUserLink(ApiClient, user, dlg.querySelector('#txtConnectUsername').value).then(function () {
dialogHelper.close(dlg);
}, function () {
dialogHelper.close(dlg);
});
});
e.preventDefault();
return false;
});
}
xhr.send();
});
}
};
});
define(["dialogHelper","connectHelper","emby-input","emby-button","emby-collapse","paper-icon-button-light","formDialogStyle"],function(dialogHelper,connectHelper){"use strict";return{show:function(){return new Promise(function(resolve,reject){var xhr=new XMLHttpRequest;xhr.open("GET","components/guestinviter/connectlink.template.html",!0),xhr.onload=function(e){var template=this.response,dlg=dialogHelper.createDialog({removeOnClose:!0,size:"small"});dlg.classList.add("ui-body-a"),dlg.classList.add("background-theme-a"),dlg.classList.add("formDialog");var html="";html+=Globalize.translateDocument(template),dlg.innerHTML=html,dialogHelper.open(dlg),dlg.addEventListener("close",function(){dlg.submitted?resolve():reject()}),dlg.querySelector(".btnCancel").addEventListener("click",function(e){dialogHelper.close(dlg)}),dlg.querySelector("form").addEventListener("submit",function(e){return ApiClient.getCurrentUser().then(function(user){connectHelper.updateUserLink(ApiClient,user,dlg.querySelector("#txtConnectUsername").value).then(function(){dialogHelper.close(dlg)},function(){dialogHelper.close(dlg)})}),e.preventDefault(),!1})},xhr.send()})}}});

View File

@ -1,115 +1 @@
define(['dialogHelper', 'jQuery', 'emby-input', 'emby-button', 'emby-checkbox', 'paper-icon-button-light', 'formDialogStyle'], function (dialogHelper, $) {
'use strict';
function renderLibrarySharingList(context, result) {
var folderHtml = '';
folderHtml += result.Items.map(function (i) {
var currentHtml = '';
var isChecked = true;
var checkedHtml = isChecked ? ' checked="checked"' : '';
currentHtml += '<label><input is="emby-checkbox" class="chkShareFolder" type="checkbox" data-folderid="' + i.Id + '"' + checkedHtml + '/><span>' + i.Name + '</span></label>';
return currentHtml;
}).join('');
context.querySelector('.librarySharingList').innerHTML = folderHtml;
}
function inviteUser(dlg) {
Dashboard.showLoadingMsg();
var shareExcludes = $(".chkShareFolder", dlg).get().filter(function (i) {
return i.checked;
}).map(function (i) {
return i.getAttribute('data-folderid');
});
require(['connectHelper'], function (connectHelper) {
connectHelper.inviteGuest({
apiClient: ApiClient,
guestOptions: {
ConnectUsername: dlg.querySelector('#txtConnectUsername').value,
EnabledLibraries: shareExcludes.join(','),
SendingUserId: Dashboard.getCurrentUserId(),
EnableLiveTv: false
}
}).then(function() {
dlg.submitted = true;
dialogHelper.close(dlg);
});
});
}
return {
show: function () {
return new Promise(function (resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'components/guestinviter/guestinviter.template.html', true);
xhr.onload = function (e) {
var template = this.response;
var dlg = dialogHelper.createDialog({
removeOnClose: true,
size: 'small'
});
dlg.classList.add('ui-body-a');
dlg.classList.add('background-theme-a');
dlg.classList.add('formDialog');
var html = '';
html += Globalize.translateDocument(template);
dlg.innerHTML = html;
dialogHelper.open(dlg);
dlg.addEventListener('close', function () {
if (dlg.submitted) {
resolve();
} else {
reject();
}
});
dlg.querySelector('.btnCancel').addEventListener('click', function (e) {
dialogHelper.close(dlg);
});
dlg.querySelector('form').addEventListener('submit', function (e) {
inviteUser(dlg);
e.preventDefault();
return false;
});
ApiClient.getJSON(ApiClient.getUrl("Library/MediaFolders", { IsHidden: false })).then(function (result) {
renderLibrarySharingList(dlg, result);
});
}
xhr.send();
});
}
};
});
define(["dialogHelper","jQuery","emby-input","emby-button","emby-checkbox","paper-icon-button-light","formDialogStyle"],function(dialogHelper,$){"use strict";function renderLibrarySharingList(context,result){var folderHtml="";folderHtml+=result.Items.map(function(i){var currentHtml="",isChecked=!0,checkedHtml=isChecked?' checked="checked"':"";return currentHtml+='<label><input is="emby-checkbox" class="chkShareFolder" type="checkbox" data-folderid="'+i.Id+'"'+checkedHtml+"/><span>"+i.Name+"</span></label>"}).join(""),context.querySelector(".librarySharingList").innerHTML=folderHtml}function inviteUser(dlg){Dashboard.showLoadingMsg();var shareExcludes=$(".chkShareFolder",dlg).get().filter(function(i){return i.checked}).map(function(i){return i.getAttribute("data-folderid")});require(["connectHelper"],function(connectHelper){connectHelper.inviteGuest({apiClient:ApiClient,guestOptions:{ConnectUsername:dlg.querySelector("#txtConnectUsername").value,EnabledLibraries:shareExcludes.join(","),SendingUserId:Dashboard.getCurrentUserId(),EnableLiveTv:!1}}).then(function(){dlg.submitted=!0,dialogHelper.close(dlg)})})}return{show:function(){return new Promise(function(resolve,reject){var xhr=new XMLHttpRequest;xhr.open("GET","components/guestinviter/guestinviter.template.html",!0),xhr.onload=function(e){var template=this.response,dlg=dialogHelper.createDialog({removeOnClose:!0,size:"small"});dlg.classList.add("ui-body-a"),dlg.classList.add("background-theme-a"),dlg.classList.add("formDialog");var html="";html+=Globalize.translateDocument(template),dlg.innerHTML=html,dialogHelper.open(dlg),dlg.addEventListener("close",function(){dlg.submitted?resolve():reject()}),dlg.querySelector(".btnCancel").addEventListener("click",function(e){dialogHelper.close(dlg)}),dlg.querySelector("form").addEventListener("submit",function(e){return inviteUser(dlg),e.preventDefault(),!1}),ApiClient.getJSON(ApiClient.getUrl("Library/MediaFolders",{IsHidden:!1})).then(function(result){renderLibrarySharingList(dlg,result)})},xhr.send()})}}});

View File

@ -1,65 +1 @@
define(['datetime'], function (datetime) {
'use strict';
/*
* Javascript Humane Dates
* Copyright (c) 2008 Dean Landolt (deanlandolt.com)
* Re-write by Zach Leatherman (zachleat.com)
*
* Adopted from the John Resig's pretty.js
* at http://ejohn.org/blog/javascript-pretty-date
* and henrah's proposed modification
* at http://ejohn.org/blog/javascript-pretty-date/#comment-297458
*
* Licensed under the MIT license.
*/
function humane_date(date_str) {
var time_formats = [[90, 'a minute'], // 60*1.5
[3600, 'minutes', 60], // 60*60, 60
[5400, 'an hour'], // 60*60*1.5
[86400, 'hours', 3600], // 60*60*24, 60*60
[129600, 'a day'], // 60*60*24*1.5
[604800, 'days', 86400], // 60*60*24*7, 60*60*24
[907200, 'a week'], // 60*60*24*7*1.5
[2628000, 'weeks', 604800], // 60*60*24*(365/12), 60*60*24*7
[3942000, 'a month'], // 60*60*24*(365/12)*1.5
[31536000, 'months', 2628000], // 60*60*24*365, 60*60*24*(365/12)
[47304000, 'a year'], // 60*60*24*365*1.5
[3153600000, 'years', 31536000] // 60*60*24*365*100, 60*60*24*365
];
var dt = new Date;
var date = datetime.parseISO8601Date(date_str, true);
var seconds = ((dt - date) / 1000);
var token = ' ago';
var i = 0;
var format;
if (seconds < 0) {
seconds = Math.abs(seconds);
//token = '';
}
while (format = time_formats[i++]) {
if (seconds < format[0]) {
if (format.length == 2) {
return format[1] + token;
} else {
return Math.round(seconds / format[2]) + ' ' + format[1] + token;
}
}
}
// overflow for centuries
if (seconds > 4730400000)
return Math.round(seconds / 4730400000) + ' centuries' + token;
return date_str;
}
window.humane_date = humane_date;
return humane_date;
});
define(["datetime"],function(datetime){"use strict";function humane_date(date_str){var format,time_formats=[[90,"a minute"],[3600,"minutes",60],[5400,"an hour"],[86400,"hours",3600],[129600,"a day"],[604800,"days",86400],[907200,"a week"],[2628e3,"weeks",604800],[3942e3,"a month"],[31536e3,"months",2628e3],[47304e3,"a year"],[31536e5,"years",31536e3]],dt=new Date,date=datetime.parseISO8601Date(date_str,!0),seconds=(dt-date)/1e3,token=" ago",i=0;for(seconds<0&&(seconds=Math.abs(seconds));format=time_formats[i++];)if(seconds<format[0])return 2==format.length?format[1]+token:Math.round(seconds/format[2])+" "+format[1]+token;return seconds>47304e5?Math.round(seconds/47304e5)+" centuries"+token:date_str}return window.humane_date=humane_date,humane_date});

View File

@ -1,74 +1 @@
define(['apphost', 'globalize', 'shell'], function (appHost, globalize, shell) {
'use strict';
function getProductInfo(feature) {
return null;
}
function showExternalPremiereInfo() {
shell.openUrl('https://emby.media/premiere');
}
function beginPurchase(feature, email) {
showExternalPremiereInfo();
return Promise.reject();
}
function restorePurchase(id) {
return Promise.reject();
}
function getSubscriptionOptions() {
var options = [];
options.push({
id: 'embypremiere',
title: globalize.translate('sharedcomponents#HeaderBecomeProjectSupporter'),
requiresEmail: false
});
return Promise.resolve(options);
}
function isUnlockedByDefault(feature, options) {
var autoUnlockedFeatures = appHost.unlockedFeatures ? appHost.unlockedFeatures() : [];
if (autoUnlockedFeatures.indexOf(feature) != -1) {
return Promise.resolve();
}
return Promise.reject();
}
function getAdminFeatureName(feature) {
return feature;
}
function getRestoreButtonText() {
return globalize.translate('sharedcomponents#ButtonAlreadyPaid');
}
function getPeriodicMessageIntervalMs(feature) {
if (feature === 'playback') {
return 43200000;
}
return 0;
}
return {
getProductInfo: getProductInfo,
beginPurchase: beginPurchase,
restorePurchase: restorePurchase,
getSubscriptionOptions: getSubscriptionOptions,
isUnlockedByDefault: isUnlockedByDefault,
getAdminFeatureName: getAdminFeatureName,
getRestoreButtonText: getRestoreButtonText,
getPeriodicMessageIntervalMs: getPeriodicMessageIntervalMs
};
});
define(["apphost","globalize","shell"],function(appHost,globalize,shell){"use strict";function getProductInfo(feature){return null}function showExternalPremiereInfo(){shell.openUrl("https://emby.media/premiere")}function beginPurchase(feature,email){return showExternalPremiereInfo(),Promise.reject()}function restorePurchase(id){return Promise.reject()}function getSubscriptionOptions(){var options=[];return options.push({id:"embypremiere",title:globalize.translate("sharedcomponents#HeaderBecomeProjectSupporter"),requiresEmail:!1}),Promise.resolve(options)}function isUnlockedByDefault(feature,options){var autoUnlockedFeatures=appHost.unlockedFeatures?appHost.unlockedFeatures():[];return autoUnlockedFeatures.indexOf(feature)!=-1?Promise.resolve():Promise.reject()}function getAdminFeatureName(feature){return feature}function getRestoreButtonText(){return globalize.translate("sharedcomponents#ButtonAlreadyPaid")}function getPeriodicMessageIntervalMs(feature){return"playback"===feature?432e5:0}return{getProductInfo:getProductInfo,beginPurchase:beginPurchase,restorePurchase:restorePurchase,getSubscriptionOptions:getSubscriptionOptions,isUnlockedByDefault:isUnlockedByDefault,getAdminFeatureName:getAdminFeatureName,getRestoreButtonText:getRestoreButtonText,getPeriodicMessageIntervalMs:getPeriodicMessageIntervalMs}});

File diff suppressed because one or more lines are too long

View File

@ -1,200 +1 @@
define(['dialogHelper', 'jQuery', 'emby-button', 'emby-select'], function (dialogHelper, $) {
'use strict';
var currentItemId;
var currentFile;
var currentDeferred;
var hasChanges = false;
function onFileReaderError(evt) {
Dashboard.hideLoadingMsg();
switch (evt.target.error.code) {
case evt.target.error.NOT_FOUND_ERR:
require(['toast'], function (toast) {
toast(Globalize.translate('MessageFileNotFound'));
});
break;
case evt.target.error.ABORT_ERR:
break; // noop
default:
require(['toast'], function (toast) {
toast(Globalize.translate('MessageFileReadError'));
});
break;
};
}
function setFiles(page, files) {
var file = files[0];
if (!file || !file.type.match('image.*')) {
$('#imageOutput', page).html('');
$('#fldUpload', page).hide();
currentFile = null;
return;
}
currentFile = file;
var reader = new FileReader();
reader.onerror = onFileReaderError;
reader.onloadstart = function () {
$('#fldUpload', page).hide();
};
reader.onabort = function () {
Dashboard.hideLoadingMsg();
console.log('File read cancelled');
};
// Closure to capture the file information.
reader.onload = (function (theFile) {
return function (e) {
// Render thumbnail.
var html = ['<img style="max-width:300px;max-height:100px;" src="', e.target.result, '" title="', escape(theFile.name), '"/>'].join('');
$('#imageOutput', page).html(html);
$('#fldUpload', page).show();
};
})(file);
// Read in the image file as a data URL.
reader.readAsDataURL(file);
}
function processImageChangeResult(page) {
hasChanges = true;
history.back();
}
function onSubmit() {
var file = currentFile;
if (!file) {
return false;
}
if (file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/jpeg") {
return false;
}
Dashboard.showLoadingMsg();
var page = $(this).parents('.dialog');
var imageType = $('#selectImageType', page).val();
ApiClient.uploadItemImage(currentItemId, imageType, file).then(function () {
$('#uploadImage', page).val('').trigger('change');
Dashboard.hideLoadingMsg();
processImageChangeResult(page);
});
return false;
}
function initEditor(page) {
$('form', page).off('submit', onSubmit).on('submit', onSubmit);
$('#uploadImage', page).on("change", function () {
setFiles(page, this.files);
});
$("#imageDropZone", page).on('dragover', function (e) {
e.preventDefault();
e.originalEvent.dataTransfer.dropEffect = 'Copy';
return false;
}).on('drop', function (e) {
e.preventDefault();
setFiles(page, e.originalEvent.dataTransfer.files);
return false;
});
}
function showEditor(itemId, options) {
options = options || {};
var xhr = new XMLHttpRequest();
xhr.open('GET', 'components/imageuploader/imageuploader.template.html', true);
xhr.onload = function (e) {
var template = this.response;
currentItemId = itemId;
var dlg = dialogHelper.createDialog({
size: 'fullscreen-border'
});
var theme = options.theme || 'b';
dlg.classList.add('ui-body-' + theme);
dlg.classList.add('background-theme-' + theme);
var html = '';
html += '<h2 class="dialogHeader">';
html += '<button type="button" is="emby-button" icon="arrow-back" class="fab mini btnCloseDialog autoSize" tabindex="-1"><i class="md-icon">&#xE5C4;</i></button>';
html += '<div style="display:inline-block;margin-left:.6em;vertical-align:middle;">' + Globalize.translate('HeaderUploadImage') + '</div>';
html += '</h2>';
html += '<div class="editorContent" style="padding:0 1em;">';
html += Globalize.translateDocument(template);
html += '</div>';
dlg.innerHTML = html;
// Has to be assigned a z-index after the call to .open()
$(dlg).on('close', onDialogClosed);
dialogHelper.open(dlg);
var editorContent = dlg.querySelector('.editorContent');
initEditor(editorContent);
$('#selectImageType', dlg).val(options.imageType || 'Primary');
$('.btnCloseDialog', dlg).on('click', function () {
dialogHelper.close(dlg);
});
}
xhr.send();
}
function onDialogClosed() {
$(this).remove();
Dashboard.hideLoadingMsg();
currentDeferred.resolveWith(null, [hasChanges]);
}
return {
show: function (itemId, options) {
var deferred = jQuery.Deferred();
currentDeferred = deferred;
hasChanges = false;
showEditor(itemId, options);
return deferred.promise();
}
};
});
define(["dialogHelper","jQuery","emby-button","emby-select"],function(dialogHelper,$){"use strict";function onFileReaderError(evt){switch(Dashboard.hideLoadingMsg(),evt.target.error.code){case evt.target.error.NOT_FOUND_ERR:require(["toast"],function(toast){toast(Globalize.translate("MessageFileNotFound"))});break;case evt.target.error.ABORT_ERR:break;default:require(["toast"],function(toast){toast(Globalize.translate("MessageFileReadError"))})}}function setFiles(page,files){var file=files[0];if(!file||!file.type.match("image.*"))return $("#imageOutput",page).html(""),$("#fldUpload",page).hide(),void(currentFile=null);currentFile=file;var reader=new FileReader;reader.onerror=onFileReaderError,reader.onloadstart=function(){$("#fldUpload",page).hide()},reader.onabort=function(){Dashboard.hideLoadingMsg(),console.log("File read cancelled")},reader.onload=function(theFile){return function(e){var html=['<img style="max-width:300px;max-height:100px;" src="',e.target.result,'" title="',escape(theFile.name),'"/>'].join("");$("#imageOutput",page).html(html),$("#fldUpload",page).show()}}(file),reader.readAsDataURL(file)}function processImageChangeResult(page){hasChanges=!0,history.back()}function onSubmit(){var file=currentFile;if(!file)return!1;if("image/png"!=file.type&&"image/jpeg"!=file.type&&"image/jpeg"!=file.type)return!1;Dashboard.showLoadingMsg();var page=$(this).parents(".dialog"),imageType=$("#selectImageType",page).val();return ApiClient.uploadItemImage(currentItemId,imageType,file).then(function(){$("#uploadImage",page).val("").trigger("change"),Dashboard.hideLoadingMsg(),processImageChangeResult(page)}),!1}function initEditor(page){$("form",page).off("submit",onSubmit).on("submit",onSubmit),$("#uploadImage",page).on("change",function(){setFiles(page,this.files)}),$("#imageDropZone",page).on("dragover",function(e){return e.preventDefault(),e.originalEvent.dataTransfer.dropEffect="Copy",!1}).on("drop",function(e){return e.preventDefault(),setFiles(page,e.originalEvent.dataTransfer.files),!1})}function showEditor(itemId,options){options=options||{};var xhr=new XMLHttpRequest;xhr.open("GET","components/imageuploader/imageuploader.template.html",!0),xhr.onload=function(e){var template=this.response;currentItemId=itemId;var dlg=dialogHelper.createDialog({size:"fullscreen-border"}),theme=options.theme||"b";dlg.classList.add("ui-body-"+theme),dlg.classList.add("background-theme-"+theme);var html="";html+='<h2 class="dialogHeader">',html+='<button type="button" is="emby-button" icon="arrow-back" class="fab mini btnCloseDialog autoSize" tabindex="-1"><i class="md-icon">&#xE5C4;</i></button>',html+='<div style="display:inline-block;margin-left:.6em;vertical-align:middle;">'+Globalize.translate("HeaderUploadImage")+"</div>",html+="</h2>",html+='<div class="editorContent" style="padding:0 1em;">',html+=Globalize.translateDocument(template),html+="</div>",dlg.innerHTML=html,$(dlg).on("close",onDialogClosed),dialogHelper.open(dlg);var editorContent=dlg.querySelector(".editorContent");initEditor(editorContent),$("#selectImageType",dlg).val(options.imageType||"Primary"),$(".btnCloseDialog",dlg).on("click",function(){dialogHelper.close(dlg)})},xhr.send()}function onDialogClosed(){$(this).remove(),Dashboard.hideLoadingMsg(),currentDeferred.resolveWith(null,[hasChanges])}var currentItemId,currentFile,currentDeferred,hasChanges=!1;return{show:function(itemId,options){var deferred=jQuery.Deferred();return currentDeferred=deferred,hasChanges=!1,showEditor(itemId,options),deferred.promise()}}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,45 +1 @@
.touch-menu-la {
position: fixed;
top: 0;
bottom: 0;
background-color: #FFF;
will-change: transform;
contain: layout style;
display: flex;
transition: transform ease-out 60ms, left ease-out 260ms;
z-index: 1099;
}
.touch-menu-la.open {
box-shadow: 2px 0 12px rgba(0, 0, 0, 0.4);
}
.touch-menu-la.transition {
/*transition: transform 0.3s ease-out;*/
transition: transform ease-out 260ms, left ease-out 260ms;
/*transition: -webkit-transform ease-in-out 0.3s, width ease-in-out 0.3s, visibility 0.3s;
transition: transform ease-in-out 0.3s, width ease-in-out 0.3s, visibility 0.3s;*/
}
.scrollContainer {
flex-grow: 1;
}
.tmla-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #000;
opacity: 0.0;
z-index: 1098;
transition: opacity ease-in-out 0.38s, visibility ease-in-out 0.38s;
background-color: rgba(0, 0, 0, 0.3);
visibility: hidden;
}
.tmla-mask.backdrop {
visibility: visible;
opacity: 1;
}
.tmla-mask,.touch-menu-la{position:fixed;top:0;bottom:0}.touch-menu-la{background-color:#FFF;will-change:transform;contain:layout style;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-transition:-webkit-transform ease-out 60ms,left ease-out 260ms;-o-transition:transform ease-out 60ms,left ease-out 260ms;transition:transform ease-out 60ms,left ease-out 260ms;z-index:1099}.touch-menu-la.open{-webkit-box-shadow:2px 0 12px rgba(0,0,0,.4);box-shadow:2px 0 12px rgba(0,0,0,.4)}.touch-menu-la.transition{-webkit-transition:-webkit-transform ease-out 260ms,left ease-out 260ms;-o-transition:transform ease-out 260ms,left ease-out 260ms;transition:transform ease-out 260ms,left ease-out 260ms}.scrollContainer{-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1}.tmla-mask{left:0;right:0;background-color:#000;opacity:0;z-index:1098;-webkit-transition:opacity ease-in-out .38s,visibility ease-in-out .38s;-o-transition:opacity ease-in-out .38s,visibility ease-in-out .38s;transition:opacity ease-in-out .38s,visibility ease-in-out .38s;background-color:rgba(0,0,0,.3);visibility:hidden}.tmla-mask.backdrop{visibility:visible;opacity:1}

View File

@ -1,305 +1 @@
define(['browser', 'css!./navdrawer', 'scrollStyles'], function (browser) {
'use strict';
return function (options) {
var self,
defaults,
mask,
maskHammer,
menuHammer,
newPos = 0,
currentPos = 0,
startPoint = 0,
countStart = 0,
velocity = 0.0;
options.target.classList.add('transition');
var draggingX;
var draggingY;
var scrollContainer = options.target.querySelector('.scrollContainer');
scrollContainer.classList.add('smoothScrollY');
var TouchMenuLA = function () {
self = this;
defaults = {
width: 260,
handleSize: 30,
disableMask: false,
maxMaskOpacity: 0.5
};
this.isVisible = false;
this.initialize();
};
TouchMenuLA.prototype.initElements = function (Hammer) {
options.target.classList.add('touch-menu-la');
options.target.style.width = options.width + 'px';
options.target.style.left = -options.width + 'px';
if (!options.disableMask) {
mask = document.createElement('div');
mask.className = 'tmla-mask';
document.body.appendChild(mask);
if (Hammer) {
maskHammer = new Hammer(mask, null);
}
}
};
function onPanStart(ev) {
options.target.classList.remove('transition');
options.target.classList.add('open');
velocity = Math.abs(ev.velocity);
}
function onPanMove(ev) {
velocity = Math.abs(ev.velocity);
// Depending on the deltas, choose X or Y
var isOpen = self.visible;
// If it's already open, then treat any right-swipe as vertical pan
if (isOpen && !draggingX && ev.deltaX > 0) {
draggingY = true;
}
if (!draggingX && !draggingY && (!isOpen || Math.abs(ev.deltaX) >= 10)) {
draggingX = true;
scrollContainer.addEventListener('scroll', disableEvent);
self.showMask();
} else if (!draggingY) {
draggingY = true;
}
if (draggingX) {
newPos = currentPos + ev.deltaX;
self.changeMenuPos();
}
}
function onPanEnd(ev) {
options.target.classList.add('transition');
scrollContainer.removeEventListener('scroll', disableEvent);
draggingX = false;
draggingY = false;
currentPos = ev.deltaX;
self.checkMenuState(ev.deltaX, ev.deltaY);
}
function initEdgeSwipe(Hammer) {
if (options.disableEdgeSwipe) {
return;
}
return;
require(['hammer-main'], initEdgeSwipeInternal);
}
function initEdgeSwipeInternal(edgeHammer) {
var isPeeking = false;
edgeHammer.on('panstart panmove', function (ev) {
if (isPeeking) {
onPanMove(ev);
} else {
var srcEvent = ev.srcEvent;
var clientX = srcEvent.clientX;
if (!clientX) {
var touches = srcEvent.touches;
if (touches && touches.length) {
clientX = touches[0].clientX;
}
}
if (clientX <= options.handleSize) {
isPeeking = true;
onPanStart(ev);
}
}
});
edgeHammer.on('panend pancancel', function (ev) {
if (isPeeking) {
isPeeking = false;
onPanEnd(ev);
}
});
self.edgeHammer = edgeHammer;
}
function disableEvent(e) {
e.preventDefault();
e.stopPropagation();
}
TouchMenuLA.prototype.touchStartMenu = function () {
menuHammer.on('panstart', function (ev) {
onPanStart(ev);
});
menuHammer.on('panmove', function (ev) {
onPanMove(ev);
});
};
TouchMenuLA.prototype.animateToPosition = function (pos) {
requestAnimationFrame(function () {
if (pos) {
options.target.style.transform = 'translate3d(' + pos + 'px, 0, 0)';
} else {
options.target.style.transform = 'none';
}
});
};
TouchMenuLA.prototype.changeMenuPos = function () {
if (newPos <= options.width) {
this.animateToPosition(newPos);
}
};
TouchMenuLA.prototype.touchEndMenu = function () {
menuHammer.on('panend pancancel', onPanEnd);
};
TouchMenuLA.prototype.clickMaskClose = function () {
mask.addEventListener('click', function () {
self.close();
});
};
TouchMenuLA.prototype.checkMenuState = function (deltaX, deltaY) {
if (velocity >= 1.0) {
if (deltaX >= -80 || Math.abs(deltaY) >= 70) {
self.open();
} else {
self.close();
}
} else {
if (newPos >= 100) {
self.open();
} else {
self.close();
}
}
};
TouchMenuLA.prototype.open = function () {
this.animateToPosition(options.width);
currentPos = options.width;
this.isVisible = true;
options.target.classList.add('open');
self.showMask();
self.invoke(options.onChange);
};
TouchMenuLA.prototype.close = function () {
this.animateToPosition(0);
currentPos = 0;
self.isVisible = false;
options.target.classList.remove('open');
self.hideMask();
self.invoke(options.onChange);
};
TouchMenuLA.prototype.toggle = function () {
if (self.isVisible) {
self.close();
} else {
self.open();
}
};
TouchMenuLA.prototype.eventStartMask = function () {
maskHammer.on('panstart panmove', function (ev) {
if (ev.center.x <= options.width && self.isVisible) {
countStart++;
if (countStart == 1) {
startPoint = ev.deltaX;
}
if (ev.deltaX < 0) {
draggingX = true;
newPos = (ev.deltaX - startPoint) + options.width;
self.changeMenuPos();
velocity = Math.abs(ev.velocity);
}
}
});
};
TouchMenuLA.prototype.eventEndMask = function () {
maskHammer.on('panend pancancel', function (ev) {
self.checkMenuState(ev.deltaX);
countStart = 0;
});
};
TouchMenuLA.prototype.showMask = function () {
mask.classList.add('backdrop');
};
TouchMenuLA.prototype.hideMask = function () {
mask.classList.remove('backdrop');
};
TouchMenuLA.prototype.invoke = function (fn) {
if (fn) {
fn.apply(self);
}
};
function initWithHammer(Hammer) {
if (Hammer) {
menuHammer = Hammer(options.target, null);
}
self.initElements(Hammer);
if (Hammer) {
self.touchStartMenu();
self.touchEndMenu();
self.eventStartMask();
self.eventEndMask();
initEdgeSwipe(Hammer);
}
if (!options.disableMask) {
self.clickMaskClose();
}
}
TouchMenuLA.prototype.initialize = function () {
options = Object.assign(defaults, options || {});
// Not ready yet
if (browser.edge) {
options.disableEdgeSwipe = true;
}
if (browser.touch) {
require(['hammer'], initWithHammer);
} else {
initWithHammer();
}
};
return new TouchMenuLA();
};
});
define(["browser","css!./navdrawer","scrollStyles"],function(browser){"use strict";return function(options){function onPanStart(ev){options.target.classList.remove("transition"),options.target.classList.add("open"),velocity=Math.abs(ev.velocity)}function onPanMove(ev){velocity=Math.abs(ev.velocity);var isOpen=self.visible;isOpen&&!draggingX&&ev.deltaX>0&&(draggingY=!0),draggingX||draggingY||isOpen&&!(Math.abs(ev.deltaX)>=10)?draggingY||(draggingY=!0):(draggingX=!0,scrollContainer.addEventListener("scroll",disableEvent),self.showMask()),draggingX&&(newPos=currentPos+ev.deltaX,self.changeMenuPos())}function onPanEnd(ev){options.target.classList.add("transition"),scrollContainer.removeEventListener("scroll",disableEvent),draggingX=!1,draggingY=!1,currentPos=ev.deltaX,self.checkMenuState(ev.deltaX,ev.deltaY)}function initEdgeSwipe(Hammer){options.disableEdgeSwipe}function disableEvent(e){e.preventDefault(),e.stopPropagation()}function initWithHammer(Hammer){Hammer&&(menuHammer=Hammer(options.target,null)),self.initElements(Hammer),Hammer&&(self.touchStartMenu(),self.touchEndMenu(),self.eventStartMask(),self.eventEndMask(),initEdgeSwipe(Hammer)),options.disableMask||self.clickMaskClose()}var self,defaults,mask,maskHammer,menuHammer,newPos=0,currentPos=0,startPoint=0,countStart=0,velocity=0;options.target.classList.add("transition");var draggingX,draggingY,scrollContainer=options.target.querySelector(".scrollContainer");scrollContainer.classList.add("smoothScrollY");var TouchMenuLA=function(){self=this,defaults={width:260,handleSize:30,disableMask:!1,maxMaskOpacity:.5},this.isVisible=!1,this.initialize()};return TouchMenuLA.prototype.initElements=function(Hammer){options.target.classList.add("touch-menu-la"),options.target.style.width=options.width+"px",options.target.style.left=-options.width+"px",options.disableMask||(mask=document.createElement("div"),mask.className="tmla-mask",document.body.appendChild(mask),Hammer&&(maskHammer=new Hammer(mask,null)))},TouchMenuLA.prototype.touchStartMenu=function(){menuHammer.on("panstart",function(ev){onPanStart(ev)}),menuHammer.on("panmove",function(ev){onPanMove(ev)})},TouchMenuLA.prototype.animateToPosition=function(pos){requestAnimationFrame(function(){pos?options.target.style.transform="translate3d("+pos+"px, 0, 0)":options.target.style.transform="none"})},TouchMenuLA.prototype.changeMenuPos=function(){newPos<=options.width&&this.animateToPosition(newPos)},TouchMenuLA.prototype.touchEndMenu=function(){menuHammer.on("panend pancancel",onPanEnd)},TouchMenuLA.prototype.clickMaskClose=function(){mask.addEventListener("click",function(){self.close()})},TouchMenuLA.prototype.checkMenuState=function(deltaX,deltaY){velocity>=1?deltaX>=-80||Math.abs(deltaY)>=70?self.open():self.close():newPos>=100?self.open():self.close()},TouchMenuLA.prototype.open=function(){this.animateToPosition(options.width),currentPos=options.width,this.isVisible=!0,options.target.classList.add("open"),self.showMask(),self.invoke(options.onChange)},TouchMenuLA.prototype.close=function(){this.animateToPosition(0),currentPos=0,self.isVisible=!1,options.target.classList.remove("open"),self.hideMask(),self.invoke(options.onChange)},TouchMenuLA.prototype.toggle=function(){self.isVisible?self.close():self.open()},TouchMenuLA.prototype.eventStartMask=function(){maskHammer.on("panstart panmove",function(ev){ev.center.x<=options.width&&self.isVisible&&(countStart++,1==countStart&&(startPoint=ev.deltaX),ev.deltaX<0&&(draggingX=!0,newPos=ev.deltaX-startPoint+options.width,self.changeMenuPos(),velocity=Math.abs(ev.velocity)))})},TouchMenuLA.prototype.eventEndMask=function(){maskHammer.on("panend pancancel",function(ev){self.checkMenuState(ev.deltaX),countStart=0})},TouchMenuLA.prototype.showMask=function(){mask.classList.add("backdrop")},TouchMenuLA.prototype.hideMask=function(){mask.classList.remove("backdrop")},TouchMenuLA.prototype.invoke=function(fn){fn&&fn.apply(self)},TouchMenuLA.prototype.initialize=function(){options=Object.assign(defaults,options||{}),browser.edge&&(options.disableEdgeSwipe=!0),browser.touch?require(["hammer"],initWithHammer):initWithHammer()},new TouchMenuLA}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,72 +1 @@
.autoorganizetable > .table {
width: 100%;
}
.autoorganizetable th {
padding: 0.4em;
}
.autoorganizetable > .table > tbody > tr > td {
padding: 0.4em;
}
.autoorganizetable .fileCell {
word-wrap: break-word;
word-break: break-all;
}
.autoorganizetable > .table > thead > th {
text-align: left;
}
.autoorganizetable tbody tr:nth-child(odd) td,
.autoorganizetable tbody tr:nth-child(odd) th {
background-color: #eeeeee; /* non-RGBA fallback */
background-color: rgba(0,0,0,.04);
}
@media screen and (max-width: 800px) {
.autoorganizetable > .table {
margin-bottom: 0;
background-color: transparent;
}
.autoorganizetable .spinnerCell {
display: none !important;
}
.autoorganizetable > .table > thead,
.autoorganizetable > .table > tfoot {
display: none;
}
.autoorganizetable > .table > tbody {
display: block;
}
.autoorganizetable > .table > tbody > tr {
display: block;
border: 1px solid #e0e0e0;
border-radius: 2px;
margin-bottom: 1.6rem;
}
.autoorganizetable > .table > tbody > tr > td {
background-color: #eeeeee; /* non-RGBA fallback */
background-color: rgba(0,0,0,.04);
display: block;
vertical-align: middle;
text-align: left;
text-overflow: ellipsis;
padding: 0.4em;
}
.autoorganizetable > .table > tbody > tr > td[data-title]:before {
content: attr(data-title);
float: left;
font-size: inherit;
font-weight: bold;
min-width: 20%;
}
}
.autoorganizetable>.table{width:100%}.autoorganizetable th,.autoorganizetable>.table>tbody>tr>td{padding:.4em}.autoorganizetable .fileCell{word-wrap:break-word;word-break:break-all}.autoorganizetable>.table>thead>th{text-align:left}.autoorganizetable tbody tr:nth-child(odd) td,.autoorganizetable tbody tr:nth-child(odd) th{background-color:#eee;background-color:rgba(0,0,0,.04)}@media screen and (max-width:800px){.autoorganizetable>.table{margin-bottom:0;background-color:transparent}.autoorganizetable .spinnerCell{display:none!important}.autoorganizetable>.table>tfoot,.autoorganizetable>.table>thead{display:none}.autoorganizetable>.table>tbody{display:block}.autoorganizetable>.table>tbody>tr{display:block;border:1px solid #e0e0e0;-webkit-border-radius:2px;border-radius:2px;margin-bottom:1.6rem}.autoorganizetable>.table>tbody>tr>td{background-color:#eee;background-color:rgba(0,0,0,.04);display:block;vertical-align:middle;text-align:left;-o-text-overflow:ellipsis;text-overflow:ellipsis;padding:.4em}.autoorganizetable>.table>tbody>tr>td[data-title]:before{content:attr(data-title);float:left;font-size:inherit;font-weight:700;min-width:20%}}

View File

@ -1,17 +1 @@
.btnActiveCast {
color: #52B54B !important;
}
.headerSelectedPlayer {
font-weight: normal;
max-width: 160px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
@media all and (max-width: 600px) {
.headerSelectedPlayer {
display: none;
}
}
.btnActiveCast{color:#52B54B!important}.headerSelectedPlayer{font-weight:400;max-width:160px;-o-text-overflow:ellipsis;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}@media all and (max-width:600px){.headerSelectedPlayer{display:none}}

File diff suppressed because one or more lines are too long

View File

@ -1,87 +1 @@
.detailTableContainer {
width: 100%;
text-align: center;
}
.detailTable {
border-collapse: collapse;
border-spacing: 0;
text-align: left;
width: 100%;
margin: 0 auto;
}
.stretchedDetailTable {
width: 100%;
}
.detailTable a {
text-decoration: none;
}
.detailTable a:hover {
text-decoration: underline;
}
.detailTable td {
border-spacing: 0;
padding: 5px 5px;
}
.detailTable th {
border-spacing: 0;
padding: 5px;
font-weight: bold;
text-align: left;
vertical-align: top;
}
.userDataCell {
width: 130px;
text-align: right;
}
.tabletColumn, .desktopColumn {
display: none;
}
.detailTable .btnPlay {
margin: 0;
}
.detailTableButtonsCell {
white-space: nowrap;
}
.detailTableButtonsCell button {
margin-top: 0;
margin-bottom: 0;
}
.detailTableButtonsCell button + button {
margin-left: .5em;
}
@media all and (min-width: 600px) {
.tabletColumn {
display: table-cell;
}
}
@media all and (min-width: 1100px) {
.desktopColumn {
display: table-cell;
}
}
.detailTable tbody tr:nth-child(odd) td,
.detailTable tbody tr:nth-child(odd) th {
background-color: #eeeeee; /* non-RGBA fallback */
background-color: rgba(0,0,0,.1);
}
.stripedTable tbody tr:nth-child(odd) td,
.stripedTable tbody tr:nth-child(odd) th {
background-color: #eeeeee; /* non-RGBA fallback */
background-color: rgba(0,0,0,.04);
}
.detailTableContainer{width:100%;text-align:center}.detailTable,.detailTable th{border-spacing:0;text-align:left}.detailTable{border-collapse:collapse;width:100%;margin:0 auto}.stretchedDetailTable{width:100%}.detailTable a{text-decoration:none}.detailTable a:hover{text-decoration:underline}.detailTable td{border-spacing:0;padding:5px}.detailTable th{padding:5px;font-weight:700;vertical-align:top}.userDataCell{width:130px;text-align:right}.desktopColumn,.tabletColumn{display:none}.detailTable .btnPlay{margin:0}.detailTableButtonsCell{white-space:nowrap}.detailTableButtonsCell button{margin-top:0;margin-bottom:0}.detailTableButtonsCell button+button{margin-left:.5em}@media all and (min-width:600px){.tabletColumn{display:table-cell}}@media all and (min-width:1100px){.desktopColumn{display:table-cell}}.detailTable tbody tr:nth-child(odd) td,.detailTable tbody tr:nth-child(odd) th{background-color:#eee;background-color:rgba(0,0,0,.1)}.stripedTable tbody tr:nth-child(odd) td,.stripedTable tbody tr:nth-child(odd) th{background-color:#eee;background-color:rgba(0,0,0,.04)}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1 @@
/* Allow vertical space for anything that slides up at the bottom */
.guideVerticalScroller {
padding-bottom: 160px;
}
.tvGuideHeader.headroom--unpinned {
-webkit-transform: none;
transform: none;
}
.guideVerticalScroller{padding-bottom:160px}.tvGuideHeader.headroom--unpinned{-webkit-transform:none;transform:none}

View File

@ -1,221 +1 @@
.editorTab {
padding-bottom: 200px;
}
.editPageContent {
padding: 0;
}
.editPageInnerContent {
padding: 0 15px 100px;
}
.editPageName {
margin: .5em 0 0;
}
.editPageSidebar {
display: none;
}
.libraryTree {
margin-left: .25em;
}
.offlineEditorNode {
color: #cc3333;
}
.editorNode img {
height: 18px;
margin: 0 .35em;
vertical-align: middle;
position: relative;
top: -2px;
}
.remoteImageContainer {
display: inline-block;
margin: 5px;
vertical-align: top;
}
.remoteImageDetails {
text-align: left;
background: #282828;
position: relative;
padding: 5px 5px 2px;
}
.remoteImageDetails paper-icon-button {
position: absolute;
bottom: 0;
right: 0;
}
.remoteImageDetailText {
padding: 5px 5px;
}
.remoteImageDetailText + .remoteImageDetailText {
color: #ccc;
}
.remoteImage {
background-position: center bottom;
background-repeat: no-repeat;
background-size: contain;
display: block;
/* For the box shadow so that the bottom border isnt underneath the text */
z-index: 100000;
position: relative;
}
.remotePosterImage {
width: 140px;
height: 210px;
}
.remoteBackdropImage {
width: 272px;
height: 153px;
}
.remoteBannerImage {
width: 272px;
height: 50px;
}
.remoteDiscImage {
width: 180px;
height: 180px;
}
@media all and (min-width: 600px) {
.remotePosterImage {
width: 160px;
height: 240px;
}
}
@media all and (min-width: 1200px) {
.remotePosterImage {
width: 200px;
height: 300px;
}
.remoteBackdropImage {
width: 320px;
height: 180px;
}
.remoteDiscImage {
width: 240px;
height: 240px;
}
.remoteBannerImage {
width: 544px;
height: 100px;
}
}
.editorfieldDescription {
color: #ccc;
}
.searchImage {
background-position: center bottom;
background-repeat: no-repeat;
background-size: contain;
display: block;
}
.searchBackdropImageContainer {
width: 160px;
}
.searchDiscImageContainer {
width: 150px;
}
.searchPosterImageContainer {
width: 140px;
}
.searchBackdropImageContainer .searchImage {
height: 90px;
}
.searchDiscImageContainer .searchImage {
height: 150px;
}
.searchPosterImageContainer .searchImage {
height: 210px;
}
.searchImageContainer .remoteImageDetails {
overflow-x: hidden;
text-overflow: ellipsis;
}
.jstree-anchor {
font-weight: normal !important;
}
.jstree-wholerow-hovered {
background: #38c !important;
border-radius: 0 !important;
box-shadow: none !important;
}
.jstree-default .jstree-hovered {
background: none !important;
border-radius: 0 !important;
box-shadow: none !important;
color: #fff !important;
}
.jstree-default .jstree-wholerow-clicked {
background: #52B54B !important;
}
@media all and (min-width: 600px) {
.remoteBannerImage {
width: 450px;
height: 83px;
}
}
@media all and (min-width: 800px) {
.editPageSidebar {
position: fixed;
top: 54px;
bottom: 0;
left: 0;
width: 30%;
display: block;
border-right: 1px solid #555;
}
.editPageInnerContent {
float: right;
width: 67.5%;
}
}
@media all and (min-width: 1800px) {
.editPageSidebar {
width: 25%;
}
.editPageInnerContent {
width: 72.5%;
}
}
.editorTab{padding-bottom:200px}.editPageContent{padding:0}.editPageInnerContent{padding:0 15px 100px}.editPageName{margin:.5em 0 0}.editPageSidebar{display:none}.libraryTree{margin-left:.25em}.offlineEditorNode{color:#c33}.editorfieldDescription,.remoteImageDetailText+.remoteImageDetailText{color:#ccc}.editorNode img{height:18px;margin:0 .35em;vertical-align:middle;position:relative;top:-2px}.remoteImageContainer{display:inline-block;margin:5px;vertical-align:top}.remoteImageDetails{text-align:left;background:#282828;position:relative;padding:5px 5px 2px}.remoteImage,.searchImage{background-position:center bottom;background-repeat:no-repeat;display:block}.remoteImageDetails paper-icon-button{position:absolute;bottom:0;right:0}.remoteImageDetailText{padding:5px}.remoteImage{-webkit-background-size:contain;background-size:contain;z-index:100000;position:relative}.remotePosterImage{width:140px;height:210px}.remoteBackdropImage{width:272px;height:153px}.remoteBannerImage{width:272px;height:50px}.remoteDiscImage{width:180px;height:180px}@media all and (min-width:600px){.remotePosterImage{width:160px;height:240px}}@media all and (min-width:1200px){.remotePosterImage{width:200px;height:300px}.remoteBackdropImage{width:320px;height:180px}.remoteDiscImage{width:240px;height:240px}.remoteBannerImage{width:544px;height:100px}}.searchImage{-webkit-background-size:contain;background-size:contain}.searchBackdropImageContainer{width:160px}.searchDiscImageContainer{width:150px}.searchPosterImageContainer{width:140px}.searchBackdropImageContainer .searchImage{height:90px}.searchDiscImageContainer .searchImage{height:150px}.searchPosterImageContainer .searchImage{height:210px}.searchImageContainer .remoteImageDetails{overflow-x:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis}.jstree-anchor{font-weight:400!important}.jstree-wholerow-hovered{background:#38c!important;-webkit-border-radius:0!important;border-radius:0!important;-webkit-box-shadow:none!important;box-shadow:none!important}.jstree-default .jstree-hovered{background:0 0!important;-webkit-border-radius:0!important;border-radius:0!important;-webkit-box-shadow:none!important;box-shadow:none!important;color:#fff!important}.jstree-default .jstree-wholerow-clicked{background:#52B54B!important}@media all and (min-width:600px){.remoteBannerImage{width:450px;height:83px}}@media all and (min-width:800px){.editPageSidebar{position:fixed;top:54px;bottom:0;left:0;width:30%;display:block;border-right:1px solid #555}.editPageInnerContent{float:right;width:67.5%}}@media all and (min-width:1800px){.editPageSidebar{width:25%}.editPageInnerContent{width:72.5%}}

View File

@ -1,35 +1 @@
.btnNotifications {
text-decoration: none !important;
outline: 0 !important;
vertical-align: middle;
width: auto;
margin: 0;
padding-top: 0;
padding-bottom: 0;
}
.btnNotificationsInner {
color: #fff;
font-weight: 500;
position: relative;
border-radius: 1000px;
background: #444;
line-height: 28px;
min-width: 30px;
display: inline-flex;
align-items: center;
justify-content: center;
text-align: center;
}
.levelNormal {
background-color: #43A047;
}
.levelWarning {
background-color: #FF7537;
}
.levelError {
background-color: #d14836;
}
.btnNotifications{text-decoration:none!important;outline:0!important;vertical-align:middle;width:auto;margin:0;padding-top:0;padding-bottom:0}.btnNotificationsInner{color:#fff;font-weight:500;position:relative;-webkit-border-radius:1000px;border-radius:1000px;background:#444;line-height:28px;min-width:30px;display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;text-align:center}.levelNormal{background-color:#43A047}.levelWarning{background-color:#FF7537}.levelError{background-color:#d14836}

View File

@ -1,172 +1 @@
/*.nowPlayingPage {
padding-top: 1em !important;
}*/
.remoteControlContent {
padding: 1em 0 0;
max-width: 96%;
}
.nowPlayingInfoContainer {
display: flex;
flex-direction: row;
}
.nowPlayingPageTitle {
margin: 0 0 .5em .5em;
}
.nowPlayingPositionSliderContainer {
margin: .7em 0 .7em 1em;
}
.nowPlayingInfoButtons {
display: flex;
align-items: center;
flex-wrap: wrap;
font-size: 130%;
}
.nowPlayingPageImageContainer {
width: 20%;
margin-right: .25em;
position: relative;
flex-shrink: 0;
}
@media all and (min-width: 800px) {
.nowPlayingPageImageContainer {
width: 16%;
}
}
.nowPlayingInfoControls {
flex-grow: 1;
display: flex;
flex-direction: column;
justify-content: center;
}
.nowPlayingPageImage {
/*position: absolute;*/
bottom: 0;
left: 0;
right: 0;
width: 100%;
-moz-box-shadow: 0 0 1.9vh #000;
-webkit-box-shadow: 0 0 1.9vh #000;
box-shadow: 0 0 1.9vh #000;
border: solid 1px #222;
user-drag: none;
user-select: none;
-moz-user-select: none;
-webkit-user-drag: none;
-webkit-user-select: none;
-ms-user-select: none;
}
@media all and (orientation: portrait) and (max-width: 800px) {
.remoteControlContent {
padding-top: 0;
}
.nowPlayingInfoContainer {
flex-direction: column !important;
align-items: center;
}
.nowPlayingPageTitle {
text-align: center;
margin: .5em 0 .75em 0;
}
.nowPlayingPositionSliderContainer {
margin: .7em 1em;
}
.nowPlayingInfoButtons {
justify-content: center;
}
.nowPlayingPageImageContainer {
width: auto;
margin-right: 0;
}
.nowPlayingInfoControls {
margin-top: 1em;
}
.nowPlayingPageImage {
width: auto;
height: 36vh;
}
}
.nowPlayingTime {
display: flex;
align-items: center;
margin: 0 1em;
}
.nowPlayingSecondaryButtons {
display: flex;
align-items: center;
}
@media all and (min-width: 800px) {
.nowPlayingSecondaryButtons {
flex-grow: 1;
justify-content: flex-end;
}
}
@media all and (min-width: 1280px) {
.nowPlayingPageImageContainer {
margin-right: .75em;
}
}
.nowPlayingNavButtonContainer {
width: 400px;
}
.nowPlayingPageRepeatActive {
color: #2ad !important;
}
.smallBackdropPosterItem .cardOverlayInner > div {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.playlistIndexIndicatorImage {
background-size: initial !important;
background-image: url(images/ani_equalizer_white.gif) !important;
}
.hideVideoButtons .videoButton {
display: none;
}
.nowPlayingCastIcon {
font-size: 86%;
}
.nowPlayingVolumeSliderContainer {
width: 6em;
}
@media all and (max-width: 400px) {
.playlist .listItemMediaInfo {
display: none !important;
}
}
.remoteControlContent{padding:1em 0 0;max-width:96%}.nowPlayingInfoContainer{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row}.nowPlayingPageTitle{margin:0 0 .5em .5em}.nowPlayingPositionSliderContainer{margin:.7em 0 .7em 1em}.nowPlayingInfoButtons{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-flex-wrap:wrap;flex-wrap:wrap;font-size:130%}.nowPlayingInfoControls,.nowPlayingTime{display:-webkit-box;display:-webkit-flex}.nowPlayingPageImageContainer{width:20%;margin-right:.25em;position:relative;-webkit-flex-shrink:0;flex-shrink:0}@media all and (min-width:800px){.nowPlayingPageImageContainer{width:16%}}.nowPlayingInfoControls{-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.nowPlayingPageImage{bottom:0;left:0;right:0;width:100%;-webkit-box-shadow:0 0 1.9vh #000;box-shadow:0 0 1.9vh #000;border:1px solid #222;user-drag:none;user-select:none;-moz-user-select:none;-webkit-user-drag:none;-webkit-user-select:none;-ms-user-select:none}@media all and (orientation:portrait) and (max-width:800px){.remoteControlContent{padding-top:0}.nowPlayingInfoContainer{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-webkit-flex-direction:column!important;flex-direction:column!important;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.nowPlayingPageTitle{text-align:center;margin:.5em 0 .75em}.nowPlayingPositionSliderContainer{margin:.7em 1em}.nowPlayingInfoButtons{-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.nowPlayingPageImageContainer{width:auto;margin-right:0}.nowPlayingInfoControls{margin-top:1em}.nowPlayingPageImage{width:auto;height:36vh}}.nowPlayingTime{display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;margin:0 1em}.nowPlayingSecondaryButtons{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}@media all and (min-width:800px){.nowPlayingSecondaryButtons{-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1;-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end}}@media all and (min-width:1280px){.nowPlayingPageImageContainer{margin-right:.75em}}.nowPlayingNavButtonContainer{width:400px}.nowPlayingPageRepeatActive{color:#2ad!important}.smallBackdropPosterItem .cardOverlayInner>div{white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis;overflow:hidden}.playlistIndexIndicatorImage{-webkit-background-size:initial initial!important;background-size:initial!important;background-image:url(images/ani_equalizer_white.gif)!important}.hideVideoButtons .videoButton{display:none}.nowPlayingCastIcon{font-size:86%}.nowPlayingVolumeSliderContainer{width:6em}@media all and (max-width:400px){.playlist .listItemMediaInfo{display:none!important}}

View File

@ -1,264 +1 @@
.nowPlayingText {
display: inline-block;
position: relative;
top: -7px;
margin: 0 0 0 3px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
vertical-align: middle;
text-align: left;
max-width: 130px;
}
.mediaButton.active {
color: #52B54B;
}
@media (min-width: 500px) {
.nowPlayingText {
max-width: 180px;
}
}
@media (min-width: 600px) {
.nowPlayingText {
max-width: 200px;
}
}
@media (min-width: 800px) {
.nowPlayingText {
margin-right: 30px;
}
}
.nowPlayingBarInfoContainer {
display: flex;
align-items: center;
}
.currentTime {
display: inline-block;
vertical-align: middle;
max-width: 110px;
margin-right: 2em;
font-weight: normal;
}
/* Now playing bar */
.nowPlayingBar {
/* Above everything, except for the video player and popup overlays */
color: #fff;
text-align: center;
/*box-shadow: 0 -2px 2px 0 rgba(0,0,0,.14),-1px 5px 1px rgba(0,0,0,.12);*/
will-change: transform;
contain: layout style;
font-size: 90%;
transition: transform 200ms ease-out;
}
.nowPlayingBar-hidden {
transform: translate3d(0,100%,0);
}
.hiddenNowPlayingBar .nowPlayingBar {
display: none !important;
}
.nowPlayingBarTop {
display: flex;
flex-direction: row;
align-items: center;
}
.mediaButton, .nowPlayingBarUserDataButtons .btnUserItemRating {
vertical-align: middle;
color: #e8e8e8;
margin: 0;
text-align: center;
}
.mediaButton i {
height: 1em;
width: 1em;
font-size: 36px;
}
.mediaButton.muteButton i, .mediaButton.unmuteButton i, .mediaButton.castButton i, .mediaButton.infoButton i {
font-size: 24px;
}
.nowPlayingImage {
display: inline-block;
vertical-align: middle;
margin-right: 1em;
}
.nowPlayingImage img {
vertical-align: bottom;
}
.nowPlayingImage img {
height: 64px;
}
.nowPlayingBar .nowPlayingImage {
width: 64px;
height: 64px;
background-position: center center;
background-repeat: no-repeat;
background-size: contain;
}
.nowPlayingBarText {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
vertical-align: middle;
text-align: left;
max-width: 130px;
flex-grow: 1;
}
.repeatActive {
color: #52B54B;
}
@media (min-width: 500px) {
.nowPlayingBarText {
max-width: 180px;
}
}
@media (min-width: 600px) {
.nowPlayingBarText {
max-width: 200px;
}
}
@media (min-width: 700px) {
.nowPlayingBarText {
max-width: 240px;
}
}
@media (min-width: 800px) {
.nowPlayingBarText {
max-width: 300px;
margin-right: 30px;
}
}
@media (min-width: 900px) {
.nowPlayingBarText {
max-width: 400px;
}
}
.nowPlayingBarCenter {
vertical-align: middle;
text-align: center;
margin-top: 6px;
/* Need this to make sure it's on top of nowPlayingBarPositionContainer so that buttons are fully clickable */
z-index: 2;
position: absolute;
left: 200px;
right: 200px;
top: 0;
}
.nowPlayingBarPositionContainer {
position: absolute !important;
left: 64px;
top: -8px;
right: 0;
z-index: 1;
}
.nowPlayingBarPositionContainer .mdl-slider__background-upper {
background: #333;
}
.headroom--unpinned .nowPlayingBarPositionContainer {
display: none;
}
.noMediaProgress .nowPlayingBarPositionContainer {
display: none;
}
.nowPlayingBarRight {
position: relative;
margin: 0 1em 0 auto;
/* Need this to make sure it's on top of nowPlayingBarPositionContainer so that buttons are fully clickable */
z-index: 2;
display: flex;
align-items: center;
}
.nowPlayingBarCurrentTime {
vertical-align: middle;
font-weight: normal;
text-align: center;
display: inline-block;
margin: 0 auto;
padding-left: 50px;
}
.nowPlayingBarVolumeSliderContainer {
margin-right: 2em;
}
.nowPlayingBarUserDataButtons {
display: inline-block;
margin-left: 2em;
margin-right: 2em;
}
@media all and (max-width: 1400px) {
.nowPlayingBarUserDataButtons {
display: none;
}
}
@media all and (max-width: 1100px) {
.nowPlayingBarVolumeSliderContainer, .nowPlayingBar .muteButton, .nowPlayingBar .unmuteButton {
display: none !important;
}
}
@media all and (max-width: 800px) {
.nowPlayingBarCurrentTime {
padding-left: 0;
top: 22px;
right: 140px;
position: absolute;
}
.nowPlayingBarCenter > *:not(.nowPlayingBarCurrentTime) {
display: none !important;
}
.toggleRepeatButton {
display: none;
}
}
@media all and (min-width: 800px) {
.nowPlayingBarRight .playPauseButton {
display: none;
}
}
@media all and (max-width: 600px) {
.nowPlayingBarCurrentTime {
display: none;
}
}
.nowPlayingBarText,.nowPlayingText{overflow:hidden;white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis}.nowPlayingText{display:inline-block;position:relative;top:-7px;margin:0 0 0 3px;vertical-align:middle;text-align:left;max-width:130px}.mediaButton.active{color:#52B54B}@media (min-width:500px){.nowPlayingText{max-width:180px}}@media (min-width:600px){.nowPlayingText{max-width:200px}}@media (min-width:800px){.nowPlayingText{margin-right:30px}}.nowPlayingBarInfoContainer{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.currentTime{display:inline-block;vertical-align:middle;max-width:110px;margin-right:2em;font-weight:400}.nowPlayingBar{color:#fff;text-align:center;will-change:transform;contain:layout style;font-size:90%;-webkit-transition:-webkit-transform .2s ease-out;-o-transition:transform .2s ease-out;transition:transform .2s ease-out}.nowPlayingBar-hidden{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.hiddenNowPlayingBar .nowPlayingBar{display:none!important}.nowPlayingBarTop{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.mediaButton,.nowPlayingBarUserDataButtons .btnUserItemRating{vertical-align:middle;color:#e8e8e8;margin:0;text-align:center}.mediaButton i{height:1em;width:1em;font-size:36px}.mediaButton.castButton i,.mediaButton.infoButton i,.mediaButton.muteButton i,.mediaButton.unmuteButton i{font-size:24px}.nowPlayingImage{display:inline-block;vertical-align:middle;margin-right:1em}.nowPlayingImage img{vertical-align:bottom;height:64px}.nowPlayingBar .nowPlayingImage{width:64px;height:64px;background-position:center center;background-repeat:no-repeat;-webkit-background-size:contain;background-size:contain}.nowPlayingBarText{vertical-align:middle;text-align:left;max-width:130px;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1}.repeatActive{color:#52B54B}@media (min-width:500px){.nowPlayingBarText{max-width:180px}}@media (min-width:600px){.nowPlayingBarText{max-width:200px}}@media (min-width:700px){.nowPlayingBarText{max-width:240px}}@media (min-width:800px){.nowPlayingBarText{max-width:300px;margin-right:30px}}@media (min-width:900px){.nowPlayingBarText{max-width:400px}}.nowPlayingBarCenter{vertical-align:middle;text-align:center;margin-top:6px;z-index:2;position:absolute;left:200px;right:200px;top:0}.nowPlayingBarPositionContainer{position:absolute!important;left:64px;top:-8px;right:0;z-index:1}.nowPlayingBarPositionContainer .mdl-slider__background-upper{background:#333}.headroom--unpinned .nowPlayingBarPositionContainer,.noMediaProgress .nowPlayingBarPositionContainer{display:none}.nowPlayingBarRight{position:relative;margin:0 1em 0 auto;z-index:2;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.nowPlayingBarCurrentTime{vertical-align:middle;font-weight:400;text-align:center;display:inline-block;margin:0 auto;padding-left:50px}.nowPlayingBarVolumeSliderContainer{margin-right:2em}.nowPlayingBarUserDataButtons{display:inline-block;margin-left:2em;margin-right:2em}@media all and (max-width:1400px){.nowPlayingBarUserDataButtons{display:none}}@media all and (max-width:1100px){.nowPlayingBar .muteButton,.nowPlayingBar .unmuteButton,.nowPlayingBarVolumeSliderContainer{display:none!important}}@media all and (max-width:800px){.nowPlayingBarCurrentTime{padding-left:0;top:22px;right:140px;position:absolute}.nowPlayingBarCenter>:not(.nowPlayingBarCurrentTime){display:none!important}.toggleRepeatButton{display:none}}@media all and (min-width:800px){.nowPlayingBarRight .playPauseButton{display:none}}@media all and (max-width:600px){.nowPlayingBarCurrentTime{display:none}}

View File

@ -1,344 +1 @@
.backgroundContainer {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
contain: layout style;
}
/* Links */
.ui-body-b a {
color: #52B54B /*{b-link-color}*/;
font-weight: 500;
}
.ui-body-b a:visited {
color: #52B54B /*{b-link-visited}*/;
}
.ui-body-b a:hover {
color: #2E7D32 /*{b-link-hover}*/;
}
.ui-body-b a:active {
color: #2E7D32 /*{b-link-active}*/;
}
/* Remove IE mobile 300ms tap delay */
html {
-ms-touch-action: manipulation;
touch-action: manipulation;
/* Prevent white flickering */
background-color: #242424;
/* Normalize for different browsers */
margin: 0;
padding: 0;
height: 100%;
font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", 'Open Sans', sans-serif;
font-size: 88%;
}
h1 {
font-family: -apple-system-headline, BlinkMacSystemFont, "Roboto", "Segoe UI", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", 'Open Sans', sans-serif;
}
h2 {
font-family: -apple-system-subheadline, BlinkMacSystemFont, "Roboto", "Segoe UI", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", 'Open Sans', sans-serif;
}
body {
overflow-y: scroll !important;
/* This is needed to prevent a horizontal scrollbar while neon-animated-pages are animating. */
overflow-x: hidden;
/*Can't use this with safari or it causes some content to disappear*/
/*-webkit-overflow-scrolling: touch;*/
/* Remove the white default from jqm */
background-color: transparent !important;
/* Normalize for different browsers */
margin: 0;
padding: 0;
height: 100%;
-webkit-font-smoothing: antialiased;
}
body.autoScrollY {
overflow-y: auto !important;
}
.mainAnimatedPage {
/* Have to override because it breaks scrolling when dependant on window scroll */
contain: style !important;
}
/* Without this, no content will be displayed in mobile safari */
.pageContainer {
overflow-x: visible !important;
/* jqm often wants to assign a background color to this */
background-color: transparent !important;
}
.bodyWithPopupOpen {
overflow-y: hidden !important;
}
h1, h2, h3 {
margin-top: 1em;
}
h1 {
font-weight: normal !important;
opacity: .7;
font-size: 1.72em;
}
h2 {
font-weight: normal;
}
h3 {
font-weight: normal;
}
a, a:active, a:hover {
text-decoration: none;
}
.libraryPage h1 a {
color: #fff !important;
}
h1 a:hover {
text-decoration: underline;
}
.ui-body-b a.accent {
color: #52B54B !important;
}
.ui-body-a .paperList {
background-color: #fff;
}
.ui-body-a [is="emby-select"] {
border-color: #ccc !important;
}
.ui-body-a [is="emby-input"], .ui-body-a [is="emby-textarea"] {
background: none;
border-color: #ccc !important;
}
.ui-body-a .secondaryText {
color: #ccc;
}
.ui-body-b .secondaryText {
color: #aaa;
}
div[data-role='page'] {
outline: none;
}
/**
* Note: I have omitted any vendor-prefixes for clarity.
* Adding them is left as an exercise for the reader.
*/
.headroom {
transition: transform 180ms linear;
}
.headroom--pinned {
transform: none;
}
.headroom--unpinned:not(.headroomDisabled) {
transform: translateY(-100%);
}
.libraryViewNav.headroom--unpinned:not(.headroomDisabled) {
transform: translateY(-210%);
}
.hide {
display: none !important;
}
/*
Header
*/
.header {
padding: 20px 0 0 20px;
}
.imgLogoIcon {
height: 40px;
vertical-align: middle;
}
.imgLogoIcon + span {
margin-left: 10px;
}
@media all and (max-height: 800px) {
.header {
display: none !important;
}
}
.pageTitle {
margin-top: 0;
font-family: inherit;
}
.fieldDescription {
padding-left: 2px;
font-weight: normal;
white-space: normal !important;
}
.fieldDescription + .fieldDescription {
margin-top: 5px;
}
.background-theme-a .backgroundContainer {
background-color: #f6f6f6;
}
.dialog.background-theme-a {
background-color: #f0f0f0;
}
.ui-content {
border-width: 0;
overflow: visible;
overflow-x: hidden;
padding: 1em;
}
.page > .ui-content, .pageWithAbsoluteTabs .pageTabContent, .absolutePageTabContent .itemsContainer {
/* Need this so that the audio player doesn't cover content, but also for unveil lazy loading. */
padding-bottom: 160px;
}
@media all and (min-width: 800px) {
/*
Forms
*/
form, .readOnlyContent {
max-width: 700px;
}
.header {
padding-bottom: 15px;
}
}
@media all and (min-width: 900px) {
.page:not(.standalonePage) .header {
padding-top: 0;
}
}
.supporterPromotionContainer {
margin: 0 0 2em;
}
@media all and (min-width: 1280px) {
.supporterPromotionContainer {
position: fixed;
top: 120px;
right: 0;
}
}
.fullWidthContent .supporterPromotionContainer {
position: static !important;
}
@media all and (min-width: 800px) {
.supporterPromotionContainer {
display: flex;
flex-direction: row-reverse;
}
.supporterPromotion {
text-align: center;
padding: 0 2em;
}
.supporterPromotion button {
padding-left: 2em;
padding-right: 2em;
}
}
.syncActivityForTarget {
margin: 0 0 3em 0;
}
@media all and (min-width: 800px) {
.syncActivityForTarget {
max-width: 600px;
margin: 0 3em 3em 0;
display: inline-block;
vertical-align: top;
min-width: 400px;
}
}
.imageDropZone {
border: 2px dashed #bbb;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
padding: 25px;
text-align: center;
color: #bbb;
}
.ui-body-a .emby-collapsible-button {
border-color: #ddd;
}
.ui-body-a .collapseContent {
background-color: #fff;
}
.ui-body-a .inputLabelUnfocused, .ui-body-a .textareaLabel {
color: #555;
}
.ui-body-a .inputLabelFocused, .ui-body-a .textareaLabelFocused, .ui-body-a .selectLabelFocused {
color: green;
}
.ui-body-a .selectLabelUnfocused, .ui-body-a .paperListLabel, .ui-body-a .fieldDescription {
color: #555;
}
.ui-body-a .visualCardBox-cardScalable, .ui-body-a .visualCardBox-cardFooter {
background-color: #fff;
}
.ui-body-a .visualCardBox {
border: 0;
margin: 6px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.ui-body-a .cardFooter .cardText + .cardText {
opacity: .8;
}
.ui-body-a .listItem .secondary {
color: #737373;
}
.ui-body-b a,.ui-body-b a:visited{color:#52B54B}body,html{margin:0;padding:0;height:100%}.backgroundContainer{position:fixed;top:0;left:0;right:0;bottom:0;contain:layout style}.ui-body-b a{font-weight:500}.ui-body-b a:active,.ui-body-b a:hover{color:#2E7D32}html{touch-action:manipulation;background-color:#242424;font-family:-apple-system,BlinkMacSystemFont,Roboto,"Segoe UI",Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",'Open Sans',sans-serif;font-size:88%}.pageContainer,body{background-color:transparent!important}h1{font-family:-apple-system-headline,BlinkMacSystemFont,Roboto,"Segoe UI",Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",'Open Sans',sans-serif;font-weight:400!important;opacity:.7;font-size:1.72em}h2{font-family:-apple-system-subheadline,BlinkMacSystemFont,Roboto,"Segoe UI",Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",'Open Sans',sans-serif}body{overflow-y:scroll!important;overflow-x:hidden;-webkit-font-smoothing:antialiased}body.autoScrollY{overflow-y:auto!important}.mainAnimatedPage{contain:style!important}.pageContainer{overflow-x:visible!important}.bodyWithPopupOpen{overflow-y:hidden!important}h1,h2,h3{margin-top:1em}h2,h3{font-weight:400}a,a:active,a:hover{text-decoration:none}.libraryPage h1 a{color:#fff!important}h1 a:hover{text-decoration:underline}.ui-body-b a.accent{color:#52B54B!important}.ui-body-a .paperList{background-color:#fff}.ui-body-a [is=emby-select]{border-color:#ccc!important}.ui-body-a [is=emby-input],.ui-body-a [is=emby-textarea]{background:0 0;border-color:#ccc!important}.ui-body-a .secondaryText{color:#ccc}.ui-body-b .secondaryText{color:#aaa}div[data-role=page]{outline:0}.headroom{-webkit-transition:-webkit-transform 180ms linear;-o-transition:transform 180ms linear;transition:transform 180ms linear}.headroom--pinned{-webkit-transform:none;transform:none}.headroom--unpinned:not(.headroomDisabled){-webkit-transform:translateY(-100%);transform:translateY(-100%)}.libraryViewNav.headroom--unpinned:not(.headroomDisabled){-webkit-transform:translateY(-210%);transform:translateY(-210%)}.hide{display:none!important}.header{padding:20px 0 0 20px}.imgLogoIcon{height:40px;vertical-align:middle}.imgLogoIcon+span{margin-left:10px}@media all and (max-height:800px){.header{display:none!important}}.pageTitle{margin-top:0;font-family:inherit}.fieldDescription{padding-left:2px;font-weight:400;white-space:normal!important}.fieldDescription+.fieldDescription{margin-top:5px}.background-theme-a .backgroundContainer{background-color:#f6f6f6}.dialog.background-theme-a{background-color:#f0f0f0}.ui-body-a .collapseContent,.ui-body-a .visualCardBox-cardFooter,.ui-body-a .visualCardBox-cardScalable{background-color:#fff}.ui-content{border-width:0;overflow:visible;overflow-x:hidden;padding:1em}.absolutePageTabContent .itemsContainer,.page>.ui-content,.pageWithAbsoluteTabs .pageTabContent{padding-bottom:160px}@media all and (min-width:900px){.page:not(.standalonePage) .header{padding-top:0}}.supporterPromotionContainer{margin:0 0 2em}@media all and (min-width:1280px){.supporterPromotionContainer{position:fixed;top:120px;right:0}}.fullWidthContent .supporterPromotionContainer{position:static!important}.syncActivityForTarget{margin:0 0 3em}@media all and (min-width:800px){.readOnlyContent,form{max-width:700px}.header{padding-bottom:15px}.supporterPromotionContainer{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-webkit-flex-direction:row-reverse;flex-direction:row-reverse}.supporterPromotion{text-align:center;padding:0 2em}.supporterPromotion button{padding-left:2em;padding-right:2em}.syncActivityForTarget{max-width:600px;margin:0 3em 3em 0;display:inline-block;vertical-align:top;min-width:400px}}.imageDropZone{border:2px dashed #bbb;-webkit-border-radius:5px;border-radius:5px;padding:25px;text-align:center;color:#bbb}.ui-body-a .emby-collapsible-button{border-color:#ddd}.ui-body-a .inputLabelUnfocused,.ui-body-a .textareaLabel{color:#555}.ui-body-a .inputLabelFocused,.ui-body-a .selectLabelFocused,.ui-body-a .textareaLabelFocused{color:green}.ui-body-a .fieldDescription,.ui-body-a .paperListLabel,.ui-body-a .selectLabelUnfocused{color:#555}.ui-body-a .visualCardBox{border:0;margin:6px;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.1);box-shadow:0 2px 4px rgba(0,0,0,.1)}.ui-body-a .cardFooter .cardText+.cardText{opacity:.8}.ui-body-a .listItem .secondary{color:#737373}

View File

@ -1,15 +1 @@
define([], function () {
'use strict';
return function (view, params) {
var self = this;
view.addEventListener('viewbeforeshow', function (e) {
var elem = view.querySelector('#appVersionNumber');
elem.innerHTML = elem.innerHTML.replace('{0}', ConnectionManager.appVersion());
});
}
});
define([],function(){"use strict";return function(view,params){view.addEventListener("viewbeforeshow",function(e){var elem=view.querySelector("#appVersionNumber");elem.innerHTML=elem.innerHTML.replace("{0}",ConnectionManager.appVersion())})}});

File diff suppressed because one or more lines are too long

View File

@ -1,178 +1 @@
define(['listViewStyle'], function () {
'use strict';
var query = {
StartIndex: 0,
Limit: 100000
};
var currentResult;
function parentWithClass(elem, className) {
while (!elem.classList || !elem.classList.contains(className)) {
elem = elem.parentNode;
if (!elem) {
return null;
}
}
return elem;
}
function reloadList(page) {
Dashboard.showLoadingMsg();
ApiClient.getSmartMatchInfos(query).then(function (infos) {
currentResult = infos;
populateList(page, infos);
Dashboard.hideLoadingMsg();
}, function () {
Dashboard.hideLoadingMsg();
});
}
function populateList(page, result) {
var infos = result.Items;
if (infos.length > 0) {
infos = infos.sort(function (a, b) {
a = a.OrganizerType + " " + (a.DisplayName || a.ItemName);
b = b.OrganizerType + " " + (b.DisplayName || b.ItemName);
if (a == b) {
return 0;
}
if (a < b) {
return -1;
}
return 1;
});
}
var html = "";
if (infos.length) {
html += '<div class="paperList">';
}
for (var i = 0, length = infos.length; i < length; i++) {
var info = infos[i];
html += '<div class="listItem">';
html += '<div class="listItemIconContainer">';
html += '<i class="listItemIcon md-icon">folder</i>';
html += '</div>';
html += '<div class="listItemBody">';
html += "<h2 class='listItemBodyText'>" + (info.DisplayName || info.ItemName) + "</h2>";
html += '</div>';
html += '</div>';
var matchStringIndex = 0;
html += info.MatchStrings.map(function (m) {
var matchStringHtml = '';
matchStringHtml += '<div class="listItem">';
matchStringHtml += '<div class="listItemBody" style="padding: .1em 1em .4em 5.5em; min-height: 1.5em;">';
matchStringHtml += "<div class='listItemBodyText secondary'>" + m + "</div>";
matchStringHtml += '</div>';
matchStringHtml += '<button type="button" is="emby-button" class="btnDeleteMatchEntry" style="padding: 0;" data-index="' + i + '" data-matchindex="' + matchStringIndex + '" title="' + Globalize.translate('ButtonDelete') + '"><i class="md-icon">delete</i></button>';
matchStringHtml += '</div>';
matchStringIndex++;
return matchStringHtml;
}).join('');
}
if (infos.length) {
html += "</div>";
}
var matchInfos = page.querySelector('.divMatchInfos');
matchInfos.innerHTML = html;
}
function getTabs() {
return [
{
href: 'autoorganizelog.html',
name: Globalize.translate('TabActivityLog')
},
{
href: 'autoorganizetv.html',
name: Globalize.translate('TabTV')
},
{
href: 'autoorganizesmart.html',
name: Globalize.translate('TabSmartMatches')
}];
}
return function (view, params) {
var self = this;
var divInfos = view.querySelector('.divMatchInfos');
divInfos.addEventListener('click', function (e) {
var button = parentWithClass(e.target, 'btnDeleteMatchEntry');
if (button) {
var index = parseInt(button.getAttribute('data-index'));
var matchIndex = parseInt(button.getAttribute('data-matchindex'));
var info = currentResult.Items[index];
var entries = [
{
Name: info.ItemName,
Value: info.MatchStrings[matchIndex]
}];
ApiClient.deleteSmartMatchEntries(entries).then(function () {
reloadList(view);
}, Dashboard.processErrorResponse);
}
});
view.addEventListener('viewshow', function (e) {
LibraryMenu.setTabs('autoorganize', 2, getTabs);
Dashboard.showLoadingMsg();
reloadList(view);
});
view.addEventListener('viewhide', function (e) {
currentResult = null;
});
};
});
define(["listViewStyle"],function(){"use strict";function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function reloadList(page){Dashboard.showLoadingMsg(),ApiClient.getSmartMatchInfos(query).then(function(infos){currentResult=infos,populateList(page,infos),Dashboard.hideLoadingMsg()},function(){Dashboard.hideLoadingMsg()})}function populateList(page,result){var infos=result.Items;infos.length>0&&(infos=infos.sort(function(a,b){return a=a.OrganizerType+" "+(a.DisplayName||a.ItemName),b=b.OrganizerType+" "+(b.DisplayName||b.ItemName),a==b?0:a<b?-1:1}));var html="";infos.length&&(html+='<div class="paperList">');for(var i=0,length=infos.length;i<length;i++){var info=infos[i];html+='<div class="listItem">',html+='<div class="listItemIconContainer">',html+='<i class="listItemIcon md-icon">folder</i>',html+="</div>",html+='<div class="listItemBody">',html+="<h2 class='listItemBodyText'>"+(info.DisplayName||info.ItemName)+"</h2>",html+="</div>",html+="</div>";var matchStringIndex=0;html+=info.MatchStrings.map(function(m){var matchStringHtml="";return matchStringHtml+='<div class="listItem">',matchStringHtml+='<div class="listItemBody" style="padding: .1em 1em .4em 5.5em; min-height: 1.5em;">',matchStringHtml+="<div class='listItemBodyText secondary'>"+m+"</div>",matchStringHtml+="</div>",matchStringHtml+='<button type="button" is="emby-button" class="btnDeleteMatchEntry" style="padding: 0;" data-index="'+i+'" data-matchindex="'+matchStringIndex+'" title="'+Globalize.translate("ButtonDelete")+'"><i class="md-icon">delete</i></button>',matchStringHtml+="</div>",matchStringIndex++,matchStringHtml}).join("")}infos.length&&(html+="</div>");var matchInfos=page.querySelector(".divMatchInfos");matchInfos.innerHTML=html}function getTabs(){return[{href:"autoorganizelog.html",name:Globalize.translate("TabActivityLog")},{href:"autoorganizetv.html",name:Globalize.translate("TabTV")},{href:"autoorganizesmart.html",name:Globalize.translate("TabSmartMatches")}]}var currentResult,query={StartIndex:0,Limit:1e5};return function(view,params){var divInfos=view.querySelector(".divMatchInfos");divInfos.addEventListener("click",function(e){var button=parentWithClass(e.target,"btnDeleteMatchEntry");if(button){var index=parseInt(button.getAttribute("data-index")),matchIndex=parseInt(button.getAttribute("data-matchindex")),info=currentResult.Items[index],entries=[{Name:info.ItemName,Value:info.MatchStrings[matchIndex]}];ApiClient.deleteSmartMatchEntries(entries).then(function(){reloadList(view)},Dashboard.processErrorResponse)}}),view.addEventListener("viewshow",function(e){LibraryMenu.setTabs("autoorganize",2,getTabs),Dashboard.showLoadingMsg(),reloadList(view)}),view.addEventListener("viewhide",function(e){currentResult=null})}});

File diff suppressed because one or more lines are too long

View File

@ -1,144 +1 @@
define(['jQuery', 'fnchecked'], function ($) {
'use strict';
function loadPage(page, config) {
$('.chkMovies', page).checked(config.EnableIntrosForMovies);
$('.chkEpisodes', page).checked(config.EnableIntrosForEpisodes);
$('.chkMyMovieTrailers', page).checked(config.EnableIntrosFromMoviesInLibrary);
$('.chkUpcomingTheaterTrailers', page).checked(config.EnableIntrosFromUpcomingTrailers);
$('.chkUpcomingDvdTrailers', page).checked(config.EnableIntrosFromUpcomingDvdMovies);
$('.chkUpcomingStreamingTrailers', page).checked(config.EnableIntrosFromUpcomingStreamingMovies);
$('.chkOtherTrailers', page).checked(config.EnableIntrosFromSimilarMovies);
$('.chkUnwatchedOnly', page).checked(!config.EnableIntrosForWatchedContent);
$('.chkEnableParentalControl', page).checked(config.EnableIntrosParentalControl);
$('#txtCustomIntrosPath', page).val(config.CustomIntroPath || '');
$('#txtCodecIntrosPath', page).val(config.MediaInfoIntroPath || '');
$('#txtNumTrailers', page).val(config.TrailerLimit);
Dashboard.hideLoadingMsg();
}
function onSubmit() {
Dashboard.showLoadingMsg();
var form = this;
var page = $(form).parents('.page');
ApiClient.getNamedConfiguration("cinemamode").then(function (config) {
config.CustomIntroPath = $('#txtCustomIntrosPath', page).val();
config.MediaInfoIntroPath = $('#txtCodecIntrosPath', page).val();
config.TrailerLimit = $('#txtNumTrailers', page).val();
config.EnableIntrosForMovies = $('.chkMovies', page).checked();
config.EnableIntrosForEpisodes = $('.chkEpisodes', page).checked();
config.EnableIntrosFromMoviesInLibrary = $('.chkMyMovieTrailers', page).checked();
config.EnableIntrosForWatchedContent = !$('.chkUnwatchedOnly', page).checked();
config.EnableIntrosParentalControl = $('.chkEnableParentalControl', page).checked();
config.EnableIntrosFromUpcomingTrailers = $('.chkUpcomingTheaterTrailers', page).checked();
config.EnableIntrosFromUpcomingDvdMovies = $('.chkUpcomingDvdTrailers', page).checked();
config.EnableIntrosFromUpcomingStreamingMovies = $('.chkUpcomingStreamingTrailers', page).checked();
config.EnableIntrosFromSimilarMovies = $('.chkOtherTrailers', page).checked();
ApiClient.updateNamedConfiguration("cinemamode", config).then(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
return false;
}
function getTabs() {
return [
{
href: 'cinemamodeconfiguration.html',
name: Globalize.translate('TabCinemaMode')
},
{
href: 'playbackconfiguration.html',
name: Globalize.translate('TabResumeSettings')
},
{
href: 'streamingsettings.html',
name: Globalize.translate('TabStreaming')
}];
}
$(document).on('pageinit', "#cinemaModeConfigurationPage", function () {
var page = this;
$('#btnSelectCustomIntrosPath', page).on("click.selectDirectory", function () {
require(['directorybrowser'], function (directoryBrowser) {
var picker = new directoryBrowser();
picker.show({
callback: function (path) {
if (path) {
$('#txtCustomIntrosPath', page).val(path);
}
picker.close();
},
header: Globalize.translate('HeaderSelectCustomIntrosPath')
});
});
});
$('#btnSelectCodecIntrosPath', page).on("click.selectDirectory", function () {
require(['directorybrowser'], function (directoryBrowser) {
var picker = new directoryBrowser();
picker.show({
callback: function (path) {
if (path) {
$('#txtCodecIntrosPath', page).val(path);
}
picker.close();
},
header: Globalize.translate('HeaderSelectCodecIntrosPath')
});
});
});
$('.cinemaModeConfigurationForm').off('submit', onSubmit).on('submit', onSubmit);
if (!AppInfo.enableSupporterMembership) {
page.querySelector('.lnkSupporterLearnMore').href = '#';
page.querySelector('.lnkSupporterLearnMore').addEventListener('click', function (e) {
e.preventDefault();
return false;
});
}
}).on('pageshow', "#cinemaModeConfigurationPage", function () {
LibraryMenu.setTabs('playback', 0, getTabs);
Dashboard.showLoadingMsg();
var page = this;
ApiClient.getNamedConfiguration("cinemamode").then(function (config) {
loadPage(page, config);
});
});
});
define(["jQuery","fnchecked"],function($){"use strict";function loadPage(page,config){$(".chkMovies",page).checked(config.EnableIntrosForMovies),$(".chkEpisodes",page).checked(config.EnableIntrosForEpisodes),$(".chkMyMovieTrailers",page).checked(config.EnableIntrosFromMoviesInLibrary),$(".chkUpcomingTheaterTrailers",page).checked(config.EnableIntrosFromUpcomingTrailers),$(".chkUpcomingDvdTrailers",page).checked(config.EnableIntrosFromUpcomingDvdMovies),$(".chkUpcomingStreamingTrailers",page).checked(config.EnableIntrosFromUpcomingStreamingMovies),$(".chkOtherTrailers",page).checked(config.EnableIntrosFromSimilarMovies),$(".chkUnwatchedOnly",page).checked(!config.EnableIntrosForWatchedContent),$(".chkEnableParentalControl",page).checked(config.EnableIntrosParentalControl),$("#txtCustomIntrosPath",page).val(config.CustomIntroPath||""),$("#txtCodecIntrosPath",page).val(config.MediaInfoIntroPath||""),$("#txtNumTrailers",page).val(config.TrailerLimit),Dashboard.hideLoadingMsg()}function onSubmit(){Dashboard.showLoadingMsg();var form=this,page=$(form).parents(".page");return ApiClient.getNamedConfiguration("cinemamode").then(function(config){config.CustomIntroPath=$("#txtCustomIntrosPath",page).val(),config.MediaInfoIntroPath=$("#txtCodecIntrosPath",page).val(),config.TrailerLimit=$("#txtNumTrailers",page).val(),config.EnableIntrosForMovies=$(".chkMovies",page).checked(),config.EnableIntrosForEpisodes=$(".chkEpisodes",page).checked(),config.EnableIntrosFromMoviesInLibrary=$(".chkMyMovieTrailers",page).checked(),config.EnableIntrosForWatchedContent=!$(".chkUnwatchedOnly",page).checked(),config.EnableIntrosParentalControl=$(".chkEnableParentalControl",page).checked(),config.EnableIntrosFromUpcomingTrailers=$(".chkUpcomingTheaterTrailers",page).checked(),config.EnableIntrosFromUpcomingDvdMovies=$(".chkUpcomingDvdTrailers",page).checked(),config.EnableIntrosFromUpcomingStreamingMovies=$(".chkUpcomingStreamingTrailers",page).checked(),config.EnableIntrosFromSimilarMovies=$(".chkOtherTrailers",page).checked(),ApiClient.updateNamedConfiguration("cinemamode",config).then(Dashboard.processServerConfigurationUpdateResult)}),!1}function getTabs(){return[{href:"cinemamodeconfiguration.html",name:Globalize.translate("TabCinemaMode")},{href:"playbackconfiguration.html",name:Globalize.translate("TabResumeSettings")},{href:"streamingsettings.html",name:Globalize.translate("TabStreaming")}]}$(document).on("pageinit","#cinemaModeConfigurationPage",function(){var page=this;$("#btnSelectCustomIntrosPath",page).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({callback:function(path){path&&$("#txtCustomIntrosPath",page).val(path),picker.close()},header:Globalize.translate("HeaderSelectCustomIntrosPath")})})}),$("#btnSelectCodecIntrosPath",page).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({callback:function(path){path&&$("#txtCodecIntrosPath",page).val(path),picker.close()},header:Globalize.translate("HeaderSelectCodecIntrosPath")})})}),$(".cinemaModeConfigurationForm").off("submit",onSubmit).on("submit",onSubmit),AppInfo.enableSupporterMembership||(page.querySelector(".lnkSupporterLearnMore").href="#",page.querySelector(".lnkSupporterLearnMore").addEventListener("click",function(e){return e.preventDefault(),!1}))}).on("pageshow","#cinemaModeConfigurationPage",function(){LibraryMenu.setTabs("playback",0,getTabs),Dashboard.showLoadingMsg();var page=this;ApiClient.getNamedConfiguration("cinemamode").then(function(config){loadPage(page,config)})})});

View File

@ -1,158 +1 @@
define(['jQuery', 'fnchecked', 'emby-checkbox', 'emby-collapse', 'emby-textarea', 'emby-input', 'emby-select'], function ($) {
'use strict';
var brandingConfigKey = "branding";
var currentBrandingOptions;
var currentLanguage;
function loadPage(page, config, languageOptions, systemInfo) {
var os = systemInfo.OperatingSystem.toLowerCase();
if (os.indexOf('windows') != -1) {
$('#windowsStartupDescription', page).show();
} else {
$('#windowsStartupDescription', page).hide();
}
if (systemInfo.SupportsAutoRunAtStartup) {
$('#fldRunAtStartup', page).show();
} else {
$('#fldRunAtStartup', page).hide();
}
page.querySelector('#txtCachePath').value = config.CachePath || '';
$('#selectLocalizationLanguage', page).html(languageOptions.map(function (l) {
return '<option value="' + l.Value + '">' + l.Name + '</option>';
})).val(config.UICulture);
currentLanguage = config.UICulture;
$('#chkUsageData', page).checked(config.EnableAnonymousUsageReporting);
$('#chkRunAtStartup', page).checked(config.RunAtStartup);
if (systemInfo.CanSelfUpdate) {
$('.fldAutomaticUpdates', page).show();
} else {
$('.fldAutomaticUpdates', page).hide();
}
$('#chkEnableAutomaticServerUpdates', page).checked(config.EnableAutoUpdate);
$('#chkEnableAutomaticRestart', page).checked(config.EnableAutomaticRestart);
if (systemInfo.CanSelfRestart) {
$('#fldEnableAutomaticRestart', page).show();
} else {
$('#fldEnableAutomaticRestart', page).hide();
}
if (systemInfo.CanSelfRestart || systemInfo.CanSelfUpdate) {
$('.autoUpdatesContainer', page).removeClass('hide');
} else {
$('.autoUpdatesContainer', page).addClass('hide');
}
Dashboard.hideLoadingMsg();
}
function onSubmit() {
Dashboard.showLoadingMsg();
var form = this;
var page = $(form).parents('.page');
ApiClient.getServerConfiguration().then(function (config) {
config.UICulture = $('#selectLocalizationLanguage', form).val();
config.CachePath = form.querySelector('#txtCachePath').value;
var requiresReload = false;
if (config.UICulture != currentLanguage) {
requiresReload = true;
}
config.EnableAnonymousUsageReporting = $('#chkUsageData', form).checked();
config.RunAtStartup = $('#chkRunAtStartup', form).checked();
config.EnableAutomaticRestart = $('#chkEnableAutomaticRestart', form).checked();
config.EnableAutoUpdate = $('#chkEnableAutomaticServerUpdates', form).checked();
ApiClient.updateServerConfiguration(config).then(function () {
ApiClient.getNamedConfiguration(brandingConfigKey).then(function (brandingConfig) {
brandingConfig.LoginDisclaimer = form.querySelector('#txtLoginDisclaimer').value;
brandingConfig.CustomCss = form.querySelector('#txtCustomCss').value;
if (currentBrandingOptions && brandingConfig.CustomCss != currentBrandingOptions.CustomCss) {
requiresReload = true;
}
ApiClient.updateNamedConfiguration(brandingConfigKey, brandingConfig).then(Dashboard.processServerConfigurationUpdateResult);
if (requiresReload && !AppInfo.isNativeApp) {
window.location.reload(true);
}
});
});
});
// Disable default form submission
return false;
}
return function (view, params) {
$('#btnSelectCachePath', view).on("click.selectDirectory", function () {
require(['directorybrowser'], function (directoryBrowser) {
var picker = new directoryBrowser();
picker.show({
callback: function (path) {
if (path) {
view.querySelector('#txtCachePath').value = path;
}
picker.close();
},
header: Globalize.translate('HeaderSelectServerCachePath'),
instruction: Globalize.translate('HeaderSelectServerCachePathHelp')
});
});
});
$('.dashboardGeneralForm', view).off('submit', onSubmit).on('submit', onSubmit);
view.addEventListener('viewshow', function () {
var promise1 = ApiClient.getServerConfiguration();
var promise2 = ApiClient.getJSON(ApiClient.getUrl("Localization/Options"));
var promise3 = ApiClient.getSystemInfo();
Promise.all([promise1, promise2, promise3]).then(function (responses) {
loadPage(view, responses[0], responses[1], responses[2]);
});
ApiClient.getNamedConfiguration(brandingConfigKey).then(function (config) {
currentBrandingOptions = config;
view.querySelector('#txtLoginDisclaimer').value = config.LoginDisclaimer || '';
view.querySelector('#txtCustomCss').value = config.CustomCss || '';
});
});
};
});
define(["jQuery","fnchecked","emby-checkbox","emby-collapse","emby-textarea","emby-input","emby-select"],function($){"use strict";function loadPage(page,config,languageOptions,systemInfo){var os=systemInfo.OperatingSystem.toLowerCase();os.indexOf("windows")!=-1?$("#windowsStartupDescription",page).show():$("#windowsStartupDescription",page).hide(),systemInfo.SupportsAutoRunAtStartup?$("#fldRunAtStartup",page).show():$("#fldRunAtStartup",page).hide(),page.querySelector("#txtCachePath").value=config.CachePath||"",$("#selectLocalizationLanguage",page).html(languageOptions.map(function(l){return'<option value="'+l.Value+'">'+l.Name+"</option>"})).val(config.UICulture),currentLanguage=config.UICulture,$("#chkUsageData",page).checked(config.EnableAnonymousUsageReporting),$("#chkRunAtStartup",page).checked(config.RunAtStartup),systemInfo.CanSelfUpdate?$(".fldAutomaticUpdates",page).show():$(".fldAutomaticUpdates",page).hide(),$("#chkEnableAutomaticServerUpdates",page).checked(config.EnableAutoUpdate),$("#chkEnableAutomaticRestart",page).checked(config.EnableAutomaticRestart),systemInfo.CanSelfRestart?$("#fldEnableAutomaticRestart",page).show():$("#fldEnableAutomaticRestart",page).hide(),systemInfo.CanSelfRestart||systemInfo.CanSelfUpdate?$(".autoUpdatesContainer",page).removeClass("hide"):$(".autoUpdatesContainer",page).addClass("hide"),Dashboard.hideLoadingMsg()}function onSubmit(){Dashboard.showLoadingMsg();var form=this;$(form).parents(".page");return ApiClient.getServerConfiguration().then(function(config){config.UICulture=$("#selectLocalizationLanguage",form).val(),config.CachePath=form.querySelector("#txtCachePath").value;var requiresReload=!1;config.UICulture!=currentLanguage&&(requiresReload=!0),config.EnableAnonymousUsageReporting=$("#chkUsageData",form).checked(),config.RunAtStartup=$("#chkRunAtStartup",form).checked(),config.EnableAutomaticRestart=$("#chkEnableAutomaticRestart",form).checked(),config.EnableAutoUpdate=$("#chkEnableAutomaticServerUpdates",form).checked(),ApiClient.updateServerConfiguration(config).then(function(){ApiClient.getNamedConfiguration(brandingConfigKey).then(function(brandingConfig){brandingConfig.LoginDisclaimer=form.querySelector("#txtLoginDisclaimer").value,brandingConfig.CustomCss=form.querySelector("#txtCustomCss").value,currentBrandingOptions&&brandingConfig.CustomCss!=currentBrandingOptions.CustomCss&&(requiresReload=!0),ApiClient.updateNamedConfiguration(brandingConfigKey,brandingConfig).then(Dashboard.processServerConfigurationUpdateResult),requiresReload&&!AppInfo.isNativeApp&&window.location.reload(!0)})})}),!1}var currentBrandingOptions,currentLanguage,brandingConfigKey="branding";return function(view,params){$("#btnSelectCachePath",view).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({callback:function(path){path&&(view.querySelector("#txtCachePath").value=path),picker.close()},header:Globalize.translate("HeaderSelectServerCachePath"),instruction:Globalize.translate("HeaderSelectServerCachePathHelp")})})}),$(".dashboardGeneralForm",view).off("submit",onSubmit).on("submit",onSubmit),view.addEventListener("viewshow",function(){var promise1=ApiClient.getServerConfiguration(),promise2=ApiClient.getJSON(ApiClient.getUrl("Localization/Options")),promise3=ApiClient.getSystemInfo();Promise.all([promise1,promise2,promise3]).then(function(responses){loadPage(view,responses[0],responses[1],responses[2])}),ApiClient.getNamedConfiguration(brandingConfigKey).then(function(config){currentBrandingOptions=config,view.querySelector("#txtLoginDisclaimer").value=config.LoginDisclaimer||"",view.querySelector("#txtCustomCss").value=config.CustomCss||""})})}});

View File

@ -1,139 +1 @@
define(['jQuery', 'fnchecked', 'emby-checkbox'], function ($) {
'use strict';
function onSubmit() {
var form = this;
var localAddress = form.querySelector('#txtLocalAddress').value;
var enableUpnp = $('#chkEnableUpnp', form).checked();
confirmSelections(localAddress, enableUpnp, function () {
Dashboard.showLoadingMsg();
ApiClient.getServerConfiguration().then(function (config) {
config.HttpServerPortNumber = $('#txtPortNumber', form).val();
config.PublicPort = $('#txtPublicPort', form).val();
config.PublicHttpsPort = $('#txtPublicHttpsPort', form).val();
config.EnableHttps = $('#chkEnableHttps', form).checked();
config.HttpsPortNumber = $('#txtHttpsPort', form).val();
config.EnableUPnP = enableUpnp;
config.WanDdns = $('#txtDdns', form).val();
config.CertificatePath = $('#txtCertificatePath', form).val();
config.LocalNetworkAddresses = localAddress ? [localAddress] : [];
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult, Dashboard.processErrorResponse);
});
});
// Disable default form submission
return false;
}
function confirmSelections(localAddress, enableUpnp, callback) {
if (localAddress || !enableUpnp) {
require(['alert'], function (alert) {
alert({
title: Globalize.translate('TitleHostingSettings'),
text: Globalize.translate('SettingsWarning')
}).then(callback);
});
} else {
callback();
}
}
function getTabs() {
return [
{
href: 'dashboardhosting.html',
name: Globalize.translate('TabHosting')
},
{
href: 'serversecurity.html',
name: Globalize.translate('TabSecurity')
}];
}
return function (view, params) {
var self = this;
function loadPage(page, config) {
$('#txtPortNumber', page).val(config.HttpServerPortNumber);
$('#txtPublicPort', page).val(config.PublicPort);
$('#txtPublicHttpsPort', page).val(config.PublicHttpsPort);
page.querySelector('#txtLocalAddress').value = config.LocalNetworkAddresses[0] || '';
var chkEnableHttps = page.querySelector('#chkEnableHttps');
chkEnableHttps.checked = config.EnableHttps;
$('#txtHttpsPort', page).val(config.HttpsPortNumber);
$('#txtDdns', page).val(config.WanDdns || '');
var txtCertificatePath = page.querySelector('#txtCertificatePath');
txtCertificatePath.value = config.CertificatePath || '';
$('#chkEnableUpnp', page).checked(config.EnableUPnP);
onCertPathChange.call(txtCertificatePath);
Dashboard.hideLoadingMsg();
}
function onCertPathChange() {
if (this.value) {
view.querySelector('#txtDdns').setAttribute('required', 'required');
} else {
view.querySelector('#txtDdns').removeAttribute('required');
}
}
$('#btnSelectCertPath', view).on("click.selectDirectory", function () {
require(['directorybrowser'], function (directoryBrowser) {
var picker = new directoryBrowser();
picker.show({
includeFiles: true,
includeDirectories: true,
callback: function (path) {
if (path) {
$('#txtCertificatePath', view).val(path);
}
picker.close();
},
header: Globalize.translate('HeaderSelectCertificatePath')
});
});
});
$('.dashboardHostingForm').off('submit', onSubmit).on('submit', onSubmit);
view.querySelector('#txtCertificatePath').addEventListener('change', onCertPathChange);
view.addEventListener('viewshow', function (e) {
LibraryMenu.setTabs('adminadvanced', 0, getTabs);
Dashboard.showLoadingMsg();
ApiClient.getServerConfiguration().then(function (config) {
loadPage(view, config);
});
});
};
});
define(["jQuery","fnchecked","emby-checkbox"],function($){"use strict";function onSubmit(){var form=this,localAddress=form.querySelector("#txtLocalAddress").value,enableUpnp=$("#chkEnableUpnp",form).checked();return confirmSelections(localAddress,enableUpnp,function(){Dashboard.showLoadingMsg(),ApiClient.getServerConfiguration().then(function(config){config.HttpServerPortNumber=$("#txtPortNumber",form).val(),config.PublicPort=$("#txtPublicPort",form).val(),config.PublicHttpsPort=$("#txtPublicHttpsPort",form).val(),config.EnableHttps=$("#chkEnableHttps",form).checked(),config.HttpsPortNumber=$("#txtHttpsPort",form).val(),config.EnableUPnP=enableUpnp,config.WanDdns=$("#txtDdns",form).val(),config.CertificatePath=$("#txtCertificatePath",form).val(),config.LocalNetworkAddresses=localAddress?[localAddress]:[],ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult,Dashboard.processErrorResponse)})}),!1}function confirmSelections(localAddress,enableUpnp,callback){localAddress||!enableUpnp?require(["alert"],function(alert){alert({title:Globalize.translate("TitleHostingSettings"),text:Globalize.translate("SettingsWarning")}).then(callback)}):callback()}function getTabs(){return[{href:"dashboardhosting.html",name:Globalize.translate("TabHosting")},{href:"serversecurity.html",name:Globalize.translate("TabSecurity")}]}return function(view,params){function loadPage(page,config){$("#txtPortNumber",page).val(config.HttpServerPortNumber),$("#txtPublicPort",page).val(config.PublicPort),$("#txtPublicHttpsPort",page).val(config.PublicHttpsPort),page.querySelector("#txtLocalAddress").value=config.LocalNetworkAddresses[0]||"";var chkEnableHttps=page.querySelector("#chkEnableHttps");chkEnableHttps.checked=config.EnableHttps,$("#txtHttpsPort",page).val(config.HttpsPortNumber),$("#txtDdns",page).val(config.WanDdns||"");var txtCertificatePath=page.querySelector("#txtCertificatePath");txtCertificatePath.value=config.CertificatePath||"",$("#chkEnableUpnp",page).checked(config.EnableUPnP),onCertPathChange.call(txtCertificatePath),Dashboard.hideLoadingMsg()}function onCertPathChange(){this.value?view.querySelector("#txtDdns").setAttribute("required","required"):view.querySelector("#txtDdns").removeAttribute("required")}$("#btnSelectCertPath",view).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({includeFiles:!0,includeDirectories:!0,callback:function(path){path&&$("#txtCertificatePath",view).val(path),picker.close()},header:Globalize.translate("HeaderSelectCertificatePath")})})}),$(".dashboardHostingForm").off("submit",onSubmit).on("submit",onSubmit),view.querySelector("#txtCertificatePath").addEventListener("change",onCertPathChange),view.addEventListener("viewshow",function(e){LibraryMenu.setTabs("adminadvanced",0,getTabs),Dashboard.showLoadingMsg(),ApiClient.getServerConfiguration().then(function(config){loadPage(view,config)})})}});

View File

@ -1,101 +1 @@
define(['jQuery', 'fnchecked'], function ($) {
'use strict';
function load(page, config) {
$('#txtUploadPath', page).val(config.CameraUploadPath || '');
$('#chkSubfolder', page).checked(config.EnableCameraUploadSubfolders);
}
function loadData(page) {
Dashboard.showLoadingMsg();
ApiClient.getNamedConfiguration("devices").then(function (config) {
load(page, config);
Dashboard.hideLoadingMsg();
});
}
function save(page) {
ApiClient.getNamedConfiguration("devices").then(function (config) {
config.CameraUploadPath = $('#txtUploadPath', page).val();
config.EnableCameraUploadSubfolders = $('#chkSubfolder', page).checked();
ApiClient.updateNamedConfiguration("devices", config).then(Dashboard.processServerConfigurationUpdateResult);
});
}
function onSubmit() {
var form = this;
var page = $(form).parents('.page');
save(page);
return false;
}
function getTabs() {
return [
{
href: 'syncactivity.html',
name: Globalize.translate('TabSyncJobs')
},
{
href: 'devicesupload.html',
name: Globalize.translate('TabCameraUpload')
},
{
href: 'appservices.html?context=sync',
name: Globalize.translate('TabServices')
},
{
href: 'syncsettings.html',
name: Globalize.translate('TabSettings')
}];
}
$(document).on('pageinit', "#devicesUploadPage", function () {
var page = this;
$('#btnSelectUploadPath', page).on("click.selectDirectory", function () {
require(['directorybrowser'], function (directoryBrowser) {
var picker = new directoryBrowser();
picker.show({
callback: function (path) {
if (path) {
$('#txtUploadPath', page).val(path);
}
picker.close();
},
header: Globalize.translate('HeaderSelectUploadPath')
});
});
});
$('.devicesUploadForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshow', "#devicesUploadPage", function () {
LibraryMenu.setTabs('syncadmin', 1, getTabs);
var page = this;
loadData(page);
});
});
define(["jQuery","fnchecked"],function($){"use strict";function load(page,config){$("#txtUploadPath",page).val(config.CameraUploadPath||""),$("#chkSubfolder",page).checked(config.EnableCameraUploadSubfolders)}function loadData(page){Dashboard.showLoadingMsg(),ApiClient.getNamedConfiguration("devices").then(function(config){load(page,config),Dashboard.hideLoadingMsg()})}function save(page){ApiClient.getNamedConfiguration("devices").then(function(config){config.CameraUploadPath=$("#txtUploadPath",page).val(),config.EnableCameraUploadSubfolders=$("#chkSubfolder",page).checked(),ApiClient.updateNamedConfiguration("devices",config).then(Dashboard.processServerConfigurationUpdateResult)})}function onSubmit(){var form=this,page=$(form).parents(".page");return save(page),!1}function getTabs(){return[{href:"syncactivity.html",name:Globalize.translate("TabSyncJobs")},{href:"devicesupload.html",name:Globalize.translate("TabCameraUpload")},{href:"appservices.html?context=sync",name:Globalize.translate("TabServices")},{href:"syncsettings.html",name:Globalize.translate("TabSettings")}]}$(document).on("pageinit","#devicesUploadPage",function(){var page=this;$("#btnSelectUploadPath",page).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({callback:function(path){path&&$("#txtUploadPath",page).val(path),picker.close()},header:Globalize.translate("HeaderSelectUploadPath")})})}),$(".devicesUploadForm").off("submit",onSubmit).on("submit",onSubmit)}).on("pageshow","#devicesUploadPage",function(){LibraryMenu.setTabs("syncadmin",1,getTabs);var page=this;loadData(page)})});

View File

@ -1,70 +1 @@
define(['globalize', 'emby-checkbox', 'emby-button'], function (globalize) {
'use strict';
function getTabs() {
return [
{
href: 'library.html',
name: Globalize.translate('HeaderLibraries')
},
{
href: 'librarydisplay.html',
name: Globalize.translate('TabDisplay')
},
{
href: 'metadataimages.html',
name: Globalize.translate('TabMetadata')
},
{
href: 'metadatanfo.html',
name: Globalize.translate('TabNfoSettings')
},
{
href: 'librarysettings.html',
name: Globalize.translate('TabAdvanced')
}];
}
return function (view, params) {
var self = this;
view.querySelector('form').addEventListener('submit', function (e) {
Dashboard.showLoadingMsg();
var form = this;
ApiClient.getServerConfiguration().then(function (config) {
config.EnableFolderView = form.querySelector('.chkFolderView').checked;
config.EnableGroupingIntoCollections = form.querySelector('.chkGroupMoviesIntoCollections').checked;
config.DisplaySpecialsWithinSeasons = form.querySelector('.chkDisplaySpecialsWithinSeasons').checked;
config.DisplayCollectionsView = form.querySelector('.chkDisplayCollectionView').checked;
config.EnableChannelView = !form.querySelector('.chkDisplayChannelsInline').checked;
config.EnableExternalContentInSuggestions = form.querySelector('.chkExternalContentInSuggestions').checked;
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
});
e.preventDefault();
return false;
});
function loadData() {
ApiClient.getServerConfiguration().then(function (config) {
view.querySelector('.chkFolderView').checked = config.EnableFolderView;
view.querySelector('.chkGroupMoviesIntoCollections').checked = config.EnableGroupingIntoCollections;
view.querySelector('.chkDisplaySpecialsWithinSeasons').checked = config.DisplaySpecialsWithinSeasons;
view.querySelector('.chkDisplayCollectionView').checked = config.DisplayCollectionsView;
view.querySelector('.chkDisplayChannelsInline').checked = !(config.EnableChannelView || false);
view.querySelector('.chkExternalContentInSuggestions').checked = config.EnableExternalContentInSuggestions;
});
}
view.addEventListener('viewshow', function () {
LibraryMenu.setTabs('librarysetup', 1, getTabs);
loadData();
});
};
});
define(["globalize","emby-checkbox","emby-button"],function(globalize){"use strict";function getTabs(){return[{href:"library.html",name:Globalize.translate("HeaderLibraries")},{href:"librarydisplay.html",name:Globalize.translate("TabDisplay")},{href:"metadataimages.html",name:Globalize.translate("TabMetadata")},{href:"metadatanfo.html",name:Globalize.translate("TabNfoSettings")},{href:"librarysettings.html",name:Globalize.translate("TabAdvanced")}]}return function(view,params){function loadData(){ApiClient.getServerConfiguration().then(function(config){view.querySelector(".chkFolderView").checked=config.EnableFolderView,view.querySelector(".chkGroupMoviesIntoCollections").checked=config.EnableGroupingIntoCollections,view.querySelector(".chkDisplaySpecialsWithinSeasons").checked=config.DisplaySpecialsWithinSeasons,view.querySelector(".chkDisplayCollectionView").checked=config.DisplayCollectionsView,view.querySelector(".chkDisplayChannelsInline").checked=!config.EnableChannelView,view.querySelector(".chkExternalContentInSuggestions").checked=config.EnableExternalContentInSuggestions})}view.querySelector("form").addEventListener("submit",function(e){Dashboard.showLoadingMsg();var form=this;return ApiClient.getServerConfiguration().then(function(config){config.EnableFolderView=form.querySelector(".chkFolderView").checked,config.EnableGroupingIntoCollections=form.querySelector(".chkGroupMoviesIntoCollections").checked,config.DisplaySpecialsWithinSeasons=form.querySelector(".chkDisplaySpecialsWithinSeasons").checked,config.DisplayCollectionsView=form.querySelector(".chkDisplayCollectionView").checked,config.EnableChannelView=!form.querySelector(".chkDisplayChannelsInline").checked,config.EnableExternalContentInSuggestions=form.querySelector(".chkExternalContentInSuggestions").checked,ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult)}),e.preventDefault(),!1}),view.addEventListener("viewshow",function(){LibraryMenu.setTabs("librarysetup",1,getTabs),loadData()})}});

View File

@ -1,161 +1 @@
define(['jQuery', 'fnchecked', 'emby-checkbox'], function ($) {
'use strict';
function loadPage(page, config) {
if (config.MergeMetadataAndImagesByName) {
$('.fldImagesByName', page).hide();
} else {
$('.fldImagesByName', page).show();
}
$('#txtSeasonZeroName', page).val(config.SeasonZeroDisplayName);
$('#chkSaveMetadataHidden', page).checked(config.SaveMetadataHidden);
$('#txtMetadataPath', page).val(config.MetadataPath || '');
$('#txtMetadataNetworkPath', page).val(config.MetadataNetworkPath || '');
Dashboard.hideLoadingMsg();
}
function loadMetadataConfig(page, config) {
$('#selectDateAdded', page).val((config.UseFileCreationTimeForDateAdded ? '1' : '0'));
}
function loadFanartConfig(page, config) {
$('#txtFanartApiKey', page).val(config.UserApiKey || '');
}
function saveFanart(form) {
ApiClient.getNamedConfiguration("fanart").then(function (config) {
config.UserApiKey = $('#txtFanartApiKey', form).val();
ApiClient.updateNamedConfiguration("fanart", config);
});
}
function saveMetadata(form) {
ApiClient.getNamedConfiguration("metadata").then(function (config) {
config.UseFileCreationTimeForDateAdded = $('#selectDateAdded', form).val() == '1';
ApiClient.updateNamedConfiguration("metadata", config);
});
}
function onSubmit() {
Dashboard.showLoadingMsg();
var form = this;
ApiClient.getServerConfiguration().then(function (config) {
config.SeasonZeroDisplayName = $('#txtSeasonZeroName', form).val();
config.SaveMetadataHidden = $('#chkSaveMetadataHidden', form).checked();
config.EnableTvDbUpdates = $('#chkEnableTvdbUpdates', form).checked();
config.EnableTmdbUpdates = $('#chkEnableTmdbUpdates', form).checked();
config.EnableFanArtUpdates = $('#chkEnableFanartUpdates', form).checked();
config.MetadataPath = $('#txtMetadataPath', form).val();
config.MetadataNetworkPath = $('#txtMetadataNetworkPath', form).val();
config.FanartApiKey = $('#txtFanartApiKey', form).val();
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
});
saveMetadata(form);
saveFanart(form);
// Disable default form submission
return false;
}
function getTabs() {
return [
{
href: 'library.html',
name: Globalize.translate('HeaderLibraries')
},
{
href: 'librarydisplay.html',
name: Globalize.translate('TabDisplay')
},
{
href: 'metadataimages.html',
name: Globalize.translate('TabMetadata')
},
{
href: 'metadatanfo.html',
name: Globalize.translate('TabNfoSettings')
},
{
href: 'librarysettings.html',
name: Globalize.translate('TabAdvanced')
}];
}
return function (view, params) {
var self = this;
$('#btnSelectMetadataPath', view).on("click.selectDirectory", function () {
require(['directorybrowser'], function (directoryBrowser) {
var picker = new directoryBrowser();
picker.show({
path: $('#txtMetadataPath', view).val(),
networkSharePath: $('#txtMetadataNetworkPath', view).val(),
callback: function (path, networkPath) {
if (path) {
$('#txtMetadataPath', view).val(path);
$('#txtMetadataNetworkPath', view).val(networkPath);
}
picker.close();
},
header: Globalize.translate('HeaderSelectMetadataPath'),
instruction: Globalize.translate('HeaderSelectMetadataPathHelp'),
enableNetworkSharePath: true
});
});
});
$('.librarySettingsForm').off('submit', onSubmit).on('submit', onSubmit);
view.addEventListener('viewshow', function () {
LibraryMenu.setTabs('librarysetup', 4, getTabs);
Dashboard.showLoadingMsg();
var page = this;
ApiClient.getServerConfiguration().then(function (config) {
loadPage(page, config);
});
ApiClient.getNamedConfiguration("metadata").then(function (metadata) {
loadMetadataConfig(page, metadata);
});
ApiClient.getNamedConfiguration("fanart").then(function (metadata) {
loadFanartConfig(page, metadata);
});
});
};
});
define(["jQuery","fnchecked","emby-checkbox"],function($){"use strict";function loadPage(page,config){config.MergeMetadataAndImagesByName?$(".fldImagesByName",page).hide():$(".fldImagesByName",page).show(),$("#txtSeasonZeroName",page).val(config.SeasonZeroDisplayName),$("#chkSaveMetadataHidden",page).checked(config.SaveMetadataHidden),$("#txtMetadataPath",page).val(config.MetadataPath||""),$("#txtMetadataNetworkPath",page).val(config.MetadataNetworkPath||""),Dashboard.hideLoadingMsg()}function loadMetadataConfig(page,config){$("#selectDateAdded",page).val(config.UseFileCreationTimeForDateAdded?"1":"0")}function loadFanartConfig(page,config){$("#txtFanartApiKey",page).val(config.UserApiKey||"")}function saveFanart(form){ApiClient.getNamedConfiguration("fanart").then(function(config){config.UserApiKey=$("#txtFanartApiKey",form).val(),ApiClient.updateNamedConfiguration("fanart",config)})}function saveMetadata(form){ApiClient.getNamedConfiguration("metadata").then(function(config){config.UseFileCreationTimeForDateAdded="1"==$("#selectDateAdded",form).val(),ApiClient.updateNamedConfiguration("metadata",config)})}function onSubmit(){Dashboard.showLoadingMsg();var form=this;return ApiClient.getServerConfiguration().then(function(config){config.SeasonZeroDisplayName=$("#txtSeasonZeroName",form).val(),config.SaveMetadataHidden=$("#chkSaveMetadataHidden",form).checked(),config.EnableTvDbUpdates=$("#chkEnableTvdbUpdates",form).checked(),config.EnableTmdbUpdates=$("#chkEnableTmdbUpdates",form).checked(),config.EnableFanArtUpdates=$("#chkEnableFanartUpdates",form).checked(),config.MetadataPath=$("#txtMetadataPath",form).val(),config.MetadataNetworkPath=$("#txtMetadataNetworkPath",form).val(),config.FanartApiKey=$("#txtFanartApiKey",form).val(),ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult)}),saveMetadata(form),saveFanart(form),!1}function getTabs(){return[{href:"library.html",name:Globalize.translate("HeaderLibraries")},{href:"librarydisplay.html",name:Globalize.translate("TabDisplay")},{href:"metadataimages.html",name:Globalize.translate("TabMetadata")},{href:"metadatanfo.html",name:Globalize.translate("TabNfoSettings")},{href:"librarysettings.html",name:Globalize.translate("TabAdvanced")}]}return function(view,params){$("#btnSelectMetadataPath",view).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({path:$("#txtMetadataPath",view).val(),networkSharePath:$("#txtMetadataNetworkPath",view).val(),callback:function(path,networkPath){path&&($("#txtMetadataPath",view).val(path),$("#txtMetadataNetworkPath",view).val(networkPath)),picker.close()},header:Globalize.translate("HeaderSelectMetadataPath"),instruction:Globalize.translate("HeaderSelectMetadataPathHelp"),enableNetworkSharePath:!0})})}),$(".librarySettingsForm").off("submit",onSubmit).on("submit",onSubmit),view.addEventListener("viewshow",function(){LibraryMenu.setTabs("librarysetup",4,getTabs),Dashboard.showLoadingMsg();var page=this;ApiClient.getServerConfiguration().then(function(config){loadPage(page,config)}),ApiClient.getNamedConfiguration("metadata").then(function(metadata){loadMetadataConfig(page,metadata)}),ApiClient.getNamedConfiguration("fanart").then(function(metadata){loadFanartConfig(page,metadata)})})}});

View File

@ -1,136 +1 @@
define(['emby-checkbox'], function () {
'use strict';
function reload(page, providerId) {
page.querySelector('.txtDevicePath').value = '';
if (providerId) {
ApiClient.getNamedConfiguration("livetv").then(function (config) {
var info = config.TunerHosts.filter(function (i) {
return i.Id == providerId;
})[0];
page.querySelector('.txtDevicePath').value = info.Url || '';
page.querySelector('.txtM3uUrl').value = info.M3UUrl || '';
page.querySelector('.chkEnabled').checked = info.IsEnabled;
});
}
}
function fillInfoFromPage(page, info) {
info.Url = page.querySelector('.txtDevicePath').value;
info.M3UUrl = page.querySelector('.txtM3uUrl').value;
info.IsEnabled = page.querySelector('.chkEnabled').checked;
info.DiseqC = page.querySelector('.selectDiseqC').value;
info.SourceA = page.querySelector('.selectSourceA').value;
info.SourceB = page.querySelector('.selectSourceB').value;
info.SourceC = page.querySelector('.selectSourceC').value;
info.SourceD = page.querySelector('.selectSourceD').value;
}
function submitTunerInfo(page, info) {
ApiClient.ajax({
type: "POST",
url: ApiClient.getUrl('LiveTv/TunerHosts'),
data: JSON.stringify(info),
contentType: "application/json"
}).then(function () {
Dashboard.processServerConfigurationUpdateResult();
Dashboard.navigate('livetvstatus.html');
}, function () {
Dashboard.hideLoadingMsg();
Dashboard.alert({
message: Globalize.translate('ErrorSavingTvProvider')
});
});
}
function populateMappings(view) {
ApiClient.getJSON(ApiClient.getUrl('LiveTv/TunerHosts/Satip/IniMappings')).then(function (mappings) {
var optionsHtml = mappings.map(function (m) {
return '<option value="' + m.Value + '">' + m.Name + '</option>';
}).join('');
optionsHtml = '<option value="">' + Globalize.translate('OptionNone') + '</option>' + optionsHtml;
view.querySelector('.selectSourceA').innerHTML = optionsHtml;
view.querySelector('.selectSourceB').innerHTML = optionsHtml;
view.querySelector('.selectSourceC').innerHTML = optionsHtml;
view.querySelector('.selectSourceD').innerHTML = optionsHtml;
});
}
return function (view, params) {
function submitForm() {
Dashboard.showLoadingMsg();
var id = params.id;
if (id) {
ApiClient.getNamedConfiguration("livetv").then(function (config) {
var info = config.TunerHosts.filter(function (i) {
return i.Id == id;
})[0];
fillInfoFromPage(view, info);
submitTunerInfo(view, info);
});
} else {
var info = {
Type: 'satip'
};
fillInfoFromPage(view, info);
submitTunerInfo(view, info);
}
}
function onSelectDiseqCChange(e) {
var select = e.target;
var value = select.value;
if (value) {
view.querySelector('.fldSourceB').classList.remove('hide');
} else {
view.querySelector('.fldSourceB').classList.add('hide');
}
if (value == 'diseqc1') {
view.querySelector('.fldSourceC').classList.remove('hide');
view.querySelector('.fldSourceD').classList.remove('hide');
} else {
view.querySelector('.fldSourceC').classList.add('hide');
view.querySelector('.fldSourceD').classList.add('hide');
}
}
view.querySelector('form').addEventListener('submit', function (e) {
submitForm();
e.preventDefault();
return false;
});
view.querySelector('.selectDiseqC').addEventListener('change', onSelectDiseqCChange);
populateMappings(view);
view.addEventListener('viewshow', function (e) {
var providerId = params.id;
reload(view, providerId);
});
}
});
define(["emby-checkbox"],function(){"use strict";function reload(page,providerId){page.querySelector(".txtDevicePath").value="",providerId&&ApiClient.getNamedConfiguration("livetv").then(function(config){var info=config.TunerHosts.filter(function(i){return i.Id==providerId})[0];page.querySelector(".txtDevicePath").value=info.Url||"",page.querySelector(".txtM3uUrl").value=info.M3UUrl||"",page.querySelector(".chkEnabled").checked=info.IsEnabled})}function fillInfoFromPage(page,info){info.Url=page.querySelector(".txtDevicePath").value,info.M3UUrl=page.querySelector(".txtM3uUrl").value,info.IsEnabled=page.querySelector(".chkEnabled").checked,info.DiseqC=page.querySelector(".selectDiseqC").value,info.SourceA=page.querySelector(".selectSourceA").value,info.SourceB=page.querySelector(".selectSourceB").value,info.SourceC=page.querySelector(".selectSourceC").value,info.SourceD=page.querySelector(".selectSourceD").value}function submitTunerInfo(page,info){ApiClient.ajax({type:"POST",url:ApiClient.getUrl("LiveTv/TunerHosts"),data:JSON.stringify(info),contentType:"application/json"}).then(function(){Dashboard.processServerConfigurationUpdateResult(),Dashboard.navigate("livetvstatus.html")},function(){Dashboard.hideLoadingMsg(),Dashboard.alert({message:Globalize.translate("ErrorSavingTvProvider")})})}function populateMappings(view){ApiClient.getJSON(ApiClient.getUrl("LiveTv/TunerHosts/Satip/IniMappings")).then(function(mappings){var optionsHtml=mappings.map(function(m){return'<option value="'+m.Value+'">'+m.Name+"</option>"}).join("");optionsHtml='<option value="">'+Globalize.translate("OptionNone")+"</option>"+optionsHtml,view.querySelector(".selectSourceA").innerHTML=optionsHtml,view.querySelector(".selectSourceB").innerHTML=optionsHtml,view.querySelector(".selectSourceC").innerHTML=optionsHtml,view.querySelector(".selectSourceD").innerHTML=optionsHtml})}return function(view,params){function submitForm(){Dashboard.showLoadingMsg();var id=params.id;if(id)ApiClient.getNamedConfiguration("livetv").then(function(config){var info=config.TunerHosts.filter(function(i){return i.Id==id})[0];fillInfoFromPage(view,info),submitTunerInfo(view,info)});else{var info={Type:"satip"};fillInfoFromPage(view,info),submitTunerInfo(view,info)}}function onSelectDiseqCChange(e){var select=e.target,value=select.value;value?view.querySelector(".fldSourceB").classList.remove("hide"):view.querySelector(".fldSourceB").classList.add("hide"),"diseqc1"==value?(view.querySelector(".fldSourceC").classList.remove("hide"),view.querySelector(".fldSourceD").classList.remove("hide")):(view.querySelector(".fldSourceC").classList.add("hide"),view.querySelector(".fldSourceD").classList.add("hide"))}view.querySelector("form").addEventListener("submit",function(e){return submitForm(),e.preventDefault(),!1}),view.querySelector(".selectDiseqC").addEventListener("change",onSelectDiseqCChange),populateMappings(view),view.addEventListener("viewshow",function(e){var providerId=params.id;reload(view,providerId)})}});

View File

@ -1,79 +1 @@
define(['datetime', 'listViewStyle'], function (datetime) {
'use strict';
return function (view, params) {
view.querySelector('#chkDebugLog').addEventListener('change', function () {
ApiClient.getServerConfiguration().then(function (config) {
config.EnableDebugLevelLogging = view.querySelector('#chkDebugLog').checked;
ApiClient.updateServerConfiguration(config);
});
});
view.addEventListener('viewbeforeshow', function () {
Dashboard.showLoadingMsg();
var apiClient = ApiClient;
apiClient.getJSON(apiClient.getUrl('System/Logs')).then(function (logs) {
var html = '';
html += '<div class="paperList">';
html += logs.map(function (log) {
var logUrl = apiClient.getUrl('System/Logs/Log', {
name: log.Name
});
logUrl += "&api_key=" + apiClient.accessToken();
var logHtml = '';
logHtml += '<div class="listItem">';
logHtml += '<a item-icon class="clearLink" href="' + logUrl + '" target="_blank">';
logHtml += '<i class="md-icon listItemIcon">schedule</i>';
logHtml += "</a>";
logHtml += '<div class="listItemBody two-line">';
logHtml += '<a class="clearLink" href="' + logUrl + '" target="_blank">';
logHtml += "<h3 class='listItemBodyText'>" + log.Name + "</h3>";
var date = datetime.parseISO8601Date(log.DateModified, true);
var text = datetime.toLocaleDateString(date);
text += ' ' + datetime.getDisplayTime(date);
logHtml += '<div class="listItemBodyText secondary">' + text + '</div>';
logHtml += "</a>";
logHtml += '</div>';
logHtml += '</div>';
return logHtml;
})
.join('');
html += '</div>';
view.querySelector('.serverLogs').innerHTML = html;
Dashboard.hideLoadingMsg();
});
apiClient.getServerConfiguration().then(function (config) {
view.querySelector('#chkDebugLog').checked = config.EnableDebugLevelLogging;
});
});
};
});
define(["datetime","listViewStyle"],function(datetime){"use strict";return function(view,params){view.querySelector("#chkDebugLog").addEventListener("change",function(){ApiClient.getServerConfiguration().then(function(config){config.EnableDebugLevelLogging=view.querySelector("#chkDebugLog").checked,ApiClient.updateServerConfiguration(config)})}),view.addEventListener("viewbeforeshow",function(){Dashboard.showLoadingMsg();var apiClient=ApiClient;apiClient.getJSON(apiClient.getUrl("System/Logs")).then(function(logs){var html="";html+='<div class="paperList">',html+=logs.map(function(log){var logUrl=apiClient.getUrl("System/Logs/Log",{name:log.Name});logUrl+="&api_key="+apiClient.accessToken();var logHtml="";logHtml+='<div class="listItem">',logHtml+='<a item-icon class="clearLink" href="'+logUrl+'" target="_blank">',logHtml+='<i class="md-icon listItemIcon">schedule</i>',logHtml+="</a>",logHtml+='<div class="listItemBody two-line">',logHtml+='<a class="clearLink" href="'+logUrl+'" target="_blank">',logHtml+="<h3 class='listItemBodyText'>"+log.Name+"</h3>";var date=datetime.parseISO8601Date(log.DateModified,!0),text=datetime.toLocaleDateString(date);return text+=" "+datetime.getDisplayTime(date),logHtml+='<div class="listItemBodyText secondary">'+text+"</div>",logHtml+="</a>",logHtml+="</div>",logHtml+="</div>"}).join(""),html+="</div>",view.querySelector(".serverLogs").innerHTML=html,Dashboard.hideLoadingMsg()}),apiClient.getServerConfiguration().then(function(config){view.querySelector("#chkDebugLog").checked=config.EnableDebugLevelLogging})})}});

View File

@ -1,145 +1 @@
define([], function () {
'use strict';
function goNext() {
Dashboard.navigate('wizardagreement.html');
}
function loadDownloadInfo(view) {
var instructions = '';
ApiClient.getSystemInfo().then(function (systemInfo) {
var operatingSystem = systemInfo.OperatingSystem.toLowerCase();
if (operatingSystem == 'windows') {
view.querySelector('.fldSelectEncoderPathType').classList.add('hide');
view.querySelector('.markExec').classList.add('hide');
} else {
view.querySelector('.fldSelectEncoderPathType').classList.remove('hide');
view.querySelector('.markExec').classList.remove('hide');
}
if (operatingSystem == 'windows' && systemInfo.SystemArchitecture != 'Arm') {
view.querySelector('.suggestedLocation').innerHTML = Globalize.translate('FFmpegSuggestedDownload', '<a target="_blank" href="https://ffmpeg.zeranoe.com/builds">https://ffmpeg.zeranoe.com</a>');
if (systemInfo.SystemArchitecture == 'X86') {
instructions = 'Download FFmpeg 32-Bit Static';
}
else if (systemInfo.SystemArchitecture == 'X64') {
instructions = 'Download FFmpeg 64-Bit Static';
}
} else if (operatingSystem == 'linux') {
view.querySelector('.suggestedLocation').innerHTML = Globalize.translate('FFmpegSuggestedDownload', '<a target="_blank" href="http://johnvansickle.com/ffmpeg">http://johnvansickle.com/ffmpeg</a>');
if (systemInfo.SystemArchitecture == 'X86') {
instructions = 'Download x86 build';
}
else if (systemInfo.SystemArchitecture == 'X64') {
instructions = 'Download x86_64 build';
}
} else if (operatingSystem == 'osx' && systemInfo.SystemArchitecture == 'X64') {
view.querySelector('.suggestedLocation').innerHTML = Globalize.translate('FFmpegSuggestedDownload', '<a target="_blank" href="http://evermeet.cx/ffmpeg">http://evermeet.cx/ffmpeg</a>');
instructions = 'Download both ffmpeg and ffprobe, and extract them to the same folder.';
} else {
view.querySelector('.suggestedLocation').innerHTML = Globalize.translate('FFmpegSuggestedDownload', '<a target="_blank" href="http://ffmpeg.org">https://ffmpeg.org/download.html</a>');
}
view.querySelector('.downloadInstructions').innerHTML = instructions;
var selectEncoderPath = view.querySelector('#selectEncoderPath');
selectEncoderPath.value = 'Custom';
onSelectEncoderPathChange.call(selectEncoderPath);
});
}
function onSaveEncodingPathFailure(response) {
var msg = '';
// This is a fallback that handles both 404 and 400 (no path entered)
msg = Globalize.translate('FFmpegSavePathNotFound');
require(['alert'], function (alert) {
alert(msg);
});
}
function parentWithClass(elem, className) {
while (!elem.classList || !elem.classList.contains(className)) {
elem = elem.parentNode;
if (!elem) {
return null;
}
}
return elem;
}
function onSelectEncoderPathChange(e) {
var page = parentWithClass(this, 'page');
if (this.value == 'Custom') {
page.querySelector('.fldEncoderPath').classList.remove('hide');
} else {
page.querySelector('.fldEncoderPath').classList.add('hide');
}
}
return function (view, params) {
view.querySelector('#btnSelectEncoderPath').addEventListener("click", function () {
require(['directorybrowser'], function (directoryBrowser) {
var picker = new directoryBrowser();
picker.show({
includeFiles: true,
callback: function (path) {
if (path) {
view.querySelector('.txtEncoderPath').value = path;
}
picker.close();
}
});
});
});
view.querySelector('form').addEventListener('submit', function (e) {
var form = this;
ApiClient.ajax({
url: ApiClient.getUrl('System/MediaEncoder/Path'),
type: 'POST',
data: {
Path: form.querySelector('.txtEncoderPath').value,
PathType: 'Custom'
}
}).then(goNext, onSaveEncodingPathFailure);
e.preventDefault();
return false;
});
view.querySelector('#selectEncoderPath').addEventListener('change', onSelectEncoderPathChange);
view.addEventListener('viewbeforeshow', function (e) {
loadDownloadInfo(view);
});
};
});
define([],function(){"use strict";function goNext(){Dashboard.navigate("wizardagreement.html")}function loadDownloadInfo(view){var instructions="";ApiClient.getSystemInfo().then(function(systemInfo){var operatingSystem=systemInfo.OperatingSystem.toLowerCase();"windows"==operatingSystem?(view.querySelector(".fldSelectEncoderPathType").classList.add("hide"),view.querySelector(".markExec").classList.add("hide")):(view.querySelector(".fldSelectEncoderPathType").classList.remove("hide"),view.querySelector(".markExec").classList.remove("hide")),"windows"==operatingSystem&&"Arm"!=systemInfo.SystemArchitecture?(view.querySelector(".suggestedLocation").innerHTML=Globalize.translate("FFmpegSuggestedDownload",'<a target="_blank" href="https://ffmpeg.zeranoe.com/builds">https://ffmpeg.zeranoe.com</a>'),"X86"==systemInfo.SystemArchitecture?instructions="Download FFmpeg 32-Bit Static":"X64"==systemInfo.SystemArchitecture&&(instructions="Download FFmpeg 64-Bit Static")):"linux"==operatingSystem?(view.querySelector(".suggestedLocation").innerHTML=Globalize.translate("FFmpegSuggestedDownload",'<a target="_blank" href="http://johnvansickle.com/ffmpeg">http://johnvansickle.com/ffmpeg</a>'),"X86"==systemInfo.SystemArchitecture?instructions="Download x86 build":"X64"==systemInfo.SystemArchitecture&&(instructions="Download x86_64 build")):"osx"==operatingSystem&&"X64"==systemInfo.SystemArchitecture?(view.querySelector(".suggestedLocation").innerHTML=Globalize.translate("FFmpegSuggestedDownload",'<a target="_blank" href="http://evermeet.cx/ffmpeg">http://evermeet.cx/ffmpeg</a>'),instructions="Download both ffmpeg and ffprobe, and extract them to the same folder."):view.querySelector(".suggestedLocation").innerHTML=Globalize.translate("FFmpegSuggestedDownload",'<a target="_blank" href="http://ffmpeg.org">https://ffmpeg.org/download.html</a>'),view.querySelector(".downloadInstructions").innerHTML=instructions;var selectEncoderPath=view.querySelector("#selectEncoderPath");selectEncoderPath.value="Custom",onSelectEncoderPathChange.call(selectEncoderPath)})}function onSaveEncodingPathFailure(response){var msg="";msg=Globalize.translate("FFmpegSavePathNotFound"),require(["alert"],function(alert){alert(msg)})}function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function onSelectEncoderPathChange(e){var page=parentWithClass(this,"page");"Custom"==this.value?page.querySelector(".fldEncoderPath").classList.remove("hide"):page.querySelector(".fldEncoderPath").classList.add("hide")}return function(view,params){view.querySelector("#btnSelectEncoderPath").addEventListener("click",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({includeFiles:!0,callback:function(path){path&&(view.querySelector(".txtEncoderPath").value=path),picker.close()}})})}),view.querySelector("form").addEventListener("submit",function(e){var form=this;return ApiClient.ajax({url:ApiClient.getUrl("System/MediaEncoder/Path"),type:"POST",data:{Path:form.querySelector(".txtEncoderPath").value,PathType:"Custom"}}).then(goNext,onSaveEncodingPathFailure),e.preventDefault(),!1}),view.querySelector("#selectEncoderPath").addEventListener("change",onSelectEncoderPathChange),view.addEventListener("viewbeforeshow",function(e){loadDownloadInfo(view)})}});

View File

@ -1,27 +1 @@
define(['loading'], function (loading) {
'use strict';
function onFinish() {
loading.show();
ApiClient.ajax({
url: ApiClient.getUrl('Startup/Complete'),
type: 'POST'
}).then(function () {
Dashboard.navigate('dashboard.html');
loading.hide();
});
}
return function (view, params) {
var self = this;
view.querySelector('.btnWizardNext').addEventListener('click', onFinish);
};
});
define(["loading"],function(loading){"use strict";function onFinish(){loading.show(),ApiClient.ajax({url:ApiClient.getUrl("Startup/Complete"),type:"POST"}).then(function(){Dashboard.navigate("dashboard.html"),loading.hide()})}return function(view,params){view.querySelector(".btnWizardNext").addEventListener("click",onFinish)}});

View File

@ -1,15 +1 @@
.libraryMenuButtonText {
font-weight: 500 !important;
}
@media all and (min-width: 300px) {
.libraryViewNav, .emby-tabs-slider {
display: flex;
flex-grow: 1;
}
.emby-tab-button {
flex-grow: 1;
}
}
.libraryMenuButtonText{font-weight:500!important}@media all and (min-width:300px){.emby-tabs-slider,.libraryViewNav{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1}.emby-tab-button{-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1}}

View File

@ -1,95 +1 @@
body:not(.dashboardDocument) .mainDrawerButton {
display: none !important;
}
.pageWithAbsoluteTabs:not(.noSecondaryNavPage) {
padding-top: 88px !important;
}
.libraryPage:not(.noSecondaryNavPage) {
padding-top: 85px !important;
}
.backdropContainer {
/* This isn't implemented right and ends up looking terrible */
background-attachment: initial;
}
.viewMenuBar {
/* It needs this in order to retain height since we're positioning the contents absolutely */
height: 50px;
}
.ui-body-b .libraryViewNav {
box-shadow: none;
}
/*.viewMenuBar, .ui-body-b .libraryViewNav {
background: rgba(34,35,38,.90);
-webkit-backdrop-filter: blur(5px);
backdrop-filter: blur(5px);
}
.viewMenuBar.semiTransparent {
background-color: rgba(15, 15, 15, .3);
}*/
.emby-tab-button {
font-weight: 400;
text-transform: none !important;
border-color: transparent !important;
border-width: 0 !important;
}
.criticReviewPaperList {
background-color: #262626;
}
.settingsMenuHeader {
display: none;
}
.libraryMenuButtonText {
font-weight: 500 !important;
}
.btnNotificationsInner {
font-weight: 400;
}
.cardImageContainer {
border-radius: 4px;
}
.sidebarLinkText {
font-weight: 400 !important;
}
.videoSubtitles {
font-size: 200% !important;
}
.txtSearch {
padding-bottom: .5em !important;
text-indent: 0 !important;
}
.searchInputContainer {
margin-left: 5%;
margin-right: 5%;
}
.categorySyncButton, .btnSync {
display: none !important;
}
.dialog.background-theme-b {
background: rgba(28,28,28,.84);
-webkit-backdrop-filter: blur(5px);
backdrop-filter: blur(5px);
}
.cardOverlayButton {
-webkit-backdrop-filter: blur(5px);
backdrop-filter: blur(5px);
}
body:not(.dashboardDocument) .mainDrawerButton{display:none!important}.pageWithAbsoluteTabs:not(.noSecondaryNavPage){padding-top:88px!important}.libraryPage:not(.noSecondaryNavPage){padding-top:85px!important}.backdropContainer{background-attachment:initial}.viewMenuBar{height:50px}.ui-body-b .libraryViewNav{-webkit-box-shadow:none;box-shadow:none}.emby-tab-button{font-weight:400;text-transform:none!important;border-color:transparent!important;border-width:0!important}.criticReviewPaperList{background-color:#262626}.settingsMenuHeader{display:none}.libraryMenuButtonText{font-weight:500!important}.btnNotificationsInner{font-weight:400}.cardImageContainer{-webkit-border-radius:4px;border-radius:4px}.sidebarLinkText{font-weight:400!important}.videoSubtitles{font-size:200%!important}.txtSearch{padding-bottom:.5em!important;text-indent:0!important}.searchInputContainer{margin-left:5%;margin-right:5%}.btnSync,.categorySyncButton{display:none!important}.dialog.background-theme-b{background:rgba(28,28,28,.84);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}.cardOverlayButton{-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}

View File

@ -1,8 +1 @@
define(['jQuery'], function ($) {
'use strict';
$.fn.buttonEnabled = function (enabled) {
return enabled ? this.attr('disabled', '').removeAttr('disabled') : this.attr('disabled', 'disabled');
};
});
define(["jQuery"],function($){"use strict";$.fn.buttonEnabled=function(enabled){return enabled?this.attr("disabled","").removeAttr("disabled"):this.attr("disabled","disabled")}});

View File

@ -1,12 +1 @@
Dashboard.confirm = function (message, title, callback) {
'use strict';
require(['confirm'], function (confirm) {
confirm(message, title).then(function () {
callback(true);
}, function () {
callback(false);
});
});
};
Dashboard.confirm=function(message,title,callback){"use strict";require(["confirm"],function(confirm){confirm(message,title).then(function(){callback(!0)},function(){callback(!1)})})};

View File

@ -1,20 +1 @@
define(['jQuery'], function ($) {
'use strict';
// TODO: This needs to be deprecated, but it's used heavily
$.fn.checked = function (value) {
if (value === true || value === false) {
// Set the value of the checkbox
return $(this).each(function () {
this.checked = value;
});
} else {
// Return check state
return this.length && this[0].checked;
}
};
$.fn.checkboxradio = function () {
return this;
};
});
define(["jQuery"],function($){"use strict";$.fn.checked=function(value){return value===!0||value===!1?$(this).each(function(){this.checked=value}):this.length&&this[0].checked},$.fn.checkboxradio=function(){return this}});

View File

@ -1,9 +1 @@
define(['jQuery'], function ($) {
'use strict';
// TODO: This needs to be deprecated, but it's used heavily by plugins
$.fn.selectmenu = function () {
// No-op. This implementation only exists to prevent script errors
return this;
};
});
define(["jQuery"],function($){"use strict";$.fn.selectmenu=function(){return this}});

File diff suppressed because one or more lines are too long

View File

@ -1,106 +1 @@
define(['jQuery'], function ($) {
'use strict';
function reloadList(page) {
Dashboard.showLoadingMsg();
var promise1 = ApiClient.getAvailablePlugins({
TargetSystems: 'Server'
});
var promise2 = ApiClient.getInstalledPlugins();
Promise.all([promise1, promise2]).then(function (responses) {
renderInstalled(page, responses[0], responses[1]);
renderCatalog(page, responses[0], responses[1]);
});
}
function getCategories() {
var context = getParameterByName('context');
var categories = [];
if (context == 'sync') {
categories.push('Sync');
}
else if (context == 'livetv') {
categories.push('Live TV');
}
else if (context == 'notifications') {
categories.push('Notifications');
}
return categories;
}
function renderInstalled(page, availablePlugins, installedPlugins) {
requirejs(['scripts/pluginspage'], function() {
var category = getCategories()[0];
installedPlugins = installedPlugins.filter(function (i) {
var catalogEntry = availablePlugins.filter(function (a) {
return (a.guid || '').toLowerCase() == (i.Id || '').toLowerCase();
})[0];
if (catalogEntry) {
return catalogEntry.category == category;
}
return false;
});
PluginsPage.renderPlugins(page, installedPlugins);
});
}
function renderCatalog(page, availablePlugins, installedPlugins) {
requirejs(['scripts/plugincatalogpage'], function () {
var categories = getCategories();
PluginCatalog.renderCatalog({
catalogElement: $('.catalog', page),
availablePlugins: availablePlugins,
installedPlugins: installedPlugins,
categories: categories,
showCategory: false,
context: getParameterByName('context'),
targetSystem: 'Server'
});
});
}
$(document).on('pagebeforeshow pageshow', "#appServicesPage", function () {
// This needs both events for the helpurl to get done at the right time
var page = this;
var context = getParameterByName('context');
if (context == 'sync') {
LibraryMenu.setTitle(Globalize.translate('TitleSync'));
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Sync');
}
else if (context == 'livetv') {
LibraryMenu.setTitle(Globalize.translate('TitleLiveTV'));
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Live%20TV');
}
else if (context == 'notifications') {
LibraryMenu.setTitle(Globalize.translate('TitleNotifications'));
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Notifications');
}
}).on('pageshow', "#appServicesPage", function () {
var page = this;
reloadList(page);
});
});
define(["jQuery"],function($){"use strict";function reloadList(page){Dashboard.showLoadingMsg();var promise1=ApiClient.getAvailablePlugins({TargetSystems:"Server"}),promise2=ApiClient.getInstalledPlugins();Promise.all([promise1,promise2]).then(function(responses){renderInstalled(page,responses[0],responses[1]),renderCatalog(page,responses[0],responses[1])})}function getCategories(){var context=getParameterByName("context"),categories=[];return"sync"==context?categories.push("Sync"):"livetv"==context?categories.push("Live TV"):"notifications"==context&&categories.push("Notifications"),categories}function renderInstalled(page,availablePlugins,installedPlugins){requirejs(["scripts/pluginspage"],function(){var category=getCategories()[0];installedPlugins=installedPlugins.filter(function(i){var catalogEntry=availablePlugins.filter(function(a){return(a.guid||"").toLowerCase()==(i.Id||"").toLowerCase()})[0];return!!catalogEntry&&catalogEntry.category==category}),PluginsPage.renderPlugins(page,installedPlugins)})}function renderCatalog(page,availablePlugins,installedPlugins){requirejs(["scripts/plugincatalogpage"],function(){var categories=getCategories();PluginCatalog.renderCatalog({catalogElement:$(".catalog",page),availablePlugins:availablePlugins,installedPlugins:installedPlugins,categories:categories,showCategory:!1,context:getParameterByName("context"),targetSystem:"Server"})})}$(document).on("pagebeforeshow pageshow","#appServicesPage",function(){var page=this,context=getParameterByName("context");"sync"==context?(LibraryMenu.setTitle(Globalize.translate("TitleSync")),page.setAttribute("data-helpurl","https://github.com/MediaBrowser/Wiki/wiki/Sync")):"livetv"==context?(LibraryMenu.setTitle(Globalize.translate("TitleLiveTV")),page.setAttribute("data-helpurl","https://github.com/MediaBrowser/Wiki/wiki/Live%20TV")):"notifications"==context&&(LibraryMenu.setTitle(Globalize.translate("TitleNotifications")),page.setAttribute("data-helpurl","https://github.com/MediaBrowser/Wiki/wiki/Notifications"))}).on("pageshow","#appServicesPage",function(){var page=this;reloadList(page)})});

View File

@ -1,112 +1 @@
define(['backdrop', 'appStorage'], function (backdrop, appStorage) {
'use strict';
function enabled() {
var apiClient = window.ApiClient;
if (!apiClient) {
return false;
}
var userId = apiClient.getCurrentUserId();
var val = appStorage.getItem('enableBackdrops-' + userId);
// For bandwidth
return val == '1';
}
var cache = {};
function getBackdropItemIds(apiClient, userId, types, parentId) {
var key = 'backdrops2_' + userId + (types || '') + (parentId || '');
var data = cache[key];
if (data) {
console.log('Found backdrop id list in cache. Key: ' + key);
data = JSON.parse(data);
return Promise.resolve(data);
} else {
var options = {
SortBy: "IsFavoriteOrLiked,Random",
Limit: 20,
Recursive: true,
IncludeItemTypes: types,
ImageTypes: "Backdrop",
//Ids: "8114409aa00a2722456c08e298f90bed",
ParentId: parentId
};
return apiClient.getItems(apiClient.getCurrentUserId(), options).then(function (result) {
var images = result.Items.map(function (i) {
return {
Id: i.Id,
tag: i.BackdropImageTags[0],
ServerId: i.ServerId
};
});
cache[key] = JSON.stringify(images);
return images;
});
}
}
function showBackdrop(type, parentId) {
var apiClient = window.ApiClient;
if (!apiClient) {
return;
}
getBackdropItemIds(apiClient, apiClient.getCurrentUserId(), type, parentId).then(function (images) {
if (images.length) {
backdrop.setBackdrops(images.map(function (i) {
i.BackdropImageTags = [i.tag];
return i;
}));
} else {
backdrop.clear();
}
});
}
pageClassOn('pagebeforeshow', "page", function () {
var page = this;
// These pages self-manage their backdrops
if (page.classList.contains('selfBackdropPage')) {
return;
}
if (page.classList.contains('backdropPage')) {
if (enabled()) {
var type = page.getAttribute('data-backdroptype');
var parentId = page.classList.contains('globalBackdropPage') ? '' : LibraryMenu.getTopParentId();
showBackdrop(type, parentId);
} else {
page.classList.remove('backdropPage');
backdrop.clear();
}
} else {
backdrop.clear();
}
});
});
define(["backdrop","appStorage"],function(backdrop,appStorage){"use strict";function enabled(){var apiClient=window.ApiClient;if(!apiClient)return!1;var userId=apiClient.getCurrentUserId(),val=appStorage.getItem("enableBackdrops-"+userId);return"1"==val}function getBackdropItemIds(apiClient,userId,types,parentId){var key="backdrops2_"+userId+(types||"")+(parentId||""),data=cache[key];if(data)return console.log("Found backdrop id list in cache. Key: "+key),data=JSON.parse(data),Promise.resolve(data);var options={SortBy:"IsFavoriteOrLiked,Random",Limit:20,Recursive:!0,IncludeItemTypes:types,ImageTypes:"Backdrop",ParentId:parentId};return apiClient.getItems(apiClient.getCurrentUserId(),options).then(function(result){var images=result.Items.map(function(i){return{Id:i.Id,tag:i.BackdropImageTags[0],ServerId:i.ServerId}});return cache[key]=JSON.stringify(images),images})}function showBackdrop(type,parentId){var apiClient=window.ApiClient;apiClient&&getBackdropItemIds(apiClient,apiClient.getCurrentUserId(),type,parentId).then(function(images){images.length?backdrop.setBackdrops(images.map(function(i){return i.BackdropImageTags=[i.tag],i})):backdrop.clear()})}var cache={};pageClassOn("pagebeforeshow","page",function(){var page=this;if(!page.classList.contains("selfBackdropPage"))if(page.classList.contains("backdropPage"))if(enabled()){var type=page.getAttribute("data-backdroptype"),parentId=page.classList.contains("globalBackdropPage")?"":LibraryMenu.getTopParentId();showBackdrop(type,parentId)}else page.classList.remove("backdropPage"),backdrop.clear();else backdrop.clear()})});

View File

@ -1,73 +1 @@
define(['appSettings', 'emby-checkbox'], function (appSettings) {
'use strict';
function loadForm(page, user) {
var uploadServers = appSettings.cameraUploadServers();
page.querySelector('.uploadServerList').innerHTML = ConnectionManager.getSavedServers().map(function (s) {
var checkedHtml = uploadServers.indexOf(s.Id) == -1 ? '' : ' checked';
var html = '<label><input type="checkbox" is="emby-checkbox"' + checkedHtml + ' class="chkUploadServer" data-id="' + s.Id + '"/><span>' + s.Name + '</span></label>';
return html;
}).join('');
Dashboard.hideLoadingMsg();
}
function saveUser(page) {
var chkUploadServer = page.querySelectorAll('.chkUploadServer');
var cameraUploadServers = [];
for (var i = 0, length = chkUploadServer.length; i < length; i++) {
if (chkUploadServer[i].checked) {
cameraUploadServers.push(chkUploadServer[i].getAttribute('data-id'));
}
}
appSettings.cameraUploadServers(cameraUploadServers);
if (window.MainActivity) {
// TODO: isolate into android app
MainActivity.authorizeStorage();
}
Dashboard.hideLoadingMsg();
}
return function (view, params) {
view.querySelector('form').addEventListener('submit', function (e) {
Dashboard.showLoadingMsg();
saveUser(view);
// Disable default form submission
e.preventDefault();
return false;
});
view.addEventListener('viewshow', function () {
var page = this;
Dashboard.showLoadingMsg();
var userId = params.userId || Dashboard.getCurrentUserId();
ApiClient.getUser(userId).then(function (user) {
loadForm(page, user);
});
});
view.addEventListener('viewbeforehide', function () {
saveUser(this);
});
};
});
define(["appSettings","emby-checkbox"],function(appSettings){"use strict";function loadForm(page,user){var uploadServers=appSettings.cameraUploadServers();page.querySelector(".uploadServerList").innerHTML=ConnectionManager.getSavedServers().map(function(s){var checkedHtml=uploadServers.indexOf(s.Id)==-1?"":" checked",html='<label><input type="checkbox" is="emby-checkbox"'+checkedHtml+' class="chkUploadServer" data-id="'+s.Id+'"/><span>'+s.Name+"</span></label>";return html}).join(""),Dashboard.hideLoadingMsg()}function saveUser(page){for(var chkUploadServer=page.querySelectorAll(".chkUploadServer"),cameraUploadServers=[],i=0,length=chkUploadServer.length;i<length;i++)chkUploadServer[i].checked&&cameraUploadServers.push(chkUploadServer[i].getAttribute("data-id"));appSettings.cameraUploadServers(cameraUploadServers),window.MainActivity&&MainActivity.authorizeStorage(),Dashboard.hideLoadingMsg()}return function(view,params){view.querySelector("form").addEventListener("submit",function(e){return Dashboard.showLoadingMsg(),saveUser(view),e.preventDefault(),!1}),view.addEventListener("viewshow",function(){var page=this;Dashboard.showLoadingMsg();var userId=params.userId||Dashboard.getCurrentUserId();ApiClient.getUser(userId).then(function(user){loadForm(page,user)})}),view.addEventListener("viewbeforehide",function(){saveUser(this)})}});

View File

@ -1,264 +1 @@
define(['jQuery', 'cardBuilder', 'imageLoader', 'emby-itemscontainer'], function ($, cardBuilder, imageLoader) {
'use strict';
var data = {};
function getPageData(context) {
var key = getSavedQueryKey(context);
var pageData = data[key];
if (!pageData) {
pageData = data[key] = {
query: {
SortBy: "",
SortOrder: "Ascending",
Fields: "PrimaryImageAspectRatio",
StartIndex: 0,
Limit: LibraryBrowser.getDefaultPageSize()
}
};
LibraryBrowser.loadSavedQueryValues(key, pageData.query);
}
return pageData;
}
function getQuery(context) {
return getPageData(context).query;
}
function getSavedQueryKey(context) {
if (!context.savedQueryKey) {
context.savedQueryKey = LibraryBrowser.getSavedQueryKey('channelitems');
}
return context.savedQueryKey;
}
function getParam(context, name) {
if (!context.pageParams) {
context.pageParams = {};
}
if (!context.pageParams[name]) {
context.pageParams[name] = getParameterByName(name);
}
return context.pageParams[name];
}
function reloadFeatures(page) {
var channelId = getParam(page, 'id');
ApiClient.getJSON(ApiClient.getUrl("Channels/" + channelId + "/Features")).then(function (features) {
if (features.CanFilter) {
$('.filterControls', page).show();
} else {
$('.filterControls', page).hide();
}
if (features.SupportsSortOrderToggle) {
$('.sortOrderToggle', page).show();
} else {
$('.sortOrderToggle', page).hide();
}
var maxPageSize = features.MaxPageSize;
var query = getQuery(page);
if (maxPageSize) {
query.Limit = Math.min(maxPageSize, query.Limit || maxPageSize);
}
getPageData(page).sortFields = features.DefaultSortFields;
reloadItems(page);
});
}
function reloadItems(page) {
Dashboard.showLoadingMsg();
var channelId = getParam(page, 'id');
var folderId = getParam(page, 'folderId');
var query = getQuery(page);
query.UserId = Dashboard.getCurrentUserId();
if (folderId) {
ApiClient.getItem(query.UserId, folderId).then(function (item) {
LibraryMenu.setTitle(item.Name);
});
} else {
ApiClient.getItem(query.UserId, channelId).then(function (item) {
LibraryMenu.setTitle(item.Name);
});
}
query.folderId = folderId;
ApiClient.getJSON(ApiClient.getUrl("Channels/" + channelId + "/Items", query)).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);
var html = '';
var pagingHtml = LibraryBrowser.getQueryPagingHtml({
startIndex: query.StartIndex,
limit: query.Limit,
totalRecordCount: result.TotalRecordCount,
showLimit: false,
updatePageSizeSetting: false,
sortButton: true,
filterButton: true
});
updateFilterControls(page);
html = cardBuilder.getCardsHtml({
items: result.Items,
shape: "auto",
defaultShape: 'square',
context: 'channels',
showTitle: true,
coverImage: true,
showYear: true,
lazy: true,
centerText: true
});
var i, length;
var elems = page.querySelectorAll('.paging');
for (i = 0, length = elems.length; i < length; i++) {
elems[i].innerHTML = pagingHtml;
}
var elem = page.querySelector('#items');
elem.innerHTML = html;
imageLoader.lazyChildren(elem);
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', page).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
$('.btnFilter', page).on('click', function () {
showFilterMenu(page);
});
// On callback make sure to set StartIndex = 0
$('.btnSort', page).on('click', function () {
showSortMenu(page);
});
Dashboard.hideLoadingMsg();
}, function () {
Dashboard.hideLoadingMsg();
});
}
function showFilterMenu(page) {
require(['components/filterdialog/filterdialog'], function (filterDialogFactory) {
var filterDialog = new filterDialogFactory({
query: getQuery(page)
});
Events.on(filterDialog, 'filterchange', function () {
reloadItems(page);
});
filterDialog.show();
});
}
function showSortMenu(page) {
var sortFields = getPageData(page).sortFields;
var items = [];
items.push({
name: Globalize.translate('OptionDefaultSort'),
id: ''
});
if (sortFields.indexOf('Name') != -1) {
items.push({
name: Globalize.translate('OptionNameSort'),
id: 'SortName'
});
}
if (sortFields.indexOf('CommunityRating') != -1) {
items.push({
name: Globalize.translate('OptionCommunityRating'),
id: 'CommunityRating'
});
}
if (sortFields.indexOf('DateCreated') != -1) {
items.push({
name: Globalize.translate('OptionDateAdded'),
id: 'DateCreated'
});
}
if (sortFields.indexOf('PlayCount') != -1) {
items.push({
name: Globalize.translate('OptionPlayCount'),
id: 'PlayCount'
});
}
if (sortFields.indexOf('PremiereDate') != -1) {
items.push({
name: Globalize.translate('OptionReleaseDate'),
id: 'PremiereDate'
});
}
if (sortFields.indexOf('Runtime') != -1) {
items.push({
name: Globalize.translate('OptionRuntime'),
id: 'Runtime'
});
}
LibraryBrowser.showSortMenu({
items: items,
callback: function () {
reloadItems(page);
},
query: getQuery(page)
});
}
function updateFilterControls(page) {
}
pageIdOn('pagebeforeshow', "channelItemsPage", function () {
var page = this;
reloadFeatures(page);
updateFilterControls(page);
});
});
define(["jQuery","cardBuilder","imageLoader","emby-itemscontainer"],function($,cardBuilder,imageLoader){"use strict";function getPageData(context){var key=getSavedQueryKey(context),pageData=data[key];return pageData||(pageData=data[key]={query:{SortBy:"",SortOrder:"Ascending",Fields:"PrimaryImageAspectRatio",StartIndex:0,Limit:LibraryBrowser.getDefaultPageSize()}},LibraryBrowser.loadSavedQueryValues(key,pageData.query)),pageData}function getQuery(context){return getPageData(context).query}function getSavedQueryKey(context){return context.savedQueryKey||(context.savedQueryKey=LibraryBrowser.getSavedQueryKey("channelitems")),context.savedQueryKey}function getParam(context,name){return context.pageParams||(context.pageParams={}),context.pageParams[name]||(context.pageParams[name]=getParameterByName(name)),context.pageParams[name]}function reloadFeatures(page){var channelId=getParam(page,"id");ApiClient.getJSON(ApiClient.getUrl("Channels/"+channelId+"/Features")).then(function(features){features.CanFilter?$(".filterControls",page).show():$(".filterControls",page).hide(),features.SupportsSortOrderToggle?$(".sortOrderToggle",page).show():$(".sortOrderToggle",page).hide();var maxPageSize=features.MaxPageSize,query=getQuery(page);maxPageSize&&(query.Limit=Math.min(maxPageSize,query.Limit||maxPageSize)),getPageData(page).sortFields=features.DefaultSortFields,reloadItems(page)})}function reloadItems(page){Dashboard.showLoadingMsg();var channelId=getParam(page,"id"),folderId=getParam(page,"folderId"),query=getQuery(page);query.UserId=Dashboard.getCurrentUserId(),folderId?ApiClient.getItem(query.UserId,folderId).then(function(item){LibraryMenu.setTitle(item.Name)}):ApiClient.getItem(query.UserId,channelId).then(function(item){LibraryMenu.setTitle(item.Name)}),query.folderId=folderId,ApiClient.getJSON(ApiClient.getUrl("Channels/"+channelId+"/Items",query)).then(function(result){window.scrollTo(0,0);var html="",pagingHtml=LibraryBrowser.getQueryPagingHtml({startIndex:query.StartIndex,limit:query.Limit,totalRecordCount:result.TotalRecordCount,showLimit:!1,updatePageSizeSetting:!1,sortButton:!0,filterButton:!0});updateFilterControls(page),html=cardBuilder.getCardsHtml({items:result.Items,shape:"auto",defaultShape:"square",context:"channels",showTitle:!0,coverImage:!0,showYear:!0,lazy:!0,centerText:!0});var i,length,elems=page.querySelectorAll(".paging");for(i=0,length=elems.length;i<length;i++)elems[i].innerHTML=pagingHtml;var elem=page.querySelector("#items");elem.innerHTML=html,imageLoader.lazyChildren(elem),$(".btnNextPage",page).on("click",function(){query.StartIndex+=query.Limit,reloadItems(page)}),$(".btnPreviousPage",page).on("click",function(){query.StartIndex-=query.Limit,reloadItems(page)}),$(".btnFilter",page).on("click",function(){showFilterMenu(page)}),$(".btnSort",page).on("click",function(){showSortMenu(page)}),Dashboard.hideLoadingMsg()},function(){Dashboard.hideLoadingMsg()})}function showFilterMenu(page){require(["components/filterdialog/filterdialog"],function(filterDialogFactory){var filterDialog=new filterDialogFactory({query:getQuery(page)});Events.on(filterDialog,"filterchange",function(){reloadItems(page)}),filterDialog.show()})}function showSortMenu(page){var sortFields=getPageData(page).sortFields,items=[];items.push({name:Globalize.translate("OptionDefaultSort"),id:""}),sortFields.indexOf("Name")!=-1&&items.push({name:Globalize.translate("OptionNameSort"),id:"SortName"}),sortFields.indexOf("CommunityRating")!=-1&&items.push({name:Globalize.translate("OptionCommunityRating"),id:"CommunityRating"}),sortFields.indexOf("DateCreated")!=-1&&items.push({name:Globalize.translate("OptionDateAdded"),id:"DateCreated"}),sortFields.indexOf("PlayCount")!=-1&&items.push({name:Globalize.translate("OptionPlayCount"),id:"PlayCount"}),sortFields.indexOf("PremiereDate")!=-1&&items.push({name:Globalize.translate("OptionReleaseDate"),id:"PremiereDate"}),sortFields.indexOf("Runtime")!=-1&&items.push({name:Globalize.translate("OptionRuntime"),id:"Runtime"}),LibraryBrowser.showSortMenu({items:items,callback:function(){reloadItems(page)},query:getQuery(page)})}function updateFilterControls(page){}var data={};pageIdOn("pagebeforeshow","channelItemsPage",function(){var page=this;reloadFeatures(page),updateFilterControls(page)})});

View File

@ -1,97 +1 @@
define(['libraryBrowser', 'cardBuilder', 'imageLoader', 'emby-itemscontainer', 'emby-tabs', 'emby-button', 'scripts/channelslatest', 'scripts/sections'], function (libraryBrowser, cardBuilder, imageLoader) {
'use strict';
// The base query options
var query = {
StartIndex: 0
};
function reloadItems(page) {
Dashboard.showLoadingMsg();
query.UserId = Dashboard.getCurrentUserId();
ApiClient.getJSON(ApiClient.getUrl("Channels", query)).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);
var html = '';
var view = 'Thumb';
if (view == "Thumb") {
html = cardBuilder.getCardsHtml({
items: result.Items,
shape: "backdrop",
context: 'channels',
showTitle: true,
lazy: true,
centerText: true,
preferThumb: true
});
}
else if (view == "ThumbCard") {
html = cardBuilder.getCardsHtml({
items: result.Items,
shape: "backdrop",
preferThumb: true,
context: 'channels',
lazy: true,
cardLayout: true,
showTitle: true
});
}
var elem = page.querySelector('#items');
elem.innerHTML = html;
imageLoader.lazyChildren(elem);
libraryBrowser.saveQueryValues('channels', query);
Dashboard.hideLoadingMsg();
});
}
function loadTab(page, index) {
switch (index) {
case 1:
libraryBrowser.loadSavedQueryValues('channels', query);
reloadItems(page);
break;
default:
break;
}
}
return function (view, params) {
var self = this;
var viewTabs = view.querySelector('.libraryViewNav');
libraryBrowser.configurePaperLibraryTabs(view, viewTabs, view.querySelectorAll('.pageTabContent'), [0, 1]);
viewTabs.addEventListener('tabchange', function (e) {
loadTab(view, parseInt(e.detail.selectedTabIndex));
});
require(["headroom-window"], function (headroom) {
headroom.add(viewTabs);
self.headroom = headroom;
});
view.addEventListener('viewdestroy', function (e) {
if (self.headroom) {
self.headroom.remove(viewTabs);
}
});
};
});
define(["libraryBrowser","cardBuilder","imageLoader","emby-itemscontainer","emby-tabs","emby-button","scripts/channelslatest","scripts/sections"],function(libraryBrowser,cardBuilder,imageLoader){"use strict";function reloadItems(page){Dashboard.showLoadingMsg(),query.UserId=Dashboard.getCurrentUserId(),ApiClient.getJSON(ApiClient.getUrl("Channels",query)).then(function(result){window.scrollTo(0,0);var html="",view="Thumb";"Thumb"==view?html=cardBuilder.getCardsHtml({items:result.Items,shape:"backdrop",context:"channels",showTitle:!0,lazy:!0,centerText:!0,preferThumb:!0}):"ThumbCard"==view&&(html=cardBuilder.getCardsHtml({items:result.Items,shape:"backdrop",preferThumb:!0,context:"channels",lazy:!0,cardLayout:!0,showTitle:!0}));var elem=page.querySelector("#items");elem.innerHTML=html,imageLoader.lazyChildren(elem),libraryBrowser.saveQueryValues("channels",query),Dashboard.hideLoadingMsg()})}function loadTab(page,index){switch(index){case 1:libraryBrowser.loadSavedQueryValues("channels",query),reloadItems(page)}}var query={StartIndex:0};return function(view,params){var self=this,viewTabs=view.querySelector(".libraryViewNav");libraryBrowser.configurePaperLibraryTabs(view,viewTabs,view.querySelectorAll(".pageTabContent"),[0,1]),viewTabs.addEventListener("tabchange",function(e){loadTab(view,parseInt(e.detail.selectedTabIndex))}),require(["headroom-window"],function(headroom){headroom.add(viewTabs),self.headroom=headroom}),view.addEventListener("viewdestroy",function(e){self.headroom&&self.headroom.remove(viewTabs)})}});

View File

@ -1,38 +1 @@
define([], function () {
'use strict';
function reloadItems(page) {
Dashboard.showLoadingMsg();
Sections.loadLatestChannelItems(page.querySelector('.latestItems'), Dashboard.getCurrentUserId()).then(function() {
Dashboard.hideLoadingMsg();
}, function () {
Dashboard.hideLoadingMsg();
});
}
function loadTab(page, index) {
switch (index) {
case 0:
reloadItems(page);
break;
default:
break;
}
}
pageIdOn('pageinit', "channelsPage", function () {
var page = this;
var mdlTabs = page.querySelector('.libraryViewNav');
mdlTabs.addEventListener('tabchange', function (e) {
loadTab(page, parseInt(e.detail.selectedTabIndex));
});
});
});
define([],function(){"use strict";function reloadItems(page){Dashboard.showLoadingMsg(),Sections.loadLatestChannelItems(page.querySelector(".latestItems"),Dashboard.getCurrentUserId()).then(function(){Dashboard.hideLoadingMsg()},function(){Dashboard.hideLoadingMsg()})}function loadTab(page,index){switch(index){case 0:reloadItems(page)}}pageIdOn("pageinit","channelsPage",function(){var page=this,mdlTabs=page.querySelector(".libraryViewNav");mdlTabs.addEventListener("tabchange",function(e){loadTab(page,parseInt(e.detail.selectedTabIndex))})})});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,96 +1 @@
define(['jQuery'], function ($) {
'use strict';
function load(page, device, capabilities) {
if (capabilities.SupportsContentUploading) {
$('#fldCameraUploadPath', page).removeClass('hide');
} else {
$('#fldCameraUploadPath', page).addClass('hide');
}
$('#txtCustomName', page).val(device.CustomName || '');
$('#txtUploadPath', page).val(device.CameraUploadPath || '');
$('.reportedName', page).html(device.ReportedName || '');
}
function loadData(page) {
Dashboard.showLoadingMsg();
var id = getParameterByName('id');
var promise1 = ApiClient.getJSON(ApiClient.getUrl('Devices/Info', { Id: id }));
var promise2 = ApiClient.getJSON(ApiClient.getUrl('Devices/Capabilities', { Id: id }));
Promise.all([promise1, promise2]).then(function (responses) {
load(page, responses[0], responses[1]);
Dashboard.hideLoadingMsg();
});
}
function save(page) {
var id = getParameterByName('id');
ApiClient.ajax({
url: ApiClient.getUrl('Devices/Options', { Id: id }),
type: 'POST',
data: JSON.stringify({
CustomName: $('#txtCustomName', page).val(),
CameraUploadPath: $('#txtUploadPath', page).val()
}),
contentType: "application/json"
}).then(Dashboard.processServerConfigurationUpdateResult);
}
function onSubmit() {
var form = this;
var page = $(form).parents('.page');
save(page);
return false;
}
$(document).on('pageinit', "#devicePage", function () {
var page = this;
$('#btnSelectUploadPath', page).on("click.selectDirectory", function () {
require(['directorybrowser'], function (directoryBrowser) {
var picker = new directoryBrowser();
picker.show({
callback: function (path) {
if (path) {
$('#txtUploadPath', page).val(path);
}
picker.close();
},
header: Globalize.translate('HeaderSelectUploadPath')
});
});
});
$('.deviceForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshow', "#devicePage", function () {
var page = this;
loadData(page);
});
});
define(["jQuery"],function($){"use strict";function load(page,device,capabilities){capabilities.SupportsContentUploading?$("#fldCameraUploadPath",page).removeClass("hide"):$("#fldCameraUploadPath",page).addClass("hide"),$("#txtCustomName",page).val(device.CustomName||""),$("#txtUploadPath",page).val(device.CameraUploadPath||""),$(".reportedName",page).html(device.ReportedName||"")}function loadData(page){Dashboard.showLoadingMsg();var id=getParameterByName("id"),promise1=ApiClient.getJSON(ApiClient.getUrl("Devices/Info",{Id:id})),promise2=ApiClient.getJSON(ApiClient.getUrl("Devices/Capabilities",{Id:id}));Promise.all([promise1,promise2]).then(function(responses){load(page,responses[0],responses[1]),Dashboard.hideLoadingMsg()})}function save(page){var id=getParameterByName("id");ApiClient.ajax({url:ApiClient.getUrl("Devices/Options",{Id:id}),type:"POST",data:JSON.stringify({CustomName:$("#txtCustomName",page).val(),CameraUploadPath:$("#txtUploadPath",page).val()}),contentType:"application/json"}).then(Dashboard.processServerConfigurationUpdateResult)}function onSubmit(){var form=this,page=$(form).parents(".page");return save(page),!1}$(document).on("pageinit","#devicePage",function(){var page=this;$("#btnSelectUploadPath",page).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({callback:function(path){path&&$("#txtUploadPath",page).val(path),picker.close()},header:Globalize.translate("HeaderSelectUploadPath")})})}),$(".deviceForm").off("submit",onSubmit).on("submit",onSubmit)}).on("pageshow","#devicePage",function(){var page=this;loadData(page)})});

View File

@ -1,113 +1 @@
define(['jQuery', 'listViewStyle'], function ($) {
'use strict';
function deleteDevice(page, id) {
var msg = Globalize.translate('DeleteDeviceConfirmation');
require(['confirm'], function (confirm) {
confirm(msg, Globalize.translate('HeaderDeleteDevice')).then(function () {
Dashboard.showLoadingMsg();
ApiClient.ajax({
type: "DELETE",
url: ApiClient.getUrl('Devices', {
Id: id
})
}).then(function () {
loadData(page);
});
});
});
}
function load(page, devices) {
var html = '';
if (devices.length) {
html += '<div class="paperList">';
}
html += devices.map(function (d) {
var deviceHtml = '';
deviceHtml += '<div class="listItem">';
deviceHtml += '<i class="listItemIcon md-icon" style="background:#999;">tablet_android</i>';
if (d.AppName && d.LastUserName) {
deviceHtml += '<div class="listItemBody three-line">';
} else {
deviceHtml += '<div class="listItemBody two-line">';
}
deviceHtml += '<a class="clearLink" href="device.html?id=' + d.Id + '">';
deviceHtml += '<div class="listItemBodyText">';
deviceHtml += d.Name;
deviceHtml += '</div>';
if (d.AppName) {
deviceHtml += '<div class="listItemBodyText secondary">';
deviceHtml += d.AppName;
deviceHtml += '</div>';
}
if (d.LastUserName) {
deviceHtml += '<div class="listItemBodyText secondary">';
deviceHtml += Globalize.translate('DeviceLastUsedByUserName', d.LastUserName);
deviceHtml += '</div>';
}
deviceHtml += '</a>';
deviceHtml += '</div>';
deviceHtml += '<button type="button" is="paper-icon-button-light" class="btnDeleteDevice" data-id="' + d.Id + '" title="' + Globalize.translate('ButtonDelete') + '"><i class="md-icon">delete</i></button>';
deviceHtml += '</div>';
return deviceHtml;
}).join('');
if (devices.length) {
html += '</div>';
}
var elem = $('.devicesList', page).html(html).trigger('create');
$('.btnDeleteDevice', elem).on('click', function () {
deleteDevice(page, this.getAttribute('data-id'));
});
}
function loadData(page) {
Dashboard.showLoadingMsg();
ApiClient.getJSON(ApiClient.getUrl('Devices', {
SupportsPersistentIdentifier: true
})).then(function (result) {
load(page, result.Items);
Dashboard.hideLoadingMsg();
});
}
$(document).on('pageshow', "#devicesPage", function () {
var page = this;
loadData(page);
});
});
define(["jQuery","listViewStyle"],function($){"use strict";function deleteDevice(page,id){var msg=Globalize.translate("DeleteDeviceConfirmation");require(["confirm"],function(confirm){confirm(msg,Globalize.translate("HeaderDeleteDevice")).then(function(){Dashboard.showLoadingMsg(),ApiClient.ajax({type:"DELETE",url:ApiClient.getUrl("Devices",{Id:id})}).then(function(){loadData(page)})})})}function load(page,devices){var html="";devices.length&&(html+='<div class="paperList">'),html+=devices.map(function(d){var deviceHtml="";return deviceHtml+='<div class="listItem">',deviceHtml+='<i class="listItemIcon md-icon" style="background:#999;">tablet_android</i>',deviceHtml+=d.AppName&&d.LastUserName?'<div class="listItemBody three-line">':'<div class="listItemBody two-line">',deviceHtml+='<a class="clearLink" href="device.html?id='+d.Id+'">',deviceHtml+='<div class="listItemBodyText">',deviceHtml+=d.Name,deviceHtml+="</div>",d.AppName&&(deviceHtml+='<div class="listItemBodyText secondary">',deviceHtml+=d.AppName,deviceHtml+="</div>"),d.LastUserName&&(deviceHtml+='<div class="listItemBodyText secondary">',deviceHtml+=Globalize.translate("DeviceLastUsedByUserName",d.LastUserName),deviceHtml+="</div>"),deviceHtml+="</a>",deviceHtml+="</div>",deviceHtml+='<button type="button" is="paper-icon-button-light" class="btnDeleteDevice" data-id="'+d.Id+'" title="'+Globalize.translate("ButtonDelete")+'"><i class="md-icon">delete</i></button>',deviceHtml+="</div>"}).join(""),devices.length&&(html+="</div>");var elem=$(".devicesList",page).html(html).trigger("create");$(".btnDeleteDevice",elem).on("click",function(){deleteDevice(page,this.getAttribute("data-id"))})}function loadData(page){Dashboard.showLoadingMsg(),ApiClient.getJSON(ApiClient.getUrl("Devices",{SupportsPersistentIdentifier:!0})).then(function(result){load(page,result.Items),Dashboard.hideLoadingMsg()})}$(document).on("pageshow","#devicesPage",function(){var page=this;loadData(page)})});

File diff suppressed because one or more lines are too long

View File

@ -1,122 +1 @@
define(['jQuery', 'listViewStyle'], function ($) {
'use strict';
function loadProfiles(page) {
Dashboard.showLoadingMsg();
ApiClient.getJSON(ApiClient.getUrl("Dlna/ProfileInfos")).then(function (result) {
renderUserProfiles(page, result);
renderSystemProfiles(page, result);
Dashboard.hideLoadingMsg();
});
}
function renderUserProfiles(page, profiles) {
renderProfiles(page, page.querySelector('.customProfiles'), profiles.filter(function (p) {
return p.Type == 'User';
}));
}
function renderSystemProfiles(page, profiles) {
renderProfiles(page, page.querySelector('.systemProfiles'), profiles.filter(function (p) {
return p.Type == 'System';
}));
}
function renderProfiles(page, element, profiles) {
var html = '';
if (profiles.length) {
html += '<div class="paperList">';
}
for (var i = 0, length = profiles.length; i < length; i++) {
var profile = profiles[i];
html += '<div class="listItem">';
html += "<a item-icon class='clearLink listItemIconContainer' href='dlnaprofile.html?id=" + profile.Id + "'>";
html += '<i class="md-icon listItemIcon">dvr</i>';
html += "</a>";
html += '<div class="listItemBody">';
html += "<a class='clearLink' href='dlnaprofile.html?id=" + profile.Id + "'>";
html += "<div>" + profile.Name + "</div>";
//html += "<div secondary>" + task.Description + "</div>";
html += "</a>";
html += '</div>';
if (profile.Type == 'User') {
html += '<button type="button" is="paper-icon-button-light" class="btnDeleteProfile" data-profileid="' + profile.Id + '" title="' + Globalize.translate('ButtonDelete') + '"><i class="md-icon">delete</i></button>';
}
html += '</div>';
}
if (profiles.length) {
html += '</div>';
}
element.innerHTML = html;
$('.btnDeleteProfile', element).on('click', function () {
var id = this.getAttribute('data-profileid');
deleteProfile(page, id);
});
}
function deleteProfile(page, id) {
require(['confirm'], function (confirm) {
confirm(Globalize.translate('MessageConfirmProfileDeletion'), Globalize.translate('HeaderConfirmProfileDeletion')).then(function () {
Dashboard.showLoadingMsg();
ApiClient.ajax({
type: "DELETE",
url: ApiClient.getUrl("Dlna/Profiles/" + id)
}).then(function () {
Dashboard.hideLoadingMsg();
loadProfiles(page);
});
});
});
}
function getTabs() {
return [
{
href: 'dlnasettings.html',
name: Globalize.translate('TabSettings')
},
{
href: 'dlnaprofiles.html',
name: Globalize.translate('TabProfiles')
}];
}
$(document).on('pageshow', "#dlnaProfilesPage", function () {
LibraryMenu.setTabs('dlna', 1, getTabs);
var page = this;
loadProfiles(page);
});
});
define(["jQuery","listViewStyle"],function($){"use strict";function loadProfiles(page){Dashboard.showLoadingMsg(),ApiClient.getJSON(ApiClient.getUrl("Dlna/ProfileInfos")).then(function(result){renderUserProfiles(page,result),renderSystemProfiles(page,result),Dashboard.hideLoadingMsg()})}function renderUserProfiles(page,profiles){renderProfiles(page,page.querySelector(".customProfiles"),profiles.filter(function(p){return"User"==p.Type}))}function renderSystemProfiles(page,profiles){renderProfiles(page,page.querySelector(".systemProfiles"),profiles.filter(function(p){return"System"==p.Type}))}function renderProfiles(page,element,profiles){var html="";profiles.length&&(html+='<div class="paperList">');for(var i=0,length=profiles.length;i<length;i++){var profile=profiles[i];html+='<div class="listItem">',html+="<a item-icon class='clearLink listItemIconContainer' href='dlnaprofile.html?id="+profile.Id+"'>",html+='<i class="md-icon listItemIcon">dvr</i>',html+="</a>",html+='<div class="listItemBody">',html+="<a class='clearLink' href='dlnaprofile.html?id="+profile.Id+"'>",html+="<div>"+profile.Name+"</div>",html+="</a>",html+="</div>","User"==profile.Type&&(html+='<button type="button" is="paper-icon-button-light" class="btnDeleteProfile" data-profileid="'+profile.Id+'" title="'+Globalize.translate("ButtonDelete")+'"><i class="md-icon">delete</i></button>'),html+="</div>"}profiles.length&&(html+="</div>"),element.innerHTML=html,$(".btnDeleteProfile",element).on("click",function(){var id=this.getAttribute("data-profileid");deleteProfile(page,id)})}function deleteProfile(page,id){require(["confirm"],function(confirm){confirm(Globalize.translate("MessageConfirmProfileDeletion"),Globalize.translate("HeaderConfirmProfileDeletion")).then(function(){Dashboard.showLoadingMsg(),ApiClient.ajax({type:"DELETE",url:ApiClient.getUrl("Dlna/Profiles/"+id)}).then(function(){Dashboard.hideLoadingMsg(),loadProfiles(page)})})})}function getTabs(){return[{href:"dlnasettings.html",name:Globalize.translate("TabSettings")},{href:"dlnaprofiles.html",name:Globalize.translate("TabProfiles")}]}$(document).on("pageshow","#dlnaProfilesPage",function(){LibraryMenu.setTabs("dlna",1,getTabs);var page=this;loadProfiles(page)})});

View File

@ -1,83 +1 @@
define(['jQuery', 'fnchecked'], function ($) {
'use strict';
function loadPage(page, config, users) {
page.querySelector('#chkEnablePlayTo').checked = config.EnablePlayTo;
page.querySelector('#chkEnableDlnaDebugLogging').checked = config.EnableDebugLog;
$('#txtClientDiscoveryInterval', page).val(config.ClientDiscoveryIntervalSeconds);
$('#chkEnableServer', page).checked(config.EnableServer);
$('#chkBlastAliveMessages', page).checked(config.BlastAliveMessages);
$('#txtBlastInterval', page).val(config.BlastAliveMessageIntervalSeconds);
var usersHtml = users.map(function (u) {
return '<option value="' + u.Id + '">' + u.Name + '</option>';
}).join('');
$('#selectUser', page).html(usersHtml).val(config.DefaultUserId || '');
Dashboard.hideLoadingMsg();
}
function onSubmit() {
Dashboard.showLoadingMsg();
var form = this;
ApiClient.getNamedConfiguration("dlna").then(function (config) {
config.EnablePlayTo = form.querySelector('#chkEnablePlayTo').checked;
config.EnableDebugLog = form.querySelector('#chkEnableDlnaDebugLogging').checked;
config.ClientDiscoveryIntervalSeconds = $('#txtClientDiscoveryInterval', form).val();
config.EnableServer = $('#chkEnableServer', form).checked();
config.BlastAliveMessages = $('#chkBlastAliveMessages', form).checked();
config.BlastAliveMessageIntervalSeconds = $('#txtBlastInterval', form).val();
config.DefaultUserId = $('#selectUser', form).val();
ApiClient.updateNamedConfiguration("dlna", config).then(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
return false;
}
function getTabs() {
return [
{
href: 'dlnasettings.html',
name: Globalize.translate('TabSettings')
},
{
href: 'dlnaprofiles.html',
name: Globalize.translate('TabProfiles')
}];
}
$(document).on('pageinit', "#dlnaSettingsPage", function () {
$('.dlnaSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshow', "#dlnaSettingsPage", function () {
LibraryMenu.setTabs('dlna', 0, getTabs);
Dashboard.showLoadingMsg();
var page = this;
var promise1 = ApiClient.getNamedConfiguration("dlna");
var promise2 = ApiClient.getUsers();
Promise.all([promise1, promise2]).then(function (responses) {
loadPage(page, responses[0], responses[1]);
});
});
});
define(["jQuery","fnchecked"],function($){"use strict";function loadPage(page,config,users){page.querySelector("#chkEnablePlayTo").checked=config.EnablePlayTo,page.querySelector("#chkEnableDlnaDebugLogging").checked=config.EnableDebugLog,$("#txtClientDiscoveryInterval",page).val(config.ClientDiscoveryIntervalSeconds),$("#chkEnableServer",page).checked(config.EnableServer),$("#chkBlastAliveMessages",page).checked(config.BlastAliveMessages),$("#txtBlastInterval",page).val(config.BlastAliveMessageIntervalSeconds);var usersHtml=users.map(function(u){return'<option value="'+u.Id+'">'+u.Name+"</option>"}).join("");$("#selectUser",page).html(usersHtml).val(config.DefaultUserId||""),Dashboard.hideLoadingMsg()}function onSubmit(){Dashboard.showLoadingMsg();var form=this;return ApiClient.getNamedConfiguration("dlna").then(function(config){config.EnablePlayTo=form.querySelector("#chkEnablePlayTo").checked,config.EnableDebugLog=form.querySelector("#chkEnableDlnaDebugLogging").checked,config.ClientDiscoveryIntervalSeconds=$("#txtClientDiscoveryInterval",form).val(),config.EnableServer=$("#chkEnableServer",form).checked(),config.BlastAliveMessages=$("#chkBlastAliveMessages",form).checked(),config.BlastAliveMessageIntervalSeconds=$("#txtBlastInterval",form).val(),config.DefaultUserId=$("#selectUser",form).val(),ApiClient.updateNamedConfiguration("dlna",config).then(Dashboard.processServerConfigurationUpdateResult)}),!1}function getTabs(){return[{href:"dlnasettings.html",name:Globalize.translate("TabSettings")},{href:"dlnaprofiles.html",name:Globalize.translate("TabProfiles")}]}$(document).on("pageinit","#dlnaSettingsPage",function(){$(".dlnaSettingsForm").off("submit",onSubmit).on("submit",onSubmit)}).on("pageshow","#dlnaSettingsPage",function(){LibraryMenu.setTabs("dlna",0,getTabs),Dashboard.showLoadingMsg();var page=this,promise1=ApiClient.getNamedConfiguration("dlna"),promise2=ApiClient.getUsers();Promise.all([promise1,promise2]).then(function(responses){loadPage(page,responses[0],responses[1])})})});

View File

@ -1,38 +1 @@
define(['loading'], function (loading) {
'use strict';
function reload(context, itemId) {
loading.show();
if (itemId) {
require(['metadataEditor'], function (metadataEditor) {
metadataEditor.embed(context.querySelector('.editPageInnerContent'), itemId, ApiClient.serverInfo().Id);
});
} else {
context.querySelector('.editPageInnerContent').innerHTML = '';
loading.hide();
}
}
return function (view, params) {
view.addEventListener('viewshow', function () {
reload(this, MetadataEditor.getCurrentItemId());
});
MetadataEditor.setCurrentItemId(null);
view.querySelector('.libraryTree').addEventListener('itemclicked', function (event) {
var data = event.detail;
if (data.id != MetadataEditor.getCurrentItemId()) {
MetadataEditor.setCurrentItemId(data.id);
reload(view, data.id);
}
});
};
});
define(["loading"],function(loading){"use strict";function reload(context,itemId){loading.show(),itemId?require(["metadataEditor"],function(metadataEditor){metadataEditor.embed(context.querySelector(".editPageInnerContent"),itemId,ApiClient.serverInfo().Id)}):(context.querySelector(".editPageInnerContent").innerHTML="",loading.hide())}return function(view,params){view.addEventListener("viewshow",function(){reload(this,MetadataEditor.getCurrentItemId())}),MetadataEditor.setCurrentItemId(null),view.querySelector(".libraryTree").addEventListener("itemclicked",function(event){var data=event.detail;data.id!=MetadataEditor.getCurrentItemId()&&(MetadataEditor.setCurrentItemId(data.id),reload(view,data.id))})}});

File diff suppressed because one or more lines are too long

View File

@ -1,203 +1 @@
define(['jQuery'], function ($) {
'use strict';
function loadPage(page, config, systemInfo) {
page.querySelector('#chkEnableThrottle').checked = config.EnableThrottling;
$('#selectVideoDecoder', page).val(config.HardwareAccelerationType);
$('#selectThreadCount', page).val(config.EncodingThreadCount);
$('#txtDownMixAudioBoost', page).val(config.DownMixAudioBoost);
page.querySelector('.txtEncoderPath').value = config.EncoderAppPath || '';
$('#txtTranscodingTempPath', page).val(config.TranscodingTempPath || '');
$('#txtVaapiDevice', page).val(config.VaapiDevice || '');
page.querySelector('#selectH264Preset').value = config.H264Preset || '';
page.querySelector('#txtH264Crf').value = config.H264Crf || '';
var selectEncoderPath = page.querySelector('#selectEncoderPath');
selectEncoderPath.value = systemInfo.EncoderLocationType;
onSelectEncoderPathChange.call(selectEncoderPath);
page.querySelector('#selectVideoDecoder').dispatchEvent(new CustomEvent('change', {
bubbles: true
}));
Dashboard.hideLoadingMsg();
}
function onSaveEncodingPathFailure(response) {
Dashboard.hideLoadingMsg();
var msg = '';
// This is a fallback that handles both 404 and 400 (no path entered)
msg = Globalize.translate('FFmpegSavePathNotFound');
require(['alert'], function (alert) {
alert(msg);
});
}
function updateEncoder(form) {
return ApiClient.getSystemInfo().then(function (systemInfo) {
return ApiClient.ajax({
url: ApiClient.getUrl('System/MediaEncoder/Path'),
type: 'POST',
data: {
Path: form.querySelector('.txtEncoderPath').value,
PathType: form.querySelector('#selectEncoderPath').value
}
}).then(Dashboard.processServerConfigurationUpdateResult, onSaveEncodingPathFailure);
});
}
function onSubmit() {
var form = this;
var onDecoderConfirmed = function () {
Dashboard.showLoadingMsg();
ApiClient.getNamedConfiguration("encoding").then(function (config) {
config.DownMixAudioBoost = $('#txtDownMixAudioBoost', form).val();
config.TranscodingTempPath = $('#txtTranscodingTempPath', form).val();
config.EncodingThreadCount = $('#selectThreadCount', form).val();
config.HardwareAccelerationType = $('#selectVideoDecoder', form).val();
config.VaapiDevice = $('#txtVaapiDevice', form).val();
config.H264Preset = form.querySelector('#selectH264Preset').value;
config.H264Crf = parseInt(form.querySelector('#txtH264Crf').value || '0');
config.EnableThrottling = form.querySelector('#chkEnableThrottle').checked;
ApiClient.updateNamedConfiguration("encoding", config).then(function () {
updateEncoder(form);
});
});
};
if ($('#selectVideoDecoder', form).val()) {
require(['alert'], function (alert) {
alert({
title: Globalize.translate('TitleHardwareAcceleration'),
text: Globalize.translate('HardwareAccelerationWarning')
}).then(onDecoderConfirmed);
});
} else {
onDecoderConfirmed();
}
// Disable default form submission
return false;
}
function onSelectEncoderPathChange(e) {
var page = $(this).parents('.page')[0];
if (this.value == 'Custom') {
page.querySelector('.fldEncoderPath').classList.remove('hide');
page.querySelector('.txtEncoderPath').setAttribute('required', 'required');
} else {
page.querySelector('.fldEncoderPath').classList.add('hide');
page.querySelector('.txtEncoderPath').removeAttribute('required');
}
}
$(document).on('pageinit', "#encodingSettingsPage", function () {
var page = this;
page.querySelector('#selectVideoDecoder').addEventListener('change', function () {
if (this.value == 'vaapi') {
page.querySelector('.fldVaapiDevice').classList.remove('hide');
page.querySelector('#txtVaapiDevice').setAttribute('required', 'required');
} else {
page.querySelector('.fldVaapiDevice').classList.add('hide');
page.querySelector('#txtVaapiDevice').removeAttribute('required');
}
});
$('#btnSelectEncoderPath', page).on("click.selectDirectory", function () {
require(['directorybrowser'], function (directoryBrowser) {
var picker = new directoryBrowser();
picker.show({
includeFiles: true,
callback: function (path) {
if (path) {
$('.txtEncoderPath', page).val(path);
}
picker.close();
}
});
});
});
$('#btnSelectTranscodingTempPath', page).on("click.selectDirectory", function () {
require(['directorybrowser'], function (directoryBrowser) {
var picker = new directoryBrowser();
picker.show({
callback: function (path) {
if (path) {
$('#txtTranscodingTempPath', page).val(path);
}
picker.close();
},
header: Globalize.translate('HeaderSelectTranscodingPath'),
instruction: Globalize.translate('HeaderSelectTranscodingPathHelp')
});
});
});
$('.encodingSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
page.querySelector('#selectEncoderPath').addEventListener('change', onSelectEncoderPathChange);
}).on('pageshow', "#encodingSettingsPage", function () {
Dashboard.showLoadingMsg();
var page = this;
ApiClient.getNamedConfiguration("encoding").then(function (config) {
ApiClient.getSystemInfo().then(function (systemInfo) {
if (systemInfo.EncoderLocationType == "External") {
page.querySelector('.fldSelectEncoderPathType').classList.add('hide');
} else {
page.querySelector('.fldSelectEncoderPathType').classList.remove('hide');
}
loadPage(page, config, systemInfo);
});
});
});
});
define(["jQuery"],function($){"use strict";function loadPage(page,config,systemInfo){page.querySelector("#chkEnableThrottle").checked=config.EnableThrottling,$("#selectVideoDecoder",page).val(config.HardwareAccelerationType),$("#selectThreadCount",page).val(config.EncodingThreadCount),$("#txtDownMixAudioBoost",page).val(config.DownMixAudioBoost),page.querySelector(".txtEncoderPath").value=config.EncoderAppPath||"",$("#txtTranscodingTempPath",page).val(config.TranscodingTempPath||""),$("#txtVaapiDevice",page).val(config.VaapiDevice||""),page.querySelector("#selectH264Preset").value=config.H264Preset||"",page.querySelector("#txtH264Crf").value=config.H264Crf||"";var selectEncoderPath=page.querySelector("#selectEncoderPath");selectEncoderPath.value=systemInfo.EncoderLocationType,onSelectEncoderPathChange.call(selectEncoderPath),page.querySelector("#selectVideoDecoder").dispatchEvent(new CustomEvent("change",{bubbles:!0})),Dashboard.hideLoadingMsg()}function onSaveEncodingPathFailure(response){Dashboard.hideLoadingMsg();var msg="";msg=Globalize.translate("FFmpegSavePathNotFound"),require(["alert"],function(alert){alert(msg)})}function updateEncoder(form){return ApiClient.getSystemInfo().then(function(systemInfo){return ApiClient.ajax({url:ApiClient.getUrl("System/MediaEncoder/Path"),type:"POST",data:{Path:form.querySelector(".txtEncoderPath").value,PathType:form.querySelector("#selectEncoderPath").value}}).then(Dashboard.processServerConfigurationUpdateResult,onSaveEncodingPathFailure)})}function onSubmit(){var form=this,onDecoderConfirmed=function(){Dashboard.showLoadingMsg(),ApiClient.getNamedConfiguration("encoding").then(function(config){config.DownMixAudioBoost=$("#txtDownMixAudioBoost",form).val(),config.TranscodingTempPath=$("#txtTranscodingTempPath",form).val(),config.EncodingThreadCount=$("#selectThreadCount",form).val(),config.HardwareAccelerationType=$("#selectVideoDecoder",form).val(),config.VaapiDevice=$("#txtVaapiDevice",form).val(),config.H264Preset=form.querySelector("#selectH264Preset").value,config.H264Crf=parseInt(form.querySelector("#txtH264Crf").value||"0"),config.EnableThrottling=form.querySelector("#chkEnableThrottle").checked,ApiClient.updateNamedConfiguration("encoding",config).then(function(){updateEncoder(form)})})};return $("#selectVideoDecoder",form).val()?require(["alert"],function(alert){alert({title:Globalize.translate("TitleHardwareAcceleration"),text:Globalize.translate("HardwareAccelerationWarning")}).then(onDecoderConfirmed)}):onDecoderConfirmed(),!1}function onSelectEncoderPathChange(e){var page=$(this).parents(".page")[0];"Custom"==this.value?(page.querySelector(".fldEncoderPath").classList.remove("hide"),page.querySelector(".txtEncoderPath").setAttribute("required","required")):(page.querySelector(".fldEncoderPath").classList.add("hide"),page.querySelector(".txtEncoderPath").removeAttribute("required"))}$(document).on("pageinit","#encodingSettingsPage",function(){var page=this;page.querySelector("#selectVideoDecoder").addEventListener("change",function(){"vaapi"==this.value?(page.querySelector(".fldVaapiDevice").classList.remove("hide"),page.querySelector("#txtVaapiDevice").setAttribute("required","required")):(page.querySelector(".fldVaapiDevice").classList.add("hide"),page.querySelector("#txtVaapiDevice").removeAttribute("required"))}),$("#btnSelectEncoderPath",page).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({includeFiles:!0,callback:function(path){path&&$(".txtEncoderPath",page).val(path),picker.close()}})})}),$("#btnSelectTranscodingTempPath",page).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({callback:function(path){path&&$("#txtTranscodingTempPath",page).val(path),picker.close()},header:Globalize.translate("HeaderSelectTranscodingPath"),instruction:Globalize.translate("HeaderSelectTranscodingPathHelp")})})}),$(".encodingSettingsForm").off("submit",onSubmit).on("submit",onSubmit),page.querySelector("#selectEncoderPath").addEventListener("change",onSelectEncoderPathChange)}).on("pageshow","#encodingSettingsPage",function(){Dashboard.showLoadingMsg();var page=this;ApiClient.getNamedConfiguration("encoding").then(function(config){ApiClient.getSystemInfo().then(function(systemInfo){"External"==systemInfo.EncoderLocationType?page.querySelector(".fldSelectEncoderPathType").classList.add("hide"):page.querySelector(".fldSelectEncoderPathType").classList.remove("hide"),loadPage(page,config,systemInfo)})})})});

File diff suppressed because one or more lines are too long

View File

@ -1,20 +1 @@
define(['components/favoriteitems'], function (favoriteItems) {
'use strict';
return function (view, params) {
var self = this;
view.addEventListener('viewshow', function (e) {
var isRestored = e.detail.isRestored;
if (!isRestored) {
var parentId = null;
favoriteItems.render(view, Dashboard.getCurrentUserId(), parentId);
}
});
};
});
define(["components/favoriteitems"],function(favoriteItems){"use strict";return function(view,params){view.addEventListener("viewshow",function(e){var isRestored=e.detail.isRestored;if(!isRestored){var parentId=null;favoriteItems.render(view,Dashboard.getCurrentUserId(),parentId)}})}});

View File

@ -1,66 +1 @@
define([], function () {
'use strict';
function processForgotPasswordResult(result) {
if (result.Action == 'ContactAdmin') {
Dashboard.alert({
message: Globalize.translate('MessageContactAdminToResetPassword'),
title: Globalize.translate('HeaderForgotPassword')
});
return;
}
if (result.Action == 'InNetworkRequired') {
Dashboard.alert({
message: Globalize.translate('MessageForgotPasswordInNetworkRequired'),
title: Globalize.translate('HeaderForgotPassword')
});
return;
}
if (result.Action == 'PinCode') {
var msg = Globalize.translate('MessageForgotPasswordFileCreated');
msg += "<br/>";
msg += "<br/>";
msg += result.PinFile;
msg += "<br/>";
Dashboard.alert({
message: msg,
title: Globalize.translate('HeaderForgotPassword')
});
return;
}
}
return function (view, params) {
function onSubmit(e) {
ApiClient.ajax({
type: 'POST',
url: ApiClient.getUrl('Users/ForgotPassword'),
dataType: 'json',
data: {
EnteredUsername: view.querySelector('#txtName').value
}
}).then(processForgotPasswordResult);
e.preventDefault();
return false;
}
view.querySelector('form').addEventListener('submit', onSubmit);
};
});
define([],function(){"use strict";function processForgotPasswordResult(result){if("ContactAdmin"==result.Action)return void Dashboard.alert({message:Globalize.translate("MessageContactAdminToResetPassword"),title:Globalize.translate("HeaderForgotPassword")});if("InNetworkRequired"==result.Action)return void Dashboard.alert({message:Globalize.translate("MessageForgotPasswordInNetworkRequired"),title:Globalize.translate("HeaderForgotPassword")});if("PinCode"==result.Action){var msg=Globalize.translate("MessageForgotPasswordFileCreated");return msg+="<br/>",msg+="<br/>",msg+=result.PinFile,msg+="<br/>",void Dashboard.alert({message:msg,title:Globalize.translate("HeaderForgotPassword")})}}return function(view,params){function onSubmit(e){return ApiClient.ajax({type:"POST",url:ApiClient.getUrl("Users/ForgotPassword"),dataType:"json",data:{EnteredUsername:view.querySelector("#txtName").value}}).then(processForgotPasswordResult),e.preventDefault(),!1}view.querySelector("form").addEventListener("submit",onSubmit)}});

View File

@ -1,56 +1 @@
define([], function () {
'use strict';
function processForgotPasswordResult(result) {
if (result.Success) {
var msg = Globalize.translate('MessagePasswordResetForUsers');
msg += '<br/>';
msg += '<br/>';
msg += result.UsersReset.join('<br/>');
Dashboard.alert({
message: msg,
title: Globalize.translate('HeaderPasswordReset'),
callback: function () {
window.location.href = 'login.html';
}
});
return;
}
Dashboard.alert({
message: Globalize.translate('MessageInvalidForgotPasswordPin'),
title: Globalize.translate('HeaderPasswordReset')
});
return;
}
return function (view, params) {
function onSubmit(e) {
ApiClient.ajax({
type: 'POST',
url: ApiClient.getUrl('Users/ForgotPassword/Pin'),
dataType: 'json',
data: {
Pin: view.querySelector('#txtPin').value
}
}).then(processForgotPasswordResult);
e.preventDefault();
return false;
}
view.querySelector('form').addEventListener('submit', onSubmit);
};
});
define([],function(){"use strict";function processForgotPasswordResult(result){if(result.Success){var msg=Globalize.translate("MessagePasswordResetForUsers");return msg+="<br/>",msg+="<br/>",msg+=result.UsersReset.join("<br/>"),void Dashboard.alert({message:msg,title:Globalize.translate("HeaderPasswordReset"),callback:function(){window.location.href="login.html"}})}Dashboard.alert({message:Globalize.translate("MessageInvalidForgotPasswordPin"),title:Globalize.translate("HeaderPasswordReset")})}return function(view,params){function onSubmit(e){return ApiClient.ajax({type:"POST",url:ApiClient.getUrl("Users/ForgotPassword/Pin"),dataType:"json",data:{Pin:view.querySelector("#txtPin").value}}).then(processForgotPasswordResult),e.preventDefault(),!1}view.querySelector("form").addEventListener("submit",onSubmit)}});

View File

@ -1,84 +1 @@
define(['jQuery', 'imageLoader'], function ($, imageLoader) {
'use strict';
// The base query options
var query = {
SortBy: "SortName",
SortOrder: "Ascending",
Recursive: true,
Fields: "DateCreated,ItemCounts",
StartIndex: 0
};
function getSavedQueryKey() {
return LibraryBrowser.getSavedQueryKey();
}
function reloadItems(page) {
Dashboard.showLoadingMsg();
ApiClient.getGameGenres(Dashboard.getCurrentUserId(), query).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);
var html = '';
$('.listTopPaging', page).html(LibraryBrowser.getQueryPagingHtml({
startIndex: query.StartIndex,
limit: query.Limit,
totalRecordCount: result.TotalRecordCount,
showLimit: false
}));
html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "backdrop",
preferThumb: true,
context: 'games',
showItemCounts: true,
centerText: true,
lazy: true
});
var elem = page.querySelector('#items');
elem.innerHTML = html;
imageLoader.lazyChildren(elem);
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', page).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
LibraryBrowser.saveQueryValues(getSavedQueryKey(), query);
Dashboard.hideLoadingMsg();
});
}
$(document).on('pagebeforeshow', "#gameGenresPage", function () {
query.ParentId = LibraryMenu.getTopParentId();
var limit = LibraryBrowser.getDefaultPageSize();
// If the default page size has changed, the start index will have to be reset
if (limit != query.Limit) {
query.Limit = limit;
query.StartIndex = 0;
}
LibraryBrowser.loadSavedQueryValues(getSavedQueryKey(), query);
reloadItems(this);
});
});
define(["jQuery","imageLoader"],function($,imageLoader){"use strict";function getSavedQueryKey(){return LibraryBrowser.getSavedQueryKey()}function reloadItems(page){Dashboard.showLoadingMsg(),ApiClient.getGameGenres(Dashboard.getCurrentUserId(),query).then(function(result){window.scrollTo(0,0);var html="";$(".listTopPaging",page).html(LibraryBrowser.getQueryPagingHtml({startIndex:query.StartIndex,limit:query.Limit,totalRecordCount:result.TotalRecordCount,showLimit:!1})),html=LibraryBrowser.getPosterViewHtml({items:result.Items,shape:"backdrop",preferThumb:!0,context:"games",showItemCounts:!0,centerText:!0,lazy:!0});var elem=page.querySelector("#items");elem.innerHTML=html,imageLoader.lazyChildren(elem),$(".btnNextPage",page).on("click",function(){query.StartIndex+=query.Limit,reloadItems(page)}),$(".btnPreviousPage",page).on("click",function(){query.StartIndex-=query.Limit,reloadItems(page)}),LibraryBrowser.saveQueryValues(getSavedQueryKey(),query),Dashboard.hideLoadingMsg()})}var query={SortBy:"SortName",SortOrder:"Ascending",Recursive:!0,Fields:"DateCreated,ItemCounts",StartIndex:0};$(document).on("pagebeforeshow","#gameGenresPage",function(){query.ParentId=LibraryMenu.getTopParentId();var limit=LibraryBrowser.getDefaultPageSize();limit!=query.Limit&&(query.Limit=limit,query.StartIndex=0),LibraryBrowser.loadSavedQueryValues(getSavedQueryKey(),query),reloadItems(this)})});

View File

@ -1,186 +1 @@
define(['jQuery', 'listView', 'imageLoader'], function ($, listView, imageLoader) {
'use strict';
var data = {};
function getPageData(context) {
var key = getSavedQueryKey(context);
var pageData = data[key];
if (!pageData) {
pageData = data[key] = {
query: {
SortBy: "SortName",
SortOrder: "Ascending",
MediaTypes: "Game",
Recursive: true,
Fields: "Genres,Studios,PrimaryImageAspectRatio,SortName",
ImageTypeLimit: 1,
EnableImageTypes: "Primary,Backdrop,Banner,Thumb",
StartIndex: 0,
Limit: LibraryBrowser.getDefaultPageSize()
},
view: LibraryBrowser.getSavedView(key) || 'Poster'
};
pageData.query.ParentId = LibraryMenu.getTopParentId();
LibraryBrowser.loadSavedQueryValues(key, pageData.query);
}
return pageData;
}
function getQuery(context) {
return getPageData(context).query;
}
function getSavedQueryKey(context) {
if (!context.savedQueryKey) {
context.savedQueryKey = LibraryBrowser.getSavedQueryKey('games');
}
return context.savedQueryKey;
}
function reloadItems(page) {
Dashboard.showLoadingMsg();
var query = getQuery(page);
ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);
var html = '';
$('.listTopPaging', page).html(LibraryBrowser.getQueryPagingHtml({
startIndex: query.StartIndex,
limit: query.Limit,
totalRecordCount: result.TotalRecordCount,
showLimit: false,
filterButton: true
}));
var view = getPageData(page).view;
if (view == "List") {
html = listView.getListViewHtml({
items: result.Items,
context: 'games',
sortBy: query.SortBy
});
}
else if (view == "Poster") {
html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "auto",
context: 'games',
showTitle: true,
showParentTitle: true,
centerText: true
});
}
else if (view == "PosterCard") {
html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "auto",
context: 'games',
showTitle: true,
showParentTitle: true,
cardLayout: true
});
}
var elem = page.querySelector('#items');
elem.innerHTML = html;
imageLoader.lazyChildren(elem);
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', page).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
$('.btnFilter', page).on('click', function () {
showFilterMenu(page);
});
LibraryBrowser.saveQueryValues(getSavedQueryKey(page), query);
Dashboard.hideLoadingMsg();
});
}
function showFilterMenu(page) {
require(['components/filterdialog/filterdialog'], function (filterDialogFactory) {
var filterDialog = new filterDialogFactory({
query: getQuery(page),
mode: 'games'
});
Events.on(filterDialog, 'filterchange', function () {
reloadItems(page);
});
filterDialog.show();
});
}
$(document).on('pageinit', "#gamesPage", function () {
var page = this;
$('.alphabetPicker', this).on('alphaselect', function (e, character) {
var query = getQuery(page);
query.NameStartsWithOrGreater = character;
query.StartIndex = 0;
reloadItems(page);
}).on('alphaclear', function (e) {
var query = getQuery(page);
query.NameStartsWithOrGreater = '';
reloadItems(page);
});
}).on('pagebeforeshow', "#gamesPage", function () {
var page = this;
var query = getQuery(page);
query.ParentId = LibraryMenu.getTopParentId();
var limit = LibraryBrowser.getDefaultPageSize();
// If the default page size has changed, the start index will have to be reset
if (limit != query.Limit) {
query.Limit = limit;
query.StartIndex = 0;
}
var viewkey = getSavedQueryKey(page);
LibraryBrowser.loadSavedQueryValues(viewkey, query);
LibraryBrowser.getSavedViewSetting(viewkey).then(function (val) {
if (val) {
$('#selectView', page).val(val).trigger('change');
} else {
reloadItems(page);
}
});
});
});
define(["jQuery","listView","imageLoader"],function($,listView,imageLoader){"use strict";function getPageData(context){var key=getSavedQueryKey(context),pageData=data[key];return pageData||(pageData=data[key]={query:{SortBy:"SortName",SortOrder:"Ascending",MediaTypes:"Game",Recursive:!0,Fields:"Genres,Studios,PrimaryImageAspectRatio,SortName",ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",StartIndex:0,Limit:LibraryBrowser.getDefaultPageSize()},view:LibraryBrowser.getSavedView(key)||"Poster"},pageData.query.ParentId=LibraryMenu.getTopParentId(),LibraryBrowser.loadSavedQueryValues(key,pageData.query)),pageData}function getQuery(context){return getPageData(context).query}function getSavedQueryKey(context){return context.savedQueryKey||(context.savedQueryKey=LibraryBrowser.getSavedQueryKey("games")),context.savedQueryKey}function reloadItems(page){Dashboard.showLoadingMsg();var query=getQuery(page);ApiClient.getItems(Dashboard.getCurrentUserId(),query).then(function(result){window.scrollTo(0,0);var html="";$(".listTopPaging",page).html(LibraryBrowser.getQueryPagingHtml({startIndex:query.StartIndex,limit:query.Limit,totalRecordCount:result.TotalRecordCount,showLimit:!1,filterButton:!0}));var view=getPageData(page).view;"List"==view?html=listView.getListViewHtml({items:result.Items,context:"games",sortBy:query.SortBy}):"Poster"==view?html=LibraryBrowser.getPosterViewHtml({items:result.Items,shape:"auto",context:"games",showTitle:!0,showParentTitle:!0,centerText:!0}):"PosterCard"==view&&(html=LibraryBrowser.getPosterViewHtml({items:result.Items,shape:"auto",context:"games",showTitle:!0,showParentTitle:!0,cardLayout:!0}));var elem=page.querySelector("#items");elem.innerHTML=html,imageLoader.lazyChildren(elem),$(".btnNextPage",page).on("click",function(){query.StartIndex+=query.Limit,reloadItems(page)}),$(".btnPreviousPage",page).on("click",function(){query.StartIndex-=query.Limit,reloadItems(page)}),$(".btnFilter",page).on("click",function(){showFilterMenu(page)}),LibraryBrowser.saveQueryValues(getSavedQueryKey(page),query),Dashboard.hideLoadingMsg()})}function showFilterMenu(page){require(["components/filterdialog/filterdialog"],function(filterDialogFactory){var filterDialog=new filterDialogFactory({query:getQuery(page),mode:"games"});Events.on(filterDialog,"filterchange",function(){reloadItems(page)}),filterDialog.show()})}var data={};$(document).on("pageinit","#gamesPage",function(){var page=this;$(".alphabetPicker",this).on("alphaselect",function(e,character){var query=getQuery(page);query.NameStartsWithOrGreater=character,query.StartIndex=0,reloadItems(page)}).on("alphaclear",function(e){var query=getQuery(page);query.NameStartsWithOrGreater="",reloadItems(page)})}).on("pagebeforeshow","#gamesPage",function(){var page=this,query=getQuery(page);query.ParentId=LibraryMenu.getTopParentId();var limit=LibraryBrowser.getDefaultPageSize();limit!=query.Limit&&(query.Limit=limit,query.StartIndex=0);var viewkey=getSavedQueryKey(page);LibraryBrowser.loadSavedQueryValues(viewkey,query),LibraryBrowser.getSavedViewSetting(viewkey).then(function(val){val?$("#selectView",page).val(val).trigger("change"):reloadItems(page)})})});

View File

@ -1,72 +1 @@
define(['jQuery', 'imageLoader'], function ($, imageLoader) {
'use strict';
$(document).on('pagebeforeshow', "#gamesRecommendedPage", function () {
var parentId = LibraryMenu.getTopParentId();
var userId = Dashboard.getCurrentUserId();
var page = this;
var options = {
IncludeItemTypes: "Game",
Limit: 18,
Fields: "PrimaryImageAspectRatio",
ParentId: parentId,
ImageTypeLimit: 1,
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
};
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
var recentlyAddedItems = page.querySelector('#recentlyAddedItems');
recentlyAddedItems.innerHTML = LibraryBrowser.getPosterViewHtml({
items: items,
transparent: true,
borderless: true,
shape: 'auto',
lazy: true
});
imageLoader.lazyChildren(recentlyAddedItems);
});
options = {
SortBy: "DatePlayed",
SortOrder: "Descending",
MediaTypes: "Game",
Limit: 18,
Recursive: true,
Filters: "IsPlayed",
Fields: "ItemCounts,AudioInfo,PrimaryImageAspectRatio",
ParentId: parentId,
ImageTypeLimit: 1,
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
};
ApiClient.getItems(userId, options).then(function (result) {
if (result.Items.length) {
$('#recentlyPlayedSection', page).show();
} else {
$('#recentlyPlayedSection', page).hide();
}
var recentlyPlayedItems = page.querySelector('#recentlyPlayedItems');
recentlyPlayedItems.innerHTML = LibraryBrowser.getPosterViewHtml({
items: result.Items,
transparent: true,
borderless: true,
shape: 'auto',
lazy: true
});
imageLoader.lazyChildren(recentlyPlayedItems);
});
});
});
define(["jQuery","imageLoader"],function($,imageLoader){"use strict";$(document).on("pagebeforeshow","#gamesRecommendedPage",function(){var parentId=LibraryMenu.getTopParentId(),userId=Dashboard.getCurrentUserId(),page=this,options={IncludeItemTypes:"Game",Limit:18,Fields:"PrimaryImageAspectRatio",ParentId:parentId,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb"};ApiClient.getJSON(ApiClient.getUrl("Users/"+userId+"/Items/Latest",options)).then(function(items){var recentlyAddedItems=page.querySelector("#recentlyAddedItems");recentlyAddedItems.innerHTML=LibraryBrowser.getPosterViewHtml({items:items,transparent:!0,borderless:!0,shape:"auto",lazy:!0}),imageLoader.lazyChildren(recentlyAddedItems)}),options={SortBy:"DatePlayed",SortOrder:"Descending",MediaTypes:"Game",Limit:18,Recursive:!0,Filters:"IsPlayed",Fields:"ItemCounts,AudioInfo,PrimaryImageAspectRatio",ParentId:parentId,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb"},ApiClient.getItems(userId,options).then(function(result){result.Items.length?$("#recentlyPlayedSection",page).show():$("#recentlyPlayedSection",page).hide();var recentlyPlayedItems=page.querySelector("#recentlyPlayedItems");recentlyPlayedItems.innerHTML=LibraryBrowser.getPosterViewHtml({items:result.Items,transparent:!0,borderless:!0,shape:"auto",lazy:!0}),imageLoader.lazyChildren(recentlyPlayedItems)})})});

View File

@ -1,85 +1 @@
define(['jQuery', 'imageLoader'], function ($, imageLoader) {
'use strict';
// The base query options
var query = {
SortBy: "SortName",
SortOrder: "Ascending",
MediaTypes: "Game",
Recursive: true,
Fields: "ItemCounts",
StartIndex: 0
};
function getSavedQueryKey() {
return LibraryBrowser.getSavedQueryKey();
}
function reloadItems(page) {
Dashboard.showLoadingMsg();
ApiClient.getStudios(Dashboard.getCurrentUserId(), query).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);
var html = '';
$('.listTopPaging', page).html(LibraryBrowser.getQueryPagingHtml({
startIndex: query.StartIndex,
limit: query.Limit,
totalRecordCount: result.TotalRecordCount,
showLimit: false
}));
html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "backdrop",
preferThumb: true,
context: 'games',
showItemCounts: true,
centerText: true,
lazy: true
});
var elem = page.querySelector('#items');
elem.innerHTML = html;
imageLoader.lazyChildren(elem);
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', page).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
LibraryBrowser.saveQueryValues(getSavedQueryKey(), query);
Dashboard.hideLoadingMsg();
});
}
$(document).on('pagebeforeshow', "#gameStudiosPage", function () {
query.ParentId = LibraryMenu.getTopParentId();
var limit = LibraryBrowser.getDefaultPageSize();
// If the default page size has changed, the start index will have to be reset
if (limit != query.Limit) {
query.Limit = limit;
query.StartIndex = 0;
}
LibraryBrowser.loadSavedQueryValues(getSavedQueryKey(), query);
reloadItems(this);
});
});
define(["jQuery","imageLoader"],function($,imageLoader){"use strict";function getSavedQueryKey(){return LibraryBrowser.getSavedQueryKey()}function reloadItems(page){Dashboard.showLoadingMsg(),ApiClient.getStudios(Dashboard.getCurrentUserId(),query).then(function(result){window.scrollTo(0,0);var html="";$(".listTopPaging",page).html(LibraryBrowser.getQueryPagingHtml({startIndex:query.StartIndex,limit:query.Limit,totalRecordCount:result.TotalRecordCount,showLimit:!1})),html=LibraryBrowser.getPosterViewHtml({items:result.Items,shape:"backdrop",preferThumb:!0,context:"games",showItemCounts:!0,centerText:!0,lazy:!0});var elem=page.querySelector("#items");elem.innerHTML=html,imageLoader.lazyChildren(elem),$(".btnNextPage",page).on("click",function(){query.StartIndex+=query.Limit,reloadItems(page)}),$(".btnPreviousPage",page).on("click",function(){query.StartIndex-=query.Limit,reloadItems(page)}),LibraryBrowser.saveQueryValues(getSavedQueryKey(),query),Dashboard.hideLoadingMsg()})}var query={SortBy:"SortName",SortOrder:"Ascending",MediaTypes:"Game",Recursive:!0,Fields:"ItemCounts",StartIndex:0};$(document).on("pagebeforeshow","#gameStudiosPage",function(){query.ParentId=LibraryMenu.getTopParentId();var limit=LibraryBrowser.getDefaultPageSize();limit!=query.Limit&&(query.Limit=limit,query.StartIndex=0),LibraryBrowser.loadSavedQueryValues(getSavedQueryKey(),query),reloadItems(this)})});

View File

@ -1,77 +1 @@
define(['jQuery', 'imageLoader'], function ($, imageLoader) {
'use strict';
// The base query options
var query = {
SortBy: "SortName",
SortOrder: "Ascending",
IncludeItemTypes: "GameSystem",
Recursive: true,
Fields: "DateCreated",
StartIndex: 0,
ImageTypeLimit: 1,
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
};
function getSavedQueryKey() {
return LibraryBrowser.getSavedQueryKey();
}
function reloadItems(page) {
Dashboard.showLoadingMsg();
ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);
updateFilterControls(page);
var html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "backdrop",
context: 'games',
showTitle: true,
centerText: true,
lazy: true
});
var elem = page.querySelector('#items');
elem.innerHTML = html;
imageLoader.lazyChildren(elem);
LibraryBrowser.saveQueryValues(getSavedQueryKey(), query);
Dashboard.hideLoadingMsg();
});
}
function updateFilterControls(page) {
// Reset form values using the last used query
}
$(document).on('pagebeforeshow', "#gamesystemsPage", function () {
query.ParentId = LibraryMenu.getTopParentId();
var limit = LibraryBrowser.getDefaultPageSize();
// If the default page size has changed, the start index will have to be reset
if (limit != query.Limit) {
query.Limit = limit;
query.StartIndex = 0;
}
LibraryBrowser.loadSavedQueryValues(getSavedQueryKey(), query);
reloadItems(this);
updateFilterControls(this);
});
});
define(["jQuery","imageLoader"],function($,imageLoader){"use strict";function getSavedQueryKey(){return LibraryBrowser.getSavedQueryKey()}function reloadItems(page){Dashboard.showLoadingMsg(),ApiClient.getItems(Dashboard.getCurrentUserId(),query).then(function(result){window.scrollTo(0,0),updateFilterControls(page);var html=LibraryBrowser.getPosterViewHtml({items:result.Items,shape:"backdrop",context:"games",showTitle:!0,centerText:!0,lazy:!0}),elem=page.querySelector("#items");elem.innerHTML=html,imageLoader.lazyChildren(elem),LibraryBrowser.saveQueryValues(getSavedQueryKey(),query),Dashboard.hideLoadingMsg()})}function updateFilterControls(page){}var query={SortBy:"SortName",SortOrder:"Ascending",IncludeItemTypes:"GameSystem",Recursive:!0,Fields:"DateCreated",StartIndex:0,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb"};$(document).on("pagebeforeshow","#gamesystemsPage",function(){query.ParentId=LibraryMenu.getTopParentId();var limit=LibraryBrowser.getDefaultPageSize();limit!=query.Limit&&(query.Limit=limit,query.StartIndex=0),LibraryBrowser.loadSavedQueryValues(getSavedQueryKey(),query),reloadItems(this),updateFilterControls(this)})});

View File

@ -1,15 +1 @@
define(['components/favoriteitems'], function (favoriteItems) {
'use strict';
return function (view, params, tabContent) {
var self = this;
self.renderTab = function () {
var parentId = null;
favoriteItems.render(tabContent, Dashboard.getCurrentUserId(), parentId);
};
};
});
define(["components/favoriteitems"],function(favoriteItems){"use strict";return function(view,params,tabContent){var self=this;self.renderTab=function(){var parentId=null;favoriteItems.render(tabContent,Dashboard.getCurrentUserId(),parentId)}}});

View File

@ -1,71 +1 @@
define(['components/categorysyncbuttons', 'cardBuilder', 'apphost', 'imageLoader', 'emby-itemscontainer'], function (categorysyncbuttons, cardBuilder, appHost, imageLoader) {
'use strict';
function getNextUpPromise() {
var query = {
Limit: 24,
Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated,BasicSyncInfo",
UserId: Dashboard.getCurrentUserId(),
ImageTypeLimit: 1,
EnableImageTypes: "Primary,Backdrop,Thumb"
};
return ApiClient.getNextUpEpisodes(query);
}
function loadNextUp(page, promise) {
promise.then(function (result) {
if (result.Items.length) {
page.querySelector('.noNextUpItems').classList.add('hide');
} else {
page.querySelector('.noNextUpItems').classList.remove('hide');
}
var html = '';
var supportsImageAnalysis = appHost.supports('imageanalysis');
html += cardBuilder.getCardsHtml({
items: result.Items,
shape: "backdrop",
showTitle: true,
showParentTitle: true,
overlayText: false,
lazy: true,
preferThumb: true,
showDetailsMenu: true,
centerText: !supportsImageAnalysis,
overlayPlayButton: true,
context: 'home-nextup',
cardLayout: supportsImageAnalysis,
vibrant: supportsImageAnalysis
});
var elem = page.querySelector('#nextUpItems');
elem.innerHTML = html;
imageLoader.lazyChildren(elem);
Dashboard.hideLoadingMsg();
});
}
return function (view, params, tabContent) {
var self = this;
var nextUpPromise;
categorysyncbuttons.init(view);
self.preRender = function () {
nextUpPromise = getNextUpPromise();
};
self.renderTab = function () {
Dashboard.showLoadingMsg();
loadNextUp(view, nextUpPromise);
};
};
});
define(["components/categorysyncbuttons","cardBuilder","apphost","imageLoader","emby-itemscontainer"],function(categorysyncbuttons,cardBuilder,appHost,imageLoader){"use strict";function getNextUpPromise(){var query={Limit:24,Fields:"PrimaryImageAspectRatio,SeriesInfo,DateCreated,BasicSyncInfo",UserId:Dashboard.getCurrentUserId(),ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Thumb"};return ApiClient.getNextUpEpisodes(query)}function loadNextUp(page,promise){promise.then(function(result){result.Items.length?page.querySelector(".noNextUpItems").classList.add("hide"):page.querySelector(".noNextUpItems").classList.remove("hide");var html="",supportsImageAnalysis=appHost.supports("imageanalysis");html+=cardBuilder.getCardsHtml({items:result.Items,shape:"backdrop",showTitle:!0,showParentTitle:!0,overlayText:!1,lazy:!0,preferThumb:!0,showDetailsMenu:!0,centerText:!supportsImageAnalysis,overlayPlayButton:!0,context:"home-nextup",cardLayout:supportsImageAnalysis,vibrant:supportsImageAnalysis});var elem=page.querySelector("#nextUpItems");elem.innerHTML=html,imageLoader.lazyChildren(elem),Dashboard.hideLoadingMsg()})}return function(view,params,tabContent){var nextUpPromise,self=this;categorysyncbuttons.init(view),self.preRender=function(){nextUpPromise=getNextUpPromise()},self.renderTab=function(){Dashboard.showLoadingMsg(),loadNextUp(view,nextUpPromise)}}});

View File

@ -1,155 +1 @@
define(['datetime', 'cardBuilder', 'apphost', 'imageLoader', 'emby-itemscontainer', 'scrollStyles'], function (datetime, cardBuilder, appHost, imageLoader) {
'use strict';
function getUpcomingPromise() {
Dashboard.showLoadingMsg();
var query = {
Limit: 40,
Fields: "AirTime,UserData",
UserId: Dashboard.getCurrentUserId(),
ImageTypeLimit: 1,
EnableImageTypes: "Primary,Backdrop,Banner,Thumb",
EnableTotalRecordCount: false
};
return ApiClient.getJSON(ApiClient.getUrl("Shows/Upcoming", query));
}
function loadUpcoming(page, promise) {
promise.then(function (result) {
var items = result.Items;
if (items.length) {
page.querySelector('.noItemsMessage').style.display = 'none';
} else {
page.querySelector('.noItemsMessage').style.display = 'block';
}
var elem = page.querySelector('#upcomingItems');
renderUpcoming(elem, items);
Dashboard.hideLoadingMsg();
});
}
function enableScrollX() {
return browserInfo.mobile;
}
function getThumbShape() {
return enableScrollX() ? 'overflowBackdrop' : 'backdrop';
}
function renderUpcoming(elem, items) {
var groups = [];
var currentGroupName = '';
var currentGroup = [];
var i, length;
for (i = 0, length = items.length; i < length; i++) {
var item = items[i];
var dateText = '';
if (item.PremiereDate) {
try {
var premiereDate = datetime.parseISO8601Date(item.PremiereDate, true);
if (datetime.isRelativeDay(premiereDate, -1)) {
dateText = Globalize.translate('Yesterday');
} else {
dateText = LibraryBrowser.getFutureDateText(premiereDate, true);
}
} catch (err) {
}
}
if (dateText != currentGroupName) {
if (currentGroup.length) {
groups.push({
name: currentGroupName,
items: currentGroup
});
}
currentGroupName = dateText;
currentGroup = [item];
} else {
currentGroup.push(item);
}
}
var html = '';
for (i = 0, length = groups.length; i < length; i++) {
var group = groups[i];
html += '<div class="homePageSection">';
html += '<h1 class="listHeader">' + group.name + '</h1>';
var allowBottomPadding = true;
if (enableScrollX()) {
allowBottomPadding = false;
html += '<div is="emby-itemscontainer" class="itemsContainer hiddenScrollX">';
} else {
html += '<div is="emby-itemscontainer" class="itemsContainer vertical-wrap">';
}
var supportsImageAnalysis = appHost.supports('imageanalysis');
html += cardBuilder.getCardsHtml({
items: group.items,
showLocationTypeIndicator: false,
shape: getThumbShape(),
showTitle: true,
preferThumb: true,
lazy: true,
showDetailsMenu: true,
centerText: !supportsImageAnalysis,
context: 'home-upcoming',
overlayMoreButton: !supportsImageAnalysis,
showParentTitle: true,
allowBottomPadding: allowBottomPadding,
cardLayout: supportsImageAnalysis,
vibrant: supportsImageAnalysis
});
html += '</div>';
html += '</div>';
}
elem.innerHTML = html;
imageLoader.lazyChildren(elem);
}
return function (view, params, tabContent) {
var self = this;
var upcomingPromise;
self.preRender = function () {
upcomingPromise = getUpcomingPromise();
};
self.renderTab = function () {
Dashboard.showLoadingMsg();
loadUpcoming(view, upcomingPromise);
};
};
});
define(["datetime","cardBuilder","apphost","imageLoader","emby-itemscontainer","scrollStyles"],function(datetime,cardBuilder,appHost,imageLoader){"use strict";function getUpcomingPromise(){Dashboard.showLoadingMsg();var query={Limit:40,Fields:"AirTime,UserData",UserId:Dashboard.getCurrentUserId(),ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",EnableTotalRecordCount:!1};return ApiClient.getJSON(ApiClient.getUrl("Shows/Upcoming",query))}function loadUpcoming(page,promise){promise.then(function(result){var items=result.Items;items.length?page.querySelector(".noItemsMessage").style.display="none":page.querySelector(".noItemsMessage").style.display="block";var elem=page.querySelector("#upcomingItems");renderUpcoming(elem,items),Dashboard.hideLoadingMsg()})}function enableScrollX(){return browserInfo.mobile}function getThumbShape(){return enableScrollX()?"overflowBackdrop":"backdrop"}function renderUpcoming(elem,items){var i,length,groups=[],currentGroupName="",currentGroup=[];for(i=0,length=items.length;i<length;i++){var item=items[i],dateText="";if(item.PremiereDate)try{var premiereDate=datetime.parseISO8601Date(item.PremiereDate,!0);dateText=datetime.isRelativeDay(premiereDate,-1)?Globalize.translate("Yesterday"):LibraryBrowser.getFutureDateText(premiereDate,!0)}catch(err){}dateText!=currentGroupName?(currentGroup.length&&groups.push({name:currentGroupName,items:currentGroup}),currentGroupName=dateText,currentGroup=[item]):currentGroup.push(item)}var html="";for(i=0,length=groups.length;i<length;i++){var group=groups[i];html+='<div class="homePageSection">',html+='<h1 class="listHeader">'+group.name+"</h1>";var allowBottomPadding=!0;enableScrollX()?(allowBottomPadding=!1,html+='<div is="emby-itemscontainer" class="itemsContainer hiddenScrollX">'):html+='<div is="emby-itemscontainer" class="itemsContainer vertical-wrap">';var supportsImageAnalysis=appHost.supports("imageanalysis");html+=cardBuilder.getCardsHtml({items:group.items,showLocationTypeIndicator:!1,shape:getThumbShape(),showTitle:!0,preferThumb:!0,lazy:!0,showDetailsMenu:!0,centerText:!supportsImageAnalysis,context:"home-upcoming",overlayMoreButton:!supportsImageAnalysis,showParentTitle:!0,allowBottomPadding:allowBottomPadding,cardLayout:supportsImageAnalysis,vibrant:supportsImageAnalysis}),html+="</div>",html+="</div>"}elem.innerHTML=html,imageLoader.lazyChildren(elem)}return function(view,params,tabContent){var upcomingPromise,self=this;self.preRender=function(){upcomingPromise=getUpcomingPromise()},self.renderTab=function(){Dashboard.showLoadingMsg(),loadUpcoming(view,upcomingPromise)}}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,73 +1 @@
define(['datetime', 'listView'], function (datetime, listView) {
'use strict';
function isSameDay(date1, date2) {
return date1.toDateString() === date2.toDateString();
}
function renderPrograms(page, result) {
var html = '';
var currentItems = [];
var currentStartDate = null;
for (var i = 0, length = result.Items.length; i < length; i++) {
var item = result.Items[i];
var itemStartDate = datetime.parseISO8601Date(item.StartDate);
if (!currentStartDate || !isSameDay(currentStartDate, itemStartDate)) {
if (currentItems.length) {
html += '<h1>' + datetime.toLocaleDateString(currentStartDate, { weekday: 'long', month: 'long', day: 'numeric' }) + '</h1>';
html += '<div is="emby-itemscontainer" class="vertical-list">' + listView.getListViewHtml({
items: currentItems,
enableUserDataButtons: false,
showParentTitle: true,
image: false,
showProgramTime: true,
mediaInfo: false,
parentTitleWithTitle: true
}) + '</div>';
}
currentStartDate = itemStartDate;
currentItems = [];
}
currentItems.push(item);
}
page.querySelector('#childrenContent').innerHTML = html;
}
function loadPrograms(page, channelId) {
ApiClient.getLiveTvPrograms({
ChannelIds: channelId,
UserId: Dashboard.getCurrentUserId(),
HasAired: false,
SortBy: "StartDate",
EnableTotalRecordCount: false,
EnableImages: false,
ImageTypeLimit: 0,
EnableUserData: false
}).then(function (result) {
renderPrograms(page, result);
Dashboard.hideLoadingMsg();
});
}
return {
renderPrograms: loadPrograms
};
});
define(["datetime","listView"],function(datetime,listView){"use strict";function isSameDay(date1,date2){return date1.toDateString()===date2.toDateString()}function renderPrograms(page,result){for(var html="",currentItems=[],currentStartDate=null,i=0,length=result.Items.length;i<length;i++){var item=result.Items[i],itemStartDate=datetime.parseISO8601Date(item.StartDate);currentStartDate&&isSameDay(currentStartDate,itemStartDate)||(currentItems.length&&(html+="<h1>"+datetime.toLocaleDateString(currentStartDate,{weekday:"long",month:"long",day:"numeric"})+"</h1>",html+='<div is="emby-itemscontainer" class="vertical-list">'+listView.getListViewHtml({items:currentItems,enableUserDataButtons:!1,showParentTitle:!0,image:!1,showProgramTime:!0,mediaInfo:!1,parentTitleWithTitle:!0})+"</div>"),currentStartDate=itemStartDate,currentItems=[]),currentItems.push(item)}page.querySelector("#childrenContent").innerHTML=html}function loadPrograms(page,channelId){ApiClient.getLiveTvPrograms({ChannelIds:channelId,UserId:Dashboard.getCurrentUserId(),HasAired:!1,SortBy:"StartDate",EnableTotalRecordCount:!1,EnableImages:!1,ImageTypeLimit:0,EnableUserData:!1}).then(function(result){renderPrograms(page,result),Dashboard.hideLoadingMsg()})}return{renderPrograms:loadPrograms}});

View File

@ -1,141 +1 @@
define(['cardBuilder', 'imageLoader', 'emby-itemscontainer'], function (cardBuilder, imageLoader) {
'use strict';
return function (view, params, tabContent) {
var self = this;
var data = {};
function getPageData(context) {
var key = getSavedQueryKey(context);
var pageData = data[key];
if (!pageData) {
pageData = data[key] = {
query: {
StartIndex: 0,
Limit: LibraryBrowser.getDefaultPageSize(),
Fields: "PrimaryImageAspectRatio"
}
};
LibraryBrowser.loadSavedQueryValues(key, pageData.query);
}
return pageData;
}
function getQuery(context) {
return getPageData(context).query;
}
function getSavedQueryKey(context) {
if (!context.savedQueryKey) {
context.savedQueryKey = LibraryBrowser.getSavedQueryKey('channels');
}
return context.savedQueryKey;
}
function getChannelsHtml(channels) {
return cardBuilder.getCardsHtml({
items: channels,
shape: "square",
showTitle: true,
lazy: true,
cardLayout: true,
showDetailsMenu: true,
showCurrentProgram: true
});
}
function renderChannels(context, result) {
var query = getQuery(context);
context.querySelector('.paging').innerHTML = LibraryBrowser.getQueryPagingHtml({
startIndex: query.StartIndex,
limit: query.Limit,
totalRecordCount: result.TotalRecordCount,
showLimit: false,
updatePageSizeSetting: false,
filterButton: false
});
var html = getChannelsHtml(result.Items);
var elem = context.querySelector('#items');
elem.innerHTML = html;
imageLoader.lazyChildren(elem);
var i, length;
var elems;
function onNextPageClick() {
query.StartIndex += query.Limit;
reloadItems(context);
}
function onPreviousPageClick() {
query.StartIndex -= query.Limit;
reloadItems(context);
}
elems = context.querySelectorAll('.btnNextPage');
for (i = 0, length = elems.length; i < length; i++) {
elems[i].addEventListener('click', onNextPageClick);
}
elems = context.querySelectorAll('.btnPreviousPage');
for (i = 0, length = elems.length; i < length; i++) {
elems[i].addEventListener('click', onPreviousPageClick);
}
LibraryBrowser.saveQueryValues(getSavedQueryKey(context), query);
}
function showFilterMenu(context) {
require(['components/filterdialog/filterdialog'], function (filterDialogFactory) {
var filterDialog = new filterDialogFactory({
query: getQuery(context),
mode: 'livetvchannels'
});
Events.on(filterDialog, 'filterchange', function () {
reloadItems(context);
});
filterDialog.show();
});
}
function reloadItems(context) {
Dashboard.showLoadingMsg();
var query = getQuery(context);
query.UserId = Dashboard.getCurrentUserId();
ApiClient.getLiveTvChannels(query).then(function (result) {
renderChannels(context, result);
Dashboard.hideLoadingMsg();
});
}
tabContent.querySelector('.btnFilter').addEventListener('click', function () {
showFilterMenu(tabContent);
});
self.renderTab = function () {
reloadItems(tabContent);
};
};
});
define(["cardBuilder","imageLoader","emby-itemscontainer"],function(cardBuilder,imageLoader){"use strict";return function(view,params,tabContent){function getPageData(context){var key=getSavedQueryKey(context),pageData=data[key];return pageData||(pageData=data[key]={query:{StartIndex:0,Limit:LibraryBrowser.getDefaultPageSize(),Fields:"PrimaryImageAspectRatio"}},LibraryBrowser.loadSavedQueryValues(key,pageData.query)),pageData}function getQuery(context){return getPageData(context).query}function getSavedQueryKey(context){return context.savedQueryKey||(context.savedQueryKey=LibraryBrowser.getSavedQueryKey("channels")),context.savedQueryKey}function getChannelsHtml(channels){return cardBuilder.getCardsHtml({items:channels,shape:"square",showTitle:!0,lazy:!0,cardLayout:!0,showDetailsMenu:!0,showCurrentProgram:!0})}function renderChannels(context,result){function onNextPageClick(){query.StartIndex+=query.Limit,reloadItems(context)}function onPreviousPageClick(){query.StartIndex-=query.Limit,reloadItems(context)}var query=getQuery(context);context.querySelector(".paging").innerHTML=LibraryBrowser.getQueryPagingHtml({startIndex:query.StartIndex,limit:query.Limit,totalRecordCount:result.TotalRecordCount,showLimit:!1,updatePageSizeSetting:!1,filterButton:!1});var html=getChannelsHtml(result.Items),elem=context.querySelector("#items");elem.innerHTML=html,imageLoader.lazyChildren(elem);var i,length,elems;for(elems=context.querySelectorAll(".btnNextPage"),i=0,length=elems.length;i<length;i++)elems[i].addEventListener("click",onNextPageClick);for(elems=context.querySelectorAll(".btnPreviousPage"),i=0,length=elems.length;i<length;i++)elems[i].addEventListener("click",onPreviousPageClick);LibraryBrowser.saveQueryValues(getSavedQueryKey(context),query)}function showFilterMenu(context){require(["components/filterdialog/filterdialog"],function(filterDialogFactory){var filterDialog=new filterDialogFactory({query:getQuery(context),mode:"livetvchannels"});Events.on(filterDialog,"filterchange",function(){reloadItems(context)}),filterDialog.show()})}function reloadItems(context){Dashboard.showLoadingMsg();var query=getQuery(context);query.UserId=Dashboard.getCurrentUserId(),ApiClient.getLiveTvChannels(query).then(function(result){renderChannels(context,result),Dashboard.hideLoadingMsg()})}var self=this,data={};tabContent.querySelector(".btnFilter").addEventListener("click",function(){showFilterMenu(tabContent)}),self.renderTab=function(){reloadItems(tabContent)}}});

Some files were not shown because too many files have changed in this diff Show More