diff --git a/.gitignore b/.gitignore index 8c35a229..41ffacd8 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ extras +docs +.DS_Store diff --git a/Readme.txt b/Readme.txt index b56ab6ed..96a47cbd 100644 --- a/Readme.txt +++ b/Readme.txt @@ -1,4 +1,4 @@ -This DataTables plugin (v1.8.x) for jQuery was developed out of the desire to allow highly configurable access to HTML tables with advanced access features. +This DataTables plugin (v1.9.x) for jQuery was developed out of the desire to allow highly configurable access to HTML tables with advanced access features. For detailed installation, usage and API instructions, please refer to the DataTables web-pages: http://www.datatables.net @@ -6,6 +6,6 @@ Questions, feature requests and bug reports (etc) can all be asked on the DataTa The DataTables source can be found in the media/js/ directory of this archive. -DataTables is released with dual licensing, using the GPL v2 (license-gpl2.txt) and an BSD style license (license-bsd.txt). Please see the corresponding license file for details of these licenses. You are free to use, modify and distribute this software, but all copyright information must remain. +DataTables is released with dual licensing, using the GPL v2 (license-gpl2.txt) and an BSD style license (license-bsd.txt). You may select which of the two licenses you wish to use DataTables under. Please see the corresponding license file for details of these licenses. You are free to use, modify and distribute this software, but all copyright information must remain. If you discover any bugs in DataTables, have any suggestions for improvements or even if you just like using it, please free to get in touch with me: www.datatables.net/contact \ No newline at end of file diff --git a/examples/advanced_init/column_render.html b/examples/advanced_init/column_render.html index 5a302bb1..81175359 100644 --- a/examples/advanced_init/column_render.html +++ b/examples/advanced_init/column_render.html @@ -497,6 +497,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -515,7 +516,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -529,6 +530,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/advanced_init/complex_header.html b/examples/advanced_init/complex_header.html index 948de665..bf334e52 100644 --- a/examples/advanced_init/complex_header.html +++ b/examples/advanced_init/complex_header.html @@ -494,6 +494,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -512,7 +513,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -526,6 +527,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/advanced_init/defaults.html b/examples/advanced_init/defaults.html new file mode 100644 index 00000000..f8b7f8c4 --- /dev/null +++ b/examples/advanced_init/defaults.html @@ -0,0 +1,611 @@ + + + + + + + DataTables example + + + + + + +
    +
    + DataTables - setting defaults example +
    + +

    Preamble

    +

    When working with DataTables over multiple pages it is often useful to set the initialisation defaults to common values (for example you might want to set sDom to a common value so all tables get the same layout). This can be done using the $.fn.dataTable.defaults object. This object will take all the same parameters as the DataTables initialisation object, but in this case you are setting the default for all future initialisations of DataTables.

    + +

    This example shows the filtering and sorting features of DataTables being disabled by default, which is reflected in the table when it is initialised, as can be seen below.

    + +

    Live example

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Rendering engineBrowserPlatform(s)Engine versionCSS grade
    TridentInternet + Explorer 4.0Win 95+ 4X
    TridentInternet + Explorer 5.0Win 95+5C
    TridentInternet + Explorer 5.5Win 95+5.5A
    TridentInternet + Explorer 6Win 98+6A
    TridentInternet Explorer 7Win XP SP2+7A
    TridentAOL browser (AOL desktop)Win XP6A
    GeckoFirefox 1.0Win 98+ / OSX.2+1.7A
    GeckoFirefox 1.5Win 98+ / OSX.2+1.8A
    GeckoFirefox 2.0Win 98+ / OSX.2+1.8A
    GeckoFirefox 3.0Win 2k+ / OSX.3+1.9A
    GeckoCamino 1.0OSX.2+1.8A
    GeckoCamino 1.5OSX.3+1.8A
    GeckoNetscape 7.2Win 95+ / Mac OS 8.6-9.21.7A
    GeckoNetscape Browser 8Win 98SE+1.7A
    GeckoNetscape Navigator 9Win 98+ / OSX.2+1.8A
    GeckoMozilla 1.0Win 95+ / OSX.1+1A
    GeckoMozilla 1.1Win 95+ / OSX.1+1.1A
    GeckoMozilla 1.2Win 95+ / OSX.1+1.2A
    GeckoMozilla 1.3Win 95+ / OSX.1+1.3A
    GeckoMozilla 1.4Win 95+ / OSX.1+1.4A
    GeckoMozilla 1.5Win 95+ / OSX.1+1.5A
    GeckoMozilla 1.6Win 95+ / OSX.1+1.6A
    GeckoMozilla 1.7Win 98+ / OSX.1+1.7A
    GeckoMozilla 1.8Win 98+ / OSX.1+1.8A
    GeckoSeamonkey 1.1Win 98+ / OSX.2+1.8A
    GeckoEpiphany 2.20Gnome1.8A
    WebkitSafari 1.2OSX.3125.5A
    WebkitSafari 1.3OSX.3312.8A
    WebkitSafari 2.0OSX.4+419.3A
    WebkitSafari 3.0OSX.4+522.1A
    WebkitOmniWeb 5.5OSX.4+420A
    WebkitiPod Touch / iPhoneiPod420.1A
    WebkitS60S60413A
    PrestoOpera 7.0Win 95+ / OSX.1+-A
    PrestoOpera 7.5Win 95+ / OSX.2+-A
    PrestoOpera 8.0Win 95+ / OSX.2+-A
    PrestoOpera 8.5Win 95+ / OSX.2+-A
    PrestoOpera 9.0Win 95+ / OSX.3+-A
    PrestoOpera 9.2Win 88+ / OSX.3+-A
    PrestoOpera 9.5Win 88+ / OSX.3+-A
    PrestoOpera for WiiWii-A
    PrestoNokia N800N800-A
    PrestoNintendo DS browserNintendo DS8.5C/A1
    KHTMLKonqureror 3.1KDE 3.13.1C
    KHTMLKonqureror 3.3KDE 3.33.3A
    KHTMLKonqureror 3.5KDE 3.53.5A
    TasmanInternet Explorer 4.5Mac OS 8-9-X
    TasmanInternet Explorer 5.1Mac OS 7.6-91C
    TasmanInternet Explorer 5.2Mac OS 8-X1C
    MiscNetFront 3.1Embedded devices-C
    MiscNetFront 3.4Embedded devices-A
    MiscDillo 0.8Embedded devices-X
    MiscLinksText only-X
    MiscLynxText only-X
    MiscIE MobileWindows Mobile 6-C
    MiscPSP browserPSP-C
    Other browsersAll others--U
    Rendering engineBrowserPlatform(s)Engine versionCSS grade
    +
    +
    + + +

    Initialisation code

    +
    $(document).ready(function() {
    +	$.extend( $.fn.dataTable.defaults, {
    +		"bFilter": false,
    +		"bSort": false
    +	} );
    +
    +	$('#example').dataTable();
    +} );
    + + + + +

    Other examples

    + + + + + + +
    + + \ No newline at end of file diff --git a/examples/advanced_init/dom_multiple_elements.html b/examples/advanced_init/dom_multiple_elements.html index 4677fc84..46f28d13 100644 --- a/examples/advanced_init/dom_multiple_elements.html +++ b/examples/advanced_init/dom_multiple_elements.html @@ -490,6 +490,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -508,7 +509,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -522,6 +523,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/advanced_init/dom_toolbar.html b/examples/advanced_init/dom_toolbar.html index 3bb53a02..25ff6d98 100644 --- a/examples/advanced_init/dom_toolbar.html +++ b/examples/advanced_init/dom_toolbar.html @@ -495,6 +495,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -513,7 +514,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -527,6 +528,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/advanced_init/events_live.html b/examples/advanced_init/events_live.html index bab4ed83..92ea85c9 100644 --- a/examples/advanced_init/events_live.html +++ b/examples/advanced_init/events_live.html @@ -523,6 +523,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -541,7 +542,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -555,6 +556,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/advanced_init/events_post_init.html b/examples/advanced_init/events_post_init.html index 5c4c7507..41ad2a68 100644 --- a/examples/advanced_init/events_post_init.html +++ b/examples/advanced_init/events_post_init.html @@ -42,7 +42,7 @@ var oTable = $('#example').dataTable(); /* Apply the tooltips */ - $( oTable.fnGetNodes() ).tooltip( { + oTable.$('tr').tooltip( { "delay": 0, "track": true, "fade": 250 @@ -57,7 +57,8 @@

    Preamble

    -

    Events which are assigned to the table elements are retained by DataTables such that they will still work as you would expect, even after changing the sort order etc. (no need to reapply the event handlers). You can do this at any time, although if you apply the handlers after the table has been initialised there is an extra set. Rather then queriing the DOM to get all rows (since they aren't there) you need to use the fnGetNodes() API function. This is shown in this example.

    +

    Events which are assigned to the table elements are retained by DataTables such that they will still work as you would expect, even after changing the sort order etc. (no need to reapply the event handlers). You can do this at any time, although if you apply the handlers after the table has been initialised there is an extra set. Rather then querying the DOM to get all rows (since they aren't there) you can use the '$' API method that DataTables provides which does a jQuery selector on the whole table and returns a jQuery object.

    +

    This example shows the tooltip plug-in being applied to the table after initialisation.

    Live example

    @@ -521,7 +522,7 @@ var oTable = $('#example').dataTable(); /* Apply the tooltips */ - $( oTable.fnGetNodes() ).tooltip( { + oTable.$('tr').tooltip( { "delay": 0, "track": true, "fade": 250 @@ -545,6 +546,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -563,7 +565,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -577,6 +579,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/advanced_init/events_pre_init.html b/examples/advanced_init/events_pre_init.html index e364c449..a60ccc40 100644 --- a/examples/advanced_init/events_pre_init.html +++ b/examples/advanced_init/events_pre_init.html @@ -545,6 +545,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -563,7 +564,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -577,6 +578,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/advanced_init/footer_callback.html b/examples/advanced_init/footer_callback.html index 3c88d79b..d9f66771 100644 --- a/examples/advanced_init/footer_callback.html +++ b/examples/advanced_init/footer_callback.html @@ -529,6 +529,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -547,7 +548,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -561,6 +562,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/advanced_init/highlight.html b/examples/advanced_init/highlight.html index 6b76568e..51d513ca 100644 --- a/examples/advanced_init/highlight.html +++ b/examples/advanced_init/highlight.html @@ -522,6 +522,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -540,7 +541,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -554,6 +555,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/advanced_init/html_sort.html b/examples/advanced_init/html_sort.html index 37e94c39..8281309a 100644 --- a/examples/advanced_init/html_sort.html +++ b/examples/advanced_init/html_sort.html @@ -76,6 +76,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -94,7 +95,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -108,6 +109,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/advanced_init/language_file.html b/examples/advanced_init/language_file.html index 71ab546f..c737b883 100644 --- a/examples/advanced_init/language_file.html +++ b/examples/advanced_init/language_file.html @@ -487,6 +487,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -505,7 +506,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -519,6 +520,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/advanced_init/length_menu.html b/examples/advanced_init/length_menu.html index 0c0ffb3b..d1cce32b 100644 --- a/examples/advanced_init/length_menu.html +++ b/examples/advanced_init/length_menu.html @@ -483,6 +483,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -501,7 +502,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -515,6 +516,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/advanced_init/row_callback.html b/examples/advanced_init/row_callback.html index 20722a3c..9d4a4785 100644 --- a/examples/advanced_init/row_callback.html +++ b/examples/advanced_init/row_callback.html @@ -505,6 +505,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -523,7 +524,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -537,6 +538,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/advanced_init/row_grouping.html b/examples/advanced_init/row_grouping.html index c235aeab..3099a816 100644 --- a/examples/advanced_init/row_grouping.html +++ b/examples/advanced_init/row_grouping.html @@ -540,6 +540,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -558,7 +559,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -572,6 +573,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/advanced_init/sorting_control.html b/examples/advanced_init/sorting_control.html index 15f9808b..d01818d0 100644 --- a/examples/advanced_init/sorting_control.html +++ b/examples/advanced_init/sorting_control.html @@ -504,6 +504,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -522,7 +523,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -536,6 +537,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/ajax/ajax.html b/examples/ajax/ajax.html index f85bf230..65a48f31 100644 --- a/examples/ajax/ajax.html +++ b/examples/ajax/ajax.html @@ -87,6 +87,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -105,7 +106,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -119,6 +120,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/ajax/custom_data_property.html b/examples/ajax/custom_data_property.html index d8bc20c1..bf0fe1b1 100644 --- a/examples/ajax/custom_data_property.html +++ b/examples/ajax/custom_data_property.html @@ -89,6 +89,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -107,7 +108,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -121,6 +122,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/ajax/deep.html b/examples/ajax/deep.html index 842160c3..af43013b 100644 --- a/examples/ajax/deep.html +++ b/examples/ajax/deep.html @@ -101,6 +101,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -119,7 +120,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -133,6 +134,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/ajax/defer_render.html b/examples/ajax/defer_render.html index 16bdbdb3..f38558b3 100644 --- a/examples/ajax/defer_render.html +++ b/examples/ajax/defer_render.html @@ -89,6 +89,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -107,7 +108,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -121,6 +122,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/ajax/null_data_source.html b/examples/ajax/null_data_source.html index 116bdd3a..9e510cca 100644 --- a/examples/ajax/null_data_source.html +++ b/examples/ajax/null_data_source.html @@ -93,6 +93,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -111,7 +112,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -125,6 +126,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/ajax/objects.html b/examples/ajax/objects.html index 2868b8d2..cbfb4fd0 100644 --- a/examples/ajax/objects.html +++ b/examples/ajax/objects.html @@ -101,6 +101,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -119,7 +120,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -133,6 +134,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/ajax/objects_subarrays.html b/examples/ajax/objects_subarrays.html index 49b2b93f..1547c096 100644 --- a/examples/ajax/objects_subarrays.html +++ b/examples/ajax/objects_subarrays.html @@ -101,6 +101,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -119,7 +120,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -133,6 +134,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/api/add_row.html b/examples/api/add_row.html index 987b630b..13b4bbf2 100644 --- a/examples/api/add_row.html +++ b/examples/api/add_row.html @@ -100,6 +100,7 @@ function fnClickAddRow() {
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -118,7 +119,7 @@ function fnClickAddRow() {
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -132,6 +133,7 @@ function fnClickAddRow() {
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/api/api_in_init.html b/examples/api/api_in_init.html index cb558a8d..e1beb086 100644 --- a/examples/api/api_in_init.html +++ b/examples/api/api_in_init.html @@ -15,10 +15,8 @@ $(document).ready(function() { $('#example').dataTable( { "fnInitComplete": function () { - var - that = this, - nTrs = this.fnGetNodes(); - $('td', nTrs).click( function () { + var that = this; + this.$('td').click( function () { that.fnFilter( this.innerHTML ); } ); } @@ -33,8 +31,8 @@

    Preamble

    -

    There are times when you may wish to call API functions inside the DataTables callback functions (for example fnInitComplete, fnRowCallback etc). The complicating issue with this is that the object hasn't fully initialised, so you can't assign the result to something like oTable and then use oTable in the callback. However, this is catered for by the execution scope of the callback function. Here 'this' is the DataTables object that is created for the table.

    -

    In this example you will be able to see that this.fnGetNodes() is used, and also the value of this stored in the variable 'that' so it can be used inside the jQuery click function, where the execution scope has been changed to the td element!). The action here is to apply the filter with the value of what is in each cell.

    +

    There are times when you may wish to call API functions inside the DataTables callback functions (for example fnInitComplete, fnRowCallback etc). The complicating issue with this is that the object hasn't fully initialised, so you can't assign the result to something like oTable and then use oTable in the callback. However, this is catered for by the execution scope of the callback function. Here this is the DataTables object that is created for the table.

    +

    In this example you will be able to see that this.$() is used to get all nodes in the table's body and then act on them (in this case added a click event). Note also the value of this stored in the variable that so it can be used inside the jQuery click function, where the execution scope has been changed to the td element!). The action here is to apply the filter with the value of what is in each cell.

    Live example

    @@ -471,10 +469,8 @@
    $(document).ready(function() {
     	$('#example').dataTable( {
     		"fnInitComplete": function () {
    -			var 
    -				that = this,
    -				nTrs = this.fnGetNodes();
    -			$('td', nTrs).click( function () {
    +			var that = this;
    +			this.$('td').click( function () {
     				that.fnFilter( this.innerHTML );
     			} );
     		}
    @@ -498,6 +494,7 @@
     					
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -516,7 +513,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -530,6 +527,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/api/counter_column.html b/examples/api/counter_column.html index 2117ed94..663d5f8a 100644 --- a/examples/api/counter_column.html +++ b/examples/api/counter_column.html @@ -569,6 +569,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -587,7 +588,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -601,6 +602,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/api/editable.html b/examples/api/editable.html index fd75f47e..df171637 100644 --- a/examples/api/editable.html +++ b/examples/api/editable.html @@ -18,7 +18,7 @@ var oTable = $('#example').dataTable(); /* Apply the jEditable handlers to the table */ - $('td', oTable.fnGetNodes()).editable( '../examples_support/editable_ajax.php', { + oTable.$('td').editable( '../examples_support/editable_ajax.php', { "callback": function( sValue, y ) { var aPos = oTable.fnGetPosition( this ); oTable.fnUpdate( sValue, aPos[0], aPos[1] ); @@ -484,7 +484,7 @@ var oTable = $('#example').dataTable(); /* Apply the jEditable handlers to the table */ - $('td', oTable.fnGetNodes()).editable( '../examples_support/editable_ajax.php', { + oTable.$('td').editable( '../examples_support/editable_ajax.php', { "callback": function( sValue, y ) { var aPos = oTable.fnGetPosition( this ); oTable.fnUpdate( sValue, aPos[0], aPos[1] ); @@ -516,6 +516,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -534,7 +535,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -548,6 +549,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/api/form.html b/examples/api/form.html index d79c7923..76ca4556 100644 --- a/examples/api/form.html +++ b/examples/api/form.html @@ -16,7 +16,7 @@ $(document).ready(function() { $('#form').submit( function() { - var sData = $('input', oTable.fnGetNodes()).serialize(); + var sData = oTable.$('input').serialize(); alert( "The following data would have been submitted to the server: \n\n"+sData ); return false; } ); @@ -534,7 +534,7 @@ $(document).ready(function() { $('#form').submit( function() { - var sData = $('input', oTable.fnGetNodes()).serialize(); + var sData = oTable.$('input').serialize(); alert( "The following data would have been submitted to the server: \n\n"+sData ); return false; } ); @@ -559,6 +559,7 @@ $(document).ready(function() {
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -577,7 +578,7 @@ $(document).ready(function() {
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -591,6 +592,7 @@ $(document).ready(function() {
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/api/highlight.html b/examples/api/highlight.html index ff312d96..74fac84c 100644 --- a/examples/api/highlight.html +++ b/examples/api/highlight.html @@ -17,12 +17,11 @@ "bSortClasses": false } ); - $('td', oTable.fnGetNodes()).hover( function() { + oTable.$('td').hover( function() { var iCol = $('td', this.parentNode).index(this) % 5; - var nTrs = oTable.fnGetNodes(); - $('td:nth-child('+(iCol+1)+')', nTrs).addClass( 'highlighted' ); + $('td:nth-child('+(iCol+1)+')', oTable.$('tr')).addClass( 'highlighted' ); }, function() { - $('td.highlighted', oTable.fnGetNodes()).removeClass('highlighted'); + oTable.$('td.highlighted').removeClass('highlighted'); } ); } ); @@ -473,12 +472,11 @@ "bSortClasses": false } ); - $('td', oTable.fnGetNodes()).hover( function() { + oTable.$('td').hover( function() { var iCol = $('td', this.parentNode).index(this) % 5; - var nTrs = oTable.fnGetNodes(); - $('td:nth-child('+(iCol+1)+')', nTrs).addClass( 'highlighted' ); + $('td:nth-child('+(iCol+1)+')', oTable.$('tr')).addClass( 'highlighted' ); }, function() { - $('td.highlighted', oTable.fnGetNodes()).removeClass('highlighted'); + oTable.$('td.highlighted').removeClass('highlighted'); } ); } );
    + + + + + +
    +
    + DataTables - flexible width example +
    + +

    Preamble

    +

    Often you may want to have your table resize dynamically with the page. Typically this is done by assigning width:100% in your CSS, but this presents a problem for Javascript since it can be very hard to get that relative size, rather than the absolute pixels. As such, if you apply the width attribute to the HTML table + tag, this will be used as the width for the table (overruling any CSS styles).

    +

    This example shows a table width width="100%" and the container is also flexible width, so as the window is resized, the table will also resize dynamically.

    + +

    Live example

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Rendering engineBrowserPlatform(s)Engine versionCSS grade
    TridentInternet + Explorer 4.0Win 95+ 4X
    TridentInternet + Explorer 5.0Win 95+5C
    TridentInternet + Explorer 5.5Win 95+5.5A
    TridentInternet + Explorer 6Win 98+6A
    TridentInternet Explorer 7Win XP SP2+7A
    TridentAOL browser (AOL desktop)Win XP6A
    GeckoFirefox 1.0Win 98+ / OSX.2+1.7A
    GeckoFirefox 1.5Win 98+ / OSX.2+1.8A
    GeckoFirefox 2.0Win 98+ / OSX.2+1.8A
    GeckoFirefox 3.0Win 2k+ / OSX.3+1.9A
    GeckoCamino 1.0OSX.2+1.8A
    GeckoCamino 1.5OSX.3+1.8A
    GeckoNetscape 7.2Win 95+ / Mac OS 8.6-9.21.7A
    GeckoNetscape Browser 8Win 98SE+1.7A
    GeckoNetscape Navigator 9Win 98+ / OSX.2+1.8A
    GeckoMozilla 1.0Win 95+ / OSX.1+1A
    GeckoMozilla 1.1Win 95+ / OSX.1+1.1A
    GeckoMozilla 1.2Win 95+ / OSX.1+1.2A
    GeckoMozilla 1.3Win 95+ / OSX.1+1.3A
    GeckoMozilla 1.4Win 95+ / OSX.1+1.4A
    GeckoMozilla 1.5Win 95+ / OSX.1+1.5A
    GeckoMozilla 1.6Win 95+ / OSX.1+1.6A
    GeckoMozilla 1.7Win 98+ / OSX.1+1.7A
    GeckoMozilla 1.8Win 98+ / OSX.1+1.8A
    GeckoSeamonkey 1.1Win 98+ / OSX.2+1.8A
    GeckoEpiphany 2.20Gnome1.8A
    WebkitSafari 1.2OSX.3125.5A
    WebkitSafari 1.3OSX.3312.8A
    WebkitSafari 2.0OSX.4+419.3A
    WebkitSafari 3.0OSX.4+522.1A
    WebkitOmniWeb 5.5OSX.4+420A
    WebkitiPod Touch / iPhoneiPod420.1A
    WebkitS60S60413A
    PrestoOpera 7.0Win 95+ / OSX.1+-A
    PrestoOpera 7.5Win 95+ / OSX.2+-A
    PrestoOpera 8.0Win 95+ / OSX.2+-A
    PrestoOpera 8.5Win 95+ / OSX.2+-A
    PrestoOpera 9.0Win 95+ / OSX.3+-A
    PrestoOpera 9.2Win 88+ / OSX.3+-A
    PrestoOpera 9.5Win 88+ / OSX.3+-A
    PrestoOpera for WiiWii-A
    PrestoNokia N800N800-A
    PrestoNintendo DS browserNintendo DS8.5C/A1
    KHTMLKonqureror 3.1KDE 3.13.1C
    KHTMLKonqureror 3.3KDE 3.33.3A
    KHTMLKonqureror 3.5KDE 3.53.5A
    TasmanInternet Explorer 4.5Mac OS 8-9-X
    TasmanInternet Explorer 5.1Mac OS 7.6-91C
    TasmanInternet Explorer 5.2Mac OS 8-X1C
    MiscNetFront 3.1Embedded devices-C
    MiscNetFront 3.4Embedded devices-A
    MiscDillo 0.8Embedded devices-X
    MiscLinksText only-X
    MiscLynxText only-X
    MiscIE MobileWindows Mobile 6-C
    MiscPSP browserPSP-C
    Other browsersAll others--U
    Rendering engineBrowserPlatform(s)Engine versionCSS grade
    +
    +
    + + +

    Initialisation code

    +
    $(document).ready(function() {
    +	$('#example').dataTable();
    +} );
    + + + + +

    Other examples

    + + + + + + +
    + + \ No newline at end of file diff --git a/examples/basic_init/hidden_columns.html b/examples/basic_init/hidden_columns.html index c1f5ad3c..efa724f9 100644 --- a/examples/basic_init/hidden_columns.html +++ b/examples/basic_init/hidden_columns.html @@ -483,6 +483,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -501,7 +502,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -515,6 +516,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/basic_init/language.html b/examples/basic_init/language.html index 70a5b98f..511c7cbb 100644 --- a/examples/basic_init/language.html +++ b/examples/basic_init/language.html @@ -491,6 +491,7 @@ $('#example').dataTable( {
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -509,7 +510,7 @@ $('#example').dataTable( {
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -523,6 +524,7 @@ $('#example').dataTable( {
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/basic_init/multi_col_sort.html b/examples/basic_init/multi_col_sort.html index d5be92b4..fac5b65d 100644 --- a/examples/basic_init/multi_col_sort.html +++ b/examples/basic_init/multi_col_sort.html @@ -514,6 +514,7 @@ $(document).ready(function() {
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -532,7 +533,7 @@ $(document).ready(function() {
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -546,6 +547,7 @@ $(document).ready(function() {
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/basic_init/multiple_tables.html b/examples/basic_init/multiple_tables.html index 9a373d9b..068515a6 100644 --- a/examples/basic_init/multiple_tables.html +++ b/examples/basic_init/multiple_tables.html @@ -295,6 +295,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -313,7 +314,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -327,6 +328,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/basic_init/scroll_x.html b/examples/basic_init/scroll_x.html index 002907fb..375cf8a3 100644 --- a/examples/basic_init/scroll_x.html +++ b/examples/basic_init/scroll_x.html @@ -489,6 +489,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -507,7 +508,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -521,6 +522,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/basic_init/scroll_xy.html b/examples/basic_init/scroll_xy.html index ea5c09d0..75a86fc5 100644 --- a/examples/basic_init/scroll_xy.html +++ b/examples/basic_init/scroll_xy.html @@ -479,6 +479,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -497,7 +498,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -511,6 +512,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/basic_init/scroll_y.html b/examples/basic_init/scroll_y.html index 2c7d4547..95f1f283 100644 --- a/examples/basic_init/scroll_y.html +++ b/examples/basic_init/scroll_y.html @@ -486,6 +486,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -504,7 +505,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -518,6 +519,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/basic_init/scroll_y_infinite.html b/examples/basic_init/scroll_y_infinite.html index 1391a502..7f99ab87 100644 --- a/examples/basic_init/scroll_y_infinite.html +++ b/examples/basic_init/scroll_y_infinite.html @@ -489,6 +489,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -507,7 +508,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -521,6 +522,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/basic_init/scroll_y_theme.html b/examples/basic_init/scroll_y_theme.html index cd15674d..c2b4447c 100644 --- a/examples/basic_init/scroll_y_theme.html +++ b/examples/basic_init/scroll_y_theme.html @@ -488,6 +488,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -506,7 +507,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -520,6 +521,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/basic_init/state_save.html b/examples/basic_init/state_save.html index 055dbdc7..ca0026a5 100644 --- a/examples/basic_init/state_save.html +++ b/examples/basic_init/state_save.html @@ -483,6 +483,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -501,7 +502,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -515,6 +516,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/basic_init/table_sorting.html b/examples/basic_init/table_sorting.html index 6654e0d8..2032142a 100644 --- a/examples/basic_init/table_sorting.html +++ b/examples/basic_init/table_sorting.html @@ -483,6 +483,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -501,7 +502,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -515,6 +516,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/basic_init/themes.html b/examples/basic_init/themes.html index 2451d3cc..3e8f0c42 100644 --- a/examples/basic_init/themes.html +++ b/examples/basic_init/themes.html @@ -477,6 +477,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -495,7 +496,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -509,6 +510,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/basic_init/zero_config.html b/examples/basic_init/zero_config.html index 33f69eec..cdea3477 100644 --- a/examples/basic_init/zero_config.html +++ b/examples/basic_init/zero_config.html @@ -28,7 +28,7 @@

    Live example

    - +
    @@ -479,6 +479,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -497,7 +498,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -511,6 +512,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/data_sources/ajax.html b/examples/data_sources/ajax.html index 21b6e4b7..efa0fa8f 100644 --- a/examples/data_sources/ajax.html +++ b/examples/data_sources/ajax.html @@ -87,6 +87,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -105,7 +106,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -119,6 +120,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/data_sources/dom.html b/examples/data_sources/dom.html index fa82498f..ec067218 100644 --- a/examples/data_sources/dom.html +++ b/examples/data_sources/dom.html @@ -479,6 +479,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -497,7 +498,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -511,6 +512,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/data_sources/js_array.html b/examples/data_sources/js_array.html index 75b3e6d8..a04953be 100644 --- a/examples/data_sources/js_array.html +++ b/examples/data_sources/js_array.html @@ -168,6 +168,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -186,7 +187,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -200,6 +201,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/data_sources/server_side.html b/examples/data_sources/server_side.html index f3125606..80cf9bf2 100644 --- a/examples/data_sources/server_side.html +++ b/examples/data_sources/server_side.html @@ -271,6 +271,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -289,7 +290,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -303,6 +304,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/examples_support/syntax/js/shCore.js b/examples/examples_support/syntax/js/shCore.js index e2b82a2e..b85ba887 100644 --- a/examples/examples_support/syntax/js/shCore.js +++ b/examples/examples_support/syntax/js/shCore.js @@ -333,7 +333,7 @@ var dtLinks = [ /* Show and syntax highlight XHR returns from the server */ $(document).ready( function () { - if ( $.fn.dataTableSettings.length > 1 ) { + if ( $.fn.dataTableSettings.length >= 1 ) { $('#example').dataTable().bind('xhr', function ( e, oSettings ) { var n = document.getElementById('latest_xhr'); n.innerHTML = JSON.stringify( diff --git a/examples/index.html b/examples/index.html index bca584de..e86e968d 100644 --- a/examples/index.html +++ b/examples/index.html @@ -29,6 +29,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -47,7 +48,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -61,6 +62,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/plug-ins/dom_sort.html b/examples/plug-ins/dom_sort.html index 50054799..c7bf8401 100644 --- a/examples/plug-ins/dom_sort.html +++ b/examples/plug-ins/dom_sort.html @@ -1021,6 +1021,7 @@ $(document).ready(function() {
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -1039,7 +1040,7 @@ $(document).ready(function() {
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -1053,6 +1054,7 @@ $(document).ready(function() {
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/plug-ins/html_sort.html b/examples/plug-ins/html_sort.html index 9f9ab356..f1daa7ef 100644 --- a/examples/plug-ins/html_sort.html +++ b/examples/plug-ins/html_sort.html @@ -87,6 +87,7 @@ $(document).ready(function() {
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -105,7 +106,7 @@ $(document).ready(function() {
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -119,6 +120,7 @@ $(document).ready(function() {
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/plug-ins/paging_plugin.html b/examples/plug-ins/paging_plugin.html index a575c9dd..6eb88716 100644 --- a/examples/plug-ins/paging_plugin.html +++ b/examples/plug-ins/paging_plugin.html @@ -717,6 +717,7 @@ $(document).ready(function() {
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -735,7 +736,7 @@ $(document).ready(function() {
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -749,6 +750,7 @@ $(document).ready(function() {
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/plug-ins/plugin_api.html b/examples/plug-ins/plugin_api.html index 4e7b7e79..13e992ff 100644 --- a/examples/plug-ins/plugin_api.html +++ b/examples/plug-ins/plugin_api.html @@ -547,6 +547,7 @@ $(document).ready(function() {
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -565,7 +566,7 @@ $(document).ready(function() {
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -579,6 +580,7 @@ $(document).ready(function() {
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/plug-ins/range_filtering.html b/examples/plug-ins/range_filtering.html index 9b9928a2..1c223636 100644 --- a/examples/plug-ins/range_filtering.html +++ b/examples/plug-ins/range_filtering.html @@ -551,6 +551,7 @@ $(document).ready(function() {
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -569,7 +570,7 @@ $(document).ready(function() {
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -583,6 +584,7 @@ $(document).ready(function() {
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/plug-ins/sorting_plugin.html b/examples/plug-ins/sorting_plugin.html index 420a48eb..6d2a5218 100644 --- a/examples/plug-ins/sorting_plugin.html +++ b/examples/plug-ins/sorting_plugin.html @@ -580,6 +580,7 @@ $(document).ready(function() {
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -598,7 +599,7 @@ $(document).ready(function() {
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -612,6 +613,7 @@ $(document).ready(function() {
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/plug-ins/sorting_sType.html b/examples/plug-ins/sorting_sType.html index 44cd9326..ce917298 100644 --- a/examples/plug-ins/sorting_sType.html +++ b/examples/plug-ins/sorting_sType.html @@ -528,6 +528,7 @@ $(document).ready(function() {
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -546,7 +547,7 @@ $(document).ready(function() {
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -560,6 +561,7 @@ $(document).ready(function() {
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/server_side/column_ordering.html b/examples/server_side/column_ordering.html index f55a6176..69fede18 100644 --- a/examples/server_side/column_ordering.html +++ b/examples/server_side/column_ordering.html @@ -106,6 +106,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -124,7 +125,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -138,6 +139,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/server_side/custom_vars.html b/examples/server_side/custom_vars.html index 50c6c4ef..079ca6b1 100644 --- a/examples/server_side/custom_vars.html +++ b/examples/server_side/custom_vars.html @@ -97,6 +97,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -115,7 +116,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -129,6 +130,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/server_side/defer_loading.html b/examples/server_side/defer_loading.html index 78b341a1..64906c68 100644 --- a/examples/server_side/defer_loading.html +++ b/examples/server_side/defer_loading.html @@ -160,6 +160,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -178,7 +179,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -192,6 +193,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/server_side/editable.html b/examples/server_side/editable.html index cc28e561..38d557a9 100644 --- a/examples/server_side/editable.html +++ b/examples/server_side/editable.html @@ -110,6 +110,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -128,7 +129,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -142,6 +143,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/server_side/ids.html b/examples/server_side/ids.html index 4d1eb16d..ed57292d 100644 --- a/examples/server_side/ids.html +++ b/examples/server_side/ids.html @@ -91,6 +91,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -109,7 +110,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -123,6 +124,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/server_side/jsonp.html b/examples/server_side/jsonp.html index a16fe98c..09ca5439 100644 --- a/examples/server_side/jsonp.html +++ b/examples/server_side/jsonp.html @@ -109,6 +109,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -127,7 +128,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -141,6 +142,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/server_side/object_data.html b/examples/server_side/object_data.html index e2e84aa0..1673b4e3 100644 --- a/examples/server_side/object_data.html +++ b/examples/server_side/object_data.html @@ -106,6 +106,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -124,7 +125,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -138,6 +139,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/server_side/pipeline.html b/examples/server_side/pipeline.html index dd22ae43..f30212d4 100644 --- a/examples/server_side/pipeline.html +++ b/examples/server_side/pipeline.html @@ -300,6 +300,7 @@ $(document).ready(function() {
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -318,7 +319,7 @@ $(document).ready(function() {
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -332,6 +333,7 @@ $(document).ready(function() {
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/server_side/post.html b/examples/server_side/post.html index 0e12bcb8..2cd65bee 100644 --- a/examples/server_side/post.html +++ b/examples/server_side/post.html @@ -93,6 +93,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -111,7 +112,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -125,6 +126,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/server_side/row_details.html b/examples/server_side/row_details.html index 18ce1968..f136919c 100644 --- a/examples/server_side/row_details.html +++ b/examples/server_side/row_details.html @@ -173,6 +173,7 @@ $(document).ready(function() {
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -191,7 +192,7 @@ $(document).ready(function() {
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -205,6 +206,7 @@ $(document).ready(function() {
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/server_side/scripts/server_processing.php b/examples/server_side/scripts/server_processing.php index ffeae7eb..98faa61c 100644 --- a/examples/server_side/scripts/server_processing.php +++ b/examples/server_side/scripts/server_processing.php @@ -61,8 +61,8 @@ { if ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == "true" ) { - $sOrder .= $aColumns[ intval( $_GET['iSortCol_'.$i] ) ]." - ".mysql_real_escape_string( $_GET['sSortDir_'.$i] ) .", "; + $sOrder .= "`".$aColumns[ intval( $_GET['iSortCol_'.$i] ) ]."` ". + mysql_real_escape_string( $_GET['sSortDir_'.$i] ) .", "; } } @@ -86,7 +86,7 @@ $sWhere = "WHERE ("; for ( $i=0 ; $iHidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -155,7 +156,7 @@ $(document).ready(function() {
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -169,6 +170,7 @@ $(document).ready(function() {
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/examples/server_side/server_side.html b/examples/server_side/server_side.html index ddeecad8..5c6bce09 100644 --- a/examples/server_side/server_side.html +++ b/examples/server_side/server_side.html @@ -270,6 +270,7 @@
  • Hidden columns
  • Complex headers - grouping with colspan
  • DOM positioning
  • +
  • Flexible table width
  • State saving
  • Alternative pagination styles
  • Scrolling:
    @@ -288,7 +289,7 @@
  • Events:
    Live events / Pre-init / - Post-init with fnGetNodes + Post-init
  • Column rendering
  • Sorting without HTML tags
  • @@ -302,6 +303,7 @@
  • Footer callback
  • Control sorting direction of columns
  • Change language information from a file (internationalisation)
  • +
  • Setting defaults
  • API

    diff --git a/media/css/demo_table.css b/media/css/demo_table.css index 3bc04337..eefb5597 100644 --- a/media/css/demo_table.css +++ b/media/css/demo_table.css @@ -71,34 +71,60 @@ } .dataTables_paginate { - width: 44px; - * width: 50px; float: right; text-align: right; } /* Pagination nested */ -.paginate_disabled_previous, .paginate_enabled_previous, .paginate_disabled_next, .paginate_enabled_next { +.paginate_disabled_previous, .paginate_enabled_previous, +.paginate_disabled_next, .paginate_enabled_next { height: 19px; - width: 19px; - margin-left: 3px; float: left; + cursor: pointer; + *cursor: hand; + color: #111 !important; +} +.paginate_disabled_previous:hover, .paginate_enabled_previous:hover, +.paginate_disabled_next:hover, .paginate_enabled_next:hover { + text-decoration: none !important; +} +.paginate_disabled_previous:active, .paginate_enabled_previous:active, +.paginate_disabled_next:active, .paginate_enabled_next:active { + outline: none; +} + +.paginate_disabled_previous, +.paginate_disabled_next { + color: #666 !important; +} +.paginate_disabled_previous, .paginate_enabled_previous { + padding-left: 23px; +} +.paginate_disabled_next, .paginate_enabled_next { + padding-right: 23px; + margin-left: 10px; } .paginate_disabled_previous { - background-image: url('../images/back_disabled.jpg'); + background: url('../images/back_disabled.png') no-repeat top left; } .paginate_enabled_previous { - background-image: url('../images/back_enabled.jpg'); + background: url('../images/back_enabled.png') no-repeat top left; +} +.paginate_enabled_previous:hover { + background: url('../images/back_enabled_hover.png') no-repeat top left; } .paginate_disabled_next { - background-image: url('../images/forward_disabled.jpg'); + background: url('../images/forward_disabled.png') no-repeat top right; } .paginate_enabled_next { - background-image: url('../images/forward_enabled.jpg'); + background: url('../images/forward_enabled.png') no-repeat top right; +} +.paginate_enabled_next:hover { + background: url('../images/forward_enabled_hover.png') no-repeat top right; } @@ -176,7 +202,10 @@ table.display td.center { .sorting_desc_disabled { background: url('../images/sort_desc_disabled.png') no-repeat center right; } - + +th:active { + outline: none; +} @@ -290,8 +319,8 @@ td.details { line-height: 22px; } -.paging_full_numbers span.paginate_button, - .paging_full_numbers span.paginate_active { +.paging_full_numbers a.paginate_button, + .paging_full_numbers a.paginate_active { border: 1px solid #aaa; -webkit-border-radius: 5px; -moz-border-radius: 5px; @@ -299,17 +328,19 @@ td.details { margin: 0 3px; cursor: pointer; *cursor: hand; + color: #333 !important; } -.paging_full_numbers span.paginate_button { +.paging_full_numbers a.paginate_button { background-color: #ddd; } -.paging_full_numbers span.paginate_button:hover { +.paging_full_numbers a.paginate_button:hover { background-color: #ccc; + text-decoration: none !important; } -.paging_full_numbers span.paginate_active { +.paging_full_numbers a.paginate_active { background-color: #99B3FF; } diff --git a/media/css/demo_table_jui.css b/media/css/demo_table_jui.css index 84268caa..360aef08 100644 --- a/media/css/demo_table_jui.css +++ b/media/css/demo_table_jui.css @@ -42,6 +42,7 @@ margin: 0; cursor: pointer; * cursor: hand; + color: #333 !important; } .dataTables_paginate .ui-button { @@ -341,8 +342,8 @@ td.details { width: 40%; } -.paging_full_numbers span.paginate_button, - .paging_full_numbers span.paginate_active { +.paging_full_numbers a.paginate_button, + .paging_full_numbers a.paginate_active { border: 1px solid #aaa; -webkit-border-radius: 5px; -moz-border-radius: 5px; @@ -350,17 +351,19 @@ td.details { margin: 0 3px; cursor: pointer; *cursor: hand; + color: #333 !important; } -.paging_full_numbers span.paginate_button { +.paging_full_numbers a.paginate_button { background-color: #ddd; } -.paging_full_numbers span.paginate_button:hover { +.paging_full_numbers a.paginate_button:hover { background-color: #ccc; + text-decoration: none !important; } -.paging_full_numbers span.paginate_active { +.paging_full_numbers a.paginate_active { background-color: #99B3FF; } diff --git a/media/images/back_disabled.jpg b/media/images/back_disabled.jpg deleted file mode 100644 index 1e73a546..00000000 Binary files a/media/images/back_disabled.jpg and /dev/null differ diff --git a/media/images/back_disabled.png b/media/images/back_disabled.png new file mode 100644 index 00000000..881de797 Binary files /dev/null and b/media/images/back_disabled.png differ diff --git a/media/images/back_enabled.jpg b/media/images/back_enabled.jpg deleted file mode 100644 index a6d764c7..00000000 Binary files a/media/images/back_enabled.jpg and /dev/null differ diff --git a/media/images/back_enabled.png b/media/images/back_enabled.png new file mode 100644 index 00000000..c608682b Binary files /dev/null and b/media/images/back_enabled.png differ diff --git a/media/images/back_enabled_hover.png b/media/images/back_enabled_hover.png new file mode 100644 index 00000000..d300f106 Binary files /dev/null and b/media/images/back_enabled_hover.png differ diff --git a/media/images/forward_disabled.jpg b/media/images/forward_disabled.jpg deleted file mode 100644 index 28a9dc53..00000000 Binary files a/media/images/forward_disabled.jpg and /dev/null differ diff --git a/media/images/forward_disabled.png b/media/images/forward_disabled.png new file mode 100644 index 00000000..6a6ded7d Binary files /dev/null and b/media/images/forward_disabled.png differ diff --git a/media/images/forward_enabled.jpg b/media/images/forward_enabled.jpg deleted file mode 100644 index 598c075f..00000000 Binary files a/media/images/forward_enabled.jpg and /dev/null differ diff --git a/media/images/forward_enabled.png b/media/images/forward_enabled.png new file mode 100644 index 00000000..a4e6b538 Binary files /dev/null and b/media/images/forward_enabled.png differ diff --git a/media/images/forward_enabled_hover.png b/media/images/forward_enabled_hover.png new file mode 100644 index 00000000..fc46c5eb Binary files /dev/null and b/media/images/forward_enabled_hover.png differ diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index be4fdd28..38133f14 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -1,18 +1,17 @@ -/* - * File: jquery.dataTables.js - * Version: 1.8.3.dev - * Description: Paginate, search and sort HTML tables - * Author: Allan Jardine (www.sprymedia.co.uk) - * Created: 28/3/2008 - * Language: Javascript - * License: GPL v2 or BSD 3 point style - * Project: Mtaala - * Contact: allan.jardine@sprymedia.co.uk - * - * Copyright 2008-2011 Allan Jardine, all rights reserved. +/** + * @summary DataTables + * @description Paginate, search and sort HTML tables + * @version 1.9.0.dev + * @file jquery.dataTables.js + * @author Allan Jardine (www.sprymedia.co.uk) + * @contact www.sprymedia.co.uk/contact + * + * @copyright Copyright 2010-2011 Allan Jardine, all rights reserved. * * This source file is free software, under either the GPL v2 license or a - * BSD style license, as supplied with this software. + * BSD style license, available at: + * http://datatables.net/license_gpl2 + * http://datatables.net/license_bsd * * This source file is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY @@ -21,2546 +20,89 @@ * For details please refer to: http://www.datatables.net */ -/* - * 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,_fnInitialise,_fnInitComplete,_fnLanguageProcess,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_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,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_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,_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,_fnApplyColumnDefs,_fnBindAction*/ -(function($, window, document) { - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Section - DataTables variables - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - /* - * Variable: dataTableSettings - * Purpose: Store the settings for each dataTables instance - * Scope: jQuery.fn - */ - $.fn.dataTableSettings = []; - var _aoSettings = $.fn.dataTableSettings; /* Short reference for fast internal lookup */ - - /* - * Variable: dataTableExt - * Purpose: Container for customisable parts of DataTables - * Scope: jQuery.fn - */ - $.fn.dataTableExt = {}; - var _oExt = $.fn.dataTableExt; - - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Section - DataTables extensible objects +(/** @lends */function($, window, document, undefined) { + /** + * DataTables is a plug-in for the jQuery Javascript library. It is a + * highly flexible tool, based upon the foundations of progressive + * enhancement, which will add advanced interaction controls to any + * HTML table. For a full list of features please refer to + * DataTables.net. + * + * Note that the DataTable object is not a global variable but is + * aliased to jQuery.fn.DataTable and jQuery.fn.dataTable through which + * it may be accessed. + * + * @class + * @param {object} [oInit={}] Configuration object for DataTables. Options + * are defined by {@link DataTable.defaults} + * @requires jQuery 1.3+ * - * The _oExt object is used to provide an area where user defined plugins can be - * added to DataTables. The following properties of the object are used: - * oApi - Plug-in API functions - * aTypes - Auto-detection of types - * oSort - Sorting functions used by DataTables (based on the type) - * oPagination - Pagination functions for different input styles - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - /* - * Variable: sVersion - * Purpose: Version string for plug-ins to check compatibility - * Scope: jQuery.fn.dataTableExt - * 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 + * @example + * // Basic initialisation + * $(document).ready( function { + * $('#example').dataTable(); + * } ); + * + * @example + * // Initialisation with configuration options - in this case, disable + * // pagination and sorting. + * $(document).ready( function { + * $('#example').dataTable( { + * "bPaginate": false, + * "bSort": false + * } ); + * } ); */ - _oExt.sVersion = "1.8.3.dev"; - - /* - * Variable: sErrMode - * Purpose: How should DataTables report an error. Can take the value 'alert' or 'throw' - * Scope: jQuery.fn.dataTableExt - */ - _oExt.sErrMode = "alert"; - - /* - * Variable: iApiIndex - * Purpose: Index for what 'this' index API functions should use - * Scope: jQuery.fn.dataTableExt - */ - _oExt.iApiIndex = 0; - - /* - * Variable: oApi - * Purpose: Container for plugin API functions - * Scope: jQuery.fn.dataTableExt - */ - _oExt.oApi = { }; - - /* - * Variable: aFiltering - * Purpose: Container for plugin filtering functions - * Scope: jQuery.fn.dataTableExt - */ - _oExt.afnFiltering = [ ]; - - /* - * Variable: aoFeatures - * Purpose: Container for plugin function functions - * Scope: jQuery.fn.dataTableExt - * Notes: Array of objects with the following parameters: - * fnInit: Function for initialisation of Feature. Takes oSettings and returns node - * cFeature: Character that will be matched in sDom - case sensitive - * sFeature: Feature name - just for completeness :-) - */ - _oExt.aoFeatures = [ ]; - - /* - * Variable: ofnSearch - * Purpose: Container for custom filtering functions - * Scope: jQuery.fn.dataTableExt - * Notes: This is an object (the name should match the type) for custom filtering function, - * which can be used for live DOM checking or formatted text filtering - */ - _oExt.ofnSearch = { }; - - /* - * Variable: afnSortData - * Purpose: Container for custom sorting data source functions - * Scope: jQuery.fn.dataTableExt - * Notes: Array (associative) of functions which is run prior to a column of this - * 'SortDataType' being sorted upon. - * Function input parameters: - * object:oSettings- DataTables settings object - * int:iColumn - Target column number - * Return value: Array of data which exactly matched the full data set size for the column to - * be sorted upon - */ - _oExt.afnSortData = [ ]; - - /* - * Variable: oStdClasses - * Purpose: Storage for the various classes that DataTables uses - * Scope: jQuery.fn.dataTableExt - */ - _oExt.oStdClasses = { - /* Two buttons buttons */ - "sPagePrevEnabled": "paginate_enabled_previous", - "sPagePrevDisabled": "paginate_disabled_previous", - "sPageNextEnabled": "paginate_enabled_next", - "sPageNextDisabled": "paginate_disabled_next", - "sPageJUINext": "", - "sPageJUIPrev": "", - - /* Full numbers paging buttons */ - "sPageButton": "paginate_button", - "sPageButtonActive": "paginate_active", - "sPageButtonStaticDisabled": "paginate_button paginate_button_disabled", - "sPageFirst": "first", - "sPagePrevious": "previous", - "sPageNext": "next", - "sPageLast": "last", - - /* Striping classes */ - "sStripeOdd": "odd", - "sStripeEven": "even", - - /* Empty row */ - "sRowEmpty": "dataTables_empty", - - /* Features */ - "sWrapper": "dataTables_wrapper", - "sFilter": "dataTables_filter", - "sInfo": "dataTables_info", - "sPaging": "dataTables_paginate paging_", /* Note that the type is postfixed */ - "sLength": "dataTables_length", - "sProcessing": "dataTables_processing", - - /* Sorting */ - "sSortAsc": "sorting_asc", - "sSortDesc": "sorting_desc", - "sSortable": "sorting", /* Sortable in both directions */ - "sSortableAsc": "sorting_asc_disabled", - "sSortableDesc": "sorting_desc_disabled", - "sSortableNone": "sorting_disabled", - "sSortColumn": "sorting_", /* Note that an int is postfixed for the sorting order */ - "sSortJUIAsc": "", - "sSortJUIDesc": "", - "sSortJUI": "", - "sSortJUIAscAllowed": "", - "sSortJUIDescAllowed": "", - "sSortJUIWrapper": "", - "sSortIcon": "", - - /* Scrolling */ - "sScrollWrapper": "dataTables_scroll", - "sScrollHead": "dataTables_scrollHead", - "sScrollHeadInner": "dataTables_scrollHeadInner", - "sScrollBody": "dataTables_scrollBody", - "sScrollFoot": "dataTables_scrollFoot", - "sScrollFootInner": "dataTables_scrollFootInner", - - /* Misc */ - "sFooterTH": "" - }; - - /* - * Variable: oJUIClasses - * Purpose: Storage for the various classes that DataTables uses - jQuery UI suitable - * Scope: jQuery.fn.dataTableExt - */ - _oExt.oJUIClasses = { - /* Two buttons buttons */ - "sPagePrevEnabled": "fg-button ui-button ui-state-default ui-corner-left", - "sPagePrevDisabled": "fg-button ui-button ui-state-default ui-corner-left ui-state-disabled", - "sPageNextEnabled": "fg-button ui-button ui-state-default ui-corner-right", - "sPageNextDisabled": "fg-button ui-button ui-state-default ui-corner-right ui-state-disabled", - "sPageJUINext": "ui-icon ui-icon-circle-arrow-e", - "sPageJUIPrev": "ui-icon ui-icon-circle-arrow-w", - - /* Full numbers paging buttons */ - "sPageButton": "fg-button ui-button ui-state-default", - "sPageButtonActive": "fg-button ui-button ui-state-default ui-state-disabled", - "sPageButtonStaticDisabled": "fg-button ui-button ui-state-default ui-state-disabled", - "sPageFirst": "first ui-corner-tl ui-corner-bl", - "sPagePrevious": "previous", - "sPageNext": "next", - "sPageLast": "last ui-corner-tr ui-corner-br", - - /* Striping classes */ - "sStripeOdd": "odd", - "sStripeEven": "even", - - /* Empty row */ - "sRowEmpty": "dataTables_empty", - - /* Features */ - "sWrapper": "dataTables_wrapper", - "sFilter": "dataTables_filter", - "sInfo": "dataTables_info", - "sPaging": "dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi "+ - "ui-buttonset-multi paging_", /* Note that the type is postfixed */ - "sLength": "dataTables_length", - "sProcessing": "dataTables_processing", - - /* Sorting */ - "sSortAsc": "ui-state-default", - "sSortDesc": "ui-state-default", - "sSortable": "ui-state-default", - "sSortableAsc": "ui-state-default", - "sSortableDesc": "ui-state-default", - "sSortableNone": "ui-state-default", - "sSortColumn": "sorting_", /* Note that an int is postfixed for the sorting order */ - "sSortJUIAsc": "css_right ui-icon ui-icon-triangle-1-n", - "sSortJUIDesc": "css_right ui-icon ui-icon-triangle-1-s", - "sSortJUI": "css_right ui-icon ui-icon-carat-2-n-s", - "sSortJUIAscAllowed": "css_right ui-icon ui-icon-carat-1-n", - "sSortJUIDescAllowed": "css_right ui-icon ui-icon-carat-1-s", - "sSortJUIWrapper": "DataTables_sort_wrapper", - "sSortIcon": "DataTables_sort_icon", - - /* Scrolling */ - "sScrollWrapper": "dataTables_scroll", - "sScrollHead": "dataTables_scrollHead ui-state-default", - "sScrollHeadInner": "dataTables_scrollHeadInner", - "sScrollBody": "dataTables_scrollBody", - "sScrollFoot": "dataTables_scrollFoot ui-state-default", - "sScrollFootInner": "dataTables_scrollFootInner", - - /* Misc */ - "sFooterTH": "ui-state-default" - }; - - /* - * Variable: oPagination - * Purpose: Container for the various type of pagination that dataTables supports - * Scope: jQuery.fn.dataTableExt - */ - _oExt.oPagination = { - /* - * Variable: two_button - * Purpose: Standard two button (forward/back) pagination - * Scope: jQuery.fn.dataTableExt.oPagination - */ - "two_button": { - /* - * Function: oPagination.two_button.fnInit - * Purpose: Initialise dom elements required for pagination with forward/back buttons only - * Returns: - - * Inputs: object:oSettings - dataTables settings object - * node:nPaging - the DIV which contains this pagination control - * function:fnCallbackDraw - draw function which must be called on update - */ - "fnInit": function ( oSettings, nPaging, fnCallbackDraw ) - { - var nPrevious, nNext, nPreviousInner, nNextInner; - var fnClickHandler = function ( e ) { - if ( oSettings.oApi._fnPageChange( oSettings, e.data.action ) ) - { - fnCallbackDraw( oSettings ); - } - }; - - /* Store the next and previous elements in the oSettings object as they can be very - * usful for automation - particularly testing - */ - if ( !oSettings.bJUI ) - { - nPrevious = document.createElement( 'div' ); - nNext = document.createElement( 'div' ); - } - else - { - nPrevious = document.createElement( 'a' ); - nNext = document.createElement( 'a' ); - - nNextInner = document.createElement('span'); - nNextInner.className = oSettings.oClasses.sPageJUINext; - nNext.appendChild( nNextInner ); - - nPreviousInner = document.createElement('span'); - nPreviousInner.className = oSettings.oClasses.sPageJUIPrev; - nPrevious.appendChild( nPreviousInner ); - } - - nPrevious.className = oSettings.oClasses.sPagePrevDisabled; - nNext.className = oSettings.oClasses.sPageNextDisabled; - - nPrevious.title = oSettings.oLanguage.oPaginate.sPrevious; - nNext.title = oSettings.oLanguage.oPaginate.sNext; - - nPaging.appendChild( nPrevious ); - nPaging.appendChild( nNext ); - - $(nPrevious) - .bind( 'click.DT', { action: "previous" }, fnClickHandler ) - .bind( 'selectstart.DT', function () { return false; } ); /* Take the brutal approach to cancelling text selection */ - $(nNext) - .bind( 'click.DT', { action: "next" }, fnClickHandler ) - .bind( 'selectstart.DT', function () { return false; } ); - - /* ID the first elements only */ - if ( oSettings.sTableId !== '' && typeof oSettings.aanFeatures.p == "undefined" ) - { - nPaging.setAttribute( 'id', oSettings.sTableId+'_paginate' ); - nPrevious.setAttribute( 'id', oSettings.sTableId+'_previous' ); - nNext.setAttribute( 'id', oSettings.sTableId+'_next' ); - } - }, - - /* - * Function: oPagination.two_button.fnUpdate - * Purpose: Update the two button pagination at the end of the draw - * Returns: - - * Inputs: object:oSettings - dataTables settings object - * function:fnCallbackDraw - draw function to call on page change - */ - "fnUpdate": function ( oSettings, fnCallbackDraw ) - { - if ( !oSettings.aanFeatures.p ) - { - return; - } - - /* Loop over each instance of the pager */ - var an = oSettings.aanFeatures.p; - for ( var i=0, iLen=an.length ; i= (iPages - iPageCountHalf)) - { - iStartButton = iPages - iPageCount + 1; - iEndButton = iPages; - } - else - { - iStartButton = iCurrentPage - Math.ceil(iPageCount / 2) + 1; - iEndButton = iStartButton + iPageCount - 1; - } - } - } - - /* Build the dynamic list */ - for ( i=iStartButton ; i<=iEndButton ; i++ ) - { - if ( iCurrentPage != i ) - { - sList += ''+i+''; - } - else - { - sList += ''+i+''; - } - } - - /* Loop over each instance of the pager */ - var an = oSettings.aanFeatures.p; - var anButtons, anStatic, nPaginateList; - var fnClick = function(e) { - /* Use the information in the element to jump to the required page */ - var iTarget = (this.innerHTML * 1) - 1; - oSettings._iDisplayStart = iTarget * oSettings._iDisplayLength; - fnCallbackDraw( oSettings ); - e.preventDefault(); - }; - var fnFalse = function () { return false; }; - - for ( i=0, iLen=an.length ; i y) ? 1 : 0)); - }, - - "string-desc": function ( x, y ) - { - return ((x < y) ? 1 : ((x > y) ? -1 : 0)); - }, - - - /* - * html sorting (ignore html tags) - */ - "html-pre": function ( a ) - { - return a.replace( /<.*?>/g, "" ).toLowerCase(); - }, - - "html-asc": function ( x, y ) - { - return ((x < y) ? -1 : ((x > y) ? 1 : 0)); - }, - - "html-desc": function ( x, y ) - { - return ((x < y) ? 1 : ((x > y) ? -1 : 0)); - }, - - - /* - * date sorting - */ - "date-pre": function ( a ) - { - var x = Date.parse( a ); - - if ( isNaN(x) || x==="" ) - { - x = Date.parse( "01/01/1970 00:00:00" ); - } - return x; - }, - - "date-asc": function ( x, y ) - { - return x - y; - }, - - "date-desc": function ( x, y ) - { - return y - x; - }, - - - /* - * numerical sorting - */ - "numeric-asc": function ( a ) - { - return (a=="-" || a==="") ? 0 : a*1; - }, - - "numeric-asc": function ( x, y ) - { - return x - y; - }, - - "numeric-desc": function ( x, y ) - { - return y - x; - } - }; - - - /* - * Variable: aTypes - * Purpose: Container for the various type of type detection that dataTables supports - * Scope: jQuery.fn.dataTableExt - * Notes: The functions in this array are expected to parse a string to see if it is a data - * type that it recognises. If so then the function should return the name of the type (a - * corresponding sort function should be defined!), if the type is not recognised then the - * function should return null such that the parser and move on to check the next type. - * Note that ordering is important in this array - the functions are processed linearly, - * starting at index 0. - * Note that the input for these functions is always a string! It cannot be any other data - * type - */ - _oExt.aTypes = [ - /* - * Function: - - * Purpose: Check to see if a string is numeric - * Returns: string:'numeric' or null - * Inputs: mixed:sText - string to check - */ - function ( sData ) - { - /* Allow zero length strings as a number */ - if ( typeof sData == 'number' ) - { - return 'numeric'; - } - else if ( typeof sData != 'string' ) - { - return null; - } - - var sValidFirstChars = "0123456789-"; - var sValidChars = "0123456789."; - var Char; - var bDecimal = false; - - /* Check for a valid first char (no period and allow negatives) */ - Char = sData.charAt(0); - if (sValidFirstChars.indexOf(Char) == -1) - { - return null; - } - - /* Check all the other characters are valid */ - for ( var i=1 ; i') != -1 ) - { - return 'html'; - } - return null; - } - ]; - - /* - * Function: fnVersionCheck - * Purpose: Check a version string against this version of DataTables. Useful for plug-ins - * Returns: bool:true -this version of DataTables is greater or equal to the required version - * false -this version of DataTales is not suitable - * Inputs: string:sVersion - the version to check against. May be in the following formats: - * "a", "a.b" or "a.b.c" - * Notes: This function will only check the first three parts of a version string. It is - * assumed that beta and dev versions will meet the requirements. This might change in future - */ - _oExt.fnVersionCheck = function( sVersion ) + var DataTable = function( oInit ) { - /* This is cheap, but very effective */ - var fnZPad = function (Zpad, count) - { - while(Zpad.length < count) { - Zpad += '0'; - } - return Zpad; - }; - var aThis = _oExt.sVersion.split('.'); - var aThat = sVersion.split('.'); - var sThis = '', sThat = ''; - - for ( var i=0, iLen=aThat.length ; i= parseInt(sThat, 10); - }; - - /* - * Variable: _oExternConfig - * Purpose: Store information for DataTables to access globally about other instances - * Scope: jQuery.fn.dataTableExt - */ - _oExt._oExternConfig = { - /* int:iNextUnique - next unique number for an instance */ - "iNextUnique": 0 - }; - - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Section - DataTables prototype - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - /* - * Function: dataTable - * Purpose: DataTables information - * Returns: - - * Inputs: object:oInit - initialisation options for the table - */ - $.fn.dataTable = function( oInit ) - { - /* - * Function: classSettings - * Purpose: Settings container function for all 'class' properties which are required - * by dataTables - * Returns: - - * Inputs: - - */ - function classSettings () - { - this.fnRecordsTotal = function () - { - if ( this.oFeatures.bServerSide ) { - return parseInt(this._iRecordsTotal, 10); - } else { - return this.aiDisplayMaster.length; - } - }; - - this.fnRecordsDisplay = function () - { - if ( this.oFeatures.bServerSide ) { - return parseInt(this._iRecordsDisplay, 10); - } else { - return this.aiDisplay.length; - } - }; - - this.fnDisplayEnd = function () - { - if ( this.oFeatures.bServerSide ) { - if ( this.oFeatures.bPaginate === false || this._iDisplayLength == -1 ) { - return this._iDisplayStart+this.aiDisplay.length; - } else { - return Math.min( this._iDisplayStart+this._iDisplayLength, - this._iRecordsDisplay ); - } - } else { - return this._iDisplayEnd; - } - }; - - /* - * Variable: oInstance - * Purpose: The DataTables object for this table - * Scope: jQuery.dataTable.classSettings - */ - this.oInstance = null; - - /* - * Variable: sInstance - * Purpose: Unique idendifier for each instance of the DataTables object - * Scope: jQuery.dataTable.classSettings - */ - this.sInstance = null; - - /* - * Variable: oFeatures - * Purpose: Indicate the enablement of key dataTable features - * Scope: jQuery.dataTable.classSettings - */ - this.oFeatures = { - "bPaginate": true, - "bLengthChange": true, - "bFilter": true, - "bSort": true, - "bInfo": true, - "bAutoWidth": true, - "bProcessing": false, - "bSortClasses": true, - "bStateSave": false, - "bServerSide": false, - "bDeferRender": false - }; - - /* - * Variable: oScroll - * Purpose: Container for scrolling options - * Scope: jQuery.dataTable.classSettings - */ - this.oScroll = { - "sX": "", - "sXInner": "", - "sY": "", - "bCollapse": false, - "bInfinite": false, - "iLoadGap": 100, - "iBarWidth": 0, - "bAutoCss": true - }; - - /* - * Variable: aanFeatures - * Purpose: Array referencing the nodes which are used for the features - * Scope: jQuery.dataTable.classSettings - * Notes: The parameters of this object match what is allowed by sDom - i.e. - * 'l' - Length changing - * 'f' - Filtering input - * 't' - The table! - * 'i' - Information - * 'p' - Pagination - * 'r' - pRocessing - */ - this.aanFeatures = []; - - /* - * Variable: oLanguage - * Purpose: Store the language strings used by dataTables - * Scope: jQuery.dataTable.classSettings - * Notes: The words in the format _VAR_ are variables which are dynamically replaced - * by javascript - */ - this.oLanguage = { - "sProcessing": "Processing...", - "sLengthMenu": "Show _MENU_ entries", - "sZeroRecords": "No matching records found", - "sEmptyTable": "No data available in table", - "sLoadingRecords": "Loading...", - "sInfo": "Showing _START_ to _END_ of _TOTAL_ entries", - "sInfoEmpty": "Showing 0 to 0 of 0 entries", - "sInfoFiltered": "(filtered from _MAX_ total entries)", - "sInfoPostFix": "", - "sInfoThousands": ",", - "sSearch": "Search:", - "sUrl": "", - "oPaginate": { - "sFirst": "First", - "sPrevious": "Previous", - "sNext": "Next", - "sLast": "Last" - }, - "fnInfoCallback": null - }; - - /* - * Variable: aoData - * Purpose: Store data information - * Scope: jQuery.dataTable.classSettings - * Notes: This is an array of objects with the following parameters: - * int: _iId - internal id for tracking - * array: _aData - internal data - used for sorting / filtering etc - * node: nTr - display node - * array node: _anHidden - hidden TD nodes - * string: _sRowStripe - */ - this.aoData = []; - - /* - * Variable: aiDisplay - * Purpose: Array of indexes which are in the current display (after filtering etc) - * Scope: jQuery.dataTable.classSettings - */ - this.aiDisplay = []; - - /* - * Variable: aiDisplayMaster - * Purpose: Array of indexes for display - no filtering - * Scope: jQuery.dataTable.classSettings - */ - this.aiDisplayMaster = []; - - /* - * Variable: aoColumns - * Purpose: Store information about each column that is in use - * Scope: jQuery.dataTable.classSettings - */ - this.aoColumns = []; - - /* - * Variable: aoHeader - * Purpose: Store information about the table's header - * Scope: jQuery.dataTable.classSettings - */ - this.aoHeader = []; - - /* - * Variable: aoFooter - * Purpose: Store information about the table's footer - * Scope: jQuery.dataTable.classSettings - */ - this.aoFooter = []; - - /* - * Variable: iNextId - * Purpose: Store the next unique id to be used for a new row - * Scope: jQuery.dataTable.classSettings - */ - this.iNextId = 0; - - /* - * Variable: asDataSearch - * Purpose: Search data array for regular expression searching - * Scope: jQuery.dataTable.classSettings - */ - this.asDataSearch = []; - - /* - * Variable: oPreviousSearch - * Purpose: Store the previous search incase we want to force a re-search - * or compare the old search to a new one - * Scope: jQuery.dataTable.classSettings - */ - this.oPreviousSearch = { - "sSearch": "", - "bRegex": false, - "bSmart": true - }; - - /* - * Variable: aoPreSearchCols - * Purpose: Store the previous search for each column - * Scope: jQuery.dataTable.classSettings - */ - this.aoPreSearchCols = []; - - /* - * Variable: aaSorting - * Purpose: Sorting information - * Scope: jQuery.dataTable.classSettings - * Notes: Index 0 - column number - * Index 1 - current sorting direction - * Index 2 - index of asSorting for this column - */ - this.aaSorting = [ [0, 'asc', 0] ]; - - /* - * Variable: aaSortingFixed - * Purpose: Sorting information that is always applied - * Scope: jQuery.dataTable.classSettings - */ - this.aaSortingFixed = null; - - /* - * Variable: asStripeClasses - * Purpose: Classes to use for the striping of a table - * Scope: jQuery.dataTable.classSettings - */ - this.asStripeClasses = []; - - /* - * Variable: asDestroyStripes - * Purpose: If restoring a table - we should restore its striping classes as well - * Scope: jQuery.dataTable.classSettings - */ - this.asDestroyStripes = []; - - /* - * Variable: sDestroyWidth - * Purpose: If restoring a table - we should restore its width - * Scope: jQuery.dataTable.classSettings - */ - this.sDestroyWidth = 0; - - /* - * Variable: fnRowCallback - * Purpose: Call this function every time a row is inserted (draw) - * Scope: jQuery.dataTable.classSettings - */ - this.fnRowCallback = null; - - /* - * Variable: fnHeaderCallback - * Purpose: Callback function for the header on each draw - * Scope: jQuery.dataTable.classSettings - */ - this.fnHeaderCallback = null; - - /* - * Variable: fnFooterCallback - * Purpose: Callback function for the footer on each draw - * Scope: jQuery.dataTable.classSettings - */ - this.fnFooterCallback = null; - - /* - * Variable: aoDrawCallback - * Purpose: Array of callback functions for draw callback functions - * Scope: jQuery.dataTable.classSettings - * Notes: Each array element is an object with the following parameters: - * function:fn - function to call - * string:sName - name callback (feature). useful for arranging array - */ - this.aoDrawCallback = []; - - /* - * Variable: fnPreDrawCallback - * Purpose: Callback function for just before the table is redrawn. A return of false - * will be used to cancel the draw. - * Scope: jQuery.dataTable.classSettings - */ - this.fnPreDrawCallback = null; - - /* - * Variable: fnInitComplete - * Purpose: Callback function for when the table has been initialised - * Scope: jQuery.dataTable.classSettings - */ - this.fnInitComplete = null; - - /* - * Variable: sTableId - * Purpose: Cache the table ID for quick access - * Scope: jQuery.dataTable.classSettings - */ - this.sTableId = ""; - - /* - * Variable: nTable - * Purpose: Cache the table node for quick access - * Scope: jQuery.dataTable.classSettings - */ - this.nTable = null; - - /* - * Variable: nTHead - * Purpose: Permanent ref to the thead element - * Scope: jQuery.dataTable.classSettings - */ - this.nTHead = null; - - /* - * Variable: nTFoot - * Purpose: Permanent ref to the tfoot element - if it exists - * Scope: jQuery.dataTable.classSettings - */ - this.nTFoot = null; - - /* - * Variable: nTBody - * Purpose: Permanent ref to the tbody element - * Scope: jQuery.dataTable.classSettings - */ - this.nTBody = null; - - /* - * Variable: nTableWrapper - * Purpose: Cache the wrapper node (contains all DataTables controlled elements) - * Scope: jQuery.dataTable.classSettings - */ - this.nTableWrapper = null; - - /* - * Variable: bDeferLoading - * Purpose: Indicate if when using server-side processing the loading of data - * should be deferred until the second draw - * Scope: jQuery.dataTable.classSettings - */ - this.bDeferLoading = false; - - /* - * Variable: bInitialised - * Purpose: Indicate if all required information has been read in - * Scope: jQuery.dataTable.classSettings - */ - this.bInitialised = false; - - /* - * Variable: aoOpenRows - * Purpose: Information about open rows - * Scope: jQuery.dataTable.classSettings - * Notes: Has the parameters 'nTr' and 'nParent' - */ - this.aoOpenRows = []; - - /* - * Variable: sDom - * Purpose: Dictate the positioning that the created elements will take - * Scope: jQuery.dataTable.classSettings - * Notes: - * The following options are allowed: - * 'l' - Length changing - * 'f' - Filtering input - * 't' - The table! - * 'i' - Information - * 'p' - Pagination - * 'r' - pRocessing - * The following constants are allowed: - * 'H' - jQueryUI theme "header" classes - * 'F' - jQueryUI theme "footer" classes - * The following syntax is expected: - * '<' and '>' - div elements - * '<"class" and '>' - div with a class - * Examples: - * '<"wrapper"flipt>', 'ip>' - */ - this.sDom = 'lfrtip'; - - /* - * Variable: sPaginationType - * Purpose: Note which type of sorting should be used - * Scope: jQuery.dataTable.classSettings - */ - this.sPaginationType = "two_button"; - - /* - * Variable: iCookieDuration - * Purpose: The cookie duration (for bStateSave) in seconds - default 2 hours - * Scope: jQuery.dataTable.classSettings - */ - this.iCookieDuration = 60 * 60 * 2; - - /* - * Variable: sCookiePrefix - * Purpose: The cookie name prefix - * Scope: jQuery.dataTable.classSettings - */ - this.sCookiePrefix = "SpryMedia_DataTables_"; - - /* - * Variable: fnCookieCallback - * Purpose: Callback function for cookie creation - * Scope: jQuery.dataTable.classSettings - */ - this.fnCookieCallback = null; - - /* - * Variable: aoStateSave - * Purpose: Array of callback functions for state saving - * Scope: jQuery.dataTable.classSettings - * Notes: Each array element is an object with the following parameters: - * function:fn - function to call. Takes two parameters, oSettings and the JSON string to - * save that has been thus far created. Returns a JSON string to be inserted into a - * json object (i.e. '"param": [ 0, 1, 2]') - * string:sName - name of callback - */ - this.aoStateSave = []; - - /* - * Variable: aoStateLoad - * Purpose: Array of callback functions for state loading - * Scope: jQuery.dataTable.classSettings - * Notes: Each array element is an object with the following parameters: - * function:fn - function to call. Takes two parameters, oSettings and the object stored. - * May return false to cancel state loading. - * string:sName - name of callback - */ - this.aoStateLoad = []; - - /* - * Variable: oLoadedState - * Purpose: State that was loaded from the cookie. Useful for back reference - * Scope: jQuery.dataTable.classSettings - */ - this.oLoadedState = null; - - /* - * Variable: sAjaxSource - * Purpose: Source url for AJAX data for the table - * Scope: jQuery.dataTable.classSettings - */ - this.sAjaxSource = null; - - /* - * Variable: sAjaxDataProp - * Purpose: Property from a given object from which to read the table data from. This can - * be an empty string (when not server-side processing), in which case it is - * assumed an an array is given directly. - * Scope: jQuery.dataTable.classSettings - */ - this.sAjaxDataProp = 'aaData'; - - /* - * Variable: bAjaxDataGet - * Purpose: Note if draw should be blocked while getting data - * Scope: jQuery.dataTable.classSettings - */ - this.bAjaxDataGet = true; - - /* - * Variable: jqXHR - * Purpose: The last jQuery XHR object that was used for server-side data gathering. - * This can be used for working with the XHR information in one of the callbacks - * Scope: jQuery.dataTable.classSettings - */ - this.jqXHR = null; - - /* - * Variable: fnServerData - * Purpose: Function to get the server-side data - can be overruled by the developer - * Scope: jQuery.dataTable.classSettings - */ - this.fnServerData = function ( url, data, callback, settings ) { - settings.jqXHR = $.ajax( { - "url": url, - "data": data, - "success": function (json) { - $(settings.oInstance).trigger('xhr', settings); - callback( json ); - }, - "dataType": "json", - "cache": false, - "type": settings.sServerMethod, - "error": function (xhr, error, thrown) { - if ( error == "parsererror" ) { - alert( "DataTables warning: JSON data from server could not be parsed. "+ - "This is caused by a JSON formatting error." ); - } - } - } ); - }; - - /* - * Variable: aoServerParams - * Purpose: Functions which are called prior to sending an Ajax request so extra parameters - * can easily be sent to the server - * Scope: jQuery.dataTable.classSettings - * Notes: Each array element is an object with the following parameters: - * function:fn - function to call - * string:sName - name callback - useful for knowing where it came from (plugin etc) - */ - this.aoServerParams = []; - - /* - * Variable: sServerType - * Purpose: Send the XHR HTTP method - GET or POST (could be PUT or DELETE if required) - * Scope: jQuery.dataTable.classSettings - */ - this.sServerMethod = "GET"; - - /* - * Variable: fnFormatNumber - * Purpose: Format numbers for display - * Scope: jQuery.dataTable.classSettings - */ - this.fnFormatNumber = function ( iIn ) - { - if ( iIn < 1000 ) - { - /* A small optimisation for what is likely to be the vast majority of use cases */ - return iIn; - } - else - { - var s=(iIn+""), a=s.split(""), out="", iLen=s.length; - - for ( var i=0 ; i
    Rendering engine
    a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,unknownElems:!!a.getElementsByTagName("nav").length,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",enctype:!!c.createElement("form").enctype,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.lastChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-999px",top:"-999px"});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
    ",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
    t
    ",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;f(function(){var a,b,d,e,g,h,i=1,j="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",l="visibility:hidden;border:0;",n="style='"+j+"border:5px solid #000;padding:0;'",p="
    "+""+"
    ";m=c.getElementsByTagName("body")[0];!m||(a=c.createElement("div"),a.style.cssText=l+"width:0;height:0;position:static;top:0;margin-top:"+i+"px",m.insertBefore(a,m.firstChild),o=c.createElement("div"),o.style.cssText=j+l,o.innerHTML=p,a.appendChild(o),b=o.firstChild,d=b.firstChild,g=b.nextSibling.firstChild.firstChild,h={doesNotAddBorder:d.offsetTop!==5,doesAddBorderForTableAndCells:g.offsetTop===5},d.style.position="fixed",d.style.top="20px",h.fixedPosition=d.offsetTop===20||d.offsetTop===15,d.style.position=d.style.top="",b.style.overflow="hidden",b.style.position="relative",h.subtractsBorderForOverflowNotVisible=d.offsetTop===-5,h.doesNotIncludeMarginInBodyOffset=m.offsetTop!==i,m.removeChild(a),o=a=null,f.extend(k,h))}),o.innerHTML="",n.removeChild(o),o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[f.expando]:a[f.expando]&&f.expando,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[f.expando]=n=++f.uuid:n=f.expando),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[f.expando]:f.expando;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)?b=b:b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" "));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];if(!arguments.length){if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}return b}e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!a||j===3||j===8||j===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g},removeAttr:function(a,b){var c,d,e,g,h=0;if(a.nodeType===1){d=(b||"").split(p),g=d.length;for(;h=0}})});var z=/\.(.*)$/,A=/^(?:textarea|input|select)$/i,B=/\./g,C=/ /g,D=/[^\w\s.|`]/g,E=/^([^\.]*)?(?:\.(.+))?$/,F=/\bhover(\.\S+)?/,G=/^key/,H=/^(?:mouse|contextmenu)|click/,I=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,J=function(a){var b=I.exec(a);b&& -(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},K=function(a,b){return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||a.id===b[2])&&(!b[3]||b[3].test(a.className))},L=function(a){return f.event.special.hover?a:a.replace(F,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=L(c).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"",(g||!e)&&c.preventDefault();if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,n=null;for(m=e.parentNode;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l=0:t===b&&(t=o[s]=r.quick?K(m,r.quick):f(m).is(s)),t&&q.push(r);q.length&&j.push({elem:m,matches:q})}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),G.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),H.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

    ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
    ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var Y="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",Z=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,_=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,ba=/<([\w:]+)/,bb=/",""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},bk=X(c);bj.optgroup=bj.option,bj.tbody=bj.tfoot=bj.colgroup=bj.caption=bj.thead,bj.th=bj.td,f.support.htmlSerialize||(bj._default=[1,"div
    ","
    "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after" -,arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Z,""):null;if(typeof a=="string"&&!bd.test(a)&&(f.support.leadingWhitespace||!$.test(a))&&!bj[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(_,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bn(a,d),e=bo(a),g=bo(d);for(h=0;e[h];++h)g[h]&&bn(e[h],g[h])}if(b){bm(a,d);if(c){e=bo(a),g=bo(d);for(h=0;e[h];++h)bm(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!bc.test(k))k=b.createTextNode(k);else{k=k.replace(_,"<$1>");var l=(ba.exec(k)||["",""])[1].toLowerCase(),m=bj[l]||bj._default,n=m[0],o=b.createElement("div");b===c?bk.appendChild(o):X(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=bb.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&$.test(k)&&o.insertBefore(b.createTextNode($.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bt.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bs,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bs.test(g)?g.replace(bs,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bB(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bC=function(a,c){var d,e,g;c=c.replace(bu,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bD=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bv.test(f)&&bw.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bB=bC||bD,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bF=/%20/g,bG=/\[\]$/,bH=/\r?\n/g,bI=/#.*$/,bJ=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bK=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bL=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bM=/^(?:GET|HEAD)$/,bN=/^\/\//,bO=/\?/,bP=/)<[^<]*)*<\/script>/gi,bQ=/^(?:select|textarea)/i,bR=/\s+/,bS=/([?&])_=[^&]*/,bT=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bU=f.fn.load,bV={},bW={},bX,bY,bZ=["*/"]+["*"];try{bX=e.href}catch(b$){bX=c.createElement("a"),bX.href="",bX=bX.href}bY=bT.exec(bX.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bU)return bU.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
    ").append(c.replace(bP,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bQ.test(this.nodeName)||bK.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bH,"\r\n")}}):{name:b.name,value:c.replace(bH,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?cb(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),cb(a,b);return a},ajaxSettings:{url:bX,isLocal:bL.test(bY[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bZ},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:b_(bV),ajaxTransport:b_(bW),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cd(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=ce(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bJ.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bI,"").replace(bN,bY[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bR),d.crossDomain==null&&(r=bT.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bY[1]&&r[2]==bY[2]&&(r[3]||(r[1]==="http:"?80:443))==(bY[3]||(bY[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),ca(bV,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bM.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bO.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bS,"$1_="+x);d.url=y+(y===d.url?(bO.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bZ+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=ca(bW,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){s<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)cc(g,a[g],c,e);return d.join("&").replace(bF,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cf=f.now(),cg=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cf++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cg.test(b.url)||e&&cg.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cg,l),b.url===j&&(e&&(k=k.replace(cg,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ch=a.ActiveXObject?function(){for(var a in cj)cj[a](0,1)}:!1,ci=0,cj;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ck()||cl()}:ck,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ch&&delete cj[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++ci,ch&&(cj||(cj={},f(a).unload(ch)),cj[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cm={},cn,co,cp=/^(?:toggle|show|hide)$/,cq=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cr,cs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],ct;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cw("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cz.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cz.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cA(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cA(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
    a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
    "+""+"
    ",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
    t
    ",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
    ",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

    ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
    ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
    ","
    "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
    ").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/media/src/.DS_Store b/media/src/.DS_Store new file mode 100644 index 00000000..613c4b7b Binary files /dev/null and b/media/src/.DS_Store differ diff --git a/media/src/DataTables.js b/media/src/DataTables.js new file mode 100644 index 00000000..cb8498d9 --- /dev/null +++ b/media/src/DataTables.js @@ -0,0 +1,191 @@ +/** + * @summary DataTables + * @description Paginate, search and sort HTML tables + * @version 1.9.0.dev + * @file jquery.dataTables.js + * @author Allan Jardine (www.sprymedia.co.uk) + * @contact www.sprymedia.co.uk/contact + * + * @copyright Copyright 2010-2011 Allan Jardine, all rights reserved. + * + * This source file is free software, under either the GPL v2 license or a + * BSD style license, available at: + * http://datatables.net/license_gpl2 + * http://datatables.net/license_bsd + * + * This source file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. + * + * For details please refer to: http://www.datatables.net + */ + +/*jslint evil: true, undef: true, browser: true */ +/*globals $, jQuery,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_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,_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,_fnApplyColumnDefs,_fnBindAction*/ + +(/** @lends */function($, window, document, undefined) { + /** + * DataTables is a plug-in for the jQuery Javascript library. It is a + * highly flexible tool, based upon the foundations of progressive + * enhancement, which will add advanced interaction controls to any + * HTML table. For a full list of features please refer to + * DataTables.net. + * + * Note that the DataTable object is not a global variable but is + * aliased to jQuery.fn.DataTable and jQuery.fn.dataTable through which + * it may be accessed. + * + * @class + * @param {object} [oInit={}] Configuration object for DataTables. Options + * are defined by {@link DataTable.defaults} + * @requires jQuery 1.3+ + * + * @example + * // Basic initialisation + * $(document).ready( function { + * $('#example').dataTable(); + * } ); + * + * @example + * // Initialisation with configuration options - in this case, disable + * // pagination and sorting. + * $(document).ready( function { + * $('#example').dataTable( { + * "bPaginate": false, + * "bSort": false + * } ); + * } ); + */ + var DataTable = function( oInit ) + { + require('core.columns.js'); + require('core.data.js'); + require('core.draw.js'); + require('core.ajax.js'); + require('core.filter.js'); + require('core.info.js'); + require('core.init.js'); + require('core.length.js'); + require('core.page.js'); + require('core.processing.js'); + require('core.scrolling.js'); + require('core.sizing.js'); + require('core.sort.js'); + require('core.state.js'); + require('core.support.js'); + + require('api.methods.js'); + require('api.internal.js'); + + var _that = this; + return this.each(function() { + require('core.constructor.js'); + } ); + }; + + /** + * Version string for plug-ins to check compatibility. 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 + * @member + * @type string + * @default Version number + */ + DataTable.version = "1.9.0.dev"; + + /** + * Private data store, containing all of the settings objects that are created for the + * tables on a given page. + * + * Note that the DataTable.settings object is aliased to jQuery.fn.dataTableExt + * through which is may be accessed and manipulated, or jQuery.fn.dataTable.settings. + * @member + * @type array + * @default [] + * @private + */ + DataTable.settings = []; + + /** + * Object models container, for the various models that DataTables has available + * to it. These models define the objects that are used to hold the active state + * and configuration of the table. + * @namespace + */ + DataTable.models = {}; + require('model.ext.js'); + require('model.search.js'); + require('model.row.js'); + require('model.column.js'); + require('model.defaults.js'); + require('model.defaults.columns.js'); + require('model.settings.js'); + + /** + * Extension object for DataTables that is used to provide all extension options. + * See {@link DataTable.models.ext} for full information about the extension object. + * + * Note that the DataTable.ext object is aliased to jQuery.fn.dataTableExt + * through which is may be accessed and manipulated, or jQuery.fn.dataTable.ext. + * @namespace + */ + DataTable.ext = $.extend( true, {}, DataTable.models.ext ); + require('ext.classes.js'); + require('ext.paging.js'); + require('ext.sorting.js'); + require('ext.types.js'); + + // jQuery aliases + $.fn.DataTable = DataTable; + $.fn.dataTable = DataTable; + $.fn.dataTableSettings = DataTable.settings; + $.fn.dataTableExt = DataTable.ext; + + + // Information about events fired by DataTables - for documentation. + /** + * Draw event, fired whenever the table is redrawn on the page, at the same point as + * fnDrawCallback. This may be useful for binding events or performing calculations when + * the table is altered at all. + * @name DataTable#draw + * @event + * @param {event} e jQuery event object + * @param {object} o DataTables settings object {@link DataTable.models.oSettings} + */ + + /** + * Filter event, fired when the filtering applied to the table (using the build in global + * global filter, or column filters) is altered. + * @name DataTable#filter + * @event + * @param {event} e jQuery event object + * @param {object} o DataTables settings object {@link DataTable.models.oSettings} + */ + + /** + * Page change event, fired when the paging of the table is altered. + * @name DataTable#page + * @event + * @param {event} e jQuery event object + * @param {object} o DataTables settings object {@link DataTable.models.oSettings} + */ + + /** + * Sort event, fired when the sorting applied to the table is altered. + * @name DataTable#sort + * @event + * @param {event} e jQuery event object + * @param {object} o DataTables settings object {@link DataTable.models.oSettings} + */ + + /** + * Ajax (XHR) event, fired whenever an Ajax request is completed from a request to + * made to the server for new data (note that this trigger is called in fnServerData, + * if you override fnServerData and which to use this event, you need to trigger it in + * you success function). + * @name DataTable#xhr + * @event + * @param {event} e jQuery event object + * @param {object} o DataTables settings object {@link DataTable.models.oSettings} + */ +}(jQuery, window, document, undefined)); diff --git a/media/src/api/api.internal.js b/media/src/api/api.internal.js new file mode 100644 index 00000000..a10f5359 --- /dev/null +++ b/media/src/api/api.internal.js @@ -0,0 +1,122 @@ + +/* + * This is really a good bit rubbish this method of exposing the internal methods + * publically... - To be fixed in 2.0 using methods on the prototype + */ + + +/** + * Create a wrapper function for exporting an internal functions to an external API. + * @param {string} sFunc API function name + * @returns {function} wrapped function + * @memberof DataTable#oApi + */ +function _fnExternApiFunc (sFunc) +{ + return function() { + var aArgs = [_fnSettingsFromNode(this[DataTable.ext.iApiIndex])].concat( + Array.prototype.slice.call(arguments) ); + return DataTable.ext.oApi[sFunc].apply( this, aArgs ); + }; +} + + +/** + * Reference to internal functions for use by plug-in developers. Note that these + * methods are references to internal functions and are considered to be private. + * If you use these methods, be aware that they are liable to change between versions + * (check the upgrade notes). + * @namespace + */ +this.oApi = { + "_fnExternApiFunc": _fnExternApiFunc, + "_fnInitialise": _fnInitialise, + "_fnInitComplete": _fnInitComplete, + "_fnLanguageCompat": _fnLanguageCompat, + "_fnAddColumn": _fnAddColumn, + "_fnColumnOptions": _fnColumnOptions, + "_fnAddData": _fnAddData, + "_fnCreateTr": _fnCreateTr, + "_fnGatherData": _fnGatherData, + "_fnBuildHead": _fnBuildHead, + "_fnDrawHead": _fnDrawHead, + "_fnDraw": _fnDraw, + "_fnReDraw": _fnReDraw, + "_fnAjaxUpdate": _fnAjaxUpdate, + "_fnAjaxParameters": _fnAjaxParameters, + "_fnAjaxUpdateDraw": _fnAjaxUpdateDraw, + "_fnServerParams": _fnServerParams, + "_fnAddOptionsHtml": _fnAddOptionsHtml, + "_fnFeatureHtmlTable": _fnFeatureHtmlTable, + "_fnScrollDraw": _fnScrollDraw, + "_fnAdjustColumnSizing": _fnAdjustColumnSizing, + "_fnFeatureHtmlFilter": _fnFeatureHtmlFilter, + "_fnFilterComplete": _fnFilterComplete, + "_fnFilterCustom": _fnFilterCustom, + "_fnFilterColumn": _fnFilterColumn, + "_fnFilter": _fnFilter, + "_fnBuildSearchArray": _fnBuildSearchArray, + "_fnBuildSearchRow": _fnBuildSearchRow, + "_fnFilterCreateSearch": _fnFilterCreateSearch, + "_fnDataToSearch": _fnDataToSearch, + "_fnSort": _fnSort, + "_fnSortAttachListener": _fnSortAttachListener, + "_fnSortingClasses": _fnSortingClasses, + "_fnFeatureHtmlPaginate": _fnFeatureHtmlPaginate, + "_fnPageChange": _fnPageChange, + "_fnFeatureHtmlInfo": _fnFeatureHtmlInfo, + "_fnUpdateInfo": _fnUpdateInfo, + "_fnFeatureHtmlLength": _fnFeatureHtmlLength, + "_fnFeatureHtmlProcessing": _fnFeatureHtmlProcessing, + "_fnProcessingDisplay": _fnProcessingDisplay, + "_fnVisibleToColumnIndex": _fnVisibleToColumnIndex, + "_fnColumnIndexToVisible": _fnColumnIndexToVisible, + "_fnNodeToDataIndex": _fnNodeToDataIndex, + "_fnVisbleColumns": _fnVisbleColumns, + "_fnCalculateEnd": _fnCalculateEnd, + "_fnConvertToWidth": _fnConvertToWidth, + "_fnCalculateColumnWidths": _fnCalculateColumnWidths, + "_fnScrollingWidthAdjust": _fnScrollingWidthAdjust, + "_fnGetWidestNode": _fnGetWidestNode, + "_fnGetMaxLenString": _fnGetMaxLenString, + "_fnStringToCss": _fnStringToCss, + "_fnDetectType": _fnDetectType, + "_fnSettingsFromNode": _fnSettingsFromNode, + "_fnGetDataMaster": _fnGetDataMaster, + "_fnGetTrNodes": _fnGetTrNodes, + "_fnGetTdNodes": _fnGetTdNodes, + "_fnEscapeRegex": _fnEscapeRegex, + "_fnDeleteIndex": _fnDeleteIndex, + "_fnReOrderIndex": _fnReOrderIndex, + "_fnColumnOrdering": _fnColumnOrdering, + "_fnLog": _fnLog, + "_fnClearTable": _fnClearTable, + "_fnSaveState": _fnSaveState, + "_fnLoadState": _fnLoadState, + "_fnCreateCookie": _fnCreateCookie, + "_fnReadCookie": _fnReadCookie, + "_fnDetectHeader": _fnDetectHeader, + "_fnGetUniqueThs": _fnGetUniqueThs, + "_fnScrollBarWidth": _fnScrollBarWidth, + "_fnApplyToChildren": _fnApplyToChildren, + "_fnMap": _fnMap, + "_fnGetRowData": _fnGetRowData, + "_fnGetCellData": _fnGetCellData, + "_fnSetCellData": _fnSetCellData, + "_fnGetObjectDataFn": _fnGetObjectDataFn, + "_fnSetObjectDataFn": _fnSetObjectDataFn, + "_fnApplyColumnDefs": _fnApplyColumnDefs, + "_fnBindAction": _fnBindAction, + "_fnExtend": _fnExtend +}; + +$.extend( DataTable.ext.oApi, this.oApi ); + +for ( var sFunc in DataTable.ext.oApi ) +{ + if ( sFunc ) + { + this[sFunc] = _fnExternApiFunc(sFunc); + } +} + diff --git a/media/src/api/api.methods.js b/media/src/api/api.methods.js new file mode 100644 index 00000000..d0eb1fae --- /dev/null +++ b/media/src/api/api.methods.js @@ -0,0 +1,1145 @@ + + +/** + * Perform a jQuery selector action on the table's TR elements (from the tbody) and + * return the resulting jQuery object. + * @param {string} sSelector jQuery selector + * @param {object} [oOpts] Optional parameters for modifying the rows to be included + * @param {string} [oOpts.filter=none] Select TR elements that meet the current filter + * criterion ("applied") or all TR elements (i.e. no filter). + * @param {string} [oOpts.order=current] Order of the TR elements in the processed array. + * Can be either 'current', whereby the current sorting of the table is used, or + * 'original' whereby the original order the data was read into the table is used. + * @param {string} [oOpts.page=all] Limit the selection to the currently displayed page + * ("current") or not ("all"). If 'current' is given, then order is assumed to be + * 'current' and filter is 'applied', regardless of what they might be given as. + * @returns {object} jQuery object, filtered by the given selector. + * + * @example + * $(document).ready(function() { + * var oTable = $('#example').dataTable(); + * + * // Highlight every second row + * oTable.$('tr:odd').css('backgroundColor', 'blue'); + * } ); + * + * @example + * $(document).ready(function() { + * var oTable = $('#example').dataTable(); + * + * // Filter to rows with 'Webkit' in them, add a background colour and then + * // remove the filter, thus highlighting the 'Webkit' rows only. + * oTable.fnFilter('Webkit'); + * oTable.$('tr', {"filter": "applied"}).css('backgroundColor', 'blue'); + * oTable.fnFilter(''); + * } ); + */ +this.$ = function ( sSelector, oOpts ) +{ + var i, iLen, a = []; + var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] ); + + if ( !oOpts ) + { + oOpts = {}; + } + + oOpts = $.extend( {}, { + "filter": "none", // applied + "order": "current", // "original" + "page": "all" // current + }, oOpts ); + + // Current page implies that order=current and fitler=applied, since it is fairly + // senseless otherwise + if ( oOpts.page == 'current' ) + { + for ( i=oSettings._iDisplayStart, iLen=oSettings.fnDisplayEnd() ; i + *
  • 1D array of data - add a single row with the data provided
  • + *
  • 2D array of arrays - add multiple rows in a single call
  • + *
  • object - data object when using mDataProp
  • + *
  • array of objects - multiple data objects when using mDataProp
  • + * + * @param {bool} [bRedraw=true] redraw the table or not + * @returns {array} An array of integers, representing the list of indexes in + * aoData ({@link DataTable.models.oSettings}) that have been added to + * the table. + * + * @example + * // Global var for counter + * var giCount = 2; + * + * $(document).ready(function() { + * $('#example').dataTable(); + * } ); + * + * function fnClickAddRow() { + * $('#example').dataTable().fnAddData( [ + * giCount+".1", + * giCount+".2", + * giCount+".3", + * giCount+".4" ] + * ); + * + * giCount++; + * } + */ +this.fnAddData = function( mData, bRedraw ) +{ + if ( mData.length === 0 ) + { + return []; + } + + var aiReturn = []; + var iTest; + + /* Find settings from table node */ + var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] ); + + /* Check if we want to add multiple rows or not */ + if ( typeof mData[0] === "object" ) + { + for ( var i=0 ; i= oSettings.aiDisplay.length ) + { + oSettings._iDisplayStart -= oSettings._iDisplayLength; + if ( oSettings._iDisplayStart < 0 ) + { + oSettings._iDisplayStart = 0; + } + } + + if ( bRedraw === undefined || bRedraw ) + { + _fnCalculateEnd( oSettings ); + _fnDraw( oSettings ); + } + + return oData; +}; + + +/** + * Restore the table to it's original state in the DOM by removing all of DataTables + * enhancements, alterations to the DOM structure of the table and event listeners. + * @param {boolean} [bRemove=false] Completely remove the table from the DOM + * + * @example + * $(document).ready(function() { + * // This example is fairly pointless in reality, but shows how fnDestroy can be used + * var oTable = $('#example').dataTable(); + * oTable.fnDestroy(); + * } ); + */ +this.fnDestroy = function ( bRemove ) +{ + var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] ); + var nOrig = oSettings.nTableWrapper.parentNode; + var nBody = oSettings.nTBody; + var i, iLen; + + bRemove = (bRemove===undefined) ? false : true; + + /* Flag to note that the table is currently being destroyed - no action should be taken */ + oSettings.bDestroying = true; + + /* Restore hidden columns */ + for ( i=0, iLen=oSettings.aoDestroyCallback.length ; i
    ')[0]; + + /* Check to see if we should append an id and/or a class name to the container */ + cNext = aDom[i+1]; + if ( cNext == "'" || cNext == '"' ) + { + sAttr = ""; + j = 2; + while ( aDom[i+j] != cNext ) + { + sAttr += aDom[i+j]; + j++; + } + + /* Replace jQuery UI constants */ + if ( sAttr == "H" ) + { + sAttr = "fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"; + } + else if ( sAttr == "F" ) + { + sAttr = "fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"; + } + + /* The attribute can be in the format of "#id.class", "#id" or "class" This logic + * breaks the string into parts and applies them as needed + */ + if ( sAttr.indexOf('.') != -1 ) + { + var aSplit = sAttr.split('.'); + nNewNode.id = aSplit[0].substr(1, aSplit[0].length-1); + nNewNode.className = aSplit[1]; + } + else if ( sAttr.charAt(0) == "#" ) + { + nNewNode.id = sAttr.substr(1, sAttr.length-1); + } + else + { + nNewNode.className = sAttr; + } + + i += j; /* Move along the position array */ + } + + nInsertNode.appendChild( nNewNode ); + nInsertNode = nNewNode; + } + else if ( cOption == '>' ) + { + /* End container div */ + nInsertNode = nInsertNode.parentNode; + } + else if ( cOption == 'l' && oSettings.oFeatures.bPaginate && oSettings.oFeatures.bLengthChange ) + { + /* Length */ + nTmp = _fnFeatureHtmlLength( oSettings ); + iPushFeature = 1; + } + else if ( cOption == 'f' && oSettings.oFeatures.bFilter ) + { + /* Filter */ + nTmp = _fnFeatureHtmlFilter( oSettings ); + iPushFeature = 1; + } + else if ( cOption == 'r' && oSettings.oFeatures.bProcessing ) + { + /* pRocessing */ + nTmp = _fnFeatureHtmlProcessing( oSettings ); + iPushFeature = 1; + } + else if ( cOption == 't' ) + { + /* Table */ + nTmp = _fnFeatureHtmlTable( oSettings ); + iPushFeature = 1; + } + else if ( cOption == 'i' && oSettings.oFeatures.bInfo ) + { + /* Info */ + nTmp = _fnFeatureHtmlInfo( oSettings ); + iPushFeature = 1; + } + else if ( cOption == 'p' && oSettings.oFeatures.bPaginate ) + { + /* Pagination */ + nTmp = _fnFeatureHtmlPaginate( oSettings ); + iPushFeature = 1; + } + else if ( DataTable.ext.aoFeatures.length !== 0 ) + { + /* Plug-in features */ + var aoFeatures = DataTable.ext.aoFeatures; + for ( var k=0, kLen=aoFeatures.length ; k') : + sSearchStr==="" ? '' : sSearchStr+' '; + + var nFilter = document.createElement( 'div' ); + nFilter.className = oSettings.oClasses.sFilter; + nFilter.innerHTML = ''; + if ( !oSettings.aanFeatures.f ) + { + nFilter.id = oSettings.sTableId+'_filter'; + } + + var jqFilter = $("input", nFilter); + jqFilter.val( oSettings.oPreviousSearch.sSearch.replace('"','"') ); + jqFilter.bind( 'keyup.DT', function(e) { + /* Update all other filter input elements for the new display */ + var n = oSettings.aanFeatures.f; + for ( var i=0, iLen=n.length ; i=0 ; i-- ) + { + var sData = _fnDataToSearch( _fnGetCellData( oSettings, oSettings.aiDisplay[i], iColumn, 'filter' ), + oSettings.aoColumns[iColumn].sType ); + if ( ! rpSearch.test( sData ) ) + { + oSettings.aiDisplay.splice( i, 1 ); + iIndexCorrector++; + } + } +} + + +/** + * Filter the data table based on user input and draw the table + * @param {object} oSettings dataTables settings object + * @param {string} sInput string to filter on + * @param {int} iForce optional - force a research of the master array (1) or not (undefined or 0) + * @param {bool} bRegex treat as a regular expression or not + * @param {bool} bSmart perform smart filtering or not + * @param {bool} bCaseInsensitive Do case insenstive matching or not + * @memberof DataTable#oApi + */ +function _fnFilter( oSettings, sInput, iForce, bRegex, bSmart, bCaseInsensitive ) +{ + var i; + var rpSearch = _fnFilterCreateSearch( sInput, bRegex, bSmart, bCaseInsensitive ); + + /* Check if we are forcing or not - optional parameter */ + if ( !iForce ) + { + iForce = 0; + } + + /* Need to take account of custom filtering functions - always filter */ + if ( DataTable.ext.afnFiltering.length !== 0 ) + { + iForce = 1; + } + + /* + * If the input is blank - we want the full data set + */ + if ( sInput.length <= 0 ) + { + oSettings.aiDisplay.splice( 0, oSettings.aiDisplay.length); + oSettings.aiDisplay = oSettings.aiDisplayMaster.slice(); + } + else + { + /* + * We are starting a new search or the new search string is smaller + * then the old one (i.e. delete). Search from the master array + */ + if ( oSettings.aiDisplay.length == oSettings.aiDisplayMaster.length || + oSettings.oPreviousSearch.sSearch.length > sInput.length || iForce == 1 || + sInput.indexOf(oSettings.oPreviousSearch.sSearch) !== 0 ) + { + /* Nuke the old display array - we are going to rebuild it */ + oSettings.aiDisplay.splice( 0, oSettings.aiDisplay.length); + + /* Force a rebuild of the search array */ + _fnBuildSearchArray( oSettings, 1 ); + + /* Search through all records to populate the search array + * The the oSettings.aiDisplayMaster and asDataSearch arrays have 1 to 1 + * mapping + */ + for ( i=0 ; i tag - remove it */ + sSearch = sSearch.replace(/\n/g," ").replace(/\r/g,""); + } + + return sSearch; +} + +/** + * Build a regular expression object suitable for searching a table + * @param {string} sSearch string to search for + * @param {bool} bRegex treat as a regular expression or not + * @param {bool} bSmart perform smart filtering or not + * @param {bool} bCaseInsensitive Do case insenstive matching or not + * @returns {RegExp} constructed object + * @memberof DataTable#oApi + */ +function _fnFilterCreateSearch( sSearch, bRegex, bSmart, bCaseInsensitive ) +{ + var asSearch, sRegExpString; + + if ( bSmart ) + { + /* Generate the regular expression to use. Something along the lines of: + * ^(?=.*?\bone\b)(?=.*?\btwo\b)(?=.*?\bthree\b).*$ + */ + asSearch = bRegex ? sSearch.split( ' ' ) : _fnEscapeRegex( sSearch ).split( ' ' ); + sRegExpString = '^(?=.*?'+asSearch.join( ')(?=.*?' )+').*$'; + return new RegExp( sRegExpString, bCaseInsensitive ? "i" : "" ); + } + else + { + sSearch = bRegex ? sSearch : _fnEscapeRegex( sSearch ); + return new RegExp( sSearch, bCaseInsensitive ? "i" : "" ); + } +} + + +/** + * Convert raw data into something that the user can search on + * @param {string} sData data to be modified + * @param {string} sType data type + * @returns {string} search string + * @memberof DataTable#oApi + */ +function _fnDataToSearch ( sData, sType ) +{ + if ( typeof DataTable.ext.ofnSearch[sType] === "function" ) + { + return DataTable.ext.ofnSearch[sType]( sData ); + } + else if ( sType == "html" ) + { + return sData.replace(/[\r\n]/g," ").replace( /<.*?>/g, "" ); + } + else if ( typeof sData === "string" ) + { + return sData.replace(/[\r\n]/g," "); + } + else if ( sData === null ) + { + return ''; + } + return sData; +} + + +/** + * scape a string stuch that it can be used in a regular expression + * @param {string} sVal string to escape + * @returns {string} escaped string + * @memberof DataTable#oApi + */ +function _fnEscapeRegex ( sVal ) +{ + var acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^' ]; + var reReplace = new RegExp( '(\\' + acEscape.join('|\\') + ')', 'g' ); + return sVal.replace(reReplace, '\\$1'); +} + diff --git a/media/src/core/core.info.js b/media/src/core/core.info.js new file mode 100644 index 00000000..97d6e9e1 --- /dev/null +++ b/media/src/core/core.info.js @@ -0,0 +1,106 @@ + + +/** + * Generate the node required for the info display + * @param {object} oSettings dataTables settings object + * @returns {node} Information element + * @memberof DataTable#oApi + */ +function _fnFeatureHtmlInfo ( oSettings ) +{ + var nInfo = document.createElement( 'div' ); + nInfo.className = oSettings.oClasses.sInfo; + + /* Actions that are to be taken once only for this feature */ + if ( !oSettings.aanFeatures.i ) + { + /* Add draw callback */ + oSettings.aoDrawCallback.push( { + "fn": _fnUpdateInfo, + "sName": "information" + } ); + + /* Add id */ + nInfo.id = oSettings.sTableId+'_info'; + } + oSettings.nTable.setAttribute( 'aria-describedby', oSettings.sTableId+'_info' ); + + return nInfo; +} + + +/** + * Update the information elements in the display + * @param {object} oSettings dataTables settings object + * @memberof DataTable#oApi + */ +function _fnUpdateInfo ( oSettings ) +{ + /* Show information about the table */ + if ( !oSettings.oFeatures.bInfo || oSettings.aanFeatures.i.length === 0 ) + { + return; + } + + var + iStart = oSettings._iDisplayStart+1, iEnd = oSettings.fnDisplayEnd(), + iMax = oSettings.fnRecordsTotal(), iTotal = oSettings.fnRecordsDisplay(), + sStart = oSettings.fnFormatNumber( iStart ), sEnd = oSettings.fnFormatNumber( iEnd ), + sMax = oSettings.fnFormatNumber( iMax ), sTotal = oSettings.fnFormatNumber( iTotal ), + sOut; + + /* When infinite scrolling, we are always starting at 1. _iDisplayStart is used only + * internally + */ + if ( oSettings.oScroll.bInfinite ) + { + sStart = oSettings.fnFormatNumber( 1 ); + } + + if ( oSettings.fnRecordsDisplay() === 0 && + oSettings.fnRecordsDisplay() == oSettings.fnRecordsTotal() ) + { + /* Empty record set */ + sOut = oSettings.oLanguage.sInfoEmpty+ oSettings.oLanguage.sInfoPostFix; + } + else if ( oSettings.fnRecordsDisplay() === 0 ) + { + /* Rmpty record set after filtering */ + sOut = oSettings.oLanguage.sInfoEmpty +' '+ + oSettings.oLanguage.sInfoFiltered.replace('_MAX_', sMax)+ + oSettings.oLanguage.sInfoPostFix; + } + else if ( oSettings.fnRecordsDisplay() == oSettings.fnRecordsTotal() ) + { + /* Normal record set */ + sOut = oSettings.oLanguage.sInfo. + replace('_START_', sStart). + replace('_END_', sEnd). + replace('_TOTAL_', sTotal)+ + oSettings.oLanguage.sInfoPostFix; + } + else + { + /* Record set after filtering */ + sOut = oSettings.oLanguage.sInfo. + replace('_START_', sStart). + replace('_END_', sEnd). + replace('_TOTAL_', sTotal) +' '+ + oSettings.oLanguage.sInfoFiltered.replace('_MAX_', + oSettings.fnFormatNumber(oSettings.fnRecordsTotal()))+ + oSettings.oLanguage.sInfoPostFix; + } + + if ( oSettings.oLanguage.fnInfoCallback !== null ) + { + sOut = oSettings.oLanguage.fnInfoCallback.call( oSettings.oInstance, + oSettings, iStart, iEnd, iMax, iTotal, sOut ); + } + + var n = oSettings.aanFeatures.i; + for ( var i=0, iLen=n.length ; i'; + var i, iLen; + + if ( oSettings.aLengthMenu.length == 2 && typeof oSettings.aLengthMenu[0] === 'object' && + typeof oSettings.aLengthMenu[1] === 'object' ) + { + for ( i=0, iLen=oSettings.aLengthMenu[0].length ; i'+ + oSettings.aLengthMenu[1][i]+''; + } + } + else + { + for ( i=0, iLen=oSettings.aLengthMenu.length ; i'+ + oSettings.aLengthMenu[i]+''; + } + } + sStdMenu += ''; + + var nLength = document.createElement( 'div' ); + if ( !oSettings.aanFeatures.l ) + { + nLength.id = oSettings.sTableId+'_length'; + } + nLength.className = oSettings.oClasses.sLength; + nLength.innerHTML = ''; + + /* + * Set the length to the current display length - thanks to Andrea Pavlovic for this fix, + * and Stefan Skopnik for fixing the fix! + */ + $('select option[value="'+oSettings._iDisplayLength+'"]', nLength).attr("selected", true); + + $('select', nLength).bind( 'change.DT', function(e) { + var iVal = $(this).val(); + + /* Update all other length options for the new display */ + var n = oSettings.aanFeatures.l; + for ( i=0, iLen=n.length ; i oSettings.aiDisplay.length || + oSettings._iDisplayLength == -1 ) + { + oSettings._iDisplayEnd = oSettings.aiDisplay.length; + } + else + { + oSettings._iDisplayEnd = oSettings._iDisplayStart + oSettings._iDisplayLength; + } + } +} + diff --git a/media/src/core/core.page.js b/media/src/core/core.page.js new file mode 100644 index 00000000..c652da8c --- /dev/null +++ b/media/src/core/core.page.js @@ -0,0 +1,119 @@ + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Note that most of the paging logic is done in + * DataTable.ext.oPagination + */ + +/** + * Generate the node required for default pagination + * @param {object} oSettings dataTables settings object + * @returns {node} Pagination feature node + * @memberof DataTable#oApi + */ +function _fnFeatureHtmlPaginate ( oSettings ) +{ + if ( oSettings.oScroll.bInfinite ) + { + return null; + } + + var nPaginate = document.createElement( 'div' ); + nPaginate.className = oSettings.oClasses.sPaging+oSettings.sPaginationType; + + DataTable.ext.oPagination[ oSettings.sPaginationType ].fnInit( oSettings, nPaginate, + function( oSettings ) { + _fnCalculateEnd( oSettings ); + _fnDraw( oSettings ); + } + ); + + /* Add a draw callback for the pagination on first instance, to update the paging display */ + if ( !oSettings.aanFeatures.p ) + { + oSettings.aoDrawCallback.push( { + "fn": function( oSettings ) { + DataTable.ext.oPagination[ oSettings.sPaginationType ].fnUpdate( oSettings, function( oSettings ) { + _fnCalculateEnd( oSettings ); + _fnDraw( oSettings ); + } ); + }, + "sName": "pagination" + } ); + } + return nPaginate; +} + + +/** + * Alter the display settings to change the page + * @param {object} oSettings dataTables settings object + * @param {string|int} mAction Paging action to take: "first", "previous", "next" or "last" + * or page number to jump to (integer) + * @returns {bool} true page has changed, false - no change (no effect) eg 'first' on page 1 + * @memberof DataTable#oApi + */ +function _fnPageChange ( oSettings, mAction ) +{ + var iOldStart = oSettings._iDisplayStart; + + if ( typeof mAction === "number" ) + { + oSettings._iDisplayStart = mAction * oSettings._iDisplayLength; + if ( oSettings._iDisplayStart > oSettings.fnRecordsDisplay() ) + { + oSettings._iDisplayStart = 0; + } + } + else if ( mAction == "first" ) + { + oSettings._iDisplayStart = 0; + } + else if ( mAction == "previous" ) + { + oSettings._iDisplayStart = oSettings._iDisplayLength>=0 ? + oSettings._iDisplayStart - oSettings._iDisplayLength : + 0; + + /* Correct for underrun */ + if ( oSettings._iDisplayStart < 0 ) + { + oSettings._iDisplayStart = 0; + } + } + else if ( mAction == "next" ) + { + if ( oSettings._iDisplayLength >= 0 ) + { + /* Make sure we are not over running the display array */ + if ( oSettings._iDisplayStart + oSettings._iDisplayLength < oSettings.fnRecordsDisplay() ) + { + oSettings._iDisplayStart += oSettings._iDisplayLength; + } + } + else + { + oSettings._iDisplayStart = 0; + } + } + else if ( mAction == "last" ) + { + if ( oSettings._iDisplayLength >= 0 ) + { + var iPages = parseInt( (oSettings.fnRecordsDisplay()-1) / oSettings._iDisplayLength, 10 ) + 1; + oSettings._iDisplayStart = (iPages-1) * oSettings._iDisplayLength; + } + else + { + oSettings._iDisplayStart = 0; + } + } + else + { + _fnLog( oSettings, 0, "Unknown paging action: "+mAction ); + } + $(oSettings.oInstance).trigger('page', oSettings); + + return iOldStart != oSettings._iDisplayStart; +} + diff --git a/media/src/core/core.processing.js b/media/src/core/core.processing.js new file mode 100644 index 00000000..f1bdd34c --- /dev/null +++ b/media/src/core/core.processing.js @@ -0,0 +1,42 @@ + + +/** + * Generate the node required for the processing node + * @param {object} oSettings dataTables settings object + * @returns {node} Processing element + * @memberof DataTable#oApi + */ +function _fnFeatureHtmlProcessing ( oSettings ) +{ + var nProcessing = document.createElement( 'div' ); + + if ( !oSettings.aanFeatures.r ) + { + nProcessing.id = oSettings.sTableId+'_processing'; + } + nProcessing.innerHTML = oSettings.oLanguage.sProcessing; + nProcessing.className = oSettings.oClasses.sProcessing; + oSettings.nTable.parentNode.insertBefore( nProcessing, oSettings.nTable ); + + return nProcessing; +} + + +/** + * Display or hide the processing indicator + * @param {object} oSettings dataTables settings object + * @param {bool} bShow Show the processing indicator (true) or not (false) + * @memberof DataTable#oApi + */ +function _fnProcessingDisplay ( oSettings, bShow ) +{ + if ( oSettings.oFeatures.bProcessing ) + { + var an = oSettings.aanFeatures.r; + for ( var i=0, iLen=an.length ; i + $(oSettings.nTable).height() - oSettings.oScroll.iLoadGap ) + { + /* Only do the redraw if we have to - we might be at the end of the data */ + if ( oSettings.fnDisplayEnd() < oSettings.fnRecordsDisplay() ) + { + _fnPageChange( oSettings, 'next' ); + _fnCalculateEnd( oSettings ); + _fnDraw( oSettings ); + } + } + } + } ); + } + + oSettings.nScrollHead = nScrollHead; + oSettings.nScrollFoot = nScrollFoot; + + return nScroller; +} + + +/** + * Update the various tables for resizing. It's a bit of a pig this function, but + * basically the idea to: + * 1. Re-create the table inside the scrolling div + * 2. Take live measurements from the DOM + * 3. Apply the measurements + * 4. Clean up + * @param {object} o dataTables settings object + * @returns {node} Node to add to the DOM + * @memberof DataTable#oApi + */ +function _fnScrollDraw ( o ) +{ + var + nScrollHeadInner = o.nScrollHead.getElementsByTagName('div')[0], + nScrollHeadTable = nScrollHeadInner.getElementsByTagName('table')[0], + nScrollBody = o.nTable.parentNode, + i, iLen, j, jLen, anHeadToSize, anHeadSizers, anFootSizers, anFootToSize, oStyle, iVis, + iWidth, aApplied=[], iSanityWidth, + nScrollFootInner = (o.nTFoot !== null) ? o.nScrollFoot.getElementsByTagName('div')[0] : null, + nScrollFootTable = (o.nTFoot !== null) ? nScrollFootInner.getElementsByTagName('table')[0] : null, + ie67 = $.browser.msie && $.browser.version <= 7; + + /* + * 1. Re-create the table inside the scrolling div + */ + + /* Remove the old minimised thead and tfoot elements in the inner table */ + var nTheadSize = o.nTable.getElementsByTagName('thead'); + if ( nTheadSize.length > 0 ) + { + o.nTable.removeChild( nTheadSize[0] ); + } + + var nTfootSize; + if ( o.nTFoot !== null ) + { + /* Remove the old minimised footer element in the cloned header */ + nTfootSize = o.nTable.getElementsByTagName('tfoot'); + if ( nTfootSize.length > 0 ) + { + o.nTable.removeChild( nTfootSize[0] ); + } + } + + /* Clone the current header and footer elements and then place it into the inner table */ + nTheadSize = o.nTHead.cloneNode(true); + o.nTable.insertBefore( nTheadSize, o.nTable.childNodes[0] ); + + if ( o.nTFoot !== null ) + { + nTfootSize = o.nTFoot.cloneNode(true); + o.nTable.insertBefore( nTfootSize, o.nTable.childNodes[1] ); + } + + /* + * 2. Take live measurements from the DOM - do not alter the DOM itself! + */ + + /* Remove old sizing and apply the calculated column widths + * 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 + nScrollBody.offsetHeight || $(nScrollBody).css('overflow-y') == "scroll") ) + { + o.nTable.style.width = _fnStringToCss( $(o.nTable).outerWidth()-o.oScroll.iBarWidth ); + } + } + else + { + if ( o.oScroll.sXInner !== "" ) + { + /* x scroll inner has been given - use it */ + o.nTable.style.width = _fnStringToCss(o.oScroll.sXInner); + } + else if ( iSanityWidth == $(nScrollBody).width() && + $(nScrollBody).height() < $(o.nTable).height() ) + { + /* There is y-scrolling - try to take account of the y scroll bar */ + o.nTable.style.width = _fnStringToCss( iSanityWidth-o.oScroll.iBarWidth ); + if ( $(o.nTable).outerWidth() > iSanityWidth-o.oScroll.iBarWidth ) + { + /* Not possible to take account of it */ + o.nTable.style.width = _fnStringToCss( iSanityWidth ); + } + } + else + { + /* All else fails */ + o.nTable.style.width = _fnStringToCss( iSanityWidth ); + } + } + + /* Recalculate the sanity width - now that we've applied the required width, before it was + * a temporary variable. This is required because the column width calculation is done + * before this table DOM is created. + */ + iSanityWidth = $(o.nTable).outerWidth(); + + /* We want the hidden header to have zero height, so remove padding and borders. Then + * set the width based on the real headers + */ + anHeadToSize = o.nTHead.getElementsByTagName('tr'); + anHeadSizers = nTheadSize.getElementsByTagName('tr'); + + _fnApplyToChildren( function(nSizer, nToSize) { + oStyle = nSizer.style; + oStyle.paddingTop = "0"; + oStyle.paddingBottom = "0"; + oStyle.borderTopWidth = "0"; + oStyle.borderBottomWidth = "0"; + oStyle.height = 0; + + iWidth = $(nSizer).width(); + nToSize.style.width = _fnStringToCss( iWidth ); + aApplied.push( iWidth ); + }, anHeadSizers, anHeadToSize ); + $(anHeadSizers).height(0); + + if ( o.nTFoot !== null ) + { + /* Clone the current footer and then place it into the body table as a "hidden header" */ + anFootSizers = nTfootSize.getElementsByTagName('tr'); + anFootToSize = o.nTFoot.getElementsByTagName('tr'); + + _fnApplyToChildren( function(nSizer, nToSize) { + oStyle = nSizer.style; + oStyle.paddingTop = "0"; + oStyle.paddingBottom = "0"; + oStyle.borderTopWidth = "0"; + oStyle.borderBottomWidth = "0"; + oStyle.height = 0; + + iWidth = $(nSizer).width(); + nToSize.style.width = _fnStringToCss( iWidth ); + aApplied.push( iWidth ); + }, anFootSizers, anFootToSize ); + $(anFootSizers).height(0); + } + + /* + * 3. Apply the measurements + */ + + /* "Hide" the header and footer that we used for the sizing. We want to also fix their width + * to what they currently are + */ + _fnApplyToChildren( function(nSizer) { + nSizer.innerHTML = ""; + nSizer.style.width = _fnStringToCss( aApplied.shift() ); + }, anHeadSizers ); + + if ( o.nTFoot !== null ) + { + _fnApplyToChildren( function(nSizer) { + nSizer.innerHTML = ""; + nSizer.style.width = _fnStringToCss( aApplied.shift() ); + }, anFootSizers ); + } + + /* Sanity check that the table is of a sensible width. If not then we are going to get + * misalignment - try to prevent this by not allowing the table to shrink below its min width + */ + if ( $(o.nTable).outerWidth() < iSanityWidth ) + { + /* The min width depends upon if we have a vertical scrollbar visible or not */ + var iCorrection = ((nScrollBody.scrollHeight > nScrollBody.offsetHeight || + $(nScrollBody).css('overflow-y') == "scroll")) ? + iSanityWidth+o.oScroll.iBarWidth : iSanityWidth; + + /* IE6/7 are a law unto themselves... */ + if ( ie67 && (nScrollBody.scrollHeight > + nScrollBody.offsetHeight || $(nScrollBody).css('overflow-y') == "scroll") ) + { + o.nTable.style.width = _fnStringToCss( iCorrection-o.oScroll.iBarWidth ); + } + + /* Apply the calculated minimum width to the table wrappers */ + nScrollBody.style.width = _fnStringToCss( iCorrection ); + nScrollHeadInner.parentNode.style.width = _fnStringToCss( iCorrection ); + + if ( o.nTFoot !== null ) + { + nScrollFootInner.parentNode.style.width = _fnStringToCss( iCorrection ); + } + + /* And give the user a warning that we've stopped the table getting too small */ + if ( o.oScroll.sX === "" ) + { + _fnLog( o, 1, "The table cannot fit into the current element which will cause column"+ + " misalignment. The table has been drawn at its minimum possible width." ); + } + else if ( o.oScroll.sXInner !== "" ) + { + _fnLog( o, 1, "The table cannot fit into the current element which will cause column"+ + " misalignment. Increase the sScrollXInner value or remove it to allow automatic"+ + " calculation" ); + } + } + else + { + nScrollBody.style.width = _fnStringToCss( '100%' ); + nScrollHeadInner.parentNode.style.width = _fnStringToCss( '100%' ); + + if ( o.nTFoot !== null ) + { + nScrollFootInner.parentNode.style.width = _fnStringToCss( '100%' ); + } + } + + + /* + * 4. Clean up + */ + + if ( o.oScroll.sY === "" ) + { + /* IE7< puts a vertical scrollbar in place (when it shouldn't be) due to subtracting + * the scrollbar height from the visible display, rather than adding it on. We need to + * set the height in order to sort this. Don't want to do it in any other browsers. + */ + if ( ie67 ) + { + nScrollBody.style.height = _fnStringToCss( o.nTable.offsetHeight+o.oScroll.iBarWidth ); + } + } + + if ( o.oScroll.sY !== "" && o.oScroll.bCollapse ) + { + nScrollBody.style.height = _fnStringToCss( o.oScroll.sY ); + + var iExtra = (o.oScroll.sX !== "" && o.nTable.offsetWidth > nScrollBody.offsetWidth) ? + o.oScroll.iBarWidth : 0; + if ( o.nTable.offsetHeight < nScrollBody.offsetHeight ) + { + nScrollBody.style.height = _fnStringToCss( $(o.nTable).height()+iExtra ); + } + } + + /* Finally set the width's of the header and footer tables */ + var iOuterWidth = $(o.nTable).outerWidth(); + nScrollHeadTable.style.width = _fnStringToCss( iOuterWidth ); + nScrollHeadInner.style.width = _fnStringToCss( iOuterWidth+o.oScroll.iBarWidth ); + + if ( o.nTFoot !== null ) + { + nScrollFootInner.style.width = _fnStringToCss( o.nTable.offsetWidth+o.oScroll.iBarWidth ); + nScrollFootTable.style.width = _fnStringToCss( o.nTable.offsetWidth ); + } + + /* If sorting or filtering has occurred, jump the scrolling back to the top */ + if ( o.bSorted || o.bFiltered ) + { + nScrollBody.scrollTop = 0; + } +} + + +/** + * Apply a given function to the display child nodes of an element array (typically + * TD children of TR rows + * @param {function} fn Method to apply to the objects + * @param array {nodes} an1 List of elements to look through for display children + * @param array {nodes} an2 Another list (identical structure to the first) - optional + * @memberof DataTable#oApi + */ +function _fnApplyToChildren( fn, an1, an2 ) +{ + for ( var i=0, iLen=an1.length ; itd', nCalcTmp); + } + + /* Apply custom sizing to the cloned header */ + var nThs = _fnGetUniqueThs( oSettings, nTheadClone ); + iCorrector = 0; + for ( i=0 ; i 0 ) + { + oSettings.aoColumns[i].sWidth = _fnStringToCss( iWidth ); + } + iCorrector++; + } + } + + var cssWidth = $(nCalcTmp).css('width'); + oSettings.nTable.style.width = (cssWidth.indexOf('%') !== -1) ? + cssWidth : _fnStringToCss( $(nCalcTmp).outerWidth() ); + nCalcTmp.parentNode.removeChild( nCalcTmp ); + } + + if ( widthAttr ) + { + oSettings.nTable.style.width = _fnStringToCss( widthAttr ); + } +} + + +/** + * Adjust a table's width to take account of scrolling + * @param {object} oSettings dataTables settings object + * @param {node} n table node + * @memberof DataTable#oApi + */ +function _fnScrollingWidthAdjust ( oSettings, n ) +{ + if ( oSettings.oScroll.sX === "" && oSettings.oScroll.sY !== "" ) + { + /* When y-scrolling only, we want to remove the width of the scroll bar so the table + * + scroll bar will fit into the area avaialble. + */ + var iOrigWidth = $(n).width(); + n.style.width = _fnStringToCss( $(n).outerWidth()-oSettings.oScroll.iBarWidth ); + } + else if ( oSettings.oScroll.sX !== "" ) + { + /* When x-scrolling both ways, fix the table at it's current size, without adjusting */ + n.style.width = _fnStringToCss( $(n).outerWidth() ); + } +} + + +/** + * Get the widest node + * @param {object} oSettings dataTables settings object + * @param {int} iCol column of interest + * @returns {string} max strlens for each column + * @memberof DataTable#oApi + */ +function _fnGetWidestNode( oSettings, iCol ) +{ + var iMaxIndex = _fnGetMaxLenString( oSettings, iCol ); + if ( iMaxIndex < 0 ) + { + return null; + } + + if ( oSettings.aoData[iMaxIndex].nTr === null ) + { + var n = document.createElement('td'); + n.innerHTML = _fnGetCellData( oSettings, iMaxIndex, iCol, '' ); + return n; + } + return _fnGetTdNodes(oSettings, iMaxIndex)[iCol]; +} + + +/** + * Get the maximum strlen for each data column + * @param {object} oSettings dataTables settings object + * @param {int} iCol column of interest + * @returns {string} max strlens for each column + * @memberof DataTable#oApi + */ +function _fnGetMaxLenString( oSettings, iCol ) +{ + var iMax = -1; + var iMaxIndex = -1; + + for ( var i=0 ; i/g, "" ); + if ( s.length > iMax ) + { + iMax = s.length; + iMaxIndex = i; + } + } + + return iMaxIndex; +} + + +/** + * Append a CSS unit (only if required) to a string + * @param {array} aArray1 first array + * @param {array} aArray2 second array + * @returns {int} 0 if match, 1 if length is different, 2 if no match + * @memberof DataTable#oApi + */ +function _fnStringToCss( s ) +{ + if ( s === null ) + { + return "0px"; + } + + if ( typeof s == 'number' ) + { + if ( s < 0 ) + { + return "0px"; + } + return s+"px"; + } + + /* Check if the last character is not 0-9 */ + var c = s.charCodeAt( s.length-1 ); + if (c < 0x30 || c > 0x39) + { + return s; + } + return s+"px"; +} + + +/** + * Get the width of a scroll bar in this browser being used + * @returns {int} width in pixels + * @memberof DataTable#oApi + */ +function _fnScrollBarWidth () +{ + var inner = document.createElement('p'); + var style = inner.style; + style.width = "100%"; + style.height = "200px"; + style.padding = "0px"; + + var outer = document.createElement('div'); + style = outer.style; + style.position = "absolute"; + style.top = "0px"; + style.left = "0px"; + style.visibility = "hidden"; + style.width = "200px"; + style.height = "150px"; + style.padding = "0px"; + style.overflow = "hidden"; + outer.appendChild(inner); + + document.body.appendChild(outer); + var w1 = inner.offsetWidth; + outer.style.overflow = 'scroll'; + var w2 = inner.offsetWidth; + if ( w1 == w2 ) + { + w2 = outer.clientWidth; + } + + document.body.removeChild(outer); + return (w1 - w2); +} + diff --git a/media/src/core/core.sort.js b/media/src/core/core.sort.js new file mode 100644 index 00000000..6a02ab2a --- /dev/null +++ b/media/src/core/core.sort.js @@ -0,0 +1,455 @@ + + +/** + * Change the order of the table + * @param {object} oSettings dataTables settings object + * @param {bool} bApplyClasses optional - should we apply classes or not + * @memberof DataTable#oApi + */ +function _fnSort ( oSettings, bApplyClasses ) +{ + var + i, iLen, j, jLen, k, kLen, + sDataType, nTh, + aaSort = [], + aiOrig = [], + oSort = DataTable.ext.oSort, + aoData = oSettings.aoData, + aoColumns = oSettings.aoColumns, + oAria = oSettings.oLanguage.oAria; + + /* No sorting required if server-side or no sorting array */ + if ( !oSettings.oFeatures.bServerSide && + (oSettings.aaSorting.length !== 0 || oSettings.aaSortingFixed !== null) ) + { + if ( oSettings.aaSortingFixed !== null ) + { + aaSort = oSettings.aaSortingFixed.concat( oSettings.aaSorting ); + } + else + { + aaSort = oSettings.aaSorting.slice(); + } + + /* If there is a sorting data type, and a fuction belonging to it, then we need to + * get the data from the developer's function and apply it for this column + */ + for ( i=0 ; i 0 && aaSort[0][0] == i ) + { + nTh.setAttribute('aria-sort', aaSort[0][1]=="asc" ? "ascending" : "descending" ); + + var nextSort = (aoColumns[i].asSorting[ aaSort[0][2]+1 ]) ? + aoColumns[i].asSorting[ aaSort[0][2]+1 ] : aoColumns[i].asSorting[0]; + nTh.setAttribute('aria-label', aoColumns[i].sTitle+ + (nextSort=="asc" ? oAria.sSortAscending : oAria.sSortDescending) ); + } + else + { + nTh.setAttribute('aria-label', aoColumns[i].sTitle+ + (aoColumns[i].asSorting[0]=="asc" ? oAria.sSortAscending : oAria.sSortDescending) ); + } + } + else + { + nTh.setAttribute('aria-label', aoColumns[i].sTitle); + } + } + + /* Tell the draw function that we have sorted the data */ + oSettings.bSorted = true; + $(oSettings.oInstance).trigger('sort', oSettings); + + /* Copy the master data into the draw array and re-draw */ + if ( oSettings.oFeatures.bFilter ) + { + /* _fnFilter() will redraw the table for us */ + _fnFilterComplete( oSettings, oSettings.oPreviousSearch, 1 ); + } + else + { + oSettings.aiDisplay = oSettings.aiDisplayMaster.slice(); + oSettings._iDisplayStart = 0; /* reset display back to page 0 */ + _fnCalculateEnd( oSettings ); + _fnDraw( oSettings ); + } +} + + +/** + * Attach a sort handler (click) to a node + * @param {object} oSettings dataTables settings object + * @param {node} nNode node to attach the handler to + * @param {int} iDataIndex column sorting index + * @param {function} [fnCallback] callback function + * @memberof DataTable#oApi + */ +function _fnSortAttachListener ( oSettings, nNode, iDataIndex, fnCallback ) +{ + _fnBindAction( nNode, {}, function (e) { + /* If the column is not sortable - don't to anything */ + if ( oSettings.aoColumns[iDataIndex].bSortable === false ) + { + return; + } + + /* + * This is a little bit odd I admit... I declare a temporary function inside the scope of + * _fnBuildHead and the click handler in order that the code presented here can be used + * twice - once for when bProcessing is enabled, and another time for when it is + * disabled, as we need to perform slightly different actions. + * Basically the issue here is that the Javascript engine in modern browsers don't + * appear to allow the rendering engine to update the display while it is still excuting + * it's thread (well - it does but only after long intervals). This means that the + * 'processing' display doesn't appear for a table sort. To break the js thread up a bit + * I force an execution break by using setTimeout - but this breaks the expected + * thread continuation for the end-developer's point of view (their code would execute + * too early), so we on;y do it when we absolutely have to. + */ + var fnInnerSorting = function () { + var iColumn, iNextSort; + + /* If the shift key is pressed then we are multipe column sorting */ + if ( e.shiftKey ) + { + /* Are we already doing some kind of sort on this column? */ + var bFound = false; + for ( var i=0 ; i= iColumns ) + { + for ( i=0 ; i 4096 ) /* Magic 10 for padding */ + { + var aCookies =document.cookie.split(';'); + for ( var i=0, iLen=aCookies.length ; i'+oLang.sPrevious+''+ + ''+oLang.sNext+'' + : + ''+ + ''; + $(nPaging).append( sAppend ); + + var els = $('a', nPaging); + var nPrevious = els[0], + nNext = els[1]; + + oSettings.oApi._fnBindAction( nPrevious, {action: "previous"}, fnClickHandler ); + oSettings.oApi._fnBindAction( nNext, {action: "next"}, fnClickHandler ); + + /* ID the first elements only */ + if ( !oSettings.aanFeatures.p ) + { + nPaging.id = oSettings.sTableId+'_paginate'; + nPrevious.id = oSettings.sTableId+'_previous'; + nNext.id = oSettings.sTableId+'_next'; + + nPrevious.setAttribute('aria-controls', oSettings.sTableId); + nNext.setAttribute('aria-controls', oSettings.sTableId); + } + }, + + /* + * Function: oPagination.two_button.fnUpdate + * Purpose: Update the two button pagination at the end of the draw + * Returns: - + * Inputs: object:oSettings - dataTables settings object + * function:fnCallbackDraw - draw function to call on page change + */ + "fnUpdate": function ( oSettings, fnCallbackDraw ) + { + if ( !oSettings.aanFeatures.p ) + { + return; + } + + var oClasses = oSettings.oClasses; + var an = oSettings.aanFeatures.p; + + /* Loop over each instance of the pager */ + for ( var i=0, iLen=an.length ; i'+oLang.sFirst+''+ + ''+oLang.sPrevious+''+ + ''+ + ''+oLang.sNext+''+ + ''+oLang.sLast+'' + ); + var els = $('a', nPaging); + var nFirst = els[0], + nPrev = els[1], + nNext = els[2], + nLast = els[3]; + + oSettings.oApi._fnBindAction( nFirst, {action: "first"}, fnClickHandler ); + oSettings.oApi._fnBindAction( nPrev, {action: "previous"}, fnClickHandler ); + oSettings.oApi._fnBindAction( nNext, {action: "next"}, fnClickHandler ); + oSettings.oApi._fnBindAction( nLast, {action: "last"}, fnClickHandler ); + + /* ID the first elements only */ + if ( !oSettings.aanFeatures.p ) + { + nPaging.id = oSettings.sTableId+'_paginate'; + nFirst.id =oSettings.sTableId+'_first'; + nPrev.id =oSettings.sTableId+'_previous'; + nNext.id =oSettings.sTableId+'_next'; + nLast.id =oSettings.sTableId+'_last'; + } + }, + + /* + * Function: oPagination.full_numbers.fnUpdate + * Purpose: Update the list of page buttons shows + * Returns: - + * Inputs: object:oSettings - dataTables settings object + * function:fnCallbackDraw - draw function to call on page change + */ + "fnUpdate": function ( oSettings, fnCallbackDraw ) + { + if ( !oSettings.aanFeatures.p ) + { + return; + } + + var iPageCount = DataTable.ext.oPagination.iFullNumbersShowPages; + var iPageCountHalf = Math.floor(iPageCount / 2); + var iPages = Math.ceil((oSettings.fnRecordsDisplay()) / oSettings._iDisplayLength); + var iCurrentPage = Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength) + 1; + var sList = ""; + var iStartButton, iEndButton, i, iLen; + var oClasses = oSettings.oClasses; + var anButtons, anStatic, nPaginateList; + var an = oSettings.aanFeatures.p; + var fnBind = function (j) { + oSettings.oApi._fnBindAction( this, {"page": j+iStartButton-1}, function(e) { + /* Use the information in the element to jump to the required page */ + oSettings.oApi._fnPageChange( oSettings, e.data.page ); + fnCallbackDraw( oSettings ); + e.preventDefault(); + } ); + }; + + /* Pages calculation */ + if (iPages < iPageCount) + { + iStartButton = 1; + iEndButton = iPages; + } + else if (iCurrentPage <= iPageCountHalf) + { + iStartButton = 1; + iEndButton = iPageCount; + } + else if (iCurrentPage >= (iPages - iPageCountHalf)) + { + iStartButton = iPages - iPageCount + 1; + iEndButton = iPages; + } + else + { + iStartButton = iCurrentPage - Math.ceil(iPageCount / 2) + 1; + iEndButton = iStartButton + iPageCount - 1; + } + + /* Build the dynamic list */ + for ( i=iStartButton ; i<=iEndButton ; i++ ) + { + sList += (iCurrentPage !== i) ? + ''+oSettings.fnFormatNumber(i)+'' : + ''+oSettings.fnFormatNumber(i)+''; + } + + /* Loop over each instance of the pager */ + for ( i=0, iLen=an.length ; i/g, "" ).toLocaleLowerCase(); + }, + + "html-asc": function ( x, y ) + { + return x.localeCompare(y); + }, + + "html-desc": function ( x, y ) + { + return y.localeCompare(x); + }, + + + /* + * date sorting + */ + "date-pre": function ( a ) + { + var x = Date.parse( a ); + + if ( isNaN(x) || x==="" ) + { + x = Date.parse( "01/01/1970 00:00:00" ); + } + return x; + }, + + "date-asc": function ( x, y ) + { + return x - y; + }, + + "date-desc": function ( x, y ) + { + return y - x; + }, + + + /* + * numerical sorting + */ + "numeric-pre": function ( a ) + { + return (a=="-" || a==="") ? 0 : a*1; + }, + + "numeric-asc": function ( x, y ) + { + return x - y; + }, + + "numeric-desc": function ( x, y ) + { + return y - x; + } +} ); diff --git a/media/src/ext/ext.types.js b/media/src/ext/ext.types.js new file mode 100644 index 00000000..ffd4e143 --- /dev/null +++ b/media/src/ext/ext.types.js @@ -0,0 +1,88 @@ + + +$.extend( DataTable.ext.aTypes, [ + /* + * Function: - + * Purpose: Check to see if a string is numeric + * Returns: string:'numeric' or null + * Inputs: mixed:sText - string to check + */ + function ( sData ) + { + /* Allow zero length strings as a number */ + if ( typeof sData === 'number' ) + { + return 'numeric'; + } + else if ( typeof sData !== 'string' ) + { + return null; + } + + var sValidFirstChars = "0123456789-"; + var sValidChars = "0123456789."; + var Char; + var bDecimal = false; + + /* Check for a valid first char (no period and allow negatives) */ + Char = sData.charAt(0); + if (sValidFirstChars.indexOf(Char) == -1) + { + return null; + } + + /* Check all the other characters are valid */ + for ( var i=1 ; i') != -1 ) + { + return 'html'; + } + return null; + } +] ); + diff --git a/media/src/model/model.column.js b/media/src/model/model.column.js new file mode 100644 index 00000000..9f076c36 --- /dev/null +++ b/media/src/model/model.column.js @@ -0,0 +1,248 @@ + + + +/** + * Template object for the column information object in DataTables. This object + * is held in the settings aoColumns array and contains all the information that + * DataTables needs about each individual column. + * + * Note that this object is related to {@link DataTable.defaults.columns} + * but this one is the internal data store for DataTables's cache of columns. + * It should NOT be manipulated outside of DataTables. Any configuration should + * be done through the initialisation options. + * @namespace + */ +DataTable.models.oColumn = { + /** + * A list of the columns that sorting should occur on when this column + * is sorted. That this property is an array allows multi-column sorting + * to be defined for a column (for example first name / last name columns + * would benefit from this). The values are integers pointing to the + * columns to be sorted on (typically it will be a single integer pointing + * at itself, but that doesn't need to be the case). + * @type array + */ + "aDataSort": null, + + /** + * Define the sorting directions that are applied to the column, in sequence + * as the column is repeatedly sorted upon - i.e. the first value is used + * as the sorting direction when the column if first sorted (clicked on). + * Sort it again (click again) and it will move on to the next index. + * Repeat until loop. + * @type array + */ + "asSorting": null, + + /** + * Flag to indicate if the column is searchable, and thus should be included + * in the filtering or not. + * @type boolean + */ + "bSearchable": null, + + /** + * Flag to indicate if the column is sortable or not. + * @type boolean + */ + "bSortable": null, + + /** + * When using fnRender, you have two options for what to do with the data, + * and this property serves as the switch. Firstly, you can have the sorting + * and filtering use the rendered value (true - default), or you can have + * the sorting and filtering us the original value (false). + * + * *NOTE* It is it is advisable now to use mDataProp as a function and make + * use of the 'type' that it gives, allowing (potentially) different data to + * be used for sorting, filtering, display and type detection. + * @type boolean + * @deprecated + */ + "bUseRendered": null, + + /** + * Flag to indicate if the column is currently visible in the table or not + * @type boolean + */ + "bVisible": null, + + /** + * Flag to indicate to the type detection method if the automatic type + * detection should be used, or if a column type (sType) has been specified + * @type boolean + * @default true + * @private + */ + "_bAutoType": true, + + /** + * Developer definable function that is called whenever a cell is created (Ajax source, + * etc) or processed for input (DOM source). This can be used as a compliment to fnRender + * allowing you to modify the DOM element (add background colour for example) when the + * element is available (since it is not when fnRender is called). + * @type function + * @param {element} nTd The TD node that has been created + * @param {*} sData The Data for the cell + * @param {array|object} oData The data for the whole row + * @param {int} iRow The row index for the aoData data store + * @default null + */ + "fnCreatedCell": null, + + /** + * Function to get data from a cell in a column. You should never + * access data directly through _aData internally in DataTables - always use + * the method attached to this property. It allows mDataProp to function as + * required. This function is automatically assigned by the column + * initialisation method + * @type function + * @param {array|object} oData The data array/object for the array + * (i.e. aoData[]._aData) + * @param {string} sSpecific The specific data type you want to get - + * 'display', 'type' 'filter' 'sort' + * @returns {*} The data for the cell from the given row's data + * @default null + */ + "fnGetData": null, + + /** + * Custom display function that will be called for the display of each cell + * in this column. + * @type function + * @param {object} o Object with the following parameters: + * @param {int} o.iDataRow The row in aoData + * @param {int} o.iDataColumn The column in question + * @param {array o.aData The data for the row in question + * @param {object} o.oSettings The settings object for this DataTables instance + * @returns {string} The string you which to use in the display + * @default null + */ + "fnRender": null, + + /** + * Function to set data for a cell in the column. You should never + * set the data directly to _aData internally in DataTables - always use + * this method. It allows mDataProp to function as required. This function + * is automatically assigned by the column initialisation method + * @type function + * @param {array|object} oData The data array/object for the array + * (i.e. aoData[]._aData) + * @param {*} sValue Value to set + * @default null + */ + "fnSetData": null, + + /** + * Property to read the value for the cells in the column from the data + * source array / object. If null, then the default content is used, if a + * function is given then the return from the function is used. + * @type function|int|string|null + * @default null + */ + "mDataProp": null, + + /** + * Unique header TH/TD element for this column - this is what the sorting + * listener is attached to (if sorting is enabled.) + * @type node + * @default null + */ + "nTh": null, + + /** + * Unique footer TH/TD element for this column (if there is one). Not used + * in DataTables as such, but can be used for plug-ins to reference the + * footer for each column. + * @type node + * @default null + */ + "nTf": null, + + /** + * The class to apply to all TD elements in the table's TBODY for the column + * @type string + * @default null + */ + "sClass": null, + + /** + * When DataTables calculates the column widths to assign to each column, + * it finds the longest string in each column and then constructs a + * temporary table and reads the widths from that. The problem with this + * is that "mmm" is much wider then "iiii", but the latter is a longer + * string - thus the calculation can go wrong (doing it properly and putting + * it into an DOM object and measuring that is horribly(!) slow). Thus as + * a "work around" we provide this option. It will append its value to the + * text that is found to be the longest string for the column - i.e. padding. + * @type string + */ + "sContentPadding": null, + + /** + * Allows a default value to be given for a column's data, and will be used + * whenever a null data source is encountered (this can be because mDataProp + * is set to null, or because the data source itself is null). + * @type string + * @default null + */ + "sDefaultContent": null, + + /** + * Name for the column, allowing reference to the column by name as well as + * by index (needs a lookup to work by name). + * @type string + */ + "sName": null, + + /** + * Custom sorting data type - defines which of the available plug-ins in + * afnSortData the custom sorting will use - if any is defined. + * @type string + * @default std + */ + "sSortDataType": 'std', + + /** + * Class to be applied to the header element when sorting on this column + * @type string + * @default null + */ + "sSortingClass": null, + + /** + * Class to be applied to the header element when sorting on this column - + * when jQuery UI theming is used. + * @type string + * @default null + */ + "sSortingClassJUI": null, + + /** + * Title of the column - what is seen in the TH element (nTh). + * @type string + */ + "sTitle": null, + + /** + * Column sorting and filtering type + * @type string + * @default null + */ + "sType": null, + + /** + * Width of the column + * @type string + * @default null + */ + "sWidth": null, + + /** + * Width of the column when it was first "encountered" + * @type string + * @default null + */ + "sWidthOrig": null +}; + diff --git a/media/src/model/model.defaults.columns.js b/media/src/model/model.defaults.columns.js new file mode 100644 index 00000000..42648492 --- /dev/null +++ b/media/src/model/model.defaults.columns.js @@ -0,0 +1,639 @@ + + +/** + * Column options that can be given to DataTables at initialisation time. + * @namespace + */ +DataTable.defaults.columns = { + /** + * Allows a column's sorting to take multiple columns into account when + * doing a sort. For example first name / last name columns make sense to + * do a multi-column sort over the two columns. + * @type array + * @default null Takes the value of the column index automatically + * + * @example + * // Using aoColumnDefs + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumnDefs": [ + * { "aDataSort": [ 0, 1 ], "aTargets": [ 0 ] }, + * { "aDataSort": [ 1, 0 ], "aTargets": [ 1 ] }, + * { "aDataSort": [ 2, 3, 4 ], "aTargets": [ 2 ] } + * ] + * } ); + * } ); + * + * @example + * // Using aoColumns + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumns": [ + * { "aDataSort": [ 0, 1 ] }, + * { "aDataSort": [ 1, 0 ] }, + * { "aDataSort": [ 2, 3, 4 ] }, + * null, + * null + * ] + * } ); + * } ); + */ + "aDataSort": null, + + + /** + * You can control the default sorting direction, and even alter the behaviour + * of the sort handler (i.e. only allow ascending sorting etc) using this + * parameter. + * @type array + * @default [ 'asc', 'desc' ] + * + * @example + * // Using aoColumnDefs + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumnDefs": [ + * { "asSorting": [ "asc" ], "aTargets": [ 1 ] }, + * { "asSorting": [ "desc", "asc", "asc" ], "aTargets": [ 2 ] }, + * { "asSorting": [ "desc" ], "aTargets": [ 3 ] } + * ] + * } ); + * } ); + * + * @example + * // Using aoColumns + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumns": [ + * null, + * { "asSorting": [ "asc" ] }, + * { "asSorting": [ "desc", "asc", "asc" ] }, + * { "asSorting": [ "desc" ] }, + * null + * ] + * } ); + * } ); + */ + "asSorting": [ 'asc', 'desc' ], + + + /** + * Enable or disable filtering on the data in this column. + * @type boolean + * @default true + * + * @example + * // Using aoColumnDefs + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumnDefs": [ + * { "bSearchable": false, "aTargets": [ 0 ] } + * ] } ); + * } ); + * + * @example + * // Using aoColumns + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumns": [ + * { "bSearchable": false }, + * null, + * null, + * null, + * null + * ] } ); + * } ); + */ + "bSearchable": true, + + + /** + * Enable or disable sorting on this column. + * @type boolean + * @default true + * + * @example + * // Using aoColumnDefs + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumnDefs": [ + * { "bSortable": false, "aTargets": [ 0 ] } + * ] } ); + * } ); + * + * @example + * // Using aoColumns + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumns": [ + * { "bSortable": false }, + * null, + * null, + * null, + * null + * ] } ); + * } ); + */ + "bSortable": true, + + + /** + * When using fnRender() for a column, you may wish to use the original data + * (before rendering) for sorting and filtering (the default is to used the + * rendered data that the user can see). This may be useful for dates etc. + * @type boolean + * @default true + * + * @example + * // Using aoColumnDefs + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumnDefs": [ + * { + * "fnRender": function ( oObj ) { + * return oObj.aData[0] +' '+ oObj.aData[3]; + * }, + * "bUseRendered": false, + * "aTargets": [ 0 ] + * } + * ] + * } ); + * } ); + * + * @example + * // Using aoColumns + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumns": [ + * { + * "fnRender": function ( oObj ) { + * return oObj.aData[0] +' '+ oObj.aData[3]; + * }, + * "bUseRendered": false + * }, + * null, + * null, + * null, + * null + * ] + * } ); + * } ); + */ + "bUseRendered": true, + + + /** + * Enable or disable the display of this column. + * @type boolean + * @default true + * + * @example + * // Using aoColumnDefs + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumnDefs": [ + * { "bVisible": false, "aTargets": [ 0 ] } + * ] } ); + * } ); + * + * @example + * // Using aoColumns + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumns": [ + * { "bVisible": false }, + * null, + * null, + * null, + * null + * ] } ); + * } ); + */ + "bVisible": true, + + + /** + * Developer definable function that is called whenever a cell is created (Ajax source, + * etc) or processed for input (DOM source). This can be used as a compliment to fnRender + * allowing you to modify the DOM element (add background colour for example) when the + * element is available (since it is not when fnRender is called). + * @type function + * @param {element} nTd The TD node that has been created + * @param {*} sData The Data for the cell + * @param {array|object} oData The data for the whole row + * @param {int} iRow The row index for the aoData data store + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumnDefs": [ { + * "aTargets": [3], + * "fnCreatedCell": function (nTd, sData, oData, i) { + * if ( sData == "1.7" ) { + * $(nTd).css('color', 'blue') + * } + * } + * } ] + * }); + * } ); + */ + "fnCreatedCell": null, + + + /** + * Custom display function that will be called for the display of each cell in + * this column. + * @type function + * @param {object} o Object with the following parameters: + * @param {int} o.iDataRow The row in aoData + * @param {int} o.iDataColumn The column in question + * @param {array o.aData The data for the row in question + * @param {object} o.oSettings The settings object for this DataTables instance + * @returns {string} The string you which to use in the display + * + * @example + * // Using aoColumnDefs + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumnDefs": [ + * { + * "fnRender": function ( o ) { + * return o.aData[0] +' '+ o.aData[3]; + * }, + * "aTargets": [ 0 ] + * } + * ] + * } ); + * } ); + * + * @example + * // Using aoColumns + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumns": [ + * { "fnRender": function ( o ) { + * return o.aData[0] +' '+ o.aData[3]; + * } }, + * null, + * null, + * null, + * null + * ] + * } ); + * } ); + */ + "fnRender": null, + + + /** + * The column index (starting from 0!) that you wish a sort to be performed + * upon when this column is selected for sorting. This can be used for sorting + * on hidden columns for example. + * @type int + * @default -1 Use automatically calculated column index + * + * @example + * // Using aoColumnDefs + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumnDefs": [ + * { "iDataSort": 1, "aTargets": [ 0 ] } + * ] + * } ); + * } ); + * + * @example + * // Using aoColumns + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumns": [ + * { "iDataSort": 1 }, + * null, + * null, + * null, + * null + * ] + * } ); + * } ); + */ + "iDataSort": -1, + + + /** + * This property can be used to read data from any JSON data source property, + * including deeply nested objects / properties. By default DataTables will + * use an array index (incrementally increased for each column) as the data + * source, but a string can be used for this property which will read an + * object property from the data source, a function which will be given the + * data source object to render into a string or null where the cell will be + * treated as empty. For more information see + * http://datatables.net/blog/Extended_data_source_options_with_DataTables + * @type string|int|function|null + * @default null Use automatically calculated column index + * + * @example + * $(document).ready(function() { + * var oTable = $('#example').dataTable( { + * "sAjaxSource": "sources/deep.txt", + * "aoColumns": [ + * { "mDataProp": "engine" }, + * { "mDataProp": "browser" }, + * { "mDataProp": "platform.inner" }, + * { "mDataProp": "platform.details.0" }, + * { "mDataProp": "platform.details.1" } + * ] + * } ); + * } ); + */ + "mDataProp": null, + + + /** + * Class to give to each cell in this column. + * @type string + * @default Empty string + * + * @example + * // Using aoColumnDefs + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumnDefs": [ + * { "sClass": "my_class", "aTargets": [ 0 ] } + * ] + * } ); + * } ); + * + * @example + * // Using aoColumns + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumns": [ + * { "sClass": "my_class" }, + * null, + * null, + * null, + * null + * ] + * } ); + * } ); + */ + "sClass": "", + + /** + * When DataTables calculates the column widths to assign to each column, + * it finds the longest string in each column and then constructs a + * temporary table and reads the widths from that. The problem with this + * is that "mmm" is much wider then "iiii", but the latter is a longer + * string - thus the calculation can go wrong (doing it properly and putting + * it into an DOM object and measuring that is horribly(!) slow). Thus as + * a "work around" we provide this option. It will append its value to the + * text that is found to be the longest string for the column - i.e. padding. + * Generally you shouldn't need this, and it is not documented on the + * general DataTables.net documentation + * @type string + * @default Empty string + * + * @example + * // Using aoColumns + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumns": [ + * null, + * null, + * null, + * { + * "sContentPadding": "mmm" + * } + * ] + * } ); + * } ); + */ + "sContentPadding": "", + + + /** + * Allows a default value to be given for a column's data, and will be used + * whenever a null data source is encountered (this can be because mDataProp + * is set to null, or because the data source itself is null). + * @type string + * @default null + * + * @example + * // Using aoColumnDefs + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumnDefs": [ + * { + * "mDataProp": null, + * "sDefaultContent": "Edit", + * "aTargets": [ -1 ] + * } + * ] + * } ); + * } ); + * + * @example + * // Using aoColumns + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumns": [ + * null, + * null, + * null, + * { + * "mDataProp": null, + * "sDefaultContent": "Edit" + * } + * ] + * } ); + * } ); + */ + "sDefaultContent": null, + + + /** + * This parameter is only used in DataTables' server-side processing. It can + * be exceptionally useful to know what columns are being displayed on the + * client side, and to map these to database fields. When defined, the names + * also allow DataTables to reorder information from the server if it comes + * back in an unexpected order (i.e. if you switch your columns around on the + * client-side, your server-side code does not also need updating). + * @type string + * @default Empty string + * + * @example + * // Using aoColumnDefs + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumnDefs": [ + * { "sName": "engine", "aTargets": [ 0 ] }, + * { "sName": "browser", "aTargets": [ 1 ] }, + * { "sName": "platform", "aTargets": [ 2 ] }, + * { "sName": "version", "aTargets": [ 3 ] }, + * { "sName": "grade", "aTargets": [ 4 ] } + * ] + * } ); + * } ); + * + * @example + * // Using aoColumns + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumns": [ + * { "sName": "engine" }, + * { "sName": "browser" }, + * { "sName": "platform" }, + * { "sName": "version" }, + * { "sName": "grade" } + * ] + * } ); + * } ); + */ + "sName": "", + + + /** + * Defines a data source type for the sorting which can be used to read + * realtime information from the table (updating the internally cached + * version) prior to sorting. This allows sorting to occur on user editable + * elements such as form inputs. + * @type string + * @default std + * + * @example + * // Using aoColumnDefs + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumnDefs": [ + * { "sSortDataType": "dom-text", "aTargets": [ 2, 3 ] }, + * { "sType": "numeric", "aTargets": [ 3 ] }, + * { "sSortDataType": "dom-select", "aTargets": [ 4 ] }, + * { "sSortDataType": "dom-checkbox", "aTargets": [ 5 ] } + * ] + * } ); + * } ); + * + * @example + * // Using aoColumns + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumns": [ + * null, + * null, + * { "sSortDataType": "dom-text" }, + * { "sSortDataType": "dom-text", "sType": "numeric" }, + * { "sSortDataType": "dom-select" }, + * { "sSortDataType": "dom-checkbox" } + * ] + * } ); + * } ); + */ + "sSortDataType": "std", + + + /** + * The title of this column. + * @type string + * @default null Derived from the 'TH' value for this column in the + * original HTML table. + * + * @example + * // Using aoColumnDefs + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumnDefs": [ + * { "sTitle": "My column title", "aTargets": [ 0 ] } + * ] + * } ); + * } ); + * + * @example + * // Using aoColumns + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumns": [ + * { "sTitle": "My column title" }, + * null, + * null, + * null, + * null + * ] + * } ); + * } ); + */ + "sTitle": null, + + + /** + * The type allows you to specify how the data for this column will be sorted. + * Four types (string, numeric, date and html (which will strip HTML tags + * before sorting)) are currently available. Note that only date formats + * understood by Javascript's Date() object will be accepted as type date. For + * example: "Mar 26, 2008 5:03 PM". May take the values: 'string', 'numeric', + * 'date' or 'html' (by default). Further types can be adding through + * plug-ins. + * @type string + * @default null Auto-detected from raw data + * + * @example + * // Using aoColumnDefs + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumnDefs": [ + * { "sType": "html", "aTargets": [ 0 ] } + * ] + * } ); + * } ); + * + * @example + * // Using aoColumns + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumns": [ + * { "sType": "html" }, + * null, + * null, + * null, + * null + * ] + * } ); + * } ); + */ + "sType": null, + + + /** + * Defining the width of the column, this parameter may take any CSS value + * (3em, 20px etc). DataTables applys 'smart' widths to columns which have not + * been given a specific width through this interface ensuring that the table + * remains readable. + * @type string + * @default null Automatic + * + * @example + * // Using aoColumnDefs + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumnDefs": [ + * { "sWidth": "20%", "aTargets": [ 0 ] } + * ] + * } ); + * } ); + * + * @example + * // Using aoColumns + * $(document).ready(function() { + * $('#example').dataTable( { + * "aoColumns": [ + * { "sWidth": "20%" }, + * null, + * null, + * null, + * null + * ] + * } ); + * } ); + */ + "sWidth": null +}; + diff --git a/media/src/model/model.defaults.js b/media/src/model/model.defaults.js new file mode 100644 index 00000000..b665ecdd --- /dev/null +++ b/media/src/model/model.defaults.js @@ -0,0 +1,1748 @@ + + +/** + * Initialisation options that can be given to DataTables at initialisation + * time. + * @namespace + */ +DataTable.defaults = { + /** + * An array of data to use for the table, passed in at initialisation which + * will be used in preference to any data which is already in the DOM. This is + * particularly useful for constructing tables purely in Javascript, for + * example with a custom Ajax call. + * @type array + * @default null + * + * @example + * // Using a 2D array data source + * $(document).ready( function () { + * $('#example').dataTable( { + * "aaData": [ + * ['Trident', 'Internet Explorer 4.0', 'Win 95+', 4, 'X'], + * ['Trident', 'Internet Explorer 5.0', 'Win 95+', 5, 'C'], + * ], + * "aoColumns": [ + * { "sTitle": "Engine" }, + * { "sTitle": "Browser" }, + * { "sTitle": "Platform" }, + * { "sTitle": "Version" }, + * { "sTitle": "Grade" } + * ] + * } ); + * } ); + * + * @example + * // Using an array of objects as a data source (mDataProp) + * $(document).ready( function () { + * $('#example').dataTable( { + * "aaData": [ + * { + * "engine": "Trident", + * "browser": "Internet Explorer 4.0", + * "platform": "Win 95+", + * "version": 4, + * "grade": "X" + * }, + * { + * "engine": "Trident", + * "browser": "Internet Explorer 5.0", + * "platform": "Win 95+", + * "version": 5, + * "grade": "C" + * } + * ], + * "aoColumns": [ + * { "sTitle": "Engine", "mDataProp": "engine" }, + * { "sTitle": "Browser", "mDataProp": "browser" }, + * { "sTitle": "Platform", "mDataProp": "platform" }, + * { "sTitle": "Version", "mDataProp": "version" }, + * { "sTitle": "Grade", "mDataProp": "grade" } + * ] + * } ); + * } ); + */ + "aaData": null, + + + /** + * If sorting is enabled, then DataTables will perform a first pass sort on + * initialisation. You can define which column(s) the sort is performed upon, + * and the sorting direction, with this variable. The aaSorting array should + * contain an array for each column to be sorted initially containing the + * column's index and a direction string ('asc' or 'desc'). + * @type array + * @default [[0,'asc']] + * + * @example + * // Sort by 3rd column first, and then 4th column + * $(document).ready( function() { + * $('#example').dataTable( { + * "aaSorting": [[2,'asc'], [3,'desc']] + * } ); + * } ); + * + * // No initial sorting + * $(document).ready( function() { + * $('#example').dataTable( { + * "aaSorting": [] + * } ); + * } ); + */ + "aaSorting": [[0,'asc']], + + + /** + * This parameter is basically identical to the aaSorting parameter, but + * cannot be overridden by user interaction with the table. What this means + * is that you could have a column (visible or hidden) which the sorting will + * always be forced on first - any sorting after that (from the user) will + * then be performed as required. This can be useful for grouping rows + * together. + * @type array + * @default null + * + * @example + * $(document).ready( function() { + * $('#example').dataTable( { + * "aaSortingFixed": [[0,'asc']] + * } ); + * } ) + */ + "aaSortingFixed": null, + + + /** + * This parameter allows you to readily specify the entries in the length drop + * down menu that DataTables shows when pagination is enabled. It can be + * either a 1D array of options which will be used for both the displayed + * option and the value, or a 2D array which will use the array in the first + * position as the value, and the array in the second position as the + * displayed options (useful for language strings such as 'All'). + * @type array + * @default [ 10, 25, 50, 100 ] + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]] + * } ); + * } ); + * + * @example + * // Setting the default display length as well as length menu + * // This is likely to be wanted if you remove the '10' option which + * // is the iDisplayLength default. + * $(document).ready(function() { + * $('#example').dataTable( { + * "iDisplayLength": 25, + * "aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]] + * } ); + * } ); + */ + "aLengthMenu": [ 10, 25, 50, 100 ], + + + /** + * The aoColumns option in the initialisation parameter allows you to define + * details about the way individual columns behave. For a full list of + * column options that can be set, please see + * {@link DataTable.defaults.columns}. Note that if you use aoColumns to + * define your columns, you must have an entry in the array for every single + * column that you have in your table (these can be null if you don't which + * to specify any options). + * @member + */ + "aoColumns": null, + + /** + * Very similar to aoColumns, aoColumnDefs allows you to target a specific + * column, multiple columns, or all columns, using the aTargets property of + * each object in the array. This allows great flexibility when creating + * tables, as the aoColumnDefs arrays can be of any length, targeting the + * columns you specifically want. aoColumnDefs may use any of the column + * options available: {@link DataTable.defaults.columns}, but it _must_ + * have aTargets defined in each object in the array. Values in the aTargets + * array may be: + *
      + *
    • a string - class name will be matched on the TH for the column
    • + *
    • 0 or a positive integer - column index counting from the left
    • + *
    • a negative integer - column index counting from the right
    • + *
    • the string "_all" - all columns (i.e. assign a default)
    • + *
    + * @member + */ + "aoColumnDefs": null, + + + /** + * Basically the same as oSearch, this parameter defines the individual column + * filtering state at initialisation time. The array must be of the same size + * as the number of columns, and each element be an object with the parameters + * "sSearch" and "bEscapeRegex" (the latter is optional). 'null' is also + * accepted and the default will be used. + * @type array + * @default [] + * + * @example + * $(document).ready( function() { + * $('#example').dataTable( { + * "aoSearchCols": [ + * null, + * { "sSearch": "My filter" }, + * null, + * { "sSearch": "^[0-9]", "bEscapeRegex": false } + * ] + * } ); + * } ) + */ + "aoSearchCols": [], + + + /** + * An array of CSS classes that should be applied to displayed rows. This + * array may be of any length, and DataTables will apply each class + * sequentially, looping when required. + * @type array + * @default [ 'odd', 'even' ] + * + * @example + * $(document).ready( function() { + * $('#example').dataTable( { + * "asStripeClasses": [ 'strip1', 'strip2', 'strip3' ] + * } ); + * } ) + */ + "asStripeClasses": [ 'odd', 'even' ], + + + /** + * Enable or disable automatic column width calculation. This can be disabled + * as an optimisation (it takes some time to calculate the widths) if the + * tables widths are passed in using aoColumns. + * @type boolean + * @default true + * + * @example + * $(document).ready( function () { + * $('#example').dataTable( { + * "bAutoWidth": false + * } ); + * } ); + */ + "bAutoWidth": true, + + + /** + * Deferred rendering can provide DataTables with a huge speed boost when you + * are using an Ajax or JS data source for the table. This option, when set to + * true, will cause DataTables to defer the creation of the table elements for + * each row until they are needed for a draw - saving a significant amount of + * time. + * @type boolean + * @default false + * + * @example + * $(document).ready(function() { + * var oTable = $('#example').dataTable( { + * "sAjaxSource": "sources/arrays.txt", + * "bDeferRender": true + * } ); + * } ); + */ + "bDeferRender": false, + + + /** + * Replace a DataTable which matches the given selector and replace it with + * one which has the properties of the new initialisation object passed. If no + * table matches the selector, then the new DataTable will be constructed as + * per normal. + * @type boolean + * @default false + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "sScrollY": "200px", + * "bPaginate": false + * } ); + * + * // Some time later.... + * $('#example').dataTable( { + * "bFilter": false, + * "bDestroy": true + * } ); + * } ); + */ + "bDestroy": false, + + + /** + * Enable or disable filtering of data. Filtering in DataTables is "smart" in + * that it allows the end user to input multiple words (space separated) and + * will match a row containing those words, even if not in the order that was + * specified (this allow matching across multiple columns). Note that if you + * wish to use filtering in DataTables this must remain 'true' - to remove the + * default filtering input box and retain filtering abilities, please use + * @ref{sDom}. + * @type boolean + * @default true + * + * @example + * $(document).ready( function () { + * $('#example').dataTable( { + * "bFilter": false + * } ); + * } ); + */ + "bFilter": true, + + + /** + * Enable or disable the table information display. This shows information + * about the data that is currently visible on the page, including information + * about filtered data if that action is being performed. + * @type boolean + * @default true + * + * @example + * $(document).ready( function () { + * $('#example').dataTable( { + * "bInfo": false + * } ); + * } ); + */ + "bInfo": true, + + + /** + * Enable jQuery UI ThemeRoller support (required as ThemeRoller requires some + * slightly different and additional mark-up from what DataTables has + * traditionally used). + * @type boolean + * @default false + * + * @example + * $(document).ready( function() { + * $('#example').dataTable( { + * "bJQueryUI": true + * } ); + * } ); + */ + "bJQueryUI": false, + + + /** + * Allows the end user to select the size of a formatted page from a select + * menu (sizes are 10, 25, 50 and 100). Requires pagination (bPaginate). + * @type boolean + * @default true + * + * @example + * $(document).ready( function () { + * $('#example').dataTable( { + * "bLengthChange": false + * } ); + * } ); + */ + "bLengthChange": true, + + + /** + * Enable or disable pagination. + * @type boolean + * @default true + * + * @example + * $(document).ready( function () { + * $('#example').dataTable( { + * "bPaginate": false + * } ); + * } ); + */ + "bPaginate": true, + + + /** + * Enable or disable the display of a 'processing' indicator when the table is + * being processed (e.g. a sort). This is particularly useful for tables with + * large amounts of data where it can take a noticeable amount of time to sort + * the entries. + * @type boolean + * @default false + * + * @example + * $(document).ready( function () { + * $('#example').dataTable( { + * "bProcessing": true + * } ); + * } ); + */ + "bProcessing": false, + + + /** + * Retrieve the DataTables object for the given selector. Note that if the + * table has already been initialised, this parameter will cause DataTables + * to simply return the object that has already been set up - it will not take + * account of any changes you might have made to the initialisation object + * passed to DataTables (setting this parameter to true is an acknowledgement + * that you understand this). bDestroy can be used to reinitialise a table if + * you need. + * @type boolean + * @default false + * + * @example + * $(document).ready(function() { + * initTable(); + * tableActions(); + * } ); + * + * function initTable () + * { + * return $('#example').dataTable( { + * "sScrollY": "200px", + * "bPaginate": false, + * "bRetrieve": true + * } ); + * } + * + * function tableActions () + * { + * var oTable = initTable(); + * // perform API operations with oTable + * } + */ + "bRetrieve": false, + + + /** + * Indicate if DataTables should be allowed to set the padding / margin + * etc for the scrolling header elements or not. Typically you will want + * this. + * @type boolean + * @default true + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "bScrollAutoCss": false, + * "sScrollY": "200px" + * } ); + * } ); + */ + "bScrollAutoCss": true, + + + /** + * When vertical (y) scrolling is enabled, DataTables will force the height of + * the table's viewport to the given height at all times (useful for layout). + * However, this can look odd when filtering data down to a small data set, + * and the footer is left "floating" further down. This parameter (when + * enabled) will cause DataTables to collapse the table's viewport down when + * the result set will fit within the given Y height. + * @type boolean + * @default false + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "sScrollY": "200", + * "bScrollCollapse": true + * } ); + * } ); + */ + "bScrollCollapse": false, + + + /** + * Enable infinite scrolling for DataTables (to be used in combination with + * sScrollY). Infinite scrolling means that DataTables will continually load + * data as a user scrolls through a table, which is very useful for large + * dataset. This cannot be used with pagination, which is automatically + * disabled. + * @type boolean + * @default false + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "bScrollInfinite": true, + * "bScrollCollapse": true, + * "sScrollY": "200px" + * } ); + * } ); + */ + "bScrollInfinite": false, + + + /** + * Configure DataTables to use server-side processing. Note that the + * sAjaxSource parameter must also be given in order to give DataTables a + * source to obtain the required data for each draw. + * @type boolean + * @default false + * + * @example + * $(document).ready( function () { + * $('#example').dataTable( { + * "bServerSide": true, + * "sAjaxSource": "xhr.php" + * } ); + * } ); + */ + "bServerSide": false, + + + /** + * Enable or disable sorting of columns. Sorting of individual columns can be + * disabled by the "bSortable" option for each column. + * @type boolean + * @default true + * + * @example + * $(document).ready( function () { + * $('#example').dataTable( { + * "bSort": false + * } ); + * } ); + */ + "bSort": true, + + + /** + * Allows control over whether DataTables should use the top (true) unique + * cell that is found for a single column, or the bottom (false - default). + * This is useful when using complex headers. + * @type boolean + * @default false + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "bSortCellsTop": true + * } ); + * } ); + */ + "bSortCellsTop": false, + + + /** + * Enable or disable the addition of the classes 'sorting_1', 'sorting_2' and + * 'sorting_3' to the columns which are currently being sorted on. This is + * presented as a feature switch as it can increase processing time (while + * classes are removed and added) so for large data sets you might want to + * turn this off. + * @type boolean + * @default true + * + * @example + * $(document).ready( function () { + * $('#example').dataTable( { + * "bSortClasses": false + * } ); + * } ); + */ + "bSortClasses": true, + + + /** + * Enable or disable state saving. When enabled a cookie will be used to save + * table display information such as pagination information, display length, + * filtering and sorting. As such when the end user reloads the page the + * display display will match what thy had previously set up. + * @type boolean + * @default false + * + * @example + * $(document).ready( function () { + * $('#example').dataTable( { + * "bStateSave": true + * } ); + * } ); + */ + "bStateSave": false, + + + /** + * Customise the cookie and / or the parameters being stored when using + * DataTables with state saving enabled. This function is called whenever + * the cookie is modified, and it expects a fully formed cookie string to be + * returned. Note that the data object passed in is a Javascript object which + * must be converted to a string (JSON.stringify for example). + * @type function + * @param {string} sName Name of the cookie defined by DataTables + * @param {object} oData Data to be stored in the cookie + * @param {string} sExpires Cookie expires string + * @param {string} sPath Path of the cookie to set + * @returns {string} Cookie formatted string (which should be encoded by + * using encodeURIComponent()) + * + * @example + * $(document).ready( function () { + * $('#example').dataTable( { + * "fnCookieCallback": function (sName, oData, sExpires, sPath) { + * // Customise oData or sName or whatever else here + * return sName + "="+JSON.stringify(oData)+"; expires=" + sExpires +"; path=" + sPath; + * } + * } ); + * } ); + */ + "fnCookieCallback": null, + + + /** + * This function is called on every 'draw' event, and allows you to + * dynamically modify any aspect you want about the created DOM. + * @type function + * @param {object} oSettings DataTables settings object + * + * @example + * $(document).ready( function() { + * $('#example').dataTable( { + * "fnDrawCallback": function() { + * alert( 'DataTables has redrawn the table' ); + * } + * } ); + * } ); + */ + "fnDrawCallback": null, + + + /** + * Identical to fnHeaderCallback() but for the table footer this function + * allows you to modify the table footer on every 'draw' even. + * @type function + * @param {node} nFoot "TR" element for the footer + * @param {array} aData Full table data (as derived from the original HTML) + * @param {int} iStart Index for the current display starting point in the + * display array + * @param {int} iEnd Index for the current display ending point in the + * display array + * @param {array int} aiDisplay Index array to translate the visual position + * to the full data array + * + * @example + * $(document).ready( function() { + * $('#example').dataTable( { + * "fnFooterCallback": function( nFoot, aData, iStart, iEnd, aiDisplay ) { + * nFoot.getElementsByTagName('th')[0].innerHTML = "Starting index is "+iStart; + * } + * } ); + * } ) + */ + "fnFooterCallback": null, + + + /** + * When rendering large numbers in the information element for the table + * (i.e. "Showing 1 to 10 of 57 entries") DataTables will render large numbers + * to have a comma separator for the 'thousands' units (e.g. 1 million is + * rendered as "1,000,000") to help readability for the end user. This + * function will override the default method DataTables uses. + * @type function + * @param {int} iIn number to be formatted + * @returns {string} formatted string for DataTables to show the number + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "fnFormatNumber": function ( iIn ) { + * if ( iIn < 1000 ) { + * return iIn; + * } else { + * var + * s=(iIn+""), + * a=s.split(""), out="", + * iLen=s.length; + * + * for ( var i=0 ; i<iLen ; i++ ) { + * if ( i%3 === 0 && i !== 0 ) { + * out = "'"+out; + * } + * out = a[iLen-i-1]+out; + * } + * } + * return out; + * }; + * } ); + * } ); + */ + "fnFormatNumber": function ( iIn ) { + if ( iIn < 1000 ) + { + // A small optimisation for what is likely to be the majority of use cases + return iIn; + } + + var s=(iIn+""), a=s.split(""), out="", iLen=s.length; + + for ( var i=0 ; i + * + * @example + * $(document).ready( function() { + * $('#example').dataTable( { + * "fnInitComplete": function(oSettings, json) { + * alert( 'DataTables has finished its initialisation.' ); + * } + * } ); + * } ) + */ + "fnInitComplete": null, + + + /** + * Called at the very start of each table draw and can be used to cancel the + * draw by returning false, any other return (including undefined) results in + * the full draw occurring). + * @type function + * @param {object} oSettings DataTables settings object + * @returns {boolean} False will cancel the draw, anything else (including no + * return) will allow it to complete. + * + * @example + * $(document).ready( function() { + * $('#example').dataTable( { + * "fnPreDrawCallback": function( oSettings ) { + * if ( $('#test').val() == 1 ) { + * return false; + * } + * } + * } ); + * } ); + */ + "fnPreDrawCallback": null, + + + /** + * This function allows you to 'post process' each row after it have been + * generated for each table draw, but before it is rendered on screen. This + * function might be used for setting the row class name etc. + * @type function + * @param {node} nRow "TR" element for the current row + * @param {array} aData Raw data array for this row + * @param {int} iDisplayIndex The display index for the current table draw + * @param {int} iDisplayIndexFull The index of the data in the full list of + * rows (after filtering) + * @returns {node} "TR" element for the current row + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { + * // Bold the grade for all 'A' grade browsers + * if ( aData[4] == "A" ) + * { + * $('td:eq(4)', nRow).html( 'A' ); + * } + * return nRow; + * } + * } ); + * } ); + */ + "fnRowCallback": null, + + + /** + * This parameter allows you to override the default function which obtains + * the data from the server ($.getJSON) so something more suitable for your + * application. For example you could use POST data, or pull information from + * a Gears or AIR database. + * @type function + * @param {string} sSource HTTP source to obtain the data from (sAjaxSource) + * @param {array} aoData A key/value pair object containing the data to send + * to the server + * @param {function} fnCallback to be called on completion of the data get + * process that will draw the data on the page. + * @param {object} oSettings DataTables settings object + * + * @example + * // POST data to server + * $(document).ready(function() { + * $('#example').dataTable( { + * "bProcessing": true, + * "bServerSide": true, + * "sAjaxSource": "xhr.php", + * "fnServerData": function ( sSource, aoData, fnCallback ) { + * $.ajax( { + * "dataType": 'json', + * "type": "POST", + * "url": sSource, + * "data": aoData, + * "success": fnCallback + * } ); + * } + * } ); + * } ); + */ + "fnServerData": function ( sUrl, aoData, fnCallback, oSettings ) { + oSettings.jqXHR = $.ajax( { + "url": sUrl, + "data": aoData, + "success": function (json) { + $(oSettings.oInstance).trigger('xhr', oSettings); + fnCallback( json ); + }, + "dataType": "json", + "cache": false, + "type": oSettings.sServerMethod, + "error": function (xhr, error, thrown) { + if ( error == "parsererror" ) { + alert( "DataTables warning: JSON data from server could not be parsed. "+ + "This is caused by a JSON formatting error." ); + } + } + } ); + }, + + + /** + * It is often useful to send extra data to the server when making an Ajax + * request - for example custom filtering information, and this callback + * function makes it trivial to send extra information to the server. The + * passed in parameter is the data set that has been constructed by + * DataTables, and you can add to this or modify it as you require. + * @type function + * @param {array} aoData Data array (array of objects which are name/value + * pairs) that has been constructed by DataTables and will be sent to the + * server. In the case of Ajax sourced data with server-side processing + * this will be an empty array, for server-side processing there will be a + * significant number of parameters! + * @returns {undefined} Ensure that you modify the aoData array passed in, + * as this is passed by reference. + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "bProcessing": true, + * "bServerSide": true, + * "sAjaxSource": "scripts/server_processing.php", + * "fnServerParams": function ( aoData ) { + * aoData.push( { "name": "more_data", "value": "my_value" } ); + * } + * } ); + * } ); + */ + "fnServerParams": null, + + + /** + * State saving in DataTables is very useful, but it does a blanket save on + * all properties that the user can modify, so the table is restored. This + * callback method can be used to modify the saved properties as you require, + * just prior to them being loaded. This method can also be used to override + * the state loading altogether by returning false. + * @type function + * @param {object} oSettings DataTables settings object + * @param {object} oData Object containing information retrieved from the + * state saving cookie which should be restored. For the exact properties + * please refer to the DataTables code. + * @returns {boolean} false if the state should not be loaded, true otherwise + * + * @example + * // Remove a previously saved filter + * $(document).ready( function () { + * $('#example').dataTable( { + * "bStateSave": true, + * "fnStateLoadCallback": function ( oSettings, oData ) { + * oData.sFilter = ""; + * return true; + * } + * } ); + * } ); + * + * @example + * // Override state loading + * $(document).ready( function () { + * $('#example').dataTable( { + * "bStateSave": true, + * "fnStateLoadCallback": function ( oSettings, oData ) { + * return false; + * } + * } ); + * } ); + */ + "fnStateLoadCallback": null, + + + /** + * When using state saving it can be useful to store your own custom + * parameters in the state saving cookie that DataTables uses, or to modify + * the settings that DataTables uses. Note that this function can be quite + * involved to use since it uses JSON notation in a string, given that jQuery + * does not provide a "stringify" option for JSON objects. + * @type function + * @param {object} oSettings DataTables settings object + * @param {string} sValue a JSON string (without the final closing brace) + * which should be stored in the state saving cookie. + * @returns {string} The full string that should be used to save the state + * + * @example + * // Add a custom parameter + * $(document).ready( function () { + * $('#example').dataTable( { + * "bStateSave": true, + * "fnStateSaveCallback": function ( oSettings, sValue ) { + * sValue += ',"myCustomParameter": "myValue"'; + * return sValue; + * } + * } ); + * } ); + * + * @example + * // Modify saved filter to be blank + * $(document).ready( function () { + * $('#example').dataTable( { + * "bStateSave": true, + * "fnStateSaveCallback": function ( oSettings, sValue ) { + * sValue = sValue.replace( /"sFilter":".*?"/, '"sFilter":""' ); + * return sValue; + * } + * } ); + * } ); + * + * @example + * // Modify saved filter to be blank - using JSON2.js + * $(document).ready( function () { + * $('#example').dataTable( { + * "bStateSave": true, + * "fnStateSaveCallback": function ( oSettings, sValue ) { + * var oData = JSON.parse( sValue+"}" ); + * oData.sFilter = ""; + * return JSON.stringify( oData ).slice( 0, -1 ); + * } + * } ); + * } ); + */ + "fnStateSaveCallback": null, + + + /** + * Duration of the cookie which is used for storing session information. This + * value is given in seconds. + * @type int + * @default 7200 (2 hours) + * + * @example + * $(document).ready( function() { + * $('#example').dataTable( { + * "iCookieDuration": 60*60*24 // 1 day + * } ); + * } ) + */ + "iCookieDuration": 7200, + + + /** + * When enabled DataTables will not make a request to the server for the first + * page draw - rather it will use the data already on the page (no sorting etc + * will be applied to it), thus saving on an XHR at load time. iDeferLoading + * is used to indicate that deferred loading is required, but it is also used + * to tell DataTables how many records there are in the full table (allowing + * the information element and pagination to be displayed correctly). + * @type int + * @default null + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "bServerSide": true, + * "sAjaxSource": "scripts/server_processing.php", + * "iDeferLoading": 57 + * } ); + * } ); + */ + "iDeferLoading": null, + + + /** + * Number of rows to display on a single page when using pagination. If + * feature enabled (bLengthChange) then the end user will be able to override + * this to a custom setting using a pop-up menu. + * @type int + * @default 10 + * + * @example + * $(document).ready( function() { + * $('#example').dataTable( { + * "iDisplayLength": 50 + * } ); + * } ) + */ + "iDisplayLength": 10, + + + /** + * Define the starting point for data display when using DataTables with + * pagination. Note that this parameter is the number of records, rather than + * the page number, so if you have 10 records per page and want to start on + * the third page, it should be "20". + * @type int + * @default 0 + * + * @example + * $(document).ready( function() { + * $('#example').dataTable( { + * "iDisplayStart": 20 + * } ); + * } ) + */ + "iDisplayStart": 0, + + + /** + * The scroll gap is the amount of scrolling that is left to go before + * DataTables will load the next 'page' of data automatically. You typically + * want a gap which is big enough that the scrolling will be smooth for the + * user, while not so large that it will load more data than need. + * @type int + * @default 100 + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "bScrollInfinite": true, + * "bScrollCollapse": true, + * "sScrollY": "200px", + * "iScrollLoadGap": 50 + * } ); + * } ); + */ + "iScrollLoadGap": 100, + + + /** + * By default DataTables allows keyboard navigation of the table (sorting, paging, + * and filtering) by adding a tabindex attribute to the required elements. This + * allows you to tab through the controls and press the enter key to activate them. + * The tabindex is default 0, meaning that the tab follows the flow of the document. + * You can overrule this using this parameter if you wish. Use a value of -1 to + * disable built-in keyboard navigation. + * @type int + * @default 0 + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "iTabIndex": 1 + * } ); + * } ); + */ + "iTabIndex": 0, + + + /** + * All strings that DataTables uses in the user interface that it creates + * are defined in this object, allowing you to modified them individually or + * completely replace them all as required. + * @member + */ + "oLanguage": { + /** + * Strings that are used for WAI-ARIA labels and controls only (these are not + * actually visible on the page, but will be read by screenreaders, and thus + * must be internationalised as well). + * @namespace + */ + "oAria": { + /** + * ARIA label that is added to the table headers when the column may be + * sorted ascending by activing the column (click or return when focused). + * Note that the column header is prefixed to this string. + * @type string + * @default : activate to sort column ascending + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "oLanguage": { + * "oAria": { + * "sSortAscending": " - click/return to sort ascending" + * } + * } + * } ); + * } ); + */ + "sSortAscending": ": activate to sort column ascending", + + /** + * ARIA label that is added to the table headers when the column may be + * sorted descending by activing the column (click or return when focused). + * Note that the column header is prefixed to this string. + * @type string + * @default : activate to sort column ascending + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "oLanguage": { + * "oAria": { + * "sSortDescending": " - click/return to sort descending" + * } + * } + * } ); + * } ); + */ + "sSortDescending": ": activate to sort column descending" + }, + + /** + * Pagination string used by DataTables for the two built-in pagination + * control types ("two_button" and "full_numbers") + * @namespace + */ + "oPaginate": { + /** + * Text to use when using the 'full_numbers' type of pagination for the + * button to take the user to the first page. + * @type string + * @default First + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "oLanguage": { + * "oPaginate": { + * "sFirst": "First page" + * } + * } + * } ); + * } ); + */ + "sFirst": "First", + + + /** + * Text to use when using the 'full_numbers' type of pagination for the + * button to take the user to the last page. + * @type string + * @default Last + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "oLanguage": { + * "oPaginate": { + * "sLast": "Last page" + * } + * } + * } ); + * } ); + */ + "sLast": "Last", + + + /** + * Text to use when using the 'full_numbers' type of pagination for the + * button to take the user to the next page. + * @type string + * @default Next + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "oLanguage": { + * "oPaginate": { + * "sNext": "Next page" + * } + * } + * } ); + * } ); + */ + "sNext": "Next", + + + /** + * Text to use when using the 'full_numbers' type of pagination for the + * button to take the user to the previous page. + * @type string + * @default Previous + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "oLanguage": { + * "oPaginate": { + * "sPrevious": "Previous page" + * } + * } + * } ); + * } ); + */ + "sPrevious": "Previous" + }, + + /** + * This string is shown in preference to sZeroRecords when the table is + * empty of data (regardless of filtering). Note that this is an optional + * parameter - if it is not given, the value of sZeroRecords will be used + * instead (either the default or given value). + * @type string + * @default No data available in table + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "oLanguage": { + * "sEmptyTable": "No data available in table" + * } + * } ); + * } ); + */ + "sEmptyTable": "No data available in table", + + + /** + * This string gives information to the end user about the information that + * is current on display on the page. The _START_, _END_ and _TOTAL_ + * variables are all dynamically replaced as the table display updates, and + * can be freely moved or removed as the language requirements change. + * @type string + * @default Showing _START_ to _END_ of _TOTAL_ entries + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "oLanguage": { + * "sInfo": "Got a total of _TOTAL_ entries to show (_START_ to _END_)" + * } + * } ); + * } ); + */ + "sInfo": "Showing _START_ to _END_ of _TOTAL_ entries", + + + /** + * Display information string for when the table is empty. Typically the + * format of this string should match sInfo. + * @type string + * @default Showing 0 to 0 of 0 entries + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "oLanguage": { + * "sInfoEmpty": "No entries to show" + * } + * } ); + * } ); + */ + "sInfoEmpty": "Showing 0 to 0 of 0 entries", + + + /** + * When a user filters the information in a table, this string is appended + * to the information (sInfo) to give an idea of how strong the filtering + * is. The variable _MAX_ is dynamically updated. + * @type string + * @default (filtered from _MAX_ total entries) + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "oLanguage": { + * "sInfoFiltered": " - filtering from _MAX_ records" + * } + * } ); + * } ); + */ + "sInfoFiltered": "(filtered from _MAX_ total entries)", + + + /** + * If can be useful to append extra information to the info string at times, + * and this variable does exactly that. This information will be appended to + * the sInfo (sInfoEmpty and sInfoFiltered in whatever combination they are + * being used) at all times. + * @type string + * @default Empty string + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "oLanguage": { + * "sInfoPostFix": "All records shown are derived from real information." + * } + * } ); + * } ); + */ + "sInfoPostFix": "", + + + /** + * DataTables has a build in number formatter (fnFormatNumber) which is used + * to format large numbers that are used in the table information. By + * default a comma is used, but this can be trivially changed to any + * character you wish with this parameter. + * @type string + * @default , + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "oLanguage": { + * "sInfoThousands": "'" + * } + * } ); + * } ); + */ + "sInfoThousands": ",", + + + /** + * Detail the action that will be taken when the drop down menu for the + * pagination length option is changed. The '_MENU_' variable is replaced + * with a default select list of 10, 25, 50 and 100, and can be replaced + * with a custom select box if required. + * @type string + * @default Show _MENU_ entries + * + * @example + * // Language change only + * $(document).ready(function() { + * $('#example').dataTable( { + * "oLanguage": { + * "sLengthMenu": "Display _MENU_ records" + * } + * } ); + * } ); + * + * @example + * // Language and options change + * $(document).ready(function() { + * $('#example').dataTable( { + * "oLanguage": { + * "sLengthMenu": 'Display records' + * } + * } ); + * } ); + */ + "sLengthMenu": "Show _MENU_ entries", + + + /** + * When using Ajax sourced data and during the first draw when DataTables is + * gathering the data, this message is shown in an empty row in the table to + * indicate to the end user the the data is being loaded. Note that this + * parameter is not used when loading data by server-side processing, just + * Ajax sourced data with client-side processing. + * @type string + * @default Loading... + * + * @example + * $(document).ready( function() { + * $('#example').dataTable( { + * "oLanguage": { + * "sLoadingRecords": "Please wait - loading..." + * } + * } ); + * } ); + */ + "sLoadingRecords": "Loading...", + + + /** + * Text which is displayed when the table is processing a user action + * (usually a sort command or similar). + * @type string + * @default Processing... + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "oLanguage": { + * "sProcessing": "DataTables is currently busy" + * } + * } ); + * } ); + */ + "sProcessing": "Processing...", + + + /** + * Details the actions that will be taken when the user types into the + * filtering input text box. The variable "_INPUT_", if used in the string, + * is replaced with the HTML text box for the filtering input allowing + * control over where it appears in the string. If "_INPUT_" is not given + * then the input box is appended to the string automatically. + * @type string + * @default Search: + * + * @example + * // Input text box will be appended at the end automatically + * $(document).ready(function() { + * $('#example').dataTable( { + * "oLanguage": { + * "sSearch": "Filter records:" + * } + * } ); + * } ); + * + * @example + * // Specify where the filter should appear + * $(document).ready(function() { + * $('#example').dataTable( { + * "oLanguage": { + * "sSearch": "Apply filter _INPUT_ to table" + * } + * } ); + * } ); + */ + "sSearch": "Search:", + + + /** + * All of the language information can be stored in a file on the + * server-side, which DataTables will look up if this parameter is passed. + * It must store the URL of the language file, which is in a JSON format, + * and the object has the same properties as the oLanguage object in the + * initialiser object (i.e. the above parameters). Please refer to one of + * the example language files to see how this works in action. + * @type string + * @default Empty string - i.e. disabled + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "oLanguage": { + * "sUrl": "http://www.sprymedia.co.uk/dataTables/lang.txt" + * } + * } ); + * } ); + */ + "sUrl": "", + + + /** + * Text shown inside the table records when the is no information to be + * displayed after filtering. sEmptyTable is shown when there is simply no + * information in the table at all (regardless of filtering). + * @type string + * @default No matching records found + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "oLanguage": { + * "sZeroRecords": "No records to display" + * } + * } ); + * } ); + */ + "sZeroRecords": "No matching records found" + }, + + + /** + * This parameter allows you to have define the global filtering state at + * initialisation time. As an object the "sSearch" parameter must be + * defined, but all other parameters are optional. When "bRegex" is true, + * the search string will be treated as a regular expression, when false + * (default) it will be treated as a straight string. When "bSmart" + * DataTables will use it's smart filtering methods (to word match at + * any point in the data), when false this will not be done. + * @type object + * @extends DataTable.models.oSearch + * + * @example + * $(document).ready( function() { + * $('#example').dataTable( { + * "oSearch": {"sSearch": "Initial search"} + * } ); + * } ) + */ + "oSearch": $.extend( {}, DataTable.models.oSearch ), + + + /** + * By default DataTables will look for the property 'aaData' when obtaining + * data from an Ajax source or for server-side processing - this parameter + * allows that property to be changed. You can use Javascript dotted object + * notation to get a data source for multiple levels of nesting. + * @type string + * @default aaData + * + * @example + * // Get data from { "data": [...] } + * $(document).ready(function() { + * var oTable = $('#example').dataTable( { + * "sAjaxSource": "sources/data.txt", + * "sAjaxDataProp": "data" + * } ); + * } ); + * + * @example + * // Get data from { "data": { "inner": [...] } } + * $(document).ready(function() { + * var oTable = $('#example').dataTable( { + * "sAjaxSource": "sources/data.txt", + * "sAjaxDataProp": "data.inner" + * } ); + * } ); + */ + "sAjaxDataProp": "aaData", + + + /** + * You can instruct DataTables to load data from an external source using this + * parameter (use aData if you want to pass data in you already have). Simply + * provide a url a JSON object can be obtained from. This object must include + * the parameter 'aaData' which is the data source for the table. + * @type string + * @default null + * + * @example + * $(document).ready( function() { + * $('#example').dataTable( { + * "sAjaxSource": "http://www.sprymedia.co.uk/dataTables/json.php" + * } ); + * } ) + */ + "sAjaxSource": null, + + + /** + * This parameter can be used to override the default prefix that DataTables + * assigns to a cookie when state saving is enabled. + * @type string + * @default SpryMedia_DataTables_ + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "sCookiePrefix": "my_datatable_", + * } ); + * } ); + */ + "sCookiePrefix": "SpryMedia_DataTables_", + + + /** + * This initialisation variable allows you to specify exactly where in the + * DOM you want DataTables to inject the various controls it adds to the page + * (for example you might want the pagination controls at the top of the + * table). DIV elements (with or without a custom class) can also be added to + * aid styling. The follow syntax is used: + *
      + *
    • The following options are allowed: + *
        + *
      • 'l' - Length changing
      • 'f' - Filtering input + *
      • 't' - The table!
      • + *
      • 'i' - Information
      • + *
      • 'p' - Pagination
      • + *
      • 'r' - pRocessing
      • + *
      + *
    • + *
    • The following constants are allowed: + *
        + *
      • 'H' - jQueryUI theme "header" classes ('fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix')
      • + *
      • 'F' - jQueryUI theme "footer" classes ('fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix')
      • + *
      + *
    • + *
    • The following syntax is expected: + *
        + *
      • '<' and '>' - div elements
      • + *
      • '<"class" and '>' - div with a class
      • + *
      • '<"#id" and '>' - div with an ID
      • + *
      + *
    • + *
    • Examples: + *
        + *
      • '<"wrapper"flipt>'
      • + *
      • '<lf<t>ip>'
      • + *
      + *
    • + *
    + * @type string + * @default lfrtip (when bJQueryUI is false) or + * <"H"lfr>t<"F"ip> (when bJQueryUI is true) + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "sDom": '<"top"i>rt<"bottom"flp><"clear"&lgt;' + * } ); + * } ); + */ + "sDom": "lfrtip", + + + /** + * DataTables features two different built-in pagination interaction methods + * ('two_button' or 'full_numbers') which present different page controls to + * the end user. Further methods can be added using the API (see below). + * @type string + * @default two_button + * + * @example + * $(document).ready( function() { + * $('#example').dataTable( { + * "sPaginationType": "full_numbers" + * } ); + * } ) + */ + "sPaginationType": "two_button", + + + /** + * Enable horizontal scrolling. When a table is too wide to fit into a certain + * layout, or you have a large number of columns in the table, you can enable + * x-scrolling to show the table in a viewport, which can be scrolled. This + * property can by any CSS unit, or a number (in which case it will be treated + * as a pixel measurement). + * @type string + * @default blank string - i.e. disabled + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "sScrollX": "100%", + * "bScrollCollapse": true + * } ); + * } ); + */ + "sScrollX": "", + + + /** + * This property can be used to force a DataTable to use more width than it + * might otherwise do when x-scrolling is enabled. For example if you have a + * table which requires to be well spaced, this parameter is useful for + * "over-sizing" the table, and thus forcing scrolling. This property can by + * any CSS unit, or a number (in which case it will be treated as a pixel + * measurement). + * @type string + * @default blank string - i.e. disabled + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "sScrollX": "100%", + * "sScrollXInner": "110%" + * } ); + * } ); + */ + "sScrollXInner": "", + + + /** + * Enable vertical scrolling. Vertical scrolling will constrain the DataTable + * to the given height, an enable scrolling for any data which overflows the + * current viewport. This can be used as an alternative to paging to display + * a lot of data in a small area (although paging and scrolling can both be + * enabled at the same time). This property can by any CSS unit, or a number + * (in which case it will be treated as a pixel measurement). + * @type string + * @default blank string - i.e. disabled + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "sScrollY": "200px", + * "bPaginate": false + * } ); + * } ); + */ + "sScrollY": "", + + + /** + * Set the HTTP method that is used to make the Ajax call for server-side + * processing or Ajax sourced data. + * @type string + * @default GET + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "bServerSide": true, + * "sAjaxSource": "scripts/post.php", + * "sServerMethod": "POST" + * } ); + * } ); + */ + "sServerMethod": "GET" +}; + diff --git a/media/src/model/model.ext.js b/media/src/model/model.ext.js new file mode 100644 index 00000000..a0ff0f70 --- /dev/null +++ b/media/src/model/model.ext.js @@ -0,0 +1,548 @@ + + +/** + * DataTables extension options and plug-ins. This namespace acts as a collection "area" + * for plug-ins that can be used to extend the default DataTables behaviour - indeed many + * of the build in methods use this method to provide their own capabilities (sorting methods + * for example). + * + * Note that this namespace is aliased to jQuery.fn.dataTableExt so it can be readily accessed + * and modified by plug-ins. + * @namespace + */ +DataTable.models.ext = { + /** + * Plug-in filtering functions - this method of filtering is complimentary to the default + * type based filtering, and a lot more comprehensive as it allows you complete control + * over the filtering logic. Each element in this array is a function (parameters + * described below) that is called for every row in the table, and your logic decides if + * it should be included in the filtered data set or not. + *
      + *
    • + * Function input parameters: + *
        + *
      • {object} DataTables settings object: see {@link DataTable.models.oSettings}.
      • + *
      • {array|object} Data for the row to be processed (same as the original format + * that was passed in as the data source, or an array from a DOM data source
      • + *
      • {int} Row index in aoData ({@link DataTable.models.oSettings.aoData}), which can + * be useful to retrieve the TR element if you need DOM interaction.
      • + *
      + *
    • + *
    • + * Function return: + *
        + *
      • {boolean} Include the row in the filtered result set (true) or not (false)
      • + *
      + * + *
    + * @type array + * @default [] + * + * @example + * // The following example shows custom filtering being applied to the fourth column (i.e. + * // the aData[3] index) based on two input values from the end-user, matching the data in + * // a certain range. + * $.fn.dataTableExt.afnFiltering.push( + * function( oSettings, aData, iDataIndex ) { + * var iMin = document.getElementById('min').value * 1; + * var iMax = document.getElementById('max').value * 1; + * var iVersion = aData[3] == "-" ? 0 : aData[3]*1; + * if ( iMin == "" && iMax == "" ) { + * return true; + * } + * else if ( iMin == "" && iVersion < iMax ) { + * return true; + * } + * else if ( iMin < iVersion && "" == iMax ) { + * return true; + * } + * else if ( iMin < iVersion && iVersion < iMax ) { + * return true; + * } + * return false; + * } + * ); + */ + "afnFiltering": [], + + + /** + * Plug-in sorting functions - this method of sorting is complimentary to the default type + * based sorting that DataTables does automatically, allowing much greater control over the + * the data that is being used to sort a column. This is useful if you want to do sorting + * based on live data (for example the contents of an 'input' element) rather than just the + * static string that DataTables knows of. The way these plug-ins work is that you create + * an array of the values you wish to be sorted for the column in question and then return + * that array. Which pre-sorting function is run here depends on the sSortDataType parameter + * that is used for the column (if any). This is the corollary of ofnSearch for sort + * data. + *
      + *
    • + * Function input parameters: + *
        + *
      • {object} DataTables settings object: see {@link DataTable.models.oSettings}.
      • + *
      • {int} Target column index
      • + *
      + *
    • + *
    • + * Function return: + *
        + *
      • {array} Data for the column to be sorted upon
      • + *
      + * + *
    + * + * Note that as of v1.9, it is typically preferable to use mDataProp to prepare data for + * the different uses that DataTables can put the data to. Specifically mDataProp when + * used as a function will give you a 'type' (sorting, filtering etc) that you can use to + * prepare the data as required for the different types. As such, this method is deprecated. + * @type array + * @default [] + * @deprecated + * + * @example + * // Updating the cached sorting information with user entered values in HTML input elements + * jQuery.fn.dataTableExt.afnSortData['dom-text'] = function  ( oSettings, iColumn ) + * { + * var aData = []; + * $( 'td:eq('+iColumn+') input', oSettings.oApi._fnGetTrNodes(oSettings) ).each( function () { + * aData.push( this.value ); + * } ); + * return aData; + * } + */ + "afnSortData": [], + + + /** + * Feature plug-ins - This is an array of objects which describe the feature plug-ins that are + * available to DataTables. These feature plug-ins are accessible through the sDom initialisation + * option. As such, each feature plug-in must describe a function that is used to initialise + * itself (fnInit), a character so the feature can be enabled by sDom (cFeature) and the name + * of the feature (sFeature). Thus the objects attached to this method must provide: + *
      + *
    • {function} fnInit Initialisation of the plug-in + *
        + *
      • + * Function input parameters: + *
          + *
        • {object} DataTables settings object: see {@link DataTable.models.oSettings}.
        • + *
        + *
      • + *
      • + * Function return: + *
          + *
        • {node|null} The element which contains your feature. Note that the return + * may also be void if your plug-in does not require to inject any DOM elements + * into DataTables control (sDom) - for example this might be useful when + * developing a plug-in which allows table control via keyboard entry.
        • + *
        + * + *
      + *
    • + *
    • {character} cFeature Character that will be matched in sDom - case sensitive
    • + *
    • {string} sFeature Feature name
    • + *
    + * @type array + * @default [] + * + * @example + * // How TableTools initialises itself. + * $.fn.dataTableExt.aoFeatures.push( { + * "fnInit": function( oSettings ) { + * return new TableTools( { "oDTSettings": oSettings } ); + * }, + * "cFeature": "T", + * "sFeature": "TableTools" + * } ); + */ + "aoFeatures": [], + + + /** + * Type detection plug-in functions - DataTables utilises types to define how sorting and + * filtering behave, and types can be either be defined by the developer (sType for the + * column) or they can be automatically detected by the methods in this array. The functions + * defined in the array are quite simple, taking a single parameter (the data to analyse) + * and returning the type if it is a known type, or null otherwise. + *
      + *
    • + * Function input parameters: + *
        + *
      • {*} Data from the column cell to be analysed
      • + *
      + *
    • + *
    • + * Function return: + *
        + *
      • {string|null} Data type detected, or null if unknown (and thus pass it + * on to the other type detection functions.
      • + *
      + * + *
    + * @type array + * @default [] + * + * @example + * // Currency type detection plug-in: + * jQuery.fn.dataTableExt.aTypes.push( + * function ( sData ) { + * var sValidChars = "0123456789.-"; + * var Char; + * + * // Check the numeric part + * for ( i=1 ; i= parseInt(sThat, 10); + }, + + + /** + * Index for what 'this' index API functions should use + * @type int + * @default 0 + */ + "iApiIndex": 0, + + + /** + * Pre-processing of filtering data plug-ins - When you assign the sType for a column + * (or have it automatically detected for you by DataTables or a type detection plug-in), + * you will typically be using this for custom sorting, but it can also be used to provide + * custom filtering by allowing you to pre-processing the data and returning the data in + * the format that should be filtered upon. This is done by adding functions this object + * with a parameter name which matches the sType for that target column. This is the + * corollary of afnSortData for filtering data. + *
      + *
    • + * Function input parameters: + *
        + *
      • {*} Data from the column cell to be prepared for filtering
      • + *
      + *
    • + *
    • + * Function return: + *
        + *
      • {string|null} Formatted string that will be used for the filtering.
      • + *
      + * + *
    + * + * Note that as of v1.9, it is typically preferable to use mDataProp to prepare data for + * the different uses that DataTables can put the data to. Specifically mDataProp when + * used as a function will give you a 'type' (sorting, filtering etc) that you can use to + * prepare the data as required for the different types. As such, this method is deprecated. + * @type object + * @default {} + * @deprecated + * + * @example + * $.fn.dataTableExt.ofnSearch['title-numeric'] = function ( sData ) { + * return sData.replace(/\n/g," ").replace( /<.*?>/g, "" ); + * } + */ + "ofnSearch": {}, + + + /** + * Container for all private functions in DataTables so they can be exposed externally + * @type object + * @default {} + */ + "oApi": {}, + + + /** + * Storage for the various classes that DataTables uses + * @type object + * @default {} + */ + "oStdClasses": {}, + + + /** + * Storage for the various classes that DataTables uses - jQuery UI suitable + * @type object + * @default {} + */ + "oJUIClasses": {}, + + + /** + * Pagination plug-in methods - The style and controls of the pagination can significantly + * impact on how the end user interacts with the data in your table, and DataTables allows + * the addition of pagination controls by extending this object, which can then be enabled + * through the sPaginationType initialisation parameter. Each pagination type that + * is added is an object (the property name of which is what sPaginationType refers + * to) that has two properties, both methods that are used by DataTables to update the + * control's state. + *
      + *
    • + * fnInit - Initialisation of the paging controls. Called only during initialisation + * of the table. It is expected that this function will add the required DOM elements + * to the page for the paging controls to work. The element pointer + * 'oSettings.aanFeatures.p' array is provided by DataTables to contain the paging + * controls (note that this is a 2D array to allow for multiple instances of each + * DataTables DOM element). It is suggested that you add the controls to this element + * as children + *
        + *
      • + * Function input parameters: + *
          + *
        • {object} DataTables settings object: see {@link DataTable.models.oSettings}.
        • + *
        • {node} Container into which the pagination controls must be inserted
        • + *
        • {function} Draw callback function - whenever the controls cause a page + * change, this method must be called to redraw the table.
        • + *
        + *
      • + *
      • + * Function return: + *
          + *
        • No return required
        • + *
        + * + *
      + * + *
    • + * fnInit - This function is called whenever the paging status of the table changes and is + * typically used to update classes and/or text of the paging controls to reflex the new + * status. + *
        + *
      • + * Function input parameters: + *
          + *
        • {object} DataTables settings object: see {@link DataTable.models.oSettings}.
        • + *
        • {function} Draw callback function - in case you need to redraw the table again + * or attach new event listeners
        • + *
        + *
      • + *
      • + * Function return: + *
          + *
        • No return required
        • + *
        + * + *
      + * + *
    + * @type object + * @default {} + * + * @example + * $.fn.dataTableExt.oPagination.four_button = { + * "fnInit": function ( oSettings, nPaging, fnCallbackDraw ) { + * nFirst = document.createElement( 'span' ); + * nPrevious = document.createElement( 'span' ); + * nNext = document.createElement( 'span' ); + * nLast = document.createElement( 'span' ); + * + * nFirst.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sFirst ) ); + * nPrevious.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sPrevious ) ); + * nNext.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sNext ) ); + * nLast.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sLast ) ); + * + * nFirst.className = "paginate_button first"; + * nPrevious.className = "paginate_button previous"; + * nNext.className="paginate_button next"; + * nLast.className = "paginate_button last"; + * + * nPaging.appendChild( nFirst ); + * nPaging.appendChild( nPrevious ); + * nPaging.appendChild( nNext ); + * nPaging.appendChild( nLast ); + * + * $(nFirst).click( function () { + * oSettings.oApi._fnPageChange( oSettings, "first" ); + * fnCallbackDraw( oSettings ); + * } ); + * + * $(nPrevious).click( function() { + * oSettings.oApi._fnPageChange( oSettings, "previous" ); + * fnCallbackDraw( oSettings ); + * } ); + * + * $(nNext).click( function() { + * oSettings.oApi._fnPageChange( oSettings, "next" ); + * fnCallbackDraw( oSettings ); + * } ); + * + * $(nLast).click( function() { + * oSettings.oApi._fnPageChange( oSettings, "last" ); + * fnCallbackDraw( oSettings ); + * } ); + * + * $(nFirst).bind( 'selectstart', function () { return false; } ); + * $(nPrevious).bind( 'selectstart', function () { return false; } ); + * $(nNext).bind( 'selectstart', function () { return false; } ); + * $(nLast).bind( 'selectstart', function () { return false; } ); + * }, + * + * "fnUpdate": function ( oSettings, fnCallbackDraw ) { + * if ( !oSettings.aanFeatures.p ) { + * return; + * } + * + * // Loop over each instance of the pager + * var an = oSettings.aanFeatures.p; + * for ( var i=0, iLen=an.length ; i + *
  • + * Function input parameters: + *
      + *
    • {*} Data to compare to the second parameter
    • + *
    • {*} Data to compare to the first parameter
    • + *
    + *
  • + *
  • + * Function return: + *
      + *
    • {int} Sorting match: <0 if first parameter should be sorted lower than + * the second parameter, ===0 if the two parameters are equal and >0 if + * the first parameter should be sorted height than the second parameter.
    • + *
    + * + * + * @type object + * @default {} + * + * @example + * // Case-sensitive string sorting, with no pre-formatting method + * $.extend( $.fn.dataTableExt.oSort, { + * "string-case-asc": function(x,y) { + * return ((x < y) ? -1 : ((x > y) ?  1 : 0)); + * }, + * "string-case-desc": function(x,y) { + * return ((x < y) ?  1 : ((x > y) ? -1 : 0)); + * } + * } ); + * + * @example + * // Case-insensitive string sorting, with pre-formatting + * $.extend( $.fn.dataTableExt.oSort, { + * "string-pre": function(x) { + * return x.toLowerCase(); + * }, + * "string-asc": function(x,y) { + * return ((x < y) ? -1 : ((x > y) ?  1 : 0)); + * }, + * "string-desc": function(x,y) { + * return ((x < y) ?  1 : ((x > y) ? -1 : 0)); + * } + * } ); + */ + "oSort": {}, + + + /** + * Version string for plug-ins to check compatibility. 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 + * @type string + * @default Version number + */ + "sVersion": DataTable.version, + + + /** + * How should DataTables report an error. Can take the value 'alert' or 'throw' + * @type string + * @default alert + */ + "sErrMode": "alert", + + + /** + * Store information for DataTables to access globally about other instances + * @namespace + * @private + */ + "_oExternConfig": { + /* int:iNextUnique - next unique number for an instance */ + "iNextUnique": 0 + } +}; + diff --git a/media/src/model/model.row.js b/media/src/model/model.row.js new file mode 100644 index 00000000..f88ec698 --- /dev/null +++ b/media/src/model/model.row.js @@ -0,0 +1,64 @@ + + + +/** + * Template object for the way in which DataTables holds information about + * each individual row. This is the object format used for the settings + * aoData array. + * @namespace + */ +DataTable.models.oRow = { + /** + * TR element for the row + * @type node + * @default null + */ + "nTr": null, + + /** + * Data object from the original data source for the row. This is either + * an array if using the traditional form of DataTables, or an object if + * using mDataProp options. The exact type will depend on the passed in + * data from the data source, or will be an array if using DOM a data + * source. + * @type array|object + * @default [] + */ + "_aData": [], + + /** + * Sorting data cache - this array is ostensibly the same length as the + * number of columns (although each index is generated only as it is + * needed), and holds the data that is used for sorting each column in the + * row. We do this cache generation at the start of the sort in order that + * the formatting of the sort data need be done only once for each cell + * per sort. This array should not be read from or written to by anything + * other than the master sorting methods. + * @type array + * @default [] + * @private + */ + "_aSortData": [], + + /** + * Array of TD elements that are cached for hidden rows, so they can be + * reinserted into the table if a column is made visible again (or to act + * as a store if a column is made hidden). Only hidden columns have a + * reference in the array. For non-hidden columns the value is either + * undefined or null. + * @type array nodes + * @default [] + * @private + */ + "_anHidden": [], + + /** + * Cache of the class name that DataTables has applied to the row, so we + * can quickly look at this variable rather than needing to do a DOM check + * on className for the nTr property. + * @type string + * @default Empty string + * @private + */ + "_sRowStripe": "" +}; diff --git a/media/src/model/model.search.js b/media/src/model/model.search.js new file mode 100644 index 00000000..455fa297 --- /dev/null +++ b/media/src/model/model.search.js @@ -0,0 +1,40 @@ + + + +/** + * Template object for the way in which DataTables holds information about + * search information for the global filter and individual column filters. + * @namespace + */ +DataTable.models.oSearch = { + /** + * Flag to indicate if the filtering should be case insensitive or not + * @type boolean + * @default true + */ + "bCaseInsensitive": true, + + /** + * Applied search term + * @type string + * @default Empty string + */ + "sSearch": "", + + /** + * Flag to indicate if the search term should be interpreted as a + * regular expression (true) or not (false) and therefore and special + * regex characters escaped. + * @type boolean + * @default false + */ + "bRegex": false, + + /** + * Flag to indicate if DataTables is to use its smart filtering or not. + * @type boolean + * @default true + */ + "bSmart": true +}; + diff --git a/media/src/model/model.settings.js b/media/src/model/model.settings.js new file mode 100644 index 00000000..4c0c941a --- /dev/null +++ b/media/src/model/model.settings.js @@ -0,0 +1,841 @@ + + +/** + * DataTables settings object - this holds all the information needed for a + * given table, including configuration, data and current application of the + * table options. DataTables does not have a single instance for each DataTable + * with the settings attached to that instance, but rather instances of the + * DataTable "class" are created on-the-fly as needed (typically by a + * $().dataTable() call) and the settings object is then applied to that + * instance. + * + * Note that this object is related to {@link DataTable.defaults} but this + * one is the internal data store for DataTables's cache of columns. It should + * NOT be manipulated outside of DataTables. Any configuration should be done + * through the initialisation options. + * @namespace + * @todo Really should attach the settings object to individual instances so we + * don't need to create new instances on each $().dataTable() call (if the + * table already exists). It would also save passing oSettings around and + * into every single function. However, this is a very significant + * architecture change for DataTables and will almost certainly break + * backwards compatibility with older installations. This is something that + * will be done in 2.0. + */ +DataTable.models.oSettings = { + /** + * Primary features of DataTables and their enablement state. + * @namespace + */ + "oFeatures": { + + /** + * Flag to say if DataTables should automatically try to calculate the + * optimum table and columns widths (true) or not (false). + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type boolean + */ + "bAutoWidth": null, + + /** + * Delay the creation of TR and TD elements until they are actually + * needed by a driven page draw. This can give a significant speed + * increase for Ajax source and Javascript source data, but makes no + * difference at all fro DOM and server-side processing tables. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type boolean + */ + "bDeferRender": null, + + /** + * Enable filtering on the table or not. Note that if this is disabled + * then there is no filtering at all on the table, including fnFilter. + * To just remove the filtering input use sDom and remove the 'f' option. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type boolean + */ + "bFilter": null, + + /** + * Table information element (the 'Showing x of y records' div) enable + * flag. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type boolean + */ + "bInfo": null, + + /** + * Present a user control allowing the end user to change the page size + * when pagination is enabled. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type boolean + */ + "bLengthChange": null, + + /** + * Pagination enabled or not. Note that if this is disabled then length + * changing must also be disabled. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type boolean + */ + "bPaginate": null, + + /** + * Processing indicator enable flag whenever DataTables is enacting a + * user request - typically an Ajax request for server-side processing. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type boolean + */ + "bProcessing": null, + + /** + * Server-side processing enabled flag - when enabled DataTables will + * get all data from the server for every draw - there is no filtering, + * sorting or paging done on the client-side. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type boolean + */ + "bServerSide": null, + + /** + * Sorting enablement flag. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type boolean + */ + "bSort": null, + + /** + * Apply a class to the columns which are being sorted to provide a + * visual highlight or not. This can slow things down when enabled since + * there is a lot of DOM interaction. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type boolean + */ + "bSortClasses": null, + + /** + * State saving enablement flag. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type boolean + */ + "bStateSave": null + }, + + + /** + * Scrolling settings for a table. + * @namespace + */ + "oScroll": { + /** + * Indicate if DataTables should be allowed to set the padding / margin + * etc for the scrolling header elements or not. Typically you will want + * this. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type boolean + */ + "bAutoCss": null, + + /** + * When the table is shorter in height than sScrollY, collapse the + * table container down to the height of the table (when true). + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type boolean + */ + "bCollapse": null, + + /** + * Infinite scrolling enablement flag. Now deprecated in favour of + * using the Scroller plug-in. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type boolean + */ + "bInfinite": null, + + /** + * Width of the scrollbar for the web-browser's platform. Calculated + * during table initialisation. + * @type int + * @default 0 + */ + "iBarWidth": 0, + + /** + * Space (in pixels) between the bottom of the scrolling container and + * the bottom of the scrolling viewport before the next page is loaded + * when using infinite scrolling. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type int + */ + "iLoadGap": null, + + /** + * Viewport width for horizontal scrolling. Horizontal scrolling is + * disabled if an empty string. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type string + */ + "sX": null, + + /** + * Width to expand the table to when using x-scrolling. Typically you + * should not need to use this. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type string + * @deprecated + */ + "sXInner": null, + + /** + * Viewport height for vertical scrolling. Vertical scrolling is disabled + * if an empty string. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type string + */ + "sY": null + }, + + /** + * Language information for the table. + * @namespace + * @extends DataTable.defaults.oLanguage + */ + "oLanguage": { + /** + * Information callback function. See + * {@link DataTable.defaults.fnInfoCallback} + * @type function + * @default + */ + "fnInfoCallback": null + }, + + /** + * Array referencing the nodes which are used for the features. The + * parameters of this object match what is allowed by sDom - i.e. + *
      + *
    • 'l' - Length changing
    • + *
    • 'f' - Filtering input
    • + *
    • 't' - The table!
    • + *
    • 'i' - Information
    • + *
    • 'p' - Pagination
    • + *
    • 'r' - pRocessing
    • + *
    + * @type array + * @default [] + */ + "aanFeatures": [], + + /** + * Store data information - see {@link DataTable.models.oRow} for detailed + * information. + * @type array + * @default [] + */ + "aoData": [], + + /** + * Array of indexes which are in the current display (after filtering etc) + * @type array + * @default [] + */ + "aiDisplay": [], + + /** + * Array of indexes for display - no filtering + * @type array + * @default [] + */ + "aiDisplayMaster": [], + + /** + * Store information about each column that is in use + * @type array + * @default [] + */ + "aoColumns": [], + + /** + * Store information about the table's header + * @type array + * @default [] + */ + "aoHeader": [], + + /** + * Store information about the table's footer + * @type array + * @default [] + */ + "aoFooter": [], + + /** + * Search data array for regular expression searching + * @type array + * @default [] + */ + "asDataSearch": [], + + /** + * Store the applied global search information in case we want to force a + * research or compare the old search to a new one. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @namespace + * @extends DataTable.models.oSearch + */ + "oPreviousSearch": {}, + + /** + * Store the applied search for each column - see + * {@link DataTable.models.oSearch} for the format that is used for the + * filtering information for each column. + * @type array + * @default [] + */ + "aoPreSearchCols": [], + + /** + * Sorting that is applied to the table. Note that the inner arrays are + * used in the following manner: + *
      + *
    • Index 0 - column number
    • + *
    • Index 1 - current sorting direction
    • + *
    • Index 2 - index of asSorting for this column
    • + *
    + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type array + * @todo These inner arrays should really be objects + */ + "aaSorting": null, + + /** + * Sorting that is always applied to the table (i.e. prefixed in front of + * aaSorting). + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type array|null + * @default null + */ + "aaSortingFixed": null, + + /** + * Classes to use for the striping of a table. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type array + * @default [] + */ + "asStripeClasses": null, + + /** + * If restoring a table - we should restore its striping classes as well + * @type array + * @default [] + */ + "asDestroyStripes": [], + + /** + * If restoring a table - we should restore its width + * @type int + * @default 0 + */ + "sDestroyWidth": 0, + + /** + * Call this function every time a row is inserted (draw). + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type function + * @default null + * @todo Make into an array so plug-ins can hook in + */ + "fnRowCallback": null, + + /** + * Callback function for the header on each draw. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type function + * @default null + * @todo Make into an array so plug-ins can hook in + */ + "fnHeaderCallback": null, + + /** + * Callback function for the footer on each draw. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type function + * @default null + * @todo Make into an array so plug-ins can hook in + */ + "fnFooterCallback": null, + + /** + * Array of callback functions for draw callback functions + * @type array + * @default [] + */ + "aoDrawCallback": [], + + /** + * Callback function for just before the table is redrawn. A return of + * false will be used to cancel the draw. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type function + * @default null + * @todo Make into an array so plug-ins can hook in + */ + "fnPreDrawCallback": null, + + /** + * Callback function for when the table has been initialised. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type function + * @default null + * @todo Make into an array so plug-ins can hook in + */ + "fnInitComplete": null, + + /** + * Cache the table ID for quick access + * @type string + * @default Empty string + */ + "sTableId": "", + + /** + * The TABLE node for the main table + * @type node + * @default null + */ + "nTable": null, + + /** + * Permanent ref to the thead element + * @type node + * @default null + */ + "nTHead": null, + + /** + * Permanent ref to the tfoot element - if it exists + * @type node + * @default null + */ + "nTFoot": null, + + /** + * Permanent ref to the tbody element + * @type node + * @default null + */ + "nTBody": null, + + /** + * Cache the wrapper node (contains all DataTables controlled elements) + * @type node + * @default null + */ + "nTableWrapper": null, + + /** + * Indicate if when using server-side processing the loading of data + * should be deferred until the second draw. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type boolean + * @default false + */ + "bDeferLoading": false, + + /** + * Indicate if all required information has been read in + * @type boolean + * @default false + */ + "bInitialised": false, + + /** + * Information about open rows. Each object in the array has the parameters + * 'nTr' and 'nParent' + * @type array + * @default [] + */ + "aoOpenRows": [], + + /** + * Dictate the positioning of DataTables' control elements - see + * {@link DataTable.model.oInit.sDom}. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type string + * @default null + */ + "sDom": null, + + /** + * Which type of pagination should be used. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type string + * @default two_button + */ + "sPaginationType": "two_button", + + /** + * The cookie duration (for bStateSave) in seconds. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type int + * @default 0 + */ + "iCookieDuration": 0, + + /** + * The cookie name prefix. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type string + * @default Empty string + */ + "sCookiePrefix": "", + + /** + * Callback function for cookie creation. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type function + * @default null + */ + "fnCookieCallback": null, + + /** + * Array of callback functions for state saving. Each array element is an + * object with the following parameters: + *
      + *
    • function:fn - function to call. Takes two parameters, oSettings + * and the JSON string to save that has been thus far created. Returns + * a JSON string to be inserted into a json object + * (i.e. '"param": [ 0, 1, 2]')
    • + *
    • string:sName - name of callback
    • + *
    + * @type array + * @default [] + */ + "aoStateSave": [], + + /** + * Array of callback functions for state loading. Each array element is an + * object with the following parameters: + *
      + *
    • function:fn - function to call. Takes two parameters, oSettings + * and the object stored. May return false to cancel state loading
    • + *
    • string:sName - name of callback
    • + *
    + * @type array + * @default [] + */ + "aoStateLoad": [], + + /** + * State that was loaded from the cookie. Useful for back reference + * @type object + * @default null + */ + "oLoadedState": null, + + /** + * Source url for AJAX data for the table. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type string + * @default null + */ + "sAjaxSource": null, + + /** + * Property from a given object from which to read the table data from. This + * can be an empty string (when not server-side processing), in which case + * it is assumed an an array is given directly. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type string + */ + "sAjaxDataProp": null, + + /** + * Note if draw should be blocked while getting data + * @type boolean + * @default true + */ + "bAjaxDataGet": true, + + /** + * The last jQuery XHR object that was used for server-side data gathering. + * This can be used for working with the XHR information in one of the + * callbacks + * @type object + * @default null + */ + "jqXHR": null, + + /** + * Function to get the server-side data. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type function + */ + "fnServerData": null, + + /** + * Functions which are called prior to sending an Ajax request so extra + * parameters can easily be sent to the server + * @type array + * @default [] + */ + "aoServerParams": [], + + /** + * Send the XHR HTTP method - GET or POST (could be PUT or DELETE if + * required). + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type string + */ + "sServerMethod": null, + + /** + * Format numbers for display. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type function + */ + "fnFormatNumber": null, + + /** + * List of options that can be used for the user selectable length menu. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type array + * @default [] + */ + "aLengthMenu": null, + + /** + * Counter for the draws that the table does. Also used as a tracker for + * server-side processing + * @type int + * @default 0 + */ + "iDraw": 0, + + /** + * Indicate if a redraw is being done - useful for Ajax + * @type boolean + * @default false + */ + "bDrawing": false, + + /** + * Draw index (iDraw) of the last error when parsing the returned data + * @type int + * @default -1 + */ + "iDrawError": -1, + + /** + * Paging display length + * @type int + * @default 10 + */ + "_iDisplayLength": 10, + + /** + * Paging start point - aiDisplay index + * @type int + * @default 0 + */ + "_iDisplayStart": 0, + + /** + * Paging end point - aiDisplay index. Use fnDisplayEnd rather than + * this property to get the end point + * @type int + * @default 10 + * @private + */ + "_iDisplayEnd": 10, + + /** + * Server-side processing - number of records in the result set + * (i.e. before filtering), Use fnRecordsTotal rather than + * this property to get the value of the number of records, regardless of + * the server-side processing setting. + * @type int + * @default 0 + * @private + */ + "_iRecordsTotal": 0, + + /** + * Server-side processing - number of records in the current display set + * (i.e. after filtering). Use fnRecordsDisplay rather than + * this property to get the value of the number of records, regardless of + * the server-side processing setting. + * @type boolean + * @default 0 + * @private + */ + "_iRecordsDisplay": 0, + + /** + * Flag to indicate if jQuery UI marking and classes should be used. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type boolean + */ + "bJUI": null, + + /** + * The classes to use for the table + * @type object + * @default {} + */ + "oClasses": {}, + + /** + * Flag attached to the settings object so you can check in the draw + * callback if filtering has been done in the draw. Deprecated in favour of + * events. + * @type boolean + * @default false + * @deprecated + */ + "bFiltered": false, + + /** + * Flag attached to the settings object so you can check in the draw + * callback if sorting has been done in the draw. Deprecated in favour of + * events. + * @type boolean + * @default false + * @deprecated + */ + "bSorted": false, + + /** + * Indicate that if multiple rows are in the header and there is more than + * one unique cell per column, if the top one (true) or bottom one (false) + * should be used for sorting / title by DataTables. + * Note that this parameter will be set by the initialisation routine. To + * set a default use {@link DataTable.defaults}. + * @type boolean + */ + "bSortCellsTop": null, + + /** + * Initialisation object that is used for the table + * @type object + * @default null + */ + "oInit": null, + + /** + * Destroy callback functions - for plug-ins to attach themselves to the + * destroy so they can clean up markup and events. + * @type array + * @default [] + */ + "aoDestroyCallback": [], + + + /** + * Get the number of records in the current record set, before filtering + * @type function + */ + "fnRecordsTotal": function () + { + if ( this.oFeatures.bServerSide ) { + return parseInt(this._iRecordsTotal, 10); + } else { + return this.aiDisplayMaster.length; + } + }, + + /** + * Get the number of records in the current record set, after filtering + * @type function + */ + "fnRecordsDisplay": function () + { + if ( this.oFeatures.bServerSide ) { + return parseInt(this._iRecordsDisplay, 10); + } else { + return this.aiDisplay.length; + } + }, + + /** + * Set the display end point - aiDisplay index + * @type function + * @todo Should do away with _iDisplayEnd and calculate it on-the-fly here + */ + "fnDisplayEnd": function () + { + if ( this.oFeatures.bServerSide ) { + if ( this.oFeatures.bPaginate === false || this._iDisplayLength == -1 ) { + return this._iDisplayStart+this.aiDisplay.length; + } else { + return Math.min( this._iDisplayStart+this._iDisplayLength, + this._iRecordsDisplay ); + } + } else { + return this._iDisplayEnd; + } + }, + + /** + * The DataTables object for this table + * @type object + * @default null + */ + "oInstance": null, + + /** + * Unique identifier for each instance of the DataTables object. If there + * is an ID on the table node, then it takes that value, otherwise an + * incrementing internal counter is used. + * @type string + * @default null + */ + "sInstance": null, + + /** + * tabindex attribute value that is added to DataTables control elements, allowing + * keyboard navigation of the table and its controls. + */ + "iTabIndex": 0 +}; diff --git a/media/unit_testing/performance/large.php b/media/unit_testing/performance/large.php index 6dbb7244..23d84c14 100644 --- a/media/unit_testing/performance/large.php +++ b/media/unit_testing/performance/large.php @@ -37,6 +37,7 @@ // console.profileEnd(); //} + oTable.fnSort( [[ 1, 'asc' ]] ); oTable.fnSort( [[ 1, 'asc' ]] ); oTable.fnSort( [[ 2, 'asc' ]] ); oTable.fnSort( [[ 1, 'asc' ]] ); diff --git a/media/unit_testing/tests_onhold/1_dom/2608.js b/media/unit_testing/tests_onhold/1_dom/2608.js old mode 100755 new mode 100644 diff --git a/media/unit_testing/tests_onhold/1_dom/asStripClasses.js b/media/unit_testing/tests_onhold/1_dom/asStripClasses.js index 89b5ad49..906fc788 100755 --- a/media/unit_testing/tests_onhold/1_dom/asStripClasses.js +++ b/media/unit_testing/tests_onhold/1_dom/asStripClasses.js @@ -1,5 +1,5 @@ // DATA_TEMPLATE: dom_data -oTest.fnStart( "asStripClasses" ); +oTest.fnStart( "asStripeClasses" ); $(document).ready( function () { /* Check the default */ @@ -44,7 +44,7 @@ $(document).ready( function () { function () { oSession.fnRestore(); $('#example').dataTable( { - "asStripClasses": [] + "asStripeClasses": [] } ); }, function () { @@ -61,7 +61,7 @@ $(document).ready( function () { function () { oSession.fnRestore(); $('#example').dataTable( { - "asStripClasses": [ 'test1', 'test2' ] + "asStripeClasses": [ 'test1', 'test2' ] } ); }, function () { @@ -79,7 +79,7 @@ $(document).ready( function () { function () { oSession.fnRestore(); $('#example').dataTable( { - "asStripClasses": [ 'test1', 'test2', 'test3', 'test4' ] + "asStripeClasses": [ 'test1', 'test2', 'test3', 'test4' ] } ); }, function () { diff --git a/media/unit_testing/tests_onhold/1_dom/fnFilter.js b/media/unit_testing/tests_onhold/1_dom/fnFilter.js new file mode 100755 index 00000000..1e18b22d --- /dev/null +++ b/media/unit_testing/tests_onhold/1_dom/fnFilter.js @@ -0,0 +1,16 @@ +// DATA_TEMPLATE: dom_data +oTest.fnStart( "fnFilter" ); + +$(document).ready( function () { + /* Check the default */ + var oTable = $('#example').dataTable(); + oTable.fnFilter(1); + + oTest.fnTest( + "Filtering with a non-string input is valid", + null, + function () { return $('#example_info').html() == "Showing 1 to 10 of 32 entries (filtered from 57 total entries)"; } + ); + + oTest.fnComplete(); +} ); \ No newline at end of file diff --git a/media/unit_testing/tests_onhold/1_dom/fnInitComplete.js b/media/unit_testing/tests_onhold/1_dom/fnInitComplete.js index 14a9197c..1659d124 100755 --- a/media/unit_testing/tests_onhold/1_dom/fnInitComplete.js +++ b/media/unit_testing/tests_onhold/1_dom/fnInitComplete.js @@ -17,18 +17,18 @@ $(document).ready( function () { oTest.fnTest( - "One argument passed (for DOM!)", + "Two arguments passed", function () { oSession.fnRestore(); mPass = -1; $('#example').dataTable( { "fnInitComplete": function ( ) { - mPass = arguments.length; + mPass = arguments.length===2 && arguments[1]===undefined; } } ); }, - function () { return mPass == 1; } + function () { return mPass; } ); diff --git a/media/unit_testing/tests_onhold/1_dom/sPaginationType.js b/media/unit_testing/tests_onhold/1_dom/sPaginationType.js index 269be7ea..8d975f55 100755 --- a/media/unit_testing/tests_onhold/1_dom/sPaginationType.js +++ b/media/unit_testing/tests_onhold/1_dom/sPaginationType.js @@ -19,9 +19,9 @@ $(document).ready( function () { ); oTest.fnTest( - "Two div elements are in the wrapper", + "Two A elements are in the wrapper", null, - function () { return $('#example_paginate div').length == 2; } + function () { return $('#example_paginate a').length == 2; } ); oTest.fnTest( @@ -75,10 +75,10 @@ $(document).ready( function () { oTest.fnTest( "Jump to last page", function () { - nFirst = $('div.dataTables_paginate span.first'); - nPrevious = $('div.dataTables_paginate span.previous'); - nNext = $('div.dataTables_paginate span.next'); - nLast = $('div.dataTables_paginate span.last'); + nFirst = $('div.dataTables_paginate a.first'); + nPrevious = $('div.dataTables_paginate a.previous'); + nNext = $('div.dataTables_paginate a.next'); + nLast = $('div.dataTables_paginate a.last'); nLast.click(); }, function () { diff --git a/media/unit_testing/tests_onhold/2_js/asStripClasses.js b/media/unit_testing/tests_onhold/2_js/asStripClasses.js index 202ba776..fa3af827 100644 --- a/media/unit_testing/tests_onhold/2_js/asStripClasses.js +++ b/media/unit_testing/tests_onhold/2_js/asStripClasses.js @@ -1,5 +1,5 @@ // DATA_TEMPLATE: js_data -oTest.fnStart( "asStripClasses" ); +oTest.fnStart( "asStripeClasses" ); $(document).ready( function () { /* Check the default */ @@ -36,7 +36,7 @@ $(document).ready( function () { oSession.fnRestore(); $('#example').dataTable( { "aaData": gaaData, - "asStripClasses": [] + "asStripeClasses": [] } ); }, function () { @@ -54,7 +54,7 @@ $(document).ready( function () { oSession.fnRestore(); $('#example').dataTable( { "aaData": gaaData, - "asStripClasses": [ 'test1', 'test2' ] + "asStripeClasses": [ 'test1', 'test2' ] } ); }, function () { @@ -73,7 +73,7 @@ $(document).ready( function () { oSession.fnRestore(); $('#example').dataTable( { "aaData": gaaData, - "asStripClasses": [ 'test1', 'test2', 'test3', 'test4' ] + "asStripeClasses": [ 'test1', 'test2', 'test3', 'test4' ] } ); }, function () { diff --git a/media/unit_testing/tests_onhold/2_js/fnInitComplete.js b/media/unit_testing/tests_onhold/2_js/fnInitComplete.js index 57547913..08580e5b 100644 --- a/media/unit_testing/tests_onhold/2_js/fnInitComplete.js +++ b/media/unit_testing/tests_onhold/2_js/fnInitComplete.js @@ -19,7 +19,7 @@ $(document).ready( function () { oTest.fnTest( - "One argument passed (for DOM!)", + "Two arguments passed", function () { oSession.fnRestore(); @@ -27,11 +27,11 @@ $(document).ready( function () { $('#example').dataTable( { "aaData": gaaData, "fnInitComplete": function ( ) { - mPass = arguments.length; + mPass = arguments.length===2 && arguments[1]===undefined; } } ); }, - function () { return mPass == 1; } + function () { return mPass; } ); diff --git a/media/unit_testing/tests_onhold/2_js/sPaginationType.js b/media/unit_testing/tests_onhold/2_js/sPaginationType.js index bf5fda21..7fa7407f 100644 --- a/media/unit_testing/tests_onhold/2_js/sPaginationType.js +++ b/media/unit_testing/tests_onhold/2_js/sPaginationType.js @@ -21,9 +21,9 @@ $(document).ready( function () { ); oTest.fnTest( - "Two div elements are in the wrapper", + "Two A elements are in the wrapper", null, - function () { return $('#example_paginate div').length == 2; } + function () { return $('#example_paginate a').length == 2; } ); oTest.fnTest( @@ -78,10 +78,10 @@ $(document).ready( function () { oTest.fnTest( "Jump to last page", function () { - nFirst = $('div.dataTables_paginate span.first'); - nPrevious = $('div.dataTables_paginate span.previous'); - nNext = $('div.dataTables_paginate span.next'); - nLast = $('div.dataTables_paginate span.last'); + nFirst = $('div.dataTables_paginate a.first'); + nPrevious = $('div.dataTables_paginate a.previous'); + nNext = $('div.dataTables_paginate a.next'); + nLast = $('div.dataTables_paginate a.last'); nLast.click(); }, function () { diff --git a/media/unit_testing/tests_onhold/3_ajax/asStripClasses.js b/media/unit_testing/tests_onhold/3_ajax/asStripClasses.js index 55a62898..b195c405 100644 --- a/media/unit_testing/tests_onhold/3_ajax/asStripClasses.js +++ b/media/unit_testing/tests_onhold/3_ajax/asStripClasses.js @@ -1,5 +1,5 @@ // DATA_TEMPLATE: empty_table -oTest.fnStart( "asStripClasses" ); +oTest.fnStart( "asStripeClasses" ); $(document).ready( function () { /* Check the default */ @@ -36,7 +36,7 @@ $(document).ready( function () { oSession.fnRestore(); $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", - "asStripClasses": [] + "asStripeClasses": [] } ); }, function () { @@ -59,7 +59,7 @@ $(document).ready( function () { oSession.fnRestore(); $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", - "asStripClasses": [ 'test1', 'test2' ] + "asStripeClasses": [ 'test1', 'test2' ] } ); }, function () { @@ -78,7 +78,7 @@ $(document).ready( function () { oSession.fnRestore(); $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", - "asStripClasses": [ 'test1', 'test2', 'test3', 'test4' ] + "asStripeClasses": [ 'test1', 'test2', 'test3', 'test4' ] } ); }, function () { diff --git a/media/unit_testing/tests_onhold/3_ajax/sPaginationType.js b/media/unit_testing/tests_onhold/3_ajax/sPaginationType.js index bd79cca2..71606c41 100644 --- a/media/unit_testing/tests_onhold/3_ajax/sPaginationType.js +++ b/media/unit_testing/tests_onhold/3_ajax/sPaginationType.js @@ -21,9 +21,9 @@ $(document).ready( function () { ); oTest.fnWaitTest( - "Two div elements are in the wrapper", + "Two A elements are in the wrapper", null, - function () { return $('#example_paginate div').length == 2; } + function () { return $('#example_paginate a').length == 2; } ); oTest.fnWaitTest( @@ -87,10 +87,10 @@ $(document).ready( function () { oTest.fnWaitTest( "Jump to last page", function () { - nFirst = $('div.dataTables_paginate span.first'); - nPrevious = $('div.dataTables_paginate span.previous'); - nNext = $('div.dataTables_paginate span.next'); - nLast = $('div.dataTables_paginate span.last'); + nFirst = $('div.dataTables_paginate a.first'); + nPrevious = $('div.dataTables_paginate a.previous'); + nNext = $('div.dataTables_paginate a.next'); + nLast = $('div.dataTables_paginate a.last'); nLast.click(); }, function () { diff --git a/media/unit_testing/tests_onhold/4_server-side/asStripClasses.js b/media/unit_testing/tests_onhold/4_server-side/asStripClasses.js index 50dbeec4..760ba4e3 100644 --- a/media/unit_testing/tests_onhold/4_server-side/asStripClasses.js +++ b/media/unit_testing/tests_onhold/4_server-side/asStripClasses.js @@ -1,5 +1,5 @@ // DATA_TEMPLATE: empty_table -oTest.fnStart( "asStripClasses" ); +oTest.fnStart( "asStripeClasses" ); $(document).ready( function () { /* Check the default */ @@ -38,7 +38,7 @@ $(document).ready( function () { $('#example').dataTable( { "bServerSide": true, "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php", - "asStripClasses": [] + "asStripeClasses": [] } ); }, function () { @@ -62,7 +62,7 @@ $(document).ready( function () { $('#example').dataTable( { "bServerSide": true, "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php", - "asStripClasses": [ 'test1', 'test2' ] + "asStripeClasses": [ 'test1', 'test2' ] } ); }, function () { @@ -82,7 +82,7 @@ $(document).ready( function () { $('#example').dataTable( { "bServerSide": true, "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php", - "asStripClasses": [ 'test1', 'test2', 'test3', 'test4' ] + "asStripeClasses": [ 'test1', 'test2', 'test3', 'test4' ] } ); }, function () { diff --git a/media/unit_testing/tests_onhold/4_server-side/fnInitComplete.js b/media/unit_testing/tests_onhold/4_server-side/fnInitComplete.js index 800743c4..8da655f3 100644 --- a/media/unit_testing/tests_onhold/4_server-side/fnInitComplete.js +++ b/media/unit_testing/tests_onhold/4_server-side/fnInitComplete.js @@ -20,7 +20,7 @@ $(document).ready( function () { oTest.fnWaitTest( - "One argument passed", + "Two arguments passed", function () { oSession.fnRestore(); @@ -29,11 +29,11 @@ $(document).ready( function () { "bServerSide": true, "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php", "fnInitComplete": function ( ) { - mPass = arguments.length; + mPass = arguments.length===2 && arguments[1]===undefined; } } ); }, - function () { return mPass == 1; } + function () { return mPass; } ); diff --git a/media/unit_testing/tests_onhold/4_server-side/sPaginationType.js b/media/unit_testing/tests_onhold/4_server-side/sPaginationType.js index 37a5a524..5895f7e3 100644 --- a/media/unit_testing/tests_onhold/4_server-side/sPaginationType.js +++ b/media/unit_testing/tests_onhold/4_server-side/sPaginationType.js @@ -22,9 +22,9 @@ $(document).ready( function () { ); oTest.fnWaitTest( - "Two div elements are in the wrapper", + "Two A elements are in the wrapper", null, - function () { return $('#example_paginate div').length == 2; } + function () { return $('#example_paginate a').length == 2; } ); oTest.fnWaitTest( @@ -91,10 +91,10 @@ $(document).ready( function () { oTest.fnWaitTest( "Jump to last page", function () { - nFirst = $('div.dataTables_paginate span.first'); - nPrevious = $('div.dataTables_paginate span.previous'); - nNext = $('div.dataTables_paginate span.next'); - nLast = $('div.dataTables_paginate span.last'); + nFirst = $('div.dataTables_paginate a.first'); + nPrevious = $('div.dataTables_paginate a.previous'); + nNext = $('div.dataTables_paginate a.next'); + nLast = $('div.dataTables_paginate a.last'); nLast.click(); }, function () { diff --git a/media/unit_testing/tests_onhold/5_ajax_objects/_zero_config.js b/media/unit_testing/tests_onhold/5_ajax_objects/_zero_config.js new file mode 100644 index 00000000..af7fcae8 --- /dev/null +++ b/media/unit_testing/tests_onhold/5_ajax_objects/_zero_config.js @@ -0,0 +1,847 @@ +// DATA_TEMPLATE: empty_table +oTest.fnStart( "Sanity checks for DataTables with data from JS - Object data source" ); + +oTest.fnTest( + "jQuery.dataTable function", + null, + function () { return typeof jQuery().dataTable == "function"; } +); + +oTest.fnTest( + "jQuery.dataTableSettings storage array", + null, + function () { return typeof jQuery().dataTableSettings == "object"; } +); + +oTest.fnTest( + "jQuery.dataTableExt plugin object", + null, + function () { return typeof jQuery().dataTableExt == "object"; } +); + +$(document).ready( function () { + var oInit = { + "aoColumns": [ + { "mDataProp": "engine" }, + { "mDataProp": "browser" }, + { "mDataProp": "platform" }, + { "mDataProp": "version" }, + { "mDataProp": "grade" } + ], + "aaData": [ + { + "engine": "Trident", + "browser": "Internet Explorer 4.0", + "platform": "Win 95+", + "version": "4", + "grade": "X" + }, + { + "engine": "Trident", + "browser": "Internet Explorer 5.0", + "platform": "Win 95+", + "version": "5", + "grade": "C" + }, + { + "engine": "Trident", + "browser": "Internet Explorer 5.5", + "platform": "Win 95+", + "version": "5.5", + "grade": "A" + }, + { + "engine": "Trident", + "browser": "Internet Explorer 6", + "platform": "Win 98+", + "version": "6", + "grade": "A" + }, + { + "engine": "Trident", + "browser": "Internet Explorer 7", + "platform": "Win XP SP2+", + "version": "7", + "grade": "A" + }, + { + "engine": "Trident", + "browser": "AOL browser (AOL desktop)", + "platform": "Win XP", + "version": "6", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Firefox 1.0", + "platform": "Win 98+ / OSX.2+", + "version": "1.7", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Firefox 1.5", + "platform": "Win 98+ / OSX.2+", + "version": "1.8", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Firefox 2.0", + "platform": "Win 98+ / OSX.2+", + "version": "1.8", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Firefox 3.0", + "platform": "Win 2k+ / OSX.3+", + "version": "1.9", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Camino 1.0", + "platform": "OSX.2+", + "version": "1.8", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Camino 1.5", + "platform": "OSX.3+", + "version": "1.8", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Netscape 7.2", + "platform": "Win 95+ / Mac OS 8.6-9.2", + "version": "1.7", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Netscape Browser 8", + "platform": "Win 98SE+", + "version": "1.7", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Netscape Navigator 9", + "platform": "Win 98+ / OSX.2+", + "version": "1.8", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Mozilla 1.0", + "platform": "Win 95+ / OSX.1+", + "version": "1", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Mozilla 1.1", + "platform": "Win 95+ / OSX.1+", + "version": "1.1", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Mozilla 1.2", + "platform": "Win 95+ / OSX.1+", + "version": "1.2", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Mozilla 1.3", + "platform": "Win 95+ / OSX.1+", + "version": "1.3", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Mozilla 1.4", + "platform": "Win 95+ / OSX.1+", + "version": "1.4", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Mozilla 1.5", + "platform": "Win 95+ / OSX.1+", + "version": "1.5", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Mozilla 1.6", + "platform": "Win 95+ / OSX.1+", + "version": "1.6", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Mozilla 1.7", + "platform": "Win 98+ / OSX.1+", + "version": "1.7", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Mozilla 1.8", + "platform": "Win 98+ / OSX.1+", + "version": "1.8", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Seamonkey 1.1", + "platform": "Win 98+ / OSX.2+", + "version": "1.8", + "grade": "A" + }, + { + "engine": "Gecko", + "browser": "Epiphany 2.20", + "platform": "Gnome", + "version": "1.8", + "grade": "A" + }, + { + "engine": "Webkit", + "browser": "Safari 1.2", + "platform": "OSX.3", + "version": "125.5", + "grade": "A" + }, + { + "engine": "Webkit", + "browser": "Safari 1.3", + "platform": "OSX.3", + "version": "312.8", + "grade": "A" + }, + { + "engine": "Webkit", + "browser": "Safari 2.0", + "platform": "OSX.4+", + "version": "419.3", + "grade": "A" + }, + { + "engine": "Webkit", + "browser": "Safari 3.0", + "platform": "OSX.4+", + "version": "522.1", + "grade": "A" + }, + { + "engine": "Webkit", + "browser": "OmniWeb 5.5", + "platform": "OSX.4+", + "version": "420", + "grade": "A" + }, + { + "engine": "Webkit", + "browser": "iPod Touch / iPhone", + "platform": "iPod", + "version": "420.1", + "grade": "A" + }, + { + "engine": "Webkit", + "browser": "S60", + "platform": "S60", + "version": "413", + "grade": "A" + }, + { + "engine": "Presto", + "browser": "Opera 7.0", + "platform": "Win 95+ / OSX.1+", + "version": "-", + "grade": "A" + }, + { + "engine": "Presto", + "browser": "Opera 7.5", + "platform": "Win 95+ / OSX.2+", + "version": "-", + "grade": "A" + }, + { + "engine": "Presto", + "browser": "Opera 8.0", + "platform": "Win 95+ / OSX.2+", + "version": "-", + "grade": "A" + }, + { + "engine": "Presto", + "browser": "Opera 8.5", + "platform": "Win 95+ / OSX.2+", + "version": "-", + "grade": "A" + }, + { + "engine": "Presto", + "browser": "Opera 9.0", + "platform": "Win 95+ / OSX.3+", + "version": "-", + "grade": "A" + }, + { + "engine": "Presto", + "browser": "Opera 9.2", + "platform": "Win 88+ / OSX.3+", + "version": "-", + "grade": "A" + }, + { + "engine": "Presto", + "browser": "Opera 9.5", + "platform": "Win 88+ / OSX.3+", + "version": "-", + "grade": "A" + }, + { + "engine": "Presto", + "browser": "Opera for Wii", + "platform": "Wii", + "version": "-", + "grade": "A" + }, + { + "engine": "Presto", + "browser": "Nokia N800", + "platform": "N800", + "version": "-", + "grade": "A" + }, + { + "engine": "Presto", + "browser": "Nintendo DS browser", + "platform": "Nintendo DS", + "version": "8.5", + "grade": "C/A1" + }, + { + "engine": "KHTML", + "browser": "Konqureror 3.1", + "platform": "KDE 3.1", + "version": "3.1", + "grade": "C" + }, + { + "engine": "KHTML", + "browser": "Konqureror 3.3", + "platform": "KDE 3.3", + "version": "3.3", + "grade": "A" + }, + { + "engine": "KHTML", + "browser": "Konqureror 3.5", + "platform": "KDE 3.5", + "version": "3.5", + "grade": "A" + }, + { + "engine": "Tasman", + "browser": "Internet Explorer 4.5", + "platform": "Mac OS 8-9", + "version": "-", + "grade": "X" + }, + { + "engine": "Tasman", + "browser": "Internet Explorer 5.1", + "platform": "Mac OS 7.6-9", + "version": "1", + "grade": "C" + }, + { + "engine": "Tasman", + "browser": "Internet Explorer 5.2", + "platform": "Mac OS 8-X", + "version": "1", + "grade": "C" + }, + { + "engine": "Misc", + "browser": "NetFront 3.1", + "platform": "Embedded devices", + "version": "-", + "grade": "C" + }, + { + "engine": "Misc", + "browser": "NetFront 3.4", + "platform": "Embedded devices", + "version": "-", + "grade": "A" + }, + { + "engine": "Misc", + "browser": "Dillo 0.8", + "platform": "Embedded devices", + "version": "-", + "grade": "X" + }, + { + "engine": "Misc", + "browser": "Links", + "platform": "Text only", + "version": "-", + "grade": "X" + }, + { + "engine": "Misc", + "browser": "Lynx", + "platform": "Text only", + "version": "-", + "grade": "X" + }, + { + "engine": "Misc", + "browser": "IE Mobile", + "platform": "Windows Mobile 6", + "version": "-", + "grade": "C" + }, + { + "engine": "Misc", + "browser": "PSP browser", + "platform": "PSP", + "version": "-", + "grade": "C" + }, + { + "engine": "Other browsers", + "browser": "All others", + "platform": "-", + "version": "-", + "grade": "U" + } +] + }; + $('#example').dataTable( oInit ); + + /* Basic checks */ + oTest.fnWaitTest( + "Length changing div exists", + null, + function () { return document.getElementById('example_length') != null; } + ); + + oTest.fnTest( + "Filtering div exists", + null, + function () { return document.getElementById('example_filter') != null; } + ); + + oTest.fnTest( + "Information div exists", + null, + function () { return document.getElementById('example_info') != null; } + ); + + oTest.fnTest( + "Pagination div exists", + null, + function () { return document.getElementById('example_paginate') != null; } + ); + + oTest.fnTest( + "Processing div is off by default", + null, + function () { return document.getElementById('example_processing') == null; } + ); + + oTest.fnWaitTest( + "10 rows shown on the first page", + null, + function () { return $('#example tbody tr').length == 10; } + ); + + oTest.fnTest( + "Initial sort occured", + null, + function () { return $('#example tbody td:eq(0)').html() == "Gecko"; } + ); + + /* Need to use the WaitTest for sorting due to the setTimeout datatables uses */ + oTest.fnTest( + "Sorting (first click) on second column", + function () { $('#example thead th:eq(1)').click(); }, + function () { return $('#example tbody td:eq(1)').html() == "All others"; } + ); + + oTest.fnTest( + "Sorting (second click) on second column", + function () { $('#example thead th:eq(1)').click(); }, + function () { return $('#example tbody td:eq(1)').html() == "Seamonkey 1.1"; } + ); + + oTest.fnTest( + "Sorting (third click) on second column", + function () { $('#example thead th:eq(1)').click(); }, + function () { return $('#example tbody td:eq(1)').html() == "All others"; } + ); + + oTest.fnTest( + "Sorting (first click) on numeric column", + function () { $('#example thead th:eq(3)').click(); }, + function () { return $('#example tbody td:eq(3)').html() == "-"; } + ); + + oTest.fnTest( + "Sorting (second click) on numeric column", + function () { $('#example thead th:eq(3)').click(); }, + function () { return $('#example tbody td:eq(3)').html() == "522.1"; } + ); + + oTest.fnTest( + "Sorting multi-column (first click)", + function () { + $('#example thead th:eq(0)').click(); + oDispacher.click( $('#example thead th:eq(1)')[0], { 'shift': true } ); }, + function () { var b = + $('#example tbody td:eq(0)').html() == "Gecko" && + $('#example tbody td:eq(1)').html() == "Camino 1.0"; return b; } + ); + + oTest.fnTest( + "Sorting multi-column - sorting second column only", + function () { + $('#example thead th:eq(1)').click(); }, + function () { return $('#example tbody td:eq(1)').html() == "All others"; } + ); + + /* Basic paging */ + oTest.fnTest( + "Paging to second page", + function () { $('#example_next').click(); }, + function () { return $('#example tbody td:eq(1)').html() == "IE Mobile"; } + ); + + oTest.fnTest( + "Paging to first page", + function () { $('#example_previous').click(); }, + function () { return $('#example tbody td:eq(1)').html() == "All others"; } + ); + + oTest.fnTest( + "Attempting to page back beyond the first page", + function () { $('#example_previous').click(); }, + function () { return $('#example tbody td:eq(1)').html() == "All others"; } + ); + + /* Changing length */ + oTest.fnTest( + "Changing table length to 25 records", + function () { $("select[name=example_length]").val('25').change(); }, + function () { return $('#example tbody tr').length == 25; } + ); + + oTest.fnTest( + "Changing table length to 50 records", + function () { $("select[name=example_length]").val('50').change(); }, + function () { return $('#example tbody tr').length == 50; } + ); + + oTest.fnTest( + "Changing table length to 100 records", + function () { $("select[name=example_length]").val('100').change(); }, + function () { return $('#example tbody tr').length == 57; } + ); + + oTest.fnTest( + "Changing table length to 10 records", + function () { $("select[name=example_length]").val('10').change(); }, + function () { return $('#example tbody tr').length == 10; } + ); + + /* + * Information element + */ + oTest.fnTest( + "Information on zero config", + null, + function () { return document.getElementById('example_info').innerHTML == "Showing 1 to 10 of 57 entries"; } + ); + + oTest.fnTest( + "Information on second page", + function () { $('#example_next').click(); }, + function () { return document.getElementById('example_info').innerHTML == "Showing 11 to 20 of 57 entries"; } + ); + + oTest.fnTest( + "Information on third page", + function () { $('#example_next').click(); }, + function () { return document.getElementById('example_info').innerHTML == "Showing 21 to 30 of 57 entries"; } + ); + + oTest.fnTest( + "Information on last page", + function () { + $('#example_next').click(); + $('#example_next').click(); + $('#example_next').click(); + }, + function () { return document.getElementById('example_info').innerHTML == "Showing 51 to 57 of 57 entries"; } + ); + + oTest.fnTest( + "Information back on first page", + function () { + $('#example_previous').click(); + $('#example_previous').click(); + $('#example_previous').click(); + $('#example_previous').click(); + $('#example_previous').click(); + }, + function () { return document.getElementById('example_info').innerHTML == "Showing 1 to 10 of 57 entries"; } + ); + + oTest.fnTest( + "Information with 25 records", + function () { $("select[name=example_length]").val('25').change(); }, + function () { return document.getElementById('example_info').innerHTML == "Showing 1 to 25 of 57 entries"; } + ); + + oTest.fnTest( + "Information with 25 records - second page", + function () { $('#example_next').click(); }, + function () { return document.getElementById('example_info').innerHTML == "Showing 26 to 50 of 57 entries"; } + ); + + oTest.fnTest( + "Information with 100 records - first page", + function () { + $('#example_previous').click(); + $("select[name=example_length]").val('100').change(); + }, + function () { return document.getElementById('example_info').innerHTML == "Showing 1 to 57 of 57 entries"; } + ); + + oTest.fnTest( + "Information back to 10 records", + function () { + $('#example_previous').click(); + $("select[name=example_length]").val('10').change(); + }, + function () { return document.getElementById('example_info').innerHTML == "Showing 1 to 10 of 57 entries"; } + ); + + oTest.fnTest( + "Information with filter 'Win'", + function () { $('#example_filter input').val("Win").keyup(); }, + function () { return document.getElementById('example_info').innerHTML == + "Showing 1 to 10 of 31 entries (filtered from 57 total entries)"; } + ); + + oTest.fnTest( + "Information with filter 'Win' second page", + function () { $('#example_next').click(); }, + function () { return document.getElementById('example_info').innerHTML == + "Showing 11 to 20 of 31 entries (filtered from 57 total entries)"; } + ); + + oTest.fnTest( + "Information with filter 'Win' last page", + function () { + $('#example_next').click(); + $('#example_next').click(); + }, + function () { return document.getElementById('example_info').innerHTML == + "Showing 31 to 31 of 31 entries (filtered from 57 total entries)"; } + ); + + oTest.fnTest( + "Information with filter 'Win' back to first page", + function () { + $('#example_previous').click(); + $('#example_previous').click(); + $('#example_previous').click(); + }, + function () { return document.getElementById('example_info').innerHTML == + "Showing 1 to 10 of 31 entries (filtered from 57 total entries)"; } + ); + + oTest.fnTest( + "Information with filter 'Win' second page - second time", + function () { + $('#example_next').click(); + }, + function () { return document.getElementById('example_info').innerHTML == + "Showing 11 to 20 of 31 entries (filtered from 57 total entries)"; } + ); + + oTest.fnTest( + "Information with filter increased to 'Win 98'", + function () { $('#example_filter input').val("Win 98").keyup(); }, + function () { return document.getElementById('example_info').innerHTML == + "Showing 1 to 9 of 9 entries (filtered from 57 total entries)"; } + ); + + oTest.fnTest( + "Information with filter decreased to 'Win'", + function () { $('#example_filter input').val("Win").keyup(); }, + function () { return document.getElementById('example_info').innerHTML == + "Showing 1 to 10 of 31 entries (filtered from 57 total entries)"; } + ); + + oTest.fnTest( + "Information with filter 'Win' second page - third time", + function () { + $('#example_next').click(); + }, + function () { return document.getElementById('example_info').innerHTML == + "Showing 11 to 20 of 31 entries (filtered from 57 total entries)"; } + ); + + oTest.fnTest( + "Information with filter removed", + function () { $('#example_filter input').val("").keyup(); }, + function () { return document.getElementById('example_info').innerHTML == + "Showing 1 to 10 of 57 entries"; } + ); + + + /* + * Filtering + */ + oTest.fnWaitTest( + "Filter 'W' - rows", + function () { + /* Reset the table such that the old sorting doesn't mess things up */ + oSession.fnRestore(); + $('#example').dataTable( oInit ); + $('#example_filter input').val("W").keyup(); }, + function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "Gecko"; } + ); + + oTest.fnTest( + "Filter 'W' - info", + null, + function () { return document.getElementById('example_info').innerHTML == + "Showing 1 to 10 of 42 entries (filtered from 57 total entries)"; } + ); + + oTest.fnTest( + "Filter 'Wi'", + function () { $('#example_filter input').val("Wi").keyup(); }, + function () { return document.getElementById('example_info').innerHTML == + "Showing 1 to 10 of 32 entries (filtered from 57 total entries)"; } + ); + + oTest.fnTest( + "Filter 'Win'", + function () { $('#example_filter input').val("Win").keyup(); }, + function () { return document.getElementById('example_info').innerHTML == + "Showing 1 to 10 of 31 entries (filtered from 57 total entries)"; } + ); + + oTest.fnTest( + "Filter 'Win' - sorting column 1", + function () { $('#example thead th:eq(1)').click(); }, + function () { return $('#example tbody tr:eq(0) td:eq(1)').html() == "AOL browser (AOL desktop)"; } + ); + + oTest.fnTest( + "Filter 'Win' - sorting column 1 info", + null, + function () { return document.getElementById('example_info').innerHTML == + "Showing 1 to 10 of 31 entries (filtered from 57 total entries)"; } + ); + + oTest.fnTest( + "Filter 'Win' - sorting column 1 reverse", + function () { $('#example thead th:eq(1)').click(); }, + function () { return $('#example tbody tr:eq(0) td:eq(1)').html() == "Seamonkey 1.1"; } + ); + + oTest.fnTest( + "Filter 'Win XP' - maintaing reverse sorting col 1", + function () { $('#example_filter input').val("Win XP").keyup(); }, + function () { return $('#example tbody tr:eq(0) td:eq(1)').html() == "Internet Explorer 7"; } + ); + + oTest.fnTest( + "Filter 'Win XP' - sorting col 3", + function () { $('#example thead th:eq(3)').click(); }, + function () { return $('#example tbody tr:eq(0) td:eq(3)').html() == "4"; } + ); + + oTest.fnTest( + "Filter 'Win XP' - sorting col 3 - reversed", + function () { $('#example thead th:eq(3)').click(); }, + function () { return $('#example tbody tr:eq(0) td:eq(3)').html() == "7"; } + ); + + oTest.fnTest( + "Filter 'Win' - sorting col 3 - reversed info", + null, + function () { return document.getElementById('example_info').innerHTML == + "Showing 1 to 6 of 6 entries (filtered from 57 total entries)"; } + ); + + oTest.fnTest( + "Filter 'nothinghere'", + function () { $('#example_filter input').val("nothinghere").keyup(); }, + function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == + "No matching records found"; } + ); + + oTest.fnTest( + "Filter 'nothinghere' - info", + null, + function () { return document.getElementById('example_info').innerHTML == + "Showing 0 to 0 of 0 entries (filtered from 57 total entries)"; } + ); + + oTest.fnTest( + "Filter back to blank and 1st column sorting", + function () { + $('#example_filter input').val("").keyup(); + $('#example thead th:eq(0)').click(); + }, + function () { return document.getElementById('example_info').innerHTML == + "Showing 1 to 10 of 57 entries"; } + ); + + oTest.fnTest( + "Prefixing a filter entry", + function () { + $('#example_filter input').val("Win").keyup(); + $('#example_filter input').val("GeckoWin").keyup(); + }, + function () { return document.getElementById('example_info').innerHTML == + "Showing 0 to 0 of 0 entries (filtered from 57 total entries)"; } + ); + + oTest.fnTest( + "Prefixing a filter entry with space", + function () { + $('#example_filter input').val("Gecko Win").keyup(); + }, + function () { return document.getElementById('example_info').innerHTML == + "Showing 1 to 10 of 17 entries (filtered from 57 total entries)"; } + ); + + + + + + + + + oTest.fnComplete(); +} ); \ No newline at end of file diff --git a/media/unit_testing/tests_onhold/5_ajax_objects/asStripClasses.js b/media/unit_testing/tests_onhold/5_ajax_objects/asStripClasses.js index 49e7ed59..82f2bc8d 100644 --- a/media/unit_testing/tests_onhold/5_ajax_objects/asStripClasses.js +++ b/media/unit_testing/tests_onhold/5_ajax_objects/asStripClasses.js @@ -1,5 +1,5 @@ // DATA_TEMPLATE: empty_table -oTest.fnStart( "asStripClasses" ); +oTest.fnStart( "asStripeClasses" ); $(document).ready( function () { /* Check the default */ @@ -50,7 +50,7 @@ $(document).ready( function () { { "mDataProp": "version", "aTargets": [3] }, { "mDataProp": "grade", "aTargets": [4] } ], - "asStripClasses": [] + "asStripeClasses": [] } ); }, function () { @@ -80,7 +80,7 @@ $(document).ready( function () { { "mDataProp": "version", "aTargets": [3] }, { "mDataProp": "grade", "aTargets": [4] } ], - "asStripClasses": [ 'test1', 'test2' ] + "asStripeClasses": [ 'test1', 'test2' ] } ); }, function () { @@ -106,7 +106,7 @@ $(document).ready( function () { { "mDataProp": "version", "aTargets": [3] }, { "mDataProp": "grade", "aTargets": [4] } ], - "asStripClasses": [ 'test1', 'test2', 'test3', 'test4' ] + "asStripeClasses": [ 'test1', 'test2', 'test3', 'test4' ] } ); }, function () { diff --git a/media/unit_testing/tests_onhold/5_ajax_objects/sPaginationType.js b/media/unit_testing/tests_onhold/5_ajax_objects/sPaginationType.js index 69256437..684fb83e 100644 --- a/media/unit_testing/tests_onhold/5_ajax_objects/sPaginationType.js +++ b/media/unit_testing/tests_onhold/5_ajax_objects/sPaginationType.js @@ -28,9 +28,9 @@ $(document).ready( function () { ); oTest.fnWaitTest( - "Two div elements are in the wrapper", + "Two A elements are in the wrapper", null, - function () { return $('#example_paginate div').length == 2; } + function () { return $('#example_paginate a').length == 2; } ); oTest.fnWaitTest( @@ -101,10 +101,10 @@ $(document).ready( function () { oTest.fnWaitTest( "Jump to last page", function () { - nFirst = $('div.dataTables_paginate span.first'); - nPrevious = $('div.dataTables_paginate span.previous'); - nNext = $('div.dataTables_paginate span.next'); - nLast = $('div.dataTables_paginate span.last'); + nFirst = $('div.dataTables_paginate a.first'); + nPrevious = $('div.dataTables_paginate a.previous'); + nNext = $('div.dataTables_paginate a.next'); + nLast = $('div.dataTables_paginate a.last'); nLast.click(); }, function () { diff --git a/media/unit_testing/tests_onhold/6_delayed_rendering/asStripClasses.js b/media/unit_testing/tests_onhold/6_delayed_rendering/asStripClasses.js index f4be1962..038447f2 100644 --- a/media/unit_testing/tests_onhold/6_delayed_rendering/asStripClasses.js +++ b/media/unit_testing/tests_onhold/6_delayed_rendering/asStripClasses.js @@ -1,5 +1,5 @@ // DATA_TEMPLATE: empty_table -oTest.fnStart( "asStripClasses" ); +oTest.fnStart( "asStripeClasses" ); $(document).ready( function () { /* Check the default */ @@ -38,7 +38,7 @@ $(document).ready( function () { $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", "bDeferRender": true, - "asStripClasses": [] + "asStripeClasses": [] } ); }, function () { @@ -62,7 +62,7 @@ $(document).ready( function () { $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", "bDeferRender": true, - "asStripClasses": [ 'test1', 'test2' ] + "asStripeClasses": [ 'test1', 'test2' ] } ); }, function () { @@ -82,7 +82,7 @@ $(document).ready( function () { $('#example').dataTable( { "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", "bDeferRender": true, - "asStripClasses": [ 'test1', 'test2', 'test3', 'test4' ] + "asStripeClasses": [ 'test1', 'test2', 'test3', 'test4' ] } ); }, function () { diff --git a/media/unit_testing/tests_onhold/6_delayed_rendering/sPaginationType.js b/media/unit_testing/tests_onhold/6_delayed_rendering/sPaginationType.js index f29f2c20..8364f90c 100644 --- a/media/unit_testing/tests_onhold/6_delayed_rendering/sPaginationType.js +++ b/media/unit_testing/tests_onhold/6_delayed_rendering/sPaginationType.js @@ -22,9 +22,9 @@ $(document).ready( function () { ); oTest.fnWaitTest( - "Two div elements are in the wrapper", + "Two A elements are in the wrapper", null, - function () { return $('#example_paginate div').length == 2; } + function () { return $('#example_paginate a').length == 2; } ); oTest.fnWaitTest( @@ -89,10 +89,10 @@ $(document).ready( function () { oTest.fnWaitTest( "Jump to last page", function () { - nFirst = $('div.dataTables_paginate span.first'); - nPrevious = $('div.dataTables_paginate span.previous'); - nNext = $('div.dataTables_paginate span.next'); - nLast = $('div.dataTables_paginate span.last'); + nFirst = $('div.dataTables_paginate a.first'); + nPrevious = $('div.dataTables_paginate a.previous'); + nNext = $('div.dataTables_paginate a.next'); + nLast = $('div.dataTables_paginate a.last'); nLast.click(); }, function () { diff --git a/scripts/jshint.config b/scripts/jshint.config new file mode 100644 index 00000000..533d4d31 --- /dev/null +++ b/scripts/jshint.config @@ -0,0 +1,72 @@ +{ + // Settings + "passfail" : false, // Stop on first error. + "maxerr" : 100, // Maximum error before stopping. + + + // Predefined globals whom JSHint will ignore. + "browser" : true, // Standard browser globals e.g. `window`, `document`. + + "node" : false, + "rhino" : false, + "couch" : false, + "wsh" : true, // Windows Scripting Host. + + "jquery" : true, + "prototypejs" : false, + "mootools" : false, + "dojo" : false, + + "predef" : [ // Custom globals. + //"exampleVar", + //"anotherCoolGlobal", + //"iLoveDouglas" + ], + + + // Development. + "debug" : false, // Allow debugger statements e.g. browser breakpoints. + "devel" : true, // Allow developments statements e.g. `console.log();`. + + + // ECMAScript 5. + "es5" : true, // Allow ECMAScript 5 syntax. + "strict" : false, // Require `use strict` pragma in every file. + "globalstrict" : false, // Allow global "use strict" (also enables 'strict'). + + + // The Good Parts. + "asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons). + "laxbreak" : true, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons. + "bitwise" : true, // Prohibit bitwise operators (&, |, ^, etc.). + "boss" : false, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments. + "curly" : true, // Require {} for every new block or scope. + "eqeqeq" : false, // Require triple equals i.e. `===`. + "eqnull" : false, // Tolerate use of `== null`. + "evil" : false, // Tolerate use of `eval`. + "expr" : false, // Tolerate `ExpressionStatement` as Programs. + "forin" : false, // Tolerate `for in` loops without `hasOwnPrototype`. + "immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );` + "latedef" : true, // Prohipit variable use before definition. + "loopfunc" : false, // Allow functions to be defined within loops. + "noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`. + "regexp" : false, // Prohibit `.` and `[^...]` in regular expressions. + "regexdash" : false, // Tolerate unescaped last dash i.e. `[-...]`. + "scripturl" : true, // Tolerate script-targeted URLs. + "shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`. + "supernew" : false, // Tolerate `new function () { ... };` and `new Object;`. + "undef" : true, // Require all non-global variables be declared before they are used. + + + // Personal styling preferences. + "newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`. + "noempty" : true, // Prohibit use of empty blocks. + "nonew" : true, // Prohibit use of constructors for side-effects. + "nomen" : false, // Prohibit use of initial or trailing underbars in names. + "onevar" : false, // Allow only one `var` statement per function. + "plusplus" : false, // Prohibit use of `++` & `--`. + "sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`. + "trailing" : true, // Prohibit trailing whitespaces. + "white" : false, // Check against strict whitespace and indentation rules. + "indent" : 4 // Specify indentation spacing +} diff --git a/scripts/make.sh b/scripts/make.sh new file mode 100755 index 00000000..acb7e63d --- /dev/null +++ b/scripts/make.sh @@ -0,0 +1,89 @@ +#!/bin/sh + +cd ../media/src + +# DEFAULTS +CLOSURE="/usr/local/closure_compiler/compiler.jar" +JSDOC="/usr/local/jsdoc/jsdoc" +CMD=$1 + +MAIN_FILE="../js/jquery.dataTables.js" +MIN_FILE="../js/jquery.dataTables.min.js" +VERSION=$(grep " * @version " DataTables.js | awk -F" " '{ print $3 }') + +echo "" +echo " DataTables build ($VERSION)" +echo "" + + +IFS='%' + +cp DataTables.js DataTables.js.build + +echo " Building main script" +grep "require(" DataTables.js.build > /dev/null +while [ $? -eq 0 ]; do + REQUIRE=$(grep "require(" DataTables.js.build | head -n 1) + + SPACER=$(echo ${REQUIRE} | cut -d r -f 1) + FILE=$(echo ${REQUIRE} | sed -e "s#^.*require('##g" -e "s#');##") + DIR=$(echo ${FILE} | cut -d \. -f 1) + + sed "s#^#${SPACER}#" < ${DIR}/${FILE} > ${DIR}/${FILE}.build + + sed -e "/${REQUIRE}/r ${DIR}/${FILE}.build" -e "/${REQUIRE}/d" < DataTables.js.build > DataTables.js.out + mv DataTables.js.out DataTables.js.build + + rm ${DIR}/${FILE}.build + + grep "require(" DataTables.js.build > /dev/null +done + +mv DataTables.js.build $MAIN_FILE + + +if [ "$CMD" != "debug" ]; then + if [ "$CMD" = "jshint" -o "$CMD" = "" ]; then + echo " JSHint" + jshint $MAIN_FILE --config ../../scripts/jshint.config + if [ $? -ne 0 ]; then + echo " Errors occured - exiting" + exit 1 + else + echo " Pass" + fi + fi + + if [ "$CMD" = "compress" -o "$CMD" = "" ]; then + echo " Minification" + echo "/* + * File: jquery.dataTables.min.js + * Version: $VERSION + * Author: Allan Jardine (www.sprymedia.co.uk) + * Info: www.datatables.net + * + * Copyright 2008-2011 Allan Jardine, all rights reserved. + * + * This source file is free software, under either the GPL v2 license or a + * BSD style license, available at: + * http://datatables.net/license_gpl2 + * http://datatables.net/license_bsd + * + * This source file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. + */" > $MIN_FILE + + java -jar $CLOSURE --js $MAIN_FILE >> $MIN_FILE + echo " Min JS file size: $(ls -l $MIN_FILE | awk -F" " '{ print $5 }')" + fi + + if [ "$CMD" = "docs" -o "$CMD" = "" ]; then + echo " Documentation" + $JSDOC -d ../../docs -t JSDoc-DataTables $MAIN_FILE + fi +fi + +echo " Done\n" + + diff --git a/scripts/unit_tests.sh b/scripts/unit_tests.sh new file mode 100755 index 00000000..0e73d924 --- /dev/null +++ b/scripts/unit_tests.sh @@ -0,0 +1,109 @@ +#!/bin/sh + +ENABLE=$1 + +echo "" +echo " DataTables unit tests" +echo "" + +if [ ! "$ENABLE" = "Enable" -a ! "$ENABLE" = "Disable" -o "ENABLE" = "-h" ]; then + echo " Enable or Disable must be given as the first argument." + echo " Optionally the second argument can be given as an integer to enable/disable a certain " + echo " set of tests or the string 'sanity' to run the sanity check for all data types." + echo "" + exit 1 +fi + +cd ../media/unit_testing + +if [ "$ENABLE" = "Enable" ]; then + if [ ! -d tests ]; then + echo " Building test directory" + mkdir tests + mkdir tests/1_dom + mkdir tests/2_js + mkdir tests/3_ajax + mkdir tests/4_server-side + mkdir tests/5_ajax_objects + mkdir tests/6_delayed_rendering + fi + + echo " Enabling:" + if [ ! -z $2 ]; then + if [ "$2" = "sanity" ]; then + echo " Sanity checks" + mv tests_onhold/1_dom/_zero_config.js tests/1_dom/ + mv tests_onhold/2_js/_zero_config.js tests/2_js/ + mv tests_onhold/3_ajax/_zero_config.js tests/3_ajax/ + mv tests_onhold/4_server-side/_zero_config.js tests/4_server-side/ + mv tests_onhold/5_ajax_objects/_zero_config.js tests/5_ajax_objects/ + mv tests_onhold/6_delayed_rendering/_zero_config.js tests/6_delayed_rendering/ + elif [ $2 -eq 1 ]; then + echo " DOM" + mv tests_onhold/1_dom/* tests/1_dom/ + elif [ $2 -eq 2 ]; then + echo " JS" + mv tests_onhold/2_js/* tests/2_js/ + elif [ $2 -eq 3 ]; then + echo " Ajax" + mv tests_onhold/3_ajax/* tests/3_ajax/ + elif [ $2 -eq 4 ]; then + echo " SErver-side" + mv tests_onhold/4_server-side/* tests/4_server-side/ + elif [ $2 -eq 5 ]; then + echo " Ajax objects" + mv tests_onhold/5_ajax_objects/* tests/5_ajax_objects/ + elif [ $2 -eq 6 ]; then + echo " Delayed rendering" + mv tests_onhold/6_delayed_rendering/* tests/6_delayed_rendering/ + fi + else + echo " All tests" + mv tests_onhold/1_dom/* tests/1_dom/ + mv tests_onhold/2_js/* tests/2_js/ + mv tests_onhold/3_ajax/* tests/3_ajax/ + mv tests_onhold/4_server-side/* tests/4_server-side/ + mv tests_onhold/5_ajax_objects/* tests/5_ajax_objects/ + mv tests_onhold/6_delayed_rendering/* tests/6_delayed_rendering/ + fi + +else + echo " Disabling:" + if [ ! -z $2 ]; then + if [ "$2" = "sanity" ]; then + echo " Sanity checks" + mv tests/1_dom/* tests_onhold/1_dom/ + mv tests/2_js/* tests_onhold/2_js/ + mv tests/3_ajax/* tests_onhold/3_ajax/ + mv tests/4_server-side/* tests_onhold/4_server-side/ + mv tests/5_ajax_objects/* tests_onhold/5_ajax_objects/ + mv tests/6_delayed_rendering/* tests_onhold/6_delayed_rendering/ + elif [ $2 -eq 1 ]; then + echo " DOM" + mv tests/1_dom/* tests_onhold/1_dom/ + elif [ $2 -eq 2 ]; then + echo " JS" + mv tests/2_js/* tests_onhold/2_js/ + elif [ $2 -eq 3 ]; then + echo " Ajax" + mv tests/3_ajax/* tests_onhold/3_ajax/ + elif [ $2 -eq 4 ]; then + echo " Server-side" + mv tests/4_server-side/* tests_onhold/4_server-side/ + elif [ $2 -eq 5 ]; then + echo " Ajax objects" + mv tests/5_ajax_objects/* tests_onhold/5_ajax_objects/ + elif [ $2 -eq 6 ]; then + echo " Delayed rendering" + mv tests/6_delayed_rendering/* tests_onhold/6_delayed_rendering/ + fi + else + echo " All tests" + mv tests/1_dom/* tests_onhold/1_dom/ + mv tests/2_js/* tests_onhold/2_js/ + mv tests/3_ajax/* tests_onhold/3_ajax/ + mv tests/4_server-side/* tests_onhold/4_server-side/ + mv tests/5_ajax_objects/* tests_onhold/5_ajax_objects/ + mv tests/6_delayed_rendering/* tests_onhold/6_delayed_rendering/ + fi +fi