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

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


The following commit(s) were added to refs/heads/FLAGON-469 by this push:
     new 08a72ec  [FLAGON-436] Added innerWidth/Height to packageLogs and 
packageCustomLogs
08a72ec is described below

commit 08a72ec51db7fab034a8ad4bfb4af74c005a7fae
Author: poorejc <[email protected]>
AuthorDate: Fri Jan 10 11:58:39 2020 -0500

    [FLAGON-436] Added innerWidth/Height to packageLogs and packageCustomLogs
---
 build/UserAleWebExtension/content.js    |  9 +++++++++
 build/UserAleWebExtension/manifest.json |  2 +-
 build/userale-2.1.0.js                  | 10 ++++++++++
 build/userale-2.1.0.min.js              |  2 +-
 example/index.html                      |  1 +
 src/UserALEWebExtension/manifest.json   |  2 +-
 src/packageLogs.js                      | 10 ++++++++++
 7 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/build/UserAleWebExtension/content.js 
b/build/UserAleWebExtension/content.js
index 00aecf0..6f60307 100644
--- a/build/UserAleWebExtension/content.js
+++ b/build/UserAleWebExtension/content.js
@@ -490,6 +490,7 @@ function packageLog(e, detailFcn) {
     'clientTime' : timeFields.milli,
     'microTime' : timeFields.micro,
     'location' : getLocation(e),
+    'scrnRes' : getSreenRes(),
     'type' : e.type,
     'logType': 'raw',
     'userAction' : true,
@@ -617,6 +618,14 @@ function getLocation(e) {
 }
 
 /**
+ * Extracts innerWidth and innerHeight to provide estimates of screen 
resolution
+ * @return {Object} An object containing the innerWidth and InnerHeight
+ */
+function getSreenRes() {
+    return { 'width': window.innerWidth, 'height': window.innerHeight};
+}
+
+/**
  * Builds a string CSS selector from the provided element
  * @param  {HTMLElement} ele The element from which the selector is built.
  * @return {string}     The CSS selector for the element, or Unknown if it 
can't be determined.
diff --git a/build/UserAleWebExtension/manifest.json 
b/build/UserAleWebExtension/manifest.json
index 9776960..be2c019 100644
--- a/build/UserAleWebExtension/manifest.json
+++ b/build/UserAleWebExtension/manifest.json
@@ -1,7 +1,7 @@
 {
   "manifest_version": 2,
   "name": "User ALE Extension",
-  "version": "2.0.0",
+  "version": "2.1.0",
   "description": "Injects UserALE.js into every page for testing & user 
research purposes",
   "icons": {
     "48": "icons/border-48.png"
diff --git a/build/userale-2.1.0.js b/build/userale-2.1.0.js
index 4c53af1..b45e366 100644
--- a/build/userale-2.1.0.js
+++ b/build/userale-2.1.0.js
@@ -472,6 +472,7 @@
       'clientTime' : timeFields.milli,
       'microTime' : timeFields.micro,
       'location' : getLocation(e),
+      'scrnRes' : getSreenRes(),
       'type' : e.type,
       'logType': 'raw',
       'userAction' : true,
@@ -522,6 +523,7 @@
           'browser': detectBrowser$1(),
           'clientTime' : timeFields.milli,
           'microTime' : timeFields.micro,
+          'scrnRes' : getSreenRes(),
           'logType': 'custom',
           'userAction' : userAction,
           'details' : details,
@@ -650,6 +652,14 @@
   }
 
   /**
+   * Extracts innerWidth and innerHeight to provide estimates of screen 
resolution
+   * @return {Object} An object containing the innerWidth and InnerHeight
+   */
+  function getSreenRes() {
+      return { 'width': window.innerWidth, 'height': window.innerHeight};
+  }
+
+  /**
    * Builds a string CSS selector from the provided element
    * @param  {HTMLElement} ele The element from which the selector is built.
    * @return {string}     The CSS selector for the element, or Unknown if it 
can't be determined.
diff --git a/build/userale-2.1.0.min.js b/build/userale-2.1.0.min.js
index 76cf4e6..05c5065 100644
--- a/build/userale-2.1.0.min.js
+++ b/build/userale-2.1.0.min.js
@@ -15,4 +15,4 @@
  * limitations under the License.
  * @preserved
  */
-!function(e,n){"object"==typeof exports&&"undefined"!=typeof 
module?n(exports):"function"==typeof 
define&&define.amd?define(["exports"],n):n((e=e||self).userale={})}(this,function(t){"use
 strict";var e="2.1.0",r=null;function 
n(t,o){Object.keys(o).forEach(function(e){if("userFromParams"===e){var 
n=function(e){var n=new 
RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)"),t=window.location.href.match(n);return 
t&&t[2]?decodeURIComponent(t[2].replace(/\+/g," 
")):null}(o[e]);n&&(t.userId=n)}t[e]=o[e]})}var [...]
\ No newline at end of file
+!function(e,n){"object"==typeof exports&&"undefined"!=typeof 
module?n(exports):"function"==typeof 
define&&define.amd?define(["exports"],n):n((e=e||self).userale={})}(this,function(t){"use
 strict";var e="2.1.0",r=null;function 
n(t,o){Object.keys(o).forEach(function(e){if("userFromParams"===e){var 
n=function(e){var n=new 
RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)"),t=window.location.href.match(n);return 
t&&t[2]?decodeURIComponent(t[2].replace(/\+/g," 
")):null}(o[e]);n&&(t.userId=n)}t[e]=o[e]})}var [...]
\ No newline at end of file
diff --git a/example/index.html b/example/index.html
index de2a0d6..7b647cc 100644
--- a/example/index.html
+++ b/example/index.html
@@ -79,5 +79,6 @@ limitations under the License.
   <input type="radio" name="Use Case" value="HCI"> HCI<br>
   <input type="radio" name="Use Case" value="other"> Other
 </form>
+<br>
 </body>
 </html>
\ No newline at end of file
diff --git a/src/UserALEWebExtension/manifest.json 
b/src/UserALEWebExtension/manifest.json
index 9776960..be2c019 100644
--- a/src/UserALEWebExtension/manifest.json
+++ b/src/UserALEWebExtension/manifest.json
@@ -1,7 +1,7 @@
 {
   "manifest_version": 2,
   "name": "User ALE Extension",
-  "version": "2.0.0",
+  "version": "2.1.0",
   "description": "Injects UserALE.js into every page for testing & user 
research purposes",
   "icons": {
     "48": "icons/border-48.png"
diff --git a/src/packageLogs.js b/src/packageLogs.js
index 92889fd..78f460f 100644
--- a/src/packageLogs.js
+++ b/src/packageLogs.js
@@ -97,6 +97,7 @@ export function packageLog(e, detailFcn) {
     'clientTime' : timeFields.milli,
     'microTime' : timeFields.micro,
     'location' : getLocation(e),
+    'scrnRes' : getSreenRes(),
     'type' : e.type,
     'logType': 'raw',
     'userAction' : true,
@@ -147,6 +148,7 @@ export function packageCustomLog(customLog, detailFcn, 
userAction) {
         'browser': detectBrowser(),
         'clientTime' : timeFields.milli,
         'microTime' : timeFields.micro,
+        'scrnRes' : getSreenRes(),
         'logType': 'custom',
         'userAction' : userAction,
         'details' : details,
@@ -275,6 +277,14 @@ export function getLocation(e) {
 }
 
 /**
+ * Extracts innerWidth and innerHeight to provide estimates of screen 
resolution
+ * @return {Object} An object containing the innerWidth and InnerHeight
+ */
+export function getSreenRes() {
+    return { 'width': window.innerWidth, 'height': window.innerHeight};
+}
+
+/**
  * Builds a string CSS selector from the provided element
  * @param  {HTMLElement} ele The element from which the selector is built.
  * @return {string}     The CSS selector for the element, or Unknown if it 
can't be determined.

Reply via email to