1var ITDialog = function (options) { 2 if (typeof (options) == "undefined") { 3 options = {}; 4 } 5 6 var GetNextAvailableDialogID = function () { 7 for (var x = 0; x < 25; x++) { 8 if ($('#ITDialog' + x).length == 0) { 9 return 'ITDialog' + x; 10 } 11 } 12 } 13 14 this.DialogID = GetNextAvailableDialogID(); 15 this.Width = typeof (options.Width) !== "undefined" && false == isNaN(options.Width) 16 ? options.Width 17 : 0; 18 this.Height = typeof (options.Height) !== "undefined" && false == isNaN(options.Height) 19 ? options.Height 20 : 0; 21 this.VarName = typeof (options.VarName) !== "undefined" ? options.VarName : ''; 22 this.IsImageDisplay = typeof (options.IsImageDisplay) !== "undefined" ? options.IsImageDisplay : false; 23 this.OnOpenFunc = typeof (options.OnOpen) !== "undefined" ? options.OnOpen : null; 24 this.ContentContainerSelector = typeof (options.ContentContainerSelector) !== "undefined" ? options.ContentContainerSelector : ""; 25 this.SelectorContentHoldingContainer = typeof (options.ContentContainerSelector) !== "undefined" ? $(options.ContentContainerSelector) : null; 26 this.ShowFooter = typeof (options.ShowFooter) !== "undefined" ? options.ShowFooter : true; 27 this.Title = typeof (options.Title) !== "undefined" ? options.Title : " "; 28 this.FitToContents = typeof (options.FitToContents) !== "undefined" ? options.FitToContents : false; 29 30 var maxSizeStyleAttributes = 'max-height: 70vh; max-width: 60vw;' 31 var divSize = this.ShouldFitDialogToContents() ? '' : 'width: ' + this.Width + 'px; height: ' + (this.Height - 40) + 'px; '; 32 divSize += maxSizeStyleAttributes; 33 var spanOrDiv; 34 35 if (this.IsImageDisplay) { 36 spanOrDiv = "span"; 37 } else { 38 spanOrDiv = "div"; 39 } 40 41 if (this.VarName.length < 1) { 42 alert('You must include the variable name given to the dialog object [VarName] in the options parameter array when instantiating a dialog.'); 43 } 44 if ($('#' + this.DialogID).length < 1) {//only render 1 time if it's not existing on page already 45 var dialogHTML = 46 '<div class="ITDialogContainer hidden" id="' + this.DialogID + '_container">' + 47 '<div class="ITDialogFiller"></div>' + 48 '<div class="ITDialogMiddleRow">' + 49 '<div class="ITDialogFiller"></div>' + 50 '<div class="ITDialogBorder" id="' + this.DialogID + '">' + 51 '<i class="dialogExitIcon bi bi-x-circle-fill" role="button" aria-label="Close" onclick="' + this.VarName + '.Close();return false;"></i>' + 52 '<' + spanOrDiv + ' class="Scrollable" id="' + this.DialogID + '_Content"></' + spanOrDiv + '>' + 53 '</div>' + 54 '<div class="ITDialogFiller"></div>' + 55 '</div>' + 56 '<div class="ITDialogFiller"></div>' + 57 '</div>'; 58 $('body').append(dialogHTML); 59 } 60} 61ITDialog.prototype = { 62 DialogID: '', 63 Width: 0, 64 Height: 0, 65 OnOpenFunc: null, 66 Title: ' ', 67 VarName: '', 68 FitToContents: false, 69 Open: function () { 70 if (this.SelectorContentHoldingContainer !== null) { 71 $("#" + this.DialogID + "_Content").append(this.SelectorContentHoldingContainer.children()); 72 } 73 if (this.OnOpenFunc) { 74 this.OnOpenFunc(); 75 } 76 $('#' + this.DialogID + "_container").removeClass("hidden"); 77 }, 78 Close: function () { 79 $('#' + this.DialogID + "_container").addClass("hidden"); 80 if (this.SelectorContentHoldingContainer !== null) { 81 this.SelectorContentHoldingContainer.append($("#" + this.DialogID + "_Content").children()); 82 } 83 }, 84 SetWidth: function(width){ 85 $('#' + this.DialogID).css({ width: width + 'px' }); 86 }, 87 SetHeight: function(height){ 88 $('#' + this.DialogID).css({ height: height + 'px' }); 89 }, 90 AdjustToContentsWidth: function(){ 91 $('#' + this.DialogID).css('width', 'auto'); 92 }, 93 AdjustToContentsHeight: function(){ 94 $('#' + this.DialogID).css('height', 'auto'); 95 }, 96 SetTitle: function(title){ 97 $('#' + this.DialogID + '_Title').html(title); 98 }, 99 SetOnOpenFunc: function(strFunc){ 100 this.OnOpenFunc = strFunc; 101 }, 102 SetContent: function(content){ 103 $('#' + this.DialogID + '_Content').html(content); 104 }, 105 AdjustToContents: function(){ 106 this.AdjustToContentsWidth(); 107 this.AdjustToContentsHeight(); 108 }, 109 ShouldFitDialogToContents: function(){ 110 return this.FitToContents || (this.Height == 0 && this.Width == 0); 111 } 112} 113 114 115var Issuetrak = Issuetrak || {}; 116 117Issuetrak.DialogInteractor = function() 118{ 119 this.initialize(); 120}; 121 122Issuetrak.DialogInteractor.prototype.initialize = function() 123{ 124 $(document).ready(function() 125 { 126 $(document).on("click", ".triggerCloseWindow", function() 127 { 128 window.close(); 129 }); 130 }); 131} 132 133var dialogInteractor = new Issuetrak.DialogInteractor();
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.