diff --git a/build.xml b/build.xml index 079a8b7d..c39fff14 100644 --- a/build.xml +++ b/build.xml @@ -1,7 +1,7 @@ - + diff --git a/examples/bobsmith/.classpath b/examples/bobsmith/.classpath index 68db325c..13d3191e 100644 --- a/examples/bobsmith/.classpath +++ b/examples/bobsmith/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/charts/.classpath b/examples/charts/.classpath index 80de3feb..52fc886e 100644 --- a/examples/charts/.classpath +++ b/examples/charts/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/composer/.classpath b/examples/composer/.classpath index 68db325c..13d3191e 100644 --- a/examples/composer/.classpath +++ b/examples/composer/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/dialog/.classpath b/examples/dialog/.classpath index 68db325c..13d3191e 100644 --- a/examples/dialog/.classpath +++ b/examples/dialog/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/dragdrop/.classpath b/examples/dragdrop/.classpath index 68db325c..13d3191e 100644 --- a/examples/dragdrop/.classpath +++ b/examples/dragdrop/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/feature/auth1/.classpath b/examples/feature/auth1/.classpath index f6856a60..c11f1439 100644 --- a/examples/feature/auth1/.classpath +++ b/examples/feature/auth1/.classpath @@ -27,8 +27,8 @@ - - + + diff --git a/examples/feature/itemmodel/.classpath b/examples/feature/itemmodel/.classpath index 68db325c..13d3191e 100644 --- a/examples/feature/itemmodel/.classpath +++ b/examples/feature/itemmodel/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/feature/mediaplayer/.classpath b/examples/feature/mediaplayer/.classpath index 68db325c..13d3191e 100644 --- a/examples/feature/mediaplayer/.classpath +++ b/examples/feature/mediaplayer/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/feature/serverpush/.classpath b/examples/feature/serverpush/.classpath index 68db325c..13d3191e 100644 --- a/examples/feature/serverpush/.classpath +++ b/examples/feature/serverpush/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/filetreetable/.classpath b/examples/filetreetable/.classpath index 68db325c..13d3191e 100644 --- a/examples/filetreetable/.classpath +++ b/examples/filetreetable/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/form/.classpath b/examples/form/.classpath index 68db325c..13d3191e 100644 --- a/examples/form/.classpath +++ b/examples/form/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/googlemap/.classpath b/examples/googlemap/.classpath index 68db325c..13d3191e 100644 --- a/examples/googlemap/.classpath +++ b/examples/googlemap/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/hello-mvn/pom.xml b/examples/hello-mvn/pom.xml index 5a1129cd..108aedb7 100644 --- a/examples/hello-mvn/pom.xml +++ b/examples/hello-mvn/pom.xml @@ -29,7 +29,7 @@ eu.webtoolkit jwt - 4.11.0 + 4.11.1 diff --git a/examples/hello/.classpath b/examples/hello/.classpath index 68db325c..13d3191e 100644 --- a/examples/hello/.classpath +++ b/examples/hello/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/hellowidgetset/.classpath b/examples/hellowidgetset/.classpath index 68db325c..13d3191e 100644 --- a/examples/hellowidgetset/.classpath +++ b/examples/hellowidgetset/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/javascript/.classpath b/examples/javascript/.classpath index 68db325c..13d3191e 100644 --- a/examples/javascript/.classpath +++ b/examples/javascript/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/mandelbrot/.classpath b/examples/mandelbrot/.classpath index 68db325c..13d3191e 100644 --- a/examples/mandelbrot/.classpath +++ b/examples/mandelbrot/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/mission/.classpath b/examples/mission/.classpath index 68db325c..13d3191e 100644 --- a/examples/mission/.classpath +++ b/examples/mission/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/painting/.classpath b/examples/painting/.classpath index 0003f96b..832a3bba 100644 --- a/examples/painting/.classpath +++ b/examples/painting/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/planner/.classpath b/examples/planner/.classpath index c1943aa3..bc979c29 100644 --- a/examples/planner/.classpath +++ b/examples/planner/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/simplechat/.classpath b/examples/simplechat/.classpath index 68db325c..13d3191e 100644 --- a/examples/simplechat/.classpath +++ b/examples/simplechat/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/style/.classpath b/examples/style/.classpath index 68db325c..13d3191e 100644 --- a/examples/style/.classpath +++ b/examples/style/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/textedit/.classpath b/examples/textedit/.classpath index 68db325c..13d3191e 100644 --- a/examples/textedit/.classpath +++ b/examples/textedit/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/treeview/.classpath b/examples/treeview/.classpath index 68db325c..13d3191e 100644 --- a/examples/treeview/.classpath +++ b/examples/treeview/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/treeviewdragdrop/.classpath b/examples/treeviewdragdrop/.classpath index 2260baf0..48d47e17 100644 --- a/examples/treeviewdragdrop/.classpath +++ b/examples/treeviewdragdrop/.classpath @@ -4,7 +4,7 @@ - + diff --git a/examples/widgetgallery/.classpath b/examples/widgetgallery/.classpath index 82b2eb69..95a37304 100644 --- a/examples/widgetgallery/.classpath +++ b/examples/widgetgallery/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/widgetgallery/src/eu/webtoolkit/jwt/examples/widgetgallery/FormWidgets.java b/examples/widgetgallery/src/eu/webtoolkit/jwt/examples/widgetgallery/FormWidgets.java index d15a0a4d..96ebcb8a 100644 --- a/examples/widgetgallery/src/eu/webtoolkit/jwt/examples/widgetgallery/FormWidgets.java +++ b/examples/widgetgallery/src/eu/webtoolkit/jwt/examples/widgetgallery/FormWidgets.java @@ -211,6 +211,7 @@ private WWidget slider() { result.bindWidget("Slider", Slider()); result.bindWidget("SliderVertical", SliderVertical()); result.bindWidget("SliderSteps", SliderSteps()); + result.bindWidget("SliderNative", SliderNative()); return result; } @@ -989,6 +990,29 @@ WWidget SliderSteps() { return container; } + WWidget SliderNative() { + WContainerWidget container = new WContainerWidget(); + new WText("What is your favorite odd number?", (WContainerWidget) container); + new WBreak((WContainerWidget) container); + final WSlider slider = new WSlider((WContainerWidget) container); + slider.resize(new WLength(300), new WLength(50)); + slider.setNativeControl(true); + slider.setTickInterval(10); + slider.setRange(1, 99); + slider.setStep(2); + new WBreak((WContainerWidget) container); + final WText out = new WText((WContainerWidget) container); + out.setMargin(new WLength(10), EnumSet.of(Side.Left)); + slider + .valueChanged() + .addListener( + this, + () -> { + out.setText("So your favorite odd number is " + slider.getValueText() + " !"); + }); + return container; + } + WWidget ProgressBar() { WContainerWidget container = new WContainerWidget(); container.setStyleClass("inline-buttons"); diff --git a/examples/widgetgallery/src/eu/webtoolkit/jwt/examples/widgetgallery/src.xml b/examples/widgetgallery/src/eu/webtoolkit/jwt/examples/widgetgallery/src.xml index aada896d..04b25dc8 100644 --- a/examples/widgetgallery/src/eu/webtoolkit/jwt/examples/widgetgallery/src.xml +++ b/examples/widgetgallery/src/eu/webtoolkit/jwt/examples/widgetgallery/src.xml @@ -4465,6 +4465,30 @@ out.setText("I was born in the year " + slider.getValueText() + "."); }); } + + ]]> +
  void SliderNative() {
+    WContainerWidget container = new WContainerWidget();
+    new WText("What is your favorite odd number?", (WContainerWidget) container);
+    new WBreak((WContainerWidget) container);
+    final WSlider slider = new WSlider((WContainerWidget) container);
+    slider.resize(new WLength(300), new WLength(50));
+    slider.setNativeControl(true);
+    slider.setTickInterval(10);
+    slider.setRange(1, 99);
+    slider.setStep(2);
+    new WBreak((WContainerWidget) container);
+    final WText out = new WText((WContainerWidget) container);
+    out.setMargin(new WLength(10), EnumSet.of(Side.Left));
+    slider
+        .valueChanged()
+        .addListener(
+            this,
+            () -> {
+              out.setText("So your favorite odd number is " + slider.getValueText() + " !");
+            });
+  }
 
]]>

Top

+ +

Native slider

+

+ You can use a native HTML5 slider by using setNativeControl(true). This allow + the user to use arrow keys to change the value of the slider. However this does not support + setTickPosition() and setTickLength(). +

+ +
+ Example + ${SliderNative} + ${src SliderNative} +
+ +

Top

diff --git a/jwt-4.11.0.pom b/jwt-4.11.1.pom similarity index 98% rename from jwt-4.11.0.pom rename to jwt-4.11.1.pom index a990a4a5..5f76e1b5 100644 --- a/jwt-4.11.0.pom +++ b/jwt-4.11.1.pom @@ -10,7 +10,7 @@ jwt jar Java Web Toolkit - 4.11.0 + 4.11.1 Java library for developing web applications https://webtoolkit.eu/jwt/ diff --git a/jwt-auth-4.11.0.pom b/jwt-auth-4.11.1.pom similarity index 95% rename from jwt-auth-4.11.0.pom rename to jwt-auth-4.11.1.pom index d55ff700..3107abd2 100644 --- a/jwt-auth-4.11.0.pom +++ b/jwt-auth-4.11.1.pom @@ -10,7 +10,7 @@ jwt-auth jar Java Web Toolkit Authentication Library - 4.11.0 + 4.11.1 Authentication library for the Java Web Toolkit https://webtoolkit.eu/jwt/ @@ -31,7 +31,7 @@ eu.webtoolkit jwt - 4.11.0 + 4.11.1 diff --git a/overview.html b/overview.html index 3fc3ca45..ba4df823 100755 --- a/overview.html +++ b/overview.html @@ -11,7 +11,7 @@ dd p { margin-top: 0px; } dd div { margin: 10px 0px; } -JWt 4.11.0 +JWt 4.11.1 @@ -25,10 +25,62 @@

Release notes

the way you build JWt, the way you configure JWt or the JWt API and behaviour. It also indicates the main changes from version to verison. +

Release 4.11.1 (November 5, 2024)

+ +

JWt 4.11.1 is a patch release that addresses the following issues:

+ +
    +
  • + Issue #13041: + Increase the default number of iteration of Auth::BCryptHashFunction to 12. A warning message will also be logged when using Auth::BCryptHashFunction with less than the minumum of 10 iterations that ASVS recommends. +
  • +
  • + Issue #11868: + Added the WStackedWidget::currentWidgetChanged() signal that is emitted when the WStackedWidget changes the element that it shows. +
  • +
  • + Issue #13106: + ensure that the correct disabled class is used on a per-theme basis. This wrongly affected all Bootstrap themes. +
  • +
  • + Issue #13104: + a Bootstrap 5 WDialog is now correctly raised to the front when WDialog::raiseToFront() is called. +
  • +
  • + Issue #12813: + Added the possibility for each column of + WAbstractItemView to be set resizable or not independently using the + WAbstractItemView::setColumnResizeEnabled(), and WAbstractItemView::setColumnResizeEnabled() functions. +
  • +
  • + Issue #11855: + the loading indicator should now be shown directly when the indicator-timeout is set to 0 instead of having a few millisecond delay. + This can be set by the <application-settings><indicator-timeout>0</indicator-timeout></application-settings> property in the wt_config.xml. +
  • +
  • + Issue #7856: + Fix a bug where change() and input() signals would sometimes not be emitted by a + WSlider with native control if progressive bootstrap was enabled. +
  • +
  • + Issue #11001: + Delete the extra space that was sometimes added before the first and after last element of a + WBoxLayout if the spacing was more than twice as big as the margin. +
  • +
  • + Issue #11008: + ensure that a JavaScript variable that retrieves the index of an item in a layout is called correctly. +
  • +
  • + Issue #13115: + Fix a bug where a widget removed from a disabled parent widget and added to a different enabled parent widget would still appear disabled. +
  • +
+

Release 4.11.0 (October 1, 2024)

- Wt 4.11.0 is a major release that includes the ability to enable MFA for authentication. + JWt 4.11.0 is a major release that includes the ability to enable MFA for authentication. JWt is now able to support MFA in its authentication system. It is easily enabled with a single call to AuthService::setMfaProvider(). By default an implementation for TOTP is included. This offers a way to enable an additional layer of security for your applications. Instead of remembering a single password, users can be made to enter a short code that changes often, as an additional authentication step. Developers are also able to implement this feature in any way they see fit via the interface AbstractMfaProcess. @@ -90,7 +142,7 @@

Bug fixes

Release 4.10.4 (March 6, 2024)

- Wt 4.10.4 is a (smaller) patch release that addresses the following issues. + JWt 4.10.4 is a (smaller) patch release that addresses the following issues. This release is somewhat smaller due to bigger features being in the works. Developers can expect some bigger new features in the authentication framework soon!

@@ -113,7 +165,7 @@

Release 4.10.4 (March 6, 2024)

Release 4.10.3 (December 20, 2023)

