thecore_ui_rails_admin 2.1.3 → 2.1.4

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.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/rails_admin/custom/ckeditor_ajax.js.coffee +7 -0
  3. data/app/assets/javascripts/rails_admin/custom/timer.js +135 -0
  4. data/app/assets/javascripts/rails_admin/custom/ui.js +115 -0
  5. data/app/assets/javascripts/rails_admin/ra.widgets.coffee +233 -0
  6. data/app/assets/stylesheets/rails_admin/custom/flashing.scss +28 -0
  7. data/app/assets/stylesheets/rails_admin/custom/theming.scss +199 -0
  8. data/app/assets/stylesheets/rails_admin/custom/togglable-sidebar.scss +112 -0
  9. data/app/views/contact_mailer/contact_message.html.erb +5 -0
  10. data/app/views/devise/confirmations/new.html.erb +16 -0
  11. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  12. data/app/views/devise/mailer/password_change.html.erb +5 -0
  13. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  14. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  15. data/app/views/devise/menu/_login_items.html.erb +7 -0
  16. data/app/views/devise/passwords/edit.html.erb +25 -0
  17. data/app/views/devise/passwords/new.html.erb +18 -0
  18. data/app/views/devise/registrations/edit.html.erb +45 -0
  19. data/app/views/devise/registrations/new.html.erb +29 -0
  20. data/app/views/devise/sessions/new.html.erb +28 -0
  21. data/app/views/devise/shared/_links.html.erb +25 -0
  22. data/app/views/devise/unlocks/new.html.erb +16 -0
  23. data/app/views/home/index.html.erb +5 -0
  24. data/app/views/kaminari/_first_page.html.erb +3 -0
  25. data/app/views/kaminari/_gap.html.erb +3 -0
  26. data/app/views/kaminari/_last_page.html.erb +3 -0
  27. data/app/views/kaminari/_next_page.html.erb +3 -0
  28. data/app/views/kaminari/_page.html.erb +9 -0
  29. data/app/views/kaminari/_paginator.html.erb +15 -0
  30. data/app/views/kaminari/_prev_page.html.erb +3 -0
  31. data/app/views/layouts/_footer.html.erb +3 -0
  32. data/app/views/layouts/_messages.html.erb +9 -0
  33. data/app/views/layouts/_navigation.html.erb +20 -0
  34. data/app/views/layouts/_navigation_links.html.erb +7 -0
  35. data/app/views/layouts/mailer.html.erb +6 -0
  36. data/app/views/layouts/mailer.text.erb +1 -0
  37. data/app/views/layouts/rails_admin/_navigation.html.haml +13 -0
  38. data/app/views/layouts/rails_admin/_secondary_navigation.html.haml +3 -0
  39. data/app/views/layouts/rails_admin/_sidebar_navigation.html.haml +4 -0
  40. data/app/views/layouts/rails_admin/_user_navigation.html.haml +7 -0
  41. data/app/views/layouts/rails_admin/application.html.haml +59 -0
  42. data/app/views/layouts/rails_admin/pjax.html.haml +25 -0
  43. data/app/views/layouts/thecore.html.erb +42 -0
  44. data/app/views/pages/contact.html.erb +54 -0
  45. data/app/views/pages/home.html.erb +2 -0
  46. data/app/views/pages/inside.html.erb +4 -0
  47. data/app/views/rails_admin/main/_card.html.haml +17 -0
  48. data/app/views/rails_admin/main/_modal_interaction.html.erb +53 -0
  49. data/app/views/rails_admin/main/dashboard.html.haml +25 -0
  50. data/app/views/rails_admin/main/index.html.haml +90 -0
  51. data/app/views/shared/_flash.html.erb +10 -0
  52. data/app/views/users/confirmations/new.html.erb +16 -0
  53. data/app/views/users/mailer/confirmation_instructions.html.erb +5 -0
  54. data/app/views/users/mailer/password_change.html.erb +3 -0
  55. data/app/views/users/mailer/reset_password_instructions.html.erb +8 -0
  56. data/app/views/users/mailer/unlock_instructions.html.erb +7 -0
  57. data/app/views/users/passwords/edit.html.erb +19 -0
  58. data/app/views/users/passwords/new.html.erb +15 -0
  59. data/app/views/users/registrations/edit.html.erb +27 -0
  60. data/app/views/users/registrations/new.html.erb +17 -0
  61. data/app/views/users/sessions/new.html.erb +37 -0
  62. data/app/views/users/shared/_links.html.erb +26 -0
  63. data/app/views/users/unlocks/new.html.erb +16 -0
  64. data/config/initializers/rails_admin.rb +49 -0
  65. data/config/initializers/thecore_concern.rb +125 -0
  66. data/config/locales/en.index_cards.custom.yml +8 -0
  67. data/config/locales/en.main.yml +27 -0
  68. data/config/locales/en.rails_admin.yml +34 -0
  69. data/config/locales/en.rollincode.yml +5 -0
  70. data/config/locales/it.index_cards.custom.yml +20 -0
  71. data/config/locales/it.main.yml +27 -0
  72. data/config/locales/it.rails_admin.yml +4 -0
  73. data/config/locales/it.rollincode.yml +5 -0
  74. data/config/routes.rb +10 -0
  75. data/lib/thecore_ui_rails_admin.rb +3 -0
  76. data/lib/thecore_ui_rails_admin/engine.rb +7 -0
  77. data/lib/thecore_ui_rails_admin/version.rb +1 -1
  78. metadata +88 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06647bd6cb9070ca2ad2ac816e58c810876d10e4abb058455a5f654172626eaa
