module Opal::Bootbox
Constants
- VERSION
Public Instance Methods
alert(*args, &block)
click to toggle source
Creates an alert window. The given block is optional. Method executes asynchronously. No result is passed to the given block.
# File lib/opal/bootbox.rb, line 30 def alert(*args, &block) bootbox_call(__method__, *args, &block) end
bootbox_call(method, *args, &block)
click to toggle source
# File lib/opal/bootbox.rb, line 16 def bootbox_call(method, *args, &block) arg = args.first if arg.is_a?(Hash) && arg[:callback].nil? arg[:callback] = block Native.call(`bootbox`, method, arg.to_n) else Native.call(`bootbox`, method, arg.to_n, &block) end end
confirm(*args, &block)
click to toggle source
Creates a confirm window. Method executes asynchronously. The result passed to given block is true or false.
# File lib/opal/bootbox.rb, line 37 def confirm(*args, &block) bootbox_call(__method__, *args, &block) end
dialog(*args, &block)
click to toggle source
Creates a custom dialog window. Method executes asynchronously. The result passed to given block is a String or nil. see bootboxjs.com/examples.html
# File lib/opal/bootbox.rb, line 52 def dialog(*args, &block) bootbox_call(__method__, *args, &block) end
prompt(*args, &block)
click to toggle source
Creates a prompt window. Method executes asynchronously. The result passed to given block is a String or nil.
# File lib/opal/bootbox.rb, line 44 def prompt(*args, &block) bootbox_call(__method__, *args, &block) end