// ROOT JQUERY --> // JavaScript Document var lastChecked = null; $(datepickers);function datepickers(){ $( "#datepicker" ).datepicker(); $( "#format" ).change(function() { $( "#datepicker" ).datepicker(); }); $( "#datepicker1" ).datepicker(); $( "#format" ).change(function() { $( "#datepicker1" ).datepicker(); }); $( "#datepicker2" ).datepicker(); $( "#format" ).change(function() { $( "#datepicker2" ).datepicker(); }); $( "#datepicker3" ).datepicker(); $( "#format" ).change(function() { $( "#datepicker3" ).datepicker(); }); $( "#datepicker2month1" ).datepicker({ numberOfMonths: 2, showButtonPanel: true }); $( "#format" ).change(function() { $( "#datepicker2month1" ).datepicker(); }); /*datetime pickers */ $('#datetime1').datetimepicker(); $('#datetime2').datetimepicker(); $('#datetime3').datetimepicker(); $('#datetime4').datetimepicker(); $('#datetime5').datepicker({ numberOfMonths: 2 }); $('#datetime6').datetimepicker({ controlType: 'select', oneLine: true, timeFormat: 'hh:mm tt', altField: "#datetime6_alt", altFieldTimeOnly: false }); } $(general);function general(){ //$(".error").click(function() { $(".error").hide("fast")}); //$(".toggle").click(function() { $(".page_header_container").slideToggle("medium")}); var $cbs= $('.tablesorter tbody tr'); // $(this).toggleClass('selected_item'); $cbs .filter(':has(:checkbox:checked)') .addClass('hover2') .end() .click(function(event) { if (event.target.type !== 'checkbox') { $(':checkbox', this).attr('checked', function() { return !this.checked; }); } }); var $cbs2= $('.mvtable tbody tr'); $cbs2 .filter(':has(:checkbox:checked)') .addClass('hover2') .end() .click(function(event) { if (event.target.type !== 'checkbox') { $(':checkbox', this).attr('checked', function() { return !this.checked; }); } }); /*$cbs. change(function () { $("input:checkbox") .prop('checked', $(this) .prop("checked")); });*/ var $div= $('.fsa_choice'); $div .filter(':has(:checkbox:checked)') .addClass('hover') .end() .click(function(event) { //$(this).toggleClass('selected_item'); /*if($('.case').is(':checked')){ $(this).find('td').each(function(){ $(this).css("background",""); }); } else { $(this).find('td').each(function(){ $(this).css("background","green"); }); }*/ if (event.target.type !== 'checkbox') { $(':checkbox', this).attr('checked', function() { return !this.checked; }); } }); /*$cbs.click(select); function select(){ $(this).find('td').each(function(){ $(this).toggleClass('selected_item_2'); //$(this).css("background","green"); }); } */ $cbs.hover( // Hover over function() { $(this).addClass('hover'); // Hover out }, function() { $(this).removeClass('hover'); }); $cbs2.hover( // Hover over function() { $(this).addClass('checky'); // Hover out }, function() { $(this).removeClass('checky'); }); $div.hover( // Hover over function() { $(this).addClass('hover'); // Hover out }, function() { $(this).removeClass('hover'); }); /*var ass=$(".step1item"); ass .filter(':has(:checkbox:checked)') .end() .click(function(event) { $(this).toggleClass('selected_item'); if (event.target.type !== 'checkbox') { $(':checkbox', this).attr('checked', function() { return !this.checked; }); } });*/ /* $('#rowclick5add tr').click(function(event) { $(this).parent("tr").addClass('selected_item'); }); */ $(".agent").click(function() { $("#agent").toggleClass("selected_item")}); $(".scheduled").click(function() { $("#scheduled").toggleClass("selected_item")}); $(".actual").click(function() { $("#actual").toggleClass("selected_item")}); var $selectall = $("#selectall"); $selectall .click(function () { $('.chkbox').attr('checked', this.checked); if($(".chkbox").length == $(".case:checked").length) { $cbs.addClass('checky'); } else { $cbs.removeClass('checky'); } }); $('.chkbox').click(function(e) { var $chkboxes = $('.chkbox'); //if ($(this).attr('checked')) { // $(this).closest('tr').addClass('checky'); //} else { // $(this).closest('tr').removeClass('checky'); //} if(!lastChecked) { lastChecked = this; return; } if(e.shiftKey) { var start = $chkboxes.index(this); var end = $chkboxes.index(lastChecked); $chkboxes.slice(Math.min(start,end), Math.max(start,end)+ 1).attr('checked', lastChecked.checked); if(lastChecked.checked){ $chkboxes.slice(Math.min(start,end), Math.max(start,end)+ 1).closest('tr').addClass('checky'); } else { $chkboxes.slice(Math.min(start,end), Math.max(start,end)+ 1).closest('tr').removeClass('checky'); } } lastChecked = this; }); } $(tablesorter);function tablesorter(){ // Original hover function, which also makes a line clickable //New Click on Table Row and open url //looks for url tag and opens the location withing the url tag var row = $(".tablesorter tr"); row.click( function(){ if( $(this).attr("url").length ) { var loc=$(this).attr("url"); window.location = $(this).attr("url"); } }); var row = $(".display tr"); row.click( function(){ if( $(this).attr("url").length ) { var loc=$(this).attr("url"); window.location = $(this).attr("url"); } }); //New Click on Table Row and open url ENDS //in the works $("#checkAll").change(function () { $(".chkbox").prop('checked', $(this).prop("checked")); }); //in the works ends //this function will be removed $("#listrow tr").hover( // Hover over function() { $(this).addClass('hover'); if($(this).attr("url") !== undefined) { $(this).click(function(){ window.location = $(this).attr("url"); }); } // Hover out }, function() { $(this).removeClass('hover'); }); //this function will be removed END $(".tablesorter").click(function() { $('.chkbox').each(function() { var check=$(this).is(":checked"); if(check==1){ //console.log("check is 1"); $(this).closest('tr').addClass('checky'); } else { //console.log("check is 0"); $(this).closest('tr').removeClass('checky'); } }); }); }