doc/api/python/epydoc.js
author Brendan Donegan brendand@symbian.org
Tue, 29 Sep 2009 13:52:26 +0100
changeset 536 ffddef07ae2e
parent 432 f2ddfa555b0f
permissions -rw-r--r--
fixed STAF_security
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
432
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
     1
function toggle_private() {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
     2
        // Search for any private/public links on this page.  Store
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
     3
        // their old text in "cmd," so we will know what action to
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
     4
        // take; and change their text to the opposite action.
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
     5
        var cmd = "?";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
     6
        var elts = document.getElementsByTagName("a");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
     7
        for(var i=0; i<elts.length; i++) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
     8
          if (elts[i].className == "privatelink") {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
     9
            cmd = elts[i].innerHTML;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    10
            elts[i].innerHTML = ((cmd && cmd.substr(0,4)=="show")?
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    11
                                    "hide&nbsp;private":"show&nbsp;private");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    12
          }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    13
        }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    14
        // Update all DIVs containing private objects.
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    15
        var elts = document.getElementsByTagName("div");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    16
        for(var i=0; i<elts.length; i++) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    17
          if (elts[i].className == "private") {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    18
            elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"none":"block");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    19
          }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    20
        }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    21
        // Update all table rowss containing private objects.  Note, we
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    22
        // use "" instead of "block" becaue IE & firefox disagree on what
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    23
        // this should be (block vs table-row), and "" just gives the
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    24
        // default for both browsers.
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    25
        var elts = document.getElementsByTagName("tr");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    26
        for(var i=0; i<elts.length; i++) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    27
          if (elts[i].className == "private") {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    28
            elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"none":"");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    29
          }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    30
        }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    31
        // Update all list items containing private objects.
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    32
        var elts = document.getElementsByTagName("li");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    33
        for(var i=0; i<elts.length; i++) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    34
          if (elts[i].className == "private") {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    35
            elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    36
                                        "none":"list-item");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    37
          }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    38
        }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    39
        // Update all list items containing private objects.
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    40
        var elts = document.getElementsByTagName("ul");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    41
        for(var i=0; i<elts.length; i++) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    42
          if (elts[i].className == "private") {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    43
            elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"none":"block");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    44
          }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    45
        }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    46
        // Set a cookie to remember the current option.
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    47
        document.cookie = "EpydocPrivate="+cmd;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    48
      }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    49
function getCookie(name) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    50
        var dc = document.cookie;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    51
        var prefix = name + "=";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    52
        var begin = dc.indexOf("; " + prefix);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    53
        if (begin == -1) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    54
          begin = dc.indexOf(prefix);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    55
          if (begin != 0) return null;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    56
        } else
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    57
        { begin += 2; }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    58
        var end = document.cookie.indexOf(";", begin);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    59
        if (end == -1)
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    60
        { end = dc.length; }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    61
        return unescape(dc.substring(begin + prefix.length, end));
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    62
      }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    63
function setFrame(url1, url2) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    64
          parent.frames[1].location.href = url1;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    65
          parent.frames[2].location.href = url2;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    66
      }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    67
function checkCookie() {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    68
        var cmd=getCookie("EpydocPrivate");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    69
        if (cmd && cmd.substr(0,4)!="show" && location.href.indexOf("#_") < 0)
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    70
            toggle_private();
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    71
      }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    72
function toggleCallGraph(id) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    73
        var elt = document.getElementById(id);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    74
        if (elt.style.display == "none")
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    75
            elt.style.display = "block";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    76
        else
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    77
            elt.style.display = "none";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    78
      }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    79
