You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flagon.apache.org by po...@apache.org on 2019/06/20 04:10:14 UTC

[incubator-flagon-useralejs] branch v2.0.0Release updated: [FLAGON-412] Update example/index.html to include API filtering and mapping examples

This is an automated email from the ASF dual-hosted git repository.

poorejc pushed a commit to branch v2.0.0Release
in repository https://gitbox.apache.org/repos/asf/incubator-flagon-useralejs.git


The following commit(s) were added to refs/heads/v2.0.0Release by this push:
     new 9f6271b  [FLAGON-412] Update example/index.html to include API filtering and mapping examples
9f6271b is described below

commit 9f6271b6adee6fa97e91403965c72ff24f9fec4e
Author: poorejc <po...@apache.org>
AuthorDate: Thu Jun 20 00:10:01 2019 -0400

    [FLAGON-412] Update example/index.html to include API filtering and mapping examples
---
 example/index.html | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/example/index.html b/example/index.html
index be8cdfc..6cdb907 100644
--- a/example/index.html
+++ b/example/index.html
@@ -18,16 +18,37 @@ limitations under the License.
 <head>
   <title>UserAleJS - Example Page</title>
   <script
-    src="file:///...[your file path].../build/userale-2.0.0.min.js"
+    src="file:///Users/jpoore/Documents/Apache_Flagon/test/incubator-flagon-useralejs/build/userale-2.0.0.min.js"
     data-url="http://localhost:8000/"
     data-user="example-user"
     data-version="2.0.0"
     data-tool="Apache UserALE.js Example"
   ></script>
+<!--Try out a UserALE.js filter!
+    <script type="text/javascript">
+    window.userale.filter(function (log) {
+      var type_array = ['mouseup', 'mouseover', 'dblclick', 'blur', 'focus']
+      var logType_array = ['interval']
+      return !type_array.includes(log.type) && !logType_array.includes(log.logType);
+    });
+  </script>
+-->
 </head>
 <body>
   <div class="container">
     <button id="test_button">Click me!</button>
   </div>
+<!--Play around with this mapping function to transform your logs!
+    <script type="text/javascript">
+      window.userale.map(function (log) {
+        var targetsForLabels = ["button#test_button"];
+        if (targetsForLabels.includes(log.target)) {
+            return Object.assign({}, log, { CustomLabel: "Click me!" });
+        } else {
+            return log;  
+        } 
+      });
+  </script>
+-->
 </body>
 </html>