Commit b08b5acc94fd01da5189c16f5c80d785a7a3b5b5

Authored by totoro
1 parent c2211587

Bump to JQuery 1.11.0 and JQueryUI 1.10.4

New - Add jquery_button with image
New - Add scrollY support for JQuery datatable
web/CXM_jquery.anubis
... ... @@ -28,8 +28,8 @@ define List(HTML_Head_Tag)
28 28 jquery_defaults
29 29 =
30 30 [
31   - js(js_file("/js/jquery/jquery-1.8.0.min.js")),
32   - js(js_file("/js/jquery/jquery-ui-1.8.23.custom.min.js")),
  31 + js(js_file("/js/jquery/jquery-1.11.0.min.js")),
  32 + js(js_file("/js/jquery/jquery-ui-1.10.4.custom.min.js")),
33 33 ].
34 34  
35 35 /* Initialize jQuery in compatiblity mode with jQueryUI */
... ... @@ -40,9 +40,9 @@ public define List(HTML_Head_Tag)
40 40 String theme_name
41 41 )
42 42 =
43   - if file_exists(web_dir+"/public/css/jquery/"+theme_name+"/jquery-ui-1.8.23.custom.css") then
44   - [ css(css_file("/css/jquery/"+theme_name+"/jquery-ui-1.8.23.custom.css")) . jquery_defaults ]
  43 + if file_exists(web_dir+"/public/css/jquery/"+theme_name+"/jquery-ui-1.10.4.custom.min.css") then
  44 + [ css(css_file("/css/jquery/"+theme_name+"/jquery-ui-1.10.4.custom.min.css")) . jquery_defaults ]
45 45 else
46   - println("Jquery Theme not found "+web_dir+"/css/jquery/"+theme_name+"/jquery-ui-1.8.23.custom.css");
47   - [ css(css_file("/css/jquery/redmond/jquery-ui-1.8.23.custom.css")) . jquery_defaults ]
  46 + println("Jquery Theme not found "+web_dir+"/css/jquery/"+theme_name+"/jquery-ui-1.10.4.custom.min.css");
  47 + [ css(css_file("/css/jquery/redmond/jquery-ui-1.10.4.custom.min.css")) . jquery_defaults ]
48 48 .
... ...
web/jQuery/CXM_jquery_button.anubis
... ... @@ -263,3 +263,25 @@ public define HTML_Partial_Content
263 263 literal("<button id=\""+id+"\">"+label+"</button>")
264 264 )
265 265 .
  266 +
  267 +public define HTML_Partial_Content
  268 + jquery_button
  269 + (
  270 + String img_url,
  271 + String label_text,
  272 + String action
  273 + )=
  274 + partial_content(
  275 + [
  276 + js_inline(script("","$(document).ready(function(){$('#jq_img_btn').button();});"))
  277 + ],
  278 + div([id("jq_img_btn")],
  279 + table([
  280 + row( cell( actioner(same,same, img_link(img_url, label_text), action, []))),
  281 + row( cell( actioner(same,same, link(label_text), action, [])))
  282 + ]
  283 + )
  284 + ))
  285 +
  286 + .
  287 +
... ...
web/jQuery/CXM_jquery_datatable.anubis
... ... @@ -69,6 +69,7 @@ public define HTML_Partial_Content
69 69 Bool enable_jqueryui,
70 70 Bool enable_pagination,
71 71 JQuery_datatable_pagination_type pagination_type,
  72 + JQuery_datatable_scrollY_type scrollY,
72 73 Bool enable_change_page_length, // if true, "enable_pagination" must be true too.
73 74 Bool enable_search_field,
74 75 Bool enable_columns_sorting,
... ... @@ -88,7 +89,13 @@ public define HTML_Partial_Content
88 89 \"bJQueryUI\":"+to_String(enable_jqueryui)+",
89 90 \"sPaginationType\":'"+jquery_datatable_pagination_type_to_string(pagination_type)+"',
90 91 \"bFilter\":"+to_String(enable_search_field)+",
91   - \"bPaginate\":"+to_String(enable_pagination)+",
  92 + \"bPaginate\":"+to_String(enable_pagination)+","+
  93 + if scrollY is
  94 + {
  95 + no_scroll then "",
  96 + scrollY(size) then "\"sScrollY\": \""+size+"px\","
  97 + }+
  98 + "\"bStateSave\": true,
92 99 \"bLengthChange\":"+to_String(enable_change_page_length)+",
93 100 \"bSort\":"+to_String(enable_columns_sorting)+","+
94 101 get_datatable_translation(lang)+"
... ... @@ -110,8 +117,9 @@ public define HTML_Partial_Content
110 117 Bool enable_jqueryui,
111 118 Bool enable_pagination,
112 119 JQuery_datatable_pagination_type pagination_type,
  120 + JQuery_datatable_scrollY_type scrollY,
113 121 Bool enable_change_page_length, // if true, "enable_pagination" must be true too.
114 122 Bool enable_search_field,
115 123 Bool enable_columns_sorting
116 124 ) =
117   - jquery_datatable(table_id, table, enable_jqueryui, enable_pagination, pagination_type, enable_change_page_length, enable_search_field, enable_columns_sorting, "en").
  125 + jquery_datatable(table_id, table, enable_jqueryui, enable_pagination, pagination_type, scrollY, enable_change_page_length, enable_search_field, enable_columns_sorting, "en").
... ...
web/jQuery/CXM_jquery_datatable_types.anubis
... ... @@ -15,7 +15,10 @@ public type JQuery_datatable_pagination_type:
15 15 jq_dt_pt_two_button, //default option
16 16 jq_dt_pt_full_numbers
17 17 .
18   -
  18 +public type JQuery_datatable_scrollY_type:
  19 + no_scroll,
  20 + scrollY(Int size).
  21 +
19 22 public define String
20 23 jquery_datatable_pagination_type_to_string
21 24 (
... ...