vue_crud 0.1.9.6 → 0.1.9.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generators/vue_crud/froala_generator.rb +12 -0
  3. data/lib/generators/vue_crud/sortable.rb +10 -0
  4. data/lib/generators/vue_crud/templates/assets/images/froala_editor/color_picker.png +0 -0
  5. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/froala_editor.js +11089 -0
  6. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/languages/en_gb.js +178 -0
  7. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/languages/zh_cn.js +234 -0
  8. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/languages/zh_tw.js +234 -0
  9. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/align.js +119 -0
  10. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/char_counter.js +150 -0
  11. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/code_beautifier.js +3271 -0
  12. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/code_view.js +311 -0
  13. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/colors.js +350 -0
  14. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/draggable.js +379 -0
  15. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/emoticons.js +347 -0
  16. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/entities.js +113 -0
  17. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/file.js +609 -0
  18. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/font_family.js +178 -0
  19. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/font_size.js +116 -0
  20. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/forms.js +415 -0
  21. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/fullscreen.js +209 -0
  22. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/image.js +2401 -0
  23. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/image_manager.js +921 -0
  24. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/inline_style.js +86 -0
  25. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/line_breaker.js +435 -0
  26. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/link.js +997 -0
  27. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/lists.js +382 -0
  28. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/paragraph_format.js +293 -0
  29. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/paragraph_style.js +139 -0
  30. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/quick_insert.js +342 -0
  31. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/quote.js +138 -0
  32. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/save.js +176 -0
  33. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/table.js +3123 -0
  34. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/url.js +113 -0
  35. data/lib/generators/vue_crud/templates/assets/javascripts/froala_editor/plugins/video.js +1135 -0
  36. data/lib/generators/vue_crud/templates/assets/javascripts/sortable.js +1249 -0
  37. data/lib/generators/vue_crud/templates/assets/stylesheets/froala_editor/froala_editor.scss +1008 -0
  38. data/lib/generators/vue_crud/templates/assets/stylesheets/froala_editor/froala_style.scss +273 -0
  39. data/lib/generators/vue_crud/templates/assets/stylesheets/froala_editor/plugins/char_counter.scss +46 -0
  40. data/lib/generators/vue_crud/templates/assets/stylesheets/froala_editor/plugins/code_view.scss +102 -0
  41. data/lib/generators/vue_crud/templates/assets/stylesheets/froala_editor/plugins/colors.scss +129 -0
  42. data/lib/generators/vue_crud/templates/assets/stylesheets/froala_editor/plugins/draggable.scss +32 -0
  43. data/lib/generators/vue_crud/templates/assets/stylesheets/froala_editor/plugins/emoticons.scss +27 -0
  44. data/lib/generators/vue_crud/templates/assets/stylesheets/froala_editor/plugins/file.scss +135 -0
  45. data/lib/generators/vue_crud/templates/assets/stylesheets/froala_editor/plugins/fullscreen.scss +28 -0
  46. data/lib/generators/vue_crud/templates/assets/stylesheets/froala_editor/plugins/image.scss +233 -0
  47. data/lib/generators/vue_crud/templates/assets/stylesheets/froala_editor/plugins/image_manager.scss +370 -0
  48. data/lib/generators/vue_crud/templates/assets/stylesheets/froala_editor/plugins/line_breaker.scss +26 -0
  49. data/lib/generators/vue_crud/templates/assets/stylesheets/froala_editor/plugins/quick_insert.scss +56 -0
  50. data/lib/generators/vue_crud/templates/assets/stylesheets/froala_editor/plugins/table.scss +156 -0
  51. data/lib/generators/vue_crud/templates/assets/stylesheets/froala_editor/plugins/video.scss +136 -0
  52. data/lib/generators/vue_crud/templates/assets/stylesheets/froala_editor/themes/dark.scss +1087 -0
  53. data/lib/generators/vue_crud/templates/assets/stylesheets/froala_editor/themes/gray.scss +1087 -0
  54. data/lib/generators/vue_crud/templates/assets/stylesheets/froala_editor/themes/red.scss +1087 -0
  55. data/lib/generators/vue_crud/templates/assets/stylesheets/froala_editor/themes/royal.scss +1087 -0
  56. data/lib/generators/vue_crud/templates/vue_crud.html +54 -71
  57. data/lib/vue_crud/version.rb +1 -1
  58. data/vendor/assets/javascripts/vue_crud.js +212 -59
  59. metadata +56 -2
