binco 3.1.3 → 3.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b047030d78a36ed3a38b3e030e5ec245a399921e
4
- data.tar.gz: 1cc92ea70e6deadeaa2bbd78a671bf0c2aaa928d
3
+ metadata.gz: 8aa0f9d9390c123db1fe22ea9ae807542aa65d6b
4
+ data.tar.gz: 12e26cc1aead15e45370a20970ab79041b76ff33
5
5
  SHA512:
6
- metadata.gz: 522acdff2f264ada41f10391267fb4486943fefc03dffdb0b8643d86360ed0155d01717336212bcf9177d65ab3d765deb3481e672c355743e1f82b52bb0ee521
7
- data.tar.gz: 62022f697cddb2dc02d9bc1d0b4f4ceb34b51ca5752fa9d97a7362f208c26794e8ea1900c2ea7914e70e25480f13f89c995f0f343ec8e04eb60b9872ef8c7c90
6
+ metadata.gz: 20ceab3b9e86d9cf6b6b918633250a898d8b2216a8a9a6b534c75be6b21cd0f69abb2e7dfa3a5c23a67a4c95403f808553af6d875174f424cde9ce69be0ca604
7
+ data.tar.gz: d5689513233ada079526d155c3c3682938d9459ef2e88465f4e7e63741e2ebbf176f744cd7237f45d6eba81b5cc800910035f977461b81ef3f7922cdfe43f1a6
@@ -0,0 +1,305 @@
1
+ /*
2
+ * Implements a user-facing modal confirmation when link has a
3
+ * "data-confirm" attribute using bootstrap's modals. MIT license.
4
+ *
5
+ * - vjt@openssl.it Tue Jul 2 18:45:15 CEST 2013
6
+ */
7
+ (function ($) {
8
+
9
+ /**
10
+ * Builds the markup for a [Bootstrap modal](http://twitter.github.io/bootstrap/javascript.html#modals)
11
+ * for the given `element`. Uses the following `data-` parameters to
12
+ * customize it:
13
+ *
14
+ * * `data-confirm`: Contains the modal body text. HTML is allowed.
15
+ * Separate multiple paragraphs using \n\n.
16
+ * * `data-commit`: The 'confirm' button text. "Confirm" by default.
17
+ * * `data-cancel`: The 'cancel' button text. "Cancel" by default.
18
+ * * `data-verify`: Adds a text input in which the user has to input
19
+ * the text in this attribute value for the 'confirm'
20
+ * button to be clickable. Optional.
21
+ * * `data-verify-text`: Adds a label for the data-verify input. Optional
22
+ * * `data-focus`: Define focused input. Supported values are
23
+ * 'cancel' or 'commit', 'cancel' is default for
24
+ * data-method DELETE, 'commit' for all others.
25
+ *
26
+ * You can set global setting using `dataConfirmModal.setDefaults`, for example:
27
+ *
28
+ * dataConfirmModal.setDefaults({
29
+ * title: 'Confirm your action',
30
+ * commit: 'Continue',
31
+ * cancel: 'Cancel',
32
+ * fade: false,
33
+ * verifyClass: 'form-control',
34
+ * });
35
+ *
36
+ */
37
+
38
+ var defaults = {
39
+ title: 'Confirmar acción',
40
+ commit: 'Confirmar',
41
+ commitClass: 'btn btn-danger',
42
+ cancel: 'Regresar',
43
+ cancelClass: 'btn btn-default',
44
+ fade: true,
45
+ verifyClass: 'form-control',
46
+ elements: ['a[data-confirm]', 'button[data-confirm]', 'input[type=submit][data-confirm]'],
47
+ focus: 'commit',
48
+ zIndex: 1050,
49
+ modalClass: false,
50
+ show: true
51
+ };
52
+
53
+ var settings;
54
+
55
+ window.dataConfirmModal = {
56
+ setDefaults: function (newSettings) {
57
+ settings = $.extend(settings, newSettings);
58
+ },
59
+
60
+ restoreDefaults: function () {
61
+ settings = $.extend({}, defaults);
62
+ },
63
+
64
+ confirm: function (options) {
65
+ // Build an ephemeral modal
66
+ //
67
+ var modal = buildModal(options);
68
+
69
+ modal.spawn();
70
+ modal.on('hidden.bs.modal', function () {
71
+ modal.remove();
72
+ });
73
+
74
+ modal.find('.commit').on('click', function () {
75
+ if (options.onConfirm && options.onConfirm.call)
76
+ options.onConfirm.call();
77
+
78
+ modal.modal('hide');
79
+ });
80
+
81
+ modal.find('.cancel').on('click', function () {
82
+ if (options.onCancel && options.onCancel.call)
83
+ options.onCancel.call();
84
+
85
+ modal.modal('hide');
86
+ });
87
+ }
88
+ };
89
+
90
+ dataConfirmModal.restoreDefaults();
91
+
92
+ var buildElementModal = function (element) {
93
+ var options = {
94
+ title: element.data('title') || element.attr('title') || element.data('original-title'),
95
+ text: element.data('confirm'),
96
+ focus: element.data('focus'),
97
+ method: element.data('method'),
98
+ modalClass: element.data('modal-class'),
99
+ commit: element.data('commit'),
100
+ commitClass: element.data('commit-class'),
101
+ cancel: element.data('cancel'),
102
+ cancelClass: element.data('cancel-class'),
103
+ remote: element.data('remote'),
104
+ verify: element.data('verify'),
105
+ verifyRegexp: element.data('verify-regexp'),
106
+ verifyLabel: element.data('verify-text'),
107
+ verifyRegexpCaseInsensitive: element.data('verify-regexp-caseinsensitive'),
108
+ backdrop: element.data('backdrop') || true,
109
+ keyboard: element.data('keyboard') || true,
110
+ show: element.data('show') || true
111
+ };
112
+
113
+ var modal = buildModal(options);
114
+
115
+ modal.find('.commit').on('click', function () {
116
+ // Call the original event handler chain
117
+ element.get(0).click();
118
+
119
+ modal.modal('hide');
120
+ });
121
+
122
+ return modal;
123
+ }
124
+
125
+ var buildModal = function (options) {
126
+ var id = 'confirm-modal-' + String(Math.random()).slice(2, -1);
127
+ var fade = settings.fade ? 'fade' : '';
128
+ var modalClass = options.modalClass ? options.modalClass : settings.modalClass;
129
+
130
+ var modal = $(
131
+ '<div id="'+id+'" class="modal '+modalClass+' '+fade+'" tabindex="-1" role="dialog" aria-labelledby="'+id+'Label" aria-hidden="true">' +
132
+ '<div class="modal-dialog" role="document">' +
133
+ '<div class="modal-content">' +
134
+ '<div class="modal-header">' +
135
+ '<h5 id="'+id+'Label" class="modal-title"></h5> ' +
136
+ '<button type="button" class="close" data-dismiss="modal" aria-label="Close">' +
137
+ '<span aria-hidden="true">&times;</span>' +
138
+ '</button>' +
139
+ '</div>' +
140
+ '<div class="modal-body"></div>' +
141
+ '<div class="modal-footer">' +
142
+ '<button class="btn cancel" data-dismiss="modal" aria-hidden="true"></button>' +
143
+ '<button class="btn commit"></button>' +
144
+ '</div>'+
145
+ '</div>'+
146
+ '</div>'+
147
+ '</div>'
148
+ );
149
+
150
+ // Make sure it's always the top zindex
151
+ var highest = current = settings.zIndex;
152
+ $('.modal.in').not('#'+id).each(function() {
153
+ current = parseInt($(this).css('z-index'), 10);
154
+ if(current > highest) {
155
+ highest = current
156
+ }
157
+ });
158
+ modal.css('z-index', parseInt(highest) + 1);
159
+
160
+ modal.find('.modal-title').text(options.title || settings.title);
161
+
162
+ var body = modal.find('.modal-body');
163
+
164
+ $.each((options.text||'').split(/\n{2}/), function (i, piece) {
165
+ body.append($('<p/>').html(piece));
166
+ });
167
+
168
+ var commit = modal.find('.commit');
169
+ commit.text(options.commit || settings.commit);
170
+ commit.addClass(options.commitClass || settings.commitClass);
171
+
172
+ var cancel = modal.find('.cancel');
173
+ cancel.text(options.cancel || settings.cancel);
174
+ cancel.addClass(options.cancelClass || settings.cancelClass);
175
+
176
+ if (options.remote) {
177
+ commit.attr('data-dismiss', 'modal');
178
+ }
179
+
180
+ if (options.verify || options.verifyRegexp) {
181
+ commit.prop('disabled', true);
182
+
183
+ var isMatch;
184
+ if (options.verifyRegexp) {
185
+ var caseInsensitive = options.verifyRegexpCaseInsensitive;
186
+ var regexp = options.verifyRegexp;
187
+ var re = new RegExp(regexp, caseInsensitive ? 'i' : '');
188
+
189
+ isMatch = function (input) { return input.match(re) };
190
+ } else {
191
+ isMatch = function (input) { return options.verify == input };
192
+ }
193
+
194
+ var verification = $('<input/>', {"type": 'text', "class": settings.verifyClass}).on('keyup', function () {
195
+ commit.prop('disabled', !isMatch($(this).val()));
196
+ });
197
+
198
+ modal.on('shown.bs.modal', function () {
199
+ verification.focus();
200
+ });
201
+
202
+ modal.on('hidden.bs.modal', function () {
203
+ verification.val('').trigger('keyup');
204
+ });
205
+
206
+ if (options.verifyLabel)
207
+ body.append($('<p>', {text: options.verifyLabel}))
208
+
209
+ body.append(verification);
210
+ }
211
+
212
+ var focus_element;
213
+ if (options.focus) {
214
+ focus_element = options.focus;
215
+ } else if (options.method == 'delete') {
216
+ focus_element = 'cancel'
217
+ } else {
218
+ focus_element = settings.focus;
219
+ }
220
+ focus_element = modal.find('.' + focus_element);
221
+
222
+ modal.on('shown.bs.modal', function () {
223
+ focus_element.focus();
224
+ });
225
+
226
+ $('body').append(modal);
227
+
228
+ modal.spawn = function() {
229
+ return modal.modal({
230
+ backdrop: options.backdrop,
231
+ keyboard: options.keyboard,
232
+ show: options.show
233
+ });
234
+ };
235
+
236
+ return modal;
237
+ };
238
+
239
+
240
+ /**
241
+ * Returns a modal already built for the given element or builds a new one,
242
+ * caching it into the element's `confirm-modal` data attribute.
243
+ */
244
+ var getModal = function (element) {
245
+ var modal = element.data('confirm-modal');
246
+
247
+ if (!modal) {
248
+ modal = buildElementModal(element);
249
+ element.data('confirm-modal', modal);
250
+ }
251
+
252
+ return modal;
253
+ };
254
+
255
+ $.fn.confirmModal = function () {
256
+ var modal = getModal($(this));
257
+
258
+ modal.spawn();
259
+
260
+ return modal;
261
+ };
262
+
263
+ if ($.rails) {
264
+ /**
265
+ * Attaches to Rails' UJS adapter's 'confirm' event, triggered on elements
266
+ * having a `data-confirm` attribute set.
267
+ *
268
+ * If the modal is not visible, then it is spawned and the default Rails
269
+ * confirmation dialog is canceled.
270
+ *
271
+ * If the modal is visible, it means the handler is being called by the
272
+ * modal commit button click handler, as such the user has successfully
273
+ * clicked on the confirm button. In this case Rails' confirm function
274
+ * is briefly overriden, and afterwards reset when the modal is closed.
275
+ *
276
+ */
277
+ var window_confirm = window.confirm;
278
+
279
+ $(document).delegate(settings.elements.join(', '), 'confirm', function() {
280
+ var element = $(this), modal = getModal(element);
281
+
282
+ if (!modal.is(':visible')) {
283
+ modal.spawn();
284
+
285
+ // Cancel Rails' confirmation
286
+ return false;
287
+
288
+ } else {
289
+ // Modal has been confirmed. Override Rails' handler
290
+ window.confirm = function () {
291
+ return true;
292
+ }
293
+
294
+ modal.one('hidden.bs.modal', function() {
295
+ // Reset it after modal is closed.
296
+ window.confirm = window_confirm;
297
+ });
298
+
299
+ // Proceed with Rails' handlers
300
+ return true;
301
+ }
302
+ });
303
+ }
304
+
305
+ })(jQuery);
@@ -1,3 +1,3 @@
1
1
  module Binco
2
- VERSION = '3.1.3'
2
+ VERSION = '3.1.4'
3
3
  end
@@ -15,7 +15,7 @@
15
15
  // $gray-300: #dee2e6 !default;
16
16
  // $gray-400: #ced4da !default;
17
17
  // $gray-500: #adb5bd !default;
18
- // $gray-600: #868e96 !default;
18
+ // $gray-600: #6c757d !default;
19
19
  // $gray-700: #495057 !default;
20
20
  // $gray-800: #343a40 !default;
21
21
  // $gray-900: #212529 !default;
@@ -103,7 +103,7 @@
103
103
  // $enable-shadows: false !default;
104
104
  // $enable-gradients: false !default;
105
105
  // $enable-transitions: true !default;
106
- // $enable-hover-media-query: false !default;
106
+ // $enable-hover-media-query: false !default; // Deprecated, no longer affects any compiled CSS
107
107
  // $enable-grid-classes: true !default;
108
108
  // $enable-print-styles: true !default;
109
109
  //
@@ -114,23 +114,27 @@
114
114
  // variables. Mostly focused on spacing.
115
115
  // You can add more entries to the $spacers map, should you need more variation.
116
116
  //
117
+ // stylelint-disable
117
118
  // $spacer: 1rem !default;
118
- // $spacers: (
119
+ // $spacers: () !default;
120
+ // $spacers: map-merge((
119
121
  // 0: 0,
120
122
  // 1: ($spacer * .25),
121
123
  // 2: ($spacer * .5),
122
124
  // 3: $spacer,
123
125
  // 4: ($spacer * 1.5),
124
126
  // 5: ($spacer * 3)
125
- // ) !default;
127
+ // ), $spacers);
126
128
  //
127
129
  // This variable affects the `.h-*` and `.w-*` classes.
128
- // $sizes: (
130
+ // $sizes: () !default;
131
+ // $sizes: map-merge((
129
132
  // 25: 25%,
130
133
  // 50: 50%,
131
134
  // 75: 75%,
132
135
  // 100: 100%
133
- // ) !default;
136
+ // ), $sizes);
137
+ // stylelint-enable
134
138
  //
135
139
  // Body
136
140
  //
@@ -201,7 +205,7 @@
201
205
  // $line-height-sm: 1.5 !default;
202
206
  //
203
207
  // $border-width: 1px !default;
204
- // $border-color: $gray-200 !default;
208
+ // $border-color: $gray-300 !default;
205
209
  //
206
210
  // $border-radius: .25rem !default;
207
211
  // $border-radius-lg: .3rem !default;
@@ -323,7 +327,7 @@
323
327
  // $input-btn-line-height: $line-height-base !default;
324
328
  //
325
329
  // $input-btn-focus-width: .2rem !default;
