using now Birgit's substitution list for images before looking at the usual places

This commit is contained in:
ralf 2024-08-25 11:48:19 +02:00
parent dacd2e0c94
commit 3e0cce403e
4 changed files with 310 additions and 10 deletions

View File

@ -101,7 +101,7 @@
</et2-vbox>
</row>
<row class="$row_cont[class] $row_cont[cat_id]" valign="top">
<et2-image align="center" label="$row_cont[type_label]" src="$row_cont[type]" noLang="1"/>
<et2-image align="center" label="$row_cont[type_label]" src="$row_cont[type]" noLang="1" style="font-size: 200%"/>
<et2-vbox id="${row}[id]">
<et2-description id="${row}[line1]" noLang="1"></et2-description>
<et2-description id="${row}[line2]" noLang="1"></et2-description>

View File

@ -58,13 +58,17 @@ export class Et2Image extends Et2Widget(LitElement) implements et2_IDetachedDOM
{
// Hide if no valid image
if (this._img) this._img.src = '';
this.className = '';
this.className = this.title = '';
return;
}
const bootstrap = url.match(/\/node_modules\/bootstrap-icons\/icons\/([^.]+)\.svg/);
if (bootstrap && !this._img)
{
this.className = 'bi-'+bootstrap[1];
if (this.statustext || this.label)
{
this.title = this.statustext || this.label;
}
return;
}
// change between bootstrap and regular img
@ -165,6 +169,7 @@ export class Et2Image extends Et2Widget(LitElement) implements et2_IDetachedDOM
if (bootstrap)
{
this.className = 'bi-'+bootstrap[1];
this.title = this.statustext || this.label;
return html``;
}
this.className = '';

View File