@@ -0,0 +1,119 @@
1
+ /*!
2
+ * froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor)
3
+ * License https://froala.com/wysiwyg-editor/terms/
4
+ * Copyright 2014-2016 Froala Labs
5
+ */
6
+
7
+ (function (factory) {
8
+ if (typeof define === 'function' && define.amd) {
9
+ // AMD. Register as an anonymous module.
10
+ define(['jquery'], factory);
11
+ } else if (typeof module === 'object' && module.exports) {
12
+ // Node/CommonJS
13
+ module.exports = function( root, jQuery ) {
14
+ if ( jQuery === undefined ) {
15
+ // require('jQuery') returns a factory that requires window to
16
+ // build a jQuery instance, we normalize how we use modules
17
+ // that require this pattern but the window provided is a noop
18
+ // if it's defined (how jquery works)
19
+ if ( typeof window !== 'undefined' ) {
20
+ jQuery = require('jquery');
21
+ }
22
+ else {
23
+ jQuery = require('jquery')(root);
24
+ }
25
+ }
26
+ factory(jQuery);
27
+ return jQuery;
28
+ };
29
+ } else {
30
+ // Browser globals
31
+ factory(jQuery);
32
+ }
33
+ }(function ($) {
34
+
35
+ 'use strict';
36
+
37
+ $.FE.PLUGINS.align = function (editor) {
38
+ function apply (val) {
39
+ // Wrap.
40
+ editor.selection.save();
41
+ editor.html.wrap(true, true, true, true);
42
+ editor.selection.restore();
43
+
44
+ var blocks = editor.selection.blocks();
45
+
46
+ for (var i = 0; i < blocks.length; i++) {
47
+ $(blocks[i]).css('text-align', val).removeClass('fr-temp-div');
48
+ if ($(blocks[i]).attr('class') === '') $(blocks[i]).removeAttr('class');
49
+ }
50
+
51
+ editor.selection.save();
52
+ editor.html.unwrap();
53
+ editor.selection.restore();
54
+ }
55
+
56
+ function refresh ($btn) {
57
+ var blocks = editor.selection.blocks();
58
+ if (blocks.length) {
59
+ var alignment = editor.helpers.getAlignment($(blocks[0]));
60
+
61
+ $btn.find('> *:first').replaceWith(editor.icon.create('align-' + alignment));
62
+ }
63
+ }
64
+
65
+ function refreshOnShow($btn, $dropdown) {
66
+ var blocks = editor.selection.blocks();
67
+ if (blocks.length) {
68
+ var alignment = editor.helpers.getAlignment($(blocks[0]));
69
+
70
+ $dropdown.find('a.fr-command[data-param1="' + alignment + '"]').addClass('fr-active');
71
+ }
72
+ }
73
+
74
+ return {
75
+ apply: apply,
76
+ refresh: refresh,
77
+ refreshOnShow: refreshOnShow
78
+ }
79
+ }
80
+
81
+ $.FE.DefineIcon('align', { NAME: 'align-left' });
82
+ $.FE.DefineIcon('align-left', { NAME: 'align-left' });
83
+ $.FE.DefineIcon('align-right', { NAME: 'align-right' });
84
+ $.FE.DefineIcon('align-center', { NAME: 'align-center' });
85
+ $.FE.DefineIcon('align-justify', { NAME: 'align-justify' });
86
+ $.FE.RegisterCommand('align', {
87
+ type: 'dropdown',
88
+ title: 'Align',
89
+ options: {
90
+ left: 'Align Left',
91
+ center: 'Align Center',
92
+ right: 'Align Right',
93
+ justify: 'Align Justify'
94
+ },
95
+ html: function () {
96
+ var c = '<ul class="fr-dropdown-list">';
97
+ var options = $.FE.COMMANDS.align.options;
98
+ for (var val in options) {
99
+ if (options.hasOwnProperty(val)) {
100
+ c += '<li><a class="fr-command fr-title" data-cmd="align" data-param1="' + val + '" title="' + this.language.translate(options[val]) + '">' + this.icon.create('align-' + val) + '</a></li>';
101
+ }
102
+ }
103
+ c += '</ul>';
104
+
105
+ return c;
106
+ },
107
+ callback: function (cmd, val) {
108
+ this.align.apply(val);
109
+ },
110
+ refresh: function ($btn) {
111
+ this.align.refresh($btn);
112
+ },
113
+ refreshOnShow: function ($btn, $dropdown) {
114
+ this.align.refreshOnShow($btn, $dropdown);
115
+ },
116
+ plugin: 'align'
117
+ })
118
+
119
+ }));
@@ -0,0 +1,150 @@
1
+ /*!
2
+ * froala_editor v2.3.3 (https://www.froala.com/wysiwyg-editor)
3
+ * License https://froala.com/wysiwyg-editor/terms/
4
+ * Copyright 2014-2016 Froala Labs
5
+ */
6
+
7
+ (function (factory) {
8
+ if (typeof define === 'function' && define.amd) {
9
+ // AMD. Register as an anonymous module.
10
+ define(['jquery'], factory);
11
+ } else if (typeof module === 'object' && module.exports) {
12
+ // Node/CommonJS
13
+ module.exports = function( root, jQuery ) {
14
+ if ( jQuery === undefined ) {
15
+ // require('jQuery') returns a factory that requires window to
16
+ // build a jQuery instance, we normalize how we use modules
17
+ // that require this pattern but the window provided is a noop
18
+ // if it's defined (how jquery works)
19
+ if ( typeof window !== 'undefined' ) {
20
+ jQuery = require('jquery');
21
+ }
22
+ else {
23
+ jQuery = require('jquery')(root);
24
+ }
25
+ }
26
+ factory(jQuery);
27
+ return jQuery;
28
+ };
29
+ } else {
30
+ // Browser globals
31
+ factory(jQuery);
32
+ }
33
+ }(function ($) {
34
+
35
+ 'use strict';
36
+
37
+ // Extend defaults.
38
+ $.extend($.FE.DEFAULTS, {
39
+ charCounterMax: -1,
40
+ charCounterCount: true
41
+ });
42
+
43
+
44
+ $.FE.PLUGINS.charCounter = function (editor) {
45
+ var $counter;
46
+
47
+ /**
48
+ * Get the char number.
49
+ */
50
+ function count () {
51
+ return editor.$el.text().length;
52
+ }
53
+
54
+ /**
55
+ * Check chars on typing.
56
+ */
57
+ function _checkCharNumber (e) {
58
+ // Continue if infinite characters;
59
+ if (editor.opts.charCounterMax < 0) return true;
60
+
61
+ // Continue if enough characters.
62
+ if (count() < editor.opts.charCounterMax) return true;
63
+
64
+ // Stop if the key will produce a new char.
65
+ var keyCode = e.which;
66
+ if (!editor.keys.ctrlKey(e) && editor.keys.isCharacter(keyCode)) {
67
+ e.preventDefault();
68
+ e.stopPropagation();
69
+ editor.events.trigger('charCounter.exceeded');
70
+ return false;
71
+ }
72
+
73
+ return true;
74
+ }
75
+
76
+ /**
77
+ * Check chars on paste.
78
+ */
79
+ function _checkCharNumberOnPaste (html) {
80
+ if (editor.opts.charCounterMax < 0) return html;
81
+
82
+ var len = $('<div>').html(html).text().length;
83
+ if (len + count() <= editor.opts.charCounterMax) return html;
84
+
85
+ editor.events.trigger('charCounter.exceeded');
86
+
87
+ return '';
88
+ }
89
+
90
+ /**
91
+ * Update the char counter.
92
+ */
93
+ function _updateCharNumber () {
94
+ if (editor.opts.charCounterCount) {
95
+ var chars = count() + (editor.opts.charCounterMax > 0 ? '/' + editor.opts.charCounterMax : '');
96
+
97
+ $counter.text(chars);
98
+
99
+ if (editor.opts.toolbarBottom) {
100
+ $counter.css('margin-bottom', editor.$tb.outerHeight(true))
101
+ }
102
+
103
+ // Scroll size correction.
104
+ var scroll_size = editor.$wp.get(0).offsetWidth - editor.$wp.get(0).clientWidth;
105
+ if (scroll_size >= 0) {
106
+ if (editor.opts.direction == 'rtl') {
107
+ $counter.css('margin-left', scroll_size);
108
+ }
109
+ else {
110
+ $counter.css('margin-right', scroll_size);
111
+ }
112
+ }
113
+ }
114
+ }
115
+
116
+ /*
117
+ * Initialize.
118
+ */
119
+ function _init () {
120
+ if (!editor.$wp) return false;
121
+
122
+ if (!editor.opts.charCounterCount) return false;
123
+
124
+ $counter = $('<span class="fr-counter"></span><input class="fr-color-picker" type="color">');
125
+ $counter.css('bottom', editor.$wp.css('border-bottom-width'));
126
+ editor.$box.append($counter);
127
+
128
+ editor.events.on('keydown', _checkCharNumber, true);
129
+ editor.events.on('paste.afterCleanup', _checkCharNumberOnPaste);
130
+ editor.events.on('keyup contentChanged', function () {
131
+ editor.events.trigger('charCounter.update');
132
+ });
133
+
134
+ editor.events.on('charCounter.update', _updateCharNumber);
135
+ editor.events.trigger('charCounter.update');
136
+
137
+ editor.events.on('destroy', function () {
138
+ $(editor.o_win).off('resize.char' + editor.id);
139
+ $counter.removeData().remove();
140
+ $counter = null;
141
+ });
142
+ }
143
+
144
+ return {
145
+ _init: _init,
146
+ count: count
147
+ }
148
+ }
149
+
150
+ }));