6 |
2006-08-16 Dobrica Pavlinusic <dpavlin@rot13.org> |
2006-08-16 Dobrica Pavlinusic <dpavlin@rot13.org> |
7 |
*/ |
*/ |
8 |
|
|
9 |
var preloadDistance = 1000; |
var preloadDistance = _getWindowHeight() * 2; |
10 |
var isUpdating = false; |
var isUpdating = false; |
11 |
var isMouseDown = false; |
var isMouseDown = false; |
12 |
var checker; |
var checker; |
42 |
'Loading page '+ v.page + '...' |
'Loading page '+ v.page + '...' |
43 |
); |
); |
44 |
|
|
45 |
console.log( 'v = ', v ); |
//console.log( 'v = ', v ); |
46 |
|
|
47 |
$.get( |
$.get( |
48 |
"/Frey::View::NoPager/results_as_markup", |
"/Frey::View::NoPager/results_as_markup", |
51 |
search: v.search |
search: v.search |
52 |
}, |
}, |
53 |
function ( response ) { |
function ( response ) { |
54 |
$('#next_page').html( response ); |
var next_page = $( '#next_page_' + v.page ); |
55 |
|
next_page.hide(); |
56 |
|
$( '#results' ).append( '<!-- appended page ' + v.page + ' -->' + response ); |
57 |
|
|
58 |
var resp_v; |
var resp_v; |
59 |
eval( 'resp_v=' + $('#json').val() ); |
eval( 'resp_v=' + $('#json').val() ); |
60 |
console.log( 'resp_v = ', resp_v ); |
//console.log( 'resp_v = ', resp_v ); |
61 |
|
|
62 |
|
// record ID so we can detect back-button |
63 |
|
v.id = resp_v.id; |
64 |
|
|
65 |
// restore status line |
// restore status line |
66 |
$('#status').html( resp_v.status || old_status ); |
$('#status').html( resp_v.status || old_status ); |
84 |
|
|
85 |
var cookie_id = getCookie(cookie+'_id') || 0; |
var cookie_id = getCookie(cookie+'_id') || 0; |
86 |
|
|
87 |
console.debug( v ); |
//console.debug( 'ready', v ); |
88 |
$.log.debug("Page Cookie:" + cookie_id); |
$.log.debug("Page Cookie:" + cookie_id); |
89 |
|
|
90 |
|
/* FIXME |
91 |
var fromBackButton = false; |
var fromBackButton = false; |
92 |
if ( cookie_id == v.id ) { |
if ( cookie_id == v.id ) { |
93 |
fromBackButton = true; |
fromBackButton = true; |
102 |
$('#spacer').height( getCookie(cookie+'_height')+"px" ); |
$('#spacer').height( getCookie(cookie+'_height')+"px" ); |
103 |
scroll( 0, getCookie(cookie+'_scroll') ); |
scroll( 0, getCookie(cookie+'_scroll') ); |
104 |
} |
} |
105 |
|
*/ |
106 |
|
|
107 |
$(window).mousedown( function () { |
$(window).mousedown( function () { |
108 |
isMouseDown = true; |
isMouseDown = true; |