@ -93,16 +93,29 @@ egw.extend('images', egw.MODULE_GLOBAL, function()
{
return this.webserverUrl+images['vfs'][_name];
}
tries[_app + (_app == 'phpgwapi' ? " (current app)" : "")] = _name;
if (typeof images[_app] != 'undefined' && typeof images[_app][_name] == 'string')
if (_app !== 'api')
{
return this.webserverUrl+images[_app][_name];
tries['global'] = _app+'/'+_name;
if (typeof images['global'] !== 'undefined' && typeof images['global'][_app+'/'+_name] === 'string' &&
typeof images['bootstrap'] !== 'undefined' && typeof images['bootstrap'][images['global'][_app+'/'+_name]] == 'string')
{
return this.webserverUrl+images['bootstrap'][images['global'][_app+'/'+_name]];
}
}
tries['global'] = _name;
if (typeof images['global'] !== 'undefined' && typeof images['global'][_name] === 'string')
{
if (typeof images['bootstrap'] !== 'undefined' && typeof images['bootstrap'][_name] == 'string')
{
return this.webserverUrl+images['bootstrap'][_name];
}
return this.image(images['global'][_name], _app);
}
tries[_app + (_app == 'phpgwapi' ? " (current app)" : "")] = _name;
if (typeof images[_app] != 'undefined' && typeof images[_app][_name] == 'string')
{
return this.webserverUrl+images[_app][_name];
}
tries['bootstrap'] = _name;
if (typeof images['bootstrap'] !== 'undefined' && typeof images['bootstrap'][_name] == 'string')
{

View File

@ -27,11 +27,293 @@ class Image
* @var string[]
*/
static $global2bootstrap = [
'edit' => 'pencil-fill',
'save' => 'api/save', // as bootstrap's save would shadow api/save and is not fitting
'apply' => 'floppy',
'cancel' => 'x-square',
'delete' => 'trash3',
'5_day_view' => '5-square',
'7_day_view' => '7-square',
//'about' => 'about',
'accept_call' => 'telephone',
'add' => 'plus-circle',
'agt_action_fail' => 'slash-circle',
'agt_action_success' => 'check-lg',
'agt_reload' => 'arrow-clockwise',
//'alarm' => 'alarm',
'apply' => 'floppy',
'apps' => 'grid-3x3-gap',
//'archive' => 'archive',
'arrow_down' => 'caret-down-fill',
'arrow_left' => 'caret-left-fill',
'arrow_right' => 'caret-right-fill',
'arrow_up' => 'caret-up-fill',
'back' => 'forward',
'bullet' => 'record-circle',
'cake' => 'cake2',
'calendar' => 'calendar3',
'call' => 'telephone',
'cancel' => 'x-square',
'cancelled' => 'x-lg',
'check' => 'check-lg',
'close' => 'x-lg',
'configure' => 'gear',
'continue' => 'forward',
//'copy' => 'copy',
'cti_phone' => 'telephone',
'cursor_editable' => 'copy',
'darkmode_off' => 'moon-fill',
'darkmode_on' => 'brightness-high',
'datepopup' => 'calendar3',
'delete' => 'trash3',
'deleted' => 'trash3',
'dialog_error' => 'exclamation-circle',
'dialog_help' => 'question-circle',
'dialog_info' => 'info-circle',
'dialog_warning' => 'exclamation-triangle',
'discard' => 'arrow-counterclockwise',
'done' => 'check-lg',
'dots' => 'three-dots-vertical',
'down' => 'forward',
//'download' => 'download',
'drop' => 'paperclip',
'edit' => 'pencil-fill',
'edit_leaf' => 'pencil-square',
'editpaste' => 'clipboard2-data',
'export' => 'download',
'fav_filter' => 'star',
'favorites' => 'star-fill',
'filesave' => 'folder-symlink',
'filter' => 'funnel',
'folder' => 'folder2',
'folder_management' => 'folder-check',
'generate_password' => 'key',
'goup' => 'forward',
'group' => 'people',
'hangup' => 'telephone-minus',
'help' => 'question-circle',
'home' => 'house-door',
'ical' => 'box-arrow-down',
'import' => 'box-arrow-up',
'infolog_task' => 'file-earmark-font',
'internet' => 'globe2',
'landscape' => 'tablet-landscape',
'language' => 'translate',
'leaf' => 'file-earmark',
'link' => 'link-45deg',
//'list' => 'list',
'list_alt' => 'list',
//'lock' => 'lock',
'logout' => 'power',
'menu_active' => 'forward',
'menu_list' => 'list-task',
'milestone' => 'check2-circle',
'mime128_application_pdf' => 'file-earmark-pdf',
'mime128_directory' => 'folder2',
'minus' => 'dash-lg',
'month' => 'calendar-month',
'mouse_scroll_lr' => 'arrows',
'mouse_scroll_ud' => 'arrow-down-up',
'move' => 'scissors',
'navbar' => 'app',
'new' => 'file-earmark-plus',
'new_leaf' => 'file-earmark-plus',
'next' => 'forward',
'notification_message' => 'bell',
'notification_message_active' => 'bell',
'offer' => 'question-square',
'password' => 'key',
'password_old' => 'key-fill',
'personal' => 'person',
'phone' => 'telephone',
'planner' => 'people',
'planner_category' => 'tags',
'plus' => 'plus-lg',
'portrait' => 'tablet',
'preferences' => 'gear',
'previous' => 'forward',
'print' => 'printer',
'prio_high' => 'arrow-up-circle',
'prio_low' => 'arrow-down-circle',
'priority' => 'dash-circle',
'private' => 'key',
'reload' => 'arrow-clockwise',
'save' => 'api/save', // @todo: as bootstrap's save would shadow api/save and is not fitting
'save_new' => 'api/save_new', // @todo
'save_zip' => 'file-zip',
//'search' => 'search',
'security-update' => 'shield-exclamation',
'setup' => 'gear',
//'share' => 'share',
'single' => 'person',
'symlink' => 'reply',
'tag_message' => 'tag',
'tentative' => 'clock-history',
'timestamp' => 'magic',
//'unlock' => 'unlock',
'up' => 'forward',
'update' => 'shield-exclamation',
'upload' => 'box-arrow-up',
'url' => 'link-45deg',
'users' => 'people',
'view' => 'search',
'visibility' => 'eye',
'visibility_off' => 'eye-slash',
'addressbook/accounts' => 'person-gear',
'addressbook/advanced-search' => 'zoom-in',
'addressbook/group' => 'people',
'addressbook/private' => 'key',
'calendar/1_day_view' => '1-square',
'calendar/4_day_view' => '4-square',
'calendar/accepted' => 'check-lg',
'calendar/day' => '1-square',
'calendar/list_view' => 'list',
'calendar/month_view' => 'calendar-month',
'calendar/multiweek_view' => 'card-list',
'calendar/needs-action' => 'question-circle',
'calendar/next' => 'forward',
'calendar/nonblocking' => 'ban',
'calendar/planner_category_view' => 'tags',
'calendar/planner_view' => 'people',
'calendar/previous' => 'forward',
'calendar/private' => 'key',
'calendar/recur' => 'arrow-clockwise',
'calendar/rejected' => 'x-circle',
'calendar/single' => 'person',
'calendar/tentative' => 'clock-history',
'calendar/today' => 'calendar-event',
'calendar/videoconference' => 'camera-video',
'calendar/week_view' => '7-square',
'collabora/curly_brackets_icon' => 'braces-asterisk',
'dhtmlxtree/close' => 'caret-down',
'dhtmlxtree/folderClosed' => 'folder2',
'dhtmlxtree/folderOpen' => 'folder2-open',
'dhtmlxtree/kfm_home' => 'upload',
'dhtmlxtree/MailFolderClosed' => 'folder2',
'dhtmlxtree/MailFolderDrafts' => 'floppy',
'dhtmlxtree/MailFolderHam' => 'envelope-check',
'dhtmlxtree/MailFolderJunk' => 'exclamation-octagon',
'dhtmlxtree/MailFolderOutbox' => 'upload',
'dhtmlxtree/MailFolderPlain' => 'envelope',
'dhtmlxtree/MailFolderSent' => 'send',
'dhtmlxtree/MailFolderTemplates' => 'file-earmark-text',
'dhtmlxtree/MailFolderTrash' => 'trash',
'dhtmlxtree/open' => 'caret-up',
'dhtmlxtree/thunderbird' => 'house-door',
'filemanager/button_createdir' => 'folder-plus',
'filemanager/editpaste' => 'clipboard-check',
'filemanager/folder_closed' => 'folder2',
'filemanager/folder_closed_big' => 'folder2',
'filemanager/folder_open' => 'folder2-open',
'filemanager/gohome' => 'house-door',
'filemanager/list_row' => 'list',
'filemanager/list_tile' => 'grid-3x3-gap',
'filemanager/mailpaste' => 'envelope-check',
'filemanager/upload' => 'upload',
'images/blocks' => 'boxes',
'images/books' => 'journals',
'images/charts' => 'bar-chart-line',
'images/clipboard' => 'clipboard-check',
'images/communications' => 'pc-display',
'images/configure' => 'tools',
'images/connect' => 'plug',
'images/finance' => 'bank',
'images/gear' => 'gear',
'images/hardware' => 'motherboard',
'images/help' => 'question-circle',
'images/idea' => 'lightbulb',
'images/important' => 'exclamation-triangle',
'images/info' => 'info-circle',
'images/linux' => 'ubuntu',
'images/mac' => 'apple',
'images/open_book' => 'book',
'images/open_folder' => 'folder2-open',
'images/people' => 'people',
'images/person' => 'person',
'images/screen' => 'display',
'images/security' => 'lock',
'images/star' => 'star',
'images/stats' => 'calculator',
'images/table' => 'table',
'images/winclose' => 'x-square',
'images/windows' => 'windows',
'images/world' => 'globe-europe-africa',
'importexport/export' => 'download',
'importexport/import' => 'upload',
'infolog/archive' => 'archive',
'infolog/billed' => 'currency-euro',
'infolog/call' => 'telephone',
'infolog/cancelled' => 'x-square',
'infolog/deleted' => 'trash3',
'infolog/done' => 'check-lg',
'infolog/done_all' => 'check-all',
'infolog/email' => 'envelope',
'infolog/nonactive' => 'slash-circle',
'infolog/not-started' => 'pause-circle',
'infolog/note' => 'pencil-square',
'infolog/phone' => 'phone-vibrate',
'infolog/status' => 'question-square',
'infolog/task' => 'check-square',
'infolog/template' => 'file-earmark-text',
'infolog/will-call' => 'telephone-plus',
'mail/attach' => 'paperclip',
'mail/certified_message' => 'envelope-check',
'mail/fileexport' => 'floppy',
'mail/filter' => 'funnel',
'mail/htmlmode' => 'code-slash',
'mail/kmmsgdel' => 'x-lg',
'mail/kmmsgnew' => 'envelope-plus',
'mail/kmmsgread' => 'envelope-open',
'mail/kmmsgunseen' => 'envelope-fill',
'mail/mail_forward' => 'forward',
'mail/mail_forward_attach' => 'envelope-arrow-up',
'mail/mail_label1' => 'lightning',
'mail/mail_label2' => 'key',
'mail/mail_label3' => 'person',
'mail/mail_label4' => 'gear',
'mail/mail_label5' => 'clock',
'mail/mail_reply' => 'reply',
'mail/mail_replyall' => 'reply-all',
'mail/mail_send' => 'send',
'mail/notification' => 'bell',
'mail/prio_high' => 'exclamation-diamond',
'mail/prio_low' => 'arrow-down-square',
'mail/read_flagged_small' => 'flag',
'mail/smime_encrypt' => 'building-lock',
'mail/smime_sign' => 'database-lock',
'mail/source' => 'code',
'mail/spam_list_domain_add' => 'house-add',
'mail/spam_list_domain_remove' => 'house-dash',
'mail/spam_list_remove' => 'envelope-dash',
'mail/tag_message' => 'tag',
'mail/textmode' => 'fonts',
'mail/unread_flagged_small' => 'flag-fill',
'mail/whitelist' => 'envelope-check',
'projectmanager/download' => 'download',
'projectmanager/milestone' => 'check2-circle',
'projectmanager/pricelist' => 'currency-euro',
'status/videoconference' => 'camera-video',
'status/videoconference_call' => 'camera-video-off',
'status/videoconference_join' => 'node-plus',
'timesheet/pause' => 'pause-fill',
'timesheet/pause-orange' => 'pause-fill',
'timesheet/play' => 'play-fill',
'timesheet/play-blue' => 'play-fill',
'timesheet/stop' => 'stop-fill',
'topmenu_items/access' => 'lock',
'topmenu_items/category' => 'tag',
'topmenu_items/home' => 'house-door',
'topmenu_items/logout' => 'power',
'topmenu_items/mobile/back' => 'arrow-left',
'topmenu_items/mobile/cancelled' => 'x-lg',
'topmenu_items/mobile/check' => 'check-lg',
'topmenu_items/mobile/checkbox' => 'square',
'topmenu_items/mobile/menu' => 'list',
'topmenu_items/mobile/menu_active' => 'arrow-left',
'topmenu_items/mobile/notify_off' => 'bell-slash',
'topmenu_items/mobile/notify_on' => 'bell',
'topmenu_items/mobile/plus_white' => 'plus-lg',
'topmenu_items/mobile/save' => 'floppy',
'topmenu_items/mobile/search' => 'search',
'topmenu_items/mobile/star' => 'star',
'topmenu_items/password' => 'key',
'topmenu_items/search' => 'search',
'topmenu_items/setup' => 'gear',
];
/**
* Searches a appname, template and maybe language and type-specific image