Open icemac opened 5 years ago
Example JS code written by @drfho in zopefoundation/Zope#471
$('table.objectItems').find('tr').each(function(){
$(this).find('th').eq(1).after('<th> </th>');
var random_boolean = Math.random() >= 0.5;
if (random_boolean) {
$(this).find('td').eq(1).after('<td><i title="External Editor" class="far fa-edit"></i></td>');
} else {
$(this).find('td').eq(1).after('<td> </i></td>');
}
});
zopefoundation/Zope#471 requires changes in ExternalEditor as it overwrites the templates to add its link. Maybe it should be switched to do it using JavaScript as it would to drop the existing monkey patch mechanism. It could be included using the mechanism described in https://zope.readthedocs.io/en/latest/ZMI.html#use-custom-icons-and-resources.
Originally posted by @icemac in https://github.com/zopefoundation/Zope/pull/471#issuecomment-461483569