326
- // $input-btn-focus-color: rgba(theme-color("primary"), .25) !default;
330
+ // $input-btn-focus-color: rgba($component-active-bg, .25) !default;
327
331
  // $input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color !default;
328
332
  //
329
333
  // $input-btn-padding-y-sm: .25rem !default;
@@ -401,14 +405,14 @@
401
405
  // $input-border-radius-sm: $border-radius-sm !default;
402
406
  //
403
407
  // $input-focus-bg: $input-bg !default;
404
- // $input-focus-border-color: lighten(theme-color("primary"), 25%) !default;
408
+ // $input-focus-border-color: lighten($component-active-bg, 25%) !default;
405
409
  // $input-focus-color: $input-color !default;
406
410
  // $input-focus-width: $input-btn-focus-width !default;
407
411
  // $input-focus-box-shadow: $input-btn-focus-box-shadow !default;
408
412
  //
409
413
  // $input-placeholder-color: $gray-600 !default;
410
414
  //
411
- // $input-height-border: $input-btn-border-width * 2 !default;
415
+ // $input-height-border: $input-border-width * 2 !default;
412
416
  //
413
417
  // $input-height-inner: ($font-size-base * $input-btn-line-height) + ($input-btn-padding-y * 2) !default;
414
418
  // $input-height: calc(#{$input-height-inner} + #{$input-height-border}) !default;
