Remove JS translations from frontend profile
This commit is contained in:
parent
969eacea7f
commit
072d3592fc
2
js/user-profile.min.js
vendored
2
js/user-profile.min.js
vendored
@ -1 +1 @@
|
||||
function fcn_unsetOauth(t,e,n){const a=prompt(sprintf(_x("Are you sure? Note that if you disconnect all accounts, you may no longer be able to log back in once you log out. Enter %s to confirm.","Unset OAuth prompt.","fictioneer"),_x("delete","Prompt deletion confirmation string.","fictioneer").toUpperCase()));if(!a||a.toLowerCase()!=_x("delete","Prompt deletion confirmation string.","fictioneer").toLowerCase())return;const r=_$$$(`oauth-${e}`);r.classList.add("ajax-in-progress"),fcn_ajaxPost(payload={action:"fictioneer_ajax_unset_my_oauth",nonce:t,channel:e,id:n}).then((t=>{t.success?(r.classList.remove("_connected"),r.classList.add("_disconnected"),r.querySelector("button").remove(),fcn_showNotification(r.dataset.unset)):(r.style.background="var(--notice-warning-background)",fcn_showNotification(t.data.error,5,"warning"))})).catch((t=>{t.status&&t.statusText&&(r.style.background="var(--notice-warning-background)",fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning"))})).then((()=>{r.classList.remove("ajax-in-progress")}))}function fcn_deleteMyAccount(t){if(_$$$("button-delete-my-account").hasAttribute("disabled"))return;const e=prompt(sprintf(t.dataset.warning,_x("delete","Prompt deletion confirmation string.","fictioneer").toUpperCase()));e&&e.toLowerCase()==_x("delete","Prompt deletion confirmation string.","fictioneer").toLowerCase()&&(_$$$("button-delete-my-account").setAttribute("disabled",!0),fcn_ajaxPost({action:"fictioneer_ajax_delete_my_account",nonce:t.dataset.nonce,id:t.dataset.id}).then((t=>{t.success?location.reload():(fcn_showNotification(t.data.error,5,"warning"),_$$$("button-delete-my-account").innerHTML=t.data.button)})).catch((t=>{t.status&&t.statusText&&(fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning"),_$$$("button-delete-my-account").innerHTML=response.data.button)})))}_$$(".button-unset-oauth").forEach((t=>{t.addEventListener("click",(t=>{fcn_unsetOauth(t.currentTarget.dataset.nonce,t.currentTarget.dataset.channel,t.currentTarget.dataset.id)}))})),_$$$("button-delete-my-account")?.addEventListener("click",(t=>{fcn_deleteMyAccount(t.currentTarget)}));const fcn_profileDataTranslations=_$$$("profile-data-translations")?.dataset;function fcn_dataDeletionPrompt(t){const e=prompt(sprintf(t.dataset.warning,_x("delete","Prompt deletion confirmation string.","fictioneer").toUpperCase()));return!(!e||e.toLowerCase()!=_x("delete","Prompt deletion confirmation string.","fictioneer").toLowerCase())}function fcn_clearData(t,e){const n=t.closest(".card");localStorage.removeItem("fcnBookshelfContent"),n.classList.add("ajax-in-progress"),t.remove(),fcn_ajaxPost({action:e,fcn_fast_ajax:1,nonce:t.dataset.nonce}).then((t=>{t.success?n.querySelector(".card__content").innerHTML=t.data.success:fcn_showNotification(t.data.error,10,"warning")})).catch((t=>{t.status&&t.statusText&&fcn_showNotification(`${t.status}: ${t.statusText}`,10,"warning")})).then((()=>{n.classList.remove("ajax-in-progress")}))}_$(".button-clear-comments")?.addEventListener("click",(t=>{fcn_dataDeletionPrompt(t.currentTarget)&&fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_comments")})),_$(".button-clear-comment-subscriptions")?.addEventListener("click",(t=>{fcn_dataDeletionPrompt(t.currentTarget)&&fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_comment_subscriptions")})),_$(".button-clear-checkmarks")?.addEventListener("click",(t=>{if(!fcn_dataDeletionPrompt(t.currentTarget))return;const e=fcn_getUserData();e.checkmarks={data:{},updated:Date.now()},fcn_setUserData(e),fcn_updateCheckmarksView(),fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_checkmarks",!0)})),_$(".button-clear-reminders")?.addEventListener("click",(t=>{if(!fcn_dataDeletionPrompt(t.currentTarget))return;const e=fcn_getUserData();e.reminders={data:{}},fcn_setUserData(e),fcn_updateRemindersView(),fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_reminders",!0)})),_$(".button-clear-follows")?.addEventListener("click",(t=>{if(!fcn_dataDeletionPrompt(t.currentTarget))return;const e=fcn_getUserData();e.follows={data:{}},fcn_setUserData(e),fcn_updateFollowsView(),fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_follows",!0)})),_$(".button-clear-bookmarks")?.addEventListener("click",(t=>{if(!fcn_dataDeletionPrompt(t.currentTarget))return;const e=fcn_getUserData();e.bookmarks="{}",fcn_setUserData(e),fcn_bookmarks.data={},t.currentTarget.closest(".card").querySelector(".card__content").innerHTML=fcn_profileDataTranslations.clearedSuccess,fcn_setBookmarks(fcn_bookmarks)}));
|
||||
function fcn_unsetOauth(t){const e=prompt(t.dataset.warning);if(!e||e.toLowerCase()!=t.dataset.confirm.toLowerCase())return;const a=_$$$(`oauth-${t.dataset.channel}`);a.classList.add("ajax-in-progress"),fcn_ajaxPost(payload={action:"fictioneer_ajax_unset_my_oauth",nonce:t.dataset.nonce,channel:t.dataset.channel,id:t.dataset.id}).then((t=>{t.success?(a.classList.remove("_connected"),a.classList.add("_disconnected"),a.querySelector("button").remove(),fcn_showNotification(a.dataset.unset)):(a.style.background="var(--notice-warning-background)",fcn_showNotification(t.data.error,5,"warning"))})).catch((t=>{t.status&&t.statusText&&(a.style.background="var(--notice-warning-background)",fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning"))})).then((()=>{a.classList.remove("ajax-in-progress")}))}function fcn_deleteMyAccount(t){if(_$$$("button-delete-my-account").hasAttribute("disabled"))return;const e=prompt(t.dataset.warning);e&&e.toLowerCase()==t.dataset.confirm.toLowerCase()&&(_$$$("button-delete-my-account").setAttribute("disabled",!0),fcn_ajaxPost({action:"fictioneer_ajax_delete_my_account",nonce:t.dataset.nonce,id:t.dataset.id}).then((t=>{t.success?location.reload():(fcn_showNotification(t.data.error,5,"warning"),_$$$("button-delete-my-account").innerHTML=t.data.button)})).catch((t=>{t.status&&t.statusText&&(fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning"),_$$$("button-delete-my-account").innerHTML=response.data.button)})))}_$$(".button-unset-oauth").forEach((t=>{t.addEventListener("click",(t=>{fcn_unsetOauth(t.currentTarget)}))})),_$$$("button-delete-my-account")?.addEventListener("click",(t=>{fcn_deleteMyAccount(t.currentTarget)}));const fcn_profileDataTranslations=_$$$("profile-data-translations")?.dataset;function fcn_dataDeletionPrompt(t){const e=prompt(t.dataset.warning);return!(!e||e.toLowerCase()!=t.dataset.confirm.toLowerCase())}function fcn_clearData(t,e){const a=t.closest(".card");localStorage.removeItem("fcnBookshelfContent"),a.classList.add("ajax-in-progress"),t.remove(),fcn_ajaxPost({action:e,fcn_fast_ajax:1,nonce:t.dataset.nonce}).then((t=>{t.success?a.querySelector(".card__content").innerHTML=t.data.success:fcn_showNotification(t.data.error,10,"warning")})).catch((t=>{t.status&&t.statusText&&fcn_showNotification(`${t.status}: ${t.statusText}`,10,"warning")})).then((()=>{a.classList.remove("ajax-in-progress")}))}_$(".button-clear-comments")?.addEventListener("click",(t=>{fcn_dataDeletionPrompt(t.currentTarget)&&fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_comments")})),_$(".button-clear-comment-subscriptions")?.addEventListener("click",(t=>{fcn_dataDeletionPrompt(t.currentTarget)&&fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_comment_subscriptions")})),_$(".button-clear-checkmarks")?.addEventListener("click",(t=>{if(!fcn_dataDeletionPrompt(t.currentTarget))return;const e=fcn_getUserData();e.checkmarks={data:{},updated:Date.now()},fcn_setUserData(e),fcn_updateCheckmarksView(),fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_checkmarks",!0)})),_$(".button-clear-reminders")?.addEventListener("click",(t=>{if(!fcn_dataDeletionPrompt(t.currentTarget))return;const e=fcn_getUserData();e.reminders={data:{}},fcn_setUserData(e),fcn_updateRemindersView(),fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_reminders",!0)})),_$(".button-clear-follows")?.addEventListener("click",(t=>{if(!fcn_dataDeletionPrompt(t.currentTarget))return;const e=fcn_getUserData();e.follows={data:{}},fcn_setUserData(e),fcn_updateFollowsView(),fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_follows",!0)})),_$(".button-clear-bookmarks")?.addEventListener("click",(t=>{if(!fcn_dataDeletionPrompt(t.currentTarget))return;const e=fcn_getUserData();e.bookmarks="{}",fcn_setUserData(e),fcn_bookmarks.data={},t.currentTarget.closest(".card").querySelector(".card__content").innerHTML=fcn_profileDataTranslations.clearedSuccess,fcn_setBookmarks(fcn_bookmarks)}));
|
@ -27,6 +27,13 @@ if ( ! current_user_can( 'fcn_allow_self_delete' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Prompts
|
||||
$confirmation = _x( 'DELETE', 'Prompt deletion confirmation string.', 'fictioneer' );
|
||||
$delete_account_prompt = sprintf(
|
||||
__( 'Are you sure? Your account will be irrevocably deleted, although this will not remove your comments. Enter %s to confirm.', 'fictioneer' ),
|
||||
$confirmation
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<h3 class="profile__danger-headline"><?php _e( 'Danger Zone', 'fictioneer' ); ?></h3>
|
||||
@ -34,5 +41,5 @@ if ( ! current_user_can( 'fcn_allow_self_delete' ) ) {
|
||||
<p class="profile__description"><?php _e( 'You can delete your account and associated data with it. Submitted <em>content</em> such as comments will remain under the “Deleted User” name unless you clear that <em>prior</em>. Be aware that once you delete your account, there is no going back.', 'fictioneer' ); ?></p>
|
||||
|
||||
<div class="profile__actions">
|
||||
<button id="button-delete-my-account" type="button" data-nonce="<?php echo wp_create_nonce( 'fictioneer_delete_account' ); ?>" data-warning="<?php esc_attr_e( 'Are you sure? Your account will be irrevocably deleted, although this will not remove your comments. Enter %s to confirm.', 'fictioneer' ); ?>" class="button _danger" data-id="<?php echo $current_user->ID; ?>"><?php _e( 'Delete Account', 'fictioneer' ); ?></button>
|
||||
<button id="button-delete-my-account" type="button" class="button _danger" data-nonce="<?php echo wp_create_nonce( 'fictioneer_delete_account' ); ?>" data-id="<?php echo $current_user->ID; ?>" data-confirm="<?php echo $confirmation; ?>" data-warning="<?php echo esc_attr( $delete_account_prompt ); ?>"><?php _e( 'Delete Account', 'fictioneer' ); ?></button>
|
||||
</div>
|
||||
|
@ -71,6 +71,33 @@ if ( $can_checkmarks ) {
|
||||
$args['checkmarks'] = $checkmarks;
|
||||
}
|
||||
|
||||
// Prompts
|
||||
$confirmation = _x( 'DELETE', 'Prompt deletion confirmation string.', 'fictioneer' );
|
||||
$delete_comments_prompt = sprintf(
|
||||
__( 'Are you sure? Comments will be irrevocably deleted. Enter %s to confirm.', 'fictioneer' ),
|
||||
$confirmation
|
||||
);
|
||||
$delete_comment_subscriptions_prompt = sprintf(
|
||||
__( 'Are you sure? Comment subscriptions will be irrevocably deleted. Enter %s to confirm.', 'fictioneer' ),
|
||||
$confirmation
|
||||
);
|
||||
$delete_follows_prompt = sprintf(
|
||||
__( 'Are you sure? Follows will be irrevocably deleted. Enter %s to confirm.', 'fictioneer' ),
|
||||
$confirmation
|
||||
);
|
||||
$delete_reminders_prompt = sprintf(
|
||||
__( 'Are you sure? Reminders will be irrevocably deleted. Enter %s to confirm.', 'fictioneer' ),
|
||||
$confirmation
|
||||
);
|
||||
$delete_checkmarks_prompt = sprintf(
|
||||
__( 'Are you sure? Checkmarks will be irrevocably deleted. Enter %s to confirm.', 'fictioneer' ),
|
||||
$confirmation
|
||||
);
|
||||
$delete_bookmarks_prompt = sprintf(
|
||||
__( 'Are you sure? Bookmarks will be irrevocably deleted. Enter %s to confirm.', 'fictioneer' ),
|
||||
$confirmation
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<div id="profile-data-translations" data-cleared-success="<?php esc_attr_e( 'Data has been cleared.', 'fictioneer' ); ?>" data-cleared-error="<?php esc_attr_e( 'Error. Data could not be cleared.', 'fictioneer' ); ?>" hidden></div>
|
||||
@ -105,7 +132,7 @@ if ( $can_checkmarks ) {
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<button class="card__delete button-clear-comments" data-nonce="<?php echo wp_create_nonce( 'fictioneer_clear_comments' ); ?>" data-warning="<?php esc_attr_e( 'Are you sure? Comments will be irrevocably deleted. Enter %s to confirm.', 'fictioneer' ); ?>"><i class="fa-solid fa-trash-can"></i></button>
|
||||
<button class="card__delete button-clear-comments" data-nonce="<?php echo wp_create_nonce( 'fictioneer_clear_comments' ); ?>" data-confirm="<?php echo $confirmation; ?>" data-warning="<?php echo esc_attr( $delete_comments_prompt ); ?>"><i class="fa-solid fa-trash-can"></i></button>
|
||||
</div>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
@ -127,7 +154,7 @@ if ( $can_checkmarks ) {
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<button class="card__delete button-clear-comment-subscriptions" data-nonce="<?php echo wp_create_nonce( 'fictioneer_clear_comment_subscriptions' ); ?>" data-warning="<?php esc_attr_e( 'Are you sure? Comment subscriptions will be irrevocably deleted. Enter %s to confirm.', 'fictioneer' ); ?>"><i class="fa-solid fa-trash-can"></i></button>
|
||||
<button class="card__delete button-clear-comment-subscriptions" data-nonce="<?php echo wp_create_nonce( 'fictioneer_clear_comment_subscriptions' ); ?>" data-confirm="<?php echo $confirmation; ?>" data-warning="<?php echo esc_attr( $delete_comment_subscriptions_prompt ); ?>"><i class="fa-solid fa-trash-can"></i></button>
|
||||
</div>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
@ -158,7 +185,7 @@ if ( $can_checkmarks ) {
|
||||
</div>
|
||||
</div>
|
||||
<?php if ( $follows_count > 0 ) : ?>
|
||||
<button class="card__delete button-clear-follows" data-nonce="<?php echo wp_create_nonce( 'fictioneer_clear_follows' ); ?>" data-warning="<?php esc_attr_e( 'Are you sure? Follows will be irrevocably deleted. Enter %s to confirm.', 'fictioneer' ); ?>"><i class="fa-solid fa-trash-can"></i></button>
|
||||
<button class="card__delete button-clear-follows" data-nonce="<?php echo wp_create_nonce( 'fictioneer_clear_follows' ); ?>" data-confirm="<?php echo $confirmation; ?>" data-warning="<?php echo esc_attr( $delete_follows_prompt ); ?>"><i class="fa-solid fa-trash-can"></i></button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</li>
|
||||
@ -190,7 +217,7 @@ if ( $can_checkmarks ) {
|
||||
</div>
|
||||
</div>
|
||||
<?php if ( $reminders_count > 0 ) : ?>
|
||||
<button class="card__delete button-clear-reminders" data-nonce="<?php echo wp_create_nonce( 'fictioneer_clear_reminders' ); ?>" data-warning="<?php esc_attr_e( 'Are you sure? Reminders will be irrevocably deleted. Enter %s to confirm.', 'fictioneer' ); ?>"><i class="fa-solid fa-trash-can"></i></button>
|
||||
<button class="card__delete button-clear-reminders" data-nonce="<?php echo wp_create_nonce( 'fictioneer_clear_reminders' ); ?>" data-confirm="<?php echo $confirmation; ?>" data-warning="<?php echo esc_attr( $delete_reminders_prompt ); ?>"><i class="fa-solid fa-trash-can"></i></button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</li>
|
||||
@ -227,7 +254,7 @@ if ( $can_checkmarks ) {
|
||||
</div>
|
||||
</div>
|
||||
<?php if ( $stories_count > 0 || $chapters_count > 0 ) : ?>
|
||||
<button class="card__delete button-clear-checkmarks" data-nonce="<?php echo wp_create_nonce( 'fictioneer_clear_checkmarks' ); ?>" data-warning="<?php esc_attr_e( 'Are you sure? Checkmarks will be irrevocably deleted. Enter %s to confirm.', 'fictioneer' ); ?>"><i class="fa-solid fa-trash-can"></i></button>
|
||||
<button class="card__delete button-clear-checkmarks" data-nonce="<?php echo wp_create_nonce( 'fictioneer_clear_checkmarks' ); ?>" data-confirm="<?php echo $confirmation; ?>" data-warning="<?php echo esc_attr( $delete_checkmarks_prompt ); ?>"><i class="fa-solid fa-trash-can"></i></button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</li>
|
||||
@ -250,7 +277,7 @@ if ( $can_checkmarks ) {
|
||||
<?php _e( 'You have currently <b>%s bookmark(s)</b> set. Bookmarks are only processed in your browser.', 'fictioneer' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<button class="card__delete button-clear-bookmarks" data-warning="<?php esc_attr_e( 'Are you sure? Bookmarks will be irrevocably deleted. Enter %s to confirm.', 'fictioneer' ); ?>"><i class="fa-solid fa-trash-can"></i></button>
|
||||
<button class="card__delete button-clear-bookmarks" data-confirm="<?php echo $confirmation; ?>" data-warning="<?php echo esc_attr( $delete_bookmarks_prompt ); ?>"><i class="fa-solid fa-trash-can"></i></button>
|
||||
</div>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
@ -35,7 +35,14 @@ $oauth_providers = [
|
||||
['google', 'Google'],
|
||||
['patreon', 'Patreon']
|
||||
];
|
||||
$unset_notification = __( '%s connection successfully unset.', 'fictioneer' )
|
||||
$unset_notification = __( '%s connection successfully unset.', 'fictioneer' );
|
||||
|
||||
// Prompts
|
||||
$confirmation = _x( 'DELETE', 'Prompt deletion confirmation string.', 'fictioneer' );
|
||||
$unset_oauth_prompt = sprintf(
|
||||
__( 'Are you sure? Note that if you disconnect all accounts, you may no longer be able to log back in once you log out. Enter %s to confirm.', 'fictioneer' ),
|
||||
$confirmation
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
@ -104,6 +111,8 @@ $unset_notification = __( '%s connection successfully unset.', 'fictioneer' )
|
||||
data-nonce="<?php echo wp_create_nonce( 'fictioneer_unset_oauth' ); ?>"
|
||||
data-id="<?php echo $current_user->ID; ?>"
|
||||
data-channel="<?php echo $provider[0]; ?>"
|
||||
data-confirm="<?php echo $confirmation; ?>"
|
||||
data-warning="<?php echo esc_attr( $unset_oauth_prompt ); ?>"
|
||||
><?php fictioneer_icon( 'fa-xmark' ); ?></button>
|
||||
</div>
|
||||
<?php
|
||||
|
@ -11,28 +11,17 @@
|
||||
* validated server-side as well.
|
||||
*
|
||||
* @since 4.5.0
|
||||
* @param {String} none - Nonce for the action.
|
||||
* @param {String} channel - The OAuth channel to delete.
|
||||
* @param {Number} id - The ID of the user.
|
||||
* @param {HTMLElement} button - The clicked button.
|
||||
*/
|
||||
|
||||
function fcn_unsetOauth(nonce, channel, id) {
|
||||
// Confirm deletion request using localized string
|
||||
const confirm = prompt(
|
||||
sprintf(
|
||||
_x('Are you sure? Note that if you disconnect all accounts, you may no longer be able to log back in once you log out. Enter %s to confirm.', 'Unset OAuth prompt.', 'fictioneer'),
|
||||
_x('delete', 'Prompt deletion confirmation string.', 'fictioneer').toUpperCase()
|
||||
)
|
||||
);
|
||||
function fcn_unsetOauth(button) {
|
||||
const confirm = prompt(button.dataset.warning);
|
||||
|
||||
if (
|
||||
!confirm ||
|
||||
confirm.toLowerCase() != _x('delete', 'Prompt deletion confirmation string.', 'fictioneer').toLowerCase()
|
||||
) {
|
||||
if (!confirm || confirm.toLowerCase() != button.dataset.confirm.toLowerCase()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const connection = _$$$(`oauth-${channel}`);
|
||||
const connection = _$$$(`oauth-${button.dataset.channel}`);
|
||||
|
||||
// Mark as in-progress
|
||||
connection.classList.add('ajax-in-progress');
|
||||
@ -40,9 +29,9 @@ function fcn_unsetOauth(nonce, channel, id) {
|
||||
// Request
|
||||
fcn_ajaxPost(payload = {
|
||||
'action': 'fictioneer_ajax_unset_my_oauth',
|
||||
'nonce': nonce,
|
||||
'channel': channel,
|
||||
'id': id
|
||||
'nonce': button.dataset.nonce,
|
||||
'channel': button.dataset.channel,
|
||||
'id': button.dataset.id
|
||||
})
|
||||
.then(response => {
|
||||
if (response.success) {
|
||||
@ -74,11 +63,7 @@ _$$('.button-unset-oauth').forEach(element => {
|
||||
element.addEventListener(
|
||||
'click',
|
||||
e => {
|
||||
fcn_unsetOauth(
|
||||
e.currentTarget.dataset.nonce,
|
||||
e.currentTarget.dataset.channel,
|
||||
e.currentTarget.dataset.id
|
||||
);
|
||||
fcn_unsetOauth(e.currentTarget);
|
||||
}
|
||||
);
|
||||
});
|
||||
@ -105,17 +90,9 @@ function fcn_deleteMyAccount(button) {
|
||||
return;
|
||||
}
|
||||
|
||||
const confirm = prompt(
|
||||
sprintf(
|
||||
button.dataset.warning,
|
||||
_x('delete', 'Prompt deletion confirmation string.', 'fictioneer').toUpperCase()
|
||||
)
|
||||
);
|
||||
const confirm = prompt(button.dataset.warning);
|
||||
|
||||
if (
|
||||
!confirm ||
|
||||
confirm.toLowerCase() != _x('delete', 'Prompt deletion confirmation string.', 'fictioneer').toLowerCase()
|
||||
) {
|
||||
if (!confirm || confirm.toLowerCase() != button.dataset.confirm.toLowerCase()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -169,17 +146,11 @@ const /** @const {DOMStringMap} */ fcn_profileDataTranslations = _$$$('profile-d
|
||||
*/
|
||||
|
||||
function fcn_dataDeletionPrompt(button) {
|
||||
const confirm = prompt(
|
||||
sprintf(
|
||||
button.dataset.warning,
|
||||
_x('delete', 'Prompt deletion confirmation string.', 'fictioneer').toUpperCase()
|
||||
)
|
||||
);
|
||||
const confirm = prompt(button.dataset.warning);
|
||||
|
||||
if (
|
||||
!confirm ||
|
||||
confirm.toLowerCase() != _x('delete', 'Prompt deletion confirmation string.', 'fictioneer').toLowerCase()
|
||||
) return false;
|
||||
if (!confirm || confirm.toLowerCase() != button.dataset.confirm.toLowerCase()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user