Class: Nice::Js::Caller
- Inherits:
-
Object
- Object
- Nice::Js::Caller
- Defined in:
- lib/nice/js/caller.rb
Class Method Summary collapse
-
.change_top_css(new_state_name) ⇒ Object
Change Body Css Class to reflect current state.
- .clean_root_tree ⇒ Object
-
.generate_js_insert_after(new_node, reference_node_ref) ⇒ Object
DOM Manipulation.
- .generate_js_insert_inside(new_node, reference_node_ref) ⇒ Object
- .generate_js_remove(curr_state) ⇒ Object
- .insert_or_update_back_listener(url) ⇒ Object
-
.move_to_url(url, title) ⇒ Object
History Manipulation.
- .replace_node(new_node, reference_node_ref) ⇒ Object
-
.state_did_change(prev_state, new_state) ⇒ Object
events for UI.
Class Method Details
.change_top_css(new_state_name) ⇒ Object
Change Body Css Class to reflect current state
42 43 44 |
# File 'lib/nice/js/caller.rb', line 42 def self.change_top_css new_state_name "NiceEventDispatcher.dispatch_event(\'nice.dom.ChangeTopCssEvent\',{new_state_name:\'#{new_state_name}\'});" end |
.clean_root_tree ⇒ Object
22 23 24 |
# File 'lib/nice/js/caller.rb', line 22 def self.clean_root_tree "NiceEventDispatcher.dispatch_event(\'nice.dom.CleanRootEvent\',{});" end |
.generate_js_insert_after(new_node, reference_node_ref) ⇒ Object
DOM Manipulation
6 7 8 |
# File 'lib/nice/js/caller.rb', line 6 def self.generate_js_insert_after new_node, reference_node_ref "NiceEventDispatcher.dispatch_event(\'nice.dom.InsertAfterEvent\',{new_node:\'#{new_node}\', ref_node:\"#{reference_node_ref}\"});" end |
.generate_js_insert_inside(new_node, reference_node_ref) ⇒ Object
10 11 12 |
# File 'lib/nice/js/caller.rb', line 10 def self.generate_js_insert_inside new_node, reference_node_ref "NiceEventDispatcher.dispatch_event(\'nice.dom.InsertInsideEvent\',{new_node:\'#{new_node}\', ref_node:\"#{reference_node_ref}\"});" end |
.generate_js_remove(curr_state) ⇒ Object
18 19 20 |
# File 'lib/nice/js/caller.rb', line 18 def self.generate_js_remove curr_state "NiceEventDispatcher.dispatch_event(\'nice.dom.RemoveStateEvent\',{curr_state:\'#{curr_state}\'});" end |
.insert_or_update_back_listener(url) ⇒ Object
32 33 34 |
# File 'lib/nice/js/caller.rb', line 32 def self.insert_or_update_back_listener url "NiceEventDispatcher.dispatch_event(\'nice.hist.PopHistoryEvent\',{url:\'#{url}\'});" end |
.move_to_url(url, title) ⇒ Object
History Manipulation
28 29 30 |
# File 'lib/nice/js/caller.rb', line 28 def self.move_to_url url, title "NiceEventDispatcher.dispatch_event(\'nice.hist.ChangeURLEvent\',{url:\'#{url}\', title:\'#{title}\'});" end |
.replace_node(new_node, reference_node_ref) ⇒ Object
14 15 16 |
# File 'lib/nice/js/caller.rb', line 14 def self.replace_node new_node, reference_node_ref "NiceEventDispatcher.dispatch_event(\'nice.dom.ReplaceEvent\',{new_node:\'#{new_node}\', ref_node:\"#{reference_node_ref}\"});" end |
.state_did_change(prev_state, new_state) ⇒ Object
events for UI
37 38 39 |
# File 'lib/nice/js/caller.rb', line 37 def self.state_did_change prev_state, new_state "NiceEventDispatcher.dispatch_event(\'nice.ui.StateDidChangeEvent\',{prev_state:\'#{prev_state}\', new_state:\"#{new_state}\"});" end |