4
- data.tar.gz: d8a0f95e40e5c74d18f8a664f979f1bc37f3e43f06ec3b6ed69575184a13743e
3
+ metadata.gz: 78a1dd7ba203dc1d336c00fb86f0e9f7cf2c796b2b24511d062c273eddbf1eaa
4
+ data.tar.gz: a359435b170c33d16d5ff47b8642f4d132e62a07491fd05056bc8b884bded8f0
5
5
  SHA512:
6
- metadata.gz: 02bbfe00a79d0d2e766cffb36a14f00902be7a7119a87916ee82e4c71bec785ae0e8e59ff4d33c1298c3708cdcfaf67641f27e104b40bc622166f57cc85e4fd9
7
- data.tar.gz: f3e494638d1d4df195cda7be2240c992043ed0f0721c0354d7ddf162165440b7e391bc871a4e8b33b487aa6f6729d5d70c224620922609fdc0b53592f61b56b1
6
+ metadata.gz: 510fa296d40ae2d48f0c00a03216cd7fc176b1796686e25e8f04f42933ed58e64a96abf7069c8b60a4bc54f1688c6b16ff17e970df7356ec30b93be8a6277c10
7
+ data.tar.gz: 829585f7fb0ba54de9a8dc27be4b548d19a2e54051bd7ed991f549954bc200523ed21cb799f30489425a6601b1c7b7ff62a4e92a08beae18fe92e5e5047f8646
@@ -0,0 +1,7 @@
1
+ $(document).ready ->
2
+ $(document).on 'mousedown', '.save-action', (e) -> # triggers also when submitting form with enter
3
+ for instance of CKEDITOR.instances
4
+ editor = CKEDITOR.instances[instance]
5
+ if editor.checkDirty()
6
+ editor.updateElement();
7
+ return true;
@@ -0,0 +1,135 @@
1
+ (function (root, factory) {
2
+ 'use strict'
3
+ if (typeof define === 'function' && define.amd) define([], factory)
4
+ else if (typeof exports === 'object') module.exports = factory()
5
+ else root.Timer = factory()
6
+ }(this, function () {
7
+ 'use strict'
8
+
9
+ var defaultOptions = {
10
+ tick : 1,
11
+ onstart : null,
12
+ ontick : null,
13
+ onpause : null,
14
+ onstop : null,
15
+ onend : null
16
+ }
17
+
18
+ var Timer = function (options) {
19
+ if (!(this instanceof Timer)) return new Timer(options)
20
+ this._ = {
21
+ id : +new Date,
22
+ options : {},
23
+ duration : 0,
24
+ status : 'initialized',
25
+ start : 0,
26
+ measures : []
27
+ }
28
+ for (var prop in defaultOptions) this._.options[prop] = defaultOptions[prop]
29
+ this.options(options)
30
+ }
31
+
32
+ Timer.prototype.start = function (duration) {
33
+ if (!+duration && !this._.duration) return this
34
+ duration && (duration *= 1000)
35
+ if (this._.timeout && this._.status === 'started') return this
36
+ this._.duration = duration || this._.duration
37
+ this._.timeout = setTimeout(end.bind(this), this._.duration)
38
+ if (typeof this._.options.ontick === 'function')
39
+ this._.interval = setInterval(function () {
40
+ trigger.call(this, 'ontick', this.getDuration())
41
+ }.bind(this), +this._.options.tick * 1000)
42
+ this._.start = +new Date
43
+ this._.status = 'started'
44
+ trigger.call(this, 'onstart', this.getDuration())
45
+ return this
46
+ }
47
+
48
+ Timer.prototype.pause = function () {
49
+ if (this._.status !== 'started') return this
50
+ this._.duration -= (+new Date - this._.start)
51
+ clear.call(this, false)
52
+ this._.status = 'paused'
53
+ trigger.call(this, 'onpause')
54
+ return this
55
+ }
56
+
57
+ Timer.prototype.stop = function () {
58
+ if (!/started|paused/.test(this._.status)) return this
59
+ clear.call(this, true)
60
+ this._.status = 'stopped'
61
+ trigger.call(this, 'onstop')
62
+ return this
63
+ }
64
+
65
+ Timer.prototype.getDuration = function () {
66
+ if (this._.status === 'started')
67
+ return this._.duration - (+new Date - this._.start)
68
+ if (this._.status === 'paused') return this._.duration
69
+ return 0
70
+ }
71
+
72
+ Timer.prototype.getStatus = function () {
73
+ return this._.status
74
+ }
75
+
76
+ Timer.prototype.options = function (option, value) {
77
+ if (option && value) this._.options[option] = value
78
+ if (!value && typeof option === 'object')
79
+ for (var prop in option)
80
+ if (this._.options.hasOwnProperty(prop))
81
+ this._.options[prop] = option[prop]
82
+ return this
83
+ }
84
+
85
+ Timer.prototype.on = function (option, value) {
86
+ if (typeof option !== 'string' || typeof value !== 'function') return this
87
+ if (!(/^on/).test(option))
88
+ option = 'on' + option
89
+ if (this._.options.hasOwnProperty(option))
90
+ this._.options[option] = value
91
+ return this
92
+ }
93
+
94
+ Timer.prototype.off = function (option) {
95
+ if (typeof option !== 'string') return this
96
+ option = option.toLowerCase()
97
+ if (option === 'all') {
98
+ this._.options = defaultOptions
99
+ return this
100
+ }
101
+ if (!(/^on/).test(option)) option = 'on' + option
102
+ if (this._.options.hasOwnProperty(option))
103
+ this._.options[option] = defaultOptions[option]
104
+ return this
105
+ }
106
+
107
+ Timer.prototype.measureStart = function (label) {
108
+ this._.measures[label || ''] = +new Date
109
+ return this
110
+ }
111
+
112
+ Timer.prototype.measureStop = function (label) {
113
+ return +new Date - this._.measures[label || '']
114
+ }
115
+
116
+ function end () {
117
+ clear.call(this)
118
+ this._.status = 'stopped'
119
+ trigger.call(this, 'onend')
120
+ }
121
+
122
+ function trigger (event) {
123
+ var callback = this._.options[event],
124
+ args = [].slice.call(arguments, 1)
125
+ typeof callback === 'function' && callback.apply(this, args)
126
+ }
127
+
128
+ function clear (clearDuration) {
129
+ clearTimeout(this._.timeout)
130
+ clearInterval(this._.interval)
131
+ if (clearDuration === true) this._.duration = 0
132
+ }
133
+
134
+ return Timer
135
+ }))
@@ -0,0 +1,115 @@
1
+ //= require selectize
2
+ //= require timer
3
+ //= require froala_editor.min.js
4
+ //= require plugins/align.min.js
5
+ //= require plugins/char_counter.min.js
6
+ //= require plugins/colors.min.js
7
+ //= require plugins/font_family.min.js
8
+ //= require plugins/font_size.min.js
9
+ //= require plugins/line_breaker.min.js
10
+ //= require plugins/link.min.js
11
+ //= require plugins/lists.min.js
12
+ //= require plugins/special_characters.min.js
13
+ //= require plugins/url.min.js
14
+ //= require languages/it.js
15
+ //= require rails_admin/custom/ckeditor_ajax
16
+ //= require_tree .
17
+
18
+ $(document).on('ready pjax:success', function(e) {
19
+ handleActiveBase();
20
+
21
+ function handleActiveBase() {
22
+ $('.sub-menu').each(function() {
23
+ if ($(this).hasClass('active')) {
24
+ $(this).parent().prev().addClass('active');
25
+ $(this).parent().prev().addClass('open');
26
+ $(this).parent().slideDown();
27
+ }
28
+ });
29
+ }
30
+ // home dashboard dark theme
31
+ if ((new RegExp('app/$').test(e.currentTarget.URL) || new RegExp('app$').test(e.currentTarget.URL)) && !new RegExp('app/app').test(e.currentTarget.URL)) {
32
+ $('.page-header, .content').addClass('dashboard');
33
+ } else {
34
+ $('.page-header, .content').removeClass('dashboard');
35
+ }
36
+
37
+ $('textarea[data-richtext="froala-wysiwyg"').froalaEditor();
38
+
39
+ // $(document).ready(function () {
40
+ // Hide and show the sidebar
41
+ // Make the sidebar button shine a bit
42
+ // setTimeout(function() {
43
+ // $('#sidebar-collapse').addClass("flash");
44
+ // }, 500);
45
+ // setTimeout(function() {
46
+ // if (!$('#wrapper').hasClass('toggled'))
47
+ // $('#wrapper').addClass('toggled');
48
+ // }, 1200);
49
+ // });
50
+ });
51
+
52
+ $(function() {
53
+ var array_menu = [];
54
+ var lvl_1 = null;
55
+ var count = 0;
56
+
57
+ $('.sidebar-nav li').each(function(index, item) {
58
+ if ($(item).hasClass('dropdown-header')) {
59
+ lvl_1 = count++;
60
+ array_menu[lvl_1] = []
61
+ } else {
62
+ $(item).addClass('sub-menu sub-menu-' + lvl_1);
63
+ }
64
+ });
65
+
66
+ for (var i = 0; i <= array_menu.length; i++) {
67
+ $('.sub-menu-' + i).wrapAll("<div class='sub-menu-container' />");
68
+ }
69
+
70
+ $('.sub-menu-container').hide();
71
+
72
+ handleActiveBase();
73
+
74
+ function handleActiveBase() {
75
+ $('.sub-menu').each(function() {
76
+ if ($(this).hasClass('active')) {
77
+ $(this).parent().prev().addClass('active');
78
+ $(this).parent().slideDown();
79
+ }
80
+ });
81
+ }
82
+
83
+ $('.dropdown-header').bind('click', function() {
84
+ $('.dropdown-header').removeClass('open'); //Rimuove tutte le classi open
85
+ $(this).toggleClass('open'); // Apre la corrente
86
+ // Se la corrente è già aperta, allora la chiude
87
+
88
+ $('.dropdown-header').removeClass('active');
89
+ $('.sub-menu-container').stop().slideUp();
90
+ $(this).toggleClass('active');
91
+ $(this).next('.sub-menu-container').stop().slideDown();
92
+ });
93
+ });
94
+
95
+ $(document).ready(function () {
96
+ // All pjax in sidebar-nav make the menu disappear when clicked
97
+ $(".sidebar-nav a[class=pjax]").on("click", function(){
98
+ $('#wrapper').toggleClass('toggled');
99
+ });
100
+
101
+ $('#sidebar-collapse').on('click', function() {
102
+ $('#wrapper').toggleClass('toggled');
103
+ });
104
+
105
+ $('textarea[data-richtext="froala-wysiwyg"').froalaEditor();
106
+ // // Hide and show the sidebar
107
+ // // Make the sidebar button shine a bit
108
+ // setTimeout(function() {
109
+ // $('#sidebar-collapse').addClass("flash");
110
+ // }, 500);
111
+ // setTimeout(function() {
112
+ // if (!$('#wrapper').hasClass('toggled'))
113
+ // $('#wrapper').addClass('toggled');
114
+ // }, 1200);
115
+ });
@@ -0,0 +1,233 @@
1
+ $(document).on 'rails_admin.dom_ready', (e, content) ->
2
+ content = if content then content else $('form')
3
+
4
+ if content.length # don't waste time otherwise
5
+
6
+ # colorpicker
7
+
8
+ content.find('[data-color]').each ->
9
+ that = this
10
+ $(this).ColorPicker
11
+ color: $(that).val()
12
+ onShow: (el) ->
13
+ $(el).fadeIn(500)
14
+ false
15
+ onHide: (el) ->
16
+ $(el).fadeOut(500)
17
+ false
18
+ onChange: (hsb, hex, rgb) ->
19
+ $(that).val(hex)
20
+ $(that).css('backgroundColor', '#' + hex)
21
+
22
+ # datetime picker
23
+ $.fn.datetimepicker.defaults.icons =
24
+ time: 'fa fa-clock'
25
+ date: 'fa fa-calendar'
26
+ up: 'fa fa-chevron-up'
27
+ down: 'fa fa-chevron-down'
28
+ previous: 'fa fa-angle-double-left'
29
+ next: 'fa fa-angle-double-right'
30
+ today: 'fa fa-dot-circle'
31
+ clear: 'fa fa-trash'
32
+ close: 'fa fa-times'
33
+
34
+ content.find('[data-datetimepicker]').each ->
35
+ options = $(this).data('options')
36
+ $.extend(options, {locale: RailsAdmin.I18n.locale})
37
+ $(this).datetimepicker options
38
+
39
+ # enumeration
40
+
41
+ content.find('[data-enumeration]').each ->
42
+ if $(this).is('[multiple]')
43
+ $(this).filteringMultiselect $(this).data('options')
44
+ else
45
+ $(this).filteringSelect $(this).data('options')
46
+
47
+ # fileupload
48
+
49
+ content.find('[data-fileupload]').each ->
50
+ input = this
51
+ $(this).on 'click', ".delete input[type='checkbox']", ->
52
+ $(input).children('.toggle').toggle('slow')
53
+
54
+ # fileupload-preview
55
+
56
+ content.find('[data-fileupload]').change ->
57
+ input = this
58
+ image_container = $("#" + input.id).parent().children(".preview")
59
+ unless image_container.length
60
+ image_container = $("#" + input.id).parent().prepend($('<img />').addClass('preview').addClass('img-thumbnail')).find('img.preview')
61
+ image_container.parent().find('img:not(.preview)').hide()
62
+ ext = $("#" + input.id).val().split('.').pop().toLowerCase()
63
+ if input.files and input.files[0] and $.inArray(ext, ['gif', 'png', 'jpg', 'jpeg', 'bmp']) != -1
64
+ reader = new FileReader()
65
+ reader.onload = (e) ->
66
+ image_container.attr "src", e.target.result
67
+ reader.readAsDataURL input.files[0]
68
+ image_container.show()
69
+ else
70
+ image_container.hide()
71
+
72
+ # filtering-multiselect
73
+
74
+ content.find('[data-filteringmultiselect]').each ->
75
+ $(this).filteringMultiselect $(this).data('options')
76
+ if $(this).parents("#modal").length # hide link if we already are inside a dialog (endless issues on nested dialogs with JS)
77
+ $(this).siblings('.btn').remove()
78
+ else
79
+ $(this).parents('.control-group').first().remoteForm()
80
+
81
+ # filtering-select
82
+
83
+ content.find('[data-filteringselect]').each ->
84
+ $(this).filteringSelect $(this).data('options')
85
+ if $(this).parents("#modal").length # hide link if we already are inside a dialog (endless issues on nested dialogs with JS)
86
+ $(this).siblings('.btn').remove()
87
+ else
88
+ $(this).parents('.control-group').first().remoteForm()
89
+
90
+ # nested-many
91
+
92
+ content.find('[data-nestedmany]').each ->
93
+ field = $(this).parents('.control-group').first()
94
+ nav = field.find('> .controls > .nav')
95
+ tab_content = field.find('> .tab-content')
96
+ toggler = field.find('> .controls > .btn-group > .toggler')
97
+ # add each nested field to a tab-pane and reference it in the nav
98
+ tab_content.children('.fields:not(.tab-pane)').addClass('tab-pane').each ->
99
+ $(this).attr('id', 'unique-id-' + (new Date().getTime()) + Math.floor(Math.random() * 100000)) # some elements are created on the same ms
100
+ nav.append('<li><a data-toggle="tab" href="#' + this.id + '">' + $(this).children('.object-infos').data('object-label') + '</a></li>')
101
+ # only if no tab is set to active
102
+ if nav.find("> li.active").length == 0
103
+ # init first tab, toggler and tab_content/tabs visibility
104
+ nav.find("> li > a[data-toggle='tab']:first").tab('show')
105
+ if nav.children().length == 0
106
+ nav.hide()
107
+ tab_content.hide()
108
+ toggler.addClass('disabled').removeClass('active').children('i').addClass('icon-chevron-right')
109
+ else
110
+ if toggler.hasClass('active')
111
+ nav.show()
112
+ tab_content.show()
113
+ toggler.children('i').addClass('icon-chevron-down')
114
+ else
115
+ nav.hide()
116
+ tab_content.hide()
117
+ toggler.children('i').addClass('icon-chevron-right')
118
+
119
+ # nested-one
120
+
121
+ content.find('[data-nestedone]').each ->
122
+ field = $(this).parents('.control-group').first()
123
+ nav = field.find("> .controls > .nav")
124
+ tab_content = field.find("> .tab-content")
125
+ toggler = field.find('> .controls > .btn-group > .toggler')
126
+ tab_content.children(".fields:not(.tab-pane)").addClass('tab-pane active').each ->
127
+ # Convert the "add nested field" button to just showing the title of the new model
128
+ field.find('> .controls .add_nested_fields').removeClass('add_nested_fields').html($(this).children('.object-infos').data('object-label'))
129
+ nav.append('<li><a data-toggle="tab" href="#' + this.id + '">' + $(this).children('.object-infos').data('object-label') + '</a></li>')
130
+ first_tab = nav.find("> li > a[data-toggle='tab']:first")
131
+ first_tab.tab('show')
132
+ field.find("> .controls > [data-target]:first").html('<i class="icon-white"></i> ' + first_tab.html())
133
+ nav.hide()
134
+ if nav.children().length == 0
135
+ nav.hide()
136
+ tab_content.hide()
137
+ toggler.addClass('disabled').removeClass('active').children('i').addClass('icon-chevron-right')
138
+ else
139
+ if toggler.hasClass('active')
140
+ toggler.children('i').addClass('icon-chevron-down')
141
+ tab_content.show()
142
+ else
143
+ toggler.children('i').addClass('icon-chevron-right')
144
+ tab_content.hide()
145
+
146
+ # polymorphic-association
147
+
148
+ content.find('[data-polymorphic]').each ->
149
+ type_select = $(this)
150
+ field = type_select.parents('.control-group').first()
151
+ object_select = field.find('select').last()
152
+ urls = type_select.data('urls')
153
+ type_select.on 'change', (e) ->
154
+ if $(this).val() is ''
155
+ object_select.html('<option value=""></option>')
156
+ else
157
+ $.ajax
158
+ url: urls[type_select.val()]
159
+ data:
160
+ compact: true
161
+ all: true
162
+ beforeSend: (xhr) ->
163
+ xhr.setRequestHeader("Accept", "application/json")
164
+ success: (data, status, xhr) ->
165
+ html = $('<option></option>')
166
+ $(data).each (i, el) ->
167
+ option = $('<option></option>')
168
+ option.attr('value', el.id)
169
+ option.text(el.label)
170
+ html = html.add(option)
171
+ object_select.html(html)
172
+
173
+ # ckeditor
174
+
175
+ goCkeditors = ->
176
+ content.find('[data-richtext=ckeditor]').not('.ckeditored').each (index, domEle) ->
177
+ try
178
+ if instance = window.CKEDITOR.instances[this.id]
179
+ instance.destroy(true)
180
+ window.CKEDITOR.replace(this, $(this).data('options'))
181
+ $(this).addClass('ckeditored')
182
+
183
+ $editors = content.find('[data-richtext=ckeditor]').not('.ckeditored')
184
+ if $editors.length
185
+ if not window.CKEDITOR
186
+ options = $editors.first().data('options')
187
+ window.CKEDITOR_BASEPATH = options['base_location']
188
+ $.getScript options['jspath'], (script, textStatus, jqXHR) =>
189
+ goCkeditors()
190
+ else
191
+ goCkeditors()
192
+
193
+ #codemirror
194
+
195
+ goCodeMirrors = (array) =>
196
+ array.each (index, domEle) ->
197
+ options = $(this).data('options')
198
+ textarea = this
199
+ $.getScript options['locations']['mode'], (script, textStatus, jqXHR) ->
200
+ $('head').append('<link href="' + options['locations']['theme'] + '" rel="stylesheet" media="all" type="text\/css">')
201
+ CodeMirror.fromTextArea(textarea, options['options'])
202
+ $(textarea).addClass('codemirrored')
203
+
204
+ array = content.find('[data-richtext=codemirror]').not('.codemirrored')
205
+ if array.length
206
+ @array = array
207
+ if not window.CodeMirror
208
+ options = $(array[0]).data('options')
209
+ $('head').append('<link href="' + options['csspath'] + '" rel="stylesheet" media="all" type="text\/css">')
210
+ $.getScript options['jspath'], (script, textStatus, jqXHR) =>
211
+ goCodeMirrors(@array)
212
+ else
213
+ goCodeMirrors(@array)
214
+
215
+ # bootstrap_wysihtml5
216
+
217
+ goBootstrapWysihtml5s = (array, config_options) =>
218
+ array.each ->
219
+ $(@).addClass('bootstrap-wysihtml5ed')
220
+ $(@).closest('.controls').addClass('well')
221
+ $(@).wysihtml5(config_options)
222
+
223
+ array = content.find('[data-richtext=bootstrap-wysihtml5]').not('.bootstrap-wysihtml5ed')
224
+ if array.length
225
+ @array = array
226
+ options = $(array[0]).data('options')
227
+ config_options = $.parseJSON(options['config_options'])
228
+ if not window.wysihtml5
229
+ $('head').append('<link href="' + options['csspath'] + '" rel="stylesheet" media="all" type="text\/css">')
230
+ $.getScript options['jspath'], (script, textStatus, jqXHR) =>
231
+ goBootstrapWysihtml5s(@array, config_options)
232
+ else
233
+ goBootstrapWysihtml5s(@array, config_options)