From 8b2211a6e0dc130bfa9c5edd8f80b9f00ea539f2 Mon Sep 17 00:00:00 2001 From: totoro Date: Sat, 9 May 2015 23:04:29 +0200 Subject: [PATCH] Move the fisheye code from internal MailFountain code to calexium_lib, to let share it with all. This is also the start point of migration from dojo to jquery js dependency. Julien will perform this migration --- web/widgets/fisheye_menu.anubis | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+), 0 deletions(-) create mode 100644 web/widgets/fisheye_menu.anubis diff --git a/web/widgets/fisheye_menu.anubis b/web/widgets/fisheye_menu.anubis new file mode 100644 index 0000000..5085df9 --- /dev/null +++ b/web/widgets/fisheye_menu.anubis @@ -0,0 +1,76 @@ +/* + * Created by PyramIDE. + * User: フランスのトトロ + * Date: 09/05/2015 + * Time: 22:33 + * © Calexium + */ + +transmit tools/basis.anubis +transmit calexium_lib/web/CXM_making_a_web_site.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)image( + [ + 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_content([], literal("")), + [_ . _] then partial_content([], + + 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)), + + literal("\n")]) + )) + + }. -- libgit2 0.21.4