Created
October 18, 2012 16:53
-
-
Save adjohu/3913224 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(withJQuery = function withJQuery() { | |
// Check for jQuery | |
if (!window.jQuery) { | |
return setTimeout(withJQuery, 100); | |
} | |
var getISODateFor = function (title) { | |
var selector = ".DtlDetailTbl td:contains('" + title + "') + .ResConfirmValue"; | |
var date = new Date($(selector).text()); | |
return date.toISOString(); | |
}; | |
var new_uv = { | |
product: { | |
accomodations: [{ | |
type: "Hotel", | |
adults: $(".NumGuests").text(), | |
rooms: $(".DtlDetailTbl td:contains('Number of Rooms') + .ResConfirmValue").text(), | |
checkin_time: getISODateFor("Check-in"), | |
checkout_time: getISODateFor("Check-Out") | |
}] | |
}, | |
transaction: { | |
order_id: $("#V29_C1_ird_RDR_ctl00_ConfirmNumberRow .ResConfirmValue").text(), | |
total: (function () { | |
var tot = $(".DtlPriceTbl td:contains('Total'):last + .ResConfirmValue").text(); // total | |
return tot.match(/(\d|\.)+/)[0]; | |
})() | |
} | |
}; | |
window.updateOpenTagState(new_uv); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment