[prev in list] [next in list] [prev in thread] [next in thread]
List: php-doc-cvs
Subject: [DOC-CVS] com doc/base: added "Copy ${en->hash} to Clipboard" feature.: scripts/revcheck.php
From: Yoshinari Takaoka <mumumu () php ! net>
Date: 2021-03-22 17:50:48
Message-ID: php-mail-b7b83d3e92cc48d9a95e63e0b58e16c7909012085 () git ! php ! net
[Download RAW message or body]
Commit: e4d657eb078812becee04135e3c547bf8f9c4783
Author: Yoshinari Takaoka <mumumu@mumumu.org> Tue, 23 Mar 2021 02:50:48 \
+0900
Parents: 820d55ac2318599e137e3f80cfd582f974d37204
Branches: master
Link: http://git.php.net/?p=doc/base.git;a=commitdiff;h=e4d657eb078812becee04135e3c547bf8f9c4783
Log:
added "Copy ${en->hash} to Clipboard" feature.
When we used SVN, we could copy EN-Revision id to translated xml easily because its \
revision id was integer number.
Now we migrated to git, and cannot copy too long revision "hash" from revcheck \
easily. "Copy" hash id button enables us to work with hash between revcheck and xml \
files.
Its implementation uses clipboard.js ( https://clipboardjs.com/ ).
Changed paths:
M scripts/revcheck.php
Diff:
diff --git a/scripts/revcheck.php b/scripts/revcheck.php
index 8129bff13..321cfc362 100644
--- a/scripts/revcheck.php
+++ b/scripts/revcheck.php
@@ -300,6 +300,8 @@ h1 { color: #FFFFFF; }
table { margin-left: auto; margin-right: auto; text-align: left; border-spacing: \
1px; } th { color: white; background-color: #666699; padding: 0.2em; text-align: \
center; vertical-align: middle; } td { padding: 0.2em 0.3em; }
+.oc { white-space: nowrap; overflow: hidden; max-width: 7em; }
+.copy { margin:0; padding: 0; font-size:small; }
.o { white-space: nowrap; overflow: hidden; max-width: 3em; }
.c { text-align: center; }
.r { text-align: right; }
@@ -389,6 +391,17 @@ HTML;
function print_html_footer()
{
print <<<HTML
+
+<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js"></script>
+<script>
+ var clipboard = new ClipboardJS('.btn');
+ clipboard.on('success', function (e) {
+ console.log(e);
+ });
+ clipboard.on('error', function (e) {
+ console.log(e);
+ });
+</script>
</body>
</html>
HTML;
@@ -460,7 +473,12 @@ HTML;
print <<<HTML
<tr class="$bg">
<td class="l">$nm</td>
- <td class="o">$h1</td>
+ <td class="oc">
+ <button class="btn copy" data-clipboard-text="{$en->hash}">
+ Copy
+ </button>
+ $h1
+ </td>
<td class="o">$h2</td>
<td class="r">$s1</td>
<td class="r">$s2</td>
--
PHP Documentation Commits Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic