update web components

This commit is contained in:
Luke Pulverenti 2017-06-04 16:37:39 -04:00
parent cffce37b65
commit e9027951c4
28 changed files with 27 additions and 27 deletions

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
define(["loading","libraryMenu","listViewStyle"],function(loading,libraryMenu){"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){loading.show(),ApiClient.getSmartMatchInfos(query).then(function(infos){currentResult=infos,populateList(page,infos),loading.hide()},function(){loading.hide()})}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),loading.show(),reloadList(view)}),view.addEventListener("viewhide",function(e){currentResult=null})}});
define(["loading","libraryMenu","listViewStyle"],function(loading,libraryMenu){"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){loading.show(),ApiClient.getSmartMatchInfos(query).then(function(infos){currentResult=infos,populateList(page,infos),loading.hide()},function(){loading.hide()})}function getHtmlFromMatchStrings(info,i){var matchStringIndex=0;return 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("")}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>",html+=getHtmlFromMatchStrings(info,i)}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),loading.show(),reloadList(view)}),view.addEventListener("viewhide",function(e){currentResult=null})}});

View file

@ -1 +1 @@
define(["jQuery","loading","fnchecked","emby-checkbox","emby-collapse","emby-textarea","emby-input","emby-select","emby-linkbutton"],function($,loading){"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"),loading.hide()}function onSubmit(){loading.show();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(function(){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||""})})}});
define(["jQuery","loading","fnchecked","emby-checkbox","emby-collapse","emby-textarea","emby-input","emby-select","emby-linkbutton"],function($,loading){"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"),loading.hide()}function onSubmit(){loading.show();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(function(){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 +1 @@
define(["jQuery","loading","libraryMenu","fnchecked","emby-checkbox","emby-linkbutton"],function($,loading,libraryMenu){"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||""),loading.hide()}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(){loading.show();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),loading.show();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","loading","libraryMenu","fnchecked","emby-checkbox","emby-linkbutton"],function($,loading,libraryMenu){"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||""),loading.hide()}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(){loading.show();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),loading.show();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)})})}});

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
define(["emby-linkbutton"],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 is="emby-linkbutton" class="button-link" 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 is="emby-linkbutton" class="button-link" 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 is="emby-linkbutton" class="button-link" 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 is="emby-linkbutton" class="button-link" 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)})}});
define(["emby-linkbutton"],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 is="emby-linkbutton" class="button-link" 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 is="emby-linkbutton" class="button-link" 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 is="emby-linkbutton" class="button-link" 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 is="emby-linkbutton" class="button-link" 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)})}});