mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
1 line
1.5 KiB
JavaScript
1 line
1.5 KiB
JavaScript
define(["jQuery","loading","fnchecked"],function($,loading){"use strict";function load(page,config){$("#txtUploadPath",page).val(config.CameraUploadPath||""),$("#chkSubfolder",page).checked(config.EnableCameraUploadSubfolders)}function loadData(page){loading.show(),ApiClient.getNamedConfiguration("devices").then(function(config){load(page,config),loading.hide()})}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:"devices.html",name:Globalize.translate("TabDevices")},{href:"devicesupload.html",name:Globalize.translate("TabCameraUpload")}]}$(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("devices",1,getTabs);var page=this;loadData(page)})}); |