Merge branch 'widget' of github.com:souvarin/EWF into widget

This commit is contained in:
YNH Webdev
2013-09-24 15:20:43 +02:00
48 changed files with 204 additions and 123 deletions

View File

@@ -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

View File

@@ -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 navbar.make_navbar_with_brand ("Example")
create control.make_multi_control ("container")
control.add_class ("container")
create navbar.make_navbar_with_brand ("navbar1", "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

View File

@@ -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", <<create {WSF_GRID_COLUMN}.make ("Title", "title"),
create {WSF_GRID_COLUMN}.make ("Content", "content")>>, datasource)
container.add_control (grid)
control := container
control.add_control (grid)
end
change_query

View File

@@ -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_SLIDER_CONTROL
end

View File

@@ -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

View File

@@ -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

View File

@@ -13,7 +13,7 @@
<library name="http" location="..\..\library\network\protocol\http\http-safe.ecf"/>
<library name="http_client" location="$ISE_LIBRARY\contrib\library\network\http_client\http_client-safe.ecf"/>
<library name="wsf" location="..\..\library\server\wsf\wsf-safe.ecf"/>
<library name="wsf_js_widget" location="..\..\library\server\wsf_js_widget\wsf_js_widget-safe.ecf" readonly="false"/>
<library name="wsf_js_widget" location="..\..\draft\library\wsf_js_widget\wsf_js_widget-safe.ecf" readonly="false"/>
</target>
<target name="widgetapp_nino" extends="common">
<root class="APPLICATION" feature="make_and_launch"/>