mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
N°1164 #1491 - Fix syntax code highlighting display in CaseLog/HTML fields
This commit is contained in:
@@ -150,6 +150,14 @@ EOF
|
||||
if ($sFieldClass === 'Combodo\\iTop\\Form\\Field\\CaseLogField')
|
||||
{
|
||||
$this->PreparingCaseLogEntries($oOutput);
|
||||
// Trigger highlighter for all code blocks in this caselog
|
||||
$oOutput->AddJs(
|
||||
<<<JS
|
||||
$("[data-field-id='{$this->oField->GetId()}'][data-form-path='{$this->oField->GetFormPath()}'] .caselog_field_entry_content > pre").each(function(i, block) {
|
||||
hljs.highlightBlock(block);
|
||||
});
|
||||
JS
|
||||
);
|
||||
}
|
||||
$oOutput->AddHtml('</div>');
|
||||
|
||||
@@ -349,6 +357,14 @@ EOF
|
||||
$oOutput->AddHtml('<div class="form_field_control">');
|
||||
$oOutput->AddHtml('<div class="form-control-static">')->AddHtml($this->oField->GetDisplayValue(), false)->AddHtml('</div>');
|
||||
$oOutput->AddHtml('</div>');
|
||||
// Trigger highlighter for all code blocks in this html text field
|
||||
$oOutput->AddJs(
|
||||
<<<JS
|
||||
$("[data-field-id='{$this->oField->GetId()}'][data-form-path='{$this->oField->GetFormPath()}'] .HTML pre").each(function(i, block) {
|
||||
hljs.highlightBlock(block);
|
||||
});
|
||||
JS
|
||||
);
|
||||
}
|
||||
|
||||
// Adding hidden input
|
||||
@@ -378,6 +394,14 @@ EOF
|
||||
|
||||
// Closing container
|
||||
$oOutput->AddHtml('</div>');
|
||||
// Trigger highlighter for all code blocks in this caselog
|
||||
$oOutput->AddJs(
|
||||
<<<JS
|
||||
$("[data-field-id='{$this->oField->GetId()}'][data-form-path='{$this->oField->GetFormPath()}'] .caselog_field_entry_content pre").each(function(i, block) {
|
||||
hljs.highlightBlock(block);
|
||||
});
|
||||
JS
|
||||
);
|
||||
break;
|
||||
|
||||
case 'Combodo\\iTop\\Form\\Field\\BlobField':
|
||||
|
||||
Reference in New Issue
Block a user