diff --git a/web/jQuery/CXM_jquery_datatable.anubis b/web/jQuery/CXM_jquery_datatable.anubis index 6c717bf..ebd17d0 100644 --- a/web/jQuery/CXM_jquery_datatable.anubis +++ b/web/jQuery/CXM_jquery_datatable.anubis @@ -23,9 +23,12 @@ public define List(HTML_Head_Tag) ) = [ - css(css_file("/css/jquery/jquery.dataTables.css")), - css(css_file("/css/jquery/jquery.dataTables_themeroller.css")), - js(js_file("/js/jquery/jquery.dataTables.min.js")) + css(css_file("/css/jquery/jquery.dataTables.min.css")), + css(css_file("/css/jquery/jquery.dataTables_themeroller.min.css")), + js(js_file("/js/jquery/jquery.dataTables.min.js")), + css(css_file("js/jquery/dataTables/extensions/Scroller/css/dataTables.scroller.min.css")), + js(js_file("js/jquery/dataTables/extensions/Scroller/js/dataTables.scroller.min.js")), + ] . @@ -74,7 +77,8 @@ public define HTML_Partial_Content Bool enable_search_field, Bool enable_columns_sorting, String lang, - JQuery_datatable_extra_type extra + JQuery_datatable_extra_type extra, + String web_dir ) = partial_content( @@ -99,7 +103,7 @@ public define HTML_Partial_Content "\"bStateSave\": true, \"bLengthChange\":"+to_String(enable_change_page_length)+", \"bSort\":"+to_String(enable_columns_sorting)+","+ - get_datatable_translation(lang)+ + get_datatable_translation(lang, web_dir)+ jquery_datatable_extra_to_string(extra)+ "}); }); @@ -122,6 +126,7 @@ public define HTML_Partial_Content JQuery_datatable_scrollY_type scrollY, Bool enable_change_page_length, // if true, "enable_pagination" must be true too. Bool enable_search_field, - Bool enable_columns_sorting + Bool enable_columns_sorting, + String web_dir ) = - jquery_datatable(table_id, table, enable_jqueryui, enable_pagination, pagination_type, scrollY, enable_change_page_length, enable_search_field, enable_columns_sorting, "en", no_extra). + jquery_datatable(table_id, table, enable_jqueryui, enable_pagination, pagination_type, scrollY, enable_change_page_length, enable_search_field, enable_columns_sorting, "en", no_extra, web_dir). diff --git a/web/jQuery/CXM_jquery_datatable_translation.anubis b/web/jQuery/CXM_jquery_datatable_translation.anubis index 2529704..38bb4d5 100644 --- a/web/jQuery/CXM_jquery_datatable_translation.anubis +++ b/web/jQuery/CXM_jquery_datatable_translation.anubis @@ -7,19 +7,23 @@ * To change this template use Tools | Options | Coding | Edit Standard Headers. */ +read tools/basis.anubis public define String get_datatable_translation ( - String language + String language, + String web_dir )= - with file = if language = "en" then "en" else - if language = "fr" then "fr" else - if language = "zh" then "zh" else - if language = "ja" then "ja" else - "en", + + with file = if file_exists(web_dir+"/public/js/jquery/dataTables/translation/"+language+".txt") then + language + else + println("NOT FOUND : "+web_dir+"/public/js/jquery/dataTables/translation/"+language+".txt"); + "en", + "\"oLanguage\": { - \"sUrl\": \"/js/jquery/dataTables/"+file+".txt\" + \"sUrl\": \"/js/jquery/dataTables/translation/"+file+".txt\" }". diff --git a/web/jQuery/CXM_jquery_datatable_types.anubis b/web/jQuery/CXM_jquery_datatable_types.anubis index faaf759..fa33825 100644 --- a/web/jQuery/CXM_jquery_datatable_types.anubis +++ b/web/jQuery/CXM_jquery_datatable_types.anubis @@ -11,10 +11,14 @@ read calexium_lib/web/CXM_making_a_web_site.anubis read tools/basis.anubis read system/string.anubis - + pagingType Since: 1.10 + Pagination button display options + public type JQuery_datatable_pagination_type: - jq_dt_pt_two_button, //default option - jq_dt_pt_full_numbers + jq_dt_pt_simple, //'Previous' and 'Next' buttons only + jq_dt_pt_simple_numbers, //'Previous' and 'Next' buttons, plus page numbers (default option) + jq_dt_pt_full, //'First', 'Previous', 'Next' and 'Last' buttons + jq_dt_pt_full_numbers //'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers . public type JQuery_datatable_scrollY_type: no_scroll, @@ -41,12 +45,13 @@ public define String JQuery_datatable_pagination_type pt ) = - if pt is - { - jq_dt_pt_two_button then "two_button", - jq_dt_pt_full_numbers then "full_numbers" - } - . + if pt is + { + jq_dt_pt_simple then "simple", + jq_dt_pt_simple_numbers then "simple_numbers", + jq_dt_pt_full then "full", + jq_dt_pt_full_numbers then "full_numbers", + }. public define JQuery_datatable_pagination_type string_to_jquery_datatable_pagination_type @@ -55,9 +60,11 @@ public define JQuery_datatable_pagination_type ) = with st=to_lower(str), - if st="two_button" then jq_dt_pt_two_button else - if st="full_numbers" then jq_dt_pt_full_numbers else - jq_dt_pt_two_button + if st="simple" then jq_dt_pt_simple else + if st="simple_numbers" then jq_dt_pt_simple_numbers else + if st="full" then jq_dt_pt_full else + if st="full_numbers" then jq_dt_pt_full_numbers else + jq_dt_pt_simple_numbers . public type JQuery_datatable_server_side_type: -- libgit2 0.21.4