OpenCores
URL https://opencores.org/ocsvn/uart_block/uart_block/trunk

Subversion Repositories uart_block

[/] [uart_block/] [trunk/] [docs/] [doxygenDocs/] [html/] [navtree.js] - Blame information for rev 40

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 40 leonardoar
var NAVTREE =
2
[
3
  [ "Uart wishbone slave Documentation", "index.html", [
4
    [ "Packages", null, [
5
      [ "Packages", "namespaces.html", "namespaces" ]
6
    ] ],
7
    [ "Design Unit List", null, [
8
      [ "Design Unit List", "annotated.html", "annotated" ],
9
      [ "Design Units", "classes.html", null ],
10
      [ "Design Unit Hierarchy", "hierarchy.html", "hierarchy" ],
11
      [ "Design Unit Members", "functions.html", [
12
        [ "All", "functions.html", null ],
13
        [ "Variables", "functions_vars.html", null ]
14
      ] ]
15
    ] ],
16
    [ "Files", null, [
17
      [ "File List", "files.html", "files" ]
18
    ] ]
19
  ] ]
20
];
21
 
22
function getData(varName)
23
{
24
  var i = varName.lastIndexOf('/');
25
  var n = i>=0 ? varName.substring(i+1) : varName;
26
  return eval(n);
27
}
28
 
29
function stripPath(uri)
30
{
31
  return uri.substring(uri.lastIndexOf('/')+1);
32
}
33
 
34
function getScript(scriptName,func,show)
35
{
36
  var head = document.getElementsByTagName("head")[0];
37
  var script = document.createElement('script');
38
  script.id = scriptName;
39
  script.type = 'text/javascript';
40
  script.onload = func;
41
  script.src = scriptName+'.js';
42
  script.onreadystatechange = function() {
43
    if (script.readyState=='complete' || script.readyState=='loaded') {
44
      func(); if (show) showRoot();
45
    }
46
  };
47
  head.appendChild(script);
48
}
49
 
50
function createIndent(o,domNode,node,level)
51
{
52
  if (node.parentNode && node.parentNode.parentNode) {
53
    createIndent(o,domNode,node.parentNode,level+1);
54
  }
55
  var imgNode = document.createElement("img");
56
  imgNode.width = 16;
57
  imgNode.height = 22;
58
  if (level==0 && node.childrenData) {
59
    node.plus_img = imgNode;
60
    node.expandToggle = document.createElement("a");
61
    node.expandToggle.href = "javascript:void(0)";
62
    node.expandToggle.onclick = function() {
63
      if (node.expanded) {
64
        $(node.getChildrenUL()).slideUp("fast");
65
        if (node.isLast) {
66
          node.plus_img.src = node.relpath+"ftv2plastnode.png";
67
        } else {
68
          node.plus_img.src = node.relpath+"ftv2pnode.png";
69
        }
70
        node.expanded = false;
71
      } else {
72
        expandNode(o, node, false, false);
73
      }
74
    }
75
    node.expandToggle.appendChild(imgNode);
76
    domNode.appendChild(node.expandToggle);
77
  } else {
78
    domNode.appendChild(imgNode);
79
  }
80
  if (level==0) {
81
    if (node.isLast) {
82
      if (node.childrenData) {
83
        imgNode.src = node.relpath+"ftv2plastnode.png";
84
      } else {
85
        imgNode.src = node.relpath+"ftv2lastnode.png";
86
        domNode.appendChild(imgNode);
87
      }
88
    } else {
89
      if (node.childrenData) {
90
        imgNode.src = node.relpath+"ftv2pnode.png";
91
      } else {
92
        imgNode.src = node.relpath+"ftv2node.png";
93
        domNode.appendChild(imgNode);
94
      }
95
    }
96
  } else {
97
    if (node.isLast) {
98
      imgNode.src = node.relpath+"ftv2blank.png";
99
    } else {
100
      imgNode.src = node.relpath+"ftv2vertline.png";
101
    }
102
  }
103
  imgNode.border = "0";
104
}
105
 
