@vacayou/tripfusion-js-sdk 1.3.0 → 1.9.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/README.md +3 -4
- package/package.json +34 -23
- package/dist/index.html +0 -49
- package/dist/main.js +0 -1359
package/README.md
CHANGED
|
@@ -19,11 +19,10 @@ The booking widget can be controlled both via JavaScript function calls and via
|
|
|
19
19
|
To display the widget, you need to add the `book` function as an event handler, for example:
|
|
20
20
|
|
|
21
21
|
```html
|
|
22
|
-
<button onClick="book({config
|
|
22
|
+
<button onClick="book({...config})">Book Now</button>
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
The widget configuration is done using the optional parameters
|
|
26
|
-
|
|
25
|
+
The widget configuration is done using the optional [parameters](#configuration-options).
|
|
27
26
|
To hide the widget, you need to call the `closeWidget()` function.
|
|
28
27
|
|
|
29
28
|
**Using the widget with HTML links**
|
|
@@ -33,7 +32,7 @@ To trigger the booking widget, simply add the following parameters to any HTML l
|
|
|
33
32
|
https://<link>/?tripfusion=true[&options=...]
|
|
34
33
|
```
|
|
35
34
|
|
|
36
|
-
The widget configuration is done by passing additional parameters in the link (parameter names are the same as those used when calling the JS `book()` function,
|
|
35
|
+
The widget configuration is done by passing additional [parameters](#configuration-options) in the link (parameter names are the same as those used when calling the JS `book()` function, all parameters should be separated by `&` symbol), for example:
|
|
37
36
|
|
|
38
37
|
- Standard booking:
|
|
39
38
|
|
package/package.json
CHANGED
|
@@ -1,26 +1,37 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
2
|
+
"name": "@vacayou/tripfusion-js-sdk",
|
|
3
|
+
"version": "1.9.0",
|
|
4
|
+
"description": "Tripfusion Booking Engine JS SDK",
|
|
5
|
+
"browser": "./dist/main.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"homepage": "https://www.tripfusion.com/",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"watch": "webpack --mode development --watch",
|
|
12
|
+
"start": "webpack serve --open",
|
|
13
|
+
"build": "webpack --mode production"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"css-loader": "^7.1.2",
|
|
17
|
+
"html-webpack-plugin": "^5.6.0",
|
|
18
|
+
"mini-css-extract-plugin": "^2.9.1",
|
|
19
|
+
"style-loader": "^4.0.0",
|
|
20
|
+
"ts-loader": "^9.5.1",
|
|
21
|
+
"typescript": "^5.6.2",
|
|
22
|
+
"webpack": "^5.94.0",
|
|
23
|
+
"webpack-cli": "^5.1.4",
|
|
24
|
+
"webpack-dev-server": "^5.1.0"
|
|
25
|
+
},
|
|
26
|
+
"overrides": {
|
|
27
|
+
"webpack-dev-server": {
|
|
28
|
+
"express": {
|
|
29
|
+
"cookie": "^0.7.0"
|
|
30
|
+
}
|
|
25
31
|
}
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"dayjs": "^1.11.13",
|
|
35
|
+
"zustand": "^5.0.0-rc.2"
|
|
36
|
+
}
|
|
26
37
|
}
|
package/dist/index.html
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<script id="tripfusion-sdk" src="main.js?client=yo1&propertyId=105"></script>
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
</head>
|
|
7
|
-
<body>
|
|
8
|
-
<script>
|
|
9
|
-
window.addEventListener("load", function () {
|
|
10
|
-
var demoLink = document.createElement("a");
|
|
11
|
-
demoLink.href =
|
|
12
|
-
"?tripfusion=true&offerId=76";
|
|
13
|
-
demoLink.title = "Book with offer";
|
|
14
|
-
demoLink.innerHTML = "Book with offer";
|
|
15
|
-
document.body.appendChild(demoLink);
|
|
16
|
-
document.body.appendChild(document.createElement("br"));
|
|
17
|
-
|
|
18
|
-
demoLink = document.createElement("a");
|
|
19
|
-
demoLink.href =
|
|
20
|
-
"?tripfusion=true&client=co-variant-6&propertyId=1016";
|
|
21
|
-
demoLink.title = "Experiences only";
|
|
22
|
-
demoLink.innerHTML = "Experiences only";
|
|
23
|
-
document.body.appendChild(demoLink);
|
|
24
|
-
document.body.appendChild(document.createElement("br"));
|
|
25
|
-
|
|
26
|
-
demoLink = document.createElement("a");
|
|
27
|
-
demoLink.href =
|
|
28
|
-
"?tripfusion=true&checkin=2022-10-10&checkout=2022-10-12&adults=2&client=co-variant-6&propertyId=1016";
|
|
29
|
-
demoLink.title = "Experiences only with predefined check in and check out dates";
|
|
30
|
-
demoLink.innerHTML = "Experiences only with predefined check in and check out dates";
|
|
31
|
-
document.body.appendChild(demoLink);
|
|
32
|
-
document.body.appendChild(document.createElement("br"));
|
|
33
|
-
|
|
34
|
-
var existingBookingId = 11041;
|
|
35
|
-
demoLink = document.createElement("a");
|
|
36
|
-
demoLink.href =
|
|
37
|
-
"?tripfusion=true&mode=append&bookingId=" + existingBookingId;
|
|
38
|
-
demoLink.title = "Append items to existing booking";
|
|
39
|
-
demoLink.innerHTML = "Append items to existing booking";
|
|
40
|
-
document.body.appendChild(demoLink);
|
|
41
|
-
document.body.appendChild(document.createElement("br"));
|
|
42
|
-
});
|
|
43
|
-
</script>
|
|
44
|
-
<h1>Tripfusion JS SDK Demo</h1>
|
|
45
|
-
<h3>JS handler</h3>
|
|
46
|
-
<button onClick="book()">Book Now</button><br />
|
|
47
|
-
<h3>Link handlers with different options</h3>
|
|
48
|
-
</body>
|
|
49
|
-
</html>
|