Advertisement
Guest User

Untitled

a guest
Dec 5th, 2011
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.31 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. use strict;
  4.  
  5. my $xhtml = "";
  6. $xhtml .= <<EOT;
  7.  
  8. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  9. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  10. <head>
  11. </head>
  12.  
  13. <style type="text/css" media="screen">
  14. #popitmenu{
  15. position: absolute;
  16. background-color: yellow;
  17. border:1px solid black;
  18. font: normal 12px Verdana;
  19. line-height: 18px;
  20. z-index: 100;
  21. visibility: hidden;
  22. -moz-box-shadow: 5px 5px 5px #666;
  23. margin: 0px 0px;
  24. }
  25. #popitmenu a{
  26. text-decoration: none;
  27. padding-left: 6px;
  28. color: black;
  29. display: block;
  30. }
  31. #popitmenu a:hover{ /*hover background color*/
  32. background-color: #CCFF9D;
  33. }
  34. </style>
  35.  
  36. <body>
  37.  
  38. <div id="popitmenu" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>
  39.  
  40.  
  41.  
  42.  
  43. <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="1100px" height="1500px">
  44.  
  45. <script type="application/ecmascript"> <![CDATA[
  46. function circle_click(evt) {
  47. var circle = evt.target;
  48. var currentRadius = circle.getAttribute("r");
  49. if (currentRadius == 100)
  50. circle.setAttribute("r", currentRadius*2);
  51. else
  52. circle.setAttribute("r", currentRadius*0.5);
  53. }
  54. ]]> </script>
  55.  
  56.  
  57.  
  58. <script type="application/ecmascript"> <![CDATA[
  59.  
  60. var defaultMenuWidth="150px";
  61. var ie5=document.all;
  62. var ns6=document.getElementById&&!document.all;
  63. var ns4=document.layers;
  64.  
  65. function downmenu(evt,admin,finfo)
  66. {
  67. var code = new Array();
  68.  
  69. code = '';
  70. code += '<a href="/www.test.com" '+ admin + '>Link<a>';
  71. code += '<a href="/telnet.pl.?' + finfo + ' ">telnet</a> ';
  72. showmenu(evt, code, '100px');
  73. }
  74.  
  75. function showmenu(e,code,optWidth)
  76. {
  77.  
  78. if (!document.all&&!document.getElementById&&!document.layers) return;
  79.  
  80. clearhidemenu()
  81.  
  82. menuobj=ns6? document.getElementById("popitmenu") : ns4? document.popmenu : ""
  83. menuobj.thestyle=(ie5||ns6)? menuobj.style : menuobj
  84. menuobj.innerHTML=code;
  85.  
  86. menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
  87. menuobj.contentwidth=menuobj.offsetWidth
  88. menuobj.contentheight=menuobj.offsetHeight
  89.  
  90.  
  91. eventX=ie5? event.clientX : e.clientX
  92. eventY=ie5? event.clientY : e.clientY
  93. var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
  94. var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
  95.  
  96. if (rightedge<menuobj.contentwidth)
  97. menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
  98. else
  99. menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
  100.  
  101. if (bottomedge<menuobj.contentheight)
  102. menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
  103. else
  104. menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px"
  105. menuobj.style.visibility="visible"
  106.  
  107. return false
  108. }
  109.  
  110. function contains_ns6(a, b) {
  111. while (b.parentNode)
  112. if ((b = b.parentNode) == a) return true;
  113. return false;
  114. }
  115.  
  116. function hidemenu()
  117. { if (window.menuobj) menuobj.style.visibility="hidden" }
  118.  
  119. function dynamichide(e)
  120. { if (ie5&&!menuobj.contains(e.toElement)) hidemenu()
  121. else
  122. if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
  123. hidemenu()
  124. }
  125.  
  126. function delayhidemenu(){ delayhide=setTimeout("hidemenu()",500) }
  127.  
  128. function clearhidemenu(){ if (window.delayhide) clearTimeout(delayhide) }
  129.  
  130. if (ie5||ns6) document.onclick=hidemenu
  131. ]]>
  132. </script>
  133.  
  134.  
  135. <ellipse cx="240" cy="50" rx="220" ry="30" style="fill:yellow" />
  136.  
  137. <ellipse cx="220" cy="50" rx="190" ry="20" style="fill:white" />
  138. <ellipse cx="240" cy="50" rx="220" ry="30" style="fill:yellow" />
  139.  
  140. <ellipse cx="220" cy="50" rx="190" ry="20" style="fill:white" />
  141.  
  142. <rect onmouseover="downmenu(evt,'ddd','eee')" onmouseout="delayhidemenu()" x="200" y="600" width="50" height="50" style="fill:rgb(0,0,255);" />
  143.  
  144.  
  145. <circle onclick="circle_click(evt)" cx="300" cy="525" r="100" fill="red"/>
  146.  
  147. <text x="300" y="480" font-family="Verdana" font-size="35" text-anchor="middle">gggg </text>
  148.  
  149.  
  150. </svg>
  151.  
  152. </body>
  153. </html>
  154. EOT
  155.  
  156. print "Content-type: application/xhtml+xml; charset=utf-8 \n\n";
  157. print $xhtml;
  158.  
  159.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement