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

This commit is contained in:
severin
2014-03-05 15:57:24 +01:00
41 changed files with 201 additions and 234 deletions

View File

@@ -9,12 +9,12 @@ deferred class
feature -- Access feature -- Access
autocompletion (input: STRING): JSON_ARRAY autocompletion (input: STRING_32): JSON_ARRAY
-- JSON array of suggestions that fit the specific input -- JSON array of suggestions that fit the specific input
deferred deferred
end end
template: detachable STRING template: detachable STRING_32
-- Customizable template -- Customizable template
end end

View File

@@ -16,7 +16,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (l: ITERABLE [STRING]) make (l: ITERABLE [STRING_32])
-- Initialize -- Initialize
do do
list := l list := l
@@ -24,7 +24,7 @@ feature {NONE} -- Initialization
feature -- Implementation feature -- Implementation
autocompletion (input: STRING): JSON_ARRAY autocompletion (input: STRING_32): JSON_ARRAY
-- Implementation -- Implementation
local local
o: WSF_JSON_OBJECT o: WSF_JSON_OBJECT
@@ -41,7 +41,7 @@ feature -- Implementation
end end
end end
list: ITERABLE [STRING] list: ITERABLE [STRING_32]
-- List containing suggestions -- List containing suggestions
end end

View File

@@ -23,13 +23,13 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (title: STRING) make (title: STRING_32)
-- Make a dropdown control with div tag name and specified menu title -- Make a dropdown control with div tag name and specified menu title
do do
make_with_tag_name (title, "div") make_with_tag_name (title, "div")
end end
make_with_tag_name (title, t: STRING) make_with_tag_name (title, t: STRING_32)
-- Make a dropdown control with specified tag name (such as li) and menu title -- Make a dropdown control with specified tag name (such as li) and menu title
do do
make_multi_control_with_tag_name (t) make_multi_control_with_tag_name (t)
@@ -55,7 +55,7 @@ feature -- Change
dropdown_menu.add_control (li) dropdown_menu.add_control (li)
end end
add_link_item (label, link: STRING) add_link_item (label, link: STRING_32)
local local
c: WSF_BASIC_CONTROL c: WSF_BASIC_CONTROL
do do

View File

@@ -12,7 +12,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (a_header, a_field: STRING) make (a_header, a_field: STRING_32)
do do
header := a_header header := a_header
field_name := a_field field_name := a_field
@@ -21,7 +21,7 @@ feature {NONE} -- Initialization
feature -- Render feature -- Render
render_column (e: WSF_ENTITY): STRING render_column (e: WSF_ENTITY): STRING_32
-- Return the rendered column cell for a specific entity (row) -- Return the rendered column cell for a specific entity (row)
do do
if attached e.item (field_name) as data then if attached e.item (field_name) as data then
@@ -33,12 +33,12 @@ feature -- Render
feature -- Properties feature -- Properties
header: STRING header: STRING_32
sortable: BOOLEAN sortable: BOOLEAN
sorting_name: STRING sorting_name: STRING_32
field_name: STRING field_name: STRING_32
end end

View File

@@ -29,7 +29,7 @@ feature {NONE} -- Initialization
feature -- Render feature -- Render
render_item (item: G): STRING render_item (item: G): STRING_32
-- Render table row -- Render table row
do do
Result := "" Result := ""
@@ -41,7 +41,7 @@ feature -- Render
Result := render_tag_with_tagname ("tr", Result, "", "") Result := render_tag_with_tagname ("tr", Result, "", "")
end end
render_header: STRING render_header: STRING_32
-- Render table header -- Render table header
do do
Result := "" Result := ""
@@ -53,10 +53,10 @@ feature -- Render
Result := render_tag_with_tagname ("thead", render_tag_with_tagname ("tr", Result, "", ""), "", "") Result := render_tag_with_tagname ("thead", render_tag_with_tagname ("tr", Result, "", ""), "", "")
end end
render: STRING render: STRING_32
-- Render entre table and subcontrols -- Render entre table and subcontrols
local local
table: STRING table: STRING_32
do do
table := render_tag_with_tagname ("table", render_header + render_tag_with_tagname ("tbody", render_body, "", ""), "", "table table-striped") table := render_tag_with_tagname ("table", render_header + render_tag_with_tagname ("tbody", render_body, "", ""), "", "table table-striped")
Result := "" Result := ""

View File

@@ -21,14 +21,14 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (a_header, a_field: STRING) make (a_header, a_field: STRING_32)
do do
make_column (a_header, a_field) make_column (a_header, a_field)
end end
feature -- Render feature -- Render
render_column (e: WSF_ENTITY): STRING render_column (e: WSF_ENTITY): STRING_32
-- Return the rendered column image cell for a specific entity (row) -- Return the rendered column image cell for a specific entity (row)
do do
if attached e.item (field_name) as data then if attached e.item (field_name) as data then

View File

