mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-08 18:30:42 +00:00
Merge branch 'master' of https://git.scc.kit.edu/pse-typinferenz/typicalc
This commit is contained in:
commit
b728ced2af
@ -12,8 +12,9 @@
|
||||
#headerField {
|
||||
border-bottom: 2px solid #e8e8e8;
|
||||
background-color: #f8f8f8;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr repeat(1, auto) 1fr;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
padding: 0.5em 0em;
|
||||
border-radius: 5px 5px 0 0;
|
||||
@ -23,6 +24,11 @@
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
#copyButton {
|
||||
margin-left: auto;
|
||||
margin-right: 10%;
|
||||
}
|
||||
|
||||
#main {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
@ -7,6 +7,8 @@ import com.vaadin.flow.component.dependency.JsModule;
|
||||
import com.vaadin.flow.component.html.H4;
|
||||
import com.vaadin.flow.component.icon.Icon;
|
||||
import com.vaadin.flow.component.icon.VaadinIcon;
|
||||
import com.vaadin.flow.component.notification.Notification;
|
||||
import com.vaadin.flow.component.notification.NotificationVariant;
|
||||
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import com.vaadin.flow.i18n.LocaleChangeEvent;
|
||||
@ -30,6 +32,7 @@ public class InferenceRuleField extends VerticalLayout implements LocaleChangeOb
|
||||
private static final String HEADER_ID = "headerField";
|
||||
private static final String MAIN_ID = "main";
|
||||
private static final String RULE_NAME_ID = "ruleName";
|
||||
private static final String COPY_BUTTON_ID = "copyButton";
|
||||
|
||||
private final String nameKey;
|
||||
private final Button copyButton;
|
||||
@ -48,22 +51,25 @@ public class InferenceRuleField extends VerticalLayout implements LocaleChangeOb
|
||||
HorizontalLayout header = new HorizontalLayout();
|
||||
header.setId(HEADER_ID);
|
||||
this.ruleName = new H4(getTranslation(nameKey));
|
||||
this.copyButton = new Button(new Icon(VaadinIcon.CLIPBOARD));
|
||||
copyButton.addClickListener(event -> {
|
||||
UI.getCurrent().getPage().executeJs("window.copyToClipboard($0)", latex);
|
||||
Notification.show(getTranslation("root.copied")).addThemeVariants(NotificationVariant.LUMO_PRIMARY);
|
||||
});
|
||||
copyButton.setId(COPY_BUTTON_ID);
|
||||
ruleName.setId(RULE_NAME_ID);
|
||||
header.add(ruleName);
|
||||
header.add(ruleName, copyButton);
|
||||
|
||||
VerticalLayout main = new VerticalLayout();
|
||||
main.setId(MAIN_ID);
|
||||
this.copyButton = new Button(getTranslation("root.copyLatex"), new Icon(VaadinIcon.CLIPBOARD));
|
||||
MathjaxDisplay rule = new MathjaxDisplay(latex);
|
||||
copyButton.addClickListener(event -> UI.getCurrent().getPage().executeJs("window.copyToClipboard($0)", latex));
|
||||
main.add(rule, copyButton);
|
||||
main.add(rule);
|
||||
add(header, main);
|
||||
setId(INFERENCE_RULE_FIELD_ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void localeChange(LocaleChangeEvent event) {
|
||||
copyButton.setText(getTranslation("root.copyLatex"));
|
||||
ruleName.setText(getTranslation(nameKey));
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
root.close=Schließen
|
||||
root.save=Speichern
|
||||
root.copyLatex=Kopiere Latex-Code
|
||||
root.copied=LaTeX-Code in Zwischenablage kopiert.
|
||||
root.selectExample=Beispiel auswählen:
|
||||
root.typeInfer=Typisieren
|
||||
root.operatingHelp=Hilfe
|
||||
|
@ -1,6 +1,6 @@
|
||||
root.close=Close
|
||||
root.save=Save
|
||||
root.copyLatex=Copy latex code
|
||||
root.copied=LaTeX code copied to clipboard.
|
||||
root.selectExample=Select example:
|
||||
root.typeInfer=Type
|
||||
root.operatingHelp=Help
|
||||
|
Loading…
Reference in New Issue
Block a user