Module LightboxHelper
In: app/helpers/lightbox_helper.rb

Methods

Public Instance methods

[Source]

   # File app/helpers/lightbox_helper.rb, line 3
3:   def include_lightbox_header
4:     stylesheet_link_tag('lightbox') + javascript_include_tag('lightbox')
5:   end

[Source]

    # File app/helpers/lightbox_helper.rb, line 35
35:   def lightbox?
36:     request.xhr?
37:   end

[Source]

    # File app/helpers/lightbox_helper.rb, line 15
15:   def lightbox_button(type, label, url, options = {})
16:     button(type, label, url, lightbox_options(options))
17:   end

[Source]

    # File app/helpers/lightbox_helper.rb, line 11
11:   def lightbox_close_button(text, options = {})
12:     button(:close, text, '#', lightbox_options(options, 'lbAction').merge(:rel => 'deactivate'))
13:   end

[Source]

    # File app/helpers/lightbox_helper.rb, line 19
19:   def lightbox_icon_button(type, label, url, options = {})
20:     icon_button(type, label, url, lightbox_options(options))
21:   end

[Source]

   # File app/helpers/lightbox_helper.rb, line 7
7:   def lightbox_link_to(text, url, options = {})
8:     link_to(text, url, lightbox_options(options))
9:   end

options must be an HTML options hash as passed to link_to etc.

returns a new hash with lightbox class added. Keeps existing classes.

[Source]

    # File app/helpers/lightbox_helper.rb, line 26
26:   def lightbox_options(options, lightbox_type = 'lbOn')
27:     the_class = lightbox_type
28:     the_class << " #{options[:class]}" if options.has_key?(:class)
29:     options.merge(
30:       :class => the_class,
31:       :onclick => 'alert("%s"); return false' % _('Please, try again when the page loading completes.')
32:     )
33:   end

[Validate]