diff options
| author | Florian Hahn <flo@fhahn.com> | 2019-01-25 17:48:31 +0000 |
|---|---|---|
| committer | Florian Hahn <flo@fhahn.com> | 2019-01-25 17:48:31 +0000 |
| commit | fd7ee479401b069bc14dd7b604fd6e1da31dc95e (patch) | |
| tree | 1aaa776ffb95facb83131a358bb0b5fe1997fcb0 /llvm/test/tools/opt-viewer/Outputs/basic/basic_or.c.html | |
| parent | 599c0bc93b14db810c91c2edcc467603fc627581 (diff) | |
| download | bcm5719-llvm-fd7ee479401b069bc14dd7b604fd6e1da31dc95e.tar.gz bcm5719-llvm-fd7ee479401b069bc14dd7b604fd6e1da31dc95e.zip | |
[opt-viewer] Add javascript to expand/hide full message for multiline remarks.
This patch adds support for displaying remarks with multiple
lines. For such remarks, it creates a hidden div
containing the message's lines except the first one in a <pre>
tag. It also prepends a link (with '+' as text) to the regular remark
line. This link can be used to show/hide the div containing the
full remark.
In combination with D57159, this allows for better displaying of
multiline remarks in the html pages generated by opt-viewer.
The Javascript is very simple and should be supported by any recent
major browser.
Reviewers: hfinkel, anemet, thegameg, serge-sans-paille
Reviewed By: anemet
Differential Revision: https://reviews.llvm.org/D57167
llvm-svn: 352223
Diffstat (limited to 'llvm/test/tools/opt-viewer/Outputs/basic/basic_or.c.html')
| -rw-r--r-- | llvm/test/tools/opt-viewer/Outputs/basic/basic_or.c.html | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/llvm/test/tools/opt-viewer/Outputs/basic/basic_or.c.html b/llvm/test/tools/opt-viewer/Outputs/basic/basic_or.c.html index 225ebabdbde..2b0baf942b5 100644 --- a/llvm/test/tools/opt-viewer/Outputs/basic/basic_or.c.html +++ b/llvm/test/tools/opt-viewer/Outputs/basic/basic_or.c.html @@ -4,6 +4,23 @@ <meta charset="utf-8" /> <head> <link rel='stylesheet' type='text/css' href='style.css'> +<script type="text/javascript"> +/* Simple helper to show/hide the expanded message of a remark. */ +function toggleExpandedMessage(e) { + var FullTextElems = e.parentElement.parentElement.getElementsByClassName("full-info"); + if (!FullTextElems || FullTextElems.length < 1) { + return false; + } + var FullText = FullTextElems[0]; + if (FullText.style.display == 'none') { + e.innerHTML = '-'; + FullText.style.display = 'block'; + } else { + e.innerHTML = '+'; + FullText.style.display = 'none'; + } +} +</script> </head> <body> <div class="centered"> @@ -106,6 +123,20 @@ </tr> <tr> +<td></td> +<td></td> +<td class="column-entry-green">multiline</td> +<td><pre style="display:inline"> </pre><span class="column-entry-yellow"><a style="text-decoration: none;" href="" onclick="toggleExpandedMessage(this); return false;">+</a> This is a remark with </span> +<div class="full-info" style="display:none;"> + <div class="col-left"><pre style="display:inline"> </pre></div> + <div class="expanded col-left"><pre>multiple + lines +</pre></div> +</div></td> +<td class="column-entry-yellow">Test</td> +</tr> + +<tr> <td><a name="L11">11</a></td> <td></td> <td></td> |

