TinyMCE Advanced - Version 4.1.1

Version Description

  • Fix bug with image captions when wpautop is disabled.
  • Add translation support to the settings page. Button names/descriptions are translated from JS using the existing WordPress translation, so this part of the settings page will be translated by default. The other text still needs separate translation.
Download this release

Release Info

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

Code changes from version 4.1 to 4.1.1

css/tadv-styles.css CHANGED
@@ -88,21 +88,33 @@ ul.container,
88
  content: "\e02f";
89
  }
90
 
91
- #tadv-menu-img {
92
- height: 28px;
93
  margin-bottom: 0;
94
- background: #fff url(../images/menu.png) no-repeat 0 center;
95
  border: 1px solid #ccc;
96
  border-bottom: 0;
97
  opacity: 0.4;
98
  filter: alpha(opacity=40);
99
  }
100
 
101
- #tadv-menu-img.enabled {
102
  opacity: 1;
103
  filter: alpha(opacity=100);
104
  }
105
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  #tadvzones,
107
  #unused {
108
  -webkit-user-select: none;
@@ -134,6 +146,11 @@ ul.container,
134
  display: none;
135
  }
136
 
 
 
 
 
 
137
  .tadvdropzone .tadvmodule .tadvitem {
138
  border: 1px solid transparent;
139
  display: block;
@@ -145,6 +162,18 @@ ul.container,
145
  border-radius: 2px;
146
  }
147
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  .tadvdropzone .tadvmodule .tadvitem:hover {
149
  border-color: #999;
150
  }
@@ -195,6 +224,11 @@ ul.container,
195
  padding: 1px 3px;
196
  -webkit-border-radius: 2px;
197
  border-radius: 2px;
 
 
 
 
 
198
  }
199
 
200
  #unused .tadvmodule .descr {
@@ -203,42 +237,16 @@ ul.container,
203
  line-height: 22px;
204
  }
205
 
206
- #fontsizeselect .tadvitem {
207
- background: url(../images/fontsizeselect.png) no-repeat center center;
208
- }
209
-
210
- #fontselect .tadvitem {
211
- background: url(../images/fontselect.png) no-repeat center center;
212
- }
213
-
214
- #formatselect .tadvitem {
215
- background: url(../images/formatselect.png) no-repeat center center;
216
- }
217
-
218
- #styleselect .tadvitem {
219
- background: url(../images/styleselect.png) no-repeat center center;
220
- }
221
-
222
- #formatselect.tadvmodule .tadvitem,
223
- #styleselect.tadvmodule .tadvitem,
224
- #fontsizeselect.tadvmodule .tadvitem,
225
- #fontselect.tadvmodule .tadvitem {
226
- width: 98px;
227
  }
228
 
229
  .tadvdropzone #formatselect,
230
  .tadvdropzone #styleselect,
231
  .tadvdropzone #fontsizeselect,
232
  .tadvdropzone #fontselect {
233
- width: 104px;
234
- }
235
-
236
- .tadvdropzone #formatselect .tadvitem,
237
- .tadvdropzone #styleselect .tadvitem,
238
- .tadvdropzone #fontsizeselect .tadvitem,
239
- .tadvdropzone #fontselect .tadvitem {
240
- width: 92px;
241
- border-color: #bbb;
242
  }
243
 
244
  div.tadv-error {
88
  content: "\e02f";
89
  }
90
 
91
+ #tadv-mce-menu {
 
92
  margin-bottom: 0;
93
+ background: #fff;
94
  border: 1px solid #ccc;
95
  border-bottom: 0;
96
  opacity: 0.4;
97
  filter: alpha(opacity=40);
98
  }
99
 
100
+ #tadv-mce-menu.enabled {
101
  opacity: 1;
102
  filter: alpha(opacity=100);
103
  }
104
 
105
+ #tadv-mce-menu.mce-menubar .mce-menubtn:hover {
106
+ background: transparent;
107
+ }
108
+
109
+ #tadv-mce-menu .mce-btn .mce-caret {
110
+ margin-top: 9px;
111
+ margin-left: 1px;
112
+ }
113
+
114
+ #tadv-mce-menu * {
115
+ cursor: default;
116
+ }
117
+
118
  #tadvzones,
119
  #unused {
120
  -webkit-user-select: none;
146
  display: none;
147
  }
148
 
149
+ .tadvdropzone .mce-menubtn .descr {
150
+ padding: 0;
151
+ font-size: 13px;
152
+ }
153
+
154
  .tadvdropzone .tadvmodule .tadvitem {
155
  border: 1px solid transparent;
156
  display: block;
162
  border-radius: 2px;
163
  }
164
 
165
+ .tadvdropzone .tadvmodule .tadvitem.mce-widget {
166
+ width: auto;
167
+ height: 20px;
168
+ border-color: #ccc;
169
+ background-color: #fff;
170
+ cursor: move;
171
+ }
172
+
173
+ .tadvdropzone.mce-toolbar .mce-btn .the-button {
174
+ padding: 0 3px;
175
+ }
176
+
177
  .tadvdropzone .tadvmodule .tadvitem:hover {
178
  border-color: #999;
179
  }
224
  padding: 1px 3px;
225
  -webkit-border-radius: 2px;
226
  border-radius: 2px;
227
+ white-space: nowrap;
228
+ overflow: hidden;
229
+ text-overflow: ellipsis;
230
+ background-image: none;
231
+ box-shadow: none;
232
  }
233
 
234
  #unused .tadvmodule .descr {
237
  line-height: 22px;
238
  }
239
 
240
+ #unused .tadvmodule .the-button .descr {
241
+ padding: 0 4px;
242
+ font-size: 13px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  }
244
 
245
  .tadvdropzone #formatselect,
246
  .tadvdropzone #styleselect,
247
  .tadvdropzone #fontsizeselect,
248
  .tadvdropzone #fontselect {
249
+ width: 115px;
 
 
 
 
 
 
 
 
250
  }
251
 
