Add javascript function
This commit is contained in:
@@ -142,6 +142,16 @@ feature -- Implementation
|
|||||||
Result.append ("<script src=%"")
|
Result.append ("<script src=%"")
|
||||||
Result.append (base_path)
|
Result.append (base_path)
|
||||||
Result.append ("assets/widget.js%"></script>")
|
Result.append ("assets/widget.js%"></script>")
|
||||||
|
if attached additional_javascripts as ajs then
|
||||||
|
across
|
||||||
|
ajs as js
|
||||||
|
loop
|
||||||
|
Result.append ("<script src=%"")
|
||||||
|
Result.append (base_path)
|
||||||
|
Result.append (js.item)
|
||||||
|
Result.append ("%"></script>")
|
||||||
|
end
|
||||||
|
end
|
||||||
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>")
|
||||||
@@ -149,6 +159,16 @@ feature -- Implementation
|
|||||||
else
|
else
|
||||||
Result.append ("<div data-name=%"" + control_name + "%" data-type=%"WSF_PAGE_CONTROL%">")
|
Result.append ("<div data-name=%"" + control_name + "%" data-type=%"WSF_PAGE_CONTROL%">")
|
||||||
Result.append (control.render)
|
Result.append (control.render)
|
||||||
|
if attached additional_javascripts as ajs then
|
||||||
|
across
|
||||||
|
ajs as js
|
||||||
|
loop
|
||||||
|
Result.append ("<script src=%"")
|
||||||
|
Result.append (base_path)
|
||||||
|
Result.append (js.item)
|
||||||
|
Result.append ("%"></script>")
|
||||||
|
end
|
||||||
|
end
|
||||||
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>")
|
||||||
@@ -175,6 +195,19 @@ feature -- Implementation
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_javascript (path: STRING_32)
|
||||||
|
local
|
||||||
|
ajs: attached like additional_javascripts
|
||||||
|
do
|
||||||
|
if attached additional_javascripts as aajs then
|
||||||
|
ajs := aajs
|
||||||
|
else
|
||||||
|
create ajs.make (1)
|
||||||
|
end
|
||||||
|
ajs.extend (path)
|
||||||
|
additional_javascripts := ajs
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Event handling
|
feature -- Event handling
|
||||||
|
|
||||||
handle_callback (cname: LIST [STRING_32]; event: STRING_32; event_parameter: detachable ANY)
|
handle_callback (cname: LIST [STRING_32]; event: STRING_32; event_parameter: detachable ANY)
|
||||||
@@ -226,4 +259,7 @@ feature {NONE} -- Root control
|
|||||||
control: WSF_CONTROL
|
control: WSF_CONTROL
|
||||||
-- The root control of this page
|
-- The root control of this page
|
||||||
|
|
||||||
|
additional_javascripts: detachable ARRAYED_LIST [STRING_32]
|
||||||
|
-- List containing the additional javascipt files
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user