active_admin_pro 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/active_admin_pro.js +1 -37
  3. data/app/assets/javascripts/active_admin_pro/actions/new.js +7 -5
  4. data/app/assets/javascripts/active_admin_pro/actions/show.js +9 -7
  5. data/app/assets/javascripts/active_admin_pro/components/codemirror_input.js +17 -21
  6. data/app/assets/javascripts/active_admin_pro/components/link.js +13 -15
  7. data/app/assets/javascripts/active_admin_pro/components/phone_input.js +9 -8
  8. data/app/assets/javascripts/active_admin_pro/components/progress_bar.js +2 -0
  9. data/app/assets/javascripts/active_admin_pro/components/select_input.js +12 -10
  10. data/app/assets/javascripts/active_admin_pro/components/sortable_handle.js +8 -6
  11. data/app/assets/javascripts/active_admin_pro/components/summernote_input.js +7 -5
  12. data/app/assets/javascripts/active_admin_pro/components/text_input.js +9 -8
  13. data/app/assets/javascripts/active_admin_pro/components/time_zone_input.js +9 -8
  14. data/app/assets/javascripts/active_admin_pro/components/title_to_slug.js +11 -9
  15. data/app/assets/stylesheets/active_admin_pro/components/codemirror_input.scss +1 -1
  16. data/app/assets/stylesheets/active_admin_pro/layout/flashes.scss +13 -19
  17. data/app/assets/stylesheets/codemirror/themes/active_admin_pro.scss +117 -0
  18. data/app/inputs/codemirror_input.rb +1 -1
  19. data/app/models/{activeadmin_pro → active_admin_pro}/summernote_image.rb +0 -0
  20. data/config/initializers/active_admin.rb +1 -1
  21. data/lib/active_admin_pro.rb +1 -0
  22. data/lib/active_admin_pro/engine.rb +1 -1
  23. data/lib/active_admin_pro/version.rb +1 -1
  24. data/lib/generators/{activeadmin_pro → active_admin_pro}/install_generator.rb +0 -0
  25. data/lib/tasks/{activeadmin_pro_tasks.rake → active_admin_pro_tasks.rake} +1 -1
  26. data/vendor/assets/javascripts/summernote.js +5 -41
  27. metadata +21 -7
  28. data/app/assets/javascripts/active_admin_pro/components/flashes.js +0 -9
  29. data/app/assets/stylesheets/codemirror/themes/activeadmin_pro.scss +0 -117
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2352d25e3fae68b6bf5e4e906a14e61d5207a868
4
- data.tar.gz: 27f15efc18b3947b5fd51ac1de8dc56656a82aa3
3
+ metadata.gz: 40da224f2c53a66c89d0bb2d287d2f2860cf7c66
4
+ data.tar.gz: d93c77773de0d7d57a0faf4ef1784c9e349ce85f
5
5
  SHA512:
6
- metadata.gz: 4e8ce29e47e3762b2faeb0ebbe0ddf135989660373cc5c148bd58bcdd1cf1c37d24cbbd98693f637d8f9085acf15bbf95486e49c064a8f9e583f319d2ae832cb
7
- data.tar.gz: 70a1e7d9c24c133f19c9cc022cb6c62ccd1c81c84831bc37cb303098063bd877f5a08b25920fbc4c14ae6f745232087ba74c326fc378570689b68748fdee67d4
6
+ metadata.gz: f210b81c192fd547de7e428f236eeed58d8fb43c36ef3f2e53f852af5414ce6046a6758cbd1767dfd54886ab42725b1cc9d8e0e6334f68acc8ebf581f1788ba9
7
+ data.tar.gz: ccf864b13be94639683ab75c319aeb7c60d02ff137d5f5b631aee17d895c5a35bc1aa3a212580ead095b954233aead5abb486e1048659780858359e46b399e56
@@ -1,41 +1,5 @@
1
- /* globals Turbolinks */
2
1
  //= require active_admin/base
3
2
  //= require activeadmin-sortable
3
+ //= require codelation
4
4
  //= require turbolinks
5
- //= require_self
6
5
  //= require_tree ./active_admin_pro
