Commit ceed0d51eed1f2ac4cd90c23462415b71bcc8402
1 parent
f0610c45
add some useful widgets used in almost all Calexium projects
Showing
2 changed files
with
292 additions
and
0 deletions
Show diff stats
| 1 | +/* | ||
| 2 | + * Created by PyramIDE. | ||
| 3 | + * User: フランスのトトロ | ||
| 4 | + * Date: 06/05/2007 | ||
| 5 | + * Time: 09:39 | ||
| 6 | + * © Calexium | ||
| 7 | + */ | ||
| 8 | + | ||
| 9 | +read tools/basis.anubis | ||
| 10 | + | ||
| 11 | +read calexium_lib/web/CXM_common.anubis | ||
| 12 | +read calexium_lib/web/CXM_making_a_web_site.anubis | ||
| 13 | + | ||
| 14 | + /**** WAVE BOX ****/ | ||
| 15 | + | ||
| 16 | +public define HTML_Partial_Content | ||
| 17 | + html_wave_box | ||
| 18 | + ( | ||
| 19 | + String legend, | ||
| 20 | + HTML_Partial_Content content, | ||
| 21 | + String class_id | ||
| 22 | + )= | ||
| 23 | + partial_content([], | ||
| 24 | + div([class(class_id)], | ||
| 25 | + sequence( | ||
| 26 | + [ | ||
| 27 | + text([class("frame_wave")], legend), //legend | ||
| 28 | + div([class("frame_blk")], partial(content)) | ||
| 29 | + ]))). | ||
| 30 | + | ||
| 31 | +public define HTML_Partial_Content | ||
| 32 | + html_wave_box | ||
| 33 | + ( | ||
| 34 | + String legend, | ||
| 35 | + HTML_Off_Form content, | ||
| 36 | + String class_id | ||
| 37 | + )= | ||
| 38 | + partial_content([], | ||
| 39 | + div([class(class_id)], | ||
| 40 | + sequence( | ||
| 41 | + [ | ||
| 42 | + text([class("frame_wave")], legend), //legend | ||
| 43 | + div([class("frame_blk")], content) | ||
| 44 | + ]))). | ||
| 45 | + | ||
| 46 | +public define HTML_Off_Form | ||
| 47 | + html_wave_box | ||
| 48 | + ( | ||
| 49 | + String legend, | ||
| 50 | + HTML_Off_Form content, | ||
| 51 | + String class_id | ||
| 52 | + )= | ||
| 53 | + div([class(class_id)], | ||
| 54 | + sequence( | ||
| 55 | + [ | ||
| 56 | + text([class("frame_wave")], legend), //legend | ||
| 57 | + div([class("frame_blk")], content) | ||
| 58 | + ])). | ||
| 59 | + | ||
| 60 | +public define HTML_Off_Form | ||
| 61 | + html_wave_box | ||
| 62 | + ( | ||
| 63 | + String legend, | ||
| 64 | + HTML_Off_Form content | ||
| 65 | + )= | ||
| 66 | + html_wave_box(legend, content, "frame"). | ||
| 67 | + | ||
| 68 | +public define HTML_Partial_Content | ||
| 69 | + html_wave_box | ||
| 70 | + ( | ||
| 71 | + String legend, | ||
| 72 | + HTML_Partial_Content content | ||
| 73 | + )= | ||
| 74 | + html_wave_box(legend, content, "frame"). | ||
| 75 | + | ||
| 76 | +public define HTML_Partial_Content | ||
| 77 | + html_wave_box | ||
| 78 | + ( | ||
| 79 | + String legend, | ||
| 80 | + HTML_Off_Form content | ||
| 81 | + )= | ||
| 82 | + html_wave_box(legend, content, "frame"). | ||
| 83 | + | ||
| 84 | +public define HTML_Off_Form | ||
| 85 | + html_wave_box_custom_size | ||
| 86 | + ( | ||
| 87 | + Int size, | ||
| 88 | + String legend, | ||
| 89 | + HTML_Off_Form content, | ||
| 90 | + )= | ||
| 91 | + div([style("width: "+abs_to_decimal(size)+"px")], | ||
| 92 | + sequence( | ||
| 93 | + [ | ||
| 94 | + text([class("frame_wave")], legend), //legend | ||
| 95 | + div([class("frame_blk")], content) | ||
| 96 | + ])). | ||
| 97 | + | ||
| 98 | +public define HTML_Off_Form | ||
| 99 | + html_wave_box_wide | ||
| 100 | + ( | ||
| 101 | + String legend, | ||
| 102 | + HTML_Off_Form content | ||
| 103 | + )= | ||
| 104 | + html_wave_box(legend, content, "frame wide"). | ||
| 105 | + | ||
| 106 | +public define HTML_Partial_Content | ||
| 107 | + html_wave_box_wide | ||
| 108 | + ( | ||
| 109 | + String legend, | ||
| 110 | + HTML_Partial_Content content | ||
| 111 | + )= | ||
| 112 | + html_wave_box(legend, content, "frame wide"). | ||
| 113 | + | ||
| 114 | + /**** CHANGELIST ****/ | ||
| 115 | +public type ChangeListItem: | ||
| 116 | + change_list_item( | ||
| 117 | + String icon, | ||
| 118 | + String label, | ||
| 119 | + String value). | ||
| 120 | + | ||
| 121 | +define HTML_Row(HTML_Off_Form) | ||
| 122 | + make_row | ||
| 123 | + ( | ||
| 124 | + ChangeListItem item, | ||
| 125 | + Int odd, | ||
| 126 | + )= | ||
| 127 | + if item is change_list_item(icon, label, value) then | ||
| 128 | + //with bg = (Cell_Option) else core_attrs([class()]), | ||
| 129 | + row([], | ||
| 130 | + [ | ||
| 131 | + cell([core_attrs([class("icon "+icon)])],text("")), | ||
| 132 | + cell([core_attrs([class("label")])],text(label)), | ||
| 133 | + cell(text(value)) | ||
| 134 | + ] | ||
| 135 | + ) | ||
| 136 | + . | ||
| 137 | + | ||
| 138 | +define List(HTML_Row(HTML_Off_Form)) | ||
| 139 | + make_changelist_rows | ||
| 140 | + ( | ||
| 141 | + List(ChangeListItem) items, | ||
| 142 | + List(HTML_Row(HTML_Off_Form)) so_far, | ||
| 143 | + Int odd | ||
| 144 | + )= | ||
| 145 | + if items is | ||
| 146 | + { | ||
| 147 | + [] then reverse(so_far), | ||
| 148 | + [h . t] then | ||
| 149 | + make_changelist_rows(t, [ make_row(h, odd) . so_far], 1 - odd) | ||
| 150 | + }. | ||
| 151 | + | ||
| 152 | +public define HTML_Off_Form | ||
| 153 | + process_changelist | ||
| 154 | + ( | ||
| 155 | + List(ChangeListItem) items | ||
| 156 | + )= | ||
| 157 | + div([class("changelist")], | ||
| 158 | + table([class("module"), attr("cellspacing","0")], make_changelist_rows(items, [], 1))) | ||
| 159 | + . | ||
| 160 | + | ||
| 161 | +public define HTML_Off_Form | ||
| 162 | + html_tooltip | ||
| 163 | + ( | ||
| 164 | + String title, | ||
| 165 | + String keyword, | ||
| 166 | + ) = | ||
| 167 | + literal("<a id=\"help_"+keyword+"\" class=\"jTipu jTip_help\" name=\""+title+"\" href=\"/?a=ajax_show_tooltip&tooltip_id="+keyword+"\"></a>"). | ||
| 168 | + | ||
| 169 | + actioner(same,same, link([id("help_" + keyword), class("jTip jTip_help"), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_id", keyword)], []). | ||
| 170 | + | ||
| 171 | +public define HTML_Off_Form | ||
| 172 | + html_tooltip | ||
| 173 | + ( | ||
| 174 | + String title, | ||
| 175 | + String keyword, | ||
| 176 | + Int width, | ||
| 177 | + ) = | ||
| 178 | + literal("<a id=\"help_"+keyword+"\" class=\"jTipu jTip_help\" name=\""+title+"\" href=\"/?a=ajax_show_tooltip&tooltip_id="+keyword+"&width="+width+"\"></a>"). | ||
| 179 | + | ||
| 180 | + 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))], []). | ||
| 181 | + | ||
| 182 | +public define HTML_In_Form | ||
| 183 | + html_tooltip | ||
| 184 | + ( | ||
| 185 | + String title, | ||
| 186 | + String keyword, | ||
| 187 | + ) = | ||
| 188 | + literal("<a id=\"help_"+keyword+"\" class=\"jTipu jTip_help\" name=\""+title+"\" href=\"/?a=ajax_show_tooltip&tooltip_id="+keyword+"\"></a>"). | ||
| 189 | + | ||
| 190 | + actioner(same,same, link([id("help_" + keyword), class("jTip jTip_help"), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_id", keyword)], []). | ||
| 191 | + | ||
| 192 | +public define HTML_In_Form | ||
| 193 | + html_tooltip | ||
| 194 | + ( | ||
| 195 | + String title, | ||
| 196 | + String keyword, | ||
| 197 | + Int width, | ||
| 198 | + ) = | ||
| 199 | + literal("<a id=\"help_"+keyword+"\" class=\"jTipu jTip_help\" name=\""+title+"\" href=\"/?a=ajax_show_tooltip&tooltip_id="+keyword+"&width="+width+"\"></a>"). | ||
| 200 | + | ||
| 201 | + 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))], []). | ||
| 202 | + | ||
| 203 | + public define HTML_Off_Form | ||
| 204 | + html_tooltip_ext | ||
| 205 | + ( | ||
| 206 | + String title, | ||
| 207 | + String keyword, | ||
| 208 | + String class_suffix | ||
| 209 | + ) = | ||
| 210 | + actioner(same,same, link([id("help_" + keyword), class("jTip jTip_"+class_suffix), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_ext", keyword)], []). | ||
| 211 | + | ||
| 212 | +public define HTML_Off_Form | ||
| 213 | + html_tooltip_ext | ||
| 214 | + ( | ||
| 215 | + String title, | ||
| 216 | + String keyword, | ||
| 217 | + String class_suffix, | ||
| 218 | + List((String, String)) ext_args | ||
| 219 | + ) = | ||
| 220 | + with extra_args = format_extra_operands(ext_args), | ||
| 221 | + literal("<a id=\"help_"+keyword+"\" class=\"jTipu jTip_"+class_suffix+"\" name=\""+title+"\" href=\"/?a=ajax_show_tooltip&tooltip_ext="+keyword+extra_args+"\"></a>"). | ||
| 222 | + | ||
| 223 | + 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, []). | ||
| 224 | + | ||
| 225 | + public define HTML_In_Form | ||
| 226 | + html_tooltip_ext | ||
| 227 | + ( | ||
| 228 | + String title, | ||
| 229 | + String keyword, | ||
| 230 | + String class_suffix | ||
| 231 | + ) = | ||
| 232 | + actioner(same,same, link([id("help_" + keyword), class("jTipu jTip_"+class_suffix), attr("target", "_blank")], " ", success(title)), "ajax_show_tooltip", [("tooltip_ext", keyword)], []). | ||
| 233 | + | ||
| 234 | +public define HTML_In_Form | ||
| 235 | + html_tooltip_ext | ||
| 236 | + ( | ||
| 237 | + String title, | ||
| 238 | + String keyword, | ||
| 239 | + String class_suffix, | ||
| 240 | + List((String, String)) ext_args | ||
| 241 | + ) = | ||
| 242 | + with extra_args = format_extra_operands(ext_args), | ||
| 243 | + literal("<a id=\"help_"+keyword+"\" class=\"jTipu jTip_"+class_suffix+"\" name=\""+title+"\" href=\"/?a=ajax_show_tooltip&tooltip_ext="+keyword+extra_args+"\"></a>"). | ||
| 244 | + | ||
| 245 | + | ||
| 246 | + href=\"/?a=ajax_show_tooltip&tooltip_id="+keyword+"\" id=\"help_"+keyword+HELP_HMS_MODE" class="jTip jTip_help" target="_blank" name="Aide sur la fonctionnalité 'No Limit'"> </a>"). | ||
| 247 | + | ||
| 248 | + 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, []). |
| 1 | +/* | ||
| 2 | + * Created by PyramIDE. | ||
| 3 | + * User: フランスのトトロ | ||
| 4 | + * Date: 10/04/2015 | ||
| 5 | + * Time: 22:22 | ||
| 6 | + * © Calexium | ||
| 7 | + */ | ||
| 8 | + | ||
| 9 | +read tools/basis.anubis | ||
| 10 | + | ||
| 11 | +read calexium_lib/web/CXM_common.anubis | ||
| 12 | +read calexium_lib/web/CXM_making_a_web_site.anubis | ||
| 13 | + | ||
| 14 | +read css_helper.anubis | ||
| 15 | + | ||
| 16 | +public type Dashboard_content: | ||
| 17 | + none, | ||
| 18 | + content(List(ChangeListItem) content, String title). | ||
| 19 | + | ||
| 20 | +public define HTML_Off_Form | ||
| 21 | + dash_board | ||
| 22 | + ( | ||
| 23 | + Dashboard_content left, | ||
| 24 | + Dashboard_content right | ||
| 25 | + )= | ||
| 26 | + table([class("container")], | ||
| 27 | + [ row( [ cell([class("module_col left_col")], | ||
| 28 | + if left is | ||
| 29 | + { | ||
| 30 | + none then literal(""), | ||
| 31 | + content(list, title) then html_wave_box_wide(title, sequence([process_changelist(list)])) | ||
| 32 | + } | ||
| 33 | + ), | ||
| 34 | + cell([class("module_col right_col")], | ||
| 35 | + if right is | ||
| 36 | + { | ||
| 37 | + none then literal(""), | ||
| 38 | + content(list, title) then html_wave_box_wide(title, sequence([process_changelist(list)])) | ||
| 39 | + } | ||
| 40 | + ) | ||
| 41 | + ]) | ||
| 42 | + ]). | ||
| 43 | + | ||
| 44 | + |