|
1 | 1 | <?php |
2 | 2 |
|
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 | | - |
12 | 3 | /** |
13 | 4 | * Processwire module for running the Tracy debugger from Nette. |
14 | 5 | * by Adrian Jones |
@@ -41,7 +32,7 @@ class TracyDebugger extends WireData implements Module, ConfigurableModule { |
41 | 32 | 'summary' => __('Tracy debugger from Nette with several PW specific custom tools.', __FILE__), |
42 | 33 | 'author' => 'Adrian Jones', |
43 | 34 | 'href' => 'https://processwire.com/talk/topic/12208-tracy-debugger/', |
44 | | - 'version' => '4.9.7', |
| 35 | + 'version' => '4.9.8', |
45 | 36 | 'autoload' => true, |
46 | 37 | 'singular' => true, |
47 | 38 | 'requires' => 'ProcessWire>=2.7.2, PHP>=5.4.4', |
@@ -867,24 +858,44 @@ class TracyDebugger extends WireData implements Module, ConfigurableModule { |
867 | 858 | Debugger::$customJsStr .= ' |
868 | 859 | } |
869 | 860 |
|
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 | + } |
885 | 895 | } |
886 | 896 | } |
887 | | - }; |
| 897 | + } |
| 898 | + panelsZIndex(); |
888 | 899 | '; |
889 | 900 |
|
890 | 901 | 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 { |
2104 | 2115 | // Main Setup |
2105 | 2116 | $fieldset = $this->wire('modules')->get("InputfieldFieldset"); |
2106 | 2117 | $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__); |
2108 | 2119 | $wrapper->add($fieldset); |
2109 | 2120 |
|
2110 | 2121 | $f = $this->wire('modules')->get("InputfieldCheckbox"); |
|
0 commit comments