TinyMCE Advanced - Version 4.2.3

Version Description

  • Updated for WordPress 4.3 and TinyMCE 4.2.3.
  • Removed the 'textpattern' plugin as WordPress 4.3 includes similar functionality by default.
Download this release

Release Info

Developer azaozz
Plugin Icon 128x128 TinyMCE Advanced
Version 4.2.3
Comparing to
See all releases

Code changes from version 4.1.9 to 4.2.3

langs/tinymce-advanced-fr_FR.mo ADDED
Binary file
langs/tinymce-advanced-fr_FR.po ADDED
@@ -0,0 +1,314 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: TinyMCE Advanced\n"
4
+ "POT-Creation-Date: 2015-04-02 17:49-0800\n"
5
+ "PO-Revision-Date: 2015-08-03 10:32-0800\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: \n"
8
+ "Language: fr_FR\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.6.9\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "Plural-Forms: nplurals=2; plural=(n > 1);\n"
15
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
16
+ "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c;"
17
+ "esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
18
+ "X-Poedit-SearchPath-0: .\n"
19
+ "X-Poedit-SearchPath-1: ..\n"
20
+
21
+ #: ../tadv_admin.php:128
22
+ msgid "Default settings restored."
23
+ msgstr "Les paramètres par défaut restaurés."
24
+
25
+ #: ../tadv_admin.php:137
26
+ msgid "TinyMCE Advanced Settings Export"
27
+ msgstr "Réglages d'exportation de TinyMCE Advanced "
28
+
29
+ #: ../tadv_admin.php:141
30
+ msgid "The settings are exported as a JSON encoded string."
31
+ msgstr "Les paramètres sont exportés sous forme de chaîne JSON codée."
32
+
33
+ #: ../tadv_admin.php:142
34
+ msgid ""
35
+ "Please copy the content and save it in a <b>text</b> (.txt) file, using a "
36
+ "plain text editor like Notepad."
37
+ msgstr ""
38
+ "S'il vous plaît copier le contenu et l'enregistrer dans un fichier <b>texte</"
39
+ "b> (.txt), en utilisant un éditeur de texte comme Notepad."
40
+
41
+ #: ../tadv_admin.php:143
42
+ msgid ""
43
+ "It is important that the export is not changed in any way, no spaces, line "
44
+ "breaks, etc."
45
+ msgstr ""
46
+ "Il est important que l'exportation n'a pas changé en aucune manière, pas "
47
+ "d'espaces, sauts de ligne, etc."
48
+
49
+ #: ../tadv_admin.php:148
50
+ msgid "Select All"
51
+ msgstr "Sélectionner tout"
52
+
53
+ #: ../tadv_admin.php:150 ../tadv_admin.php:174
54
+ msgid "Back to Editor Settings"
55
+ msgstr "Retour aux paramètres de l'éditeur"
56
+
57
+ #: ../tadv_admin.php:160
58
+ msgid "TinyMCE Advanced Settings Import"
59
+ msgstr "Réglages d'importation de TinyMCE Advanced "
60
+
61
+ #: ../tadv_admin.php:163
62
+ msgid ""
63
+ "The settings are imported from a JSON encoded string. Please paste the "
64
+ "exported string in the text area below."
65
+ msgstr ""
66
+ "Les paramètres sont importés à partir d'une chaîne JSON codée. S'il vous "
67
+ "plaît collez la chaîne exporté dans la zone de texte ci-dessous."
68
+
69
+ #: ../tadv_admin.php:168
70
+ msgid "Verify"
71
+ msgstr "Vérifier"
72
+
73
+ #: ../tadv_admin.php:169
74
+ msgid "Import"
75
+ msgstr "Importer"
76
+
77
+ #: ../tadv_admin.php:196
78
+ msgid "Importing of settings failed."
79
+ msgstr "Importation des paramètres échoué."
80
+
81
+ #: ../tadv_admin.php:221
82
+ msgid "ERROR: All toolbars are empty. Default settings loaded."
83
+ msgstr ""
84
+ "Erreur: Tous les barres d'outils sont vides. Les réglages par défaut chargés."
85
+
86
+ #: ../tadv_admin.php:233
87
+ msgid "Editor Settings"
88
+ msgstr "Paramètres de l'éditeur"
89
+
90
+ #: ../tadv_admin.php:244
91
+ #, php-format
92
+ msgid ""
93
+ "This plugin requires WordPress version %1$s or newer. It appears that you "
94
+ "are running %2$s. This can make the editor unstable."
95
+ msgstr ""
96
+ "Ce plugin nécessite la version WordPress %1$s ou plus récent. Il semble que "
97
+ "vous utilisez la version %2$s. Cela peut rendre l'éditeur instable."
98
+
99
+ #: ../tadv_admin.php:251
100
+ #, php-format
101
+ msgid ""
102
+ "Please upgrade your WordPress installation or download an <a href=\"%s"
103
+ "\">older version of the plugin</a>."
104
+ msgstr ""
105
+ "S'il vous plaît mettre à jour votre installation de WordPress ou télécharger "
106
+ "une <a href=\"%s\">ancienne version du plugin</a>."
107
+
108
+ #: ../tadv_admin.php:261
109
+ msgid "Settings saved."
110
+ msgstr "Paramètres sauvegardés."
111
+
112
+ #: ../tadv_admin.php:270 ../tadv_admin.php:534
113
+ msgid "Save Changes"
114
+ msgstr "Sauvegarder les changements"
115
+
116
+ #: ../tadv_admin.php:275
117
+ msgid ""
118
+ "New in TinyMCE 4.0/WordPress 3.9 is the editor menu. When it is enabled, "
119
+ "most buttons are also available as menu items."
120
+ msgstr ""
121
+ "Nouveau dans TinyMCE 4.0 / WordPress 3.9 est le menu de l'éditeur. Quand il "
122
+ "est activé, la plupart des boutons sont également disponibles comme des "
123
+ "éléments de menu."
124
+
125
+ #: ../tadv_admin.php:279
126
+ msgid "Enable the editor menu."
127
+ msgstr "Activez le menu de l'éditeur."
128
+
129
+ #: ../tadv_admin.php:391
130
+ msgid ""
131
+ "Drag buttons from the unused buttons below and drop them in the toolbars "
132
+ "above, or drag the buttons in the toolbars to rearrange them."
133
+ msgstr ""
134
+ "Faites glisser les boutons inutilisés ci-dessous et déposez-les dans les "
135
+ "barres d'outils ci-dessus, ou faites glisser les boutons dans les barres "
136
+ "d'outils pour les réorganiser."
137
+
138
+ #: ../tadv_admin.php:394
139
+ msgid "Unused Buttons"
140
+ msgstr "Boutons inutilisés"
141
+
142
+ #: ../tadv_admin.php:435
143
+ msgid "Also enable:"
144
+ msgstr "Permettre également:"
145
+
146
+ #: ../tadv_admin.php:438
147
+ msgid "List Style Options"
148
+ msgstr "Options de style de liste"
149
+
150
+ #: ../tadv_admin.php:443
151
+ msgid "Context Menu"
152
+ msgstr "Menu contextuel"
153
+
154
+ #: ../tadv_admin.php:448
155
+ msgid "Link (replaces the Insert/Edit Link dialog)"
156
+ msgstr "Lien (remplace la boîte de dialogue Insérer / Modifier Lien)"
157
+
158
+ #: ../tadv_admin.php:458
159
+ msgid "Advanced Options"
160
+ msgstr "Options avancées"
161
+
162
+ #: ../tadv_admin.php:466
163
+ msgid "Import editor-style.css."
164
+ msgstr "Importer editor-style.css."
165
+
166
+ #: ../tadv_admin.php:468
167
+ msgid "It seems your theme does not support customised styles for the editor."
168
+ msgstr ""
169
+ "Il semble que votre thème ne supporte pas les styles personnalisés pour "
170
+ "l'éditeur."
171
+
172
+ #: ../tadv_admin.php:469
173
+ msgid ""
174
+ "You can create a CSS file named <code>editor-style.css</code> and upload it "
175
+ "to your theme's directory."
176
+ msgstr ""
177
+ "Vous pouvez créer un fichier CSS nommé <code>editor-style.css</code> et de "
178
+ "le transférer vers le répertoire de votre thème."
179
+
180
+ #: ../tadv_admin.php:470
181
+ msgid "After that, enable this setting."
182
+ msgstr "Après cela, activez ce paramètre."
183
+
184
+ #: ../tadv_admin.php:479
185
+ msgid ""
186
+ "Load the CSS classes used in editor-style.css and replace the Formats button "
187
+ "and sub-menu."
188
+ msgstr ""
189
+ "Chargez les classes CSS utilisées dans editor-style.css et remplacer le "
190
+ "bouton Formats et sous-menus."
191
+
192
+ #: ../tadv_admin.php:484
193
+ msgid "Markdown typing support (text pattern plugin)"
194
+ msgstr ""
195
+
196
+ #: ../tadv_admin.php:486
197
+ msgid ""
198
+ "This plugin matches special patterns while you type and applies formats or "
199
+ "executes commands on the matched text."
200
+ msgstr ""
201
+ "Ce plugin correspond à motifs spéciaux pendant que vous tapez et applique "
202
+ "formats ou exécute des commandes sur le texte correspondant."
203
+
204
+ #: ../tadv_admin.php:487
205
+ msgid ""
206
+ "The default patterns are the same as the markdown syntax so you can type "
207
+ "<code># text</code> to create a header, <code>1. text</code> to create a "
208
+ "list, <code>**text**</code> to make it bold, etc."
209
+ msgstr ""
210
+ "Les schémas par défaut sont les mêmes que la syntaxe Markdown de sorte que "
211
+ "vous pouvez taper <code># text</code> pour créer un en-tête, <code>1. text</"
212
+ "code> pour créer une liste,<code>**text**</code> pour mettre en gras, etc."
213
+
214
+ #: ../tadv_admin.php:488
215
+ msgid "More information"
216
+ msgstr "Plus d'informations"
217
+
218
+ #: ../tadv_admin.php:494
219
+ msgid ""
220
+ "Stop removing the &lt;p&gt; and &lt;br /&gt; tags when saving and show them "
221
+ "in the Text editor"
222
+ msgstr ""
223
+ "Arrêtez de retirer les balises &lt;p&gt; et &lt;br /&gt; lors de "
224
+ "l'enregistrement et les affiche dans l'éditeur de texte"
225
+
226
+ #: ../tadv_admin.php:496
227
+ msgid ""
228
+ "This will make it possible to use more advanced coding in the HTML editor "
229
+ "without the back-end filtering affecting it much."
230
+ msgstr ""
231
+ "Ainsi, il sera possible d'utiliser le codage plus avancé dans l'éditeur HTML "
232
+ "sans le filtrage back-end qui affecte beaucoup."
233
+
234
+ #: ../tadv_admin.php:497
235
+ msgid ""
236
+ "However it may behave unexpectedly in rare cases, so test it thoroughly "
237
+ "before enabling it permanently."
238
+ msgstr ""
239
+ "Cependant, il peut se comporter de façon inattendue dans de rares cas, si le "
240
+ "tester à fond avant de l'activer de façon permanente."
241
+
242
+ #: ../tadv_admin.php:498
243
+ msgid ""
244
+ "Line breaks in the HTML editor would still affect the output, in particular "
245
+ "do not use empty lines, line breaks inside HTML tags or multiple &lt;br /"
246
+ "&gt; tags."
247
+ msgstr ""
248
+ "Sauts de ligne dans l'éditeur HTML seraient encore affecter la sortie, en "
249
+ "particulier, ne pas utiliser des lignes vides, les sauts de ligne à "
250
+ "l'intérieur de balises HTML ou multiple balises &lt;br /&gt;."
251
+
252
+ #: ../tadv_admin.php:504
253
+ msgid "Replace font size settings"
254
+ msgstr "Remplacer les paramètres de taille de police"
255
+
256
+ #: ../tadv_admin.php:505
257
+ msgid ""
258
+ "Replaces the size setting available for fonts with: 8px 10px 12px 14px 16px "
259
+ "20px 24px 28px 32px 36px."
260
+ msgstr ""
261
+ "Remplace le réglage de la taille disponible pour les polices avec: 8px 10px "
262
+ "12px 14px 16px 20px 24px 28px 32px 36px."
263
+
264
+ #: ../tadv_admin.php:510
265
+ msgid "Enable pasting of image source"
266
+ msgstr "Activer coller de la source de l'image"
267
+
268
+ #: ../tadv_admin.php:512
269
+ msgid ""
270
+ "Works only in Firefox and Safari. These browsers support pasting of images "
271
+ "directly in the editor and convert them to base64 encoded text."
272
+ msgstr ""
273
+ "Fonctionne uniquement dans Firefox et Safari. Ces navigateurs supportent le "
274
+ "coller des images directement dans l'éditeur et les convertir en texte "
275
+ "base64."
276
+
277
+ #: ../tadv_admin.php:513
278
+ msgid ""
279
+ "This is not acceptable for larger images like photos or graphics, but may be "
280
+ "useful in some cases for very small images like icons, not larger than 2-3KB."
281
+ msgstr ""
282
+ "Cette situation est inacceptable pour les grandes images comme des photos ou "
283
+ "des graphiques, mais peut être utile dans certains cas pour les très petites "
284
+ "images comme icônes, pas plus grands que 2-3KB."
285
+
286
+ #: ../tadv_admin.php:514
287
+ msgid "These images will not be available in the Media Library."
288
+ msgstr "Ces images ne seront pas disponibles dans la bibliothèque multimédia."
289
+
290
+ #: ../tadv_admin.php:520
291
+ msgid "Administration"
292
+ msgstr "Administration"
293
+
294
+ #: ../tadv_admin.php:522
295
+ msgid "Export Settings"
296
+ msgstr "Réglages d'exportation"
297
+
298
+ #: ../tadv_admin.php:523
299
+ msgid "Import Settings"
300
+ msgstr "Réglages d'importation"
301
+
302
+ #: ../tadv_admin.php:533
303
+ msgid "Restore Default Settings"
304
+ msgstr "Restaurer les paramètres par défaut"
305
+
306
+ #: ../tadv_admin.php:539
307
+ msgid ""
308
+ "The [Toolbar toggle] button shows or hides the second, third, and forth "
309
+ "button rows. It will only work when it is in the first row and there are "
310
+ "buttons in the second row."
311
+ msgstr ""
312
+ "Le bouton [Barre d'outils] bascule sur afficher ou masquer les deuxième, "
313
+ "troisième, et quatrième rangées de boutons. Il ne fonctionne que quand il "
314
+ "est dans la première rangée et il ya des boutons de la deuxième rangée."
langs/tinymce-advanced-sv_SE.mo ADDED
Binary file
langs/tinymce-advanced-sv_SE.po ADDED
@@ -0,0 +1,309 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: TinyMCE Advanced\n"
4
+ "POT-Creation-Date: 2015-05-04 13:27-0800\n"
5
+ "PO-Revision-Date: 2015-05-04 13:27-0800\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: \n"
8
+ "Language: sv_SE\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.6.9\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
16
+ "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c;"
17
+ "esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
18
+ "X-Poedit-SearchPath-0: .\n"
19
+ "X-Poedit-SearchPath-1: ..\n"
20
+
21
+ #: ../tadv_admin.php:128
22
+ msgid "Default settings restored."
23
+ msgstr "Standardinställningar återställda."
24
+
25
+ #: ../tadv_admin.php:137
26
+ msgid "TinyMCE Advanced Settings Export"
27
+ msgstr "TinyMCE Avancerad Inställningsexport"
28
+
29
+ #: ../tadv_admin.php:141
30
+ msgid "The settings are exported as a JSON encoded string."
31
+ msgstr "Inställningarna exporteras som en JSON-kodad sträng."
32
+
33
+ #: ../tadv_admin.php:142
34
+ msgid ""
35
+ "Please copy the content and save it in a <b>text</b> (.txt) file, using a "
36
+ "plain text editor like Notepad."
37
+ msgstr ""
38
+ "Vänligen kopiera innehållet och spara det i en <b>text</b>-fil (.txt), genom "
39
+ "en ren texteditor såsom Anteckningar."
40
+
41
+ #: ../tadv_admin.php:143
42
+ msgid ""
43
+ "It is important that the export is not changed in any way, no spaces, line "
44
+ "breaks, etc."
45
+ msgstr ""
46
+ "Det är viktigt att exporten inte ändras på något sätt, inga mellanrum eller "
47
+ "radbrytningar etc."
48
+
49
+ #: ../tadv_admin.php:148
50
+ msgid "Select All"
51
+ msgstr "Välj allt"
52
+
53
+ #: ../tadv_admin.php:150 ../tadv_admin.php:174
54
+ msgid "Back to Editor Settings"
55
+ msgstr "Tillbaka till redigerarinställningar"
56
+
57
+ #: ../tadv_admin.php:160
58
+ msgid "TinyMCE Advanced Settings Import"
59
+ msgstr "TinyMCE Avancerad Inställningsimport"
60
+
61
+ #: ../tadv_admin.php:163
62
+ msgid ""
63
+ "The settings are imported from a JSON encoded string. Please paste the "
64
+ "exported string in the text area below."
65
+ msgstr ""
66
+ "Inställningarna importeras från en JSON-kodad sträng. Vänligen klistra in "
67
+ "den exporterade strängen i textfältet nedan."
68
+
69
+ #: ../tadv_admin.php:168
70
+ msgid "Verify"
71
+ msgstr "Jämför"
72
+
73
+ #: ../tadv_admin.php:169
74
+ msgid "Import"
75
+ msgstr "Importera"
76
+
77
+ #: ../tadv_admin.php:196
78
+ msgid "Importing of settings failed."
79
+ msgstr "Import av inställningar misslyckades."
80
+
81
+ #: ../tadv_admin.php:221
82
+ msgid "ERROR: All toolbars are empty. Default settings loaded."
83
+ msgstr "FEL: Alla verktygsfält är tomma. Ursprungsinställningar inladdade."
84
+
85
+ #: ../tadv_admin.php:233
86
+ msgid "Editor Settings"
87
+ msgstr "Redigerarinställningar"
88
+
89
+ #: ../tadv_admin.php:240
90
+ msgid "Settings saved."
91
+ msgstr "Inställningar sparade."
92
+
93
+ #: ../tadv_admin.php:249 ../tadv_admin.php:513
94
+ msgid "Save Changes"
95
+ msgstr "Spara ändringar"
96
+
97
+ #: ../tadv_admin.php:254
98
+ msgid ""
99
+ "New in TinyMCE 4.0/WordPress 3.9 is the editor menu. When it is enabled, "
100
+ "most buttons are also available as menu items."
101
+ msgstr ""
102
+ "Nytt i TinyMCE 4.0/WordPress 3.9 är redigerarmenyn. När den är aktiverad "
103
+ "blir de flesta knapparna också tillgängliga som menyval."
104
+
105
+ #: ../tadv_admin.php:258
106
+ msgid "Enable the editor menu."
107
+ msgstr "Aktivera redigerarmenyn."
108
+
109
+ #: ../tadv_admin.php:370
110
+ msgid ""
111
+ "Drag buttons from the unused buttons below and drop them in the toolbars "
112
+ "above, or drag the buttons in the toolbars to rearrange them."
113
+ msgstr ""
114
+ "Dra knappar från de oanvända knapparna nedan och släpp dem i verktygsfälten "
115
+ "ovan, eller dra knapparna i verktygsfältet för att arrangera om dem."
116
+
117
+ #: ../tadv_admin.php:373
118
+ msgid "Unused Buttons"
119
+ msgstr "Oanvända knappar"
120
+
121
+ #: ../tadv_admin.php:414
122
+ msgid "Also enable:"
123
+ msgstr "Aktivera också:"
124
+
125
+ #: ../tadv_admin.php:417
126
+ msgid "List Style Options"
127
+ msgstr "Liststil-tillval"
128
+
129
+ #: ../tadv_admin.php:422
130
+ msgid "Context Menu"
131
+ msgstr "Sammanhangsmeny"
132
+
133
+ #: ../tadv_admin.php:427
134
+ msgid "Link (replaces the Insert/Edit Link dialog)"
135
+ msgstr "Länk (ersätter dialogfönstret Infoga/redigera länk)"
136
+
137
+ #: ../tadv_admin.php:437
138
+ msgid "Advanced Options"
139
+ msgstr "Avancerade tillval"
140
+
141
+ #: ../tadv_admin.php:445
142
+ msgid "Import editor-style.css."
143
+ msgstr "Importera editor-style.css."
144
+
145
+ #: ../tadv_admin.php:447
146
+ msgid "It seems your theme does not support customised styles for the editor."
147
+ msgstr ""
148
+ "Det verkar som att ditt tema inte stöder anpassade stilar för redigeraren."
149
+
150
+ #: ../tadv_admin.php:448
151
+ msgid ""
152
+ "You can create a CSS file named <code>editor-style.css</code> and upload it "
153
+ "to your theme's directory."
154
+ msgstr ""
155
+ "Du kan skapa en CSS-fil namngiven <code>editor-style.css</code> och ladda "
156
+ "upp till ditt temas mapp."
157
+
158
+ #: ../tadv_admin.php:449
159
+ msgid "After that, enable this setting."
160
+ msgstr "Efteråt, aktivera denna inställning."
161
+
162
+ #: ../tadv_admin.php:458
163
+ msgid ""
164
+ "Load the CSS classes used in editor-style.css and replace the Formats button "
165
+ "and sub-menu."
166
+ msgstr ""
167
+ "Ladda CSS-klasser från editor-style.css och ersätt Formaterings-knapp och "
168
+ "undermeny."
169
+
170
+ #: ../tadv_admin.php:463
171
+ msgid "Markdown typing support (text pattern plugin)"
172
+ msgstr "Stöd för att skriva Markdown (tillägg för textflöde)"
173
+
174
+ #: ../tadv_admin.php:465
175
+ msgid ""
176
+ "This plugin matches special patterns while you type and applies formats or "
177
+ "executes commands on the matched text."
178
+ msgstr ""
179
+ "Detta tillägg matchar speciella mönster medan du skriver och applicerar "
180
+ "formatering eller utför kommandon utifrån matchad text."
181
+
182
+ #: ../tadv_admin.php:466
183
+ msgid ""
184
+ "The default patterns are the same as the markdown syntax so you can type "
185
+ "<code># text</code> to create a header, <code>1. text</code> to create a "
186
+ "list, <code>**text**</code> to make it bold, etc."
187
+ msgstr ""
188
+ "Standardmönster är samma som markdown-syntax så att du kan skriva <code># "
189
+ "text</code> för att skapa en rubrik, <code>1. text</code> för att skapa en "
190
+ "lista, <code>**text**</code> för fet stil etc."
191
+
192
+ #: ../tadv_admin.php:467
193
+ msgid "More information"
194
+ msgstr "Mer information"
195
+
196
+ #: ../tadv_admin.php:473
197
+ msgid ""
198
+ "Stop removing the &lt;p&gt; and &lt;br /&gt; tags when saving and show them "
199
+ "in the Text editor"
200
+ msgstr ""
201
+ "Sluta ta bort &lt;p&gt; och &lt;br /&gt;-taggar vid sparande och visa dem i "
202
+ "textredigeraren"
203
+
204
+ #: ../tadv_admin.php:475
205
+ msgid ""
206
+ "This will make it possible to use more advanced coding in the HTML editor "
207
+ "without the back-end filtering affecting it much."
208
+ msgstr ""
209
+ "Detta möjliggör mer avancerad kodning i HTML-redigeraren utan att backend-"
210
+ "filtrering påverkar så mycket."
211
+
212
+ #: ../tadv_admin.php:476
213
+ msgid ""
214
+ "However it may behave unexpectedly in rare cases, so test it thoroughly "
215
+ "before enabling it permanently."
216
+ msgstr ""
217
+ "Ändå kan det uppföra sig oväntat i särskilda fall, så testa noggrant innan "
218
+ "du aktiverar det permanent."
219
+
220
+ #: ../tadv_admin.php:477
221
+ msgid ""
222
+ "Line breaks in the HTML editor would still affect the output, in particular "
223
+ "do not use empty lines, line breaks inside HTML tags or multiple &lt;br /"
224
+ "&gt; tags."
225
+ msgstr ""
226
+ "Radbrytningar i HTML-redigeraren skulle fortfarande påverka utmatningen så "
227
+ "använd i synnerhet inte några tomma rader, radbrytningar inuti HTML-taggar "
228
+ "eller flera &lt;br /&gt;-taggar."
229
+
230
+ #: ../tadv_admin.php:483
231
+ msgid "Replace font size settings"
232
+ msgstr "Ersätt textstorleksinställningar"
233
+
234
+ #: ../tadv_admin.php:484
235
+ msgid ""
236
+ "Replaces the size setting available for fonts with: 8px 10px 12px 14px 16px "
237
+ "20px 24px 28px 32px 36px."
238
+ msgstr ""
239
+ "Ersätter storleksinställningen för teckensnitt med: 8px 10px 12px 14px 16px "
240
+ "20px 24px 28px 32px 36px."
241
+
242
+ #: ../tadv_admin.php:489
243
+ msgid "Enable pasting of image source"
244
+ msgstr "Aktivera inklistring av bildkällor"
245
+
246
+ #: ../tadv_admin.php:491
247
+ msgid ""
248
+ "Works only in Firefox and Safari. These browsers support pasting of images "
249
+ "directly in the editor and convert them to base64 encoded text."
250
+ msgstr ""
251
+ "Fungerar enbart med Firefox och Safari. Dessa webbläsare stöder inklistring "
252
+ "av bilder direkt i redigeraren och konverterar dem till base64-kodad text."
253
+
254
+ #: ../tadv_admin.php:492
255
+ msgid ""
256
+ "This is not acceptable for larger images like photos or graphics, but may be "
257
+ "useful in some cases for very small images like icons, not larger than 2-3KB."
258
+ msgstr ""
259
+ "Detta är inte acceptabelt för större bilder som foton eller grafik, men kan "
260
+ "vara användbart i vissa fall för väldigt små bilder såsom ikoner, inte "
261
+ "större än 2-3kB."
262
+
263
+ #: ../tadv_admin.php:493
264
+ msgid "These images will not be available in the Media Library."
265
+ msgstr "Dessa bilder kommer inte att finnas i Mediabiblioteket."
266
+
267
+ #: ../tadv_admin.php:499
268
+ msgid "Administration"
269
+ msgstr "Administration"
270
+
271
+ #: ../tadv_admin.php:501
272
+ msgid "Export Settings"
273
+ msgstr "Exportera inställningar"
274
+
275
+ #: ../tadv_admin.php:502
276
+ msgid "Import Settings"
277
+ msgstr "Importera inställningar"
278
+
279
+ #: ../tadv_admin.php:512
280
+ msgid "Restore Default Settings"
281
+ msgstr "Återställ ursprungsinställningar"
282
+
283
+ #: ../tadv_admin.php:518
284
+ msgid ""
285
+ "The [Toolbar toggle] button shows or hides the second, third, and forth "
286
+ "button rows. It will only work when it is in the first row and there are "
287
+ "buttons in the second row."
288
+ msgstr ""
289
+ "[Växla verktygsfält]-knappen visar eller gömmer den andra, tredje och fjärde "
290
+ "knappraden. Det fungerar endast när knappen finns på den första raden och "
291
+ "det finns knappar i den andra raden."
292
+
293
+ #: ../tinymce-advanced.php:166
294
+ #, php-format
295
+ msgid ""
296
+ "TinyMCE Advanced requires WordPress version %1$s or newer. It appears that "
297
+ "you are running %2$s. This can make the editor unstable."
298
+ msgstr ""
299
+ "Detta tillägg kräver WordPress version %1$s eller nyare. Det verkar som att "
300
+ "du kör %2$s. Detta kan göra redigeraren instabil."
301
+
302
+ #: ../tinymce-advanced.php:173
303
+ #, php-format
304
+ msgid ""
305
+ "Please upgrade your WordPress installation or download an <a href=\"%s"
306
+ "\">older version of the plugin</a>."
307
+ msgstr ""
308
+ "Vänligen uppgradera din WordPress-installation eller ladda hem en <a href="
309
+ "\"%s\">äldre version av tillägget</a>."
mce/advlist/plugin.js CHANGED
@@ -1,8 +1,8 @@
1
  /**
2
  * plugin.js
3
  *
4
- * Copyright, Moxiecode Systems AB
5
  * Released under LGPL License.
 
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
1
  /**
2
  * plugin.js
3
  *
 
4
  * Released under LGPL License.
5
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
mce/anchor/plugin.js CHANGED
@@ -1,8 +1,8 @@
1
  /**
2
  * plugin.js
3
  *
4
- * Copyright, Moxiecode Systems AB
5
  * Released under LGPL License.
 
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
1
  /**
2
  * plugin.js
3
  *
 
4
  * Released under LGPL License.
5
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
mce/code/plugin.js CHANGED
@@ -1,8 +1,8 @@
1
  /**
2
  * plugin.js
3
  *
4
- * Copyright, Moxiecode Systems AB
5
  * Released under LGPL License.
 
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
1
  /**
2
  * plugin.js
3
  *
 
4
  * Released under LGPL License.
5
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
mce/contextmenu/plugin.js CHANGED
@@ -1,8 +1,8 @@
1
  /**
2
  * plugin.js
3
  *
4
- * Copyright, Moxiecode Systems AB
5
  * Released under LGPL License.
 
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
@@ -62,8 +62,9 @@ tinymce.PluginManager.add('contextmenu', function(editor) {
62
 
63
  menu = new tinymce.ui.Menu({
64
  items: items,
65
- context: 'contextmenu'
66
- }).addClass('contextmenu').renderTo();
 
67
 
68
  editor.on('remove', function() {
69
  menu.remove();
1
  /**
2
  * plugin.js
3
  *
 
4
  * Released under LGPL License.
5
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
62
 
63
  menu = new tinymce.ui.Menu({
64
  items: items,
65
+ context: 'contextmenu',
66
+ classes: 'contextmenu'
67
+ }).renderTo();
68
 
69
  editor.on('remove', function() {
70
  menu.remove();
mce/contextmenu/plugin.min.js CHANGED
@@ -1 +1 @@
1
- tinymce.PluginManager.add("contextmenu",function(a){var b,c=a.settings.contextmenu_never_use_native;a.on("contextmenu",function(d){var e,f=a.getDoc();if(!d.ctrlKey||c){if(d.preventDefault(),tinymce.Env.mac&&tinymce.Env.webkit&&2==d.button&&f.caretRangeFromPoint&&a.selection.setRng(f.caretRangeFromPoint(d.x,d.y)),e=a.settings.contextmenu||"link image inserttable | cell row column deletetable",b)b.show();else{var g=[];tinymce.each(e.split(/[ ,]/),function(b){var c=a.menuItems[b];"|"==b&&(c={text:b}),c&&(c.shortcut="",g.push(c))});for(var h=0;h<g.length;h++)"|"==g[h].text&&(0===h||h==g.length-1)&&g.splice(h,1);b=new tinymce.ui.Menu({items:g,context:"contextmenu"}).addClass("contextmenu").renderTo(),a.on("remove",function(){b.remove(),b=null})}var i={x:d.pageX,y:d.pageY};a.inline||(i=tinymce.DOM.getPos(a.getContentAreaContainer()),i.x+=d.clientX,i.y+=d.clientY),b.moveTo(i.x,i.y)}})});
1
+ tinymce.PluginManager.add("contextmenu",function(a){var b,c=a.settings.contextmenu_never_use_native;a.on("contextmenu",function(d){var e,f=a.getDoc();if(!d.ctrlKey||c){if(d.preventDefault(),tinymce.Env.mac&&tinymce.Env.webkit&&2==d.button&&f.caretRangeFromPoint&&a.selection.setRng(f.caretRangeFromPoint(d.x,d.y)),e=a.settings.contextmenu||"link image inserttable | cell row column deletetable",b)b.show();else{var g=[];tinymce.each(e.split(/[ ,]/),function(b){var c=a.menuItems[b];"|"==b&&(c={text:b}),c&&(c.shortcut="",g.push(c))});for(var h=0;h<g.length;h++)"|"==g[h].text&&(0===h||h==g.length-1)&&g.splice(h,1);b=new tinymce.ui.Menu({items:g,context:"contextmenu",classes:"contextmenu"}).renderTo(),a.on("remove",function(){b.remove(),b=null})}var i={x:d.pageX,y:d.pageY};a.inline||(i=tinymce.DOM.getPos(a.getContentAreaContainer()),i.x+=d.clientX,i.y+=d.clientY),b.moveTo(i.x,i.y)}})});
mce/importcss/plugin.js CHANGED
@@ -1,8 +1,8 @@
1
  /**
2
  * plugin.js
3
  *
4
- * Copyright, Moxiecode Systems AB
5
  * Released under LGPL License.
 
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
@@ -73,7 +73,9 @@ tinymce.PluginManager.add('importcss', function(editor) {
73
  each(doc.styleSheets, function(styleSheet) {
74
  append(styleSheet);
75
  });
76
- } catch (e) {}
 
 
77
 
78
  return selectors;
79
  }
1
  /**
2
  * plugin.js
3
  *
 
4
  * Released under LGPL License.
5
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
73
  each(doc.styleSheets, function(styleSheet) {
74
  append(styleSheet);
75
  });
76
+ } catch (e) {
77
+ // Ignore
78
+ }
79
 
80
  return selectors;
81
  }
mce/insertdatetime/plugin.js CHANGED
@@ -1,8 +1,8 @@
1
  /**
2
  * plugin.js
3
  *
4
- * Copyright, Moxiecode Systems AB
5
  * Released under LGPL License.
 
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
1
  /**
2
  * plugin.js
3
  *
 
4
  * Released under LGPL License.
5
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
mce/link/plugin.js CHANGED
@@ -1,8 +1,8 @@
1
  /**
2
  * plugin.js
3
  *
4
- * Copyright, Moxiecode Systems AB
5
  * Released under LGPL License.
 
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
@@ -196,6 +196,7 @@ tinymce.PluginManager.add('link', function(editor) {
196
  onselect: linkListChangeHandler,
197
  value: editor.convertURL(data.href, 'href'),
198
  onPostRender: function() {
 
199
  linkListCtrl = this;
200
  }
201
  };
1
  /**
2
  * plugin.js
3
  *
 
4
  * Released under LGPL License.
5
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
196
  onselect: linkListChangeHandler,
197
  value: editor.convertURL(data.href, 'href'),
198
  onPostRender: function() {
199
+ /*eslint consistent-this:0*/
200
  linkListCtrl = this;
