Skip to content

Commit 91cdf3b

Browse files
committed
Fix blusecreen zIndex when triggered by ajax call. Some cleanup. Logo to ReadMe.
1 parent bc0cb90 commit 91cdf3b

File tree

4 files changed

+42
-30
lines changed

4 files changed

+42
-30
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
![Tracy Debugger for ProcessWire logo](https://adrianbj.github.io/TracyDebugger/img/icon.svg)
2+
13
# Tracy Debugger for ProcessWire
24

35
**The ultimate “swiss army knife” debugging and development tool for the [ProcessWire](https://processwire.com/) CMF/CMS**
@@ -6,7 +8,7 @@ Integrates and extends Nette's Tracy debugging tool
68

79
30+ custom tools designed for effective ProcessWire debugging and lightning fast development
810

9-
![Tracy Debug Bar Kitchen Sink](https://github.com/adrianbj/TracyDebugger/blob/master/docs/img/debug-bar-kitchen-sink.png?raw=true "Tracy Debug Bar")
11+
![Tracy Debug Bar Kitchen Sink](https://adrianbj.github.io/TracyDebugger/img/debug-bar-kitchen-sink.png "Tracy Debug Bar")
1012

1113
### Documentation
1214
Documentation is available at: https://adrianbj.github.io/TracyDebugger/

TracyDebugger.module

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
<?php
22

3-
// TODO
4-
// sometimes Console panel isn't loading content from history, or maybe it's just not resizing properly?
5-
// check test mode when editing template file in backend - is there any point since you can't view changes?
6-
// cleanup unnecessary File Editor code
7-
// maybe an option to automatically restore backup if error/exception
8-
// try to automatically select opened file in folders/files sidebar
9-
// PW code autocompletion for Console and File Editor panels
10-
11-
123
/**
134
* Processwire module for running the Tracy debugger from Nette.
145
* by Adrian Jones
@@ -41,7 +32,7 @@ class TracyDebugger extends WireData implements Module, ConfigurableModule {
4132
'summary' => __('Tracy debugger from Nette with several PW specific custom tools.', __FILE__),
4233
'author' => 'Adrian Jones',
4334
'href' => 'https://processwire.com/talk/topic/12208-tracy-debugger/',
44-
'version' => '4.9.7',
35+
'version' => '4.9.8',
4536
'autoload' => true,
4637
'singular' => true,
4738
'requires' => 'ProcessWire>=2.7.2, PHP>=5.4.4',
@@ -867,24 +858,44 @@ class TracyDebugger extends WireData implements Module, ConfigurableModule {
867858
Debugger::$customJsStr .= '
868859
}
869860

870-
window.onload = function(e) {
871-
var tracyLogo = document.getElementById("tracy-debug-logo");
872-
tracyLogo.setAttribute("title", tracyLogo.getAttribute("title") + "\n\nDouble-click to visit module settings");
873-
tracyLogo.addEventListener("dblclick", function() {
874-
window.open("'.$this->wire('config')->urls->admin.'module/edit?name=TracyDebugger","_blank");
875-
}, false);
876-
877-
if(document.getElementById("tracy-bs"))
878-
document.getElementById("tracy-bs").style.zIndex = z = '.$this->data['panelZindex'].';
879-
880-
window.Tracy.DebugPanel.zIndex = z = '.$this->data['panelZindex'].';
881-
var panels = document.getElementsByClassName("tracy-panel");
882-
if(panels.length > 0) {
883-
for (var i = 0; i < panels.length; i++) {
884-
panels[i].style.zIndex = z++;
861+
function modifyTracyLogo() {
862+
if(!document.getElementById("tracy-debug-bar")) {
863+
window.requestAnimationFrame(modifyTracyLogo);
864+
} else {
865+
var tracyLogo = document.getElementById("tracy-debug-logo");
866+
tracyLogo.setAttribute("title", tracyLogo.getAttribute("title") + "\n\nDouble-click to visit module settings");
867+
tracyLogo.addEventListener("dblclick", function() {
868+
window.open("'.$this->wire('config')->urls->admin.'module/edit?name=TracyDebugger","_blank");
869+
}, false);
870+
}
871+
}
872+
modifyTracyLogo();
873+
874+
875+
function bsZIndex() {
876+
if(!document.getElementById("tracy-bs")) {
877+
window.requestAnimationFrame(bsZIndex);
878+
} else {
879+
if(document.getElementById("tracy-bs"))
880+
document.getElementById("tracy-bs").style.zIndex = z = '.$this->data['panelZindex'].';
881+
}
882+
}
883+
bsZIndex();
884+
885+
function panelsZIndex() {
886+
if(!document.getElementById("tracy-debug-bar")) {
887+
window.requestAnimationFrame(panelsZIndex);
888+
} else {
889+
window.Tracy.DebugPanel.zIndex = z = '.$this->data['panelZindex'].';
890+
var panels = document.getElementsByClassName("tracy-panel");
891+
if(panels.length > 0) {
892+
for (var i = 0; i < panels.length; i++) {
893+
panels[i].style.zIndex = z++;
894+
}
885895
}
886896
}
887-
};
897+
}
898+
panelsZIndex();
888899
';
889900

890901
if($this->data['hideDebugBar'] && $this->showServerTypeIndicator() && $this->data['styleAdminType'] == 'custom' && !$this->wire('input')->cookie->tracyShow) {
@@ -2104,7 +2115,7 @@ class TracyDebugger extends WireData implements Module, ConfigurableModule {
21042115
// Main Setup
21052116
$fieldset = $this->wire('modules')->get("InputfieldFieldset");
21062117
$fieldset->label = __('Main setup', __FILE__);
2107-
$fieldset->description = __('For more details on the settings below see:'."\n".'[TracyDebugger Debugger for ProcessWire](https://adrianbj.github.io/TracyDebugger)'."\n".'[Tracy Docs](https://tracy.nette.org/)', __FILE__);
2118+
$fieldset->description = __('For more details on the settings below see:'."\n".'[TracyDebugger Debugger for ProcessWire](https://adrianbj.github.io/TracyDebugger)'."\n".'[Tracy Docs](https://tracy.nette.org/)'."\n\n"."Don't forget to [Star on Github](https://github.com/adrianbj/TracyDebugger)!", __FILE__);
21082119
$wrapper->add($fieldset);
21092120

21102121
$f = $this->wire('modules')->get("InputfieldCheckbox");

panels/ConsolePanel.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,6 @@ public function getPanel() {
521521
522522
// set autocomplete and other options
523523
ace.config.loadModule('ace/ext/language_tools', function () {
524-
document.getElementById("tracyConsoleCode").style.visibility = "visible";
525524
if(!!localStorage.getItem("tracyConsole") && localStorage.getItem("tracyConsole") !== "null" && localStorage.getItem("tracyConsole") !== "undefined") {
526525
try {
527526
tracyConsole.setEditorState(JSON.parse(localStorage.getItem("tracyConsole")));

panels/FileEditorPanel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public function getPanel() {
201201
$out .= '
202202
</div>
203203
<div id="tracyFileEditorCodeContainer" style="float: left; width: calc(100vw - 400px) !important;">
204-
<div id="tracyFileEditorCode" style="visibility:hidden; height:100px; position:relative;"></div><br />
204+
<div id="tracyFileEditorCode" style="position:relative;"></div><br />
205205
<form id="tracyFileEditorSubmission" method="post" action="'.\TracyDebugger::inputUrl(true).'">
206206
<fieldset>
207207
<textarea id="tracyFileEditorRawCode" name="tracyFileEditorRawCode" style="display:none"></textarea>

0 commit comments

Comments
 (0)