@@ -447,20 +451,21 @@
447
451
  // $custom-control-indicator-disabled-bg: $gray-200 !default;
448
452
  // $custom-control-label-disabled-color: $gray-600 !default;
449
453
  //
450
- // $custom-control-indicator-checked-color: $white !default;
451
- // $custom-control-indicator-checked-bg: theme-color("primary") !default;
454
+ // $custom-control-indicator-checked-color: $component-active-color !default;
455
+ // $custom-control-indicator-checked-bg: $component-active-bg !default;
456
+ // $custom-control-indicator-checked-disabled-bg: rgba(theme-color("primary"), .5) !default;
452
457
  // $custom-control-indicator-checked-box-shadow: none !default;
453
458
  //
454
459
  // $custom-control-indicator-focus-box-shadow: 0 0 0 1px $body-bg, $input-btn-focus-box-shadow !default;
455
460
  //
456
- // $custom-control-indicator-active-color: $white !default;
457
- // $custom-control-indicator-active-bg: lighten(theme-color("primary"), 35%) !default;
461
+ // $custom-control-indicator-active-color: $component-active-color !default;
462
+ // $custom-control-indicator-active-bg: lighten($component-active-bg, 35%) !default;
458
463
  // $custom-control-indicator-active-box-shadow: none !default;
459
464
  //
460
465
  // $custom-checkbox-indicator-border-radius: $border-radius !default;
461
466
  // $custom-checkbox-indicator-icon-checked: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#{$custom-control-indicator-checked-color}' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E"), "#", "%23") !default;
462
467
  //
463
- // $custom-checkbox-indicator-indeterminate-bg: theme-color("primary") !default;
468
+ // $custom-checkbox-indicator-indeterminate-bg: $component-active-bg !default;
464
469
  // $custom-checkbox-indicator-indeterminate-color: $custom-control-indicator-checked-color !default;
465
470
  // $custom-checkbox-indicator-icon-indeterminate: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='#{$custom-checkbox-indicator-indeterminate-color}' d='M0 2h4'/%3E%3C/svg%3E"), "#", "%23") !default;
466
471
  // $custom-checkbox-indicator-indeterminate-box-shadow: none !default;
@@ -485,7 +490,7 @@
485
490
  // $custom-select-border-radius: $border-radius !default;
486
491
  //
487
492
  // $custom-select-focus-border-color: $input-focus-border-color !default;
488
- // $custom-select-focus-box-shadow: inset 0 1px 2px rgba($black, .075), $input-btn-focus-box-shadow !default;
493
+ // $custom-select-focus-box-shadow: inset 0 1px 2px rgba($black, .075), 0 0 5px rgba($custom-select-focus-border-color, .5) !default;
489
494
  //
490
495
  // $custom-select-font-size-sm: 75% !default;
491
496
  // $custom-select-height-sm: $input-height-sm !default;
@@ -585,6 +590,8 @@
585
590
  // $navbar-padding-y: ($spacer / 2) !default;
586
591
  // $navbar-padding-x: $spacer !default;
587
592
  //
593
+ // $navbar-nav-link-padding-x: .5rem !default;
594
+ //
588
595
  // $navbar-brand-font-size: $font-size-lg !default;
589
596
  // Compute the navbar-brand padding-y so the navbar-brand will have the same height as navbar-text and nav-link
590
597
  // $nav-link-height: ($font-size-base * $line-height-base + $nav-link-padding-y * 2) !default;
@@ -625,13 +632,15 @@
625
632
  // $pagination-border-width: $border-width !default;
626
633
  // $pagination-border-color: $gray-300 !default;
627
634
  //
635
+ // $pagination-focus-box-shadow: $input-btn-focus-box-shadow !default;
636
+ //
628
637
  // $pagination-hover-color: $link-hover-color !default;
