wysiwyg-rails 2.7.5 → 2.7.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/froala_editor.min.js +8 -8
  3. data/app/assets/javascripts/froala_editor.pkgd.min.js +18 -18
  4. data/app/assets/javascripts/languages/ar.js +1 -1
  5. data/app/assets/javascripts/languages/bs.js +1 -1
  6. data/app/assets/javascripts/languages/cs.js +1 -1
  7. data/app/assets/javascripts/languages/da.js +1 -1
  8. data/app/assets/javascripts/languages/de.js +1 -1
  9. data/app/assets/javascripts/languages/en_ca.js +1 -1
  10. data/app/assets/javascripts/languages/en_gb.js +1 -1
  11. data/app/assets/javascripts/languages/es.js +1 -1
  12. data/app/assets/javascripts/languages/et.js +1 -1
  13. data/app/assets/javascripts/languages/fa.js +1 -1
  14. data/app/assets/javascripts/languages/fi.js +1 -1
  15. data/app/assets/javascripts/languages/fr.js +1 -1
  16. data/app/assets/javascripts/languages/he.js +1 -1
  17. data/app/assets/javascripts/languages/hr.js +1 -1
  18. data/app/assets/javascripts/languages/hu.js +1 -1
  19. data/app/assets/javascripts/languages/id.js +1 -1
  20. data/app/assets/javascripts/languages/it.js +1 -1
  21. data/app/assets/javascripts/languages/ja.js +1 -1
  22. data/app/assets/javascripts/languages/ko.js +1 -1
  23. data/app/assets/javascripts/languages/me.js +1 -1
  24. data/app/assets/javascripts/languages/nb.js +1 -1
  25. data/app/assets/javascripts/languages/nl.js +26 -26
  26. data/app/assets/javascripts/languages/pl.js +5 -5
  27. data/app/assets/javascripts/languages/pt_br.js +1 -1
  28. data/app/assets/javascripts/languages/pt_pt.js +1 -1
  29. data/app/assets/javascripts/languages/ro.js +1 -1
  30. data/app/assets/javascripts/languages/ru.js +2 -2
  31. data/app/assets/javascripts/languages/sk.js +1 -1
  32. data/app/assets/javascripts/languages/sr.js +1 -1
  33. data/app/assets/javascripts/languages/sv.js +50 -50
  34. data/app/assets/javascripts/languages/th.js +1 -1
  35. data/app/assets/javascripts/languages/tr.js +1 -1
  36. data/app/assets/javascripts/languages/uk.js +2 -2
  37. data/app/assets/javascripts/languages/vi.js +1 -1
  38. data/app/assets/javascripts/languages/zh_cn.js +1 -1
  39. data/app/assets/javascripts/languages/zh_tw.js +1 -1
  40. data/app/assets/javascripts/plugins/align.min.js +2 -2
  41. data/app/assets/javascripts/plugins/char_counter.min.js +1 -1
  42. data/app/assets/javascripts/plugins/code_beautifier.min.js +1 -1
  43. data/app/assets/javascripts/plugins/code_view.min.js +2 -2
  44. data/app/assets/javascripts/plugins/colors.min.js +1 -1
  45. data/app/assets/javascripts/plugins/draggable.min.js +2 -2
  46. data/app/assets/javascripts/plugins/emoticons.min.js +2 -2
  47. data/app/assets/javascripts/plugins/entities.min.js +1 -1
  48. data/app/assets/javascripts/plugins/file.min.js +2 -2
  49. data/app/assets/javascripts/plugins/font_family.min.js +1 -1
  50. data/app/assets/javascripts/plugins/font_size.min.js +1 -1
  51. data/app/assets/javascripts/plugins/forms.min.js +1 -1
  52. data/app/assets/javascripts/plugins/fullscreen.min.js +2 -2
  53. data/app/assets/javascripts/plugins/help.min.js +2 -2
  54. data/app/assets/javascripts/plugins/image.min.js +3 -3
  55. data/app/assets/javascripts/plugins/image_manager.min.js +2 -2
  56. data/app/assets/javascripts/plugins/inline_style.min.js +1 -1
  57. data/app/assets/javascripts/plugins/line_breaker.min.js +1 -1
  58. data/app/assets/javascripts/plugins/link.min.js +2 -2
  59. data/app/assets/javascripts/plugins/lists.min.js +1 -1
  60. data/app/assets/javascripts/plugins/paragraph_format.min.js +2 -2
  61. data/app/assets/javascripts/plugins/paragraph_style.min.js +1 -1
  62. data/app/assets/javascripts/plugins/print.min.js +1 -1
  63. data/app/assets/javascripts/plugins/quick_insert.min.js +2 -2
  64. data/app/assets/javascripts/plugins/quote.min.js +1 -1
  65. data/app/assets/javascripts/plugins/save.min.js +1 -1
  66. data/app/assets/javascripts/plugins/special_characters.min.js +1 -1
  67. data/app/assets/javascripts/plugins/table.min.js +3 -3
  68. data/app/assets/javascripts/plugins/url.min.js +2 -2
  69. data/app/assets/javascripts/plugins/video.min.js +3 -3
  70. data/app/assets/javascripts/plugins/word_paste.min.js +2 -2
  71. data/app/assets/javascripts/third_party/embedly.min.js +2 -2
  72. data/app/assets/javascripts/third_party/image_aviary.min.js +2 -2
  73. data/app/assets/javascripts/third_party/spell_checker.min.js +1 -1
  74. data/app/assets/stylesheets/froala_editor.css +1 -7
  75. data/app/assets/stylesheets/froala_editor.min.css +2 -2
  76. data/app/assets/stylesheets/froala_editor.pkgd.css +2 -7
  77. data/app/assets/stylesheets/froala_editor.pkgd.min.css +2 -2
  78. data/app/assets/stylesheets/froala_style.css +3 -1
  79. data/app/assets/stylesheets/froala_style.min.css +2 -2
  80. data/app/assets/stylesheets/plugins/char_counter.css +1 -1
  81. data/app/assets/stylesheets/plugins/char_counter.min.css +1 -1
  82. data/app/assets/stylesheets/plugins/code_view.css +1 -1
  83. data/app/assets/stylesheets/plugins/code_view.min.css +1 -1
  84. data/app/assets/stylesheets/plugins/colors.css +1 -1
  85. data/app/assets/stylesheets/plugins/colors.min.css +1 -1
  86. data/app/assets/stylesheets/plugins/draggable.css +1 -1
  87. data/app/assets/stylesheets/plugins/draggable.min.css +1 -1
  88. data/app/assets/stylesheets/plugins/emoticons.css +1 -1
  89. data/app/assets/stylesheets/plugins/emoticons.min.css +1 -1
  90. data/app/assets/stylesheets/plugins/file.css +1 -1
  91. data/app/assets/stylesheets/plugins/file.min.css +1 -1
  92. data/app/assets/stylesheets/plugins/fullscreen.css +1 -1
  93. data/app/assets/stylesheets/plugins/fullscreen.min.css +1 -1
  94. data/app/assets/stylesheets/plugins/help.css +1 -1
  95. data/app/assets/stylesheets/plugins/help.min.css +1 -1
  96. data/app/assets/stylesheets/plugins/image.css +1 -1
  97. data/app/assets/stylesheets/plugins/image.min.css +1 -1
  98. data/app/assets/stylesheets/plugins/image_manager.css +2 -1
  99. data/app/assets/stylesheets/plugins/image_manager.min.css +2 -2
  100. data/app/assets/stylesheets/plugins/line_breaker.css +1 -1
  101. data/app/assets/stylesheets/plugins/line_breaker.min.css +1 -1
  102. data/app/assets/stylesheets/plugins/quick_insert.css +1 -1
  103. data/app/assets/stylesheets/plugins/quick_insert.min.css +1 -1
  104. data/app/assets/stylesheets/plugins/special_characters.css +1 -1
  105. data/app/assets/stylesheets/plugins/special_characters.min.css +1 -1
  106. data/app/assets/stylesheets/plugins/table.css +1 -1
  107. data/app/assets/stylesheets/plugins/table.min.css +1 -1
  108. data/app/assets/stylesheets/plugins/video.css +1 -1
  109. data/app/assets/stylesheets/plugins/video.min.css +1 -1
  110. data/app/assets/stylesheets/themes/dark.css +3 -3
  111. data/app/assets/stylesheets/themes/dark.min.css +2 -2
  112. data/app/assets/stylesheets/themes/gray.css +1 -1
  113. data/app/assets/stylesheets/themes/gray.min.css +1 -1
  114. data/app/assets/stylesheets/themes/red.css +2 -2
  115. data/app/assets/stylesheets/themes/red.min.css +2 -2
  116. data/app/assets/stylesheets/themes/royal.css +1 -1
  117. data/app/assets/stylesheets/themes/royal.min.css +1 -1
  118. data/app/assets/stylesheets/third_party/embedly.css +1 -1
  119. data/app/assets/stylesheets/third_party/embedly.min.css +1 -1
  120. data/app/assets/stylesheets/third_party/spell_checker.css +1 -1
  121. data/app/assets/stylesheets/third_party/spell_checker.min.css +1 -1
  122. data/lib/wysiwyg-rails/version.rb +1 -1
  123. metadata +2 -8
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
@@ -51,14 +51,14 @@ $.FE.LANGUAGE['sv'] = {
51
51
  "Cancel": "Avbryt",
52
52
  "OK": "Ok",
53
53
  "Back": "Tillbaka",
54
- "Remove": "Avl\u00e4gsna",
55
- "More": "Vi\u0161e",
54
+ "Remove": "Ta bort",
55
+ "More": "Mer",
56
56
  "Update": "Uppdatera",
57
57
  "Style": "Stil",
58
58
 
59
59
  // Font
60
60
  "Font Family": "Teckensnitt",
61
- "Font Size": "Storlek",
61
+ "Font Size": "Teckenstorlek",
62
62
 
63
63
  // Colors
64
64
  "Colors": "F\u00e4rger",
@@ -76,14 +76,14 @@ $.FE.LANGUAGE['sv'] = {
76
76
  "Heading 4": "Rubrik 4",
77
77
 
78
78
  // Style
79
- "Paragraph Style": "Styckeformat",
79
+ "Paragraph Style": "Styckesformat",
80
80
  "Inline Style": "Infogad stil",
81
81
 
82
82
  // Alignment
83
83
  "Align": "Justera",
84
- "Align Left": "V\u00e4nsterst\u00e4ll",
84
+ "Align Left": "Vänsterjustera",
85
85
  "Align Center": "Centrera",
86
- "Align Right": "H\u00f6gerst\u00e4ll",
86
+ "Align Right": "Högerjustera",
87
87
  "Align Justify": "Justera",
88
88
  "None": "Inget",
89
89
 
@@ -108,25 +108,25 @@ $.FE.LANGUAGE['sv'] = {
108
108
  "Upload Image": "Ladda upp en bild",
109
109
  "By URL": "Genom URL",
110
110
  "Browse": "Bl\u00e4ddra",
111
- "Drop image": "Sl\u00e4ppa bild",
111
+ "Drop image": "Sl\u00e4pp bild",
112
112
  "or click": "eller klicka",
113
113
  "Manage Images": "Hantera bilder",
114
- "Loading": "L\u00e4ser",
115
- "Deleting": "Radera",
116
- "Tags": "Taggar",
114
+ "Loading": "Laddar",
115
+ "Deleting": "Raderar",
116
+ "Tags": "Etiketter",
117
117
  "Are you sure? Image will be deleted.": "\u00c4r du s\u00e4ker? Bild kommer att raderas.",
118
118
  "Replace": "Ers\u00e4tt",
119
- "Uploading": "Uppladdning",
119
+ "Uploading": "Laddar up",
120
120
  "Loading image": "Laddar bild",
121
121
  "Display": "Visa",
122
- "Inline": "I k\u00f6",
123
- "Break Text": "Break text",
122
+ "Inline": "I linje",
123
+ "Break Text": "Bryt text",
124
124
  "Alternate Text": "Alternativ text",
125
125
  "Change Size": "\u00c4ndra storlek",
126
126
  "Width": "Bredd",
127
127
  "Height": "H\u00f6jd",
128
- "Something went wrong. Please try again.": "N\u00e5got gick snett. Var god f\u00f6rs\u00f6k igen.",
129
- "Image Caption": "Bildtextning",
128
+ "Something went wrong. Please try again.": "N\u00e5got gick fel. Var god f\u00f6rs\u00f6k igen.",
129
+ "Image Caption": "Bildtext",
130
130
  "Advanced Edit": "Avancerad redigering",
131
131
 
132
132
  // Video
@@ -146,28 +146,28 @@ $.FE.LANGUAGE['sv'] = {
146
146
  "Row": "Rad",
147
147
  "Insert row above": "Infoga rad f\u00f6re",
148
148
  "Insert row below": "Infoga rad efter",
149
- "Delete row": "Radera rad",
149
+ "Delete row": "Ta bort rad",
150
150
  "Column": "Kolumn",
151
151
  "Insert column before": "Infoga kollumn f\u00f6re",
152
152
  "Insert column after": "Infoga kolumn efter",
153
- "Delete column": "Radera kolumn",
153
+ "Delete column": "Ta bort kolumn",
154
154
  "Cell": "Cell",
155
155
  "Merge cells": "Sammanfoga celler",
156
- "Horizontal split": "Horisontell split",
157
- "Vertical split": "Vertikal split",
158
- "Cell Background": "Cellbakgrunden",
159
- "Vertical Align": "Vertikala justeringen",
160
- "Top": "Topp",
156
+ "Horizontal split": "Dela horisontellt",
157
+ "Vertical split": "Dela vertikalt",
158
+ "Cell Background": "Cellbakgrund",
159
+ "Vertical Align": "Vertikal justering",
160
+ "Top": "Överst",
161
161
  "Middle": "Mitten",
162
- "Bottom": "Botten",
163
- "Align Top": "Justera topp",
162
+ "Bottom": "Nederst",
163
+ "Align Top": "Justera överst",
164
164
  "Align Middle": "Justera mitten",
165
- "Align Bottom": "Justera botten",
165
+ "Align Bottom": "Justera nederst",
166
166
  "Cell Style": "Cellformat",
167
167
 
168
168
  // Files
169
169
  "Upload File": "Ladda upp fil",
170
- "Drop file": "Sl\u00e4ppa fil",
170
+ "Drop file": "Sl\u00e4pp fil",
171
171
 
172
172
  // Emoticons
173
173
  "Emoticons": "Uttryckssymboler",
@@ -229,11 +229,11 @@ $.FE.LANGUAGE['sv'] = {
229
229
  "Face with medical mask": "Ansikte med medicinsk maskera",
230
230
 
231
231
  // Line breaker
232
- "Break": "Break",
232
+ "Break": "Ny rad",
233
233
 
234
234
  // Math
235
235
  "Subscript": "Neds\u00e4nkt",
236
- "Superscript": "Upph\u00f6jd text",
236
+ "Superscript": "Upph\u00f6jd",
237
237
 
238
238
  // Full screen
239
239
  "Fullscreen": "Helsk\u00e4rm",
@@ -252,18 +252,18 @@ $.FE.LANGUAGE['sv'] = {
252
252
  "Select All": "Markera allt",
253
253
 
254
254
  // Code view
255
- "Code View": "Kodvyn",
255
+ "Code View": "Kodvy",
256
256
 
257
257
  // Quote
258
- "Quote": "Citerar",
258
+ "Quote": "Citat",
259
259
  "Increase": "\u00d6ka",
260
260
  "Decrease": "Minska",
261
261
 
262
262
  // Quick Insert
263
- "Quick Insert": "Snabb insats",
263
+ "Quick Insert": "Snabbinfoga",
264
264
 
265
265
  // Spcial Characters
266
- "Special Characters": "Speciella karaktärer",
266
+ "Special Characters": "Specialtecken",
267
267
  "Latin": "Latin",
268
268
  "Greek": "Grekisk",
269
269
  "Cyrillic": "Cyrillic",
@@ -271,7 +271,7 @@ $.FE.LANGUAGE['sv'] = {
271
271
  "Currency": "Valuta",
272
272
  "Arrows": "Pilar",
273
273
  "Math": "Matematik",
274
- "Misc": "Misc",
274
+ "Misc": "Övrigt",
275
275
 
276
276
  // Print.
277
277
  "Print": "Skriva ut",
@@ -280,37 +280,37 @@ $.FE.LANGUAGE['sv'] = {
280
280
  "Spell Checker": "Stavningskontroll",
281
281
 
282
282
  // Help
283
- "Help": "Hjälpa",
283
+ "Help": "Hjälp",
284
284
  "Shortcuts": "Genvägar",
285
285
  "Inline Editor": "Inline editor",
286
286
  "Show the editor": "Visa redigeraren",
287
- "Common actions": "Gemensamma åtgärder",
287
+ "Common actions": "Vanliga kommandon",
288
288
  "Copy": "Kopiera",
289
- "Cut": "Skära",
290
- "Paste": "Klistra",
289
+ "Cut": "Klipp ut",
290
+ "Paste": "Klistra in",
291
291
  "Basic Formatting": "Grundläggande formatering",
292
292
  "Increase quote level": "Öka citatnivå",
293
- "Decrease quote level": "Sänk citatnivå",
293
+ "Decrease quote level": "Minska citatnivå",
294
294
  "Image / Video": "Bild / video",
295
- "Resize larger": "Ändra storlek större",
296
- "Resize smaller": "Ändra storlek mindre",
295
+ "Resize larger": "Öka storlek",
296
+ "Resize smaller": "Minska storlek",
297
297
  "Table": "Tabell",
298
- "Select table cell": "Välj tabellcell",
299
- "Extend selection one cell": "Utvidga valet en cell",
300
- "Extend selection one row": "Förlänga valet en rad",
298
+ "Select table cell": "Markera tabellcell",
299
+ "Extend selection one cell": "Utöka markering en cell",
300
+ "Extend selection one row": "Utöka markering en rad",
301
301
  "Navigation": "Navigering",
302
- "Focus popup / toolbar": "Fokus popup / verktygsfältet",
303
- "Return focus to previous position": "Returnera fokus till tidigare position",
302
+ "Focus popup / toolbar": "Fokusera popup / verktygsfältet",
303
+ "Return focus to previous position": "Byt fokus till föregående plats",
304
304
 
305
305
  // Embed.ly
306
306
  "Embed URL": "Bädda in url",
307
307
  "Paste in a URL to embed": "Klistra in i en url för att bädda in",
308
308
 
309
309
  // Word Paste.
310
- "The pasted content is coming from a Microsoft Word document. Do you want to keep the format or clean it up?": "Det klistrade innehållet kommer från ett Microsoft Word-dokument. vill du hålla formatet eller städa upp det?",
311
- "Keep": "Ha kvar",
312
- "Clean": "Rena",
313
- "Word Paste Detected": "Ordpasta upptäcks"
310
+ "The pasted content is coming from a Microsoft Word document. Do you want to keep the format or clean it up?": "Den inklippta texten kommer från ett Microsoft Word-dokument. Vill du behålla formateringen eller städa upp det?",
311
+ "Keep": "Behåll",
312
+ "Clean": "Städa upp",
313
+ "Word Paste Detected": "Urklipp från Word upptäckt"
314
314
  },
315
315
  direction: "ltr"
316
316
  };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
@@ -133,7 +133,7 @@ $.FE.LANGUAGE['uk'] = {
133
133
  "Insert Video": "\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438 \u0432\u0456\u0434\u0435\u043e",
134
134
  "Embedded Code": "\u0432\u0431\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0439 \u043a\u043e\u0434",
135
135
  "Paste in a video URL": "Вставте в відео-URL",
136
- "Drop video": "Падіння відео",
136
+ "Drop video": "Перетягніть відео",
137
137
  "Your browser does not support HTML5 video.": "Ваш браузер не підтримує відео html5.",
138
138
  "Upload Video": "Завантажити відео",
139
139
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
6
6
 
7
- !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c)}:a(window.jQuery)}(function(a){a.FE.PLUGINS.align=function(b){function c(c){b.selection.save(),b.html.wrap(!0,!0,!0,!0),b.selection.restore();for(var d=b.selection.blocks(),e=0;e<d.length;e++)b.helpers.getAlignment(a(d[e].parentNode))==c?a(d[e]).css("text-align","").removeClass("fr-temp-div"):a(d[e]).css("text-align",c).removeClass("fr-temp-div"),""===a(d[e]).attr("class")&&a(d[e]).removeAttr("class"),""===a(d[e]).attr("style")&&a(d[e]).removeAttr("style");b.selection.save(),b.html.unwrap(),b.selection.restore()}function d(c){var d=b.selection.blocks();if(d.length){var e=b.helpers.getAlignment(a(d[0]));c.find("> *:first").replaceWith(b.icon.create("align-"+e))}}function e(c,d){var e=b.selection.blocks();if(e.length){var f=b.helpers.getAlignment(a(e[0]));d.find('a.fr-command[data-param1="'+f+'"]').addClass("fr-active").attr("aria-selected",!0)}}return{apply:c,refresh:d,refreshOnShow:e}},a.FE.DefineIcon("align",{NAME:"align-left"}),a.FE.DefineIcon("align-left",{NAME:"align-left"}),a.FE.DefineIcon("align-right",{NAME:"align-right"}),a.FE.DefineIcon("align-center",{NAME:"align-center"}),a.FE.DefineIcon("align-justify",{NAME:"align-justify"}),a.FE.RegisterCommand("align",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"Align Center",right:"Align Right",justify:"Align Justify"},html:function(){var b='<ul class="fr-dropdown-list" role="presentation">',c=a.FE.COMMANDS.align.options;for(var d in c)c.hasOwnProperty(d)&&(b+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="align" data-param1="'+d+'" title="'+this.language.translate(c[d])+'">'+this.icon.create("align-"+d)+'<span class="fr-sr-only">'+this.language.translate(c[d])+"</span></a></li>");return b+="</ul>"},callback:function(a,b){this.align.apply(b)},refresh:function(a){this.align.refresh(a)},refreshOnShow:function(a,b){this.align.refreshOnShow(a,b)},plugin:"align"})});
7
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c)}:a(window.jQuery)}(function(a){a.FE.PLUGINS.align=function(b){function c(c){var d=b.selection.element();if(a(d).parents(".fr-img-caption").length)a(d).css("text-align",c);else{b.selection.save(),b.html.wrap(!0,!0,!0,!0),b.selection.restore();for(var e=b.selection.blocks(),f=0;f<e.length;f++)b.helpers.getAlignment(a(e[f].parentNode))==c?a(e[f]).css("text-align","").removeClass("fr-temp-div"):a(e[f]).css("text-align",c).removeClass("fr-temp-div"),""===a(e[f]).attr("class")&&a(e[f]).removeAttr("class"),""===a(e[f]).attr("style")&&a(e[f]).removeAttr("style");b.selection.save(),b.html.unwrap(),b.selection.restore()}}function d(c){var d=b.selection.blocks();if(d.length){var e=b.helpers.getAlignment(a(d[0]));c.find("> *:first").replaceWith(b.icon.create("align-"+e))}}function e(c,d){var e=b.selection.blocks();if(e.length){var f=b.helpers.getAlignment(a(e[0]));d.find('a.fr-command[data-param1="'+f+'"]').addClass("fr-active").attr("aria-selected",!0)}}return{apply:c,refresh:d,refreshOnShow:e}},a.FE.DefineIcon("align",{NAME:"align-left"}),a.FE.DefineIcon("align-left",{NAME:"align-left"}),a.FE.DefineIcon("align-right",{NAME:"align-right"}),a.FE.DefineIcon("align-center",{NAME:"align-center"}),a.FE.DefineIcon("align-justify",{NAME:"align-justify"}),a.FE.RegisterCommand("align",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"Align Center",right:"Align Right",justify:"Align Justify"},html:function(){var b='<ul class="fr-dropdown-list" role="presentation">',c=a.FE.COMMANDS.align.options;for(var d in c)c.hasOwnProperty(d)&&(b+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="align" data-param1="'+d+'" title="'+this.language.translate(c[d])+'">'+this.icon.create("align-"+d)+'<span class="fr-sr-only">'+this.language.translate(c[d])+"</span></a></li>");return b+="</ul>"},callback:function(a,b){this.align.apply(b)},refresh:function(a){this.align.refresh(a)},refreshOnShow:function(a,b){this.align.refreshOnShow(a,b)},plugin:"align"})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
6
6
 
7
- !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c)}:a(window.jQuery)}(function(a){a.extend(a.FE.DEFAULTS,{codeMirror:window.CodeMirror,codeMirrorOptions:{lineNumbers:!0,tabMode:"indent",indentWithTabs:!0,lineWrapping:!0,mode:"text/html",tabSize:2},codeBeautifierOptions:{end_with_newline:!0,indent_inner_html:!0,extra_liners:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","ol","table","dl"],brace_style:"expand",indent_char:" ",indent_size:1,wrap_line_length:0},codeViewKeepActiveButtons:["fullscreen"]}),a.FE.PLUGINS.codeView=function(b){function c(){return b.$box.hasClass("fr-code-view")}function d(){return l?l.getValue():k.val()}function e(a){var c=d();b.html.set(c),b.$el.blur(),b.$tb.find(" > .fr-command").not(a).removeClass("fr-disabled").attr("aria-disabled",!1),a.removeClass("fr-active").attr("aria-pressed",!1),b.selection.setAtStart(b.el),b.selection.restore(),b.placeholder.refresh(),b.undo.saveStep()}function f(c){k||(i(),!l&&b.opts.codeMirror?l=b.opts.codeMirror.fromTextArea(k.get(0),b.opts.codeMirrorOptions):b.events.$on(k,"keydown keyup change input",function(){b.opts.height?this.removeAttribute("rows"):(this.rows=1,0===this.value.length?this.style.height="auto":this.style.height=this.scrollHeight+"px")})),b.undo.saveStep(),b.html.cleanEmptyTags(),b.html.cleanWhiteTags(!0),b.core.hasFocus()&&(b.core.isEmpty()||(b.selection.save(),b.$el.find('.fr-marker[data-type="true"]:first').replaceWith('<span class="fr-tmp fr-sm">F</span>'),b.$el.find('.fr-marker[data-type="false"]:last').replaceWith('<span class="fr-tmp fr-em">F</span>')));var d=b.html.get(!1,!0);b.$el.find("span.fr-tmp").remove(),b.$box.toggleClass("fr-code-view",!0),b.core.hasFocus()&&b.$el.blur(),d=d.replace(/<span class="fr-tmp fr-sm">F<\/span>/,"FROALA-SM"),d=d.replace(/<span class="fr-tmp fr-em">F<\/span>/,"FROALA-EM"),b.codeBeautifier&&(d=b.codeBeautifier.run(d,b.opts.codeBeautifierOptions));var e,f;if(l){e=d.indexOf("FROALA-SM"),f=d.indexOf("FROALA-EM"),e>f?e=f:f-=9,d=d.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"");var g=d.substring(0,e).length-d.substring(0,e).replace(/\n/g,"").length,h=d.substring(0,f).length-d.substring(0,f).replace(/\n/g,"").length;e=d.substring(0,e).length-d.substring(0,d.substring(0,e).lastIndexOf("\n")+1).length,f=d.substring(0,f).length-d.substring(0,d.substring(0,f).lastIndexOf("\n")+1).length,l.setSize(null,b.opts.height?b.opts.height:"auto"),b.opts.heightMin&&b.$box.find(".CodeMirror-scroll").css("min-height",b.opts.heightMin),l.setValue(d),l.focus(),l.setSelection({line:g,ch:e},{line:h,ch:f}),l.refresh(),l.clearHistory()}else{e=d.indexOf("FROALA-SM"),f=d.indexOf("FROALA-EM")-9,b.opts.heightMin&&k.css("min-height",b.opts.heightMin),b.opts.height&&k.css("height",b.opts.height),b.opts.heightMax&&k.css("max-height",b.opts.height||b.opts.heightMax),k.val(d.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"")).trigger("change");var j=a(b.o_doc).scrollTop();k.focus(),k.get(0).setSelectionRange(e,f),a(b.o_doc).scrollTop(j)}b.$tb.find(" > .fr-command").not(c).filter(function(){return b.opts.codeViewKeepActiveButtons.indexOf(a(this).data("cmd"))<0}).addClass("fr-disabled").attr("aria-disabled",!0),c.addClass("fr-active").attr("aria-pressed",!0),!b.helpers.isMobile()&&b.opts.toolbarInline&&b.toolbar.hide()}function g(a){"undefined"==typeof a&&(a=!c());var d=b.$tb.find('.fr-command[data-cmd="html"]');a?(b.popups.hideAll(),f(d)):(b.$box.toggleClass("fr-code-view",!1),e(d))}function h(){c()&&g(!1),l&&l.toTextArea(),k.val("").removeData().remove(),k=null,m&&(m.remove(),m=null)}function i(){k=a('<textarea class="fr-code" tabIndex="-1">'),b.$wp.append(k),k.attr("dir",b.opts.direction),b.$box.hasClass("fr-basic")||(m=a('<a data-cmd="html" title="Code View" class="fr-command fr-btn html-switch'+(b.helpers.isMobile()?"":" fr-desktop")+'" role="button" tabIndex="-1"><i class="fa fa-code"></i></button>'),b.$box.append(m),b.events.bindClick(b.$box,"a.html-switch",function(){g(!1)}));var e=function(){return!c()};b.events.on("buttons.refresh",e),b.events.on("copy",e,!0),b.events.on("cut",e,!0),b.events.on("paste",e,!0),b.events.on("destroy",h,!0),b.events.on("html.set",function(){c()&&g(!0)}),b.events.on("form.submit",function(){c()&&(b.html.set(d()),b.events.trigger("contentChanged",[],!0))},!0)}function j(){return b.$wp?void 0:!1}var k,l,m;return{_init:j,toggle:g,isActive:c,get:d}},a.FE.RegisterCommand("html",{title:"Code View",undo:!1,focus:!1,forcedRefresh:!0,toggle:!0,callback:function(){this.codeView.toggle()},plugin:"codeView"}),a.FE.DefineIcon("html",{NAME:"code"})});
7
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c)}:a(window.jQuery)}(function(a){a.extend(a.FE.DEFAULTS,{codeMirror:window.CodeMirror,codeMirrorOptions:{lineNumbers:!0,tabMode:"indent",indentWithTabs:!0,lineWrapping:!0,mode:"text/html",tabSize:2},codeBeautifierOptions:{end_with_newline:!0,indent_inner_html:!0,extra_liners:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","ol","table","dl"],brace_style:"expand",indent_char:" ",indent_size:1,wrap_line_length:0},codeViewKeepActiveButtons:["fullscreen"]}),a.FE.PLUGINS.codeView=function(b){function c(){return b.$box.hasClass("fr-code-view")}function d(){return m?m.getValue():l.val()}function e(){c()&&(m.setSize(null,b.opts.height?b.opts.height:"auto"),b.opts.heightMin||b.opts.height?b.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",b.opts.heightMin||b.opts.height):b.$box.find(".CodeMirror-scroll, .CodeMirror-gutters").css("min-height",""))}function f(a){var c=d();b.html.set(c),b.$el.blur(),b.$tb.find(" > .fr-command").not(a).removeClass("fr-disabled").attr("aria-disabled",!1),a.removeClass("fr-active").attr("aria-pressed",!1),b.selection.setAtStart(b.el),b.selection.restore(),b.placeholder.refresh(),b.undo.saveStep()}function g(c){l||(j(),!m&&b.opts.codeMirror?m=b.opts.codeMirror.fromTextArea(l.get(0),b.opts.codeMirrorOptions):b.events.$on(l,"keydown keyup change input",function(){b.opts.height?this.removeAttribute("rows"):(this.rows=1,0===this.value.length?this.style.height="auto":this.style.height=this.scrollHeight+"px")})),b.undo.saveStep(),b.html.cleanEmptyTags(),b.html.cleanWhiteTags(!0),b.core.hasFocus()&&(b.core.isEmpty()||(b.selection.save(),b.$el.find('.fr-marker[data-type="true"]:first').replaceWith('<span class="fr-tmp fr-sm">F</span>'),b.$el.find('.fr-marker[data-type="false"]:last').replaceWith('<span class="fr-tmp fr-em">F</span>')));var d=b.html.get(!1,!0);b.$el.find("span.fr-tmp").remove(),b.$box.toggleClass("fr-code-view",!0),b.core.hasFocus()&&b.$el.blur(),d=d.replace(/<span class="fr-tmp fr-sm">F<\/span>/,"FROALA-SM"),d=d.replace(/<span class="fr-tmp fr-em">F<\/span>/,"FROALA-EM"),b.codeBeautifier&&(d=b.codeBeautifier.run(d,b.opts.codeBeautifierOptions));var e,f;if(m){e=d.indexOf("FROALA-SM"),f=d.indexOf("FROALA-EM"),e>f?e=f:f-=9,d=d.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"");var g=d.substring(0,e).length-d.substring(0,e).replace(/\n/g,"").length,h=d.substring(0,f).length-d.substring(0,f).replace(/\n/g,"").length;e=d.substring(0,e).length-d.substring(0,d.substring(0,e).lastIndexOf("\n")+1).length,f=d.substring(0,f).length-d.substring(0,d.substring(0,f).lastIndexOf("\n")+1).length,m.setSize(null,b.opts.height?b.opts.height:"auto"),b.opts.heightMin&&b.$box.find(".CodeMirror-scroll").css("min-height",b.opts.heightMin),m.setValue(d),m.focus(),m.setSelection({line:g,ch:e},{line:h,ch:f}),m.refresh(),m.clearHistory()}else{e=d.indexOf("FROALA-SM"),f=d.indexOf("FROALA-EM")-9,b.opts.heightMin&&l.css("min-height",b.opts.heightMin),b.opts.height&&l.css("height",b.opts.height),b.opts.heightMax&&l.css("max-height",b.opts.height||b.opts.heightMax),l.val(d.replace(/FROALA-SM/g,"").replace(/FROALA-EM/g,"")).trigger("change");var i=a(b.o_doc).scrollTop();l.focus(),l.get(0).setSelectionRange(e,f),a(b.o_doc).scrollTop(i)}b.$tb.find(" > .fr-command").not(c).filter(function(){return b.opts.codeViewKeepActiveButtons.indexOf(a(this).data("cmd"))<0}).addClass("fr-disabled").attr("aria-disabled",!0),c.addClass("fr-active").attr("aria-pressed",!0),!b.helpers.isMobile()&&b.opts.toolbarInline&&b.toolbar.hide()}function h(a){"undefined"==typeof a&&(a=!c());var d=b.$tb.find('.fr-command[data-cmd="html"]');a?(b.popups.hideAll(),g(d)):(b.$box.toggleClass("fr-code-view",!1),f(d))}function i(){c()&&h(!1),m&&m.toTextArea(),l.val("").removeData().remove(),l=null,n&&(n.remove(),n=null)}function j(){l=a('<textarea class="fr-code" tabIndex="-1">'),b.$wp.append(l),l.attr("dir",b.opts.direction),b.$box.hasClass("fr-basic")||(n=a('<a data-cmd="html" title="Code View" class="fr-command fr-btn html-switch'+(b.helpers.isMobile()?"":" fr-desktop")+'" role="button" tabIndex="-1"><i class="fa fa-code"></i></button>'),b.$box.append(n),b.events.bindClick(b.$box,"a.html-switch",function(){h(!1)}));var f=function(){return!c()};b.events.on("buttons.refresh",f),b.events.on("copy",f,!0),b.events.on("cut",f,!0),b.events.on("paste",f,!0),b.events.on("destroy",i,!0),b.events.on("html.set",function(){c()&&h(!0)}),b.events.on("codeView.update",e),b.events.on("form.submit",function(){c()&&(b.html.set(d()),b.events.trigger("contentChanged",[],!0))},!0)}function k(){return b.$wp?void 0:!1}var l,m,n;return{_init:k,toggle:h,isActive:c,get:d}},a.FE.RegisterCommand("html",{title:"Code View",undo:!1,focus:!1,forcedRefresh:!0,toggle:!0,callback:function(){this.codeView.toggle()},plugin:"codeView"}),a.FE.DefineIcon("html",{NAME:"code"})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
6
6
 
7
- !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c)}:a(window.jQuery)}(function(a){a.extend(a.FE.DEFAULTS,{dragInline:!0}),a.FE.PLUGINS.draggable=function(b){function c(c){return c.originalEvent&&c.originalEvent.target&&c.originalEvent.target.nodeType==Node.TEXT_NODE?!0:(c.target&&"A"==c.target.tagName&&1==c.target.childNodes.length&&"IMG"==c.target.childNodes[0].tagName&&(c.target=c.target.childNodes[0]),a(c.target).hasClass("fr-draggable")?(b.undo.canDo()||b.undo.saveStep(),b.opts.dragInline?b.$el.attr("contenteditable",!0):b.$el.attr("contenteditable",!1),b.opts.toolbarInline&&b.toolbar.hide(),a(c.target).addClass("fr-dragging"),b.browser.msie||b.browser.edge||b.selection.clear(),void c.originalEvent.dataTransfer.setData("text","Froala")):(c.preventDefault(),!1))}function d(a){return!(a&&("HTML"==a.tagName||"BODY"==a.tagName||b.node.isElement(a)))}function e(a,c,d){b.opts.iframe&&(a+=b.$iframe.offset().top,c+=b.$iframe.offset().left),n.offset().top!=a&&n.css("top",a),n.offset().left!=c&&n.css("left",c),n.width()!=d&&n.css("width",d)}function f(c){var f=b.doc.elementFromPoint(c.originalEvent.pageX-b.win.pageXOffset,c.originalEvent.pageY-b.win.pageYOffset);if(!d(f)){for(var g=0,h=f;!d(h)&&h==f&&c.originalEvent.pageY-b.win.pageYOffset-g>0;)g++,h=b.doc.elementFromPoint(c.originalEvent.pageX-b.win.pageXOffset,c.originalEvent.pageY-b.win.pageYOffset-g);(!d(h)||n&&0===b.$el.find(h).length&&h!=n.get(0))&&(h=null);for(var i=0,j=f;!d(j)&&j==f&&c.originalEvent.pageY-b.win.pageYOffset+i<a(b.doc).height();)i++,j=b.doc.elementFromPoint(c.originalEvent.pageX-b.win.pageXOffset,c.originalEvent.pageY-b.win.pageYOffset+i);(!d(j)||n&&0===b.$el.find(j).length&&j!=n.get(0))&&(j=null),f=null==j&&h?h:j&&null==h?j:j&&h?i>g?h:j:null}if(a(f).hasClass("fr-drag-helper"))return!1;if(f&&!b.node.isBlock(f)&&(f=b.node.blockParent(f)),f&&["TD","TH","TR","THEAD","TBODY"].indexOf(f.tagName)>=0&&(f=a(f).parents("table").get(0)),f&&["LI"].indexOf(f.tagName)>=0&&(f=a(f).parents("UL, OL").get(0)),f&&!a(f).hasClass("fr-drag-helper")){n||(a.FE.$draggable_helper||(a.FE.$draggable_helper=a('<div class="fr-drag-helper"></div>')),n=a.FE.$draggable_helper,b.events.on("shared.destroy",function(){n.html("").removeData().remove(),n=null},!0));var k,l=c.originalEvent.pageY;k=l<a(f).offset().top+a(f).outerHeight()/2?!0:!1;var m=a(f),o=0;k||0!==m.next().length?(k||(m=m.next()),"before"==n.data("fr-position")&&m.is(n.data("fr-tag"))||(m.prev().length>0&&(o=parseFloat(m.prev().css("margin-bottom"))||0),o=Math.max(o,parseFloat(m.css("margin-top"))||0),e(m.offset().top-o/2-b.$box.offset().top,m.offset().left-b.win.pageXOffset-b.$box.offset().left,m.width()),n.data("fr-position","before"))):"after"==n.data("fr-position")&&m.is(n.data("fr-tag"))||(o=parseFloat(m.css("margin-bottom"))||0,e(m.offset().top+a(f).height()+o/2-b.$box.offset().top,m.offset().left-b.win.pageXOffset-b.$box.offset().left,m.width()),n.data("fr-position","after")),n.data("fr-tag",m),n.addClass("fr-visible"),n.appendTo(b.$box)}else n&&b.$box.find(n).length>0&&n.removeClass("fr-visible")}function g(a){a.originalEvent.dataTransfer.dropEffect="move",b.opts.dragInline?j()||!b.browser.msie&&!b.browser.edge||a.preventDefault():(a.preventDefault(),f(a))}function h(a){a.originalEvent.dataTransfer.dropEffect="move",b.opts.dragInline||a.preventDefault()}function i(a){b.$el.attr("contenteditable",!0);var c=b.$el.find(".fr-dragging");n&&n.hasClass("fr-visible")&&b.$box.find(n).length?k(a):c.length&&(a.preventDefault(),a.stopPropagation()),n&&b.$box.find(n).length&&n.removeClass("fr-visible"),c.removeClass("fr-dragging")}function j(){for(var b=null,c=0;c<a.FE.INSTANCES.length;c++)if(b=a.FE.INSTANCES[c].$el.find(".fr-dragging"),b.length)return b.get(0)}function k(c){for(var d,e,f=0;f<a.FE.INSTANCES.length;f++)if(d=a.FE.INSTANCES[f].$el.find(".fr-dragging"),d.length){e=a.FE.INSTANCES[f];break}if(d.length){if(c.preventDefault(),c.stopPropagation(),n&&n.hasClass("fr-visible")&&b.$box.find(n).length)n.data("fr-tag")[n.data("fr-position")]('<span class="fr-marker"></span>'),n.removeClass("fr-visible");else{var g=b.markers.insertAtPoint(c.originalEvent);if(g===!1)return!1}if(d.removeClass("fr-dragging"),d=b.events.chainTrigger("element.beforeDrop",d),d===!1)return!1;var h=d;if(d.parent().is("A")&&(h=d.parent()),b.core.isEmpty())b.events.focus();else{var i=b.$el.find(".fr-marker");i.replaceWith(a.FE.MARKERS),b.selection.restore()}if(e==b||b.undo.canDo()||b.undo.saveStep(),b.core.isEmpty())b.$el.html(h);else{var j=b.markers.insert();0===h.find(j).length?a(j).replaceWith(h):a(j).replaceWith(d),d.after(a.FE.MARKERS),b.selection.restore()}return b.popups.hideAll(),b.selection.save(),b.$el.find(b.html.emptyBlockTagsQuery()).not("TD, TH, LI, .fr-inner").remove(),b.html.wrap(),b.html.fillEmptyBlocks(),b.selection.restore(),b.undo.saveStep(),b.opts.iframe&&b.size.syncIframe(),e!=b&&(e.popups.hideAll(),e.$el.find(e.html.emptyBlockTagsQuery()).not("TD, TH, LI, .fr-inner").remove(),e.html.wrap(),e.html.fillEmptyBlocks(),e.undo.saveStep(),e.events.trigger("element.dropped"),e.opts.iframe&&e.size.syncIframe()),b.events.trigger("element.dropped",[h]),!1}n&&n.removeClass("fr-visible"),b.undo.canDo()||b.undo.saveStep(),setTimeout(function(){b.undo.saveStep()},0)}function l(a){if(a&&"DIV"==a.tagName&&b.node.hasClass(a,"fr-drag-helper"))a.parentNode.removeChild(a);else if(a&&a.nodeType==Node.ELEMENT_NODE)for(var c=a.querySelectorAll("div.fr-drag-helper"),d=0;d<c.length;d++)c[d].parentNode.removeChild(c[d])}function m(){b.opts.enter==a.FE.ENTER_BR&&(b.opts.dragInline=!0),b.events.on("dragstart",c,!0),b.events.on("dragover",g,!0),b.events.on("dragenter",h,!0),b.events.on("document.dragend",i,!0),b.events.on("document.drop",i,!0),b.events.on("drop",k,!0),b.events.on("html.processGet",l)}var n;return{_init:m}}});
7
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c)}:a(window.jQuery)}(function(a){a.extend(a.FE.DEFAULTS,{dragInline:!0}),a.FE.PLUGINS.draggable=function(b){function c(c){return c.originalEvent&&c.originalEvent.target&&c.originalEvent.target.nodeType==Node.TEXT_NODE?!0:(c.target&&"A"==c.target.tagName&&1==c.target.childNodes.length&&"IMG"==c.target.childNodes[0].tagName&&(c.target=c.target.childNodes[0]),a(c.target).hasClass("fr-draggable")?(b.undo.canDo()||b.undo.saveStep(),b.opts.dragInline?b.$el.attr("contenteditable",!0):b.$el.attr("contenteditable",!1),b.opts.toolbarInline&&b.toolbar.hide(),a(c.target).addClass("fr-dragging"),b.browser.msie||b.browser.edge||b.selection.clear(),void c.originalEvent.dataTransfer.setData("text","Froala")):(c.preventDefault(),!1))}function d(a){return!(a&&("HTML"==a.tagName||"BODY"==a.tagName||b.node.isElement(a)))}function e(a,c,d){b.opts.iframe&&(a+=b.$iframe.offset().top,c+=b.$iframe.offset().left),n.offset().top!=a&&n.css("top",a),n.offset().left!=c&&n.css("left",c),n.width()!=d&&n.css("width",d)}function f(c){var f=b.doc.elementFromPoint(c.originalEvent.pageX-b.win.pageXOffset,c.originalEvent.pageY-b.win.pageYOffset);if(!d(f)){for(var g=0,h=f;!d(h)&&h==f&&c.originalEvent.pageY-b.win.pageYOffset-g>0;)g++,h=b.doc.elementFromPoint(c.originalEvent.pageX-b.win.pageXOffset,c.originalEvent.pageY-b.win.pageYOffset-g);(!d(h)||n&&0===b.$el.find(h).length&&h!=n.get(0))&&(h=null);for(var i=0,j=f;!d(j)&&j==f&&c.originalEvent.pageY-b.win.pageYOffset+i<a(b.doc).height();)i++,j=b.doc.elementFromPoint(c.originalEvent.pageX-b.win.pageXOffset,c.originalEvent.pageY-b.win.pageYOffset+i);(!d(j)||n&&0===b.$el.find(j).length&&j!=n.get(0))&&(j=null),f=null==j&&h?h:j&&null==h?j:j&&h?i>g?h:j:null}if(a(f).hasClass("fr-drag-helper"))return!1;if(f&&!b.node.isBlock(f)&&(f=b.node.blockParent(f)),f&&["TD","TH","TR","THEAD","TBODY"].indexOf(f.tagName)>=0&&(f=a(f).parents("table").get(0)),f&&["LI"].indexOf(f.tagName)>=0&&(f=a(f).parents("UL, OL").get(0)),f&&!a(f).hasClass("fr-drag-helper")){n||(a.FE.$draggable_helper||(a.FE.$draggable_helper=a('<div class="fr-drag-helper"></div>')),n=a.FE.$draggable_helper,b.events.on("shared.destroy",function(){n.html("").removeData().remove(),n=null},!0));var k,l=c.originalEvent.pageY;k=l<a(f).offset().top+a(f).outerHeight()/2?!0:!1;var m=a(f),o=0;k||0!==m.next().length?(k||(m=m.next()),"before"==n.data("fr-position")&&m.is(n.data("fr-tag"))||(m.prev().length>0&&(o=parseFloat(m.prev().css("margin-bottom"))||0),o=Math.max(o,parseFloat(m.css("margin-top"))||0),e(m.offset().top-o/2-b.$box.offset().top,m.offset().left-b.win.pageXOffset-b.$box.offset().left,m.width()),n.data("fr-position","before"))):"after"==n.data("fr-position")&&m.is(n.data("fr-tag"))||(o=parseFloat(m.css("margin-bottom"))||0,e(m.offset().top+a(f).height()+o/2-b.$box.offset().top,m.offset().left-b.win.pageXOffset-b.$box.offset().left,m.width()),n.data("fr-position","after")),n.data("fr-tag",m),n.addClass("fr-visible"),n.appendTo(b.$box)}else n&&b.$box.find(n).length>0&&n.removeClass("fr-visible")}function g(a){a.originalEvent.dataTransfer.dropEffect="move",b.opts.dragInline?j()||!b.browser.msie&&!b.browser.edge||a.preventDefault():(a.preventDefault(),f(a))}function h(a){a.originalEvent.dataTransfer.dropEffect="move",b.opts.dragInline||a.preventDefault()}function i(a){b.$el.attr("contenteditable",!0);var c=b.$el.find(".fr-dragging");n&&n.hasClass("fr-visible")&&b.$box.find(n).length?k(a):c.length&&(a.preventDefault(),a.stopPropagation()),n&&b.$box.find(n).length&&n.removeClass("fr-visible"),c.removeClass("fr-dragging")}function j(){for(var b=null,c=0;c<a.FE.INSTANCES.length;c++)if(b=a.FE.INSTANCES[c].$el.find(".fr-dragging"),b.length)return b.get(0)}function k(c){for(var d,e,f=0;f<a.FE.INSTANCES.length;f++)if(d=a.FE.INSTANCES[f].$el.find(".fr-dragging"),d.length){e=a.FE.INSTANCES[f];break}if(d.length){if(c.preventDefault(),c.stopPropagation(),n&&n.hasClass("fr-visible")&&b.$box.find(n).length)n.data("fr-tag")[n.data("fr-position")]('<span class="fr-marker"></span>'),n.removeClass("fr-visible");else{var g=b.markers.insertAtPoint(c.originalEvent);if(g===!1)return!1}if(d.removeClass("fr-dragging"),d=b.events.chainTrigger("element.beforeDrop",d),d===!1)return!1;var h=d;if(d.parent().is("A")&&1==d.parent().get(0).childNodes.length&&(h=d.parent()),b.core.isEmpty())b.events.focus();else{var i=b.$el.find(".fr-marker");i.replaceWith(a.FE.MARKERS),b.selection.restore()}if(e==b||b.undo.canDo()||b.undo.saveStep(),b.core.isEmpty())b.$el.html(h);else{var j=b.markers.insert();0===h.find(j).length?a(j).replaceWith(h):0===d.find(j).length&&a(j).replaceWith(d),d.after(a.FE.MARKERS),b.selection.restore()}return b.popups.hideAll(),b.selection.save(),b.$el.find(b.html.emptyBlockTagsQuery()).not("TD, TH, LI, .fr-inner").remove(),b.html.wrap(),b.html.fillEmptyBlocks(),b.selection.restore(),b.undo.saveStep(),b.opts.iframe&&b.size.syncIframe(),e!=b&&(e.popups.hideAll(),e.$el.find(e.html.emptyBlockTagsQuery()).not("TD, TH, LI, .fr-inner").remove(),e.html.wrap(),e.html.fillEmptyBlocks(),e.undo.saveStep(),e.events.trigger("element.dropped"),e.opts.iframe&&e.size.syncIframe()),b.events.trigger("element.dropped",[h]),!1}n&&n.removeClass("fr-visible"),b.undo.canDo()||b.undo.saveStep(),setTimeout(function(){b.undo.saveStep()},0)}function l(a){if(a&&"DIV"==a.tagName&&b.node.hasClass(a,"fr-drag-helper"))a.parentNode.removeChild(a);else if(a&&a.nodeType==Node.ELEMENT_NODE)for(var c=a.querySelectorAll("div.fr-drag-helper"),d=0;d<c.length;d++)c[d].parentNode.removeChild(c[d])}function m(){b.opts.enter==a.FE.ENTER_BR&&(b.opts.dragInline=!0),b.events.on("dragstart",c,!0),b.events.on("dragover",g,!0),b.events.on("dragenter",h,!0),b.events.on("document.dragend",i,!0),b.events.on("document.drop",i,!0),b.events.on("drop",k,!0),b.events.on("html.processGet",l)}var n;return{_init:m}}});
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
6
6
 
7
- !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c)}:a(window.jQuery)}(function(a){a.extend(a.FE.POPUP_TEMPLATES,{emoticons:"[_BUTTONS_][_EMOTICONS_]"}),a.extend(a.FE.DEFAULTS,{emoticonsStep:8,emoticonsSet:[{code:"1f600",desc:"Grinning face"},{code:"1f601",desc:"Grinning face with smiling eyes"},{code:"1f602",desc:"Face with tears of joy"},{code:"1f603",desc:"Smiling face with open mouth"},{code:"1f604",desc:"Smiling face with open mouth and smiling eyes"},{code:"1f605",desc:"Smiling face with open mouth and cold sweat"},{code:"1f606",desc:"Smiling face with open mouth and tightly-closed eyes"},{code:"1f607",desc:"Smiling face with halo"},{code:"1f608",desc:"Smiling face with horns"},{code:"1f609",desc:"Winking face"},{code:"1f60a",desc:"Smiling face with smiling eyes"},{code:"1f60b",desc:"Face savoring delicious food"},{code:"1f60c",desc:"Relieved face"},{code:"1f60d",desc:"Smiling face with heart-shaped eyes"},{code:"1f60e",desc:"Smiling face with sunglasses"},{code:"1f60f",desc:"Smirking face"},{code:"1f610",desc:"Neutral face"},{code:"1f611",desc:"Expressionless face"},{code:"1f612",desc:"Unamused face"},{code:"1f613",desc:"Face with cold sweat"},{code:"1f614",desc:"Pensive face"},{code:"1f615",desc:"Confused face"},{code:"1f616",desc:"Confounded face"},{code:"1f617",desc:"Kissing face"},{code:"1f618",desc:"Face throwing a kiss"},{code:"1f619",desc:"Kissing face with smiling eyes"},{code:"1f61a",desc:"Kissing face with closed eyes"},{code:"1f61b",desc:"Face with stuck out tongue"},{code:"1f61c",desc:"Face with stuck out tongue and winking eye"},{code:"1f61d",desc:"Face with stuck out tongue and tightly-closed eyes"},{code:"1f61e",desc:"Disappointed face"},{code:"1f61f",desc:"Worried face"},{code:"1f620",desc:"Angry face"},{code:"1f621",desc:"Pouting face"},{code:"1f622",desc:"Crying face"},{code:"1f623",desc:"Persevering face"},{code:"1f624",desc:"Face with look of triumph"},{code:"1f625",desc:"Disappointed but relieved face"},{code:"1f626",desc:"Frowning face with open mouth"},{code:"1f627",desc:"Anguished face"},{code:"1f628",desc:"Fearful face"},{code:"1f629",desc:"Weary face"},{code:"1f62a",desc:"Sleepy face"},{code:"1f62b",desc:"Tired face"},{code:"1f62c",desc:"Grimacing face"},{code:"1f62d",desc:"Loudly crying face"},{code:"1f62e",desc:"Face with open mouth"},{code:"1f62f",desc:"Hushed face"},{code:"1f630",desc:"Face with open mouth and cold sweat"},{code:"1f631",desc:"Face screaming in fear"},{code:"1f632",desc:"Astonished face"},{code:"1f633",desc:"Flushed face"},{code:"1f634",desc:"Sleeping face"},{code:"1f635",desc:"Dizzy face"},{code:"1f636",desc:"Face without mouth"},{code:"1f637",desc:"Face with medical mask"}],emoticonsButtons:["emoticonsBack","|"],emoticonsUseImage:!0}),a.FE.PLUGINS.emoticons=function(b){function c(){var a=b.$tb.find('.fr-command[data-cmd="emoticons"]'),c=b.popups.get("emoticons");if(c||(c=e()),!c.hasClass("fr-active")){b.popups.refresh("emoticons"),b.popups.setContainer("emoticons",b.$tb);var d=a.offset().left+a.outerWidth()/2,f=a.offset().top+(b.opts.toolbarBottom?10:a.outerHeight()-10);b.popups.show("emoticons",d,f,a.outerHeight())}}function d(){b.popups.hide("emoticons")}function e(){var a="";b.opts.toolbarInline&&b.opts.emoticonsButtons.length>0&&(a='<div class="fr-buttons fr-emoticons-buttons">'+b.button.buildList(b.opts.emoticonsButtons)+"</div>");var c={buttons:a,emoticons:g()},d=b.popups.create("emoticons",c);return b.tooltip.bind(d,".fr-emoticon"),h(d),d}function f(){if(!b.selection.isCollapsed())return!1;var a=b.selection.element(),c=b.selection.endElement();if(a&&b.node.hasClass(a,"fr-emoticon"))return a;if(c&&b.node.hasClass(c,"fr-emoticon"))return c;var d=b.selection.ranges(0),e=d.startContainer;if(e.nodeType==Node.ELEMENT_NODE&&e.childNodes.length>0&&d.startOffset>0){var f=e.childNodes[d.startOffset-1];if(b.node.hasClass(f,"fr-emoticon"))return f}return!1}function g(){for(var a='<div style="text-align: center">',c=0;c<b.opts.emoticonsSet.length;c++)0!==c&&c%b.opts.emoticonsStep===0&&(a+="<br>"),a+='<span class="fr-command fr-emoticon" tabIndex="-1" data-cmd="insertEmoticon" title="'+b.language.translate(b.opts.emoticonsSet[c].desc)+'" role="button" data-param1="'+b.opts.emoticonsSet[c].code+'">'+(b.opts.emoticonsUseImage?'<img src="https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.1/assets/svg/'+b.opts.emoticonsSet[c].code+'.svg"/>':"&#x"+b.opts.emoticonsSet[c].code+";")+'<span class="fr-sr-only">'+b.language.translate(b.opts.emoticonsSet[c].desc)+"&nbsp;&nbsp;&nbsp;</span></span>";return b.opts.emoticonsUseImage&&(a+='<p style="font-size: 12px; text-align: center; padding: 0 5px;">Emoji free by <a class="fr-link" tabIndex="-1" href="http://emojione.com/" target="_blank" rel="nofollow" role="link" aria-label="Open Emoji One website.">Emoji One</a></p>'),a+="</div>"}function h(c){b.events.on("popup.tab",function(d){var e=a(d.currentTarget);if(!b.popups.isVisible("emoticons")||!e.is("span, a"))return!0;var f,g,h,i=d.which;if(a.FE.KEYCODE.TAB==i){if(e.is("span.fr-emoticon")&&d.shiftKey||e.is("a")&&!d.shiftKey){var j=c.find(".fr-buttons");f=!b.accessibility.focusToolbar(j,d.shiftKey?!0:!1)}if(f!==!1){var k=c.find("span.fr-emoticon:focus:first, span.fr-emoticon:visible:first, a");e.is("span.fr-emoticon")&&(k=k.not("span.fr-emoticon:not(:focus)")),g=k.index(e),g=d.shiftKey?((g-1)%k.length+k.length)%k.length:(g+1)%k.length,h=k.get(g),b.events.disableBlur(),h.focus(),f=!1}}else if(a.FE.KEYCODE.ARROW_UP==i||a.FE.KEYCODE.ARROW_DOWN==i||a.FE.KEYCODE.ARROW_LEFT==i||a.FE.KEYCODE.ARROW_RIGHT==i){if(e.is("span.fr-emoticon")){var l=e.parent().find("span.fr-emoticon");g=l.index(e);var m=b.opts.emoticonsStep,n=Math.floor(l.length/m),o=g%m,p=Math.floor(g/m),q=p*m+o,r=n*m;a.FE.KEYCODE.ARROW_UP==i?q=((q-m)%r+r)%r:a.FE.KEYCODE.ARROW_DOWN==i?q=(q+m)%r:a.FE.KEYCODE.ARROW_LEFT==i?q=((q-1)%r+r)%r:a.FE.KEYCODE.ARROW_RIGHT==i&&(q=(q+1)%r),h=a(l.get(q)),b.events.disableBlur(),h.focus(),f=!1}}else a.FE.KEYCODE.ENTER==i&&(e.is("a")?e[0].click():b.button.exec(e),f=!1);return f===!1&&(d.preventDefault(),d.stopPropagation()),f},!0)}function i(c,d){var e=f(),g=b.selection.ranges(0);e?(0===g.startOffset&&b.selection.element()===e?a(e).before(a.FE.MARKERS+a.FE.INVISIBLE_SPACE):g.startOffset>0&&b.selection.element()===e&&g.commonAncestorContainer.parentNode.classList.contains("fr-emoticon")&&a(e).after(a.FE.INVISIBLE_SPACE+a.FE.MARKERS),b.selection.restore(),b.html.insert('<span class="fr-emoticon fr-deletable'+(d?" fr-emoticon-img":"")+'"'+(d?' style="background: url('+d+');"':"")+">"+(d?"&nbsp;":c)+"</span>&nbsp;"+a.FE.MARKERS,!0)):b.html.insert('<span class="fr-emoticon fr-deletable'+(d?" fr-emoticon-img":"")+'"'+(d?' style="background: url('+d+');"':"")+">"+(d?"&nbsp;":c)+"</span>&nbsp;",!0)}function j(){b.popups.hide("emoticons"),b.toolbar.showInline()}function k(){var c=function(){for(var a=b.el.querySelectorAll(".fr-emoticon:not(.fr-deletable)"),c=0;c<a.length;c++)a[c].className+=" fr-deletable"};c(),b.events.on("html.set",c),b.events.on("keydown",function(c){if(b.keys.isCharacter(c.which)&&b.selection.inEditor()){var d=b.selection.ranges(0),e=f();b.node.hasClass(e,"fr-emoticon-img")&&e&&(0===d.startOffset&&b.selection.element()===e?a(e).before(a.FE.MARKERS+a.FE.INVISIBLE_SPACE):a(e).after(a.FE.INVISIBLE_SPACE+a.FE.MARKERS),b.selection.restore())}}),b.events.on("keyup",function(c){for(var d=b.el.querySelectorAll(".fr-emoticon"),e=0;e<d.length;e++)"undefined"!=typeof d[e].textContent&&0===d[e].textContent.replace(/\u200B/gi,"").length&&a(d[e]).remove();if(!(c.which>=a.FE.KEYCODE.ARROW_LEFT&&c.which<=a.FE.KEYCODE.ARROW_DOWN)){var g=f();b.node.hasClass(g,"fr-emoticon-img")&&(a(g).append(a.FE.MARKERS),b.selection.restore())}})}return{_init:k,insert:i,showEmoticonsPopup:c,hideEmoticonsPopup:d,back:j}},a.FE.DefineIcon("emoticons",{NAME:"smile-o"}),a.FE.RegisterCommand("emoticons",{title:"Emoticons",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("emoticons")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("emoticons")):this.emoticons.showEmoticonsPopup()},plugin:"emoticons"}),a.FE.RegisterCommand("insertEmoticon",{callback:function(a,b){this.emoticons.insert("&#x"+b+";",this.opts.emoticonsUseImage?"https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.1/assets/svg/"+b+".svg":null),this.emoticons.hideEmoticonsPopup()}}),a.FE.DefineIcon("emoticonsBack",{NAME:"arrow-left"}),a.FE.RegisterCommand("emoticonsBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.emoticons.back()}})});
7
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c)}:a(window.jQuery)}(function(a){a.extend(a.FE.POPUP_TEMPLATES,{emoticons:"[_BUTTONS_][_EMOTICONS_]"}),a.extend(a.FE.DEFAULTS,{emoticonsStep:8,emoticonsSet:[{code:"1f600",desc:"Grinning face"},{code:"1f601",desc:"Grinning face with smiling eyes"},{code:"1f602",desc:"Face with tears of joy"},{code:"1f603",desc:"Smiling face with open mouth"},{code:"1f604",desc:"Smiling face with open mouth and smiling eyes"},{code:"1f605",desc:"Smiling face with open mouth and cold sweat"},{code:"1f606",desc:"Smiling face with open mouth and tightly-closed eyes"},{code:"1f607",desc:"Smiling face with halo"},{code:"1f608",desc:"Smiling face with horns"},{code:"1f609",desc:"Winking face"},{code:"1f60a",desc:"Smiling face with smiling eyes"},{code:"1f60b",desc:"Face savoring delicious food"},{code:"1f60c",desc:"Relieved face"},{code:"1f60d",desc:"Smiling face with heart-shaped eyes"},{code:"1f60e",desc:"Smiling face with sunglasses"},{code:"1f60f",desc:"Smirking face"},{code:"1f610",desc:"Neutral face"},{code:"1f611",desc:"Expressionless face"},{code:"1f612",desc:"Unamused face"},{code:"1f613",desc:"Face with cold sweat"},{code:"1f614",desc:"Pensive face"},{code:"1f615",desc:"Confused face"},{code:"1f616",desc:"Confounded face"},{code:"1f617",desc:"Kissing face"},{code:"1f618",desc:"Face throwing a kiss"},{code:"1f619",desc:"Kissing face with smiling eyes"},{code:"1f61a",desc:"Kissing face with closed eyes"},{code:"1f61b",desc:"Face with stuck out tongue"},{code:"1f61c",desc:"Face with stuck out tongue and winking eye"},{code:"1f61d",desc:"Face with stuck out tongue and tightly-closed eyes"},{code:"1f61e",desc:"Disappointed face"},{code:"1f61f",desc:"Worried face"},{code:"1f620",desc:"Angry face"},{code:"1f621",desc:"Pouting face"},{code:"1f622",desc:"Crying face"},{code:"1f623",desc:"Persevering face"},{code:"1f624",desc:"Face with look of triumph"},{code:"1f625",desc:"Disappointed but relieved face"},{code:"1f626",desc:"Frowning face with open mouth"},{code:"1f627",desc:"Anguished face"},{code:"1f628",desc:"Fearful face"},{code:"1f629",desc:"Weary face"},{code:"1f62a",desc:"Sleepy face"},{code:"1f62b",desc:"Tired face"},{code:"1f62c",desc:"Grimacing face"},{code:"1f62d",desc:"Loudly crying face"},{code:"1f62e",desc:"Face with open mouth"},{code:"1f62f",desc:"Hushed face"},{code:"1f630",desc:"Face with open mouth and cold sweat"},{code:"1f631",desc:"Face screaming in fear"},{code:"1f632",desc:"Astonished face"},{code:"1f633",desc:"Flushed face"},{code:"1f634",desc:"Sleeping face"},{code:"1f635",desc:"Dizzy face"},{code:"1f636",desc:"Face without mouth"},{code:"1f637",desc:"Face with medical mask"}],emoticonsButtons:["emoticonsBack","|"],emoticonsUseImage:!0}),a.FE.PLUGINS.emoticons=function(b){function c(){var a=b.$tb.find('.fr-command[data-cmd="emoticons"]'),c=b.popups.get("emoticons");if(c||(c=e()),!c.hasClass("fr-active")){b.popups.refresh("emoticons"),b.popups.setContainer("emoticons",b.$tb);var d=a.offset().left+a.outerWidth()/2,f=a.offset().top+(b.opts.toolbarBottom?10:a.outerHeight()-10);b.popups.show("emoticons",d,f,a.outerHeight())}}function d(){b.popups.hide("emoticons")}function e(){var a="";b.opts.toolbarInline&&b.opts.emoticonsButtons.length>0&&(a='<div class="fr-buttons fr-emoticons-buttons">'+b.button.buildList(b.opts.emoticonsButtons)+"</div>");var c={buttons:a,emoticons:g()},d=b.popups.create("emoticons",c);return b.tooltip.bind(d,".fr-emoticon"),h(d),d}function f(){if(!b.selection.isCollapsed())return!1;var a=b.selection.element(),c=b.selection.endElement();if(a&&b.node.hasClass(a,"fr-emoticon"))return a;if(c&&b.node.hasClass(c,"fr-emoticon"))return c;var d=b.selection.ranges(0),e=d.startContainer;if(e.nodeType==Node.ELEMENT_NODE&&e.childNodes.length>0&&d.startOffset>0){var f=e.childNodes[d.startOffset-1];if(b.node.hasClass(f,"fr-emoticon"))return f}return!1}function g(){for(var a='<div style="text-align: center">',c=0;c<b.opts.emoticonsSet.length;c++)0!==c&&c%b.opts.emoticonsStep===0&&(a+="<br>"),a+='<span class="fr-command fr-emoticon" tabIndex="-1" data-cmd="insertEmoticon" title="'+b.language.translate(b.opts.emoticonsSet[c].desc)+'" role="button" data-param1="'+b.opts.emoticonsSet[c].code+'">'+(b.opts.emoticonsUseImage?'<img src="https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.1/assets/svg/'+b.opts.emoticonsSet[c].code+'.svg"/>':"&#x"+b.opts.emoticonsSet[c].code+";")+'<span class="fr-sr-only">'+b.language.translate(b.opts.emoticonsSet[c].desc)+"&nbsp;&nbsp;&nbsp;</span></span>";return b.opts.emoticonsUseImage&&(a+='<p style="font-size: 12px; text-align: center; padding: 0 5px;">Emoji free by <a class="fr-link" tabIndex="-1" href="http://emojione.com/" target="_blank" rel="nofollow" role="link" aria-label="Open Emoji One website.">Emoji One</a></p>'),a+="</div>"}function h(c){b.events.on("popup.tab",function(d){var e=a(d.currentTarget);if(!b.popups.isVisible("emoticons")||!e.is("span, a"))return!0;var f,g,h,i=d.which;if(a.FE.KEYCODE.TAB==i){if(e.is("span.fr-emoticon")&&d.shiftKey||e.is("a")&&!d.shiftKey){var j=c.find(".fr-buttons");f=!b.accessibility.focusToolbar(j,d.shiftKey?!0:!1)}if(f!==!1){var k=c.find("span.fr-emoticon:focus:first, span.fr-emoticon:visible:first, a");e.is("span.fr-emoticon")&&(k=k.not("span.fr-emoticon:not(:focus)")),g=k.index(e),g=d.shiftKey?((g-1)%k.length+k.length)%k.length:(g+1)%k.length,h=k.get(g),b.events.disableBlur(),h.focus(),f=!1}}else if(a.FE.KEYCODE.ARROW_UP==i||a.FE.KEYCODE.ARROW_DOWN==i||a.FE.KEYCODE.ARROW_LEFT==i||a.FE.KEYCODE.ARROW_RIGHT==i){if(e.is("span.fr-emoticon")){var l=e.parent().find("span.fr-emoticon");g=l.index(e);var m=b.opts.emoticonsStep,n=Math.floor(l.length/m),o=g%m,p=Math.floor(g/m),q=p*m+o,r=n*m;a.FE.KEYCODE.ARROW_UP==i?q=((q-m)%r+r)%r:a.FE.KEYCODE.ARROW_DOWN==i?q=(q+m)%r:a.FE.KEYCODE.ARROW_LEFT==i?q=((q-1)%r+r)%r:a.FE.KEYCODE.ARROW_RIGHT==i&&(q=(q+1)%r),h=a(l.get(q)),b.events.disableBlur(),h.focus(),f=!1}}else a.FE.KEYCODE.ENTER==i&&(e.is("a")?e[0].click():b.button.exec(e),f=!1);return f===!1&&(d.preventDefault(),d.stopPropagation()),f},!0)}function i(c,d){var e=f(),g=b.selection.ranges(0);e?(0===g.startOffset&&b.selection.element()===e?a(e).before(a.FE.MARKERS+a.FE.INVISIBLE_SPACE):g.startOffset>0&&b.selection.element()===e&&g.commonAncestorContainer.parentNode.classList.contains("fr-emoticon")&&a(e).after(a.FE.INVISIBLE_SPACE+a.FE.MARKERS),b.selection.restore(),b.html.insert('<span class="fr-emoticon fr-deletable'+(d?" fr-emoticon-img":"")+'"'+(d?' style="background: url('+d+');"':"")+">"+(d?"&nbsp;":c)+"</span>&nbsp;"+a.FE.MARKERS,!0)):b.html.insert('<span class="fr-emoticon fr-deletable'+(d?" fr-emoticon-img":"")+'"'+(d?' style="background: url('+d+');"':"")+">"+(d?"&nbsp;":c)+"</span>&nbsp;",!0)}function j(){b.popups.hide("emoticons"),b.toolbar.showInline()}function k(){var c=function(){for(var a=b.el.querySelectorAll(".fr-emoticon:not(.fr-deletable)"),c=0;c<a.length;c++)a[c].className+=" fr-deletable"};c(),b.events.on("html.set",c),b.events.on("keydown",function(c){if(b.keys.isCharacter(c.which)&&b.selection.inEditor()){var d=b.selection.ranges(0),e=f();b.node.hasClass(e,"fr-emoticon-img")&&e&&(0===d.startOffset&&b.selection.element()===e?a(e).before(a.FE.MARKERS+a.FE.INVISIBLE_SPACE):a(e).after(a.FE.INVISIBLE_SPACE+a.FE.MARKERS),b.selection.restore())}}),b.events.on("keyup",function(c){for(var d=b.el.querySelectorAll(".fr-emoticon"),e=0;e<d.length;e++)"undefined"!=typeof d[e].textContent&&0===d[e].textContent.replace(/\u200B/gi,"").length&&a(d[e]).remove();if(!(c.which>=a.FE.KEYCODE.ARROW_LEFT&&c.which<=a.FE.KEYCODE.ARROW_DOWN)){var g=f();b.node.hasClass(g,"fr-emoticon-img")&&(a(g).append(a.FE.MARKERS),b.selection.restore())}})}return{_init:k,insert:i,showEmoticonsPopup:c,hideEmoticonsPopup:d,back:j}},a.FE.DefineIcon("emoticons",{NAME:"smile-o",FA5NAME:"smile"}),a.FE.RegisterCommand("emoticons",{title:"Emoticons",undo:!1,focus:!0,refreshOnCallback:!1,popup:!0,callback:function(){this.popups.isVisible("emoticons")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("emoticons")):this.emoticons.showEmoticonsPopup()},plugin:"emoticons"}),a.FE.RegisterCommand("insertEmoticon",{callback:function(a,b){this.emoticons.insert("&#x"+b+";",this.opts.emoticonsUseImage?"https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.1/assets/svg/"+b+".svg":null),this.emoticons.hideEmoticonsPopup()}}),a.FE.DefineIcon("emoticonsBack",{NAME:"arrow-left"}),a.FE.RegisterCommand("emoticonsBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.emoticons.back()}})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
6
6
 
7
- !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c)}:a(window.jQuery)}(function(a){a.extend(a.FE.POPUP_TEMPLATES,{"file.insert":"[_BUTTONS_][_UPLOAD_LAYER_][_PROGRESS_BAR_]"}),a.extend(a.FE.DEFAULTS,{fileUpload:!0,fileUploadURL:"https://i.froala.com/upload",fileUploadParam:"file",fileUploadParams:{},fileUploadToS3:!1,fileUploadMethod:"POST",fileMaxSize:10485760,fileAllowedTypes:["*"],fileInsertButtons:["fileBack","|"],fileUseSelectedText:!1}),a.FE.PLUGINS.file=function(b){function c(){var a=b.$tb.find('.fr-command[data-cmd="insertFile"]'),c=b.popups.get("file.insert");if(c||(c=s()),e(),!c.hasClass("fr-active"))if(b.popups.refresh("file.insert"),b.popups.setContainer("file.insert",b.$tb),a.is(":visible")){var d=a.offset().left+a.outerWidth()/2,f=a.offset().top+(b.opts.toolbarBottom?10:a.outerHeight()-10);b.popups.show("file.insert",d,f,a.outerHeight())}else b.position.forSelection(c),b.popups.show("file.insert")}function d(){var a=b.popups.get("file.insert");a||(a=s()),a.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),a.find(".fr-file-progress-bar-layer").addClass("fr-active"),a.find(".fr-buttons").hide(),f(b.language.translate("Uploading"),0)}function e(a){var c=b.popups.get("file.insert");c&&(c.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),c.find(".fr-file-progress-bar-layer").removeClass("fr-active"),c.find(".fr-buttons").show(),a&&(b.events.focus(),b.popups.hide("file.insert")))}function f(a,c){var d=b.popups.get("file.insert");if(d){var e=d.find(".fr-file-progress-bar-layer");e.find("h3").text(a+(c?" "+c+"%":"")),e.removeClass("fr-error"),c?(e.find("div").removeClass("fr-indeterminate"),e.find("div > span").css("width",c+"%")):e.find("div").addClass("fr-indeterminate")}}function g(a){d();var c=b.popups.get("file.insert"),e=c.find(".fr-file-progress-bar-layer");e.addClass("fr-error");var f=e.find("h3");f.text(a),b.events.disableBlur(),f.focus()}function h(a,c,d){b.edit.on(),b.events.focus(!0),b.selection.restore(),b.opts.fileUseSelectedText&&b.selection.text().length&&(c=b.selection.text()),b.html.insert('<a href="'+a+'" target="_blank" id="fr-inserted-file" class="fr-file">'+c+"</a>");var e=b.$el.find("#fr-inserted-file");e.removeAttr("id"),b.popups.hide("file.insert"),b.undo.saveStep(),x(),b.events.trigger("file.inserted",[e,d])}function i(a){try{if(b.events.trigger("file.uploaded",[a],!0)===!1)return b.edit.on(),!1;var c=JSON.parse(a);return c.link?c:(n(A,a),!1)}catch(d){return n(C,a),!1}}function j(c){try{var d=a(c).find("Location").text(),e=a(c).find("Key").text();return b.events.trigger("file.uploadedToS3",[d,e,c],!0)===!1?(b.edit.on(),!1):d}catch(f){return n(C,c),!1}}function k(a){var c=this.status,d=this.response,e=this.responseXML,f=this.responseText;try{if(b.opts.fileUploadToS3)if(201==c){var g=j(e);g&&h(g,a,d||e)}else n(C,d||e);else if(c>=200&&300>c){var k=i(f);k&&h(k.link,a,d||f)}else n(B,d||f)}catch(l){n(C,d||f)}}function l(){n(C,this.response||this.responseText||this.responseXML)}function m(a){if(a.lengthComputable){var c=a.loaded/a.total*100|0;f(b.language.translate("Uploading"),c)}}function n(a,c){b.edit.on(),g(b.language.translate("Something went wrong. Please try again.")),b.events.trigger("file.error",[{code:a,message:G[a]},c])}function o(){b.edit.on(),e(!0)}function p(a){if("undefined"!=typeof a&&a.length>0){if(b.events.trigger("file.beforeUpload",[a])===!1)return!1;var c=a[0];if(c.size>b.opts.fileMaxSize)return n(D),!1;if(b.opts.fileAllowedTypes.indexOf("*")<0&&b.opts.fileAllowedTypes.indexOf(c.type.replace(/file\//g,""))<0)return n(E),!1;var e;if(b.drag_support.formdata&&(e=b.drag_support.formdata?new FormData:null),e){var f;if(b.opts.fileUploadToS3!==!1){e.append("key",b.opts.fileUploadToS3.keyStart+(new Date).getTime()+"-"+(c.name||"untitled")),e.append("success_action_status","201"),e.append("X-Requested-With","xhr"),e.append("Content-Type",c.type);for(f in b.opts.fileUploadToS3.params)b.opts.fileUploadToS3.params.hasOwnProperty(f)&&e.append(f,b.opts.fileUploadToS3.params[f])}for(f in b.opts.fileUploadParams)b.opts.fileUploadParams.hasOwnProperty(f)&&e.append(f,b.opts.fileUploadParams[f]);e.append(b.opts.fileUploadParam,c);var g=b.opts.fileUploadURL;b.opts.fileUploadToS3&&(g=b.opts.fileUploadToS3.uploadURL?b.opts.fileUploadToS3.uploadURL:"https://"+b.opts.fileUploadToS3.region+".amazonaws.com/"+b.opts.fileUploadToS3.bucket);var h=b.core.getXHR(g,b.opts.fileUploadMethod);h.onload=function(){k.call(h,c.name)},h.onerror=l,h.upload.onprogress=m,h.onabort=o,d(),b.edit.off();var i=b.popups.get("file.insert");i&&i.off("abortUpload").on("abortUpload",function(){4!=h.readyState&&h.abort()}),h.send(e)}}}function q(c){b.events.$on(c,"dragover dragenter",".fr-file-upload-layer",function(){return a(this).addClass("fr-drop"),!1},!0),b.events.$on(c,"dragleave dragend",".fr-file-upload-layer",function(){return a(this).removeClass("fr-drop"),!1},!0),b.events.$on(c,"drop",".fr-file-upload-layer",function(d){d.preventDefault(),d.stopPropagation(),a(this).removeClass("fr-drop");var e=d.originalEvent.dataTransfer;if(e&&e.files){var f=c.data("instance")||b;f.file.upload(e.files)}},!0),b.helpers.isIOS()&&b.events.$on(c,"touchstart",'.fr-file-upload-layer input[type="file"]',function(){a(this).trigger("click")}),b.events.$on(c,"change",'.fr-file-upload-layer input[type="file"]',function(){if(this.files){var d=c.data("instance")||b;d.file.upload(this.files)}a(this).val("")},!0)}function r(){e()}function s(a){if(a)return b.popups.onHide("file.insert",r),!0;var c="";b.opts.fileUpload||b.opts.fileInsertButtons.splice(b.opts.fileInsertButtons.indexOf("fileUpload"),1),c='<div class="fr-buttons">'+b.button.buildList(b.opts.fileInsertButtons)+"</div>";var d="";b.opts.fileUpload&&(d='<div class="fr-file-upload-layer fr-layer fr-active" id="fr-file-upload-layer-'+b.id+'"><strong>'+b.language.translate("Drop file")+"</strong><br>("+b.language.translate("or click")+')<div class="fr-form"><input type="file" name="'+b.opts.fileUploadParam+'" accept="/*" tabIndex="-1" aria-labelledby="fr-file-upload-layer-'+b.id+'" role="button"></div></div>');var e='<div class="fr-file-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="fileDismissError" tabIndex="2" role="button">OK</button></div></div>',f={buttons:c,upload_layer:d,progress_bar:e},g=b.popups.create("file.insert",f);return q(g),g}function t(a){b.node.hasClass(a,"fr-file")}function u(c){var e=c.originalEvent.dataTransfer;if(e&&e.files&&e.files.length){var f=e.files[0];if(f&&"undefined"!=typeof f.type){if(f.type.indexOf("image")<0&&(b.opts.fileAllowedTypes.indexOf(f.type)>=0||b.opts.fileAllowedTypes.indexOf("*")>=0)){if(!b.opts.fileUpload)return c.preventDefault(),c.stopPropagation(),!1;b.markers.remove(),b.markers.insertAtPoint(c.originalEvent),b.$el.find(".fr-marker").replaceWith(a.FE.MARKERS),b.popups.hideAll();var g=b.popups.get("file.insert");return g||(g=s()),b.popups.setContainer("file.insert",b.$sc),b.popups.show("file.insert",c.originalEvent.pageX,c.originalEvent.pageY),d(),p(e.files),c.preventDefault(),c.stopPropagation(),!1}}else f.type.indexOf("image")<0&&(c.preventDefault(),c.stopPropagation())}}function v(){b.events.on("drop",u),b.events.$on(b.$win,"keydown",function(c){var d=c.which,e=b.popups.get("file.insert");e&&d==a.FE.KEYCODE.ESC&&e.trigger("abortUpload")}),b.events.on("destroy",function(){var a=b.popups.get("file.insert");a&&a.trigger("abortUpload")})}function w(){b.events.disableBlur(),b.selection.restore(),b.events.enableBlur(),b.popups.hide("file.insert"),b.toolbar.showInline()}function x(){var a,c=Array.prototype.slice.call(b.el.querySelectorAll("a.fr-file")),d=[];for(a=0;a<c.length;a++)d.push(c[a].getAttribute("href"));if(H)for(a=0;a<H.length;a++)d.indexOf(H[a].getAttribute("href"))<0&&b.events.trigger("file.unlink",[H[a]]);H=c}function y(){v(),b.events.on("link.beforeRemove",t),b.$wp&&(x(),b.events.on("contentChanged",x)),s(!0)}var z=1,A=2,B=3,C=4,D=5,E=6,F=7,G={};G[z]="File cannot be loaded from the passed link.",G[A]="No link in upload response.",G[B]="Error during file upload.",G[C]="Parsing response failed.",G[D]="File is too large.",G[E]="File file type is invalid.",G[F]="Files can be uploaded only to same domain in IE 8 and IE 9.";var H;return{_init:y,showInsertPopup:c,upload:p,insert:h,back:w,hideProgressBar:e}},a.FE.DefineIcon("insertFile",{NAME:"file-o"}),a.FE.RegisterCommand("insertFile",{title:"Upload File",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("file.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("file.insert")):this.file.showInsertPopup()},plugin:"file"}),a.FE.DefineIcon("fileBack",{NAME:"arrow-left"}),a.FE.RegisterCommand("fileBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.file.back()},refresh:function(a){this.opts.toolbarInline?(a.removeClass("fr-hidden"),a.next(".fr-separator").removeClass("fr-hidden")):(a.addClass("fr-hidden"),a.next(".fr-separator").addClass("fr-hidden"))}}),a.FE.RegisterCommand("fileDismissError",{title:"OK",callback:function(){this.file.hideProgressBar(!0)}})});
7
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c)}:a(window.jQuery)}(function(a){a.extend(a.FE.POPUP_TEMPLATES,{"file.insert":"[_BUTTONS_][_UPLOAD_LAYER_][_PROGRESS_BAR_]"}),a.extend(a.FE.DEFAULTS,{fileUpload:!0,fileUploadURL:"https://i.froala.com/upload",fileUploadParam:"file",fileUploadParams:{},fileUploadToS3:!1,fileUploadMethod:"POST",fileMaxSize:10485760,fileAllowedTypes:["*"],fileInsertButtons:["fileBack","|"],fileUseSelectedText:!1}),a.FE.PLUGINS.file=function(b){function c(){var a=b.$tb.find('.fr-command[data-cmd="insertFile"]'),c=b.popups.get("file.insert");if(c||(c=s()),e(),!c.hasClass("fr-active"))if(b.popups.refresh("file.insert"),b.popups.setContainer("file.insert",b.$tb),a.is(":visible")){var d=a.offset().left+a.outerWidth()/2,f=a.offset().top+(b.opts.toolbarBottom?10:a.outerHeight()-10);b.popups.show("file.insert",d,f,a.outerHeight())}else b.position.forSelection(c),b.popups.show("file.insert")}function d(){var a=b.popups.get("file.insert");a||(a=s()),a.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),a.find(".fr-file-progress-bar-layer").addClass("fr-active"),a.find(".fr-buttons").hide(),f(b.language.translate("Uploading"),0)}function e(a){var c=b.popups.get("file.insert");c&&(c.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),c.find(".fr-file-progress-bar-layer").removeClass("fr-active"),c.find(".fr-buttons").show(),a&&(b.events.focus(),b.popups.hide("file.insert")))}function f(a,c){var d=b.popups.get("file.insert");if(d){var e=d.find(".fr-file-progress-bar-layer");e.find("h3").text(a+(c?" "+c+"%":"")),e.removeClass("fr-error"),c?(e.find("div").removeClass("fr-indeterminate"),e.find("div > span").css("width",c+"%")):e.find("div").addClass("fr-indeterminate")}}function g(a){d();var c=b.popups.get("file.insert"),e=c.find(".fr-file-progress-bar-layer");e.addClass("fr-error");var f=e.find("h3");f.text(a),b.events.disableBlur(),f.focus()}function h(a,c,d){b.edit.on(),b.events.focus(!0),b.selection.restore(),b.opts.fileUseSelectedText&&b.selection.text().length&&(c=b.selection.text()),b.html.insert('<a href="'+a+'" target="_blank" id="fr-inserted-file" class="fr-file">'+c+"</a>");var e=b.$el.find("#fr-inserted-file");e.removeAttr("id"),b.popups.hide("file.insert"),b.undo.saveStep(),x(),b.events.trigger("file.inserted",[e,d])}function i(a){try{if(b.events.trigger("file.uploaded",[a],!0)===!1)return b.edit.on(),!1;var c=JSON.parse(a);return c.link?c:(n(A,a),!1)}catch(d){return n(C,a),!1}}function j(c){try{var d=a(c).find("Location").text(),e=a(c).find("Key").text();return b.events.trigger("file.uploadedToS3",[d,e,c],!0)===!1?(b.edit.on(),!1):d}catch(f){return n(C,c),!1}}function k(a){var c=this.status,d=this.response,e=this.responseXML,f=this.responseText;try{if(b.opts.fileUploadToS3)if(201==c){var g=j(e);g&&h(g,a,d||e)}else n(C,d||e);else if(c>=200&&300>c){var k=i(f);k&&h(k.link,a,d||f)}else n(B,d||f)}catch(l){n(C,d||f)}}function l(){n(C,this.response||this.responseText||this.responseXML)}function m(a){if(a.lengthComputable){var c=a.loaded/a.total*100|0;f(b.language.translate("Uploading"),c)}}function n(a,c){b.edit.on(),g(b.language.translate("Something went wrong. Please try again.")),b.events.trigger("file.error",[{code:a,message:G[a]},c])}function o(){b.edit.on(),e(!0)}function p(a){if("undefined"!=typeof a&&a.length>0){if(b.events.trigger("file.beforeUpload",[a])===!1)return!1;var c=a[0];if(c.size>b.opts.fileMaxSize)return n(D),!1;if(b.opts.fileAllowedTypes.indexOf("*")<0&&b.opts.fileAllowedTypes.indexOf(c.type.replace(/file\//g,""))<0)return n(E),!1;var e;if(b.drag_support.formdata&&(e=b.drag_support.formdata?new FormData:null),e){var f;if(b.opts.fileUploadToS3!==!1){e.append("key",b.opts.fileUploadToS3.keyStart+(new Date).getTime()+"-"+(c.name||"untitled")),e.append("success_action_status","201"),e.append("X-Requested-With","xhr"),e.append("Content-Type",c.type);for(f in b.opts.fileUploadToS3.params)b.opts.fileUploadToS3.params.hasOwnProperty(f)&&e.append(f,b.opts.fileUploadToS3.params[f])}for(f in b.opts.fileUploadParams)b.opts.fileUploadParams.hasOwnProperty(f)&&e.append(f,b.opts.fileUploadParams[f]);e.append(b.opts.fileUploadParam,c);var g=b.opts.fileUploadURL;b.opts.fileUploadToS3&&(g=b.opts.fileUploadToS3.uploadURL?b.opts.fileUploadToS3.uploadURL:"https://"+b.opts.fileUploadToS3.region+".amazonaws.com/"+b.opts.fileUploadToS3.bucket);var h=b.core.getXHR(g,b.opts.fileUploadMethod);h.onload=function(){k.call(h,c.name)},h.onerror=l,h.upload.onprogress=m,h.onabort=o,d();var i=b.popups.get("file.insert");i&&i.off("abortUpload").on("abortUpload",function(){4!=h.readyState&&h.abort()}),h.send(e)}}}function q(c){b.events.$on(c,"dragover dragenter",".fr-file-upload-layer",function(){return a(this).addClass("fr-drop"),!1},!0),b.events.$on(c,"dragleave dragend",".fr-file-upload-layer",function(){return a(this).removeClass("fr-drop"),!1},!0),b.events.$on(c,"drop",".fr-file-upload-layer",function(d){d.preventDefault(),d.stopPropagation(),a(this).removeClass("fr-drop");var e=d.originalEvent.dataTransfer;if(e&&e.files){var f=c.data("instance")||b;f.file.upload(e.files)}},!0),b.helpers.isIOS()&&b.events.$on(c,"touchstart",'.fr-file-upload-layer input[type="file"]',function(){a(this).trigger("click")}),b.events.$on(c,"change",'.fr-file-upload-layer input[type="file"]',function(){if(this.files){var d=c.data("instance")||b;d.file.upload(this.files)}a(this).val("")},!0)}function r(){e()}function s(a){if(a)return b.popups.onHide("file.insert",r),!0;var c="";b.opts.fileUpload||b.opts.fileInsertButtons.splice(b.opts.fileInsertButtons.indexOf("fileUpload"),1),c='<div class="fr-buttons">'+b.button.buildList(b.opts.fileInsertButtons)+"</div>";var d="";b.opts.fileUpload&&(d='<div class="fr-file-upload-layer fr-layer fr-active" id="fr-file-upload-layer-'+b.id+'"><strong>'+b.language.translate("Drop file")+"</strong><br>("+b.language.translate("or click")+')<div class="fr-form"><input type="file" name="'+b.opts.fileUploadParam+'" accept="/*" tabIndex="-1" aria-labelledby="fr-file-upload-layer-'+b.id+'" role="button"></div></div>');var e='<div class="fr-file-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="fileDismissError" tabIndex="2" role="button">OK</button></div></div>',f={buttons:c,upload_layer:d,progress_bar:e},g=b.popups.create("file.insert",f);return q(g),g}function t(a){b.node.hasClass(a,"fr-file")}function u(c){var e=c.originalEvent.dataTransfer;if(e&&e.files&&e.files.length){var f=e.files[0];if(f&&"undefined"!=typeof f.type){if(f.type.indexOf("image")<0){if(!b.opts.fileUpload)return c.preventDefault(),c.stopPropagation(),!1;b.markers.remove(),b.markers.insertAtPoint(c.originalEvent),b.$el.find(".fr-marker").replaceWith(a.FE.MARKERS),b.popups.hideAll();var g=b.popups.get("file.insert");return g||(g=s()),b.popups.setContainer("file.insert",b.$sc),b.popups.show("file.insert",c.originalEvent.pageX,c.originalEvent.pageY),d(),p(e.files),c.preventDefault(),c.stopPropagation(),!1}}else f.type.indexOf("image")<0&&(c.preventDefault(),c.stopPropagation())}}function v(){b.events.on("drop",u),b.events.$on(b.$win,"keydown",function(c){var d=c.which,e=b.popups.get("file.insert");e&&d==a.FE.KEYCODE.ESC&&e.trigger("abortUpload")}),b.events.on("destroy",function(){var a=b.popups.get("file.insert");a&&a.trigger("abortUpload")})}function w(){b.events.disableBlur(),b.selection.restore(),b.events.enableBlur(),b.popups.hide("file.insert"),b.toolbar.showInline()}function x(){var a,c=Array.prototype.slice.call(b.el.querySelectorAll("a.fr-file")),d=[];for(a=0;a<c.length;a++)d.push(c[a].getAttribute("href"));if(H)for(a=0;a<H.length;a++)d.indexOf(H[a].getAttribute("href"))<0&&b.events.trigger("file.unlink",[H[a]]);H=c}function y(){v(),b.events.on("link.beforeRemove",t),b.$wp&&(x(),b.events.on("contentChanged",x)),s(!0)}var z=1,A=2,B=3,C=4,D=5,E=6,F=7,G={};G[z]="File cannot be loaded from the passed link.",G[A]="No link in upload response.",G[B]="Error during file upload.",G[C]="Parsing response failed.",G[D]="File is too large.",G[E]="File file type is invalid.",G[F]="Files can be uploaded only to same domain in IE 8 and IE 9.";var H;return{_init:y,showInsertPopup:c,upload:p,insert:h,back:w,hideProgressBar:e}},a.FE.DefineIcon("insertFile",{NAME:"file-o",FA5NAME:"file"}),a.FE.RegisterCommand("insertFile",{title:"Upload File",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("file.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("file.insert")):this.file.showInsertPopup()},plugin:"file"}),a.FE.DefineIcon("fileBack",{NAME:"arrow-left"}),a.FE.RegisterCommand("fileBack",{title:"Back",undo:!1,focus:!1,back:!0,refreshAfterCallback:!1,callback:function(){this.file.back()},refresh:function(a){this.opts.toolbarInline?(a.removeClass("fr-hidden"),a.next(".fr-separator").removeClass("fr-hidden")):(a.addClass("fr-hidden"),a.next(".fr-separator").addClass("fr-hidden"))}}),a.FE.RegisterCommand("fileDismissError",{title:"OK",callback:function(){this.file.hideProgressBar(!0)}})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
6
6
 
7
- !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c)}:a(window.jQuery)}(function(a){a.FE.PLUGINS.fullscreen=function(b){function c(){return b.$box.hasClass("fr-fullscreen")}function d(){i=b.helpers.scrollTop(),b.$box.toggleClass("fr-fullscreen"),a("body:first").toggleClass("fr-fullscreen"),j=a('<div style="display: none;"></div>'),b.$box.after(j),b.helpers.isMobile()&&(b.$tb.data("parent",b.$tb.parent()),b.$tb.prependTo(b.$box),b.$tb.data("sticky-dummy")&&b.$tb.after(b.$tb.data("sticky-dummy"))),k=b.opts.height,l=b.opts.heightMax,m=b.opts.zIndex,b.position.refresh(),b.opts.height=b.o_win.innerHeight-(b.opts.toolbarInline?0:b.$tb.outerHeight()),b.opts.zIndex=2147483641,b.opts.heightMax=null,b.size.refresh(),b.opts.toolbarInline&&b.toolbar.showInline();for(var c=b.$box.parent();!c.is("body:first");)c.data("z-index",c.css("z-index")).data("overflow",c.css("overflow")).css("z-index","2147483640").css("overflow","visible"),c=c.parent();b.events.trigger("charCounter.update"),b.$win.trigger("scroll")}function e(){b.$box.toggleClass("fr-fullscreen"),a("body:first").toggleClass("fr-fullscreen"),b.$tb.prependTo(b.$tb.data("parent")),b.$tb.data("sticky-dummy")&&b.$tb.after(b.$tb.data("sticky-dummy")),b.opts.height=k,b.opts.heightMax=l,b.opts.zIndex=m,b.size.refresh(),a(b.o_win).scrollTop(i),b.opts.toolbarInline&&b.toolbar.showInline(),b.events.trigger("charCounter.update"),b.opts.toolbarSticky&&b.opts.toolbarStickyOffset&&(b.opts.toolbarBottom?b.$tb.css("bottom",b.opts.toolbarStickyOffset).data("bottom",b.opts.toolbarStickyOffset):b.$tb.css("top",b.opts.toolbarStickyOffset).data("top",b.opts.toolbarStickyOffset));for(var c=b.$box.parent();!c.is("body:first");)c.data("z-index")&&(c.css("z-index",""),c.css("z-index")!=c.data("z-index")&&c.css("z-index",c.data("z-index")),c.removeData("z-index")),c.data("overflow")?(c.css("overflow",""),c.css("overflow")!=c.data("overflow")&&c.css("overflow",c.data("overflow")),c.removeData("overflow")):(c.css("overflow",""),c.removeData("overflow")),c=c.parent();a(b.o_win).trigger("scroll")}function f(){c()?e():d(),g(b.$tb.find('.fr-command[data-cmd="fullscreen"]'))}function g(a){var d=c();a.toggleClass("fr-active",d).attr("aria-pressed",d),a.find("> *:not(.fr-sr-only)").replaceWith(d?b.icon.create("fullscreenCompress"):b.icon.create("fullscreen"))}function h(){return b.$wp?(b.events.$on(a(b.o_win),"resize",function(){c()&&(e(),d())}),b.events.on("toolbar.hide",function(){return c()&&b.helpers.isMobile()?!1:void 0}),void b.events.on("destroy",function(){c()&&e()},!0)):!1}var i,j,k,l,m;return{_init:h,toggle:f,refresh:g,isActive:c}},a.FE.RegisterCommand("fullscreen",{title:"Fullscreen",undo:!1,focus:!1,accessibilityFocus:!0,forcedRefresh:!0,toggle:!0,callback:function(){this.fullscreen.toggle()},refresh:function(a){this.fullscreen.refresh(a)},plugin:"fullscreen"}),a.FE.DefineIcon("fullscreen",{NAME:"expand"}),a.FE.DefineIcon("fullscreenCompress",{NAME:"compress"})});
7
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c)}:a(window.jQuery)}(function(a){a.FE.PLUGINS.fullscreen=function(b){function c(){return b.$box.hasClass("fr-fullscreen")}function d(){if(b.helpers.isIOS()&&b.core.hasFocus())return b.$el.blur(),setTimeout(f,250),!1;i=b.helpers.scrollTop(),b.$box.toggleClass("fr-fullscreen"),a("body:first").toggleClass("fr-fullscreen"),b.helpers.isMobile()&&(b.$tb.data("parent",b.$tb.parent()),b.$tb.prependTo(b.$box),b.$tb.data("sticky-dummy")&&b.$tb.after(b.$tb.data("sticky-dummy"))),j=b.opts.height,k=b.opts.heightMax,l=b.opts.zIndex,b.position.refresh(),b.opts.height=b.o_win.innerHeight-(b.opts.toolbarInline?0:b.$tb.outerHeight()),b.opts.zIndex=2147483641,b.opts.heightMax=null,b.size.refresh(),b.opts.toolbarInline&&b.toolbar.showInline();for(var c=b.$box.parent();!c.is("body:first");)c.data("z-index",c.css("z-index")).data("overflow",c.css("overflow")).css("z-index","2147483640").css("overflow","visible"),c=c.parent();b.opts.toolbarContainer&&b.$box.prepend(b.$tb),b.events.trigger("charCounter.update"),b.events.trigger("codeView.update"),b.$win.trigger("scroll")}function e(){if(b.helpers.isIOS()&&b.core.hasFocus())return b.$el.blur(),setTimeout(f,250),!1;b.$box.toggleClass("fr-fullscreen"),a("body:first").toggleClass("fr-fullscreen"),b.$tb.prependTo(b.$tb.data("parent")),b.$tb.data("sticky-dummy")&&b.$tb.after(b.$tb.data("sticky-dummy")),b.opts.height=j,b.opts.heightMax=k,b.opts.zIndex=l,b.size.refresh(),a(b.o_win).scrollTop(i),b.opts.toolbarInline&&b.toolbar.showInline(),b.events.trigger("charCounter.update"),b.opts.toolbarSticky&&b.opts.toolbarStickyOffset&&(b.opts.toolbarBottom?b.$tb.css("bottom",b.opts.toolbarStickyOffset).data("bottom",b.opts.toolbarStickyOffset):b.$tb.css("top",b.opts.toolbarStickyOffset).data("top",b.opts.toolbarStickyOffset));for(var c=b.$box.parent();!c.is("body:first");)c.data("z-index")&&(c.css("z-index",""),c.css("z-index")!=c.data("z-index")&&c.css("z-index",c.data("z-index")),c.removeData("z-index")),c.data("overflow")?(c.css("overflow",""),c.css("overflow")!=c.data("overflow")&&c.css("overflow",c.data("overflow")),c.removeData("overflow")):(c.css("overflow",""),c.removeData("overflow")),c=c.parent();b.opts.toolbarContainer&&a(b.opts.toolbarContainer).append(b.$tb),a(b.o_win).trigger("scroll"),b.events.trigger("codeView.update")}function f(){c()?e():d(),g(b.$tb.find('.fr-command[data-cmd="fullscreen"]'))}function g(a){var d=c();a.toggleClass("fr-active",d).attr("aria-pressed",d),a.find("> *:not(.fr-sr-only)").replaceWith(d?b.icon.create("fullscreenCompress"):b.icon.create("fullscreen"))}function h(){return b.$wp?(b.events.$on(a(b.o_win),"resize",function(){c()&&(e(),d())}),b.events.on("toolbar.hide",function(){return c()&&b.helpers.isMobile()?!1:void 0}),b.events.on("position.refresh",function(){return b.helpers.isIOS()?!c():void 0}),void b.events.on("destroy",function(){c()&&e()},!0)):!1}var i,j,k,l;return{_init:h,toggle:f,refresh:g,isActive:c}},a.FE.RegisterCommand("fullscreen",{title:"Fullscreen",undo:!1,focus:!1,accessibilityFocus:!0,forcedRefresh:!0,toggle:!0,callback:function(){this.fullscreen.toggle()},refresh:function(a){this.fullscreen.refresh(a)},plugin:"fullscreen"}),a.FE.DefineIcon("fullscreen",{NAME:"expand"}),a.FE.DefineIcon("fullscreenCompress",{NAME:"compress"})});
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
6
6
 
7
- !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c)}:a(window.jQuery)}(function(a){a.extend(a.FE.DEFAULTS,{helpSets:[{title:"Inline Editor",commands:[{val:"OSkeyE",desc:"Show the editor"}]},{title:"Common actions",commands:[{val:"OSkeyC",desc:"Copy"},{val:"OSkeyX",desc:"Cut"},{val:"OSkeyV",desc:"Paste"},{val:"OSkeyZ",desc:"Undo"},{val:"OSkeyShift+Z",desc:"Redo"},{val:"OSkeyK",desc:"Insert Link"},{val:"OSkeyP",desc:"Insert Image"}]},{title:"Basic Formatting",commands:[{val:"OSkeyA",desc:"Select All"},{val:"OSkeyB",desc:"Bold"},{val:"OSkeyI",desc:"Italic"},{val:"OSkeyU",desc:"Underline"},{val:"OSkeyS",desc:"Strikethrough"},{val:"OSkey]",desc:"Increase Indent"},{val:"OSkey[",desc:"Decrease Indent"}]},{title:"Quote",commands:[{val:"OSkey'",desc:"Increase quote level"},{val:"OSkeyShift+'",desc:"Decrease quote level"}]},{title:"Image / Video",commands:[{val:"OSkey+",desc:"Resize larger"},{val:"OSkey-",desc:"Resize smaller"}]},{title:"Table",commands:[{val:"Alt+Space",desc:"Select table cell"},{val:"Shift+Left/Right arrow",desc:"Extend selection one cell"},{val:"Shift+Up/Down arrow",desc:"Extend selection one row"}]},{title:"Navigation",commands:[{val:"OSkey/",desc:"Shortcuts"},{val:"Alt+F10",desc:"Focus popup / toolbar"},{val:"Esc",desc:"Return focus to previous position"}]}]}),a.FE.PLUGINS.help=function(b){function c(){}function d(){for(var c='<div class="fr-help-modal">',d=0;d<a.FE.DEFAULTS.helpSets.length;d++){var e=a.FE.DEFAULTS.helpSets[d],f="<table>";f+="<thead><tr><th>"+b.language.translate(e.title)+"</th></tr></thead>",f+="<tbody>";for(var g=0;g<e.commands.length;g++){var h=e.commands[g];f+="<tr>",f+="<td>"+b.language.translate(h.desc)+"</td>",f+="<td>"+h.val.replace("OSkey",b.helpers.isMac()?"&#8984;":"Ctrl+")+"</td>",f+="</tr>"}f+="</tbody></table>",c+=f}return c+="</div>"}function e(){if(!g){var c="<h4>"+b.language.translate("Shortcuts")+"</h4>",e=d(),f=b.modals.create(j,c,e);g=f.$modal,h=f.$head,i=f.$body,b.events.$on(a(b.o_win),"resize",function(){b.modals.resize(j)})}b.modals.show(j),b.modals.resize(j)}function f(){b.modals.hide(j)}var g,h,i,j="help";return{_init:c,show:e,hide:f}},a.FroalaEditor.DefineIcon("help",{NAME:"question"}),a.FE.RegisterShortcut(a.FE.KEYCODE.SLASH,"help",null,"/"),a.FE.RegisterCommand("help",{title:"Help",icon:"help",undo:!1,focus:!1,modal:!0,callback:function(){this.help.show()},plugin:"help",showOnMobile:!1})});
7
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c)}:a(window.jQuery)}(function(a){a.extend(a.FE.DEFAULTS,{helpSets:[{title:"Inline Editor",commands:[{val:"OSkeyE",desc:"Show the editor"}]},{title:"Common actions",commands:[{val:"OSkeyC",desc:"Copy"},{val:"OSkeyX",desc:"Cut"},{val:"OSkeyV",desc:"Paste"},{val:"OSkeyZ",desc:"Undo"},{val:"OSkeyShift+Z",desc:"Redo"},{val:"OSkeyK",desc:"Insert Link"},{val:"OSkeyP",desc:"Insert Image"}]},{title:"Basic Formatting",commands:[{val:"OSkeyA",desc:"Select All"},{val:"OSkeyB",desc:"Bold"},{val:"OSkeyI",desc:"Italic"},{val:"OSkeyU",desc:"Underline"},{val:"OSkeyS",desc:"Strikethrough"},{val:"OSkey]",desc:"Increase Indent"},{val:"OSkey[",desc:"Decrease Indent"}]},{title:"Quote",commands:[{val:"OSkey'",desc:"Increase quote level"},{val:"OSkeyShift+'",desc:"Decrease quote level"}]},{title:"Image / Video",commands:[{val:"OSkey+",desc:"Resize larger"},{val:"OSkey-",desc:"Resize smaller"}]},{title:"Table",commands:[{val:"Alt+Space",desc:"Select table cell"},{val:"Shift+Left/Right arrow",desc:"Extend selection one cell"},{val:"Shift+Up/Down arrow",desc:"Extend selection one row"}]},{title:"Navigation",commands:[{val:"OSkey/",desc:"Shortcuts"},{val:"Alt+F10",desc:"Focus popup / toolbar"},{val:"Esc",desc:"Return focus to previous position"}]}]}),a.FE.PLUGINS.help=function(b){function c(){}function d(){for(var a='<div class="fr-help-modal">',c=0;c<b.opts.helpSets.length;c++){var d=b.opts.helpSets[c],e="<table>";e+="<thead><tr><th>"+b.language.translate(d.title)+"</th></tr></thead>",e+="<tbody>";for(var f=0;f<d.commands.length;f++){var g=d.commands[f];e+="<tr>",e+="<td>"+b.language.translate(g.desc)+"</td>",e+="<td>"+g.val.replace("OSkey",b.helpers.isMac()?"&#8984;":"Ctrl+")+"</td>",e+="</tr>"}e+="</tbody></table>",a+=e}return a+="</div>"}function e(){if(!g){var c="<h4>"+b.language.translate("Shortcuts")+"</h4>",e=d(),f=b.modals.create(j,c,e);g=f.$modal,h=f.$head,i=f.$body,b.events.$on(a(b.o_win),"resize",function(){b.modals.resize(j)})}b.modals.show(j),b.modals.resize(j)}function f(){b.modals.hide(j)}var g,h,i,j="help";return{_init:c,show:e,hide:f}},a.FroalaEditor.DefineIcon("help",{NAME:"question"}),a.FE.RegisterShortcut(a.FE.KEYCODE.SLASH,"help",null,"/"),a.FE.RegisterCommand("help",{title:"Help",icon:"help",undo:!1,focus:!1,modal:!0,callback:function(){this.help.show()},plugin:"help",showOnMobile:!1})});
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
6
6
 
