Labs and feasibility (WET v4.0.xplugin)

Test prototype and feasibility of front-end feature like WET v4.0.x plugin experimental project.

On this page...
Screen shoot of JJ down plugin with WET

Last status: Under development

Refine/Show big list of content into a dropdown presentation. The expected behaviour is the user open up the drop down, choose an item, then either he choose again or the content is ajax-in bellow the control.

Next step / Thing to do:

Documents

Coding and example

Version Examples Comments Work started Last update Status
0.1.0 alpha Plugin source code Completed
0.1.1 alpha Plugin source code
  • Multiple action upon change
  • Customize AJAX call
  • Trigger even on ajaxed content (at risk)
Completed
0.1.2 alpha Plugin source code
  • Toggle content
  • Added "append" action
  • Toggle may heavy
  • Partial support of querying
Completed
1.0.0-rc.1 Plugin source code Partial fix of Firefox keyboard issue Completed
1.0.0-rc.2 Plugin source code Partial fix of Firefox keyboard issue Completed
1.0.0-rc.3 Plugin source code Fix validation issue Completed
1.0.0

Working example

Documentation

Source code

First version use on a production site Released, Documation completed
1.0-next.2

wb-fieldflow:

Plugin source code
  • Table filtering
  • Added a working example for "query" action
  • Full rewrite to be more event based
  • Plugin renamed to wb-fieldflow
  • Action on the fly require to be specified through plugin options
2016-10-14 2016-11-29 Completed
1-next.0 Custom URL live building for ajax and redirect To do
1-next.1

Use handlebars.js ?

See templating labs project

Show content in template To do
1-next.0 Code clean up and optimisation To do

Completed / Thing tested:

Fieldflow plugin

Last status: PR submited

Change a simple list into a interactive component

Coding and example

Version Examples Comments Work started Last update Status
0.1.0 alpha See jj-down version 1.0-next.2 Completed
0.2.0 beta

English:

French:

Plugin source code
In stabilization for PR
1.0.0 alpha See PR #7790 Submited

Templating plugin

Last status: Abandonned on Jan 10 2017

Create a templating plugin similar to data-ajax but it could deal with an external json, local variable and get

To do

Documents

Coding and example

Version Examples Comments Work started Last update Status
0.1.0 alpha Plugin source code In progress

Data JSON

Last status: PR sumited

Similar of the data-ajax But it is for JSON file. The main feature is it will support json filtering by URI fragment as specified in section 6 of RFC6901

Coding and example

Version Examples Comments Work started Last update Status
0.1.0 alpha Add support to use dataset name handeled by wb-jsonpatch Merged in WET as version 1.0 on 18/11/2016
1.1
  • Support for HTML5 <template> element
  • Support dataset name to work in conjonction with jsonmanager
Completed
1.1+alpha-2

Source code

Do the French translation of the HTML5 template and add caching busting support to data-ajax and ajax-fetch In progress
1.1+alpha-3 1.1+alpha-4

Source code, see @duboisp branch data-json-template

Do the French translation In progress
1.1+beta See PR #7875 Submited

Documents

Quick experiment

Convert XML to JSON

To add in json-fetch

,

	// Changes XML to JSON (based on https://davidwalsh.name/convert-xml-json)
	xmlToJson = function ( xml ) {

		// Create the return object
		var obj = {};

		if (xml.nodeType == 1) { // element
			// do attributes
			if (xml.attributes.length > 0) {
			obj["@attributes"] = {};
				for (var j = 0; j < xml.attributes.length; j++) {
					var attribute = xml.attributes.item(j);
					obj["@attributes"][attribute.nodeName] = attribute.nodeValue;
				}
			}
		} else if (xml.nodeType == 3) { // text
			obj = xml.nodeValue;
		}

		// do children
		if (xml.hasChildNodes()) {
			for(var i = 0; i < xml.childNodes.length; i++) {
				var item = xml.childNodes.item(i);
				var nodeName = item.nodeName;
				if (typeof(obj[nodeName]) == "undefined") {
					obj[nodeName] = xmlToJson(item);
				} else {
					if (typeof(obj[nodeName].push) == "undefined") {
						var old = obj[nodeName];
						obj[nodeName] = [];
						obj[nodeName].push(old);
					}
					obj[nodeName].push(xmlToJson(item));
				}
			}
		}
		return obj;
	}

Then change include this in json-fetch

				if ( !fetchOpts.isxml ) {
					fetchOpts.dataType = "json";
				} else {
					fetchOpts.dataType = "xml";
					console.log("set dataType to XML");
				}


....

