biola_wcms_components 0.15.3 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,77 +1,75 @@
1
- if (!RedactorPlugins) var RedactorPlugins = {};
2
-
3
1
  (function($)
4
2
  {
5
- RedactorPlugins.video = function()
6
- {
7
- return {
8
- reUrlYoutube: /https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com\S*[^\w\-\s])([\w\-]{11})(?=[^\w\-]|$)(?![?=&+%\w.-]*(?:['"][^<>]*>|<\/a>))[?=&+%\w.-]*/ig,
9
- reUrlVimeo: /https?:\/\/(www\.)?vimeo.com\/(\d+)($|\/)/,
10
- getTemplate: function()
11
- {
12
- return String()
13
- + '<section id="redactor-modal-video-insert">'
14
- + '<label>' + this.lang.get('video_html_code') + '</label>'
15
- + '<textarea id="redactor-insert-video-area" style="height: 160px;"></textarea>'
16
- + '</section>';
17
- },
18
- init: function()
19
- {
20
- var button = this.button.addAfter('image', 'video', this.lang.get('video'));
21
- this.button.addCallback(button, this.video.show);
22
- },
23
- show: function()
24
- {
25
- this.modal.addTemplate('video', this.video.getTemplate());
3
+ $.Redactor.prototype.video = function()
4
+ {
5
+ return {
6
+ reUrlYoutube: /https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com\S*[^\w\-\s])([\w\-]{11})(?=[^\w\-]|$)(?![?=&+%\w.-]*(?:['"][^<>]*>|<\/a>))[?=&+%\w.-]*/ig,
7
+ reUrlVimeo: /https?:\/\/(www\.)?vimeo.com\/(\d+)($|\/)/,
8
+ getTemplate: function()
9
+ {
10
+ return String()
11
+ + '<section id="redactor-modal-video-insert">'
12
+ + '<label>' + this.lang.get('video_html_code') + '</label>'
13
+ + '<textarea id="redactor-insert-video-area" style="height: 160px;"></textarea>'
14
+ + '</section>';
15
+ },
16
+ init: function()
17
+ {
18
+ var button = this.button.addAfter('image', 'video', this.lang.get('video'));
19
+ this.button.addCallback(button, this.video.show);
20
+ },
21
+ show: function()
22
+ {
23
+ this.modal.addTemplate('video', this.video.getTemplate());
26
24
 
27
- this.modal.load('video', this.lang.get('video'), 700);
28
- this.modal.createCancelButton();
25
+ this.modal.load('video', this.lang.get('video'), 700);
26
+ this.modal.createCancelButton();
29
27
 
30
- var button = this.modal.createActionButton(this.lang.get('insert'));
31
- button.on('click', this.video.insert);
28
+ var button = this.modal.createActionButton(this.lang.get('insert'));
29
+ button.on('click', this.video.insert);
32
30
 
33
- this.selection.save();
34
- this.modal.show();
31
+ this.selection.save();
32
+ this.modal.show();
35
33
 
36
- $('#redactor-insert-video-area').focus();
34
+ $('#redactor-insert-video-area').focus();
37
35
 
38
- },
39
- insert: function()
40
- {
41
- var data = $('#redactor-insert-video-area').val();
36
+ },
37
+ insert: function()
38
+ {
39
+ var data = $('#redactor-insert-video-area').val();
42
40
 
43
- if (!data.match(/<iframe|<video/gi))
44
- {
45
- data = this.clean.stripTags(data);
41
+ if (!data.match(/<iframe|<video/gi))
42
+ {
43
+ data = this.clean.stripTags(data);
46
44
 
47
- // parse if it is link on youtube & vimeo
48
- var iframeStart = '<iframe style="width: 500px; height: 281px;" src="',
49
- iframeEnd = '" frameborder="0" allowfullscreen></iframe>';
45
+ // parse if it is link on youtube & vimeo
46
+ var iframeStart = '<iframe style="width: 500px; height: 281px;" src="',
47
+ iframeEnd = '" frameborder="0" allowfullscreen></iframe>';
50
48
 
51
- if (data.match(this.video.reUrlYoutube))
52
- {
53
- data = data.replace(this.video.reUrlYoutube, iframeStart + '//www.youtube.com/embed/$1' + iframeEnd);
54
- }
55
- else if (data.match(this.video.reUrlVimeo))
56
- {
57
- data = data.replace(this.video.reUrlVimeo, iframeStart + '//player.vimeo.com/video/$2' + iframeEnd);
58
- }
59
- }
49
+ if (data.match(this.video.reUrlYoutube))
50
+ {
51
+ data = data.replace(this.video.reUrlYoutube, iframeStart + '//www.youtube.com/embed/$1' + iframeEnd);
52
+ }
53
+ else if (data.match(this.video.reUrlVimeo))
54
+ {
55
+ data = data.replace(this.video.reUrlVimeo, iframeStart + '//player.vimeo.com/video/$2' + iframeEnd);
56
+ }
57
+ }
60
58
 
61
- this.selection.restore();
62
- this.modal.close();
59
+ this.selection.restore();
60
+ this.modal.close();
63
61
 
64
- var current = this.selection.getBlock() || this.selection.getCurrent();
62
+ var current = this.selection.getBlock() || this.selection.getCurrent();
65
63
 
66
- if (current) $(current).after(data);
67
- else
68
- {
69
- this.insert.html(data);
70
- }
64
+ if (current) $(current).after(data);
65
+ else
66
+ {
67
+ this.insert.html(data);
68
+ }
71
69
 
72
- this.code.sync();
73
- }
70
+ this.code.sync();
71
+ }
74
72
 
75
- };
76
- };
77
- })(jQuery);
73
+ };
74
+ };
75
+ })(jQuery);
@@ -1,10 +1,6 @@
1
1
  /*
2
2
  Icon font
3
3
  */
4
- @font-face {
5
- font-family: 'RedactorFont';
6
- src: url('redactor-font.eot');
7
- }
8
4
  @font-face {
9
5
  font-family: 'RedactorFont';
10
6
  src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMggi/NUAAAC8AAAAYGNtYXAaVcx2AAABHAAAAExnYXNwAAAAEAAAAWgAAAAIZ2x5Zm8dIFkAAAFwAAATSGhlYWQACVb9AAAUuAAAADZoaGVhA+ECBQAAFPAAAAAkaG10eEEBA94AABUUAAAAkGxvY2FVlFE8AAAVpAAAAEptYXhwAC8AkgAAFfAAAAAgbmFtZRHEcG0AABYQAAABZnBvc3QAAwAAAAAXeAAAACAAAwIAAZAABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADmHwHg/+D/4AHgACAAAAABAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEADgAAAAKAAgAAgACAAEAIOYf//3//wAAAAAAIOYA//3//wAB/+MaBAADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAA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AAAAAAAAAAAAQAB//8ADwABAAAAAQAAhlBJsl8PPPUACwIAAAAAAM91iyUAAAAAz3WLJf///9sCAAHbAAAACAACAAAAAAAAAAEAAAHg/+AAAAIA//8AAAIAAAEAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAAAQAAAAIAAAACAAAAAgAAAAIAAG4CAAAAAgAAbQIAAAACAAAJAgAASQIA//8CAAAAAgAAAAIAAAACAACSAgAAAAIAAAACAAAlAgAAAAIAAG4CAAAlAgAAJQIAAEkCAAAAAgAAAAIAAJMCAAAlAgAAQgIAAAACAAAAAgAAAAIAAAACAAAAAABQAAAkAAAAAAAOAK4AAQAAAAAAAQAYAAAAAQAAAAAAAgAOAGoAAQAAAAAAAwAYAC4AAQAAAAAABAAYAHgAAQAAAAAABQAWABgAAQAAAAAABgAMAEYAAQAAAAAACgAoAJAAAwABBAkAAQAYAAAAAwABBAkAAgAOAGoAAwABBAkAAwAYAC4AAwABBAkABAAYAHgAAwABBAkABQAWABgAAwABBAkABgAYAFIAAwABBAkACgAoAJAAUgBlAGQAYQBjAHQAbwByAEYAbwBuAHQAVgBlAHIAcwBpAG8AbgAgADEALgAwAFIAZQBkAGEAYwB0AG8AcgBGAG8AbgB0UmVkYWN0b3JGb250AFIAZQBkAGEAYwB0AG8AcgBGAG8AbgB0AFIAZQBnAHUAbABhAHIAUgBlAGQAYQBjAHQAbwByAEYAbwBuAHQARwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABJAGMAbwBNAG8AbwBuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format('woff');
@@ -32,7 +28,7 @@
32
28
  box-shadow: none;
33
29
  color: #ccc;
34
30
  font-size: 13px;
35
- font-family: Menlo, Monaco, monospace, sans-serif;
31
+ font-family: Menlo, Monaco, monospace, sans-serif !important;
36
32
  resize: none;
37
33
  }
38
34
  .redactor-box textarea:focus {
@@ -64,22 +60,6 @@
64
60
  #redactor-modal {
65
61
  z-index: 1053;
66
62
  }
67
- /*
68
- Resize
69
- */
70
- .redactor-resize {
71
- background: #f4f4f4;
72
- padding: 4px 0 3px 0;
73
- cursor: move;
74
- border: 1px solid #e3e3e3;
75
- border-top: none;
76
- }
77
- .redactor-resize div {
78
- width: 30px;
79
- margin: auto;
80
- border-top: 1px solid #bbb;
81
- border-bottom: 1px solid #fff;
82
- }
83
63
  /*
84
64
  Fullscreen
85
65
  */
@@ -92,8 +72,12 @@ body .redactor-box-fullscreen {
92
72
  /*
93
73
  Utils
94
74
  */
95
- .body-redactor-hidden {
96
- overflow: hidden;
75
+ .redactor-scrollbar-measure {
76
+ position: absolute;
77
+ top: -9999px;
78
+ width: 50px;
79
+ height: 50px;
80
+ overflow: scroll;
97
81
  }
98
82
  /*
99
83
  Editor
@@ -103,10 +87,11 @@ body .redactor-box-fullscreen {
103
87
  overflow: auto;
104
88
  margin: 0 !important;
105
89
  padding: 20px;
90
+ min-height: 80px;
106
91
  outline: none;
107
92
  white-space: normal;
108
93
  border: 1px solid #eee;
109
- font-family: Arial, Helvetica, Verdana, Tahoma, sans-serif;
94
+ font-family: Arial, Helvetica, Verdana, Tahoma, sans-serif !important;
110
95
  font-size: 14px;
111
96
  line-height: 1.6em;
112
97
  }
@@ -119,22 +104,16 @@ body .redactor-box-fullscreen {
119
104
  /*
120
105
  Placeholder
121
106
  */
122
- .redactor-placeholder {
123
- position: relative;
124
- }
125
107
  .redactor-placeholder:after {
126
108
  position: absolute;
127
109
  top: 20px;
128
110
  left: 20px;
129
111
  content: attr(placeholder);
112
+ display: block;
113
+ /* For Firefox */
130
114
  color: #999 !important;
131
115
  font-weight: normal !important;
132
116
  }
133
- /* Placeholder in linebreaks mode */
134
- .redactor-linebreaks.redactor-placeholder:after {
135
- top: 20px;
136
- left: 20px;
137
- }
138
117
  /*
139
118
  Toolbar
140
119
  */
@@ -227,6 +206,10 @@ body .redactor-box-fullscreen {
227
206
  background-color: transparent !important;
228
207
  cursor: default;
229
208
  }
209
+ .redactor-toolbar li a.redactor-button-focus {
210
+ color: #fff;
211
+ background: #000;
212
+ }
230
213
  /*
231
214
  CodeMirror
232
215
  */
@@ -361,7 +344,7 @@ body .redactor-box-fullscreen {
361
344
  color: #fff;
362
345
  padding: 5px 8px;
363
346
  line-height: 1;
364
- font-family: Arial, Helvetica, Verdana, Tahoma, sans-serif;
347
+ font-family: Arial, Helvetica, Verdana, Tahoma, sans-serif !important;
365
348
  font-size: 12px;
366
349
  border-radius: 2px;
367
350
  }
@@ -379,7 +362,7 @@ body .redactor-box-fullscreen {
379
362
  background-color: #fff;
380
363
  box-shadow: 0 1px 7px rgba(0, 0, 0, 0.25);
381
364
  font-size: 14px;
382
- font-family: Arial, Helvetica, Verdana, Tahoma, sans-serif;
365
+ font-family: Arial, Helvetica, Verdana, Tahoma, sans-serif !important;
383
366
  line-height: 1.6em;
384
367
  }
385
368
  .redactor-dropdown a {
@@ -397,6 +380,23 @@ body .redactor-box-fullscreen {
397
380
  color: #fff !important;
398
381
  text-decoration: none;
399
382
  }
383
+ .redactor-dropdown a.selected {
384
+ background-color: #000;
385
+ color: #fff;
386
+ }
387
+ .redactor-dropdown a.redactor-dropdown-link-inactive,
388
+ .redactor-dropdown a.redactor-dropdown-link-inactive:hover {
389
+ background: none;
390
+ cursor: default;
391
+ color: #000 !important;
392
+ filter: alpha(opacity=40);
393
+ -moz-opacity: 0.4;
394
+ opacity: 0.4;
395
+ }
396
+ .redactor-dropdown a.redactor-dropdown-link-selected {
397
+ color: #fff;
398
+ background: #000;
399
+ }
400
400
  /*
401
401
  IMAGE BOX
402
402
  */
@@ -438,7 +438,7 @@ body .redactor-box-fullscreen {
438
438
  */
439
439
  .redactor-link-tooltip {
440
440
  position: absolute;
441
- z-index: 49999;
441
+ z-index: 99;
442
442
  padding: 10px;
443
443
  line-height: 1;
444
444
  display: inline-block;
@@ -448,7 +448,7 @@ body .redactor-box-fullscreen {
448
448
  .redactor-link-tooltip,
449
449
  .redactor-link-tooltip a {
450
450
  font-size: 12px;
451
- font-family: Arial, Helvetica, Verdana, Tahoma, sans-serif;
451
+ font-family: Arial, Helvetica, Verdana, Tahoma, sans-serif !important;
452
452
  }
453
453
  .redactor-link-tooltip a {
454
454
  color: #ccc;
@@ -552,6 +552,7 @@ body .redactor-box-fullscreen {
552
552
  overflow-y: auto;
553
553
  }
554
554
  #redactor-modal {
555
+ outline: 0;
555
556
  position: relative;
556
557
  margin: auto;
557
558
  margin-bottom: 20px;
@@ -559,7 +560,7 @@ body .redactor-box-fullscreen {
559
560
  background: #fff;
560
561
  color: #000;
561
562
  font-size: 14px !important;
562
- font-family: Arial, Helvetica, Verdana, Tahoma, sans-serif;
563
+ font-family: Arial, Helvetica, Verdana, Tahoma, sans-serif !important;
563
564
  box-shadow: 0 1px 70px rgba(0, 0, 0, 0.5);
564
565
  }
565
566
  #redactor-modal header {
@@ -601,7 +602,7 @@ body .redactor-box-fullscreen {
601
602
  color: #333;
602
603
  width: 100%;
603
604
  font-size: 14px;
604
- font-family: Arial, Helvetica, Verdana, Tahoma, sans-serif;
605
+ font-family: Arial, Helvetica, Verdana, Tahoma, sans-serif !important;
605
606
  -moz-transition: border 0.3s ease-in;
606
607
  transition: border 0.3s ease-in;
607
608
  }
@@ -691,6 +692,11 @@ body .redactor-box-fullscreen {
691
692
  font-size: 30px;
692
693
  font-weight: 300;
693
694
  cursor: pointer;
695
+ -webkit-appearance: none;
696
+ padding: 0;
697
+ border: 0;
698
+ background: 0;
699
+ outline: none;
694
700
  }
695
701
  #redactor-modal-close:hover {
696
702
  color: #000;
@@ -708,7 +714,7 @@ body .redactor-box-fullscreen {
708
714
  text-decoration: none;
709
715
  font-weight: normal;
710
716
  font-size: 12px;
711
- font-family: Arial, Helvetica, Verdana, Tahoma, sans-serif;
717
+ font-family: Arial, Helvetica, Verdana, Tahoma, sans-serif !important;
712
718
  line-height: 1;
713
719
  cursor: pointer;
714
720
  }
@@ -784,7 +790,8 @@ body .redactor-box-fullscreen {
784
790
  */
785
791
  .redactor-editor code,
786
792
  .redactor-editor pre {
787
- font-family: Menlo, Monaco, monospace, sans-serif;
793
+ font-family: Menlo, Monaco, monospace, sans-serif !important;
794
+ cursor: text;
788
795
  }
789
796
  .redactor-editor div,
790
797
  .redactor-editor p,
@@ -834,10 +841,15 @@ body .redactor-box-fullscreen {
834
841
  }
835
842
  .redactor-editor blockquote {
836
843
  margin-left: 1.6em !important;
837
- padding-left: 0;
844
+ padding: 0;
845
+ text-align: left;
838
846
  color: #777;
839
847
  font-style: italic;
840
848
  }
849
+ .redactor-editor blockquote:before,
850
+ .redactor-editor blockquote:after {
851
+ content: '';
852
+ }
841
853
  .redactor-editor ul,
842
854
  .redactor-editor ol {
843
855
  padding-left: 2em;
@@ -883,12 +895,10 @@ body .redactor-box-fullscreen {
883
895
  background-color: #d8d7d7;
884
896
  }
885
897
  .redactor-editor pre {
886
- overflow: auto;
887
898
  padding: 1em;
888
899
  border: 1px solid #ddd;
889
900
  border-radius: 3px;
890
901
  background: #f8f8f8;
891
- white-space: pre;
892
902
  font-size: 90%;
893
903
  }
894
904
  .redactor-editor hr {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: biola_wcms_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.3
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Hall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-27 00:00:00.000000000 Z
11
+ date: 2015-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ace-rails-ap
@@ -221,10 +221,10 @@ files:
221
221
  - lib/components/cas_authentication.rb
222
222
  - lib/components/gallery_photos.rb
223
223
  - lib/components/menu_block.rb
224
- - lib/components/presentation_data_editor.rb
225
224
  - vendor/assets/javascripts/bootstrap-multiselect.js
226
225
  - vendor/assets/javascripts/bootstrap-tagsinput.js
227
226
  - vendor/assets/javascripts/handlebars.js
227
+ - vendor/assets/javascripts/json-editor.js
228
228
  - vendor/assets/javascripts/redactor.js
229
229
  - vendor/assets/javascripts/redactor_fullscreen.js
230
230
  - vendor/assets/javascripts/redactor_table.js
@@ -1,238 +0,0 @@
1
- class PresentationDataEditor
2
- attr_reader :view
3
- attr_reader :data
4
- attr_reader :schema
5
- attr_reader :form
6
-
7
- # Expects a hash schema definition.
8
- # will probably come from presentation_data_template.schema
9
- def initialize(view_context, data, schema, form)
10
- @view = view_context
11
- @data = data
12
- @schema = schema
13
- @form = form
14
- end
15
-
16
- def render
17
- presentation_data_editor if schema.is_a? Array
18
- end
19
-
20
-
21
- private
22
-
23
- def presentation_data_editor
24
- view.content_tag :div, array_of_attributes(schema), id: 'presentation_data_editor'
25
- end
26
-
27
- def array_of_attributes(attributes, parent_keys=[], wrapper_class: 'nest')
28
- view.content_tag(:div, class: wrapper_class) do
29
- Array(attributes).map do |attribute|
30
- build_form_attribute(ActiveSupport::HashWithIndifferentAccess.new(attribute), parent_keys)
31
- end.join(" ").html_safe
32
- end
33
- end
34
-
35
- def build_form_attribute(attribute, parent_keys)
36
- case attribute[:type]
37
- when 'hash'
38
- build_hash(attribute, parent_keys)
39
- when 'array'
40
- build_array(attribute, parent_keys)
41
- when 'string', nil # String should be the default value
42
- build_string(attribute, parent_keys)
43
- when 'image'
44
- build_image_uploader(attribute, parent_keys)
45
- when 'html'
46
- build_html(attribute, parent_keys)
47
- when 'checkbox'
48
- build_check_box(attribute, parent_keys)
49
- when 'number'
50
- build_number(attribute, parent_keys)
51
- end
52
- end
53
-
54
-
55
-
56
- ############################
57
- ### Type specific Builders
58
- ############################
59
- def build_hash(attribute, parent_keys)
60
- view.content_tag(:h4, attribute[:name].titleize) +
61
- array_of_attributes(attribute[:nested_attributes], parent_keys + Array(attribute[:name]))
62
- end
63
-
64
- def build_array(attribute, parent_keys)
65
- view.content_tag(:div, class: 'array_wrapper') do
66
- view.content_tag(:h4, attribute[:name].titleize) +
67
- # build empty form template for creating new items
68
- build_array_with_data(
69
- attribute[:nested_attributes],
70
- parent_keys,
71
- attribute[:name]
72
- )
73
- end
74
- end
75
-
76
- def build_array_with_data(attributes, parent_keys, array_name)
77
- view.content_tag(:div, class: 'nest existing_array') do
78
- build_array_framework(attributes, parent_keys, array_name) +
79
- build_array_items(attributes, parent_keys, array_name) +
80
- view.content_tag(:a, 'Add Item', href:'#', class: 'add_array_item', tabindex: '-1')
81
- end
82
- end
83
-
84
- def build_array_items(attributes, parent_keys, array_name)
85
- Array(data_grab(parent_keys, array_name)).each_with_index.map do |v,i|
86
- view.content_tag :div, class: 'array_item' do
87
- view.content_tag(:a, 'Delete Item', href:'#', class: 'delete_array_item pull-right', tabindex: '-1') +
88
- array_of_attributes(attributes, parent_keys + Array(array_name) + Array(i), wrapper_class: nil)
89
- end
90
- end.join(" ").html_safe
91
- end
92
-
93
- def build_array_framework(attributes, parent_keys, array_name)
94
- view.content_tag(:div, class: 'array_item framework') do
95
- view.content_tag(:a, 'Delete Item', href:'#', class: 'delete_array_item pull-right', tabindex: '-1') +
96
- array_of_attributes(attributes, parent_keys + Array(array_name) + Array(0), wrapper_class: nil)
97
- end
98
- end
99
-
100
-
101
- def build_string(attribute, parent_keys)
102
- view.content_tag :div, class: 'form-group' do
103
- view.label_tag(attribute[:name]) +
104
- view.text_field_tag(
105
- form_name(parent_keys, attribute[:name]),
106
- data_grab(parent_keys, attribute[:name]),
107
- {
108
- class: "form-control #{attribute[:class]}",
109
- id: attribute_id(parent_keys, attribute[:name]),
110
- placeholder: attribute[:placeholder]
111
- }
112
- )
113
- end
114
- end
115
-
116
- def build_check_box(attribute, parent_keys)
117
- view.content_tag :div, class: 'form-group' do
118
- view.label_tag(attribute[:name]) +
119
- view.check_box_tag(
120
- form_name(parent_keys, attribute[:name]), # name
121
- 1, # value
122
- data_grab(parent_keys, attribute[:name]).to_i == 1,# checked or not
123
- { # options
124
- class: "form-control #{attribute[:class]}",
125
- id: attribute_id(parent_keys, attribute[:name]),
126
- placeholder: attribute[:placeholder]
127
- }
128
- )
129
- end
130
- end
131
-
132
- def build_number(attribute, parent_keys)
133
- view.content_tag :div, class: 'form-group' do
134
- view.label_tag(attribute[:name]) +
135
- view.number_field_tag(
136
- form_name(parent_keys, attribute[:name]),
137
- data_grab(parent_keys, attribute[:name]),
138
- {
139
- class: "form-control #{attribute[:class]}",
140
- id: attribute_id(parent_keys, attribute[:name]),
141
- placeholder: attribute[:placeholder]
142
- }
143
- )
144
- end
145
- end
146
-
147
- def build_image_uploader(attribute, parent_keys)
148
- view.content_tag :div, class: 'form-group type-image-uploader' do
149
- view.label_tag(attribute[:name]) +
150
- view.text_field_tag(
151
- form_name(parent_keys, attribute[:name]),
152
- data_grab(parent_keys, attribute[:name]),
153
- {
154
- class: "form-control drop-image-uploader #{attribute[:class]}",
155
- id: attribute_id(parent_keys, attribute[:name]),
156
- placeholder: "Drop image here"
157
- }
158
- ) +
159
- view.content_tag(:div, class: 'image_preview') do
160
- view.image_tag data_grab(parent_keys, attribute[:name])
161
- end
162
- end
163
- end
164
-
165
- def build_html(attribute, parent_keys)
166
- view.content_tag :div, class: 'form-group' do
167
- view.label_tag(attribute[:name]) +
168
- view.text_area_tag(
169
- form_name(parent_keys, attribute[:name]),
170
- data_grab(parent_keys, attribute[:name]),
171
- {
172
- class: "redactor #{attribute[:class]}",
173
- id: attribute_id(parent_keys, attribute[:name]),
174
- 'data-buttons' => editor_buttons(attribute),
175
- 'data-formatting' => 'p h1 h2 h3 h4 h5 quote'
176
- }
177
- )
178
- end
179
- end
180
-
181
-
182
-
183
- ############################
184
- ### helper methods
185
- ############################
186
-
187
- # This will create the name parameter for a given form input
188
- # Example:
189
- # research(hash) > books(array) > 2(array index) > title(attribute_name)
190
- # will become
191
- # "pdata[research][books][][title]"
192
- def form_name(parent_keys, attr_name)
193
- p = ['pdata'] + parent_keys + [attr_name]
194
- p.compact.each_with_index.map do |v,i|
195
- if i == 0
196
- v # don't wrap the first key in brackets
197
- elsif v.is_a?(Integer)
198
- "[]" # Skip the number, this will be an array...
199
- else
200
- "[#{v}]"
201
- end
202
- end.join('')
203
- end
204
-
205
- # Creates an underscored version of the form_name above.
206
- # Example:
207
- # "pdata_research_books_2_title"
208
- def attribute_id(parent_keys, attr_name)
209
- p = ['pdata'] + parent_keys + [attr_name]
210
- p.compact.join('_')
211
- end
212
-
213
- # Will look up the data given the correct path
214
- def data_grab(parent_keys, attr_name)
215
- path = parent_keys + [attr_name]
216
-
217
- # I'm using inject here to traverse the data hash with each sequential
218
- # key or index value. I use `try` just in case the data is not there
219
- # and `last` is nil.
220
- path.compact.inject(data) do |last, p|
221
- if last.is_a? Array
222
- # Use a number to reference the array element
223
- last.try(:[], p.to_i)
224
- elsif last.is_a? Hash
225
- last.try(:[], p.to_s)
226
- end
227
- end
228
- end
229
-
230
- def editor_buttons(attribute)
231
- default_buttons = %w(formatting bold italic unorderedlist orderedlist link)
232
- buttons = attribute[:editor_buttons].to_s.split(' ').presence || default_buttons
233
- buttons.push('html') if !buttons.include?('html')
234
- buttons.push('fullscreen') unless buttons.include?('fullscreen')
235
- buttons.join(' ')
236
- end
237
-
238
- end