class HtmlGrid::PopupLink

Attributes

height[W]
locationbar[W]
menubar[W]
resizable[W]
scrollbars[W]
toolbar[W]
width[W]

Public Instance Methods

init() click to toggle source
Calls superclass method HtmlGrid::Link#init
# File lib/htmlgrid/popuplink.rb, line 33
def init
  super
  @scrollbars = true
  @resizable = true
  @toolbar = true
  @menubar = false
  @locationbar = false
  @width = 750
  @height = 460
end
to_html(context) click to toggle source
Calls superclass method HtmlGrid::Link#to_html
# File lib/htmlgrid/popuplink.rb, line 44
def to_html(context)
  props = {
    "scrollbars"    => yesorno(@scrollbars),
    "resizable"     =>  yesorno(@resizable),
    "toolbar"       =>    yesorno(@toolbar),
    "menubar"       =>    yesorno(@menubar),
    "locationbar"   =>        yesorno(@locationbar),
    "width" =>      @width,
    "height"        =>     @height
  }.collect { |key, val|
    [key, val].join("=")
  }.join(",")
  name = @lookandfeel.lookup(@name).to_s.gsub(@@name_ptrn, "")
  script = "window.open('#{href}', '#{name}', '#{props}').focus(); return false"
  @attributes.store("onClick", script)
  super
end

Private Instance Methods

yesorno(value) click to toggle source
# File lib/htmlgrid/popuplink.rb, line 64
def yesorno(value)
  value ? "yes" : "no"
end