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

fix dialogs

This commit is contained in:
Luke Pulverenti 2016-09-09 22:21:00 -04:00
parent 29f295b69c
commit d08ee04bdb
10 changed files with 113 additions and 70 deletions

View file

@ -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) { function showTvDialog(options) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
@ -65,6 +65,8 @@ define(['dialogHelper', 'layoutManager', 'scrollHelper', 'globalize', 'require',
html += '<button is="emby-button" type="button" class="' + buttonClass + '" data-id="' + item.id + '"' + autoFocus + '>' + item.name + '</button>'; html += '<button is="emby-button" type="button" class="' + buttonClass + '" data-id="' + item.id + '"' + autoFocus + '>' + item.name + '</button>';
} }
dlg.style.minWidth = (Math.min(options.buttons.length * 150, dom.getWindowSize().innerWidth - 50)) + 'px';
dlg.querySelector('.formDialogFooter').innerHTML = html; dlg.querySelector('.formDialogFooter').innerHTML = html;
var dialogResult; var dialogResult;

View file

@ -149,7 +149,7 @@
}, 0); }, 0);
dom.addEventListener((dlg.dialogContainer || backdrop), 'click', function (e) { dom.addEventListener((dlg.dialogContainer || backdrop), 'click', function (e) {
if (!isParent(dlg, e.target)) { if (e.target == dlg.dialogContainer) {
close(dlg); 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) { function isHistoryEnabled(dlg) {
return dlg.getAttribute('data-history') == 'true'; return dlg.getAttribute('data-history') == 'true';
} }

View file

@ -12,7 +12,7 @@
} }
.formDialogHeader, .formDialogFooter { .formDialogHeader, .formDialogFooter {
background-color: #1D1E21; background-color: #222326;
} }
.formDialogHeaderTitle { .formDialogHeaderTitle {

View file

@ -357,6 +357,11 @@
}); });
context.querySelector('.btnHeaderSave').addEventListener('click', function (e) {
context.querySelector('.btnSave').click();
});
context.querySelector('#chkLockData').addEventListener('click', function (e) { context.querySelector('#chkLockData').addEventListener('click', function (e) {
if (!e.target.checked) { if (!e.target.checked) {
@ -1208,6 +1213,8 @@
elem.innerHTML = globalize.translateDocument(template, 'sharedcomponents'); elem.innerHTML = globalize.translateDocument(template, 'sharedcomponents');
elem.querySelector('.formDialogFooter').classList.remove('formDialogFooter');
elem.querySelector('.btnHeaderSave').classList.remove('hide');
elem.querySelector('.btnCancel').classList.add('hide'); elem.querySelector('.btnCancel').classList.add('hide');
currentContext = elem; currentContext = elem;

View file

@ -4,6 +4,10 @@
${Edit} ${Edit}
</h3> </h3>
<div style="margin-left: auto; display: flex; align-items: center; justify-content: center;"> <div style="margin-left: auto; display: flex; align-items: center; justify-content: center;">
<button is="emby-button" type="button" class="btnHeaderSave button-accent-flat hide" tabindex="-1">
<i class="md-icon">check</i>
<span>${Save}</span>
</button>
<button is="paper-icon-button-light" class="btnMore autoSize" tabindex="-1"> <button is="paper-icon-button-light" class="btnMore autoSize" tabindex="-1">
<i class="md-icon">more_vert</i> <i class="md-icon">more_vert</i>
</button> </button>

View file

@ -397,7 +397,7 @@
html += globalize.translate('sharedcomponents#Sync'); html += globalize.translate('sharedcomponents#Sync');
html += '</h3>'; html += '</h3>';
html += '<a href="https://github.com/MediaBrowser/Wiki/wiki/Sync" target="_blank" class="clearLink lnkHelp" style="margin-top:0;display:inline-block;vertical-align:middle;margin-left:auto;"><button is="emby-button" type="button" class="mini"><i class="md-icon">info</i><span>' + globalize.translate('sharedcomponents#Help') + '</span></button></a>'; html += '<a href="https://github.com/MediaBrowser/Wiki/wiki/Sync" target="_blank" class="clearLink lnkHelp" style="margin-top:0;display:inline-block;vertical-align:middle;margin-left:auto;"><button is="emby-button" type="button" class="button-accent-flat"><i class="md-icon">info</i><span>' + globalize.translate('sharedcomponents#Help') + '</span></button></a>';
html += '</div>'; html += '</div>';

View file

@ -95,7 +95,7 @@
</div> </div>
<br /> <br />
<div> <div>
<button is="emby-button" type="submit" class="raised submit block"><i class="md-icon">check</i><span>${ButtonSave}</span></button> <button is="emby-button" type="submit" class="raised button-submit block"><i class="md-icon">check</i><span>${ButtonSave}</span></button>
</div> </div>
</form> </form>
</div> </div>

View file

@ -1,4 +1,4 @@
define(['jQuery'], function ($) { define(['jQuery', 'fnchecked'], function ($) {
var currentUser; var currentUser;

View file

@ -338,7 +338,7 @@
"TitleMetadata": "Metadata", "TitleMetadata": "Metadata",
"LabelFanartApiKey": "Personal api key:", "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.", "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:", "LabelMetadataDownloadLanguage": "Preferred download language:",
"ButtonSignIn": "Sign In", "ButtonSignIn": "Sign In",
"TitleSignIn": "Sign In", "TitleSignIn": "Sign In",
@ -446,12 +446,12 @@
"ButtonPlayTrailer": "Trailer", "ButtonPlayTrailer": "Trailer",
"LabelMissing": "Missing", "LabelMissing": "Missing",
"LabelOffline": "Offline", "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", "HeaderFrom": "From",
"HeaderTo": "To", "HeaderTo": "To",
"LabelFrom": "From:", "LabelFrom": "From:",
"LabelTo": "To:", "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", "ButtonAddPathSubstitution": "Add Substitution",
"OptionSpecialEpisode": "Specials", "OptionSpecialEpisode": "Specials",
"OptionMissingEpisode": "Missing Episodes", "OptionMissingEpisode": "Missing Episodes",
@ -494,7 +494,7 @@
"LabelPublicHttpsPort": "Public https port number:", "LabelPublicHttpsPort": "Public https port number:",
"LabelPublicHttpsPortHelp": "The public port number that should be mapped to the local https port.", "LabelPublicHttpsPortHelp": "The public port number that should be mapped to the local https port.",
"LabelEnableHttps": "Report https as external address", "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:", "LabelHttpsPort": "Local https port number:",
"LabelHttpsPortHelp": "The tcp port number that Emby's https server should bind to.", "LabelHttpsPortHelp": "The tcp port number that Emby's https server should bind to.",
"LabelEnableAutomaticPortMap": "Enable automatic port mapping", "LabelEnableAutomaticPortMap": "Enable automatic port mapping",
@ -601,7 +601,7 @@
"TitleDlna": "DLNA", "TitleDlna": "DLNA",
"HeaderServerSettings": "Server Settings", "HeaderServerSettings": "Server Settings",
"HeaderRequireManualLogin": "Require manual username entry for:", "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", "OptionOtherApps": "Other apps",
"OptionMobileApps": "Mobile apps", "OptionMobileApps": "Mobile apps",
"HeaderNotificationList": "Click on a notification to configure sending options.", "HeaderNotificationList": "Click on a notification to configure sending options.",
@ -703,7 +703,7 @@
"LabelEmbedAlbumArtDidl": "Embed album art in Didl", "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.", "LabelEmbedAlbumArtDidlHelp": "Some devices prefer this method for obtaining album art. Others may fail to play with this option enabled.",
"LabelAlbumArtPN": "Album art PN:", "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:", "LabelAlbumArtMaxWidth": "Album art max width:",
"LabelAlbumArtMaxWidthHelp": "Max resolution of album art exposed via upnp:albumArtURI.", "LabelAlbumArtMaxWidthHelp": "Max resolution of album art exposed via upnp:albumArtURI.",
"LabelAlbumArtMaxHeight": "Album art max height:", "LabelAlbumArtMaxHeight": "Album art max height:",
@ -1231,7 +1231,7 @@
"OptionAllowMediaPlaybackTranscodingHelp": "Users will receive friendly messages when content is unplayable based on policy.", "OptionAllowMediaPlaybackTranscodingHelp": "Users will receive friendly messages when content is unplayable based on policy.",
"TabStreaming": "Streaming", "TabStreaming": "Streaming",
"LabelRemoteClientBitrateLimit": "Internet streaming bitrate limit (Mbps):", "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:", "LabelConversionCpuCoreLimit": "CPU core limit:",
"LabelConversionCpuCoreLimitHelp": "Limit the number of CPU cores that will be used during sync conversion.", "LabelConversionCpuCoreLimitHelp": "Limit the number of CPU cores that will be used during sync conversion.",
"OptionEnableFullSpeedConversion": "Enable full speed conversion", "OptionEnableFullSpeedConversion": "Enable full speed conversion",
@ -1722,7 +1722,7 @@
"ButtonChangeContentType": "Change content type", "ButtonChangeContentType": "Change content type",
"HeaderMediaLocations": "Media Locations", "HeaderMediaLocations": "Media Locations",
"LabelContentTypeValue": "Content type: {0}", "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)", "FolderTypeUnset": "Unset (mixed content)",
"BirthPlaceValue": "Birth place: {0}", "BirthPlaceValue": "Birth place: {0}",
"DeathDateValue": "Died: {0}", "DeathDateValue": "Died: {0}",

View file

@ -1,4 +1,4 @@
<div id="editUserPage" data-role="page" class="page type-interior userProfilesPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Users" data-require="scripts/useredit,emby-input,paper-checkbox,emby-button"> <div id="editUserPage" data-role="page" class="page type-interior userProfilesPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Users" data-require="scripts/useredit,emby-input,emby-checkbox,emby-button">
<div data-role="content"> <div data-role="content">
<div class="content-primary"> <div class="content-primary">
@ -42,68 +42,112 @@
</div> </div>
</div> </div>
<br /> <br />
<div> <label class="checkboxContainer">
<paper-checkbox id="chkIsAdmin">${OptionAllowUserToManageServer}</paper-checkbox> <input type="checkbox" is="emby-checkbox" id="chkIsAdmin" />
</div> <span>${OptionAllowUserToManageServer}</span>
<br /> </label>
<br />
<div id="featureAccessFields"> <div id="featureAccessFields">
<div class="paperListLabel">${HeaderFeatureAccess}</div> <h3 class="paperListLabel">${HeaderFeatureAccess}</h3>
<div class="paperCheckboxList paperList" style="padding:.5em 1em;"> <div class="checkboxList paperList" style="padding:.5em 1em;">
<paper-checkbox id="chkEnableContentDeletion">${OptionAllowDeleteLibraryContent}</paper-checkbox> <label>
<paper-checkbox id="chkEnableDownloading">${OptionAllowContentDownloading}</paper-checkbox> <input type="checkbox" is="emby-checkbox" id="chkEnableContentDeletion" />
<paper-checkbox id="chkEnableLiveTvAccess">${OptionAllowBrowsingLiveTv}</paper-checkbox> <span>${OptionAllowDeleteLibraryContent}</span>
<paper-checkbox id="chkManageLiveTv">${OptionAllowManageLiveTv}</paper-checkbox> </label>
<label>
<input type="checkbox" is="emby-checkbox" id="chkEnableDownloading" />
<span>${OptionAllowContentDownloading}</span>
</label>
<label>
<input type="checkbox" is="emby-checkbox" id="chkEnableLiveTvAccess" />
<span>${OptionAllowBrowsingLiveTv}</span>
</label>
<label>
<input type="checkbox" is="emby-checkbox" id="chkManageLiveTv" />
<span>${OptionAllowManageLiveTv}</span>
</label>
</div> </div>
</div> </div>
<div> <div>
<br /> <br />
<div class="paperListLabel">${HeaderPlayback}</div> <h3 class="paperListLabel">${HeaderPlayback}</h3>
<div class="paperCheckboxList paperList" style="padding:.5em 1em;"> <div class="checkboxList paperList" style="padding:.5em 1em;">
<paper-checkbox id="chkEnableMediaPlayback">${OptionAllowMediaPlayback}</paper-checkbox> <label>
<paper-checkbox id="chkEnableAudioPlaybackTranscoding">${OptionAllowAudioPlaybackTranscoding}</paper-checkbox> <input type="checkbox" is="emby-checkbox" id="chkEnableMediaPlayback" />
<paper-checkbox id="chkEnableVideoPlaybackTranscoding">${OptionAllowVideoPlaybackTranscoding}</paper-checkbox> <span>${OptionAllowMediaPlayback}</span>
<paper-checkbox id="chkEnableVideoPlaybackRemuxing">${OptionAllowVideoPlaybackRemuxing}</paper-checkbox> </label>
<label>
<input type="checkbox" is="emby-checkbox" id="chkEnableAudioPlaybackTranscoding" />
<span>${OptionAllowAudioPlaybackTranscoding}</span>
</label>
<label>
<input type="checkbox" is="emby-checkbox" id="chkEnableVideoPlaybackTranscoding" />
<span>${OptionAllowVideoPlaybackTranscoding}</span>
</label>
<label>
<input type="checkbox" is="emby-checkbox" id="chkEnableVideoPlaybackRemuxing" />
<span>${OptionAllowVideoPlaybackRemuxing}</span>
</label>
</div> </div>
<div class="fieldDescription">${OptionAllowMediaPlaybackTranscodingHelp}</div> <div class="fieldDescription">${OptionAllowMediaPlaybackTranscodingHelp}</div>
<br />
</div> </div>
<div> <div>
<br /> <br />
<div class="paperListLabel">${HeaderRemoteControl}</div> <h3 class="checkboxListLabel">${HeaderRemoteControl}</h3>
<div class="paperCheckboxList paperList" style="padding:.5em 1em;"> <div class="checkboxList paperList" style="padding:.5em 1em;">
<paper-checkbox id="chkEnableRemoteControlOtherUsers">${OptionAllowRemoteControlOthers}</paper-checkbox> <label>
<paper-checkbox id="chkRemoteControlSharedDevices">${OptionAllowRemoteSharedDevices}</paper-checkbox> <input type="checkbox" is="emby-checkbox" id="chkEnableRemoteControlOtherUsers" />
<span>${OptionAllowRemoteControlOthers}</span>
</label>
<label>
<input type="checkbox" is="emby-checkbox" id="chkRemoteControlSharedDevices" />
<span>${OptionAllowRemoteSharedDevices}</span>
</label>
</div> </div>
<div class="fieldDescription">${OptionAllowRemoteSharedDevicesHelp}</div> <div class="fieldDescription">${OptionAllowRemoteSharedDevicesHelp}</div>
<br />
</div> </div>
<div> <div>
<br /> <br />
<div class="paperListLabel">${HeaderSync}</div> <h3 class="checkboxListLabel">${HeaderSync}</h3>
<div class="paperCheckboxList paperList" style="padding:.5em 1em;"> <div class="checkboxList paperList" style="padding:.5em 1em;">
<paper-checkbox id="chkEnableSync">${OptionAllowSyncContent}</paper-checkbox> <label>
<paper-checkbox id="chkEnableSyncTranscoding">${OptionAllowSyncTranscoding}</paper-checkbox> <input type="checkbox" is="emby-checkbox" id="chkEnableSync" />
<span>${OptionAllowSyncContent}</span>
</label>
<label>
<input type="checkbox" is="emby-checkbox" id="chkEnableSyncTranscoding" />
<span>${OptionAllowSyncTranscoding}</span>
</label>
</div> </div>
<br /> <br />
</div> </div>
<div> <div class="checkboxContainer checkboxContainer-withDescription">
<br /> <label>
<paper-checkbox id="chkEnableSharing">${OptionAllowLinkSharing}</paper-checkbox> <input type="checkbox" is="emby-checkbox" id="chkEnableSharing" />
<div class="fieldDescription paperCheckboxFieldDescription sharingHelp"></div> <span>${OptionAllowLinkSharing}</span>
<br /> </label>
<div class="fieldDescription checkboxFieldDescription sharingHelp"></div>
</div> </div>
<div id="fldIsEnabled" style="margin: 1em 0 2em;"> <div class="checkboxContainer checkboxContainer-withDescription" id="fldIsEnabled">
<paper-checkbox id="chkDisabled">${OptionDisableUser}</paper-checkbox> <label>
<div class="fieldDescription paperCheckboxFieldDescription">${OptionDisableUserHelp}</div> <input type="checkbox" is="emby-checkbox" id="chkDisabled" />
<span>${OptionDisableUser}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${OptionDisableUserHelp}</div>
</div> </div>
<div style="margin: 1em 0;"> <div class="checkboxContainer checkboxContainer-withDescription">
<paper-checkbox id="chkDisableUserPreferences">${OptionDisableUserPreferences}</paper-checkbox> <label>
<div class="fieldDescription paperCheckboxFieldDescription">${OptionDisableUserPreferencesHelp}</div> <input type="checkbox" is="emby-checkbox" id="chkDisableUserPreferences" />
<span>${OptionDisableUserPreferences}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${OptionDisableUserPreferencesHelp}</div>
</div> </div>
<div id="fldIsHidden" style="margin: 2em 0 1em;"> <div class="checkboxContainer checkboxContainer-withDescription" id="fldIsHidden">
<paper-checkbox id="chkIsHidden">${OptionHideUser}</paper-checkbox> <label>
<div class="fieldDescription paperCheckboxFieldDescription">${OptionHideUserFromLoginHelp}</div> <input type="checkbox" is="emby-checkbox" id="chkIsHidden" />
<span>${OptionHideUser}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${OptionHideUserFromLoginHelp}</div>
</div> </div>
<br /> <br />
<div> <div>