252
  div.tadv-error {
images/fontselect.png DELETED
Binary file
images/fontsizeselect.png DELETED
Binary file
images/formatselect.png DELETED
Binary file
images/menu.png DELETED
Binary file
images/styleselect.png DELETED
Binary file
js/tadv.js CHANGED
@@ -32,7 +32,7 @@ jQuery( document ).ready( function( $ ) {
32
  });
33
 
34
  $( '#menubar' ).on( 'change', function() {
35
- $( '#tadv-menu-img' ).toggleClass( 'enabled', $(this).prop('checked') );
36
  });
37
 
38
  $('#tadv-export-select').click( function() {
@@ -56,4 +56,34 @@ jQuery( document ).ready( function( $ ) {
56
  $importError.text( error );
57
  }
58
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  });
32
  });
33
 
34
  $( '#menubar' ).on( 'change', function() {
35
+ $( '#tadv-mce-menu' ).toggleClass( 'enabled', $(this).prop('checked') );
36
  });
37
 
38
  $('#tadv-export-select').click( function() {
56
  $importError.text( error );
57
  }
58
  });
59
+
60
+ function translate( str ) {
61
+ if ( window.tadvTranslation.hasOwnProperty( str ) ) {
62
+ return window.tadvTranslation[str];
63
+ }
64
+ return str;
65
+ }
66
+
67
+ if ( typeof window.tadvTranslation === 'object' ) {
68
+ $( '.tadvitem' ).each( function( i, element ) {
69
+ var $element = $( element ),
70
+ $descr = $element.find( '.descr' ),
71
+ text = $descr.text();
72
+
73
+ if ( text ) {
74
+ text = translate( text );
75
+ $descr.text( text );
76
+ $element.find( '.mce-ico' ).attr( 'title', text );
77
+ }
78
+ });
79
+
80
+ $( '#tadv-mce-menu .tadv-translate' ).each( function( i, element ) {
81
+ var $element = $( element ),
82
+ text = $element.text();
83
+
84
+ if ( text ) {
85
+ $element.text( translate( text ) );
86
+ }
87
+ });
88
+ }
89
  });
langs/tinymce-advanced.pot ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: TinyMCE Advanced\n"
4
+ "POT-Creation-Date: 2014-09-07 21:23-0800\n"
5
+ "PO-Revision-Date: 2014-09-07 21:23-0800\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: \n"
8
+ "Language: en_US\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:21
22
+ #, php-format
23
+ msgid ""
24
+ "This plugin requires WordPress version 4.0 or newer. Please upgrade your "
25
+ "WordPress installation or download an %solder version of the plugin%s."
26
+ msgstr ""
27
+
28
+ #: ../tadv_admin.php:146
29
+ msgid "Default settings restored."
30
+ msgstr ""
31
+
32
+ #: ../tadv_admin.php:155
33
+ msgid "TinyMCE Advanced Settings Export"
34
+ msgstr ""
35
+
36
+ #: ../tadv_admin.php:161
37
+ msgid ""
38
+ "The settings are exported as a JSON encoded string. Please copy the content "
39
+ "and save it in a <b>text</b> (.txt) file, using a plain text editor like "
40
+ "Notepad. It is important that the export is not changed in any way, no "
41
+ "spaces, line breaks, etc."
42
+ msgstr ""
43
+
44
+ #: ../tadv_admin.php:170
45
+ msgid "Select All"
46
+ msgstr ""
47
+
48
+ #: ../tadv_admin.php:172 ../tadv_admin.php:200
49
+ msgid "Back to Editor Settings"
50
+ msgstr ""
51
+
52
+ #: ../tadv_admin.php:182
53
+ msgid "TinyMCE Advanced Settings Import"
54
+ msgstr ""
55
+
56
+ #: ../tadv_admin.php:186
57
+ msgid ""
58
+ "The settings are imported from a JSON encoded string. Please paste the "
59
+ "exported string in the textarea below."
60
+ msgstr ""
61
+
62
+ #: ../tadv_admin.php:193
63
+ msgid "Verify"
64
+ msgstr ""
65
+
66
+ #: ../tadv_admin.php:195
67
+ msgid "Import"
68
+ msgstr ""
69
+
70
+ #: ../tadv_admin.php:222
71
+ msgid "Importing of settings failed."
72
+ msgstr ""
73
+
74
+ #: ../tadv_admin.php:248
75
+ msgid "ERROR: All toolbars are empty. Default settings loaded."
76
+ msgstr ""
77
+
78
+ #: ../tadv_admin.php:261
79
+ msgid "Editor Settings"
80
+ msgstr ""
81
+
82
+ #: ../tadv_admin.php:265
83
+ msgid "Settings saved."
84
+ msgstr ""
85
+
86
+ #: ../tadv_admin.php:274 ../tadv_admin.php:565
87
+ msgid "Save Changes"
88
+ msgstr ""
89
+
90
+ #: ../tadv_admin.php:279
91
+ msgid ""
92
+ "New in TinyMCE 4.0/WordPress 3.9 is the editor menu. When it is enabled, "
93
+ "most buttons are also available as menu items."
94
+ msgstr ""
95
+
96
+ #: ../tadv_admin.php:284
97
+ msgid "Enable the editor menu."
98
+ msgstr ""
99
+
100
+ #: ../tadv_admin.php:396
101
+ msgid ""
102
+ "Drag buttons from the unused buttons below and drop them in the toolbars "
103
+ "above, or drag the buttons in the toolbars to rearrange them."
104
+ msgstr ""
105
+
106
+ #: ../tadv_admin.php:400
107
+ msgid "Unused Buttons"
108
+ msgstr ""
109
+
110
+ #: ../tadv_admin.php:441
111
+ msgid "Also enable:"
112
+ msgstr ""
113
+
114
+ #: ../tadv_admin.php:444
115
+ msgid "List Style Options"
116
+ msgstr ""
117
+
118
+ #: ../tadv_admin.php:450
119
+ msgid "Context Menu"
120
+ msgstr ""
121
+
122
+ #: ../tadv_admin.php:455
123
+ msgid "Link (replaces the Insert/Edit Link dialog)"
124
+ msgstr ""
125
+
126
+ #: ../tadv_admin.php:465
127
+ msgid "Advanced Options"
128
+ msgstr ""
129
+
130
+ #: ../tadv_admin.php:474
131
+ msgid "Import editor-style.css."
132
+ msgstr ""
133
+
134
+ #: ../tadv_admin.php:476
135
+ msgid ""
136
+ "It seems your theme does not support customised styles for the editor. You "
137
+ "can create a CSS file named <code>editor-style.css</code> and upload it to "
138
+ "your theme's directory. After that, enable this setting."
139
+ msgstr ""
140
+
141
+ #: ../tadv_admin.php:488
142
+ msgid ""
143
+ "Load the CSS classes used in editor-style.css and replace the Formats button "
144
+ "and sub-menu."
145
+ msgstr ""
146
+
147
+ #: ../tadv_admin.php:495
148
+ msgid "Markdown typing support (text pattern plugin)"
149
+ msgstr ""
150
+
151
+ #: ../tadv_admin.php:497
152
+ msgid ""
153
+ "This plugin matches special patterns while you type and applies formats or "
154
+ "executed commands on these text patterns. The default patterns are the same "
155
+ "as the markdown syntax so you can type <code># text</code> to create a "
156
+ "header, <code>1. text</code> to create a list, <code>**text**</code> to make "
157
+ "something bold, etc."
158
+ msgstr ""
159
+
160
+ #: ../tadv_admin.php:503
161
+ msgid "More information"
162
+ msgstr ""
163
+
164
+ #: ../tadv_admin.php:510
165
+ msgid ""
166
+ "Stop removing the &lt;p&gt; and &lt;br /&gt; tags when saving and show them "
167
+ "in the Text editor"
168
+ msgstr ""
169
+
170
+ #: ../tadv_admin.php:513
171
+ msgid ""
172
+ "This will make it possible to use more advanced coding in the HTML editor "
173
+ "without the back-end filtering affecting it much. However it may behave "
174
+ "unexpectedly in rare cases, so test it thoroughly before enabling it "
175
+ "permanently. Line breaks in the HTML editor would still affect the output, "
176
+ "in particular do not use empty lines, line breaks inside HTML tags or "
177
+ "multiple &lt;br /&gt; tags."
178
+ msgstr ""
179
+
180
+ #: ../tadv_admin.php:525
181
+ msgid "Replace font size settings"
182
+ msgstr ""
183
+
184
+ #: ../tadv_admin.php:527
185
+ msgid ""
186
+ "Replaces the size setting available for fonts with: 8px 10px 12px 14px 16px "
187
+ "20px 24px 28px 32px 36px."
188
+ msgstr ""
189
+
190
+ #: ../tadv_admin.php:534
191
+ msgid "Enable pasting of image source"
192
+ msgstr ""
193
+
194
+ #: ../tadv_admin.php:536
195
+ msgid ""
196
+ "Works only in Firefox and Safari. These browsers support pasting of images "
197
+ "directly in the editor and convert them to base64 encoded text. This is not "
198
+ "acceptable for larger images like photos or graphics, but may be useful in "
199
+ "some cases for very small images like icons, not larger than 2-3KB. These "
200
+ "images will not be available in the Media Library."
201
+ msgstr ""
202
+
203
+ #: ../tadv_admin.php:547
204
+ msgid "Administration"
205
+ msgstr ""
206
+
207
+ #: ../tadv_admin.php:550
208
+ msgid "Export Settings"
209
+ msgstr ""
210
+
211
+ #: ../tadv_admin.php:552
212
+ msgid "Import Settings"
213
+ msgstr ""
214
+
215
+ #: ../tadv_admin.php:563
216
+ msgid "Restore Default Settings"
217
+ msgstr ""
218
+
219
+ #: ../tadv_admin.php:570
220
+ msgid ""
221
+ "The [Toolbar toggle] button shows or hides the second, third, and forth "
222
+ "button rows. It will only work when it is in the first row and there are "
223
+ "buttons in the second row."
224
+ msgstr ""
mce/wptadv/plugin.js CHANGED
@@ -1,36 +1,36 @@
1
  /*global tinymce:true */
