/* This file is part of Natural Docs, which is Copyright © 2003-2022 Code Clear LLC. Natural Docs is licensed under version 3 of the GNU Affero General Public License (AGPL). Refer to License.txt or www.naturaldocs.org for the complete details. This file may be distributed with documentation files generated by Natural Docs. Such documentation is not covered by Natural Docs' copyright and licensing, and may have its own copyright and distribution terms as decided by its author. */ "use strict";var NDSummary=new function(){this.Start=function(){this.toolTipHolder=document.createElement("div");this.toolTipHolder.style.display="none";this.toolTipHolder.style.position="fixed";this.toolTipHolder.style.zIndex=21;document.body.appendChild(this.toolTipHolder);};this.OnLocationChange=function(oldLocation,newLocation){this.ResetToolTip();if(oldLocation==undefined||oldLocation.type!=newLocation.type||oldLocation.path!=newLocation.path){this.summaryLanguages=undefined;this.summaryCommentTypes=undefined;this.summaryEntries=undefined;this.summaryToolTips=undefined;if(oldLocation==undefined){this.Build();}else if(this.delayedLoadingTimeout==undefined){this.delayedLoadingTimeout=setTimeout(function(){if(NDSummary.summaryLanguages==undefined){NDSummary.Build();}clearTimeout(NDSummary.delayedLoadingTimout);NDSummary.delayedLoadingTimeout=undefined;},250);}var head=document.getElementsByTagName("head")[0];var loader=document.getElementById("NDSummaryLoader");if(loader){head.removeChild(loader);}loader=document.getElementById("NDSummaryToolTipsLoader");if(loader){head.removeChild(loader);}if(newLocation.summaryFile){NDCore.LoadJavaScript(newLocation.summaryFile,"NDSummaryLoader");}}this.FinishNavigation();};this.OnSummaryLoaded=function(hashPath,summaryLanguages,summaryCommentTypes,summaryEntries){if(hashPath==NDFramePage.currentLocation.path){this.summaryLanguages=summaryLanguages;this.summaryCommentTypes=summaryCommentTypes;this.summaryEntries=summaryEntries;this.Build();this.FinishNavigation();NDCore.LoadJavaScript(NDFramePage.currentLocation.summaryTTFile,"NDSummaryToolTipsLoader");}};this.OnToolTipsLoaded=function(hashPath,summaryToolTips){if(hashPath==NDFramePage.currentLocation.path){this.summaryToolTips=summaryToolTips;if(this.showingToolTip!=undefined&&summaryToolTips[this.showingToolTip]!=undefined){this.ShowToolTip();}}};this.Build=function(){var newContent=document.createElement("div");newContent.id="SuContent";if(this.summaryEntries==undefined){var loadingNotice=document.createElement("div");loadingNotice.className="SuLoadingNotice";newContent.appendChild(loadingNotice);}else{var mouseOverHandler=function(e){NDSummary.OnEntryMouseOver(e);};var mouseOutHandler=function(e){NDSummary.OnEntryMouseOut(e);};for(var i=0;i"+entry[3];entryHTML.onmouseover=mouseOverHandler;entryHTML.onmouseout=mouseOutHandler;var entryHTMLChild=entryHTML.firstChild;if(entryHTMLChild!=undefined&&NDCore.HasClass(entryHTMLChild,"Qualifier")){entryHTMLChild.onmouseover=mouseOverHandler;entryHTMLChild.onmouseout=mouseOutHandler;}newContent.appendChild(entryHTML);}}}var summaryContainer=document.getElementById("NDSummary");var oldContent=document.getElementById("SuContent");if(oldContent!=undefined){summaryContainer.replaceChild(newContent,oldContent);}else{summaryContainer.appendChild(newContent);}newContent.scrollIntoView(true);if(this.summaryEntries!=undefined){NDFramePage.SizeSummaryToContent();}};this.FinishNavigation=function(){if(NDCore.CaseInsensitiveAnchors()&&this.summaryEntries!=undefined&&NDFramePage.currentLocation!=undefined&&NDFramePage.currentLocation.member!=undefined){var topicID=-1;for(var i=0;i0){return id;}else{return-1;}};this.ShowToolTip=function(){var entry=document.getElementById("SuEntry"+this.showingToolTip);this.toolTipHolder.innerHTML=this.summaryToolTips[this.showingToolTip];this.toolTipHolder.style.visibility="hidden";this.toolTipHolder.style.display="block";var summaryBlock=document.getElementById("NDSummary");var x=summaryBlock.offsetLeft+entry.offsetLeft+entry.offsetWidth;var y=summaryBlock.offsetTop+entry.offsetTop-summaryBlock.scrollTop;var newWidth=undefined;var maxWidth=window.innerWidth-x-5;if(this.toolTipHolder.offsetWidth>maxWidth){newWidth=maxWidth;}this.toolTipHolder.style.left=x+"px";this.toolTipHolder.style.top=y+"px";if(newWidth!=undefined){this.toolTipHolder.style.width=newWidth+"px";}var prototypes=this.toolTipHolder.getElementsByClassName("NDPrototype");if(prototypes.length>0&&NDCore.HasClass(prototypes[0],"WideForm")&&prototypes[0].scrollWidth>prototypes[0].offsetWidth){NDCore.ChangePrototypeToNarrowForm(prototypes[0]);}if(y+this.toolTipHolder.offsetHeight+25>window.innerHeight){var newY=window.innerHeight-this.toolTipHolder.offsetHeight-25;if(newY<0){newY=0;}this.toolTipHolder.style.top=newY+"px";}this.toolTipHolder.style.visibility="visible";};this.ResetToolTip=function(){if(this.showingToolTip!=undefined){this.toolTipHolder.style.display="none";this.toolTipHolder.style.width=null;this.lastToolTip=this.showingToolTip;this.showingToolTip=undefined;}if(this.toolTipTimeout!=undefined){clearTimeout(this.toolTipTimeout);this.toolTipTimeout=undefined;}};};