629
638
  // $pagination-hover-bg: $gray-200 !default;
630
639
  // $pagination-hover-border-color: $gray-300 !default;
631
640
  //
632
- // $pagination-active-color: $white !default;
633
- // $pagination-active-bg: theme-color("primary") !default;
634
- // $pagination-active-border-color: theme-color("primary") !default;
641
+ // $pagination-active-color: $component-active-color !default;
642
+ // $pagination-active-bg: $component-active-bg !default;
643
+ // $pagination-active-border-color: $pagination-active-bg !default;
635
644
  //
636
645
  // $pagination-disabled-color: $gray-600 !default;
637
646
  // $pagination-disabled-bg: $white !default;
@@ -667,9 +676,11 @@
667
676
  //
668
677
  // Tooltips
669
678
  //
679
+ // $tooltip-font-size: $font-size-sm !default;
670
680
  // $tooltip-max-width: 200px !default;
671
681
  // $tooltip-color: $white !default;
672
682
  // $tooltip-bg: $black !default;
683
+ // $tooltip-border-radius: $border-radius !default;
673
684
  // $tooltip-opacity: .9 !default;
674
685
  // $tooltip-padding-y: .25rem !default;
675
686
  // $tooltip-padding-x: .5rem !default;
@@ -682,10 +693,12 @@
682
693
  //
683
694
  // Popovers
684
695
  //
696
+ // $popover-font-size: $font-size-sm !default;
685
697
  // $popover-bg: $white !default;
686
698
  // $popover-max-width: 276px !default;
687
699
  // $popover-border-width: $border-width !default;
688
700
  // $popover-border-color: rgba($black, .2) !default;
701
+ // $popover-border-radius: $border-radius-lg !default;
689
702
  // $popover-box-shadow: 0 .25rem .5rem rgba($black, .2) !default;
690
703
  //
691
704
  // $popover-header-bg: darken($popover-bg, 3%) !default;
@@ -760,6 +773,10 @@
760
773
  // $alert-link-font-weight: $font-weight-bold !default;
761
774
  // $alert-border-width: $border-width !default;
762
775
  //
776
+ // $alert-bg-level: -10 !default;
777
+ // $alert-border-level: -9 !default;
778
+ // $alert-color-level: 6 !default;
779
+ //
763
780
  //
764
781
  // Progress bars
765
782
  //
@@ -870,3 +887,8 @@
870
887
  //
871
888
  // $pre-color: $gray-900 !default;
872
889
  // $pre-scrollable-max-height: 340px !default;
890
+ //
891
+ //
892
+ // Printing
893
+ // $print-page-size: a3 !default;
894
+ // $print-body-min-width: map-get($grid-breakpoints, "lg") !default;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: binco
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.3
4
+ version: 3.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Camacho
@@ -30,7 +30,7 @@ cert_chain:
30
30
  XdmvXYY6Fr9AHqSdbvphaVu+RqBpkBdGUQCcCZ73NjXSUwgJumx1p1A8e4NXrh1e
31
31
  pYh0/Q==
32
32
  -----END CERTIFICATE-----
33
- date: 2018-01-17 00:00:00.000000000 Z
33
+ date: 2018-01-19 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: railties
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 4.0.0.beta3
61
+ version: 4.0.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 4.0.0.beta3
68
+ version: 4.0.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: jquery-rails
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -169,7 +169,7 @@ files:
169
169
  - Rakefile
170
170
  - app/assets/javascripts/binco.js
171
171
  - app/assets/javascripts/binco_namespace.js
172
- - app/assets/javascripts/bootstrap-data-confirm.coffee
172
+ - app/assets/javascripts/bootstrap-data-confirm.js
173
173
  - app/assets/javascripts/select2-rails.coffee
174
174
  - app/assets/stylesheets/_datepicker.scss
175
175
  - app/assets/stylesheets/binco.scss
