css_helper.anubis 7.93 KB
/*
 * Created by PyramIDE.
 * User: フランスのトトロ 
 * Date: 06/05/2007
 * Time: 09:39
 * © David RENÉ
 */

read tools/basis.anubis

read calexium_lib/web/CXM_common.anubis
read calexium_lib/web/CXM_making_a_web_site.anubis

 /**** WAVE BOX ****/

public define HTML_Partial_Content 
  html_wave_box
  (
    String                legend,
    HTML_Partial_Content  content,
    List(CoreAttrs)       attrs
  )=
  partial_content([], 
  div(attrs,
    sequence(
    [
      text([class("frame_wave")], legend),   //legend
      div([class("frame_blk")], partial(content))
    ]))).

public define HTML_Partial_Content 
  html_wave_box
  (
    String          legend,
    HTML_Off_Form   content,
    List(CoreAttrs) attrs
  )=
  partial_content([],
  div(attrs,
    sequence(
    [
      text([class("frame_wave")], legend),   //legend
      div([class("frame_blk")], content)
    ]))).
    
public define HTML_Off_Form 
  html_wave_box
  (
    String          legend,
    HTML_Off_Form   content,
    List(CoreAttrs) attrs
  )=
  div(attrs,
    sequence(
    [
      text([class("frame_wave")], legend),   //legend
      div([class("frame_blk")], content)
    ])).
  
public define HTML_Off_Form 
  html_wave_box
  (
    String        legend,
    HTML_Off_Form content
  )=
  html_wave_box(legend, content, [class("frame")]).

public define HTML_Partial_Content 
  html_wave_box
  (
    String                legend,
    HTML_Partial_Content  content
  )=
  html_wave_box(legend, content, [class("frame")]).

public define HTML_Partial_Content 
  html_wave_box
  (
    String                legend,
    List(CoreAttrs)       attrs,
    HTML_Partial_Content  content
  )=
  html_wave_box(legend, content, [class("frame")]+attrs).
  
public define HTML_Partial_Content 
  html_wave_box
  (
    String         legend,
    HTML_Off_Form  content
  )=
  html_wave_box(legend, content, [class("frame")]).
  
public define HTML_Off_Form 
  html_wave_box_custom_size
  (
    Int           size,
    String        legend,
    HTML_Off_Form content,
  )=
  div([style("width: "+abs_to_decimal(size)+"px")],
    sequence(
    [
      text([class("frame_wave")], legend),   //legend
      div([class("frame_blk")], content)
    ])).
    
public define HTML_Off_Form 
  html_wave_box_wide
  (
    String        legend,
    HTML_Off_Form content
  )=
  html_wave_box(legend, content, [class("frame wide")]).
  
public define HTML_Partial_Content 
  html_wave_box_wide
  (
    String                legend,
    HTML_Partial_Content  content
  )=
  html_wave_box(legend, content, [class("frame wide")]).

  /**** CHANGELIST ****/
public type ChangeListItem:
  change_list_item(
    String icon,
    String label,
    HTML_Off_Form value).

public define ChangeListItem
  change_list_item
  (
    String  icon,
    String  label,
    String  value
  )=
  change_list_item(icon, label, text(value)).
  
public define ChangeListItem
  change_list_item
  (
    String  label,
    String  value
  )=
  change_list_item("", label, text(value)).

public define ChangeListItem
  change_list_item
  (
    String         label,
    HTML_Off_Form  value
  )=
  change_list_item("", label, value).
  
define HTML_Row(HTML_Off_Form)
  make_row
  (
    ChangeListItem  item,
    Int             odd,
  )=
  if item is change_list_item(icon, label, value) then
  //with bg = (Cell_Option)   else core_attrs([class()]),
  row([],
    if icon = "" then
        [ cell([core_attrs([class("label")])],text(label)),
          cell(value)
        ]
    else
        [ cell([core_attrs([class("icon "+icon)])],text("")),
          cell([core_attrs([class("label")])],text(label)),
          cell(value)
        ]
     )
  .
  
define List(HTML_Row(HTML_Off_Form))
  make_changelist_rows
  (
    List(ChangeListItem)          items,
    List(HTML_Row(HTML_Off_Form)) so_far,
    Int                           odd
  )=
  if items is
  {
    []      then reverse(so_far),
    [h . t] then 
      make_changelist_rows(t, [ make_row(h, odd) . so_far], 1 - odd)
  }.
  
public define HTML_Partial_Content
  changelist_table
  (
    List(ChangeListItem) items
  )=
  partial_content([css(css_file("css/changelists.css"))],
  div([class("changelist")],
    table([/*class("module"), */ attr("cellspacing","0")], make_changelist_rows(items, [], 1))))
  .
  
 public define HTML_Off_Form
  html_tooltip
  (
    String title,
    String keyword,
  ) =
  literal("<a id=\"help_"+keyword+"\" class=\"jTipu jTip_help\" name=\""+title+"\" href=\"/?a=ajax_show_tooltip&amp;tooltip_id="+keyword+"\"></a>").
  
  actioner(same,same, link([id("help_" + keyword), class("jTip jTip_help"), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_id", keyword)], []).

public define HTML_Off_Form
  html_tooltip
  (
    String title,
    String keyword,
    Int  width,
  ) =
  literal("<a id=\"help_"+keyword+"\" class=\"jTipu jTip_help\" name=\""+title+"\" href=\"/?a=ajax_show_tooltip&amp;tooltip_id="+keyword+"&width="+width+"\"></a>").

  actioner(same,same, link([id("help_" + keyword), class("jTip jTip_help"), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_id", keyword), ("width", to_decimal(width))], []).

 public define HTML_In_Form
  html_tooltip
  (
    String title,
    String keyword,
  ) =
  literal("<a id=\"help_"+keyword+"\" class=\"jTipu jTip_help\" name=\""+title+"\" href=\"/?a=ajax_show_tooltip&amp;tooltip_id="+keyword+"\"></a>").

  actioner(same,same, link([id("help_" + keyword), class("jTip jTip_help"), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_id", keyword)], []).

public define HTML_In_Form
  html_tooltip
  (
    String title,
    String keyword,
    Int  width,
  ) =
  literal("<a id=\"help_"+keyword+"\" class=\"jTipu jTip_help\" name=\""+title+"\" href=\"/?a=ajax_show_tooltip&amp;tooltip_id="+keyword+"&width="+width+"\"></a>").

  actioner(same,same, link([id("help_" + keyword), class("jTip jTip_help"), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_id", keyword), ("width", to_decimal(width))], []).
  
 public define HTML_Off_Form
  html_tooltip_ext
  (
    String  title,
    String  keyword,
    String  class_suffix
  ) =
  actioner(same,same, link([id("help_" + keyword), class("jTip jTip_"+class_suffix), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_ext", keyword)], []).

public define HTML_Off_Form
  html_tooltip_ext
  (
    String  title,
    String  keyword,
    String  class_suffix,
    List((String, String)) ext_args
  ) =
  with extra_args = format_extra_operands(ext_args),
  literal("<a id=\"help_"+keyword+"\" class=\"jTipu jTip_"+class_suffix+"\" name=\""+title+"\" href=\"/?a=ajax_show_tooltip&amp;tooltip_ext="+keyword+extra_args+"\"></a>").

  actioner(same,same, link([id("help_" + keyword), class("jTip jTip_"+class_suffix), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_ext", keyword)] + ext_args, []).

 public define HTML_In_Form
  html_tooltip_ext
  (
    String  title,
    String  keyword,
    String  class_suffix
  ) =
  actioner(same,same, link([id("help_" + keyword), class("jTipu jTip_"+class_suffix), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_ext", keyword)], []).

public define HTML_In_Form
  html_tooltip_ext
  (
    String  title,
    String  keyword,
    String  class_suffix,
    List((String, String)) ext_args
  ) =
  with extra_args = format_extra_operands(ext_args),
  literal("<a id=\"help_"+keyword+"\" class=\"jTipu jTip_"+class_suffix+"\" name=\""+title+"\" href=\"/?a=ajax_show_tooltip&amp;tooltip_ext="+keyword+extra_args+"\"></a>").
  
  
  href=\"/?a=ajax_show_tooltip&amp;tooltip_id="+keyword+"\" id=\"help_"+keyword+HELP_HMS_MODE" class="jTip jTip_help" target="_blank" name="Aide sur la fonctionnalité 'No Limit'"> </a>").
  
  actioner(same,same, link([id("help_" + keyword), class("jTip jTip_"+class_suffix), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_ext", keyword)] + ext_args, []).