From c6d59d3366d9ea4bf3e988a9b4ee5bbf6ce7a8a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Severin=20M=C3=BCnger?= Date: Fri, 27 Sep 2013 18:13:55 +0200 Subject: [PATCH 1/3] Fixed slider --- .../kernel/navbar/wsf_navbar_control.e | 27 ++++++---- .../kernel/slider/wsf_image_slider_control.e | 52 +++++++++++++------ .../kernel/webcontrol/wsf_basic_control.e | 13 ++++- .../kernel/webcontrol/wsf_control.e | 41 +++++++-------- .../kernel/webcontrol/wsf_stateless_control.e | 2 +- examples/widgetapp/base_page.e | 8 +-- examples/widgetapp/image_slider_page.e | 2 + examples/widgetapp/sample_page.e | 1 + 8 files changed, 91 insertions(+), 55 deletions(-) diff --git a/draft/library/wsf_js_widget/kernel/navbar/wsf_navbar_control.e b/draft/library/wsf_js_widget/kernel/navbar/wsf_navbar_control.e index d3fbf2c6..e26244b8 100644 --- a/draft/library/wsf_js_widget/kernel/navbar/wsf_navbar_control.e +++ b/draft/library/wsf_js_widget/kernel/navbar/wsf_navbar_control.e @@ -25,6 +25,7 @@ feature {NONE} -- Initialization make_multi_control (n) add_class ("navbar navbar-inverse navbar-fixed-top") create nav.make_with_tag_name (control_name + "_nav", "ul") + create nav_right.make_with_tag_name (control_name + "_nav_right", "ul") nav.add_class ("nav navbar-nav") end @@ -43,16 +44,15 @@ feature -- Rendering nav_string: STRING do temp := render_tag_with_tagname ("span", "", "", "icon-bar") - temp.append (render_tag_with_tagname ("span", "", "", "icon-bar")) - temp.append (render_tag_with_tagname ("span", "", "", "icon-bar")) + temp.multiply (3) temp := render_tag_with_tagname ("button", temp, "", "navbar-toggle") if attached brand as b then temp.append (render_tag_with_tagname ("a", b, "href=%"#%"", "navbar-brand")) end temp := render_tag_with_tagname ("div", temp, "", "navbar-header") nav_string := nav.render - if attached nav_right as n then - nav_string.append (n.render) + if nav_right.controls.count > 0 then + nav_string.append (nav_right.render) end temp.append (render_tag_with_tagname ("div", nav_string, "", "navbar-collapse")) Result := render_tag_with_tagname ("div", temp, "", "container") @@ -61,6 +61,17 @@ feature -- Rendering feature -- Change + set_active (tab: INTEGER) + require + tab >= 0 and tab < nav.controls.count + nav_right.controls.count + do + if tab < nav.controls.count then + nav.controls.i_th (tab).add_class ("active") + else + nav_right.controls.i_th (tab - nav.controls.count).add_class ("active") + end + end + add_list_element_right (c: WSF_STATELESS_CONTROL) -- Add element in li tag to right aligned part of navbar local @@ -68,11 +79,7 @@ feature -- Change li: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] do name := control_name + "_rightlink"; - if attached nav_right as right then - name := name + right.controls.count.out - else - name := name + "0" - end + name := name + nav_right.controls.count.out create li.make_with_tag_name (name, "li") li.add_control (c) add_element_right (li) @@ -117,7 +124,7 @@ feature -- Properties nav: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] -- Middle nav - nav_right: detachable WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] + nav_right: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] -- Right nav end diff --git a/draft/library/wsf_js_widget/kernel/slider/wsf_image_slider_control.e b/draft/library/wsf_js_widget/kernel/slider/wsf_image_slider_control.e index 7e1f4948..51607549 100644 --- a/draft/library/wsf_js_widget/kernel/slider/wsf_image_slider_control.e +++ b/draft/library/wsf_js_widget/kernel/slider/wsf_image_slider_control.e @@ -21,9 +21,9 @@ feature {NONE} -- Initialization do make_control (n, "div") add_class ("carousel slide") - create list.make_with_tag_name (control_name+"_links", "ol") + create list.make_with_tag_name (control_name + "_links", "ol") list.add_class ("carousel-indicators") - create slide_wrapper.make_multi_control (control_name+"_wrapper") + create slide_wrapper.make_multi_control (control_name + "_wrapper") slide_wrapper.add_class ("carousel-inner") end @@ -53,45 +53,63 @@ feature -- Rendering do temp := list.render temp.append (slide_wrapper.render) - temp.append (render_tag_with_tagname ("a", "", "href=%"#" + control_name + "%" data-slide=%"next%"", "left carousel-control")) - temp.append (render_tag_with_tagname ("a", "", "href=%"#" + control_name + "%" data-slide=%"prev%"", "right carousel-control")) + temp.append (render_tag_with_tagname ("a", "", "href=%"#" + control_name + "%" data-slide=%"prev%"", "left carousel-control")) + temp.append (render_tag_with_tagname ("a", "", "href=%"#" + control_name + "%" data-slide=%"next%"", "right carousel-control")) Result := render_tag (temp, "") end feature -- Change - add_image_with_caption (src, alt: STRING; caption: detachable WSF_STATELESS_CONTROL) + add_image_with_caption (src, alt, caption: STRING) + local + caption_control: detachable WSF_STATELESS_CONTROL + do + if attached caption as c then + caption_control := create {WSF_BASIC_CONTROL}.make_with_body ("p", "", c) + end + add_image_with_caption_control (src, alt, caption_control) + end + + add_image_with_caption_control (src, alt: STRING; caption: detachable WSF_STATELESS_CONTROL) -- Add a new image to the slider, with specified url, alternative text and caption element local - item: WSF_MULTI_CONTROL[WSF_STATELESS_CONTROL] + item: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] do - list.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("li", "data-target=%"#" + control_name + "%" data-slide-to=%"" + list.controls.count.out + "%"", "")); - create item.make_multi_control (control_name+"_item"+slide_wrapper.controls.count.out) + create item.make_multi_control (control_name + "_item" + slide_wrapper.controls.count.out) item.add_class ("item") - item.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("img", "src=%"" + src + "%" alt=%"" + alt + "%"", "")) + item.add_control (create {WSF_BASIC_CONTROL}.make_with_body_class ("img", "src=%"" + src + "%" alt=%"" + alt + "%"", "", "")) if attached caption as c then item.add_control (c) end - slide_wrapper.add_control (item) + add_control (item) end add_image (src, alt: STRING) -- Add a new image to the slider, with specified url and alternative text do - add_image_with_caption (src, alt, Void) + add_image_with_caption (src, alt, "") end - add_control(c:WSF_STATELESS_CONTROL) - do - - end + add_control (c: WSF_STATELESS_CONTROL) + -- Add a new control to the slider + local + cl: STRING + do + cl := "" + if slide_wrapper.controls.count = 0 then + cl := "active" + c.add_class (cl) + end + slide_wrapper.add_control (c) + list.add_control (create {WSF_BASIC_CONTROL}.make_with_body_class ("li", "data-target=%"#" + control_name + "%" data-slide-to=%"" + list.controls.count.out + "%"", cl, "")); + end feature -- Properties - list: WSF_MULTI_CONTROL[WSF_STATELESS_CONTROL] + list: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] -- List of slider links - slide_wrapper: WSF_MULTI_CONTROL[WSF_STATELESS_CONTROL] + slide_wrapper: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] -- List of the single slides end diff --git a/draft/library/wsf_js_widget/kernel/webcontrol/wsf_basic_control.e b/draft/library/wsf_js_widget/kernel/webcontrol/wsf_basic_control.e index 8bcf360e..e168f145 100644 --- a/draft/library/wsf_js_widget/kernel/webcontrol/wsf_basic_control.e +++ b/draft/library/wsf_js_widget/kernel/webcontrol/wsf_basic_control.e @@ -15,14 +15,14 @@ inherit end create - make_control, make_with_body + make_control, make_with_body, make_with_body_class feature {NONE} -- Initialization make_control (t: STRING) -- Initialize do - make_with_body (t, "", "") + make_with_body_class (t, "", "", "") end make_with_body (t, attr, b: STRING) @@ -33,6 +33,15 @@ feature {NONE} -- Initialization body := b end + make_with_body_class (t, attr, c, b: STRING) + -- Initialize with specific attributes and body + do + make_with_body (t, attr, b) + if not c.is_empty then + css_classes.extend (c) + end + end + feature -- Rendering render: STRING diff --git a/draft/library/wsf_js_widget/kernel/webcontrol/wsf_control.e b/draft/library/wsf_js_widget/kernel/webcontrol/wsf_control.e index 761e0207..f3d3999f 100644 --- a/draft/library/wsf_js_widget/kernel/webcontrol/wsf_control.e +++ b/draft/library/wsf_js_widget/kernel/webcontrol/wsf_control.e @@ -14,11 +14,6 @@ inherit render_tag end - -feature - - control_name: STRING - feature {NONE} -- Initialization make_control (n, a_tag_name: STRING) @@ -37,30 +32,30 @@ feature {NONE} -- Initialization feature -- Actions - start_modal(url:STRING; title:STRING) - --Start a modal window containg an other or the same page + start_modal (url: STRING; title: STRING) + --Start a modal window containg an other or the same page local - modal:JSON_OBJECT + modal: JSON_OBJECT do create modal.make - modal.put (create {JSON_STRING}.make_json("start_modal"), "type") - modal.put (create {JSON_STRING}.make_json(url), "url") - modal.put (create {JSON_STRING}.make_json(title), "title") + modal.put (create {JSON_STRING}.make_json ("start_modal"), "type") + modal.put (create {JSON_STRING}.make_json (url), "url") + modal.put (create {JSON_STRING}.make_json (title), "title") actions.add (modal) end - show_alert(mesage:STRING) - --Start a modal window containg an other or the same page + show_alert (mesage: STRING) + --Start a modal window containg an other or the same page local - modal:JSON_OBJECT + modal: JSON_OBJECT do create modal.make - modal.put (create {JSON_STRING}.make_json("show_alert"), "type") - modal.put (create {JSON_STRING}.make_json(mesage), "message") + modal.put (create {JSON_STRING}.make_json ("show_alert"), "type") + modal.put (create {JSON_STRING}.make_json (mesage), "message") actions.add (modal) end -feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT +feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management load_state (new_states: JSON_OBJECT) -- Select state stored with `control_name` as key @@ -90,9 +85,9 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT end if actions.count > 0 then if not attached states.item ("actions") then - states.put (create {JSON_ARRAY}.make_array,"actions") + states.put (create {JSON_ARRAY}.make_array, "actions") end - if attached {JSON_ARRAY}states.item ("actions") as action_list then + if attached {JSON_ARRAY} states.item ("actions") as action_list then across actions.array_representation as action loop @@ -138,17 +133,18 @@ feature -- Rendering Result := render_tag_with_tagname (tag_name, body, l_attributes, css_classes_string) end -feature -- EVENT HANDLING +feature -- Event handling handle_callback (cname: STRING; event: STRING; event_parameter: detachable STRING) -- Method called if any callback received. In this method you can route the callback to the event handler deferred end + feature -- Change set_isolation (p: BOOLEAN) do - isolate := true + isolate := p end feature -- Properties @@ -156,4 +152,7 @@ feature -- Properties isolate: BOOLEAN actions: JSON_ARRAY + + control_name: STRING + end diff --git a/draft/library/wsf_js_widget/kernel/webcontrol/wsf_stateless_control.e b/draft/library/wsf_js_widget/kernel/webcontrol/wsf_stateless_control.e index 011585cc..f890f7be 100644 --- a/draft/library/wsf_js_widget/kernel/webcontrol/wsf_stateless_control.e +++ b/draft/library/wsf_js_widget/kernel/webcontrol/wsf_stateless_control.e @@ -27,7 +27,7 @@ feature -- Access -- List of classes (appear in the "class" attribute) attributes: detachable STRING - -- Attributes string + -- Attributes string (without classes) feature -- Change diff --git a/examples/widgetapp/base_page.e b/examples/widgetapp/base_page.e index 2c119c19..957b231e 100644 --- a/examples/widgetapp/base_page.e +++ b/examples/widgetapp/base_page.e @@ -10,15 +10,13 @@ deferred class inherit WSF_PAGE_CONTROL - redefine - control + redefine + control end feature initialize_controls - local - navbar: WSF_NAVBAR_CONTROL do create control.make_multi_control ("container") control.add_class ("container") @@ -37,4 +35,6 @@ feature control: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] + navbar: WSF_NAVBAR_CONTROL + end diff --git a/examples/widgetapp/image_slider_page.e b/examples/widgetapp/image_slider_page.e index 21af24b9..54f8c3df 100644 --- a/examples/widgetapp/image_slider_page.e +++ b/examples/widgetapp/image_slider_page.e @@ -24,6 +24,8 @@ feature -- Implementation Precursor create slider.make_slider ("myslider") slider.add_image ("http://www.placesmustseen.com/wp-content/uploads/2013/01/paris-eiffel-tower.jpg", "Eiffel Tower") + slider.add_image ("http://24.media.tumblr.com/0fcec9a7dde5b405a46b6fcda1ffad0c/tumblr_mtagkyYVIT1st5lhmo1_1280.jpg", "car") + slider.add_image ("http://25.media.tumblr.com/d9e791508eb9a532aa7f258fa4e0fedc/tumblr_mtag5zve3g1st5lhmo1_1280.jpg", "landscape") control.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h1", "", " Image Slider Demo")) control.add_control (slider) end diff --git a/examples/widgetapp/sample_page.e b/examples/widgetapp/sample_page.e index 33c056d8..dfde62d2 100644 --- a/examples/widgetapp/sample_page.e +++ b/examples/widgetapp/sample_page.e @@ -86,6 +86,7 @@ feature source.set_control (progress) progress.set_isolation (true) control.add_control (progress) + navbar.set_active (1) end handle_click2 From 26e6a62e6b8436ac1178f09e77006624f727f6fa Mon Sep 17 00:00:00 2001 From: Severin Date: Sun, 29 Sep 2013 02:24:33 +0200 Subject: [PATCH 2/3] Test --- contrib/library/text/parser/json/test/getest/ec_compile.sh | 0 tools/build_archive.sh | 0 tools/ise_wizard/install_ise_wizard.sh | 0 tools/ise_wizard/install_ise_wizard_custom.sh | 0 4 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 contrib/library/text/parser/json/test/getest/ec_compile.sh mode change 100755 => 100644 tools/build_archive.sh mode change 100755 => 100644 tools/ise_wizard/install_ise_wizard.sh mode change 100755 => 100644 tools/ise_wizard/install_ise_wizard_custom.sh diff --git a/contrib/library/text/parser/json/test/getest/ec_compile.sh b/contrib/library/text/parser/json/test/getest/ec_compile.sh old mode 100755 new mode 100644 diff --git a/tools/build_archive.sh b/tools/build_archive.sh old mode 100755 new mode 100644 diff --git a/tools/ise_wizard/install_ise_wizard.sh b/tools/ise_wizard/install_ise_wizard.sh old mode 100755 new mode 100644 diff --git a/tools/ise_wizard/install_ise_wizard_custom.sh b/tools/ise_wizard/install_ise_wizard_custom.sh old mode 100755 new mode 100644 From 61f032a819864a244573d0ecd96f991c928d48e1 Mon Sep 17 00:00:00 2001 From: severin Date: Tue, 29 Oct 2013 15:32:57 +0100 Subject: [PATCH 3/3] Fixed WSF_MULTI_CONTROL (wrong order of subcontrols), completed navbar, improved slider --- .../kernel/grid/wsf_repeater_control.e | 8 ++- .../kernel/navbar/wsf_navbar_control.e | 62 ++++++++++++++----- .../kernel/slider/wsf_image_slider_control.e | 25 ++++---- .../kernel/webcontrol/wsf_multi_control.e | 8 +-- examples/widgetapp/application.e | 2 +- examples/widgetapp/base_page.e | 4 +- examples/widgetapp/grid_page.e | 14 ++--- examples/widgetapp/image_slider_page.e | 8 ++- examples/widgetapp/repeater_page.e | 1 + 9 files changed, 84 insertions(+), 48 deletions(-) diff --git a/draft/library/wsf_js_widget/kernel/grid/wsf_repeater_control.e b/draft/library/wsf_js_widget/kernel/grid/wsf_repeater_control.e index 7aa6e61f..0ab198c9 100644 --- a/draft/library/wsf_js_widget/kernel/grid/wsf_repeater_control.e +++ b/draft/library/wsf_js_widget/kernel/grid/wsf_repeater_control.e @@ -19,13 +19,16 @@ inherit feature {NONE} -- Initialization make_repeater (n: STRING; a_datasource: WSF_DATASOURCE [G]) + local + p: WSF_PAGINATION_CONTROL [G] do make_multi_control (n) datasource := a_datasource datasource.set_on_update_agent (agent update) if attached {WSF_PAGABLE_DATASOURCE [G]} a_datasource as ds then - create pagination_control.make_paging (n + "_paging", ds) - add_control (pagination_control) + create p.make_paging (n + "_paging", ds) + add_control (p) + pagination_control := p end end @@ -53,7 +56,6 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management Result.put (datasource.state, "datasource") end - feature -- Rendering render_item (item: G): STRING diff --git a/draft/library/wsf_js_widget/kernel/navbar/wsf_navbar_control.e b/draft/library/wsf_js_widget/kernel/navbar/wsf_navbar_control.e index e26244b8..e8f35f75 100644 --- a/draft/library/wsf_js_widget/kernel/navbar/wsf_navbar_control.e +++ b/draft/library/wsf_js_widget/kernel/navbar/wsf_navbar_control.e @@ -23,10 +23,12 @@ feature {NONE} -- Initialization --Initialize do make_multi_control (n) + active_set := false add_class ("navbar navbar-inverse navbar-fixed-top") create nav.make_with_tag_name (control_name + "_nav", "ul") create nav_right.make_with_tag_name (control_name + "_nav_right", "ul") nav.add_class ("nav navbar-nav") + nav_right.add_class ("nav navbar-nav navbar-right") end make_navbar_with_brand (n, b: STRING) @@ -62,17 +64,43 @@ feature -- Rendering feature -- Change set_active (tab: INTEGER) + -- Sets the given tab as current active tab require - tab >= 0 and tab < nav.controls.count + nav_right.controls.count + tab >= 1 and tab <= tab_count and not active_set do - if tab < nav.controls.count then + if tab <= nav.controls.count then nav.controls.i_th (tab).add_class ("active") else nav_right.controls.i_th (tab - nav.controls.count).add_class ("active") end + active_set := true end - add_list_element_right (c: WSF_STATELESS_CONTROL) + add_dropdown (l: WSF_STATELESS_CONTROL; d: WSF_STATELESS_CONTROL) + -- Add dropdown menu (in li tag with class dropdown) to navbar + local + li: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] + do + create li.make_with_tag_name (control_name + "_link" + nav.controls.count.out, "li") + li.add_class ("dropdown") + li.add_control (l) + li.add_control (d) + add_element (li) + end + + add_dropdown_right (l: WSF_STATELESS_CONTROL; d: WSF_STATELESS_CONTROL) + -- Add dropdown menu (in li tag with class dropdown) to right aligned part of navbar + local + li: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] + do + create li.make_with_tag_name (control_name + "_link" + nav.controls.count.out, "li") + li.add_class ("dropdown") + li.add_control (l) + li.add_control (d) + add_element_right (li) + end + + add_list_element_right (l: WSF_STATELESS_CONTROL) -- Add element in li tag to right aligned part of navbar local name: STRING @@ -81,33 +109,24 @@ feature -- Change name := control_name + "_rightlink"; name := name + nav_right.controls.count.out create li.make_with_tag_name (name, "li") - li.add_control (c) + li.add_control (l) add_element_right (li) end - add_list_element (c: WSF_STATELESS_CONTROL) + add_list_element (l: WSF_STATELESS_CONTROL) -- Add element in li tag to main nav local li: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] do create li.make_with_tag_name (control_name + "_link" + nav.controls.count.out, "li") - li.add_control (c) + li.add_control (l) add_element (li) end add_element_right (c: WSF_STATELESS_CONTROL) -- Add element to right aligned part of navbar - local - right: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] do - if attached nav_right as r then - right := r - else - create right.make_with_tag_name (control_name + "_rightnav", "ul") - right.add_class ("nav navbar-nav navbar-right") - nav_right := right - end - right.add_control (c) + nav_right.add_control (c) end add_element (c: WSF_STATELESS_CONTROL) @@ -116,8 +135,19 @@ feature -- Change nav.add_control (c) end +feature -- Access + + tab_count: INTEGER + -- Current sum of the number of items in left and right navbar + do + Result := nav.controls.count + nav_right.controls.count + end + feature -- Properties + active_set: BOOLEAN + -- This flag is set once a tab has been set as active tab + brand: detachable STRING -- Optional brand of the navbar diff --git a/draft/library/wsf_js_widget/kernel/slider/wsf_image_slider_control.e b/draft/library/wsf_js_widget/kernel/slider/wsf_image_slider_control.e index 51607549..9eacd0d4 100644 --- a/draft/library/wsf_js_widget/kernel/slider/wsf_image_slider_control.e +++ b/draft/library/wsf_js_widget/kernel/slider/wsf_image_slider_control.e @@ -64,7 +64,7 @@ feature -- Change local caption_control: detachable WSF_STATELESS_CONTROL do - if attached caption as c then + if attached caption as c and then not c.is_empty then caption_control := create {WSF_BASIC_CONTROL}.make_with_body ("p", "", c) end add_image_with_caption_control (src, alt, caption_control) @@ -72,16 +72,8 @@ feature -- Change add_image_with_caption_control (src, alt: STRING; caption: detachable WSF_STATELESS_CONTROL) -- Add a new image to the slider, with specified url, alternative text and caption element - local - item: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] do - create item.make_multi_control (control_name + "_item" + slide_wrapper.controls.count.out) - item.add_class ("item") - item.add_control (create {WSF_BASIC_CONTROL}.make_with_body_class ("img", "src=%"" + src + "%" alt=%"" + alt + "%"", "", "")) - if attached caption as c then - item.add_control (c) - end - add_control (item) + add_control (create {WSF_BASIC_CONTROL}.make_with_body_class ("img", "src=%"" + src + "%" alt=%"" + alt + "%"", "", ""), Void) end add_image (src, alt: STRING) @@ -90,17 +82,24 @@ feature -- Change add_image_with_caption (src, alt, "") end - add_control (c: WSF_STATELESS_CONTROL) + add_control (c: WSF_STATELESS_CONTROL; caption: detachable WSF_STATELESS_CONTROL) -- Add a new control to the slider local cl: STRING + item: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] do + create item.make_multi_control (control_name + "_item" + slide_wrapper.controls.count.out) + item.add_class ("item") + item.add_control (c) + if attached caption as capt then + item.add_control (capt) + end cl := "" if slide_wrapper.controls.count = 0 then cl := "active" - c.add_class (cl) + item.add_class (cl) end - slide_wrapper.add_control (c) + slide_wrapper.add_control (item) list.add_control (create {WSF_BASIC_CONTROL}.make_with_body_class ("li", "data-target=%"#" + control_name + "%" data-slide-to=%"" + list.controls.count.out + "%"", cl, "")); end diff --git a/draft/library/wsf_js_widget/kernel/webcontrol/wsf_multi_control.e b/draft/library/wsf_js_widget/kernel/webcontrol/wsf_multi_control.e index 6c281c0b..003e9878 100644 --- a/draft/library/wsf_js_widget/kernel/webcontrol/wsf_multi_control.e +++ b/draft/library/wsf_js_widget/kernel/webcontrol/wsf_multi_control.e @@ -120,19 +120,17 @@ feature -- Rendering across controls as c loop - Result := c.item.render + Result + Result := Result + c.item.render end Result := render_tag (Result, "") end feature -- Change - add_control (c: detachable G) + add_control (c: G) -- Add a control to this multi control do - if attached c as d then - controls.put_front (d) - end + controls.extend (c) end feature -- Properties diff --git a/examples/widgetapp/application.e b/examples/widgetapp/application.e index 89808dc4..46c6b659 100644 --- a/examples/widgetapp/application.e +++ b/examples/widgetapp/application.e @@ -133,7 +133,7 @@ feature -- Execution slider_demo (request: WSF_REQUEST; response: WSF_RESPONSE) local - page: IMAGE_SLIDER_PAGE + page: SLIDER_PAGE do -- To send a response we need to setup, the status code and -- the response headers. diff --git a/examples/widgetapp/base_page.e b/examples/widgetapp/base_page.e index 957b231e..1ef57640 100644 --- a/examples/widgetapp/base_page.e +++ b/examples/widgetapp/base_page.e @@ -24,8 +24,8 @@ feature navbar.add_list_element (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/%"", "Home")) navbar.add_list_element (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/grid%"", "Grid")) navbar.add_list_element (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/repeater%"", "Repeater")) - navbar.add_list_element (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/slider%"", "Image Slider")) - navbar.add_list_element_right (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"#%"", "About")) + navbar.add_list_element (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/slider%"", "Slider")) + navbar.add_list_element_right (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/about%"", "About")) if not attached get_parameter ("ajax") then control.add_control (navbar) end diff --git a/examples/widgetapp/grid_page.e b/examples/widgetapp/grid_page.e index 95895d4a..d21396e1 100644 --- a/examples/widgetapp/grid_page.e +++ b/examples/widgetapp/grid_page.e @@ -10,9 +10,9 @@ class inherit BASE_PAGE - redefine - initialize_controls - end + redefine + initialize_controls + end create make @@ -22,16 +22,16 @@ feature initialize_controls do Precursor - control.add_control (create {WSF_BASIC_CONTROL}.make_with_body("h1","","Grid Demo")) + control.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h1", "", "Grid Demo")) create datasource.make_news create search_query.make_autocomplete ("query", create {GOOGLE_AUTOCOMPLETION}.make) search_query.add_class ("form-control") search_query.set_change_event (agent change_query) control.add_control (search_query) - control.add_control (create {WSF_BASIC_CONTROL}.make_with_body("h2","","Results")) - create grid.make_grid ("mygrid", <>, datasource) + control.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h2", "", "Results")) + create grid.make_grid ("mygrid", <>, datasource) control.add_control (grid) + navbar.set_active (2) end change_query diff --git a/examples/widgetapp/image_slider_page.e b/examples/widgetapp/image_slider_page.e index 54f8c3df..cb23c691 100644 --- a/examples/widgetapp/image_slider_page.e +++ b/examples/widgetapp/image_slider_page.e @@ -5,7 +5,7 @@ note revision: "$Revision$" class - IMAGE_SLIDER_PAGE + SLIDER_PAGE inherit @@ -20,14 +20,20 @@ create feature -- Implementation initialize_controls + local + form: WSF_FORM_CONTROL do Precursor create slider.make_slider ("myslider") + create form.make_form_control ("sliderform") + form.add_control (create {WSF_FORM_ELEMENT_CONTROL[STRING]}.make_form_element ("Input", create {WSF_INPUT_CONTROL}.make_input ("sliderformtext", "Test"))) + slider.add_control (form, Void) slider.add_image ("http://www.placesmustseen.com/wp-content/uploads/2013/01/paris-eiffel-tower.jpg", "Eiffel Tower") slider.add_image ("http://24.media.tumblr.com/0fcec9a7dde5b405a46b6fcda1ffad0c/tumblr_mtagkyYVIT1st5lhmo1_1280.jpg", "car") slider.add_image ("http://25.media.tumblr.com/d9e791508eb9a532aa7f258fa4e0fedc/tumblr_mtag5zve3g1st5lhmo1_1280.jpg", "landscape") control.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h1", "", " Image Slider Demo")) control.add_control (slider) + navbar.set_active (4) end process diff --git a/examples/widgetapp/repeater_page.e b/examples/widgetapp/repeater_page.e index 4c93959c..eba46107 100644 --- a/examples/widgetapp/repeater_page.e +++ b/examples/widgetapp/repeater_page.e @@ -31,6 +31,7 @@ feature control.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h2", "", "Results")) create repeater.make_repeater ("myrepeater", datasource) control.add_control (repeater) + navbar.set_active (3) end change_query