From d08ee04bdb0802f390705a07ab2031837654a16a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 9 Sep 2016 22:21:00 -0400 Subject: [PATCH] fix dialogs --- .../emby-webcomponents/dialog/dialog.js | 4 +- .../dialoghelper/dialoghelper.js | 16 +-- .../emby-webcomponents/formdialog.css | 2 +- .../metadataeditor/metadataeditor.js | 7 + .../metadataeditor.template.html | 4 + .../emby-webcomponents/sync/sync.js | 2 +- dashboard-ui/livetvsettings.html | 2 +- dashboard-ui/scripts/useredit.js | 2 +- dashboard-ui/strings/en-US.json | 16 +-- dashboard-ui/useredit.html | 128 ++++++++++++------ 10 files changed, 113 insertions(+), 70 deletions(-) diff --git a/dashboard-ui/bower_components/emby-webcomponents/dialog/dialog.js b/dashboard-ui/bower_components/emby-webcomponents/dialog/dialog.js index 85cc01a64f..ef728db827 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/dialog/dialog.js +++ b/dashboard-ui/bower_components/emby-webcomponents/dialog/dialog.js @@ -1,4 +1,4 @@ -define(['dialogHelper', 'layoutManager', 'scrollHelper', 'globalize', 'require', 'material-icons', 'emby-button', 'paper-icon-button-light', 'emby-input', 'formDialogStyle'], function (dialogHelper, layoutManager, scrollHelper, globalize, require) { +define(['dialogHelper', 'dom', 'layoutManager', 'scrollHelper', 'globalize', 'require', 'material-icons', 'emby-button', 'paper-icon-button-light', 'emby-input', 'formDialogStyle'], function (dialogHelper, dom, layoutManager, scrollHelper, globalize, require) { function showTvDialog(options) { return new Promise(function (resolve, reject) { @@ -65,6 +65,8 @@ define(['dialogHelper', 'layoutManager', 'scrollHelper', 'globalize', 'require', html += ''; } + dlg.style.minWidth = (Math.min(options.buttons.length * 150, dom.getWindowSize().innerWidth - 50)) + 'px'; + dlg.querySelector('.formDialogFooter').innerHTML = html; var dialogResult; diff --git a/dashboard-ui/bower_components/emby-webcomponents/dialoghelper/dialoghelper.js b/dashboard-ui/bower_components/emby-webcomponents/dialoghelper/dialoghelper.js index edf8cff209..e23b24ce72 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/dialoghelper/dialoghelper.js +++ b/dashboard-ui/bower_components/emby-webcomponents/dialoghelper/dialoghelper.js @@ -149,7 +149,7 @@ }, 0); dom.addEventListener((dlg.dialogContainer || backdrop), 'click', function (e) { - if (!isParent(dlg, e.target)) { + if (e.target == dlg.dialogContainer) { close(dlg); } }, { @@ -157,20 +157,6 @@ }); } - function isParent(parent, child) { - - while (child) { - - if (child == parent) { - return true; - } - - child = child.parentNode; - } - - return false; - } - function isHistoryEnabled(dlg) { return dlg.getAttribute('data-history') == 'true'; } diff --git a/dashboard-ui/bower_components/emby-webcomponents/formdialog.css b/dashboard-ui/bower_components/emby-webcomponents/formdialog.css index 1089399d01..49ac548919 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/formdialog.css +++ b/dashboard-ui/bower_components/emby-webcomponents/formdialog.css @@ -12,7 +12,7 @@ } .formDialogHeader, .formDialogFooter { - background-color: #1D1E21; + background-color: #222326; } .formDialogHeaderTitle { diff --git a/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.js b/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.js index f3b20cf626..f01316b401 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.js +++ b/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.js @@ -357,6 +357,11 @@ }); + context.querySelector('.btnHeaderSave').addEventListener('click', function (e) { + + context.querySelector('.btnSave').click(); + }); + context.querySelector('#chkLockData').addEventListener('click', function (e) { if (!e.target.checked) { @@ -1208,6 +1213,8 @@ elem.innerHTML = globalize.translateDocument(template, 'sharedcomponents'); + elem.querySelector('.formDialogFooter').classList.remove('formDialogFooter'); + elem.querySelector('.btnHeaderSave').classList.remove('hide'); elem.querySelector('.btnCancel').classList.add('hide'); currentContext = elem; diff --git a/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.template.html b/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.template.html index 5a0ede25d9..7707937c8c 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.template.html +++ b/dashboard-ui/bower_components/emby-webcomponents/metadataeditor/metadataeditor.template.html @@ -4,6 +4,10 @@ ${Edit}
+ diff --git a/dashboard-ui/bower_components/emby-webcomponents/sync/sync.js b/dashboard-ui/bower_components/emby-webcomponents/sync/sync.js index 7142259192..bf93f7e90c 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/sync/sync.js +++ b/dashboard-ui/bower_components/emby-webcomponents/sync/sync.js @@ -397,7 +397,7 @@ html += globalize.translate('sharedcomponents#Sync'); html += ''; - html += ''; + html += ''; html += '
'; diff --git a/dashboard-ui/livetvsettings.html b/dashboard-ui/livetvsettings.html index ae11c8f938..72c50d9031 100644 --- a/dashboard-ui/livetvsettings.html +++ b/dashboard-ui/livetvsettings.html @@ -95,7 +95,7 @@
- +
diff --git a/dashboard-ui/scripts/useredit.js b/dashboard-ui/scripts/useredit.js index fc0205f9e0..07cac8129b 100644 --- a/dashboard-ui/scripts/useredit.js +++ b/dashboard-ui/scripts/useredit.js @@ -1,4 +1,4 @@ -define(['jQuery'], function ($) { +define(['jQuery', 'fnchecked'], function ($) { var currentUser; diff --git a/dashboard-ui/strings/en-US.json b/dashboard-ui/strings/en-US.json index 26346ca7bf..9af2328772 100644 --- a/dashboard-ui/strings/en-US.json +++ b/dashboard-ui/strings/en-US.json @@ -338,7 +338,7 @@ "TitleMetadata": "Metadata", "LabelFanartApiKey": "Personal api key:", "LabelFanartApiKeyHelp": "Requests to fanart without a personal API key return images that were approved over 7 days ago. With a personal API key that drops to 48 hours and if you are also a fanart VIP member that will further drop to around 10 minutes.", - "ExtractChapterImagesHelp": "Extracting chapter images will allow clients to display graphical scene selection menus. The process can be slow, cpu-intensive and may require several gigabytes of space. It runs when videos are discovered, and also as a nightly scheduled task. The schedule is configurable in the scheduled tasks area. It is not recommended to run this task during peak usage hours.", + "ExtractChapterImagesHelp": "Extracting chapter images will allow Emby apps to display graphical scene selection menus. The process can be slow, cpu-intensive and may require several gigabytes of space. It runs when videos are discovered, and also as a nightly scheduled task. The schedule is configurable in the scheduled tasks area. It is not recommended to run this task during peak usage hours.", "LabelMetadataDownloadLanguage": "Preferred download language:", "ButtonSignIn": "Sign In", "TitleSignIn": "Sign In", @@ -446,12 +446,12 @@ "ButtonPlayTrailer": "Trailer", "LabelMissing": "Missing", "LabelOffline": "Offline", - "PathSubstitutionHelp": "Path substitutions are used for mapping a path on the server to a path that clients are able to access. By allowing clients direct access to media on the server they may be able to play them directly over the network and avoid using server resources to stream and transcode them.", + "PathSubstitutionHelp": "Path substitutions are used for mapping a path on the server to a path that Emby apps are able to access. By allowing Emby apps direct access to media on the server they may be able to play them directly over the network and avoid using server resources to stream and transcode them.", "HeaderFrom": "From", "HeaderTo": "To", "LabelFrom": "From:", "LabelTo": "To:", - "LabelToHelp": "Example: \\\\MyServer\\Movies (a path clients can access)", + "LabelToHelp": "Example: \\\\MyServer\\Movies (a path that can be accessed by Emby apps)", "ButtonAddPathSubstitution": "Add Substitution", "OptionSpecialEpisode": "Specials", "OptionMissingEpisode": "Missing Episodes", @@ -494,7 +494,7 @@ "LabelPublicHttpsPort": "Public https port number:", "LabelPublicHttpsPortHelp": "The public port number that should be mapped to the local https port.", "LabelEnableHttps": "Report https as external address", - "LabelEnableHttpsHelp": "If enabled, the server will report an https url to clients as it's external address.", + "LabelEnableHttpsHelp": "If enabled, the server will report an https url to Emby apps as it's external address.", "LabelHttpsPort": "Local https port number:", "LabelHttpsPortHelp": "The tcp port number that Emby's https server should bind to.", "LabelEnableAutomaticPortMap": "Enable automatic port mapping", @@ -601,7 +601,7 @@ "TitleDlna": "DLNA", "HeaderServerSettings": "Server Settings", "HeaderRequireManualLogin": "Require manual username entry for:", - "HeaderRequireManualLoginHelp": "When disabled clients may present a login screen with a visual selection of users.", + "HeaderRequireManualLoginHelp": "When disabled, Emby apps may present a login screen with a visual selection of users.", "OptionOtherApps": "Other apps", "OptionMobileApps": "Mobile apps", "HeaderNotificationList": "Click on a notification to configure sending options.", @@ -703,7 +703,7 @@ "LabelEmbedAlbumArtDidl": "Embed album art in Didl", "LabelEmbedAlbumArtDidlHelp": "Some devices prefer this method for obtaining album art. Others may fail to play with this option enabled.", "LabelAlbumArtPN": "Album art PN:", - "LabelAlbumArtHelp": "PN used for album art, within the dlna:profileID attribute on upnp:albumArtURI. Some clients require a specific value, regardless of the size of the image.", + "LabelAlbumArtHelp": "PN used for album art, within the dlna:profileID attribute on upnp:albumArtURI. Some devices require a specific value, regardless of the size of the image.", "LabelAlbumArtMaxWidth": "Album art max width:", "LabelAlbumArtMaxWidthHelp": "Max resolution of album art exposed via upnp:albumArtURI.", "LabelAlbumArtMaxHeight": "Album art max height:", @@ -1231,7 +1231,7 @@ "OptionAllowMediaPlaybackTranscodingHelp": "Users will receive friendly messages when content is unplayable based on policy.", "TabStreaming": "Streaming", "LabelRemoteClientBitrateLimit": "Internet streaming bitrate limit (Mbps):", - "LabelRemoteClientBitrateLimitHelp": "An optional streaming bitrate limit for all out of network clients. This is useful to prevent clients from requesting a higher bitrate than your internet connection can handle.", + "LabelRemoteClientBitrateLimitHelp": "An optional streaming bitrate limit for all out of network devices. This is useful to prevent devices from requesting a higher bitrate than your internet connection can handle.", "LabelConversionCpuCoreLimit": "CPU core limit:", "LabelConversionCpuCoreLimitHelp": "Limit the number of CPU cores that will be used during sync conversion.", "OptionEnableFullSpeedConversion": "Enable full speed conversion", @@ -1722,7 +1722,7 @@ "ButtonChangeContentType": "Change content type", "HeaderMediaLocations": "Media Locations", "LabelContentTypeValue": "Content type: {0}", - "LabelPathSubstitutionHelp": "Optional: Path substitution can map server paths to network shares that clients can access for direct playback.", + "LabelPathSubstitutionHelp": "Optional: Path substitution can map server paths to network shares that Emby apps can access for direct playback.", "FolderTypeUnset": "Unset (mixed content)", "BirthPlaceValue": "Birth place: {0}", "DeathDateValue": "Died: {0}", diff --git a/dashboard-ui/useredit.html b/dashboard-ui/useredit.html index 9d4b20eb6a..15c8196364 100644 --- a/dashboard-ui/useredit.html +++ b/dashboard-ui/useredit.html @@ -1,4 +1,4 @@ -
+
@@ -42,68 +42,112 @@

-
- ${OptionAllowUserToManageServer} -
-
-
+
-
${HeaderFeatureAccess}
-
- ${OptionAllowDeleteLibraryContent} - ${OptionAllowContentDownloading} - ${OptionAllowBrowsingLiveTv} - ${OptionAllowManageLiveTv} +

${HeaderFeatureAccess}

+
+ + + +

-
${HeaderPlayback}
-
- ${OptionAllowMediaPlayback} - ${OptionAllowAudioPlaybackTranscoding} - ${OptionAllowVideoPlaybackTranscoding} - ${OptionAllowVideoPlaybackRemuxing} +

${HeaderPlayback}

+
+ + + +
${OptionAllowMediaPlaybackTranscodingHelp}
-

-
${HeaderRemoteControl}
-
- ${OptionAllowRemoteControlOthers} - ${OptionAllowRemoteSharedDevices} +

${HeaderRemoteControl}

+
+ + +
${OptionAllowRemoteSharedDevicesHelp}
-

-
${HeaderSync}
-
- ${OptionAllowSyncContent} - ${OptionAllowSyncTranscoding} +

${HeaderSync}

+
+ +

-
-
- ${OptionAllowLinkSharing} -
-
+
+ +
-
- ${OptionDisableUser} -
${OptionDisableUserHelp}
+
+ +
${OptionDisableUserHelp}
-
- ${OptionDisableUserPreferences} -
${OptionDisableUserPreferencesHelp}
+
+ +
${OptionDisableUserPreferencesHelp}
-
- ${OptionHideUser} -
${OptionHideUserFromLoginHelp}
+
+ +
${OptionHideUserFromLoginHelp}