/[jquery]/no_pager/no_pager.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 /no_pager/no_pager.js

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

revision 2 by dpavlin, Tue Aug 15 15:43:31 2006 UTC revision 10 by dpavlin, Wed Aug 16 01:02:00 2006 UTC
# Line 19  function favorite( image, feedID ){ Line 19  function favorite( image, feedID ){
19    
20  function getMoreHistory(){  function getMoreHistory(){
21          var indexVal = getElement("history_index").value;          var indexVal = getElement("history_index").value;
22          var xmlDoc = doSimpleXMLHttpRequest("index.cgi/snippet", {index: indexVal, q: document.getElementById('q').value });          var q = getElement('q').value;
23            getElement('status').innerHTML = 'Loading page '+ ( parseInt(indexVal) + 1 ) + '...';
24            var xmlDoc = doSimpleXMLHttpRequest("index.cgi/snippet", {index: indexVal, q: q});
25          xmlDoc.addCallbacks(addMoreHistory, failure);          xmlDoc.addCallbacks(addMoreHistory, failure);
26  }  }
27    
# Line 38  function addMoreHistory( xmlDoc ){ Line 40  function addMoreHistory( xmlDoc ){
40          var index_el = getElement("history_index");          var index_el = getElement("history_index");
41          var indexVal = parseInt(index_el.value);          var indexVal = parseInt(index_el.value);
42    
43  // minimum response length?          // minimum response length?
44          if (response.length < 300){          if (response.length < 500){
45                                    
46             showElement("footer")             showElement("footer")
47             if( indexVal > 0 ){             if( indexVal > 0 ){
# Line 48  function addMoreHistory( xmlDoc ){ Line 50  function addMoreHistory( xmlDoc ){
50                                             );                                             );
51             }else{             }else{
52                     var out = H2({'style':'text-align:center; font-style:italic; padding: 2em;'},                     var out = H2({'style':'text-align:center; font-style:italic; padding: 2em;'},
53                                                  "No posts matched your search."                                                  "No results matched your search."
54                                             );                                             );
55             }             }
56             replaceChildNodes( "more_history", out )             replaceChildNodes( "more_history", out )
57               getElement("status").innerHTML = '';
58             return;             return;
59          }          }
60    
# Line 67  function addMoreHistory( xmlDoc ){ Line 70  function addMoreHistory( xmlDoc ){
70          swapDOM( "more_history", new_history );          swapDOM( "more_history", new_history );
71                    
72          isUpdating = false;          isUpdating = false;
73    
74            var status_update = getElement("status_update");
75            var status = getElement("status");
76            if (status_update && status) {
77                    status.innerHTML = status_update.innerHTML;
78                    log("status updated");
79            }
80    
81  }  }
82    
83  function updatePage(){  function updatePage(){
84          if ( isUpdating == false          if ( isUpdating == false
85                     && mouseState == "up"                          && mouseState == "up"
86                     && getPageHeight() - getScrollHeight() < preloadDistance){                          && getPageHeight() - getScrollHeight() < preloadDistance){
87          log("Getting segment: ", $("history_index").value);                  log("Getting segment: ", $("history_index").value);
88          setCookie(id, $("history_index").value );                  setCookie(id, $("history_index").value );
89          isUpdating = true;                  isUpdating = true;
90                  getMoreHistory();                  getMoreHistory();
91          }          }
92          checker.cancel();          checker.cancel();

Legend:
Removed from v.2  
changed lines
  Added in v.10

  ViewVC Help
Powered by ViewVC 1.1.26