From 8ff1b7985477683725efb89c055a68ceef2681f3 Mon Sep 17 00:00:00 2001 From: Adrian Jones Date: Wed, 27 Mar 2024 20:00:54 -0700 Subject: [PATCH] Another attempt at always loading adminer.js (it was loaded except for Page Tree root URL). Also switched file-editor.js to this method as it was also having sporadic issues. --- TracyDebugger.module.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/TracyDebugger.module.php b/TracyDebugger.module.php index 363a588..1da4926 100644 --- a/TracyDebugger.module.php +++ b/TracyDebugger.module.php @@ -27,7 +27,7 @@ public static function getModuleInfo() { 'summary' => __('Tracy debugger from Nette with many PW specific custom tools.', __FILE__), 'author' => 'Adrian Jones', 'href' => 'https://processwire.com/talk/forum/58-tracy-debugger/', - 'version' => '4.26.5', + 'version' => '4.26.6', 'autoload' => 100000, // in PW 3.0.114+ higher numbers are loaded first - we want Tracy first 'singular' => true, 'requires' => 'ProcessWire>=2.7.2, PHP>=5.4.4', @@ -1101,7 +1101,6 @@ public function init() { if(in_array('fileEditor', static::$showPanels)) { // this needs to be loaded here (not just in File Editor panel) so that links // will work even if File Editor panel hasn't been opened yet - Debugger::$customJsFiles[] = $this->wire('config')->paths->TracyDebugger.'scripts/file-editor.js'; Debugger::$customJsFiles[] = $this->wire('config')->paths->TracyDebugger.'scripts/php-file-tree/php_file_tree.js'; } @@ -1111,12 +1110,6 @@ public function init() { Debugger::$customJsFiles[] = $this->wire('config')->paths->TracyDebugger.'scripts/exception-loader.js'; } - if(in_array('adminer', static::$showPanels)) { - // this needs to be loaded here (not just in Adminer panel) so that links - // will work even if Adminer panel hasn't been opened yet - Debugger::$customJsFiles[] = $this->wire('config')->paths->TracyDebugger.'scripts/adminer.js'; - } - if($this->showServerTypeIndicator()) { $this->serverStyleInfo = $this->getServerAdminStyles(); Debugger::$customCssStr .= $this->setServerAdminStyleColor(); @@ -1260,6 +1253,13 @@ function addLocalAlert() {
'; + if(in_array('fileEditor', static::$showPanels)) { + Debugger::$customJsStr .= file_get_contents($this->wire('config')->paths->TracyDebugger.'scripts/file-editor.js'); + } + if(in_array('adminer', static::$showPanels)) { + Debugger::$customJsStr .= file_get_contents($this->wire('config')->paths->TracyDebugger.'scripts/adminer.js'); + } + Debugger::$customJsStr .= ' function addHideLink() { if(!document.getElementById("tracy-debug-bar")) {