Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4620b46

Browse filesBrowse files
committed
Append line number to path and replace button with icon
1 parent 057e2f5 commit 4620b46
Copy full SHA for 4620b46

File tree

5 files changed

+21
-17
lines changed
Filter options

5 files changed

+21
-17
lines changed

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
}
3939
4040
if (navigator.clipboard) {
41-
document.querySelectorAll('[data-clipboard-text]').forEach(function(button) {
42-
removeClass(button, 'hidden');
43-
button.addEventListener('click', function() {
44-
navigator.clipboard.writeText(button.getAttribute('data-clipboard-text'));
41+
document.querySelectorAll('[data-clipboard-text]').forEach(function(element) {
42+
removeClass(element, 'hidden');
43+
element.addEventListener('click', function() {
44+
navigator.clipboard.writeText(element.getAttribute('data-clipboard-text'));
4545
})
4646
});
4747
}
@@ -707,10 +707,10 @@
707707
});
708708
}
709709
710-
/* Prevents from disallowing clicks on buttons inside toggles */
711-
var copyToClipboardButtons = toggles[i].querySelectorAll('button');
712-
for (var k = 0; k < copyToClipboardButtons.length; k++) {
713-
addEventListener(copyToClipboardButtons[k], 'click', function(e) {
710+
/* Prevents from disallowing clicks on "copy to clipboard" elements inside toggles */
711+
var copyToClipboardElements = toggles[i].querySelectorAll('span[data-clipboard-text]')
712+
for (var k = 0; k < copyToClipboardElements.length; k++) {
713+
addEventListener(copyToClipboardElements[k], 'click', function(e) {
714714
e.stopPropagation();
715715
});
716716
}

‎src/Symfony/Component/ErrorHandler/Resources/assets/css/exception.css

Copy file name to clipboardExpand all lines: src/Symfony/Component/ErrorHandler/Resources/assets/css/exception.css
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ header .container { display: flex; justify-content: space-between; }
227227
.trace-line a { color: var(--base-6); }
228228
.trace-line .icon { opacity: .4; position: absolute; left: 10px; top: 11px; }
229229
.trace-line .icon svg { fill: var(--base-5); height: 16px; width: 16px; }
230+
.trace-line .icon.icon-copy { left: auto; top: auto; padding-left: 5px; }
230231
.trace-line-header { padding-left: 36px; padding-right: 10px; }
231232
.trace-line-header button { color: var(--color-error); padding-left: 0; padding-right: 0 }
232233

+1Lines changed: 1 addition & 0 deletions
Loading

‎src/Symfony/Component/ErrorHandler/Resources/assets/js/exception.js

Copy file name to clipboardExpand all lines: src/Symfony/Component/ErrorHandler/Resources/assets/js/exception.js
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ Sfjs = (function() {
3030
}
3131

3232
if (navigator.clipboard) {
33-
document.querySelectorAll('[data-clipboard-text]').forEach(function(button) {
34-
removeClass(button, 'hidden');
35-
button.addEventListener('click', function() {
36-
navigator.clipboard.writeText(button.getAttribute('data-clipboard-text'));
33+
document.querySelectorAll('[data-clipboard-text]').forEach(function(element) {
34+
removeClass(element, 'hidden');
35+
element.addEventListener('click', function() {
36+
navigator.clipboard.writeText(element.getAttribute('data-clipboard-text'));
3737
})
3838
});
3939
}
@@ -174,10 +174,10 @@ Sfjs = (function() {
174174
});
175175
}
176176

177-
/* Prevents from disallowing clicks on buttons inside toggles */
178-
var copyToClipboardButtons = toggles[i].querySelectorAll('button');
179-
for (var k = 0; k < copyToClipboardButtons.length; k++) {
180-
addEventListener(copyToClipboardButtons[k], 'click', function(e) {
177+
/* Prevents from disallowing clicks on "copy to clipboard" elements inside toggles */
178+
var copyToClipboardElements = toggles[i].querySelectorAll('span[data-clipboard-text]')
179+
for (var k = 0; k < copyToClipboardElements.length; k++) {
180+
addEventListener(copyToClipboardElements[k], 'click', function(e) {
181181
e.stopPropagation();
182182
});
183183
}

‎src/Symfony/Component/ErrorHandler/Resources/views/trace.html.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/ErrorHandler/Resources/views/trace.html.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
<span class="trace-method"><?= $trace['function']; ?></span>
2626
<?php } ?>
2727
(line <?= $lineNumber; ?>)
28-
<button class="hidden" data-clipboard-text="<?php echo implode(\DIRECTORY_SEPARATOR, $filePathParts); ?>">Copy path</button>
28+
<span class="icon icon-copy hidden" data-clipboard-text="<?php echo implode(\DIRECTORY_SEPARATOR, $filePathParts).':'.$lineNumber; ?>">
29+
<?php echo $this->include('assets/images/icon-copy.svg'); ?>
30+
</span>
2931
</span>
3032
<?php } ?>
3133
</div>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.