diff --git a/web/CXM_jquery.anubis b/web/CXM_jquery.anubis index c23b708..47b5491 100644 --- a/web/CXM_jquery.anubis +++ b/web/CXM_jquery.anubis @@ -11,14 +11,15 @@ read calexium_lib/web/CXM_making_a_web_site.anubis read tools/printable_tree.anubis read tools/basis.anubis -public define List(HTML_Head_Tag) +/* jQuery default js files */ +define List(HTML_Head_Tag) jquery_defaults = [ - js(js_file("js/jquery/jquery-1.8.0.min.js")), - js(js_file("js/jquery/jquery-ui-1.8.23.custom.min.js")), + js(js_file("/js/jquery/jquery-1.8.0.min.js")), + js(js_file("/js/jquery/jquery-ui-1.8.23.custom.min.js")), ]. - + /* Initialize jQuery in compatiblity mode with jQueryUI */ public define List(HTML_Head_Tag) jquery_init @@ -28,9 +29,7 @@ public define List(HTML_Head_Tag) ) = if file_exists(web_dir+"/css/jquery/"+theme_name+"/jquery-ui-1.8.23.custom.css") then - [ css(css_file("css/jquery/"+theme_name+"/jquery-ui-1.8.23.custom.css")) . jquery_defaults ] + [ css(css_file("/css/jquery/"+theme_name+"/jquery-ui-1.8.23.custom.css")) . jquery_defaults ] else - [ css(css_file(web_dir+"/css/jquery/redmond/jquery-ui-1.8.23.custom.css")) . jquery_defaults ] + [ css(css_file("/css/jquery/redmond/jquery-ui-1.8.23.custom.css")) . jquery_defaults ] . - - diff --git a/web/CXM_jquery_tabs.anubis b/web/CXM_jquery_tabs.anubis new file mode 100644 index 0000000..8a99eb7 --- /dev/null +++ b/web/CXM_jquery_tabs.anubis @@ -0,0 +1,80 @@ +/* + * Created by PyramIDE. + * User: Jeremy + * Date: 04/09/2012 + * Time: 16:19 + * + * To change this template use Tools | Options | Coding | Edit Standard Headers. + */ + +read calexium_lib/web/CXM_making_a_web_site.anubis +read tools/basis.anubis + +public type JQuery_tab: + jQuery_tab(String title, HTML_Off_Form content) +. + + +define HTML_Partial_Content + _jquery_tabs + ( + String tabs_container_id, + List(JQuery_tab) tabs, + String tabs_titles, + List(HTML_Off_Form) tabs_contents, + Int count + ) + = + if tabs is + { + [ ] then + partial_content( + [], + sequence([ + literal(""), + sequence(reverse(tabs_contents)) + ]) + ), + [ h . t ] then + if h is jQuery_tab(title, content) then + _jquery_tabs( + tabs_container_id, + t, + tabs_titles + "
  • "+title+"
  • ", + [ + sequence([ + literal("
    "), + content, + literal("
    ") + ]) + . + tabs_contents + ], + count+1 + ) + } + . + + +public define HTML_Partial_Content + jquery_tabs + ( + String tabs_container_id, + List(JQuery_tab) tabs + ) + = + if _jquery_tabs(tabs_container_id, tabs, "", [], 0) is partial_content(tags, html) then + partial_content( + [ + js_inline(script("", "$(document).ready(function(){$('#"+tabs_container_id+"').tabs();});")) + . + tags + ], + sequence([ + literal("
    "), + html, + literal("
    ") + ]) + ) + . + -- libgit2 0.21.4