Merge branch 'widget_slider' into widget

Conflicts:
	draft/library/wsf_js_widget/kernel/webcontrol/wsf_control.e
	examples/widgetapp/base_page.e
This commit is contained in:
severin
2013-10-29 15:39:32 +01:00
17 changed files with 161 additions and 87 deletions

View File

@@ -15,14 +15,14 @@ inherit
end
create
make_control, make_with_body
make_control, make_with_body, make_with_body_class
feature {NONE} -- Initialization
make_control (t: STRING)
-- Initialize
do
make_with_body (t, "", "")
make_with_body_class (t, "", "", "")
end
make_with_body (t, attr, b: STRING)
@@ -33,6 +33,15 @@ feature {NONE} -- Initialization
body := b
end
make_with_body_class (t, attr, c, b: STRING)
-- Initialize with specific attributes and body
do
make_with_body (t, attr, b)
if not c.is_empty then
css_classes.extend (c)
end
end
feature -- Rendering
render: STRING

View File

@@ -14,11 +14,6 @@ inherit
render_tag
end
feature
control_name: STRING
feature {NONE} -- Initialization
make_control (n, a_tag_name: STRING)
@@ -37,10 +32,10 @@ feature {NONE} -- Initialization
feature -- Actions
start_modal(url:STRING; title:STRING)
--Start a modal window containg an other or the same page
start_modal (url: STRING; title: STRING)
--Start a modal window containg an other or the same page
local
modal:WSF_JSON_OBJECT
modal: WSF_JSON_OBJECT
do
create modal.make
modal.put_string ("start_modal", "type")
@@ -49,10 +44,10 @@ feature -- Actions
actions.add (modal)
end
start_modal_big(url:STRING; title:STRING)
--Start a modal window containg an other or the same page
start_modal_big (url: STRING; title: STRING)
--Start a modal window containg an other or the same page
local
modal:WSF_JSON_OBJECT
modal: WSF_JSON_OBJECT
do
create modal.make
modal.put_string ("start_modal_big", "type")
@@ -61,10 +56,10 @@ feature -- Actions
actions.add (modal)
end
show_alert(mesage:STRING)
--Start a modal window containg an other or the same page
show_alert (mesage: STRING)
--Start a modal window containg an other or the same page
local
modal:WSF_JSON_OBJECT
modal: WSF_JSON_OBJECT
do
create modal.make
modal.put_string ("show_alert", "type")
@@ -72,7 +67,7 @@ feature -- Actions
actions.add (modal)
end
feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT
feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
load_state (new_states: JSON_OBJECT)
-- Select state stored with `control_name` as key
@@ -102,9 +97,9 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT
end
if actions.count > 0 then
if not attached states.item ("actions") then
states.put (create {JSON_ARRAY}.make_array,"actions")
states.put (create {JSON_ARRAY}.make_array, "actions")
end
if attached {JSON_ARRAY}states.item ("actions") as action_list then
if attached {JSON_ARRAY} states.item ("actions") as action_list then
across
actions.array_representation as action
loop
@@ -150,17 +145,18 @@ feature -- Rendering
Result := render_tag_with_tagname (tag_name, body, l_attributes, css_classes_string)
end
feature -- EVENT HANDLING
feature -- Event handling
handle_callback (cname: STRING; event: STRING; event_parameter: detachable STRING)
-- Method called if any callback received. In this method you can route the callback to the event handler
deferred
end
feature -- Change
set_isolation (p: BOOLEAN)
do
isolate := true
isolate := p
end
feature -- Properties
@@ -168,4 +164,7 @@ feature -- Properties
isolate: BOOLEAN
actions: JSON_ARRAY
control_name: STRING
end

View File

@@ -120,19 +120,17 @@ feature -- Rendering
across
controls as c
loop
Result := c.item.render + Result
Result := Result + c.item.render
end
Result := render_tag (Result, "")
end
feature -- Change
add_control (c: detachable G)
add_control (c: G)
-- Add a control to this multi control
do
if attached c as d then
controls.put_front (d)
end
controls.extend (c)
end
feature -- Properties

View File

@@ -27,7 +27,7 @@ feature -- Access
-- List of classes (appear in the "class" attribute)
attributes: detachable STRING
-- Attributes string
-- Attributes string (without classes)
feature -- Change