/[Frey]/trunk/static/Frey/View/NoPager.js
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/static/Frey/View/NoPager.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 962 by dpavlin, Wed Jan 7 17:50:03 2009 UTC revision 963 by dpavlin, Wed Jan 7 20:31:51 2009 UTC
# Line 13  var checker; Line 13  var checker;
13  var v;  var v;
14  var cookie = 'no_pager';  var cookie = 'no_pager';
15    
16  function load_page() {  function load_next_page() {
17    
18          setCookie(cookie+"_height", getScrollHeight() );          setCookie(cookie+"_height", getScrollHeight() );
19          setCookie(cookie+"_scroll", getScrollHeight() - _getWindowHeight() );          setCookie(cookie+"_scroll", getScrollHeight() - _getWindowHeight() );
20    
# Line 35  function load_page() { Line 36  function load_page() {
36          setCookie( cookie+'_page', v.page );          setCookie( cookie+'_page', v.page );
37          isUpdating = true;          isUpdating = true;
38    
39            var old_status = $('#status').html;
40    
41          $('#status').html(          $('#status').html(
42                  'Loading page '+ v.page + '...'                  'Loading page '+ v.page + '...'
43          );          );
44    
45            console.log( 'v = ', v );
46    
47          $.get(          $.get(
48                  "/Frey::View::NoPager/results_as_markup",                  "/Frey::View::NoPager/results_as_markup",
49                  {                  {
# Line 46  function load_page() { Line 51  function load_page() {
51                          search: v.search                          search: v.search
52                  },                  },
53                  function ( response ) {                  function ( response ) {
                           
54                          $('#next_page').html( response );                          $('#next_page').html( response );
55    
56                          eval( 'v=' + $('#json').val() );                          var resp_v;
57                            eval( 'resp_v=' + $('#json').val() );
58                            console.log( 'resp_v = ', resp_v );
59    
60                            // restore status line
61                            $('#status').html( resp_v.status || old_status );
62    
63                          isUpdating = false;                          isUpdating = false;
                         $('#status').html( v.status );  
64                  }                  }
65          );          );
66    
# Line 71  $(document).ready( function() { Line 79  $(document).ready( function() {
79    
80          var cookie_id = getCookie(cookie+'_id') || 0;          var cookie_id = getCookie(cookie+'_id') || 0;
81    
82          $.log.debug("Page ID:" + v.id);          console.debug( v );
83          $.log.debug("Page Cookie:" + cookie_id);          $.log.debug("Page Cookie:" + cookie_id);
84    
85          var fromBackButton = false;          var fromBackButton = false;
# Line 97  $(document).ready( function() { Line 105  $(document).ready( function() {
105          });          });
106    
107          checker = setInterval(function () {          checker = setInterval(function () {
108                  load_page();                  load_next_page();
109          }, 100);          }, 100);
110    
111    

Legend:
Removed from v.962  
changed lines
  Added in v.963

  ViewVC Help
Powered by ViewVC 1.1.26