diff --git a/examples/widgetapp/application.e b/examples/widgetapp/application.e index 6eab7d56..89808dc4 100644 --- a/examples/widgetapp/application.e +++ b/examples/widgetapp/application.e @@ -57,7 +57,6 @@ feature -- Router and Filter create {WSF_LOGGING_FILTER} f f.set_next (l_filter) l_filter := f - filter := l_filter end @@ -78,10 +77,10 @@ feature -- Router and Filter setup_router do - -- router.map (create {WSF_URI_MAPPING}.make ("/hello", create {WSF_AGENT_URI_HANDLER}.make (agent execute_hello))) map_agent_uri ("/", agent execute_hello, Void) map_agent_uri ("/grid", agent grid_demo, Void) map_agent_uri ("/repeater", agent repeater_demo, Void) + map_agent_uri ("/slider", agent slider_demo, Void) -- NOTE: you could put all those files in a specific folder, and use WSF_FILE_SYSTEM_HANDLER with "/" -- this way, it handles the caching and so on @@ -102,7 +101,7 @@ feature -- Helper: mapping feature -- Execution - execute_hello (request: WSF_REQUEST; response: WSF_RESPONSE) + execute_hello (request: WSF_REQUEST; response: WSF_RESPONSE) local page: SAMPLE_PAGE do @@ -132,6 +131,16 @@ feature -- Execution page.execute end + slider_demo (request: WSF_REQUEST; response: WSF_RESPONSE) + local + page: IMAGE_SLIDER_PAGE + do + -- To send a response we need to setup, the status code and + -- the response headers. + create page.make (request, response) + page.execute + end + load_file (name: STRING; request: WSF_REQUEST; response: WSF_RESPONSE) local f: WSF_FILE_RESPONSE diff --git a/examples/widgetapp/base_page.e b/examples/widgetapp/base_page.e index 262bee7a..001c3b31 100644 --- a/examples/widgetapp/base_page.e +++ b/examples/widgetapp/base_page.e @@ -10,6 +10,9 @@ deferred class inherit WSF_PAGE_CONTROL + redefine + control + end feature @@ -17,21 +20,21 @@ feature local navbar: WSF_NAVBAR_CONTROL do - create container.make_multi_control ("container") - container.add_class ("container") + create control.make_multi_control ("container") + control.add_class ("container") create navbar.make_navbar_with_brand ("Example") 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")) if not attached get_parameter ("ajax") then - container.add_control (navbar) + control.add_control (navbar) end - control := container end feature - container: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] + control: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] end diff --git a/examples/widgetapp/grid_page.e b/examples/widgetapp/grid_page.e index 5b7dc318..95895d4a 100644 --- a/examples/widgetapp/grid_page.e +++ b/examples/widgetapp/grid_page.e @@ -22,17 +22,16 @@ feature initialize_controls do Precursor - container.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) - container.add_control (search_query) - container.add_control (create {WSF_BASIC_CONTROL}.make_with_body("h2","","Results")) + control.add_control (search_query) + control.add_control (create {WSF_BASIC_CONTROL}.make_with_body("h2","","Results")) create grid.make_grid ("mygrid", <>, datasource) - container.add_control (grid) - control := container + control.add_control (grid) end change_query diff --git a/examples/widgetapp/image_slider_page.e b/examples/widgetapp/image_slider_page.e new file mode 100644 index 00000000..4f456bfe --- /dev/null +++ b/examples/widgetapp/image_slider_page.e @@ -0,0 +1,39 @@ +note + description: "Summary description for {IMAGE_SLIDER_PAGE}." + author: "" + date: "$Date$" + revision: "$Revision$" + +class + IMAGE_SLIDER_PAGE + +inherit + + BASE_PAGE + redefine + initialize_controls + end + +create + make + +feature -- Implementation + + initialize_controls + do + Precursor + create slider.make_slider ("myslider") + slider.add_image ("http://www.placesmustseen.com/wp-content/uploads/2013/01/paris-eiffel-tower.jpg", "Eiffel Tower") + control.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h1", "", " Image Slider Demo")) + control.add_control (slider) + end + + process + do + end + +feature -- Properties + + slider: WSF_IMAGE_SLIDER_CONTROL + +end diff --git a/examples/widgetapp/repeater_page.e b/examples/widgetapp/repeater_page.e index d76a1592..4c93959c 100644 --- a/examples/widgetapp/repeater_page.e +++ b/examples/widgetapp/repeater_page.e @@ -8,6 +8,7 @@ class REPEATER_PAGE inherit + BASE_PAGE redefine initialize_controls @@ -21,15 +22,15 @@ feature initialize_controls do Precursor - container.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h1", ""," Repeater Demo")) + control.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h1", "", " Repeater 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) - container.add_control (search_query) - container.add_control (create {WSF_BASIC_CONTROL}.make_with_body("h2", "", "Results")) + control.add_control (search_query) + control.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h2", "", "Results")) create repeater.make_repeater ("myrepeater", datasource) - container.add_control (repeater) + control.add_control (repeater) end change_query @@ -50,4 +51,3 @@ feature datasource: GOOGLE_NEWS_DATASOURCE end - diff --git a/examples/widgetapp/sample_page.e b/examples/widgetapp/sample_page.e index d1fbf6e9..da18fab0 100644 --- a/examples/widgetapp/sample_page.e +++ b/examples/widgetapp/sample_page.e @@ -77,15 +77,15 @@ feature --Result create result_html.make_html ("txtBox3", "p", "") form.add_control (create {WSF_FORM_ELEMENT_CONTROL [STRING]}.make_form_element ("Result", result_html)) - container.add_control (form) + control.add_control (form) --Progress bar - container.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h4", "", "Autoincrementing progressbar")) + control.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h4", "", "Autoincrementing progressbar")) create source.make create progress.make_progress_with_source ("progress1", source) source.set_control (progress) progress.set_isolation (true) - container.add_control (progress) + control.add_control (progress) end handle_click2 diff --git a/library/server/wsf_js_widget/webcontrol/wsf_page_control.e b/library/server/wsf_js_widget/webcontrol/wsf_page_control.e index b38b0d64..31d5d769 100644 --- a/library/server/wsf_js_widget/webcontrol/wsf_page_control.e +++ b/library/server/wsf_js_widget/webcontrol/wsf_page_control.e @@ -145,7 +145,7 @@ feature -- Implementation end end -feature -- EVENT HANDLING +feature -- Event handling handle_callback (cname: STRING; event: STRING; event_parameter: detachable STRING) -- Forward callback to control @@ -153,7 +153,7 @@ feature -- EVENT HANDLING control.handle_callback (cname, event, event_parameter) end -feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT +feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management state: JSON_OBJECT do diff --git a/library/server/wsf_js_widget/image_slider/wsf_image_slider_control.e b/library/server/wsf_js_widget/wsf_image_slider_control.e similarity index 92% rename from library/server/wsf_js_widget/image_slider/wsf_image_slider_control.e rename to library/server/wsf_js_widget/wsf_image_slider_control.e index f200e258..c8d99362 100644 --- a/library/server/wsf_js_widget/image_slider/wsf_image_slider_control.e +++ b/library/server/wsf_js_widget/wsf_image_slider_control.e @@ -63,7 +63,7 @@ feature -- Change add_image_with_caption (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 + item: WSF_STATELESS_MULTI_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 @@ -77,17 +77,17 @@ feature -- Change add_image (src, alt: STRING) -- Add a new image to the slider, with specified url and alternative text local - item: WSF_MULTI_CONTROL[WSF_STATELESS_CONTROL] + item: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] do add_image_with_caption (src, alt, Void) end feature -- Properties - list: WSF_MULTI_CONTROL[WSF_STATELESS_CONTROL] + list: WSF_STATELESS_MULTI_CONTROL -- List of slider links - slide_wrapper: WSF_MULTI_CONTROL[WSF_STATELESS_CONTROL] + slide_wrapper: WSF_STATELESS_MULTI_CONTROL -- List of the single image slides end diff --git a/library/server/wsf_js_widget/wsf_js_widget-safe.ecf b/library/server/wsf_js_widget/wsf_js_widget-safe.ecf index 037a9b78..901f9d88 100644 --- a/library/server/wsf_js_widget/wsf_js_widget-safe.ecf +++ b/library/server/wsf_js_widget/wsf_js_widget-safe.ecf @@ -16,12 +16,13 @@ - - - - + + + + +