2021-08-05 03:02:30 +02:00
|
|
|
/*
|
|
|
|
@licstart The following is the entire license notice for the JavaScript code in this file.
|
|
|
|
|
|
|
|
The MIT License (MIT)
|
|
|
|
|
|
|
|
Copyright (C) 1997-2020 by Dimitri van Heesch
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
|
|
and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
|
|
including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
|
|
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in all copies or
|
|
|
|
substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
|
|
|
|
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
|
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
@licend The above is the entire license notice for the JavaScript code in this file
|
|
|
|
*/
|
2024-12-15 01:45:58 +01:00
|
|
|
var once=1;
|
2021-08-05 03:02:30 +02:00
|
|
|
function initResizable()
|
|
|
|
{
|
|
|
|
var cookie_namespace = 'doxygen';
|
2024-12-15 01:45:58 +01:00
|
|
|
var sidenav,navtree,content,header,barWidth=6,desktop_vp=768,titleHeight;
|
2021-08-05 03:02:30 +02:00
|
|
|
|
2024-12-15 01:45:58 +01:00
|
|
|
function readSetting(cookie)
|
2021-08-05 03:02:30 +02:00
|
|
|
{
|
2024-12-15 01:45:58 +01:00
|
|
|
if (window.chrome) {
|
|
|
|
var val = localStorage.getItem(cookie_namespace+'_width');
|
|
|
|
if (val) return val;
|
|
|
|
} else {
|
|
|
|
var myCookie = cookie_namespace+"_"+cookie+"=";
|
|
|
|
if (document.cookie) {
|
|
|
|
var index = document.cookie.indexOf(myCookie);
|
|
|
|
if (index != -1) {
|
|
|
|
var valStart = index + myCookie.length;
|
|
|
|
var valEnd = document.cookie.indexOf(";", valStart);
|
|
|
|
if (valEnd == -1) {
|
|
|
|
valEnd = document.cookie.length;
|
|
|
|
}
|
|
|
|
var val = document.cookie.substring(valStart, valEnd);
|
|
|
|
return val;
|
2021-08-05 03:02:30 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-12-15 01:45:58 +01:00
|
|
|
return 250;
|
2021-08-05 03:02:30 +02:00
|
|
|
}
|
|
|
|
|
2024-12-15 01:45:58 +01:00
|
|
|
function writeSetting(cookie, val)
|
2021-08-05 03:02:30 +02:00
|
|
|
{
|
2024-12-15 01:45:58 +01:00
|
|
|
if (window.chrome) {
|
|
|
|
localStorage.setItem(cookie_namespace+"_width",val);
|
|
|
|
} else {
|
2021-08-05 03:02:30 +02:00
|
|
|
var date = new Date();
|
|
|
|
date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week
|
|
|
|
expiration = date.toGMTString();
|
2024-12-15 01:45:58 +01:00
|
|
|
document.cookie = cookie_namespace + "_" + cookie + "=" + val + "; SameSite=Lax; expires=" + expiration+"; path=/";
|
2021-08-05 03:02:30 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function resizeWidth()
|
|
|
|
{
|
|
|
|
var windowWidth = $(window).width() + "px";
|
|
|
|
var sidenavWidth = $(sidenav).outerWidth();
|
|
|
|
content.css({marginLeft:parseInt(sidenavWidth)+"px"});
|
2024-12-15 01:45:58 +01:00
|
|
|
if (typeof page_layout!=='undefined' && page_layout==1) {
|
|
|
|
footer.css({marginLeft:parseInt(sidenavWidth)+"px"});
|
|
|
|
}
|
|
|
|
writeSetting('width',sidenavWidth-barWidth);
|
2021-08-05 03:02:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function restoreWidth(navWidth)
|
|
|
|
{
|
|
|
|
var windowWidth = $(window).width() + "px";
|
|
|
|
content.css({marginLeft:parseInt(navWidth)+barWidth+"px"});
|
2024-12-15 01:45:58 +01:00
|
|
|
if (typeof page_layout!=='undefined' && page_layout==1) {
|
|
|
|
footer.css({marginLeft:parseInt(navWidth)+barWidth+"px"});
|
|
|
|
}
|
2021-08-05 03:02:30 +02:00
|
|
|
sidenav.css({width:navWidth + "px"});
|
|
|
|
}
|
|
|
|
|
|
|
|
function resizeHeight()
|
|
|
|
{
|
|
|
|
var headerHeight = header.outerHeight();
|
|
|
|
var footerHeight = footer.outerHeight();
|
2024-12-15 01:45:58 +01:00
|
|
|
var windowHeight = $(window).height();
|
|
|
|
var contentHeight,navtreeHeight,sideNavHeight;
|
|
|
|
if (typeof page_layout==='undefined' || page_layout==0) { /* DISABLE_INDEX=NO */
|
|
|
|
contentHeight = windowHeight - headerHeight - footerHeight;
|
|
|
|
navtreeHeight = contentHeight;
|
|
|
|
sideNavHeight = contentHeight;
|
|
|
|
} else if (page_layout==1) { /* DISABLE_INDEX=YES */
|
|
|
|
contentHeight = windowHeight - footerHeight;
|
|
|
|
navtreeHeight = windowHeight - headerHeight;
|
|
|
|
sideNavHeight = windowHeight;
|
2021-08-05 03:02:30 +02:00
|
|
|
}
|
2024-12-15 01:45:58 +01:00
|
|
|
content.css({height:contentHeight + "px"});
|
|
|
|
navtree.css({height:navtreeHeight + "px"});
|
|
|
|
sidenav.css({height:sideNavHeight + "px"});
|
2021-08-05 03:02:30 +02:00
|
|
|
if (location.hash.slice(1)) {
|
|
|
|
(document.getElementById(location.hash.slice(1))||document.body).scrollIntoView();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function collapseExpand()
|
|
|
|
{
|
2024-12-15 01:45:58 +01:00
|
|
|
var newWidth;
|
2021-08-05 03:02:30 +02:00
|
|
|
if (sidenav.width()>0) {
|
2024-12-15 01:45:58 +01:00
|
|
|
newWidth=0;
|
2021-08-05 03:02:30 +02:00
|
|
|
}
|
|
|
|
else {
|
2024-12-15 01:45:58 +01:00
|
|
|
var width = readSetting('width');
|
|
|
|
newWidth = (width>250 && width<$(window).width()) ? width : 250;
|
2021-08-05 03:02:30 +02:00
|
|
|
}
|
2024-12-15 01:45:58 +01:00
|
|
|
restoreWidth(newWidth);
|
|
|
|
var sidenavWidth = $(sidenav).outerWidth();
|
|
|
|
writeSetting('width',sidenavWidth-barWidth);
|
2021-08-05 03:02:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
header = $("#top");
|
|
|
|
sidenav = $("#side-nav");
|
|
|
|
content = $("#doc-content");
|
|
|
|
navtree = $("#nav-tree");
|
|
|
|
footer = $("#nav-path");
|
|
|
|
$(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } });
|
|
|
|
$(sidenav).resizable({ minWidth: 0 });
|
|
|
|
$(window).resize(function() { resizeHeight(); });
|
|
|
|
var device = navigator.userAgent.toLowerCase();
|
|
|
|
var touch_device = device.match(/(iphone|ipod|ipad|android)/);
|
|
|
|
if (touch_device) { /* wider split bar for touch only devices */
|
|
|
|
$(sidenav).css({ paddingRight:'20px' });
|
|
|
|
$('.ui-resizable-e').css({ width:'20px' });
|
|
|
|
$('#nav-sync').css({ right:'34px' });
|
|
|
|
barWidth=20;
|
|
|
|
}
|
2024-12-15 01:45:58 +01:00
|
|
|
var width = readSetting('width');
|
2021-08-05 03:02:30 +02:00
|
|
|
if (width) { restoreWidth(width); } else { resizeWidth(); }
|
|
|
|
resizeHeight();
|
|
|
|
var url = location.href;
|
|
|
|
var i=url.indexOf("#");
|
|
|
|
if (i>=0) window.location.hash=url.substr(i);
|
|
|
|
var _preventDefault = function(evt) { evt.preventDefault(); };
|
|
|
|
$("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault);
|
2024-12-15 01:45:58 +01:00
|
|
|
if (once) {
|
|
|
|
$(".ui-resizable-handle").dblclick(collapseExpand);
|
|
|
|
once=0
|
|
|
|
}
|
2021-08-05 03:02:30 +02:00
|
|
|
$(window).on('load',resizeHeight);
|
|
|
|
}
|
|
|
|
/* @license-end */
|