Skip to content
Closed
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
2 changes: 1 addition & 1 deletion src/main/java/propertyFiles/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ delete=Delete
copyClipboard=Copy to Clipboard
truncateMoreBtn=Read full {0} [+]
truncateMoreTip=Click to read the full {0}.
truncateLessBtn=Collapse {0} [+]
truncateLessBtn=Collapse {0} [-]
truncateLessTip=Click to collapse the {0}.
yes=Yes
no=No
Expand Down
11 changes: 6 additions & 5 deletions src/main/webapp/dataset.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -1790,6 +1790,7 @@
<p:remoteCommand name="datasetSaveCommand" action="#{DatasetPage.save()}" update=":datasetForm,:messagePanel"/>
<!-- END: Publish/Submit for Review Dialogs -->
</h:form>
<c:set var="descriptionText" value="#{DatasetPage.datasetVersionUI.description.datasetFieldType.localeTitle}" />
<script>
//<![CDATA[
$(document).ready(function () {
Expand All @@ -1799,12 +1800,12 @@
function summaryDescTruncation() {
// truncate summary description, contentTruncate function in dv_rebind_bootstrap_ui.js
// add summary desc row id to pass as selector param
var descId = 'dsDescription';
var descId = 'dsDescription td > div';
// add metadata dynamic label text, tooltip text from bundle as param
var truncMoreBtn = '#{of:format1(bundle.truncateMoreBtn, DatasetPage.datasetVersionUI.description.datasetFieldType.localeTitle)}';
var truncMoreTip = '#{of:format1(bundle.truncateMoreTip, DatasetPage.datasetVersionUI.description.datasetFieldType.localeTitle)}';
var truncLessBtn = '#{of:format1(bundle.truncateLessBtn, DatasetPage.datasetVersionUI.description.datasetFieldType.localeTitle)}';
var truncLessTip = '#{of:format1(bundle.truncateLessTip, DatasetPage.datasetVersionUI.description.datasetFieldType.localeTitle)}';
var truncMoreBtn = '#{of:format1(bundle.truncateMoreBtn, descriptionText)}';
var truncMoreTip = '#{of:format1(bundle.truncateMoreTip, descriptionText)}';
var truncLessBtn = '#{of:format1(bundle.truncateLessBtn, descriptionText)}';
var truncLessTip = '#{of:format1(bundle.truncateLessTip, descriptionText)}';

// pass bundle text variabls as params to function
contentTruncate(descId, truncMoreBtn, truncMoreTip, truncLessBtn, truncLessTip);
Expand Down
14 changes: 14 additions & 0 deletions src/main/webapp/dataverse.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -822,12 +822,14 @@
</div>
</h:form>
</p:dialog>
<c:set var="descriptionText" value="#{bundle.description}" />
<script>
//<![CDATA[
var scrollPos=0;
$(document).ready(function () {
initCarousel();
popoverHTML('#{bundle.htmlAllowedTitle}','#{bundle.htmlAllowedTags}');
summarizeDesc();
});
function initCarousel() {
var owl1 = $("#featuredDataversesList");
Expand All @@ -853,6 +855,18 @@
}
$('#featuredDataversesList .item').matchHeight();
}
function summarizeDesc() {
// truncate summary description, contentTruncate function in dv_rebind_bootstrap_ui.js
// add id to pass as selector param
var descId = 'dataverseDesc';
// add metadata dynamic label text, tooltip text from bundle as param
var truncMoreBtn = '#{of:format1(bundle.truncateMoreBtn, descriptionText)}';
var truncMoreTip = '#{of:format1(bundle.truncateMoreTip, descriptionText)}';
var truncLessBtn = '#{of:format1(bundle.truncateLessBtn, descriptionText)}';
var truncLessTip = '#{of:format1(bundle.truncateLessTip, descriptionText)}';
// pass bundle text variables as params to function
contentTruncate(descId, truncMoreBtn, truncMoreTip, truncLessBtn, truncLessTip);
}
function callOnError(){
window.scrollTo(0, 0);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/resources/js/dv_rebind_bootstrap_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function sharrre(){
*/
function contentTruncate(truncSelector, truncMoreBtn, truncMoreTip, truncLessBtn, truncLessTip){
// SELECTOR ID FROM PARAMETERS
$('#' + truncSelector + ' td > div:first-child').each(function () {
$('#' + truncSelector).each(function () {

// add responsive img class to limit width to that of container
$(this).find('img').attr('class', 'img-responsive');
Expand Down