Merge branch 'widget' of github.com:ynh/EWF into widget
This commit is contained in:
@@ -35,9 +35,11 @@ feature {NONE} -- Initialization
|
||||
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 ("/widget.js", agent load_js, Void)
|
||||
map_agent_uri ("/widget.css", agent load_css, Void)
|
||||
map_agent_uri ("/bootstrap.min.css", agent load_bootstrap, Void)
|
||||
map_agent_uri ("/widget.js", agent load_file("widget.js", ?, ?), Void)
|
||||
map_agent_uri ("/jquery.min.js", agent load_file("jquery.min.js", ?, ?), Void)
|
||||
map_agent_uri ("/typeahead.min.js", agent load_file("typeahead.min.js", ?, ?), Void)
|
||||
map_agent_uri ("/widget.css", agent load_file("widget.css", ?, ?), Void)
|
||||
map_agent_uri ("/bootstrap.min.css", agent load_file("bootstrap.min.css", ?, ?), Void)
|
||||
end
|
||||
|
||||
feature -- Helper: mapping
|
||||
@@ -79,27 +81,11 @@ feature -- Execution
|
||||
page.execute
|
||||
end
|
||||
|
||||
load_js (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
load_file (name: STRING; req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
local
|
||||
f: WSF_FILE_RESPONSE
|
||||
do
|
||||
create f.make_html ("widget.js")
|
||||
res.send (f)
|
||||
end
|
||||
|
||||
load_css (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
local
|
||||
f: WSF_FILE_RESPONSE
|
||||
do
|
||||
create f.make_html ("widget.css")
|
||||
res.send (f)
|
||||
end
|
||||
|
||||
load_bootstrap (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
local
|
||||
f: WSF_FILE_RESPONSE
|
||||
do
|
||||
create f.make_html ("bootstrap.min.css")
|
||||
create f.make_html (name)
|
||||
res.send (f)
|
||||
end
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
5
examples/widgetapp/jquery.min.js
vendored
Normal file
5
examples/widgetapp/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -27,7 +27,6 @@ feature
|
||||
n4_container: WSF_FORM_ELEMENT_CONTROL [STRING]
|
||||
n5_container: WSF_FORM_ELEMENT_CONTROL [STRING]
|
||||
cats_container: WSF_FORM_ELEMENT_CONTROL [LIST [STRING]]
|
||||
s: FLAG_AUTOCOMPLETION
|
||||
do
|
||||
Precursor
|
||||
create form.make_form_control ("panel")
|
||||
@@ -44,8 +43,7 @@ feature
|
||||
n2_container.add_validator (create {WSF_DECIMAL_VALIDATOR}.make_decimal_validator ("Invalid Number"))
|
||||
form.add_control (n2_container)
|
||||
--Flag autocomplete
|
||||
create s.make (<<["dz", "Algeria"], ["be", "Belgium"], ["ca", "Canada"], ["de", "Deutschland"], ["england", "England"], ["fi", "Finland"], ["gr", "Greece"], ["hu", "Hungary"]>>)
|
||||
create autocompletion1.make_autocomplete ("autocompletion1", s)
|
||||
create autocompletion1.make_autocomplete ("autocompletion1", create {FLAG_AUTOCOMPLETION}.make)
|
||||
create n3_container.make_form_element ("Flag Autocomplete", autocompletion1)
|
||||
form.add_control (n3_container)
|
||||
--Contact autocomplete
|
||||
|
||||
7
examples/widgetapp/typeahead.min.js
vendored
Normal file
7
examples/widgetapp/typeahead.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -61,7 +61,7 @@ feature
|
||||
control.handle_callback (control_name, event, event_parameter)
|
||||
create states_changes.make
|
||||
control.read_state_changes (states_changes)
|
||||
response.put_header ({HTTP_STATUS_CODE}.ok, <<["Content-Type", "application/json"]>>)
|
||||
response.put_header ({HTTP_STATUS_CODE}.ok, <<["Content-Type", "application/json; charset=ISO-8859-1"]>>)
|
||||
response.put_string (states_changes.representation)
|
||||
else
|
||||
process
|
||||
@@ -86,12 +86,12 @@ feature
|
||||
control.read_state (states)
|
||||
data.append (states.representation)
|
||||
data.append (";</script>")
|
||||
data.append ("<script src=%"//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js%"></script>")
|
||||
data.append ("<script src=%"//cdnjs.cloudflare.com/ajax/libs/typeahead.js/0.9.3/typeahead.min.js%"></script>")
|
||||
data.append ("<script src=%"/jquery.min.js%"></script>")
|
||||
data.append ("<script src=%"/typeahead.min.js%"></script>")
|
||||
data.append ("<script src=%"/widget.js%"></script>")
|
||||
data.append ("</body></html>")
|
||||
create page.make
|
||||
page.put_header ({HTTP_STATUS_CODE}.ok, <<["Content-Type", "text/html"]>>)
|
||||
page.put_header ({HTTP_STATUS_CODE}.ok, <<["Content-Type", "text/html; charset=ISO-8859-1"]>>)
|
||||
page.set_body (data)
|
||||
response.send (page)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user