106
function newNode(o, po, text, link, childrenData, lastNode)
107
{
108
  var node = new Object();
109
  node.children = Array();
110
  node.childrenData = childrenData;
111
  node.depth = po.depth + 1;
112
  node.relpath = po.relpath;
113
  node.isLast = lastNode;
114
 
115
  node.li = document.createElement("li");
116
  po.getChildrenUL().appendChild(node.li);
117
  node.parentNode = po;
118
 
119
  node.itemDiv = document.createElement("div");
120
  node.itemDiv.className = "item";
121
 
122
  node.labelSpan = document.createElement("span");
123
  node.labelSpan.className = "label";
124
 
125
  createIndent(o,node.itemDiv,node,0);
126
  node.itemDiv.appendChild(node.labelSpan);
127
  node.li.appendChild(node.itemDiv);
128
 
129
  var a = document.createElement("a");
130
  node.labelSpan.appendChild(a);
131
  node.label = document.createTextNode(text);
132
  node.expanded = false;
133
  a.appendChild(node.label);
134
  if (link) {
135
    var url;
136
    if (link.substring(0,1)=='^') {
137
      url = link.substring(1);
138
      link = url;
139
    } else {
140
      url = node.relpath+link;
141
    }
142
    a.className = stripPath(link.replace('#',':'));
143
    if (link.indexOf('#')!=-1) {
144
      var aname = '#'+link.split('#')[1];
145
      var srcPage = stripPath($(location).attr('pathname'));
146
      var targetPage = stripPath(link.split('#')[0]);
147
      a.href = srcPage!=targetPage ? url : '#';
148
      a.onclick = function(){
149
        if (!$(a).parent().parent().hasClass('selected'))
150
        {
151
          $('.item').removeClass('selected');
152
          $('.item').removeAttr('id');
153
          $(a).parent().parent().addClass('selected');
154
          $(a).parent().parent().attr('id','selected');
155
        }
156
        var pos, anchor = $(aname), docContent = $('#doc-content');
157
        if (anchor.parent().attr('class')=='memItemLeft') {
158
          pos = anchor.parent().position().top;
159
        } else {
160
          pos = anchor.position().top;
161
        }
162
        var dist = Math.abs(Math.min(
163
                     pos-docContent.offset().top,
164
                     docContent[0].scrollHeight-
165
                     docContent.height()-docContent.scrollTop()));
166
        docContent.animate({
167
          scrollTop: pos + docContent.scrollTop() - docContent.offset().top
168
        },Math.max(50,Math.min(500,dist)),function(){
169
          window.location.replace(aname);
170
        });
171
      };
172
    } else {
173
      a.href = url;
174
    }
175
  } else {
176
    if (childrenData != null)
177
    {
178
      a.className = "nolink";
179
      a.href = "javascript:void(0)";
180
      a.onclick = node.expandToggle.onclick;
181
    }
182
  }
183
 
184
  node.childrenUL = null;
185
  node.getChildrenUL = function() {
186
    if (!node.childrenUL) {
187
      node.childrenUL = document.createElement("ul");
188
      node.childrenUL.className = "children_ul";
189
      node.childrenUL.style.display = "none";
190
      node.li.appendChild(node.childrenUL);
191
    }
192
    return node.childrenUL;
193
  };
194
 
195
  return node;
196
}
197
 
198
function showRoot()
199
{
200
  var headerHeight = $("#top").height();
201
  var footerHeight = $("#nav-path").height();
202
  var windowHeight = $(window).height() - headerHeight - footerHeight;
203
  (function (){ // retry until we can scroll to the selected item
204
    try {
205
      navtree.scrollTo('#selected',0,{offset:-windowHeight/2});
206
    } catch (err) {
207
      setTimeout(arguments.callee, 0);
208
    }
209
  })();
210
}
211
 
212
function expandNode(o, node, imm, showRoot)
213
{
214
  if (node.childrenData && !node.expanded) {
215
    if (typeof(node.childrenData)==='string') {
216
      var varName    = node.childrenData;
217
      getScript(node.relpath+varName,function(){
218
        node.childrenData = getData(varName);
219
        expandNode(o, node, imm, showRoot);
220
      }, showRoot);
221
    } else {
222
      if (!node.childrenVisited) {
223
        getNode(o, node);
224
      } if (imm) {
225
        $(node.getChildrenUL()).show();
226
      } else {
227
        $(node.getChildrenUL()).slideDown("fast");
228
      }
229
      if (node.isLast) {
230
        node.plus_img.src = node.relpath+"ftv2mlastnode.png";
231
      } else {
232
        node.plus_img.src = node.relpath+"ftv2mnode.png";
233
      }
234
      node.expanded = true;
235
    }
236
  }
237
}
238
 
239
function highlightAnchor()
240
{
241
  var anchor = $($(location).attr('hash'));
242
  if (anchor.parent().attr('class')=='memItemLeft'){
243
    var rows = $('.memberdecls tr[class$=\""'+
244
        window.location.hash.substring(1)+'"\"]').children();
245
    rows.effect('highlight',{},1500);
246
  } else if (anchor.parent().is(":header")) {
247
    anchor.parent().effect('highlight',{},1500);
248
  } else {
249
    var targetDiv = anchor.next();
250
    $(targetDiv).children('.memproto,.memdoc').effect("highlight",{},1500);
251
  }
252
}
253
 
