Guest User

Untitled

a guest
Feb 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         function getDayDetails(diffmonth,month,day){
  2.             if ( diffmonth != 0 ) {
  3.                 url = '/cal/feeds/day/getDayChanges/{{year}}/'+diffmonth+'/'+day+'/{{type}}/?{% if canc %}canc=True&{% endif %}search={{search}}&';
  4.             } else{
  5.                 url = '/cal/feeds/day/getDayChanges/{{year}}/'+month+'/'+day+'/{{type}}/?{% if canc %}canc=True&{% endif %}search={{search}}&';
  6.             }
  7.             request = new Request.HTML({
  8.                 method: 'get',
  9.                 url: url ,
  10.                 //update:'result',
  11.                 async: true,
  12.                 onSuccess: function(responseTree, responseElements, responseHTML, responseJavaScript) {    
  13.                     var response = responseHTML;
  14.                     if ( diffmonth != 0 ) {
  15.                         id = 'id'+diffmonth+day
  16.                     } else{
  17.                         id = 'id'+month+day
  18.                     }
  19.                     $(id).innerHTML = response
  20.                 }
  21.            
  22.             }).send();
  23.             myRequestStack.include(request)
  24.         }
  25.         function initiateLoad(){
  26.                 {% for week in month_days %}
  27.                     {% for day, entries, diffmonth in week %}
  28.                         getDayDetails({{diffmonth}},{{month}}, {{day}})
  29.                     {% endfor %}
  30.                 {% endfor %}
  31.         }
  32.         var myRequestStack = []; // public!
  33.         window.addEvent('domready', function() {
  34.             $$('a').addEvent('click', function(){myRequestStack.invoke('cancel')});        
  35.         initiateLoad();
  36.         });
Add Comment
Please, Sign In to add comment