PageSourceSearch

https://www.virreyhotel.com/static/js/motor/update-url.js

js virreyhotel.com collected 2026-09-27 08:01:19 UTC 2,195 bytes, 70 lines download raw bytes

1export default class UpdateUrl{
2
3    constructor(keyAndValues,urlReservation,ticker,lang){
4        const keys = Object.keys(keyAndValues);
5        keys.forEach((key)=>{
6            this[key] = keyAndValues[key];
7        });
8        this.ticker = ticker;
9        this.urlReservation = urlReservation;
10        this.lang = lang;
11    }
12
13    handle (){
14        this.#updateUrl();
15    }
16
17    restartKeysAndValues(){
18
19    }
20
21    // #updateUrl(){
22    //     let final_url = this.urlReservation + "/booking1";
23    //     $("#motor-form").attr("action", final_url);
24    // }
25
26    #updateUrl() {
27        if (!this.keyAndValues || !this.keyAndValues.startDate || !this.keyAndValues.endDate || !this.keyAndValues.numRooms) {
28            console.error("Missing necessary keyAndValues properties");
29            return;
30        }
31
32        let final_url = this.urlReservation + "/booking1?";
33        let params = [];
34
35        // Agregar parámetros generales
36        params.push(`startDate=${this.keyAndValues.startDate}`);
37        params.push(`endDate=${this.keyAndValues.endDate}`);
38        params.push(`numRooms=${this.keyAndValues.numRooms}`);
39
40        // Agregar adultos en orden
41        for (let i = 1; i <= this.keyAndValues.numRooms; i++) {
42            if (this.keyAndValues[`adultsRoom${i}`] !== undefined) {
43                params.push(`adultsRoom${i}=${this.keyAndValues[`adultsRoom${i}`]}`);
44            }
45        }
46
47        // Agregar niños en orden
48        for (let i = 1; i <= this.keyAndValues.numRooms; i++) {
49            if (this.keyAndValues[`childrenRoom${i}`] !== undefined) {
50                params.push(`childrenRoom${i}=${this.keyAndValues[`childrenRoom${i}`]}`);
51            }
52        }
53
54        // Agregar bebés en orden
55        for (let i = 1; i <= this.keyAndValues.numRooms; i++) {
56            if (this.keyAndValues[`babiesRoom${i}`] !== undefined) {
57                params.push(`babiesRoom${i}=${this.keyAndValues[`babiesRoom${i}`]}`);
58            }
59        }
60
61        final_url += params.join('&');
62        $("#motor-form").attr("action", final_url);
63    }
64
65
66    #isHotelTickerPresent(){
67        return typeof this.hotel_ticker == undefined || this.hotel_ticker == null;
68    }
69
70}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.