CXM_jquery.anubis 1.48 KB
/*
 * Created by PyramIDE.
 * User: Jeremy
 * Date: 21/08/2012
 * Time: 16:52
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

read calexium_lib/web/CXM_making_a_web_site.anubis
read tools/printable_tree.anubis
read tools/basis.anubis

/* jQuery Actioner type */
public type JQuery_Actioner_type:
  jqform,
  jqlink,
  jqscript.

/* jQuery Actioner */
public type JQuery_Actioner:
  jQuery_actioner(Actioner_Target target, JQuery_Actioner_type type, String url_or_form_id).


/* */
public define Script
  jquery_ready
  (
    String  code  //javascript code to execute when the document is ready
  )=
  script("","$(document).ready(function(){"+code+"});").
  
        
/* jQuery default js files */
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")),
   ].
   
/* Initialize jQuery in compatiblity mode with jQueryUI */
public define List(HTML_Head_Tag)
  jquery_init
  (
   String web_dir,
   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 ]
    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 ]
  .