PageSourceSearch

https://finex.cz/wp-content/themes/finex-theme/dist/js/watch-post.118df714074b4f816c59.js

js finex.cz collected 2026-10-02 05:25:56 UTC 3,642 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[691],{2803:(e,t,s)=>{s.r(t),s.d(t,{handleDeleteClick:()=>f,handlePinClick:()=>c,initWatchPost:()=>u,loadPinnedPostsStatus:()=>l,setWatchedState:()=>i});var a=s(428),o=s.n(a),r=s(6739),n=s(5054);let d=null;function i(e,t){if(o()(e).toggleClass("active",t),o()(e).toggleClass("ga-portfolio-remove",t),o()(e).toggleClass("ga-portfolio-add",!t),void 0!==o()(e).data("switch-class")&&(o()(e).toggleClass("btn-remove",t),o()(e).toggleClass("btn-secondary",!t)),null!=o()(e).data("connected")&&1===o()(e).data("connected")){const s=o()(e).data("id");o()(`[data-id="${s}"]`).each(function(){o()(this).toggleClass("active",t),o()(this).toggleClass("ga-portfolio-remove",t),o()(this).toggleClass("ga-portfolio-add",!t),void 0!==o()(this).data("switch-class")&&(o()(this).toggleClass("btn-remove",t),o()(this).toggleClass("btn-secondary",!t))})}}function l(e=document){if(d)return d.then(()=>l(e));const t=o()(e).find(n.J).addBack(n.J).filter(":not([data-fnx-watch-status-loaded])"),s=new Set;return t.each((e,t)=>{const a=o()(t).data("id")||finex.post_id;a&&s.add(a)}),s.size?(t.attr("data-fnx-watch-status-loaded","true"),d=new Promise(e=>{o().ajax({url:finex.fast_ajax_url,method:"POST",data:{action:"finex_user_is_watched_post",posts:Array.from(s)}}).done(e=>{try{const s=JSON.parse(e);if(s.logged){const e=s.posts.reduce((e,t)=>(e[t.id]=t.watched,e),{});t.each((t,s)=>{const a=o()(s),r=a.data("id")||finex.post_id;r&&i(a,!!e[r]),a.removeClass("disabled")})}else t.removeAttr("data-fnx-watch-status-loaded")}catch(e){t.removeAttr("data-fnx-watch-status-loaded"),console.error("Error checking saved posts status:",e)}}).fail(e=>{t.removeAttr("data-fnx-watch-status-loaded"),console.error("Error checking saved posts status:",e)}).always(()=>{d=null,e()})}),d):Promise.resolve()}async function c(e){if(e.preventDefault(),!o()("body").hasClass("logged-in"))return!1;const t=o()(e.currentTarget);if(t.hasClass("disabled"))return!1;t.addClass("disabled");const s=t.data("id")||finex.post_id;if(!s)return t.removeClass("disabled"),!1;try{await(0,r.Xl)()}catch(e){return t.removeClass("disabled"),console.error("Error preparing saved-post request:",e),!1}const a=t.hasClass("active");return o().ajax({type:"POST",url:finex.fast_ajax_url,data:{action:"finex_user_profile_toggle_saved_post",post_id:s,remove:a,finex_frontend_nonce:finex.nonces.finex_frontend_nonce},dataType:"json",success:e=>{"success"===e.type?(o()(`.switch-asset[data-id="${s}"]`).data("watched",a?0:1),i(t,!a)):console.error("Error watching post:",e)},error:e=>{console.error("Error watching post:",e)},complete:()=>{t.removeClass("disabled")}}),!0}async function f(e){if(e.preventDefault(),!o()("body").hasClass("logged-in"))return!1;const t=o()(e.currentTarget);if(t.hasClass("disabled"))return!1;t.addClass("disabled");const s=t.data("post_id");if(!s)return t.removeClass("disabled"),!1;try{await(0,r.Xl)()}catch(e){return t.removeClass("disabled"),console.error("Error preparing saved-post removal:",e),!1}return o().ajax({type:"POST",url:finex.fast_ajax_url,data:{action:"finex_user_profile_toggle_saved_post",post_id:s,remove:!0,finex_frontend_nonce:finex.nonces.finex_frontend_nonce},dataType:"json",success:e=>{"success"===e.type?(t.closest("article").slideUp(),t.closest(".pagination-content").trigger("reload-page")):console.error("Error removing post:",e)},error:e=>{console.error("Error removing post:",e)},complete:()=>{t.removeClass("disabled")}}),!0}function u(){o()("body").off("click.finexWatchPost",n.J).on("click.finexWatchPost",n.J,c).off("click.finexWatchPost",n.z).on("click.finexWatchPost",n.z,f)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.