"use strict"; /*! * HelpNDoc HTML template * Copyright (C) IBE Software - All rights reserved. * Can only be used in documentation generated by HelpNDoc: http://www.helpndoc.com */var Hnd,__extends=this&&this.__extends||function(){var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}))(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}}(),Exception=function(o){function e(e){var t=o.call(this,e)||this;return t.message=e,t.name="Exception",t.message=e,t}return __extends(e,o),e.prototype.toString=function(){return"["+this.name+']: "'+this.message+'"'},e}(Error),EInvalidHtmlElement=function(o){function e(e){var t=o.call(this,e)||this;return t.message=e,t.name="EInvalidHtmlElement",t}return __extends(e,o),e}(Exception);!function(e){function t(){}e.AppOptions=function(){};e.AppEvents=t,n.prototype._=function(e){var t=this.TRANSLATIONS[e];return t||e},n.prototype.doOnJsTreeError=function(e,t){console.error("JSTree Error",t);e=e.find(".jstree-loading");e&&(t.error&&"ajax"==t.error?e.html('Loading Error: Please make sure your web-server is correctly configured to serve JSON files. Learn more...'):e.html("Error: please check your web-developer console for more information."))},n.prototype.doOnTopicChanged=function(e){this.EVENTS.onTopicChanged&&("string"==typeof e&&""!==e||(e=$(this.options.elTopicContent).data("hnd-id")+".html"),this.EVENTS.onTopicChanged(e))},n.prototype.doProcessParameters=function(){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.keyup(),this.$elSearchForm.submit())},n.prototype.fixURI=function(e){return e.replace(/\%u00A0/g,"%20")},n.prototype.getAnchor=function(){return window.location.hash.substr(1)},n.prototype.isExternalLink=function(e){function t(e){return(e=0===e.indexOf("//")?location.protocol+e:e).toLowerCase().replace(/([a-z])?:\/\//,"$1").split("/")[0]}return(-1",e.toString())}a.DoUpdateInlineToc(),a.SelectTopicInToc(n,i,!0),a.DoScrollToAnchorIfNeeded(),a.DoHighlightText(a.searchTerm),imageMapResize(),a.doOnTopicChanged(r)})},n.prototype.DoHandleLink=function(e,t,o,n,i){"_blank"==n||this.isExternalLink(o)||!0===i?this.DoShowExternalUrl(t,o,n):this.DoShowTopic(e,t,o)},n.prototype.DoHighlightText=function(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())}},n.prototype.DoScrollToAnchorIfNeeded=function(){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")},n.prototype.DoUpdateInlineToc=function(){var e=this.options.inlineTocHeadings,t=$(this.options.elInlineTocContainer),n=e.split(","),i=0,r=[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="",n=1;null!==document.getElementById(t+o);)o="_"+n++;return t+o}($(this).text())}).each(function(){var e,o=$(this),t=$.map(n,function(e,t){return o.is(e)?t:void 0})[0];i").appendTo(e)):r.splice(0,Math.min(i-t,Math.max(r.length-1,0))),$("
  • ").appendTo(r[0]).append($("").text(o.text()).attr("href","#"+o.attr("id"))),i=t})},n.prototype.InitHeadRoom=function(){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()},n.prototype.InitMask=function(){var o=this;this.$elMask=$(this.options.elMask),this.$elMask.on("click",function(e){var t=o.$elMask.data("toggle");t&&$("body").removeClass(t)})},n.prototype.InitModal=function(){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})},n.prototype.InitResponsiveClasses=function(){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",function(){e()})},n.prototype.InitSplitter=function(){var t=0,o=parseInt($("nav").css("width"),10),e=$("#hnd-splitter");e&&e.length&&interact("#hnd-splitter").draggable({cursorChecker:function(){return"ew-resize"},startAxis:"xy",lockAxis:"x",listeners:{move:function(e){t+=e.dx,e.target.style.transform="translateX("+t+"px)"},end:function(e){$("header").css("padding-left",o+14+t),$("#main").css("margin-left",o+t),$("#panel-left").css("width",o+t)}}})},n.prototype.InitSearchEngine=function(){this.searchEngine=new HndJsSe},n.prototype.InitSearchForm=function(){var r=this;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",function(e){setTimeout(function(){r.$elSearchInput.trigger("focus").trigger("select")},50)}),this.$elSearchInput.on("keyup",function(e){r.searchTerm=String(r.$elSearchInput.val()),r.DoHighlightText(r.searchTerm)}),this.$elSearchForm.on("submit",function(e){e.preventDefault();var t=r.$elTreeSearch.jstree(!0),e=$(e.target).find('input[type="text"]').first(),e=String(e.val());if(r.$elSearchInfo.hide(),t.delete_node(r.$elTreeSearch.find("li").toArray()),e.length'+l[h].title+"
  • ";c+="",d.$elModal.find(".modal-body").html(c),d.$elModal.modal("show")}else $("body").removeClass("sm-nav-expanded"),d.DoHandleLink(r,a,i,s,!1)}}).on("ready.jstree",function(e,t){d.SelectTopicInToc("","",!0);var o=parseInt($(n).data("openlvl"),10);o&&d.OpenTreeToLevel($(n),o)}).jstree({core:{animation:d.options.animationDelay,check_callback:$(n).is($(d.options.elTreeSearch)),multiple:!1,strings:{"Loading ...":d._("Loading...")},themes:{dots:!1,responsive:!0},data:t,error:function(e){d.doOnJsTreeError($(n),e)}},types:{default:{icon:"icon-default"}},plugins:["types"]})})},n.prototype.InitHistory=function(){var n=this;window.onpopstate=function(e){n.$elTopicContainer.load(window.location+" "+n.options.elTopicContent,function(e,t,o){n.SelectTopicInToc("","",!0),n.DoScrollToAnchorIfNeeded()})}},n.prototype.InitLinks=function(){function e(e){e.preventDefault();var t=e.currentTarget;o.$elModal&&o.$elModal.modal("hide"),$("body").removeClass("sm-nav-expanded"),o.DoHandleLink("","",t.href,t.target,!0===e.ctrlKey)}var o=this;this.$elTopicContainer.on("click","a",e),$(".modal-body").on("click","a",e)},n.prototype.Init=function(){if(this.$elTopicContainer=$(this.options.elTopicContainer),!this.$elTopicContainer)throw new EInvalidHtmlElement("Invalid topic container element ["+this.options.elTopicContainer+"]")},n.prototype.Boot=function(){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())}},n.prototype.OpenTreeToLevel=function(e,n){try{var i;!n||(i=$(e).jstree(!0))&&$(i.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=i.get_node($(this).attr("id"));o.parents.length<=n&&i.open_node(o)})}catch(e){console.error("[HND-APP] An error occurred while opening the tree =>",e.toString())}},n.prototype.SelectTopicInToc=function(t,e,o){void 0===o&&(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(function(){var e=document.getElementById(t+"_anchor");e&&e.focus()},this.options.animationDelay+50))};var o=n;function n(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()}e.App=o}(Hnd=Hnd||{});