opal-bootbox 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/opal/bootbox.rb +18 -4
- data/lib/opal/bootbox/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49a5f706d7b1498f3f402603b2fc28cc38640032
|
4
|
+
data.tar.gz: 5ec45755993176d6e3429991400309aca9003c4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa05abc60e1ca252f3332af4ec573c684ea9e55c3d0eeb0463e7dd1eec91450b585f08f973fe0355d61c96f7251c79089a821a23e8c4b24ce7d3a72a8ee86e1e
|
7
|
+
data.tar.gz: 607575582805561cd6e3f7d15e4e3c642ad28eb7bc32cdf52ea228acb41921ac36b0ba0a90a02d50aa350d79f0a5b28af48760138fe9b635272de678c98e1dfa
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
The goal of this project is to wrap the Bootbox Javascript library with Opal, providing a simple Ruby interface to Bootbox functionality.
|
4
4
|
|
5
|
-
Bootbox.js is a small JavaScript library which implements dialog (alert, prompt, confirm) boxes using Bootstrap modals.
|
5
|
+
Bootbox.js is a small open source (MIT) JavaScript library which implements dialog (alert, prompt, confirm) boxes using Bootstrap modals.
|
6
6
|
|
7
7
|
To find out more about Bootbox, go to http://bootboxjs.com.
|
8
8
|
|
@@ -47,7 +47,7 @@ require 'opal-bootbox'
|
|
47
47
|
>> http://getbootstrap.com/getting-started/#download
|
48
48
|
> and put the files in `app/` or whichever directory you are compiling assets from.
|
49
49
|
|
50
|
-
###
|
50
|
+
### Examples
|
51
51
|
|
52
52
|
```
|
53
53
|
$bootbox.alert('Hello world!') do
|
data/lib/opal/bootbox.rb
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
module Opal
|
2
|
+
module Bootbox
|
3
|
+
end
|
4
|
+
end
|
5
|
+
|
6
|
+
if RUBY_ENGINE == 'opal'
|
7
|
+
|
8
|
+
require 'native'
|
9
|
+
|
1
10
|
module Opal
|
2
11
|
module Bootbox
|
3
12
|
module_function
|
@@ -8,18 +17,21 @@ module Opal
|
|
8
17
|
|
9
18
|
# Creates an alert window.
|
10
19
|
# The given block is optional.
|
20
|
+
# Method executes asynchronously.
|
11
21
|
# No result is passed to the given block.
|
12
22
|
def alert(*args, &block)
|
13
23
|
bootbox_call(__method__, *args, &block)
|
14
24
|
end
|
15
25
|
|
16
26
|
# Creates a confirm window.
|
27
|
+
# Method executes asynchronously.
|
17
28
|
# The result passed to given block is true or false.
|
18
29
|
def confirm(*args, &block)
|
19
30
|
bootbox_call(__method__, *args, &block)
|
20
31
|
end
|
21
32
|
|
22
33
|
# Creates a prompt window.
|
34
|
+
# Method executes asynchronously.
|
23
35
|
# The result passed to given block is a String or nil.
|
24
36
|
def prompt(*args, &block)
|
25
37
|
bootbox_call(__method__, *args, &block)
|
@@ -27,12 +39,14 @@ module Opal
|
|
27
39
|
|
28
40
|
end
|
29
41
|
end
|
30
|
-
$bootbox = Opal::Bootbox
|
31
42
|
|
32
|
-
|
33
|
-
|
43
|
+
else # RUBY_ENGINE
|
44
|
+
|
34
45
|
require 'opal'
|
35
46
|
require 'opal/bootbox/version'
|
36
47
|
Opal.append_path File.expand_path('../..', __FILE__).untaint
|
37
|
-
|
48
|
+
|
49
|
+
end # RUBY_ENGINE
|
50
|
+
|
51
|
+
$bootbox = Opal::Bootbox
|
38
52
|
|
data/lib/opal/bootbox/version.rb
CHANGED