@@ -1,129 +0,0 @@
1
- $.fn.twitter_bootstrap_confirmbox =
2
- defaults:
3
- title: null
4
- proceed: "OK"
5
- proceed_class: "btn"
6
- cancel: "Cancelar"
7
- cancel_class: "btn"
8
-
9
- TwitterBootstrapConfirmBox = (message, element, callback) ->
10
-
11
- $dialog = $("""
12
- <div class="modal fade" id="confirmation_dialog" role="dialog" tabindex="-1">
13
- <div class="modal-dialog">
14
- <div class="modal-content">
15
- <div class="modal-header">
16
- <h4 class="modal-title"></h4>
17
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
18
- </div>
19
- <div class="modal-body"></div>
20
- <div class="modal-footer"></div>
21
- </div>
22
- </div>
23
- </div>
24
- """)
25
-
26
- $dialog
27
- .find(".modal-header")
28
- .find(".modal-title")
29
- .html(element.data("confirm-title") || $.fn.twitter_bootstrap_confirmbox.defaults.title || window.top.location.origin)
30
- .end()
31
- .end()
32
-
33
- .find(".modal-body")
34
- .html(message.toString().replace(/\n/g, "<br />"))
35
- .end()
36
-
37
- .find(".modal-footer")
38
- .append(
39
- $("<a />", { href: "#", "data-dismiss": "modal" })
40
- .html(element.data("confirm-cancel") || $.fn.twitter_bootstrap_confirmbox.defaults.cancel)
41
- .addClass($.fn.twitter_bootstrap_confirmbox.defaults.cancel_class)
42
- .addClass(element.data("confirm-cancel-class") || "btn-default")
43
- .click((event) ->
44
- event.preventDefault()
45
- $dialog.modal("hide")
46
- )
47
- ,
48
- $("<a />", { href: "#" })
49
- .html(element.data("confirm-proceed") || $.fn.twitter_bootstrap_confirmbox.defaults.proceed)
50
- .addClass($.fn.twitter_bootstrap_confirmbox.defaults.proceed_class)
51
- .addClass(element.data("confirm-proceed-class") || "btn-warning")
52
- .click((event) ->
53
- event.preventDefault()
54
- $dialog.modal("hide")
55
- callback()
56
- )
57
- )
58
- .end()
59
-
60
- .on('keypress', (e) ->
61
- $('.modal-footer a:last').trigger('click') if e.keyCode == 13 # Enter Key Code
62
- )
63
-
64
- .on("hidden", -> $(@).remove())
65
-
66
- .modal("show")
67
-
68
- .appendTo(document.body)
69
-
70
- $.rails.allowAction = (element) ->
71
- $(element).blur();
72
- message = element.data("confirm")
73
- answer = false
74
- return true unless message
75
-
76
- if $.rails.fire(element, "confirm")
77
- TwitterBootstrapConfirmBox message, element, ->
78
- if $.rails.fire(element, "confirm:complete", [answer])
79
- allowAction = $.rails.allowAction
80
-
81
- $.rails.allowAction = ->
82
- true
83
-
84
- if element.get(0).click
85
- element.get(0).click()
86
-
87
- else if Event?
88
- evt = new Event("click", {
89
- bubbles: true,
90
- cancelable: true,
91
- view: window,
92
- detail: 0,
93
- screenX: 0,
94
- screenY: 0,
95
- clientX: 0,
96
- clientY: 0,
97
- ctrlKey: false,
98
- altKey: false,
99
- shiftKey: false,
100
- metaKey: false,
101
- button: 0,
102
- relatedTarget: document.body.parentNode
103
- })
104
- element.get(0).dispatchEvent(evt)
105
-
106
- else if $.isFunction(document.createEvent)
107
- evt = document.createEvent "MouseEvents"
108
- evt.initMouseEvent(
109
- "click",
110
- true, # e.bubbles,
111
- true, # e.cancelable,
112
- window, # e.view,
113
- 0, # e.detail,
114
- 0, # e.screenX,
115
- 0, # e.screenY,
116
- 0, # e.clientX,
117
- 0, # e.clientY,
118
- false, # e.ctrlKey,
119
- false, # e.altKey,
120
- false, # e.shiftKey,
121
- false, # e.metaKey,
122
- 0, # e.button,
123
- document.body.parentNode # e.relatedTarget
124
- )
125
- element.get(0).dispatchEvent(evt)
126
-
127
- $.rails.allowAction = allowAction
128
-
129
- false