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,347 @@
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($.FE.POPUP_TEMPLATES, {
38
+ emoticons: '[_BUTTONS_][_EMOTICONS_]'
39
+ })
40
+
41
+ // Extend defaults.
42
+ $.extend($.FE.DEFAULTS, {
43
+ emoticonsStep: 8,
44
+ emoticonsSet: [
45
+ { code: '1f600', desc: 'Grinning face' },
46
+ { code: '1f601', desc: 'Grinning face with smiling eyes' },
47
+ { code: '1f602', desc: 'Face with tears of joy' },
48
+ { code: '1f603', desc: 'Smiling face with open mouth' },
49
+ { code: '1f604', desc: 'Smiling face with open mouth and smiling eyes' },
50
+ { code: '1f605', desc: 'Smiling face with open mouth and cold sweat' },
51
+ { code: '1f606', desc: 'Smiling face with open mouth and tightly-closed eyes' },
52
+ { code: '1f607', desc: 'Smiling face with halo' },
53
+
54
+ { code: '1f608', desc: 'Smiling face with horns' },
55
+ { code: '1f609', desc: 'Winking face' },
56
+ { code: '1f60a', desc: 'Smiling face with smiling eyes' },
57
+ { code: '1f60b', desc: 'Face savoring delicious food' },
58
+ { code: '1f60c', desc: 'Relieved face' },
59
+ { code: '1f60d', desc: 'Smiling face with heart-shaped eyes' },
60
+ { code: '1f60e', desc: 'Smiling face with sunglasses' },
61
+ { code: '1f60f', desc: 'Smirking face' },
62
+
63
+ { code: '1f610', desc: 'Neutral face' },
64
+ { code: '1f611', desc: 'Expressionless face' },
65
+ { code: '1f612', desc: 'Unamused face' },
66
+ { code: '1f613', desc: 'Face with cold sweat' },
67
+ { code: '1f614', desc: 'Pensive face' },
68
+ { code: '1f615', desc: 'Confused face' },
69
+ { code: '1f616', desc: 'Confounded face' },
70
+ { code: '1f617', desc: 'Kissing face' },
71
+
72
+ { code: '1f618', desc: 'Face throwing a kiss' },
73
+ { code: '1f619', desc: 'Kissing face with smiling eyes' },
74
+ { code: '1f61a', desc: 'Kissing face with closed eyes' },
75
+ { code: '1f61b', desc: 'Face with stuck out tongue' },
76
+ { code: '1f61c', desc: 'Face with stuck out tongue and winking eye' },
77
+ { code: '1f61d', desc: 'Face with stuck out tongue and tightly-closed eyes' },
78
+ { code: '1f61e', desc: 'Disappointed face' },
79
+ { code: '1f61f', desc: 'Worried face' },
80
+
81
+ { code: '1f620', desc: 'Angry face' },
82
+ { code: '1f621', desc: 'Pouting face' },
83
+ { code: '1f622', desc: 'Crying face' },
84
+ { code: '1f623', desc: 'Persevering face' },
85
+ { code: '1f624', desc: 'Face with look of triumph' },
86
+ { code: '1f625', desc: 'Disappointed but relieved face' },
87
+ { code: '1f626', desc: 'Frowning face with open mouth' },
88
+ { code: '1f627', desc: 'Anguished face' },
89
+
90
+ { code: '1f628', desc: 'Fearful face' },
91
+ { code: '1f629', desc: 'Weary face' },
92
+ { code: '1f62a', desc: 'Sleepy face' },
93
+ { code: '1f62b', desc: 'Tired face' },
94
+ { code: '1f62c', desc: 'Grimacing face' },
95
+ { code: '1f62d', desc: 'Loudly crying face' },
96
+ { code: '1f62e', desc: 'Face with open mouth' },
97
+ { code: '1f62f', desc: 'Hushed face' },
98
+
99
+ { code: '1f630', desc: 'Face with open mouth and cold sweat' },
100
+ { code: '1f631', desc: 'Face screaming in fear' },
101
+ { code: '1f632', desc: 'Astonished face' },
102
+ { code: '1f633', desc: 'Flushed face' },
103
+ { code: '1f634', desc: 'Sleeping face' },
104
+ { code: '1f635', desc: 'Dizzy face' },
105
+ { code: '1f636', desc: 'Face without mouth' },
106
+ { code: '1f637', desc: 'Face with medical mask' }
107
+ ],
108
+ emoticonsButtons: ['emoticonsBack', '|'],
109
+ emoticonsUseImage: true
110
+ });
111
+
112
+ $.FE.PLUGINS.emoticons = function (editor) {
113
+ /*
114
+ * Show the emoticons popup.
115
+ */
116
+ function _showEmoticonsPopup () {
117
+ var $btn = editor.$tb.find('.fr-command[data-cmd="emoticons"]');
118
+
119
+ var $popup = editor.popups.get('emoticons');
120
+ if (!$popup) $popup = _initEmoticonsPopup();
121
+
122
+ if (!$popup.hasClass('fr-active')) {
123
+ // Colors popup
124
+ editor.popups.refresh('emoticons');
125
+ editor.popups.setContainer('emoticons', editor.$tb);
126
+
127
+ // Colors popup left and top position.
128
+ var left = $btn.offset().left + $btn.outerWidth() / 2;
129
+ var top = $btn.offset().top + (editor.opts.toolbarBottom ? 10 : $btn.outerHeight() - 10);
130
+
131
+ editor.popups.show('emoticons', left, top, $btn.outerHeight());
132
+ }
133
+ }
134
+
135
+ /*
136
+ * Hide emoticons popup.
137
+ */
138
+ function _hideEmoticonsPopup () {
139
+ // Hide popup.
140
+ editor.popups.hide('emoticons');
141
+ }
142
+
143
+ /**
144
+ * Init the emoticons popup.
145
+ */
146
+ function _initEmoticonsPopup () {
147
+ var emoticons_buttons = '';
148
+
149
+ if (editor.opts.toolbarInline) {
150
+ // Colors buttons.
151
+ if (editor.opts.emoticonsButtons.length > 0) {
152
+ emoticons_buttons = '<div class="fr-buttons fr-emoticons-buttons">' + editor.button.buildList(editor.opts.emoticonsButtons) + '</div>';
153
+ }
154
+ }
155
+
156
+ var template = {
157
+ buttons: emoticons_buttons,
158
+ emoticons: _emoticonsHTML()
159
+ };
160
+
161
+ // Create popup.
162
+ var $popup = editor.popups.create('emoticons', template);
163
+
164
+ // Assing tooltips to buttons.
165
+ editor.tooltip.bind($popup, '.fr-emoticon');
166
+
167
+ return $popup;
168
+ }
169
+
170
+ /*
171
+ * HTML for the emoticons popup.
172
+ */
173
+ function _emoticonsHTML () {
174
+ // Create emoticons html.
175
+ var emoticons_html = '<div style="text-align: center">';
176
+
177
+ // Add emoticons.
178
+ for (var i = 0; i < editor.opts.emoticonsSet.length; i++) {
179
+ if (i !== 0 && i % editor.opts.emoticonsStep === 0) {
180
+ emoticons_html += '<br>';
181
+ }
182
+
183
+ emoticons_html += '<span class="fr-command fr-emoticon" data-cmd="insertEmoticon" title="' + editor.language.translate(editor.opts.emoticonsSet[i].desc) + '" data-param1="' + editor.opts.emoticonsSet[i].code + '">' + (editor.opts.emoticonsUseImage ? '<img src="' + 'https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.1/assets/svg/' + editor.opts.emoticonsSet[i].code + '.svg' + '"/>' : '&#x' + editor.opts.emoticonsSet[i].code + ';') + '</span>';
184
+ }
185
+
186
+ if (editor.opts.emoticonsUseImage) emoticons_html += '<p style="font-size: 12px; text-align: center; padding: 0 5px;">Emoji free by <a href="http://emojione.com/" target="_blank" rel="nofollow">Emoji One</a></p>';
187
+ emoticons_html += '</div>';
188
+
189
+ return emoticons_html;
190
+ }
191
+
192
+ /*
193
+ * Insert emoticon.
194
+ */
195
+ function insert (emoticon, img) {
196
+ // Insert emoticon.
197
+ editor.html.insert('<span class="fr-emoticon fr-deletable' + (img ? ' fr-emoticon-img' : '') + '"' + (img ? ' style="background: url(' + img + ');"' : '') + '>' + (img ? '&nbsp;' : emoticon) + '</span>' + '&nbsp;' + $.FE.MARKERS, true);
198
+ }
199
+
200
+ /*
201
+ * Go back to the inline editor.
202
+ */
203
+ function back () {
204
+ editor.popups.hide('emoticons');
205
+ editor.toolbar.showInline();
206
+ }
207
+
208
+ /*
209
+ * Init emoticons.
210
+ */
211
+ function _init () {
212
+ var setDeletable = function () {
213
+ var emtcs = editor.$el.get(0).querySelectorAll('.fr-emoticon:not(.fr-deletable)');
214
+ for (var i = 0; i < emtcs.length; i++) {
215
+ emtcs[i].className += ' fr-deletable';
216
+ }
217
+ }
218
+ setDeletable();
219
+
220
+ editor.events.on('html.set', setDeletable);
221
+
222
+ // Replace emoticons with unicode.
223
+ editor.events.on('html.get', function (html) {
224
+ for (var i = 0; i < editor.opts.emoticonsSet.length; i++) {
225
+ var em = editor.opts.emoticonsSet[i];
226
+ var text = $('<div>').html(em.code).text();
227
+ html = html.split(text).join(em.code);
228
+ }
229
+
230
+ return html;
231
+ });
232
+
233
+ var inEmoticon = function () {
234
+ if (!editor.selection.isCollapsed()) return false;
235
+
236
+ var s_el = editor.selection.element();
237
+ var e_el = editor.selection.endElement();
238
+
239
+ if ($(s_el).hasClass('fr-emoticon')) return s_el;
240
+ if ($(e_el).hasClass('fr-emoticon')) return e_el;
241
+
242
+ var range = editor.selection.ranges(0);
243
+ var container = range.startContainer;
244
+ if (container.nodeType == Node.ELEMENT_NODE) {
245
+ if (container.childNodes.length > 0 && range.startOffset > 0) {
246
+ var node = container.childNodes[range.startOffset - 1];
247
+ if ($(node).hasClass('fr-emoticon')) {
248
+ return node;
249
+ }
250
+ }
251
+ }
252
+
253
+ return false;
254
+ }
255
+
256
+ editor.events.on('keydown', function (e) {
257
+ if (editor.keys.isCharacter(e.which) && editor.selection.inEditor()) {
258
+ var range = editor.selection.ranges(0);
259
+ var el = inEmoticon();
260
+ if (el) {
261
+ if (range.startOffset === 0 && editor.selection.element() === el) {
262
+ $(el).before($.FE.MARKERS + $.FE.INVISIBLE_SPACE);
263
+ }
264
+ else {
265
+ $(el).after($.FE.INVISIBLE_SPACE + $.FE.MARKERS);
266
+ }
267
+ editor.selection.restore();
268
+ }
269
+ }
270
+ });
271
+
272
+ editor.events.on('keyup', function (e) {
273
+ var emtcs = editor.$el.get(0).querySelectorAll('.fr-emoticon');
274
+
275
+ for (var i = 0; i < emtcs.length; i++) {
276
+ if (typeof emtcs[i].textContent != 'undefined' && emtcs[i].textContent.replace(/\u200B/gi, '').length === 0) {
277
+ $(emtcs[i]).remove();
278
+ }
279
+ }
280
+
281
+ if (!(e.which >= 37 && e.which <= 40)) {
282
+ var el = inEmoticon();
283
+ if (el && (el.className || '').indexOf('fr-emoticon-img')) {
284
+ $(el).append($.FE.MARKERS);
285
+ editor.selection.restore();
286
+ }
287
+ }
288
+ });
289
+ }
290
+
291
+ return {
292
+ _init: _init,
293
+ insert: insert,
294
+ showEmoticonsPopup: _showEmoticonsPopup,
295
+ hideEmoticonsPopup: _hideEmoticonsPopup,
296
+ back: back
297
+ }
298
+ }
299
+
300
+ // Toolbar emoticons button.
301
+ $.FE.DefineIcon('emoticons', { NAME: 'smile-o' });
302
+ $.FE.RegisterCommand('emoticons', {
303
+ title: 'Emoticons',
304
+ undo: false,
305
+ focus: true,
306
+ refreshOnCallback: false,
307
+ popup: true,
308
+ callback: function () {
309
+ if (!this.popups.isVisible('emoticons')) {
310
+ this.emoticons.showEmoticonsPopup();
311
+ }
312
+ else {
313
+ if (this.$el.find('.fr-marker')) {
314
+ this.events.disableBlur();
315
+ this.selection.restore();
316
+ }
317
+ this.popups.hide('emoticons');
318
+ }
319
+ },
320
+ plugin: 'emoticons'
321
+ });
322
+
323
+ // Insert emoticon command.
324
+ $.FE.RegisterCommand('insertEmoticon', {
325
+ callback: function (cmd, code) {
326
+ // Insert emoticon.
327
+ this.emoticons.insert('&#x' + code + ';', this.opts.emoticonsUseImage ? 'https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.1/assets/svg/' + code + '.svg' : null);
328
+
329
+ // Hide emoticons popup.
330
+ this.emoticons.hideEmoticonsPopup();
331
+ }
332
+ });
333
+
334
+ // Emoticons back.
335
+ $.FE.DefineIcon('emoticonsBack', { NAME: 'arrow-left' });
336
+ $.FE.RegisterCommand('emoticonsBack', {
337
+ title: 'Back',
338
+ undo: false,
339
+ focus: false,
340
+ back: true,
341
+ refreshAfterCallback: false,
342
+ callback: function () {
343
+ this.emoticons.back();
344
+ }
345
+ });
346
+
347
+ }));
@@ -0,0 +1,113 @@
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
+ entities: '&amp;&lt;&gt;&quot;&apos;&iexcl;&cent;&pound;&curren;&yen;&brvbar;&sect;&uml;&copy;&ordf;&laquo;&not;&shy;&reg;&macr;&deg;&plusmn;&sup2;&sup3;&acute;&micro;&para;&middot;&cedil;&sup1;&ordm;&raquo;&frac14;&frac12;&frac34;&iquest;&Agrave;&Aacute;&Acirc;&Atilde;&Auml;&Aring;&AElig;&Ccedil;&Egrave;&Eacute;&Ecirc;&Euml;&Igrave;&Iacute;&Icirc;&Iuml;&ETH;&Ntilde;&Ograve;&Oacute;&Ocirc;&Otilde;&Ouml;&times;&Oslash;&Ugrave;&Uacute;&Ucirc;&Uuml;&Yacute;&THORN;&szlig;&agrave;&aacute;&acirc;&atilde;&auml;&aring;&aelig;&ccedil;&egrave;&eacute;&ecirc;&euml;&igrave;&iacute;&icirc;&iuml;&eth;&ntilde;&ograve;&oacute;&ocirc;&otilde;&ouml;&divide;&oslash;&ugrave;&uacute;&ucirc;&uuml;&yacute;&thorn;&yuml;&OElig;&oelig;&Scaron;&scaron;&Yuml;&fnof;&circ;&tilde;&Alpha;&Beta;&Gamma;&Delta;&Epsilon;&Zeta;&Eta;&Theta;&Iota;&Kappa;&Lambda;&Mu;&Nu;&Xi;&Omicron;&Pi;&Rho;&Sigma;&Tau;&Upsilon;&Phi;&Chi;&Psi;&Omega;&alpha;&beta;&gamma;&delta;&epsilon;&zeta;&eta;&theta;&iota;&kappa;&lambda;&mu;&nu;&xi;&omicron;&pi;&rho;&sigmaf;&sigma;&tau;&upsilon;&phi;&chi;&psi;&omega;&thetasym;&upsih;&piv;&ensp;&emsp;&thinsp;&zwnj;&zwj;&lrm;&rlm;&ndash;&mdash;&lsquo;&rsquo;&sbquo;&ldquo;&rdquo;&bdquo;&dagger;&Dagger;&bull;&hellip;&permil;&prime;&Prime;&lsaquo;&rsaquo;&oline;&frasl;&euro;&image;&weierp;&real;&trade;&alefsym;&larr;&uarr;&rarr;&darr;&harr;&crarr;&lArr;&uArr;&rArr;&dArr;&hArr;&forall;&part;&exist;&empty;&nabla;&isin;&notin;&ni;&prod;&sum;&minus;&lowast;&radic;&prop;&infin;&ang;&and;&or;&cap;&cup;&int;&there4;&sim;&cong;&asymp;&ne;&equiv;&le;&ge;&sub;&sup;&nsub;&sube;&supe;&oplus;&otimes;&perp;&sdot;&lceil;&rceil;&lfloor;&rfloor;&lang;&rang;&loz;&spades;&clubs;&hearts;&diams;'
40
+ });
41
+
42
+
43
+ $.FE.PLUGINS.entities = function (editor) {
44
+ var _reg_exp;
45
+ var _map;
46
+
47
+ function _process(el) {
48
+ var text = el.textContent;
49
+ if (text.match(_reg_exp)) {
50
+ var new_text = '';
51
+ for (var j = 0; j < text.length; j++) {
52
+ if (_map[text[j]]) new_text += _map[text[j]];
53
+ else new_text += text[j];
54
+ }
55
+ el.textContent = new_text;
56
+ }
57
+ }
58
+
59
+ function _encode (el) {
60
+ if (el && ['STYLE', 'SCRIPT'].indexOf(el.tagName) >= 0) return true;
61
+
62
+ var contents = editor.node.contents(el);
63
+
64
+ for (var i = 0; i < contents.length; i++) {
65
+ if (contents[i].nodeType == Node.TEXT_NODE) {
66
+ _process(contents[i]);
67
+ }
68
+ else {
69
+ _encode(contents[i]);
70
+ }
71
+ }
72
+
73
+ if (el.nodeType == Node.TEXT_NODE) _process(el);
74
+ }
75
+
76
+ /**
77
+ * Encode entities.
78
+ */
79
+ function _encodeEntities (html) {
80
+ if (html.length === 0) return '';
81
+
82
+ return editor.clean.exec(html, _encode);
83
+ }
84
+
85
+ /*
86
+ * Initialize.
87
+ */
88
+ function _init () {
89
+ if (editor.opts.htmlSimpleAmpersand) {
90
+ editor.opts.entities = editor.opts.entities.replace('&amp;', '');
91
+ }
92
+
93
+ // Do escape.
94
+ var entities_text = $('<div>').html(editor.opts.entities).text();
95
+ var entities_array = editor.opts.entities.split(';');
96
+ _map = {};
97
+ _reg_exp = '';
98
+ for (var i = 0; i < entities_text.length; i++) {
99
+ var chr = entities_text.charAt(i);
100
+ _map[chr] = entities_array[i] + ';';
101
+ _reg_exp += '\\' + chr + (i < entities_text.length - 1 ? '|' : '');
102
+ }
103
+ _reg_exp = new RegExp('(' + _reg_exp + ')', 'g');
104
+
105
+ editor.events.on('html.get', _encodeEntities, true);
106
+ }
107
+
108
+ return {
109
+ _init: _init
110
+ }
111
+ }
112
+
113
+ }));