MediaWiki:Common.js
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
$(document).ready(function(){var t=$(".card"),e=$("#show-article-wrapper");function i(){var t=$(".list-container .card").get();t.sort(function(t,e){var i=parseInt($(t).find(".entry-number").text().replace(/\[|\]/g,""),10);return parseInt($(e).find(".entry-number").text().replace(/\[|\]/g,""),10)-i}),$.each(t,function(t,e){$(".list-container").append(e)})}function a(t){for(var e,i,a=$(t).get(),l=a.length;--l>0;)e=Math.floor(Math.random()*(l+1)),i=a[l],a[l]=a[e],a[e]=i;$.each(a,function(e,i){$(t).parent().append(i)})}function l(t){var e=$(t).get();e.sort(function(t,e){var i=$(t).find(".title").text().toUpperCase(),a=$(e).find(".title").text().toUpperCase();return i<a?-1:i>a?1:0}),$.each(e,function(e,i){$(t).parent().append(i)})}function o(){$(".home-chronicle-list div.list-container div.card:not(.event)").each(function(){if(!$(this).closest(".home-chronicle-block").length){var t=$(this).find(".title").detach(),e=$(this).find(".images").detach();$(this).find(".title-images").remove();var i=$('<div class="title-images"></div>').append(e,t);$(this).find(".people").after(i)}}),$(".home-chronicle-block div.list-container div.card:not(.event)").each(function(){var t=$(this).find(".title-images");if(t.length){var e=t.find(".title").detach(),i=t.find(".images").detach();t.remove(),$(this).find(".people").after(e),$(this).find(".type").after(i)}else{var i=$(this).find(".images").detach();$(this).find(".type").after(i)}})}function n(){$(".card.event").each(function(){var t=$(this).find(".container-people-date");0===t.length&&(t=$('<div class="container-people-date"></div>'),$(this).append(t));var e=$(this).find(".people").detach(),i=$(this).find(".date").detach();t.append(e).append(i),$(this).closest(".home-chronicle-block").length?t.is($(this).find(".title").next())||$(this).find(".title").after(t):$(this).closest(".home-chronicle-list").length&&!t.is($(this).find(".title").prev())&&$(this).find(".title").before(t)})}function c(){var t,e="",i=$(".card").length>0?".card":".community-card";$(".filter .values a[title]").each(function(){var t=$(this),a=t.attr("title").toLowerCase(),l=0;t.find("button").hasClass("active")&&($(i).each(function(){var t=$(this);$(".filter").each(function(){var e=$(this).data("filter");-1!==t.find("."+e).text().toLowerCase().indexOf(a)&&l++})}),e+="<span>["+l+"] "+a+"</span> ")}),e?$(".count-filtered-cards").html(e).show():$(".count-filtered-cards").hide(),t=$(".card").length>0?".card":".community-card",$(t).show().each(function(){var t=$(this),e=!1;$(".filter").each(function(){if(!e){var i=$(this).data("filter"),a=$(this).find(".values a[title] button.active").map(function(){return $(this).parent("a").attr("title").toLowerCase()}).get();if(a.length>0){var l=t.find("."+i).text().toLowerCase();a.some(function(t){return -1!==l.indexOf(t)})||(e=!0)}}}),e&&t.hide()}),s(i),r(i),n(i),o(i),console.log("Filtering process complete, updated views and borders")}function s(){$(".home-chronicle-list div.list-container div.card").removeClass("last-visible"),$(".home-chronicle-list div.list-container div.card:visible:last").addClass("last-visible")}function r(){$(".home-chronicle-block div.list-container").css("width","100%"),$(".home-chronicle-block div.list-container div.card").css("width","calc(20% - 0px)"),$(".home-chronicle-block div.list-container div.card:nth-child(5n + 1)").css("width","calc(20% + 4px)")}function d(t){return t.split("\n").filter(function(t){return""!==t.trim()}).map(function(t){return"<p>"+t.trim()+"</p>"}).join("")}$(".head-box").click(function(){window.location.href="/Main_Page"}),t.each(function(){var t=$(this).find(".related-articles");if(t.length>0){var e=t.find(".related-article"),i=[];e.each(function(){$(this).find("p").remove();var t=$(this)[0].outerHTML;-1===$.inArray(t,i)&&i.push(t)}),t.empty(),t.append(i.join(""))}}),$("#home").length>0?(console.log("The #home element exists on this page."),$(".home-block-view").show(),$(".home-chronicle-block-button, .home-block-view-button").addClass("active-view-button"),$(".home-chronicle-list-button, .home-random-list-button, .home-alphabetical-list-button").hide(),i(),s(),r(),n(),o(),$(".home-list-view-button").click(function(){console.log("List view button clicked."),$(".home-list-sorting-buttons").css("display","flex"),$(".home-block-view").removeClass("home-block-view").addClass("home-list-view"),$(".home-chronicle-block").removeClass("home-chronicle-block").addClass("home-chronicle-list"),$(".home-chronicle-block-button, .home-random-block-button, .home-alphabetical-block-button").hide(),$(".home-chronicle-list-button, .home-random-list-button, .home-alphabetical-list-button").show(),s(),r(),n(),o(),$(".home-block-view-button").removeClass("active-view-button"),$(".home-list-view-button").addClass("active-view-button"),$(".home-chronicle-block-button").hasClass("active-view-button")?($(".home-chronicle-block-button").removeClass("active-view-button"),$(".home-chronicle-list-button").addClass("active-view-button")):$(".home-random-block-button").hasClass("active-view-button")?($(".home-random-block-button").removeClass("active-view-button"),$(".home-random-list-button").addClass("active-view-button")):$(".home-alphabetical-block-button").hasClass("active-view-button")&&($(".home-alphabetical-block-button").removeClass("active-view-button"),$(".home-alphabetical-list-button").addClass("active-view-button"))}),$(".home-block-view-button").click(function(){console.log("Block view button clicked."),$(".home-list-sorting-buttons").hide(),$(".home-list-view").removeClass("home-list-view").addClass("home-block-view"),$(".home-chronicle-list").removeClass("home-chronicle-list").addClass("home-chronicle-block"),$(".home-chronicle-block-button, .home-random-block-button, .home-alphabetical-block-button").show(),$(".home-chronicle-list-button, .home-random-list-button, .home-alphabetical-list-button").hide(),s(),r(),n(),o(),$(".home-list-view-button").removeClass("active-view-button"),$(".home-block-view-button").addClass("active-view-button"),$(".home-chronicle-list-button").hasClass("active-view-button")?($(".home-chronicle-list-button").removeClass("active-view-button"),$(".home-chronicle-block-button").addClass("active-view-button")):$(".home-random-list-button").hasClass("active-view-button")?($(".home-random-list-button").removeClass("active-view-button"),$(".home-random-block-button").addClass("active-view-button")):$(".home-alphabetical-list-button").hasClass("active-view-button")&&($(".home-alphabetical-list-button").removeClass("active-view-button"),$(".home-alphabetical-block-button").addClass("active-view-button"))}),$(".home-chronicle-block-button").click(function(){i(),s(),r(),n(),o(),$(".home-chronicle-block-button").addClass("active-view-button"),$(".home-random-block-button").removeClass("active-view-button"),$(".home-alphabetical-block-button").removeClass("active-view-button")}),$(".home-random-block-button").click(function(){a(".list-container .card"),s(),r(),n(),o(),$(".home-random-block-button").addClass("active-view-button"),$(".home-chronicle-block-button").removeClass("active-view-button"),$(".home-alphabetical-block-button").removeClass("active-view-button")}),$(".home-alphabetical-block-button").click(function(){l(".list-container .card"),s(),r(),n(),o(),$(".home-alphabetical-block-button").addClass("active-view-button"),$(".home-chronicle-block-button").removeClass("active-view-button"),$(".home-random-block-button").removeClass("active-view-button")}),$(".home-chronicle-list-button").click(function(){i(),s(),r(),n(),o(),$(".home-chronicle-list-button").addClass("active-view-button"),$(".home-random-list-button").removeClass("active-view-button"),$(".home-alphabetical-list-button").removeClass("active-view-button")}),$(".home-random-list-button").click(function(){a(".list-container .card"),s(),r(),n(),o(),$(".home-random-list-button").addClass("active-view-button"),$(".home-chronicle-list-button").removeClass("active-view-button"),$(".home-alphabetical-list-button").removeClass("active-view-button")}),$(".home-alphabetical-list-button").click(function(){l(".list-container .card"),s(),r(),n(),o(),$(".home-alphabetical-list-button").addClass("active-view-button"),$(".home-chronicle-list-button").removeClass("active-view-button"),$(".home-random-list-button").removeClass("active-view-button")})):(console.log("NOT HOMEPAGE"),$(".home-list-view").show(),$(".chronicle-list-button, .list-view-button").addClass("active-view-button"),$(".chronicle-block-button, .random-block-button, .alphabetical-block-button").hide(),i(),s(),r(),n(),o(),$(".list-view-button").click(function(){console.log("List view button clicked."),$(".list-sorting-buttons").css("display","flex"),$(".block-sorting-buttons").hide(),$(".home-block-view").removeClass("home-block-view").addClass("home-list-view"),$(".home-chronicle-block").removeClass("home-chronicle-block").addClass("home-chronicle-list"),$(".chronicle-block-button, random-block-button, alphabetical-block-button").hide(),$(".chronicle-list-button, .random-list-button, .alphabetical-list-button").show(),s(),r(),n(),o(),$(".block-view-button").removeClass("active-view-button"),$(".list-view-button").addClass("active-view-button"),$(".chronicle-block-button").hasClass("active-view-button")?($(".chronicle-block-button").removeClass("active-view-button"),$(".chronicle-list-button").addClass("active-view-button")):$(".random-block-button").hasClass("active-view-button")?($(".random-block-button").removeClass("active-view-button"),$(".random-list-button").addClass("active-view-button")):$(".alphabetical-block-button").hasClass("active-view-button")&&($(".alphabetical-block-button").removeClass("active-view-button"),$(".alphabetical-list-button").addClass("active-view-button"))}),$(".block-view-button").click(function(){console.log("Block view button clicked."),$(".list-sorting-buttons").hide(),$(".block-sorting-buttons").css("display","flex"),$(".home-list-view").removeClass("home-list-view").addClass("home-block-view"),$(".home-chronicle-list").removeClass("home-chronicle-list").addClass("home-chronicle-block"),$(".chronicle-block-button, .random-block-button, .alphabetical-block-button").show(),$(".chronicle-list-button, .random-list-button, .alphabetical-list-button").hide(),s(),r(),n(),o(),$(".list-view-button").removeClass("active-view-button"),$(".block-view-button").addClass("active-view-button"),$(".chronicle-list-button").hasClass("active-view-button")?($(".chronicle-list-button").removeClass("active-view-button"),$(".chronicle-block-button").addClass("active-view-button")):$(".random-list-button").hasClass("active-view-button")?($(".random-list-button").removeClass("active-view-button"),$(".random-block-button").addClass("active-view-button")):$(".alphabetical-list-button").hasClass("active-view-button")&&($(".alphabetical-list-button").removeClass("active-view-button"),$(".alphabetical-block-button").addClass("active-view-button"))}),$(".chronicle-block-button").click(function(){i(),s(),r(),n(),o(),$(".chronicle-block-button").addClass("active-view-button"),$(".random-block-button").removeClass("active-view-button"),$(".alphabetical-block-button").removeClass("active-view-button")}),$(".random-block-button").click(function(){a(".list-container .card"),s(),r(),n(),o(),$(".random-block-button").addClass("active-view-button"),$(".chronicle-block-button").removeClass("active-view-button"),$(".alphabetical-block-button").removeClass("active-view-button")}),$(".alphabetical-block-button").click(function(){l(".list-container .card"),s(),r(),n(),o(),$(".alphabetical-block-button").addClass("active-view-button"),$(".chronicle-block-button").removeClass("active-view-button"),$(".random-block-button").removeClass("active-view-button")}),$(".chronicle-list-button").click(function(){i(),s(),r(),n(),o(),$(".chronicle-list-button").addClass("active-view-button"),$(".random-list-button").removeClass("active-view-button"),$(".alphabetical-list-button").removeClass("active-view-button")}),$(".random-list-button").click(function(){a(".list-container .card"),s(),r(),n(),o(),$(".random-list-button").addClass("active-view-button"),$(".chronicle-list-button").removeClass("active-view-button"),$(".alphabetical-list-button").removeClass("active-view-button")}),$(".alphabetical-list-button").click(function(){l(".list-container .card"),s(),r(),n(),o(),$(".alphabetical-list-button").addClass("active-view-button"),$(".chronicle-list-button").removeClass("active-view-button"),$(".random-list-button").removeClass("active-view-button")})),$(".general-toggle").click(function(){var t=$("#filters");$(".reset-button"),t.toggleClass("is-visible"),t.hasClass("is-visible")?(t.css("display","grid").hide().slideDown(100),$(this).text("[FILTER]"),$(document).on("mousedown.hideFilters",function(e){var i=!t.is(e.target)&&0===t.has(e.target).length,a=$(e.target).closest(".general-toggle").length>0;i&&!a&&(t.removeClass("is-visible").slideUp(100,function(){$(this).css("display","none")}),$(".general-toggle").text("[FILTER]"),$(document).off("mousedown.hideFilters"))})):(t.slideUp(100,function(){$(this).css("display","none")}),$(this).text("[FILTER]"),$(document).off("mousedown.hideFilters")),s(),r(),n(),o()}),$(".open-filter").click(function(t){t.stopPropagation();var e=$(this).closest(".filter").data("filter"),i=$(".card").length>0?".card":".community-card";console.log("Filter type:",e,"Card Selector:",i),$("#values-"+e).toggle(),$("#values-"+e).is(":visible")?$(this).addClass("active-filter"):$(this).removeClass("active-filter"),s(i),r(i),n(i),o(i),console.log("Updated views and borders after filter toggle")}),$(".reset-filter").click(function(t){t.stopPropagation(),$("#filters .values button").removeClass("active"),$(".open-filter").removeClass("active-filter"),$(".count-filtered-cards").text("").hide(),c(),s(),r(),n(),o()}),$("#filters .values button").click(function(){console.log("Filter is clicked!!!"),$(this).toggleClass("active"),c(),s(),r(),n(),o()}),$(window).on("scroll",function(){var t=$("#filters");t.hasClass("is-visible")&&(t.removeClass("is-visible").slideUp(100,function(){$(this).css("display","none")}),$(".general-toggle").text("[FILTER]"))});var h=[];function v(t){var e=0,i=t.length>1;function a(a){var l=t[e=a];u(e+1,t.length),$("#article-content").find(".article-images").html(b(l,e,t.length,i))}i&&($("#article-content").on("click",".next-arrow",function(){a((e+1)%t.length)}),$("#article-content").on("click",".prev-arrow",function(){a((e-1+t.length)%t.length)})),a(e)}function b(t,e,i,a){return'<div class="image-navigation"><p class="article-label-image">'+(e+1+"/")+i+' IMAGES</p><div class="image-container"><div class="arrows-and-image">'+(a?'<div class="prev-arrow"><</div><div class="next-arrow">></div>':"")+'<img src="'+t.src+'" alt="'+t.alt+'"></div><div class="'+t.captionClass+'">'+t.caption+"</div></div></div>"}function u(t,e){$("#article-content .article-label-image").text(t+"/"+e+" IMAGES")}function m(){let t=document.querySelector("#show-article"),e=t.clientHeight,i=-Math.atan(20/e),a=document.querySelector("#show-article-before");a.style.transform="matrix("+Math.cos(i)+","+Math.sin(i)+","+-Math.sin(i)+","+Math.cos(i)+",0,0)"}function p(t,i){i.stopPropagation(),console.log("openModal function called.");var a=$(t).hasClass("related-article");if(e.css("display","block"),$("#article-title").empty(),$("#article-content").empty(),a){for(var l=[],o=1;o<=5;o++){var n=".related-article-image"+o,c=".related-article-caption-image"+o,s=$(t).find(n+" img");if(s.length){var r=$(t).find(n+" "+c).text();l.push({link:$(t).find(n+" a").attr("href"),src:s.attr("src"),alt:s.attr("alt"),caption:r,captionClass:"related-article-caption-image"+o})}}l.length>1&&v(l);var h=$(t).find(".related-article-entry-number").text(),u=$(t).find(".related-article-people").html(),m=$(t).find(".related-article-title").text(),p=$(t).find(".related-article-type").html(),f=$(t).find(".related-article-pdf a").attr("href"),w=$(t).find(".related-article-link a").attr("href"),g=$(t).find(".related-article-entity").text(),k=$(t).find(".related-article-discipline").text(),C=$(t).find(".related-article-subject").html(),y=$(t).find(".related-article-description").html(),x=$(t).find(".related-article-reflection").html(),_=$(t).find(".related-article-quote").text(),S=$(t).find(".related-article-modification-date").text();$("#article-title").html('<p class="article-entry-number">'+h+'</p><p class="article-people">'+u+"</p>");var E='<div class="article-title-link">';if(E+='<p class="article-title">'+m+"</p>",E+='<div class="link-pdf">',f&&(E+='<a href="'+f+'" target="_blank" class="pdf-link-icon">[PDF<span class="text-symbol">⤴</span>]</a>'),w&&(E+='<a href="'+w+'" target="_blank" class="external-link-icon">[WEB<span class="text-symbol">⤴</span>]</a>'),E+="</div>",E+="</div>",E+='<p class="article-type">'+p+'</p><div class="article-metadata"><div class="article-metadata-column"><p class="article-metadata-label">Entity</p><p class="article-metadata-value">'+g+'</p></div><div class="article-metadata-column"><p class="article-metadata-label">Discipline</p><p class="article-metadata-value">'+k+'</p></div><div class="article-metadata-column"><p class="article-metadata-label">Subject(s)</p><p class="article-metadata-value">'+C+"</p></div></div>",l.length>0){var F=l[0],L=l.length>1;E+='<div class="article-images">'+b(F,0,l.length,L)+"</div>"}E+=(y?'<p class="article-label-description">Description</p><div class="article-description">'+d(y)+"</div>":"")+(x?'<p class="article-label-reflection">Reflection</p><div class="article-reflection">'+d(x)+"</div>":"")+(_?'<p class="article-label-quote">Quote</p><p class="article-quote">'+_+"</p>":"")+'<p class="article-label-modification-date">Added on</p><div class="article-modification-date">'+S+"</div>",$("#article-content").html(E)}else{for(var l=[],o=1;o<=5;o++){var n=".image"+o,c=".caption-image"+o,s=$(t).find(n+" img");if(s.length){var r=$(t).find(n+" "+c).text();l.push({link:$(t).find(n+" a").attr("href"),src:s.attr("src"),alt:s.attr("alt"),caption:r,captionClass:"caption-image"+o})}}l.length>1&&v(l);var h=$(t).find(".entry-number").text(),m=$(t).find(".title").text(),u=$(t).find(".people").html(),p=$(t).find(".type").html(),f=$(t).find(".pdf a").attr("href"),w=$(t).find(".link a").attr("href"),g=$(t).find(".entity").text(),k=$(t).find(".discipline").text(),C=$(t).find(".subject").html(),y=$(t).find(".description").html(),x=$(t).find(".reflection").html(),_=$(t).find(".quote").text(),q=$(t).find(".external-reference").html(),S=$(t).find(".modification-date").text(),D=$(t).find(".related-articles").html();$("#article-title").html('<p class="article-entry-number">'+h+'</p><p class="article-people">'+u+"</p>");var E='<div class="article-title-link">';if(E+='<p class="article-title">'+m+"</p>",E+='<div class="link-pdf">',f&&(E+='<a href="'+f+'" target="_blank" class="pdf-link-icon">[PDF<span class="text-symbol">⤴</span>]</a>'),w&&(E+='<a href="'+w+'" target="_blank" class="external-link-icon">[WEB<span class="text-symbol">⤴</span>]</a>'),E+="</div>",E+="</div>",E+='<p class="article-type">'+p+'</p><div class="article-metadata"><div class="article-metadata-column"><p class="article-metadata-label">Entity</p><p class="article-metadata-value">'+g+'</p></div><div class="article-metadata-column"><p class="article-metadata-label">Discipline</p><p class="article-metadata-value">'+k+'</p></div><div class="article-metadata-column"><p class="article-metadata-label">Subject(s)</p><p class="article-metadata-value">'+C+"</p></div></div>",l.length>0){var F=l[0],L=l.length>1;E+='<div class="article-images">'+b(F,0,l.length,L)+"</div>"}E+=(y?'<p class="article-label-description">Description</p><div class="article-description">'+d(y)+"</div>":"")+(x?'<p class="article-label-reflection">Reflection</p><div class="article-reflection">'+d(x)+"</div>":"")+(q?'<p class="article-label-external-reference">References</p><p class="article-external-reference">'+q+"</p>":"")+(_?'<p class="article-label-quote">Quote</p><p class="article-quote">'+_+"</p>":"")+'<p class="article-label-modification-date">Added on</p><div class="article-modification-date">'+S+"</div>",$("#article-content").html(E),$("#related-articles").html(D),D&&D.trim().length>0&&$("#related-articles").html('<div class="related-articles-label">Related Articles</div><div class="related-articles-container">'+D+"</div>").show()}$(".home-chronicle-list").is(":visible")?($(".home-list-view").each(function(){var t=$(this).width();$(this).data("originalWidth",t),$(this).css("width","calc(60% - 2px)")}),$(".home-chronicle-list .type").each(function(){var t=$(this).css("left");$(this).data("originalLeft",t),$(this).css("left","85%")})):$(".home-chronicle-block").is(":visible")&&($(".home-chronicle-block div.list-container").each(function(){$(this).width(),$(this).css("width","calc(60% - 0px)")}),$(".home-chronicle-block div.list-container div.card").each(function(){$(this).width(),$(this).css("width","calc(33.333% - 0px)")})),$(".list-container").addClass("fade-out")}function f(){$(".home-chronicle-list").is(":visible")?($(".home-list-view").css("width","100%"),$(".home-chronicle-list div.list-container div.card div.type").css("left","90%")):$(".home-chronicle-block").is(":visible")&&r(),e.hide()}if($(".article-images .image-container").each(function(){var t=$(this).find("img"),e=$(this).find('div[class^="caption-image"]'),i={src:t.attr("src"),alt:t.attr("alt"),caption:e.text(),captionClass:e.attr("class")};h.push(i)}),h.length>0&&(v(h),u(1,h.length)),$(".caption-image1").each(function(){var t=$(this).html().split("<br>").map(function(t){return'<span class="caption-line">'+t+"</span>"}).join("<br>");$(this).html(t)}),$(".card").on("click",function(t){if(!$(t.target).closest(".people a, .type a").length){if($(this).hasClass("event")){var e,i,a;t.stopImmediatePropagation(),e=this,(i=t).stopPropagation(),i.preventDefault(),(a=$(e).find(".link a").attr("href"))&&window.open(a,"_blank").focus(),$(".list-container").removeClass("fade-out"),f()}else p(this,t),m()}}),$("#show-article-wrapper").on("click",".related-article",function(t){p(this,t),m()}),$("#close-button").on("click",function(){$(".list-container").removeClass("fade-out"),f()}),$(document).on("mousedown",function(t){var i=!e.is(t.target)&&0===e.has(t.target).length,a=$(t.target).closest(".card, .list-card").length>0;i&&!a&&($(".list-container").removeClass("fade-out"),e.css("display","none"),f())}),$("#show-article-wrapper").hover(function(){$(this).css("overflow-y","auto"),$(this).css("overflow-x","hidden")},function(){$(this).css("overflow-y","hidden"),$(this).css("overflow-x","hidden")}),$(".community-card").length&&$(".community-card").each(function(){var t=$(this).find(".community-description"),e=d(t.text());t.html(e),$(this).find("*").each(function(){($(this).is(":empty")||"<br>"===$(this).html().trim())&&$(this).remove()})}),console.log("Document ready!"),$("#show-article-wrapper-entry").length){function d(t){return t.split("\n").filter(function(t){return""!==t.trim()}).map(function(t){return"<p>"+t.trim()+"</p>"}).join("")}if(console.log("Element with id 'show-article-wrapper-entry' found!"),$(".article-description").length){console.log("Element with class 'article-description' found!");var w=$(".article-description").text();console.log("Original description text:",w);var g=d(w);console.log("Formatted description text:",g),$(".article-description").html(g)}if($(".article-reflection").length){console.log("Element with class 'article-reflection' found!");var k=$(".article-reflection").text();console.log("Original reflection text:",k);var C=d(k);console.log("Formatted reflection text:",C),$(".article-reflection").html(C)}}if($(".mw-search-results-info").length){var y=$(".mw-search-results-info > p");"There were no results matching the query."!==y.text().trim()&&y.text("Pages related to your Search")}var x={};$(".mw-search-result-heading").each(function(){var t=$(this).find("a").attr("title");x[t]?$(this).hide():x[t]=!0}),$(".mw-search-results-container").contents().filter(function(){return 3===this.nodeType}).remove(),$("#searchText").replaceWith('<form action="/index.php" id="searchform"><div id="simpleSearchSpecial" class="right-inner-addon"><span>[ Search ]</span><input class="form-control" name="search" placeholder="" title="Search [alt-shift-f]" accesskey="f" id="searchInput" tabindex="1" autocomplete="off" type="search"><span class="closing-bracket">]</span><input value="Special:Search" name="title" type="hidden"></div></form>'),$(".oo-ui-actionFieldLayout-button .oo-ui-buttonInputWidget").remove();var _=document.querySelector("#submit");console.log("Submit button:",_),_&&(console.log("#submit button found."),_.addEventListener("click",function(t){console.log("Submit button clicked."),t.preventDefault();var e="mailto:"+encodeURIComponent("submit@softwear.directory")+"?subject="+encodeURIComponent("new entry to the softwear directory")+"&body="+encodeURIComponent("☺ the following content could be interesting for the directory:\n\n[ author / creator ]\n\n---\n\n[ title ]\n\n---\n\n[ why should it be included? ]\n\n---\n\n[ link or pdf ]\n\n---\n\n[ your name / contact / social ]\n\n---").replace(/%20/g," ");window.location.href=e}))});