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:
0
contrib/library/text/parser/json/test/getest/ec_compile.sh
Executable file → Normal file
0
contrib/library/text/parser/json/test/getest/ec_compile.sh
Executable file → Normal file
@@ -19,13 +19,16 @@ inherit
|
|||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
make_repeater (n: STRING; a_datasource: WSF_DATASOURCE [G])
|
make_repeater (n: STRING; a_datasource: WSF_DATASOURCE [G])
|
||||||
|
local
|
||||||
|
p: WSF_PAGINATION_CONTROL [G]
|
||||||
do
|
do
|
||||||
make_multi_control (n)
|
make_multi_control (n)
|
||||||
datasource := a_datasource
|
datasource := a_datasource
|
||||||
datasource.set_on_update_agent (agent update)
|
datasource.set_on_update_agent (agent update)
|
||||||
if attached {WSF_PAGABLE_DATASOURCE [G]} a_datasource as ds then
|
if attached {WSF_PAGABLE_DATASOURCE [G]} a_datasource as ds then
|
||||||
create pagination_control.make_paging (n + "_paging", ds)
|
create p.make_paging (n + "_paging", ds)
|
||||||
add_control (pagination_control)
|
add_control (p)
|
||||||
|
pagination_control := p
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -53,7 +56,6 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
|
|||||||
Result.put (datasource.state, "datasource")
|
Result.put (datasource.state, "datasource")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
feature -- Rendering
|
feature -- Rendering
|
||||||
|
|
||||||
render_item (item: G): STRING
|
render_item (item: G): STRING
|
||||||
|
|||||||
@@ -23,9 +23,12 @@ feature {NONE} -- Initialization
|
|||||||
--Initialize
|
--Initialize
|
||||||
do
|
do
|
||||||
make_multi_control (n)
|
make_multi_control (n)
|
||||||
|
active_set := false
|
||||||
add_class ("navbar navbar-inverse navbar-fixed-top")
|
add_class ("navbar navbar-inverse navbar-fixed-top")
|
||||||
create nav.make_with_tag_name (control_name + "_nav", "ul")
|
create nav.make_with_tag_name (control_name + "_nav", "ul")
|
||||||
|
create nav_right.make_with_tag_name (control_name + "_nav_right", "ul")
|
||||||
nav.add_class ("nav navbar-nav")
|
nav.add_class ("nav navbar-nav")
|
||||||
|
nav_right.add_class ("nav navbar-nav navbar-right")
|
||||||
end
|
end
|
||||||
|
|
||||||
make_navbar_with_brand (n, b: STRING)
|
make_navbar_with_brand (n, b: STRING)
|
||||||
@@ -43,16 +46,15 @@ feature -- Rendering
|
|||||||
nav_string: STRING
|
nav_string: STRING
|
||||||
do
|
do
|
||||||
temp := render_tag_with_tagname ("span", "", "", "icon-bar")
|
temp := render_tag_with_tagname ("span", "", "", "icon-bar")
|
||||||
temp.append (render_tag_with_tagname ("span", "", "", "icon-bar"))
|
temp.multiply (3)
|
||||||
temp.append (render_tag_with_tagname ("span", "", "", "icon-bar"))
|
|
||||||
temp := render_tag_with_tagname ("button", temp, "", "navbar-toggle")
|
temp := render_tag_with_tagname ("button", temp, "", "navbar-toggle")
|
||||||
if attached brand as b then
|
if attached brand as b then
|
||||||
temp.append (render_tag_with_tagname ("a", b, "href=%"#%"", "navbar-brand"))
|
temp.append (render_tag_with_tagname ("a", b, "href=%"#%"", "navbar-brand"))
|
||||||
end
|
end
|
||||||
temp := render_tag_with_tagname ("div", temp, "", "navbar-header")
|
temp := render_tag_with_tagname ("div", temp, "", "navbar-header")
|
||||||
nav_string := nav.render
|
nav_string := nav.render
|
||||||
if attached nav_right as n then
|
if nav_right.controls.count > 0 then
|
||||||
nav_string.append (n.render)
|
nav_string.append (nav_right.render)
|
||||||
end
|
end
|
||||||
temp.append (render_tag_with_tagname ("div", nav_string, "", "navbar-collapse"))
|
temp.append (render_tag_with_tagname ("div", nav_string, "", "navbar-collapse"))
|
||||||
Result := render_tag_with_tagname ("div", temp, "", "container")
|
Result := render_tag_with_tagname ("div", temp, "", "container")
|
||||||
@@ -61,46 +63,70 @@ feature -- Rendering
|
|||||||
|
|
||||||
feature -- Change
|
feature -- Change
|
||||||
|
|
||||||
add_list_element_right (c: WSF_STATELESS_CONTROL)
|
set_active (tab: INTEGER)
|
||||||
|
-- Sets the given tab as current active tab
|
||||||
|
require
|
||||||
|
tab >= 1 and tab <= tab_count and not active_set
|
||||||
|
do
|
||||||
|
if tab <= nav.controls.count then
|
||||||
|
nav.controls.i_th (tab).add_class ("active")
|
||||||
|
else
|
||||||
|
nav_right.controls.i_th (tab - nav.controls.count).add_class ("active")
|
||||||
|
end
|
||||||
|
active_set := true
|
||||||
|
end
|
||||||
|
|
||||||
|
add_dropdown (l: WSF_STATELESS_CONTROL; d: WSF_STATELESS_CONTROL)
|
||||||
|
-- Add dropdown menu (in li tag with class dropdown) to navbar
|
||||||
|
local
|
||||||
|
li: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
|
||||||
|
do
|
||||||
|
create li.make_with_tag_name (control_name + "_link" + nav.controls.count.out, "li")
|
||||||
|
li.add_class ("dropdown")
|
||||||
|
li.add_control (l)
|
||||||
|
li.add_control (d)
|
||||||
|
add_element (li)
|
||||||
|
end
|
||||||
|
|
||||||
|
add_dropdown_right (l: WSF_STATELESS_CONTROL; d: WSF_STATELESS_CONTROL)
|
||||||
|
-- Add dropdown menu (in li tag with class dropdown) to right aligned part of navbar
|
||||||
|
local
|
||||||
|
li: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
|
||||||
|
do
|
||||||
|
create li.make_with_tag_name (control_name + "_link" + nav.controls.count.out, "li")
|
||||||
|
li.add_class ("dropdown")
|
||||||
|
li.add_control (l)
|
||||||
|
li.add_control (d)
|
||||||
|
add_element_right (li)
|
||||||
|
end
|
||||||
|
|
||||||
|
add_list_element_right (l: WSF_STATELESS_CONTROL)
|
||||||
-- Add element in li tag to right aligned part of navbar
|
-- Add element in li tag to right aligned part of navbar
|
||||||
local
|
local
|
||||||
name: STRING
|
name: STRING
|
||||||
li: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
|
li: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
|
||||||
do
|
do
|
||||||
name := control_name + "_rightlink";
|
name := control_name + "_rightlink";
|
||||||
if attached nav_right as right then
|
name := name + nav_right.controls.count.out
|
||||||
name := name + right.controls.count.out
|
|
||||||
else
|
|
||||||
name := name + "0"
|
|
||||||
end
|
|
||||||
create li.make_with_tag_name (name, "li")
|
create li.make_with_tag_name (name, "li")
|
||||||
li.add_control (c)
|
li.add_control (l)
|
||||||
add_element_right (li)
|
add_element_right (li)
|
||||||
end
|
end
|
||||||
|
|
||||||
add_list_element (c: WSF_STATELESS_CONTROL)
|
add_list_element (l: WSF_STATELESS_CONTROL)
|
||||||
-- Add element in li tag to main nav
|
-- Add element in li tag to main nav
|
||||||
local
|
local
|
||||||
li: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
|
li: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
|
||||||
do
|
do
|
||||||
create li.make_with_tag_name (control_name + "_link" + nav.controls.count.out, "li")
|
create li.make_with_tag_name (control_name + "_link" + nav.controls.count.out, "li")
|
||||||
li.add_control (c)
|
li.add_control (l)
|
||||||
add_element (li)
|
add_element (li)
|
||||||
end
|
end
|
||||||
|
|
||||||
add_element_right (c: WSF_STATELESS_CONTROL)
|
add_element_right (c: WSF_STATELESS_CONTROL)
|
||||||
-- Add element to right aligned part of navbar
|
-- Add element to right aligned part of navbar
|
||||||
local
|
|
||||||
right: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
|
|
||||||
do
|
do
|
||||||
if attached nav_right as r then
|
nav_right.add_control (c)
|
||||||
right := r
|
|
||||||
else
|
|
||||||
create right.make_with_tag_name (control_name + "_rightnav", "ul")
|
|
||||||
right.add_class ("nav navbar-nav navbar-right")
|
|
||||||
nav_right := right
|
|
||||||
end
|
|
||||||
right.add_control (c)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
add_element (c: WSF_STATELESS_CONTROL)
|
add_element (c: WSF_STATELESS_CONTROL)
|
||||||
@@ -109,15 +135,26 @@ feature -- Change
|
|||||||
nav.add_control (c)
|
nav.add_control (c)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
feature -- Access
|
||||||
|
|
||||||
|
tab_count: INTEGER
|
||||||
|
-- Current sum of the number of items in left and right navbar
|
||||||
|
do
|
||||||
|
Result := nav.controls.count + nav_right.controls.count
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Properties
|
feature -- Properties
|
||||||
|
|
||||||
|
active_set: BOOLEAN
|
||||||
|
-- This flag is set once a tab has been set as active tab
|
||||||
|
|
||||||
brand: detachable STRING
|
brand: detachable STRING
|
||||||
-- Optional brand of the navbar
|
-- Optional brand of the navbar
|
||||||
|
|
||||||
nav: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
|
nav: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
|
||||||
-- Middle nav
|
-- Middle nav
|
||||||
|
|
||||||
nav_right: detachable WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
|
nav_right: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
|
||||||
-- Right nav
|
-- Right nav
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ feature {NONE} -- Initialization
|
|||||||
do
|
do
|
||||||
make_control (n, "div")
|
make_control (n, "div")
|
||||||
add_class ("carousel slide")
|
add_class ("carousel slide")
|
||||||
create list.make_with_tag_name (control_name+"_links", "ol")
|
create list.make_with_tag_name (control_name + "_links", "ol")
|
||||||
list.add_class ("carousel-indicators")
|
list.add_class ("carousel-indicators")
|
||||||
create slide_wrapper.make_multi_control (control_name+"_wrapper")
|
create slide_wrapper.make_multi_control (control_name + "_wrapper")
|
||||||
slide_wrapper.add_class ("carousel-inner")
|
slide_wrapper.add_class ("carousel-inner")
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -53,45 +53,62 @@ feature -- Rendering
|
|||||||
do
|
do
|
||||||
temp := list.render
|
temp := list.render
|
||||||
temp.append (slide_wrapper.render)
|
temp.append (slide_wrapper.render)
|
||||||
temp.append (render_tag_with_tagname ("a", "<span class=%"icon-prev%"></span>", "href=%"#" + control_name + "%" data-slide=%"next%"", "left carousel-control"))
|
temp.append (render_tag_with_tagname ("a", "<span class=%"icon-prev%"></span>", "href=%"#" + control_name + "%" data-slide=%"prev%"", "left carousel-control"))
|
||||||
temp.append (render_tag_with_tagname ("a", "<span class=%"icon-next%"></span>", "href=%"#" + control_name + "%" data-slide=%"prev%"", "right carousel-control"))
|
temp.append (render_tag_with_tagname ("a", "<span class=%"icon-next%"></span>", "href=%"#" + control_name + "%" data-slide=%"next%"", "right carousel-control"))
|
||||||
Result := render_tag (temp, "")
|
Result := render_tag (temp, "")
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Change
|
feature -- Change
|
||||||
|
|
||||||
add_image_with_caption (src, alt: STRING; caption: detachable WSF_STATELESS_CONTROL)
|
add_image_with_caption (src, alt, caption: STRING)
|
||||||
-- Add a new image to the slider, with specified url, alternative text and caption element
|
|
||||||
local
|
local
|
||||||
item: WSF_MULTI_CONTROL[WSF_STATELESS_CONTROL]
|
caption_control: detachable WSF_STATELESS_CONTROL
|
||||||
do
|
do
|
||||||
list.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("li", "data-target=%"#" + control_name + "%" data-slide-to=%"" + list.controls.count.out + "%"", ""));
|
if attached caption as c and then not c.is_empty then
|
||||||
create item.make_multi_control (control_name+"_item"+slide_wrapper.controls.count.out)
|
caption_control := create {WSF_BASIC_CONTROL}.make_with_body ("p", "", c)
|
||||||
item.add_class ("item")
|
|
||||||
item.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("img", "src=%"" + src + "%" alt=%"" + alt + "%"", ""))
|
|
||||||
if attached caption as c then
|
|
||||||
item.add_control (c)
|
|
||||||
end
|
end
|
||||||
slide_wrapper.add_control (item)
|
add_image_with_caption_control (src, alt, caption_control)
|
||||||
|
end
|
||||||
|
|
||||||
|
add_image_with_caption_control (src, alt: STRING; 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
|
end
|
||||||
|
|
||||||
add_image (src, alt: STRING)
|
add_image (src, alt: STRING)
|
||||||
-- 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, Void)
|
add_image_with_caption (src, alt, "")
|
||||||
end
|
end
|
||||||
|
|
||||||
add_control(c:WSF_STATELESS_CONTROL)
|
add_control (c: WSF_STATELESS_CONTROL; caption: detachable WSF_STATELESS_CONTROL)
|
||||||
do
|
-- Add a new control to the slider
|
||||||
|
local
|
||||||
end
|
cl: STRING
|
||||||
|
item: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
|
||||||
|
do
|
||||||
|
create item.make_multi_control (control_name + "_item" + slide_wrapper.controls.count.out)
|
||||||
|
item.add_class ("item")
|
||||||
|
item.add_control (c)
|
||||||
|
if attached caption as capt then
|
||||||
|
item.add_control (capt)
|
||||||
|
end
|
||||||
|
cl := ""
|
||||||
|
if slide_wrapper.controls.count = 0 then
|
||||||
|
cl := "active"
|
||||||
|
item.add_class (cl)
|
||||||
|
end
|
||||||
|
slide_wrapper.add_control (item)
|
||||||
|
list.add_control (create {WSF_BASIC_CONTROL}.make_with_body_class ("li", "data-target=%"#" + control_name + "%" data-slide-to=%"" + list.controls.count.out + "%"", cl, ""));
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Properties
|
feature -- Properties
|
||||||
|
|
||||||
list: WSF_MULTI_CONTROL[WSF_STATELESS_CONTROL]
|
list: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
|
||||||
-- List of slider links
|
-- List of slider links
|
||||||
|
|
||||||
slide_wrapper: WSF_MULTI_CONTROL[WSF_STATELESS_CONTROL]
|
slide_wrapper: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
|
||||||
-- List of the single slides
|
-- List of the single slides
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -15,14 +15,14 @@ inherit
|
|||||||
end
|
end
|
||||||
|
|
||||||
create
|
create
|
||||||
make_control, make_with_body
|
make_control, make_with_body, make_with_body_class
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
make_control (t: STRING)
|
make_control (t: STRING)
|
||||||
-- Initialize
|
-- Initialize
|
||||||
do
|
do
|
||||||
make_with_body (t, "", "")
|
make_with_body_class (t, "", "", "")
|
||||||
end
|
end
|
||||||
|
|
||||||
make_with_body (t, attr, b: STRING)
|
make_with_body (t, attr, b: STRING)
|
||||||
@@ -33,6 +33,15 @@ feature {NONE} -- Initialization
|
|||||||
body := b
|
body := b
|
||||||
end
|
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
|
feature -- Rendering
|
||||||
|
|
||||||
render: STRING
|
render: STRING
|
||||||
|
|||||||
@@ -14,11 +14,6 @@ inherit
|
|||||||
render_tag
|
render_tag
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
feature
|
|
||||||
|
|
||||||
control_name: STRING
|
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
make_control (n, a_tag_name: STRING)
|
make_control (n, a_tag_name: STRING)
|
||||||
@@ -37,10 +32,10 @@ feature {NONE} -- Initialization
|
|||||||
|
|
||||||
feature -- Actions
|
feature -- Actions
|
||||||
|
|
||||||
start_modal(url:STRING; title:STRING)
|
start_modal (url: STRING; title: STRING)
|
||||||
--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
|
||||||
do
|
do
|
||||||
create modal.make
|
create modal.make
|
||||||
modal.put_string ("start_modal", "type")
|
modal.put_string ("start_modal", "type")
|
||||||
@@ -49,10 +44,10 @@ feature -- Actions
|
|||||||
actions.add (modal)
|
actions.add (modal)
|
||||||
end
|
end
|
||||||
|
|
||||||
start_modal_big(url:STRING; title:STRING)
|
start_modal_big (url: STRING; title: STRING)
|
||||||
--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
|
||||||
do
|
do
|
||||||
create modal.make
|
create modal.make
|
||||||
modal.put_string ("start_modal_big", "type")
|
modal.put_string ("start_modal_big", "type")
|
||||||
@@ -61,10 +56,10 @@ feature -- Actions
|
|||||||
actions.add (modal)
|
actions.add (modal)
|
||||||
end
|
end
|
||||||
|
|
||||||
show_alert(mesage:STRING)
|
show_alert (mesage: STRING)
|
||||||
--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
|
||||||
do
|
do
|
||||||
create modal.make
|
create modal.make
|
||||||
modal.put_string ("show_alert", "type")
|
modal.put_string ("show_alert", "type")
|
||||||
@@ -72,7 +67,7 @@ feature -- Actions
|
|||||||
actions.add (modal)
|
actions.add (modal)
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT
|
feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
|
||||||
|
|
||||||
load_state (new_states: JSON_OBJECT)
|
load_state (new_states: JSON_OBJECT)
|
||||||
-- Select state stored with `control_name` as key
|
-- Select state stored with `control_name` as key
|
||||||
@@ -102,9 +97,9 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT
|
|||||||
end
|
end
|
||||||
if actions.count > 0 then
|
if actions.count > 0 then
|
||||||
if not attached states.item ("actions") 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
|
end
|
||||||
if attached {JSON_ARRAY}states.item ("actions") as action_list then
|
if attached {JSON_ARRAY} states.item ("actions") as action_list then
|
||||||
across
|
across
|
||||||
actions.array_representation as action
|
actions.array_representation as action
|
||||||
loop
|
loop
|
||||||
@@ -150,17 +145,18 @@ 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
|
||||||
|
|
||||||
feature -- EVENT HANDLING
|
feature -- Event handling
|
||||||
|
|
||||||
handle_callback (cname: STRING; event: STRING; event_parameter: detachable STRING)
|
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
|
-- Method called if any callback received. In this method you can route the callback to the event handler
|
||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Change
|
feature -- Change
|
||||||
|
|
||||||
set_isolation (p: BOOLEAN)
|
set_isolation (p: BOOLEAN)
|
||||||
do
|
do
|
||||||
isolate := true
|
isolate := p
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Properties
|
feature -- Properties
|
||||||
@@ -168,4 +164,7 @@ feature -- Properties
|
|||||||
isolate: BOOLEAN
|
isolate: BOOLEAN
|
||||||
|
|
||||||
actions: JSON_ARRAY
|
actions: JSON_ARRAY
|
||||||
|
|
||||||
|
control_name: STRING
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -120,19 +120,17 @@ feature -- Rendering
|
|||||||
across
|
across
|
||||||
controls as c
|
controls as c
|
||||||
loop
|
loop
|
||||||
Result := c.item.render + Result
|
Result := Result + c.item.render
|
||||||
end
|
end
|
||||||
Result := render_tag (Result, "")
|
Result := render_tag (Result, "")
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Change
|
feature -- Change
|
||||||
|
|
||||||
add_control (c: detachable G)
|
add_control (c: G)
|
||||||
-- Add a control to this multi control
|
-- Add a control to this multi control
|
||||||
do
|
do
|
||||||
if attached c as d then
|
controls.extend (c)
|
||||||
controls.put_front (d)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Properties
|
feature -- Properties
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ feature -- Access
|
|||||||
-- List of classes (appear in the "class" attribute)
|
-- List of classes (appear in the "class" attribute)
|
||||||
|
|
||||||
attributes: detachable STRING
|
attributes: detachable STRING
|
||||||
-- Attributes string
|
-- Attributes string (without classes)
|
||||||
|
|
||||||
feature -- Change
|
feature -- Change
|
||||||
|
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ feature -- Execution
|
|||||||
|
|
||||||
slider_demo (request: WSF_REQUEST; response: WSF_RESPONSE)
|
slider_demo (request: WSF_REQUEST; response: WSF_RESPONSE)
|
||||||
local
|
local
|
||||||
page: IMAGE_SLIDER_PAGE
|
page: SLIDER_PAGE
|
||||||
do
|
do
|
||||||
-- To send a response we need to setup, the status code and
|
-- To send a response we need to setup, the status code and
|
||||||
-- the response headers.
|
-- the response headers.
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ feature
|
|||||||
|
|
||||||
initialize_controls
|
initialize_controls
|
||||||
local
|
local
|
||||||
navbar: WSF_NAVBAR_CONTROL
|
|
||||||
btn: WSF_BUTTON_CONTROL
|
btn: WSF_BUTTON_CONTROL
|
||||||
do
|
do
|
||||||
create control.make_multi_control ("container")
|
create control.make_multi_control ("container")
|
||||||
@@ -27,7 +26,8 @@ feature
|
|||||||
navbar.add_list_element (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/%"", "Home"))
|
navbar.add_list_element (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/%"", "Home"))
|
||||||
navbar.add_list_element (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/grid%"", "Grid"))
|
navbar.add_list_element (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/grid%"", "Grid"))
|
||||||
navbar.add_list_element (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/repeater%"", "Repeater"))
|
navbar.add_list_element (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/repeater%"", "Repeater"))
|
||||||
navbar.add_list_element (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/slider%"", "Image Slider"))
|
navbar.add_list_element (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/slider%"", "Slider"))
|
||||||
|
navbar.add_list_element_right (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/about%"", "About"))
|
||||||
create btn.make_button ("scode", "Show Code")
|
create btn.make_button ("scode", "Show Code")
|
||||||
btn.set_click_event (agent show_code)
|
btn.set_click_event (agent show_code)
|
||||||
btn.set_isolation (true)
|
btn.set_isolation (true)
|
||||||
@@ -47,4 +47,6 @@ feature
|
|||||||
|
|
||||||
control: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
|
control: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
|
||||||
|
|
||||||
|
navbar: WSF_NAVBAR_CONTROL
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ class
|
|||||||
inherit
|
inherit
|
||||||
|
|
||||||
BASE_PAGE
|
BASE_PAGE
|
||||||
redefine
|
redefine
|
||||||
initialize_controls
|
initialize_controls
|
||||||
end
|
end
|
||||||
|
|
||||||
create
|
create
|
||||||
make
|
make
|
||||||
@@ -22,16 +22,16 @@ feature
|
|||||||
initialize_controls
|
initialize_controls
|
||||||
do
|
do
|
||||||
Precursor
|
Precursor
|
||||||
control.add_control (create {WSF_BASIC_CONTROL}.make_with_body("h1","","Grid Demo"))
|
control.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h1", "", "Grid Demo"))
|
||||||
create datasource.make_news
|
create datasource.make_news
|
||||||
create search_query.make_autocomplete ("query", create {GOOGLE_AUTOCOMPLETION}.make)
|
create search_query.make_autocomplete ("query", create {GOOGLE_AUTOCOMPLETION}.make)
|
||||||
search_query.add_class ("form-control")
|
search_query.add_class ("form-control")
|
||||||
search_query.set_change_event (agent change_query)
|
search_query.set_change_event (agent change_query)
|
||||||
control.add_control (search_query)
|
control.add_control (search_query)
|
||||||
control.add_control (create {WSF_BASIC_CONTROL}.make_with_body("h2","","Results"))
|
control.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h2", "", "Results"))
|
||||||
create grid.make_grid ("mygrid", <<create {WSF_GRID_COLUMN}.make ("Title", "title"),
|
create grid.make_grid ("mygrid", <<create {WSF_GRID_COLUMN}.make ("Title", "title"), create {WSF_GRID_COLUMN}.make ("Content", "content")>>, datasource)
|
||||||
create {WSF_GRID_COLUMN}.make ("Content", "content")>>, datasource)
|
|
||||||
control.add_control (grid)
|
control.add_control (grid)
|
||||||
|
navbar.set_active (2)
|
||||||
end
|
end
|
||||||
|
|
||||||
change_query
|
change_query
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ note
|
|||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
class
|
class
|
||||||
IMAGE_SLIDER_PAGE
|
SLIDER_PAGE
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
|
|
||||||
@@ -20,12 +20,20 @@ create
|
|||||||
feature -- Implementation
|
feature -- Implementation
|
||||||
|
|
||||||
initialize_controls
|
initialize_controls
|
||||||
|
local
|
||||||
|
form: WSF_FORM_CONTROL
|
||||||
do
|
do
|
||||||
Precursor
|
Precursor
|
||||||
create slider.make_slider ("myslider")
|
create slider.make_slider ("myslider")
|
||||||
|
create form.make_form_control ("sliderform")
|
||||||
|
form.add_control (create {WSF_FORM_ELEMENT_CONTROL[STRING]}.make_form_element ("Input", create {WSF_INPUT_CONTROL}.make_input ("sliderformtext", "Test")))
|
||||||
|
slider.add_control (form, Void)
|
||||||
slider.add_image ("http://www.placesmustseen.com/wp-content/uploads/2013/01/paris-eiffel-tower.jpg", "Eiffel Tower")
|
slider.add_image ("http://www.placesmustseen.com/wp-content/uploads/2013/01/paris-eiffel-tower.jpg", "Eiffel Tower")
|
||||||
|
slider.add_image ("http://24.media.tumblr.com/0fcec9a7dde5b405a46b6fcda1ffad0c/tumblr_mtagkyYVIT1st5lhmo1_1280.jpg", "car")
|
||||||
|
slider.add_image ("http://25.media.tumblr.com/d9e791508eb9a532aa7f258fa4e0fedc/tumblr_mtag5zve3g1st5lhmo1_1280.jpg", "landscape")
|
||||||
control.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h1", "", " Image Slider Demo"))
|
control.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h1", "", " Image Slider Demo"))
|
||||||
control.add_control (slider)
|
control.add_control (slider)
|
||||||
|
navbar.set_active (4)
|
||||||
end
|
end
|
||||||
|
|
||||||
process
|
process
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ feature
|
|||||||
control.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h2", "", "Results"))
|
control.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h2", "", "Results"))
|
||||||
create repeater.make_repeater ("myrepeater", datasource)
|
create repeater.make_repeater ("myrepeater", datasource)
|
||||||
control.add_control (repeater)
|
control.add_control (repeater)
|
||||||
|
navbar.set_active (3)
|
||||||
end
|
end
|
||||||
|
|
||||||
change_query
|
change_query
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ feature
|
|||||||
source.set_control (progress)
|
source.set_control (progress)
|
||||||
progress.set_isolation (true)
|
progress.set_isolation (true)
|
||||||
control.add_control (progress)
|
control.add_control (progress)
|
||||||
|
navbar.set_active (1)
|
||||||
end
|
end
|
||||||
|
|
||||||
handle_click
|
handle_click
|
||||||
|
|||||||
0
tools/build_archive.sh
Executable file → Normal file
0
tools/build_archive.sh
Executable file → Normal file
0
tools/ise_wizard/install_ise_wizard.sh
Executable file → Normal file
0
tools/ise_wizard/install_ise_wizard.sh
Executable file → Normal file
0
tools/ise_wizard/install_ise_wizard_custom.sh
Executable file → Normal file
0
tools/ise_wizard/install_ise_wizard_custom.sh
Executable file → Normal file
Reference in New Issue
Block a user