Source for file profiler.phtml

Documentation is available at profiler.phtml

  1. 1: <?php
  2. 2:  
  3. 3: /**
  4. 4:  * Nette Framework - Profiler screen template.
  5. 5:  *
  6. 6:  * Copyright (c) 2004, 2009 David Grudl (http://davidgrudl.com)
  7. 7:  *
  8. 8:  * This source file is subject to the "Nette license" that is bundled
  9. 9:  * with this package in the file license.txt.
  10. 10:  *
  11. 11:  * For more information please see https://nette.org
  12. 12:  *
  13. 13:  * @author     David Grudl
  14. 14:  * @copyright  Copyright (c) 2004, 2009 David Grudl
  15. 15:  * @license    https://nette.org/license  Nette license
  16. 16:  * @link       https://nette.org
  17. 17:  * @category   Nette
  18. 18:  * @package    Nette
  19. 19:  * @version    $Id$
  20. 20:  *
  21. 21:  * @param      array     $colophons 
  22. 22:  * @return     void 
  23. 23:  */
  24. 24:  
  25. 25:  
  26. 26:  
  27. 27: ?>
  28. 28:  
  29. 29: <style type="text/css">
  30. 30: /* <![CDATA[ */
  31. 31:     #netteProfilerContainer {
  32. 32:         position: fixed;
  33. 33:         _position: absolute;
  34. 34:         right: 5px;
  35. 35:         bottom: 5px;
  36. 36:         z-index: 23178;
  37. 37:     }
  38. 38:  
  39. 39:     #netteProfiler {
  40. 40:         font: normal normal 11px/1.4 Consolas, Arial;
  41. 41:         position: relative;
  42. 42:         padding: 1px;
  43. 43:         color: black;
  44. 44:         background: #EEE;
  45. 45:         border: 1px dotted gray;
  46. 46:         cursor: move;
  47. 47:         opacity: .70;
  48. 48:         =filter: alpha(opacity=70);
  49. 49:     }
  50. 50:  
  51. 51:     #netteProfiler * {
  52. 52:         color: inherit;
  53. 53:         background: inherit;
  54. 54:         text-align: inherit;
  55. 55:     }
  56. 56:  
  57. 57:     #netteProfilerIcon {
  58. 58:         position: absolute;
  59. 59:         right: 0;
  60. 60:         top: 0;
  61. 61:         line-height: 1;
  62. 62:         padding: 4px;
  63. 63:         color: black;
  64. 64:         text-decoration: none;
  65. 65:     }
  66. 66:  
  67. 67:     #netteProfiler:hover {
  68. 68:         opacity: 1;
  69. 69:         =filter: none;
  70. 70:     }
  71. 71:  
  72. 72:     #netteProfiler ul {
  73. 73:         margin: 0;
  74. 74:         padding: 0;
  75. 75:         width: 350px;
  76. 76:     }
  77. 77:  
  78. 78:     #netteProfiler li {
  79. 79:         margin: 0;
  80. 80:         padding: 1px;
  81. 81:         text-align: left;
  82. 82:         list-style: none;
  83. 83:     }
  84. 84:  
  85. 85:     #netteProfiler span[title] {
  86. 86:         border-bottom: 1px dotted gray;
  87. 87:         cursor: help;
  88. 88:     }
  89. 89:  
  90. 90:     #netteProfiler strong {
  91. 91:         color: red;
  92. 92:     }
  93. 93: /* ]]> */
  94. 94: </style>
  95. 95:  
  96. 96:  
  97. 97: <div id="netteProfilerContainer">
  98. 98: <div id="netteProfiler">
  99. 99:     <a id="netteProfilerIcon" href="#"><span>&#x25bc;</span></a
  100. 100:     ><ul>
  101. 101:     <?php foreach ($colophons as $callback)?>
  102. 102:     <?php foreach ((array) call_user_func($callback'profiler'as $line)?><li><?php echo $line"\n" ?></li><?php endforeach ?>
  103. 103:     <?php endforeach ?>
  104. 104:     </ul>
  105. 105: </div>
  106. 106: </div>
  107. 107:  
  108. 108:  
  109. 109: <script type="text/javascript">
  110. 110: /* <![CDATA[ */
  111. 111: document.getElementById('netteProfiler').onmousedown = function(e) {
  112. 112:     e = e || event;
  113. 113:     this.posX = parseInt(this.style.left + '0');
  114. 114:     this.posY = parseInt(this.style.top + '0');
  115. 115:     this.mouseX = e.clientX;
  116. 116:     this.mouseY = e.clientY;
  117. 117:  
  118. 118:     var thisObj = this;
  119. 119:  
  120. 120:     document.documentElement.onmousemove = function(e) {
  121. 121:         e = e || event;
  122. 122:         thisObj.style.left = (e.clientX - thisObj.mouseX + thisObj.posX) + "px";
  123. 123:         thisObj.style.top = (e.clientY - thisObj.mouseY + thisObj.posY) + "px";
  124. 124:         return false;
  125. 125:     };
  126. 126:  
  127. 127:     document.documentElement.onmouseup = function(e) {
  128. 128:         document.documentElement.onmousemove = null;
  129. 129:         document.documentElement.onmouseup = null;
  130. 130:         return false;
  131. 131:     };
  132. 132: };
  133. 133:  
  134. 134: document.getElementById('netteProfilerIcon').onclick = function(e) {
  135. 135:     var span = this.getElementsByTagName('span')[0];
  136. 136:     var panel = this.nextSibling;
  137. 137:     var collapsed = panel.currentStyle ? panel.currentStyle.display == 'none' : getComputedStyle(panel, null).display == 'none';
  138. 138:  
  139. 139:     span.innerHTML = collapsed ? String.fromCharCode(0x25bc) : 'Profiler ' + String.fromCharCode(0x25ba);
  140. 140:     panel.style.display = collapsed ? 'block' : 'none';
  141. 141:     span.parentNode.style.position = collapsed ? 'absolute' : 'static';
  142. 142:     return false;
  143. 144: /* ]]> */
  144. 145: </script>