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

Added js+css to get the checksum to display in Bootstrap tooltips #7580

Merged
merged 1 commit into from
Feb 4, 2021
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
24 changes: 16 additions & 8 deletions src/main/webapp/file-info-fragment.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,32 @@
</div>
<!-- CHECKSUM -->
<div class="checksum-block" jsf:rendered="#{!fileMetadata.dataFile.tabularData and !(empty fileMetadata.dataFile.checksumValue)}">
<span class="sr-only #{!editDatafilesPage ? 'checksum-truncate' : ''}" style="margin-right:3px;"
<span class="sr-only #{!editDatafilesPage ? 'checksum-truncate checksum-tooltip' : ''}" style="margin-right:3px;"
data-toggle="tooltip" data-placement="top" data-html="true"
data-clipboard-action="copy"
data-clipboard-text="#{fileMetadata.dataFile.checksumValue}"
title="#{bundle['file.metaData.checksum.copy']} #{fileMetadata.dataFile.checksumValue}">#{fileMetadata.dataFile.checksumType}: #{fileMetadata.dataFile.checksumValue}</span>
<span class="glyphicon glyphicon-copy btn-copy" data-clipboard-action="copy"
data-clipboard-text="#{fileMetadata.dataFile.checksumValue}" title="#{bundle['file.metaData.checksum.copy']} #{fileMetadata.dataFile.checksumValue}"></span>
title="#{bundle['file.metaData.checksum.copy']}&lt;br/&gt;#{fileMetadata.dataFile.checksumValue}">#{fileMetadata.dataFile.checksumType}: #{fileMetadata.dataFile.checksumValue}</span>
<span class="glyphicon glyphicon-copy btn-copy checksum-tooltip"
data-toggle="tooltip" data-placement="top" data-html="true"
data-clipboard-action="copy"
data-clipboard-text="#{fileMetadata.dataFile.checksumValue}"
title="#{bundle['file.metaData.checksum.copy']}&lt;br/&gt;#{fileMetadata.dataFile.checksumValue}"></span>
</div>
<!-- TABULAR VARIABLES, OBSERVATIONS + UNF -->
<div class="unf-block" jsf:rendered="#{fileMetadata.dataFile.tabularData}">
<h:outputText id="fileNumVars" value="#{fileMetadata.dataFile.dataTable.varQuantity} #{bundle['file.metaData.dataFile.dataTab.variables']}, "/>
<h:outputText id="fileNumObs" value="#{fileMetadata.dataFile.dataTable.caseQuantity} #{bundle['file.metaData.dataFile.dataTab.observations']} "/>
<span jsf:id="fileUNF" class="sr-only #{!editDatafilesPage ? 'checksum-truncate' : ''}" style="margin-right:3px;"
<span jsf:id="fileUNF" class="sr-only #{!editDatafilesPage ? 'checksum-truncate checksum-tooltip' : ''}" style="margin-right:3px;"
jsf:rendered="#{!(empty fileMetadata.dataFile.unf)}"
data-toggle="tooltip" data-placement="top" data-html="true"
data-clipboard-action="copy"
data-clipboard-text="#{fileMetadata.dataFile.unf}"
title="#{bundle['file.metaData.checksum.copy']} #{fileMetadata.dataFile.unf}">#{fileMetadata.dataFile.unf}</span>
<span class="glyphicon glyphicon-copy btn-copy" jsf:rendered="#{!(empty fileMetadata.dataFile.unf)}" data-clipboard-action="copy"
data-clipboard-text="#{fileMetadata.dataFile.unf}" title="#{bundle['file.metaData.checksum.copy']} #{fileMetadata.dataFile.unf}"></span>
title="#{bundle['file.metaData.checksum.copy']}&lt;br/&gt;#{fileMetadata.dataFile.unf}">#{fileMetadata.dataFile.unf}</span>
<span class="glyphicon glyphicon-copy btn-copy checksum-tooltip" jsf:rendered="#{!(empty fileMetadata.dataFile.unf)}"
data-toggle="tooltip" data-placement="top" data-html="true"
data-clipboard-action="copy"
data-clipboard-text="#{fileMetadata.dataFile.unf}"
title="#{bundle['file.metaData.checksum.copy']}&lt;br/&gt;#{fileMetadata.dataFile.unf}"></span>
</div>
</div>
<div class="fileDescription small" jsf:rendered="#{!(empty fileMetadata.description)}">
Expand Down
3 changes: 3 additions & 0 deletions src/main/webapp/resources/js/dv_rebind_bootstrap_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ function checksumTruncate(){
}
}
});
$('span.checksum-tooltip').on('inserted.bs.tooltip', function () {
$("body div.tooltip-inner").css("word-break", "break-all");
});
}

