N°2950 - Fix syntax highlighting (CKEditor) not working on AttributeHTML

- Fix for not supported attributes (HTML)
- Migrate selectors for new backoffice markup
This commit is contained in:
Molkobain
2020-11-04 17:25:25 +01:00
parent fa0bb2b466
commit d76e4255f2
6 changed files with 30 additions and 35 deletions

View File

@@ -145,14 +145,6 @@ EOF
// Then the previous entries if necessary
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>');
@@ -338,14 +330,6 @@ 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
@@ -374,14 +358,6 @@ JS
// 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':
@@ -522,6 +498,13 @@ EOF
if($bRichEditor) {
// MagnificPopup on images
$oOutput->AddJs(InlineImage::FixImagesWidth());
// Trigger highlighter for all code blocks in this caselog
$oOutput->AddJs(<<<JS
$("[data-field-id='{$this->oField->GetId()}'][data-form-path='{$this->oField->GetFormPath()}'] pre").each(function(i, block) {
hljs.highlightBlock(block);
});
JS
);
}
break;
}