PageSourceSearch

https://www.falkoping.se/sitevision/system-resource/706c47851a9c6e…7fbc171ef52fc04ec9b767285/js/likableUtil.js

js falkoping.se collected 2026-10-02 07:00:33 UTC 5,345 bytes, 2 lines download raw bytes

1(globalThis.webpackChunk_sv_portlet=globalThis.webpackChunk_sv_portlet||[]).push([[8837],{745(){sv.i18n.portlet=sv.i18n.portlet||{},sv.i18n.portlet.archive=sv.i18n.portlet.archive||{},sv.i18n.portlet.archive.archive=sv.i18n.portlet.archive.archive||{},sv.i18n.portlet.archive.archive.de={creatingArticle:"Artikel wird erstellt..."},sv.i18n.portlet.archive.archive.en={creatingArticle:"Creating article..."},sv.i18n.portlet.archive.archive.es={creatingArticle:"Creando artículo..."},sv.i18n.portlet.archive.archive.fi={creatingArticle:"Luo artikkelia..."},sv.i18n.portlet.archive.archive.fr={creatingArticle:"Créer des articles..."},sv.i18n.portlet.archive.archive.no={creatingArticle:"Oppretter artikkel ..."},sv.i18n.portlet.archive.archive.sv={creatingArticle:"Skapar artikel..."}},9495(t,e,i){"use strict";i.r(e);i(4571),i(745),i(4197)},4197(){sv.i18n.portlet=sv.i18n.portlet||{},sv.i18n.portlet.blog=sv.i18n.portlet.blog||{},sv.i18n.portlet.blog.blog=sv.i18n.portlet.blog.blog||{},sv.i18n.portlet.blog.blog.de={creatingBlogEntry:"Blogbeitrag wird erstellt..."},sv.i18n.portlet.blog.blog.en={creatingBlogEntry:"Creating blog entry..."},sv.i18n.portlet.blog.blog.es={creatingBlogEntry:"Creando entrada de blog..."},sv.i18n.portlet.blog.blog.fi={creatingBlogEntry:"Luo blogiyhteyttä..."},sv.i18n.portlet.blog.blog.fr={creatingBlogEntry:"Créer des articles de blog..."},sv.i18n.portlet.blog.blog.no={creatingBlogEntry:"Oppretter blogginnlegg ..."},sv.i18n.portlet.blog.blog.sv={creatingBlogEntry:"Skapar blogginlägg..."}},4571(t,e,i){"use strict";i.d(e,{G:()=>b});var l=i(3501),r=i.n(l),a=i(1173),n=i.n(a),o=i(7834),s=i(1257);const c=n().template('<i class="halflings-icon thumbs-up"></i><%= likeText %> (<%= likeCount %>)'),g={};var d=function(t){return g[t]?g[t]:o.i18n.getText("portlet.social.util.likableutil",t)},p=function(t){var e=t.data("like-count")||0,i=!!t.data("user-likes");t.html(c({likeText:d(i?"likes":"like"),likeCount:e,userLikes:i})),t[i?"addClass":"removeClass"]("sv-liked")},v=function(t){(t=t||r()("body")).is("[data-fn-likable],[data-fn-portlet-likable]")?p(t):t.find("[data-fn-likable],[data-fn-portlet-likable]").each(function(){p(r()(this))})},u=function(t,e){t.tooltip({html:!0,title:e.join("<br>")}),t.tooltip("show")};const b=function(){var t,e,i=r()(this),l=!!i.data("user-likes"),a=i.data("likable-id");if(i.removeData("likes"),a){if(!i.hasClass("sv-disabled"))return i.addClass("sv-disabled"),t=i.closest(".sv-portlet"),e=o.ObjectUtil.getObjectId(t.attr("id")),function(t,e,i){return r().ajax({url:t,method:i?"DELETE":"POST",dataType:"JSON",data:{likable:e}})}(l?(0,s.RY)(e,"unlike")+"&likable="+a:(0,s.RY)(e,"like"),a,l).done(function(t){i.data("user-likes",!l).data("like-count",t.count),p(i)}).fail(function(t){o.ErrorUtil.handleAjaxFailure(t)}
1).always(function(){i.removeClass("sv-disabled")}),!1}else o.Log.warn("Trying to like object without likable-id in portlet "+i.closest(".sv-portlet").attr("id"))};r()("body").on("click.likeable","a[data-fn-likable]",b),r()(document).on("mouseenter",".sv-like",function(){var t,e=r()(this),i=e.closest(".sv-portlet"),l=o.ObjectUtil.getObjectId(i.attr("id")),a=e.data("likable-id"),n=e.data("likes");if(e.data("like-count")>0)if(n)u(e,n);else{var c=(0,s.RY)(l,"likes")+"&likable="+a;(t=c,r().ajax({url:t,method:"GET",dataType:"JSON"})).done(function(t){e.data("likes",t),u(e,t)}).fail(function(t){o.ErrorUtil.handleAjaxFailure(t)})}}),o.Events.on(o.Events.types.updateLikables,v),v()},1257(t,e,i){"use strict";i.d(e,{$F:()=>h,PD:()=>p,RY:()=>v,h$:()=>g,l0:()=>d,mI:()=>u,nL:()=>c,uX:()=>b});var l=i(7834),r=i.n(l),a=i(3501),n=i.n(a),o=i(1173),s=i.n(o);const c=function(t){var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(window.location.href);return e?e[1]:null},g=function(t,e,i){var l="/modelobjectapi/1/"+r().PageContext.pageId+"/"+t+"/"+e;return i&&(l+="/"+i),l},d=function(t){var e=t.modelHandler,i=t.objectId,l=t.operationObjectId,a=t.contextNodeId||r().PageContext.pageId;"string"==typeof t&&(e=t),i||(i=r().PageContext.pageId);var n="/edit-api/1/"+a+"/"+i+"/"+e;return l&&(n+="/"+l),n},p=function(t,e,i){return`/${r().PageContext.pageId}/${t}.${i?"json":"htm"}?state=${e}`},v=function(t,e){var i=c("identity"),l=c("group"),a=c("tag");return"/portletresource/"+r().PageContext.pageId+"/"+t+"?state="+e+(i?"&identity="+i:"")+(l?"&group="+l:"")+(a?"&tag="+a:"")},u=function(t,e){var i=n()(t);n().each(i,function(){var t=n()(this),i=t.attr("id"),a=l.ObjectUtil.getObjectId(i);b(t,"/"+r().PageContext.pageId+"/"+a+".htm"+(e||""))})},b=function(t,e,i){let l;l="string"==typeof t?n()(t):t,n().get(e,function(e){l.fadeOut("fast",function(){l.html(e),l.fadeIn(),"function"==typeof i&&i.call(this,t)})})};var f={};const h=function(t,e){var i,r=t.attr("id");if(r){if(r=r.replace(".","_"),!f[r+e]){if(0===(i=t.find("script.sv-tmpl-"+e)).length)return void l.Log.warn("portletUtil","Could not find template with name "+e+" for portlet "+r);f[r+e]=s().template(i.html())}return f[r+e]}l.Log.warn("portletUtil","Tried to get template from invalid element")};r().PortletUtil={getModelObjectUri:g,getEditApiUri:d,getPortletUri:p,getPortletResourceUri:v,reloadPortletsByType:u,doGetWithFade:b,doGet:function(t,e,i){n().get(e,function(e){n()(t).html(e),"function"==typeof i&&i.call(this,t)})},getTemplate:h,parseRequestParameters:c}}}]);
2//# sourceMappingURL=likableUtil.js.map

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.