Skip to content

Instantly share code, notes, and snippets.

@ebbnormal
Created Oct 17, 2015
Embed
What would you like to do?
this.initConfirmationSheet = function initConfirmationSheet(divForDiagram){
alert("in Confirmation Sheet init");
setUpGUI();
//Initialize all of the local variables as formatted and properly lengthed strings
MyEventID_txt= "";
var Reservation_array = findValue(ConfInfo, "Reservation_array");
displayHostName(Reservation_array[indexIntoResArray+19]);
displayBarCode(Reservation_array[indexIntoResArray+9]); //Pass the ticket type
//displayPurchaseName(ConfInfo.BLName + "," + ConfInfo.BFName);
displayVenueInfo(Reservation_array[indexIntoResArray+20]);
EventID = Reservation_array[indexIntoResArray];
alert("EventID from Res array :" + EventID);
MyEventID_txt= "EID " + String(EventID);
alert("MY Event ID txt " + MyEventID_txt);
alert("displaying ennumerating predicting");
address_txt = Reservation_array[indexIntoResArray+21] + " " +
Reservation_array[indexIntoResArray+22] + ", " +
Reservation_array[indexIntoResArray+23] + " " +
Reservation_array[indexIntoResArray+24];
IsGeneralAdmission = Number(Reservation_array[indexIntoResArray+29]) == 1;
parseSeatInfo(Reservation_array);
var Trans_time = findValue(ConfInfo, "TransTime");
purchaseTime_txt = "Trans: " + Trans_time;
alert("Purchase Time: " + purchaseTime_txt);
ticketCount_txt = ticketCount + " of " + Reservation_array.length/NUM_ITEMS_ON_RES_ARRAY;
createNodesForEachStyleEntry();
alert("about to be in save ticket moving");
saveTicketInfo();
if(IsBoxOffice) {
// updateLegalNotes();
}
//setUpRestrictions();
generateImages(700,300);
//TixInteractionPanel.show();
//window.print();
}
function generateImages(width, height) {
alert("generate images");
// sanitize input
width = parseInt(width);
height = parseInt(height);
if (isNaN(width)) width = 100;
if (isNaN(height)) height = 100;
// Give a minimum size of 50x50
width = Math.max(width, 50);
height = Math.max(height, 50);
var imgDiv = document.getElementById('myImages');
imgDiv.innerHTML = '';
alert(imgDiv);
var db = confSheetDiagramRef.documentBounds.copy();
var boundswidth = db.width;
var boundsheight = db.height;
alert(boundswidth);
alert(boundsheight);
var imgWidth = width;
var imgHeight = height;
var p = db.position.copy();
for (var i = 0; i < boundsheight; i += imgHeight) {
for (var j = 0; j < boundswidth; j += imgWidth) {
alert("made it inside the loop?");
img = confSheetDiagramRef.makeImage({
scale: 1,
position: new go.Point(p.x + j, p.y + i),
size: new go.Size(imgWidth, imgHeight)
});
// Append the new HTMLImageElement to the #myImages div
img.className = 'images';
imgDiv.appendChild(img);
imgDiv.appendChild(document.createElement('br'));
console.log("length of image div children" + imgDiv.children.length);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment