/* * 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)) ]) )) }.