/* * SiteSEO * https://siteseo.io/ * (c) SiteSEO Team <support@siteseo.io> */ /* Copyright 2016 - 2024 - Benjamin Denis (email : contact@seopress.org) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ function siteseo_blur_focus_event(){jQuery(".siteseo-drag-icon-container").each(function(t,e){var s=jQuery(e).closest(".siteseo-card"),a=s.prevAll().filter(".siteseo-card"),i=s.nextAll().filter(".siteseo-card");a.length<=0&&(jQuery(".siteseo-drag-icon-container .dashicons-arrow-up-alt2").removeClass("siteseo-blur-icon"),s.find(".dashicons-arrow-up-alt2").addClass("siteseo-blur-icon")),i.length<=0&&(jQuery(".siteseo-drag-icon-container .dashicons-arrow-down-alt2").removeClass("siteseo-blur-icon"),s.find(".dashicons-arrow-down-alt2").addClass("siteseo-blur-icon"))})}jQuery(document).ready(function(t){t.trim(t("#siteseo-notifications-center").html())||t("#siteseo-notifications-center").remove(),["notice-get-started","notice-usm","notice-wizard","notice-insights-wizard","notice-seo-consultant","notice-amp-analytics","notice-tagdiv","notice-divide-comments","notice-review","notice-trailingslash","notice-posts-number","notice-rss-use-excerpt","notice-ga-ids","notice-search-console","notice-google-business","notice-ssl","notice-title-tag","notice-enfold","notice-themes","notice-page-builders","notice-go-pro","notice-noindex","notice-tasks","notice-insights","notice-robots-txt","notice-robots-txt-valid",].forEach(function(e){t("#"+e).on("click",function(){t("#"+e).attr("data-notice","1"==t("#"+e).attr("data-notice")?"0":"1"),t.ajax({method:"POST",url:siteseoAjaxHideNotices.siteseo_hide_notices,data:{action:"siteseo_hide_notices",notice:e,notice_value:t("#"+e).attr("data-notice"),_ajax_nonce:siteseoAjaxHideNotices.siteseo_nonce},success:function(s){t("#siteseo-notice-save").css("display","block"),t("#siteseo-notice-save .html").html("Notice successfully removed"),t("#"+e+"-alert").fadeOut(),t("#siteseo-notice-save").delay(3500).fadeOut()}})})}),["titles","xml-sitemap","social","google-analytics","instant-indexing","advanced","local-business","woocommerce","edd","dublin-core","rich-snippets","breadcrumbs","inspect-url","robots","news","404","bot","rewrite","white-label","ai"].forEach(function(e){t("#toggle-"+e).on("click",function(){t("#toggle-"+e).attr("data-toggle","1"==t("#toggle-"+e).attr("data-toggle")?"0":"1"),t(this).siblings("#titles-state-default").toggleClass("feature-state-off"),t(this).siblings("#titles-state").toggleClass("feature-state-off"),t.ajax({method:"POST",url:siteseoAjaxToggleFeatures.siteseo_toggle_features,data:{action:"siteseo_toggle_features",feature:"toggle-"+e,feature_value:t("#toggle-"+e).attr("data-toggle"),_ajax_nonce:siteseoAjaxToggleFeatures.siteseo_nonce},success:function(){window.history.pushState("","",window.location.href+"&settings-updated=true"),t("#siteseo-notice-save").show(),t("#siteseo-notice-save").delay(3500).fadeOut(),window.history.pushState("","",window.location.href)}})})}),t("#siteseo-activity-panel button").on("click",function(){if("activity-panel-tab-expand"==t(this).attr("id")){t(".hide-panel").toggle(200),t(this).find("span").toggleClass("btn-rotate");return}t(this).toggleClass("is-active"),t("#siteseo-activity-panel-"+t(this).data("panel")).toggleClass("is-open")}),t("#siteseo-activity-panel .siteseo-close-panel").on("click",function(){t("#siteseo-activity-panel-"+t(this).data("panel")).toggleClass("is-open")}),t("#siteseo-content").on("click",function(){t("#siteseo-activity-panel").find(".is-open").toggleClass("is-open"),t("#siteseo-activity-panel").find(".is-active").toggleClass("is-active")}),t("body").on("click",".siteseo-item-toggle-options",function(e){e.stopPropagation(),t(this).next(".siteseo-card-popover").toggleClass("is-open")}),t("#siteseo-news-items").on("click",function(){t.ajax({method:"POST",url:siteseoAjaxNews.siteseo_news,data:{action:"siteseo_news",news_max_items:t("#news_max_items").val(),_ajax_nonce:siteseoAjaxNews.siteseo_nonce},success:function(e){t("#siteseo-news-panel .siteseo-card-content").load(" #siteseo-news-panel .siteseo-card-content"),t("#siteseo-news-panel .siteseo-card-popover").toggleClass("is-open")}})}),t("#siteseo_news").on("click",function(){t("#siteseo-news-panel").toggleClass("is-active"),t("#siteseo_news").attr("data-toggle","1"==t("#siteseo_news").attr("data-toggle")?"0":"1"),t.ajax({method:"POST",url:siteseoAjaxDisplay.siteseo_display,data:{action:"siteseo_display",news_center:t("#siteseo_news").attr("data-toggle"),_ajax_nonce:siteseoAjaxDisplay.siteseo_nonce}})}),t("#siteseo_tools").on("click",function(){t("#notice-insights-alert").toggleClass("is-active"),t("#siteseo_tools").attr("data-toggle","1"==t("#siteseo_tools").attr("data-toggle")?"0":"1"),t.ajax({method:"POST",url:siteseoAjaxDisplay.siteseo_display,data:{action:"siteseo_display",tools_center:t("#siteseo_tools").attr("data-toggle"),_ajax_nonce:siteseoAjaxDisplay.siteseo_nonce}})}),t("#notifications_center").on("click",function(){t("#siteseo-notifications-center").toggleClass("is-active"),t("#notifications_center").attr("data-toggle","1"==t("#notifications_center").attr("data-toggle")?"0":"1"),t.ajax({method:"POST",url:siteseoAjaxDisplay.siteseo_display,data:{action:"siteseo_display",notifications_center:t("#notifications_center").attr("data-toggle"),_ajax_nonce:siteseoAjaxDisplay.siteseo_nonce}})}),t("body").on("click",".siteseo-card-title .siteseo-drag-icon-container .dashicons-arrow-up-alt2",function(e){e.stopPropagation();var s=t(this).closest(".siteseo-card"),a=s.prevAll().filter(".siteseo-card");if(a.length>0){var i=t("<div></div>");s.appendTo(i),t(i.prop("innerHTML")).insertBefore(a.get(0)),siteseo_blur_focus_event()}}),t("body").on("click",".siteseo-card-title .siteseo-drag-icon-container .dashicons-arrow-down-alt2",function(e){e.stopPropagation();var s=t(this).closest(".siteseo-card"),a=s.nextAll().filter(".siteseo-card");if(a.length>0){var i=t("<div></div>");s.appendTo(i),t(i.prop("innerHTML")).insertAfter(a.get(0)),siteseo_blur_focus_event()}}),t("body").on("click",".siteseo-card-title.ui-sortable-handle",function(e){e.stopPropagation(),t(this).find(".dashicons-controls-play").click()}),t("body").on("click",".siteseo-card-title .siteseo-drag-icon-container .dashicons-controls-play",function(e){e.stopPropagation(),t(this).closest(".siteseo-card").children("div:not(.siteseo-card-title)").slideToggle(),t(this).toggleClass("rotate-element")}),siteseo_blur_focus_event()}),jQuery(document).ready(function(t){var e=window.location.hash.split("$");if("undefined"!=typeof sessionStorage){var s=sessionStorage.getItem("siteseo_admin_tab");"1"==e[1]?(t("#tab_siteseo_analytics-tab").addClass("nav-tab-active"),t("#tab_siteseo_analytics").addClass("active")):"2"==e[1]?(t("#tab_siteseo_matomo-tab").addClass("nav-tab-active"),t("#tab_siteseo_matomo").addClass("active")):"3"==e[1]?(t("#tab_siteseo_ps-tab").addClass("nav-tab-active"),t("#tab_siteseo_ps_tools").addClass("active")):s?(t("#siteseo-admin-tabs").find(".nav-tab.nav-tab-active").removeClass("nav-tab-active"),t("#siteseo-admin-tabs").find(".siteseo-tab.active").removeClass("active"),t("#"+s.split("#tab=")+"-tab").addClass("nav-tab-active"),t("#"+s.split("#tab=")).addClass("active")):(t("#siteseo-admin-tabs a.nav-tab").first().addClass("nav-tab-active"),t("#siteseo-admin-tabs .wrap-siteseo-tab-content > div").first().addClass("active"))}t("#siteseo-admin-tabs").find("a.nav-tab").click(function(s){s.preventDefault();var a=t(this).attr("href").split("#tab=")[1];t("#siteseo-admin-tabs").find(".nav-tab.nav-tab-active").removeClass("nav-tab-active"),t("#"+a+"-tab").addClass("nav-tab-active"),1==e[1]?sessionStorage.setItem("siteseo_admin_tab","tab_siteseo_analytics"):2==e[1]?sessionStorage.setItem("siteseo_admin_tab","tab_siteseo_matomo"):3==e[1]?sessionStorage.setItem("siteseo_admin_tab","tab_siteseo_ps_tools"):sessionStorage.setItem("siteseo_admin_tab",a),t("#siteseo-admin-tabs").find(".siteseo-tab.active").removeClass("active"),t("#"+a).addClass("active")}),t(".siteseo-dashboard-columns .siteseo-dashboard-column:first-child").sortable({items:".siteseo-card",placeholder:"sp-dashboard-card-highlight",cancel:".siteseo-intro, .siteseo-card-popover",handle:".siteseo-card-title",opacity:.9,forcePlaceholderSize:!0,update:function(e){let s=jQuery(e.target);var a=s.sortable("toArray",{attribute:"id"});t.ajax({method:"POST",url:siteseoAjaxDndFeatures.siteseo_dnd_features,data:{action:"siteseo_dnd_features",order:a,_ajax_nonce:siteseoAjaxDndFeatures.siteseo_nonce},success:function(t){siteseo_blur_focus_event()}})}})});