Skip to content

Commit

Permalink
Allow set extraImageClass
Browse files Browse the repository at this point in the history
  • Loading branch information
cth-inni committed Oct 26, 2021
1 parent 2eb63d2 commit 65bb5ed
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/ChatBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function __construct($newObj=null)
$oriObj = [
'devTools' => false,
'allowForkScript' => null,
'extraImageClass' => null,
'chatHeaderSize' => 'normal',
'mainCastColor' => '#248bf5',
'castColorMode' => 'none', // none, random, palette (15 colors)
Expand Down Expand Up @@ -770,7 +771,12 @@ private function render_image_holder($dialogue)
{
$link = $this->fn_valid_link($dialogue['_context']);
$tempHtml = '<div class="container-image">';
$tempHtml .= '<img src="'.$link.'" alt="Image" style="width:100%;height:100%;">';
$extraClass = '';
if($this->settings->extraImageClass)
{
$extraClass = $this->settings->extraImageClass;
}
$tempHtml .= '<img src="'.$link.'" class="'.$extraClass.'" alt="Image" style="width:100%;height:100%;">';
$tempHtml .= '</div>';
return $tempHtml;
}
Expand Down Expand Up @@ -923,7 +929,12 @@ private function renderRoleSide($dialogue,$direction='left',$color='#CCC')
$context = '';
switch($ext){
case 'image':
$context = '<img src="'.$dataPath.'" alt="Image" style="width:100%;height:100%;">';
$extraClass = '';
if($this->settings->extraImageClass)
{
$extraClass = $this->settings->extraImageClass;
}
$context = '<img src="'.$dataPath.'" class="'.$extraClass.'" alt="Image" style="width:100%;height:100%;">';
break;
case 'mp3':
$context = '<audio controls style="width:100%;min-width:300px;">';
Expand Down

0 comments on commit 65bb5ed

Please sign in to comment.