Apply fast AJAX to reminders

This commit is contained in:
Tetrakern 2023-08-21 02:34:01 +02:00
parent 0a310f473e
commit 708b2213aa
9 changed files with 25 additions and 8 deletions

View File

@ -328,7 +328,12 @@ define(
'fictioneer_ajax_clear_my_follows',
'fictioneer_ajax_mark_follows_read',
'fictioneer_ajax_get_follows_notifications',
'fictioneer_ajax_get_follows_list'
'fictioneer_ajax_get_follows_list',
// Reminders
'fictioneer_ajax_get_reminders',
'fictioneer_ajax_toggle_reminder',
'fictioneer_ajax_clear_my_reminders',
'fictioneer_ajax_get_reminders_list'
)
);
@ -362,6 +367,15 @@ function fictioneer_do_fast_ajax() {
require_once __DIR__ . '/includes/functions/users/_follows.php';
}
if ( get_option( 'fictioneer_enable_reminders' ) && strpos( $action, '_reminder' ) !== false ) {
require_once __DIR__ . '/includes/functions/_content_helpers.php';
require_once __DIR__ . '/includes/functions/users/_reminders.php';
}
if ( strpos( $action, '_list' ) !== false ) {
require_once __DIR__ . '/includes/functions/_wordpress_mods.php';
}
if ( strpos( $action, '_comment' ) !== false ) {
require_once __DIR__ . '/includes/functions/comments/_comments_controller.php';
require_once __DIR__ . '/includes/functions/comments/_comments_ajax.php';

View File

@ -28,7 +28,6 @@ if ( ! function_exists( 'fictioneer_get_card_list' ) ) {
$post_type = in_array( $type, ['story', 'chapter', 'collection', 'recommendation'] ) ? "fcn_$type" : $type;
$page = $query_args['paged'] ?? 1;
$is_empty = false;
$is_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX;
// Validations
if ( ! in_array( $post_type, $allowed_types ) ) {
@ -47,7 +46,7 @@ if ( ! function_exists( 'fictioneer_get_card_list' ) ) {
// Default card arguments
$the_card_args = array(
'cache' => ! $is_ajax && fictioneer_caching_active() && ! fictioneer_private_caching_active()
'cache' => fictioneer_caching_active() && ! fictioneer_private_caching_active()
);
// Merge with optional arguments

View File

@ -605,7 +605,7 @@ if ( get_option( 'fictioneer_enable_lightbox' ) ) {
}
/**
* Adds data-lightbox attribute if enabled
* Returns data-lightbox attribute if enabled
*
* @since 4.7
*

View File

@ -1 +1 @@
const fcn_bookshelfTarget=_$$$("ajax-bookshelf-target");function fcn_getBookshelfContent(){const e=localStorage.getItem("fcnBookshelfContent");return e&&fcn_isValidJSONString(e)?JSON.parse(e):{html:{},count:{}}}function fcn_updateBookshelfView(e=null,t=null,o=null,n=!1){let a=fcn_getBookshelfContent();const s=(e=e??fcn_bookshelfTarget.dataset.action)+(t=t??fcn_bookshelfTarget.dataset.page)+(o=o??fcn_bookshelfTarget.dataset.order);if(!a.hasOwnProperty("timestamp")||a.timestamp+6e4<Date.now())return localStorage.removeItem("fcnBookshelfContent"),a={html:{},count:{}},void fcn_fetchBookshelfPart(e,t,o,n);a.hasOwnProperty("html")&&a.html.hasOwnProperty(s)?(fcn_bookshelfTarget.innerHTML=a.html[s],fcn_bookshelfTarget.classList.remove("ajax-in-progress"),fcn_bookshelfTarget.dataset.page=t,_$(".item-number").innerHTML=`(${a.count[e]})`,n&&_$$$("main").scrollIntoView({behavior:"smooth"})):fcn_fetchBookshelfPart(e,t,o,n)}function fcn_browseBookshelfPage(e){fcn_bookshelfTarget.classList.add("ajax-in-progress"),fcn_updateBookshelfView(null,e,null,!0),history.pushState({},"",fcn_buildUrl({tab:fcn_bookshelfTarget.dataset.tab,pg:e,order:fcn_bookshelfTarget.dataset.order}).href)}function fcn_fetchBookshelfPart(e,t,o,n=!1){const a=e+t+o,s=fcn_getBookshelfContent();fcn_ajaxGet({action:e,page:t,order:o}).then((o=>{o.success?(s.timestamp=Date.now(),s.html[a]=o.data.html,s.count[e]=o.data.count,localStorage.setItem("fcnBookshelfContent",JSON.stringify(s)),fcn_bookshelfTarget.innerHTML=o.data.html,fcn_bookshelfTarget.dataset.page=t,_$(".item-number").innerHTML=`(${o.data.count})`):(fcn_bookshelfTarget.innerHTML="",fcn_bookshelfTarget.appendChild(fcn_buildErrorNotice(o.data.error)))})).catch((e=>{_$(".item-number").innerHTML="",fcn_bookshelfTarget.innerHTML="",fcn_bookshelfTarget.appendChild(fcn_buildErrorNotice(`${e.status}: ${e.statusText}`))})).then((()=>{fcn_bookshelfTarget.classList.remove("ajax-in-progress"),n&&_$$$("main").scrollIntoView({behavior:"smooth"})}))}fcn_theRoot.dataset.ajaxNonce&&!_$$$("fictioneer-ajax-nonce")?fcn_theRoot.addEventListener("nonceReady",(()=>{fcn_updateBookshelfView()})):fcn_updateBookshelfView(),_$(".bookshelf__list")?.addEventListener("click",(e=>{const t=e.target.closest(".page-numbers[data-page]");t&&fcn_browseBookshelfPage(t.dataset.page)}));
const fcn_bookshelfTarget=_$$$("ajax-bookshelf-target");function fcn_getBookshelfContent(){const e=localStorage.getItem("fcnBookshelfContent");return e&&fcn_isValidJSONString(e)?JSON.parse(e):{html:{},count:{}}}function fcn_updateBookshelfView(e=null,t=null,o=null,n=!1){let a=fcn_getBookshelfContent();const s=(e=e??fcn_bookshelfTarget.dataset.action)+(t=t??fcn_bookshelfTarget.dataset.page)+(o=o??fcn_bookshelfTarget.dataset.order);if(!a.hasOwnProperty("timestamp")||a.timestamp+6e4<Date.now())return localStorage.removeItem("fcnBookshelfContent"),a={html:{},count:{}},void fcn_fetchBookshelfPart(e,t,o,n);a.hasOwnProperty("html")&&a.html.hasOwnProperty(s)?(fcn_bookshelfTarget.innerHTML=a.html[s],fcn_bookshelfTarget.classList.remove("ajax-in-progress"),fcn_bookshelfTarget.dataset.page=t,_$(".item-number").innerHTML=`(${a.count[e]})`,n&&_$$$("main").scrollIntoView({behavior:"smooth"})):fcn_fetchBookshelfPart(e,t,o,n)}function fcn_browseBookshelfPage(e){fcn_bookshelfTarget.classList.add("ajax-in-progress"),fcn_updateBookshelfView(null,e,null,!0),history.pushState({},"",fcn_buildUrl({tab:fcn_bookshelfTarget.dataset.tab,pg:e,order:fcn_bookshelfTarget.dataset.order}).href)}function fcn_fetchBookshelfPart(e,t,o,n=!1){const a=e+t+o,s=fcn_getBookshelfContent();fcn_ajaxGet({action:e,fcn_fast_ajax:1,page:t,order:o}).then((o=>{o.success?(s.timestamp=Date.now(),s.html[a]=o.data.html,s.count[e]=o.data.count,localStorage.setItem("fcnBookshelfContent",JSON.stringify(s)),fcn_bookshelfTarget.innerHTML=o.data.html,fcn_bookshelfTarget.dataset.page=t,_$(".item-number").innerHTML=`(${o.data.count})`):(fcn_bookshelfTarget.innerHTML="",fcn_bookshelfTarget.appendChild(fcn_buildErrorNotice(o.data.error)))})).catch((e=>{_$(".item-number").innerHTML="",fcn_bookshelfTarget.innerHTML="",fcn_bookshelfTarget.appendChild(fcn_buildErrorNotice(`${e.status}: ${e.statusText}`))})).then((()=>{fcn_bookshelfTarget.classList.remove("ajax-in-progress"),n&&_$$$("main").scrollIntoView({behavior:"smooth"})}))}fcn_theRoot.dataset.ajaxNonce&&!_$$$("fictioneer-ajax-nonce")?fcn_theRoot.addEventListener("nonceReady",(()=>{fcn_updateBookshelfView()})):fcn_updateBookshelfView(),_$(".bookshelf__list")?.addEventListener("click",(e=>{const t=e.target.closest(".page-numbers[data-page]");t&&fcn_browseBookshelfPage(t.dataset.page)}));

2
js/reminders.min.js vendored
View File

@ -1 +1 @@
var fcn_userRemindersTimeout,fcn_reminders;function fcn_initializeReminders(){fcn_reminders=fcn_getReminders(),fcn_fetchRemindersFromDatabase()}function fcn_getReminders(){const e=localStorage.getItem("fcnStoryReminders");return e&&fcn_isValidJSONString(e)?JSON.parse(e):{lastLoaded:0,data:{}}}function fcn_fetchRemindersFromDatabase(){fcn_ajaxLimitThreshold<fcn_reminders.lastLoaded?fcn_updateRemindersView():fcn_ajaxGet({action:"fictioneer_ajax_get_reminders"}).then((e=>{if(e.success){let t=e.data.reminders;t=fcn_isValidJSONString(t)?t:"{}",t=JSON.parse(t),(fcn_reminders="object"==typeof t&&t.data&&Object.keys(t.data).length>0?t:{data:{}}).lastLoaded=Date.now()}})).catch((()=>{localStorage.removeItem("fcnStoryReminders"),fcn_reminders=!1})).then((()=>{fcn_updateRemindersView(),localStorage.removeItem("fcnBookshelfContent")}))}function fcn_toggleReminder(e){const t=fcn_getReminders();if(localStorage.removeItem("fcnBookshelfContent"),JSON.stringify(fcn_reminders.data[e])!==JSON.stringify(t.data[e]))return fcn_reminders=t,fcn_showNotification(__("Reminders re-synchronized.","fictioneer")),void fcn_updateRemindersView();(fcn_reminders=t).data.hasOwnProperty(e)?delete fcn_reminders.data[e]:fcn_reminders.data[e]={timestamp:Date.now()},fcn_reminders.lastLoaded=0,fcn_updateRemindersView(),clearTimeout(fcn_userRemindersTimeout),fcn_userRemindersTimeout=setTimeout((()=>{fcn_ajaxPost(payload={action:"fictioneer_ajax_toggle_reminder",story_id:e,set:fcn_reminders.data.hasOwnProperty(e)}).then((e=>{e.data.error&&fcn_showNotification(e.data.error,5,"warning")})).catch((e=>{e.status&&e.statusText&&fcn_showNotification(`${e.status}: ${e.statusText}`,5,"warning")}))}),fictioneer_ajax.post_debounce_rate)}function fcn_updateRemindersView(){fcn_reminders&&(_$$(".button-read-later").forEach((e=>{e.classList.toggle("_remembered",fcn_reminders.data.hasOwnProperty(e.dataset.storyId))})),_$$(".card").forEach((e=>{e.classList.toggle("has-reminder",fcn_reminders?.data.hasOwnProperty(e.dataset.storyId))})),localStorage.setItem("fcnStoryReminders",JSON.stringify(fcn_reminders)))}fcn_isLoggedIn&&fcn_initializeReminders(),_$$(".button-read-later").forEach((e=>{e.addEventListener("click",(e=>{fcn_toggleReminder(e.currentTarget.dataset.storyId)}))}));
var fcn_userRemindersTimeout,fcn_reminders;function fcn_initializeReminders(){fcn_reminders=fcn_getReminders(),fcn_fetchRemindersFromDatabase()}function fcn_getReminders(){const e=localStorage.getItem("fcnStoryReminders");return e&&fcn_isValidJSONString(e)?JSON.parse(e):{lastLoaded:0,data:{}}}function fcn_fetchRemindersFromDatabase(){fcn_ajaxLimitThreshold<fcn_reminders.lastLoaded?fcn_updateRemindersView():fcn_ajaxGet({action:"fictioneer_ajax_get_reminders",fcn_fast_ajax:1}).then((e=>{if(e.success){let t=e.data.reminders;t=fcn_isValidJSONString(t)?t:"{}",t=JSON.parse(t),(fcn_reminders="object"==typeof t&&t.data&&Object.keys(t.data).length>0?t:{data:{}}).lastLoaded=Date.now()}})).catch((()=>{localStorage.removeItem("fcnStoryReminders"),fcn_reminders=!1})).then((()=>{fcn_updateRemindersView(),localStorage.removeItem("fcnBookshelfContent")}))}function fcn_toggleReminder(e){const t=fcn_getReminders();if(localStorage.removeItem("fcnBookshelfContent"),JSON.stringify(fcn_reminders.data[e])!==JSON.stringify(t.data[e]))return fcn_reminders=t,fcn_showNotification(__("Reminders re-synchronized.","fictioneer")),void fcn_updateRemindersView();(fcn_reminders=t).data.hasOwnProperty(e)?delete fcn_reminders.data[e]:fcn_reminders.data[e]={timestamp:Date.now()},fcn_reminders.lastLoaded=0,fcn_updateRemindersView(),clearTimeout(fcn_userRemindersTimeout),fcn_userRemindersTimeout=setTimeout((()=>{fcn_ajaxPost(payload={action:"fictioneer_ajax_toggle_reminder",fcn_fast_ajax:1,story_id:e,set:fcn_reminders.data.hasOwnProperty(e)}).then((e=>{e.data.error&&fcn_showNotification(e.data.error,5,"warning")})).catch((e=>{e.status&&e.statusText&&fcn_showNotification(`${e.status}: ${e.statusText}`,5,"warning")}))}),fictioneer_ajax.post_debounce_rate)}function fcn_updateRemindersView(){fcn_reminders&&(_$$(".button-read-later").forEach((e=>{e.classList.toggle("_remembered",fcn_reminders.data.hasOwnProperty(e.dataset.storyId))})),_$$(".card").forEach((e=>{e.classList.toggle("has-reminder",fcn_reminders?.data.hasOwnProperty(e.dataset.storyId))})),localStorage.setItem("fcnStoryReminders",JSON.stringify(fcn_reminders)))}fcn_isLoggedIn&&fcn_initializeReminders(),_$$(".button-read-later").forEach((e=>{e.addEventListener("click",(e=>{fcn_toggleReminder(e.currentTarget.dataset.storyId)}))}));

View File

@ -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 o=_$$$(`oauth-${e}`);o.classList.add("ajax-in-progress"),fcn_ajaxPost(payload={action:"fictioneer_ajax_unset_my_oauth",nonce:t,channel:e,id:n}).then((t=>{t.success?(o.classList.remove("_connected"),o.classList.add("_disconnected"),o.querySelector("button").remove(),fcn_showNotification(o.dataset.unset)):(o.style.background="var(--warning)",fcn_showNotification(t.data.error,5,"warning"))})).catch((t=>{t.status&&t.statusText&&(o.style.background="var(--warning)",fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning"))})).then((()=>{o.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,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=>{fcn_dataDeletionPrompt(t.currentTarget)&&(fcn_checkmarks={data:{},timestamp:Date.now()},fcn_updateCheckmarksView(),fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_checkmarks",!0))})),_$(".button-clear-reminders")?.addEventListener("click",(t=>{fcn_dataDeletionPrompt(t.currentTarget)&&(fcn_reminders={data:{}},fcn_updateRemindersView(),fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_reminders",!0))})),_$(".button-clear-follows")?.addEventListener("click",(t=>{fcn_dataDeletionPrompt(t.currentTarget)&&(fcn_follows={data:{}},fcn_updateFollowsView(),fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_follows",!0))})),_$(".button-clear-bookmarks")?.addEventListener("click",(t=>{fcn_dataDeletionPrompt(t.currentTarget)&&(fcn_bookmarks.data&&Object.keys(fcn_bookmarks.data).forEach((t=>fcn_removeBookmark(t))),t.currentTarget.closest(".card").querySelector(".card__content").innerHTML=fcn_profileDataTranslations.clearedSuccess,fcn_setBookmarks(fcn_bookmarks))}));
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 o=_$$$(`oauth-${e}`);o.classList.add("ajax-in-progress"),fcn_ajaxPost(payload={action:"fictioneer_ajax_unset_my_oauth",nonce:t,channel:e,id:n}).then((t=>{t.success?(o.classList.remove("_connected"),o.classList.add("_disconnected"),o.querySelector("button").remove(),fcn_showNotification(o.dataset.unset)):(o.style.background="var(--warning)",fcn_showNotification(t.data.error,5,"warning"))})).catch((t=>{t.status&&t.statusText&&(o.style.background="var(--warning)",fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning"))})).then((()=>{o.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=>{fcn_dataDeletionPrompt(t.currentTarget)&&(fcn_checkmarks={data:{},timestamp:Date.now()},fcn_updateCheckmarksView(),fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_checkmarks",!0))})),_$(".button-clear-reminders")?.addEventListener("click",(t=>{fcn_dataDeletionPrompt(t.currentTarget)&&(fcn_reminders={data:{}},fcn_updateRemindersView(),fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_reminders",!0))})),_$(".button-clear-follows")?.addEventListener("click",(t=>{fcn_dataDeletionPrompt(t.currentTarget)&&(fcn_follows={data:{}},fcn_updateFollowsView(),fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_follows",!0))})),_$(".button-clear-bookmarks")?.addEventListener("click",(t=>{fcn_dataDeletionPrompt(t.currentTarget)&&(fcn_bookmarks.data&&Object.keys(fcn_bookmarks.data).forEach((t=>fcn_removeBookmark(t))),t.currentTarget.closest(".card").querySelector(".card__content").innerHTML=fcn_profileDataTranslations.clearedSuccess,fcn_setBookmarks(fcn_bookmarks))}));

View File

@ -135,6 +135,7 @@ function fcn_fetchBookshelfPart(action, page, order, scroll = false) {
// Request
fcn_ajaxGet({
'action': action,
'fcn_fast_ajax': 1,
'page': page,
'order': order
})

View File

@ -62,7 +62,8 @@ function fcn_fetchRemindersFromDatabase() {
// Request
fcn_ajaxGet({
'action': 'fictioneer_ajax_get_reminders'
'action': 'fictioneer_ajax_get_reminders',
'fcn_fast_ajax': 1
})
.then((response) => {
// Check for success
@ -151,6 +152,7 @@ function fcn_toggleReminder(storyId) {
fcn_userRemindersTimeout = setTimeout(() => {
fcn_ajaxPost(payload = {
'action': 'fictioneer_ajax_toggle_reminder',
'fcn_fast_ajax': 1,
'story_id': storyId,
'set': fcn_reminders.data.hasOwnProperty(storyId)
})

View File

@ -200,6 +200,7 @@ function fcn_clearData(button, action) {
// Request
fcn_ajaxPost({
'action': action,
'fcn_fast_ajax': 1,
'nonce': button.dataset.nonce
})
.then((response) => {