254
function showNode(o, node, index)
255
{
256
  if (node.childrenData /*&& !node.expanded*/) {
257
    if (typeof(node.childrenData)==='string') {
258
      var varName    = node.childrenData;
259
      getScript(node.relpath+varName,function(){
260
        node.childrenData = getData(varName);
261
        showNode(o,node,index);
262
      },true);
263
    } else {
264
      if (!node.childrenVisited) {
265
        getNode(o, node);
266
      }
267
      $(node.getChildrenUL()).show();
268
      if (node.isLast) {
269
        node.plus_img.src = node.relpath+"ftv2mlastnode.png";
270
      } else {
271
        node.plus_img.src = node.relpath+"ftv2mnode.png";
272
      }
273
      node.expanded = true;
274
      var n = node.children[o.breadcrumbs[index]];
275
      if (index+1<o.breadcrumbs.length) {
276
        showNode(o,n,index+1);
277
      } else {
278
        if (typeof(n.childrenData)==='string') {
279
          var varName = n.childrenData;
280
          getScript(n.relpath+varName,function(){
281
            n.childrenData = getData(varName);
282
            node.expanded=false;
283
            showNode(o,node,index); // retry with child node expanded
284
          },true);
285
        } else {
286
          if (o.toroot=="index.html" || n.childrenData) {
287
            expandNode(o, n, true, true);
288
          }
289
          var a;
290
          if ($(location).attr('hash')) {
291
            var link=stripPath($(location).attr('pathname'))+':'+
292
                     $(location).attr('hash').substring(1);
293
            a=$('.item a[class$=\""'+link+'"\"]');
294
          }
295
          if (a && a.length) {
296
            a.parent().parent().addClass('selected');
297
            a.parent().parent().attr('id','selected');
298
            highlightAnchor();
299
          } else {
300
            $(n.itemDiv).addClass('selected');
301
            $(n.itemDiv).attr('id','selected');
302
          }
303
          showRoot();
304
        }
305
      }
306
    }
307
  }
308
}
309
 
310
function getNode(o, po)
311
{
312
  po.childrenVisited = true;
313
  var l = po.childrenData.length-1;
314
  for (var i in po.childrenData) {
315
    var nodeData = po.childrenData[i];
316
    po.children[i] = newNode(o, po, nodeData[0], nodeData[1], nodeData[2],
317
      i==l);
318
  }
319
}
320
 
321
function navTo(o,root,hash,relpath)
322
{
323
  getScript(relpath+"navtreeindex",function(){
324
    var navTreeIndex = eval('NAVTREEINDEX');
325
    if (navTreeIndex) {
326
      var nti = navTreeIndex[root+hash];
327
      o.breadcrumbs = nti ? nti : navTreeIndex[root];
328
      if (o.breadcrumbs==null) o.breadcrumbs = navTreeIndex["index.html"];
329
      o.breadcrumbs.unshift(0);
330
      showNode(o, o.node, 0);
331
    }
332
  },true);
333
}
334
 
335
function initNavTree(toroot,relpath)
336
{
337
  var o = new Object();
338
  o.toroot = toroot;
339
  o.node = new Object();
340
  o.node.li = document.getElementById("nav-tree-contents");
341
  o.node.childrenData = NAVTREE;
342
  o.node.children = new Array();
343
  o.node.childrenUL = document.createElement("ul");
344
  o.node.getChildrenUL = function() { return o.node.childrenUL; };
345
  o.node.li.appendChild(o.node.childrenUL);
346
  o.node.depth = 0;
347
  o.node.relpath = relpath;
348
  o.node.expanded = false;
349
  o.node.isLast = true;
350
  o.node.plus_img = document.createElement("img");
351
  o.node.plus_img.src = relpath+"ftv2pnode.png";
352
  o.node.plus_img.width = 16;
353
  o.node.plus_img.height = 22;
354
 
355
  navTo(o,toroot,window.location.hash,relpath);
356
 
357
  $(window).bind('hashchange', function(){
358
     if (window.location.hash && window.location.hash.length>1){
359
       var a;
360
       if ($(location).attr('hash')){
361
         var clslink=stripPath($(location).attr('pathname'))+':'+
362
                               $(location).attr('hash').substring(1);
363
         a=$('.item a[class$=\""'+clslink+'"\"]');
364
       }
365
       if (a==null || !$(a).parent().parent().hasClass('selected')){
366
         $('.item').removeClass('selected');
367
         $('.item').removeAttr('id');
368
       }
369
       var link=stripPath($(location).attr('pathname'));
370
       navTo(o,link,$(location).attr('hash'),relpath);
371
     }
372
  })
373
 
374
  $(window).load(showRoot);
375
}
376
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.