Updated code to remove obsolete call on recent version of json library.
Updated upload_image example to use PATH instead of DIRECTORY_NAME or similar. Removed unused local variables.
This commit is contained in:
@@ -35,7 +35,7 @@ feature -- Implementation
|
||||
l_lowered_input: READABLE_STRING_GENERAL
|
||||
l_lowered_item: READABLE_STRING_GENERAL
|
||||
do
|
||||
create Result.make_array
|
||||
create Result.make_empty
|
||||
l_lowered_input := a_input.as_lower
|
||||
across
|
||||
list as c
|
||||
@@ -50,7 +50,7 @@ feature -- Implementation
|
||||
end
|
||||
|
||||
;note
|
||||
copyright: "2011-2014, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
|
||||
copyright: "2011-2015, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
|
||||
@@ -43,7 +43,7 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
|
||||
update
|
||||
-- Send new renederd control to client on update
|
||||
do
|
||||
state_changes.replace (create {JSON_STRING}.make_json_from_string_32 (render), "_html")
|
||||
state_changes.replace (create {JSON_STRING}.make_from_string_32 (render), "_html")
|
||||
end
|
||||
|
||||
feature --Event handling
|
||||
@@ -100,7 +100,7 @@ feature -- Properties
|
||||
datasource: WSF_PAGABLE_DATASOURCE [G]
|
||||
|
||||
;note
|
||||
copyright: "2011-2014, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
|
||||
copyright: "2011-2015, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
|
||||
@@ -39,7 +39,7 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
|
||||
update
|
||||
-- Send new rendered control to client on update
|
||||
do
|
||||
state_changes.replace (create {JSON_STRING}.make_json_from_string_32 (render_body), "_body")
|
||||
state_changes.replace (create {JSON_STRING}.make_from_string_32 (render_body), "_body")
|
||||
state_changes.replace (datasource.state, "datasource")
|
||||
end
|
||||
|
||||
@@ -100,7 +100,7 @@ feature -- Access
|
||||
pagination_control: detachable WSF_PAGINATION_CONTROL [G]
|
||||
|
||||
;note
|
||||
copyright: "2011-2014, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
|
||||
copyright: "2011-2015, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
|
||||
@@ -100,7 +100,7 @@ feature -- Change
|
||||
do
|
||||
if not t.same_string (text) then
|
||||
text := t
|
||||
state_changes.replace (create {JSON_STRING}.make_json_from_string_32 (t), "text")
|
||||
state_changes.replace (create {JSON_STRING}.make_from_string_32 (t), "text")
|
||||
end
|
||||
ensure
|
||||
text_same_string_as_t: text.same_string (t)
|
||||
@@ -160,7 +160,7 @@ feature -- Properties
|
||||
-- Procedure to be execued on change
|
||||
|
||||
;note
|
||||
copyright: "2011-2014, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
|
||||
copyright: "2011-2015, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
|
||||
@@ -65,7 +65,7 @@ feature -- Change
|
||||
else
|
||||
remove_class ("active")
|
||||
end
|
||||
state_changes.replace (create {JSON_BOOLEAN}.make_boolean (a), "active")
|
||||
state_changes.replace (create {JSON_BOOLEAN}.make (a), "active")
|
||||
end
|
||||
ensure
|
||||
active_set: active = a
|
||||
@@ -77,4 +77,14 @@ feature -- Properties
|
||||
active: BOOLEAN
|
||||
-- The active state of this item
|
||||
|
||||
;note
|
||||
copyright: "2011-2015, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
5949 Hollister Ave., Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
end
|
||||
|
||||
@@ -28,7 +28,7 @@ feature {NONE} -- Initialization
|
||||
make_stateless_control (a_tag_name)
|
||||
create control_name_prefix.make_empty
|
||||
create state_changes.make
|
||||
create actions.make_array
|
||||
create actions.make_empty
|
||||
ensure
|
||||
state_changes_attached: attached state_changes
|
||||
end
|
||||
@@ -110,7 +110,7 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
|
||||
end
|
||||
if actions.count > 0 then
|
||||
if states.item ("actions") = Void then
|
||||
states.put (create {JSON_ARRAY}.make_array, "actions")
|
||||
states.put (create {JSON_ARRAY}.make_empty, "actions")
|
||||
end
|
||||
if attached {JSON_ARRAY} states.item ("actions") as action_list then
|
||||
across
|
||||
@@ -223,7 +223,7 @@ feature -- Properties
|
||||
-- control state and therefore could have the same name (Stateless multi controls do not add a hierarchy level)
|
||||
|
||||
;note
|
||||
copyright: "2011-2014, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
|
||||
copyright: "2011-2015, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
|
||||
@@ -29,7 +29,7 @@ feature {NONE} -- Initialization
|
||||
-- Initialize with specified tag
|
||||
do
|
||||
Precursor (tag)
|
||||
create items.make_array
|
||||
create items.make_empty
|
||||
create pending_removes.make (1)
|
||||
ensure then
|
||||
tag_set: tag_name.same_string (tag)
|
||||
@@ -194,7 +194,7 @@ invariant
|
||||
all_items_exist: items.count = controls.count
|
||||
|
||||
note
|
||||
copyright: "2011-2014, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
|
||||
copyright: "2011-2015, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
|
||||
@@ -148,7 +148,7 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
|
||||
validator_description: JSON_ARRAY
|
||||
do
|
||||
create Result.make
|
||||
create validator_description.make_array
|
||||
create validator_description.make_empty
|
||||
across
|
||||
validators as v
|
||||
loop
|
||||
@@ -209,7 +209,7 @@ feature -- Validation
|
||||
-- Set the error message that will be displayed upon failure of client side validation
|
||||
do
|
||||
error := e
|
||||
state_changes.replace (create {JSON_STRING}.make_json_from_string_32 (e), "error")
|
||||
state_changes.replace (create {JSON_STRING}.make_from_string_32 (e), "error")
|
||||
ensure
|
||||
error_set: error.same_string (e)
|
||||
end
|
||||
@@ -257,7 +257,7 @@ feature -- Properties
|
||||
-- The bootstrap column span of the label of this form element control
|
||||
|
||||
;note
|
||||
copyright: "2011-2014, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
|
||||
copyright: "2011-2015, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
|
||||
@@ -83,14 +83,22 @@ feature -- Implementation
|
||||
if not event.same_string_general ("uploadfile") then
|
||||
create states.make_empty
|
||||
request.read_input_data_into (states)
|
||||
create json_parser.make_parser (states)
|
||||
if attached {JSON_OBJECT} json_parser.parse_json as sp then
|
||||
create json_parser.make_with_string (states)
|
||||
json_parser.parse_content
|
||||
if
|
||||
json_parser.is_valid and then
|
||||
attached {JSON_OBJECT} json_parser.parsed_json_value as sp
|
||||
then
|
||||
set_state (sp)
|
||||
end
|
||||
else
|
||||
if attached request.form_parameter ("state") as statedata then
|
||||
create json_parser.make_parser (statedata.as_string.value)
|
||||
if attached {JSON_OBJECT} json_parser.parse_json as sp then
|
||||
create json_parser.make_with_string (statedata.as_string.value)
|
||||
json_parser.parse_content
|
||||
if
|
||||
json_parser.is_valid and then
|
||||
attached {JSON_OBJECT} json_parser.parsed_json_value as sp
|
||||
then
|
||||
set_state (sp)
|
||||
end
|
||||
end
|
||||
@@ -259,7 +267,7 @@ feature {NONE} -- Root control
|
||||
-- List containing the additional javascipt files
|
||||
|
||||
;note
|
||||
copyright: "2011-2014, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
|
||||
copyright: "2011-2015, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
|
||||
Reference in New Issue
Block a user