2 @licstart The following is the entire license notice for the
3 JavaScript code in this file.
5 Copyright (C) 1997-2017 by Dimitri van Heesch
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 @licend The above is the entire license notice
22 for the JavaScript code in this file
24 function initResizable()
26 var cookie_namespace = 'doxygen';
27 var sidenav,navtree,content,header,collapsed,collapsedWidth=0,barWidth=6,desktop_vp=768,titleHeight;
29 function readCookie(cookie)
31 var myCookie = cookie_namespace+"_"+cookie+"=";
32 if (document.cookie) {
33 var index = document.cookie.indexOf(myCookie);
35 var valStart = index + myCookie.length;
36 var valEnd = document.cookie.indexOf(";", valStart);
38 valEnd = document.cookie.length;
40 var val = document.cookie.substring(valStart, valEnd);
47 function writeCookie(cookie, val, expiration)
49 if (val==undefined) return;
50 if (expiration == null) {
51 var date = new Date();
52 date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week
53 expiration = date.toGMTString();
55 document.cookie = cookie_namespace + "_" + cookie + "=" + val + "; expires=" + expiration+"; path=/";
58 function resizeWidth()
60 var windowWidth = $(window).width() + "px";
61 var sidenavWidth = $(sidenav).outerWidth();
62 content.css({marginLeft:parseInt(sidenavWidth)+"px"});
63 writeCookie('width',sidenavWidth-barWidth, null);
66 function restoreWidth(navWidth)
68 var windowWidth = $(window).width() + "px";
69 content.css({marginLeft:parseInt(navWidth)+barWidth+"px"});
70 sidenav.css({width:navWidth + "px"});
73 function resizeHeight()
75 var headerHeight = header.outerHeight();
76 var footerHeight = footer.outerHeight();
77 var windowHeight = $(window).height() - headerHeight - footerHeight;
78 content.css({height:windowHeight + "px"});
79 navtree.css({height:windowHeight + "px"});
80 sidenav.css({height:windowHeight + "px"});
81 var width=$(window).width();
82 if (width!=collapsedWidth) {
83 if (width<desktop_vp && collapsedWidth>=desktop_vp) {
87 } else if (width>desktop_vp && collapsedWidth<desktop_vp) {
94 (document.getElementById(location.hash.slice(1))||document.body).scrollIntoView();
97 function collapseExpand()
99 if (sidenav.width()>0) {
104 var width = readCookie('width');
105 if (width>200 && width<$(window).width()) { restoreWidth(width); } else { restoreWidth(200); }
111 sidenav = $("#side-nav");
112 content = $("#doc-content");
113 navtree = $("#nav-tree");
114 footer = $("#nav-path");
115 $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } });
116 $(sidenav).resizable({ minWidth: 0 });
117 $(window).resize(function() { resizeHeight(); });
118 var device = navigator.userAgent.toLowerCase();
119 var touch_device = device.match(/(iphone|ipod|ipad|android)/);
120 if (touch_device) { /* wider split bar for touch only devices */
121 $(sidenav).css({ paddingRight:'20px' });
122 $('.ui-resizable-e').css({ width:'20px' });
123 $('#nav-sync').css({ right:'34px' });
126 var width = readCookie('width');
127 if (width) { restoreWidth(width); } else { resizeWidth(); }
129 var url = location.href;
130 var i=url.indexOf("#");
131 if (i>=0) window.location.hash=url.substr(i);
132 var _preventDefault = function(evt) { evt.preventDefault(); };
133 $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault);
134 $(".ui-resizable-handle").dblclick(collapseExpand);
135 $(window).on('load',resizeHeight);