PageSourceSearch

https://communistvoice.org/js/app.min.js

js communistvoice.org collected 2026-09-24 23:31:48 UTC 12,139 bytes, 6 lines download raw bytes

1"use strict";
2/*!
3 * HelpNDoc HTML template
4 * Copyright (C) IBE Software - All rights reserved.
5 * Can only be used in documentation generated by HelpNDoc: http://www.helpndoc.com
6 */class Exception extends Error{constructor(e){super(e),this.message=e,this.name="Exception",this.message=e}toString(){return"["+this.name+']: "'+this.message+'"'}}class EInvalidHtmlElement extends Exception{constructor(e){super(e),this.message=e,this.name="EInvalidHtmlElement"}}var Hnd;!function(e){e.AppOptions=class{};e.AppEvents=class{};e.App=class{_(e){var t=this.TRANSLATIONS[e];return t||e}doOnJsTreeError(e,t){console.error("JSTree Error",t);e=e.find(".jstree-loading");e&&(t.error&&"ajax"==t.error?e.html('<strong>Loading Error</strong>: Please make sure your web-server is correctly configured to serve JSON files. <a href="https://www.helpndoc.com/sites/default/files/documentation/html/Tableofcontentsisemptyorloadingi.html">Learn more...</a>'):e.html("<strong>Error</strong>: please check your web-developer console for more information."))}doOnTopicChanged(e){this.EVENTS.onTopicChanged&&("string"==typeof e&&""!==e||(e=$(this.options.elTopicContent).data("hnd-id")+".html"),this.EVENTS.onTopicChanged(e))}doProcessParameters(){var e=URI(location.href).search(!0);e.tab&&""!=e.tab&&$("#tab-"+e.tab).tab("show"),e.search&&void 0!==e.search&&""!=e.search&&(this.$elSearchInput.val(e.search),this.$elSearchInput.trigger("keyup"),this.$elSearchForm.trigger("submit"))}fixURI(e){return e.replace(/\%u00A0/g,"%20")}getAnchor(){return window.location.hash.substring(1)}isExternalLink(e){function t(e){return(e=0===e.indexOf("//")?location.protocol+e:e).toLowerCase().replace(/([a-z])?:\/\//,"$1").split("/")[0]}return(-1<e.indexOf(":")||-1<e.indexOf("//"))&&t(location.href)!==t(e)||(e=new URI(e),-1==["htm","html"].indexOf(e.suffix().toLowerCase()))}DoShowExternalUrl(e,t,o){"mailto:"==t.substring(0,7).toLowerCase()?location.href=t:(o&&""!=o.trim()||(o="_self"),window.open(t,o))}DoShowTopic(e,n,s){this.$elTopicContainer.load(s+" "+this.options.elTopicContent,(e,t,o)=>{var i=$(this.options.elTopicContent).data("hnd-id");if(window.history.pushState({id:i,title:n},n,s),"undefined"!=typeof ga&&ga)try{void 0!==ga.getAll&&ga.getAll&&ga.getAll()[0]?ga.getAll()[0].send("pageview",location.pathname):ga("send","pageview",location.pathname)}catch(e){console.error("[HND-APP] An error occurred while using Google Analytics tracking code =>",e.toString())}this.DoUpdateInlineToc(),this.SelectTopicInToc(i,n,!0),this.DoScrollToAnchorIfNeeded(),this.DoHighlightText(this.searchTerm),imageMapResize(),this.doOnTopicChanged(s)})}DoHandleLink(e,t,o,i,n){"_blank"==i||this.isExternalLink(o)||!0===n?this.DoShowExternalUrl(t,o,i):this.DoShowTopic(e,t,o)}DoHighlightText(e){try{this.$elTopicContainer.unmark(),e&&""!==e&&this.$elTopicContainer.mark(e,{accuracy:"complementary",diacritics:!1})}catch(e){console.error("[HND-APP] An error occurred while highlighting the search term =>",e.toString())}}DoScrollToAnchorIfNeeded(){var e,t,o=decodeURIComponent(this.getAnchor());""!==o?(e=(e=(e=$("a[name='"+o+"']"))&&e.length?e:$("a[name='"+o.toLowerCase()+"']"))&&e.length?e:$("#"+o))&&void 0!==e&&e.offset&&e.offset()?(t=this.$elHeadroom.position().top<0?0:this.$elHeadroom.outerHeight(!0)+5,$("html,body").animate({scrollTop:e.offset().top-t},"fast")):console.error("[HND-APP] Unkonwn or invalid anchor =>",o):$("html,body").animate({scrollTop:0},"fast")}DoUpdateInlineToc(){var e=this.options.inlineTocHeadings,t=$(this.options.elInlineTocContainer);let i=e.split(","),n=0,s=[t];$(this.$elTopicContainer).find(e).attr("id",function(e,t){return t||function(e){for(var t=(e=0===e.length?"heading":e).replace(/[^a-zA-Z0-9]+/g,"_"),o="",i=1;null!==document.getElementById(t+o);)o="_"+i++;return t+o}($(this).text())}).each(function(){var e,o=$(this),t=$.map(i,function(e,t){return o.is(e)?t:void 0})[0];t>n?(e=s[0].children("li:last")[0])&&s.unshift($("<ul/>").appendTo(e)):s.splice(0,Math.min(n-t,Math.max(s.length-1,0))),$("<li/>").appendTo(s[0]).append($("<a/>").addClass("dropdown-item").text(o.text()).attr("href","#"+o.attr("id"))),n=t})}
6InitHeadRoom(){if(this.$elHeadroom=$(this.options.elHeadroom),!this.$elHeadroom.length)throw new EInvalidHtmlElement("Invalid headroom element ["+this.options.elHeadroom+"]");new Headroom(this.$elHeadroom.get(0),{offset:100,tolerance:5,classes:{initial:"animated",pinned:"slideDown",unpinned:"slideUp"},onUnpin:function(){$("body").addClass("header-up")},onPin:function(){$("body").removeClass("header-up")}}).init()}InitMask(){this.$elMask=$(this.options.elMask),this.$elMask.on("click",e=>{var t=this.$elMask.data("toggle");t&&$("body").removeClass(t)})}InitModal(){this.$elModal=$(this.options.elModal),this.$elModal.find(".modal-title").html(this._("Related topics...")),this.$elModal.find(".modal-btn-close").html(this._("Close")),this.$elModal.modal({show:!1})}InitResponsiveClasses(){var o="";function e(){var e="",t=$(window).width();t<768?e="mode-xs":t<992?e="mode-sm":t<1200?e="mode-md":1200<=t&&(e="mode-lg"),e!=o&&($("body").removeClass(["mode-xs","mode-sm","mode-md","mode-lg"]).addClass(e),"mode-xs"==e?($("header").css("padding-left",""),$("#main").css("margin-left",""),$("#panel-left").css("width","")):"mode-xs"==o&&(t=$("#hnd-splitter").offset().left,$("header").css("padding-left",t+14),$("#main").css("margin-left",t),$("#panel-left").css("width",t)),o=e)}e(),$(window).on("resize",()=>{e()})}InitSplitter(){var t=0;const o=parseInt($("nav").css("width"),10);var e=$("#hnd-splitter");e&&e.length&&interact("#hnd-splitter").draggable({cursorChecker:()=>"ew-resize",startAxis:"xy",lockAxis:"x",listeners:{move(e){t+=e.dx,e.target.style.transform="translateX("+t+"px)"},end(e){$("header").css("padding-left",o+14+t),$("#main").css("margin-left",o+t),$("#panel-left").css("width",o+t)}}})}
6InitSearchEngine(){this.searchEngine=new HndJsSe}InitSearchForm(){this.$elTreeSearch=$(this.options.elTreeSearch).first(),this.$elSearchForm=$(this.options.elSearchForm),this.$elSearchInfo=$(this.options.elSearchInfo),this.$elSearchInput=$(this.options.elSearchInput),this.$elSearchTab=$(this.options.elSearchTab),this.$elSearchInfo.html(this._("Please enter more characters")+"."),this.$elSearchInfo.show(),this.$elSearchTab.on("click",e=>{setTimeout(()=>{this.$elSearchInput.trigger("focus").trigger("select")},50)}),this.$elSearchInput.on("keyup",e=>{this.searchTerm=String(this.$elSearchInput.val()),this.DoHighlightText(this.searchTerm)}),this.$elSearchForm.on("submit",e=>{e.preventDefault();var t=this.$elTreeSearch.jstree(!0),e=$(e.target).find('input[type="text"]').first(),e=String(e.val());if(this.$elSearchInfo.hide(),t.delete_node(this.$elTreeSearch.find("li").toArray()),e.length<this.options.searchEngineMinChars)this.$elSearchInfo.html(this._("Search term too short")+". "+this._("Please enter more characters")+"."),this.$elSearchInfo.show();else if(window.bSearchDataLoaded)if(oWl){this.searchEngine.ParseInput(e);var o=this.searchEngine.PerformSearch(oWl);if(0==o.length)this.$elSearchInfo.html(this._("No results")+". "+this._("Please enter more characters")+"."),this.$elSearchInfo.show();else for(var i="",n=0;n<o.length;n++){i=this.fixURI(aTl[o[n][0]][1]);try{i=decodeURIComponent(i)}catch(e){console.warn("Node text contains illegal characters :",i)}t.create_node("#",{parent:"#",text:i+" ("+o[n][1]+")",a_attr:{href:aTl[o[n][0]][0]}})}}else this.$elSearchInfo.html(this._("Incorrect or corrupt search data. Please check your HelpNDoc template")),this.$elSearchInfo.show();else this.$elSearchInfo.html(this._("Word list not ready yet. Please wait until the word list is fully downloaded.")),this.$elSearchInfo.show()})}InitToggler(){this.$elToggler=$(this.options.elToggler),this.$elToggler.on("click",e=>{var t=window.matchMedia("(max-width: 768px)").matches?this.options.classNavExpandedSmall:this.options.classNavExpandedMedium;$("body").toggleClass(t)})}InitTrees(){this.$elTreeContainers=$(this.options.elTreeContainers),this.$elTreeContainers.each((e,i)=>{var t=$(i).data("url"),t=t?{url:t,dataType:"json"}:null;$(i).on("changed.jstree",(e,t,o,i)=>{if("select_node"===t.action){var n=t.node.a_attr.href,s=t.node.id,a=t.node.text,r=t.node.a_attr.target||"_self",l=$(t.event.target).data("related");if(l&&l.length){l.sort((e,t)=>{e=e.title.toUpperCase(),t=t.title.toUpperCase();return e<t?-1:t<e?1:0});for(var h='<ul class="relative-list">',c=0;c<l.length;c++)h=h+'<li><a href="'+l[c].url+'">'+l[c].title+"</a></li>";h+="</ul>",this.$elModal.find(".modal-body").html(h),this.$elModal.modal("show")}else $("body").removeClass("sm-nav-expanded"),this.DoHandleLink(s,a,n,r,!1)}}).on("ready.jstree",(e,t)=>{this.SelectTopicInToc("","",!0);var o=parseInt($(i).data("openlvl"),10);o&&this.OpenTreeToLevel($(i),o)}).jstree({core:{animation:this.options.animationDelay,check_callback:$(i).is($(this.options.elTreeSearch)),multiple:!1,strings:{"Loading ...":this._("Loading...")},themes:{dots:!1,responsive:!0},data:t,error:e=>{this.doOnJsTreeError($(i),e)}},types:{default:{icon:"icon-default"}},plugins:["types"]})})}InitHistory(){window.onpopstate=e=>{this.$elTopicContainer.load(window.location+" "+this.options.elTopicContent,(e,t,o)=>{this.DoUpdateInlineToc(),this.SelectTopicInToc("","",!0),this.DoScrollToAnchorIfNeeded()})}}InitLinks(){var e=e=>{e.preventDefault();var t=e.currentTarget;this.$elModal&&this.$elModal.modal("hide"),$("body").removeClass("sm-nav-expanded"),this.DoHandleLink("","",t.href,t.target,!0===e.ctrlKey)};this.$elTopicContainer.on("click","a",e),$(".modal-body").on("click","a",e)}Init(){if(this.$elTopicContainer=$(this.options.elTopicContainer),!this.$elTopicContainer)throw new EInvalidHtmlElement("Invalid topic container element ["+this.options.elTopicContainer+"]")}constructor(e){this.DEFAULTS={animationDelay:200,elHeadroom:"header",elInlineTocContainer:"#inline-toc",elMask:".mask",elModal:"#hndModal",elSearchForm:"#search-form",elSearchInfo:"#search-info",elSearchInput:"#input-search",elSearchTab:"#tab-search",elToggler:".hnd-toggle",elTopicContainer:"article",elTopicContent:"#topic-content",elTreeContainers:".tree-container",elTreeSearch:"#search-tree",classNavExpandedSmall:"sm-nav-expanded",classNavExpandedMedium:"md-nav-expanded",inlineTocHeadings:"h1,h2,h3",searchEngineMinChars:3},this.EVENTS={onTopicChanged:null},this.TRANSLATIONS={"Search term too short":"Search term too short","No results":"No results","Please enter more characters":"Please enter more characters","Word list not ready yet. Please wait until the word list is fully downloaded":"Word list not ready yet. Please wait until the word list is fully downloaded","Incorrect or corrupt search data. Please check your HelpNDoc template":"Incorrect or corrupt search data. Please check your HelpNDoc template","Related topics...":"Related topics...","Loading...":"Loading...",Close:"Close"},this.options=$.extend({},this.DEFAULTS,e),this.Init()}Boot(){try{this.InitTrees(),this.InitLinks(),this.InitHistory(),this.InitToggler(),this.InitMask(),this.InitModal(),this.InitSearchEngine(),this.InitSearchForm(),this.InitHeadRoom(),this.InitSplitter(),this.InitResponsiveClasses(),this.doOnTopicChanged(),this.doProcessParameters(),this.DoUpdateInlineToc()}catch(e){console.error("[HND-APP] An error occurred while booting the application =>",e.toString())}}OpenTreeToLevel(e,i){try{if(i){const n=$(e).jstree(!0);n&&$(n.get_json("#",{no_a_attr:!0,no_children:!1,no_data:!0,no_id:!1,no_li_attr:!0,no_state:!0,flat:!0})).each(function(e,t){var o=n.get_node($(this).attr("id"));o.parents.length<=i&&n.open_node(o)})}}catch(e){console.error("[HND-APP] An error occurred while opening the tree =>",e.toString())}}SelectTopicInToc(t,e,o=!1){"string"==typeof t&&""!==t||(t=$(this.options.elTopicContent).data("hnd-id")),"string"==typeof e&&""!==e||(e=$(this.options.elTopicContent).data("hnd-title")),"string"==typeof t&&""!==t&&(this.$elTreeContainers.jstree("deselect_all",!0),this.$elTreeContainers.jstree("select_node",t,!0,!1),e&&""!==e&&(document.title=e),o)&&setTimeout(()=>{var e=document.getElementById(t+"_anchor");e&&e.focus()},this.options.animationDelay+50)}}}(Hnd=Hnd||{});

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.