1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-01-30 23:52:11 +01:00

Merge branch 'master' into adjust

Conflicts:
	media/js/jquery.dataTables.js
This commit is contained in:
Sahab Yazdani 2011-06-30 16:13:56 -04:00
commit cf0611258f
16 changed files with 235 additions and 110 deletions

View File

@ -61,7 +61,8 @@
{
if ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == "true" )
{
$sOrder .= $aColumns[ intval( $_GET['iSortCol_'.$i] ) ]."
$iColumnIndex = array_search( $_GET['mDataProp_'.$_GET['iSortCol_'.$i]], $aColumns );
$sOrder .= $aColumns[ $iColumnIndex ]."
".mysql_real_escape_string( $_GET['sSortDir_'.$i] ) .", ";
}
}
@ -105,7 +106,8 @@
{
$sWhere .= " AND ";
}
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string($_GET['sSearch_'.$i])."%' ";
$iColumnIndex = array_search( $_GET['mDataProp_'.$i], $aColumns );
$sWhere .= $aColumns[$iColumnIndex]." LIKE '%".mysql_real_escape_string($_GET['sSearch_'.$i])."%' ";
}
}

View File

@ -1,6 +1,6 @@
/*
/*
* File: jquery.dataTables.js
* Version: 1.8.1.dev
* Version: 1.8.2.dev
* Description: Paginate, search and sort HTML tables
* Author: Allan Jardine (www.sprymedia.co.uk)
* Created: 28/3/2008
@ -25,7 +25,7 @@
* When considering jsLint, we need to allow eval() as it it is used for reading cookies
*/
/*jslint evil: true, undef: true, browser: true */
/*globals $, jQuery,_fnExternApiFunc,_fnInitalise,_fnInitComplete,_fnLanguageProcess,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxUpdateDraw,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnCalculateEnd,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnArrayCmp,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnReOrderIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn*/
/*globals $, jQuery,_fnExternApiFunc,_fnInitalise,_fnInitComplete,_fnLanguageProcess,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnCalculateEnd,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnArrayCmp,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnReOrderIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn*/
(function($, window, document) {
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
@ -67,7 +67,7 @@
* Notes: Allowed format is a.b.c.d.e where:
* a:int, b:int, c:int, d:string(dev|beta), e:int. d and e are optional
*/
_oExt.sVersion = "1.8.1.dev";
_oExt.sVersion = "1.8.2.dev";
/*
* Variable: sErrMode
@ -2138,9 +2138,6 @@
/* Flag to note that the table is currently being destoryed - no action should be taken */
oSettings.bDestroying = true;
/* Blitz all DT events */
$(oSettings.nTableWrapper).find('*').andSelf().unbind('.DT');
/* Restore hidden columns */
for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
{
@ -2150,6 +2147,9 @@
}
}
/* Blitz all DT events */
$(oSettings.nTableWrapper).find('*').andSelf().unbind('.DT');
/* If there is an 'empty' indicator row, remove it */
$('tbody>tr>td.'+oSettings.oClasses.sRowEmpty, oSettings.nTable).parent().remove();
@ -2220,7 +2220,7 @@
}
/* Restore the width of the original table */
if ( oSettings.bAutoWidth === true )
if ( oSettings.oFeatures.bAutoWidth === true )
{
oSettings.nTable.style.width = _fnStringToCss(oSettings.sDestroyWidth);
}
@ -2247,7 +2247,7 @@
/*
* Function: fnAdjustColumnSizing
* Purpose: Update table sizing based on content. This would most likely be used for scrolling
* Purpose: Update tale sizing based on content. This would most likely be used for scrolling
* and will typically need a redraw after it.
* Returns: -
* Inputs: bool:bRedraw - redraw the table or not, you will typically want to - default true
@ -3429,56 +3429,10 @@
{
if ( oSettings.bAjaxDataGet )
{
oSettings.iDraw++;
_fnProcessingDisplay( oSettings, true );
var iColumns = oSettings.aoColumns.length;
var aoData = [];
var i;
/* Paging and general */
oSettings.iDraw++;
aoData.push( { "name": "sEcho", "value": oSettings.iDraw } );
aoData.push( { "name": "iColumns", "value": iColumns } );
aoData.push( { "name": "sColumns", "value": _fnColumnOrdering(oSettings) } );
aoData.push( { "name": "iDisplayStart", "value": oSettings._iDisplayStart } );
aoData.push( { "name": "iDisplayLength", "value": oSettings.oFeatures.bPaginate !== false ?
oSettings._iDisplayLength : -1 } );
/* Filtering */
if ( oSettings.oFeatures.bFilter !== false )
{
aoData.push( { "name": "sSearch", "value": oSettings.oPreviousSearch.sSearch } );
aoData.push( { "name": "bRegex", "value": oSettings.oPreviousSearch.bRegex } );
for ( i=0 ; i<iColumns ; i++ )
{
aoData.push( { "name": "sSearch_"+i, "value": oSettings.aoPreSearchCols[i].sSearch } );
aoData.push( { "name": "bRegex_"+i, "value": oSettings.aoPreSearchCols[i].bRegex } );
aoData.push( { "name": "bSearchable_"+i, "value": oSettings.aoColumns[i].bSearchable } );
}
}
/* Sorting */
if ( oSettings.oFeatures.bSort !== false )
{
var iFixed = oSettings.aaSortingFixed !== null ? oSettings.aaSortingFixed.length : 0;
var iUser = oSettings.aaSorting.length;
aoData.push( { "name": "iSortingCols", "value": iFixed+iUser } );
for ( i=0 ; i<iFixed ; i++ )
{
aoData.push( { "name": "iSortCol_"+i, "value": oSettings.aaSortingFixed[i][0] } );
aoData.push( { "name": "sSortDir_"+i, "value": oSettings.aaSortingFixed[i][1] } );
}
for ( i=0 ; i<iUser ; i++ )
{
aoData.push( { "name": "iSortCol_"+(i+iFixed), "value": oSettings.aaSorting[i][0] } );
aoData.push( { "name": "sSortDir_"+(i+iFixed), "value": oSettings.aaSorting[i][1] } );
}
for ( i=0 ; i<iColumns ; i++ )
{
aoData.push( { "name": "bSortable_"+i, "value": oSettings.aoColumns[i].bSortable } );
}
}
var aoData = _fnAjaxParameters( oSettings );
oSettings.fnServerData.call( oSettings.oInstance, oSettings.sAjaxSource, aoData,
function(json) {
@ -3492,6 +3446,71 @@
}
}
/*
* Function: _fnAjaxParameters
* Purpose: Build up the parameters in an object needed for a server-side processing request
* Returns: bool: block the table drawing or not
* Inputs: object:oSettings - dataTables settings object
*/
function _fnAjaxParameters( oSettings )
{
var iColumns = oSettings.aoColumns.length;
var aoData = [], mDataProp;
var i;
aoData.push( { "name": "sEcho", "value": oSettings.iDraw } );
aoData.push( { "name": "iColumns", "value": iColumns } );
aoData.push( { "name": "sColumns", "value": _fnColumnOrdering(oSettings) } );
aoData.push( { "name": "iDisplayStart", "value": oSettings._iDisplayStart } );
aoData.push( { "name": "iDisplayLength", "value": oSettings.oFeatures.bPaginate !== false ?
oSettings._iDisplayLength : -1 } );
for ( i=0 ; i<iColumns ; i++ )
{
mDataProp = oSettings.aoColumns[i].mDataProp;
aoData.push( { "name": "mDataProp_"+i, "value": typeof(mDataProp)=="function" ? 'function' : mDataProp } );
}
/* Filtering */
if ( oSettings.oFeatures.bFilter !== false )
{
aoData.push( { "name": "sSearch", "value": oSettings.oPreviousSearch.sSearch } );
aoData.push( { "name": "bRegex", "value": oSettings.oPreviousSearch.bRegex } );
for ( i=0 ; i<iColumns ; i++ )
{
aoData.push( { "name": "sSearch_"+i, "value": oSettings.aoPreSearchCols[i].sSearch } );
aoData.push( { "name": "bRegex_"+i, "value": oSettings.aoPreSearchCols[i].bRegex } );
aoData.push( { "name": "bSearchable_"+i, "value": oSettings.aoColumns[i].bSearchable } );
}
}
/* Sorting */
if ( oSettings.oFeatures.bSort !== false )
{
var iFixed = oSettings.aaSortingFixed !== null ? oSettings.aaSortingFixed.length : 0;
var iUser = oSettings.aaSorting.length;
aoData.push( { "name": "iSortingCols", "value": iFixed+iUser } );
for ( i=0 ; i<iFixed ; i++ )
{
aoData.push( { "name": "iSortCol_"+i, "value": oSettings.aaSortingFixed[i][0] } );
aoData.push( { "name": "sSortDir_"+i, "value": oSettings.aaSortingFixed[i][1] } );
}
for ( i=0 ; i<iUser ; i++ )
{
aoData.push( { "name": "iSortCol_"+(i+iFixed), "value": oSettings.aaSorting[i][0] } );
aoData.push( { "name": "sSortDir_"+(i+iFixed), "value": oSettings.aaSorting[i][1] } );
}
for ( i=0 ; i<iColumns ; i++ )
{
aoData.push( { "name": "bSortable_"+i, "value": oSettings.aoColumns[i].bSortable } );
}
}
return aoData;
}
/*
* Function: _fnAjaxUpdateDraw
* Purpose: Data the data from the server (nuking the old) and redraw the table
@ -3919,7 +3938,9 @@
nScrollHeadTable = nScrollHeadInner.getElementsByTagName('table')[0],
nScrollBody = o.nTable.parentNode,
i, iLen, j, jLen, anHeadToSize, anHeadSizers, anFootSizers, anFootToSize, oStyle, iVis,
iWidth, aApplied=[], iSanityWidth;
iWidth, aApplied=[], iSanityWidth,
nScrollFootInner = (o.nTFoot !== null) ? o.nScrollFoot.getElementsByTagName('div')[0] : null,
nScrollFootTable = (o.nTFoot !== null) ? nScrollFootInner.getElementsByTagName('table')[0] : null;
/*
* 1. Re-create the table inside the scrolling div
@ -3960,6 +3981,12 @@
* Get the unique column headers in the newly created (cloned) header. We want to apply the
* calclated sizes to this header
*/
if ( o.oScroll.sX === "" )
{
nScrollBody.style.width = '100%';
nScrollHeadInner.parentNode.style.width = '100%';
}
var nThs = _fnGetUniqueThs( o, nTheadSize );
for ( i=0, iLen=nThs.length ; i<iLen ; i++ )
{
@ -4020,6 +4047,20 @@
*/
iSanityWidth = $(o.nTable).outerWidth();
/* If x-scrolling is disabled, then the viewport cannot be less than the sanity width */
if ( o.oScroll.sX === "" )
{
var iCorrection = (nScrollBody.scrollHeight > nScrollBody.offsetHeight) ?
iSanityWidth+o.oScroll.iBarWidth : iSanityWidth;
nScrollBody.style.width = _fnStringToCss( iCorrection );
nScrollHeadInner.parentNode.style.width = _fnStringToCss( iCorrection );
if ( o.nTFoot !== null )
{
nScrollFootInner.parentNode.style.width = _fnStringToCss( iCorrection );
}
}
/* We want the hidden header to have zero height, so remove padding and borders. Then
* set the width based on the real headers
*/
@ -4137,10 +4178,6 @@
if ( o.nTFoot !== null )
{
var
nScrollFootInner = o.nScrollFoot.getElementsByTagName('div')[0],
nScrollFootTable = nScrollFootInner.getElementsByTagName('table')[0];
nScrollFootInner.style.width = _fnStringToCss( o.nTable.offsetWidth+o.oScroll.iBarWidth );
nScrollFootTable.style.width = _fnStringToCss( o.nTable.offsetWidth );
}
@ -6750,11 +6787,12 @@
this.oApi._fnDraw = _fnDraw;
this.oApi._fnReDraw = _fnReDraw;
this.oApi._fnAjaxUpdate = _fnAjaxUpdate;
this.oApi._fnAjaxParameters = _fnAjaxParameters;
this.oApi._fnAjaxUpdateDraw = _fnAjaxUpdateDraw;
this.oApi._fnAddOptionsHtml = _fnAddOptionsHtml;
this.oApi._fnFeatureHtmlTable = _fnFeatureHtmlTable;
this.oApi._fnScrollDraw = _fnScrollDraw;
this.oApi._fnAjustColumnSizing = this.oApi._fnAdjustColumnSizing = _fnAdjustColumnSizing;
this.oApi._fnAdjustColumnSizing = _fnAdjustColumnSizing;
this.oApi._fnFeatureHtmlFilter = _fnFeatureHtmlFilter;
this.oApi._fnFilterComplete = _fnFilterComplete;
this.oApi._fnFilterCustom = _fnFilterCustom;

8
media/js/jquery.js vendored

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,23 @@
// DATA_TEMPLATE: dom_data
oTest.fnStart( "5508 - Table container width doesn't change when filtering applied to scrolling table" );
$(document).ready( function () {
$('#example').dataTable( {
"sScrollY": "300px",
"bPaginate": false
} );
oTest.fnTest(
"Width of container 800px on init with scroll",
null,
function () { return $('div.dataTables_scrollBody').width() == 800; }
);
oTest.fnTest(
"Unaltered when filter applied",
function () { $('#example').dataTable().fnFilter('123'); },
function () { return $('div.dataTables_scrollBody').width() == 800; }
);
oTest.fnComplete();
} );

View File

@ -18,11 +18,17 @@ $(document).ready( function () {
function () { return $('select', oSettings.aanFeatures.l[0]).length == 1 }
);
oTest.fnTest(
"A label input is used",
null,
function () { return $('label', oSettings.aanFeatures.l[0]).length == 1 }
);
oTest.fnTest(
"Default is put into DOM",
null,
function () {
var anChildren = oSettings.aanFeatures.l[0].childNodes;
var anChildren = $('label',oSettings.aanFeatures.l[0])[0].childNodes;
var bReturn =
anChildren[0].nodeValue == "Show " &&
anChildren[2].nodeValue == " entries";
@ -49,8 +55,7 @@ $(document).ready( function () {
"Menu length language definition is in the DOM",
null,
function () {
var anChildren = oSettings.aanFeatures.l[0].childNodes;
return anChildren[0].nodeValue == "unit test";
return $('label', oSettings.aanFeatures.l[0]).text() == "unit test";
}
);
@ -67,7 +72,7 @@ $(document).ready( function () {
oSettings = oTable.fnSettings();
},
function () {
var anChildren = oSettings.aanFeatures.l[0].childNodes;
var anChildren = $('label',oSettings.aanFeatures.l[0])[0].childNodes;
var bReturn =
anChildren[0].nodeValue == "unit " &&
anChildren[2].nodeValue == " test";

View File

@ -12,10 +12,16 @@ $(document).ready( function () {
function () { return oSettings.oLanguage.sSearch == "Search:"; }
);
oTest.fnTest(
"A label input is used",
null,
function () { return $('label', oSettings.aanFeatures.f[0]).length == 1 }
);
oTest.fnTest(
"Search language default is in the DOM",
null,
function () { return document.getElementById('example_filter').childNodes[0].nodeValue
function () { return $('label', oSettings.aanFeatures.f[0]).text()
== "Search: "; }
);
@ -37,8 +43,7 @@ $(document).ready( function () {
oTest.fnTest(
"Info language definition is in the DOM",
null,
function () { return document.getElementById('example_filter').childNodes[0].nodeValue
== "unit test "; }
function () { return $('label', oSettings.aanFeatures.f[0]).text().indexOf('unit test') !== -1; }
);

View File

@ -20,11 +20,17 @@ $(document).ready( function () {
function () { return $('select', oSettings.aanFeatures.l[0]).length == 1 }
);
oTest.fnTest(
"A label input is used",
null,
function () { return $('label', oSettings.aanFeatures.l[0]).length == 1 }
);
oTest.fnTest(
"Default is put into DOM",
null,
function () {
var anChildren = oSettings.aanFeatures.l[0].childNodes;
var anChildren = $('label',oSettings.aanFeatures.l[0])[0].childNodes;
var bReturn =
anChildren[0].nodeValue == "Show " &&
anChildren[2].nodeValue == " entries";
@ -52,8 +58,7 @@ $(document).ready( function () {
"Menu length language definition is in the DOM",
null,
function () {
var anChildren = oSettings.aanFeatures.l[0].childNodes;
return anChildren[0].nodeValue == "unit test";
return $('label', oSettings.aanFeatures.l[0]).text() == "unit test";
}
);
@ -71,7 +76,7 @@ $(document).ready( function () {
oSettings = oTable.fnSettings();
},
function () {
var anChildren = oSettings.aanFeatures.l[0].childNodes;
var anChildren = $('label',oSettings.aanFeatures.l[0])[0].childNodes;
var bReturn =
anChildren[0].nodeValue == "unit " &&
anChildren[2].nodeValue == " test";

View File

@ -14,10 +14,16 @@ $(document).ready( function () {
function () { return oSettings.oLanguage.sSearch == "Search:"; }
);
oTest.fnTest(
"A label input is used",
null,
function () { return $('label', oSettings.aanFeatures.f[0]).length == 1 }
);
oTest.fnTest(
"Search language default is in the DOM",
null,
function () { return document.getElementById('example_filter').childNodes[0].nodeValue
function () { return $('label', oSettings.aanFeatures.f[0]).text()
== "Search: "; }
);
@ -40,8 +46,7 @@ $(document).ready( function () {
oTest.fnTest(
"Info language definition is in the DOM",
null,
function () { return document.getElementById('example_filter').childNodes[0].nodeValue
== "unit test "; }
function () { return $('label', oSettings.aanFeatures.f[0]).text().indexOf('unit test') !== -1; }
);

View File

@ -20,11 +20,17 @@ $(document).ready( function () {
function () { return $('select', oSettings.aanFeatures.l[0]).length == 1 }
);
oTest.fnTest(
"A label input is used",
null,
function () { return $('label', oSettings.aanFeatures.l[0]).length == 1 }
);
oTest.fnTest(
"Default is put into DOM",
null,
function () {
var anChildren = oSettings.aanFeatures.l[0].childNodes;
var anChildren = $('label',oSettings.aanFeatures.l[0])[0].childNodes;
var bReturn =
anChildren[0].nodeValue == "Show " &&
anChildren[2].nodeValue == " entries";
@ -52,8 +58,7 @@ $(document).ready( function () {
"Menu length language definition is in the DOM",
null,
function () {
var anChildren = oSettings.aanFeatures.l[0].childNodes;
return anChildren[0].nodeValue == "unit test";
return $('label', oSettings.aanFeatures.l[0]).text() == "unit test";
}
);
@ -71,7 +76,7 @@ $(document).ready( function () {
oSettings = oTable.fnSettings();
},
function () {
var anChildren = oSettings.aanFeatures.l[0].childNodes;
var anChildren = $('label',oSettings.aanFeatures.l[0])[0].childNodes;
var bReturn =
anChildren[0].nodeValue == "unit " &&
anChildren[2].nodeValue == " test";

View File

@ -14,10 +14,16 @@ $(document).ready( function () {
function () { return oSettings.oLanguage.sSearch == "Search:"; }
);
oTest.fnTest(
"A label input is used",
null,
function () { return $('label', oSettings.aanFeatures.f[0]).length == 1 }
);
oTest.fnTest(
"Search language default is in the DOM",
null,
function () { return document.getElementById('example_filter').childNodes[0].nodeValue
function () { return $('label', oSettings.aanFeatures.f[0]).text()
== "Search: "; }
);
@ -40,8 +46,7 @@ $(document).ready( function () {
oTest.fnTest(
"Info language definition is in the DOM",
null,
function () { return document.getElementById('example_filter').childNodes[0].nodeValue
== "unit test "; }
function () { return $('label', oSettings.aanFeatures.f[0]).text().indexOf('unit test') !== -1; }
);

View File

@ -21,11 +21,17 @@ $(document).ready( function () {
function () { return $('select', oSettings.aanFeatures.l[0]).length == 1 }
);
oTest.fnTest(
"A label input is used",
null,
function () { return $('label', oSettings.aanFeatures.l[0]).length == 1 }
);
oTest.fnTest(
"Default is put into DOM",
null,
function () {
var anChildren = oSettings.aanFeatures.l[0].childNodes;
var anChildren = $('label',oSettings.aanFeatures.l[0])[0].childNodes;
var bReturn =
anChildren[0].nodeValue == "Show " &&
anChildren[2].nodeValue == " entries";
@ -54,8 +60,7 @@ $(document).ready( function () {
"Menu length language definition is in the DOM",
null,
function () {
var anChildren = oSettings.aanFeatures.l[0].childNodes;
return anChildren[0].nodeValue == "unit test";
return $('label', oSettings.aanFeatures.l[0]).text() == "unit test";
}
);
@ -74,7 +79,7 @@ $(document).ready( function () {
oSettings = oTable.fnSettings();
},
function () {
var anChildren = oSettings.aanFeatures.l[0].childNodes;
var anChildren = $('label',oSettings.aanFeatures.l[0])[0].childNodes;
var bReturn =
anChildren[0].nodeValue == "unit " &&
anChildren[2].nodeValue == " test";

View File

@ -15,10 +15,16 @@ $(document).ready( function () {
function () { return oSettings.oLanguage.sSearch == "Search:"; }
);
oTest.fnTest(
"A label input is used",
null,
function () { return $('label', oSettings.aanFeatures.f[0]).length == 1 }
);
oTest.fnTest(
"Search language default is in the DOM",
null,
function () { return document.getElementById('example_filter').childNodes[0].nodeValue
function () { return $('label', oSettings.aanFeatures.f[0]).text()
== "Search: "; }
);
@ -42,8 +48,7 @@ $(document).ready( function () {
oTest.fnTest(
"Info language definition is in the DOM",
null,
function () { return document.getElementById('example_filter').childNodes[0].nodeValue
== "unit test "; }
function () { return $('label', oSettings.aanFeatures.f[0]).text().indexOf('unit test') !== -1; }
);

View File

@ -27,11 +27,17 @@ $(document).ready( function () {
function () { return $('select', oSettings.aanFeatures.l[0]).length == 1 }
);
oTest.fnTest(
"A label input is used",
null,
function () { return $('label', oSettings.aanFeatures.l[0]).length == 1 }
);
oTest.fnTest(
"Default is put into DOM",
null,
function () {
var anChildren = oSettings.aanFeatures.l[0].childNodes;
var anChildren = $('label',oSettings.aanFeatures.l[0])[0].childNodes;
var bReturn =
anChildren[0].nodeValue == "Show " &&
anChildren[2].nodeValue == " entries";
@ -66,8 +72,7 @@ $(document).ready( function () {
"Menu length language definition is in the DOM",
null,
function () {
var anChildren = oSettings.aanFeatures.l[0].childNodes;
return anChildren[0].nodeValue == "unit test";
return $('label', oSettings.aanFeatures.l[0]).text() == "unit test";
}
);
@ -92,7 +97,7 @@ $(document).ready( function () {
oSettings = oTable.fnSettings();
},
function () {
var anChildren = oSettings.aanFeatures.l[0].childNodes;
var anChildren = $('label',oSettings.aanFeatures.l[0])[0].childNodes;
var bReturn =
anChildren[0].nodeValue == "unit " &&
anChildren[2].nodeValue == " test";

View File

@ -21,10 +21,16 @@ $(document).ready( function () {
function () { return oSettings.oLanguage.sSearch == "Search:"; }
);
oTest.fnTest(
"A label input is used",
null,
function () { return $('label', oSettings.aanFeatures.f[0]).length == 1 }
);
oTest.fnTest(
"Search language default is in the DOM",
null,
function () { return document.getElementById('example_filter').childNodes[0].nodeValue
function () { return $('label', oSettings.aanFeatures.f[0]).text()
== "Search: "; }
);
@ -54,8 +60,7 @@ $(document).ready( function () {
oTest.fnTest(
"Info language definition is in the DOM",
null,
function () { return document.getElementById('example_filter').childNodes[0].nodeValue
== "unit test "; }
function () { return $('label', oSettings.aanFeatures.f[0]).text().indexOf('unit test') !== -1; }
);

View File

@ -21,11 +21,17 @@ $(document).ready( function () {
function () { return $('select', oSettings.aanFeatures.l[0]).length == 1 }
);
oTest.fnTest(
"A label input is used",
null,
function () { return $('label', oSettings.aanFeatures.l[0]).length == 1 }
);
oTest.fnTest(
"Default is put into DOM",
null,
function () {
var anChildren = oSettings.aanFeatures.l[0].childNodes;
var anChildren = $('label',oSettings.aanFeatures.l[0])[0].childNodes;
var bReturn =
anChildren[0].nodeValue == "Show " &&
anChildren[2].nodeValue == " entries";
@ -54,8 +60,7 @@ $(document).ready( function () {
"Menu length language definition is in the DOM",
null,
function () {
var anChildren = oSettings.aanFeatures.l[0].childNodes;
return anChildren[0].nodeValue == "unit test";
return $('label', oSettings.aanFeatures.l[0]).text() == "unit test";
}
);
@ -74,7 +79,7 @@ $(document).ready( function () {
oSettings = oTable.fnSettings();
},
function () {
var anChildren = oSettings.aanFeatures.l[0].childNodes;
var anChildren = $('label',oSettings.aanFeatures.l[0])[0].childNodes;
var bReturn =
anChildren[0].nodeValue == "unit " &&
anChildren[2].nodeValue == " test";

View File

@ -15,10 +15,16 @@ $(document).ready( function () {
function () { return oSettings.oLanguage.sSearch == "Search:"; }
);
oTest.fnTest(
"A label input is used",
null,
function () { return $('label', oSettings.aanFeatures.f[0]).length == 1 }
);
oTest.fnTest(
"Search language default is in the DOM",
null,
function () { return document.getElementById('example_filter').childNodes[0].nodeValue
function () { return $('label', oSettings.aanFeatures.f[0]).text()
== "Search: "; }
);
@ -42,8 +48,7 @@ $(document).ready( function () {
oTest.fnTest(
"Info language definition is in the DOM",
null,
function () { return document.getElementById('example_filter').childNodes[0].nodeValue
== "unit test "; }
function () { return $('label', oSettings.aanFeatures.f[0]).text().indexOf('unit test') !== -1; }
);