2024-01-12 20:08:54 +00:00
|
|
|
(()=>{"use strict";var e="reference",t=!1,n="event.ReferencePreviewsPopups";function r(){return t}var o=document.createElement("template");o.innerHTML='\n<div class="mwe-popups mwe-popups mwe-popups-type-reference" aria-hidden>\n\t<div class="mwe-popups-container">\n\t\t<div class="mwe-popups-extract">\n\t\t\t<div class="mwe-popups-scroll">\n\t\t\t\t<strong class="mwe-popups-title">\n\t\t\t\t\t<span class="popups-icon"></span>\n\t\t\t\t\t<span class="mwe-popups-title-placeholder"></span>\n\t\t\t\t</strong>\n\t\t\t\t<bdi><div class="mw-parser-output"></div></bdi>\n\t\t\t</div>\n\t\t\t<div class="mwe-popups-fade"></div>\n\t\t</div>\n\t\t<footer>\n\t\t\t<div class="mwe-popups-settings"></div>\n\t\t</footer>\n\t</div>\n</div>';var c,s,l=function(e,t){"string"==typeof t?e.insertAdjacentHTML("afterend",t):e.parentNode.appendChild(t),e.remove()};function p(e){var t=e.referenceType||"generic",c=mw.message("popups-refpreview-".concat(t));c.exists()||(c=mw.message("popups-refpreview-reference"));var s=o.content.cloneNode(!0).children[0];l(s.querySelector(".mwe-popups-title-placeholder"),mw.html.escape(c.text())),s.querySelector(".mwe-popups-title .popups-icon").classList.add("popups-icon--reference-".concat(t)),s.querySelector(".mw-parser-output").innerHTML=e.extract,Array.prototype.forEach.call(s.querySelectorAll('.mwe-popups-extract a[href][class~="external"]:not([target])'),(function(e){e.target="_blank",e.rel="".concat(e.rel?"".concat(e.rel," "):"","noopener")})),Array.prototype.forEach.call(s.querySelectorAll(".mw-collapsible"),(function(e){var t=document.createElement("div");t.classList.add("mwe-collapsible-placeholder");var n=document.createElement("span");n.classList.add("popups-icon","popups-icon--infoFilled");var r=document.createElement("span");r.classList.add("mwe-collapsible-placeholder-label"),r.textContent=mw.msg("popups-refpreview-collapsible-placeholder"),t.appendChild(n),t.appendChild(r),l(e,t)}));var p=function(e){e.classList.remove("headerSort"),e.removeAttribute("tabindex"),e.removeAttribute("title")};Array.prototype.forEach.call(s.querySelectorAll("table.sortable"),(function(e){e.classList.remove("sortable","jquery-tablesorter"),Array.prototype.forEach.call(e.querySelectorAll(".headerSort"),p)}));var a=document.createElement("a");a.classList.add("cdx-button","cdx-button--fake-button","cdx-button--fake-button--enabled","cdx-button--weight-quiet","cdx-button--icon-only","mwe-popups-settings-button");var i=document.createElement("span");i.classList.add("popups-icon","popups-icon--size-small","popups-icon--settings");var u=document.createElement("span");return u.textContent=mw.msg("popups-settings-icon-gear-title"),a.append(i),a.append(u),s.querySelector(".mwe-popups-settings").appendChild(a),r()&&s.querySelector(".mw-parser-output").addEventListener("click",(function(e){e.target.matches("a")&&mw.track(n,{action:"clickedReferencePreviewsContentLink"})})),s.querySelector(".mwe-popups-scroll").addEventListener("scroll",(function(e){var t=e.target,o=t.scrollTop>=t.scrollHeight-t.clientHeight-1;if(r()&&(t.isOpenRecorded||(mw.track(n,{action:"poppedOpen",scrollbarsPresent:t.scrollHeight>t.clientHeight}),t.isOpenRecorded=!0),t.scrollTop>0&&!t.isScrollRecorded&&(mw.track(n,{action:"scrolled"}),t.isScrollRecorded=!0)),o||!t.isScrolling){var c=t.parentNode,s=t.scrollWidth>t.clientWidth,l=t.offsetHeight-t.clientHeight,p=t.scrollHeight>t.clientHeight,a=t.offsetWidth-t.clientWidth,i=c.querySelector(".mwe-popups-fade");i.style.bottom=s?"".concat(l,"px"):0,i.style.right=p?"".concat(a,"px"):0,t.isScrolling=!o,c.classList.toggle("mwe-popups-fade-out",t.isScrolling),c.setAttribute("lang",mw.config.get("wgPageContentLanguage"))}})),s}c=mw.config,s=parseInt(c.get("wgPopupsFlags"),10),c.set("wgPopupsConflictsWithRefTooltipsGadget",!!(2&s)),c.set("wgPopupsReferencePreviews",!!(4&s));var a=function(t,n,r){return r.get("wgPopupsReferencePreviews")?r.get("wgPopupsConflictsWithRefTooltipsGadget")||r.get("wgPopupsConflictsWithNavPopupGadget")||"minerva"===r.get("skin")?null:t.isAnon()?n(e):"1"===t.options.get("popups-reference-previews")
|