diff --git a/src/components/Avatar/Avatar.vue b/src/components/Avatar/Avatar.vue new file mode 100644 index 0000000000..905465a881 --- /dev/null +++ b/src/components/Avatar/Avatar.vue @@ -0,0 +1,183 @@ + + + + + + + diff --git a/src/components/Avatar/index.js b/src/components/Avatar/index.js new file mode 100644 index 0000000000..87d4bf91da --- /dev/null +++ b/src/components/Avatar/index.js @@ -0,0 +1,26 @@ +/** + * @copyright Copyright (c) 2018 Julius Härtl + * + * @author Julius Härtl + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +import Avatar from './Avatar' + +export default Avatar +export { Avatar } diff --git a/src/components/PopoverMenu/PopoverMenuItem.vue b/src/components/PopoverMenu/PopoverMenuItem.vue index d70cfc4884..8e83fff902 100644 --- a/src/components/PopoverMenu/PopoverMenuItem.vue +++ b/src/components/PopoverMenu/PopoverMenuItem.vue @@ -26,7 +26,8 @@ - + + {{ item.text }}

{{ item.longtext }}

@@ -100,6 +101,15 @@ export default { return this.item.key ? this.item.key : Math.round(Math.random() * 16 * 1000000).toString(16) + }, + iconIsUrl() { + try { + // eslint-disable-next-line no-unused-vars + const url = new URL(this.item.icon) + return true + } catch (_) { + return false + } } }, methods: { diff --git a/src/components/index.js b/src/components/index.js index eb7857afdf..e00cd1adca 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -24,10 +24,12 @@ import AppNavigation from './AppNavigation' import PopoverMenu from './PopoverMenu' import DatetimePicker from './DatetimePicker' import Multiselect from './Multiselect' +import Avatar from './Avatar' export { AppNavigation, PopoverMenu, DatetimePicker, - Multiselect + Multiselect, + Avatar }