fisheye_menu.anubis
2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
* Created by PyramIDE.
* User: フランスのトトロ
* Date: 09/05/2015
* Time: 22:33
* © David RENÉ
*/
transmit tools/basis.anubis
transmit xlib/web/CXM_making_a_web_site.anubis
read xlib/web/jQuery/CXM_jquery_animate.anubis
read xlib/web/CXM_jquery.anubis
public type FisheyeEntry:
fisheye_entry(
String id, //html id
String icon_path, //path of the icon to shown with this entry
String action, //action to do when click on that icon
String help_text //Help text to show
).
define List(HTML_Off_Form)
make_fisheye_menu
(
(String) -> String _T, //translator function
List(FisheyeEntry) entries,
List(HTML_Off_Form) so_far,
String selected_space //id of the selected space
)=
if entries is
{
[] then reverse(so_far), //reverse to be in the right direction
[h . t] then
with entry = (HTML_Off_Form)img(
[
id(h.id),
class("menu_item"+if h.id = selected_space then " menu_selected" else ""),
event(onclick,"location.href='?a="+h.action+"';"),
attr("widgetid",h.id),
attr("title",_T(h.help_text))
],
h.icon_path,
_T(h.help_text)),
make_fisheye_menu(_T, t, [ entry . so_far], selected_space)
}.
public define HTML_Partial_Content
make_fisheye_menu
(
(String) -> String _T, //translator function
List(FisheyeEntry) entries, //List of all eyes to show
String selected_space //html id of the selected eye (means that it will be surrounded with square to indicate the selection)
)=
if entries is
{
[] then partial_empty,
[_ . _] then partial_content(jquery_animate(childs(html_Id("top_menu")), size_on_hover(64, 64, 350, 1420)),
div([id("top_menu"), style("min-height:70px!important;vertical-align:top;display:table-row")],
sequence([
//Liste des espaces
sequence(make_fisheye_menu(_T, entries, [], selected_space))
])
))
}.