Skip to content
This repository has been archived by the owner on Feb 19, 2023. It is now read-only.

fix image description and add image title #47

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
14 changes: 13 additions & 1 deletion admin/theme-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,18 @@ function of_options(){
"std" => "1",
"type" => "checkbox");

$of_options[] = array( "name" => __("Show image title", 'dsframework'),
"desc" => __("Show the media title on top-left of gallery area."),
"id" => "show_image_title",
"std" => "1",
"type" => "checkbox");

$of_options[] = array( "name" => __("Show image description", 'dsframework'),
"desc" => __("Show the media description on top-left of gallery area."),
"id" => "show_image_desc",
"std" => "1",
"type" => "checkbox");

$of_options[] = array( "name" => __("Show share buttons in project description", 'dsframework'),
"desc" => __("Show social media share buttons in the project description box."),
"id" => "project_desc_share_buttons",
Expand All @@ -191,7 +203,7 @@ function of_options(){
"id" => "menu_indented",
"std" => "1",
"type" => "checkbox");

}
}
?>
9 changes: 5 additions & 4 deletions content-ds-gallery.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,15 @@
$img_scale = '';
}

$desc = get_post( $attachment_id_item )->post_content;

$desc = get_ds_option('show_image_desc')==1 ? get_post( $attachment_id_item )->post_content : null;
$title = get_ds_option('show_image_title')==1 ? get_post( $attachment_id_item )->post_title : null;


if(!$alt_attr)
$alt_attr = $image_urls[$j];

$album_data .= "\t\t<li class=\"two-dim-item\"{$video_data}{$img_scale} data-img-desc=\"{$desc}\" data-img-width=\"{$image_widths[$j]}\" data-img-height=\"{$image_heights[$j]}\">";
$album_data .= "\t\t<li class=\"two-dim-item\"{$video_data}{$img_scale} data-img-title=\"{$title}\" data-img-desc=\"{$desc}\" data-img-width=\"{$image_widths[$j]}\" data-img-height=\"{$image_heights[$j]}\">";

$album_data .= "<a href=\"{$image_urls[$j]}\">{$alt_attr}</a>";

$album_data .= "</li>\n";
Expand All @@ -157,4 +158,4 @@
$album_data .= "<p>Empty album</p>";
}
echo $album_data;
?>
?>
2 changes: 1 addition & 1 deletion css-less/two-dim-slider.less
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@
height: auto;
padding: 1.0em;
}
h3.album-title {
h3.img-title {
margin-top: 0;
}
.img-content {
Expand Down
15 changes: 9 additions & 6 deletions js/jquery.slider-pack.1.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -2015,6 +2015,7 @@
path = currItem.find('a').attr('href'),
bWidth = currItem.attr('data-img-width'),
bHeight = currItem.attr('data-img-height'),
title = currItem.attr('data-img-title'),
desc = currItem.attr('data-img-desc');


Expand All @@ -2029,7 +2030,7 @@

if(currImgDesc.length <= 0) {
hasDesc = false;
currImgDesc = $('<div id="img-desc" class="img-desc-block text-block"><div class="info-container"><div class="img-content">'+desc+'</div></div></div>');
currImgDesc = $('<div id="img-desc" class="img-desc-block text-block"><div class="info-container"><h3 class="img-title"></h3><div class="img-content"></div></div></div>');
} else {
hasDesc = true;
}
Expand Down Expand Up @@ -2067,16 +2068,18 @@
.bind('load.tds', self._onLoadingComplete({type:'loaded', loadDataItem:currQueueItem, block:currBlock, img:currImg }))
.bind('error.tds', self._onLoadingComplete({type:'error', loadDataItem:currQueueItem, block:currBlock, img:currImg })).attr({'src': path, 'alt':currItem.find('a').text()});

if (desc.length > 0 || title.length > 0) {
currImgDesc.find('.img-title').text(title);
currImgDesc.find('.img-content').text(desc);
currImgDesc.show();
}else{
currImgDesc.hide();
}

if (!hasDesc) {
currImgDesc.appendTo(currBlock.find('.block-inside'));
}

if (desc.length > 0) {
currImgDesc.show();
}else{
currImgDesc.hide();
}
if (!hasImage) {
currImg.appendTo(currBlock.find('.block-inside'));
}
Expand Down
3 changes: 1 addition & 2 deletions js/jquery.slider-pack.1.1.min.js

Large diffs are not rendered by default.