2
 
3
- tinymce.PluginManager.add('wptadv', function( editor ) {
4
  editor.on( 'init', function() {
5
  if ( ! editor.settings.wpautop && editor.settings.tadv_noautop ) {
6
  editor.on( 'SaveContent', function( event ) {
7
  var regex = [
8
- new RegExp('https?://(www\.)?youtube\.com/watch.*', 'i'),
9
  new RegExp('http://youtu.be/*'),
10
  new RegExp('http://blip.tv/*'),
11
- new RegExp('https?://(www\.)?vimeo\.com/.*', 'i'),
12
- new RegExp('https?://(www\.)?dailymotion\.com/.*', 'i'),
13
  new RegExp('http://dai.ly/*'),
14
- new RegExp('https?://(www\.)?flickr\.com/.*', 'i'),
15
  new RegExp('http://flic.kr/*'),
16
- new RegExp('https?://(.+\.)?smugmug\.com/.*', 'i'),
17
- new RegExp('https?://(www\.)?hulu\.com/watch/.*', 'i'),
18
- new RegExp('https?://(www\.)?viddler\.com/.*', 'i'),
19
  new RegExp('http://qik.com/*'),
20
  new RegExp('http://revision3.com/*'),
21
  new RegExp('http://i*.photobucket.com/albums/*'),
22
  new RegExp('http://gi*.photobucket.com/groups/*'),
23
- new RegExp('https?://(www\.)?scribd\.com/.*', 'i'),
24
  new RegExp('http://wordpress.tv/*'),
25
- new RegExp('https?://(.+\.)?polldaddy\.com/.*', 'i'),
26
- new RegExp('https?://(www\.)?funnyordie\.com/videos/.*', 'i'),
27
- new RegExp('https?://(www\.)?twitter\.com/.+?/status(es)?/.*', 'i'),
28
- new RegExp('https?://(www\.)?soundcloud\.com/.*', 'i'),
29
- new RegExp('https?://(www\.)?slideshare\.net/*', 'i'),
30
- new RegExp('http://instagr(\.am|am\.com)/p/.*', 'i'),
31
- new RegExp('https?://(www\.)?rdio\.com/.*', 'i'),
32
- new RegExp('https?://rd\.io/x/.*', 'i'),
33
- new RegExp('https?://(open|play)\.spotify\.com/.*', 'i')
34
  ];
35
 
36
  event.content = event.content.replace( /<p>(https?:\/\/[^<> "]+?)<\/p>/ig, function( all, match ) {
@@ -51,4 +51,11 @@ tinymce.PluginManager.add('wptadv', function( editor ) {
51
  });
52
  }
53
  });
 
 
 
 
 
 
 
54
  });
1
  /*global tinymce:true */
2
 
3
+ tinymce.PluginManager.add( 'wptadv', function( editor ) {
4
  editor.on( 'init', function() {
5
  if ( ! editor.settings.wpautop && editor.settings.tadv_noautop ) {
6
  editor.on( 'SaveContent', function( event ) {
7
  var regex = [
8
+ new RegExp('https?://(www\\.)?youtube\\.com/watch.*', 'i'),
9
  new RegExp('http://youtu.be/*'),
10
  new RegExp('http://blip.tv/*'),
11
+ new RegExp('https?://(www\\.)?vimeo\\.com/.*', 'i'),
12
+ new RegExp('https?://(www\\.)?dailymotion\\.com/.*', 'i'),
13
  new RegExp('http://dai.ly/*'),
14
+ new RegExp('https?://(www\\.)?flickr\\.com/.*', 'i'),
15
  new RegExp('http://flic.kr/*'),
16
+ new RegExp('https?://(.+\\.)?smugmug\\.com/.*', 'i'),
17
+ new RegExp('https?://(www\\.)?hulu\\.com/watch/.*', 'i'),
18
+ new RegExp('https?://(www\\.)?viddler\\.com/.*', 'i'),
19
  new RegExp('http://qik.com/*'),
20
  new RegExp('http://revision3.com/*'),
21
  new RegExp('http://i*.photobucket.com/albums/*'),
22
  new RegExp('http://gi*.photobucket.com/groups/*'),
23
+ new RegExp('https?://(www\\.)?scribd\\.com/.*', 'i'),
24
  new RegExp('http://wordpress.tv/*'),
25
+ new RegExp('https?://(.+\\.)?polldaddy\\.com/.*', 'i'),
26
+ new RegExp('https?://(www\\.)?funnyordie\\.com/videos/.*', 'i'),
27
+ new RegExp('https?://(www\\.)?twitter\\.com/.+?/status(es)?/.*', 'i'),
28
+ new RegExp('https?://(www\\.)?soundcloud\\.com/.*', 'i'),
29
+ new RegExp('https?://(www\\.)?slideshare\\.net/*', 'i'),
30
+ new RegExp('http://instagr(\\.am|am\\.com)/p/.*', 'i'),
31
+ new RegExp('https?://(www\\.)?rdio\\.com/.*', 'i'),
32
+ new RegExp('https?://rd\\.io/x/.*', 'i'),
33
+ new RegExp('https?://(open|play)\\.spotify\\.com/.*', 'i')
34
  ];
35
 
36
  event.content = event.content.replace( /<p>(https?:\/\/[^<> "]+?)<\/p>/ig, function( all, match ) {
51
  });
52
  }
53
  });
54
+
55
+ // Remove white space between <div> and <dl> (fixes captions when no wpautop)
56
+ editor.on( 'PostProcess', function( event ) {
57
+ if ( event.content && ! editor.settings.wpautop && editor.settings.tadv_noautop ) {
58
+ event.content = event.content.replace( /(<div [^>]+>)\s*<dl/g, '$1<dl' );
59
+ }
60
+ }, true );
61
  });
mce/wptadv/plugin.min.js CHANGED
@@ -1 +1 @@
1
- tinymce.PluginManager.add("wptadv",function(a){a.on("init",function(){!a.settings.wpautop&&a.settings.tadv_noautop&&a.on("SaveContent",function(a){var b=[new RegExp("https?://(www.)?youtube.com/watch.*","i"),new RegExp("http://youtu.be/*"),new RegExp("http://blip.tv/*"),new RegExp("https?://(www.)?vimeo.com/.*","i"),new RegExp("https?://(www.)?dailymotion.com/.*","i"),new RegExp("http://dai.ly/*"),new RegExp("https?://(www.)?flickr.com/.*","i"),new RegExp("http://flic.kr/*"),new RegExp("https?://(.+.)?smugmug.com/.*","i"),new RegExp("https?://(www.)?hulu.com/watch/.*","i"),new RegExp("https?://(www.)?viddler.com/.*","i"),new RegExp("http://qik.com/*"),new RegExp("http://revision3.com/*"),new RegExp("http://i*.photobucket.com/albums/*"),new RegExp("http://gi*.photobucket.com/groups/*"),new RegExp("https?://(www.)?scribd.com/.*","i"),new RegExp("http://wordpress.tv/*"),new RegExp("https?://(.+.)?polldaddy.com/.*","i"),new RegExp("https?://(www.)?funnyordie.com/videos/.*","i"),new RegExp("https?://(www.)?twitter.com/.+?/status(es)?/.*","i"),new RegExp("https?://(www.)?soundcloud.com/.*","i"),new RegExp("https?://(www.)?slideshare.net/*","i"),new RegExp("http://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")];a.content=a.content.replace(/<p>(https?:\/\/[^<> "]+?)<\/p>/gi,function(a,c){for(var d in b)if(b[d].test(c))return"\n"+c+"\n";return a}).replace(/caption\]\[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")})})})});
1
+ tinymce.PluginManager.add("wptadv",function(a){a.on("init",function(){!a.settings.wpautop&&a.settings.tadv_noautop&&a.on("SaveContent",function(a){var b=[new RegExp("https?://(www\\.)?youtube\\.com/watch.*","i"),new RegExp("http://youtu.be/*"),new RegExp("http://blip.tv/*"),new RegExp("https?://(www\\.)?vimeo\\.com/.*","i"),new RegExp("https?://(www\\.)?dailymotion\\.com/.*","i"),new RegExp("http://dai.ly/*"),new RegExp("https?://(www\\.)?flickr\\.com/.*","i"),new RegExp("http://flic.kr/*"),new RegExp("https?://(.+\\.)?smugmug\\.com/.*","i"),new RegExp("https?://(www\\.)?hulu\\.com/watch/.*","i"),new RegExp("https?://(www\\.)?viddler\\.com/.*","i"),new RegExp("http://qik.com/*"),new RegExp("http://revision3.com/*"),new RegExp("http://i*.photobucket.com/albums/*"),new RegExp("http://gi*.photobucket.com/groups/*"),new RegExp("https?://(www\\.)?scribd\\.com/.*","i"),new RegExp("http://wordpress.tv/*"),new RegExp("https?://(.+\\.)?polldaddy\\.com/.*","i"),new RegExp("https?://(www\\.)?funnyordie\\.com/videos/.*","i"),new RegExp("https?://(www\\.)?twitter\\.com/.+?/status(es)?/.*","i"),new RegExp("https?://(www\\.)?soundcloud\\.com/.*","i"),new RegExp("https?://(www\\.)?slideshare\\.net/*","i"),new RegExp("http://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")];a.content=a.content.replace(/<p>(https?:\/\/[^<> "]+?)<\/p>/gi,function(a,c){for(var d in b)if(b[d].test(c))return"\n"+c+"\n";return a}).replace(/caption\]\[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("PostProcess",function(b){b.content&&!a.settings.wpautop&&a.settings.tadv_noautop&&(b.content=b.content.replace(/(<div [^>]+>)\s*<dl/g,"$1<dl"))},!0)});
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: azaozz
3
  Tags: wysiwyg, formatting, tinymce, write, editor
4
  Requires at least: 4.0
5
  Tested up to: 4.0
6
- Stable tag: 4.1
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -30,6 +30,10 @@ Best is to install directly from WordPress. If manual installation is required,
30
 
31
  == Changelog ==
32
 
 
 
 
 
33
  = 4.1 =
34
  * Updated for WordPress 4.0 and TinyMCE 4.1.
35
  * Add the 'textpattern' plugin that supports some of the markdown syntax while typing, [(more info)](http://www.tinymce.com/wiki.php/Configuration:textpattern_patterns).
3
  Tags: wysiwyg, formatting, tinymce, write, editor
4
  Requires at least: 4.0
5
  Tested up to: 4.0
6
+ Stable tag: 4.1.1
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
30
 
31
  == Changelog ==
32
 
33
+ = 4.1.1 =
34
+ * Fix bug with image captions when wpautop is disabled.
35
+ * Add translation support to the settings page. Button names/descriptions are translated from JS using the existing WordPress translation, so this part of the settings page will be translated by default. The other text still needs separate translation.
36
+
37
  = 4.1 =
38
  * Updated for WordPress 4.0 and TinyMCE 4.1.
39
  * Add the 'textpattern' plugin that supports some of the markdown syntax while typing, [(more info)](http://www.tinymce.com/wiki.php/Configuration:textpattern_patterns).
tadv_admin.php CHANGED
@@ -9,6 +9,7 @@ if ( ! current_user_can( 'manage_options' ) ) {
9
  wp_die('Access denied');
10
  }
11
 
 
12
  $message = '';
13
 
14
  // TODO admin || SA
@@ -18,7 +19,7 @@ if ( ! $this->check_minimum_supported_version() ) {
18
  <div class="error">
19
  <p><?php printf(
20
  __( 'This plugin requires WordPress version 4.0 or newer. Please upgrade your WordPress ' .
21
- 'installation or download an %1$solder version of the plugin%2$s.', 'tinymce-advanced' ),
22
  '<a href="//wordpress.org/extend/plugins/tinymce-advanced/download/">',
23
  '</a>'
24
  ); ?></p>
@@ -67,7 +68,7 @@ if ( isset( $_POST['tadv-save'] ) ) {
67
 
68
  if ( ! empty( $_POST['menubar'] ) ) {
69
  $options_array[] = 'menubar';
70
- $plugins_array = array( 'anchor', 'code', 'insertdatetime', 'nonbreaking', 'print', 'searchreplace',
71
  'table', 'visualblocks', 'visualchars' );
72
  }
73
 
@@ -283,15 +284,63 @@ if ( isset( $_POST['tadv-save'] ) && empty( $message ) ) {
283
  <?php _e('Enable the editor menu.', 'tinymce-advanced'); ?>
284
  </label></p>
285
 
286
- <p id="tadv-menu-img" <?php if ( $this->check_setting( 'menubar' ) ) { echo ' class="enabled"'; } ?>>&nbsp;</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
 
288
  <?php
289
 
 
 
290
  for ( $i = 1; $i < 5; $i++ ) {
291
  $toolbar = "toolbar_$i";
292
 
293
  ?>
294
- <div class="tadvdropzone">
295
  <ul id="tb<?php echo $i; ?>" class="container">
296
  <?php
297
 
@@ -308,15 +357,30 @@ for ( $i = 1; $i < 5; $i++ ) {
308
  continue;
309
  }
310
 
311
- if ( strpos( $name, '<!' ) === 0 )
312
- $name = '';
313
-
314
  ?><li class="tadvmodule" id="<?php echo $button; ?>">
315
- <div class="tadvitem">
316
- <i class="mce-ico mce-i-<?php echo $button; ?>" title="<?php echo $name; ?>"></i>
317
- <span class="descr"> <?php echo $name; ?></span>
318
- <input type="hidden" class="tadv-button" name="tb<?php echo $i; ?>[]" value="<?php echo $button; ?>" />
319
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
320
  </li><?php
321
 
322
  }
@@ -338,21 +402,35 @@ for ( $i = 1; $i < 5; $i++ ) {
338
  <?php
339
 
340
  foreach( $all_buttons as $button => $name ) {
341
- if ( strpos( $button, 'separator' ) !== false )
342
  continue;
 
343
 
344
- if ( strpos( $name, '<!' ) === 0 )
345
- $name = '';
346
 
347
- ?>
348
- <li class="tadvmodule" id="<?php echo $button; ?>">
349
- <div class="tadvitem">
350
- <i class="mce-ico mce-i-<?php echo $button; ?>" title="<?php echo $name; ?>"></i>
351
- <span class="descr"> <?php echo $name; ?></span>
352
- <input type="hidden" class="tadv-button" name="unused[]" value="<?php echo $button; ?>" />
353
- </div>
354
- </li>
355
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
356
 
357
  }
358
 
@@ -489,7 +567,7 @@ if ( ! is_multisite() || current_user_can( 'manage_sites' ) ) {
489
  </form>
490
 
491
  <div id="wp-adv-error-message" class="tadv-error">
492
- <?php _e('The "Toolbar toggle" button shows/hides the second, third, and forth button rows. '.
493
  'It will only work when it is in the first row and there are buttons in the second row.', 'tinymce-advanced'); ?>
494
  </div>
495
  </div><!-- /wrap -->
9
  wp_die('Access denied');
10
  }
11
 
12
+ load_plugin_textdomain( 'tinymce-advanced', false, 'tinymce-advanced/langs' );
13
  $message = '';
14
 
15
  // TODO admin || SA
19
  <div class="error">
20
  <p><?php printf(
21
  __( 'This plugin requires WordPress version 4.0 or newer. Please upgrade your WordPress ' .
22
+ 'installation or download an %solder version of the plugin%s.', 'tinymce-advanced' ),
23
  '<a href="//wordpress.org/extend/plugins/tinymce-advanced/download/">',
24
  '</a>'
25
  ); ?></p>
68
 
69
  if ( ! empty( $_POST['menubar'] ) ) {
70
  $options_array[] = 'menubar';
71
+ $plugins_array = array( 'anchor', 'code', 'insertdatetime', 'nonbreaking', 'print', 'searchreplace',
72
  'table', 'visualblocks', 'visualchars' );
73
  }
74
 
284
  <?php _e('Enable the editor menu.', 'tinymce-advanced'); ?>
285
  </label></p>
286
 
287
+ <div id="tadv-mce-menu" class="mce-container mce-menubar mce-toolbar mce-first mce-stack-layout-item
288
+ <?php if ( $this->check_setting( 'menubar' ) ) { echo ' enabled'; } ?>">
289
+ <div class="mce-container-body mce-flow-layout">
290
+ <div class="mce-widget mce-btn mce-menubtn mce-first mce-flow-layout-item">
291
+ <button type="button">
292
+ <span class="tadv-translate">File</span>
293
+ <i class="mce-caret"></i>
294
+ </button>
295
+ </div>
296
+ <div class="mce-widget mce-btn mce-menubtn mce-flow-layout-item">
297
+ <button type="button">
298
+ <span class="tadv-translate">Edit</span>
299
+ <i class="mce-caret"></i>
300
+ </button>
301
+ </div>
302
+ <div class="mce-widget mce-btn mce-menubtn mce-flow-layout-item">
303
+ <button type="button">
304
+ <span class="tadv-translate">Insert</span>
305
+ <i class="mce-caret"></i>
306
+ </button>
307
+ </div>
308
+ <div class="mce-widget mce-btn mce-menubtn mce-flow-layout-item mce-toolbar-item">
309
+ <button type="button">
310
+ <span class="tadv-translate">View</span>
311
+ <i class="mce-caret"></i>
312
+ </button>
313
+ </div>
314
+ <div class="mce-widget mce-btn mce-menubtn mce-flow-layout-item">
315
+ <button type="button">
316
+ <span class="tadv-translate">Format</span>
317
+ <i class="mce-caret"></i>
318
+ </button>
319
+ </div>
320
+ <div class="mce-widget mce-btn mce-menubtn mce-flow-layout-item">
321
+ <button type="button">
322
+ <span class="tadv-translate">Table</span>
323
+ <i class="mce-caret"></i>
324
+ </button>
325
+ </div>
326
+ <div class="mce-widget mce-btn mce-menubtn mce-last mce-flow-layout-item">
327
+ <button type="button">
328
+ <span class="tadv-translate">Tools</span>
329
+ <i class="mce-caret"></i>
330
+ </button>
331
+ </div>
332
+ </div>
333
+ </div>
334
 
335
  <?php
336
 
337
+ $mce_text_buttons = array( 'styleselect', 'formatselect', 'fontselect', 'fontsizeselect' );
338
+
339
  for ( $i = 1; $i < 5; $i++ ) {
340
  $toolbar = "toolbar_$i";
341
 
342
  ?>
343
+ <div class="tadvdropzone mce-toolbar">
344
  <ul id="tb<?php echo $i; ?>" class="container">
345
  <?php
346
 
357
  continue;
358
  }
359
 
 
 
 
360
  ?><li class="tadvmodule" id="<?php echo $button; ?>">
361
+ <?php
362
+
363
+ if ( in_array( $button, $mce_text_buttons, true ) ) {
364
+ ?>
365
+ <div class="tadvitem mce-widget mce-btn mce-menubtn mce-fixed-width mce-listbox">
366
+ <div class="the-button">
367
+ <span class="descr"><?php echo $name; ?></span>
368
+ <i class="mce-caret"></i>
369
+ <input type="hidden" class="tadv-button" name="tb<?php echo $i; ?>[]" value="<?php echo $button; ?>" />
370
+ </div>
371
+ </div>
372
+ <?php
373
+ } else {
374
+ ?>
375
+ <div class="tadvitem">
376
+ <i class="mce-ico mce-i-<?php echo $button; ?>" title="<?php echo $name; ?>"></i>
377
+ <span class="descr"><?php echo $name; ?></span>
378
+ <input type="hidden" class="tadv-button" name="tb<?php echo $i; ?>[]" value="<?php echo $button; ?>" />
379
+ </div>
380
+ <?php
381
+ }
382
+
383
+ ?>
384
  </li><?php
385
 
386
  }
402
  <?php
403
 
404
  foreach( $all_buttons as $button => $name ) {
405
+ if ( strpos( $button, 'separator' ) !== false ) {
406
  continue;
407
+ }
408
 
409
+ ?><li class="tadvmodule" id="<?php echo $button; ?>">
410
+ <?php
411
 
412
+ if ( in_array( $button, $mce_text_buttons, true ) ) {
413
+ ?>
414
+ <div class="tadvitem mce-widget mce-btn mce-menubtn mce-fixed-width mce-listbox">
415
+ <div class="the-button">
416
+ <span class="descr"><?php echo $name; ?></span>
417
+ <i class="mce-caret"></i>
418
+ <input type="hidden" class="tadv-button" name="tb<?php echo $i; ?>[]" value="<?php echo $button; ?>" />
419
+ </div>
420
+ </div>
421
+ <?php
422
+ } else {
423
+ ?>
424
+ <div class="tadvitem">
425
+ <i class="mce-ico mce-i-<?php echo $button; ?>" title="<?php echo $name; ?>"></i>
426
+ <span class="descr"><?php echo $name; ?></span>
427
+ <input type="hidden" class="tadv-button" name="tb<?php echo $i; ?>[]" value="<?php echo $button; ?>" />
428
+ </div>
429
+ <?php
430
+ }
431
+
432
+ ?>
433
+ </li><?php
434
 
435
  }
436
 
567
  </form>
568
 
569
  <div id="wp-adv-error-message" class="tadv-error">
570
+ <?php _e('The [Toolbar toggle] button shows or hides the second, third, and forth button rows. ' .
571
  'It will only work when it is in the first row and there are buttons in the second row.', 'tinymce-advanced'); ?>
572
  </div>
573
  </div><!-- /wrap -->
tinymce-advanced.php CHANGED
@@ -3,10 +3,9 @@
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
7
  Author: Andrew Ozz
8
  Author URI: http://www.laptoptips.ca/
9
- Text Domain: tinymce-advanced
10
 
11
  Released under the GPL version 2.0, http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -33,7 +32,24 @@ class Tinymce_Advanced {
33
  private $used_buttons = array();
34
  private $all_buttons = array();
35
  private $buttons_filter = array();
36
- private $all_plugins = array( 'advlist','anchor','code','contextmenu','emoticons','importcss','insertdatetime','nonbreaking','print','searchreplace','table','visualblocks','visualchars','link','textpattern' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
  private $default_settings = array(
39
  'options' => 'menubar,advlist',
@@ -55,7 +71,7 @@ class Tinymce_Advanced {
55
  add_action( 'plugins_loaded', array( &$this, 'set_paths' ), 50 );
56
 
57
  if ( is_admin() ) {
58
- add_action( 'admin_menu', array( &$this, 'menu' ) );
59
  add_action( 'admin_enqueue_scripts', array( &$this, 'enqueue_scripts' ) );
60
  }
61
 
@@ -108,6 +124,26 @@ class Tinymce_Advanced {
108
  wp_enqueue_script( 'tadv-js', TADV_URL . 'js/tadv.js', array( 'jquery-ui-sortable' ), '4.0', true );
109
  wp_enqueue_style( 'tadv-mce-skin', includes_url( 'js/tinymce/skins/lightgray/skin.min.css' ), array(), '4.0' );
110
  wp_enqueue_style( 'tadv-css', TADV_URL . 'css/tadv-styles.css', array( 'editor-buttons' ), '4.0' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  }
112
  }
113
 
@@ -175,60 +211,60 @@ class Tinymce_Advanced {
175
  'italic' => 'Italic',
176
  'underline' => 'Underline',
177
  'strikethrough' => 'Strikethrough',
178
- 'alignleft' => 'Align Left',
179
- 'aligncenter' => 'Align Center',
180
- 'alignright' => 'Align Right',
181
  'alignjustify' => 'Justify',
182
- 'styleselect' => '<!--styleselect-->',
183
- 'formatselect' => '<!--formatselect-->',
184
- 'fontselect' => '<!--fontselect-->',
185
- 'fontsizeselect' => '<!--fontsizeselect-->',
186
  'cut' => 'Cut',
187
  'copy' => 'Copy',
188
  'paste' => 'Paste',
189
- 'bullist' => 'Bullet List',
190
- 'numlist' => 'Numbered List',
191
- 'outdent' => 'Outdent',
192
- 'indent' => 'Indent',
193
- 'blockquote' => 'Quote',
194
  'undo' => 'Undo',
195
  'redo' => 'Redo',
196
- 'removeformat' => 'Remove Formatting',
197
  'subscript' => 'Subscript',
198
  'superscript' => 'Superscript',
199
 
200
  // From plugins
201
- 'hr' => 'Horizontal Rule',
202
- 'link' => 'Link',
203
- 'unlink' => 'Remove Link',
204
- 'image' => 'Edit Image',
205
- 'charmap' => 'Character Map',
206
- 'pastetext' => 'Paste as Text',
207
  'print' => 'Print',
208
- 'anchor' => 'Insert Anchor',
209
- 'searchreplace' => 'Search/Replace',
210
- 'visualblocks' => 'Visual Blocks',
211
- // 'visualchars' => 'Hidden Chars',
212
- 'code' => 'HTML code',
213
- 'fullscreen' => 'Full Screen',
214
- 'insertdatetime' => 'Insert Date/Time',
215
- 'media' => 'Insert Media',
216
- 'nonbreaking' => 'Non-Break Space',
217
  'table' => 'Table',
218
- 'ltr' => 'Left to Right',
219
- 'rtl' => 'Right to Left',
220
  'emoticons' => 'Emoticons',
221
- 'forecolor' => 'Text Color',
222
- 'backcolor' => 'Text Background',
223
 
224
  // Layer plugin ?
225
  // 'insertlayer' => 'Layer',
226
 
227
  // WP
228
- 'wp_adv' => 'Toolbar toggle',
229
- 'wp_help' => 'Help',
230
- 'wp_more' => 'More Tag',
231
- 'wp_page' => 'Page Break',
232
  );
233
 
234
  // add/remove allowed buttons
@@ -509,13 +545,14 @@ class Tinymce_Advanced {
509
  }
510
 
511
  function settings_page() {
512
- if ( ! defined( 'TADV_ADMIN_PAGE' ) )
513
  define( 'TADV_ADMIN_PAGE', true );
 
514
 
515
  include_once( TADV_PATH . 'tadv_admin.php' );
516
  }
517
 
518
- function menu() {
519
  add_options_page( 'TinyMCE Advanced', 'TinyMCE Advanced', 'manage_options', 'tinymce-advanced', array( &$this, 'settings_page' ) );
520
  }
521
  }
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.1
7
  Author: Andrew Ozz
8
  Author URI: http://www.laptoptips.ca/
 
9
 
10
  Released under the GPL version 2.0, http://www.gnu.org/licenses/gpl-2.0.html
11
 
32
  private $used_buttons = array();
33
  private $all_buttons = array();
34
  private $buttons_filter = array();
35
+
36
+ private $all_plugins = array(
37
+ 'advlist',
38
+ 'anchor',
39
+ 'code',
40
+ 'contextmenu',
41
+ 'emoticons',
42
+ 'importcss',
43
+ 'insertdatetime',
44
+ 'nonbreaking',
45
+ 'print',
46
+ 'searchreplace',
47
+ 'table',
48
+ 'visualblocks',
49
+ 'visualchars',
50
+ 'link',
51
+ 'textpattern',
52
+ );
53
 
54
  private $default_settings = array(
55
  'options' => 'menubar,advlist',
71
  add_action( 'plugins_loaded', array( &$this, 'set_paths' ), 50 );
72
 
73
  if ( is_admin() ) {
74
+ add_action( 'admin_menu', array( &$this, 'add_menu' ) );
75
  add_action( 'admin_enqueue_scripts', array( &$this, 'enqueue_scripts' ) );
76
  }
77
 
124
  wp_enqueue_script( 'tadv-js', TADV_URL . 'js/tadv.js', array( 'jquery-ui-sortable' ), '4.0', true );
125
  wp_enqueue_style( 'tadv-mce-skin', includes_url( 'js/tinymce/skins/lightgray/skin.min.css' ), array(), '4.0' );
126
  wp_enqueue_style( 'tadv-css', TADV_URL . 'css/tadv-styles.css', array( 'editor-buttons' ), '4.0' );
127
+
128
+ if ( substr( get_locale(), 0, 2 ) !== 'en' ) {
129
+ add_action( 'admin_footer', array( &$this, 'load_mce_translation' ) );
130
+ }
131
+ }
132
+ }
133
+
134
+ function load_mce_translation() {
135
+ if ( ! class_exists( '_WP_Editors' ) ) {
136
+ require( ABSPATH . WPINC . '/class-wp-editor.php' );
137
+ }
138
+
139
+ $strings = _WP_Editors::wp_mce_translation();
140
+ $strings = preg_replace( '/tinymce.addI18n[^{]+/', '', $strings );
141
+ $strings = preg_replace( '/[^}]*$/', '', $strings );
142
+
143
+ if ( $strings ) {
144
+ ?>
145
+ <script type="text/javascript">var tadvTranslation = <?php echo $strings; ?>;</script>
146
+ <?php
147
  }
148
  }
149
 
211
  'italic' => 'Italic',
212
  'underline' => 'Underline',
213
  'strikethrough' => 'Strikethrough',
214
+ 'alignleft' => 'Align left',
215
+ 'aligncenter' => 'Align center',
216
+ 'alignright' => 'Align right',
217
  'alignjustify' => 'Justify',
218
+ 'styleselect' => 'Formats',
219
+ 'formatselect' => 'Paragraph',
220
+ 'fontselect' => 'Font Family',
221
+ 'fontsizeselect' => 'Font Sizes',
222
  'cut' => 'Cut',
223
  'copy' => 'Copy',
224
  'paste' => 'Paste',
225
+ 'bullist' => 'Bulleted list',
226
+ 'numlist' => 'Numbered list',
227
+ 'outdent' => 'Decrease indent',
228
+ 'indent' => 'Increase indent',
229
+ 'blockquote' => 'Blockquote',
230
  'undo' => 'Undo',
231
  'redo' => 'Redo',
232
+ 'removeformat' => 'Clear formatting',
233
  'subscript' => 'Subscript',
234
  'superscript' => 'Superscript',
235
 
236
  // From plugins
237
+ 'hr' => 'Horizontal line',
238
+ 'link' => 'Insert/edit link',
239
+ 'unlink' => 'Remove link',
240
+ 'image' => 'Insert/edit image',
241
+ 'charmap' => 'Special character',
242
+ 'pastetext' => 'Paste as text',
243
  'print' => 'Print',
244
+ 'anchor' => 'Anchor',
245
+ 'searchreplace' => 'Find and replace',
246
+ 'visualblocks' => 'Show blocks',
247
+ // 'visualchars' => 'Hidden chars',
248
+ 'code' => 'Source code',
249
+ 'fullscreen' => 'Fullscreen',
250
+ 'insertdatetime' => 'Insert date/time',
251
+ 'media' => 'Insert/edit video',
252
+ 'nonbreaking' => 'Nonbreaking space',
253
  'table' => 'Table',
254
+ 'ltr' => 'Left to right',
255
+ 'rtl' => 'Right to left',
256
  'emoticons' => 'Emoticons',
257
+ 'forecolor' => 'Text color',
258
+ 'backcolor' => 'Background color',
259
 
260
  // Layer plugin ?
261
  // 'insertlayer' => 'Layer',
262
 
263
  // WP
264
+ 'wp_adv' => 'Toolbar Toggle',
265
+ 'wp_help' => 'Keyboard Shortcuts',
266
+ 'wp_more' => 'Read more...',
267
+ 'wp_page' => 'Page break',
268
  );
269
 
270
  // add/remove allowed buttons
545
  }
546
 
547
  function settings_page() {
548
+ if ( ! defined( 'TADV_ADMIN_PAGE' ) ) {
549
  define( 'TADV_ADMIN_PAGE', true );
550
+ }
551
 
552
  include_once( TADV_PATH . 'tadv_admin.php' );
553
  }
554
 
555
+ function add_menu() {
556
  add_options_page( 'TinyMCE Advanced', 'TinyMCE Advanced', 'manage_options', 'tinymce-advanced', array( &$this, 'settings_page' ) );
557
  }
558
  }