ar i, i_len, i_cache, backlog;

						if ( fetchOpts.isxml ) {
							console.log(true);
							response = xmlToJson( response );
							console.log(response)
						}

						if ( !fetchOpts.nocache ) {
							try {
								jsonCache[ url ] = response;
							} catch ( error ) {
								return;
							}
						}

JSON Manager

Last status: PR submited

Provide JSON basic manipulation throw patch operation, and could be customized from query string instruction and manage the data as a dataset name.

Coding and example

Version Examples Comments Work started Last update Status
0.0.1 See the Templatating (hbs) alpha version. Closed, code isolated
0.1.0 alpha

Used by working example only:

Plugin almost stable, next task is:
  • documentation and testing
  • May be review/change wb-jsonpatch by forking the project in WET and applying our own changes
Completed
0.2 Require data-json v1.1 and need to include the json-patch wet-boew fork instead of wb-jsonpatch Completed
0.2 Require data-json v1.1+a3 and need to include the json-patch wet-boew fork instead of wb-jsonpatch Completed
1.0+beta See PR #7882 Submited
1.next

Add support for:

  • for schema.org
  • RDF
  • JSONLD
  • JSON Schema (in draft)
  • RestFUL API Authentification

Documents

URL Mapping

Last status PR Submited

Performing action based on URL query. Check to re-use the concept of the JSON manager. Inspired by discussion on #6622 where applying filtering to a data-table based on URL query.

Create a dedicated reusable module for the "action" management. So it will be able to be re-used by wb-fieldflow and url-mapping plugin

Isolate and re-use the logic of managing the mapping of and URL. Make it a component by it's own, like the action manager

Coding and example

Version Examples Comments Work started Last update Status
0.1.0 alpha Plugin stable, next task will be documentation and add a working example for the action "addClass" and "removeClass" Completed
0.2 alpha 2 Completed
1.0+beta See PR #7883 Submited

File Meta

Last status: Prototyped

Add the file size and the file type next to a PDF link or other documents. In other word this is to convert in a WET plugin the file-size.js used in severals page on IRCC website. was known as filesize.

Coding and example

Version Examples Comments Work started Last update Status
0.1.0 alpha Experimentation, would require i18n information In Progress
Screen shoot of TablesSaw plugin with WET

Last status: Under prototyping with exploration

Provide a responsive table solution in WET.

Next step / Thing to do:

Documents

Completed / Thing tested:

References and ressources

Github issue

Techniques for coding complex tables

Other:

Screen shoot of HTML API plugin with WET

Last status: Functional and one know implementation

Operate an app by using a customized form interface, then on submit parsing the html result into JSON, then display the result by specifying a template

This is a plugin divided in part:

Plugin in context
Interface and interaction with the user.
Form scraping
Plugin that contain a pre-configured set of instruction that allow the form scraping
Controler
Core plugin that control the execution order

The plugin run in the following sequence:

  1. An anchor with a link to the web form to complete Task A
  2. From the config, an inline form, compatible with the destination form, in ajaxed under the link.
  3. The inline form is submited
  4. The data submission is submited, either to a RESTful API or directly to the destination form
  5. If is through the destination form
    1. Send a form post
    2. Wait for an answer
    3. Run a specialized script to extract data
    4. Uniform the presentation of the data, like in a form of an API, also at that stage re-adjust well know information like the language and data status
    5. The data is available through a standardized JSON string
  6. Load the appropriate HTML template based on the data status
  7. Run a light template system that fill the template with the data retreived from the result data.
  8. Output the HTML formated result

Working example: http://www.ic.gc.ca/eic/site/cipointernet-internetopic.nsf/eng/h_wr00004.html

WET Editor interface

Create a baseline template and API to be used when a WET plugin need to be configured. At the very limit it could generate the json for the data-* attribute or ideally it will generated the pre-configured plugin code and it will be able to read and modified from a pre-configured plugin code.

Some material to start with

Screen shoot of bars with value plugin

Last status: Feasibility demonstrated

Show the actual value on the top of the bar chart by using flotcharts drawing engine.

Next step / Thing to do:

Completed / Thing tested:

Screen shoot of curved line plugin with WET

Last status: Working

Add effect to a line charts to have curved line when the direction change.

Next step / Thing to do:

Completed / Thing tested:

Last status: Data Captured

Contain a real use case with hundred of charts in one page.

Captured on

Load some flot plugin that improve the chart and display the value (almost all of them), it have charting grouping (like figure 15.15), and have dual chart in the same drawing board.

Next step / Thing to do:

Documents

See all the content of this folder. You will find flot plugin source code, several screen shot and the original html page source code. It seem to be running on WET 4.0.20 for chart dependency, but the site run on wet-boew 4.0.22

Date modified: