@itutoring/itutoring_application_js_api 1.3.17 → 1.3.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/apiController.js +13 -0
  2. package/package.json +1 -1
package/apiController.js CHANGED
@@ -42,6 +42,15 @@ class APIController
42
42
  return CookiesManager.GetCookie("session");
43
43
  }
44
44
 
45
+ static ReadUserSource()
46
+ {
47
+ var urlParams = new URLSearchParams(window.location.search);
48
+ if (urlParams.has("s"))
49
+ return urlParams.get("s");
50
+
51
+ return null;
52
+ }
53
+
45
54
  /**
46
55
  *
47
56
  * @param module "Name of API module"
@@ -74,6 +83,8 @@ class APIController
74
83
  request.setRequestHeader("sites", location.hostname);
75
84
  request.setRequestHeader("key", APIController.#CLIENT_KEY);
76
85
  request.setRequestHeader("visitor-session", this.GetVisitorSessionID());
86
+ if (this.ReadUserSource() != null)
87
+ request.setRequestHeader("visitor-source", this.ReadUserSource());
77
88
  request.send();
78
89
  });
79
90
  }
@@ -118,6 +129,8 @@ class APIController
118
129
  request.setRequestHeader("sites", location.hostname);
119
130
  request.setRequestHeader("key", APIController.#CLIENT_KEY);
120
131
  request.setRequestHeader("visitor-session", this.GetVisitorSessionID());
132
+ if (this.ReadUserSource() != null)
133
+ request.setRequestHeader("visitor-source", this.ReadUserSource());
121
134
 
122
135
  if (file != null)
123
136
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itutoring/itutoring_application_js_api",
3
- "version": "1.3.17",
3
+ "version": "1.3.18",
4
4
  "description": "Javascript API for iTutoring Application",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",