From 7475109afe11473b55cb0c666844ea5f4d3247bc Mon Sep 17 00:00:00 2001 From: gambas Date: Wed, 5 Feb 2020 22:47:23 +0100 Subject: [PATCH] Fix component metadata so that it is usable from the outside. [GB.WEB.FORM2] * BUG: Fix component metadata. * BUG: Don't make test forms exported. They can conflict with other forms with the same name. * NEW: The Window Close event can be cancelled. --- comp/src/gb.web.form2/.component | 3 +-- comp/src/gb.web.form2/.src/Test/Webform1.class | 2 +- comp/src/gb.web.form2/.src/Test/Webform2.class | 2 +- comp/src/gb.web.form2/.src/WebForm.class | 4 +++- comp/src/gb.web.form2/lib.js | 11 ++++++----- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/comp/src/gb.web.form2/.component b/comp/src/gb.web.form2/.component index f0e70ffa6..367fc6af4 100644 --- a/comp/src/gb.web.form2/.component +++ b/comp/src/gb.web.form2/.component @@ -2,6 +2,5 @@ Key=gb.web.form2 Version=3.14.90 State=2 -Needs=EventLoop Requires=gb.util,gb.web,gb.util.web -Excludes=gb.web.form +Excludes=gb.web.form,gb.gui,gb.gui.qt,gb.qt4,gb.qt5,gb.sdl2,gb.gtk,gb.gtk3,gb.sdl diff --git a/comp/src/gb.web.form2/.src/Test/Webform1.class b/comp/src/gb.web.form2/.src/Test/Webform1.class index 195754a61..3bb426544 100644 --- a/comp/src/gb.web.form2/.src/Test/Webform1.class +++ b/comp/src/gb.web.form2/.src/Test/Webform1.class @@ -1,6 +1,6 @@ ' Gambas class file -Export +'Export Private $aFile As String[] Private $aStat As Stat[] diff --git a/comp/src/gb.web.form2/.src/Test/Webform2.class b/comp/src/gb.web.form2/.src/Test/Webform2.class index 78489d03c..bef310786 100644 --- a/comp/src/gb.web.form2/.src/Test/Webform2.class +++ b/comp/src/gb.web.form2/.src/Test/Webform2.class @@ -1,6 +1,6 @@ ' Gambas class file -Export +'Export Public Sub WebTimer1_Timer() diff --git a/comp/src/gb.web.form2/.src/WebForm.class b/comp/src/gb.web.form2/.src/WebForm.class index f42d00035..f98d63e1b 100644 --- a/comp/src/gb.web.form2/.src/WebForm.class +++ b/comp/src/gb.web.form2/.src/WebForm.class @@ -923,8 +923,10 @@ Public Sub Close(Optional ReturnValue As Variant) ' Dim bCancel As Boolean Dim hWindow As WebWindow + Dim bCancel As Boolean - Raise Close + bCancel = Raise Close + If bCancel Then Return If _Window Then diff --git a/comp/src/gb.web.form2/lib.js b/comp/src/gb.web.form2/lib.js index 2516c1110..c10bbb3a2 100644 --- a/comp/src/gb.web.form2/lib.js +++ b/comp/src/gb.web.form2/lib.js @@ -109,7 +109,7 @@ gw = { console.log('load: ' + src); }, - setInnerHtml : function(id, html) + setInnerHtml: function(id, html) { var oldDiv = $(id); var newDiv = oldDiv.cloneNode(false); @@ -117,7 +117,7 @@ gw = { oldDiv.parentNode.replaceChild(newDiv, oldDiv); }, - setOuterHtml : function(id, html) + setOuterHtml: function(id, html) { if ($(id)) $(id).outerHTML = html; @@ -125,7 +125,7 @@ gw = { console.log('setOuterHtml: ' + id + '? ' + html); }, - removeElement : function(id) + removeElement: function(id) { var elt = $(id); //for (i = 0; i < id_list.length; i++) @@ -140,7 +140,7 @@ gw = { //} }, - insertElement : function(id, parent) + insertElement: function(id, parent) { var elt; var pelt = $(parent); @@ -153,7 +153,7 @@ gw = { pelt.appendChild(elt); }, - setVisible : function(id, visible) + setVisible: function(id, visible) { var elt = $(id); if (elt) @@ -204,6 +204,7 @@ gw = { gw.lock_id = setTimeout(function() { $('gw-lock').style.opacity = '1'; + gw.lock_id = undefined; }, 500); }