From dbcb1def296c1e38884e5829c85545a4f8dbb891 Mon Sep 17 00:00:00 2001 From: severin Date: Sat, 4 Jan 2014 16:14:30 +0100 Subject: [PATCH] Added date chooser widget --- .../widgets/wsf_country_chooser_control.e | 95 +++++++++++++++++++ .../widgets/wsf_datetime_picker_control.e | 11 +++ .../wsf_js_widget/wsf_js_widget-safe.ecf | 2 +- 3 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 draft/library/wsf_js_widget/kernel/widgets/wsf_country_chooser_control.e create mode 100644 draft/library/wsf_js_widget/kernel/widgets/wsf_datetime_picker_control.e diff --git a/draft/library/wsf_js_widget/kernel/widgets/wsf_country_chooser_control.e b/draft/library/wsf_js_widget/kernel/widgets/wsf_country_chooser_control.e new file mode 100644 index 00000000..94e7572b --- /dev/null +++ b/draft/library/wsf_js_widget/kernel/widgets/wsf_country_chooser_control.e @@ -0,0 +1,95 @@ +note + description: "Summary description for {WSF_COUNTRY_CHOOSER_CONTROL}." + author: "" + date: "$Date$" + revision: "$Revision$" + +class + WSF_COUNTRY_CHOOSER_CONTROL + +inherit + + WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] + rename + make as make_multi_control, + make_with_tag_name as make_multi_control_with_tag_name + select + make_control + end + + WSF_VALUE_CONTROL [STRING] + undefine + load_state, + full_state, + read_state_changes, + make + end + +create + make, make_with_tag_name + +feature {NONE} -- Initialization + + make (title: STRING) + -- Make a dropdown control with div tag name and specified menu title + do + make_with_tag_name (title, "div") + end + + make_with_tag_name (title, t: STRING) + -- Make a dropdown control with specified tag name (such as li) and menu title + local + temp: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] + options: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] + listbox: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] + do + make_multi_control_with_tag_name (t) + add_class ("bfh-selectbox bfh-countries") + append_attribute ("data-country=%"US%" data-flags=%"true%"") + create input.make ("") + input.append_attribute ("type=%"hidden%"") + add_control (input) + create temp.make_with_tag_name ("a") + temp.add_class ("bfh-selectbox-toggle") + temp.append_attribute ("role=%"button%" data-toggle=%"bfh-selectbox%" href=%"#%"") + temp.add_control (create {WSF_BASIC_CONTROL}.make_with_body_class ("span", "data-option=%"%"", "bfh-selectbox-option input-medium", "")) + temp.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("b", "style=%"border-top-color: black !important;%"", "")) + add_control (temp) + create options.make + options.add_class ("bfh-selectbox-options") + options.add_control (create {WSF_BASIC_CONTROL}.make_with_body_class ("input", "type=%"text%"", "bfh-selectbox-filter", "")) + create listbox.make + listbox.append_attribute ("role=%"listbox%"") + listbox.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("ul", "role=%"option%"", "")) + options.add_control (listbox) + add_control (options) + end + --
+ -- + -- + -- + --
+ -- + --
+ --
    + --
+ --
+ --
+ --
+ +feature -- Implementation + + value: STRING + do + Result := input.value + end + +feature -- Properties + + input:WSF_INPUT_CONTROL + +end diff --git a/draft/library/wsf_js_widget/kernel/widgets/wsf_datetime_picker_control.e b/draft/library/wsf_js_widget/kernel/widgets/wsf_datetime_picker_control.e new file mode 100644 index 00000000..0e9b0937 --- /dev/null +++ b/draft/library/wsf_js_widget/kernel/widgets/wsf_datetime_picker_control.e @@ -0,0 +1,11 @@ +note + description: "Summary description for {WSF_DATETIME_PICKER_CONTROL}." + author: "" + date: "$Date$" + revision: "$Revision$" + +class + WSF_DATETIME_PICKER_CONTROL +inherit + +end diff --git a/draft/library/wsf_js_widget/wsf_js_widget-safe.ecf b/draft/library/wsf_js_widget/wsf_js_widget-safe.ecf index 690881a7..36617de7 100644 --- a/draft/library/wsf_js_widget/wsf_js_widget-safe.ecf +++ b/draft/library/wsf_js_widget/wsf_js_widget-safe.ecf @@ -17,7 +17,7 @@ - +