Class: RaveEmbed::WavePanel
- Includes:
- ClassLevelInheritableAttributes
- Defined in:
- lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/wave_panel.rb
Instance Attribute Summary collapse
-
#bg_color ⇒ Object
Returns the value of attribute bg_color.
-
#color ⇒ Object
Returns the value of attribute color.
-
#dom_id ⇒ Object
Returns the value of attribute dom_id.
-
#font ⇒ Object
Returns the value of attribute font.
-
#font_size ⇒ Object
Returns the value of attribute font_size.
-
#height ⇒ Object
Returns the value of attribute height.
-
#is_public ⇒ Object
Returns the value of attribute is_public.
-
#jquery ⇒ Object
Returns the value of attribute jquery.
-
#participants ⇒ Object
Returns the value of attribute participants.
-
#root_url ⇒ Object
Returns the value of attribute root_url.
-
#wave_id ⇒ Object
Returns the value of attribute wave_id.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(wave_id_str, opts = {}) ⇒ WavePanel
constructor
A new instance of WavePanel.
- #to_html ⇒ Object
Methods included from ClassLevelInheritableAttributes
Constructor Details
#initialize(wave_id_str, opts = {}) ⇒ WavePanel
Returns a new instance of WavePanel.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/wave_panel.rb', line 21 def initialize(wave_id_str, opts = {}) @wave_id = wave_id_str @dom_id = opts[:dom_id] || WavePanel.g_dom_id @root_url = opts[:root_url] || WavePanel.g_root_url @bg_color = opts[:bg_color] || WavePanel.g_bg_color @color = opts[:color] || WavePanel.g_color @font = opts[:font] || WavePanel.g_font @font_size = opts[:font_size] || WavePanel.g_font_size @height = opts[:height] || WavePanel.g_height @width = opts[:width] || WavePanel.g_width @jquery = opts[:jquery] || WavePanel.g_jquery @is_public = if opts[:is_public].nil? WavePanel.g_is_public else opts[:is_public] ? true : false end @participants = opts[:participants] || [] validate end |
Instance Attribute Details
#bg_color ⇒ Object
Returns the value of attribute bg_color.
18 19 20 |
# File 'lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/wave_panel.rb', line 18 def bg_color @bg_color end |
#color ⇒ Object
Returns the value of attribute color.
18 19 20 |
# File 'lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/wave_panel.rb', line 18 def color @color end |
#dom_id ⇒ Object
Returns the value of attribute dom_id.
18 19 20 |
# File 'lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/wave_panel.rb', line 18 def dom_id @dom_id end |
#font ⇒ Object
Returns the value of attribute font.
18 19 20 |
# File 'lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/wave_panel.rb', line 18 def font @font end |
#font_size ⇒ Object
Returns the value of attribute font_size.
18 19 20 |
# File 'lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/wave_panel.rb', line 18 def font_size @font_size end |
#height ⇒ Object
Returns the value of attribute height.
18 19 20 |
# File 'lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/wave_panel.rb', line 18 def height @height end |
#is_public ⇒ Object
Returns the value of attribute is_public.
18 19 20 |
# File 'lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/wave_panel.rb', line 18 def is_public @is_public end |
#jquery ⇒ Object
Returns the value of attribute jquery.
18 19 20 |
# File 'lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/wave_panel.rb', line 18 def jquery @jquery end |
#participants ⇒ Object
Returns the value of attribute participants.
18 19 20 |
# File 'lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/wave_panel.rb', line 18 def participants @participants end |
#root_url ⇒ Object
Returns the value of attribute root_url.
18 19 20 |
# File 'lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/wave_panel.rb', line 18 def root_url @root_url end |
#wave_id ⇒ Object
Returns the value of attribute wave_id.
18 19 20 |
# File 'lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/wave_panel.rb', line 18 def wave_id @wave_id end |
#width ⇒ Object
Returns the value of attribute width.
18 19 20 |
# File 'lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/wave_panel.rb', line 18 def width @width end |
Instance Method Details
#to_html ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/six-updater-web/vendor/plugins/rave_embed/lib/rave_embed/wave_panel.rb', line 51 def to_html html = "<div id='#{dom_id}'" unless width.blank? and height.blank? styles = [] styles << "width:#{width}" unless width.blank? styles << "height:#{height}" unless height.blank? html << " style='#{styles.join(";")}'" end html << "></div>\n" html << "<script type='text/javascript'>\ngoogle.load(\"wave\", \"1\"); google.setOnLoadCallback(function() { new google.wave.WavePanel({target: document.getElementById(\"#{dom_id}\")}).loadWave(\"googlewave.com!#{wave_id}\");}); </script>\n" #html << "<script type='text/javascript'>\n" #html << "$(document).ready({\n" if jquery? #html << " var wavePanel = new WavePanel('#{root_url}');\n" #html << " wavePanel.loadWave('#{wave_id}');\n" #html << ui_options_js if ui_configured? #html << " wavePanel.init(document.getElementById('#{dom_id}'));\n" #html << "})\n" if jquery? #html << "</script>\n" end |