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
autocompletion (input: STRING): JSON_ARRAY
autocompletion (input: STRING_32): JSON_ARRAY
-- JSON array of suggestions that fit the specific input
deferred
end
template: detachable STRING
template: detachable STRING_32
-- Customizable template
end

View File

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

View File

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

View File

@@ -12,7 +12,7 @@ create
feature {NONE} -- Initialization
make (a_header, a_field: STRING)
make (a_header, a_field: STRING_32)
do
header := a_header
field_name := a_field
@@ -21,7 +21,7 @@ feature {NONE} -- Initialization
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)
do
if attached e.item (field_name) as data then
@@ -33,12 +33,12 @@ feature -- Render
feature -- Properties
header: STRING
header: STRING_32
sortable: BOOLEAN
sorting_name: STRING
sorting_name: STRING_32
field_name: STRING
field_name: STRING_32
end

View File

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

View File

@@ -21,14 +21,14 @@ create
feature {NONE} -- Initialization
make (a_header, a_field: STRING)
make (a_header, a_field: STRING_32)
do
make_column (a_header, a_field)
end
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)
do
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
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
do
if Current.control_name.same_string (cname[1]) then
@@ -57,7 +57,7 @@ feature --Event handling
elseif event.same_string ("prev") then
datasource.set_page (datasource.page - 1)
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)
end
end
@@ -67,12 +67,12 @@ feature --Event handling
feature -- Render
render: STRING
render: STRING_32
-- Render paging control
local
paging_start: INTEGER
paging_end: INTEGER
cssclass: STRING
cssclass: STRING_32
do
Result := render_tag_with_tagname ("li", render_tag_with_tagname ("a", "«", "href=%"#%" data-nr=%"prev%"", ""), "", "")
paging_start := (datasource.page - 4).max (1)

View File

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

View File

@@ -31,7 +31,7 @@ feature {NONE} -- Initialization
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
do
make_input ( "")
@@ -49,7 +49,7 @@ feature -- State
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
Precursor {WSF_INPUT_CONTROL} (cname, event, event_parameter)
if cname[1].same_string (control_name) and event.same_string ("autocomplete") then
@@ -59,8 +59,8 @@ feature -- Callback
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

View File

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

View File

@@ -9,7 +9,7 @@ class
inherit
WSF_VALUE_CONTROL [LIST [STRING]]
WSF_VALUE_CONTROL [LIST [STRING_32]]
rename
make as make_control
undefine
@@ -36,9 +36,9 @@ feature {NONE} -- Initializaton
feature -- Implementation
value: LIST [STRING]
value: LIST [STRING_32]
do
create {ARRAYED_LIST [STRING]} Result.make (0)
create {ARRAYED_LIST [STRING_32]} Result.make (0)
across
controls as c
loop
@@ -48,7 +48,7 @@ feature -- Implementation
end
end
set_value (v: LIST [STRING])
set_value (v: LIST [STRING_32])
do
across
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
WSF_VALUE_CONTROL [detachable WSF_FILE]
WSF_VALUE_CONTROL [detachable WSF_FILE_DEFINITION]
rename
make as make_value_control
end
@@ -35,7 +35,7 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
set_state (new_state: JSON_OBJECT)
-- Restore text from json
local
id: detachable STRING
id: detachable STRING_32
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_id") as a_id then
@@ -69,12 +69,12 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
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
f_name: detachable STRING
f_type: detachable STRING
f_name: detachable STRING_32
f_type: detachable STRING_32
f_size: detachable INTEGER
f_id: detachable STRING
f_id: detachable STRING_32
do
if Current.control_name.same_string (cname [1]) then
if attached change_event as cevent and event.same_string ("change") then
@@ -112,14 +112,14 @@ feature -- Upload
feature -- Implementation
value: detachable WSF_FILE
value: detachable WSF_FILE_DEFINITION
do
Result := file
end
render: STRING
render: STRING_32
local
attr: STRING
attr: STRING_32
do
attr := "type=%"file%" "
if attached attributes as a then
@@ -159,7 +159,7 @@ feature -- Change
end
end
set_value (v: detachable WSF_FILE)
set_value (v: detachable WSF_FILE_DEFINITION)
do
file := v
end
@@ -180,7 +180,7 @@ feature -- Properties
image_preview: BOOLEAN
-- Preview uploaded image
file: detachable WSF_FILE
file: detachable WSF_FILE_DEFINITION
-- Text to be displayed
change_event: detachable PROCEDURE [ANY, TUPLE]
@@ -189,7 +189,7 @@ feature -- Properties
upload_done_event: detachable PROCEDURE [ANY, TUPLE]
-- 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
end

View File

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

View File

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

View File

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

View File

@@ -39,7 +39,7 @@ feature {NONE} -- Initialization
nav_right.add_class ("nav navbar-nav navbar-right")
end
make_with_brand (b: STRING)
make_with_brand (b: STRING_32)
-- Initialize with specified brand string
do
make
@@ -48,10 +48,10 @@ feature {NONE} -- Initialization
feature -- Rendering
render: STRING
render: STRING_32
local
temp: STRING
nav_string: STRING
temp: STRING_32
nav_string: STRING_32
do
temp := render_tag_with_tagname ("span", "", "", "icon-bar")
temp.multiply (3)
@@ -129,7 +129,7 @@ feature -- Properties
active_set: BOOLEAN
-- 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
nav: WSF_STATELESS_MULTI_CONTROL [WSF_STATELESS_CONTROL]

View File

@@ -30,7 +30,7 @@ feature {NONE} -- Initialization
feature -- Change
add_link (link, text: STRING)
add_link (link, text: STRING_32)
-- Add a link to nav list
local
c: WSF_NAVLIST_ITEM_CONTROL
@@ -39,7 +39,7 @@ feature -- Change
add_control (c)
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
local
c: WSF_NAVLIST_ITEM_CONTROL

View File

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

View File

@@ -55,7 +55,7 @@ feature -- State 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
if cname[1].same_string (control_name) and event.same_string ("progress_fetch") then
state_changes.put_integer (progress_value, "progress")
@@ -64,9 +64,9 @@ feature -- Event handling
feature -- Rendering
render: STRING
render: STRING_32
local
p: STRING
p: STRING_32
do
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")

View File

@@ -43,16 +43,16 @@ feature -- State handling
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 nothing here
end
feature -- Rendering
render: STRING
render: STRING_32
local
temp: STRING
temp: STRING_32
do
temp := list.render
temp.append (slide_wrapper.render)
@@ -63,7 +63,7 @@ feature -- Rendering
feature -- Change
add_image_with_caption (src, alt, caption: STRING)
add_image_with_caption (src, alt, caption: STRING_32)
local
caption_control: detachable WSF_STATELESS_CONTROL
do
@@ -73,13 +73,13 @@ feature -- Change
add_image_with_caption_control (src, alt, caption_control)
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
do
add_control (create {WSF_BASIC_CONTROL}.make_with_body_class ("img", "src=%"" + src + "%" alt=%"" + alt + "%"", "", ""), Void)
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
do
add_image_with_caption (src, alt, "")
@@ -88,7 +88,7 @@ feature -- Change
add_control (c: WSF_STATELESS_CONTROL; caption: detachable WSF_STATELESS_CONTROL)
-- Add a new control to the slider
local
cl: STRING
cl: STRING_32
item: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
do
create item.make ()

View File

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

View File

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

View File

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

View File

@@ -11,7 +11,7 @@ class
inherit
WSF_VALIDATOR [detachable WSF_FILE]
WSF_VALIDATOR [detachable WSF_FILE_DEFINITION]
rename
make as make_validator
redefine
@@ -23,7 +23,7 @@ create
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
do
make_validator (e)
@@ -32,7 +32,7 @@ feature {NONE} -- Initialization
feature -- Implementation
is_valid (input: detachable WSF_FILE): BOOLEAN
is_valid (input: detachable WSF_FILE_DEFINITION): BOOLEAN
do
Result := True
if attached input as a_input then

View File

@@ -23,7 +23,7 @@ create
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
do
make_validator (e)

View File

@@ -23,7 +23,7 @@ create
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
do
make_validator (e)

View File

@@ -11,7 +11,7 @@ class
inherit
WSF_VALIDATOR [STRING]
WSF_VALIDATOR [STRING_32]
rename
make as make_validator
redefine
@@ -23,7 +23,7 @@ create
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
do
make_validator (e)
@@ -33,7 +33,7 @@ feature {NONE} -- Initialization
feature -- Implementation
is_valid (input: STRING): BOOLEAN
is_valid (input: STRING_32): BOOLEAN
do
--Only compile when used
if not regexp.is_compiled then
@@ -55,7 +55,7 @@ feature -- State
feature -- Properties
regexp_string: STRING
regexp_string: STRING_32
regexp: REGULAR_EXPRESSION

View File

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

View File

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

View File

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

View File

@@ -21,7 +21,7 @@ inherit
feature {NONE} -- Initialization
make (a_tag_name: STRING)
make (a_tag_name: STRING_32)
-- Initialize with specified and tag
require
not a_tag_name.is_empty
@@ -36,7 +36,7 @@ feature {NONE} -- Initialization
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
local
modal: WSF_JSON_OBJECT
@@ -52,7 +52,7 @@ feature -- Actions
actions.add (modal)
end
show_alert (message: STRING)
show_alert (message: STRING_32)
--Start a modal window containg an other or the same page
local
alert: WSF_JSON_OBJECT
@@ -63,7 +63,7 @@ feature -- Actions
actions.add (alert)
end
redirect (url: STRING)
redirect (url: STRING_32)
--Redirect to an other page
local
modal: WSF_JSON_OBJECT
@@ -127,17 +127,17 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
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
do
Result := render_tag_with_generator_name (js_class, body, attrs)
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
local
css_classes_string: STRING
l_attributes: STRING
css_classes_string: STRING_32
l_attributes: STRING_32
do
css_classes_string := ""
across
@@ -155,14 +155,14 @@ feature -- Rendering
Result := render_tag_with_tagname (tag_name, body, l_attributes, css_classes_string)
end
js_class: STRING
js_class: STRING_32
do
Result := generator
end
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
deferred
end
@@ -187,14 +187,14 @@ feature -- Properties
control_id := d
end
control_name: STRING
control_name: STRING_32
do
Result := control_name_prefix + control_id.out
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
control_name_prefix := p
end

View File

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

View File

@@ -29,19 +29,19 @@ create
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
do
make_with_validators (a_label, False, c, create {ARRAYED_LIST [WSF_VALIDATOR [G]]}.make (0))
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
do
make_with_validators (a_label, True, c, create {ARRAYED_LIST [WSF_VALIDATOR [G]]}.make (0))
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
do
make_control ("div")
@@ -145,7 +145,7 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
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
do
if cname [1].same_string (control_name) then
@@ -163,10 +163,10 @@ feature -- Event handling
feature -- Implementation
render: STRING
render: STRING_32
-- HTML Respresentation of this form element control
local
body: STRING
body: STRING_32
do
body := ""
if attached label as l and then not l.is_empty then
@@ -188,7 +188,7 @@ feature -- Validation
validators.extend (v)
end
set_error (e: STRING)
set_error (e: STRING_32)
-- Set the error message that will be displayed upon failure of client side validation
do
error := e
@@ -228,10 +228,10 @@ feature -- Properties
validators: LIST [WSF_VALIDATOR [G]]
-- The validators which check the input when validaton is performed
label: detachable STRING
label: detachable STRING_32
-- The label of this form element control
error: STRING
error: STRING_32
-- The error message that is displayed when client side validation fails
label_width: INTEGER

View File

@@ -13,7 +13,7 @@ class
inherit
WSF_VALUE_CONTROL [STRING]
WSF_VALUE_CONTROL [STRING_32]
rename
make as make_value_control
end
@@ -23,7 +23,7 @@ create
feature {NONE} -- Initialization
make (t, v: STRING)
make (t, v: STRING_32)
-- Initialize
do
make_value_control (t)
@@ -49,19 +49,19 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
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
end
feature -- Implementation
render: STRING
render: STRING_32
-- HTML representation of this html control
do
Result := render_tag (html, "")
end
set_html (t: STRING)
set_html (t: STRING_32)
do
if not t.same_string (html) then
html := t
@@ -69,18 +69,18 @@ feature -- Implementation
end
end
value: STRING
value: STRING_32
do
Result := html
end
set_value (v: STRING)
set_value (v: STRING_32)
do
html := v
end
feature -- Properties
html: STRING
html: STRING_32
end

View File

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

View File

@@ -32,7 +32,7 @@ feature {NONE} -- Initialization
make_with_tag_name ("div")
end
make_with_tag_name (t: STRING)
make_with_tag_name (t: STRING_32)
-- Initialize with specified control name and tag
do
make_control (t)
@@ -135,7 +135,7 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
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
do
if equal (cname [1], control_name) then
@@ -157,7 +157,7 @@ feature -- Event handling
feature -- Rendering
render: STRING
render: STRING_32
-- HTML representation of this multi control
do
Result := ""

View File

@@ -1,8 +1,8 @@
note
description: "[
The skeleton for a page control which represents a single page
of the web application. This class is the starting point for
event distribution, rendering and state handling.
The skeleton for a page control which represents a single page
of the web application. This class is the starting point for
event distribution, rendering and state handling.
]"
author: ""
date: "$Date$"
@@ -25,8 +25,14 @@ inherit
feature {NONE} -- Initialization
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
do
base_path := a_base_path
control_name := req.request_time_stamp.out
make_control ("body")
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.
-- If request is not a callback. Run process and render the html page
local
event: detachable STRING
event: detachable STRING_32
event_parameter: detachable ANY
event_control_name: detachable STRING
states: STRING
event_control_name: detachable STRING_32
states: STRING_32
states_changes: WSF_JSON_OBJECT
json_parser: JSON_PARSER
do
@@ -111,7 +117,7 @@ feature -- Implementation
response.send (page)
end
render: STRING
render: STRING_32
local
ajax: BOOLEAN
do
@@ -119,12 +125,20 @@ feature -- Implementation
create Result.make_empty
if not ajax then
Result.append ("<html><head>")
Result.append ("<link href=%"/assets/bootstrap.min.css%" rel=%"stylesheet%">")
Result.append ("<link href=%"/assets/widget.css%" rel=%"stylesheet%">")
Result.append ("<link href=%"")
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 (control.render)
Result.append ("<script src=%"/assets/jquery.min.js%"></script>")
Result.append ("<script src=%"/assets/widget.js%"></script>")
Result.append ("<script src=%"")
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 (full_state.representation)
Result.append (");page.initialize();});</script>")
@@ -146,7 +160,7 @@ feature -- Implementation
control.read_state_changes (states)
end
get_parameter (key: STRING): detachable STRING
get_parameter (key: STRING_32): detachable STRING_32
-- Read query parameter as string
local
value: detachable WSF_VALUE
@@ -160,7 +174,7 @@ feature -- Implementation
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
do
control.handle_callback (cname, event, event_parameter)
@@ -196,7 +210,9 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
feature
control_name: STRING
control_name: STRING_32
base_path: STRING_32
feature {NONE} -- Root control

View File

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

View File

@@ -40,7 +40,7 @@ feature
set_subcontrol_prefixes
end
set_control_name_prefix (p: STRING)
set_control_name_prefix (p: STRING_32)
do
control_name_prefix := p
set_subcontrol_prefixes
@@ -69,10 +69,10 @@ feature
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
local
css_classes_string: STRING
css_classes_string: STRING_32
do
create css_classes_string.make_empty
across
@@ -85,7 +85,7 @@ feature
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
do
across

View File

@@ -20,7 +20,7 @@ inherit
make_control
end
WSF_VALUE_CONTROL [STRING]
WSF_VALUE_CONTROL [STRING_32]
undefine
load_state,
full_state,
@@ -33,7 +33,7 @@ create
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
local
span: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
@@ -52,12 +52,12 @@ feature {NONE} -- Initialization
feature -- Implementation
value: STRING
value: STRING_32
do
Result := input.value
end
set_value (v: STRING)
set_value (v: STRING_32)
do
input.set_value (v)
end