function expand(id) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    80
  var elt = document.getElementById(id+"-expanded");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    81
  if (elt) elt.style.display = "block";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    82
  var elt = document.getElementById(id+"-expanded-linenums");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    83
  if (elt) elt.style.display = "block";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    84
  var elt = document.getElementById(id+"-collapsed");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    85
  if (elt) { elt.innerHTML = ""; elt.style.display = "none"; }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    86
  var elt = document.getElementById(id+"-collapsed-linenums");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    87
  if (elt) { elt.innerHTML = ""; elt.style.display = "none"; }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    88
  var elt = document.getElementById(id+"-toggle");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    89
  if (elt) { elt.innerHTML = "-"; }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    90
}
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    91
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    92
function collapse(id) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    93
  var elt = document.getElementById(id+"-expanded");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    94
  if (elt) elt.style.display = "none";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    95
  var elt = document.getElementById(id+"-expanded-linenums");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    96
  if (elt) elt.style.display = "none";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    97
  var elt = document.getElementById(id+"-collapsed-linenums");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    98
  if (elt) { elt.innerHTML = "<br/>"; elt.style.display="block"; }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
    99
  var elt = document.getElementById(id+"-toggle");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   100
  if (elt) { elt.innerHTML = "+"; }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   101
  var elt = document.getElementById(id+"-collapsed");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   102
  if (elt) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   103
    elt.style.display = "block";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   104
    
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   105
    var indent = elt.getAttribute("indent");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   106
    var pad = elt.getAttribute("pad");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   107
    var s = "<tt class='py-lineno'>";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   108
    for (var i=0; i<pad.length; i++) { s += "&nbsp;" }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   109
    s += "</tt>";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   110
    s += "&nbsp;&nbsp;<tt class='py-line'>";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   111
    for (var i=0; i<indent.length; i++) { s += "&nbsp;" }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   112
    s += "<a href='#' onclick='expand(\"" + id;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   113
    s += "\");return false'>...</a></tt><br />";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   114
    elt.innerHTML = s;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   115
  }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   116
}
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   117
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   118
function toggle(id) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   119
  elt = document.getElementById(id+"-toggle");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   120
  if (elt.innerHTML == "-")
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   121
      collapse(id); 
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   122
  else
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   123
      expand(id);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   124
  return false;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   125
}
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   126
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   127
function highlight(id) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   128
  var elt = document.getElementById(id+"-def");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   129
  if (elt) elt.className = "py-highlight-hdr";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   130
  var elt = document.getElementById(id+"-expanded");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   131
  if (elt) elt.className = "py-highlight";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   132
  var elt = document.getElementById(id+"-collapsed");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   133
  if (elt) elt.className = "py-highlight";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   134
}
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   135
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   136
function num_lines(s) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   137
  var n = 1;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   138
  var pos = s.indexOf("\n");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   139
  while ( pos > 0) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   140
    n += 1;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   141
    pos = s.indexOf("\n", pos+1);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   142
  }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   143
  return n;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   144
}
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   145
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   146
// Collapse all blocks that mave more than `min_lines` lines.
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   147
function collapse_all(min_lines) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   148
  var elts = document.getElementsByTagName("div");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   149
  for (var i=0; i<elts.length; i++) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   150
    var elt = elts[i];
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   151
    var split = elt.id.indexOf("-");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   152
    if (split > 0)
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   153
      if (elt.id.substring(split, elt.id.length) == "-expanded")
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   154
        if (num_lines(elt.innerHTML) > min_lines)
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   155
          collapse(elt.id.substring(0, split));
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   156
  }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   157
}
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   158
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   159
function expandto(href) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   160
  var start = href.indexOf("#")+1;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   161
  if (start != 0 && start != href.length) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   162
    if (href.substring(start, href.length) != "-") {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   163
      collapse_all(4);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   164
      pos = href.indexOf(".", start);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   165
      while (pos != -1) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   166
        var id = href.substring(start, pos);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   167
        expand(id);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   168
        pos = href.indexOf(".", pos+1);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   169
      }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   170
      var id = href.substring(start, href.length);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   171
      expand(id);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   172
      highlight(id);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   173
    }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   174
  }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   175
}
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   176
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   177
function kill_doclink(id) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   178
  var parent = document.getElementById(id);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   179
  parent.removeChild(parent.childNodes.item(0));
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   180
}
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   181
function auto_kill_doclink(ev) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   182
  if (!ev) var ev = window.event;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   183
  if (!this.contains(ev.toElement)) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   184
    var parent = document.getElementById(this.parentID);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   185
    parent.removeChild(parent.childNodes.item(0));
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   186
  }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   187
}
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   188
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   189
function doclink(id, name, targets_id) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   190
  var elt = document.getElementById(id);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   191
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   192
  // If we already opened the box, then destroy it.
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   193
  // (This case should never occur, but leave it in just in case.)
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   194
  if (elt.childNodes.length > 1) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   195
    elt.removeChild(elt.childNodes.item(0));
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   196
  }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   197
  else {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   198
    // The outer box: relative + inline positioning.
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   199
    var box1 = document.createElement("div");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   200
    box1.style.position = "relative";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   201
    box1.style.display = "inline";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   202
    box1.style.top = 0;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   203
    box1.style.left = 0;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   204
  
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   205
    // A shadow for fun
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   206
    var shadow = document.createElement("div");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   207
    shadow.style.position = "absolute";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   208
    shadow.style.left = "-1.3em";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   209
    shadow.style.top = "-1.3em";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   210
    shadow.style.background = "#404040";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   211
    
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   212
    // The inner box: absolute positioning.
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   213
    var box2 = document.createElement("div");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   214
    box2.style.position = "relative";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   215
    box2.style.border = "1px solid #a0a0a0";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   216
    box2.style.left = "-.2em";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   217
    box2.style.top = "-.2em";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   218
    box2.style.background = "white";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   219
    box2.style.padding = ".3em .4em .3em .4em";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   220
    box2.style.fontStyle = "normal";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   221
    box2.onmouseout=auto_kill_doclink;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   222
    box2.parentID = id;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   223
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   224
    // Get the targets
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   225
    var targets_elt = document.getElementById(targets_id);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   226
    var targets = targets_elt.getAttribute("targets");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   227
    var links = "";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   228
    target_list = targets.split(",");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   229
    for (var i=0; i<target_list.length; i++) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   230
        var target = target_list[i].split("=");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   231
        links += "<li><a href='" + target[1] + 
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   232
               "' style='text-decoration:none'>" +
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   233
               target[0] + "</a></li>";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   234
    }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   235
  
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   236
    // Put it all together.
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   237
    elt.insertBefore(box1, elt.childNodes.item(0));
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   238
    //box1.appendChild(box2);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   239
    box1.appendChild(shadow);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   240
    shadow.appendChild(box2);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   241
    box2.innerHTML =
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   242
        "Which <b>"+name+"</b> do you want to see documentation for?" +
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   243
        "<ul style='margin-bottom: 0;'>" +
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   244
        links + 
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   245
        "<li><a href='#' style='text-decoration:none' " +
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   246
        "onclick='kill_doclink(\""+id+"\");return false;'>"+
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   247
        "<i>None of the above</i></a></li></ul>";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   248
  }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   249
  return false;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   250
}
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   251
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   252
function get_anchor() {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   253
          var href = location.href;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   254
          var start = href.indexOf("#")+1;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   255
          if ((start != 0) && (start != href.length))
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   256
              return href.substring(start, href.length);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   257
      }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   258
function redirect_url(dottedName) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   259
          // Scan through each element of the "pages" list, and check
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   260
          // if "name" matches with any of them.
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   261
          for (var i=0; i<pages.length; i++) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   262
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   263
              // Each page has the form "<pagename>-m" or "<pagename>-c";
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   264
              // extract the <pagename> portion & compare it to dottedName.
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   265
              var pagename = pages[i].substring(0, pages[i].length-2);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   266
              if (pagename == dottedName.substring(0,pagename.length)) {
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   267
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   268
                  // We've found a page that matches `dottedName`;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   269
                  // construct its URL, using leftover `dottedName`
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   270
                  // content to form an anchor.
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   271
                  var pagetype = pages[i].charAt(pages[i].length-1);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   272
                  var url = pagename + ((pagetype=="m")?"-module.html":
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   273
                                                        "-class.html");
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   274
                  if (dottedName.length > pagename.length)
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   275
                      url += "#" + dottedName.substring(pagename.length+1,
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   276
                                                        dottedName.length);
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   277
                  return url;
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   278
              }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   279
          }
f2ddfa555b0f Add FBF documents for default config that built PDK 2.0.e
Shabe Razvi <shaber@symbian.org>
parents:
diff changeset
   280
      }