PageSourceSearch

https://www.fanverse.org/js/sv/contentratings/rate.min.js?_v=461a0a82

js fanverse.org collected 2026-09-24 19:45:02 UTC 8,668 bytes, 18 lines download raw bytes

1var SV=window.SV||{};SV.$=SV.$||window.jQuery||null;SV.extendObject=SV.extendObject||XF.extendObject||jQuery.extend;
2(function(u,t){const g=SV.$,c="function"!==typeof XF.on;SV.RateTooltipElement=XF.extend(XF.TooltipElement,{__backup:{reposition:"svContentRating_reposition"},reposition(){this.svContentRating_reposition();if(c){var a=this.$tooltip.dimensions(!0);if(0!==a.left){var b=this.positioner.dimensions(!0);(b=a.right-b.right)&&this.$tooltip.css({left:Math.max(0,a.left-b)})}}else if(a=XF.dimensions(this.tooltip,!0),0!==a.left&&(b=XF.dimensions(this.positioner,!0),b=a.right-b.right))this.tooltip.style.left=Math.max(0,
3a.left-b)+"px"}});SV.RateTooltip=XF.Element.newHandler({options:{tooltip:null,delay:null,trigger:"hover focus touchhold"},trigger:null,tooltip:null,init(){const a=this.getContent();if(a)if(this.tooltip=new SV.RateTooltipElement(a,{extraClass:"tooltip--sv-rate",html:!0}),null===this.options.delay&&(this.options.delay="contentrating"in XF.config?XF.config.contentrating.tooltipDelay:400),this.trigger=new XF.TooltipTrigger(this.target||this.$target,this.tooltip,{delayIn:this.options.delay,trigger:this.options.trigger,
4maintain:!0,onShow:this.onShow.bind(this),onHide:this.onHide.bind(this)}),this.trigger.init(),c)this.$target.on("click",this.actionClick.bind(this));else XF.on(this.target,"click",this.actionClick.bind(this))},actionClick:function(a){a.preventDefault();c?this.$target.data("tooltip:taphold")&&this.$target.is(a.currentTarget)&&this.$target.removeData("tooltip:taphold"):XF.DataStore.get(this.target,"tooltip:taphold")&&this.target===a.currentTarget&&XF.DataStore.remove(this.target,"tooltip:taphold")},
5getContent(){var a=this.options.tooltip;if(a&&(a=XF.findRelativeIf(a,this.target||this.$target))){var b=c?a.clone().contents():a.cloneNode(!0).childNodes;a.remove();return b}},onShow(){const a=SV.RateTooltip.activeTooltip;a&&a!==this&&a.hide();SV.RateTooltip.activeTooltip=this},onHide(){SV.RateTooltip.activeTooltip===this&&(SV.RateTooltip.activeTooltip=null);c?this.$target.removeData("tooltip:taphold"):XF.DataStore.remove(this.target,"tooltip:taphold")},show(){this.trigger.show()},hide(){this.trigger.hide()}});
6SV.RateTooltip.activeTooltip=null;SV.ReactionTooltipElement=XF.extend(XF.TooltipElement,{__backup:{reposition:"svContentRating_reposition"},options:SV.extendObject({},XF.TooltipElement.prototype.options,{verticalPositioner:null,horizontalPositioner:null}),reposition(){let a=this.positioner;if(!a)console.error("No tooltip positioner");else if(!this.loadRequired){if(a instanceof Element||a instanceof g){var b=a;this.options.verticalPositioner&&(b=XF.findRelativeIf(this.options.verticalPositioner,a),
7!b||c&&!b.length)&&(b=a);var d=a;this.options.horizontalPositioner&&(d=XF.findRelativeIf(this.options.horizontalPositioner,a),!d||c&&!d.length)&&(d=a);b=c?b.dimensions(!0):XF.dimensions(b);d=c?d.dimensions(!0):XF.dimensions(d);this.setPositioner({top:b.top,right:d.right,bottom:b.bottom,left:d.left})}this.svContentRating_reposition();this.setPositioner(a)}}});SV.ReactionTooltip=XF.extend(XF.Tooltip,{options:SV.extendObject({},XF.Tooltip.prototype.options,{verticalPositioner:null,horizontalPositioner:null}),
8init(){var a=this.getContent();const b=XF.TooltipOptions.extractTooltip(this.options);b.verticalPositioner=this.options.verticalPositioner;b.horizontalPositioner=this.options.horizontalPositioner;this.tooltip=new SV.ReactionTooltipElement(a,b);a=XF.TooltipOptions.extractTrigger(this.options);this.trigger=new XF.TooltipTrigger(this.target||this.$target,this.tooltip,a);this.trigger.init()}});SV.RateClick=XF.Event.newHandler({eventNameSpace:"SVRateClick",options:{ratingBar:null,ratingMenu:null,nativeReactionsBar:null},
9tooltipTarget:null,init(){},click(a){a.preventDefault();a.stopPropagation();a=this.target||this.$target.get(0);var b=SV.RateTooltip.activeTooltip;if(b){let d,h;c?(d=this.$target.xfUniqueId(),h=b.$target.xfUniqueId(),this.tooltipTarget=b.$target.get(0)):(d=XF.uniqueId(a),h=XF.uniqueId(b.target),this.tooltipTarget=b.target);if(d===h)return;b.hide()}(b=a.closest(".menu"))&&(c?g(b).trigger("menu:close"):XF.trigger(b,"menu:close"));XF.ajax("POST",a.getAttribute("href"),{},this.handleAjax.bind(this),{skipDefaultSuccess:!0})},
10handleAjax(a){var b=this.target||this.$target.get(0);this.tooltipTarget&&(b=this.tooltipTarget);let d=c?g(b):b,h=this.options.nativeReactionsBar?this.options.nativeReactionsBar:b.getAttribute("data-native-reactions-bar"),k=h?XF.findRelativeIf(h,d):null,n=(b=this.options.ratingBar)?XF.findRelativeIf(b,d):null,r=this.options.ratingMenu,e=r?XF.findRelativeIf(r,d):null,l="contentrating"in XF.config?XF.config.contentrating.menuDelay:100;c&&(k=k?k.get(0):null,n=n?n.get(0):null,e=e?e.get(0):null);k?("ratingBarMenu"in
11a&&"content"in a.ratingBarMenu&&a.ratingBarMenu.content&&XF.setupHtmlInsert(a.ratingBarMenu,f=>{c&&(f=f.get(0));e&&a.ratingBarMenu.content&&(f.style.display="none",e.parentNode.insertBefore(f,e.nextSibling),h&&f.querySelectorAll('[data-xf-click="sv-rate"]').forEach(m=>{m.setAttribute("data-native-reactions-bar",h)}),c?g(e).fadeOut(l,()=>{e.remove();g(f).fadeIn(l);XF.activate(g(f))}):XF.Animate.fadeOut(e,{speed:l,complete(){e.remove();XF.Animate.fadeIn(f,{speed:l});XF.activate(f)}}))}),"undefined"!==
12typeof a.html&&k&&(a.html.content.trim()?XF.setupHtmlInsert(a.html,f=>{c&&(f=f.get(0));c?g(k).html(f).addClassTransitioned("is-active"):(k.innerHTML=f.innerHTML,XF.Transition.addClassTransitioned(k,"is-active"));h&&k.querySelectorAll('[data-xf-click="sv-rate"]').forEach(m=>{m.setAttribute("data-native-reactions-bar",h)})}):c?g(k).removeClassTransitioned("is-active",()=>{k.replaceChildren()}):XF.Transition.removeClassTransitioned(k,"is-active",()=>{k.replaceChildren()}))):"undefined"!==typeof a.html&&
13n&&XF.setupHtmlInsert(a.html,f=>{c&&(f=f.get(0));let m;if(e){const p=f.querySelector(r);m=p.parentElement.removeChild(p);m.style.display="none";e.parentNode.insertBefore(m,e.nextSibling)}const q=f;q.style.display="none";n.parentNode.insertBefore(q,n.nextSibling);c?(g(n).fadeOut(l,()=>{n.remove();g(q).fadeIn(l)}),e&&g(e).fadeOut(l,()=>{e.remove();if(m){let p=g(m);p.fadeIn(l);XF.activate(p)}})):(XF.Animate.fadeOut(n,{speed:l,complete(){n.remove();XF.Animate.fadeIn(q,{speed:l})}}),e&&XF.Animate.fadeOut(e,
14{speed:l,complete(){e.remove();m&&(XF.Animate.fadeIn(m,{speed:l}),XF.activate(m))}}))})}});
14SV.TouchDetect=XF.Element.newHandler({init(){if(!SV.TouchDetectEnabled){SV.TouchDetectEnabled=!0;const a=u.querySelector("html"),b=()=>{a.classList.add("sv-touch-enabled")};if(c)g(a).one("touchstart",b);else XF.on(a,"touchstart",b,{once:!0})}}});SV.RatingCategoryCollapsible=XF.Element.newHandler({options:{location:null},storage:null,$hideLink:null,$showLink:null,$list:null,init(){if(this.options.location){var a=
15this.target||this.$target.get(0);this.$hideLink=a.querySelector(".hide");this.$showLink=a.querySelector(".show");this.storage=t.localStorage;"undefined"===typeof this.storage&&(this.storage=t.sessionStorage,"undefined"===typeof this.storage&&(this.storage={getItem(){},setItem(){},removeItem(){}}));this.$list=this.getList();a.addEventListener("click",this.onShowControlsClick.bind(this));this.initListHiding()}else console.log("Require a storage location to be set")},getList(){const a=this.target||this.$target.get(0);
16return this.nextUntil(a.closest(".dataList-row--subSection"),".dataList-row--subSection")},initListHiding(){this.storage.getItem(location)?(this.$hideLink.classList.remove("active"),this.$showLink.classList.add("active"),this.$list.forEach(a=>{a.style.display="none"})):(this.$hideLink.classList.add("active"),this.$showLink.classList.remove("active"))},onShowControlsClick(){this.storage.getItem(location)?(this.storage.removeItem(location),this.$hideLink.classList.add("active"),this.$showLink.classList.remove("active"),
17this.$list.forEach(a=>{a.style.display="table-row"})):(this.storage.setItem(location,"1"),this.$hideLink.classList.remove("active"),this.$showLink.classList.add("active"),this.$list.forEach(a=>{a.style.display="none"}))},nextUntil(a,b,d){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);let h=[];for(a=a.nextElementSibling;a&&!a.matches(b);)d&&!a.matches(d)||h.push(a),a=a.nextElementSibling;return h}});SV.TouchDetectEnabled=
18!1;XF.Element.register("sv-touch-detect","SV.TouchDetect");XF.Element.register("sv-rate-tooltip","SV.RateTooltip");XF.Element.register("sv-rating-type-tooltip","SV.ReactionTooltip");XF.Element.register("sv-rating-category-collapsible","SV.RatingCategoryCollapsible");XF.Event.register("click","sv-rate","SV.RateClick")})(document,window);

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.