formatter.js
Go to the documentation of this file.
1 /* Formatter: Adds dynamicly needed things for styling purposes in manual */
2 
3 if (document.getElementsByClassName("header").length)
4  for each (var n in document.getElementsByClassName("header")[0].childNodes){
5  if (n.nodeName && n.nodeName.toLowerCase() == "h1"){
6  var d = n.parentNode.insertBefore(document.createElement("div"), n);
7  d.className = "js";
8  n.className = "js";
9  d.appendChild(n);
10  var n1 = n.cloneNode(true);
11  n1.className = "js outline";
12  d.appendChild(n1);
13  var n2 = n.cloneNode(true);
14  n2.className = "js filling";
15  d.appendChild(n2);
16  break;
17  }
18  }
19 
20 for each (var n in document.getElementsByTagName("a")){
21  if (n.href && (n.href.indexOf("http://") != -1))
22  n.target = "_blank";
23 }
24 
25 for each (var r in document.getElementsByClassName("imagerow")){
26  if (r.childNodes) for each (var n in r.childNodes){
27  if (n.nodeName && n.nodeName.toLowerCase() == "img"){
28  var img = new Image();
29  img.src = n.src;
30  var size = {
31  width: img.width,
32  height: img.height,
33  };
34  var MAX_IMAGE_HEIGHT = 300;
35  if (size.height > MAX_IMAGE_HEIGHT){
36  var f = size.height / MAX_IMAGE_HEIGHT;
37  size.height = size.height / f;
38  size.width = size.width / f;
39  }
40  var style = "min-width: " + (img.width/2) + "px;max-width: " + (size.width) + "px;";
41  n.setAttribute("style", style);
42 
43  if ((img.width <= 260) && (img.height <= MAX_IMAGE_HEIGHT))
44  continue;
45 
46  n.style.cursor = "pointer";
47  n.cstyle = style;
48  n.ostyle = "max-width: " + (img.width) + "px;width:100%;";
49  n.collapsed = true;
50  n.onclick = function(e){
51  if (!e.target.collapsed){
52  e.target.setAttribute("style", e.target.cstyle);
53  e.target.collapsed = true;
54  for each (var i in e.target.parentNode.childNodes){
55  if (i.nodeName && (i.nodeName.toLowerCase() == "img"))
56  i.style.display = "";
57  }
58 
59  } else {
60  e.target.setAttribute("style", e.target.ostyle);
61  e.target.collapsed = false;
62  for each (var i in e.target.parentNode.childNodes){
63  if (i.nodeName && (i.nodeName.toLowerCase() == "img") && (i!=e.target))
64  i.style.display = "none";
65  }
66  }
67  e.target.style.cursor = "pointer";
68  }
69  }
70  }
71 }
function width(ele) rect(ele).width
function d(s)
_updateDatepicker height
Element Properties style
_getSelectedPageStyle s i