aboutsummaryrefslogtreecommitdiffstats
path: root/doc/old/html/resize.js
diff options
context:
space:
mode:
authorroot <root@v22013111044215586.yourvserver.net>2014-06-29 18:32:40 +0200
committerroot <root@v22013111044215586.yourvserver.net>2014-06-29 18:32:40 +0200
commita47971aefd2bee45f4e57dd1fc3ea24bb370881f (patch)
tree957bd627cf9016cc826b5a5bbfb6001f4edc4830 /doc/old/html/resize.js
parent5df50c4a0bf80f3697c7088c9c4a3815206fe97d (diff)
downloadvolse-hubzilla-a47971aefd2bee45f4e57dd1fc3ea24bb370881f.tar.gz
volse-hubzilla-a47971aefd2bee45f4e57dd1fc3ea24bb370881f.tar.bz2
volse-hubzilla-a47971aefd2bee45f4e57dd1fc3ea24bb370881f.zip
Some doco work. Changed main.bb and added a return link to all .bb files and began planning new entries for user orientated documentation.
Diffstat (limited to 'doc/old/html/resize.js')
-rw-r--r--doc/old/html/resize.js93
1 files changed, 93 insertions, 0 deletions
diff --git a/doc/old/html/resize.js b/doc/old/html/resize.js
new file mode 100644
index 000000000..8365b253c
--- /dev/null
+++ b/doc/old/html/resize.js
@@ -0,0 +1,93 @@
+var cookie_namespace = 'doxygen';
+var sidenav,navtree,content,header;
+
+function readCookie(cookie)
+{
+ 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;
+ }
+ }
+ return 0;
+}
+
+function writeCookie(cookie, val, expiration)
+{
+ if (val==undefined) return;
+ if (expiration == null)
+ {
+ var date = new Date();
+ date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week
+ expiration = date.toGMTString();
+ }
+ document.cookie = cookie_namespace + "_" + cookie + "=" + val + "; expires=" + expiration+"; path=/";
+}
+
+function resizeWidth()
+{
+ var windowWidth = $(window).width() + "px";
+ var sidenavWidth = $(sidenav).outerWidth();
+ content.css({marginLeft:parseInt(sidenavWidth)+6+"px"}); //account for 6px-wide handle-bar
+ writeCookie('width',sidenavWidth, null);
+}
+
+function restoreWidth(navWidth)
+{
+ var windowWidth = $(window).width() + "px";
+ content.css({marginLeft:parseInt(navWidth)+6+"px"});
+ sidenav.css({width:navWidth + "px"});
+}
+
+function resizeHeight()
+{
+ var headerHeight = header.outerHeight();
+ var footerHeight = footer.outerHeight();
+ var windowHeight = $(window).height() - headerHeight - footerHeight;
+ content.css({height:windowHeight + "px"});
+ navtree.css({height:windowHeight + "px"});
+ sidenav.css({height:windowHeight + "px",top: headerHeight+"px"});
+}
+
+function initResizable()
+{
+ header = $("#top");
+ sidenav = $("#side-nav");
+ content = $("#doc-content");
+ navtree = $("#nav-tree");
+ footer = $("#nav-path");
+ $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } });
+ $(window).resize(function() { resizeHeight(); });
+ var width = readCookie('width');
+ 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);
+ $(document).bind('touchmove',function(e){
+ try {
+ var target = e.target;
+ while (target) {
+ if ($(target).css('-webkit-overflow-scrolling')=='touch') return;
+ target = target.parentNode;
+ }
+ e.preventDefault();
+ } catch(err) {
+ e.preventDefault();
+ }
+ });
+}
+
+