twitter-bootstrap-rails-confirm 0.0.5 → 1.0.0

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.
data/README.md CHANGED
@@ -11,7 +11,7 @@ The normal confirm dialog shows a text with buttons 'ok' and 'cancel'. More info
11
11
 
12
12
  This behaviour is similar to that of a "regular" confirm box in ways that it uses the same title and button labels. Defaults are set when the DOM has been loaded and can be changed in two ways:
13
13
 
14
- Chaning all default values:
14
+ Changing all default values:
15
15
 
16
16
  $(document).ready(function() {
17
17
  $.fn.twitter_bootstrap_confirmbox.defaults = {
@@ -22,7 +22,7 @@ Chaning all default values:
22
22
  }
23
23
  });
24
24
 
25
- Only chaning the proceed_class default:
25
+ Only changing the proceed_class default:
26
26
 
27
27
  $(document).ready(function() {
28
28
  $.fn.twitter_bootstrap_confirmbox.defaults.proceed_class = "btn proceed btn-success"
@@ -2,7 +2,7 @@ module Twitter
2
2
  module Bootstrap
3
3
  module Rails
4
4
  module Confirm
5
- VERSION = "0.0.5"
5
+ VERSION = "1.0.0"
6
6
  end
7
7
  end
8
8
  end
@@ -7,13 +7,15 @@ $ ->
7
7
  proceed_class: "btn proceed btn-primary"
8
8
 
9
9
  TwitterBootstrapConfirmBox = (message, element, callback) ->
10
- $(document.body).append($('
11
- <div class="modal hide" id="confirmation_dialog">
12
- <div class="modal-header"><button type="button" class="close" data-dismiss="modal">×</button><h3>...</h3></div>
13
- <div class="modal-body"></div>
14
- <div class="modal-footer"><a href="#" class="btn cancel" data-dismiss="modal">...</a><a href="#" class="btn proceed btn-primary">...</a></div>
15
- </div>
16
- '))
10
+ $(document.body).append(
11
+ $(
12
+ '<div class="modal hide" id="confirmation_dialog">
13
+ <div class="modal-header"><button type="button" class="close" data-dismiss="modal">×</button><h3>...</h3></div>
14
+ <div class="modal-body"></div>
15
+ <div class="modal-footer"><a href="#" class="btn cancel" data-dismiss="modal">...</a><a href="#" class="btn proceed btn-primary">...</a></div>
16
+ </div>'
17
+ )
18
+ )
17
19
 
18
20
  $("#confirmation_dialog .modal-body").html(message)
19
21
  $("#confirmation_dialog .modal-header h3").html(element.data("confirm-title") || $.fn.twitter_bootstrap_confirmbox.defaults.title || window.top.location.origin)
@@ -42,7 +44,31 @@ $ ->
42
44
 
43
45
  $.rails.allowAction = ->
44
46
  true
45
- element.trigger "click"
47
+
48
+ if element.get(0).click
49
+ element.get(0).click()
50
+ else if $.isFunction(document.createEvent)
51
+ evt = document.createEvent "MouseEvents"
52
+ evt.initMouseEvent(
53
+ "click",
54
+ true, # e.bubbles,
55
+ true, #e.cancelable,
56
+ window, #e.view,
57
+ 0, #e.detail,
58
+ 0, #e.screenX,
59
+ 0, #e.screenY,
60
+ 0, #e.clientX,
61
+ 0, #e.clientY,
62
+ false, #e.ctrlKey,
63
+ false, #e.altKey,
64
+ false, #e.shiftKey,
65
+ false, #e.metaKey,
66
+ 0, #e.button,
67
+ document.body.parentNode #e.relatedTarget
68
+ )
69
+ element.get(0).dispatchEvent(evt)
70
+ else
71
+ element.trigger "click"
46
72
 
47
73
  $.rails.allowAction = allowAction
48
74
 
metadata CHANGED
@@ -1,33 +1,23 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: twitter-bootstrap-rails-confirm
3
- version: !ruby/object:Gem::Version
4
- hash: 21
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 5
10
- version: 0.0.5
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Rene van Lieshout
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-11-15 00:00:00 Z
12
+ date: 2013-02-22 00:00:00.000000000 Z
19
13
  dependencies: []
20
-
21
14
  description: Confirm dialogs using Twitter Bootstrap
22
- email:
15
+ email:
23
16
  - rene@bluerail.nl
24
17
  executables: []
25
-
26
18
  extensions: []
27
-
28
19
  extra_rdoc_files: []
29
-
30
- files:
20
+ files:
31
21
  - .gitignore
32
22
  - Gemfile
33
23
  - LICENSE
@@ -40,37 +30,33 @@ files:
40
30
  - vendor/assets/javascripts/twitter/bootstrap/rails/confirm.coffee
41
31
  homepage: https://github.com/bluerail/twitter-bootstrap-rails-confirm
42
32
  licenses: []
43
-
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
38
+ required_ruby_version: !ruby/object:Gem::Requirement
51
39
  none: false
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- hash: 3
56
- segments:
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ segments:
57
45
  - 0
58
- version: "0"
59
- required_rubygems_version: !ruby/object:Gem::Requirement
46
+ hash: 624208733835673147
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
48
  none: false
61
- requirements:
62
- - - ">="
63
- - !ruby/object:Gem::Version
64
- hash: 3
65
- segments:
49
+ requirements:
50
+ - - ! '>='
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ segments:
66
54
  - 0
67
- version: "0"
55
+ hash: 624208733835673147
68
56
  requirements: []
69
-
70
57
  rubyforge_project:
71
58
  rubygems_version: 1.8.24
72
59
  signing_key:
73
60
  specification_version: 3
74
61
  summary: Applies a custom confirm dialog for elements with a data-confirm attribute.
75
62
  test_files: []
76
-