From a8f9078f8f01f08f9adeadd43aac477f34786c5e Mon Sep 17 00:00:00 2001 From: totoro Date: Thu, 14 May 2015 19:27:35 +0200 Subject: [PATCH] Bump to jQuery 1.11.3 & jQueryUI 1.11.4 & jQuery Datatable 1.10.7 --- asterisk/ami.anubis | 339 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- asterisk/ami_commands.anubis | 49 ++++++++++++++++++++++++------------------------- web/CXM_jquery.anubis | 12 +++++++----- web/jQuery/CXM_jquery_datatable.anubis | 76 ++++++++++++++++++++++++++++++++++++++++++++++++---------------------------- web/jQuery/CXM_jquery_datatable_server_side.anubis | 13 +++++++------ 5 files changed, 255 insertions(+), 234 deletions(-) diff --git a/asterisk/ami.anubis b/asterisk/ami.anubis index 1e39e6e..5531665 100644 --- a/asterisk/ami.anubis +++ b/asterisk/ami.anubis @@ -1,170 +1,169 @@ -/* - * Created by PyramIDE. - * User: Totoro - * Date: 13/07/2013 - * Time: 02:07 - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ - -read system/string.anubis -read tools/basis.anubis -read tools/connections.anubis - -read asterisk/ami_types.anubis -read asterisk/ami_commands.anubis -read web/CXM_http_get_common.anubis - - - - public define Result( - -define Maybe(One) - receive - ( - Bool print_dump, - Connection conn - )= - //TODO find the header and content-lenght to get full length of answer - - if read(conn, 16384, 5) is - { - error then println("Read error");failure, - timeout then println("Read timeout");failure, - ok(ba) then - with ami_response = to_string(ba), - // typed_response = xml_rpc_get_response(xml_response), - if print_dump then - - success(println("=== ASTERISK SERVER answer ==="+crlf +"["+ ami_response + "]" )) - //println("=== XML_RPC Anubis interpretation ==="); - - /* if typed_response is - { - failure then println("Interpretation error"), - success(result) then - if result is - { - ok(ok_res) then println(format_xml_rpc_parameters(ok_res,1)), - fault(fault) then println(format_xml_rpc_fault(fault,1)) - } - - } */ - - else success(unique) - } - . - -define Maybe(String) - _format_action - ( - String so_far, - List(Key_value) values - )= - if values is - { - [] then success(so_far+crlf), - [h . t] then - if h is key_value(key, value) then - _format_action(so_far+key+": "+value+crlf, t) - }. - - /** Format the AMI action - * - */ - -define Maybe(String) - format_action - ( - AMI_Action action - )= - if action is action(action_type, values_list) then - _format_action( "Action: "+action_type+crlf, - //"ActionID: "+ - values_list) - . - - - -public define Maybe(One) - send_action - ( - Asterisk_client client, - AMI_Action action - )= - if client is asterisk_client(conn, _, auth) then - - //format the action into string - if format_action(action) is - { - failure then failure - success(action_str) then - //send the action trough the connection to Asterisk - println("=== ACTION ==="); - print(action_str); - println("=== END ACTION ==="); - - if write(conn, to_byte_array(action_str)) is - { - failure then failure, - success(_) then receive(true, conn) - } - }. - -public define Maybe(Asterisk_client) - asterisk_new_client - ( - String server_name, - AMI_Auth auth - )= - if separate_name_port(server_name, 5038) is (name, server_port) then - // - // resolve server name and call 'https_get' with numeric server address: - // - with a = dns(name), - if a is ok(server_addr) then - println("TCP "+server_port+ " "+server_name); - if (Result(NetworkConnectError,RWStream))connect(server_addr, server_port) is - { - error(e) then failure, - ok(conn) then - if read_line(tcp(conn), 80, 10) is - { - error then failure, - timeout then failure, - eof then failure, - ok(str) then - println("=== ASTERISK SERVER answer ==="+crlf +"["+ str + "]" ); - //to ensure that it is an Asterisk server we test the returned string - if start_with(to_lower(str), "asterisk call manager") then - - with client = asterisk_client(tcp(conn), var(0), auth), - if send_action(client, ami_login(auth)) is - { - failure then failure, - success(_) then success(client) - } - else - failure - - } - - } - else - failure. - - -global define One - ami_test - ( - List(String) args - )= - if asterisk_new_client("192.168.3.20:5038", auth("admin","admin")) is - { - failure then println(" asterisk new client failure"), - success(ami_client) then unique - //forget(xml_rpc_client_execute(true, rpc_client, "/Settings", "list_domains", empty_param)) - //forget(xml_rpc_client_execute(true, rpc_client, "/Settings", "delete_domain", parameters([parameter[string("amisdefontainebleau.org")]]))) - //forget(xml_rpc_client_execute(true, rpc_client, "/Settings", "create_domain", empty_param)) - }. - +/* + * Created by PyramIDE. + * User: Totoro + * Date: 13/07/2013 + * Time: 02:07 + * + */ + +read system/string.anubis +read tools/basis.anubis +read tools/connections.anubis + +read asterisk/ami_types.anubis +read asterisk/ami_commands.anubis +read web/CXM_http_get_common.anubis + + + + public define Result( + +define Maybe(One) + receive + ( + Bool print_dump, + Connection conn + )= + //TODO find the header and content-lenght to get full length of answer + + if read(conn, 16384, 5) is + { + error then println("Read error");failure, + timeout then println("Read timeout");failure, + ok(ba) then + with ami_response = to_string(ba), + // typed_response = xml_rpc_get_response(xml_response), + if print_dump then + + success(println("=== ASTERISK SERVER answer ==="+crlf +"["+ ami_response + "]" )) + //println("=== XML_RPC Anubis interpretation ==="); + + /* if typed_response is + { + failure then println("Interpretation error"), + success(result) then + if result is + { + ok(ok_res) then println(format_xml_rpc_parameters(ok_res,1)), + fault(fault) then println(format_xml_rpc_fault(fault,1)) + } + + } */ + + else success(unique) + } + . + +define Maybe(String) + _format_action + ( + String so_far, + List(Key_value) values + )= + if values is + { + [] then success(so_far+crlf), + [h . t] then + if h is key_value(key, value) then + _format_action(so_far+key+": "+value+crlf, t) + }. + + /** Format the AMI action + * + */ + +define Maybe(String) + format_action + ( + AMI_Action action + )= + if action is action(action_type, values_list) then + _format_action( "Action: "+action_type+crlf, + //"ActionID: "+ + values_list) + . + + + +public define Maybe(One) + send_action + ( + Asterisk_client client, + AMI_Action action + )= + if client is asterisk_client(conn, _, auth) then + + //format the action into string + if format_action(action) is + { + failure then failure + success(action_str) then + //send the action trough the connection to Asterisk + println("=== ACTION ==="); + print(action_str); + println("=== END ACTION ==="); + + if write(conn, to_byte_array(action_str)) is + { + failure then failure, + success(_) then receive(true, conn) + } + }. + +public define Maybe(Asterisk_client) + asterisk_new_client + ( + String server_name, + AMI_Auth auth + )= + if separate_name_port(server_name, 5038) is (name, server_port) then + // + // resolve server name and call 'https_get' with numeric server address: + // + with a = dns(name), + if a is ok(server_addr) then + println("TCP "+server_port+ " "+server_name); + if (Result(NetworkConnectError,RWStream))connect(server_addr, server_port) is + { + error(e) then failure, + ok(conn) then + if read_line(tcp(conn), 80, 10) is + { + error then failure, + timeout then failure, + eof then failure, + ok(str) then + println("=== ASTERISK SERVER answer ==="+crlf +"["+ str + "]" ); + //to ensure that it is an Asterisk server we test the returned string + if start_with(to_lower(str), "asterisk call manager") then + + with client = asterisk_client(tcp(conn), var(0), auth), + if send_action(client, ami_login(auth)) is + { + failure then failure, + success(_) then success(client) + } + else + failure + + } + + } + else + failure. + + +global define One + ami_test + ( + List(String) args + )= + if asterisk_new_client("192.168.3.20:5038", auth("admin","admin")) is + { + failure then println(" asterisk new client failure"), + success(ami_client) then unique + //forget(xml_rpc_client_execute(true, rpc_client, "/Settings", "list_domains", empty_param)) + //forget(xml_rpc_client_execute(true, rpc_client, "/Settings", "delete_domain", parameters([parameter[string("amisdefontainebleau.org")]]))) + //forget(xml_rpc_client_execute(true, rpc_client, "/Settings", "create_domain", empty_param)) + }. + diff --git a/asterisk/ami_commands.anubis b/asterisk/ami_commands.anubis index 359eb3a..2881621 100644 --- a/asterisk/ami_commands.anubis +++ b/asterisk/ami_commands.anubis @@ -1,25 +1,24 @@ -/* - * Created by PyramIDE. - * User: Totoro - * Date: 14/07/2013 - * Time: 01:34 - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ - -read asterisk/ami_types.anubis - -public define AMI_Action ami_login(String user, String password, Bool events) = - action("Login", [ - key_value("Username",user), - key_value("Secret", password), - key_value("Events", if events then "on" else "off") - ]). - -public define AMI_Action ami_login(String user, String password)= - ami_login(user, password, true). - -public define AMI_Action ami_login(AMI_Auth ami_auth) = - if ami_auth is auth(user, password) then - ami_login(user, password, true). - +/* + * Created by PyramIDE. + * User: Totoro + * Date: 14/07/2013 + * Time: 01:34 + * + */ + +read asterisk/ami_types.anubis + +public define AMI_Action ami_login(String user, String password, Bool events) = + action("Login", [ + key_value("Username",user), + key_value("Secret", password), + key_value("Events", if events then "on" else "off") + ]). + +public define AMI_Action ami_login(String user, String password)= + ami_login(user, password, true). + +public define AMI_Action ami_login(AMI_Auth ami_auth) = + if ami_auth is auth(user, password) then + ami_login(user, password, true). + diff --git a/web/CXM_jquery.anubis b/web/CXM_jquery.anubis index fe26c97..3d87660 100644 --- a/web/CXM_jquery.anubis +++ b/web/CXM_jquery.anubis @@ -57,8 +57,8 @@ define List(HTML_Head_Tag) jquery_defaults = [ - js(js_file("/js/jquery/jquery-1.11.1.min.js")), - js(js_file("/js/jquery/jquery-ui-1.10.4.custom.min.js")), + js(js_file("/jquery/jquery-1.11.3.js")), + js(js_file("/jquery/jquery-ui-1.11.4/jquery-ui.min.js")), ]. /* Initialize jQuery in compatiblity mode with jQueryUI */ @@ -69,9 +69,11 @@ public define List(HTML_Head_Tag) String theme_name ) = - if file_exists(web_dir+"/public/css/jquery/"+theme_name+"/jquery-ui-1.10.4.custom.min.css") then - [ css(css_file("/css/jquery/"+theme_name+"/jquery-ui-1.10.4.custom.min.css")) . jquery_defaults ] + if file_exists(web_dir+"/public/jquery/jquery-ui-1.11.4/theme/"+theme_name+"/jquery-ui.min.css") then + [ css(css_file("/jquery/jquery-ui-1.11.4/theme/"+theme_name+"/jquery-ui.min.css")), + css(css_file("/jquery/jquery-ui-1.11.4/theme/"+theme_name+"/jquery-ui.structure.min.css")), + css(css_file("/jquery/jquery-ui-1.11.4/theme/"+theme_name+"/jquery-ui.theme.min.css")) . jquery_defaults ] else println("Jquery Theme not found "+web_dir+"/css/jquery/"+theme_name+"/jquery-ui-1.10.4.custom.min.css"); - [ css(css_file("/css/jquery/redmond/jquery-ui-1.10.4.custom.min.css")) . jquery_defaults ] + [ css(css_file("/css/jquery/jquery-ui-1.11.4.custom.min.css")) . jquery_defaults ] . diff --git a/web/jQuery/CXM_jquery_datatable.anubis b/web/jQuery/CXM_jquery_datatable.anubis index bc9f60b..b8427ea 100644 --- a/web/jQuery/CXM_jquery_datatable.anubis +++ b/web/jQuery/CXM_jquery_datatable.anubis @@ -17,13 +17,13 @@ read system/convert.anubis /* Initialize jQuery datatables */ public define List(HTML_Head_Tag) - jquery_datatables_init + jquery_datatables_1_9_init ( String web_dir, ) = [ - css(css_file("/css/jquery/jquery.dataTables.css")), + css(css_file("css/jquery/jquery.dataTables.css")), css(css_file("/css/jquery/jquery.dataTables_themeroller.css")), js(js_file("/js/jquery/jquery.dataTables.js")), //js(js_file("js/jquery/dataTables/dataTables.jqueryui.js")) , only for datatable 1.10 @@ -35,6 +35,24 @@ public define List(HTML_Head_Tag) ] . +public define List(HTML_Head_Tag) + jquery_datatables_1_10_init +// ( +// String web_dir, +// ) + = + [ + //css(css_file("jquery/plug-in/DataTables-1.10.7/media/css/jquery.dataTables.min.css")), + //css(css_file("jquery/plug-in/DataTables-1.10.7/media/css/jquery.dataTables_themeroller.css")), + js(js_file("jquery/plug-in/DataTables-1.10.7/media/js/jquery.dataTables.js")), + js(js_file("jquery/plug-in/DataTables-1.10.7/media/js/dataTables.jqueryui.js")) , //only for datatable 1.10 + css(css_file("jquery/plug-in/DataTables-1.10.7/media/css/dataTables.jqueryui.css")), //only for datatable 1.10 + css(css_file("jquery/plug-in/DataTables-1.10.7/extensions/Scroller/css/dataTables.scroller.min.css")), + js(js_file("jquery/plug-in/DataTables-1.10.7/extensions/Scroller/js/dataTables.scroller.js")), +// css(css_file("jquery/plug-in/DataTables-1.10.7/extensions/Responsive/css/dataTables.responsive.css")), +// js(js_file("jquery/plug-in/DataTables-1.10.7/extensions/responsive/js/dataTables.responsive.js")), + ] + . public define HTML_Partial_Content jquery_datatable ( @@ -42,7 +60,7 @@ public define HTML_Partial_Content HTML_Off_Form table ) = - partial_content( + partial_content(jquery_datatables_1_10_init + [ js_inline(jquery_ready("$('#"+table_id+"').dataTable();")) ], table ) @@ -57,7 +75,7 @@ public define HTML_Partial_Content ) = if enable_jqueryui then - partial_content( + partial_content( jquery_datatables_1_10_init + [ js_inline(jquery_ready("$('#"+table_id+"').dataTable({\"bJQueryUI\":true});")) ], table ) @@ -83,30 +101,32 @@ public define HTML_Partial_Content String web_dir ) = - partial_content( - [ - js_inline(jquery_ready(" - $('#"+table_id+"').dataTable( - { - \"bJQueryUI\":"+to_String(enable_jqueryui)+", - \"sPaginationType\":'"+jquery_datatable_pagination_type_to_string(pagination_type)+"', - \"bFilter\":"+to_String(enable_search_field)+", - \"bPaginate\":"+to_String(enable_pagination)+","+ - if scrollY is - { - no_scroll then "", - scrollY(size) then "\"sScrollY\": \""+size+"px\"," - }+ - "\"bStateSave\": true, - \"bLengthChange\":"+to_String(enable_change_page_length)+", - \"bSort\":"+to_String(enable_columns_sorting)+","+ - get_datatable_translation(lang, web_dir)+ - jquery_datatable_extra_to_string(extra)+ - "}); - " - ) - ) - ], + partial_content( jquery_datatables_1_10_init + + [ + js_inline(jquery_ready(" + $('#"+table_id+"').dataTable( + { + \"jQueryUI\":"+to_String(enable_jqueryui)+", + \"sPaginationType\":'"+jquery_datatable_pagination_type_to_string(pagination_type)+"', + \"bFilter\":"+to_String(enable_search_field)+", + \"bPaginate\":"+to_String(enable_pagination)+","+ + // responsive: true,"+ + + if scrollY is + { + no_scroll then "", + scrollY(size) then "\"sScrollY\": \""+size+"px\"," + }+ + "\"bStateSave\": true, + \"bLengthChange\":"+to_String(enable_change_page_length)+", + \"bSort\":"+to_String(enable_columns_sorting)+","+ + get_datatable_translation(lang, web_dir)+ + jquery_datatable_extra_to_string(extra)+ + "}); + " + ) + ) + ], table ) . diff --git a/web/jQuery/CXM_jquery_datatable_server_side.anubis b/web/jQuery/CXM_jquery_datatable_server_side.anubis index e753f42..6c9b014 100644 --- a/web/jQuery/CXM_jquery_datatable_server_side.anubis +++ b/web/jQuery/CXM_jquery_datatable_server_side.anubis @@ -17,13 +17,14 @@ public define Maybe(JQuery_datatable_server_side_type) List(Web_arg) lwa )= - if get_String(lwa, "sEcho") is {failure then failure, success(secho) then - if get_Int(lwa, "iColumns") is {failure then failure, success(icolumns) then - if get_String(lwa, "sColumns") is {failure then failure, success(scolumns) then - if get_Int(lwa, "iDisplayStart") is {failure then failure, success(idisplaystart) then - if get_Int(lwa, "iDisplayLength") is {failure then failure, success(idisplaylength) then - if get_String(lwa, "sSearch") is {failure then failure, success(sSearch) then + if get_String(lwa, "sEcho") is {failure then println("can't read sEcho");failure, success(secho) then + if get_Int(lwa, "iColumns") is {failure then println("can't read iColumns");failure, success(icolumns) then + if get_String(lwa, "sColumns") is {failure then println("can't read sColumns");failure, success(scolumns) then + if get_Int(lwa, "iDisplayStart") is {failure then println("can't read iDisplayStart");failure, success(idisplaystart) then + if get_Int(lwa, "iDisplayLength") is {failure then println("can't read iDisplayLength");failure, success(idisplaylength) then + if get_String(lwa, "sSearch") is {failure then println("can't read sSearch");failure, success(sSearch) then // if get_String(lwa, "sSortDir") is {failure then failure, success(sSortDir) then success(dt_ss(secho, icolumns, scolumns, idisplaystart, idisplaylength, if sSearch = "" then failure else success(sSearch))) }}}}}}. + -- libgit2 0.21.4