Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions browser/images/dark/lc_framedialog.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions browser/images/dark/lc_removetableof.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions browser/images/lc_framedialog.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions browser/images/lc_removetableof.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 21 additions & 1 deletion browser/src/app/LOUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,14 @@ class LOUtil {
public static onlydarkModeItems: string[] = ['invertbackground'];

// Common images used in all modes, so the default one will be used.
public static commonItems: string[] = ['serverauditok', 'serverauditerror'];
public static commonItems: string[] = [
'serverauditok',
'serverauditerror',
'compact_customanimation',
'slideshow-exit',
'slideshow-slideNext',
'slideshow-slidePrevious',
];

// Helper function to strip '.svg' suffix and 'lc_' prefix.
public static stripName(name: string): string {
Expand Down Expand Up @@ -331,6 +338,13 @@ class LOUtil {
cleanName = encodeURIComponent(cleanName).replace(/%/g, '');
cleanName = cleanName.toLowerCase();
}

// Skip icon lookup for numeric-only IDs (JSDialog artifacts like 1, 5, 65535)
if (/^\d+$/.test(cleanName)) return '';

// Skip icon lookup for overflow button pseudo-commands
if (cleanName.startsWith('overflow-button-')) return '';

var iconURLAliases: IconNameMap = {
// lc_closemobile.svg is generated when loading in NB mode then
// switch to compact mode: 1st hidden element in the top toolbar
Expand Down Expand Up @@ -550,6 +564,12 @@ class LOUtil {
graphicfiltersobel: 'graphicfiltersobel',
effects: 'pictureeffectsmenu',
fitwidthzoom: 'pagewidth',
'exportas-pdf': 'exportpdf',
'exportas-epub': 'exportepub',
'fullscreen-drawing': 'presentation',
endnotedialog: 'footnotedialog',
updateallindexes: 'insertmultiindex',
formatframemenu: 'framedialog',
};
if (iconURLAliases[cleanName]) {
cleanName = iconURLAliases[cleanName];
Expand Down
9 changes: 7 additions & 2 deletions browser/src/control/Control.JSDialogBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1830,8 +1830,13 @@ window.L.Control.JSDialogBuilder = window.L.Control.extend({
buttonImage.src = data.image;
}
else {
buttonImage = window.L.DomUtil.create('img', '', button);
app.LOUtil.setImage(buttonImage, app.LOUtil.getIconNameOfCommand(data.command), builder.map);
var iconName = app.LOUtil.getIconNameOfCommand(data.command);
if (iconName) {
buttonImage = window.L.DomUtil.create('img', '', button);
app.LOUtil.setImage(buttonImage, iconName, builder.map);
} else {
buttonImage = false;
}
}
} else {
buttonImage = false;
Expand Down