7
- !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c)}:a(window.jQuery)}(function(a){a.extend(a.FE.POPUP_TEMPLATES,{"image.insert":"[_BUTTONS_][_UPLOAD_LAYER_][_BY_URL_LAYER_][_PROGRESS_BAR_]","image.edit":"[_BUTTONS_]","image.alt":"[_BUTTONS_][_ALT_LAYER_]","image.size":"[_BUTTONS_][_SIZE_LAYER_]"}),a.extend(a.FE.DEFAULTS,{imageInsertButtons:["imageBack","|","imageUpload","imageByURL"],imageEditButtons:["imageReplace","imageAlign","imageCaption","imageRemove","|","imageLink","linkOpen","linkEdit","linkRemove","-","imageDisplay","imageStyle","imageAlt","imageSize"],imageAltButtons:["imageBack","|"],imageSizeButtons:["imageBack","|"],imageUpload:!0,imageUploadURL:"https://i.froala.com/upload",imageCORSProxy:"https://cors-anywhere.froala.com",imageUploadRemoteUrls:!0,imageUploadParam:"file",imageUploadParams:{},imageUploadToS3:!1,imageUploadMethod:"POST",imageMaxSize:10485760,imageAllowedTypes:["jpeg","jpg","png","gif"],imageResize:!0,imageResizeWithPercent:!1,imageRoundPercent:!1,imageDefaultWidth:300,imageDefaultAlign:"center",imageDefaultDisplay:"block",imageSplitHTML:!1,imageStyles:{"fr-rounded":"Rounded","fr-bordered":"Bordered","fr-shadow":"Shadow"},imageMove:!0,imageMultipleStyles:!0,imageTextNear:!0,imagePaste:!0,imagePasteProcess:!1,imageMinWidth:16,imageOutputSize:!1,imageDefaultMargin:5}),a.FE.PLUGINS.image=function(b){function c(){var a=b.popups.get("image.insert"),c=a.find(".fr-image-by-url-layer input");c.val(""),Ea&&c.val(Ea.attr("src")),c.trigger("change")}function d(){var a=b.$tb.find('.fr-command[data-cmd="insertImage"]'),c=b.popups.get("image.insert");if(c||(c=N()),t(),!c.hasClass("fr-active"))if(b.popups.refresh("image.insert"),b.popups.setContainer("image.insert",b.$tb),a.is(":visible")){var d=a.offset().left+a.outerWidth()/2,e=a.offset().top+(b.opts.toolbarBottom?10:a.outerHeight()-10);b.popups.show("image.insert",d,e,a.outerHeight())}else b.position.forSelection(c),b.popups.show("image.insert")}function e(){var a=b.popups.get("image.edit");if(a||(a=r()),a){var c=Aa();Ca()&&(c=c.find(".fr-img-wrap")),b.popups.setContainer("image.edit",b.$sc),b.popups.refresh("image.edit");var d=c.offset().left+c.outerWidth()/2,e=c.offset().top+c.outerHeight();b.popups.show("image.edit",d,e,c.outerHeight())}}function f(){t()}function g(a){a.parents(".fr-img-caption").length>0&&(a=a.parents(".fr-img-caption:first")),a.hasClass("fr-dii")||a.hasClass("fr-dib")||(a.addClass("fr-fi"+qa(a)[0]),a.addClass("fr-di"+ra(a)[0]),a.css("margin",""),a.css("float",""),a.css("display",""),a.css("z-index",""),a.css("position",""),a.css("overflow",""),a.css("vertical-align",""))}function h(a){a.parents(".fr-img-caption").length>0&&(a=a.parents(".fr-img-caption:first"));var b=a.hasClass("fr-dib")?"block":a.hasClass("fr-dii")?"inline":null,c=a.hasClass("fr-fil")?"left":a.hasClass("fr-fir")?"right":qa(a);oa(a,b,c),a.removeClass("fr-dib fr-dii fr-fir fr-fil")}function i(){for(var c="IMG"==b.el.tagName?[b.el]:b.el.querySelectorAll("img"),d=0;d<c.length;d++){var e=a(c[d]);!b.opts.htmlUntouched&&b.opts.useClasses?((b.opts.imageEditButtons.indexOf("imageAlign")>=0||b.opts.imageEditButtons.indexOf("imageDisplay")>=0)&&g(e),b.opts.imageTextNear||(e.parents(".fr-img-caption").length>0?e.parents(".fr-img-caption:first").removeClass("fr-dii").addClass("fr-dib"):e.removeClass("fr-dii").addClass("fr-dib"))):b.opts.htmlUntouched||b.opts.useClasses||(b.opts.imageEditButtons.indexOf("imageAlign")>=0||b.opts.imageEditButtons.indexOf("imageDisplay")>=0)&&h(e),b.opts.iframe&&e.on("load",b.size.syncIframe)}}function j(c){"undefined"==typeof c&&(c=!0);var d,e=Array.prototype.slice.call(b.el.querySelectorAll("img")),f=[];for(d=0;d<e.length;d++)if(f.push(e[d].getAttribute("src")),a(e[d]).toggleClass("fr-draggable",b.opts.imageMove),""===e[d].getAttribute("class")&&e[d].removeAttribute("class"),""===e[d].getAttribute("style")&&e[d].removeAttribute("style"),e[d].parentNode&&e[d].parentNode.parentNode&&b.node.hasClass(e[d].parentNode.parentNode,"fr-img-caption")){var g=e[d].parentNode.parentNode;b.browser.mozilla||g.setAttribute("contenteditable",!1),g.setAttribute("draggable",!1),g.classList.add("fr-draggable");var h=e[d].nextSibling;h&&h.setAttribute("contenteditable",!0)}if(Sa)for(d=0;d<Sa.length;d++)f.indexOf(Sa[d].getAttribute("src"))<0&&b.events.trigger("image.removed",[a(Sa[d])]);if(Sa&&c){var i=[];for(d=0;d<Sa.length;d++)i.push(Sa[d].getAttribute("src"));for(d=0;d<e.length;d++)i.indexOf(e[d].getAttribute("src"))<0&&b.events.trigger("image.loaded",[a(e[d])])}Sa=e}function k(){if(Fa||$(),!Ea)return!1;var a=b.$wp||b.$sc;a.append(Fa),Fa.data("instance",b);var c=a.scrollTop()-("static"!=a.css("position")?a.offset().top:0),d=a.scrollLeft()-("static"!=a.css("position")?a.offset().left:0);d-=b.helpers.getPX(a.css("border-left-width")),c-=b.helpers.getPX(a.css("border-top-width")),b.$el.is("img")&&b.$sc.is("body")&&(c=0,d=0);var e=Aa();Ca()&&(e=e.find(".fr-img-wrap")),Fa.css("top",(b.opts.iframe?e.offset().top:e.offset().top+c)-1).css("left",(b.opts.iframe?e.offset().left:e.offset().left+d)-1).css("width",e.get(0).getBoundingClientRect().width).css("height",e.get(0).getBoundingClientRect().height).addClass("fr-active")}function l(a){return'<div class="fr-handler fr-h'+a+'"></div>'}function m(a){Ca()?Ea.parents(".fr-img-caption").css("width",a):Ea.css("width",a)}function n(c){if(!b.core.sameInstance(Fa))return!0;if(c.preventDefault(),c.stopPropagation(),b.$el.find("img.fr-error").left)return!1;b.undo.canDo()||b.undo.saveStep();var d=c.pageX||c.originalEvent.touches[0].pageX;if("mousedown"==c.type){var e=b.$oel.get(0),f=e.ownerDocument,g=f.defaultView||f.parentWindow,h=!1;try{h=g.location!=g.parent.location&&!(g.$&&g.$.FE)}catch(i){}h&&g.frameElement&&(d+=b.helpers.getPX(a(g.frameElement).offset().left)+g.frameElement.clientLeft)}Ga=a(this),Ga.data("start-x",d),Ga.data("start-width",Ea.width()),Ga.data("start-height",Ea.height());var j=Ea.width();if(b.opts.imageResizeWithPercent){var k=Ea.parentsUntil(b.$el,b.html.blockTagsQuery()).get(0)||b.el;j=(j/a(k).outerWidth()*100).toFixed(2)+"%"}m(j),Ha.show(),b.popups.hideAll(),ma()}function o(c){if(!b.core.sameInstance(Fa))return!0;var d;if(Ga&&Ea){if(c.preventDefault(),b.$el.find("img.fr-error").left)return!1;var e=c.pageX||(c.originalEvent.touches?c.originalEvent.touches[0].pageX:null);if(!e)return!1;var f=Ga.data("start-x"),g=e-f,h=Ga.data("start-width");if((Ga.hasClass("fr-hnw")||Ga.hasClass("fr-hsw"))&&(g=0-g),b.opts.imageResizeWithPercent){var i=Ea.parentsUntil(b.$el,b.html.blockTagsQuery()).get(0)||b.el;h=((h+g)/a(i).outerWidth()*100).toFixed(2),b.opts.imageRoundPercent&&(h=Math.round(h)),m(h+"%"),d=Ca()?(b.helpers.getPX(Ea.parents(".fr-img-caption").css("width"))/a(i).outerWidth()*100).toFixed(2):(b.helpers.getPX(Ea.css("width"))/a(i).outerWidth()*100).toFixed(2),d===h||b.opts.imageRoundPercent||m(d+"%"),Ea.css("height","").removeAttr("height")}else h+g>=b.opts.imageMinWidth&&(m(h+g),d=Ca()?b.helpers.getPX(Ea.parents(".fr-img-caption").css("width")):b.helpers.getPX(Ea.css("width"))),d!==h+g&&m(d),((Ea.attr("style")||"").match(/(^height:)|(; *height:)/)||Ea.attr("height"))&&(Ea.css("height",Ga.data("start-height")*Ea.width()/Ga.data("start-width")),Ea.removeAttr("height"));k(),b.events.trigger("image.resize",[za()])}}function p(a){if(!b.core.sameInstance(Fa))return!0;if(Ga&&Ea){if(a&&a.stopPropagation(),b.$el.find("img.fr-error").left)return!1;Ga=null,Ha.hide(),k(),e(),b.undo.saveStep(),b.events.trigger("image.resizeEnd",[za()])}}function q(a,c,d){b.edit.on(),Ea&&Ea.addClass("fr-error"),v(b.language.translate("Something went wrong. Please try again.")),!Ea&&d&&_(d),b.events.trigger("image.error",[{code:a,message:Ra[a]},c,d])}function r(a){if(a)return b.$wp&&b.events.$on(b.$wp,"scroll",function(){Ea&&b.popups.isVisible("image.edit")&&(b.events.disableBlur(),x(Ea))}),!0;var c="";if(b.opts.imageEditButtons.length>0){c+='<div class="fr-buttons">',c+=b.button.buildList(b.opts.imageEditButtons),c+="</div>";var d={buttons:c},e=b.popups.create("image.edit",d);return e}return!1}function s(a){var c=b.popups.get("image.insert");if(c||(c=N()),c.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),c.find(".fr-image-progress-bar-layer").addClass("fr-active"),c.find(".fr-buttons").hide(),Ea){var d=Aa();b.popups.setContainer("image.insert",b.$sc);var e=d.offset().left+d.width()/2,f=d.offset().top+d.height();b.popups.show("image.insert",e,f,d.outerHeight())}"undefined"==typeof a&&u(b.language.translate("Uploading"),0)}function t(a){var c=b.popups.get("image.insert");if(c&&(c.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),c.find(".fr-image-progress-bar-layer").removeClass("fr-active"),c.find(".fr-buttons").show(),a||b.$el.find("img.fr-error").length)){if(b.events.focus(),b.$el.find("img.fr-error").length&&(b.$el.find("img.fr-error").remove(),b.undo.saveStep(),b.undo.run(),b.undo.dropRedo()),!b.$wp&&Ea){var d=Ea;ka(!0),b.selection.setAfter(d.get(0)),b.selection.restore()}b.popups.hide("image.insert")}}function u(a,c){var d=b.popups.get("image.insert");if(d){var e=d.find(".fr-image-progress-bar-layer");e.find("h3").text(a+(c?" "+c+"%":"")),e.removeClass("fr-error"),c?(e.find("div").removeClass("fr-indeterminate"),e.find("div > span").css("width",c+"%")):e.find("div").addClass("fr-indeterminate")}}function v(a){s();var c=b.popups.get("image.insert"),d=c.find(".fr-image-progress-bar-layer");d.addClass("fr-error");var e=d.find("h3");e.text(a),b.events.disableBlur(),e.focus()}function w(){var a=b.popups.get("image.insert"),c=a.find(".fr-image-by-url-layer input");if(c.val().length>0){if(s(),u(b.language.translate("Loading image")),b.opts.imageUploadRemoteUrls&&b.opts.imageCORSProxy&&b.opts.imageUpload){var d=new XMLHttpRequest;d.open("GET",b.opts.imageCORSProxy+"/"+c.val(),!0),d.responseType="blob",d.onload=function(){200==this.status?I([new Blob([this.response],{type:this.response.type||"image/png"})],Ea):q(Ja)},d.send()}else z(c.val(),!0,[],Ea);c.val(""),c.blur()}}function x(a){ja.call(a.get(0))}function y(){var c=a(this);b.popups.hide("image.insert"),c.removeClass("fr-uploading"),c.next().is("br")&&c.next().remove(),x(c),b.events.trigger("image.loaded",[c])}function z(a,c,d,e,f){b.edit.off(),u(b.language.translate("Loading image")),c&&(a=b.helpers.sanitizeURL(a));var g=new Image;g.onload=function(){var c,g;if(e){b.undo.canDo()||e.hasClass("fr-uploading")||b.undo.saveStep();var h=e.data("fr-old-src");e.data("fr-image-pasted")&&(h=null),b.$wp?(c=e.clone().removeData("fr-old-src").removeClass("fr-uploading").removeAttr("data-fr-image-pasted"),c.off("load"),h&&e.attr("src",h),e.replaceWith(c)):c=e;for(var i=c.get(0).attributes,k=0;k<i.length;k++){var l=i[k];0===l.nodeName.indexOf("data-")&&c.removeAttr(l.nodeName)}if("undefined"!=typeof d)for(g in d)d.hasOwnProperty(g)&&"link"!=g&&c.attr("data-"+g,d[g]);c.on("load",y),c.attr("src",a),b.edit.on(),j(!1),b.undo.saveStep(),b.$el.blur(),b.events.trigger(h?"image.replaced":"image.inserted",[c,f])}else c=F(a,d,y),j(!1),b.undo.saveStep(),b.$el.blur(),b.events.trigger("image.inserted",[c,f])},g.onerror=function(){q(Ja)},s(b.language.translate("Loading image")),g.src=a}function A(a){try{if(b.events.trigger("image.uploaded",[a],!0)===!1)return b.edit.on(),!1;var c=JSON.parse(a);return c.link?c:(q(Ka,a),!1)}catch(d){return q(Ma,a),!1}}function B(c){try{var d=a(c).find("Location").text(),e=a(c).find("Key").text();return b.events.trigger("image.uploadedToS3",[d,e,c],!0)===!1?(b.edit.on(),!1):d}catch(f){return q(Ma,c),!1}}function C(a){u(b.language.translate("Loading image"));var c=this.status,d=this.response,e=this.responseXML,f=this.responseText;try{if(b.opts.imageUploadToS3)if(201==c){var g=B(e);g&&z(g,!1,[],a,d||e)}else q(Ma,d||e,a);else if(c>=200&&300>c){var h=A(f);h&&z(h.link,!1,h,a,d||f)}else q(La,d||f,a)}catch(i){q(Ma,d||f,a)}}function D(){q(Ma,this.response||this.responseText||this.responseXML)}function E(a){if(a.lengthComputable){var c=a.loaded/a.total*100|0;u(b.language.translate("Uploading"),c)}}function F(c,d,e){var f,g="";if(d&&"undefined"!=typeof d)for(f in d)d.hasOwnProperty(f)&&"link"!=f&&(g+=" data-"+f+'="'+d[f]+'"');var h=b.opts.imageDefaultWidth;h&&"auto"!=h&&(h+=b.opts.imageResizeWithPercent?"%":"px");var i=a('<img src="'+c+'"'+g+(h?' style="width: '+h+';"':"")+">");oa(i,b.opts.imageDefaultDisplay,b.opts.imageDefaultAlign),i.on("load",e),i.on("error",function(){a(this).addClass("fr-error"),q(Qa)}),b.edit.on(),b.events.focus(!0),b.selection.restore(),b.undo.saveStep(),b.opts.imageSplitHTML?b.markers.split():b.markers.insert(),b.html.wrap();var j=b.$el.find(".fr-marker");return j.length?(j.parent().is("hr")&&j.parent().after(j),b.node.isLastSibling(j)&&j.parent().hasClass("fr-deletable")&&j.insertAfter(j.parent()),j.replaceWith(i)):b.$el.append(i),b.selection.clear(),i}function G(){b.edit.on(),t(!0)}function H(c,d,e,f){function g(){var e=a(this);e.off("load"),e.addClass("fr-uploading"),e.next().is("br")&&e.next().remove(),b.placeholder.refresh(),x(e),k(),s(),b.edit.off(),c.onload=function(){C.call(c,e)},c.onerror=D,c.upload.onprogress=E,c.onabort=G,e.off("abortUpload").on("abortUpload",function(){4!=c.readyState&&c.abort()}),c.send(d)}var h,i=new FileReader;i.addEventListener("load",function(){var a=i.result;if(i.result.indexOf("svg+xml")<0){for(var c=atob(i.result.split(",")[1]),d=[],e=0;e<c.length;e++)d.push(c.charCodeAt(e));a=window.URL.createObjectURL(new Blob([new Uint8Array(d)],{type:"image/jpeg"}))}f?(f.on("load",g),f.one("error",function(){f.off("load"),f.attr("src",f.data("fr-old-src")),q(Qa)}),b.edit.on(),b.undo.saveStep(),f.data("fr-old-src",f.attr("src")),f.attr("src",a)):h=F(a,null,g)},!1),i.readAsDataURL(e)}function I(a,c){if("undefined"!=typeof a&&a.length>0){if(b.events.trigger("image.beforeUpload",[a,c])===!1)return!1;var d=a[0];if(d.name||(d.name=(new Date).getTime()+".jpg"),d.size>b.opts.imageMaxSize)return q(Na),!1;if(b.opts.imageAllowedTypes.indexOf(d.type.replace(/image\//g,""))<0)return q(Oa),!1;var e;if(b.drag_support.formdata&&(e=b.drag_support.formdata?new FormData:null),e){var f;if(b.opts.imageUploadToS3!==!1){e.append("key",b.opts.imageUploadToS3.keyStart+(new Date).getTime()+"-"+(d.name||"untitled")),e.append("success_action_status","201"),e.append("X-Requested-With","xhr"),e.append("Content-Type",d.type);for(f in b.opts.imageUploadToS3.params)b.opts.imageUploadToS3.params.hasOwnProperty(f)&&e.append(f,b.opts.imageUploadToS3.params[f])}for(f in b.opts.imageUploadParams)b.opts.imageUploadParams.hasOwnProperty(f)&&e.append(f,b.opts.imageUploadParams[f]);e.append(b.opts.imageUploadParam,d,d.name);var g=b.opts.imageUploadURL;b.opts.imageUploadToS3&&(g=b.opts.imageUploadToS3.uploadURL?b.opts.imageUploadToS3.uploadURL:"https://"+b.opts.imageUploadToS3.region+".amazonaws.com/"+b.opts.imageUploadToS3.bucket);var h=b.core.getXHR(g,b.opts.imageUploadMethod);H(h,e,d,c||Ea)}}}function J(c){b.events.$on(c,"dragover dragenter",".fr-image-upload-layer",function(){return a(this).addClass("fr-drop"),!1},!0),b.events.$on(c,"dragleave dragend",".fr-image-upload-layer",function(){return a(this).removeClass("fr-drop"),!1},!0),b.events.$on(c,"drop",".fr-image-upload-layer",function(d){d.preventDefault(),d.stopPropagation(),a(this).removeClass("fr-drop");var e=d.originalEvent.dataTransfer;if(e&&e.files){var f=c.data("instance")||b;f.events.disableBlur(),f.image.upload(e.files),f.events.enableBlur()}},!0),b.helpers.isIOS()&&b.events.$on(c,"touchstart",'.fr-image-upload-layer input[type="file"]',function(){a(this).trigger("click")},!0),b.events.$on(c,"change",'.fr-image-upload-layer input[type="file"]',function(){if(this.files){var d=c.data("instance")||b;d.events.disableBlur(),c.find("input:focus").blur(),d.events.enableBlur(),d.image.upload(this.files,Ea)}a(this).val("")},!0)}function K(a){return a.is("img")&&a.parents(".fr-img-caption").length>0?a.parents(".fr-img-caption"):void 0}function L(c){var d=c.originalEvent.dataTransfer;if(d&&d.files&&d.files.length){var e=d.files[0];if(e&&e.type&&-1!==e.type.indexOf("image")&&b.opts.imageAllowedTypes.indexOf(e.type.replace(/image\//g,""))>=0){if(!b.opts.imageUpload)return c.preventDefault(),c.stopPropagation(),!1;b.markers.remove(),b.markers.insertAtPoint(c.originalEvent),b.$el.find(".fr-marker").replaceWith(a.FE.MARKERS),0===b.$el.find(".fr-marker").length&&b.selection.setAtEnd(b.el),b.popups.hideAll();var f=b.popups.get("image.insert");f||(f=N()),b.popups.setContainer("image.insert",b.$sc);var g=c.originalEvent.pageX,h=c.originalEvent.pageY;return b.opts.iframe&&(h+=b.$iframe.offset().top,g+=b.$iframe.offset().left),b.popups.show("image.insert",g,h),s(),b.opts.imageAllowedTypes.indexOf(e.type.replace(/image\//g,""))>=0?(ka(!0),I(d.files)):q(Oa),c.preventDefault(),c.stopPropagation(),!1}}}function M(){b.events.$on(b.$el,b._mousedown,"IMG"==b.el.tagName?null:'img:not([contenteditable="false"])',function(c){return"false"==a(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable")?!0:(b.helpers.isMobile()||b.selection.clear(),Ia=!0,b.popups.areVisible()&&b.events.disableBlur(),b.browser.msie&&(b.events.disableBlur(),b.$el.attr("contenteditable",!1)),b.draggable||"touchstart"==c.type||c.preventDefault(),void c.stopPropagation())}),b.events.$on(b.$el,b._mouseup,"IMG"==b.el.tagName?null:'img:not([contenteditable="false"])',function(c){return"false"==a(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable")?!0:void(Ia&&(Ia=!1,c.stopPropagation(),b.browser.msie&&(b.$el.attr("contenteditable",!0),b.events.enableBlur())))}),b.events.on("keyup",function(c){if(c.shiftKey&&""===b.selection.text().replace(/\n/g,"")&&b.keys.isArrow(c.which)){var d=b.selection.element(),e=b.selection.endElement();d&&"IMG"==d.tagName?x(a(d)):e&&"IMG"==e.tagName&&x(a(e))}},!0),b.events.on("drop",L),b.events.on("element.beforeDrop",K),b.events.on("mousedown window.mousedown",la),b.events.on("window.touchmove",ma),b.events.on("mouseup window.mouseup",function(){return Ea?(ka(),!1):void ma()}),b.events.on("commands.mousedown",function(a){a.parents(".fr-toolbar").length>0&&ka()}),b.events.on("blur image.hideResizer commands.undo commands.redo element.dropped",function(){Ia=!1,ka(!0)}),b.events.on("modals.hide",function(){Ea&&(xa(),b.selection.clear())})}function N(a){if(a)return b.popups.onRefresh("image.insert",c),b.popups.onHide("image.insert",f),!0;var d,e="";b.opts.imageUpload||b.opts.imageInsertButtons.splice(b.opts.imageInsertButtons.indexOf("imageUpload"),1),b.opts.imageInsertButtons.length>1&&(e='<div class="fr-buttons">'+b.button.buildList(b.opts.imageInsertButtons)+"</div>");var g=b.opts.imageInsertButtons.indexOf("imageUpload"),h=b.opts.imageInsertButtons.indexOf("imageByURL"),i="";g>=0&&(d=" fr-active",h>=0&&g>h&&(d=""),i='<div class="fr-image-upload-layer'+d+' fr-layer" id="fr-image-upload-layer-'+b.id+'"><strong>'+b.language.translate("Drop image")+"</strong><br>("+b.language.translate("or click")+')<div class="fr-form"><input type="file" accept="image/'+b.opts.imageAllowedTypes.join(", image/").toLowerCase()+'" tabIndex="-1" aria-labelledby="fr-image-upload-layer-'+b.id+'" role="button"></div></div>');var j="";h>=0&&(d=" fr-active",g>=0&&h>g&&(d=""),j='<div class="fr-image-by-url-layer'+d+' fr-layer" id="fr-image-by-url-layer-'+b.id+'"><div class="fr-input-line"><input id="fr-image-by-url-layer-text-'+b.id+'" type="text" placeholder="http://" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageInsertByURL" tabIndex="2" role="button">'+b.language.translate("Insert")+"</button></div></div>");var k='<div class="fr-image-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="imageDismissError" tabIndex="2" role="button">OK</button></div></div>',l={buttons:e,upload_layer:i,by_url_layer:j,progress_bar:k},m=b.popups.create("image.insert",l);return b.$wp&&b.events.$on(b.$wp,"scroll",function(){Ea&&b.popups.isVisible("image.insert")&&wa()}),J(m),m}function O(){if(Ea){var a=b.popups.get("image.alt");a.find("input").val(Ea.attr("alt")||"").trigger("change")}}function P(){var a=b.popups.get("image.alt");a||(a=Q()),t(),b.popups.refresh("image.alt"),b.popups.setContainer("image.alt",b.$sc);var c=Aa();Ca()&&(c=c.find(".fr-img-wrap"));var d=c.offset().left+c.outerWidth()/2,e=c.offset().top+c.outerHeight();b.popups.show("image.alt",d,e,c.outerHeight())}function Q(a){if(a)return b.popups.onRefresh("image.alt",O),!0;var c="";c='<div class="fr-buttons">'+b.button.buildList(b.opts.imageAltButtons)+"</div>";var d="";d='<div class="fr-image-alt-layer fr-layer fr-active" id="fr-image-alt-layer-'+b.id+'"><div class="fr-input-line"><input id="fr-image-alt-layer-text-'+b.id+'" type="text" placeholder="'+b.language.translate("Alternate Text")+'" tabIndex="1"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetAlt" tabIndex="2" role="button">'+b.language.translate("Update")+"</button></div></div>";var e={buttons:c,alt_layer:d},f=b.popups.create("image.alt",e);return b.$wp&&b.events.$on(b.$wp,"scroll.image-alt",function(){Ea&&b.popups.isVisible("image.alt")&&P()}),f}function R(a){if(Ea){var c=b.popups.get("image.alt");Ea.attr("alt",a||c.find("input").val()||""),c.find("input:focus").blur(),x(Ea)}}function S(){if(Ea){var a=b.popups.get("image.size");a.find('input[name="width"]').val(Ea.get(0).style.width).trigger("change"),a.find('input[name="height"]').val(Ea.get(0).style.height).trigger("change")}}function T(){var a=b.popups.get("image.size");a||(a=U()),t(),b.popups.refresh("image.size"),b.popups.setContainer("image.size",b.$sc);var c=Aa();Ca()&&(c=c.find(".fr-img-wrap"));var d=c.offset().left+c.outerWidth()/2,e=c.offset().top+c.outerHeight();b.popups.show("image.size",d,e,c.outerHeight())}function U(a){if(a)return b.popups.onRefresh("image.size",S),!0;var c="";c='<div class="fr-buttons">'+b.button.buildList(b.opts.imageSizeButtons)+"</div>";var d="";d='<div class="fr-image-size-layer fr-layer fr-active" id="fr-image-size-layer-'+b.id+'"><div class="fr-image-group"><div class="fr-input-line"><input id="fr-image-size-layer-width-'+b.id+'" type="text" name="width" placeholder="'+b.language.translate("Width")+'" tabIndex="1"></div><div class="fr-input-line"><input id="fr-image-size-layer-height'+b.id+'" type="text" name="height" placeholder="'+b.language.translate("Height")+'" tabIndex="1"></div></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetSize" tabIndex="2" role="button">'+b.language.translate("Update")+"</button></div></div>";var e={buttons:c,size_layer:d},f=b.popups.create("image.size",e);return b.$wp&&b.events.$on(b.$wp,"scroll.image-size",function(){Ea&&b.popups.isVisible("image.size")&&T()}),f}function V(a,c){if(Ea){var d=b.popups.get("image.size");a=a||d.find('input[name="width"]').val()||"",c=c||d.find('input[name="height"]').val()||"";var e=/^[\d]+((px)|%)*$/g;Ea.removeAttr("width").removeAttr("height"),a.match(e)?Ea.css("width",a):Ea.css("width",""),c.match(e)?Ea.css("height",c):Ea.css("height",""),Ca()&&(Ea.parent().removeAttr("width").removeAttr("height"),a.match(e)?Ea.parent().css("width",a):Ea.parent().css("width",""),c.match(e)?Ea.parent().css("height",c):Ea.parent().css("height","")),d.find("input:focus").blur(),x(Ea)}}function W(a){var c,d,e=b.popups.get("image.insert");if(Ea||b.opts.toolbarInline){if(Ea){var f=Aa();Ca()&&(f=f.find(".fr-img-wrap")),d=f.offset().top+f.outerHeight(),c=f.offset().left+f.outerWidth()/2}}else{var g=b.$tb.find('.fr-command[data-cmd="insertImage"]');c=g.offset().left+g.outerWidth()/2,d=g.offset().top+(b.opts.toolbarBottom?10:g.outerHeight()-10)}!Ea&&b.opts.toolbarInline&&(d=e.offset().top-b.helpers.getPX(e.css("margin-top")),e.hasClass("fr-above")&&(d+=e.outerHeight())),e.find(".fr-layer").removeClass("fr-active"),e.find(".fr-"+a+"-layer").addClass("fr-active"),b.popups.show("image.insert",c,d,Ea?Ea.outerHeight():0),b.accessibility.focusPopup(e)}function X(a){var c=b.popups.get("image.insert");c.find(".fr-image-upload-layer").hasClass("fr-active")&&a.addClass("fr-active").attr("aria-pressed",!0)}function Y(a){var c=b.popups.get("image.insert");c.find(".fr-image-by-url-layer").hasClass("fr-active")&&a.addClass("fr-active").attr("aria-pressed",!0)}function Z(a,b,c,d){return a.pageX=b,n.call(this,a),a.pageX=a.pageX+c*Math.floor(Math.pow(1.1,d)),o.call(this,a),p.call(this,a),++d}function $(){var c;if(b.shared.$image_resizer?(Fa=b.shared.$image_resizer,Ha=b.shared.$img_overlay,b.events.on("destroy",function(){Fa.removeClass("fr-active").appendTo(a("body:first"))},!0)):(b.shared.$image_resizer=a('<div class="fr-image-resizer"></div>'),Fa=b.shared.$image_resizer,b.events.$on(Fa,"mousedown",function(a){a.stopPropagation()},!0),b.opts.imageResize&&(Fa.append(l("nw")+l("ne")+l("sw")+l("se")),b.shared.$img_overlay=a('<div class="fr-image-overlay"></div>'),Ha=b.shared.$img_overlay,c=Fa.get(0).ownerDocument,a(c).find("body:first").append(Ha))),b.events.on("shared.destroy",function(){Fa.html("").removeData().remove(),Fa=null,b.opts.imageResize&&(Ha.remove(),Ha=null)},!0),b.helpers.isMobile()||b.events.$on(a(b.o_win),"resize",function(){Ea&&!Ea.hasClass("fr-uploading")?ka(!0):Ea&&(k(),wa(),s(!1))}),b.opts.imageResize){c=Fa.get(0).ownerDocument,b.events.$on(Fa,b._mousedown,".fr-handler",n),b.events.$on(a(c),b._mousemove,o),b.events.$on(a(c.defaultView||c.parentWindow),b._mouseup,p),b.events.$on(Ha,"mouseleave",p);var d=1,e=null,f=0;b.events.on("keydown",function(c){if(Ea){var g=-1!=navigator.userAgent.indexOf("Mac OS X")?c.metaKey:c.ctrlKey,h=c.which;(h!==e||c.timeStamp-f>200)&&(d=1),(h==a.FE.KEYCODE.EQUALS||b.browser.mozilla&&h==a.FE.KEYCODE.FF_EQUALS)&&g&&!c.altKey?d=Z.call(this,c,1,1,d):(h==a.FE.KEYCODE.HYPHEN||b.browser.mozilla&&h==a.FE.KEYCODE.FF_HYPHEN)&&g&&!c.altKey?d=Z.call(this,c,2,-1,d):b.keys.ctrlKey(c)||h!=a.FE.KEYCODE.ENTER||(Ea.before("<br>"),x(Ea)),e=h,f=c.timeStamp}},!0),b.events.on("keyup",function(){d=1})}}function _(c){c=c||Aa(),c&&b.events.trigger("image.beforeRemove",[c])!==!1&&(b.popups.hideAll(),xa(),ka(!0),b.undo.canDo()||b.undo.saveStep(),c.get(0)==b.el?c.removeAttr("src"):("A"==c.get(0).parentNode.tagName?(b.selection.setBefore(c.get(0).parentNode)||b.selection.setAfter(c.get(0).parentNode)||c.parent().after(a.FE.MARKERS),a(c.get(0).parentNode).remove()):(b.selection.setBefore(c.get(0))||b.selection.setAfter(c.get(0))||c.after(a.FE.MARKERS),c.remove()),b.html.fillEmptyBlocks(),b.selection.restore()),b.undo.saveStep())}function aa(c){var d=c.which;if(Ea&&(d==a.FE.KEYCODE.BACKSPACE||d==a.FE.KEYCODE.DELETE))return c.preventDefault(),c.stopPropagation(),_(),!1;if(Ea&&d==a.FE.KEYCODE.ESC){var e=Ea;return ka(!0),b.selection.setAfter(e.get(0)),b.selection.restore(),c.preventDefault(),!1}if(Ea&&(d==a.FE.KEYCODE.ARROW_LEFT||d==a.FE.KEYCODE.ARROW_RIGHT)){var f=Ea.get(0);return ka(!0),d==a.FE.KEYCODE.ARROW_LEFT?b.selection.setBefore(f):b.selection.setAfter(f),b.selection.restore(),c.preventDefault(),!1}return Ea&&d!=a.FE.KEYCODE.F10&&!b.keys.isBrowserAction(c)?(c.preventDefault(),c.stopPropagation(),!1):void 0}function ba(a){if(a&&"IMG"==a.tagName){if(b.node.hasClass(a,"fr-uploading")||b.node.hasClass(a,"fr-error")?a.parentNode.removeChild(a):b.node.hasClass(a,"fr-draggable")&&a.classList.remove("fr-draggable"),a.parentNode&&a.parentNode.parentNode&&b.node.hasClass(a.parentNode.parentNode,"fr-img-caption")){var c=a.parentNode.parentNode;c.removeAttribute("contenteditable"),c.removeAttribute("draggable"),c.classList.remove("fr-draggable");var d=a.nextSibling;d&&d.removeAttribute("contenteditable")}}else if(a&&a.nodeType==Node.ELEMENT_NODE)for(var e=a.querySelectorAll("img.fr-uploading, img.fr-error, img.fr-draggable"),f=0;f<e.length;f++)ba(e[f])}function ca(){if(M(),"IMG"==b.el.tagName&&b.$el.addClass("fr-view"),b.events.$on(b.$el,b.helpers.isMobile()&&!b.helpers.isWindowsPhone()?"touchend":"click","IMG"==b.el.tagName?null:'img:not([contenteditable="false"])',ja),b.helpers.isMobile()&&(b.events.$on(b.$el,"touchstart","IMG"==b.el.tagName?null:'img:not([contenteditable="false"])',function(){Ta=!1}),b.events.$on(b.$el,"touchmove",function(){Ta=!0})),b.$wp?(b.events.on("window.keydown keydown",aa,!0),b.events.on("keyup",function(b){return Ea&&b.which==a.FE.KEYCODE.ENTER?!1:void 0},!0)):b.events.$on(b.$win,"keydown",aa),b.events.on("toolbar.esc",function(){if(Ea){if(b.$wp)b.events.disableBlur(),b.events.focus();else{var a=Ea;ka(!0),b.selection.setAfter(a.get(0)),b.selection.restore()}return!1}},!0),b.events.on("toolbar.focusEditor",function(){return Ea?!1:void 0},!0),b.events.on("window.cut window.copy",function(a){Ea&&b.popups.isVisible("image.edit")&&!b.popups.get("image.edit").find(":focus").length&&(xa(),b.paste.saveCopiedText(a,Ea.get(0).outerHTML,Ea.attr("alt")),"copy"==a.type?setTimeout(function(){x(Ea)}):(ka(!0),b.undo.saveStep(),setTimeout(function(){b.undo.saveStep()},0)))},!0),b.browser.msie&&b.events.on("keydown",function(c){if(!b.selection.isCollapsed()||!Ea)return!0;var d=c.which;d==a.FE.KEYCODE.C&&b.keys.ctrlKey(c)?b.events.trigger("window.copy"):d==a.FE.KEYCODE.X&&b.keys.ctrlKey(c)&&b.events.trigger("window.cut")}),b.events.$on(a(b.o_win),"keydown",function(b){var c=b.which;return Ea&&c==a.FE.KEYCODE.BACKSPACE?(b.preventDefault(),!1):void 0}),b.events.$on(b.$win,"keydown",function(b){var c=b.which;Ea&&Ea.hasClass("fr-uploading")&&c==a.FE.KEYCODE.ESC&&Ea.trigger("abortUpload")}),b.events.on("destroy",function(){Ea&&Ea.hasClass("fr-uploading")&&Ea.trigger("abortUpload")}),b.events.on("paste.before",ha),b.events.on("paste.beforeCleanup",ia),b.events.on("paste.after",ea),b.events.on("html.set",i),b.events.on("html.inserted",i),i(),b.events.on("destroy",function(){Sa=[]}),b.events.on("html.processGet",ba),b.opts.imageOutputSize){var c;b.events.on("html.beforeGet",function(){c=b.el.querySelectorAll("img");for(var d=0;d<c.length;d++){var e=c[d].style.width||a(c[d]).width(),f=c[d].style.height||a(c[d]).height();e&&c[d].setAttribute("width",(""+e).replace(/px/,"")),f&&c[d].setAttribute("height",(""+f).replace(/px/,""))}})}b.opts.iframe&&b.events.on("image.loaded",b.size.syncIframe),b.$wp&&(j(),b.events.on("contentChanged",j)),b.events.$on(a(b.o_win),"orientationchange.image",function(){setTimeout(function(){Ea&&x(Ea)},100)}),r(!0),N(!0),U(!0),Q(!0),b.events.on("node.remove",function(a){return"IMG"==a.get(0).tagName?(_(a),!1):void 0})}function da(c){if(b.events.trigger("image.beforePasteUpload",[c])===!1)return!1;Ea=a(c),k(),e(),wa(),s();for(var d=atob(a(c).attr("src").split(",")[1]),f=[],g=0;g<d.length;g++)f.push(d.charCodeAt(g));var h=new Blob([new Uint8Array(f)],{type:"image/jpeg"});I([h],Ea)}function ea(){b.opts.imagePaste?b.$el.find("img[data-fr-image-pasted]").each(function(c,d){if(b.opts.imagePasteProcess){var e=b.opts.imageDefaultWidth;e&&"auto"!=e&&(e+=b.opts.imageResizeWithPercent?"%":"px"),a(d).css("width",e).removeClass("fr-dii fr-dib fr-fir fr-fil").addClass((b.opts.imageDefaultDisplay?"fr-di"+b.opts.imageDefaultDisplay[0]:"")+(b.opts.imageDefaultAlign&&"center"!=b.opts.imageDefaultAlign?" fr-fi"+b.opts.imageDefaultAlign[0]:""))}if(0===d.src.indexOf("data:"))da(d);else if(0===d.src.indexOf("blob:")||0===d.src.indexOf("http")&&b.opts.imageUploadRemoteUrls&&b.opts.imageCORSProxy){var f=new Image;f.crossOrigin="Anonymous",f.onload=function(){var a=b.o_doc.createElement("CANVAS"),c=a.getContext("2d");a.height=this.naturalHeight,a.width=this.naturalWidth,c.drawImage(this,0,0),d.src=a.toDataURL("image/png"),da(d)},f.src=(0===d.src.indexOf("blob:")?"":b.opts.imageCORSProxy+"/")+d.src;
8
- }else 0!==d.src.indexOf("http")||0===d.src.indexOf("https://mail.google.com/mail")?(b.selection.save(),a(d).remove(),b.selection.restore()):a(d).removeAttr("data-fr-image-pasted")}):b.$el.find("img[data-fr-image-pasted]").remove()}function fa(a){var c=a.target.result,d=b.opts.imageDefaultWidth;d&&"auto"!=d&&(d+=b.opts.imageResizeWithPercent?"%":"px"),b.html.insert('<img data-fr-image-pasted="true" class="'+(b.opts.imageDefaultDisplay?"fr-di"+b.opts.imageDefaultDisplay[0]:"")+(b.opts.imageDefaultAlign&&"center"!=b.opts.imageDefaultAlign?" fr-fi"+b.opts.imageDefaultAlign[0]:"")+'" src="'+c+'"'+(d?' style="width: '+d+';"':"")+">"),b.events.trigger("paste.after")}function ga(a){var b=new FileReader;b.onload=fa,b.readAsDataURL(a)}function ha(a){if(a&&a.clipboardData&&a.clipboardData.items){var b=null;if(a.clipboardData.getData("text/rtf"))b=a.clipboardData.items[0].getAsFile();else for(var c=0;c<a.clipboardData.items.length&&!(b=a.clipboardData.items[c].getAsFile());c++);if(b)return ga(b),!1}}function ia(a){return a=a.replace(/<img /gi,'<img data-fr-image-pasted="true" ')}function ja(c){if("false"==a(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable"))return!0;if(c&&"touchend"==c.type&&Ta)return!0;if(c&&b.edit.isDisabled())return c.stopPropagation(),c.preventDefault(),!1;for(var d=0;d<a.FE.INSTANCES.length;d++)a.FE.INSTANCES[d]!=b&&a.FE.INSTANCES[d].events.trigger("image.hideResizer");b.toolbar.disable(),c&&(c.stopPropagation(),c.preventDefault()),b.helpers.isMobile()&&(b.events.disableBlur(),b.$el.blur(),b.events.enableBlur()),b.opts.iframe&&b.size.syncIframe(),Ea=a(this),b.browser.msie||xa(),k(),e(),b.browser.msie||b.selection.clear(),b.helpers.isIOS()&&(b.events.disableBlur(),b.$el.blur()),b.button.bulkRefresh(),b.events.trigger("video.hideResizer")}function ka(a){Ea&&(na()||a===!0)&&(b.toolbar.enable(),Fa.removeClass("fr-active"),b.popups.hide("image.edit"),Ea=null,ma(),Ga=null,Ha&&Ha.hide())}function la(){Ua=!0}function ma(){Ua=!1}function na(){return Ua}function oa(a,c,d){!b.opts.htmlUntouched&&b.opts.useClasses?(a.removeClass("fr-fil fr-fir fr-dib fr-dii"),d&&a.addClass("fr-fi"+d[0]),c&&a.addClass("fr-di"+c[0])):"inline"==c?(a.css({display:"inline-block",verticalAlign:"bottom",margin:b.opts.imageDefaultMargin}),"center"==d?a.css({"float":"none",marginBottom:"",marginTop:"",maxWidth:"calc(100% - "+2*b.opts.imageDefaultMargin+"px)",textAlign:"center"}):"left"==d?a.css({"float":"left",marginLeft:0,maxWidth:"calc(100% - "+b.opts.imageDefaultMargin+"px)",textAlign:"left"}):a.css({"float":"right",marginRight:0,maxWidth:"calc(100% - "+b.opts.imageDefaultMargin+"px)",textAlign:"right"})):"block"==c&&(a.css({display:"block","float":"none",verticalAlign:"top",margin:b.opts.imageDefaultMargin+"px auto",textAlign:"center"}),"left"==d?a.css({marginLeft:0,textAlign:"left"}):"right"==d&&a.css({marginRight:0,textAlign:"right"}))}function pa(a){var c=Aa();c.removeClass("fr-fir fr-fil"),!b.opts.htmlUntouched&&b.opts.useClasses?"left"==a?c.addClass("fr-fil"):"right"==a&&c.addClass("fr-fir"):oa(c,ra(),a),xa(),k(),e(),b.selection.clear()}function qa(a){if("undefined"==typeof a&&(a=Aa()),a){if(a.hasClass("fr-fil"))return"left";if(a.hasClass("fr-fir"))return"right";if(a.hasClass("fr-dib")||a.hasClass("fr-dii"))return"center";var b=a.css("float");if(a.css("float","none"),"block"==a.css("display")){if(a.css("float",""),a.css("float")!=b&&a.css("float",b),0===parseInt(a.css("margin-left"),10))return"left";if(0===parseInt(a.css("margin-right"),10))return"right"}else{if(a.css("float",""),a.css("float")!=b&&a.css("float",b),"left"==a.css("float"))return"left";if("right"==a.css("float"))return"right"}}return"center"}function ra(a){"undefined"==typeof a&&(a=Aa());var b=a.css("float");return a.css("float","none"),"block"==a.css("display")?(a.css("float",""),a.css("float")!=b&&a.css("float",b),"block"):(a.css("float",""),a.css("float")!=b&&a.css("float",b),"inline")}function sa(a){Ea&&a.find("> *:first").replaceWith(b.icon.create("image-align-"+qa()))}function ta(a,b){Ea&&b.find('.fr-command[data-param1="'+qa()+'"]').addClass("fr-active").attr("aria-selected",!0)}function ua(a){var c=Aa();c.removeClass("fr-dii fr-dib"),!b.opts.htmlUntouched&&b.opts.useClasses?"inline"==a?c.addClass("fr-dii"):"block"==a&&c.addClass("fr-dib"):oa(c,a,qa()),xa(),k(),e(),b.selection.clear()}function va(a,b){Ea&&b.find('.fr-command[data-param1="'+ra()+'"]').addClass("fr-active").attr("aria-selected",!0)}function wa(){var a=b.popups.get("image.insert");a||(a=N()),b.popups.isVisible("image.insert")||(t(),b.popups.refresh("image.insert"),b.popups.setContainer("image.insert",b.$sc));var c=Aa();Ca()&&(c=c.find(".fr-img-wrap"));var d=c.offset().left+c.outerWidth()/2,e=c.offset().top+c.outerHeight();b.popups.show("image.insert",d,e,c.outerHeight(!0))}function xa(){if(Ea){b.events.disableBlur(),b.selection.clear();var a=b.doc.createRange();a.selectNode(Ea.get(0));var c=b.selection.get();c.addRange(a),b.events.enableBlur()}}function ya(){Ea?(b.events.disableBlur(),a(".fr-popup input:focus").blur(),x(Ea)):(b.events.disableBlur(),b.selection.restore(),b.events.enableBlur(),b.popups.hide("image.insert"),b.toolbar.showInline())}function za(){return Ea}function Aa(){return Ca()?Ea.parents(".fr-img-caption:first"):Ea}function Ba(a,c,d){if("undefined"==typeof c&&(c=b.opts.imageStyles),"undefined"==typeof d&&(d=b.opts.imageMultipleStyles),!Ea)return!1;var e=Aa();if(!d){var f=Object.keys(c);f.splice(f.indexOf(a),1),e.removeClass(f.join(" "))}"object"==typeof c[a]?(e.removeAttr("style"),e.css(c[a].style)):e.toggleClass(a),x(Ea)}function Ca(){return Ea?Ea.parents(".fr-img-caption").length>0:!1}function Da(){var c;Ea&&!Ca()?(c=Ea,Ea.parent().is("a")&&(c=Ea.parent()),c.wrap("<span "+(b.browser.mozilla?"":'contenteditable="false"')+'class="fr-img-caption '+Ea.attr("class")+'" style="'+(Ea.attr("style")?Ea.attr("style")+" ":"")+"width: "+Ea.width()+'px;" draggable="false"></span>'),c.wrap('<span class="fr-img-wrap"></span>'),c.after('<span class="fr-inner" contenteditable="true">'+a.FE.START_MARKER+"Image caption"+a.FE.END_MARKER+"</span>"),Ea.removeAttr("class").removeAttr("style").removeAttr("width"),ka(!0),b.selection.restore()):(c=Aa(),Ea.insertAfter(c),Ea.attr("class",c.attr("class").replace("fr-img-caption","")).attr("style",c.attr("style")),c.remove(),x(Ea))}var Ea,Fa,Ga,Ha,Ia=!1,Ja=1,Ka=2,La=3,Ma=4,Na=5,Oa=6,Pa=7,Qa=8,Ra={};Ra[Ja]="Image cannot be loaded from the passed link.",Ra[Ka]="No link in upload response.",Ra[La]="Error during file upload.",Ra[Ma]="Parsing response failed.",Ra[Na]="File is too large.",Ra[Oa]="Image file type is invalid.",Ra[Pa]="Files can be uploaded only to same domain in IE 8 and IE 9.",Ra[Qa]="Image file is corrupted.";var Sa,Ta,Ua=!1;return{_init:ca,showInsertPopup:d,showLayer:W,refreshUploadButton:X,refreshByURLButton:Y,upload:I,insertByURL:w,align:pa,refreshAlign:sa,refreshAlignOnShow:ta,display:ua,refreshDisplayOnShow:va,replace:wa,back:ya,get:za,getEl:Aa,insert:z,showProgressBar:s,remove:_,hideProgressBar:t,applyStyle:Ba,showAltPopup:P,showSizePopup:T,setAlt:R,setSize:V,toggleCaption:Da,hasCaption:Ca,exitEdit:ka,edit:x}},a.FE.DefineIcon("insertImage",{NAME:"image"}),a.FE.RegisterShortcut(a.FE.KEYCODE.P,"insertImage",null,"P"),a.FE.RegisterCommand("insertImage",{title:"Insert Image",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("image.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("image.insert")):this.image.showInsertPopup()},plugin:"image"}),a.FE.DefineIcon("imageUpload",{NAME:"upload"}),a.FE.RegisterCommand("imageUpload",{title:"Upload Image",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-upload")},refresh:function(a){this.image.refreshUploadButton(a)}}),a.FE.DefineIcon("imageByURL",{NAME:"link"}),a.FE.RegisterCommand("imageByURL",{title:"By URL",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-by-url")},refresh:function(a){this.image.refreshByURLButton(a)}}),a.FE.RegisterCommand("imageInsertByURL",{title:"Insert Image",undo:!0,refreshAfterCallback:!1,callback:function(){this.image.insertByURL()},refresh:function(a){var b=this.image.get();b?a.text(this.language.translate("Replace")):a.text(this.language.translate("Insert"))}}),a.FE.DefineIcon("imageDisplay",{NAME:"star"}),a.FE.RegisterCommand("imageDisplay",{title:"Display",type:"dropdown",options:{inline:"Inline",block:"Break Text"},callback:function(a,b){this.image.display(b)},refresh:function(a){this.opts.imageTextNear||a.addClass("fr-hidden")},refreshOnShow:function(a,b){this.image.refreshDisplayOnShow(a,b)}}),a.FE.DefineIcon("image-align",{NAME:"align-left"}),a.FE.DefineIcon("image-align-left",{NAME:"align-left"}),a.FE.DefineIcon("image-align-right",{NAME:"align-right"}),a.FE.DefineIcon("image-align-center",{NAME:"align-justify"}),a.FE.DefineIcon("imageAlign",{NAME:"align-justify"}),a.FE.RegisterCommand("imageAlign",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"None",right:"Align Right"},html:function(){var b='<ul class="fr-dropdown-list" role="presentation">',c=a.FE.COMMANDS.imageAlign.options;for(var d in c)c.hasOwnProperty(d)&&(b+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="imageAlign" data-param1="'+d+'" title="'+this.language.translate(c[d])+'">'+this.icon.create("image-align-"+d)+'<span class="fr-sr-only">'+this.language.translate(c[d])+"</span></a></li>");return b+="</ul>"},callback:function(a,b){this.image.align(b)},refresh:function(a){this.image.refreshAlign(a)},refreshOnShow:function(a,b){this.image.refreshAlignOnShow(a,b)}}),a.FE.DefineIcon("imageReplace",{NAME:"exchange"}),a.FE.RegisterCommand("imageReplace",{title:"Replace",undo:!1,focus:!1,popup:!0,refreshAfterCallback:!1,callback:function(){this.image.replace()}}),a.FE.DefineIcon("imageRemove",{NAME:"trash"}),a.FE.RegisterCommand("imageRemove",{title:"Remove",callback:function(){this.image.remove()}}),a.FE.DefineIcon("imageBack",{NAME:"arrow-left"}),a.FE.RegisterCommand("imageBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.image.back()},refresh:function(a){var b=this.image.get();b||this.opts.toolbarInline?(a.removeClass("fr-hidden"),a.next(".fr-separator").removeClass("fr-hidden")):(a.addClass("fr-hidden"),a.next(".fr-separator").addClass("fr-hidden"))}}),a.FE.RegisterCommand("imageDismissError",{title:"OK",undo:!1,callback:function(){this.image.hideProgressBar(!0)}}),a.FE.DefineIcon("imageStyle",{NAME:"magic"}),a.FE.RegisterCommand("imageStyle",{title:"Style",type:"dropdown",html:function(){var a='<ul class="fr-dropdown-list" role="presentation">',b=this.opts.imageStyles;for(var c in b)if(b.hasOwnProperty(c)){var d=b[c];"object"==typeof d&&(d=d.title),a+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="imageStyle" data-param1="'+c+'">'+this.language.translate(d)+"</a></li>"}return a+="</ul>"},callback:function(a,b){this.image.applyStyle(b)},refreshOnShow:function(b,c){var d=this.image.getEl();d&&c.find(".fr-command").each(function(){var b=a(this).data("param1"),c=d.hasClass(b);a(this).toggleClass("fr-active",c).attr("aria-selected",c)})}}),a.FE.DefineIcon("imageAlt",{NAME:"info"}),a.FE.RegisterCommand("imageAlt",{undo:!1,focus:!1,popup:!0,title:"Alternate Text",callback:function(){this.image.showAltPopup()}}),a.FE.RegisterCommand("imageSetAlt",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setAlt()}}),a.FE.DefineIcon("imageSize",{NAME:"arrows-alt"}),a.FE.RegisterCommand("imageSize",{undo:!1,focus:!1,popup:!0,title:"Change Size",callback:function(){this.image.showSizePopup()}}),a.FE.RegisterCommand("imageSetSize",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setSize()}}),a.FE.DefineIcon("imageCaption",{NAME:"commenting"}),a.FE.RegisterCommand("imageCaption",{undo:!0,focus:!1,title:"Image Caption",refreshAfterCallback:!0,callback:function(){this.image.toggleCaption()},refresh:function(a){this.image.get()&&a.toggleClass("fr-active",this.image.hasCaption())}})});
7
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c)}:a(window.jQuery)}(function(a){a.extend(a.FE.POPUP_TEMPLATES,{"image.insert":"[_BUTTONS_][_UPLOAD_LAYER_][_BY_URL_LAYER_][_PROGRESS_BAR_]","image.edit":"[_BUTTONS_]","image.alt":"[_BUTTONS_][_ALT_LAYER_]","image.size":"[_BUTTONS_][_SIZE_LAYER_]"}),a.extend(a.FE.DEFAULTS,{imageInsertButtons:["imageBack","|","imageUpload","imageByURL"],imageEditButtons:["imageReplace","imageAlign","imageCaption","imageRemove","|","imageLink","linkOpen","linkEdit","linkRemove","-","imageDisplay","imageStyle","imageAlt","imageSize"],imageAltButtons:["imageBack","|"],imageSizeButtons:["imageBack","|"],imageUpload:!0,imageUploadURL:"https://i.froala.com/upload",imageCORSProxy:"https://cors-anywhere.froala.com",imageUploadRemoteUrls:!0,imageUploadParam:"file",imageUploadParams:{},imageUploadToS3:!1,imageUploadMethod:"POST",imageMaxSize:10485760,imageAllowedTypes:["jpeg","jpg","png","gif"],imageResize:!0,imageResizeWithPercent:!1,imageRoundPercent:!1,imageDefaultWidth:300,imageDefaultAlign:"center",imageDefaultDisplay:"block",imageSplitHTML:!1,imageStyles:{"fr-rounded":"Rounded","fr-bordered":"Bordered","fr-shadow":"Shadow"},imageMove:!0,imageMultipleStyles:!0,imageTextNear:!0,imagePaste:!0,imagePasteProcess:!1,imageMinWidth:16,imageOutputSize:!1,imageDefaultMargin:5}),a.FE.PLUGINS.image=function(b){function c(){var a=b.popups.get("image.insert"),c=a.find(".fr-image-by-url-layer input");c.val(""),Ea&&c.val(Ea.attr("src")),c.trigger("change")}function d(){var a=b.$tb.find('.fr-command[data-cmd="insertImage"]'),c=b.popups.get("image.insert");if(c||(c=N()),t(),!c.hasClass("fr-active"))if(b.popups.refresh("image.insert"),b.popups.setContainer("image.insert",b.$tb),a.is(":visible")){var d=a.offset().left+a.outerWidth()/2,e=a.offset().top+(b.opts.toolbarBottom?10:a.outerHeight()-10);b.popups.show("image.insert",d,e,a.outerHeight())}else b.position.forSelection(c),b.popups.show("image.insert")}function e(){var a=b.popups.get("image.edit");if(a||(a=r()),a){var c=Aa();Ca()&&(c=c.find(".fr-img-wrap")),b.popups.setContainer("image.edit",b.$sc),b.popups.refresh("image.edit");var d=c.offset().left+c.outerWidth()/2,e=c.offset().top+c.outerHeight();b.popups.show("image.edit",d,e,c.outerHeight())}}function f(){t()}function g(a){a.parents(".fr-img-caption").length>0&&(a=a.parents(".fr-img-caption:first")),a.hasClass("fr-dii")||a.hasClass("fr-dib")||(a.addClass("fr-fi"+qa(a)[0]),a.addClass("fr-di"+ra(a)[0]),a.css("margin",""),a.css("float",""),a.css("display",""),a.css("z-index",""),a.css("position",""),a.css("overflow",""),a.css("vertical-align",""))}function h(a){a.parents(".fr-img-caption").length>0&&(a=a.parents(".fr-img-caption:first"));var b=a.hasClass("fr-dib")?"block":a.hasClass("fr-dii")?"inline":null,c=a.hasClass("fr-fil")?"left":a.hasClass("fr-fir")?"right":qa(a);oa(a,b,c),a.removeClass("fr-dib fr-dii fr-fir fr-fil")}function i(){for(var c="IMG"==b.el.tagName?[b.el]:b.el.querySelectorAll("img"),d=0;d<c.length;d++){var e=a(c[d]);!b.opts.htmlUntouched&&b.opts.useClasses?((b.opts.imageDefaultAlign||b.opts.imageDefaultDisplay)&&g(e),b.opts.imageTextNear||(e.parents(".fr-img-caption").length>0?e.parents(".fr-img-caption:first").removeClass("fr-dii").addClass("fr-dib"):e.removeClass("fr-dii").addClass("fr-dib"))):b.opts.htmlUntouched||b.opts.useClasses||(b.opts.imageDefaultAlign||b.opts.imageDefaultDisplay)&&h(e),b.opts.iframe&&e.on("load",b.size.syncIframe)}}function j(c){"undefined"==typeof c&&(c=!0);var d,e=Array.prototype.slice.call(b.el.querySelectorAll("img")),f=[];for(d=0;d<e.length;d++)if(f.push(e[d].getAttribute("src")),a(e[d]).toggleClass("fr-draggable",b.opts.imageMove),""===e[d].getAttribute("class")&&e[d].removeAttribute("class"),""===e[d].getAttribute("style")&&e[d].removeAttribute("style"),e[d].parentNode&&e[d].parentNode.parentNode&&b.node.hasClass(e[d].parentNode.parentNode,"fr-img-caption")){var g=e[d].parentNode.parentNode;b.browser.mozilla||g.setAttribute("contenteditable",!1),g.setAttribute("draggable",!1),g.classList.add("fr-draggable");var h=e[d].nextSibling;h&&h.setAttribute("contenteditable",!0)}if(Sa)for(d=0;d<Sa.length;d++)f.indexOf(Sa[d].getAttribute("src"))<0&&b.events.trigger("image.removed",[a(Sa[d])]);if(Sa&&c){var i=[];for(d=0;d<Sa.length;d++)i.push(Sa[d].getAttribute("src"));for(d=0;d<e.length;d++)i.indexOf(e[d].getAttribute("src"))<0&&b.events.trigger("image.loaded",[a(e[d])])}Sa=e}function k(){if(Fa||$(),!Ea)return!1;var a=b.$wp||b.$sc;a.append(Fa),Fa.data("instance",b);var c=a.scrollTop()-("static"!=a.css("position")?a.offset().top:0),d=a.scrollLeft()-("static"!=a.css("position")?a.offset().left:0);d-=b.helpers.getPX(a.css("border-left-width")),c-=b.helpers.getPX(a.css("border-top-width")),b.$el.is("img")&&b.$sc.is("body")&&(c=0,d=0);var e=Aa();Ca()&&(e=e.find(".fr-img-wrap")),Fa.css("top",(b.opts.iframe?e.offset().top:e.offset().top+c)-1).css("left",(b.opts.iframe?e.offset().left:e.offset().left+d)-1).css("width",e.get(0).getBoundingClientRect().width).css("height",e.get(0).getBoundingClientRect().height).addClass("fr-active")}function l(a){return'<div class="fr-handler fr-h'+a+'"></div>'}function m(a){Ca()?Ea.parents(".fr-img-caption").css("width",a):Ea.css("width",a)}function n(c){if(!b.core.sameInstance(Fa))return!0;if(c.preventDefault(),c.stopPropagation(),b.$el.find("img.fr-error").left)return!1;b.undo.canDo()||b.undo.saveStep();var d=c.pageX||c.originalEvent.touches[0].pageX;if("mousedown"==c.type){var e=b.$oel.get(0),f=e.ownerDocument,g=f.defaultView||f.parentWindow,h=!1;try{h=g.location!=g.parent.location&&!(g.$&&g.$.FE)}catch(i){}h&&g.frameElement&&(d+=b.helpers.getPX(a(g.frameElement).offset().left)+g.frameElement.clientLeft)}Ga=a(this),Ga.data("start-x",d),Ga.data("start-width",Ea.width()),Ga.data("start-height",Ea.height());var j=Ea.width();if(b.opts.imageResizeWithPercent){var k=Ea.parentsUntil(b.$el,b.html.blockTagsQuery()).get(0)||b.el;j=(j/a(k).outerWidth()*100).toFixed(2)+"%"}m(j),Ha.show(),b.popups.hideAll(),ma()}function o(c){if(!b.core.sameInstance(Fa))return!0;var d;if(Ga&&Ea){if(c.preventDefault(),b.$el.find("img.fr-error").left)return!1;var e=c.pageX||(c.originalEvent.touches?c.originalEvent.touches[0].pageX:null);if(!e)return!1;var f=Ga.data("start-x"),g=e-f,h=Ga.data("start-width");if((Ga.hasClass("fr-hnw")||Ga.hasClass("fr-hsw"))&&(g=0-g),b.opts.imageResizeWithPercent){var i=Ea.parentsUntil(b.$el,b.html.blockTagsQuery()).get(0)||b.el;h=((h+g)/a(i).outerWidth()*100).toFixed(2),b.opts.imageRoundPercent&&(h=Math.round(h)),m(h+"%"),d=Ca()?(b.helpers.getPX(Ea.parents(".fr-img-caption").css("width"))/a(i).outerWidth()*100).toFixed(2):(b.helpers.getPX(Ea.css("width"))/a(i).outerWidth()*100).toFixed(2),d===h||b.opts.imageRoundPercent||m(d+"%"),Ea.css("height","").removeAttr("height")}else h+g>=b.opts.imageMinWidth&&(m(h+g),d=Ca()?b.helpers.getPX(Ea.parents(".fr-img-caption").css("width")):b.helpers.getPX(Ea.css("width"))),d!==h+g&&m(d),((Ea.attr("style")||"").match(/(^height:)|(; *height:)/)||Ea.attr("height"))&&(Ea.css("height",Ga.data("start-height")*Ea.width()/Ga.data("start-width")),Ea.removeAttr("height"));k(),b.events.trigger("image.resize",[za()])}}function p(a){if(!b.core.sameInstance(Fa))return!0;if(Ga&&Ea){if(a&&a.stopPropagation(),b.$el.find("img.fr-error").left)return!1;Ga=null,Ha.hide(),k(),e(),b.undo.saveStep(),b.events.trigger("image.resizeEnd",[za()])}}function q(a,c,d){b.edit.on(),Ea&&Ea.addClass("fr-error"),v(b.language.translate("Something went wrong. Please try again.")),!Ea&&d&&_(d),b.events.trigger("image.error",[{code:a,message:Ra[a]},c,d])}function r(a){if(a)return b.$wp&&b.events.$on(b.$wp,"scroll",function(){Ea&&b.popups.isVisible("image.edit")&&(b.events.disableBlur(),x(Ea))}),!0;var c="";if(b.opts.imageEditButtons.length>0){c+='<div class="fr-buttons">',c+=b.button.buildList(b.opts.imageEditButtons),c+="</div>";var d={buttons:c},e=b.popups.create("image.edit",d);return e}return!1}function s(a){var c=b.popups.get("image.insert");if(c||(c=N()),c.find(".fr-layer.fr-active").removeClass("fr-active").addClass("fr-pactive"),c.find(".fr-image-progress-bar-layer").addClass("fr-active"),c.find(".fr-buttons").hide(),Ea){var d=Aa();b.popups.setContainer("image.insert",b.$sc);var e=d.offset().left+d.width()/2,f=d.offset().top+d.height();b.popups.show("image.insert",e,f,d.outerHeight())}"undefined"==typeof a&&u(b.language.translate("Uploading"),0)}function t(a){var c=b.popups.get("image.insert");if(c&&(c.find(".fr-layer.fr-pactive").addClass("fr-active").removeClass("fr-pactive"),c.find(".fr-image-progress-bar-layer").removeClass("fr-active"),c.find(".fr-buttons").show(),a||b.$el.find("img.fr-error").length)){if(b.events.focus(),b.$el.find("img.fr-error").length&&(b.$el.find("img.fr-error").remove(),b.undo.saveStep(),b.undo.run(),b.undo.dropRedo()),!b.$wp&&Ea){var d=Ea;ka(!0),b.selection.setAfter(d.get(0)),b.selection.restore()}b.popups.hide("image.insert")}}function u(a,c){var d=b.popups.get("image.insert");if(d){var e=d.find(".fr-image-progress-bar-layer");e.find("h3").text(a+(c?" "+c+"%":"")),e.removeClass("fr-error"),c?(e.find("div").removeClass("fr-indeterminate"),e.find("div > span").css("width",c+"%")):e.find("div").addClass("fr-indeterminate")}}function v(a){s();var c=b.popups.get("image.insert"),d=c.find(".fr-image-progress-bar-layer");d.addClass("fr-error");var e=d.find("h3");e.text(a),b.events.disableBlur(),e.focus()}function w(){var a=b.popups.get("image.insert"),c=a.find(".fr-image-by-url-layer input");if(c.val().length>0){s(),u(b.language.translate("Loading image"));var d=c.val();if(b.opts.imageUploadRemoteUrls&&b.opts.imageCORSProxy&&b.opts.imageUpload){var e=new XMLHttpRequest;e.responseType="blob",e.onload=function(){200==this.status?I([new Blob([this.response],{type:this.response.type||"image/png"})],Ea):q(Ja)},e.onerror=function(){z(d,!0,[],Ea)},e.open("GET",b.opts.imageCORSProxy+"/"+d,!0),e.send()}else z(d,!0,[],Ea);c.val(""),c.blur()}}function x(a){ja.call(a.get(0))}function y(){var c=a(this);b.popups.hide("image.insert"),c.removeClass("fr-uploading"),c.next().is("br")&&c.next().remove(),x(c),b.events.trigger("image.loaded",[c])}function z(a,c,d,e,f){b.edit.off(),u(b.language.translate("Loading image")),c&&(a=b.helpers.sanitizeURL(a));var g=new Image;g.onload=function(){var c,g;if(e){b.undo.canDo()||e.hasClass("fr-uploading")||b.undo.saveStep();var h=e.data("fr-old-src");e.data("fr-image-pasted")&&(h=null),b.$wp?(c=e.clone().removeData("fr-old-src").removeClass("fr-uploading").removeAttr("data-fr-image-pasted"),c.off("load"),h&&e.attr("src",h),e.replaceWith(c)):c=e;for(var i=c.get(0).attributes,k=0;k<i.length;k++){var l=i[k];0===l.nodeName.indexOf("data-")&&c.removeAttr(l.nodeName)}if("undefined"!=typeof d)for(g in d)d.hasOwnProperty(g)&&"link"!=g&&c.attr("data-"+g,d[g]);c.on("load",y),c.attr("src",a),b.edit.on(),j(!1),b.undo.saveStep(),b.events.disableBlur(),b.$el.blur(),b.events.trigger(h?"image.replaced":"image.inserted",[c,f])}else c=F(a,d,y),j(!1),b.undo.saveStep(),b.$el.blur(),b.events.trigger("image.inserted",[c,f])},g.onerror=function(){q(Ja)},s(b.language.translate("Loading image")),g.src=a}function A(a){try{if(b.events.trigger("image.uploaded",[a],!0)===!1)return b.edit.on(),!1;var c=JSON.parse(a);return c.link?c:(q(Ka,a),!1)}catch(d){return q(Ma,a),!1}}function B(c){try{var d=a(c).find("Location").text(),e=a(c).find("Key").text();return b.events.trigger("image.uploadedToS3",[d,e,c],!0)===!1?(b.edit.on(),!1):d}catch(f){return q(Ma,c),!1}}function C(a){u(b.language.translate("Loading image"));var c=this.status,d=this.response,e=this.responseXML,f=this.responseText;try{if(b.opts.imageUploadToS3)if(201==c){var g=B(e);g&&z(g,!1,[],a,d||e)}else q(Ma,d||e,a);else if(c>=200&&300>c){var h=A(f);h&&z(h.link,!1,h,a,d||f)}else q(La,d||f,a)}catch(i){q(Ma,d||f,a)}}function D(){q(Ma,this.response||this.responseText||this.responseXML)}function E(a){if(a.lengthComputable){var c=a.loaded/a.total*100|0;u(b.language.translate("Uploading"),c)}}function F(c,d,e){var f,g="";if(d&&"undefined"!=typeof d)for(f in d)d.hasOwnProperty(f)&&"link"!=f&&(g+=" data-"+f+'="'+d[f]+'"');var h=b.opts.imageDefaultWidth;h&&"auto"!=h&&(h+=b.opts.imageResizeWithPercent?"%":"px");var i=a('<img src="'+c+'"'+g+(h?' style="width: '+h+';"':"")+">");oa(i,b.opts.imageDefaultDisplay,b.opts.imageDefaultAlign),i.on("load",e),i.on("error",function(){a(this).addClass("fr-error"),q(Qa)}),b.edit.on(),b.events.focus(!0),b.selection.restore(),b.undo.saveStep(),b.opts.imageSplitHTML?b.markers.split():b.markers.insert(),b.html.wrap();var j=b.$el.find(".fr-marker");return j.length?(j.parent().is("hr")&&j.parent().after(j),b.node.isLastSibling(j)&&j.parent().hasClass("fr-deletable")&&j.insertAfter(j.parent()),j.replaceWith(i)):b.$el.append(i),b.selection.clear(),i}function G(){b.edit.on(),t(!0)}function H(c,d,e,f){function g(){var e=a(this);e.off("load"),e.addClass("fr-uploading"),e.next().is("br")&&e.next().remove(),b.placeholder.refresh(),x(e),k(),s(),b.edit.off(),c.onload=function(){C.call(c,e)},c.onerror=D,c.upload.onprogress=E,c.onabort=G,e.off("abortUpload").on("abortUpload",function(){4!=c.readyState&&c.abort()}),c.send(d)}var h,i=new FileReader;i.addEventListener("load",function(){var a=i.result;if(i.result.indexOf("svg+xml")<0){for(var c=atob(i.result.split(",")[1]),d=[],e=0;e<c.length;e++)d.push(c.charCodeAt(e));a=window.URL.createObjectURL(new Blob([new Uint8Array(d)],{type:"image/jpeg"}))}f?(f.on("load",g),f.one("error",function(){f.off("load"),f.attr("src",f.data("fr-old-src")),q(Qa)}),b.edit.on(),b.undo.saveStep(),f.data("fr-old-src",f.attr("src")),f.attr("src",a)):h=F(a,null,g)},!1),i.readAsDataURL(e)}function I(a,c){if("undefined"!=typeof a&&a.length>0){if(b.events.trigger("image.beforeUpload",[a,c])===!1)return!1;var d=a[0];if(d.name||(d.name=(new Date).getTime()+".jpg"),d.size>b.opts.imageMaxSize)return q(Na),!1;if(b.opts.imageAllowedTypes.indexOf(d.type.replace(/image\//g,""))<0)return q(Oa),!1;var e;if(b.drag_support.formdata&&(e=b.drag_support.formdata?new FormData:null),e){var f;if(b.opts.imageUploadToS3!==!1){e.append("key",b.opts.imageUploadToS3.keyStart+(new Date).getTime()+"-"+(d.name||"untitled")),e.append("success_action_status","201"),e.append("X-Requested-With","xhr"),e.append("Content-Type",d.type);for(f in b.opts.imageUploadToS3.params)b.opts.imageUploadToS3.params.hasOwnProperty(f)&&e.append(f,b.opts.imageUploadToS3.params[f])}for(f in b.opts.imageUploadParams)b.opts.imageUploadParams.hasOwnProperty(f)&&e.append(f,b.opts.imageUploadParams[f]);e.append(b.opts.imageUploadParam,d,d.name);var g=b.opts.imageUploadURL;b.opts.imageUploadToS3&&(g=b.opts.imageUploadToS3.uploadURL?b.opts.imageUploadToS3.uploadURL:"https://"+b.opts.imageUploadToS3.region+".amazonaws.com/"+b.opts.imageUploadToS3.bucket);var h=b.core.getXHR(g,b.opts.imageUploadMethod);H(h,e,d,c||Ea)}}}function J(c){b.events.$on(c,"dragover dragenter",".fr-image-upload-layer",function(){return a(this).addClass("fr-drop"),!1},!0),b.events.$on(c,"dragleave dragend",".fr-image-upload-layer",function(){return a(this).removeClass("fr-drop"),!1},!0),b.events.$on(c,"drop",".fr-image-upload-layer",function(d){d.preventDefault(),d.stopPropagation(),a(this).removeClass("fr-drop");var e=d.originalEvent.dataTransfer;if(e&&e.files){var f=c.data("instance")||b;f.events.disableBlur(),f.image.upload(e.files),f.events.enableBlur()}},!0),b.helpers.isIOS()&&b.events.$on(c,"touchstart",'.fr-image-upload-layer input[type="file"]',function(){a(this).trigger("click")},!0),b.events.$on(c,"change",'.fr-image-upload-layer input[type="file"]',function(){if(this.files){var d=c.data("instance")||b;d.events.disableBlur(),c.find("input:focus").blur(),d.events.enableBlur(),d.image.upload(this.files,Ea)}a(this).val("")},!0)}function K(a){return a.is("img")&&a.parents(".fr-img-caption").length>0?a.parents(".fr-img-caption"):void 0}function L(c){var d=c.originalEvent.dataTransfer;if(d&&d.files&&d.files.length){var e=d.files[0];if(e&&e.type&&-1!==e.type.indexOf("image")&&b.opts.imageAllowedTypes.indexOf(e.type.replace(/image\//g,""))>=0){if(!b.opts.imageUpload)return c.preventDefault(),c.stopPropagation(),!1;b.markers.remove(),b.markers.insertAtPoint(c.originalEvent),b.$el.find(".fr-marker").replaceWith(a.FE.MARKERS),0===b.$el.find(".fr-marker").length&&b.selection.setAtEnd(b.el),b.popups.hideAll();var f=b.popups.get("image.insert");f||(f=N()),b.popups.setContainer("image.insert",b.$sc);var g=c.originalEvent.pageX,h=c.originalEvent.pageY;return b.opts.iframe&&(h+=b.$iframe.offset().top,g+=b.$iframe.offset().left),b.popups.show("image.insert",g,h),s(),b.opts.imageAllowedTypes.indexOf(e.type.replace(/image\//g,""))>=0?(ka(!0),I(d.files)):q(Oa),c.preventDefault(),c.stopPropagation(),!1}}}function M(){b.events.$on(b.$el,b._mousedown,"IMG"==b.el.tagName?null:'img:not([contenteditable="false"])',function(c){return"false"==a(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable")?!0:(b.helpers.isMobile()||b.selection.clear(),Ia=!0,b.popups.areVisible()&&b.events.disableBlur(),b.browser.msie&&(b.events.disableBlur(),b.$el.attr("contenteditable",!1)),b.draggable||"touchstart"==c.type||c.preventDefault(),void c.stopPropagation())}),b.events.$on(b.$el,b._mouseup,"IMG"==b.el.tagName?null:'img:not([contenteditable="false"])',function(c){return"false"==a(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable")?!0:void(Ia&&(Ia=!1,c.stopPropagation(),b.browser.msie&&(b.$el.attr("contenteditable",!0),b.events.enableBlur())))}),b.events.on("keyup",function(c){if(c.shiftKey&&""===b.selection.text().replace(/\n/g,"")&&b.keys.isArrow(c.which)){var d=b.selection.element(),e=b.selection.endElement();d&&"IMG"==d.tagName?x(a(d)):e&&"IMG"==e.tagName&&x(a(e))}},!0),b.events.on("drop",L),b.events.on("element.beforeDrop",K),b.events.on("mousedown window.mousedown",la),b.events.on("window.touchmove",ma),b.events.on("mouseup window.mouseup",function(){return Ea?(ka(),!1):void ma()}),b.events.on("commands.mousedown",function(a){a.parents(".fr-toolbar").length>0&&ka()}),b.events.on("blur image.hideResizer commands.undo commands.redo element.dropped",function(){Ia=!1,ka(!0)}),b.events.on("modals.hide",function(){Ea&&(xa(),b.selection.clear())})}function N(a){if(a)return b.popups.onRefresh("image.insert",c),b.popups.onHide("image.insert",f),!0;var d,e="";b.opts.imageUpload||b.opts.imageInsertButtons.splice(b.opts.imageInsertButtons.indexOf("imageUpload"),1),b.opts.imageInsertButtons.length>1&&(e='<div class="fr-buttons">'+b.button.buildList(b.opts.imageInsertButtons)+"</div>");var g=b.opts.imageInsertButtons.indexOf("imageUpload"),h=b.opts.imageInsertButtons.indexOf("imageByURL"),i="";g>=0&&(d=" fr-active",h>=0&&g>h&&(d=""),i='<div class="fr-image-upload-layer'+d+' fr-layer" id="fr-image-upload-layer-'+b.id+'"><strong>'+b.language.translate("Drop image")+"</strong><br>("+b.language.translate("or click")+')<div class="fr-form"><input type="file" accept="image/'+b.opts.imageAllowedTypes.join(", image/").toLowerCase()+'" tabIndex="-1" aria-labelledby="fr-image-upload-layer-'+b.id+'" role="button"></div></div>');var j="";h>=0&&(d=" fr-active",g>=0&&h>g&&(d=""),j='<div class="fr-image-by-url-layer'+d+' fr-layer" id="fr-image-by-url-layer-'+b.id+'"><div class="fr-input-line"><input id="fr-image-by-url-layer-text-'+b.id+'" type="text" placeholder="http://" tabIndex="1" aria-required="true"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageInsertByURL" tabIndex="2" role="button">'+b.language.translate("Insert")+"</button></div></div>");var k='<div class="fr-image-progress-bar-layer fr-layer"><h3 tabIndex="-1" class="fr-message">Uploading</h3><div class="fr-loader"><span class="fr-progress"></span></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-dismiss" data-cmd="imageDismissError" tabIndex="2" role="button">OK</button></div></div>',l={buttons:e,upload_layer:i,by_url_layer:j,progress_bar:k},m=b.popups.create("image.insert",l);return b.$wp&&b.events.$on(b.$wp,"scroll",function(){Ea&&b.popups.isVisible("image.insert")&&wa()}),J(m),m}function O(){if(Ea){var a=b.popups.get("image.alt");a.find("input").val(Ea.attr("alt")||"").trigger("change")}}function P(){var a=b.popups.get("image.alt");a||(a=Q()),t(),b.popups.refresh("image.alt"),b.popups.setContainer("image.alt",b.$sc);var c=Aa();Ca()&&(c=c.find(".fr-img-wrap"));var d=c.offset().left+c.outerWidth()/2,e=c.offset().top+c.outerHeight();b.popups.show("image.alt",d,e,c.outerHeight())}function Q(a){if(a)return b.popups.onRefresh("image.alt",O),!0;var c="";c='<div class="fr-buttons">'+b.button.buildList(b.opts.imageAltButtons)+"</div>";var d="";d='<div class="fr-image-alt-layer fr-layer fr-active" id="fr-image-alt-layer-'+b.id+'"><div class="fr-input-line"><input id="fr-image-alt-layer-text-'+b.id+'" type="text" placeholder="'+b.language.translate("Alternate Text")+'" tabIndex="1"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetAlt" tabIndex="2" role="button">'+b.language.translate("Update")+"</button></div></div>";var e={buttons:c,alt_layer:d},f=b.popups.create("image.alt",e);return b.$wp&&b.events.$on(b.$wp,"scroll.image-alt",function(){Ea&&b.popups.isVisible("image.alt")&&P()}),f}function R(a){if(Ea){var c=b.popups.get("image.alt");Ea.attr("alt",a||c.find("input").val()||""),c.find("input:focus").blur(),x(Ea)}}function S(){if(Ea){var a=b.popups.get("image.size");a.find('input[name="width"]').val(Ea.get(0).style.width).trigger("change"),a.find('input[name="height"]').val(Ea.get(0).style.height).trigger("change")}}function T(){var a=b.popups.get("image.size");a||(a=U()),t(),b.popups.refresh("image.size"),b.popups.setContainer("image.size",b.$sc);var c=Aa();Ca()&&(c=c.find(".fr-img-wrap"));var d=c.offset().left+c.outerWidth()/2,e=c.offset().top+c.outerHeight();b.popups.show("image.size",d,e,c.outerHeight())}function U(a){if(a)return b.popups.onRefresh("image.size",S),!0;var c="";c='<div class="fr-buttons">'+b.button.buildList(b.opts.imageSizeButtons)+"</div>";var d="";d='<div class="fr-image-size-layer fr-layer fr-active" id="fr-image-size-layer-'+b.id+'"><div class="fr-image-group"><div class="fr-input-line"><input id="fr-image-size-layer-width-'+b.id+'" type="text" name="width" placeholder="'+b.language.translate("Width")+'" tabIndex="1"></div><div class="fr-input-line"><input id="fr-image-size-layer-height'+b.id+'" type="text" name="height" placeholder="'+b.language.translate("Height")+'" tabIndex="1"></div></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="imageSetSize" tabIndex="2" role="button">'+b.language.translate("Update")+"</button></div></div>";var e={buttons:c,size_layer:d},f=b.popups.create("image.size",e);return b.$wp&&b.events.$on(b.$wp,"scroll.image-size",function(){Ea&&b.popups.isVisible("image.size")&&T()}),f}function V(a,c){if(Ea){var d=b.popups.get("image.size");a=a||d.find('input[name="width"]').val()||"",c=c||d.find('input[name="height"]').val()||"";var e=/^[\d]+((px)|%)*$/g;Ea.removeAttr("width").removeAttr("height"),a.match(e)?Ea.css("width",a):Ea.css("width",""),c.match(e)?Ea.css("height",c):Ea.css("height",""),Ca()&&(Ea.parent().removeAttr("width").removeAttr("height"),a.match(e)?Ea.parent().css("width",a):Ea.parent().css("width",""),c.match(e)?Ea.parent().css("height",c):Ea.parent().css("height","")),d.find("input:focus").blur(),x(Ea)}}function W(a){var c,d,e=b.popups.get("image.insert");if(Ea||b.opts.toolbarInline){if(Ea){var f=Aa();Ca()&&(f=f.find(".fr-img-wrap")),d=f.offset().top+f.outerHeight(),c=f.offset().left+f.outerWidth()/2}}else{var g=b.$tb.find('.fr-command[data-cmd="insertImage"]');c=g.offset().left+g.outerWidth()/2,d=g.offset().top+(b.opts.toolbarBottom?10:g.outerHeight()-10)}!Ea&&b.opts.toolbarInline&&(d=e.offset().top-b.helpers.getPX(e.css("margin-top")),e.hasClass("fr-above")&&(d+=e.outerHeight())),e.find(".fr-layer").removeClass("fr-active"),e.find(".fr-"+a+"-layer").addClass("fr-active"),b.popups.show("image.insert",c,d,Ea?Ea.outerHeight():0),b.accessibility.focusPopup(e)}function X(a){var c=b.popups.get("image.insert");c.find(".fr-image-upload-layer").hasClass("fr-active")&&a.addClass("fr-active").attr("aria-pressed",!0)}function Y(a){var c=b.popups.get("image.insert");c.find(".fr-image-by-url-layer").hasClass("fr-active")&&a.addClass("fr-active").attr("aria-pressed",!0)}function Z(a,b,c,d){return a.pageX=b,n.call(this,a),a.pageX=a.pageX+c*Math.floor(Math.pow(1.1,d)),o.call(this,a),p.call(this,a),++d}function $(){var c;if(b.shared.$image_resizer?(Fa=b.shared.$image_resizer,Ha=b.shared.$img_overlay,b.events.on("destroy",function(){Fa.removeClass("fr-active").appendTo(a("body:first"))},!0)):(b.shared.$image_resizer=a('<div class="fr-image-resizer"></div>'),Fa=b.shared.$image_resizer,b.events.$on(Fa,"mousedown",function(a){a.stopPropagation()},!0),b.opts.imageResize&&(Fa.append(l("nw")+l("ne")+l("sw")+l("se")),b.shared.$img_overlay=a('<div class="fr-image-overlay"></div>'),Ha=b.shared.$img_overlay,c=Fa.get(0).ownerDocument,a(c).find("body:first").append(Ha))),b.events.on("shared.destroy",function(){Fa.html("").removeData().remove(),Fa=null,b.opts.imageResize&&(Ha.remove(),Ha=null)},!0),b.helpers.isMobile()||b.events.$on(a(b.o_win),"resize",function(){Ea&&!Ea.hasClass("fr-uploading")?ka(!0):Ea&&(k(),wa(),s(!1))}),b.opts.imageResize){c=Fa.get(0).ownerDocument,b.events.$on(Fa,b._mousedown,".fr-handler",n),b.events.$on(a(c),b._mousemove,o),b.events.$on(a(c.defaultView||c.parentWindow),b._mouseup,p),b.events.$on(Ha,"mouseleave",p);var d=1,e=null,f=0;b.events.on("keydown",function(c){if(Ea){var g=-1!=navigator.userAgent.indexOf("Mac OS X")?c.metaKey:c.ctrlKey,h=c.which;(h!==e||c.timeStamp-f>200)&&(d=1),(h==a.FE.KEYCODE.EQUALS||b.browser.mozilla&&h==a.FE.KEYCODE.FF_EQUALS)&&g&&!c.altKey?d=Z.call(this,c,1,1,d):(h==a.FE.KEYCODE.HYPHEN||b.browser.mozilla&&h==a.FE.KEYCODE.FF_HYPHEN)&&g&&!c.altKey?d=Z.call(this,c,2,-1,d):b.keys.ctrlKey(c)||h!=a.FE.KEYCODE.ENTER||(Ea.before("<br>"),x(Ea)),e=h,f=c.timeStamp}},!0),b.events.on("keyup",function(){d=1})}}function _(c){c=c||Aa(),c&&b.events.trigger("image.beforeRemove",[c])!==!1&&(b.popups.hideAll(),xa(),ka(!0),b.undo.canDo()||b.undo.saveStep(),c.get(0)==b.el?c.removeAttr("src"):("A"==c.get(0).parentNode.tagName?(b.selection.setBefore(c.get(0).parentNode)||b.selection.setAfter(c.get(0).parentNode)||c.parent().after(a.FE.MARKERS),a(c.get(0).parentNode).remove()):(b.selection.setBefore(c.get(0))||b.selection.setAfter(c.get(0))||c.after(a.FE.MARKERS),c.remove()),b.html.fillEmptyBlocks(),b.selection.restore()),b.undo.saveStep())}function aa(c){var d=c.which;if(Ea&&(d==a.FE.KEYCODE.BACKSPACE||d==a.FE.KEYCODE.DELETE))return c.preventDefault(),c.stopPropagation(),_(),!1;if(Ea&&d==a.FE.KEYCODE.ESC){var e=Ea;return ka(!0),b.selection.setAfter(e.get(0)),b.selection.restore(),c.preventDefault(),!1}if(Ea&&(d==a.FE.KEYCODE.ARROW_LEFT||d==a.FE.KEYCODE.ARROW_RIGHT)){var f=Ea.get(0);return ka(!0),d==a.FE.KEYCODE.ARROW_LEFT?b.selection.setBefore(f):b.selection.setAfter(f),b.selection.restore(),c.preventDefault(),!1}return Ea&&d!=a.FE.KEYCODE.F10&&!b.keys.isBrowserAction(c)?(c.preventDefault(),c.stopPropagation(),!1):void 0}function ba(a){if(a&&"IMG"==a.tagName){if(b.node.hasClass(a,"fr-uploading")||b.node.hasClass(a,"fr-error")?a.parentNode.removeChild(a):b.node.hasClass(a,"fr-draggable")&&a.classList.remove("fr-draggable"),a.parentNode&&a.parentNode.parentNode&&b.node.hasClass(a.parentNode.parentNode,"fr-img-caption")){var c=a.parentNode.parentNode;c.removeAttribute("contenteditable"),c.removeAttribute("draggable"),c.classList.remove("fr-draggable");var d=a.nextSibling;d&&d.removeAttribute("contenteditable")}}else if(a&&a.nodeType==Node.ELEMENT_NODE)for(var e=a.querySelectorAll("img.fr-uploading, img.fr-error, img.fr-draggable"),f=0;f<e.length;f++)ba(e[f])}function ca(){if(M(),"IMG"==b.el.tagName&&b.$el.addClass("fr-view"),b.events.$on(b.$el,b.helpers.isMobile()&&!b.helpers.isWindowsPhone()?"touchend":"click","IMG"==b.el.tagName?null:'img:not([contenteditable="false"])',ja),b.helpers.isMobile()&&(b.events.$on(b.$el,"touchstart","IMG"==b.el.tagName?null:'img:not([contenteditable="false"])',function(){Ta=!1}),b.events.$on(b.$el,"touchmove",function(){Ta=!0})),b.$wp?(b.events.on("window.keydown keydown",aa,!0),b.events.on("keyup",function(b){return Ea&&b.which==a.FE.KEYCODE.ENTER?!1:void 0},!0)):b.events.$on(b.$win,"keydown",aa),b.events.on("toolbar.esc",function(){if(Ea){if(b.$wp)b.events.disableBlur(),b.events.focus();else{var a=Ea;ka(!0),b.selection.setAfter(a.get(0)),b.selection.restore()}return!1}},!0),b.events.on("toolbar.focusEditor",function(){return Ea?!1:void 0},!0),b.events.on("window.cut window.copy",function(c){if(Ea&&b.popups.isVisible("image.edit")&&!b.popups.get("image.edit").find(":focus").length){var d=Aa();Ca()?(d.before(a.FE.START_MARKER),d.after(a.FE.END_MARKER),b.selection.restore(),b.paste.saveCopiedText(d.get(0).outerHTML,d.text())):(xa(),b.paste.saveCopiedText(Ea.get(0).outerHTML,Ea.attr("alt"))),"copy"==c.type?setTimeout(function(){x(Ea)}):(ka(!0),b.undo.saveStep(),setTimeout(function(){b.undo.saveStep()},0))}},!0),b.browser.msie&&b.events.on("keydown",function(c){if(!b.selection.isCollapsed()||!Ea)return!0;var d=c.which;d==a.FE.KEYCODE.C&&b.keys.ctrlKey(c)?b.events.trigger("window.copy"):d==a.FE.KEYCODE.X&&b.keys.ctrlKey(c)&&b.events.trigger("window.cut")}),b.events.$on(a(b.o_win),"keydown",function(b){var c=b.which;return Ea&&c==a.FE.KEYCODE.BACKSPACE?(b.preventDefault(),!1):void 0}),b.events.$on(b.$win,"keydown",function(b){var c=b.which;Ea&&Ea.hasClass("fr-uploading")&&c==a.FE.KEYCODE.ESC&&Ea.trigger("abortUpload")}),b.events.on("destroy",function(){Ea&&Ea.hasClass("fr-uploading")&&Ea.trigger("abortUpload")}),b.events.on("paste.before",ha),b.events.on("paste.beforeCleanup",ia),b.events.on("paste.after",ea),b.events.on("html.set",i),b.events.on("html.inserted",i),i(),b.events.on("destroy",function(){Sa=[]}),b.events.on("html.processGet",ba),b.opts.imageOutputSize){var c;b.events.on("html.beforeGet",function(){c=b.el.querySelectorAll("img");for(var d=0;d<c.length;d++){var e=c[d].style.width||a(c[d]).width(),f=c[d].style.height||a(c[d]).height();e&&c[d].setAttribute("width",(""+e).replace(/px/,"")),f&&c[d].setAttribute("height",(""+f).replace(/px/,""))}})}b.opts.iframe&&b.events.on("image.loaded",b.size.syncIframe),b.$wp&&(j(),b.events.on("contentChanged",j)),b.events.$on(a(b.o_win),"orientationchange.image",function(){setTimeout(function(){Ea&&x(Ea)},100)}),r(!0),N(!0),U(!0),Q(!0),b.events.on("node.remove",function(a){return"IMG"==a.get(0).tagName?(_(a),!1):void 0})}function da(c){if(b.events.trigger("image.beforePasteUpload",[c])===!1)return!1;Ea=a(c),k(),e(),wa(),s();for(var d=atob(a(c).attr("src").split(",")[1]),f=[],g=0;g<d.length;g++)f.push(d.charCodeAt(g));var h=new Blob([new Uint8Array(f)],{type:"image/jpeg"});I([h],Ea)}function ea(){b.opts.imagePaste?b.$el.find("img[data-fr-image-pasted]").each(function(c,d){if(b.opts.imagePasteProcess){var e=b.opts.imageDefaultWidth;e&&"auto"!=e&&(e+=b.opts.imageResizeWithPercent?"%":"px"),a(d).css("width",e).removeClass("fr-dii fr-dib fr-fir fr-fil"),oa(a(d),b.opts.imageDefaultDisplay,b.opts.imageDefaultAlign)}if(0===d.src.indexOf("data:"))da(d);else if(0===d.src.indexOf("blob:")||0===d.src.indexOf("http")&&b.opts.imageUploadRemoteUrls&&b.opts.imageCORSProxy){var f=new Image;f.crossOrigin="Anonymous",f.onload=function(){var a=b.o_doc.createElement("CANVAS"),c=a.getContext("2d");a.height=this.naturalHeight,a.width=this.naturalWidth,c.drawImage(this,0,0),d.src=a.toDataURL("image/png"),da(d)},f.src=(0===d.src.indexOf("blob:")?"":b.opts.imageCORSProxy+"/")+d.src}else 0!==d.src.indexOf("http")||0===d.src.indexOf("https://mail.google.com/mail")?(b.selection.save(),
8
+ a(d).remove(),b.selection.restore()):a(d).removeAttr("data-fr-image-pasted")}):b.$el.find("img[data-fr-image-pasted]").remove()}function fa(a){var c=a.target.result,d=b.opts.imageDefaultWidth;d&&"auto"!=d&&(d+=b.opts.imageResizeWithPercent?"%":"px"),b.undo.saveStep(),b.html.insert('<img data-fr-image-pasted="true" src="'+c+'"'+(d?' style="width: '+d+';"':"")+">");var e=b.$el.find('img[data-fr-image-pasted="true"]');e&&oa(e,b.opts.imageDefaultDisplay,b.opts.imageDefaultAlign),b.events.trigger("paste.after")}function ga(a){var b=new FileReader;b.onload=fa,b.readAsDataURL(a)}function ha(a){if(a&&a.clipboardData&&a.clipboardData.items){var b=null;if(a.clipboardData.getData("text/rtf"))b=a.clipboardData.items[0].getAsFile();else for(var c=0;c<a.clipboardData.items.length&&!(b=a.clipboardData.items[c].getAsFile());c++);if(b)return ga(b),!1}}function ia(a){return a=a.replace(/<img /gi,'<img data-fr-image-pasted="true" ')}function ja(c){if("false"==a(this).parents("[contenteditable]:not(.fr-element):not(.fr-img-caption):not(body):first").attr("contenteditable"))return!0;if(c&&"touchend"==c.type&&Ta)return!0;if(c&&b.edit.isDisabled())return c.stopPropagation(),c.preventDefault(),!1;for(var d=0;d<a.FE.INSTANCES.length;d++)a.FE.INSTANCES[d]!=b&&a.FE.INSTANCES[d].events.trigger("image.hideResizer");b.toolbar.disable(),c&&(c.stopPropagation(),c.preventDefault()),b.helpers.isMobile()&&(b.events.disableBlur(),b.$el.blur(),b.events.enableBlur()),b.opts.iframe&&b.size.syncIframe(),Ea=a(this),b.browser.msie||xa(),k(),e(),b.browser.msie||b.selection.clear(),b.helpers.isIOS()&&(b.events.disableBlur(),b.$el.blur()),b.button.bulkRefresh(),b.events.trigger("video.hideResizer")}function ka(a){Ea&&(na()||a===!0)&&(b.toolbar.enable(),Fa.removeClass("fr-active"),b.popups.hide("image.edit"),Ea=null,ma(),Ga=null,Ha&&Ha.hide())}function la(){Ua=!0}function ma(){Ua=!1}function na(){return Ua}function oa(a,c,d){!b.opts.htmlUntouched&&b.opts.useClasses?(a.removeClass("fr-fil fr-fir fr-dib fr-dii"),d&&a.addClass("fr-fi"+d[0]),c&&a.addClass("fr-di"+c[0])):"inline"==c?(a.css({display:"inline-block",verticalAlign:"bottom",margin:b.opts.imageDefaultMargin}),"center"==d?a.css({"float":"none",marginBottom:"",marginTop:"",maxWidth:"calc(100% - "+2*b.opts.imageDefaultMargin+"px)",textAlign:"center"}):"left"==d?a.css({"float":"left",marginLeft:0,maxWidth:"calc(100% - "+b.opts.imageDefaultMargin+"px)",textAlign:"left"}):a.css({"float":"right",marginRight:0,maxWidth:"calc(100% - "+b.opts.imageDefaultMargin+"px)",textAlign:"right"})):"block"==c&&(a.css({display:"block","float":"none",verticalAlign:"top",margin:b.opts.imageDefaultMargin+"px auto",textAlign:"center"}),"left"==d?a.css({marginLeft:0,textAlign:"left"}):"right"==d&&a.css({marginRight:0,textAlign:"right"}))}function pa(a){var c=Aa();c.removeClass("fr-fir fr-fil"),!b.opts.htmlUntouched&&b.opts.useClasses?"left"==a?c.addClass("fr-fil"):"right"==a&&c.addClass("fr-fir"):oa(c,ra(),a),xa(),k(),e(),b.selection.clear()}function qa(a){if("undefined"==typeof a&&(a=Aa()),a){if(a.hasClass("fr-fil"))return"left";if(a.hasClass("fr-fir"))return"right";if(a.hasClass("fr-dib")||a.hasClass("fr-dii"))return"center";var b=a.css("float");if(a.css("float","none"),"block"==a.css("display")){if(a.css("float",""),a.css("float")!=b&&a.css("float",b),0===parseInt(a.css("margin-left"),10))return"left";if(0===parseInt(a.css("margin-right"),10))return"right"}else{if(a.css("float",""),a.css("float")!=b&&a.css("float",b),"left"==a.css("float"))return"left";if("right"==a.css("float"))return"right"}}return"center"}function ra(a){"undefined"==typeof a&&(a=Aa());var b=a.css("float");return a.css("float","none"),"block"==a.css("display")?(a.css("float",""),a.css("float")!=b&&a.css("float",b),"block"):(a.css("float",""),a.css("float")!=b&&a.css("float",b),"inline")}function sa(a){Ea&&a.find("> *:first").replaceWith(b.icon.create("image-align-"+qa()))}function ta(a,b){Ea&&b.find('.fr-command[data-param1="'+qa()+'"]').addClass("fr-active").attr("aria-selected",!0)}function ua(a){var c=Aa();c.removeClass("fr-dii fr-dib"),!b.opts.htmlUntouched&&b.opts.useClasses?"inline"==a?c.addClass("fr-dii"):"block"==a&&c.addClass("fr-dib"):oa(c,a,qa()),xa(),k(),e(),b.selection.clear()}function va(a,b){Ea&&b.find('.fr-command[data-param1="'+ra()+'"]').addClass("fr-active").attr("aria-selected",!0)}function wa(){var a=b.popups.get("image.insert");a||(a=N()),b.popups.isVisible("image.insert")||(t(),b.popups.refresh("image.insert"),b.popups.setContainer("image.insert",b.$sc));var c=Aa();Ca()&&(c=c.find(".fr-img-wrap"));var d=c.offset().left+c.outerWidth()/2,e=c.offset().top+c.outerHeight();b.popups.show("image.insert",d,e,c.outerHeight(!0))}function xa(){if(Ea){b.events.disableBlur(),b.selection.clear();var a=b.doc.createRange();a.selectNode(Ea.get(0));var c=b.selection.get();c.addRange(a),b.events.enableBlur()}}function ya(){Ea?(b.events.disableBlur(),a(".fr-popup input:focus").blur(),x(Ea)):(b.events.disableBlur(),b.selection.restore(),b.events.enableBlur(),b.popups.hide("image.insert"),b.toolbar.showInline())}function za(){return Ea}function Aa(){return Ca()?Ea.parents(".fr-img-caption:first"):Ea}function Ba(a,c,d){if("undefined"==typeof c&&(c=b.opts.imageStyles),"undefined"==typeof d&&(d=b.opts.imageMultipleStyles),!Ea)return!1;var e=Aa();if(!d){var f=Object.keys(c);f.splice(f.indexOf(a),1),e.removeClass(f.join(" "))}"object"==typeof c[a]?(e.removeAttr("style"),e.css(c[a].style)):e.toggleClass(a),x(Ea)}function Ca(){return Ea?Ea.parents(".fr-img-caption").length>0:!1}function Da(){var c;Ea&&!Ca()?(c=Ea,Ea.parent().is("a")&&(c=Ea.parent()),c.wrap("<span "+(b.browser.mozilla?"":'contenteditable="false"')+'class="fr-img-caption '+Ea.attr("class")+'" style="'+(Ea.attr("style")?Ea.attr("style")+" ":"")+"width: "+Ea.width()+'px;" draggable="false"></span>'),c.wrap('<span class="fr-img-wrap"></span>'),c.after('<span class="fr-inner" contenteditable="true">'+a.FE.START_MARKER+"Image caption"+a.FE.END_MARKER+"</span>"),Ea.removeAttr("class").removeAttr("style").removeAttr("width"),ka(!0),b.selection.restore()):(c=Aa(),Ea.insertAfter(c),Ea.attr("class",c.attr("class").replace("fr-img-caption","")).attr("style",c.attr("style")),c.remove(),x(Ea))}var Ea,Fa,Ga,Ha,Ia=!1,Ja=1,Ka=2,La=3,Ma=4,Na=5,Oa=6,Pa=7,Qa=8,Ra={};Ra[Ja]="Image cannot be loaded from the passed link.",Ra[Ka]="No link in upload response.",Ra[La]="Error during file upload.",Ra[Ma]="Parsing response failed.",Ra[Na]="File is too large.",Ra[Oa]="Image file type is invalid.",Ra[Pa]="Files can be uploaded only to same domain in IE 8 and IE 9.",Ra[Qa]="Image file is corrupted.";var Sa,Ta,Ua=!1;return{_init:ca,showInsertPopup:d,showLayer:W,refreshUploadButton:X,refreshByURLButton:Y,upload:I,insertByURL:w,align:pa,refreshAlign:sa,refreshAlignOnShow:ta,display:ua,refreshDisplayOnShow:va,replace:wa,back:ya,get:za,getEl:Aa,insert:z,showProgressBar:s,remove:_,hideProgressBar:t,applyStyle:Ba,showAltPopup:P,showSizePopup:T,setAlt:R,setSize:V,toggleCaption:Da,hasCaption:Ca,exitEdit:ka,edit:x}},a.FE.DefineIcon("insertImage",{NAME:"image"}),a.FE.RegisterShortcut(a.FE.KEYCODE.P,"insertImage",null,"P"),a.FE.RegisterCommand("insertImage",{title:"Insert Image",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("image.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("image.insert")):this.image.showInsertPopup()},plugin:"image"}),a.FE.DefineIcon("imageUpload",{NAME:"upload"}),a.FE.RegisterCommand("imageUpload",{title:"Upload Image",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-upload")},refresh:function(a){this.image.refreshUploadButton(a)}}),a.FE.DefineIcon("imageByURL",{NAME:"link"}),a.FE.RegisterCommand("imageByURL",{title:"By URL",undo:!1,focus:!1,toggle:!0,callback:function(){this.image.showLayer("image-by-url")},refresh:function(a){this.image.refreshByURLButton(a)}}),a.FE.RegisterCommand("imageInsertByURL",{title:"Insert Image",undo:!0,refreshAfterCallback:!1,callback:function(){this.image.insertByURL()},refresh:function(a){var b=this.image.get();b?a.text(this.language.translate("Replace")):a.text(this.language.translate("Insert"))}}),a.FE.DefineIcon("imageDisplay",{NAME:"star"}),a.FE.RegisterCommand("imageDisplay",{title:"Display",type:"dropdown",options:{inline:"Inline",block:"Break Text"},callback:function(a,b){this.image.display(b)},refresh:function(a){this.opts.imageTextNear||a.addClass("fr-hidden")},refreshOnShow:function(a,b){this.image.refreshDisplayOnShow(a,b)}}),a.FE.DefineIcon("image-align",{NAME:"align-left"}),a.FE.DefineIcon("image-align-left",{NAME:"align-left"}),a.FE.DefineIcon("image-align-right",{NAME:"align-right"}),a.FE.DefineIcon("image-align-center",{NAME:"align-justify"}),a.FE.DefineIcon("imageAlign",{NAME:"align-justify"}),a.FE.RegisterCommand("imageAlign",{type:"dropdown",title:"Align",options:{left:"Align Left",center:"None",right:"Align Right"},html:function(){var b='<ul class="fr-dropdown-list" role="presentation">',c=a.FE.COMMANDS.imageAlign.options;for(var d in c)c.hasOwnProperty(d)&&(b+='<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="imageAlign" data-param1="'+d+'" title="'+this.language.translate(c[d])+'">'+this.icon.create("image-align-"+d)+'<span class="fr-sr-only">'+this.language.translate(c[d])+"</span></a></li>");return b+="</ul>"},callback:function(a,b){this.image.align(b)},refresh:function(a){this.image.refreshAlign(a)},refreshOnShow:function(a,b){this.image.refreshAlignOnShow(a,b)}}),a.FE.DefineIcon("imageReplace",{NAME:"exchange",FA5NAME:"exchange-alt"}),a.FE.RegisterCommand("imageReplace",{title:"Replace",undo:!1,focus:!1,popup:!0,refreshAfterCallback:!1,callback:function(){this.image.replace()}}),a.FE.DefineIcon("imageRemove",{NAME:"trash"}),a.FE.RegisterCommand("imageRemove",{title:"Remove",callback:function(){this.image.remove()}}),a.FE.DefineIcon("imageBack",{NAME:"arrow-left"}),a.FE.RegisterCommand("imageBack",{title:"Back",undo:!1,focus:!1,back:!0,callback:function(){this.image.back()},refresh:function(a){var b=this.image.get();b||this.opts.toolbarInline?(a.removeClass("fr-hidden"),a.next(".fr-separator").removeClass("fr-hidden")):(a.addClass("fr-hidden"),a.next(".fr-separator").addClass("fr-hidden"))}}),a.FE.RegisterCommand("imageDismissError",{title:"OK",undo:!1,callback:function(){this.image.hideProgressBar(!0)}}),a.FE.DefineIcon("imageStyle",{NAME:"magic"}),a.FE.RegisterCommand("imageStyle",{title:"Style",type:"dropdown",html:function(){var a='<ul class="fr-dropdown-list" role="presentation">',b=this.opts.imageStyles;for(var c in b)if(b.hasOwnProperty(c)){var d=b[c];"object"==typeof d&&(d=d.title),a+='<li role="presentation"><a class="fr-command" tabIndex="-1" role="option" data-cmd="imageStyle" data-param1="'+c+'">'+this.language.translate(d)+"</a></li>"}return a+="</ul>"},callback:function(a,b){this.image.applyStyle(b)},refreshOnShow:function(b,c){var d=this.image.getEl();d&&c.find(".fr-command").each(function(){var b=a(this).data("param1"),c=d.hasClass(b);a(this).toggleClass("fr-active",c).attr("aria-selected",c)})}}),a.FE.DefineIcon("imageAlt",{NAME:"info"}),a.FE.RegisterCommand("imageAlt",{undo:!1,focus:!1,popup:!0,title:"Alternate Text",callback:function(){this.image.showAltPopup()}}),a.FE.RegisterCommand("imageSetAlt",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setAlt()}}),a.FE.DefineIcon("imageSize",{NAME:"arrows-alt"}),a.FE.RegisterCommand("imageSize",{undo:!1,focus:!1,popup:!0,title:"Change Size",callback:function(){this.image.showSizePopup()}}),a.FE.RegisterCommand("imageSetSize",{undo:!0,focus:!1,title:"Update",refreshAfterCallback:!1,callback:function(){this.image.setSize()}}),a.FE.DefineIcon("imageCaption",{NAME:"commenting",FA5NAME:"comment-alt"}),a.FE.RegisterCommand("imageCaption",{undo:!0,focus:!1,title:"Image Caption",refreshAfterCallback:!0,callback:function(){this.image.toggleCaption()},refresh:function(a){this.image.get()&&a.toggleClass("fr-active",this.image.hasCaption())}})});
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */
6
6
 