7
-
8
- // The app is fully ready for enabling transition cache,
9
- // but I can't quite prevent all elements from flashing on load.
10
- // Turbolinks.enableTransitionCache();
11
- Turbolinks.enableProgressBar();
12
-
13
- // I was struggling to get everything to fire off every page load,
14
- // but only once per page load, so I came up with crap.
15
- //
16
- // Usage:
17
- //
18
- // App.ready(function() {
19
- // console.log('This will be called once after every page load.');
20
- // });
21
- if (window.App === undefined) {
22
- window.App = {
23
- initialized: false,
24
- initializers: []
25
- };
26
- }
27
-
28
- App.ready = function(readyFunction) {
29
- if (!App.initialized) {
30
- App.initializers.push(readyFunction);
31
- }
32
- };
33
-
34
- if (!App.initialized) {
35
- $(document).on('ready page:load', function() {
36
- $.each(App.initializers, function(index, initializer) {
37
- initializer();
38
- });
39
- App.initialized = true;
40
- });
41
- }
@@ -1,8 +1,10 @@
1
1
  // Enable dropdown for multiple actions on show pages.
2
- App.ready(function() {
2
+ (function() {
3
3
  "use strict";
4
4
 
5
- setTimeout(function() {
6
- $('body.new #main_content form input:not([type="hidden"]):first').focus();
7
- }, 10);
8
- });
5
+ App.register('component').enter(function() {
6
+ setTimeout(function() {
7
+ $('body.new #main_content form input:not([type="hidden"]):first').focus();
8
+ }, 10);
9
+ })
10
+ })();
@@ -1,12 +1,14 @@
1
1
  // Enable dropdown for multiple actions on show pages.
