/*! * HelpNDoc HTML template * Copyright (C) IBE Software - All rights reserved. * Can only be used in documentation generated by HelpNDoc: http://www.helpndoc.com */ var __extends=this&&this.__extends||function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),Exception=function(e){function t(t){var o=e.call(this,t)||this;return o.message=t,o.name="Exception",o.message=t,o}return __extends(t,e),t.prototype.toString=function(){return"["+this.name+']: "'+this.message+'"'},t}(Error),EInvalidHtmlElement=function(e){function t(t){var o=e.call(this,t)||this;return o.message=t,o.name="EInvalidHtmlElement",o}return __extends(t,e),t}(Exception),Hnd;!function(e){var t=function(){function e(){}return e}();e.AppOptions=t;var o=function(){function e(){}return e}();e.AppEvents=o;var n=function(){function e(e){this.DEFAULTS={animationDelay:200,elHeadroom:"header",elMask:".mask",elModal:"#hndModal",elSearchForm:"#search-form",elSearchInfo:"#search-info",elSearchInput:"#input-search",elToggler:".hnd-toggle",elTopicContainer:"article",elTopicContent:"#topic-content",elTreeContainers:".tree-container",elTreeSearch:"#search-tree",classNavExpandedSmall:"sm-nav-expanded",classNavExpandedMedium:"md-nav-expanded"},this.EVENTS={onTopicChanged:null},this.TRANSLATIONS={"Search term too short":"Search term too short","No results":"No results","Please enter 3 or more characters":"Please enter 3 or 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()}return e.prototype._=function(e){var t=this.TRANSLATIONS[e];return t?t:e},e.prototype.doOnJsTreeError=function(e,t){console.error("JSTree Error",t);var o=e.find(".jstree-loading");o&&(t.error&&"ajax"==t.error?o.html('Loading Error: Please make sure your web-server is correctly configured to serve JSON files. Learn more...'):o.html("Error: please check your web-developer console for more information."))},e.prototype.doOnTopicChanged=function(e){this.EVENTS.onTopicChanged&&("string"==typeof e&&""!==e||(e=$(this.options.elTopicContent).data("hnd-id")+".html"),this.EVENTS.onTopicChanged(e))},e.prototype.doProcessParameters=function(){var e=URI(location.href),t=e.search(!0);t.tab&&""!=t.tab&&$("#tab-"+t.tab).tab("show"),t.search&&""!=t.search&&(this.$elSearchInput.val(t.search),this.$elSearchInput.keyup(),this.$elSearchForm.submit())},e.prototype.fixURI=function(e){return e.replace(/\%u00A0/g,"%20")},e.prototype.getAnchor=function(){return window.location.hash.substr(1)},e.prototype.isExternalLink=function(e){var t=function(e){return 0===e.indexOf("//")&&(e=location.protocol+e),e.toLowerCase().replace(/([a-z])?:\/\//,"$1").split("/")[0]};if((e.indexOf(":")>-1||e.indexOf("//")>-1)&&t(location.href)!==t(e))return!0;var o=new URI(e);return["htm","html"].indexOf(o.suffix().toLowerCase())==-1},e.prototype.DoShowExternalUrl=function(e,t,o){window.open(t,o)},e.prototype.DoShowTopic=function(e,t,o){var n=this;this.$elTopicContainer.load(o+" "+this.options.elTopicContent,function(e,r,i){var a=$(n.options.elTopicContent),l=a.data("hnd-id");a.data("hnd-context");if(window.history.pushState({id:l,title:t},t,o),"undefined"!=typeof ga&&ga)try{if(void 0!==ga.getAll&&ga.getAll&&ga.getAll()[0]){ga.getAll()[0].send("pageview",location.pathname)}else ga("send","pageview",location.pathname)}catch(e){console.error("[HND-APP] An error occurred while using Google Analytics tracking code =>",e.toString())}n.SelectTopicInToc(l,t,!1),n.DoScrollToAnchorIfNeeded(),n.DoHighlightText(n.searchTerm),n.doOnTopicChanged(o)})},e.prototype.DoHandleLink=function(e,t,o,n,r){"_blank"==n||this.isExternalLink(o)||r===!0?this.DoShowExternalUrl(t,o,n):this.DoShowTopic(e,t,o)},e.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())}},e.prototype.DoScrollToAnchorIfNeeded=function(){var e=decodeURIComponent(this.getAnchor());if(""!==e){var t=$("a[name='"+e+"']");if(t&&t.length||(t=$("a[name='"+e.toLowerCase()+"']")),t&&t.offset&&t.offset()){var o=this.$elHeadroom.position().top<0?0:this.$elHeadroom.outerHeight(!0)+5;$("html,body").animate({scrollTop:t.offset().top-o},"fast")}else console.error("[HND-APP] Unkonwn or invalid anchor =>",e)}else $("html,body").animate({scrollTop:0},"fast")},e.prototype.InitHeadRoom=function(){if(this.$elHeadroom=$(this.options.elHeadroom),!this.$elHeadroom.length)throw new EInvalidHtmlElement("Invalid headroom element ["+this.options.elHeadroom+"]");this.$elHeadroom.headroom({offset:100,tolerance:5,classes:{initial:"animated",pinned:"slideDown",unpinned:"slideUp"},onUnPin:function(){$("body").addClass("header-up")},onPin:function(){$("body").removeClass("header-up")}})},e.prototype.InitMask=function(){var e=this;this.$elMask=$(this.options.elMask),this.$elMask.click(function(t){var o=e.$elMask.data("toggle");o&&$("body").removeClass(o)})},e.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})},e.prototype.InitSearchEngine=function(){this.searchEngine=new HndJsSe},e.prototype.InitSearchForm=function(){var e=this;this.$elTreeSearch=$(this.options.elTreeSearch).first(),this.$elSearchForm=$(this.options.elSearchForm),this.$elSearchInfo=$(this.options.elSearchInfo),this.$elSearchInput=$(this.options.elSearchInput),this.$elSearchInfo.html(this._("Please enter 3 or more characters")+"."),this.$elSearchInfo.show(),this.$elSearchInput.keyup(function(t){e.searchTerm=e.$elSearchInput.val(),e.DoHighlightText(e.searchTerm)}),this.$elSearchForm.submit(function(t){t.preventDefault();var o=e.$elTreeSearch.jstree(!0),n=$(t.target).find('input[type="text"]').first(),r=n.val();if(e.$elSearchInfo.hide(),o.delete_node(e.$elTreeSearch.find("li").toArray()),r.length<3)e.$elSearchInfo.html(e._("Search term too short")+". "+e._("Please enter 3 or more characters")+"."),e.$elSearchInfo.show();else if(window.bSearchDataLoaded)if(oWl){e.searchEngine.ParseInput(r);var i=e.searchEngine.PerformSearch(oWl);if(0==i.length)e.$elSearchInfo.html(e._("No results")+". "+e._("Please enter 3 or more characters")+"."),e.$elSearchInfo.show();else for(var a="",l=0;l'+c[d].title+"";h+="",e.$elModal.find(".modal-body").html(h),e.$elModal.modal("show")}else $("body").removeClass("sm-nav-expanded"),e.DoHandleLink(a,l,i,s,!1)}}).on("ready.jstree",function(t,n){e.SelectTopicInToc("","",!0);var r=parseInt($(o).data("openlvl"),10);r&&e.OpenTreeToLevel($(o),r)}).jstree({core:{animation:e.options.animationDelay,check_callback:$(o).is($(e.options.elTreeSearch)),multiple:!1,strings:{"Loading ...":e._("Loading...")},themes:{dots:!1,responsive:!0},data:r,error:function(t){e.doOnJsTreeError($(o),t)}},types:{default:{icon:"icon-default"}},plugins:["types"]})})},e.prototype.InitHistory=function(){var e=this;window.onpopstate=function(t){e.$elTopicContainer.load(window.location+" "+e.options.elTopicContent,function(t,o,n){e.SelectTopicInToc("","",!1),e.DoScrollToAnchorIfNeeded()})}},e.prototype.InitLinks=function(){var e=this,t=function(t){t.preventDefault();var o=t.currentTarget;e.$elModal&&e.$elModal.modal("hide"),$("body").removeClass("sm-nav-expanded"),e.DoHandleLink("","",o.href,o.target,t.ctrlKey===!0)};this.$elTopicContainer.on("click","a",t),$(".modal-body").on("click","a",t)},e.prototype.Init=function(){if(this.$elTopicContainer=$(this.options.elTopicContainer),!this.$elTopicContainer)throw new EInvalidHtmlElement("Invalid topic container element ["+this.options.elTopicContainer+"]")},e.prototype.Boot=function(){try{this.InitTrees(),this.InitLinks(),this.InitHistory(),this.InitToggler(),this.InitMask(),this.InitModal(),this.InitSearchEngine(),this.InitSearchForm(),this.InitHeadRoom(),this.doOnTopicChanged(),this.doProcessParameters()}catch(e){console.error("[HND-APP] An error occurred while booting the application =>",e.toString())}},e.prototype.OpenTreeToLevel=function(e,t){try{if(t){var o=$(e).jstree(!0);o&&$(o.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,n){var r=o.get_node(this.id);r.parents.length<=t&&o.open_node(r)})}}catch(e){console.error("[HND-APP] An error occurred while opening the tree =>",e.toString())}},e.prototype.SelectTopicInToc=function(e,t,o){void 0===o&&(o=!1),"string"==typeof e&&""!==e||(e=$(this.options.elTopicContent).data("hnd-id")),"string"==typeof t&&""!==t||(t=$(this.options.elTopicContent).data("hnd-title")),"string"==typeof e&&""!==e&&(this.$elTreeContainers.jstree("deselect_all",!0),this.$elTreeContainers.jstree("select_node",e,!0,!1),t&&""!==t&&(document.title=t),o&&setTimeout(function(){var t=document.getElementById(e+"_anchor");t&&t.scrollIntoView()},this.options.animationDelay+50))},e}();e.App=n}(Hnd||(Hnd={}));