notie-rails 2.0.1 → 2.1.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.
- checksums.yaml +4 -4
- data/README.md +5 -2
- data/lib/notie/rails/version.rb +1 -1
- data/notie-rails.gemspec +3 -2
- data/vendor/assets/javascripts/notie.js +165 -96
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f7407007d91f112c037c964c3a53f802d360a7e
|
4
|
+
data.tar.gz: ddc80bcbe1975da8f4830fbed659b74c588ffff6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2e1e32d261cde5cc20947925ba7f41cea7e5dd9cae089d1223aace54b9b599edf9cf13c742cc40219dc1cdebb548df6b491ed618e05fafd1303196888821333
|
7
|
+
data.tar.gz: 31178510fcab56bd1b373cefe7e6337c8d901be7868d19ac0c42c69c365eabacfe74b7d831e29ceb166526863741c49b9fe28390b346889c6ee8dfe7d0d1115f
|
data/README.md
CHANGED
@@ -18,14 +18,17 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
See
|
21
|
+
###[See notie.js for questions about the actual javascript library.](https://jaredreich.com/projects/notie.js/)
|
22
22
|
|
23
|
-
|
23
|
+
Otherwise fill out an issue if there are rails issues and I will do my best to attend to them in a timely fashion.
|
24
|
+
|
25
|
+
After you have added `notie-rails` to your gemfile, include it to the asset pipeline by adding the following line to your `app/assets/javascripts/application.js`
|
24
26
|
|
25
27
|
```ruby
|
26
28
|
//= require notie.js
|
27
29
|
```
|
28
30
|
## Contributing
|
31
|
+
Please do not edit the notie.js file. This project is not associated with the notie.js project, it simply packages it for easy integration with rails.
|
29
32
|
|
30
33
|
1. Fork it ( https://github.com/djds23/notie-rails/fork )
|
31
34
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
data/lib/notie/rails/version.rb
CHANGED
data/notie-rails.gemspec
CHANGED
@@ -8,12 +8,13 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Notie::Rails::VERSION
|
9
9
|
spec.authors = ["Dean Silfen"]
|
10
10
|
spec.email = ["dean.silfen@gmail.com"]
|
11
|
+
spec.license = "MIT"
|
11
12
|
|
12
13
|
spec.summary = %q{A rails asset pipeline gem for notie.js}
|
13
|
-
spec.description = %q{A rails asset pipeline gem for notie.js
|
14
|
+
spec.description = %q{A rails asset pipeline gem for notie.js. see notie.js documentation for more info: https://jaredreich.com/projects/notie.js/. This project is not associated with the notie.js project, it simply packages it for easy integration with rails.}
|
15
|
+
spec.homepage = 'https://github.com/djds23/notie-rails'
|
14
16
|
|
15
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
16
|
-
spec.bindir = "exe"
|
17
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
18
19
|
spec.require_paths = ["lib"]
|
19
20
|
|
@@ -9,7 +9,7 @@
|
|
9
9
|
* Project home:
|
10
10
|
* https://jaredreich.com/projects/notie.js
|
11
11
|
*
|
12
|
-
* Version: 2.0
|
12
|
+
* Version: 2.1.0
|
13
13
|
*
|
14
14
|
*/
|
15
15
|
|
@@ -24,6 +24,7 @@ var notie = function(){
|
|
24
24
|
var font_size_big = '24px';
|
25
25
|
var font_change_screen_width = 600;
|
26
26
|
var animation_delay = 0.3;
|
27
|
+
var background_click_dismiss = true;
|
27
28
|
|
28
29
|
// notie.alert colors
|
29
30
|
var alert_color_success_background = '#57BF57';
|
@@ -48,7 +49,7 @@ var notie = function(){
|
|
48
49
|
var alert_text_id = 'notie-alert-text';
|
49
50
|
var confirm_outer_id = 'notie-confirm-outer';
|
50
51
|
var confirm_inner_id = 'notie-confirm-inner';
|
51
|
-
var
|
52
|
+
var confirm_background_id = 'notie-confirm-background';
|
52
53
|
var confirm_yes_id = 'notie-confirm-yes';
|
53
54
|
var confirm_no_id = 'notie-confirm-no';
|
54
55
|
var confirm_text_id = 'notie-confirm-text';
|
@@ -56,7 +57,7 @@ var notie = function(){
|
|
56
57
|
var confirm_no_text_id = 'notie-confirm-no-text';
|
57
58
|
var input_outer_id = 'notie-input-outer';
|
58
59
|
var input_inner_id = 'notie-input-inner';
|
59
|
-
var
|
60
|
+
var input_background_id = 'notie-input-background';
|
60
61
|
var input_div_id = 'notie-input-div';
|
61
62
|
var input_field_id = 'notie-input-field';
|
62
63
|
var input_yes_id = 'notie-input-yes';
|
@@ -69,6 +70,91 @@ var notie = function(){
|
|
69
70
|
|
70
71
|
|
71
72
|
|
73
|
+
|
74
|
+
|
75
|
+
// HELPERS
|
76
|
+
// *********************************************
|
77
|
+
|
78
|
+
// Function for resize listeners for font-size
|
79
|
+
var resizeListener = function resizeListener(ele) {
|
80
|
+
if (window.innerWidth <= font_change_screen_width) { ele.style.fontSize = font_size_small; }
|
81
|
+
else { ele.style.fontSize = font_size_big; }
|
82
|
+
};
|
83
|
+
|
84
|
+
|
85
|
+
// Debounce function (credit to Underscore.js)
|
86
|
+
var debounce_time = 500;
|
87
|
+
var debounce = function debounce(func, wait, immediate) {
|
88
|
+
var timeout;
|
89
|
+
return function() {
|
90
|
+
var context = this, args = arguments;
|
91
|
+
var later = function() {
|
92
|
+
timeout = null;
|
93
|
+
if (!immediate) func.apply(context, args);
|
94
|
+
};
|
95
|
+
var callNow = immediate && !timeout;
|
96
|
+
clearTimeout(timeout);
|
97
|
+
timeout = setTimeout(later, wait);
|
98
|
+
if (callNow) func.apply(context, args);
|
99
|
+
};
|
100
|
+
}
|
101
|
+
|
102
|
+
|
103
|
+
// Event listener for enter and escape keys
|
104
|
+
window.addEventListener('keydown', function(event) {
|
105
|
+
var enter_clicked = (event.which == 13 || event.keyCode == 13);
|
106
|
+
var escape_clicked = (event.which == 27 || event.keyCode == 27);
|
107
|
+
if (alert_is_showing) {
|
108
|
+
if (enter_clicked || escape_clicked) {
|
109
|
+
clearTimeout(alert_timeout_1);
|
110
|
+
clearTimeout(alert_timeout_2);
|
111
|
+
alert_hide();
|
112
|
+
}
|
113
|
+
}
|
114
|
+
else if (confirm_is_showing) {
|
115
|
+
if (enter_clicked) {
|
116
|
+
confirm_yes.click();
|
117
|
+
}
|
118
|
+
else if (escape_clicked) {
|
119
|
+
confirm_no.click();
|
120
|
+
}
|
121
|
+
}
|
122
|
+
else if (input_is_showing) {
|
123
|
+
if (enter_clicked) {
|
124
|
+
input_yes.click();
|
125
|
+
}
|
126
|
+
else if (escape_clicked) {
|
127
|
+
input_no.click();
|
128
|
+
}
|
129
|
+
}
|
130
|
+
});
|
131
|
+
|
132
|
+
|
133
|
+
// addEventListener polyfill, fixes a style.height issue for IE8
|
134
|
+
if (typeof Element.prototype.addEventListener === 'undefined') {
|
135
|
+
Element.prototype.addEventListener = Window.prototype.addEventListener = function (e, callback) {
|
136
|
+
e = 'on' + e;
|
137
|
+
return this.attachEvent(e, callback);
|
138
|
+
};
|
139
|
+
}
|
140
|
+
|
141
|
+
|
142
|
+
// Scroll disable and enable for notie.confirm and notie.input
|
143
|
+
var original_body_height, original_body_overflow;
|
144
|
+
function scroll_disable() {
|
145
|
+
original_body_height = document.body.style.height;
|
146
|
+
original_body_overflow = document.body.style.overflow;
|
147
|
+
document.body.style.height = '100%';
|
148
|
+
document.body.style.overflow = 'hidden';
|
149
|
+
}
|
150
|
+
function scroll_enable() {
|
151
|
+
document.body.style.height = original_body_height;
|
152
|
+
document.body.style.overflow = original_body_overflow;
|
153
|
+
}
|
154
|
+
// *********************************************
|
155
|
+
|
156
|
+
|
157
|
+
|
72
158
|
// NOTIE.ALERT
|
73
159
|
// *********************************************
|
74
160
|
|
@@ -88,28 +174,28 @@ var notie = function(){
|
|
88
174
|
alert_outer.style.WebkitTransition = '';
|
89
175
|
alert_outer.style.transition = '';
|
90
176
|
alert_outer.style.cursor = 'pointer';
|
91
|
-
|
177
|
+
|
178
|
+
// Hide alert on click
|
179
|
+
alert_outer.onclick = function() {
|
92
180
|
clearTimeout(alert_timeout_1);
|
93
181
|
clearTimeout(alert_timeout_2);
|
94
182
|
alert_hide();
|
95
|
-
}
|
183
|
+
};
|
184
|
+
|
96
185
|
var alert_inner = document.createElement('div');
|
97
186
|
alert_inner.id = alert_inner_id;
|
98
187
|
alert_inner.style.padding = '20px';
|
99
188
|
alert_inner.style.display = 'table-cell';
|
100
189
|
alert_inner.style.verticalAlign = 'middle';
|
101
190
|
alert_outer.appendChild(alert_inner);
|
102
|
-
|
191
|
+
|
103
192
|
// Initialize notie text
|
104
193
|
var alert_text = document.createElement('span');
|
105
194
|
alert_text.id = alert_text_id;
|
106
195
|
alert_text.style.color = alert_color_text;
|
107
196
|
if (window.innerWidth <= font_change_screen_width) { alert_text.style.fontSize = font_size_small; }
|
108
197
|
else { alert_text.style.fontSize = font_size_big; }
|
109
|
-
window.addEventListener('resize',
|
110
|
-
if (window.innerWidth <= font_change_screen_width) { alert_text.style.fontSize = font_size_small; }
|
111
|
-
else { alert_text.style.fontSize = font_size_big; }
|
112
|
-
}, true);
|
198
|
+
window.addEventListener('resize', debounce(resizeListener.bind(null, alert_text), debounce_time), true);
|
113
199
|
alert_inner.appendChild(alert_text);
|
114
200
|
|
115
201
|
// Attach notie to the body element
|
@@ -123,6 +209,9 @@ var notie = function(){
|
|
123
209
|
var was_clicked_counter = 0;
|
124
210
|
|
125
211
|
function alert(type, message, seconds) {
|
212
|
+
|
213
|
+
// Blur active element for use of enter key, focus input
|
214
|
+
document.activeElement.blur();
|
126
215
|
|
127
216
|
was_clicked_counter++;
|
128
217
|
|
@@ -251,21 +340,27 @@ var notie = function(){
|
|
251
340
|
confirm_outer.style.WebkitTransition = '';
|
252
341
|
confirm_outer.style.transition = '';
|
253
342
|
|
254
|
-
var
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
343
|
+
var confirm_background = document.createElement('div');
|
344
|
+
confirm_background.id = confirm_background_id;
|
345
|
+
confirm_background.style.position = 'fixed';
|
346
|
+
confirm_background.style.top = '0';
|
347
|
+
confirm_background.style.left = '0';
|
348
|
+
confirm_background.style.zIndex = '999999997';
|
349
|
+
confirm_background.style.height = '100%';
|
350
|
+
confirm_background.style.width = '100%';
|
351
|
+
confirm_background.style.display = 'none';
|
352
|
+
confirm_background.style.backgroundColor = 'white';
|
353
|
+
confirm_background.style.MozTransition = 'all ' + animation_delay + 's ease';
|
354
|
+
confirm_background.style.WebkitTransition = 'all ' + animation_delay + 's ease';
|
355
|
+
confirm_background.style.transition = 'all ' + animation_delay + 's ease';
|
356
|
+
confirm_background.style.opacity = '0';
|
357
|
+
|
358
|
+
// Hide notie.confirm on background click
|
359
|
+
confirm_background.onclick = function() {
|
360
|
+
if (background_click_dismiss) {
|
361
|
+
confirm_hide();
|
362
|
+
}
|
363
|
+
};
|
269
364
|
|
270
365
|
var confirm_inner = document.createElement('div');
|
271
366
|
confirm_inner.id = confirm_inner_id;
|
@@ -304,10 +399,7 @@ var notie = function(){
|
|
304
399
|
confirm_text.style.color = confirm_and_input_color_text;
|
305
400
|
if (window.innerWidth <= font_change_screen_width) { confirm_text.style.fontSize = font_size_small; }
|
306
401
|
else { confirm_text.style.fontSize = font_size_big; }
|
307
|
-
window.addEventListener('resize',
|
308
|
-
if (window.innerWidth <= font_change_screen_width) { confirm_text.style.fontSize = font_size_small; }
|
309
|
-
else { confirm_text.style.fontSize = font_size_big; }
|
310
|
-
}, true);
|
402
|
+
window.addEventListener('resize', debounce(resizeListener.bind(null, confirm_text), debounce_time), true);
|
311
403
|
confirm_inner.appendChild(confirm_text);
|
312
404
|
|
313
405
|
var confirm_yes_text = document.createElement('span');
|
@@ -315,10 +407,7 @@ var notie = function(){
|
|
315
407
|
confirm_yes_text.style.color = confirm_and_input_color_yes_text;
|
316
408
|
if (window.innerWidth <= font_change_screen_width) { confirm_yes_text.style.fontSize = font_size_small; }
|
317
409
|
else { confirm_yes_text.style.fontSize = font_size_big; }
|
318
|
-
window.addEventListener('resize',
|
319
|
-
if (window.innerWidth <= font_change_screen_width) { confirm_yes_text.style.fontSize = font_size_small; }
|
320
|
-
else { confirm_yes_text.style.fontSize = font_size_big; }
|
321
|
-
}, true);
|
410
|
+
window.addEventListener('resize', debounce(resizeListener.bind(null, confirm_yes_text), debounce_time), true);
|
322
411
|
confirm_yes.appendChild(confirm_yes_text);
|
323
412
|
|
324
413
|
var confirm_no_text = document.createElement('span');
|
@@ -326,15 +415,12 @@ var notie = function(){
|
|
326
415
|
confirm_no_text.style.color = confirm_and_input_color_no_text;
|
327
416
|
if (window.innerWidth <= font_change_screen_width) { confirm_no_text.style.fontSize = font_size_small; }
|
328
417
|
else { confirm_no_text.style.fontSize = font_size_big; }
|
329
|
-
window.addEventListener('resize',
|
330
|
-
if (window.innerWidth <= font_change_screen_width) { confirm_no_text.style.fontSize = font_size_small; }
|
331
|
-
else { confirm_no_text.style.fontSize = font_size_big; }
|
332
|
-
}, true);
|
418
|
+
window.addEventListener('resize', debounce(resizeListener.bind(null, confirm_no_text), debounce_time), true);
|
333
419
|
confirm_no.appendChild(confirm_no_text);
|
334
420
|
|
335
421
|
// Attach confirm elements to the body element
|
336
422
|
document.body.appendChild(confirm_outer);
|
337
|
-
document.body.appendChild(
|
423
|
+
document.body.appendChild(confirm_background);
|
338
424
|
|
339
425
|
// Declare variables
|
340
426
|
var confirm_height = 0;
|
@@ -342,6 +428,9 @@ var notie = function(){
|
|
342
428
|
|
343
429
|
function confirm(title, yes_text, no_text, yes_callback) {
|
344
430
|
|
431
|
+
// Blur active element for use of enter key
|
432
|
+
document.activeElement.blur();
|
433
|
+
|
345
434
|
if (alert_is_showing) {
|
346
435
|
// Hide notie.alert
|
347
436
|
clearTimeout(alert_timeout_1);
|
@@ -379,7 +468,7 @@ var notie = function(){
|
|
379
468
|
confirm_outer.style.top = '-10000px';
|
380
469
|
confirm_outer.style.display = 'table';
|
381
470
|
confirm_outer.style.top = '-' + confirm_outer.offsetHeight - 5 + 'px';
|
382
|
-
|
471
|
+
confirm_background.style.display = 'block';
|
383
472
|
|
384
473
|
setTimeout(function() {
|
385
474
|
|
@@ -389,7 +478,7 @@ var notie = function(){
|
|
389
478
|
confirm_outer.style.transition = 'all ' + animation_delay + 's ease';
|
390
479
|
|
391
480
|
confirm_outer.style.top = 0;
|
392
|
-
|
481
|
+
confirm_background.style.opacity = '0.75';
|
393
482
|
|
394
483
|
setTimeout(function() {
|
395
484
|
confirm_is_showing = true;
|
@@ -414,7 +503,7 @@ var notie = function(){
|
|
414
503
|
function confirm_hide() {
|
415
504
|
|
416
505
|
confirm_outer.style.top = '-' + confirm_outer.offsetHeight - 5 + 'px';
|
417
|
-
|
506
|
+
confirm_background.style.opacity = '0';
|
418
507
|
|
419
508
|
setTimeout(function() {
|
420
509
|
|
@@ -422,7 +511,7 @@ var notie = function(){
|
|
422
511
|
confirm_outer.style.MozTransition = '';
|
423
512
|
confirm_outer.style.WebkitTransition = '';
|
424
513
|
confirm_outer.style.transition = '';
|
425
|
-
|
514
|
+
confirm_background.style.display = 'none';
|
426
515
|
|
427
516
|
confirm_outer.style.top = '-10000px';
|
428
517
|
|
@@ -455,21 +544,27 @@ var notie = function(){
|
|
455
544
|
input_outer.style.WebkitTransition = '';
|
456
545
|
input_outer.style.transition = '';
|
457
546
|
|
458
|
-
var
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
547
|
+
var input_background = document.createElement('div');
|
548
|
+
input_background.id = input_background_id;
|
549
|
+
input_background.style.position = 'fixed';
|
550
|
+
input_background.style.top = '0';
|
551
|
+
input_background.style.left = '0';
|
552
|
+
input_background.style.zIndex = '999999997';
|
553
|
+
input_background.style.height = '100%';
|
554
|
+
input_background.style.width = '100%';
|
555
|
+
input_background.style.display = 'none';
|
556
|
+
input_background.style.backgroundColor = 'white';
|
557
|
+
input_background.style.MozTransition = 'all ' + animation_delay + 's ease';
|
558
|
+
input_background.style.WebkitTransition = 'all ' + animation_delay + 's ease';
|
559
|
+
input_background.style.transition = 'all ' + animation_delay + 's ease';
|
560
|
+
input_background.style.opacity = '0';
|
561
|
+
|
562
|
+
// Hide notie.input on background click
|
563
|
+
input_background.onclick = function() {
|
564
|
+
if (background_click_dismiss) {
|
565
|
+
input_hide();
|
566
|
+
}
|
567
|
+
};
|
473
568
|
|
474
569
|
var input_inner = document.createElement('div');
|
475
570
|
input_inner.id = input_inner_id;
|
@@ -509,10 +604,7 @@ var notie = function(){
|
|
509
604
|
input_field.style.fontSize = font_size_big;
|
510
605
|
if (window.innerWidth <= font_change_screen_width) { input_field.style.fontSize = font_size_small; }
|
511
606
|
else { input_field.style.fontSize = font_size_big; }
|
512
|
-
window.addEventListener('resize',
|
513
|
-
if (window.innerWidth <= font_change_screen_width) { input_field.style.fontSize = font_size_small; }
|
514
|
-
else { input_field.style.fontSize = font_size_big; }
|
515
|
-
}, true);
|
607
|
+
window.addEventListener('resize', debounce(resizeListener.bind(null, input_field), debounce_time), true);
|
516
608
|
input_div.appendChild(input_field);
|
517
609
|
|
518
610
|
var input_yes = document.createElement('div');
|
@@ -542,10 +634,7 @@ var notie = function(){
|
|
542
634
|
input_text.style.color = confirm_and_input_color_text;
|
543
635
|
if (window.innerWidth <= font_change_screen_width) { input_text.style.fontSize = font_size_small; }
|
544
636
|
else { input_text.style.fontSize = font_size_big; }
|
545
|
-
window.addEventListener('resize',
|
546
|
-
if (window.innerWidth <= font_change_screen_width) { input_text.style.fontSize = font_size_small; }
|
547
|
-
else { input_text.style.fontSize = font_size_big; }
|
548
|
-
}, true);
|
637
|
+
window.addEventListener('resize', debounce(resizeListener.bind(null, input_text), debounce_time), true);
|
549
638
|
input_inner.appendChild(input_text);
|
550
639
|
|
551
640
|
var input_yes_text = document.createElement('span');
|
@@ -553,10 +642,7 @@ var notie = function(){
|
|
553
642
|
input_yes_text.style.color = confirm_and_input_color_yes_text;
|
554
643
|
if (window.innerWidth <= font_change_screen_width) { input_yes_text.style.fontSize = font_size_small; }
|
555
644
|
else { input_yes_text.style.fontSize = font_size_big; }
|
556
|
-
window.addEventListener('resize',
|
557
|
-
if (window.innerWidth <= font_change_screen_width) { input_yes_text.style.fontSize = font_size_small; }
|
558
|
-
else { input_yes_text.style.fontSize = font_size_big; }
|
559
|
-
}, true);
|
645
|
+
window.addEventListener('resize', debounce(resizeListener.bind(null, input_yes_text), debounce_time), true);
|
560
646
|
input_yes.appendChild(input_yes_text);
|
561
647
|
|
562
648
|
var input_no_text = document.createElement('span');
|
@@ -564,15 +650,12 @@ var notie = function(){
|
|
564
650
|
input_no_text.style.color = confirm_and_input_color_no_text;
|
565
651
|
if (window.innerWidth <= font_change_screen_width) { input_no_text.style.fontSize = font_size_small; }
|
566
652
|
else { input_no_text.style.fontSize = font_size_big; }
|
567
|
-
window.addEventListener('resize',
|
568
|
-
if (window.innerWidth <= font_change_screen_width) { input_no_text.style.fontSize = font_size_small; }
|
569
|
-
else { input_no_text.style.fontSize = font_size_big; }
|
570
|
-
}, true);
|
653
|
+
window.addEventListener('resize', debounce(resizeListener.bind(null, input_no_text), debounce_time), true);
|
571
654
|
input_no.appendChild(input_no_text);
|
572
655
|
|
573
656
|
// Attach input elements to the body element
|
574
657
|
document.body.appendChild(input_outer);
|
575
|
-
document.body.appendChild(
|
658
|
+
document.body.appendChild(input_background);
|
576
659
|
|
577
660
|
// Declare variables
|
578
661
|
var input_height = 0;
|
@@ -580,6 +663,10 @@ var notie = function(){
|
|
580
663
|
|
581
664
|
function input(title, submit_text, cancel_text, type, placeholder, submit_callback, prefilled_value_optional) {
|
582
665
|
|
666
|
+
// Blur active element for use of enter key, focus input
|
667
|
+
document.activeElement.blur();
|
668
|
+
setTimeout(function() { input_field.focus(); }, (animation_delay * 1000));
|
669
|
+
|
583
670
|
input_field.setAttribute('type', type);
|
584
671
|
input_field.setAttribute('placeholder', placeholder);
|
585
672
|
input_field.value = '';
|
@@ -621,7 +708,7 @@ var notie = function(){
|
|
621
708
|
input_outer.style.top = '-10000px';
|
622
709
|
input_outer.style.display = 'table';
|
623
710
|
input_outer.style.top = '-' + input_outer.offsetHeight - 5 + 'px';
|
624
|
-
|
711
|
+
input_background.style.display = 'block';
|
625
712
|
|
626
713
|
setTimeout(function() {
|
627
714
|
|
@@ -631,7 +718,7 @@ var notie = function(){
|
|
631
718
|
input_outer.style.transition = 'all ' + animation_delay + 's ease';
|
632
719
|
|
633
720
|
input_outer.style.top = 0;
|
634
|
-
|
721
|
+
input_background.style.opacity = '0.75';
|
635
722
|
|
636
723
|
setTimeout(function() {
|
637
724
|
input_is_showing = true;
|
@@ -656,7 +743,7 @@ var notie = function(){
|
|
656
743
|
function input_hide() {
|
657
744
|
|
658
745
|
input_outer.style.top = '-' + input_outer.offsetHeight - 5 + 'px';
|
659
|
-
|
746
|
+
input_background.style.opacity = '0';
|
660
747
|
|
661
748
|
setTimeout(function() {
|
662
749
|
|
@@ -664,7 +751,7 @@ var notie = function(){
|
|
664
751
|
input_outer.style.MozTransition = '';
|
665
752
|
input_outer.style.WebkitTransition = '';
|
666
753
|
input_outer.style.transition = '';
|
667
|
-
|
754
|
+
input_background.style.display = 'none';
|
668
755
|
|
669
756
|
input_outer.style.top = '-10000px';
|
670
757
|
|
@@ -677,24 +764,6 @@ var notie = function(){
|
|
677
764
|
}
|
678
765
|
|
679
766
|
|
680
|
-
|
681
|
-
|
682
|
-
// SCROLL DISABLE AND ENABLE FOR NOTIE.CONFIRM and NOTIE.INPUT
|
683
|
-
// *********************************************
|
684
|
-
var original_body_height, original_body_overflow;
|
685
|
-
function scroll_disable() {
|
686
|
-
original_body_height = document.body.style.height;
|
687
|
-
original_body_overflow = document.body.style.overflow;
|
688
|
-
document.body.style.height = '100%;';
|
689
|
-
document.body.style.overflow = 'hidden';
|
690
|
-
}
|
691
|
-
function scroll_enable() {
|
692
|
-
document.body.style.height = original_body_height;
|
693
|
-
document.body.style.overflow = original_body_overflow;
|
694
|
-
}
|
695
|
-
|
696
|
-
|
697
|
-
|
698
767
|
|
699
768
|
return {
|
700
769
|
alert: alert,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notie-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dean Silfen
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,8 +38,9 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
-
description: 'A rails asset pipeline gem for notie.js
|
42
|
-
for more info: https://jaredreich.com/projects/notie.js
|
41
|
+
description: 'A rails asset pipeline gem for notie.js. see notie.js documentation
|
42
|
+
for more info: https://jaredreich.com/projects/notie.js/. This project is not associated
|
43
|
+
with the notie.js project, it simply packages it for easy integration with rails.'
|
43
44
|
email:
|
44
45
|
- dean.silfen@gmail.com
|
45
46
|
executables: []
|
@@ -57,8 +58,9 @@ files:
|
|
57
58
|
- lib/notie/rails/version.rb
|
58
59
|
- notie-rails.gemspec
|
59
60
|
- vendor/assets/javascripts/notie.js
|
60
|
-
homepage:
|
61
|
-
licenses:
|
61
|
+
homepage: https://github.com/djds23/notie-rails
|
62
|
+
licenses:
|
63
|
+
- MIT
|
62
64
|
metadata: {}
|
63
65
|
post_install_message:
|
64
66
|
rdoc_options: []
|