@@ -48,7 +48,7 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
feature --Event handling feature --Event handling
handle_callback (cname: LIST[STRING]; event: STRING; event_parameter: detachable ANY) handle_callback (cname: LIST[STRING_32]; event: STRING_32; event_parameter: detachable ANY)
-- Handle goto/next/prev events -- Handle goto/next/prev events
do do
if Current.control_name.same_string (cname[1]) then if Current.control_name.same_string (cname[1]) then
@@ -57,7 +57,7 @@ feature --Event handling
elseif event.same_string ("prev") then elseif event.same_string ("prev") then
datasource.set_page (datasource.page - 1) datasource.set_page (datasource.page - 1)
elseif event.same_string ("goto") then elseif event.same_string ("goto") then
if attached {STRING}event_parameter as p and then attached p.to_integer as i then if attached {STRING_32}event_parameter as p and then attached p.to_integer as i then
datasource.set_page (i) datasource.set_page (i)
end end
end end
@@ -67,12 +67,12 @@ feature --Event handling
feature -- Render feature -- Render
render: STRING render: STRING_32
-- Render paging control -- Render paging control
local local
paging_start: INTEGER paging_start: INTEGER
paging_end: INTEGER paging_end: INTEGER
cssclass: STRING cssclass: STRING_32
do do
Result := render_tag_with_tagname ("li", render_tag_with_tagname ("a", "«", "href=%"#%" data-nr=%"prev%"", ""), "", "") Result := render_tag_with_tagname ("li", render_tag_with_tagname ("a", "«", "href=%"#%" data-nr=%"prev%"", ""), "", "")
paging_start := (datasource.page - 4).max (1) paging_start := (datasource.page - 4).max (1)

View File

@@ -60,12 +60,12 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
feature -- Rendering feature -- Rendering
render_item (item: G): STRING render_item (item: G): STRING_32
--Render item --Render item
deferred deferred
end end
render_body: STRING render_body: STRING_32
--Render Body --Render Body
do do
Result := "" Result := ""
@@ -76,10 +76,10 @@ feature -- Rendering
end end
end end
render: STRING render: STRING_32
--Render repeater inclusive paging if paging is available --Render repeater inclusive paging if paging is available
local local
content: STRING content: STRING_32
do do
content := render_tag_with_tagname ("div", render_body, "", "repeater_content") content := render_tag_with_tagname ("div", render_body, "", "repeater_content")
Result := "" Result := ""

View File

@@ -31,7 +31,7 @@ feature {NONE} -- Initialization
end end
end end
make_with_agent (c: FUNCTION [ANY, TUPLE [STRING], JSON_ARRAY]) make_with_agent (c: FUNCTION [ANY, TUPLE [STRING_32], JSON_ARRAY])
-- Initialize with specified name and autocompletion function -- Initialize with specified name and autocompletion function
do do
make_input ( "") make_input ( "")
@@ -49,7 +49,7 @@ feature -- State
feature -- Callback feature -- Callback
handle_callback (cname: LIST[STRING]; event: STRING; event_parameter: detachable ANY) handle_callback (cname: LIST[STRING_32]; event: STRING_32; event_parameter: detachable ANY)
do do
Precursor {WSF_INPUT_CONTROL} (cname, event, event_parameter) Precursor {WSF_INPUT_CONTROL} (cname, event, event_parameter)
if cname[1].same_string (control_name) and event.same_string ("autocomplete") then if cname[1].same_string (control_name) and event.same_string ("autocomplete") then
@@ -59,8 +59,8 @@ feature -- Callback
feature -- Properties feature -- Properties
create_json_list: FUNCTION [ANY, TUPLE [STRING], JSON_ARRAY] create_json_list: FUNCTION [ANY, TUPLE [STRING_32], JSON_ARRAY]
template: STRING template: STRING_32
end end

View File

@@ -19,7 +19,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (l, c: STRING) make (l, c: STRING_32)
-- Initialize with specified control name, -- Initialize with specified control name,
do do
make_value_control ("input") make_value_control ("input")
@@ -54,7 +54,7 @@ feature --Event handling
change_event := e change_event := e
end end
handle_callback (cname: LIST [STRING]; event: STRING; event_parameter: detachable ANY) handle_callback (cname: LIST [STRING_32]; event: STRING_32; event_parameter: detachable ANY)
do do
if Current.control_name.same_string (cname [1]) and attached change_event as cevent then if Current.control_name.same_string (cname [1]) and attached change_event as cevent then
if event.same_string ("change") then if event.same_string ("change") then
@@ -65,9 +65,9 @@ feature --Event handling
feature -- Implementation feature -- Implementation
render: STRING render: STRING_32
local local
attrs: STRING attrs: STRING_32
do do
attrs := "type=%"checkbox%"" attrs := "type=%"checkbox%""
if checked then if checked then
@@ -88,13 +88,13 @@ feature -- Implementation
feature -- Properties feature -- Properties
label: STRING label: STRING_32
-- The label of the checkbox control -- The label of the checkbox control
checked: BOOLEAN checked: BOOLEAN
-- The checked value of the checkbox control -- The checked value of the checkbox control
checked_value: STRING checked_value: STRING_32
-- String checked value -- String checked value
change_event: detachable PROCEDURE [ANY, TUPLE] change_event: detachable PROCEDURE [ANY, TUPLE]

View File

@@ -9,7 +9,7 @@ class
inherit inherit
WSF_VALUE_CONTROL [LIST [STRING]] WSF_VALUE_CONTROL [LIST [STRING_32]]
rename rename
make as make_control make as make_control
undefine undefine
@@ -36,9 +36,9 @@ feature {NONE} -- Initializaton
feature -- Implementation feature -- Implementation
value: LIST [STRING] value: LIST [STRING_32]
do do
create {ARRAYED_LIST [STRING]} Result.make (0) create {ARRAYED_LIST [STRING_32]} Result.make (0)
across across
controls as c controls as c
loop loop
@@ -48,7 +48,7 @@ feature -- Implementation
end end
end end
set_value (v: LIST [STRING]) set_value (v: LIST [STRING_32])
do do
across across
controls as c controls as c

View File

@@ -1,49 +0,0 @@
note
description: "Summary description for {WSF_FILE}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
WSF_FILE
create
make
feature {NONE}
make (a_name, a_type: STRING; a_size: INTEGER; a_id: detachable STRING)
do
name := a_name
type := a_type
size := a_size
id := a_id
end
feature
set_id (a_id: detachable STRING)
do
id := a_id
end
feature --Properties
is_uploaded: BOOLEAN
do
Result := attached id
end
name: STRING
-- File name
type: STRING
-- File mime type
size: INTEGER
-- File size
id: detachable STRING
-- Server side file id (e.g. S3 filename)
end

View File

@@ -9,7 +9,7 @@ class
inherit inherit
WSF_VALUE_CONTROL [detachable WSF_FILE] WSF_VALUE_CONTROL [detachable WSF_FILE_DEFINITION]
rename rename
make as make_value_control make as make_value_control
end end
@@ -35,7 +35,7 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
set_state (new_state: JSON_OBJECT) set_state (new_state: JSON_OBJECT)
-- Restore text from json -- Restore text from json
local local
id: detachable STRING id: detachable STRING_32
do do
if attached {JSON_STRING} new_state.item ("file_name") as new_name and attached {JSON_STRING} new_state.item ("file_type") as new_type and attached {JSON_NUMBER} new_state.item ("file_size") as new_size then if attached {JSON_STRING} new_state.item ("file_name") as new_name and attached {JSON_STRING} new_state.item ("file_type") as new_type and attached {JSON_NUMBER} new_state.item ("file_size") as new_size then
if attached {JSON_STRING} new_state.item ("file_id") as a_id then if attached {JSON_STRING} new_state.item ("file_id") as a_id then
@@ -69,12 +69,12 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
feature -- Event handling feature -- Event handling
handle_callback (cname: LIST [STRING]; event: STRING; event_parameter: detachable ANY) handle_callback (cname: LIST [STRING_32]; event: STRING_32; event_parameter: detachable ANY)
local local
f_name: detachable STRING f_name: detachable STRING_32
f_type: detachable STRING f_type: detachable STRING_32
f_size: detachable INTEGER f_size: detachable INTEGER
f_id: detachable STRING f_id: detachable STRING_32
do do
if Current.control_name.same_string (cname [1]) then if Current.control_name.same_string (cname [1]) then
if attached change_event as cevent and event.same_string ("change") then if attached change_event as cevent and event.same_string ("change") then
@@ -112,14 +112,14 @@ feature -- Upload
feature -- Implementation feature -- Implementation
value: detachable WSF_FILE value: detachable WSF_FILE_DEFINITION
do do
Result := file Result := file
end end
render: STRING render: STRING_32
local local
attr: STRING attr: STRING_32
do do
attr := "type=%"file%" " attr := "type=%"file%" "
if attached attributes as a then if attached attributes as a then
@@ -159,7 +159,7 @@ feature -- Change
end end
end end
set_value (v: detachable WSF_FILE) set_value (v: detachable WSF_FILE_DEFINITION)
do do
file := v file := v
end end
@@ -180,7 +180,7 @@ feature -- Properties
image_preview: BOOLEAN image_preview: BOOLEAN
-- Preview uploaded image -- Preview uploaded image
file: detachable WSF_FILE file: detachable WSF_FILE_DEFINITION
-- Text to be displayed -- Text to be displayed
change_event: detachable PROCEDURE [ANY, TUPLE] change_event: detachable PROCEDURE [ANY, TUPLE]
@@ -189,7 +189,7 @@ feature -- Properties
upload_done_event: detachable PROCEDURE [ANY, TUPLE] upload_done_event: detachable PROCEDURE [ANY, TUPLE]
-- Procedure to be execued when upload was successful -- Procedure to be execued when upload was successful
upload_function: detachable FUNCTION [ANY, TUPLE [ITERABLE [WSF_UPLOADED_FILE]], detachable STRING] upload_function: detachable FUNCTION [ANY, TUPLE [ITERABLE [WSF_UPLOADED_FILE]], detachable STRING_32]
-- Store uploaded file and return server side file id -- Store uploaded file and return server side file id
end end

View File

@@ -9,7 +9,7 @@ class
inherit inherit
WSF_VALUE_CONTROL [STRING] WSF_VALUE_CONTROL [STRING_32]
rename rename
make as make_value_control make as make_value_control
end end
@@ -19,7 +19,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (v: STRING) make (v: STRING_32)
-- Initialize with specified value -- Initialize with specified value
do do
make_value_control ("input") make_value_control ("input")
@@ -54,7 +54,7 @@ feature --Event handling
change_event := e change_event := e
end end
handle_callback (cname: LIST [STRING]; event: STRING; event_parameter: detachable ANY) handle_callback (cname: LIST [STRING_32]; event: STRING_32; event_parameter: detachable ANY)
do do
if Current.control_name.same_string (cname [1]) and attached change_event as cevent then if Current.control_name.same_string (cname [1]) and attached change_event as cevent then
if event.same_string ("change") then if event.same_string ("change") then
@@ -65,9 +65,9 @@ feature --Event handling
feature -- Rendering feature -- Rendering
render: STRING render: STRING_32
local local
attr: STRING attr: STRING_32
do do
attr := "type=%"" + type + "%" value=%"" + text + "%" " attr := "type=%"" + type + "%" value=%"" + text + "%" "
if attached attributes as a then if attached attributes as a then
@@ -81,7 +81,7 @@ feature -- Rendering
feature -- Change feature -- Change
set_text (t: STRING) set_text (t: STRING_32)
-- Set text to be displayed -- Set text to be displayed
do do
if not t.same_string (text) then if not t.same_string (text) then
@@ -98,19 +98,19 @@ feature -- Change
end end
end end
set_type (t: STRING) set_type (t: STRING_32)
do do
type := t type := t
end end
feature -- Implementation feature -- Implementation
value: STRING value: STRING_32
do do
Result := text Result := text
end end
set_value (v: STRING) set_value (v: STRING_32)
do do
text := v text := v
end end
@@ -120,10 +120,10 @@ feature -- Properties
disabled: BOOLEAN disabled: BOOLEAN
-- Defines if the input field is editable -- Defines if the input field is editable
text: STRING text: STRING_32
-- Text to be displayed -- Text to be displayed
type: STRING type: STRING_32
-- Type of this input control -- Type of this input control
change_event: detachable PROCEDURE [ANY, TUPLE] change_event: detachable PROCEDURE [ANY, TUPLE]

View File

@@ -19,7 +19,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (v: STRING) make (v: STRING_32)
-- Initialize with specified control name and text -- Initialize with specified control name and text
do do
make_input (v) make_input (v)

View File

@@ -21,7 +21,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (t: STRING) make (t: STRING_32)
-- Initialize with specified control name and text to be displayed in this textarea -- Initialize with specified control name and text to be displayed in this textarea
do do
make_input (t) make_input (t)
@@ -30,7 +30,7 @@ feature {NONE} -- Initialization
feature -- Rendering feature -- Rendering
render: STRING render: STRING_32
do do
Result := render_tag (text, "") Result := render_tag (text, "")
end end

View File

@@ -39,7 +39,7 @@ feature {NONE} -- Initialization
nav_right.add_class ("nav navbar-nav navbar-right") nav_right.add_class ("nav navbar-nav navbar-right")
end end
make_with_brand (b: STRING) make_with_brand (b: STRING_32)
-- Initialize with specified brand string -- Initialize with specified brand string
do do
make make
@@ -48,10 +48,10 @@ feature {NONE} -- Initialization
feature -- Rendering feature -- Rendering
render: STRING render: STRING_32
local local
temp: STRING temp: STRING_32
nav_string: STRING nav_string: STRING_32
do do
temp := render_tag_with_tagname ("span", "", "", "icon-bar") temp := render_tag_with_tagname ("span", "", "", "icon-bar")
temp.multiply (3) temp.multiply (3)
@@ -129,7 +129,7 @@ feature -- Properties
active_set: BOOLEAN active_set: BOOLEAN
-- This flag is set once a tab has been set as active tab -- This flag is set once a tab has been set as active tab
brand: detachable STRING brand: detachable STRING_32
-- Optional brand of the navbar -- Optional brand of the navbar
nav: WSF_STATELESS_MULTI_CONTROL [WSF_STATELESS_CONTROL] nav: WSF_STATELESS_MULTI_CONTROL [WSF_STATELESS_CONTROL]

View File

@@ -30,7 +30,7 @@ feature {NONE} -- Initialization
feature -- Change feature -- Change
add_link (link, text: STRING) add_link (link, text: STRING_32)
-- Add a link to nav list -- Add a link to nav list
local local
c: WSF_NAVLIST_ITEM_CONTROL c: WSF_NAVLIST_ITEM_CONTROL
@@ -39,7 +39,7 @@ feature -- Change
add_control (c) add_control (c)
end end
add_button (event: attached like {WSF_BUTTON_CONTROL}.click_event; text: STRING) add_button (event: attached like {WSF_BUTTON_CONTROL}.click_event; text: STRING_32)
-- Add a button control to navlist -- Add a button control to navlist
local local
c: WSF_NAVLIST_ITEM_CONTROL c: WSF_NAVLIST_ITEM_CONTROL

View File

@@ -24,7 +24,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (link, t: STRING) make (link, t: STRING_32)
do do
make_control ("a") make_control ("a")
text := t text := t

View File

@@ -55,7 +55,7 @@ feature -- State handling
feature -- Event handling feature -- Event handling
handle_callback (cname: LIST[STRING]; event: STRING; event_parameter: detachable ANY) handle_callback (cname: LIST[STRING_32]; event: STRING_32; event_parameter: detachable ANY)
do do
if cname[1].same_string (control_name) and event.same_string ("progress_fetch") then if cname[1].same_string (control_name) and event.same_string ("progress_fetch") then
state_changes.put_integer (progress_value, "progress") state_changes.put_integer (progress_value, "progress")
@@ -64,9 +64,9 @@ feature -- Event handling
feature -- Rendering feature -- Rendering
render: STRING render: STRING_32
local local
p: STRING p: STRING_32
do do
p := progress_value.out p := progress_value.out
Result := render_tag_with_tagname ("div", "", "role=%"progressbar%" aria-valuenow=%"" + p + "%" aria-valuemin=%"0%" aria-valuemax=%"100%" style=%"width: " + p + "%%;%"", "progress-bar") Result := render_tag_with_tagname ("div", "", "role=%"progressbar%" aria-valuenow=%"" + p + "%" aria-valuemin=%"0%" aria-valuemax=%"100%" style=%"width: " + p + "%%;%"", "progress-bar")

View File

@@ -43,16 +43,16 @@ feature -- State handling
feature -- Callback feature -- Callback
handle_callback (cname: LIST[STRING]; event: STRING; event_parameter: detachable ANY) handle_callback (cname: LIST[STRING_32]; event: STRING_32; event_parameter: detachable ANY)
do do
-- Do nothing here -- Do nothing here
end end
feature -- Rendering feature -- Rendering
render: STRING render: STRING_32
local local
temp: STRING temp: STRING_32
do do
temp := list.render temp := list.render
temp.append (slide_wrapper.render) temp.append (slide_wrapper.render)
@@ -63,7 +63,7 @@ feature -- Rendering
feature -- Change feature -- Change
add_image_with_caption (src, alt, caption: STRING) add_image_with_caption (src, alt, caption: STRING_32)
local local
caption_control: detachable WSF_STATELESS_CONTROL caption_control: detachable WSF_STATELESS_CONTROL
do do
@@ -73,13 +73,13 @@ feature -- Change
add_image_with_caption_control (src, alt, caption_control) add_image_with_caption_control (src, alt, caption_control)
end end
add_image_with_caption_control (src, alt: STRING; caption: detachable WSF_STATELESS_CONTROL) add_image_with_caption_control (src, alt: STRING_32; caption: detachable WSF_STATELESS_CONTROL)
-- Add a new image to the slider, with specified url, alternative text and caption element -- Add a new image to the slider, with specified url, alternative text and caption element
do do
add_control (create {WSF_BASIC_CONTROL}.make_with_body_class ("img", "src=%"" + src + "%" alt=%"" + alt + "%"", "", ""), Void) add_control (create {WSF_BASIC_CONTROL}.make_with_body_class ("img", "src=%"" + src + "%" alt=%"" + alt + "%"", "", ""), Void)
end end
add_image (src, alt: STRING) add_image (src, alt: STRING_32)
-- Add a new image to the slider, with specified url and alternative text -- Add a new image to the slider, with specified url and alternative text
do do
add_image_with_caption (src, alt, "") add_image_with_caption (src, alt, "")
@@ -88,7 +88,7 @@ feature -- Change
add_control (c: WSF_STATELESS_CONTROL; caption: detachable WSF_STATELESS_CONTROL) add_control (c: WSF_STATELESS_CONTROL; caption: detachable WSF_STATELESS_CONTROL)
-- Add a new control to the slider -- Add a new control to the slider
local local
cl: STRING cl: STRING_32
item: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] item: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
do do
create item.make () create item.make ()

View File

@@ -21,7 +21,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (h: like handler; e: STRING) make (h: like handler; e: STRING_32)
do do
make_validator (e) make_validator (e)
handler := h handler := h

View File

@@ -21,7 +21,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (e: STRING) make (e: STRING_32)
-- Initialize with specified error message which will be displayed on validation failure -- Initialize with specified error message which will be displayed on validation failure
do do
make_regexp_validator ("^[0-9]+(\.[0-9]*)?$|^\.[0-9]+$", e) make_regexp_validator ("^[0-9]+(\.[0-9]*)?$|^\.[0-9]+$", e)

View File

@@ -21,7 +21,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (e: STRING) make (e: STRING_32)
-- Initialize with specified error message which will be displayed on validation failure -- Initialize with specified error message which will be displayed on validation failure
do do
make_regexp_validator ("^.*@.*$", e) make_regexp_validator ("^.*@.*$", e)

View File

@@ -11,7 +11,7 @@ class
inherit inherit
WSF_VALIDATOR [detachable WSF_FILE] WSF_VALIDATOR [detachable WSF_FILE_DEFINITION]
rename rename
make as make_validator make as make_validator
redefine redefine
@@ -23,7 +23,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (m: INTEGER; e: STRING) make (m: INTEGER; e: STRING_32)
-- Initialize with specified maximum filesize and error message which will be displayed on validation failure -- Initialize with specified maximum filesize and error message which will be displayed on validation failure
do do
make_validator (e) make_validator (e)
@@ -32,7 +32,7 @@ feature {NONE} -- Initialization
feature -- Implementation feature -- Implementation
is_valid (input: detachable WSF_FILE): BOOLEAN is_valid (input: detachable WSF_FILE_DEFINITION): BOOLEAN
do do
Result := True Result := True
if attached input as a_input then if attached input as a_input then

View File

@@ -23,7 +23,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (m: INTEGER; e: STRING) make (m: INTEGER; e: STRING_32)
-- Initialize with specified maximum and error message which will be displayed on validation failure -- Initialize with specified maximum and error message which will be displayed on validation failure
do do
make_validator (e) make_validator (e)

View File

@@ -23,7 +23,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (m: INTEGER; e: STRING) make (m: INTEGER; e: STRING_32)
-- Initialize with specified minimum and error message which will be displayed on validation failure -- Initialize with specified minimum and error message which will be displayed on validation failure
do do
make_validator (e) make_validator (e)

View File

@@ -11,7 +11,7 @@ class
inherit inherit
WSF_VALIDATOR [STRING] WSF_VALIDATOR [STRING_32]
rename rename
make as make_validator make as make_validator
redefine redefine
@@ -23,7 +23,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (r, e: STRING) make (r, e: STRING_32)
-- Initialize with specified regular expression and error message which will be displayed on validation failure -- Initialize with specified regular expression and error message which will be displayed on validation failure
do do
make_validator (e) make_validator (e)
@@ -33,7 +33,7 @@ feature {NONE} -- Initialization
feature -- Implementation feature -- Implementation
is_valid (input: STRING): BOOLEAN is_valid (input: STRING_32): BOOLEAN
do do
--Only compile when used --Only compile when used
if not regexp.is_compiled then if not regexp.is_compiled then
@@ -55,7 +55,7 @@ feature -- State
feature -- Properties feature -- Properties
regexp_string: STRING regexp_string: STRING_32
regexp: REGULAR_EXPRESSION regexp: REGULAR_EXPRESSION

View File

@@ -11,7 +11,7 @@ deferred class
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (e: STRING) make (e: STRING_32)
-- Initialize with specified error message to be displayed on validation failure -- Initialize with specified error message to be displayed on validation failure
do do
error := e error := e
@@ -34,6 +34,6 @@ feature -- Access
feature -- Properties feature -- Properties
error: STRING error: STRING_32
end end

View File

@@ -25,13 +25,13 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (t: STRING) make (t: STRING_32)
-- Initialize -- Initialize
do do
make_with_body_class (t, "", "", "") make_with_body_class (t, "", "", "")
end end
make_with_body (t, attr, b: STRING) make_with_body (t, attr, b: STRING_32)
-- Initialize with specific attributes and body -- Initialize with specific attributes and body
do do
make_stateless_control (t) make_stateless_control (t)
@@ -39,7 +39,7 @@ feature {NONE} -- Initialization
body := b body := b
end end
make_with_body_class (t, attr, c, b: STRING) make_with_body_class (t, attr, c, b: STRING_32)
-- Initialize with specific class, attributes and body -- Initialize with specific class, attributes and body
do do
make_with_body (t, attr, b) make_with_body (t, attr, b)
@@ -50,7 +50,7 @@ feature {NONE} -- Initialization
feature -- Rendering feature -- Rendering
render: STRING render: STRING_32
-- HTML representation of this control -- HTML representation of this control
do do
Result := render_tag (body, attributes) Result := render_tag (body, attributes)
@@ -58,7 +58,7 @@ feature -- Rendering
feature -- Change feature -- Change
set_body (b: STRING) set_body (b: STRING_32)
-- Set the body of this control -- Set the body of this control
do do
body := b body := b
@@ -66,10 +66,10 @@ feature -- Change
feature -- Access feature -- Access
attributes: STRING attributes: STRING_32
-- Attributes of this control -- Attributes of this control
body: STRING body: STRING_32
-- Body of this control -- Body of this control
end end

View File

@@ -22,7 +22,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (a_text: STRING) make (a_text: STRING_32)
-- Initialize with specified control name and text -- Initialize with specified control name and text
do do
make_control ("button") make_control ("button")
@@ -58,7 +58,7 @@ feature --Event handling
click_event := e click_event := e
end end
handle_callback (cname: LIST [STRING]; event: STRING; event_parameter: detachable ANY) handle_callback (cname: LIST [STRING_32]; event: STRING_32; event_parameter: detachable ANY)
do do
if Current.control_name.same_string (cname [1]) and attached click_event as cevent then if Current.control_name.same_string (cname [1]) and attached click_event as cevent then
cevent.call (Void) cevent.call (Void)
@@ -67,10 +67,10 @@ feature --Event handling
feature -- Rendering feature -- Rendering
render: STRING render: STRING_32
-- HTML representation of this control -- HTML representation of this control
local local
attr: STRING attr: STRING_32
do do
create attr.make_empty create attr.make_empty
if attached attributes as a then if attached attributes as a then
@@ -84,7 +84,7 @@ feature -- Rendering
feature -- Change feature -- Change
set_text (t: STRING) set_text (t: STRING_32)
-- Set text of that button -- Set text of that button
do do
if not t.same_string (text) then if not t.same_string (text) then
@@ -106,7 +106,7 @@ feature -- Properties
disabled: BOOLEAN disabled: BOOLEAN
-- Defines if the button is editable -- Defines if the button is editable
text: STRING text: STRING_32
-- The text currently displayed on this button -- The text currently displayed on this button
click_event: detachable PROCEDURE [ANY, TUPLE] click_event: detachable PROCEDURE [ANY, TUPLE]

View File

@@ -21,7 +21,7 @@ inherit
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (a_tag_name: STRING) make (a_tag_name: STRING_32)
-- Initialize with specified and tag -- Initialize with specified and tag
require require
not a_tag_name.is_empty not a_tag_name.is_empty
@@ -36,7 +36,7 @@ feature {NONE} -- Initialization
feature -- Actions feature -- Actions
start_modal (url: STRING; title: STRING; big: BOOLEAN) start_modal (url: STRING_32; title: STRING_32; big: BOOLEAN)
--Start a modal window containg an other or the same page --Start a modal window containg an other or the same page
local local
modal: WSF_JSON_OBJECT modal: WSF_JSON_OBJECT
@@ -52,7 +52,7 @@ feature -- Actions
actions.add (modal) actions.add (modal)
end end
show_alert (message: STRING) show_alert (message: STRING_32)
--Start a modal window containg an other or the same page --Start a modal window containg an other or the same page
local local
alert: WSF_JSON_OBJECT alert: WSF_JSON_OBJECT
@@ -63,7 +63,7 @@ feature -- Actions
actions.add (alert) actions.add (alert)
end end
redirect (url: STRING) redirect (url: STRING_32)
--Redirect to an other page --Redirect to an other page
local local
modal: WSF_JSON_OBJECT modal: WSF_JSON_OBJECT
@@ -127,17 +127,17 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
feature -- Rendering feature -- Rendering
render_tag (body: STRING; attrs: detachable STRING): STRING render_tag (body: STRING_32; attrs: detachable STRING_32): STRING_32
-- Render this control with the specified body and attributes -- Render this control with the specified body and attributes
do do
Result := render_tag_with_generator_name (js_class, body, attrs) Result := render_tag_with_generator_name (js_class, body, attrs)
end end
render_tag_with_generator_name (a_generator, body: STRING; attrs: detachable STRING): STRING render_tag_with_generator_name (a_generator, body: STRING_32; attrs: detachable STRING_32): STRING_32
-- Render this control with the specified generator name, body and attributes -- Render this control with the specified generator name, body and attributes
local local
css_classes_string: STRING css_classes_string: STRING_32
l_attributes: STRING l_attributes: STRING_32
do do
css_classes_string := "" css_classes_string := ""
across across
@@ -155,14 +155,14 @@ feature -- Rendering
Result := render_tag_with_tagname (tag_name, body, l_attributes, css_classes_string) Result := render_tag_with_tagname (tag_name, body, l_attributes, css_classes_string)
end end
js_class: STRING js_class: STRING_32
do do
Result := generator Result := generator
end end
feature -- Event handling feature -- Event handling
handle_callback (cname: LIST [STRING]; event: STRING; event_parameter: detachable ANY) handle_callback (cname: LIST [STRING_32]; event: STRING_32; event_parameter: detachable ANY)
-- Method called if any callback received. In this method you can route the callback to the event handler -- Method called if any callback received. In this method you can route the callback to the event handler
deferred deferred
end end
@@ -187,14 +187,14 @@ feature -- Properties
control_id := d control_id := d
end end
control_name: STRING control_name: STRING_32
do do
Result := control_name_prefix + control_id.out Result := control_name_prefix + control_id.out
end end
control_name_prefix: STRING assign set_control_name_prefix control_name_prefix: STRING_32 assign set_control_name_prefix
set_control_name_prefix (p: STRING) set_control_name_prefix (p: STRING_32)
do do
control_name_prefix := p control_name_prefix := p
end end

View File

@@ -22,7 +22,7 @@ inherit
feature {NONE} -- Initialization feature {NONE} -- Initialization
make_with_tag_name (tag: STRING) make_with_tag_name (tag: STRING_32)
do do
Precursor (tag) Precursor (tag)
create items.make_array create items.make_array
@@ -113,11 +113,11 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
feature feature
create_control_from_tag (tag: STRING): detachable G create_control_from_tag (tag: STRING_32): detachable G
deferred deferred
end end
add_control_from_tag (tag: STRING) add_control_from_tag (tag: STRING_32)
local local
item: WSF_JSON_OBJECT item: WSF_JSON_OBJECT
do do
@@ -153,7 +153,7 @@ feature
end end
end end
js_class: STRING js_class: STRING_32
do do
Result := "WSF_DYNAMIC_MULTI_CONTROL" Result := "WSF_DYNAMIC_MULTI_CONTROL"
end end

View File

@@ -29,19 +29,19 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make_without_border (a_label: detachable STRING; c: WSF_VALUE_CONTROL [G]) make_without_border (a_label: detachable STRING_32; c: WSF_VALUE_CONTROL [G])
-- Initialize form element control with a specific label (or 'Void' for no label) and value control -- Initialize form element control with a specific label (or 'Void' for no label) and value control
do do
make_with_validators (a_label, False, c, create {ARRAYED_LIST [WSF_VALIDATOR [G]]}.make (0)) make_with_validators (a_label, False, c, create {ARRAYED_LIST [WSF_VALIDATOR [G]]}.make (0))
end end
make (a_label: detachable STRING; c: WSF_VALUE_CONTROL [G]) make (a_label: detachable STRING_32; c: WSF_VALUE_CONTROL [G])
-- Initialize form element control with a specific label (or 'Void' for no label) and value control -- Initialize form element control with a specific label (or 'Void' for no label) and value control
do do
make_with_validators (a_label, True, c, create {ARRAYED_LIST [WSF_VALIDATOR [G]]}.make (0)) make_with_validators (a_label, True, c, create {ARRAYED_LIST [WSF_VALIDATOR [G]]}.make (0))
end end
make_with_validators (a_label: detachable STRING; show_border: BOOLEAN; c: WSF_VALUE_CONTROL [G]; v: LIST [WSF_VALIDATOR [G]]) make_with_validators (a_label: detachable STRING_32; show_border: BOOLEAN; c: WSF_VALUE_CONTROL [G]; v: LIST [WSF_VALIDATOR [G]])
-- Initialize form element control with a specific label (or 'Void' for no label), value control and list of validators -- Initialize form element control with a specific label (or 'Void' for no label), value control and list of validators
do do
make_control ("div") make_control ("div")
@@ -145,7 +145,7 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
feature -- Event handling feature -- Event handling
handle_callback (cname: LIST [STRING]; event: STRING; event_parameter: detachable ANY) handle_callback (cname: LIST [STRING_32]; event: STRING_32; event_parameter: detachable ANY)
-- Pass callback to subcontrols -- Pass callback to subcontrols
do do
if cname [1].same_string (control_name) then if cname [1].same_string (control_name) then
@@ -163,10 +163,10 @@ feature -- Event handling
feature -- Implementation feature -- Implementation
render: STRING render: STRING_32
-- HTML Respresentation of this form element control -- HTML Respresentation of this form element control
local local
body: STRING body: STRING_32
do do
body := "" body := ""
if attached label as l and then not l.is_empty then if attached label as l and then not l.is_empty then
@@ -188,7 +188,7 @@ feature -- Validation
validators.extend (v) validators.extend (v)
end end
set_error (e: STRING) set_error (e: STRING_32)
-- Set the error message that will be displayed upon failure of client side validation -- Set the error message that will be displayed upon failure of client side validation
do do
error := e error := e
@@ -228,10 +228,10 @@ feature -- Properties
validators: LIST [WSF_VALIDATOR [G]] validators: LIST [WSF_VALIDATOR [G]]
-- The validators which check the input when validaton is performed -- The validators which check the input when validaton is performed
label: detachable STRING label: detachable STRING_32
-- The label of this form element control -- The label of this form element control
error: STRING error: STRING_32
-- The error message that is displayed when client side validation fails -- The error message that is displayed when client side validation fails
label_width: INTEGER label_width: INTEGER

View File

@@ -13,7 +13,7 @@ class
inherit inherit
WSF_VALUE_CONTROL [STRING] WSF_VALUE_CONTROL [STRING_32]
rename rename
make as make_value_control make as make_value_control
end end
@@ -23,7 +23,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (t, v: STRING) make (t, v: STRING_32)
-- Initialize -- Initialize
do do
make_value_control (t) make_value_control (t)
@@ -49,19 +49,19 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
feature --Event handling feature --Event handling
handle_callback (cname: LIST [STRING]; event: STRING; event_parameter: detachable ANY) handle_callback (cname: LIST [STRING_32]; event: STRING_32; event_parameter: detachable ANY)
do do
end end
feature -- Implementation feature -- Implementation
render: STRING render: STRING_32
-- HTML representation of this html control -- HTML representation of this html control
do do
Result := render_tag (html, "") Result := render_tag (html, "")
end end
set_html (t: STRING) set_html (t: STRING_32)
do do
if not t.same_string (html) then if not t.same_string (html) then
html := t html := t
@@ -69,18 +69,18 @@ feature -- Implementation
end end
end end
value: STRING value: STRING_32
do do
Result := html Result := html
end end
set_value (v: STRING) set_value (v: STRING_32)
do do
html := v html := v
end end
feature -- Properties feature -- Properties
html: STRING html: STRING_32
end end

View File

@@ -23,7 +23,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (n: STRING) make (n: STRING_32)
do do
make_with_tag_name ("div") make_with_tag_name ("div")
add_class ("row") add_class ("row")

View File

@@ -32,7 +32,7 @@ feature {NONE} -- Initialization
make_with_tag_name ("div") make_with_tag_name ("div")
end end
make_with_tag_name (t: STRING) make_with_tag_name (t: STRING_32)
-- Initialize with specified control name and tag -- Initialize with specified control name and tag
do do
make_control (t) make_control (t)
@@ -135,7 +135,7 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
feature -- Event handling feature -- Event handling
handle_callback (cname: LIST [STRING]; event: STRING; event_parameter: detachable ANY) handle_callback (cname: LIST [STRING_32]; event: STRING_32; event_parameter: detachable ANY)
-- Pass callback to subcontrols -- Pass callback to subcontrols
do do
if equal (cname [1], control_name) then if equal (cname [1], control_name) then
@@ -157,7 +157,7 @@ feature -- Event handling
feature -- Rendering feature -- Rendering
render: STRING render: STRING_32
-- HTML representation of this multi control -- HTML representation of this multi control
do do
Result := "" Result := ""

View File

@@ -25,8 +25,14 @@ inherit
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (req: WSF_REQUEST; res: WSF_RESPONSE) make (req: WSF_REQUEST; res: WSF_RESPONSE)
do
make_with_base_path (req, res, "/")
end
make_with_base_path (req: WSF_REQUEST; res: WSF_RESPONSE; a_base_path: STRING_32)
-- Initialize -- Initialize
do do
base_path := a_base_path
control_name := req.request_time_stamp.out control_name := req.request_time_stamp.out
make_control ("body") make_control ("body")
request := req request := req
@@ -62,10 +68,10 @@ feature -- Implementation
-- Entry Point: If request is a callback, restore control states and execute handle then return new state json. -- Entry Point: If request is a callback, restore control states and execute handle then return new state json.
-- If request is not a callback. Run process and render the html page -- If request is not a callback. Run process and render the html page
local local
event: detachable STRING event: detachable STRING_32
event_parameter: detachable ANY event_parameter: detachable ANY
event_control_name: detachable STRING event_control_name: detachable STRING_32
states: STRING states: STRING_32
states_changes: WSF_JSON_OBJECT states_changes: WSF_JSON_OBJECT
json_parser: JSON_PARSER json_parser: JSON_PARSER
do do
@@ -111,7 +117,7 @@ feature -- Implementation
response.send (page) response.send (page)
end end
render: STRING render: STRING_32
local local
ajax: BOOLEAN ajax: BOOLEAN
do do
@@ -119,12 +125,20 @@ feature -- Implementation
create Result.make_empty create Result.make_empty
if not ajax then if not ajax then
Result.append ("<html><head>") Result.append ("<html><head>")
Result.append ("<link href=%"/assets/bootstrap.min.css%" rel=%"stylesheet%">") Result.append ("<link href=%"")
Result.append ("<link href=%"/assets/widget.css%" rel=%"stylesheet%">") Result.append (base_path)
Result.append ("assets/bootstrap.min.css%" rel=%"stylesheet%">")
Result.append ("<link href=%"")
Result.append (base_path)
Result.append ("assets/widget.css%" rel=%"stylesheet%">")
Result.append ("</head><body data-name=%"" + control_name + "%" data-type=%"WSF_PAGE_CONTROL%">") Result.append ("</head><body data-name=%"" + control_name + "%" data-type=%"WSF_PAGE_CONTROL%">")
Result.append (control.render) Result.append (control.render)
Result.append ("<script src=%"/assets/jquery.min.js%"></script>") Result.append ("<script src=%"")
Result.append ("<script src=%"/assets/widget.js%"></script>") Result.append (base_path)
Result.append ("assets/jquery.min.js%"></script>")
Result.append ("<script src=%"")
Result.append (base_path)
Result.append ("assets/widget.js%"></script>")
Result.append ("<script type=%"text/javascript%">$(function() {var page= new WSF_PAGE_CONTROL(") Result.append ("<script type=%"text/javascript%">$(function() {var page= new WSF_PAGE_CONTROL(")
Result.append (full_state.representation) Result.append (full_state.representation)
Result.append (");page.initialize();});</script>") Result.append (");page.initialize();});</script>")
@@ -146,7 +160,7 @@ feature -- Implementation
control.read_state_changes (states) control.read_state_changes (states)
end end
get_parameter (key: STRING): detachable STRING get_parameter (key: STRING_32): detachable STRING_32
-- Read query parameter as string -- Read query parameter as string
local local
value: detachable WSF_VALUE value: detachable WSF_VALUE
@@ -160,7 +174,7 @@ feature -- Implementation
feature -- Event handling feature -- Event handling
handle_callback (cname: LIST [STRING]; event: STRING; event_parameter: detachable ANY) handle_callback (cname: LIST [STRING_32]; event: STRING_32; event_parameter: detachable ANY)
-- Forward callback to control -- Forward callback to control
do do
control.handle_callback (cname, event, event_parameter) control.handle_callback (cname, event, event_parameter)
@@ -196,7 +210,9 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
feature feature
control_name: STRING control_name: STRING_32
base_path: STRING_32
feature {NONE} -- Root control feature {NONE} -- Root control

View File

@@ -14,7 +14,7 @@ deferred class
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (a_tag_name: STRING) make (a_tag_name: STRING_32)
-- Initialize with specified tag -- Initialize with specified tag
require require
not a_tag_name.is_empty not a_tag_name.is_empty
@@ -25,30 +25,30 @@ feature {NONE} -- Initialization
feature -- Access feature -- Access
tag_name: STRING tag_name: STRING_32
-- The tag name -- The tag name
css_classes: ARRAYED_LIST [STRING] css_classes: ARRAYED_LIST [STRING_32]
-- List of classes (appear in the "class" attribute) -- List of classes (appear in the "class" attribute)
attributes: detachable STRING attributes: detachable STRING_32
-- Attributes string (without classes) -- Attributes string (without classes)
feature -- Change feature -- Change
add_class (c: STRING) add_class (c: STRING_32)
-- Add a css class to this control -- Add a css class to this control
do do
css_classes.force (c) css_classes.force (c)
end end
remove_class (cla: STRING) remove_class (cla: STRING_32)
-- Add a css class to this control -- Add a css class to this control
do do
css_classes.prune (cla) css_classes.prune (cla)
end end
append_attribute (a: STRING) append_attribute (a: STRING_32)
-- Adds the specified attribute to the attribute string of this control -- Adds the specified attribute to the attribute string of this control
do do
if attached attributes as attr then if attached attributes as attr then
@@ -61,10 +61,10 @@ feature -- Change
feature -- Rendering feature -- Rendering
render_tag (body: STRING; attrs: detachable STRING): STRING render_tag (body: STRING_32; attrs: detachable STRING_32): STRING_32
-- Generate HTML of this control with the specified body and attributes -- Generate HTML of this control with the specified body and attributes
local local
css_classes_string: STRING css_classes_string: STRING_32
do do
create css_classes_string.make_empty create css_classes_string.make_empty
across across
@@ -75,10 +75,10 @@ feature -- Rendering
Result := render_tag_with_tagname (tag_name, body, attrs, css_classes_string) Result := render_tag_with_tagname (tag_name, body, attrs, css_classes_string)
end end
render_tag_with_tagname (tag, body: STRING; attrs: detachable STRING; css_classes_string: STRING): STRING render_tag_with_tagname (tag, body: STRING_32; attrs: detachable STRING_32; css_classes_string: STRING_32): STRING_32
-- Generate HTML of the specified tag with specified body, attributes and css classes -- Generate HTML of the specified tag with specified body, attributes and css classes
local local
l_attributes: STRING l_attributes: STRING_32
do do
if attached attrs as a then if attached attrs as a then
create l_attributes.make_from_string (a) create l_attributes.make_from_string (a)
@@ -99,13 +99,13 @@ feature -- Rendering
end end
end end
render_tag_with_body (body: STRING): STRING render_tag_with_body (body: STRING_32): STRING_32
-- Generate HTML of this control with the specified body -- Generate HTML of this control with the specified body
do do
Result := render_tag (body, attributes) Result := render_tag (body, attributes)
end end
render: STRING render: STRING_32
-- Return html representation of control -- Return html representation of control
deferred deferred
end end

View File

@@ -40,7 +40,7 @@ feature
set_subcontrol_prefixes set_subcontrol_prefixes
end end
set_control_name_prefix (p: STRING) set_control_name_prefix (p: STRING_32)
do do
control_name_prefix := p control_name_prefix := p
set_subcontrol_prefixes set_subcontrol_prefixes
@@ -69,10 +69,10 @@ feature
end end
end end
render_tag (body: STRING; attrs: detachable STRING): STRING render_tag (body: STRING_32; attrs: detachable STRING_32): STRING_32
-- Generate HTML of this control with the specified body and attributes -- Generate HTML of this control with the specified body and attributes
local local
css_classes_string: STRING css_classes_string: STRING_32
do do
create css_classes_string.make_empty create css_classes_string.make_empty
across across
@@ -85,7 +85,7 @@ feature
feature -- Event handling feature -- Event handling
handle_callback (cname: LIST [STRING]; event: STRING; event_parameter: detachable ANY) handle_callback (cname: LIST [STRING_32]; event: STRING_32; event_parameter: detachable ANY)
-- Pass callback to subcontrols -- Pass callback to subcontrols
do do
across across

View File

@@ -20,7 +20,7 @@ inherit
make_control make_control
end end
WSF_VALUE_CONTROL [STRING] WSF_VALUE_CONTROL [STRING_32]
undefine undefine
load_state, load_state,
full_state, full_state,
@@ -33,7 +33,7 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (t: STRING) make (t: STRING_32)
-- Make a date picker control with specified tag name (such as li) and menu title -- Make a date picker control with specified tag name (such as li) and menu title
local local
span: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL] span: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
@@ -52,12 +52,12 @@ feature {NONE} -- Initialization
feature -- Implementation feature -- Implementation
value: STRING value: STRING_32
do do
Result := input.value Result := input.value
end end
set_value (v: STRING) set_value (v: STRING_32)
do do
input.set_value (v) input.set_value (v)
end end