SZSPTP ez430-RF2480 1.0

ZigBee Sensor Network with synchronized time and time-stamped measurements.
resize.js
1 var cookie_namespace = 'doxygen';
2 var sidenav,navtree,content,header;
3 
4 function readCookie(cookie)
5 {
6  var myCookie = cookie_namespace+"_"+cookie+"=";
7  if (document.cookie)
8  {
9  var index = document.cookie.indexOf(myCookie);
10  if (index != -1)
11  {
12  var valStart = index + myCookie.length;
13  var valEnd = document.cookie.indexOf(";", valStart);
14  if (valEnd == -1)
15  {
16  valEnd = document.cookie.length;
17  }
18  var val = document.cookie.substring(valStart, valEnd);
19  return val;
20  }
21  }
22  return 0;
23 }
24 
25 function writeCookie(cookie, val, expiration)
26 {
27  if (val==undefined) return;
28  if (expiration == null)
29  {
30  var date = new Date();
31  date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week
32  expiration = date.toGMTString();
33  }
34  document.cookie = cookie_namespace + "_" + cookie + "=" + val + "; expires=" + expiration+"; path=/";
35 }
36 
37 function resizeWidth()
38 {
39  var windowWidth = $(window).width() + "px";
40  var sidenavWidth = $(sidenav).outerWidth();
41  content.css({marginLeft:parseInt(sidenavWidth)+"px"});
42  writeCookie('width',sidenavWidth, null);
43 }
44 
45 function restoreWidth(navWidth)
46 {
47  var windowWidth = $(window).width() + "px";
48  content.css({marginLeft:parseInt(navWidth)+6+"px"});
49  sidenav.css({width:navWidth + "px"});
50 }
51 
52 function resizeHeight()
53 {
54  var headerTop = header.position().top;
55  var headerHeight = header.outerHeight();
56  var footerTop = footer.position().top;
57  var windowHeight = $(window).height() - headerHeight - footerTop;
58  content.css({height:windowHeight + "px"});
59  navtree.css({height:windowHeight + "px"});
60  sidenav.css({height:windowHeight + "px",top: (headerTop+headerHeight)+"px"});
61 }
62 
63 function initResizable()
64 {
65  header = $("#top");
66  sidenav = $("#side-nav");
67  content = $("#doc-content");
68  navtree = $("#nav-tree");
69  footer = $("#main_nav");
70  $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } });
71  $(window).resize(function() { resizeHeight(); });
72  var width = readCookie('width');
73  if (width) { restoreWidth(width); } else { resizeWidth(); }
74  resizeHeight();
75  var url = location.href;
76  var i=url.indexOf("#");
77  if (i>=0) window.location.hash=url.substr(i);
78  var _preventDefault = function(evt) { evt.preventDefault(); };
79  $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault);
80  $(document).bind('touchmove',function(e){
81  var device = navigator.userAgent.toLowerCase();
82  var ios = device.match(/(iphone|ipod|ipad)/);
83  if (ios) {
84  try {
85  var target = e.target;
86  while (target) {
87  if ($(target).css('-webkit-overflow-scrolling')=='touch') return;
88  target = target.parentNode;
89  }
90  e.preventDefault();
91  } catch(err) {
92  e.preventDefault();
93  }
94  }
95  });
96 }
97 
98