2
- App.ready(function() {
2
+ (function() {
3
3
  "use strict";
4
4
 
5
- $('body.show #titlebar_right').click(function() {
6
- $(this).toggleClass('active');
7
- });
5
+ App.register('component').enter(function() {
6
+ $('body.show #titlebar_right').click(function() {
7
+ $(this).toggleClass('active');
8
+ });
8
9
 
9
- $('body.show #active_admin_content').click(function() {
10
- $('body.show #titlebar_right').removeClass('active');
10
+ $('body.show #active_admin_content').click(function() {
11
+ $('body.show #titlebar_right').removeClass('active');
12
+ });
11
13
  });
12
- });
14
+ })();
@@ -35,14 +35,12 @@
35
35
 
36
36
  // CodeMirror editor field.
37
37
  // @see https://codemirror.net
38
- App.ready(function() {
38
+ (function() {
39
39
  "use strict";
40
40
 
41
- var codemirrorInputs, windowElement;
42
-
43
- function activateBehavior() {
44
- codemirrorInputs = $('.input.codemirror');
45
- windowElement = $(window);
41
+ App.register('component').enter(function() {
42
+ var codemirrorInputs = $('.input.codemirror');
43
+ var windowElement = $(window);
46
44
 
47
45
  codemirrorInputs.each(function() {
48
46
  var wrapper = $(this);
@@ -73,20 +71,18 @@ App.ready(function() {
73
71
  });
74
72
  });
75
73
 
74
+ // Code Mirror works best when there is a fixed width on its container, so
75
+ // let's detect the size the container is without the input and set the width.
76
+ function resizeCodemirrorInputs() {
77
+ codemirrorInputs.each(function() {
78
+ var wrapper = $(this);
79
+ wrapper.hide();
80
+ wrapper.css('width', wrapper.parent().innerWidth() + 'px');
81
+ wrapper.show();
82
+ });
83
+ }
84
+
76
85
  resizeCodemirrorInputs();
77
86
  windowElement.resize(resizeCodemirrorInputs);
78
- }
79
-
80
- // Code Mirror works best when there is a fixed width on its container, so
81
- // let's detect the size the container is without the input and set the width.
82
- function resizeCodemirrorInputs() {
83
- codemirrorInputs.each(function() {
84
- var wrapper = $(this);
85
- wrapper.hide();
86
- wrapper.css('width', wrapper.parent().innerWidth() + 'px');
87
- wrapper.show();
88
- });
89
- }
90
-
91
- activateBehavior();
92
- });
87
+ });
88
+ })();
@@ -1,23 +1,21 @@
1
- App.ready(function() {
1
+ (function() {
2
2
  "use strict";
3
- var body = $('body');
4
- var links = $('a:not([data-method="delete"]):not([data-action="destroy"]):not(.has_many_add):not(.dropdown_menu_button):not([target="_blank"])');
3
+
4
+ var body, links;
5
5
 
6
6
  // Add active class on click to style while loading via turbolinks
7
7
  // and add loading class to the body element.
8
- links.click(function() {
9
- body.addClass('loading');
10
- $(this).addClass('active');
11
- });
12
-
13
- // Remove loading and active classes on page load
14
- body.removeClass('loading');
15
- links.removeClass('active');
8
+ App.register('component').enter(function() {
9
+ body = $('body');
10
+ links = $('a:not([data-method="delete"]):not([data-action="destroy"]):not(.has_many_add):not(.dropdown_menu_button):not([target="_blank"])');
16
11
 
17
- // We also need to make sure to remove the loading classes when the
18
- // page is restored by Turbolinks when using the back button
19
- document.addEventListener('page:restore', function() {
12
+ links.click(function() {
13
+ body.addClass('loading');
14
+ $(this).addClass('active');
15
+ });
16
+ }).exit(function() {
17
+ // Remove loading and active classes on page unload
20
18
  body.removeClass('loading');
21
19
  links.removeClass('active');
22
20
  });
23
- });
21
+ })();
@@ -1,7 +1,7 @@
1
1
  //= require intl-tel-input
2
2
  //= require intl-tel-utils
3
3
 
4
- App.ready(function() {
4
+ (function() {
5
5
  "use strict";
6
6
 
7
7
  function activateBehavior() {
@@ -42,11 +42,12 @@ App.ready(function() {
42
42
  });
43
43
  }
44
44
 
45
- $('.has_many_add').click(function() {
46
- setTimeout(function() {
47
- activateBehavior();
48
- }, 0);
45
+ App.register('component').enter(function() {
46
+ activateBehavior();
47
+ $('.has_many_add').click(function() {
48
+ setTimeout(function() {
49
+ activateBehavior();
50
+ }, 0);
51
+ });
49
52
  });
50
-
51
- activateBehavior();
52
- });
53
+ })();
@@ -0,0 +1,2 @@
1
+ /* globals Turbolinks */
2
+ Turbolinks.enableProgressBar();
@@ -1,5 +1,5 @@
1
1
  // Highlight the label for a select field on focus.
2
- App.ready(function() {
2
+ (function() {
3
3
  "use strict";
4
4
 
5
5
  function activateBehavior(selector) {
@@ -19,13 +19,15 @@ App.ready(function() {
19
19
  });
20
20
  }
21
21
 
22
- $('.has_many_add').click(function() {
23
- setTimeout(function() {
24
- activateBehavior('.has_many_fields:last .input.country');
25
- activateBehavior('.has_many_fields:last .input.select');
26
- }, 0);
27
- });
22
+ App.register('component').enter(function() {
23
+ activateBehavior('.input.country:not(.filter_form_field)');
24
+ activateBehavior('.input.select:not(.filter_form_field)');
28
25
 
29
- activateBehavior('.input.country:not(.filter_form_field)');
30
- activateBehavior('.input.select:not(.filter_form_field)');
31
- });
26
+ $('.has_many_add').click(function() {
27
+ setTimeout(function() {
28
+ activateBehavior('.has_many_fields:last .input.country');
29
+ activateBehavior('.has_many_fields:last .input.select');
30
+ }, 0);
31
+ });
32
+ });
33
+ })();
@@ -1,8 +1,10 @@
1
- // Activate any sortable columns. The gem on its own doesn't handle using Turbolinks.
2
- // @see https://github.com/neo/activeadmin-sortable
3
- App.ready(function() {
1
+ (function() {
4
2
  "use strict";
5
3
 
6
- // Normally fired by $(document).ready
7
- $('.handle').closest('tbody').activeAdminSortable();
8
- });
4
+ // Activate any sortable columns. The gem on its own doesn't handle using Turbolinks.
5
+ // @see https://github.com/neo/activeadmin-sortable
6
+ App.register('component').enter(function() {
7
+ // Normally fired by $(document).ready
8
+ $('.handle').closest('tbody').activeAdminSortable();
9
+ });
10
+ })();
@@ -8,7 +8,7 @@
8
8
 
9
9
  // Summernote editor field.
10
10
  // @see http://summernote.org
11
- App.ready(function() {
11
+ (function() {
12
12
  "use strict";
13
13
 
14
14
  var toolbar = [
@@ -28,7 +28,7 @@ App.ready(function() {
28
28
  codemirror: {
29
29
  lineNumbers: true,
30
30
  mode: 'htmlmixed',
31
- theme: 'activeadmin_pro'
31
+ theme: 'active_admin_pro'
32
32
  },
33
33
  height: 200,
34
34
  minHeight: 180,
@@ -90,7 +90,7 @@ App.ready(function() {
90
90
  $.ajax({
91
91
  data: data,
92
92
  type: "POST",
93
- url: "/admin/activeadmin_pro_summernote_images",
93
+ url: "/admin/active_admin_pro_summernote_images",
94
94
  cache: false,
95
95
  contentType: false,
96
96
  processData: false,
@@ -128,5 +128,7 @@ App.ready(function() {
128
128
  });
129
129
  }
130
130
 
131
- activateBehavior();
132
- });
131
+ App.register('component').enter(function() {
132
+ activateBehavior();
133
+ });
134
+ })();
@@ -1,7 +1,7 @@
1
1
  // This is a Google Material Design inspired text field.
2
2
  // The JavaScript doesn't do much. It just set the classes needed
3
3
  // by the CSS based on the input's focus and blank/filled states.
4
- App.ready(function() {
4
+ (function() {
5
5
  "use strict";
6
6
 
7
7
  function activateBehavior() {
@@ -37,11 +37,12 @@ App.ready(function() {
37
37
  });
38
38
  }
39
39
 
40
- $('.has_many_add').click(function() {
41
- setTimeout(function() {
42
- activateBehavior();
43
- }, 0);
40
+ App.register('component').enter(function() {
41
+ activateBehavior();
42
+ $('.has_many_add').click(function() {
43
+ setTimeout(function() {
44
+ activateBehavior();
45
+ }, 0);
46
+ });
44
47
  });
45
-
46
- activateBehavior();
47
- });
48
+ })();
@@ -1,6 +1,6 @@
1
1
  // Creates a select input populated with time zones and automatically
2
2
  // selects the current time zone detected by the browser.
3
- App.ready(function() {
3
+ (function() {
4
4
  "use strict";
5
5
 
6
6
  var offset, option, select;
@@ -41,11 +41,12 @@ App.ready(function() {
41
41
  return offset;
42
42
  }
43
43
 
44
- $('.has_many_add').click(function() {
45
- setTimeout(function() {
46
- activateBehavior();
47
- }, 0);
44
+ App.register('component').enter(function() {
45
+ activateBehavior();
46
+ $('.has_many_add').click(function() {
47
+ setTimeout(function() {
48
+ activateBehavior();
49
+ }, 0);
50
+ });
48
51
  });
49
-
50
- activateBehavior();
51
- });
52
+ })();
@@ -1,16 +1,18 @@
1
1
  //= require slug
2
2
  /* globals slug */
3
3
 
4
- App.ready(function() {
4
+ (function() {
5
5
  "use strict";
6
6
 
7
- var titleInput = $('.title-to-slug-title');
8
- var slugInput = $('.title-to-slug-slug');
9
- var titleAsSlug;
7
+ App.register('component').enter(function() {
8
+ var titleInput = $('.title-to-slug-title');
9
+ var slugInput = $('.title-to-slug-slug');
10
+ var titleAsSlug;
10
11
 
11
- titleInput.bind('propertychange change click keyup input paste', function() {
12
- titleAsSlug = slug(titleInput.val(), { lower: true });
13
- slugInput.val(titleAsSlug);
14
- slugInput.blur();
12
+ titleInput.bind('propertychange change click keyup input paste', function() {
13
+ titleAsSlug = slug(titleInput.val(), { lower: true });
14
+ slugInput.val(titleAsSlug);
15
+ slugInput.blur();
16
+ });
15
17
  });
16
- });
18
+ })();
@@ -1,5 +1,5 @@
1
1
  @import "codemirror";
2
- @import "codemirror/themes/activeadmin_pro";
2
+ @import "codemirror/themes/active_admin_pro";
3
3
  @import "codemirror/themes/base16-dark";
4
4
  @import "codemirror/themes/base16-light";
5
5
  @import "codemirror/themes/dracula";
@@ -1,7 +1,7 @@
1
- $alert-background-color: rgba(color($red, 700), 0.8);
2
- $alert-text-color: $white;
3
- $notice-background-color: rgba(color($accent-color, 600), 0.9);
4
- $notice-text-color: $white;
1
+ $alert-background-color: rgba($red, 0.85);
2
+ $alert-font-color: $white;
3
+ $notice-background-color: rgba($green, 0.85);
4
+ $notice-font-color: $white;
5
5
 
6
6
  @include keyframes(flash-up) {
7
7
  0% {
@@ -21,32 +21,26 @@ $notice-text-color: $white;
21
21
  }
22
22
  }
23
23
 
24
- .flashes {
24
+ .flash_alert,
25
+ .flash_notice {
26
+ @include animation(flash-up 6s 1);
25
27
  @include transform(translateZ(0) translate3d(0, 100%, 0));
26
28
  bottom: 0;
27
29
  font-size: 1.6em;
28
- left: $navigation-width;
30
+ left: 0;
31
+ line-height: 1.2;
32
+ padding: 0.6em 0.9em;
29
33
  position: fixed;
30
34
  right: 0;
31
35
  text-align: center;
32
- z-index: 1000;
33
-
34
- &.animate {
35
- @include animation(flash-up 6s 1);
36
- }
37
36
  }
38
37
 
39
- .flash_alert,
40
- .flash_error {
38
+ .flash_alert {
41
39
  background-color: $alert-background-color;
42
- color: $alert-text-color;
43
- padding: ($base-font-size + 2px) ($base-font-size * 2);
44
- text-shadow: 0 1px 1px darken($alert-background-color, 20%);
40
+ color: $alert-font-color;
45
41
  }
46
42
 
47
43
  .flash_notice {
48
44
  background-color: $notice-background-color;
49
- color: $notice-text-color;
50
- padding: ($base-font-size + 2px) ($base-font-size * 2);
51
- text-shadow: 0 1px 1px darken($notice-background-color, 20%);
45
+ color: $notice-font-color;
52
46
  }
@@ -0,0 +1,117 @@
1
+ // Pretty good CodeMirror theme that matches the Google Material Design colors
2
+ .cm-s-active_admin_pro.CodeMirror {
3
+ background: color($blue-grey, 50);
4
+ color: color($grey, 800);
5
+ }
6
+
7
+ .cm-s-active_admin_pro div.CodeMirror-selected {
8
+ background: color($blue-grey, 100);
9
+ }
10
+
11
+ .cm-s-active_admin_pro .CodeMirror-line::selection,
12
+ .cm-s-active_admin_pro .CodeMirror-line > span::selection,
13
+ .cm-s-active_admin_pro .CodeMirror-line > span > span::selection {
14
+ background: rgba(color($blue-grey, 50), 0.99);
15
+ }
16
+
17
+ .cm-s-active_admin_pro .CodeMirror-line::-moz-selection,
18
+ .cm-s-active_admin_pro .CodeMirror-line > span::-moz-selection,
19
+ .cm-s-active_admin_pro .CodeMirror-line > span > span::-moz-selection {
20
+ background: rgba(color($blue-grey, 50), 0.99);
21
+ }
22
+
23
+ .cm-s-active_admin_pro .CodeMirror-gutters {
24
+ background: color($blue-grey, 100);
25
+ color: color($blue-grey, 800);
26
+ border-right: 0;
27
+ }
28
+
29
+ .cm-s-active_admin_pro .CodeMirror-guttermarker {
30
+ color: $white;
31
+ }
32
+
33
+ .cm-s-active_admin_pro .CodeMirror-guttermarker-subtle {
34
+ color: color($blue-grey, 800);
35
+ }
36
+
37
+ .cm-s-active_admin_pro .CodeMirror-linenumber {
38
+ color: color($blue-grey, 800);
39
+ }
40
+
41
+ .cm-s-active_admin_pro .CodeMirror-cursor {
42
+ border-left: 1px solid $black;
43
+ }
44
+
45
+ .cm-s-active_admin_pro span.cm-comment {
46
+ color: $grey;
47
+ }
48
+
49
+ .cm-s-active_admin_pro span.cm-atom {
50
+ color: $deep-purple;
51
+ }
52
+
53
+ .cm-s-active_admin_pro span.cm-number {
54
+ color: color($cyan, 700);
55
+ }
56
+
57
+ .cm-s-active_admin_pro span.cm-property {
58
+ color: color($amber, 700);
59
+ }
60
+
61
+ .cm-s-active_admin_pro span.cm-attribute {
62
+ color: $deep-purple;
63
+ }
64
+
65
+ .cm-s-active_admin_pro span.cm-keyword {
66
+ color: $pink;
67
+ }
68
+
69
+ .cm-s-active_admin_pro span.cm-string {
70
+ color: $blue;
71
+ }
72
+
73
+ .cm-s-active_admin_pro span.cm-variable {
74
+ color: color($grey, 800);
75
+ }
76
+
77
+ .cm-s-active_admin_pro span.cm-variable-2 {
78
+ color: color($grey, 800);
79
+ }
80
+
81
+ .cm-s-active_admin_pro span.cm-variable-3 {
82
+ color: color($grey, 800);
83
+ }
84
+
85
+ .cm-s-active_admin_pro span.cm-def {
86
+ color: $indigo;
87
+ }
88
+
89
+ .cm-s-active_admin_pro span.cm-bracket {
90
+ color: $green;
91
+ }
92
+
93
+ .cm-s-active_admin_pro span.cm-tag {
94
+ color: $deep-purple;
95
+ }
96
+
97
+ .cm-s-active_admin_pro span.cm-header {
98
+ color: color($blue, 700);
99
+ }
100
+
101
+ .cm-s-active_admin_pro span.cm-link {
102
+ color: $cyan;
103
+ }
104
+
105
+ .cm-s-active_admin_pro span.cm-error {
106
+ background: $red;
107
+ color: $white;
108
+ }
109
+
110
+ .cm-s-active_admin_pro .CodeMirror-activeline-background {
111
+ background: $amber;
112
+ }
113
+
114
+ .cm-s-active_admin_pro .CodeMirror-matchingbracket {
115
+ background: color($blue-grey, 100);
116
+ color: $black !important;
117
+ }
@@ -19,7 +19,7 @@ class CodemirrorInput < Formtastic::Inputs::TextInput
19
19
  codemirror_options[:tabSize] ||= 2
20
20
 
21
21
  # Set the default theme to the matching Active Admin Pro theme
22
- codemirror_options[:theme] ||= "activeadmin_pro"
22
+ codemirror_options[:theme] ||= "active_admin_pro"
23
23
 
24
24
  # Pass the CodeMirror options as a data attribute to the input element
25
25
  super.merge(class: "codemirror", data: { codemirror: codemirror_options })
@@ -31,5 +31,5 @@ ActiveAdmin.application.tap do |config|
31
31
  config.meta_tags["viewport"] ||= "initial-scale=1, maximum-scale=1, width=device-width"
32
32
 
33
33
  # Add route and controller for Summernote's image uploads
34
- config.load_paths.unshift File.join(File.expand_path("../../..", __FILE__), "lib", "activeadmin_pro", "summernote_image")
34
+ config.load_paths.unshift File.join(File.expand_path("../../..", __FILE__), "lib", "active_admin_pro", "summernote_image")
35
35
  end
@@ -1,5 +1,6 @@
1
1
  require "activeadmin"
2
2
  require "activeadmin-sortable"
3
+ require "codelation_assets"
3
4
  require "fog"
4
5
  require "turbolinks"
5
6
  require "active_admin_pro/engine"
@@ -2,7 +2,7 @@ module ActiveAdminPro
2
2
  class Engine < ::Rails::Engine
3
3
  # Load Rails Generators
4
4
  generators do
5
- require File.join(File.expand_path("../..", __FILE__), "generators", "activeadmin_pro", "install_generator.rb")
5
+ require File.join(File.expand_path("../..", __FILE__), "generators", "active_admin_pro", "install_generator.rb")
6
6
  end
7
7
  end
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveAdminPro
2
- VERSION = "0.1.2".freeze
2
+ VERSION = "0.1.3".freeze
3
3
  end
@@ -1,4 +1,4 @@
1
1
  # desc "Explaining what the task does"
2
- # task :activeadmin_pro do
2
+ # task :active_admin_pro do
3
3
  # # Task goes here
4
4
  # end
@@ -605,6 +605,10 @@
605
605
  * @param {Node} node
606
606
  */
607
607
  var nodeLength = function (node) {
608
+ if (node === undefined || node === null) {
609
+ return 0;
610
+ }
611
+
608
612
  if (isText(node)) {
609
613
  return node.nodeValue.length;
610
614
  }
@@ -6109,46 +6113,6 @@
6109
6113
  };
6110
6114
  };
6111
6115
 
6112
- var ImagePopover = function (context) {
6113
- var ui = $.summernote.ui;
6114
-
6115
- var options = context.options;
6116
-
6117
- this.shouldInitialize = function () {
6118
- return !list.isEmpty(options.popover.image);
6119
- };
6120
-
6121
- this.initialize = function () {
6122
- this.$popover = ui.popover({
6123
- className: 'note-image-popover'
6124
- }).render().appendTo('body');
6125
- var $content = this.$popover.find('.popover-content');
6126
-
6127
- context.invoke('buttons.build', $content, options.popover.image);
6128
- };
6129
-
6130
- this.destroy = function () {
6131
- this.$popover.remove();
6132
- };
6133
-
6134
- this.update = function (target) {
6135
- if (dom.isImg(target)) {
6136
- var pos = dom.posFromPlaceholder(target);
6137
- this.$popover.css({
6138
- display: 'block',
6139
- left: pos.left,
6140
- top: pos.top
6141
- });
6142
- } else {
6143
- this.hide();
6144
- }
6145
- };
6146
-
6147
- this.hide = function () {
6148
- this.$popover.hide();
6149
- };
6150
- };
6151
-
6152
6116
  var VideoDialog = function (context) {
6153
6117
  var self = this;
6154
6118
  var ui = $.summernote.ui;
@@ -6724,7 +6688,7 @@
6724
6688
  'linkDialog': LinkDialog,
6725
6689
  'linkPopover': LinkPopover,
6726
6690
  'imageDialog': ImageDialog,
6727
- 'imagePopover': ImagePopover,
6691
+ // 'imagePopover': ImagePopover,
6728
6692
  'videoDialog': VideoDialog,
6729
6693
  'helpDialog': HelpDialog,
6730
6694
  'airPopover': AirPopover
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_admin_pro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Pattison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-22 00:00:00.000000000 Z
11
+ date: 2016-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeadmin
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: codelation_assets
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.2'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.2'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: fog
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -290,9 +304,9 @@ files:
290
304
  - app/assets/javascripts/active_admin_pro/actions/new.js
291
305
  - app/assets/javascripts/active_admin_pro/actions/show.js
292
306
  - app/assets/javascripts/active_admin_pro/components/codemirror_input.js
293
- - app/assets/javascripts/active_admin_pro/components/flashes.js
294
307
  - app/assets/javascripts/active_admin_pro/components/link.js
295
308
  - app/assets/javascripts/active_admin_pro/components/phone_input.js
309
+ - app/assets/javascripts/active_admin_pro/components/progress_bar.js
296
310
  - app/assets/javascripts/active_admin_pro/components/select_input.js
297
311
  - app/assets/javascripts/active_admin_pro/components/sortable_handle.js
298
312
  - app/assets/javascripts/active_admin_pro/components/summernote_input.js
@@ -453,21 +467,21 @@ files:
453
467
  - app/assets/stylesheets/active_admin_pro/vendor/neat/settings/_grid.scss
454
468
  - app/assets/stylesheets/active_admin_pro/vendor/neat/settings/_visual-grid.scss
455
469
  - app/assets/stylesheets/active_admin_pro/vendor/normalize.css
456
- - app/assets/stylesheets/codemirror/themes/activeadmin_pro.scss
470
+ - app/assets/stylesheets/codemirror/themes/active_admin_pro.scss
457
471
  - app/inputs/codemirror_input.rb
458
472
  - app/inputs/datepicker_input.rb
459
473
  - app/inputs/phone_input.rb
460
474
  - app/inputs/summernote_input.rb
461
475
  - app/inputs/time_zone_input.rb
462
- - app/models/activeadmin_pro/summernote_image.rb
476
+ - app/models/active_admin_pro/summernote_image.rb
463
477
  - config/initializers/active_admin.rb
464
478
  - config/locales/en.yml
465
479
  - lib/active_admin_pro.rb
466
480
  - lib/active_admin_pro/engine.rb
467
481
  - lib/active_admin_pro/summernote_image/summernote_image.rb
468
482
  - lib/active_admin_pro/version.rb
469
- - lib/generators/activeadmin_pro/install_generator.rb
470
- - lib/tasks/activeadmin_pro_tasks.rake
483
+ - lib/generators/active_admin_pro/install_generator.rb
484
+ - lib/tasks/active_admin_pro_tasks.rake
471
485
  - spec/spec_helper.rb
472
486
  - vendor/assets/javascripts/bootstrap.js
473
487
  - vendor/assets/javascripts/codemirror.js
@@ -1,9 +0,0 @@
1
- // Add active class on click to style while loading via turbolinks.
2
- App.ready(function() {
3
- "use strict";
4
-
5
- $('.flashes').addClass('animate');
6
- $(document).on('page:before-change', function() {
7
- $('.flashes').removeClass('animate');
8
- });
9
- });
@@ -1,117 +0,0 @@
1
- // Pretty good CodeMirror theme that matches the Google Material Design colors
2
- .cm-s-activeadmin_pro.CodeMirror {
3
- background: color($blue-grey, 50);
4
- color: color($grey, 800);
5
- }
6
-
7
- .cm-s-activeadmin_pro div.CodeMirror-selected {
8
- background: color($blue-grey, 100);
9
- }
10
-
11
- .cm-s-activeadmin_pro .CodeMirror-line::selection,
12
- .cm-s-activeadmin_pro .CodeMirror-line > span::selection,
13
- .cm-s-activeadmin_pro .CodeMirror-line > span > span::selection {
14
- background: rgba(color($blue-grey, 50), 0.99);
15
- }
16
-
17
- .cm-s-activeadmin_pro .CodeMirror-line::-moz-selection,
18
- .cm-s-activeadmin_pro .CodeMirror-line > span::-moz-selection,
19
- .cm-s-activeadmin_pro .CodeMirror-line > span > span::-moz-selection {
20
- background: rgba(color($blue-grey, 50), 0.99);
21
- }
22
-
23
- .cm-s-activeadmin_pro .CodeMirror-gutters {
24
- background: color($blue-grey, 100);
25
- color: color($blue-grey, 800);
26
- border-right: 0;
27
- }
28
-
29
- .cm-s-activeadmin_pro .CodeMirror-guttermarker {
30
- color: $white;
31
- }
32
-
33
- .cm-s-activeadmin_pro .CodeMirror-guttermarker-subtle {
34
- color: color($blue-grey, 800);
35
- }
36
-
37
- .cm-s-activeadmin_pro .CodeMirror-linenumber {
38
- color: color($blue-grey, 800);
39
- }
40
-
41
- .cm-s-activeadmin_pro .CodeMirror-cursor {
42
- border-left: 1px solid $black;
43
- }
44
-
45
- .cm-s-activeadmin_pro span.cm-comment {
46
- color: $grey;
47
- }
48
-
49
- .cm-s-activeadmin_pro span.cm-atom {
50
- color: $deep-purple;
51
- }
52
-
53
- .cm-s-activeadmin_pro span.cm-number {
54
- color: color($cyan, 700);
55
- }
56
-
57
- .cm-s-activeadmin_pro span.cm-property {
58
- color: color($amber, 700);
59
- }
60
-
61
- .cm-s-activeadmin_pro span.cm-attribute {
62
- color: $deep-purple;
63
- }
64
-
65
- .cm-s-activeadmin_pro span.cm-keyword {
66
- color: $pink;
67
- }
68
-
69
- .cm-s-activeadmin_pro span.cm-string {
70
- color: $blue;
71
- }
72
-
73
- .cm-s-activeadmin_pro span.cm-variable {
74
- color: color($grey, 800);
75
- }
76
-
77
- .cm-s-activeadmin_pro span.cm-variable-2 {
78
- color: color($grey, 800);
79
- }
80
-
81
- .cm-s-activeadmin_pro span.cm-variable-3 {
82
- color: color($grey, 800);
83
- }
84
-
85
- .cm-s-activeadmin_pro span.cm-def {
86
- color: $indigo;
87
- }
88
-
89
- .cm-s-activeadmin_pro span.cm-bracket {
90
- color: $green;
91
- }
92
-
93
- .cm-s-activeadmin_pro span.cm-tag {
94
- color: $deep-purple;
95
- }
96
-
97
- .cm-s-activeadmin_pro span.cm-header {
98
- color: color($blue, 700);
99
- }
100
-
101
- .cm-s-activeadmin_pro span.cm-link {
102
- color: $cyan;
103
- }
104
-
105
- .cm-s-activeadmin_pro span.cm-error {
106
- background: $red;
107
- color: $white;
108
- }
109
-
110
- .cm-s-activeadmin_pro .CodeMirror-activeline-background {
111
- background: $amber;
112
- }
113
-
114
- .cm-s-activeadmin_pro .CodeMirror-matchingbracket {
115
- background: color($blue-grey, 100);
116
- color: $black !important;
117
- }