Guest User

Untitled

a guest
Apr 21st, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var context_object;
  2. var d = new Date();
  3. var user_timezone = 'GMT'+ (-d.getTimezoneOffset()/60);
  4. setCookie('timezone', user_timezone);
  5.  
  6. $(function(){
  7.     $('body').append('<img id="main-loading" src="/'+versionDir+'images/cog.gif" alt=""/>');
  8.  
  9.     contextMenu();
  10.     initTabs();
  11.     initjQueryUi();
  12.     initCompanySelect();
  13.  
  14.     $('.domk').live('keyup',function(){
  15.         doMK(this);
  16.     });
  17.  
  18.     $('a[href$="edit/Company"]').parent().remove();
  19.  
  20.     if($('.tabs .secondary').size() < 2){
  21.         $('.tabs .secondary').remove();
  22.     }
  23.  
  24.     $('.date_input').live('keyup',function(){
  25.         doDate($(this));
  26.     });
  27.    
  28.     $('.setl_date_input').live('keyup',function(){
  29.         doDate($(this));
  30.     });
  31.  
  32.     $('.icon-nav img').mouseenter(
  33.         function(){
  34.             jump($(this));
  35.         }
  36.         );
  37.  
  38.     $(".tooltip").tipTip();
  39.  
  40.     toolTips();
  41.  
  42.     $(document).ajaxStart(function(h) {
  43.         showLoading();
  44.     });
  45.  
  46.     $(document).ajaxStop(function() {
  47.         toolTips();
  48.         initjQueryUi();
  49.         hideLoading();
  50.     });
  51.    
  52.     inputDatePicker();
  53.  
  54.     function unloadPage(){
  55.         showLoading();
  56.     }
  57.     window.onbeforeunload = unloadPage;
  58.  
  59.     $(document).ready(function(){
  60.         //hideLoading();
  61.         });
  62.    
  63.     $(document).keydown(function(e) {
  64.         if (e.keyCode == 27) {
  65.             Dialog.closeAll();
  66.         }
  67.     });
  68. });
  69.  
  70. function inputDatePicker(){
  71.     $('.date_input').live('click', function(){
  72.         $(this).datepicker({
  73.             constrainInput: false,
  74.             showOn: 'focus',
  75.             dateFormat: 'mm-dd-yy',
  76.             beforeShowDay: function (date){
  77.                 for (i = 0; i < calendarEvents.length; i++) {
  78.                     if (date.getMonth() == calendarEvents[i][0] - 1
  79.                         && date.getDate() == calendarEvents[i][1]
  80.                         && (!calendarEvents[i][2] || date.getFullYear() == calendarEvents[i][2])) {
  81.                         return [false,"ui-state-active","Event Name"];
  82.                     }
  83.                 }
  84.                 return [true, ""];//enable all other days
  85.             }
  86.         }).focus();
  87.     });
  88.    
  89.     $('.setl_date_input').live('click', function(){
  90.         var startdate = null;
  91.         if($('.window_forward').is(':checked') && $('#settlement_date_input_begin').val().length != 0){
  92.             startdate = $('#settlement_date_input_begin').val();
  93.             console.log(startdate);
  94.         }
  95.         $(this).datepicker({
  96.             constrainInput: false,
  97.             showOn: 'focus',
  98.             dateFormat: 'mm-dd-yy',
  99.             defaultDate: startdate,
  100.             beforeShowDay: function (date){
  101.                 for (i = 0; i < calendarEvents.length; i++) {
  102.                     if (date.getMonth() == calendarEvents[i][0] - 1
  103.                         && date.getDate() == calendarEvents[i][1]
  104.                         && (!calendarEvents[i][2] || date.getFullYear() == calendarEvents[i][2])) {
  105.                         return [false,"ui-state-active","Event Name"];
  106.                     }
  107.                 }
  108.                 return [true, ""];//enable all other days
  109.             }
  110.         }).focus();
  111.     });
  112.    
  113.    
  114. }
Add Comment
Please, Sign In to add comment