7
- !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c)}:a(window.jQuery)}(function(a){if(a.extend(a.FE.DEFAULTS,{imageManagerLoadURL:"https://i.froala.com/load-files",imageManagerLoadMethod:"get",imageManagerLoadParams:{},imageManagerPreloader:"",imageManagerDeleteURL:"",imageManagerDeleteMethod:"post",imageManagerDeleteParams:{},imageManagerPageSize:12,imageManagerScrollOffset:20,imageManagerToggleTags:!0}),a.FE.PLUGINS.imageManager=function(b){function c(){if(!z){var a='<div class="fr-modal-head-line"><i class="fa fa-bars fr-modal-more fr-not-available" id="fr-modal-more-'+b.sid+'" title="'+b.language.translate("Tags")+'"></i><h4 data-text="true">'+b.language.translate("Manage Images")+"</h4></div>";a+='<div class="fr-modal-tags" id="fr-modal-tags"></div>';var c='<img class="fr-preloader" id="fr-preloader" alt="'+b.language.translate("Loading")+'.." src="'+b.opts.imageManagerPreloader+'" style="display: none;">';c+='<div class="fr-image-list" id="fr-image-list"></div>';var d=b.modals.create(K,a,c);z=d.$modal,A=d.$head,B=d.$body}z.data("current-image",b.image.get()),b.modals.show(K),C||x(),g()}function d(){b.modals.hide(K)}function e(){var b=a(window).outerWidth();return 768>b?2:1200>b?3:4}function f(){D.empty();for(var a=0;J>a;a++)D.append('<div class="fr-list-column"></div>')}function g(){C.show(),D.find(".fr-list-column").empty(),b.opts.imageManagerLoadURL?a.ajax({url:b.opts.imageManagerLoadURL,method:b.opts.imageManagerLoadMethod,data:b.opts.imageManagerLoadParams,dataType:"json",crossDomain:b.opts.requestWithCORS,xhrFields:{withCredentials:b.opts.requestWithCredentials},headers:b.opts.requestHeaders}).done(function(a,c,d){b.events.trigger("imageManager.imagesLoaded",[a]),h(a,d.response),C.hide()}).fail(function(){var a=this.xhr();s(M,a.response||a.responseText)}):s(N)}function h(a,b){try{D.find(".fr-list-column").empty(),G=0,H=0,I=0,F=a,i()}catch(c){s(O,b)}}function i(){if(H<F.length&&(D.outerHeight()<=B.outerHeight()+b.opts.imageManagerScrollOffset||B.scrollTop()+b.opts.imageManagerScrollOffset>D.outerHeight()-B.outerHeight())){G++;for(var a=b.opts.imageManagerPageSize*(G-1);a<Math.min(F.length,b.opts.imageManagerPageSize*G);a++)j(F[a])}}function j(c){var d=new Image,e=a('<div class="fr-image-container fr-empty fr-image-'+I++ +'" data-loading="'+b.language.translate("Loading")+'.." data-deleting="'+b.language.translate("Deleting")+'..">');n(!1),d.onload=function(){e.height(Math.floor(e.width()/d.width*d.height));var f=a("<img/>");if(c.thumb)f.attr("src",c.thumb);else{if(s(P,c),!c.url)return s(Q,c),!1;f.attr("src",c.url)}if(c.url&&f.attr("data-url",c.url),c.tag)if(A.find(".fr-modal-more.fr-not-available").removeClass("fr-not-available"),A.find(".fr-modal-tags").show(),c.tag.indexOf(",")>=0){for(var g=c.tag.split(","),h=0;h<g.length;h++)g[h]=g[h].trim(),0===E.find('a[title="'+g[h]+'"]').length&&E.append('<a role="button" title="'+g[h]+'">'+g[h]+"</a>");f.attr("data-tag",g.join())}else 0===E.find('a[title="'+c.tag.trim()+'"]').length&&E.append('<a role="button" title="'+c.tag.trim()+'">'+c.tag.trim()+"</a>"),f.attr("data-tag",c.tag.trim());c.name&&f.attr("alt",c.name);for(var j in c)c.hasOwnProperty(j)&&"thumb"!=j&&"url"!=j&&"tag"!=j&&f.attr("data-"+j,c[j]);e.append(f).append(a(b.icon.create("imageManagerDelete")).addClass("fr-delete-img").attr("title",b.language.translate("Delete"))).append(a(b.icon.create("imageManagerInsert")).addClass("fr-insert-img").attr("title",b.language.translate("Insert"))),E.find(".fr-selected-tag").each(function(a,b){w(f,b.text)||e.hide()}),f.on("load",function(){e.removeClass("fr-empty"),e.height("auto"),H++;var a=l(parseInt(f.parent().attr("class").match(/fr-image-(\d+)/)[1],10)+1);m(a),n(!1),H%b.opts.imageManagerPageSize===0&&i()}),b.events.trigger("imageManager.imageLoaded",[f])},d.onerror=function(){H++,e.remove();var a=l(parseInt(e.attr("class").match(/fr-image-(\d+)/)[1],10)+1);m(a),s(L,c),H%b.opts.imageManagerPageSize===0&&i()},d.src=c.thumb||c.url,k().append(e)}function k(){var b,c;return D.find(".fr-list-column").each(function(d,e){var f=a(e);0===d?(c=f.outerHeight(),b=f):f.outerHeight()<c&&(c=f.outerHeight(),b=f)}),b}function l(b){void 0===b&&(b=0);for(var c=[],d=I-1;d>=b;d--){var e=D.find(".fr-image-"+d);e.length&&(c.push(e),a('<div id="fr-image-hidden-container">').append(e),D.find(".fr-image-"+d).remove())}return c}function m(a){for(var b=a.length-1;b>=0;b--)k().append(a[b])}function n(a){if(void 0===a&&(a=!0),!z.is(":visible"))return!0;var c=e();if(c!=J){J=c;var d=l();f(),m(d)}b.modals.resize(K),a&&i()}function o(a){var b={},c=a.data();for(var d in c)c.hasOwnProperty(d)&&"url"!=d&&"tag"!=d&&(b[d]=c[d]);return b}function p(c){var d=a(c.currentTarget).siblings("img"),e=z.data("instance")||b,f=z.data("current-image");if(b.modals.hide(K),e.image.showProgressBar(),f)f.data("fr-old-src",f.attr("src")),f.trigger("click");else{e.events.focus(!0),e.selection.restore();var g=e.position.getBoundingRect(),h=g.left+g.width/2+a(b.doc).scrollLeft(),i=g.top+g.height+a(b.doc).scrollTop();e.popups.setContainer("image.insert",b.$sc),e.popups.show("image.insert",h,i)}e.image.insert(d.data("url"),!1,o(d),f)}function q(){z.find("#fr-modal-tags > a").each(function(){0===z.find('#fr-image-list [data-tag*="'+a(this).text()+'"]').length&&a(this).removeClass("fr-selected-tag").hide()}),u()}function r(c){var d=a(c.currentTarget).siblings("img"),e=b.language.translate("Are you sure? Image will be deleted.");confirm(e)&&(b.opts.imageManagerDeleteURL?b.events.trigger("imageManager.beforeDeleteImage",[d])!==!1&&(d.parent().addClass("fr-image-deleting"),a.ajax({method:b.opts.imageManagerDeleteMethod,url:b.opts.imageManagerDeleteURL,data:a.extend(a.extend({src:d.attr("src")},o(d)),b.opts.imageManagerDeleteParams),crossDomain:b.opts.requestWithCORS,xhrFields:{withCredentials:b.opts.requestWithCredentials},headers:b.opts.requestHeaders}).done(function(a){b.events.trigger("imageManager.imageDeleted",[a]);var c=l(parseInt(d.parent().attr("class").match(/fr-image-(\d+)/)[1],10)+1);d.parent().remove(),m(c),q(),n(!0)}).fail(function(a){s(R,a.response||a.responseText)})):s(S))}function s(c,d){c>=10&&20>c?C.hide():c>=20&&30>c&&a(".fr-image-deleting").removeClass("fr-image-deleting"),b.events.trigger("imageManager.error",[{code:c,message:T[c]},d])}function t(){var a=A.find(".fr-modal-head-line").outerHeight(),b=E.outerHeight();A.toggleClass("fr-show-tags"),A.hasClass("fr-show-tags")?(A.css("height",a+b),E.find("a").css("opacity",1)):(A.css("height",a),E.find("a").css("opacity",0))}function u(){var b=E.find(".fr-selected-tag");b.length>0?(D.find("img").parent().show(),b.each(function(b,c){D.find("img").each(function(b,d){var e=a(d);w(e,c.text)||e.parent().hide()})})):D.find("img").parent().show();var c=l();m(c),i()}function v(c){c.preventDefault();var d=a(c.currentTarget);d.toggleClass("fr-selected-tag"),b.opts.imageManagerToggleTags&&d.siblings("a").removeClass("fr-selected-tag"),u()}function w(a,b){for(var c=(a.attr("data-tag")||"").split(","),d=0;d<c.length;d++)if(c[d]==b)return!0;return!1}function x(){C=z.find("#fr-preloader"),D=z.find("#fr-image-list"),E=z.find("#fr-modal-tags"),J=e(),f(),A.css("height",A.find(".fr-modal-head-line").outerHeight()),b.events.$on(a(b.o_win),"resize",function(){n(F?!0:!1)}),b.helpers.isMobile()&&(b.events.bindClick(D,"div.fr-image-container",function(b){z.find(".fr-mobile-selected").removeClass("fr-mobile-selected"),a(b.currentTarget).addClass("fr-mobile-selected")}),z.on(b._mousedown,function(){z.find(".fr-mobile-selected").removeClass("fr-mobile-selected")})),b.events.bindClick(D,".fr-insert-img",p),b.events.bindClick(D,".fr-delete-img",r),z.on(b._mousedown+" "+b._mouseup,function(a){a.stopPropagation()}),z.on(b._mousedown,"*",function(){b.events.disableBlur()}),B.on("scroll",i),b.events.bindClick(z,"i#fr-modal-more-"+b.sid,t),b.events.bindClick(E,"a",v)}function y(){return b.$wp||"IMG"==b.el.tagName?void 0:!1}var z,A,B,C,D,E,F,G,H,I,J,K="image_manager",L=10,M=11,N=12,O=13,P=14,Q=15,R=21,S=22,T={};return T[L]="Image cannot be loaded from the passed link.",T[M]="Error during load images request.",T[N]="Missing imageManagerLoadURL option.",T[O]="Parsing load response failed.",T[P]="Missing image thumb.",T[Q]="Missing image URL.",T[R]="Error during delete image request.",T[S]="Missing imageManagerDeleteURL option.",{require:["image"],_init:y,show:c,hide:d}},!a.FE.PLUGINS.image)throw new Error("Image manager plugin requires image plugin.");a.FE.DEFAULTS.imageInsertButtons.push("imageManager"),a.FE.RegisterCommand("imageManager",{title:"Browse",undo:!1,focus:!1,modal:!0,callback:function(){this.imageManager.show()},plugin:"imageManager"}),a.FE.DefineIcon("imageManager",{NAME:"folder"}),a.FE.DefineIcon("imageManagerInsert",{NAME:"plus"}),a.FE.DefineIcon("imageManagerDelete",{NAME:"trash"})});
7
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c)}:a(window.jQuery)}(function(a){if(a.extend(a.FE.DEFAULTS,{imageManagerLoadURL:"https://i.froala.com/load-files",imageManagerLoadMethod:"get",imageManagerLoadParams:{},imageManagerPreloader:null,imageManagerDeleteURL:"",imageManagerDeleteMethod:"post",imageManagerDeleteParams:{},imageManagerPageSize:12,imageManagerScrollOffset:20,imageManagerToggleTags:!0}),a.FE.PLUGINS.imageManager=function(b){function c(){if(!z){var a='<div class="fr-modal-head-line"><i class="fa fa-bars fr-modal-more fr-not-available" id="fr-modal-more-'+b.sid+'" title="'+b.language.translate("Tags")+'"></i><h4 data-text="true">'+b.language.translate("Manage Images")+"</h4></div>";a+='<div class="fr-modal-tags" id="fr-modal-tags"></div>';var c;c=b.opts.imageManagerPreloader?'<img class="fr-preloader" id="fr-preloader" alt="'+b.language.translate("Loading")+'.." src="'+b.opts.imageManagerPreloader+'" style="display: none;">':'<span class="fr-preloader" id="fr-preloader" style="display: none;">'+b.language.translate("Loading")+"</span>",c+='<div class="fr-image-list" id="fr-image-list"></div>';var d=b.modals.create(K,a,c);z=d.$modal,A=d.$head,B=d.$body}z.data("current-image",b.image.get()),b.modals.show(K),C||x(),g()}function d(){b.modals.hide(K)}function e(){var b=a(window).outerWidth();return 768>b?2:1200>b?3:4}function f(){D.empty();for(var a=0;J>a;a++)D.append('<div class="fr-list-column"></div>')}function g(){C.show(),D.find(".fr-list-column").empty(),b.opts.imageManagerLoadURL?a.ajax({url:b.opts.imageManagerLoadURL,method:b.opts.imageManagerLoadMethod,data:b.opts.imageManagerLoadParams,dataType:"json",crossDomain:b.opts.requestWithCORS,xhrFields:{withCredentials:b.opts.requestWithCredentials},headers:b.opts.requestHeaders}).done(function(a,c,d){b.events.trigger("imageManager.imagesLoaded",[a]),h(a,d.response),C.hide()}).fail(function(){var a=this.xhr();s(M,a.response||a.responseText)}):s(N)}function h(a,b){try{D.find(".fr-list-column").empty(),G=0,H=0,I=0,F=a,i()}catch(c){s(O,b)}}function i(){if(H<F.length&&(D.outerHeight()<=B.outerHeight()+b.opts.imageManagerScrollOffset||B.scrollTop()+b.opts.imageManagerScrollOffset>D.outerHeight()-B.outerHeight())){G++;for(var a=b.opts.imageManagerPageSize*(G-1);a<Math.min(F.length,b.opts.imageManagerPageSize*G);a++)j(F[a])}}function j(c){var d=new Image,e=a('<div class="fr-image-container fr-empty fr-image-'+I++ +'" data-loading="'+b.language.translate("Loading")+'.." data-deleting="'+b.language.translate("Deleting")+'..">');n(!1),d.onload=function(){e.height(Math.floor(e.width()/d.width*d.height));var f=a("<img/>");if(c.thumb)f.attr("src",c.thumb);else{if(s(P,c),!c.url)return s(Q,c),!1;f.attr("src",c.url)}if(c.url&&f.attr("data-url",c.url),c.tag)if(A.find(".fr-modal-more.fr-not-available").removeClass("fr-not-available"),A.find(".fr-modal-tags").show(),c.tag.indexOf(",")>=0){for(var g=c.tag.split(","),h=0;h<g.length;h++)g[h]=g[h].trim(),0===E.find('a[title="'+g[h]+'"]').length&&E.append('<a role="button" title="'+g[h]+'">'+g[h]+"</a>");f.attr("data-tag",g.join())}else 0===E.find('a[title="'+c.tag.trim()+'"]').length&&E.append('<a role="button" title="'+c.tag.trim()+'">'+c.tag.trim()+"</a>"),f.attr("data-tag",c.tag.trim());c.name&&f.attr("alt",c.name);for(var j in c)c.hasOwnProperty(j)&&"thumb"!=j&&"url"!=j&&"tag"!=j&&f.attr("data-"+j,c[j]);e.append(f).append(a(b.icon.create("imageManagerDelete")).addClass("fr-delete-img").attr("title",b.language.translate("Delete"))).append(a(b.icon.create("imageManagerInsert")).addClass("fr-insert-img").attr("title",b.language.translate("Insert"))),E.find(".fr-selected-tag").each(function(a,b){w(f,b.text)||e.hide()}),f.on("load",function(){e.removeClass("fr-empty"),e.height("auto"),H++;var a=l(parseInt(f.parent().attr("class").match(/fr-image-(\d+)/)[1],10)+1);m(a),n(!1),H%b.opts.imageManagerPageSize===0&&i()}),b.events.trigger("imageManager.imageLoaded",[f])},d.onerror=function(){H++,e.remove();var a=l(parseInt(e.attr("class").match(/fr-image-(\d+)/)[1],10)+1);m(a),s(L,c),H%b.opts.imageManagerPageSize===0&&i()},d.src=c.thumb||c.url,k().append(e)}function k(){var b,c;return D.find(".fr-list-column").each(function(d,e){var f=a(e);0===d?(c=f.outerHeight(),b=f):f.outerHeight()<c&&(c=f.outerHeight(),b=f)}),b}function l(b){void 0===b&&(b=0);for(var c=[],d=I-1;d>=b;d--){var e=D.find(".fr-image-"+d);e.length&&(c.push(e),a('<div id="fr-image-hidden-container">').append(e),D.find(".fr-image-"+d).remove())}return c}function m(a){for(var b=a.length-1;b>=0;b--)k().append(a[b])}function n(a){if(void 0===a&&(a=!0),!z.is(":visible"))return!0;var c=e();if(c!=J){J=c;var d=l();f(),m(d)}b.modals.resize(K),a&&i()}function o(a){var b={},c=a.data();for(var d in c)c.hasOwnProperty(d)&&"url"!=d&&"tag"!=d&&(b[d]=c[d]);return b}function p(c){var d=a(c.currentTarget).siblings("img"),e=z.data("instance")||b,f=z.data("current-image");if(b.modals.hide(K),e.image.showProgressBar(),f)f.data("fr-old-src",f.attr("src")),f.trigger("click");else{e.events.focus(!0),e.selection.restore();var g=e.position.getBoundingRect(),h=g.left+g.width/2+a(b.doc).scrollLeft(),i=g.top+g.height+a(b.doc).scrollTop();e.popups.setContainer("image.insert",b.$sc),e.popups.show("image.insert",h,i)}e.image.insert(d.data("url"),!1,o(d),f)}function q(){z.find("#fr-modal-tags > a").each(function(){0===z.find('#fr-image-list [data-tag*="'+a(this).text()+'"]').length&&a(this).removeClass("fr-selected-tag").hide()}),u()}function r(c){var d=a(c.currentTarget).siblings("img"),e=b.language.translate("Are you sure? Image will be deleted.");confirm(e)&&(b.opts.imageManagerDeleteURL?b.events.trigger("imageManager.beforeDeleteImage",[d])!==!1&&(d.parent().addClass("fr-image-deleting"),a.ajax({method:b.opts.imageManagerDeleteMethod,url:b.opts.imageManagerDeleteURL,data:a.extend(a.extend({src:d.attr("src")},o(d)),b.opts.imageManagerDeleteParams),crossDomain:b.opts.requestWithCORS,xhrFields:{withCredentials:b.opts.requestWithCredentials},headers:b.opts.requestHeaders}).done(function(a){b.events.trigger("imageManager.imageDeleted",[a]);var c=l(parseInt(d.parent().attr("class").match(/fr-image-(\d+)/)[1],10)+1);d.parent().remove(),m(c),q(),n(!0)}).fail(function(a){s(R,a.response||a.responseText)})):s(S))}function s(c,d){c>=10&&20>c?C.hide():c>=20&&30>c&&a(".fr-image-deleting").removeClass("fr-image-deleting"),b.events.trigger("imageManager.error",[{code:c,message:T[c]},d])}function t(){var a=A.find(".fr-modal-head-line").outerHeight(),b=E.outerHeight();A.toggleClass("fr-show-tags"),A.hasClass("fr-show-tags")?(A.css("height",a+b),E.find("a").css("opacity",1)):(A.css("height",a),E.find("a").css("opacity",0))}function u(){var b=E.find(".fr-selected-tag");b.length>0?(D.find("img").parent().show(),b.each(function(b,c){D.find("img").each(function(b,d){var e=a(d);w(e,c.text)||e.parent().hide()})})):D.find("img").parent().show();var c=l();m(c),i()}function v(c){c.preventDefault();var d=a(c.currentTarget);d.toggleClass("fr-selected-tag"),b.opts.imageManagerToggleTags&&d.siblings("a").removeClass("fr-selected-tag"),u()}function w(a,b){for(var c=(a.attr("data-tag")||"").split(","),d=0;d<c.length;d++)if(c[d]==b)return!0;return!1}function x(){C=z.find("#fr-preloader"),D=z.find("#fr-image-list"),E=z.find("#fr-modal-tags"),J=e(),f(),A.css("height",A.find(".fr-modal-head-line").outerHeight()),b.events.$on(a(b.o_win),"resize",function(){n(F?!0:!1)}),b.helpers.isMobile()&&(b.events.bindClick(D,"div.fr-image-container",function(b){z.find(".fr-mobile-selected").removeClass("fr-mobile-selected"),a(b.currentTarget).addClass("fr-mobile-selected")}),z.on(b._mousedown,function(){z.find(".fr-mobile-selected").removeClass("fr-mobile-selected")})),b.events.bindClick(D,".fr-insert-img",p),b.events.bindClick(D,".fr-delete-img",r),z.on(b._mousedown+" "+b._mouseup,function(a){a.stopPropagation()}),z.on(b._mousedown,"*",function(){b.events.disableBlur()}),B.on("scroll",i),b.events.bindClick(z,"i#fr-modal-more-"+b.sid,t),b.events.bindClick(E,"a",v)}function y(){return b.$wp||"IMG"==b.el.tagName?void 0:!1}var z,A,B,C,D,E,F,G,H,I,J,K="image_manager",L=10,M=11,N=12,O=13,P=14,Q=15,R=21,S=22,T={};return T[L]="Image cannot be loaded from the passed link.",T[M]="Error during load images request.",T[N]="Missing imageManagerLoadURL option.",T[O]="Parsing load response failed.",T[P]="Missing image thumb.",T[Q]="Missing image URL.",T[R]="Error during delete image request.",T[S]="Missing imageManagerDeleteURL option.",{require:["image"],_init:y,show:c,hide:d}},!a.FE.PLUGINS.image)throw new Error("Image manager plugin requires image plugin.");a.FE.DEFAULTS.imageInsertButtons.push("imageManager"),a.FE.RegisterCommand("imageManager",{title:"Browse",undo:!1,focus:!1,modal:!0,callback:function(){this.imageManager.show()},plugin:"imageManager"}),a.FE.DefineIcon("imageManager",{NAME:"folder"}),a.FE.DefineIcon("imageManagerInsert",{NAME:"plus"}),a.FE.DefineIcon("imageManagerDelete",{NAME:"trash"})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * froala_editor v2.7.5 (https://www.froala.com/wysiwyg-editor)
2
+ * froala_editor v2.7.6 (https://www.froala.com/wysiwyg-editor)
3
3
  * License https://froala.com/wysiwyg-editor/terms/
4
4
  * Copyright 2014-2018 Froala Labs
5
5
  */