Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: FlowingCode/CommonsDemo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3427c9e54e76b1917284cd84049b1f24e0effcc5
Choose a base ref
..
head repository: FlowingCode/CommonsDemo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f84ade871ee678d8346827b261af7d499619fdbd
Choose a head ref
Showing with 11 additions and 6 deletions.
  1. +5 −2 src/main/resources/META-INF/resources/frontend/code-viewer.ts
  2. +6 −4 src/test/java/com/flowingcode/vaadin/addons/demo/SampleDemoDefault.java
7 changes: 5 additions & 2 deletions src/main/resources/META-INF/resources/frontend/code-viewer.ts
Original file line number Diff line number Diff line change
@@ -30,6 +30,8 @@ export class CodeViewer extends LitElement {

private __license : Element[] = [];

env: any = {};

createRenderRoot() {
return this;
}
@@ -318,7 +320,8 @@ pre[class*="language-"] {
__eval(line: string) : string|undefined {
let expr = line.split(' ');
if (expr.length==3) {
if (expr[0]!='vaadin') {
const value = this.env[expr[0]];
if (value==undefined) {
return 'isfalse';
}

@@ -333,7 +336,7 @@ pre[class*="language-"] {
default: return undefined;
}};

switch (op('23',expr[2])) {
switch (op(value, expr[2])) {
case true: return 'istrue';
case false: return 'isfalse';
}
Original file line number Diff line number Diff line change
@@ -31,10 +31,12 @@ public class SampleDemoDefault extends Div {

public SampleDemoDefault() {
add(new Span("Demo component with defaulted @DemoSource annotation"));
//show-source System.out.println("this line will be displayed in the code snippet");
// show-source System.out.println("this line will be displayed in the code snippet");
this.getClass(); // hide-source (this line will not be displayed in the code snippet)
//#if vaadin ge 23
//show-source System.out.println("conditional code for Vaadin 23+");
//#endif
// #if vaadin ge 23
// show-source System.out.println("conditional code for Vaadin 23+");
// #elif vaadin ge 14
// show-source System.out.println("conditional code for Vaadin 14-22");
// #endif
}
}