Lines 278-280
function replace_html_date( original_node, id, format ) {
Link Here
|
278 |
script.text = script_content; |
278 |
script.text = script_content; |
279 |
$(original_node).append( script ); |
279 |
$(original_node).append( script ); |
280 |
} |
280 |
} |
|
|
281 |
$.fn.dataTableExt.oPagination.four_button = { |
282 |
/* |
283 |
* Function: oPagination.four_button.fnInit |
284 |
* Purpose: Initalise dom elements required for pagination with a list of the pages |
285 |
* Returns: - |
286 |
* Inputs: object:oSettings - dataTables settings object |
287 |
* node:nPaging - the DIV which contains this pagination control |
288 |
* function:fnCallbackDraw - draw function which must be called on update |
289 |
*/ |
290 |
"fnInit": function ( oSettings, nPaging, fnCallbackDraw ) |
291 |
{ |
292 |
nFirst = document.createElement( 'span' ); |
293 |
nPrevious = document.createElement( 'span' ); |
294 |
nNext = document.createElement( 'span' ); |
295 |
nLast = document.createElement( 'span' ); |
296 |
|
297 |
/* nFirst.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sFirst ) ); |
298 |
nPrevious.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sPrevious ) ); |
299 |
nNext.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sNext ) ); |
300 |
nLast.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sLast ) );*/ |
301 |
|
302 |
nFirst.className = "paginate_button first"; |
303 |
nPrevious.className = "paginate_button previous"; |
304 |
nNext.className="paginate_button next"; |
305 |
nLast.className = "paginate_button last"; |
306 |
|
307 |
nPaging.appendChild( nFirst ); |
308 |
nPaging.appendChild( nPrevious ); |
309 |
nPaging.appendChild( nNext ); |
310 |
nPaging.appendChild( nLast ); |
311 |
|
312 |
$(nFirst).click( function () { |
313 |
oSettings.oApi._fnPageChange( oSettings, "first" ); |
314 |
fnCallbackDraw( oSettings ); |
315 |
} ); |
316 |
|
317 |
$(nPrevious).click( function() { |
318 |
oSettings.oApi._fnPageChange( oSettings, "previous" ); |
319 |
fnCallbackDraw( oSettings ); |
320 |
} ); |
321 |
|
322 |
$(nNext).click( function() { |
323 |
oSettings.oApi._fnPageChange( oSettings, "next" ); |
324 |
fnCallbackDraw( oSettings ); |
325 |
} ); |
326 |
|
327 |
$(nLast).click( function() { |
328 |
oSettings.oApi._fnPageChange( oSettings, "last" ); |
329 |
fnCallbackDraw( oSettings ); |
330 |
} ); |
331 |
|
332 |
/* Disallow text selection */ |
333 |
$(nFirst).bind( 'selectstart', function () { return false; } ); |
334 |
$(nPrevious).bind( 'selectstart', function () { return false; } ); |
335 |
$(nNext).bind( 'selectstart', function () { return false; } ); |
336 |
$(nLast).bind( 'selectstart', function () { return false; } ); |
337 |
}, |
338 |
|
339 |
/* |
340 |
* Function: oPagination.four_button.fnUpdate |
341 |
* Purpose: Update the list of page buttons shows |
342 |
* Returns: - |
343 |
* Inputs: object:oSettings - dataTables settings object |
344 |
* function:fnCallbackDraw - draw function which must be called on update |
345 |
*/ |
346 |
"fnUpdate": function ( oSettings, fnCallbackDraw ) |
347 |
{ |
348 |
if ( !oSettings.aanFeatures.p ) |
349 |
{ |
350 |
return; |
351 |
} |
352 |
|
353 |
/* Loop over each instance of the pager */ |
354 |
var an = oSettings.aanFeatures.p; |
355 |
for ( var i=0, iLen=an.length ; i<iLen ; i++ ) |
356 |
{ |
357 |
var buttons = an[i].getElementsByTagName('span'); |
358 |
if ( oSettings._iDisplayStart === 0 ) |
359 |
{ |
360 |
buttons[0].className = "paginate_disabled_first"; |
361 |
buttons[1].className = "paginate_disabled_previous"; |
362 |
} |
363 |
else |
364 |
{ |
365 |
buttons[0].className = "paginate_enabled_first"; |
366 |
buttons[1].className = "paginate_enabled_previous"; |
367 |
} |
368 |
|
369 |
if ( oSettings.fnDisplayEnd() == oSettings.fnRecordsDisplay() ) |
370 |
{ |
371 |
buttons[2].className = "paginate_disabled_next"; |
372 |
buttons[3].className = "paginate_disabled_last"; |
373 |
} |
374 |
else |
375 |
{ |
376 |
buttons[2].className = "paginate_enabled_next"; |
377 |
buttons[3].className = "paginate_enabled_last"; |
378 |
} |
379 |
} |
380 |
} |
381 |
}; |