This is an automated email from the ASF dual-hosted git repository.
jkevan pushed a commit to branch UNOMI-610-new-tracker
in repository https://gitbox.apache.org/repos/asf/unomi-tracker.git
The following commit(s) were added to refs/heads/UNOMI-610-new-tracker by this
push:
new 2334031 UNOMI-610: base tracker first draft
2334031 is described below
commit 23340318727fef9d6bac871419bbecc53e34310a
Author: Kevan <[email protected]>
AuthorDate: Tue Sep 6 14:33:51 2022 +0200
UNOMI-610: base tracker first draft
---
dist/apache-unomi-tracker.cjs.js | 25 ++++++++++++++++++-------
dist/apache-unomi-tracker.esm.js | 25 ++++++++++++++++++-------
dist/apache-unomi-tracker.umd.js | 25 ++++++++++++++++++-------
src/tracker/tracker.js | 26 ++++++++++++++++++--------
4 files changed, 72 insertions(+), 29 deletions(-)
diff --git a/dist/apache-unomi-tracker.cjs.js b/dist/apache-unomi-tracker.cjs.js
index d76e25c..fb6aedd 100644
--- a/dist/apache-unomi-tracker.cjs.js
+++ b/dist/apache-unomi-tracker.cjs.js
@@ -11,13 +11,6 @@ function _unsupportedIterableToArray(o, minLen) { if (!o)
return; if (typeof o =
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length)
len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i]; } return arr2; }
var newTracker = function newTracker() {
var wem = {
- getLoadedContext: function getLoadedContext() {
- return wem.cxs;
- },
- getFormNamesToWatch: function getFormNamesToWatch() {
- return wem.formNamesToWatch;
- },
-
/**
* This function initialize the tracker
*
@@ -120,6 +113,24 @@ var newTracker = function newTracker() {
}
});
},
+
+ /**
+ * get the current loaded context from Unomi, will be accessible only
after loadContext() have been performed
+ * @returns {object} loaded context
+ */
+ getLoadedContext: function getLoadedContext() {
+ return wem.cxs;
+ },
+
+ /**
+ * In case Unomi contains rules related to HTML forms in the current page,
this will be there names/ids
+ * The logic is simple, in case a rule exists for current webpage on a
form event in Unomi backend,
+ * then this form will be identified as form to be watched.
+ * @returns {string[]} form names/ids in current web page
+ */
+ getFormNamesToWatch: function getFormNamesToWatch() {
+ return wem.formNamesToWatch;
+ },
convertUrlParametersToObj: function
convertUrlParametersToObj(searchString) {
if (!searchString) {
return null;
diff --git a/dist/apache-unomi-tracker.esm.js b/dist/apache-unomi-tracker.esm.js
index 945562f..757535d 100644
--- a/dist/apache-unomi-tracker.esm.js
+++ b/dist/apache-unomi-tracker.esm.js
@@ -7,13 +7,6 @@ function _unsupportedIterableToArray(o, minLen) { if (!o)
return; if (typeof o =
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length)
len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i]; } return arr2; }
var newTracker = function newTracker() {
var wem = {
- getLoadedContext: function getLoadedContext() {
- return wem.cxs;
- },
- getFormNamesToWatch: function getFormNamesToWatch() {
- return wem.formNamesToWatch;
- },
-
/**
* This function initialize the tracker
*
@@ -116,6 +109,24 @@ var newTracker = function newTracker() {
}
});
},
+
+ /**
+ * get the current loaded context from Unomi, will be accessible only
after loadContext() have been performed
+ * @returns {object} loaded context
+ */
+ getLoadedContext: function getLoadedContext() {
+ return wem.cxs;
+ },
+
+ /**
+ * In case Unomi contains rules related to HTML forms in the current page,
this will be there names/ids
+ * The logic is simple, in case a rule exists for current webpage on a
form event in Unomi backend,
+ * then this form will be identified as form to be watched.
+ * @returns {string[]} form names/ids in current web page
+ */
+ getFormNamesToWatch: function getFormNamesToWatch() {
+ return wem.formNamesToWatch;
+ },
convertUrlParametersToObj: function
convertUrlParametersToObj(searchString) {
if (!searchString) {
return null;
diff --git a/dist/apache-unomi-tracker.umd.js b/dist/apache-unomi-tracker.umd.js
index effe0c4..cfbc8fc 100644
--- a/dist/apache-unomi-tracker.umd.js
+++ b/dist/apache-unomi-tracker.umd.js
@@ -1653,13 +1653,6 @@
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length)
len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i]; } return arr2; }
var newTracker = function newTracker() {
var wem = {
- getLoadedContext: function getLoadedContext() {
- return wem.cxs;
- },
- getFormNamesToWatch: function getFormNamesToWatch() {
- return wem.formNamesToWatch;
- },
-
/**
* This function initialize the tracker
*
@@ -1762,6 +1755,24 @@
}
});
},
+
+ /**
+ * get the current loaded context from Unomi, will be accessible only
after loadContext() have been performed
+ * @returns {object} loaded context
+ */
+ getLoadedContext: function getLoadedContext() {
+ return wem.cxs;
+ },
+
+ /**
+ * In case Unomi contains rules related to HTML forms in the current
page, this will be there names/ids
+ * The logic is simple, in case a rule exists for current webpage on a
form event in Unomi backend,
+ * then this form will be identified as form to be watched.
+ * @returns {string[]} form names/ids in current web page
+ */
+ getFormNamesToWatch: function getFormNamesToWatch() {
+ return wem.formNamesToWatch;
+ },
convertUrlParametersToObj: function
convertUrlParametersToObj(searchString) {
if (!searchString) {
return null;
diff --git a/src/tracker/tracker.js b/src/tracker/tracker.js
index 73b9050..f2e2785 100644
--- a/src/tracker/tracker.js
+++ b/src/tracker/tracker.js
@@ -2,14 +2,6 @@ import { Crawler } from 'es6-crawler-detect';
export const newTracker = () => {
const wem = {
- getLoadedContext: function () {
- return wem.cxs;
- },
-
- getFormNamesToWatch: function () {
- return wem.formNamesToWatch;
- },
-
/**
* This function initialize the tracker
*
@@ -108,6 +100,24 @@ export const newTracker = () => {
});
},
+ /**
+ * get the current loaded context from Unomi, will be accessible only
after loadContext() have been performed
+ * @returns {object} loaded context
+ */
+ getLoadedContext: function () {
+ return wem.cxs;
+ },
+
+ /**
+ * In case Unomi contains rules related to HTML forms in the current
page, this will be there names/ids
+ * The logic is simple, in case a rule exists for current webpage on a
form event in Unomi backend,
+ * then this form will be identified as form to be watched.
+ * @returns {string[]} form names/ids in current web page
+ */
+ getFormNamesToWatch: function () {
+ return wem.formNamesToWatch;
+ },
+
convertUrlParametersToObj: function (searchString) {
if (!searchString) {
return null;