Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JENKINS-73971 Extract event handlers in NestedViewsSearch/search-results #48

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
<l:layout title="${%Search for} '${q}'">
<l:side-panel>
<h2><l:icon class="icon-help icon-sm" /> Search help</h2>
<a onclick="document.getElementById('button_expand_2_1').style.display = 'none'; document.getElementById('button_collapse_2_1').style.display = 'inline'; document.getElementById('details_2_1').style.display = 'block'; return false;"
style="font-size: smaller; display: inline" href="#" id="button_expand_2_1">Search History (expand)</a>
<a onclick="document.getElementById('button_collapse_2_1').style.display = 'none';document.getElementById('details_2_1').style.display = 'none';document.getElementById('button_expand_2_1').style.display = 'inline'; return false;"
style="font-size: smaller; display: none" href="#" id="button_collapse_2_1">Search History (collapse)</a>
<a style="font-size: smaller; display: inline" href="#" id="button_expand_2_1">Search History (expand)</a>
<a style="font-size: smaller; display: none" href="#" id="button_collapse_2_1">Search History (collapse)</a>
<st:adjunct includes="hudson.plugins.nested_view.NestedViewsSearch.searchscripts"/>
<div style="display: none" id="details_2_1">
<ol>
<j:forEach var="hist" items="${it.getHistory()}">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// <![CDATA[
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CDATA is not needed here. or on line 16.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless you insists, I will keep it there. I like when code is somehow wrapped, and on contrary I do nt ot like the JS's myNameSapce = function () { notation... Anyway.. Yah my bad habit:(

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, no big deal either way.


function nvwp_showHide_button_2_1_show(event) {
document.getElementById('button_expand_2_1').style.display = 'none';
document.getElementById('button_collapse_2_1').style.display = 'inline';
document.getElementById('details_2_1').style.display = 'block';
event.preventDefault();
}
function nvwp_showHide_button_2_1_hide(event) {
document.getElementById('button_collapse_2_1').style.display = 'none';
document.getElementById('details_2_1').style.display = 'none';
document.getElementById('button_expand_2_1').style.display = 'inline';
event.preventDefault();
}

const exEl = document.getElementById("button_expand_2_1");
exEl.addEventListener("click", nvwp_showHide_button_2_1_show);

const colEl = document.getElementById("button_collapse_2_1");
colEl.addEventListener("click", nvwp_showHide_button_2_1_hide);



// ]]>