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) {
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>';
}
dlg.style.minWidth = (Math.min(options.buttons.length * 150, dom.getWindowSize().innerWidth - 50)) + 'px';
dlg.querySelector('.formDialogFooter').innerHTML = html;
var dialogResult;

View File

@ -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';
}

View File

@ -12,7 +12,7 @@
}
.formDialogHeader, .formDialogFooter {
background-color: #1D1E21;
background-color: #222326;
}
.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) {
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;

View File

@ -4,6 +4,10 @@
${Edit}
</h3>
<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">
<i class="md-icon">more_vert</i>
</button>

View File

@ -397,7 +397,7 @@
html += globalize.translate('sharedcomponents#Sync');
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>';

View File

@ -95,7 +95,7 @@
</div>
<br />
<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>
</form>
</div>

View File

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

View File

@ -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}",

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