mr.jdwolfe / CRO Quick Buttons

// ==UserScript==
// @name         CRO Quick Buttons
// @namespace    https://callcenter15.ihotelier.com/
// @version      0.1
// @description  Adds buttons near the nights field and adults/children field to speed up entering those values.
// @license      MIT
// @author       Jacob Wolfe
// @match        https://callcenter15.ihotelier.com/callcenter-1.5/mainPage/index
// @updateURL    https://openuserjs.org/meta/mr.jdwolfe/CRO_Quick_Buttons.meta.js
// ==/UserScript==

(function() {
    'use strict';
    var nightspot = document.querySelector("#form1 > table > tbody > tr > td > table:nth-child(2) > tbody > tr:nth-child(1) > td:nth-child(1) > div > table > tbody > tr:nth-child(4) > td:nth-child(2)");
    var btn = document.createElement("BUTTON");
    btn.innerHTML = "Two Nights";
    btn.onclick = function() {twonights()};
    nightspot.appendChild(btn);
})();

function twonights() {
    var nights = document.querySelector("#form1 > table > tbody > tr > td > table:nth-child(2) > tbody > tr:nth-child(1) > td:nth-child(1) > div > table > tbody > tr:nth-child(4) > td:nth-child(2) > input[type=text]");
    nights.value = '2';
    fnNight('LF');
};