|
2 | 2 | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
3 | 3 | <xsl:output method="html" version="4.0" encoding="UTF-8" indent="yes" media-type="text/html; charset=utf-8"/> |
4 | 4 | <xsl:include href="FormatCommon.xsl"/> |
| 5 | + <xsl:include href="JSFunctions.xsl"/> |
5 | 6 | <!-- |
6 | 7 | ================================================================ |
7 | 8 | Format the xml returned from XAmple parse for user display. |
@@ -57,13 +58,7 @@ Main template |
57 | 58 | <html> |
58 | 59 | <head> |
59 | 60 | <meta charset="UTF-8" /> |
60 | | - <xsl:call-template name="Script"/> |
61 | | - <style type="text/css"> |
62 | | - .interblock { |
63 | | - display: -moz-inline-box; |
64 | | - display: inline-block; |
65 | | - vertical-align: top; |
66 | | - }</style> |
| 61 | + <xsl:call-template name="TraceScript"/> |
67 | 62 | </head> |
68 | 63 | <body style="font-family:Times New Roman"> |
69 | 64 | <h1> |
@@ -420,178 +415,6 @@ ShowMsaInfo |
420 | 415 | </span> |
421 | 416 | </xsl:for-each> |
422 | 417 | </xsl:template> |
423 | | - <!-- |
424 | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
425 | | - Script |
426 | | - Output the JavaScript script to handle dynamic "tree" |
427 | | - Parameters: none |
428 | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
429 | | - --> |
430 | | - <xsl:template name="Script"> |
431 | | - <script language="JavaScript" id="clientEventHandlersJS"> |
432 | | - <xsl:text disable-output-escaping="yes"> |
433 | | - function ButtonShowDetails() |
434 | | - { |
435 | | - if (TraceSection.style.display == 'none') |
436 | | - { |
437 | | - TraceSection.style.display = 'block'; |
438 | | - ShowDetailsButton.value = "Hide Details"; |
439 | | - } |
440 | | - else |
441 | | - { |
442 | | - TraceSection.style.display = 'none'; |
443 | | - ShowDetailsButton.value = "Show Details"; |
444 | | - } |
445 | | - } |
446 | | - // Center the mouse position in the browser |
447 | | - function CenterNodeInBrowser(node) |
448 | | - { |
449 | | - var posx = 0; |
450 | | - var posy = 0; |
451 | | - if (!e) var e = window.event; |
452 | | - if (e.pageX || e.pageY) |
453 | | - { |
454 | | - posx = e.pageX; |
455 | | - posy = e.pageY; |
456 | | - } |
457 | | - else if (e.clientX || e.clientY) |
458 | | - { |
459 | | - posx = e.clientX + document.body.scrollLeft; |
460 | | - posy = e.clientY + document.body.scrollTop; |
461 | | - } |
462 | | - // posx and posy contain the mouse position relative to the document |
463 | | - curY = findPosY(node); |
464 | | - offset = document.body.clientHeight/2; |
465 | | - window.scrollTo(0, curY-offset); // scroll to about the middle if possible |
466 | | - } |
467 | | - // findPosX() and findPosY() are from http://www.quirksmode.org/js/findpos.html |
468 | | - function findPosX(obj) |
469 | | -{ |
470 | | - var curleft = 0; |
471 | | - if (obj.offsetParent) |
472 | | - { |
473 | | - while (obj.offsetParent) |
474 | | - { |
475 | | - curleft += obj.offsetLeft |
476 | | - obj = obj.offsetParent; |
477 | | - } |
478 | | - } |
479 | | - else if (obj.x) |
480 | | - curleft += obj.x; |
481 | | - return curleft; |
482 | | -} |
483 | | - |
484 | | -function findPosY(obj) |
485 | | -{ |
486 | | - var curtop = 0; |
487 | | - if (obj.offsetParent) |
488 | | - { |
489 | | - while (obj.offsetParent) |
490 | | - { |
491 | | - curtop += obj.offsetTop |
492 | | - obj = obj.offsetParent; |
493 | | - } |
494 | | - } |
495 | | - else if (obj.y) |
496 | | - curtop += obj.y; |
497 | | - return curtop; |
498 | | -} |
499 | | - |
500 | | -// nextSibling function that skips over textNodes. |
501 | | -function NextNonTextSibling(node) |
502 | | -{ |
503 | | - while(node.nextSibling.nodeName == "#text") |
504 | | - node = node.nextSibling; |
505 | | - |
506 | | - return node.nextSibling; |
507 | | -} |
508 | | - |
509 | | -// This script based on the one given in http://www.codeproject.com/jscript/dhtml_treeview.asp. |
510 | | -function Toggle(node, path, imgOffset) |
511 | | -{ |
512 | | - |
513 | | - Images = new Array('beginminus.gif', 'beginplus.gif', 'lastminus.gif', 'lastplus.gif', 'minus.gif', 'plus.gif', 'singleminus.gif', 'singleplus.gif', |
514 | | - 'beginminusRTL.gif', 'beginplusRTL.gif', 'lastminusRTL.gif', 'lastplusRTL.gif', 'minusRTL.gif', 'plusRTL.gif', 'singleminusRTL.gif', 'singleplusRTL.gif'); |
515 | | - // Unfold the branch if it isn't visible |
516 | | - |
517 | | - if (NextNonTextSibling(node).style.display == 'none') |
518 | | - { |
519 | | - // Change the image (if there is an image) |
520 | | - if (node.childNodes.length > 0) |
521 | | - { |
522 | | - if (node.childNodes.item(0).nodeName == "IMG") |
523 | | - { |
524 | | - var str = node.childNodes.item(0).src; |
525 | | - var pos = str.indexOf(Images[1 + imgOffset]); // beginplus.gif |
526 | | - if (pos >= 0) |
527 | | - { |
528 | | - node.childNodes.item(0).src = path + Images[0 + imgOffset]; // "beginminus.gif"; |
529 | | - } |
530 | | - else |
531 | | - { |
532 | | - pos = str.indexOf(Images[7 + imgOffset]); // "singleplus.gif"); |
533 | | - if (pos >= 0) |
534 | | - { |
535 | | - node.childNodes.item(0).src = path + Images[6 + imgOffset]; // "singleminus.gif"; |
536 | | - } |
537 | | - else |
538 | | - { |
539 | | - pos = str.indexOf(Images[3 + imgOffset]); // "lastplus.gif"); |
540 | | - if (pos >= 0) |
541 | | - { |
542 | | - node.childNodes.item(0).src = path + Images[2 + imgOffset]; // "lastminus.gif"; |
543 | | - } |
544 | | - else |
545 | | - { |
546 | | - node.childNodes.item(0).src = path + Images[4 + imgOffset]; // "minus.gif"; |
547 | | - } |
548 | | - } |
549 | | - } |
550 | | - } |
551 | | - } |
552 | | - NextNonTextSibling(node).style.display = 'block'; |
553 | | - CenterNodeInBrowser(node); |
554 | | - } |
555 | | - // Collapse the branch if it IS visible |
556 | | - else |
557 | | - { |
558 | | - // Change the image (if there is an image) |
559 | | - if (node.childNodes.length > 0) |
560 | | - { |
561 | | - if (node.childNodes.item(0).nodeName == "IMG") |
562 | | - var str = node.childNodes.item(0).src; |
563 | | - var pos = str.indexOf(Images[0 + imgOffset]); // "beginminus.gif"); |
564 | | - if (pos >= 0) |
565 | | - { |
566 | | - node.childNodes.item(0).src = path + Images[1 + imgOffset]; // "beginplus.gif"; |
567 | | - } |
568 | | - else |
569 | | - { |
570 | | - pos = str.indexOf(Images[6 + imgOffset]); // "singleminus.gif"); |
571 | | - if (pos >= 0) |
572 | | - { |
573 | | - node.childNodes.item(0).src = path + Images[7 + imgOffset]; // "singleplus.gif"; |
574 | | - } |
575 | | - else |
576 | | - { |
577 | | - pos = str.indexOf(Images[2 + imgOffset]); // "lastminus.gif"); |
578 | | - if (pos >= 0) |
579 | | - { |
580 | | - node.childNodes.item(0).src = path + Images[3 + imgOffset]; // "lastplus.gif"; |
581 | | - } |
582 | | - else |
583 | | - { |
584 | | - node.childNodes.item(0).src = path + Images[5 + imgOffset]; // "plus.gif"; |
585 | | - } |
586 | | - } |
587 | | - } |
588 | | - } |
589 | | - NextNonTextSibling(node).style.display = 'none'; |
590 | | -} |
591 | | -} |
592 | | - </xsl:text> |
593 | | - </script> |
594 | | - </xsl:template> |
595 | 418 | <!-- |
596 | 419 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
597 | 420 | ShowAnyFailure |
|
0 commit comments