//Include json2-min.js only for borwsers that do not have native support for JSON object var JSON; var currentRow; if (!JSON){ includeJson2 = document.createElement('script'); includeJson2.type = "text/javascript"; includeJson2.src = "cui/js/json2-min.js"; document.getElementsByTagName('head')[0].appendChild(includeJson2); } //Common function initUi() { // document.getElementById('username').value = "Mahesh.Tummala@Sabre.com"; //for testing $("input:submit").button(); colorTableRows(); initButtonIcons(); } function colorTableRows() { $(".tableContent > tbody > tr:nth-child(even)").addClass("evenColored"); $(".tableContent > tbody > tr:nth-child(odd)").addClass("oddColored"); } // Used in CL reports function initButtonIcons() { $("a#exportReport").button({icons:{ primary:"ui-icon-document"}}); $(".helpIcon").tooltip({offset:[-80, -110]}); } function initTables(tableId) { $('#' + tableId).dataTable({ "oLanguage":dataTableLanguage, "sPaginationType":"button_numbers", "bScrollCollapse":true, "bSort":false, "bFilter":true, "sScrollX":"100%", "aLengthMenu":[10, 20, 30], "sDom":"lrtip" }); } // Right now Used in AMS and TB Statement pages function openStatementDetailDialog(url, viewName, minHeight, titleName) { var waitDiv = '#' + viewName + 'Loading'; // $(waitDiv).show(); $('#' + viewName + 'Transaction').html(''); $('#' + viewName + 'Dialog').load(url, function (response, status, xhr) { if(response.indexOf("") != -1){ document.location.reload(true); } // $(waitDiv).hide(); }).dialog({modal:true, width:700, height:'auto', minHeight:minHeight, resizable:false, position:'center', title:titleName, open: function () { $('#' + viewName + 'Dialog').load(url, function (response, status, xhr) { if (response.indexOf("") == -1) { $('#' + viewName + 'Dialog').attr('tabindex','0'); $('#' + viewName + 'Dialog').focus(); $('#' +'ui-dialog-title-'+ viewName + 'Dialog').attr('role','heading').attr('aria-level','3'); $("div[class='ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable']").attr('aria-modal','true'); } }) } }); return false; } function openStatementDialog(url, viewName, minHeight, titleName) { // $('#' + viewName + 'Transaction').html(''); $('#' + viewName + 'Dialog').load('include/txnImgLoad.html', function (response, status, xhr) { /* if(response.indexOf("") != -1){ document.location.reload(true); }*/ }).dialog({modal:true, width:700, height:'auto', minHeight:minHeight, resizable:false, position:'center', title:titleName, open: function () { $('#' + viewName + 'Dialog').attr('tabindex','0'); $('#' + viewName + 'Dialog').focus(); $('#' +'ui-dialog-title-'+ viewName + 'Dialog').attr('role','heading').attr('aria-level','3'); $("div[class='ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable']").attr('aria-modal','true'); $("#periodTable").on('click','.ticketNumber',function(e){ currentRow=e.target.id; }); }, close: function() { $('#' + currentRow).focus(); //document.getElementById(currentRow).focus(); } }); openStatementDetailDialog(url, viewName, minHeight, titleName) return false; } //accessibility related changes function autofousText() { $('#username').focus(); } //dialog fix $(document).on('keydown', function(e) { var target = e.target; var shiftPressed = e.shiftKey; // If TAB key pressed if (e.keyCode == 9) { // If inside a Modal dialog (determined by attribute role="dialog") if ($(target).parents('[role=dialog]').length || $(target).children('[role=dialog]').length) { // Find first or last input element in the dialog parent (depending on whether Shift was pressed). // Input elements must be visible, and can be Input/Select/Button/Textarea. var borderElem = shiftPressed ? $(target).closest('[role=dialog]').find('input:visible,select:visible,button:visible,textarea:visible,div:visible').first() : $(target).closest('[role=dialog]').find('input:visible,select:visible,button:visible,textarea:visible,div:visible').last(); if ($(borderElem).length) { if ($(target).is($(borderElem))) { return false; } else { return true; } } } } if($("#resetNoticeBlock").is(":visible")){ $("#resetClose").focus() } return true; }); $(document).ready(function () { $("div[id='bannerLogo']").contents().unwrap().wrap('
'); $('a').click(function(){ var x = $(this).parent(); if ($(x).attr("id")=="flagIcons") { var pos = $(this).attr("title"); $("a").attr("title",pos+"is the now selected by the user"); } }); });;