function clickCopyClipboard(){
Expand Down
20 changes: 12 additions & 8 deletions src/main/webapp/search-include-fragment.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -614,25 +614,29 @@
<h:outputText value=" - #{SearchIncludeFragment.dataFileSizeDisplay(result.entity)}" rendered="#{!result.harvested}"/>
<h:outputText value=" - " rendered="#{!result.harvested and !SearchIncludeFragment.isTabular(result.entity) and !(empty result.fileChecksumValue)}"/>
<span class="checksum-block" jsf:rendered="#{!result.harvested and !SearchIncludeFragment.isTabular(result.entity) and !(empty result.fileChecksumValue)}">
<span class="sr-only checksum-truncate" style="margin-right:3px;"
<span class="sr-only checksum-truncate checksum-tooltip" style="margin-right:3px;"
data-toggle="tooltip" data-placement="top" data-html="true"
data-clipboard-action="copy"
data-clipboard-text="#{result.fileChecksumValue}"
title="#{bundle['file.metaData.checksum.copy']} #{result.fileChecksumValue}">#{result.fileChecksumType}: #{result.fileChecksumValue}</span>
<span class="glyphicon glyphicon-copy btn-copy"
title="#{bundle['file.metaData.checksum.copy']}&lt;br/&gt;#{result.fileChecksumValue}">#{result.fileChecksumType}: #{result.fileChecksumValue}</span>
<span class="glyphicon glyphicon-copy btn-copy checksum-tooltip"
data-toggle="tooltip" data-placement="top" data-html="true"
data-clipboard-action="copy"
data-clipboard-text="#{result.fileChecksumValue}" title="#{bundle['file.metaData.checksum.copy']} #{result.fileChecksumValue}"></span>
data-clipboard-text="#{result.fileChecksumValue}" title="#{bundle['file.metaData.checksum.copy']}&lt;br/&gt;#{result.fileChecksumValue}"></span>
</span>
<!-- if tabular data file, display number of variables and observations, and unf -->
<span class="unf-block" jsf:rendered="#{!empty SearchIncludeFragment.tabularDataDisplayInfo(result.entity)}">
<h:outputText value=" - #{SearchIncludeFragment.tabularDataDisplayInfo(result.entity)}"/>
<h:outputText value=" - " rendered="#{!empty SearchIncludeFragment.tabularDataUnfDisplay(result.entity)}"/>
<span class="sr-only checksum-truncate" style="margin-right:3px;" jsf:rendered="#{!empty SearchIncludeFragment.tabularDataUnfDisplay(result.entity)}"
<span class="sr-only checksum-truncate checksum-tooltip" style="margin-right:3px;" jsf:rendered="#{!empty SearchIncludeFragment.tabularDataUnfDisplay(result.entity)}"
data-toggle="tooltip" data-placement="top" data-html="true"
data-clipboard-action="copy"
data-clipboard-text="#{SearchIncludeFragment.tabularDataUnfDisplay(result.entity)}"
title="#{bundle['file.metaData.checksum.copy']} #{SearchIncludeFragment.tabularDataUnfDisplay(result.entity)}">#{SearchIncludeFragment.tabularDataUnfDisplay(result.entity)}</span>
<span class="glyphicon glyphicon-copy btn-copy" jsf:rendered="#{!empty SearchIncludeFragment.tabularDataUnfDisplay(result.entity)}"
title="#{bundle['file.metaData.checksum.copy']}&lt;br/&gt;#{SearchIncludeFragment.tabularDataUnfDisplay(result.entity)}">#{SearchIncludeFragment.tabularDataUnfDisplay(result.entity)}</span>
<span class="glyphicon glyphicon-copy btn-copy checksum-tooltip" jsf:rendered="#{!empty SearchIncludeFragment.tabularDataUnfDisplay(result.entity)}"
data-toggle="tooltip" data-placement="top" data-html="true"
data-clipboard-action="copy"
data-clipboard-text="#{SearchIncludeFragment.tabularDataUnfDisplay(result.entity)}" title="#{bundle['file.metaData.checksum.copy']} #{SearchIncludeFragment.tabularDataUnfDisplay(result.entity)}"></span>
data-clipboard-text="#{SearchIncludeFragment.tabularDataUnfDisplay(result.entity)}" title="#{bundle['file.metaData.checksum.copy']}&lt;br/&gt;#{SearchIncludeFragment.tabularDataUnfDisplay(result.entity)}"></span>
</span>
</div>

Expand Down