2 @licstart The following is the entire license notice for the JavaScript code in this file.
6 Copyright (C) 1997-2020 by Dimitri van Heesch
8 Permission is hereby granted, free of charge, to any person obtaining a copy of this software
9 and associated documentation files (the "Software"), to deal in the Software without restriction,
10 including without limitation the rights to use, copy, modify, merge, publish, distribute,
11 sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
14 The above copyright notice and this permission notice shall be included in all copies or
15 substantial portions of the Software.
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
18 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 @licend The above is the entire license notice for the JavaScript code in this file
25 function initResizable()
27 var cookie_namespace = 'doxygen';
28 var sidenav,navtree,content,header,collapsed,collapsedWidth=0,barWidth=6,desktop_vp=768,titleHeight;
30 function readCookie(cookie)
32 var myCookie = cookie_namespace+"_"+cookie+"=";
33 if (document.cookie) {
34 var index = document.cookie.indexOf(myCookie);
36 var valStart = index + myCookie.length;
37 var valEnd = document.cookie.indexOf(";", valStart);
39 valEnd = document.cookie.length;
41 var val = document.cookie.substring(valStart, valEnd);
48 function writeCookie(cookie, val, expiration)
50 if (val==undefined) return;
51 if (expiration == null) {
52 var date = new Date();
53 date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week
54 expiration = date.toGMTString();
56 document.cookie = cookie_namespace + "_" + cookie + "=" + val + "; SameSite=Lax; expires=" + expiration+"; path=/";
59 function resizeWidth()
61 var windowWidth = $(window).width() + "px";
62 var sidenavWidth = $(sidenav).outerWidth();
63 content.css({marginLeft:parseInt(sidenavWidth)+"px"});
64 writeCookie('width',sidenavWidth-barWidth, null);
67 function restoreWidth(navWidth)
69 var windowWidth = $(window).width() + "px";
70 content.css({marginLeft:parseInt(navWidth)+barWidth+"px"});
71 sidenav.css({width:navWidth + "px"});
74 function resizeHeight()
76 var headerHeight = header.outerHeight();
77 var footerHeight = footer.outerHeight();
78 var windowHeight = $(window).height();
79 var contentHeight,navtreeHeight,sideNavHeight;
80 if (typeof page_layout==='undefined' || page_layout==0) { /* DISABLE_INDEX=NO */
81 contentHeight = windowHeight - headerHeight - footerHeight;
82 navtreeHeight = contentHeight;
83 sideNavHeight = contentHeight;
84 } else if (page_layout==1) { /* DISABLE_INDEX=YES */
85 contentHeight = windowHeight - footerHeight;
86 navtreeHeight = windowHeight - headerHeight;
87 sideNavHeight = windowHeight;
89 content.css({height:contentHeight + "px"});
90 navtree.css({height:navtreeHeight + "px"});
91 sidenav.css({height:sideNavHeight + "px"});
92 var width=$(window).width();
93 if (width!=collapsedWidth) {
94 if (width<desktop_vp && collapsedWidth>=desktop_vp) {
98 } else if (width>desktop_vp && collapsedWidth<desktop_vp) {
103 collapsedWidth=width;
105 if (location.hash.slice(1)) {
106 (document.getElementById(location.hash.slice(1))||document.body).scrollIntoView();
110 function collapseExpand()
112 if (sidenav.width()>0) {
117 var width = readCookie('width');
118 if (width>200 && width<$(window).width()) { restoreWidth(width); } else { restoreWidth(200); }
124 sidenav = $("#side-nav");
125 content = $("#doc-content");
126 navtree = $("#nav-tree");
127 footer = $("#nav-path");
128 $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } });
129 $(sidenav).resizable({ minWidth: 0 });
130 $(window).resize(function() { resizeHeight(); });
131 var device = navigator.userAgent.toLowerCase();
132 var touch_device = device.match(/(iphone|ipod|ipad|android)/);
133 if (touch_device) { /* wider split bar for touch only devices */
134 $(sidenav).css({ paddingRight:'20px' });
135 $('.ui-resizable-e').css({ width:'20px' });
136 $('#nav-sync').css({ right:'34px' });
139 var width = readCookie('width');
140 if (width) { restoreWidth(width); } else { resizeWidth(); }
142 var url = location.href;
143 var i=url.indexOf("#");
144 if (i>=0) window.location.hash=url.substr(i);
145 var _preventDefault = function(evt) { evt.preventDefault(); };
146 $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault);
147 $(".ui-resizable-handle").dblclick(collapseExpand);
148 $(window).on('load',resizeHeight);