Skip to content

Commit

Permalink
Merge pull request #18 from webability-go/late-night
Browse files Browse the repository at this point in the history
Late night
  • Loading branch information
metalwolf committed Jun 13, 2022
2 parents 4393dad + 114fcde commit 5b43e0b
Show file tree
Hide file tree
Showing 66 changed files with 3,668 additions and 3,207 deletions.
39 changes: 37 additions & 2 deletions README.md
Expand Up @@ -4,10 +4,10 @@
[![GoDoc](https://godoc.org/github.com/webability-go/wajaf?status.png)](https://godoc.org/github.com/webability-go/wajaf)
[![GolangCI](https://golangci.com/badges/github.com/webability-go/wajaf.svg)](https://golangci.com)

WAJAF for GO v1
WAJAF for GO v0.1
=============================

WAJAF is the WebAbility Javascript Application Framework. It is a synchronized GO-Server <=> JS-Client framework to developp organized web applications.
WAJAF is the WebAbility Javascript Application Framework. It is a synchronized GO-Server <=> JS-Client framework to develop organized web applications.

GO manuals are available on godoc.org [![GoDoc](https://godoc.org/github.com/webability-go/wajaf?status.png)](https://godoc.org/github.com/webability-go/wajaf)

Expand Down Expand Up @@ -110,6 +110,41 @@ TO DO:
Version Changes Control
=======================

v0.1.3 - 2022-06-12
------------------------
- Added CodeNode.go to create a node of code.
- Added colorfieldelement.go to create a field to pick a color.
- Added config/wajaf.conf in examples to run the examples on a xamboo server if needed.
- The css for prettify is now absolute in the html code.
- Some correction in the example code.
- The go libraries now includes the new structures compatible with Xamboo 1.6
- The jsfile.go added to manage all the JS files on an embed filesystem.
- The js.go library now uses the GetJSFile into the wajaf library.
- go.mod modified to go 1.17 for embed filesystem needed.
- Some errors corrected into groupContainer.js and tabContainer.js to work better.
- The buttonElement now as a listener to send data to the server when clicked.
- lovFieldElement is now working correctly.
- textFieldElement now knows integer, float, text, masked types of fields, and correctly convert values to send to server.
- ajaxManager can now handle ajax promises.
- canvasManager create for test purpose.
- wa4glmanager modified to work on promises, capture errors and needed login requests.
- options.go added to manager lovfield list of options.
- resources directory removed, replaced by embed filesystem


v0.1.2 - 2021-10-04
------------------------
- Correction of isEmpty function of the core, to give true is the Date is empty or the String() is empty.
- The simple javascript examples are now working on a Xamboo Go Server (Presentation, js.go corrected, all libraries working)


v0.1.1 - 2021-02-26
------------------------
- gridContainer.js has been modified to support large list of daat and put correct information metada data.
- node.go enhanced to detect wrong XML formats and return an error
- Added xml.Comment into node XML unmarshall to consider it


v0.1.0 - 2020-12-22
------------------------
- First build on GO, with all the necesary code to devel, test, publish and show live examples.
Expand Down
11 changes: 11 additions & 0 deletions codenode.go
@@ -0,0 +1,11 @@
package wajaf

type CodeNode NodeDef

func NewCodeNode(id string, tp string, code string) CodeElement {

c := NewNode("code", tp)
c.SetID(id)
c.SetData(code)
return c
}
13 changes: 13 additions & 0 deletions colorfieldelement.go
@@ -0,0 +1,13 @@
package wajaf

type ColorFieldElement NodeDef

func NewColorFieldElement(id string) ColorFieldElement {

e := NewNode("element", "colorfieldElement")
e.SetID(id)

e.RegisterKnownAttributes([]string{"display", "style", "classname", "left", "width", "right", "top", "height", "bottom"})

return e
}
31 changes: 31 additions & 0 deletions examples/config/wajaf.conf
@@ -0,0 +1,31 @@
# The main example site configuration file

# Where the pages of our CMS is
# pagesdir can be relative to the xamboo run directory, or absolute
pagesdir=./wajaf/examples/pages/

# The main page to use for / (must exists in the pages)
mainpage=home
errorpage=errors/page
errorblock=errors/block

# The default version of the pages for this site. It is highly recommended to never change 'base' unless you perfectly know what you are doing (advanced configuration)
version=base
# The default language of the pages for this site. You may change with your local language
language=en

# If the pages of the site accept parameters as URL by default (like this: /the-page/param1/param2/param3 )
# boolean: yes/no, true/false, 0/1
acceptpathparameters=yes

# Master LIBRARY
# plugin.app.library=./applications/webability.info/xmodules/app/app.so

# Default app to use (must exist in plugin libraries)
# app=app

# The context we will use and the app name by default
# userdatasource=xmodules
# datasource=xmodules

jspath=./wajaf/js/
2 changes: 1 addition & 1 deletion examples/pages/4gl/4gl.code
Expand Up @@ -10,7 +10,7 @@
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<link rel="stylesheet" href="../prettify/prettify.css" type="text/css" />
<link rel="stylesheet" href="/prettify/prettify.css" type="text/css" />
<script language="javascript" type="text/javascript" src="/prettify/prettify.js"></script>
<script language="javascript" type="text/javascript" src="/js/wajaf.js"></script>
</head>
Expand Down
1 change: 1 addition & 0 deletions examples/pages/ex-simpledommask
6 changes: 3 additions & 3 deletions examples/pages/home/home.code
Expand Up @@ -19,9 +19,9 @@

<div class="container">

<h1 style="font-size: 20px;">The <a href="http://www.webability.info/wajaf">WebAbility&reg; Javascript Application Framework</a> (WAJAF) demo site</h1>
<h1 style="font-size: 20px;">The <a href="https://github.com/webability-go/wajaf" target="_blank">WebAbility&reg; Javascript Application Framework</a> (WAJAF) demo site</h1>

Any doubt ? please refer to the <a href="http://developers.webability.info/wajaf" target="_blank">WAJAF Documentation</a><br />
Any doubt ? please refer to the <a href="https://github.com/webability-go/wajaf" target="_blank">WAJAF Documentation</a><br />

<br />

Expand Down Expand Up @@ -56,7 +56,7 @@ Any doubt ? please refer to the <a href="http://developers.webability.info/wajaf

<h2>WAJAF</h2>

<h3>The Core</h3>
<h3>The Core itself</h3>
<ul>
<a href="examples/core.attributes.html">Attributes examples</a><br />
<a href="examples/core.zindex.html">getNextZIndex examples</a><br />
Expand Down
8 changes: 4 additions & 4 deletions examples/pages/js/js.go
Expand Up @@ -7,13 +7,13 @@ import (
"regexp"
"strings"

"github.com/webability-go/wajaf/resources"
"github.com/webability-go/wajaf"
"github.com/webability-go/xcore/v2"

"github.com/webability-go/xamboo/assets"
"github.com/webability-go/xamboo/cms/context"
)

func Run(ctx *assets.Context, template *xcore.XTemplate, language *xcore.XLanguage, e interface{}) interface{} {
func Run(ctx *context.Context, template *xcore.XTemplate, language *xcore.XLanguage, e interface{}) interface{} {

// Va a buscar los datos de la página
// JS: core mandatory load for every page
Expand Down Expand Up @@ -81,7 +81,7 @@ func (js *WJS) Load(filename string) ([]byte, error) {
data, _ := ioutil.ReadFile(js.Dir + d + filename)
return data, nil
}
data := resources.ResourcesContainer.Get(d + filename)
data := wajaf.GetJSFile(filename)
if data != nil {
return data, nil
}
Expand Down
4 changes: 2 additions & 2 deletions examples/pages/main/main.go
Expand Up @@ -3,10 +3,10 @@ package main
import (
"github.com/webability-go/xcore/v2"

"github.com/webability-go/xamboo/assets"
"github.com/webability-go/xamboo/cms/context"
)

func Run(ctx *assets.Context, template *xcore.XTemplate, language *xcore.XLanguage, e interface{}) interface{} {
func Run(ctx *context.Context, template *xcore.XTemplate, language *xcore.XLanguage, e interface{}) interface{} {

params := &xcore.XDataset{
// "#": language,
Expand Down
3 changes: 2 additions & 1 deletion examples/pages/main/main.template
Expand Up @@ -168,7 +168,8 @@ function(e)
<dataset>
{"row":[
{"id":"combined", "template":"folder", "image":"examplegroup.png", "name":"Combined", "father": null, "closeable": true, "loadable": false},
{"id":"ex-groupcontainer", "template":"example", "image":"example.png", "name":"groupContainer", "father": "combined", "closeable": false, "loadable": false}
{"id":"ex-groupcontainer", "template":"example", "image":"example.png", "name":"groupContainer", "father": "combined", "closeable": false, "loadable": false},
{"id":"ex-simpledommask", "template":"example", "image":"example.png", "name":"xdommask Simple", "father": "combined", "closeable": false, "loadable": false}
%--
{id:'ex_gridContainerSimple', template:'example', image:'example.png', name:'gridContainerSimple', father: 'combined', closeable: false, loadable: false},
{id:'ex_gridContainer', template:'example', image:'example.png', name:'gridContainer', father: 'combined', closeable: false, loadable: false},
Expand Down
108 changes: 54 additions & 54 deletions examples/public/examples/ajax.catcherror.html
@@ -1,54 +1,54 @@
<script language="javascript" type="text/javascript" src="/wajaf/system/core.js"></script>
<script language="javascript" type="text/javascript" src="/wajaf/managers/eventManager.js"></script>
<script language="javascript" type="text/javascript" src="/wajaf/managers/ajaxManager.js"></script>

Click to <span onclick="docall();" style="cursor: pointer; text-decoration: underline; background-color: red;">create a request</span>.<br />
Click to <span onclick="doabort();" style="cursor: pointer; text-decoration: underline; background-color: red;">abort the request</span> (be faster than the network).<br />
<br />

<div id="div1" style="position: relative; min-height: 100px; width: 95%; margin-left: auto; margin-right: auto; border: 2px solid blue;">
Waiting...<br />
</div>

Received code from server:<br />
<div id="div2" style="position: relative; min-height: 10px; width: 95%; margin-left: auto; margin-right: auto; border: 2px solid blue;">
</div>

<script type="text/javascript">

var r = null;

function loaded(rq)
{
$('div2').innerHTML = rq.responseText;
// unlink the request
r = null;
}

function statefeedback(type, err, msg)
{
if (type == 'wait')
$('div1').innerHTML += 'A wait state has happened: type=' + type + ' readyState=' + err + ' message=' + msg + '<br />';
else
$('div1').innerHTML += 'An error has happened: type=' + type + ' error=' + err + ' message=' + msg + '<br />';
}

function docall()
{
if (r == null)
{
r = ajax('/?P=dataset1', 'get', null, loaded, true);
r.addStateFeedback(statefeedback);
}
}

function doabort()
{
if (r != null)
{
r.abort();
r = null;
}
}

</script>
<script language="javascript" type="text/javascript" src="/wajaf/system/core.js"></script>
<script language="javascript" type="text/javascript" src="/wajaf/managers/eventManager.js"></script>
<script language="javascript" type="text/javascript" src="/wajaf/managers/ajaxManager.js"></script>

Click to <span onclick="docall();" style="cursor: pointer; text-decoration: underline; background-color: red;">create a request</span>.<br />
Click to <span onclick="doabort();" style="cursor: pointer; text-decoration: underline; background-color: red;">abort the request</span> (be faster than the network).<br />
<br />

<div id="div1" style="position: relative; min-height: 100px; width: 95%; margin-left: auto; margin-right: auto; border: 2px solid blue;">
Waiting...<br />
</div>

Received code from server:<br />
<div id="div2" style="position: relative; min-height: 10px; width: 95%; margin-left: auto; margin-right: auto; border: 2px solid blue;">
</div>

<script type="text/javascript">

var r = null;

function loaded(rq)
{
$('div2').innerHTML = rq.responseText;
// unlink the request
r = null;
}

function statefeedback(type, err, msg)
{
if (type == 'wait')
$('div1').innerHTML += 'A wait state has happened: type=' + type + ' readyState=' + err + ' message=' + msg + '<br />';
else
$('div1').innerHTML += 'An error has happened: type=' + type + ' error=' + err + ' message=' + msg + '<br />';
}

function docall()
{
if (r == null)
{
r = ajax('/?P=dataset1', 'get', null, loaded, true);
r.addStateFeedback(statefeedback);
}
}

function doabort()
{
if (r != null)
{
r.abort();
r = null;
}
}

</script>

0 comments on commit 5b43e0b

Please sign in to comment.