WP-Table Reloaded - Version 1.7

Version Description

This upgrade includes an updated DataTables library, adds a "Table" button in the toolbar of the visual editor, and enhances several other things.

Download this release

Release Info

Developer TobiasBg
Plugin Icon wp plugin WP-Table Reloaded
Version 1.7
Comparing to
See all releases

Code changes from version 1.6.1 to 1.7

Files changed (51) hide show
  1. admin/admin-editor-buttons-script.dev.js +10 -13
  2. admin/admin-editor-buttons-script.js +1 -5
  3. admin/admin-script.dev.js +11 -0
  4. admin/admin-script.js +1 -1
  5. admin/admin-style.css +1 -1
  6. admin/admin-style.dev.css +4 -0
  7. admin/admin-tinymce-buttons-script.dev.js +57 -0
  8. admin/admin-tinymce-buttons-script.js +1 -0
  9. admin/plugin-editor-button.png +0 -0
  10. admin/plugin-icon-small.png +0 -0
  11. admin/plugin-icon.png +0 -0
  12. classes/helper.class.php +7 -7
  13. controllers/controller-admin.php +95 -44
  14. controllers/controller-base.php +2 -1
  15. controllers/controller-frontend.php +36 -20
  16. css/datatables.css +2 -2
  17. css/plugin.css +4 -0
  18. js/jquery.datatables.min.js +270 -225
  19. js/tabletools/tabletools.js +158 -11
  20. js/tabletools/zeroclipboard.js +32 -5
  21. js/tabletools/zeroclipboard.swf +0 -0
  22. languages/wp-table-reloaded-cs_CZ.mo +0 -0
  23. languages/wp-table-reloaded-cs_CZ.po +287 -255
  24. languages/wp-table-reloaded-de_DE.mo +0 -0
  25. languages/wp-table-reloaded-de_DE.po +287 -260
  26. languages/wp-table-reloaded-es_ES.mo +0 -0
  27. languages/wp-table-reloaded-es_ES.po +576 -577
  28. languages/wp-table-reloaded-fi_FI.mo +0 -0
  29. languages/wp-table-reloaded-fi_FI.po +2303 -2266
  30. languages/wp-table-reloaded-fr_FR.mo +0 -0
  31. languages/wp-table-reloaded-fr_FR.po +2465 -0
  32. languages/wp-table-reloaded-it_IT.mo +0 -0
  33. languages/wp-table-reloaded-it_IT.po +337 -303
  34. languages/wp-table-reloaded-ja.mo +0 -0
  35. languages/wp-table-reloaded-ja.po +724 -758
  36. languages/wp-table-reloaded-ru_RU.mo +0 -0
  37. languages/wp-table-reloaded-ru_RU.po +2338 -0
  38. languages/wp-table-reloaded-sk_SK.mo +0 -0
  39. languages/wp-table-reloaded-sk_SK.po +289 -266
  40. languages/wp-table-reloaded-sv_SE.mo +0 -0
  41. languages/wp-table-reloaded-sv_SE.po +352 -249
  42. languages/wp-table-reloaded-ua_UA.mo +0 -0
  43. languages/wp-table-reloaded-ua_UA.po +2408 -0
  44. languages/wp-table-reloaded-zh_CN.mo +0 -0
  45. languages/wp-table-reloaded-zh_CN.po +2062 -0
  46. languages/wp-table-reloaded.pot +308 -264
  47. readme.txt +24 -6
  48. views/view-about.php +11 -11
  49. views/view-edit.php +18 -5
  50. views/view-options.php +12 -3
  51. wp-table-reloaded.php +31 -10
