1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

jshint fixes

This commit is contained in:
Luke Pulverenti 2017-08-20 17:03:58 -04:00
parent 1f6f6f4c12
commit 97ecd62cc4
16 changed files with 60 additions and 17 deletions

File diff suppressed because one or more lines are too long

View file

@ -1 +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){function parentWithClass(elem,className){for(;!elem.classList||!elem.classList.contains(className);)if(elem=elem.parentNode,!elem)return null;return elem}function mapChannel(button,channelId,providerChannelId){loading.show();var providerId=options.providerId,apiClient=connectionManager.getApiClient(options.serverId);apiClient.ajax({type:"POST",url:ApiClient.getUrl("LiveTv/ChannelMappings"),data:{providerId:providerId,tunerChannelId:channelId,providerChannelId:providerChannelId},dataType:"json"}).then(function(mapping){var listItem=parentWithClass(button,"listItem");button.setAttribute("data-providerid",mapping.ProviderChannelId),listItem.querySelector(".secondary").innerHTML=getMappingSecondaryName(mapping,currentMappingOptions.ProviderName),loading.hide()})}function onChannelsElementClick(e){var btnMap=parentWithClass(e.target,"btnMap");if(btnMap){var channelId=btnMap.getAttribute("data-id"),providerChannelId=btnMap.getAttribute("data-providerid"),menuItems=currentMappingOptions.ProviderChannels.map(function(m){return{name:m.Name,id:m.Id,selected:m.Id.toLowerCase()==providerChannelId.toLowerCase()}});actionsheet.show({positionTo:btnMap,items:menuItems}).then(function(newChannelId){mapChannel(btnMap,channelId,newChannelId)})}}function getChannelMappingOptions(serverId,providerId){var apiClient=connectionManager.getApiClient(serverId);return apiClient.getJSON(apiClient.getUrl("LiveTv/ChannelMappingOptions",{providerId:providerId}))}function getMappingSecondaryName(mapping,providerName){return(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.ProviderChannelName&&(html+=getMappingSecondaryName(channel,providerName)),html+="</div>",html+="</div>",html+='<button class="btnMap autoSize" is="paper-icon-button-light" type="button" data-id="'+channel.Id+'" data-providerid="'+channel.ProviderChannelId+'"><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)})}}}); 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,channelId,providerChannelId){loading.show();var providerId=options.providerId,apiClient=connectionManager.getApiClient(options.serverId);apiClient.ajax({type:"POST",url:ApiClient.getUrl("LiveTv/ChannelMappings"),data:{providerId:providerId,tunerChannelId:channelId,providerChannelId:providerChannelId},dataType:"json"}).then(function(mapping){var listItem=parentWithClass(button,"listItem");button.setAttribute("data-providerid",mapping.ProviderChannelId),listItem.querySelector(".secondary").innerHTML=getMappingSecondaryName(mapping,currentMappingOptions.ProviderName),loading.hide()})}function onChannelsElementClick(e){var btnMap=parentWithClass(e.target,"btnMap");if(btnMap){var channelId=btnMap.getAttribute("data-id"),providerChannelId=btnMap.getAttribute("data-providerid"),menuItems=currentMappingOptions.ProviderChannels.map(function(m){return{name:m.Name,id:m.Id,selected:m.Id.toLowerCase()===providerChannelId.toLowerCase()}});actionsheet.show({positionTo:btnMap,items:menuItems}).then(function(newChannelId){mapChannel(btnMap,channelId,newChannelId)})}}function getChannelMappingOptions(serverId,providerId){var apiClient=connectionManager.getApiClient(serverId);return apiClient.getJSON(apiClient.getUrl("LiveTv/ChannelMappingOptions",{providerId:providerId}))}function getMappingSecondaryName(mapping,providerName){return(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.ProviderChannelName&&(html+=getMappingSecondaryName(channel,providerName)),html+="</div>",html+="</div>",html+='<button class="btnMap autoSize" is="paper-icon-button-light" type="button" data-id="'+channel.Id+'" data-providerid="'+channel.ProviderChannelId+'"><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)})}}});

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 +1 @@
define(["dom","appRouter","connectionManager"],function(dom,appRouter,connectionManager){"use strict";function onGroupedCardClick(e,card){var itemId=card.getAttribute("data-id"),serverId=card.getAttribute("data-serverid"),apiClient=connectionManager.getApiClient(serverId),userId=apiClient.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 appRouter.showItem(items[0]);var url="itemdetails.html?id="+itemId+"&serverId="+serverId;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}}); define(["dom","appRouter","connectionManager"],function(dom,appRouter,connectionManager){"use strict";function onGroupedCardClick(e,card){var itemId=card.getAttribute("data-id"),serverId=card.getAttribute("data-serverid"),apiClient=connectionManager.getApiClient(serverId),userId=apiClient.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 appRouter.showItem(items[0]);var url="itemdetails.html?id="+itemId+"&serverId="+serverId;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 +1 @@
define(["dialogHelper","jQuery","loading","emby-button","emby-select"],function(dialogHelper,$,loading){"use strict";function onFileReaderError(evt){switch(loading.hide(),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(){loading.hide(),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;loading.show();var page=$(this).parents(".dialog"),imageType=$("#selectImageType",page).val();return ApiClient.uploadItemImage(currentItemId,imageType,file).then(function(){$("#uploadImage",page).val("").trigger("change"),loading.hide(),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(),loading.hide(),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()}}}); define(["dialogHelper","jQuery","loading","emby-button","emby-select"],function(dialogHelper,$,loading){"use strict";function onFileReaderError(evt){switch(loading.hide(),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(){loading.hide(),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;loading.show();var page=$(this).parents(".dialog"),imageType=$("#selectImageType",page).val();return ApiClient.uploadItemImage(currentItemId,imageType,file).then(function(){$("#uploadImage",page).val("").trigger("change"),loading.hide(),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(),loading.hide(),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

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

@ -1943,5 +1943,20 @@
"PluginInstalledMessage": "The plugin has been successfully installed. Emby Server will need to be restarted for changes to take effect.", "PluginInstalledMessage": "The plugin has been successfully installed. Emby Server will need to be restarted for changes to take effect.",
"Themes": "Themes", "Themes": "Themes",
"LabelTheme": "Theme:", "LabelTheme": "Theme:",
"LabelDashboardTheme": "Server dashboard theme:" "LabelDashboardTheme": "Server dashboard theme:",
"MessagePremiereStatusGood": "You have a {0} Emby Premiere plan and your device usage is well within your limit.",
"MessagePremiereStatusClose": "You have a {0} Emby Premiere plan, but your device usage is close to the limit.",
"MessagePremiereExtendedPlans": "Consider an {0}extended device plan{1}",
"MessagePremiereStatusOver": "You have a {0} Emby Premiere plan, but you are over your device limit!",
"ListItemPremiereSub": "{0} subscription purchased via {2} expires {1}",
"LabelClickToCancel": "Click to cancel this subscription",
"LabelCancelInfo": "You can manage this subscription directly with {0}",
"LabelAlreadyCanceled": "This subscription has been canceled. Key will remain valid until expiration.",
"HeaderCancelSub": "Cancel Emby Premiere",
"MessageConfirmSubCancel": "NO, Please don't go... You will miss out on all the great features of Emby Premiere!",
"ButtonCancelSub": "I know, cancel it anyway",
"ButtonDontCancelSub": "Keep Emby Premiere",
"MessageSubCancelReqSent": "An email has been sent to the owner of the key. Please follow the instructions in that email to complete the cancellation of this subscription. We hope to see you back soon!",
"MessageSubCancelError": "Something went wrong trying to cancel. Please send an email to {0} and we'll get you squared away.",
"LabelAlreadyCancelled": "This subscription has been cancelled. You will not be charged again but the features will work until the date above."
} }

View file

@ -1,5 +1,14 @@
<div id="supporterKeyPage" data-role="page" class="page type-interior" data-require="emby-collapse,scripts/supporterkeypage,emby-input,emby-button"> <div id="supporterKeyPage" data-role="page" class="page type-interior">
<style>
.expiredBackground {
background: #cc3333;
}
.nearExpiredBackground {
background: orange;
}
</style>
<div> <div>
<div class="content-primary"> <div class="content-primary">
<div class="readOnlyContent"> <div class="readOnlyContent">
@ -32,7 +41,7 @@
</div> </div>
</div> </div>
<div style="display: none; padding: 1em; margin-top: 1em; font-weight: normal;" class="ui-bar-a notSupporter"> <div class="hide notSupporter">
<p> <p>
<strong>${MessageInvalidKey}</strong> <strong>${MessageInvalidKey}</strong>
</p> </p>
@ -49,6 +58,25 @@
</p> </p>
</form> </form>
<br /> <br />
<div class="hide isSupporter">
<h1 style="margin-bottom:0;">${Status}</h1>
<div class="paperList paperList-clear" id="status-indicator" style="margin-top:0;">
<div class="listItem">
<i class="listItemIcon md-icon">&#xE5CA;</i>
<div class="listItemBody">
<div class="listItemBodyText" id="premiere-status"></div>
<div class="listItemBodyText secondary hide" id="extended-plans"></div>
</div>
</div>
</div>
<div id="premiere-subs" class="hide">
<h2>${Subscriptions}</h2>
<div id="premiere-subs-content" class="paperList"></div>
</div>
</div>
<br />
<div is="emby-collapse" title="${HeaderForgotKey}"> <div is="emby-collapse" title="${HeaderForgotKey}">
<div class="collapseContent"> <div class="collapseContent">
<form id="lostKeyForm"> <form id="lostKeyForm">