ba-js-rt 1.0.0
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.
- package/lib/rt.js +1 -0
- package/package.json +27 -0
package/lib/rt.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var BA=BA||{},getRFromRequest=function getRFromRequest(){var s="";top.location&&(s=top.location.href);var r="unset",found=s.match(/[&\?]r=([^&]*)/);return found&&found.length>1&&(r=escape(found[1])),r},setCookie=function setCookie(name,value,expires,path,domain,secure){var today=new Date;today.setTime(today.getTime()),expires&&(expires*=864e5);var expires_date=new Date(today.getTime()+expires);document.cookie=name+"="+escape(value)+(expires?";expires="+expires_date.toGMTString():"")+(path?";path="+path:"")+(domain?";domain="+domain:"")+(secure?";secure":"")},getPDomain=function getPDomain(hostname){for(var i=0,domain=document.domain,p=domain.split("."),s="_gd"+new Date().getTime();i<p.length-1&&-1==document.cookie.indexOf(s+"="+s);)domain=p.slice(-1-++i).join("."),document.cookie=s+"="+s+";domain="+domain+";";return document.cookie=s+"=;expires=Thu, 01 Jan 1970 00:00:01 GMT;domain="+domain+";",domain};!function registerRForSite(){var r=getRFromRequest();if(r&&"null"!=r&&"unset"!=r&&""!=r){var cDom=getPDomain(window.location.hostname);setCookie("r",escape(r),0,"/",cDom),setCookie("ra",escape(r),365,"/",cDom)}}();
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ba-js-rt",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"build": "swc ./src -d lib",
|
|
6
|
+
"lint": "eslint --ext js src --fix",
|
|
7
|
+
"prepublishOnly": "yarn build",
|
|
8
|
+
"prepare": "husky install"
|
|
9
|
+
},
|
|
10
|
+
"files": ["lib"],
|
|
11
|
+
"main": "./lib/rt.js",
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@swc/cli": "^0.1.57",
|
|
14
|
+
"@swc/core": "^1.3.2",
|
|
15
|
+
"eslint": "^8.23.1",
|
|
16
|
+
"eslint-config-airbnb-base": "^15.0.0",
|
|
17
|
+
"eslint-config-prettier": "^8.5.0",
|
|
18
|
+
"eslint-plugin-import": "^2.26.0",
|
|
19
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
20
|
+
"husky": ">=6",
|
|
21
|
+
"lint-staged": ">=10",
|
|
22
|
+
"prettier": "^2.7.1"
|
|
23
|
+
},
|
|
24
|
+
"lint-staged": {
|
|
25
|
+
"*.js": "eslint --cache --fix"
|
|
26
|
+
}
|
|
27
|
+
}
|