201
  }
202
  };
mce/nonbreaking/plugin.js CHANGED
@@ -1,8 +1,8 @@
1
  /**
2
  * plugin.js
3
  *
4
- * Copyright, Moxiecode Systems AB
5
  * Released under LGPL License.
 
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
1
  /**
2
  * plugin.js
3
  *
 
4
  * Released under LGPL License.
5
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
mce/print/plugin.js CHANGED
@@ -1,8 +1,8 @@
1
  /**
2
  * plugin.js
3
  *
4
- * Copyright, Moxiecode Systems AB
5
  * Released under LGPL License.
 
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
1
  /**
2
  * plugin.js
3
  *
 
4
  * Released under LGPL License.
5
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
mce/searchreplace/plugin.js CHANGED
@@ -1,8 +1,8 @@
1
  /**
2
  * plugin.js
3
  *
4
- * Copyright, Moxiecode Systems AB
5
  * Released under LGPL License.
 
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
@@ -203,34 +203,34 @@
203
  node.parentNode.removeChild(node);
204
 
205
  return el;
206
- } else {
207
- // Replace startNode -> [innerNodes...] -> endNode (in that order)
208
- before = doc.createTextNode(startNode.data.substring(0, range.startNodeIndex));
209
- after = doc.createTextNode(endNode.data.substring(range.endNodeIndex));
210
- var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex);
211
- var innerEls = [];
212
-
213
- for (var i = 0, l = range.innerNodes.length; i < l; ++i) {
214
- var innerNode = range.innerNodes[i];
215
- var innerEl = makeReplacementNode(innerNode.data, matchIndex);
216
- innerNode.parentNode.replaceChild(innerEl, innerNode);
217
- innerEls.push(innerEl);
218
- }
219
 
220
- var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex);
 
 
 
 
 
 
 
 
 
 
 
221
 
222
- parentNode = startNode.parentNode;
223
- parentNode.insertBefore(before, startNode);
224
- parentNode.insertBefore(elA, startNode);
225
- parentNode.removeChild(startNode);
226
 
227
- parentNode = endNode.parentNode;
228
- parentNode.insertBefore(elB, endNode);
229
- parentNode.insertBefore(after, endNode);
230
- parentNode.removeChild(endNode);
231
 
232
- return elB;
233
- }
 
 
 
 
234
  };
235
  }
236
 
@@ -260,7 +260,9 @@
260
  var self = this, currentIndex = -1;
261
 
262
  function showDialog() {
263
- var last = {};
 
 
264
 
265
  function updateButtonStates() {
266
  win.statusbar.find('#next').disabled(!findSpansByIndex(currentIndex + 1).length);
@@ -323,7 +325,7 @@
323
  };
324
  },
325
  buttons: [
326
- {text: "Find", onclick: function() {
327
  win.submit();
328
  }},
329
  {text: "Replace", disabled: true, onclick: function() {
@@ -355,7 +357,7 @@
355
  labelGap: 30,
356
  spacing: 10,
357
  items: [
358
- {type: 'textbox', name: 'find', size: 40, label: 'Find', value: editor.selection.getNode().src},
359
  {type: 'textbox', name: 'replace', size: 40, label: 'Replace with'},
360
  {type: 'checkbox', name: 'case', text: 'Match case', label: ' '},
361
  {type: 'checkbox', name: 'words', text: 'Whole words', label: ' '}
@@ -463,7 +465,13 @@
463
  }
464
 
465
  function removeNode(node) {
466
- node.parentNode.removeChild(node);
 
 
 
 
 
 
467
  }
468
 
469
  self.find = function(text, matchCase, wholeWord) {
@@ -496,20 +504,22 @@
496
  }
497
  };
498
 
 
 
 
 
 
 
499
  self.replace = function(text, forward, all) {
500
  var i, nodes, node, matchIndex, currentMatchIndex, nextIndex = currentIndex, hasMore;
501
 
502
  forward = forward !== false;
503
 
504
  node = editor.getBody();
505
- nodes = tinymce.toArray(node.getElementsByTagName('span'));
506
  for (i = 0; i < nodes.length; i++) {
507
  var nodeIndex = getElmIndex(nodes[i]);
508
 
509
- if (nodeIndex === null || !nodeIndex.length) {
510
- continue;
511
- }
512
-
513
  matchIndex = currentMatchIndex = parseInt(nodeIndex, 10);
514
  if (all || matchIndex === currentIndex) {
515
  if (text.length) {
@@ -520,11 +530,7 @@
520
  }
521
 
522
  while (nodes[++i]) {
523
- matchIndex = getElmIndex(nodes[i]);
524
-
525
- if (nodeIndex === null || !nodeIndex.length) {
526
- continue;
527
- }
528
 
529
  if (matchIndex === currentMatchIndex) {
530
  removeNode(nodes[i]);
1
  /**
2
  * plugin.js
3
  *
 
4
  * Released under LGPL License.
5
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
203
  node.parentNode.removeChild(node);
204
 
205
  return el;
206
+ }
 
 
 
 
 
 
 
 
 
 
 
 
207
 
208
+ // Replace startNode -> [innerNodes...] -> endNode (in that order)
209
+ before = doc.createTextNode(startNode.data.substring(0, range.startNodeIndex));
210
+ after = doc.createTextNode(endNode.data.substring(range.endNodeIndex));
211
+ var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex);
212
+ var innerEls = [];
213
+
214
+ for (var i = 0, l = range.innerNodes.length; i < l; ++i) {
215
+ var innerNode = range.innerNodes[i];
216
+ var innerEl = makeReplacementNode(innerNode.data, matchIndex);
217
+ innerNode.parentNode.replaceChild(innerEl, innerNode);
218
+ innerEls.push(innerEl);
219
+ }
220
 
221
+ var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex);
 
 
 
222
 
223
+ parentNode = startNode.parentNode;
224
+ parentNode.insertBefore(before, startNode);
225
+ parentNode.insertBefore(elA, startNode);
226
+ parentNode.removeChild(startNode);
227
 
228
+ parentNode = endNode.parentNode;
229
+ parentNode.insertBefore(elB, endNode);
230
+ parentNode.insertBefore(after, endNode);
231
+ parentNode.removeChild(endNode);
232
+
233
+ return elB;
234
  };
235
  }
236
 
260
  var self = this, currentIndex = -1;
261
 
262
  function showDialog() {
263
+ var last = {}, selectedText;
264
+
265
+ selectedText = tinymce.trim(editor.selection.getContent({format: 'text'}));
266
 
267
  function updateButtonStates() {
268
  win.statusbar.find('#next').disabled(!findSpansByIndex(currentIndex + 1).length);
325
  };
326
  },
327
  buttons: [
328
+ {text: "Find", subtype: 'primary', onclick: function() {
329
  win.submit();
330
  }},
331
  {text: "Replace", disabled: true, onclick: function() {
357
  labelGap: 30,
358
  spacing: 10,
359
  items: [
360
+ {type: 'textbox', name: 'find', size: 40, label: 'Find', value: selectedText},
361
  {type: 'textbox', name: 'replace', size: 40, label: 'Replace with'},
362
  {type: 'checkbox', name: 'case', text: 'Match case', label: ' '},
363
  {type: 'checkbox', name: 'words', text: 'Whole words', label: ' '}
465
  }
466
 
467
  function removeNode(node) {
468
+ var dom = editor.dom, parent = node.parentNode;
469
+
470
+ dom.remove(node);
471
+
472
+ if (dom.isEmpty(parent)) {
473
+ dom.remove(parent);
474
+ }
475
  }
476
 
477
  self.find = function(text, matchCase, wholeWord) {
504
  }
505
  };
506
 
507
+ function isMatchSpan(node) {
508
+ var matchIndex = getElmIndex(node);
509
+
510
+ return matchIndex !== null && matchIndex.length > 0;
511
+ }
512
+
513
  self.replace = function(text, forward, all) {
514
  var i, nodes, node, matchIndex, currentMatchIndex, nextIndex = currentIndex, hasMore;
515
 
516
  forward = forward !== false;
517
 
518
  node = editor.getBody();
519
+ nodes = tinymce.grep(tinymce.toArray(node.getElementsByTagName('span')), isMatchSpan);
520
  for (i = 0; i < nodes.length; i++) {
521
  var nodeIndex = getElmIndex(nodes[i]);
522
 
 
 
 
 
523
  matchIndex = currentMatchIndex = parseInt(nodeIndex, 10);
524
  if (all || matchIndex === currentIndex) {
525
  if (text.length) {
530
  }
531
 
532
  while (nodes[++i]) {
533
+ matchIndex = parseInt(getElmIndex(nodes[i]), 10);
 
 
 
 
534
 
535
  if (matchIndex === currentMatchIndex) {
536
  removeNode(nodes[i]);
mce/searchreplace/plugin.min.js CHANGED
@@ -1 +1 @@
1
- !function(){function a(a,b,c,d,e){function f(a,b){if(b=b||0,!a[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var c=a.index;if(b>0){var d=a[b];if(!d)throw"Invalid capture group";c+=a[0].indexOf(d),a[0]=d}return[c,c+a[0].length,[a[0]]]}function g(a){var b;if(3===a.nodeType)return a.data;if(n[a.nodeName]&&!m[a.nodeName])return"";if(b="",(m[a.nodeName]||o[a.nodeName])&&(b+="\n"),a=a.firstChild)do b+=g(a);while(a=a.nextSibling);return b}function h(a,b,c){var d,e,f,g,h=[],i=0,j=a,k=b.shift(),l=0;a:for(;;){if((m[j.nodeName]||o[j.nodeName])&&i++,3===j.nodeType&&(!e&&j.length+i>=k[1]?(e=j,g=k[1]-i):d&&h.push(j),!d&&j.length+i>k[0]&&(d=j,f=k[0]-i),i+=j.length),d&&e){if(j=c({startNode:d,startNodeIndex:f,endNode:e,endNodeIndex:g,innerNodes:h,match:k[2],matchIndex:l}),i-=e.length-g,d=null,e=null,h=[],k=b.shift(),l++,!k)break}else{if((!n[j.nodeName]||m[j.nodeName])&&j.firstChild){j=j.firstChild;continue}if(j.nextSibling){j=j.nextSibling;continue}}for(;;){if(j.nextSibling){j=j.nextSibling;break}if(j.parentNode===a)break a;j=j.parentNode}}}function i(a){var b;if("function"!=typeof a){var c=a.nodeType?a:l.createElement(a);b=function(a,b){var d=c.cloneNode(!1);return d.setAttribute("data-mce-index",b),a&&d.appendChild(l.createTextNode(a)),d}}else b=a;return function(a){var c,d,e,f=a.startNode,g=a.endNode,h=a.matchIndex;if(f===g){var i=f;e=i.parentNode,a.startNodeIndex>0&&(c=l.createTextNode(i.data.substring(0,a.startNodeIndex)),e.insertBefore(c,i));var j=b(a.match[0],h);return e.insertBefore(j,i),a.endNodeIndex<i.length&&(d=l.createTextNode(i.data.substring(a.endNodeIndex)),e.insertBefore(d,i)),i.parentNode.removeChild(i),j}c=l.createTextNode(f.data.substring(0,a.startNodeIndex)),d=l.createTextNode(g.data.substring(a.endNodeIndex));for(var k=b(f.data.substring(a.startNodeIndex),h),m=[],n=0,o=a.innerNodes.length;o>n;++n){var p=a.innerNodes[n],q=b(p.data,h);p.parentNode.replaceChild(q,p),m.push(q)}var r=b(g.data.substring(0,a.endNodeIndex),h);return e=f.parentNode,e.insertBefore(c,f),e.insertBefore(k,f),e.removeChild(f),e=g.parentNode,e.insertBefore(r,g),e.insertBefore(d,g),e.removeChild(g),r}}var j,k,l,m,n,o,p=[],q=0;if(l=b.ownerDocument,m=e.getBlockElements(),n=e.getWhiteSpaceElements(),o=e.getShortEndedElements(),k=g(b)){if(a.global)for(;j=a.exec(k);)p.push(f(j,d));else j=k.match(a),p.push(f(j,d));return p.length&&(q=p.length,h(b,p,i(c))),q}}function b(b){function c(){function a(){e.statusbar.find("#next").disabled(!g(k+1).length),e.statusbar.find("#prev").disabled(!g(k-1).length)}function c(){tinymce.ui.MessageBox.alert("Could not find the specified string.",function(){e.find("#find")[0].focus()})}var d={},e=tinymce.ui.Factory.create({type:"window",layout:"flex",pack:"center",align:"center",onClose:function(){b.focus(),j.done()},onSubmit:function(b){var f,h,i,l;return b.preventDefault(),h=e.find("#case").checked(),l=e.find("#words").checked(),i=e.find("#find").value(),i.length?d.text==i&&d.caseState==h&&d.wholeWord==l?0===g(k+1).length?void c():(j.next(),void a()):(f=j.find(i,h,l),f||c(),e.statusbar.items().slice(1).disabled(0===f),a(),void(d={text:i,caseState:h,wholeWord:l})):(j.done(!1),void e.statusbar.items().slice(1).disabled(!0))},buttons:[{text:"Find",onclick:function(){e.submit()}},{text:"Replace",disabled:!0,onclick:function(){j.replace(e.find("#replace").value())||(e.statusbar.items().slice(1).disabled(!0),k=-1,d={})}},{text:"Replace all",disabled:!0,onclick:function(){j.replace(e.find("#replace").value(),!0,!0),e.statusbar.items().slice(1).disabled(!0),d={}}},{type:"spacer",flex:1},{text:"Prev",name:"prev",disabled:!0,onclick:function(){j.prev(),a()}},{text:"Next",name:"next",disabled:!0,onclick:function(){j.next(),a()}}],title:"Find and replace",items:{type:"form",padding:20,labelGap:30,spacing:10,items:[{type:"textbox",name:"find",size:40,label:"Find",value:b.selection.getNode().src},{type:"textbox",name:"replace",size:40,label:"Replace with"},{type:"checkbox",name:"case",text:"Match case",label:" "},{type:"checkbox",name:"words",text:"Whole words",label:" "}]}}).renderTo().reflow()}function d(a){var b=a.getAttribute("data-mce-index");return"number"==typeof b?""+b:b}function e(c){var d,e;return e=b.dom.create("span",{"data-mce-bogus":1}),e.className="mce-match-marker",d=b.getBody(),j.done(!1),a(c,d,e,!1,b.schema)}function f(a){var b=a.parentNode;a.firstChild&&b.insertBefore(a.firstChild,a),a.parentNode.removeChild(a)}function g(a){var c,e=[];if(c=tinymce.toArray(b.getBody().getElementsByTagName("span")),c.length)for(var f=0;f<c.length;f++){var g=d(c[f]);null!==g&&g.length&&g===a.toString()&&e.push(c[f])}return e}function h(a){var c=k,d=b.dom;a=a!==!1,a?c++:c--,d.removeClass(g(k),"mce-match-marker-selected");var e=g(c);return e.length?(d.addClass(g(c),"mce-match-marker-selected"),b.selection.scrollIntoView(e[0]),c):-1}function i(a){a.parentNode.removeChild(a)}var j=this,k=-1;j.init=function(a){a.addMenuItem("searchreplace",{text:"Find and replace",shortcut:"Meta+F",onclick:c,separator:"before",context:"edit"}),a.addButton("searchreplace",{tooltip:"Find and replace",shortcut:"Meta+F",onclick:c}),a.addCommand("SearchReplace",c),a.shortcuts.add("Meta+F","",c)},j.find=function(a,b,c){a=a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),a=c?"\\b"+a+"\\b":a;var d=e(new RegExp(a,b?"g":"gi"));return d&&(k=-1,k=h(!0)),d},j.next=function(){var a=h(!0);-1!==a&&(k=a)},j.prev=function(){var a=h(!1);-1!==a&&(k=a)},j.replace=function(a,c,e){var h,l,m,n,o,p,q=k;for(c=c!==!1,m=b.getBody(),l=tinymce.toArray(m.getElementsByTagName("span")),h=0;h<l.length;h++){var r=d(l[h]);if(null!==r&&r.length)if(n=o=parseInt(r,10),e||n===k){for(a.length?(l[h].firstChild.nodeValue=a,f(l[h])):i(l[h]);l[++h];)if(n=d(l[h]),null!==r&&r.length){if(n!==o){h--;break}i(l[h])}c&&q--}else o>k&&l[h].setAttribute("data-mce-index",o-1)}return b.undoManager.add(),k=q,c?(p=g(q+1).length>0,j.next()):(p=g(q-1).length>0,j.prev()),!e&&p},j.done=function(a){var c,e,g,h;for(e=tinymce.toArray(b.getBody().getElementsByTagName("span")),c=0;c<e.length;c++){var i=d(e[c]);null!==i&&i.length&&(i===k.toString()&&(g||(g=e[c].firstChild),h=e[c].firstChild),f(e[c]))}if(g&&h){var j=b.dom.createRng();return j.setStart(g,0),j.setEnd(h,h.data.length),a!==!1&&b.selection.setRng(j),j}}}tinymce.PluginManager.add("searchreplace",b)}();
1
+ !function(){function a(a,b,c,d,e){function f(a,b){if(b=b||0,!a[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var c=a.index;if(b>0){var d=a[b];if(!d)throw"Invalid capture group";c+=a[0].indexOf(d),a[0]=d}return[c,c+a[0].length,[a[0]]]}function g(a){var b;if(3===a.nodeType)return a.data;if(n[a.nodeName]&&!m[a.nodeName])return"";if(b="",(m[a.nodeName]||o[a.nodeName])&&(b+="\n"),a=a.firstChild)do b+=g(a);while(a=a.nextSibling);return b}function h(a,b,c){var d,e,f,g,h=[],i=0,j=a,k=b.shift(),l=0;a:for(;;){if((m[j.nodeName]||o[j.nodeName])&&i++,3===j.nodeType&&(!e&&j.length+i>=k[1]?(e=j,g=k[1]-i):d&&h.push(j),!d&&j.length+i>k[0]&&(d=j,f=k[0]-i),i+=j.length),d&&e){if(j=c({startNode:d,startNodeIndex:f,endNode:e,endNodeIndex:g,innerNodes:h,match:k[2],matchIndex:l}),i-=e.length-g,d=null,e=null,h=[],k=b.shift(),l++,!k)break}else{if((!n[j.nodeName]||m[j.nodeName])&&j.firstChild){j=j.firstChild;continue}if(j.nextSibling){j=j.nextSibling;continue}}for(;;){if(j.nextSibling){j=j.nextSibling;break}if(j.parentNode===a)break a;j=j.parentNode}}}function i(a){var b;if("function"!=typeof a){var c=a.nodeType?a:l.createElement(a);b=function(a,b){var d=c.cloneNode(!1);return d.setAttribute("data-mce-index",b),a&&d.appendChild(l.createTextNode(a)),d}}else b=a;return function(a){var c,d,e,f=a.startNode,g=a.endNode,h=a.matchIndex;if(f===g){var i=f;e=i.parentNode,a.startNodeIndex>0&&(c=l.createTextNode(i.data.substring(0,a.startNodeIndex)),e.insertBefore(c,i));var j=b(a.match[0],h);return e.insertBefore(j,i),a.endNodeIndex<i.length&&(d=l.createTextNode(i.data.substring(a.endNodeIndex)),e.insertBefore(d,i)),i.parentNode.removeChild(i),j}c=l.createTextNode(f.data.substring(0,a.startNodeIndex)),d=l.createTextNode(g.data.substring(a.endNodeIndex));for(var k=b(f.data.substring(a.startNodeIndex),h),m=[],n=0,o=a.innerNodes.length;o>n;++n){var p=a.innerNodes[n],q=b(p.data,h);p.parentNode.replaceChild(q,p),m.push(q)}var r=b(g.data.substring(0,a.endNodeIndex),h);return e=f.parentNode,e.insertBefore(c,f),e.insertBefore(k,f),e.removeChild(f),e=g.parentNode,e.insertBefore(r,g),e.insertBefore(d,g),e.removeChild(g),r}}var j,k,l,m,n,o,p=[],q=0;if(l=b.ownerDocument,m=e.getBlockElements(),n=e.getWhiteSpaceElements(),o=e.getShortEndedElements(),k=g(b)){if(a.global)for(;j=a.exec(k);)p.push(f(j,d));else j=k.match(a),p.push(f(j,d));return p.length&&(q=p.length,h(b,p,i(c))),q}}function b(b){function c(){function a(){f.statusbar.find("#next").disabled(!g(l+1).length),f.statusbar.find("#prev").disabled(!g(l-1).length)}function c(){tinymce.ui.MessageBox.alert("Could not find the specified string.",function(){f.find("#find")[0].focus()})}var d,e={};d=tinymce.trim(b.selection.getContent({format:"text"}));var f=tinymce.ui.Factory.create({type:"window",layout:"flex",pack:"center",align:"center",onClose:function(){b.focus(),k.done()},onSubmit:function(b){var d,h,i,j;return b.preventDefault(),h=f.find("#case").checked(),j=f.find("#words").checked(),i=f.find("#find").value(),i.length?e.text==i&&e.caseState==h&&e.wholeWord==j?0===g(l+1).length?void c():(k.next(),void a()):(d=k.find(i,h,j),d||c(),f.statusbar.items().slice(1).disabled(0===d),a(),void(e={text:i,caseState:h,wholeWord:j})):(k.done(!1),void f.statusbar.items().slice(1).disabled(!0))},buttons:[{text:"Find",subtype:"primary",onclick:function(){f.submit()}},{text:"Replace",disabled:!0,onclick:function(){k.replace(f.find("#replace").value())||(f.statusbar.items().slice(1).disabled(!0),l=-1,e={})}},{text:"Replace all",disabled:!0,onclick:function(){k.replace(f.find("#replace").value(),!0,!0),f.statusbar.items().slice(1).disabled(!0),e={}}},{type:"spacer",flex:1},{text:"Prev",name:"prev",disabled:!0,onclick:function(){k.prev(),a()}},{text:"Next",name:"next",disabled:!0,onclick:function(){k.next(),a()}}],title:"Find and replace",items:{type:"form",padding:20,labelGap:30,spacing:10,items:[{type:"textbox",name:"find",size:40,label:"Find",value:d},{type:"textbox",name:"replace",size:40,label:"Replace with"},{type:"checkbox",name:"case",text:"Match case",label:" "},{type:"checkbox",name:"words",text:"Whole words",label:" "}]}}).renderTo().reflow()}function d(a){var b=a.getAttribute("data-mce-index");return"number"==typeof b?""+b:b}function e(c){var d,e;return e=b.dom.create("span",{"data-mce-bogus":1}),e.className="mce-match-marker",d=b.getBody(),k.done(!1),a(c,d,e,!1,b.schema)}function f(a){var b=a.parentNode;a.firstChild&&b.insertBefore(a.firstChild,a),a.parentNode.removeChild(a)}function g(a){var c,e=[];if(c=tinymce.toArray(b.getBody().getElementsByTagName("span")),c.length)for(var f=0;f<c.length;f++){var g=d(c[f]);null!==g&&g.length&&g===a.toString()&&e.push(c[f])}return e}function h(a){var c=l,d=b.dom;a=a!==!1,a?c++:c--,d.removeClass(g(l),"mce-match-marker-selected");var e=g(c);return e.length?(d.addClass(g(c),"mce-match-marker-selected"),b.selection.scrollIntoView(e[0]),c):-1}function i(a){var c=b.dom,d=a.parentNode;c.remove(a),c.isEmpty(d)&&c.remove(d)}function j(a){var b=d(a);return null!==b&&b.length>0}var k=this,l=-1;k.init=function(a){a.addMenuItem("searchreplace",{text:"Find and replace",shortcut:"Meta+F",onclick:c,separator:"before",context:"edit"}),a.addButton("searchreplace",{tooltip:"Find and replace",shortcut:"Meta+F",onclick:c}),a.addCommand("SearchReplace",c),a.shortcuts.add("Meta+F","",c)},k.find=function(a,b,c){a=a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),a=c?"\\b"+a+"\\b":a;var d=e(new RegExp(a,b?"g":"gi"));return d&&(l=-1,l=h(!0)),d},k.next=function(){var a=h(!0);-1!==a&&(l=a)},k.prev=function(){var a=h(!1);-1!==a&&(l=a)},k.replace=function(a,c,e){var h,m,n,o,p,q,r=l;for(c=c!==!1,n=b.getBody(),m=tinymce.grep(tinymce.toArray(n.getElementsByTagName("span")),j),h=0;h<m.length;h++){var s=d(m[h]);if(o=p=parseInt(s,10),e||o===l){for(a.length?(m[h].firstChild.nodeValue=a,f(m[h])):i(m[h]);m[++h];){if(o=parseInt(d(m[h]),10),o!==p){h--;break}i(m[h])}c&&r--}else p>l&&m[h].setAttribute("data-mce-index",p-1)}return b.undoManager.add(),l=r,c?(q=g(r+1).length>0,k.next()):(q=g(r-1).length>0,k.prev()),!e&&q},k.done=function(a){var c,e,g,h;for(e=tinymce.toArray(b.getBody().getElementsByTagName("span")),c=0;c<e.length;c++){var i=d(e[c]);null!==i&&i.length&&(i===l.toString()&&(g||(g=e[c].firstChild),h=e[c].firstChild),f(e[c]))}if(g&&h){var j=b.dom.createRng();return j.setStart(g,0),j.setEnd(h,h.data.length),a!==!1&&b.selection.setRng(j),j}}}tinymce.PluginManager.add("searchreplace",b)}();
mce/table/plugin.js CHANGED
@@ -80,13 +80,50 @@
80
  }
81
  }
82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  // Included from: js/tinymce/plugins/table/classes/TableGrid.js
84
 
85
  /**
86
  * TableGrid.js
87
  *
88
- * Copyright, Moxiecode Systems AB
89
  * Released under LGPL License.
 
90
  *
91
  * License: http://www.tinymce.com/license
92
  * Contributing: http://www.tinymce.com/contributing
@@ -102,13 +139,10 @@
102
  */