- Wt 4.10.3 is a patch release that addresses the following issues: + JWt 4.10.3 is a patch release that addresses the following issues:

    @@ -144,7 +196,7 @@

    Release 4.10.3 (December 20, 2023)

    Release 4.10.2 (November 8, 2023)

    - Wt 4.10.2 is a patch release that addresses the following issues: + JWt 4.10.2 is a patch release that addresses the following issues:

      @@ -220,7 +272,7 @@

      Other improvements

      Release 4.9.2 (April 18, 2023)

      - Wt 4.9.2 is a patch release that addresses the following issues: + JWt 4.9.2 is a patch release that addresses the following issues:

        diff --git a/src/eu/webtoolkit/jwt/DomElement.java b/src/eu/webtoolkit/jwt/DomElement.java index 5c41be69..0fc7ea75 100644 --- a/src/eu/webtoolkit/jwt/DomElement.java +++ b/src/eu/webtoolkit/jwt/DomElement.java @@ -331,7 +331,7 @@ public void setEvent( js.append("o=this;"); if (anchorClick) { js.append( - "if(e.ctrlKey||e.metaKey||e.shiftKey||(Wt4_11_0.button(e) > 1))return true;else{"); + "if(e.ctrlKey||e.metaKey||e.shiftKey||(Wt4_11_1.button(e) > 1))return true;else{"); } js.append(jsCode); if (isExposed) { @@ -438,7 +438,7 @@ public void setTimeout(int delay, int interval) { public void callMethod(final String method) { ++this.numManipulations_; if (this.var_.length() == 0) { - this.javaScript_.append("Wt4_11_0").append(".$('").append(this.id_).append("')."); + this.javaScript_.append("Wt4_11_1").append(".$('").append(this.id_).append("')."); } else { this.javaScript_.append(this.var_).append('.'); } @@ -493,7 +493,7 @@ public final void removeAllChildren() { } /** Removes the element. */ public void removeFromParent() { - this.callJavaScript("Wt4_11_0.remove('" + this.getId() + "');", true); + this.callJavaScript("Wt4_11_1.remove('" + this.getId() + "');", true); } /** Replaces the element by another element. */ public void replaceWith(DomElement newElement) { @@ -582,7 +582,7 @@ public String asJavaScript(final EscapeOStream out, DomElement.Priority priority if (this.removeAllChildren_ >= 0) { this.declare(out); if (this.removeAllChildren_ == 0) { - out.append("Wt4_11_0").append(".setHtml(").append(this.var_).append(", '');\n"); + out.append("Wt4_11_1").append(".setHtml(").append(this.var_).append(", '');\n"); } else { out.append("(Array.from(") .append(this.var_) @@ -615,18 +615,18 @@ public String asJavaScript(final EscapeOStream out, DomElement.Priority priority if (this.properties_.get(Property.StyleDisplay) != null) { String style = this.properties_.get(Property.StyleDisplay); if (style.equals("none")) { - out.append("Wt4_11_0.hide('").append(this.id_).append("');\n"); + out.append("Wt4_11_1.hide('").append(this.id_).append("');\n"); return this.var_; } else { if (style.equals("inline")) { - out.append("Wt4_11_0.inline('" + this.id_ + "');\n"); + out.append("Wt4_11_1.inline('" + this.id_ + "');\n"); return this.var_; } else { if (style.equals("block")) { - out.append("Wt4_11_0.block('" + this.id_ + "');\n"); + out.append("Wt4_11_1.block('" + this.id_ + "');\n"); return this.var_; } else { - out.append("Wt4_11_0.show('") + out.append("Wt4_11_1.show('") .append(this.id_) .append("', '") .append(style) @@ -643,7 +643,7 @@ public String asJavaScript(final EscapeOStream out, DomElement.Priority priority } } if (this.unwrapped_) { - out.append("Wt4_11_0.unwrap('").append(this.id_).append("');\n"); + out.append("Wt4_11_1.unwrap('").append(this.id_).append("');\n"); } this.processEvents(app); this.processProperties(app); @@ -660,7 +660,7 @@ public String asJavaScript(final EscapeOStream out, DomElement.Priority priority .append(");\n"); this.replaced_.createElement(out, app, insertJs.toString()); if (this.unstubbed_) { - out.append("Wt4_11_0.unstub(") + out.append("Wt4_11_1.unstub(") .append(this.var_) .append(',') .append(varr) @@ -686,14 +686,14 @@ public String asJavaScript(final EscapeOStream out, DomElement.Priority priority } if (!this.childrenToSave_.isEmpty()) { this.declare(out); - out.append("Wt4_11_0").append(".saveReparented(").append(this.var_).append(");"); + out.append("Wt4_11_1").append(".saveReparented(").append(this.var_).append(");"); } for (int i = 0; i < this.childrenToSave_.size(); ++i) { out.append("var c") .append(this.var_) .append((int) i) .append('=') - .append("Wt4_11_0.$('") + .append("Wt4_11_1.$('") .append(this.childrenToSave_.get(i)) .append("')"); if (app.getEnvironment().agentIsIE()) { @@ -715,7 +715,7 @@ public String asJavaScript(final EscapeOStream out, DomElement.Priority priority } this.renderInnerHtmlJS(out, app); for (int i = 0; i < this.childrenToSave_.size(); ++i) { - out.append("Wt4_11_0.replaceWith('") + out.append("Wt4_11_1.replaceWith('") .append(this.childrenToSave_.get(i)) .append("',c") .append(this.var_) @@ -1106,7 +1106,7 @@ public void declare(final EscapeOStream out) { if (this.var_.length() == 0) { out.append("var ") .append(this.getCreateVar()) - .append("=Wt4_11_0.$('") + .append("=Wt4_11_1.$('") .append(this.id_) .append("');\n"); } @@ -1351,7 +1351,7 @@ private void processEvents(WApplication app) { DomElement.EventHandler keypress = this.eventHandlers_.get(S_keypress); if (keypress != null && keypress.jsCode.length() != 0) { MapUtils.access(self.eventHandlers_, S_keypress, DomElement.EventHandler.class).jsCode = - "if (Wt4_11_0.isKeyPress(event)){" + "if (Wt4_11_1.isKeyPress(event)){" + MapUtils.access(self.eventHandlers_, S_keypress, DomElement.EventHandler.class) .jsCode + '}'; @@ -1367,7 +1367,7 @@ private void processProperties(WApplication app) { if (minw != null || maxw != null) { if (w == null) { StringBuilder expr = new StringBuilder(); - expr.append("Wt4_11_0.IEwidth(this,"); + expr.append("Wt4_11_1.IEwidth(this,"); if (minw != null) { expr.append('\'').append(minw).append('\''); self.properties_.remove(Property.StyleMinWidth); @@ -1406,7 +1406,7 @@ private void setJavaScriptProperties(final EscapeOStream out, WApplication app) if (this.willRenderInnerHtmlJS(app)) { break; } - out.append("Wt4_11_0.setHtml(").append(this.var_).append(','); + out.append("Wt4_11_1.setHtml(").append(this.var_).append(','); if (!pushed) { escaped.pushEscape(EscapeOStream.RuleSet.JsStringLiteralSQuote); pushed = true; @@ -1645,7 +1645,7 @@ private String addToParent( StringBuilder insertJS = new StringBuilder(); if (pos != -1) { insertJS - .append("Wt4_11_0.insertAt(") + .append("Wt4_11_1.insertAt(") .append(parentVar) .append(",") .append(this.var_) @@ -1679,7 +1679,7 @@ private void renderInnerHtmlJS(final EscapeOStream out, WApplication app) { || !this.childrenHtml_.isEmpty() || innerHTML.length() != 0) { this.declare(out); - out.append("Wt4_11_0.setHtml(").append(this.var_).append(",'"); + out.append("Wt4_11_1.setHtml(").append(this.var_).append(",'"); out.pushEscape(EscapeOStream.RuleSet.JsStringLiteralSQuote); List timeouts = new ArrayList(); EscapeOStream js = new EscapeOStream(); diff --git a/src/eu/webtoolkit/jwt/FlexLayoutImpl.java b/src/eu/webtoolkit/jwt/FlexLayoutImpl.java index 93a6ea34..4cc97654 100644 --- a/src/eu/webtoolkit/jwt/FlexLayoutImpl.java +++ b/src/eu/webtoolkit/jwt/FlexLayoutImpl.java @@ -86,7 +86,7 @@ public void updateDom(final DomElement parent) { } this.addedItems_.clear(); for (int i = 0; i < this.removedItems_.size(); ++i) { - div.callJavaScript("Wt4_11_0.remove('" + this.removedItems_.get(i) + "');", true); + div.callJavaScript("Wt4_11_1.remove('" + this.removedItems_.get(i) + "');", true); } this.removedItems_.clear(); div.callMethod("layout.adjust()"); @@ -118,11 +118,11 @@ public DomElement createDomElement( margin[2] = this.getLayout().getContentsMargin(Side.Bottom); Orientation orientation = this.getOrientation(); if (orientation == Orientation.Horizontal) { - margin[3] = Math.max(0, margin[3] - this.grid_.horizontalSpacing_ / 2); - margin[1] = Math.max(0, margin[1] - (this.grid_.horizontalSpacing_ + 1) / 2); + margin[3] = Math.max(0, margin[3]); + margin[1] = Math.max(0, margin[1]); } else { - margin[0] = Math.max(0, margin[0] - this.grid_.verticalSpacing_ / 2); - margin[2] = Math.max(0, margin[2] - (this.grid_.horizontalSpacing_ + 1) / 2); + margin[0] = Math.max(0, margin[0]); + margin[2] = Math.max(0, margin[2]); } ResizeSensor.applyIfNeeded(this.getContainer()); result = parent; @@ -155,7 +155,7 @@ public DomElement createDomElement( result.addChild(el); } StringBuilder js = new StringBuilder(); - js.append("layout=new Wt4_11_0.FlexLayout(") + js.append("layout=new Wt4_11_1.FlexLayout(") .append(app.getJavaScriptClass()) .append(",'") .append(this.elId_) @@ -322,20 +322,36 @@ private DomElement createElement( } switch (this.getDirection()) { case LeftToRight: - m[3] += (this.grid_.horizontalSpacing_ + 1) / 2; - m[1] += this.grid_.horizontalSpacing_ / 2; + if (index != 0) { + m[3] += (this.grid_.horizontalSpacing_ + 1) / 2; + } + if (index != this.count(orientation) - 1) { + m[1] += this.grid_.horizontalSpacing_ / 2; + } break; case RightToLeft: - m[1] += (this.grid_.horizontalSpacing_ + 1) / 2; - m[3] += this.grid_.horizontalSpacing_ / 2; + if (index != 0) { + m[1] += (this.grid_.horizontalSpacing_ + 1) / 2; + } + if (index != this.count(orientation) - 1) { + m[3] += this.grid_.horizontalSpacing_ / 2; + } break; case TopToBottom: - m[0] += (this.grid_.horizontalSpacing_ + 1) / 2; - m[2] += this.grid_.horizontalSpacing_ / 2; + if (index != 0) { + m[0] += (this.grid_.horizontalSpacing_ + 1) / 2; + } + if (index != this.count(orientation) - 1) { + m[2] += this.grid_.horizontalSpacing_ / 2; + } break; case BottomToTop: - m[2] += (this.grid_.horizontalSpacing_ + 1) / 2; - m[0] += this.grid_.horizontalSpacing_ / 2; + if (index != 0) { + m[2] += (this.grid_.horizontalSpacing_ + 1) / 2; + } + if (index != this.count(orientation) - 1) { + m[0] += this.grid_.horizontalSpacing_ / 2; + } break; } if (m[0] != 0 || m[1] != 0 || m[2] != 0 || m[3] != 0) { diff --git a/src/eu/webtoolkit/jwt/PaintedSlider.java b/src/eu/webtoolkit/jwt/PaintedSlider.java index 7dd3c50a..96cb0258 100644 --- a/src/eu/webtoolkit/jwt/PaintedSlider.java +++ b/src/eu/webtoolkit/jwt/PaintedSlider.java @@ -144,7 +144,7 @@ public void updateState() { char[] buf = new char[30]; StringBuilder mouseDownJS = new StringBuilder(); mouseDownJS - .append("obj.setAttribute('down', Wt4_11_0") + .append("obj.setAttribute('down', Wt4_11_1") .append(".widgetCoordinates(obj, event).") .append(u) .append(");"); @@ -200,7 +200,7 @@ public void updateState() { StringBuilder mouseMovedJS = new StringBuilder(); mouseMovedJS .append("var down = obj.getAttribute('down');") - .append("var WT = Wt4_11_0;") + .append("var WT = Wt4_11_1;") .append("if (down != null && down != '') {") .append(computeD.toString()); mouseMovedJS @@ -244,7 +244,7 @@ public void updateState() { StringBuilder mouseUpJS = new StringBuilder(); mouseUpJS .append("var down = obj.getAttribute('down');") - .append("var WT = Wt4_11_0;") + .append("var WT = Wt4_11_1;") .append("if (down != null && down != '') {") .append(computeD.toString()) .append("d += ") diff --git a/src/eu/webtoolkit/jwt/ResizeSensor.java b/src/eu/webtoolkit/jwt/ResizeSensor.java index 10d7688c..937a70ac 100644 --- a/src/eu/webtoolkit/jwt/ResizeSensor.java +++ b/src/eu/webtoolkit/jwt/ResizeSensor.java @@ -29,7 +29,7 @@ public static void applyIfNeeded(WWidget w) { loadJavaScript(app); w.setJavaScriptMember(" ResizeSensor", ""); w.setJavaScriptMember( - " ResizeSensor", "new Wt4_11_0.ResizeSensor(Wt4_11_0," + w.getJsRef() + ")"); + " ResizeSensor", "new Wt4_11_1.ResizeSensor(Wt4_11_1," + w.getJsRef() + ")"); } } diff --git a/src/eu/webtoolkit/jwt/StdGridLayoutImpl2.java b/src/eu/webtoolkit/jwt/StdGridLayoutImpl2.java index 0ec9a1fa..5518cb3c 100644 --- a/src/eu/webtoolkit/jwt/StdGridLayoutImpl2.java +++ b/src/eu/webtoolkit/jwt/StdGridLayoutImpl2.java @@ -93,7 +93,7 @@ public void updateDom(final DomElement parent) { } this.addedItems_.clear(); for (int i = 0; i < this.removedItems_.size(); ++i) { - parent.callJavaScript("Wt4_11_0.remove('" + this.removedItems_.get(i) + "');", true); + parent.callJavaScript("Wt4_11_1.remove('" + this.removedItems_.get(i) + "');", true); } this.removedItems_.clear(); parent.addChild(div); @@ -189,7 +189,7 @@ public DomElement createDomElement( } StringBuilder js = new StringBuilder(); js.append(app.getJavaScriptClass()) - .append(".layouts2.add(new Wt4_11_0.StdLayout2(") + .append(".layouts2.add(new Wt4_11_1.StdLayout2(") .append(app.getJavaScriptClass()) .append(",'") .append(this.getId()) @@ -741,7 +741,7 @@ static WJavaScriptPreamble wtjs1() { JavaScriptScope.WtClassScope, JavaScriptObjectType.JavaScriptConstructor, "StdLayout2", - "(function(e,t,i,s,n,o,l,f,r,c,a){const d=e.WT;this.descendants=[];const u=1e6,g=\"-\"+u+\"px\",h=this;let p,m,z,x,y,S,w=a,L=!0,W=!0,b=!1;const E=document.body.classList.contains(\"Wt-rtl\"),M=[{initialized:!1,config:w.cols,margins:r,maxSize:l,measures:[],sizes:[],stretched:[],fixedSize:[],Left:E?\"Right\":\"Left\",left:E?\"right\":\"left\",Right:E?\"Left\":\"Right\",Size:\"Width\",size:\"width\",alignBits:0,getItem:function(e,t){return w.items[t*M[0].config.length+e]},setItem:function(e,t,i){w.items[t*M[0].config.length+e]=i},handleClass:\"Wt-vrh2\",resizeDir:\"h\",resizerClass:\"Wt-hsh2\",fitSize:s,resizeHandles:[]},{initialized:!1,config:w.rows,margins:c,maxSize:f,measures:[],sizes:[],stretched:[],fixedSize:[],Left:\"Top\",left:\"top\",Right:\"Bottom\",Size:\"Height\",size:\"height\",alignBits:4,getItem:function(e,t){return w.items[e*M[0].config.length+t]},setItem:function(e,t,i){w.items[e*M[0].config.length+t]=i},handleClass:\"Wt-hrh2\",resizeDir:\"v\",resizerClass:\"Wt-vsh2\",fitSize:n,resizeHandles:[]}];document.getElementById(t).wtLayout=this;function R(e){for(const t of w.items)if(t&&t.id===e)return t;return null}function H(e,t,i,s){const n=M[t];let o,l,f=t?e.scrollHeight:e.scrollWidth;if(0===t){const i=d.pxself(e,n.left);if(f+i>s.clientWidth||f+i===s.clientWidth&&d.isGecko&&\"hidden\"===s.parentNode.parentNode.style.visibility){o=e.style[n.left];T(e,n.left,g);f=t?e.scrollHeight:e.scrollWidth}}let r=t?e.clientHeight:e.clientWidth;if(d.isGecko&&!e.style[n.size]&&0===t&&(\"visible\"===(c=d.css(e,\"overflow\"))||\"none\"===c)){l=e.style[n.size];T(e,n.size,\"\")}var c;let a=t?e.offsetHeight:e.offsetWidth;o&&T(e,n.left,o);l&&T(e,n.size,l);r>=u&&(r-=u);f>=u&&(f-=u);a>=u&&(a-=u);if(0===f){f=d.pxself(e,n.size);0===f||d.isOpera||d.isGecko||(f-=d.px(e,\"border\"+n.Left+\"Width\")+d.px(e,\"border\"+n.Right+\"Width\"))}if(f>a)if(0===d.pxself(e,n.size))f=r;else{let t=!1;e.querySelectorAll(\".Wt-popup\").forEach((function(e){\"none\"!==e.style.display&&(t=!0)}));t&&(f=r)}const h=d.px(e,\"border\"+n.Left+\"Width\")+d.px(e,\"border\"+n.Right+\"Width\"),p=a-(r+h)!=0;if(i)return[f,p];(d.isGecko||d.isWebKit)&&0===t&&e.getBoundingClientRect().width!==Math.ceil(e.getBoundingClientRect().width)&&(f+=1);d.boxSizing(e)||d.isOpera||(f+=h);f+=d.px(e,\"margin\"+n.Left)+d.px(e,\"margin\"+n.Right);d.boxSizing(e)||(f+=d.px(e,\"padding\"+n.Left)+d.px(e,\"padding\"+n.Right));f+=a-(r+h);f0&&(f=Math.min(m,f));return[Math.round(f),p]}function N(e,t){const i=M[t];if(\"none\"===e.style.display)return 0;if(e[\"layoutMin\"+i.Size])return e[\"layoutMin\"+i.Size];{let t=d.px(e,\"min\"+i.Size);d.boxSizing(e)||(t+=d.px(e,\"padding\"+i.Left)+d.px(e,\"padding\"+i.Right));return t}}function C(e,t){const i=M[t];let s=d.px(e,\"margin\"+i.Left)+d.px(e,\"margin\"+i.Right);d.boxSizing(e)||(s+=d.px(e,\"border\"+i.Left+\"Width\")+d.px(e,\"border\"+i.Right+\"Width\")+d.px(e,\"padding\"+i.Left)+d.px(e,\"padding\"+i.Right));return s}function v(e,t){const i=M[t];return d.px(e,\"padding\"+i.Left)+d.px(e,\"padding\"+i.Right)}function D(e,t){if(d.boxSizing(e)){const i=M[t];return d.px(e,\"border\"+i.Left+\"Width\")+d.px(e,\"border\"+i.Right+\"Width\")+d.px(e,\"padding\"+i.Left)+d.px(e,\"padding\"+i.Right)}return 0}function I(e,t){const i=M[t];return Math.round(d.px(e,\"border\"+i.Left+\"Width\")+d.px(e,\"border\"+i.Right+\"Width\")+d.px(e,\"margin\"+i.Left)+d.px(e,\"margin\"+i.Right)+d.px(e,\"padding\"+i.Left)+d.px(e,\"padding\"+i.Right))}function A(t,i,s){t.dirty=Math.max(t.dirty,i);L=!0;s&&e.layouts2.scheduleAdjust()}function T(e,t,i){if(e.style[t]!==i){e.style[t]=i;return!0}return!1}function j(e){return\"none\"===e.style.display&&!e.ed||e.classList.contains(\"Wt-hidden\")}this.updateSizeInParent=function(e){if(m&&z.id){const e=d.$(z.id);if(e){if(z!==e){m=e.parentNode.wtLayout;m?z=e:G()}}else G()}if(m&&x){const i=M[e];let s=i.measures[2];i.maxSize>0&&(s=Math.min(i.maxSize,s));if(S){const i=d.getElement(t);if(!i)return;let n=i,o=n.parentNode;for(;;){o.wtGetPS&&(s=o.wtGetPS(o,n,e,s));s+=I(o,e);if(o===z)break;1===e&&o===i.parentNode&&!o.lh&&o.offsetHeight>s&&(s=o.offsetHeight);n=o;o=n.parentNode}}else s+=y[e];m.setChildSize(z,e,s)}};function B(i,s,n){const o=s.di,l=M[i],f=M[1^i],r=d.getElement(t);let c,a,u;for(u=o-1;u>=0;--u)if(l.sizes[u]>=0){c=-(l.sizes[u]-l.measures[1][u]);break}a=l.sizes[o]-l.measures[1][o];E&&([c,a]=[-a,-c]);new d.SizeHandle(d,l.resizeDir,d.pxself(s,l.size),d.pxself(s,f.size),c,a,l.resizerClass,(function(t){!function(t,i,s){const n=M[t];E&&(s=-s);if(n.config[i][0]>0&&0===n.config[i+1][0]){++i;s=-s}n.fixedSize[i]=n.sizes[i]+s;e.layouts2.scheduleAdjust()}(i,u,t)}),s,r,n,0,0)}function P(e,t){const i=e.config.length;if(0!==e.config[t][1])for(let s=t+1;s-1)return!0;for(let i=t-1;i>=0;--i)if(e.measures[1][i]>-1)return 0!==e.config[i][1];return!1}this.setConfig=function(t){const i=w;w=t;M[0].config=w.cols;M[1].config=w.rows;M[0].stretched=[];M[1].stretched=[];for(const e of i.items)if(e){const t=R(e.id);if(t){t.ps=e.ps;t.sc=e.sc;t.ms=e.ms;t.size=e.size;t.psize=e.psize;t.fs=e.fs;t.margin=e.margin;t.set=e.set}else if(e.set){e.set[0]&&T(e.w,M[0].size,\"\");e.set[1]&&T(e.w,M[1].size,\"\")}}W=!0;L=!0;e.layouts2.scheduleAdjust()};this.getId=function(){return t};this.setElDirty=function(t){const i=R(t.id);if(i){i.dirty=2;L=!0;e.layouts2.scheduleAdjust()}};this.setItemsDirty=function(t){const i=M[0].config.length;for(const[s,n]of t){const t=w.items[s*i+n];if(t){t.dirty=2;if(t.layout){t.layout=!1;t.wasLayout=!0;e.layouts2.setChildLayoutsDirty(h,t.w)}}}L=!0};this.setDirty=function(){W=!0};this.setAllDirty=function(){for(const e of w.items)e&&(e.dirty=2);L=!0};this.setChildSize=function(e,t,i){const s=M[0].config.length,n=M[t];let o;const l=R(e.id);if(l){const e=0===t?o%s:o/s;if(l.align>>n.alignBits&15||!n.stretched[e]){l.ps||(l.ps=[]);l.ps[t]=i}l.layout=!0;A(l,1)}};function G(){const e=d.getElement(t);p=null===i;m=null;z=null;x=!0;b=!0;y=[];S=!1;if(p){let t=e,i=t.parentNode;y=[0,0];for(;i!==document&&!t.classList.contains(\"wt-reparented\");){y[0]+=I(i,0);y[1]+=I(i,1);i.wtGetPS&&(S=!0);const e=i.parentNode.wtLayout;if(e){z=i;m=e;break}t=i;i=t.parentNode;1===i.childNodes.length||i.wtGetPS||(x=!1)}const s=e.parentNode;for(let e=0;e<2;++e)M[e].sizeSet=0!==d.pxself(s,M[e].size)}else{m=document.getElementById(i).wtLayout;z=e;y[0]=I(z,0);y[1]=I(z,1)}}this.measure=function(e){const i=d.getElement(t);if(i&&!d.isHidden(i)){b||G();if(L||W){!function(e,t,i){const s=M[e],n=M[1^e],l=s.measures,f=s.config.length,r=n.config.length,c=l.slice();if(5===c.length){c[0]=c[0].slice();c[1]=c[1].slice()}if(L){if(i&&void 0===s.minSize){s.minSize=d.px(i,\"min\"+s.Size);s.minSize>0&&(s.minSize-=D(i,e))}const u=[],g=[];let p,m;const z=!0;let x=!1;for(let b=0;b1){const G=d.$(B.id);if(!G){s.setItem(b,I,null);continue}if(G!==B.w){B.w=G;const k=B;[G,...G.querySelectorAll(\"img\")].filter((e=>\"IMG\"===e.tagName)).forEach((function(e){e.addEventListener(\"load\",(function(){A(k,1,!0)}))}))}}if(!o&&\"absolute\"!==B.w.style.position){B.w.style.position=\"absolute\";B.w.style.visibility=\"hidden\"}B.ps||(B.ps=[]);B.sc||(B.sc=[]);B.ms||(B.ms=[]);B.size||(B.size=[]);B.psize||(B.psize=[]);B.fs||(B.fs=[]);B.margin||(B.margin=[]);const P=!B.set;B.set||(B.set=[!1,!1]);if(j(B.w)){B.ps[e]=B.ms[e]=0;continue}if(B.w){if(B.dirty){let _;if(B.dirty>1){_=N(B.w,e);B.ms[e]=_}else _=B.ms[e];B.dirty>1&&(B.margin[e]=C(B.w,e));if(!B.set[e])if(0!==e&&P){const $=Math.round(d.px(B.w,s.size));$>Math.max(D(B.w,e),_)?B.fs[e]=$+B.margin[e]:B.fs[e]=0}else{const J=d.pxself(B.w,s.size);B.fs[e]=J?J+B.margin[e]:0}const q=B.align>>s.alignBits&15;let O=B.fs[e];if(q||z||s.config[b][0]<=0)if(B.layout){0===O&&(O=B.ps[e]);B.ps[e]=O}else{if(B.wasLayout){B.wasLayout=!1;B.set=[!1,!1];B.ps=[];B.w.wtResize&&B.w.wtResize(B.w,-1,-1,!0);T(B.w,M[1].size,\"\")}const K=H(B.w,e,!1,t),F=K[0];let Q=B.set[e];Q&&B.psize[e]>8&&(Q=F>=B.psize[e]-4&&F<=B.psize[e]+4);const U=void 0!==B.ps[e]&&s.config[b][0]>0&&B.set[e];O=Q||U?Math.max(O,B.ps[e]):Math.max(O,F);B.ps[e]=O;B.sc[e]=K[1]}else B.layout&&0===O&&(O=B.ps[e]);if(B.span&&1!==B.span[e])x=!0;else{O>E&&(E=O);_>R&&(R=_)}}else if(B.span&&1!==B.span[e])x=!0;else{B.ps[e]>E&&(E=B.ps[e]);B.ms[e]>R&&(R=B.ms[e])}j(B.w)||B.span&&1!==B.span[e]||(v=!1)}}}v?R=E=-1:R>E&&(E=R);u[b]=E;g[b]=R;if(R>-1){p+=E;m+=R}}if(x){function a(t,i){for(let n=f-1;n>=0;--n)for(let o=0;o1){let o,f=t(l),r=0,c=0;for(o=0;o0&&(c+=s.config[n+o][0]);0!==o&&(f-=s.margins[0])}}if(f>=0)if(r>0){c>0&&(r=c);for(o=0;o0?s.config[n+o][0]:1;if(e>0){const t=Math.round(f*(e/r));f-=t;r-=e;i[n+o]+=t}}}else i[n]=f}}}a((function(t){return t.ps[e]}),u);a((function(t){return t.ms[e]}),g)}p=0;m=0;for(let V=0;Vu[V]&&(u[V]=g[V]);if(g[V]>-1){p+=u[V];m+=g[V]}}let y=0,S=!0,w=!1;for(let X=0;X-1){if(S){y+=s.margins[1];S=!1}else{y+=s.margins[0];w&&(y+=4)}w=0!==s.config[X][1]}S||(y+=s.margins[2]);p+=y;m+=y;s.measures=[u,g,p,m,y]}(W||c[2]!==s.measures[2])&&h.updateSizeInParent(e);if(i&&0===s.minSize&&c[3]!==s.measures[3]&&\"Wt-domRoot\"!==i.parentNode.className){const Y=s.measures[3]+\"px\";T(i,\"min\"+s.Size,Y)}i&&0===e&&i&&d.hasTag(i,\"TD\")&&T(i,s.size,s.measures[2]+\"px\")}(e,i,p?i.parentNode:null)}1===e&&(L=W=!1)}};this.setMaxSize=function(e,t){M[0].maxSize=e;M[1].maxSize=t};this.apply=function(e){const i=d.getElement(t);if(!i)return!1;if(d.isHidden(i))return!0;!function(e,i){const s=M[e],n=M[1^e],l=s.measures;let f=0,r=!1,c=!1;const a=p?i.parentNode:null;if(0===s.maxSize)if(a){const t=d.css(a,\"position\");\"absolute\"===t&&(f=d.pxself(a,s.size));if(0===f){if(!s.initialized){if(0===e&&(\"absolute\"===t||\"fixed\"===t)){a.style.display=\"none\";f=a.clientWidth;a.style.display=\"\"}f=e?a.clientHeight:a.clientWidth;r=!0;let i,n;if(d.hasTag(a,\"TD\")||d.hasTag(a,\"TH\")||a.parentNode.classList.contains(\"Wt-domRoot\")){i=0;n=1}else{i=s.minSize?s.minSize:l[3];n=0}f-(i+v(a,e))<=1&&(s.maxSize=999999)}if(0===f&&0===s.maxSize){f=e?a.clientHeight:a.clientWidth;r=!0}}}else{f=d.pxself(i,s.size);c=!0}else if(s.sizeSet){f=d.pxself(a,s.size);c=!0}let u=0;a&&a.wtGetPS&&1===e&&(u=a.wtGetPS(a,i,e,0));let g=l[2];g=l[3]-u){const e=-1,t=-2,i=0,n=1;let o=f-l[4];const r=[],c=[0,0],a=[0,0];let d=0;for(let u=0;u-1){let t=-1;P(s,u)||delete s.fixedSize[u];if(void 0!==s.fixedSize[u]&&(u+1===x||l[1][u+1]>-1))t=s.fixedSize[u];else if(P(s,u)&&0!==s.config[u][1]&&s.config[u][1][0]>=0){t=s.config[u][1][0];s.config[u][1][1]&&(t=(f-l[4])*t/100)}if(t>=0){r[u]=e;h[u]=t;o-=h[u]}else{let e;if(s.config[u][0]>0){e=n;r[u]=s.config[u][0];d+=r[u]}else{e=i;r[u]=0}c[e]+=l[1][u];a[e]+=l[0][u];h[u]=l[0][u]}}else{r[u]=t;h[u]=-1}s.fixedSize.length>x&&(s.fixedSize.length=x);if(0===d){for(let e=0;ea[i]+c[n]){o-=a[i];if(o>a[n]){if(s.fitSize){o-=a[n];const e=o/d;let t=0;for(let i=0;i0){const n=t;t+=r[i]*e;h[i]+=Math.round(t)-Math.round(n);s.stretched[i]=!0}}}else{const e=n;o0?(o-c[e])/(a[e]-c[e]):0;let i=0;for(let e=0;e0){const s=i;i+=(l[0][e]-l[1][e])*t;h[e]=l[1][e]+Math.round(i)-Math.round(s)}}}else{for(let e=0;e0&&(h[e]=l[1][e]);o-=c[n];const e=i;o0?(o-c[e])/(a[e]-c[e]):0;let s=0;for(let e=0;e-1){if(W){const o=t+\"-rs\"+e+\"-\"+l;let f=d.getElement(o);if(!f){s.resizeHandles[l]=o;f=document.createElement(\"div\");f.setAttribute(\"id\",o);f.di=l;f.style.position=\"absolute\";f.style[n.left]=n.margins[1]+\"px\";f.style[s.size]=s.margins[0]+\"px\";n.cSize&&(f.style[n.size]=n.cSize-n.margins[2]-n.margins[1]+\"px\");f.className=s.handleClass;i.insertBefore(f,i.firstChild);f.onmousedown=f.ontouchstart=function(t){const i=t||window.event;B(e,this,i)}}w+=2;T(f,s.left,w+\"px\");w+=2}else if(s.resizeHandles[l]){const e=d.getElement(s.resizeHandles[l]);e.parentNode.removeChild(e);delete s.resizeHandles[l]}W=0!==s.config[l][1];L?L=!1:w+=s.margins[0]}else if(s.resizeHandles[l]){const e=d.getElement(s.resizeHandles[l]);e.parentNode.removeChild(e);delete s.resizeHandles[l]}for(let t=0;t=h.length);++t){n&&(f+=4);n=0!==s.config[l+t][1];h[l+t-1]>-1&&h[l+t]>-1&&(f+=s.margins[0]);f+=h[l+t]}}T(t,\"visibility\",\"\");let r=i.align>>s.alignBits&15,c=i.ps[e];f=c&&i.set[e]){T(t,s.size,c+\"px\")&&A(i,1);i.set[e]=!1}i.size[e]=c;i.psize[e]=c}else{const o=i.margin[e],l=Math.max(0,f-o),r=0===e&&i.sc[e];if(j(t)||!r&&f===c&&!i.layout)if(i.fs[e])0===e&&T(t,s.size,i.fs[e]-o+\"px\");else{T(t,s.size,\"\")&&A(i,1);i.set&&(i.set[e]=!1)}else if(T(t,s.size,l+\"px\")){A(i,1);i.set[e]=!0}n=w;i.size[e]=l;i.psize[e]=f}if(o)if(b){T(t,s.left,\"4px\");\"absolute\"!==d.css(t,\"position\")&&(t.style.position=\"relative\")}else T(t,s.left,\"0px\");else T(t,s.left,n+\"px\");if(1===e){t.wtResize&&t.wtResize(t,i.set[0]?Math.round(i.size[0]):-1,i.set[1]?Math.round(i.size[1]):-1,!0);i.dirty=0}}}h[l]>-1&&(w+=h[l])}if(s.resizeHandles.length>x){for(const e of s.resizeHandles)if(e){const t=d.getElement(e);t.parentNode.removeChild(t)}s.resizeHandles.length=x}i.querySelectorAll(`:scope > .${n.handleClass}`).forEach((function(e){e.style[s.size]=f-s.margins[2]-s.margins[1]+\"px\"}))}(e,i);return!0};this.contains=function(e){const i=d.getElement(t),s=d.getElement(e.getId());return!(!i||!s)&&d.contains(i,s)};this.WT=d})"); + "(function(e,t,i,s,n,o,l,f,r,c,a){const d=e.WT;this.descendants=[];const u=0,g=1,h=1,p=0,m=1e6,z=\"-\"+m+\"px\",x=this;let y,S,w,L,W,b,R=a,E=!0,M=!0,H=!1;const N=document.body.classList.contains(\"Wt-rtl\"),C=[{initialized:!1,config:R.cols,margins:r,maxSize:l,measures:[],sizes:[],stretched:[],fixedSize:[],Left:N?\"Right\":\"Left\",left:N?\"right\":\"left\",Right:N?\"Left\":\"Right\",Size:\"Width\",size:\"width\",alignBits:0,getItem:function(e,t){return R.items[t*C[p].config.length+e]},setItem:function(e,t,i){R.items[t*C[p].config.length+e]=i},handleClass:\"Wt-vrh2\",resizeDir:\"h\",resizerClass:\"Wt-hsh2\",fitSize:s,resizeHandles:[]},{initialized:!1,config:R.rows,margins:c,maxSize:f,measures:[],sizes:[],stretched:[],fixedSize:[],Left:\"Top\",left:\"top\",Right:\"Bottom\",Size:\"Height\",size:\"height\",alignBits:4,getItem:function(e,t){return R.items[e*C[p].config.length+t]},setItem:function(e,t,i){R.items[e*C[p].config.length+t]=i},handleClass:\"Wt-hrh2\",resizeDir:\"v\",resizerClass:\"Wt-vsh2\",fitSize:n,resizeHandles:[]}];document.getElementById(t).wtLayout=this;function v(e){for(const t of R.items)if(t&&t.id===e)return t;return null}function D(e,t,i,s){const n=C[t];let o,l,f=t?e.scrollHeight:e.scrollWidth;if(t===p){const i=d.pxself(e,n.left);if(f+i>s.clientWidth||f+i===s.clientWidth&&d.isGecko&&\"hidden\"===s.parentNode.parentNode.style.visibility){o=e.style[n.left];G(e,n.left,z);f=t?e.scrollHeight:e.scrollWidth}}let r=t?e.clientHeight:e.clientWidth;if(d.isGecko&&!e.style[n.size]&&t===p&&(\"visible\"===(c=d.css(e,\"overflow\"))||\"none\"===c)){l=e.style[n.size];G(e,n.size,\"\")}var c;let a=t?e.offsetHeight:e.offsetWidth;o&&G(e,n.left,o);l&&G(e,n.size,l);r>=m&&(r-=m);f>=m&&(f-=m);a>=m&&(a-=m);if(0===f){f=d.pxself(e,n.size);0===f||d.isOpera||d.isGecko||(f-=d.px(e,\"border\"+n.Left+\"Width\")+d.px(e,\"border\"+n.Right+\"Width\"))}if(f>a)if(0===d.pxself(e,n.size))f=r;else{let t=!1;e.querySelectorAll(\".Wt-popup\").forEach((function(e){\"none\"!==e.style.display&&(t=!0)}));t&&(f=r)}const u=d.px(e,\"border\"+n.Left+\"Width\")+d.px(e,\"border\"+n.Right+\"Width\"),g=a-(r+u)!=0;if(i)return[f,g];(d.isGecko||d.isWebKit)&&t===p&&e.getBoundingClientRect().width!==Math.ceil(e.getBoundingClientRect().width)&&(f+=1);d.boxSizing(e)||d.isOpera||(f+=u);f+=d.px(e,\"margin\"+n.Left)+d.px(e,\"margin\"+n.Right);d.boxSizing(e)||(f+=d.px(e,\"padding\"+n.Left)+d.px(e,\"padding\"+n.Right));f+=a-(r+u);f0&&(f=Math.min(h,f));return[Math.round(f),g]}function I(e,t){const i=C[t];if(\"none\"===e.style.display)return 0;if(e[\"layoutMin\"+i.Size])return e[\"layoutMin\"+i.Size];{let t=d.px(e,\"min\"+i.Size);d.boxSizing(e)||(t+=d.px(e,\"padding\"+i.Left)+d.px(e,\"padding\"+i.Right));return t}}function A(e,t){const i=C[t];let s=d.px(e,\"margin\"+i.Left)+d.px(e,\"margin\"+i.Right);d.boxSizing(e)||(s+=d.px(e,\"border\"+i.Left+\"Width\")+d.px(e,\"border\"+i.Right+\"Width\")+d.px(e,\"padding\"+i.Left)+d.px(e,\"padding\"+i.Right));return s}function T(e,t){const i=C[t];return d.px(e,\"padding\"+i.Left)+d.px(e,\"padding\"+i.Right)}function j(e,t){if(d.boxSizing(e)){const i=C[t];return d.px(e,\"border\"+i.Left+\"Width\")+d.px(e,\"border\"+i.Right+\"Width\")+d.px(e,\"padding\"+i.Left)+d.px(e,\"padding\"+i.Right)}return 0}function B(e,t){const i=C[t];return Math.round(d.px(e,\"border\"+i.Left+\"Width\")+d.px(e,\"border\"+i.Right+\"Width\")+d.px(e,\"margin\"+i.Left)+d.px(e,\"margin\"+i.Right)+d.px(e,\"padding\"+i.Left)+d.px(e,\"padding\"+i.Right))}function P(t,i,s){t.dirty=Math.max(t.dirty,i);E=!0;s&&e.layouts2.scheduleAdjust()}function G(e,t,i){if(e.style[t]!==i){e.style[t]=i;return!0}return!1}function k(e){return\"none\"===e.style.display&&!e.ed||e.classList.contains(\"Wt-hidden\")}this.updateSizeInParent=function(e){if(S&&w.id){const e=d.$(w.id);if(e){if(w!==e){S=e.parentNode.wtLayout;S?w=e:O()}}else O()}if(S&&L){const i=C[e];let s=i.measures[2];i.maxSize>0&&(s=Math.min(i.maxSize,s));if(b){const i=d.getElement(t);if(!i)return;let n=i,o=n.parentNode;for(;;){o.wtGetPS&&(s=o.wtGetPS(o,n,e,s));s+=B(o,e);if(o===w)break;1===e&&o===i.parentNode&&!o.lh&&o.offsetHeight>s&&(s=o.offsetHeight);n=o;o=n.parentNode}}else s+=W[e];S.setChildSize(w,e,s)}};function _(i,s,n){const o=s.di,l=C[i],f=C[1^i],r=d.getElement(t);let c,a,g;for(g=o-1;g>=0;--g)if(l.sizes[g]>=0){c=-(l.sizes[g]-l.measures[h][g]);break}a=l.sizes[o]-l.measures[h][o];N&&([c,a]=[-a,-c]);new d.SizeHandle(d,l.resizeDir,d.pxself(s,l.size),d.pxself(s,f.size),c,a,l.resizerClass,(function(t){!function(t,i,s){const n=C[t];N&&(s=-s);if(n.config[i][u]>0&&0===n.config[i+1][u]){++i;s=-s}n.fixedSize[i]=n.sizes[i]+s;e.layouts2.scheduleAdjust()}(i,g,t)}),s,r,n,0,0)}function q(e,t){const i=e.config.length;if(0!==e.config[t][g])for(let s=t+1;s-1)return!0;for(let i=t-1;i>=0;--i)if(e.measures[h][i]>-1)return 0!==e.config[i][g];return!1}this.setConfig=function(t){const i=R;R=t;C[0].config=R.cols;C[1].config=R.rows;C[0].stretched=[];C[1].stretched=[];for(const e of i.items)if(e){const t=v(e.id);if(t){t.ps=e.ps;t.sc=e.sc;t.ms=e.ms;t.size=e.size;t.psize=e.psize;t.fs=e.fs;t.margin=e.margin;t.set=e.set}else if(e.set){e.set[p]&&G(e.w,C[p].size,\"\");e.set[1]&&G(e.w,C[1].size,\"\")}}M=!0;E=!0;e.layouts2.scheduleAdjust()};this.getId=function(){return t};this.setElDirty=function(t){const i=v(t.id);if(i){i.dirty=2;E=!0;e.layouts2.scheduleAdjust()}};this.setItemsDirty=function(t){const i=C[p].config.length;for(const[s,n]of t){const t=R.items[s*i+n];if(t){t.dirty=2;if(t.layout){t.layout=!1;t.wasLayout=!0;e.layouts2.setChildLayoutsDirty(x,t.w)}}}E=!0};this.setDirty=function(){M=!0};this.setAllDirty=function(){for(const e of R.items)e&&(e.dirty=2);E=!0};this.setChildSize=function(e,t,i){const s=C[p].config.length,n=C[t],o=v(e.id);if(o){const l=function(e){let t=0;for(const i of R.items){if(i&&i.id===e)return t;t+=1}return null}(e.id),f=t===p?l%s:l/s;if(o.align>>n.alignBits&15||!n.stretched[f]){o.ps||(o.ps=[]);o.ps[t]=i}o.layout=!0;P(o,1)}};function O(){const e=d.getElement(t);y=null===i;S=null;w=null;L=!0;H=!0;W=[];b=!1;if(y){let t=e,i=t.parentNode;W=[0,0];for(;i!==document&&!t.classList.contains(\"wt-reparented\");){W[p]+=B(i,p);W[1]+=B(i,1);i.wtGetPS&&(b=!0);const e=i.parentNode.wtLayout;if(e){w=i;S=e;break}t=i;i=t.parentNode;1===i.childNodes.length||i.wtGetPS||(L=!1)}const s=e.parentNode;for(let e=0;e<2;++e)C[e].sizeSet=0!==d.pxself(s,C[e].size)}else{S=document.getElementById(i).wtLayout;w=e;W[p]=B(w,p);W[1]=B(w,1)}}this.measure=function(e){const i=d.getElement(t);if(i&&!d.isHidden(i)){H||O();if(E||M){!function(e,t,i){const s=C[e],n=C[1^e],l=s.measures,f=s.config.length,r=n.config.length,c=l.slice();if(5===c.length){c[0]=c[0].slice();c[h]=c[h].slice()}if(E){if(i&&void 0===s.minSize){s.minSize=d.px(i,\"min\"+s.Size);s.minSize>0&&(s.minSize-=j(i,e))}const m=[],z=[],y=!0;let S=!1;for(let H=0;H1){const O=d.$(_.id);if(!O){s.setItem(H,B,null);continue}if(O!==_.w){_.w=O;const $=_;[O,...O.querySelectorAll(\"img\")].filter((e=>\"IMG\"===e.tagName)).forEach((function(e){e.addEventListener(\"load\",(function(){P($,1,!0)}))}))}}if(!o&&\"absolute\"!==_.w.style.position){_.w.style.position=\"absolute\";_.w.style.visibility=\"hidden\"}_.ps||(_.ps=[]);_.sc||(_.sc=[]);_.ms||(_.ms=[]);_.size||(_.size=[]);_.psize||(_.psize=[]);_.fs||(_.fs=[]);_.margin||(_.margin=[]);const q=!_.set;_.set||(_.set=[!1,!1]);if(k(_.w)){_.ps[e]=_.ms[e]=0;continue}if(_.w){if(_.dirty){let J;if(_.dirty>1){J=I(_.w,e);_.ms[e]=J}else J=_.ms[e];_.dirty>1&&(_.margin[e]=A(_.w,e));if(!_.set[e])if(e!==p&&q){const Q=Math.round(d.px(_.w,s.size));Q>Math.max(j(_.w,e),J)?_.fs[e]=Q+_.margin[e]:_.fs[e]=0}else{const U=d.pxself(_.w,s.size);_.fs[e]=U?U+_.margin[e]:0}const K=_.align>>s.alignBits&15;let F=_.fs[e];if(K||y||s.config[H][u]<=0)if(_.layout){0===F&&(F=_.ps[e]);_.ps[e]=F}else{if(_.wasLayout){_.wasLayout=!1;_.set=[!1,!1];_.ps=[];_.w.wtResize&&_.w.wtResize(_.w,-1,-1,!0);G(_.w,C[1].size,\"\")}const V=D(_.w,e,!1,t),X=V[0];let Y=_.set[e];Y&&_.psize[e]>8&&(Y=X>=_.psize[e]-4&&X<=_.psize[e]+4);const Z=void 0!==_.ps[e]&&s.config[H][u]>0&&_.set[e];F=Y||Z?Math.max(F,_.ps[e]):Math.max(F,X);_.ps[e]=F;_.sc[e]=V[1]}else _.layout&&0===F&&(F=_.ps[e]);if(_.span&&1!==_.span[e])S=!0;else{F>N&&(N=F);J>v&&(v=J)}}else if(_.span&&1!==_.span[e])S=!0;else{_.ps[e]>N&&(N=_.ps[e]);_.ms[e]>v&&(v=_.ms[e])}k(_.w)||_.span&&1!==_.span[e]||(T=!1)}}}T?v=N=-1:v>N&&(N=v);m[H]=N;z[H]=v}if(S){function a(t,i){for(let n=f-1;n>=0;--n)for(let o=0;o1){let o,f=t(l),r=0,c=0;for(o=0;o0&&(c+=s.config[n+o][u]);0!==o&&(f-=s.margins[0])}}if(f>=0)if(r>0){c>0&&(r=c);for(o=0;o0?s.config[n+o][u]:1;if(e>0){const t=Math.round(f*(e/r));f-=t;r-=e;i[n+o]+=t}}}else i[n]=f}}}a((function(t){return t.ps[e]}),m);a((function(t){return t.ms[e]}),z)}let w=0,L=0;for(let ee=0;eem[ee]&&(m[ee]=z[ee]);if(z[ee]>-1){w+=m[ee];L+=z[ee]}}let W=0,b=!0,R=!1;for(let te=0;te-1){if(b){W+=s.margins[1];b=!1}else{W+=s.margins[0];R&&(W+=4)}R=0!==s.config[te][g]}b||(W+=s.margins[2]);w+=W;L+=W;s.measures=[m,z,w,L,W]}(M||c[2]!==s.measures[2])&&x.updateSizeInParent(e);if(i&&0===s.minSize&&c[3]!==s.measures[3]&&\"Wt-domRoot\"!==i.parentNode.className){const ie=s.measures[3]+\"px\";G(i,\"min\"+s.Size,ie)}i&&e===p&&i&&d.hasTag(i,\"TD\")&&G(i,s.size,s.measures[2]+\"px\")}(e,i,y?i.parentNode:null)}1===e&&(E=M=!1)}};this.setMaxSize=function(e,t){C[p].maxSize=e;C[1].maxSize=t};this.apply=function(e){const i=d.getElement(t);if(!i)return!1;if(d.isHidden(i))return!0;!function(e,i){const s=C[e],n=C[1^e],l=s.measures;let f=0,r=!1,c=!1;const a=y?i.parentNode:null;if(0===s.maxSize)if(a){const t=d.css(a,\"position\");\"absolute\"===t&&(f=d.pxself(a,s.size));if(0===f){if(!s.initialized){if(e===p&&(\"absolute\"===t||\"fixed\"===t)){a.style.display=\"none\";f=a.clientWidth;a.style.display=\"\"}f=e?a.clientHeight:a.clientWidth;r=!0;let i,n;if(d.hasTag(a,\"TD\")||d.hasTag(a,\"TH\")||a.parentNode.classList.contains(\"Wt-domRoot\")){i=0;n=1}else{i=s.minSize?s.minSize:l[3];n=0}f-(i+T(a,e))<=1&&(s.maxSize=999999)}if(0===f&&0===s.maxSize){f=e?a.clientHeight:a.clientWidth;r=!0}}}else{f=d.pxself(i,s.size);c=!0}else if(s.sizeSet){f=d.pxself(a,s.size);c=!0}let m=0;a&&a.wtGetPS&&1===e&&(m=a.wtGetPS(a,i,e,0));let z=l[2];z=l[3]-m){const e=-1,t=-2,i=0,n=1;let o=f-l[4];const r=[],c=[0,0],a=[0,0];let d=0;for(let p=0;p-1){let t=-1;q(s,p)||delete s.fixedSize[p];if(void 0!==s.fixedSize[p]&&(p+1===L||l[h][p+1]>-1))t=s.fixedSize[p];else if(q(s,p)&&0!==s.config[p][g]&&s.config[p][g][0]>=0){t=s.config[p][g][0];s.config[p][g][1]&&(t=(f-l[4])*t/100)}if(t>=0){r[p]=e;x[p]=t;o-=x[p]}else{let e;if(s.config[p][u]>0){e=n;r[p]=s.config[p][u];d+=r[p]}else{e=i;r[p]=0}c[e]+=l[h][p];a[e]+=l[0][p];x[p]=l[0][p]}}else{r[p]=t;x[p]=-1}s.fixedSize.length>L&&(s.fixedSize.length=L);if(0===d){for(let e=0;ea[i]+c[n]){o-=a[i];if(o>a[n]){if(s.fitSize){o-=a[n];const e=o/d;let t=0;for(let i=0;i0){const n=t;t+=r[i]*e;x[i]+=Math.round(t)-Math.round(n);s.stretched[i]=!0}}}else{const e=n;o0?(o-c[e])/(a[e]-c[e]):0;let i=0;for(let e=0;e0){const s=i;i+=(l[0][e]-l[h][e])*t;x[e]=l[h][e]+Math.round(i)-Math.round(s)}}}else{for(let e=0;e0&&(x[e]=l[h][e]);o-=c[n];const e=i;o0?(o-c[e])/(a[e]-c[e]):0;let s=0;for(let e=0;e-1){if(M){const o=t+\"-rs\"+e+\"-\"+l;let f=d.getElement(o);if(!f){s.resizeHandles[l]=o;f=document.createElement(\"div\");f.setAttribute(\"id\",o);f.di=l;f.style.position=\"absolute\";f.style[n.left]=n.margins[1]+\"px\";f.style[s.size]=s.margins[0]+\"px\";n.cSize&&(f.style[n.size]=n.cSize-n.margins[2]-n.margins[1]+\"px\");f.className=s.handleClass;i.insertBefore(f,i.firstChild);f.onmousedown=f.ontouchstart=function(t){const i=t||window.event;_(e,this,i)}}R+=2;G(f,s.left,R+\"px\");R+=2}else if(s.resizeHandles[l]){const e=d.getElement(s.resizeHandles[l]);e.parentNode.removeChild(e);delete s.resizeHandles[l]}M=0!==s.config[l][g];E?E=!1:R+=s.margins[0]}else if(s.resizeHandles[l]){const e=d.getElement(s.resizeHandles[l]);e.parentNode.removeChild(e);delete s.resizeHandles[l]}for(let t=0;t=x.length);++t){n&&(f+=4);n=0!==s.config[l+t][g];x[l+t-1]>-1&&x[l+t]>-1&&(f+=s.margins[0]);f+=x[l+t]}}G(t,\"visibility\",\"\");let r=i.align>>s.alignBits&15,c=i.ps[e];f=c&&i.set[e]){G(t,s.size,c+\"px\")&&P(i,1);i.set[e]=!1}i.size[e]=c;i.psize[e]=c}else{const o=i.margin[e],l=Math.max(0,f-o),r=0===e&&i.sc[e];if(k(t)||!r&&f===c&&!i.layout)if(i.fs[e])e===p&&G(t,s.size,i.fs[e]-o+\"px\");else{G(t,s.size,\"\")&&P(i,1);i.set&&(i.set[e]=!1)}else if(G(t,s.size,l+\"px\")){P(i,1);i.set[e]=!0}n=R;i.size[e]=l;i.psize[e]=f}if(o)if(H){G(t,s.left,\"4px\");\"absolute\"!==d.css(t,\"position\")&&(t.style.position=\"relative\")}else G(t,s.left,\"0px\");else G(t,s.left,n+\"px\");if(1===e){t.wtResize&&t.wtResize(t,i.set[p]?Math.round(i.size[p]):-1,i.set[1]?Math.round(i.size[1]):-1,!0);i.dirty=0}}}x[l]>-1&&(R+=x[l])}if(s.resizeHandles.length>L){for(const e of s.resizeHandles)if(e){const t=d.getElement(e);t.parentNode.removeChild(t)}s.resizeHandles.length=L}i.querySelectorAll(`:scope > .${n.handleClass}`).forEach((function(e){e.style[s.size]=f-s.margins[2]-s.margins[1]+\"px\"}))}(e,i);return!0};this.contains=function(e){const i=d.getElement(t),s=d.getElement(e.getId());return!(!i||!s)&&d.contains(i,s)};this.WT=d})"); } static WJavaScriptPreamble appjs1() { diff --git a/src/eu/webtoolkit/jwt/StdWidgetItemImpl.java b/src/eu/webtoolkit/jwt/StdWidgetItemImpl.java index e51b0a19..bc684c4e 100644 --- a/src/eu/webtoolkit/jwt/StdWidgetItemImpl.java +++ b/src/eu/webtoolkit/jwt/StdWidgetItemImpl.java @@ -31,25 +31,25 @@ public StdWidgetItemImpl(WWidgetItem item) { public static String getChildrenResizeJS() { WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WtResize.js", wtjs10()); - return "Wt4_11_0.ChildrenResize"; + return "Wt4_11_1.ChildrenResize"; } public static String getChildrenGetPSJS() { WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WtResize.js", wtjs11()); - return "Wt4_11_0.ChildrenGetPS"; + return "Wt4_11_1.ChildrenGetPS"; } public static String getSecondResizeJS() { WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WtResize.js", wtjs12()); - return "Wt4_11_0.LastResize"; + return "Wt4_11_1.LastResize"; } public static String getSecondGetPSJS() { WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WtResize.js", wtjs13()); - return "Wt4_11_0.LastGetPS"; + return "Wt4_11_1.LastGetPS"; } public String getId() { diff --git a/src/eu/webtoolkit/jwt/WAbstractItemView.java b/src/eu/webtoolkit/jwt/WAbstractItemView.java index 68e5cc72..b4e7b870 100644 --- a/src/eu/webtoolkit/jwt/WAbstractItemView.java +++ b/src/eu/webtoolkit/jwt/WAbstractItemView.java @@ -527,13 +527,33 @@ public boolean isSortingEnabled(int column) { * @see WAbstractItemView#setColumnResizeEnabled(boolean enabled) */ public void setColumnResizeEnabled(boolean enabled) { - if (enabled != this.columnResize_) { - this.columnResize_ = enabled; + this.columnResize_ = enabled; + for (int i = 0; i < (int) this.columns_.size(); i++) { + this.columnInfo(i).resizable = enabled; + } + this.scheduleRerender(WAbstractItemView.RenderState.NeedRerenderHeader); + } + /** + * Enables interactive column resizing. + * + *

        Enable or disable column resize handles for interactive resizing of a single column. The + * column that is passed indicated the column index in the view. The indices start + * from 0. + * + *

        Column resizing is enabled by default when JavaScript is available. + * + *

        + * + * @see WAbstractItemView#setColumnResizeEnabled(boolean enabled) + */ + public void setColumnResizeEnabled(boolean enabled, int column) { + if (enabled != this.columnInfo(column).resizable) { + this.columnInfo(column).resizable = enabled; this.scheduleRerender(WAbstractItemView.RenderState.NeedRerenderHeader); } } /** - * Returns whether column resizing is enabled. + * Returns whether column resizing is enabled for new columns. * *

        * @@ -542,6 +562,19 @@ public void setColumnResizeEnabled(boolean enabled) { public boolean isColumnResizeEnabled() { return this.columnResize_; } + /** + * Returns whether column resizing is enabled for a single column. + * + *

        The column that is passed indicated the column index in the view. The indices + * start from 0. + * + *

        + * + * @see WAbstractItemView#setColumnResizeEnabled(boolean enabled) + */ + public boolean isColumnResizeEnabled(int column) { + return this.columnInfo(column).resizable; + } /** * Changes the selection behaviour. * @@ -1686,6 +1719,7 @@ static class ColumnInfo { public WWidget extraHeaderWidget; public boolean sorting; public boolean hidden; + public boolean resizable; public WAbstractItemDelegate itemDelegate_; public String getStyleClass() { @@ -1704,6 +1738,7 @@ public ColumnInfo(WAbstractItemView view, int anId) { this.extraHeaderWidget = (WWidget) null; this.sorting = view.sorting_; this.hidden = false; + this.resizable = view.columnResize_; this.itemDelegate_ = (WAbstractItemDelegate) null; this.width = new WLength(150); WCssTemplateRule r = new WCssTemplateRule("#" + view.getId() + " ." + this.getStyleClass()); @@ -1956,9 +1991,11 @@ protected WWidget createHeaderWidget(int column) { i.addStyleClass("Wt-label"); contents.addWidget(i); if (this.isDisabled()) { - contents.addStyleClass("Wt-disabled"); + WApplication app = WApplication.getInstance(); + String themedDisabledClass = app != null ? app.getTheme().getDisabledClass() : ""; + contents.addStyleClass(themedDisabledClass); for (WWidget child : contents.getChildren()) { - child.addStyleClass("Wt-disabled"); + child.addStyleClass(themedDisabledClass); } } int headerLevel = this.model_ != null ? this.headerLevel(column) : 0; @@ -1982,11 +2019,11 @@ protected WWidget createHeaderWidget(int column) { } } } - boolean activeRH = this.columnResize_; + boolean hasResizeHandle = info.resizable; WContainerWidget resizeHandle = new WContainerWidget(); resizeHandle.setStyleClass( - "Wt-tv-rh" + (activeRH ? "" : " Wt-tv-no-rh") + " Wt-tv-br headerrh"); - if (activeRH) { + "Wt-tv-rh" + (hasResizeHandle ? "" : " Wt-tv-no-rh") + " Wt-tv-br headerrh"); + if (hasResizeHandle) { resizeHandle.mouseWentDown().addListener(this.resizeHandleMDownJS_); } resizeHandle.setMargin( @@ -2039,9 +2076,11 @@ protected WWidget createHeaderWidget(int column) { }); result.addWidget(main); if (this.isDisabled()) { - result.addStyleClass("Wt-disabled"); + WApplication app = WApplication.getInstance(); + String themedDisabledClass = app != null ? app.getTheme().getDisabledClass() : ""; + result.addStyleClass(themedDisabledClass); for (WWidget child : result.getChildren()) { - child.addStyleClass("Wt-disabled"); + child.addStyleClass(themedDisabledClass); } } String sc = StringUtils.asString(index.getData(ItemDataRole.StyleClass)).toString(); diff --git a/src/eu/webtoolkit/jwt/WAbstractMedia.java b/src/eu/webtoolkit/jwt/WAbstractMedia.java index 7ec300b3..47b6adb8 100644 --- a/src/eu/webtoolkit/jwt/WAbstractMedia.java +++ b/src/eu/webtoolkit/jwt/WAbstractMedia.java @@ -266,7 +266,7 @@ public String getJsMediaRef() { if (this.mediaId_.length() == 0) { return "null"; } else { - return "Wt4_11_0.getElement('" + this.mediaId_ + "')"; + return "Wt4_11_1.getElement('" + this.mediaId_ + "')"; } } @@ -277,7 +277,7 @@ protected void getDomChanges(final List result, WApplication app) { if (this.sourcesChanged_) { for (int i = 0; i < this.sourcesRendered_; ++i) { media.callJavaScript( - "Wt4_11_0.remove('" + this.mediaId_ + "s" + String.valueOf(i) + "');", true); + "Wt4_11_1.remove('" + this.mediaId_ + "s" + String.valueOf(i) + "');", true); } this.sourcesRendered_ = 0; for (int i = 0; i < this.sources_.size(); ++i) { @@ -378,7 +378,7 @@ void updateMediaDom(final DomElement element, boolean all) { if (all && this.alternative_ != null) { element.setAttribute( "onerror", - "if(event.target.error && event.target.error.code==event.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED){while (this.hasChildNodes())if (Wt4_11_0.hasTag(this.firstChild,'SOURCE')){this.removeChild(this.firstChild);}else{this.parentNode.insertBefore(this.firstChild, this);}this.style.display= 'none';}"); + "if(event.target.error && event.target.error.code==event.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED){while (this.hasChildNodes())if (Wt4_11_1.hasTag(this.firstChild,'SOURCE')){this.removeChild(this.firstChild);}else{this.parentNode.insertBefore(this.firstChild, this);}this.style.display= 'none';}"); } if (all || this.flagsChanged_) { if (!all || this.flags_.contains(PlayerOption.Controls)) { @@ -504,7 +504,7 @@ private void renderSource( if (isLast && this.alternative_ != null) { element.setAttribute( "onerror", - "var media = this.parentNode;if(media){while (media && media.children.length)if (Wt4_11_0.hasTag(media.firstChild,'SOURCE')){media.removeChild(media.firstChild);}else{media.parentNode.insertBefore(media.firstChild, media);}media.style.display= 'none';}"); + "var media = this.parentNode;if(media){while (media && media.children.length)if (Wt4_11_1.hasTag(media.firstChild,'SOURCE')){media.removeChild(media.firstChild);}else{media.parentNode.insertBefore(media.firstChild, media);}media.style.display= 'none';}"); } else { element.setAttribute("onerror", ""); } @@ -537,7 +537,7 @@ private void loadJavaScript() { app.loadJavaScript("js/WAbstractMedia.js", wtjs1()); this.setJavaScriptMember( " WAbstractMedia", - "new Wt4_11_0.WAbstractMedia(" + app.getJavaScriptClass() + "," + this.getJsRef() + ");"); + "new Wt4_11_1.WAbstractMedia(" + app.getJavaScriptClass() + "," + this.getJsRef() + ");"); } } diff --git a/src/eu/webtoolkit/jwt/WAbstractSpinBox.java b/src/eu/webtoolkit/jwt/WAbstractSpinBox.java index b994bd9a..317e9021 100644 --- a/src/eu/webtoolkit/jwt/WAbstractSpinBox.java +++ b/src/eu/webtoolkit/jwt/WAbstractSpinBox.java @@ -275,7 +275,7 @@ private void defineJavaScript() { WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WSpinBox.js", wtjs1()); StringBuilder ss = new StringBuilder(); - ss.append("new Wt4_11_0.WSpinBox(") + ss.append("new Wt4_11_1.WSpinBox(") .append(app.getJavaScriptClass()) .append(",") .append(this.getJsRef()) diff --git a/src/eu/webtoolkit/jwt/WAnchor.java b/src/eu/webtoolkit/jwt/WAnchor.java index 8477b6ad..a6924da8 100644 --- a/src/eu/webtoolkit/jwt/WAnchor.java +++ b/src/eu/webtoolkit/jwt/WAnchor.java @@ -409,7 +409,7 @@ static void renderUrlResolution(WWidget widget, final DomElement element, boolea if (all) { element.setProperty(Property.Class, StringUtils.addWord(widget.getStyleClass(), "Wt-rr")); } else { - element.callJavaScript("Wt4_11_0.$('" + widget.getId() + "').classList.add('Wt-rr');"); + element.callJavaScript("Wt4_11_1.$('" + widget.getId() + "').classList.add('Wt-rr');"); } } diff --git a/src/eu/webtoolkit/jwt/WApplication.java b/src/eu/webtoolkit/jwt/WApplication.java index b121be2b..6a6c967a 100644 --- a/src/eu/webtoolkit/jwt/WApplication.java +++ b/src/eu/webtoolkit/jwt/WApplication.java @@ -2261,9 +2261,9 @@ public void setLoadingIndicator(WLoadingIndicator indicator) { if (this.loadingIndicator_ != null) { this.domRoot_.addWidget(indicator); this.showLoadJS.setJavaScript( - "function(o,e) {Wt4_11_0.inline('" + this.loadingIndicator_.getId() + "');}"); + "function(o,e) {Wt4_11_1.inline('" + this.loadingIndicator_.getId() + "');}"); this.hideLoadJS.setJavaScript( - "function(o,e) {Wt4_11_0.hide('" + this.loadingIndicator_.getId() + "');}"); + "function(o,e) {Wt4_11_1.hide('" + this.loadingIndicator_.getId() + "');}"); this.loadingIndicator_.hide(); } } @@ -2669,7 +2669,7 @@ protected void enableAjax() { this.domRoot2_.enableAjax(); } this.doJavaScript( - "Wt4_11_0.ajaxInternalPaths(" + "Wt4_11_1.ajaxInternalPaths(" + WWebWidget.jsStringLiteral(this.resolveRelativeUrl(this.getBookmarkUrl("/"))) + ");"); } @@ -3047,7 +3047,7 @@ private void streamJavaScriptPreamble(final StringBuilder out, boolean all) { String scope = preamble.scope == JavaScriptScope.ApplicationScope ? this.getJavaScriptClass() - : "Wt4_11_0"; + : "Wt4_11_1"; if (preamble.type == JavaScriptObjectType.JavaScriptFunction) { out.append(scope) .append('.') diff --git a/src/eu/webtoolkit/jwt/WBootstrap2Theme.java b/src/eu/webtoolkit/jwt/WBootstrap2Theme.java index 3458bfc5..cd04f47c 100644 --- a/src/eu/webtoolkit/jwt/WBootstrap2Theme.java +++ b/src/eu/webtoolkit/jwt/WBootstrap2Theme.java @@ -436,7 +436,7 @@ public void applyValidationStyle( app.loadJavaScript("js/BootstrapValidate.js", wtjs2()); if (app.getEnvironment().hasAjax()) { StringBuilder js = new StringBuilder(); - js.append("Wt4_11_0.setValidationState(") + js.append("Wt4_11_1.setValidationState(") .append(widget.getJsRef()) .append(",") .append(validation.getState() == ValidationState.Valid) diff --git a/src/eu/webtoolkit/jwt/WBootstrap3Theme.java b/src/eu/webtoolkit/jwt/WBootstrap3Theme.java index 2aeab34f..dfbce730 100644 --- a/src/eu/webtoolkit/jwt/WBootstrap3Theme.java +++ b/src/eu/webtoolkit/jwt/WBootstrap3Theme.java @@ -479,7 +479,7 @@ public void applyValidationStyle( app.loadJavaScript("js/BootstrapValidate.js", wtjs2()); if (app.getEnvironment().hasAjax()) { StringBuilder js = new StringBuilder(); - js.append("Wt4_11_0.setValidationState(") + js.append("Wt4_11_1.setValidationState(") .append(widget.getJsRef()) .append(",") .append(validation.getState() == ValidationState.Valid) diff --git a/src/eu/webtoolkit/jwt/WBootstrap5Theme.java b/src/eu/webtoolkit/jwt/WBootstrap5Theme.java index d1288c48..b087d9d0 100644 --- a/src/eu/webtoolkit/jwt/WBootstrap5Theme.java +++ b/src/eu/webtoolkit/jwt/WBootstrap5Theme.java @@ -470,7 +470,7 @@ public void applyValidationStyle( app.loadJavaScript("js/BootstrapValidate.js", wtjs2()); if (app.getEnvironment().hasAjax()) { StringBuilder js = new StringBuilder(); - js.append("Wt4_11_0.setValidationState(") + js.append("Wt4_11_1.setValidationState(") .append(widget.getJsRef()) .append(",") .append(validation.getState() == ValidationState.Valid) diff --git a/src/eu/webtoolkit/jwt/WCanvasPaintDevice.java b/src/eu/webtoolkit/jwt/WCanvasPaintDevice.java index 95c144f0..8a057c8e 100644 --- a/src/eu/webtoolkit/jwt/WCanvasPaintDevice.java +++ b/src/eu/webtoolkit/jwt/WCanvasPaintDevice.java @@ -192,7 +192,7 @@ public void drawImage( } int imageIndex = this.createImage(imgUri); this.js_ - .append("Wt4_11_0.gfxUtils.drawImage(ctx,images[") + .append("Wt4_11_1.gfxUtils.drawImage(ctx,images[") .append(String.valueOf(imageIndex)) .append("],") .append(WWebWidget.jsStringLiteral(imgUri)) @@ -214,7 +214,7 @@ public void drawPath(final WPainterPath path) { if (path.isJavaScriptBound()) { this.renderStateChanges(true); this.js_ - .append("Wt4_11_0.gfxUtils.drawPath(ctx,") + .append("Wt4_11_1.gfxUtils.drawPath(ctx,") .append(path.getJsRef()) .append(",") .append(this.currentNoBrush_ ? "false" : "true") @@ -232,7 +232,7 @@ public void drawStencilAlongPath( final WPainterPath stencil, final WPainterPath path, boolean softClipping) { this.renderStateChanges(true); this.js_ - .append("Wt4_11_0") + .append("Wt4_11_1") .append(".gfxUtils.drawStencilAlongPath(ctx,") .append(stencil.getJsRef()) .append(",") @@ -250,7 +250,7 @@ public void drawRect(final WRectF rectangle) { if (rectangle.isJavaScriptBound()) { this.renderStateChanges(true); this.js_ - .append("Wt4_11_0") + .append("Wt4_11_1") .append(".gfxUtils.drawRect(ctx,") .append(rectangle.getJsRef()) .append(",") @@ -283,7 +283,7 @@ public void drawText( case Html5Text: { this.js_ - .append("Wt4_11_0.gfxUtils.drawText(ctx,") + .append("Wt4_11_1.gfxUtils.drawText(ctx,") .append(rect.getJsRef()) .append(',') .append(String.valueOf(EnumUtils.valueOf(flags))) @@ -352,7 +352,7 @@ public void drawText( .append(");"); if (this.currentPen_.isJavaScriptBound()) { this.js_ - .append("ctx.fillStyle=Wt4_11_0.gfxUtils.css_text(") + .append("ctx.fillStyle=Wt4_11_1.gfxUtils.css_text(") .append(this.currentPen_.getJsRef()) .append(".color);"); } else { @@ -426,7 +426,7 @@ public void drawTextOnPath( double lineHeight, boolean softClipping) { this.renderStateChanges(true); - this.js_.append("Wt4_11_0.gfxUtils.drawTextOnPath(ctx,["); + this.js_.append("Wt4_11_1.gfxUtils.drawTextOnPath(ctx,["); for (int i = 0; i < text.size(); ++i) { if (i != 0) { this.js_.append(','); @@ -481,7 +481,7 @@ public void render( final String canvasId, DomElement text, final String updateAreasJs) { - String canvasVar = "Wt4_11_0.getElement('" + canvasId + "')"; + String canvasVar = "Wt4_11_1.getElement('" + canvasId + "')"; String paintedWidgetObjRef = paintedWidgetJsRef + ".wtObj"; StringBuilder tmp = new StringBuilder(); tmp.append(";(function(){"); @@ -659,7 +659,7 @@ private void renderStateChanges(boolean resetPathTranslation) { final WPainterPath p = this.getPainter().getClipPath(); if (!p.isEmpty()) { this.js_ - .append("Wt4_11_0") + .append("Wt4_11_1") .append(".gfxUtils.setClipPath(ctx,") .append(p.getJsRef()) .append(",") @@ -668,7 +668,7 @@ private void renderStateChanges(boolean resetPathTranslation) { .append(this.getPainter().hasClipping() ? "true" : "false") .append(");"); } else { - this.js_.append("Wt4_11_0").append(".gfxUtils.removeClipPath(ctx);"); + this.js_.append("Wt4_11_1").append(".gfxUtils.removeClipPath(ctx);"); } this.currentClipTransform_.assign(t); this.currentClipPath_.assign(p); @@ -745,7 +745,7 @@ && fequal(f.getM22(), this.currentTransform_.getM22())) { } else { if (this.getPainter().getPen().isJavaScriptBound()) { this.js_ - .append("ctx.strokeStyle=Wt4_11_0.gfxUtils.css_text(") + .append("ctx.strokeStyle=Wt4_11_1.gfxUtils.css_text(") .append(this.getPainter().getPen().getJsRef()) .append(".color);"); } else { @@ -836,7 +836,7 @@ && fequal(f.getM22(), this.currentTransform_.getM22())) { } else { if (this.currentBrush_.isJavaScriptBound()) { this.js_ - .append("ctx.fillStyle=Wt4_11_0.gfxUtils.css_text(") + .append("ctx.fillStyle=Wt4_11_1.gfxUtils.css_text(") .append(this.currentBrush_.getJsRef()) .append(".color);"); } else { diff --git a/src/eu/webtoolkit/jwt/WClientGLWidget.java b/src/eu/webtoolkit/jwt/WClientGLWidget.java index 8883d277..980df3f7 100644 --- a/src/eu/webtoolkit/jwt/WClientGLWidget.java +++ b/src/eu/webtoolkit/jwt/WClientGLWidget.java @@ -2401,7 +2401,7 @@ public void initJavaScriptMatrix4(final WGLWidget.JavaScriptMatrix4x4 mat) { public void setJavaScriptMatrix4( final WGLWidget.JavaScriptMatrix4x4 jsm, final javax.vecmath.Matrix4f m) { - this.js_.append("Wt4_11_0.glMatrix.mat4.set("); + this.js_.append("Wt4_11_1.glMatrix.mat4.set("); javax.vecmath.Matrix4f t = WebGLUtils.transpose(m); WebGLUtils.renderfv(this.js_, t, JsArrayType.Float32Array); this.js_.append(", ").append(jsm.getJsRef()).append(");"); @@ -2548,7 +2548,7 @@ public void restoreContext(final String jsRef) { public void render(final String jsRef, EnumSet flags) { if (flags.contains(RenderFlag.Full)) { StringWriter tmp = new StringWriter(); - tmp.append("{\nvar o = new Wt4_11_0.WGLWidget(") + tmp.append("{\nvar o = new Wt4_11_1.WGLWidget(") .append(WApplication.getInstance().getJavaScriptClass()) .append(",") .append(jsRef) diff --git a/src/eu/webtoolkit/jwt/WCssStyleSheet.java b/src/eu/webtoolkit/jwt/WCssStyleSheet.java index e43b197c..7979e9b2 100644 --- a/src/eu/webtoolkit/jwt/WCssStyleSheet.java +++ b/src/eu/webtoolkit/jwt/WCssStyleSheet.java @@ -179,14 +179,14 @@ public void cssText(final StringBuilder out, boolean all) { public void javaScriptUpdate(WApplication app, final StringBuilder js, boolean all) { if (!all) { for (int i = 0; i < this.rulesRemoved_.size(); ++i) { - js.append("Wt4_11_0.removeCssRule("); + js.append("Wt4_11_1.removeCssRule("); DomElement.jsStringLiteral(js, this.rulesRemoved_.get(i), '\''); js.append(");"); } this.rulesRemoved_.clear(); for (Iterator i_it = this.rulesModified_.iterator(); i_it.hasNext(); ) { WCssRule i = i_it.next(); - js.append("{ var d= Wt4_11_0.getCssRule("); + js.append("{ var d= Wt4_11_1.getCssRule("); DomElement.jsStringLiteral(js, i.getSelector(), '\''); js.append(");if(d){"); DomElement d = DomElement.updateGiven("d", DomElementType.SPAN); @@ -205,7 +205,7 @@ public void javaScriptUpdate(WApplication app, final StringBuilder js, boolean a final List toProcess = this.rules_; for (int i = 0; i < toProcess.size(); ++i) { WCssRule rule = toProcess.get(i); - js.append("Wt4_11_0.addCss('").append(rule.getSelector()).append("',"); + js.append("Wt4_11_1.addCss('").append(rule.getSelector()).append("',"); DomElement.jsStringLiteral(js, rule.getDeclarations(), '\''); js.append(");\n"); } @@ -213,7 +213,7 @@ public void javaScriptUpdate(WApplication app, final StringBuilder js, boolean a final List toProcess = this.rulesAdded_; for (int i = 0; i < toProcess.size(); ++i) { final WCssRule rule = toProcess.get(i); - js.append("Wt4_11_0.addCss('").append(rule.getSelector()).append("',"); + js.append("Wt4_11_1.addCss('").append(rule.getSelector()).append("',"); DomElement.jsStringLiteral(js, rule.getDeclarations(), '\''); js.append(");\n"); } @@ -226,7 +226,7 @@ public void javaScriptUpdate(WApplication app, final StringBuilder js, boolean a StringBuilder css = new StringBuilder(); this.cssText(css, all); if (!(css.length() == 0)) { - js.append("Wt4_11_0.addCssText("); + js.append("Wt4_11_1.addCssText("); DomElement.jsStringLiteral(js, css.toString(), '\''); js.append(");\n"); } diff --git a/src/eu/webtoolkit/jwt/WCssTheme.java b/src/eu/webtoolkit/jwt/WCssTheme.java index 8fe2c4ae..dffb06c5 100644 --- a/src/eu/webtoolkit/jwt/WCssTheme.java +++ b/src/eu/webtoolkit/jwt/WCssTheme.java @@ -569,7 +569,7 @@ public void applyValidationStyle( app.loadJavaScript("js/CssThemeValidate.js", wtjs2()); if (app.getEnvironment().hasAjax()) { StringBuilder js = new StringBuilder(); - js.append("Wt4_11_0.setValidationState(") + js.append("Wt4_11_1.setValidationState(") .append(widget.getJsRef()) .append(",") .append(validation.getState() == ValidationState.Valid) diff --git a/src/eu/webtoolkit/jwt/WDateEdit.java b/src/eu/webtoolkit/jwt/WDateEdit.java index 11de8ad6..a993ca15 100644 --- a/src/eu/webtoolkit/jwt/WDateEdit.java +++ b/src/eu/webtoolkit/jwt/WDateEdit.java @@ -346,7 +346,7 @@ private void defineJavaScript() { WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WDateEdit.js", wtjs1()); String jsObj = - "new Wt4_11_0.WDateEdit(" + "new Wt4_11_1.WDateEdit(" + app.getJavaScriptClass() + "," + this.getJsRef() diff --git a/src/eu/webtoolkit/jwt/WDateValidator.java b/src/eu/webtoolkit/jwt/WDateValidator.java index 8e50593f..d09005cc 100644 --- a/src/eu/webtoolkit/jwt/WDateValidator.java +++ b/src/eu/webtoolkit/jwt/WDateValidator.java @@ -304,7 +304,7 @@ public WString getInvalidTooLateText() { public String getJavaScriptValidate() { loadJavaScript(WApplication.getInstance()); StringBuilder js = new StringBuilder(); - js.append("new Wt4_11_0.WDateValidator(").append(this.isMandatory()).append(",["); + js.append("new Wt4_11_1.WDateValidator(").append(this.isMandatory()).append(",["); for (int i = 0; i < this.formats_.size(); ++i) { WDate.RegExpInfo r = WDate.formatToRegExp(this.formats_.get(i)); if (i != 0) { diff --git a/src/eu/webtoolkit/jwt/WDialog.java b/src/eu/webtoolkit/jwt/WDialog.java index d1af9804..414bfb50 100644 --- a/src/eu/webtoolkit/jwt/WDialog.java +++ b/src/eu/webtoolkit/jwt/WDialog.java @@ -398,7 +398,7 @@ public void setResizable(boolean resizable) { Resizable.loadJavaScript(WApplication.getInstance()); this.setJavaScriptMember( " Resizable", - "(new Wt4_11_0.Resizable(Wt4_11_0," + "(new Wt4_11_1.Resizable(Wt4_11_1," + this.getJsRef() + ")).onresize(function(w, h, done) {var obj = " + this.getJsRef() @@ -699,7 +699,7 @@ protected void render(EnumSet flags) { } } this.doJavaScript( - "new Wt4_11_0.WDialog(" + "new Wt4_11_1.WDialog(" + app.getJavaScriptClass() + "," + this.getJsRef() diff --git a/src/eu/webtoolkit/jwt/WDoubleValidator.java b/src/eu/webtoolkit/jwt/WDoubleValidator.java index 8f8d7133..204dff65 100644 --- a/src/eu/webtoolkit/jwt/WDoubleValidator.java +++ b/src/eu/webtoolkit/jwt/WDoubleValidator.java @@ -250,7 +250,7 @@ public boolean isIgnoreTrailingSpaces() { public String getJavaScriptValidate() { loadJavaScript(WApplication.getInstance()); StringBuilder js = new StringBuilder(); - js.append("new Wt4_11_0.WDoubleValidator(") + js.append("new Wt4_11_1.WDoubleValidator(") .append(this.isMandatory()) .append(',') .append(this.ignoreTrailingSpaces_) diff --git a/src/eu/webtoolkit/jwt/WEmailEdit.java b/src/eu/webtoolkit/jwt/WEmailEdit.java index c00b3271..3c232d47 100644 --- a/src/eu/webtoolkit/jwt/WEmailEdit.java +++ b/src/eu/webtoolkit/jwt/WEmailEdit.java @@ -267,7 +267,7 @@ protected void render(EnumSet flags) { super.render(flags); WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WEmailEdit.js", wtjs1()); - super.setJavaScriptMember("wtEncodeValue", "Wt4_11_0.encodeEmailValue"); + super.setJavaScriptMember("wtEncodeValue", "Wt4_11_1.encodeEmailValue"); } void updateDom(final DomElement element, boolean all) { diff --git a/src/eu/webtoolkit/jwt/WEmailValidator.java b/src/eu/webtoolkit/jwt/WEmailValidator.java index b2b05e81..2ea46d9f 100644 --- a/src/eu/webtoolkit/jwt/WEmailValidator.java +++ b/src/eu/webtoolkit/jwt/WEmailValidator.java @@ -213,7 +213,7 @@ public WString getPattern() { public String getJavaScriptValidate() { loadJavaScript(WApplication.getInstance()); StringBuilder js = new StringBuilder(); - js.append("new Wt4_11_0.WEmailValidator(") + js.append("new Wt4_11_1.WEmailValidator(") .append(this.isMandatory()) .append(',') .append(this.isMultiple()) diff --git a/src/eu/webtoolkit/jwt/WEnvironment.java b/src/eu/webtoolkit/jwt/WEnvironment.java index 445fa277..4bc69476 100644 --- a/src/eu/webtoolkit/jwt/WEnvironment.java +++ b/src/eu/webtoolkit/jwt/WEnvironment.java @@ -52,7 +52,7 @@ public class WEnvironment { /** Wt's JavaScript scope. */ public static String getJavaScriptWtScope() { - return "Wt4_11_0"; + return "Wt4_11_1"; } /** * Parameters passed to the application. @@ -447,7 +447,7 @@ public String getDeploymentPath() { *

        Example: "1.99.2" */ public static String getLibraryVersion() { - return "4.11.0"; + return "4.11.1"; } // public void libraryVersion(final bad java simple ref int series, final bad java simple ref int // major, final bad java simple ref int minor) ; diff --git a/src/eu/webtoolkit/jwt/WFileDropWidget.java b/src/eu/webtoolkit/jwt/WFileDropWidget.java index 107ca0db..52a7ae89 100644 --- a/src/eu/webtoolkit/jwt/WFileDropWidget.java +++ b/src/eu/webtoolkit/jwt/WFileDropWidget.java @@ -726,7 +726,7 @@ String renderRemoveJs(boolean recursive) { if (this.isRendered()) { String result = this.getJsRef() + ".destructor();"; if (!recursive) { - result += "Wt4_11_0.remove('" + this.getId() + "');"; + result += "Wt4_11_1.remove('" + this.getId() + "');"; } return result; } else { @@ -848,7 +848,7 @@ private void setup() { String maxFileSize = String.valueOf(WApplication.getInstance().getMaximumRequestSize()); this.setJavaScriptMember( " WFileDropWidget", - "new Wt4_11_0.WFileDropWidget(" + "new Wt4_11_1.WFileDropWidget(" + app.getJavaScriptClass() + "," + this.getJsRef() diff --git a/src/eu/webtoolkit/jwt/WFileUpload.java b/src/eu/webtoolkit/jwt/WFileUpload.java index 0db70c1a..6bf61c19 100644 --- a/src/eu/webtoolkit/jwt/WFileUpload.java +++ b/src/eu/webtoolkit/jwt/WFileUpload.java @@ -473,7 +473,7 @@ private void onData(long current, long total) { private void onDataExceeded(long dataExceeded) { this.doJavaScript( - "Wt4_11_0.$('if" + this.getId() + "').src='" + this.fileUploadTarget_.getUrl() + "';"); + "Wt4_11_1.$('if" + this.getId() + "').src='" + this.fileUploadTarget_.getUrl() + "';"); if (this.flags_.get(BIT_UPLOADING)) { this.flags_.clear(BIT_UPLOADING); this.handleFileTooLarge(dataExceeded); @@ -534,7 +534,7 @@ void updateDom(final DomElement element, boolean all) { element.setAttribute("action", this.fileUploadTarget_.generateUrl()); String maxFileSize = String.valueOf(WApplication.getInstance().getMaximumRequestSize()); String command = - "{var submit = true;var x = Wt4_11_0.$('in" + "{var submit = true;var x = Wt4_11_1.$('in" + this.getId() + "');if (x.files != null) {for (var i = 0; i < x.files.length; i++) {var f = x.files[i];if (f.size > " + maxFileSize @@ -681,9 +681,9 @@ protected void propagateSetEnabled(boolean enabled) { String renderRemoveJs(boolean recursive) { boolean isIE = WApplication.getInstance().getEnvironment().agentIsIE(); if (this.isRendered() && isIE) { - String result = "Wt4_11_0.$('if" + this.getId() + "').innerHTML = \"\";"; + String result = "Wt4_11_1.$('if" + this.getId() + "').innerHTML = \"\";"; if (!recursive) { - result += "Wt4_11_0.remove('" + this.getId() + "');"; + result += "Wt4_11_1.remove('" + this.getId() + "');"; } return result; } else { diff --git a/src/eu/webtoolkit/jwt/WFlashObject.java b/src/eu/webtoolkit/jwt/WFlashObject.java index 801fbebc..81aaeab9 100644 --- a/src/eu/webtoolkit/jwt/WFlashObject.java +++ b/src/eu/webtoolkit/jwt/WFlashObject.java @@ -146,7 +146,7 @@ public void setFlashVariable(final String name, final CharSequence value) { * for example on IE when flash is not installed. */ public String getJsFlashRef() { - return "Wt4_11_0.getElement('" + this.getId() + "_flash')"; + return "Wt4_11_1.getElement('" + this.getId() + "_flash')"; } /** * Sets content to be displayed if Flash is not available. diff --git a/src/eu/webtoolkit/jwt/WFormWidget.java b/src/eu/webtoolkit/jwt/WFormWidget.java index 70c9c38e..55e569c7 100644 --- a/src/eu/webtoolkit/jwt/WFormWidget.java +++ b/src/eu/webtoolkit/jwt/WFormWidget.java @@ -336,7 +336,7 @@ protected void validatorChanged() { this.setJavaScriptMember("wtValidate", validateJS); if (!(this.validateJs_ != null)) { this.validateJs_ = new JSlot(); - this.validateJs_.setJavaScript("function(o){Wt4_11_0.validate(o)}"); + this.validateJs_.setJavaScript("function(o){Wt4_11_1.validate(o)}"); this.keyWentUp().addListener(this.validateJs_); this.changed().addListener(this.validateJs_); if (this.getDomElementType() != DomElementType.SELECT) { @@ -354,7 +354,7 @@ protected void validatorChanged() { } StringUtils.replace(inputFilter, '/', "\\/"); this.filterInput_.setJavaScript( - "function(o,e){Wt4_11_0.filter(o,e," + jsStringLiteral(inputFilter) + ")}"); + "function(o,e){Wt4_11_1.filter(o,e," + jsStringLiteral(inputFilter) + ")}"); } else { if (this.filterInput_ != null) { this.keyPressed().removeListener(this.filterInput_); @@ -396,7 +396,7 @@ private void defineJavaScript(boolean force) { app.loadJavaScript("js/WFormWidget.js", wtjs1()); this.setJavaScriptMember( " WFormWidget", - "new Wt4_11_0.WFormWidget(" + "new Wt4_11_1.WFormWidget(" + app.getJavaScriptClass() + "," + this.getJsRef() diff --git a/src/eu/webtoolkit/jwt/WGLWidget.java b/src/eu/webtoolkit/jwt/WGLWidget.java index fc755ccd..c57e6669 100644 --- a/src/eu/webtoolkit/jwt/WGLWidget.java +++ b/src/eu/webtoolkit/jwt/WGLWidget.java @@ -566,7 +566,7 @@ public WGLWidget.JavaScriptMatrix4x4 inverted() { } WGLWidget.JavaScriptMatrix4x4 copy = this.clone(); copy.jsRef_ = - "Wt4_11_0.glMatrix.mat4.inverse(" + this.jsRef_ + ", Wt4_11_0.glMatrix.mat4.create())"; + "Wt4_11_1.glMatrix.mat4.inverse(" + this.jsRef_ + ", Wt4_11_1.glMatrix.mat4.create())"; copy.operations_.add(WGLWidget.JavaScriptMatrix4x4.op.INVERT); return copy; } @@ -577,7 +577,7 @@ public WGLWidget.JavaScriptMatrix4x4 transposed() { } WGLWidget.JavaScriptMatrix4x4 copy = this.clone(); copy.jsRef_ = - "Wt4_11_0.glMatrix.mat4.transpose(" + this.jsRef_ + ", Wt4_11_0.glMatrix.mat4.create())"; + "Wt4_11_1.glMatrix.mat4.transpose(" + this.jsRef_ + ", Wt4_11_1.glMatrix.mat4.create())"; copy.operations_.add(WGLWidget.JavaScriptMatrix4x4.op.TRANSPOSE); return copy; } @@ -588,10 +588,10 @@ public WGLWidget.JavaScriptMatrix4x4 multiply(final javax.vecmath.Matrix4f m) { } WGLWidget.JavaScriptMatrix4x4 copy = this.clone(); StringWriter ss = new StringWriter(); - ss.append("Wt4_11_0.glMatrix.mat4.multiply(").append(this.jsRef_).append(","); + ss.append("Wt4_11_1.glMatrix.mat4.multiply(").append(this.jsRef_).append(","); javax.vecmath.Matrix4f t = WebGLUtils.transpose(m); WebGLUtils.renderfv(ss, t, this.context_.pImpl_.getArrayType()); - ss.append(", Wt4_11_0.glMatrix.mat4.create())"); + ss.append(", Wt4_11_1.glMatrix.mat4.create())"); copy.jsRef_ = ss.toString(); copy.operations_.add(WGLWidget.JavaScriptMatrix4x4.op.MULTIPLY); copy.matrices_.add(m); diff --git a/src/eu/webtoolkit/jwt/WImage.java b/src/eu/webtoolkit/jwt/WImage.java index beb787a5..65d08988 100644 --- a/src/eu/webtoolkit/jwt/WImage.java +++ b/src/eu/webtoolkit/jwt/WImage.java @@ -383,7 +383,7 @@ protected void defineJavaScript() { WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WImage.js", wtjs1()); StringBuilder ss = new StringBuilder(); - ss.append("new Wt4_11_0.WImage(") + ss.append("new Wt4_11_1.WImage(") .append(app.getJavaScriptClass()) .append(",") .append(this.getJsRef()) diff --git a/src/eu/webtoolkit/jwt/WIntValidator.java b/src/eu/webtoolkit/jwt/WIntValidator.java index 9f3ae8e5..662daacd 100644 --- a/src/eu/webtoolkit/jwt/WIntValidator.java +++ b/src/eu/webtoolkit/jwt/WIntValidator.java @@ -248,7 +248,7 @@ public boolean isIgnoreTrailingSpaces() { public String getJavaScriptValidate() { loadJavaScript(WApplication.getInstance()); StringBuilder js = new StringBuilder(); - js.append("new Wt4_11_0.WIntValidator(").append(this.isMandatory()).append(','); + js.append("new Wt4_11_1.WIntValidator(").append(this.isMandatory()).append(','); if (this.bottom_ != Integer.MIN_VALUE) { js.append(this.bottom_); } else { diff --git a/src/eu/webtoolkit/jwt/WInteractWidget.java b/src/eu/webtoolkit/jwt/WInteractWidget.java index ba30211f..b5b36a7c 100644 --- a/src/eu/webtoolkit/jwt/WInteractWidget.java +++ b/src/eu/webtoolkit/jwt/WInteractWidget.java @@ -535,7 +535,7 @@ public void setPopup(boolean popup) { if (popup && WApplication.getInstance().getEnvironment().hasAjax()) { this.clicked() .addListener( - "function(o,e) { if (Wt4_11_0.WPopupWidget && o.wtPopup) {Wt4_11_0.WPopupWidget.popupClicked = o;document.dispatchEvent(new MouseEvent('click', e));Wt4_11_0.WPopupWidget.popupClicked = null; }}"); + "function(o,e) { if (Wt4_11_1.WPopupWidget && o.wtPopup) {Wt4_11_1.WPopupWidget.popupClicked = o;document.dispatchEvent(new MouseEvent('click', e));Wt4_11_1.WPopupWidget.popupClicked = null; }}"); this.clicked().preventPropagation(); } super.setPopup(popup); @@ -627,7 +627,7 @@ void updateDom(final DomElement element, boolean all) { String CheckDisabled = "if(o.classList.contains('" + app.getTheme().getDisabledClass() - + "')){Wt4_11_0.cancelEvent(e);return;}"; + + "')){Wt4_11_1.cancelEvent(e);return;}"; if (updateMouseDown) { StringBuilder js = new StringBuilder(); js.append(CheckDisabled); @@ -639,11 +639,11 @@ void updateDom(final DomElement element, boolean all) { && mouseDown.isConnected() && (mouseUp != null && mouseUp.isConnected() || mouseMove != null && mouseMove.isConnected())) { - js.append("Wt4_11_0.capture(this);"); + js.append("Wt4_11_1.capture(this);"); } if (mouseMove != null && mouseMove.isConnected() || mouseDrag != null && mouseDrag.isConnected()) { - js.append("Wt4_11_0.mouseDown(e);"); + js.append("Wt4_11_1.mouseDown(e);"); } if (mouseDown != null) { js.append(mouseDown.getJavaScript()); @@ -659,7 +659,7 @@ void updateDom(final DomElement element, boolean all) { js.append(CheckDisabled); if (mouseMove != null && mouseMove.isConnected() || mouseDrag != null && mouseDrag.isConnected()) { - js.append("Wt4_11_0.mouseUp(e);"); + js.append("Wt4_11_1.mouseUp(e);"); } if (mouseUp != null) { js.append(mouseUp.getJavaScript()); @@ -680,8 +680,8 @@ void updateDom(final DomElement element, boolean all) { if (mouseDrag != null) { actions.add( new DomElement.EventAction( - "Wt4_11_0.buttons", - mouseDrag.getJavaScript() + "Wt4_11_0.drag(e);", + "Wt4_11_1.buttons", + mouseDrag.getJavaScript() + "Wt4_11_1.drag(e);", mouseDrag.encodeCmd(), mouseDrag.isExposedSignal())); mouseDrag.updateOk(); @@ -704,7 +704,7 @@ void updateDom(final DomElement element, boolean all) { && touchStart.isConnected() && (touchEnd != null && touchEnd.isConnected() || touchMove != null && touchMove.isConnected())) { - js.append("Wt4_11_0.capture(this);"); + js.append("Wt4_11_1.capture(this);"); } if (touchStart != null) { js.append(touchStart.getJavaScript()); @@ -746,12 +746,12 @@ void updateDom(final DomElement element, boolean all) { StringBuilder js = new StringBuilder(); js.append(CheckDisabled); if (mouseDrag != null) { - js.append("if (Wt4_11_0.dragged()) return;"); + js.append("if (Wt4_11_1.dragged()) return;"); } if (mouseDblClick != null && mouseDblClick.needsUpdate(all)) { if (mouseClick != null) { if (mouseClick.isDefaultActionPrevented() || mouseClick.isPropagationPrevented()) { - js.append("Wt4_11_0.cancelEvent(e"); + js.append("Wt4_11_1.cancelEvent(e"); if (mouseClick.isDefaultActionPrevented() && mouseClick.isPropagationPrevented()) { js.append(");"); } else { @@ -763,7 +763,7 @@ void updateDom(final DomElement element, boolean all) { } } } - js.append("if(Wt4_11_0.isDblClick(o, e)) {").append(mouseDblClick.getJavaScript()); + js.append("if(Wt4_11_1.isDblClick(o, e)) {").append(mouseDblClick.getJavaScript()); if (mouseDblClick.isExposedSignal()) { js.append(app.getJavaScriptClass()) .append("._p_.update(o,'") @@ -772,7 +772,7 @@ void updateDom(final DomElement element, boolean all) { } mouseDblClick.updateOk(); js.append( - "}else{if (Wt4_11_0.isIElt9 && document.createEventObject) e = document.createEventObject(e);o.wtE1 = e;o.wtClickTimeout = setTimeout(function() {o.wtClickTimeout = null; o.wtE1 = null;"); + "}else{if (Wt4_11_1.isIElt9 && document.createEventObject) e = document.createEventObject(e);o.wtE1 = e;o.wtClickTimeout = setTimeout(function() {o.wtClickTimeout = null; o.wtE1 = null;"); if (mouseClick != null) { js.append(mouseClick.getJavaScript()); if (mouseClick.isExposedSignal()) { diff --git a/src/eu/webtoolkit/jwt/WLeafletMap.java b/src/eu/webtoolkit/jwt/WLeafletMap.java index c0e09bb8..1da22ef3 100644 --- a/src/eu/webtoolkit/jwt/WLeafletMap.java +++ b/src/eu/webtoolkit/jwt/WLeafletMap.java @@ -667,7 +667,7 @@ private void defineJavaScript() { String optionsStr = this.options_.toString(); StringBuilder ss = new StringBuilder(); EscapeOStream es = new EscapeOStream(ss); - es.append("new Wt4_11_0.WLeafletMap(") + es.append("new Wt4_11_1.WLeafletMap(") .append(app.getJavaScriptClass()) .append(",") .append(this.getJsRef()) diff --git a/src/eu/webtoolkit/jwt/WLengthValidator.java b/src/eu/webtoolkit/jwt/WLengthValidator.java index 0abf36cd..77983494 100644 --- a/src/eu/webtoolkit/jwt/WLengthValidator.java +++ b/src/eu/webtoolkit/jwt/WLengthValidator.java @@ -198,7 +198,7 @@ public WString getInvalidTooLongText() { public String getJavaScriptValidate() { loadJavaScript(WApplication.getInstance()); StringBuilder js = new StringBuilder(); - js.append("new Wt4_11_0.WLengthValidator(").append(this.isMandatory()).append(','); + js.append("new Wt4_11_1.WLengthValidator(").append(this.isMandatory()).append(','); if (this.minLength_ != 0) { js.append(this.minLength_); } else { diff --git a/src/eu/webtoolkit/jwt/WLineEdit.java b/src/eu/webtoolkit/jwt/WLineEdit.java index e5a07af4..06fd0650 100644 --- a/src/eu/webtoolkit/jwt/WLineEdit.java +++ b/src/eu/webtoolkit/jwt/WLineEdit.java @@ -338,7 +338,7 @@ public void setSelection(int start, int length) { String s = String.valueOf(start); String e = String.valueOf(start + length); this.doJavaScript( - "Wt4_11_0.setUnicodeSelectionRange(" + this.getJsRef() + "," + s + "," + e + ")"); + "Wt4_11_1.setUnicodeSelectionRange(" + this.getJsRef() + "," + s + "," + e + ")"); } /** * Returns the current cursor position. @@ -747,7 +747,7 @@ private void defineJavaScript() { String space = ""; space += this.spaceChar_; String jsObj = - "new Wt4_11_0.WLineEdit(" + "new Wt4_11_1.WLineEdit(" + app.getJavaScriptClass() + "," + this.getJsRef() diff --git a/src/eu/webtoolkit/jwt/WMediaPlayer.java b/src/eu/webtoolkit/jwt/WMediaPlayer.java index bd70c32a..dc1b84e1 100644 --- a/src/eu/webtoolkit/jwt/WMediaPlayer.java +++ b/src/eu/webtoolkit/jwt/WMediaPlayer.java @@ -769,7 +769,7 @@ protected void render(EnumSet flags) { first = false; } ss.append('}').append("});"); - ss.append("new Wt4_11_0.WMediaPlayer(") + ss.append("new Wt4_11_1.WMediaPlayer(") .append(app.getJavaScriptClass()) .append(',') .append(this.getJsRef()) diff --git a/src/eu/webtoolkit/jwt/WMediaPlayerImpl.java b/src/eu/webtoolkit/jwt/WMediaPlayerImpl.java index 1f1e4f7f..4dcaeae7 100644 --- a/src/eu/webtoolkit/jwt/WMediaPlayerImpl.java +++ b/src/eu/webtoolkit/jwt/WMediaPlayerImpl.java @@ -33,7 +33,7 @@ String renderRemoveJs(boolean recursive) { if (this.isRendered()) { String result = this.player_.getJsPlayerRef() + ".jPlayer('destroy');"; if (!recursive) { - result += "Wt4_11_0.remove('" + this.getId() + "');"; + result += "Wt4_11_1.remove('" + this.getId() + "');"; } return result; } else { diff --git a/src/eu/webtoolkit/jwt/WMenu.java b/src/eu/webtoolkit/jwt/WMenu.java index a8018be9..1422d200 100644 --- a/src/eu/webtoolkit/jwt/WMenu.java +++ b/src/eu/webtoolkit/jwt/WMenu.java @@ -31,6 +31,11 @@ * stack. The contents stack may contain other items, and could be shared with other {@link WMenu} * instances. * + *

        When using nested menus, you can use the currentWidgetChanged() signal to react to the change + * of widget selected while knowing what widget was selected as the {@link WMenu#itemSelected() + * itemSelected()} signal from the sub-menu is only emited when the widget selected by the submenu + * is changed. + * *

        When used without a contents stack, you can react to menu item selection using the {@link * WMenu#itemSelected() itemSelected()} signal, to implement some custom handling of item selection. * @@ -49,6 +54,17 @@ * menu.addItem("Demo", new DemoWidget()); * menu.addItem(new WMenuItem("Demo2", new DemoWidget())); * + * // bind the function to call when a new item is selected + * contents.currentWidgetChanged().connect((newSelection) . { + * if (newSelection instanceof Wt.WText){ + * logger.info(new StringWriter().append("Text selected: ").append((WText)newSelection).text()); + * } + * else if (newSelection instanceof DemoWidget){ + * logger.info(new StringWriter().append("Testing a demo"); + * } + * } + * ); + * * } * *

        After construction, the first entry will be selected. At any time, it is possible to select a @@ -397,6 +413,14 @@ public WMenuItem insertMenu( *

        Inserts a menu item. Use this form to insert specialized {@link WMenuItem} implementations. * *

        + * + *

        Note: When using the {@link WMenu} with a {@link WStackedWidget}, the first {@link + * WMenuItem} added will be automatically selected. This implies that this function can trigger + * the {@link WMenu#itemSelectRendered() itemSelectRendered()} and {@link WMenu#itemSelected() + * itemSelected()} signals. + * + * @see WMenu#itemSelected() + * @see WMenu#itemSelectRendered() */ public WMenuItem insertItem(int index, WMenuItem item) { item.setParentMenu(this); @@ -407,13 +431,9 @@ public WMenuItem insertItem(int index, WMenuItem item) { if (contentsPtr != null) { WWidget contents = contentsPtr; this.contentsStack_.addWidget(contentsPtr); + this.contentsStack_.setLoadPolicy(this.contentsStack_.getCount() - 1, result.loadPolicy_); if (this.contentsStack_.getCount() == 1) { - this.setCurrent(0); - if (this.isLoaded()) { - this.getCurrentItem().loadContents(); - } - this.contentsStack_.setCurrentWidget(contents); - this.renderSelected(result, true); + this.select(0, false); } else { this.renderSelected(result, false); } @@ -941,11 +961,21 @@ void select(int index, boolean changePath) { int last = this.current_; this.setCurrent(index); this.selectVisual(this.current_, changePath, true); + WMenuItem item; if (index != -1) { - WMenuItem item = this.itemAt(index); + item = this.itemAt(index); item.show(); if (this.isLoaded()) { + boolean itemLoaded = item.isContentsLoaded(); item.loadContents(); + if (!itemLoaded + && this.contentsStack_ != null + && this.contentsStack_.loadPolicies_.get(this.contentsStack_.currentIndex_) + == ContentLoading.Lazy) { + WContainerWidget container = + ObjectUtils.cast(this.contentsStack_.getCurrentWidget(), WContainerWidget.class); + this.contentsStack_.currentWidgetChanged().trigger(container.getWidget(0)); + } } WMenu self = this; if (changePath && this.emitPathChange_) { diff --git a/src/eu/webtoolkit/jwt/WMenuItem.java b/src/eu/webtoolkit/jwt/WMenuItem.java index b159302e..07f9cbf4 100644 --- a/src/eu/webtoolkit/jwt/WMenuItem.java +++ b/src/eu/webtoolkit/jwt/WMenuItem.java @@ -749,7 +749,7 @@ protected void render(EnumSet flags) { } } - private ContentLoading loadPolicy_; + ContentLoading loadPolicy_; private WWidget uContents_; private WWidget oContents_; private WContainerWidget uContentsContainer_; @@ -821,7 +821,7 @@ void updateInternalPath() { } } - private boolean isContentsLoaded() { + boolean isContentsLoaded() { return this.oContents_ != null && !(this.uContents_ != null); } diff --git a/src/eu/webtoolkit/jwt/WPainterPath.java b/src/eu/webtoolkit/jwt/WPainterPath.java index b3202636..35d156e2 100644 --- a/src/eu/webtoolkit/jwt/WPainterPath.java +++ b/src/eu/webtoolkit/jwt/WPainterPath.java @@ -731,7 +731,7 @@ public final WRectF getControlPointRect() { public WPainterPath getCrisp() { WPainterPath result = new WPainterPath(); if (this.isJavaScriptBound()) { - result.assignBinding(this, "Wt4_11_0.gfxUtils.path_crisp(" + this.getJsRef() + ')'); + result.assignBinding(this, "Wt4_11_1.gfxUtils.path_crisp(" + this.getJsRef() + ')'); } for (int i = 0; i < this.segments_.size(); ++i) { final WPainterPath.Segment segment = this.segments_.get(i); diff --git a/src/eu/webtoolkit/jwt/WPanel.java b/src/eu/webtoolkit/jwt/WPanel.java index 22969ecd..7746a3c5 100644 --- a/src/eu/webtoolkit/jwt/WPanel.java +++ b/src/eu/webtoolkit/jwt/WPanel.java @@ -57,7 +57,7 @@ public WPanel(WContainerWidget parentContainer) { this.impl_.bindWidget("contents", centralArea); this.setJavaScriptMember( WT_RESIZE_JS, - "function(self, w, h, s) {var hdefined = h >= 0;if (hdefined) {var mh = Wt4_11_0.px(self, 'maxHeight');if (mh > 0) h = Math.min(h, mh);}if (Wt4_11_0.boxSizing(self)) {h -= Wt4_11_0.px(self, 'borderTopWidth') + Wt4_11_0.px(self, 'borderBottomWidth');}var c = self.lastChild;var t = c.previousSibling;if (t)h -= t.offsetHeight;h -= 8;if (hdefined && h > 0) {c.lh = true;c.style.height = h + 'px';c.querySelectorAll(':scope > *').forEach(function(self) { let padding = self.getBoundingClientRect().height - Wt4_11_0.px(self, 'height');self.style.height = (h - padding) + 'px';self.lh = true;});} else {c.style.height = '';c.lh = false;for (const child of c.children) {child.style.height = '';child.lh = false;}}};"); + "function(self, w, h, s) {var hdefined = h >= 0;if (hdefined) {var mh = Wt4_11_1.px(self, 'maxHeight');if (mh > 0) h = Math.min(h, mh);}if (Wt4_11_1.boxSizing(self)) {h -= Wt4_11_1.px(self, 'borderTopWidth') + Wt4_11_1.px(self, 'borderBottomWidth');}var c = self.lastChild;var t = c.previousSibling;if (t)h -= t.offsetHeight;h -= 8;if (hdefined && h > 0) {c.lh = true;c.style.height = h + 'px';c.querySelectorAll(':scope > *').forEach(function(self) { let padding = self.getBoundingClientRect().height - Wt4_11_1.px(self, 'height');self.style.height = (h - padding) + 'px';self.lh = true;});} else {c.style.height = '';c.lh = false;for (const child of c.children) {child.style.height = '';child.lh = false;}}};"); this.setJavaScriptMember(WT_GETPS_JS, StdWidgetItemImpl.getSecondGetPSJS()); if (parentContainer != null) parentContainer.addWidget(this); } diff --git a/src/eu/webtoolkit/jwt/WPopupMenu.java b/src/eu/webtoolkit/jwt/WPopupMenu.java index 52f1bbd7..87e45508 100644 --- a/src/eu/webtoolkit/jwt/WPopupMenu.java +++ b/src/eu/webtoolkit/jwt/WPopupMenu.java @@ -171,7 +171,7 @@ public void popup(final WPoint p) { this.setOffsets(new WLength(42), EnumSet.of(Side.Left, Side.Top)); this.setOffsets(new WLength(-10000), EnumSet.of(Side.Left, Side.Top)); this.doJavaScript( - "Wt4_11_0.positionXY('" + "Wt4_11_1.positionXY('" + this.getId() + "'," + String.valueOf(p.getX()) @@ -421,7 +421,7 @@ protected void render(EnumSet flags) { String renderRemoveJs(boolean recursive) { String result = super.renderRemoveJs(true); - result += "Wt4_11_0.remove('" + this.getId() + "');"; + result += "Wt4_11_1.remove('" + this.getId() + "');"; return result; } @@ -500,7 +500,7 @@ private void prepareRender(WApplication app) { if (!this.cancel_.isConnected()) { app.loadJavaScript("js/WPopupMenu.js", wtjs1()); StringBuilder s = new StringBuilder(); - s.append("new Wt4_11_0.WPopupMenu(") + s.append("new Wt4_11_1.WPopupMenu(") .append(app.getJavaScriptClass()) .append(',') .append(this.getJsRef()) diff --git a/src/eu/webtoolkit/jwt/WPopupWidget.java b/src/eu/webtoolkit/jwt/WPopupWidget.java index f55f3447..b44cb640 100644 --- a/src/eu/webtoolkit/jwt/WPopupWidget.java +++ b/src/eu/webtoolkit/jwt/WPopupWidget.java @@ -228,7 +228,7 @@ private void defineJS() { app.loadJavaScript("js/WPopupWidget.js", wtjs1()); StringBuilder jsObj = new StringBuilder(); jsObj - .append("new Wt4_11_0.WPopupWidget(") + .append("new Wt4_11_1.WPopupWidget(") .append(app.getJavaScriptClass()) .append(',') .append(this.getJsRef()) diff --git a/src/eu/webtoolkit/jwt/WRectF.java b/src/eu/webtoolkit/jwt/WRectF.java index 9c4c1c55..650ac38f 100644 --- a/src/eu/webtoolkit/jwt/WRectF.java +++ b/src/eu/webtoolkit/jwt/WRectF.java @@ -422,7 +422,7 @@ public WRectF getNormalized() { } WRectF result = new WRectF(x, y, w, h); if (this.isJavaScriptBound()) { - result.assignBinding(this, "Wt4_11_0.gfxUtils.rect_normalized(" + this.getJsRef() + ')'); + result.assignBinding(this, "Wt4_11_1.gfxUtils.rect_normalized(" + this.getJsRef() + ')'); } return result; } diff --git a/src/eu/webtoolkit/jwt/WRegExpValidator.java b/src/eu/webtoolkit/jwt/WRegExpValidator.java index a4b1387f..cee183c8 100644 --- a/src/eu/webtoolkit/jwt/WRegExpValidator.java +++ b/src/eu/webtoolkit/jwt/WRegExpValidator.java @@ -161,7 +161,7 @@ public WString getInvalidNoMatchText() { public String getJavaScriptValidate() { loadJavaScript(WApplication.getInstance()); StringBuilder js = new StringBuilder(); - js.append("new Wt4_11_0.WRegExpValidator(").append(this.isMandatory()).append(','); + js.append("new Wt4_11_1.WRegExpValidator(").append(this.isMandatory()).append(','); js.append(WWebWidget.jsStringLiteral(this.pattern_)).append(",'"); if ((this.regex_.flags() & Pattern.CASE_INSENSITIVE) != 0) { js.append('i'); diff --git a/src/eu/webtoolkit/jwt/WSlider.java b/src/eu/webtoolkit/jwt/WSlider.java index afa6e96a..a55a5162 100644 --- a/src/eu/webtoolkit/jwt/WSlider.java +++ b/src/eu/webtoolkit/jwt/WSlider.java @@ -78,6 +78,7 @@ public WSlider(WContainerWidget parentContainer) { this.preferNative_ = false; this.changed_ = false; this.changedConnected_ = false; + this.inputConnected_ = false; this.handleWidth_ = 20; this.minimum_ = 0; this.maximum_ = 99; @@ -115,6 +116,7 @@ public WSlider(Orientation orientation, WContainerWidget parentContainer) { this.preferNative_ = false; this.changed_ = false; this.changedConnected_ = false; + this.inputConnected_ = false; this.handleWidth_ = 20; this.minimum_ = 0; this.maximum_ = 99; @@ -541,6 +543,8 @@ public void setValueText(final String value) { public void enableAjax() { if (this.paintedSlider_ != null) { this.paintedSlider_.connectSlots(); + } else { + super.enableAjax(); } } @@ -685,7 +689,7 @@ void updateDom(final DomElement element, boolean all) { } else { if (!this.inputConnected_ && (this.valueChanged_.isConnected() || this.sliderMoved_.isConnected())) { - this.changedConnected_ = true; + this.inputConnected_ = true; this.input() .addListener( this, diff --git a/src/eu/webtoolkit/jwt/WStackedWidget.java b/src/eu/webtoolkit/jwt/WStackedWidget.java index 227e93e9..c48f4c34 100644 --- a/src/eu/webtoolkit/jwt/WStackedWidget.java +++ b/src/eu/webtoolkit/jwt/WStackedWidget.java @@ -30,6 +30,12 @@ * WStackedWidget#setCurrentIndex(int index) setCurrentIndex()} you can retrieve or set the visible * widget. * + *

        When calling the above + * {@link WStackedWidget#setCurrentIndex(int index) setCurrentIndex()}, this will fire the + * {@link WStackedWidget#currentWidgetChanged() currentWidgetChanged()} signal. This allows + * developers to know when the current visible widget has changed and what the new visible widget + * is. + * *

        WStackedWidget, like {@link WContainerWidget}, is by default not inline. * *

        @@ -55,6 +61,8 @@ public WStackedWidget(WContainerWidget parentContainer) { this.widgetsAdded_ = false; this.javaScriptDefined_ = false; this.loadAnimateJS_ = false; + this.loadPolicies_ = new ArrayList(); + this.currentWidgetChanged_ = new Signal1(); this.setOverflow(Overflow.Hidden); this.addStyleClass("Wt-stack"); if (parentContainer != null) parentContainer.addWidget(this); @@ -70,6 +78,8 @@ public WStackedWidget() { public void addWidget(WWidget widget) { super.addWidget(widget); + int index = this.getCount() - 1; + this.loadPolicies_.add(0 + index, ContentLoading.Eager); if (this.currentIndex_ == -1) { this.currentIndex_ = 0; } @@ -77,7 +87,9 @@ public void addWidget(WWidget widget) { } // public Widget addWidget( widget) ; public WWidget removeWidget(WWidget widget) { + int index = this.getIndexOf(widget); WWidget result = super.removeWidget(widget); + this.loadPolicies_.remove(0 + index); if (this.currentIndex_ >= this.getCount()) { if (this.getCount() > 0) { this.setCurrentIndex(this.getCount() - 1); @@ -116,6 +128,7 @@ public WWidget getCurrentWidget() { /** Insert a widget at a given index. */ public void insertWidget(int index, WWidget widget) { super.insertWidget(index, widget); + this.loadPolicies_.add(0 + index, ContentLoading.Eager); if (this.currentIndex_ == -1) { this.currentIndex_ = 0; } @@ -183,6 +196,15 @@ public void setCurrentIndex(int index, final WAnimation animation, boolean autoR + ");"); } } + if (this.loadPolicies_.get(this.currentIndex_) == ContentLoading.Lazy) { + WContainerWidget container = + ObjectUtils.cast(this.getCurrentWidget(), WContainerWidget.class); + if (container.getCount() != 0) { + this.currentWidgetChanged().trigger(container.getWidget(0)); + } + } else { + this.currentWidgetChanged().trigger(this.getCurrentWidget()); + } } /** * Changes the current widget using a custom animation. @@ -253,6 +275,17 @@ public void setTransitionAnimation(final WAnimation animation, boolean autoRever public final void setTransitionAnimation(final WAnimation animation) { setTransitionAnimation(animation, false); } + /** + * Signal which indicates that the current widget was changed. + * + *

        This signal is emitted when the current widget was changed. It holds a pointer to the new + * current widget. It is emitted every time the {@link WStackedWidget#setCurrentIndex(int index) + * setCurrentIndex()} or {@link WStackedWidget#setCurrentWidget(WWidget widget) + * setCurrentWidget()} is called. + */ + public Signal1 currentWidgetChanged() { + return this.currentWidgetChanged_; + } protected DomElement createDomElement(WApplication app) { return super.createDomElement(app); @@ -286,10 +319,12 @@ protected void render(EnumSet flags) { private WAnimation animation_; private boolean autoReverseAnimation_; - private int currentIndex_; + int currentIndex_; private boolean widgetsAdded_; private boolean javaScriptDefined_; private boolean loadAnimateJS_; + List loadPolicies_; + private Signal1 currentWidgetChanged_; private void defineJavaScript() { if (!this.javaScriptDefined_) { @@ -298,7 +333,7 @@ private void defineJavaScript() { app.loadJavaScript("js/WStackedWidget.js", wtjs1()); this.setJavaScriptMember( " WStackedWidget", - "new Wt4_11_0.WStackedWidget(" + app.getJavaScriptClass() + "," + this.getJsRef() + ");"); + "new Wt4_11_1.WStackedWidget(" + app.getJavaScriptClass() + "," + this.getJsRef() + ");"); this.setJavaScriptMember(WT_RESIZE_JS, this.getJsRef() + ".wtObj.wtResize"); this.setJavaScriptMember(WT_GETPS_JS, this.getJsRef() + ".wtObj.wtGetPs"); if (this.loadAnimateJS_) { @@ -319,6 +354,10 @@ private void loadAnimateJS() { } } + void setLoadPolicy(int index, ContentLoading loadPolicy) { + this.loadPolicies_.set(index, loadPolicy); + } + static WJavaScriptPreamble wtjs1() { return new WJavaScriptPreamble( JavaScriptScope.WtClassScope, diff --git a/src/eu/webtoolkit/jwt/WSuggestionPopup.java b/src/eu/webtoolkit/jwt/WSuggestionPopup.java index 6bddb0ad..42879b6c 100644 --- a/src/eu/webtoolkit/jwt/WSuggestionPopup.java +++ b/src/eu/webtoolkit/jwt/WSuggestionPopup.java @@ -869,7 +869,7 @@ private void defineJavaScript() { String autoSelect = this.isAutoSelectEnabled_ ? "true" : "false"; this.setJavaScriptMember( " WSuggestionPopup", - "new Wt4_11_0.WSuggestionPopup(" + "new Wt4_11_1.WSuggestionPopup(" + app.getJavaScriptClass() + "," + this.getJsRef() @@ -918,7 +918,7 @@ static WJavaScriptPreamble wtjs2() { static String instantiateStdMatcher(final WSuggestionPopup.Options options) { StringBuilder s = new StringBuilder(); - s.append("new Wt4_11_0.WSuggestionPopupStdMatcher(") + s.append("new Wt4_11_1.WSuggestionPopupStdMatcher(") .append(WWebWidget.jsStringLiteral(options.highlightBeginTag)) .append(", ") .append(WWebWidget.jsStringLiteral(options.highlightEndTag)) diff --git a/src/eu/webtoolkit/jwt/WTableView.java b/src/eu/webtoolkit/jwt/WTableView.java index 7d09aaed..5644cb97 100644 --- a/src/eu/webtoolkit/jwt/WTableView.java +++ b/src/eu/webtoolkit/jwt/WTableView.java @@ -2173,7 +2173,7 @@ private void defineJavaScript() { WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WTableView.js", wtjs1()); StringBuilder s = new StringBuilder(); - s.append("new Wt4_11_0.WTableView(") + s.append("new Wt4_11_1.WTableView(") .append(app.getJavaScriptClass()) .append(',') .append(this.getJsRef()) diff --git a/src/eu/webtoolkit/jwt/WTemplate.java b/src/eu/webtoolkit/jwt/WTemplate.java index 87d1c88c..58c3ba30 100644 --- a/src/eu/webtoolkit/jwt/WTemplate.java +++ b/src/eu/webtoolkit/jwt/WTemplate.java @@ -1429,7 +1429,7 @@ private static int parseArgs(final String text, int pos, final List res private void unrenderWidget(WWidget w, final DomElement el) { String removeJs = w.renderRemoveJs(false); if (removeJs.charAt(0) == '_') { - el.callJavaScript("Wt4_11_0.remove('" + removeJs.substring(1) + "');", true); + el.callJavaScript("Wt4_11_1.remove('" + removeJs.substring(1) + "');", true); } else { el.callJavaScript(removeJs, true); } diff --git a/src/eu/webtoolkit/jwt/WTextEdit.java b/src/eu/webtoolkit/jwt/WTextEdit.java index 7d7939a8..695c9f7b 100644 --- a/src/eu/webtoolkit/jwt/WTextEdit.java +++ b/src/eu/webtoolkit/jwt/WTextEdit.java @@ -296,7 +296,7 @@ String renderRemoveJs(boolean recursive) { if (this.isRendered()) { String result = this.getJsRef() + ".ed.remove();"; if (!recursive) { - result += "Wt4_11_0.remove('" + this.getId() + "');"; + result += "Wt4_11_1.remove('" + this.getId() + "');"; } return result; } else { @@ -397,7 +397,7 @@ private void init() { this.version_ = getTinyMCEVersion(); this.setJavaScriptMember( " WTextEdit", - "new Wt4_11_0.WTextEdit(" + app.getJavaScriptClass() + "," + this.getJsRef() + ");"); + "new Wt4_11_1.WTextEdit(" + app.getJavaScriptClass() + "," + this.getJsRef() + ");"); this.setJavaScriptMember( WT_RESIZE_JS, "function(e, w, h, s) { var obj = " diff --git a/src/eu/webtoolkit/jwt/WTimeEdit.java b/src/eu/webtoolkit/jwt/WTimeEdit.java index c0d2ee91..0fa0964a 100644 --- a/src/eu/webtoolkit/jwt/WTimeEdit.java +++ b/src/eu/webtoolkit/jwt/WTimeEdit.java @@ -279,7 +279,7 @@ private void defineJavaScript() { WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WTimeEdit.js", wtjs1()); String jsObj = - "new Wt4_11_0.WTimeEdit(" + "new Wt4_11_1.WTimeEdit(" + app.getJavaScriptClass() + "," + this.getJsRef() diff --git a/src/eu/webtoolkit/jwt/WTimeValidator.java b/src/eu/webtoolkit/jwt/WTimeValidator.java index 3fabe662..c41599ca 100644 --- a/src/eu/webtoolkit/jwt/WTimeValidator.java +++ b/src/eu/webtoolkit/jwt/WTimeValidator.java @@ -218,7 +218,7 @@ public WValidator.Result validate(final String input) { public String getJavaScriptValidate() { loadJavaScript(WApplication.getInstance()); StringBuilder js = new StringBuilder(); - js.append("new Wt4_11_0.WTimeValidator(").append(this.isMandatory()).append(",["); + js.append("new Wt4_11_1.WTimeValidator(").append(this.isMandatory()).append(",["); for (int i = 0; i < this.formats_.size(); ++i) { WTime.RegExpInfo r = WTime.formatToRegExp(this.formats_.get(i)); if (i != 0) { diff --git a/src/eu/webtoolkit/jwt/WTimerWidget.java b/src/eu/webtoolkit/jwt/WTimerWidget.java index 65659491..fe2a2407 100644 --- a/src/eu/webtoolkit/jwt/WTimerWidget.java +++ b/src/eu/webtoolkit/jwt/WTimerWidget.java @@ -74,7 +74,7 @@ DomElementType getDomElementType() { String renderRemoveJs(boolean recursive) { return "{var obj=" + this.getJsRef() - + ";if (obj && obj.timer) {clearTimeout(obj.timer);obj.timer = null;}Wt4_11_0.remove('" + + ";if (obj && obj.timer) {clearTimeout(obj.timer);obj.timer = null;}Wt4_11_1.remove('" + this.getId() + "');}"; } diff --git a/src/eu/webtoolkit/jwt/WTransform.java b/src/eu/webtoolkit/jwt/WTransform.java index a526cd9d..cc04951e 100644 --- a/src/eu/webtoolkit/jwt/WTransform.java +++ b/src/eu/webtoolkit/jwt/WTransform.java @@ -259,7 +259,7 @@ public WPointF map(final WPointF p) { o = p; } result.assignBinding( - o, "Wt4_11_0.gfxUtils.transform_mult(" + this.getJsRef() + ',' + p.getJsRef() + ')'); + o, "Wt4_11_1.gfxUtils.transform_mult(" + this.getJsRef() + ',' + p.getJsRef() + ')'); } return result; } @@ -316,7 +316,7 @@ public WRectF map(final WRectF rect) { o = rect; } result.assignBinding( - o, "Wt4_11_0.gfxUtils.transform_mult(" + this.getJsRef() + ',' + rect.getJsRef() + ')'); + o, "Wt4_11_1.gfxUtils.transform_mult(" + this.getJsRef() + ',' + rect.getJsRef() + ')'); } return result; } @@ -343,7 +343,7 @@ public WPainterPath map(final WPainterPath path) { o = path; } result.assignBinding( - o, "Wt4_11_0.gfxUtils.transform_apply(" + this.getJsRef() + ',' + path.getJsRef() + ')'); + o, "Wt4_11_1.gfxUtils.transform_apply(" + this.getJsRef() + ',' + path.getJsRef() + ')'); } final List sourceSegments = path.getSegments(); for (int i = 0; i < sourceSegments.size(); ++i) { @@ -472,7 +472,7 @@ public WTransform translate(final WPointF p) { } else { this.assignBinding( o, - "Wt4_11_0.gfxUtils.transform_mult((function(){var p=" + "Wt4_11_1.gfxUtils.transform_mult((function(){var p=" + p.getJsRef() + ";return [1,0,0,1,p[0],p[1]];})(),(" + refBefore @@ -496,7 +496,7 @@ public WTransform multiplyAndAssign(final WTransform Y) { o = Y; } this.assignBinding( - o, "Wt4_11_0.gfxUtils.transform_mult(" + this.getJsRef() + ',' + Y.getJsRef() + ')'); + o, "Wt4_11_1.gfxUtils.transform_mult(" + this.getJsRef() + ',' + Y.getJsRef() + ')'); } double z11 = X.m_[M11] * Y.m_[M11] + X.m_[M12] * Y.m_[M21]; double z12 = X.m_[M11] * Y.m_[M12] + X.m_[M12] * Y.m_[M22]; @@ -535,7 +535,7 @@ public WTransform getAdjoint() { this.getM32() * this.getM21() - this.getM31() * this.getM22(), -(this.getM32() * this.getM11() - this.getM31() * this.getM12())); if (this.isJavaScriptBound()) { - res.assignBinding(this, "Wt4_11_0.gfxUtils.transform_adjoint(" + this.getJsRef() + ")"); + res.assignBinding(this, "Wt4_11_1.gfxUtils.transform_adjoint(" + this.getJsRef() + ")"); } return res; } @@ -558,7 +558,7 @@ public WTransform getInverted() { adj.getM31() / det, adj.getM32() / det); if (this.isJavaScriptBound()) { - res.assignBinding(this, "Wt4_11_0.gfxUtils.transform_inverted(" + this.getJsRef() + ")"); + res.assignBinding(this, "Wt4_11_1.gfxUtils.transform_inverted(" + this.getJsRef() + ")"); } return res; } else { diff --git a/src/eu/webtoolkit/jwt/WTreeNode.java b/src/eu/webtoolkit/jwt/WTreeNode.java index aefa05ab..45636873 100644 --- a/src/eu/webtoolkit/jwt/WTreeNode.java +++ b/src/eu/webtoolkit/jwt/WTreeNode.java @@ -844,10 +844,12 @@ private void update() { && this.getTree().isDisabled() && this.getTree().getTreeRoot() != null) { WTreeNode root = this.getTree().getTreeRoot(); + WApplication app = WApplication.getInstance(); + String themedDisabledClass = app != null ? app.getTheme().getDisabledClass() : ""; for (WTreeNode node : root.getChildNodes()) { - if (!node.hasStyleClass("Wt-disabled")) { - node.addStyleClass("Wt-disabled"); - node.getLabel().addStyleClass("Wt-disabled"); + if (!node.hasStyleClass(themedDisabledClass)) { + node.addStyleClass(themedDisabledClass); + node.getLabel().addStyleClass(themedDisabledClass); } } } diff --git a/src/eu/webtoolkit/jwt/WTreeTable.java b/src/eu/webtoolkit/jwt/WTreeTable.java index bd914561..63a81407 100644 --- a/src/eu/webtoolkit/jwt/WTreeTable.java +++ b/src/eu/webtoolkit/jwt/WTreeTable.java @@ -265,7 +265,7 @@ private void defineJavaScript() { app.loadJavaScript("js/WTreeTable.js", wtjs1()); this.setJavaScriptMember( " WTreeTable", - "new Wt4_11_0.WTreeTable(" + app.getJavaScriptClass() + "," + this.getJsRef() + ");"); + "new Wt4_11_1.WTreeTable(" + app.getJavaScriptClass() + "," + this.getJsRef() + ");"); } static WJavaScriptPreamble wtjs1() { diff --git a/src/eu/webtoolkit/jwt/WTreeView.java b/src/eu/webtoolkit/jwt/WTreeView.java index 02ad3c98..60910a3f 100644 --- a/src/eu/webtoolkit/jwt/WTreeView.java +++ b/src/eu/webtoolkit/jwt/WTreeView.java @@ -567,7 +567,7 @@ public void setRowHeaderCount(int count) { if (useStyleLeft) { boolean rtl = app.getLayoutDirection() == LayoutDirection.RightToLeft; this.tieRowsScrollJS_.setJavaScript( - "function(obj, event) {Wt4_11_0.getCssRule('#" + "function(obj, event) {Wt4_11_1.getCssRule('#" + this.getId() + " .Wt-tv-rowc').style.left= -obj.scrollLeft " + (rtl ? "+ (obj.firstChild.offsetWidth - obj.offsetWidth)" : "") @@ -865,7 +865,7 @@ private void defineJavaScript() { app.loadJavaScript("js/WTreeView.js", wtjs1()); this.setJavaScriptMember( " WTreeView", - "new Wt4_11_0.WTreeView(" + "new Wt4_11_1.WTreeView(" + app.getJavaScriptClass() + "," + this.getJsRef() diff --git a/src/eu/webtoolkit/jwt/WTreeViewNode.java b/src/eu/webtoolkit/jwt/WTreeViewNode.java index 91467926..37facafc 100644 --- a/src/eu/webtoolkit/jwt/WTreeViewNode.java +++ b/src/eu/webtoolkit/jwt/WTreeViewNode.java @@ -606,23 +606,25 @@ public WWidget getCellWidget(int column) { void updateDom(final DomElement element, boolean all) { if (this.view_.isDisabled()) { - this.addStyleClass("Wt-disabled"); - this.nodeWidget_.addStyleClass("Wt-disabled"); + WApplication app = WApplication.getInstance(); + String themedDisabledClass = app != null ? app.getTheme().getDisabledClass() : ""; + this.addStyleClass(themedDisabledClass); + this.nodeWidget_.addStyleClass(themedDisabledClass); WWidget widget = this.nodeWidget_.resolveWidget("cols-row"); if (widget != null) { - widget.addStyleClass("Wt-disabled"); + widget.addStyleClass(themedDisabledClass); } widget = this.nodeWidget_.resolveWidget("expand"); if (widget != null) { - widget.addStyleClass("Wt-disabled"); + widget.addStyleClass(themedDisabledClass); } widget = this.nodeWidget_.resolveWidget("no-expand"); if (widget != null) { - widget.addStyleClass("Wt-disabled"); + widget.addStyleClass(themedDisabledClass); } widget = this.nodeWidget_.resolveWidget("col0"); if (widget != null) { - widget.addStyleClass("Wt-disabled"); + widget.addStyleClass(themedDisabledClass); } } super.updateDom(element, all); diff --git a/src/eu/webtoolkit/jwt/WVirtualImage.java b/src/eu/webtoolkit/jwt/WVirtualImage.java index 224b2962..4a6c223d 100644 --- a/src/eu/webtoolkit/jwt/WVirtualImage.java +++ b/src/eu/webtoolkit/jwt/WVirtualImage.java @@ -143,11 +143,11 @@ public void enableDragging() { this.impl_ .mouseWentDown() .addListener( - "function(obj, event) { var pc = Wt4_11_0.pageCoordinates(event); obj.setAttribute('dsx', pc.x); obj.setAttribute('dsy', pc.y);}"); + "function(obj, event) { var pc = Wt4_11_1.pageCoordinates(event); obj.setAttribute('dsx', pc.x); obj.setAttribute('dsy', pc.y);}"); this.impl_ .mouseMoved() .addListener( - "function(obj, event) {var WT= Wt4_11_0;var lastx = obj.getAttribute('dsx');var lasty = obj.getAttribute('dsy');if (lastx != null && lastx != '') {var nowxy = WT.pageCoordinates(event);var img = " + "function(obj, event) {var WT= Wt4_11_1;var lastx = obj.getAttribute('dsx');var lasty = obj.getAttribute('dsy');if (lastx != null && lastx != '') {var nowxy = WT.pageCoordinates(event);var img = " + this.contents_.getJsRef() + ";img.style.left = (WT.pxself(img, 'left')+nowxy.x-lastx) + 'px';img.style.top = (WT.pxself(img, 'top')+nowxy.y-lasty) + 'px';obj.setAttribute('dsx', nowxy.x);obj.setAttribute('dsy', nowxy.y);}}"); this.impl_ diff --git a/src/eu/webtoolkit/jwt/WWebWidget.java b/src/eu/webtoolkit/jwt/WWebWidget.java index 7f1098d7..1246f6cc 100644 --- a/src/eu/webtoolkit/jwt/WWebWidget.java +++ b/src/eu/webtoolkit/jwt/WWebWidget.java @@ -362,7 +362,9 @@ public boolean isVisible() { } public void setDisabled(boolean disabled) { - if (canOptimizeUpdates() && disabled == this.flags_.get(BIT_DISABLED)) { + if (canOptimizeUpdates() + && disabled == this.flags_.get(BIT_DISABLED) + && !this.flags_.get(BIT_PARENT_CHANGED)) { return; } boolean wasEnabled = this.isEnabled(); @@ -1294,7 +1296,7 @@ void updateDom(final DomElement element, boolean all) { app.addAutoJavaScript( "{var w = " + this.getJsRef() - + ";if (w && !Wt4_11_0.isHidden(w)) {var i = Wt4_11_0.getElement('" + + ";if (w && !Wt4_11_1.isHidden(w)) {var i = Wt4_11_1.getElement('" + i.getId() + "');i.style.width=w.clientWidth + 'px';i.style.height=w.clientHeight + 'px';}}"); element.addChild(i); @@ -1491,7 +1493,7 @@ void updateDom(final DomElement element, boolean all) { } String deferred = this.flags_.get(BIT_TOOLTIP_DEFERRED) ? "true" : "false"; element.callJavaScript( - "Wt4_11_0.toolTip(" + "Wt4_11_1.toolTip(" + app.getJavaScriptClass() + "," + jsStringLiteral(this.getId()) @@ -1534,7 +1536,7 @@ void updateDom(final DomElement element, boolean all) { if (!all && this.transientImpl_ != null) { for (int i = 0; i < this.transientImpl_.addedStyleClasses_.size(); ++i) { element.callJavaScript( - "Wt4_11_0.$('" + "Wt4_11_1.$('" + this.getId() + "').classList.add('" + this.transientImpl_.addedStyleClasses_.get(i) @@ -1542,7 +1544,7 @@ void updateDom(final DomElement element, boolean all) { } for (int i = 0; i < this.transientImpl_.removedStyleClasses_.size(); ++i) { element.callJavaScript( - "Wt4_11_0.$('" + "Wt4_11_1.$('" + this.getId() + "').classList.remove('" + this.transientImpl_.removedStyleClasses_.get(i) @@ -1554,7 +1556,7 @@ void updateDom(final DomElement element, boolean all) { for (int i = 0; i < this.transientImpl_.childRemoveChanges_.size(); ++i) { final String js = this.transientImpl_.childRemoveChanges_.get(i); if (js.charAt(0) == '_') { - element.callJavaScript("Wt4_11_0.remove('" + js.substring(1) + "');", true); + element.callJavaScript("Wt4_11_1.remove('" + js.substring(1) + "');", true); } else { element.callJavaScript(js, true); } @@ -1654,7 +1656,7 @@ void updateDom(final DomElement element, boolean all) { if (this.flags_.get(BIT_HIDE_WITH_VISIBILITY)) { if (this.flags_.get(BIT_HIDDEN_CHANGED) || all && this.flags_.get(BIT_HIDDEN)) { if (this.flags_.get(BIT_HIDDEN)) { - element.callJavaScript("Wt4_11_0.$('" + this.getId() + "').classList.add('Wt-hidden');"); + element.callJavaScript("Wt4_11_1.$('" + this.getId() + "').classList.add('Wt-hidden');"); element.setProperty(Property.StyleVisibility, "hidden"); if (this.flags_.get(BIT_HIDE_WITH_OFFSETS)) { element.setProperty(Property.StylePosition, "absolute"); @@ -1695,7 +1697,7 @@ void updateDom(final DomElement element, boolean all) { } } element.callJavaScript( - "Wt4_11_0.$('" + this.getId() + "').classList.remove('Wt-hidden');"); + "Wt4_11_1.$('" + this.getId() + "').classList.remove('Wt-hidden');"); element.setProperty(Property.StyleVisibility, "visible"); } } @@ -1710,7 +1712,7 @@ void updateDom(final DomElement element, boolean all) { app.loadJavaScript(THIS_JS, wtjs2()); if (!this.flags_.get(BIT_HIDE_WITH_VISIBILITY)) { StringBuilder ss = new StringBuilder(); - ss.append("Wt4_11_0") + ss.append("Wt4_11_1") .append(".animateDisplay(") .append(app.getJavaScriptClass()) .append(",'") @@ -1732,7 +1734,7 @@ void updateDom(final DomElement element, boolean all) { } } else { StringBuilder ss = new StringBuilder(); - ss.append("Wt4_11_0") + ss.append("Wt4_11_1") .append(".animateVisible('") .append(this.getId()) .append("',") @@ -1799,13 +1801,13 @@ void updateDom(final DomElement element, boolean all) { if (!app.isJavaScriptLoaded(SCROLL_JS) && this.isScrollVisibilityEnabled()) { app.loadJavaScript(SCROLL_JS, wtjs3()); StringBuilder ss = new StringBuilder(); - ss.append("if (!Wt4_11_0.scrollVisibility) {Wt4_11_0.scrollVisibility = new "); - ss.append("Wt4_11_0.ScrollVisibility(").append(app.getJavaScriptClass() + "); }"); + ss.append("if (!Wt4_11_1.scrollVisibility) {Wt4_11_1.scrollVisibility = new "); + ss.append("Wt4_11_1.ScrollVisibility(").append(app.getJavaScriptClass() + "); }"); element.callJavaScript(ss.toString()); } if (this.isScrollVisibilityEnabled()) { StringBuilder ss = new StringBuilder(); - ss.append("Wt4_11_0.scrollVisibility.add({"); + ss.append("Wt4_11_1.scrollVisibility.add({"); ss.append("el:").append(this.getJsRef()).append(','); ss.append("margin:").append(this.getScrollVisibilityMargin()).append(','); ss.append("visible:").append(this.isScrollVisible()); @@ -1815,7 +1817,7 @@ void updateDom(final DomElement element, boolean all) { } else { if (this.flags_.get(BIT_SCROLL_VISIBILITY_LOADED)) { element.callJavaScript( - "Wt4_11_0.scrollVisibility.remove(" + jsStringLiteral(this.getId()) + ");"); + "Wt4_11_1.scrollVisibility.remove(" + jsStringLiteral(this.getId()) + ");"); this.flags_.clear(BIT_SCROLL_VISIBILITY_LOADED); } } @@ -1861,6 +1863,7 @@ void propagateRenderOk(boolean deep) { this.flags_.clear(BIT_TABINDEX_CHANGED); this.flags_.clear(BIT_SCROLL_VISIBILITY_CHANGED); this.flags_.clear(BIT_OBJECT_NAME_CHANGED); + this.flags_.clear(BIT_PARENT_CHANGED); this.renderOk(); if (deep) { this.iterateChildren( @@ -1879,7 +1882,7 @@ String renderRemoveJs(boolean recursive) { final StringBuilder result = new StringBuilder(); if (this.isRendered() && this.isScrollVisibilityEnabled()) { result - .append("Wt4_11_0.scrollVisibility.remove(") + .append("Wt4_11_1.scrollVisibility.remove(") .append(jsStringLiteral(this.getId())) .append(");"); this.flags_.set(BIT_SCROLL_VISIBILITY_CHANGED); @@ -1893,7 +1896,7 @@ String renderRemoveJs(boolean recursive) { if ((result.length() == 0)) { result.append("_").append(this.getId()); } else { - result.append("Wt4_11_0.remove('").append(this.getId()).append("');"); + result.append("Wt4_11_1.remove('").append(this.getId()).append("');"); } } return result.toString(); @@ -2086,6 +2089,7 @@ protected void beingDeleted() { private static final int BIT_SCROLL_VISIBILITY_CHANGED = 35; private static final int BIT_THEME_STYLE_DISABLED = 36; private static final int BIT_OBJECT_NAME_CHANGED = 37; + private static final int BIT_PARENT_CHANGED = 38; private static String FOCUS_SIGNAL = "focus"; private static String BLUR_SIGNAL = "blur"; private static final int DEFAULT_BASE_Z_INDEX = 1100; @@ -2509,11 +2513,13 @@ private void emitChildrenChanged() { } protected void setParentWidget(WWidget parent) { + this.flags_.set(BIT_PARENT_CHANGED, parent != this.getParent()); super.setParentWidget(parent); if (parent != null) { if (this.isPopup()) { this.calcZIndex(); } + this.propagateSetEnabled(parent.isEnabled()); } } diff --git a/src/eu/webtoolkit/jwt/WWidget.java b/src/eu/webtoolkit/jwt/WWidget.java index 87af126f..30038ad4 100644 --- a/src/eu/webtoolkit/jwt/WWidget.java +++ b/src/eu/webtoolkit/jwt/WWidget.java @@ -430,11 +430,11 @@ public void positionAt(WWidget widget, Orientation orientation) { } String side = orientation == Orientation.Horizontal ? ".Horizontal" : ".Vertical"; this.doJavaScript( - "Wt4_11_0.positionAtWidget('" + "Wt4_11_1.positionAtWidget('" + this.getId() + "','" + widget.getId() - + "',Wt4_11_0" + + "',Wt4_11_1" + side + ");"); } @@ -946,7 +946,7 @@ public void refresh() {} * @see WWidget#isRendered() */ public String getJsRef() { - return "Wt4_11_0.$('" + this.getId() + "')"; + return "Wt4_11_1.$('" + this.getId() + "')"; } /** * Sets an attribute value. diff --git a/src/eu/webtoolkit/jwt/WWidgetCanvasPainter.java b/src/eu/webtoolkit/jwt/WWidgetCanvasPainter.java index cb70d588..a039485f 100644 --- a/src/eu/webtoolkit/jwt/WWidgetCanvasPainter.java +++ b/src/eu/webtoolkit/jwt/WWidgetCanvasPainter.java @@ -66,7 +66,7 @@ public void createContents(DomElement result, WPaintDevice device) { WApplication app = WApplication.getInstance(); { StringBuilder ss = new StringBuilder(); - ss.append("new Wt4_11_0.WPaintedWidget(") + ss.append("new Wt4_11_1.WPaintedWidget(") .append(app.getJavaScriptClass()) .append(",") .append(this.widget_.getJsRef()) @@ -76,7 +76,7 @@ public void createContents(DomElement result, WPaintDevice device) { String updateAreasJs = ""; if (hasJsObjects) { StringBuilder ss = new StringBuilder(); - ss.append("new Wt4_11_0.WJavaScriptObjectStorage(") + ss.append("new Wt4_11_1.WJavaScriptObjectStorage(") .append(app.getJavaScriptClass()) .append(",") .append(this.widget_.getJsRef()) diff --git a/src/eu/webtoolkit/jwt/WWidgetVectorPainter.java b/src/eu/webtoolkit/jwt/WWidgetVectorPainter.java index 391fc2b2..9ea99363 100644 --- a/src/eu/webtoolkit/jwt/WWidgetVectorPainter.java +++ b/src/eu/webtoolkit/jwt/WWidgetVectorPainter.java @@ -56,7 +56,7 @@ public void updateContents(final List result, WPaintDevice device) { if (this.widget_.repaintFlags_.contains(PaintFlag.Update)) { DomElement painter = DomElement.updateGiven( - "Wt4_11_0.getElement('p" + this.widget_.getId() + "').firstChild", + "Wt4_11_1.getElement('p" + this.widget_.getId() + "').firstChild", DomElementType.DIV); painter.setProperty(Property.AddedInnerHTML, vectorDevice.getRendered()); WApplication app = WApplication.getInstance(); diff --git a/src/eu/webtoolkit/jwt/WebRenderer.java b/src/eu/webtoolkit/jwt/WebRenderer.java index aeebb82f..a9401c23 100644 --- a/src/eu/webtoolkit/jwt/WebRenderer.java +++ b/src/eu/webtoolkit/jwt/WebRenderer.java @@ -508,7 +508,7 @@ private void serveMainscript(final WebResponse response) throws IOException { "SHOW_ERROR", conf.getErrorReporting() == Configuration.ErrorReporting.ErrorMessage); script.setCondition("UGLY_INTERNAL_PATHS", this.session_.isUseUglyInternalPaths()); script.setCondition("DYNAMIC_JS", false); - script.setVar("WT_CLASS", "Wt4_11_0"); + script.setVar("WT_CLASS", "Wt4_11_1"); script.setVar("APP_CLASS", app.getJavaScriptClass()); script.setCondition("STRICTLY_SERIALIZED_EVENTS", conf.serializedEvents()); script.setCondition("WEB_SOCKETS", conf.webSockets()); @@ -569,18 +569,18 @@ private void serveMainscript(final WebResponse response) throws IOException { boolean enabledAjax = app.enableAjax_; if (app.enableAjax_) { this.collectedJS1_ - .append("var form = Wt4_11_0.getElement('Wt-form'); if (form) {") + .append("var form = Wt4_11_1.getElement('Wt-form'); if (form) {") .append(this.beforeLoadJS_.toString()); this.beforeLoadJS_.setLength(0); this.collectedJS1_ .append("var domRoot=") .append(app.domRoot_.getJsRef()) .append(';') - .append("Wt4_11_0.progressed(domRoot);"); + .append("Wt4_11_1.progressed(domRoot);"); int librariesLoaded = this.loadScriptLibraries(this.collectedJS1_, app); app.streamBeforeLoadJavaScript(this.collectedJS1_, false); this.collectedJS2_ - .append("Wt4_11_0.resolveRelativeAnchors();") + .append("Wt4_11_1.resolveRelativeAnchors();") .append("domRoot.style.visibility = 'visible';") .append(app.getJavaScriptClass()) .append("._p_.doAutoJavaScript();"); @@ -633,7 +633,7 @@ private void serveMainscript(final WebResponse response) throws IOException { .append("}, 400);") .append("else "); } - out.append("Wt4_11_0.ready(function() { ") + out.append("Wt4_11_1.ready(function() { ") .append(app.getJavaScriptClass()) .append("._p_.load(true);});\n"); } @@ -919,7 +919,7 @@ private void serveMainAjax(final StringBuilder out) { if (widgetset) { String historyE = app.getEnvironment().getParameter("Wt-history"); if (historyE != null) { - out.append("Wt4_11_0") + out.append("Wt4_11_1") .append(".history.initialize('") .append(historyE.charAt(0)) .append("-field', '") @@ -937,7 +937,7 @@ private void serveMainAjax(final StringBuilder out) { out.append("};\n"); } this.renderSetServerPush(out); - out.append("Wt4_11_0.ready(function() { ") + out.append("Wt4_11_1.ready(function() { ") .append(app.getJavaScriptClass()) .append("._p_.load(") .append(!widgetset) @@ -1169,7 +1169,7 @@ private void collectJavaScriptUpdate(final StringBuilder out) { private void loadStyleSheet( final StringBuilder out, WApplication app, final WLinkedCssStyleSheet sheet) { - out.append("Wt4_11_0") + out.append("Wt4_11_1") .append(".addStyleSheet('") .append(sheet.getLink().resolveUrl(app)) .append("', '") @@ -1188,7 +1188,7 @@ private void loadStyleSheets(final StringBuilder out, WApplication app) { private void removeStyleSheets(final StringBuilder out, WApplication app) { for (int i = (int) app.styleSheetsToRemove_.size() - 1; i > -1; --i) { - out.append("Wt4_11_0") + out.append("Wt4_11_1") .append(".removeStyleSheet('") .append(app.styleSheetsToRemove_.get(i).getLink().resolveUrl(app)) .append("');\n "); diff --git a/src/eu/webtoolkit/jwt/WebSession.java b/src/eu/webtoolkit/jwt/WebSession.java index 2182aa80..0ffd54f4 100644 --- a/src/eu/webtoolkit/jwt/WebSession.java +++ b/src/eu/webtoolkit/jwt/WebSession.java @@ -1705,7 +1705,7 @@ public void setLoaded() { this.setState(WebSession.State.Loaded, this.controller_.getConfiguration().getSessionTimeout()); if (wasSuspended) { if (this.env_.hasAjax() && this.controller_.getConfiguration().reloadIsNewSession()) { - this.app_.doJavaScript("Wt4_11_0.history.removeSessionId()"); + this.app_.doJavaScript("Wt4_11_1.history.removeSessionId()"); this.sessionIdInUrl_ = false; } this.app_.unsuspended().trigger(); @@ -2101,7 +2101,7 @@ private void notifySignal(final WEvent e) throws IOException { String hashE = request.getParameter(se + "_"); if (hashE != null) { this.changeInternalPath(hashE, handler.getResponse()); - this.app_.doJavaScript("Wt4_11_0.scrollHistory();"); + this.app_.doJavaScript("Wt4_11_1.scrollHistory();"); } else { this.changeInternalPath("", handler.getResponse()); } diff --git a/src/eu/webtoolkit/jwt/auth/AuthThrottle.java b/src/eu/webtoolkit/jwt/auth/AuthThrottle.java index 87b76af2..492f8b7e 100644 --- a/src/eu/webtoolkit/jwt/auth/AuthThrottle.java +++ b/src/eu/webtoolkit/jwt/auth/AuthThrottle.java @@ -153,7 +153,7 @@ public void initializeThrottlingMessage(WInteractWidget button) { app.loadJavaScript("js/AuthThrottle.js", wtjs1()); button.setJavaScriptMember( " AuthThrottle", - "new Wt4_11_0.AuthThrottle(Wt4_11_0," + "new Wt4_11_1.AuthThrottle(Wt4_11_1," + button.getJsRef() + "," + WString.toWString(WString.tr("Wt.Auth.throttle-retry")).getJsStringLiteral() diff --git a/src/eu/webtoolkit/jwt/auth/OAuthProcess.java b/src/eu/webtoolkit/jwt/auth/OAuthProcess.java index 38e643ad..03d951cf 100644 --- a/src/eu/webtoolkit/jwt/auth/OAuthProcess.java +++ b/src/eu/webtoolkit/jwt/auth/OAuthProcess.java @@ -138,7 +138,7 @@ public void connectStartAuthenticate(final AbstractEventSignal s) { && this.service_.isPopupEnabled()) { StringBuilder js = new StringBuilder(); js.append("function(object, event) {") - .append("Wt4_11_0.PopupWindow(Wt4_11_0") + .append("Wt4_11_1.PopupWindow(Wt4_11_1") .append(",") .append(WWebWidget.jsStringLiteral(this.getAuthorizeUrl())) .append(", ") diff --git a/src/eu/webtoolkit/jwt/auth/RegistrationModel.java b/src/eu/webtoolkit/jwt/auth/RegistrationModel.java index 81e2c0b2..df3766bd 100644 --- a/src/eu/webtoolkit/jwt/auth/RegistrationModel.java +++ b/src/eu/webtoolkit/jwt/auth/RegistrationModel.java @@ -517,9 +517,9 @@ public static void validatePasswordsMatchJS( + info2.getJsRef() + ",o1=" + password.getJsRef() - + ";if (!o1.classList.contains('Wt-invalid')) {if (o.value == o1.value) {o.classList.remove('Wt-invalid');Wt4_11_0.setHtml(i," + + ";if (!o1.classList.contains('Wt-invalid')) {if (o.value == o1.value) {o.classList.remove('Wt-invalid');Wt4_11_1.setHtml(i," + WString.toWString(WString.tr("Wt.Auth.valid")).getJsStringLiteral() - + ");} else {o.classList.remove('Wt-valid');Wt4_11_0.setHtml(i," + + ");} else {o.classList.remove('Wt-valid');Wt4_11_1.setHtml(i," + WString.toWString(WString.tr("Wt.Auth.repeat-password-info")).getJsStringLiteral() + ");}}}"); } diff --git a/src/eu/webtoolkit/jwt/chart/WAxisSliderWidget.java b/src/eu/webtoolkit/jwt/chart/WAxisSliderWidget.java index 342ec8ff..c53c53b4 100644 --- a/src/eu/webtoolkit/jwt/chart/WAxisSliderWidget.java +++ b/src/eu/webtoolkit/jwt/chart/WAxisSliderWidget.java @@ -637,7 +637,7 @@ protected void paintEvent(WPaintDevice paintDevice) { if (this.getMethod() == RenderMethod.HtmlCanvas) { WApplication app = WApplication.getInstance(); StringBuilder ss = new StringBuilder(); - ss.append("new Wt4_11_0.WAxisSliderWidget(") + ss.append("new Wt4_11_1.WAxisSliderWidget(") .append(app.getJavaScriptClass()) .append(",") .append(this.getJsRef()) diff --git a/src/eu/webtoolkit/jwt/chart/WCartesianChart.java b/src/eu/webtoolkit/jwt/chart/WCartesianChart.java index 06ad8ab3..9b38f01b 100644 --- a/src/eu/webtoolkit/jwt/chart/WCartesianChart.java +++ b/src/eu/webtoolkit/jwt/chart/WCartesianChart.java @@ -3081,7 +3081,7 @@ protected void paintEvent(WPaintDevice paintDevice) { int selectedCurve = this.selectedSeries_ != null ? this.getSeriesIndexOf(this.selectedSeries_) : -1; int followCurve = this.followCurve_ != null ? this.getSeriesIndexOf(this.followCurve_) : -1; - ss.append("new Wt4_11_0.WCartesianChart(") + ss.append("new Wt4_11_1.WCartesianChart(") .append(app.getJavaScriptClass()) .append(",") .append(this.getJsRef()) @@ -5870,8 +5870,8 @@ private void defineJavaScript() { if (app != null && (this.isInteractive() || this.hasDeferredToolTips_)) { app.loadJavaScript("js/ChartCommon.js", wtjs2()); app.doJavaScript( - "if (!Wt4_11_0.chartCommon) {Wt4_11_0.chartCommon = new " - + "Wt4_11_0.ChartCommon(" + "if (!Wt4_11_1.chartCommon) {Wt4_11_1.chartCommon = new " + + "Wt4_11_1.ChartCommon(" + app.getJavaScriptClass() + "); }", false); diff --git a/src/eu/webtoolkit/jwt/skeletons/Wt.js b/src/eu/webtoolkit/jwt/skeletons/Wt.js index 817742e0..40788590 100644 --- a/src/eu/webtoolkit/jwt/skeletons/Wt.js +++ b/src/eu/webtoolkit/jwt/skeletons/Wt.js @@ -2244,8 +2244,10 @@ if (!window._$_WT_CLASS_$_) { this.maxZIndex = function() { let maxz = 0; + let tempMax = 0; document.querySelectorAll(".Wt-dialog, .modal, .modal-dialog").forEach(function(elem) { - maxz = Math.max(maxz, WT.css(elem, "z-index")); + tempMax = Math.max(maxz, WT.css(elem, "z-index")); + maxz = isNaN(tempMax) ? maxz : tempMax; }); return maxz; @@ -3559,9 +3561,17 @@ window._$_APP_CLASS_$_ = new (function() { } const eventsData = encodePendingEvents(maxEventsSize); - tm = eventsData.feedback ? - setTimeout(useWebSockets ? wsWaitFeedback : waitFeedback, _$_INDICATOR_TIMEOUT_$_) : - null; + + if (eventsData.feedback && _$_INDICATOR_TIMEOUT_$_ === 0) { + if (!useWebSockets) { + waitFeedback(); + } + tm = Date.now(); // we need a unique id for when we use websocket + } else { + tm = eventsData.feedback ? + setTimeout(useWebSockets ? wsWaitFeedback : waitFeedback, _$_INDICATOR_TIMEOUT_$_) : + null; + } data += eventsData.result; poll = false; } else { @@ -3579,6 +3589,10 @@ window._$_APP_CLASS_$_ = new (function() { pendingWsRequests[wsRqId] = { time: Date.now(), tm: tm }; ++nextWsRqId; data += "&wsRqId=" + wsRqId; + + if (_$_INDICATOR_TIMEOUT_$_ === 0) { + wsWaitFeedback(); + } } websocket.socket.send(data); diff --git a/src/eu/webtoolkit/jwt/skeletons/Wt.min.js b/src/eu/webtoolkit/jwt/skeletons/Wt.min.js index 0f8b43f4..6a82a5b4 100644 --- a/src/eu/webtoolkit/jwt/skeletons/Wt.min.js +++ b/src/eu/webtoolkit/jwt/skeletons/Wt.min.js @@ -3,7 +3,7 @@ * * For terms of use, see LICENSE. */ -_$_$if_DYNAMIC_JS_$_();window.JavaScriptFunction=1;window.JavaScriptConstructor=2;window.JavaScriptObject=3;window.JavaScriptPrototype=4;window.WT_DECLARE_WT_MEMBER=function(e,t,n,o){if(t===JavaScriptPrototype){const e=n.indexOf(".prototype");_$_WT_CLASS_$_[n.substring(0,e)].prototype[n.substring(e+".prototype.".length)]=o}else t===JavaScriptFunction?_$_WT_CLASS_$_[n]=function(){return o.apply(_$_WT_CLASS_$_,arguments)}:_$_WT_CLASS_$_[n]=o};window.WT_DECLARE_WT_MEMBER_BIG=window.WT_DECLARE_WT_MEMBER;window.WT_DECLARE_APP_MEMBER=function(e,t,n,o){const i=window.currentApp;if(t===JavaScriptPrototype){const e=n.indexOf(".prototype");i[n.substring(0,e)].prototype[n.substring(e+".prototype.".length)]=o}else t===JavaScriptFunction?i[n]=function(){return o.apply(i,arguments)}:i[n]=o};_$_$endif_$_();_$_$ifnot_DYNAMIC_JS_$_();window.JavaScriptConstructor=2;window.WT_DECLARE_WT_MEMBER_BIG=function(e,t,n,o){return o};_$_$endif_$_();window._$_WT_CLASS_$_||(window._$_WT_CLASS_$_=new function(){const e=this,t="undefined";this.ready=function(e){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()};this.isEmptyObject=function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0};this.condCall=function(e,t,n){e[t]&&e[t](n)};this.buttons=0;let n=0,o=0;this.button=function(e){try{const t=e.type;if("mouseup"!==t&&"mousedown"!==t&&"click"!==t&&"dblclick"!==t)return 0}catch(e){return 0}return 0===e.button?1:1===e.button?2:2===e.button?4:0};this.mouseDown=function(t){e.buttons|=e.button(t)};this.mouseUp=function(t){n=e.button(t);e.buttons&=~n;setTimeout((function(){o=0}),5)};this.dragged=function(e){return o>2};this.drag=function(e){++o}; +_$_$if_DYNAMIC_JS_$_();window.JavaScriptFunction=1;window.JavaScriptConstructor=2;window.JavaScriptObject=3;window.JavaScriptPrototype=4;window.WT_DECLARE_WT_MEMBER=function(e,t,n,o){if(t===JavaScriptPrototype){const e=n.indexOf(".prototype");_$_WT_CLASS_$_[n.substring(0,e)].prototype[n.substring(e+11)]=o}else t===JavaScriptFunction?_$_WT_CLASS_$_[n]=function(){return o.apply(_$_WT_CLASS_$_,arguments)}:_$_WT_CLASS_$_[n]=o};window.WT_DECLARE_WT_MEMBER_BIG=window.WT_DECLARE_WT_MEMBER;window.WT_DECLARE_APP_MEMBER=function(e,t,n,o){const i=window.currentApp;if(t===JavaScriptPrototype){const e=n.indexOf(".prototype");i[n.substring(0,e)].prototype[n.substring(e+11)]=o}else t===JavaScriptFunction?i[n]=function(){return o.apply(i,arguments)}:i[n]=o};_$_$endif_$_();_$_$ifnot_DYNAMIC_JS_$_();window.JavaScriptConstructor=2;window.WT_DECLARE_WT_MEMBER_BIG=function(e,t,n,o){return o};_$_$endif_$_();window._$_WT_CLASS_$_||(window._$_WT_CLASS_$_=new function(){const e=this,t="undefined";this.ready=function(e){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()};this.isEmptyObject=function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0};this.condCall=function(e,t,n){e[t]&&e[t](n)};this.buttons=0;let n=0,o=0;this.button=function(e){try{const t=e.type;if("mouseup"!==t&&"mousedown"!==t&&"click"!==t&&"dblclick"!==t)return 0}catch(e){return 0}return 0===e.button?1:1===e.button?2:2===e.button?4:0};this.mouseDown=function(t){e.buttons|=e.button(t)};this.mouseUp=function(t){n=e.button(t);e.buttons&=~n;setTimeout((function(){o=0}),5)};this.dragged=function(e){return o>2};this.drag=function(e){++o}; /** * @preserve Includes Array Remove - By John Resig (MIT Licensed) */this.arrayRemove=function(e,t,n){const o=e.slice((n||t)+1||e.length);e.length=t<0?e.length+t:t;return e.push.apply(e,o)};this.addAll=function(e,t){for(let n=0,o=t.length;n0&&(d=setTimeout((function(){if(!u&&o){c.onreadystatechange=new Function;c=null;u=!0;n(e.ResponseStatus.Timeout,null,s)}}),l));c.onreadystatechange=function(){4===c.readyState&&p()};try{c.onload=p;c.onerror=function(){f(e.ResponseStatus.Error)}}catch(e){}c.send(t)}this.responseReceived=function(e){};this.sendUpdate=function(e,t,n,i,r){return o?new s(e,t,n,i,r):null};this.cancel=function(){o=null};this.setUrl=function(e){o=e}}:new function(){let o=t,i=null;function s(t,i,s,r){this.userData=i;const l=this.script=document.createElement("script");l.id="script"+s;l.setAttribute("src",o+"&"+t);l.onerror=function(){n(e.ResponseStatus.Error,null,i);l.parentNode.removeChild(l)};document.getElementsByTagName("head")[0].appendChild(l);this.abort=function(){l.parentNode.removeChild(l)}}this.responseReceived=function(t){if(null!==i){const t=i;i.script.parentNode.removeChild(i.script);i=null;n(e.ResponseStatus.OK,"",t.userData)}};this.sendUpdate=function(e,t,n,r,l){if(!o)return null;i=new s(e,t,n,r);return i};this.cancel=function(){o=null};this.setUrl=function(e){o=e}}};this.setHtml=function(t,n,o){function i(e,t){let n,o,s;switch(e.nodeType){case 1:n=null===e.namespaceURI?document.createElement(e.nodeName):document.createElementNS(e.namespaceURI,e.nodeName);if(e.attributes&&e.attributes.length>0)for(o=0,s=e.attributes.length;o0)for(o=0,s=e.childNodes.length;o"+n+"","application/xhtml+xml");s=r.documentElement;1!==s.nodeType&&(s=s.nextSibling);if(!o){e.saveReparented(t);t.innerHTML=""}for(let e=0,n=s.childNodes.length;e0)for(let t=0,o=e.attributes.length;t=8&&(e.className=t.className.substring(8));const n=t.getAttribute("style");n&&e.setAttribute("style",n);t.parentNode.replaceChild(e,t)}};this.navigateInternalPath=function(t,n){const o=t||window.event;if(!o.ctrlKey&&!o.metaKey&&e.button(o)<=1){e.history.navigate(n,!0);e.cancelEvent(o,e.CancelDefaultAction)}};this.ajaxInternalPaths=function(t){document.querySelectorAll(".Wt-ip").forEach((function(n){let o,i=n.getAttribute("href"),s=i.lastIndexOf("?wtd");-1===s&&(s=i.lastIndexOf("&wtd"));-1!==s&&(i=i.substring(0,s));if(-1!==i.indexOf("://")){const e=document.createElement("div");e.innerHTML='x';const n=e.firstChild.href;o=i.substring(n.length-1)}else{for(;i.startsWith("../");)i=i.substring(3);"/"!==i.charAt(0)&&(i="/"+i);o=i.substring(t.length);o.startsWith("_=")&&"?"===t.charAt(t.length-1)&&(o="?"+o)}0!==o.length&&"/"===o.charAt(0)||(o="/"+o);o.startsWith("/?_=")&&(o=o.substring(4));n.setAttribute("href",i);n.setAttribute("href",n.href);n.onclick=function(t){e.navigateInternalPath(t,o)};n.classList.remove("Wt-ip")}))};this.resolveRelativeAnchors=function(){document.querySelectorAll(".Wt-rr").forEach((function(e){e.href&&e.setAttribute("href",e.href);e.src&&e.setAttribute("src",e.src);e.classList.remove("Wt-rr")}))};let r=!1;this.CancelPropagate=1;this.CancelDefaultAction=2;this.CancelAll=3;this.cancelEvent=function(n,o){if(r)return;const i=typeof o===t?e.CancelAll:o;i&e.CancelDefaultAction&&(n.preventDefault?n.preventDefault():n.returnValue=!1);i&e.CancelPropagate&&(n.stopPropagation?n.stopPropagation():n.cancelBubble=!0)};this.getElement=function(e){let t=document.getElementById(e);if(!t)for(let n=0;ns.length&&(o=s.length);oo&&(n=o);e.focus();if(i)for(let e=0;e=n&&e>=o);++e)if(l(s.charCodeAt(e))&&e+10||(13===e.keyCode||27===e.keyCode||32===e.keyCode||e.keyCode>46&&e.keyCode<112)};let c=null,d=null;this.isDblClick=function(e,t){if(e.wtClickTimeout&&Math.abs(e.wtE1.clientX-t.clientX)<3&&Math.abs(e.wtE1.clientY-t.clientY)<3){clearTimeout(e.wtClickTimeout);e.wtClickTimeout=null;e.wtE1=null;return!0}return!1};this.eventRepeat=function(t,n,o){e.stopRepeat();n=n||500;o=o||50;t();c=setTimeout((function(){c=null;t();d=setInterval(t,o)}),n)};this.stopRepeat=function(){if(c){clearTimeout(c);c=null}if(d){clearInterval(d);d=null}};let u=null,f=null;this.css=function(e,t){if(e.style[t])return e.style[t];if(e!==u){u=e;f=window.getComputedStyle?window.getComputedStyle(e,null):e.currentStyle?e.currentStyle:null}return f?f[t]:null};function p(e,t,n){if("auto"===e||null===e)return n;const o=t.exec(e),i=o&&2===o.length?o[1]:null;return i?parseFloat(i):n}this.parsePx=function(e){return p(e,/^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/i,0)};this.parsePct=function(e,t){return p(e,/^\s*(-?\d+(?:\.\d+)?)\s*%\s*$/i,t)};this.px=function(t,n){return e.parsePx(e.css(t,n))};this.pxself=function(t,n){return e.parsePx(t.style[n])};this.pctself=function(t,n){return e.parsePct(t.style[n],0)};this.styleAttribute=function(e){function t(e){let t=e.search(/-./);for(;-1!==t;){const n=e.charAt(t+1).toUpperCase();t=(e=e.replace(/-./,n)).search(/-./)}return e}const n=["","-moz-","-webkit-","-o-","-ms-"],o=document.createElement("div");for(let i=0,s=n.length;io?o+1:""!==t.style.styleFloat?n-1:"auto"}return"auto"};this.hide=function(t){e.getElement(t).style.display="none"};this.inline=function(t){e.getElement(t).style.display="inline"};this.block=function(t){e.getElement(t).style.display="block"};this.show=function(t,n){e.getElement(t).style.display=n};let h=null;this.firedTarget=null;this.target=function(t){try{return e.firedTarget||t.target||t.srcElement}catch(e){return null}};function g(t){if(null===h)return null;t||(t=window.event);if(t){let n=e.target(t);for(;n&&n!==h;)n=n.parentNode;return n===h?null:h}return h}function m(t){const n=g(t);if(n&&!r){t||(t=window.event);r=!0;e.condCall(n,"onmousemove",t);r=!1;return!1}return!0}function y(t){const n=g(t);e.capture(null);if(n){t||(t=window.event);e.condCall(n,"onmouseup",t);e.cancelEvent(t,e.CancelPropagate);return!1}return!0}function b(t){const n=g(t);if(n&&!r){t||(t=window.event);r=!0;e.condCall(n,"ontouchmove",t);r=!1;return!1}return!0}function w(t){const n=g(t);e.capture(null);if(n){t||(t=window.event);e.condCall(n,"ontouchend",t);e.cancelEvent(t,e.CancelPropagate);return!1}return!0}let T=!1;function _(t){t.addEventListener("mousemove",m,!0);t.addEventListener("mouseup",y,!0);e.isGecko&&window.addEventListener("mouseout",(function(t){!t.relatedTarget&&e.hasTag(t.target,"HTML")&&y(t)}),!0)}function v(){if(T)return;T=!0;const e=document.body;_(e);!function(e){e.addEventListener("touchmove",b,!0);e.addEventListener("touchend",w,!0)}(e)}this.capture=function(e){v();if(h&&e)return;for(let e=0;e32768){o=document.createElement("style");n.parentNode.insertBefore(o,n);o.styleSheet.cssText=t}else o.styleSheet.cssText+=t}else{const e=document.createTextNode(t);n.appendChild(e)}};this.getCssRule=function(e,t){e=e.toLowerCase();if(document.styleSheets)for(let n=0;n0){const e=o[o.length-1];e.parentNode.insertBefore(n,e.nextSibling)}else document.body.appendChild(n)}};this.removeStyleSheet=function(e){document.querySelectorAll('link[rel=stylesheet][href~="'+e+'"]').forEach((function(e){e.remove()}));const t=document.styleSheets;for(let n=0;nf.x){n=p;a=0}else if(n+d>p+f.x){let o=g.scrollLeft;g===document.body&&(o=g.clientWidth-f.x);i=i-m.x+o;n=g.clientWidth-(i+e.px(t,"marginRight"));a=1}else{let o=g.scrollLeft;g===document.body&&(o=0);n=n-m.x+o;n-=e.px(t,"marginLeft");a=0}if(u>f.y){o=h;c=0}else if(o+u>h+f.y){s>h+f.y&&(s=h+f.y);let n=g.scrollTop;g===document.body&&(n=g.clientHeight-f.y);s=s-m.y+n;o=g.clientHeight-(s+e.px(t,"marginBottom")+e.px(t,"borderBottomWidth"));c=1}else{let n=g.scrollTop;g===document.body&&(n=0);o=(o=o-m.y+n)-e.px(t,"marginTop")+e.px(t,"borderTopWidth");c=0}t.style[r[a]]=n+"px";t.style[l[c]]=o+"px"};this.positionXY=function(t,n,o){const i=e.getElement(t);if(!e.isHidden(i)){i.style.display="block";e.fitToWindow(i,n,o,n,o)}};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(t,n,o,i){const s=e.getElement(t),r=e.getElement(n);i||(i=0);if(!r||!s)return;const l=e.widgetPageCoordinates(r);let a,c,d,u;s.style.position="absolute";"none"===e.css(s,"display")&&(s.style.display="block");if(o===e.Horizontal){a=l.x+r.offsetWidth;c=l.y+i;d=l.x;u=l.y+r.offsetHeight-i}else{a=l.x;c=l.y+r.offsetHeight;d=l.x+r.offsetWidth;u=l.y}let f,p=r;s.parentNode.removeChild(s);for(f=p.parentNode;!f.classList.contains("Wt-domRoot")&&!f.wtReparentBarrier&&!("inline"!==e.css(f,"display")&&f.clientHeight>100&&("scroll"===getComputedStyle(f).overflowY||"scroll"===getComputedStyle(f).overflowX||f.scrollHeight>f.clientHeight&&"auto"===getComputedStyle(f).overflowY||f.scrollWidth>f.clientWidth&&"auto"===getComputedStyle(f).overflowX));f=f.parentNode)p=f;const h=e.css(f,"position");"absolute"!==h&&"relative"!==h&&(f.style.position="relative");f.appendChild(s);s.classList.add("wt-reparented");e.fitToWindow(s,a,c,d,u);s.style.visibility=""};this.hasFocus=function(e){try{return e===document.activeElement}catch(e){return!1}};this.progressed=function(t){const n=document,o=n.body,i=this.getElement("Wt-form");t.style.display=i.style.display;i.parentNode.replaceChild(t,i);o.removeEventListener?o.removeEventListener("click",delayClick,!0):o.detachEvent("click",delayClick);setTimeout((function(){for(let t=0,o=delayedClicks.length;t1&&(e=e.substring(1));const n=e.split("&");e="";for(let o=0,i=n.length;o=1&&"/"===n[n.length-1]){_$_$if_UGLY_INTERNAL_PATHS_$_();o=!0;_$_$endif_$_();_$_$ifnot_UGLY_INTERNAL_PATHS_$_();n=n.substring(0,n.length-1);_$_$endif_$_()}},removeSessionId:function(){let e=r.location.pathname;const t=e.indexOf(";jsessionid=");-1!==t&&(e=e.substring(0,t));const n=e+a(r.location.search,"wtd");r.history.replaceState(null,null,n)},navigate:function(s,r){e.resolveRelativeAnchors();t=s;const l=s.replace(/%/g,"%25").replace(/\+/g,"%2b").replace(/ /g,"%20").replace(/&/g,"%26");let c=n;0!==l.length&&(c+=(o?"?_=":"")+l);if(o){let e=a(window.location.search,"_");if(e.length>1){e.length>2&&"?"===e[0]&&"&"===e[1]&&(e=e.substring(1));-1===c.indexOf("?")?c+="?"+e.substring(1):c+="&"+e.substring(1)}}else c+=window.location.search;try{const e={};e.state=s||"";e.title=document.title;S();window.history.pushState(e,document.title,c)}catch(e){console.log(e.toString())}r&&i(s)},getCurrentState:function(){return t}}}();this.maxZIndex=function(){let t=0;document.querySelectorAll(".Wt-dialog, .modal, .modal-dialog").forEach((function(n){t=Math.max(t,e.css(n,"z-index"))}));return t};this.ResponseStatus={OK:0,Error:1,Timeout:2}});if(window._$_APP_CLASS_$_&&window._$_APP_CLASS_$_._p_)try{window._$_APP_CLASS_$_._p_.quit(null)}catch(e){}window._$_APP_CLASS_$_=new function(){const self=this,WT=_$_WT_CLASS_$_,UNDEFINED="undefined";let downX=0,downY=0;const deployUrl=_$_DEPLOY_PATH_$_;function saveDownPos(e){const t=WT.pageCoordinates(e);downX=t.x;downY=t.y}let currentHash=null;function onHashChange(){const e=_$_WT_CLASS_$_.history.getCurrentState();if((!(null!==e&&e.length>0)||e.startsWith("/"))&¤tHash!==e){currentHash=e;setTimeout((function(){update(null,"hash",null,!0)}),1)}}function setHash(e,t){if(currentHash!==e&&(currentHash||"/"!==e)){t||(currentHash=e);WT.history.navigate(e,t)}}const dragState={object:null,sourceId:null,mimeType:null,dropOffsetX:null,dragOffsetY:null,dropTarget:null,objectPrevStyle:null,xy:null};let touchTimer;const touchduration=1e3;function touchStart(e,t){touchTimer=setTimeout((function(){dragStart(e,t)}),touchduration)}function touchEnded(){touchTimer&&clearTimeout(touchTimer)}function dragStart(e,t){if(t.touches&&"vibrate"in navigator){navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate;navigator.vibrate&&navigator.vibrate(100)}if((t.ctrlKey||WT.button(t)>1)&&!t.touches)return!0;const n=WT.target(t);if(n&&"inline"!==WT.css(n,"display")&&(n.offsetWidth>n.clientWidth||n.offsetHeight>n.clientHeight)){const e=WT.widgetPageCoordinates(n),o=WT.pageCoordinates(t),i=o.x-e.x,s=o.y-e.y;if(i>n.clientWidth||s>n.clientHeight)return!0}const o=dragState;o.object=WT.getElement(e.getAttribute("dwid"));if(null===o.object)return!0;o.sourceId=e.getAttribute("dsid");o.objectPrevStyle={position:o.object.style.position,display:o.object.style.display,left:o.object.style.left,top:o.object.style.top,className:o.object.className,parent:o.object.parentNode,zIndex:o.object.zIndex};o.object.parentNode.removeChild(o.object);o.object.style.position="absolute";o.object.className=o.objectPrevStyle.className+"";o.object.style.zIndex="200000";document.body.appendChild(o.object);WT.capture(null);WT.capture(o.object);o.object.onmousemove=dragDrag;o.object.onmouseup=dragEnd;document.addEventListener("mousedown",dragAbort);window.addEventListener("mouseup",dragAbort);document.addEventListener("touchstart",dragAbort);o.object.ontouchmove=dragDrag;o.object.ontouchend=dragEnd;o.offsetX=-4;o.offsetY=-4;o.dropTarget=null;o.mimeType=e.getAttribute("dmt");o.xy=WT.pageCoordinates(t);WT.cancelEvent(t,WT.CancelPropagate);return!1}function dragDrag(e){e=e||window.event;if(null!==dragState.object){const t=dragState,n=WT.pageCoordinates(e);""!==t.object.style.display&&t.xy.x!==n.x&&t.xy.y!==n.y&&(t.object.style.display="");t.object.style.left=n.x-t.offsetX+"px";t.object.style.top=n.y-t.offsetY+"px";const o=t.dropTarget;let i;if(e.changedTouches){t.object.style.display="none";i=document.elementFromPoint(e.changedTouches[0].clientX,e.changedTouches[0].clientY);t.object.style.display=""}else{i=WT.target(e);if(i===t.object&&document.elementFromPoint){t.object.style.display="none";i=document.elementFromPoint(e.clientX,e.clientY);t.object.style.display=""}}const s="{"+t.mimeType+":";let r=null;t.dropTarget=null;for(;i;){r=i.getAttribute("amts");if(null!==r&&-1!==r.indexOf(s)){t.dropTarget=i;break}i=i.parentNode;if(!i.tagName||WT.hasTag(i,"HTML"))break}if(t.dropTarget!==o){if(t.dropTarget){const e=r.indexOf(s)+s.length,n=r.indexOf("}",e),o=r.substring(e,n);if(0!==o.length){t.dropTarget.setAttribute("dos",t.dropTarget.className);t.dropTarget.className=t.dropTarget.className+" "+o}}else t.object.styleClass="";if(null!==o){o.handleDragDrop&&o.handleDragDrop("end",t.object,e,"",s);const n=o.getAttribute("dos");null!==n&&(o.className=n)}}t.dropTarget?t.dropTarget.handleDragDrop?t.dropTarget.handleDragDrop("drag",t.object,e,"",s):t.object.className=t.objectPrevStyle.className+" Wt-valid-drop":t.object.className=t.objectPrevStyle.className+"";return!1}return!0}function dragAbort(){WT.capture(null);const e=dragState;if(e.object){document.body.removeChild(e.object);e.objectPrevStyle.parent.appendChild(e.object);e.object.style.zIndex=e.objectPrevStyle.zIndex;e.object.style.position=e.objectPrevStyle.position;e.object.style.display=e.objectPrevStyle.display;e.object.style.left=e.objectPrevStyle.left;e.object.style.top=e.objectPrevStyle.top;e.object.className=e.objectPrevStyle.className;e.object=null;touchTimer&&clearTimeout(touchTimer)}if(document.removeEventListener){document.removeEventListener("mousedown",dragAbort);window.removeEventListener("mouseup",dragAbort);document.removeEventListener("touchstart",dragAbort)}else{document.detachEvent("onmousedown",dragAbort);window.detachEvent("onmouseup",dragAbort)}}function dragEnd(e){e=e||window.event;WT.capture(null);const t=dragState;if(t.object){if(t.dropTarget){const n=t.dropTarget.getAttribute("dos");null!==n&&(t.dropTarget.className=n);t.dropTarget.handleDragDrop?t.dropTarget.handleDragDrop("drop",t.object,e,t.sourceId,t.mimeType):e.touches?emit(t.dropTarget,{name:"_drop2",eventObject:t.dropTarget,event:e},t.sourceId,t.mimeType):emit(t.dropTarget,{name:"_drop",eventObject:t.dropTarget,event:e},t.sourceId,t.mimeType)}dragAbort()}}function encodeTouches(e,t){let n="";for(let o=0,i=e.length;o0?"&e"+i:"&";let s=t+pendingEvents[i].data.join(t);pendingEvents[i].evAckId=_$_INDICATOR_TIMEOUT_$_){null===currentHideLoadingIndicator&&waitFeedback();return}const o=parseInt(n,10);o>t&&(t=o)}nextWsRqId=t+1;document.body.style.cursor="auto";if(null!==currentHideLoadingIndicator){try{currentHideLoadingIndicator()}catch(e){}currentHideLoadingIndicator=null}}const WebSocketUnknown=0,WebSocketConnecting=1,WebSocketAckConnect=2,WebSocketWorking=3,WebSocketUnavailable=4,websocket={state:WebSocketUnknown,socket:null,keepAlive:null,reconnectTries:0};let connectionMonitor=null;function setServerPush(e){serverPush=e}function doAutoJavaScript(){self._p_.autoJavaScript()}function doJavaScript(e){if(e){e="(function() {"+e+"})();";window.execScript?window.execScript(e):window.eval(e)}self===window._$_APP_CLASS_$_&&doAutoJavaScript()}function webSocketAckConnect(){nextWsRqId=0;pendingWsRequests={};websocket.socket.send("&signal=none&connected="+ackUpdateId);websocket.state=WebSocketWorking}function handleResponse(e,t,n){connectionMonitor&&connectionMonitor.onStatusChange("connectionStatus",e===WT.ResponseStatus.OK?1:0);if(!hasQuit)if(waitingForJavaScript)setTimeout((function(){handleResponse(e,t,n)}),50);else{if(pollTimer){clearTimeout(pollTimer);pollTimer=null}if(e===WT.ResponseStatus.OK){WT.resolveRelativeAnchors();_$_$if_CATCH_ERROR_$_();try{_$_$endif_$_();doJavaScript(t);_$_$if_CATCH_ERROR_$_()}catch(e){const n=e.stack||e.stacktrace,o=e.description||e.message,i={exception_code:e.code,exception_description:o,exception_js:t};i.stack=n;sendError(i,"Wt internal error; code: "+e.code+", description: "+o);throw e}_$_$endif_$_();n&&cancelFeedback(n)}else pendingEvents=sentEvents.concat(pendingEvents);sentEvents=[];responsePending=null;e===WT.ResponseStatus.OK?commErrors=0:e===WT.ResponseStatus.Error&&++commErrors;if(!hasQuit){websocket.state===WebSocketAckConnect&&webSocketAckConnect();if(serverPush&&!waitingForJavaScript||pendingEvents.length>0)if(e===WT.ResponseStatus.Error){const e=Math.min(12e4,500*Math.exp(commErrors));updateTimeout=setTimeout((function(){sendUpdate()}),e)}else null===updateTimeout&&sendUpdate()}}}function setSessionUrl(e){sessionUrl=-1!==e.indexOf("://")||"/"===e[0]?e:deployUrl+e;comm&&comm.setUrl(e)}setSessionUrl(_$_SESSION_URL_$_);comm=WT.initAjaxComm(sessionUrl,handleResponse);function doPollTimeout(){responsePending.abort();responsePending=null;pollTimer=null;hasQuit||sendUpdate()}function setConnectionMonitor(e){connectionMonitor=e;connectionMonitor.status={};connectionMonitor.status.connectionStatus=0;connectionMonitor.status.websocket=!1;connectionMonitor.onStatusChange=function(e,t){const n=connectionMonitor.status[e];if(n!==t){connectionMonitor.status[e]=t;connectionMonitor.onChange(e,n,t)}}}let updating=!1,updateTimeoutStart;function update(e,t,n,o){checkEventOverflow();if(!updating){updating=!0;WT.checkReleaseCapture(e,n);_$_$if_STRICTLY_SERIALIZED_EVENTS_$_();if(!responsePending){_$_$endif_$_();const i={},s=pendingEvents.length;i.object=e;i.signal=t;i.event=window.fakeEvent||n;i.feedback=o;i.evAckId=ackUpdateId;pendingEvents[s]=encodeEvent(i);scheduleUpdate();doJavaScript();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_();updating=!1}}function schedulePing(){websocket.keepAlive&&clearInterval(websocket.keepAlive);websocket.keepAlive=setInterval((function(){const e=websocket.socket;if(1===e.readyState)e.send("&signal=ping");else{clearInterval(websocket.keepAlive);websocket.keepAlive=null}}),_$_SERVER_PUSH_TIMEOUT_$_)}function scheduleUpdate(){if(hasQuit){if(!quitStr)return;if(confirm(quitStr)){document.location=document.location;quitStr=null;return}quitStr=null}else{_$_$if_WEB_SOCKETS_$_();if(websocket.state!==WebSocketUnavailable)if(typeof window.WebSocket===UNDEFINED)websocket.state=WebSocketUnavailable;else{let t=websocket.socket;if(null===t||t.readyState>1)if(null!==t&&websocket.state===WebSocketUnknown)websocket.state=WebSocketUnavailable;else{function e(){if(!hasQuit){++websocket.reconnectTries;const e=Math.min(12e4,500*Math.exp(websocket.reconnectTries));setTimeout((function(){scheduleUpdate()}),e)}}let n;if(-1!==sessionUrl.indexOf("://"))n="ws"+sessionUrl.substring(4);else{const i=sessionUrl.substring(sessionUrl.indexOf("?"));n="ws"+location.protocol.substring(4)+"//"+location.host+_$_WS_PATH_$_+i}n+="&request=ws";const o=_$_WS_ID_$_;o.length>0&&(n+="&wsid="+o);websocket.socket=t=new WebSocket(n);websocket.state=WebSocketConnecting;websocket.keepAlive&&clearInterval(websocket.keepAlive);websocket.keepAlive=null;t.onmessage=function(e){let t=null;if(websocket.state===WebSocketConnecting){if("connect"!==e.data){console.log("WebSocket: was expecting a connect?");console.log(e.data);return}if(null!==responsePending&&null!==pollTimer){clearTimeout(pollTimer);pollTimer=null;responsePending.abort();responsePending=null}responsePending||!WT.isEmptyObject(pendingWsRequests)?websocket.state=WebSocketAckConnect:webSocketAckConnect()}else{if(connectionMonitor){connectionMonitor.onStatusChange("websocket",!0);connectionMonitor.onStatusChange("connectionStatus",1)}websocket.state=WebSocketWorking;t=e.data}websocket.reconnectTries=0;null!==t&&handleResponse(WT.ResponseStatus.OK,t,null)};t.onerror=function(t){connectionMonitor&&connectionMonitor.onStatusChange("websocket",!1);3===websocket.reconnectTries&&websocket.state===WebSocketUnknown&&(websocket.state=WebSocketUnavailable);e()};t.onclose=function(t){connectionMonitor&&connectionMonitor.onStatusChange("websocket",!1);3===websocket.reconnectTries&&websocket.state===WebSocketUnknown&&(websocket.state=WebSocketUnavailable);e()};t.onopen=function(e){if(connectionMonitor){connectionMonitor.onStatusChange("websocket",!0);connectionMonitor.onStatusChange("connectionStatus",1)}schedulePing()}}if(1===t.readyState&&t.state===WebSocketWorking){schedulePing();sendUpdate();return}}_$_$endif_$_();if(null!==responsePending&&null!==pollTimer){clearTimeout(pollTimer);pollTimer=null;responsePending.abort();responsePending=null}if(null===responsePending)if(null===updateTimeout){updateTimeout=setTimeout((function(){sendUpdate()}),WT.updateDelay);updateTimeoutStart=(new Date).getTime()}else if(commErrors){clearTimeout(updateTimeout);updateTimeout=null;sendUpdate()}else{if((new Date).getTime()-updateTimeoutStart>WT.updateDelay){clearTimeout(updateTimeout);updateTimeout=null;sendUpdate()}}}}let ackUpdateId=_$_ACK_UPDATE_ID_$_,ackPuzzle=null;function responseReceived(e,t){ackPuzzle=t;ackUpdateId=e;comm.responseReceived(e)}function wsRqsDone(){for(let e=0;e0&&(n+="&Wt-params="+encodeURIComponent(i));if(pendingEvents.length>0){let i=_$_MAX_FORMDATA_SIZE_$_-n.length;o&&(i-=("&wsRqId="+nextWsRqId).length);const s=encodePendingEvents(i);e=s.feedback?setTimeout(o?wsWaitFeedback:waitFeedback,_$_INDICATOR_TIMEOUT_$_):null;n+=s.result;t=!1}else{n+="&signal=poll";e=null;t=!0}if(o){responsePending=null;if(!t){if(e){const t=nextWsRqId;pendingWsRequests[t]={time:Date.now(),tm:e};++nextWsRqId;n+="&wsRqId="+t}websocket.socket.send(n)}}else{if(responsePending)try{throw new Error("responsePending is true before comm.sendUpdate")}catch(e){const t=e.stack||e.stacktrace,n=e.description||e.message,o={exception_description:n};o.stack=t;sendError(o,"Wt internal error; description: "+n);throw e}pollTimer=t?setTimeout(doPollTimeout,_$_SERVER_PUSH_TIMEOUT_$_):null;responsePending=1;responsePending=comm.sendUpdate("request=jsupdate"+n,e,ackUpdateId,-1,t)}}function propagateSize(e,t,n){-1===t&&(t=e.offsetWidth);-1===n&&(n=e.offsetHeight);if(typeof e.wtWidth===UNDEFINED||e.wtWidth!==t||typeof e.wtHeight===UNDEFINED||e.wtHeight!==n){e.wtWidth=t;e.wtHeight=n;t>=0&&n>=0&&emit(e,"resized",Math.round(t),Math.round(n))}}function emit(e,t){checkEventOverflow();const n={},o=pendingEvents.length;n.signal="user";n.id="string"==typeof e?e:e===self?"app":e.id;if("object"==typeof t){n.name=t.name;n.object=t.eventObject;n.event=t.event}else{n.name=t;n.object=n.event=null}n.args=[];for(let e=2;e0&&pendingEvents.length>=_$_MAX_PENDING_EVENTS_$_){const e="too many pending events";sendError(e,"Wt internal error; description: "+e);pendingEvents=[];throw new Error(e)}}function addTimerEvent(e,t,n){const o=function(){const t=WT.getElement(e);if(t){if(-1!==n)t.timer=setTimeout(t.tm,n);else{t.timer=null;t.tm=null}t.onclick&&t.onclick()}},i=WT.getElement(e);i.timer&&clearTimeout(i.timer);i.timer=setTimeout(o,t);i.tm=o}const jsLibsLoaded={};let waitingForJavaScript=!1;function onJsLoad(e,t){setTimeout((function(){if(!0===jsLibsLoaded[e]){waitingForJavaScript=!1;t();!waitingForJavaScript&&serverPush&&sendUpdate()}else jsLibsLoaded[e]=t}),20);waitingForJavaScript=!0}function jsLoaded(e){if(!0!==jsLibsLoaded[e]){if(typeof jsLibsLoaded[e]!==UNDEFINED){waitingForJavaScript=!1;jsLibsLoaded[e]();!waitingForJavaScript&&serverPush&&sendUpdate()}jsLibsLoaded[e]=!0}}function loadScript(uri,symbol,tries){let loaded=!1,error=!1;function onerror(){if(!loaded&&!error){error=!0;const e=typeof tries===UNDEFINED?2:tries;if(e>1)loadScript(uri,symbol,e-1);else{const e={"error-description":"Fatal error: failed loading "+uri};sendError(e,e["error-description"]);quit(null)}}}function onload(){if(!loaded&&!error){loaded=!0;jsLoaded(uri)}}if(""!==symbol)try{loaded=!eval("typeof "+symbol+" === 'undefined'")}catch(e){loaded=!1}if(loaded)jsLoaded(uri);else{const e=document.createElement("script");e.setAttribute("src",uri);e.onload=onload;e.onerror=onerror;e.onreadystatechange=function(){const t=e.readyState;"loaded"===t?onerror():"complete"===t&&onload()};const t=document.getElementsByTagName("head")[0];t.appendChild(e)}}function ImagePreloader(e,t){this.callback=t;this.work=e.length;this.images=[];if(0===e.length)this.callback(this.images);else for(const t of e)this.preload(t)}ImagePreloader.prototype.preload=function(e){const t=new Image;this.images.push(t);t.onload=ImagePreloader.prototype.onload;t.onerror=ImagePreloader.prototype.onload;t.onabort=ImagePreloader.prototype.onload;t.imagePreloader=this;t.src=e};ImagePreloader.prototype.onload=function(){const e=this.imagePreloader;0==--e.work&&e.callback(e.images)};ImagePreloader.prototype.cancel=function(){const e=this.images;for(const t of e){t.onload=function(){};t.onerror=function(){};t.onabort=function(){}}this.callback=function(){}};function ArrayBufferPreloader(e,t){this.callback=t;this.work=e.length;this.arrayBuffers=[];if(0===e.length)t(this.arrayBuffers);else for(let t=0;ts.length&&(o=s.length);oo&&(n=o);e.focus();if(i)for(let e=0;e=n&&e>=o);++e)if(l(s.charCodeAt(e))&&e+10||(13===e.keyCode||27===e.keyCode||32===e.keyCode||e.keyCode>46&&e.keyCode<112)};let c=null,d=null;this.isDblClick=function(e,t){if(e.wtClickTimeout&&Math.abs(e.wtE1.clientX-t.clientX)<3&&Math.abs(e.wtE1.clientY-t.clientY)<3){clearTimeout(e.wtClickTimeout);e.wtClickTimeout=null;e.wtE1=null;return!0}return!1};this.eventRepeat=function(t,n,o){e.stopRepeat();n=n||500;o=o||50;t();c=setTimeout((function(){c=null;t();d=setInterval(t,o)}),n)};this.stopRepeat=function(){if(c){clearTimeout(c);c=null}if(d){clearInterval(d);d=null}};let u=null,f=null;this.css=function(e,t){if(e.style[t])return e.style[t];if(e!==u){u=e;f=window.getComputedStyle?window.getComputedStyle(e,null):e.currentStyle?e.currentStyle:null}return f?f[t]:null};function p(e,t,n){if("auto"===e||null===e)return n;const o=t.exec(e),i=o&&2===o.length?o[1]:null;return i?parseFloat(i):n}this.parsePx=function(e){return p(e,/^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/i,0)};this.parsePct=function(e,t){return p(e,/^\s*(-?\d+(?:\.\d+)?)\s*%\s*$/i,t)};this.px=function(t,n){return e.parsePx(e.css(t,n))};this.pxself=function(t,n){return e.parsePx(t.style[n])};this.pctself=function(t,n){return e.parsePct(t.style[n],0)};this.styleAttribute=function(e){function t(e){let t=e.search(/-./);for(;-1!==t;){const n=e.charAt(t+1).toUpperCase();t=(e=e.replace(/-./,n)).search(/-./)}return e}const n=["","-moz-","-webkit-","-o-","-ms-"],o=document.createElement("div");for(let i=0,s=n.length;io?o+1:""!==t.style.styleFloat?n-1:"auto"}return"auto"};this.hide=function(t){e.getElement(t).style.display="none"};this.inline=function(t){e.getElement(t).style.display="inline"};this.block=function(t){e.getElement(t).style.display="block"};this.show=function(t,n){e.getElement(t).style.display=n};let h=null;this.firedTarget=null;this.target=function(t){try{return e.firedTarget||t.target||t.srcElement}catch(e){return null}};function g(t){if(null===h)return null;t||(t=window.event);if(t){let n=e.target(t);for(;n&&n!==h;)n=n.parentNode;return n===h?null:h}return h}function m(t){const n=g(t);if(n&&!r){t||(t=window.event);r=!0;e.condCall(n,"onmousemove",t);r=!1;return!1}return!0}function y(t){const n=g(t);e.capture(null);if(n){t||(t=window.event);e.condCall(n,"onmouseup",t);e.cancelEvent(t,e.CancelPropagate);return!1}return!0}function b(t){const n=g(t);if(n&&!r){t||(t=window.event);r=!0;e.condCall(n,"ontouchmove",t);r=!1;return!1}return!0}function w(t){const n=g(t);e.capture(null);if(n){t||(t=window.event);e.condCall(n,"ontouchend",t);e.cancelEvent(t,e.CancelPropagate);return!1}return!0}let T=!1;function _(t){t.addEventListener("mousemove",m,!0);t.addEventListener("mouseup",y,!0);e.isGecko&&window.addEventListener("mouseout",(function(t){!t.relatedTarget&&e.hasTag(t.target,"HTML")&&y(t)}),!0)}function v(){if(T)return;T=!0;const e=document.body;_(e);!function(e){e.addEventListener("touchmove",b,!0);e.addEventListener("touchend",w,!0)}(e)}this.capture=function(e){v();if(h&&e)return;for(let e=0;e32768){o=document.createElement("style");n.parentNode.insertBefore(o,n);o.styleSheet.cssText=t}else o.styleSheet.cssText+=t}else{const e=document.createTextNode(t);n.appendChild(e)}};this.getCssRule=function(e,t){e=e.toLowerCase();if(document.styleSheets)for(let n=0;n0){const e=o[o.length-1];e.parentNode.insertBefore(n,e.nextSibling)}else document.body.appendChild(n)}};this.removeStyleSheet=function(e){document.querySelectorAll('link[rel=stylesheet][href~="'+e+'"]').forEach((function(e){e.remove()}));const t=document.styleSheets;for(let n=0;nf.x){n=p;a=0}else if(n+d>p+f.x){let o=g.scrollLeft;g===document.body&&(o=g.clientWidth-f.x);i=i-m.x+o;n=g.clientWidth-(i+e.px(t,"marginRight"));a=1}else{let o=g.scrollLeft;g===document.body&&(o=0);n=n-m.x+o;n-=e.px(t,"marginLeft");a=0}if(u>f.y){o=h;c=0}else if(o+u>h+f.y){s>h+f.y&&(s=h+f.y);let n=g.scrollTop;g===document.body&&(n=g.clientHeight-f.y);s=s-m.y+n;o=g.clientHeight-(s+e.px(t,"marginBottom")+e.px(t,"borderBottomWidth"));c=1}else{let n=g.scrollTop;g===document.body&&(n=0);o=(o=o-m.y+n)-e.px(t,"marginTop")+e.px(t,"borderTopWidth");c=0}t.style[r[a]]=n+"px";t.style[l[c]]=o+"px"};this.positionXY=function(t,n,o){const i=e.getElement(t);if(!e.isHidden(i)){i.style.display="block";e.fitToWindow(i,n,o,n,o)}};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(t,n,o,i){const s=e.getElement(t),r=e.getElement(n);i||(i=0);if(!r||!s)return;const l=e.widgetPageCoordinates(r);let a,c,d,u;s.style.position="absolute";"none"===e.css(s,"display")&&(s.style.display="block");if(o===e.Horizontal){a=l.x+r.offsetWidth;c=l.y+i;d=l.x;u=l.y+r.offsetHeight-i}else{a=l.x;c=l.y+r.offsetHeight;d=l.x+r.offsetWidth;u=l.y}let f,p=r;s.parentNode.removeChild(s);for(f=p.parentNode;!f.classList.contains("Wt-domRoot")&&!f.wtReparentBarrier&&!("inline"!==e.css(f,"display")&&f.clientHeight>100&&("scroll"===getComputedStyle(f).overflowY||"scroll"===getComputedStyle(f).overflowX||f.scrollHeight>f.clientHeight&&"auto"===getComputedStyle(f).overflowY||f.scrollWidth>f.clientWidth&&"auto"===getComputedStyle(f).overflowX));f=f.parentNode)p=f;const h=e.css(f,"position");"absolute"!==h&&"relative"!==h&&(f.style.position="relative");f.appendChild(s);s.classList.add("wt-reparented");e.fitToWindow(s,a,c,d,u);s.style.visibility=""};this.hasFocus=function(e){try{return e===document.activeElement}catch(e){return!1}};this.progressed=function(t){const n=document,o=n.body,i=this.getElement("Wt-form");t.style.display=i.style.display;i.parentNode.replaceChild(t,i);o.removeEventListener?o.removeEventListener("click",delayClick,!0):o.detachEvent("click",delayClick);setTimeout((function(){for(let t=0,o=delayedClicks.length;t1&&(e=e.substring(1));const n=e.split("&");e="";for(let o=0,i=n.length;o=1&&"/"===n[n.length-1]){_$_$if_UGLY_INTERNAL_PATHS_$_();o=!0;_$_$endif_$_();_$_$ifnot_UGLY_INTERNAL_PATHS_$_();n=n.substring(0,n.length-1);_$_$endif_$_()}},removeSessionId:function(){let e=r.location.pathname;const t=e.indexOf(";jsessionid=");-1!==t&&(e=e.substring(0,t));const n=e+a(r.location.search,"wtd");r.history.replaceState(null,null,n)},navigate:function(s,r){e.resolveRelativeAnchors();t=s;const l=s.replace(/%/g,"%25").replace(/\+/g,"%2b").replace(/ /g,"%20").replace(/&/g,"%26");let c=n;0!==l.length&&(c+=(o?"?_=":"")+l);if(o){let e=a(window.location.search,"_");if(e.length>1){e.length>2&&"?"===e[0]&&"&"===e[1]&&(e=e.substring(1));-1===c.indexOf("?")?c+="?"+e.substring(1):c+="&"+e.substring(1)}}else c+=window.location.search;try{const e={};e.state=s||"";e.title=document.title;S();window.history.pushState(e,document.title,c)}catch(e){console.log(e.toString())}r&&i(s)},getCurrentState:function(){return t}}}();this.maxZIndex=function(){let t=0,n=0;document.querySelectorAll(".Wt-dialog, .modal, .modal-dialog").forEach((function(o){n=Math.max(t,e.css(o,"z-index"));t=isNaN(n)?t:n}));return t};this.ResponseStatus={OK:0,Error:1,Timeout:2}});if(window._$_APP_CLASS_$_&&window._$_APP_CLASS_$_._p_)try{window._$_APP_CLASS_$_._p_.quit(null)}catch(e){}window._$_APP_CLASS_$_=new function(){const self=this,WT=_$_WT_CLASS_$_,UNDEFINED="undefined";let downX=0,downY=0;const deployUrl=_$_DEPLOY_PATH_$_;function saveDownPos(e){const t=WT.pageCoordinates(e);downX=t.x;downY=t.y}let currentHash=null;function onHashChange(){const e=_$_WT_CLASS_$_.history.getCurrentState();if((!(null!==e&&e.length>0)||e.startsWith("/"))&¤tHash!==e){currentHash=e;setTimeout((function(){update(null,"hash",null,!0)}),1)}}function setHash(e,t){if(currentHash!==e&&(currentHash||"/"!==e)){t||(currentHash=e);WT.history.navigate(e,t)}}const dragState={object:null,sourceId:null,mimeType:null,dropOffsetX:null,dragOffsetY:null,dropTarget:null,objectPrevStyle:null,xy:null};let touchTimer;const touchduration=1e3;function touchStart(e,t){touchTimer=setTimeout((function(){dragStart(e,t)}),touchduration)}function touchEnded(){touchTimer&&clearTimeout(touchTimer)}function dragStart(e,t){if(t.touches&&"vibrate"in navigator){navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate;navigator.vibrate&&navigator.vibrate(100)}if((t.ctrlKey||WT.button(t)>1)&&!t.touches)return!0;const n=WT.target(t);if(n&&"inline"!==WT.css(n,"display")&&(n.offsetWidth>n.clientWidth||n.offsetHeight>n.clientHeight)){const e=WT.widgetPageCoordinates(n),o=WT.pageCoordinates(t),i=o.x-e.x,s=o.y-e.y;if(i>n.clientWidth||s>n.clientHeight)return!0}const o=dragState;o.object=WT.getElement(e.getAttribute("dwid"));if(null===o.object)return!0;o.sourceId=e.getAttribute("dsid");o.objectPrevStyle={position:o.object.style.position,display:o.object.style.display,left:o.object.style.left,top:o.object.style.top,className:o.object.className,parent:o.object.parentNode,zIndex:o.object.zIndex};o.object.parentNode.removeChild(o.object);o.object.style.position="absolute";o.object.className=o.objectPrevStyle.className+"";o.object.style.zIndex="200000";document.body.appendChild(o.object);WT.capture(null);WT.capture(o.object);o.object.onmousemove=dragDrag;o.object.onmouseup=dragEnd;document.addEventListener("mousedown",dragAbort);window.addEventListener("mouseup",dragAbort);document.addEventListener("touchstart",dragAbort);o.object.ontouchmove=dragDrag;o.object.ontouchend=dragEnd;o.offsetX=-4;o.offsetY=-4;o.dropTarget=null;o.mimeType=e.getAttribute("dmt");o.xy=WT.pageCoordinates(t);WT.cancelEvent(t,WT.CancelPropagate);return!1}function dragDrag(e){e=e||window.event;if(null!==dragState.object){const t=dragState,n=WT.pageCoordinates(e);""!==t.object.style.display&&t.xy.x!==n.x&&t.xy.y!==n.y&&(t.object.style.display="");t.object.style.left=n.x-t.offsetX+"px";t.object.style.top=n.y-t.offsetY+"px";const o=t.dropTarget;let i;if(e.changedTouches){t.object.style.display="none";i=document.elementFromPoint(e.changedTouches[0].clientX,e.changedTouches[0].clientY);t.object.style.display=""}else{i=WT.target(e);if(i===t.object&&document.elementFromPoint){t.object.style.display="none";i=document.elementFromPoint(e.clientX,e.clientY);t.object.style.display=""}}const s="{"+t.mimeType+":";let r=null;t.dropTarget=null;for(;i;){r=i.getAttribute("amts");if(null!==r&&-1!==r.indexOf(s)){t.dropTarget=i;break}i=i.parentNode;if(!i.tagName||WT.hasTag(i,"HTML"))break}if(t.dropTarget!==o){if(t.dropTarget){const e=r.indexOf(s)+s.length,n=r.indexOf("}",e),o=r.substring(e,n);if(0!==o.length){t.dropTarget.setAttribute("dos",t.dropTarget.className);t.dropTarget.className=t.dropTarget.className+" "+o}}else t.object.styleClass="";if(null!==o){o.handleDragDrop&&o.handleDragDrop("end",t.object,e,"",s);const n=o.getAttribute("dos");null!==n&&(o.className=n)}}t.dropTarget?t.dropTarget.handleDragDrop?t.dropTarget.handleDragDrop("drag",t.object,e,"",s):t.object.className=t.objectPrevStyle.className+" Wt-valid-drop":t.object.className=t.objectPrevStyle.className+"";return!1}return!0}function dragAbort(){WT.capture(null);const e=dragState;if(e.object){document.body.removeChild(e.object);e.objectPrevStyle.parent.appendChild(e.object);e.object.style.zIndex=e.objectPrevStyle.zIndex;e.object.style.position=e.objectPrevStyle.position;e.object.style.display=e.objectPrevStyle.display;e.object.style.left=e.objectPrevStyle.left;e.object.style.top=e.objectPrevStyle.top;e.object.className=e.objectPrevStyle.className;e.object=null;touchTimer&&clearTimeout(touchTimer)}if(document.removeEventListener){document.removeEventListener("mousedown",dragAbort);window.removeEventListener("mouseup",dragAbort);document.removeEventListener("touchstart",dragAbort)}else{document.detachEvent("onmousedown",dragAbort);window.detachEvent("onmouseup",dragAbort)}}function dragEnd(e){e=e||window.event;WT.capture(null);const t=dragState;if(t.object){if(t.dropTarget){const n=t.dropTarget.getAttribute("dos");null!==n&&(t.dropTarget.className=n);t.dropTarget.handleDragDrop?t.dropTarget.handleDragDrop("drop",t.object,e,t.sourceId,t.mimeType):e.touches?emit(t.dropTarget,{name:"_drop2",eventObject:t.dropTarget,event:e},t.sourceId,t.mimeType):emit(t.dropTarget,{name:"_drop",eventObject:t.dropTarget,event:e},t.sourceId,t.mimeType)}dragAbort()}}function encodeTouches(e,t){let n="";for(let o=0,i=e.length;o0?"&e"+i:"&";let s=t+pendingEvents[i].data.join(t);pendingEvents[i].evAckId=_$_INDICATOR_TIMEOUT_$_){null===currentHideLoadingIndicator&&waitFeedback();return}const o=parseInt(n,10);o>t&&(t=o)}nextWsRqId=t+1;document.body.style.cursor="auto";if(null!==currentHideLoadingIndicator){try{currentHideLoadingIndicator()}catch(e){}currentHideLoadingIndicator=null}}const WebSocketUnknown=0,WebSocketConnecting=1,WebSocketAckConnect=2,WebSocketWorking=3,WebSocketUnavailable=4,websocket={state:WebSocketUnknown,socket:null,keepAlive:null,reconnectTries:0};let connectionMonitor=null;function setServerPush(e){serverPush=e}function doAutoJavaScript(){self._p_.autoJavaScript()}function doJavaScript(e){if(e){e="(function() {"+e+"})();";window.execScript?window.execScript(e):window.eval(e)}self===window._$_APP_CLASS_$_&&doAutoJavaScript()}function webSocketAckConnect(){nextWsRqId=0;pendingWsRequests={};websocket.socket.send("&signal=none&connected="+ackUpdateId);websocket.state=WebSocketWorking}function handleResponse(e,t,n){connectionMonitor&&connectionMonitor.onStatusChange("connectionStatus",e===WT.ResponseStatus.OK?1:0);if(!hasQuit)if(waitingForJavaScript)setTimeout((function(){handleResponse(e,t,n)}),50);else{if(pollTimer){clearTimeout(pollTimer);pollTimer=null}if(e===WT.ResponseStatus.OK){WT.resolveRelativeAnchors();_$_$if_CATCH_ERROR_$_();try{_$_$endif_$_();doJavaScript(t);_$_$if_CATCH_ERROR_$_()}catch(e){const n=e.stack||e.stacktrace,o=e.description||e.message,i={exception_code:e.code,exception_description:o,exception_js:t};i.stack=n;sendError(i,"Wt internal error; code: "+e.code+", description: "+o);throw e}_$_$endif_$_();n&&cancelFeedback(n)}else pendingEvents=sentEvents.concat(pendingEvents);sentEvents=[];responsePending=null;e===WT.ResponseStatus.OK?commErrors=0:e===WT.ResponseStatus.Error&&++commErrors;if(!hasQuit){websocket.state===WebSocketAckConnect&&webSocketAckConnect();if(serverPush&&!waitingForJavaScript||pendingEvents.length>0)if(e===WT.ResponseStatus.Error){const e=Math.min(12e4,500*Math.exp(commErrors));updateTimeout=setTimeout((function(){sendUpdate()}),e)}else null===updateTimeout&&sendUpdate()}}}function setSessionUrl(e){sessionUrl=-1!==e.indexOf("://")||"/"===e[0]?e:deployUrl+e;comm&&comm.setUrl(e)}setSessionUrl(_$_SESSION_URL_$_);comm=WT.initAjaxComm(sessionUrl,handleResponse);function doPollTimeout(){responsePending.abort();responsePending=null;pollTimer=null;hasQuit||sendUpdate()}function setConnectionMonitor(e){connectionMonitor=e;connectionMonitor.status={};connectionMonitor.status.connectionStatus=0;connectionMonitor.status.websocket=!1;connectionMonitor.onStatusChange=function(e,t){const n=connectionMonitor.status[e];if(n!==t){connectionMonitor.status[e]=t;connectionMonitor.onChange(e,n,t)}}}let updating=!1,updateTimeoutStart;function update(e,t,n,o){checkEventOverflow();if(!updating){updating=!0;WT.checkReleaseCapture(e,n);_$_$if_STRICTLY_SERIALIZED_EVENTS_$_();if(!responsePending){_$_$endif_$_();const i={},s=pendingEvents.length;i.object=e;i.signal=t;i.event=window.fakeEvent||n;i.feedback=o;i.evAckId=ackUpdateId;pendingEvents[s]=encodeEvent(i);scheduleUpdate();doJavaScript();_$_$if_STRICTLY_SERIALIZED_EVENTS_$_()}_$_$endif_$_();updating=!1}}function schedulePing(){websocket.keepAlive&&clearInterval(websocket.keepAlive);websocket.keepAlive=setInterval((function(){const e=websocket.socket;if(1===e.readyState)e.send("&signal=ping");else{clearInterval(websocket.keepAlive);websocket.keepAlive=null}}),_$_SERVER_PUSH_TIMEOUT_$_)}function scheduleUpdate(){if(hasQuit){if(!quitStr)return;if(confirm(quitStr)){document.location=document.location;quitStr=null;return}quitStr=null}else{_$_$if_WEB_SOCKETS_$_();if(websocket.state!==WebSocketUnavailable)if(typeof window.WebSocket===UNDEFINED)websocket.state=WebSocketUnavailable;else{let t=websocket.socket;if(null===t||t.readyState>1)if(null!==t&&websocket.state===WebSocketUnknown)websocket.state=WebSocketUnavailable;else{function e(){if(!hasQuit){++websocket.reconnectTries;const e=Math.min(12e4,500*Math.exp(websocket.reconnectTries));setTimeout((function(){scheduleUpdate()}),e)}}let n;if(-1!==sessionUrl.indexOf("://"))n="ws"+sessionUrl.substring(4);else{const i=sessionUrl.substring(sessionUrl.indexOf("?"));n="ws"+location.protocol.substring(4)+"//"+location.host+_$_WS_PATH_$_+i}n+="&request=ws";const o=_$_WS_ID_$_;o.length>0&&(n+="&wsid="+o);websocket.socket=t=new WebSocket(n);websocket.state=WebSocketConnecting;websocket.keepAlive&&clearInterval(websocket.keepAlive);websocket.keepAlive=null;t.onmessage=function(e){let t=null;if(websocket.state===WebSocketConnecting){if("connect"!==e.data){console.log("WebSocket: was expecting a connect?");console.log(e.data);return}if(null!==responsePending&&null!==pollTimer){clearTimeout(pollTimer);pollTimer=null;responsePending.abort();responsePending=null}responsePending||!WT.isEmptyObject(pendingWsRequests)?websocket.state=WebSocketAckConnect:webSocketAckConnect()}else{if(connectionMonitor){connectionMonitor.onStatusChange("websocket",!0);connectionMonitor.onStatusChange("connectionStatus",1)}websocket.state=WebSocketWorking;t=e.data}websocket.reconnectTries=0;null!==t&&handleResponse(WT.ResponseStatus.OK,t,null)};t.onerror=function(t){connectionMonitor&&connectionMonitor.onStatusChange("websocket",!1);3===websocket.reconnectTries&&websocket.state===WebSocketUnknown&&(websocket.state=WebSocketUnavailable);e()};t.onclose=function(t){connectionMonitor&&connectionMonitor.onStatusChange("websocket",!1);3===websocket.reconnectTries&&websocket.state===WebSocketUnknown&&(websocket.state=WebSocketUnavailable);e()};t.onopen=function(e){if(connectionMonitor){connectionMonitor.onStatusChange("websocket",!0);connectionMonitor.onStatusChange("connectionStatus",1)}schedulePing()}}if(1===t.readyState&&t.state===WebSocketWorking){schedulePing();sendUpdate();return}}_$_$endif_$_();if(null!==responsePending&&null!==pollTimer){clearTimeout(pollTimer);pollTimer=null;responsePending.abort();responsePending=null}if(null===responsePending)if(null===updateTimeout){updateTimeout=setTimeout((function(){sendUpdate()}),WT.updateDelay);updateTimeoutStart=(new Date).getTime()}else if(commErrors){clearTimeout(updateTimeout);updateTimeout=null;sendUpdate()}else{if((new Date).getTime()-updateTimeoutStart>WT.updateDelay){clearTimeout(updateTimeout);updateTimeout=null;sendUpdate()}}}}let ackUpdateId=_$_ACK_UPDATE_ID_$_,ackPuzzle=null;function responseReceived(e,t){ackPuzzle=t;ackUpdateId=e;comm.responseReceived(e)}function wsRqsDone(){for(let e=0;e0){let i=_$_MAX_FORMDATA_SIZE_$_-n.length;o&&(i-=("&wsRqId="+nextWsRqId).length);const s=encodePendingEvents(i);if(s.feedback&&0===_$_INDICATOR_TIMEOUT_$_){o||waitFeedback();e=Date.now()}else e=s.feedback?setTimeout(o?wsWaitFeedback:waitFeedback,_$_INDICATOR_TIMEOUT_$_):null;n+=s.result;t=!1}else{n+="&signal=poll";e=null;t=!0}if(o){responsePending=null;if(!t){if(e){const t=nextWsRqId;pendingWsRequests[t]={time:Date.now(),tm:e};++nextWsRqId;n+="&wsRqId="+t;0===_$_INDICATOR_TIMEOUT_$_&&wsWaitFeedback()}websocket.socket.send(n)}}else{if(responsePending)try{throw new Error("responsePending is true before comm.sendUpdate")}catch(e){const t=e.stack||e.stacktrace,n=e.description||e.message,o={exception_description:n};o.stack=t;sendError(o,"Wt internal error; description: "+n);throw e}pollTimer=t?setTimeout(doPollTimeout,_$_SERVER_PUSH_TIMEOUT_$_):null;responsePending=1;responsePending=comm.sendUpdate("request=jsupdate"+n,e,ackUpdateId,-1,t)}}function propagateSize(e,t,n){-1===t&&(t=e.offsetWidth);-1===n&&(n=e.offsetHeight);if(typeof e.wtWidth===UNDEFINED||e.wtWidth!==t||typeof e.wtHeight===UNDEFINED||e.wtHeight!==n){e.wtWidth=t;e.wtHeight=n;t>=0&&n>=0&&emit(e,"resized",Math.round(t),Math.round(n))}}function emit(e,t){checkEventOverflow();const n={},o=pendingEvents.length;n.signal="user";n.id="string"==typeof e?e:e===self?"app":e.id;if("object"==typeof t){n.name=t.name;n.object=t.eventObject;n.event=t.event}else{n.name=t;n.object=n.event=null}n.args=[];for(let e=2;e0&&pendingEvents.length>=_$_MAX_PENDING_EVENTS_$_){const e="too many pending events";sendError(e,"Wt internal error; description: "+e);pendingEvents=[];throw new Error(e)}}function addTimerEvent(e,t,n){const o=function(){const t=WT.getElement(e);if(t){if(-1!==n)t.timer=setTimeout(t.tm,n);else{t.timer=null;t.tm=null}t.onclick&&t.onclick()}},i=WT.getElement(e);i.timer&&clearTimeout(i.timer);i.timer=setTimeout(o,t);i.tm=o}const jsLibsLoaded={};let waitingForJavaScript=!1;function onJsLoad(e,t){setTimeout((function(){if(!0===jsLibsLoaded[e]){waitingForJavaScript=!1;t();!waitingForJavaScript&&serverPush&&sendUpdate()}else jsLibsLoaded[e]=t}),20);waitingForJavaScript=!0}function jsLoaded(e){if(!0!==jsLibsLoaded[e]){if(typeof jsLibsLoaded[e]!==UNDEFINED){waitingForJavaScript=!1;jsLibsLoaded[e]();!waitingForJavaScript&&serverPush&&sendUpdate()}jsLibsLoaded[e]=!0}}function loadScript(uri,symbol,tries){let loaded=!1,error=!1;function onerror(){if(!loaded&&!error){error=!0;const e=typeof tries===UNDEFINED?2:tries;if(e>1)loadScript(uri,symbol,e-1);else{const e={"error-description":"Fatal error: failed loading "+uri};sendError(e,e["error-description"]);quit(null)}}}function onload(){if(!loaded&&!error){loaded=!0;jsLoaded(uri)}}if(""!==symbol)try{loaded=!eval("typeof "+symbol+" === 'undefined'")}catch(e){loaded=!1}if(loaded)jsLoaded(uri);else{const e=document.createElement("script");e.setAttribute("src",uri);e.onload=onload;e.onerror=onerror;e.onreadystatechange=function(){const t=e.readyState;"loaded"===t?onerror():"complete"===t&&onload()};const t=document.getElementsByTagName("head")[0];t.appendChild(e)}}function ImagePreloader(e,t){this.callback=t;this.work=e.length;this.images=[];if(0===e.length)this.callback(this.images);else for(const t of e)this.preload(t)}ImagePreloader.prototype.preload=function(e){const t=new Image;this.images.push(t);t.onload=ImagePreloader.prototype.onload;t.onerror=ImagePreloader.prototype.onload;t.onabort=ImagePreloader.prototype.onload;t.imagePreloader=this;t.src=e};ImagePreloader.prototype.onload=function(){const e=this.imagePreloader;0==--e.work&&e.callback(e.images)};ImagePreloader.prototype.cancel=function(){const e=this.images;for(const t of e){t.onload=function(){};t.onerror=function(){};t.onabort=function(){}}this.callback=function(){}};function ArrayBufferPreloader(e,t){this.callback=t;this.work=e.length;this.arrayBuffers=[];if(0===e.length)t(this.arrayBuffers);else for(let t=0;t