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