-
Notifications
You must be signed in to change notification settings - Fork 662
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move of Do Action and Action manager plugin from GCWeb to wet-boew
- Loading branch information
Showing
22 changed files
with
3,529 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"city": { | ||
"gat": "Gatineau", | ||
"ott": "Ottawa", | ||
"vdm": "Val-des-monts" | ||
}, | ||
"fruit": "Perry", | ||
"country": { | ||
"name": "Canada", | ||
"province": { | ||
"qc": "Quebec", | ||
"on": "Ontario", | ||
"ma": "Manitoba" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"ville": { | ||
"gat": "Gatineau", | ||
"ott": "Ottawa", | ||
"vdm": "Val-des-monts" | ||
}, | ||
"fruit": "poire", | ||
"pays": { | ||
"nom": "Canada", | ||
"province": { | ||
"qc": "Québec", | ||
"on": "Ontario", | ||
"ma": "Manitoba" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"test" : "test found!", | ||
"express" : { | ||
"bad-date" : "Date not found", | ||
"2019-06-10" : "2019-06-13", | ||
"2019-06-11" : "2019-06-14", | ||
"2019-06-12" : "2019-06-15" | ||
}, | ||
"standard" : { | ||
"bad-date" : "Date not found", | ||
"2019-06-10" : "2019-06-20", | ||
"2019-06-11" : "2019-06-21", | ||
"2019-06-12" : "2019-06-22" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"test" : "test trouvé!", | ||
"express" : { | ||
"bad-date" : "Date introuvable", | ||
"2019-06-10" : "2019-06-13", | ||
"2019-06-11" : "2019-06-14", | ||
"2019-06-12" : "2019-06-15" | ||
}, | ||
"standard" : { | ||
"bad-date" : "Date introuvable", | ||
"2019-06-10" : "2019-06-20", | ||
"2019-06-11" : "2019-06-21", | ||
"2019-06-12" : "2019-06-22" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"data": "Du fichier JSON 1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"data": "From JSON file 1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"data": "+Du fichier JSON 2" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"data": "+From JSON file 2" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"data": "-Du fichier JSON 3" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"data": "-From JSON file 3" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"data": "&Du fichier JSON 4" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"data": "&From JSON file 4" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** | ||
* @title WET-BOEW URL mapping | ||
* @overview Execute pre-configured action based on url query string | ||
* @license wet-boew.github.io/wet-boew/License-en.html / wet-boew.github.io/wet-boew/Licence-fr.html | ||
* @author @duboisp | ||
*/ | ||
( function( $, window, wb ) { | ||
"use strict"; | ||
|
||
/* | ||
* Variable and function definitions. | ||
* These are global to the plugin - meaning that they will be initialized once per page, | ||
* not once per instance of plugin on the page. So, this is a good place to define | ||
* variables that are common to all instances of the plugin on a page. | ||
*/ | ||
var componentName = "wb-doaction", | ||
selector = "a[data-" + componentName + "],button[data-" + componentName + "]", | ||
runActions = "do.wb-actionmng", | ||
$document = wb.doc; | ||
|
||
$document.on( "click", selector, function( event ) { | ||
|
||
var elm = event.target, | ||
$elm = $( elm ); | ||
|
||
// Get the selector when click on a child of it, like click on a figure wrapped in a anchor with doaction. | ||
if ( event.currentTarget !== event.target ) { | ||
$elm = $elm.parentsUntil( "main", selector ); | ||
elm = $elm[ 0 ]; | ||
} | ||
|
||
// Ensure that we only execute for anchor and button | ||
if ( elm.nodeName === "BUTTON" || elm.nodeName === "A" ) { | ||
|
||
if ( !elm.id ) { | ||
elm.id = wb.getId(); | ||
} | ||
|
||
if ( wb.isReady ) { | ||
|
||
// Execute actions if any. | ||
$elm.trigger( { | ||
type: runActions, | ||
actions: wb.getData( $elm, componentName ) | ||
} ); | ||
} else { | ||
|
||
// Execution of the action after WET will be ready | ||
$document.one( "wb-ready.wb", function( ) { | ||
$elm.trigger( { | ||
type: runActions, | ||
actions: wb.getData( $elm, componentName ) | ||
} ); | ||
} ); | ||
} | ||
return false; | ||
} | ||
} ); | ||
|
||
|
||
} )( jQuery, window, wb ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"@context": { | ||
"@version": 1.1, | ||
"dct": "http://purl.org/dc/terms/", | ||
"title": { "@id": "dct:title", "@container": "@language" }, | ||
"description": { "@id": "dct:description", "@container": "@language" }, | ||
"modified": "dct:modified" | ||
}, | ||
"title": { | ||
"en": "Do action", | ||
"fr": "Exécuter des actions" | ||
}, | ||
"description": { | ||
"en": "Execute action, like filter a table, based on pre-established set of configuration.", | ||
"fr": "Exécute des actions, tel que filtrer un tableau, selon une configuration pré-établis." | ||
}, | ||
"modified": "2019-1-12", | ||
"componentName": "wb-doaction", | ||
"status": "stable", | ||
"pages": { | ||
"examples": [ | ||
{ | ||
"title": "Table", | ||
"language": "en", | ||
"path": "tblfilter-en.html" | ||
}, | ||
{ | ||
"title": "Filtrer un tableau", | ||
"language": "fr", | ||
"path": "tblfilter-fr.html" | ||
}, | ||
{ | ||
"title": "JSON", | ||
"language": "en", | ||
"path": "json-en.html" | ||
}, | ||
{ | ||
"title": "JSON", | ||
"language": "fr", | ||
"path": "json-fr.html" | ||
}, | ||
{ | ||
"title": "JSON manager patches", | ||
"language": "en", | ||
"path": "../wb-jsonmanager/jsonmanager-doaction-en.html" | ||
}, | ||
{ | ||
"title": "Gestionnaire JSON avec l'exécuteur d'action de patches", | ||
"language": "fr", | ||
"path": "../wb-jsonmanager/jsonmanager-doaction-fr.html" | ||
} | ||
], | ||
"docs": [ | ||
{ | ||
"title": "Do action", | ||
"language": "en", | ||
"path": "doaction-doc-en.html" | ||
}, | ||
{ | ||
"title": "Exécuter des actions", | ||
"language": "fr", | ||
"path": "doaction-doc-fr.html" | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.