- A placeholder is now shown in the gallery.
- The page editors will use the original image url if the display
thumbnail is missing.
For #3142
this.listContainer.addEventListener('event-emit-select-image', this.onImageSelectEvent.bind(this));
+ this.listContainer.addEventListener('error', event => {
+ event.target.src = baseUrl('loading_error.png');
+ }, true);
+
onSelect(this.selectButton, () => {
if (this.callback) {
this.callback(this.lastSelected);
actionInsertImage() {
const cursorPos = this.cm.getCursor('from');
window.ImageManager.show(image => {
+ const imageUrl = image.thumbs.display || image.url;
let selectedText = this.cm.getSelection();
- let newText = "[](" + image.url + ")";
+ let newText = "[](" + image.url + ")";
this.cm.focus();
this.cm.replaceSelection(newText);
this.cm.setCursor(cursorPos.line, cursorPos.ch + newText.length);
}
// Replace the actively selected content with the linked image
+ const imageUrl = image.thumbs.display || image.url;
let html = `<a href="${image.url}" target="_blank">`;
- html += `<img src="${image.thumbs.display}" alt="${image.name}">`;
+ html += `<img src="${imageUrl}" alt="${image.name}">`;
html += '</a>';
win.tinyMCE.activeEditor.execCommand('mceInsertContent', false, html);
}, 'gallery');
tooltip: 'Insert an image',
onclick: function () {
window.ImageManager.show(function (image) {
+ const imageUrl = image.thumbs.display || image.url;
let html = `<a href="${image.url}" target="_blank">`;
- html += `<img src="${image.thumbs.display}" alt="${image.name}">`;
+ html += `<img src="${imageUrl}" alt="${image.name}">`;
html += '</a>';
editor.execCommand('mceInsertContent', false, html);
}, 'gallery');
<div class="image-manager-viewer">
<a href="{{ $image->url }}" target="_blank" rel="noopener" class="block">
- <img src="{{ $image->thumbs['display'] }}"
+ <img src="{{ $image->thumbs['display'] ?? $image->url }}"
alt="{{ $image->name }}"
class="anim fadeIn"
title="{{ $image->name }}">