twitter-bootstrap-rails-confirm 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3ba7f8b59246c9423a9638868574b5804848b692
|
4
|
+
data.tar.gz: b050961231c0042715e0002e15c52d0ca1d136eb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d33ffd28ae2866614123985160aca05b99a944a655c57627ce34f088e5b97de4a5b91e55e1970aeef2d7a86b754fb5c9a88a19b41d7ae4e0c1f19402615fef14
|
7
|
+
data.tar.gz: f5e669f9bd96d87284481bf4181eb22e0700448ac42bfdac607bc5707b0c4f3f282c54d32f950812ecc17ef16cba08729c4614ed422bfbce9f6403dbf3d39f11
|
data/README.md
CHANGED
@@ -73,9 +73,11 @@ Next... nothing. There is nothing you need to do to get this working. A helper c
|
|
73
73
|
|
74
74
|
## Changelog
|
75
75
|
|
76
|
-
###
|
76
|
+
### 1.0.3 (September 4, 2014)
|
77
77
|
|
78
|
-
*
|
78
|
+
* [(rvanlieshout)](https://github.com/rvanlieshout) [Problems with using event constructors](https://github.com/bluerail/twitter-bootstrap-rails-confirm/issues/18)
|
79
|
+
* [(stevelacey)](https://github.com/stevelacey) [Avoid appending custom proceed class to btn-primary, refactored dialog JS](https://github.com/bluerail/twitter-bootstrap-rails-confirm/pull/17)
|
80
|
+
* [(zsy056)](https://github.com/zsy056) [When message is numerical, the call replace on message will cause a TypeError](https://github.com/bluerail/twitter-bootstrap-rails-confirm/pull/22)
|
79
81
|
|
80
82
|
### 1.0.2 (Oktober 11, 2013)
|
81
83
|
|
@@ -1,42 +1,65 @@
|
|
1
1
|
$.fn.twitter_bootstrap_confirmbox =
|
2
2
|
defaults:
|
3
|
-
fade: false
|
4
3
|
title: null
|
4
|
+
proceed: "OK"
|
5
|
+
proceed_class: "btn proceed"
|
5
6
|
cancel: "Cancel"
|
6
7
|
cancel_class: "btn cancel"
|
7
|
-
|
8
|
-
proceed_class: "btn proceed btn-primary"
|
8
|
+
fade: false
|
9
9
|
|
10
10
|
TwitterBootstrapConfirmBox = (message, element, callback) ->
|
11
|
-
$(
|
12
|
-
|
13
|
-
|
14
|
-
<
|
15
|
-
<
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
11
|
+
$dialog = $('
|
12
|
+
<div class="modal hide" id="confirmation_dialog">
|
13
|
+
<div class="modal-header">
|
14
|
+
<button type="button" class="close" data-dismiss="modal">×</button>
|
15
|
+
<h3>...</h3>
|
16
|
+
</div>
|
17
|
+
<div class="modal-body"></div>
|
18
|
+
<div class="modal-footer"></div>
|
19
|
+
</div>
|
20
|
+
')
|
21
|
+
|
22
|
+
$dialog.addClass("fade") if element.data("confirm-fade") || $.fn.twitter_bootstrap_confirmbox.defaults.fade
|
20
23
|
|
21
|
-
$
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
$(this).remove()
|
28
|
-
)
|
24
|
+
$dialog
|
25
|
+
.find(".modal-header")
|
26
|
+
.find("h3")
|
27
|
+
.html(element.data("confirm-title") || $.fn.twitter_bootstrap_confirmbox.defaults.title || window.top.location.origin)
|
28
|
+
.end()
|
29
|
+
.end()
|
29
30
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
callback()
|
34
|
-
false
|
31
|
+
.find(".modal-body")
|
32
|
+
.html(message.toString().replace(/\n/g, "<br />"))
|
33
|
+
.end()
|
35
34
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
.find(".modal-footer")
|
36
|
+
.append(
|
37
|
+
$("<a />", {href: "#", "data-dismiss": "modal"})
|
38
|
+
.html(element.data("confirm-cancel") || $.fn.twitter_bootstrap_confirmbox.defaults.cancel)
|
39
|
+
.addClass($.fn.twitter_bootstrap_confirmbox.defaults.cancel_class)
|
40
|
+
.addClass(element.data("confirm-cancel-class"))
|
41
|
+
.click((event) ->
|
42
|
+
event.preventDefault()
|
43
|
+
$dialog.modal("hide")
|
44
|
+
)
|
45
|
+
,
|
46
|
+
$("<a />", {href: "#"})
|
47
|
+
.html(element.data("confirm-proceed") || $.fn.twitter_bootstrap_confirmbox.defaults.proceed)
|
48
|
+
.addClass($.fn.twitter_bootstrap_confirmbox.defaults.proceed_class)
|
49
|
+
.addClass(element.data("confirm-proceed-class") || "btn-primary")
|
50
|
+
.click((event) ->
|
51
|
+
event.preventDefault()
|
52
|
+
$dialog.modal("hide")
|
53
|
+
callback()
|
54
|
+
)
|
55
|
+
)
|
56
|
+
.end()
|
57
|
+
|
58
|
+
.on("hidden", -> $(this).remove())
|
59
|
+
|
60
|
+
.modal("show")
|
61
|
+
|
62
|
+
.appendTo(document.body)
|
40
63
|
|
41
64
|
$.rails.allowAction = (element) ->
|
42
65
|
message = element.data("confirm")
|
@@ -53,25 +76,47 @@ $.rails.allowAction = (element) ->
|
|
53
76
|
|
54
77
|
if element.get(0).click
|
55
78
|
element.get(0).click()
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
79
|
+
|
80
|
+
else if Event?
|
81
|
+
evt = new Event("click", {
|
82
|
+
bubbles: true,
|
83
|
+
cancelable: true,
|
84
|
+
view: window,
|
85
|
+
detail: 0,
|
86
|
+
screenX: 0,
|
87
|
+
screenY: 0,
|
88
|
+
clientX: 0,
|
89
|
+
clientY: 0,
|
90
|
+
ctrlKey: false,
|
91
|
+
altKey: false,
|
92
|
+
shiftKey: false,
|
93
|
+
metaKey: false,
|
94
|
+
button: 0,
|
95
|
+
relatedTarget: document.body.parentNode
|
72
96
|
})
|
73
97
|
element.get(0).dispatchEvent(evt)
|
74
98
|
|
99
|
+
else if $.isFunction(document.createEvent)
|
100
|
+
evt = document.createEvent "MouseEvents"
|
101
|
+
evt.initMouseEvent(
|
102
|
+
"click",
|
103
|
+
true, # e.bubbles,
|
104
|
+
true, # e.cancelable,
|
105
|
+
window, # e.view,
|
106
|
+
0, # e.detail,
|
107
|
+
0, # e.screenX,
|
108
|
+
0, # e.screenY,
|
109
|
+
0, # e.clientX,
|
110
|
+
0, # e.clientY,
|
111
|
+
false, # e.ctrlKey,
|
112
|
+
false, # e.altKey,
|
113
|
+
false, # e.shiftKey,
|
114
|
+
false, # e.metaKey,
|
115
|
+
0, # e.button,
|
116
|
+
document.body.parentNode # e.relatedTarget
|
117
|
+
)
|
118
|
+
element.get(0).dispatchEvent(evt)
|
119
|
+
|
75
120
|
$.rails.allowAction = allowAction
|
76
121
|
|
77
122
|
false
|
metadata
CHANGED
@@ -1,33 +1,22 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitter-bootstrap-rails-confirm
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 2
|
10
|
-
version: 1.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.3
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Rene van Lieshout
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2013-10-11 00:00:00 Z
|
11
|
+
date: 2014-09-04 00:00:00.000000000 Z
|
19
12
|
dependencies: []
|
20
|
-
|
21
13
|
description: Confirm dialogs using Twitter Bootstrap
|
22
|
-
email:
|
14
|
+
email:
|
23
15
|
- rene@bluerail.nl
|
24
16
|
executables: []
|
25
|
-
|
26
17
|
extensions: []
|
27
|
-
|
28
18
|
extra_rdoc_files: []
|
29
|
-
|
30
|
-
files:
|
19
|
+
files:
|
31
20
|
- .gitignore
|
32
21
|
- Gemfile
|
33
22
|
- LICENSE
|
@@ -40,37 +29,26 @@ files:
|
|
40
29
|
- vendor/assets/javascripts/twitter/bootstrap/rails/confirm.coffee
|
41
30
|
homepage: https://github.com/bluerail/twitter-bootstrap-rails-confirm
|
42
31
|
licenses: []
|
43
|
-
|
32
|
+
metadata: {}
|
44
33
|
post_install_message:
|
45
34
|
rdoc_options: []
|
46
|
-
|
47
|
-
require_paths:
|
35
|
+
require_paths:
|
48
36
|
- lib
|
49
37
|
- vendor
|
50
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
none: false
|
61
|
-
requirements:
|
62
|
-
- - ">="
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
hash: 3
|
65
|
-
segments:
|
66
|
-
- 0
|
67
|
-
version: "0"
|
38
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
68
48
|
requirements: []
|
69
|
-
|
70
49
|
rubyforge_project:
|
71
|
-
rubygems_version:
|
50
|
+
rubygems_version: 2.0.14
|
72
51
|
signing_key:
|
73
|
-
specification_version:
|
52
|
+
specification_version: 4
|
74
53
|
summary: Applies a custom confirm dialog for elements with a data-confirm attribute.
|
75
54
|
test_files: []
|
76
|
-
|