From c37934f8982dc52a8859fdae8f850f5a185d2719 Mon Sep 17 00:00:00 2001 From: Moritz Dieing <63721811+moritzdieing@users.noreply.github.com> Date: Thu, 28 Jan 2021 12:16:10 +0100 Subject: [PATCH 1/2] UpperBar erweitert --- frontend/styles/view/main/upper-bar.css | 26 +++ package.json | 10 +- pnpm-lock.yaml | 188 ------------------ .../edu/kit/typicalc/view/main/UpperBar.java | 31 ++- .../language/translation_de.properties | 3 +- 5 files changed, 59 insertions(+), 199 deletions(-) create mode 100644 frontend/styles/view/main/upper-bar.css diff --git a/frontend/styles/view/main/upper-bar.css b/frontend/styles/view/main/upper-bar.css new file mode 100644 index 0000000..62172dc --- /dev/null +++ b/frontend/styles/view/main/upper-bar.css @@ -0,0 +1,26 @@ +#header { + height: var(--lumo-size-xl); +} + +#header img { + border-radius: 50%; + height: var(--lumo-size-s); + margin-left: auto; + margin-right: var(--lumo-space-m); + overflow: hidden; + background-color: var(--lumo-contrast); +} + +#viewTitle { + font-size: var(--lumo-font-size-l); + margin-right: auto; + cursor: pointer; +} + +#icon { + margin-left: auto; + margin-right: 20px; +} + + + diff --git a/package.json b/package.json index 45b7254..0771879 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,7 @@ "@vaadin/router": "1.7.2", "@vaadin/vaadin-app-layout": "2.2.0", "@vaadin/vaadin-button": "2.4.0", - "@vaadin/vaadin-charts": "7.0.0", "@vaadin/vaadin-combo-box": "5.4.7", - "@vaadin/vaadin-confirm-dialog": "1.3.0", "@vaadin/vaadin-custom-field": "1.3.0", "@vaadin/vaadin-details": "1.2.0", "@vaadin/vaadin-dialog": "2.5.2", @@ -32,10 +30,7 @@ "@vaadin/form": "./target/flow-frontend/form", "@vaadin/vaadin-avatar": "1.0.3", "open": "^7.2.1", - "@vaadin/vaadin-crud": "1.3.0", - "@vaadin/vaadin-cookie-consent": "1.2.0", "@vaadin/vaadin-upload": "4.4.1", - "@vaadin/vaadin-board": "2.2.0", "@vaadin/vaadin-date-time-picker": "1.4.0", "@vaadin/vaadin-login": "1.2.0", "@vaadin/vaadin-accordion": "1.2.0", @@ -44,11 +39,8 @@ "@vaadin/vaadin-context-menu": "4.5.0", "@vaadin/vaadin-tabs": "3.2.0", "@vaadin/vaadin-radio-button": "1.5.1", - "@vaadin/vaadin-rich-text-editor": "1.3.0", "lit-element": "2.3.1", "@vaadin/vaadin-core-shrinkwrap": "18.0.5", - "@vaadin/vaadin-grid-pro": "2.2.2", - "@vaadin/vaadin-shrinkwrap": "18.0.5", "@vaadin/vaadin-date-picker": "4.4.1" }, "devDependencies": { @@ -149,6 +141,6 @@ "lit-css-loader": "0.0.4", "extract-loader": "5.1.0" }, - "hash": "04462da9d778f9542e7732e145ac4b9dbdea38fe120e57367afe34d62fd3024a" + "hash": "62511e127eb6b94b147718eaf87963a72562a63efa45b11debd35ee61e3cd13a" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e2c3936..ebbcc78 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,16 +8,11 @@ dependencies: '@vaadin/vaadin-accordion': 1.2.0 '@vaadin/vaadin-app-layout': 2.2.0 '@vaadin/vaadin-avatar': 1.0.3 - '@vaadin/vaadin-board': 2.2.0 '@vaadin/vaadin-button': 2.4.0 - '@vaadin/vaadin-charts': 7.0.0 '@vaadin/vaadin-checkbox': 2.5.0 '@vaadin/vaadin-combo-box': 5.4.7 - '@vaadin/vaadin-confirm-dialog': 1.3.0 '@vaadin/vaadin-context-menu': 4.5.0 - '@vaadin/vaadin-cookie-consent': 1.2.0 '@vaadin/vaadin-core-shrinkwrap': 18.0.5 - '@vaadin/vaadin-crud': 1.3.0 '@vaadin/vaadin-custom-field': 1.3.0 '@vaadin/vaadin-date-picker': 4.4.1 '@vaadin/vaadin-date-time-picker': 1.4.0 @@ -25,7 +20,6 @@ dependencies: '@vaadin/vaadin-dialog': 2.5.2 '@vaadin/vaadin-form-layout': 2.3.0 '@vaadin/vaadin-grid': 5.7.7 - '@vaadin/vaadin-grid-pro': 2.2.2 '@vaadin/vaadin-icons': 4.3.2 '@vaadin/vaadin-item': 2.3.0 '@vaadin/vaadin-list-box': 1.4.0 @@ -37,9 +31,7 @@ dependencies: '@vaadin/vaadin-ordered-layout': 1.4.0 '@vaadin/vaadin-progress-bar': 1.3.0 '@vaadin/vaadin-radio-button': 1.5.1 - '@vaadin/vaadin-rich-text-editor': 1.3.0 '@vaadin/vaadin-select': 2.4.0 - '@vaadin/vaadin-shrinkwrap': 18.0.5 '@vaadin/vaadin-split-layout': 4.3.0 '@vaadin/vaadin-tabs': 3.2.0 '@vaadin/vaadin-text-field': 2.8.2 @@ -1093,15 +1085,6 @@ packages: dev: false resolution: integrity: sha512-XIzYQLXqesW3V4XFecPAm5iC7MeBQSlYDKTV5ULLeJu7IJuVYzfm/EukU80WFZ2k7bPgSK8ICkhecK/tv0N1iQ== - /@vaadin/vaadin-board/2.2.0: - dependencies: - '@polymer/iron-resizable-behavior': 3.0.1 - '@polymer/polymer': 3.2.0 - '@vaadin/vaadin-element-mixin': 2.4.2 - '@vaadin/vaadin-license-checker': 2.1.2 - dev: false - resolution: - integrity: sha512-O4C/tY5MSFKpuHdvMD/W9r1AizstPnI5RpWN7ghbYoWs3FxZ+RRr9SfHHr1r94W6rSeaZsbaFjaaCPCncv/aAQ== /@vaadin/vaadin-button/2.4.0: dependencies: '@polymer/polymer': 3.2.0 @@ -1113,16 +1096,6 @@ packages: dev: false resolution: integrity: sha512-C94F07OOb5Ciq2BY4CklIQG+WJFA6QoTFDQl8JJloJgPI12b9kmyP8uRgfq4VAHHusqKqIvA8AB6VZuGg5lagg== - /@vaadin/vaadin-charts/7.0.0: - dependencies: - '@polymer/polymer': 3.2.0 - '@vaadin/vaadin-element-mixin': 2.4.2 - '@vaadin/vaadin-license-checker': 2.1.2 - '@vaadin/vaadin-themable-mixin': 1.6.2 - highcharts: 8.1.2 - dev: false - resolution: - integrity: sha512-CErXOyOUhD2wmIBYOVRTMgS6hAlFUMbT3frIgumiZZOb8MWvznGqiU2I+9/tb1V4RFEXRNjCGwCzWwp+K7LIUQ== /@vaadin/vaadin-checkbox/2.5.0: dependencies: '@polymer/polymer': 3.2.0 @@ -1152,20 +1125,6 @@ packages: dev: false resolution: integrity: sha512-1ETpu5okrc8HFr7zOtQP1i4o1ySYheWhhInic2XdhUfB9Lvj8MS6iY+BLcQupOYHD8OwS8wvpH2hKxUe1ST9jw== - /@vaadin/vaadin-confirm-dialog/1.3.0: - dependencies: - '@polymer/polymer': 3.2.0 - '@vaadin/vaadin-button': 2.4.0 - '@vaadin/vaadin-dialog': 2.5.2 - '@vaadin/vaadin-element-mixin': 2.4.2 - '@vaadin/vaadin-license-checker': 2.1.2 - '@vaadin/vaadin-lumo-styles': 1.6.1 - '@vaadin/vaadin-material-styles': 1.3.2 - '@vaadin/vaadin-overlay': 3.5.1 - '@vaadin/vaadin-themable-mixin': 1.6.2 - dev: false - resolution: - integrity: sha512-di4hp8Ca0mGoNVDWqI9Gl/G2TXl/cKfy+ApR5co+m95+uC7wpGeocQMWuqaoTZfOmR/VqMVDveew2GhUUsELnw== /@vaadin/vaadin-context-menu/4.5.0: dependencies: '@polymer/iron-media-query': 3.0.1 @@ -1186,18 +1145,6 @@ packages: dev: false resolution: integrity: sha512-oGsNaWbM6RisY1LkyWYtwnw+DtSRSpkFDbemEOtkYezj+Hhsd9+07LqILaUU4pB0zPaRq+uq+2tKba/TL3t23g== - /@vaadin/vaadin-cookie-consent/1.2.0: - dependencies: - '@polymer/polymer': 3.2.0 - '@vaadin/vaadin-element-mixin': 2.4.2 - '@vaadin/vaadin-license-checker': 2.1.2 - '@vaadin/vaadin-lumo-styles': 1.6.1 - '@vaadin/vaadin-material-styles': 1.3.2 - '@vaadin/vaadin-themable-mixin': 1.6.2 - cookieconsent: 3.1.1 - dev: false - resolution: - integrity: sha512-F+KbxaauVmJsjbT5rhJ4lgPDtk9w8HmmFScE9FOHa0DnwlBNbpo26AE68+BcjeYmGHmXjQsndfvTqFQ10r3yZw== /@vaadin/vaadin-core-shrinkwrap/18.0.5: dependencies: '@polymer/iron-a11y-announcer': 3.0.2 @@ -1255,24 +1202,6 @@ packages: dev: false resolution: integrity: sha512-ky5LkkIcSexpLNGWUNng9n+HMR6OOpp9dy7ahR61SU3E85YA6csxZp29DPc/k1C7kEmLX1QfsfH0vlW8uAqmrQ== - /@vaadin/vaadin-crud/1.3.0: - dependencies: - '@polymer/iron-media-query': 3.0.1 - '@polymer/polymer': 3.2.0 - '@vaadin/vaadin-button': 2.4.0 - '@vaadin/vaadin-confirm-dialog': 1.3.0 - '@vaadin/vaadin-dialog': 2.5.2 - '@vaadin/vaadin-element-mixin': 2.4.2 - '@vaadin/vaadin-form-layout': 2.3.0 - '@vaadin/vaadin-grid': 5.7.7 - '@vaadin/vaadin-license-checker': 2.1.2 - '@vaadin/vaadin-lumo-styles': 1.6.1 - '@vaadin/vaadin-material-styles': 1.3.2 - '@vaadin/vaadin-text-field': 2.8.2 - '@vaadin/vaadin-themable-mixin': 1.6.2 - dev: false - resolution: - integrity: sha512-2Wj902XD2qHIX4YLyfRccCwoOcK0rqse94k3/YkGMb0WFVhqrKuA5h/ZwVxWqRI2nD765D7NvLePcSnE0uO4hA== /@vaadin/vaadin-custom-field/1.3.0: dependencies: '@polymer/polymer': 3.2.0 @@ -1360,23 +1289,6 @@ packages: dev: false resolution: integrity: sha512-uEmTtJRT7TokIaXMwO96PZ9CLSosfgGKLv3RtC/IltDeH+K2nmmaEcmlcteAOevCyXGShA4fwHp9MoODSPZv1Q== - /@vaadin/vaadin-grid-pro/2.2.2: - dependencies: - '@polymer/polymer': 3.2.0 - '@vaadin/vaadin-checkbox': 2.5.0 - '@vaadin/vaadin-element-mixin': 2.4.2 - '@vaadin/vaadin-grid': 5.7.7 - '@vaadin/vaadin-item': 2.3.0 - '@vaadin/vaadin-license-checker': 2.1.2 - '@vaadin/vaadin-list-box': 1.4.0 - '@vaadin/vaadin-lumo-styles': 1.6.1 - '@vaadin/vaadin-material-styles': 1.3.2 - '@vaadin/vaadin-select': 2.4.0 - '@vaadin/vaadin-text-field': 2.8.2 - '@vaadin/vaadin-themable-mixin': 1.6.2 - dev: false - resolution: - integrity: sha512-AbAvSzsVRlCrYvneA/zXkqW80xPtYw+CLeyAvpEPet3csuQiDcWYp16Opl7BB2BDeo9jHMANyR9w4L1haKImBQ== /@vaadin/vaadin-grid/5.7.7: dependencies: '@polymer/iron-a11y-announcer': 3.0.2 @@ -1411,12 +1323,6 @@ packages: dev: false resolution: integrity: sha512-hG1MQ8cLaFlsoqSZFm8bqXrHxMry6vtkJrpiXArxpaZXMwPkJnfrUT3D6Qm/NG/rZHvOzZa5U/1k5+dyledlHA== - /@vaadin/vaadin-license-checker/2.1.2: - dependencies: - '@vaadin/vaadin-development-mode-detector': 2.0.4 - dev: false - resolution: - integrity: sha512-oD6/MoavXyIZp6NWhkbJD5RKrpiWohhaQpgqjM0bFIthRr+1NoiG5R1w0uY3NIdMDuaXlsUFSQJ/Viz1v7F/jQ== /@vaadin/vaadin-list-box/1.4.0: dependencies: '@polymer/polymer': 3.2.0 @@ -1527,20 +1433,6 @@ packages: dev: false resolution: integrity: sha512-CF5I+VM8zPfHDlZPp8AvhqabbxB7dIgtRSjqwMJ9yVM/zT0QNxXp1BQUcS3e5tGTudOdHblgbiOI+KzUWbuYiA== - /@vaadin/vaadin-rich-text-editor/1.3.0: - dependencies: - '@polymer/polymer': 3.2.0 - '@vaadin/vaadin-button': 2.4.0 - '@vaadin/vaadin-confirm-dialog': 1.3.0 - '@vaadin/vaadin-element-mixin': 2.4.2 - '@vaadin/vaadin-license-checker': 2.1.2 - '@vaadin/vaadin-lumo-styles': 1.6.1 - '@vaadin/vaadin-material-styles': 1.3.2 - '@vaadin/vaadin-text-field': 2.8.2 - '@vaadin/vaadin-themable-mixin': 1.6.2 - dev: false - resolution: - integrity: sha512-fiCyJiLb0DCfW5eyqoiAm1p9mItV2pc0DNl0YSrhSVtW2JrvrrvQBunSLuphua5Y/yJJLOvw6CsyS2TRq8oypw== /@vaadin/vaadin-select/2.4.0: dependencies: '@polymer/iron-media-query': 3.0.1 @@ -1559,70 +1451,6 @@ packages: dev: false resolution: integrity: sha512-JUCsg/rBIyDcjnZmrXCu+G7a7QJtKquix/WI6L56yG8zgX5EP6p6Wt15G0bohDXGO0xvW+i8NCCO65EftjqnUw== - /@vaadin/vaadin-shrinkwrap/18.0.5: - dependencies: - '@polymer/iron-a11y-announcer': 3.0.2 - '@polymer/iron-a11y-keys-behavior': 3.0.1 - '@polymer/iron-fit-behavior': 3.0.2 - '@polymer/iron-flex-layout': 3.0.1 - '@polymer/iron-icon': 3.0.1 - '@polymer/iron-iconset-svg': 3.0.1 - '@polymer/iron-list': 3.1.0 - '@polymer/iron-media-query': 3.0.1 - '@polymer/iron-meta': 3.0.1 - '@polymer/iron-overlay-behavior': 3.0.3 - '@polymer/iron-resizable-behavior': 3.0.1 - '@polymer/iron-scroll-target-behavior': 3.0.1 - '@vaadin/router': 1.7.2 - '@vaadin/vaadin-accordion': 1.2.0 - '@vaadin/vaadin-app-layout': 2.2.0 - '@vaadin/vaadin-avatar': 1.0.3 - '@vaadin/vaadin-board': 2.2.0 - '@vaadin/vaadin-button': 2.4.0 - '@vaadin/vaadin-charts': 7.0.0 - '@vaadin/vaadin-checkbox': 2.5.0 - '@vaadin/vaadin-combo-box': 5.4.7 - '@vaadin/vaadin-confirm-dialog': 1.3.0 - '@vaadin/vaadin-context-menu': 4.5.0 - '@vaadin/vaadin-control-state-mixin': 2.2.4 - '@vaadin/vaadin-cookie-consent': 1.2.0 - '@vaadin/vaadin-crud': 1.3.0 - '@vaadin/vaadin-custom-field': 1.3.0 - '@vaadin/vaadin-date-picker': 4.4.1 - '@vaadin/vaadin-date-time-picker': 1.4.0 - '@vaadin/vaadin-details': 1.2.0 - '@vaadin/vaadin-development-mode-detector': 2.0.4 - '@vaadin/vaadin-dialog': 2.5.2 - '@vaadin/vaadin-element-mixin': 2.4.2 - '@vaadin/vaadin-form-layout': 2.3.0 - '@vaadin/vaadin-grid': 5.7.7 - '@vaadin/vaadin-grid-pro': 2.2.2 - '@vaadin/vaadin-icons': 4.3.2 - '@vaadin/vaadin-item': 2.3.0 - '@vaadin/vaadin-list-box': 1.4.0 - '@vaadin/vaadin-list-mixin': 2.5.1 - '@vaadin/vaadin-login': 1.2.0 - '@vaadin/vaadin-lumo-styles': 1.6.1 - '@vaadin/vaadin-material-styles': 1.3.2 - '@vaadin/vaadin-menu-bar': 1.2.1 - '@vaadin/vaadin-notification': 1.6.0 - '@vaadin/vaadin-ordered-layout': 1.4.0 - '@vaadin/vaadin-overlay': 3.5.1 - '@vaadin/vaadin-progress-bar': 1.3.0 - '@vaadin/vaadin-radio-button': 1.5.1 - '@vaadin/vaadin-rich-text-editor': 1.3.0 - '@vaadin/vaadin-select': 2.4.0 - '@vaadin/vaadin-split-layout': 4.3.0 - '@vaadin/vaadin-tabs': 3.2.0 - '@vaadin/vaadin-text-field': 2.8.2 - '@vaadin/vaadin-themable-mixin': 1.6.2 - '@vaadin/vaadin-time-picker': 2.4.0 - '@vaadin/vaadin-upload': 4.4.1 - '@vaadin/vaadin-usage-statistics': 2.1.0 - '@webcomponents/shadycss': 1.9.6 - dev: false - resolution: - integrity: sha512-bxaMLfpNIai3ryknngZlvewAYDStKFg1LYMAkNVNGmVmrY7WVNVUptkoNnrokpzMvLyHoo7tTrROMOtTSh08Tg== /@vaadin/vaadin-split-layout/4.3.0: dependencies: '@polymer/iron-resizable-behavior': 3.0.1 @@ -3096,10 +2924,6 @@ packages: node: '>= 0.6' resolution: integrity: sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== - /cookieconsent/3.1.1: - dev: false - resolution: - integrity: sha512-v8JWLJcI7Zs9NWrs8hiVldVtm3EBF70TJI231vxn6YToBGj0c9dvdnYwltydkAnrbBMOM/qX1xLFrnTfm5wTag== /copy-concurrently/1.0.5: dependencies: aproba: 1.2.0 @@ -4252,10 +4076,6 @@ packages: hasBin: true resolution: integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - /highcharts/8.1.2: - dev: false - resolution: - integrity: sha512-Q124Lj+2+bVY2MKMd7d8uSVAmhZVzWgknUUzUBEC27S94dCyK6PBgahuwiMP/ET4w7qSFBBi4OC77ZUb0Vnuyg== /hmac-drbg/1.0.1: dependencies: hash.js: 1.1.7 @@ -7522,16 +7342,11 @@ specifiers: '@vaadin/vaadin-accordion': 1.2.0 '@vaadin/vaadin-app-layout': 2.2.0 '@vaadin/vaadin-avatar': 1.0.3 - '@vaadin/vaadin-board': 2.2.0 '@vaadin/vaadin-button': 2.4.0 - '@vaadin/vaadin-charts': 7.0.0 '@vaadin/vaadin-checkbox': 2.5.0 '@vaadin/vaadin-combo-box': 5.4.7 - '@vaadin/vaadin-confirm-dialog': 1.3.0 '@vaadin/vaadin-context-menu': 4.5.0 - '@vaadin/vaadin-cookie-consent': 1.2.0 '@vaadin/vaadin-core-shrinkwrap': 18.0.5 - '@vaadin/vaadin-crud': 1.3.0 '@vaadin/vaadin-custom-field': 1.3.0 '@vaadin/vaadin-date-picker': 4.4.1 '@vaadin/vaadin-date-time-picker': 1.4.0 @@ -7539,7 +7354,6 @@ specifiers: '@vaadin/vaadin-dialog': 2.5.2 '@vaadin/vaadin-form-layout': 2.3.0 '@vaadin/vaadin-grid': 5.7.7 - '@vaadin/vaadin-grid-pro': 2.2.2 '@vaadin/vaadin-icons': 4.3.2 '@vaadin/vaadin-item': 2.3.0 '@vaadin/vaadin-list-box': 1.4.0 @@ -7551,9 +7365,7 @@ specifiers: '@vaadin/vaadin-ordered-layout': 1.4.0 '@vaadin/vaadin-progress-bar': 1.3.0 '@vaadin/vaadin-radio-button': 1.5.1 - '@vaadin/vaadin-rich-text-editor': 1.3.0 '@vaadin/vaadin-select': 2.4.0 - '@vaadin/vaadin-shrinkwrap': 18.0.5 '@vaadin/vaadin-split-layout': 4.3.0 '@vaadin/vaadin-tabs': 3.2.0 '@vaadin/vaadin-text-field': 2.8.2 diff --git a/src/main/java/edu/kit/typicalc/view/main/UpperBar.java b/src/main/java/edu/kit/typicalc/view/main/UpperBar.java index cbe2ada..eff66f4 100644 --- a/src/main/java/edu/kit/typicalc/view/main/UpperBar.java +++ b/src/main/java/edu/kit/typicalc/view/main/UpperBar.java @@ -1,14 +1,43 @@ package edu.kit.typicalc.view.main; +import com.vaadin.flow.component.applayout.DrawerToggle; +import com.vaadin.flow.component.dependency.CssImport; +import com.vaadin.flow.component.dialog.Dialog; +import com.vaadin.flow.component.html.H1; +import com.vaadin.flow.component.icon.Icon; +import com.vaadin.flow.component.icon.VaadinIcon; +import com.vaadin.flow.component.orderedlayout.FlexComponent; import com.vaadin.flow.component.orderedlayout.HorizontalLayout; import com.vaadin.flow.i18n.LocaleChangeEvent; import com.vaadin.flow.i18n.LocaleChangeObserver; +import edu.kit.typicalc.view.content.infocontent.StartPageView; +@CssImport("./styles/view/main/upper-bar.css") public class UpperBar extends HorizontalLayout implements LocaleChangeObserver { + private final H1 viewTitle; + private final InputBar inputBar; + private final Icon helpDialogIcon; public UpperBar() { - //TODO implement + setId("header"); + getThemeList().set("dark", true); + setWidthFull(); + setSpacing(false); + setAlignItems(FlexComponent.Alignment.CENTER); + add(new DrawerToggle()); + this.viewTitle = new H1(getTranslation("root.typicalc")); + viewTitle.setId("viewTitle"); + this.inputBar = new InputBar(); + this.helpDialogIcon = new Icon(VaadinIcon.QUESTION_CIRCLE); + helpDialogIcon.setId("icon"); + + viewTitle.addClickListener(event -> this.getUI().get().navigate(StartPageView.class)); + add(viewTitle, inputBar, helpDialogIcon); + } + + private void createHelpDialog() { + //TODO create help dialog here --> maybe move to separate class if too big } @Override diff --git a/src/main/resources/language/translation_de.properties b/src/main/resources/language/translation_de.properties index 18d7d9e..abd5c11 100644 --- a/src/main/resources/language/translation_de.properties +++ b/src/main/resources/language/translation_de.properties @@ -10,4 +10,5 @@ abs-rule=\\begin{prooftree}\ \\BinaryInfC{$\\Gamma \\vdash t_1 \\ t_2 : \\tau_2$}\ \\end{prooftree} -test=hello world \ No newline at end of file +test=hello world +root.typicalc=Typicalc \ No newline at end of file From bee97390b69dee059580408d88caed80668f3c0d Mon Sep 17 00:00:00 2001 From: ucrhh Date: Thu, 28 Jan 2021 12:33:38 +0100 Subject: [PATCH 2/2] mathjax now rendering with MathjaxDisplay --- frontend/src/mathjax-adapter.ts | 32 +-- frontend/src/mathjax-setup.js | 114 +++++++++ package.json | 39 ++- pnpm-lock.yaml | 233 ++++-------------- .../content/infocontent/StartPageView.java | 13 +- .../typicalc/view/main/MathjaxDisplay.java | 2 +- 6 files changed, 195 insertions(+), 238 deletions(-) create mode 100644 frontend/src/mathjax-setup.js diff --git a/frontend/src/mathjax-adapter.ts b/frontend/src/mathjax-adapter.ts index 1ccafb6..40c4919 100644 --- a/frontend/src/mathjax-adapter.ts +++ b/frontend/src/mathjax-adapter.ts @@ -1,6 +1,5 @@ import {LitElement, html} from 'lit-element'; import {TemplateResult} from "lit-html"; - declare let window: { MathJax: { typesetShadow: (arg0: ShadowRoot | null, arg1: () => void) => void, @@ -10,21 +9,8 @@ declare let window: { }; export abstract class MathjaxAdapter extends LitElement { - protected execTypeset() { - if (window.MathJax !== undefined) { - window.MathJax.typesetShadow(this.shadowRoot, () => this.calculateSteps()); - } - } - - - render(): TemplateResult { - return html` -
-
`; - } - - connectedCallback() { - super.connectedCallback(); + constructor() { + super(); if (window.MathJax === undefined || !window.MathJax.isInitialized) { window.addEventListener('mathjax-initialized', () => this.execTypeset()); } else { @@ -32,6 +18,20 @@ export abstract class MathjaxAdapter extends LitElement { } } + protected execTypeset() { + if (window.MathJax !== undefined) { + window.MathJax.typesetShadow(this.shadowRoot, () => this.calculateSteps()); + } + } + // @ts-ignore + + + render(): TemplateResult { + return html` +
+
`; + } + protected abstract showStep(n: number): void; protected abstract calculateSteps(): void; diff --git a/frontend/src/mathjax-setup.js b/frontend/src/mathjax-setup.js new file mode 100644 index 0000000..e12a355 --- /dev/null +++ b/frontend/src/mathjax-setup.js @@ -0,0 +1,114 @@ +window.MathJax = { + loader: {load: ['[tex]/bussproofs', '[tex]/html', '[tex]/action']}, + tex: { + packages: {'[+]': ['bussproofs', 'html', 'action']}, + inlineMath: [['$', '$'], ['\\(', '\\)']] + }, + startup: { + ready: () => { + const mathjax = MathJax._.mathjax.mathjax; + const HTMLAdaptor = MathJax._.adaptors.HTMLAdaptor.HTMLAdaptor; + const HTMLHandler = MathJax._.handlers.html.HTMLHandler.HTMLHandler; + const AbstractHandler = MathJax._.core.Handler.AbstractHandler.prototype; + const startup = MathJax.startup; + + // + // Extend HTMLAdaptor to handle shadowDOM as the document + // + class ShadowAdaptor extends HTMLAdaptor { + create(kind, ns) { + const document = (this.document.createElement ? this.document : this.window.document); + return (ns ? + document.createElementNS(ns, kind) : + document.createElement(kind)); + } + + text(text) { + const document = (this.document.createTextNode ? this.document : this.window.document); + return document.createTextNode(text); + } + + head(doc) { + return doc.head || (doc.getElementById("mjx-document") || {}).firstChild || doc; + } + + body(doc) { + return doc.body || (doc.getElementById("mjx-document") || {}).lastChild || doc; + } + + root(doc) { + return doc.documentElement || doc.getElementById("mjx-document") || doc; + } + } + + // + // Extend HTMLHandler to handle shadowDOM as document + // + class ShadowHandler extends HTMLHandler { + create(document, options) { + const adaptor = this.adaptor; + if (typeof (document) === 'string') { + document = adaptor.parse(document, 'text/html'); + } else if ((document instanceof adaptor.window.HTMLElement || + document instanceof adaptor.window.DocumentFragment) && + !(document instanceof window.ShadowRoot)) { + let child = document; + document = adaptor.parse('', 'text/html'); + adaptor.append(adaptor.body(document), child); + } + // + // We can't use super.create() here, since that doesn't + // handle shadowDOM correctly, so call HTMLHandler's parent class + // directly instead. + // + return AbstractHandler.create.call(this, document, options); + } + } + + // + // Register the new handler and adaptor + // + startup.registerConstructor('HTMLHandler', ShadowHandler); + startup.registerConstructor('browserAdaptor', () => new ShadowAdaptor(window)); + + // + // A service function that creates a new MathDocument from the + // shadow root with the configured input and output jax, and then + // renders the document. The MathDocument is returned in case + // you need to rerender the shadowRoot later. + // + MathJax.typesetShadow = function (root, callback) { + const InputJax = startup.getInputJax(); + const OutputJax = startup.getOutputJax(); + const html = mathjax.document(root, {InputJax, OutputJax}); + html.render(); + if (callback != null) { + callback(html); + } + return html; + } + + // + // Now do the usual startup now that the extensions are in place + // + let event = new Event('mathjax-initialized', { + bubbles: true, + composed: true, + detail: "composed" + }) + MathJax.startup.defaultReady(); + MathJax.startup.promise.then(() => { + console.log("MathJax initialized"); + MathJax.isInitialized = true; + document.dispatchEvent(event); + }) + } + } +}; + +(function () { + let script = document.createElement('script'); + script.src = 'http://cdn.jsdelivr.net/npm/mathjax@3.1.2/es5/tex-svg.js'; + // script.async = true; + document.head.appendChild(script); +})(); \ No newline at end of file diff --git a/package.json b/package.json index 45b7254..3207c37 100644 --- a/package.json +++ b/package.json @@ -6,13 +6,19 @@ "@polymer/iron-list": "3.1.0", "@polymer/polymer": "3.2.0", "@vaadin/flow-frontend": "./target/flow-frontend", + "@vaadin/form": "./target/flow-frontend/form", "@vaadin/router": "1.7.2", + "@vaadin/vaadin-accordion": "1.2.0", "@vaadin/vaadin-app-layout": "2.2.0", + "@vaadin/vaadin-avatar": "1.0.3", "@vaadin/vaadin-button": "2.4.0", - "@vaadin/vaadin-charts": "7.0.0", + "@vaadin/vaadin-checkbox": "2.5.0", "@vaadin/vaadin-combo-box": "5.4.7", - "@vaadin/vaadin-confirm-dialog": "1.3.0", + "@vaadin/vaadin-context-menu": "4.5.0", + "@vaadin/vaadin-core-shrinkwrap": "18.0.5", "@vaadin/vaadin-custom-field": "1.3.0", + "@vaadin/vaadin-date-picker": "4.4.1", + "@vaadin/vaadin-date-time-picker": "1.4.0", "@vaadin/vaadin-details": "1.2.0", "@vaadin/vaadin-dialog": "2.5.2", "@vaadin/vaadin-form-layout": "2.3.0", @@ -20,36 +26,23 @@ "@vaadin/vaadin-icons": "4.3.2", "@vaadin/vaadin-item": "2.3.0", "@vaadin/vaadin-list-box": "1.4.0", + "@vaadin/vaadin-login": "1.2.0", "@vaadin/vaadin-lumo-styles": "1.6.1", "@vaadin/vaadin-material-styles": "1.3.2", "@vaadin/vaadin-menu-bar": "1.2.1", "@vaadin/vaadin-notification": "1.6.0", "@vaadin/vaadin-ordered-layout": "1.4.0", "@vaadin/vaadin-progress-bar": "1.3.0", + "@vaadin/vaadin-radio-button": "1.5.1", "@vaadin/vaadin-select": "2.4.0", "@vaadin/vaadin-split-layout": "4.3.0", - "@vaadin/vaadin-text-field": "2.8.2", - "@vaadin/form": "./target/flow-frontend/form", - "@vaadin/vaadin-avatar": "1.0.3", - "open": "^7.2.1", - "@vaadin/vaadin-crud": "1.3.0", - "@vaadin/vaadin-cookie-consent": "1.2.0", - "@vaadin/vaadin-upload": "4.4.1", - "@vaadin/vaadin-board": "2.2.0", - "@vaadin/vaadin-date-time-picker": "1.4.0", - "@vaadin/vaadin-login": "1.2.0", - "@vaadin/vaadin-accordion": "1.2.0", - "@vaadin/vaadin-checkbox": "2.5.0", - "@vaadin/vaadin-time-picker": "2.4.0", - "@vaadin/vaadin-context-menu": "4.5.0", "@vaadin/vaadin-tabs": "3.2.0", - "@vaadin/vaadin-radio-button": "1.5.1", - "@vaadin/vaadin-rich-text-editor": "1.3.0", + "@vaadin/vaadin-text-field": "2.8.2", + "@vaadin/vaadin-time-picker": "2.4.0", + "@vaadin/vaadin-upload": "4.4.1", "lit-element": "2.3.1", - "@vaadin/vaadin-core-shrinkwrap": "18.0.5", - "@vaadin/vaadin-grid-pro": "2.2.2", - "@vaadin/vaadin-shrinkwrap": "18.0.5", - "@vaadin/vaadin-date-picker": "4.4.1" + "mathjax-full": "^3.1.2", + "open": "^7.2.1" }, "devDependencies": { "@types/validator": "13.1.0", @@ -149,6 +142,6 @@ "lit-css-loader": "0.0.4", "extract-loader": "5.1.0" }, - "hash": "04462da9d778f9542e7732e145ac4b9dbdea38fe120e57367afe34d62fd3024a" + "hash": "304d37ef096ced408c2e2d293cf0e75e6865ad39b8ee3d643c1300454ac92cc3" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e2c3936..3f78b94 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,16 +8,11 @@ dependencies: '@vaadin/vaadin-accordion': 1.2.0 '@vaadin/vaadin-app-layout': 2.2.0 '@vaadin/vaadin-avatar': 1.0.3 - '@vaadin/vaadin-board': 2.2.0 '@vaadin/vaadin-button': 2.4.0 - '@vaadin/vaadin-charts': 7.0.0 '@vaadin/vaadin-checkbox': 2.5.0 '@vaadin/vaadin-combo-box': 5.4.7 - '@vaadin/vaadin-confirm-dialog': 1.3.0 '@vaadin/vaadin-context-menu': 4.5.0 - '@vaadin/vaadin-cookie-consent': 1.2.0 '@vaadin/vaadin-core-shrinkwrap': 18.0.5 - '@vaadin/vaadin-crud': 1.3.0 '@vaadin/vaadin-custom-field': 1.3.0 '@vaadin/vaadin-date-picker': 4.4.1 '@vaadin/vaadin-date-time-picker': 1.4.0 @@ -25,7 +20,6 @@ dependencies: '@vaadin/vaadin-dialog': 2.5.2 '@vaadin/vaadin-form-layout': 2.3.0 '@vaadin/vaadin-grid': 5.7.7 - '@vaadin/vaadin-grid-pro': 2.2.2 '@vaadin/vaadin-icons': 4.3.2 '@vaadin/vaadin-item': 2.3.0 '@vaadin/vaadin-list-box': 1.4.0 @@ -37,15 +31,14 @@ dependencies: '@vaadin/vaadin-ordered-layout': 1.4.0 '@vaadin/vaadin-progress-bar': 1.3.0 '@vaadin/vaadin-radio-button': 1.5.1 - '@vaadin/vaadin-rich-text-editor': 1.3.0 '@vaadin/vaadin-select': 2.4.0 - '@vaadin/vaadin-shrinkwrap': 18.0.5 '@vaadin/vaadin-split-layout': 4.3.0 '@vaadin/vaadin-tabs': 3.2.0 '@vaadin/vaadin-text-field': 2.8.2 '@vaadin/vaadin-time-picker': 2.4.0 '@vaadin/vaadin-upload': 4.4.1 lit-element: 2.3.1 + mathjax-full: 3.1.2 open: 7.3.1 devDependencies: '@types/validator': 13.1.0 @@ -1093,15 +1086,6 @@ packages: dev: false resolution: integrity: sha512-XIzYQLXqesW3V4XFecPAm5iC7MeBQSlYDKTV5ULLeJu7IJuVYzfm/EukU80WFZ2k7bPgSK8ICkhecK/tv0N1iQ== - /@vaadin/vaadin-board/2.2.0: - dependencies: - '@polymer/iron-resizable-behavior': 3.0.1 - '@polymer/polymer': 3.2.0 - '@vaadin/vaadin-element-mixin': 2.4.2 - '@vaadin/vaadin-license-checker': 2.1.2 - dev: false - resolution: - integrity: sha512-O4C/tY5MSFKpuHdvMD/W9r1AizstPnI5RpWN7ghbYoWs3FxZ+RRr9SfHHr1r94W6rSeaZsbaFjaaCPCncv/aAQ== /@vaadin/vaadin-button/2.4.0: dependencies: '@polymer/polymer': 3.2.0 @@ -1113,16 +1097,6 @@ packages: dev: false resolution: integrity: sha512-C94F07OOb5Ciq2BY4CklIQG+WJFA6QoTFDQl8JJloJgPI12b9kmyP8uRgfq4VAHHusqKqIvA8AB6VZuGg5lagg== - /@vaadin/vaadin-charts/7.0.0: - dependencies: - '@polymer/polymer': 3.2.0 - '@vaadin/vaadin-element-mixin': 2.4.2 - '@vaadin/vaadin-license-checker': 2.1.2 - '@vaadin/vaadin-themable-mixin': 1.6.2 - highcharts: 8.1.2 - dev: false - resolution: - integrity: sha512-CErXOyOUhD2wmIBYOVRTMgS6hAlFUMbT3frIgumiZZOb8MWvznGqiU2I+9/tb1V4RFEXRNjCGwCzWwp+K7LIUQ== /@vaadin/vaadin-checkbox/2.5.0: dependencies: '@polymer/polymer': 3.2.0 @@ -1152,20 +1126,6 @@ packages: dev: false resolution: integrity: sha512-1ETpu5okrc8HFr7zOtQP1i4o1ySYheWhhInic2XdhUfB9Lvj8MS6iY+BLcQupOYHD8OwS8wvpH2hKxUe1ST9jw== - /@vaadin/vaadin-confirm-dialog/1.3.0: - dependencies: - '@polymer/polymer': 3.2.0 - '@vaadin/vaadin-button': 2.4.0 - '@vaadin/vaadin-dialog': 2.5.2 - '@vaadin/vaadin-element-mixin': 2.4.2 - '@vaadin/vaadin-license-checker': 2.1.2 - '@vaadin/vaadin-lumo-styles': 1.6.1 - '@vaadin/vaadin-material-styles': 1.3.2 - '@vaadin/vaadin-overlay': 3.5.1 - '@vaadin/vaadin-themable-mixin': 1.6.2 - dev: false - resolution: - integrity: sha512-di4hp8Ca0mGoNVDWqI9Gl/G2TXl/cKfy+ApR5co+m95+uC7wpGeocQMWuqaoTZfOmR/VqMVDveew2GhUUsELnw== /@vaadin/vaadin-context-menu/4.5.0: dependencies: '@polymer/iron-media-query': 3.0.1 @@ -1186,18 +1146,6 @@ packages: dev: false resolution: integrity: sha512-oGsNaWbM6RisY1LkyWYtwnw+DtSRSpkFDbemEOtkYezj+Hhsd9+07LqILaUU4pB0zPaRq+uq+2tKba/TL3t23g== - /@vaadin/vaadin-cookie-consent/1.2.0: - dependencies: - '@polymer/polymer': 3.2.0 - '@vaadin/vaadin-element-mixin': 2.4.2 - '@vaadin/vaadin-license-checker': 2.1.2 - '@vaadin/vaadin-lumo-styles': 1.6.1 - '@vaadin/vaadin-material-styles': 1.3.2 - '@vaadin/vaadin-themable-mixin': 1.6.2 - cookieconsent: 3.1.1 - dev: false - resolution: - integrity: sha512-F+KbxaauVmJsjbT5rhJ4lgPDtk9w8HmmFScE9FOHa0DnwlBNbpo26AE68+BcjeYmGHmXjQsndfvTqFQ10r3yZw== /@vaadin/vaadin-core-shrinkwrap/18.0.5: dependencies: '@polymer/iron-a11y-announcer': 3.0.2 @@ -1255,24 +1203,6 @@ packages: dev: false resolution: integrity: sha512-ky5LkkIcSexpLNGWUNng9n+HMR6OOpp9dy7ahR61SU3E85YA6csxZp29DPc/k1C7kEmLX1QfsfH0vlW8uAqmrQ== - /@vaadin/vaadin-crud/1.3.0: - dependencies: - '@polymer/iron-media-query': 3.0.1 - '@polymer/polymer': 3.2.0 - '@vaadin/vaadin-button': 2.4.0 - '@vaadin/vaadin-confirm-dialog': 1.3.0 - '@vaadin/vaadin-dialog': 2.5.2 - '@vaadin/vaadin-element-mixin': 2.4.2 - '@vaadin/vaadin-form-layout': 2.3.0 - '@vaadin/vaadin-grid': 5.7.7 - '@vaadin/vaadin-license-checker': 2.1.2 - '@vaadin/vaadin-lumo-styles': 1.6.1 - '@vaadin/vaadin-material-styles': 1.3.2 - '@vaadin/vaadin-text-field': 2.8.2 - '@vaadin/vaadin-themable-mixin': 1.6.2 - dev: false - resolution: - integrity: sha512-2Wj902XD2qHIX4YLyfRccCwoOcK0rqse94k3/YkGMb0WFVhqrKuA5h/ZwVxWqRI2nD765D7NvLePcSnE0uO4hA== /@vaadin/vaadin-custom-field/1.3.0: dependencies: '@polymer/polymer': 3.2.0 @@ -1360,23 +1290,6 @@ packages: dev: false resolution: integrity: sha512-uEmTtJRT7TokIaXMwO96PZ9CLSosfgGKLv3RtC/IltDeH+K2nmmaEcmlcteAOevCyXGShA4fwHp9MoODSPZv1Q== - /@vaadin/vaadin-grid-pro/2.2.2: - dependencies: - '@polymer/polymer': 3.2.0 - '@vaadin/vaadin-checkbox': 2.5.0 - '@vaadin/vaadin-element-mixin': 2.4.2 - '@vaadin/vaadin-grid': 5.7.7 - '@vaadin/vaadin-item': 2.3.0 - '@vaadin/vaadin-license-checker': 2.1.2 - '@vaadin/vaadin-list-box': 1.4.0 - '@vaadin/vaadin-lumo-styles': 1.6.1 - '@vaadin/vaadin-material-styles': 1.3.2 - '@vaadin/vaadin-select': 2.4.0 - '@vaadin/vaadin-text-field': 2.8.2 - '@vaadin/vaadin-themable-mixin': 1.6.2 - dev: false - resolution: - integrity: sha512-AbAvSzsVRlCrYvneA/zXkqW80xPtYw+CLeyAvpEPet3csuQiDcWYp16Opl7BB2BDeo9jHMANyR9w4L1haKImBQ== /@vaadin/vaadin-grid/5.7.7: dependencies: '@polymer/iron-a11y-announcer': 3.0.2 @@ -1411,12 +1324,6 @@ packages: dev: false resolution: integrity: sha512-hG1MQ8cLaFlsoqSZFm8bqXrHxMry6vtkJrpiXArxpaZXMwPkJnfrUT3D6Qm/NG/rZHvOzZa5U/1k5+dyledlHA== - /@vaadin/vaadin-license-checker/2.1.2: - dependencies: - '@vaadin/vaadin-development-mode-detector': 2.0.4 - dev: false - resolution: - integrity: sha512-oD6/MoavXyIZp6NWhkbJD5RKrpiWohhaQpgqjM0bFIthRr+1NoiG5R1w0uY3NIdMDuaXlsUFSQJ/Viz1v7F/jQ== /@vaadin/vaadin-list-box/1.4.0: dependencies: '@polymer/polymer': 3.2.0 @@ -1527,20 +1434,6 @@ packages: dev: false resolution: integrity: sha512-CF5I+VM8zPfHDlZPp8AvhqabbxB7dIgtRSjqwMJ9yVM/zT0QNxXp1BQUcS3e5tGTudOdHblgbiOI+KzUWbuYiA== - /@vaadin/vaadin-rich-text-editor/1.3.0: - dependencies: - '@polymer/polymer': 3.2.0 - '@vaadin/vaadin-button': 2.4.0 - '@vaadin/vaadin-confirm-dialog': 1.3.0 - '@vaadin/vaadin-element-mixin': 2.4.2 - '@vaadin/vaadin-license-checker': 2.1.2 - '@vaadin/vaadin-lumo-styles': 1.6.1 - '@vaadin/vaadin-material-styles': 1.3.2 - '@vaadin/vaadin-text-field': 2.8.2 - '@vaadin/vaadin-themable-mixin': 1.6.2 - dev: false - resolution: - integrity: sha512-fiCyJiLb0DCfW5eyqoiAm1p9mItV2pc0DNl0YSrhSVtW2JrvrrvQBunSLuphua5Y/yJJLOvw6CsyS2TRq8oypw== /@vaadin/vaadin-select/2.4.0: dependencies: '@polymer/iron-media-query': 3.0.1 @@ -1559,70 +1452,6 @@ packages: dev: false resolution: integrity: sha512-JUCsg/rBIyDcjnZmrXCu+G7a7QJtKquix/WI6L56yG8zgX5EP6p6Wt15G0bohDXGO0xvW+i8NCCO65EftjqnUw== - /@vaadin/vaadin-shrinkwrap/18.0.5: - dependencies: - '@polymer/iron-a11y-announcer': 3.0.2 - '@polymer/iron-a11y-keys-behavior': 3.0.1 - '@polymer/iron-fit-behavior': 3.0.2 - '@polymer/iron-flex-layout': 3.0.1 - '@polymer/iron-icon': 3.0.1 - '@polymer/iron-iconset-svg': 3.0.1 - '@polymer/iron-list': 3.1.0 - '@polymer/iron-media-query': 3.0.1 - '@polymer/iron-meta': 3.0.1 - '@polymer/iron-overlay-behavior': 3.0.3 - '@polymer/iron-resizable-behavior': 3.0.1 - '@polymer/iron-scroll-target-behavior': 3.0.1 - '@vaadin/router': 1.7.2 - '@vaadin/vaadin-accordion': 1.2.0 - '@vaadin/vaadin-app-layout': 2.2.0 - '@vaadin/vaadin-avatar': 1.0.3 - '@vaadin/vaadin-board': 2.2.0 - '@vaadin/vaadin-button': 2.4.0 - '@vaadin/vaadin-charts': 7.0.0 - '@vaadin/vaadin-checkbox': 2.5.0 - '@vaadin/vaadin-combo-box': 5.4.7 - '@vaadin/vaadin-confirm-dialog': 1.3.0 - '@vaadin/vaadin-context-menu': 4.5.0 - '@vaadin/vaadin-control-state-mixin': 2.2.4 - '@vaadin/vaadin-cookie-consent': 1.2.0 - '@vaadin/vaadin-crud': 1.3.0 - '@vaadin/vaadin-custom-field': 1.3.0 - '@vaadin/vaadin-date-picker': 4.4.1 - '@vaadin/vaadin-date-time-picker': 1.4.0 - '@vaadin/vaadin-details': 1.2.0 - '@vaadin/vaadin-development-mode-detector': 2.0.4 - '@vaadin/vaadin-dialog': 2.5.2 - '@vaadin/vaadin-element-mixin': 2.4.2 - '@vaadin/vaadin-form-layout': 2.3.0 - '@vaadin/vaadin-grid': 5.7.7 - '@vaadin/vaadin-grid-pro': 2.2.2 - '@vaadin/vaadin-icons': 4.3.2 - '@vaadin/vaadin-item': 2.3.0 - '@vaadin/vaadin-list-box': 1.4.0 - '@vaadin/vaadin-list-mixin': 2.5.1 - '@vaadin/vaadin-login': 1.2.0 - '@vaadin/vaadin-lumo-styles': 1.6.1 - '@vaadin/vaadin-material-styles': 1.3.2 - '@vaadin/vaadin-menu-bar': 1.2.1 - '@vaadin/vaadin-notification': 1.6.0 - '@vaadin/vaadin-ordered-layout': 1.4.0 - '@vaadin/vaadin-overlay': 3.5.1 - '@vaadin/vaadin-progress-bar': 1.3.0 - '@vaadin/vaadin-radio-button': 1.5.1 - '@vaadin/vaadin-rich-text-editor': 1.3.0 - '@vaadin/vaadin-select': 2.4.0 - '@vaadin/vaadin-split-layout': 4.3.0 - '@vaadin/vaadin-tabs': 3.2.0 - '@vaadin/vaadin-text-field': 2.8.2 - '@vaadin/vaadin-themable-mixin': 1.6.2 - '@vaadin/vaadin-time-picker': 2.4.0 - '@vaadin/vaadin-upload': 4.4.1 - '@vaadin/vaadin-usage-statistics': 2.1.0 - '@webcomponents/shadycss': 1.9.6 - dev: false - resolution: - integrity: sha512-bxaMLfpNIai3ryknngZlvewAYDStKFg1LYMAkNVNGmVmrY7WVNVUptkoNnrokpzMvLyHoo7tTrROMOtTSh08Tg== /@vaadin/vaadin-split-layout/4.3.0: dependencies: '@polymer/iron-resizable-behavior': 3.0.1 @@ -2992,6 +2821,12 @@ packages: node: '>= 6' resolution: integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== + /commander/6.2.1: + dev: false + engines: + node: '>= 6' + resolution: + integrity: sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== /commondir/1.0.1: dev: true resolution: @@ -3096,10 +2931,6 @@ packages: node: '>= 0.6' resolution: integrity: sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== - /cookieconsent/3.1.1: - dev: false - resolution: - integrity: sha512-v8JWLJcI7Zs9NWrs8hiVldVtm3EBF70TJI231vxn6YToBGj0c9dvdnYwltydkAnrbBMOM/qX1xLFrnTfm5wTag== /copy-concurrently/1.0.5: dependencies: aproba: 1.2.0 @@ -3643,6 +3474,12 @@ packages: node: '>=4.0.0' resolution: integrity: sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== + /esm/3.2.25: + dev: false + engines: + node: '>=6' + resolution: + integrity: sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA== /esrecurse/4.2.1: dependencies: estraverse: 4.3.0 @@ -4252,10 +4089,6 @@ packages: hasBin: true resolution: integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - /highcharts/8.1.2: - dev: false - resolution: - integrity: sha512-Q124Lj+2+bVY2MKMd7d8uSVAmhZVzWgknUUzUBEC27S94dCyK6PBgahuwiMP/ET4w7qSFBBi4OC77ZUb0Vnuyg== /hmac-drbg/1.0.1: dependencies: hash.js: 1.1.7 @@ -5082,6 +4915,14 @@ packages: node: '>=0.10.0' resolution: integrity: sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + /mathjax-full/3.1.2: + dependencies: + esm: 3.2.25 + mj-context-menu: 0.6.1 + speech-rule-engine: 3.1.1 + dev: false + resolution: + integrity: sha512-jFCwRFdFwIOa8J7r6VZT0AIv9ZwbLQ9aPc9YZp695NTvv7XKU2NunJodA+zDWzElIFJ7mTsImyfe5R3QyRNZjw== /md5.js/1.3.5: dependencies: hash-base: 3.0.4 @@ -5285,6 +5126,10 @@ packages: node: '>=0.10.0' resolution: integrity: sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== + /mj-context-menu/0.6.1: + dev: false + resolution: + integrity: sha512-7NO5s6n10TIV96d4g2uDpG7ZDpIhMh0QNfGdJw/W47JswFcosz457wqz/b5sAKvl12sxINGFCn80NZHKwxQEXA== /mkdirp/0.5.5: dependencies: minimist: 1.2.5 @@ -6670,6 +6515,15 @@ packages: node: '>=6.0.0' resolution: integrity: sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA== + /speech-rule-engine/3.1.1: + dependencies: + commander: 6.2.1 + wicked-good-xpath: 1.3.0 + xmldom-sre: 0.1.31 + dev: false + hasBin: true + resolution: + integrity: sha512-FGX8B44yI3yGhmcw8nZ/by2ffUlZG6m5b/O3RULXsSiwhL/evL+jwQ6BXQxV3gGtOYptOFalTVCAFknAJgBKAg== /split-string/3.1.0: dependencies: extend-shallow: 3.0.2 @@ -7420,6 +7274,10 @@ packages: hasBin: true resolution: integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + /wicked-good-xpath/1.3.0: + dev: false + resolution: + integrity: sha1-gbDpXoZQ5JyUsiKY//hoa1VTz2w= /worker-farm/1.7.0: dependencies: errno: 0.1.7 @@ -7455,6 +7313,12 @@ packages: dev: true resolution: integrity: sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA== + /xmldom-sre/0.1.31: + dev: false + engines: + node: '>=0.1' + resolution: + integrity: sha512-f9s+fUkX04BxQf+7mMWAp5zk61pciie+fFLC9hX9UVvCeJQfNHRHXpeo5MPcR0EUf57PYLdt+ZO4f3Ipk2oZUw== /xtend/4.0.2: dev: true engines: @@ -7522,16 +7386,11 @@ specifiers: '@vaadin/vaadin-accordion': 1.2.0 '@vaadin/vaadin-app-layout': 2.2.0 '@vaadin/vaadin-avatar': 1.0.3 - '@vaadin/vaadin-board': 2.2.0 '@vaadin/vaadin-button': 2.4.0 - '@vaadin/vaadin-charts': 7.0.0 '@vaadin/vaadin-checkbox': 2.5.0 '@vaadin/vaadin-combo-box': 5.4.7 - '@vaadin/vaadin-confirm-dialog': 1.3.0 '@vaadin/vaadin-context-menu': 4.5.0 - '@vaadin/vaadin-cookie-consent': 1.2.0 '@vaadin/vaadin-core-shrinkwrap': 18.0.5 - '@vaadin/vaadin-crud': 1.3.0 '@vaadin/vaadin-custom-field': 1.3.0 '@vaadin/vaadin-date-picker': 4.4.1 '@vaadin/vaadin-date-time-picker': 1.4.0 @@ -7539,7 +7398,6 @@ specifiers: '@vaadin/vaadin-dialog': 2.5.2 '@vaadin/vaadin-form-layout': 2.3.0 '@vaadin/vaadin-grid': 5.7.7 - '@vaadin/vaadin-grid-pro': 2.2.2 '@vaadin/vaadin-icons': 4.3.2 '@vaadin/vaadin-item': 2.3.0 '@vaadin/vaadin-list-box': 1.4.0 @@ -7551,9 +7409,7 @@ specifiers: '@vaadin/vaadin-ordered-layout': 1.4.0 '@vaadin/vaadin-progress-bar': 1.3.0 '@vaadin/vaadin-radio-button': 1.5.1 - '@vaadin/vaadin-rich-text-editor': 1.3.0 '@vaadin/vaadin-select': 2.4.0 - '@vaadin/vaadin-shrinkwrap': 18.0.5 '@vaadin/vaadin-split-layout': 4.3.0 '@vaadin/vaadin-tabs': 3.2.0 '@vaadin/vaadin-text-field': 2.8.2 @@ -7569,6 +7425,7 @@ specifiers: lit-css-loader: 0.0.4 lit-element: 2.3.1 lit-html: 1.2.1 + mathjax-full: ^3.1.2 open: ^7.2.1 progress-webpack-plugin: 0.0.24 raw-loader: 4.0.0 diff --git a/src/main/java/edu/kit/typicalc/view/content/infocontent/StartPageView.java b/src/main/java/edu/kit/typicalc/view/content/infocontent/StartPageView.java index 681beaa..645906a 100644 --- a/src/main/java/edu/kit/typicalc/view/content/infocontent/StartPageView.java +++ b/src/main/java/edu/kit/typicalc/view/content/infocontent/StartPageView.java @@ -1,9 +1,8 @@ package edu.kit.typicalc.view.content.infocontent; import com.vaadin.flow.component.button.Button; -import com.vaadin.flow.component.notification.Notification; +import com.vaadin.flow.component.dependency.JsModule; import com.vaadin.flow.component.orderedlayout.VerticalLayout; -import com.vaadin.flow.component.textfield.TextArea; import com.vaadin.flow.router.PageTitle; import com.vaadin.flow.router.Route; import com.vaadin.flow.router.RouteAlias; @@ -13,23 +12,17 @@ import edu.kit.typicalc.view.main.MathjaxDisplay; @Route(value = "home", layout = MainViewImpl.class) @PageTitle("Typicalc") @RouteAlias(value = "", layout = MainViewImpl.class) +@JsModule("./src/mathjax-setup.js") public class StartPageView extends VerticalLayout { - private TextArea name; private Button sayHello; public StartPageView() { // todo implement correctly setId("start-page"); - name = new TextArea("translation test"); - name.setValue(getTranslation("abs-rule")); - name.setWidthFull(); add(new MathjaxDisplay()); sayHello = new Button("Say hello"); - add(name, sayHello); - sayHello.addClickListener(e -> { - Notification.show("Hello " + name.getValue()); - }); + add(sayHello); } } diff --git a/src/main/java/edu/kit/typicalc/view/main/MathjaxDisplay.java b/src/main/java/edu/kit/typicalc/view/main/MathjaxDisplay.java index 22cfde8..283183f 100644 --- a/src/main/java/edu/kit/typicalc/view/main/MathjaxDisplay.java +++ b/src/main/java/edu/kit/typicalc/view/main/MathjaxDisplay.java @@ -16,7 +16,7 @@ public class MathjaxDisplay extends LitTemplate { * Creates the hello world template. */ public MathjaxDisplay() { - content.add("testtestetstest"); + content.add(getTranslation("abs-rule")); } }