admin/admin-editor-buttons-script.dev.js CHANGED
@@ -5,35 +5,32 @@
5
6
jQuery(document).ready(function($){
7
8
- var editor_toolbar = $("#ed_toolbar");
9
-
10
if ( editor_toolbar ) {
11
- var theButton = document.createElement('input');
12
theButton.type = 'button';
13
- theButton.value = WP_Table_Reloaded_Admin.str_EditorButtonCaption;
14
theButton.className = 'ed_button';
15
- theButton.title = WP_Table_Reloaded_Admin.str_EditorButtonCaption;
16
theButton.id = 'ed_button_wp_table_reloaded';
17
editor_toolbar.append( theButton );
18
- $("#ed_button_wp_table_reloaded").click( wp_table_reloaded_button_click );
19
}
20
21
function wp_table_reloaded_button_click() {
22
-
23
var title = 'WP-Table Reloaded';
24
- var url = WP_Table_Reloaded_Admin.str_EditorButtonAjaxURL;
25
26
tb_show( title, url, false);
27
28
- $("#TB_ajaxContent").width("auto").height("94.5%")
29
- .click(function(event) {
30
var $target = $(event.target);
31
if ( $target.is('a.send_table_to_editor') ) {
32
- var table_id = $target.attr('title');
33
- send_to_editor( '[table id=' + table_id + ' /]' );
34
}
35
return false;
36
- });
37
38
return false;
39
}
5
6
jQuery(document).ready(function($){
7
8
+ var editor_toolbar = $( '#ed_toolbar' );
9
if ( editor_toolbar ) {
10
+ var theButton = document.createElement( 'input' );
11
theButton.type = 'button';
12
+ theButton.value = WP_Table_Reloaded_Editor_Button.str_EditorButtonCaption;
13
theButton.className = 'ed_button';
14
+ theButton.title = WP_Table_Reloaded_Editor_Button.str_EditorButtonCaption;
15
theButton.id = 'ed_button_wp_table_reloaded';
16
editor_toolbar.append( theButton );
17
+ $( '#ed_button_wp_table_reloaded' ).click( wp_table_reloaded_button_click );
18
}
19
20
function wp_table_reloaded_button_click() {
21
var title = 'WP-Table Reloaded';
22
+ var url = WP_Table_Reloaded_Editor_Button.str_EditorButtonAjaxURL;
23
24
tb_show( title, url, false);
25
26
+ $( '#TB_ajaxContent' ).width( 'auto' ).height( '94.5%' )
27
+ .click( function(event) {
28
var $target = $(event.target);
29
if ( $target.is('a.send_table_to_editor') ) {
30
+ send_to_editor( '[table id=' + $target.attr('title') + ' /]' );
31
}
32
return false;
33
+ } );
34
35
return false;
36
}
admin/admin-editor-buttons-script.js CHANGED
@@ -1,5 +1 @@
1
- /***************************************************************
2
- * This JS file belongs to the Admin part of WP-Table Reloaded! *
3
- * PLEASE DO NOT make any changes here! Thank you! *
4
- ***************************************************************/
5
- jQuery(document).ready(function(c){var d=c("#ed_toolbar");if(d){var b=document.createElement("input");b.type="button";b.value=WP_Table_Reloaded_Admin.str_EditorButtonCaption;b.className="ed_button";b.title=WP_Table_Reloaded_Admin.str_EditorButtonCaption;b.id="ed_button_wp_table_reloaded";d.append(b);c("#ed_button_wp_table_reloaded").click(a)}function a(){var f="WP-Table Reloaded";var e=WP_Table_Reloaded_Admin.str_EditorButtonAjaxURL;tb_show(f,e,false);c("#TB_ajaxContent").width("auto").height("94.5%").click(function(h){var g=c(h.target);if(g.is("a.send_table_to_editor")){var i=g.attr("title");send_to_editor("[table id="+i+" /]")}return false});return false}});
1
+ jQuery(document).ready(function(c){var d=c("#ed_toolbar");if(d){var b=document.createElement("input");b.type="button";b.value=WP_Table_Reloaded_Editor_Button.str_EditorButtonCaption;b.className="ed_button";b.title=WP_Table_Reloaded_Editor_Button.str_EditorButtonCaption;b.id="ed_button_wp_table_reloaded";d.append(b);c("#ed_button_wp_table_reloaded").click(a)}function a(){var f="WP-Table Reloaded";var e=WP_Table_Reloaded_Editor_Button.str_EditorButtonAjaxURL;tb_show(f,e,false);c("#TB_ajaxContent").width("auto").height("94.5%").click(function(h){var g=c(h.target);if(g.is("a.send_table_to_editor")){send_to_editor("[table id="+g.attr("title")+" /]")}return false});return false}});
admin/admin-script.dev.js CHANGED
@@ -187,10 +187,21 @@ jQuery(document).ready( function( $ ) {
187
$( '.wp-table-reloaded-datatables-options input' ).removeAttr( 'disabled' );
188
if ( !WP_Table_Reloaded_Admin.option_tabletools_active )
189
$( '#table_options_datatables_tabletools' ).attr( 'disabled', 'disabled' );
190
} else {
191
$( '.wp-table-reloaded-datatables-options input' ).attr( 'disabled', 'disabled' );
192
}
193
} );
194
} else if ( WP_Table_Reloaded_Admin.option_tablesorter_enabled ) {
195
$( '#table_options_first_row_th' ).change( function () {
196
if( $(this).attr('checked') )
187
$( '.wp-table-reloaded-datatables-options input' ).removeAttr( 'disabled' );
188
if ( !WP_Table_Reloaded_Admin.option_tabletools_active )
189
$( '#table_options_datatables_tabletools' ).attr( 'disabled', 'disabled' );
190
+ if ( !$( '#table_options_datatables_paginate' ).attr('checked') )
191
+ $( '#table_options_datatables_paginate_entries' ).attr( 'disabled', 'disabled' );
192
} else {
193
$( '.wp-table-reloaded-datatables-options input' ).attr( 'disabled', 'disabled' );
194
}
195
} );
196
+
197
+ $( '#table_options_datatables_paginate' ).change( function () {
198
+ if( $(this).attr('checked') ) {
199
+ $( '#table_options_datatables_paginate_entries' ).removeAttr( 'disabled' );
200
+ } else {
201
+ $( '#table_options_datatables_paginate_entries' ).attr( 'disabled', 'disabled' );
202
+ }
203
+ } );
204
+
205
} else if ( WP_Table_Reloaded_Admin.option_tablesorter_enabled ) {
206
$( '#table_options_first_row_th' ).change( function () {
207
if( $(this).attr('checked') )
admin/admin-script.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(d){d("#a-hide-rows").click(function(){var m=d('#table_contents tr:not(".table-foot") :checked').length;if(m==0){alert(WP_Table_Reloaded_Admin.str_UnHideRowsNoSelection)}else{d('#table_contents tr:not(".table-foot") :checked').removeAttr("checked").next().val(true).parents("tr").addClass("row-hidden");e()}return false});d("#a-unhide-rows").click(function(){var m=d('#table_contents tr:not(".table-foot") :checked').length;if(m==0){alert(WP_Table_Reloaded_Admin.str_UnHideRowsNoSelection)}else{d('#table_contents tr:not(".table-foot") :checked').removeAttr("checked").next().val(false).parents("tr").removeClass("row-hidden");e()}return false});d("#a-hide-columns").click(function(){var m=d("#table_contents .table-foot :checked").length;if(m==0){alert(WP_Table_Reloaded_Admin.str_UnHideColsNoSelection)}else{d("#table_contents .table-foot :checked").removeAttr("checked").next().val(true).each(function(){d("#table_contents ."+d(this).attr("id")).addClass("column-hidden")});e()}return false});d("#a-unhide-columns").click(function(){var m=d("#table_contents .table-foot :checked").length;if(m==0){alert(WP_Table_Reloaded_Admin.str_UnHideColsNoSelection)}else{d("#table_contents .table-foot :checked").removeAttr("checked").next().val(false).each(function(){d("#table_contents ."+d(this).attr("id")).removeClass("column-hidden")});e()}return false});d("#button-insert-rows").click(function(){var m=d('#table_contents tr:not(".table-foot") :checked').length;if(m==0){alert(WP_Table_Reloaded_Admin.str_InsertRowsNoSelection);return false}else{return true}});d("#button-insert-columns").click(function(){var m=d("#table_contents .table-foot :checked").length;if(m==0){alert(WP_Table_Reloaded_Admin.str_InsertColsNoSelection);return false}else{return true}});var c="";function a(){d(this).val(c);d("#table_contents textarea").unbind("click",a);e()}d("#a-add-colspan").click(function(){c="#colspan#";if(confirm(WP_Table_Reloaded_Admin.str_DataManipulationAddColspan)){d("#table_contents textarea").bind("click",a)}return false});d("#a-add-rowspan").click(function(){c="#rowspan#";if(confirm(WP_Table_Reloaded_Admin.str_DataManipulationAddRowspan)){d("#table_contents textarea").bind("click",a)}return false});var g=null;if(WP_Table_Reloaded_Admin.option_growing_textareas){d("#table_contents textarea").focus(function(){d(g).removeClass("focus");g=d(this).parents("tr").find("textarea");d(g).addClass("focus")})}function i(){d("#options_custom_css").addClass("focus")}d("#options_custom_css").one("focus",i);d("#export_format").change(function(){if("csv"==d(this).val()){d(".tr-export-delimiter").show()}else{d(".tr-export-delimiter").hide()}}).change();var j=d(".wp-table-reloaded-table-information #table_id").val();d(".wp-table-reloaded-table-information #table_id").change(function(){if(j!=d(this).val()){if(confirm(WP_Table_Reloaded_Admin.str_ChangeTableID)){j=d(this).val();e()}else{d(this).val(j)}}});d(".tr-import-addreplace input").click(function(){if("replace"==d(".tr-import-addreplace input:checked").val()){d(".tr-import-addreplace-table").show()}else{d(".tr-import-addreplace-table").hide()}});d(".tr-import-addreplace input:checked").click();d(".tr-import-from input").click(function(){d(".tr-import-file-upload, .tr-import-url, .tr-import-form-field, .tr-import-server").hide();d(".tr-import-"+d(".tr-import-from input:checked").val()).show()});d(".tr-import-from input:checked").click();d("#options_use_custom_css").change(function(){if(d(this).attr("checked")){d("#options_custom_css").removeAttr("disabled")}else{d("#options_custom_css").attr("disabled","disabled")}});d("#options_enable_tablesorter").change(function(){if(d(this).attr("checked")){d("#options_tablesorter_script").removeAttr("disabled")}else{d("#options_tablesorter_script").attr("disabled","disabled")}});if(WP_Table_Reloaded_Admin.option_tablesorter_enabled&&WP_Table_Reloaded_Admin.option_datatables_active){d("#table_options_first_row_th").change(function(){if(d(this).attr("checked")){d("#table_options_use_tablesorter").removeAttr("disabled");if(d("#table_options_use_tablesorter").attr("checked")){d(".wp-table-reloaded-datatables-options input").removeAttr("disabled");if(!WP_Table_Reloaded_Admin.option_tabletools_active){d("#table_options_datatables_tabletools").attr("disabled","disabled")}}}else{d("#table_options_use_tablesorter").attr("disabled","disabled");d(".wp-table-reloaded-datatables-options input").attr("disabled","disabled")}});d("#table_options_use_tablesorter").change(function(){if(d(this).attr("checked")){d(".wp-table-reloaded-datatables-options input").removeAttr("disabled");if(!WP_Table_Reloaded_Admin.option_tabletools_active){d("#table_options_datatables_tabletools").attr("disabled","disabled")}}else{d(".wp-table-reloaded-datatables-options input").attr("disabled","disabled")}})}else{if(WP_Table_Reloaded_Admin.option_tablesorter_enabled){d("#table_options_first_row_th").change(function(){if(d(this).attr("checked")){d("#table_options_use_tablesorter").removeAttr("disabled")}else{d("#table_options_use_tablesorter").attr("disabled","disabled")}})}}d("#table_options_print_name").change(function(){if(d(this).attr("checked")){d("#table_options_print_name_position").removeAttr("disabled")}else{d("#table_options_print_name_position").attr("disabled","disabled")}});d("#table_options_print_description").change(function(){if(d(this).attr("checked")){d("#table_options_print_description_position").removeAttr("disabled")}else{d("#table_options_print_description_position").attr("disabled","disabled")}});d("#options_uninstall_upon_deactivation").click(function(){if(d(this).attr("checked")){return confirm(WP_Table_Reloaded_Admin.str_UninstallCheckboxActivation)}});var k="";function f(){d(this).val(d(this).val()+k);d("#table_contents textarea").unbind("click",f);e()}d("#a-insert-link").click(function(){var o="";if(WP_Table_Reloaded_Admin.option_add_target_blank_to_links){o=' target="_blank"'}var n=prompt(WP_Table_Reloaded_Admin.str_DataManipulationLinkInsertURL+":","http://");if(n){var m=prompt(WP_Table_Reloaded_Admin.str_DataManipulationLinkInsertText+":",WP_Table_Reloaded_Admin.str_DataManipulationLinkInsertText);if(m){k='<a href="'+n+'"'+o+">"+m+"</a>";k=prompt(WP_Table_Reloaded_Admin.str_DataManipulationLinkInsertExplain,k);if(k){d("#table_contents textarea").bind("click",f)}}}return false});function b(){edCanvas=this;d("#table_contents textarea").unbind("click",b);var m=d("#a-insert-image");tb_show(m.attr("title"),m.attr("href"),m.attr("rel"));tb_my_position();d(this).blur();e()}function h(){if(confirm(WP_Table_Reloaded_Admin.str_DataManipulationImageInsertThickbox)){d("#table_contents textarea").bind("click",b)}return false}d("#a-insert-image").bind("click",h);d("#insert_custom_field_name").keyup(function(){d(this).val(d(this).val().toLowerCase().replace(/[^a-z0-9_-]/g,""))});d(".focus-blur-change").focus(function(){if(d(this).attr("title")==d(this).val()){d(this).val("")}}).blur(function(){if(""==d(this).val()){d(this).val(d(this).attr("title"))}});d("#table_custom_fields textarea").focus(function(){d("#table_custom_fields .focus").removeClass("focus");d(this).addClass("focus")});d("input.bulk_copy_tables").click(function(){return confirm(WP_Table_Reloaded_Admin.str_BulkCopyTablesLink)});d("input.bulk_delete_tables").click(function(){return confirm(WP_Table_Reloaded_Admin.str_BulkDeleteTablesLink)});d("input.bulk_wp_table_import_tables").click(function(){return confirm(WP_Table_Reloaded_Admin.str_BulkImportwpTableTablesLink)});d("a.copy_table_link").click(function(){return confirm(WP_Table_Reloaded_Admin.str_CopyTableLink)});d("#button-delete-rows").click(function(){var n=d('#table_contents tr:not(".table-foot") :checkbox').length-1;var m=d('#table_contents tr:not(".table-foot") :checked').length;if(m==0){alert(WP_Table_Reloaded_Admin.str_DeleteRowsFailedNoSelection);return false}else{if(n==m){alert(WP_Table_Reloaded_Admin.str_DeleteRowsFailedNotAll);return false}else{return confirm(WP_Table_Reloaded_Admin.str_DeleteRowsConfirm)}}});d("#button-delete-columns").click(function(){var m=d("#table_contents .table-foot :checkbox").length;var n=d("#table_contents .table-foot :checked").length;if(n==0){alert(WP_Table_Reloaded_Admin.str_DeleteColsFailedNoSelection);return false}else{if(m==n){alert(WP_Table_Reloaded_Admin.str_DeleteColsFailedNotAll);return false}else{return confirm(WP_Table_Reloaded_Admin.str_DeleteColsConfirm)}}});d("a.import_wptable_link").click(function(){return confirm(WP_Table_Reloaded_Admin.str_ImportwpTableLink)});d("#import_wp_table_reloaded_dump_file").click(function(){return confirm(WP_Table_Reloaded_Admin.str_ImportDumpFile)});d("#uninstall_plugin_link").click(function(){if(confirm(WP_Table_Reloaded_Admin.str_UninstallPluginLink_1)){return confirm(WP_Table_Reloaded_Admin.str_UninstallPluginLink_2)}else{return false}});d("a.cf_shortcode_link").click(function(){var m=prompt(WP_Table_Reloaded_Admin.str_CFShortcodeMessage,d(this).attr("title"));return false});d("a.table_shortcode_link").click(function(){var m=prompt(WP_Table_Reloaded_Admin.str_TableShortcodeMessage,d(this).attr("title"));return false});d(".postbox h3, .postbox .handlediv").click(function(){d(d(this).parent().get(0)).toggleClass("closed")});var l=false;function e(){l=true;d("#wp_table_reloaded_edit_table").find("#table_name, textarea").unbind("change",e);d("#wp_table_reloaded_edit_table .wp-table-reloaded-options input, #wp_table_reloaded_edit_table .wp-table-reloaded-options select").unbind("change",e)}if(WP_Table_Reloaded_Admin.option_show_exit_warning){window.onbeforeunload=function(){if(l){return WP_Table_Reloaded_Admin.str_saveAlert}};d("#wp_table_reloaded_edit_table input[name='submit[update]'], #wp_table_reloaded_edit_table input[name='submit[save_back]']").click(function(){d("#wp_table_reloaded_edit_table .wp-table-reloaded-options input, #wp_table_reloaded_edit_table .wp-table-reloaded-options select").removeAttr("disabled");window.onbeforeunload=null});d("#wp_table_reloaded_edit_table").find("#table_name, textarea").bind("change",e);d("#wp_table_reloaded_edit_table .wp-table-reloaded-options input, #wp_table_reloaded_edit_table .wp-table-reloaded-options select").bind("change",e)}tb_init("a.help-link");tb_init("a.preview-link");tb_my_position()});function send_to_editor(a){jQuery(edCanvas).val(jQuery(edCanvas).val()+a);tb_remove()}var tb_my_position;(function(a){tb_my_position=function(){var e=a("#TB_window"),d=a(window).width(),c=a(window).height(),b=(720<d)?720:d;if(e.size()){e.width(b-50).height(c-45);a("#TB_iframeContent").width(b-50).height(c-75);e.css({"margin-left":"-"+parseInt(((b-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){e.css({top:"20px","margin-top":"0"})}}return a("a.preview-link").each(function(){var f=a(this).attr("href");if(!f){return}f=f.replace(/&width=[0-9]+/g,"");f=f.replace(/&height=[0-9]+/g,"");a(this).attr("href",f+"&width="+(b-80)+"&height="+(c-85))})};a(window).resize(function(){tb_my_position()})})(jQuery);
1
+ jQuery(document).ready(function(d){d("#a-hide-rows").click(function(){var m=d('#table_contents tr:not(".table-foot") :checked').length;if(m==0){alert(WP_Table_Reloaded_Admin.str_UnHideRowsNoSelection)}else{d('#table_contents tr:not(".table-foot") :checked').removeAttr("checked").next().val(true).parents("tr").addClass("row-hidden");e()}return false});d("#a-unhide-rows").click(function(){var m=d('#table_contents tr:not(".table-foot") :checked').length;if(m==0){alert(WP_Table_Reloaded_Admin.str_UnHideRowsNoSelection)}else{d('#table_contents tr:not(".table-foot") :checked').removeAttr("checked").next().val(false).parents("tr").removeClass("row-hidden");e()}return false});d("#a-hide-columns").click(function(){var m=d("#table_contents .table-foot :checked").length;if(m==0){alert(WP_Table_Reloaded_Admin.str_UnHideColsNoSelection)}else{d("#table_contents .table-foot :checked").removeAttr("checked").next().val(true).each(function(){d("#table_contents ."+d(this).attr("id")).addClass("column-hidden")});e()}return false});d("#a-unhide-columns").click(function(){var m=d("#table_contents .table-foot :checked").length;if(m==0){alert(WP_Table_Reloaded_Admin.str_UnHideColsNoSelection)}else{d("#table_contents .table-foot :checked").removeAttr("checked").next().val(false).each(function(){d("#table_contents ."+d(this).attr("id")).removeClass("column-hidden")});e()}return false});d("#button-insert-rows").click(function(){var m=d('#table_contents tr:not(".table-foot") :checked').length;if(m==0){alert(WP_Table_Reloaded_Admin.str_InsertRowsNoSelection);return false}else{return true}});d("#button-insert-columns").click(function(){var m=d("#table_contents .table-foot :checked").length;if(m==0){alert(WP_Table_Reloaded_Admin.str_InsertColsNoSelection);return false}else{return true}});var c="";function a(){d(this).val(c);d("#table_contents textarea").unbind("click",a);e()}d("#a-add-colspan").click(function(){c="#colspan#";if(confirm(WP_Table_Reloaded_Admin.str_DataManipulationAddColspan)){d("#table_contents textarea").bind("click",a)}return false});d("#a-add-rowspan").click(function(){c="#rowspan#";if(confirm(WP_Table_Reloaded_Admin.str_DataManipulationAddRowspan)){d("#table_contents textarea").bind("click",a)}return false});var g=null;if(WP_Table_Reloaded_Admin.option_growing_textareas){d("#table_contents textarea").focus(function(){d(g).removeClass("focus");g=d(this).parents("tr").find("textarea");d(g).addClass("focus")})}function i(){d("#options_custom_css").addClass("focus")}d("#options_custom_css").one("focus",i);d("#export_format").change(function(){if("csv"==d(this).val()){d(".tr-export-delimiter").show()}else{d(".tr-export-delimiter").hide()}}).change();var j=d(".wp-table-reloaded-table-information #table_id").val();d(".wp-table-reloaded-table-information #table_id").change(function(){if(j!=d(this).val()){if(confirm(WP_Table_Reloaded_Admin.str_ChangeTableID)){j=d(this).val();e()}else{d(this).val(j)}}});d(".tr-import-addreplace input").click(function(){if("replace"==d(".tr-import-addreplace input:checked").val()){d(".tr-import-addreplace-table").show()}else{d(".tr-import-addreplace-table").hide()}});d(".tr-import-addreplace input:checked").click();d(".tr-import-from input").click(function(){d(".tr-import-file-upload, .tr-import-url, .tr-import-form-field, .tr-import-server").hide();d(".tr-import-"+d(".tr-import-from input:checked").val()).show()});d(".tr-import-from input:checked").click();d("#options_use_custom_css").change(function(){if(d(this).attr("checked")){d("#options_custom_css").removeAttr("disabled")}else{d("#options_custom_css").attr("disabled","disabled")}});d("#options_enable_tablesorter").change(function(){if(d(this).attr("checked")){d("#options_tablesorter_script").removeAttr("disabled")}else{d("#options_tablesorter_script").attr("disabled","disabled")}});if(WP_Table_Reloaded_Admin.option_tablesorter_enabled&&WP_Table_Reloaded_Admin.option_datatables_active){d("#table_options_first_row_th").change(function(){if(d(this).attr("checked")){d("#table_options_use_tablesorter").removeAttr("disabled");if(d("#table_options_use_tablesorter").attr("checked")){d(".wp-table-reloaded-datatables-options input").removeAttr("disabled");if(!WP_Table_Reloaded_Admin.option_tabletools_active){d("#table_options_datatables_tabletools").attr("disabled","disabled")}}}else{d("#table_options_use_tablesorter").attr("disabled","disabled");d(".wp-table-reloaded-datatables-options input").attr("disabled","disabled")}});d("#table_options_use_tablesorter").change(function(){if(d(this).attr("checked")){d(".wp-table-reloaded-datatables-options input").removeAttr("disabled");if(!WP_Table_Reloaded_Admin.option_tabletools_active){d("#table_options_datatables_tabletools").attr("disabled","disabled")}if(!d("#table_options_datatables_paginate").attr("checked")){d("#table_options_datatables_paginate_entries").attr("disabled","disabled")}}else{d(".wp-table-reloaded-datatables-options input").attr("disabled","disabled")}});d("#table_options_datatables_paginate").change(function(){if(d(this).attr("checked")){d("#table_options_datatables_paginate_entries").removeAttr("disabled")}else{d("#table_options_datatables_paginate_entries").attr("disabled","disabled")}})}else{if(WP_Table_Reloaded_Admin.option_tablesorter_enabled){d("#table_options_first_row_th").change(function(){if(d(this).attr("checked")){d("#table_options_use_tablesorter").removeAttr("disabled")}else{d("#table_options_use_tablesorter").attr("disabled","disabled")}})}}d("#table_options_print_name").change(function(){if(d(this).attr("checked")){d("#table_options_print_name_position").removeAttr("disabled")}else{d("#table_options_print_name_position").attr("disabled","disabled")}});d("#table_options_print_description").change(function(){if(d(this).attr("checked")){d("#table_options_print_description_position").removeAttr("disabled")}else{d("#table_options_print_description_position").attr("disabled","disabled")}});d("#options_uninstall_upon_deactivation").click(function(){if(d(this).attr("checked")){return confirm(WP_Table_Reloaded_Admin.str_UninstallCheckboxActivation)}});var k="";function f(){d(this).val(d(this).val()+k);d("#table_contents textarea").unbind("click",f);e()}d("#a-insert-link").click(function(){var o="";if(WP_Table_Reloaded_Admin.option_add_target_blank_to_links){o=' target="_blank"'}var n=prompt(WP_Table_Reloaded_Admin.str_DataManipulationLinkInsertURL+":","http://");if(n){var m=prompt(WP_Table_Reloaded_Admin.str_DataManipulationLinkInsertText+":",WP_Table_Reloaded_Admin.str_DataManipulationLinkInsertText);if(m){k='<a href="'+n+'"'+o+">"+m+"</a>";k=prompt(WP_Table_Reloaded_Admin.str_DataManipulationLinkInsertExplain,k);if(k){d("#table_contents textarea").bind("click",f)}}}return false});function b(){edCanvas=this;d("#table_contents textarea").unbind("click",b);var m=d("#a-insert-image");tb_show(m.attr("title"),m.attr("href"),m.attr("rel"));tb_my_position();d(this).blur();e()}function h(){if(confirm(WP_Table_Reloaded_Admin.str_DataManipulationImageInsertThickbox)){d("#table_contents textarea").bind("click",b)}return false}d("#a-insert-image").bind("click",h);d("#insert_custom_field_name").keyup(function(){d(this).val(d(this).val().toLowerCase().replace(/[^a-z0-9_-]/g,""))});d(".focus-blur-change").focus(function(){if(d(this).attr("title")==d(this).val()){d(this).val("")}}).blur(function(){if(""==d(this).val()){d(this).val(d(this).attr("title"))}});d("#table_custom_fields textarea").focus(function(){d("#table_custom_fields .focus").removeClass("focus");d(this).addClass("focus")});d("input.bulk_copy_tables").click(function(){return confirm(WP_Table_Reloaded_Admin.str_BulkCopyTablesLink)});d("input.bulk_delete_tables").click(function(){return confirm(WP_Table_Reloaded_Admin.str_BulkDeleteTablesLink)});d("input.bulk_wp_table_import_tables").click(function(){return confirm(WP_Table_Reloaded_Admin.str_BulkImportwpTableTablesLink)});d("a.copy_table_link").click(function(){return confirm(WP_Table_Reloaded_Admin.str_CopyTableLink)});d("#button-delete-rows").click(function(){var n=d('#table_contents tr:not(".table-foot") :checkbox').length-1;var m=d('#table_contents tr:not(".table-foot") :checked').length;if(m==0){alert(WP_Table_Reloaded_Admin.str_DeleteRowsFailedNoSelection);return false}else{if(n==m){alert(WP_Table_Reloaded_Admin.str_DeleteRowsFailedNotAll);return false}else{return confirm(WP_Table_Reloaded_Admin.str_DeleteRowsConfirm)}}});d("#button-delete-columns").click(function(){var m=d("#table_contents .table-foot :checkbox").length;var n=d("#table_contents .table-foot :checked").length;if(n==0){alert(WP_Table_Reloaded_Admin.str_DeleteColsFailedNoSelection);return false}else{if(m==n){alert(WP_Table_Reloaded_Admin.str_DeleteColsFailedNotAll);return false}else{return confirm(WP_Table_Reloaded_Admin.str_DeleteColsConfirm)}}});d("a.import_wptable_link").click(function(){return confirm(WP_Table_Reloaded_Admin.str_ImportwpTableLink)});d("#import_wp_table_reloaded_dump_file").click(function(){return confirm(WP_Table_Reloaded_Admin.str_ImportDumpFile)});d("#uninstall_plugin_link").click(function(){if(confirm(WP_Table_Reloaded_Admin.str_UninstallPluginLink_1)){return confirm(WP_Table_Reloaded_Admin.str_UninstallPluginLink_2)}else{return false}});d("a.cf_shortcode_link").click(function(){var m=prompt(WP_Table_Reloaded_Admin.str_CFShortcodeMessage,d(this).attr("title"));return false});d("a.table_shortcode_link").click(function(){var m=prompt(WP_Table_Reloaded_Admin.str_TableShortcodeMessage,d(this).attr("title"));return false});d(".postbox h3, .postbox .handlediv").click(function(){d(d(this).parent().get(0)).toggleClass("closed")});var l=false;function e(){l=true;d("#wp_table_reloaded_edit_table").find("#table_name, textarea").unbind("change",e);d("#wp_table_reloaded_edit_table .wp-table-reloaded-options input, #wp_table_reloaded_edit_table .wp-table-reloaded-options select").unbind("change",e)}if(WP_Table_Reloaded_Admin.option_show_exit_warning){window.onbeforeunload=function(){if(l){return WP_Table_Reloaded_Admin.str_saveAlert}};d("#wp_table_reloaded_edit_table input[name='submit[update]'], #wp_table_reloaded_edit_table input[name='submit[save_back]']").click(function(){d("#wp_table_reloaded_edit_table .wp-table-reloaded-options input, #wp_table_reloaded_edit_table .wp-table-reloaded-options select").removeAttr("disabled");window.onbeforeunload=null});d("#wp_table_reloaded_edit_table").find("#table_name, textarea").bind("change",e);d("#wp_table_reloaded_edit_table .wp-table-reloaded-options input, #wp_table_reloaded_edit_table .wp-table-reloaded-options select").bind("change",e)}tb_init("a.help-link");tb_init("a.preview-link");tb_my_position()});function send_to_editor(a){jQuery(edCanvas).val(jQuery(edCanvas).val()+a);tb_remove()}var tb_my_position;(function(a){tb_my_position=function(){var e=a("#TB_window"),d=a(window).width(),c=a(window).height(),b=(720<d)?720:d;if(e.size()){e.width(b-50).height(c-45);a("#TB_iframeContent").width(b-50).height(c-75);e.css({"margin-left":"-"+parseInt(((b-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){e.css({top:"20px","margin-top":"0"})}}return a("a.preview-link").each(function(){var f=a(this).attr("href");if(!f){return}f=f.replace(/&width=[0-9]+/g,"");f=f.replace(/&height=[0-9]+/g,"");a(this).attr("href",f+"&width="+(b-80)+"&height="+(c-85))})};a(window).resize(function(){tb_my_position()})})(jQuery);
admin/admin-style.css CHANGED
@@ -1 +1 @@
1
- #wp-table-reloaded-list .table-id{font-size:12px;font-weight:bold;text-shadow:rgba(255,255,255,0.8) 0 1px 0;}#wp-table-reloaded-list .sorting,#wp-table-reloaded-list .sorting_asc,#wp-table-reloaded-list .sorting_desc{cursor:pointer;white-space:nowrap;}#wp-table-reloaded-list .sorting span{background-repeat:no-repeat;background-position:center;background-image:url('../img/bg.gif');margin-right:-5px;}#wp-table-reloaded-list .sorting_asc span{background-repeat:no-repeat;background-position:center;background-image:url('../img/asc.gif');}#wp-table-reloaded-list .sorting_desc span{background-repeat:no-repeat;background-position:center;background-image:url('../img/desc.gif');}#wp-table-reloaded-list .check-column{width:24px!important;padding:7px 7px 8px 0!important;text-align:right;}#wp-table-reloaded-list .even{background-color:#F9F9F9;}#wp-table-reloaded-list{margin-top:10px;margin-bottom:10px;}#table_contents .row-hidden td,#table_contents .row-hidden th,#table_contents .row-hidden textarea,#table_contents .column-hidden,#table_contents .column-hidden textarea{background-color:#FFE0E0;}#table_contents .focus{height:84px;}#options_custom_css{width:600px;height:100px;}#options_custom_css.focus{height:300px;}.wp-table-reloaded-table-information td{padding:5px 0 5px 0;width:90%;}.wp-table-reloaded-newtable td{padding:5px 0 5px 0;width:85%;}.wp-table-reloaded-table-information th{font-weight:normal;text-align:left;padding:5px 10px 5px 0;vertical-align:middle;width:10%;min-width:130px;}.wp-table-reloaded-newtable,.wp-table-reloaded-table-information,.wp-table-reloaded-table-information input,.wp-table-reloaded-table-information textarea{width:100%;}.wp-table-reloaded-options td{padding:5px 0 5px 0;}.wp-table-reloaded-options th{font-weight:normal;text-align:left;padding:5px 10px 5px 0;vertical-align:middle;}.wp-table-reloaded-data-manipulation{width:100%;}.wp-table-reloaded-data-manipulation td{padding-top:7px!important;padding-bottom:7px!important;line-height:2.2em;}.widefat td{vertical-align:baseline!important;}#table_custom_fields td{vertical-align:middle!important;}#table_contents td{white-space:nowrap;vertical-align:middle!important;}#table_contents th{white-space:nowrap;vertical-align:middle!important;text-align:center;}#table_contents textarea{min-width:180px;width:100%;}#table_contents .table-head td,#table_contents .table-foot td{padding:7px 7px 8px;line-height:1.3em;text-align:center;text-shadow:rgba(255,255,255,0.8) 0 1px 0;font-weight:bold;}#table_contents .check-column{font-weight:bold;padding-left:5px;padding-right:5px;text-align:right;}.no-wrap{white-space:nowrap;}.hide_link,.expand_link{position:absolute;right:10px;font-weight:normal;cursor:pointer;padding:0!important;}#uninstall_plugin_link{color:#BC0B0B;}.postbox h3.hndle{cursor:pointer!important;}div.postbox .expand_link{display:none;}div.closed .expand_link{display:inline!important;}div.closed .hide_link{display:none;}#TB_ajaxContent .wp-table-reloaded{border-collapse:separate;border-spacing:1px;background-color:#CDCDCD;margin:10px 0 15px 0;font-size:8pt;width:100%;text-align:left;}#TB_ajaxContent .wp-table-reloaded th{background-color:#E6EEEE;border:1px solid #FFF;padding:4px;}#TB_ajaxContent .wp-table-reloaded td{color:#3D3D3D;padding:4px;background-color:#FFF;vertical-align:top;}#TB_ajaxContent .wp-table-reloaded .even td{background-color:#FFF;}#TB_ajaxContent .wp-table-reloaded .odd td{background-color:#F0F0F6;}#TB_ajaxContent .wp-table-reloaded .row-hover tr:hover td{background-color:#D0D0D6;}.dataTables_wrapper{clear:both;position:relative;zoom:1;}.dataTables_processing{position:absolute;top:0;left:50%;width:250px;margin-left:-125px;border:1px solid #ddd;text-align:center;color:#999;font-size:11px;padding:2px 0;}.dataTables_length{width:50%;float:left;}.dataTables_filter{width:45%;float:right;text-align:right;}.dataTables_info{width:60%;float:left;}.dataTables_paginate{width:44px;* width:50px;float:right;text-align:right;}.paging_full_numbers{width:400px;height:22px;line-height:22px;}.paging_full_numbers span.paginate_button,.paging_full_numbers span.paginate_active{border:1px solid #aaa;-webkit-border-radius:5px;-moz-border-radius:5px;padding:2px 5px;margin:0 3px;cursor:pointer;*cursor:hand;}.paging_full_numbers span.paginate_button{background-color:#ddd;}.paging_full_numbers span.paginate_button:hover{background-color:#ccc;}.paging_full_numbers span.paginate_active{background-color:#99B3FF;}
1
+ #icon-wp-table-reloaded{background:transparent url('plugin-icon.png') no-repeat;}#wp-table-reloaded-list .table-id{font-size:12px;font-weight:bold;text-shadow:rgba(255,255,255,0.8) 0 1px 0;}#wp-table-reloaded-list .sorting,#wp-table-reloaded-list .sorting_asc,#wp-table-reloaded-list .sorting_desc{cursor:pointer;white-space:nowrap;}#wp-table-reloaded-list .sorting span{background-repeat:no-repeat;background-position:center;background-image:url('../img/bg.gif');margin-right:-5px;}#wp-table-reloaded-list .sorting_asc span{background-repeat:no-repeat;background-position:center;background-image:url('../img/asc.gif');}#wp-table-reloaded-list .sorting_desc span{background-repeat:no-repeat;background-position:center;background-image:url('../img/desc.gif');}#wp-table-reloaded-list .check-column{width:24px!important;padding:7px 7px 8px 0!important;text-align:right;}#wp-table-reloaded-list .even{background-color:#F9F9F9;}#wp-table-reloaded-list{margin-top:10px;margin-bottom:10px;}#table_contents .row-hidden td,#table_contents .row-hidden th,#table_contents .row-hidden textarea,#table_contents .column-hidden,#table_contents .column-hidden textarea{background-color:#FFE0E0;}#table_contents .focus{height:84px;}#options_custom_css{width:600px;height:100px;}#options_custom_css.focus{height:300px;}.wp-table-reloaded-table-information td{padding:5px 0 5px 0;width:90%;}.wp-table-reloaded-newtable td{padding:5px 0 5px 0;width:85%;}.wp-table-reloaded-table-information th{font-weight:normal;text-align:left;padding:5px 10px 5px 0;vertical-align:middle;width:10%;min-width:130px;}.wp-table-reloaded-newtable,.wp-table-reloaded-table-information,.wp-table-reloaded-table-information input,.wp-table-reloaded-table-information textarea{width:100%;}.wp-table-reloaded-options td{padding:5px 0 5px 0;}.wp-table-reloaded-options th{font-weight:normal;text-align:left;padding:5px 10px 5px 0;vertical-align:middle;}.wp-table-reloaded-data-manipulation{width:100%;}.wp-table-reloaded-data-manipulation td{padding-top:7px!important;padding-bottom:7px!important;line-height:2.2em;}.widefat td{vertical-align:baseline!important;}#table_custom_fields td{vertical-align:middle!important;}#table_contents td{white-space:nowrap;vertical-align:middle!important;}#table_contents th{white-space:nowrap;vertical-align:middle!important;text-align:center;}#table_contents textarea{min-width:180px;width:100%;}#table_contents .table-head td,#table_contents .table-foot td{padding:7px 7px 8px;line-height:1.3em;text-align:center;text-shadow:rgba(255,255,255,0.8) 0 1px 0;font-weight:bold;}#table_contents .check-column{font-weight:bold;padding-left:5px;padding-right:5px;text-align:right;}.no-wrap{white-space:nowrap;}.hide_link,.expand_link{position:absolute;right:10px;font-weight:normal;cursor:pointer;padding:0!important;}#uninstall_plugin_link{color:#BC0B0B;}.postbox h3.hndle{cursor:pointer!important;}div.postbox .expand_link{display:none;}div.closed .expand_link{display:inline!important;}div.closed .hide_link{display:none;}#TB_ajaxContent .wp-table-reloaded{border-collapse:separate;border-spacing:1px;background-color:#CDCDCD;margin:10px 0 15px 0;font-size:8pt;width:100%;text-align:left;}#TB_ajaxContent .wp-table-reloaded th{background-color:#E6EEEE;border:1px solid #FFF;padding:4px;}#TB_ajaxContent .wp-table-reloaded td{color:#3D3D3D;padding:4px;background-color:#FFF;vertical-align:top;}#TB_ajaxContent .wp-table-reloaded .even td{background-color:#FFF;}#TB_ajaxContent .wp-table-reloaded .odd td{background-color:#F0F0F6;}#TB_ajaxContent .wp-table-reloaded .row-hover tr:hover td{background-color:#D0D0D6;}.dataTables_wrapper{clear:both;position:relative;zoom:1;}.dataTables_processing{position:absolute;top:0;left:50%;width:250px;margin-left:-125px;border:1px solid #ddd;text-align:center;color:#999;font-size:11px;padding:2px 0;}.dataTables_length{width:50%;float:left;}.dataTables_filter{width:45%;float:right;text-align:right;}.dataTables_info{width:60%;float:left;}.dataTables_paginate{width:44px;* width:50px;float:right;text-align:right;}.paging_full_numbers{width:400px;height:22px;line-height:22px;}.paging_full_numbers span.paginate_button,.paging_full_numbers span.paginate_active{border:1px solid #aaa;-webkit-border-radius:5px;-moz-border-radius:5px;padding:2px 5px;margin:0 3px;cursor:pointer;*cursor:hand;}.paging_full_numbers span.paginate_button{background-color:#ddd;}.paging_full_numbers span.paginate_button:hover{background-color:#ccc;}.paging_full_numbers span.paginate_active{background-color:#99B3FF;}
admin/admin-style.dev.css CHANGED
@@ -3,6 +3,10 @@
3
* PLEASE DO NOT make any changes here! Thank you! *
4
****************************************************************/
5
6
#wp-table-reloaded-list .table-id {
7
font-size:12px;
8
font-weight: bold;
3
* PLEASE DO NOT make any changes here! Thank you! *
4
****************************************************************/
5
6
+ #icon-wp-table-reloaded {
7
+ background: transparent url('plugin-icon.png') no-repeat;
8
+ }
9
+
10
#wp-table-reloaded-list .table-id {
11
font-size:12px;
12
font-weight: bold;
admin/admin-tinymce-buttons-script.dev.js ADDED
@@ -0,0 +1,57 @@
1
+ /***************************************************************
2
+ * This JS file belongs to the Admin part of WP-Table Reloaded! *
3
+ * PLEASE DO NOT make any changes here! Thank you! *
4
+ ***************************************************************/
5
+
6
+ jQuery(document).ready(function($){
7
+
8
+ function wp_table_reloaded_tinymce_button_click() {
9
+ var title = 'WP-Table Reloaded';
10
+ var url = WP_Table_Reloaded_Editor_Button.str_EditorButtonAjaxURL;
11
+
12
+ tb_show( title, url, false );
13
+
14
+ $( '#TB_ajaxContent' ).width( 'auto' ).height( '94.5%' )
15
+ .click( function(event) {
16
+ var $target = $(event.target);
17
+ if ( $target.is( 'a.send_table_to_editor' ) ) {
18
+ tinyMCE.execCommand( 'mceInsertContent', 0, '[table id=' + $target.attr( 'title' ) + ' /]' );
19
+ tb_remove();
20
+ }
21
+ return false;
22
+ } );
23
+
24
+ return false;
25
+ }
26
+
27
+ // tinymce.PluginManager.requireLangPack('table');
28
+ tinymce.create( 'tinymce.plugins.TablePlugin', {
29
+ init : function(ed, url) {
30
+ ed.addCommand( 'mceTableInsert', function() {
31
+ wp_table_reloaded_tinymce_button_click();
32
+ } );
33
+ ed.addButton( 'table', {
34
+ title : WP_Table_Reloaded_Editor_Button.str_EditorButtonTitle,
35
+ cmd : 'mceTableInsert',
36
+ image : url + '/plugin-editor-button.png'
37
+ } );
38
+ ed.onNodeChange.add( function(ed, cm, n) {
39
+ cm.setActive( 'table', n.nodeName == 'IMG' );
40
+ } );
41
+ },
42
+ createControl : function(n, cm) {
43
+ return null;
44
+ },
45
+ getInfo : function() {
46
+ return {
47
+ longname : 'WP-Table Reloaded',
48
+ author : 'Tobias B&auml;thge',
49
+ authorurl : 'http://tobias.baethge.com/',
50
+ infourl : 'http://tobias.baethge.com/wordpress-plugins/wp-table-reloaded-english/',
51
+ version : '1.7'
52
+ };
53
+ }
54
+ });
55
+ tinymce.PluginManager.add( 'table', tinymce.plugins.TablePlugin );
56
+
57
+ });
admin/admin-tinymce-buttons-script.js ADDED
@@ -0,0 +1 @@
1
+ jQuery(document).ready(function(b){function a(){var d="WP-Table Reloaded";var c=WP_Table_Reloaded_Editor_Button.str_EditorButtonAjaxURL;tb_show(d,c,false);b("#TB_ajaxContent").width("auto").height("94.5%").click(function(f){var e=b(f.target);if(e.is("a.send_table_to_editor")){tinyMCE.execCommand("mceInsertContent",0,"[table id="+e.attr("title")+" /]");tb_remove()}return false});return false}tinymce.create("tinymce.plugins.TablePlugin",{init:function(c,d){c.addCommand("mceTableInsert",function(){a()});c.addButton("table",{title:WP_Table_Reloaded_Editor_Button.str_EditorButtonTitle,cmd:"mceTableInsert",image:d+"/plugin-editor-button.png"});c.onNodeChange.add(function(f,e,g){e.setActive("table",g.nodeName=="IMG")})},createControl:function(d,c){return null},getInfo:function(){return{longname:"WP-Table Reloaded",author:"Tobias B&auml;thge",authorurl:"http://tobias.baethge.com/",infourl:"http://tobias.baethge.com/wordpress-plugins/wp-table-reloaded-english/",version:"1.7"}}});tinymce.PluginManager.add("table",tinymce.plugins.TablePlugin)});
admin/plugin-editor-button.png ADDED
Binary file
admin/plugin-icon-small.png ADDED
Binary file
admin/plugin-icon.png ADDED
Binary file
classes/helper.class.php CHANGED
@@ -24,11 +24,11 @@ class WP_Table_Reloaded_Helper {
24
25
// ###################################################################################################################
26
function print_page_header( $text = 'WP-Table Reloaded' ) {
27
- echo <<<TEXT
28
- <div class="wrap">
29
- <h2>{$text}</h2>
30
- <div id="poststuff">
31
- TEXT;
32
}
33
34
// ###################################################################################################################
@@ -101,12 +101,12 @@ TEXT;
101
function help_button( $id ) {
102
$help = array(
103
'colspan' => array(
104
- 'text' => __( 'Table cells can span across more than one column or row.', WP_TABLE_RELOADED_TEXTDOMAIN ) . '<br/><br/>' . __( 'Combining consecutive cells within the same row is called "colspanning".', WP_TABLE_RELOADED_TEXTDOMAIN ) . '<br/><br/>' . __( 'To combine cells, add the keyword #colspan# to the cell to the right of the one with the content for the combined cell by using the corresponding button.', WP_TABLE_RELOADED_TEXTDOMAIN ) . '<br/><br/>' . __( 'Repeat this to add the keyword to all cells that shall be connected.', WP_TABLE_RELOADED_TEXTDOMAIN ),
105
'height' => 200,
106
'width' => 300
107
),
108
'rowspan' => array(
109
- 'text' => __( 'Table cells can span across more than one column or row.', WP_TABLE_RELOADED_TEXTDOMAIN ) . '<br/><br/>' . __( 'Combining consecutive cells within the same column is called "rowspanning".', WP_TABLE_RELOADED_TEXTDOMAIN ) . '<br/><br/>' . __( 'To combine cells, add the keyword #rowspan# to the cell below the one with the content for the combined cell by using the corresponding button.', WP_TABLE_RELOADED_TEXTDOMAIN ) . '<br/><br/>' . __( 'Repeat this to add the keyword to all cells that shall be connected.', WP_TABLE_RELOADED_TEXTDOMAIN ),
110
'height' => 200,
111
'width' => 300
112
)
24
25
// ###################################################################################################################
26
function print_page_header( $text = 'WP-Table Reloaded' ) {
27
+ echo '<div class="wrap">';
28
+ if ( function_exists( 'screen_icon' ) ) // it does not for our pseudo-AJAX requests
29
+ screen_icon( 'wp-table-reloaded' );
30
+ echo "<h2>{$text}</h2>";
31
+ echo '<div id="poststuff">';
32
}
33
34
// ###################################################################################################################
101
function help_button( $id ) {
102
$help = array(
103
'colspan' => array(
104
+ 'text' => __( 'Table cells can span across more than one column or row.', WP_TABLE_RELOADED_TEXTDOMAIN ) . '<br/><br/>' . __( 'Combining consecutive cells within the same row is called "colspanning".', WP_TABLE_RELOADED_TEXTDOMAIN ) . '<br/><br/>' . __( 'To combine cells, add the keyword #colspan# to the cell to the right of the one with the content for the combined cell by using the corresponding button.', WP_TABLE_RELOADED_TEXTDOMAIN ) . '<br/><br/>' . __( 'Repeat this to add the keyword to all cells that shall be connected.', WP_TABLE_RELOADED_TEXTDOMAIN ) . '<br/><br/>' . __( 'Be aware that the JavaScript libraries will not work on tables which have combined cells.', WP_TABLE_RELOADED_TEXTDOMAIN ),
105
'height' => 200,
106
'width' => 300
107
),
108
'rowspan' => array(
109
+ 'text' => __( 'Table cells can span across more than one column or row.', WP_TABLE_RELOADED_TEXTDOMAIN ) . '<br/><br/>' . __( 'Combining consecutive cells within the same column is called "rowspanning".', WP_TABLE_RELOADED_TEXTDOMAIN ) . '<br/><br/>' . __( 'To combine cells, add the keyword #rowspan# to the cell below the one with the content for the combined cell by using the corresponding button.', WP_TABLE_RELOADED_TEXTDOMAIN ) . '<br/><br/>' . __( 'Repeat this to add the keyword to all cells that shall be connected.', WP_TABLE_RELOADED_TEXTDOMAIN ) . '<br/><br/>' . __( 'Be aware that the JavaScript libraries will not work on tables which have combined cells.', WP_TABLE_RELOADED_TEXTDOMAIN ),
110
'height' => 200,
111
'width' => 300
112
)
controllers/controller-admin.php CHANGED
@@ -199,22 +199,22 @@ class WP_Table_Reloaded_Controller_Admin extends WP_Table_Reloaded_Controller_Ba
199
$display_name = 'WP-Table Reloaded'; // the name that is displayed in the admin menu on the left
200
$display_name = apply_filters( 'wp_table_reloaded_plugin_display_name', $display_name ); // can be filtered to something shorter maybe
201
202
- if ( isset( $_POST['options']['admin_menu_parent_page'] ) )
203
- $admin_menu_page = $_POST['options']['admin_menu_parent_page'];
204
- else
205
- $admin_menu_page = $this->options['admin_menu_parent_page'];
206
- $admin_menu_page = apply_filters( 'wp_table_reloaded_admin_menu_parent_page', $admin_menu_page ); // plugins may filter/change this though
207
if ( !in_array( $admin_menu_page, $this->possible_admin_menu_parent_pages ) )
208
$admin_menu_page = 'tools.php';
209
210
- // top-level menu is created in different function, all others are created with the filename as a parameter
211
- if ( 'top-level' == $admin_menu_page ) {
212
- $this->hook = add_menu_page( 'WP-Table Reloaded', $display_name, $min_capability, $this->page_slug, array( &$this, 'show_manage_page' ) );
213
- $this->page_url = 'admin.php';
214
- } else {
215
$this->hook = add_submenu_page( $admin_menu_page, 'WP-Table Reloaded', $display_name, $min_capability, $this->page_slug, array( &$this, 'show_manage_page' ) );
216
- $this->page_url = $admin_menu_page;
217
- }
218
219
add_action( 'load-' . $this->hook, array( &$this, 'load_manage_page' ) );
220
}
@@ -258,20 +258,21 @@ class WP_Table_Reloaded_Controller_Admin extends WP_Table_Reloaded_Controller_Ba
258
'en_US' => __( 'English', WP_TABLE_RELOADED_TEXTDOMAIN ),
259
'es_ES' => __( 'Spanish', WP_TABLE_RELOADED_TEXTDOMAIN ),
260
'fi_FI' => __( 'Finnish', WP_TABLE_RELOADED_TEXTDOMAIN ),
261
'hi_IN' => __( 'Hindi', WP_TABLE_RELOADED_TEXTDOMAIN ),
262
'it_IT' => __( 'Italian', WP_TABLE_RELOADED_TEXTDOMAIN ),
263
'ja' => __( 'Japanese', WP_TABLE_RELOADED_TEXTDOMAIN ),
264
'pt_BR' => __( 'Brazilian Portuguese', WP_TABLE_RELOADED_TEXTDOMAIN ),
265
'sk_SK' => __( 'Slovak', WP_TABLE_RELOADED_TEXTDOMAIN ),
266
- 'sv_SE' => __( 'Swedish', WP_TABLE_RELOADED_TEXTDOMAIN )
267
- /* // the following will (as of currently) be made inactive because they are not up-to-date
268
'sq_AL' => __( 'Albanian', WP_TABLE_RELOADED_TEXTDOMAIN ),
269
'by_BY' => __( 'Belorussian', WP_TABLE_RELOADED_TEXTDOMAIN ),
270
- 'et' => __( 'Estonian', WP_TABLE_RELOADED_TEXTDOMAIN ),
271
- 'fr_FR' => __( 'French', WP_TABLE_RELOADED_TEXTDOMAIN ),
272
'pl_PL' => __( 'Polish', WP_TABLE_RELOADED_TEXTDOMAIN ),
273
- 'ru_RU' => __( 'Russian', WP_TABLE_RELOADED_TEXTDOMAIN ),
274
- 'tr_TR' => __( 'Turkish', WP_TABLE_RELOADED_TEXTDOMAIN )
275
*/
276
);
277
asort( $this->available_plugin_languages );
@@ -299,7 +300,7 @@ class WP_Table_Reloaded_Controller_Admin extends WP_Table_Reloaded_Controller_Ba
299
$messages = array(
300
0 => false,
301
1 => sprintf( __( 'Welcome to WP-Table Reloaded %s. If you encounter any questions or problems, please refer to the <a href="%s">FAQ</a>, the <a href="%s">documentation</a>, and the <a href="%s">support</a> section.', WP_TABLE_RELOADED_TEXTDOMAIN ), $this->options['installed_version'], 'http://tobias.baethge.com/go/wp-table-reloaded/faq/', 'http://tobias.baethge.com/go/wp-table-reloaded/documentation/', 'http://tobias.baethge.com/go/wp-table-reloaded/support/' ),
302
- 2 => sprintf( __( 'Thank you for upgrading to WP-Table Reloaded %s.', WP_TABLE_RELOADED_TEXTDOMAIN ), $this->options['installed_version'] ) . ' ' . sprintf( __( 'Please read the <a href="%s">release announcement</a> for more information.', WP_TABLE_RELOADED_TEXTDOMAIN ), "http://tobias.baethge.com/go/wp-table-reloaded/release-announcement/{$this->options['installed_version']}/" ) . '<br/>' . sprintf( __( 'If you like the new features and enhancements, I would appreciate a small <a href="%s">donation</a>. Thank you.', WP_TABLE_RELOADED_TEXTDOMAIN ), 'http://tobias.baethge.com/go/wp-table-reloaded/donate/' )
303
);
304
$message = ( isset( $messages[ $this->options['show_welcome_message'] ] ) ) ? $messages[ $this->options['show_welcome_message'] ] : false;
305
if ( $message ) {
@@ -396,6 +397,7 @@ class WP_Table_Reloaded_Controller_Admin extends WP_Table_Reloaded_Controller_Ba
396
$table['options']['datatables_filter'] = isset( $_POST['table']['options']['datatables_filter'] );
397
$table['options']['datatables_info'] = isset( $_POST['table']['options']['datatables_info'] );
398
$table['options']['datatables_tabletools'] = isset( $_POST['table']['options']['datatables_tabletools'] );
399
// $table['options']['datatables_customcommands'] is an input type=text field that is always submitted
400
// $table['options']['print_name|description_position'] are select fields that are always submitted
401
@@ -878,7 +880,7 @@ class WP_Table_Reloaded_Controller_Admin extends WP_Table_Reloaded_Controller_Ba
878
$this->load_view( 'import' );
879
return;
880
}
881
-
882
// do import with the config set above
883
$this->import_instance->import_format = $_POST['import_format'];
884
$this->import_instance->import_table();
@@ -889,22 +891,21 @@ class WP_Table_Reloaded_Controller_Admin extends WP_Table_Reloaded_Controller_Ba
889
$this->import_instance->unlink_uploaded_file();
890
891
if ( isset( $_POST['import_addreplace'] ) && isset( $_POST['import_addreplace_table'] ) && ( 'replace' == $_POST['import_addreplace'] ) && $this->table_exists( $_POST['import_addreplace_table'] ) ) {
892
- $existing_table = $this->load_table( $_POST['import_addreplace_table'] );
893
- $table = array_merge( $existing_table, $imported_table );
894
$success_message = sprintf( __( 'Table %s (%s) replaced successfully.', WP_TABLE_RELOADED_TEXTDOMAIN ), $this->helper->safe_output( $table['name'] ), $this->helper->safe_output( $table['id'] ) );
895
- unset( $existing_table );
896
} else {
897
$table = array_merge( $this->default_table, $imported_table );
898
$table['id'] = $this->get_new_table_id();
899
$success_message = _n( 'Table imported successfully.', 'Tables imported successfully.', 1, WP_TABLE_RELOADED_TEXTDOMAIN );
900
}
901
902
- $rows = count( $table['data'] );
903
- $cols = (0 < $rows) ? count( $table['data'][0] ) : 0;
904
- $rows = ( 0 < $rows ) ? $rows : 1;
905
- $cols = ( 0 < $cols ) ? $cols : 1;
906
- $table['visibility']['rows'] = array_fill( 0, $rows, false );
907
- $table['visibility']['columns'] = array_fill( 0, $cols, false );
908
909
if ( !$error ) {
910
$this->save_table( $table );
@@ -939,14 +940,14 @@ class WP_Table_Reloaded_Controller_Admin extends WP_Table_Reloaded_Controller_Ba
939
$this->load_view( 'edit', compact( 'table_id' ) );
940
} elseif ( isset( $_POST['import_wp_table_reloaded_dump_file'] ) ) {
941
check_admin_referer( $this->get_nonce( 'import_dump' ) );
942
-
943
// check if user is admin
944
if ( !current_user_can( 'manage_options' ) ) {
945
$this->helper->print_header_message( __( 'You do not have sufficient rights to perform this action.', WP_TABLE_RELOADED_TEXTDOMAIN ) );
946
$this->load_view( 'options' );
947
return;
948
}
949
-
950
// check if file was uploaded
951
if ( empty( $_FILES['dump_file']['tmp_name'] ) ) {
952
$this->helper->print_header_message( __( 'You did not upload a WP-Table Reloaded dump file.', WP_TABLE_RELOADED_TEXTDOMAIN ) );
@@ -1088,12 +1089,13 @@ class WP_Table_Reloaded_Controller_Admin extends WP_Table_Reloaded_Controller_Ba
1088
else
1089
$this->options['plugin_language'] = 'auto';
1090
// admin menu parent page
1091
if ( in_array( $new_options['admin_menu_parent_page'], $this->possible_admin_menu_parent_pages ) )
1092
$this->options['admin_menu_parent_page'] = $new_options['admin_menu_parent_page'];
1093
else
1094
$this->options['admin_menu_parent_page'] = 'tools.php';
1095
- // adjust $this->page_url, so that next page load will work
1096
- $this->page_url = ( 'top-level' == $this->options['admin_menu_parent_page'] ) ? 'admin.php' : $this->options['admin_menu_parent_page'] ;
1097
// user access to plugin
1098
if ( in_array( $new_options['user_access_plugin'], array( 'admin', 'editor', 'author', 'contributor' ) ) )
1099
$this->options['user_access_plugin'] = $new_options['user_access_plugin'];
@@ -1115,7 +1117,13 @@ class WP_Table_Reloaded_Controller_Admin extends WP_Table_Reloaded_Controller_Ba
1115
1116
$this->update_options();
1117
1118
- $this->helper->print_header_message( __( 'Options saved successfully.', WP_TABLE_RELOADED_TEXTDOMAIN ) );
1119
}
1120
$this->load_view( 'options' );
1121
}
@@ -1239,22 +1247,24 @@ class WP_Table_Reloaded_Controller_Admin extends WP_Table_Reloaded_Controller_Ba
1239
function load_view( $name, $params = array(), $print_submenu_navigation = true ) {
1240
extract( $params );
1241
1242
- // these views also need the complete table, besides the parameters
1243
- if ( in_array( $name, array( 'edit', 'ajax_preview' ) ) )
1244
- $table = $this->load_table( $table_id );
1245
-
1246
$headlines = array(
1247
'list' => __( 'List of Tables', WP_TABLE_RELOADED_TEXTDOMAIN ) . ' &lsaquo; ' . __( 'WP-Table Reloaded', WP_TABLE_RELOADED_TEXTDOMAIN ),
1248
'add' => __( 'Add new Table', WP_TABLE_RELOADED_TEXTDOMAIN ),
1249
- 'edit' => sprintf( __( 'Edit Table &quot;%s&quot; (ID %s)', WP_TABLE_RELOADED_TEXTDOMAIN ), $this->helper->safe_output( $table['name'] ), $this->helper->safe_output( $table['id'] ) ),
1250
'import' => __( 'Import a Table', WP_TABLE_RELOADED_TEXTDOMAIN ),
1251
'export' => __( 'Export a Table', WP_TABLE_RELOADED_TEXTDOMAIN ),
1252
'options' => __( 'Plugin Options', WP_TABLE_RELOADED_TEXTDOMAIN ) . ' &lsaquo; ' . __( 'WP-Table Reloaded', WP_TABLE_RELOADED_TEXTDOMAIN ),
1253
'about' => __( 'About WP-Table Reloaded', WP_TABLE_RELOADED_TEXTDOMAIN ),
1254
'uninstall' => __( 'WP-Table Reloaded', WP_TABLE_RELOADED_TEXTDOMAIN ),
1255
- 'ajax_list' => __( 'List of Tables', WP_TABLE_RELOADED_TEXTDOMAIN ),
1256
- 'ajax_preview' => sprintf( __( 'Preview of Table &quot;%s&quot; (ID %s)', WP_TABLE_RELOADED_TEXTDOMAIN ), $this->helper->safe_output( $table['name'] ), $this->helper->safe_output( $table['id'] ) )
1257
);
1258
$headline = isset( $headlines[ $name ] ) ? $headlines[ $name ] : '';
1259
1260
$this->helper->print_page_header( $headline );
@@ -1539,6 +1549,14 @@ class WP_Table_Reloaded_Controller_Admin extends WP_Table_Reloaded_Controller_Ba
1539
if ( version_compare( $this->options['installed_version'] , '1.4.9', '<' ) )
1540
$new_options['tablesorter_script'] = ( isset( $this->options['use_tablesorter_extended'] ) && $this->options['use_tablesorter_extended'] ) ? 'tablesorter_extended' : 'tablesorter';
1541
1542
// 3. step: update installed version number, empty update message cache, set welcome message
1543
$new_options['installed_version'] = WP_TABLE_RELOADED_PLUGIN_VERSION;
1544
$new_options['update_message'] = array();
@@ -1678,7 +1696,7 @@ class WP_Table_Reloaded_Controller_Admin extends WP_Table_Reloaded_Controller_Ba
1678
'str_DataManipulationLinkInsertURL' => __( 'URL of link to insert', WP_TABLE_RELOADED_TEXTDOMAIN ),
1679
'str_DataManipulationLinkInsertText' => __( 'Text of link', WP_TABLE_RELOADED_TEXTDOMAIN ),
1680
'str_DataManipulationLinkInsertExplain' => __( 'To insert the following HTML code for a link into a cell, just click the cell after closing this dialog.', WP_TABLE_RELOADED_TEXTDOMAIN ),
1681
- 'str_DataManipulationImageInsertThickbox' => __( 'To insert an image, click the cell into which you want to insert the image.', WP_TABLE_RELOADED_TEXTDOMAIN ) . "\n" . __( 'The Media Library will open, from which you can select the desired image or insert the image URL.', WP_TABLE_RELOADED_TEXTDOMAIN ) . "\n" . sprintf( __( 'Click the &quot;%s&quot; button to insert the image.', WP_TABLE_RELOADED_TEXTDOMAIN ), esc_js( __( 'Insert into Post' ) ) ),
1682
'str_DataManipulationAddColspan' => __( 'To combine cells within a row, click into the cell to the right of the cell that has the content the combined cells shall have.', WP_TABLE_RELOADED_TEXTDOMAIN ),
1683
'str_DataManipulationAddRowspan' => __( 'To combine cells within a column, click into the cell below the cell that has the content the combined cells shall have.', WP_TABLE_RELOADED_TEXTDOMAIN ),
1684
'str_BulkCopyTablesLink' => __( 'Do you want to copy the selected tables?', WP_TABLE_RELOADED_TEXTDOMAIN ),
@@ -1743,12 +1761,45 @@ class WP_Table_Reloaded_Controller_Admin extends WP_Table_Reloaded_Controller_Ba
1743
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '.dev' : '';
1744
$jsfile = "admin/admin-editor-buttons-script{$suffix}.js";
1745
1746
wp_enqueue_script( 'wp-table-reloaded-editor-button-js', plugins_url( $jsfile, WP_TABLE_RELOADED__FILE__ ), array( 'jquery', 'thickbox', 'media-upload' ), $this->options['installed_version'], true );
1747
- wp_localize_script( 'wp-table-reloaded-editor-button-js', 'WP_Table_Reloaded_Admin', array(
1748
'str_EditorButtonCaption' => __( 'Table', WP_TABLE_RELOADED_TEXTDOMAIN ),
1749
'str_EditorButtonAjaxURL' => $ajax_url,
1750
- 'l10n_print_after' => 'try{convertEntities(WP_Table_Reloaded_Admin);}catch(e){};'
1751
) );
1752
}
1753
1754
/**
199
$display_name = 'WP-Table Reloaded'; // the name that is displayed in the admin menu on the left
200
$display_name = apply_filters( 'wp_table_reloaded_plugin_display_name', $display_name ); // can be filtered to something shorter maybe
201
202
+ $admin_menu_page = apply_filters( 'wp_table_reloaded_admin_menu_parent_page', $this->options['admin_menu_parent_page'] );
203
+ // backward-compatibility for the filter
204
+ if ( 'top-level' == $admin_menu_page )
205
+ $admin_menu_page = 'admin.php';
206
+ // 'edit-pages.php' was renamed to 'edit.php?post_type=page' in WP 3.0
207
+ if ( 'edit-pages.php' == $admin_menu_page && version_compare( $GLOBALS['wp_version'] , '2.9.9', '>' ) )
208
+ $admin_menu_page = 'edit.php?post_type=page';
209
if ( !in_array( $admin_menu_page, $this->possible_admin_menu_parent_pages ) )
210
$admin_menu_page = 'tools.php';
211
212
+ // Top-Level menu is created in different function, all others are created with the filename as a parameter
213
+ if ( 'admin.php' == $admin_menu_page )
214
+ $this->hook = add_menu_page( 'WP-Table Reloaded', $display_name, $min_capability, $this->page_slug, array( &$this, 'show_manage_page' ), plugins_url( 'admin/plugin-icon-small.png', WP_TABLE_RELOADED__FILE__ ) );
215
+ else
216
$this->hook = add_submenu_page( $admin_menu_page, 'WP-Table Reloaded', $display_name, $min_capability, $this->page_slug, array( &$this, 'show_manage_page' ) );
217
+ $this->page_url = $admin_menu_page;
218
219
add_action( 'load-' . $this->hook, array( &$this, 'load_manage_page' ) );
220
}
258
'en_US' => __( 'English', WP_TABLE_RELOADED_TEXTDOMAIN ),
259
'es_ES' => __( 'Spanish', WP_TABLE_RELOADED_TEXTDOMAIN ),
260
'fi_FI' => __( 'Finnish', WP_TABLE_RELOADED_TEXTDOMAIN ),
261
+ 'fr_FR' => __( 'French', WP_TABLE_RELOADED_TEXTDOMAIN ),
262
'hi_IN' => __( 'Hindi', WP_TABLE_RELOADED_TEXTDOMAIN ),
263
'it_IT' => __( 'Italian', WP_TABLE_RELOADED_TEXTDOMAIN ),
264
'ja' => __( 'Japanese', WP_TABLE_RELOADED_TEXTDOMAIN ),
265
'pt_BR' => __( 'Brazilian Portuguese', WP_TABLE_RELOADED_TEXTDOMAIN ),
266
+ 'ru_RU' => __( 'Russian', WP_TABLE_RELOADED_TEXTDOMAIN ),
267
'sk_SK' => __( 'Slovak', WP_TABLE_RELOADED_TEXTDOMAIN ),
268
+ 'sv_SE' => __( 'Swedish', WP_TABLE_RELOADED_TEXTDOMAIN ),
269
+ 'ua_UA' => __( 'Ukrainian', WP_TABLE_RELOADED_TEXTDOMAIN ),
270
+ 'zh_CN' => __( 'Chinese (Simplified)', WP_TABLE_RELOADED_TEXTDOMAIN ),
271
+ /* // the following are inactive because they are not up-to-date
272
'sq_AL' => __( 'Albanian', WP_TABLE_RELOADED_TEXTDOMAIN ),
273
'by_BY' => __( 'Belorussian', WP_TABLE_RELOADED_TEXTDOMAIN ),
274
'pl_PL' => __( 'Polish', WP_TABLE_RELOADED_TEXTDOMAIN ),
275
+ 'tr_TR' => __( 'Turkish', WP_TABLE_RELOADED_TEXTDOMAIN ),
276
*/
277
);
278
asort( $this->available_plugin_languages );
300
$messages = array(
301
0 => false,
302
1 => sprintf( __( 'Welcome to WP-Table Reloaded %s. If you encounter any questions or problems, please refer to the <a href="%s">FAQ</a>, the <a href="%s">documentation</a>, and the <a href="%s">support</a> section.', WP_TABLE_RELOADED_TEXTDOMAIN ), $this->options['installed_version'], 'http://tobias.baethge.com/go/wp-table-reloaded/faq/', 'http://tobias.baethge.com/go/wp-table-reloaded/documentation/', 'http://tobias.baethge.com/go/wp-table-reloaded/support/' ),
303
+ 2 => sprintf( __( 'Thank you for upgrading to WP-Table Reloaded %s.', WP_TABLE_RELOADED_TEXTDOMAIN ), $this->options['installed_version'] ) . ' ' . __( 'This version includes several enhancements, like an updated DataTables library, a &quot;Table&quot; button in the toolbar of the visual editor, and several other things.', WP_TABLE_RELOADED_TEXTDOMAIN ) . ' ' . sprintf( __( 'Please read the <a href="%s">release announcement</a> for more information.', WP_TABLE_RELOADED_TEXTDOMAIN ), "http://tobias.baethge.com/go/wp-table-reloaded/release-announcement/{$this->options['installed_version']}/" ) . '<br/>' . sprintf( __( 'If you like the new features and enhancements, I would appreciate a small <a href="%s">donation</a>. Thank you.', WP_TABLE_RELOADED_TEXTDOMAIN ), 'http://tobias.baethge.com/go/wp-table-reloaded/donate/' )
304
);
305
$message = ( isset( $messages[ $this->options['show_welcome_message'] ] ) ) ? $messages[ $this->options['show_welcome_message'] ] : false;
306
if ( $message ) {
397
$table['options']['datatables_filter'] = isset( $_POST['table']['options']['datatables_filter'] );
398
$table['options']['datatables_info'] = isset( $_POST['table']['options']['datatables_info'] );
399
$table['options']['datatables_tabletools'] = isset( $_POST['table']['options']['datatables_tabletools'] );
400
+ $table['options']['datatables_paginate_entries'] = ( is_numeric( $table['options']['datatables_paginate_entries'] ) ) ? absint( $table['options']['datatables_paginate_entries'] ) : $this->default_table['options']['datatables_paginate_entries'];
401
// $table['options']['datatables_customcommands'] is an input type=text field that is always submitted
402
// $table['options']['print_name|description_position'] are select fields that are always submitted
403
880
$this->load_view( 'import' );
881
return;
882
}
883
+
884
// do import with the config set above
885
$this->import_instance->import_format = $_POST['import_format'];
886
$this->import_instance->import_table();
891
$this->import_instance->unlink_uploaded_file();
892
893
if ( isset( $_POST['import_addreplace'] ) && isset( $_POST['import_addreplace_table'] ) && ( 'replace' == $_POST['import_addreplace'] ) && $this->table_exists( $_POST['import_addreplace_table'] ) ) {
894
+ $table = $this->load_table( $_POST['import_addreplace_table'] );
895
+ $table['data'] = $imported_table['data'];
896
$success_message = sprintf( __( 'Table %s (%s) replaced successfully.', WP_TABLE_RELOADED_TEXTDOMAIN ), $this->helper->safe_output( $table['name'] ), $this->helper->safe_output( $table['id'] ) );
897
} else {
898
$table = array_merge( $this->default_table, $imported_table );
899
$table['id'] = $this->get_new_table_id();
900
$success_message = _n( 'Table imported successfully.', 'Tables imported successfully.', 1, WP_TABLE_RELOADED_TEXTDOMAIN );
901
}
902
903
+ unset( $imported_table );
904
+
905
+ foreach ( $table['data'] as $row_idx => $row )
906
+ $table['visibility']['rows'][$row_idx] = isset( $table['visibility']['rows'][$row_idx] ) ? $table['visibility']['rows'][$row_idx] : false;
907
+ foreach ( $table['data'][0] as $col_idx => $col )
908
+ $table['visibility']['columns'][$col_idx] = isset( $table['visibility']['columns'][$col_idx] ) ? $table['visibility']['columns'][$col_idx] : false;
909
910
if ( !$error ) {
911
$this->save_table( $table );
940
$this->load_view( 'edit', compact( 'table_id' ) );
941
} elseif ( isset( $_POST['import_wp_table_reloaded_dump_file'] ) ) {
942
check_admin_referer( $this->get_nonce( 'import_dump' ) );
943
+
944
// check if user is admin
945
if ( !current_user_can( 'manage_options' ) ) {
946
$this->helper->print_header_message( __( 'You do not have sufficient rights to perform this action.', WP_TABLE_RELOADED_TEXTDOMAIN ) );
947
$this->load_view( 'options' );
948
return;
949
}
950
+
951
// check if file was uploaded
952
if ( empty( $_FILES['dump_file']['tmp_name'] ) ) {
953
$this->helper->print_header_message( __( 'You did not upload a WP-Table Reloaded dump file.', WP_TABLE_RELOADED_TEXTDOMAIN ) );
1089
else
1090
$this->options['plugin_language'] = 'auto';
1091
// admin menu parent page
1092
+ $admin_menu_parent_page_changed = ( $this->options['admin_menu_parent_page'] != $new_options['admin_menu_parent_page'] );
1093
if ( in_array( $new_options['admin_menu_parent_page'], $this->possible_admin_menu_parent_pages ) )
1094
$this->options['admin_menu_parent_page'] = $new_options['admin_menu_parent_page'];
1095
else
1096
$this->options['admin_menu_parent_page'] = 'tools.php';
1097
+ // update $this->page_url, so that next page load will work
1098
+ $this->page_url = $this->options['admin_menu_parent_page'] ;
1099
// user access to plugin
1100
if ( in_array( $new_options['user_access_plugin'], array( 'admin', 'editor', 'author', 'contributor' ) ) )
1101
$this->options['user_access_plugin'] = $new_options['user_access_plugin'];
1117
1118
$this->update_options();
1119
1120
+ $message = __( 'Options saved successfully.', WP_TABLE_RELOADED_TEXTDOMAIN );
1121
+ if ( $admin_menu_parent_page_changed ) {
1122
+ $url = $this->get_action_url( array( 'action' => 'options' ), false );
1123
+ $message .= ' ' . sprintf( __( '<a href="%s">Click here to Proceed.</a>', WP_TABLE_RELOADED_TEXTDOMAIN ), $url );
1124
+ }
1125
+
1126
+ $this->helper->print_header_message( $message );
1127
}
1128
$this->load_view( 'options' );
1129
}
1247
function load_view( $name, $params = array(), $print_submenu_navigation = true ) {
1248
extract( $params );
1249
1250
$headlines = array(
1251
'list' => __( 'List of Tables', WP_TABLE_RELOADED_TEXTDOMAIN ) . ' &lsaquo; ' . __( 'WP-Table Reloaded', WP_TABLE_RELOADED_TEXTDOMAIN ),
1252
'add' => __( 'Add new Table', WP_TABLE_RELOADED_TEXTDOMAIN ),
1253
'import' => __( 'Import a Table', WP_TABLE_RELOADED_TEXTDOMAIN ),
1254
'export' => __( 'Export a Table', WP_TABLE_RELOADED_TEXTDOMAIN ),
1255
'options' => __( 'Plugin Options', WP_TABLE_RELOADED_TEXTDOMAIN ) . ' &lsaquo; ' . __( 'WP-Table Reloaded', WP_TABLE_RELOADED_TEXTDOMAIN ),
1256
'about' => __( 'About WP-Table Reloaded', WP_TABLE_RELOADED_TEXTDOMAIN ),
1257
'uninstall' => __( 'WP-Table Reloaded', WP_TABLE_RELOADED_TEXTDOMAIN ),
1258
+ 'ajax_list' => __( 'List of Tables', WP_TABLE_RELOADED_TEXTDOMAIN )
1259
);
1260
+
1261
+ // these views also need the complete table, besides the parameters
1262
+ if ( in_array( $name, array( 'edit', 'ajax_preview' ) ) ) {
1263
+ $table = $this->load_table( $table_id );
1264
+ $headlines['edit'] = sprintf( __( 'Edit Table &quot;%s&quot; (ID %s)', WP_TABLE_RELOADED_TEXTDOMAIN ), $this->helper->safe_output( $table['name'] ), $this->helper->safe_output( $table['id'] ) );
1265
+ $headlines['ajax_preview'] = sprintf( __( 'Preview of Table &quot;%s&quot; (ID %s)', WP_TABLE_RELOADED_TEXTDOMAIN ), $this->helper->safe_output( $table['name'] ), $this->helper->safe_output( $table['id'] ) );
1266
+ }
1267
+
1268
$headline = isset( $headlines[ $name ] ) ? $headlines[ $name ] : '';
1269
1270
$this->helper->print_page_header( $headline );
1549
if ( version_compare( $this->options['installed_version'] , '1.4.9', '<' ) )
1550
$new_options['tablesorter_script'] = ( isset( $this->options['use_tablesorter_extended'] ) && $this->options['use_tablesorter_extended'] ) ? 'tablesorter_extended' : 'tablesorter';
1551
1552
+ // 2d., 'edit-pages.php' was renamed to 'edit.php?post_type=page' in WP 3.0
1553
+ if ( 'edit-pages.php' == $this->options['admin_menu_parent_page'] && version_compare( $GLOBALS['wp_version'] , '2.9.9', '>' ) )
1554
+ $new_options['admin_menu_parent_page'] = 'edit.php?post_type=page';
1555
+
1556
+ // 2e., 'top-level' was renamed to 'admin.php' (internally)
1557
+ if ( 'top-level' == $this->options['admin_menu_parent_page'] )
1558
+ $new_options['admin_menu_parent_page'] = 'admin.php';
1559
+
1560
// 3. step: update installed version number, empty update message cache, set welcome message
1561
$new_options['installed_version'] = WP_TABLE_RELOADED_PLUGIN_VERSION;
1562
$new_options['update_message'] = array();
1696
'str_DataManipulationLinkInsertURL' => __( 'URL of link to insert', WP_TABLE_RELOADED_TEXTDOMAIN ),
1697
'str_DataManipulationLinkInsertText' => __( 'Text of link', WP_TABLE_RELOADED_TEXTDOMAIN ),
1698
'str_DataManipulationLinkInsertExplain' => __( 'To insert the following HTML code for a link into a cell, just click the cell after closing this dialog.', WP_TABLE_RELOADED_TEXTDOMAIN ),
1699
+ 'str_DataManipulationImageInsertThickbox' => __( 'To insert an image, click &quot;OK&quot; and then click into the cell into which you want to insert the image.', WP_TABLE_RELOADED_TEXTDOMAIN ) . "\n" . __( 'The Media Library will open, from which you can select the desired image or insert the image URL.', WP_TABLE_RELOADED_TEXTDOMAIN ) . "\n" . sprintf( __( 'Click the &quot;%s&quot; button to insert the image.', WP_TABLE_RELOADED_TEXTDOMAIN ), esc_js( __( 'Insert into Post' ) ) ),
1700
'str_DataManipulationAddColspan' => __( 'To combine cells within a row, click into the cell to the right of the cell that has the content the combined cells shall have.', WP_TABLE_RELOADED_TEXTDOMAIN ),
1701
'str_DataManipulationAddRowspan' => __( 'To combine cells within a column, click into the cell below the cell that has the content the combined cells shall have.', WP_TABLE_RELOADED_TEXTDOMAIN ),
1702
'str_BulkCopyTablesLink' => __( 'Do you want to copy the selected tables?', WP_TABLE_RELOADED_TEXTDOMAIN ),
1761
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '.dev' : '';
1762
$jsfile = "admin/admin-editor-buttons-script{$suffix}.js";
1763
1764
+ // HTML editor integration
1765
wp_enqueue_script( 'wp-table-reloaded-editor-button-js', plugins_url( $jsfile, WP_TABLE_RELOADED__FILE__ ), array( 'jquery', 'thickbox', 'media-upload' ), $this->options['installed_version'], true );
1766
+ wp_localize_script( 'wp-table-reloaded-editor-button-js', 'WP_Table_Reloaded_Editor_Button', array(
1767
'str_EditorButtonCaption' => __( 'Table', WP_TABLE_RELOADED_TEXTDOMAIN ),
1768
+ 'str_EditorButtonTitle' => __( 'Insert a Table', WP_TABLE_RELOADED_TEXTDOMAIN ),
1769
'str_EditorButtonAjaxURL' => $ajax_url,
1770
+ 'l10n_print_after' => 'try{convertEntities(WP_Table_Reloaded_Editor_Button);}catch(e){};'
1771
) );
1772
+
1773
+ // TinyMCE integration
1774
+ if ( user_can_richedit() ) {
1775
+ add_filter( 'mce_external_plugins', array( &$this, 'add_tinymce_plugin' ) );
1776
+ add_filter( 'mce_buttons', array( &$this, 'add_tinymce_button' ) );
1777
+ }
1778
+ }
1779
+
1780
+ /**
1781
+ * Add "Table" button and separator to the TinyMCE toolbar
1782
+ *
1783
+ * @param array $buttons Current set of buttons in the TinyMCE toolbar
1784
+ * @return array Current set of buttons in the TinyMCE toolbar, including "Table" button
1785
+ */
1786
+ function add_tinymce_button( $buttons ) {
1787
+ $buttons[] = '|';
1788
+ $buttons[] = 'table';
1789
+ return $buttons;
1790
+ }
1791
+
1792
+ /**
1793
+ * Register "Table" button plugin to TinyMCE
1794
+ *
1795
+ * @param array $plugins Current set of registered TinyMCE plugins
1796
+ * @return array Current set of registered TinyMCE plugins, including "Table" button plugin
1797
+ */
1798
+ function add_tinymce_plugin( $plugins ) {
1799
+ $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '.dev' : '';
1800
+ $jsfile = "admin/admin-tinymce-buttons-script{$suffix}.js";
1801
+ $plugins['table'] = plugins_url( $jsfile, WP_TABLE_RELOADED__FILE__ );
1802
+ return $plugins;
1803
}
1804
1805
/**
controllers/controller-base.php CHANGED
@@ -62,6 +62,7 @@ class WP_Table_Reloaded_Controller_Base {
62
'use_tablesorter' => true,
63
'datatables_sort' => true,
64
'datatables_paginate' => true,
65
'datatables_lengthchange' => true,
66
'datatables_filter' => true,
67
'datatables_info' => true,
@@ -81,7 +82,7 @@ class WP_Table_Reloaded_Controller_Base {
81
* List of allowed places for the menu item of WP-Table Reloaded in the WP admin menu
82
* @var array
83
*/
84
- var $possible_admin_menu_parent_pages = array( 'tools.php', 'top-level', 'edit.php', 'edit-pages.php', 'plugins.php', 'index.php', 'options-general.php' );
85
86
/**
87
* PHP4 class constructor, calls the PHP5 class constructor __construct()
62
'use_tablesorter' => true,
63
'datatables_sort' => true,
64
'datatables_paginate' => true,
65
+ 'datatables_paginate_entries' => 10,
66
'datatables_lengthchange' => true,
67
'datatables_filter' => true,
68
'datatables_info' => true,
82
* List of allowed places for the menu item of WP-Table Reloaded in the WP admin menu
83
* @var array
84
*/
85
+ var $possible_admin_menu_parent_pages = array( 'tools.php', 'admin.php', 'edit.php', 'edit.php?post_type=page', 'edit-pages.php', 'plugins.php', 'index.php', 'options-general.php' );
86
87
/**
88
* PHP4 class constructor, calls the PHP5 class constructor __construct()
controllers/controller-frontend.php CHANGED
@@ -171,6 +171,7 @@ class WP_Table_Reloaded_Controller_Frontend extends WP_Table_Reloaded_Controller
171
'use_tablesorter' => -1,
172
'datatables_sort' => -1,
173
'datatables_paginate' => -1,
174
'datatables_lengthchange' => -1,
175
'datatables_filter' => -1,
176
'datatables_info' => -1,
@@ -202,23 +203,6 @@ class WP_Table_Reloaded_Controller_Frontend extends WP_Table_Reloaded_Controller
202
return $message;
203
}
204
205
- // explode from string to array
206
- $atts['column_widths'] = ( !empty( $atts['column_widths'] ) ) ? explode( '|', $atts['column_widths'] ) : array();
207
-
208
- // rows/columns are indexed from 0 internally, but from 1 externally, thus substract 1 from each value
209
- $atts['show_rows'] = ( !empty( $atts['show_rows'] ) ) ? explode( ',', $atts['show_rows'] ) : array();
210
- foreach ( $atts['show_rows'] as $key => $value )
211
- $atts['show_rows'][ $key ] = (string) ( $value - 1 );
212
- $atts['show_columns'] = ( !empty( $atts['show_columns'] ) ) ? explode( ',', $atts['show_columns'] ) : array();
213
- foreach ( $atts['show_columns'] as $key => $value )
214
- $atts['show_columns'][ $key ] = (string) ( $value - 1 );
215
- $atts['hide_rows'] = ( !empty( $atts['hide_rows'] ) ) ? explode( ',', $atts['hide_rows'] ) : array();
216
- foreach ( $atts['hide_rows'] as $key => $value )
217
- $atts['hide_rows'][ $key ] = (string) ( $value - 1 );
218
- $atts['hide_columns'] = ( !empty( $atts['hide_columns'] ) ) ? explode( ',', $atts['hide_columns'] ) : array();
219
- foreach ( $atts['hide_columns'] as $key => $value )
220
- $atts['hide_columns'][ $key ] = (string) ( $value - 1 );
221
-
222
$table = $this->load_table( $table_id );
223
224
// check for table data
@@ -227,7 +211,32 @@ class WP_Table_Reloaded_Controller_Frontend extends WP_Table_Reloaded_Controller
227
$message = apply_filters( 'wp_table_reloaded_table_empty_message', $message, $table_id );
228
return $message;
229
}
230
231
// determine options to use (if set in Shortcode, use those, otherwise use options from DB, i.e. "Edit Table" screen)
232
$output_options = array();
233
foreach ( $atts as $key => $value ) {
@@ -254,16 +263,16 @@ class WP_Table_Reloaded_Controller_Frontend extends WP_Table_Reloaded_Controller
254
'alternating_row_colors' => $output_options['alternating_row_colors'],
255
'datatables_sort' => $output_options['datatables_sort'],
256
'datatables_paginate' => $output_options['datatables_paginate'],
257
'datatables_lengthchange' => $output_options['datatables_lengthchange'],
258
'datatables_filter' => $output_options['datatables_filter'],
259
'datatables_info' => $output_options['datatables_info'],
260
'datatables_tabletools' => $output_options['datatables_tabletools'],
261
'datatables_customcommands' => $output_options['datatables_customcommands']
262
);
263
- $js_options = apply_filters( 'wp_table_reloaded_table_js_options', $js_options, $table_id );
264
265
// eventually add this table to list of tables which have a JS library enabled and thus are to be included in the script's call in the footer
266
- $rows = count( $table['data'] );
267
if ( $output_options['use_tablesorter'] && $output_options['first_row_th'] && 1 < $rows )
268
$this->tablesorter_tables[] = array (
269
'table_id' => $table_id,
@@ -287,9 +296,14 @@ class WP_Table_Reloaded_Controller_Frontend extends WP_Table_Reloaded_Controller
287
if ( current_user_can( $min_capability ) ) {
288
$admin_menu_page = $this->options['admin_menu_parent_page'];
289
$admin_menu_page = apply_filters( 'wp_table_reloaded_admin_menu_parent_page', $admin_menu_page );
290
if ( !in_array( $admin_menu_page, $this->possible_admin_menu_parent_pages ) )
291
$admin_menu_page = 'tools.php';
292
- $admin_menu_page = ( 'top-level' == $admin_menu_page ) ? 'admin.php' : $admin_menu_page;
293
$url_params = array(
294
'page' => $this->page_slug,
295
'action' => 'edit',
@@ -569,6 +583,8 @@ CSSSTYLE;
569
$parameters['bSort'] = '"bSort": false';
570
if ( !$js_options['datatables_paginate'] )
571
$parameters['bPaginate'] = '"bPaginate": false';
572
if ( !$js_options['datatables_lengthchange'] )
573
$parameters['bLengthChange'] = '"bLengthChange": false';
574
if ( !$js_options['datatables_filter'] )
171
'use_tablesorter' => -1,
172
'datatables_sort' => -1,
173
'datatables_paginate' => -1,
174
+ 'datatables_paginate_entries' => -1,
175
'datatables_lengthchange' => -1,
176
'datatables_filter' => -1,
177
'datatables_info' => -1,
203
return $message;
204
}
205
206
$table = $this->load_table( $table_id );
207
208
// check for table data
211
$message = apply_filters( 'wp_table_reloaded_table_empty_message', $message, $table_id );
212
return $message;
213
}
214
+
215
+ $rows = count( $table['data'] );
216
+ $columns = count( $table['data'][0] );
217
218
+ // explode from string to array
219
+ $atts['column_widths'] = ( !empty( $atts['column_widths'] ) ) ? explode( '|', $atts['column_widths'] ) : array();
220
+
221
+ // add all rows/columns to array if "all" value set for one of the four parameters
222
+ // rows/columns are indexed from 0 internally, but from 1 externally, thus substract 1 from each value
223
+ $actions = array( 'show', 'hide' );
224
+ $elements = array( 'rows', 'columns' );
225
+ foreach ( $actions as $action ) {
226
+ foreach ( $elements as $element ) {
227
+ if ( !empty( $atts["{$action}_{$element}"] ) ) {
228
+ if ( 'all' == $atts["{$action}_{$element}"] )
229
+ $atts["{$action}_{$element}"] = range( 1, ${$element} + 1 ); // because second comment above
230
+ else
231
+ $atts["{$action}_{$element}"] = explode( ',', $atts["{$action}_{$element}"] );
232
+ foreach ( $atts["{$action}_{$element}"] as $key => $value )
233
+ $atts["{$action}_{$element}"][ $key ] = (string) ( $value - 1 );
234
+ } else {
235
+ $atts["{$action}_{$element}"] = array();
236
+ }
237
+ }
238
+ }
239
+
240
// determine options to use (if set in Shortcode, use those, otherwise use options from DB, i.e. "Edit Table" screen)
241
$output_options = array();
242
foreach ( $atts as $key => $value ) {
263
'alternating_row_colors' => $output_options['alternating_row_colors'],
264
'datatables_sort' => $output_options['datatables_sort'],
265
'datatables_paginate' => $output_options['datatables_paginate'],
266
+ 'datatables_paginate_entries' => $output_options['datatables_paginate_entries'],
267
'datatables_lengthchange' => $output_options['datatables_lengthchange'],
268
'datatables_filter' => $output_options['datatables_filter'],
269
'datatables_info' => $output_options['datatables_info'],
270
'datatables_tabletools' => $output_options['datatables_tabletools'],
271
'datatables_customcommands' => $output_options['datatables_customcommands']
272
);
273
+ $js_options = apply_filters( 'wp_table_reloaded_table_js_options', $js_options, $table_id, $output_options );
274
275
// eventually add this table to list of tables which have a JS library enabled and thus are to be included in the script's call in the footer
276
if ( $output_options['use_tablesorter'] && $output_options['first_row_th'] && 1 < $rows )
277
$this->tablesorter_tables[] = array (
278
'table_id' => $table_id,
296
if ( current_user_can( $min_capability ) ) {
297
$admin_menu_page = $this->options['admin_menu_parent_page'];
298
$admin_menu_page = apply_filters( 'wp_table_reloaded_admin_menu_parent_page', $admin_menu_page );
299
+ // backward-compatibility for the filter
300
+ if ( 'top-level' == $admin_menu_page )
301
+ $admin_menu_page = 'admin.php';
302
+ // 'edit-pages.php' was renamed to 'edit.php?post_type=page' in WP 3.0
303
+ if ( 'edit-pages.php' == $admin_menu_page && version_compare( $GLOBALS['wp_version'] , '2.9.9', '>' ) )
304
+ $admin_menu_page = 'edit.php?post_type=page';
305
if ( !in_array( $admin_menu_page, $this->possible_admin_menu_parent_pages ) )
306
$admin_menu_page = 'tools.php';
307
$url_params = array(
308
'page' => $this->page_slug,
309
'action' => 'edit',
583
$parameters['bSort'] = '"bSort": false';
584
if ( !$js_options['datatables_paginate'] )
585
$parameters['bPaginate'] = '"bPaginate": false';
586
+ if ( $js_options['datatables_paginate'] && !empty( $js_options['datatables_paginate_entries'] ) && 10 <> $js_options['datatables_paginate_entries'] )
587
+ $parameters['iDisplayLength'] = '"iDisplayLength": '. $js_options['datatables_paginate_entries'];
588
if ( !$js_options['datatables_lengthchange'] )
589
$parameters['bLengthChange'] = '"bLengthChange": false';
590
if ( !$js_options['datatables_filter'] )
css/datatables.css CHANGED
@@ -17,8 +17,8 @@
17
}
18
19
.dataTables_wrapper {
20
- position: relative;
21
- zoom: 1;
22
min-height: 302px;
23
_height: 302px;
24
clear: both;
17
}
18
19
.dataTables_wrapper {
20
+ position: relative;
21
+ zoom: 1;
22
min-height: 302px;
23
_height: 302px;
24
clear: both;
css/plugin.css CHANGED
@@ -32,4 +32,8 @@
32
}
33
.wp-table-reloaded .row-hover tr:hover td {
34
background-color: #D0D0D6;
35
}
32
}
33
.wp-table-reloaded .row-hover tr:hover td {
34
background-color: #D0D0D6;
35
+ }
36
+ .wp-table-reloaded-table-description {
37
+ clear: both;
38
+ display: block;
39
}
js/jquery.datatables.min.js CHANGED
@@ -1,10 +1,10 @@
1
/*
2
* File: jquery.dataTables.min.js
3
- * Version: 1.5.6
4
* Author: Allan Jardine (www.sprymedia.co.uk)
5
* Info: www.datatables.net
6
*
7
- * Copyright 2008-2009 Allan Jardine, all rights reserved.
8
*
9
* This source file is free software, under either the GPL v2 license or a
10
* BSD style license, as supplied with this software.
@@ -13,66 +13,65 @@
13
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14
* or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
15
*/
16
- (function($){$.fn.dataTableSettings=[];$.fn.dataTableExt={};var _oExt=$.fn.dataTableExt;
17
- _oExt.sVersion="1.5.6";_oExt.iApiIndex=0;_oExt.oApi={};_oExt.afnFiltering=[];_oExt.aoFeatures=[];
18
- _oExt.ofnSearch={};_oExt.afnSortData=[];_oExt.oStdClasses={sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active",sPageButtonStaticDisabled:"paginate_button",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripOdd:"odd",sStripEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:""};
19
_oExt.oJUIClasses={sPagePrevEnabled:"fg-button ui-state-default ui-corner-left",sPagePrevDisabled:"fg-button ui-state-default ui-corner-left ui-state-disabled",sPageNextEnabled:"fg-button ui-state-default ui-corner-right",sPageNextDisabled:"fg-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",sPageButton:"fg-button ui-state-default",sPageButtonActive:"fg-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-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",sStripOdd:"odd",sStripEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate fg-buttonset fg-buttonset-multi paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",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_",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"};
20
- _oExt.oPagination={two_button:{fnInit:function(oSettings,fnCallbackDraw){var nPaging=oSettings.anFeatures.p;
21
- if(!oSettings.bJUI){oSettings.nPrevious=document.createElement("div");oSettings.nNext=document.createElement("div")
22
- }else{oSettings.nPrevious=document.createElement("a");oSettings.nNext=document.createElement("a");
23
- var nNextInner=document.createElement("span");nNextInner.className=oSettings.oClasses.sPageJUINext;
24
- oSettings.nNext.appendChild(nNextInner);var nPreviousInner=document.createElement("span");
25
- nPreviousInner.className=oSettings.oClasses.sPageJUIPrev;oSettings.nPrevious.appendChild(nPreviousInner)
26
- }if(oSettings.sTableId!==""){nPaging.setAttribute("id",oSettings.sTableId+"_paginate");
27
- oSettings.nPrevious.setAttribute("id",oSettings.sTableId+"_previous");oSettings.nNext.setAttribute("id",oSettings.sTableId+"_next")
28
- }oSettings.nPrevious.className=oSettings.oClasses.sPagePrevDisabled;oSettings.nNext.className=oSettings.oClasses.sPageNextDisabled;
29
- oSettings.nPrevious.title=oSettings.oLanguage.oPaginate.sPrevious;oSettings.nNext.title=oSettings.oLanguage.oPaginate.sNext;
30
- nPaging.appendChild(oSettings.nPrevious);nPaging.appendChild(oSettings.nNext);$(nPaging).insertAfter(oSettings.nTable);
31
- $(oSettings.nPrevious).click(function(){oSettings._iDisplayStart=oSettings._iDisplayLength>=0?oSettings._iDisplayStart-oSettings._iDisplayLength:0;
32
- if(oSettings._iDisplayStart<0){oSettings._iDisplayStart=0}fnCallbackDraw(oSettings)
33
- });$(oSettings.nNext).click(function(){if(oSettings._iDisplayLength>=0){if(oSettings._iDisplayStart+oSettings._iDisplayLength<oSettings.fnRecordsDisplay()){oSettings._iDisplayStart+=oSettings._iDisplayLength
34
- }}else{oSettings._iDisplayStart=0}fnCallbackDraw(oSettings)});$(oSettings.nPrevious).bind("selectstart",function(){return false
35
- });$(oSettings.nNext).bind("selectstart",function(){return false})},fnUpdate:function(oSettings,fnCallbackDraw){if(!oSettings.anFeatures.p){return
36
- }oSettings.nPrevious.className=(oSettings._iDisplayStart===0)?oSettings.oClasses.sPagePrevDisabled:oSettings.oClasses.sPagePrevEnabled;
37
- oSettings.nNext.className=(oSettings.fnDisplayEnd()==oSettings.fnRecordsDisplay())?oSettings.oClasses.sPageNextDisabled:oSettings.oClasses.sPageNextEnabled
38
- }},iFullNumbersShowPages:5,full_numbers:{fnInit:function(oSettings,fnCallbackDraw){var nPaging=oSettings.anFeatures.p;
39
- var nFirst=document.createElement("span");var nPrevious=document.createElement("span");
40
- var nList=document.createElement("span");var nNext=document.createElement("span");
41
- var nLast=document.createElement("span");nFirst.innerHTML=oSettings.oLanguage.oPaginate.sFirst;
42
- nPrevious.innerHTML=oSettings.oLanguage.oPaginate.sPrevious;nNext.innerHTML=oSettings.oLanguage.oPaginate.sNext;
43
- nLast.innerHTML=oSettings.oLanguage.oPaginate.sLast;var oClasses=oSettings.oClasses;
44
- nFirst.className=oClasses.sPageButton+" "+oClasses.sPageFirst;nPrevious.className=oClasses.sPageButton+" "+oClasses.sPagePrevious;
45
- nNext.className=oClasses.sPageButton+" "+oClasses.sPageNext;nLast.className=oClasses.sPageButton+" "+oClasses.sPageLast;
46
- if(oSettings.sTableId!==""){nPaging.setAttribute("id",oSettings.sTableId+"_paginate");
47
nFirst.setAttribute("id",oSettings.sTableId+"_first");nPrevious.setAttribute("id",oSettings.sTableId+"_previous");
48
nNext.setAttribute("id",oSettings.sTableId+"_next");nLast.setAttribute("id",oSettings.sTableId+"_last")
49
- }nPaging.appendChild(nFirst);nPaging.appendChild(nPrevious);nPaging.appendChild(nList);
50
- nPaging.appendChild(nNext);nPaging.appendChild(nLast);$(nFirst).click(function(){oSettings._iDisplayStart=0;
51
- fnCallbackDraw(oSettings)});$(nPrevious).click(function(){oSettings._iDisplayStart=oSettings._iDisplayLength>=0?oSettings._iDisplayStart-oSettings._iDisplayLength:0;
52
- if(oSettings._iDisplayStart<0){oSettings._iDisplayStart=0}fnCallbackDraw(oSettings)
53
- });$(nNext).click(function(){if(oSettings._iDisplayLength>=0){if(oSettings._iDisplayStart+oSettings._iDisplayLength<oSettings.fnRecordsDisplay()){oSettings._iDisplayStart+=oSettings._iDisplayLength
54
- }}else{oSettings._iDisplayStart=0}fnCallbackDraw(oSettings)});$(nLast).click(function(){if(oSettings._iDisplayLength>=0){var iPages=parseInt((oSettings.fnRecordsDisplay()-1)/oSettings._iDisplayLength,10)+1;
55
- oSettings._iDisplayStart=(iPages-1)*oSettings._iDisplayLength}else{oSettings._iDisplayStart=0
56
- }fnCallbackDraw(oSettings)});$("span",nPaging).bind("mousedown",function(){return false
57
- });$("span",nPaging).bind("selectstart",function(){return false});oSettings.nPaginateList=nList
58
- },fnUpdate:function(oSettings,fnCallbackDraw){if(!oSettings.anFeatures.p){return}var iPageCount=jQuery.fn.dataTableExt.oPagination.iFullNumbersShowPages;
59
- var iPageCountHalf=Math.floor(iPageCount/2);var iPages=Math.ceil((oSettings.fnRecordsDisplay())/oSettings._iDisplayLength);
60
- var iCurrentPage=Math.ceil(oSettings._iDisplayStart/oSettings._iDisplayLength)+1;
61
- var sList="";var iStartButton;var iEndButton;var oClasses=oSettings.oClasses;if(iPages<iPageCount){iStartButton=1;
62
iEndButton=iPages}else{if(iCurrentPage<=iPageCountHalf){iStartButton=1;iEndButton=iPageCount
63
}else{if(iCurrentPage>=(iPages-iPageCountHalf)){iStartButton=iPages-iPageCount+1;
64
iEndButton=iPages}else{iStartButton=iCurrentPage-Math.ceil(iPageCount/2)+1;iEndButton=iStartButton+iPageCount-1
65
- }}}for(var i=iStartButton;i<=iEndButton;i++){if(iCurrentPage!=i){sList+='<span class="'+oClasses.sPageButton+'">'+i+"</span>"
66
- }else{sList+='<span class="'+oClasses.sPageButtonActive+'">'+i+"</span>"}}oSettings.nPaginateList.innerHTML=sList;
67
- $("span",oSettings.nPaginateList).bind("mousedown",function(){return false});$("span",oSettings.nPaginateList).bind("selectstart",function(){return false
68
- });$("span",oSettings.nPaginateList).click(function(){var iTarget=(this.innerHTML*1)-1;
69
oSettings._iDisplayStart=iTarget*oSettings._iDisplayLength;fnCallbackDraw(oSettings);
70
- return false});var nButtons=$("span",oSettings.anFeatures.p);var nStatic=[nButtons[0],nButtons[1],nButtons[nButtons.length-2],nButtons[nButtons.length-1]];
71
- $(nStatic).removeClass(oClasses.sPageButton+" "+oClasses.sPageButtonActive);if(iCurrentPage==1){nStatic[0].className+=" "+oClasses.sPageButtonStaticDisabled;
72
- nStatic[1].className+=" "+oClasses.sPageButtonStaticDisabled}else{nStatic[0].className+=" "+oClasses.sPageButton;
73
- nStatic[1].className+=" "+oClasses.sPageButton}if(iCurrentPage==iPages||oSettings._iDisplayLength==-1){nStatic[2].className+=" "+oClasses.sPageButtonStaticDisabled;
74
- nStatic[3].className+=" "+oClasses.sPageButtonStaticDisabled}else{nStatic[2].className+=" "+oClasses.sPageButton;
75
- nStatic[3].className+=" "+oClasses.sPageButton}}}};_oExt.oSort={"string-asc":function(a,b){var x=a.toLowerCase();
76
var y=b.toLowerCase();return((x<y)?-1:((x>y)?1:0))},"string-desc":function(a,b){var x=a.toLowerCase();
77
var y=b.toLowerCase();return((x<y)?1:((x>y)?-1:0))},"html-asc":function(a,b){var x=a.replace(/<.*?>/g,"").toLowerCase();
78
var y=b.replace(/<.*?>/g,"").toLowerCase();return((x<y)?-1:((x>y)?1:0))},"html-desc":function(a,b){var x=a.replace(/<.*?>/g,"").toLowerCase();
@@ -87,15 +86,15 @@ var sValidChars="0123456789.";var Char;var bDecimal=false;Char=sData.charAt(0);i
87
}for(var i=1;i<sData.length;i++){Char=sData.charAt(i);if(sValidChars.indexOf(Char)==-1){return null
88
}if(Char=="."){if(bDecimal){return null}bDecimal=true}}return"numeric"},function(sData){var iParse=Date.parse(sData);
89
if(iParse!==null&&!isNaN(iParse)){return"date"}return null}];_oExt._oExternConfig={iNextUnique:0};
90
- $.fn.dataTable=function(oInit){var _aoSettings=$.fn.dataTableSettings;function classSettings(){this.fnRecordsTotal=function(){if(this.oFeatures.bServerSide){return this._iRecordsTotal
91
}else{return this.aiDisplayMaster.length}};this.fnRecordsDisplay=function(){if(this.oFeatures.bServerSide){return this._iRecordsDisplay
92
}else{return this.aiDisplay.length}};this.fnDisplayEnd=function(){if(this.oFeatures.bServerSide){return this._iDisplayStart+this.aiDisplay.length
93
}else{return this._iDisplayEnd}};this.sInstance=null;this.oFeatures={bPaginate:true,bLengthChange:true,bFilter:true,bSort:true,bInfo:true,bAutoWidth:true,bProcessing:false,bSortClasses:true,bStateSave:false,bServerSide:false};
94
- this.anFeatures=[];this.oLanguage={sProcessing:"Processing...",sLengthMenu:"Show _MENU_ entries",sZeroRecords:"No matching records found",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sSearch:"Search:",sUrl:"",oPaginate:{sFirst:"First",sPrevious:"Previous",sNext:"Next",sLast:"Last"}};
95
this.aoData=[];this.aiDisplay=[];this.aiDisplayMaster=[];this.aoColumns=[];this.iNextId=0;
96
this.asDataSearch=[];this.oPreviousSearch={sSearch:"",bEscapeRegex:true};this.aoPreSearchCols=[];
97
this.aaSorting=[[0,"asc",0]];this.aaSortingFixed=null;this.asStripClasses=[];this.fnRowCallback=null;
98
- this.fnHeaderCallback=null;this.fnFooterCallback=null;this.fnDrawCallback=null;this.fnInitComplete=null;
99
this.sTableId="";this.nTable=null;this.iDefaultSortIndex=0;this.bInitialised=false;
100
this.aoOpenRows=[];this.sDom="lfrtip";this.sPaginationType="two_button";this.iCookieDuration=60*60*2;
101
this.sAjaxSource=null;this.bAjaxDataGet=true;this.fnServerData=$.getJSON;this.iServerDraw=0;
@@ -107,15 +106,19 @@ if(typeof bComplete!="undefined"&&bComplete===false){_fnCalculateEnd(oSettings);
107
if(typeof bEscapeRegex=="undefined"){bEscapeRegex=true}if(typeof iColumn=="undefined"||iColumn===null){_fnFilterComplete(oSettings,{sSearch:sInput,bEscapeRegex:bEscapeRegex},1)
108
}else{oSettings.aoPreSearchCols[iColumn].sSearch=sInput;oSettings.aoPreSearchCols[iColumn].bEscapeRegex=bEscapeRegex;
109
_fnFilterComplete(oSettings,oSettings.oPreviousSearch,1)}};this.fnSettings=function(nNode){return _fnSettingsFromNode(this[_oExt.iApiIndex])
110
- };this.fnSort=function(aaSort){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
111
- oSettings.aaSorting=aaSort;_fnSort(oSettings)};this.fnAddData=function(mData,bRedraw){var aiReturn=[];
112
- var iTest;if(typeof bRedraw=="undefined"){bRedraw=true}var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
113
- if(typeof mData[0]=="object"){for(var i=0;i<mData.length;i++){iTest=_fnAddData(oSettings,mData[i]);
114
- if(iTest==-1){return aiReturn}aiReturn.push(iTest)}}else{iTest=_fnAddData(oSettings,mData);
115
- if(iTest==-1){return aiReturn}aiReturn.push(iTest)}oSettings.aiDisplay=oSettings.aiDisplayMaster.slice();
116
- _fnBuildSearchArray(oSettings,1);if(bRedraw){_fnReDraw(oSettings)}return aiReturn
117
- };this.fnDeleteRow=function(iAODataIndex,fnCallBack,bNullRow){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
118
- var i;for(i=0;i<oSettings.aiDisplayMaster.length;i++){if(oSettings.aiDisplayMaster[i]==iAODataIndex){oSettings.aiDisplayMaster.splice(i,1);
119
break}}for(i=0;i<oSettings.aiDisplay.length;i++){if(oSettings.aiDisplay[i]==iAODataIndex){oSettings.aiDisplay.splice(i,1);
120
break}}_fnBuildSearchArray(oSettings,1);if(typeof fnCallBack=="function"){fnCallBack.call(this)
121
}if(oSettings._iDisplayStart>=oSettings.aiDisplay.length){oSettings._iDisplayStart-=oSettings._iDisplayLength;
@@ -128,29 +131,30 @@ this.fnClose(nTr);var nNewRow=document.createElement("tr");var nNewCell=document
128
nNewRow.appendChild(nNewCell);nNewCell.className=sClass;nNewCell.colSpan=_fnVisbleColumns(oSettings);
129
nNewCell.innerHTML=sHtml;var nTrs=$("tbody tr",oSettings.nTable);if($.inArray(nTr,nTrs)!=-1){$(nNewRow).insertAfter(nTr)
130
}if(!oSettings.oFeatures.bServerSide){oSettings.aoOpenRows.push({nTr:nNewRow,nParent:nTr})
131
- }};this.fnClose=function(nTr){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
132
for(var i=0;i<oSettings.aoOpenRows.length;i++){if(oSettings.aoOpenRows[i].nParent==nTr){var nTrParent=oSettings.aoOpenRows[i].nTr.parentNode;
133
if(nTrParent){nTrParent.removeChild(oSettings.aoOpenRows[i].nTr)}oSettings.aoOpenRows.splice(i,1);
134
- return 0}}return 1};this.fnGetData=function(iRow){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
135
- if(typeof iRow!="undefined"){return oSettings.aoData[iRow]._aData}return _fnGetDataMaster(oSettings)
136
- };this.fnGetNodes=function(iRow){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
137
if(typeof iRow!="undefined"){return oSettings.aoData[iRow].nTr}return _fnGetTrNodes(oSettings)
138
};this.fnGetPosition=function(nNode){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
139
- var i;if(nNode.nodeName=="TR"){for(i=0;i<oSettings.aoData.length;i++){if(oSettings.aoData[i]!==null&&oSettings.aoData[i].nTr==nNode){return i
140
- }}}else{if(nNode.nodeName=="TD"){for(i=0;i<oSettings.aoData.length;i++){var iCorrector=0;
141
- for(var j=0;j<oSettings.aoColumns.length;j++){if(oSettings.aoColumns[j].bVisible){if(oSettings.aoData[i]!==null&&oSettings.aoData[i].nTr.getElementsByTagName("td")[j-iCorrector]==nNode){return[i,j-iCorrector,j]
142
- }}else{iCorrector++}}}}}return null};this.fnUpdate=function(mData,iRow,iColumn,bRedraw){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
143
- var iVisibleColumn;var sDisplay;if(typeof bRedraw=="undefined"){bRedraw=true}if(typeof mData!="object"){sDisplay=mData;
144
- oSettings.aoData[iRow]._aData[iColumn]=sDisplay;if(oSettings.aoColumns[iColumn].fnRender!==null){sDisplay=oSettings.aoColumns[iColumn].fnRender({iDataRow:iRow,iDataColumn:iColumn,aData:oSettings.aoData[iRow]._aData,oSettings:oSettings});
145
if(oSettings.aoColumns[iColumn].bUseRendered){oSettings.aoData[iRow]._aData[iColumn]=sDisplay
146
}}iVisibleColumn=_fnColumnIndexToVisible(oSettings,iColumn);if(iVisibleColumn!==null){oSettings.aoData[iRow].nTr.getElementsByTagName("td")[iVisibleColumn].innerHTML=sDisplay
147
- }}else{if(mData.length!=oSettings.aoColumns.length){alert("Warning: An array passed to fnUpdate must have the same number of columns as the table in question - in this case "+oSettings.aoColumns.length);
148
return 1}for(var i=0;i<mData.length;i++){sDisplay=mData[i];oSettings.aoData[iRow]._aData[i]=sDisplay;
149
if(oSettings.aoColumns[i].fnRender!==null){sDisplay=oSettings.aoColumns[i].fnRender({iDataRow:iRow,iDataColumn:i,aData:oSettings.aoData[iRow]._aData,oSettings:oSettings});
150
if(oSettings.aoColumns[i].bUseRendered){oSettings.aoData[iRow]._aData[i]=sDisplay
151
}}iVisibleColumn=_fnColumnIndexToVisible(oSettings,i);if(iVisibleColumn!==null){oSettings.aoData[iRow].nTr.getElementsByTagName("td")[iVisibleColumn].innerHTML=sDisplay
152
- }}}_fnBuildSearchArray(oSettings,1);if(bRedraw){_fnReDraw(oSettings)}return 0};this.fnSetColumnVis=function(iCol,bShow){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
153
- var i,iLen;var iColumns=oSettings.aoColumns.length;var nTd;if(oSettings.aoColumns[iCol].bVisible==bShow){return
154
}var nTrHead=$("thead:eq(0)>tr",oSettings.nTable)[0];var nTrFoot=$("tfoot:eq(0)>tr",oSettings.nTable)[0];
155
var anTheadTh=[];var anTfootTh=[];for(i=0;i<iColumns;i++){anTheadTh.push(oSettings.aoColumns[i].nTh);
156
anTfootTh.push(oSettings.aoColumns[i].nTf)}if(bShow){var iInsert=0;for(i=0;i<iCol;
@@ -160,21 +164,22 @@ i<iLen;i++){nTd=oSettings.aoData[i]._anHidden[iCol];oSettings.aoData[i].nTr.appe
160
}}else{var iBefore;for(i=iCol;i<iColumns;i++){iBefore=_fnColumnIndexToVisible(oSettings,i);
161
if(iBefore!==null){break}}nTrHead.insertBefore(anTheadTh[iCol],nTrHead.getElementsByTagName("th")[iBefore]);
162
if(nTrFoot){nTrFoot.insertBefore(anTfootTh[iCol],nTrFoot.getElementsByTagName("th")[iBefore])
163
- }for(i=0,iLen=oSettings.aoData.length;i<iLen;i++){nTd=oSettings.aoData[i]._anHidden[iCol];
164
- oSettings.aoData[i].nTr.insertBefore(nTd,oSettings.aoData[i].nTr.getElementsByTagName("td")[iBefore])
165
}}oSettings.aoColumns[iCol].bVisible=true}else{nTrHead.removeChild(anTheadTh[iCol]);
166
- if(nTrFoot){nTrFoot.removeChild(anTfootTh[iCol])}var iVisCol=_fnColumnIndexToVisible(oSettings,iCol);
167
- for(i=0,iLen=oSettings.aoData.length;i<iLen;i++){nTd=oSettings.aoData[i].nTr.getElementsByTagName("td")[iVisCol];
168
- oSettings.aoData[i]._anHidden[iCol]=nTd;nTd.parentNode.removeChild(nTd)}oSettings.aoColumns[iCol].bVisible=false
169
- }for(i=0,iLen=oSettings.aoOpenRows.length;i<iLen;i++){oSettings.aoOpenRows[i].nTr.colSpan=_fnVisbleColumns(oSettings)
170
- }_fnSaveState(oSettings)};function _fnExternApiFunc(sFunc){return function(){var aArgs=[_fnSettingsFromNode(this[_oExt.iApiIndex])].concat(Array.prototype.slice.call(arguments));
171
return _oExt.oApi[sFunc].apply(this,aArgs)}}for(var sFunc in _oExt.oApi){if(sFunc){this[sFunc]=_fnExternApiFunc(sFunc)
172
}}function _fnInitalise(oSettings){if(oSettings.bInitialised===false){setTimeout(function(){_fnInitalise(oSettings)
173
- },200);return}_fnAddOptionsHtml(oSettings);_fnDrawHead(oSettings);_fnSortingClasses(oSettings);
174
- if(oSettings.oFeatures.bSort){_fnSort(oSettings,false);_fnSortingClasses(oSettings)
175
- }else{oSettings.aiDisplay=oSettings.aiDisplayMaster.slice();_fnCalculateEnd(oSettings);
176
- _fnDraw(oSettings)}if(oSettings.sAjaxSource!==null&&!oSettings.oFeatures.bServerSide){_fnProcessingDisplay(oSettings,true);
177
- $.getJSON(oSettings.sAjaxSource,null,function(json){for(var i=0;i<json.aaData.length;
178
i++){_fnAddData(oSettings,json.aaData[i])}oSettings.iInitDisplayStart=oSettings._iDisplayStart;
179
if(oSettings.oFeatures.bSort){_fnSort(oSettings)}else{oSettings.aiDisplay=oSettings.aiDisplayMaster.slice();
180
_fnCalculateEnd(oSettings);_fnDraw(oSettings)}_fnProcessingDisplay(oSettings,false);
@@ -199,30 +204,35 @@ oCol.sSortingClassJUI=""}else{if($.inArray("asc",oCol.asSorting)!=-1&&$.inArray(
199
oCol.sSortingClassJUI=oSettings.oClasses.sSortJUIAscAllowed}else{if($.inArray("asc",oCol.asSorting)==-1&&$.inArray("desc",oCol.asSorting)!=-1){oCol.sSortingClass=oSettings.oClasses.sSortableDesc;
200
oCol.sSortingClassJUI=oSettings.oClasses.sSortJUIDescAllowed}}}if(typeof oSettings.aoPreSearchCols[iLength]=="undefined"||oSettings.aoPreSearchCols[iLength]===null){oSettings.aoPreSearchCols[iLength]={sSearch:"",bEscapeRegex:true}
201
}else{if(typeof oSettings.aoPreSearchCols[iLength].bEscapeRegex=="undefined"){oSettings.aoPreSearchCols[iLength].bEscapeRegex=true
202
- }}}function _fnAddData(oSettings,aData){if(aData.length!=oSettings.aoColumns.length){alert("Warning - added data does not match known number of columns");
203
- return -1}var iThisIndex=oSettings.aoData.length;oSettings.aoData.push({_iId:oSettings.iNextId++,_aData:aData.slice(),nTr:document.createElement("tr"),_anHidden:[]});
204
- var nTd;for(var i=0;i<aData.length;i++){nTd=document.createElement("td");if(typeof oSettings.aoColumns[i].fnRender=="function"){var sRendered=oSettings.aoColumns[i].fnRender({iDataRow:iThisIndex,iDataColumn:i,aData:aData,oSettings:oSettings});
205
nTd.innerHTML=sRendered;if(oSettings.aoColumns[i].bUseRendered){oSettings.aoData[iThisIndex]._aData[i]=sRendered
206
}}else{nTd.innerHTML=aData[i]}if(oSettings.aoColumns[i].sClass!==null){nTd.className=oSettings.aoColumns[i].sClass
207
- }if(oSettings.aoColumns[i]._bAutoType&&oSettings.aoColumns[i].sType!="string"){if(oSettings.aoColumns[i].sType===null){oSettings.aoColumns[i].sType=_fnDetectType(aData[i])
208
- }else{if(oSettings.aoColumns[i].sType=="date"||oSettings.aoColumns[i].sType=="numeric"){oSettings.aoColumns[i].sType=_fnDetectType(aData[i])
209
}}}if(oSettings.aoColumns[i].bVisible){oSettings.aoData[iThisIndex].nTr.appendChild(nTd)
210
}else{oSettings.aoData[iThisIndex]._anHidden[i]=nTd}}oSettings.aiDisplayMaster.push(iThisIndex);
211
- return iThisIndex}function _fnGatherData(oSettings){var iLoop;var i,j;if(oSettings.sAjaxSource===null){$("tbody:eq(0)>tr",oSettings.nTable).each(function(){var iThisIndex=oSettings.aoData.length;
212
- oSettings.aoData.push({_iId:oSettings.iNextId++,_aData:[],nTr:this,_anHidden:[]});
213
- oSettings.aiDisplayMaster.push(iThisIndex);var aLocalData=oSettings.aoData[iThisIndex]._aData;
214
- $("td",this).each(function(i){aLocalData[i]=this.innerHTML})})}var iCorrector=0;for(i=0;
215
- i<oSettings.aoColumns.length;i++){if(oSettings.aoColumns[i].sTitle===null){oSettings.aoColumns[i].sTitle=oSettings.aoColumns[i].nTh.innerHTML
216
- }var bAutoType=oSettings.aoColumns[i]._bAutoType;var bRender=typeof oSettings.aoColumns[i].fnRender=="function";
217
- var bClass=oSettings.aoColumns[i].sClass!==null;var bVisible=oSettings.aoColumns[i].bVisible;
218
- if(bAutoType||bRender||bClass||!bVisible){iLoop=oSettings.aoData.length;for(j=0;j<iLoop;
219
- j++){var nCellNode=oSettings.aoData[j].nTr.getElementsByTagName("td")[i-iCorrector];
220
- if(bAutoType){if(oSettings.aoColumns[i].sType===null){oSettings.aoColumns[i].sType=_fnDetectType(oSettings.aoData[j]._aData[i])
221
- }else{if(oSettings.aoColumns[i].sType=="date"||oSettings.aoColumns[i].sType=="numeric"){oSettings.aoColumns[i].sType=_fnDetectType(oSettings.aoData[j]._aData[i])
222
- }}}if(bRender){var sRendered=oSettings.aoColumns[i].fnRender({iDataRow:j,iDataColumn:i,aData:oSettings.aoData[j]._aData,oSettings:oSettings});
223
- nCellNode.innerHTML=sRendered;if(oSettings.aoColumns[i].bUseRendered){oSettings.aoData[j]._aData[i]=sRendered
224
- }}if(bClass){nCellNode.className+=" "+oSettings.aoColumns[i].sClass}if(!bVisible){oSettings.aoData[j]._anHidden[i]=nCellNode;
225
- nCellNode.parentNode.removeChild(nCellNode)}}if(!bVisible){iCorrector++}}}}function _fnDrawHead(oSettings){var i,nTh,iLen;
226
var iThs=oSettings.nTable.getElementsByTagName("thead")[0].getElementsByTagName("th").length;
227
var iCorrector=0;if(iThs!==0){for(i=0,iLen=oSettings.aoColumns.length;i<iLen;i++){nTh=oSettings.aoColumns[i].nTh;
228
if(oSettings.aoColumns[i].bVisible){if(oSettings.aoColumns[i].sWidth!==null){nTh.style.width=oSettings.aoColumns[i].sWidth
@@ -233,50 +243,34 @@ nTh.innerHTML=oSettings.aoColumns[i].sTitle;if(oSettings.aoColumns[i].bVisible){
233
}if(oSettings.aoColumns[i].sWidth!==null){nTh.style.width=oSettings.aoColumns[i].sWidth
234
}nTr.appendChild(nTh)}}$("thead:eq(0)",oSettings.nTable).html("")[0].appendChild(nTr)
235
}if(oSettings.bJUI){for(i=0,iLen=oSettings.aoColumns.length;i<iLen;i++){oSettings.aoColumns[i].nTh.insertBefore(document.createElement("span"),oSettings.aoColumns[i].nTh.firstChild)
236
- }}if(oSettings.oFeatures.bSort){for(i=0;i<oSettings.aoColumns.length;i++){if(oSettings.aoColumns[i].bSortable===false){$(oSettings.aoColumns[i].nTh).addClass(oSettings.oClasses.sSortableNone);
237
- continue}$(oSettings.aoColumns[i].nTh).click(function(e){var iDataIndex;for(var i=0;
238
- i<oSettings.aoColumns.length;i++){if(oSettings.aoColumns[i].nTh==this){iDataIndex=i;
239
- break}}if(oSettings.aoColumns[iDataIndex].bSortable===false){return}var fnInnerSorting=function(){var iColumn,iNextSort;
240
- if(e.shiftKey){var bFound=false;for(var i=0;i<oSettings.aaSorting.length;i++){if(oSettings.aaSorting[i][0]==iDataIndex){bFound=true;
241
- iColumn=oSettings.aaSorting[i][0];iNextSort=oSettings.aaSorting[i][2]+1;if(typeof oSettings.aoColumns[iColumn].asSorting[iNextSort]=="undefined"){oSettings.aaSorting.splice(i,1)
242
- }else{oSettings.aaSorting[i][1]=oSettings.aoColumns[iColumn].asSorting[iNextSort];
243
- oSettings.aaSorting[i][2]=iNextSort}break}}if(bFound===false){oSettings.aaSorting.push([iDataIndex,oSettings.aoColumns[iDataIndex].asSorting[0],0])
244
- }}else{if(oSettings.aaSorting.length==1&&oSettings.aaSorting[0][0]==iDataIndex){iColumn=oSettings.aaSorting[0][0];
245
- iNextSort=oSettings.aaSorting[0][2]+1;if(typeof oSettings.aoColumns[iColumn].asSorting[iNextSort]=="undefined"){iNextSort=0
246
- }oSettings.aaSorting[0][1]=oSettings.aoColumns[iColumn].asSorting[iNextSort];oSettings.aaSorting[0][2]=iNextSort
247
- }else{oSettings.aaSorting.splice(0,oSettings.aaSorting.length);oSettings.aaSorting.push([iDataIndex,oSettings.aoColumns[iDataIndex].asSorting[0],0])
248
- }}_fnSort(oSettings)};if(!oSettings.oFeatures.bProcessing){fnInnerSorting()}else{_fnProcessingDisplay(oSettings,true);
249
- setTimeout(function(){fnInnerSorting();if(!oSettings.oFeatures.bServerSide){_fnProcessingDisplay(oSettings,false)
250
- }},0)}})}$("thead:eq(0) th",oSettings.nTable).mousedown(function(e){if(e.shiftKey){this.onselectstart=function(){return false
251
- };return false}})}if(oSettings.oFeatures.bAutoWidth&&oSettings.nTable.offsetWidth!==0){oSettings.nTable.style.width=oSettings.nTable.offsetWidth+"px"
252
- }var nTfoot=oSettings.nTable.getElementsByTagName("tfoot");if(nTfoot.length!==0){iCorrector=0;
253
var nTfs=nTfoot[0].getElementsByTagName("th");for(i=0,iLen=nTfs.length;i<iLen;i++){oSettings.aoColumns[i].nTf=nTfs[i-iCorrector];
254
if(!oSettings.aoColumns[i].bVisible){nTfs[i-iCorrector].parentNode.removeChild(nTfs[i-iCorrector]);
255
- iCorrector++}}}}function _fnDraw(oSettings){var i;var anRows=[];var iRowCount=0;var bRowError=false;
256
- var iStrips=oSettings.asStripClasses.length;var iOpenRows=oSettings.aoOpenRows.length;
257
- if(oSettings.oFeatures.bServerSide&&!_fnAjaxUpdate(oSettings)){return}if(typeof oSettings.iInitDisplayStart!="undefined"&&oSettings.iInitDisplayStart!=-1){oSettings._iDisplayStart=oSettings.iInitDisplayStart;
258
oSettings.iInitDisplayStart=-1;_fnCalculateEnd(oSettings)}if(oSettings.aiDisplay.length!==0){var iStart=oSettings._iDisplayStart;
259
var iEnd=oSettings._iDisplayEnd;if(oSettings.oFeatures.bServerSide){iStart=0;iEnd=oSettings.aoData.length
260
- }for(var j=iStart;j<iEnd;j++){var nRow=oSettings.aoData[oSettings.aiDisplay[j]].nTr;
261
- if(iStrips!==0){$(nRow).removeClass(oSettings.asStripClasses.join(" "));$(nRow).addClass(oSettings.asStripClasses[iRowCount%iStrips])
262
- }if(typeof oSettings.fnRowCallback=="function"){nRow=oSettings.fnRowCallback(nRow,oSettings.aoData[oSettings.aiDisplay[j]]._aData,iRowCount,j);
263
- if(!nRow&&!bRowError){alert("Error: A node was not returned by fnRowCallback");bRowError=true
264
- }}anRows.push(nRow);iRowCount++;if(iOpenRows!==0){for(var k=0;k<iOpenRows;k++){if(nRow==oSettings.aoOpenRows[k].nParent){anRows.push(oSettings.aoOpenRows[k].nTr)
265
}}}}}else{anRows[0]=document.createElement("tr");if(typeof oSettings.asStripClasses[0]!="undefined"){anRows[0].className=oSettings.asStripClasses[0]
266
}var nTd=document.createElement("td");nTd.setAttribute("valign","top");nTd.colSpan=oSettings.aoColumns.length;
267
nTd.className=oSettings.oClasses.sRowEmpty;nTd.innerHTML=oSettings.oLanguage.sZeroRecords;
268
anRows[iRowCount].appendChild(nTd)}if(typeof oSettings.fnHeaderCallback=="function"){oSettings.fnHeaderCallback($("thead:eq(0)>tr",oSettings.nTable)[0],_fnGetDataMaster(oSettings),oSettings._iDisplayStart,oSettings.fnDisplayEnd(),oSettings.aiDisplay)
269
}if(typeof oSettings.fnFooterCallback=="function"){oSettings.fnFooterCallback($("tfoot:eq(0)>tr",oSettings.nTable)[0],_fnGetDataMaster(oSettings),oSettings._iDisplayStart,oSettings.fnDisplayEnd(),oSettings.aiDisplay)
270
- }var nTrs=$("tbody:eq(0)>tr",oSettings.nTable);for(i=0;i<nTrs.length;i++){nTrs[i].parentNode.removeChild(nTrs[i])
271
- }var nBody=$("tbody:eq(0)",oSettings.nTable);if(nBody[0]){for(i=0;i<anRows.length;
272
- i++){nBody[0].appendChild(anRows[i])}}if(oSettings.oFeatures.bPaginate){_oExt.oPagination[oSettings.sPaginationType].fnUpdate(oSettings,function(oSettings){_fnCalculateEnd(oSettings);
273
- _fnDraw(oSettings)})}if(oSettings.oFeatures.bInfo&&oSettings.anFeatures.i){if(oSettings.fnRecordsDisplay()===0&&oSettings.fnRecordsDisplay()==oSettings.fnRecordsTotal()){oSettings.anFeatures.i.innerHTML=oSettings.oLanguage.sInfoEmpty+oSettings.oLanguage.sInfoPostFix
274
- }else{if(oSettings.fnRecordsDisplay()===0){oSettings.anFeatures.i.innerHTML=oSettings.oLanguage.sInfoEmpty+" "+oSettings.oLanguage.sInfoFiltered.replace("_MAX_",oSettings.fnRecordsTotal())+oSettings.oLanguage.sInfoPostFix
275
- }else{if(oSettings.fnRecordsDisplay()==oSettings.fnRecordsTotal()){oSettings.anFeatures.i.innerHTML=oSettings.oLanguage.sInfo.replace("_START_",oSettings._iDisplayStart+1).replace("_END_",oSettings.fnDisplayEnd()).replace("_TOTAL_",oSettings.fnRecordsDisplay())+oSettings.oLanguage.sInfoPostFix
276
- }else{oSettings.anFeatures.i.innerHTML=oSettings.oLanguage.sInfo.replace("_START_",oSettings._iDisplayStart+1).replace("_END_",oSettings.fnDisplayEnd()).replace("_TOTAL_",oSettings.fnRecordsDisplay())+" "+oSettings.oLanguage.sInfoFiltered.replace("_MAX_",oSettings.fnRecordsTotal())+oSettings.oLanguage.sInfoPostFix
277
- }}}}if(oSettings.oFeatures.bServerSide&&oSettings.oFeatures.bSort){_fnSortingClasses(oSettings)
278
- }_fnSaveState(oSettings);if(typeof oSettings.fnDrawCallback=="function"){oSettings.fnDrawCallback(oSettings)
279
- }oSettings.bSorted=false;oSettings.bFiltered=false}function _fnReDraw(oSettings){if(oSettings.oFeatures.bSort){_fnSort(oSettings,oSettings.oPreviousSearch)
280
}else{if(oSettings.oFeatures.bFilter){_fnFilterComplete(oSettings,oSettings.oPreviousSearch)
281
}else{_fnCalculateEnd(oSettings);_fnDraw(oSettings)}}}function _fnAjaxUpdate(oSettings){if(oSettings.bAjaxDataGet){_fnProcessingDisplay(oSettings,true);
282
var iColumns=oSettings.aoColumns.length;var aoData=[];var i;oSettings.iServerDraw++;
@@ -290,8 +284,8 @@ aoData.push({name:"bEscapeRegex_"+i,value:oSettings.aoPreSearchCols[i].bEscapeRe
290
aoData.push({name:"bSearchable_"+i,value:oSettings.aoColumns[i].bSearchable})}}if(oSettings.oFeatures.bSort!==false){var iFixed=oSettings.aaSortingFixed!==null?oSettings.aaSortingFixed.length:0;
291
var iUser=oSettings.aaSorting.length;aoData.push({name:"iSortingCols",value:iFixed+iUser});
292
for(i=0;i<iFixed;i++){aoData.push({name:"iSortCol_"+i,value:oSettings.aaSortingFixed[i][0]});
293
- aoData.push({name:"iSortDir_"+i,value:oSettings.aaSortingFixed[i][1]})}for(i=0;i<iUser;
294
- i++){aoData.push({name:"iSortCol_"+(i+iFixed),value:oSettings.aaSorting[i][0]});aoData.push({name:"iSortDir_"+(i+iFixed),value:oSettings.aaSorting[i][1]})
295
}for(i=0;i<iColumns;i++){aoData.push({name:"bSortable_"+i,value:oSettings.aoColumns[i].bSortable})
296
}}oSettings.fnServerData(oSettings.sAjaxSource,aoData,function(json){_fnAjaxUpdateDraw(oSettings,json)
297
});return false}else{return true}}function _fnAjaxUpdateDraw(oSettings,json){if(typeof json.sEcho!="undefined"){if(json.sEcho*1<oSettings.iServerDraw){return
@@ -308,43 +302,28 @@ oSettings.nTable.parentNode.insertBefore(nHolding,oSettings.nTable);var nWrapper
308
nWrapper.className=oSettings.oClasses.sWrapper;if(oSettings.sTableId!==""){nWrapper.setAttribute("id",oSettings.sTableId+"_wrapper")
309
}var nInsertNode=nWrapper;var sDom=oSettings.sDom.replace("H","fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix");
310
sDom=sDom.replace("F","fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix");
311
- var aDom=sDom.split("");var nTmp;for(var i=0;i<aDom.length;i++){var cOption=aDom[i];
312
- if(cOption=="<"){var nNewNode=document.createElement("div");var cNext=aDom[i+1];if(cNext=="'"||cNext=='"'){var sClass="";
313
- var j=2;while(aDom[i+j]!=cNext){sClass+=aDom[i+j];j++}nNewNode.className=sClass;i+=j
314
- }nInsertNode.appendChild(nNewNode);nInsertNode=nNewNode}else{if(cOption==">"){nInsertNode=nInsertNode.parentNode
315
- }else{if(cOption=="l"&&oSettings.oFeatures.bPaginate&&oSettings.oFeatures.bLengthChange){nTmp=_fnFeatureHtmlLength(oSettings);
316
- oSettings.anFeatures[cOption]=nTmp;nInsertNode.appendChild(nTmp)}else{if(cOption=="f"&&oSettings.oFeatures.bFilter){nTmp=_fnFeatureHtmlFilter(oSettings);
317
- oSettings.anFeatures[cOption]=nTmp;nInsertNode.appendChild(nTmp)}else{if(cOption=="r"&&oSettings.oFeatures.bProcessing){nTmp=_fnFeatureHtmlProcessing(oSettings);
318
- oSettings.anFeatures[cOption]=nTmp;nInsertNode.appendChild(nTmp)}else{if(cOption=="t"){oSettings.anFeatures[cOption]=oSettings.nTable;
319
- nInsertNode.appendChild(oSettings.nTable)}else{if(cOption=="i"&&oSettings.oFeatures.bInfo){nTmp=_fnFeatureHtmlInfo(oSettings);
320
- oSettings.anFeatures[cOption]=nTmp;nInsertNode.appendChild(nTmp)}else{if(cOption=="p"&&oSettings.oFeatures.bPaginate){nTmp=_fnFeatureHtmlPaginate(oSettings);
321
- oSettings.anFeatures[cOption]=nTmp;nInsertNode.appendChild(nTmp)}else{if(_oExt.aoFeatures.length!==0){var aoFeatures=_oExt.aoFeatures;
322
for(var k=0,kLen=aoFeatures.length;k<kLen;k++){if(cOption==aoFeatures[k].cFeature){nTmp=aoFeatures[k].fnInit(oSettings);
323
- oSettings.anFeatures[cOption]=nTmp;nInsertNode.appendChild(nTmp);break}}}}}}}}}}}}nHolding.parentNode.replaceChild(nWrapper,nHolding)
324
}function _fnFeatureHtmlFilter(oSettings){var nFilter=document.createElement("div");
325
- if(oSettings.sTableId!==""){nFilter.setAttribute("id",oSettings.sTableId+"_filter")
326
}nFilter.className=oSettings.oClasses.sFilter;var sSpace=oSettings.oLanguage.sSearch===""?"":" ";
327
nFilter.innerHTML=oSettings.oLanguage.sSearch+sSpace+'<input type="text" />';var jqFilter=$("input",nFilter);
328
- jqFilter.val(oSettings.oPreviousSearch.sSearch.replace('"',"&quot;"));jqFilter.keyup(function(e){_fnFilterComplete(oSettings,{sSearch:this.value,bEscapeRegex:oSettings.oPreviousSearch.bEscapeRegex})
329
});jqFilter.keypress(function(e){if(e.keyCode==13){return false}});return nFilter
330
- }function _fnFeatureHtmlInfo(oSettings){var nInfo=document.createElement("div");if(oSettings.sTableId!==""){nInfo.setAttribute("id",oSettings.sTableId+"_info")
331
- }nInfo.className=oSettings.oClasses.sInfo;return nInfo}function _fnFeatureHtmlPaginate(oSettings){var nPaginate=document.createElement("div");
332
- nPaginate.className=oSettings.oClasses.sPaging+oSettings.sPaginationType;oSettings.anFeatures.p=nPaginate;
333
- _oExt.oPagination[oSettings.sPaginationType].fnInit(oSettings,function(oSettings){_fnCalculateEnd(oSettings);
334
- _fnDraw(oSettings)});return nPaginate}function _fnFeatureHtmlLength(oSettings){var sName=(oSettings.sTableId==="")?"":'name="'+oSettings.sTableId+'_length"';
335
- var sStdMenu='<select size="1" '+sName+'><option value="10">10</option><option value="25">25</option><option value="50">50</option><option value="100">100</option></select>';
336
- var nLength=document.createElement("div");if(oSettings.sTableId!==""){nLength.setAttribute("id",oSettings.sTableId+"_length")
337
- }nLength.className=oSettings.oClasses.sLength;nLength.innerHTML=oSettings.oLanguage.sLengthMenu.replace("_MENU_",sStdMenu);
338
- $('select option[value="'+oSettings._iDisplayLength+'"]',nLength).attr("selected",true);
339
- $("select",nLength).change(function(e){oSettings._iDisplayLength=parseInt($(this).val(),10);
340
- _fnCalculateEnd(oSettings);if(oSettings._iDisplayEnd==oSettings.aiDisplay.length){oSettings._iDisplayStart=oSettings._iDisplayEnd-oSettings._iDisplayLength;
341
- if(oSettings._iDisplayStart<0){oSettings._iDisplayStart=0}}if(oSettings._iDisplayLength==-1){oSettings._iDisplayStart=0
342
- }_fnDraw(oSettings)});return nLength}function _fnFeatureHtmlProcessing(oSettings){var nProcessing=document.createElement("div");
343
- if(oSettings.sTableId!==""){nProcessing.setAttribute("id",oSettings.sTableId+"_processing")
344
- }nProcessing.innerHTML=oSettings.oLanguage.sProcessing;nProcessing.className=oSettings.oClasses.sProcessing;
345
- oSettings.nTable.parentNode.insertBefore(nProcessing,oSettings.nTable);return nProcessing
346
- }function _fnProcessingDisplay(oSettings,bShow){if(oSettings.oFeatures.bProcessing){oSettings.anFeatures.r.style.visibility=bShow?"visible":"hidden"
347
- }}function _fnFilterComplete(oSettings,oInput,iForce){_fnFilter(oSettings,oInput.sSearch,iForce,oInput.bEscapeRegex);
348
for(var i=0;i<oSettings.aoPreSearchCols.length;i++){_fnFilterColumn(oSettings,oSettings.aoPreSearchCols[i].sSearch,i,oSettings.aoPreSearchCols[i].bEscapeRegex)
349
}if(_oExt.afnFiltering.length!==0){_fnFilterCustom(oSettings)}oSettings.bFiltered=true;
350
oSettings._iDisplayStart=0;_fnCalculateEnd(oSettings);_fnDraw(oSettings);_fnBuildSearchArray(oSettings,0)
@@ -363,8 +342,15 @@ oSettings.aiDisplay=oSettings.aiDisplayMaster.slice()}else{if(oSettings.aiDispla
363
_fnBuildSearchArray(oSettings,1);for(i=0;i<oSettings.aiDisplayMaster.length;i++){if(rpSearch.test(oSettings.asDataSearch[i])){oSettings.aiDisplay.push(oSettings.aiDisplayMaster[i])
364
}}}else{var iIndexCorrector=0;for(i=0;i<oSettings.asDataSearch.length;i++){if(!rpSearch.test(oSettings.asDataSearch[i])){oSettings.aiDisplay.splice(i-iIndexCorrector,1);
365
iIndexCorrector++}}}}oSettings.oPreviousSearch.sSearch=sInput;oSettings.oPreviousSearch.bEscapeRegex=bEscapeRegex
366
- }function _fnSort(oSettings,bApplyClasses){var aaSort=[];var oSort=_oExt.oSort;var aoData=oSettings.aoData;
367
- var iDataSort;var iDataType;var i,j,jLen;if(oSettings.aaSorting.length!==0||oSettings.aaSortingFixed!==null){if(oSettings.aaSortingFixed!==null){aaSort=oSettings.aaSortingFixed.concat(oSettings.aaSorting)
368
}else{aaSort=oSettings.aaSorting.slice()}for(i=0;i<aaSort.length;i++){var iColumn=aaSort[i][0];
369
var sDataType=oSettings.aoColumns[iColumn].sSortDataType;if(typeof _oExt.afnSortData[sDataType]!="undefined"){var iCorrector=0;
370
var aData=_oExt.afnSortData[sDataType](oSettings,iColumn);for(j=0,jLen=aoData.length;
@@ -373,7 +359,7 @@ j<jLen;j++){if(aoData[j]!==null){aoData[j]._aData[iColumn]=aData[iCorrector];iCo
373
for(i=0;i<aaSort.length-1;i++){iDataSort=oSettings.aoColumns[aaSort[i][0]].iDataSort;
374
iDataType=oSettings.aoColumns[iDataSort].sType;sDynamicSort+="iTest = oSort['"+iDataType+"-"+aaSort[i][1]+"']( aoData[a]._aData["+iDataSort+"], aoData[b]._aData["+iDataSort+"] ); if ( iTest === 0 )"
375
}iDataSort=oSettings.aoColumns[aaSort[aaSort.length-1][0]].iDataSort;iDataType=oSettings.aoColumns[iDataSort].sType;
376
- sDynamicSort+="iTest = oSort['"+iDataType+"-"+aaSort[aaSort.length-1][1]+"']( aoData[a]._aData["+iDataSort+"], aoData[b]._aData["+iDataSort+"] ); return iTest;}";
377
eval(sDynamicSort);oSettings.aiDisplayMaster.sort(fnLocalSorting)}else{var aAirSort=[];
378
var iLen=aaSort.length;for(i=0;i<iLen;i++){iDataSort=oSettings.aoColumns[aaSort[i][0]].iDataSort;
379
aAirSort.push([iDataSort,oSettings.aoColumns[iDataSort].sType+"-"+aaSort[i][1]])}oSettings.aiDisplayMaster.sort(function(a,b){var iTest;
@@ -381,7 +367,19 @@ for(var i=0;i<iLen;i++){iTest=oSort[aAirSort[i][1]](aoData[a]._aData[aAirSort[i]
381
if(iTest!==0){return iTest}}return 0})}}if(typeof bApplyClasses=="undefined"||bApplyClasses){_fnSortingClasses(oSettings)
382
}oSettings.bSorted=true;if(oSettings.oFeatures.bFilter){_fnFilterComplete(oSettings,oSettings.oPreviousSearch,1)
383
}else{oSettings.aiDisplay=oSettings.aiDisplayMaster.slice();oSettings._iDisplayStart=0;
384
- _fnCalculateEnd(oSettings);_fnDraw(oSettings)}}function _fnSortingClasses(oSettings){var i,j,iFound;
385
var aaSort,sClass;var iColumns=oSettings.aoColumns.length;var oClasses=oSettings.oClasses;
386
for(i=0;i<iColumns;i++){if(oSettings.aoColumns[i].bSortable){$(oSettings.aoColumns[i].nTh).removeClass(oClasses.sSortAsc+" "+oClasses.sSortDesc+" "+oSettings.aoColumns[i].sSortingClass)
387
}}if(oSettings.aaSortingFixed!==null){aaSort=oSettings.aaSortingFixed.concat(oSettings.aaSorting)
@@ -391,24 +389,56 @@ iFound=j;break}}$(oSettings.aoColumns[i].nTh).addClass(sClass);if(oSettings.bJUI
391
jqSpan.removeClass(oClasses.sSortJUIAsc+" "+oClasses.sSortJUIDesc+" "+oClasses.sSortJUI+" "+oClasses.sSortJUIAscAllowed+" "+oClasses.sSortJUIDescAllowed);
392
var sSpanClass;if(iFound==-1){sSpanClass=oSettings.aoColumns[i].sSortingClassJUI}else{if(aaSort[iFound][1]=="asc"){sSpanClass=oClasses.sSortJUIAsc
393
}else{sSpanClass=oClasses.sSortJUIDesc}}jqSpan.addClass(sSpanClass)}}else{$(oSettings.aoColumns[i].nTh).addClass(oSettings.aoColumns[i].sSortingClass)
394
- }}if(oSettings.oFeatures.bSort&&oSettings.oFeatures.bSortClasses){var nTrs=_fnGetTrNodes(oSettings);
395
- sClass=oClasses.sSortColumn;$("td",nTrs).removeClass(sClass+"1 "+sClass+"2 "+sClass+"3");
396
- var iClass=1;for(i=0;i<aaSort.length;i++){var iVis=_fnColumnIndexToVisible(oSettings,aaSort[i][0]);
397
- if(iVis!==null){if(iClass<=2){$("td:eq("+iVis+")",nTrs).addClass(sClass+iClass)}else{$("td:eq("+iVis+")",nTrs).addClass(sClass+"3")
398
- }iClass++}}}}function _fnVisibleToColumnIndex(oSettings,iMatch){var iColumn=-1;for(var i=0;
399
i<oSettings.aoColumns.length;i++){if(oSettings.aoColumns[i].bVisible===true){iColumn++
400
}if(iColumn==iMatch){return i}}return null}function _fnColumnIndexToVisible(oSettings,iMatch){var iVisible=-1;
401
for(var i=0;i<oSettings.aoColumns.length;i++){if(oSettings.aoColumns[i].bVisible===true){iVisible++
402
}if(i==iMatch){return oSettings.aoColumns[i].bVisible===true?iVisible:null}}return null
403
- }function _fnVisbleColumns(oS){var iVis=0;for(var i=0;i<oS.aoColumns.length;i++){if(oS.aoColumns[i].bVisible===true){iVis++
404
- }}return iVis}function _fnBuildSearchArray(oSettings,iMaster){oSettings.asDataSearch.splice(0,oSettings.asDataSearch.length);
405
- var aArray=(typeof iMaster!="undefined"&&iMaster==1)?oSettings.aiDisplayMaster:oSettings.aiDisplay;
406
- for(var i=0,iLen=aArray.length;i<iLen;i++){oSettings.asDataSearch[i]="";for(var j=0,jLen=oSettings.aoColumns.length;
407
- j<jLen;j++){if(oSettings.aoColumns[j].bSearchable){var sData=oSettings.aoData[aArray[i]]._aData[j];
408
- oSettings.asDataSearch[i]+=_fnDataToSearch(sData,oSettings.aoColumns[j].sType)+" "
409
- }}}}function _fnDataToSearch(sData,sType){if(typeof _oExt.ofnSearch[sType]=="function"){return _oExt.ofnSearch[sType](sData)
410
- }else{if(sType=="html"){return sData.replace(/\n/g," ").replace(/<.*?>/g,"")}else{if(typeof sData=="string"){return sData.replace(/\n/g," ")
411
- }}}return sData}function _fnCalculateEnd(oSettings){if(oSettings.oFeatures.bPaginate===false){oSettings._iDisplayEnd=oSettings.aiDisplay.length
412
}else{if(oSettings._iDisplayStart+oSettings._iDisplayLength>oSettings.aiDisplay.length||oSettings._iDisplayLength==-1){oSettings._iDisplayEnd=oSettings.aiDisplay.length
413
}else{oSettings._iDisplayEnd=oSettings._iDisplayStart+oSettings._iDisplayLength}}}function _fnConvertToWidth(sWidth,nParent){if(!sWidth||sWidth===null||sWidth===""){return 0
414
}if(typeof nParent=="undefined"){nParent=document.getElementsByTagName("body")[0]
@@ -428,7 +458,8 @@ if(oSettings.aoColumns[i].sWidth!==null){var sWidth="";if(oSettings.aoColumns[i]
428
sCalcHtml+="</tr>";nCalcTmp=$(sTableTmp+sCalcHead+sCalcHtml+"</table>")[0];nCalcTmp.style.width=iTableWidth+"px";
429
nCalcTmp.style.visibility="hidden";nCalcTmp.style.position="absolute";oSettings.nTable.parentNode.appendChild(nCalcTmp);
430
var oNodes=$("tr:eq(1)>td",nCalcTmp);var iIndex;for(i=0;i<oNodes.length;i++){iIndex=oNodes[i].getAttribute("tag_index");
431
- oSettings.aoColumns[iIndex].sWidth=$("td",nCalcTmp)[i].offsetWidth+"px"}oSettings.nTable.parentNode.removeChild(nCalcTmp)
432
}}function fnGetMaxLenString(oSettings,iCol){var iMax=0;var iMaxIndex=-1;for(var i=0;
433
i<oSettings.aoData.length;i++){if(oSettings.aoData[i]._aData[iCol].length>iMax){iMax=oSettings.aoData[i]._aData[iCol].length;
434
iMaxIndex=i}}if(iMaxIndex>=0){return oSettings.aoData[iMaxIndex]._aData[iCol]}return""
@@ -440,7 +471,14 @@ i++){if(_aoSettings[i].nTable==nTable){return _aoSettings[i]}}return null}functi
440
var iLen=oSettings.aoData.length;for(var i=0;i<iLen;i++){if(oSettings.aoData[i]===null){aData.push(null)
441
}else{aData.push(oSettings.aoData[i]._aData)}}return aData}function _fnGetTrNodes(oSettings){var aNodes=[];
442
var iLen=oSettings.aoData.length;for(var i=0;i<iLen;i++){if(oSettings.aoData[i]===null){aNodes.push(null)
443
- }else{aNodes.push(oSettings.aoData[i].nTr)}}return aNodes}function _fnEscapeRegex(sVal){var acEscape=["/",".","*","+","?","|","(",")","[","]","{","}","\\","quot;,"^"];
444
var reReplace=new RegExp("(\\"+acEscape.join("|\\")+")","g");return sVal.replace(reReplace,"\\$1")
445
}function _fnReOrderIndex(oSettings,sColumns){var aColumns=sColumns.split(",");var aiReturn=[];
446
for(var i=0,iLen=oSettings.aoColumns.length;i<iLen;i++){for(var j=0;j<iLen;j++){if(oSettings.aoColumns[i].sName==aColumns[j]){aiReturn.push(j);
@@ -463,16 +501,16 @@ for(i=0;i<oSettings.aoColumns.length;i++){sValue+=oSettings.aoColumns[i].bVisibl
463
}else{oData=eval("("+sData+")")}}catch(e){return}oSettings._iDisplayStart=oData.iStart;
464
oSettings.iInitDisplayStart=oData.iStart;oSettings._iDisplayEnd=oData.iEnd;oSettings._iDisplayLength=oData.iLength;
465
oSettings.oPreviousSearch.sSearch=oData.sFilter;oSettings.aaSorting=oData.aaSorting.slice();
466
- if(typeof oData.sFilterEsc!="undefined"){oSettings.oPreviousSearch.bEscapeRegex=oData.sFilterEsc
467
}if(typeof oData.aaSearchCols!="undefined"){for(var i=0;i<oData.aaSearchCols.length;
468
i++){oSettings.aoPreSearchCols[i]={sSearch:oData.aaSearchCols[i][0],bEscapeRegex:oData.aaSearchCols[i][1]}
469
}}if(typeof oData.abVisCols!="undefined"){oInit.saved_aoColumns=[];for(i=0;i<oData.abVisCols.length;
470
i++){oInit.saved_aoColumns[i]={};oInit.saved_aoColumns[i].bVisible=oData.abVisCols[i]
471
}}}}function _fnCreateCookie(sName,sValue,iSecs){var date=new Date();date.setTime(date.getTime()+(iSecs*1000));
472
- sName+="_"+window.location.pathname.replace(/[\/:]/g,"").toLowerCase();document.cookie=sName+"="+sValue+"; expires="+date.toGMTString()+"; path=/"
473
}function _fnReadCookie(sName){var sNameEQ=sName+"_"+window.location.pathname.replace(/[\/:]/g,"").toLowerCase()+"=";
474
var sCookieContents=document.cookie.split(";");for(var i=0;i<sCookieContents.length;
475
- i++){var c=sCookieContents[i];while(c.charAt(0)==" "){c=c.substring(1,c.length)}if(c.indexOf(sNameEQ)===0){return c.substring(sNameEQ.length,c.length)
476
}}return null}function _fnGetUniqueThs(nThead){var nTrs=nThead.getElementsByTagName("tr");
477
if(nTrs.length==1){return nTrs[0].getElementsByTagName("th")}var aLayout=[],aReturn=[];
478
var ROWSPAN=2,COLSPAN=3,TDELEM=4;var i,j,k,iLen,jLen,iColumnShifted;var fnShiftCol=function(a,i,j){while(typeof a[i][j]!="undefined"){j++
@@ -491,21 +529,24 @@ this.oApi._fnLanguageProcess=_fnLanguageProcess;this.oApi._fnAddColumn=_fnAddCol
491
this.oApi._fnAddData=_fnAddData;this.oApi._fnGatherData=_fnGatherData;this.oApi._fnDrawHead=_fnDrawHead;
492
this.oApi._fnDraw=_fnDraw;this.oApi._fnAjaxUpdate=_fnAjaxUpdate;this.oApi._fnAddOptionsHtml=_fnAddOptionsHtml;
493
this.oApi._fnFeatureHtmlFilter=_fnFeatureHtmlFilter;this.oApi._fnFeatureHtmlInfo=_fnFeatureHtmlInfo;
494
- this.oApi._fnFeatureHtmlPaginate=_fnFeatureHtmlPaginate;this.oApi._fnFeatureHtmlLength=_fnFeatureHtmlLength;
495
- this.oApi._fnFeatureHtmlProcessing=_fnFeatureHtmlProcessing;this.oApi._fnProcessingDisplay=_fnProcessingDisplay;
496
- this.oApi._fnFilterComplete=_fnFilterComplete;this.oApi._fnFilterColumn=_fnFilterColumn;
497
- this.oApi._fnFilter=_fnFilter;this.oApi._fnSortingClasses=_fnSortingClasses;this.oApi._fnVisibleToColumnIndex=_fnVisibleToColumnIndex;
498
- this.oApi._fnColumnIndexToVisible=_fnColumnIndexToVisible;this.oApi._fnVisbleColumns=_fnVisbleColumns;
499
this.oApi._fnBuildSearchArray=_fnBuildSearchArray;this.oApi._fnDataToSearch=_fnDataToSearch;
500
this.oApi._fnCalculateEnd=_fnCalculateEnd;this.oApi._fnConvertToWidth=_fnConvertToWidth;
501
this.oApi._fnCalculateColumnWidths=_fnCalculateColumnWidths;this.oApi._fnArrayCmp=_fnArrayCmp;
502
this.oApi._fnDetectType=_fnDetectType;this.oApi._fnGetDataMaster=_fnGetDataMaster;
503
- this.oApi._fnGetTrNodes=_fnGetTrNodes;this.oApi._fnEscapeRegex=_fnEscapeRegex;this.oApi._fnReOrderIndex=_fnReOrderIndex;
504
- this.oApi._fnColumnOrdering=_fnColumnOrdering;this.oApi._fnClearTable=_fnClearTable;
505
- this.oApi._fnSaveState=_fnSaveState;this.oApi._fnLoadState=_fnLoadState;this.oApi._fnCreateCookie=_fnCreateCookie;
506
- this.oApi._fnReadCookie=_fnReadCookie;this.oApi._fnGetUniqueThs=_fnGetUniqueThs;this.oApi._fnReDraw=_fnReDraw;
507
- var _that=this;return this.each(function(){var oSettings=new classSettings();_aoSettings.push(oSettings);
508
- var i=0,iLen;var bInitHandedOff=false;var bUsePassedData=false;var sId=this.getAttribute("id");
509
if(sId!==null){oSettings.sTableId=sId;oSettings.sInstance=sId}else{oSettings.sInstance=_oExt._oExternConfig.iNextUnique++
510
}oSettings.nTable=this;oSettings.oApi=_that.oApi;if(typeof oInit!="undefined"&&oInit!==null){_fnMap(oSettings.oFeatures,oInit,"bPaginate");
511
_fnMap(oSettings.oFeatures,oInit,"bLengthChange");_fnMap(oSettings.oFeatures,oInit,"bFilter");
@@ -514,16 +555,18 @@ _fnMap(oSettings.oFeatures,oInit,"bProcessing");_fnMap(oSettings.oFeatures,oInit
514
_fnMap(oSettings.oFeatures,oInit,"bSortClasses");_fnMap(oSettings.oFeatures,oInit,"bServerSide");
515
_fnMap(oSettings,oInit,"asStripClasses");_fnMap(oSettings,oInit,"fnRowCallback");
516
_fnMap(oSettings,oInit,"fnHeaderCallback");_fnMap(oSettings,oInit,"fnFooterCallback");
517
- _fnMap(oSettings,oInit,"fnDrawCallback");_fnMap(oSettings,oInit,"fnInitComplete");
518
- _fnMap(oSettings,oInit,"fnServerData");_fnMap(oSettings,oInit,"aaSorting");_fnMap(oSettings,oInit,"aaSortingFixed");
519
- _fnMap(oSettings,oInit,"sPaginationType");_fnMap(oSettings,oInit,"sAjaxSource");_fnMap(oSettings,oInit,"iCookieDuration");
520
- _fnMap(oSettings,oInit,"sDom");_fnMap(oSettings,oInit,"oSearch","oPreviousSearch");
521
- _fnMap(oSettings,oInit,"aoSearchCols","aoPreSearchCols");_fnMap(oSettings,oInit,"iDisplayLength","_iDisplayLength");
522
- _fnMap(oSettings,oInit,"bJQueryUI","bJUI");if(typeof oInit.bJQueryUI!="undefined"&&oInit.bJQueryUI){oSettings.oClasses=_oExt.oJUIClasses;
523
if(typeof oInit.sDom=="undefined"){oSettings.sDom='<"H"lfr>t<"F"ip>'}}if(typeof oInit.iDisplayStart!="undefined"&&typeof oSettings.iInitDisplayStart=="undefined"){oSettings.iInitDisplayStart=oInit.iDisplayStart;
524
oSettings._iDisplayStart=oInit.iDisplayStart}if(typeof oInit.bStateSave!="undefined"){oSettings.oFeatures.bStateSave=oInit.bStateSave;
525
- _fnLoadState(oSettings,oInit)}if(typeof oInit.aaData!="undefined"){bUsePassedData=true
526
- }if(typeof oInit!="undefined"&&typeof oInit.aoData!="undefined"){oInit.aoColumns=oInit.aoData
527
}if(typeof oInit.oLanguage!="undefined"){if(typeof oInit.oLanguage.sUrl!="undefined"&&oInit.oLanguage.sUrl!==""){oSettings.oLanguage.sUrl=oInit.oLanguage.sUrl;
528
$.getJSON(oSettings.oLanguage.sUrl,null,function(json){_fnLanguageProcess(oSettings,json,true)
529
});bInitHandedOff=true}else{_fnLanguageProcess(oSettings,oInit.oLanguage,false)}}}else{oInit={}
@@ -533,8 +576,10 @@ var nThs=nThead.length===0?null:_fnGetUniqueThs(nThead[0]);var bUseCols=typeof o
533
for(i=0,iLen=bUseCols?oInit.aoColumns.length:nThs.length;i<iLen;i++){var oCol=bUseCols?oInit.aoColumns[i]:null;
534
var nTh=nThs?nThs[i]:null;if(typeof oInit.saved_aoColumns!="undefined"&&oInit.saved_aoColumns.length==iLen){if(oCol===null){oCol={}
535
}oCol.bVisible=oInit.saved_aoColumns[i].bVisible}_fnAddColumn(oSettings,oCol,nTh)
536
- }for(i=0;i<oSettings.aaSorting.length;i++){if(typeof oSettings.aaSorting[i][2]=="undefined"){oSettings.aaSorting[i][2]=0
537
- }}if(this.getElementsByTagName("thead").length===0){this.appendChild(document.createElement("thead"))
538
}if(this.getElementsByTagName("tbody").length===0){this.appendChild(document.createElement("tbody"))
539
}if(bUsePassedData){for(i=0;i<oInit.aaData.length;i++){_fnAddData(oSettings,oInit.aaData[i])
540
}}else{_fnGatherData(oSettings)}oSettings.aiDisplay=oSettings.aiDisplayMaster.slice();
1
/*
2
* File: jquery.dataTables.min.js
3
+ * Version: 1.6.2
4
* Author: Allan Jardine (www.sprymedia.co.uk)
5
* Info: www.datatables.net
6
*
7
+ * Copyright 2008-2010 Allan Jardine, all rights reserved.
8
*
9
* This source file is free software, under either the GPL v2 license or a
10
* BSD style license, as supplied with this software.
13
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14
* or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
15
*/
16
+ (function($){$.fn.dataTableSettings=[];var _aoSettings=$.fn.dataTableSettings;$.fn.dataTableExt={};
17
+ var _oExt=$.fn.dataTableExt;_oExt.sVersion="1.6.2";_oExt.iApiIndex=0;_oExt.oApi={};
18
+ _oExt.afnFiltering=[];_oExt.aoFeatures=[];_oExt.ofnSearch={};_oExt.afnSortData=[];
19
+ _oExt.oStdClasses={sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active",sPageButtonStaticDisabled:"paginate_button",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripOdd:"odd",sStripEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:""};
20
_oExt.oJUIClasses={sPagePrevEnabled:"fg-button ui-state-default ui-corner-left",sPagePrevDisabled:"fg-button ui-state-default ui-corner-left ui-state-disabled",sPageNextEnabled:"fg-button ui-state-default ui-corner-right",sPageNextDisabled:"fg-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",sPageButton:"fg-button ui-state-default",sPageButtonActive:"fg-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-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",sStripOdd:"odd",sStripEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate fg-buttonset fg-buttonset-multi paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",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_",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"};
21
+ _oExt.oPagination={two_button:{fnInit:function(oSettings,nPaging,fnCallbackDraw){var nPrevious,nNext,nPreviousInner,nNextInner;
22
+ if(!oSettings.bJUI){nPrevious=document.createElement("div");nNext=document.createElement("div")
23
+ }else{nPrevious=document.createElement("a");nNext=document.createElement("a");nNextInner=document.createElement("span");
24
+ nNextInner.className=oSettings.oClasses.sPageJUINext;nNext.appendChild(nNextInner);
25
+ nPreviousInner=document.createElement("span");nPreviousInner.className=oSettings.oClasses.sPageJUIPrev;
26
+ nPrevious.appendChild(nPreviousInner)}nPrevious.className=oSettings.oClasses.sPagePrevDisabled;
27
+ nNext.className=oSettings.oClasses.sPageNextDisabled;nPrevious.title=oSettings.oLanguage.oPaginate.sPrevious;
28
+ nNext.title=oSettings.oLanguage.oPaginate.sNext;nPaging.appendChild(nPrevious);nPaging.appendChild(nNext);
29
+ $(nPrevious).click(function(){if(oSettings.oApi._fnPageChange(oSettings,"previous")){fnCallbackDraw(oSettings)
30
+ }});$(nNext).click(function(){if(oSettings.oApi._fnPageChange(oSettings,"next")){fnCallbackDraw(oSettings)
31
+ }});$(nPrevious).bind("selectstart",function(){return false});$(nNext).bind("selectstart",function(){return false
32
+ });if(oSettings.sTableId!==""&&typeof oSettings.aanFeatures.p=="undefined"){nPaging.setAttribute("id",oSettings.sTableId+"_paginate");
33
+ nPrevious.setAttribute("id",oSettings.sTableId+"_previous");nNext.setAttribute("id",oSettings.sTableId+"_next")
34
+ }},fnUpdate:function(oSettings,fnCallbackDraw){if(!oSettings.aanFeatures.p){return
35
+ }var an=oSettings.aanFeatures.p;for(var i=0,iLen=an.length;i<iLen;i++){if(an[i].childNodes.length!==0){an[i].childNodes[0].className=(oSettings._iDisplayStart===0)?oSettings.oClasses.sPagePrevDisabled:oSettings.oClasses.sPagePrevEnabled;
36
+ an[i].childNodes[1].className=(oSettings.fnDisplayEnd()==oSettings.fnRecordsDisplay())?oSettings.oClasses.sPageNextDisabled:oSettings.oClasses.sPageNextEnabled
37
+ }}}},iFullNumbersShowPages:5,full_numbers:{fnInit:function(oSettings,nPaging,fnCallbackDraw){var nFirst=document.createElement("span");
38
+ var nPrevious=document.createElement("span");var nList=document.createElement("span");
39
+ var nNext=document.createElement("span");var nLast=document.createElement("span");
40
+ nFirst.innerHTML=oSettings.oLanguage.oPaginate.sFirst;nPrevious.innerHTML=oSettings.oLanguage.oPaginate.sPrevious;
41
+ nNext.innerHTML=oSettings.oLanguage.oPaginate.sNext;nLast.innerHTML=oSettings.oLanguage.oPaginate.sLast;
42
+ var oClasses=oSettings.oClasses;nFirst.className=oClasses.sPageButton+" "+oClasses.sPageFirst;
43
+ nPrevious.className=oClasses.sPageButton+" "+oClasses.sPagePrevious;nNext.className=oClasses.sPageButton+" "+oClasses.sPageNext;
44
+ nLast.className=oClasses.sPageButton+" "+oClasses.sPageLast;nPaging.appendChild(nFirst);
45
+ nPaging.appendChild(nPrevious);nPaging.appendChild(nList);nPaging.appendChild(nNext);
46
+ nPaging.appendChild(nLast);$(nFirst).click(function(){if(oSettings.oApi._fnPageChange(oSettings,"first")){fnCallbackDraw(oSettings)
47
+ }});$(nPrevious).click(function(){if(oSettings.oApi._fnPageChange(oSettings,"previous")){fnCallbackDraw(oSettings)
48
+ }});$(nNext).click(function(){if(oSettings.oApi._fnPageChange(oSettings,"next")){fnCallbackDraw(oSettings)
49
+ }});$(nLast).click(function(){if(oSettings.oApi._fnPageChange(oSettings,"last")){fnCallbackDraw(oSettings)
50
+ }});$("span",nPaging).bind("mousedown",function(){return false}).bind("selectstart",function(){return false
51
+ });if(oSettings.sTableId!==""&&typeof oSettings.aanFeatures.p=="undefined"){nPaging.setAttribute("id",oSettings.sTableId+"_paginate");
52
nFirst.setAttribute("id",oSettings.sTableId+"_first");nPrevious.setAttribute("id",oSettings.sTableId+"_previous");
53
nNext.setAttribute("id",oSettings.sTableId+"_next");nLast.setAttribute("id",oSettings.sTableId+"_last")
54
+ }},fnUpdate:function(oSettings,fnCallbackDraw){if(!oSettings.aanFeatures.p){return
55
+ }var iPageCount=_oExt.oPagination.iFullNumbersShowPages;var iPageCountHalf=Math.floor(iPageCount/2);
56
+ var iPages=Math.ceil((oSettings.fnRecordsDisplay())/oSettings._iDisplayLength);var iCurrentPage=Math.ceil(oSettings._iDisplayStart/oSettings._iDisplayLength)+1;
57
+ var sList="";var iStartButton,iEndButton,i,iLen;var oClasses=oSettings.oClasses;if(iPages<iPageCount){iStartButton=1;
58
iEndButton=iPages}else{if(iCurrentPage<=iPageCountHalf){iStartButton=1;iEndButton=iPageCount
59
}else{if(iCurrentPage>=(iPages-iPageCountHalf)){iStartButton=iPages-iPageCount+1;
60
iEndButton=iPages}else{iStartButton=iCurrentPage-Math.ceil(iPageCount/2)+1;iEndButton=iStartButton+iPageCount-1
61
+ }}}for(i=iStartButton;i<=iEndButton;i++){if(iCurrentPage!=i){sList+='<span class="'+oClasses.sPageButton+'">'+i+"</span>"
62
+ }else{sList+='<span class="'+oClasses.sPageButtonActive+'">'+i+"</span>"}}var an=oSettings.aanFeatures.p;
63
+ var anButtons,anStatic,nPaginateList;var fnClick=function(){var iTarget=(this.innerHTML*1)-1;
64
oSettings._iDisplayStart=iTarget*oSettings._iDisplayLength;fnCallbackDraw(oSettings);
65
+ return false};var fnFalse=function(){return false};for(i=0,iLen=an.length;i<iLen;
66
+ i++){if(an[i].childNodes.length===0){continue}nPaginateList=an[i].childNodes[2];nPaginateList.innerHTML=sList;
67
+ $("span",nPaginateList).click(fnClick).bind("mousedown",fnFalse).bind("selectstart",fnFalse);
68
+ anButtons=an[i].getElementsByTagName("span");anStatic=[anButtons[0],anButtons[1],anButtons[anButtons.length-2],anButtons[anButtons.length-1]];
69
+ $(anStatic).removeClass(oClasses.sPageButton+" "+oClasses.sPageButtonActive+" "+oClasses.sPageButtonStaticDisabled);
70
+ if(iCurrentPage==1){anStatic[0].className+=" "+oClasses.sPageButtonStaticDisabled;
71
+ anStatic[1].className+=" "+oClasses.sPageButtonStaticDisabled}else{anStatic[0].className+=" "+oClasses.sPageButton;
72
+ anStatic[1].className+=" "+oClasses.sPageButton}if(iPages===0||iCurrentPage==iPages||oSettings._iDisplayLength==-1){anStatic[2].className+=" "+oClasses.sPageButtonStaticDisabled;
73
+ anStatic[3].className+=" "+oClasses.sPageButtonStaticDisabled}else{anStatic[2].className+=" "+oClasses.sPageButton;
74
+ anStatic[3].className+=" "+oClasses.sPageButton}}}}};_oExt.oSort={"string-asc":function(a,b){var x=a.toLowerCase();
75
var y=b.toLowerCase();return((x<y)?-1:((x>y)?1:0))},"string-desc":function(a,b){var x=a.toLowerCase();
76
var y=b.toLowerCase();return((x<y)?1:((x>y)?-1:0))},"html-asc":function(a,b){var x=a.replace(/<.*?>/g,"").toLowerCase();
77
var y=b.replace(/<.*?>/g,"").toLowerCase();return((x<y)?-1:((x>y)?1:0))},"html-desc":function(a,b){var x=a.replace(/<.*?>/g,"").toLowerCase();
86
}for(var i=1;i<sData.length;i++){Char=sData.charAt(i);if(sValidChars.indexOf(Char)==-1){return null
87
}if(Char=="."){if(bDecimal){return null}bDecimal=true}}return"numeric"},function(sData){var iParse=Date.parse(sData);
88
if(iParse!==null&&!isNaN(iParse)){return"date"}return null}];_oExt._oExternConfig={iNextUnique:0};
89
+ $.fn.dataTable=function(oInit){function classSettings(){this.fnRecordsTotal=function(){if(this.oFeatures.bServerSide){return this._iRecordsTotal
90
}else{return this.aiDisplayMaster.length}};this.fnRecordsDisplay=function(){if(this.oFeatures.bServerSide){return this._iRecordsDisplay
91
}else{return this.aiDisplay.length}};this.fnDisplayEnd=function(){if(this.oFeatures.bServerSide){return this._iDisplayStart+this.aiDisplay.length
92
}else{return this._iDisplayEnd}};this.sInstance=null;this.oFeatures={bPaginate:true,bLengthChange:true,bFilter:true,bSort:true,bInfo:true,bAutoWidth:true,bProcessing:false,bSortClasses:true,bStateSave:false,bServerSide:false};
93
+ this.aanFeatures=[];this.oLanguage={sProcessing:"Processing...",sLengthMenu:"Show _MENU_ entries",sZeroRecords:"No matching records found",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sSearch:"Search:",sUrl:"",oPaginate:{sFirst:"First",sPrevious:"Previous",sNext:"Next",sLast:"Last"}};
94
this.aoData=[];this.aiDisplay=[];this.aiDisplayMaster=[];this.aoColumns=[];this.iNextId=0;
95
this.asDataSearch=[];this.oPreviousSearch={sSearch:"",bEscapeRegex:true};this.aoPreSearchCols=[];
96
this.aaSorting=[[0,"asc",0]];this.aaSortingFixed=null;this.asStripClasses=[];this.fnRowCallback=null;
97
+ this.fnHeaderCallback=null;this.fnFooterCallback=null;this.aoDrawCallback=[];this.fnInitComplete=null;
98
this.sTableId="";this.nTable=null;this.iDefaultSortIndex=0;this.bInitialised=false;
99
this.aoOpenRows=[];this.sDom="lfrtip";this.sPaginationType="two_button";this.iCookieDuration=60*60*2;
100
this.sAjaxSource=null;this.bAjaxDataGet=true;this.fnServerData=$.getJSON;this.iServerDraw=0;
106
if(typeof bEscapeRegex=="undefined"){bEscapeRegex=true}if(typeof iColumn=="undefined"||iColumn===null){_fnFilterComplete(oSettings,{sSearch:sInput,bEscapeRegex:bEscapeRegex},1)
107
}else{oSettings.aoPreSearchCols[iColumn].sSearch=sInput;oSettings.aoPreSearchCols[iColumn].bEscapeRegex=bEscapeRegex;
108
_fnFilterComplete(oSettings,oSettings.oPreviousSearch,1)}};this.fnSettings=function(nNode){return _fnSettingsFromNode(this[_oExt.iApiIndex])
109
+ };this.fnVersionCheck=function(sVersion){var fnZPad=function(Zpad,count){while(Zpad.length<count){Zpad+="0"
110
+ }return Zpad};var aThis=_oExt.sVersion.split(".");var aThat=sVersion.split(".");var sThis="",sThat="";
111
+ for(var i=0,iLen=aThat.length;i<iLen;i++){sThis+=fnZPad(aThis[i],3);sThat+=fnZPad(aThat[i],3)
112
+ }return parseInt(sThis,10)>=parseInt(sThat,10)};this.fnSort=function(aaSort){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
113
+ oSettings.aaSorting=aaSort;_fnSort(oSettings)};this.fnSortListener=function(nNode,iColumn,fnCallback){_fnSortAttachListener(_fnSettingsFromNode(this[_oExt.iApiIndex]),nNode,iColumn,fnCallback)
114
+ };this.fnAddData=function(mData,bRedraw){if(mData.length===0){return[]}var aiReturn=[];
115
+ var iTest;var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);if(typeof mData[0]=="object"){for(var i=0;
116
+ i<mData.length;i++){iTest=_fnAddData(oSettings,mData[i]);if(iTest==-1){return aiReturn
117
+ }aiReturn.push(iTest)}}else{iTest=_fnAddData(oSettings,mData);if(iTest==-1){return aiReturn
118
+ }aiReturn.push(iTest)}oSettings.aiDisplay=oSettings.aiDisplayMaster.slice();_fnBuildSearchArray(oSettings,1);
119
+ if(typeof bRedraw=="undefined"||bRedraw){_fnReDraw(oSettings)}return aiReturn};this.fnDeleteRow=function(mTarget,fnCallBack,bNullRow){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
120
+ var i,iAODataIndex;iAODataIndex=(typeof mTarget=="object")?_fnNodeToDataIndex(oSettings,mTarget):mTarget;
121
+ for(i=0;i<oSettings.aiDisplayMaster.length;i++){if(oSettings.aiDisplayMaster[i]==iAODataIndex){oSettings.aiDisplayMaster.splice(i,1);
122
break}}for(i=0;i<oSettings.aiDisplay.length;i++){if(oSettings.aiDisplay[i]==iAODataIndex){oSettings.aiDisplay.splice(i,1);
123
break}}_fnBuildSearchArray(oSettings,1);if(typeof fnCallBack=="function"){fnCallBack.call(this)
124
}if(oSettings._iDisplayStart>=oSettings.aiDisplay.length){oSettings._iDisplayStart-=oSettings._iDisplayLength;
131
nNewRow.appendChild(nNewCell);nNewCell.className=sClass;nNewCell.colSpan=_fnVisbleColumns(oSettings);
132
nNewCell.innerHTML=sHtml;var nTrs=$("tbody tr",oSettings.nTable);if($.inArray(nTr,nTrs)!=-1){$(nNewRow).insertAfter(nTr)
133
}if(!oSettings.oFeatures.bServerSide){oSettings.aoOpenRows.push({nTr:nNewRow,nParent:nTr})
134
+ }return nNewRow};this.fnClose=function(nTr){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
135
for(var i=0;i<oSettings.aoOpenRows.length;i++){if(oSettings.aoOpenRows[i].nParent==nTr){var nTrParent=oSettings.aoOpenRows[i].nTr.parentNode;
136
if(nTrParent){nTrParent.removeChild(oSettings.aoOpenRows[i].nTr)}oSettings.aoOpenRows.splice(i,1);
137
+ return 0}}return 1};this.fnGetData=function(mRow){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
138
+ if(typeof mRow!="undefined"){var iRow=(typeof mRow=="object")?_fnNodeToDataIndex(oSettings,mRow):mRow;
139
+ return oSettings.aoData[iRow]._aData}return _fnGetDataMaster(oSettings)};this.fnGetNodes=function(iRow){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
140
if(typeof iRow!="undefined"){return oSettings.aoData[iRow].nTr}return _fnGetTrNodes(oSettings)
141
};this.fnGetPosition=function(nNode){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
142
+ var i;if(nNode.nodeName=="TR"){return _fnNodeToDataIndex(oSettings,nNode)}else{if(nNode.nodeName=="TD"){var iDataIndex=_fnNodeToDataIndex(oSettings,nNode.parentNode);
143
+ var iCorrector=0;for(var j=0;j<oSettings.aoColumns.length;j++){if(oSettings.aoColumns[j].bVisible){if(oSettings.aoData[iDataIndex].nTr.getElementsByTagName("td")[j-iCorrector]==nNode){return[iDataIndex,j-iCorrector,j]
144
+ }}else{iCorrector++}}}}return null};this.fnUpdate=function(mData,mRow,iColumn,bRedraw){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
145
+ var iVisibleColumn;var sDisplay;var iRow=(typeof mRow=="object")?_fnNodeToDataIndex(oSettings,mRow):mRow;
146
+ if(typeof mData!="object"){sDisplay=mData;oSettings.aoData[iRow]._aData[iColumn]=sDisplay;
147
+ if(oSettings.aoColumns[iColumn].fnRender!==null){sDisplay=oSettings.aoColumns[iColumn].fnRender({iDataRow:iRow,iDataColumn:iColumn,aData:oSettings.aoData[iRow]._aData,oSettings:oSettings});
148
if(oSettings.aoColumns[iColumn].bUseRendered){oSettings.aoData[iRow]._aData[iColumn]=sDisplay
149
}}iVisibleColumn=_fnColumnIndexToVisible(oSettings,iColumn);if(iVisibleColumn!==null){oSettings.aoData[iRow].nTr.getElementsByTagName("td")[iVisibleColumn].innerHTML=sDisplay
150
+ }}else{if(mData.length!=oSettings.aoColumns.length){alert("DataTables warning: An array passed to fnUpdate must have the same number of columns as the table in question - in this case "+oSettings.aoColumns.length);
151
return 1}for(var i=0;i<mData.length;i++){sDisplay=mData[i];oSettings.aoData[iRow]._aData[i]=sDisplay;
152
if(oSettings.aoColumns[i].fnRender!==null){sDisplay=oSettings.aoColumns[i].fnRender({iDataRow:iRow,iDataColumn:i,aData:oSettings.aoData[iRow]._aData,oSettings:oSettings});
153
if(oSettings.aoColumns[i].bUseRendered){oSettings.aoData[iRow]._aData[i]=sDisplay
154
}}iVisibleColumn=_fnColumnIndexToVisible(oSettings,i);if(iVisibleColumn!==null){oSettings.aoData[iRow].nTr.getElementsByTagName("td")[iVisibleColumn].innerHTML=sDisplay
155
+ }}}_fnBuildSearchArray(oSettings,1);if(typeof bRedraw!="undefined"&&bRedraw){_fnReDraw(oSettings)
156
+ }return 0};this.fnSetColumnVis=function(iCol,bShow){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
157
+ var i,iLen;var iColumns=oSettings.aoColumns.length;var nTd,anTds;if(oSettings.aoColumns[iCol].bVisible==bShow){return
158
}var nTrHead=$("thead:eq(0)>tr",oSettings.nTable)[0];var nTrFoot=$("tfoot:eq(0)>tr",oSettings.nTable)[0];
159
var anTheadTh=[];var anTfootTh=[];for(i=0;i<iColumns;i++){anTheadTh.push(oSettings.aoColumns[i].nTh);
160
anTfootTh.push(oSettings.aoColumns[i].nTf)}if(bShow){var iInsert=0;for(i=0;i<iCol;
164
}}else{var iBefore;for(i=iCol;i<iColumns;i++){iBefore=_fnColumnIndexToVisible(oSettings,i);
165
if(iBefore!==null){break}}nTrHead.insertBefore(anTheadTh[iCol],nTrHead.getElementsByTagName("th")[iBefore]);
166
if(nTrFoot){nTrFoot.insertBefore(anTfootTh[iCol],nTrFoot.getElementsByTagName("th")[iBefore])
167
+ }anTds=_fnGetTdNodes(oSettings);for(i=0,iLen=oSettings.aoData.length;i<iLen;i++){nTd=oSettings.aoData[i]._anHidden[iCol];
168
+ oSettings.aoData[i].nTr.insertBefore(nTd,$(">td:eq("+iBefore+")",oSettings.aoData[i].nTr)[0])
169
}}oSettings.aoColumns[iCol].bVisible=true}else{nTrHead.removeChild(anTheadTh[iCol]);
170
+ if(nTrFoot){nTrFoot.removeChild(anTfootTh[iCol])}anTds=_fnGetTdNodes(oSettings);for(i=0,iLen=oSettings.aoData.length;
171
+ i<iLen;i++){nTd=anTds[(i*oSettings.aoColumns.length)+iCol];oSettings.aoData[i]._anHidden[iCol]=nTd;
172
+ nTd.parentNode.removeChild(nTd)}oSettings.aoColumns[iCol].bVisible=false}for(i=0,iLen=oSettings.aoOpenRows.length;
173
+ i<iLen;i++){oSettings.aoOpenRows[i].nTr.colSpan=_fnVisbleColumns(oSettings)}_fnSaveState(oSettings)
174
+ };this.fnPageChange=function(sAction,bRedraw){var oSettings=_fnSettingsFromNode(this[_oExt.iApiIndex]);
175
+ _fnPageChange(oSettings,sAction);_fnCalculateEnd(oSettings);if(typeof bRedraw=="undefined"||bRedraw){_fnDraw(oSettings)
176
+ }};function _fnExternApiFunc(sFunc){return function(){var aArgs=[_fnSettingsFromNode(this[_oExt.iApiIndex])].concat(Array.prototype.slice.call(arguments));
177
return _oExt.oApi[sFunc].apply(this,aArgs)}}for(var sFunc in _oExt.oApi){if(sFunc){this[sFunc]=_fnExternApiFunc(sFunc)
178
}}function _fnInitalise(oSettings){if(oSettings.bInitialised===false){setTimeout(function(){_fnInitalise(oSettings)
179
+ },200);return}_fnAddOptionsHtml(oSettings);_fnDrawHead(oSettings);if(oSettings.oFeatures.bSort){_fnSort(oSettings,false);
180
+ _fnSortingClasses(oSettings)}else{oSettings.aiDisplay=oSettings.aiDisplayMaster.slice();
181
+ _fnCalculateEnd(oSettings);_fnDraw(oSettings)}if(oSettings.sAjaxSource!==null&&!oSettings.oFeatures.bServerSide){_fnProcessingDisplay(oSettings,true);
182
+ oSettings.fnServerData(oSettings.sAjaxSource,null,function(json){for(var i=0;i<json.aaData.length;
183
i++){_fnAddData(oSettings,json.aaData[i])}oSettings.iInitDisplayStart=oSettings._iDisplayStart;
184
if(oSettings.oFeatures.bSort){_fnSort(oSettings)}else{oSettings.aiDisplay=oSettings.aiDisplayMaster.slice();
185
_fnCalculateEnd(oSettings);_fnDraw(oSettings)}_fnProcessingDisplay(oSettings,false);
204
oCol.sSortingClassJUI=oSettings.oClasses.sSortJUIAscAllowed}else{if($.inArray("asc",oCol.asSorting)==-1&&$.inArray("desc",oCol.asSorting)!=-1){oCol.sSortingClass=oSettings.oClasses.sSortableDesc;
205
oCol.sSortingClassJUI=oSettings.oClasses.sSortJUIDescAllowed}}}if(typeof oSettings.aoPreSearchCols[iLength]=="undefined"||oSettings.aoPreSearchCols[iLength]===null){oSettings.aoPreSearchCols[iLength]={sSearch:"",bEscapeRegex:true}
206
}else{if(typeof oSettings.aoPreSearchCols[iLength].bEscapeRegex=="undefined"){oSettings.aoPreSearchCols[iLength].bEscapeRegex=true
207
+ }}}function _fnAddData(oSettings,aData){if(aData.length!=oSettings.aoColumns.length){alert("DataTables warning: Added data does not match known number of columns");
208
+ return -1}var iThisIndex=oSettings.aoData.length;oSettings.aoData.push({nTr:document.createElement("tr"),_iId:oSettings.iNextId++,_aData:aData.slice(),_anHidden:[],_sRowStripe:""});
209
+ var nTd,sThisType;for(var i=0;i<aData.length;i++){nTd=document.createElement("td");
210
+ if(typeof oSettings.aoColumns[i].fnRender=="function"){var sRendered=oSettings.aoColumns[i].fnRender({iDataRow:iThisIndex,iDataColumn:i,aData:aData,oSettings:oSettings});
211
nTd.innerHTML=sRendered;if(oSettings.aoColumns[i].bUseRendered){oSettings.aoData[iThisIndex]._aData[i]=sRendered
212
}}else{nTd.innerHTML=aData[i]}if(oSettings.aoColumns[i].sClass!==null){nTd.className=oSettings.aoColumns[i].sClass
213
+ }if(oSettings.aoColumns[i]._bAutoType&&oSettings.aoColumns[i].sType!="string"){sThisType=_fnDetectType(oSettings.aoData[iThisIndex]._aData[i]);
214
+ if(oSettings.aoColumns[i].sType===null){oSettings.aoColumns[i].sType=sThisType}else{if(oSettings.aoColumns[i].sType!=sThisType){oSettings.aoColumns[i].sType="string"
215
}}}if(oSettings.aoColumns[i].bVisible){oSettings.aoData[iThisIndex].nTr.appendChild(nTd)
216
}else{oSettings.aoData[iThisIndex]._anHidden[i]=nTd}}oSettings.aiDisplayMaster.push(iThisIndex);
217
+ return iThisIndex}function _fnGatherData(oSettings){var iLoop,i,iLen,j,jLen,jInner,nTds,nTrs,nTd,aLocalData,iThisIndex,iRow,iRows,iColumn,iColumns;
218
+ if(oSettings.sAjaxSource===null){nTrs=oSettings.nTable.getElementsByTagName("tbody")[0].childNodes;
219
+ for(i=0,iLen=nTrs.length;i<iLen;i++){if(nTrs[i].nodeName=="TR"){iThisIndex=oSettings.aoData.length;
220
+ oSettings.aoData.push({nTr:nTrs[i],_iId:oSettings.iNextId++,_aData:[],_anHidden:[],_sRowStripe:""});
221
+ oSettings.aiDisplayMaster.push(iThisIndex);aLocalData=oSettings.aoData[iThisIndex]._aData;
222
+ nTds=nTrs[i].childNodes;jInner=0;for(j=0,jLen=nTds.length;j<jLen;j++){if(nTds[j].nodeName=="TD"){aLocalData[jInner]=nTds[j].innerHTML;
223
+ jInner++}}}}}nTrs=_fnGetTrNodes(oSettings);nTds=[];for(i=0,iLen=nTrs.length;i<iLen;
224
+ i++){for(j=0,jLen=nTrs[i].childNodes.length;j<jLen;j++){nTd=nTrs[i].childNodes[j];
225
+ if(nTd.nodeName=="TD"){nTds.push(nTd)}}}if(nTds.length!=nTrs.length*oSettings.aoColumns.length){alert("DataTables warning: Unexpected number of TD elements. Expected "+(nTrs.length*oSettings.aoColumns.length)+" and got "+nTds.length+". DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination.")
226
+ }for(iColumn=0,iColumns=oSettings.aoColumns.length;iColumn<iColumns;iColumn++){if(oSettings.aoColumns[iColumn].sTitle===null){oSettings.aoColumns[iColumn].sTitle=oSettings.aoColumns[iColumn].nTh.innerHTML
227
+ }var bAutoType=oSettings.aoColumns[iColumn]._bAutoType,bRender=typeof oSettings.aoColumns[iColumn].fnRender=="function",bClass=oSettings.aoColumns[iColumn].sClass!==null,bVisible=oSettings.aoColumns[iColumn].bVisible,nCell,sThisType,sRendered;
228
+ if(bAutoType||bRender||bClass||!bVisible){for(iRow=0,iRows=oSettings.aoData.length;
229
+ iRow<iRows;iRow++){nCell=nTds[(iRow*iColumns)+iColumn];if(bAutoType){if(oSettings.aoColumns[iColumn].sType!="string"){sThisType=_fnDetectType(oSettings.aoData[iRow]._aData[iColumn]);
230
+ if(oSettings.aoColumns[iColumn].sType===null){oSettings.aoColumns[iColumn].sType=sThisType
231
+ }else{if(oSettings.aoColumns[iColumn].sType!=sThisType){oSettings.aoColumns[iColumn].sType="string"
232
+ }}}}if(bRender){sRendered=oSettings.aoColumns[iColumn].fnRender({iDataRow:iRow,iDataColumn:iColumn,aData:oSettings.aoData[iRow]._aData,oSettings:oSettings});
233
+ nCell.innerHTML=sRendered;if(oSettings.aoColumns[iColumn].bUseRendered){oSettings.aoData[iRow]._aData[iColumn]=sRendered
234
+ }}if(bClass){nCell.className+=" "+oSettings.aoColumns[iColumn].sClass}if(!bVisible){oSettings.aoData[iRow]._anHidden[iColumn]=nCell;
235
+ nCell.parentNode.removeChild(nCell)}}}}}function _fnDrawHead(oSettings){var i,nTh,iLen;
236
var iThs=oSettings.nTable.getElementsByTagName("thead")[0].getElementsByTagName("th").length;
237
var iCorrector=0;if(iThs!==0){for(i=0,iLen=oSettings.aoColumns.length;i<iLen;i++){nTh=oSettings.aoColumns[i].nTh;
238
if(oSettings.aoColumns[i].bVisible){if(oSettings.aoColumns[i].sWidth!==null){nTh.style.width=oSettings.aoColumns[i].sWidth
243
}if(oSettings.aoColumns[i].sWidth!==null){nTh.style.width=oSettings.aoColumns[i].sWidth
244
}nTr.appendChild(nTh)}}$("thead:eq(0)",oSettings.nTable).html("")[0].appendChild(nTr)
245
}if(oSettings.bJUI){for(i=0,iLen=oSettings.aoColumns.length;i<iLen;i++){oSettings.aoColumns[i].nTh.insertBefore(document.createElement("span"),oSettings.aoColumns[i].nTh.firstChild)
246
+ }}if(oSettings.oFeatures.bSort){for(i=0;i<oSettings.aoColumns.length;i++){if(oSettings.aoColumns[i].bSortable!==false){_fnSortAttachListener(oSettings,oSettings.aoColumns[i].nTh,i)
247
+ }else{$(oSettings.aoColumns[i].nTh).addClass(oSettings.oClasses.sSortableNone)}}$("thead:eq(0) th",oSettings.nTable).mousedown(function(e){if(e.shiftKey){this.onselectstart=function(){return false
248
+ };return false}})}var nTfoot=oSettings.nTable.getElementsByTagName("tfoot");if(nTfoot.length!==0){iCorrector=0;
249
var nTfs=nTfoot[0].getElementsByTagName("th");for(i=0,iLen=nTfs.length;i<iLen;i++){oSettings.aoColumns[i].nTf=nTfs[i-iCorrector];
250
if(!oSettings.aoColumns[i].bVisible){nTfs[i-iCorrector].parentNode.removeChild(nTfs[i-iCorrector]);
251
+ iCorrector++}}}}function _fnDraw(oSettings){var i,iLen;var anRows=[];var iRowCount=0;
252
+ var bRowError=false;var iStrips=oSettings.asStripClasses.length;var iOpenRows=oSettings.aoOpenRows.length;
253
+ if(oSettings.oFeatures.bServerSide&&!_fnAjaxUpdate(oSettings)){return}if(typeof oSettings.iInitDisplayStart!="undefined"&&oSettings.iInitDisplayStart!=-1){oSettings._iDisplayStart=(oSettings.iInitDisplayStart>=oSettings.fnRecordsDisplay())?0:oSettings.iInitDisplayStart;
254
oSettings.iInitDisplayStart=-1;_fnCalculateEnd(oSettings)}if(oSettings.aiDisplay.length!==0){var iStart=oSettings._iDisplayStart;
255
var iEnd=oSettings._iDisplayEnd;if(oSettings.oFeatures.bServerSide){iStart=0;iEnd=oSettings.aoData.length
256
+ }for(var j=iStart;j<iEnd;j++){var aoData=oSettings.aoData[oSettings.aiDisplay[j]];
257
+ var nRow=aoData.nTr;if(iStrips!==0){var sStrip=oSettings.asStripClasses[iRowCount%iStrips];
258
+ if(aoData._sRowStripe!=sStrip){$(nRow).removeClass(aoData._sRowStripe).addClass(sStrip);
259
+ aoData._sRowStripe=sStrip}}if(typeof oSettings.fnRowCallback=="function"){nRow=oSettings.fnRowCallback(nRow,oSettings.aoData[oSettings.aiDisplay[j]]._aData,iRowCount,j);
260
+ if(!nRow&&!bRowError){alert("DataTables warning: A node was not returned by fnRowCallback");
261
+ bRowError=true}}anRows.push(nRow);iRowCount++;if(iOpenRows!==0){for(var k=0;k<iOpenRows;
262
+ k++){if(nRow==oSettings.aoOpenRows[k].nParent){anRows.push(oSettings.aoOpenRows[k].nTr)
263
}}}}}else{anRows[0]=document.createElement("tr");if(typeof oSettings.asStripClasses[0]!="undefined"){anRows[0].className=oSettings.asStripClasses[0]
264
}var nTd=document.createElement("td");nTd.setAttribute("valign","top");nTd.colSpan=oSettings.aoColumns.length;
265
nTd.className=oSettings.oClasses.sRowEmpty;nTd.innerHTML=oSettings.oLanguage.sZeroRecords;
266
anRows[iRowCount].appendChild(nTd)}if(typeof oSettings.fnHeaderCallback=="function"){oSettings.fnHeaderCallback($("thead:eq(0)>tr",oSettings.nTable)[0],_fnGetDataMaster(oSettings),oSettings._iDisplayStart,oSettings.fnDisplayEnd(),oSettings.aiDisplay)
267
}if(typeof oSettings.fnFooterCallback=="function"){oSettings.fnFooterCallback($("tfoot:eq(0)>tr",oSettings.nTable)[0],_fnGetDataMaster(oSettings),oSettings._iDisplayStart,oSettings.fnDisplayEnd(),oSettings.aiDisplay)
268
+ }var nBody=oSettings.nTable.getElementsByTagName("tbody");if(nBody[0]){var nTrs=nBody[0].childNodes;
269
+ for(i=nTrs.length-1;i>=0;i--){nTrs[i].parentNode.removeChild(nTrs[i])}for(i=0,iLen=anRows.length;
270
+ i<iLen;i++){nBody[0].appendChild(anRows[i])}}for(i=0,iLen=oSettings.aoDrawCallback.length;
271
+ i<iLen;i++){oSettings.aoDrawCallback[i].fn(oSettings)}oSettings.bSorted=false;oSettings.bFiltered=false;
272
+ if(typeof oSettings._bInitComplete=="undefined"){oSettings._bInitComplete=true;if(oSettings.oFeatures.bAutoWidth&&oSettings.nTable.offsetWidth!==0){oSettings.nTable.style.width=oSettings.nTable.offsetWidth+"px"
273
+ }}}function _fnReDraw(oSettings){if(oSettings.oFeatures.bSort){_fnSort(oSettings,oSettings.oPreviousSearch)
274
}else{if(oSettings.oFeatures.bFilter){_fnFilterComplete(oSettings,oSettings.oPreviousSearch)
275
}else{_fnCalculateEnd(oSettings);_fnDraw(oSettings)}}}function _fnAjaxUpdate(oSettings){if(oSettings.bAjaxDataGet){_fnProcessingDisplay(oSettings,true);
276
var iColumns=oSettings.aoColumns.length;var aoData=[];var i;oSettings.iServerDraw++;
284
aoData.push({name:"bSearchable_"+i,value:oSettings.aoColumns[i].bSearchable})}}if(oSettings.oFeatures.bSort!==false){var iFixed=oSettings.aaSortingFixed!==null?oSettings.aaSortingFixed.length:0;
285
var iUser=oSettings.aaSorting.length;aoData.push({name:"iSortingCols",value:iFixed+iUser});
286
for(i=0;i<iFixed;i++){aoData.push({name:"iSortCol_"+i,value:oSettings.aaSortingFixed[i][0]});
287
+ aoData.push({name:"sSortDir_"+i,value:oSettings.aaSortingFixed[i][1]})}for(i=0;i<iUser;
288
+ i++){aoData.push({name:"iSortCol_"+(i+iFixed),value:oSettings.aaSorting[i][0]});aoData.push({name:"sSortDir_"+(i+iFixed),value:oSettings.aaSorting[i][1]})
289
}for(i=0;i<iColumns;i++){aoData.push({name:"bSortable_"+i,value:oSettings.aoColumns[i].bSortable})
290
}}oSettings.fnServerData(oSettings.sAjaxSource,aoData,function(json){_fnAjaxUpdateDraw(oSettings,json)
291
});return false}else{return true}}function _fnAjaxUpdateDraw(oSettings,json){if(typeof json.sEcho!="undefined"){if(json.sEcho*1<oSettings.iServerDraw){return
302
nWrapper.className=oSettings.oClasses.sWrapper;if(oSettings.sTableId!==""){nWrapper.setAttribute("id",oSettings.sTableId+"_wrapper")
303
}var nInsertNode=nWrapper;var sDom=oSettings.sDom.replace("H","fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix");
304
sDom=sDom.replace("F","fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix");
305
+ var aDom=sDom.split("");var nTmp,iPushFeature,cOption,nNewNode,cNext,sClass,j;for(var i=0;
306
+ i<aDom.length;i++){iPushFeature=0;cOption=aDom[i];if(cOption=="<"){nNewNode=document.createElement("div");
307
+ cNext=aDom[i+1];if(cNext=="'"||cNext=='"'){sClass="";j=2;while(aDom[i+j]!=cNext){sClass+=aDom[i+j];
308
+ j++}nNewNode.className=sClass;i+=j}nInsertNode.appendChild(nNewNode);nInsertNode=nNewNode
309
+ }else{if(cOption==">"){nInsertNode=nInsertNode.parentNode}else{if(cOption=="l"&&oSettings.oFeatures.bPaginate&&oSettings.oFeatures.bLengthChange){nTmp=_fnFeatureHtmlLength(oSettings);
310
+ iPushFeature=1}else{if(cOption=="f"&&oSettings.oFeatures.bFilter){nTmp=_fnFeatureHtmlFilter(oSettings);
311
+ iPushFeature=1}else{if(cOption=="r"&&oSettings.oFeatures.bProcessing){nTmp=_fnFeatureHtmlProcessing(oSettings);
312
+ iPushFeature=1}else{if(cOption=="t"){nTmp=oSettings.nTable;iPushFeature=1}else{if(cOption=="i"&&oSettings.oFeatures.bInfo){nTmp=_fnFeatureHtmlInfo(oSettings);
313
+ iPushFeature=1}else{if(cOption=="p"&&oSettings.oFeatures.bPaginate){nTmp=_fnFeatureHtmlPaginate(oSettings);
314
+ iPushFeature=1}else{if(_oExt.aoFeatures.length!==0){var aoFeatures=_oExt.aoFeatures;
315
for(var k=0,kLen=aoFeatures.length;k<kLen;k++){if(cOption==aoFeatures[k].cFeature){nTmp=aoFeatures[k].fnInit(oSettings);
316
+ if(nTmp){iPushFeature=1}break}}}}}}}}}}}if(iPushFeature==1){if(typeof oSettings.aanFeatures[cOption]!="object"){oSettings.aanFeatures[cOption]=[]
317
+ }oSettings.aanFeatures[cOption].push(nTmp);nInsertNode.appendChild(nTmp)}}nHolding.parentNode.replaceChild(nWrapper,nHolding)
318
}function _fnFeatureHtmlFilter(oSettings){var nFilter=document.createElement("div");
319
+ if(oSettings.sTableId!==""&&typeof oSettings.aanFeatures.f=="undefined"){nFilter.setAttribute("id",oSettings.sTableId+"_filter")
320
}nFilter.className=oSettings.oClasses.sFilter;var sSpace=oSettings.oLanguage.sSearch===""?"":" ";
321
nFilter.innerHTML=oSettings.oLanguage.sSearch+sSpace+'<input type="text" />';var jqFilter=$("input",nFilter);
322
+ jqFilter.val(oSettings.oPreviousSearch.sSearch.replace('"',"&quot;"));jqFilter.keyup(function(e){var n=oSettings.aanFeatures.f;
323
+ for(var i=0,iLen=n.length;i<iLen;i++){if(n[i]!=this.parentNode){$("input",n[i]).val(this.value)
324
+ }}_fnFilterComplete(oSettings,{sSearch:this.value,bEscapeRegex:oSettings.oPreviousSearch.bEscapeRegex})
325
});jqFilter.keypress(function(e){if(e.keyCode==13){return false}});return nFilter
326
+ }function _fnFilterComplete(oSettings,oInput,iForce){_fnFilter(oSettings,oInput.sSearch,iForce,oInput.bEscapeRegex);
327
for(var i=0;i<oSettings.aoPreSearchCols.length;i++){_fnFilterColumn(oSettings,oSettings.aoPreSearchCols[i].sSearch,i,oSettings.aoPreSearchCols[i].bEscapeRegex)
328
}if(_oExt.afnFiltering.length!==0){_fnFilterCustom(oSettings)}oSettings.bFiltered=true;
329
oSettings._iDisplayStart=0;_fnCalculateEnd(oSettings);_fnDraw(oSettings);_fnBuildSearchArray(oSettings,0)
342
_fnBuildSearchArray(oSettings,1);for(i=0;i<oSettings.aiDisplayMaster.length;i++){if(rpSearch.test(oSettings.asDataSearch[i])){oSettings.aiDisplay.push(oSettings.aiDisplayMaster[i])
343
}}}else{var iIndexCorrector=0;for(i=0;i<oSettings.asDataSearch.length;i++){if(!rpSearch.test(oSettings.asDataSearch[i])){oSettings.aiDisplay.splice(i-iIndexCorrector,1);
344
iIndexCorrector++}}}}oSettings.oPreviousSearch.sSearch=sInput;oSettings.oPreviousSearch.bEscapeRegex=bEscapeRegex
345
+ }function _fnBuildSearchArray(oSettings,iMaster){oSettings.asDataSearch.splice(0,oSettings.asDataSearch.length);
346
+ var aArray=(typeof iMaster!="undefined"&&iMaster==1)?oSettings.aiDisplayMaster:oSettings.aiDisplay;
347
+ for(var i=0,iLen=aArray.length;i<iLen;i++){oSettings.asDataSearch[i]="";for(var j=0,jLen=oSettings.aoColumns.length;
348
+ j<jLen;j++){if(oSettings.aoColumns[j].bSearchable){var sData=oSettings.aoData[aArray[i]]._aData[j];
349
+ oSettings.asDataSearch[i]+=_fnDataToSearch(sData,oSettings.aoColumns[j].sType)+" "
350
+ }}}}function _fnDataToSearch(sData,sType){if(typeof _oExt.ofnSearch[sType]=="function"){return _oExt.ofnSearch[sType](sData)
351
+ }else{if(sType=="html"){return sData.replace(/\n/g," ").replace(/<.*?>/g,"")}else{if(typeof sData=="string"){return sData.replace(/\n/g," ")
352
+ }}}return sData}function _fnSort(oSettings,bApplyClasses){var aaSort=[];var oSort=_oExt.oSort;
353
+ var aoData=oSettings.aoData;var iDataSort;var iDataType;var i,j,jLen;if(!oSettings.oFeatures.bServerSide&&(oSettings.aaSorting.length!==0||oSettings.aaSortingFixed!==null)){if(oSettings.aaSortingFixed!==null){aaSort=oSettings.aaSortingFixed.concat(oSettings.aaSorting)
354
}else{aaSort=oSettings.aaSorting.slice()}for(i=0;i<aaSort.length;i++){var iColumn=aaSort[i][0];
355
var sDataType=oSettings.aoColumns[iColumn].sSortDataType;if(typeof _oExt.afnSortData[sDataType]!="undefined"){var iCorrector=0;
356
var aData=_oExt.afnSortData[sDataType](oSettings,iColumn);for(j=0,jLen=aoData.length;
359
for(i=0;i<aaSort.length-1;i++){iDataSort=oSettings.aoColumns[aaSort[i][0]].iDataSort;
360
iDataType=oSettings.aoColumns[iDataSort].sType;sDynamicSort+="iTest = oSort['"+iDataType+"-"+aaSort[i][1]+"']( aoData[a]._aData["+iDataSort+"], aoData[b]._aData["+iDataSort+"] ); if ( iTest === 0 )"
361
}iDataSort=oSettings.aoColumns[aaSort[aaSort.length-1][0]].iDataSort;iDataType=oSettings.aoColumns[iDataSort].sType;
362
+ sDynamicSort+="iTest = oSort['"+iDataType+"-"+aaSort[aaSort.length-1][1]+"']( aoData[a]._aData["+iDataSort+"], aoData[b]._aData["+iDataSort+"] );if (iTest===0) return oSort['numeric-"+aaSort[aaSort.length-1][1]+"'](a, b); return iTest;}";
363
eval(sDynamicSort);oSettings.aiDisplayMaster.sort(fnLocalSorting)}else{var aAirSort=[];
364
var iLen=aaSort.length;for(i=0;i<iLen;i++){iDataSort=oSettings.aoColumns[aaSort[i][0]].iDataSort;
365
aAirSort.push([iDataSort,oSettings.aoColumns[iDataSort].sType+"-"+aaSort[i][1]])}oSettings.aiDisplayMaster.sort(function(a,b){var iTest;
367
if(iTest!==0){return iTest}}return 0})}}if(typeof bApplyClasses=="undefined"||bApplyClasses){_fnSortingClasses(oSettings)
368
}oSettings.bSorted=true;if(oSettings.oFeatures.bFilter){_fnFilterComplete(oSettings,oSettings.oPreviousSearch,1)
369
}else{oSettings.aiDisplay=oSettings.aiDisplayMaster.slice();oSettings._iDisplayStart=0;
370
+ _fnCalculateEnd(oSettings);_fnDraw(oSettings)}}function _fnSortAttachListener(oSettings,nNode,iDataIndex,fnCallback){$(nNode).click(function(e){if(oSettings.aoColumns[iDataIndex].bSortable===false){return
371
+ }var fnInnerSorting=function(){var iColumn,iNextSort;if(e.shiftKey){var bFound=false;
372
+ for(var i=0;i<oSettings.aaSorting.length;i++){if(oSettings.aaSorting[i][0]==iDataIndex){bFound=true;
373
+ iColumn=oSettings.aaSorting[i][0];iNextSort=oSettings.aaSorting[i][2]+1;if(typeof oSettings.aoColumns[iColumn].asSorting[iNextSort]=="undefined"){oSettings.aaSorting.splice(i,1)
374
+ }else{oSettings.aaSorting[i][1]=oSettings.aoColumns[iColumn].asSorting[iNextSort];
375
+ oSettings.aaSorting[i][2]=iNextSort}break}}if(bFound===false){oSettings.aaSorting.push([iDataIndex,oSettings.aoColumns[iDataIndex].asSorting[0],0])
376
+ }}else{if(oSettings.aaSorting.length==1&&oSettings.aaSorting[0][0]==iDataIndex){iColumn=oSettings.aaSorting[0][0];
377
+ iNextSort=oSettings.aaSorting[0][2]+1;if(typeof oSettings.aoColumns[iColumn].asSorting[iNextSort]=="undefined"){iNextSort=0
378
+ }oSettings.aaSorting[0][1]=oSettings.aoColumns[iColumn].asSorting[iNextSort];oSettings.aaSorting[0][2]=iNextSort
379
+ }else{oSettings.aaSorting.splice(0,oSettings.aaSorting.length);oSettings.aaSorting.push([iDataIndex,oSettings.aoColumns[iDataIndex].asSorting[0],0])
380
+ }}_fnSort(oSettings)};if(!oSettings.oFeatures.bProcessing){fnInnerSorting()}else{_fnProcessingDisplay(oSettings,true);
381
+ setTimeout(function(){fnInnerSorting();if(!oSettings.oFeatures.bServerSide){_fnProcessingDisplay(oSettings,false)
382
+ }},0)}if(typeof fnCallback=="function"){fnCallback(oSettings)}})}function _fnSortingClasses(oSettings){var i,iLen,j,jLen,iFound;
383
var aaSort,sClass;var iColumns=oSettings.aoColumns.length;var oClasses=oSettings.oClasses;
384
for(i=0;i<iColumns;i++){if(oSettings.aoColumns[i].bSortable){$(oSettings.aoColumns[i].nTh).removeClass(oClasses.sSortAsc+" "+oClasses.sSortDesc+" "+oSettings.aoColumns[i].sSortingClass)
385
}}if(oSettings.aaSortingFixed!==null){aaSort=oSettings.aaSortingFixed.concat(oSettings.aaSorting)
389
jqSpan.removeClass(oClasses.sSortJUIAsc+" "+oClasses.sSortJUIDesc+" "+oClasses.sSortJUI+" "+oClasses.sSortJUIAscAllowed+" "+oClasses.sSortJUIDescAllowed);
390
var sSpanClass;if(iFound==-1){sSpanClass=oSettings.aoColumns[i].sSortingClassJUI}else{if(aaSort[iFound][1]=="asc"){sSpanClass=oClasses.sSortJUIAsc
391
}else{sSpanClass=oClasses.sSortJUIDesc}}jqSpan.addClass(sSpanClass)}}else{$(oSettings.aoColumns[i].nTh).addClass(oSettings.aoColumns[i].sSortingClass)
392
+ }}sClass=oClasses.sSortColumn;if(oSettings.oFeatures.bSort&&oSettings.oFeatures.bSortClasses){var nTds=_fnGetTdNodes(oSettings);
393
+ if(nTds.length>=iColumns){for(i=0;i<iColumns;i++){if(nTds[i].className.indexOf(sClass+"1")!=-1){for(j=0,jLen=(nTds.length/iColumns);
394
+ j<jLen;j++){nTds[(iColumns*j)+i].className=nTds[(iColumns*j)+i].className.replace(" "+sClass+"1","")
395
+ }}else{if(nTds[i].className.indexOf(sClass+"2")!=-1){for(j=0,jLen=(nTds.length/iColumns);
396
+ j<jLen;j++){nTds[(iColumns*j)+i].className=nTds[(iColumns*j)+i].className.replace(" "+sClass+"2","")
397
+ }}else{if(nTds[i].className.indexOf(sClass+"3")!=-1){for(j=0,jLen=(nTds.length/iColumns);
398
+ j<jLen;j++){nTds[(iColumns*j)+i].className=nTds[(iColumns*j)+i].className.replace(" "+sClass+"3","")
399
+ }}}}}}var iClass=1,iTargetCol;for(i=0;i<aaSort.length;i++){iTargetCol=parseInt(aaSort[i][0],10);
400
+ for(j=0,jLen=(nTds.length/iColumns);j<jLen;j++){nTds[(iColumns*j)+iTargetCol].className+=" "+sClass+iClass
401
+ }if(iClass<3){iClass++}}}}function _fnFeatureHtmlPaginate(oSettings){var nPaginate=document.createElement("div");
402
+ nPaginate.className=oSettings.oClasses.sPaging+oSettings.sPaginationType;_oExt.oPagination[oSettings.sPaginationType].fnInit(oSettings,nPaginate,function(oSettings){_fnCalculateEnd(oSettings);
403
+ _fnDraw(oSettings)});if(typeof oSettings.aanFeatures.p=="undefined"){oSettings.aoDrawCallback.push({fn:function(oSettings){_oExt.oPagination[oSettings.sPaginationType].fnUpdate(oSettings,function(oSettings){_fnCalculateEnd(oSettings);
404
+ _fnDraw(oSettings)})},sName:"pagination"})}return nPaginate}function _fnPageChange(oSettings,sAction){var iOldStart=oSettings._iDisplayStart;
405
+ if(sAction=="first"){oSettings._iDisplayStart=0}else{if(sAction=="previous"){oSettings._iDisplayStart=oSettings._iDisplayLength>=0?oSettings._iDisplayStart-oSettings._iDisplayLength:0;
406
+ if(oSettings._iDisplayStart<0){oSettings._iDisplayStart=0}}else{if(sAction=="next"){if(oSettings._iDisplayLength>=0){if(oSettings._iDisplayStart+oSettings._iDisplayLength<oSettings.fnRecordsDisplay()){oSettings._iDisplayStart+=oSettings._iDisplayLength
407
+ }}else{oSettings._iDisplayStart=0}}else{if(sAction=="last"){if(oSettings._iDisplayLength>=0){var iPages=parseInt((oSettings.fnRecordsDisplay()-1)/oSettings._iDisplayLength,10)+1;
408
+ oSettings._iDisplayStart=(iPages-1)*oSettings._iDisplayLength}else{oSettings._iDisplayStart=0
409
+ }}else{alert("DataTables warning: unknown paging action: "+sAction)}}}}return iOldStart!=oSettings._iDisplayStart
410
+ }function _fnFeatureHtmlInfo(oSettings){var nInfo=document.createElement("div");nInfo.className=oSettings.oClasses.sInfo;
411
+ if(typeof oSettings.aanFeatures.i=="undefined"){oSettings.aoDrawCallback.push({fn:_fnUpdateInfo,sName:"information"});
412
+ if(oSettings.sTableId!==""){nInfo.setAttribute("id",oSettings.sTableId+"_info")}}return nInfo
413
+ }function _fnUpdateInfo(oSettings){if(!oSettings.oFeatures.bInfo||oSettings.aanFeatures.i.length===0){return
414
+ }var nFirst=oSettings.aanFeatures.i[0];if(oSettings.fnRecordsDisplay()===0&&oSettings.fnRecordsDisplay()==oSettings.fnRecordsTotal()){nFirst.innerHTML=oSettings.oLanguage.sInfoEmpty+oSettings.oLanguage.sInfoPostFix
415
+ }else{if(oSettings.fnRecordsDisplay()===0){nFirst.innerHTML=oSettings.oLanguage.sInfoEmpty+" "+oSettings.oLanguage.sInfoFiltered.replace("_MAX_",oSettings.fnRecordsTotal())+oSettings.oLanguage.sInfoPostFix
416
+ }else{if(oSettings.fnRecordsDisplay()==oSettings.fnRecordsTotal()){nFirst.innerHTML=oSettings.oLanguage.sInfo.replace("_START_",oSettings._iDisplayStart+1).replace("_END_",oSettings.fnDisplayEnd()).replace("_TOTAL_",oSettings.fnRecordsDisplay())+oSettings.oLanguage.sInfoPostFix
417
+ }else{nFirst.innerHTML=oSettings.oLanguage.sInfo.replace("_START_",oSettings._iDisplayStart+1).replace("_END_",oSettings.fnDisplayEnd()).replace("_TOTAL_",oSettings.fnRecordsDisplay())+" "+oSettings.oLanguage.sInfoFiltered.replace("_MAX_",oSettings.fnRecordsTotal())+oSettings.oLanguage.sInfoPostFix
418
+ }}}var n=oSettings.aanFeatures.i;if(n.length>1){var sInfo=nFirst.innerHTML;for(var i=1,iLen=n.length;
419
+ i<iLen;i++){n[i].innerHTML=sInfo}}}function _fnFeatureHtmlLength(oSettings){var sName=(oSettings.sTableId==="")?"":'name="'+oSettings.sTableId+'_length"';
420
+ var sStdMenu='<select size="1" '+sName+'><option value="10">10</option><option value="25">25</option><option value="50">50</option><option value="100">100</option></select>';
421
+ var nLength=document.createElement("div");if(oSettings.sTableId!==""&&typeof oSettings.aanFeatures.l=="undefined"){nLength.setAttribute("id",oSettings.sTableId+"_length")
422
+ }nLength.className=oSettings.oClasses.sLength;nLength.innerHTML=oSettings.oLanguage.sLengthMenu.replace("_MENU_",sStdMenu);
423
+ $('select option[value="'+oSettings._iDisplayLength+'"]',nLength).attr("selected",true);
424
+ $("select",nLength).change(function(e){var iVal=$(this).val();var n=oSettings.aanFeatures.l;
425
+ for(var i=0,iLen=n.length;i<iLen;i++){if(n[i]!=this.parentNode){$("select",n[i]).val(iVal)
426
+ }}oSettings._iDisplayLength=parseInt(iVal,10);_fnCalculateEnd(oSettings);if(oSettings._iDisplayEnd==oSettings.aiDisplay.length){oSettings._iDisplayStart=oSettings._iDisplayEnd-oSettings._iDisplayLength;
427
+ if(oSettings._iDisplayStart<0){oSettings._iDisplayStart=0}}if(oSettings._iDisplayLength==-1){oSettings._iDisplayStart=0
428
+ }_fnDraw(oSettings)});return nLength}function _fnFeatureHtmlProcessing(oSettings){var nProcessing=document.createElement("div");
429
+ if(oSettings.sTableId!==""&&typeof oSettings.aanFeatures.r=="undefined"){nProcessing.setAttribute("id",oSettings.sTableId+"_processing")
430
+ }nProcessing.innerHTML=oSettings.oLanguage.sProcessing;nProcessing.className=oSettings.oClasses.sProcessing;
431
+ oSettings.nTable.parentNode.insertBefore(nProcessing,oSettings.nTable);return nProcessing
432
+ }function _fnProcessingDisplay(oSettings,bShow){if(oSettings.oFeatures.bProcessing){var an=oSettings.aanFeatures.r;
433
+ for(var i=0,iLen=an.length;i<iLen;i++){an[i].style.visibility=bShow?"visible":"hidden"
434
+ }}}function _fnVisibleToColumnIndex(oSettings,iMatch){var iColumn=-1;for(var i=0;
435
i<oSettings.aoColumns.length;i++){if(oSettings.aoColumns[i].bVisible===true){iColumn++
436
}if(iColumn==iMatch){return i}}return null}function _fnColumnIndexToVisible(oSettings,iMatch){var iVisible=-1;
437
for(var i=0;i<oSettings.aoColumns.length;i++){if(oSettings.aoColumns[i].bVisible===true){iVisible++
438
}if(i==iMatch){return oSettings.aoColumns[i].bVisible===true?iVisible:null}}return null
439
+ }function _fnNodeToDataIndex(s,n){for(var i=0,iLen=s.aoData.length;i<iLen;i++){if(s.aoData[i]!==null&&s.aoData[i].nTr==n){return i
440
+ }}return null}function _fnVisbleColumns(oS){var iVis=0;for(var i=0;i<oS.aoColumns.length;
441
+ i++){if(oS.aoColumns[i].bVisible===true){iVis++}}return iVis}function _fnCalculateEnd(oSettings){if(oSettings.oFeatures.bPaginate===false){oSettings._iDisplayEnd=oSettings.aiDisplay.length
442
}else{if(oSettings._iDisplayStart+oSettings._iDisplayLength>oSettings.aiDisplay.length||oSettings._iDisplayLength==-1){oSettings._iDisplayEnd=oSettings.aiDisplay.length
443
}else{oSettings._iDisplayEnd=oSettings._iDisplayStart+oSettings._iDisplayLength}}}function _fnConvertToWidth(sWidth,nParent){if(!sWidth||sWidth===null||sWidth===""){return 0
444
}if(typeof nParent=="undefined"){nParent=document.getElementsByTagName("body")[0]
458
sCalcHtml+="</tr>";nCalcTmp=$(sTableTmp+sCalcHead+sCalcHtml+"</table>")[0];nCalcTmp.style.width=iTableWidth+"px";
459
nCalcTmp.style.visibility="hidden";nCalcTmp.style.position="absolute";oSettings.nTable.parentNode.appendChild(nCalcTmp);
460
var oNodes=$("tr:eq(1)>td",nCalcTmp);var iIndex;for(i=0;i<oNodes.length;i++){iIndex=oNodes[i].getAttribute("tag_index");
461
+ var iContentWidth=$("td",nCalcTmp).eq(i).width();var iSetWidth=oSettings.aoColumns[i].sWidth?oSettings.aoColumns[i].sWidth.slice(0,-2):0;
462
+ oSettings.aoColumns[iIndex].sWidth=Math.max(iContentWidth,iSetWidth)+"px"}oSettings.nTable.parentNode.removeChild(nCalcTmp)
463
}}function fnGetMaxLenString(oSettings,iCol){var iMax=0;var iMaxIndex=-1;for(var i=0;
464
i<oSettings.aoData.length;i++){if(oSettings.aoData[i]._aData[iCol].length>iMax){iMax=oSettings.aoData[i]._aData[iCol].length;
465
iMaxIndex=i}}if(iMaxIndex>=0){return oSettings.aoData[iMaxIndex]._aData[iCol]}return""
471
var iLen=oSettings.aoData.length;for(var i=0;i<iLen;i++){if(oSettings.aoData[i]===null){aData.push(null)
472
}else{aData.push(oSettings.aoData[i]._aData)}}return aData}function _fnGetTrNodes(oSettings){var aNodes=[];
473
var iLen=oSettings.aoData.length;for(var i=0;i<iLen;i++){if(oSettings.aoData[i]===null){aNodes.push(null)
474
+ }else{aNodes.push(oSettings.aoData[i].nTr)}}return aNodes}function _fnGetTdNodes(oSettings){var nTrs=_fnGetTrNodes(oSettings);
475
+ var nTds=[],nTd;var anReturn=[];var iCorrector;var iRow,iRows,iColumn,iColumns;for(iRow=0,iRows=nTrs.length;
476
+ iRow<iRows;iRow++){nTds=[];for(iColumn=0,iColumns=nTrs[iRow].childNodes.length;iColumn<iColumns;
477
+ iColumn++){nTd=nTrs[iRow].childNodes[iColumn];if(nTd.nodeName=="TD"){nTds.push(nTd)
478
+ }}iCorrector=0;for(iColumn=0,iColumns=oSettings.aoColumns.length;iColumn<iColumns;
479
+ iColumn++){if(oSettings.aoColumns[iColumn].bVisible){anReturn.push(nTds[iColumn-iCorrector])
480
+ }else{anReturn.push(oSettings.aoData[iRow]._anHidden[iColumn]);iCorrector++}}}return anReturn
481
+ }function _fnEscapeRegex(sVal){var acEscape=["/",".","*","+","?","|","(",")","[","]","{","}","\\","quot;,"^"];
482
var reReplace=new RegExp("(\\"+acEscape.join("|\\")+")","g");return sVal.replace(reReplace,"\\$1")
483
}function _fnReOrderIndex(oSettings,sColumns){var aColumns=sColumns.split(",");var aiReturn=[];
484
for(var i=0,iLen=oSettings.aoColumns.length;i<iLen;i++){for(var j=0;j<iLen;j++){if(oSettings.aoColumns[i].sName==aColumns[j]){aiReturn.push(j);
501
}else{oData=eval("("+sData+")")}}catch(e){return}oSettings._iDisplayStart=oData.iStart;
502
oSettings.iInitDisplayStart=oData.iStart;oSettings._iDisplayEnd=oData.iEnd;oSettings._iDisplayLength=oData.iLength;
503
oSettings.oPreviousSearch.sSearch=oData.sFilter;oSettings.aaSorting=oData.aaSorting.slice();
504
+ oSettings.saved_aaSorting=oData.aaSorting.slice();if(typeof oData.sFilterEsc!="undefined"){oSettings.oPreviousSearch.bEscapeRegex=oData.sFilterEsc
505
}if(typeof oData.aaSearchCols!="undefined"){for(var i=0;i<oData.aaSearchCols.length;
506
i++){oSettings.aoPreSearchCols[i]={sSearch:oData.aaSearchCols[i][0],bEscapeRegex:oData.aaSearchCols[i][1]}
507
}}if(typeof oData.abVisCols!="undefined"){oInit.saved_aoColumns=[];for(i=0;i<oData.abVisCols.length;
508
i++){oInit.saved_aoColumns[i]={};oInit.saved_aoColumns[i].bVisible=oData.abVisCols[i]
509
}}}}function _fnCreateCookie(sName,sValue,iSecs){var date=new Date();date.setTime(date.getTime()+(iSecs*1000));
510
+ sName+="_"+window.location.pathname.replace(/[\/:]/g,"").toLowerCase();document.cookie=sName+"="+encodeURIComponent(sValue)+"; expires="+date.toGMTString()+"; path=/"
511
}function _fnReadCookie(sName){var sNameEQ=sName+"_"+window.location.pathname.replace(/[\/:]/g,"").toLowerCase()+"=";
512
var sCookieContents=document.cookie.split(";");for(var i=0;i<sCookieContents.length;
513
+ i++){var c=sCookieContents[i];while(c.charAt(0)==" "){c=c.substring(1,c.length)}if(c.indexOf(sNameEQ)===0){return decodeURIComponent(c.substring(sNameEQ.length,c.length))
514
}}return null}function _fnGetUniqueThs(nThead){var nTrs=nThead.getElementsByTagName("tr");
515
if(nTrs.length==1){return nTrs[0].getElementsByTagName("th")}var aLayout=[],aReturn=[];
516
var ROWSPAN=2,COLSPAN=3,TDELEM=4;var i,j,k,iLen,jLen,iColumnShifted;var fnShiftCol=function(a,i,j){while(typeof a[i][j]!="undefined"){j++
529
this.oApi._fnAddData=_fnAddData;this.oApi._fnGatherData=_fnGatherData;this.oApi._fnDrawHead=_fnDrawHead;
530
this.oApi._fnDraw=_fnDraw;this.oApi._fnAjaxUpdate=_fnAjaxUpdate;this.oApi._fnAddOptionsHtml=_fnAddOptionsHtml;
531
this.oApi._fnFeatureHtmlFilter=_fnFeatureHtmlFilter;this.oApi._fnFeatureHtmlInfo=_fnFeatureHtmlInfo;
532
+ this.oApi._fnFeatureHtmlPaginate=_fnFeatureHtmlPaginate;this.oApi._fnPageChange=_fnPageChange;
533
+ this.oApi._fnFeatureHtmlLength=_fnFeatureHtmlLength;this.oApi._fnFeatureHtmlProcessing=_fnFeatureHtmlProcessing;
534
+ this.oApi._fnProcessingDisplay=_fnProcessingDisplay;this.oApi._fnFilterComplete=_fnFilterComplete;
535
+ this.oApi._fnFilterColumn=_fnFilterColumn;this.oApi._fnFilter=_fnFilter;this.oApi._fnSortingClasses=_fnSortingClasses;
536
+ this.oApi._fnVisibleToColumnIndex=_fnVisibleToColumnIndex;this.oApi._fnColumnIndexToVisible=_fnColumnIndexToVisible;
537
+ this.oApi._fnNodeToDataIndex=_fnNodeToDataIndex;this.oApi._fnVisbleColumns=_fnVisbleColumns;
538
this.oApi._fnBuildSearchArray=_fnBuildSearchArray;this.oApi._fnDataToSearch=_fnDataToSearch;
539
this.oApi._fnCalculateEnd=_fnCalculateEnd;this.oApi._fnConvertToWidth=_fnConvertToWidth;
540
this.oApi._fnCalculateColumnWidths=_fnCalculateColumnWidths;this.oApi._fnArrayCmp=_fnArrayCmp;
541
this.oApi._fnDetectType=_fnDetectType;this.oApi._fnGetDataMaster=_fnGetDataMaster;
542
+ this.oApi._fnGetTrNodes=_fnGetTrNodes;this.oApi._fnGetTdNodes=_fnGetTdNodes;this.oApi._fnEscapeRegex=_fnEscapeRegex;
543
+ this.oApi._fnReOrderIndex=_fnReOrderIndex;this.oApi._fnColumnOrdering=_fnColumnOrdering;
544
+ this.oApi._fnClearTable=_fnClearTable;this.oApi._fnSaveState=_fnSaveState;this.oApi._fnLoadState=_fnLoadState;
545
+ this.oApi._fnCreateCookie=_fnCreateCookie;this.oApi._fnReadCookie=_fnReadCookie;this.oApi._fnGetUniqueThs=_fnGetUniqueThs;
546
+ this.oApi._fnReDraw=_fnReDraw;var _that=this;return this.each(function(){var i=0,iLen,j,jLen;
547
+ for(i=0,iLen=_aoSettings.length;i<iLen;i++){if(_aoSettings[i].nTable==this){alert("DataTables warning: Unable to re-initialise DataTable. Please use the API to make any configuration changes required.");
548
+ return _aoSettings[i]}}var oSettings=new classSettings();_aoSettings.push(oSettings);
549
+ var bInitHandedOff=false;var bUsePassedData=false;var sId=this.getAttribute("id");
550
if(sId!==null){oSettings.sTableId=sId;oSettings.sInstance=sId}else{oSettings.sInstance=_oExt._oExternConfig.iNextUnique++
551
}oSettings.nTable=this;oSettings.oApi=_that.oApi;if(typeof oInit!="undefined"&&oInit!==null){_fnMap(oSettings.oFeatures,oInit,"bPaginate");
552
_fnMap(oSettings.oFeatures,oInit,"bLengthChange");_fnMap(oSettings.oFeatures,oInit,"bFilter");
555
_fnMap(oSettings.oFeatures,oInit,"bSortClasses");_fnMap(oSettings.oFeatures,oInit,"bServerSide");
556
_fnMap(oSettings,oInit,"asStripClasses");_fnMap(oSettings,oInit,"fnRowCallback");
557
_fnMap(oSettings,oInit,"fnHeaderCallback");_fnMap(oSettings,oInit,"fnFooterCallback");
558
+ _fnMap(oSettings,oInit,"fnInitComplete");_fnMap(oSettings,oInit,"fnServerData");_fnMap(oSettings,oInit,"aaSorting");
559
+ _fnMap(oSettings,oInit,"aaSortingFixed");_fnMap(oSettings,oInit,"sPaginationType");
560
+ _fnMap(oSettings,oInit,"sAjaxSource");_fnMap(oSettings,oInit,"iCookieDuration");_fnMap(oSettings,oInit,"sDom");
561
+ _fnMap(oSettings,oInit,"oSearch","oPreviousSearch");_fnMap(oSettings,oInit,"aoSearchCols","aoPreSearchCols");
562
+ _fnMap(oSettings,oInit,"iDisplayLength","_iDisplayLength");_fnMap(oSettings,oInit,"bJQueryUI","bJUI");
563
+ if(typeof oInit.fnDrawCallback=="function"){oSettings.aoDrawCallback.push({fn:oInit.fnDrawCallback,sName:"user"})
564
+ }if(oSettings.oFeatures.bServerSide&&oSettings.oFeatures.bSort&&oSettings.oFeatures.bSortClasses){oSettings.aoDrawCallback.push({fn:_fnSortingClasses,sName:"server_side_sort_classes"})
565
+ }if(typeof oInit.bJQueryUI!="undefined"&&oInit.bJQueryUI){oSettings.oClasses=_oExt.oJUIClasses;
566
if(typeof oInit.sDom=="undefined"){oSettings.sDom='<"H"lfr>t<"F"ip>'}}if(typeof oInit.iDisplayStart!="undefined"&&typeof oSettings.iInitDisplayStart=="undefined"){oSettings.iInitDisplayStart=oInit.iDisplayStart;
567
oSettings._iDisplayStart=oInit.iDisplayStart}if(typeof oInit.bStateSave!="undefined"){oSettings.oFeatures.bStateSave=oInit.bStateSave;
568
+ _fnLoadState(oSettings,oInit);oSettings.aoDrawCallback.push({fn:_fnSaveState,sName:"state_save"})
569
+ }if(typeof oInit.aaData!="undefined"){bUsePassedData=true}if(typeof oInit!="undefined"&&typeof oInit.aoData!="undefined"){oInit.aoColumns=oInit.aoData
570
}if(typeof oInit.oLanguage!="undefined"){if(typeof oInit.oLanguage.sUrl!="undefined"&&oInit.oLanguage.sUrl!==""){oSettings.oLanguage.sUrl=oInit.oLanguage.sUrl;
571
$.getJSON(oSettings.oLanguage.sUrl,null,function(json){_fnLanguageProcess(oSettings,json,true)
572
});bInitHandedOff=true}else{_fnLanguageProcess(oSettings,oInit.oLanguage,false)}}}else{oInit={}
576
for(i=0,iLen=bUseCols?oInit.aoColumns.length:nThs.length;i<iLen;i++){var oCol=bUseCols?oInit.aoColumns[i]:null;
577
var nTh=nThs?nThs[i]:null;if(typeof oInit.saved_aoColumns!="undefined"&&oInit.saved_aoColumns.length==iLen){if(oCol===null){oCol={}
578
}oCol.bVisible=oInit.saved_aoColumns[i].bVisible}_fnAddColumn(oSettings,oCol,nTh)
579
+ }for(i=0,iLen=oSettings.aaSorting.length;i<iLen;i++){var oColumn=oSettings.aoColumns[oSettings.aaSorting[i][0]];
580
+ if(typeof oSettings.aaSorting[i][2]=="undefined"){oSettings.aaSorting[i][2]=0}if(typeof oInit.aaSorting=="undefined"&&typeof oSettings.saved_aaSorting=="undefined"){oSettings.aaSorting[i][1]=oColumn.asSorting[0]
581
+ }for(j=0,jLen=oColumn.asSorting.length;j<jLen;j++){if(oSettings.aaSorting[i][1]==oColumn.asSorting[j]){oSettings.aaSorting[i][2]=j;
582
+ break}}}if(this.getElementsByTagName("thead").length===0){this.appendChild(document.createElement("thead"))
583
}if(this.getElementsByTagName("tbody").length===0){this.appendChild(document.createElement("tbody"))
584
}if(bUsePassedData){for(i=0;i<oInit.aaData.length;i++){_fnAddData(oSettings,oInit.aaData[i])
585
}}else{_fnGatherData(oSettings)}oSettings.aiDisplay=oSettings.aiDisplayMaster.slice();
js/tabletools/tabletools.js CHANGED
@@ -1,6 +1,6 @@
1
/*
2
* File: TableTools.js
3
- * Version: 1.0.4 dev
4
* CVS: $Id$
5
* Description: Copy, save and print functions for DataTables
6
* Author: Allan Jardine (www.sprymedia.co.uk)
@@ -11,7 +11,7 @@
11
* Project: Just a little bit of fun :-)
12
* Contact: www.sprymedia.co.uk/contact
13
*
14
- * Copyright 2009 Allan Jardine, all rights reserved.
15
*
16
*/
17
@@ -27,8 +27,15 @@ var TableToolsInit = {
27
"bCopy": true,
28
"bPrint": true
29
},
30
"bIncHiddenColumns": false,
31
- "sPrintMessage": "",
32
"sTitle": "",
33
"sSwfPath": WP_Table_Reloaded_TableTools.swf_path,
34
"iButtonHeight": 30,
@@ -127,6 +134,8 @@ function TableTools ( oInit )
127
var clip = new ZeroClipboard.Client();
128
clip.setHandCursor( true );
129
clip.setAction( 'save' );
130
clip.setFileName( fnGetTitle()+'.csv' );
131
132
clip.addEventListener('mouseOver', function(client) {
@@ -138,7 +147,7 @@ function TableTools ( oInit )
138
} );
139
140
clip.addEventListener('mouseDown', function(client) {
141
- clip.setText( fnGetDataTablesData(",", TableToolsInit.sCsvBoundary) );
142
} );
143
144
fnGlue( clip, nButton, "ToolTables_CSV_"+_iId, "Save as CSV" );
@@ -164,6 +173,8 @@ function TableTools ( oInit )
164
var clip = new ZeroClipboard.Client();
165
clip.setHandCursor( true );
166
clip.setAction( 'save' );
167
clip.setFileName( fnGetTitle()+'.xls' );
168
169
clip.addEventListener('mouseOver', function(client) {
@@ -175,7 +186,7 @@ function TableTools ( oInit )
175
} );
176
177
clip.addEventListener('mouseDown', function(client) {
178
- clip.setText( fnGetDataTablesData("\t") );
179
} );
180
181
fnGlue( clip, nButton, "ToolTables_XLS_"+_iId, "Save for Excel" );
@@ -211,12 +222,12 @@ function TableTools ( oInit )
211
} );
212
213
clip.addEventListener('mouseDown', function(client) {
214
- clip.setText( fnGetDataTablesData("\t") );
215
} );
216
217
clip.addEventListener('complete', function (client, text) {
218
var aData = _sLastData.split('\n');
219
- alert( 'Copied '+(aData.length-2)+' rows to the clipboard' );
220
} );
221
222
fnGlue( clip, nButton, "ToolTables_Copy_"+_iId, "Copy to clipboard" );
@@ -255,7 +266,9 @@ function TableTools ( oInit )
255
fnPrintHideNodes( _DTSettings.nTable );
256
257
/* Show the whole table */
258
_iPrintSaveLength = _DTSettings._iDisplayLength;
259
_DTSettings._iDisplayLength = -1;
260
_DTSettings.oApi._fnCalculateEnd( _DTSettings );
261
_DTSettings.oApi._fnDraw( _DTSettings );
@@ -277,8 +290,7 @@ function TableTools ( oInit )
277
/* Add a node telling the user what is going on */
278
var nInfo = document.createElement( "div" );
279
nInfo.className = "TableTools_PrintInfo";
280
- nInfo.innerHTML = "<h6>Print view</h6><p>Please use your browser's print function to "+
281
- "print this table. Press escape when finished.";
282
document.body.appendChild( nInfo );
283
284
/* Add a message at the top of the page */
@@ -334,6 +346,7 @@ function TableTools ( oInit )
334
}
335
336
/* Restore the table length */
337
_DTSettings._iDisplayLength = _iPrintSaveLength;
338
_DTSettings.oApi._fnCalculateEnd( _DTSettings );
339
_DTSettings.oApi._fnDraw( _DTSettings );
@@ -496,6 +509,102 @@ function TableTools ( oInit )
496
}
497
498
499
/*
500
* Function: fnGetDataTablesData
501
* Purpose: Get data from DataTables' internals and format it for output
@@ -523,6 +632,11 @@ function TableTools ( oInit )
523
if ( _oSettings.bIncHiddenColumns === true || _DTSettings.aoColumns[i].bVisible )
524
{
525
sLoopData = _DTSettings.aoColumns[i].sTitle.replace(/\n/g," ").replace( /<.*?>/g, "" );
526
sData += fnBoundData( sLoopData, sBoundary, regex ) + sSeperator;
527
}
528
}
@@ -541,12 +655,24 @@ function TableTools ( oInit )
541
var mTypeData = _DTSettings.aoData[ _DTSettings.aiDisplay[j] ]._aData[ i ];
542
if ( typeof mTypeData == "string" )
543
{
544
- sLoopData = mTypeData.replace(/\n/g," ").replace( /<.*?>/g, "" );
545
}
546
else
547
{
548
sLoopData = mTypeData+"";
549
}
550
sData += fnBoundData( sLoopData, sBoundary, regex ) + sSeperator;
551
}
552
}
@@ -557,6 +683,27 @@ function TableTools ( oInit )
557
/* Remove the last new line */
558
sData.slice( 0, -1 );
559
560
_sLastData = sData;
561
return sData;
562
}
@@ -582,7 +729,7 @@ if ( typeof $.fn.dataTable == "function" && typeof $.fn.dataTableExt.sVersion !=
582
}
583
else
584
{
585
- alert( "Warning: TableTools requires DataTables 1.5 beta 9 or greater - "+
586
"www.datatables.net/download");
587
}
588
})(jQuery);
1
/*
2
* File: TableTools.js
3
+ * Version: 1.1.3
4
* CVS: $Id$
5
* Description: Copy, save and print functions for DataTables
6
* Author: Allan Jardine (www.sprymedia.co.uk)
11
* Project: Just a little bit of fun :-)
12
* Contact: www.sprymedia.co.uk/contact
13
*
14
+ * Copyright 2009-2010 Allan Jardine, all rights reserved.
15
*
16
*/
17
27
"bCopy": true,
28
"bPrint": true
29
},
30
+ "oBom": {
31
+ "bCsv": true,
32
+ "bXls": true,
33
+ },
34
+ "bIncFooter": true,
35
"bIncHiddenColumns": false,
36
+ "sPrintMessage": "", /* Message with will print with the table */
37
+ "sPrintInfo": "<h6>Print view</h6><p>Please use your browser's print function to "+
38
+ "print this table. Press escape when finished.", /* The 'fading' message */
39
"sTitle": "",
40
"sSwfPath": WP_Table_Reloaded_TableTools.swf_path,
41
"iButtonHeight": 30,
134
var clip = new ZeroClipboard.Client();
135
clip.setHandCursor( true );
136
clip.setAction( 'save' );
137
+ clip.setCharSet( 'UTF8' );
138
+ clip.setBomInc( _oSettings.oBom.bCsv );
139
clip.setFileName( fnGetTitle()+'.csv' );
140
141
clip.addEventListener('mouseOver', function(client) {
147
} );
148
149
clip.addEventListener('mouseDown', function(client) {
150
+ fnFlashSetText( clip, fnGetDataTablesData(",", TableToolsInit.sCsvBoundary) );
151
} );
152
153
fnGlue( clip, nButton, "ToolTables_CSV_"+_iId, "Save as CSV" );
173
var clip = new ZeroClipboard.Client();
174
clip.setHandCursor( true );
175
clip.setAction( 'save' );
176
+ clip.setCharSet( 'UTF16LE' );
177
+ clip.setBomInc( _oSettings.oBom.bXls );
178
clip.setFileName( fnGetTitle()+'.xls' );
179
180
clip.addEventListener('mouseOver', function(client) {
186
} );
187
188
clip.addEventListener('mouseDown', function(client) {
189
+ fnFlashSetText( clip, fnGetDataTablesData("\t") );
190
} );
191
192
fnGlue( clip, nButton, "ToolTables_XLS_"+_iId, "Save for Excel" );
222
} );
223
224
clip.addEventListener('mouseDown', function(client) {
225
+ fnFlashSetText( clip, fnGetDataTablesData("\t") );
226
} );
227
228
clip.addEventListener('complete', function (client, text) {
229
var aData = _sLastData.split('\n');
230
+ alert( 'Copied '+(aData.length-1)+' rows to the clipboard' );
231
} );
232
233
fnGlue( clip, nButton, "ToolTables_Copy_"+_iId, "Copy to clipboard" );
266
fnPrintHideNodes( _DTSettings.nTable );
267
268
/* Show the whole table */
269
+ _iPrintSaveStart = _DTSettings._iDisplayStart;
270
_iPrintSaveLength = _DTSettings._iDisplayLength;
271
+ _DTSettings._iDisplayStart = 0;
272
_DTSettings._iDisplayLength = -1;
273
_DTSettings.oApi._fnCalculateEnd( _DTSettings );
274
_DTSettings.oApi._fnDraw( _DTSettings );
290
/* Add a node telling the user what is going on */
291
var nInfo = document.createElement( "div" );
292
nInfo.className = "TableTools_PrintInfo";
293
+ nInfo.innerHTML = _oSettings.sPrintInfo;
294
document.body.appendChild( nInfo );
295
296
/* Add a message at the top of the page */
346
}
347
348
/* Restore the table length */
349
+ _DTSettings._iDisplayStart = _iPrintSaveStart;
350
_DTSettings._iDisplayLength = _iPrintSaveLength;
351
_DTSettings.oApi._fnCalculateEnd( _DTSettings );
352
_DTSettings.oApi._fnDraw( _DTSettings );
509
}
510
511
512
+ /*
513
+ * Function: fnHtmlDecode
514
+ * Purpose: Decode HTML entities
515
+ * Returns: string: - decoded string
516
+ * Inputs: string:sData - encoded string
517
+ */
518
+ function fnHtmlDecode( sData )
519
+ {
520
+ var
521
+ aData = fnChunkData( sData, 2048 ),
522
+ n = document.createElement('div'),
523
+ i, iLen, iIndex,
524
+ sReturn = "", sInner;
525
+
526
+ /* nodeValue has a limit in browsers - so we chunk the data into smaller segments to build
527
+ * up the string. Note that the 'trick' here is to remember than we might have split over
528
+ * an HTML entity, so we backtrack a little to make sure this doesn't happen
529
+ */
530
+ for ( i=0, iLen=aData.length ; i<iLen ; i++ )
531
+ {
532
+ /* Magic number 8 is because no entity is longer then strlen 8 in ISO 8859-1 */
533
+ iIndex = aData[i].lastIndexOf( '&' );
534
+ if ( iIndex != -1 && aData[i].length >= 8 && iIndex > aData[i].length - 8 )
535
+ {
536
+ sInner = aData[i].substr( iIndex );
537
+ aData[i] = aData[i].substr( 0, iIndex );
538
+ }
539
+
540
+ n.innerHTML = aData[i];
541
+ sReturn += n.childNodes[0].nodeValue;
542
+ }
543
+
544
+ return sReturn;
545
+ }
546
+
547
+
548
+ //function fnHtmlDecode( sData )
549
+ //{
550
+ // var n = document.createElement('div');
551
+ // n.innerHTML = sData;
552
+ // return n.childNodes[0].nodeValue;
553
+ //}
554
+
555
+
556
+ /*
557
+ * Function: fnChunkData
558
+ * Purpose: Break a string up into an array of smaller strings
559
+ * Returns: array strings: - string array
560
+ * Inputs: string:sData - data to be broken up
561
+ * int:iSize - chunk size
562
+ */
563
+ function fnChunkData( sData, iSize )
564
+ {
565
+ var asReturn = [];
566
+ var iStrlen = sData.length;
567
+
568
+ for ( var i=0 ; i<iStrlen ; i+=iSize )
569
+ {
570
+ if ( i+iSize < iStrlen )
571
+ {
572
+ asReturn.push( sData.substring( i, i+iSize ) );
573
+ }
574
+ else
575
+ {
576
+ asReturn.push( sData.substring( i, iStrlen ) );
577
+ }
578
+ }
579
+
580
+ return asReturn;
581
+ }
582
+
583
+
584
+ /*
585
+ * Function: fnFlashSetText
586
+ * Purpose: Set the text for the flash clip to deal with
587
+ * Returns: -
588
+ * Inputs: object:clip - the ZeroClipboard object
589
+ * string:sData - the data to be set
590
+ * Notes: This function is required for large information sets. There is a limit on the
591
+ * amount of data that can be transfered between Javascript and Flash in a single call, so
592
+ * we use this method to build up the text in Flash by sending over chunks. It is estimated
593
+ * that the data limit is around 64k, although it is undocuments, and appears to be different
594
+ * between different flash versions. We chunk at 8KiB.
595
+ */
596
+ function fnFlashSetText( clip, sData )
597
+ {
598
+ var asData = fnChunkData( sData, 8192 );
599
+
600
+ clip.clearText();
601
+ for ( var i=0, iLen=asData.length ; i<iLen ; i++ )
602
+ {
603
+ clip.appendText( asData[i] );
604
+ }
605
+ }
606
+
607
+
608
/*
609
* Function: fnGetDataTablesData
610
* Purpose: Get data from DataTables' internals and format it for output
632
if ( _oSettings.bIncHiddenColumns === true || _DTSettings.aoColumns[i].bVisible )
633
{
634
sLoopData = _DTSettings.aoColumns[i].sTitle.replace(/\n/g," ").replace( /<.*?>/g, "" );
635
+ if ( sLoopData.indexOf( '&' ) != -1 )
636
+ {
637
+ sLoopData = fnHtmlDecode( sLoopData );
638
+ }
639
+
640
sData += fnBoundData( sLoopData, sBoundary, regex ) + sSeperator;
641
}
642
}
655
var mTypeData = _DTSettings.aoData[ _DTSettings.aiDisplay[j] ]._aData[ i ];
656
if ( typeof mTypeData == "string" )
657
{
658
+ /* Strip newlines, replace img tags with alt attr. and finally strip html... */
659
+ sLoopData = mTypeData.replace(/\n/g," ");
660
+ sLoopData = sLoopData.replace(/<img.*?\s+alt\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s>]+)).*?>/gi, '$1$2$3')
661
+ sLoopData = sLoopData.replace( /<.*?>/g, "" );
662
}
663
else
664
{
665
sLoopData = mTypeData+"";
666
}
667
+
668
+ /* Trim and clean the data */
669
+ sLoopData = sLoopData.replace(/^\s+/, '').replace(/\s+#x2F;, '');
670
+ if ( sLoopData.indexOf( '&' ) != -1 )
671
+ {
672
+ sLoopData = fnHtmlDecode( sLoopData );
673
+ }
674
+
675
+ /* Bound it and add it to the total data */
676
sData += fnBoundData( sLoopData, sBoundary, regex ) + sSeperator;
677
}
678
}
683
/* Remove the last new line */
684
sData.slice( 0, -1 );
685
686
+ /* Add the footer */
687
+ if ( _oSettings.bIncFooter )
688
+ {
689
+ for ( i=0, iLen=_DTSettings.aoColumns.length ; i<iLen ; i++ )
690
+ {
691
+ if ( _DTSettings.aoColumns[i].nTf !== null &&
692
+ (_oSettings.bIncHiddenColumns === true || _DTSettings.aoColumns[i].bVisible) )
693
+ {
694
+ sLoopData = _DTSettings.aoColumns[i].nTf.innerHTML.replace(/\n/g," ").replace( /<.*?>/g, "" );
695
+ if ( sLoopData.indexOf( '&' ) != -1 )
696
+ {
697
+ sLoopData = fnHtmlDecode( sLoopData );
698
+ }
699
+
700
+ sData += fnBoundData( sLoopData, sBoundary, regex ) + sSeperator;
701
+ }
702
+ }
703
+ sData = sData.slice( 0, sSeperator.length*-1 );
704
+ }
705
+
706
+ /* No pointers here - this is a string copy :-) */
707
_sLastData = sData;
708
return sData;
709
}
729
}
730
else
731
{
732
+ alert( "Warning: TableTools requires DataTables 1.5 or greater - "+
733
"www.datatables.net/download");
734
}
735
})(jQuery);
js/tabletools/zeroclipboard.js CHANGED
@@ -3,7 +3,7 @@
3
4
var ZeroClipboard = {
5
6
- version: "1.0.4",
7
clients: {}, // registered upload clients on page, indexed by id
8
moviePath: 'zeroclipboard.swf', // URL to movie
9
nextId: 1, // ID of next movie
@@ -190,20 +190,44 @@ ZeroClipboard.Client.prototype = {
190
}
191
},
192
193
setText: function(newText) {
194
- // set text to be copied to clipboard
195
this.clipText = newText;
196
if (this.ready) { this.movie.setText(newText) ;}
197
},
198
199
setFileName: function(newText) {
200
- // set text to be copied to clipboard
201
this.fileName = newText;
202
if (this.ready) this.movie.setFileName(newText);
203
},
204
205
setAction: function(newText) {
206
- // set text to be copied to clipboard
207
this.action = newText;
208
if (this.ready) this.movie.setAction(newText);
209
},
@@ -252,9 +276,12 @@ ZeroClipboard.Client.prototype = {
252
}
253
254
this.ready = true;
255
- this.movie.setText( this.clipText );
256
this.movie.setFileName( this.fileName );
257
this.movie.setAction( this.action );
258
this.movie.setHandCursor( this.handCursorEnabled );
259