103
  define("tinymce/tableplugin/TableGrid", [
104
  "tinymce/util/Tools",
105
- "tinymce/Env"
106
- ], function(Tools, Env) {
107
- var each = Tools.each;
108
-
109
- function getSpanVal(td, name) {
110
- return parseInt(td.getAttribute(name) || 1, 10);
111
- }
112
 
113
  return function(editor, table) {
114
  var grid, gridWidth, startPos, endPos, selectedCell, selection = editor.selection, dom = selection.dom;
@@ -269,9 +303,7 @@ define("tinymce/tableplugin/TableGrid", [
269
  if (formatNode) {
270
  cell.appendChild(formatNode);
271
  } else {
272
- if (!Env.ie || Env.ie > 10) {
273
- cell.innerHTML = '<br data-mce-bogus="1" />';
274
- }
275
  }
276
 
277
  return cell;
@@ -952,8 +984,8 @@ define("tinymce/tableplugin/TableGrid", [
952
  /**
953
  * Quirks.js
954
  *
955
- * Copyright, Moxiecode Systems AB
956
  * Released under LGPL License.
 
957
  *
958
  * License: http://www.tinymce.com/license
959
  * Contributing: http://www.tinymce.com/contributing
@@ -968,13 +1000,10 @@ define("tinymce/tableplugin/TableGrid", [
968
  define("tinymce/tableplugin/Quirks", [
969
  "tinymce/util/VK",
970
  "tinymce/Env",
971
- "tinymce/util/Tools"
972
- ], function(VK, Env, Tools) {
973
- var each = Tools.each;
974
-
975
- function getSpanVal(td, name) {
976
- return parseInt(td.getAttribute(name) || 1, 10);
977
- }
978
 
979
  return function(editor) {
980
  /**
@@ -993,18 +1022,19 @@ define("tinymce/tableplugin/Quirks", [
993
  moveCursorToRow(editor, sourceNode, siblingRow, upBool);
994
  e.preventDefault();
995
  return true;
996
- } else {
997
- var tableNode = editor.dom.getParent(currentRow, 'table');
998
- var middleNode = currentRow.parentNode;
999
- var parentNodeName = middleNode.nodeName.toLowerCase();
1000
- if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) {
1001
- var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody');
1002
- if (targetParent !== null) {
1003
- return moveToRowInTarget(upBool, targetParent, sourceNode);
1004
- }
1005
  }
1006
- return escapeTable(upBool, currentRow, siblingDirection, tableNode);
1007
  }
 
 
1008
  }
1009
 
1010
  function getTargetParent(upBool, topNode, secondNode, nodeName) {
@@ -1015,9 +1045,9 @@ define("tinymce/tableplugin/Quirks", [
1015
  } else if (position === -1) {
1016
  var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1;
1017
  return tbodies[topOrBottom];
1018
- } else {
1019
- return tbodies[position + (upBool ? -1 : 1)];
1020
  }
 
 
1021
  }
1022
 
1023
  function getFirstHeadOrFoot(upBool, parent) {
@@ -1043,17 +1073,17 @@ define("tinymce/tableplugin/Quirks", [
1043
  if (tableSibling) {
1044
  moveCursorToStartOfElement(tableSibling);
1045
  return true;
1046
- } else {
1047
- var parentCell = editor.dom.getParent(table, 'td,th');
1048
- if (parentCell) {
1049
- return handle(upBool, parentCell, e);
1050
- } else {
1051
- var backUpSibling = getChildForDirection(currentRow, !upBool);
1052
- moveCursorToStartOfElement(backUpSibling);
1053
- e.preventDefault();
1054
- return false;
1055
- }
1056
  }
 
 
 
 
 
 
 
 
 
 
1057
  }
1058
 
1059
  function getChildForDirection(parent, up) {
@@ -1284,20 +1314,47 @@ define("tinymce/tableplugin/Quirks", [
1284
  * Delete table if all cells are selected.
1285
  */
1286
  function deleteTable() {
 
 
 
 
 
 
 
 
 
 
1287
  editor.on('keydown', function(e) {
1288
  if ((e.keyCode == VK.DELETE || e.keyCode == VK.BACKSPACE) && !e.isDefaultPrevented()) {
1289
- var table = editor.dom.getParent(editor.selection.getStart(), 'table');
1290
 
 
1291
  if (table) {
1292
- var cells = editor.dom.select('td,th', table), i = cells.length;
1293
- while (i--) {
1294
- if (!editor.dom.hasClass(cells[i], 'mce-item-selected')) {
1295
- return;
 
 
 
 
 
 
 
 
1296
  }
 
 
1297
  }
1298
 
1299
  e.preventDefault();
1300
- editor.execCommand('mceTableDelete');
 
 
 
 
 
 
1301
  }
1302
  }
1303
  });
@@ -1327,8 +1384,8 @@ define("tinymce/tableplugin/Quirks", [
1327
  /**
1328
  * CellSelection.js
1329
  *
1330
- * Copyright, Moxiecode Systems AB
1331
  * Released under LGPL License.
 
1332
  *
1333
  * License: http://www.tinymce.com/license
1334
  * Contributing: http://www.tinymce.com/contributing
@@ -1506,8 +1563,8 @@ define("tinymce/tableplugin/CellSelection", [
1506
  /**
1507
  * Dialogs.js
1508
  *
1509
- * Copyright, Moxiecode Systems AB
1510
  * Released under LGPL License.
 
1511
  *
1512
  * License: http://www.tinymce.com/license
1513
  * Contributing: http://www.tinymce.com/contributing
@@ -1693,7 +1750,7 @@ define("tinymce/tableplugin/Dialogs", [
1693
  function onSubmitTableForm() {
1694
 
1695
  //Explore the layers of the table till we find the first layer of tds or ths
1696
- function styleTDTH (elm, name, value) {
1697
  if (elm.tagName === "TD" || elm.tagName === "TH") {
1698
  dom.setStyle(elm, name, value);
1699
  } else {
@@ -1778,7 +1835,7 @@ define("tinymce/tableplugin/Dialogs", [
1778
  });
1779
  }
1780
 
1781
- function getTDTHOverallStyle (elm, name) {
1782
  var cells = editor.dom.select("td,th", elm), firstChildStyle;
1783
 
1784
  function checkChildren(firstChildStyle, elms) {
@@ -2333,8 +2390,8 @@ define("tinymce/tableplugin/Dialogs", [
2333
  /**
2334
  * Plugin.js
2335
  *
2336
- * Copyright, Moxiecode Systems AB
2337
  * Released under LGPL License.
 
2338
  *
2339
  * License: http://www.tinymce.com/license
2340
  * Contributing: http://www.tinymce.com/contributing
80
  }
81
  }
82
 
83
+ // Included from: js/tinymce/plugins/table/classes/Utils.js
84
+
85
+ /**
86
+ * Utils.js
87
+ *
88
+ * Released under LGPL License.
89
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
90
+ *
91
+ * License: http://www.tinymce.com/license
92
+ * Contributing: http://www.tinymce.com/contributing
93
+ */
94
+
95
+ /**
96
+ * Various utility functions.
97
+ *
98
+ * @class tinymce.tableplugin.Utils
99
+ * @private
100
+ */
101
+ define("tinymce/tableplugin/Utils", [
102
+ "tinymce/Env"
103
+ ], function(Env) {
104
+ function getSpanVal(td, name) {
105
+ return parseInt(td.getAttribute(name) || 1, 10);
106
+ }
107
+
108
+ function paddCell(cell) {
109
+ if (!Env.ie || Env.ie > 10) {
110
+ cell.innerHTML = '<br data-mce-bogus="1" />';
111
+ }
112
+ }
113
+
114
+ return {
115
+ getSpanVal: getSpanVal,
116
+ paddCell: paddCell
117
+ };
118
+ });
119
+
120
  // Included from: js/tinymce/plugins/table/classes/TableGrid.js
121
 
122
  /**
123
  * TableGrid.js
124
  *
 
125
  * Released under LGPL License.
126
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
127
  *
128
  * License: http://www.tinymce.com/license
129
  * Contributing: http://www.tinymce.com/contributing
139
  */
140
  define("tinymce/tableplugin/TableGrid", [
141
  "tinymce/util/Tools",
142
+ "tinymce/Env",
143
+ "tinymce/tableplugin/Utils"
144
+ ], function(Tools, Env, Utils) {
145
+ var each = Tools.each, getSpanVal = Utils.getSpanVal;
 
 
 
146
 
147
  return function(editor, table) {
148
  var grid, gridWidth, startPos, endPos, selectedCell, selection = editor.selection, dom = selection.dom;
303
  if (formatNode) {
304
  cell.appendChild(formatNode);
305
  } else {
306
+ Utils.paddCell(cell);
 
 
307
  }
308
 
309
  return cell;
984
  /**
985
  * Quirks.js
986
  *
 
987
  * Released under LGPL License.
988
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
989
  *
990
  * License: http://www.tinymce.com/license
991
  * Contributing: http://www.tinymce.com/contributing
1000
  define("tinymce/tableplugin/Quirks", [
1001
  "tinymce/util/VK",
1002
  "tinymce/Env",
1003
+ "tinymce/util/Tools",
1004
+ "tinymce/tableplugin/Utils"
1005
+ ], function(VK, Env, Tools, Utils) {
1006
+ var each = Tools.each, getSpanVal = Utils.getSpanVal;
 
 
 
1007
 
1008
  return function(editor) {
1009
  /**
1022
  moveCursorToRow(editor, sourceNode, siblingRow, upBool);
1023
  e.preventDefault();
1024
  return true;
1025
+ }
1026
+
1027
+ var tableNode = editor.dom.getParent(currentRow, 'table');
1028
+ var middleNode = currentRow.parentNode;
1029
+ var parentNodeName = middleNode.nodeName.toLowerCase();
1030
+ if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) {
1031
+ var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody');
1032
+ if (targetParent !== null) {
1033
+ return moveToRowInTarget(upBool, targetParent, sourceNode);
1034
  }
 
1035
  }
1036
+
1037
+ return escapeTable(upBool, currentRow, siblingDirection, tableNode);
1038
  }
1039
 
1040
  function getTargetParent(upBool, topNode, secondNode, nodeName) {
1045
  } else if (position === -1) {
1046
  var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1;
1047
  return tbodies[topOrBottom];
 
 
1048
  }
1049
+
1050
+ return tbodies[position + (upBool ? -1 : 1)];
1051
  }
1052
 
1053
  function getFirstHeadOrFoot(upBool, parent) {
1073
  if (tableSibling) {
1074
  moveCursorToStartOfElement(tableSibling);
1075
  return true;
 
 
 
 
 
 
 
 
 
 
1076
  }
1077
+
1078
+ var parentCell = editor.dom.getParent(table, 'td,th');
1079
+ if (parentCell) {
1080
+ return handle(upBool, parentCell, e);
1081
+ }
1082
+
1083
+ var backUpSibling = getChildForDirection(currentRow, !upBool);
1084
+ moveCursorToStartOfElement(backUpSibling);
1085
+ e.preventDefault();
1086
+ return false;
1087
  }
1088
 
1089
  function getChildForDirection(parent, up) {
1314
  * Delete table if all cells are selected.
1315
  */
1316
  function deleteTable() {
1317
+ function placeCaretInCell(cell) {
1318
+ editor.selection.select(cell, true);
1319
+ editor.selection.collapse(true);
1320
+ }
1321
+
1322
+ function clearCell(cell) {
1323
+ editor.$(cell).empty();
1324
+ Utils.paddCell(cell);
1325
+ }
1326
+
1327
  editor.on('keydown', function(e) {
1328
  if ((e.keyCode == VK.DELETE || e.keyCode == VK.BACKSPACE) && !e.isDefaultPrevented()) {
1329
+ var table, tableCells, selectedTableCells, cell;
1330
 
1331
+ table = editor.dom.getParent(editor.selection.getStart(), 'table');
1332
  if (table) {
1333
+ tableCells = editor.dom.select('td,th', table);
1334
+ selectedTableCells = Tools.grep(tableCells, function(cell) {
1335
+ return editor.dom.hasClass(cell, 'mce-item-selected');
1336
+ });
1337
+
1338
+ if (selectedTableCells.length === 0) {
1339
+ // If caret is within an empty table cell then empty it for real
1340
+ cell = editor.dom.getParent(editor.selection.getStart(), 'td,th');
1341
+ if (editor.selection.isCollapsed() && cell && editor.dom.isEmpty(cell)) {
1342
+ e.preventDefault();
1343
+ clearCell(cell);
1344
+ placeCaretInCell(cell);
1345
  }
1346
+
1347
+ return;
1348
  }
1349
 
1350
  e.preventDefault();
1351
+
1352
+ if (tableCells.length == selectedTableCells.length) {
1353
+ editor.execCommand('mceTableDelete');
1354
+ } else {
1355
+ Tools.each(selectedTableCells, clearCell);
1356
+ placeCaretInCell(selectedTableCells[0]);
1357
+ }
1358
  }
1359
  }
1360
  });
1384
  /**
1385
  * CellSelection.js
1386
  *
 
1387
  * Released under LGPL License.
1388
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
1389
  *
1390
  * License: http://www.tinymce.com/license
1391
  * Contributing: http://www.tinymce.com/contributing
1563
  /**
1564
  * Dialogs.js
1565
  *
 
1566
  * Released under LGPL License.
1567
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
1568
  *
1569
  * License: http://www.tinymce.com/license
1570
  * Contributing: http://www.tinymce.com/contributing
1750
  function onSubmitTableForm() {
1751
 
1752
  //Explore the layers of the table till we find the first layer of tds or ths
1753
+ function styleTDTH(elm, name, value) {
1754
  if (elm.tagName === "TD" || elm.tagName === "TH") {
1755
  dom.setStyle(elm, name, value);
1756
  } else {
1835
  });
1836
  }
1837
 
1838
+ function getTDTHOverallStyle(elm, name) {
1839
  var cells = editor.dom.select("td,th", elm), firstChildStyle;
1840
 
1841
  function checkChildren(firstChildStyle, elms) {
2390
  /**
2391
  * Plugin.js
2392
  *
 
2393
  * Released under LGPL License.
2394
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
2395
  *
2396
  * License: http://www.tinymce.com/license
2397
  * Contributing: http://www.tinymce.com/contributing
mce/table/plugin.min.js CHANGED
@@ -1 +1 @@
1
- !function(a,b){"use strict";function c(a,b){for(var c,d=[],g=0;g<a.length;++g){if(c=f[a[g]]||e(a[g]),!c)throw"module definition dependecy not found: "+a[g];d.push(c)}b.apply(null,d)}function d(a,d,e){if("string"!=typeof a)throw"invalid module definition, module id must be defined and be a string";if(d===b)throw"invalid module definition, dependencies must be specified";if(e===b)throw"invalid module definition, definition function must be specified";c(d,function(){f[a]=e.apply(null,arguments)})}function e(b){for(var c=a,d=b.split(/[.\/]/),e=0;e<d.length;++e){if(!c[d[e]])return;c=c[d[e]]}return c}var f={};d("tinymce/tableplugin/TableGrid",["tinymce/util/Tools","tinymce/Env"],function(a,c){function d(a,b){return parseInt(a.getAttribute(b)||1,10)}var e=a.each;return function(f,g){function h(){var a=0;F=[],G=0,e(["thead","tbody","tfoot"],function(b){var c=L.select("> "+b+" tr",g);e(c,function(c,f){f+=a,e(L.select("> td, > th",c),function(a,c){var e,g,h,i;if(F[f])for(;F[f][c];)c++;for(h=d(a,"rowspan"),i=d(a,"colspan"),g=f;f+h>g;g++)for(F[g]||(F[g]=[]),e=c;c+i>e;e++)F[g][e]={part:b,real:g==f&&e==c,elm:a,rowspan:h,colspan:i};G=Math.max(G,c+1)})}),a+=c.length})}function i(a,b){return a=a.cloneNode(b),a.removeAttribute("id"),a}function j(a,b){var c;return c=F[b],c?c[a]:void 0}function k(a,b,c){a&&(c=parseInt(c,10),1===c?a.removeAttribute(b,1):a.setAttribute(b,c,1))}function l(a){return a&&(L.hasClass(a.elm,"mce-item-selected")||a==J)}function m(){var a=[];return e(g.rows,function(b){e(b.cells,function(c){return L.hasClass(c,"mce-item-selected")||J&&c==J.elm?(a.push(b),!1):void 0})}),a}function n(){var a=L.createRng();a.setStartAfter(g),a.setEndAfter(g),K.setRng(a),L.remove(g)}function o(b){var d,g={};return f.settings.table_clone_elements!==!1&&(g=a.makeMap((f.settings.table_clone_elements||"strong em b i span font h1 h2 h3 h4 h5 h6 p div").toUpperCase(),/[ ,]/)),a.walk(b,function(a){var f;return 3==a.nodeType?(e(L.getParents(a.parentNode,null,b).reverse(),function(a){g[a.nodeName]&&(a=i(a,!1),d?f&&f.appendChild(a):d=f=a,f=a)}),f&&(f.innerHTML=c.ie?"&nbsp;":'<br data-mce-bogus="1" />'),!1):void 0},"childNodes"),b=i(b,!1),k(b,"rowSpan",1),k(b,"colSpan",1),d?b.appendChild(d):(!c.ie||c.ie>10)&&(b.innerHTML='<br data-mce-bogus="1" />'),b}function p(){var a,b=L.createRng();return e(L.select("tr",g),function(a){0===a.cells.length&&L.remove(a)}),0===L.select("tr",g).length?(b.setStartBefore(g),b.setEndBefore(g),K.setRng(b),void L.remove(g)):(e(L.select("thead,tbody,tfoot",g),function(a){0===a.rows.length&&L.remove(a)}),h(),void(H&&(a=F[Math.min(F.length-1,H.y)],a&&(K.select(a[Math.min(a.length-1,H.x)].elm,!0),K.collapse(!0)))))}function q(a,b,c,d){var e,f,g,h,i;for(e=F[b][a].elm.parentNode,g=1;c>=g;g++)if(e=L.getNext(e,"tr")){for(f=a;f>=0;f--)if(i=F[b+g][f].elm,i.parentNode==e){for(h=1;d>=h;h++)L.insertAfter(o(i),i);break}if(-1==f)for(h=1;d>=h;h++)e.insertBefore(o(e.cells[0]),e.cells[0])}}function r(){e(F,function(a,b){e(a,function(a,c){var e,f,g;if(l(a)&&(a=a.elm,e=d(a,"colspan"),f=d(a,"rowspan"),e>1||f>1)){for(k(a,"rowSpan",1),k(a,"colSpan",1),g=0;e-1>g;g++)L.insertAfter(o(a),a);q(c,b,f-1,e)}})})}function s(b,c,d){var f,g,i,m,n,o,q,s,t,u,v;if(b?(f=A(b),g=f.x,i=f.y,m=g+(c-1),n=i+(d-1)):(H=I=null,e(F,function(a,b){e(a,function(a,c){l(a)&&(H||(H={x:c,y:b}),I={x:c,y:b})})}),H&&(g=H.x,i=H.y,m=I.x,n=I.y)),s=j(g,i),t=j(m,n),s&&t&&s.part==t.part){for(r(),h(),s=j(g,i).elm,k(s,"colSpan",m-g+1),k(s,"rowSpan",n-i+1),q=i;n>=q;q++)for(o=g;m>=o;o++)F[q]&&F[q][o]&&(b=F[q][o].elm,b!=s&&(u=a.grep(b.childNodes),e(u,function(a){s.appendChild(a)}),u.length&&(u=a.grep(s.childNodes),v=0,e(u,function(a){"BR"==a.nodeName&&L.getAttrib(a,"data-mce-bogus")&&v++<u.length-1&&s.removeChild(a)})),L.remove(b)));p()}}function t(a){var c,f,g,h,j,m,n,p,q;if(e(F,function(b,d){return e(b,function(b){return l(b)&&(b=b.elm,j=b.parentNode,m=i(j,!1),c=d,a)?!1:void 0}),a?!c:void 0}),c!==b){for(h=0;h<F[0].length;h++)if(F[c][h]&&(f=F[c][h].elm,f!=g)){if(a){if(c>0&&F[c-1][h]&&(p=F[c-1][h].elm,q=d(p,"rowSpan"),q>1)){k(p,"rowSpan",q+1);continue}}else if(q=d(f,"rowspan"),q>1){k(f,"rowSpan",q+1);continue}n=o(f),k(n,"colSpan",f.colSpan),m.appendChild(n),g=f}m.hasChildNodes()&&(a?j.parentNode.insertBefore(m,j):L.insertAfter(m,j))}}function u(a){var b,c;e(F,function(c){return e(c,function(c,d){return l(c)&&(b=d,a)?!1:void 0}),a?!b:void 0}),e(F,function(e,f){var g,h,i;e[b]&&(g=e[b].elm,g!=c&&(i=d(g,"colspan"),h=d(g,"rowspan"),1==i?a?(g.parentNode.insertBefore(o(g),g),q(b,f,h-1,i)):(L.insertAfter(o(g),g),q(b,f,h-1,i)):k(g,"colSpan",g.colSpan+1),c=g))})}function v(){var b=[];e(F,function(c){e(c,function(c,f){l(c)&&-1===a.inArray(b,f)&&(e(F,function(a){var b,c=a[f].elm;b=d(c,"colSpan"),b>1?k(c,"colSpan",b-1):L.remove(c)}),b.push(f))})}),p()}function w(){function a(a){var b,c;e(a.cells,function(a){var c=d(a,"rowSpan");c>1&&(k(a,"rowSpan",c-1),b=A(a),q(b.x,b.y,1,1))}),b=A(a.cells[0]),e(F[b.y],function(a){var b;a=a.elm,a!=c&&(b=d(a,"rowSpan"),1>=b?L.remove(a):k(a,"rowSpan",b-1),c=a)})}var b;b=m(),e(b.reverse(),function(b){a(b)}),p()}function x(){var a=m();return L.remove(a),p(),a}function y(){var a=m();return e(a,function(b,c){a[c]=i(b,!0)}),a}function z(a,b){var c=m(),d=c[b?0:c.length-1],f=d.cells.length;a&&(e(F,function(a){var b;return f=0,e(a,function(a){a.real&&(f+=a.colspan),a.elm.parentNode==d&&(b=1)}),b?!1:void 0}),b||a.reverse(),e(a,function(a){var c,e,g=a.cells.length;for(c=0;g>c;c++)e=a.cells[c],k(e,"colSpan",1),k(e,"rowSpan",1);for(c=g;f>c;c++)a.appendChild(o(a.cells[g-1]));for(c=f;g>c;c++)L.remove(a.cells[c]);b?d.parentNode.insertBefore(a,d):L.insertAfter(a,d)}),L.removeClass(L.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"))}function A(a){var b;return e(F,function(c,d){return e(c,function(c,e){return c.elm==a?(b={x:e,y:d},!1):void 0}),!b}),b}function B(a){H=A(a)}function C(){var a,b;return a=b=0,e(F,function(c,d){e(c,function(c,e){var f,g;l(c)&&(c=F[d][e],e>a&&(a=e),d>b&&(b=d),c.real&&(f=c.colspan-1,g=c.rowspan-1,f&&e+f>a&&(a=e+f),g&&d+g>b&&(b=d+g)))})}),{x:a,y:b}}function D(a){var b,c,d,e,f,g,h,i,j,k;if(I=A(a),H&&I){for(b=Math.min(H.x,I.x),c=Math.min(H.y,I.y),d=Math.max(H.x,I.x),e=Math.max(H.y,I.y),f=d,g=e,k=c;g>=k;k++)a=F[k][b],a.real||b-(a.colspan-1)<b&&(b-=a.colspan-1);for(j=b;f>=j;j++)a=F[c][j],a.real||c-(a.rowspan-1)<c&&(c-=a.rowspan-1);for(k=c;e>=k;k++)for(j=b;d>=j;j++)a=F[k][j],a.real&&(h=a.colspan-1,i=a.rowspan-1,h&&j+h>f&&(f=j+h),i&&k+i>g&&(g=k+i));for(L.removeClass(L.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),k=c;g>=k;k++)for(j=b;f>=j;j++)F[k][j]&&L.addClass(F[k][j].elm,"mce-item-selected")}}function E(a,b){var c,d,e;c=A(a),d=c.y*G+c.x;do{if(d+=b,e=j(d%G,Math.floor(d/G)),!e)break;if(e.elm!=a)return K.select(e.elm,!0),L.isEmpty(e.elm)&&K.collapse(!0),!0}while(e.elm==a);return!1}var F,G,H,I,J,K=f.selection,L=K.dom;g=g||L.getParent(K.getStart(),"table"),h(),J=L.getParent(K.getStart(),"th,td"),J&&(H=A(J),I=C(),J=j(H.x,H.y)),a.extend(this,{deleteTable:n,split:r,merge:s,insertRow:t,insertCol:u,deleteCols:v,deleteRows:w,cutRows:x,copyRows:y,pasteRows:z,getPos:A,setStartCell:B,setEndCell:D,moveRelIdx:E,refresh:h})}}),d("tinymce/tableplugin/Quirks",["tinymce/util/VK","tinymce/Env","tinymce/util/Tools"],function(a,b,c){function d(a,b){return parseInt(a.getAttribute(b)||1,10)}var e=c.each;return function(c){function f(){function b(b){function f(a,d){var e=a?"previousSibling":"nextSibling",f=c.dom.getParent(d,"tr"),h=f[e];if(h)return q(c,d,h,a),b.preventDefault(),!0;var k=c.dom.getParent(f,"table"),l=f.parentNode,m=l.nodeName.toLowerCase();if("tbody"===m||m===(a?"tfoot":"thead")){var n=g(a,k,l,"tbody");if(null!==n)return i(a,n,d)}return j(a,f,e,k)}function g(a,b,d,e){var f=c.dom.select(">"+e,b),g=f.indexOf(d);if(a&&0===g||!a&&g===f.length-1)return h(a,b);if(-1===g){var i="thead"===d.tagName.toLowerCase()?0:f.length-1;return f[i]}return f[g+(a?-1:1)]}function h(a,b){var d=a?"thead":"tfoot",e=c.dom.select(">"+d,b);return 0!==e.length?e[0]:null}function i(a,d,e){var f=k(d,a);return f&&q(c,e,f,a),b.preventDefault(),!0}function j(a,d,e,g){var h=g[e];if(h)return l(h),!0;var i=c.dom.getParent(g,"td,th");if(i)return f(a,i,b);var j=k(d,!a);return l(j),b.preventDefault(),!1}function k(a,b){var d=a&&a[b?"lastChild":"firstChild"];return d&&"BR"===d.nodeName?c.dom.getParent(d,"td,th"):d}function l(a){c.selection.setCursorLocation(a,0)}function m(){return t==a.UP||t==a.DOWN}function n(a){var b=a.selection.getNode(),c=a.dom.getParent(b,"tr");return null!==c}function o(a){for(var b=0,c=a;c.previousSibling;)c=c.previousSibling,b+=d(c,"colspan");return b}function p(a,b){var c=0,f=0;return e(a.children,function(a,e){return c+=d(a,"colspan"),f=e,c>b?!1:void 0}),f}function q(a,b,d,e){var f=o(c.dom.getParent(b,"td,th")),g=p(d,f),h=d.childNodes[g],i=k(h,e);l(i||h)}function r(a){var b=c.selection.getNode(),d=c.dom.getParent(b,"td,th"),e=c.dom.getParent(a,"td,th");return d&&d!==e&&s(d,e)}function s(a,b){return c.dom.getParent(a,"TABLE")===c.dom.getParent(b,"TABLE")}var t=b.keyCode;if(m()&&n(c)){var u=c.selection.getNode();setTimeout(function(){r(u)&&f(!b.shiftKey&&t===a.UP,u,b)},0)}}c.on("KeyDown",function(a){b(a)})}function g(){function a(a,b){var c,d=b.ownerDocument,e=d.createRange();return e.setStartBefore(b),e.setEnd(a.endContainer,a.endOffset),c=d.createElement("body"),c.appendChild(e.cloneContents()),0===c.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length}c.on("KeyDown",function(b){var d,e,f=c.dom;(37==b.keyCode||38==b.keyCode)&&(d=c.selection.getRng(),e=f.getParent(d.startContainer,"table"),e&&c.getBody().firstChild==e&&a(d,e)&&(d=f.createRng(),d.setStartBefore(e),d.setEndBefore(e),c.selection.setRng(d),b.preventDefault()))})}function h(){c.on("KeyDown SetContent VisualAid",function(){var a;for(a=c.getBody().lastChild;a;a=a.previousSibling)if(3==a.nodeType){if(a.nodeValue.length>0)break}else if(1==a.nodeType&&("BR"==a.tagName||!a.getAttribute("data-mce-bogus")))break;a&&"TABLE"==a.nodeName&&(c.settings.forced_root_block?c.dom.add(c.getBody(),c.settings.forced_root_block,c.settings.forced_root_block_attrs,b.ie&&b.ie<11?"&nbsp;":'<br data-mce-bogus="1" />'):c.dom.add(c.getBody(),"br",{"data-mce-bogus":"1"}))}),c.on("PreProcess",function(a){var b=a.node.lastChild;b&&("BR"==b.nodeName||1==b.childNodes.length&&("BR"==b.firstChild.nodeName||"\xa0"==b.firstChild.nodeValue))&&b.previousSibling&&"TABLE"==b.previousSibling.nodeName&&c.dom.remove(b)})}function i(){function a(a,b,c,d){var e,f,g,h=3,i=a.dom.getParent(b.startContainer,"TABLE");return i&&(e=i.parentNode),f=b.startContainer.nodeType==h&&0===b.startOffset&&0===b.endOffset&&d&&("TR"==c.nodeName||c==e),g=("TD"==c.nodeName||"TH"==c.nodeName)&&!d,f||g}function b(){var b=c.selection.getRng(),d=c.selection.getNode(),e=c.dom.getParent(b.startContainer,"TD,TH");if(a(c,b,d,e)){e||(e=d);for(var f=e.lastChild;f.lastChild;)f=f.lastChild;3==f.nodeType&&(b.setEnd(f,f.data.length),c.selection.setRng(b))}}c.on("KeyDown",function(){b()}),c.on("MouseDown",function(a){2!=a.button&&b()})}function j(){c.on("keydown",function(b){if((b.keyCode==a.DELETE||b.keyCode==a.BACKSPACE)&&!b.isDefaultPrevented()){var d=c.dom.getParent(c.selection.getStart(),"table");if(d){for(var e=c.dom.select("td,th",d),f=e.length;f--;)if(!c.dom.hasClass(e[f],"mce-item-selected"))return;b.preventDefault(),c.execCommand("mceTableDelete")}}})}j(),b.webkit&&(f(),i()),b.gecko&&(g(),h()),b.ie>10&&(g(),h())}}),d("tinymce/tableplugin/CellSelection",["tinymce/tableplugin/TableGrid","tinymce/dom/TreeWalker","tinymce/util/Tools"],function(a,b,c){return function(d){function e(a){d.getBody().style.webkitUserSelect="",(a||l)&&(d.dom.removeClass(d.dom.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),l=!1)}function f(b){var c,e,f=b.target;if(!j&&h&&(g||f!=h)&&("TD"==f.nodeName||"TH"==f.nodeName)){e=k.getParent(f,"table"),e==i&&(g||(g=new a(d,e),g.setStartCell(h),d.getBody().style.webkitUserSelect="none"),g.setEndCell(f),l=!0),c=d.selection.getSel();try{c.removeAllRanges?c.removeAllRanges():c.empty()}catch(m){}b.preventDefault()}}var g,h,i,j,k=d.dom,l=!0;return d.on("MouseDown",function(a){2==a.button||j||(e(),h=k.getParent(a.target,"td,th"),i=k.getParent(h,"table"))}),d.on("mouseover",f),d.on("remove",function(){k.unbind(d.getDoc(),"mouseover",f)}),d.on("MouseUp",function(){function a(a,d){var f=new b(a,a);do{if(3==a.nodeType&&0!==c.trim(a.nodeValue).length)return void(d?e.setStart(a,0):e.setEnd(a,a.nodeValue.length));if("BR"==a.nodeName)return void(d?e.setStartBefore(a):e.setEndBefore(a))}while(a=d?f.next():f.prev())}var e,f,j,l,m,n=d.selection;if(h){if(g&&(d.getBody().style.webkitUserSelect=""),f=k.select("td.mce-item-selected,th.mce-item-selected"),f.length>0){e=k.createRng(),l=f[0],e.setStartBefore(l),e.setEndAfter(l),a(l,1),j=new b(l,k.getParent(f[0],"table"));do if("TD"==l.nodeName||"TH"==l.nodeName){if(!k.hasClass(l,"mce-item-selected"))break;m=l}while(l=j.next());a(m),n.setRng(e)}d.nodeChanged(),h=g=i=null}}),d.on("KeyUp Drop SetContent",function(a){e("setcontent"==a.type),h=g=i=null,j=!1}),d.on("ObjectResizeStart ObjectResized",function(a){j="objectresized"!=a.type}),{clear:e}}}),d("tinymce/tableplugin/Dialogs",["tinymce/util/Tools","tinymce/Env"],function(a,b){var c=a.each;return function(d){function e(){var a=d.settings.color_picker_callback;return a?function(){var b=this;a.call(d,function(a){b.value(a).fire("change")},b.value())}:void 0}function f(a){return{title:"Advanced",type:"form",defaults:{onchange:function(){l(a,this.parents().reverse()[0],"style"==this.name())}},items:[{label:"Style",name:"style",type:"textbox"},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border color",type:"colorbox",name:"borderColor",onaction:e()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:e()}]}]}}function g(a){return a?a.replace(/px$/,""):""}function h(a){return/^[0-9]+$/.test(a)&&(a+="px"),a}function i(a){c("left center right".split(" "),function(b){d.formatter.remove("align"+b,{},a)})}function j(a){c("top middle bottom".split(" "),function(b){d.formatter.remove("valign"+b,{},a)})}function k(b,c,d){function e(b,d){return d=d||[],a.each(b,function(a){var b={text:a.text||a.title};a.menu?b.menu=e(a.menu):(b.value=a.value,c&&c(b)),d.push(b)}),d}return e(b,d||[])}function l(a,b,c){var d=b.toJSON(),e=a.parseStyle(d.style);c?(b.find("#borderColor").value(e["border-color"]||"")[0].fire("change"),b.find("#backgroundColor").value(e["background-color"]||"")[0].fire("change")):(e["border-color"]=d.borderColor,e["background-color"]=d.backgroundColor),b.find("#style").value(a.serializeStyle(a.parseStyle(a.serializeStyle(e))))}function m(a,b,c){var d=a.parseStyle(a.getAttrib(c,"style"));d["border-color"]&&(b.borderColor=d["border-color"]),d["background-color"]&&(b.backgroundColor=d["background-color"]),b.style=a.serializeStyle(d)}function n(a,b,d){var e=a.parseStyle(a.getAttrib(b,"style"));c(d,function(a){e[a.name]=a.value}),a.setAttrib(b,"style",a.serializeStyle(a.parseStyle(a.serializeStyle(e))))}var o=this;o.tableProps=function(){o.table(!0)},o.table=function(e){function j(){function c(a,b,d){if("TD"===a.tagName||"TH"===a.tagName)v.setStyle(a,b,d);else if(a.children)for(var e=0;e<a.children.length;e++)c(a.children[e],b,d)}var e;l(v,this),w=a.extend(w,this.toJSON()),w["class"]===!1&&delete w["class"],d.undoManager.transact(function(){if(p||(p=d.plugins.table.insertTable(w.cols||1,w.rows||1)),d.dom.setAttribs(p,{style:w.style,"class":w["class"]}),d.settings.table_style_by_css){if(u=[],u.push({name:"border",value:w.border}),u.push({name:"border-spacing",value:h(w.cellspacing)}),n(v,p,u),v.setAttribs(p,{"data-mce-border-color":w.borderColor,"data-mce-cell-padding":w.cellpadding,"data-mce-border":w.border}),p.children)for(var a=0;a<p.children.length;a++)c(p.children[a],"border",w.border),c(p.children[a],"padding",h(w.cellpadding))}else d.dom.setAttribs(p,{border:w.border,cellpadding:w.cellpadding,cellspacing:w.cellspacing});v.getAttrib(p,"width")&&!d.settings.table_style_by_css?v.setAttrib(p,"width",g(w.width)):v.setStyle(p,"width",h(w.width)),v.setStyle(p,"height",h(w.height)),e=v.select("caption",p)[0],e&&!w.caption&&v.remove(e),!e&&w.caption&&(e=v.create("caption"),e.innerHTML=b.ie?"\xa0":'<br data-mce-bogus="1"/>',p.insertBefore(e,p.firstChild)),i(p),w.align&&d.formatter.apply("align"+w.align,{},p),d.focus(),d.addVisual()})}function o(a,b){function c(a,c){for(var d=0;d<c.length;d++){var e=v.getStyle(c[d],b);if("undefined"==typeof a&&(a=e),a!=e)return""}return a}var e,f=d.dom.select("td,th",a);return e=c(e,f)}var p,q,r,s,t,u,v=d.dom,w={};e===!0?(p=v.getParent(d.selection.getStart(),"table"),p&&(w={width:g(v.getStyle(p,"width")||v.getAttrib(p,"width")),height:g(v.getStyle(p,"height")||v.getAttrib(p,"height")),cellspacing:g(v.getStyle(p,"border-spacing")||v.getAttrib(p,"cellspacing")),cellpadding:v.getAttrib(p,"data-mce-cell-padding")||v.getAttrib(p,"cellpadding")||o(p,"padding"),border:v.getAttrib(p,"data-mce-border")||v.getAttrib(p,"border")||o(p,"border"),borderColor:v.getAttrib(p,"data-mce-border-color"),caption:!!v.select("caption",p)[0],"class":v.getAttrib(p,"class")},c("left center right".split(" "),function(a){d.formatter.matchNode(p,"align"+a)&&(w.align=a)}))):(q={label:"Cols",name:"cols"},r={label:"Rows",name:"rows"}),d.settings.table_class_list&&(w["class"]&&(w["class"]=w["class"].replace(/\s*mce\-item\-table\s*/g,"")),s={name:"class",type:"listbox",label:"Class",values:k(d.settings.table_class_list,function(a){a.value&&(a.textStyle=function(){return d.formatter.getCssText({block:"table",classes:[a.value]})})})}),t={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",labelGapCalc:!1,padding:0,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:d.settings.table_appearance_options!==!1?[q,r,{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"}]:[q,r,{label:"Width",name:"width"},{label:"Height",name:"height"}]},{label:"Alignment",name:"align",type:"listbox",text:"None",values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},s]},d.settings.table_advtab!==!1?(m(v,w,p),d.windowManager.open({title:"Table properties",data:w,bodyType:"tabpanel",body:[{title:"General",type:"form",items:t},f(v)],onsubmit:j})):d.windowManager.open({title:"Table properties",data:w,body:t,onsubmit:j})},o.merge=function(a,b){d.windowManager.open({title:"Merge cells",body:[{label:"Cols",name:"cols",type:"textbox",value:"1",size:10},{label:"Rows",name:"rows",type:"textbox",value:"1",size:10}],onsubmit:function(){var c=this.toJSON();d.undoManager.transact(function(){a.merge(b,c.cols,c.rows)})}})},o.cell=function(){function b(){l(p,this),n=a.extend(n,this.toJSON()),d.undoManager.transact(function(){c(q,function(a){d.dom.setAttribs(a,{scope:n.scope,style:n.style,"class":n["class"]}),d.dom.setStyles(a,{width:h(n.width),height:h(n.height)}),n.type&&a.nodeName.toLowerCase()!=n.type&&(a=p.rename(a,n.type)),i(a),n.align&&d.formatter.apply("align"+n.align,{},a),j(a),n.valign&&d.formatter.apply("valign"+n.valign,{},a)}),d.focus()})}var e,n,o,p=d.dom,q=[];if(q=d.dom.select("td.mce-item-selected,th.mce-item-selected"),e=d.dom.getParent(d.selection.getStart(),"td,th"),!q.length&&e&&q.push(e),e=e||q[0]){n={width:g(p.getStyle(e,"width")||p.getAttrib(e,"width")),height:g(p.getStyle(e,"height")||p.getAttrib(e,"height")),scope:p.getAttrib(e,"scope"),"class":p.getAttrib(e,"class")},n.type=e.nodeName.toLowerCase(),c("left center right".split(" "),function(a){d.formatter.matchNode(e,"align"+a)&&(n.align=a)}),c("top middle bottom".split(" "),function(a){d.formatter.matchNode(e,"valign"+a)&&(n.valign=a)}),d.settings.table_cell_class_list&&(o={name:"class",type:"listbox",label:"Class",values:k(d.settings.table_cell_class_list,function(a){a.value&&(a.textStyle=function(){return d.formatter.getCssText({block:"td",classes:[a.value]})})})});var r={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",layout:"grid",columns:2,labelGapCalc:!1,padding:0,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},o]};d.settings.table_cell_advtab!==!1?(m(p,n,e),d.windowManager.open({title:"Cell properties",bodyType:"tabpanel",data:n,body:[{title:"General",type:"form",items:r},f(p)],onsubmit:b})):d.windowManager.open({title:"Cell properties",data:n,body:r,onsubmit:b})}},o.row=function(){function b(){var b,e,f;l(r,this),p=a.extend(p,this.toJSON()),d.undoManager.transact(function(){var a=p.type;c(s,function(c){d.dom.setAttribs(c,{scope:p.scope,style:p.style,"class":p["class"]}),d.dom.setStyles(c,{height:h(p.height)}),a!=c.parentNode.nodeName.toLowerCase()&&(b=r.getParent(c,"table"),e=c.parentNode,f=r.select(a,b)[0],f||(f=r.create(a),b.firstChild?b.insertBefore(f,b.firstChild):b.appendChild(f)),f.appendChild(c),e.hasChildNodes()||r.remove(e)),i(c),p.align&&d.formatter.apply("align"+p.align,{},c)}),d.focus()})}var e,j,n,o,p,q,r=d.dom,s=[];e=d.dom.getParent(d.selection.getStart(),"table"),j=d.dom.getParent(d.selection.getStart(),"td,th"),c(e.rows,function(a){c(a.cells,function(b){return r.hasClass(b,"mce-item-selected")||b==j?(s.push(a),!1):void 0})}),n=s[0],n&&(p={height:g(r.getStyle(n,"height")||r.getAttrib(n,"height")),scope:r.getAttrib(n,"scope"),"class":r.getAttrib(n,"class")},p.type=n.parentNode.nodeName.toLowerCase(),c("left center right".split(" "),function(a){d.formatter.matchNode(n,"align"+a)&&(p.align=a)}),d.settings.table_row_class_list&&(o={name:"class",type:"listbox",label:"Class",values:k(d.settings.table_row_class_list,function(a){a.value&&(a.textStyle=function(){return d.formatter.getCssText({block:"tr",classes:[a.value]})})})}),q={type:"form",columns:2,padding:0,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"None",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"},o]},d.settings.table_row_advtab!==!1?(m(r,p,n),d.windowManager.open({title:"Row properties",data:p,bodyType:"tabpanel",body:[{title:"General",type:"form",items:q},f(r)],onsubmit:b})):d.windowManager.open({title:"Row properties",data:p,body:q,onsubmit:b}))}}}),d("tinymce/tableplugin/Plugin",["tinymce/tableplugin/TableGrid","tinymce/tableplugin/Quirks","tinymce/tableplugin/CellSelection","tinymce/tableplugin/Dialogs","tinymce/util/Tools","tinymce/dom/TreeWalker","tinymce/Env","tinymce/PluginManager"],function(a,b,c,d,e,f,g,h){function i(e){function f(a){return function(){e.execCommand(a)}}function h(a,b){var c,d,f,h;for(f='<table id="__mce"><tbody>',c=0;b>c;c++){for(f+="<tr>",d=0;a>d;d++)f+="<td>"+(g.ie?" ":"<br>")+"</td>";f+="</tr>"}return f+="</tbody></table>",e.undoManager.transact(function(){e.insertContent(f),h=e.dom.get("__mce"),e.dom.setAttrib(h,"id",null),e.dom.setAttribs(h,e.settings.table_default_attributes||{}),e.dom.setStyles(h,e.settings.table_default_styles||{})}),h}function i(a,b){function c(){a.disabled(!e.dom.getParent(e.selection.getStart(),b)),e.selection.selectorChanged(b,function(b){a.disabled(!b)})}e.initialized?c():e.on("init",c)}function k(){i(this,"table")}function l(){i(this,"td,th")}function m(){var a="";a='<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';for(var b=0;10>b;b++){a+="<tr>";for(var c=0;10>c;c++)a+='<td role="gridcell" tabindex="-1"><a id="mcegrid'+(10*b+c)+'" href="#" data-mce-x="'+c+'" data-mce-y="'+b+'"></a></td>';a+="</tr>"}return a+="</table>",a+='<div class="mce-text-center" role="presentation">1 x 1</div>'}function n(a,b,c){var d,f,g,h,i,j=c.getEl().getElementsByTagName("table")[0],k=c.isRtl()||"tl-tr"==c.parent().rel;for(j.nextSibling.innerHTML=a+1+" x "+(b+1),k&&(a=9-a),f=0;10>f;f++)for(d=0;10>d;d++)h=j.rows[f].childNodes[d].firstChild,i=(k?d>=a:a>=d)&&b>=f,e.dom.toggleClass(h,"mce-active",i),i&&(g=h);return g.parentNode}var o,p=this,q=new d(e);e.settings.table_grid===!1?e.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",onclick:q.table}):e.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(a){a.aria&&(this.parent().hideAll(),a.stopImmediatePropagation(),q.table())},onshow:function(){n(0,0,this.menu.items()[0])},onhide:function(){var a=this.menu.items()[0].getEl().getElementsByTagName("a");e.dom.removeClass(a,"mce-active"),e.dom.addClass(a[0],"mce-active")},menu:[{type:"container",html:m(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(a){var b,c,d=a.target;"A"==d.tagName.toUpperCase()&&(b=parseInt(d.getAttribute("data-mce-x"),10),c=parseInt(d.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"==this.parent().rel)&&(b=9-b),(b!==this.lastX||c!==this.lastY)&&(n(b,c,a.control),this.lastX=b,this.lastY=c))},onclick:function(a){var b=this;"A"==a.target.tagName.toUpperCase()&&(a.preventDefault(),a.stopPropagation(),b.parent().cancel(),e.undoManager.transact(function(){h(b.lastX+1,b.lastY+1)}),e.addVisual())}}]}),e.addMenuItem("tableprops",{text:"Table properties",context:"table",onPostRender:k,onclick:q.tableProps}),e.addMenuItem("deletetable",{text:"Delete table",context:"table",onPostRender:k,cmd:"mceTableDelete"}),e.addMenuItem("cell",{separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:f("mceTableCellProps"),onPostRender:l},{text:"Merge cells",onclick:f("mceTableMergeCells"),onPostRender:l},{text:"Split cell",onclick:f("mceTableSplitCells"),onPostRender:l}]}),e.addMenuItem("row",{text:"Row",context:"table",menu:[{text:"Insert row before",onclick:f("mceTableInsertRowBefore"),onPostRender:l},{text:"Insert row after",onclick:f("mceTableInsertRowAfter"),onPostRender:l},{text:"Delete row",onclick:f("mceTableDeleteRow"),onPostRender:l},{text:"Row properties",onclick:f("mceTableRowProps"),onPostRender:l},{text:"-"},{text:"Cut row",onclick:f("mceTableCutRow"),onPostRender:l},{text:"Copy row",onclick:f("mceTableCopyRow"),onPostRender:l},{text:"Paste row before",onclick:f("mceTablePasteRowBefore"),onPostRender:l},{text:"Paste row after",onclick:f("mceTablePasteRowAfter"),onPostRender:l}]}),e.addMenuItem("column",{text:"Column",context:"table",menu:[{text:"Insert column before",onclick:f("mceTableInsertColBefore"),onPostRender:l},{text:"Insert column after",onclick:f("mceTableInsertColAfter"),onPostRender:l},{text:"Delete column",onclick:f("mceTableDeleteCol"),onPostRender:l}]});var r=[];j("inserttable tableprops deletetable | cell row column".split(" "),function(a){r.push("|"==a?{text:"-"}:e.menuItems[a])}),e.addButton("table",{type:"menubutton",title:"Table",menu:r}),g.isIE||e.on("click",function(a){a=a.target,"TABLE"===a.nodeName&&(e.selection.select(a),e.nodeChanged())}),p.quirks=new b(e),e.on("Init",function(){p.cellSelection=new c(e)}),e.on("PreInit",function(){e.serializer.addAttributeFilter("data-mce-cell-padding,data-mce-border,data-mce-border-color",function(a,b){for(var c=a.length;c--;)a[c].attr(b,null)})}),j({mceTableSplitCells:function(a){a.split()},mceTableMergeCells:function(a){var b;b=e.dom.getParent(e.selection.getStart(),"th,td"),e.dom.select("td.mce-item-selected,th.mce-item-selected").length?a.merge():q.merge(a,b)},mceTableInsertRowBefore:function(a){a.insertRow(!0)},mceTableInsertRowAfter:function(a){a.insertRow()},mceTableInsertColBefore:function(a){a.insertCol(!0)},mceTableInsertColAfter:function(a){a.insertCol()},mceTableDeleteCol:function(a){a.deleteCols()},mceTableDeleteRow:function(a){a.deleteRows()},mceTableCutRow:function(a){o=a.cutRows()},mceTableCopyRow:function(a){o=a.copyRows()},mceTablePasteRowBefore:function(a){a.pasteRows(o,!0)},mceTablePasteRowAfter:function(a){a.pasteRows(o)},mceTableDelete:function(a){a.deleteTable()}},function(b,c){e.addCommand(c,function(){var c=new a(e);c&&(b(c),e.execCommand("mceRepaint"),p.cellSelection.clear())})}),j({mceInsertTable:q.table,mceTableProps:function(){q.table(!0)},mceTableRowProps:q.row,mceTableCellProps:q.cell},function(a,b){e.addCommand(b,function(b,c){a(c)})}),e.settings.table_tab_navigation!==!1&&e.on("keydown",function(b){var c,d,f;9==b.keyCode&&(c=e.dom.getParent(e.selection.getStart(),"th,td"),c&&(b.preventDefault(),d=new a(e),f=b.shiftKey?-1:1,e.undoManager.transact(function(){!d.moveRelIdx(c,f)&&f>0&&(d.insertRow(),d.refresh(),d.moveRelIdx(c,f))})))}),p.insertTable=h}var j=e.each;h.add("table",i)})}(this);
1
+ !function(a,b){"use strict";function c(a,b){for(var c,d=[],g=0;g<a.length;++g){if(c=f[a[g]]||e(a[g]),!c)throw"module definition dependecy not found: "+a[g];d.push(c)}b.apply(null,d)}function d(a,d,e){if("string"!=typeof a)throw"invalid module definition, module id must be defined and be a string";if(d===b)throw"invalid module definition, dependencies must be specified";if(e===b)throw"invalid module definition, definition function must be specified";c(d,function(){f[a]=e.apply(null,arguments)})}function e(b){for(var c=a,d=b.split(/[.\/]/),e=0;e<d.length;++e){if(!c[d[e]])return;c=c[d[e]]}return c}var f={};d("tinymce/tableplugin/Utils",["tinymce/Env"],function(a){function b(a,b){return parseInt(a.getAttribute(b)||1,10)}function c(b){(!a.ie||a.ie>10)&&(b.innerHTML='<br data-mce-bogus="1" />')}return{getSpanVal:b,paddCell:c}}),d("tinymce/tableplugin/TableGrid",["tinymce/util/Tools","tinymce/Env","tinymce/tableplugin/Utils"],function(a,c,d){var e=a.each,f=d.getSpanVal;return function(g,h){function i(){var a=0;G=[],H=0,e(["thead","tbody","tfoot"],function(b){var c=M.select("> "+b+" tr",h);e(c,function(c,d){d+=a,e(M.select("> td, > th",c),function(a,c){var e,g,h,i;if(G[d])for(;G[d][c];)c++;for(h=f(a,"rowspan"),i=f(a,"colspan"),g=d;d+h>g;g++)for(G[g]||(G[g]=[]),e=c;c+i>e;e++)G[g][e]={part:b,real:g==d&&e==c,elm:a,rowspan:h,colspan:i};H=Math.max(H,c+1)})}),a+=c.length})}function j(a,b){return a=a.cloneNode(b),a.removeAttribute("id"),a}function k(a,b){var c;return c=G[b],c?c[a]:void 0}function l(a,b,c){a&&(c=parseInt(c,10),1===c?a.removeAttribute(b,1):a.setAttribute(b,c,1))}function m(a){return a&&(M.hasClass(a.elm,"mce-item-selected")||a==K)}function n(){var a=[];return e(h.rows,function(b){e(b.cells,function(c){return M.hasClass(c,"mce-item-selected")||K&&c==K.elm?(a.push(b),!1):void 0})}),a}function o(){var a=M.createRng();a.setStartAfter(h),a.setEndAfter(h),L.setRng(a),M.remove(h)}function p(b){var f,h={};return g.settings.table_clone_elements!==!1&&(h=a.makeMap((g.settings.table_clone_elements||"strong em b i span font h1 h2 h3 h4 h5 h6 p div").toUpperCase(),/[ ,]/)),a.walk(b,function(a){var d;return 3==a.nodeType?(e(M.getParents(a.parentNode,null,b).reverse(),function(a){h[a.nodeName]&&(a=j(a,!1),f?d&&d.appendChild(a):f=d=a,d=a)}),d&&(d.innerHTML=c.ie?"&nbsp;":'<br data-mce-bogus="1" />'),!1):void 0},"childNodes"),b=j(b,!1),l(b,"rowSpan",1),l(b,"colSpan",1),f?b.appendChild(f):d.paddCell(b),b}function q(){var a,b=M.createRng();return e(M.select("tr",h),function(a){0===a.cells.length&&M.remove(a)}),0===M.select("tr",h).length?(b.setStartBefore(h),b.setEndBefore(h),L.setRng(b),void M.remove(h)):(e(M.select("thead,tbody,tfoot",h),function(a){0===a.rows.length&&M.remove(a)}),i(),void(I&&(a=G[Math.min(G.length-1,I.y)],a&&(L.select(a[Math.min(a.length-1,I.x)].elm,!0),L.collapse(!0)))))}function r(a,b,c,d){var e,f,g,h,i;for(e=G[b][a].elm.parentNode,g=1;c>=g;g++)if(e=M.getNext(e,"tr")){for(f=a;f>=0;f--)if(i=G[b+g][f].elm,i.parentNode==e){for(h=1;d>=h;h++)M.insertAfter(p(i),i);break}if(-1==f)for(h=1;d>=h;h++)e.insertBefore(p(e.cells[0]),e.cells[0])}}function s(){e(G,function(a,b){e(a,function(a,c){var d,e,g;if(m(a)&&(a=a.elm,d=f(a,"colspan"),e=f(a,"rowspan"),d>1||e>1)){for(l(a,"rowSpan",1),l(a,"colSpan",1),g=0;d-1>g;g++)M.insertAfter(p(a),a);r(c,b,e-1,d)}})})}function t(b,c,d){var f,g,h,j,n,o,p,r,t,u,v;if(b?(f=B(b),g=f.x,h=f.y,j=g+(c-1),n=h+(d-1)):(I=J=null,e(G,function(a,b){e(a,function(a,c){m(a)&&(I||(I={x:c,y:b}),J={x:c,y:b})})}),I&&(g=I.x,h=I.y,j=J.x,n=J.y)),r=k(g,h),t=k(j,n),r&&t&&r.part==t.part){for(s(),i(),r=k(g,h).elm,l(r,"colSpan",j-g+1),l(r,"rowSpan",n-h+1),p=h;n>=p;p++)for(o=g;j>=o;o++)G[p]&&G[p][o]&&(b=G[p][o].elm,b!=r&&(u=a.grep(b.childNodes),e(u,function(a){r.appendChild(a)}),u.length&&(u=a.grep(r.childNodes),v=0,e(u,function(a){"BR"==a.nodeName&&M.getAttrib(a,"data-mce-bogus")&&v++<u.length-1&&r.removeChild(a)})),M.remove(b)));q()}}function u(a){var c,d,g,h,i,k,n,o,q;if(e(G,function(b,d){return e(b,function(b){return m(b)&&(b=b.elm,i=b.parentNode,k=j(i,!1),c=d,a)?!1:void 0}),a?!c:void 0}),c!==b){for(h=0;h<G[0].length;h++)if(G[c][h]&&(d=G[c][h].elm,d!=g)){if(a){if(c>0&&G[c-1][h]&&(o=G[c-1][h].elm,q=f(o,"rowSpan"),q>1)){l(o,"rowSpan",q+1);continue}}else if(q=f(d,"rowspan"),q>1){l(d,"rowSpan",q+1);continue}n=p(d),l(n,"colSpan",d.colSpan),k.appendChild(n),g=d}k.hasChildNodes()&&(a?i.parentNode.insertBefore(k,i):M.insertAfter(k,i))}}function v(a){var b,c;e(G,function(c){return e(c,function(c,d){return m(c)&&(b=d,a)?!1:void 0}),a?!b:void 0}),e(G,function(d,e){var g,h,i;d[b]&&(g=d[b].elm,g!=c&&(i=f(g,"colspan"),h=f(g,"rowspan"),1==i?a?(g.parentNode.insertBefore(p(g),g),r(b,e,h-1,i)):(M.insertAfter(p(g),g),r(b,e,h-1,i)):l(g,"colSpan",g.colSpan+1),c=g))})}function w(){var b=[];e(G,function(c){e(c,function(c,d){m(c)&&-1===a.inArray(b,d)&&(e(G,function(a){var b,c=a[d].elm;b=f(c,"colSpan"),b>1?l(c,"colSpan",b-1):M.remove(c)}),b.push(d))})}),q()}function x(){function a(a){var b,c;e(a.cells,function(a){var c=f(a,"rowSpan");c>1&&(l(a,"rowSpan",c-1),b=B(a),r(b.x,b.y,1,1))}),b=B(a.cells[0]),e(G[b.y],function(a){var b;a=a.elm,a!=c&&(b=f(a,"rowSpan"),1>=b?M.remove(a):l(a,"rowSpan",b-1),c=a)})}var b;b=n(),e(b.reverse(),function(b){a(b)}),q()}function y(){var a=n();return M.remove(a),q(),a}function z(){var a=n();return e(a,function(b,c){a[c]=j(b,!0)}),a}function A(a,b){var c=n(),d=c[b?0:c.length-1],f=d.cells.length;a&&(e(G,function(a){var b;return f=0,e(a,function(a){a.real&&(f+=a.colspan),a.elm.parentNode==d&&(b=1)}),b?!1:void 0}),b||a.reverse(),e(a,function(a){var c,e,g=a.cells.length;for(c=0;g>c;c++)e=a.cells[c],l(e,"colSpan",1),l(e,"rowSpan",1);for(c=g;f>c;c++)a.appendChild(p(a.cells[g-1]));for(c=f;g>c;c++)M.remove(a.cells[c]);b?d.parentNode.insertBefore(a,d):M.insertAfter(a,d)}),M.removeClass(M.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"))}function B(a){var b;return e(G,function(c,d){return e(c,function(c,e){return c.elm==a?(b={x:e,y:d},!1):void 0}),!b}),b}function C(a){I=B(a)}function D(){var a,b;return a=b=0,e(G,function(c,d){e(c,function(c,e){var f,g;m(c)&&(c=G[d][e],e>a&&(a=e),d>b&&(b=d),c.real&&(f=c.colspan-1,g=c.rowspan-1,f&&e+f>a&&(a=e+f),g&&d+g>b&&(b=d+g)))})}),{x:a,y:b}}function E(a){var b,c,d,e,f,g,h,i,j,k;if(J=B(a),I&&J){for(b=Math.min(I.x,J.x),c=Math.min(I.y,J.y),d=Math.max(I.x,J.x),e=Math.max(I.y,J.y),f=d,g=e,k=c;g>=k;k++)a=G[k][b],a.real||b-(a.colspan-1)<b&&(b-=a.colspan-1);for(j=b;f>=j;j++)a=G[c][j],a.real||c-(a.rowspan-1)<c&&(c-=a.rowspan-1);for(k=c;e>=k;k++)for(j=b;d>=j;j++)a=G[k][j],a.real&&(h=a.colspan-1,i=a.rowspan-1,h&&j+h>f&&(f=j+h),i&&k+i>g&&(g=k+i));for(M.removeClass(M.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),k=c;g>=k;k++)for(j=b;f>=j;j++)G[k][j]&&M.addClass(G[k][j].elm,"mce-item-selected")}}function F(a,b){var c,d,e;c=B(a),d=c.y*H+c.x;do{if(d+=b,e=k(d%H,Math.floor(d/H)),!e)break;if(e.elm!=a)return L.select(e.elm,!0),M.isEmpty(e.elm)&&L.collapse(!0),!0}while(e.elm==a);return!1}var G,H,I,J,K,L=g.selection,M=L.dom;h=h||M.getParent(L.getStart(),"table"),i(),K=M.getParent(L.getStart(),"th,td"),K&&(I=B(K),J=D(),K=k(I.x,I.y)),a.extend(this,{deleteTable:o,split:s,merge:t,insertRow:u,insertCol:v,deleteCols:w,deleteRows:x,cutRows:y,copyRows:z,pasteRows:A,getPos:B,setStartCell:C,setEndCell:E,moveRelIdx:F,refresh:i})}}),d("tinymce/tableplugin/Quirks",["tinymce/util/VK","tinymce/Env","tinymce/util/Tools","tinymce/tableplugin/Utils"],function(a,b,c,d){var e=c.each,f=d.getSpanVal;return function(g){function h(){function b(b){function c(a,c){var e=a?"previousSibling":"nextSibling",f=g.dom.getParent(c,"tr"),h=f[e];if(h)return q(g,c,h,a),b.preventDefault(),!0;var k=g.dom.getParent(f,"table"),l=f.parentNode,m=l.nodeName.toLowerCase();if("tbody"===m||m===(a?"tfoot":"thead")){var n=d(a,k,l,"tbody");if(null!==n)return i(a,n,c)}return j(a,f,e,k)}function d(a,b,c,d){var e=g.dom.select(">"+d,b),f=e.indexOf(c);if(a&&0===f||!a&&f===e.length-1)return h(a,b);if(-1===f){var i="thead"===c.tagName.toLowerCase()?0:e.length-1;return e[i]}return e[f+(a?-1:1)]}function h(a,b){var c=a?"thead":"tfoot",d=g.dom.select(">"+c,b);return 0!==d.length?d[0]:null}function i(a,c,d){var e=k(c,a);return e&&q(g,d,e,a),b.preventDefault(),!0}function j(a,d,e,f){var h=f[e];if(h)return l(h),!0;var i=g.dom.getParent(f,"td,th");if(i)return c(a,i,b);var j=k(d,!a);return l(j),b.preventDefault(),!1}function k(a,b){var c=a&&a[b?"lastChild":"firstChild"];return c&&"BR"===c.nodeName?g.dom.getParent(c,"td,th"):c}function l(a){g.selection.setCursorLocation(a,0)}function m(){return t==a.UP||t==a.DOWN}function n(a){var b=a.selection.getNode(),c=a.dom.getParent(b,"tr");return null!==c}function o(a){for(var b=0,c=a;c.previousSibling;)c=c.previousSibling,b+=f(c,"colspan");return b}function p(a,b){var c=0,d=0;return e(a.children,function(a,e){return c+=f(a,"colspan"),d=e,c>b?!1:void 0}),d}function q(a,b,c,d){var e=o(g.dom.getParent(b,"td,th")),f=p(c,e),h=c.childNodes[f],i=k(h,d);l(i||h)}function r(a){var b=g.selection.getNode(),c=g.dom.getParent(b,"td,th"),d=g.dom.getParent(a,"td,th");return c&&c!==d&&s(c,d)}function s(a,b){return g.dom.getParent(a,"TABLE")===g.dom.getParent(b,"TABLE")}var t=b.keyCode;if(m()&&n(g)){var u=g.selection.getNode();setTimeout(function(){r(u)&&c(!b.shiftKey&&t===a.UP,u,b)},0)}}g.on("KeyDown",function(a){b(a)})}function i(){function a(a,b){var c,d=b.ownerDocument,e=d.createRange();return e.setStartBefore(b),e.setEnd(a.endContainer,a.endOffset),c=d.createElement("body"),c.appendChild(e.cloneContents()),0===c.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length}g.on("KeyDown",function(b){var c,d,e=g.dom;(37==b.keyCode||38==b.keyCode)&&(c=g.selection.getRng(),d=e.getParent(c.startContainer,"table"),d&&g.getBody().firstChild==d&&a(c,d)&&(c=e.createRng(),c.setStartBefore(d),c.setEndBefore(d),g.selection.setRng(c),b.preventDefault()))})}function j(){g.on("KeyDown SetContent VisualAid",function(){var a;for(a=g.getBody().lastChild;a;a=a.previousSibling)if(3==a.nodeType){if(a.nodeValue.length>0)break}else if(1==a.nodeType&&("BR"==a.tagName||!a.getAttribute("data-mce-bogus")))break;a&&"TABLE"==a.nodeName&&(g.settings.forced_root_block?g.dom.add(g.getBody(),g.settings.forced_root_block,g.settings.forced_root_block_attrs,b.ie&&b.ie<11?"&nbsp;":'<br data-mce-bogus="1" />'):g.dom.add(g.getBody(),"br",{"data-mce-bogus":"1"}))}),g.on("PreProcess",function(a){var b=a.node.lastChild;b&&("BR"==b.nodeName||1==b.childNodes.length&&("BR"==b.firstChild.nodeName||"\xa0"==b.firstChild.nodeValue))&&b.previousSibling&&"TABLE"==b.previousSibling.nodeName&&g.dom.remove(b)})}function k(){function a(a,b,c,d){var e,f,g,h=3,i=a.dom.getParent(b.startContainer,"TABLE");return i&&(e=i.parentNode),f=b.startContainer.nodeType==h&&0===b.startOffset&&0===b.endOffset&&d&&("TR"==c.nodeName||c==e),g=("TD"==c.nodeName||"TH"==c.nodeName)&&!d,f||g}function b(){var b=g.selection.getRng(),c=g.selection.getNode(),d=g.dom.getParent(b.startContainer,"TD,TH");if(a(g,b,c,d)){d||(d=c);for(var e=d.lastChild;e.lastChild;)e=e.lastChild;3==e.nodeType&&(b.setEnd(e,e.data.length),g.selection.setRng(b))}}g.on("KeyDown",function(){b()}),g.on("MouseDown",function(a){2!=a.button&&b()})}function l(){function b(a){g.selection.select(a,!0),g.selection.collapse(!0)}function e(a){g.$(a).empty(),d.paddCell(a)}g.on("keydown",function(d){if((d.keyCode==a.DELETE||d.keyCode==a.BACKSPACE)&&!d.isDefaultPrevented()){var f,h,i,j;if(f=g.dom.getParent(g.selection.getStart(),"table")){if(h=g.dom.select("td,th",f),i=c.grep(h,function(a){return g.dom.hasClass(a,"mce-item-selected")}),0===i.length)return j=g.dom.getParent(g.selection.getStart(),"td,th"),void(g.selection.isCollapsed()&&j&&g.dom.isEmpty(j)&&(d.preventDefault(),e(j),b(j)));d.preventDefault(),h.length==i.length?g.execCommand("mceTableDelete"):(c.each(i,e),b(i[0]))}}})}l(),b.webkit&&(h(),k()),b.gecko&&(i(),j()),b.ie>10&&(i(),j())}}),d("tinymce/tableplugin/CellSelection",["tinymce/tableplugin/TableGrid","tinymce/dom/TreeWalker","tinymce/util/Tools"],function(a,b,c){return function(d){function e(a){d.getBody().style.webkitUserSelect="",(a||l)&&(d.dom.removeClass(d.dom.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),l=!1)}function f(b){var c,e,f=b.target;if(!j&&h&&(g||f!=h)&&("TD"==f.nodeName||"TH"==f.nodeName)){e=k.getParent(f,"table"),e==i&&(g||(g=new a(d,e),g.setStartCell(h),d.getBody().style.webkitUserSelect="none"),g.setEndCell(f),l=!0),c=d.selection.getSel();try{c.removeAllRanges?c.removeAllRanges():c.empty()}catch(m){}b.preventDefault()}}var g,h,i,j,k=d.dom,l=!0;return d.on("MouseDown",function(a){2==a.button||j||(e(),h=k.getParent(a.target,"td,th"),i=k.getParent(h,"table"))}),d.on("mouseover",f),d.on("remove",function(){k.unbind(d.getDoc(),"mouseover",f)}),d.on("MouseUp",function(){function a(a,d){var f=new b(a,a);do{if(3==a.nodeType&&0!==c.trim(a.nodeValue).length)return void(d?e.setStart(a,0):e.setEnd(a,a.nodeValue.length));if("BR"==a.nodeName)return void(d?e.setStartBefore(a):e.setEndBefore(a))}while(a=d?f.next():f.prev())}var e,f,j,l,m,n=d.selection;if(h){if(g&&(d.getBody().style.webkitUserSelect=""),f=k.select("td.mce-item-selected,th.mce-item-selected"),f.length>0){e=k.createRng(),l=f[0],e.setStartBefore(l),e.setEndAfter(l),a(l,1),j=new b(l,k.getParent(f[0],"table"));do if("TD"==l.nodeName||"TH"==l.nodeName){if(!k.hasClass(l,"mce-item-selected"))break;m=l}while(l=j.next());a(m),n.setRng(e)}d.nodeChanged(),h=g=i=null}}),d.on("KeyUp Drop SetContent",function(a){e("setcontent"==a.type),h=g=i=null,j=!1}),d.on("ObjectResizeStart ObjectResized",function(a){j="objectresized"!=a.type}),{clear:e}}}),d("tinymce/tableplugin/Dialogs",["tinymce/util/Tools","tinymce/Env"],function(a,b){var c=a.each;return function(d){function e(){var a=d.settings.color_picker_callback;return a?function(){var b=this;a.call(d,function(a){b.value(a).fire("change")},b.value())}:void 0}function f(a){return{title:"Advanced",type:"form",defaults:{onchange:function(){l(a,this.parents().reverse()[0],"style"==this.name())}},items:[{label:"Style",name:"style",type:"textbox"},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border color",type:"colorbox",name:"borderColor",onaction:e()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:e()}]}]}}function g(a){return a?a.replace(/px$/,""):""}function h(a){return/^[0-9]+$/.test(a)&&(a+="px"),a}function i(a){c("left center right".split(" "),function(b){d.formatter.remove("align"+b,{},a)})}function j(a){c("top middle bottom".split(" "),function(b){d.formatter.remove("valign"+b,{},a)})}function k(b,c,d){function e(b,d){return d=d||[],a.each(b,function(a){var b={text:a.text||a.title};a.menu?b.menu=e(a.menu):(b.value=a.value,c&&c(b)),d.push(b)}),d}return e(b,d||[])}function l(a,b,c){var d=b.toJSON(),e=a.parseStyle(d.style);c?(b.find("#borderColor").value(e["border-color"]||"")[0].fire("change"),b.find("#backgroundColor").value(e["background-color"]||"")[0].fire("change")):(e["border-color"]=d.borderColor,e["background-color"]=d.backgroundColor),b.find("#style").value(a.serializeStyle(a.parseStyle(a.serializeStyle(e))))}function m(a,b,c){var d=a.parseStyle(a.getAttrib(c,"style"));d["border-color"]&&(b.borderColor=d["border-color"]),d["background-color"]&&(b.backgroundColor=d["background-color"]),b.style=a.serializeStyle(d)}function n(a,b,d){var e=a.parseStyle(a.getAttrib(b,"style"));c(d,function(a){e[a.name]=a.value}),a.setAttrib(b,"style",a.serializeStyle(a.parseStyle(a.serializeStyle(e))))}var o=this;o.tableProps=function(){o.table(!0)},o.table=function(e){function j(){function c(a,b,d){if("TD"===a.tagName||"TH"===a.tagName)v.setStyle(a,b,d);else if(a.children)for(var e=0;e<a.children.length;e++)c(a.children[e],b,d)}var e;l(v,this),w=a.extend(w,this.toJSON()),w["class"]===!1&&delete w["class"],d.undoManager.transact(function(){if(p||(p=d.plugins.table.insertTable(w.cols||1,w.rows||1)),d.dom.setAttribs(p,{style:w.style,"class":w["class"]}),d.settings.table_style_by_css){if(u=[],u.push({name:"border",value:w.border}),u.push({name:"border-spacing",value:h(w.cellspacing)}),n(v,p,u),v.setAttribs(p,{"data-mce-border-color":w.borderColor,"data-mce-cell-padding":w.cellpadding,"data-mce-border":w.border}),p.children)for(var a=0;a<p.children.length;a++)c(p.children[a],"border",w.border),c(p.children[a],"padding",h(w.cellpadding))}else d.dom.setAttribs(p,{border:w.border,cellpadding:w.cellpadding,cellspacing:w.cellspacing});v.getAttrib(p,"width")&&!d.settings.table_style_by_css?v.setAttrib(p,"width",g(w.width)):v.setStyle(p,"width",h(w.width)),v.setStyle(p,"height",h(w.height)),e=v.select("caption",p)[0],e&&!w.caption&&v.remove(e),!e&&w.caption&&(e=v.create("caption"),e.innerHTML=b.ie?"\xa0":'<br data-mce-bogus="1"/>',p.insertBefore(e,p.firstChild)),i(p),w.align&&d.formatter.apply("align"+w.align,{},p),d.focus(),d.addVisual()})}function o(a,b){function c(a,c){for(var d=0;d<c.length;d++){var e=v.getStyle(c[d],b);if("undefined"==typeof a&&(a=e),a!=e)return""}return a}var e,f=d.dom.select("td,th",a);return e=c(e,f)}var p,q,r,s,t,u,v=d.dom,w={};e===!0?(p=v.getParent(d.selection.getStart(),"table"),p&&(w={width:g(v.getStyle(p,"width")||v.getAttrib(p,"width")),height:g(v.getStyle(p,"height")||v.getAttrib(p,"height")),cellspacing:g(v.getStyle(p,"border-spacing")||v.getAttrib(p,"cellspacing")),cellpadding:v.getAttrib(p,"data-mce-cell-padding")||v.getAttrib(p,"cellpadding")||o(p,"padding"),border:v.getAttrib(p,"data-mce-border")||v.getAttrib(p,"border")||o(p,"border"),borderColor:v.getAttrib(p,"data-mce-border-color"),caption:!!v.select("caption",p)[0],"class":v.getAttrib(p,"class")},c("left center right".split(" "),function(a){d.formatter.matchNode(p,"align"+a)&&(w.align=a)}))):(q={label:"Cols",name:"cols"},r={label:"Rows",name:"rows"}),d.settings.table_class_list&&(w["class"]&&(w["class"]=w["class"].replace(/\s*mce\-item\-table\s*/g,"")),s={name:"class",type:"listbox",label:"Class",values:k(d.settings.table_class_list,function(a){a.value&&(a.textStyle=function(){return d.formatter.getCssText({block:"table",classes:[a.value]})})})}),t={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",labelGapCalc:!1,padding:0,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:d.settings.table_appearance_options!==!1?[q,r,{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"}]:[q,r,{label:"Width",name:"width"},{label:"Height",name:"height"}]},{label:"Alignment",name:"align",type:"listbox",text:"None",values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},s]},d.settings.table_advtab!==!1?(m(v,w,p),d.windowManager.open({title:"Table properties",data:w,bodyType:"tabpanel",body:[{title:"General",type:"form",items:t},f(v)],onsubmit:j})):d.windowManager.open({title:"Table properties",data:w,body:t,onsubmit:j})},o.merge=function(a,b){d.windowManager.open({title:"Merge cells",body:[{label:"Cols",name:"cols",type:"textbox",value:"1",size:10},{label:"Rows",name:"rows",type:"textbox",value:"1",size:10}],onsubmit:function(){var c=this.toJSON();d.undoManager.transact(function(){a.merge(b,c.cols,c.rows)})}})},o.cell=function(){function b(){l(p,this),n=a.extend(n,this.toJSON()),d.undoManager.transact(function(){c(q,function(a){d.dom.setAttribs(a,{scope:n.scope,style:n.style,"class":n["class"]}),d.dom.setStyles(a,{width:h(n.width),height:h(n.height)}),n.type&&a.nodeName.toLowerCase()!=n.type&&(a=p.rename(a,n.type)),i(a),n.align&&d.formatter.apply("align"+n.align,{},a),j(a),n.valign&&d.formatter.apply("valign"+n.valign,{},a)}),d.focus()})}var e,n,o,p=d.dom,q=[];if(q=d.dom.select("td.mce-item-selected,th.mce-item-selected"),e=d.dom.getParent(d.selection.getStart(),"td,th"),!q.length&&e&&q.push(e),e=e||q[0]){n={width:g(p.getStyle(e,"width")||p.getAttrib(e,"width")),height:g(p.getStyle(e,"height")||p.getAttrib(e,"height")),scope:p.getAttrib(e,"scope"),"class":p.getAttrib(e,"class")},n.type=e.nodeName.toLowerCase(),c("left center right".split(" "),function(a){d.formatter.matchNode(e,"align"+a)&&(n.align=a)}),c("top middle bottom".split(" "),function(a){d.formatter.matchNode(e,"valign"+a)&&(n.valign=a)}),d.settings.table_cell_class_list&&(o={name:"class",type:"listbox",label:"Class",values:k(d.settings.table_cell_class_list,function(a){a.value&&(a.textStyle=function(){return d.formatter.getCssText({block:"td",classes:[a.value]})})})});var r={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",layout:"grid",columns:2,labelGapCalc:!1,padding:0,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},o]};d.settings.table_cell_advtab!==!1?(m(p,n,e),d.windowManager.open({title:"Cell properties",bodyType:"tabpanel",data:n,body:[{title:"General",type:"form",items:r},f(p)],onsubmit:b})):d.windowManager.open({title:"Cell properties",data:n,body:r,onsubmit:b})}},o.row=function(){function b(){var b,e,f;l(r,this),p=a.extend(p,this.toJSON()),d.undoManager.transact(function(){var a=p.type;c(s,function(c){d.dom.setAttribs(c,{scope:p.scope,style:p.style,"class":p["class"]}),d.dom.setStyles(c,{height:h(p.height)}),a!=c.parentNode.nodeName.toLowerCase()&&(b=r.getParent(c,"table"),e=c.parentNode,f=r.select(a,b)[0],f||(f=r.create(a),b.firstChild?b.insertBefore(f,b.firstChild):b.appendChild(f)),f.appendChild(c),e.hasChildNodes()||r.remove(e)),i(c),p.align&&d.formatter.apply("align"+p.align,{},c)}),d.focus()})}var e,j,n,o,p,q,r=d.dom,s=[];e=d.dom.getParent(d.selection.getStart(),"table"),j=d.dom.getParent(d.selection.getStart(),"td,th"),c(e.rows,function(a){c(a.cells,function(b){return r.hasClass(b,"mce-item-selected")||b==j?(s.push(a),!1):void 0})}),n=s[0],n&&(p={height:g(r.getStyle(n,"height")||r.getAttrib(n,"height")),scope:r.getAttrib(n,"scope"),"class":r.getAttrib(n,"class")},p.type=n.parentNode.nodeName.toLowerCase(),c("left center right".split(" "),function(a){d.formatter.matchNode(n,"align"+a)&&(p.align=a)}),d.settings.table_row_class_list&&(o={name:"class",type:"listbox",label:"Class",values:k(d.settings.table_row_class_list,function(a){a.value&&(a.textStyle=function(){return d.formatter.getCssText({block:"tr",classes:[a.value]})})})}),q={type:"form",columns:2,padding:0,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"None",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"},o]},d.settings.table_row_advtab!==!1?(m(r,p,n),d.windowManager.open({title:"Row properties",data:p,bodyType:"tabpanel",body:[{title:"General",type:"form",items:q},f(r)],onsubmit:b})):d.windowManager.open({title:"Row properties",data:p,body:q,onsubmit:b}))}}}),d("tinymce/tableplugin/Plugin",["tinymce/tableplugin/TableGrid","tinymce/tableplugin/Quirks","tinymce/tableplugin/CellSelection","tinymce/tableplugin/Dialogs","tinymce/util/Tools","tinymce/dom/TreeWalker","tinymce/Env","tinymce/PluginManager"],function(a,b,c,d,e,f,g,h){function i(e){function f(a){return function(){e.execCommand(a)}}function h(a,b){var c,d,f,h;for(f='<table id="__mce"><tbody>',c=0;b>c;c++){for(f+="<tr>",d=0;a>d;d++)f+="<td>"+(g.ie?" ":"<br>")+"</td>";f+="</tr>"}return f+="</tbody></table>",e.undoManager.transact(function(){e.insertContent(f),h=e.dom.get("__mce"),e.dom.setAttrib(h,"id",null),e.dom.setAttribs(h,e.settings.table_default_attributes||{}),e.dom.setStyles(h,e.settings.table_default_styles||{})}),h}function i(a,b){function c(){a.disabled(!e.dom.getParent(e.selection.getStart(),b)),e.selection.selectorChanged(b,function(b){a.disabled(!b)})}e.initialized?c():e.on("init",c)}function k(){i(this,"table")}function l(){i(this,"td,th")}function m(){var a="";a='<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';for(var b=0;10>b;b++){a+="<tr>";for(var c=0;10>c;c++)a+='<td role="gridcell" tabindex="-1"><a id="mcegrid'+(10*b+c)+'" href="#" data-mce-x="'+c+'" data-mce-y="'+b+'"></a></td>';a+="</tr>"}return a+="</table>",a+='<div class="mce-text-center" role="presentation">1 x 1</div>'}function n(a,b,c){var d,f,g,h,i,j=c.getEl().getElementsByTagName("table")[0],k=c.isRtl()||"tl-tr"==c.parent().rel;for(j.nextSibling.innerHTML=a+1+" x "+(b+1),k&&(a=9-a),f=0;10>f;f++)for(d=0;10>d;d++)h=j.rows[f].childNodes[d].firstChild,i=(k?d>=a:a>=d)&&b>=f,e.dom.toggleClass(h,"mce-active",i),i&&(g=h);return g.parentNode}var o,p=this,q=new d(e);e.settings.table_grid===!1?e.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",onclick:q.table}):e.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(a){a.aria&&(this.parent().hideAll(),a.stopImmediatePropagation(),q.table())},onshow:function(){n(0,0,this.menu.items()[0])},onhide:function(){var a=this.menu.items()[0].getEl().getElementsByTagName("a");e.dom.removeClass(a,"mce-active"),e.dom.addClass(a[0],"mce-active")},menu:[{type:"container",html:m(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(a){var b,c,d=a.target;"A"==d.tagName.toUpperCase()&&(b=parseInt(d.getAttribute("data-mce-x"),10),c=parseInt(d.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"==this.parent().rel)&&(b=9-b),(b!==this.lastX||c!==this.lastY)&&(n(b,c,a.control),this.lastX=b,this.lastY=c))},onclick:function(a){var b=this;"A"==a.target.tagName.toUpperCase()&&(a.preventDefault(),a.stopPropagation(),b.parent().cancel(),e.undoManager.transact(function(){h(b.lastX+1,b.lastY+1)}),e.addVisual())}}]}),e.addMenuItem("tableprops",{text:"Table properties",context:"table",onPostRender:k,onclick:q.tableProps}),e.addMenuItem("deletetable",{text:"Delete table",context:"table",onPostRender:k,cmd:"mceTableDelete"}),e.addMenuItem("cell",{separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:f("mceTableCellProps"),onPostRender:l},{text:"Merge cells",onclick:f("mceTableMergeCells"),onPostRender:l},{text:"Split cell",onclick:f("mceTableSplitCells"),onPostRender:l}]}),e.addMenuItem("row",{text:"Row",context:"table",menu:[{text:"Insert row before",onclick:f("mceTableInsertRowBefore"),onPostRender:l},{text:"Insert row after",onclick:f("mceTableInsertRowAfter"),onPostRender:l},{text:"Delete row",onclick:f("mceTableDeleteRow"),onPostRender:l},{text:"Row properties",onclick:f("mceTableRowProps"),onPostRender:l},{text:"-"},{text:"Cut row",onclick:f("mceTableCutRow"),onPostRender:l},{text:"Copy row",onclick:f("mceTableCopyRow"),onPostRender:l},{text:"Paste row before",onclick:f("mceTablePasteRowBefore"),onPostRender:l},{text:"Paste row after",onclick:f("mceTablePasteRowAfter"),onPostRender:l}]}),e.addMenuItem("column",{text:"Column",context:"table",menu:[{text:"Insert column before",onclick:f("mceTableInsertColBefore"),onPostRender:l},{text:"Insert column after",onclick:f("mceTableInsertColAfter"),onPostRender:l},{text:"Delete column",onclick:f("mceTableDeleteCol"),onPostRender:l}]});var r=[];j("inserttable tableprops deletetable | cell row column".split(" "),function(a){r.push("|"==a?{text:"-"}:e.menuItems[a])}),e.addButton("table",{type:"menubutton",title:"Table",menu:r}),g.isIE||e.on("click",function(a){a=a.target,"TABLE"===a.nodeName&&(e.selection.select(a),e.nodeChanged())}),p.quirks=new b(e),e.on("Init",function(){p.cellSelection=new c(e)}),e.on("PreInit",function(){e.serializer.addAttributeFilter("data-mce-cell-padding,data-mce-border,data-mce-border-color",function(a,b){for(var c=a.length;c--;)a[c].attr(b,null)})}),j({mceTableSplitCells:function(a){a.split()},mceTableMergeCells:function(a){var b;b=e.dom.getParent(e.selection.getStart(),"th,td"),e.dom.select("td.mce-item-selected,th.mce-item-selected").length?a.merge():q.merge(a,b)},mceTableInsertRowBefore:function(a){a.insertRow(!0)},mceTableInsertRowAfter:function(a){a.insertRow()},mceTableInsertColBefore:function(a){a.insertCol(!0)},mceTableInsertColAfter:function(a){a.insertCol()},mceTableDeleteCol:function(a){a.deleteCols()},mceTableDeleteRow:function(a){a.deleteRows()},mceTableCutRow:function(a){o=a.cutRows()},mceTableCopyRow:function(a){o=a.copyRows()},mceTablePasteRowBefore:function(a){a.pasteRows(o,!0)},mceTablePasteRowAfter:function(a){a.pasteRows(o)},mceTableDelete:function(a){a.deleteTable()}},function(b,c){e.addCommand(c,function(){var c=new a(e);c&&(b(c),e.execCommand("mceRepaint"),p.cellSelection.clear())})}),j({mceInsertTable:q.table,mceTableProps:function(){q.table(!0)},mceTableRowProps:q.row,mceTableCellProps:q.cell},function(a,b){e.addCommand(b,function(b,c){a(c)})}),e.settings.table_tab_navigation!==!1&&e.on("keydown",function(b){var c,d,f;9==b.keyCode&&(c=e.dom.getParent(e.selection.getStart(),"th,td"),c&&(b.preventDefault(),d=new a(e),f=b.shiftKey?-1:1,e.undoManager.transact(function(){!d.moveRelIdx(c,f)&&f>0&&(d.insertRow(),d.refresh(),d.moveRelIdx(c,f))})))}),p.insertTable=h}var j=e.each;h.add("table",i)})}(this);
mce/textpattern/plugin.js DELETED
@@ -1,268 +0,0 @@
1
- /**
2
- * plugin.js
3
- *
4
- * Copyright, Moxiecode Systems AB
5
- * Released under LGPL License.
6
- *
7
- * License: http://www.tinymce.com/license
8
- * Contributing: http://www.tinymce.com/contributing
9
- */
10
-
11
- /*global tinymce:true */
12
-
13
- tinymce.PluginManager.add('textpattern', function(editor) {
14
- var isPatternsDirty = true, patterns;
15
-
16
- patterns = editor.settings.textpattern_patterns || [
17
- {start: '*', end: '*', format: 'italic'},
18
- {start: '**', end: '**', format: 'bold'},
19
- {start: '#', format: 'h1'},
20
- {start: '##', format: 'h2'},
21
- {start: '###', format: 'h3'},
22
- {start: '####', format: 'h4'},
23
- {start: '#####', format: 'h5'},
24
- {start: '######', format: 'h6'},
25
- {start: '1. ', cmd: 'InsertOrderedList'},
26
- {start: '* ', cmd: 'InsertUnorderedList'},
27
- {start: '- ', cmd: 'InsertUnorderedList'}
28
- ];
29
-
30
- // Returns a sorted patterns list, ordered descending by start length
31
- function getPatterns() {
32
- if (isPatternsDirty) {
33
- patterns.sort(function(a, b) {
34
- if (a.start.length > b.start.length) {
35
- return -1;
36
- }
37
-
38
- if (a.start.length < b.start.length) {
39
- return 1;
40
- }
41
-
42
- return 0;
43
- });
44
-
45
- isPatternsDirty = false;
46
- }
47
-
48
- return patterns;
49
- }
50
-
51
- // Finds a matching pattern to the specified text
52
- function findPattern(text) {
53
- var patterns = getPatterns();
54
-
55
- for (var i = 0; i < patterns.length; i++) {
56
- if (text.indexOf(patterns[i].start) !== 0) {
57
- continue;
58
- }
59
-
60
- if (patterns[i].end && text.lastIndexOf(patterns[i].end) != text.length - patterns[i].end.length) {
61
- continue;
62
- }
63
-
64
- return patterns[i];
65
- }
66
- }
67
-
68
- // Finds the best matching end pattern
69
- function findEndPattern(text, offset, delta) {
70
- var patterns, pattern, i;
71
-
72
- // Find best matching end
73
- patterns = getPatterns();
74
- for (i = 0; i < patterns.length; i++) {
75
- pattern = patterns[i];
76
- if (pattern.end && text.substr(offset - pattern.end.length - delta, pattern.end.length) == pattern.end) {
77
- return pattern;
78
- }
79
- }
80
- }
81
-
82
- // Handles inline formats like *abc* and **abc**
83
- function applyInlineFormat(space) {
84
- var selection, dom, rng, container, offset, startOffset, text, patternRng, pattern, delta, format;
85
-
86
- function splitContainer() {
87
- // Split text node and remove start/end from text node
88
- container = container.splitText(startOffset);
89
- container.splitText(offset - startOffset - delta);
90
- container.deleteData(0, pattern.start.length);
91
- container.deleteData(container.data.length - pattern.end.length, pattern.end.length);
92
- }
93
-
94
- selection = editor.selection;
95
- dom = editor.dom;
96
-
97
- if (!selection.isCollapsed()) {
98
- return;
99
- }
100
-
101
- rng = selection.getRng(true);
102
- container = rng.startContainer;
103
- offset = rng.startOffset;
104
- text = container.data;
105
- delta = space ? 1 : 0;
106
-
107
- if (container.nodeType != 3) {
108
- return;
109
- }
110
-
111
- // Find best matching end
112
- pattern = findEndPattern(text, offset, delta);
113
- if (!pattern) {
114
- return;
115
- }
116
-
117
- // Find start of matched pattern
118
- // TODO: Might need to improve this if there is nested formats
119
- startOffset = Math.max(0, offset - delta);
120
- startOffset = text.lastIndexOf(pattern.start, startOffset - pattern.end.length - 1);
121
-
122
- if (startOffset === -1) {
123
- return;
124
- }
125
-
126
- // Setup a range for the matching word
127
- patternRng = dom.createRng();
128
- patternRng.setStart(container, startOffset);
129
- patternRng.setEnd(container, offset - delta);
130
- pattern = findPattern(patternRng.toString());
131
-
132
- if (!pattern || !pattern.end) {
133
- return;
134
- }
135
-
136
- // If container match doesn't have anything between start/end then do nothing
137
- if (container.data.length <= pattern.start.length + pattern.end.length) {
138
- return;
139
- }
140
-
141
- format = editor.formatter.get(pattern.format);
142
- if (format && format[0].inline) {
143
- splitContainer();
144
- editor.formatter.apply(pattern.format, {}, container);
145
- return container;
146
- }
147
- }
148
-
149
- // Handles block formats like ##abc or 1. abc
150
- function applyBlockFormat() {
151
- var selection, dom, container, firstTextNode, node, format, textBlockElm, pattern, walker, rng, offset;
152
-
153
- selection = editor.selection;
154
- dom = editor.dom;
155
-
156
- if (!selection.isCollapsed()) {
157
- return;
158
- }
159
-
160
- textBlockElm = dom.getParent(selection.getStart(), 'p');
161
- if (textBlockElm) {
162
- walker = new tinymce.dom.TreeWalker(textBlockElm, textBlockElm);
163
- while ((node = walker.next())) {
164
- if (node.nodeType == 3) {
165
- firstTextNode = node;
166
- break;
167
- }
168
- }
169
-
170
- if (firstTextNode) {
171
- pattern = findPattern(firstTextNode.data);
172
- if (!pattern) {
173
- return;
174
- }
175
-
176
- rng = selection.getRng(true);
177
- container = rng.startContainer;
178
- offset = rng.startOffset;
179
-
180
- if (firstTextNode == container) {
181
- offset = Math.max(0, offset - pattern.start.length);
182
- }
183
-
184
- if (tinymce.trim(firstTextNode.data).length == pattern.start.length) {
185
- return;
186
- }
187
-
188
- if (pattern.format) {
189
- format = editor.formatter.get(pattern.format);
190
- if (format && format[0].block) {
191
- firstTextNode.deleteData(0, pattern.start.length);
192
- editor.formatter.apply(pattern.format, {}, firstTextNode);
193
-
194
- rng.setStart(container, offset);
195
- rng.collapse(true);
196
- selection.setRng(rng);
197
- }
198
- }
199
-
200
- if (pattern.cmd) {
201
- editor.undoManager.transact(function() {
202
- firstTextNode.deleteData(0, pattern.start.length);
203
- editor.execCommand(pattern.cmd);
204
- });
205
- }
206
- }
207
- }
208
- }
209
-
210
- function handleEnter() {
211
- var rng, wrappedTextNode;
212
-
213
- wrappedTextNode = applyInlineFormat();
214
- if (wrappedTextNode) {
215
- rng = editor.dom.createRng();
216
- rng.setStart(wrappedTextNode, wrappedTextNode.data.length);
217
- rng.setEnd(wrappedTextNode, wrappedTextNode.data.length);
218
- editor.selection.setRng(rng);
219
- }
220
-
221
- applyBlockFormat();
222
- }
223
-
224
- function handleSpace() {
225
- var wrappedTextNode, lastChar, lastCharNode, rng, dom;
226
-
227
- wrappedTextNode = applyInlineFormat(true);
228
- if (wrappedTextNode) {
229
- dom = editor.dom;
230
- lastChar = wrappedTextNode.data.slice(-1);
231
-
232
- // Move space after the newly formatted node
233
- if (/[\u00a0 ]/.test(lastChar)) {
234
- wrappedTextNode.deleteData(wrappedTextNode.data.length - 1, 1);
235
- lastCharNode = dom.doc.createTextNode(lastChar);
236
-
237
- if (wrappedTextNode.nextSibling) {
238
- dom.insertAfter(lastCharNode, wrappedTextNode.nextSibling);
239
- } else {
240
- wrappedTextNode.parentNode.appendChild(lastCharNode);
241
- }
242
-
243
- rng = dom.createRng();
244
- rng.setStart(lastCharNode, 1);
245
- rng.setEnd(lastCharNode, 1);
246
- editor.selection.setRng(rng);
247
- }
248
- }
249
- }
250
-
251
- editor.on('keydown', function(e) {
252
- if (e.keyCode == 13 && !tinymce.util.VK.modifierPressed(e)) {
253
- handleEnter();
254
- }
255
- }, true);
256
-
257
- editor.on('keyup', function(e) {
258
- if (e.keyCode == 32 && !tinymce.util.VK.modifierPressed(e)) {
259
- handleSpace();
260
- }
261
- });
262
-
263
- this.getPatterns = getPatterns;
264
- this.setPatterns = function(newPatterns) {
265
- patterns = newPatterns;
266
- isPatternsDirty = true;
267
- };
268
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mce/textpattern/plugin.min.js DELETED
@@ -1 +0,0 @@
1
- tinymce.PluginManager.add("textpattern",function(a){function b(){return j&&(i.sort(function(a,b){return a.start.length>b.start.length?-1:a.start.length<b.start.length?1:0}),j=!1),i}function c(a){for(var c=b(),d=0;d<c.length;d++)if(0===a.indexOf(c[d].start)&&(!c[d].end||a.lastIndexOf(c[d].end)==a.length-c[d].end.length))return c[d]}function d(a,c,d){var e,f,g;for(e=b(),g=0;g<e.length;g++)if(f=e[g],f.end&&a.substr(c-f.end.length-d,f.end.length)==f.end)return f}function e(b){function e(){i=i.splitText(k),i.splitText(j-k-o),i.deleteData(0,n.start.length),i.deleteData(i.data.length-n.end.length,n.end.length)}var f,g,h,i,j,k,l,m,n,o,p;return f=a.selection,g=a.dom,f.isCollapsed()&&(h=f.getRng(!0),i=h.startContainer,j=h.startOffset,l=i.data,o=b?1:0,3==i.nodeType&&(n=d(l,j,o),n&&(k=Math.max(0,j-o),k=l.lastIndexOf(n.start,k-n.end.length-1),-1!==k&&(m=g.createRng(),m.setStart(i,k),m.setEnd(i,j-o),n=c(m.toString()),n&&n.end&&!(i.data.length<=n.start.length+n.end.length)))))?(p=a.formatter.get(n.format),p&&p[0].inline?(e(),a.formatter.apply(n.format,{},i),i):void 0):void 0}function f(){var b,d,e,f,g,h,i,j,k,l,m;if(b=a.selection,d=a.dom,b.isCollapsed()&&(i=d.getParent(b.getStart(),"p"))){for(k=new tinymce.dom.TreeWalker(i,i);g=k.next();)if(3==g.nodeType){f=g;break}if(f){if(j=c(f.data),!j)return;if(l=b.getRng(!0),e=l.startContainer,m=l.startOffset,f==e&&(m=Math.max(0,m-j.start.length)),tinymce.trim(f.data).length==j.start.length)return;j.format&&(h=a.formatter.get(j.format),h&&h[0].block&&(f.deleteData(0,j.start.length),a.formatter.apply(j.format,{},f),l.setStart(e,m),l.collapse(!0),b.setRng(l))),j.cmd&&a.undoManager.transact(function(){f.deleteData(0,j.start.length),a.execCommand(j.cmd)})}}}function g(){var b,c;c=e(),c&&(b=a.dom.createRng(),b.setStart(c,c.data.length),b.setEnd(c,c.data.length),a.selection.setRng(b)),f()}function h(){var b,c,d,f,g;b=e(!0),b&&(g=a.dom,c=b.data.slice(-1),/[\u00a0 ]/.test(c)&&(b.deleteData(b.data.length-1,1),d=g.doc.createTextNode(c),b.nextSibling?g.insertAfter(d,b.nextSibling):b.parentNode.appendChild(d),f=g.createRng(),f.setStart(d,1),f.setEnd(d,1),a.selection.setRng(f)))}var i,j=!0;i=a.settings.textpattern_patterns||[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}],a.on("keydown",function(a){13!=a.keyCode||tinymce.util.VK.modifierPressed(a)||g()},!0),a.on("keyup",function(a){32!=a.keyCode||tinymce.util.VK.modifierPressed(a)||h()}),this.getPatterns=b,this.setPatterns=function(a){i=a,j=!0}});
 
mce/visualblocks/plugin.js CHANGED
@@ -1,8 +1,8 @@
1
  /**
2
  * plugin.js
3
  *
4
- * Copyright 2012, Moxiecode Systems AB
5
  * Released under LGPL License.
 
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
1
  /**
2
  * plugin.js
3
  *
 
4
  * Released under LGPL License.
5
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
mce/visualchars/plugin.js CHANGED
@@ -1,8 +1,8 @@
1
  /**
2
  * plugin.js
3
  *
4
- * Copyright, Moxiecode Systems AB
5
  * Released under LGPL License.
 
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
1
  /**
2
  * plugin.js
3
  *
 
4
  * Released under LGPL License.
5
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
6
  *
7
  * License: http://www.tinymce.com/license
8
  * Contributing: http://www.tinymce.com/contributing
mce/wptadv/plugin.js CHANGED
@@ -51,6 +51,7 @@ tinymce.PluginManager.add( 'wptadv', function( editor ) {
51
  html = html.replace( new RegExp( '</(?:' + blocklist + ')>', 'gi' ), '$&\n' );
52
  html = html.replace( new RegExp( '<br(?: [^>]*)?>', 'gi' ), '$&\n' );
53
  html = html.replace( />\n\n</g, '>\n<' );
 
54
 
55
  return trim( html );
56
  }
51
  html = html.replace( new RegExp( '</(?:' + blocklist + ')>', 'gi' ), '$&\n' );
52
  html = html.replace( new RegExp( '<br(?: [^>]*)?>', 'gi' ), '$&\n' );
53
  html = html.replace( />\n\n</g, '>\n<' );
54
+ html = html.replace( /^<li/gm, '\t<li' );
55
 
56
  return trim( html );
57
  }
mce/wptadv/plugin.min.js CHANGED
@@ -1 +1 @@
1
- tinymce.PluginManager.add("wptadv",function(a){function b(a){return a=a.replace(new RegExp("<(?:"+d+")(?: [^>]*)?>","gi"),"\n$&"),a=a.replace(new RegExp("</(?:"+d+")>","gi"),"$&\n"),a=a.replace(new RegExp("<br(?: [^>]*)?>","gi"),"$&\n"),a=a.replace(/>\n\n</g,">\n<"),e(a)}var c=[new RegExp("https?://(www\\.)?youtube\\.com/(watch|playlist).*","i"),new RegExp("https?://youtu.be/.*","i"),new RegExp("https?://blip.tv/.*","i"),new RegExp("https?://(www\\.)?vimeo\\.com/.*","i"),new RegExp("https?://(www\\.)?dailymotion\\.com/.*","i"),new RegExp("https?://dai.ly/.*","i"),new RegExp("https?://(www\\.)?flickr\\.com/.*","i"),new RegExp("https?://flic.kr/.*","i"),new RegExp("https?://(.+\\.)?smugmug\\.com/.*","i"),new RegExp("https?://(www\\.)?hulu\\.com/watch/.*","i"),new RegExp("https?://(www\\.)?viddler\\.com/.*","i"),new RegExp("https?://qik.com/.*","i"),new RegExp("https?://revision3.com/.*","i"),new RegExp("https?://i*.photobucket.com/albums/.*","i"),new RegExp("https?://gi*.photobucket.com/groups/.*","i"),new RegExp("https?://(www\\.)?scribd\\.com/.*","i"),new RegExp("https?://wordpress.tv/.*","i"),new RegExp("https?://(.+\\.)?polldaddy\\.com/.*","i"),new RegExp("https?://poll\\.fm/.*","i"),new RegExp("https?://(www\\.)?funnyordie\\.com/videos/.*","i"),new RegExp("https?://(www\\.)?twitter\\.com/.+?/status(es)?/.*","i"),new RegExp("https?://vine\\.co/v/.*","i"),new RegExp("https?://(www\\.)?soundcloud\\.com/.*","i"),new RegExp("https?://(www\\.)?slideshare\\.net/.*","i"),new RegExp("https?://instagr(\\.am|am\\.com)/p/.*","i"),new RegExp("https?://(www\\.)?rdio\\.com/.*","i"),new RegExp("https?://rd\\.io/x/.*","i"),new RegExp("https?://(open|play)\\.spotify\\.com/.*","i"),new RegExp("https?://(.+\\.)?imgur\\.com/.*","i"),new RegExp("https?://(www\\.)?meetu(\\.ps|p\\.com)/.*","i"),new RegExp("https?://(www\\.)?issuu\\.com/.+/docs/.*","i"),new RegExp("https?://(www\\.)?collegehumor\\.com/video/.*","i"),new RegExp("https?://(www\\.)?mixcloud\\.com/.*","i"),new RegExp("https?://(www\\.|embed\\.)?ted\\.com/talks/.*","i"),new RegExp("https?://(www\\.)(animoto|video214)\\.com/play/.*","i"),new RegExp("https?://(.+).tumblr.com/post/.*","i"),new RegExp("https?://(www.)?kickstarter.com/projects/.*","i"),new RegExp("https?://kck.st/.*","i")],d="table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary",e=tinymce.trim;!a.settings.wpautop&&a.settings.tadv_noautop&&(a.on("init",function(){a.on("SaveContent",function(a){a.content=a.content.replace(/<p>\s*(https?:\/\/[^<>"\s]+)\s*<\/p>/gi,function(a,b){for(var d in c)if(c[d].test(b))return"\n"+b+"\n";return a}).replace(/caption\](\s|<br[^>]*>|<p>&nbsp;<\/p>)*\[caption/g,"caption] [caption").replace(/<(object|audio|video)[\s\S]+?<\/\1>/g,function(a){return a.replace(/[\r\n]+/g," ")}).replace(/<pre[^>]*>[\s\S]+?<\/pre>/g,function(a){return a=a.replace(/<br ?\/?>(\r\n|\n)?/g,"\n"),a.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"\n")})}),a.on("hide",function(){var c=a.getElement();c.value=b(c.value)})}),a.on("beforeSetContent",function(a){a.load&&(a.content=a.content.replace(/(^|[\r\n]+)\s*(https?:\/\/[^<>"\s]+)[ \u00A0\uFEFF]*([\r\n]+|$)/gim,"$1<p>$2</p>$3"))},!0))});
1
+ tinymce.PluginManager.add("wptadv",function(a){function b(a){return a=a.replace(new RegExp("<(?:"+d+")(?: [^>]*)?>","gi"),"\n$&"),a=a.replace(new RegExp("</(?:"+d+")>","gi"),"$&\n"),a=a.replace(new RegExp("<br(?: [^>]*)?>","gi"),"$&\n"),a=a.replace(/>\n\n</g,">\n<"),a=a.replace(/^<li/gm," <li"),e(a)}var c=[new RegExp("https?://(www\\.)?youtube\\.com/(watch|playlist).*","i"),new RegExp("https?://youtu.be/.*","i"),new RegExp("https?://blip.tv/.*","i"),new RegExp("https?://(www\\.)?vimeo\\.com/.*","i"),new RegExp("https?://(www\\.)?dailymotion\\.com/.*","i"),new RegExp("https?://dai.ly/.*","i"),new RegExp("https?://(www\\.)?flickr\\.com/.*","i"),new RegExp("https?://flic.kr/.*","i"),new RegExp("https?://(.+\\.)?smugmug\\.com/.*","i"),new RegExp("https?://(www\\.)?hulu\\.com/watch/.*","i"),new RegExp("https?://(www\\.)?viddler\\.com/.*","i"),new RegExp("https?://qik.com/.*","i"),new RegExp("https?://revision3.com/.*","i"),new RegExp("https?://i*.photobucket.com/albums/.*","i"),new RegExp("https?://gi*.photobucket.com/groups/.*","i"),new RegExp("https?://(www\\.)?scribd\\.com/.*","i"),new RegExp("https?://wordpress.tv/.*","i"),new RegExp("https?://(.+\\.)?polldaddy\\.com/.*","i"),new RegExp("https?://poll\\.fm/.*","i"),new RegExp("https?://(www\\.)?funnyordie\\.com/videos/.*","i"),new RegExp("https?://(www\\.)?twitter\\.com/.+?/status(es)?/.*","i"),new RegExp("https?://vine\\.co/v/.*","i"),new RegExp("https?://(www\\.)?soundcloud\\.com/.*","i"),new RegExp("https?://(www\\.)?slideshare\\.net/.*","i"),new RegExp("https?://instagr(\\.am|am\\.com)/p/.*","i"),new RegExp("https?://(www\\.)?rdio\\.com/.*","i"),new RegExp("https?://rd\\.io/x/.*","i"),new RegExp("https?://(open|play)\\.spotify\\.com/.*","i"),new RegExp("https?://(.+\\.)?imgur\\.com/.*","i"),new RegExp("https?://(www\\.)?meetu(\\.ps|p\\.com)/.*","i"),new RegExp("https?://(www\\.)?issuu\\.com/.+/docs/.*","i"),new RegExp("https?://(www\\.)?collegehumor\\.com/video/.*","i"),new RegExp("https?://(www\\.)?mixcloud\\.com/.*","i"),new RegExp("https?://(www\\.|embed\\.)?ted\\.com/talks/.*","i"),new RegExp("https?://(www\\.)(animoto|video214)\\.com/play/.*","i"),new RegExp("https?://(.+).tumblr.com/post/.*","i"),new RegExp("https?://(www.)?kickstarter.com/projects/.*","i"),new RegExp("https?://kck.st/.*","i")],d="table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary",e=tinymce.trim;!a.settings.wpautop&&a.settings.tadv_noautop&&(a.on("init",function(){a.on("SaveContent",function(a){a.content=a.content.replace(/<p>\s*(https?:\/\/[^<>"\s]+)\s*<\/p>/gi,function(a,b){for(var d in c)if(c[d].test(b))return"\n"+b+"\n";return a}).replace(/caption\](\s|<br[^>]*>|<p>&nbsp;<\/p>)*\[caption/g,"caption] [caption").replace(/<(object|audio|video)[\s\S]+?<\/\1>/g,function(a){return a.replace(/[\r\n]+/g," ")}).replace(/<pre[^>]*>[\s\S]+?<\/pre>/g,function(a){return a=a.replace(/<br ?\/?>(\r\n|\n)?/g,"\n"),a.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"\n")})}),a.on("hide",function(){var c=a.getElement();c.value=b(c.value)})}),a.on("beforeSetContent",function(a){a.load&&(a.content=a.content.replace(/(^|[\r\n]+)\s*(https?:\/\/[^<>"\s]+)[ \u00A0\uFEFF]*([\r\n]+|$)/gim,"$1<p>$2</p>$3"))},!0))});
readme.txt CHANGED
@@ -1,13 +1,13 @@
1
  === TinyMCE Advanced ===
2
  Contributors: azaozz
3
  Tags: wysiwyg, formatting, tinymce, write, editor
4
- Requires at least: 4.2
5
- Tested up to: 4.2
6
- Stable tag: 4.1.9
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
- Enables the advanced features of TinyMCE, the WordPress WYSIWYG editor.
11
 
12
  == Description ==
13
 
@@ -30,6 +30,10 @@ Best is to install directly from WordPress. If manual installation is required,
30
 
31
  == Changelog ==
32
 
 
 
 
 
33
  = 4.1.9 =
34
  * Updated for WordPress 4.2 and TinyMCE 4.1.9.
35
  * Fixed bugs with showing oEmbed previews when pasting an URL.
@@ -122,6 +126,12 @@ Includes an admin page for arranging the TinyMCE toolbar buttons, easy installat
122
 
123
  == Upgrade Notice ==
124
 
 
 
 
 
 
 
125
  = 4.1 =
126
  Includes the 'textpattern' plugin that supports some of the markdown syntax while typing, and the updated 'table' plugin that supports background and border color for tables.
127
 
@@ -149,7 +159,7 @@ Click the "Restore Default Settings" button on the plugin settings page and then
149
 
150
  = Other questions? More screenshots? =
151
 
152
- Please post on the support forum or visit the homepage for [TinyMCE Advanced](http://www.laptoptips.ca/projects/tinymce-advanced/).
153
 
154
 
155
  == Screenshots ==
1
  === TinyMCE Advanced ===
2
  Contributors: azaozz
3
  Tags: wysiwyg, formatting, tinymce, write, editor
4
+ Requires at least: 4.3
5
+ Tested up to: 4.3
6
+ Stable tag: 4.2.3
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
+ Enables the advanced features of TinyMCE, the WordPress WYSIWYG editor.
11
 
12
  == Description ==
13
 
30
 
31
  == Changelog ==
32
 
33
+ = 4.2.3 =
34
+ * Updated for WordPress 4.3 and TinyMCE 4.2.3.
35
+ * Removed the 'textpattern' plugin as WordPress 4.3 includes similar functionality by default.
36
+
37
  = 4.1.9 =
38
  * Updated for WordPress 4.2 and TinyMCE 4.1.9.
39
  * Fixed bugs with showing oEmbed previews when pasting an URL.
126
 
127
  == Upgrade Notice ==
128
 
129
+ = 4.2.3 =
130
+ Updated for WordPress 4.3 and TinyMCE 4.2.3.
131
+
132
+ = 4.1.9 =
133
+ Updated for WordPress 4.2 and TinyMCE 4.1.9.
134
+
135
  = 4.1 =
136
  Includes the 'textpattern' plugin that supports some of the markdown syntax while typing, and the updated 'table' plugin that supports background and border color for tables.
137
 
159
 
160
  = Other questions? More screenshots? =
161
 
162
+ Please post on the support forum or visit the homepage for [TinyMCE Advanced](http://www.laptoptips.ca/projects/tinymce-advanced/).
163
 
164
 
165
  == Screenshots ==
tadv_admin.php CHANGED
@@ -59,10 +59,6 @@ if ( isset( $_POST['tadv-save'] ) ) {
59
  $admin_settings_array[] = 'importcss';
60
  }
61
 
62
- if ( ! empty( $_POST['textpattern'] ) ) {
63
- $admin_settings_array[] = 'textpattern';
64
- }
65
-
66
  if ( ! empty( $_POST['no_autop'] ) ) {
67
  $admin_settings_array[] = 'no_autop';
68
  }
@@ -108,28 +104,33 @@ if ( isset( $_POST['tadv-save'] ) ) {
108
  $this->settings = $settings;
109
  $this->load_settings();
110
 
111
- // Merge the submitted plugins and from the buttons
112
  $settings['plugins'] = implode( ',', $this->get_plugins( $plugins_array ) );
113
  $this->settings = $settings;
114
  $this->plugins = $settings['plugins'];
115
 
116
- // Save the new settings
117
  update_option( 'tadv_settings', $settings );
118
 
119
  } elseif ( isset( $_POST['tadv-restore-defaults'] ) ) {
120
- // TODO admin || SA
 
 
121
  $this->admin_settings = $this->default_admin_settings;
122
  update_option( 'tadv_admin_settings', $this->default_admin_settings );
123
 
124
- // can 'save_posts' ?
125
  $this->settings = $this->default_settings;
126
  update_option( 'tadv_settings', $this->default_settings );
127
 
128
  $message = '<div class="updated"><p>' . __('Default settings restored.', 'tinymce-advanced') . '</p></div>';
129
  } elseif ( isset( $_POST['tadv-export-settings'] ) ) {
 
 
130
  $this->load_settings();
131
  $output = array( 'settings' => $this->settings );
132
- // TODO admin || SA
 
133
  $output['admin_settings'] = $this->admin_settings;
134
 
135
  ?>
@@ -154,7 +155,9 @@ if ( isset( $_POST['tadv-save'] ) ) {
154
 
155
  return;
156
  } elseif ( isset( $_POST['tadv-import-settings'] ) ) {
157
- // TODO ! admin && ! SA
 
 
158
  ?>
159
  <div class="wrap">
160
  <h2><?php _e( 'TinyMCE Advanced Settings Import', 'tinymce-advanced' ); ?></h2>
@@ -179,6 +182,8 @@ if ( isset( $_POST['tadv-save'] ) ) {
179
  return;
180
  } elseif ( isset( $_POST['tadv-import-submit'] ) && ! empty( $_POST['tadv-import'] ) && is_string( $_POST['tadv-import'] ) ) {
181
  check_admin_referer( 'tadv-import' );
 
 
182
  $import = json_decode( trim( wp_unslash( $_POST['tadv-import'] ) ), true );
183
  $settings = $admin_settings = array();
184
 
@@ -187,6 +192,7 @@ if ( isset( $_POST['tadv-save'] ) ) {
187
  $settings = $this->sanitize_settings( $import['settings'] );
188
  }
189
 
 
190
  if ( ! empty( $import['admin_settings'] ) ) {
191
  $admin_settings = $this->sanitize_settings( $import['admin_settings'] );
192
  }
@@ -195,15 +201,16 @@ if ( isset( $_POST['tadv-save'] ) ) {
195
  if ( empty( $settings ) ) {
196
  $message = '<div class="error"><p>' . __('Importing of settings failed.', 'tinymce-advanced') . '</p></div>';
197
  } else {
 
198
  $this->admin_settings = $admin_settings;
199
  update_option( 'tadv_admin_settings', $admin_settings );
200
 
201
  // User options
202
- // TODO allow editors, authors and contributors some access
203
  $this->settings = $settings;
204
  $this->load_settings();
205
 
206
- // Merge the submitted plugins and from the buttons
207
  if ( ! empty( $settings['plugins'] ) ) {
208
  $settings['plugins'] = implode( ',', $this->get_plugins( explode( ',', $settings['plugins'] ) ) );
209
  }
@@ -458,16 +465,6 @@ if ( ! is_multisite() || current_user_can( 'manage_sites' ) ) {
458
  <?php _e( 'Load the CSS classes used in editor-style.css and replace the Formats button and sub-menu.', 'tinymce-advanced' ); ?></label>
459
  </div>
460
 
461
- <div>
462
- <label><input type="checkbox" name="textpattern" id="textpattern" <?php if ( $this->check_admin_setting('textpattern') ) echo ' checked="checked"'; ?> />
463
- <?php _e( 'Markdown typing support (text pattern plugin)', 'tinymce-advanced' ); ?></label>
464
- <p>
465
- <?php _e( 'This plugin matches special patterns while you type and applies formats or executes commands on the matched text.', 'tinymce-advanced' ); ?>
466
- <?php _e( 'The default patterns are the same as the markdown syntax so you can type <code># text</code> to create a header, <code>1. text</code> to create a list, <code>**text**</code> to make it bold, etc.', 'tinymce-advanced' ); ?>
467
- <a href="http://www.tinymce.com/wiki.php/Configuration:textpattern_patterns" target="_blank"><?php _e( 'More information', 'tinymce-advanced' ); ?></a>
468
- </p>
469
- </div>
470
-
471
  <div>
472
  <label><input type="checkbox" name="no_autop" id="no_autop" <?php if ( $this->check_admin_setting( 'no_autop' ) ) echo ' checked="checked"'; ?> />
473
  <?php _e( 'Stop removing the &lt;p&gt; and &lt;br /&gt; tags when saving and show them in the Text editor', 'tinymce-advanced' ); ?></label>
59
  $admin_settings_array[] = 'importcss';
60
  }
61
 
 
 
 
 
62
  if ( ! empty( $_POST['no_autop'] ) ) {
63
  $admin_settings_array[] = 'no_autop';
64
  }
104
  $this->settings = $settings;
105
  $this->load_settings();
106
 
107
+ // Merge the submitted plugins buttons
108
  $settings['plugins'] = implode( ',', $this->get_plugins( $plugins_array ) );
109
  $this->settings = $settings;
110
  $this->plugins = $settings['plugins'];
111
 
112
+ // Save the new settings. TODO: per user
113
  update_option( 'tadv_settings', $settings );
114
 
115
  } elseif ( isset( $_POST['tadv-restore-defaults'] ) ) {
116
+ check_admin_referer( 'tadv-save-buttons-order' );
117
+
118
+ // TODO: only for admin || SA
119
  $this->admin_settings = $this->default_admin_settings;
120
  update_option( 'tadv_admin_settings', $this->default_admin_settings );
121
 
122
+ // TODO: all users that can have settings
123
  $this->settings = $this->default_settings;
124
  update_option( 'tadv_settings', $this->default_settings );
125
 
126
  $message = '<div class="updated"><p>' . __('Default settings restored.', 'tinymce-advanced') . '</p></div>';
127
  } elseif ( isset( $_POST['tadv-export-settings'] ) ) {
128
+ check_admin_referer( 'tadv-save-buttons-order' );
129
+
130
  $this->load_settings();
131
  $output = array( 'settings' => $this->settings );
132
+
133
+ // TODO: only admin || SA
134
  $output['admin_settings'] = $this->admin_settings;
135
 
136
  ?>
155
 
156
  return;
157
  } elseif ( isset( $_POST['tadv-import-settings'] ) ) {
158
+ check_admin_referer( 'tadv-save-buttons-order' );
159
+
160
+ // TODO: all users
161
  ?>
162
  <div class="wrap">
163
  <h2><?php _e( 'TinyMCE Advanced Settings Import', 'tinymce-advanced' ); ?></h2>
182
  return;
183
  } elseif ( isset( $_POST['tadv-import-submit'] ) && ! empty( $_POST['tadv-import'] ) && is_string( $_POST['tadv-import'] ) ) {
184
  check_admin_referer( 'tadv-import' );
185
+
186
+ // TODO: all users
187
  $import = json_decode( trim( wp_unslash( $_POST['tadv-import'] ) ), true );
188
  $settings = $admin_settings = array();
189
 
192
  $settings = $this->sanitize_settings( $import['settings'] );
193
  }
194
 
195
+ // only admin || SA
196
  if ( ! empty( $import['admin_settings'] ) ) {
197
  $admin_settings = $this->sanitize_settings( $import['admin_settings'] );
198
  }
201
  if ( empty( $settings ) ) {
202
  $message = '<div class="error"><p>' . __('Importing of settings failed.', 'tinymce-advanced') . '</p></div>';
203
  } else {
204
+ // only admin || SA
205
  $this->admin_settings = $admin_settings;
206
  update_option( 'tadv_admin_settings', $admin_settings );
207
 
208
  // User options
209
+ // TODO: allow editors, authors and contributors some access
210
  $this->settings = $settings;
211
  $this->load_settings();
212
 
213
+ // Merge the submitted plugins and buttons
214
  if ( ! empty( $settings['plugins'] ) ) {
215
  $settings['plugins'] = implode( ',', $this->get_plugins( explode( ',', $settings['plugins'] ) ) );
216
  }
465
  <?php _e( 'Load the CSS classes used in editor-style.css and replace the Formats button and sub-menu.', 'tinymce-advanced' ); ?></label>
466
  </div>
467
 
 
 
 
 
 
 
 
 
 
 
468
  <div>
469
  <label><input type="checkbox" name="no_autop" id="no_autop" <?php if ( $this->check_admin_setting( 'no_autop' ) ) echo ' checked="checked"'; ?> />
470
  <?php _e( 'Stop removing the &lt;p&gt; and &lt;br /&gt; tags when saving and show them in the Text editor', 'tinymce-advanced' ); ?></label>
tinymce-advanced.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: TinyMCE Advanced
4
  Plugin URI: http://www.laptoptips.ca/projects/tinymce-advanced/
5
  Description: Enables advanced features and plugins in TinyMCE, the visual editor in WordPress.
6
- Version: 4.1.9
7
  Author: Andrew Ozz
8
  Author URI: http://www.laptoptips.ca/
9
 
@@ -19,7 +19,7 @@ if ( ! class_exists('Tinymce_Advanced') ) :
19
 
20
  class Tinymce_Advanced {
21
 
22
- private $required_version = '4.2';
23
  private $settings;
24
  private $admin_settings;
25
  private $admin_options;
@@ -42,14 +42,13 @@ class Tinymce_Advanced {
42
  'emoticons',
43
  'importcss',
44
  'insertdatetime',
 
45
  'nonbreaking',
46
  'print',
47
  'searchreplace',
48
  'table',
49
  'visualblocks',
50
  'visualchars',
51
- 'link',
52
- 'textpattern',
53
  );
54
 
55
  private $default_settings = array(
@@ -82,7 +81,6 @@ class Tinymce_Advanced {
82
  add_filter( 'mce_buttons_4', array( &$this, 'mce_buttons_4' ), 999 );
83
 
84
  add_filter( 'tiny_mce_before_init', array( &$this, 'mce_options' ) );
85
- add_filter( 'htmledit_pre', array( &$this, 'htmledit' ), 999 );
86
  add_filter( 'mce_external_plugins', array( &$this, 'mce_external_plugins' ), 999 );
87
  add_filter( 'tiny_mce_plugins', array( &$this, 'tiny_mce_plugins' ), 999 );
88
  add_action( 'after_wp_tiny_mce', array( &$this, 'after_wp_tiny_mce' ) );
@@ -182,7 +180,7 @@ class Tinymce_Advanced {
182
 
183
  // Min version
184
  private function check_minimum_supported_version() {
185
- $wp_version = isset( $GLOBALS['wp_version'] ) ? $GLOBALS['wp_version'] : '0';
186
  $wp_version = str_replace( '-src', '', $wp_version );
187
 
188
  return ( version_compare( $wp_version, $this->required_version, '>=' ) );
@@ -338,9 +336,6 @@ class Tinymce_Advanced {
338
  if ( $this->check_setting( 'contextmenu' ) )
339
  $plugins[] = 'contextmenu';
340
 
341
- if ( $this->check_admin_setting( 'textpattern' ) )
342
- $plugins[] = 'textpattern';
343
-
344
  // add/remove used plugins
345
  $plugins = apply_filters( 'tadv_used_plugins', $plugins, $this->used_buttons );
346
 
@@ -454,8 +449,6 @@ class Tinymce_Advanced {
454
 
455
  if ( $this->check_setting( 'paste_images' ) ) {
456
  $init['paste_data_images'] = true;
457
- $init['paste_word_valid_elements'] = '-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],' .
458
- '-table[width],-tr,-td[colspan|rowspan|width],-th,-thead,-tfoot,-tbody,sub,sup,strike,br,del,ins,img[src|alt|title|height|width]';
459
  }
460
 
461
  return $init;
@@ -463,21 +456,48 @@ class Tinymce_Advanced {
463
 
464
  function after_wp_tiny_mce() {
465
  ?>
466
- <style type="text/css">
467
- .wp-fullscreen-wrap .mce-menubar { position: static !important; width: auto !important; }
468
- #wp-content-wrap .mce-tinymce.mce-fullscreen .mce-wp-dfw { display: none; }
469
- </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
470
  <?php
471
  }
472
 
473
- function htmledit( $c ) {
474
- if ( $this->check_admin_setting( 'no_autop' ) ) {
475
- $c = str_replace( array('&amp;', '&lt;', '&gt;'), array('&', '<', '>'), $c );
476
- $c = wpautop( $c );
477
- $c = preg_replace( '/^<p>(https?:\/\/[^<> "]+?)<\/p>$/im', '$1', $c );
478
- $c = htmlspecialchars( $c, ENT_NOQUOTES, get_option( 'blog_charset' ) );
479
- }
480
- return $c;
481
  }
482
 
483
  function mce_external_plugins( $mce_plugins ) {
3
  Plugin Name: TinyMCE Advanced
4
  Plugin URI: http://www.laptoptips.ca/projects/tinymce-advanced/
5
  Description: Enables advanced features and plugins in TinyMCE, the visual editor in WordPress.
6
+ Version: 4.2.3
7
  Author: Andrew Ozz
8
  Author URI: http://www.laptoptips.ca/
9
 
19
 
20
  class Tinymce_Advanced {
21
 
22
+ private $required_version = '4.3';
23
  private $settings;
24
  private $admin_settings;
25
  private $admin_options;
42
  'emoticons',
43
  'importcss',
44
  'insertdatetime',
45
+ 'link',
46
  'nonbreaking',
47
  'print',
48
  'searchreplace',
49
  'table',
50
  'visualblocks',
51
  'visualchars',
 
 
52
  );
53
 
54
  private $default_settings = array(
81
  add_filter( 'mce_buttons_4', array( &$this, 'mce_buttons_4' ), 999 );
82
 
83
  add_filter( 'tiny_mce_before_init', array( &$this, 'mce_options' ) );
 
84
  add_filter( 'mce_external_plugins', array( &$this, 'mce_external_plugins' ), 999 );
85
  add_filter( 'tiny_mce_plugins', array( &$this, 'tiny_mce_plugins' ), 999 );
86
  add_action( 'after_wp_tiny_mce', array( &$this, 'after_wp_tiny_mce' ) );
180
 
181
  // Min version
182
  private function check_minimum_supported_version() {
183
+ include( ABSPATH . WPINC . '/version.php' ); // get an unmodified $wp_version
184
  $wp_version = str_replace( '-src', '', $wp_version );
185
 
186
  return ( version_compare( $wp_version, $this->required_version, '>=' ) );
336
  if ( $this->check_setting( 'contextmenu' ) )
337
  $plugins[] = 'contextmenu';
338
 
 
 
 
339
  // add/remove used plugins
340
  $plugins = apply_filters( 'tadv_used_plugins', $plugins, $this->used_buttons );
341
 
449
 
450
  if ( $this->check_setting( 'paste_images' ) ) {
451
  $init['paste_data_images'] = true;
 
 
452
  }
453
 
454
  return $init;
456
 
457
  function after_wp_tiny_mce() {
458
  ?>
459
+ <script>
460
+ ( function( tinymce ) {
461
+ if ( ! tinymce ) {
462
+ return;
463
+ }
464
+
465
+ var blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre' +
466
+ '|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section' +
467
+ '|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary',
468
+ tagOpenRe = new RegExp( '<(?:' + blocklist + ')(?: [^>]*)?>', 'gi' ),
469
+ tagCloseRe = new RegExp( '</(?:' + blocklist + ')>', 'gi' ),
470
+ $ = tinymce.$;
471
+
472
+ function addLineBreaks( html ) {
473
+ html = html.replace( tagOpenRe, '\n$&' );
474
+ html = html.replace( tagCloseRe, '$&\n' );
475
+ html = html.replace( /<br(?: [^>]*)?>/gi, '$&\n' );
476
+ html = html.replace( />\n\n</g, '>\n<' );
477
+ html = html.replace( /^<li/gm, '\t<li' );
478
+
479
+ return tinymce.trim( html );
480
+ }
481
+
482
+ tinymce.each( $( '.wp-editor-wrap' ), function( element ) {
483
+ var textarea, content;
484
+
485
+ if ( $( element ).hasClass( 'html-active' ) ) {
486
+ textarea = $( '.wp-editor-area', element )[0];
487
+ content = textarea && textarea.value;
488
+
489
+ if ( content && content.indexOf( '</p>' ) !== -1 && content.indexOf( '\n' ) === -1 ) {
490
+ textarea.value = addLineBreaks( content );
491
+ }
492
+ }
493
+ });
494
+ }( window.tinymce ));
495
+ </script>
496
  <?php
497
  }
498
 
499
+ function htmledit( $content ) {
500
+ return $content;
 
 
 
 
 
 
501
  }
502
 
503
  function mce_external_plugins( $mce_plugins ) {