Skip to content

Commit 0c5e41b

Browse files
committed
More Windows slash issues. Some other encoding issues in File Editor (thanks @matjazp). Cleanup of autoopening/highlighting open file in File Editor panel. Fix Issue #18.
1 parent 385d570 commit 0c5e41b

File tree

7 files changed

+11
-12
lines changed

7 files changed

+11
-12
lines changed

TracyDebugger.module

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class TracyDebugger extends WireData implements Module, ConfigurableModule {
3232
'summary' => __('Tracy debugger from Nette with several PW specific custom tools.', __FILE__),
3333
'author' => 'Adrian Jones',
3434
'href' => 'https://processwire.com/talk/topic/12208-tracy-debugger/',
35-
'version' => '4.9.11',
35+
'version' => '4.9.12',
3636
'autoload' => true,
3737
'singular' => true,
3838
'requires' => 'ProcessWire>=2.7.2, PHP>=5.4.4',

panels/FileEditorPanel.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class FileEditorPanel extends BasePanel {
55
protected $icon;
66
protected $tracyFileEditorFilePath;
77
protected $errorMessage = null;
8+
protected $encoding = 'auto';
89

910
public function getTab() {
1011

@@ -352,6 +353,9 @@ private function php_file_tree_dir($directory, $extensions = array(), $extFilter
352353
*
353354
*/
354355
private function toUTF8($str, $encoding = 'auto', $c = false) {
356+
357+
if(PHP_VERSION_ID >= 70100) return $str;
358+
355359
// http://stackoverflow.com/questions/7979567/php-convert-any-string-to-utf-8-without-knowing-the-original-character-set-or
356360
if(extension_loaded('mbstring') && function_exists('iconv')) {
357361
if($encoding == 'auto') {

panels/PanelSelectorPanel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function getCookie(name) {
141141
$out .= '
142142
<label style="'.($this->wire('page')->template == 'admin' && in_array($name, \TracyDebugger::$hideInAdmin) ? ' visibility:hidden;position: absolute; left: -999em;' : '').'">' .
143143
($this->isOnce($name, $defaultPanels) ? $onceIcon .'&nbsp;' : '<span style="display:inline-block;width:18px">&nbsp;</span>') . '
144-
<span style="font-size:16px; font-weight:600"><a title="Panel Info" href="https://adrianbj.github.io/TracyDebugger/#/debug-bar?id='.str_replace(' ', '-', strtolower($label)).'" target="_blank">&#8505;</a></span>
144+
<span style="font-size:16px; font-weight:600"><a title="Panel Info" href="https://adrianbj.github.io/TracyDebugger/#/debug-bar?id='.str_replace(' ', '-', strtolower($label)).'" target="_blank"></a></span>
145145
<input type="checkbox" name="selectedPanels[]" ' . ($name == 'panelSelector' ? 'disabled="disabled"' : '') . ' value="'.$name.'" ' . (in_array($name, $showPanels) ? 'checked="checked"' : '') . ' /> '
146146
. $label . (in_array($name, $defaultPanels) ? '&nbsp;<strong>*</strong>' : '') . ($seconds ? '<span style="color:#999999; font-size:11px; float:right; margin-left:20px">&nbsp;' . \TracyDebugger::formatTime($seconds) . ($size ? ', '.$size : '') . '</span>' : '') . '
147147
</label>';

panels/ProcesswireInfoPanel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ function searchPw(form) {
343343
if($info['core']) continue;
344344
$moduleInfo .= $name . ": " . $this->wire('modules')->formatVersion($info['version']) . $eol;
345345
}
346-
$githubVersionsList = '<details><summary><strong>Server Details</strong></summary>' . $serverInfo . '<details><summary><strong>Server Settings</strong></summary> ' . $serverSettings . '</details><details><summary><strong>Module Details</strong></summary> ' . $moduleInfo . '</details></details>';
346+
$githubVersionsList = '<details><summary><strong>Server Details</strong></summary>' . $serverInfo . '</details><details><summary><strong>Server Settings</strong></summary> ' . $serverSettings . '</details><details><summary><strong>Module Details</strong></summary> ' . $moduleInfo . '</details>';
347347
$versionsList .= '
348348
<p>
349349
<button class="tracyCopyBtn" data-clipboard-text="'.$githubVersionsList.'">

panels/ProcesswireVersionPanel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public function getTab() {
1313
foreach(new DirectoryIterator($this->wire('config')->paths->root) as $fileInfo) {
1414
if($fileInfo->isDot()) continue;
1515
$filePath = $fileInfo->getPathname();
16+
$filePath = \TracyDebugger::forwardSlashPath($filePath);
1617
$version = str_replace($this->wire('config')->paths->root, '', $filePath);
1718
$version = str_replace('.wire-', '', $version);
1819
if(strpos($filePath, 'wire') === false) continue;

scripts/ace-editor/mode-apache_conf.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/php-file-tree/php_file_tree.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@
3232
3333
*/
3434

35-
function getCookie(name) {
36-
var value = "; " + document.cookie;
37-
var parts = value.split("; " + name + "=");
38-
if (parts.length == 2) return parts.pop().split(";").shift();
39-
}
40-
4135
function init_php_file_tree() {
4236

4337
if (!document.getElementsByTagName) return;
@@ -75,7 +69,7 @@ function init_php_file_tree() {
7569

7670
submenu[j].className = (mclass.indexOf("open") > -1) ? "open" : "closed";
7771

78-
if(getCookie('tracyFileEditorFilePath') && getCookie('tracyFileEditorFilePath').indexOf(submenu[j].text) > -1) {
72+
if(document.getElementById('panelTitleFilePath').innerHTML.indexOf(submenu[j].text) > -1) {
7973
submenu[j].className = "open";
8074
parentOpen = true;
8175
}
@@ -100,8 +94,7 @@ function init_php_file_tree() {
10094
var parser = document.createElement('a');
10195
parser.href = items[j].href;
10296
var currentFilePath = parser.search.replace('?f=','').replace('&l=1','');
103-
if((getCookie('tracyFileEditorFilePath') && getCookie('tracyFileEditorFilePath') == currentFilePath) ||
104-
document.getElementById('panelTitleFilePath').innerHTML == currentFilePath) {
97+
if(document.getElementById('panelTitleFilePath').innerHTML == currentFilePath) {
10598
items[j].classList.add("active");
10699
}
107100
}

0 commit comments

Comments
 (0)