diff --git a/home/inc/class.home_link_portlet.inc.php b/home/inc/class.home_link_portlet.inc.php index a252c546b1..a8daeef5a2 100644 --- a/home/inc/class.home_link_portlet.inc.php +++ b/home/inc/class.home_link_portlet.inc.php @@ -214,6 +214,7 @@ class home_link_portlet extends home_portlet return $actions; } + /** * This portlet accepts files and links * @@ -221,6 +222,11 @@ class home_link_portlet extends home_portlet */ public function accept_drop() { - return array('file','link'); + return array('file', 'link'); + } + + public function get_type() + { + return "et2-portlet-link"; } } diff --git a/home/js/Et2PortletLink.ts b/home/js/Et2PortletLink.ts new file mode 100644 index 0000000000..a3fdf8526b --- /dev/null +++ b/home/js/Et2PortletLink.ts @@ -0,0 +1,37 @@ +import {Et2Portlet} from "../../api/js/etemplate/Et2Portlet/Et2Portlet"; +import shoelace from "../../api/js/etemplate/Styles/shoelace"; +import {css} from "@lion/core"; +import {SelectOption} from "../../api/js/etemplate/Et2Select/FindSelectOptions"; + +/** + * Home portlet to show a list of entries + */ +export class Et2PortletLink extends Et2Portlet +{ + static get styles() + { + return [ + ...shoelace, + ...(super.styles || []), + css` + ` + ] + } + + /** + * Get a list of user-configurable properties + * @returns {[{name : string, type : string, select_options? : [SelectOption]}]} + */ + get portletProperties() : { name : string, type : string, label : string, select_options? : SelectOption[] }[] + { + return [ + ...super.portletProperties, + {name: "entry", type: "et2-link-entry", label: "Entry"} + ] + } +} + +if(!customElements.get("et2-portlet-link")) +{ + customElements.define("et2-portlet-link", Et2PortletLink); +} \ No newline at end of file diff --git a/home/js/app.ts b/home/js/app.ts index b277f5a823..af77ce6290 100644 --- a/home/js/app.ts +++ b/home/js/app.ts @@ -14,6 +14,7 @@ import {etemplate2} from "../../api/js/etemplate/etemplate2"; import {Et2Portlet} from "../../api/js/etemplate/Et2Portlet/Et2Portlet"; import {Et2PortletFavorite} from "./Et2PortletFavorite"; import {loadWebComponent} from "../../api/js/etemplate/Et2Widget/Et2Widget"; +import "./Et2PortletLink"; import "./Et2PortletList"; import "./Et2PortletNote"; import './Et2PortletWeather';