Newsletter - Version 2.5.2.7

Version Description

  • Fixed the profile save redirector on blogs without permalinks
Download this release

Release Info

Developer satollo
Plugin Icon 128x128 Newsletter
Version 2.5.2.7
Comparing to
See all releases

Code changes from version 2.5.2.3 to 2.5.2.7

Files changed (106) hide show
  1. commons.php +10 -2
  2. emails-edit.php +2 -3
  3. header.php +15 -2
  4. import.php +5 -0
  5. languages/pt_PT.php +53 -0
  6. plugin-activate.inc.php +1 -0
  7. plugin-head.inc.php +1 -1
  8. plugin.php +12 -6
  9. profile.php +3 -0
  10. readme.txt +23 -3
  11. tiny_mce/langs/en.js +1 -169
  12. tiny_mce/plugins/fullscreen/editor_plugin.js +1 -1
  13. tiny_mce/plugins/fullscreen/editor_plugin_src.js +18 -7
  14. tiny_mce/plugins/fullscreen/fullscreen.htm +2 -1
  15. tiny_mce/plugins/paste/editor_plugin.js +1 -0
  16. tiny_mce/plugins/paste/editor_plugin_src.js +871 -0
  17. tiny_mce/plugins/paste/js/pastetext.js +36 -0
  18. tiny_mce/plugins/paste/js/pasteword.js +51 -0
  19. tiny_mce/plugins/paste/langs/en_dlg.js +1 -0
  20. tiny_mce/plugins/paste/pastetext.htm +27 -0
  21. tiny_mce/plugins/paste/pasteword.htm +21 -0
  22. tiny_mce/plugins/table/cell.htm +16 -14
  23. tiny_mce/plugins/table/editor_plugin.js +1 -1
  24. tiny_mce/plugins/table/editor_plugin_src.js +1408 -1118
  25. tiny_mce/plugins/table/js/cell.js +45 -12
  26. tiny_mce/plugins/table/js/row.js +19 -19
  27. tiny_mce/plugins/table/js/table.js +59 -24
  28. tiny_mce/plugins/table/langs/en_dlg.js +1 -74
  29. tiny_mce/plugins/table/merge_cells.htm +11 -11
  30. tiny_mce/plugins/table/row.htm +12 -9
  31. tiny_mce/plugins/table/table.htm +54 -53
  32. tiny_mce/plugins/xhtmlxtras/abbr.htm +142 -0
  33. tiny_mce/plugins/xhtmlxtras/acronym.htm +142 -0
  34. tiny_mce/plugins/xhtmlxtras/attributes.htm +149 -0
  35. tiny_mce/plugins/xhtmlxtras/cite.htm +142 -0
  36. tiny_mce/plugins/xhtmlxtras/css/attributes.css +11 -0
  37. tiny_mce/plugins/xhtmlxtras/css/popup.css +9 -0
  38. tiny_mce/plugins/xhtmlxtras/del.htm +162 -0
  39. tiny_mce/plugins/xhtmlxtras/editor_plugin.js +1 -0
  40. tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +132 -0
  41. tiny_mce/plugins/xhtmlxtras/ins.htm +162 -0
  42. tiny_mce/plugins/xhtmlxtras/js/abbr.js +28 -0
  43. tiny_mce/plugins/xhtmlxtras/js/acronym.js +28 -0
  44. tiny_mce/plugins/xhtmlxtras/js/attributes.js +111 -0
  45. tiny_mce/plugins/xhtmlxtras/js/cite.js +28 -0
  46. tiny_mce/plugins/xhtmlxtras/js/del.js +53 -0
  47. tiny_mce/plugins/xhtmlxtras/js/element_common.js +229 -0
  48. tiny_mce/plugins/xhtmlxtras/js/ins.js +53 -0
  49. tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js +1 -0
  50. tiny_mce/themes/advanced/about.htm +3 -5
  51. tiny_mce/themes/advanced/anchor.htm +5 -5
  52. tiny_mce/themes/advanced/charmap.htm +44 -42
  53. tiny_mce/themes/advanced/color_picker.htm +10 -9
  54. tiny_mce/themes/advanced/editor_template.js +1 -1
  55. tiny_mce/themes/advanced/editor_template_src.js +308 -150
  56. tiny_mce/themes/advanced/image.htm +51 -51
  57. tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
  58. tiny_mce/themes/advanced/img/flash.gif +0 -0
  59. tiny_mce/themes/advanced/img/icons.gif +0 -0
  60. tiny_mce/themes/advanced/img/iframe.gif +0 -0
  61. tiny_mce/themes/advanced/img/pagebreak.gif +0 -0
  62. tiny_mce/themes/advanced/img/quicktime.gif +0 -0
  63. tiny_mce/themes/advanced/img/realmedia.gif +0 -0
  64. tiny_mce/themes/advanced/img/shockwave.gif +0 -0
  65. tiny_mce/themes/advanced/img/trans.gif +0 -0
  66. tiny_mce/themes/advanced/img/video.gif +0 -0
  67. tiny_mce/themes/advanced/img/windowsmedia.gif +0 -0
  68. tiny_mce/themes/advanced/js/about.js +1 -0
  69. tiny_mce/themes/advanced/js/anchor.js +8 -2
  70. tiny_mce/themes/advanced/js/charmap.js +34 -6
  71. tiny_mce/themes/advanced/js/color_picker.js +110 -34
  72. tiny_mce/themes/advanced/js/image.js +12 -6
  73. tiny_mce/themes/advanced/js/link.js +4 -7
  74. tiny_mce/themes/advanced/js/source_editor.js +6 -12
  75. tiny_mce/themes/advanced/langs/en.js +1 -62
  76. tiny_mce/themes/advanced/langs/en_dlg.js +1 -51
  77. tiny_mce/themes/advanced/link.htm +27 -28
  78. tiny_mce/themes/advanced/shortcuts.htm +47 -0
  79. tiny_mce/themes/advanced/skins/default/content.css +17 -2
  80. tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
  81. tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
  82. tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
  83. tiny_mce/themes/advanced/skins/default/ui.css +7 -7
  84. tiny_mce/themes/advanced/skins/highcontrast/content.css +24 -0
  85. tiny_mce/themes/advanced/skins/highcontrast/dialog.css +105 -0
  86. tiny_mce/themes/advanced/skins/highcontrast/ui.css +102 -0
  87. tiny_mce/themes/advanced/skins/o2k7/content.css +14 -1
  88. tiny_mce/themes/advanced/skins/o2k7/dialog.css +1 -0
  89. tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
  90. tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  91. tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  92. tiny_mce/themes/advanced/skins/o2k7/ui.css +10 -9
  93. tiny_mce/themes/advanced/skins/o2k7/ui_black.css +1 -1
  94. tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +1 -1
  95. tiny_mce/themes/advanced/source_editor.htm +3 -4
  96. tiny_mce/themes/simple/editor_template.js +1 -1
  97. tiny_mce/themes/simple/editor_template_src.js +1 -2
  98. tiny_mce/themes/simple/img/icons.gif +0 -0
  99. tiny_mce/themes/simple/langs/en.js +1 -11
  100. tiny_mce/tiny_mce.js +1 -1
  101. tiny_mce/tiny_mce_popup.js +1 -1
  102. tiny_mce/utils/editable_selects.js +1 -1
  103. tiny_mce/utils/form_utils.js +14 -4
  104. tiny_mce/utils/mctabs.js +95 -10
  105. tiny_mce/utils/validate.js +35 -3
  106. users-edit.php +9 -0
commons.php CHANGED
@@ -98,12 +98,14 @@ class NewsletterControls {
98
 
99
  foreach ($groups as $group) {
100
  echo '<optgroup label="' . htmlspecialchars($group['']) . '">';
 
101
  foreach ($group as $key => $label) {
102
  if ($key == '') continue;
103
  echo '<option value="' . $key . '"';
104
  if ($value == $key) echo ' selected';
105
  echo '>' . htmlspecialchars($label) . '</option>';
106
  }
 
107
  echo '</optgroup>';
108
  }
109
  echo '</select>';
@@ -292,7 +294,7 @@ function newsletter_search($text, $status='', $order='email', $list = null, $lin
292
  }
293
 
294
  function newsletter_get_test_subscribers() {
295
- global $newsletter;
296
  $subscribers = array();
297
  for ($i = 0; $i < 5; $i++) {
298
  if (!empty($newsletter->options_main['test_email_' . $i])) {
@@ -308,7 +310,13 @@ function newsletter_get_test_subscribers() {
308
  $subscribers[] = $subscriber;
309
  }
310
  }
311
- return $subscribers;
 
 
 
 
 
 
312
  }
313
 
314
  function newsletter_delete_all($status=null) {
98
 
99
  foreach ($groups as $group) {
100
  echo '<optgroup label="' . htmlspecialchars($group['']) . '">';
101
+ if (!empty($group)) {
102
  foreach ($group as $key => $label) {
103
  if ($key == '') continue;
104
  echo '<option value="' . $key . '"';
105
  if ($value == $key) echo ' selected';
106
  echo '>' . htmlspecialchars($label) . '</option>';
107
  }
108
+ }
109
  echo '</optgroup>';
110
  }
111
  echo '</select>';
294
  }
295
 
296
  function newsletter_get_test_subscribers() {
297
+ global $newsletter, $wpdb;
298
  $subscribers = array();
299
  for ($i = 0; $i < 5; $i++) {
300
  if (!empty($newsletter->options_main['test_email_' . $i])) {
310
  $subscribers[] = $subscriber;
311
  }
312
  }
313
+ $others = $wpdb->get_results("select * from " . $wpdb->prefix . "newsletter where test=1");
314
+ if (!empty($others)) {
315
+ foreach ($others as &$other) {
316
+ $subscribers[] = $other;
317
+ }
318
+ }
319
+ return $subscribers;
320
  }
321
 
322
  function newsletter_delete_all($status=null) {
emails-edit.php CHANGED
@@ -124,9 +124,9 @@ function newsletter_get_theme_css_url($theme) {
124
  mode : "specific_textareas",
125
  editor_selector : "visual",
126
  theme : "advanced",
127
- plugins: "table,fullscreen",
128
  theme_advanced_disable : "styleselect",
129
- theme_advanced_buttons1_add: "forecolor,blockquote,code",
130
  theme_advanced_buttons3 : "tablecontrols,fullscreen",
131
  relative_urls : false,
132
  remove_script_host : false,
@@ -230,7 +230,6 @@ function newsletter_get_theme_css_url($theme) {
230
 
231
  <?php if ($nc->data['status'] == 'new') {
232
  $nc->button_confirm('send', 'Send', 'Start a real delivery?');
233
- $nc->button_confirm('send-now', 'Instant send', 'Start a real delivery?');
234
  } ?>
235
  <?php if ($nc->data['status'] == 'sending') $nc->button_confirm('pause', 'Pause', 'Pause the delivery?'); ?>
236
  <?php if ($nc->data['status'] == 'paused') $nc->button_confirm('continue', 'Continue', 'Continue the delivery?'); ?>
124
  mode : "specific_textareas",
125
  editor_selector : "visual",
126
  theme : "advanced",
127
+ plugins: "table,fullscreen,paste",
128
  theme_advanced_disable : "styleselect",
129
+ theme_advanced_buttons1_add: "forecolor,blockquote,code,pastetext,pasteword,selectall",
130
  theme_advanced_buttons3 : "tablecontrols,fullscreen",
131
  relative_urls : false,
132
  remove_script_host : false,
230
 
231
  <?php if ($nc->data['status'] == 'new') {
232
  $nc->button_confirm('send', 'Send', 'Start a real delivery?');
 
233
  } ?>
234
  <?php if ($nc->data['status'] == 'sending') $nc->button_confirm('pause', 'Pause', 'Pause the delivery?'); ?>
235
  <?php if ($nc->data['status'] == 'paused') $nc->button_confirm('continue', 'Continue', 'Continue the delivery?'); ?>
header.php CHANGED
@@ -1,2 +1,15 @@
1
- <iframe src="http://frames.satollo.net/newsletter.php" frameborder="0" width="100%" height="80" style="border: 0"></iframe>
2
-
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <table cellpadding="0" cellspacing="0" border="0" style="border: 1px solid #ddd; background-color: #f7f7ff; padding: 10px;">
2
+ <tr>
3
+ <td valign="middle" align="left" width="110">
4
+ <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5Y6JXSA7BSU2L" target="_blank"><img src="http://www.satollo.net/images/donate.gif"/></a>
5
+ </td>
6
+ <td valign="top" align="left">
7
+ <strong>Your donation is like a diamond: it's forever</strong>.
8
+ More about <a href="http://www.satollo.net/donations" target="_blank">donations I receive</a>.
9
+ See <a href="http://www.satollo.net/plugins" target="_blank"><strong>other plugins</strong></a> that can be useful for your blog.
10
+ <form method="post" action="http://www.satollo.net/subscribe" target="_blank">
11
+ Subscribe my newsletter: <input name="ne" value="Your email" onclick="if (this.defaultValue==this.value) this.value=''" onblur="if (this.value=='') this.value=this.defaultValue"> <input type="hidden" value="s" name="na"> <input type="hidden" value="plugin" name="nr"><input type="submit" value="Subscribe">
12
+ </form>
13
+ </td>
14
+ </tr>
15
+ </table>
import.php CHANGED
@@ -42,6 +42,11 @@ if ($action == 'import') {
42
  }
43
  $subscriber['name'] = $newsletter->normalize_name($data[1]);
44
  $subscriber['surname'] = $newsletter->normalize_name($data[2]);
 
 
 
 
 
45
  // May by here for a previous saving
46
  unset($subscriber['id']);
47
 
42
  }
43
  $subscriber['name'] = $newsletter->normalize_name($data[1]);
44
  $subscriber['surname'] = $newsletter->normalize_name($data[2]);
45
+
46
+ for ($i=1; $i<=NEWSLETTER_PROFILE_MAX; $i++) {
47
+ if (isset($data[$i+2])) $subscriber['profile_' . $i] = $data[$i+2];
48
+ }
49
+
50
  // May by here for a previous saving
51
  unset($subscriber['id']);
52
 
languages/pt_PT.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $defaults_profile['email_error'] = 'Endereço de email incorreto.';
3
+ $defaults_profile['name_error'] = 'O nome não pode estar vazio.';
4
+
5
+ // Subscription page introductory text (befor the subscription form)
6
+ $defaults['subscription_text'] =
7
+ "<p>Inscreva-se na newsletter preenchendo os campos abaixo.</p>
8
+ <p>Um email de confirmação será enviado para a sua caixa de email:
9
+ por favor leia as instruções e complete seu registro.</p>";
10
+
11
+ // Message show after a subbscription request has made.
12
+ $defaults['subscribed_text'] =
13
+ "<p>Foi inscrito corretamente na newsletter.
14
+ Dentro de alguns minutos irá receber um email de confirmação. Siga o link no email para confirmar a inscrição.
15
+ Se o email demorar mais do que 15 minutos a chegar, verifique a sua caixa de SPAM.</p>";
16
+
17
+ // Confirmation email subject (double opt-in)
18
+ $defaults['confirmation_subject'] =
19
+ "{name}, confirme sua inscrição no site {blog_title}";
20
+
21
+ // Confirmation email body (double opt-in)
22
+ $defaults['confirmation_message'] =
23
+ "<p>Olá {name},</p>
24
+ <p>Recebemos um pedido de inscrição no nosso sistema proveniente deste email. Para confirmar
25
+ <a href=\"{subscription_confirm_url}\"><strong>clicando aqui</strong></a>.
26
+ Se não consegue abrir o link, acesse através deste endereço:</p>
27
+ <p>{subscription_confirm_url}</p>
28
+ <p>Se o pedido de inscrição não é proveniente de si, apenas ignore esta mensagem.</p>
29
+ <p>Obrigado.</p>";
30
+
31
+
32
+ // Subscription confirmed text (after a user clicked the confirmation link
33
+ // on the email he received
34
+ $defaults['confirmed_text'] =
35
+ "<p>Sua inscrição foi confirmada!
36
+ Obrigado {name}.</p>";
37
+
38
+ $defaults['confirmed_subject'] =
39
+ "Bem vindo(a), {name}";
40
+
41
+ $defaults['confirmed_message'] =
42
+ "<p>A mensagem confirma a sua inscrição no nosso sistema.</p>
43
+ <p>Obrigado.</p>";
44
+
45
+ // Unsubscription request introductory text
46
+ $defaults['unsubscription_text'] =
47
+ "<p>Cancele a sua inscrição no sistema
48
+ <a href=\"{unsubscription_confirm_url}\">clicando aqui</a>.";
49
+
50
+ // When you finally loosed your subscriber
51
+ $defaults['unsubscribed_text'] =
52
+ "<p>Sua inscrição foi cancelada. Inscreva-se novamente quando quiser.</p>";
53
+
plugin-activate.inc.php CHANGED
@@ -49,6 +49,7 @@ $sql = "CREATE TABLE `" . $wpdb->prefix . "newsletter` (
49
  `profile_19` varchar(255) NOT NULL DEFAULT '',
50
  `referrer` varchar(50) NOT NULL DEFAULT '',
51
  `ip` varchar(50) NOT NULL DEFAULT '',
 
52
  PRIMARY KEY (`id`),
53
  UNIQUE KEY `email` (`email`)
54
  ) $charset_collate;";
49
  `profile_19` varchar(255) NOT NULL DEFAULT '',
50
  `referrer` varchar(50) NOT NULL DEFAULT '',
51
  `ip` varchar(50) NOT NULL DEFAULT '',
52
+ `test` tinyint(4) NOT NULL DEFAULT 0,
53
  PRIMARY KEY (`id`),
54
  UNIQUE KEY `email` (`email`)
55
  ) $charset_collate;";
plugin-head.inc.php CHANGED
@@ -2,7 +2,7 @@
2
  <script type="text/javascript">
3
  //<![CDATA[
4
  function newsletter_check(f) {
5
- var re = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
6
  if (!re.test(f.elements["ne"].value)) {
7
  alert("<?php echo addslashes($options['email_error']); ?>");
8
  return false;
2
  <script type="text/javascript">
3
  //<![CDATA[
4
  function newsletter_check(f) {
5
+ var re = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-]{1,})+\.)+([a-zA-Z0-9]{2,})+$/;
6
  if (!re.test(f.elements["ne"].value)) {
7
  alert("<?php echo addslashes($options['email_error']); ?>");
8
  return false;
plugin.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Newsletter
4
  Plugin URI: http://www.satollo.net/plugins/newsletter
5
  Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="http://www.satollo.net/plugins/newsletter#update">this page</a> to know what's changed.</strong>
6
- Version: 2.5.2.3
7
  Author: Satollo
8
  Author URI: http://www.satollo.net
9
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
@@ -83,6 +83,7 @@ class Newsletter {
83
  }
84
 
85
  function check_transient($name, $time) {
 
86
  if (get_transient($name) !== false) {
87
  $this->log('Called too quickly');
88
  return false;
@@ -114,7 +115,7 @@ class Newsletter {
114
  global $wpdb;
115
 
116
  $this->log();
117
-
118
  if ($this->limits_exceeded()) return false;
119
 
120
  if ($users == null) {
@@ -169,7 +170,7 @@ class Newsletter {
169
 
170
  $m = '<html><head><style type="text/css">' . $css .
171
  '</style></head><body>' . $m . '</body></html>';
172
-
173
  $s = $this->replace($email->subject, $user);
174
  $x = $this->mail($user->email, $s, $m, true, $headers, 2);
175
 
@@ -418,7 +419,11 @@ class Newsletter {
418
  if ($options_profile['privacy_status'] == 1) {
419
  $buffer .= '<input type="checkbox" name="ny"/>&nbsp;' . $options_profile['privacy'] . '<br />';
420
  }
421
- $buffer .= '<input type="submit" value="' . $options_profile['subscribe'] . '"/></td></tr>';
 
 
 
 
422
  $buffer .= '</table></form></div>';
423
  return $buffer;
424
  }
@@ -619,7 +624,8 @@ class Newsletter {
619
 
620
  $wpdb->update($wpdb->prefix . 'newsletter', $data, array('id' => $user->id));
621
  $url = empty($this->options_main['url']) ? get_option('home') : $this->options_main['url'];
622
- header('Location: ' . $url . '/?na=pe&ni=' . $user->id . '&nt=' . $user->token);
 
623
  die();
624
  }
625
 
@@ -682,7 +688,7 @@ class Newsletter {
682
  $text = str_replace('{blog_title}', get_option('blogname'), $text);
683
  $text = str_replace('{date}', date_i18n(get_option('date_format')), $text);
684
  $text = str_replace('{blog_description}', get_option('blogdescription'), $text);
685
-
686
  // Date processing
687
  $x = 0;
688
  while (($x = strpos($text, '{date_', $x)) !== false) {
3
  Plugin Name: Newsletter
4
  Plugin URI: http://www.satollo.net/plugins/newsletter
5
  Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="http://www.satollo.net/plugins/newsletter#update">this page</a> to know what's changed.</strong>
6
+ Version: 2.5.2.7
7
  Author: Satollo
8
  Author URI: http://www.satollo.net
9
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
83
  }
84
 
85
  function check_transient($name, $time) {
86
+ usleep(rand(0, 1000000));
87
  if (get_transient($name) !== false) {
88
  $this->log('Called too quickly');
89
  return false;
115
  global $wpdb;
116
 
117
  $this->log();
118
+
119
  if ($this->limits_exceeded()) return false;
120
 
121
  if ($users == null) {
170
 
171
  $m = '<html><head><style type="text/css">' . $css .
172
  '</style></head><body>' . $m . '</body></html>';
173
+
174
  $s = $this->replace($email->subject, $user);
175
  $x = $this->mail($user->email, $s, $m, true, $headers, 2);
176
 
419
  if ($options_profile['privacy_status'] == 1) {
420
  $buffer .= '<input type="checkbox" name="ny"/>&nbsp;' . $options_profile['privacy'] . '<br />';
421
  }
422
+ if (strpos($options_profile['subscribe'], 'http://') !== false) {
423
+ $buffer .= '<input type="image" src="' . $options_profile['subscribe'] . '"/></td></tr>';
424
+ } else {
425
+ $buffer .= '<input type="submit" value="' . $options_profile['subscribe'] . '"/></td></tr>';
426
+ }
427
  $buffer .= '</table></form></div>';
428
  return $buffer;
429
  }
624
 
625
  $wpdb->update($wpdb->prefix . 'newsletter', $data, array('id' => $user->id));
626
  $url = empty($this->options_main['url']) ? get_option('home') : $this->options_main['url'];
627
+ $url = $this->add_qs($url, 'na=pe&ni=' . $user->id . '&nt=' . $user->token, false);
628
+ header('Location: ' . $url);
629
  die();
630
  }
631
 
688
  $text = str_replace('{blog_title}', get_option('blogname'), $text);
689
  $text = str_replace('{date}', date_i18n(get_option('date_format')), $text);
690
  $text = str_replace('{blog_description}', get_option('blogdescription'), $text);
691
+
692
  // Date processing
693
  $x = 0;
694
  while (($x = strpos($text, '{date_', $x)) !== false) {
profile.php CHANGED
@@ -124,6 +124,9 @@ $status = array(0=>'Disabled', 1=>'Only on profile page', 2=>'Even on subscripti
124
  <th>Buttons</th>
125
  <td>
126
  "subscribe": <?php $nc->text('subscribe'); ?> "profile save": <?php $nc->text('save'); ?>
 
 
 
127
  </td>
128
  </tr>
129
  </table>
124
  <th>Buttons</th>
125
  <td>
126
  "subscribe": <?php $nc->text('subscribe'); ?> "profile save": <?php $nc->text('save'); ?>
127
+ <div class="hints">
128
+ For "subscribe" insert an URL to an image (http://...) to use it as a graphical button.
129
+ </div>
130
  </td>
131
  </tr>
132
  </table>
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
 
2
  === Newsletter ===
3
  Tags: newsletter,email,subscription,mass mail
4
- Requires at least: 2.7
5
- Tested up to: 3.2.1
6
  Stable tag: trunk
7
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2545483
8
  Contributors: satollo
@@ -11,7 +11,7 @@ Add a real newsletter service to your blog. In seconds. For free.
11
 
12
  == Description ==
13
 
14
- This plug-in lets you collect subscribers on your blog with a single or double opt-in
15
  subscription process. Double opt-in is law compliant and it means the user has to confirm the subscription
16
  following simple standard instructions sent to him via email.
17
 
@@ -69,6 +69,26 @@ No screen shots are available at this time.
69
 
70
  == Changelog ==
71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  = 2.5.2.3 =
73
 
74
  * Fixed extra field of type "list" not showing up correctly (when more than one)
1
 
2
  === Newsletter ===
3
  Tags: newsletter,email,subscription,mass mail
4
+ Requires at least: 2.8
5
+ Tested up to: 3.3.1
6
  Stable tag: trunk
7
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2545483
8
  Contributors: satollo
11
 
12
  == Description ==
13
 
14
+ This plug-in lets you to collect subscribers on your blog with a single or double opt-in
15
  subscription process. Double opt-in is law compliant and it means the user has to confirm the subscription
16
  following simple standard instructions sent to him via email.
17
 
69
 
70
  == Changelog ==
71
 
72
+ = 2.5.2.7 =
73
+
74
+ * Fixed the profile save redirector on blogs without permalinks
75
+
76
+ = 2.5.2.6 =
77
+
78
+ * Fix the new test subscriber extraction
79
+
80
+ = 2.5.2.5 =
81
+
82
+ * Added the "test" flag on subscriber so a real subscriber can be used while sending test emails
83
+ * Upgraded tinymce
84
+ * Graphical button for submit
85
+ * Emails like aaa@q.com are now accepted
86
+
87
+ = 2.5.2.4 =
88
+
89
+ * Import now consider 19 fields after the last name as extended profile data
90
+ * A possible fix for better concurrency management while sending
91
+
92
  = 2.5.2.3 =
93
 
94
  * Fixed extra field of type "list" not showing up correctly (when more than one)
tiny_mce/langs/en.js CHANGED
@@ -1,169 +1 @@
1
- tinyMCE.addI18n({en:{
2
- common:{
3
- edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?",
4
- apply:"Apply",
5
- insert:"Insert",
6
- update:"Update",
7
- cancel:"Cancel",
8
- close:"Close",
9
- browse:"Browse",
10
- class_name:"Class",
11
- not_set:"-- Not set --",
12
- clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?",
13
- clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.",
14
- popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.",
15
- invalid_data:"Error: Invalid values entered, these are marked in red.",
16
- more_colors:"More colors"
17
- },
18
- contextmenu:{
19
- align:"Alignment",
20
- left:"Left",
21
- center:"Center",
22
- right:"Right",
23
- full:"Full"
24
- },
25
- insertdatetime:{
26
- date_fmt:"%Y-%m-%d",
27
- time_fmt:"%H:%M:%S",
28
- insertdate_desc:"Insert date",
29
- inserttime_desc:"Insert time",
30
- months_long:"January,February,March,April,May,June,July,August,September,October,November,December",
31
- months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
32
- day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",
33
- day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"
34
- },
35
- print:{
36
- print_desc:"Print"
37
- },
38
- preview:{
39
- preview_desc:"Preview"
40
- },
41
- directionality:{
42
- ltr_desc:"Direction left to right",
43
- rtl_desc:"Direction right to left"
44
- },
45
- layer:{
46
- insertlayer_desc:"Insert new layer",
47
- forward_desc:"Move forward",
48
- backward_desc:"Move backward",
49
- absolute_desc:"Toggle absolute positioning",
50
- content:"New layer..."
51
- },
52
- save:{
53
- save_desc:"Save",
54
- cancel_desc:"Cancel all changes"
55
- },
56
- nonbreaking:{
57
- nonbreaking_desc:"Insert non-breaking space character"
58
- },
59
- iespell:{
60
- iespell_desc:"Run spell checking",
61
- download:"ieSpell not detected. Do you want to install it now?"
62
- },
63
- advhr:{
64
- advhr_desc:"Horizontal rule"
65
- },
66
- emotions:{
67
- emotions_desc:"Emotions"
68
- },
69
- searchreplace:{
70
- search_desc:"Find",
71
- replace_desc:"Find/Replace"
72
- },
73
- advimage:{
74
- image_desc:"Insert/edit image"
75
- },
76
- advlink:{
77
- link_desc:"Insert/edit link"
78
- },
79
- xhtmlxtras:{
80
- cite_desc:"Citation",
81
- abbr_desc:"Abbreviation",
82
- acronym_desc:"Acronym",
83
- del_desc:"Deletion",
84
- ins_desc:"Insertion",
85
- attribs_desc:"Insert/Edit Attributes"
86
- },
87
- style:{
88
- desc:"Edit CSS Style"
89
- },
90
- paste:{
91
- paste_text_desc:"Paste as Plain Text",
92
- paste_word_desc:"Paste from Word",
93
- selectall_desc:"Select All"
94
- },
95
- paste_dlg:{
96
- text_title:"Use CTRL+V on your keyboard to paste the text into the window.",
97
- text_linebreaks:"Keep linebreaks",
98
- word_title:"Use CTRL+V on your keyboard to paste the text into the window."
99
- },
100
- table:{
101
- desc:"Inserts a new table",
102
- row_before_desc:"Insert row before",
103
- row_after_desc:"Insert row after",
104
- delete_row_desc:"Delete row",
105
- col_before_desc:"Insert column before",
106
- col_after_desc:"Insert column after",
107
- delete_col_desc:"Remove column",
108
- split_cells_desc:"Split merged table cells",
109
- merge_cells_desc:"Merge table cells",
110
- row_desc:"Table row properties",
111
- cell_desc:"Table cell properties",
112
- props_desc:"Table properties",
113
- paste_row_before_desc:"Paste table row before",
114
- paste_row_after_desc:"Paste table row after",
115
- cut_row_desc:"Cut table row",
116
- copy_row_desc:"Copy table row",
117
- del:"Delete table",
118
- row:"Row",
119
- col:"Column",
120
- cell:"Cell"
121
- },
122
- autosave:{
123
- unload_msg:"The changes you made will be lost if you navigate away from this page.",
124
- restore_content: "Restore auto-saved content",
125
- warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?"
126
- },
127
- fullscreen:{
128
- desc:"Toggle fullscreen mode"
129
- },
130
- media:{
131
- desc:"Insert / edit embedded media",
132
- edit:"Edit embedded media"
133
- },
134
- fullpage:{
135
- desc:"Document properties"
136
- },
137
- template:{
138
- desc:"Insert predefined template content"
139
- },
140
- visualchars:{
141
- desc:"Visual control characters on/off."
142
- },
143
- spellchecker:{
144
- desc:"Toggle spellchecker",
145
- menu:"Spellchecker settings",
146
- ignore_word:"Ignore word",
147
- ignore_words:"Ignore all",
148
- langs:"Languages",
149
- wait:"Please wait...",
150
- sug:"Suggestions",
151
- no_sug:"No suggestions",
152
- no_mpell:"No misspellings found."
153
- },
154
- pagebreak:{
155
- desc:"Insert page break."
156
- },
157
- advlist : {
158
- types : 'Types',
159
- def : 'Default',
160
- lower_alpha : "Lower alpha",
161
- lower_greek : "Lower greek",
162
- lower_roman : "Lower roman",
163
- upper_alpha : "Upper alpha",
164
- upper_roman : "Upper roman",
165
- circle : "Circle",
166
- disc : "Disc",
167
- square : "Square"
168
- }
169
- }});
1
+ tinyMCE.addI18n({en:{common:{"more_colors":"More Colors...","invalid_data":"Error: Invalid values entered, these are marked in red.","popup_blocked":"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.","clipboard_no_support":"Currently not supported by your browser, use keyboard shortcuts instead.","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","not_set":"-- Not Set --","class_name":"Class",browse:"Browse",close:"Close",cancel:"Cancel",update:"Update",insert:"Insert",apply:"Apply","edit_confirm":"Do you want to use the WYSIWYG mode for this textarea?","invalid_data_number":"{#field} must be a number","invalid_data_min":"{#field} must be a number greater than {#min}","invalid_data_size":"{#field} must be a number or percentage",value:"(value)"},contextmenu:{full:"Full",right:"Right",center:"Center",left:"Left",align:"Alignment"},insertdatetime:{"day_short":"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun","day_long":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday","months_short":"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec","months_long":"January,February,March,April,May,June,July,August,September,October,November,December","inserttime_desc":"Insert Time","insertdate_desc":"Insert Date","time_fmt":"%H:%M:%S","date_fmt":"%Y-%m-%d"},print:{"print_desc":"Print"},preview:{"preview_desc":"Preview"},directionality:{"rtl_desc":"Direction Right to Left","ltr_desc":"Direction Left to Right"},layer:{content:"New layer...","absolute_desc":"Toggle Absolute Positioning","backward_desc":"Move Backward","forward_desc":"Move Forward","insertlayer_desc":"Insert New Layer"},save:{"save_desc":"Save","cancel_desc":"Cancel All Changes"},nonbreaking:{"nonbreaking_desc":"Insert Non-Breaking Space Character"},iespell:{download:"ieSpell not detected. Do you want to install it now?","iespell_desc":"Check Spelling"},advhr:{"delta_height":"","delta_width":"","advhr_desc":"Insert Horizontal Line"},emotions:{"delta_height":"","delta_width":"","emotions_desc":"Emotions"},searchreplace:{"replace_desc":"Find/Replace","delta_width":"","delta_height":"","search_desc":"Find"},advimage:{"delta_width":"","image_desc":"Insert/Edit Image","delta_height":""},advlink:{"delta_height":"","delta_width":"","link_desc":"Insert/Edit Link"},xhtmlxtras:{"attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":"","attribs_desc":"Insert/Edit Attributes","ins_desc":"Insertion","del_desc":"Deletion","acronym_desc":"Acronym","abbr_desc":"Abbreviation","cite_desc":"Citation"},style:{"delta_height":"","delta_width":"",desc:"Edit CSS Style"},paste:{"plaintext_mode_stick":"Paste is now in plain text mode. Click again to toggle back to regular paste mode.","plaintext_mode":"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.","selectall_desc":"Select All","paste_word_desc":"Paste from Word","paste_text_desc":"Paste as Plain Text"},"paste_dlg":{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."},table:{"merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","cellprops_delta_width":"","rowprops_delta_height":"","rowprops_delta_width":"",cell:"Cell",col:"Column",row:"Row",del:"Delete Table","copy_row_desc":"Copy Table Row","cut_row_desc":"Cut Table Row","paste_row_after_desc":"Paste Table Row After","paste_row_before_desc":"Paste Table Row Before","props_desc":"Table Properties","cell_desc":"Table Cell Properties","row_desc":"Table Row Properties","merge_cells_desc":"Merge Table Cells","split_cells_desc":"Split Merged Table Cells","delete_col_desc":"Delete Column","col_after_desc":"Insert Column After","col_before_desc":"Insert Column Before","delete_row_desc":"Delete Row","row_after_desc":"Insert Row After","row_before_desc":"Insert Row Before",desc:"Insert/Edit Table"},autosave:{"warning_message":"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?","restore_content":"Restore auto-saved content.","unload_msg":"The changes you made will be lost if you navigate away from this page."},fullscreen:{desc:"Toggle Full Screen Mode"},media:{"delta_height":"","delta_width":"",edit:"Edit Embedded Media",desc:"Insert/Edit Embedded Media"},fullpage:{desc:"Document Properties","delta_width":"","delta_height":""},template:{desc:"Insert Predefined Template Content"},visualchars:{desc:"Show/Hide Visual Control Characters"},spellchecker:{desc:"Toggle Spell Checker",menu:"Spell Checker Settings","ignore_word":"Ignore Word","ignore_words":"Ignore All",langs:"Languages",wait:"Please wait...",sug:"Suggestions","no_sug":"No Suggestions","no_mpell":"No misspellings found.","learn_word":"Learn word"},pagebreak:{desc:"Insert Page Break for Printing"},advlist:{types:"Types",def:"Default","lower_alpha":"Lower Alpha","lower_greek":"Lower Greek","lower_roman":"Lower Roman","upper_alpha":"Upper Alpha","upper_roman":"Upper Roman",circle:"Circle",disc:"Disc",square:"Square"},colors:{"333300":"Dark olive","993300":"Burnt orange","000000":"Black","003300":"Dark green","003366":"Dark azure","000080":"Navy Blue","333399":"Indigo","333333":"Very dark gray","800000":"Maroon",FF6600:"Orange","808000":"Olive","008000":"Green","008080":"Teal","0000FF":"Blue","666699":"Grayish blue","808080":"Gray",FF0000:"Red",FF9900:"Amber","99CC00":"Yellow green","339966":"Sea green","33CCCC":"Turquoise","3366FF":"Royal blue","800080":"Purple","999999":"Medium gray",FF00FF:"Magenta",FFCC00:"Gold",FFFF00:"Yellow","00FF00":"Lime","00FFFF":"Aqua","00CCFF":"Sky blue","993366":"Brown",C0C0C0:"Silver",FF99CC:"Pink",FFCC99:"Peach",FFFF99:"Light yellow",CCFFCC:"Pale green",CCFFFF:"Pale cyan","99CCFF":"Light sky blue",CC99FF:"Plum",FFFFFF:"White"},aria:{"rich_text_area":"Rich Text Area"},wordcount:{words:"Words:"}}});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
tiny_mce/plugins/fullscreen/editor_plugin.js CHANGED
@@ -1 +1 @@
1
- (function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(c,d){var e=this,f={},b;e.editor=c;c.addCommand("mceFullScreen",function(){var h,i=a.doc.documentElement;if(c.getParam("fullscreen_is_enabled")){if(c.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",e.resizeFunc);tinyMCE.get(c.getParam("fullscreen_editor_id")).setContent(c.getContent({format:"raw"}),{format:"raw"});tinyMCE.remove(c);a.remove("mce_fullscreen_container");i.style.overflow=c.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",c.getParam("fullscreen_overflow"));a.win.scrollTo(c.getParam("fullscreen_scrollx"),c.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(c.getParam("fullscreen_new_window")){h=a.win.open(d+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{h.resizeTo(screen.availWidth,screen.availHeight)}catch(g){}}else{tinyMCE.oldSettings=tinyMCE.settings;f.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";f.fullscreen_html_overflow=a.getStyle(i,"overflow",1);b=a.getViewPort();f.fullscreen_scrollx=b.x;f.fullscreen_scrolly=b.y;if(tinymce.isOpera&&f.fullscreen_overflow=="visible"){f.fullscreen_overflow="auto"}if(tinymce.isIE&&f.fullscreen_overflow=="scroll"){f.fullscreen_overflow="auto"}if(tinymce.isIE&&(f.fullscreen_html_overflow=="visible"||f.fullscreen_html_overflow=="scroll")){f.fullscreen_html_overflow="auto"}if(f.fullscreen_overflow=="0px"){f.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");i.style.overflow="hidden";b=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){b.h-=1}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+(tinymce.isIE6||(tinymce.isIE&&!a.boxModel)?"absolute":"fixed")+";top:0;left:0;width:"+b.w+"px;height:"+b.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(c.settings,function(j,k){f[k]=j});f.id="mce_fullscreen";f.width=n.clientWidth;f.height=n.clientHeight-15;f.fullscreen_is_enabled=true;f.fullscreen_editor_id=c.id;f.theme_advanced_resizing=false;f.save_onsavecallback=function(){c.setContent(tinyMCE.get(f.id).getContent({format:"raw"}),{format:"raw"});c.execCommand("mceSave")};tinymce.each(c.getParam("fullscreen_settings"),function(l,j){f[j]=l});if(f.theme_advanced_toolbar_location==="external"){f.theme_advanced_toolbar_location="top"}e.fullscreenEditor=new tinymce.Editor("mce_fullscreen",f);e.fullscreenEditor.onInit.add(function(){e.fullscreenEditor.setContent(c.getContent());e.fullscreenEditor.focus()});e.fullscreenEditor.render();tinyMCE.add(e.fullscreenEditor);e.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");e.fullscreenElement.update();e.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var j=tinymce.DOM.getViewPort();e.fullscreenEditor.theme.resizeTo(j.w,j.h)})}});c.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});c.onNodeChange.add(function(h,g){g.setActive("fullscreen",h.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();
1
+ (function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent());tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent());d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().firstChild);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();
tiny_mce/plugins/fullscreen/editor_plugin_src.js CHANGED
@@ -13,7 +13,7 @@
13
 
14
  tinymce.create('tinymce.plugins.FullScreenPlugin', {
15
  init : function(ed, url) {
16
- var t = this, s = {}, vp;
17
 
18
  t.editor = ed;
19
 
@@ -27,7 +27,7 @@
27
  else {
28
  DOM.win.setTimeout(function() {
29
  tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);
30
- tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format : 'raw'}), {format : 'raw'});
31
  tinyMCE.remove(ed);
32
  DOM.remove('mce_fullscreen_container');
33
  de.style.overflow = ed.getParam('fullscreen_html_overflow');
@@ -78,7 +78,15 @@
78
  if (tinymce.isIE)
79
  vp.h -= 1;
80
 
81
- n = DOM.add(DOM.doc.body, 'div', {id : 'mce_fullscreen_container', style : 'position:' + (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel) ? 'absolute' : 'fixed') + ';top:0;left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'});
 
 
 
 
 
 
 
 
82
  DOM.add(n, 'div', {id : 'mce_fullscreen'});
83
 
84
  tinymce.each(ed.settings, function(v, n) {
@@ -92,7 +100,7 @@
92
  s.fullscreen_editor_id = ed.id;
93
  s.theme_advanced_resizing = false;
94
  s.save_onsavecallback = function() {
95
- ed.setContent(tinyMCE.get(s.id).getContent({format : 'raw'}), {format : 'raw'});
96
  ed.execCommand('mceSave');
97
  };
98
 
@@ -110,16 +118,19 @@
110
  });
111
 
112
  t.fullscreenEditor.render();
113
- tinyMCE.add(t.fullscreenEditor);
114
 
115
  t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container');
116
  t.fullscreenElement.update();
117
  //document.body.overflow = 'hidden';
118
 
119
  t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() {
120
- var vp = tinymce.DOM.getViewPort();
 
 
 
 
121
 
122
- t.fullscreenEditor.theme.resizeTo(vp.w, vp.h);
123
  });
124
  }
125
  });
13
 
14
  tinymce.create('tinymce.plugins.FullScreenPlugin', {
15
  init : function(ed, url) {
16
+ var t = this, s = {}, vp, posCss;
17
 
18
  t.editor = ed;
19
 
27
  else {
28
  DOM.win.setTimeout(function() {
29
  tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);
30
+ tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent());
31
  tinyMCE.remove(ed);
32
  DOM.remove('mce_fullscreen_container');
33
  de.style.overflow = ed.getParam('fullscreen_html_overflow');
78
  if (tinymce.isIE)
79
  vp.h -= 1;
80
 
81
+ // Use fixed position if it exists
82
+ if (tinymce.isIE6)
83
+ posCss = 'absolute;top:' + vp.y;
84
+ else
85
+ posCss = 'fixed;top:0';
86
+
87
+ n = DOM.add(DOM.doc.body, 'div', {
88
+ id : 'mce_fullscreen_container',
89
+ style : 'position:' + posCss + ';left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'});
90
  DOM.add(n, 'div', {id : 'mce_fullscreen'});
91
 
92
  tinymce.each(ed.settings, function(v, n) {
100
  s.fullscreen_editor_id = ed.id;
101
  s.theme_advanced_resizing = false;
102
  s.save_onsavecallback = function() {
103
+ ed.setContent(tinyMCE.get(s.id).getContent());
104
  ed.execCommand('mceSave');
105
  };
106
 
118
  });
119
 
120
  t.fullscreenEditor.render();
 
121
 
122
  t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container');
123
  t.fullscreenElement.update();
124
  //document.body.overflow = 'hidden';
125
 
126
  t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() {
127
+ var vp = tinymce.DOM.getViewPort(), fed = t.fullscreenEditor, outerSize, innerSize;
128
+
129
+ // Get outer/inner size to get a delta size that can be used to calc the new iframe size
130
+ outerSize = fed.dom.getSize(fed.getContainer().firstChild);
131
+ innerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]);
132
 
133
+ fed.theme.resizeTo(vp.w - outerSize.w + innerSize.w, vp.h - outerSize.h + innerSize.h);
134
  });
135
  }
136
  });
tiny_mce/plugins/fullscreen/fullscreen.htm CHANGED
@@ -1,7 +1,8 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
  <html xmlns="http://www.w3.org/1999/xhtml">
3
  <head>
4
  <title></title>
 
5
  <script type="text/javascript" src="../../tiny_mce.js"></script>
6
  <script type="text/javascript">
7
  function patchCallback(settings, key) {
1
+ <!DOCTYPE html>
2
  <html xmlns="http://www.w3.org/1999/xhtml">
3
  <head>
4
  <title></title>
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
  <script type="text/javascript" src="../../tiny_mce.js"></script>
7
  <script type="text/javascript">
8
  function patchCallback(settings, key) {
tiny_mce/plugins/paste/editor_plugin.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_enable_default_filters:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_text_use_dialog:false,paste_text_sticky:false,paste_text_sticky_default:false,paste_text_notifyalways:false,paste_text_linebreaktype:"combined",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){return false}});d.pasteAsPlainText=b(d,"paste_text_sticky_default");function h(l,j){var k=d.dom,i;f.onPreProcess.dispatch(f,l);l.node=k.create("div",0,l.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){if(l.node.childNodes.length===1&&/^(p|h[1-6]|pre)$/i.test(l.node.firstChild.nodeName)&&l.content.indexOf("__MCE_ITEM__")===-1){k.remove(l.node.firstChild,true)}}}f.onPostProcess.dispatch(f,l);l.content=d.serializer.serialize(l.node,{getInner:1,forced_root_block:""});if((!j)&&(d.pasteAsPlainText)){f._insertPlainText(l.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(l.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,t,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:o.encode(r).replace(/\r?\n/g,"<br />")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort(d.getWin()).y}o.setStyles(l,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="<p>"+o.encode(r).replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br />")+"</p>"}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9){d([[/(?:<br>&nbsp;[\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br>&nbsp;[\s\r\n]+|<br>)*/g,"$1"]]);d([[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*(&nbsp;)+/gi,/(&nbsp;|<br[^>]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>")}if(b(k,"paste_convert_middot_lists")){d([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/&quot;/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/<h[1-6][^>]*>/gi,"<p><strong>"],[/<\/h[1-6][^>]*>/gi,"</strong></p>"]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l<d.length;l++){o=d[l];j=h.getStyle(m,o);if(j){n[o]=j;k++}}}h.setAttrib(m,"style","");if(d&&k>0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/&nbsp;/g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f<d){n=tinymce.inArray(m,f);o=i.getParents(h.parentNode,s);h=o[o.length-1-n]||h}}}c(i.select("span",t),function(v){var p=v.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.(&nbsp;|\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*(&nbsp;|\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.(&nbsp;|\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(g){var d=this.editor,e=b(d,"paste_text_linebreaktype"),i=b(d,"paste_text_replacements"),f=tinymce.is;function h(j){c(j,function(k){if(k.constructor==RegExp){g=g.replace(k,"")}else{g=g.replace(k[0],k[1])}})}if((typeof(g)==="string")&&(g.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(g)){h([/[\n\r]+/g])}else{h([/\r+/g])}h([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/<br[^>]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*<t[dh][^>]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/&nbsp;/gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"],[/\n{3,}/g,"\n\n"]]);g=d.dom.decode(tinymce.html.Entities.encodeRaw(g));if(f(i,"array")){h(i)}else{if(f(i,"string")){h(new RegExp(i,"gi"))}}if(e=="none"){h([[/\n+/g," "]])}else{if(e=="br"){h([[/\n/g,"<br />"]])}else{if(e=="p"){h([[/\n+/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"]])}else{h([[/\n\n/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"],[/\n/g,"<br />"]])}}}d.execCommand("mceInsertContent",false,g)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})();
tiny_mce/plugins/paste/editor_plugin_src.js ADDED
@@ -0,0 +1,871 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * editor_plugin_src.js
3
+ *
4
+ * Copyright 2009, Moxiecode Systems AB
5
+ * Released under LGPL License.
6
+ *
7
+ * License: http://tinymce.moxiecode.com/license
8
+ * Contributing: http://tinymce.moxiecode.com/contributing
9
+ */
10
+
11
+ (function() {
12
+ var each = tinymce.each,
13
+ defs = {
14
+ paste_auto_cleanup_on_paste : true,
15
+ paste_enable_default_filters : true,
16
+ paste_block_drop : false,
17
+ paste_retain_style_properties : "none",
18
+ paste_strip_class_attributes : "mso",
19
+ paste_remove_spans : false,
20
+ paste_remove_styles : false,
21
+ paste_remove_styles_if_webkit : true,
22
+ paste_convert_middot_lists : true,
23
+ paste_convert_headers_to_strong : false,
24
+ paste_dialog_width : "450",
25
+ paste_dialog_height : "400",
26
+ paste_text_use_dialog : false,
27
+ paste_text_sticky : false,
28
+ paste_text_sticky_default : false,
29
+ paste_text_notifyalways : false,
30
+ paste_text_linebreaktype : "combined",
31
+ paste_text_replacements : [
32
+ [/\u2026/g, "..."],
33
+ [/[\x93\x94\u201c\u201d]/g, '"'],
34
+ [/[\x60\x91\x92\u2018\u2019]/g, "'"]
35
+ ]
36
+ };
37
+
38
+ function getParam(ed, name) {
39
+ return ed.getParam(name, defs[name]);
40
+ }
41
+
42
+ tinymce.create('tinymce.plugins.PastePlugin', {
43
+ init : function(ed, url) {
44
+ var t = this;
45
+
46
+ t.editor = ed;
47
+ t.url = url;
48
+
49
+ // Setup plugin events
50
+ t.onPreProcess = new tinymce.util.Dispatcher(t);
51
+ t.onPostProcess = new tinymce.util.Dispatcher(t);
52
+
53
+ // Register default handlers
54
+ t.onPreProcess.add(t._preProcess);
55
+ t.onPostProcess.add(t._postProcess);
56
+
57
+ // Register optional preprocess handler
58
+ t.onPreProcess.add(function(pl, o) {
59
+ ed.execCallback('paste_preprocess', pl, o);
60
+ });
61
+
62
+ // Register optional postprocess
63
+ t.onPostProcess.add(function(pl, o) {
64
+ ed.execCallback('paste_postprocess', pl, o);
65
+ });
66
+
67
+ ed.onKeyDown.addToTop(function(ed, e) {
68
+ // Block ctrl+v from adding an undo level since the default logic in tinymce.Editor will add that
69
+ if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))
70
+ return false; // Stop other listeners
71
+ });
72
+
73
+ // Initialize plain text flag
74
+ ed.pasteAsPlainText = getParam(ed, 'paste_text_sticky_default');
75
+
76
+ // This function executes the process handlers and inserts the contents
77
+ // force_rich overrides plain text mode set by user, important for pasting with execCommand
78
+ function process(o, force_rich) {
79
+ var dom = ed.dom, rng;
80
+
81
+ // Execute pre process handlers
82
+ t.onPreProcess.dispatch(t, o);
83
+
84
+ // Create DOM structure
85
+ o.node = dom.create('div', 0, o.content);
86
+
87
+ // If pasting inside the same element and the contents is only one block
88
+ // remove the block and keep the text since Firefox will copy parts of pre and h1-h6 as a pre element
89
+ if (tinymce.isGecko) {
90
+ rng = ed.selection.getRng(true);
91
+ if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) {
92
+ // Is only one block node and it doesn't contain word stuff
93
+ if (o.node.childNodes.length === 1 && /^(p|h[1-6]|pre)$/i.test(o.node.firstChild.nodeName) && o.content.indexOf('__MCE_ITEM__') === -1)
94
+ dom.remove(o.node.firstChild, true);
95
+ }
96
+ }
97
+
98
+ // Execute post process handlers
99
+ t.onPostProcess.dispatch(t, o);
100
+
101
+ // Serialize content
102
+ o.content = ed.serializer.serialize(o.node, {getInner : 1, forced_root_block : ''});
103
+
104
+ // Plain text option active?
105
+ if ((!force_rich) && (ed.pasteAsPlainText)) {
106
+ t._insertPlainText(o.content);
107
+
108
+ if (!getParam(ed, "paste_text_sticky")) {
109
+ ed.pasteAsPlainText = false;
110
+ ed.controlManager.setActive("pastetext", false);
111
+ }
112
+ } else {
113
+ t._insert(o.content);
114
+ }
115
+ }
116
+
117
+ // Add command for external usage
118
+ ed.addCommand('mceInsertClipboardContent', function(u, o) {
119
+ process(o, true);
120
+ });
121
+
122
+ if (!getParam(ed, "paste_text_use_dialog")) {
123
+ ed.addCommand('mcePasteText', function(u, v) {
124
+ var cookie = tinymce.util.Cookie;
125
+
126
+ ed.pasteAsPlainText = !ed.pasteAsPlainText;
127
+ ed.controlManager.setActive('pastetext', ed.pasteAsPlainText);
128
+
129
+ if ((ed.pasteAsPlainText) && (!cookie.get("tinymcePasteText"))) {
130
+ if (getParam(ed, "paste_text_sticky")) {
131
+ ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky'));
132
+ } else {
133
+ ed.windowManager.alert(ed.translate('paste.plaintext_mode'));
134
+ }
135
+
136
+ if (!getParam(ed, "paste_text_notifyalways")) {
137
+ cookie.set("tinymcePasteText", "1", new Date(new Date().getFullYear() + 1, 12, 31))
138
+ }
139
+ }
140
+ });
141
+ }
142
+
143
+ ed.addButton('pastetext', {title: 'paste.paste_text_desc', cmd: 'mcePasteText'});
144
+ ed.addButton('selectall', {title: 'paste.selectall_desc', cmd: 'selectall'});
145
+
146
+ // This function grabs the contents from the clipboard by adding a
147
+ // hidden div and placing the caret inside it and after the browser paste
148
+ // is done it grabs that contents and processes that
149
+ function grabContent(e) {
150
+ var n, or, rng, oldRng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent;
151
+
152
+ // Check if browser supports direct plaintext access
153
+ if (e.clipboardData || dom.doc.dataTransfer) {
154
+ textContent = (e.clipboardData || dom.doc.dataTransfer).getData('Text');
155
+
156
+ if (ed.pasteAsPlainText) {
157
+ e.preventDefault();
158
+ process({content : dom.encode(textContent).replace(/\r?\n/g, '<br />')});
159
+ return;
160
+ }
161
+ }
162
+
163
+ if (dom.get('_mcePaste'))
164
+ return;
165
+
166
+ // Create container to paste into
167
+ n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste', 'data-mce-bogus' : '1'}, '\uFEFF\uFEFF');
168
+
169
+ // If contentEditable mode we need to find out the position of the closest element
170
+ if (body != ed.getDoc().body)
171
+ posY = dom.getPos(ed.selection.getStart(), body).y;
172
+ else
173
+ posY = body.scrollTop + dom.getViewPort(ed.getWin()).y;
174
+
175
+ // Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles
176
+ // If also needs to be in view on IE or the paste would fail
177
+ dom.setStyles(n, {
178
+ position : 'absolute',
179
+ left : tinymce.isGecko ? -40 : 0, // Need to move it out of site on Gecko since it will othewise display a ghost resize rect for the div
180
+ top : posY - 25,
181
+ width : 1,
182
+ height : 1,
183
+ overflow : 'hidden'
184
+ });
185
+
186
+ if (tinymce.isIE) {
187
+ // Store away the old range
188
+ oldRng = sel.getRng();
189
+
190
+ // Select the container
191
+ rng = dom.doc.body.createTextRange();
192
+ rng.moveToElementText(n);
193
+ rng.execCommand('Paste');
194
+
195
+ // Remove container
196
+ dom.remove(n);
197
+
198
+ // Check if the contents was changed, if it wasn't then clipboard extraction failed probably due
199
+ // to IE security settings so we pass the junk though better than nothing right
200
+ if (n.innerHTML === '\uFEFF\uFEFF') {
201
+ ed.execCommand('mcePasteWord');
202
+ e.preventDefault();
203
+ return;
204
+ }
205
+
206
+ // Restore the old range and clear the contents before pasting
207
+ sel.setRng(oldRng);
208
+ sel.setContent('');
209
+
210
+ // For some odd reason we need to detach the the mceInsertContent call from the paste event
211
+ // It's like IE has a reference to the parent element that you paste in and the selection gets messed up
212
+ // when it tries to restore the selection
213
+ setTimeout(function() {
214
+ // Process contents
215
+ process({content : n.innerHTML});
216
+ }, 0);
217
+
218
+ // Block the real paste event
219
+ return tinymce.dom.Event.cancel(e);
220
+ } else {
221
+ function block(e) {
222
+ e.preventDefault();
223
+ };
224
+
225
+ // Block mousedown and click to prevent selection change
226
+ dom.bind(ed.getDoc(), 'mousedown', block);
227
+ dom.bind(ed.getDoc(), 'keydown', block);
228
+
229
+ or = ed.selection.getRng();
230
+
231
+ // Move select contents inside DIV
232
+ n = n.firstChild;
233
+ rng = ed.getDoc().createRange();
234
+ rng.setStart(n, 0);
235
+ rng.setEnd(n, 2);
236
+ sel.setRng(rng);
237
+
238
+ // Wait a while and grab the pasted contents
239
+ window.setTimeout(function() {
240
+ var h = '', nl;
241
+
242
+ // Paste divs duplicated in paste divs seems to happen when you paste plain text so lets first look for that broken behavior in WebKit
243
+ if (!dom.select('div.mcePaste > div.mcePaste').length) {
244
+ nl = dom.select('div.mcePaste');
245
+
246
+ // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string
247
+ each(nl, function(n) {
248
+ var child = n.firstChild;
249
+
250
+ // WebKit inserts a DIV container with lots of odd styles
251
+ if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) {
252
+ dom.remove(child, 1);
253
+ }
254
+
255
+ // Remove apply style spans
256
+ each(dom.select('span.Apple-style-span', n), function(n) {
257
+ dom.remove(n, 1);
258
+ });
259
+
260
+ // Remove bogus br elements
261
+ each(dom.select('br[data-mce-bogus]', n), function(n) {
262
+ dom.remove(n);
263
+ });
264
+
265
+ // WebKit will make a copy of the DIV for each line of plain text pasted and insert them into the DIV
266
+ if (n.parentNode.className != 'mcePaste')
267
+ h += n.innerHTML;
268
+ });
269
+ } else {
270
+ // Found WebKit weirdness so force the content into paragraphs this seems to happen when you paste plain text from Nodepad etc
271
+ // So this logic will replace double enter with paragraphs and single enter with br so it kind of looks the same
272
+ h = '<p>' + dom.encode(textContent).replace(/\r?\n\r?\n/g, '</p><p>').replace(/\r?\n/g, '<br />') + '</p>';
273
+ }
274
+
275
+ // Remove the nodes
276
+ each(dom.select('div.mcePaste'), function(n) {
277
+ dom.remove(n);
278
+ });
279
+
280
+ // Restore the old selection
281
+ if (or)
282
+ sel.setRng(or);
283
+
284
+ process({content : h});
285
+
286
+ // Unblock events ones we got the contents
287
+ dom.unbind(ed.getDoc(), 'mousedown', block);
288
+ dom.unbind(ed.getDoc(), 'keydown', block);
289
+ }, 0);
290
+ }
291
+ }
292
+
293
+ // Check if we should use the new auto process method
294
+ if (getParam(ed, "paste_auto_cleanup_on_paste")) {
295
+ // Is it's Opera or older FF use key handler
296
+ if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) {
297
+ ed.onKeyDown.addToTop(function(ed, e) {
298
+ if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))
299
+ grabContent(e);
300
+ });
301
+ } else {
302
+ // Grab contents on paste event on Gecko and WebKit
303
+ ed.onPaste.addToTop(function(ed, e) {
304
+ return grabContent(e);
305
+ });
306
+ }
307
+ }
308
+
309
+ ed.onInit.add(function() {
310
+ ed.controlManager.setActive("pastetext", ed.pasteAsPlainText);
311
+
312
+ // Block all drag/drop events
313
+ if (getParam(ed, "paste_block_drop")) {
314
+ ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) {
315
+ e.preventDefault();
316
+ e.stopPropagation();
317
+
318
+ return false;
319
+ });
320
+ }
321
+ });
322
+
323
+ // Add legacy support
324
+ t._legacySupport();
325
+ },
326
+
327
+ getInfo : function() {
328
+ return {
329
+ longname : 'Paste text/word',
330
+ author : 'Moxiecode Systems AB',
331
+ authorurl : 'http://tinymce.moxiecode.com',
332
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',
333
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
334
+ };
335
+ },
336
+
337
+ _preProcess : function(pl, o) {
338
+ var ed = this.editor,
339
+ h = o.content,
340
+ grep = tinymce.grep,
341
+ explode = tinymce.explode,
342
+ trim = tinymce.trim,
343
+ len, stripClass;
344
+
345
+ //console.log('Before preprocess:' + o.content);
346
+
347
+ function process(items) {
348
+ each(items, function(v) {
349
+ // Remove or replace
350
+ if (v.constructor == RegExp)
351
+ h = h.replace(v, '');
352
+ else
353
+ h = h.replace(v[0], v[1]);
354
+ });
355
+ }
356
+
357
+ if (ed.settings.paste_enable_default_filters == false) {
358
+ return;
359
+ }
360
+
361
+ // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser
362
+ if (tinymce.isIE && document.documentMode >= 9) {
363
+ // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser
364
+ process([[/(?:<br>&nbsp;[\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br>&nbsp;[\s\r\n]+|<br>)*/g, '$1']]);
365
+
366
+ // IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break
367
+ process([
368
+ [/<br><br>/g, '<BR><BR>'], // Replace multiple BR elements with uppercase BR to keep them intact
369
+ [/<br>/g, ' '], // Replace single br elements with space since they are word wrap BR:s
370
+ [/<BR><BR>/g, '<br>'] // Replace back the double brs but into a single BR
371
+ ]);
372
+ }
373
+
374
+ // Detect Word content and process it more aggressive
375
+ if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) {
376
+ o.wordContent = true; // Mark the pasted contents as word specific content
377
+ //console.log('Word contents detected.');
378
+
379
+ // Process away some basic content
380
+ process([
381
+ /^\s*(&nbsp;)+/gi, // &nbsp; entities at the start of contents
382
+ /(&nbsp;|<br[^>]*>)+\s*$/gi // &nbsp; entities at the end of contents
383
+ ]);
384
+
385
+ if (getParam(ed, "paste_convert_headers_to_strong")) {
386
+ h = h.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "<p><strong>$1</strong></p>");
387
+ }
388
+
389
+ if (getParam(ed, "paste_convert_middot_lists")) {
390
+ process([
391
+ [/<!--\[if !supportLists\]-->/gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker
392
+ [/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers
393
+ [/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF)
394
+ ]);
395
+ }
396
+
397
+ process([
398
+ // Word comments like conditional comments etc
399
+ /<!--[\s\S]+?-->/gi,
400
+
401
+ // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags
402
+ /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,
403
+
404
+ // Convert <s> into <strike> for line-though
405
+ [/<(\/?)s>/gi, "<$1strike>"],
406
+
407
+ // Replace nsbp entites to char since it's easier to handle
408
+ [/&nbsp;/gi, "\u00a0"]
409
+ ]);
410
+
411
+ // Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag.
412
+ // If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot.
413
+ do {
414
+ len = h.length;
415
+ h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1");
416
+ } while (len != h.length);
417
+
418
+ // Remove all spans if no styles is to be retained
419
+ if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) {
420
+ h = h.replace(/<\/?span[^>]*>/gi, "");
421
+ } else {
422
+ // We're keeping styles, so at least clean them up.
423
+ // CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx
424
+
425
+ process([
426
+ // Convert <span style="mso-spacerun:yes">___</span> to string of alternating breaking/non-breaking spaces of same length
427
+ [/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
428
+ function(str, spaces) {
429
+ return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : "";
430
+ }
431
+ ],
432
+
433
+ // Examine all styles: delete junk, transform some, and keep the rest
434
+ [/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,
435
+ function(str, tag, style) {
436
+ var n = [],
437
+ i = 0,
438
+ s = explode(trim(style).replace(/&quot;/gi, "'"), ";");
439
+
440
+ // Examine each style definition within the tag's style attribute
441
+ each(s, function(v) {
442
+ var name, value,
443
+ parts = explode(v, ":");
444
+
445
+ function ensureUnits(v) {
446
+ return v + ((v !== "0") && (/\d$/.test(v)))? "px" : "";
447
+ }
448
+
449
+ if (parts.length == 2) {
450
+ name = parts[0].toLowerCase();
451
+ value = parts[1].toLowerCase();
452
+
453
+ // Translate certain MS Office styles into their CSS equivalents
454
+ switch (name) {
455
+ case "mso-padding-alt":
456
+ case "mso-padding-top-alt":
457
+ case "mso-padding-right-alt":
458
+ case "mso-padding-bottom-alt":
459
+ case "mso-padding-left-alt":
460
+ case "mso-margin-alt":
461
+ case "mso-margin-top-alt":
462
+ case "mso-margin-right-alt":
463
+ case "mso-margin-bottom-alt":
464
+ case "mso-margin-left-alt":
465
+ case "mso-table-layout-alt":
466
+ case "mso-height":
467
+ case "mso-width":
468
+ case "mso-vertical-align-alt":
469
+ n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value);
470
+ return;
471
+
472
+ case "horiz-align":
473
+ n[i++] = "text-align:" + value;
474
+ return;
475
+
476
+ case "vert-align":
477
+ n[i++] = "vertical-align:" + value;
478
+ return;
479
+
480
+ case "font-color":
481
+ case "mso-foreground":
482
+ n[i++] = "color:" + value;
483
+ return;
484
+
485
+ case "mso-background":
486
+ case "mso-highlight":
487
+ n[i++] = "background:" + value;
488
+ return;
489
+
490
+ case "mso-default-height":
491
+ n[i++] = "min-height:" + ensureUnits(value);
492
+ return;
493
+
494
+ case "mso-default-width":
495
+ n[i++] = "min-width:" + ensureUnits(value);
496
+ return;
497
+
498
+ case "mso-padding-between-alt":
499
+ n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value);
500
+ return;
501
+
502
+ case "text-line-through":
503
+ if ((value == "single") || (value == "double")) {
504
+ n[i++] = "text-decoration:line-through";
505
+ }
506
+ return;
507
+
508
+ case "mso-zero-height":
509
+ if (value == "yes") {
510
+ n[i++] = "display:none";
511
+ }
512
+ return;
513
+ }
514
+
515
+ // Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name
516
+ if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)) {
517
+ return;
518
+ }
519
+
520
+ // If it reached this point, it must be a valid CSS style
521
+ n[i++] = name + ":" + parts[1]; // Lower-case name, but keep value case
522
+ }
523
+ });
524
+
525
+ // If style attribute contained any valid styles the re-write it; otherwise delete style attribute.
526
+ if (i > 0) {
527
+ return tag + ' style="' + n.join(';') + '"';
528
+ } else {
529
+ return tag;
530
+ }
531
+ }
532
+ ]
533
+ ]);
534
+ }
535
+ }
536
+
537
+ // Replace headers with <strong>
538
+ if (getParam(ed, "paste_convert_headers_to_strong")) {
539
+ process([
540
+ [/<h[1-6][^>]*>/gi, "<p><strong>"],
541
+ [/<\/h[1-6][^>]*>/gi, "</strong></p>"]
542
+ ]);
543
+ }
544
+
545
+ process([
546
+ // Copy paste from Java like Open Office will produce this junk on FF
547
+ [/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, '']
548
+ ]);
549
+
550
+ // Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso").
551
+ // Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation.
552
+ stripClass = getParam(ed, "paste_strip_class_attributes");
553
+
554
+ if (stripClass !== "none") {
555
+ function removeClasses(match, g1) {
556
+ if (stripClass === "all")
557
+ return '';
558
+
559
+ var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "),
560
+ function(v) {
561
+ return (/^(?!mso)/i.test(v));
562
+ }
563
+ );
564
+
565
+ return cls.length ? ' class="' + cls.join(" ") + '"' : '';
566
+ };
567
+
568
+ h = h.replace(/ class="([^"]+)"/gi, removeClasses);
569
+ h = h.replace(/ class=([\-\w]+)/gi, removeClasses);
570
+ }
571
+
572
+ // Remove spans option
573
+ if (getParam(ed, "paste_remove_spans")) {
574
+ h = h.replace(/<\/?span[^>]*>/gi, "");
575
+ }
576
+
577
+ //console.log('After preprocess:' + h);
578
+
579
+ o.content = h;
580
+ },
581
+
582
+ /**
583
+ * Various post process items.
584
+ */
585
+ _postProcess : function(pl, o) {
586
+ var t = this, ed = t.editor, dom = ed.dom, styleProps;
587
+
588
+ if (ed.settings.paste_enable_default_filters == false) {
589
+ return;
590
+ }
591
+
592
+ if (o.wordContent) {
593
+ // Remove named anchors or TOC links
594
+ each(dom.select('a', o.node), function(a) {
595
+ if (!a.href || a.href.indexOf('#_Toc') != -1)
596
+ dom.remove(a, 1);
597
+ });
598
+
599
+ if (getParam(ed, "paste_convert_middot_lists")) {
600
+ t._convertLists(pl, o);
601
+ }
602
+
603
+ // Process styles
604
+ styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties
605
+
606
+ // Process only if a string was specified and not equal to "all" or "*"
607
+ if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) {
608
+ styleProps = tinymce.explode(styleProps.replace(/^none$/i, ""));
609
+
610
+ // Retains some style properties
611
+ each(dom.select('*', o.node), function(el) {
612
+ var newStyle = {}, npc = 0, i, sp, sv;
613
+
614
+ // Store a subset of the existing styles
615
+ if (styleProps) {
616
+ for (i = 0; i < styleProps.length; i++) {
617
+ sp = styleProps[i];
618
+ sv = dom.getStyle(el, sp);
619
+
620
+ if (sv) {
621
+ newStyle[sp] = sv;
622
+ npc++;
623
+ }
624
+ }
625
+ }
626
+
627
+ // Remove all of the existing styles
628
+ dom.setAttrib(el, 'style', '');
629
+
630
+ if (styleProps && npc > 0)
631
+ dom.setStyles(el, newStyle); // Add back the stored subset of styles
632
+ else // Remove empty span tags that do not have class attributes
633
+ if (el.nodeName == 'SPAN' && !el.className)
634
+ dom.remove(el, true);
635
+ });
636
+ }
637
+ }
638
+
639
+ // Remove all style information or only specifically on WebKit to avoid the style bug on that browser
640
+ if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) {
641
+ each(dom.select('*[style]', o.node), function(el) {
642
+ el.removeAttribute('style');
643
+ el.removeAttribute('data-mce-style');
644
+ });
645
+ } else {
646
+ if (tinymce.isWebKit) {
647
+ // We need to compress the styles on WebKit since if you paste <img border="0" /> it will become <img border="0" style="... lots of junk ..." />
648
+ // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles
649
+ each(dom.select('*', o.node), function(el) {
650
+ el.removeAttribute('data-mce-style');
651
+ });
652
+ }
653
+ }
654
+ },
655
+
656
+ /**
657
+ * Converts the most common bullet and number formats in Office into a real semantic UL/LI list.
658
+ */
659
+ _convertLists : function(pl, o) {
660
+ var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html;
661
+
662
+ // Convert middot lists into real semantic lists
663
+ each(dom.select('p', o.node), function(p) {
664
+ var sib, val = '', type, html, idx, parents;
665
+
666
+ // Get text node value at beginning of paragraph
667
+ for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling)
668
+ val += sib.nodeValue;
669
+
670
+ val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/&nbsp;/g, '\u00a0');
671
+
672
+ // Detect unordered lists look for bullets
673
+ if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(val))
674
+ type = 'ul';
675
+
676
+ // Detect ordered lists 1., a. or ixv.
677
+ if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val))
678
+ type = 'ol';
679
+
680
+ // Check if node value matches the list pattern: o&nbsp;&nbsp;
681
+ if (type) {
682
+ margin = parseFloat(p.style.marginLeft || 0);
683
+
684
+ if (margin > lastMargin)
685
+ levels.push(margin);
686
+
687
+ if (!listElm || type != lastType) {
688
+ listElm = dom.create(type);
689
+ dom.insertAfter(listElm, p);
690
+ } else {
691
+ // Nested list element
692
+ if (margin > lastMargin) {
693
+ listElm = li.appendChild(dom.create(type));
694
+ } else if (margin < lastMargin) {
695
+ // Find parent level based on margin value
696
+ idx = tinymce.inArray(levels, margin);
697
+ parents = dom.getParents(listElm.parentNode, type);
698
+ listElm = parents[parents.length - 1 - idx] || listElm;
699
+ }
700
+ }
701
+
702
+ // Remove middot or number spans if they exists
703
+ each(dom.select('span', p), function(span) {
704
+ var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, '');
705
+
706
+ // Remove span with the middot or the number
707
+ if (type == 'ul' && /^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(html))
708
+ dom.remove(span);
709
+ else if (/^__MCE_ITEM__[\s\S]*\w+\.(&nbsp;|\u00a0)*\s*/.test(html))
710
+ dom.remove(span);
711
+ });
712
+
713
+ html = p.innerHTML;
714
+
715
+ // Remove middot/list items
716
+ if (type == 'ul')
717
+ html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*(&nbsp;|\u00a0)+\s*/, '');
718
+ else
719
+ html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.(&nbsp;|\u00a0)+\s*/, '');
720
+
721
+ // Create li and add paragraph data into the new li
722
+ li = listElm.appendChild(dom.create('li', 0, html));
723
+ dom.remove(p);
724
+
725
+ lastMargin = margin;
726
+ lastType = type;
727
+ } else
728
+ listElm = lastMargin = 0; // End list element
729
+ });
730
+
731
+ // Remove any left over makers
732
+ html = o.node.innerHTML;
733
+ if (html.indexOf('__MCE_ITEM__') != -1)
734
+ o.node.innerHTML = html.replace(/__MCE_ITEM__/g, '');
735
+ },
736
+
737
+ /**
738
+ * Inserts the specified contents at the caret position.
739
+ */
740
+ _insert : function(h, skip_undo) {
741
+ var ed = this.editor, r = ed.selection.getRng();
742
+
743
+ // First delete the contents seems to work better on WebKit when the selection spans multiple list items or multiple table cells.
744
+ if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer)
745
+ ed.getDoc().execCommand('Delete', false, null);
746
+
747
+ ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo});
748
+ },
749
+
750
+ /**
751
+ * Instead of the old plain text method which tried to re-create a paste operation, the
752
+ * new approach adds a plain text mode toggle switch that changes the behavior of paste.
753
+ * This function is passed the same input that the regular paste plugin produces.
754
+ * It performs additional scrubbing and produces (and inserts) the plain text.
755
+ * This approach leverages all of the great existing functionality in the paste
756
+ * plugin, and requires minimal changes to add the new functionality.
757
+ * Speednet - June 2009
758
+ */
759
+ _insertPlainText : function(content) {
760
+ var ed = this.editor,
761
+ linebr = getParam(ed, "paste_text_linebreaktype"),
762
+ rl = getParam(ed, "paste_text_replacements"),
763
+ is = tinymce.is;
764
+
765
+ function process(items) {
766
+ each(items, function(v) {
767
+ if (v.constructor == RegExp)
768
+ content = content.replace(v, "");
769
+ else
770
+ content = content.replace(v[0], v[1]);
771
+ });
772
+ };
773
+
774
+ if ((typeof(content) === "string") && (content.length > 0)) {
775
+ // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line
776
+ if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(content)) {
777
+ process([
778
+ /[\n\r]+/g
779
+ ]);
780
+ } else {
781
+ // Otherwise just get rid of carriage returns (only need linefeeds)
782
+ process([
783
+ /\r+/g
784
+ ]);
785
+ }
786
+
787
+ process([
788
+ [/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi, "\n\n"], // Block tags get a blank line after them
789
+ [/<br[^>]*>|<\/tr>/gi, "\n"], // Single linebreak for <br /> tags and table rows
790
+ [/<\/t[dh]>\s*<t[dh][^>]*>/gi, "\t"], // Table cells get tabs betweem them
791
+ /<[a-z!\/?][^>]*>/gi, // Delete all remaining tags
792
+ [/&nbsp;/gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*)
793
+ [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"],// Cool little RegExp deletes whitespace around linebreak chars.
794
+ [/\n{3,}/g, "\n\n"] // Max. 2 consecutive linebreaks
795
+ ]);
796
+
797
+ content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content));
798
+
799
+ // Perform default or custom replacements
800
+ if (is(rl, "array")) {
801
+ process(rl);
802
+ } else if (is(rl, "string")) {
803
+ process(new RegExp(rl, "gi"));
804
+ }
805
+
806
+ // Treat paragraphs as specified in the config
807
+ if (linebr == "none") {
808
+ // Convert all line breaks to space
809
+ process([
810
+ [/\n+/g, " "]
811
+ ]);
812
+ } else if (linebr == "br") {
813
+ // Convert all line breaks to <br />
814
+ process([
815
+ [/\n/g, "<br />"]
816
+ ]);
817
+ } else if (linebr == "p") {
818
+ // Convert all line breaks to <p>...</p>
819
+ process([
820
+ [/\n+/g, "</p><p>"],
821
+ [/^(.*<\/p>)(<p>)$/, '<p>$1']
822
+ ]);
823
+ } else {
824
+ // defaults to "combined"
825
+ // Convert single line breaks to <br /> and double line breaks to <p>...</p>
826
+ process([
827
+ [/\n\n/g, "</p><p>"],
828
+ [/^(.*<\/p>)(<p>)$/, '<p>$1'],
829
+ [/\n/g, "<br />"]
830
+ ]);
831
+ }
832
+
833
+ ed.execCommand('mceInsertContent', false, content);
834
+ }
835
+ },
836
+
837
+ /**
838
+ * This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine.
839
+ */
840
+ _legacySupport : function() {
841
+ var t = this, ed = t.editor;
842
+
843
+ // Register command(s) for backwards compatibility
844
+ ed.addCommand("mcePasteWord", function() {
845
+ ed.windowManager.open({
846
+ file: t.url + "/pasteword.htm",
847
+ width: parseInt(getParam(ed, "paste_dialog_width")),
848
+ height: parseInt(getParam(ed, "paste_dialog_height")),
849
+ inline: 1
850
+ });
851
+ });
852
+
853
+ if (getParam(ed, "paste_text_use_dialog")) {
854
+ ed.addCommand("mcePasteText", function() {
855
+ ed.windowManager.open({
856
+ file : t.url + "/pastetext.htm",
857
+ width: parseInt(getParam(ed, "paste_dialog_width")),
858
+ height: parseInt(getParam(ed, "paste_dialog_height")),
859
+ inline : 1
860
+ });
861
+ });
862
+ }
863
+
864
+ // Register button for backwards compatibility
865
+ ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"});
866
+ }
867
+ });
868
+
869
+ // Register plugin
870
+ tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin);
871
+ })();
tiny_mce/plugins/paste/js/pastetext.js ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ tinyMCEPopup.requireLangPack();
2
+
3
+ var PasteTextDialog = {
4
+ init : function() {
5
+ this.resize();
6
+ },
7
+
8
+ insert : function() {
9
+ var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines;
10
+
11
+ // Convert linebreaks into paragraphs
12
+ if (document.getElementById('linebreaks').checked) {
13
+ lines = h.split(/\r?\n/);
14
+ if (lines.length > 1) {
15
+ h = '';
16
+ tinymce.each(lines, function(row) {
17
+ h += '<p>' + row + '</p>';
18
+ });
19
+ }
20
+ }
21
+
22
+ tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h});
23
+ tinyMCEPopup.close();
24
+ },
25
+
26
+ resize : function() {
27
+ var vp = tinyMCEPopup.dom.getViewPort(window), el;
28
+
29
+ el = document.getElementById('content');
30
+
31
+ el.style.width = (vp.w - 20) + 'px';
32
+ el.style.height = (vp.h - 90) + 'px';
33
+ }
34
+ };
35
+
36
+ tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog);
tiny_mce/plugins/paste/js/pasteword.js ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ tinyMCEPopup.requireLangPack();
2
+
3
+ var PasteWordDialog = {
4
+ init : function() {
5
+ var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = '';
6
+
7
+ // Create iframe
8
+ el.innerHTML = '<iframe id="iframe" src="javascript:\'\';" frameBorder="0" style="border: 1px solid gray"></iframe>';
9
+ ifr = document.getElementById('iframe');
10
+ doc = ifr.contentWindow.document;
11
+
12
+ // Force absolute CSS urls
13
+ css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")];
14
+ css = css.concat(tinymce.explode(ed.settings.content_css) || []);
15
+ tinymce.each(css, function(u) {
16
+ cssHTML += '<link href="' + ed.documentBaseURI.toAbsolute('' + u) + '" rel="stylesheet" type="text/css" />';
17
+ });
18
+
19
+ // Write content into iframe
20
+ doc.open();
21
+ doc.write('<html><head>' + cssHTML + '</head><body class="mceContentBody" spellcheck="false"></body></html>');
22
+ doc.close();
23
+
24
+ doc.designMode = 'on';
25
+ this.resize();
26
+
27
+ window.setTimeout(function() {
28
+ ifr.contentWindow.focus();
29
+ }, 10);
30
+ },
31
+
32
+ insert : function() {
33
+ var h = document.getElementById('iframe').contentWindow.document.body.innerHTML;
34
+
35
+ tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true});
36
+ tinyMCEPopup.close();
37
+ },
38
+
39
+ resize : function() {
40
+ var vp = tinyMCEPopup.dom.getViewPort(window), el;
41
+
42
+ el = document.getElementById('iframe');
43
+
44
+ if (el) {
45
+ el.style.width = (vp.w - 20) + 'px';
46
+ el.style.height = (vp.h - 90) + 'px';
47
+ }
48
+ }
49
+ };
50
+
51
+ tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog);
tiny_mce/plugins/paste/langs/en_dlg.js ADDED
@@ -0,0 +1 @@
 
1
+ tinyMCE.addI18n('en.paste_dlg',{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."});
tiny_mce/plugins/paste/pastetext.htm ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html xmlns="http://www.w3.org/1999/xhtml">
2
+ <head>
3
+ <title>{#paste.paste_text_desc}</title>
4
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
5
+ <script type="text/javascript" src="js/pastetext.js"></script>
6
+ </head>
7
+ <body onresize="PasteTextDialog.resize();" style="display:none; overflow:hidden;">
8
+ <form name="source" onsubmit="return PasteTextDialog.insert();" action="#">
9
+ <div style="float: left" class="title">{#paste.paste_text_desc}</div>
10
+
11
+ <div style="float: right">
12
+ <input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{#paste_dlg.text_linebreaks}</label>
13
+ </div>
14
+
15
+ <br style="clear: both" />
16
+
17
+ <div>{#paste_dlg.text_title}</div>
18
+
19
+ <textarea id="content" name="content" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft" class="mceFocus"></textarea>
20
+
21
+ <div class="mceActionPanel">
22
+ <input type="submit" name="insert" value="{#insert}" id="insert" />
23
+ <input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
24
+ </div>
25
+ </form>
26
+ </body>
27
+ </html>
tiny_mce/plugins/paste/pasteword.htm ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html xmlns="http://www.w3.org/1999/xhtml">
2
+ <head>
3
+ <title>{#paste.paste_word_desc}</title>
4
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
5
+ <script type="text/javascript" src="js/pasteword.js"></script>
6
+ </head>
7
+ <body onresize="PasteWordDialog.resize();" style="display:none; overflow:hidden;">
8
+ <form name="source" onsubmit="return PasteWordDialog.insert();" action="#">
9
+ <div class="title">{#paste.paste_word_desc}</div>
10
+
11
+ <div>{#paste_dlg.word_title}</div>
12
+
13
+ <div id="iframecontainer"></div>
14
+
15
+ <div class="mceActionPanel">
16
+ <input type="submit" id="insert" name="insert" value="{#insert}" />
17
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
18
+ </div>
19
+ </form>
20
+ </body>
21
+ </html>
tiny_mce/plugins/table/cell.htm CHANGED
@@ -5,16 +5,17 @@
5
  <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
  <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
  <script type="text/javascript" src="../../utils/form_utils.js"></script>
 
8
  <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9
  <script type="text/javascript" src="js/cell.js"></script>
10
  <link href="css/cell.css" rel="stylesheet" type="text/css" />
11
  </head>
12
- <body id="tablecell" style="display: none">
13
  <form onsubmit="updateAction();return false;" action="#">
14
  <div class="tabs">
15
  <ul>
16
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
17
- <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
18
  </ul>
19
  </div>
20
 
@@ -23,7 +24,7 @@
23
  <fieldset>
24
  <legend>{#table_dlg.general_props}</legend>
25
 
26
- <table border="0" cellpadding="4" cellspacing="0">
27
  <tr>
28
  <td><label for="align">{#table_dlg.align}</label></td>
29
  <td>
@@ -70,10 +71,10 @@
70
 
71
  <tr>
72
  <td><label for="width">{#table_dlg.width}</label></td>
73
- <td><input id="width" name="width" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
74
 
75
  <td><label for="height">{#table_dlg.height}</label></td>
76
- <td><input id="height" name="height" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
77
  </tr>
78
 
79
  <tr id="styleSelectRow">
@@ -92,7 +93,7 @@
92
  <fieldset>
93
  <legend>{#table_dlg.advanced_props}</legend>
94
 
95
- <table border="0" cellpadding="0" cellspacing="4">
96
  <tr>
97
  <td class="column1"><label for="id">{#table_dlg.id}</label></td>
98
  <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
@@ -124,7 +125,7 @@
124
  <tr>
125
  <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
126
  <td>
127
- <table border="0" cellpadding="0" cellspacing="0">
128
  <tr>
129
  <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
130
  <td id="backgroundimagebrowsercontainer">&nbsp;</td>
@@ -133,10 +134,10 @@
133
  </td>
134
  </tr>
135
 
136
- <tr>
137
- <td class="column1"><label for="bordercolor">{#table_dlg.bordercolor}</label></td>
138
  <td>
139
- <table border="0" cellpadding="0" cellspacing="0">
140
  <tr>
141
  <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
142
  <td id="bordercolor_pickcontainer">&nbsp;</td>
@@ -145,10 +146,10 @@
145
  </td>
146
  </tr>
147
 
148
- <tr>
149
- <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td>
150
  <td>
151
- <table border="0" cellpadding="0" cellspacing="0">
152
  <tr>
153
  <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
154
  <td id="bgcolor_pickcontainer">&nbsp;</td>
@@ -166,6 +167,7 @@
166
  <select id="action" name="action">
167
  <option value="cell">{#table_dlg.cell_cell}</option>
168
  <option value="row">{#table_dlg.cell_row}</option>
 
169
  <option value="all">{#table_dlg.cell_all}</option>
170
  </select>
171
  </div>
5
  <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
  <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
  <script type="text/javascript" src="../../utils/form_utils.js"></script>
8
+ <script type="text/javascript" src="../../utils/validate.js"></script>
9
  <script type="text/javascript" src="../../utils/editable_selects.js"></script>
10
  <script type="text/javascript" src="js/cell.js"></script>
11
  <link href="css/cell.css" rel="stylesheet" type="text/css" />
12
  </head>
13
+ <body id="tablecell" style="display: none" role="application">
14
  <form onsubmit="updateAction();return false;" action="#">
15
  <div class="tabs">
16
  <ul>
17
+ <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
18
+ <li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
19
  </ul>
20
  </div>
21
 
24
  <fieldset>
25
  <legend>{#table_dlg.general_props}</legend>
26
 
27
+ <table role="presentation" border="0" cellpadding="4" cellspacing="0">
28
  <tr>
29
  <td><label for="align">{#table_dlg.align}</label></td>
30
  <td>
71
 
72
  <tr>
73
  <td><label for="width">{#table_dlg.width}</label></td>
74
+ <td><input id="width" name="width" type="text" value="" size="7" maxlength="7" onchange="changedSize();" class="size" /></td>
75
 
76
  <td><label for="height">{#table_dlg.height}</label></td>
77
+ <td><input id="height" name="height" type="text" value="" size="7" maxlength="7" onchange="changedSize();" class="size" /></td>
78
  </tr>
79
 
80
  <tr id="styleSelectRow">
93
  <fieldset>
94
  <legend>{#table_dlg.advanced_props}</legend>
95
 
96
+ <table role="presentation" border="0" cellpadding="0" cellspacing="4">
97
  <tr>
98
  <td class="column1"><label for="id">{#table_dlg.id}</label></td>
99
  <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
125
  <tr>
126
  <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
127
  <td>
128
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
129
  <tr>
130
  <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
131
  <td id="backgroundimagebrowsercontainer">&nbsp;</td>
134
  </td>
135
  </tr>
136
 
137
+ <tr role="group" aria-labelledby="bordercolor_label">
138
+ <td class="column1"><label id="bordercolor_label" for="bordercolor">{#table_dlg.bordercolor}</label></td>
139
  <td>
140
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
141
  <tr>
142
  <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
143
  <td id="bordercolor_pickcontainer">&nbsp;</td>
146
  </td>
147
  </tr>
148
 
149
+ <tr role="group" aria-labelledby="bgcolor_label">
150
+ <td class="column1"><label id="bgcolor_label" for="bgcolor">{#table_dlg.bgcolor}</label></td>
151
  <td>
152
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
153
  <tr>
154
  <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
155
  <td id="bgcolor_pickcontainer">&nbsp;</td>
167
  <select id="action" name="action">
168
  <option value="cell">{#table_dlg.cell_cell}</option>
169
  <option value="row">{#table_dlg.cell_row}</option>
170
+ <option value="col">{#table_dlg.cell_col}</option>
171
  <option value="all">{#table_dlg.cell_all}</option>
172
  </select>
173
  </div>
tiny_mce/plugins/table/editor_plugin.js CHANGED
@@ -1 +1 @@
1
- (function(b){var c=b.each;function a(E,D,H){var e,I,A,n;r();n=D.getParent(H.getStart(),"th,td");if(n){I=C(n);A=F();n=v(I.x,I.y)}function r(){var J=0;e=[];c(["thead","tbody","tfoot"],function(K){var L=D.select(K+" tr",E);c(L,function(M,N){N+=J;c(D.select("td,th",M),function(T,O){var P,Q,R,S;if(e[N]){while(e[N][O]){O++}}R=g(T,"rowspan");S=g(T,"colspan");for(Q=N;Q<N+R;Q++){if(!e[Q]){e[Q]=[]}for(P=O;P<O+S;P++){e[Q][P]={part:K,real:Q==N&&P==O,elm:T,rowspan:R,colspan:S}}}})});J+=L.length})}function v(J,L){var K;K=e[L];if(K){return K[J]}}function g(K,J){return parseInt(K.getAttribute(J)||1)}function h(J){return D.hasClass(J.elm,"mceSelected")||J==n}function j(){var J=[];c(E.rows,function(K){c(K.cells,function(L){if(D.hasClass(L,"mceSelected")||L==n.elm){J.push(K);return false}})});return J}function q(){var J=D.createRng();J.setStartAfter(E);J.setEndAfter(E);H.setRng(J);D.remove(E)}function d(J){var K;b.walk(J,function(M){var L;if(M.nodeType==3){c(D.getParents(M.parentNode,null,J).reverse(),function(N){N=N.cloneNode(false);if(!K){K=L=N}else{if(L){L.appendChild(N)}}L=N});if(L){L.innerHTML=b.isIE?"&nbsp;":'<br _mce_bogus="1" />'}return false}},"childNodes");J=J.cloneNode(false);J.rowSpan=J.colSpan=1;if(K){J.appendChild(K)}else{if(!b.isIE){J.innerHTML='<br _mce_bogus="1" />'}}return J}function p(){var J=D.createRng();c(D.select("tr",E),function(K){if(K.cells.length==0){D.remove(K)}});if(D.select("tr",E).length==0){J.setStartAfter(E);J.setEndAfter(E);H.setRng(J);D.remove(E);return}c(D.select("thead,tbody,tfoot",E),function(K){if(K.rows.length==0){D.remove(K)}});r();row=e[Math.min(e.length-1,I.y)];if(row){H.select(row[Math.min(row.length-1,I.x)].elm,true);H.collapse(true)}}function s(P,N,R,O){var M,K,J,L,Q;M=e[N][P].elm.parentNode;for(J=1;J<=R;J++){M=D.getNext(M,"tr");if(M){for(K=P;K>=0;K--){Q=e[N+J][K].elm;if(Q.parentNode==M){for(L=1;L<=O;L++){D.insertAfter(d(Q),Q)}break}}if(K==-1){for(L=1;L<=O;L++){M.insertBefore(d(M.cells[0]),M.cells[0])}}}}}function z(){c(e,function(J,K){c(J,function(M,L){var P,O,Q,N;if(h(M)){M=M.elm;P=g(M,"colspan");O=g(M,"rowspan");if(P>1||O>1){M.colSpan=M.rowSpan=1;for(N=0;N<P-1;N++){D.insertAfter(d(M),M)}s(L,K,O-1,P)}}})})}function o(R,O,U){var M,L,T,S,Q,N,P,J,R,K;if(R){pos=C(R);M=pos.x;L=pos.y;T=M+(O-1);S=L+(U-1)}else{M=I.x;L=I.y;T=A.x;S=A.y}P=v(M,L);J=v(T,S);if(P&&J&&P.part==J.part){z();r();P=v(M,L).elm;P.colSpan=(T-M)+1;P.rowSpan=(S-L)+1;for(N=L;N<=S;N++){for(Q=M;Q<=T;Q++){R=e[N][Q].elm;if(R!=P){K=b.grep(R.childNodes);c(K,function(W,V){if(W.nodeName!="BR"||V!=K.length-1){P.appendChild(W)}});D.remove(R)}}}p()}}function k(M){var J,O,L,N,P,Q,K,R;c(e,function(S,T){c(S,function(V,U){if(h(V)){V=V.elm;P=V.parentNode;Q=P.cloneNode(false);J=T;if(M){return false}}});if(M){return !J}});for(N=0;N<e[0].length;N++){O=e[J][N].elm;if(O!=L){if(!M){rowSpan=g(O,"rowspan");if(rowSpan>1){O.rowSpan=rowSpan+1;continue}}else{if(J>0&&e[J-1][N]){R=e[J-1][N].elm;rowSpan=g(R,"rowspan");if(rowSpan>1){R.rowSpan=rowSpan+1;continue}}}K=d(O);K.colSpan=O.colSpan;Q.appendChild(K);L=O}}if(Q.hasChildNodes()){if(!M){D.insertAfter(Q,P)}else{P.parentNode.insertBefore(Q,P)}}}function f(K){var L,J;c(e,function(M,N){c(M,function(P,O){if(h(P)){L=O;if(K){return false}}});if(K){return !L}});c(e,function(P,Q){var M=P[L].elm,N,O;if(M!=J){O=g(M,"colspan");N=g(M,"rowspan");if(O==1){if(!K){D.insertAfter(d(M),M);s(L,Q,N-1,O)}else{M.parentNode.insertBefore(d(M),M);s(L,Q,N-1,O)}}else{M.colSpan++}J=M}})}function m(){var J=[];c(e,function(K,L){c(K,function(N,M){if(h(N)&&b.inArray(J,M)===-1){c(e,function(Q){var O=Q[M].elm,P;P=g(O,"colspan");if(P>1){O.colSpan=P-1}else{D.remove(O)}});J.push(M)}})});p()}function l(){var K;function J(N){var M,O,L;M=D.getNext(N,"tr");c(N.cells,function(P){var Q=g(P,"rowspan");if(Q>1){P.rowSpan=Q-1;O=C(P);s(O.x,O.y,1,1)}});O=C(N.cells[0]);c(e[O.y],function(P){var Q;P=P.elm;if(P!=L){Q=g(P,"rowspan");if(Q<=1){D.remove(P)}else{P.rowSpan=Q-1}L=P}})}K=j();c(K.reverse(),function(L){J(L)});p()}function B(){var J=j();D.remove(J);p();return J}function G(){var J=j();c(J,function(L,K){J[K]=L.cloneNode(true)});return J}function w(L,K){var M=j(),J=M[K?0:M.length-1],N=J.cells.length;c(e,function(P){var O;N=0;c(P,function(R,Q){if(R.real){N+=R.colspan}if(R.elm.parentNode==J){O=1}});if(O){return false}});if(!K){L.reverse()}c(L,function(Q){var P=Q.cells.length,O;for(i=0;i<P;i++){O=Q.cells[i];O.colSpan=O.rowSpan=1}for(i=P;i<N;i++){Q.appendChild(d(Q.cells[P-1]))}for(i=N;i<P;i++){D.remove(Q.cells[i])}if(K){J.parentNode.insertBefore(Q,J)}else{D.insertAfter(Q,J)}})}function C(J){var K;c(e,function(L,M){c(L,function(O,N){if(O.elm==J){K={x:N,y:M};return false}});return !K});return K}function u(J){I=C(J)}function F(){var L,K,J;K=J=0;c(e,function(M,N){c(M,function(P,O){var R,Q;if(h(P)){P=e[N][O];if(O>K){K=O}if(N>J){J=N}if(P.real){R=P.colspan-1;Q=P.rowspan-1;if(R){if(O+R>K){K=O+R}}if(Q){if(N+Q>J){J=N+Q}}}}})});return{x:K,y:J}}function t(P){var M,L,R,Q,K,J,N,O;A=C(P);if(I&&A){M=Math.min(I.x,A.x);L=Math.min(I.y,A.y);R=Math.max(I.x,A.x);Q=Math.max(I.y,A.y);K=R;J=Q;for(y=L;y<=J;y++){P=e[y][M];if(!P.real){if(M-(P.colspan-1)<M){M-=P.colspan-1}}}for(x=M;x<=K;x++){P=e[L][x];if(!P.real){if(L-(P.rowspan-1)<L){L-=P.rowspan-1}}}for(y=L;y<=Q;y++){for(x=M;x<=R;x++){P=e[y][x];if(P.real){N=P.colspan-1;O=P.rowspan-1;if(N){if(x+N>K){K=x+N}}if(O){if(y+O>J){J=y+O}}}}}D.removeClass(D.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=L;y<=J;y++){for(x=M;x<=K;x++){D.addClass(e[y][x].elm,"mceSelected")}}}}b.extend(this,{deleteTable:q,split:z,merge:o,insertRow:k,insertCol:f,deleteCols:m,deleteRows:l,cutRows:B,copyRows:G,pasteRows:w,getPos:C,setStartCell:u,setEndCell:t})}b.create("tinymce.plugins.TablePlugin",{init:function(e,f){var d,j;function h(m){var l=e.selection,k=e.dom.getParent(m||l.getNode(),"table");if(k){return new a(k,e.dom,l)}}function g(){e.getBody().style.webkitUserSelect="";e.dom.removeClass(e.dom.select("td.mceSelected,th.mceSelected"),"mceSelected")}c([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(k){e.addButton(k[0],{title:k[1],cmd:k[2],ui:k[3]})});if(!b.isIE){e.onClick.add(function(k,l){l=l.target;if(l.nodeName==="TABLE"){k.selection.select(l)}})}e.onNodeChange.add(function(l,k,o){var m;o=l.selection.getStart();m=l.dom.getParent(o,"td,th,caption");k.setActive("table",o.nodeName==="TABLE"||!!m);if(m&&m.nodeName==="CAPTION"){m=0}k.setDisabled("delete_table",!m);k.setDisabled("delete_col",!m);k.setDisabled("delete_table",!m);k.setDisabled("delete_row",!m);k.setDisabled("col_after",!m);k.setDisabled("col_before",!m);k.setDisabled("row_after",!m);k.setDisabled("row_before",!m);k.setDisabled("row_props",!m);k.setDisabled("cell_props",!m);k.setDisabled("split_cells",!m);k.setDisabled("merge_cells",!m)});e.onInit.add(function(l){var k,o,p=l.dom,m;d=l.windowManager;l.onMouseDown.add(function(q,r){if(r.button!=2){g();o=p.getParent(r.target,"td,th");k=p.getParent(o,"table")}});p.bind(l.getDoc(),"mouseover",function(t){var r,q,s=t.target;if(o&&(m||s!=o)&&(s.nodeName=="TD"||s.nodeName=="TH")){q=p.getParent(s,"table");if(q==k){if(!m){m=h(q);m.setStartCell(o);l.getBody().style.webkitUserSelect="none"}m.setEndCell(s)}r=l.selection.getSel();if(r.removeAllRanges){r.removeAllRanges()}else{r.empty()}t.preventDefault()}});l.onMouseUp.add(function(z,A){var r,t=z.selection,B,C=t.getSel(),q,u,s,w;if(o){if(m){z.getBody().style.webkitUserSelect=""}function v(D,F){var E=new b.dom.TreeWalker(D,D);do{if(D.nodeType==3&&b.trim(D.nodeValue).length!=0){if(F){r.setStart(D,0)}else{r.setEnd(D,D.nodeValue.length)}return}if(D.nodeName=="BR"){if(F){r.setStartBefore(D)}else{r.setEndBefore(D)}return}}while(D=(F?E.next():E.prev()))}B=p.select("td.mceSelected,th.mceSelected");if(B.length>0){r=p.createRng();u=B[0];w=B[B.length-1];v(u,1);q=new b.dom.TreeWalker(u,p.getParent(B[0],"table"));do{if(u.nodeName=="TD"||u.nodeName=="TH"){if(!p.hasClass(u,"mceSelected")){break}s=u}}while(u=q.next());v(s);t.setRng(r)}z.nodeChanged();o=m=k=null}});l.onKeyUp.add(function(q,r){g()});if(l&&l.plugins.contextmenu){l.plugins.contextmenu.onContextMenu.add(function(s,q,u){var v,t=l.selection,r=t.getNode()||l.getBody();if(l.dom.getParent(u,"td")||l.dom.getParent(u,"th")){q.removeAll();if(r.nodeName=="A"&&!l.dom.getAttrib(r,"name")){q.add({title:"advanced.link_desc",icon:"link",cmd:l.plugins.advlink?"mceAdvLink":"mceLink",ui:true});q.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});q.addSeparator()}if(r.nodeName=="IMG"&&r.className.indexOf("mceItem")==-1){q.add({title:"advanced.image_desc",icon:"image",cmd:l.plugins.advimage?"mceAdvImage":"mceImage",ui:true});q.addSeparator()}q.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});q.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});q.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});q.addSeparator();v=q.addMenu({title:"table.cell"});v.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});v.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});v.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});v=q.addMenu({title:"table.row"});v.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});v.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});v.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});v.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});v.addSeparator();v.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});v.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});v.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!j);v.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!j);v=q.addMenu({title:"table.col"});v.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});v.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});v.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{q.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(!b.isIE){function n(){var q;for(q=l.getBody().lastChild;q&&q.nodeType==3&&!q.nodeValue.length;q=q.previousSibling){}if(q&&q.nodeName=="TABLE"){l.dom.add(l.getBody(),"p",null,'<br mce_bogus="1" />')}}if(b.isGecko){l.onKeyDown.add(function(r,t){var q,s,u=r.dom;if(t.keyCode==37||t.keyCode==38){q=r.selection.getRng();s=u.getParent(q.startContainer,"table");if(s&&r.getBody().firstChild==s){if(isAtStart(q,s)){q=u.createRng();q.setStartBefore(s);q.setEndBefore(s);r.selection.setRng(q);t.preventDefault()}}}})}l.onKeyUp.add(n);l.onSetContent.add(n);l.onVisualAid.add(n);l.onPreProcess.add(function(q,s){var r=s.node.lastChild;if(r&&r.childNodes.length==1&&r.firstChild.nodeName=="BR"){q.dom.remove(r)}});n()}});c({mceTableSplitCells:function(k){k.split()},mceTableMergeCells:function(l){var m,n,k;k=e.dom.getParent(e.selection.getNode(),"th,td");if(k){m=k.rowSpan;n=k.colSpan}if(!e.dom.select("td.mceSelected,th.mceSelected").length){d.open({url:f+"/merge_cells.htm",width:240+parseInt(e.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(e.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:m,cols:n,onaction:function(o){l.merge(k,o.cols,o.rows)},plugin_url:f})}else{l.merge()}},mceTableInsertRowBefore:function(k){k.insertRow(true)},mceTableInsertRowAfter:function(k){k.insertRow()},mceTableInsertColBefore:function(k){k.insertCol(true)},mceTableInsertColAfter:function(k){k.insertCol()},mceTableDeleteCol:function(k){k.deleteCols()},mceTableDeleteRow:function(k){k.deleteRows()},mceTableCutRow:function(k){j=k.cutRows()},mceTableCopyRow:function(k){j=k.copyRows()},mceTablePasteRowBefore:function(k){k.pasteRows(j,true)},mceTablePasteRowAfter:function(k){k.pasteRows(j)},mceTableDelete:function(k){k.deleteTable()}},function(l,k){e.addCommand(k,function(){var m=h();if(m){l(m);e.execCommand("mceRepaint");g()}})});c({mceInsertTable:function(k){d.open({url:f+"/table.htm",width:400+parseInt(e.getLang("table.table_delta_width",0)),height:320+parseInt(e.getLang("table.table_delta_height",0)),inline:1},{plugin_url:f,action:k?k.action:0})},mceTableRowProps:function(){d.open({url:f+"/row.htm",width:400+parseInt(e.getLang("table.rowprops_delta_width",0)),height:295+parseInt(e.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:f})},mceTableCellProps:function(){d.open({url:f+"/cell.htm",width:400+parseInt(e.getLang("table.cellprops_delta_width",0)),height:295+parseInt(e.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:f})}},function(l,k){e.addCommand(k,function(m,n){l(n)})})}});b.PluginManager.add("table",b.plugins.TablePlugin)})(tinymce);
1
+ (function(d){var e=d.each;function c(g,h){var j=h.ownerDocument,f=j.createRange(),k;f.setStartBefore(h);f.setEnd(g.endContainer,g.endOffset);k=j.createElement("body");k.appendChild(f.cloneContents());return k.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function a(g,f){return parseInt(g.getAttribute(f)||1)}function b(H,G,K){var g,L,D,o;t();o=G.getParent(K.getStart(),"th,td");if(o){L=F(o);D=I();o=z(L.x,L.y)}function A(N,M){N=N.cloneNode(M);N.removeAttribute("id");return N}function t(){var M=0;g=[];e(["thead","tbody","tfoot"],function(N){var O=G.select("> "+N+" tr",H);e(O,function(P,Q){Q+=M;e(G.select("> td, > th",P),function(W,R){var S,T,U,V;if(g[Q]){while(g[Q][R]){R++}}U=a(W,"rowspan");V=a(W,"colspan");for(T=Q;T<Q+U;T++){if(!g[T]){g[T]=[]}for(S=R;S<R+V;S++){g[T][S]={part:N,real:T==Q&&S==R,elm:W,rowspan:U,colspan:V}}}})});M+=O.length})}function z(M,O){var N;N=g[O];if(N){return N[M]}}function s(O,M,N){if(O){N=parseInt(N);if(N===1){O.removeAttribute(M,1)}else{O.setAttribute(M,N,1)}}}function j(M){return M&&(G.hasClass(M.elm,"mceSelected")||M==o)}function k(){var M=[];e(H.rows,function(N){e(N.cells,function(O){if(G.hasClass(O,"mceSelected")||O==o.elm){M.push(N);return false}})});return M}function r(){var M=G.createRng();M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H)}function f(M){var N;d.walk(M,function(P){var O;if(P.nodeType==3){e(G.getParents(P.parentNode,null,M).reverse(),function(Q){Q=A(Q,false);if(!N){N=O=Q}else{if(O){O.appendChild(Q)}}O=Q});if(O){O.innerHTML=d.isIE?"&nbsp;":'<br data-mce-bogus="1" />'}return false}},"childNodes");M=A(M,false);s(M,"rowSpan",1);s(M,"colSpan",1);if(N){M.appendChild(N)}else{if(!d.isIE){M.innerHTML='<br data-mce-bogus="1" />'}}return M}function q(){var M=G.createRng();e(G.select("tr",H),function(N){if(N.cells.length==0){G.remove(N)}});if(G.select("tr",H).length==0){M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H);return}e(G.select("thead,tbody,tfoot",H),function(N){if(N.rows.length==0){G.remove(N)}});t();row=g[Math.min(g.length-1,L.y)];if(row){K.select(row[Math.min(row.length-1,L.x)].elm,true);K.collapse(true)}}function u(S,Q,U,R){var P,N,M,O,T;P=g[Q][S].elm.parentNode;for(M=1;M<=U;M++){P=G.getNext(P,"tr");if(P){for(N=S;N>=0;N--){T=g[Q+M][N].elm;if(T.parentNode==P){for(O=1;O<=R;O++){G.insertAfter(f(T),T)}break}}if(N==-1){for(O=1;O<=R;O++){P.insertBefore(f(P.cells[0]),P.cells[0])}}}}}function C(){e(g,function(M,N){e(M,function(P,O){var S,R,T,Q;if(j(P)){P=P.elm;S=a(P,"colspan");R=a(P,"rowspan");if(S>1||R>1){s(P,"rowSpan",1);s(P,"colSpan",1);for(Q=0;Q<S-1;Q++){G.insertAfter(f(P),P)}u(O,N,R-1,S)}}})})}function p(V,S,Y){var P,O,X,W,U,R,T,M,V,N,Q;if(V){pos=F(V);P=pos.x;O=pos.y;X=P+(S-1);W=O+(Y-1)}else{P=L.x;O=L.y;X=D.x;W=D.y}T=z(P,O);M=z(X,W);if(T&&M&&T.part==M.part){C();t();T=z(P,O).elm;s(T,"colSpan",(X-P)+1);s(T,"rowSpan",(W-O)+1);for(R=O;R<=W;R++){for(U=P;U<=X;U++){if(!g[R]||!g[R][U]){continue}V=g[R][U].elm;if(V!=T){N=d.grep(V.childNodes);e(N,function(Z){T.appendChild(Z)});if(N.length){N=d.grep(T.childNodes);Q=0;e(N,function(Z){if(Z.nodeName=="BR"&&G.getAttrib(Z,"data-mce-bogus")&&Q++<N.length-1){T.removeChild(Z)}})}G.remove(V)}}}q()}}function l(Q){var M,S,P,R,T,U,N,V,O;e(g,function(W,X){e(W,function(Z,Y){if(j(Z)){Z=Z.elm;T=Z.parentNode;U=A(T,false);M=X;if(Q){return false}}});if(Q){return !M}});for(R=0;R<g[0].length;R++){if(!g[M][R]){continue}S=g[M][R].elm;if(S!=P){if(!Q){O=a(S,"rowspan");if(O>1){s(S,"rowSpan",O+1);continue}}else{if(M>0&&g[M-1][R]){V=g[M-1][R].elm;O=a(V,"rowSpan");if(O>1){s(V,"rowSpan",O+1);continue}}}N=f(S);s(N,"colSpan",S.colSpan);U.appendChild(N);P=S}}if(U.hasChildNodes()){if(!Q){G.insertAfter(U,T)}else{T.parentNode.insertBefore(U,T)}}}function h(N){var O,M;e(g,function(P,Q){e(P,function(S,R){if(j(S)){O=R;if(N){return false}}});if(N){return !O}});e(g,function(S,T){var P,Q,R;if(!S[O]){return}P=S[O].elm;if(P!=M){R=a(P,"colspan");Q=a(P,"rowspan");if(R==1){if(!N){G.insertAfter(f(P),P);u(O,T,Q-1,R)}else{P.parentNode.insertBefore(f(P),P);u(O,T,Q-1,R)}}else{s(P,"colSpan",P.colSpan+1)}M=P}})}function n(){var M=[];e(g,function(N,O){e(N,function(Q,P){if(j(Q)&&d.inArray(M,P)===-1){e(g,function(T){var R=T[P].elm,S;S=a(R,"colSpan");if(S>1){s(R,"colSpan",S-1)}else{G.remove(R)}});M.push(P)}})});q()}function m(){var N;function M(Q){var P,R,O;P=G.getNext(Q,"tr");e(Q.cells,function(S){var T=a(S,"rowSpan");if(T>1){s(S,"rowSpan",T-1);R=F(S);u(R.x,R.y,1,1)}});R=F(Q.cells[0]);e(g[R.y],function(S){var T;S=S.elm;if(S!=O){T=a(S,"rowSpan");if(T<=1){G.remove(S)}else{s(S,"rowSpan",T-1)}O=S}})}N=k();e(N.reverse(),function(O){M(O)});q()}function E(){var M=k();G.remove(M);q();return M}function J(){var M=k();e(M,function(O,N){M[N]=A(O,true)});return M}function B(O,N){var P=k(),M=P[N?0:P.length-1],Q=M.cells.length;e(g,function(S){var R;Q=0;e(S,function(U,T){if(U.real){Q+=U.colspan}if(U.elm.parentNode==M){R=1}});if(R){return false}});if(!N){O.reverse()}e(O,function(T){var S=T.cells.length,R;for(i=0;i<S;i++){R=T.cells[i];s(R,"colSpan",1);s(R,"rowSpan",1)}for(i=S;i<Q;i++){T.appendChild(f(T.cells[S-1]))}for(i=Q;i<S;i++){G.remove(T.cells[i])}if(N){M.parentNode.insertBefore(T,M)}else{G.insertAfter(T,M)}})}function F(M){var N;e(g,function(O,P){e(O,function(R,Q){if(R.elm==M){N={x:Q,y:P};return false}});return !N});return N}function w(M){L=F(M)}function I(){var O,N,M;N=M=0;e(g,function(P,Q){e(P,function(S,R){var U,T;if(j(S)){S=g[Q][R];if(R>N){N=R}if(Q>M){M=Q}if(S.real){U=S.colspan-1;T=S.rowspan-1;if(U){if(R+U>N){N=R+U}}if(T){if(Q+T>M){M=Q+T}}}}})});return{x:N,y:M}}function v(S){var P,O,U,T,N,M,Q,R;D=F(S);if(L&&D){P=Math.min(L.x,D.x);O=Math.min(L.y,D.y);U=Math.max(L.x,D.x);T=Math.max(L.y,D.y);N=U;M=T;for(y=O;y<=M;y++){S=g[y][P];if(!S.real){if(P-(S.colspan-1)<P){P-=S.colspan-1}}}for(x=P;x<=N;x++){S=g[O][x];if(!S.real){if(O-(S.rowspan-1)<O){O-=S.rowspan-1}}}for(y=O;y<=T;y++){for(x=P;x<=U;x++){S=g[y][x];if(S.real){Q=S.colspan-1;R=S.rowspan-1;if(Q){if(x+Q>N){N=x+Q}}if(R){if(y+R>M){M=y+R}}}}}G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=O;y<=M;y++){for(x=P;x<=N;x++){if(g[y][x]){G.addClass(g[y][x].elm,"mceSelected")}}}}}d.extend(this,{deleteTable:r,split:C,merge:p,insertRow:l,insertCol:h,deleteCols:n,deleteRows:m,cutRows:E,copyRows:J,pasteRows:B,getPos:F,setStartCell:w,setEndCell:v})}d.create("tinymce.plugins.TablePlugin",{init:function(g,h){var f,m,j=true;function l(p){var o=g.selection,n=g.dom.getParent(p||o.getNode(),"table");if(n){return new b(n,g.dom,o)}}function k(){g.getBody().style.webkitUserSelect="";if(j){g.dom.removeClass(g.dom.select("td.mceSelected,th.mceSelected"),"mceSelected");j=false}}e([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(n){g.addButton(n[0],{title:n[1],cmd:n[2],ui:n[3]})});if(!d.isIE){g.onClick.add(function(n,o){o=o.target;if(o.nodeName==="TABLE"){n.selection.select(o);n.nodeChanged()}})}g.onPreProcess.add(function(o,p){var n,q,r,t=o.dom,s;n=t.select("table",p.node);q=n.length;while(q--){r=n[q];t.setAttrib(r,"data-mce-style","");if((s=t.getAttrib(r,"width"))){t.setStyle(r,"width",s);t.setAttrib(r,"width","")}if((s=t.getAttrib(r,"height"))){t.setStyle(r,"height",s);t.setAttrib(r,"height","")}}});g.onNodeChange.add(function(q,o,s){var r;s=q.selection.getStart();r=q.dom.getParent(s,"td,th,caption");o.setActive("table",s.nodeName==="TABLE"||!!r);if(r&&r.nodeName==="CAPTION"){r=0}o.setDisabled("delete_table",!r);o.setDisabled("delete_col",!r);o.setDisabled("delete_table",!r);o.setDisabled("delete_row",!r);o.setDisabled("col_after",!r);o.setDisabled("col_before",!r);o.setDisabled("row_after",!r);o.setDisabled("row_before",!r);o.setDisabled("row_props",!r);o.setDisabled("cell_props",!r);o.setDisabled("split_cells",!r);o.setDisabled("merge_cells",!r)});g.onInit.add(function(r){var p,t,q=r.dom,u;f=r.windowManager;r.onMouseDown.add(function(w,z){if(z.button!=2){k();t=q.getParent(z.target,"td,th");p=q.getParent(t,"table")}});q.bind(r.getDoc(),"mouseover",function(C){var A,z,B=C.target;if(t&&(u||B!=t)&&(B.nodeName=="TD"||B.nodeName=="TH")){z=q.getParent(B,"table");if(z==p){if(!u){u=l(z);u.setStartCell(t);r.getBody().style.webkitUserSelect="none"}u.setEndCell(B);j=true}A=r.selection.getSel();try{if(A.removeAllRanges){A.removeAllRanges()}else{A.empty()}}catch(w){}C.preventDefault()}});r.onMouseUp.add(function(F,G){var z,B=F.selection,H,I=B.getSel(),w,C,A,E;if(t){if(u){F.getBody().style.webkitUserSelect=""}function D(J,L){var K=new d.dom.TreeWalker(J,J);do{if(J.nodeType==3&&d.trim(J.nodeValue).length!=0){if(L){z.setStart(J,0)}else{z.setEnd(J,J.nodeValue.length)}return}if(J.nodeName=="BR"){if(L){z.setStartBefore(J)}else{z.setEndBefore(J)}return}}while(J=(L?K.next():K.prev()))}H=q.select("td.mceSelected,th.mceSelected");if(H.length>0){z=q.createRng();C=H[0];E=H[H.length-1];z.setStartBefore(C);z.setEndAfter(C);D(C,1);w=new d.dom.TreeWalker(C,q.getParent(H[0],"table"));do{if(C.nodeName=="TD"||C.nodeName=="TH"){if(!q.hasClass(C,"mceSelected")){break}A=C}}while(C=w.next());D(A);B.setRng(z)}F.nodeChanged();t=u=p=null}});r.onKeyUp.add(function(w,z){k()});r.onKeyDown.add(function(w,z){n(w)});r.onMouseDown.add(function(w,z){if(z.button!=2){n(w)}});function o(D,z,A,F){var B=3,G=D.dom.getParent(z.startContainer,"TABLE"),C,w,E;if(G){C=G.parentNode}w=z.startContainer.nodeType==B&&z.startOffset==0&&z.endOffset==0&&F&&(A.nodeName=="TR"||A==C);E=(A.nodeName=="TD"||A.nodeName=="TH")&&!F;return w||E}function n(A){if(!d.isWebKit){return}var z=A.selection.getRng();var C=A.selection.getNode();var B=A.dom.getParent(z.startContainer,"TD,TH");if(!o(A,z,C,B)){return}if(!B){B=C}var w=B.lastChild;while(w.lastChild){w=w.lastChild}z.setEnd(w,w.nodeValue.length);A.selection.setRng(z)}r.plugins.table.fixTableCellSelection=n;if(r&&r.plugins.contextmenu){r.plugins.contextmenu.onContextMenu.add(function(A,w,C){var D,B=r.selection,z=B.getNode()||r.getBody();if(r.dom.getParent(C,"td")||r.dom.getParent(C,"th")||r.dom.select("td.mceSelected,th.mceSelected").length){w.removeAll();if(z.nodeName=="A"&&!r.dom.getAttrib(z,"name")){w.add({title:"advanced.link_desc",icon:"link",cmd:r.plugins.advlink?"mceAdvLink":"mceLink",ui:true});w.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});w.addSeparator()}if(z.nodeName=="IMG"&&z.className.indexOf("mceItem")==-1){w.add({title:"advanced.image_desc",icon:"image",cmd:r.plugins.advimage?"mceAdvImage":"mceImage",ui:true});w.addSeparator()}w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});w.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});w.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});w.addSeparator();D=w.addMenu({title:"table.cell"});D.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});D.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});D.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});D=w.addMenu({title:"table.row"});D.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});D.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});D.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});D.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});D.addSeparator();D.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});D.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});D.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!m);D.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!m);D=w.addMenu({title:"table.col"});D.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});D.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});D.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{w.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(d.isWebKit){function v(C,N){var L=d.VK;var Q=N.keyCode;function O(Y,U,S){var T=Y?"previousSibling":"nextSibling";var Z=C.dom.getParent(U,"tr");var X=Z[T];if(X){z(C,U,X,Y);d.dom.Event.cancel(S);return true}else{var aa=C.dom.getParent(Z,"table");var W=Z.parentNode;var R=W.nodeName.toLowerCase();if(R==="tbody"||R===(Y?"tfoot":"thead")){var V=w(Y,aa,W,"tbody");if(V!==null){return K(Y,V,U,S)}}return M(Y,Z,T,aa,S)}}function w(V,T,U,X){var S=C.dom.select(">"+X,T);var R=S.indexOf(U);if(V&&R===0||!V&&R===S.length-1){return B(V,T)}else{if(R===-1){var W=U.tagName.toLowerCase()==="thead"?0:S.length-1;return S[W]}else{return S[R+(V?-1:1)]}}}function B(U,T){var S=U?"thead":"tfoot";var R=C.dom.select(">"+S,T);return R.length!==0?R[0]:null}function K(V,T,S,U){var R=J(T,V);R&&z(C,S,R,V);d.dom.Event.cancel(U);return true}function M(Y,U,R,X,W){var S=X[R];if(S){F(S);return true}else{var V=C.dom.getParent(X,"td,th");if(V){return O(Y,V,W)}else{var T=J(U,!Y);F(T);return d.dom.Event.cancel(W)}}}function J(S,R){return S&&S[R?"lastChild":"firstChild"]}function F(R){C.selection.setCursorLocation(R,0)}function A(){return Q==L.UP||Q==L.DOWN}function D(R){var T=R.selection.getNode();var S=R.dom.getParent(T,"tr");return S!==null}function P(S){var R=0;var T=S;while(T.previousSibling){T=T.previousSibling;R=R+a(T,"colspan")}return R}function E(T,R){var U=0;var S=0;e(T.children,function(V,W){U=U+a(V,"colspan");S=W;if(U>R){return false}});return S}function z(T,W,Y,V){var X=P(T.dom.getParent(W,"td,th"));var S=E(Y,X);var R=Y.childNodes[S];var U=J(R,V);F(U||R)}function H(R){var T=C.selection.getNode();var U=C.dom.getParent(T,"td,th");var S=C.dom.getParent(R,"td,th");return U&&U!==S&&I(U,S)}function I(S,R){return C.dom.getParent(S,"TABLE")===C.dom.getParent(R,"TABLE")}if(A()&&D(C)){var G=C.selection.getNode();setTimeout(function(){if(H(G)){O(!N.shiftKey&&Q===L.UP,G,N)}},0)}}r.onKeyDown.add(v)}if(!d.isIE){function s(){var w;for(w=r.getBody().lastChild;w&&w.nodeType==3&&!w.nodeValue.length;w=w.previousSibling){}if(w&&w.nodeName=="TABLE"){r.dom.add(r.getBody(),"p",null,'<br mce_bogus="1" />')}}if(d.isGecko){r.onKeyDown.add(function(z,B){var w,A,C=z.dom;if(B.keyCode==37||B.keyCode==38){w=z.selection.getRng();A=C.getParent(w.startContainer,"table");if(A&&z.getBody().firstChild==A){if(c(w,A)){w=C.createRng();w.setStartBefore(A);w.setEndBefore(A);z.selection.setRng(w);B.preventDefault()}}}})}r.onKeyUp.add(s);r.onSetContent.add(s);r.onVisualAid.add(s);r.onPreProcess.add(function(w,A){var z=A.node.lastChild;if(z&&z.childNodes.length==1&&z.firstChild.nodeName=="BR"){w.dom.remove(z)}});s();r.startContent=r.getContent({format:"raw"})}});e({mceTableSplitCells:function(n){n.split()},mceTableMergeCells:function(o){var p,q,n;n=g.dom.getParent(g.selection.getNode(),"th,td");if(n){p=n.rowSpan;q=n.colSpan}if(!g.dom.select("td.mceSelected,th.mceSelected").length){f.open({url:h+"/merge_cells.htm",width:240+parseInt(g.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(g.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:p,cols:q,onaction:function(r){o.merge(n,r.cols,r.rows)},plugin_url:h})}else{o.merge()}},mceTableInsertRowBefore:function(n){n.insertRow(true)},mceTableInsertRowAfter:function(n){n.insertRow()},mceTableInsertColBefore:function(n){n.insertCol(true)},mceTableInsertColAfter:function(n){n.insertCol()},mceTableDeleteCol:function(n){n.deleteCols()},mceTableDeleteRow:function(n){n.deleteRows()},mceTableCutRow:function(n){m=n.cutRows()},mceTableCopyRow:function(n){m=n.copyRows()},mceTablePasteRowBefore:function(n){n.pasteRows(m,true)},mceTablePasteRowAfter:function(n){n.pasteRows(m)},mceTableDelete:function(n){n.deleteTable()}},function(o,n){g.addCommand(n,function(){var p=l();if(p){o(p);g.execCommand("mceRepaint");k()}})});e({mceInsertTable:function(n){f.open({url:h+"/table.htm",width:400+parseInt(g.getLang("table.table_delta_width",0)),height:320+parseInt(g.getLang("table.table_delta_height",0)),inline:1},{plugin_url:h,action:n?n.action:0})},mceTableRowProps:function(){f.open({url:h+"/row.htm",width:400+parseInt(g.getLang("table.rowprops_delta_width",0)),height:295+parseInt(g.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:h})},mceTableCellProps:function(){f.open({url:h+"/cell.htm",width:400+parseInt(g.getLang("table.cellprops_delta_width",0)),height:295+parseInt(g.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:h})}},function(o,n){g.addCommand(n,function(p,q){o(q)})})}});d.PluginManager.add("table",d.plugins.TablePlugin)})(tinymce);
tiny_mce/plugins/table/editor_plugin_src.js CHANGED
@@ -1,1118 +1,1408 @@
1
- /**
2
- * editor_plugin_src.js
3
- *
4
- * Copyright 2009, Moxiecode Systems AB
5
- * Released under LGPL License.
6
- *
7
- * License: http://tinymce.moxiecode.com/license
8
- * Contributing: http://tinymce.moxiecode.com/contributing
9
- */
10
-
11
- (function(tinymce) {
12
- var each = tinymce.each;
13
-
14
- /**
15
- * Table Grid class.
16
- */
17
- function TableGrid(table, dom, selection) {
18
- var grid, startPos, endPos, selectedCell;
19
-
20
- buildGrid();
21
- selectedCell = dom.getParent(selection.getStart(), 'th,td');
22
- if (selectedCell) {
23
- startPos = getPos(selectedCell);
24
- endPos = findEndPos();
25
- selectedCell = getCell(startPos.x, startPos.y);
26
- }
27
-
28
- function buildGrid() {
29
- var startY = 0;
30
-
31
- grid = [];
32
-
33
- each(['thead', 'tbody', 'tfoot'], function(part) {
34
- var rows = dom.select(part + ' tr', table);
35
-
36
- each(rows, function(tr, y) {
37
- y += startY;
38
-
39
- each(dom.select('td,th', tr), function(td, x) {
40
- var x2, y2, rowspan, colspan;
41
-
42
- // Skip over existing cells produced by rowspan
43
- if (grid[y]) {
44
- while (grid[y][x])
45
- x++;
46
- }
47
-
48
- // Get col/rowspan from cell
49
- rowspan = getSpanVal(td, 'rowspan');
50
- colspan = getSpanVal(td, 'colspan');
51
-
52
- // Fill out rowspan/colspan right and down
53
- for (y2 = y; y2 < y + rowspan; y2++) {
54
- if (!grid[y2])
55
- grid[y2] = [];
56
-
57
- for (x2 = x; x2 < x + colspan; x2++) {
58
- grid[y2][x2] = {
59
- part : part,
60
- real : y2 == y && x2 == x,
61
- elm : td,
62
- rowspan : rowspan,
63
- colspan : colspan
64
- };
65
- }
66
- }
67
- });
68
- });
69
-
70
- startY += rows.length;
71
- });
72
- };
73
-
74
- function getCell(x, y) {
75
- var row;
76
-
77
- row = grid[y];
78
- if (row)
79
- return row[x];
80
- };
81
-
82
- function getSpanVal(td, name) {
83
- return parseInt(td.getAttribute(name) || 1);
84
- };
85
-
86
- function isCellSelected(cell) {
87
- return dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell;
88
- };
89
-
90
- function getSelectedRows() {
91
- var rows = [];
92
-
93
- each(table.rows, function(row) {
94
- each(row.cells, function(cell) {
95
- if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) {
96
- rows.push(row);
97
- return false;
98
- }
99
- });
100
- });
101
-
102
- return rows;
103
- };
104
-
105
- function deleteTable() {
106
- var rng = dom.createRng();
107
-
108
- rng.setStartAfter(table);
109
- rng.setEndAfter(table);
110
-
111
- selection.setRng(rng);
112
-
113
- dom.remove(table);
114
- };
115
-
116
- function cloneCell(cell) {
117
- var formatNode;
118
-
119
- // Clone formats
120
- tinymce.walk(cell, function(node) {
121
- var curNode;
122
-
123
- if (node.nodeType == 3) {
124
- each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) {
125
- node = node.cloneNode(false);
126
-
127
- if (!formatNode)
128
- formatNode = curNode = node;
129
- else if (curNode)
130
- curNode.appendChild(node);
131
-
132
- curNode = node;
133
- });
134
-
135
- // Add something to the inner node
136
- if (curNode)
137
- curNode.innerHTML = tinymce.isIE ? '&nbsp;' : '<br _mce_bogus="1" />';
138
-
139
- return false;
140
- }
141
- }, 'childNodes');
142
-
143
- cell = cell.cloneNode(false);
144
- cell.rowSpan = cell.colSpan = 1;
145
-
146
- if (formatNode) {
147
- cell.appendChild(formatNode);
148
- } else {
149
- if (!tinymce.isIE)
150
- cell.innerHTML = '<br _mce_bogus="1" />';
151
- }
152
-
153
- return cell;
154
- };
155
-
156
- function cleanup() {
157
- var rng = dom.createRng();
158
-
159
- // Empty rows
160
- each(dom.select('tr', table), function(tr) {
161
- if (tr.cells.length == 0)
162
- dom.remove(tr);
163
- });
164
-
165
- // Empty table
166
- if (dom.select('tr', table).length == 0) {
167
- rng.setStartAfter(table);
168
- rng.setEndAfter(table);
169
- selection.setRng(rng);
170
- dom.remove(table);
171
- return;
172
- }
173
-
174
- // Empty header/body/footer
175
- each(dom.select('thead,tbody,tfoot', table), function(part) {
176
- if (part.rows.length == 0)
177
- dom.remove(part);
178
- });
179
-
180
- // Restore selection to start position if it still exists
181
- buildGrid();
182
-
183
- // Restore the selection to the closest table position
184
- row = grid[Math.min(grid.length - 1, startPos.y)];
185
- if (row) {
186
- selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true);
187
- selection.collapse(true);
188
- }
189
- };
190
-
191
- function fillLeftDown(x, y, rows, cols) {
192
- var tr, x2, r, c, cell;
193
-
194
- tr = grid[y][x].elm.parentNode;
195
- for (r = 1; r <= rows; r++) {
196
- tr = dom.getNext(tr, 'tr');
197
-
198
- if (tr) {
199
- // Loop left to find real cell
200
- for (x2 = x; x2 >= 0; x2--) {
201
- cell = grid[y + r][x2].elm;
202
-
203
- if (cell.parentNode == tr) {
204
- // Append clones after
205
- for (c = 1; c <= cols; c++)
206
- dom.insertAfter(cloneCell(cell), cell);
207
-
208
- break;
209
- }
210
- }
211
-
212
- if (x2 == -1) {
213
- // Insert nodes before first cell
214
- for (c = 1; c <= cols; c++)
215
- tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]);
216
- }
217
- }
218
- }
219
- };
220
-
221
- function split() {
222
- each(grid, function(row, y) {
223
- each(row, function(cell, x) {
224
- var colSpan, rowSpan, newCell, i;
225
-
226
- if (isCellSelected(cell)) {
227
- cell = cell.elm;
228
- colSpan = getSpanVal(cell, 'colspan');
229
- rowSpan = getSpanVal(cell, 'rowspan');
230
-
231
- if (colSpan > 1 || rowSpan > 1) {
232
- cell.colSpan = cell.rowSpan = 1;
233
-
234
- // Insert cells right
235
- for (i = 0; i < colSpan - 1; i++)
236
- dom.insertAfter(cloneCell(cell), cell);
237
-
238
- fillLeftDown(x, y, rowSpan - 1, colSpan);
239
- }
240
- }
241
- });
242
- });
243
- };
244
-
245
- function merge(cell, cols, rows) {
246
- var startX, startY, endX, endY, x, y, startCell, endCell, cell, children;
247
-
248
- // Use specified cell and cols/rows
249
- if (cell) {
250
- pos = getPos(cell);
251
- startX = pos.x;
252
- startY = pos.y;
253
- endX = startX + (cols - 1);
254
- endY = startY + (rows - 1);
255
- } else {
256
- // Use selection
257
- startX = startPos.x;
258
- startY = startPos.y;
259
- endX = endPos.x;
260
- endY = endPos.y;
261
- }
262
-
263
- // Find start/end cells
264
- startCell = getCell(startX, startY);
265
- endCell = getCell(endX, endY);
266
-
267
- // Check if the cells exists and if they are of the same part for example tbody = tbody
268
- if (startCell && endCell && startCell.part == endCell.part) {
269
- // Split and rebuild grid
270
- split();
271
- buildGrid();
272
-
273
- // Set row/col span to start cell
274
- startCell = getCell(startX, startY).elm;
275
- startCell.colSpan = (endX - startX) + 1;
276
- startCell.rowSpan = (endY - startY) + 1;
277
-
278
- // Remove other cells and add it's contents to the start cell
279
- for (y = startY; y <= endY; y++) {
280
- for (x = startX; x <= endX; x++) {
281
- cell = grid[y][x].elm;
282
-
283
- if (cell != startCell) {
284
- // Move children to startCell
285
- children = tinymce.grep(cell.childNodes);
286
- each(children, function(node, i) {
287
- // Jump over last BR element
288
- if (node.nodeName != 'BR' || i != children.length - 1)
289
- startCell.appendChild(node);
290
- });
291
-
292
- // Remove cell
293
- dom.remove(cell);
294
- }
295
- }
296
- }
297
-
298
- // Remove empty rows etc and restore caret location
299
- cleanup();
300
- }
301
- };
302
-
303
- function insertRow(before) {
304
- var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell;
305
-
306
- // Find first/last row
307
- each(grid, function(row, y) {
308
- each(row, function(cell, x) {
309
- if (isCellSelected(cell)) {
310
- cell = cell.elm;
311
- rowElm = cell.parentNode;
312
- newRow = rowElm.cloneNode(false);
313
- posY = y;
314
-
315
- if (before)
316
- return false;
317
- }
318
- });
319
-
320
- if (before)
321
- return !posY;
322
- });
323
-
324
- for (x = 0; x < grid[0].length; x++) {
325
- cell = grid[posY][x].elm;
326
-
327
- if (cell != lastCell) {
328
- if (!before) {
329
- rowSpan = getSpanVal(cell, 'rowspan');
330
- if (rowSpan > 1) {
331
- cell.rowSpan = rowSpan + 1;
332
- continue;
333
- }
334
- } else {
335
- // Check if cell above can be expanded
336
- if (posY > 0 && grid[posY - 1][x]) {
337
- otherCell = grid[posY - 1][x].elm;
338
- rowSpan = getSpanVal(otherCell, 'rowspan');
339
- if (rowSpan > 1) {
340
- otherCell.rowSpan = rowSpan + 1;
341
- continue;
342
- }
343
- }
344
- }
345
-
346
- // Insert new cell into new row
347
- newCell = cloneCell(cell)
348
- newCell.colSpan = cell.colSpan;
349
- newRow.appendChild(newCell);
350
-
351
- lastCell = cell;
352
- }
353
- }
354
-
355
- if (newRow.hasChildNodes()) {
356
- if (!before)
357
- dom.insertAfter(newRow, rowElm);
358
- else
359
- rowElm.parentNode.insertBefore(newRow, rowElm);
360
- }
361
- };
362
-
363
- function insertCol(before) {
364
- var posX, lastCell;
365
-
366
- // Find first/last column
367
- each(grid, function(row, y) {
368
- each(row, function(cell, x) {
369
- if (isCellSelected(cell)) {
370
- posX = x;
371
-
372
- if (before)
373
- return false;
374
- }
375
- });
376
-
377
- if (before)
378
- return !posX;
379
- });
380
-
381
- each(grid, function(row, y) {
382
- var cell = row[posX].elm, rowSpan, colSpan;
383
-
384
- if (cell != lastCell) {
385
- colSpan = getSpanVal(cell, 'colspan');
386
- rowSpan = getSpanVal(cell, 'rowspan');
387
-
388
- if (colSpan == 1) {
389
- if (!before) {
390
- dom.insertAfter(cloneCell(cell), cell);
391
- fillLeftDown(posX, y, rowSpan - 1, colSpan);
392
- } else {
393
- cell.parentNode.insertBefore(cloneCell(cell), cell);
394
- fillLeftDown(posX, y, rowSpan - 1, colSpan);
395
- }
396
- } else
397
- cell.colSpan++;
398
-
399
- lastCell = cell;
400
- }
401
- });
402
- };
403
-
404
- function deleteCols() {
405
- var cols = [];
406
-
407
- // Get selected column indexes
408
- each(grid, function(row, y) {
409
- each(row, function(cell, x) {
410
- if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) {
411
- each(grid, function(row) {
412
- var cell = row[x].elm, colSpan;
413
-
414
- colSpan = getSpanVal(cell, 'colspan');
415
-
416
- if (colSpan > 1)
417
- cell.colSpan = colSpan - 1;
418
- else
419
- dom.remove(cell);
420
- });
421
-
422
- cols.push(x);
423
- }
424
- });
425
- });
426
-
427
- cleanup();
428
- };
429
-
430
- function deleteRows() {
431
- var rows;
432
-
433
- function deleteRow(tr) {
434
- var nextTr, pos, lastCell;
435
-
436
- nextTr = dom.getNext(tr, 'tr');
437
-
438
- // Move down row spanned cells
439
- each(tr.cells, function(cell) {
440
- var rowSpan = getSpanVal(cell, 'rowspan');
441
-
442
- if (rowSpan > 1) {
443
- cell.rowSpan = rowSpan - 1;
444
- pos = getPos(cell);
445
- fillLeftDown(pos.x, pos.y, 1, 1);
446
- }
447
- });
448
-
449
- // Delete cells
450
- pos = getPos(tr.cells[0]);
451
- each(grid[pos.y], function(cell) {
452
- var rowSpan;
453
-
454
- cell = cell.elm;
455
-
456
- if (cell != lastCell) {
457
- rowSpan = getSpanVal(cell, 'rowspan');
458
-
459
- if (rowSpan <= 1)
460
- dom.remove(cell);
461
- else
462
- cell.rowSpan = rowSpan - 1;
463
-
464
- lastCell = cell;
465
- }
466
- });
467
- };
468
-
469
- // Get selected rows and move selection out of scope
470
- rows = getSelectedRows();
471
-
472
- // Delete all selected rows
473
- each(rows.reverse(), function(tr) {
474
- deleteRow(tr);
475
- });
476
-
477
- cleanup();
478
- };
479
-
480
- function cutRows() {
481
- var rows = getSelectedRows();
482
-
483
- dom.remove(rows);
484
- cleanup();
485
-
486
- return rows;
487
- };
488
-
489
- function copyRows() {
490
- var rows = getSelectedRows();
491
-
492
- each(rows, function(row, i) {
493
- rows[i] = row.cloneNode(true);
494
- });
495
-
496
- return rows;
497
- };
498
-
499
- function pasteRows(rows, before) {
500
- var selectedRows = getSelectedRows(),
501
- targetRow = selectedRows[before ? 0 : selectedRows.length - 1],
502
- targetCellCount = targetRow.cells.length;
503
-
504
- // Calc target cell count
505
- each(grid, function(row) {
506
- var match;
507
-
508
- targetCellCount = 0;
509
- each(row, function(cell, x) {
510
- if (cell.real)
511
- targetCellCount += cell.colspan;
512
-
513
- if (cell.elm.parentNode == targetRow)
514
- match = 1;
515
- });
516
-
517
- if (match)
518
- return false;
519
- });
520
-
521
- if (!before)
522
- rows.reverse();
523
-
524
- each(rows, function(row) {
525
- var cellCount = row.cells.length, cell;
526
-
527
- // Remove col/rowspans
528
- for (i = 0; i < cellCount; i++) {
529
- cell = row.cells[i];
530
- cell.colSpan = cell.rowSpan = 1;
531
- }
532
-
533
- // Needs more cells
534
- for (i = cellCount; i < targetCellCount; i++)
535
- row.appendChild(cloneCell(row.cells[cellCount - 1]));
536
-
537
- // Needs less cells
538
- for (i = targetCellCount; i < cellCount; i++)
539
- dom.remove(row.cells[i]);
540
-
541
- // Add before/after
542
- if (before)
543
- targetRow.parentNode.insertBefore(row, targetRow);
544
- else
545
- dom.insertAfter(row, targetRow);
546
- });
547
- };
548
-
549
- function getPos(target) {
550
- var pos;
551
-
552
- each(grid, function(row, y) {
553
- each(row, function(cell, x) {
554
- if (cell.elm == target) {
555
- pos = {x : x, y : y};
556
- return false;
557
- }
558
- });
559
-
560
- return !pos;
561
- });
562
-
563
- return pos;
564
- };
565
-
566
- function setStartCell(cell) {
567
- startPos = getPos(cell);
568
- };
569
-
570
- function findEndPos() {
571
- var pos, maxX, maxY;
572
-
573
- maxX = maxY = 0;
574
-
575
- each(grid, function(row, y) {
576
- each(row, function(cell, x) {
577
- var colSpan, rowSpan;
578
-
579
- if (isCellSelected(cell)) {
580
- cell = grid[y][x];
581
-
582
- if (x > maxX)
583
- maxX = x;
584
-
585
- if (y > maxY)
586
- maxY = y;
587
-
588
- if (cell.real) {
589
- colSpan = cell.colspan - 1;
590
- rowSpan = cell.rowspan - 1;
591
-
592
- if (colSpan) {
593
- if (x + colSpan > maxX)
594
- maxX = x + colSpan;
595
- }
596
-
597
- if (rowSpan) {
598
- if (y + rowSpan > maxY)
599
- maxY = y + rowSpan;
600
- }
601
- }
602
- }
603
- });
604
- });
605
-
606
- return {x : maxX, y : maxY};
607
- };
608
-
609
- function setEndCell(cell) {
610
- var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan;
611
-
612
- endPos = getPos(cell);
613
-
614
- if (startPos && endPos) {
615
- // Get start/end positions
616
- startX = Math.min(startPos.x, endPos.x);
617
- startY = Math.min(startPos.y, endPos.y);
618
- endX = Math.max(startPos.x, endPos.x);
619
- endY = Math.max(startPos.y, endPos.y);
620
-
621
- // Expand end positon to include spans
622
- maxX = endX;
623
- maxY = endY;
624
-
625
- // Expand startX
626
- for (y = startY; y <= maxY; y++) {
627
- cell = grid[y][startX];
628
-
629
- if (!cell.real) {
630
- if (startX - (cell.colspan - 1) < startX)
631
- startX -= cell.colspan - 1;
632
- }
633
- }
634
-
635
- // Expand startY
636
- for (x = startX; x <= maxX; x++) {
637
- cell = grid[startY][x];
638
-
639
- if (!cell.real) {
640
- if (startY - (cell.rowspan - 1) < startY)
641
- startY -= cell.rowspan - 1;
642
- }
643
- }
644
-
645
- // Find max X, Y
646
- for (y = startY; y <= endY; y++) {
647
- for (x = startX; x <= endX; x++) {
648
- cell = grid[y][x];
649
-
650
- if (cell.real) {
651
- colSpan = cell.colspan - 1;
652
- rowSpan = cell.rowspan - 1;
653
-
654
- if (colSpan) {
655
- if (x + colSpan > maxX)
656
- maxX = x + colSpan;
657
- }
658
-
659
- if (rowSpan) {
660
- if (y + rowSpan > maxY)
661
- maxY = y + rowSpan;
662
- }
663
- }
664
- }
665
- }
666
-
667
- // Remove current selection
668
- dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
669
-
670
- // Add new selection
671
- for (y = startY; y <= maxY; y++) {
672
- for (x = startX; x <= maxX; x++)
673
- dom.addClass(grid[y][x].elm, 'mceSelected');
674
- }
675
- }
676
- };
677
-
678
- // Expose to public
679
- tinymce.extend(this, {
680
- deleteTable : deleteTable,
681
- split : split,
682
- merge : merge,
683
- insertRow : insertRow,
684
- insertCol : insertCol,
685
- deleteCols : deleteCols,
686
- deleteRows : deleteRows,
687
- cutRows : cutRows,
688
- copyRows : copyRows,
689
- pasteRows : pasteRows,
690
- getPos : getPos,
691
- setStartCell : setStartCell,
692
- setEndCell : setEndCell
693
- });
694
- };
695
-
696
- tinymce.create('tinymce.plugins.TablePlugin', {
697
- init : function(ed, url) {
698
- var winMan, clipboardRows;
699
-
700
- function createTableGrid(node) {
701
- var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table');
702
-
703
- if (tblElm)
704
- return new TableGrid(tblElm, ed.dom, selection);
705
- };
706
-
707
- function cleanup() {
708
- // Restore selection possibilities
709
- ed.getBody().style.webkitUserSelect = '';
710
- ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
711
- };
712
-
713
- // Register buttons
714
- each([
715
- ['table', 'table.desc', 'mceInsertTable', true],
716
- ['delete_table', 'table.del', 'mceTableDelete'],
717
- ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'],
718
- ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'],
719
- ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'],
720
- ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'],
721
- ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'],
722
- ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'],
723
- ['row_props', 'table.row_desc', 'mceTableRowProps', true],
724
- ['cell_props', 'table.cell_desc', 'mceTableCellProps', true],
725
- ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true],
726
- ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true]
727
- ], function(c) {
728
- ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]});
729
- });
730
-
731
- // Select whole table is a table border is clicked
732
- if (!tinymce.isIE) {
733
- ed.onClick.add(function(ed, e) {
734
- e = e.target;
735
-
736
- if (e.nodeName === 'TABLE')
737
- ed.selection.select(e);
738
- });
739
- }
740
-
741
- // Handle node change updates
742
- ed.onNodeChange.add(function(ed, cm, n) {
743
- var p;
744
-
745
- n = ed.selection.getStart();
746
- p = ed.dom.getParent(n, 'td,th,caption');
747
- cm.setActive('table', n.nodeName === 'TABLE' || !!p);
748
-
749
- // Disable table tools if we are in caption
750
- if (p && p.nodeName === 'CAPTION')
751
- p = 0;
752
-
753
- cm.setDisabled('delete_table', !p);
754
- cm.setDisabled('delete_col', !p);
755
- cm.setDisabled('delete_table', !p);
756
- cm.setDisabled('delete_row', !p);
757
- cm.setDisabled('col_after', !p);
758
- cm.setDisabled('col_before', !p);
759
- cm.setDisabled('row_after', !p);
760
- cm.setDisabled('row_before', !p);
761
- cm.setDisabled('row_props', !p);
762
- cm.setDisabled('cell_props', !p);
763
- cm.setDisabled('split_cells', !p);
764
- cm.setDisabled('merge_cells', !p);
765
- });
766
-
767
- ed.onInit.add(function(ed) {
768
- var startTable, startCell, dom = ed.dom, tableGrid;
769
-
770
- winMan = ed.windowManager;
771
-
772
- // Add cell selection logic
773
- ed.onMouseDown.add(function(ed, e) {
774
- if (e.button != 2) {
775
- cleanup();
776
-
777
- startCell = dom.getParent(e.target, 'td,th');
778
- startTable = dom.getParent(startCell, 'table');
779
- }
780
- });
781
-
782
- dom.bind(ed.getDoc(), 'mouseover', function(e) {
783
- var sel, table, target = e.target;
784
-
785
- if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) {
786
- table = dom.getParent(target, 'table');
787
- if (table == startTable) {
788
- if (!tableGrid) {
789
- tableGrid = createTableGrid(table);
790
- tableGrid.setStartCell(startCell);
791
-
792
- ed.getBody().style.webkitUserSelect = 'none';
793
- }
794
-
795
- tableGrid.setEndCell(target);
796
- }
797
-
798
- // Remove current selection
799
- sel = ed.selection.getSel();
800
-
801
- if (sel.removeAllRanges)
802
- sel.removeAllRanges();
803
- else
804
- sel.empty();
805
-
806
- e.preventDefault();
807
- }
808
- });
809
-
810
- ed.onMouseUp.add(function(ed, e) {
811
- var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode;
812
-
813
- // Move selection to startCell
814
- if (startCell) {
815
- if (tableGrid)
816
- ed.getBody().style.webkitUserSelect = '';
817
-
818
- function setPoint(node, start) {
819
- var walker = new tinymce.dom.TreeWalker(node, node);
820
-
821
- do {
822
- // Text node
823
- if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) {
824
- if (start)
825
- rng.setStart(node, 0);
826
- else
827
- rng.setEnd(node, node.nodeValue.length);
828
-
829
- return;
830
- }
831
-
832
- // BR element
833
- if (node.nodeName == 'BR') {
834
- if (start)
835
- rng.setStartBefore(node);
836
- else
837
- rng.setEndBefore(node);
838
-
839
- return;
840
- }
841
- } while (node = (start ? walker.next() : walker.prev()));
842
- };
843
-
844
- // Try to expand text selection as much as we can only Gecko supports cell selection
845
- selectedCells = dom.select('td.mceSelected,th.mceSelected');
846
- if (selectedCells.length > 0) {
847
- rng = dom.createRng();
848
- node = selectedCells[0];
849
- endNode = selectedCells[selectedCells.length - 1];
850
-
851
- setPoint(node, 1);
852
- walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table'));
853
-
854
- do {
855
- if (node.nodeName == 'TD' || node.nodeName == 'TH') {
856
- if (!dom.hasClass(node, 'mceSelected'))
857
- break;
858
-
859
- lastNode = node;
860
- }
861
- } while (node = walker.next());
862
-
863
- setPoint(lastNode);
864
-
865
- sel.setRng(rng);
866
- }
867
-
868
- ed.nodeChanged();
869
- startCell = tableGrid = startTable = null;
870
- }
871
- });
872
-
873
- ed.onKeyUp.add(function(ed, e) {
874
- cleanup();
875
- });
876
-
877
- // Add context menu
878
- if (ed && ed.plugins.contextmenu) {
879
- ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
880
- var sm, se = ed.selection, el = se.getNode() || ed.getBody();
881
-
882
- if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th')) {
883
- m.removeAll();
884
-
885
- if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) {
886
- m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});
887
- m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});
888
- m.addSeparator();
889
- }
890
-
891
- if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) {
892
- m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
893
- m.addSeparator();
894
- }
895
-
896
- m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}});
897
- m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'});
898
- m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'});
899
- m.addSeparator();
900
-
901
- // Cell menu
902
- sm = m.addMenu({title : 'table.cell'});
903
- sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'});
904
- sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'});
905
- sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'});
906
-
907
- // Row menu
908
- sm = m.addMenu({title : 'table.row'});
909
- sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'});
910
- sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'});
911
- sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'});
912
- sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'});
913
- sm.addSeparator();
914
- sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'});
915
- sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'});
916
- sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows);
917
- sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows);
918
-
919
- // Column menu
920
- sm = m.addMenu({title : 'table.col'});
921
- sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'});
922
- sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'});
923
- sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'});
924
- } else
925
- m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'});
926
- });
927
- }
928
-
929
- // Fixes an issue on Gecko where it's impossible to place the caret behind a table
930
- // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled
931
- if (!tinymce.isIE) {
932
- function fixTableCaretPos() {
933
- var last;
934
-
935
- // Skip empty text nodes form the end
936
- for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;
937
-
938
- if (last && last.nodeName == 'TABLE')
939
- ed.dom.add(ed.getBody(), 'p', null, '<br mce_bogus="1" />');
940
- };
941
-
942
- // Fixes an bug where it's impossible to place the caret before a table in Gecko
943
- // this fix solves it by detecting when the caret is at the beginning of such a table
944
- // and then manually moves the caret infront of the table
945
- if (tinymce.isGecko) {
946
- ed.onKeyDown.add(function(ed, e) {
947
- var rng, table, dom = ed.dom;
948
-
949
- // On gecko it's not possible to place the caret before a table
950
- if (e.keyCode == 37 || e.keyCode == 38) {
951
- rng = ed.selection.getRng();
952
- table = dom.getParent(rng.startContainer, 'table');
953
-
954
- if (table && ed.getBody().firstChild == table) {
955
- if (isAtStart(rng, table)) {
956
- rng = dom.createRng();
957
-
958
- rng.setStartBefore(table);
959
- rng.setEndBefore(table);
960
-
961
- ed.selection.setRng(rng);
962
-
963
- e.preventDefault();
964
- }
965
- }
966
- }
967
- });
968
- }
969
-
970
- ed.onKeyUp.add(fixTableCaretPos);
971
- ed.onSetContent.add(fixTableCaretPos);
972
- ed.onVisualAid.add(fixTableCaretPos);
973
-
974
- ed.onPreProcess.add(function(ed, o) {
975
- var last = o.node.lastChild;
976
-
977
- if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR')
978
- ed.dom.remove(last);
979
- });
980
-
981
- fixTableCaretPos();
982
- }
983
- });
984
-
985
- // Register action commands
986
- each({
987
- mceTableSplitCells : function(grid) {
988
- grid.split();
989
- },
990
-
991
- mceTableMergeCells : function(grid) {
992
- var rowSpan, colSpan, cell;
993
-
994
- cell = ed.dom.getParent(ed.selection.getNode(), 'th,td');
995
- if (cell) {
996
- rowSpan = cell.rowSpan;
997
- colSpan = cell.colSpan;
998
- }
999
-
1000
- if (!ed.dom.select('td.mceSelected,th.mceSelected').length) {
1001
- winMan.open({
1002
- url : url + '/merge_cells.htm',
1003
- width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)),
1004
- height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)),
1005
- inline : 1
1006
- }, {
1007
- rows : rowSpan,
1008
- cols : colSpan,
1009
- onaction : function(data) {
1010
- grid.merge(cell, data.cols, data.rows);
1011
- },
1012
- plugin_url : url
1013
- });
1014
- } else
1015
- grid.merge();
1016
- },
1017
-
1018
- mceTableInsertRowBefore : function(grid) {
1019
- grid.insertRow(true);
1020
- },
1021
-
1022
- mceTableInsertRowAfter : function(grid) {
1023
- grid.insertRow();
1024
- },
1025
-
1026
- mceTableInsertColBefore : function(grid) {
1027
- grid.insertCol(true);
1028
- },
1029
-
1030
- mceTableInsertColAfter : function(grid) {
1031
- grid.insertCol();
1032
- },
1033
-
1034
- mceTableDeleteCol : function(grid) {
1035
- grid.deleteCols();
1036
- },
1037
-
1038
- mceTableDeleteRow : function(grid) {
1039
- grid.deleteRows();
1040
- },
1041
-
1042
- mceTableCutRow : function(grid) {
1043
- clipboardRows = grid.cutRows();
1044
- },
1045
-
1046
- mceTableCopyRow : function(grid) {
1047
- clipboardRows = grid.copyRows();
1048
- },
1049
-
1050
- mceTablePasteRowBefore : function(grid) {
1051
- grid.pasteRows(clipboardRows, true);
1052
- },
1053
-
1054
- mceTablePasteRowAfter : function(grid) {
1055
- grid.pasteRows(clipboardRows);
1056
- },
1057
-
1058
- mceTableDelete : function(grid) {
1059
- grid.deleteTable();
1060
- }
1061
- }, function(func, name) {
1062
- ed.addCommand(name, function() {
1063
- var grid = createTableGrid();
1064
-
1065
- if (grid) {
1066
- func(grid);
1067
- ed.execCommand('mceRepaint');
1068
- cleanup();
1069
- }
1070
- });
1071
- });
1072
-
1073
- // Register dialog commands
1074
- each({
1075
- mceInsertTable : function(val) {
1076
- winMan.open({
1077
- url : url + '/table.htm',
1078
- width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)),
1079
- height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)),
1080
- inline : 1
1081
- }, {
1082
- plugin_url : url,
1083
- action : val ? val.action : 0
1084
- });
1085
- },
1086
-
1087
- mceTableRowProps : function() {
1088
- winMan.open({
1089
- url : url + '/row.htm',
1090
- width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)),
1091
- height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)),
1092
- inline : 1
1093
- }, {
1094
- plugin_url : url
1095
- });
1096
- },
1097
-
1098
- mceTableCellProps : function() {
1099
- winMan.open({
1100
- url : url + '/cell.htm',
1101
- width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)),
1102
- height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)),
1103
- inline : 1
1104
- }, {
1105
- plugin_url : url
1106
- });
1107
- }
1108
- }, function(func, name) {
1109
- ed.addCommand(name, function(ui, val) {
1110
- func(val);
1111
- });
1112
- });
1113
- }
1114
- });
1115
-
1116
- // Register plugin
1117
- tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin);
1118
- })(tinymce);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * editor_plugin_src.js
3
+ *
4
+ * Copyright 2009, Moxiecode Systems AB
5
+ * Released under LGPL License.
6
+ *
7
+ * License: http://tinymce.moxiecode.com/license
8
+ * Contributing: http://tinymce.moxiecode.com/contributing
9
+ */
10
+
11
+ (function(tinymce) {
12
+ var each = tinymce.each;
13
+
14
+ // Checks if the selection/caret is at the start of the specified block element
15
+ function isAtStart(rng, par) {
16
+ var doc = par.ownerDocument, rng2 = doc.createRange(), elm;
17
+
18
+ rng2.setStartBefore(par);
19
+ rng2.setEnd(rng.endContainer, rng.endOffset);
20
+
21
+ elm = doc.createElement('body');
22
+ elm.appendChild(rng2.cloneContents());
23
+
24
+ // Check for text characters of other elements that should be treated as content
25
+ return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0;
26
+ };
27
+
28
+ function getSpanVal(td, name) {
29
+ return parseInt(td.getAttribute(name) || 1);
30
+ }
31
+
32
+ /**
33
+ * Table Grid class.
34
+ */
35
+ function TableGrid(table, dom, selection) {
36
+ var grid, startPos, endPos, selectedCell;
37
+
38
+ buildGrid();
39
+ selectedCell = dom.getParent(selection.getStart(), 'th,td');
40
+ if (selectedCell) {
41
+ startPos = getPos(selectedCell);
42
+ endPos = findEndPos();
43
+ selectedCell = getCell(startPos.x, startPos.y);
44
+ }
45
+
46
+ function cloneNode(node, children) {
47
+ node = node.cloneNode(children);
48
+ node.removeAttribute('id');
49
+
50
+ return node;
51
+ }
52
+
53
+ function buildGrid() {
54
+ var startY = 0;
55
+
56
+ grid = [];
57
+
58
+ each(['thead', 'tbody', 'tfoot'], function(part) {
59
+ var rows = dom.select('> ' + part + ' tr', table);
60
+
61
+ each(rows, function(tr, y) {
62
+ y += startY;
63
+
64
+ each(dom.select('> td, > th', tr), function(td, x) {
65
+ var x2, y2, rowspan, colspan;
66
+
67
+ // Skip over existing cells produced by rowspan
68
+ if (grid[y]) {
69
+ while (grid[y][x])
70
+ x++;
71
+ }
72
+
73
+ // Get col/rowspan from cell
74
+ rowspan = getSpanVal(td, 'rowspan');
75
+ colspan = getSpanVal(td, 'colspan');
76
+
77
+ // Fill out rowspan/colspan right and down
78
+ for (y2 = y; y2 < y + rowspan; y2++) {
79
+ if (!grid[y2])
80
+ grid[y2] = [];
81
+
82
+ for (x2 = x; x2 < x + colspan; x2++) {
83
+ grid[y2][x2] = {
84
+ part : part,
85
+ real : y2 == y && x2 == x,
86
+ elm : td,
87
+ rowspan : rowspan,
88
+ colspan : colspan
89
+ };
90
+ }
91
+ }
92
+ });
93
+ });
94
+
95
+ startY += rows.length;
96
+ });
97
+ };
98
+
99
+ function getCell(x, y) {
100
+ var row;
101
+
102
+ row = grid[y];
103
+ if (row)
104
+ return row[x];
105
+ };
106
+
107
+ function setSpanVal(td, name, val) {
108
+ if (td) {
109
+ val = parseInt(val);
110
+
111
+ if (val === 1)
112
+ td.removeAttribute(name, 1);
113
+ else
114
+ td.setAttribute(name, val, 1);
115
+ }
116
+ }
117
+
118
+ function isCellSelected(cell) {
119
+ return cell && (dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell);
120
+ };
121
+
122
+ function getSelectedRows() {
123
+ var rows = [];
124
+
125
+ each(table.rows, function(row) {
126
+ each(row.cells, function(cell) {
127
+ if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) {
128
+ rows.push(row);
129
+ return false;
130
+ }
131
+ });
132
+ });
133
+
134
+ return rows;
135
+ };
136
+
137
+ function deleteTable() {
138
+ var rng = dom.createRng();
139
+
140
+ rng.setStartAfter(table);
141
+ rng.setEndAfter(table);
142
+
143
+ selection.setRng(rng);
144
+
145
+ dom.remove(table);
146
+ };
147
+
148
+ function cloneCell(cell) {
149
+ var formatNode;
150
+
151
+ // Clone formats
152
+ tinymce.walk(cell, function(node) {
153
+ var curNode;
154
+
155
+ if (node.nodeType == 3) {
156
+ each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) {
157
+ node = cloneNode(node, false);
158
+
159
+ if (!formatNode)
160
+ formatNode = curNode = node;
161
+ else if (curNode)
162
+ curNode.appendChild(node);
163
+
164
+ curNode = node;
165
+ });
166
+
167
+ // Add something to the inner node
168
+ if (curNode)
169
+ curNode.innerHTML = tinymce.isIE ? '&nbsp;' : '<br data-mce-bogus="1" />';
170
+
171
+ return false;
172
+ }
173
+ }, 'childNodes');
174
+
175
+ cell = cloneNode(cell, false);
176
+ setSpanVal(cell, 'rowSpan', 1);
177
+ setSpanVal(cell, 'colSpan', 1);
178
+
179
+ if (formatNode) {
180
+ cell.appendChild(formatNode);
181
+ } else {
182
+ if (!tinymce.isIE)
183
+ cell.innerHTML = '<br data-mce-bogus="1" />';
184
+ }
185
+
186
+ return cell;
187
+ };
188
+
189
+ function cleanup() {
190
+ var rng = dom.createRng();
191
+
192
+ // Empty rows
193
+ each(dom.select('tr', table), function(tr) {
194
+ if (tr.cells.length == 0)
195
+ dom.remove(tr);
196
+ });
197
+
198
+ // Empty table
199
+ if (dom.select('tr', table).length == 0) {
200
+ rng.setStartAfter(table);
201
+ rng.setEndAfter(table);
202
+ selection.setRng(rng);
203
+ dom.remove(table);
204
+ return;
205
+ }
206
+
207
+ // Empty header/body/footer
208
+ each(dom.select('thead,tbody,tfoot', table), function(part) {
209
+ if (part.rows.length == 0)
210
+ dom.remove(part);
211
+ });
212
+
213
+ // Restore selection to start position if it still exists
214
+ buildGrid();
215
+
216
+ // Restore the selection to the closest table position
217
+ row = grid[Math.min(grid.length - 1, startPos.y)];
218
+ if (row) {
219
+ selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true);
220
+ selection.collapse(true);
221
+ }
222
+ };
223
+
224
+ function fillLeftDown(x, y, rows, cols) {
225
+ var tr, x2, r, c, cell;
226
+
227
+ tr = grid[y][x].elm.parentNode;
228
+ for (r = 1; r <= rows; r++) {
229
+ tr = dom.getNext(tr, 'tr');
230
+
231
+ if (tr) {
232
+ // Loop left to find real cell
233
+ for (x2 = x; x2 >= 0; x2--) {
234
+ cell = grid[y + r][x2].elm;
235
+
236
+ if (cell.parentNode == tr) {
237
+ // Append clones after
238
+ for (c = 1; c <= cols; c++)
239
+ dom.insertAfter(cloneCell(cell), cell);
240
+
241
+ break;
242
+ }
243
+ }
244
+
245
+ if (x2 == -1) {
246
+ // Insert nodes before first cell
247
+ for (c = 1; c <= cols; c++)
248
+ tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]);
249
+ }
250
+ }
251
+ }
252
+ };
253
+
254
+ function split() {
255
+ each(grid, function(row, y) {
256
+ each(row, function(cell, x) {
257
+ var colSpan, rowSpan, newCell, i;
258
+
259
+ if (isCellSelected(cell)) {
260
+ cell = cell.elm;
261
+ colSpan = getSpanVal(cell, 'colspan');
262
+ rowSpan = getSpanVal(cell, 'rowspan');
263
+
264
+ if (colSpan > 1 || rowSpan > 1) {
265
+ setSpanVal(cell, 'rowSpan', 1);
266
+ setSpanVal(cell, 'colSpan', 1);
267
+
268
+ // Insert cells right
269
+ for (i = 0; i < colSpan - 1; i++)
270
+ dom.insertAfter(cloneCell(cell), cell);
271
+
272
+ fillLeftDown(x, y, rowSpan - 1, colSpan);
273
+ }
274
+ }
275
+ });
276
+ });
277
+ };
278
+
279
+ function merge(cell, cols, rows) {
280
+ var startX, startY, endX, endY, x, y, startCell, endCell, cell, children, count;
281
+
282
+ // Use specified cell and cols/rows
283
+ if (cell) {
284
+ pos = getPos(cell);
285
+ startX = pos.x;
286
+ startY = pos.y;
287
+ endX = startX + (cols - 1);
288
+ endY = startY + (rows - 1);
289
+ } else {
290
+ // Use selection
291
+ startX = startPos.x;
292
+ startY = startPos.y;
293
+ endX = endPos.x;
294
+ endY = endPos.y;
295
+ }
296
+
297
+ // Find start/end cells
298
+ startCell = getCell(startX, startY);
299
+ endCell = getCell(endX, endY);
300
+
301
+ // Check if the cells exists and if they are of the same part for example tbody = tbody
302
+ if (startCell && endCell && startCell.part == endCell.part) {
303
+ // Split and rebuild grid
304
+ split();
305
+ buildGrid();
306
+
307
+ // Set row/col span to start cell
308
+ startCell = getCell(startX, startY).elm;
309
+ setSpanVal(startCell, 'colSpan', (endX - startX) + 1);
310
+ setSpanVal(startCell, 'rowSpan', (endY - startY) + 1);
311
+
312
+ // Remove other cells and add it's contents to the start cell
313
+ for (y = startY; y <= endY; y++) {
314
+ for (x = startX; x <= endX; x++) {
315
+ if (!grid[y] || !grid[y][x])
316
+ continue;
317
+
318
+ cell = grid[y][x].elm;
319
+
320
+ if (cell != startCell) {
321
+ // Move children to startCell
322
+ children = tinymce.grep(cell.childNodes);
323
+ each(children, function(node) {
324
+ startCell.appendChild(node);
325
+ });
326
+
327
+ // Remove bogus nodes if there is children in the target cell
328
+ if (children.length) {
329
+ children = tinymce.grep(startCell.childNodes);
330
+ count = 0;
331
+ each(children, function(node) {
332
+ if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1)
333
+ startCell.removeChild(node);
334
+ });
335
+ }
336
+
337
+ // Remove cell
338
+ dom.remove(cell);
339
+ }
340
+ }
341
+ }
342
+
343
+ // Remove empty rows etc and restore caret location
344
+ cleanup();
345
+ }
346
+ };
347
+
348
+ function insertRow(before) {
349
+ var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan;
350
+
351
+ // Find first/last row
352
+ each(grid, function(row, y) {
353
+ each(row, function(cell, x) {
354
+ if (isCellSelected(cell)) {
355
+ cell = cell.elm;
356
+ rowElm = cell.parentNode;
357
+ newRow = cloneNode(rowElm, false);
358
+ posY = y;
359
+
360
+ if (before)
361
+ return false;
362
+ }
363
+ });
364
+
365
+ if (before)
366
+ return !posY;
367
+ });
368
+
369
+ for (x = 0; x < grid[0].length; x++) {
370
+ // Cell not found could be because of an invalid table structure
371
+ if (!grid[posY][x])
372
+ continue;
373
+
374
+ cell = grid[posY][x].elm;
375
+
376
+ if (cell != lastCell) {
377
+ if (!before) {
378
+ rowSpan = getSpanVal(cell, 'rowspan');
379
+ if (rowSpan > 1) {
380
+ setSpanVal(cell, 'rowSpan', rowSpan + 1);
381
+ continue;
382
+ }
383
+ } else {
384
+ // Check if cell above can be expanded
385
+ if (posY > 0 && grid[posY - 1][x]) {
386
+ otherCell = grid[posY - 1][x].elm;
387
+ rowSpan = getSpanVal(otherCell, 'rowSpan');
388
+ if (rowSpan > 1) {
389
+ setSpanVal(otherCell, 'rowSpan', rowSpan + 1);
390
+ continue;
391
+ }
392
+ }
393
+ }
394
+
395
+ // Insert new cell into new row
396
+ newCell = cloneCell(cell);
397
+ setSpanVal(newCell, 'colSpan', cell.colSpan);
398
+
399
+ newRow.appendChild(newCell);
400
+
401
+ lastCell = cell;
402
+ }
403
+ }
404
+
405
+ if (newRow.hasChildNodes()) {
406
+ if (!before)
407
+ dom.insertAfter(newRow, rowElm);
408
+ else
409
+ rowElm.parentNode.insertBefore(newRow, rowElm);
410
+ }
411
+ };
412
+
413
+ function insertCol(before) {
414
+ var posX, lastCell;
415
+
416
+ // Find first/last column
417
+ each(grid, function(row, y) {
418
+ each(row, function(cell, x) {
419
+ if (isCellSelected(cell)) {
420
+ posX = x;
421
+
422
+ if (before)
423
+ return false;
424
+ }
425
+ });
426
+
427
+ if (before)
428
+ return !posX;
429
+ });
430
+
431
+ each(grid, function(row, y) {
432
+ var cell, rowSpan, colSpan;
433
+
434
+ if (!row[posX])
435
+ return;
436
+
437
+ cell = row[posX].elm;
438
+ if (cell != lastCell) {
439
+ colSpan = getSpanVal(cell, 'colspan');
440
+ rowSpan = getSpanVal(cell, 'rowspan');
441
+
442
+ if (colSpan == 1) {
443
+ if (!before) {
444
+ dom.insertAfter(cloneCell(cell), cell);
445
+ fillLeftDown(posX, y, rowSpan - 1, colSpan);
446
+ } else {
447
+ cell.parentNode.insertBefore(cloneCell(cell), cell);
448
+ fillLeftDown(posX, y, rowSpan - 1, colSpan);
449
+ }
450
+ } else
451
+ setSpanVal(cell, 'colSpan', cell.colSpan + 1);
452
+
453
+ lastCell = cell;
454
+ }
455
+ });
456
+ };
457
+
458
+ function deleteCols() {
459
+ var cols = [];
460
+
461
+ // Get selected column indexes
462
+ each(grid, function(row, y) {
463
+ each(row, function(cell, x) {
464
+ if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) {
465
+ each(grid, function(row) {
466
+ var cell = row[x].elm, colSpan;
467
+
468
+ colSpan = getSpanVal(cell, 'colSpan');
469
+
470
+ if (colSpan > 1)
471
+ setSpanVal(cell, 'colSpan', colSpan - 1);
472
+ else
473
+ dom.remove(cell);
474
+ });
475
+
476
+ cols.push(x);
477
+ }
478
+ });
479
+ });
480
+
481
+ cleanup();
482
+ };
483
+
484
+ function deleteRows() {
485
+ var rows;
486
+
487
+ function deleteRow(tr) {
488
+ var nextTr, pos, lastCell;
489
+
490
+ nextTr = dom.getNext(tr, 'tr');
491
+
492
+ // Move down row spanned cells
493
+ each(tr.cells, function(cell) {
494
+ var rowSpan = getSpanVal(cell, 'rowSpan');
495
+
496
+ if (rowSpan > 1) {
497
+ setSpanVal(cell, 'rowSpan', rowSpan - 1);
498
+ pos = getPos(cell);
499
+ fillLeftDown(pos.x, pos.y, 1, 1);
500
+ }
501
+ });
502
+
503
+ // Delete cells
504
+ pos = getPos(tr.cells[0]);
505
+ each(grid[pos.y], function(cell) {
506
+ var rowSpan;
507
+
508
+ cell = cell.elm;
509
+
510
+ if (cell != lastCell) {
511
+ rowSpan = getSpanVal(cell, 'rowSpan');
512
+
513
+ if (rowSpan <= 1)
514
+ dom.remove(cell);
515
+ else
516
+ setSpanVal(cell, 'rowSpan', rowSpan - 1);
517
+
518
+ lastCell = cell;
519
+ }
520
+ });
521
+ };
522
+
523
+ // Get selected rows and move selection out of scope
524
+ rows = getSelectedRows();
525
+
526
+ // Delete all selected rows
527
+ each(rows.reverse(), function(tr) {
528
+ deleteRow(tr);
529
+ });
530
+
531
+ cleanup();
532
+ };
533
+
534
+ function cutRows() {
535
+ var rows = getSelectedRows();
536
+
537
+ dom.remove(rows);
538
+ cleanup();
539
+
540
+ return rows;
541
+ };
542
+
543
+ function copyRows() {
544
+ var rows = getSelectedRows();
545
+
546
+ each(rows, function(row, i) {
547
+ rows[i] = cloneNode(row, true);
548
+ });
549
+
550
+ return rows;
551
+ };
552
+
553
+ function pasteRows(rows, before) {
554
+ var selectedRows = getSelectedRows(),
555
+ targetRow = selectedRows[before ? 0 : selectedRows.length - 1],
556
+ targetCellCount = targetRow.cells.length;
557
+
558
+ // Calc target cell count
559
+ each(grid, function(row) {
560
+ var match;
561
+
562
+ targetCellCount = 0;
563
+ each(row, function(cell, x) {
564
+ if (cell.real)
565
+ targetCellCount += cell.colspan;
566
+
567
+ if (cell.elm.parentNode == targetRow)
568
+ match = 1;
569
+ });
570
+
571
+ if (match)
572
+ return false;
573
+ });
574
+
575
+ if (!before)
576
+ rows.reverse();
577
+
578
+ each(rows, function(row) {
579
+ var cellCount = row.cells.length, cell;
580
+
581
+ // Remove col/rowspans
582
+ for (i = 0; i < cellCount; i++) {
583
+ cell = row.cells[i];
584
+ setSpanVal(cell, 'colSpan', 1);
585
+ setSpanVal(cell, 'rowSpan', 1);
586
+ }
587
+
588
+ // Needs more cells
589
+ for (i = cellCount; i < targetCellCount; i++)
590
+ row.appendChild(cloneCell(row.cells[cellCount - 1]));
591
+
592
+ // Needs less cells
593
+ for (i = targetCellCount; i < cellCount; i++)
594
+ dom.remove(row.cells[i]);
595
+
596
+ // Add before/after
597
+ if (before)
598
+ targetRow.parentNode.insertBefore(row, targetRow);
599
+ else
600
+ dom.insertAfter(row, targetRow);
601
+ });
602
+ };
603
+
604
+ function getPos(target) {
605
+ var pos;
606
+
607
+ each(grid, function(row, y) {
608
+ each(row, function(cell, x) {
609
+ if (cell.elm == target) {
610
+ pos = {x : x, y : y};
611
+ return false;
612
+ }
613
+ });
614
+
615
+ return !pos;
616
+ });
617
+
618
+ return pos;
619
+ };
620
+
621
+ function setStartCell(cell) {
622
+ startPos = getPos(cell);
623
+ };
624
+
625
+ function findEndPos() {
626
+ var pos, maxX, maxY;
627
+
628
+ maxX = maxY = 0;
629
+
630
+ each(grid, function(row, y) {
631
+ each(row, function(cell, x) {
632
+ var colSpan, rowSpan;
633
+
634
+ if (isCellSelected(cell)) {
635
+ cell = grid[y][x];
636
+
637
+ if (x > maxX)
638
+ maxX = x;
639
+
640
+ if (y > maxY)
641
+ maxY = y;
642
+
643
+ if (cell.real) {
644
+ colSpan = cell.colspan - 1;
645
+ rowSpan = cell.rowspan - 1;
646
+
647
+ if (colSpan) {
648
+ if (x + colSpan > maxX)
649
+ maxX = x + colSpan;
650
+ }
651
+
652
+ if (rowSpan) {
653
+ if (y + rowSpan > maxY)
654
+ maxY = y + rowSpan;
655
+ }
656
+ }
657
+ }
658
+ });
659
+ });
660
+
661
+ return {x : maxX, y : maxY};
662
+ };
663
+
664
+ function setEndCell(cell) {
665
+ var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan;
666
+
667
+ endPos = getPos(cell);
668
+
669
+ if (startPos && endPos) {
670
+ // Get start/end positions
671
+ startX = Math.min(startPos.x, endPos.x);
672
+ startY = Math.min(startPos.y, endPos.y);
673
+ endX = Math.max(startPos.x, endPos.x);
674
+ endY = Math.max(startPos.y, endPos.y);
675
+
676
+ // Expand end positon to include spans
677
+ maxX = endX;
678
+ maxY = endY;
679
+
680
+ // Expand startX
681
+ for (y = startY; y <= maxY; y++) {
682
+ cell = grid[y][startX];
683
+
684
+ if (!cell.real) {
685
+ if (startX - (cell.colspan - 1) < startX)
686
+ startX -= cell.colspan - 1;
687
+ }
688
+ }
689
+
690
+ // Expand startY
691
+ for (x = startX; x <= maxX; x++) {
692
+ cell = grid[startY][x];
693
+
694
+ if (!cell.real) {
695
+ if (startY - (cell.rowspan - 1) < startY)
696
+ startY -= cell.rowspan - 1;
697
+ }
698
+ }
699
+
700
+ // Find max X, Y
701
+ for (y = startY; y <= endY; y++) {
702
+ for (x = startX; x <= endX; x++) {
703
+ cell = grid[y][x];
704
+
705
+ if (cell.real) {
706
+ colSpan = cell.colspan - 1;
707
+ rowSpan = cell.rowspan - 1;
708
+
709
+ if (colSpan) {
710
+ if (x + colSpan > maxX)
711
+ maxX = x + colSpan;
712
+ }
713
+
714
+ if (rowSpan) {
715
+ if (y + rowSpan > maxY)
716
+ maxY = y + rowSpan;
717
+ }
718
+ }
719
+ }
720
+ }
721
+
722
+ // Remove current selection
723
+ dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
724
+
725
+ // Add new selection
726
+ for (y = startY; y <= maxY; y++) {
727
+ for (x = startX; x <= maxX; x++) {
728
+ if (grid[y][x])
729
+ dom.addClass(grid[y][x].elm, 'mceSelected');
730
+ }
731
+ }
732
+ }
733
+ };
734
+
735
+ // Expose to public
736
+ tinymce.extend(this, {
737
+ deleteTable : deleteTable,
738
+ split : split,
739
+ merge : merge,
740
+ insertRow : insertRow,
741
+ insertCol : insertCol,
742
+ deleteCols : deleteCols,
743
+ deleteRows : deleteRows,
744
+ cutRows : cutRows,
745
+ copyRows : copyRows,
746
+ pasteRows : pasteRows,
747
+ getPos : getPos,
748
+ setStartCell : setStartCell,
749
+ setEndCell : setEndCell
750
+ });
751
+ };
752
+
753
+ tinymce.create('tinymce.plugins.TablePlugin', {
754
+ init : function(ed, url) {
755
+ var winMan, clipboardRows, hasCellSelection = true; // Might be selected cells on reload
756
+
757
+ function createTableGrid(node) {
758
+ var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table');
759
+
760
+ if (tblElm)
761
+ return new TableGrid(tblElm, ed.dom, selection);
762
+ };
763
+
764
+ function cleanup() {
765
+ // Restore selection possibilities
766
+ ed.getBody().style.webkitUserSelect = '';
767
+
768
+ if (hasCellSelection) {
769
+ ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
770
+ hasCellSelection = false;
771
+ }
772
+ };
773
+
774
+ // Register buttons
775
+ each([
776
+ ['table', 'table.desc', 'mceInsertTable', true],
777
+ ['delete_table', 'table.del', 'mceTableDelete'],
778
+ ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'],
779
+ ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'],
780
+ ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'],
781
+ ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'],
782
+ ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'],
783
+ ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'],
784
+ ['row_props', 'table.row_desc', 'mceTableRowProps', true],
785
+ ['cell_props', 'table.cell_desc', 'mceTableCellProps', true],
786
+ ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true],
787
+ ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true]
788
+ ], function(c) {
789
+ ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]});
790
+ });
791
+
792
+ // Select whole table is a table border is clicked
793
+ if (!tinymce.isIE) {
794
+ ed.onClick.add(function(ed, e) {
795
+ e = e.target;
796
+
797
+ if (e.nodeName === 'TABLE') {
798
+ ed.selection.select(e);
799
+ ed.nodeChanged();
800
+ }
801
+ });
802
+ }
803
+
804
+ ed.onPreProcess.add(function(ed, args) {
805
+ var nodes, i, node, dom = ed.dom, value;
806
+
807
+ nodes = dom.select('table', args.node);
808
+ i = nodes.length;
809
+ while (i--) {
810
+ node = nodes[i];
811
+ dom.setAttrib(node, 'data-mce-style', '');
812
+
813
+ if ((value = dom.getAttrib(node, 'width'))) {
814
+ dom.setStyle(node, 'width', value);
815
+ dom.setAttrib(node, 'width', '');
816
+ }
817
+
818
+ if ((value = dom.getAttrib(node, 'height'))) {
819
+ dom.setStyle(node, 'height', value);
820
+ dom.setAttrib(node, 'height', '');
821
+ }
822
+ }
823
+ });
824
+
825
+ // Handle node change updates
826
+ ed.onNodeChange.add(function(ed, cm, n) {
827
+ var p;
828
+
829
+ n = ed.selection.getStart();
830
+ p = ed.dom.getParent(n, 'td,th,caption');
831
+ cm.setActive('table', n.nodeName === 'TABLE' || !!p);
832
+
833
+ // Disable table tools if we are in caption
834
+ if (p && p.nodeName === 'CAPTION')
835
+ p = 0;
836
+
837
+ cm.setDisabled('delete_table', !p);
838
+ cm.setDisabled('delete_col', !p);
839
+ cm.setDisabled('delete_table', !p);
840
+ cm.setDisabled('delete_row', !p);
841
+ cm.setDisabled('col_after', !p);
842
+ cm.setDisabled('col_before', !p);
843
+ cm.setDisabled('row_after', !p);
844
+ cm.setDisabled('row_before', !p);
845
+ cm.setDisabled('row_props', !p);
846
+ cm.setDisabled('cell_props', !p);
847
+ cm.setDisabled('split_cells', !p);
848
+ cm.setDisabled('merge_cells', !p);
849
+ });
850
+
851
+ ed.onInit.add(function(ed) {
852
+ var startTable, startCell, dom = ed.dom, tableGrid;
853
+
854
+ winMan = ed.windowManager;
855
+
856
+ // Add cell selection logic
857
+ ed.onMouseDown.add(function(ed, e) {
858
+ if (e.button != 2) {
859
+ cleanup();
860
+
861
+ startCell = dom.getParent(e.target, 'td,th');
862
+ startTable = dom.getParent(startCell, 'table');
863
+ }
864
+ });
865
+
866
+ dom.bind(ed.getDoc(), 'mouseover', function(e) {
867
+ var sel, table, target = e.target;
868
+
869
+ if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) {
870
+ table = dom.getParent(target, 'table');
871
+ if (table == startTable) {
872
+ if (!tableGrid) {
873
+ tableGrid = createTableGrid(table);
874
+ tableGrid.setStartCell(startCell);
875
+
876
+ ed.getBody().style.webkitUserSelect = 'none';
877
+ }
878
+
879
+ tableGrid.setEndCell(target);
880
+ hasCellSelection = true;
881
+ }
882
+
883
+ // Remove current selection
884
+ sel = ed.selection.getSel();
885
+
886
+ try {
887
+ if (sel.removeAllRanges)
888
+ sel.removeAllRanges();
889
+ else
890
+ sel.empty();
891
+ } catch (ex) {
892
+ // IE9 might throw errors here
893
+ }
894
+
895
+ e.preventDefault();
896
+ }
897
+ });
898
+
899
+ ed.onMouseUp.add(function(ed, e) {
900
+ var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode;
901
+
902
+ // Move selection to startCell
903
+ if (startCell) {
904
+ if (tableGrid)
905
+ ed.getBody().style.webkitUserSelect = '';
906
+
907
+ function setPoint(node, start) {
908
+ var walker = new tinymce.dom.TreeWalker(node, node);
909
+
910
+ do {
911
+ // Text node
912
+ if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) {
913
+ if (start)
914
+ rng.setStart(node, 0);
915
+ else
916
+ rng.setEnd(node, node.nodeValue.length);
917
+
918
+ return;
919
+ }
920
+
921
+ // BR element
922
+ if (node.nodeName == 'BR') {
923
+ if (start)
924
+ rng.setStartBefore(node);
925
+ else
926
+ rng.setEndBefore(node);
927
+
928
+ return;
929
+ }
930
+ } while (node = (start ? walker.next() : walker.prev()));
931
+ }
932
+
933
+ // Try to expand text selection as much as we can only Gecko supports cell selection
934
+ selectedCells = dom.select('td.mceSelected,th.mceSelected');
935
+ if (selectedCells.length > 0) {
936
+ rng = dom.createRng();
937
+ node = selectedCells[0];
938
+ endNode = selectedCells[selectedCells.length - 1];
939
+ rng.setStartBefore(node);
940
+ rng.setEndAfter(node);
941
+
942
+ setPoint(node, 1);
943
+ walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table'));
944
+
945
+ do {
946
+ if (node.nodeName == 'TD' || node.nodeName == 'TH') {
947
+ if (!dom.hasClass(node, 'mceSelected'))
948
+ break;
949
+
950
+ lastNode = node;
951
+ }
952
+ } while (node = walker.next());
953
+
954
+ setPoint(lastNode);
955
+
956
+ sel.setRng(rng);
957
+ }
958
+
959
+ ed.nodeChanged();
960
+ startCell = tableGrid = startTable = null;
961
+ }
962
+ });
963
+
964
+ ed.onKeyUp.add(function(ed, e) {
965
+ cleanup();
966
+ });
967
+
968
+ ed.onKeyDown.add(function (ed, e) {
969
+ fixTableCellSelection(ed);
970
+ });
971
+
972
+ ed.onMouseDown.add(function (ed, e) {
973
+ if (e.button != 2) {
974
+ fixTableCellSelection(ed);
975
+ }
976
+ });
977
+ function tableCellSelected(ed, rng, n, currentCell) {
978
+ // The decision of when a table cell is selected is somewhat involved. The fact that this code is
979
+ // required is actually a pointer to the root cause of this bug. A cell is selected when the start
980
+ // and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases)
981
+ // or the parent of the table (in the case of the selection containing the last cell of a table).
982
+ var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'),
983
+ tableParent, allOfCellSelected, tableCellSelection;
984
+ if (table)
985
+ tableParent = table.parentNode;
986
+ allOfCellSelected =rng.startContainer.nodeType == TEXT_NODE &&
987
+ rng.startOffset == 0 &&
988
+ rng.endOffset == 0 &&
989
+ currentCell &&
990
+ (n.nodeName=="TR" || n==tableParent);
991
+ tableCellSelection = (n.nodeName=="TD"||n.nodeName=="TH")&& !currentCell;
992
+ return allOfCellSelected || tableCellSelection;
993
+ // return false;
994
+ }
995
+
996
+ // this nasty hack is here to work around some WebKit selection bugs.
997
+ function fixTableCellSelection(ed) {
998
+ if (!tinymce.isWebKit)
999
+ return;
1000
+
1001
+ var rng = ed.selection.getRng();
1002
+ var n = ed.selection.getNode();
1003
+ var currentCell = ed.dom.getParent(rng.startContainer, 'TD,TH');
1004
+
1005
+ if (!tableCellSelected(ed, rng, n, currentCell))
1006
+ return;
1007
+ if (!currentCell) {
1008
+ currentCell=n;
1009
+ }
1010
+
1011
+ // Get the very last node inside the table cell
1012
+ var end = currentCell.lastChild;
1013
+ while (end.lastChild)
1014
+ end = end.lastChild;
1015
+
1016
+ // Select the entire table cell. Nothing outside of the table cell should be selected.
1017
+ rng.setEnd(end, end.nodeValue.length);
1018
+ ed.selection.setRng(rng);
1019
+ }
1020
+ ed.plugins.table.fixTableCellSelection=fixTableCellSelection;
1021
+
1022
+ // Add context menu
1023
+ if (ed && ed.plugins.contextmenu) {
1024
+ ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
1025
+ var sm, se = ed.selection, el = se.getNode() || ed.getBody();
1026
+
1027
+ if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) {
1028
+ m.removeAll();
1029
+
1030
+ if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) {
1031
+ m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});
1032
+ m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});
1033
+ m.addSeparator();
1034
+ }
1035
+
1036
+ if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) {
1037
+ m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
1038
+ m.addSeparator();
1039
+ }
1040
+
1041
+ m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}});
1042
+ m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'});
1043
+ m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'});
1044
+ m.addSeparator();
1045
+
1046
+ // Cell menu
1047
+ sm = m.addMenu({title : 'table.cell'});
1048
+ sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'});
1049
+ sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'});
1050
+ sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'});
1051
+
1052
+ // Row menu
1053
+ sm = m.addMenu({title : 'table.row'});
1054
+ sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'});
1055
+ sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'});
1056
+ sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'});
1057
+ sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'});
1058
+ sm.addSeparator();
1059
+ sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'});
1060
+ sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'});
1061
+ sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows);
1062
+ sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows);
1063
+
1064
+ // Column menu
1065
+ sm = m.addMenu({title : 'table.col'});
1066
+ sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'});
1067
+ sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'});
1068
+ sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'});
1069
+ } else
1070
+ m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'});
1071
+ });
1072
+ }
1073
+
1074
+ // Fix to allow navigating up and down in a table in WebKit browsers.
1075
+ if (tinymce.isWebKit) {
1076
+ function moveSelection(ed, e) {
1077
+ var VK = tinymce.VK;
1078
+ var key = e.keyCode;
1079
+
1080
+ function handle(upBool, sourceNode, event) {
1081
+ var siblingDirection = upBool ? 'previousSibling' : 'nextSibling';
1082
+ var currentRow = ed.dom.getParent(sourceNode, 'tr');
1083
+ var siblingRow = currentRow[siblingDirection];
1084
+
1085
+ if (siblingRow) {
1086
+ moveCursorToRow(ed, sourceNode, siblingRow, upBool);
1087
+ tinymce.dom.Event.cancel(event);
1088
+ return true;
1089
+ } else {
1090
+ var tableNode = ed.dom.getParent(currentRow, 'table');
1091
+ var middleNode = currentRow.parentNode;
1092
+ var parentNodeName = middleNode.nodeName.toLowerCase();
1093
+ if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) {
1094
+ var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody');
1095
+ if (targetParent !== null) {
1096
+ return moveToRowInTarget(upBool, targetParent, sourceNode, event);
1097
+ }
1098
+ }
1099
+ return escapeTable(upBool, currentRow, siblingDirection, tableNode, event);
1100
+ }
1101
+ }
1102
+
1103
+ function getTargetParent(upBool, topNode, secondNode, nodeName) {
1104
+ var tbodies = ed.dom.select('>' + nodeName, topNode);
1105
+ var position = tbodies.indexOf(secondNode);
1106
+ if (upBool && position === 0 || !upBool && position === tbodies.length - 1) {
1107
+ return getFirstHeadOrFoot(upBool, topNode);
1108
+ } else if (position === -1) {
1109
+ var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1;
1110
+ return tbodies[topOrBottom];
1111
+ } else {
1112
+ return tbodies[position + (upBool ? -1 : 1)];
1113
+ }
1114
+ }
1115
+
1116
+ function getFirstHeadOrFoot(upBool, parent) {
1117
+ var tagName = upBool ? 'thead' : 'tfoot';
1118
+ var headOrFoot = ed.dom.select('>' + tagName, parent);
1119
+ return headOrFoot.length !== 0 ? headOrFoot[0] : null;
1120
+ }
1121
+
1122
+ function moveToRowInTarget(upBool, targetParent, sourceNode, event) {
1123
+ var targetRow = getChildForDirection(targetParent, upBool);
1124
+ targetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool);
1125
+ tinymce.dom.Event.cancel(event);
1126
+ return true;
1127
+ }
1128
+
1129
+ function escapeTable(upBool, currentRow, siblingDirection, table, event) {
1130
+ var tableSibling = table[siblingDirection];
1131
+ if (tableSibling) {
1132
+ moveCursorToStartOfElement(tableSibling);
1133
+ return true;
1134
+ } else {
1135
+ var parentCell = ed.dom.getParent(table, 'td,th');
1136
+ if (parentCell) {
1137
+ return handle(upBool, parentCell, event);
1138
+ } else {
1139
+ var backUpSibling = getChildForDirection(currentRow, !upBool);
1140
+ moveCursorToStartOfElement(backUpSibling);
1141
+ return tinymce.dom.Event.cancel(event);
1142
+ }
1143
+ }
1144
+ }
1145
+
1146
+ function getChildForDirection(parent, up) {
1147
+ return parent && parent[up ? 'lastChild' : 'firstChild'];
1148
+ }
1149
+
1150
+ function moveCursorToStartOfElement(n) {
1151
+ ed.selection.setCursorLocation(n, 0);
1152
+ }
1153
+
1154
+ function isVerticalMovement() {
1155
+ return key == VK.UP || key == VK.DOWN;
1156
+ }
1157
+
1158
+ function isInTable(ed) {
1159
+ var node = ed.selection.getNode();
1160
+ var currentRow = ed.dom.getParent(node, 'tr');
1161
+ return currentRow !== null;
1162
+ }
1163
+
1164
+ function columnIndex(column) {
1165
+ var colIndex = 0;
1166
+ var c = column;
1167
+ while (c.previousSibling) {
1168
+ c = c.previousSibling;
1169
+ colIndex = colIndex + getSpanVal(c, "colspan");
1170
+ }
1171
+ return colIndex;
1172
+ }
1173
+
1174
+ function findColumn(rowElement, columnIndex) {
1175
+ var c = 0;
1176
+ var r = 0;
1177
+ each(rowElement.children, function(cell, i) {
1178
+ c = c + getSpanVal(cell, "colspan");
1179
+ r = i;
1180
+ if (c > columnIndex)
1181
+ return false;
1182
+ });
1183
+ return r;
1184
+ }
1185
+
1186
+ function moveCursorToRow(ed, node, row, upBool) {
1187
+ var srcColumnIndex = columnIndex(ed.dom.getParent(node, 'td,th'));
1188
+ var tgtColumnIndex = findColumn(row, srcColumnIndex);
1189
+ var tgtNode = row.childNodes[tgtColumnIndex];
1190
+ var rowCellTarget = getChildForDirection(tgtNode, upBool);
1191
+ moveCursorToStartOfElement(rowCellTarget || tgtNode);
1192
+ }
1193
+
1194
+ function shouldFixCaret(preBrowserNode) {
1195
+ var newNode = ed.selection.getNode();
1196
+ var newParent = ed.dom.getParent(newNode, 'td,th');
1197
+ var oldParent = ed.dom.getParent(preBrowserNode, 'td,th');
1198
+ return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent)
1199
+ }
1200
+
1201
+ function checkSameParentTable(nodeOne, NodeTwo) {
1202
+ return ed.dom.getParent(nodeOne, 'TABLE') === ed.dom.getParent(NodeTwo, 'TABLE');
1203
+ }
1204
+
1205
+ if (isVerticalMovement() && isInTable(ed)) {
1206
+ var preBrowserNode = ed.selection.getNode();
1207
+ setTimeout(function() {
1208
+ if (shouldFixCaret(preBrowserNode)) {
1209
+ handle(!e.shiftKey && key === VK.UP, preBrowserNode, e);
1210
+ }
1211
+ }, 0);
1212
+ }
1213
+ }
1214
+
1215
+ ed.onKeyDown.add(moveSelection);
1216
+ }
1217
+
1218
+ // Fixes an issue on Gecko where it's impossible to place the caret behind a table
1219
+ // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled
1220
+ if (!tinymce.isIE) {
1221
+ function fixTableCaretPos() {
1222
+ var last;
1223
+
1224
+ // Skip empty text nodes form the end
1225
+ for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;
1226
+
1227
+ if (last && last.nodeName == 'TABLE')
1228
+ ed.dom.add(ed.getBody(), 'p', null, '<br mce_bogus="1" />');
1229
+ };
1230
+
1231
+ // Fixes an bug where it's impossible to place the caret before a table in Gecko
1232
+ // this fix solves it by detecting when the caret is at the beginning of such a table
1233
+ // and then manually moves the caret infront of the table
1234
+ if (tinymce.isGecko) {
1235
+ ed.onKeyDown.add(function(ed, e) {
1236
+ var rng, table, dom = ed.dom;
1237
+
1238
+ // On gecko it's not possible to place the caret before a table
1239
+ if (e.keyCode == 37 || e.keyCode == 38) {
1240
+ rng = ed.selection.getRng();
1241
+ table = dom.getParent(rng.startContainer, 'table');
1242
+
1243
+ if (table && ed.getBody().firstChild == table) {
1244
+ if (isAtStart(rng, table)) {
1245
+ rng = dom.createRng();
1246
+
1247
+ rng.setStartBefore(table);
1248
+ rng.setEndBefore(table);
1249
+
1250
+ ed.selection.setRng(rng);
1251
+
1252
+ e.preventDefault();
1253
+ }
1254
+ }
1255
+ }
1256
+ });
1257
+ }
1258
+
1259
+ ed.onKeyUp.add(fixTableCaretPos);
1260
+ ed.onSetContent.add(fixTableCaretPos);
1261
+ ed.onVisualAid.add(fixTableCaretPos);
1262
+
1263
+ ed.onPreProcess.add(function(ed, o) {
1264
+ var last = o.node.lastChild;
1265
+
1266
+ if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR')
1267
+ ed.dom.remove(last);
1268
+ });
1269
+
1270
+ fixTableCaretPos();
1271
+ ed.startContent = ed.getContent({format : 'raw'});
1272
+ }
1273
+ });
1274
+
1275
+ // Register action commands
1276
+ each({
1277
+ mceTableSplitCells : function(grid) {
1278
+ grid.split();
1279
+ },
1280
+
1281
+ mceTableMergeCells : function(grid) {
1282
+ var rowSpan, colSpan, cell;
1283
+
1284
+ cell = ed.dom.getParent(ed.selection.getNode(), 'th,td');
1285
+ if (cell) {
1286
+ rowSpan = cell.rowSpan;
1287
+ colSpan = cell.colSpan;
1288
+ }
1289
+
1290
+ if (!ed.dom.select('td.mceSelected,th.mceSelected').length) {
1291
+ winMan.open({
1292
+ url : url + '/merge_cells.htm',
1293
+ width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)),
1294
+ height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)),
1295
+ inline : 1
1296
+ }, {
1297
+ rows : rowSpan,
1298
+ cols : colSpan,
1299
+ onaction : function(data) {
1300
+ grid.merge(cell, data.cols, data.rows);
1301
+ },
1302
+ plugin_url : url
1303
+ });
1304
+ } else
1305
+ grid.merge();
1306
+ },
1307
+
1308
+ mceTableInsertRowBefore : function(grid) {
1309
+ grid.insertRow(true);
1310
+ },
1311
+
1312
+ mceTableInsertRowAfter : function(grid) {
1313
+ grid.insertRow();
1314
+ },
1315
+
1316
+ mceTableInsertColBefore : function(grid) {
1317
+ grid.insertCol(true);
1318
+ },
1319
+
1320
+ mceTableInsertColAfter : function(grid) {
1321
+ grid.insertCol();
1322
+ },
1323
+
1324
+ mceTableDeleteCol : function(grid) {
1325
+ grid.deleteCols();
1326
+ },
1327
+
1328
+ mceTableDeleteRow : function(grid) {
1329
+ grid.deleteRows();
1330
+ },
1331
+
1332
+ mceTableCutRow : function(grid) {
1333
+ clipboardRows = grid.cutRows();
1334
+ },
1335
+
1336
+ mceTableCopyRow : function(grid) {
1337
+ clipboardRows = grid.copyRows();
1338
+ },
1339
+
1340
+ mceTablePasteRowBefore : function(grid) {
1341
+ grid.pasteRows(clipboardRows, true);
1342
+ },
1343
+
1344
+ mceTablePasteRowAfter : function(grid) {
1345
+ grid.pasteRows(clipboardRows);
1346
+ },
1347
+
1348
+ mceTableDelete : function(grid) {
1349
+ grid.deleteTable();
1350
+ }
1351
+ }, function(func, name) {
1352
+ ed.addCommand(name, function() {
1353
+ var grid = createTableGrid();
1354
+
1355
+ if (grid) {
1356
+ func(grid);
1357
+ ed.execCommand('mceRepaint');
1358
+ cleanup();
1359
+ }
1360
+ });
1361
+ });
1362
+
1363
+ // Register dialog commands
1364
+ each({
1365
+ mceInsertTable : function(val) {
1366
+ winMan.open({
1367
+ url : url + '/table.htm',
1368
+ width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)),
1369
+ height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)),
1370
+ inline : 1
1371
+ }, {
1372
+ plugin_url : url,
1373
+ action : val ? val.action : 0
1374
+ });
1375
+ },
1376
+
1377
+ mceTableRowProps : function() {
1378
+ winMan.open({
1379
+ url : url + '/row.htm',
1380
+ width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)),
1381
+ height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)),
1382
+ inline : 1
1383
+ }, {
1384
+ plugin_url : url
1385
+ });
1386
+ },
1387
+
1388
+ mceTableCellProps : function() {
1389
+ winMan.open({
1390
+ url : url + '/cell.htm',
1391
+ width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)),
1392
+ height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)),
1393
+ inline : 1
1394
+ }, {
1395
+ plugin_url : url
1396
+ });
1397
+ }
1398
+ }, function(func, name) {
1399
+ ed.addCommand(name, function(ui, val) {
1400
+ func(val);
1401
+ });
1402
+ });
1403
+ }
1404
+ });
1405
+
1406
+ // Register plugin
1407
+ tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin);
1408
+ })(tinymce);
tiny_mce/plugins/table/js/cell.js CHANGED
@@ -24,7 +24,7 @@ function init() {
24
  var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));
25
  var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor'));
26
  var className = ed.dom.getAttrib(tdElm, 'class');
27
- var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
28
  var id = ed.dom.getAttrib(tdElm, 'id');
29
  var lang = ed.dom.getAttrib(tdElm, 'lang');
30
  var dir = ed.dom.getAttrib(tdElm, 'dir');
@@ -63,6 +63,11 @@ function init() {
63
  function updateAction() {
64
  var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0];
65
 
 
 
 
 
 
66
  tinyMCEPopup.restoreSelection();
67
  el = ed.selection.getStart();
68
  tdElm = ed.dom.getParent(el, "td,th");
@@ -83,8 +88,6 @@ function updateAction() {
83
  return;
84
  }
85
 
86
- ed.execCommand('mceBeginUndoLevel');
87
-
88
  switch (getSelectValue(formObj, 'action')) {
89
  case "cell":
90
  var celltype = getSelectValue(formObj, 'celltype');
@@ -125,6 +128,36 @@ function updateAction() {
125
 
126
  break;
127
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  case "all":
129
  var rows = tableElm.getElementsByTagName("tr");
130
 
@@ -166,15 +199,15 @@ function updateCell(td, skip_id) {
166
  var dom = ed.dom;
167
 
168
  if (!skip_id)
169
- td.setAttribute('id', formObj.id.value);
170
-
171
- td.setAttribute('align', formObj.align.value);
172
- td.setAttribute('vAlign', formObj.valign.value);
173
- td.setAttribute('lang', formObj.lang.value);
174
- td.setAttribute('dir', getSelectValue(formObj, 'dir'));
175
- td.setAttribute('style', ed.dom.serializeStyle(ed.dom.parseStyle(formObj.style.value)));
176
- td.setAttribute('scope', formObj.scope.value);
177
- ed.dom.setAttrib(td, 'class', getSelectValue(formObj, 'class'));
178
 
179
  // Clear deprecated attributes
180
  ed.dom.setAttrib(td, 'width', '');
24
  var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));
25
  var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor'));
26
  var className = ed.dom.getAttrib(tdElm, 'class');
27
+ var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1");
28
  var id = ed.dom.getAttrib(tdElm, 'id');
29
  var lang = ed.dom.getAttrib(tdElm, 'lang');
30
  var dir = ed.dom.getAttrib(tdElm, 'dir');
63
  function updateAction() {
64
  var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0];
65
 
66
+ if (!AutoValidator.validate(formObj)) {
67
+ tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.');
68
+ return false;
69
+ }
70
+
71
  tinyMCEPopup.restoreSelection();
72
  el = ed.selection.getStart();
73
  tdElm = ed.dom.getParent(el, "td,th");
88
  return;
89
  }
90
 
 
 
91
  switch (getSelectValue(formObj, 'action')) {
92
  case "cell":
93
  var celltype = getSelectValue(formObj, 'celltype');
128
 
129
  break;
130
 
131
+ case "col":
132
+ var curr, col = 0, cell = trElm.firstChild, rows = tableElm.getElementsByTagName("tr");
133
+
134
+ if (cell.nodeName != "TD" && cell.nodeName != "TH")
135
+ cell = nextCell(cell);
136
+
137
+ do {
138
+ if (cell == tdElm)
139
+ break;
140
+ col += cell.getAttribute("colspan");
141
+ } while ((cell = nextCell(cell)) != null);
142
+
143
+ for (var i=0; i<rows.length; i++) {
144
+ cell = rows[i].firstChild;
145
+
146
+ if (cell.nodeName != "TD" && cell.nodeName != "TH")
147
+ cell = nextCell(cell);
148
+
149
+ curr = 0;
150
+ do {
151
+ if (curr == col) {
152
+ cell = updateCell(cell, true);
153
+ break;
154
+ }
155
+ curr += cell.getAttribute("colspan");
156
+ } while ((cell = nextCell(cell)) != null);
157
+ }
158
+
159
+ break;
160
+
161
  case "all":
162
  var rows = tableElm.getElementsByTagName("tr");
163
 
199
  var dom = ed.dom;
200
 
201
  if (!skip_id)
202
+ dom.setAttrib(td, 'id', formObj.id.value);
203
+
204
+ dom.setAttrib(td, 'align', formObj.align.value);
205
+ dom.setAttrib(td, 'vAlign', formObj.valign.value);
206
+ dom.setAttrib(td, 'lang', formObj.lang.value);
207
+ dom.setAttrib(td, 'dir', getSelectValue(formObj, 'dir'));
208
+ dom.setAttrib(td, 'style', ed.dom.serializeStyle(ed.dom.parseStyle(formObj.style.value)));
209
+ dom.setAttrib(td, 'scope', formObj.scope.value);
210
+ dom.setAttrib(td, 'class', getSelectValue(formObj, 'class'));
211
 
212
  // Clear deprecated attributes
213
  ed.dom.setAttrib(td, 'width', '');
tiny_mce/plugins/table/js/row.js CHANGED
@@ -19,7 +19,7 @@ function init() {
19
  var height = trimSize(getStyle(trElm, 'height', 'height'));
20
  var className = dom.getAttrib(trElm, 'class');
21
  var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor'));
22
- var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
23
  var id = dom.getAttrib(trElm, 'id');
24
  var lang = dom.getAttrib(trElm, 'lang');
25
  var dir = dom.getAttrib(trElm, 'dir');
@@ -56,6 +56,11 @@ function updateAction() {
56
  var inst = tinyMCEPopup.editor, dom = inst.dom, trElm, tableElm, formObj = document.forms[0];
57
  var action = getSelectValue(formObj, 'action');
58
 
 
 
 
 
 
59
  tinyMCEPopup.restoreSelection();
60
  trElm = dom.getParent(inst.selection.getStart(), "tr");
61
  tableElm = dom.getParent(inst.selection.getStart(), "table");
@@ -80,8 +85,6 @@ function updateAction() {
80
  return;
81
  }
82
 
83
- inst.execCommand('mceBeginUndoLevel');
84
-
85
  switch (action) {
86
  case "row":
87
  updateRow(trElm);
@@ -123,19 +126,19 @@ function updateRow(tr_elm, skip_id, skip_parent) {
123
 
124
  // Update row element
125
  if (!skip_id)
126
- tr_elm.setAttribute('id', formObj.id.value);
127
 
128
- tr_elm.setAttribute('align', getSelectValue(formObj, 'align'));
129
- tr_elm.setAttribute('vAlign', getSelectValue(formObj, 'valign'));
130
- tr_elm.setAttribute('lang', formObj.lang.value);
131
- tr_elm.setAttribute('dir', getSelectValue(formObj, 'dir'));
132
- tr_elm.setAttribute('style', dom.serializeStyle(dom.parseStyle(formObj.style.value)));
133
  dom.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class'));
134
 
135
  // Clear deprecated attributes
136
- tr_elm.setAttribute('background', '');
137
- tr_elm.setAttribute('bgColor', '');
138
- tr_elm.setAttribute('height', '');
139
 
140
  // Set styles
141
  tr_elm.style.height = getCSSSize(formObj.height.value);
@@ -163,13 +166,10 @@ function updateRow(tr_elm, skip_id, skip_parent) {
163
  if (newParent == null) {
164
  newParent = doc.createElement(dest);
165
 
166
- if (dest == "thead") {
167
- if (theTable.firstChild.nodeName == 'CAPTION')
168
- inst.dom.insertAfter(newParent, theTable.firstChild);
169
- else
170
- theTable.insertBefore(newParent, theTable.firstChild);
171
- } else
172
- theTable.appendChild(newParent);
173
  }
174
 
175
  // append the row to the new parent
19
  var height = trimSize(getStyle(trElm, 'height', 'height'));
20
  var className = dom.getAttrib(trElm, 'class');
21
  var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor'));
22
+ var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1");
23
  var id = dom.getAttrib(trElm, 'id');
24
  var lang = dom.getAttrib(trElm, 'lang');
25
  var dir = dom.getAttrib(trElm, 'dir');
56
  var inst = tinyMCEPopup.editor, dom = inst.dom, trElm, tableElm, formObj = document.forms[0];
57
  var action = getSelectValue(formObj, 'action');
58
 
59
+ if (!AutoValidator.validate(formObj)) {
60
+ tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.');
61
+ return false;
62
+ }
63
+
64
  tinyMCEPopup.restoreSelection();
65
  trElm = dom.getParent(inst.selection.getStart(), "tr");
66
  tableElm = dom.getParent(inst.selection.getStart(), "table");
85
  return;
86
  }
87
 
 
 
88
  switch (action) {
89
  case "row":
90
  updateRow(trElm);
126
 
127
  // Update row element
128
  if (!skip_id)
129
+ dom.setAttrib(tr_elm, 'id', formObj.id.value);
130
 
131
+ dom.setAttrib(tr_elm, 'align', getSelectValue(formObj, 'align'));
132
+ dom.setAttrib(tr_elm, 'vAlign', getSelectValue(formObj, 'valign'));
133
+ dom.setAttrib(tr_elm, 'lang', formObj.lang.value);
134
+ dom.setAttrib(tr_elm, 'dir', getSelectValue(formObj, 'dir'));
135
+ dom.setAttrib(tr_elm, 'style', dom.serializeStyle(dom.parseStyle(formObj.style.value)));
136
  dom.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class'));
137
 
138
  // Clear deprecated attributes
139
+ dom.setAttrib(tr_elm, 'background', '');
140
+ dom.setAttrib(tr_elm, 'bgColor', '');
141
+ dom.setAttrib(tr_elm, 'height', '');
142
 
143
  // Set styles
144
  tr_elm.style.height = getCSSSize(formObj.height.value);
166
  if (newParent == null) {
167
  newParent = doc.createElement(dest);
168
 
169
+ if (theTable.firstChild.nodeName == 'CAPTION')
170
+ inst.dom.insertAfter(newParent, theTable.firstChild);
171
+ else
172
+ theTable.insertBefore(newParent, theTable.firstChild);
 
 
 
173
  }
174
 
175
  // append the row to the new parent
tiny_mce/plugins/table/js/table.js CHANGED
@@ -12,7 +12,7 @@ function insertTable() {
12
  tinyMCEPopup.restoreSelection();
13
 
14
  if (!AutoValidator.validate(formObj)) {
15
- tinyMCEPopup.alert(inst.getLang('invalid_data'));
16
  return false;
17
  }
18
 
@@ -21,7 +21,7 @@ function insertTable() {
21
  // Get form data
22
  cols = formObj.elements['cols'].value;
23
  rows = formObj.elements['rows'].value;
24
- border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0;
25
  cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";
26
  cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";
27
  align = getSelectValue(formObj, "align");
@@ -58,11 +58,21 @@ function insertTable() {
58
 
59
  // Update table
60
  if (action == "update") {
61
- inst.execCommand('mceBeginUndoLevel');
62
-
63
  dom.setAttrib(elm, 'cellPadding', cellpadding, true);
64
  dom.setAttrib(elm, 'cellSpacing', cellspacing, true);
65
- dom.setAttrib(elm, 'border', border);
 
 
 
 
 
 
 
 
 
 
 
 
66
  dom.setAttrib(elm, 'align', align);
67
  dom.setAttrib(elm, 'frame', frame);
68
  dom.setAttrib(elm, 'rules', rules);
@@ -82,7 +92,7 @@ function insertTable() {
82
  capEl = elm.ownerDocument.createElement('caption');
83
 
84
  if (!tinymce.isIE)
85
- capEl.innerHTML = '<br _mce_bogus="1"/>';
86
 
87
  elm.insertBefore(capEl, elm.firstChild);
88
  }
@@ -121,7 +131,7 @@ function insertTable() {
121
  if (bordercolor != "") {
122
  elm.style.borderColor = bordercolor;
123
  elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle;
124
- elm.style.borderWidth = border == "" ? "1px" : border;
125
  } else
126
  elm.style.borderColor = '';
127
 
@@ -148,10 +158,13 @@ function insertTable() {
148
  html += '<table';
149
 
150
  html += makeAttrib('id', id);
151
- html += makeAttrib('border', border);
 
 
 
152
  html += makeAttrib('cellpadding', cellpadding);
153
  html += makeAttrib('cellspacing', cellspacing);
154
- html += makeAttrib('_mce_new', '1');
155
 
156
  if (width && inst.settings.inline_styles) {
157
  if (style)
@@ -187,7 +200,7 @@ function insertTable() {
187
 
188
  if (caption) {
189
  if (!tinymce.isIE)
190
- html += '<caption><br _mce_bogus="1"/></caption>';
191
  else
192
  html += '<caption></caption>';
193
  }
@@ -197,7 +210,7 @@ function insertTable() {
197
 
198
  for (var x=0; x<cols; x++) {
199
  if (!tinymce.isIE)
200
- html += '<td><br _mce_bogus="1"/></td>';
201
  else
202
  html += '<td></td>';
203
  }
@@ -207,8 +220,6 @@ function insertTable() {
207
 
208
  html += "</table>";
209
 
210
- inst.execCommand('mceBeginUndoLevel');
211
-
212
  // Move table
213
  if (inst.settings.fix_table_elements) {
214
  var patt = '';
@@ -231,13 +242,17 @@ function insertTable() {
231
  } else
232
  inst.execCommand('mceInsertContent', false, html);
233
 
234
- tinymce.each(dom.select('table[_mce_new]'), function(node) {
235
- var td = dom.select('td', node);
236
 
237
- inst.selection.select(td[0], true);
238
- inst.selection.collapse();
 
 
 
 
239
 
240
- dom.setAttrib(node, '_mce_new', '');
241
  });
242
 
243
  inst.addVisual();
@@ -279,7 +294,7 @@ function init() {
279
 
280
  var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', '');
281
  var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = "";
282
- var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules, frame;
283
  var inst = tinyMCEPopup.editor, dom = inst.dom;
284
  var formObj = document.forms[0];
285
  var elm = dom.getParent(inst.selection.getNode(), "table");
@@ -316,7 +331,7 @@ function init() {
316
  style = dom.serializeStyle(st);
317
  dir = dom.getAttrib(elm, 'dir');
318
  lang = dom.getAttrib(elm, 'lang');
319
- background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
320
  formObj.caption.checked = elm.getElementsByTagName('caption').length > 0;
321
 
322
  orgTableWidth = width;
@@ -383,6 +398,20 @@ function changedSize() {
383
  formObj.style.value = dom.serializeStyle(st);
384
  }
385
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386
  function changedBackgroundImage() {
387
  var formObj = document.forms[0];
388
  var st = dom.parseStyle(formObj.style.value);
@@ -397,8 +426,14 @@ function changedBorder() {
397
  var st = dom.parseStyle(formObj.style.value);
398
 
399
  // Update border width if the element has a color
400
- if (formObj.border.value != "" && formObj.bordercolor.value != "")
401
- st['border-width'] = formObj.border.value + "px";
 
 
 
 
 
 
402
 
403
  formObj.style.value = dom.serializeStyle(st);
404
  }
@@ -414,7 +449,7 @@ function changedColor() {
414
 
415
  // Add border-width if it's missing
416
  if (!st['border-width'])
417
- st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px";
418
  }
419
 
420
  formObj.style.value = dom.serializeStyle(st);
@@ -425,7 +460,7 @@ function changedStyle() {
425
  var st = dom.parseStyle(formObj.style.value);
426
 
427
  if (st['background-image'])
428
- formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
429
  else
430
  formObj.backgroundimage.value = '';
431
 
12
  tinyMCEPopup.restoreSelection();
13
 
14
  if (!AutoValidator.validate(formObj)) {
15
+ tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.');
16
  return false;
17
  }
18
 
21
  // Get form data
22
  cols = formObj.elements['cols'].value;
23
  rows = formObj.elements['rows'].value;
24
+ border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0;
25
  cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";
26
  cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";
27
  align = getSelectValue(formObj, "align");
58
 
59
  // Update table
60
  if (action == "update") {
 
 
61
  dom.setAttrib(elm, 'cellPadding', cellpadding, true);
62
  dom.setAttrib(elm, 'cellSpacing', cellspacing, true);
63
+
64
+ if (!isCssSize(border)) {
65
+ dom.setAttrib(elm, 'border', border);
66
+ } else {
67
+ dom.setAttrib(elm, 'border', '');
68
+ }
69
+
70
+ if (border == '') {
71
+ dom.setStyle(elm, 'border-width', '');
72
+ dom.setStyle(elm, 'border', '');
73
+ dom.setAttrib(elm, 'border', '');
74
+ }
75
+
76
  dom.setAttrib(elm, 'align', align);
77
  dom.setAttrib(elm, 'frame', frame);
78
  dom.setAttrib(elm, 'rules', rules);
92
  capEl = elm.ownerDocument.createElement('caption');
93
 
94
  if (!tinymce.isIE)
95
+ capEl.innerHTML = '<br data-mce-bogus="1"/>';
96
 
97
  elm.insertBefore(capEl, elm.firstChild);
98
  }
131
  if (bordercolor != "") {
132
  elm.style.borderColor = bordercolor;
133
  elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle;
134
+ elm.style.borderWidth = cssSize(border);
135
  } else
136
  elm.style.borderColor = '';
137
 
158
  html += '<table';
159
 
160
  html += makeAttrib('id', id);
161
+ if (!isCssSize(border)) {
162
+ html += makeAttrib('border', border);
163
+ }
164
+
165
  html += makeAttrib('cellpadding', cellpadding);
166
  html += makeAttrib('cellspacing', cellspacing);
167
+ html += makeAttrib('data-mce-new', '1');
168
 
169
  if (width && inst.settings.inline_styles) {
170
  if (style)
200
 
201
  if (caption) {
202
  if (!tinymce.isIE)
203
+ html += '<caption><br data-mce-bogus="1"/></caption>';
204
  else
205
  html += '<caption></caption>';
206
  }
210
 
211
  for (var x=0; x<cols; x++) {
212
  if (!tinymce.isIE)
213
+ html += '<td><br data-mce-bogus="1"/></td>';
214
  else
215
  html += '<td></td>';
216
  }
220
 
221
  html += "</table>";
222
 
 
 
223
  // Move table
224
  if (inst.settings.fix_table_elements) {
225
  var patt = '';
242
  } else
243
  inst.execCommand('mceInsertContent', false, html);
244
 
245
+ tinymce.each(dom.select('table[data-mce-new]'), function(node) {
246
+ var tdorth = dom.select('td,th', node);
247
 
248
+ try {
249
+ // IE9 might fail to do this selection
250
+ inst.selection.setCursorLocation(tdorth[0], 0);
251
+ } catch (ex) {
252
+ // Ignore
253
+ }
254
 
255
+ dom.setAttrib(node, 'data-mce-new', '');
256
  });
257
 
258
  inst.addVisual();
294
 
295
  var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', '');
296
  var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = "";
297
+ var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules = "", frame = "";
298
  var inst = tinyMCEPopup.editor, dom = inst.dom;
299
  var formObj = document.forms[0];
300
  var elm = dom.getParent(inst.selection.getNode(), "table");
331
  style = dom.serializeStyle(st);
332
  dir = dom.getAttrib(elm, 'dir');
333
  lang = dom.getAttrib(elm, 'lang');
334
+ background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1");
335
  formObj.caption.checked = elm.getElementsByTagName('caption').length > 0;
336
 
337
  orgTableWidth = width;
398
  formObj.style.value = dom.serializeStyle(st);
399
  }
400
 
401
+ function isCssSize(value) {
402
+ return /^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)$/.test(value);
403
+ }
404
+
405
+ function cssSize(value, def) {
406
+ value = tinymce.trim(value || def);
407
+
408
+ if (!isCssSize(value)) {
409
+ return parseInt(value, 10) + 'px';
410
+ }
411
+
412
+ return value;
413
+ }
414
+
415
  function changedBackgroundImage() {
416
  var formObj = document.forms[0];
417
  var st = dom.parseStyle(formObj.style.value);
426
  var st = dom.parseStyle(formObj.style.value);
427
 
428
  // Update border width if the element has a color
429
+ if (formObj.border.value != "" && (isCssSize(formObj.border.value) || formObj.bordercolor.value != ""))
430
+ st['border-width'] = cssSize(formObj.border.value);
431
+ else {
432
+ if (!formObj.border.value) {
433
+ st['border'] = '';
434
+ st['border-width'] = '';
435
+ }
436
+ }
437
 
438
  formObj.style.value = dom.serializeStyle(st);
439
  }
449
 
450
  // Add border-width if it's missing
451
  if (!st['border-width'])
452
+ st['border-width'] = cssSize(formObj.border.value, 1);
453
  }
454
 
455
  formObj.style.value = dom.serializeStyle(st);
460
  var st = dom.parseStyle(formObj.style.value);
461
 
462
  if (st['background-image'])
463
+ formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1");
464
  else
465
  formObj.backgroundimage.value = '';
466
 
tiny_mce/plugins/table/langs/en_dlg.js CHANGED
@@ -1,74 +1 @@
1
- tinyMCE.addI18n('en.table_dlg',{
2
- general_tab:"General",
3
- advanced_tab:"Advanced",
4
- general_props:"General properties",
5
- advanced_props:"Advanced properties",
6
- rowtype:"Row in table part",
7
- title:"Insert/Modify table",
8
- width:"Width",
9
- height:"Height",
10
- cols:"Cols",
11
- rows:"Rows",
12
- cellspacing:"Cellspacing",
13
- cellpadding:"Cellpadding",
14
- border:"Border",
15
- align:"Alignment",
16
- align_default:"Default",
17
- align_left:"Left",
18
- align_right:"Right",
19
- align_middle:"Center",
20
- row_title:"Table row properties",
21
- cell_title:"Table cell properties",
22
- cell_type:"Cell type",
23
- valign:"Vertical alignment",
24
- align_top:"Top",
25
- align_bottom:"Bottom",
26
- bordercolor:"Border color",
27
- bgcolor:"Background color",
28
- merge_cells_title:"Merge table cells",
29
- id:"Id",
30
- style:"Style",
31
- langdir:"Language direction",
32
- langcode:"Language code",
33
- mime:"Target MIME type",
34
- ltr:"Left to right",
35
- rtl:"Right to left",
36
- bgimage:"Background image",
37
- summary:"Summary",
38
- td:"Data",
39
- th:"Header",
40
- cell_cell:"Update current cell",
41
- cell_row:"Update all cells in row",
42
- cell_all:"Update all cells in table",
43
- row_row:"Update current row",
44
- row_odd:"Update odd rows in table",
45
- row_even:"Update even rows in table",
46
- row_all:"Update all rows in table",
47
- thead:"Table Head",
48
- tbody:"Table Body",
49
- tfoot:"Table Foot",
50
- scope:"Scope",
51
- rowgroup:"Row Group",
52
- colgroup:"Col Group",
53
- col_limit:"You've exceeded the maximum number of columns of {$cols}.",
54
- row_limit:"You've exceeded the maximum number of rows of {$rows}.",
55
- cell_limit:"You've exceeded the maximum number of cells of {$cells}.",
56
- missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",
57
- caption:"Table caption",
58
- frame:"Frame",
59
- frame_none:"none",
60
- frame_groups:"groups",
61
- frame_rows:"rows",
62
- frame_cols:"cols",
63
- frame_all:"all",
64
- rules:"Rules",
65
- rules_void:"void",
66
- rules_above:"above",
67
- rules_below:"below",
68
- rules_hsides:"hsides",
69
- rules_lhs:"lhs",
70
- rules_rhs:"rhs",
71
- rules_vsides:"vsides",
72
- rules_box:"box",
73
- rules_border:"border"
74
- });
1
+ tinyMCE.addI18n('en.table_dlg',{"rules_border":"border","rules_box":"box","rules_vsides":"vsides","rules_rhs":"rhs","rules_lhs":"lhs","rules_hsides":"hsides","rules_below":"below","rules_above":"above","rules_void":"void",rules:"Rules","frame_all":"all","frame_cols":"cols","frame_rows":"rows","frame_groups":"groups","frame_none":"none",frame:"Frame",caption:"Table Caption","missing_scope":"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.","cell_limit":"You\'ve exceeded the maximum number of cells of {$cells}.","row_limit":"You\'ve exceeded the maximum number of rows of {$rows}.","col_limit":"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Footer",tbody:"Body",thead:"Header","row_all":"Update All Rows in Table","row_even":"Update Even Rows in Table","row_odd":"Update Odd Rows in Table","row_row":"Update Current Row","cell_all":"Update All Cells in Table","cell_row":"Update All Cells in Row","cell_cell":"Update Current Cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background Image",rtl:"Right to Left",ltr:"Left to Right",mime:"Target MIME Type",langcode:"Language Code",langdir:"Language Direction",style:"Style",id:"ID","merge_cells_title":"Merge Table Cells",bgcolor:"Background Color",bordercolor:"Border Color","align_bottom":"Bottom","align_top":"Top",valign:"Vertical Alignment","cell_type":"Cell Type","cell_title":"Table Cell Properties","row_title":"Table Row Properties","align_middle":"Center","align_right":"Right","align_left":"Left","align_default":"Default",align:"Alignment",border:"Border",cellpadding:"Cell Padding",cellspacing:"Cell Spacing",rows:"Rows",cols:"Columns",height:"Height",width:"Width",title:"Insert/Edit Table",rowtype:"Row Type","advanced_props":"Advanced Properties","general_props":"General Properties","advanced_tab":"Advanced","general_tab":"General","cell_col":"Update all cells in column"});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
tiny_mce/plugins/table/merge_cells.htm CHANGED
@@ -7,20 +7,20 @@
7
  <script type="text/javascript" src="../../utils/validate.js"></script>
8
  <script type="text/javascript" src="js/merge_cells.js"></script>
9
  </head>
10
- <body style="margin: 8px">
11
  <form onsubmit="MergeCellsDialog.merge();return false;" action="#">
12
  <fieldset>
13
  <legend>{#table_dlg.merge_cells_title}</legend>
14
- <table border="0" cellpadding="0" cellspacing="3" width="100%">
15
- <tr>
16
- <td>{#table_dlg.cols}:</td>
17
- <td align="right"><input type="text" name="numcols" value="" class="number min1 mceFocus" style="width: 30px" /></td>
18
- </tr>
19
- <tr>
20
- <td>{#table_dlg.rows}:</td>
21
- <td align="right"><input type="text" name="numrows" value="" class="number min1" style="width: 30px" /></td>
22
- </tr>
23
- </table>
24
  </fieldset>
25
 
26
  <div class="mceActionPanel">
7
  <script type="text/javascript" src="../../utils/validate.js"></script>
8
  <script type="text/javascript" src="js/merge_cells.js"></script>
9
  </head>
10
+ <body style="margin: 8px" role="application">
11
  <form onsubmit="MergeCellsDialog.merge();return false;" action="#">
12
  <fieldset>
13
  <legend>{#table_dlg.merge_cells_title}</legend>
14
+ <table role="presentation" border="0" cellpadding="0" cellspacing="3" width="100%">
15
+ <tr>
16
+ <td><label for="numcols">{#table_dlg.cols}</label>:</td>
17
+ <td align="right"><input type="text" id="numcols" name="numcols" value="" class="number min1 mceFocus" style="width: 30px" aria-required="true" /></td>
18
+ </tr>
19
+ <tr>
20
+ <td><label for="numrows">{#table_dlg.rows}</label>:</td>
21
+ <td align="right"><input type="text" id="numrows" name="numrows" value="" class="number min1" style="width: 30px" aria-required="true" /></td>
22
+ </tr>
23
+ </table>
24
  </fieldset>
25
 
26
  <div class="mceActionPanel">
tiny_mce/plugins/table/row.htm CHANGED
@@ -5,16 +5,17 @@
5
  <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
  <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
  <script type="text/javascript" src="../../utils/form_utils.js"></script>
 
8
  <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9
  <script type="text/javascript" src="js/row.js"></script>
10
  <link href="css/row.css" rel="stylesheet" type="text/css" />
11
  </head>
12
- <body id="tablerow" style="display: none">
13
  <form onsubmit="updateAction();return false;" action="#">
14
  <div class="tabs">
15
  <ul>
16
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
17
- <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
18
  </ul>
19
  </div>
20
 
@@ -23,7 +24,7 @@
23
  <fieldset>
24
  <legend>{#table_dlg.general_props}</legend>
25
 
26
- <table border="0" cellpadding="4" cellspacing="0">
27
  <tr>
28
  <td><label for="rowtype">{#table_dlg.rowtype}</label></td>
29
  <td class="col2">
@@ -70,7 +71,7 @@
70
 
71
  <tr>
72
  <td><label for="height">{#table_dlg.height}</label></td>
73
- <td class="col2"><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
74
  </tr>
75
  </table>
76
  </fieldset>
@@ -80,7 +81,7 @@
80
  <fieldset>
81
  <legend>{#table_dlg.advanced_props}</legend>
82
 
83
- <table border="0" cellpadding="0" cellspacing="4">
84
  <tr>
85
  <td class="column1"><label for="id">{#table_dlg.id}</label></td>
86
  <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
@@ -112,7 +113,7 @@
112
  <tr>
113
  <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
114
  <td>
115
- <table border="0" cellpadding="0" cellspacing="0">
116
  <tr>
117
  <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
118
  <td id="backgroundimagebrowsercontainer">&nbsp;</td>
@@ -122,14 +123,16 @@
122
  </tr>
123
 
124
  <tr>
125
- <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td>
126
  <td>
127
- <table border="0" cellpadding="0" cellspacing="0">
 
128
  <tr>
129
  <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
130
  <td id="bgcolor_pickcontainer">&nbsp;</td>
131
  </tr>
132
  </table>
 
133
  </td>
134
  </tr>
135
  </table>
5
  <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
  <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
  <script type="text/javascript" src="../../utils/form_utils.js"></script>
8
+ <script type="text/javascript" src="../../utils/validate.js"></script>
9
  <script type="text/javascript" src="../../utils/editable_selects.js"></script>
10
  <script type="text/javascript" src="js/row.js"></script>
11
  <link href="css/row.css" rel="stylesheet" type="text/css" />
12
  </head>
13
+ <body id="tablerow" style="display: none" role="application">
14
  <form onsubmit="updateAction();return false;" action="#">
15
  <div class="tabs">
16
  <ul>
17
+ <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
18
+ <li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
19
  </ul>
20
  </div>
21
 
24
  <fieldset>
25
  <legend>{#table_dlg.general_props}</legend>
26
 
27
+ <table role="presentation" border="0" cellpadding="4" cellspacing="0">
28
  <tr>
29
  <td><label for="rowtype">{#table_dlg.rowtype}</label></td>
30
  <td class="col2">
71
 
72
  <tr>
73
  <td><label for="height">{#table_dlg.height}</label></td>
74
+ <td class="col2"><input name="height" type="text" id="height" value="" size="7" maxlength="7" onchange="changedSize();" class="size" /></td>
75
  </tr>
76
  </table>
77
  </fieldset>
81
  <fieldset>
82
  <legend>{#table_dlg.advanced_props}</legend>
83
 
84
+ <table role="presentation" border="0" cellpadding="0" cellspacing="4">
85
  <tr>
86
  <td class="column1"><label for="id">{#table_dlg.id}</label></td>
87
  <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
113
  <tr>
114
  <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
115
  <td>
116
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
117
  <tr>
118
  <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
119
  <td id="backgroundimagebrowsercontainer">&nbsp;</td>
123
  </tr>
124
 
125
  <tr>
126
+ <td class="column1"><label for="bgcolor" id="bgcolor_label">{#table_dlg.bgcolor}</label></td>
127
  <td>
128
+ <span role="group" aria-labelledby="bgcolor_label">
129
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
130
  <tr>
131
  <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
132
  <td id="bgcolor_pickcontainer">&nbsp;</td>
133
  </tr>
134
  </table>
135
+ </span>
136
  </td>
137
  </tr>
138
  </table>
tiny_mce/plugins/table/table.htm CHANGED
@@ -10,12 +10,13 @@
10
  <script type="text/javascript" src="js/table.js"></script>
11
  <link href="css/table.css" rel="stylesheet" type="text/css" />
12
  </head>
13
- <body id="table" style="display: none">
 
14
  <form onsubmit="insertTable();return false;" action="#">
15
  <div class="tabs">
16
  <ul>
17
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
18
- <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
19
  </ul>
20
  </div>
21
 
@@ -23,48 +24,48 @@
23
  <div id="general_panel" class="panel current">
24
  <fieldset>
25
  <legend>{#table_dlg.general_props}</legend>
26
- <table border="0" cellpadding="4" cellspacing="0" width="100%">
27
- <tr>
28
- <td><label id="colslabel" for="cols">{#table_dlg.cols}</label></td>
29
- <td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" class="required number min1 mceFocus" /></td>
30
- <td><label id="rowslabel" for="rows">{#table_dlg.rows}</label></td>
31
- <td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" class="required number min1" /></td>
32
- </tr>
33
- <tr>
34
- <td><label id="cellpaddinglabel" for="cellpadding">{#table_dlg.cellpadding}</label></td>
35
- <td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" class="number" /></td>
36
- <td><label id="cellspacinglabel" for="cellspacing">{#table_dlg.cellspacing}</label></td>
37
- <td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" class="number" /></td>
38
- </tr>
39
- <tr>
40
- <td><label id="alignlabel" for="align">{#table_dlg.align}</label></td>
41
- <td><select id="align" name="align">
42
- <option value="">{#not_set}</option>
43
- <option value="center">{#table_dlg.align_middle}</option>
44
- <option value="left">{#table_dlg.align_left}</option>
45
- <option value="right">{#table_dlg.align_right}</option>
46
- </select></td>
47
- <td><label id="borderlabel" for="border">{#table_dlg.border}</label></td>
48
- <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="changedBorder();" class="number" /></td>
49
- </tr>
50
- <tr id="width_row">
51
- <td><label id="widthlabel" for="width">{#table_dlg.width}</label></td>
52
- <td><input name="width" type="text" id="width" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>
53
- <td><label id="heightlabel" for="height">{#table_dlg.height}</label></td>
54
- <td><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>
55
- </tr>
56
- <tr id="styleSelectRow">
57
- <td><label id="classlabel" for="class">{#class_name}</label></td>
58
- <td colspan="3">
59
- <select id="class" name="class" class="mceEditableSelect">
60
- <option value="" selected="selected">{#not_set}</option>
61
- </select></td>
62
- </tr>
63
- <tr>
64
- <td class="column1"><label for="caption">{#table_dlg.caption}</label></td>
65
- <td><input id="caption" name="caption" type="checkbox" class="checkbox" value="true" /></td>
66
- </tr>
67
- </table>
68
  </fieldset>
69
  </div>
70
 
@@ -72,7 +73,7 @@
72
  <fieldset>
73
  <legend>{#table_dlg.advanced_props}</legend>
74
 
75
- <table border="0" cellpadding="0" cellspacing="4">
76
  <tr>
77
  <td class="column1"><label for="id">{#table_dlg.id}</label></td>
78
  <td><input id="id" name="id" type="text" value="" class="advfield" /></td>
@@ -98,7 +99,7 @@
98
  <tr>
99
  <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
100
  <td>
101
- <table border="0" cellpadding="0" cellspacing="0">
102
  <tr>
103
  <td><input id="backgroundimage" name="backgroundimage" type="text" value="" class="advfield" onchange="changedBackgroundImage();" /></td>
104
  <td id="backgroundimagebrowsercontainer">&nbsp;</td>
@@ -150,10 +151,10 @@
150
  </td>
151
  </tr>
152
 
153
- <tr>
154
- <td class="column1"><label for="bordercolor">{#table_dlg.bordercolor}</label></td>
155
  <td>
156
- <table border="0" cellpadding="0" cellspacing="0">
157
  <tr>
158
  <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
159
  <td id="bordercolor_pickcontainer">&nbsp;</td>
@@ -162,10 +163,10 @@
162
  </td>
163
  </tr>
164
 
165
- <tr>
166
- <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td>
167
  <td>
168
- <table border="0" cellpadding="0" cellspacing="0">
169
  <tr>
170
  <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
171
  <td id="bgcolor_pickcontainer">&nbsp;</td>
10
  <script type="text/javascript" src="js/table.js"></script>
11
  <link href="css/table.css" rel="stylesheet" type="text/css" />
12
  </head>
13
+ <body id="table" style="display: none" role="application" aria-labelledby="app_title">
14
+ <span style="display:none;" id="app_title">{#table_dlg.title}</span>
15
  <form onsubmit="insertTable();return false;" action="#">
16
  <div class="tabs">
17
  <ul>
18
+ <li id="general_tab" aria-controls="general_panel" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
19
+ <li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
20
  </ul>
21
  </div>
22
 
24
  <div id="general_panel" class="panel current">
25
  <fieldset>
26
  <legend>{#table_dlg.general_props}</legend>
27
+ <table role="presentation" border="0" cellpadding="4" cellspacing="0" width="100%">
28
+ <tr>
29
+ <td><label id="colslabel" for="cols">{#table_dlg.cols}</label></td>
30
+ <td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" class="required number min1 mceFocus" aria-required="true" /></td>
31
+ <td><label id="rowslabel" for="rows">{#table_dlg.rows}</label></td>
32
+ <td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" class="required number min1" aria-required="true" /></td>
33
+ </tr>
34
+ <tr>
35
+ <td><label id="cellpaddinglabel" for="cellpadding">{#table_dlg.cellpadding}</label></td>
36
+ <td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" class="number" /></td>
37
+ <td><label id="cellspacinglabel" for="cellspacing">{#table_dlg.cellspacing}</label></td>
38
+ <td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" class="number" /></td>
39
+ </tr>
40
+ <tr>
41
+ <td><label id="alignlabel" for="align">{#table_dlg.align}</label></td>
42
+ <td><select id="align" name="align">
43
+ <option value="">{#not_set}</option>
44
+ <option value="center">{#table_dlg.align_middle}</option>
45
+ <option value="left">{#table_dlg.align_left}</option>
46
+ <option value="right">{#table_dlg.align_right}</option>
47
+ </select></td>
48
+ <td><label id="borderlabel" for="border">{#table_dlg.border}</label></td>
49
+ <td><input id="border" name="border" type="text" value="" size="3" maxlength="5" onchange="changedBorder();" class="size" /></td>
50
+ </tr>
51
+ <tr id="width_row">
52
+ <td><label id="widthlabel" for="width">{#table_dlg.width}</label></td>
53
+ <td><input name="width" type="text" id="width" value="" size="7" maxlength="7" onchange="changedSize();" class="size" /></td>
54
+ <td><label id="heightlabel" for="height">{#table_dlg.height}</label></td>
55
+ <td><input name="height" type="text" id="height" value="" size="7" maxlength="7" onchange="changedSize();" class="size" /></td>
56
+ </tr>
57
+ <tr id="styleSelectRow" >
58
+ <td><label id="classlabel" for="class">{#class_name}</label></td>
59
+ <td colspan="3" >
60
+ <select id="class" name="class" class="mceEditableSelect">
61
+ <option value="" selected="selected">{#not_set}</option>
62
+ </select></td>
63
+ </tr>
64
+ <tr>
65
+ <td class="column1" ><label for="caption">{#table_dlg.caption}</label></td>
66
+ <td><input id="caption" name="caption" type="checkbox" class="checkbox" value="true" /></td>
67
+ </tr>
68
+ </table>
69
  </fieldset>
70
  </div>
71
 
73
  <fieldset>
74
  <legend>{#table_dlg.advanced_props}</legend>
75
 
76
+ <table role="presentation" border="0" cellpadding="0" cellspacing="4">
77
  <tr>
78
  <td class="column1"><label for="id">{#table_dlg.id}</label></td>
79
  <td><input id="id" name="id" type="text" value="" class="advfield" /></td>
99
  <tr>
100
  <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
101
  <td>
102
+ <table role="presentation" aria-labelledby="backgroundimage_label" border="0" cellpadding="0" cellspacing="0">
103
  <tr>
104
  <td><input id="backgroundimage" name="backgroundimage" type="text" value="" class="advfield" onchange="changedBackgroundImage();" /></td>
105
  <td id="backgroundimagebrowsercontainer">&nbsp;</td>
151
  </td>
152
  </tr>
153
 
154
+ <tr role="group" aria-labelledby="bordercolor_label">
155
+ <td class="column1"><label id="bordercolor_label" for="bordercolor">{#table_dlg.bordercolor}</label></td>
156
  <td>
157
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
158
  <tr>
159
  <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
160
  <td id="bordercolor_pickcontainer">&nbsp;</td>
163
  </td>
164
  </tr>
165
 
166
+ <tr role="group" aria-labelledby="bgcolor_label">
167
+ <td class="column1"><label id="bgcolor_label" for="bgcolor">{#table_dlg.bgcolor}</label></td>
168
  <td>
169
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
170
  <tr>
171
  <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
172
  <td id="bgcolor_pickcontainer">&nbsp;</td>
tiny_mce/plugins/xhtmlxtras/abbr.htm ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#xhtmlxtras_dlg.title_abbr_element}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9
+ <script type="text/javascript" src="js/element_common.js"></script>
10
+ <script type="text/javascript" src="js/abbr.js"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css" />
12
+ </head>
13
+ <body style="display: none" role="application" aria-labelledby="app_title">
14
+ <span style="display:none;" id="app_title">{#xhtmlxtras_dlg.title_abbr_element}</span>
15
+ <form onsubmit="insertAbbr();return false;" action="#">
16
+ <div class="tabs">
17
+ <ul>
18
+ <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19
+ <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20
+ </ul>
21
+ </div>
22
+
23
+ <div class="panel_wrapper">
24
+ <div id="general_panel" class="panel current">
25
+ <fieldset>
26
+ <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
27
+ <table role="presentation" border="0" cellpadding="0" cellspacing="4">
28
+ <tr>
29
+ <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
30
+ <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td>
31
+ </tr>
32
+ <tr>
33
+ <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
34
+ <td><input id="id" name="id" type="text" value="" class="field" /></td>
35
+ </tr>
36
+ <tr>
37
+ <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
38
+ <td>
39
+ <select id="class" name="class" class="field mceEditableSelect">
40
+ <option value="">{#not_set}</option>
41
+ </select>
42
+ </td>
43
+ </tr>
44
+ <tr>
45
+ <td class="label"><label id="stylelabel" for="style">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
46
+ <td><input id="style" name="style" type="text" value="" class="field" /></td>
47
+ </tr>
48
+ <tr>
49
+ <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
50
+ <td>
51
+ <select id="dir" name="dir" class="field">
52
+ <option value="">{#not_set}</option>
53
+ <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
54
+ <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
55
+ </select>
56
+ </td>
57
+ </tr>
58
+ <tr>
59
+ <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
60
+ <td>
61
+ <input id="lang" name="lang" type="text" value="" class="field" />
62
+ </td>
63
+ </tr>
64
+ </table>
65
+ </fieldset>
66
+ </div>
67
+ <div id="events_panel" class="panel">
68
+ <fieldset>
69
+ <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
70
+
71
+ <table role="presentation" border="0" cellpadding="0" cellspacing="4">
72
+ <tr>
73
+ <td class="label"><label for="onfocus">onfocus</label>:</td>
74
+ <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
75
+ </tr>
76
+
77
+ <tr>
78
+ <td class="label"><label for="onblur">onblur</label>:</td>
79
+ <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
80
+ </tr>
81
+
82
+ <tr>
83
+ <td class="label"><label for="onclick">onclick</label>:</td>
84
+ <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
85
+ </tr>
86
+
87
+ <tr>
88
+ <td class="label"><label for="ondblclick">ondblclick</label>:</td>
89
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
90
+ </tr>
91
+
92
+ <tr>
93
+ <td class="label"><label for="onmousedown">onmousedown</label>:</td>
94
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
95
+ </tr>
96
+
97
+ <tr>
98
+ <td class="label"><label for="onmouseup">onmouseup</label>:</td>
99
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
100
+ </tr>
101
+
102
+ <tr>
103
+ <td class="label"><label for="onmouseover">onmouseover</label>:</td>
104
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
105
+ </tr>
106
+
107
+ <tr>
108
+ <td class="label"><label for="onmousemove">onmousemove</label>:</td>
109
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
110
+ </tr>
111
+
112
+ <tr>
113
+ <td class="label"><label for="onmouseout">onmouseout</label>:</td>
114
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
115
+ </tr>
116
+
117
+ <tr>
118
+ <td class="label"><label for="onkeypress">onkeypress</label>:</td>
119
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
120
+ </tr>
121
+
122
+ <tr>
123
+ <td class="label"><label for="onkeydown">onkeydown</label>:</td>
124
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
125
+ </tr>
126
+
127
+ <tr>
128
+ <td class="label"><label for="onkeyup">onkeyup</label>:</td>
129
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
130
+ </tr>
131
+ </table>
132
+ </fieldset>
133
+ </div>
134
+ </div>
135
+ <div class="mceActionPanel">
136
+ <input type="submit" id="insert" name="insert" value="{#update}" />
137
+ <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAbbr();" style="display: none;" />
138
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
139
+ </div>
140
+ </form>
141
+ </body>
142
+ </html>
tiny_mce/plugins/xhtmlxtras/acronym.htm ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#xhtmlxtras_dlg.title_acronym_element}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9
+ <script type="text/javascript" src="js/element_common.js"></script>
10
+ <script type="text/javascript" src="js/acronym.js"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css" />
12
+ </head>
13
+ <body style="display: none" role="application" aria-labelledby="app_title">
14
+ <span style="display:none;" id="app_title">{#xhtmlxtras_dlg.title_acronym_element}</span>
15
+ <form onsubmit="insertAcronym();return false;" action="#">
16
+ <div class="tabs">
17
+ <ul>
18
+ <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19
+ <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20
+ </ul>
21
+ </div>
22
+
23
+ <div class="panel_wrapper">
24
+ <div id="general_panel" class="panel current">
25
+ <fieldset>
26
+ <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
27
+ <table role="presentation" border="0" cellpadding="0" cellspacing="4">
28
+ <tr>
29
+ <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
30
+ <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td>
31
+ </tr>
32
+ <tr>
33
+ <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
34
+ <td><input id="id" name="id" type="text" value="" class="field" /></td>
35
+ </tr>
36
+ <tr>
37
+ <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
38
+ <td>
39
+ <select id="class" name="class" class="field mceEditableSelect">
40
+ <option value="">{#not_set}</option>
41
+ </select>
42
+ </td>
43
+ </tr>
44
+ <tr>
45
+ <td class="label"><label id="stylelabel" for="style">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
46
+ <td><input id="style" name="style" type="text" value="" class="field" /></td>
47
+ </tr>
48
+ <tr>
49
+ <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
50
+ <td>
51
+ <select id="dir" name="dir" class="field">
52
+ <option value="">{#not_set}</option>
53
+ <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
54
+ <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
55
+ </select>
56
+ </td>
57
+ </tr>
58
+ <tr>
59
+ <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
60
+ <td>
61
+ <input id="lang" name="lang" type="text" value="" class="field" />
62
+ </td>
63
+ </tr>
64
+ </table>
65
+ </fieldset>
66
+ </div>
67
+ <div id="events_panel" class="panel">
68
+ <fieldset>
69
+ <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
70
+
71
+ <table role="presentation" border="0" cellpadding="0" cellspacing="4">
72
+ <tr>
73
+ <td class="label"><label for="onfocus">onfocus</label>:</td>
74
+ <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
75
+ </tr>
76
+
77
+ <tr>
78
+ <td class="label"><label for="onblur">onblur</label>:</td>
79
+ <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
80
+ </tr>
81
+
82
+ <tr>
83
+ <td class="label"><label for="onclick">onclick</label>:</td>
84
+ <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
85
+ </tr>
86
+
87
+ <tr>
88
+ <td class="label"><label for="ondblclick">ondblclick</label>:</td>
89
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
90
+ </tr>
91
+
92
+ <tr>
93
+ <td class="label"><label for="onmousedown">onmousedown</label>:</td>
94
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
95
+ </tr>
96
+
97
+ <tr>
98
+ <td class="label"><label for="onmouseup">onmouseup</label>:</td>
99
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
100
+ </tr>
101
+
102
+ <tr>
103
+ <td class="label"><label for="onmouseover">onmouseover</label>:</td>
104
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
105
+ </tr>
106
+
107
+ <tr>
108
+ <td class="label"><label for="onmousemove">onmousemove</label>:</td>
109
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
110
+ </tr>
111
+
112
+ <tr>
113
+ <td class="label"><label for="onmouseout">onmouseout</label>:</td>
114
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
115
+ </tr>
116
+
117
+ <tr>
118
+ <td class="label"><label for="onkeypress">onkeypress</label>:</td>
119
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
120
+ </tr>
121
+
122
+ <tr>
123
+ <td class="label"><label for="onkeydown">onkeydown</label>:</td>
124
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
125
+ </tr>
126
+
127
+ <tr>
128
+ <td class="label"><label for="onkeyup">onkeyup</label>:</td>
129
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
130
+ </tr>
131
+ </table>
132
+ </fieldset>
133
+ </div>
134
+ </div>
135
+ <div class="mceActionPanel">
136
+ <input type="submit" id="insert" name="insert" value="{#update}" />
137
+ <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAcronym();" style="display: none;" />
138
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
139
+ </div>
140
+ </form>
141
+ </body>
142
+ </html>
tiny_mce/plugins/xhtmlxtras/attributes.htm ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#xhtmlxtras_dlg.attribs_title}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
+ <script type="text/javascript" src="../../utils/editable_selects.js"></script>
8
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>
9
+ <script type="text/javascript" src="js/attributes.js"></script>
10
+ <link rel="stylesheet" type="text/css" href="css/attributes.css" />
11
+ </head>
12
+ <body style="display: none" role="application" aria-labelledby="app_title">
13
+ <span style="display:none;" id="app_title">{#xhtmlxtras_dlg.attribs_title}</span>
14
+ <form onsubmit="insertAction();return false;" action="#">
15
+ <div class="tabs">
16
+ <ul>
17
+ <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_attrib_tab}</a></span></li>
18
+ <li id="events_tab" aria-controls="events_panel"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_events_tab}</a></span></li>
19
+ </ul>
20
+ </div>
21
+
22
+ <div class="panel_wrapper">
23
+ <div id="general_panel" class="panel current">
24
+ <fieldset>
25
+ <legend>{#xhtmlxtras_dlg.attribute_attrib_tab}</legend>
26
+ <table role="presentation" border="0" cellpadding="0" cellspacing="4">
27
+ <tr>
28
+ <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
29
+ <td><input id="title" name="title" type="text" value="" class="mceFocus" /></td>
30
+ </tr>
31
+ <tr>
32
+ <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
33
+ <td><input id="id" name="id" type="text" value="" /></td>
34
+ </tr>
35
+ <tr>
36
+ <td><label id="classlabel" for="classlist">{#class_name}</label></td>
37
+ <td>
38
+ <select id="classlist" name="classlist" class="mceEditableSelect">
39
+ <option value="" selected="selected">{#not_set}</option>
40
+ </select>
41
+ </td>
42
+ </tr>
43
+ <tr>
44
+ <td class="label"><label id="stylelabel" for="style">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
45
+ <td><input id="style" name="style" type="text" value="" /></td>
46
+ </tr>
47
+ <tr>
48
+ <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
49
+ <td>
50
+ <select id="dir" name="dir">
51
+ <option value="">{#not_set}</option>
52
+ <option value="ltr">{#xhtmlxtras_dlg.option_ltr}</option>
53
+ <option value="rtl">{#xhtmlxtras_dlg.option_rtl}</option>
54
+ </select>
55
+ </td>
56
+ </tr>
57
+ <tr>
58
+ <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
59
+ <td>
60
+ <input id="lang" name="lang" type="text" value="" />
61
+ </td>
62
+ </tr>
63
+ <tr>
64
+ <td><label id="tabindexlabel" for="tabindex">{#xhtmlxtras_dlg.attribute_label_tabindex}</label></td>
65
+ <td><input type="text" id="tabindex" name="tabindex" value="" /></td>
66
+ </tr>
67
+
68
+ <tr>
69
+ <td><label id="accesskeylabel" for="accesskey">{#xhtmlxtras_dlg.attribute_label_accesskey}</label></td>
70
+ <td><input type="text" id="accesskey" name="accesskey" value="" /></td>
71
+ </tr>
72
+ </table>
73
+ </fieldset>
74
+ </div>
75
+ <div id="events_panel" class="panel">
76
+ <fieldset>
77
+ <legend>{#xhtmlxtras_dlg.attribute_events_tab}</legend>
78
+
79
+ <table role="presentation" border="0" cellpadding="0" cellspacing="4">
80
+ <tr>
81
+ <td class="label"><label for="onfocus">onfocus</label>:</td>
82
+ <td><input id="onfocus" name="onfocus" type="text" value="" /></td>
83
+ </tr>
84
+
85
+ <tr>
86
+ <td class="label"><label for="onblur">onblur</label>:</td>
87
+ <td><input id="onblur" name="onblur" type="text" value="" /></td>
88
+ </tr>
89
+
90
+ <tr>
91
+ <td class="label"><label for="onclick">onclick</label>:</td>
92
+ <td><input id="onclick" name="onclick" type="text" value="" /></td>
93
+ </tr>
94
+
95
+ <tr>
96
+ <td class="label"><label for="ondblclick">ondblclick</label>:</td>
97
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" /></td>
98
+ </tr>
99
+
100
+ <tr>
101
+ <td class="label"><label for="onmousedown">onmousedown</label>:</td>
102
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" /></td>
103
+ </tr>
104
+
105
+ <tr>
106
+ <td class="label"><label for="onmouseup">onmouseup</label>:</td>
107
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" /></td>
108
+ </tr>
109
+
110
+ <tr>
111
+ <td class="label"><label for="onmouseover">onmouseover</label>:</td>
112
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" /></td>
113
+ </tr>
114
+
115
+ <tr>
116
+ <td class="label"><label for="onmousemove">onmousemove</label>:</td>
117
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" /></td>
118
+ </tr>
119
+
120
+ <tr>
121
+ <td class="label"><label for="onmouseout">onmouseout</label>:</td>
122
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" /></td>
123
+ </tr>
124
+
125
+ <tr>
126
+ <td class="label"><label for="onkeypress">onkeypress</label>:</td>
127
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" /></td>
128
+ </tr>
129
+
130
+ <tr>
131
+ <td class="label"><label for="onkeydown">onkeydown</label>:</td>
132
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" /></td>
133
+ </tr>
134
+
135
+ <tr>
136
+ <td class="label"><label for="onkeyup">onkeyup</label>:</td>
137
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" /></td>
138
+ </tr>
139
+ </table>
140
+ </fieldset>
141
+ </div>
142
+ </div>
143
+ <div class="mceActionPanel">
144
+ <input type="submit" id="insert" name="insert" value="{#insert}" />
145
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
146
+ </div>
147
+ </form>
148
+ </body>
149
+ </html>
tiny_mce/plugins/xhtmlxtras/cite.htm ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#xhtmlxtras_dlg.title_cite_element}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9
+ <script type="text/javascript" src="js/element_common.js"></script>
10
+ <script type="text/javascript" src="js/cite.js"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css" />
12
+ </head>
13
+ <body style="display: none" role="application" aria-labelledby="app_title">
14
+ <span style="display:none;" id="app_title">{#xhtmlxtras_dlg.title_cite_element}</span>
15
+ <form onsubmit="insertCite();return false;" action="#">
16
+ <div class="tabs">
17
+ <ul>
18
+ <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19
+ <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20
+ </ul>
21
+ </div>
22
+
23
+ <div class="panel_wrapper">
24
+ <div id="general_panel" class="panel current">
25
+ <fieldset>
26
+ <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
27
+ <table role="presentation" border="0" cellpadding="0" cellspacing="4">
28
+ <tr>
29
+ <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
30
+ <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td>
31
+ </tr>
32
+ <tr>
33
+ <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
34
+ <td><input id="id" name="id" type="text" value="" class="field" /></td>
35
+ </tr>
36
+ <tr>
37
+ <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
38
+ <td>
39
+ <select id="class" name="class" class="field mceEditableSelect">
40
+ <option value="">{#not_set}</option>
41
+ </select>
42
+ </td>
43
+ </tr>
44
+ <tr>
45
+ <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
46
+ <td><input id="style" name="style" type="text" value="" class="field" /></td>
47
+ </tr>
48
+ <tr>
49
+ <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
50
+ <td>
51
+ <select id="dir" name="dir" class="field">
52
+ <option value="">{#not_set}</option>
53
+ <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
54
+ <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
55
+ </select>
56
+ </td>
57
+ </tr>
58
+ <tr>
59
+ <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
60
+ <td>
61
+ <input id="lang" name="lang" type="text" value="" class="field" />
62
+ </td>
63
+ </tr>
64
+ </table>
65
+ </fieldset>
66
+ </div>
67
+ <div id="events_panel" class="panel">
68
+ <fieldset>
69
+ <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
70
+
71
+ <table role="presentation" border="0" cellpadding="0" cellspacing="4">
72
+ <tr>
73
+ <td class="label"><label for="onfocus">onfocus</label>:</td>
74
+ <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
75
+ </tr>
76
+
77
+ <tr>
78
+ <td class="label"><label for="onblur">onblur</label>:</td>
79
+ <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
80
+ </tr>
81
+
82
+ <tr>
83
+ <td class="label"><label for="onclick">onclick</label>:</td>
84
+ <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
85
+ </tr>
86
+
87
+ <tr>
88
+ <td class="label"><label for="ondblclick">ondblclick</label>:</td>
89
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
90
+ </tr>
91
+
92
+ <tr>
93
+ <td class="label"><label for="onmousedown">onmousedown</label>:</td>
94
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
95
+ </tr>
96
+
97
+ <tr>
98
+ <td class="label"><label for="onmouseup">onmouseup</label>:</td>
99
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
100
+ </tr>
101
+
102
+ <tr>
103
+ <td class="label"><label for="onmouseover">onmouseover</label>:</td>
104
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
105
+ </tr>
106
+
107
+ <tr>
108
+ <td class="label"><label for="onmousemove">onmousemove</label>:</td>
109
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
110
+ </tr>
111
+
112
+ <tr>
113
+ <td class="label"><label for="onmouseout">onmouseout</label>:</td>
114
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
115
+ </tr>
116
+
117
+ <tr>
118
+ <td class="label"><label for="onkeypress">onkeypress</label>:</td>
119
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
120
+ </tr>
121
+
122
+ <tr>
123
+ <td class="label"><label for="onkeydown">onkeydown</label>:</td>
124
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
125
+ </tr>
126
+
127
+ <tr>
128
+ <td class="label"><label for="onkeyup">onkeyup</label>:</td>
129
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
130
+ </tr>
131
+ </table>
132
+ </fieldset>
133
+ </div>
134
+ </div>
135
+ <div class="mceActionPanel">
136
+ <input type="submit" id="insert" name="insert" value="{#update}" />
137
+ <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeCite();" style="display: none;" />
138
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
139
+ </div>
140
+ </form>
141
+ </body>
142
+ </html>
tiny_mce/plugins/xhtmlxtras/css/attributes.css ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ .panel_wrapper div.current {
2
+ height: 290px;
3
+ }
4
+
5
+ #id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey {
6
+ width: 200px;
7
+ }
8
+
9
+ #events_panel input {
10
+ width: 200px;
11
+ }
tiny_mce/plugins/xhtmlxtras/css/popup.css ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ input.field, select.field {width:200px;}
2
+ input.picker {width:179px; margin-left: 5px;}
3
+ input.disabled {border-color:#F2F2F2;}
4
+ img.picker {vertical-align:text-bottom; cursor:pointer;}
5
+ h1 {padding: 0 0 5px 0;}
6
+ .panel_wrapper div.current {height:160px;}
7
+ #xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;}
8
+ a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;}
9
+ #datetime {width:180px;}
tiny_mce/plugins/xhtmlxtras/del.htm ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#xhtmlxtras_dlg.title_del_element}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9
+ <script type="text/javascript" src="js/element_common.js"></script>
10
+ <script type="text/javascript" src="js/del.js"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css" />
12
+ </head>
13
+ <body id="xhtmlxtrasins" style="display: none" role="application" aria-labelledby="app_title">
14
+ <span style="display:none;" id="app_title">{#xhtmlxtras_dlg.title_del_element}</span>
15
+ <form onsubmit="insertDel();return false;" action="#">
16
+ <div class="tabs">
17
+ <ul>
18
+ <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19
+ <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20
+ </ul>
21
+ </div>
22
+
23
+ <div class="panel_wrapper">
24
+ <div id="general_panel" class="panel current">
25
+ <fieldset>
26
+ <legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend>
27
+ <table role="presentation" border="0" cellpadding="0" cellspacing="4">
28
+ <tr>
29
+ <td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td>
30
+ <td>
31
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
32
+ <tr>
33
+ <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td>
34
+ <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse" role="button" aria-labelledby="datetimelabel"><span class="datetime" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>
35
+ </tr>
36
+ </table>
37
+ </td>
38
+ </tr>
39
+ <tr>
40
+ <td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td>
41
+ <td><input id="cite" name="cite" type="text" value="" class="field" /></td>
42
+ </tr>
43
+ </table>
44
+ </fieldset>
45
+ <fieldset>
46
+ <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
47
+ <table role="presentation" border="0" cellpadding="0" cellspacing="4">
48
+ <tr>
49
+ <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
50
+ <td><input id="title" name="title" type="text" value="" class="field" /></td>
51
+ </tr>
52
+ <tr>
53
+ <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
54
+ <td><input id="id" name="id" type="text" value="" class="field" /></td>
55
+ </tr>
56
+ <tr>
57
+ <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
58
+ <td>
59
+ <select id="class" name="class" class="field mceEditableSelect">
60
+ <option value="">{#not_set}</option>
61
+ </select>
62
+ </td>
63
+ </tr>
64
+ <tr>
65
+ <td class="label"><label id="stylelabel" for="style">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
66
+ <td><input id="style" name="style" type="text" value="" class="field" /></td>
67
+ </tr>
68
+ <tr>
69
+ <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
70
+ <td>
71
+ <select id="dir" name="dir" class="field">
72
+ <option value="">{#not_set}</option>
73
+ <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
74
+ <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
75
+ </select>
76
+ </td>
77
+ </tr>
78
+ <tr>
79
+ <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
80
+ <td>
81
+ <input id="lang" name="lang" type="text" value="" class="field" />
82
+ </td>
83
+ </tr>
84
+ </table>
85
+ </fieldset>
86
+ </div>
87
+ <div id="events_panel" class="panel">
88
+ <fieldset>
89
+ <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
90
+
91
+ <table role="presentation" border="0" cellpadding="0" cellspacing="4">
92
+ <tr>
93
+ <td class="label"><label for="onfocus">onfocus</label>:</td>
94
+ <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
95
+ </tr>
96
+
97
+ <tr>
98
+ <td class="label"><label for="onblur">onblur</label>:</td>
99
+ <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
100
+ </tr>
101
+
102
+ <tr>
103
+ <td class="label"><label for="onclick">onclick</label>:</td>
104
+ <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
105
+ </tr>
106
+
107
+ <tr>
108
+ <td class="label"><label for="ondblclick">ondblclick</label>:</td>
109
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
110
+ </tr>
111
+
112
+ <tr>
113
+ <td class="label"><label for="onmousedown">onmousedown</label>:</td>
114
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
115
+ </tr>
116
+
117
+ <tr>
118
+ <td class="label"><label for="onmouseup">onmouseup</label>:</td>
119
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
120
+ </tr>
121
+
122
+ <tr>
123
+ <td class="label"><label for="onmouseover">onmouseover</label>:</td>
124
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
125
+ </tr>
126
+
127
+ <tr>
128
+ <td class="label"><label for="onmousemove">onmousemove</label>:</td>
129
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
130
+ </tr>
131
+
132
+ <tr>
133
+ <td class="label"><label for="onmouseout">onmouseout</label>:</td>
134
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
135
+ </tr>
136
+
137
+ <tr>
138
+ <td class="label"><label for="onkeypress">onkeypress</label>:</td>
139
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
140
+ </tr>
141
+
142
+ <tr>
143
+ <td class="label"><label for="onkeydown">onkeydown</label>:</td>
144
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
145
+ </tr>
146
+
147
+ <tr>
148
+ <td class="label"><label for="onkeyup">onkeyup</label>:</td>
149
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
150
+ </tr>
151
+ </table>
152
+ </fieldset>
153
+ </div>
154
+ </div>
155
+ <div class="mceActionPanel">
156
+ <input type="submit" id="insert" name="insert" value="{#update}" />
157
+ <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeDel();" style="display: none;" />
158
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
159
+ </div>
160
+ </form>
161
+ </body>
162
+ </html>
tiny_mce/plugins/xhtmlxtras/editor_plugin.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(){tinymce.create("tinymce.plugins.XHTMLXtrasPlugin",{init:function(a,b){a.addCommand("mceCite",function(){a.windowManager.open({file:b+"/cite.htm",width:350+parseInt(a.getLang("xhtmlxtras.cite_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.cite_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAcronym",function(){a.windowManager.open({file:b+"/acronym.htm",width:350+parseInt(a.getLang("xhtmlxtras.acronym_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.acronym_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAbbr",function(){a.windowManager.open({file:b+"/abbr.htm",width:350+parseInt(a.getLang("xhtmlxtras.abbr_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.abbr_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceDel",function(){a.windowManager.open({file:b+"/del.htm",width:340+parseInt(a.getLang("xhtmlxtras.del_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.del_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceIns",function(){a.windowManager.open({file:b+"/ins.htm",width:340+parseInt(a.getLang("xhtmlxtras.ins_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.ins_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAttributes",function(){a.windowManager.open({file:b+"/attributes.htm",width:380+parseInt(a.getLang("xhtmlxtras.attr_delta_width",0)),height:370+parseInt(a.getLang("xhtmlxtras.attr_delta_height",0)),inline:1},{plugin_url:b})});a.addButton("cite",{title:"xhtmlxtras.cite_desc",cmd:"mceCite"});a.addButton("acronym",{title:"xhtmlxtras.acronym_desc",cmd:"mceAcronym"});a.addButton("abbr",{title:"xhtmlxtras.abbr_desc",cmd:"mceAbbr"});a.addButton("del",{title:"xhtmlxtras.del_desc",cmd:"mceDel"});a.addButton("ins",{title:"xhtmlxtras.ins_desc",cmd:"mceIns"});a.addButton("attribs",{title:"xhtmlxtras.attribs_desc",cmd:"mceAttributes"});a.onNodeChange.add(function(d,c,f,e){f=d.dom.getParent(f,"CITE,ACRONYM,ABBR,DEL,INS");c.setDisabled("cite",e);c.setDisabled("acronym",e);c.setDisabled("abbr",e);c.setDisabled("del",e);c.setDisabled("ins",e);c.setDisabled("attribs",f&&f.nodeName=="BODY");c.setActive("cite",0);c.setActive("acronym",0);c.setActive("abbr",0);c.setActive("del",0);c.setActive("ins",0);if(f){do{c.setDisabled(f.nodeName.toLowerCase(),0);c.setActive(f.nodeName.toLowerCase(),1)}while(f=f.parentNode)}});a.onPreInit.add(function(){a.dom.create("abbr")})},getInfo:function(){return{longname:"XHTML Xtras Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("xhtmlxtras",tinymce.plugins.XHTMLXtrasPlugin)})();
tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * editor_plugin_src.js
3
+ *
4
+ * Copyright 2009, Moxiecode Systems AB
5
+ * Released under LGPL License.
6
+ *
7
+ * License: http://tinymce.moxiecode.com/license
8
+ * Contributing: http://tinymce.moxiecode.com/contributing
9
+ */
10
+
11
+ (function() {
12
+ tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', {
13
+ init : function(ed, url) {
14
+ // Register commands
15
+ ed.addCommand('mceCite', function() {
16
+ ed.windowManager.open({
17
+ file : url + '/cite.htm',
18
+ width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)),
19
+ height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)),
20
+ inline : 1
21
+ }, {
22
+ plugin_url : url
23
+ });
24
+ });
25
+
26
+ ed.addCommand('mceAcronym', function() {
27
+ ed.windowManager.open({
28
+ file : url + '/acronym.htm',
29
+ width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)),
30
+ height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_height', 0)),
31
+ inline : 1
32
+ }, {
33
+ plugin_url : url
34
+ });
35
+ });
36
+
37
+ ed.addCommand('mceAbbr', function() {
38
+ ed.windowManager.open({
39
+ file : url + '/abbr.htm',
40
+ width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)),
41
+ height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_height', 0)),
42
+ inline : 1
43
+ }, {
44
+ plugin_url : url
45
+ });
46
+ });
47
+
48
+ ed.addCommand('mceDel', function() {
49
+ ed.windowManager.open({
50
+ file : url + '/del.htm',
51
+ width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)),
52
+ height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_height', 0)),
53
+ inline : 1
54
+ }, {
55
+ plugin_url : url
56
+ });
57
+ });
58
+
59
+ ed.addCommand('mceIns', function() {
60
+ ed.windowManager.open({
61
+ file : url + '/ins.htm',
62
+ width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)),
63
+ height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_height', 0)),
64
+ inline : 1
65
+ }, {
66
+ plugin_url : url
67
+ });
68
+ });
69
+
70
+ ed.addCommand('mceAttributes', function() {
71
+ ed.windowManager.open({
72
+ file : url + '/attributes.htm',
73
+ width : 380 + parseInt(ed.getLang('xhtmlxtras.attr_delta_width', 0)),
74
+ height : 370 + parseInt(ed.getLang('xhtmlxtras.attr_delta_height', 0)),
75
+ inline : 1
76
+ }, {
77
+ plugin_url : url
78
+ });
79
+ });
80
+
81
+ // Register buttons
82
+ ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'});
83
+ ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'});
84
+ ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'});
85
+ ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'});
86
+ ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'});
87
+ ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'});
88
+
89
+ ed.onNodeChange.add(function(ed, cm, n, co) {
90
+ n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS');
91
+
92
+ cm.setDisabled('cite', co);
93
+ cm.setDisabled('acronym', co);
94
+ cm.setDisabled('abbr', co);
95
+ cm.setDisabled('del', co);
96
+ cm.setDisabled('ins', co);
97
+ cm.setDisabled('attribs', n && n.nodeName == 'BODY');
98
+ cm.setActive('cite', 0);
99
+ cm.setActive('acronym', 0);
100
+ cm.setActive('abbr', 0);
101
+ cm.setActive('del', 0);
102
+ cm.setActive('ins', 0);
103
+
104
+ // Activate all
105
+ if (n) {
106
+ do {
107
+ cm.setDisabled(n.nodeName.toLowerCase(), 0);
108
+ cm.setActive(n.nodeName.toLowerCase(), 1);
109
+ } while (n = n.parentNode);
110
+ }
111
+ });
112
+
113
+ ed.onPreInit.add(function() {
114
+ // Fixed IE issue where it can't handle these elements correctly
115
+ ed.dom.create('abbr');
116
+ });
117
+ },
118
+
119
+ getInfo : function() {
120
+ return {
121
+ longname : 'XHTML Xtras Plugin',
122
+ author : 'Moxiecode Systems AB',
123
+ authorurl : 'http://tinymce.moxiecode.com',
124
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras',
125
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
126
+ };
127
+ }
128
+ });
129
+
130
+ // Register plugin
131
+ tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin);
132
+ })();
tiny_mce/plugins/xhtmlxtras/ins.htm ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#xhtmlxtras_dlg.title_ins_element}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>
8
+ <script type="text/javascript" src="../../utils/editable_selects.js"></script>
9
+ <script type="text/javascript" src="js/element_common.js"></script>
10
+ <script type="text/javascript" src="js/ins.js"></script>
11
+ <link rel="stylesheet" type="text/css" href="css/popup.css" />
12
+ </head>
13
+ <body id="xhtmlxtrasins" style="display: none" role="application" aria-labelledby="app_title">
14
+ <span style="display:none;" id="app_title">{#xhtmlxtras_dlg.title_ins_element}</span>
15
+ <form onsubmit="insertIns();return false;" action="#">
16
+ <div class="tabs">
17
+ <ul>
18
+ <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
19
+ <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
20
+ </ul>
21
+ </div>
22
+
23
+ <div class="panel_wrapper">
24
+ <div id="general_panel" class="panel current">
25
+ <fieldset>
26
+ <legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend>
27
+ <table role="presentation" border="0" cellpadding="0" cellspacing="4">
28
+ <tr>
29
+ <td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td>
30
+ <td>
31
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
32
+ <tr>
33
+ <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td>
34
+ <td ><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse" role="button" aria-labelledby="datetimelabel"><span class="datetime" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>
35
+ </tr>
36
+ </table>
37
+ </td>
38
+ </tr>
39
+ <tr >
40
+ <td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td>
41
+ <td><input id="cite" name="cite" type="text" value="" class="field" /></td>
42
+ </tr>
43
+ </table>
44
+ </fieldset>
45
+ <fieldset>
46
+ <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
47
+ <table role="presentation" border="0" cellpadding="0" cellspacing="4">
48
+ <tr>
49
+ <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td>
50
+ <td><input id="title" name="title" type="text" value="" class="field" /></td>
51
+ </tr>
52
+ <tr>
53
+ <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td>
54
+ <td><input id="id" name="id" type="text" value="" class="field" /></td>
55
+ </tr>
56
+ <tr>
57
+ <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td>
58
+ <td>
59
+ <select id="class" name="class" class="field mceEditableSelect">
60
+ <option value="">{#not_set}</option>
61
+ </select>
62
+ </td>
63
+ </tr>
64
+ <tr>
65
+ <td class="label"><label id="stylelabel" for="style">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td>
66
+ <td><input id="style" name="style" type="text" value="" class="field" /></td>
67
+ </tr>
68
+ <tr>
69
+ <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td>
70
+ <td>
71
+ <select id="dir" name="dir" class="field">
72
+ <option value="">{#not_set}</option>
73
+ <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option>
74
+ <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option>
75
+ </select>
76
+ </td>
77
+ </tr>
78
+ <tr>
79
+ <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td>
80
+ <td>
81
+ <input id="lang" name="lang" type="text" value="" class="field" />
82
+ </td>
83
+ </tr>
84
+ </table>
85
+ </fieldset>
86
+ </div>
87
+ <div id="events_panel" class="panel">
88
+ <fieldset>
89
+ <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
90
+
91
+ <table role="presentation" border="0" cellpadding="0" cellspacing="4">
92
+ <tr>
93
+ <td class="label"><label for="onfocus">onfocus</label>:</td>
94
+ <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
95
+ </tr>
96
+
97
+ <tr>
98
+ <td class="label"><label for="onblur">onblur</label>:</td>
99
+ <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
100
+ </tr>
101
+
102
+ <tr>
103
+ <td class="label"><label for="onclick">onclick</label>:</td>
104
+ <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
105
+ </tr>
106
+
107
+ <tr>
108
+ <td class="label"><label for="ondblclick">ondblclick</label>:</td>
109
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
110
+ </tr>
111
+
112
+ <tr>
113
+ <td class="label"><label for="onmousedown">onmousedown</label>:</td>
114
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
115
+ </tr>
116
+
117
+ <tr>
118
+ <td class="label"><label for="onmouseup">onmouseup</label>:</td>
119
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
120
+ </tr>
121
+
122
+ <tr>
123
+ <td class="label"><label for="onmouseover">onmouseover</label>:</td>
124
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
125
+ </tr>
126
+
127
+ <tr>
128
+ <td class="label"><label for="onmousemove">onmousemove</label>:</td>
129
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
130
+ </tr>
131
+
132
+ <tr>
133
+ <td class="label"><label for="onmouseout">onmouseout</label>:</td>
134
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
135
+ </tr>
136
+
137
+ <tr>
138
+ <td class="label"><label for="onkeypress">onkeypress</label>:</td>
139
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
140
+ </tr>
141
+
142
+ <tr>
143
+ <td class="label"><label for="onkeydown">onkeydown</label>:</td>
144
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
145
+ </tr>
146
+
147
+ <tr>
148
+ <td class="label"><label for="onkeyup">onkeyup</label>:</td>
149
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
150
+ </tr>
151
+ </table>
152
+ </fieldset>
153
+ </div>
154
+ </div>
155
+ <div class="mceActionPanel">
156
+ <input type="submit" id="insert" name="insert" value="{#update}" />
157
+ <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeIns();" style="display: none;" />
158
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
159
+ </div>
160
+ </form>
161
+ </body>
162
+ </html>
tiny_mce/plugins/xhtmlxtras/js/abbr.js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * abbr.js
3
+ *
4
+ * Copyright 2009, Moxiecode Systems AB
5
+ * Released under LGPL License.
6
+ *
7
+ * License: http://tinymce.moxiecode.com/license
8
+ * Contributing: http://tinymce.moxiecode.com/contributing
9
+ */
10
+
11
+ function init() {
12
+ SXE.initElementDialog('abbr');
13
+ if (SXE.currentAction == "update") {
14
+ SXE.showRemoveButton();
15
+ }
16
+ }
17
+
18
+ function insertAbbr() {
19
+ SXE.insertElement('abbr');
20
+ tinyMCEPopup.close();
21
+ }
22
+
23
+ function removeAbbr() {
24
+ SXE.removeElement('abbr');
25
+ tinyMCEPopup.close();
26
+ }
27
+
28
+ tinyMCEPopup.onInit.add(init);
tiny_mce/plugins/xhtmlxtras/js/acronym.js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * acronym.js
3
+ *
4
+ * Copyright 2009, Moxiecode Systems AB
5
+ * Released under LGPL License.
6
+ *
7
+ * License: http://tinymce.moxiecode.com/license
8
+ * Contributing: http://tinymce.moxiecode.com/contributing
9
+ */
10
+
11
+ function init() {
12
+ SXE.initElementDialog('acronym');
13
+ if (SXE.currentAction == "update") {
14
+ SXE.showRemoveButton();
15
+ }
16
+ }
17
+
18
+ function insertAcronym() {
19
+ SXE.insertElement('acronym');
20
+ tinyMCEPopup.close();
21
+ }
22
+
23
+ function removeAcronym() {
24
+ SXE.removeElement('acronym');
25
+ tinyMCEPopup.close();
26
+ }
27
+
28
+ tinyMCEPopup.onInit.add(init);
tiny_mce/plugins/xhtmlxtras/js/attributes.js ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * attributes.js
3
+ *
4
+ * Copyright 2009, Moxiecode Systems AB
5
+ * Released under LGPL License.
6
+ *
7
+ * License: http://tinymce.moxiecode.com/license
8
+ * Contributing: http://tinymce.moxiecode.com/contributing
9
+ */
10
+
11
+ function init() {
12
+ tinyMCEPopup.resizeToInnerSize();
13
+ var inst = tinyMCEPopup.editor;
14
+ var dom = inst.dom;
15
+ var elm = inst.selection.getNode();
16
+ var f = document.forms[0];
17
+ var onclick = dom.getAttrib(elm, 'onclick');
18
+
19
+ setFormValue('title', dom.getAttrib(elm, 'title'));
20
+ setFormValue('id', dom.getAttrib(elm, 'id'));
21
+ setFormValue('style', dom.getAttrib(elm, "style"));
22
+ setFormValue('dir', dom.getAttrib(elm, 'dir'));
23
+ setFormValue('lang', dom.getAttrib(elm, 'lang'));
24
+ setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
25
+ setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
26
+ setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));
27
+ setFormValue('onblur', dom.getAttrib(elm, 'onblur'));
28
+ setFormValue('onclick', onclick);
29
+ setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));
30
+ setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));
31
+ setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));
32
+ setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));
33
+ setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));
34
+ setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));
35
+ setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));
36
+ setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));
37
+ setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));
38
+ className = dom.getAttrib(elm, 'class');
39
+
40
+ addClassesToList('classlist', 'advlink_styles');
41
+ selectByValue(f, 'classlist', className, true);
42
+
43
+ TinyMCE_EditableSelects.init();
44
+ }
45
+
46
+ function setFormValue(name, value) {
47
+ if(value && document.forms[0].elements[name]){
48
+ document.forms[0].elements[name].value = value;
49
+ }
50
+ }
51
+
52
+ function insertAction() {
53
+ var inst = tinyMCEPopup.editor;
54
+ var elm = inst.selection.getNode();
55
+
56
+ setAllAttribs(elm);
57
+ tinyMCEPopup.execCommand("mceEndUndoLevel");
58
+ tinyMCEPopup.close();
59
+ }
60
+
61
+ function setAttrib(elm, attrib, value) {
62
+ var formObj = document.forms[0];
63
+ var valueElm = formObj.elements[attrib.toLowerCase()];
64
+ var inst = tinyMCEPopup.editor;
65
+ var dom = inst.dom;
66
+
67
+ if (typeof(value) == "undefined" || value == null) {
68
+ value = "";
69
+
70
+ if (valueElm)
71
+ value = valueElm.value;
72
+ }
73
+
74
+ dom.setAttrib(elm, attrib.toLowerCase(), value);
75
+ }
76
+
77
+ function setAllAttribs(elm) {
78
+ var f = document.forms[0];
79
+
80
+ setAttrib(elm, 'title');
81
+ setAttrib(elm, 'id');
82
+ setAttrib(elm, 'style');
83
+ setAttrib(elm, 'class', getSelectValue(f, 'classlist'));
84
+ setAttrib(elm, 'dir');
85
+ setAttrib(elm, 'lang');
86
+ setAttrib(elm, 'tabindex');
87
+ setAttrib(elm, 'accesskey');
88
+ setAttrib(elm, 'onfocus');
89
+ setAttrib(elm, 'onblur');
90
+ setAttrib(elm, 'onclick');
91
+ setAttrib(elm, 'ondblclick');
92
+ setAttrib(elm, 'onmousedown');
93
+ setAttrib(elm, 'onmouseup');
94
+ setAttrib(elm, 'onmouseover');
95
+ setAttrib(elm, 'onmousemove');
96
+ setAttrib(elm, 'onmouseout');
97
+ setAttrib(elm, 'onkeypress');
98
+ setAttrib(elm, 'onkeydown');
99
+ setAttrib(elm, 'onkeyup');
100
+
101
+ // Refresh in old MSIE
102
+ // if (tinyMCE.isMSIE5)
103
+ // elm.outerHTML = elm.outerHTML;
104
+ }
105
+
106
+ function insertAttribute() {
107
+ tinyMCEPopup.close();
108
+ }
109
+
110
+ tinyMCEPopup.onInit.add(init);
111
+ tinyMCEPopup.requireLangPack();
tiny_mce/plugins/xhtmlxtras/js/cite.js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * cite.js
3
+ *
4
+ * Copyright 2009, Moxiecode Systems AB
5
+ * Released under LGPL License.
6
+ *
7
+ * License: http://tinymce.moxiecode.com/license
8
+ * Contributing: http://tinymce.moxiecode.com/contributing
9
+ */
10
+
11
+ function init() {
12
+ SXE.initElementDialog('cite');
13
+ if (SXE.currentAction == "update") {
14
+ SXE.showRemoveButton();
15
+ }
16
+ }
17
+
18
+ function insertCite() {
19
+ SXE.insertElement('cite');
20
+ tinyMCEPopup.close();
21
+ }
22
+
23
+ function removeCite() {
24
+ SXE.removeElement('cite');
25
+ tinyMCEPopup.close();
26
+ }
27
+
28
+ tinyMCEPopup.onInit.add(init);
tiny_mce/plugins/xhtmlxtras/js/del.js ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * del.js
3
+ *
4
+ * Copyright 2009, Moxiecode Systems AB
5
+ * Released under LGPL License.
6
+ *
7
+ * License: http://tinymce.moxiecode.com/license
8
+ * Contributing: http://tinymce.moxiecode.com/contributing
9
+ */
10
+
11
+ function init() {
12
+ SXE.initElementDialog('del');
13
+ if (SXE.currentAction == "update") {
14
+ setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));
15
+ setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));
16
+ SXE.showRemoveButton();
17
+ }
18
+ }
19
+
20
+ function setElementAttribs(elm) {
21
+ setAllCommonAttribs(elm);
22
+ setAttrib(elm, 'datetime');
23
+ setAttrib(elm, 'cite');
24
+ elm.removeAttribute('data-mce-new');
25
+ }
26
+
27
+ function insertDel() {
28
+ var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL');
29
+
30
+ if (elm == null) {
31
+ var s = SXE.inst.selection.getContent();
32
+ if(s.length > 0) {
33
+ insertInlineElement('del');
34
+ var elementArray = SXE.inst.dom.select('del[data-mce-new]');
35
+ for (var i=0; i<elementArray.length; i++) {
36
+ var elm = elementArray[i];
37
+ setElementAttribs(elm);
38
+ }
39
+ }
40
+ } else {
41
+ setElementAttribs(elm);
42
+ }
43
+ tinyMCEPopup.editor.nodeChanged();
44
+ tinyMCEPopup.execCommand('mceEndUndoLevel');
45
+ tinyMCEPopup.close();
46
+ }
47
+
48
+ function removeDel() {
49
+ SXE.removeElement('del');
50
+ tinyMCEPopup.close();
51
+ }
52
+
53
+ tinyMCEPopup.onInit.add(init);
tiny_mce/plugins/xhtmlxtras/js/element_common.js ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * element_common.js
3
+ *
4
+ * Copyright 2009, Moxiecode Systems AB
5
+ * Released under LGPL License.
6
+ *
7
+ * License: http://tinymce.moxiecode.com/license
8
+ * Contributing: http://tinymce.moxiecode.com/contributing
9
+ */
10
+
11
+ tinyMCEPopup.requireLangPack();
12
+
13
+ function initCommonAttributes(elm) {
14
+ var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
15
+
16
+ // Setup form data for common element attributes
17
+ setFormValue('title', dom.getAttrib(elm, 'title'));
18
+ setFormValue('id', dom.getAttrib(elm, 'id'));
19
+ selectByValue(formObj, 'class', dom.getAttrib(elm, 'class'), true);
20
+ setFormValue('style', dom.getAttrib(elm, 'style'));
21
+ selectByValue(formObj, 'dir', dom.getAttrib(elm, 'dir'));
22
+ setFormValue('lang', dom.getAttrib(elm, 'lang'));
23
+ setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));
24
+ setFormValue('onblur', dom.getAttrib(elm, 'onblur'));
25
+ setFormValue('onclick', dom.getAttrib(elm, 'onclick'));
26
+ setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));
27
+ setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));
28
+ setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));
29
+ setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));
30
+ setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));
31
+ setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));
32
+ setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));
33
+ setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));
34
+ setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));
35
+ }
36
+
37
+ function setFormValue(name, value) {
38
+ if(document.forms[0].elements[name]) document.forms[0].elements[name].value = value;
39
+ }
40
+
41
+ function insertDateTime(id) {
42
+ document.getElementById(id).value = getDateTime(new Date(), "%Y-%m-%dT%H:%M:%S");
43
+ }
44
+
45
+ function getDateTime(d, fmt) {
46
+ fmt = fmt.replace("%D", "%m/%d/%y");
47
+ fmt = fmt.replace("%r", "%I:%M:%S %p");
48
+ fmt = fmt.replace("%Y", "" + d.getFullYear());
49
+ fmt = fmt.replace("%y", "" + d.getYear());
50
+ fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
51
+ fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
52
+ fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
53
+ fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
54
+ fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
55
+ fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
56
+ fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
57
+ fmt = fmt.replace("%%", "%");
58
+
59
+ return fmt;
60
+ }
61
+
62
+ function addZeros(value, len) {
63
+ var i;
64
+
65
+ value = "" + value;
66
+
67
+ if (value.length < len) {
68
+ for (i=0; i<(len-value.length); i++)
69
+ value = "0" + value;
70
+ }
71
+
72
+ return value;
73
+ }
74
+
75
+ function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
76
+ if (!form_obj || !form_obj.elements[field_name])
77
+ return;
78
+
79
+ var sel = form_obj.elements[field_name];
80
+
81
+ var found = false;
82
+ for (var i=0; i<sel.options.length; i++) {
83
+ var option = sel.options[i];
84
+
85
+ if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
86
+ option.selected = true;
87
+ found = true;
88
+ } else
89
+ option.selected = false;
90
+ }
91
+
92
+ if (!found && add_custom && value != '') {
93
+ var option = new Option('Value: ' + value, value);
94
+ option.selected = true;
95
+ sel.options[sel.options.length] = option;
96
+ }
97
+
98
+ return found;
99
+ }
100
+
101
+ function setAttrib(elm, attrib, value) {
102
+ var formObj = document.forms[0];
103
+ var valueElm = formObj.elements[attrib.toLowerCase()];
104
+ tinyMCEPopup.editor.dom.setAttrib(elm, attrib, value || valueElm.value);
105
+ }
106
+
107
+ function setAllCommonAttribs(elm) {
108
+ setAttrib(elm, 'title');
109
+ setAttrib(elm, 'id');
110
+ setAttrib(elm, 'class');
111
+ setAttrib(elm, 'style');
112
+ setAttrib(elm, 'dir');
113
+ setAttrib(elm, 'lang');
114
+ /*setAttrib(elm, 'onfocus');
115
+ setAttrib(elm, 'onblur');
116
+ setAttrib(elm, 'onclick');
117
+ setAttrib(elm, 'ondblclick');
118
+ setAttrib(elm, 'onmousedown');
119
+ setAttrib(elm, 'onmouseup');
120
+ setAttrib(elm, 'onmouseover');
121
+ setAttrib(elm, 'onmousemove');
122
+ setAttrib(elm, 'onmouseout');
123
+ setAttrib(elm, 'onkeypress');
124
+ setAttrib(elm, 'onkeydown');
125
+ setAttrib(elm, 'onkeyup');*/
126
+ }
127
+
128
+ SXE = {
129
+ currentAction : "insert",
130
+ inst : tinyMCEPopup.editor,
131
+ updateElement : null
132
+ }
133
+
134
+ SXE.focusElement = SXE.inst.selection.getNode();
135
+
136
+ SXE.initElementDialog = function(element_name) {
137
+ addClassesToList('class', 'xhtmlxtras_styles');
138
+ TinyMCE_EditableSelects.init();
139
+
140
+ element_name = element_name.toLowerCase();
141
+ var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());
142
+ if (elm != null && elm.nodeName.toUpperCase() == element_name.toUpperCase()) {
143
+ SXE.currentAction = "update";
144
+ }
145
+
146
+ if (SXE.currentAction == "update") {
147
+ initCommonAttributes(elm);
148
+ SXE.updateElement = elm;
149
+ }
150
+
151
+ document.forms[0].insert.value = tinyMCEPopup.getLang(SXE.currentAction, 'Insert', true);
152
+ }
153
+
154
+ SXE.insertElement = function(element_name) {
155
+ var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()), h, tagName;
156
+
157
+ if (elm == null) {
158
+ var s = SXE.inst.selection.getContent();
159
+ if(s.length > 0) {
160
+ tagName = element_name;
161
+
162
+ insertInlineElement(element_name);
163
+ var elementArray = tinymce.grep(SXE.inst.dom.select(element_name));
164
+ for (var i=0; i<elementArray.length; i++) {
165
+ var elm = elementArray[i];
166
+
167
+ if (SXE.inst.dom.getAttrib(elm, 'data-mce-new')) {
168
+ elm.id = '';
169
+ elm.setAttribute('id', '');
170
+ elm.removeAttribute('id');
171
+ elm.removeAttribute('data-mce-new');
172
+
173
+ setAllCommonAttribs(elm);
174
+ }
175
+ }
176
+ }
177
+ } else {
178
+ setAllCommonAttribs(elm);
179
+ }
180
+ SXE.inst.nodeChanged();
181
+ tinyMCEPopup.execCommand('mceEndUndoLevel');
182
+ }
183
+
184
+ SXE.removeElement = function(element_name){
185
+ element_name = element_name.toLowerCase();
186
+ elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());
187
+ if(elm && elm.nodeName.toUpperCase() == element_name.toUpperCase()){
188
+ tinyMCE.execCommand('mceRemoveNode', false, elm);
189
+ SXE.inst.nodeChanged();
190
+ tinyMCEPopup.execCommand('mceEndUndoLevel');
191
+ }
192
+ }
193
+
194
+ SXE.showRemoveButton = function() {
195
+ document.getElementById("remove").style.display = '';
196
+ }
197
+
198
+ SXE.containsClass = function(elm,cl) {
199
+ return (elm.className.indexOf(cl) > -1) ? true : false;
200
+ }
201
+
202
+ SXE.removeClass = function(elm,cl) {
203
+ if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) {
204
+ return true;
205
+ }
206
+ var classNames = elm.className.split(" ");
207
+ var newClassNames = "";
208
+ for (var x = 0, cnl = classNames.length; x < cnl; x++) {
209
+ if (classNames[x] != cl) {
210
+ newClassNames += (classNames[x] + " ");
211
+ }
212
+ }
213
+ elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end
214
+ }
215
+
216
+ SXE.addClass = function(elm,cl) {
217
+ if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl;
218
+ return true;
219
+ }
220
+
221
+ function insertInlineElement(en) {
222
+ var ed = tinyMCEPopup.editor, dom = ed.dom;
223
+
224
+ ed.getDoc().execCommand('FontName', false, 'mceinline');
225
+ tinymce.each(dom.select('span,font'), function(n) {
226
+ if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')
227
+ dom.replace(dom.create(en, {'data-mce-new' : 1}), n, 1);
228
+ });
229
+ }
tiny_mce/plugins/xhtmlxtras/js/ins.js ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * ins.js
3
+ *
4
+ * Copyright 2009, Moxiecode Systems AB
5
+ * Released under LGPL License.
6
+ *
7
+ * License: http://tinymce.moxiecode.com/license
8
+ * Contributing: http://tinymce.moxiecode.com/contributing
9
+ */
10
+
11
+ function init() {
12
+ SXE.initElementDialog('ins');
13
+ if (SXE.currentAction == "update") {
14
+ setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));
15
+ setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));
16
+ SXE.showRemoveButton();
17
+ }
18
+ }
19
+
20
+ function setElementAttribs(elm) {
21
+ setAllCommonAttribs(elm);
22
+ setAttrib(elm, 'datetime');
23
+ setAttrib(elm, 'cite');
24
+ elm.removeAttribute('data-mce-new');
25
+ }
26
+
27
+ function insertIns() {
28
+ var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS');
29
+
30
+ if (elm == null) {
31
+ var s = SXE.inst.selection.getContent();
32
+ if(s.length > 0) {
33
+ insertInlineElement('ins');
34
+ var elementArray = SXE.inst.dom.select('ins[data-mce-new]');
35
+ for (var i=0; i<elementArray.length; i++) {
36
+ var elm = elementArray[i];
37
+ setElementAttribs(elm);
38
+ }
39
+ }
40
+ } else {
41
+ setElementAttribs(elm);
42
+ }
43
+ tinyMCEPopup.editor.nodeChanged();
44
+ tinyMCEPopup.execCommand('mceEndUndoLevel');
45
+ tinyMCEPopup.close();
46
+ }
47
+
48
+ function removeIns() {
49
+ SXE.removeElement('ins');
50
+ tinyMCEPopup.close();
51
+ }
52
+
53
+ tinyMCEPopup.onInit.add(init);
tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js ADDED
@@ -0,0 +1 @@
 
1
+ tinyMCE.addI18n('en.xhtmlxtras_dlg',{"attribs_title":"Insert/Edit Attributes","option_rtl":"Right to Left","option_ltr":"Left to Right","insert_date":"Insert Current Date/Time",remove:"Remove","title_cite_element":"Citation Element","title_abbr_element":"Abbreviation Element","title_acronym_element":"Acronym Element","title_del_element":"Deletion Element","title_ins_element":"Insertion Element","fieldset_events_tab":"Element Events","fieldset_attrib_tab":"Element Attributes","fieldset_general_tab":"General Settings","events_tab":"Events","attrib_tab":"Attributes","general_tab":"General","attribute_attrib_tab":"Attributes","attribute_events_tab":"Events","attribute_label_accesskey":"AccessKey","attribute_label_tabindex":"TabIndex","attribute_label_langcode":"Language","attribute_option_rtl":"Right to Left","attribute_option_ltr":"Left to Right","attribute_label_langdir":"Text Direction","attribute_label_datetime":"Date/Time","attribute_label_cite":"Cite","attribute_label_style":"Style","attribute_label_class":"Class","attribute_label_id":"ID","attribute_label_title":"Title"});
tiny_mce/themes/advanced/about.htm CHANGED
@@ -9,9 +9,9 @@
9
  <body id="about" style="display: none">
10
  <div class="tabs">
11
  <ul>
12
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.about_general}</a></span></li>
13
- <li id="help_tab" style="display:none"><span><a href="javascript:mcTabs.displayTab('help_tab','help_panel');" onmousedown="return false;">{#advanced_dlg.about_help}</a></span></li>
14
- <li id="plugins_tab"><span><a href="javascript:mcTabs.displayTab('plugins_tab','plugins_panel');" onmousedown="return false;">{#advanced_dlg.about_plugins}</a></span></li>
15
  </ul>
16
  </div>
17
 
@@ -26,8 +26,6 @@
26
 
27
  <div id="buttoncontainer">
28
  <a href="http://www.moxiecode.com" target="_blank"><img src="http://tinymce.moxiecode.com/images/gotmoxie.png" alt="Got Moxie?" border="0" /></a>
29
- <a href="http://sourceforge.net/projects/tinymce/" target="_blank"><img src="http://sourceforge.net/sflogo.php?group_id=103281" alt="Hosted By Sourceforge" border="0" /></a>
30
- <a href="http://www.freshmeat.net/projects/tinymce" target="_blank"><img src="http://tinymce.moxiecode.com/images/fm.gif" alt="Also on freshmeat" border="0" /></a>
31
  </div>
32
  </div>
33
 
9
  <body id="about" style="display: none">
10
  <div class="tabs">
11
  <ul>
12
+ <li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.about_general}</a></span></li>
13
+ <li id="help_tab" style="display:none" aria-hidden="true" aria-controls="help_panel"><span><a href="javascript:mcTabs.displayTab('help_tab','help_panel');" onmousedown="return false;">{#advanced_dlg.about_help}</a></span></li>
14
+ <li id="plugins_tab" aria-controls="plugins_panel"><span><a href="javascript:mcTabs.displayTab('plugins_tab','plugins_panel');" onmousedown="return false;">{#advanced_dlg.about_plugins}</a></span></li>
15
  </ul>
16
  </div>
17
 
26
 
27
  <div id="buttoncontainer">
28
  <a href="http://www.moxiecode.com" target="_blank"><img src="http://tinymce.moxiecode.com/images/gotmoxie.png" alt="Got Moxie?" border="0" /></a>
 
 
29
  </div>
30
  </div>
31
 
tiny_mce/themes/advanced/anchor.htm CHANGED
@@ -5,15 +5,15 @@
5
  <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
  <script type="text/javascript" src="js/anchor.js"></script>
7
  </head>
8
- <body style="display: none">
9
  <form onsubmit="AnchorDialog.update();return false;" action="#">
10
- <table border="0" cellpadding="4" cellspacing="0">
11
  <tr>
12
- <td colspan="2" class="title">{#advanced_dlg.anchor_title}</td>
13
  </tr>
14
  <tr>
15
- <td class="nowrap">{#advanced_dlg.anchor_name}:</td>
16
- <td><input name="anchorName" type="text" class="mceFocus" id="anchorName" value="" style="width: 200px" /></td>
17
  </tr>
18
  </table>
19
 
5
  <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
  <script type="text/javascript" src="js/anchor.js"></script>
7
  </head>
8
+ <body style="display: none" role="application" aria-labelledby="app_title">
9
  <form onsubmit="AnchorDialog.update();return false;" action="#">
10
+ <table border="0" cellpadding="4" cellspacing="0" role="presentation">
11
  <tr>
12
+ <td colspan="2" class="title" id="app_title">{#advanced_dlg.anchor_title}</td>
13
  </tr>
14
  <tr>
15
+ <td class="nowrap"><label for="anchorName">{#advanced_dlg.anchor_name}:</label></td>
16
+ <td><input name="anchorName" type="text" class="mceFocus" id="anchorName" value="" style="width: 200px" aria-required="true" /></td>
17
  </tr>
18
  </table>
19
 
tiny_mce/themes/advanced/charmap.htm CHANGED
@@ -2,52 +2,54 @@
2
  <html xmlns="http://www.w3.org/1999/xhtml">
3
  <head>
4
  <title>{#advanced_dlg.charmap_title}</title>
5
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
6
  <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
7
  <script type="text/javascript" src="js/charmap.js"></script>
8
  </head>
9
- <body id="charmap" style="display:none">
10
- <table align="center" border="0" cellspacing="0" cellpadding="2">
11
- <tr>
12
- <td colspan="2" class="title">{#advanced_dlg.charmap_title}</td>
13
- </tr>
14
- <tr>
15
- <td id="charmapView" rowspan="2" align="left" valign="top">
16
  <!-- Chars will be rendered here -->
17
- </td>
18
- <td width="100" align="center" valign="top">
19
- <table border="0" cellpadding="0" cellspacing="0" width="100" style="height:100px">
20
- <tr>
21
- <td id="codeV">&nbsp;</td>
22
- </tr>
23
- <tr>
24
- <td id="codeN">&nbsp;</td>
25
- </tr>
26
- </table>
27
- </td>
28
- </tr>
29
- <tr>
30
- <td valign="bottom" style="padding-bottom: 3px;">
31
- <table width="100" align="center" border="0" cellpadding="2" cellspacing="0">
32
- <tr>
33
- <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;">HTML-Code</td>
34
- </tr>
35
- <tr>
36
- <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeA" align="center">&nbsp;</td>
37
- </tr>
38
- <tr>
39
- <td style="font-size: 1px;">&nbsp;</td>
40
- </tr>
41
- <tr>
42
- <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;">NUM-Code</td>
43
- </tr>
44
- <tr>
45
- <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeB" align="center">&nbsp;</td>
46
- </tr>
47
- </table>
48
- </td>
49
- </tr>
 
 
 
 
50
  </table>
51
-
52
  </body>
53
  </html>
2
  <html xmlns="http://www.w3.org/1999/xhtml">
3
  <head>
4
  <title>{#advanced_dlg.charmap_title}</title>
 
5
  <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
  <script type="text/javascript" src="js/charmap.js"></script>
7
  </head>
8
+ <body id="charmap" style="display:none" role="application">
9
+ <table align="center" border="0" cellspacing="0" cellpadding="2" role="presentation">
10
+ <tr>
11
+ <td colspan="2" class="title" ><label for="charmapView" id="charmap_label">{#advanced_dlg.charmap_title}</label></td>
12
+ </tr>
13
+ <tr>
14
+ <td id="charmapView" rowspan="2" align="left" valign="top">
15
  <!-- Chars will be rendered here -->
16
+ </td>
17
+ <td width="100" align="center" valign="top">
18
+ <table border="0" cellpadding="0" cellspacing="0" width="100" style="height:100px" role="presentation">
19
+ <tr>
20
+ <td id="codeV">&nbsp;</td>
21
+ </tr>
22
+ <tr>
23
+ <td id="codeN">&nbsp;</td>
24
+ </tr>
25
+ </table>
26
+ </td>
27
+ </tr>
28
+ <tr>
29
+ <td valign="bottom" style="padding-bottom: 3px;">
30
+ <table width="100" align="center" border="0" cellpadding="2" cellspacing="0" role="presentation">
31
+ <tr>
32
+ <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;"><label for="codeA">HTML-Code</label></td>
33
+ </tr>
34
+ <tr>
35
+ <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeA" align="center">&nbsp;</td>
36
+ </tr>
37
+ <tr>
38
+ <td style="font-size: 1px;">&nbsp;</td>
39
+ </tr>
40
+ <tr>
41
+ <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;"><label for="codeB">NUM-Code</label></td>
42
+ </tr>
43
+ <tr>
44
+ <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeB" align="center">&nbsp;</td>
45
+ </tr>
46
+ </table>
47
+ </td>
48
+ </tr>
49
+ <tr>
50
+ <td colspan="2" id="charmap_usage">{#advanced_dlg.charmap_usage}</td>
51
+ </tr>
52
+
53
  </table>
 
54
  </body>
55
  </html>
tiny_mce/themes/advanced/color_picker.htm CHANGED
@@ -6,13 +6,14 @@
6
  <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
  <script type="text/javascript" src="js/color_picker.js"></script>
8
  </head>
9
- <body id="colorpicker" style="display: none">
 
10
  <form onsubmit="insertAction();return false" action="#">
11
  <div class="tabs">
12
  <ul>
13
- <li id="picker_tab" class="current"><span><a href="javascript:mcTabs.displayTab('picker_tab','picker_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_picker_tab}</a></span></li>
14
- <li id="rgb_tab"><span><a href="javascript:;" onclick="generateWebColors();mcTabs.displayTab('rgb_tab','rgb_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_palette_tab}</a></span></li>
15
- <li id="named_tab"><span><a href="javascript:;" onclick="generateNamedColors();javascript:mcTabs.displayTab('named_tab','named_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_named_tab}</a></span></li>
16
  </ul>
17
  </div>
18
 
@@ -34,7 +35,7 @@
34
 
35
  <div id="rgb_panel" class="panel">
36
  <fieldset>
37
- <legend>{#advanced_dlg.colorpicker_palette_title}</legend>
38
  <div id="webcolors">
39
  <!-- Gets filled with web safe colors-->
40
  </div>
@@ -44,9 +45,9 @@
44
  </div>
45
 
46
  <div id="named_panel" class="panel">
47
- <fieldset>
48
- <legend>{#advanced_dlg.colorpicker_named_title}</legend>
49
- <div id="namedcolors">
50
  <!-- Gets filled with named colors-->
51
  </div>
52
 
@@ -65,7 +66,7 @@
65
  <div id="preview"></div>
66
 
67
  <div id="previewblock">
68
- <label for="color">{#advanced_dlg.colorpicker_color}</label> <input id="color" type="text" size="8" maxlength="8" class="text mceFocus" />
69
  </div>
70
  </div>
71
  </form>
6
  <script type="text/javascript" src="../../utils/mctabs.js"></script>
7
  <script type="text/javascript" src="js/color_picker.js"></script>
8
  </head>
9
+ <body id="colorpicker" style="display: none" role="application" aria-labelledby="app_label">
10
+ <span class="mceVoiceLabel" id="app_label" style="display:none;">{#advanced_dlg.colorpicker_title}</span>
11
  <form onsubmit="insertAction();return false" action="#">
12
  <div class="tabs">
13
  <ul>
14
+ <li id="picker_tab" aria-controls="picker_panel" class="current"><span><a href="javascript:mcTabs.displayTab('picker_tab','picker_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_picker_tab}</a></span></li>
15
+ <li id="rgb_tab" aria-controls="rgb_panel"><span><a href="javascript:;" onclick="mcTabs.displayTab('rgb_tab','rgb_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_palette_tab}</a></span></li>
16
+ <li id="named_tab" aria-controls="named_panel"><span><a href="javascript:;" onclick="javascript:mcTabs.displayTab('named_tab','named_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_named_tab}</a></span></li>
17
  </ul>
18
  </div>
19
 
35
 
36
  <div id="rgb_panel" class="panel">
37
  <fieldset>
38
+ <legend id="webcolors_title">{#advanced_dlg.colorpicker_palette_title}</legend>
39
  <div id="webcolors">
40
  <!-- Gets filled with web safe colors-->
41
  </div>
45
  </div>
46
 
47
  <div id="named_panel" class="panel">
48
+ <fieldset id="named_picker_label">
49
+ <legend id="named_title">{#advanced_dlg.colorpicker_named_title}</legend>
50
+ <div id="namedcolors" role="listbox" tabindex="0" aria-labelledby="named_picker_label">
51
  <!-- Gets filled with named colors-->
52
  </div>
53
 
66
  <div id="preview"></div>
67
 
68
  <div id="previewblock">
69
+ <label for="color">{#advanced_dlg.colorpicker_color}</label> <input id="color" type="text" size="8" class="text mceFocus" aria-required="true" />
70
  </div>
71
  </div>
72
  </form>
tiny_mce/themes/advanced/editor_template.js CHANGED
@@ -1 +1 @@
1
- (function(e){var d=e.DOM,b=e.dom.Event,h=e.extend,f=e.each,a=e.util.Cookie,g,c=e.explode;e.ThemeManager.requireLangPack("advanced");e.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(j,k){var l=this,m,i,n;l.editor=j;l.url=k;l.onResolveName=new e.util.Dispatcher(this);l.settings=m=h({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",readonly:j.settings.readonly},j.settings);if(!m.font_size_style_values){m.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(e.is(m.theme_advanced_font_sizes,"string")){m.font_size_style_values=e.explode(m.font_size_style_values);m.font_size_classes=e.explode(m.font_size_classes||"");n={};j.settings.theme_advanced_font_sizes=m.theme_advanced_font_sizes;f(j.getParam("theme_advanced_font_sizes","","hash"),function(q,p){var o;if(p==q&&q>=1&&q<=7){p=q+" ("+l.sizes[q-1]+"pt)";o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+"pt")}if(/^\s*\./.test(q)){o=q.replace(/\./g,"")}n[p]=o?{"class":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!="none"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location=="none"){m.theme_advanced_statusbar_location=0}j.onInit.add(function(){if(!j.settings.readonly){j.onNodeChange.add(l._nodeChanged,l)}if(j.settings.content_css!==false){j.dom.loadCSS(j.baseURI.toAbsolute("themes/advanced/skins/"+j.settings.skin+"/content.css"))}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create("DIV",{style:"position:relative"}),s.firstChild);p=d.get(q.id+"_tbl");d.add(s,"div",{id:t+"_blocker","class":"mceBlocker",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,"div",{id:t+"_progress","class":"mceProgress",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+"_blocker");d.remove(t+"_progress");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+"/skins/"+j.settings.skin+"/ui.css");if(m.skin_variant){d.loadCSS(k+"/skins/"+j.settings.skin+"/ui_"+m.skin_variant+".css")}},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((j=this.controls[l])){return i.createButton(l,{title:"advanced."+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this["_"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(k){var i=this.editor,j=i.controlManager.get("styleselect");if(j.getLength()==0){f(i.dom.getClasses(),function(n,l){var m="style_"+l;i.formatter.register(m,{inline:"span",classes:n["class"]});j.add(n["class"],m)})}},_createStyleSelect:function(m){var k=this,i=k.editor,j=i.controlManager,l;l=j.createListBox("styleselect",{title:"advanced.style_select",onselect:function(n){i.focus();i.formatter.toggle(n);return false}});i.onInit.add(function(){var o=0,n=i.getParam("style_formats");if(n){f(n,function(p){var q,r=0;f(p,function(){r++});if(r>1){q=p.name=p.name||"style_"+(o++);i.formatter.register(q,p);l.add(p.title,q)}else{l.add(p.title)}})}else{f(i.getParam("theme_advanced_styles","","hash"),function(r,q){var p;if(r){p="style_"+(o++);i.formatter.register(p,{inline:"span",classes:r});l.add(k.editor.translate(q),p)}})}});if(l.getLength()==0){l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+"_text","focus",k._importClasses,k);b.add(p.id+"_text","mousedown",k._importClasses,k);b.add(p.id+"_open","focus",k._importClasses,k);b.add(p.id+"_open","mousedown",k._importClasses,k)}else{b.add(p.id,"focus",k._importClasses,k)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(l){i.execCommand("FontName",false,l);return false}});if(k){f(i.getParam("theme_advanced_fonts",j.settings.theme_advanced_fonts,"hash"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(i){if(i.fontSize){k.execCommand("FontSize",false,i.fontSize)}else{f(m.settings.theme_advanced_font_sizes,function(p,o){if(p["class"]){j.push(p["class"])}});k.editorCommands._applyInlineStyle("span",{"class":i["class"]},{check_classes:j})}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+"pt"}n.add(i,o,{style:"font-size:"+p,"class":"mceFontSize"+(l++)+(" "+(o["class"]||""))})})}return n},_createBlockFormats:function(){var k,i={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},j=this;k=j.editor.controlManager.createListBox("formatselect",{title:"advanced.block",cmd:"FormatBlock"});if(k){f(j.editor.getParam("theme_advanced_blockformats",j.settings.theme_advanced_blockformats,"hash"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{"class":"mce_formatPreview mce_"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title="advanced.forecolor_desc";l.cmd="ForeColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("forecolor",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title="advanced.backcolor_desc";l.cmd="HiliteColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("backcolor",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j,i;m=j=d.create("span",{id:r.id+"_parent","class":"mceEditor "+r.settings.skin+"Skin"+(w.skin_variant?" "+r.settings.skin+"Skin"+v._ufirst(w.skin_variant):"")});if(!d.boxModel){m=d.add(m,"div",{"class":"mceOldBoxModel"})}m=u=d.add(m,"table",{id:r.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});m=q=d.add(m,"tbody");switch((w.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":l=v._rowLayout(w,q,k);break;case"customlayout":l=r.execCallback("theme_advanced_custom_layout",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=d.stdMode?u.getElementsByTagName("tr"):u.rows;d.addClass(i[0],"mceFirst");d.addClass(i[i.length-1],"mceLast");f(d.select("tr",q),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!r.getParam("accessibility_focus")){b.add(d.add(j,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location=="external"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;k.targetNode=null;return{iframeContainer:l,editorContainer:r.id+"_parent",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:e.majorVersion+"."+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+"_tbl");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,l){var j=this.editor,k=j.settings,n=d.get(j.id+"_tbl"),o=d.get(j.id+"_ifr"),m;i=Math.max(k.theme_advanced_resizing_min_width||100,i);l=Math.max(k.theme_advanced_resizing_min_height||100,l);i=Math.min(k.theme_advanced_resizing_max_width||65535,i);l=Math.min(k.theme_advanced_resizing_max_height||65535,l);m=n.clientHeight-o.clientHeight;d.setStyle(o,"height",l-m);d.setStyles(n,{width:i,height:l})},destroy:function(){var i=this.editor.id;b.clear(i+"_resize");b.clear(i+"_path_row");b.clear(i+"_external_close")},_simpleLayout:function(y,r,k,i){var x=this,u=x.editor,v=y.theme_advanced_toolbar_location,m=y.theme_advanced_statusbar_location,l,j,q,w;if(y.readonly){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});return j}if(v=="top"){x._addToolbars(r,k)}if(v=="external"){l=w=d.create("div",{style:"position:relative"});l=d.add(l,"div",{id:u.id+"_external","class":"mceExternalToolbar"});d.add(l,"a",{id:u.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});l=d.add(l,"table",{id:u.id+"_tblext",cellSpacing:0,cellPadding:0});q=d.add(l,"tbody");if(i.firstChild.className=="mceOldBoxModel"){i.firstChild.appendChild(w)}else{i.insertBefore(w,i.firstChild)}x._addToolbars(q,k);u.onMouseUp.add(function(){var o=d.get(u.id+"_external");d.show(o);d.hide(g);var n=b.add(u.id+"_external_close","click",function(){d.hide(u.id+"_external");b.remove(u.id+"_external_close","click",n)});d.show(o);d.setStyle(o,"top",0-d.getRect(u.id+"_tblext").h-1);d.hide(o);d.show(o);o.style.filter="";g=u.id+"_external";o=null})}if(m=="top"){x._addStatusBar(r,k)}if(!y.theme_advanced_toolbar_container){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"})}if(v=="bottom"){x._addToolbars(r,k)}if(m=="bottom"){x._addStatusBar(r,k)}return j},_rowLayout:function(w,m,k){var v=this,p=v.editor,u,x,i=p.controlManager,l,j,r,q;u=w.theme_advanced_containers_default_class||"";x=w.theme_advanced_containers_default_align||"center";f(c(w.theme_advanced_containers||""),function(s,o){var n=w["theme_advanced_container_"+s]||"";switch(n.toLowerCase()){case"mceeditor":l=d.add(m,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":v._addStatusBar(m,k);break;default:q=(w["theme_advanced_container_"+s+"_align"]||x).toLowerCase();q="mce"+v._ufirst(q);l=d.add(d.add(m,"tr"),"td",{"class":"mceToolbar "+(w["theme_advanced_container_"+s+"_class"]||u)+" "+q||x});r=i.createToolbar("toolbar"+o);v._addControls(n,r);d.setHTML(l,r.renderHTML());k.deltaHeight-=w.theme_advanced_row_height}});return j},_addControls:function(j,i){var k=this,l=k.settings,m,n=k.editor.controlManager;if(l.theme_advanced_disable&&!k._disabled){m={};f(c(l.theme_advanced_disable),function(o){m[o]=1});k._disabled=m}else{m=k._disabled}f(c(j),function(p){var o;if(m&&m[p]){return}if(p=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(q){q=k.createControl(q,n);if(q){i.add(q)}});return}o=k.createControl(p,n);if(o){i.add(o)}})},_addToolbars:function(w,k){var z=this,p,m,r=z.editor,A=z.settings,y,j=r.controlManager,u,l,q=[],x;x=A.theme_advanced_toolbar_align.toLowerCase();x="mce"+z._ufirst(x);l=d.add(d.add(w,"tr"),"td",{"class":"mceToolbar "+x});if(!r.getParam("accessibility_focus")){q.push(d.createHTML("a",{href:"#",onfocus:"tinyMCE.get('"+r.id+"').focus();"},"<!-- IE -->"))}q.push(d.createHTML("a",{href:"#",accesskey:"q",title:r.getLang("advanced.toolbar_focus")},"<!-- IE -->"));for(p=1;(y=A["theme_advanced_buttons"+p]);p++){m=j.createToolbar("toolbar"+p,{"class":"mceToolbarRow"+p});if(A["theme_advanced_buttons"+p+"_add"]){y+=","+A["theme_advanced_buttons"+p+"_add"]}if(A["theme_advanced_buttons"+p+"_add_before"]){y=A["theme_advanced_buttons"+p+"_add_before"]+","+y}z._addControls(y,m);q.push(m.renderHTML());k.deltaHeight-=A.theme_advanced_row_height}q.push(d.createHTML("a",{href:"#",accesskey:"z",title:r.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+r.id+"').focus();"},"<!-- IE -->"));d.setHTML(l,q.join(""))},_addStatusBar:function(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,"tr");k=l=d.add(k,"td",{"class":"mceStatusbar"});k=d.add(k,"div",{id:p.id+"_path_row"},w.theme_advanced_path?p.translate("advanced.path")+": ":"&#160;");d.add(k,"a",{href:"#",accesskey:"x"});if(w.theme_advanced_resizing){d.add(l,"a",{id:p.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+p.id+"_size"),r=d.get(p.id+"_tbl");if(!n){return}if(w.theme_advanced_resize_horizontal){r.style.width=Math.max(10,n.cw)+"px"}r.style.height=Math.max(10,n.ch)+"px";d.get(p.id+"_ifr").style.height=Math.max(10,parseInt(n.ch)+v.deltaHeight)+"px"})}p.onPostRender.add(function(){b.add(p.id+"_resize","mousedown",function(x){var z,t,o,s,y,r;z=d.get(p.id+"_tbl");o=z.clientWidth;s=z.clientHeight;miw=w.theme_advanced_resizing_min_width||100;mih=w.theme_advanced_resizing_min_height||100;maw=w.theme_advanced_resizing_max_width||65535;mah=w.theme_advanced_resizing_max_height||65535;t=d.add(d.get(p.id+"_parent"),"div",{"class":"mcePlaceHolder"});d.setStyles(t,{width:o,height:s});d.hide(z);d.show(t);i={x:x.screenX,y:x.screenY,w:o,h:s,dx:null,dy:null};q=b.add(d.doc,"mousemove",function(B){var n,A;i.dx=B.screenX-i.x;i.dy=B.screenY-i.y;n=Math.max(miw,i.w+i.dx);A=Math.max(mih,i.h+i.dy);n=Math.min(maw,n);A=Math.min(mah,A);if(w.theme_advanced_resize_horizontal){t.style.width=n+"px"}t.style.height=A+"px";return b.cancel(B)});u=b.add(d.doc,"mouseup",function(n){var A;b.remove(d.doc,"mousemove",q);b.remove(d.doc,"mouseup",u);z.style.display="";d.remove(t);if(i.dx===null){return}A=d.get(p.id+"_ifr");if(w.theme_advanced_resize_horizontal){z.style.width=Math.max(10,i.w+i.dx)+"px"}z.style.height=Math.max(10,i.h+i.dy)+"px";A.style.height=Math.max(10,A.clientHeight+i.dy)+"px";if(w.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+p.id+"_size",{cw:i.w+i.dx,ch:i.h+i.dy})}});return b.cancel(x)})})}j.deltaHeight-=21;k=m=null},_nodeChanged:function(o,x,l,u,j){var A=this,i,w=0,z,q,B=A.settings,y,k,r;e.each(A.stateControls,function(n){x.setActive(n,o.queryCommandState(A.controls[n][1]))});function m(p){var s,n=j.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s<n.length;s++){if(t(n[s])){return n[s]}}}x.setActive("visualaid",o.hasVisual);x.setDisabled("undo",!o.undoManager.hasUndo()&&!o.typing);x.setDisabled("redo",!o.undoManager.hasRedo());x.setDisabled("outdent",!o.queryCommandState("Outdent"));i=m("A");if(q=x.get("link")){if(!i||!i.name){q.setDisabled(!i&&u);q.setActive(!!i)}}if(q=x.get("unlink")){q.setDisabled(!i&&u);q.setActive(!!i&&!i.name)}if(q=x.get("anchor")){q.setActive(!!i&&i.name)}i=m("IMG");if(q=x.get("image")){q.setActive(!!i&&l.className.indexOf("mceItem")==-1)}if(q=x.get("styleselect")){A._importClasses();q.select(function(n){return !!o.formatter.match(n)})}if(q=x.get("formatselect")){i=m(d.isBlock);if(i){q.select(i.nodeName.toLowerCase())}}m(function(p){if(p.nodeName==="SPAN"){if(!y&&p.className){y=p.className}if(!k&&p.style.fontSize){k=p.style.fontSize}if(!r&&p.style.fontFamily){r=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}}return false});if(q=x.get("fontselect")){q.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==r})}if(q=x.get("fontsizeselect")){if(B.theme_advanced_runtime_fontsize&&!k&&!y){k=o.dom.getStyle(l,"fontSize",true)}q.select(function(n){if(n.fontSize&&n.fontSize===k){return true}if(n["class"]&&n["class"]===y){return true}})}if(B.theme_advanced_path&&B.theme_advanced_statusbar_location){i=d.get(o.id+"_path")||d.add(o.id+"_path_row","span",{id:o.id+"_path"});d.setHTML(i,"");m(function(C){var p=C.nodeName.toLowerCase(),s,v,t="";if(C.nodeType!=1||C.nodeName==="BR"||(d.hasClass(C,"mceItemHidden")||d.hasClass(C,"mceItemRemoved"))){return}if(z=d.getAttrib(C,"mce_name")){p=z}if(e.isIE&&C.scopeName!=="HTML"){p=C.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(z=d.getAttrib(C,"src")){t+="src: "+z+" "}break;case"a":if(z=d.getAttrib(C,"name")){t+="name: "+z+" ";p+="#"+z}if(z=d.getAttrib(C,"href")){t+="href: "+z+" "}break;case"font":if(z=d.getAttrib(C,"face")){t+="font: "+z+" "}if(z=d.getAttrib(C,"size")){t+="size: "+z+" "}if(z=d.getAttrib(C,"color")){t+="color: "+z+" "}break;case"span":if(z=d.getAttrib(C,"style")){t+="style: "+z+" "}break}if(z=d.getAttrib(C,"id")){t+="id: "+z+" "}if(z=C.className){z=z.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(z){t+="class: "+z+" ";if(d.isBlock(C)||p=="img"||p=="span"){p+="."+z}}}p=p.replace(/(html:)/g,"");p={name:p,node:C,title:t};A.onResolveName.dispatch(A,p);t=p.title;p=p.name;v=d.create("a",{href:"javascript:;",onmousedown:"return false;",title:t,"class":"mcePath_"+(w++)},p);if(i.hasChildNodes()){i.insertBefore(d.doc.createTextNode(" \u00bb "),i.firstChild);i.insertBefore(v,i.firstChild)}else{i.appendChild(v)}},o.getBody())}},_sel:function(i){this.editor.execCommand("mceSelectNodeDepth",false,i)},_mceInsertAnchor:function(k,j){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/anchor.htm",width:320+parseInt(i.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(i.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/charmap.htm",width:550+parseInt(i.getLang("advanced.charmap_delta_width",0)),height:250+parseInt(i.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(k,j){var i=this.editor;j=j||{};i.windowManager.open({url:e.baseURL+"/themes/advanced/color_picker.htm",width:375+parseInt(i.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(i.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:j.color,func:j.func,theme_url:this.url})},_mceCodeEditor:function(j,k){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/source_editor.htm",width:parseInt(i.getParam("theme_advanced_source_editor_width",720)),height:parseInt(i.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(j,k){var i=this.editor;if(i.dom.getAttrib(i.selection.getNode(),"class").indexOf("mceItem")!=-1){return}i.windowManager.open({url:e.baseURL+"/themes/advanced/image.htm",width:355+parseInt(i.getLang("advanced.image_delta_width",0)),height:275+parseInt(i.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(j,k){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/link.htm",width:310+parseInt(i.getLang("advanced.link_delta_width",0)),height:200+parseInt(i.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var i=this.editor;i.windowManager.confirm("advanced.newdocument",function(j){if(j){i.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var i=this;this._mceColorPicker(0,{color:i.fgColor,func:function(j){i.fgColor=j;i.editor.execCommand("ForeColor",false,j)}})},_mceBackColor:function(){var i=this;this._mceColorPicker(0,{color:i.bgColor,func:function(j){i.bgColor=j;i.editor.execCommand("HiliteColor",false,j)}})},_ufirst:function(i){return i.substring(0,1).toUpperCase()+i.substring(1)}});e.ThemeManager.add("advanced",e.themes.AdvancedTheme)}(tinymce));
1
+ (function(e){var d=e.DOM,b=e.dom.Event,h=e.extend,f=e.each,a=e.util.Cookie,g,c=e.explode;e.ThemeManager.requireLangPack("advanced");e.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(j,k){var l=this,m,i,n;l.editor=j;l.url=k;l.onResolveName=new e.util.Dispatcher(this);j.forcedHighContrastMode=j.settings.detect_highcontrast&&l._isHighContrast();j.settings.skin=j.forcedHighContrastMode?"highcontrast":j.settings.skin;l.settings=m=h({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_font_selector:"span",theme_advanced_show_current_color:0,readonly:j.settings.readonly},j.settings);if(!m.font_size_style_values){m.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(e.is(m.theme_advanced_font_sizes,"string")){m.font_size_style_values=e.explode(m.font_size_style_values);m.font_size_classes=e.explode(m.font_size_classes||"");n={};j.settings.theme_advanced_font_sizes=m.theme_advanced_font_sizes;f(j.getParam("theme_advanced_font_sizes","","hash"),function(q,p){var o;if(p==q&&q>=1&&q<=7){p=q+" ("+l.sizes[q-1]+"pt)";o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+"pt")}if(/^\s*\./.test(q)){o=q.replace(/\./g,"")}n[p]=o?{"class":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!="none"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location=="none"){m.theme_advanced_statusbar_location=0}if(j.settings.content_css!==false){j.contentCSS.push(j.baseURI.toAbsolute(k+"/skins/"+j.settings.skin+"/content.css"))}j.onInit.add(function(){if(!j.settings.readonly){j.onNodeChange.add(l._nodeChanged,l);j.onKeyUp.add(l._updateUndoStatus,l);j.onMouseUp.add(l._updateUndoStatus,l);j.dom.bind(j.dom.getRoot(),"dragend",function(){l._updateUndoStatus(j)})}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create("DIV",{style:"position:relative"}),s.firstChild);p=d.get(q.id+"_tbl");d.add(s,"div",{id:t+"_blocker","class":"mceBlocker",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,"div",{id:t+"_progress","class":"mceProgress",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+"_blocker");d.remove(t+"_progress");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+"/skins/"+j.settings.skin+"/ui.css");if(m.skin_variant){d.loadCSS(k+"/skins/"+j.settings.skin+"/ui_"+m.skin_variant+".css")}},_isHighContrast:function(){var i,j=d.add(d.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});i=(d.getStyle(j,"background-color",true)+"").toLowerCase().replace(/ /g,"");d.remove(j);return i!="rgb(171,239,86)"&&i!="#abef56"},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((j=this.controls[l])){return i.createButton(l,{title:"advanced."+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this["_"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(k){var i=this.editor,j=i.controlManager.get("styleselect");if(j.getLength()==0){f(i.dom.getClasses(),function(n,l){var m="style_"+l;i.formatter.register(m,{inline:"span",attributes:{"class":n["class"]},selector:"*"});j.add(n["class"],m)})}},_createStyleSelect:function(m){var k=this,i=k.editor,j=i.controlManager,l;l=j.createListBox("styleselect",{title:"advanced.style_select",onselect:function(o){var p,n=[];f(l.items,function(q){n.push(q.value)});i.focus();i.undoManager.add();p=i.formatter.matchAll(n);if(!o||p[0]==o){if(p[0]){i.formatter.remove(p[0])}}else{i.formatter.apply(o)}i.undoManager.add();i.nodeChanged();return false}});i.onInit.add(function(){var o=0,n=i.getParam("style_formats");if(n){f(n,function(p){var q,r=0;f(p,function(){r++});if(r>1){q=p.name=p.name||"style_"+(o++);i.formatter.register(q,p);l.add(p.title,q)}else{l.add(p.title)}})}else{f(i.getParam("theme_advanced_styles","","hash"),function(r,q){var p;if(r){p="style_"+(o++);i.formatter.register(p,{inline:"span",classes:r,selector:"*"});l.add(k.editor.translate(q),p)}})}});if(l.getLength()==0){l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+"_text","focus",k._importClasses,k);b.add(p.id+"_text","mousedown",k._importClasses,k);b.add(p.id+"_open","focus",k._importClasses,k);b.add(p.id+"_open","mousedown",k._importClasses,k)}else{b.add(p.id,"focus",k._importClasses,k)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(l){var m=k.items[k.selectedIndex];if(!l&&m){i.execCommand("FontName",false,m.value);return}i.execCommand("FontName",false,l);k.select(function(n){return l==n});if(m&&m.value==l){k.select(null)}return false}});if(k){f(i.getParam("theme_advanced_fonts",j.settings.theme_advanced_fonts,"hash"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(i){var o=n.items[n.selectedIndex];if(!i&&o){o=o.value;if(o["class"]){k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}return}if(i["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:i["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,i.fontSize)}n.select(function(p){return i==p});if(o&&(o.value.fontSize==i.fontSize||o.value["class"]==i["class"])){n.select(null)}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+"pt"}n.add(i,o,{style:"font-size:"+p,"class":"mceFontSize"+(l++)+(" "+(o["class"]||""))})})}return n},_createBlockFormats:function(){var k,i={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},j=this;k=j.editor.controlManager.createListBox("formatselect",{title:"advanced.block",onselect:function(l){j.editor.execCommand("FormatBlock",false,l);return false}});if(k){f(j.editor.getParam("theme_advanced_blockformats",j.settings.theme_advanced_blockformats,"hash"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{"class":"mce_formatPreview mce_"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title="advanced.forecolor_desc";l.cmd="ForeColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("forecolor",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title="advanced.backcolor_desc";l.cmd="HiliteColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("backcolor",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j,i;if(r.settings){r.settings.aria_label=w.aria_label+r.getLang("advanced.help_shortcut")}m=j=d.create("span",{role:"application","aria-labelledby":r.id+"_voice",id:r.id+"_parent","class":"mceEditor "+r.settings.skin+"Skin"+(w.skin_variant?" "+r.settings.skin+"Skin"+v._ufirst(w.skin_variant):"")});d.add(m,"span",{"class":"mceVoiceLabel",style:"display:none;",id:r.id+"_voice"},w.aria_label);if(!d.boxModel){m=d.add(m,"div",{"class":"mceOldBoxModel"})}m=u=d.add(m,"table",{role:"presentation",id:r.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});m=q=d.add(m,"tbody");switch((w.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":l=v._rowLayout(w,q,k);break;case"customlayout":l=r.execCallback("theme_advanced_custom_layout",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=u.rows;d.addClass(i[0],"mceFirst");d.addClass(i[i.length-1],"mceLast");f(d.select("tr",q),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!r.getParam("accessibility_focus")){b.add(d.add(j,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location=="external"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;k.targetNode=null;r.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){if(e.isWebKit){window.focus()}v.toolbarGroup.focus();return b.cancel(n)}else{if(n.keyCode===o){d.get(p.id+"_path_row").focus();return b.cancel(n)}}}});r.addShortcut("alt+0","","mceShortcuts",v);return{iframeContainer:l,editorContainer:r.id+"_parent",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:e.majorVersion+"."+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+"_ifr");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,m,k){var j=this.editor,l=this.settings,n=d.get(j.id+"_tbl"),o=d.get(j.id+"_ifr");i=Math.max(l.theme_advanced_resizing_min_width||100,i);m=Math.max(l.theme_advanced_resizing_min_height||100,m);i=Math.min(l.theme_advanced_resizing_max_width||65535,i);m=Math.min(l.theme_advanced_resizing_max_height||65535,m);d.setStyle(n,"height","");d.setStyle(o,"height",m);if(l.theme_advanced_resize_horizontal){d.setStyle(n,"width","");d.setStyle(o,"width",i);if(i<n.clientWidth){i=n.clientWidth;d.setStyle(o,"width",n.clientWidth)}}if(k&&l.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+j.id+"_size",{cw:i,ch:m})}},destroy:function(){var i=this.editor.id;b.clear(i+"_resize");b.clear(i+"_path_row");b.clear(i+"_external_close")},_simpleLayout:function(y,r,k,i){var x=this,u=x.editor,v=y.theme_advanced_toolbar_location,m=y.theme_advanced_statusbar_location,l,j,q,w;if(y.readonly){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});return j}if(v=="top"){x._addToolbars(r,k)}if(v=="external"){l=w=d.create("div",{style:"position:relative"});l=d.add(l,"div",{id:u.id+"_external","class":"mceExternalToolbar"});d.add(l,"a",{id:u.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});l=d.add(l,"table",{id:u.id+"_tblext",cellSpacing:0,cellPadding:0});q=d.add(l,"tbody");if(i.firstChild.className=="mceOldBoxModel"){i.firstChild.appendChild(w)}else{i.insertBefore(w,i.firstChild)}x._addToolbars(q,k);u.onMouseUp.add(function(){var o=d.get(u.id+"_external");d.show(o);d.hide(g);var n=b.add(u.id+"_external_close","click",function(){d.hide(u.id+"_external");b.remove(u.id+"_external_close","click",n)});d.show(o);d.setStyle(o,"top",0-d.getRect(u.id+"_tblext").h-1);d.hide(o);d.show(o);o.style.filter="";g=u.id+"_external";o=null})}if(m=="top"){x._addStatusBar(r,k)}if(!y.theme_advanced_toolbar_container){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"})}if(v=="bottom"){x._addToolbars(r,k)}if(m=="bottom"){x._addStatusBar(r,k)}return j},_rowLayout:function(w,m,k){var v=this,p=v.editor,u,x,i=p.controlManager,l,j,r,q;u=w.theme_advanced_containers_default_class||"";x=w.theme_advanced_containers_default_align||"center";f(c(w.theme_advanced_containers||""),function(s,o){var n=w["theme_advanced_container_"+s]||"";switch(s.toLowerCase()){case"mceeditor":l=d.add(m,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":v._addStatusBar(m,k);break;default:q=(w["theme_advanced_container_"+s+"_align"]||x).toLowerCase();q="mce"+v._ufirst(q);l=d.add(d.add(m,"tr"),"td",{"class":"mceToolbar "+(w["theme_advanced_container_"+s+"_class"]||u)+" "+q||x});r=i.createToolbar("toolbar"+o);v._addControls(n,r);d.setHTML(l,r.renderHTML());k.deltaHeight-=w.theme_advanced_row_height}});return j},_addControls:function(j,i){var k=this,l=k.settings,m,n=k.editor.controlManager;if(l.theme_advanced_disable&&!k._disabled){m={};f(c(l.theme_advanced_disable),function(o){m[o]=1});k._disabled=m}else{m=k._disabled}f(c(j),function(p){var o;if(m&&m[p]){return}if(p=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(q){q=k.createControl(q,n);if(q){i.add(q)}});return}o=k.createControl(p,n);if(o){i.add(o)}})},_addToolbars:function(x,k){var A=this,p,m,r=A.editor,B=A.settings,z,j=r.controlManager,u,l,q=[],y,w;w=j.createToolbarGroup("toolbargroup",{name:r.getLang("advanced.toolbar"),tab_focus_toolbar:r.getParam("theme_advanced_tab_focus_toolbar")});A.toolbarGroup=w;y=B.theme_advanced_toolbar_align.toLowerCase();y="mce"+A._ufirst(y);l=d.add(d.add(x,"tr",{role:"presentation"}),"td",{"class":"mceToolbar "+y,role:"presentation"});for(p=1;(z=B["theme_advanced_buttons"+p]);p++){m=j.createToolbar("toolbar"+p,{"class":"mceToolbarRow"+p});if(B["theme_advanced_buttons"+p+"_add"]){z+=","+B["theme_advanced_buttons"+p+"_add"]}if(B["theme_advanced_buttons"+p+"_add_before"]){z=B["theme_advanced_buttons"+p+"_add_before"]+","+z}A._addControls(z,m);w.add(m);k.deltaHeight-=B.theme_advanced_row_height}q.push(w.renderHTML());q.push(d.createHTML("a",{href:"#",accesskey:"z",title:r.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+r.id+"').focus();"},"<!-- IE -->"));d.setHTML(l,q.join(""))},_addStatusBar:function(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,"tr");k=l=d.add(k,"td",{"class":"mceStatusbar"});k=d.add(k,"div",{id:p.id+"_path_row",role:"group","aria-labelledby":p.id+"_path_voice"});if(w.theme_advanced_path){d.add(k,"span",{id:p.id+"_path_voice"},p.translate("advanced.path"));d.add(k,"span",{},": ")}else{d.add(k,"span",{},"&#160;")}if(w.theme_advanced_resizing){d.add(l,"a",{id:p.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize",tabIndex:"-1"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+p.id+"_size"),r=d.get(p.id+"_tbl");if(!n){return}v.resizeTo(n.cw,n.ch)})}p.onPostRender.add(function(){b.add(p.id+"_resize","click",function(n){n.preventDefault()});b.add(p.id+"_resize","mousedown",function(D){var t,r,s,o,C,z,A,F,n,E,x;function y(G){G.preventDefault();n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E)}function B(G){b.remove(d.doc,"mousemove",t);b.remove(p.getDoc(),"mousemove",r);b.remove(d.doc,"mouseup",s);b.remove(p.getDoc(),"mouseup",o);n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E,true)}D.preventDefault();C=D.screenX;z=D.screenY;x=d.get(v.editor.id+"_ifr");A=n=x.clientWidth;F=E=x.clientHeight;t=b.add(d.doc,"mousemove",y);r=b.add(p.getDoc(),"mousemove",y);s=b.add(d.doc,"mouseup",B);o=b.add(p.getDoc(),"mouseup",B)})})}j.deltaHeight-=21;k=m=null},_updateUndoStatus:function(j){var i=j.controlManager,k=j.undoManager;i.setDisabled("undo",!k.hasUndo()&&!k.typing);i.setDisabled("redo",!k.hasRedo())},_nodeChanged:function(m,r,D,q,E){var y=this,C,F=0,x,G,z=y.settings,w,k,u,B,l,j,i;e.each(y.stateControls,function(n){r.setActive(n,m.queryCommandState(y.controls[n][1]))});function o(p){var s,n=E.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s<n.length;s++){if(t(n[s])){return n[s]}}}r.setActive("visualaid",m.hasVisual);y._updateUndoStatus(m);r.setDisabled("outdent",!m.queryCommandState("Outdent"));C=o("A");if(G=r.get("link")){if(!C||!C.name){G.setDisabled(!C&&q);G.setActive(!!C)}}if(G=r.get("unlink")){G.setDisabled(!C&&q);G.setActive(!!C&&!C.name)}if(G=r.get("anchor")){G.setActive(!q&&!!C&&C.name)}C=o("IMG");if(G=r.get("image")){G.setActive(!q&&!!C&&D.className.indexOf("mceItem")==-1)}if(G=r.get("styleselect")){y._importClasses();j=[];f(G.items,function(n){j.push(n.value)});i=m.formatter.matchAll(j);G.select(i[0])}if(G=r.get("formatselect")){C=o(d.isBlock);if(C){G.select(C.nodeName.toLowerCase())}}o(function(p){if(p.nodeName==="SPAN"){if(!w&&p.className){w=p.className}}if(m.dom.is(p,z.theme_advanced_font_selector)){if(!k&&p.style.fontSize){k=p.style.fontSize}if(!u&&p.style.fontFamily){u=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}if(!B&&p.style.color){B=p.style.color}if(!l&&p.style.backgroundColor){l=p.style.backgroundColor}}return false});if(G=r.get("fontselect")){G.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==u})}if(G=r.get("fontsizeselect")){if(z.theme_advanced_runtime_fontsize&&!k&&!w){k=m.dom.getStyle(D,"fontSize",true)}G.select(function(n){if(n.fontSize&&n.fontSize===k){return true}if(n["class"]&&n["class"]===w){return true}})}if(z.theme_advanced_show_current_color){function A(p,n){if(G=r.get(p)){if(!n){n=G.settings.default_color}if(n!==G.value){G.displayColor(n)}}}A("forecolor",B);A("backcolor",l)}if(z.theme_advanced_show_current_color){function A(p,n){if(G=r.get(p)){if(!n){n=G.settings.default_color}if(n!==G.value){G.displayColor(n)}}}A("forecolor",B);A("backcolor",l)}if(z.theme_advanced_path&&z.theme_advanced_statusbar_location){C=d.get(m.id+"_path")||d.add(m.id+"_path_row","span",{id:m.id+"_path"});if(y.statusKeyboardNavigation){y.statusKeyboardNavigation.destroy();y.statusKeyboardNavigation=null}d.setHTML(C,"");o(function(H){var p=H.nodeName.toLowerCase(),s,v,t="";if(H.nodeType!=1||p==="br"||H.getAttribute("data-mce-bogus")||d.hasClass(H,"mceItemHidden")||d.hasClass(H,"mceItemRemoved")){return}if(e.isIE&&H.scopeName!=="HTML"){p=H.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(x=d.getAttrib(H,"src")){t+="src: "+x+" "}break;case"a":if(x=d.getAttrib(H,"name")){t+="name: "+x+" ";p+="#"+x}if(x=d.getAttrib(H,"href")){t+="href: "+x+" "}break;case"font":if(x=d.getAttrib(H,"face")){t+="font: "+x+" "}if(x=d.getAttrib(H,"size")){t+="size: "+x+" "}if(x=d.getAttrib(H,"color")){t+="color: "+x+" "}break;case"span":if(x=d.getAttrib(H,"style")){t+="style: "+x+" "}break}if(x=d.getAttrib(H,"id")){t+="id: "+x+" "}if(x=H.className){x=x.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(x){t+="class: "+x+" ";if(d.isBlock(H)||p=="img"||p=="span"){p+="."+x}}}p=p.replace(/(html:)/g,"");p={name:p,node:H,title:t};y.onResolveName.dispatch(y,p);t=p.title;p=p.name;v=d.create("a",{href:"javascript:;",role:"button",onmousedown:"return false;",title:t,"class":"mcePath_"+(F++)},p);if(C.hasChildNodes()){C.insertBefore(d.create("span",{"aria-hidden":"true"},"\u00a0\u00bb "),C.firstChild);C.insertBefore(v,C.firstChild)}else{C.appendChild(v)}},m.getBody());if(d.select("a",C).length>0){y.statusKeyboardNavigation=new e.ui.KeyboardNavigation({root:m.id+"_path_row",items:d.select("a",C),excludeFromTabOrder:true,onCancel:function(){m.focus()}},d)}}},_sel:function(i){this.editor.execCommand("mceSelectNodeDepth",false,i)},_mceInsertAnchor:function(k,j){var i=this.editor;i.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(i.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(i.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var i=this.editor;i.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(i.getLang("advanced.charmap_delta_width",0)),height:260+parseInt(i.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var i=this.editor;i.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var i=this.editor;i.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(k,j){var i=this.editor;j=j||{};i.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(i.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(i.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:j.color,func:j.func,theme_url:this.url})},_mceCodeEditor:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(i.getParam("theme_advanced_source_editor_width",720)),height:parseInt(i.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(j,k){var i=this.editor;if(i.dom.getAttrib(i.selection.getNode(),"class").indexOf("mceItem")!=-1){return}i.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(i.getLang("advanced.image_delta_width",0)),height:275+parseInt(i.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(i.getLang("advanced.link_delta_width",0)),height:200+parseInt(i.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var i=this.editor;i.windowManager.confirm("advanced.newdocument",function(j){if(j){i.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var i=this;this._mceColorPicker(0,{color:i.fgColor,func:function(j){i.fgColor=j;i.editor.execCommand("ForeColor",false,j)}})},_mceBackColor:function(){var i=this;this._mceColorPicker(0,{color:i.bgColor,func:function(j){i.bgColor=j;i.editor.execCommand("HiliteColor",false,j)}})},_ufirst:function(i){return i.substring(0,1).toUpperCase()+i.substring(1)}});e.ThemeManager.add("advanced",e.themes.AdvancedTheme)}(tinymce));
tiny_mce/themes/advanced/editor_template_src.js CHANGED
@@ -66,6 +66,9 @@
66
  t.url = url;
67
  t.onResolveName = new tinymce.util.Dispatcher(this);
68
 
 
 
 
69
  // Default settings
70
  t.settings = s = extend({
71
  theme_advanced_path : true,
@@ -81,6 +84,8 @@
81
  theme_advanced_resize_horizontal : 1,
82
  theme_advanced_resizing_use_cookie : 1,
83
  theme_advanced_font_sizes : "1,2,3,4,5,6,7",
 
 
84
  readonly : ed.settings.readonly
85
  }, ed.settings);
86
 
@@ -119,13 +124,19 @@
119
  if (s.theme_advanced_statusbar_location == 'none')
120
  s.theme_advanced_statusbar_location = 0;
121
 
 
 
 
122
  // Init editor
123
  ed.onInit.add(function() {
124
- if (!ed.settings.readonly)
125
  ed.onNodeChange.add(t._nodeChanged, t);
126
-
127
- if (ed.settings.content_css !== false)
128
- ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/" + ed.settings.skin + "/content.css"));
 
 
 
129
  });
130
 
131
  ed.onSetProgressState.add(function(ed, b, ti) {
@@ -153,6 +164,15 @@
153
  DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css");
154
  },
155
 
 
 
 
 
 
 
 
 
 
156
  createControl : function(n, cf) {
157
  var cd, c;
158
 
@@ -203,7 +223,8 @@
203
 
204
  ed.formatter.register(name, {
205
  inline : 'span',
206
- classes : o['class']
 
207
  });
208
 
209
  ctrl.add(o['class'], name);
@@ -218,8 +239,25 @@
218
  ctrl = ctrlMan.createListBox('styleselect', {
219
  title : 'advanced.style_select',
220
  onselect : function(name) {
 
 
 
 
 
 
221
  ed.focus();
222
- ed.formatter.toggle(name);
 
 
 
 
 
 
 
 
 
 
 
223
 
224
  return false; // No auto select
225
  }
@@ -251,7 +289,8 @@
251
 
252
  ed.formatter.register(name, {
253
  inline : 'span',
254
- classes : val
 
255
  });
256
 
257
  ctrl.add(t.editor.translate(key), name);
@@ -282,7 +321,24 @@
282
  c = ed.controlManager.createListBox('fontselect', {
283
  title : 'advanced.fontdefault',
284
  onselect : function(v) {
 
 
 
 
 
 
 
285
  ed.execCommand('FontName', false, v);
 
 
 
 
 
 
 
 
 
 
286
  return false; // No auto select
287
  }
288
  });
@@ -300,15 +356,38 @@
300
  var t = this, ed = t.editor, c, i = 0, cl = [];
301
 
302
  c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) {
303
- if (v.fontSize)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  ed.execCommand('FontSize', false, v.fontSize);
305
- else {
306
- each(t.settings.theme_advanced_font_sizes, function(v, k) {
307
- if (v['class'])
308
- cl.push(v['class']);
309
- });
310
 
311
- ed.editorCommands._applyInlineStyle('span', {'class' : v['class']}, {check_classes : cl});
 
 
 
 
 
 
312
  }
313
 
314
  return false; // No auto select
@@ -347,7 +426,11 @@
347
  samp : 'advanced.samp'
348
  }, t = this;
349
 
350
- c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', cmd : 'FormatBlock'});
 
 
 
 
351
  if (c) {
352
  each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) {
353
  c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v});
@@ -418,12 +501,19 @@
418
  renderUI : function(o) {
419
  var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl;
420
 
421
- n = p = DOM.create('span', {id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')});
 
 
 
 
 
 
 
422
 
423
  if (!DOM.boxModel)
424
  n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'});
425
 
426
- n = sc = DOM.add(n, 'table', {id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0});
427
  n = tb = DOM.add(n, 'tbody');
428
 
429
  switch ((s.theme_advanced_layout_manager || '').toLowerCase()) {
@@ -442,7 +532,7 @@
442
  n = o.targetNode;
443
 
444
  // Add classes to first and last TRs
445
- nl = DOM.stdMode ? sc.getElementsByTagName('tr') : sc.rows; // Quick fix for IE 8
446
  DOM.addClass(nl[0], 'mceFirst');
447
  DOM.addClass(nl[nl.length - 1], 'mceLast');
448
 
@@ -498,6 +588,28 @@
498
  t.deltaHeight = o.deltaHeight;
499
  o.targetNode = null;
500
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
501
  return {
502
  iframeContainer : ic,
503
  editorContainer : ed.id + '_parent',
@@ -516,13 +628,13 @@
516
  },
517
 
518
  resizeBy : function(dw, dh) {
519
- var e = DOM.get(this.editor.id + '_tbl');
520
 
521
  this.resizeTo(e.clientWidth + dw, e.clientHeight + dh);
522
  },
523
 
524
- resizeTo : function(w, h) {
525
- var ed = this.editor, s = ed.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'), dh;
526
 
527
  // Boundery fix box
528
  w = Math.max(s.theme_advanced_resizing_min_width || 100, w);
@@ -530,12 +642,28 @@
530
  w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w);
531
  h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h);
532
 
533
- // Calc difference between iframe and container
534
- dh = e.clientHeight - ifr.clientHeight;
535
-
536
  // Resize iframe and container
537
- DOM.setStyle(ifr, 'height', h - dh);
538
- DOM.setStyles(e, {width : w, height : h});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
539
  },
540
 
541
  destroy : function() {
@@ -629,7 +757,7 @@
629
  each(explode(s.theme_advanced_containers || ''), function(c, i) {
630
  var v = s['theme_advanced_container_' + c] || '';
631
 
632
- switch (v.toLowerCase()) {
633
  case 'mceeditor':
634
  n = DOM.add(tb, 'tr');
635
  n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
@@ -697,17 +825,19 @@
697
  },
698
 
699
  _addToolbars : function(c, o) {
700
- var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a;
701
 
702
- a = s.theme_advanced_toolbar_align.toLowerCase();
703
- a = 'mce' + t._ufirst(a);
 
 
704
 
705
- n = DOM.add(DOM.add(c, 'tr'), 'td', {'class' : 'mceToolbar ' + a});
706
 
707
- if (!ed.getParam('accessibility_focus'))
708
- h.push(DOM.createHTML('a', {href : '#', onfocus : 'tinyMCE.get(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));
709
 
710
- h.push(DOM.createHTML('a', {href : '#', accesskey : 'q', title : ed.getLang("advanced.toolbar_focus")}, '<!-- IE -->'));
711
 
712
  // Create toolbar and add the controls
713
  for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {
@@ -720,13 +850,11 @@
720
  v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v;
721
 
722
  t._addControls(v, tb);
723
-
724
- //n.appendChild(n = tb.render());
725
- h.push(tb.renderHTML());
726
 
727
  o.deltaHeight -= s.theme_advanced_row_height;
728
  }
729
-
730
  h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));
731
  DOM.setHTML(n, h.join(''));
732
  },
@@ -735,12 +863,18 @@
735
  var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td;
736
 
737
  n = DOM.add(tb, 'tr');
738
- n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'});
739
- n = DOM.add(n, 'div', {id : ed.id + '_path_row'}, s.theme_advanced_path ? ed.translate('advanced.path') + ': ' : '&#160;');
740
- DOM.add(n, 'a', {href : '#', accesskey : 'x'});
 
 
 
 
 
 
741
 
742
  if (s.theme_advanced_resizing) {
743
- DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize'});
744
 
745
  if (s.theme_advanced_resizing_use_cookie) {
746
  ed.onPostRender.add(function() {
@@ -749,99 +883,55 @@
749
  if (!o)
750
  return;
751
 
752
- if (s.theme_advanced_resize_horizontal)
753
- c.style.width = Math.max(10, o.cw) + 'px';
754
-
755
- c.style.height = Math.max(10, o.ch) + 'px';
756
- DOM.get(ed.id + '_ifr').style.height = Math.max(10, parseInt(o.ch) + t.deltaHeight) + 'px';
757
  });
758
  }
759
 
760
  ed.onPostRender.add(function() {
761
- Event.add(ed.id + '_resize', 'mousedown', function(e) {
762
- var c, p, w, h, n, pa;
763
-
764
- // Measure container
765
- c = DOM.get(ed.id + '_tbl');
766
- w = c.clientWidth;
767
- h = c.clientHeight;
768
-
769
- miw = s.theme_advanced_resizing_min_width || 100;
770
- mih = s.theme_advanced_resizing_min_height || 100;
771
- maw = s.theme_advanced_resizing_max_width || 0xFFFF;
772
- mah = s.theme_advanced_resizing_max_height || 0xFFFF;
773
-
774
- // Setup placeholder
775
- p = DOM.add(DOM.get(ed.id + '_parent'), 'div', {'class' : 'mcePlaceHolder'});
776
- DOM.setStyles(p, {width : w, height : h});
777
-
778
- // Replace with placeholder
779
- DOM.hide(c);
780
- DOM.show(p);
781
-
782
- // Create internal resize obj
783
- r = {
784
- x : e.screenX,
785
- y : e.screenY,
786
- w : w,
787
- h : h,
788
- dx : null,
789
- dy : null
790
- };
791
-
792
- // Start listening
793
- mf = Event.add(DOM.doc, 'mousemove', function(e) {
794
- var w, h;
795
-
796
- // Calc delta values
797
- r.dx = e.screenX - r.x;
798
- r.dy = e.screenY - r.y;
799
-
800
- // Boundery fix box
801
- w = Math.max(miw, r.w + r.dx);
802
- h = Math.max(mih, r.h + r.dy);
803
- w = Math.min(maw, w);
804
- h = Math.min(mah, h);
805
 
806
- // Resize placeholder
807
- if (s.theme_advanced_resize_horizontal)
808
- p.style.width = w + 'px';
 
809
 
810
- p.style.height = h + 'px';
 
811
 
812
- return Event.cancel(e);
813
- });
814
 
815
- me = Event.add(DOM.doc, 'mouseup', function(e) {
816
- var ifr;
817
 
 
818
  // Stop listening
819
- Event.remove(DOM.doc, 'mousemove', mf);
820
- Event.remove(DOM.doc, 'mouseup', me);
821
-
822
- c.style.display = '';
823
- DOM.remove(p);
824
-
825
- if (r.dx === null)
826
- return;
827
-
828
- ifr = DOM.get(ed.id + '_ifr');
829
-
830
- if (s.theme_advanced_resize_horizontal)
831
- c.style.width = Math.max(10, r.w + r.dx) + 'px';
832
 
833
- c.style.height = Math.max(10, r.h + r.dy) + 'px';
834
- ifr.style.height = Math.max(10, ifr.clientHeight + r.dy) + 'px';
835
 
836
- if (s.theme_advanced_resizing_use_cookie) {
837
- Cookie.setHash("TinyMCE_" + ed.id + "_size", {
838
- cw : r.w + r.dx,
839
- ch : r.h + r.dy
840
- });
841
- }
842
- });
843
 
844
- return Event.cancel(e);
 
 
 
 
845
  });
846
  });
847
  }
@@ -850,8 +940,15 @@
850
  n = tb = null;
851
  },
852
 
 
 
 
 
 
 
 
853
  _nodeChanged : function(ed, cm, n, co, ob) {
854
- var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn;
855
 
856
  tinymce.each(t.stateControls, function(c) {
857
  cm.setActive(c, ed.queryCommandState(t.controls[c][1]));
@@ -873,8 +970,7 @@
873
  };
874
 
875
  cm.setActive('visualaid', ed.hasVisual);
876
- cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing);
877
- cm.setDisabled('redo', !ed.undoManager.hasRedo());
878
  cm.setDisabled('outdent', !ed.queryCommandState('Outdent'));
879
 
880
  p = getParent('A');
@@ -891,20 +987,23 @@
891
  }
892
 
893
  if (c = cm.get('anchor')) {
894
- c.setActive(!!p && p.name);
895
  }
896
 
897
  p = getParent('IMG');
898
  if (c = cm.get('image'))
899
- c.setActive(!!p && n.className.indexOf('mceItem') == -1);
900
 
901
  if (c = cm.get('styleselect')) {
902
  t._importClasses();
903
 
904
- // Check each format and update
905
- c.select(function(fmt) {
906
- return !!ed.formatter.match(fmt);
907
  });
 
 
 
908
  }
909
 
910
  if (c = cm.get('formatselect')) {
@@ -919,12 +1018,20 @@
919
  if (n.nodeName === 'SPAN') {
920
  if (!cl && n.className)
921
  cl = n.className;
 
922
 
 
923
  if (!fz && n.style.fontSize)
924
  fz = n.style.fontSize;
925
 
926
  if (!fn && n.style.fontFamily)
927
  fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase();
 
 
 
 
 
 
928
  }
929
 
930
  return false;
@@ -950,25 +1057,53 @@
950
  return true;
951
  });
952
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
953
 
954
  if (s.theme_advanced_path && s.theme_advanced_statusbar_location) {
955
  p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'});
 
 
 
 
 
 
956
  DOM.setHTML(p, '');
957
 
958
  getParent(function(n) {
959
  var na = n.nodeName.toLowerCase(), u, pi, ti = '';
960
 
961
- /*if (n.getAttribute('_mce_bogus'))
962
- return;
963
- */
964
- // Ignore non element and hidden elements
965
- if (n.nodeType != 1 || n.nodeName === 'BR' || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')))
966
  return;
967
 
968
- // Fake name
969
- if (v = DOM.getAttrib(n, 'mce_name'))
970
- na = v;
971
-
972
  // Handle prefix
973
  if (tinymce.isIE && n.scopeName !== 'HTML')
974
  na = n.scopeName + ':' + na;
@@ -1043,14 +1178,25 @@
1043
  na = na.name;
1044
 
1045
  //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');";
1046
- pi = DOM.create('a', {'href' : "javascript:;", onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na);
1047
 
1048
  if (p.hasChildNodes()) {
1049
- p.insertBefore(DOM.doc.createTextNode(' \u00bb '), p.firstChild);
1050
  p.insertBefore(pi, p.firstChild);
1051
  } else
1052
  p.appendChild(pi);
1053
  }, ed.getBody());
 
 
 
 
 
 
 
 
 
 
 
1054
  }
1055
  },
1056
 
@@ -1064,7 +1210,7 @@
1064
  var ed = this.editor;
1065
 
1066
  ed.windowManager.open({
1067
- url : tinymce.baseURL + '/themes/advanced/anchor.htm',
1068
  width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)),
1069
  height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)),
1070
  inline : true
@@ -1077,9 +1223,9 @@
1077
  var ed = this.editor;
1078
 
1079
  ed.windowManager.open({
1080
- url : tinymce.baseURL + '/themes/advanced/charmap.htm',
1081
  width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)),
1082
- height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)),
1083
  inline : true
1084
  }, {
1085
  theme_url : this.url
@@ -1090,7 +1236,7 @@
1090
  var ed = this.editor;
1091
 
1092
  ed.windowManager.open({
1093
- url : tinymce.baseURL + '/themes/advanced/about.htm',
1094
  width : 480,
1095
  height : 380,
1096
  inline : true
@@ -1099,13 +1245,25 @@
1099
  });
1100
  },
1101
 
 
 
 
 
 
 
 
 
 
 
 
 
1102
  _mceColorPicker : function(u, v) {
1103
  var ed = this.editor;
1104
 
1105
  v = v || {};
1106
 
1107
  ed.windowManager.open({
1108
- url : tinymce.baseURL + '/themes/advanced/color_picker.htm',
1109
  width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)),
1110
  height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)),
1111
  close_previous : false,
@@ -1121,7 +1279,7 @@
1121
  var ed = this.editor;
1122
 
1123
  ed.windowManager.open({
1124
- url : tinymce.baseURL + '/themes/advanced/source_editor.htm',
1125
  width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)),
1126
  height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)),
1127
  inline : true,
@@ -1140,7 +1298,7 @@
1140
  return;
1141
 
1142
  ed.windowManager.open({
1143
- url : tinymce.baseURL + '/themes/advanced/image.htm',
1144
  width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)),
1145
  height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)),
1146
  inline : true
@@ -1153,7 +1311,7 @@
1153
  var ed = this.editor;
1154
 
1155
  ed.windowManager.open({
1156
- url : tinymce.baseURL + '/themes/advanced/link.htm',
1157
  width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)),
1158
  height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)),
1159
  inline : true
@@ -1201,4 +1359,4 @@
1201
  });
1202
 
1203
  tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme);
1204
- }(tinymce));
66
  t.url = url;
67
  t.onResolveName = new tinymce.util.Dispatcher(this);
68
 
69
+ ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast();
70
+ ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin;
71
+
72
  // Default settings
73
  t.settings = s = extend({
74
  theme_advanced_path : true,
84
  theme_advanced_resize_horizontal : 1,
85
  theme_advanced_resizing_use_cookie : 1,
86
  theme_advanced_font_sizes : "1,2,3,4,5,6,7",
87
+ theme_advanced_font_selector : "span",
88
+ theme_advanced_show_current_color: 0,
89
  readonly : ed.settings.readonly
90
  }, ed.settings);
91
 
124
  if (s.theme_advanced_statusbar_location == 'none')
125
  s.theme_advanced_statusbar_location = 0;
126
 
127
+ if (ed.settings.content_css !== false)
128
+ ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css"));
129
+
130
  // Init editor
131
  ed.onInit.add(function() {
132
+ if (!ed.settings.readonly) {
133
  ed.onNodeChange.add(t._nodeChanged, t);
134
+ ed.onKeyUp.add(t._updateUndoStatus, t);
135
+ ed.onMouseUp.add(t._updateUndoStatus, t);
136
+ ed.dom.bind(ed.dom.getRoot(), 'dragend', function() {
137
+ t._updateUndoStatus(ed);
138
+ });
139
+ }
140
  });
141
 
142
  ed.onSetProgressState.add(function(ed, b, ti) {
164
  DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css");
165
  },
166
 
167
+ _isHighContrast : function() {
168
+ var actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'});
169
+
170
+ actualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, '');
171
+ DOM.remove(div);
172
+
173
+ return actualColor != 'rgb(171,239,86)' && actualColor != '#abef56';
174
+ },
175
+
176
  createControl : function(n, cf) {
177
  var cd, c;
178
 
223
 
224
  ed.formatter.register(name, {
225
  inline : 'span',
226
+ attributes : {'class' : o['class']},
227
+ selector : '*'
228
  });
229
 
230
  ctrl.add(o['class'], name);
239
  ctrl = ctrlMan.createListBox('styleselect', {
240
  title : 'advanced.style_select',
241
  onselect : function(name) {
242
+ var matches, formatNames = [];
243
+
244
+ each(ctrl.items, function(item) {
245
+ formatNames.push(item.value);
246
+ });
247
+
248
  ed.focus();
249
+ ed.undoManager.add();
250
+
251
+ // Toggle off the current format
252
+ matches = ed.formatter.matchAll(formatNames);
253
+ if (!name || matches[0] == name) {
254
+ if (matches[0])
255
+ ed.formatter.remove(matches[0]);
256
+ } else
257
+ ed.formatter.apply(name);
258
+
259
+ ed.undoManager.add();
260
+ ed.nodeChanged();
261
 
262
  return false; // No auto select
263
  }
289
 
290
  ed.formatter.register(name, {
291
  inline : 'span',
292
+ classes : val,
293
+ selector : '*'
294
  });
295
 
296
  ctrl.add(t.editor.translate(key), name);
321
  c = ed.controlManager.createListBox('fontselect', {
322
  title : 'advanced.fontdefault',
323
  onselect : function(v) {
324
+ var cur = c.items[c.selectedIndex];
325
+
326
+ if (!v && cur) {
327
+ ed.execCommand('FontName', false, cur.value);
328
+ return;
329
+ }
330
+
331
  ed.execCommand('FontName', false, v);
332
+
333
+ // Fake selection, execCommand will fire a nodeChange and update the selection
334
+ c.select(function(sv) {
335
+ return v == sv;
336
+ });
337
+
338
+ if (cur && cur.value == v) {
339
+ c.select(null);
340
+ }
341
+
342
  return false; // No auto select
343
  }
344
  });
356
  var t = this, ed = t.editor, c, i = 0, cl = [];
357
 
358
  c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) {
359
+ var cur = c.items[c.selectedIndex];
360
+
361
+ if (!v && cur) {
362
+ cur = cur.value;
363
+
364
+ if (cur['class']) {
365
+ ed.formatter.toggle('fontsize_class', {value : cur['class']});
366
+ ed.undoManager.add();
367
+ ed.nodeChanged();
368
+ } else {
369
+ ed.execCommand('FontSize', false, cur.fontSize);
370
+ }
371
+
372
+ return;
373
+ }
374
+
375
+ if (v['class']) {
376
+ ed.focus();
377
+ ed.undoManager.add();
378
+ ed.formatter.toggle('fontsize_class', {value : v['class']});
379
+ ed.undoManager.add();
380
+ ed.nodeChanged();
381
+ } else
382
  ed.execCommand('FontSize', false, v.fontSize);
 
 
 
 
 
383
 
384
+ // Fake selection, execCommand will fire a nodeChange and update the selection
385
+ c.select(function(sv) {
386
+ return v == sv;
387
+ });
388
+
389
+ if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] == v['class'])) {
390
+ c.select(null);
391
  }
392
 
393
  return false; // No auto select
426
  samp : 'advanced.samp'
427
  }, t = this;
428
 
429
+ c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', onselect : function(v) {
430
+ t.editor.execCommand('FormatBlock', false, v);
431
+ return false;
432
+ }});
433
+
434
  if (c) {
435
  each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) {
436
  c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v});
501
  renderUI : function(o) {
502
  var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl;
503
 
504
+ if (ed.settings) {
505
+ ed.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut');
506
+ }
507
+
508
+ // TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for.
509
+ // Maybe actually inherit it from the original textara?
510
+ n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')});
511
+ DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label);
512
 
513
  if (!DOM.boxModel)
514
  n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'});
515
 
516
+ n = sc = DOM.add(n, 'table', {role : "presentation", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0});
517
  n = tb = DOM.add(n, 'tbody');
518
 
519
  switch ((s.theme_advanced_layout_manager || '').toLowerCase()) {
532
  n = o.targetNode;
533
 
534
  // Add classes to first and last TRs
535
+ nl = sc.rows;
536
  DOM.addClass(nl[0], 'mceFirst');
537
  DOM.addClass(nl[nl.length - 1], 'mceLast');
538
 
588
  t.deltaHeight = o.deltaHeight;
589
  o.targetNode = null;
590
 
591
+ ed.onKeyDown.add(function(ed, evt) {
592
+ var DOM_VK_F10 = 121, DOM_VK_F11 = 122;
593
+
594
+ if (evt.altKey) {
595
+ if (evt.keyCode === DOM_VK_F10) {
596
+ // Make sure focus is given to toolbar in Safari.
597
+ // We can't do this in IE as it prevents giving focus to toolbar when editor is in a frame
598
+ if (tinymce.isWebKit) {
599
+ window.focus();
600
+ }
601
+ t.toolbarGroup.focus();
602
+ return Event.cancel(evt);
603
+ } else if (evt.keyCode === DOM_VK_F11) {
604
+ DOM.get(ed.id + '_path_row').focus();
605
+ return Event.cancel(evt);
606
+ }
607
+ }
608
+ });
609
+
610
+ // alt+0 is the UK recommended shortcut for accessing the list of access controls.
611
+ ed.addShortcut('alt+0', '', 'mceShortcuts', t);
612
+
613
  return {
614
  iframeContainer : ic,
615
  editorContainer : ed.id + '_parent',
628
  },
629
 
630
  resizeBy : function(dw, dh) {
631
+ var e = DOM.get(this.editor.id + '_ifr');
632
 
633
  this.resizeTo(e.clientWidth + dw, e.clientHeight + dh);
634
  },
635
 
636
+ resizeTo : function(w, h, store) {
637
+ var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr');
638
 
639
  // Boundery fix box
640
  w = Math.max(s.theme_advanced_resizing_min_width || 100, w);
642
  w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w);
643
  h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h);
644
 
 
 
 
645
  // Resize iframe and container
646
+ DOM.setStyle(e, 'height', '');
647
+ DOM.setStyle(ifr, 'height', h);
648
+
649
+ if (s.theme_advanced_resize_horizontal) {
650
+ DOM.setStyle(e, 'width', '');
651
+ DOM.setStyle(ifr, 'width', w);
652
+
653
+ // Make sure that the size is never smaller than the over all ui
654
+ if (w < e.clientWidth) {
655
+ w = e.clientWidth;
656
+ DOM.setStyle(ifr, 'width', e.clientWidth);
657
+ }
658
+ }
659
+
660
+ // Store away the size
661
+ if (store && s.theme_advanced_resizing_use_cookie) {
662
+ Cookie.setHash("TinyMCE_" + ed.id + "_size", {
663
+ cw : w,
664
+ ch : h
665
+ });
666
+ }
667
  },
668
 
669
  destroy : function() {
757
  each(explode(s.theme_advanced_containers || ''), function(c, i) {
758
  var v = s['theme_advanced_container_' + c] || '';
759
 
760
+ switch (c.toLowerCase()) {
761
  case 'mceeditor':
762
  n = DOM.add(tb, 'tr');
763
  n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
825
  },
826
 
827
  _addToolbars : function(c, o) {
828
+ var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup;
829
 
830
+ toolbarGroup = cf.createToolbarGroup('toolbargroup', {
831
+ 'name': ed.getLang('advanced.toolbar'),
832
+ 'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar')
833
+ });
834
 
835
+ t.toolbarGroup = toolbarGroup;
836
 
837
+ a = s.theme_advanced_toolbar_align.toLowerCase();
838
+ a = 'mce' + t._ufirst(a);
839
 
840
+ n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"presentation"});
841
 
842
  // Create toolbar and add the controls
843
  for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {
850
  v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v;
851
 
852
  t._addControls(v, tb);
853
+ toolbarGroup.add(tb);
 
 
854
 
855
  o.deltaHeight -= s.theme_advanced_row_height;
856
  }
857
+ h.push(toolbarGroup.renderHTML());
858
  h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));
859
  DOM.setHTML(n, h.join(''));
860
  },
863
  var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td;
864
 
865
  n = DOM.add(tb, 'tr');
866
+ n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'});
867
+ n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'});
868
+ if (s.theme_advanced_path) {
869
+ DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path'));
870
+ DOM.add(n, 'span', {}, ': ');
871
+ } else {
872
+ DOM.add(n, 'span', {}, '&#160;');
873
+ }
874
+
875
 
876
  if (s.theme_advanced_resizing) {
877
+ DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize', tabIndex:"-1"});
878
 
879
  if (s.theme_advanced_resizing_use_cookie) {
880
  ed.onPostRender.add(function() {
883
  if (!o)
884
  return;
885
 
886
+ t.resizeTo(o.cw, o.ch);
 
 
 
 
887
  });
888
  }
889
 
890
  ed.onPostRender.add(function() {
891
+ Event.add(ed.id + '_resize', 'click', function(e) {
892
+ e.preventDefault();
893
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
894
 
895
+ Event.add(ed.id + '_resize', 'mousedown', function(e) {
896
+ var mouseMoveHandler1, mouseMoveHandler2,
897
+ mouseUpHandler1, mouseUpHandler2,
898
+ startX, startY, startWidth, startHeight, width, height, ifrElm;
899
 
900
+ function resizeOnMove(e) {
901
+ e.preventDefault();
902
 
903
+ width = startWidth + (e.screenX - startX);
904
+ height = startHeight + (e.screenY - startY);
905
 
906
+ t.resizeTo(width, height);
907
+ };
908
 
909
+ function endResize(e) {
910
  // Stop listening
911
+ Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1);
912
+ Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2);
913
+ Event.remove(DOM.doc, 'mouseup', mouseUpHandler1);
914
+ Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2);
915
+
916
+ width = startWidth + (e.screenX - startX);
917
+ height = startHeight + (e.screenY - startY);
918
+ t.resizeTo(width, height, true);
919
+ };
 
 
 
 
920
 
921
+ e.preventDefault();
 
922
 
923
+ // Get the current rect size
924
+ startX = e.screenX;
925
+ startY = e.screenY;
926
+ ifrElm = DOM.get(t.editor.id + '_ifr');
927
+ startWidth = width = ifrElm.clientWidth;
928
+ startHeight = height = ifrElm.clientHeight;
 
929
 
930
+ // Register envent handlers
931
+ mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove);
932
+ mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove);
933
+ mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize);
934
+ mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize);
935
  });
936
  });
937
  }
940
  n = tb = null;
941
  },
942
 
943
+ _updateUndoStatus : function(ed) {
944
+ var cm = ed.controlManager, um = ed.undoManager;
945
+
946
+ cm.setDisabled('undo', !um.hasUndo() && !um.typing);
947
+ cm.setDisabled('redo', !um.hasRedo());
948
+ },
949
+
950
  _nodeChanged : function(ed, cm, n, co, ob) {
951
+ var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches;
952
 
953
  tinymce.each(t.stateControls, function(c) {
954
  cm.setActive(c, ed.queryCommandState(t.controls[c][1]));
970
  };
971
 
972
  cm.setActive('visualaid', ed.hasVisual);
973
+ t._updateUndoStatus(ed);
 
974
  cm.setDisabled('outdent', !ed.queryCommandState('Outdent'));
975
 
976
  p = getParent('A');
987
  }
988
 
989
  if (c = cm.get('anchor')) {
990
+ c.setActive(!co && !!p && p.name);
991
  }
992
 
993
  p = getParent('IMG');
994
  if (c = cm.get('image'))
995
+ c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1);
996
 
997
  if (c = cm.get('styleselect')) {
998
  t._importClasses();
999
 
1000
+ formatNames = [];
1001
+ each(c.items, function(item) {
1002
+ formatNames.push(item.value);
1003
  });
1004
+
1005
+ matches = ed.formatter.matchAll(formatNames);
1006
+ c.select(matches[0]);
1007
  }
1008
 
1009
  if (c = cm.get('formatselect')) {
1018
  if (n.nodeName === 'SPAN') {
1019
  if (!cl && n.className)
1020
  cl = n.className;
1021
+ }
1022
 
1023
+ if (ed.dom.is(n, s.theme_advanced_font_selector)) {
1024
  if (!fz && n.style.fontSize)
1025
  fz = n.style.fontSize;
1026
 
1027
  if (!fn && n.style.fontFamily)
1028
  fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase();
1029
+
1030
+ if (!fc && n.style.color)
1031
+ fc = n.style.color;
1032
+
1033
+ if (!bc && n.style.backgroundColor)
1034
+ bc = n.style.backgroundColor;
1035
  }
1036
 
1037
  return false;
1057
  return true;
1058
  });
1059
  }
1060
+
1061
+ if (s.theme_advanced_show_current_color) {
1062
+ function updateColor(controlId, color) {
1063
+ if (c = cm.get(controlId)) {
1064
+ if (!color)
1065
+ color = c.settings.default_color;
1066
+ if (color !== c.value) {
1067
+ c.displayColor(color);
1068
+ }
1069
+ }
1070
+ }
1071
+ updateColor('forecolor', fc);
1072
+ updateColor('backcolor', bc);
1073
+ }
1074
+
1075
+ if (s.theme_advanced_show_current_color) {
1076
+ function updateColor(controlId, color) {
1077
+ if (c = cm.get(controlId)) {
1078
+ if (!color)
1079
+ color = c.settings.default_color;
1080
+ if (color !== c.value) {
1081
+ c.displayColor(color);
1082
+ }
1083
+ }
1084
+ };
1085
+
1086
+ updateColor('forecolor', fc);
1087
+ updateColor('backcolor', bc);
1088
+ }
1089
 
1090
  if (s.theme_advanced_path && s.theme_advanced_statusbar_location) {
1091
  p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'});
1092
+
1093
+ if (t.statusKeyboardNavigation) {
1094
+ t.statusKeyboardNavigation.destroy();
1095
+ t.statusKeyboardNavigation = null;
1096
+ }
1097
+
1098
  DOM.setHTML(p, '');
1099
 
1100
  getParent(function(n) {
1101
  var na = n.nodeName.toLowerCase(), u, pi, ti = '';
1102
 
1103
+ // Ignore non element and bogus/hidden elements
1104
+ if (n.nodeType != 1 || na === 'br' || n.getAttribute('data-mce-bogus') || DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved'))
 
 
 
1105
  return;
1106
 
 
 
 
 
1107
  // Handle prefix
1108
  if (tinymce.isIE && n.scopeName !== 'HTML')
1109
  na = n.scopeName + ':' + na;
1178
  na = na.name;
1179
 
1180
  //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');";
1181
+ pi = DOM.create('a', {'href' : "javascript:;", role: 'button', onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na);
1182
 
1183
  if (p.hasChildNodes()) {
1184
+ p.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\u00a0\u00bb '), p.firstChild);
1185
  p.insertBefore(pi, p.firstChild);
1186
  } else
1187
  p.appendChild(pi);
1188
  }, ed.getBody());
1189
+
1190
+ if (DOM.select('a', p).length > 0) {
1191
+ t.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({
1192
+ root: ed.id + "_path_row",
1193
+ items: DOM.select('a', p),
1194
+ excludeFromTabOrder: true,
1195
+ onCancel: function() {
1196
+ ed.focus();
1197
+ }
1198
+ }, DOM);
1199
+ }
1200
  }
1201
  },
1202
 
1210
  var ed = this.editor;
1211
 
1212
  ed.windowManager.open({
1213
+ url : this.url + '/anchor.htm',
1214
  width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)),
1215
  height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)),
1216
  inline : true
1223
  var ed = this.editor;
1224
 
1225
  ed.windowManager.open({
1226
+ url : this.url + '/charmap.htm',
1227
  width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)),
1228
+ height : 260 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)),
1229
  inline : true
1230
  }, {
1231
  theme_url : this.url
1236
  var ed = this.editor;
1237
 
1238
  ed.windowManager.open({
1239
+ url : this.url + '/about.htm',
1240
  width : 480,
1241
  height : 380,
1242
  inline : true
1245
  });
1246
  },
1247
 
1248
+ _mceShortcuts : function() {
1249
+ var ed = this.editor;
1250
+ ed.windowManager.open({
1251
+ url: this.url + '/shortcuts.htm',
1252
+ width: 480,
1253
+ height: 380,
1254
+ inline: true
1255
+ }, {
1256
+ theme_url: this.url
1257
+ });
1258
+ },
1259
+
1260
  _mceColorPicker : function(u, v) {
1261
  var ed = this.editor;
1262
 
1263
  v = v || {};
1264
 
1265
  ed.windowManager.open({
1266
+ url : this.url + '/color_picker.htm',
1267
  width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)),
1268
  height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)),
1269
  close_previous : false,
1279
  var ed = this.editor;
1280
 
1281
  ed.windowManager.open({
1282
+ url : this.url + '/source_editor.htm',
1283
  width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)),
1284
  height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)),
1285
  inline : true,
1298
  return;
1299
 
1300
  ed.windowManager.open({
1301
+ url : this.url + '/image.htm',
1302
  width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)),
1303
  height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)),
1304
  inline : true
1311
  var ed = this.editor;
1312
 
1313
  ed.windowManager.open({
1314
+ url : this.url + '/link.htm',
1315
  width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)),
1316
  height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)),
1317
  inline : true
1359
  });
1360
 
1361
  tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme);
1362
+ }(tinymce));
tiny_mce/themes/advanced/image.htm CHANGED
@@ -17,57 +17,57 @@
17
 
18
  <div class="panel_wrapper">
19
  <div id="general_panel" class="panel current">
20
- <table border="0" cellpadding="4" cellspacing="0">
21
- <tr>
22
- <td class="nowrap"><label for="src">{#advanced_dlg.image_src}</label></td>
23
- <td><table border="0" cellspacing="0" cellpadding="0">
24
- <tr>
25
- <td><input id="src" name="src" type="text" class="mceFocus" value="" style="width: 200px" onchange="ImageDialog.getImageData();" /></td>
26
- <td id="srcbrowsercontainer">&nbsp;</td>
27
- </tr>
28
- </table></td>
29
- </tr>
30
- <tr>
31
- <td><label for="image_list">{#advanced_dlg.image_list}</label></td>
32
- <td><select id="image_list" name="image_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;"></select></td>
33
- </tr>
34
- <tr>
35
- <td class="nowrap"><label for="alt">{#advanced_dlg.image_alt}</label></td>
36
- <td><input id="alt" name="alt" type="text" value="" style="width: 200px" /></td>
37
- </tr>
38
- <tr>
39
- <td class="nowrap"><label for="align">{#advanced_dlg.image_align}</label></td>
40
- <td><select id="align" name="align" onchange="ImageDialog.updateStyle();">
41
- <option value="">{#not_set}</option>
42
- <option value="baseline">{#advanced_dlg.image_align_baseline}</option>
43
- <option value="top">{#advanced_dlg.image_align_top}</option>
44
- <option value="middle">{#advanced_dlg.image_align_middle}</option>
45
- <option value="bottom">{#advanced_dlg.image_align_bottom}</option>
46
- <option value="text-top">{#advanced_dlg.image_align_texttop}</option>
47
- <option value="text-bottom">{#advanced_dlg.image_align_textbottom}</option>
48
- <option value="left">{#advanced_dlg.image_align_left}</option>
49
- <option value="right">{#advanced_dlg.image_align_right}</option>
50
- </select></td>
51
- </tr>
52
- <tr>
53
- <td class="nowrap"><label for="width">{#advanced_dlg.image_dimensions}</label></td>
54
- <td><input id="width" name="width" type="text" value="" size="3" maxlength="5" />
55
- x
56
- <input id="height" name="height" type="text" value="" size="3" maxlength="5" /></td>
57
- </tr>
58
- <tr>
59
- <td class="nowrap"><label for="border">{#advanced_dlg.image_border}</label></td>
60
- <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>
61
- </tr>
62
- <tr>
63
- <td class="nowrap"><label for="vspace">{#advanced_dlg.image_vspace}</label></td>
64
- <td><input id="vspace" name="vspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>
65
- </tr>
66
- <tr>
67
- <td class="nowrap"><label for="hspace">{#advanced_dlg.image_hspace}</label></td>
68
- <td><input id="hspace" name="hspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>
69
- </tr>
70
- </table>
71
  </div>
72
  </div>
73
 
17
 
18
  <div class="panel_wrapper">
19
  <div id="general_panel" class="panel current">
20
+ <table border="0" cellpadding="4" cellspacing="0">
21
+ <tr>
22
+ <td class="nowrap"><label for="src">{#advanced_dlg.image_src}</label></td>
23
+ <td><table border="0" cellspacing="0" cellpadding="0">
24
+ <tr>
25
+ <td><input id="src" name="src" type="text" class="mceFocus" value="" style="width: 200px" onchange="ImageDialog.getImageData();" /></td>
26
+ <td id="srcbrowsercontainer">&nbsp;</td>
27
+ </tr>
28
+ </table></td>
29
+ </tr>
30
+ <tr>
31
+ <td><label for="image_list">{#advanced_dlg.image_list}</label></td>
32
+ <td><select id="image_list" name="image_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;"></select></td>
33
+ </tr>
34
+ <tr>
35
+ <td class="nowrap"><label for="alt">{#advanced_dlg.image_alt}</label></td>
36
+ <td><input id="alt" name="alt" type="text" value="" style="width: 200px" /></td>
37
+ </tr>
38
+ <tr>
39
+ <td class="nowrap"><label for="align">{#advanced_dlg.image_align}</label></td>
40
+ <td><select id="align" name="align" onchange="ImageDialog.updateStyle();">
41
+ <option value="">{#not_set}</option>
42
+ <option value="baseline">{#advanced_dlg.image_align_baseline}</option>
43
+ <option value="top">{#advanced_dlg.image_align_top}</option>
44
+ <option value="middle">{#advanced_dlg.image_align_middle}</option>
45
+ <option value="bottom">{#advanced_dlg.image_align_bottom}</option>
46
+ <option value="text-top">{#advanced_dlg.image_align_texttop}</option>
47
+ <option value="text-bottom">{#advanced_dlg.image_align_textbottom}</option>
48
+ <option value="left">{#advanced_dlg.image_align_left}</option>
49
+ <option value="right">{#advanced_dlg.image_align_right}</option>
50
+ </select></td>
51
+ </tr>
52
+ <tr>
53
+ <td class="nowrap"><label for="width">{#advanced_dlg.image_dimensions}</label></td>
54
+ <td><input id="width" name="width" type="text" value="" size="3" maxlength="5" />
55
+ x
56
+ <input id="height" name="height" type="text" value="" size="3" maxlength="5" /></td>
57
+ </tr>
58
+ <tr>
59
+ <td class="nowrap"><label for="border">{#advanced_dlg.image_border}</label></td>
60
+ <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>
61
+ </tr>
62
+ <tr>
63
+ <td class="nowrap"><label for="vspace">{#advanced_dlg.image_vspace}</label></td>
64
+ <td><input id="vspace" name="vspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>
65
+ </tr>
66
+ <tr>
67
+ <td class="nowrap"><label for="hspace">{#advanced_dlg.image_hspace}</label></td>
68
+ <td><input id="hspace" name="hspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>
69
+ </tr>
70
+ </table>
71
  </div>
72
  </div>
73
 
tiny_mce/themes/advanced/img/colorpicker.jpg CHANGED
Binary file
tiny_mce/themes/advanced/img/flash.gif ADDED
Binary file
tiny_mce/themes/advanced/img/icons.gif CHANGED
Binary file
tiny_mce/themes/advanced/img/iframe.gif ADDED
Binary file
tiny_mce/themes/advanced/img/pagebreak.gif ADDED
Binary file
tiny_mce/themes/advanced/img/quicktime.gif ADDED
Binary file
tiny_mce/themes/advanced/img/realmedia.gif ADDED
Binary file
tiny_mce/themes/advanced/img/shockwave.gif ADDED
Binary file
tiny_mce/themes/advanced/img/trans.gif ADDED
Binary file
tiny_mce/themes/advanced/img/video.gif ADDED
Binary file
tiny_mce/themes/advanced/img/windowsmedia.gif ADDED
Binary file
tiny_mce/themes/advanced/js/about.js CHANGED
@@ -66,6 +66,7 @@ function insertHelpIFrame() {
66
  html = '<iframe width="100%" height="300" src="' + tinyMCEPopup.editor.baseURI.toAbsolute(tinyMCEPopup.getParam('docs_url')) + '"></iframe>';
67
  document.getElementById('iframecontainer').innerHTML = html;
68
  document.getElementById('help_tab').style.display = 'block';
 
69
  }
70
  }
71
 
66
  html = '<iframe width="100%" height="300" src="' + tinyMCEPopup.editor.baseURI.toAbsolute(tinyMCEPopup.getParam('docs_url')) + '"></iframe>';
67
  document.getElementById('iframecontainer').innerHTML = html;
68
  document.getElementById('help_tab').style.display = 'block';
69
+ document.getElementById('help_tab').setAttribute("aria-hidden", "false");
70
  }
71
  }
72
 
tiny_mce/themes/advanced/js/anchor.js CHANGED
@@ -19,15 +19,21 @@ var AnchorDialog = {
19
  update : function() {
20
  var ed = this.editor, elm, name = document.forms[0].anchorName.value;
21
 
 
 
 
 
 
22
  tinyMCEPopup.restoreSelection();
23
 
24
  if (this.action != 'update')
25
  ed.selection.collapse(1);
26
 
27
  elm = ed.dom.getParent(ed.selection.getNode(), 'A');
28
- if (elm)
 
29
  elm.name = name;
30
- else
31
  ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, ''));
32
 
33
  tinyMCEPopup.close();
19
  update : function() {
20
  var ed = this.editor, elm, name = document.forms[0].anchorName.value;
21
 
22
+ if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) {
23
+ tinyMCEPopup.alert('advanced_dlg.anchor_invalid');
24
+ return;
25
+ }
26
+
27
  tinyMCEPopup.restoreSelection();
28
 
29
  if (this.action != 'update')
30
  ed.selection.collapse(1);
31
 
32
  elm = ed.dom.getParent(ed.selection.getNode(), 'A');
33
+ if (elm) {
34
+ elm.setAttribute('name', name);
35
  elm.name = name;
36
+ } else
37
  ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, ''));
38
 
39
  tinyMCEPopup.close();
tiny_mce/themes/advanced/js/charmap.js CHANGED
@@ -173,7 +173,7 @@ var charmap = [
173
  ['&yacute;', '&#253;', true, 'y - acute'],
174
  ['&thorn;', '&#254;', true, 'thorn'],
175
  ['&yuml;', '&#255;', true, 'y - diaeresis'],
176
- ['&Alpha;', '&#913;', true, 'Alpha'],
177
  ['&Beta;', '&#914;', true, 'Beta'],
178
  ['&Gamma;', '&#915;', true, 'Gamma'],
179
  ['&Delta;', '&#916;', true, 'Delta'],
@@ -258,8 +258,8 @@ var charmap = [
258
  ['&rfloor;', '&#8971;', false,'right floor'],
259
  ['&lang;', '&#9001;', false,'left-pointing angle bracket'],
260
  ['&rang;', '&#9002;', false,'right-pointing angle bracket'],
261
- ['&loz;', '&#9674;', true,'lozenge'],
262
- ['&spades;', '&#9824;', false,'black spade suit'],
263
  ['&clubs;', '&#9827;', true, 'black club suit'],
264
  ['&hearts;', '&#9829;', true, 'black heart suit'],
265
  ['&diams;', '&#9830;', true, 'black diamond suit'],
@@ -275,19 +275,46 @@ var charmap = [
275
 
276
  tinyMCEPopup.onInit.add(function() {
277
  tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML());
 
278
  });
279
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
280
  function renderCharMapHTML() {
281
  var charsPerRow = 20, tdWidth=20, tdHeight=20, i;
282
- var html = '<table border="0" cellspacing="1" cellpadding="0" width="' + (tdWidth*charsPerRow) + '"><tr height="' + tdHeight + '">';
 
 
283
  var cols=-1;
284
 
285
  for (i=0; i<charmap.length; i++) {
 
 
286
  if (charmap[i][2]==true) {
287
  cols++;
 
288
  html += ''
289
  + '<td class="charmap">'
290
- + '<a onmouseover="previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');" onfocus="previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');" href="javascript:void(0)" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + '">'
291
  + charmap[i][1]
292
  + '</a></td>';
293
  if ((cols+1) % charsPerRow == 0)
@@ -301,7 +328,8 @@ function renderCharMapHTML() {
301
  html += '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap">&nbsp;</td>';
302
  }
303
 
304
- html += '</tr></table>';
 
305
 
306
  return html;
307
  }
173
  ['&yacute;', '&#253;', true, 'y - acute'],
174
  ['&thorn;', '&#254;', true, 'thorn'],
175
  ['&yuml;', '&#255;', true, 'y - diaeresis'],
176
+ ['&Alpha;', '&#913;', true, 'Alpha'],
177
  ['&Beta;', '&#914;', true, 'Beta'],
178
  ['&Gamma;', '&#915;', true, 'Gamma'],
179
  ['&Delta;', '&#916;', true, 'Delta'],
258
  ['&rfloor;', '&#8971;', false,'right floor'],
259
  ['&lang;', '&#9001;', false,'left-pointing angle bracket'],
260
  ['&rang;', '&#9002;', false,'right-pointing angle bracket'],
261
+ ['&loz;', '&#9674;', true, 'lozenge'],
262
+ ['&spades;', '&#9824;', true, 'black spade suit'],
263
  ['&clubs;', '&#9827;', true, 'black club suit'],
264
  ['&hearts;', '&#9829;', true, 'black heart suit'],
265
  ['&diams;', '&#9830;', true, 'black diamond suit'],
275
 
276
  tinyMCEPopup.onInit.add(function() {
277
  tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML());
278
+ addKeyboardNavigation();
279
  });
280
 
281
+ function addKeyboardNavigation(){
282
+ var tableElm, cells, settings;
283
+
284
+ cells = tinyMCEPopup.dom.select("a.charmaplink", "charmapgroup");
285
+
286
+ settings ={
287
+ root: "charmapgroup",
288
+ items: cells
289
+ };
290
+ cells[0].tabindex=0;
291
+ tinyMCEPopup.dom.addClass(cells[0], "mceFocus");
292
+ if (tinymce.isGecko) {
293
+ cells[0].focus();
294
+ } else {
295
+ setTimeout(function(){
296
+ cells[0].focus();
297
+ }, 100);
298
+ }
299
+ tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom);
300
+ }
301
+
302
  function renderCharMapHTML() {
303
  var charsPerRow = 20, tdWidth=20, tdHeight=20, i;
304
+ var html = '<div id="charmapgroup" aria-labelledby="charmap_label" tabindex="0" role="listbox">'+
305
+ '<table role="presentation" border="0" cellspacing="1" cellpadding="0" width="' + (tdWidth*charsPerRow) +
306
+ '"><tr height="' + tdHeight + '">';
307
  var cols=-1;
308
 
309
  for (i=0; i<charmap.length; i++) {
310
+ var previewCharFn;
311
+
312
  if (charmap[i][2]==true) {
313
  cols++;
314
+ previewCharFn = 'previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');';
315
  html += ''
316
  + '<td class="charmap">'
317
+ + '<a class="charmaplink" role="button" onmouseover="'+previewCharFn+'" onfocus="'+previewCharFn+'" href="javascript:void(0)" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + ' '+ tinyMCEPopup.editor.translate("advanced_dlg.charmap_usage")+'">'
318
  + charmap[i][1]
319
  + '</a></td>';
320
  if ((cols+1) % charsPerRow == 0)
328
  html += '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap">&nbsp;</td>';
329
  }
330
 
331
+ html += '</tr></table></div>';
332
+ html = html.replace(/<tr height="20"><\/tr>/g, '');
333
 
334
  return html;
335
  }
tiny_mce/themes/advanced/js/color_picker.js CHANGED
@@ -33,37 +33,41 @@ var colors = [
33
  ];
34
 
35
  var named = {
36
- '#F0F8FF':'AliceBlue','#FAEBD7':'AntiqueWhite','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',
37
- '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'BlanchedAlmond','#0000FF':'Blue','#8A2BE2':'BlueViolet','#A52A2A':'Brown',
38
- '#DEB887':'BurlyWood','#5F9EA0':'CadetBlue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'CornflowerBlue',
39
- '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'DarkBlue','#008B8B':'DarkCyan','#B8860B':'DarkGoldenRod',
40
- '#A9A9A9':'DarkGray','#A9A9A9':'DarkGrey','#006400':'DarkGreen','#BDB76B':'DarkKhaki','#8B008B':'DarkMagenta','#556B2F':'DarkOliveGreen',
41
- '#FF8C00':'Darkorange','#9932CC':'DarkOrchid','#8B0000':'DarkRed','#E9967A':'DarkSalmon','#8FBC8F':'DarkSeaGreen','#483D8B':'DarkSlateBlue',
42
- '#2F4F4F':'DarkSlateGray','#2F4F4F':'DarkSlateGrey','#00CED1':'DarkTurquoise','#9400D3':'DarkViolet','#FF1493':'DeepPink','#00BFFF':'DeepSkyBlue',
43
- '#696969':'DimGray','#696969':'DimGrey','#1E90FF':'DodgerBlue','#B22222':'FireBrick','#FFFAF0':'FloralWhite','#228B22':'ForestGreen',
44
- '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'GhostWhite','#FFD700':'Gold','#DAA520':'GoldenRod','#808080':'Gray','#808080':'Grey',
45
- '#008000':'Green','#ADFF2F':'GreenYellow','#F0FFF0':'HoneyDew','#FF69B4':'HotPink','#CD5C5C':'IndianRed','#4B0082':'Indigo','#FFFFF0':'Ivory',
46
- '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'LavenderBlush','#7CFC00':'LawnGreen','#FFFACD':'LemonChiffon','#ADD8E6':'LightBlue',
47
- '#F08080':'LightCoral','#E0FFFF':'LightCyan','#FAFAD2':'LightGoldenRodYellow','#D3D3D3':'LightGray','#D3D3D3':'LightGrey','#90EE90':'LightGreen',
48
- '#FFB6C1':'LightPink','#FFA07A':'LightSalmon','#20B2AA':'LightSeaGreen','#87CEFA':'LightSkyBlue','#778899':'LightSlateGray','#778899':'LightSlateGrey',
49
- '#B0C4DE':'LightSteelBlue','#FFFFE0':'LightYellow','#00FF00':'Lime','#32CD32':'LimeGreen','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',
50
- '#66CDAA':'MediumAquaMarine','#0000CD':'MediumBlue','#BA55D3':'MediumOrchid','#9370D8':'MediumPurple','#3CB371':'MediumSeaGreen','#7B68EE':'MediumSlateBlue',
51
- '#00FA9A':'MediumSpringGreen','#48D1CC':'MediumTurquoise','#C71585':'MediumVioletRed','#191970':'MidnightBlue','#F5FFFA':'MintCream','#FFE4E1':'MistyRose','#FFE4B5':'Moccasin',
52
- '#FFDEAD':'NavajoWhite','#000080':'Navy','#FDF5E6':'OldLace','#808000':'Olive','#6B8E23':'OliveDrab','#FFA500':'Orange','#FF4500':'OrangeRed','#DA70D6':'Orchid',
53
- '#EEE8AA':'PaleGoldenRod','#98FB98':'PaleGreen','#AFEEEE':'PaleTurquoise','#D87093':'PaleVioletRed','#FFEFD5':'PapayaWhip','#FFDAB9':'PeachPuff',
54
- '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'PowderBlue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'RosyBrown','#4169E1':'RoyalBlue',
55
- '#8B4513':'SaddleBrown','#FA8072':'Salmon','#F4A460':'SandyBrown','#2E8B57':'SeaGreen','#FFF5EE':'SeaShell','#A0522D':'Sienna','#C0C0C0':'Silver',
56
- '#87CEEB':'SkyBlue','#6A5ACD':'SlateBlue','#708090':'SlateGray','#708090':'SlateGrey','#FFFAFA':'Snow','#00FF7F':'SpringGreen',
57
- '#4682B4':'SteelBlue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',
58
- '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'WhiteSmoke','#FFFF00':'Yellow','#9ACD32':'YellowGreen'
59
  };
60
 
 
 
61
  function init() {
62
- var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color'));
63
 
64
  tinyMCEPopup.resizeToInnerSize();
65
 
66
  generatePicker();
 
 
67
 
68
  if (inputColor) {
69
  changeFinalColor(inputColor);
@@ -73,6 +77,45 @@ function init() {
73
  if (col)
74
  updateLight(col.r, col.g, col.b);
75
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  }
77
 
78
  function insertAction() {
@@ -81,7 +124,7 @@ function insertAction() {
81
  tinyMCEPopup.restoreSelection();
82
 
83
  if (f)
84
- f(color);
85
 
86
  tinyMCEPopup.close();
87
  }
@@ -91,7 +134,7 @@ function showColor(color, name) {
91
  document.getElementById("colorname").innerHTML = name;
92
 
93
  document.getElementById("preview").style.backgroundColor = color;
94
- document.getElementById("color").value = color.toLowerCase();
95
  }
96
 
97
  function convertRGBToHex(col) {
@@ -153,23 +196,40 @@ function generateWebColors() {
153
  if (el.className == 'generated')
154
  return;
155
 
156
- h += '<table border="0" cellspacing="1" cellpadding="0">'
 
157
  + '<tr>';
158
 
159
  for (i=0; i<colors.length; i++) {
160
  h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'
161
- + '<a href="javascript:insertAction();" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');" style="display:block;width:10px;height:10px;overflow:hidden;">'
162
- + '</a></td>';
 
 
 
 
163
  if ((i+1) % 18 == 0)
164
  h += '</tr><tr>';
165
  }
166
 
167
- h += '</table>';
168
 
169
  el.innerHTML = h;
170
  el.className = 'generated';
 
 
 
171
  }
172
 
 
 
 
 
 
 
 
 
 
173
  function generateNamedColors() {
174
  var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
175
 
@@ -178,11 +238,27 @@ function generateNamedColors() {
178
 
179
  for (n in named) {
180
  v = named[n];
181
- h += '<a href="javascript:insertAction();" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '"><!-- IE --></a>'
 
 
 
 
 
 
182
  }
183
 
184
  el.innerHTML = h;
185
  el.className = 'generated';
 
 
 
 
 
 
 
 
 
 
186
  }
187
 
188
  function dechex(n) {
@@ -190,10 +266,10 @@ function dechex(n) {
190
  }
191
 
192
  function computeColor(e) {
193
- var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB;
194
 
195
- x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0);
196
- y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0);
197
 
198
  partWidth = document.getElementById('colors').width / 6;
199
  partDetail = detail / 2;
33
  ];
34
 
35
  var named = {
36
+ '#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',
37
+ '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown',
38
+ '#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue',
39
+ '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod',
40
+ '#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green',
41
+ '#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue',
42
+ '#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue',
43
+ '#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green',
44
+ '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey',
45
+ '#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory',
46
+ '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue',
47
+ '#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green',
48
+ '#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey',
49
+ '#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',
50
+ '#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue',
51
+ '#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin',
52
+ '#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid',
53
+ '#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff',
54
+ '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue',
55
+ '#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver',
56
+ '#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green',
57
+ '#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',
58
+ '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green'
59
  };
60
 
61
+ var namedLookup = {};
62
+
63
  function init() {
64
+ var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value;
65
 
66
  tinyMCEPopup.resizeToInnerSize();
67
 
68
  generatePicker();
69
+ generateWebColors();
70
+ generateNamedColors();
71
 
72
  if (inputColor) {
73
  changeFinalColor(inputColor);
77
  if (col)
78
  updateLight(col.r, col.g, col.b);
79
  }
80
+
81
+ for (key in named) {
82
+ value = named[key];
83
+ namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase();
84
+ }
85
+ }
86
+
87
+ function toHexColor(color) {
88
+ var matches, red, green, blue, toInt = parseInt;
89
+
90
+ function hex(value) {
91
+ value = parseInt(value).toString(16);
92
+
93
+ return value.length > 1 ? value : '0' + value; // Padd with leading zero
94
+ };
95
+
96
+ color = color.replace(/[\s#]+/g, '').toLowerCase();
97
+ color = namedLookup[color] || color;
98
+ matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)|([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})|([a-f0-9])([a-f0-9])([a-f0-9])$/.exec(color);
99
+
100
+ if (matches) {
101
+ if (matches[1]) {
102
+ red = toInt(matches[1]);
103
+ green = toInt(matches[2]);
104
+ blue = toInt(matches[3]);
105
+ } else if (matches[4]) {
106
+ red = toInt(matches[4], 16);
107
+ green = toInt(matches[5], 16);
108
+ blue = toInt(matches[6], 16);
109
+ } else if (matches[7]) {
110
+ red = toInt(matches[7] + matches[7], 16);
111
+ green = toInt(matches[8] + matches[8], 16);
112
+ blue = toInt(matches[9] + matches[9], 16);
113
+ }
114
+
115
+ return '#' + hex(red) + hex(green) + hex(blue);
116
+ }
117
+
118
+ return '';
119
  }
120
 
121
  function insertAction() {
124
  tinyMCEPopup.restoreSelection();
125
 
126
  if (f)
127
+ f(toHexColor(color));
128
 
129
  tinyMCEPopup.close();
130
  }
134
  document.getElementById("colorname").innerHTML = name;
135
 
136
  document.getElementById("preview").style.backgroundColor = color;
137
+ document.getElementById("color").value = color.toUpperCase();
138
  }
139
 
140
  function convertRGBToHex(col) {
196
  if (el.className == 'generated')
197
  return;
198
 
199
+ // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby.
200
+ h += '<div role="listbox" aria-labelledby="webcolors_title" tabindex="0"><table role="presentation" border="0" cellspacing="1" cellpadding="0">'
201
  + '<tr>';
202
 
203
  for (i=0; i<colors.length; i++) {
204
  h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'
205
+ + '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="web_colors_' + i + '" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');" style="display:block;width:10px;height:10px;overflow:hidden;">';
206
+ if (tinyMCEPopup.editor.forcedHighContrastMode) {
207
+ h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
208
+ }
209
+ h += '<span class="mceVoiceLabel" style="display:none;" id="web_colors_' + i + '">' + colors[i].toUpperCase() + '</span>';
210
+ h += '</a></td>';
211
  if ((i+1) % 18 == 0)
212
  h += '</tr><tr>';
213
  }
214
 
215
+ h += '</table></div>';
216
 
217
  el.innerHTML = h;
218
  el.className = 'generated';
219
+
220
+ paintCanvas(el);
221
+ enableKeyboardNavigation(el.firstChild);
222
  }
223
 
224
+ function paintCanvas(el) {
225
+ tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) {
226
+ var context;
227
+ if (canvas.getContext && (context = canvas.getContext("2d"))) {
228
+ context.fillStyle = canvas.getAttribute('data-color');
229
+ context.fillRect(0, 0, 10, 10);
230
+ }
231
+ });
232
+ }
233
  function generateNamedColors() {
234
  var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
235
 
238
 
239
  for (n in named) {
240
  v = named[n];
241
+ h += '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="named_colors_' + i + '" onfocus="showColor(\'' + n + '\',\'' + v + '\');" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '">';
242
+ if (tinyMCEPopup.editor.forcedHighContrastMode) {
243
+ h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
244
+ }
245
+ h += '<span class="mceVoiceLabel" style="display:none;" id="named_colors_' + i + '">' + v + '</span>';
246
+ h += '</a>';
247
+ i++;
248
  }
249
 
250
  el.innerHTML = h;
251
  el.className = 'generated';
252
+
253
+ paintCanvas(el);
254
+ enableKeyboardNavigation(el);
255
+ }
256
+
257
+ function enableKeyboardNavigation(el) {
258
+ tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
259
+ root: el,
260
+ items: tinyMCEPopup.dom.select('a', el)
261
+ }, tinyMCEPopup.dom);
262
  }
263
 
264
  function dechex(n) {
266
  }
267
 
268
  function computeColor(e) {
269
+ var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target);
270
 
271
+ x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0);
272
+ y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0);
273
 
274
  partWidth = document.getElementById('colors').width / 6;
275
  partDetail = detail / 2;
tiny_mce/themes/advanced/js/image.js CHANGED
@@ -18,7 +18,7 @@ var ImageDialog = {
18
 
19
  e = ed.selection.getNode();
20
 
21
- this.fillFileList('image_list', 'tinyMCEImageList');
22
 
23
  if (e.nodeName == 'IMG') {
24
  f.src.value = ed.dom.getAttrib(e, 'src');
@@ -39,7 +39,7 @@ var ImageDialog = {
39
  fillFileList : function(id, l) {
40
  var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
41
 
42
- l = window[l];
43
 
44
  if (l && l.length > 0) {
45
  lst.options[lst.options.length] = new Option('', '');
@@ -77,7 +77,7 @@ var ImageDialog = {
77
  args.style = this.styleVal;
78
 
79
  tinymce.extend(args, {
80
- src : f.src.value,
81
  alt : f.alt.value,
82
  width : f.width.value,
83
  height : f.height.value
@@ -87,10 +87,16 @@ var ImageDialog = {
87
 
88
  if (el && el.nodeName == 'IMG') {
89
  ed.dom.setAttribs(el, args);
 
 
90
  } else {
91
- ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1});
92
- ed.dom.setAttribs('__mce_tmp', args);
93
- ed.dom.setAttrib('__mce_tmp', 'id', '');
 
 
 
 
94
  ed.undoManager.add();
95
  }
96
 
18
 
19
  e = ed.selection.getNode();
20
 
21
+ this.fillFileList('image_list', tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList'));
22
 
23
  if (e.nodeName == 'IMG') {
24
  f.src.value = ed.dom.getAttrib(e, 'src');
39
  fillFileList : function(id, l) {
40
  var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
41
 
42
+ l = typeof(l) === 'function' ? l() : window[l];
43
 
44
  if (l && l.length > 0) {
45
  lst.options[lst.options.length] = new Option('', '');
77
  args.style = this.styleVal;
78
 
79
  tinymce.extend(args, {
80
+ src : f.src.value.replace(/ /g, '%20'),
81
  alt : f.alt.value,
82
  width : f.width.value,
83
  height : f.height.value
87
 
88
  if (el && el.nodeName == 'IMG') {
89
  ed.dom.setAttribs(el, args);
90
+ tinyMCEPopup.editor.execCommand('mceRepaint');
91
+ tinyMCEPopup.editor.focus();
92
  } else {
93
+ tinymce.each(args, function(value, name) {
94
+ if (value === "") {
95
+ delete args[name];
96
+ }
97
+ });
98
+
99
+ ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1});
100
  ed.undoManager.add();
101
  }
102
 
tiny_mce/themes/advanced/js/link.js CHANGED
@@ -31,7 +31,7 @@ var LinkDialog = {
31
  },
32
 
33
  update : function() {
34
- var f = document.forms[0], ed = tinyMCEPopup.editor, e, b;
35
 
36
  tinyMCEPopup.restoreSelection();
37
  e = ed.dom.getParent(ed.selection.getNode(), 'A');
@@ -39,7 +39,6 @@ var LinkDialog = {
39
  // Remove element if there is no href
40
  if (!f.href.value) {
41
  if (e) {
42
- tinyMCEPopup.execCommand("mceBeginUndoLevel");
43
  b = ed.selection.getBookmark();
44
  ed.dom.remove(e, 1);
45
  ed.selection.moveToBookmark(b);
@@ -49,19 +48,17 @@ var LinkDialog = {
49
  }
50
  }
51
 
52
- tinyMCEPopup.execCommand("mceBeginUndoLevel");
53
-
54
  // Create new anchor elements
55
  if (e == null) {
56
  ed.getDoc().execCommand("unlink", false, null);
57
- tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
58
 
59
  tinymce.each(ed.dom.select("a"), function(n) {
60
  if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') {
61
  e = n;
62
 
63
  ed.dom.setAttribs(e, {
64
- href : f.href.value,
65
  title : f.linktitle.value,
66
  target : f.target_list ? getSelectValue(f, "target_list") : null,
67
  'class' : f.class_list ? getSelectValue(f, "class_list") : null
@@ -70,7 +67,7 @@ var LinkDialog = {
70
  });
71
  } else {
72
  ed.dom.setAttribs(e, {
73
- href : f.href.value,
74
  title : f.linktitle.value,
75
  target : f.target_list ? getSelectValue(f, "target_list") : null,
76
  'class' : f.class_list ? getSelectValue(f, "class_list") : null
31
  },
32
 
33
  update : function() {
34
+ var f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20');
35
 
36
  tinyMCEPopup.restoreSelection();
37
  e = ed.dom.getParent(ed.selection.getNode(), 'A');
39
  // Remove element if there is no href
40
  if (!f.href.value) {
41
  if (e) {
 
42
  b = ed.selection.getBookmark();
43
  ed.dom.remove(e, 1);
44
  ed.selection.moveToBookmark(b);
48
  }
49
  }
50
 
 
 
51
  // Create new anchor elements
52
  if (e == null) {
53
  ed.getDoc().execCommand("unlink", false, null);
54
+ tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1});
55
 
56
  tinymce.each(ed.dom.select("a"), function(n) {
57
  if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') {
58
  e = n;
59
 
60
  ed.dom.setAttribs(e, {
61
+ href : href,
62
  title : f.linktitle.value,
63
  target : f.target_list ? getSelectValue(f, "target_list") : null,
64
  'class' : f.class_list ? getSelectValue(f, "class_list") : null
67
  });
68
  } else {
69
  ed.dom.setAttribs(e, {
70
+ href : href,
71
  title : f.linktitle.value,
72
  target : f.target_list ? getSelectValue(f, "target_list") : null,
73
  'class' : f.class_list ? getSelectValue(f, "class_list") : null
tiny_mce/themes/advanced/js/source_editor.js CHANGED
@@ -44,19 +44,13 @@ function toggleWordWrap(elm) {
44
  setWrap('off');
45
  }
46
 
47
- var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
48
-
49
  function resizeInputs() {
50
- var el = document.getElementById('htmlSource');
51
 
52
- if (!tinymce.isIE) {
53
- wHeight = self.innerHeight - 65;
54
- wWidth = self.innerWidth - 16;
55
- } else {
56
- wHeight = document.body.clientHeight - 70;
57
- wWidth = document.body.clientWidth - 16;
58
- }
59
 
60
- el.style.height = Math.abs(wHeight) + 'px';
61
- el.style.width = Math.abs(wWidth) + 'px';
 
 
62
  }
44
  setWrap('off');
45
  }
46
 
 
 
47
  function resizeInputs() {
48
+ var vp = tinyMCEPopup.dom.getViewPort(window), el;
49
 
50
+ el = document.getElementById('htmlSource');
 
 
 
 
 
 
51
 
52
+ if (el) {
53
+ el.style.width = (vp.w - 20) + 'px';
54
+ el.style.height = (vp.h - 65) + 'px';
55
+ }
56
  }
tiny_mce/themes/advanced/langs/en.js CHANGED
@@ -1,62 +1 @@
1
- tinyMCE.addI18n('en.advanced',{
2
- style_select:"Styles",
3
- font_size:"Font size",
4
- fontdefault:"Font family",
5
- block:"Format",
6
- paragraph:"Paragraph",
7
- div:"Div",
8
- address:"Address",
9
- pre:"Preformatted",
10
- h1:"Heading 1",
11
- h2:"Heading 2",
12
- h3:"Heading 3",
13
- h4:"Heading 4",
14
- h5:"Heading 5",
15
- h6:"Heading 6",
16
- blockquote:"Blockquote",
17
- code:"Code",
18
- samp:"Code sample",
19
- dt:"Definition term ",
20
- dd:"Definition description",
21
- bold_desc:"Bold (Ctrl+B)",
22
- italic_desc:"Italic (Ctrl+I)",
23
- underline_desc:"Underline (Ctrl+U)",
24
- striketrough_desc:"Strikethrough",
25
- justifyleft_desc:"Align left",
26
- justifycenter_desc:"Align center",
27
- justifyright_desc:"Align right",
28
- justifyfull_desc:"Align full",
29
- bullist_desc:"Unordered list",
30
- numlist_desc:"Ordered list",
31
- outdent_desc:"Outdent",
32
- indent_desc:"Indent",
33
- undo_desc:"Undo (Ctrl+Z)",
34
- redo_desc:"Redo (Ctrl+Y)",
35
- link_desc:"Insert/edit link",
36
- unlink_desc:"Unlink",
37
- image_desc:"Insert/edit image",
38
- cleanup_desc:"Cleanup messy code",
39
- code_desc:"Edit HTML Source",
40
- sub_desc:"Subscript",
41
- sup_desc:"Superscript",
42
- hr_desc:"Insert horizontal ruler",
43
- removeformat_desc:"Remove formatting",
44
- custom1_desc:"Your custom description here",
45
- forecolor_desc:"Select text color",
46
- backcolor_desc:"Select background color",
47
- charmap_desc:"Insert custom character",
48
- visualaid_desc:"Toggle guidelines/invisible elements",
49
- anchor_desc:"Insert/edit anchor",
50
- cut_desc:"Cut",
51
- copy_desc:"Copy",
52
- paste_desc:"Paste",
53
- image_props_desc:"Image properties",
54
- newdocument_desc:"New document",
55
- help_desc:"Help",
56
- blockquote_desc:"Blockquote",
57
- clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?",
58
- path:"Path",
59
- newdocument:"Are you sure you want clear all contents?",
60
- toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",
61
- more_colors:"More colors"
62
- });
1
+ tinyMCE.addI18n('en.advanced',{"underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)",dd:"Definition Description",dt:"Definition Term ",samp:"Code Sample",code:"Code",blockquote:"Block Quote",h6:"Heading 6",h5:"Heading 5",h4:"Heading 4",h3:"Heading 3",h2:"Heading 2",h1:"Heading 1",pre:"Preformatted",address:"Address",div:"DIV",paragraph:"Paragraph",block:"Format",fontdefault:"Font Family","font_size":"Font Size","style_select":"Styles","anchor_delta_height":"","anchor_delta_width":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":"","more_colors":"More Colors...","toolbar_focus":"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",newdocument:"Are you sure you want clear all contents?",path:"Path","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","blockquote_desc":"Block Quote","help_desc":"Help","newdocument_desc":"New Document","image_props_desc":"Image Properties","paste_desc":"Paste (Ctrl+V)","copy_desc":"Copy (Ctrl+C)","cut_desc":"Cut (Ctrl+X)","anchor_desc":"Insert/Edit Anchor","visualaid_desc":"show/Hide Guidelines/Invisible Elements","charmap_desc":"Insert Special Character","backcolor_desc":"Select Background Color","forecolor_desc":"Select Text Color","custom1_desc":"Your Custom Description Here","removeformat_desc":"Remove Formatting","hr_desc":"Insert Horizontal Line","sup_desc":"Superscript","sub_desc":"Subscript","code_desc":"Edit HTML Source","cleanup_desc":"Cleanup Messy Code","image_desc":"Insert/Edit Image","unlink_desc":"Unlink","link_desc":"Insert/Edit Link","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","indent_desc":"Increase Indent","outdent_desc":"Decrease Indent","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","justifyfull_desc":"Align Full","justifyright_desc":"Align Right","justifycenter_desc":"Align Center","justifyleft_desc":"Align Left","striketrough_desc":"Strikethrough","help_shortcut":"Press ALT-F10 for toolbar. Press ALT-0 for help","rich_text_area":"Rich Text Area","shortcuts_desc":"Accessability Help",toolbar:"Toolbar"});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
tiny_mce/themes/advanced/langs/en_dlg.js CHANGED
@@ -1,51 +1 @@
1
- tinyMCE.addI18n('en.advanced_dlg',{
2
- about_title:"About TinyMCE",
3
- about_general:"About",
4
- about_help:"Help",
5
- about_license:"License",
6
- about_plugins:"Plugins",
7
- about_plugin:"Plugin",
8
- about_author:"Author",
9
- about_version:"Version",
10
- about_loaded:"Loaded plugins",
11
- anchor_title:"Insert/edit anchor",
12
- anchor_name:"Anchor name",
13
- code_title:"HTML Source Editor",
14
- code_wordwrap:"Word wrap",
15
- colorpicker_title:"Select a color",
16
- colorpicker_picker_tab:"Picker",
17
- colorpicker_picker_title:"Color picker",
18
- colorpicker_palette_tab:"Palette",
19
- colorpicker_palette_title:"Palette colors",
20
- colorpicker_named_tab:"Named",
21
- colorpicker_named_title:"Named colors",
22
- colorpicker_color:"Color:",
23
- colorpicker_name:"Name:",
24
- charmap_title:"Select custom character",
25
- image_title:"Insert/edit image",
26
- image_src:"Image URL",
27
- image_alt:"Image description",
28
- image_list:"Image list",
29
- image_border:"Border",
30
- image_dimensions:"Dimensions",
31
- image_vspace:"Vertical space",
32
- image_hspace:"Horizontal space",
33
- image_align:"Alignment",
34
- image_align_baseline:"Baseline",
35
- image_align_top:"Top",
36
- image_align_middle:"Middle",
37
- image_align_bottom:"Bottom",
38
- image_align_texttop:"Text top",
39
- image_align_textbottom:"Text bottom",
40
- image_align_left:"Left",
41
- image_align_right:"Right",
42
- link_title:"Insert/edit link",
43
- link_url:"Link URL",
44
- link_target:"Target",
45
- link_target_same:"Open link in the same window",
46
- link_target_blank:"Open link in a new window",
47
- link_titlefield:"Title",
48
- link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",
49
- link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",
50
- link_list:"Link list"
51
- });
1
+ tinyMCE.addI18n('en.advanced_dlg', {"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character", "charmap_usage":"Use left and right arrows to navigate.","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","":""});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
tiny_mce/themes/advanced/link.htm CHANGED
@@ -18,34 +18,33 @@
18
 
19
  <div class="panel_wrapper">
20
  <div id="general_panel" class="panel current">
21
-
22
- <table border="0" cellpadding="4" cellspacing="0">
23
- <tr>
24
- <td class="nowrap"><label for="href">{#advanced_dlg.link_url}</label></td>
25
- <td><table border="0" cellspacing="0" cellpadding="0">
26
- <tr>
27
- <td><input id="href" name="href" type="text" class="mceFocus" value="" style="width: 200px" onchange="LinkDialog.checkPrefix(this);" /></td>
28
- <td id="hrefbrowsercontainer">&nbsp;</td>
29
- </tr>
30
- </table></td>
31
- </tr>
32
- <tr>
33
- <td><label for="link_list">{#advanced_dlg.link_list}</label></td>
34
- <td><select id="link_list" name="link_list" onchange="document.getElementById('href').value=this.options[this.selectedIndex].value;"></select></td>
35
- </tr>
36
- <tr>
37
- <td><label id="targetlistlabel" for="targetlist">{#advanced_dlg.link_target}</label></td>
38
- <td><select id="target_list" name="target_list"></select></td>
39
- </tr>
40
- <tr>
41
- <td class="nowrap"><label for="linktitle">{#advanced_dlg.link_titlefield}</label></td>
42
- <td><input id="linktitle" name="linktitle" type="text" value="" style="width: 200px" /></td>
43
- </tr>
44
- <tr>
45
- <td><label for="class_list">{#class_name}</label></td>
46
- <td><select id="class_list" name="class_list"></select></td>
47
- </tr>
48
- </table>
49
  </div>
50
  </div>
51
 
18
 
19
  <div class="panel_wrapper">
20
  <div id="general_panel" class="panel current">
21
+ <table border="0" cellpadding="4" cellspacing="0">
22
+ <tr>
23
+ <td class="nowrap"><label for="href">{#advanced_dlg.link_url}</label></td>
24
+ <td><table border="0" cellspacing="0" cellpadding="0">
25
+ <tr>
26
+ <td><input id="href" name="href" type="text" class="mceFocus" value="" style="width: 200px" onchange="LinkDialog.checkPrefix(this);" /></td>
27
+ <td id="hrefbrowsercontainer">&nbsp;</td>
28
+ </tr>
29
+ </table></td>
30
+ </tr>
31
+ <tr>
32
+ <td><label for="link_list">{#advanced_dlg.link_list}</label></td>
33
+ <td><select id="link_list" name="link_list" onchange="document.getElementById('href').value=this.options[this.selectedIndex].value;"></select></td>
34
+ </tr>
35
+ <tr>
36
+ <td><label id="targetlistlabel" for="targetlist">{#advanced_dlg.link_target}</label></td>
37
+ <td><select id="target_list" name="target_list"></select></td>
38
+ </tr>
39
+ <tr>
40
+ <td class="nowrap"><label for="linktitle">{#advanced_dlg.link_titlefield}</label></td>
41
+ <td><input id="linktitle" name="linktitle" type="text" value="" style="width: 200px" /></td>
42
+ </tr>
43
+ <tr>
44
+ <td><label for="class_list">{#class_name}</label></td>
45
+ <td><select id="class_list" name="class_list"></select></td>
46
+ </tr>
47
+ </table>
 
48
  </div>
49
  </div>
50
 
tiny_mce/themes/advanced/shortcuts.htm ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>{#advanced_dlg.accessibility_help}</title>
5
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
+ <script type="text/javascript">tinyMCEPopup.requireLangPack();</script>
7
+ </head>
8
+ <body id="content">
9
+ <h1>{#advanced_dlg.accessibility_usage_title}</h1>
10
+ <h2>Toolbars</h2>
11
+ <p>Press ALT-F10 to move focus to the toolbars. Navigate through the buttons using the arrow keys.
12
+ Press enter to activate a button and return focus to the editor.
13
+ Press escape to return focus to the editor without performing any actions.</p>
14
+
15
+ <h2>Status Bar</h2>
16
+ <p>To access the editor status bar, press ALT-F11. Use the left and right arrow keys to navigate between elements in the path.
17
+ Press enter or space to select an element. Press escape to return focus to the editor without changing the selection.</p>
18
+
19
+ <h2>Context Menu</h2>
20
+ <p>Press shift-F10 to activate the context menu. Use the up and down arrow keys to move between menu items. To open sub-menus press the right arrow key.
21
+ To close submenus press the left arrow key. Press escape to close the context menu.</p>
22
+
23
+ <h1>Keyboard Shortcuts</h1>
24
+ <table>
25
+ <thead>
26
+ <tr>
27
+ <th>Keystroke</th>
28
+ <th>Function</th>
29
+ </tr>
30
+ </thead>
31
+ <tbody>
32
+ <tr>
33
+ <td>Control-B</td><td>Bold</td>
34
+ </tr>
35
+ <tr>
36
+ <td>Control-I</td><td>Italic</td>
37
+ </tr>
38
+ <tr>
39
+ <td>Control-Z</td><td>Undo</td>
40
+ </tr>
41
+ <tr>
42
+ <td>Control-Y</td><td>Redo</td>
43
+ </tr>
44
+ </tbody>
45
+ </table>
46
+ </body>
47
+ </html>
tiny_mce/themes/advanced/skins/default/content.css CHANGED
@@ -1,6 +1,7 @@
1
  body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
2
  body {background:#FFF;}
3
  body.mceForceColors {background:#FFF; color:#000;}
 
4
  h1 {font-size: 2em}
5
  h2 {font-size: 1.5em}
6
  h3 {font-size: 1.17em}
@@ -8,10 +9,11 @@ h4 {font-size: 1em}
8
  h5 {font-size: .83em}
9
  h6 {font-size: .75em}
10
  .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
11
- a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat 0 0;}
 
12
  td.mceSelected, th.mceSelected {background-color:#3399ff !important}
13
  img {border:0;}
14
- table {cursor:default}
15
  table td, table th {cursor:text}
16
  ins {border-bottom:1px solid green; text-decoration: none; color:green}
17
  del {color:red; text-decoration:line-through}
@@ -33,3 +35,16 @@ scrollbar-track-color:#F5F5F5;
33
 
34
  img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}
35
  font[face=mceinline] {font-family:inherit !important}
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
2
  body {background:#FFF;}
3
  body.mceForceColors {background:#FFF; color:#000;}
4
+ body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;}
5
  h1 {font-size: 2em}
6
  h2 {font-size: 1.5em}
7
  h3 {font-size: 1.17em}
9
  h5 {font-size: .83em}
10
  h6 {font-size: .75em}
11
  .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
12
+ a.mceItemAnchor {display:inline-block; -webkit-user-select:all; -webkit-user-modify:read-only; -moz-user-select:all; -moz-user-modify:read-only; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat center center}
13
+ span.mceItemNbsp {background: #DDD}
14
  td.mceSelected, th.mceSelected {background-color:#3399ff !important}
15
  img {border:0;}
16
+ table, img, hr, .mceItemAnchor {cursor:default}
17
  table td, table th {cursor:text}
18
  ins {border-bottom:1px solid green; text-decoration: none; color:green}
19
  del {color:red; text-decoration:line-through}
35
 
36
  img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}
37
  font[face=mceinline] {font-family:inherit !important}
38
+ *[contentEditable]:focus {outline:0}
39
+
40
+ .mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc}
41
+ .mceItemShockWave {background-image:url(../../img/shockwave.gif)}
42
+ .mceItemFlash {background-image:url(../../img/flash.gif)}
43
+ .mceItemQuickTime {background-image:url(../../img/quicktime.gif)}
44
+ .mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)}
45
+ .mceItemRealMedia {background-image:url(../../img/realmedia.gif)}
46
+ .mceItemVideo {background-image:url(../../img/video.gif)}
47
+ .mceItemAudio {background-image:url(../../img/video.gif)}
48
+ .mceItemEmbeddedAudio {background-image:url(../../img/video.gif)}
49
+ .mceItemIframe {background-image:url(../../img/iframe.gif)}
50
+ .mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;}
tiny_mce/themes/advanced/skins/default/img/buttons.png CHANGED
Binary file
tiny_mce/themes/advanced/skins/default/img/items.gif CHANGED
Binary file
tiny_mce/themes/advanced/skins/default/img/tabs.gif CHANGED
Binary file
tiny_mce/themes/advanced/skins/default/ui.css CHANGED
@@ -4,8 +4,8 @@
4
  .defaultSkin table td {vertical-align:middle}
5
 
6
  /* Containers */
7
- .defaultSkin table {direction:ltr; background:#F0F0EE}
8
- .defaultSkin iframe {display:block; background:#FFF}
9
  .defaultSkin .mceToolbar {height:26px}
10
  .defaultSkin .mceLeft {text-align:left}
11
  .defaultSkin .mceRight {text-align:right}
@@ -20,11 +20,11 @@
20
  .defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC}
21
  .defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC}
22
  .defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;}
23
- .defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top}
24
  .defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC}
25
- .defaultSkin .mceStatusbar {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px}
26
  .defaultSkin .mceStatusbar div {float:left; margin:2px}
27
- .defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize}
28
  .defaultSkin .mceStatusbar a:hover {text-decoration:underline}
29
  .defaultSkin table.mceToolbar {margin-left:3px}
30
  .defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px}
@@ -103,11 +103,11 @@
103
  .defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center}
104
  .defaultSkin .mceMenu span.mceMenuLine {display:none}
105
  .defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;}
 
106
 
107
  /* Progress,Resize */
108
  .defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF}
109
  .defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
110
- .defaultSkin .mcePlaceHolder {border:1px dotted gray}
111
 
112
  /* Formats */
113
  .defaultSkin .mce_formatPreview a {font-size:10px}
@@ -211,4 +211,4 @@
211
  .defaultSkin span.mce_ins {background-position:-960px -20px}
212
  .defaultSkin span.mce_pagebreak {background-position:0 -40px}
213
  .defaultSkin span.mce_restoredraft {background-position:-20px -40px}
214
- .defaultSkin .mce_spellchecker span.mceAction {background-position:-540px -20px}
4
  .defaultSkin table td {vertical-align:middle}
5
 
6
  /* Containers */
7
+ .defaultSkin table {direction:ltr;background:transparent}
8
+ .defaultSkin iframe {display:block;}
9
  .defaultSkin .mceToolbar {height:26px}
10
  .defaultSkin .mceLeft {text-align:left}
11
  .defaultSkin .mceRight {text-align:right}
20
  .defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC}
21
  .defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC}
22
  .defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;}
23
+ .defaultSkin td.mceToolbar {background:#F0F0EE; padding-top:1px; vertical-align:top}
24
  .defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC}
25
+ .defaultSkin .mceStatusbar {background:#F0F0EE; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px}
26
  .defaultSkin .mceStatusbar div {float:left; margin:2px}
27
+ .defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}
28
  .defaultSkin .mceStatusbar a:hover {text-decoration:underline}
29
  .defaultSkin table.mceToolbar {margin-left:3px}
30
  .defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px}
103
  .defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center}
104
  .defaultSkin .mceMenu span.mceMenuLine {display:none}
105
  .defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;}
106
+ .defaultSkin .mceMenuItem td, .defaultSkin .mceMenuItem th {line-height: normal}
107
 
108
  /* Progress,Resize */
109
  .defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF}
110
  .defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
 
111
 
112
  /* Formats */
113
  .defaultSkin .mce_formatPreview a {font-size:10px}
211
  .defaultSkin span.mce_ins {background-position:-960px -20px}
212
  .defaultSkin span.mce_pagebreak {background-position:0 -40px}
213
  .defaultSkin span.mce_restoredraft {background-position:-20px -40px}
214
+ .defaultSkin span.mce_spellchecker {background-position:-540px -20px}
tiny_mce/themes/advanced/skins/highcontrast/content.css ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body, td, pre { margin:8px;}
2
+ body.mceForceColors {background:#FFF; color:#000;}
3
+ h1 {font-size: 2em}
4
+ h2 {font-size: 1.5em}
5
+ h3 {font-size: 1.17em}
6
+ h4 {font-size: 1em}
7
+ h5 {font-size: .83em}
8
+ h6 {font-size: .75em}
9
+ .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
10
+ a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;}
11
+ span.mceItemNbsp {background: #DDD}
12
+ td.mceSelected, th.mceSelected {background-color:#3399ff !important}
13
+ img {border:0;}
14
+ table, img, hr, .mceItemAnchor {cursor:default}
15
+ table td, table th {cursor:text}
16
+ ins {border-bottom:1px solid green; text-decoration: none; color:green}
17
+ del {color:red; text-decoration:line-through}
18
+ cite {border-bottom:1px dashed blue}
19
+ acronym {border-bottom:1px dotted #CCC; cursor:help}
20
+ abbr {border-bottom:1px dashed #CCC; cursor:help}
21
+
22
+ img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}
23
+ font[face=mceinline] {font-family:inherit !important}
24
+ *[contentEditable]:focus {outline:0}
tiny_mce/themes/advanced/skins/highcontrast/dialog.css ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Generic */
2
+ body {
3
+ font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;
4
+ background:#F0F0EE;
5
+ color: black;
6
+ padding:0;
7
+ margin:8px 8px 0 8px;
8
+ }
9
+
10
+ html {background:#F0F0EE; color:#000;}
11
+ td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
12
+ textarea {resize:none;outline:none;}
13
+ a:link, a:visited {color:black;background-color:transparent;}
14
+ a:hover {color:#2B6FB6;background-color:transparent;}
15
+ .nowrap {white-space: nowrap}
16
+
17
+ /* Forms */
18
+ fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}
19
+ legend {color:#2B6FB6; font-weight:bold;}
20
+ label.msg {display:none;}
21
+ label.invalid {color:#EE0000; display:inline;background-color:transparent;}
22
+ input.invalid {border:1px solid #EE0000;background-color:transparent;}
23
+ input {background:#FFF; border:1px solid #CCC;color:black;}
24
+ input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
25
+ input, select, textarea {border:1px solid #808080;}
26
+ input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
27
+ input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
28
+ .input_noborder {border:0;}
29
+
30
+ /* Buttons */
31
+ #insert, #cancel, input.button, .updateButton {
32
+ font-weight:bold;
33
+ width:94px; height:23px;
34
+ cursor:pointer;
35
+ padding-bottom:2px;
36
+ float:left;
37
+ }
38
+
39
+ #cancel {float:right}
40
+
41
+ /* Browse */
42
+ a.pickcolor, a.browse {text-decoration:none}
43
+ a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}
44
+ .mceOldBoxModel a.browse span {width:22px; height:20px;}
45
+ a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
46
+ a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
47
+ a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
48
+ a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}
49
+ .mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
50
+ a.pickcolor:hover span {background-color:#B2BBD0;}
51
+ a.pickcolor:hover span.disabled {}
52
+
53
+ /* Charmap */
54
+ table.charmap {border:1px solid #AAA; text-align:center}
55
+ td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}
56
+ #charmap a {display:block; color:#000; text-decoration:none; border:0}
57
+ #charmap a:hover {background:#CCC;color:#2B6FB6}
58
+ #charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}
59
+ #charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}
60
+
61
+ /* Source */
62
+ .wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
63
+ .mceActionPanel {margin-top:5px;}
64
+
65
+ /* Tabs classes */
66
+ .tabs {width:100%; height:18px; line-height:normal;}
67
+ .tabs ul {margin:0; padding:0; list-style:none;}
68
+ .tabs li {float:left; border: 1px solid black; border-bottom:0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block; cursor:pointer;}
69
+ .tabs li.current {font-weight: bold; margin-right:2px;}
70
+ .tabs span {float:left; display:block; padding:0px 10px 0 0;}
71
+ .tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
72
+ .tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}
73
+
74
+ /* Panels */
75
+ .panel_wrapper div.panel {display:none;}
76
+ .panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
77
+ .panel_wrapper {border:1px solid #919B9C; padding:10px; padding-top:5px; clear:both; background:white;}
78
+
79
+ /* Columns */
80
+ .column {float:left;}
81
+ .properties {width:100%;}
82
+ .properties .column1 {}
83
+ .properties .column2 {text-align:left;}
84
+
85
+ /* Titles */
86
+ h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
87
+ h3 {font-size:14px;}
88
+ .title {font-size:12px; font-weight:bold; color:#2B6FB6;}
89
+
90
+ /* Dialog specific */
91
+ #link .panel_wrapper, #link div.current {height:125px;}
92
+ #image .panel_wrapper, #image div.current {height:200px;}
93
+ #plugintable thead {font-weight:bold; background:#DDD;}
94
+ #plugintable, #about #plugintable td {border:1px solid #919B9C;}
95
+ #plugintable {width:96%; margin-top:10px;}
96
+ #pluginscontainer {height:290px; overflow:auto;}
97
+ #colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}
98
+ #colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
99
+ #colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
100
+ #colorpicker #light div {overflow:hidden;}
101
+ #colorpicker #previewblock {float:right; padding-left:10px; height:20px;}
102
+ #colorpicker .panel_wrapper div.current {height:175px;}
103
+ #colorpicker #namedcolors {width:150px;}
104
+ #colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
105
+ #colorpicker #colornamecontainer {margin-top:5px;}
tiny_mce/themes/advanced/skins/highcontrast/ui.css ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Reset */
2
+ .highcontrastSkin table, .highcontrastSkin tbody, .highcontrastSkin a, .highcontrastSkin img, .highcontrastSkin tr, .highcontrastSkin div, .highcontrastSkin td, .highcontrastSkin iframe, .highcontrastSkin span, .highcontrastSkin *, .highcontrastSkin .mceText {border:0; margin:0; padding:0; vertical-align:baseline; border-collapse:separate;}
3
+ .highcontrastSkin a:hover, .highcontrastSkin a:link, .highcontrastSkin a:visited, .highcontrastSkin a:active {text-decoration:none; font-weight:normal; cursor:default;}
4
+ .highcontrastSkin table td {vertical-align:middle}
5
+
6
+ .highcontrastSkin .mceIconOnly {display: block !important;}
7
+
8
+ /* External */
9
+ .highcontrastSkin .mceExternalToolbar {position:absolute; border:1px solid; border-bottom:0; display:none; background-color: white;}
10
+ .highcontrastSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;}
11
+ .highcontrastSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px;}
12
+
13
+ /* Layout */
14
+ .highcontrastSkin table.mceLayout {border: 1px solid;}
15
+ .highcontrastSkin .mceIframeContainer {border-top:1px solid; border-bottom:1px solid}
16
+ .highcontrastSkin .mceStatusbar a:hover {text-decoration:underline}
17
+ .highcontrastSkin .mceStatusbar {display:block; line-height:1.5em; overflow:visible;}
18
+ .highcontrastSkin .mceStatusbar div {float:left}
19
+ .highcontrastSkin .mceStatusbar a.mceResize {display:block; float:right; width:20px; height:20px; cursor:se-resize; outline:0}
20
+
21
+ .highcontrastSkin .mceToolbar td { display: inline-block; float: left;}
22
+ .highcontrastSkin .mceToolbar tr { display: block;}
23
+ .highcontrastSkin .mceToolbar table { display: block; }
24
+
25
+ /* Button */
26
+
27
+ .highcontrastSkin .mceButton { display:block; margin: 2px; padding: 5px 10px;border: 1px solid; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -ms-border-radius: 3px; height: 2em;}
28
+ .highcontrastSkin .mceButton .mceVoiceLabel { height: 100%; vertical-align: center; line-height: 2em}
29
+ .highcontrastSkin .mceButtonDisabled .mceVoiceLabel { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);}
30
+ .highcontrastSkin .mceButtonActive, .highcontrastSkin .mceButton:focus, .highcontrastSkin .mceButton:active { border: 5px solid; padding: 1px 6px;-webkit-focus-ring-color:none;outline:none;}
31
+
32
+ /* Separator */
33
+ .highcontrastSkin .mceSeparator {display:block; width:16px; height:26px;}
34
+
35
+ /* ListBox */
36
+ .highcontrastSkin .mceListBox { display: block; margin:2px;-webkit-focus-ring-color:none;outline:none;}
37
+ .highcontrastSkin .mceListBox .mceText {padding: 5px 6px; line-height: 2em; width: 15ex; overflow: hidden;}
38
+ .highcontrastSkin .mceListBoxDisabled .mceText { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);}
39
+ .highcontrastSkin .mceListBox a.mceText { padding: 5px 10px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;}
40
+ .highcontrastSkin .mceListBox a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-left: 0; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;}
41
+ .highcontrastSkin .mceListBox:focus a.mceText, .highcontrastSkin .mceListBox:active a.mceText { border-width: 5px; padding: 1px 10px 1px 6px;}
42
+ .highcontrastSkin .mceListBox:focus a.mceOpen, .highcontrastSkin .mceListBox:active a.mceOpen { border-width: 5px; padding: 1px 0px 1px 4px;}
43
+
44
+ .highcontrastSkin .mceListBoxMenu {overflow-y:auto}
45
+
46
+ /* SplitButton */
47
+ .highcontrastSkin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
48
+
49
+ .highcontrastSkin .mceSplitButton { border-collapse: collapse; margin: 2px; height: 2em; line-height: 2em;-webkit-focus-ring-color:none;outline:none;}
50
+ .highcontrastSkin .mceSplitButton td { display: table-cell; float: none; margin: 0; padding: 0; height: 2em;}
51
+ .highcontrastSkin .mceSplitButton tr { display: table-row; }
52
+ .highcontrastSkin table.mceSplitButton { display: table; }
53
+ .highcontrastSkin .mceSplitButton a.mceAction { padding: 5px 10px; display: block; height: 2em; line-height: 2em; overflow: hidden; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;}
54
+ .highcontrastSkin .mceSplitButton a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;}
55
+ .highcontrastSkin .mceSplitButton .mceVoiceLabel { height: 2em; vertical-align: center; line-height: 2em; }
56
+ .highcontrastSkin .mceSplitButton:focus a.mceAction, .highcontrastSkin .mceSplitButton:active a.mceAction { border-width: 5px; border-right-width: 1px; padding: 1px 10px 1px 6px;-webkit-focus-ring-color:none;outline:none;}
57
+ .highcontrastSkin .mceSplitButton:focus a.mceOpen, .highcontrastSkin .mceSplitButton:active a.mceOpen { border-width: 5px; border-left-width: 1px; padding: 1px 0px 1px 4px;-webkit-focus-ring-color:none;outline:none;}
58
+
59
+ /* Menu */
60
+ .highcontrastSkin .mceNoIcons span.mceIcon {width:0;}
61
+ .highcontrastSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid; }
62
+ .highcontrastSkin .mceMenu table {background:white; color: black}
63
+ .highcontrastSkin .mceNoIcons a .mceText {padding-left:10px}
64
+ .highcontrastSkin .mceMenu a, .highcontrastSkin .mceMenu span, .highcontrastSkin .mceMenu {display:block;background:white; color: black}
65
+ .highcontrastSkin .mceMenu td {height:2em}
66
+ .highcontrastSkin .mceMenu a {position:relative;padding:3px 0 4px 0; display: block;}
67
+ .highcontrastSkin .mceMenu .mceText {position:relative; display:block; cursor:default; margin:0; padding:0 25px 0 25px;}
68
+ .highcontrastSkin .mceMenu pre.mceText {font-family:Monospace}
69
+ .highcontrastSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:26px;}
70
+ .highcontrastSkin td.mceMenuItemSeparator {border-top:1px solid; height:1px}
71
+ .highcontrastSkin .mceMenuItemTitle a {border:0; border-bottom:1px solid}
72
+ .highcontrastSkin .mceMenuItemTitle span.mceText {font-weight:bold; padding-left:4px}
73
+ .highcontrastSkin .mceNoIcons .mceMenuItemSelected span.mceText:before {content: "\2713\A0";}
74
+ .highcontrastSkin .mceMenu span.mceMenuLine {display:none}
75
+ .highcontrastSkin .mceMenuItemSub a .mceText:after {content: "\A0\25B8"}
76
+ .highcontrastSkin .mceMenuItem td, .highcontrastSkin .mceMenuItem th {line-height: normal}
77
+
78
+ /* ColorSplitButton */
79
+ .highcontrastSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid; color: #000}
80
+ .highcontrastSkin .mceColorSplitMenu td {padding:2px}
81
+ .highcontrastSkin .mceColorSplitMenu a {display:block; width:16px; height:16px; overflow:hidden; color:#000; margin: 0; padding: 0;}
82
+ .highcontrastSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px}
83
+ .highcontrastSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF}
84
+ .highcontrastSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid; background-color:#B6BDD2}
85
+ .highcontrastSkin a.mceMoreColors:hover {border:1px solid #0A246A; color: #000;}
86
+ .highcontrastSkin .mceColorPreview {display:none;}
87
+ .highcontrastSkin .mce_forecolor span.mceAction, .highcontrastSkin .mce_backcolor span.mceAction {height:17px;overflow:hidden}
88
+
89
+ /* Progress,Resize */
90
+ .highcontrastSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF}
91
+ .highcontrastSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
92
+
93
+ /* Formats */
94
+ .highcontrastSkin .mce_p span.mceText {}
95
+ .highcontrastSkin .mce_address span.mceText {font-style:italic}
96
+ .highcontrastSkin .mce_pre span.mceText {font-family:monospace}
97
+ .highcontrastSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em}
98
+ .highcontrastSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em}
99
+ .highcontrastSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em}
100
+ .highcontrastSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em}
101
+ .highcontrastSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em}
102
+ .highcontrastSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em}
tiny_mce/themes/advanced/skins/o2k7/content.css CHANGED
@@ -9,9 +9,10 @@ h5 {font-size: .83em}
9
  h6 {font-size: .75em}
10
  .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
11
  a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;}
 
12
  td.mceSelected, th.mceSelected {background-color:#3399ff !important}
13
  img {border:0;}
14
- table {cursor:default}
15
  table td, table th {cursor:text}
16
  ins {border-bottom:1px solid green; text-decoration: none; color:green}
17
  del {color:red; text-decoration:line-through}
@@ -33,3 +34,15 @@ scrollbar-track-color:#F5F5F5;
33
 
34
  img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}
35
  font[face=mceinline] {font-family:inherit !important}
 
 
 
 
 
 
 
 
 
 
 
 
9
  h6 {font-size: .75em}
10
  .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
11
  a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;}
12
+ span.mceItemNbsp {background: #DDD}
13
  td.mceSelected, th.mceSelected {background-color:#3399ff !important}
14
  img {border:0;}
15
+ table, img, hr, .mceItemAnchor {cursor:default}
16
  table td, table th {cursor:text}
17
  ins {border-bottom:1px solid green; text-decoration: none; color:green}
18
  del {color:red; text-decoration:line-through}
34
 
35
  img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}
36
  font[face=mceinline] {font-family:inherit !important}
37
+ *[contentEditable]:focus {outline:0}
38
+
39
+ .mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc}
40
+ .mceItemShockWave {background-image:url(../../img/shockwave.gif)}
41
+ .mceItemFlash {background-image:url(../../img/flash.gif)}
42
+ .mceItemQuickTime {background-image:url(../../img/quicktime.gif)}
43
+ .mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)}
44
+ .mceItemRealMedia {background-image:url(../../img/realmedia.gif)}
45
+ .mceItemVideo {background-image:url(../../img/video.gif)}
46
+ .mceItemAudio {background-image:url(../../img/video.gif)}
47
+ .mceItemIframe {background-image:url(../../img/iframe.gif)}
48
+ .mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;}
tiny_mce/themes/advanced/skins/o2k7/dialog.css CHANGED
@@ -114,3 +114,4 @@ h3 {font-size:14px;}
114
  #colorpicker #namedcolors {width:150px;}
115
  #colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
116
  #colorpicker #colornamecontainer {margin-top:5px;}
 
114
  #colorpicker #namedcolors {width:150px;}
115
  #colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
116
  #colorpicker #colornamecontainer {margin-top:5px;}
117
+ #colorpicker #picker_panel fieldset {margin:auto;width:325px;}
tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png CHANGED
Binary file
tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png CHANGED
Binary file
tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png CHANGED
Binary file
tiny_mce/themes/advanced/skins/o2k7/ui.css CHANGED
@@ -4,8 +4,8 @@
4
  .o2k7Skin table td {vertical-align:middle}
5
 
6
  /* Containers */
7
- .o2k7Skin table {background:#E5EFFD}
8
- .o2k7Skin iframe {display:block; background:#FFF}
9
  .o2k7Skin .mceToolbar {height:26px}
10
 
11
  /* External */
@@ -19,9 +19,10 @@
19
  .o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD}
20
  .o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0}
21
  .o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD}
22
- .o2k7Skin .mceStatusbar {display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px}
 
23
  .o2k7Skin .mceStatusbar div {float:left; padding:2px}
24
- .o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize}
25
  .o2k7Skin .mceStatusbar a:hover {text-decoration:underline}
26
  .o2k7Skin table.mceToolbar {margin-left:3px}
27
  .o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;}
@@ -50,19 +51,19 @@
50
  .o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px}
51
 
52
  /* ListBox */
53
- .o2k7Skin .mceListBox {margin-left:3px}
54
  .o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block}
55
  .o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}
56
  .o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0}
57
  .o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF}
58
  .o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px}
59
  .o2k7Skin .mceListBoxDisabled .mceText {color:gray}
60
- .o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden}
61
  .o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px}
62
  .o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;}
63
 
64
  /* SplitButton */
65
- .o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px}
66
  .o2k7Skin .mceSplitButton {background:url(img/button_bg.png)}
67
  .o2k7Skin .mceSplitButton a.mceAction {width:22px}
68
  .o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)}
@@ -105,11 +106,11 @@
105
  .o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center}
106
  .o2k7Skin .mceMenu span.mceMenuLine {display:none}
107
  .o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;}
 
108
 
109
  /* Progress,Resize */
110
  .o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF}
111
  .o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
112
- .o2k7Skin .mcePlaceHolder {border:1px dotted gray}
113
 
114
  /* Formats */
115
  .o2k7Skin .mce_formatPreview a {font-size:10px}
@@ -213,4 +214,4 @@
213
  .o2k7Skin span.mce_ins {background-position:-960px -20px}
214
  .o2k7Skin span.mce_pagebreak {background-position:0 -40px}
215
  .o2k7Skin span.mce_restoredraft {background-position:-20px -40px}
216
- .o2k7Skin .mce_spellchecker span.mceAction {background-position:-540px -20px}
4
  .o2k7Skin table td {vertical-align:middle}
5
 
6
  /* Containers */
7
+ .o2k7Skin table {background:transparent}
8
+ .o2k7Skin iframe {display:block;}
9
  .o2k7Skin .mceToolbar {height:26px}
10
 
11
  /* External */
19
  .o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD}
20
  .o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0}
21
  .o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD}
22
+ .o2k7Skin td.mceToolbar{background:#E5EFFD}
23
+ .o2k7Skin .mceStatusbar {background:#E5EFFD; display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px}
24
  .o2k7Skin .mceStatusbar div {float:left; padding:2px}
25
+ .o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}
26
  .o2k7Skin .mceStatusbar a:hover {text-decoration:underline}
27
  .o2k7Skin table.mceToolbar {margin-left:3px}
28
  .o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;}
51
  .o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px}
52
 
53
  /* ListBox */
54
+ .o2k7Skin .mceListBox {padding-left: 3px}
55
  .o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block}
56
  .o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}
57
  .o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0}
58
  .o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF}
59
  .o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px}
60
  .o2k7Skin .mceListBoxDisabled .mceText {color:gray}
61
+ .o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden; margin-left:3px}
62
  .o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px}
63
  .o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;}
64
 
65
  /* SplitButton */
66
+ .o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px; direction:ltr}
67
  .o2k7Skin .mceSplitButton {background:url(img/button_bg.png)}
68
  .o2k7Skin .mceSplitButton a.mceAction {width:22px}
69
  .o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)}
106
  .o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center}
107
  .o2k7Skin .mceMenu span.mceMenuLine {display:none}
108
  .o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;}
109
+ .o2k7Skin .mceMenuItem td, .o2k7Skin .mceMenuItem th {line-height: normal}
110
 
111
  /* Progress,Resize */
112
  .o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF}
113
  .o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
 
114
 
115
  /* Formats */
116
  .o2k7Skin .mce_formatPreview a {font-size:10px}
214
  .o2k7Skin span.mce_ins {background-position:-960px -20px}
215
  .o2k7Skin span.mce_pagebreak {background-position:0 -40px}
216
  .o2k7Skin span.mce_restoredraft {background-position:-20px -40px}
217
+ .o2k7Skin span.mce_spellchecker {background-position:-540px -20px}
tiny_mce/themes/advanced/skins/o2k7/ui_black.css CHANGED
@@ -1,6 +1,6 @@
1
  /* Black */
2
  .o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)}
3
- .o2k7SkinBlack table, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF}
4
  .o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0}
5
  .o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0}
6
  .o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;}
1
  /* Black */
2
  .o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)}
3
+ .o2k7SkinBlack td.mceToolbar, .o2k7SkinBlack td.mceStatusbar, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF}
4
  .o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0}
5
  .o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0}
6
  .o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;}
tiny_mce/themes/advanced/skins/o2k7/ui_silver.css CHANGED
@@ -1,5 +1,5 @@
1
  /* Silver */
2
  .o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)}
3
- .o2k7SkinSilver table, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee}
4
  .o2k7SkinSilver .mceListBox .mceText {background:#FFF}
5
  .o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb}
1
  /* Silver */
2
  .o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)}
3
+ .o2k7SkinSilver td.mceToolbar, .o2k7SkinSilver td.mceStatusbar, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee}
4
  .o2k7SkinSilver .mceListBox .mceText {background:#FFF}
5
  .o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb}
tiny_mce/themes/advanced/source_editor.htm CHANGED
@@ -1,13 +1,12 @@
1
  <html xmlns="http://www.w3.org/1999/xhtml">
2
  <head>
3
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
4
  <title>{#advanced_dlg.code_title}</title>
5
  <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6
  <script type="text/javascript" src="js/source_editor.js"></script>
7
  </head>
8
  <body onresize="resizeInputs();" style="display:none; overflow:hidden;">
9
  <form name="source" onsubmit="saveContent();return false;" action="#">
10
- <div style="float: left" class="title">{#advanced_dlg.code_title}</div>
11
 
12
  <div id="wrapline" style="float: right">
13
  <input type="checkbox" name="wraped" id="wraped" onclick="toggleWordWrap(this);" class="wordWrapCode" /><label for="wraped">{#advanced_dlg.code_wordwrap}</label>
@@ -18,8 +17,8 @@
18
  <textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,monospace; font-size: 12px;" dir="ltr" wrap="off" class="mceFocus"></textarea>
19
 
20
  <div class="mceActionPanel">
21
- <input type="submit" name="insert" value="{#update}" id="insert" />
22
- <input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
23
  </div>
24
  </form>
25
  </body>
1
  <html xmlns="http://www.w3.org/1999/xhtml">
2
  <head>
 
3
  <title>{#advanced_dlg.code_title}</title>
4
  <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
5
  <script type="text/javascript" src="js/source_editor.js"></script>
6
  </head>
7
  <body onresize="resizeInputs();" style="display:none; overflow:hidden;">
8
  <form name="source" onsubmit="saveContent();return false;" action="#">
9
+ <div style="float: left" class="title"><label for="htmlSource">{#advanced_dlg.code_title}</label></div>
10
 
11
  <div id="wrapline" style="float: right">
12
  <input type="checkbox" name="wraped" id="wraped" onclick="toggleWordWrap(this);" class="wordWrapCode" /><label for="wraped">{#advanced_dlg.code_wordwrap}</label>
17
  <textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,monospace; font-size: 12px;" dir="ltr" wrap="off" class="mceFocus"></textarea>
18
 
19
  <div class="mceActionPanel">
20
+ <input type="submit" role="button" name="insert" value="{#update}" id="insert" />
21
+ <input type="button" role="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
22
  </div>
23
  </form>
24
  </body>
tiny_mce/themes/simple/editor_template.js CHANGED
@@ -1 +1 @@
1
- (function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack("simple");tinymce.create("tinymce.themes.SimpleTheme",{init:function(c,d){var e=this,b=["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList"],f=c.settings;e.editor=c;c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})});c.dom.loadCSS(d+"/skins/"+f.skin+"/content.css")});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):"")||d+"/skins/"+f.skin+"/ui.css")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create("span",{id:d.id+"_container","class":"mceEditor "+d.settings.skin+"SimpleSkin"}),i);i=g=a.add(i,"table",{cellPadding:0,cellSpacing:0,"class":"mceLayout"});i=c=a.add(i,"tbody");i=a.add(c,"tr");i=b=a.add(a.add(i,"td"),"div",{"class":"mceIframeContainer"});i=a.add(a.add(c,"tr",{"class":"last"}),"td",{"class":"mceToolbar mceLast",align:"center"});c=e.toolbar=f.createToolbar("tools1");c.add(f.createButton("bold",{title:"simple.bold_desc",cmd:"Bold"}));c.add(f.createButton("italic",{title:"simple.italic_desc",cmd:"Italic"}));c.add(f.createButton("underline",{title:"simple.underline_desc",cmd:"Underline"}));c.add(f.createButton("strikethrough",{title:"simple.striketrough_desc",cmd:"Strikethrough"}));c.add(f.createSeparator());c.add(f.createButton("undo",{title:"simple.undo_desc",cmd:"Undo"}));c.add(f.createButton("redo",{title:"simple.redo_desc",cmd:"Redo"}));c.add(f.createSeparator());c.add(f.createButton("cleanup",{title:"simple.cleanup_desc",cmd:"mceCleanup"}));c.add(f.createSeparator());c.add(f.createButton("insertunorderedlist",{title:"simple.bullist_desc",cmd:"InsertUnorderedList"}));c.add(f.createButton("insertorderedlist",{title:"simple.numlist_desc",cmd:"InsertOrderedList"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+"_container",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:"Simple theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add("simple",tinymce.themes.SimpleTheme)})();
1
+ (function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack("simple");tinymce.create("tinymce.themes.SimpleTheme",{init:function(c,d){var e=this,b=["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList"],f=c.settings;e.editor=c;c.contentCSS.push(d+"/skins/"+f.skin+"/content.css");c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})})});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):"")||d+"/skins/"+f.skin+"/ui.css")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create("span",{id:d.id+"_container","class":"mceEditor "+d.settings.skin+"SimpleSkin"}),i);i=g=a.add(i,"table",{cellPadding:0,cellSpacing:0,"class":"mceLayout"});i=c=a.add(i,"tbody");i=a.add(c,"tr");i=b=a.add(a.add(i,"td"),"div",{"class":"mceIframeContainer"});i=a.add(a.add(c,"tr",{"class":"last"}),"td",{"class":"mceToolbar mceLast",align:"center"});c=e.toolbar=f.createToolbar("tools1");c.add(f.createButton("bold",{title:"simple.bold_desc",cmd:"Bold"}));c.add(f.createButton("italic",{title:"simple.italic_desc",cmd:"Italic"}));c.add(f.createButton("underline",{title:"simple.underline_desc",cmd:"Underline"}));c.add(f.createButton("strikethrough",{title:"simple.striketrough_desc",cmd:"Strikethrough"}));c.add(f.createSeparator());c.add(f.createButton("undo",{title:"simple.undo_desc",cmd:"Undo"}));c.add(f.createButton("redo",{title:"simple.redo_desc",cmd:"Redo"}));c.add(f.createSeparator());c.add(f.createButton("cleanup",{title:"simple.cleanup_desc",cmd:"mceCleanup"}));c.add(f.createSeparator());c.add(f.createButton("insertunorderedlist",{title:"simple.bullist_desc",cmd:"InsertUnorderedList"}));c.add(f.createButton("insertorderedlist",{title:"simple.numlist_desc",cmd:"InsertOrderedList"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+"_container",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:"Simple theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add("simple",tinymce.themes.SimpleTheme)})();
tiny_mce/themes/simple/editor_template_src.js CHANGED
@@ -19,6 +19,7 @@
19
  var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings;
20
 
21
  t.editor = ed;
 
22
 
23
  ed.onInit.add(function() {
24
  ed.onNodeChange.add(function(ed, cm) {
@@ -26,8 +27,6 @@
26
  cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c));
27
  });
28
  });
29
-
30
- ed.dom.loadCSS(url + "/skins/" + s.skin + "/content.css");
31
  });
32
 
33
  DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css");
19
  var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings;
20
 
21
  t.editor = ed;
22
+ ed.contentCSS.push(url + "/skins/" + s.skin + "/content.css");
23
 
24
  ed.onInit.add(function() {
25
  ed.onNodeChange.add(function(ed, cm) {
27
  cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c));
28
  });
29
  });
 
 
30
  });
31
 
32
  DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css");
tiny_mce/themes/simple/img/icons.gif CHANGED
Binary file
tiny_mce/themes/simple/langs/en.js CHANGED
@@ -1,11 +1 @@
1
- tinyMCE.addI18n('en.simple',{
2
- bold_desc:"Bold (Ctrl+B)",
3
- italic_desc:"Italic (Ctrl+I)",
4
- underline_desc:"Underline (Ctrl+U)",
5
- striketrough_desc:"Strikethrough",
6
- bullist_desc:"Unordered list",
7
- numlist_desc:"Ordered list",
8
- undo_desc:"Undo (Ctrl+Z)",
9
- redo_desc:"Redo (Ctrl+Y)",
10
- cleanup_desc:"Cleanup messy code"
11
- });
1
+ tinyMCE.addI18n('en.simple',{"cleanup_desc":"Cleanup Messy Code","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","striketrough_desc":"Strikethrough","underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)"});
 
 
 
 
 
 
 
 
 
 
tiny_mce/tiny_mce.js CHANGED
@@ -1 +1 @@
1
- (function(c){var a=/^\s*|\s*$/g,d;var b={majorVersion:"3",minorVersion:"3",releaseDate:"2010-03-10",_init:function(){var r=this,o=document,m=navigator,f=m.userAgent,l,e,k,j,h,q;r.isOpera=c.opera&&opera.buildNumber;r.isWebKit=/WebKit/.test(f);r.isIE=!r.isWebKit&&!r.isOpera&&(/MSIE/gi).test(f)&&(/Explorer/gi).test(m.appName);r.isIE6=r.isIE&&/MSIE [56]/.test(f);r.isGecko=!r.isWebKit&&/Gecko/.test(f);r.isMac=f.indexOf("Mac")!=-1;r.isAir=/adobeair/i.test(f);if(c.tinyMCEPreInit){r.suffix=tinyMCEPreInit.suffix;r.baseURL=tinyMCEPreInit.base;r.query=tinyMCEPreInit.query;return}r.suffix="";e=o.getElementsByTagName("base");for(l=0;l<e.length;l++){if(q=e[l].href){if(/^https?:\/\/[^\/]+$/.test(q)){q+="/"}j=q?q.match(/.*\//)[0]:""}}function g(i){if(i.src&&/tiny_mce(|_gzip|_jquery|_prototype)(_dev|_src)?.js/.test(i.src)){if(/_(src|dev)\.js/g.test(i.src)){r.suffix="_src"}if((h=i.src.indexOf("?"))!=-1){r.query=i.src.substring(h+1)}r.baseURL=i.src.substring(0,i.src.lastIndexOf("/"));if(j&&r.baseURL.indexOf("://")==-1&&r.baseURL.indexOf("/")!==0){r.baseURL=j+r.baseURL}return r.baseURL}return null}e=o.getElementsByTagName("script");for(l=0;l<e.length;l++){if(g(e[l])){return}}k=o.getElementsByTagName("head")[0];if(k){e=k.getElementsByTagName("script");for(l=0;l<e.length;l++){if(g(e[l])){return}}}return},is:function(f,e){if(!e){return f!==d}if(e=="array"&&(f.hasOwnProperty&&f instanceof Array)){return true}return typeof(f)==e},each:function(h,e,g){var i,f;if(!h){return 0}g=g||h;if(h.length!==d){for(i=0,f=h.length;i<f;i++){if(e.call(g,h[i],i,h)===false){return 0}}}else{for(i in h){if(h.hasOwnProperty(i)){if(e.call(g,h[i],i,h)===false){return 0}}}}return 1},map:function(e,g){var h=[];b.each(e,function(f){h.push(g(f))});return h},grep:function(e,g){var h=[];b.each(e,function(f){if(!g||g(f)){h.push(f)}});return h},inArray:function(f,g){var h,e;if(f){for(h=0,e=f.length;h<e;h++){if(f[h]===g){return h}}}return -1},extend:function(k,j){var h,g,f=arguments;for(h=1,g=f.length;h<g;h++){j=f[h];b.each(j,function(e,i){if(e!==d){k[i]=e}})}return k},trim:function(e){return(e?""+e:"").replace(a,"")},create:function(m,e){var l=this,f,h,i,j,g,k=0;m=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(m);i=m[3].match(/(^|\.)(\w+)$/i)[2];h=l.createNS(m[3].replace(/\.\w+$/,""));if(h[i]){return}if(m[2]=="static"){h[i]=e;if(this.onCreate){this.onCreate(m[2],m[3],h[i])}return}if(!e[i]){e[i]=function(){};k=1}h[i]=e[i];l.extend(h[i].prototype,e);if(m[5]){f=l.resolve(m[5]).prototype;j=m[5].match(/\.(\w+)$/i)[1];g=h[i];if(k){h[i]=function(){return f[j].apply(this,arguments)}}else{h[i]=function(){this.parent=f[j];return g.apply(this,arguments)}}h[i].prototype[i]=h[i];l.each(f,function(o,p){h[i].prototype[p]=f[p]});l.each(e,function(o,p){if(f[p]){h[i].prototype[p]=function(){this.parent=f[p];return o.apply(this,arguments)}}else{if(p!=i){h[i].prototype[p]=o}}})}l.each(e["static"],function(o,p){h[i][p]=o});if(this.onCreate){this.onCreate(m[2],m[3],h[i].prototype)}},walk:function(h,g,i,e){e=e||this;if(h){if(i){h=h[i]}b.each(h,function(j,f){if(g.call(e,j,f,i)===false){return false}b.walk(j,g,i,e)})}},createNS:function(h,g){var f,e;g=g||c;h=h.split(".");for(f=0;f<h.length;f++){e=h[f];if(!g[e]){g[e]={}}g=g[e]}return g},resolve:function(h,g){var f,e;g=g||c;h=h.split(".");for(f=0,e=h.length;f<e;f++){g=g[h[f]];if(!g){break}}return g},addUnload:function(i,h){var g=this;i={func:i,scope:h||this};if(!g.unloads){function e(){var f=g.unloads,k,l;if(f){for(l in f){k=f[l];if(k&&k.func){k.func.call(k.scope,1)}}if(c.detachEvent){c.detachEvent("onbeforeunload",j);c.detachEvent("onunload",e)}else{if(c.removeEventListener){c.removeEventListener("unload",e,false)}}g.unloads=k=f=w=e=0;if(c.CollectGarbage){CollectGarbage()}}}function j(){var k=document;if(k.readyState=="interactive"){function f(){k.detachEvent("onstop",f);if(e){e()}k=0}if(k){k.attachEvent("onstop",f)}c.setTimeout(function(){if(k){k.detachEvent("onstop",f)}},0)}}if(c.attachEvent){c.attachEvent("onunload",e);c.attachEvent("onbeforeunload",j)}else{if(c.addEventListener){c.addEventListener("unload",e,false)}}g.unloads=[i]}else{g.unloads.push(i)}return i},removeUnload:function(h){var e=this.unloads,g=null;b.each(e,function(j,f){if(j&&j.func==h){e.splice(f,1);g=h;return false}});return g},explode:function(e,f){return e?b.map(e.split(f||","),b.trim):e},_addVer:function(f){var e;if(!this.query){return f}e=(f.indexOf("?")==-1?"?":"&")+this.query;if(f.indexOf("#")==-1){return f+e}return f.replace("#",e+"#")}};b._init();c.tinymce=c.tinyMCE=b})(window);tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(a,b){this.listeners.push({cb:a,scope:b||this.scope});return a},addToTop:function(a,b){this.listeners.unshift({cb:a,scope:b||this.scope});return a},remove:function(a){var b=this.listeners,c=null;tinymce.each(b,function(e,d){if(a==e.cb){c=a;b.splice(d,1);return false}});return c},dispatch:function(){var f,d=arguments,e,b=this.listeners,g;for(e=0;e<b.length;e++){g=b[e];f=g.cb.apply(g.scope,d);if(f===false){break}}return f}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,h,d,c;e=tinymce.trim(e);g=f.settings=g||{};if(/^(mailto|tel|news|javascript|about|data):/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^\w*:?\/\//.test(e)){e=(g.base_uri.protocol||"http")+"://mce_host"+f.toAbsPath(g.base_uri.path,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(i){if(i){h.push(i)}});e=h;for(c=f.length-1,h=[];c>=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(e){var c,a,d=tinymce.util.JSON.serialize,b;if(e==null){return"null"}b=typeof e;if(b=="string"){a="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+e.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(g,f){c=a.indexOf(f);if(c+1){return"\\"+a.charAt(c+1)}g=f.charCodeAt().toString(16);return"\\u"+"0000".substring(g.length)+g})+'"'}if(b=="object"){if(e.hasOwnProperty&&e instanceof Array){for(c=0,a="[";c<e.length;c++){a+=(c>0?",":"")+d(e[c])}return a+"]"}a="{";for(c in e){a+=typeof e[c]!="function"?(a.length>1?',"':'"')+c+'":'+d(e[c]):""}return a+"}"}return""+e},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){e.call(f.error_scope||f.scope,h,g)};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(m){var k=m.each,j=m.is,i=m.isWebKit,d=m.isIE,a=/^(H[1-6R]|P|DIV|ADDRESS|PRE|FORM|T(ABLE|BODY|HEAD|FOOT|H|R|D)|LI|OL|UL|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|MENU|ISINDEX|SAMP)$/,e=g("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),f=g("src,href,style,coords,shape"),c={"&":"&amp;",'"':"&quot;","<":"&lt;",">":"&gt;"},n=/[<>&\"]/g,b=/^([a-z0-9],?)+$/i,h=/<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)(\s*\/?)>/g,l=/(\w+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;function g(q){var p={},o;q=q.split(",");for(o=q.length;o>=0;o--){p[q[o]]=1}return p}m.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(u,q){var p=this,o;p.doc=u;p.win=window;p.files={};p.cssFlicker=false;p.counter=0;p.boxModel=!m.isIE||u.compatMode=="CSS1Compat";p.stdMode=u.documentMode===8;p.settings=q=m.extend({keep_values:false,hex_colors:1,process_html:1},q);if(m.isIE6){try{u.execCommand("BackgroundImageCache",false,true)}catch(r){p.cssFlicker=true}}if(q.valid_styles){p._styles={};k(q.valid_styles,function(t,s){p._styles[s]=m.explode(t)})}m.addUnload(p.destroy,p)},getRoot:function(){var o=this,p=o.settings;return(p&&o.get(p.root_element))||o.doc.body},getViewPort:function(p){var q,o;p=!p?this.win:p;q=p.document;o=this.boxModel?q.documentElement:q.body;return{x:p.pageXOffset||o.scrollLeft,y:p.pageYOffset||o.scrollTop,w:p.innerWidth||o.clientWidth,h:p.innerHeight||o.clientHeight}},getRect:function(s){var r,o=this,q;s=o.get(s);r=o.getPos(s);q=o.getSize(s);return{x:r.x,y:r.y,w:q.w,h:q.h}},getSize:function(r){var p=this,o,q;r=p.get(r);o=p.getStyle(r,"width");q=p.getStyle(r,"height");if(o.indexOf("px")===-1){o=0}if(q.indexOf("px")===-1){q=0}return{w:parseInt(o)||r.offsetWidth||r.clientWidth,h:parseInt(q)||r.offsetHeight||r.clientHeight}},getParent:function(q,p,o){return this.getParents(q,p,o,false)},getParents:function(z,v,s,y){var q=this,p,u=q.settings,x=[];z=q.get(z);y=y===undefined;if(u.strict_root){s=s||q.getRoot()}if(j(v,"string")){p=v;if(v==="*"){v=function(o){return o.nodeType==1}}else{v=function(o){return q.is(o,p)}}}while(z){if(z==s||!z.nodeType||z.nodeType===9){break}if(!v||v(z)){if(y){x.push(z)}else{return z}}z=z.parentNode}return y?x:null},get:function(o){var p;if(o&&this.doc&&typeof(o)=="string"){p=o;o=this.doc.getElementById(o);if(o&&o.id!==p){return this.doc.getElementsByName(p)[1]}}return o},getNext:function(p,o){return this._findSib(p,o,"nextSibling")},getPrev:function(p,o){return this._findSib(p,o,"previousSibling")},select:function(q,p){var o=this;return m.dom.Sizzle(q,o.get(p)||o.get(o.settings.root_element)||o.doc,[])},is:function(q,o){var p;if(q.length===undefined){if(o==="*"){return q.nodeType==1}if(b.test(o)){o=o.toLowerCase().split(/,/);q=q.nodeName.toLowerCase();for(p=o.length-1;p>=0;p--){if(o[p]==q){return true}}return false}}return m.dom.Sizzle.matches(o,q.nodeType?[q]:q).length>0},add:function(s,v,o,r,u){var q=this;return this.run(s,function(y){var x,t;x=j(v,"string")?q.doc.createElement(v):v;q.setAttribs(x,o);if(r){if(r.nodeType){x.appendChild(r)}else{q.setHTML(x,r)}}return !u?y.appendChild(x):x})},create:function(q,o,p){return this.add(this.doc.createElement(q),q,o,p,1)},createHTML:function(v,p,s){var u="",r=this,q;u+="<"+v;for(q in p){if(p.hasOwnProperty(q)){u+=" "+q+'="'+r.encode(p[q])+'"'}}if(m.is(s)){return u+">"+s+"</"+v+">"}return u+" />"},remove:function(o,p){return this.run(o,function(r){var q,s;q=r.parentNode;if(!q){return null}if(p){while(s=r.firstChild){if(s.nodeType!==3||s.nodeValue){q.insertBefore(s,r)}else{r.removeChild(s)}}}return q.removeChild(r)})},setStyle:function(r,o,p){var q=this;return q.run(r,function(v){var u,t;u=v.style;o=o.replace(/-(\D)/g,function(x,s){return s.toUpperCase()});if(q.pixelStyles.test(o)&&(m.is(p,"number")||/^[\-0-9\.]+$/.test(p))){p+="px"}switch(o){case"opacity":if(d){u.filter=p===""?"":"alpha(opacity="+(p*100)+")";if(!r.currentStyle||!r.currentStyle.hasLayout){u.display="inline-block"}}u[o]=u["-moz-opacity"]=u["-khtml-opacity"]=p||"";break;case"float":d?u.styleFloat=p:u.cssFloat=p;break;default:u[o]=p||""}if(q.settings.update_styles){q.setAttrib(v,"_mce_style")}})},getStyle:function(r,o,q){r=this.get(r);if(!r){return false}if(this.doc.defaultView&&q){o=o.replace(/[A-Z]/g,function(s){return"-"+s});try{return this.doc.defaultView.getComputedStyle(r,null).getPropertyValue(o)}catch(p){return null}}o=o.replace(/-(\D)/g,function(t,s){return s.toUpperCase()});if(o=="float"){o=d?"styleFloat":"cssFloat"}if(r.currentStyle&&q){return r.currentStyle[o]}return r.style[o]},setStyles:function(u,v){var q=this,r=q.settings,p;p=r.update_styles;r.update_styles=0;k(v,function(o,s){q.setStyle(u,s,o)});r.update_styles=p;if(r.update_styles){q.setAttrib(u,r.cssText)}},setAttrib:function(q,r,o){var p=this;if(!q||!r){return}if(p.settings.strict){r=r.toLowerCase()}return this.run(q,function(u){var t=p.settings;switch(r){case"style":if(!j(o,"string")){k(o,function(s,x){p.setStyle(u,x,s)});return}if(t.keep_values){if(o&&!p._isRes(o)){u.setAttribute("_mce_style",o,2)}else{u.removeAttribute("_mce_style",2)}}u.style.cssText=o;break;case"class":u.className=o||"";break;case"src":case"href":if(t.keep_values){if(t.url_converter){o=t.url_converter.call(t.url_converter_scope||p,o,r,u)}p.setAttrib(u,"_mce_"+r,o,2)}break;case"shape":u.setAttribute("_mce_style",o);break}if(j(o)&&o!==null&&o.length!==0){u.setAttribute(r,""+o,2)}else{u.removeAttribute(r,2)}})},setAttribs:function(q,r){var p=this;return this.run(q,function(o){k(r,function(s,t){p.setAttrib(o,t,s)})})},getAttrib:function(r,s,q){var o,p=this;r=p.get(r);if(!r||r.nodeType!==1){return false}if(!j(q)){q=""}if(/^(src|href|style|coords|shape)$/.test(s)){o=r.getAttribute("_mce_"+s);if(o){return o}}if(d&&p.props[s]){o=r[p.props[s]];o=o&&o.nodeValue?o.nodeValue:o}if(!o){o=r.getAttribute(s,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(s)){if(r[p.props[s]]===true&&o===""){return s}return o?s:""}if(r.nodeName==="FORM"&&r.getAttributeNode(s)){return r.getAttributeNode(s).nodeValue}if(s==="style"){o=o||r.style.cssText;if(o){o=p.serializeStyle(p.parseStyle(o),r.nodeName);if(p.settings.keep_values&&!p._isRes(o)){r.setAttribute("_mce_style",o)}}}if(i&&s==="class"&&o){o=o.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(d){switch(s){case"rowspan":case"colspan":if(o===1){o=""}break;case"size":if(o==="+0"||o===20||o===0){o=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(o===0){o=""}break;case"hspace":if(o===-1){o=""}break;case"maxlength":case"tabindex":if(o===32768||o===2147483647||o==="32768"){o=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(o===65535){return s}return q;case"shape":o=o.toLowerCase();break;default:if(s.indexOf("on")===0&&o){o=(""+o).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(o!==undefined&&o!==null&&o!=="")?""+o:q},getPos:function(A,s){var p=this,o=0,z=0,u,v=p.doc,q;A=p.get(A);s=s||v.body;if(A){if(d&&!p.stdMode){A=A.getBoundingClientRect();u=p.boxModel?v.documentElement:v.body;o=p.getStyle(p.select("html")[0],"borderWidth");o=(o=="medium"||p.boxModel&&!p.isIE6)&&2||o;A.top+=p.win.self!=p.win.top?2:0;return{x:A.left+u.scrollLeft-o,y:A.top+u.scrollTop-o}}q=A;while(q&&q!=s&&q.nodeType){o+=q.offsetLeft||0;z+=q.offsetTop||0;q=q.offsetParent}q=A.parentNode;while(q&&q!=s&&q.nodeType){o-=q.scrollLeft||0;z-=q.scrollTop||0;q=q.parentNode}}return{x:o,y:z}},parseStyle:function(r){var u=this,v=u.settings,x={};if(!r){return x}function p(D,A,C){var z,B,o,y;z=x[D+"-top"+A];if(!z){return}B=x[D+"-right"+A];if(z!=B){return}o=x[D+"-bottom"+A];if(B!=o){return}y=x[D+"-left"+A];if(o!=y){return}x[C]=y;delete x[D+"-top"+A];delete x[D+"-right"+A];delete x[D+"-bottom"+A];delete x[D+"-left"+A]}function q(y,s,o,A){var z;z=x[s];if(!z){return}z=x[o];if(!z){return}z=x[A];if(!z){return}x[y]=x[s]+" "+x[o]+" "+x[A];delete x[s];delete x[o];delete x[A]}r=r.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");k(r.split(";"),function(s){var o,t=[];if(s){s=s.replace(/_MCE_SEMI_/g,";");s=s.replace(/url\([^\)]+\)/g,function(y){t.push(y);return"url("+t.length+")"});s=s.split(":");o=m.trim(s[1]);o=o.replace(/url\(([^\)]+)\)/g,function(z,y){return t[parseInt(y)-1]});o=o.replace(/rgb\([^\)]+\)/g,function(y){return u.toHex(y)});if(v.url_converter){o=o.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(y,z){return"url("+v.url_converter.call(v.url_converter_scope||u,u.decode(z),"style",null)+")"})}x[m.trim(s[0]).toLowerCase()]=o}});p("border","","border");p("border","-width","border-width");p("border","-color","border-color");p("border","-style","border-style");p("padding","","padding");p("margin","","margin");q("border","border-width","border-style","border-color");if(d){if(x.border=="medium none"){x.border=""}}return x},serializeStyle:function(v,p){var q=this,r="";function u(s,o){if(o&&s){if(o.indexOf("-")===0){return}switch(o){case"font-weight":if(s==700){s="bold"}break;case"color":case"background-color":s=s.toLowerCase();break}r+=(r?" ":"")+o+": "+s+";"}}if(p&&q._styles){k(q._styles["*"],function(o){u(v[o],o)});k(q._styles[p.toLowerCase()],function(o){u(v[o],o)})}else{k(v,u)}return r},loadCSS:function(o){var q=this,r=q.doc,p;if(!o){o=""}p=q.select("head")[0];k(o.split(","),function(s){var t;if(q.files[s]){return}q.files[s]=true;t=q.create("link",{rel:"stylesheet",href:m._addVer(s)});if(d&&r.documentMode){t.onload=function(){r.recalc();t.onload=null}}p.appendChild(t)})},addClass:function(o,p){return this.run(o,function(q){var r;if(!p){return 0}if(this.hasClass(q,p)){return q.className}r=this.removeClass(q,p);return q.className=(r!=""?(r+" "):"")+p})},removeClass:function(q,r){var o=this,p;return o.run(q,function(t){var s;if(o.hasClass(t,r)){if(!p){p=new RegExp("(^|\\s+)"+r+"(\\s+|$)","g")}s=t.className.replace(p," ");s=m.trim(s!=" "?s:"");t.className=s;if(!s){t.removeAttribute("class")}return s}return t.className})},hasClass:function(p,o){p=this.get(p);if(!p||!o){return false}return(" "+p.className+" ").indexOf(" "+o+" ")!==-1},show:function(o){return this.setStyle(o,"display","block")},hide:function(o){return this.setStyle(o,"display","none")},isHidden:function(o){o=this.get(o);return !o||o.style.display=="none"||this.getStyle(o,"display")=="none"},uniqueId:function(o){return(!o?"mce_":o)+(this.counter++)},setHTML:function(q,p){var o=this;return this.run(q,function(v){var r,t,s,z,u,r;p=o.processHTML(p);if(d){function y(){while(v.firstChild){v.firstChild.removeNode()}try{v.innerHTML="<br />"+p;v.removeChild(v.firstChild)}catch(x){r=o.create("div");r.innerHTML="<br />"+p;k(r.childNodes,function(B,A){if(A){v.appendChild(B)}})}}if(o.settings.fix_ie_paragraphs){p=p.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 _mce_keep="true">&nbsp;</p>')}y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("p");for(t=s.length-1,r=0;t>=0;t--){z=s[t];if(!z.hasChildNodes()){if(!z._mce_keep){r=1;break}z.removeAttribute("_mce_keep")}}}if(r){p=p.replace(/<p ([^>]+)>|<p>/ig,'<div $1 _mce_tmp="1">');p=p.replace(/<\/p>/g,"</div>");y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("DIV");for(t=s.length-1;t>=0;t--){z=s[t];if(z._mce_tmp){u=o.doc.createElement("p");z.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(A,x){var B;if(x!=="_mce_tmp"){B=z.getAttribute(x);if(!B&&x==="class"){B=z.className}u.setAttribute(x,B)}});for(r=0;r<z.childNodes.length;r++){u.appendChild(z.childNodes[r].cloneNode(true))}z.swapNode(u)}}}}}else{v.innerHTML=p}return p})},processHTML:function(r){var p=this,q=p.settings,v=[];if(!q.process_html){return r}if(d){r=r.replace(/&apos;/g,"&#39;");r=r.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi,"")}r=r.replace(/<a( )([^>]+)\/>|<a\/>/gi,"<a$1$2></a>");if(q.keep_values){if(/<script|noscript|style/i.test(r)){function o(t){t=t.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n");t=t.replace(/^[\r\n]*|[\r\n]*$/g,"");t=t.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g,"");t=t.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g,"");return t}r=r.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/gi,function(s,x,t){if(!x){x=' type="text/javascript"'}x=x.replace(/src=\"([^\"]+)\"?/i,function(y,z){if(q.url_converter){z=p.encode(q.url_converter.call(q.url_converter_scope||p,p.decode(z),"src","script"))}return'_mce_src="'+z+'"'});if(m.trim(t)){v.push(o(t));t="<!--\nMCE_SCRIPT:"+(v.length-1)+"\n// -->"}return"<mce:script"+x+">"+t+"</mce:script>"});r=r.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/gi,function(s,x,t){if(t){v.push(o(t));t="<!--\nMCE_SCRIPT:"+(v.length-1)+"\n-->"}return"<mce:style"+x+">"+t+"</mce:style><style "+x+' _mce_bogus="1">'+t+"</style>"});r=r.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(s,x,t){return"<mce:noscript"+x+"><!--"+p.encode(t).replace(/--/g,"&#45;&#45;")+"--></mce:noscript>"})}r=r.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g,"<!--[CDATA[$1]]-->");function u(s){return s.replace(h,function(y,z,x,t){return"<"+z+x.replace(l,function(B,A,E,D,C){var F;A=A.toLowerCase();E=E||D||C||"";if(e[A]){if(E==="false"||E==="0"){return}return A+'="'+A+'"'}if(f[A]&&x.indexOf("_mce_"+A)==-1){F=p.decode(E);if(q.url_converter&&(A=="src"||A=="href")){F=q.url_converter.call(q.url_converter_scope||p,F,A,z)}if(A=="style"){F=p.serializeStyle(p.parseStyle(F),A)}return A+'="'+E+'" _mce_'+A+'="'+p.encode(F)+'"'}return B})+t+">"})}r=u(r);r=r.replace(/MCE_SCRIPT:([0-9]+)/g,function(t,s){return v[s]})}return r},getOuterHTML:function(o){var p;o=this.get(o);if(!o){return null}if(o.outerHTML!==undefined){return o.outerHTML}p=(o.ownerDocument||this.doc).createElement("body");p.appendChild(o.cloneNode(true));return p.innerHTML},setOuterHTML:function(r,p,s){var o=this;function q(u,t,x){var y,v;v=x.createElement("body");v.innerHTML=t;y=v.lastChild;while(y){o.insertAfter(y.cloneNode(true),u);y=y.previousSibling}o.remove(u)}return this.run(r,function(u){u=o.get(u);if(u.nodeType==1){s=s||u.ownerDocument||o.doc;if(d){try{if(d&&u.nodeType==1){u.outerHTML=p}else{q(u,p,s)}}catch(t){q(u,p,s)}}else{q(u,p,s)}}})},decode:function(p){var q,r,o;if(/&[\w#]+;/.test(p)){q=this.doc.createElement("div");q.innerHTML=p;r=q.firstChild;o="";if(r){do{o+=r.nodeValue}while(r=r.nextSibling)}return o||p}return p},encode:function(o){return(""+o).replace(n,function(p){return c[p]})},insertAfter:function(o,p){p=this.get(p);return this.run(o,function(r){var q,s;q=p.parentNode;s=p.nextSibling;if(s){q.insertBefore(r,s)}else{q.appendChild(r)}return r})},isBlock:function(o){if(o.nodeType&&o.nodeType!==1){return false}o=o.nodeName||o;return a.test(o)},replace:function(s,r,p){var q=this;if(j(r,"array")){s=s.cloneNode(true)}return q.run(r,function(t){if(p){k(m.grep(t.childNodes),function(o){s.appendChild(o)})}return t.parentNode.replaceChild(s,t)})},rename:function(r,o){var q=this,p;if(r.nodeName!=o.toUpperCase()){p=q.create(o);k(q.getAttribs(r),function(s){q.setAttrib(p,s.nodeName,q.getAttrib(r,s.nodeName))});q.replace(p,r,1)}return p||r},findCommonAncestor:function(q,o){var r=q,p;while(r){p=o;while(p&&r!=p){p=p.parentNode}if(r==p){break}r=r.parentNode}if(!r&&q.ownerDocument){return q.ownerDocument.documentElement}return r},toHex:function(o){var q=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(o);function p(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}if(q){o="#"+p(q[1])+p(q[2])+p(q[3]);return o}return o},getClasses:function(){var s=this,o=[],r,u={},v=s.settings.class_filter,q;if(s.classes){return s.classes}function x(t){k(t.imports,function(y){x(y)});k(t.cssRules||t.rules,function(y){switch(y.type||1){case 1:if(y.selectorText){k(y.selectorText.split(","),function(z){z=z.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(z)||!/\.[\w\-]+$/.test(z)){return}q=z;z=z.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(v&&!(z=v(z,q))){return}if(!u[z]){o.push({"class":z});u[z]=1}})}break;case 3:x(y.styleSheet);break}})}try{k(s.doc.styleSheets,x)}catch(p){}if(o.length>0){s.classes=o}return o},run:function(u,r,q){var p=this,v;if(p.doc&&typeof(u)==="string"){u=p.get(u)}if(!u){return false}q=q||this;if(!u.nodeType&&(u.length||u.length===0)){v=[];k(u,function(s,o){if(s){if(typeof(s)=="string"){s=p.doc.getElementById(s)}v.push(r.call(q,s,o))}});return v}return r.call(q,u)},getAttribs:function(q){var p;q=this.get(q);if(!q){return[]}if(d){p=[];if(q.nodeName=="OBJECT"){return q.attributes}if(q.nodeName==="OPTION"&&this.getAttrib(q,"selected")){p.push({specified:1,nodeName:"selected"})}q.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(o){p.push({specified:1,nodeName:o})});return p}return q.attributes},destroy:function(p){var o=this;if(o.events){o.events.destroy()}o.win=o.doc=o.root=o.events=null;if(!p){m.removeUnload(o.destroy)}},createRng:function(){var o=this.doc;return o.createRange?o.createRange():new m.dom.Range(this)},nodeIndex:function(r,s){var o=0,q,p;if(r){for(r=r.previousSibling,q=r;r;r=r.previousSibling){p=r.nodeType;if(s&&p==3){if(r.nodeValue.length>0&&(q.nodeType!=p||q.nodeValue.length===0)){o++}}else{o++}q=r}}return o},split:function(u,s,y){var z=this,o=z.createRng(),v,q,x;function p(A){var t,r=A.childNodes;if(A.nodeType==1&&A.getAttribute("_mce_type")=="bookmark"){return}for(t=r.length-1;t>=0;t--){p(r[t])}if(A.nodeType!=9){if(A.nodeType==3&&A.nodeValue.length>0){return}if(A.nodeType==1){r=A.childNodes;if(r.length==1&&r[0]&&r[0].nodeType==1&&r[0].getAttribute("_mce_type")=="bookmark"){A.parentNode.insertBefore(r[0],A)}if(r.length||/^(br|hr|input|img)$/i.test(A.nodeName)){return}}z.remove(A)}return A}if(u&&s){o.setStart(u.parentNode,z.nodeIndex(u));o.setEnd(s.parentNode,z.nodeIndex(s));v=o.extractContents();o=z.createRng();o.setStart(s.parentNode,z.nodeIndex(s)+1);o.setEnd(u.parentNode,z.nodeIndex(u)+1);q=o.extractContents();x=u.parentNode;x.insertBefore(p(v),u);if(y){x.replaceChild(y,s)}else{x.insertBefore(s,u)}x.insertBefore(p(q),u);z.remove(u);return y||s}},bind:function(s,o,r,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.add(s,o,r,q||this)},unbind:function(r,o,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.remove(r,o,q)},_findSib:function(r,o,p){var q=this,s=o;if(r){if(j(s,"string")){s=function(t){return q.is(t,o)}}for(r=r[p];r;r=r[p]){if(s(r)){return r}}}return null},_isRes:function(o){return/^(top|left|bottom|right|width|height)/i.test(o)||/;\s*(top|left|bottom|right|width|height)/i.test(o)}});m.DOM=new m.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var N=this,e=c.doc,S=0,E=1,j=2,D=true,R=false,U="startOffset",h="startContainer",P="endContainer",z="endOffset",k=tinymce.extend,n=c.nodeIndex;k(N,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:D,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:I,setEndBefore:J,setEndAfter:u,collapse:A,selectNode:x,selectNodeContents:F,compareBoundaryPoints:v,deleteContents:p,extractContents:H,cloneContents:d,insertNode:C,surroundContents:M,cloneRange:K});function q(V,t){B(D,V,t)}function s(V,t){B(R,V,t)}function g(t){q(t.parentNode,n(t))}function I(t){q(t.parentNode,n(t)+1)}function J(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function A(t){if(t){N[P]=N[h];N[z]=N[U]}else{N[h]=N[P];N[U]=N[z]}N.collapsed=D}function x(t){g(t);u(t)}function F(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(W,X){var Z=N[h],Y=N[U],V=N[P],t=N[z];if(W===0){return G(Z,Y,Z,Y)}if(W===1){return G(Z,Y,V,t)}if(W===2){return G(V,t,V,t)}if(W===3){return G(V,t,Z,Y)}}function p(){m(j)}function H(){return m(S)}function d(){return m(E)}function C(Y){var V=this[h],t=this[U],X,W;if((V.nodeType===3||V.nodeType===4)&&V.nodeValue){if(!t){V.parentNode.insertBefore(Y,V)}else{if(t>=V.nodeValue.length){c.insertAfter(Y,V)}else{X=V.splitText(t);V.parentNode.insertBefore(Y,X)}}}else{if(V.childNodes.length>0){W=V.childNodes[t]}if(W){V.insertBefore(Y,W)}else{V.appendChild(Y)}}}function M(V){var t=N.extractContents();N.insertNode(V);V.appendChild(t);N.selectNode(V)}function K(){return k(new b(c),{startContainer:N[h],startOffset:N[U],endContainer:N[P],endOffset:N[z],collapsed:N.collapsed,commonAncestorContainer:N.commonAncestorContainer})}function O(t,V){var W;if(t.nodeType==3){return t}if(V<0){return t}W=t.firstChild;while(W&&V>0){--V;W=W.nextSibling}if(W){return W}return t}function l(){return(N[h]==N[P]&&N[U]==N[z])}function G(X,Z,V,Y){var aa,W,t,ab,ad,ac;if(X==V){if(Z==Y){return 0}if(Z<Y){return -1}return 1}aa=V;while(aa&&aa.parentNode!=X){aa=aa.parentNode}if(aa){W=0;t=X.firstChild;while(t!=aa&&W<Z){W++;t=t.nextSibling}if(Z<=W){return -1}return 1}aa=X;while(aa&&aa.parentNode!=V){aa=aa.parentNode}if(aa){W=0;t=V.firstChild;while(t!=aa&&W<Y){W++;t=t.nextSibling}if(W<Y){return -1}return 1}ab=c.findCommonAncestor(X,V);ad=X;while(ad&&ad.parentNode!=ab){ad=ad.parentNode}if(!ad){ad=ab}ac=V;while(ac&&ac.parentNode!=ab){ac=ac.parentNode}if(!ac){ac=ab}if(ad==ac){return 0}t=ab.firstChild;while(t){if(t==ad){return -1}if(t==ac){return 1}t=t.nextSibling}}function B(V,Y,X){var t,W;if(V){N[h]=Y;N[U]=X}else{N[P]=Y;N[z]=X}t=N[P];while(t.parentNode){t=t.parentNode}W=N[h];while(W.parentNode){W=W.parentNode}if(W==t){if(G(N[h],N[U],N[P],N[z])>0){N.collapse(V)}}else{N.collapse(V)}N.collapsed=l();N.commonAncestorContainer=c.findCommonAncestor(N[h],N[P])}function m(ab){var aa,X=0,ad=0,V,Z,W,Y,t,ac;if(N[h]==N[P]){return f(ab)}for(aa=N[P],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[h]){return r(aa,ab)}++X}for(aa=N[h],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[P]){return T(aa,ab)}++ad}Z=ad-X;W=N[h];while(Z>0){W=W.parentNode;Z--}Y=N[P];while(Z<0){Y=Y.parentNode;Z++}for(t=W.parentNode,ac=Y.parentNode;t!=ac;t=t.parentNode,ac=ac.parentNode){W=t;Y=ac}return o(W,Y,ab)}function f(Z){var ab,Y,X,aa,t,W,V;if(Z!=j){ab=e.createDocumentFragment()}if(N[U]==N[z]){return ab}if(N[h].nodeType==3){Y=N[h].nodeValue;X=Y.substring(N[U],N[z]);if(Z!=E){N[h].deleteData(N[U],N[z]-N[U]);N.collapse(D)}if(Z==j){return}ab.appendChild(e.createTextNode(X));return ab}aa=O(N[h],N[U]);t=N[z]-N[U];while(t>0){W=aa.nextSibling;V=y(aa,Z);if(ab){ab.appendChild(V)}--t;aa=W}if(Z!=E){N.collapse(D)}return ab}function r(ab,Y){var aa,Z,V,t,X,W;if(Y!=j){aa=e.createDocumentFragment()}Z=i(ab,Y);if(aa){aa.appendChild(Z)}V=n(ab);t=V-N[U];if(t<=0){if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}Z=ab.previousSibling;while(t>0){X=Z.previousSibling;W=y(Z,Y);if(aa){aa.insertBefore(W,aa.firstChild)}--t;Z=X}if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}function T(Z,Y){var ab,V,aa,t,X,W;if(Y!=j){ab=e.createDocumentFragment()}aa=Q(Z,Y);if(ab){ab.appendChild(aa)}V=n(Z);++V;t=N[z]-V;aa=Z.nextSibling;while(t>0){X=aa.nextSibling;W=y(aa,Y);if(ab){ab.appendChild(W)}--t;aa=X}if(Y!=E){N.setStartAfter(Z);N.collapse(D)}return ab}function o(Z,t,ac){var W,ae,Y,aa,ab,V,ad,X;if(ac!=j){ae=e.createDocumentFragment()}W=Q(Z,ac);if(ae){ae.appendChild(W)}Y=Z.parentNode;aa=n(Z);ab=n(t);++aa;V=ab-aa;ad=Z.nextSibling;while(V>0){X=ad.nextSibling;W=y(ad,ac);if(ae){ae.appendChild(W)}ad=X;--V}W=i(t,ac);if(ae){ae.appendChild(W)}if(ac!=E){N.setStartAfter(Z);N.collapse(D)}return ae}function i(aa,ab){var W=O(N[P],N[z]-1),ac,Z,Y,t,V,X=W!=N[P];if(W==aa){return L(W,X,R,ab)}ac=W.parentNode;Z=L(ac,R,R,ab);while(ac){while(W){Y=W.previousSibling;t=L(W,X,R,ab);if(ab!=j){Z.insertBefore(t,Z.firstChild)}X=D;W=Y}if(ac==aa){return Z}W=ac.previousSibling;ac=ac.parentNode;V=L(ac,R,R,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function Q(aa,ab){var X=O(N[h],N[U]),Y=X!=N[h],ac,Z,W,t,V;if(X==aa){return L(X,Y,D,ab)}ac=X.parentNode;Z=L(ac,R,D,ab);while(ac){while(X){W=X.nextSibling;t=L(X,Y,D,ab);if(ab!=j){Z.appendChild(t)}Y=D;X=W}if(ac==aa){return Z}X=ac.nextSibling;ac=ac.parentNode;V=L(ac,R,D,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function L(t,Y,ab,ac){var X,W,Z,V,aa;if(Y){return y(t,ac)}if(t.nodeType==3){X=t.nodeValue;if(ab){V=N[U];W=X.substring(V);Z=X.substring(0,V)}else{V=N[z];W=X.substring(0,V);Z=X.substring(V)}if(ac!=E){t.nodeValue=Z}if(ac==j){return}aa=t.cloneNode(R);aa.nodeValue=W;return aa}if(ac==j){return}return t.cloneNode(R)}function y(V,t){if(t!=j){return t==E?V.cloneNode(D):V}V.parentNode.removeChild(V)}}a.Range=b})(tinymce.dom);(function(){function a(h){var j=this,k="\uFEFF",f,i,e=h.dom,d=true,g=false;function c(m,l){if(m&&l){if(m.item&&l.item&&m.item(0)===l.item(0)){return d}if(m.isEqual&&l.isEqual&&l.isEqual(m)){try{f.startContainer.nextSibling;return d}catch(n){}}}return g}function b(){var p=h.getRng(),l=e.createRng(),m,n,r,q;n=p.item?p.item(0):p.parentElement();if(n.ownerDocument!=e.doc){return l}if(p.item||!n.hasChildNodes()){l.setStart(n.parentNode,e.nodeIndex(n));l.setEnd(l.startContainer,l.startOffset+1);return l}m=p.duplicate();r=h.isCollapsed();p.collapse();p.pasteHTML('<span id="_mce_start" style="display:none;line-height:0">'+k+"</span>");if(!r){m.collapse(g);m.pasteHTML('<span id="_mce_end" style="display:none;line-height:0">'+k+"</span>")}function o(x){var t,v,s,u;s=e.get("_mce_"+(x?"start":"end"));u=s.previousSibling;if(u&&u.nodeType==3){t=u;v=t.nodeValue.length;e.remove(s);u=t.nextSibling;if(u&&u.nodeType==3){q=d;t.appendData(u.nodeValue);e.remove(u)}}else{u=s.nextSibling;if(u&&u.nodeType==3){t=u;v=0}else{if(u){v=e.nodeIndex(u)-1}else{v=e.nodeIndex(s)}t=s.parentNode}e.remove(s)}if(x){l.setStart(t,v)}if(!x||r){l.setEnd(t,v)}}o(d);if(!r){o(g)}if(q){j.addRange(l)}return l}this.addRange=function(m){var u,A,z=h.dom.doc,s=z.body,v,o,y,p,t,l,q,r,x,n;this.destroy();y=m.startContainer;p=m.startOffset;t=m.endContainer;l=m.endOffset;u=s.createTextRange();if(y==z||t==z){u=s.createTextRange();u.collapse();u.select();return}if(y.nodeType==1&&y.hasChildNodes()){r=y.childNodes.length-1;if(p>r){x=1;y=y.childNodes[r]}else{y=y.childNodes[p]}if(y.nodeType==3){p=0}}if(t.nodeType==1&&t.hasChildNodes()){r=t.childNodes.length-1;if(l==0){n=1;t=t.childNodes[0]}else{t=t.childNodes[Math.min(r,l-1)];if(t.nodeType==3){l=t.nodeValue.length}}}if(y==t&&y.nodeType==1){if(/^(IMG|TABLE)$/.test(y.nodeName)&&p!=l){u=s.createControlRange();u.addElement(y)}else{u=s.createTextRange();if(!y.hasChildNodes()&&y.canHaveHTML){y.innerHTML=k}u.moveToElementText(y);if(y.innerHTML==k){u.collapse(d);y.removeChild(y.firstChild)}}if(p==l){u.collapse(l<=m.endContainer.childNodes.length-1)}u.select();u.scrollIntoView();return}u=s.createTextRange();q=z.createElement("span");q.innerHTML=" ";if(y.nodeType==3){if(x){e.insertAfter(q,y)}else{y.parentNode.insertBefore(q,y)}u.moveToElementText(q);q.parentNode.removeChild(q);u.move("character",p)}else{u.moveToElementText(y);if(x){u.collapse(g)}}if(y==t&&y.nodeType==3){u.moveEnd("character",l-p);u.select();u.scrollIntoView();return}A=s.createTextRange();if(t.nodeType==3){t.parentNode.insertBefore(q,t);A.moveToElementText(q);q.parentNode.removeChild(q);A.move("character",l);u.setEndPoint("EndToStart",A)}else{A.moveToElementText(t);A.collapse(!!n);u.setEndPoint("EndToEnd",A)}u.select();u.scrollIntoView()};this.getRangeAt=function(){if(!f||!c(i,h.getRng())){f=b();i=h.getRng()}return f};this.destroy=function(){i=f=null};if(h.dom.boxModel){(function(){var r=e.doc,m=r.body,o,p;r.documentElement.unselectable=d;function q(s,v){var t=m.createTextRange();try{t.moveToPoint(s,v)}catch(u){t=null}return t}function n(t){var s;if(t.button){s=q(t.x,t.y);if(s){if(s.compareEndPoints("StartToStart",p)>0){s.setEndPoint("StartToStart",p)}else{s.setEndPoint("EndToEnd",p)}s.select()}}else{l()}}function l(){e.unbind(r,"mouseup",l);e.unbind(r,"mousemove",n);o=0}e.bind(r,"mousedown",function(s){if(s.target.nodeName==="HTML"){if(o){l()}o=1;p=q(s.x,s.y);if(p){e.bind(r,"mouseup",l);e.bind(r,"mousemove",n);p.select()}}})})()}}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,i=0,d=Object.prototype.toString,n=false;var b=function(E,t,B,v){B=B||[];var e=t=t||document;if(t.nodeType!==1&&t.nodeType!==9){return[]}if(!E||typeof E!=="string"){return B}var C=[],D,z,H,G,A,s,r=true,x=o(t);p.lastIndex=0;while((D=p.exec(E))!==null){C.push(D[1]);if(D[2]){s=RegExp.rightContext;break}}if(C.length>1&&j.exec(E)){if(C.length===2&&f.relative[C[0]]){z=g(C[0]+C[1],t)}else{z=f.relative[C[0]]?[t]:b(C.shift(),t);while(C.length){E=C.shift();if(f.relative[E]){E+=C.shift()}z=g(E,z)}}}else{if(!v&&C.length>1&&t.nodeType===9&&!x&&f.match.ID.test(C[0])&&!f.match.ID.test(C[C.length-1])){var I=b.find(C.shift(),t,x);t=I.expr?b.filter(I.expr,I.set)[0]:I.set[0]}if(t){var I=v?{expr:C.pop(),set:a(v)}:b.find(C.pop(),C.length===1&&(C[0]==="~"||C[0]==="+")&&t.parentNode?t.parentNode:t,x);z=I.expr?b.filter(I.expr,I.set):I.set;if(C.length>0){H=a(z)}else{r=false}while(C.length){var u=C.pop(),y=u;if(!f.relative[u]){u=""}else{y=C.pop()}if(y==null){y=t}f.relative[u](H,y,x)}}else{H=C=[]}}if(!H){H=z}if(!H){throw"Syntax error, unrecognized expression: "+(u||E)}if(d.call(H)==="[object Array]"){if(!r){B.push.apply(B,H)}else{if(t&&t.nodeType===1){for(var F=0;H[F]!=null;F++){if(H[F]&&(H[F]===true||H[F].nodeType===1&&h(t,H[F]))){B.push(z[F])}}}else{for(var F=0;H[F]!=null;F++){if(H[F]&&H[F].nodeType===1){B.push(z[F])}}}}}else{a(H,B)}if(s){b(s,e,B,v);b.uniqueSort(B)}return B};b.uniqueSort=function(r){if(c){n=false;r.sort(c);if(n){for(var e=1;e<r.length;e++){if(r[e]===r[e-1]){r.splice(e--,1)}}}}};b.matches=function(e,r){return b(e,null,null,r)};b.find=function(y,e,z){var x,u;if(!y){return[]}for(var t=0,s=f.order.length;t<s;t++){var v=f.order[t],u;if((u=f.match[v].exec(y))){var r=RegExp.leftContext;if(r.substr(r.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");x=f.find[v](u,e,z);if(x!=null){y=y.replace(f.match[v],"");break}}}}if(!x){x=e.getElementsByTagName("*")}return{set:x,expr:y}};b.filter=function(B,A,E,t){var s=B,G=[],y=A,v,e,x=A&&A[0]&&o(A[0]);while(B&&A.length){for(var z in f.filter){if((v=f.match[z].exec(B))!=null){var r=f.filter[z],F,D;e=false;if(y==G){G=[]}if(f.preFilter[z]){v=f.preFilter[z](v,y,E,G,t,x);if(!v){e=F=true}else{if(v===true){continue}}}if(v){for(var u=0;(D=y[u])!=null;u++){if(D){F=r(D,v,u,y);var C=t^!!F;if(E&&F!=null){if(C){e=true}else{y[u]=false}}else{if(C){G.push(D);e=true}}}}}if(F!==undefined){if(!E){y=G}B=B.replace(f.match[z],"");if(!e){return[]}break}}}if(B==s){if(e==null){throw"Syntax error, unrecognized expression: "+B}else{break}}s=B}return y};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(y,e,x){var u=typeof e==="string",z=u&&!/\W/.test(e),v=u&&!z;if(z&&!x){e=e.toUpperCase()}for(var t=0,s=y.length,r;t<s;t++){if((r=y[t])){while((r=r.previousSibling)&&r.nodeType!==1){}y[t]=v||r&&r.nodeName===e?r||false:r===e}}if(v){b.filter(e,y,true)}},">":function(x,r,y){var u=typeof r==="string";if(u&&!/\W/.test(r)){r=y?r:r.toUpperCase();for(var s=0,e=x.length;s<e;s++){var v=x[s];if(v){var t=v.parentNode;x[s]=t.nodeName===r?t:false}}}else{for(var s=0,e=x.length;s<e;s++){var v=x[s];if(v){x[s]=u?v.parentNode:v.parentNode===r}}if(u){b.filter(r,x,true)}}},"":function(t,r,v){var s=i++,e=q;if(!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("parentNode",r,s,t,u,v)},"~":function(t,r,v){var s=i++,e=q;if(typeof r==="string"&&!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("previousSibling",r,s,t,u,v)}},find:{ID:function(r,s,t){if(typeof s.getElementById!=="undefined"&&!t){var e=s.getElementById(r[1]);return e?[e]:[]}},NAME:function(s,v,x){if(typeof v.getElementsByName!=="undefined"){var r=[],u=v.getElementsByName(s[1]);for(var t=0,e=u.length;t<e;t++){if(u[t].getAttribute("name")===s[1]){r.push(u[t])}}return r.length===0?null:r}},TAG:function(e,r){return r.getElementsByTagName(e[1])}},preFilter:{CLASS:function(t,r,s,e,x,y){t=" "+t[1].replace(/\\/g,"")+" ";if(y){return t}for(var u=0,v;(v=r[u])!=null;u++){if(v){if(x^(v.className&&(" "+v.className+" ").indexOf(t)>=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){for(var s=0;e[s]===false;s++){}return e[s]&&o(e[s])?r[1]:r[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=i++;return e},ATTR:function(u,r,s,e,v,x){var t=u[1].replace(/\\/g,"");if(!x&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if(u[3].match(p).length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return r<e[3]-0},gt:function(s,r,e){return r>e[3]-0},nth:function(s,r,e){return e[3]-0==r},eq:function(s,r,e){return e[3]-0==r}},filter:{PSEUDO:function(x,s,t,y){var r=s[1],u=f.filters[r];if(u){return u(x,t,s,y)}else{if(r==="contains"){return(x.textContent||x.innerText||"").indexOf(s[3])>=0}else{if(r==="not"){var v=s[3];for(var t=0,e=v.length;t<e;t++){if(v[t]===x){return false}}return true}}}},CHILD:function(e,t){var x=t[1],r=e;switch(x){case"only":case"first":while(r=r.previousSibling){if(r.nodeType===1){return false}}if(x=="first"){return true}r=e;case"last":while(r=r.nextSibling){if(r.nodeType===1){return false}}return true;case"nth":var s=t[2],A=t[3];if(s==1&&A==0){return true}var v=t[0],z=e.parentNode;if(z&&(z.sizcache!==v||!e.nodeIndex)){var u=0;for(r=z.firstChild;r;r=r.nextSibling){if(r.nodeType===1){r.nodeIndex=++u}}z.sizcache=v}var y=e.nodeIndex-A;if(s==0){return y==0}else{return(y%s==0&&y/s>=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),x=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?x===r:u==="*="?x.indexOf(r)>=0:u==="~="?(" "+x+" ").indexOf(r)>=0:!r?x&&e!==false:u==="!="?x!=r:u==="^="?x.indexOf(r)===0:u==="$="?x.substr(x.length-r.length)===r:u==="|="?x===r||x.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var j=f.match.POS;for(var l in f.match){f.match[l]=new RegExp(f.match[l].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var a=function(r,e){r=Array.prototype.slice.call(r);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(k){a=function(u,t){var r=t||[];if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var s=0,e=u.length;s<e;s++){r.push(u[s])}}else{for(var s=0;u[s];s++){r.push(u[s])}}}return r}}var c;if(document.documentElement.compareDocumentPosition){c=function(r,e){var s=r.compareDocumentPosition(e)&4?-1:r===e?0:1;if(s===0){n=true}return s}}else{if("sourceIndex" in document.documentElement){c=function(r,e){var s=r.sourceIndex-e.sourceIndex;if(s===0){n=true}return s}}else{if(document.createRange){c=function(t,r){var s=t.ownerDocument.createRange(),e=r.ownerDocument.createRange();s.setStart(t,0);s.setEnd(t,0);e.setStart(r,0);e.setEnd(r,0);var u=s.compareBoundaryPoints(Range.START_TO_END,e);if(u===0){n=true}return u}}}}(function(){var r=document.createElement("div"),s="script"+(new Date).getTime();r.innerHTML="<a name='"+s+"'/>";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(!!document.getElementById(s)){f.find.ID=function(u,v,x){if(typeof v.getElementById!=="undefined"&&!x){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r)})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="<p class='TEST'></p>";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(x,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!o(v)){try{return a(v.querySelectorAll(x),t)}catch(y){}}return e(x,v,t,u)};for(var r in e){b[r]=e[r]}})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}}})()}function m(r,x,v,B,y,A){var z=r=="previousSibling"&&!A;for(var t=0,s=B.length;t<s;t++){var e=B[t];if(e){if(z&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=B[e.sizset];break}if(e.nodeType===1&&!A){e.sizcache=v;e.sizset=t}if(e.nodeName===x){u=e;break}e=e[r]}B[t]=u}}}function q(r,x,v,B,y,A){var z=r=="previousSibling"&&!A;for(var t=0,s=B.length;t<s;t++){var e=B[t];if(e){if(z&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=B[e.sizset];break}if(e.nodeType===1){if(!A){e.sizcache=v;e.sizset=t}if(typeof x!=="string"){if(e===x){u=true;break}}else{if(b.filter(x,[e]).length>0){u=e;break}}}e=e[r]}B[t]=u}}}var h=document.compareDocumentPosition?function(r,e){return r.compareDocumentPosition(e)&16}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};var o=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var g=function(e,y){var t=[],u="",v,s=y.nodeType?[y]:y;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var x=0,r=s.length;x<r;x++){b(e,s[x],t)}return b.filter(u,t)};window.tinymce.dom.Sizzle=b})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(m,p,l,j){var g,h=this,i=h.events,k;if(p instanceof Array){k=[];f(p,function(o){k.push(h.add(m,o,l,j))});return k}if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.add(n,p,l,j))});return k}m=c.get(m);if(!m){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}d.extend(n,h._stoppers)}if(!j){return l(n)}return l.call(j,n)};if(p=="unload"){d.unloads.unshift({func:g});return g}if(p=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}i.push({obj:m,name:p,func:l,cfunc:g,scope:j});h._add(m,p,g);return l},remove:function(l,m,k){var h=this,g=h.events,i=false,j;if(l&&l.hasOwnProperty&&l instanceof Array){j=[];f(l,function(n){n=c.get(n);j.push(h.remove(n,m,k))});return j}l=c.get(l);f(g,function(o,n){if(o.obj==l&&o.name==m&&(!k||(o.func==k||o.cfunc==k))){g.splice(n,1);h._remove(l,m,o.cfunc);i=true;return false}});return i},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j<arguments.length;j++){h.push(arguments[j])}h=e[g].apply(e,h);b.update(g);return h}});a.extend(b,{on:function(i,h,g){return a.dom.Event.add(b.id,i,h,g)},getXY:function(){return{x:parseInt(b.getStyle("left")),y:parseInt(b.getStyle("top"))}},getSize:function(){var g=e.get(b.id);return{w:parseInt(b.getStyle("width")||g.clientWidth),h:parseInt(b.getStyle("height")||g.clientHeight)}},moveTo:function(g,h){b.setStyles({left:g,top:h})},moveBy:function(g,i){var h=b.getXY();b.moveTo(h.x+g,h.y+i)},resizeTo:function(g,i){b.setStyles({width:g,height:i})},resizeBy:function(g,j){var i=b.getSize();b.resizeTo(i.w+g,i.h+j)},update:function(h){var g;if(a.isIE6&&d.blocker){h=h||"";if(h.indexOf("get")===0||h.indexOf("has")===0||h.indexOf("is")===0){return}if(h=="remove"){e.remove(b.blocker);return}if(!b.blocker){b.blocker=e.uniqueId();g=e.add(d.container||e.getRoot(),"iframe",{id:b.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});e.setStyle(g,"opacity",0)}else{g=e.get(b.blocker)}e.setStyles(g,{left:b.getStyle("left",1),top:b.getStyle("top",1),width:b.getStyle("width",1),height:b.getStyle("height",1),display:b.getStyle("display",1),zIndex:parseInt(b.getStyle("zIndex",1)||0)-1})}}})}})(tinymce);(function(c){function e(f){return f.replace(/[\n\r]+/g,"")}var b=c.is,a=c.isIE,d=c.each;c.create("tinymce.dom.Selection",{Selection:function(i,h,g){var f=this;f.dom=i;f.win=h;f.serializer=g;d(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(j){f[j]=new c.util.Dispatcher(f)});if(!f.win.getSelection){f.tridentSel=new c.dom.TridentSelection(f)}c.addUnload(f.destroy,f)},getContent:function(g){var f=this,h=f.getRng(),l=f.dom.create("body"),j=f.getSel(),i,k,m;g=g||{};i=k="";g.get=true;g.format=g.format||"html";f.onBeforeGetContent.dispatch(f,g);if(g.format=="text"){return f.isCollapsed()?"":(h.text||(j.toString?j.toString():""))}if(h.cloneContents){m=h.cloneContents();if(m){l.appendChild(m)}}else{if(b(h.item)||b(h.htmlText)){l.innerHTML=h.item?h.item(0).outerHTML:h.htmlText}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(i,g){var f=this,j=f.getRng(),l,k=f.win.document;g=g||{format:"html"};g.set=true;i=g.content=f.dom.processHTML(i);f.onBeforeSetContent.dispatch(f,g);i=g.content;if(j.insertNode){i+='<span id="__caret">_</span>';if(j.startContainer==k&&j.endContainer==k){k.body.innerHTML=i}else{j.deleteContents();j.insertNode(f.getRng().createContextualFragment(i))}l=f.dom.get("__caret");j=k.createRange();j.setStartBefore(l);j.setEndBefore(l);f.setRng(j);f.dom.remove("__caret")}else{if(j.item){k.execCommand("Delete",false,null);j=f.getRng()}j.pasteHTML(i)}f.onSetContent.dispatch(f,g)},getStart:function(){var f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(1);h=g.parentElement();if(h&&h.nodeName=="BODY"){return h.firstChild||h}return h}else{h=g.startContainer;if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[Math.min(h.childNodes.length-1,g.startOffset)]}if(h&&h.nodeType==3){return h.parentNode}return h}},getEnd:function(){var g=this,h=g.getRng(),i,f;if(a){if(h.item){return h.item(0)}h=h.duplicate();h.collapse(0);i=h.parentElement();if(i&&i.nodeName=="BODY"){return i.lastChild||i}return i}else{i=h.endContainer;f=h.endOffset;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[f>0?f-1:f]}if(i&&i.nodeType==3){return i.parentNode}return i}},getBookmark:function(q,r){var u=this,m=u.dom,g,j,i,n,h,o,p,l="\uFEFF",s;function f(v,x){var t=0;d(m.select(v),function(z,y){if(z==x){t=y}});return t}if(q==2){function k(){var v=u.getRng(true),t=m.getRoot(),x={};function y(z,B){var F=[],D,H,A=z[B?"startContainer":"endContainer"],E=z[B?"startOffset":"endOffset"],C,G={};if(A.nodeType==1&&A.hasChildNodes()){H=A.childNodes.length-1;G.exclude=(B&&E>H)||(!B&&E==0);if(!B&&E){E--}A=A.childNodes[E>H?H:E];if(A.nodeType==3){E=B?0:A.nodeValue.length}}if(A.nodeType==3){if(r){for(D=A.previousSibling;D&&D.nodeType==3;D=D.previousSibling){E+=D.nodeValue.length}}G.offset=E}for(;A&&A!=t;A=A.parentNode){F.push(u.dom.nodeIndex(A,r))}G.indexes=F;return G}x.start=y(v,true);if(!u.isCollapsed()){x.end=y(v)}return x}return k()}if(q){return{rng:u.getRng()}}g=u.getRng();i=m.uniqueId();n=tinyMCE.activeEditor.selection.isCollapsed();s="overflow:hidden;line-height:0px";if(g.duplicate||g.item){if(!g.item){j=g.duplicate();g.collapse();g.pasteHTML('<span _mce_type="bookmark" id="'+i+'_start" style="'+s+'">'+l+"</span>");if(!n){j.collapse(false);j.pasteHTML('<span _mce_type="bookmark" id="'+i+'_end" style="'+s+'">'+l+"</span>")}}else{o=g.item(0);h=o.nodeName;return{name:h,index:f(h,o)}}}else{o=u.getNode();h=o.nodeName;if(h=="IMG"){return{name:h,index:f(h,o)}}j=g.cloneRange();if(!n){j.collapse(false);j.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_end",style:s},l))}g.collapse(true);g.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_start",style:s},l))}u.moveToBookmark({id:i,keep:1});return{id:i}},moveToBookmark:function(l){var n=this,k=n.dom,i,h,f,m;if(n.tridentSel){n.tridentSel.destroy()}if(l){if(l.start){f=k.createRng();m=k.getRoot();function g(s){var o=l[s?"start":"end"],p,q,r;if(o){for(q=m,p=o.indexes.length-1;p>=0;p--){q=q.childNodes[o.indexes[p]]||q}if(s){if(q.nodeType==3&&o.offset){f.setStart(q,o.offset)}else{if(o.exclude){f.setStartAfter(q)}else{f.setStartBefore(q)}}}else{if(q.nodeType==3&&o.offset){f.setEnd(q,o.offset)}else{if(o.exclude){f.setEndBefore(q)}else{f.setEndAfter(q)}}}}}g(true);g();n.setRng(f)}else{if(l.id){f=k.createRng();function j(u){var p=k.get(l.id+"_"+u),t,o,r,s,q=l.keep;if(p){t=p.parentNode;if(u=="start"){if(!q){o=k.nodeIndex(p)}else{t=p;o=1}f.setStart(t,o);f.setEnd(t,o)}else{if(!q){o=k.nodeIndex(p)}else{t=p;o=1}f.setEnd(t,o)}if(!q){s=p.previousSibling;r=p.nextSibling;d(c.grep(p.childNodes),function(v){if(v.nodeType==3){v.nodeValue=v.nodeValue.replace(/\uFEFF/g,"")}});while(p=k.get(l.id+"_"+u)){k.remove(p,1)}if(s&&r&&s.nodeType==r.nodeType&&s.nodeType==3){o=s.nodeValue.length;s.appendData(r.nodeValue);k.remove(r);if(u=="start"){f.setStart(s,o);f.setEnd(s,o)}else{f.setEnd(s,o)}}}}}j("start");j("end");n.setRng(f)}else{if(l.name){n.select(k.select(l.name)[l.index])}else{if(l.rng){n.setRng(l.rng)}}}}}},select:function(k,j){var i=this,l=i.dom,g=l.createRng(),f;f=l.nodeIndex(k);g.setStart(k.parentNode,f);g.setEnd(k.parentNode,f+1);if(j){function h(m,o){var n=new c.dom.TreeWalker(m,m);do{if(m.nodeType==3&&c.trim(m.nodeValue).length!=0){if(o){g.setStart(m,0)}else{g.setEnd(m,m.nodeValue.length)}return}if(m.nodeName=="BR"){if(o){g.setStartBefore(m)}else{g.setEndBefore(m)}return}}while(m=(o?n.next():n.prev()))}h(k,1);h(k)}i.setRng(g);return k},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}if(h.compareEndPoints){return h.compareEndPoints("StartToEnd",h)===0}return !g||h.collapsed},collapse:function(f){var g=this,h=g.getRng(),i;if(h.item){i=h.item(0);h=this.win.document.body.createTextRange();h.moveToElementText(i)}h.collapse(!!f);g.setRng(h)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(j){var g=this,h,i;if(j&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():g.win.document.createRange())}}catch(f){}if(!i){i=a?g.win.document.body.createTextRange():g.win.document.createRange()}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){h.removeAllRanges();h.addRange(i)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var g=this,f=g.getRng(),h=g.getSel(),i;if(!a){if(!f){return g.dom.getRoot()}i=f.commonAncestorContainer;if(!f.collapsed){if(f.startContainer==f.endContainer){if(f.startOffset-f.endOffset<2){if(f.startContainer.hasChildNodes()){i=f.startContainer.childNodes[f.startOffset]}}}if(c.isWebKit&&h.anchorNode&&h.anchorNode.nodeType==1){return h.anchorNode.childNodes[h.anchorOffset]}}if(i&&i.nodeType==3){return i.parentNode}return i}return f.item?f.item(0):f.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}}})})(tinymce);(function(a){a.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(c){function b(){var e=document.implementation;if(!e||!e.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(d){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(d){}}else{return e.createDocument("","",null)}}this.doc=b();this.valid=a.isOpera||a.isWebKit;this.reset()},reset:function(){var b=this,c=b.doc;if(c.firstChild){c.removeChild(c.firstChild)}b.node=c.appendChild(c.createElement("html"))},writeStartElement:function(c){var b=this;b.node=b.node.appendChild(b.doc.createElement(c))},writeAttribute:function(c,b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.setAttribute(c,b)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var b=this,c=b.node;c.appendChild(b.doc.createTextNode(""));b.node=c.parentNode},writeText:function(b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(b))},writeCDATA:function(b){this.node.appendChild(this.doc.createCDATASection(b))},writeComment:function(b){if(a.isIE){b=b.replace(/^\-|\-$/g," ")}this.node.appendChild(this.doc.createComment(b.replace(/\-\-/g," ")))},getContent:function(){var b;b=this.doc.xml||new XMLSerializer().serializeToString(this.doc);b=b.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,"&gt;")}return b}})})(tinymce);(function(a){a.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(b){this.settings=a.extend({indent_char:" ",indentation:0},b);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(b){this._writeAttributesEnd();this.writeRaw("<"+b);this.tags.push(b);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(d,b){var c=this;c.writeRaw(" "+c.encode(d)+'="'+c.encode(b)+'"')},writeEndElement:function(){var b;if(this.tags.length>0){b=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("</"+b+">")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("</"+this.tags.pop()+">");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(b){this._writeAttributesEnd();this.writeRaw(this.encode(b));this.count++},writeCDATA:function(b){this._writeAttributesEnd();this.writeRaw("<![CDATA["+b+"]]>");this.count++},writeComment:function(b){this._writeAttributesEnd();this.writeRaw("<!-- "+b+"-->");this.count++},writeRaw:function(b){this.str+=b},encode:function(b){return b.replace(/[<>&"]/g,function(c){switch(c){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";case'"':return"&quot;"}return c})},getContent:function(){return this.str},_writeAttributesEnd:function(b){if(!this.inAttr){return}this.inAttr=false;if(b&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})(tinymce);(function(e){var g=e.extend,f=e.each,b=e.util.Dispatcher,d=e.isIE,a=e.isGecko;function c(h){return h.replace(/([?+*])/g,".$1")}e.create("tinymce.dom.Serializer",{Serializer:function(j){var i=this;i.key=0;i.onPreProcess=new b(i);i.onPostProcess=new b(i);try{i.writer=new e.dom.XMLWriter()}catch(h){i.writer=new e.dom.StringWriter()}i.settings=j=g({dom:e.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(_mce_|_moz_|sizset|sizcache)/,closed:/^(br|hr|input|meta|img|link|param|area)$/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",valid_elements:"*[*]",extended_valid_elements:0,invalid_elements:0,fix_table_elements:1,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:"xhtml"},j);i.dom=j.dom;i.schema=j.schema;if(j.entity_encoding=="named"&&!j.entities){j.entity_encoding="raw"}if(j.remove_redundant_brs){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^<br \/>\s*<\//.test(n)){return"</"+o+">"}return n})})}if(j.element_format=="html"){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/<([^>]+) \/>/g,"<$1>")})}if(j.fix_list_elements){i.onPreProcess.add(function(v,s){var l,z,y=["ol","ul"],u,t,q,k=/^(OL|UL)$/,A;function m(r,x){var o=x.split(","),p;while((r=r.previousSibling)!=null){for(p=0;p<o.length;p++){if(r.nodeName==o[p]){return r}}}return null}for(z=0;z<y.length;z++){l=i.dom.select(y[z],s.node);for(u=0;u<l.length;u++){t=l[u];q=t.parentNode;if(k.test(q.nodeName)){A=m(t,"LI");if(!A){A=i.dom.create("li");A.innerHTML="&nbsp;";A.appendChild(t);q.insertBefore(A,q.firstChild)}else{A.appendChild(t)}}}}})}if(j.fix_table_elements){i.onPreProcess.add(function(k,l){if(!e.isOpera||opera.buildNumber()>=1767){f(i.dom.select("p table",l.node).reverse(),function(p){var o=i.dom.getParent(p.parentNode,"table,p");if(o.nodeName!="TABLE"){try{i.dom.split(o,p)}catch(m){}}})}})}},setEntities:function(o){var n=this,j,m,h={},k;if(n.entityLookup){return}j=o.split(",");for(m=0;m<j.length;m+=2){k=j[m];if(k==34||k==38||k==60||k==62){continue}h[String.fromCharCode(j[m])]=j[m+1];k=parseInt(j[m]).toString(16)}n.entityLookup=h},setRules:function(i){var h=this;h._setup();h.rules={};h.wildRules=[];h.validElements={};return h.addRules(i)},addRules:function(i){var h=this,j;if(!i){return}h._setup();f(i.split(","),function(m){var q=m.split(/\[|\]/),l=q[0].split("/"),r,k,o,n=[];if(j){k=e.extend([],j.attribs)}if(q.length>1){f(q[1].split("|"),function(u){var p={},t;k=k||[];u=u.replace(/::/g,"~");u=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(u);u[2]=u[2].replace(/~/g,":");if(u[1]=="!"){r=r||[];r.push(u[2])}if(u[1]=="-"){for(t=0;t<k.length;t++){if(k[t].name==u[2]){k.splice(t,1);return}}}switch(u[3]){case"=":p.defaultVal=u[4]||"";break;case":":p.forcedVal=u[4];break;case"<":p.validVals=u[4].split("?");break}if(/[*.?]/.test(u[2])){o=o||[];p.nameRE=new RegExp("^"+c(u[2])+"$");o.push(p)}else{p.name=u[2];k.push(p)}n.push(u[2])})}f(l,function(v,u){var y=v.charAt(0),t=1,p={};if(j){if(j.noEmpty){p.noEmpty=j.noEmpty}if(j.fullEnd){p.fullEnd=j.fullEnd}if(j.padd){p.padd=j.padd}}switch(y){case"-":p.noEmpty=true;break;case"+":p.fullEnd=true;break;case"#":p.padd=true;break;default:t=0}l[u]=v=v.substring(t);h.validElements[v]=1;if(/[*.?]/.test(l[0])){p.nameRE=new RegExp("^"+c(l[0])+"$");h.wildRules=h.wildRules||{};h.wildRules.push(p)}else{p.name=l[0];if(l[0]=="@"){j=p}h.rules[v]=p}p.attribs=k;if(r){p.requiredAttribs=r}if(o){v="";f(n,function(s){if(v){v+="|"}v+="("+c(s)+")"});p.validAttribsRE=new RegExp("^"+v.toLowerCase()+"$");p.wildAttribs=o}})});i="";f(h.validElements,function(m,l){if(i){i+="|"}if(l!="@"){i+=l}});h.validElementsRE=new RegExp("^("+c(i.toLowerCase())+")$")},findRule:function(m){var j=this,l=j.rules,h,k;j._setup();k=l[m];if(k){return k}l=j.wildRules;for(h=0;h<l.length;h++){if(l[h].nameRE.test(m)){return l[h]}}return null},findAttribRule:function(h,l){var j,k=h.wildAttribs;for(j=0;j<k.length;j++){if(k[j].nameRE.test(l)){return k[j]}}return null},serialize:function(r,q){var m,k=this,p,i,j,l;k._setup();q=q||{};q.format=q.format||"html";k.processObj=q;if(d){l=[];f(r.getElementsByTagName("option"),function(o){var h=k.dom.getAttrib(o,"selected");l.push(h?h:null)})}r=r.cloneNode(true);if(d){f(r.getElementsByTagName("option"),function(o,h){k.dom.setAttrib(o,"selected",l[h])})}j=r.ownerDocument.implementation;if(j.createHTMLDocument&&(e.isOpera&&opera.buildNumber()>=1767)){p=j.createHTMLDocument("");f(r.nodeName=="BODY"?r.childNodes:[r],function(h){p.body.appendChild(p.importNode(h,true))});if(r.nodeName!="BODY"){r=p.body.firstChild}else{r=p.body}i=k.dom.doc;k.dom.doc=p}k.key=""+(parseInt(k.key)+1);if(!q.no_events){q.node=r;k.onPreProcess.dispatch(k,q)}k.writer.reset();k._info=q;k._serializeNode(r,q.getInner);q.content=k.writer.getContent();if(i){k.dom.doc=i}if(!q.no_events){k.onPostProcess.dispatch(k,q)}k._postProcess(q);q.node=null;return e.trim(q.content)},_postProcess:function(n){var i=this,k=i.settings,j=n.content,m=[],l;if(n.format=="html"){l=i._protect({content:j,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<noscript[^>]*>)(.*?)(<\/noscript>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/(<!--\[CDATA\[)(.*?)(\]\]-->)/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=j.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?"<p$1>&#160;</p>":"<p$1>&nbsp;</p>");if(k.remove_linebreaks){j=j.replace(/\r?\n|\r/g," ");j=j.replace(/(<[^>]+>)\s+/g,"$1 ");j=j.replace(/\s+(<\/[^>]+>)/g," $1");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>");j=j.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"</$1>")}if(k.apply_source_formatting&&k.indent_mode=="simple"){j=j.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");j=j.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");j=j.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"</$1>\n");j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=j.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g,"<![CDATA[$1]]>");if(k.entity_encoding=="raw"){j=j.replace(/<p>&nbsp;<\/p>|<p([^>]+)>&nbsp;<\/p>/g,"<p$1>\u00a0</p>")}j=j.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(h,p,o){return"<noscript"+p+">"+i.dom.decode(o.replace(/<!--|-->/g,""))+"</noscript>"})}n.content=j},_serializeNode:function(D,I){var z=this,A=z.settings,x=z.writer,q,j,u,F,E,H,B,h,y,k,r,C,p,m,G,o;if(!A.node_filter||A.node_filter(D)){switch(D.nodeType){case 1:if(D.hasAttribute?D.hasAttribute("_mce_bogus"):D.getAttribute("_mce_bogus")){return}p=G=false;q=D.hasChildNodes();k=D.getAttribute("_mce_name")||D.nodeName.toLowerCase();o=D.getAttribute("_mce_type");if(o){if(!z._info.cleanup){p=true;return}else{G=1}}if(d){if(D.scopeName!=="HTML"&&D.scopeName!=="html"){k=D.scopeName+":"+k}}if(k.indexOf("mce:")===0){k=k.substring(4)}if(!G){if(!z.validElementsRE||!z.validElementsRE.test(k)||(z.invalidElementsRE&&z.invalidElementsRE.test(k))||I){p=true;break}}if(d){if(A.fix_content_duplication){if(D._mce_serialized==z.key){return}D._mce_serialized=z.key}if(k.charAt(0)=="/"){k=k.substring(1)}}else{if(a){if(D.nodeName==="BR"&&D.getAttribute("type")=="_moz"){return}}}if(A.validate_children){if(z.elementName&&!z.schema.isValid(z.elementName,k)){p=true;break}z.elementName=k}r=z.findRule(k);k=r.name||k;m=A.closed.test(k);if((!q&&r.noEmpty)||(d&&!k)){p=true;break}if(r.requiredAttribs){H=r.requiredAttribs;for(F=H.length-1;F>=0;F--){if(this.dom.getAttrib(D,H[F])!==""){break}}if(F==-1){p=true;break}}x.writeStartElement(k);if(r.attribs){for(F=0,B=r.attribs,E=B.length;F<E;F++){H=B[F];y=z._getAttrib(D,H);if(y!==null){x.writeAttribute(H.name,y)}}}if(r.validAttribsRE){B=z.dom.getAttribs(D);for(F=B.length-1;F>-1;F--){h=B[F];if(h.specified){H=h.nodeName.toLowerCase();if(A.invalid_attrs.test(H)||!r.validAttribsRE.test(H)){continue}C=z.findAttribRule(r,H);y=z._getAttrib(D,C,H);if(y!==null){x.writeAttribute(H,y)}}}}if(o&&G){x.writeAttribute("_mce_type",o)}if(k==="script"&&e.trim(D.innerHTML)){x.writeText("// ");x.writeCDATA(D.innerHTML.replace(/<!--|-->|<\[CDATA\[|\]\]>/g,""));q=false;break}if(r.padd){if(q&&(u=D.firstChild)&&u.nodeType===1&&D.childNodes.length===1){if(u.hasAttribute?u.hasAttribute("_mce_bogus"):u.getAttribute("_mce_bogus")){x.writeText("\u00a0")}}else{if(!q){x.writeText("\u00a0")}}}break;case 3:if(A.validate_children&&z.elementName&&!z.schema.isValid(z.elementName,"#text")){return}return x.writeText(D.nodeValue);case 4:return x.writeCDATA(D.nodeValue);case 8:return x.writeComment(D.nodeValue)}}else{if(D.nodeType==1){q=D.hasChildNodes()}}if(q&&!m){u=D.firstChild;while(u){z._serializeNode(u);z.elementName=k;u=u.nextSibling}}if(!p){if(!m){x.writeFullEndElement()}else{x.writeEndElement()}}},_protect:function(j){var i=this;j.items=j.items||[];function h(l){return l.replace(/[\r\n\\]/g,function(m){if(m==="\n"){return"\\n"}else{if(m==="\\"){return"\\\\"}}return"\\r"})}function k(l){return l.replace(/\\[\\rn]/g,function(m){if(m==="\\n"){return"\n"}else{if(m==="\\\\"){return"\\"}}return"\r"})}f(j.patterns,function(l){j.content=k(h(j.content).replace(l.pattern,function(n,o,m,p){m=k(m);if(l.encode){m=i._encode(m)}j.items.push(m);return o+"<!--mce:"+(j.items.length-1)+"-->"+p}))});return j},_unprotect:function(i,j){i=i.replace(/\<!--mce:([0-9]+)--\>/g,function(k,h){return j.items[parseInt(h)]});j.items=[];return i},_encode:function(m){var j=this,k=j.settings,i;if(k.entity_encoding!=="raw"){if(k.entity_encoding.indexOf("named")!=-1){j.setEntities(k.entities);i=j.entityLookup;m=m.replace(/[\u007E-\uFFFF]/g,function(h){var l;if(l=i[h]){h="&"+l+";"}return h})}if(k.entity_encoding.indexOf("numeric")!=-1){m=m.replace(/[\u007E-\uFFFF]/g,function(h){return"&#"+h.charCodeAt(0)+";"})}}return m},_setup:function(){var h=this,i=this.settings;if(h.done){return}h.done=1;h.setRules(i.valid_elements);h.addRules(i.extended_valid_elements);if(i.invalid_elements){h.invalidElementsRE=new RegExp("^("+c(i.invalid_elements.replace(/,/g,"|").toLowerCase())+")$")}if(i.attrib_value_filter){h.attribValueFilter=i.attribValueFilter}},_getAttrib:function(m,j,h){var l,k;h=h||j.name;if(j.forcedVal&&(k=j.forcedVal)){if(k==="{$uid}"){return this.dom.uniqueId()}return k}k=this.dom.getAttrib(m,h);switch(h){case"rowspan":case"colspan":if(k=="1"){k=""}break}if(this.attribValueFilter){k=this.attribValueFilter(h,k,m)}if(j.validVals){for(l=j.validVals.length-1;l>=0;l--){if(k==j.validVals[l]){break}}if(l==-1){return null}}if(k===""&&typeof(j.defaultVal)!="undefined"){k=j.defaultVal;if(k==="{$uid}"){return this.dom.uniqueId()}return k}else{if(h=="class"&&this.processObj.get){k=k.replace(/\s?mceItem\w+\s?/g,"")}}if(k===""){return null}return k}})})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],f={},d=[],g=0,e;function b(m,u){var v=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}u()}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(x){var t=q.create("script",{type:"text/javascript"});t.text=x;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()}});return}}s=q.create("script",{id:n,type:"text/javascript",src:a._addVer(m)});s.onload=p;s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}};(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==e){j.push(m);l[m]=c}if(q){if(!f[m]){f[m]=[]}f[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(f[r],function(s){s.func.call(s.scope)});f[r]=e}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);tinymce.dom.TreeWalker=function(a,c){var b=a;function d(i,f,e,j){var h,g;if(i){if(!j&&i[f]){return i[f]}if(i!=c){h=i[e];if(h){return h}for(g=i.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","lastSibling",e))}};(function(){var a={};function b(f,e){var d;function c(g){return g.replace(/[A-Z]+/g,function(h){return c(f[h])})}for(d in f){if(f.hasOwnProperty(d)){f[d]=c(f[d])}}c(e).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]/g,function(l,g,j){var h,k={};j=j.split(/\|/);for(h=j.length-1;h>=0;h--){k[j[h]]=1}a[g]=k})}b({Z:"#|H|K|N|O|P",Y:"#|X|form|R|Q",X:"p|T|div|U|W|isindex|fieldset|table",W:"pre|hr|blockquote|address|center|noframes",U:"ul|ol|dl|menu|dir",ZC:"#|p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"#|X|S|Q",S:"R|P",ZA:"#|a|G|J|M|O|P",R:"#|a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe"},"script[]style[]object[#|param|X|form|a|H|K|N|O|Q]param[]p[S]a[Z]br[]span[S]bdo[S]applet[#|param|X|form|a|H|K|N|O|Q]h1[S]img[]map[X|form|Q|area]h2[S]iframe[#|X|form|a|H|K|N|O|Q]h3[S]tt[S]i[S]b[S]u[S]s[S]strike[S]big[S]small[S]font[S]basefont[]em[S]strong[S]dfn[S]code[S]q[S]samp[S]kbd[S]var[S]cite[S]abbr[S]acronym[S]sub[S]sup[S]input[]select[optgroup|option]optgroup[option]option[]textarea[]label[S]button[#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[S]ins[#|X|form|a|H|K|N|O|Q]h5[S]del[#|X|form|a|H|K|N|O|Q]h6[S]div[#|X|form|a|H|K|N|O|Q]ul[li]li[#|X|form|a|H|K|N|O|Q]ol[li]dl[dt|dd]dt[S]dd[#|X|form|a|H|K|N|O|Q]menu[li]dir[li]pre[ZA]hr[]blockquote[#|X|form|a|H|K|N|O|Q]address[S|p]center[#|X|form|a|H|K|N|O|Q]noframes[#|X|form|a|H|K|N|O|Q]isindex[]fieldset[#|legend|X|form|a|H|K|N|O|Q]legend[S]table[caption|col|colgroup|thead|tfoot|tbody|tr]caption[S]col[]colgroup[col]thead[tr]tr[th|td]th[#|X|form|a|H|K|N|O|Q]form[#|X|a|H|K|N|O|Q]noscript[#|X|form|a|H|K|N|O|Q]td[#|X|form|a|H|K|N|O|Q]tfoot[tr]tbody[tr]area[]base[]body[#|X|form|a|H|K|N|O|Q]");tinymce.dom.Schema=function(){var c=this,d=a;c.isValid=function(f,e){var g=d[f];return !!(g&&(!e||g[e]))}}})();(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,r){var h=d.startContainer,k=d.startOffset,s=d.endContainer,l=d.endOffset,i,f,n,g,q,p,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(t){r([t])});return}function o(v,u,t){var x=[];for(;v&&v!=t;v=v[u]){x.push(v)}return x}function m(u,t){do{if(u.parentNode==t){return u}u=u.parentNode}while(u)}function j(v,u,x){var t=x?"nextSibling":"previousSibling";for(g=v,q=g.parentNode;g&&g!=u;g=q){q=g.parentNode;p=o(g==v?g:g[t],t);if(p.length){if(!x){p.reverse()}r(p)}}}if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[k]}if(s.nodeType==1&&s.hasChildNodes()){s=s.childNodes[Math.min(k==l?l:l-1,s.childNodes.length-1)]}i=c.findCommonAncestor(h,s);if(h==s){return r([h])}for(g=h;g;g=g.parentNode){if(g==s){return j(h,i,true)}if(g==i){break}}for(g=s;g;g=g.parentNode){if(g==h){return j(s,i)}if(g==i){break}}f=m(h,i)||h;n=m(s,i)||s;j(h,f,true);p=o(f==h?f:f.nextSibling,"nextSibling",n==s?n.nextSibling:n);if(p.length){r(p)}j(s,n)}}})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(e,d){this.id=e;this.settings=d=d||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=d.scope||this;this.disabled=0;this.active=0},setDisabled:function(d){var f;if(d!=this.disabled){f=b.get(this.id);if(f&&this.settings.unavailable_prefix){if(d){this.prevTitle=f.title;f.title=this.settings.unavailable_prefix+": "+f.title}else{f.title=this.prevTitle}}this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(b,a){this.parent(b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator"},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}z.onShowMenu.dispatch(z);if(A.keyboard_focus){a.add(o,"keydown",z._keyHandler,z);c.select("a","menu_"+z.id)[0].focus();z._focusIdx=0}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);a.remove(h,"mouseover",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000"});k=c.add(g,"div",{id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_keyHandler:function(j){var i=this,h=j.keyCode;function g(m){var k=i._focusIdx+m,l=c.select("a","menu_"+i.id)[k];if(l){i._focusIdx=k;l.focus()}}switch(h){case 38:g(-1);return;case 40:g(1);return;case 13:return;case 27:return this.hideMenu()}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,"td");i=p=c.add(i,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(d,c){this.parent(d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+a.encode(e.title)+'">';if(e.image){d+='<img class="mceIcon" src="'+e.image+'" />'+c+"</a>"}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")+"</a>"}return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(h,g){var f=this;f.parent(h,g);f.items=[];f.onChange=new a(f);f.onPostRender=new a(f);f.onAdd=new a(f);f.onRenderMenu=new d.util.Dispatcher(this);f.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var g=this,h,i;if(f!=g.selectedIndex){h=c.get(g.id+"_text");i=g.items[f];if(i){g.selectedValue=i.value;g.selectedIndex=f;c.setHTML(h,c.encode(i.title));c.removeClass(h,"mceTitle")}else{c.setHTML(h,c.encode(g.settings.title));c.addClass(h,"mceTitle");g.selectedValue=g.selectedIndex=null}h=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='<table id="'+f.id+'" cellpadding="0" cellspacing="0" class="'+j+" "+j+"Enabled"+(g["class"]?(" "+g["class"]):"")+'"><tbody><tr>';i+="<td>"+c.createHTML("a",{id:f.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},c.encode(f.settings.title))+"</td>";i+="<td>"+c.createHTML("a",{id:f.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";i+="</tr></tbody></table>";return i},showMenu:function(){var g=this,j,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}j=c.getPos(this.settings.menu_container);i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(k){if(k.value===g.selectedValue){f.items[k.id].setSelected(1);g.oldID=k.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(f.menu&&f.menu.isMenuVisible){if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(g.hideMenu,g);f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){if(h.value===undefined){f.add({title:h.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}})}else{h.id=c.uniqueId();h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)}});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id+"_text","focus",function(h){if(!f._focused){f.keyDownHandler=b.add(f.id+"_text","keydown",function(l){var i=-1,j,k=l.keyCode;e(f.items,function(m,n){if(f.selectedValue==m.value){i=n}});if(k==38){j=f.items[i-1]}else{if(k==40){j=f.items[i+1]}else{if(k==13){j=f.selectedValue;f.selectedValue=null;f.settings.onselect(j);return b.cancel(l)}}}if(j){f.hideMenu();f.select(j.value)}})}f._focused=1});b.add(f.id+"_text","blur",function(){b.remove(f.id+"_text","keydown",f.keyDownHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return c.get(this.id).options.length-1},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox"},g);return g},postRender:function(){var g=this,h;g.rendered=true;function f(j){var i=g.items[j.target.selectedIndex-1];if(i&&(i=i.value)){g.onChange.dispatch(g,i);if(g.settings.onselect){g.settings.onselect(i)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(j){var i;b.remove(g.id,"change",h);i=b.add(g.id,"blur",function(){b.add(g.id,"change",f);b.remove(g.id,"blur",i)});if(j.keyCode==13||j.keyCode==32){f(j);return b.cancel(j)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(f,e){this.parent(f,e);this.onRenderMenu=new c.util.Dispatcher(this);e.menu_container=e.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(f.hideMenu,f);f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(f,e){this.parent(f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,"class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}i+="<td>"+b.createHTML("a",{id:f.id+"_action",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]});i+="<td>"+b.createHTML("a",{id:f.id+"_open",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";return b.createHTML("table",{id:f.id,"class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:g.title},i)},postRender:function(){var e=this,f=e.settings;if(f.onclick){a.add(e.id+"_action","click",function(){if(!e.isDisabled()){f.onclick(e.value)}})}a.add(e.id+"_open","click",e.showMenu,e);a.add(e.id+"_open","focus",function(){e._focused=1});a.add(e.id+"_open","blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(h,g){var f=this;f.parent(h,g);f.settings=g=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},f.settings);f.onShowMenu=new d.util.Dispatcher(f);f.onHideMenu=new d.util.Dispatcher(f);f.value=g.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.onHideMenu.dispatch(f);f.isMenuVisible=0},renderMenu:function(){var k=this,f,j=0,l=k.settings,p,h,o,g;g=c.add(l.menu_container,"div",{id:k.id+"_menu","class":l.menu_class+" "+l["class"],style:"position:absolute;left:0;top:-1000px;"});f=c.add(g,"div",{"class":l["class"]+" mceSplitButtonMenu"});c.add(f,"span",{"class":"mceMenuLine"});p=c.add(f,"table",{"class":"mceColorSplitMenu"});h=c.add(p,"tbody");j=0;e(b(l.colors,"array")?l.colors:l.colors.split(","),function(i){i=i.replace(/^#/,"");if(!j--){o=c.add(h,"tr");j=l.grid_width-1}p=c.add(o,"td");p=c.add(p,"a",{href:"javascript:;",style:{backgroundColor:"#"+i},_mce_color:"#"+i})});if(l.more_colors_func){p=c.add(h,"tr");p=c.add(p,"td",{colspan:l.grid_width,"class":"mceMoreColors"});p=c.add(p,"a",{id:k.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},l.more_colors_title);a.add(p,"click",function(i){l.more_colors_func.call(l.more_colors_scope||this);return a.cancel(i)})}c.addClass(f,"mceColorSplitMenu");a.add(k.id+"_menu","click",function(i){var m;i=i.target;if(i.nodeName=="A"&&(m=i.getAttribute("_mce_color"))){k.setColor(m)}return a.cancel(i)});return g},setColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g;f.hideMenu();f.settings.onselect(g)},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var l=this,e="",g,j,b=tinymce.DOM,m=l.settings,d,a,f,k;k=l.controls;for(d=0;d<k.length;d++){j=k[d];a=k[d-1];f=k[d+1];if(d===0){g="mceToolbarStart";if(j.Button){g+=" mceToolbarStartButton"}else{if(j.SplitButton){g+=" mceToolbarStartSplitButton"}else{if(j.ListBox){g+=" mceToolbarStartListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,"<!-- IE -->"))}}if(b.stdMode){e+='<td style="position: relative">'+j.renderHTML()+"</td>"}else{e+="<td>"+j.renderHTML()+"</td>"}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,"<!-- IE -->"))}}}g="mceToolbarEnd";if(j.Button){g+=" mceToolbarEndButton"}else{if(j.SplitButton){g+=" mceToolbarEndSplitButton"}else{if(j.ListBox){g+=" mceToolbarEndListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},"<tbody><tr>"+e+"</tr></tbody>")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{items:[],urls:{},lookup:{},onAdd:new a(this),get:function(d){return this.lookup[d]},requireLangPack:function(e){var d=b.settings;if(d&&d.language){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(e,d){this.items.push(d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));b.ScriptLoader.add(e,d,g)}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(q){var n=this,p,l=j.ScriptLoader,u,o=[],m;function r(x,y,t){var v=x[y];if(!v){return}if(j.is(v,"string")){t=v.replace(/\.\w+$/,"");t=t?j.resolve(t):0;v=j.resolve(v)}return v.apply(t||this,Array.prototype.slice.call(arguments,2))}q=d({theme:"simple",language:"en"},q);n.settings=q;i.add(document,"init",function(){var s,v;r(q,"onpageload");switch(q.mode){case"exact":s=q.elements||"";if(s.length>0){g(e(s),function(x){if(k.get(x)){m=new j.Editor(x,q);o.push(m);m.render(1)}else{g(document.forms,function(y){g(y.elements,function(z){if(z.name===x){x="mce_editor_"+c++;k.setAttrib(z,"id",x);m=new j.Editor(x,q);o.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function t(y,x){return x.constructor===RegExp?x.test(y.className):k.hasClass(y,x)}g(k.select("textarea"),function(x){if(q.editor_deselector&&t(x,q.editor_deselector)){return}if(!q.editor_selector||t(x,q.editor_selector)){u=k.get(x.name);if(!x.id&&!u){x.id=x.name}if(!x.id||n.get(x.id)){x.id=k.uniqueId()}m=new j.Editor(x.id,q);o.push(m);m.render(1)}});break}if(q.oninit){s=v=0;g(o,function(x){v++;if(!x.initialized){x.onInit.add(function(){s++;if(s==v){r(q,"oninit")}})}else{s++}if(s==v){r(q,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l<o.length;l++){if(o[l]==n){o.splice(l,1);break}}if(m.activeEditor==n){m._setActive(o[0])}n.destroy();m.onRemoveEditor.dispatch(m,n);return n},execCommand:function(r,p,o){var q=this,n=q.get(o),l;switch(r){case"mceFocus":n.focus();return true;case"mceAddEditor":case"mceAddControl":if(!q.get(o)){new j.Editor(o,q.settings).render()}return true;case"mceAddFrameControl":l=o.window;l.tinyMCE=tinyMCE;l.tinymce=j;j.DOM.doc=l.document;j.DOM.win=l;n=new j.Editor(o.element_id,o);n.render();if(j.isIE){function m(){n.destroy();l.detachEvent("onunload",m);l=l.tinyMCE=l.tinymce=null}l.attachEvent("onunload",m)}o.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(n){n.remove()}return true;case"mceToggleEditor":if(!n){q.execCommand("mceAddControl",0,o);return true}if(n.isHidden()){n.show()}else{n.hide()}return true}if(q.activeEditor){return q.activeEditor.execCommand(r,p,o)}return false},execInstanceCommand:function(p,o,n,m){var l=this.get(p);if(l){return l.execCommand(o,n,m)}return false},triggerSave:function(){g(this.editors,function(l){l.save()})},addI18n:function(n,q){var l,m=this.i18n;if(!j.is(n,"string")){g(n,function(r,p){g(r,function(t,s){g(t,function(v,u){if(s==="common"){m[p+"."+u]=v}else{m[p+"."+s+"."+u]=v}})})})}else{g(q,function(r,p){m[n+"."+p]=r})}},_setActive:function(l){this.selectedInstance=this.activeEditor=l}})})(tinymce);(function(m){var n=m.DOM,j=m.dom.Event,f=m.extend,k=m.util.Dispatcher,i=m.each,a=m.isGecko,b=m.isIE,e=m.isWebKit,d=m.is,h=m.ThemeManager,c=m.PluginManager,o=m.inArray,l=m.grep,g=m.explode;m.create("tinymce.Editor",{Editor:function(r,q){var p=this;p.id=p.editorId=r;p.execCommands={};p.queryStateCommands={};p.queryValueCommands={};p.isNotDirty=false;p.plugins={};i(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(s){p[s]=new k(p)});p.settings=q=f({id:r,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:m.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:m.isIE6?'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">':"<!DOCTYPE>",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,inline_styles:1,convert_fonts_to_spans:true},q);p.documentBaseURI=new m.util.URI(q.document_base_url||m.documentBaseURL,{base_uri:tinyMCE.baseURI});p.baseURI=m.baseURI;p.execCallback("setup",p)},render:function(r){var u=this,v=u.settings,x=u.id,p=m.ScriptLoader;if(!j.domLoaded){j.add(document,"init",function(){u.render()});return}tinyMCE.settings=v;if(!u.getElement()){return}if(!/TEXTAREA|INPUT/i.test(u.getElement().nodeName)&&v.hidden_input&&n.getParent(x,"form")){n.insertAfter(n.create("input",{type:"hidden",name:x}),x)}if(m.WindowManager){u.windowManager=new m.WindowManager(u)}if(v.encoding=="xml"){u.onGetContent.add(function(s,t){if(t.save){t.content=n.encode(t.content)}})}if(v.add_form_submit_trigger){u.onSubmit.addToTop(function(){if(u.initialized){u.save();u.isNotDirty=1}})}if(v.add_unload_trigger){u._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(u.initialized&&!u.destroyed&&!u.isHidden()){u.save({format:"raw",no_events:true})}})}m.addUnload(u.destroy,u);if(v.submit_patch){u.onBeforeRenderUI.add(function(){var s=u.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){u.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){m.triggerSave();u.isNotDirty=1;return u.formElement._mceOldSubmit(u.formElement)}}s=null})}function q(){if(v.language){p.add(m.baseURL+"/langs/"+v.language+".js")}if(v.theme&&v.theme.charAt(0)!="-"&&!h.urls[v.theme]){h.load(v.theme,"themes/"+v.theme+"/editor_template"+m.suffix+".js")}i(g(v.plugins),function(s){if(s&&s.charAt(0)!="-"&&!c.urls[s]){if(s=="safari"){return}c.load(s,"plugins/"+s+"/editor_plugin"+m.suffix+".js")}});p.loadQueue(function(){if(!u.removed){u.init()}})}q()},init:function(){var r,E=this,F=E.settings,B,y,A=E.getElement(),q,p,C,x,z,D;m.add(E);if(F.theme){F.theme=F.theme.replace(/-/,"");q=h.get(F.theme);E.theme=new q();if(E.theme.init&&F.init_theme){E.theme.init(E,h.urls[F.theme]||m.documentBaseURL.replace(/\/$/,""))}}i(g(F.plugins.replace(/\-/g,"")),function(G){var H=c.get(G),t=c.urls[G]||m.documentBaseURL.replace(/\/$/,""),s;if(H){s=new H(E,t);E.plugins[G]=s;if(s.init){s.init(E,t)}}});if(F.popup_css!==false){if(F.popup_css){F.popup_css=E.documentBaseURI.toAbsolute(F.popup_css)}else{F.popup_css=E.baseURI.toAbsolute("themes/"+F.theme+"/skins/"+F.skin+"/dialog.css")}}if(F.popup_css_add){F.popup_css+=","+E.documentBaseURI.toAbsolute(F.popup_css_add)}E.controlManager=new m.ControlManager(E);if(F.custom_undo_redo){E.onBeforeExecCommand.add(function(t,G,u,H,s){if(G!="Undo"&&G!="Redo"&&G!="mceRepaint"&&(!s||!s.skip_undo)){if(!E.undoManager.hasUndo()){E.undoManager.add()}}});E.onExecCommand.add(function(t,G,u,H,s){if(G!="Undo"&&G!="Redo"&&G!="mceRepaint"&&(!s||!s.skip_undo)){E.undoManager.add()}})}E.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){E.nodeChanged()}});if(a){function v(s,t){if(!t||!t.initial){E.execCommand("mceRepaint")}}E.onUndo.add(v);E.onRedo.add(v);E.onSetContent.add(v)}E.onBeforeRenderUI.dispatch(E,E.controlManager);if(F.render_ui){B=F.width||A.style.width||A.offsetWidth;y=F.height||A.style.height||A.offsetHeight;E.orgDisplay=A.style.display;D=/^[0-9\.]+(|px)$/i;if(D.test(""+B)){B=Math.max(parseInt(B)+(q.deltaWidth||0),100)}if(D.test(""+y)){y=Math.max(parseInt(y)+(q.deltaHeight||0),100)}q=E.theme.renderUI({targetNode:A,width:B,height:y,deltaWidth:F.delta_width,deltaHeight:F.delta_height});E.editorContainer=q.editorContainer}if(document.domain&&location.hostname!=document.domain){m.relaxedDomain=document.domain}n.setStyles(q.sizeContainer||q.editorContainer,{width:B,height:y});y=(q.iframeHeight||y)+(typeof(y)=="number"?(q.deltaHeight||0):"");if(y<100){y=100}E.iframeHTML=F.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(F.document_base_url!=m.documentBaseURL){E.iframeHTML+='<base href="'+E.documentBaseURI.getURI()+'" />'}E.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(m.relaxedDomain){E.iframeHTML+='<script type="text/javascript">document.domain = "'+m.relaxedDomain+'";<\/script>'}x=F.body_id||"tinymce";if(x.indexOf("=")!=-1){x=E.getParam("body_id","","hash");x=x[E.id]||x}z=F.body_class||"";if(z.indexOf("=")!=-1){z=E.getParam("body_class","","hash");z=z[E.id]||""}E.iframeHTML+='</head><body id="'+x+'" class="mceContentBody '+z+'"></body></html>';if(m.relaxedDomain){if(b||(m.isOpera&&parseFloat(opera.version())>=9.5)){C='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+E.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}else{if(m.isOpera){C='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()'}}}r=n.add(q.iframeContainer,"iframe",{id:E.id+"_ifr",src:C||'javascript:""',frameBorder:"0",style:{width:"100%",height:y}});E.contentAreaContainer=q.iframeContainer;n.get(q.editorContainer).style.display=E.orgDisplay;n.get(E.id).style.display="none";if(!b||!m.relaxedDomain){E.setupIframe()}A=r=q=null},setupIframe:function(){var z=this,A=z.settings,r=n.get(z.id),u=z.getDoc(),q,x;if(!b||!m.relaxedDomain){u.open();u.write(z.iframeHTML);u.close()}if(!b){try{if(!A.readonly){u.designMode="On"}}catch(v){}}if(b){x=z.getBody();n.hide(x);if(!A.readonly){x.contentEditable=true}n.show(x)}z.dom=new m.dom.DOMUtils(z.getDoc(),{keep_values:true,url_converter:z.convertURL,url_converter_scope:z,hex_colors:A.force_hex_style_colors,class_filter:A.class_filter,update_styles:1,fix_ie_paragraphs:1,valid_styles:A.valid_styles});z.schema=new m.dom.Schema();z.serializer=new m.dom.Serializer(f(A,{valid_elements:A.verify_html===false?"*[*]":A.valid_elements,dom:z.dom,schema:z.schema}));z.selection=new m.dom.Selection(z.dom,z.getWin(),z.serializer);z.formatter=new m.Formatter(this);z.formatter.register({alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"}},{selector:"img,table",styles:{"float":"left"}}],aligncenter:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"}},{selector:"img",styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"}},{selector:"img,table",styles:{"float":"right"}}],alignfull:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"}}],bold:[{inline:"strong"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b"}],italic:[{inline:"em"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"u"}],forecolor:{inline:"span",styles:{color:"%value"}},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"}},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},blockquote:{block:"blockquote",wrapper:1},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],expand:false,deep:true}]});i("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(s){z.formatter.register(s,{block:s})});z.formatter.register(z.settings.formats);z.undoManager=new m.UndoManager(z);z.undoManager.onAdd.add(function(t,s){if(!s.initial){return z.onChange.dispatch(z,s,t)}});z.undoManager.onUndo.add(function(t,s){return z.onUndo.dispatch(z,s,t)});z.undoManager.onRedo.add(function(t,s){return z.onRedo.dispatch(z,s,t)});z.forceBlocks=new m.ForceBlocks(z,{forced_root_block:A.forced_root_block});z.editorCommands=new m.EditorCommands(z);z.serializer.onPreProcess.add(function(s,t){return z.onPreProcess.dispatch(z,t,s)});z.serializer.onPostProcess.add(function(s,t){return z.onPostProcess.dispatch(z,t,s)});z.onPreInit.dispatch(z);if(!A.gecko_spellcheck){z.getBody().spellcheck=0}if(!A.readonly){z._addEvents()}z.controlManager.onPostRender.dispatch(z,z.controlManager);z.onPostRender.dispatch(z);if(A.directionality){z.getBody().dir=A.directionality}if(A.nowrap){z.getBody().style.whiteSpace="nowrap"}if(A.custom_elements){function y(s,t){i(g(A.custom_elements),function(B){var C;if(B.indexOf("~")===0){B=B.substring(1);C="span"}else{C="div"}t.content=t.content.replace(new RegExp("<("+B+")([^>]*)>","g"),"<"+C+' _mce_name="$1"$2>');t.content=t.content.replace(new RegExp("</("+B+")>","g"),"</"+C+">")})}z.onBeforeSetContent.add(y);z.onPostProcess.add(function(s,t){if(t.set){y(s,t)}})}if(A.handle_node_change_callback){z.onNodeChange.add(function(t,s,B){z.execCallback("handle_node_change_callback",z.id,B,-1,-1,true,z.selection.isCollapsed())})}if(A.save_callback){z.onSaveContent.add(function(s,B){var t=z.execCallback("save_callback",z.id,B.content,z.getBody());if(t){B.content=t}})}if(A.onchange_callback){z.onChange.add(function(t,s){z.execCallback("onchange_callback",z,s)})}if(A.convert_newlines_to_brs){z.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"<br />")}})}if(A.fix_nesting&&b){z.onBeforeSetContent.add(function(s,t){t.content=z._fixNesting(t.content)})}if(A.preformatted){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*<pre.*?>/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='<pre class="mceItemHidden">'+t.content+"</pre>"}})}if(A.verify_css_classes){z.serializer.attribValueFilter=function(D,B){var C,t;if(D=="class"){if(!z.classesRE){t=z.dom.getClasses();if(t.length>0){C="";i(t,function(s){C+=(C?"|":"")+s["class"]});z.classesRE=new RegExp("("+C+")","gi")}}return !z.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(B)||z.classesRE.test(B)?B:""}return B}}if(A.cleanup_callback){z.onBeforeSetContent.add(function(s,t){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)});z.onPreProcess.add(function(s,t){if(t.set){z.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){z.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});z.onPostProcess.add(function(s,t){if(t.set){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=z.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(A.save_callback){z.onGetContent.add(function(s,t){if(t.save){t.content=z.execCallback("save_callback",z.id,t.content,z.getBody())}})}if(A.handle_event_callback){z.onEvent.add(function(s,t,B){if(z.execCallback("handle_event_callback",t,s,B)===false){j.cancel(t)}})}z.onSetContent.add(function(){z.addVisual(z.getBody())});if(A.padd_empty_editor){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(a){function p(s,t){i(s.dom.select("a"),function(C){var B=C.parentNode;if(s.dom.isBlock(B)&&B.lastChild===C){s.dom.add(B,"br",{_mce_bogus:1})}})}z.onExecCommand.add(function(s,t){if(t==="CreateLink"){p(s)}});z.onSetContent.add(z.selection.onSetContent.add(p));if(!A.readonly){try{u.designMode="Off";u.designMode="On"}catch(v){}}}setTimeout(function(){if(z.removed){return}z.load({initial:true,format:(A.cleanup_on_startup?"html":"raw")});z.startContent=z.getContent({format:"raw"});z.initialized=true;z.onInit.dispatch(z);z.execCallback("setupcontent_callback",z.id,z.getBody(),z.getDoc());z.execCallback("init_instance_callback",z);z.focus(true);z.nodeChanged({initial:1});if(A.content_css){m.each(g(A.content_css),function(s){z.dom.loadCSS(z.documentBaseURI.toAbsolute(s))})}if(A.auto_focus){setTimeout(function(){var s=m.get(A.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getWin().focus()},100)}},1);r=null},focus:function(q){var s,p=this,r=p.settings.content_editable;if(!q){if(!r&&(!b||p.selection.getNode().ownerDocument!=p.getDoc())){p.getWin().focus()}}if(m.activeEditor!=p){if((s=m.activeEditor)!=null){s.onDeactivate.dispatch(s,p)}p.onActivate.dispatch(p,s)}m._setActive(p)},execCallback:function(u){var p=this,r=p.settings[u],q;if(!r){return}if(p.callbackLookup&&(q=p.callbackLookup[u])){r=q.func;q=q.scope}if(d(r,"string")){q=r.replace(/\.\w+$/,"");q=q?m.resolve(q):0;r=m.resolve(r);p.callbackLookup=p.callbackLookup||{};p.callbackLookup[u]={func:r,scope:q}}return r.apply(q||p,Array.prototype.slice.call(arguments,1))},translate:function(p){var r=this.settings.language||"en",q=m.i18n;if(!p){return""}return q[r+"."+p]||p.replace(/{\#([^}]+)\}/g,function(t,s){return q[r+"."+s]||"{#"+s+"}"})},getLang:function(q,p){return m.i18n[(this.settings.language||"en")+"."+q]||(d(p)?p:"{#"+q+"}")},getParam:function(u,r,p){var s=m.trim,q=d(this.settings[u])?this.settings[u]:r,t;if(p==="hash"){t={};if(d(q,"string")){i(q.indexOf("=")>0?q.split(/[;,](?![^=;,]*(?:[;,]|$))/):q.split(","),function(x){x=x.split("=");if(x.length>1){t[s(x[0])]=s(x[1])}else{t[s(x[0])]=s(x)}})}else{t=q}return t}return q},nodeChanged:function(r){var p=this,q=p.selection,u=q.getNode()||p.getBody();if(p.initialized){r=r||{};u=b&&u.ownerDocument!=p.getDoc()?p.getBody():u;r.parents=[];p.dom.getParent(u,function(s){if(s.nodeName=="BODY"){return true}r.parents.push(s)});p.onNodeChange.dispatch(p,r?r.controlManager||p.controlManager:p.controlManager,u,q.isCollapsed(),r)}},addButton:function(r,q){var p=this;p.buttons=p.buttons||{};p.buttons[r]=q},addCommand:function(r,q,p){this.execCommands[r]={func:q,scope:p||this}},addQueryStateHandler:function(r,q,p){this.queryStateCommands[r]={func:q,scope:p||this}},addQueryValueHandler:function(r,q,p){this.queryValueCommands[r]={func:q,scope:p||this}},addShortcut:function(r,u,p,s){var q=this,v;if(!q.settings.custom_shortcuts){return false}q.shortcuts=q.shortcuts||{};if(d(p,"string")){v=p;p=function(){q.execCommand(v,false,null)}}if(d(p,"object")){v=p;p=function(){q.execCommand(v[0],v[1],v[2])}}i(g(r),function(t){var x={func:p,scope:s||this,desc:u,alt:false,ctrl:false,shift:false};i(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});q.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=x});return true},execCommand:function(x,v,z,p){var r=this,u=0,y,q;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!p||!p.skip_focus)){r.focus()}y={};r.onBeforeExecCommand.dispatch(r,x,v,z,y);if(y.terminate){return false}if(r.execCallback("execcommand_callback",r.id,r.selection.getNode(),x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(y=r.execCommands[x]){q=y.func.call(y.scope,v,z);if(q!==true){r.onExecCommand.dispatch(r,x,v,z,p);return q}}i(r.plugins,function(s){if(s.execCommand&&s.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);u=1;return false}});if(u){return true}if(r.theme&&r.theme.execCommand&&r.theme.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(m.GlobalCommands.execCommand(r,x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(r.editorCommands.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}r.getDoc().execCommand(x,v,z);r.onExecCommand.dispatch(r,x,v,z,p)},queryCommandState:function(u){var q=this,v,r;if(q._isHidden()){return}if(v=q.queryStateCommands[u]){r=v.func.call(v.scope);if(r!==true){return r}}v=q.editorCommands.queryCommandState(u);if(v!==-1){return v}try{return this.getDoc().queryCommandState(u)}catch(p){}},queryCommandValue:function(v){var q=this,u,r;if(q._isHidden()){return}if(u=q.queryValueCommands[v]){r=u.func.call(u.scope);if(r!==true){return r}}u=q.editorCommands.queryCommandValue(v);if(d(u)){return u}try{return this.getDoc().queryCommandValue(v)}catch(p){}},show:function(){var p=this;n.show(p.getContainer());n.hide(p.id);p.load()},hide:function(){var p=this,q=p.getDoc();if(b&&q){q.execCommand("SelectAll")}p.save();n.hide(p.getContainer());n.setStyle(p.id,"display",p.orgDisplay)},isHidden:function(){return !n.isHidden(this.id)},setProgressState:function(p,q,r){this.onSetProgressState.dispatch(this,p,q,r);return p},load:function(s){var p=this,r=p.getElement(),q;if(r){s=s||{};s.load=true;q=p.setContent(d(r.value)?r.value:r.innerHTML,s);s.element=r;if(!s.no_events){p.onLoadContent.dispatch(p,s)}s.element=r=null;return q}},save:function(u){var p=this,s=p.getElement(),q,r;if(!s||!p.initialized){return}u=u||{};u.save=true;if(!u.no_events){p.undoManager.typing=0;p.undoManager.add()}u.element=s;q=u.content=p.getContent(u);if(!u.no_events){p.onSaveContent.dispatch(p,u)}q=u.content;if(!/TEXTAREA|INPUT/i.test(s.nodeName)){s.innerHTML=q;if(r=n.getParent(p.id,"form")){i(r.elements,function(t){if(t.name==p.id){t.value=q;return false}})}}else{s.value=q}u.element=s=null;return q},setContent:function(q,r){var p=this;r=r||{};r.format=r.format||"html";r.set=true;r.content=q;if(!r.no_events){p.onBeforeSetContent.dispatch(p,r)}if(!m.isIE&&(q.length===0||/^\s+$/.test(q))){r.content=p.dom.setHTML(p.getBody(),'<br _mce_bogus="1" />');r.format="raw"}r.content=p.dom.setHTML(p.getBody(),m.trim(r.content));if(r.format!="raw"&&p.settings.cleanup){r.getInner=true;r.content=p.dom.setHTML(p.getBody(),p.serializer.serialize(p.getBody(),r))}if(!r.no_events){p.onSetContent.dispatch(p,r)}return r.content},getContent:function(r){var p=this,q;r=r||{};r.format=r.format||"html";r.get=true;if(!r.no_events){p.onBeforeGetContent.dispatch(p,r)}if(r.format!="raw"&&p.settings.cleanup){r.getInner=true;q=p.serializer.serialize(p.getBody(),r)}else{q=p.getBody().innerHTML}q=q.replace(/^\s*|\s*$/g,"");r.content=q;if(!r.no_events){p.onGetContent.dispatch(p,r)}return r.content},isDirty:function(){var p=this;return m.trim(p.startContent)!=m.trim(p.getContent({format:"raw",no_events:1}))&&!p.isNotDirty},getContainer:function(){var p=this;if(!p.container){p.container=n.get(p.editorContainer||p.id+"_parent")}return p.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return n.get(this.settings.content_element||this.id)},getWin:function(){var p=this,q;if(!p.contentWindow){q=n.get(p.id+"_ifr");if(q){p.contentWindow=q.contentWindow}}return p.contentWindow},getDoc:function(){var q=this,p;if(!q.contentDocument){p=q.getWin();if(p){q.contentDocument=p.document}}return q.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(p,x,v){var q=this,r=q.settings;if(r.urlconverter_callback){return q.execCallback("urlconverter_callback",p,v,true,x)}if(!r.convert_urls||(v&&v.nodeName=="LINK")||p.indexOf("file:")===0){return p}if(r.relative_urls){return q.documentBaseURI.toRelative(p)}p=q.documentBaseURI.toAbsolute(p,r.remove_script_host);return p},addVisual:function(r){var p=this,q=p.settings;r=r||p.getBody();if(!d(p.hasVisual)){p.hasVisual=q.visual}i(p.dom.select("table,a",r),function(t){var s;switch(t.nodeName){case"TABLE":s=p.dom.getAttrib(t,"border");if(!s||s=="0"){if(p.hasVisual){p.dom.addClass(t,q.visual_table_class)}else{p.dom.removeClass(t,q.visual_table_class)}}return;case"A":s=p.dom.getAttrib(t,"name");if(s){if(p.hasVisual){p.dom.addClass(t,"mceItemAnchor")}else{p.dom.removeClass(t,"mceItemAnchor")}}return}});p.onVisualAid.dispatch(p,r,p.hasVisual)},remove:function(){var p=this,q=p.getContainer();p.removed=1;p.hide();p.execCallback("remove_instance_callback",p);p.onRemove.dispatch(p);p.onExecCommand.listeners=[];m.remove(p);n.remove(q)},destroy:function(q){var p=this;if(p.destroyed){return}if(!q){m.removeUnload(p.destroy);tinyMCE.onBeforeUnload.remove(p._beforeUnload);if(p.theme&&p.theme.destroy){p.theme.destroy()}p.controlManager.destroy();p.selection.destroy();p.dom.destroy();if(!p.settings.content_editable){j.clear(p.getWin());j.clear(p.getDoc())}j.clear(p.getBody());j.clear(p.formElement)}if(p.formElement){p.formElement.submit=p.formElement._mceOldSubmit;p.formElement._mceOldSubmit=null}p.contentAreaContainer=p.formElement=p.container=p.settings.content_element=p.bodyElement=p.contentDocument=p.contentWindow=null;if(p.selection){p.selection=p.selection.win=p.selection.dom=p.selection.dom.doc=null}p.destroyed=1},_addEvents:function(){var v=this,u,y=v.settings,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function r(t,A){var s=t.type;if(v.removed){return}if(v.onEvent.dispatch(v,t,A)!==false){v[x[t.fakeType||t.type]].dispatch(v,t,A)}}i(x,function(t,s){switch(s){case"contextmenu":if(m.isOpera){v.dom.bind(v.getBody(),"mousedown",function(A){if(A.ctrlKey){A.fakeType="contextmenu";r(A)}})}else{v.dom.bind(v.getBody(),s,r)}break;case"paste":v.dom.bind(v.getBody(),s,function(A){r(A)});break;case"submit":case"reset":v.dom.bind(v.getElement().form||n.getParent(v.id,"form"),s,r);break;default:v.dom.bind(y.content_editable?v.getBody():v.getDoc(),s,r)}});v.dom.bind(y.content_editable?v.getBody():(a?v.getDoc():v.getWin()),"focus",function(s){v.focus(true)});if(m.isGecko){v.dom.bind(v.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("_mce_src"))){t.src=v.documentBaseURI.toAbsolute(s)}})}if(a){function p(){var B=this,D=B.getDoc(),C=B.settings;if(a&&!C.readonly){if(B._isHidden()){try{if(!C.content_editable){D.designMode="On"}}catch(A){}}try{D.execCommand("styleWithCSS",0,false)}catch(A){if(!B._isHidden()){try{D.execCommand("useCSS",0,true)}catch(A){}}}if(!C.table_inline_editing){try{D.execCommand("enableInlineTableEditing",false,false)}catch(A){}}if(!C.object_resizing){try{D.execCommand("enableObjectResizing",false,false)}catch(A){}}}}v.onBeforeExecCommand.add(p);v.onMouseDown.add(p)}if(m.isWebKit){v.onClick.add(function(s,t){t=t.target;if(t.nodeName=="IMG"||(t.nodeName=="A"&&v.dom.hasClass(t,"mceItemAnchor"))){v.selection.getSel().setBaseAndExtent(t,0,t,1)}})}v.onMouseUp.add(v.nodeChanged);v.onClick.add(v.nodeChanged);v.onKeyUp.add(function(s,t){var A=t.keyCode;if((A>=33&&A<=36)||(A>=37&&A<=40)||A==13||A==45||A==46||A==8||(m.isMac&&(A==91||A==93))||t.ctrlKey){v.nodeChanged()}});v.onReset.add(function(){v.setContent(v.startContent,{format:"raw"})});if(y.custom_shortcuts){if(y.custom_undo_redo_keyboard_shortcuts){v.addShortcut("ctrl+z",v.getLang("undo_desc"),"Undo");v.addShortcut("ctrl+y",v.getLang("redo_desc"),"Redo")}if(a){v.addShortcut("ctrl+b",v.getLang("bold_desc"),"Bold");v.addShortcut("ctrl+i",v.getLang("italic_desc"),"Italic");v.addShortcut("ctrl+u",v.getLang("underline_desc"),"Underline")}for(u=1;u<=6;u++){v.addShortcut("ctrl+"+u,"",["FormatBlock",false,"h"+u])}v.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);v.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);v.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function z(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}i(v.shortcuts,function(A){if(m.isMac&&A.ctrl!=t.metaKey){return}else{if(!m.isMac&&A.ctrl!=t.ctrlKey){return}}if(A.alt!=t.altKey){return}if(A.shift!=t.shiftKey){return}if(t.keyCode==A.keyCode||(t.charCode&&t.charCode==A.charCode)){s=A;return false}});return s}v.onKeyUp.add(function(s,t){var A=z(t);if(A){return j.cancel(t)}});v.onKeyPress.add(function(s,t){var A=z(t);if(A){return j.cancel(t)}});v.onKeyDown.add(function(s,t){var A=z(t);if(A){A.func.call(A.scope);return j.cancel(t)}})}if(m.isIE){v.dom.bind(v.getDoc(),"controlselect",function(A){var t=v.resizeInfo,s;A=A.target;if(A.nodeName!=="IMG"){return}if(t){v.dom.unbind(t.node,t.ev,t.cb)}if(!v.dom.hasClass(A,"mceItemNoResize")){ev="resizeend";s=v.dom.bind(A,ev,function(C){var B;C=C.target;if(B=v.dom.getStyle(C,"width")){v.dom.setAttrib(C,"width",B.replace(/[^0-9%]+/g,""));v.dom.setStyle(C,"width","")}if(B=v.dom.getStyle(C,"height")){v.dom.setAttrib(C,"height",B.replace(/[^0-9%]+/g,""));v.dom.setStyle(C,"height","")}})}else{ev="resizestart";s=v.dom.bind(A,"resizestart",j.cancel,j)}t=v.resizeInfo={node:A,ev:ev,cb:s}});v.onKeyDown.add(function(s,t){switch(t.keyCode){case 8:if(v.selection.getRng().item){s.dom.remove(v.selection.getRng().item(0));return j.cancel(t)}}})}if(m.isOpera){v.onClick.add(function(s,t){j.prevent(t)})}if(y.custom_undo_redo){function q(){v.undoManager.typing=0;v.undoManager.add()}v.dom.bind(v.getDoc(),"focusout",function(s){if(!v.removed&&v.undoManager.typing){q()}});v.onKeyUp.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45||t.ctrlKey){q()}});v.onKeyDown.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45){if(v.undoManager.typing){q()}return}if(!v.undoManager.typing){v.undoManager.add();v.undoManager.typing=1}});v.onMouseDown.add(function(){if(v.undoManager.typing){q()}})}},_isHidden:function(){var p;if(!a){return 0}p=this.selection.getSel();return(!p||!p.rangeCount||p.rangeCount==0)},_fixNesting:function(q){var r=[],p;q=q.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(t,s,v){var u;if(s==="/"){if(!r.length){return""}if(v!==r[r.length-1].tag){for(p=r.length-1;p>=0;p--){if(r[p].tag===v){r[p].close=1;break}}return""}else{r.pop();if(r.length&&r[r.length-1].close){t=t+"</"+r[r.length-1].tag+">";r.pop()}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(v)){return t}if(/\/>$/.test(t)){return t}r.push({tag:v})}return t});for(p=r.length-1;p>=0;p--){q+="</"+r[p].tag+">"}return q}})})(tinymce);(function(c){var d=c.each,e,a=true,b=false;c.EditorCommands=function(n){var l=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,o;function q(y,x,v){var u;y=y.toLowerCase();if(u=j.exec[y]){u(y,x,v);return a}return b}function m(v){var u;v=v.toLowerCase();if(u=j.state[v]){return u(v)}return -1}function h(v){var u;v=v.toLowerCase();if(u=j.value[v]){return u(v)}return b}function t(u,v){v=v||"exec";d(u,function(y,x){d(x.toLowerCase().split(","),function(z){j[v][z]=y})})}c.extend(this,{execCommand:q,queryCommandState:m,queryCommandValue:h,addCommands:t});function f(x,v,u){if(v===e){v=b}if(u===e){u=null}return n.getDoc().execCommand(x,v,u)}function s(u){return n.formatter.match(u)}function r(u,v){n.formatter.toggle(u,v?{value:v}:e)}function i(u){o=p.getBookmark(u)}function g(){p.moveToBookmark(o)}t({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(y){var x=n.getDoc(),u;try{f(y)}catch(v){u=a}if(u||!x.queryCommandEnabled(y)){if(c.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(z){if(z){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(u){if(p.isCollapsed()){p.select(p.getNode())}f(u);p.collapse(b)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(u){var v=u.substring(7);d("left,center,right,full".split(","),function(x){if(v!=x){n.formatter.remove("align"+x)}});r("align"+v)},"InsertUnorderedList,InsertOrderedList":function(x){var u,v;f(x);u=l.getParent(p.getNode(),"ol,ul");if(u){v=u.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(v.nodeName)){i();l.split(v,u);g()}}},"Bold,Italic,Underline,Strikethrough":function(u){r(u)},"ForeColor,HiliteColor,FontName":function(x,v,u){r(x,u)},FontSize:function(y,x,v){var u,z;if(v>=1&&v<=7){z=c.explode(k.font_size_style_values);u=c.explode(k.font_size_classes);if(u){v=u[v-1]||v}else{v=z[v-1]||v}}r(y,v)},RemoveFormat:function(u){n.formatter.remove(u)},mceBlockQuote:function(u){r("blockquote")},FormatBlock:function(x,v,u){return r(u)},mceCleanup:function(){i();n.setContent(n.getContent({cleanup:a}),{cleanup:a});g()},mceRemoveNode:function(y,x,v){var u=v||p.getNode();if(u!=ed.getBody()){i();n.dom.remove(u,a);g()}},mceSelectNodeDepth:function(y,x,v){var u=0;l.getParent(p.getNode(),function(z){if(z.nodeType==1&&u++==v){p.select(z);return b}},n.getBody())},mceSelectNode:function(x,v,u){p.select(u)},mceInsertContent:function(x,v,u){p.setContent(u)},mceInsertRawHTML:function(x,v,u){p.setContent("tiny_mce_marker");n.setContent(n.getContent().replace(/tiny_mce_marker/g,u))},mceSetContent:function(x,v,u){n.setContent(u)},"Indent,Outdent":function(y){var v,u,x;v=k.indentation;u=/[a-z%]+$/i.exec(v);v=parseInt(v);if(!m("InsertUnorderedList")&&!m("InsertOrderedList")){d(p.getSelectedBlocks(),function(z){if(y=="outdent"){x=Math.max(0,parseInt(z.style.paddingLeft||0)-v);l.setStyle(z,"paddingLeft",x?x+u:"")}else{l.setStyle(z,"paddingLeft",(parseInt(z.style.paddingLeft||0)+v)+u)}})}else{f(y)}},mceRepaint:function(){var v;if(c.isGecko){try{i(a);if(p.getSel()){p.getSel().selectAllChildren(n.getBody())}p.collapse(a);g()}catch(u){}}},InsertHorizontalRule:function(){p.setContent("<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(x,v,u){p.setContent(u.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(y,x,v){var u=l.getParent(p.getNode(),"a");if(c.is(v,"string")){v={href:v}}if(!u){f("CreateLink",b,"javascript:mctmp(0);");d(l.select("a[href=javascript:mctmp(0);]"),function(z){l.setAttribs(z,v)})}else{if(v.href){l.setAttribs(u,v)}else{ed.dom.remove(u,a)}}}});t({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(u){return s("align"+u.substring(7))},"Bold,Italic,Underline,Strikethrough":function(u){return s(u)},mceBlockQuote:function(){return s("blockquote")},Outdent:function(){var u;if(k.inline_styles){if((u=l.getParent(p.getStart(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}if((u=l.getParent(p.getEnd(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}}return m("InsertUnorderedList")||m("InsertOrderedList")||(!k.inline_styles&&!!l.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(u){return l.getParent(p.getNode(),u=="insertunorderedlist"?"UL":"OL")}},"state");t({"FontSize,FontName":function(x){var v=0,u;if(u=l.getParent(p.getNode(),"span")){if(x=="fontsize"){v=u.style.fontSize}else{v=u.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return v}},"value");if(k.custom_undo_redo){t({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}})(tinymce);(function(a){a.create("tinymce.UndoManager",{index:0,data:null,typing:0,UndoManager:function(c){var d=this,b=a.util.Dispatcher;d.editor=c;d.data=[];d.onAdd=new b(this);d.onUndo=new b(this);d.onRedo=new b(this)},add:function(d){var g=this,f,e=g.editor,c,h=e.settings,j;d=d||{};d.content=d.content||e.getContent({format:"raw",no_events:1});d.content=d.content.replace(/^\s*|\s*$/g,"");j=g.data[g.index];if(j&&j.content==d.content){if(g.index>0||g.data.length==1){return null}}if(h.custom_undo_redo_levels){if(g.data.length>h.custom_undo_redo_levels){for(f=0;f<g.data.length-1;f++){g.data[f]=g.data[f+1]}g.data.length--;g.index=g.data.length}}if(h.custom_undo_redo_restore_selection){d.bookmark=c=d.bookmark||e.selection.getBookmark(2,true)}if(g.index<g.data.length-1){if(g.index==0){g.data=[]}else{g.data.length=g.index+1}}g.data.push(d);g.index=g.data.length-1;g.onAdd.dispatch(g,d);e.isNotDirty=0;return d},undo:function(){var e=this,c=e.editor,b=b,d;if(e.typing){e.add();e.typing=0}if(e.index>0){b=e.data[--e.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);e.onUndo.dispatch(e,b)}return b},redo:function(){var d=this,c=d.editor,b=null;if(d.index<d.data.length-1){b=d.data[++d.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);d.onRedo.dispatch(d,b)}return b},clear:function(){var b=this;b.data=[];b.index=0;b.typing=0},hasUndo:function(){return this.index>0||this.typing},hasRedo:function(){return this.index<this.data.length-1}})})(tinymce);(function(l){var k=l.dom.Event,c=l.isIE,a=l.isGecko,b=l.isOpera,j=l.each,i=l.extend,d=true,h=false;function g(n,o){var m=o.ownerDocument.createRange();m.setStart(n.endContainer,n.endOffset);m.setEndAfter(o);return m.cloneContents().textContent.length==0}function f(m){m=m.innerHTML;m=m.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi,"-");m=m.replace(/<[^>]+>/g,"");return m.replace(/[ \u00a0\t\r\n]+/g,"")==""}function e(o,q,m){var n,p;if(f(m)){n=q.getParent(m,"ul,ol");if(!q.getParent(n.parentNode,"ul,ol")){q.split(n,m);p=q.create("p",0,'<br _mce_bogus="1" />');q.replace(p,m);o.select(p,1)}return h}return d}l.create("tinymce.ForceBlocks",{ForceBlocks:function(n){var o=this,p=n.settings,q;o.editor=n;o.dom=n.dom;q=(p.forced_root_block||"p").toLowerCase();p.element=q.toUpperCase();n.onPreInit.add(o.setup,o);o.reOpera=new RegExp("(\\u00a0|&#160;|&nbsp;)</"+q+">","gi");o.rePadd=new RegExp("<p( )([^>]+)><\\/p>|<p( )([^>]+)\\/>|<p( )([^>]+)>\\s+<\\/p>|<p><\\/p>|<p\\/>|<p>\\s+<\\/p>".replace(/p/g,q),"gi");o.reNbsp2BR1=new RegExp("<p( )([^>]+)>[\\s\\u00a0]+<\\/p>|<p>[\\s\\u00a0]+<\\/p>".replace(/p/g,q),"gi");o.reNbsp2BR2=new RegExp("<%p()([^>]+)>(&nbsp;|&#160;)<\\/%p>|<%p>(&nbsp;|&#160;)<\\/%p>".replace(/%p/g,q),"gi");o.reBR2Nbsp=new RegExp("<p( )([^>]+)>\\s*<br \\/>\\s*<\\/p>|<p>\\s*<br \\/>\\s*<\\/p>".replace(/p/g,q),"gi");function m(r,s){if(b){s.content=s.content.replace(o.reOpera,"</"+q+">")}s.content=s.content.replace(o.rePadd,"<"+q+"$1$2$3$4$5$6>\u00a0</"+q+">");if(!c&&!b&&s.set){s.content=s.content.replace(o.reNbsp2BR1,"<"+q+"$1$2><br /></"+q+">");s.content=s.content.replace(o.reNbsp2BR2,"<"+q+"$1$2><br /></"+q+">")}else{s.content=s.content.replace(o.reBR2Nbsp,"<"+q+"$1$2>\u00a0</"+q+">")}}n.onBeforeSetContent.add(m);n.onPostProcess.add(m);if(p.forced_root_block){n.onInit.add(o.forceRoots,o);n.onSetContent.add(o.forceRoots,o);n.onBeforeGetContent.add(o.forceRoots,o)}},setup:function(){var n=this,m=n.editor,p=m.settings,r=m.dom,o=m.selection;if(p.forced_root_block){m.onBeforeExecCommand.add(n.forceRoots,n);m.onKeyUp.add(n.forceRoots,n);m.onPreProcess.add(n.forceRoots,n)}if(p.force_br_newlines){if(c){m.onKeyPress.add(function(s,t){var u;if(t.keyCode==13&&o.getNode().nodeName!="LI"){o.setContent('<br id="__" /> ',{format:"raw"});u=r.get("__");u.removeAttribute("id");o.select(u);o.collapse();return k.cancel(t)}})}}if(!c&&p.force_p_newlines){m.onKeyPress.add(function(s,t){if(t.keyCode==13&&!t.shiftKey&&!n.insertPara(t)){k.cancel(t)}});if(a){m.onKeyDown.add(function(s,t){if((t.keyCode==8||t.keyCode==46)&&!t.shiftKey){n.backspaceDelete(t,t.keyCode==8)}})}}if(l.isWebKit){function q(t){var s=o.getRng(),u,y=r.create("div",null," "),x,v=r.getViewPort(t.getWin()).h;s.insertNode(u=r.create("br"));s.setStartAfter(u);s.setEndAfter(u);o.setRng(s);if(o.getSel().focusNode==u.previousSibling){o.select(r.insertAfter(r.doc.createTextNode("\u00a0"),u));o.collapse(d)}r.insertAfter(y,u);x=r.getPos(y).y;r.remove(y);if(x>v){t.getWin().scrollTo(0,x)}}m.onKeyPress.add(function(s,t){if(t.keyCode==13&&(t.shiftKey||p.force_br_newlines)){q(s);k.cancel(t)}})}m.onPreProcess.add(function(s,t){j(r.select("p,h1,h2,h3,h4,h5,h6,div",t.node),function(u){if(f(u)){j(r.select("span,em,strong,b,i",t.node),function(v){if(!v.hasChildNodes()){v.appendChild(s.getDoc().createTextNode("\u00a0"));return h}})}})});if(c){if(p.element!="P"){m.onKeyPress.add(function(s,t){n.lastElm=o.getNode().nodeName});m.onKeyUp.add(function(t,u){var x,v=o.getNode(),s=t.getBody();if(s.childNodes.length===1&&v.nodeName=="P"){v=r.rename(v,p.element);o.select(v);o.collapse();t.nodeChanged()}else{if(u.keyCode==13&&!u.shiftKey&&n.lastElm!="P"){x=r.getParent(v,"p");if(x){r.rename(x,p.element);t.nodeChanged()}}}})}}},find:function(u,p,q){var o=this.editor,m=o.getDoc().createTreeWalker(u,4,null,h),r=-1;while(u=m.nextNode()){r++;if(p==0&&u==q){return r}if(p==1&&r==q){return u}}return -1},forceRoots:function(v,H){var y=this,v=y.editor,L=v.getBody(),I=v.getDoc(),O=v.selection,z=O.getSel(),A=O.getRng(),M=-2,u,F,m,o,J=-16777215;var K,p,N,E,B,q=L.childNodes,D,C,x;for(D=q.length-1;D>=0;D--){K=q[D];if(K.nodeType===1&&K.getAttribute("_mce_type")){p=null;continue}if(K.nodeType===3||(!y.dom.isBlock(K)&&K.nodeType!==8&&!/^(script|mce:script|style|mce:style)$/i.test(K.nodeName))){if(!p){if(K.nodeType!=3||/[^\s]/g.test(K.nodeValue)){if(M==-2&&A){if(!c){if(A.startContainer.nodeType==1&&(C=A.startContainer.childNodes[A.startOffset])&&C.nodeType==1){x=C.getAttribute("id");C.setAttribute("id","__mce")}else{if(v.dom.getParent(A.startContainer,function(n){return n===L})){F=A.startOffset;m=A.endOffset;M=y.find(L,0,A.startContainer);u=y.find(L,0,A.endContainer)}}}else{o=I.body.createTextRange();o.moveToElementText(L);o.collapse(1);N=o.move("character",J)*-1;o=A.duplicate();o.collapse(1);E=o.move("character",J)*-1;o=A.duplicate();o.collapse(0);B=(o.move("character",J)*-1)-E;M=E-N;u=B}}p=v.dom.create(v.settings.forced_root_block);K.parentNode.replaceChild(p,K);p.appendChild(K)}}else{if(p.hasChildNodes()){p.insertBefore(K,p.firstChild)}else{p.appendChild(K)}}}else{p=null}}if(M!=-2){if(!c){p=L.getElementsByTagName(v.settings.element)[0];A=I.createRange();if(M!=-1){A.setStart(y.find(L,1,M),F)}else{A.setStart(p,0)}if(u!=-1){A.setEnd(y.find(L,1,u),m)}else{A.setEnd(p,0)}if(z){z.removeAllRanges();z.addRange(A)}}else{try{A=z.createRange();A.moveToElementText(L);A.collapse(1);A.moveStart("character",M);A.moveEnd("character",u);A.select()}catch(G){}}}else{if(!c&&(C=v.dom.get("__mce"))){if(x){C.setAttribute("id",x)}else{C.removeAttribute("id")}A=I.createRange();A.setStartBefore(C);A.setEndBefore(C);O.setRng(A)}}},getParentBlock:function(o){var m=this.dom;return m.getParent(o,m.isBlock)},insertPara:function(R){var F=this,v=F.editor,N=v.dom,S=v.getDoc(),W=v.settings,G=v.selection.getSel(),H=G.getRangeAt(0),V=S.body;var K,L,I,P,O,q,o,u,z,m,D,U,p,x,J,M=N.getViewPort(v.getWin()),C,E,B;K=S.createRange();K.setStart(G.anchorNode,G.anchorOffset);K.collapse(d);L=S.createRange();L.setStart(G.focusNode,G.focusOffset);L.collapse(d);I=K.compareBoundaryPoints(K.START_TO_END,L)<0;P=I?G.anchorNode:G.focusNode;O=I?G.anchorOffset:G.focusOffset;q=I?G.focusNode:G.anchorNode;o=I?G.focusOffset:G.anchorOffset;if(P===q&&/^(TD|TH)$/.test(P.nodeName)){if(P.firstChild.nodeName=="BR"){N.remove(P.firstChild)}if(P.childNodes.length==0){v.dom.add(P,W.element,null,"<br />");U=v.dom.add(P,W.element,null,"<br />")}else{J=P.innerHTML;P.innerHTML="";v.dom.add(P,W.element,null,J);U=v.dom.add(P,W.element,null,"<br />")}H=S.createRange();H.selectNodeContents(U);H.collapse(1);v.selection.setRng(H);return h}if(P==V&&q==V&&V.firstChild&&v.dom.isBlock(V.firstChild)){P=q=P.firstChild;O=o=0;K=S.createRange();K.setStart(P,0);L=S.createRange();L.setStart(q,0)}P=P.nodeName=="HTML"?S.body:P;P=P.nodeName=="BODY"?P.firstChild:P;q=q.nodeName=="HTML"?S.body:q;q=q.nodeName=="BODY"?q.firstChild:q;u=F.getParentBlock(P);z=F.getParentBlock(q);m=u?u.nodeName:W.element;if(J=F.dom.getParent(u,"li,pre")){if(J.nodeName=="LI"){return e(v.selection,F.dom,J)}return d}if(u&&(u.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(N.getStyle(u,"position",1)))){m=W.element;u=null}if(z&&(z.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(N.getStyle(u,"position",1)))){m=W.element;z=null}if(/(TD|TABLE|TH|CAPTION)/.test(m)||(u&&m=="DIV"&&/left|right/gi.test(N.getStyle(u,"float",1)))){m=W.element;u=z=null}D=(u&&u.nodeName==m)?u.cloneNode(0):v.dom.create(m);U=(z&&z.nodeName==m)?z.cloneNode(0):v.dom.create(m);U.removeAttribute("id");if(/^(H[1-6])$/.test(m)&&g(H,u)){U=v.dom.create(W.element)}J=p=P;do{if(J==V||J.nodeType==9||F.dom.isBlock(J)||/(TD|TABLE|TH|CAPTION)/.test(J.nodeName)){break}p=J}while((J=J.previousSibling?J.previousSibling:J.parentNode));J=x=q;do{if(J==V||J.nodeType==9||F.dom.isBlock(J)||/(TD|TABLE|TH|CAPTION)/.test(J.nodeName)){break}x=J}while((J=J.nextSibling?J.nextSibling:J.parentNode));if(p.nodeName==m){K.setStart(p,0)}else{K.setStartBefore(p)}K.setEnd(P,O);D.appendChild(K.cloneContents()||S.createTextNode(""));try{L.setEndAfter(x)}catch(Q){}L.setStart(q,o);U.appendChild(L.cloneContents()||S.createTextNode(""));H=S.createRange();if(!p.previousSibling&&p.parentNode.nodeName==m){H.setStartBefore(p.parentNode)}else{if(K.startContainer.nodeName==m&&K.startOffset==0){H.setStartBefore(K.startContainer)}else{H.setStart(K.startContainer,K.startOffset)}}if(!x.nextSibling&&x.parentNode.nodeName==m){H.setEndAfter(x.parentNode)}else{H.setEnd(L.endContainer,L.endOffset)}H.deleteContents();if(b){v.getWin().scrollTo(0,M.y)}if(D.firstChild&&D.firstChild.nodeName==m){D.innerHTML=D.firstChild.innerHTML}if(U.firstChild&&U.firstChild.nodeName==m){U.innerHTML=U.firstChild.innerHTML}if(f(D)){D.innerHTML="<br />"}function T(y,s){var r=[],Y,X,t;y.innerHTML="";if(W.keep_styles){X=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(X.nodeName)){Y=X.cloneNode(h);N.setAttrib(Y,"id","");r.push(Y)}}while(X=X.parentNode)}if(r.length>0){for(t=r.length-1,Y=y;t>=0;t--){Y=Y.appendChild(r[t])}r[0].innerHTML=b?"&nbsp;":"<br />";return r[0]}else{y.innerHTML=b?"&nbsp;":"<br />"}}if(f(U)){B=T(U,q)}if(b&&parseFloat(opera.version())<9.5){H.insertNode(D);H.insertNode(U)}else{H.insertNode(U);H.insertNode(D)}U.normalize();D.normalize();function A(r){return S.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,h).nextNode()||r}H=S.createRange();H.selectNodeContents(a?A(B||U):B||U);H.collapse(1);G.removeAllRanges();G.addRange(H);C=v.dom.getPos(U).y;E=U.clientHeight;if(C<M.y||C+E>M.y+M.h){v.getWin().scrollTo(0,C<M.y?C:C-M.h+25)}return h},backspaceDelete:function(s,A){var C=this,q=C.editor,x=q.getBody(),p=q.dom,o,u=q.selection,m=u.getRng(),v=m.startContainer,o,y,z;if(v&&q.dom.isBlock(v)&&!/^(TD|TH)$/.test(v.nodeName)&&A){if(v.childNodes.length==0||(v.childNodes.length==1&&v.firstChild.nodeName=="BR")){o=v;while((o=o.previousSibling)&&!q.dom.isBlock(o)){}if(o){if(v!=x.firstChild){y=q.dom.doc.createTreeWalker(o,NodeFilter.SHOW_TEXT,null,h);while(z=y.nextNode()){o=z}m=q.getDoc().createRange();m.setStart(o,o.nodeValue?o.nodeValue.length:0);m.setEnd(o,o.nodeValue?o.nodeValue.length:0);u.setRng(m);q.dom.remove(v)}return k.cancel(s)}}}function B(n){var r;n=n.target;if(n&&n.parentNode&&n.nodeName=="BR"&&(o=C.getParentBlock(n))){r=n.previousSibling;k.remove(x,"DOMNodeInserted",B);if(r&&r.nodeType==3&&/\s+$/.test(r.nodeValue)){return}if(n.previousSibling||n.nextSibling){q.dom.remove(n)}}}k._add(x,"DOMNodeInserted",B);window.setTimeout(function(){k._remove(x,"DOMNodeInserted",B)},1)}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){if(p.cmd){i.execCommand(p.cmd,p.ui||false,p.value)}}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;if(g.settings.use_native_selects){k=new c.ui.NativeListBox(m,i)}else{f=l||h._cls.listbox||c.ui.ListBox;k=new f(m,i)}h.controls[m]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){g.bookmark=g.selection.getBookmark(1)});a.add(o,"focus",function(){g.selection.moveToBookmark(g.bookmark);g.bookmark=null})})}if(k.hideMenu){g.onMouseDown.add(k.hideMenu,k)}return h.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},resizeBy:function(f,g,h){h.resizeBy(f,g)},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){function b(){var d={},c={},e={};function f(j,i,h,g){if(typeof(i)=="string"){i=[i]}a.each(i,function(k){j[k.toLowerCase()]={func:h,scope:g}})}a.extend(this,{add:function(i,h,g){f(d,i,h,g)},addQueryStateHandler:function(i,h,g){f(c,i,h,g)},addQueryValueHandler:function(i,h,g){f(e,i,h,g)},execCommand:function(h,k,j,i,g){if(k=d[k.toLowerCase()]){if(k.func.call(h||k.scope,j,i,g)!==false){return true}}},queryCommandValue:function(){if(cmd=e[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}},queryCommandState:function(){if(cmd=c[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}}})}a.GlobalCommands=new b()})(tinymce);(function(a){a.Formatter=function(R){var I={},K=a.each,b=R.dom,o=R.selection,r=a.dom.TreeWalker,G=new a.dom.RangeUtils(b),c=R.schema.isValid,B=b.isBlock,j=R.settings.forced_root_block,q=b.nodeIndex,A="\uFEFF",d=/^(src|href|style)$/,O=false,x=true,n,S,L;function k(U,T){return b.getParents(U,T,b.getRoot())}function D(){if(!L||L.apply.length||L.remove.length){L={apply:[],remove:[]}}}R.onMouseUp.add(D);D();function N(T){return T?I[T]:I}function i(T,U){if(T){if(typeof(T)!=="string"){K(T,function(W,V){i(V,W)})}else{U=U.length?U:[U];K(U,function(V){if(V.deep===n){V.deep=!V.selector}if(V.split===n){V.split=!V.selector}if(V.remove===n&&V.selector){V.remove="none"}if(typeof(V.classes)==="string"){V.classes=V.classes.split(/\s+/)}});I[T]=U}}}function P(V,ab,X){var Y=N(V),ac=Y[0],aa,U,Z;function W(af){var ae=af.startContainer,ai=af.startOffset,ah,ag;if(ae.nodeType==1||ae.nodeValue===""){ah=new r(ae.childNodes[ai]);for(ag=ah.current();ag;ag=ah.next()){if(ag.nodeType==3&&!B(ag.parentNode)&&!e(ag)){af.setStart(ag,0);break}}}return af}function T(af,ae){ae=ae||ac;if(af){K(ae.styles,function(ah,ag){b.setStyle(af,ag,p(ah,ab))});K(ae.attributes,function(ah,ag){b.setAttrib(af,ag,p(ah,ab))});K(ae.classes,function(ag){ag=p(ag,ab);if(!b.hasClass(af,ag)){b.addClass(af,ag)}})}}function ad(af){var ae=[],ah,ag;ah=ac.inline||ac.block;ag=b.create(ah);T(ag);G.walk(af,function(ai){var aj;function ak(al){var an=al.nodeName.toLowerCase(),am=al.parentNode.nodeName.toLowerCase();if(f(an,"br")){aj=0;if(ac.block){b.remove(al)}return}if(ac.wrapper&&t(al,V,ab)){aj=0;return}if(ac.block&&!ac.wrapper&&C(an)){al=b.rename(al,ah);T(al);ae.push(al);aj=0;return}if(ac.selector){K(Y,function(ao){if(b.is(al,ao.selector)){T(al,ao)}});return}if(c(ah,an)&&c(am,ah)){if(!aj){aj=ag.cloneNode(O);al.parentNode.insertBefore(aj,al);ae.push(aj)}aj.appendChild(al)}else{aj=0;K(a.grep(al.childNodes),ak);aj=0}}K(ai,ak)});K(ae,function(ak){var ai;function al(an){var am=0;K(an.childNodes,function(ao){if(!e(ao)&&!E(ao)){am++}});return am}function aj(am){var ao,an;K(am.childNodes,function(ap){if(ap.nodeType==1&&!E(ap)){ao=ap;return O}});if(ao&&g(ao,ac)){an=ao.cloneNode(O);T(an);b.replace(an,am,x);b.remove(ao,1)}return an||am}ai=al(ak);if(ai===0){b.remove(ak,1);return}if(ac.inline||ac.wrapper){if(!ac.exact&&ai===1){ak=aj(ak)}K(Y,function(am){K(b.select(am.inline,ak),function(an){Q(am,ab,an,am.exact?an:null)})});b.getParent(ak.parentNode,function(am){if(t(am,V,ab)){b.remove(ak,1);ak=0;return x}});if(ak){ak=s(y(ak),ak);ak=s(ak,y(ak,x))}}})}if(ac){if(X){U=b.createRng();U.setStartBefore(X);U.setEndAfter(X);ad(U)}else{if(!o.isCollapsed()||!ac.inline){aa=o.getBookmark();ad(m(o.getRng(x),Y));o.moveToBookmark(aa);o.setRng(W(o.getRng(x)));R.nodeChanged()}else{M("apply",V,ab)}}}}function v(V,ad,X){var Y=N(V),af=Y[0],ac,ab,U;function W(ak){var aj,ai,ah;aj=a.grep(ak.childNodes);for(ai=0,ah=Y.length;ai<ah;ai++){if(Q(Y[ai],ad,ak,ak)){break}}if(af.deep){for(ai=0,ah=aj.length;ai<ah;ai++){W(aj[ai])}}}function Z(ah){var ai;K(k(ah.parentNode).reverse(),function(aj){if(!ai&&aj.id!="_start"&&aj.id!="_end"){if(!B(aj)&&t(aj,V,ad)){ai=aj}}});return ai}function T(ak,ah,am,ap){var aq,ao,an,aj,al,ai;if(ak){ai=ak.parentNode;for(aq=ah.parentNode;aq&&aq!=ai;aq=aq.parentNode){ao=aq.cloneNode(O);for(al=0;al<Y.length;al++){if(Q(Y[al],ad,ao,ao)){ao=0;break}}if(ao){if(an){ao.appendChild(an)}if(!aj){aj=ao}an=ao}}if(ap){ah=b.split(ak,ah)}if(an){am.parentNode.insertBefore(an,am);aj.appendChild(am)}}return ah}function ae(ah){return T(Z(ah),ah,ah,true)}function aa(aj){var ai=b.get(aj?"_start":"_end"),ah=ai[aj?"firstChild":"lastChild"];b.remove(ai,1);return ah}function ag(ah){var ai,aj;ah=m(ah,Y,x);if(af.split){ai=F(ah,x);aj=F(ah);if(ai!=aj){ai=J(ai,"span",{id:"_start",_mce_type:"bookmark"});aj=J(aj,"span",{id:"_end",_mce_type:"bookmark"});ae(ai);ae(aj);ai=aa(x);aj=aa()}else{ai=aj=ae(ai)}ah.startContainer=ai.parentNode;ah.startOffset=q(ai);ah.endContainer=aj.parentNode;ah.endOffset=q(aj)+1}G.walk(ah,function(ak){K(ak,function(al){W(al)})})}if(X){U=b.createRng();U.setStartBefore(X);U.setEndAfter(X);ag(U);return}if(!o.isCollapsed()||!af.inline){ac=o.getBookmark();ag(o.getRng(x));o.moveToBookmark(ac);R.nodeChanged()}else{M("remove",V,ad)}}function z(T,V,U){if(h(T,V,U)){v(T,V,U)}else{P(T,V,U)}}function t(W,T,Y){var Z=N(T),X,V,U;function aa(ae,ag,ah){var ad,af,ab=ag[ah],ac;if(ab){if(ab.length===n){for(ad in ab){if(ab.hasOwnProperty(ad)){if(ah==="attributes"){af=b.getAttrib(ae,ad)}else{af=H(ae,ad)}if(!f(af,p(ab[ad],Y))){return}}}}else{for(ac=0;ac<ab.length;ac++){if(ah==="attributes"?b.getAttrib(ae,ab[ac]):H(ae,ab[ac])){return x}}}}return x}if(Z&&W){for(V=0;V<Z.length;V++){X=Z[V];if(g(W,X)&&aa(W,X,"attributes")&&aa(W,X,"styles")){if(U=X.classes){for(V=0;V<U.length;V++){if(!b.hasClass(W,U[V])){return}}}return x}}}}function h(V,Y,X){var U,W;function T(Z){Z=b.getParent(Z,function(aa){return !!t(aa,V,Y)});return t(Z,V,Y)}if(X){return T(X)}if(o.isCollapsed()){for(W=L.apply.length-1;W>=0;W--){if(L.apply[W].name==V){return true}}for(W=L.remove.length-1;W>=0;W--){if(L.remove[W].name==V){return false}}return T(o.getNode())}X=o.getNode();if(T(X)){return x}U=o.getStart();if(U!=X){if(T(U)){return x}}return O}function u(X){var Z=N(X),W,V,Y,U,T;if(Z){W=o.getStart();V=k(W);for(U=Z.length-1;U>=0;U--){T=Z[U].selector;if(!T){return x}for(Y=V.length-1;Y>=0;Y--){if(b.is(V[Y],T)){return x}}}}return O}a.extend(this,{get:N,register:i,apply:P,remove:v,toggle:z,match:h,matchNode:t,canApply:u});function g(T,U){if(f(T,U.inline)){return x}if(f(T,U.block)){return x}if(U.selector){return b.is(T,U.selector)}}function f(U,T){U=U||"";T=T||"";U=U.nodeName||U;T=T.nodeName||T;return U.toLowerCase()==T.toLowerCase()}function H(U,T){var V=b.getStyle(U,T);if(T=="color"||T=="backgroundColor"){V=b.toHex(V)}if(T=="fontWeight"&&V==700){V="bold"}return""+V}function p(T,U){if(typeof(T)!="string"){T=T(U)}else{if(U){T=T.replace(/%(\w+)/g,function(W,V){return U[V]||W})}}return T}function e(T){return T&&T.nodeType===3&&/^\s*$/.test(T.nodeValue)}function J(V,U,T){var W=b.create(U,T);V.parentNode.insertBefore(W,V);W.appendChild(V);return W}function m(T,ab,W){var V=T.startContainer,Y=T.startOffset,ae=T.endContainer,Z=T.endOffset,ad,aa;function ac(ah,ai,af,ag){var aj,ak;ag=ag||b.getRoot();for(;;){aj=ah.parentNode;if(aj==ag||(!ab[0].block_expand&&B(aj))){return ah}for(ad=aj[ai];ad&&ad!=ah;ad=ad[af]){if(ad.nodeType==1&&!E(ad)){return ah}if(ad.nodeType==3&&!e(ad)){return ah}}ah=ah.parentNode}return ah}if(V.nodeType==1&&V.hasChildNodes()){aa=V.childNodes.length-1;V=V.childNodes[Y>aa?aa:Y];if(V.nodeType==3){Y=0}}if(ae.nodeType==1&&ae.hasChildNodes()){aa=ae.childNodes.length-1;ae=ae.childNodes[Z>aa?aa:Z-1];if(ae.nodeType==3){Z=ae.nodeValue.length}}if(E(V.parentNode)){V=V.parentNode}if(E(V)){V=V.nextSibling||V}if(E(ae.parentNode)){ae=ae.parentNode}if(E(ae)){ae=ae.previousSibling||ae}if(ab[0].inline||ab[0].block_expand){V=ac(V,"firstChild","nextSibling");ae=ac(ae,"lastChild","previousSibling")}if(ab[0].selector&&ab[0].expand!==O){function X(ag,af){var ah,ai,aj;if(ag.nodeType==3&&ag.nodeValue.length==0&&ag[af]){ag=ag[af]}ah=k(ag);for(ai=0;ai<ah.length;ai++){for(aj=0;aj<ab.length;aj++){if(b.is(ah[ai],ab[aj].selector)){return ah[ai]}}}return ag}V=X(V,"previousSibling");ae=X(ae,"nextSibling")}if(ab[0].block||ab[0].selector){function U(ag,af,ai){var ah;if(!ab[0].wrapper){ah=b.getParent(ag,ab[0].block)}if(!ah){ah=b.getParent(ag.nodeType==3?ag.parentNode:ag,B)}if(ah&&ab[0].wrapper){ah=k(ah,"ul,ol").reverse()[0]||ah}if(!ah){ah=ag;while(ah[af]&&!B(ah[af])){ah=ah[af];if(f(ah,"br")){break}}}return ah||ag}V=U(V,"previousSibling");ae=U(ae,"nextSibling");if(ab[0].block){if(!B(V)){V=ac(V,"firstChild","nextSibling")}if(!B(ae)){ae=ac(ae,"lastChild","previousSibling")}}}if(V.nodeType==1){Y=q(V);V=V.parentNode}if(ae.nodeType==1){Z=q(ae)+1;ae=ae.parentNode}return{startContainer:V,startOffset:Y,endContainer:ae,endOffset:Z}}function Q(Z,Y,W,T){var V,U,X;if(!g(W,Z)){return O}if(Z.remove!="all"){K(Z.styles,function(ab,aa){ab=p(ab,Y);if(typeof(aa)==="number"){aa=ab;T=0}if(!T||f(H(T,aa),ab)){b.setStyle(W,aa,"")}X=1});if(X&&b.getAttrib(W,"style")==""){W.removeAttribute("style");W.removeAttribute("_mce_style")}K(Z.attributes,function(ac,aa){var ab;ac=p(ac,Y);if(typeof(aa)==="number"){aa=ac;T=0}if(!T||f(b.getAttrib(T,aa),ac)){if(aa=="class"){ac=b.getAttrib(W,aa);if(ac){ab="";K(ac.split(/\s+/),function(ad){if(/mce\w+/.test(ad)){ab+=(ab?" ":"")+ad}});if(ab){b.setAttrib(W,aa,ab);return}}}if(aa=="class"){W.removeAttribute("className")}if(d.test(aa)){W.removeAttribute("_mce_"+aa)}W.removeAttribute(aa)}});K(Z.classes,function(aa){aa=p(aa,Y);if(!T||b.hasClass(T,aa)){b.removeClass(W,aa)}});U=b.getAttribs(W);for(V=0;V<U.length;V++){if(U[V].nodeName.indexOf("_")!==0){return O}}}if(Z.remove!="none"){l(W,Z);return x}}function l(V,W){var T=V.parentNode,U;if(W.block){if(!j){function X(Z,Y,aa){Z=y(Z,Y,aa);return !Z||(Z.nodeName=="BR"||B(Z))}if(B(V)&&!B(T)){if(!X(V,O)&&!X(V.firstChild,x,1)){V.insertBefore(b.create("br"),V.firstChild)}if(!X(V,x)&&!X(V.lastChild,O,1)){V.appendChild(b.create("br"))}}}else{if(T==b.getRoot()){if(!W.list_block||!f(V,W.list_block)){K(a.grep(V.childNodes),function(Y){if(c(j,Y.nodeName.toLowerCase())){if(!U){U=J(Y,j)}else{U.appendChild(Y)}}else{U=0}})}}}}b.remove(V,1)}function y(U,T,V){if(U){T=T?"nextSibling":"previousSibling";for(U=V?U:U[T];U;U=U[T]){if(U.nodeType==1||!e(U)){return U}}}}function E(T){return T&&T.nodeType==1&&T.getAttribute("_mce_type")=="bookmark"}function s(X,W){var T,V,U;function Z(ac,ab){if(ac.nodeName!=ab.nodeName){return O}function aa(ae){var af={};K(b.getAttribs(ae),function(ag){var ah=ag.nodeName.toLowerCase();if(ah.indexOf("_")!==0&&ah!=="style"){af[ah]=b.getAttrib(ae,ah)}});return af}function ad(ah,ag){var af,ae;for(ae in ah){if(ah.hasOwnProperty(ae)){af=ag[ae];if(af===n){return O}if(ah[ae]!=af){return O}delete ag[ae]}}for(ae in ag){if(ag.hasOwnProperty(ae)){return O}}return x}if(!ad(aa(ac),aa(ab))){return O}if(!ad(b.parseStyle(b.getAttrib(ac,"style")),b.parseStyle(b.getAttrib(ab,"style")))){return O}return x}if(X&&W){function Y(ab,aa){for(V=ab;V;V=V[aa]){if(V.nodeType==3&&!e(V)){return ab}if(V.nodeType==1&&!E(V)){return V}}return ab}X=Y(X,"previousSibling");W=Y(W,"nextSibling");if(Z(X,W)){for(V=X.nextSibling;V&&V!=W;){U=V;V=V.nextSibling;X.appendChild(U)}b.remove(W);K(a.grep(W.childNodes),function(aa){X.appendChild(aa)});return X}}return W}function C(T){return/^(h[1-6]|p|div|pre|address)$/.test(T)}function F(U,X){var T,W,V;T=U[X?"startContainer":"endContainer"];W=U[X?"startOffset":"endOffset"];if(T.nodeType==1){V=T.childNodes.length-1;if(!X&&W){W--}T=T.childNodes[W>V?V:W]}return T}function M(ab,W,aa){var X,U,Z=o.getNode().parentNode,ad=R.getDoc(),Y="mceinline",ag=["onKeyDown","onKeyUp","onKeyPress"],V=L[ab],ac=L[ab=="apply"?"remove":"apply"];for(X=V.length-1;X>=0;X--){if(V[X].name==W){return}}V.push({name:W,vars:aa});for(X=ac.length-1;X>=0;X--){if(ac[X].name==W){ac.splice(X,1)}}function af(){if(S){K(ag,function(ah){R[ah].remove(S)});S=0}}function ae(ah){K(L.apply.reverse(),function(ai){P(ai.name,ai.vars,ah)});K(L.remove.reverse(),function(ai){v(ai.name,ai.vars,ah)});b.remove(ah,1);D()}function T(ah){return ah.face==Y||ah.style.fontFamily==Y}af();ad.execCommand("FontName",false,Y);K(b.select("font,span",Z),function(ai){var ah;if(T(ai)){ah=o.getBookmark();ae(ai);o.moveToBookmark(ah);R.nodeChanged();Z=0}});if(Z){S=function(ah,ai){K(b.select("font,span",Z),function(ak){var aj,al;if(ak.face==Y||ak.style.fontFamily==Y){al=ak.firstChild;ae(ak);U=b.createRng();U.setStart(al,al.nodeValue.length);U.setEnd(al,al.nodeValue.length);o.setRng(U);ah.nodeChanged();af()}});if(ai.type=="keyup"){af();D()}};K(ag,function(ah){R[ah].addToTop(S)})}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;if(c.inline_styles){h=e.explode(c.font_size_style_values);function b(j,i){g.replace(g.create("span",{style:i}),j,1)}d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}a.onPreProcess.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});
1
+ (function(d){var a=/^\s*|\s*$/g,e,c="B".replace(/A(.)|B/,"$1")==="$1";var b={majorVersion:"3",minorVersion:"4.7",releaseDate:"2011-11-03",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=d.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isIE7=s.isIE&&/MSIE [7]/.test(g);s.isIE8=s.isIE&&/MSIE [8]/.test(g);s.isIE9=s.isIE&&/MSIE [9]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWebKit\/(\d*)/)[1]>=534;if(d.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m<f.length;m++){if(r=f[m].href){if(/^https?:\/\/[^\/]+$/.test(r)){r+="/"}k=r?r.match(/.*\//)[0]:""}}function h(i){if(i.src&&/tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(i.src)){if(/_(src|dev)\.js/g.test(i.src)){s.suffix="_src"}if((j=i.src.indexOf("?"))!=-1){s.query=i.src.substring(j+1)}s.baseURL=i.src.substring(0,i.src.lastIndexOf("/"));if(k&&s.baseURL.indexOf("://")==-1&&s.baseURL.indexOf("/")!==0){s.baseURL=k+s.baseURL}return s.baseURL}return null}f=q.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}l=q.getElementsByTagName("head")[0];if(l){f=l.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}}return},is:function(g,f){if(!f){return g!==e}if(f=="array"&&(g.hasOwnProperty&&g instanceof Array)){return true}return typeof(g)==f},makeMap:function(f,j,h){var g;f=f||[];j=j||",";if(typeof(f)=="string"){f=f.split(j)}h=h||{};g=f.length;while(g--){h[f[g]]={}}return h},each:function(i,f,h){var j,g;if(!i){return 0}h=h||i;if(i.length!==e){for(j=0,g=i.length;j<g;j++){if(f.call(h,i[j],j,i)===false){return 0}}}else{for(j in i){if(i.hasOwnProperty(j)){if(f.call(h,i[j],j,i)===false){return 0}}}}return 1},map:function(g,h){var i=[];b.each(g,function(f){i.push(h(f))});return i},grep:function(g,h){var i=[];b.each(g,function(f){if(!h||h(f)){i.push(f)}});return i},inArray:function(g,h){var j,f;if(g){for(j=0,f=g.length;j<f;j++){if(g[j]===h){return j}}}return -1},extend:function(k,j){var h,g,f=arguments;for(h=1,g=f.length;h<g;h++){j=f[h];b.each(j,function(i,l){if(i!==e){k[l]=i}})}return k},trim:function(f){return(f?""+f:"").replace(a,"")},create:function(o,f,j){var n=this,g,i,k,l,h,m=0;o=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(o);k=o[3].match(/(^|\.)(\w+)$/i)[2];i=n.createNS(o[3].replace(/\.\w+$/,""),j);if(i[k]){return}if(o[2]=="static"){i[k]=f;if(this.onCreate){this.onCreate(o[2],o[3],i[k])}return}if(!f[k]){f[k]=function(){};m=1}i[k]=f[k];n.extend(i[k].prototype,f);if(o[5]){g=n.resolve(o[5]).prototype;l=o[5].match(/\.(\w+)$/i)[1];h=i[k];if(m){i[k]=function(){return g[l].apply(this,arguments)}}else{i[k]=function(){this.parent=g[l];return h.apply(this,arguments)}}i[k].prototype[k]=i[k];n.each(g,function(p,q){i[k].prototype[q]=g[q]});n.each(f,function(p,q){if(g[q]){i[k].prototype[q]=function(){this.parent=g[q];return p.apply(this,arguments)}}else{if(q!=k){i[k].prototype[q]=p}}})}n.each(f["static"],function(p,q){i[k][q]=p});if(this.onCreate){this.onCreate(o[2],o[3],i[k].prototype)}},walk:function(i,h,j,g){g=g||this;if(i){if(j){i=i[j]}b.each(i,function(k,f){if(h.call(g,k,f,j)===false){return false}b.walk(k,h,j,g)})}},createNS:function(j,h){var g,f;h=h||d;j=j.split(".");for(g=0;g<j.length;g++){f=j[g];if(!h[f]){h[f]={}}h=h[f]}return h},resolve:function(j,h){var g,f;h=h||d;j=j.split(".");for(g=0,f=j.length;g<f;g++){h=h[j[g]];if(!h){break}}return h},addUnload:function(j,i){var h=this;j={func:j,scope:i||this};if(!h.unloads){function g(){var f=h.unloads,l,m;if(f){for(m in f){l=f[m];if(l&&l.func){l.func.call(l.scope,1)}}if(d.detachEvent){d.detachEvent("onbeforeunload",k);d.detachEvent("onunload",g)}else{if(d.removeEventListener){d.removeEventListener("unload",g,false)}}h.unloads=l=f=w=g=0;if(d.CollectGarbage){CollectGarbage()}}}function k(){var l=document;if(l.readyState=="interactive"){function f(){l.detachEvent("onstop",f);if(g){g()}l=0}if(l){l.attachEvent("onstop",f)}d.setTimeout(function(){if(l){l.detachEvent("onstop",f)}},0)}}if(d.attachEvent){d.attachEvent("onunload",g);d.attachEvent("onbeforeunload",k)}else{if(d.addEventListener){d.addEventListener("unload",g,false)}}h.unloads=[j]}else{h.unloads.push(j)}return j},removeUnload:function(i){var g=this.unloads,h=null;b.each(g,function(j,f){if(j&&j.func==i){g.splice(f,1);h=i;return false}});return h},explode:function(f,g){return f?b.map(f.split(g||","),b.trim):f},_addVer:function(g){var f;if(!this.query){return g}f=(g.indexOf("?")==-1?"?":"&")+this.query;if(g.indexOf("#")==-1){return g+f}return g.replace("#",f+"#")},_replace:function(h,f,g){if(c){return g.replace(h,function(){var l=f,j=arguments,k;for(k=0;k<j.length-2;k++){if(j[k]===e){l=l.replace(new RegExp("\\$"+k,"g"),"")}else{l=l.replace(new RegExp("\\$"+k,"g"),j[k])}}return l})}return g.replace(h,f)}};b._init();d.tinymce=d.tinyMCE=b})(window);tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(a,b){this.listeners.push({cb:a,scope:b||this.scope});return a},addToTop:function(a,b){this.listeners.unshift({cb:a,scope:b||this.scope});return a},remove:function(a){var b=this.listeners,c=null;tinymce.each(b,function(e,d){if(a==e.cb){c=a;b.splice(d,1);return false}});return c},dispatch:function(){var f,d=arguments,e,b=this.listeners,g;for(e=0;e<b.length;e++){g=b[e];f=g.cb.apply(g.scope,d);if(f===false){break}}return f}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,i,d,c,h;e=tinymce.trim(e);g=f.settings=g||{};if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^[\w-]*:?\/\//.test(e)){h=g.base_uri?g.base_uri.path:new tinymce.util.URI(location.href).directory;e=((g.base_uri&&g.base_uri.protocol)||"http")+"://mce_host"+f.toAbsPath(h,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(i){if(i){h.push(i)}});e=h;for(c=f.length-1,h=[];c>=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();(function(){function serialize(o,quote){var i,v,t;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){if(quote==='"'&&a==="'"){return a}i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&o instanceof Array){for(i=0,v="[";i<o.length;i++){v+=(i>0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(i in o){if(o.hasOwnProperty(i)){v+=typeof o[i]!="function"?(v.length>1?","+quote:quote)+i+quote+":"+serialize(o[i],quote):""}}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(a){a.VK={DELETE:46,BACKSPACE:8,ENTER:13,TAB:9,SPACEBAR:32,UP:38,DOWN:40}})(tinymce);(function(k){var i=k.VK,j=i.BACKSPACE,h=i.DELETE;function c(m){var o=m.dom,n=m.selection;m.onKeyDown.add(function(q,u){var p,v,s,t,r;r=u.keyCode==h;if(r||u.keyCode==j){u.preventDefault();p=n.getRng();v=o.getParent(p.startContainer,o.isBlock);if(r){v=o.getNext(v,o.isBlock)}if(v){s=v.firstChild;while(s&&s.nodeType==3&&s.nodeValue.length==0){s=s.nextSibling}if(s&&s.nodeName==="SPAN"){t=s.cloneNode(false)}}q.getDoc().execCommand(r?"ForwardDelete":"Delete",false,null);v=o.getParent(p.startContainer,o.isBlock);k.each(o.select("span.Apple-style-span,font.Apple-style-span",v),function(x){var y=n.getBookmark();if(t){o.replace(t.cloneNode(false),x,true)}else{o.remove(x,true)}n.moveToBookmark(y)})}})}function d(m){m.onKeyUp.add(function(n,p){var o=p.keyCode;if(o==h||o==j){if(n.dom.isEmpty(n.getBody())){n.setContent("",{format:"raw"});n.nodeChanged();return}}})}function b(m){m.dom.bind(m.getDoc(),"focusin",function(){m.selection.setRng(m.selection.getRng())})}function e(m){m.onKeyDown.add(function(n,q){if(q.keyCode===j){if(n.selection.isCollapsed()&&n.selection.getRng(true).startOffset===0){var p=n.selection.getNode();var o=p.previousSibling;if(o&&o.nodeName&&o.nodeName.toLowerCase()==="hr"){n.dom.remove(o);k.dom.Event.cancel(q)}}}})}function g(m){if(!Range.prototype.getClientRects){m.onMouseDown.add(function(o,p){if(p.target.nodeName==="HTML"){var n=o.getBody();n.blur();setTimeout(function(){n.focus()},0)}})}}function f(m){m.onClick.add(function(n,o){o=o.target;if(/^(IMG|HR)$/.test(o.nodeName)){n.selection.getSel().setBaseAndExtent(o,0,o,1)}if(o.nodeName=="A"&&n.dom.hasClass(o,"mceItemAnchor")){n.selection.select(o)}n.nodeChanged()})}function l(m){var o,n;m.dom.bind(m.getDoc(),"selectionchange",function(){if(n){clearTimeout(n);n=0}n=window.setTimeout(function(){var p=m.selection.getRng();if(!o||!k.dom.RangeUtils.compareRanges(p,o)){m.nodeChanged();o=p}},50)})}function a(m){document.body.setAttribute("role","application")}k.create("tinymce.util.Quirks",{Quirks:function(m){if(k.isWebKit){c(m);d(m);b(m);f(m);if(k.isIDevice){l(m)}}if(k.isIE){e(m);d(m);a(m)}if(k.isGecko){e(m);g(m)}}})})(tinymce);(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};g={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;"};d={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n<m.length;n+=2){o=String.fromCharCode(parseInt(m[n],p));if(!g[o]){l="&"+m[n+1]+";";q[o]=l;q[l]=o}}return q}}a=e("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);j.html=j.html||{};j.html.Entities={encodeRaw:function(m,l){return m.replace(l?k:b,function(n){return g[n]||n})},encodeAllRaw:function(l){return(""+l).replace(f,function(m){return g[m]||m})},encodeNumeric:function(m,l){return m.replace(l?k:b,function(n){if(n.length>1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g<j.length;g++){a[j[g]]="\uFEFF"+g;a["\uFEFF"+g]=j[g]}function c(n,q,p,i){function o(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(r){var y={},p,n,v,q,u=d.url_converter,x=d.url_converter_scope||this;function o(C,F){var E,B,A,D;E=y[C+"-top"+F];if(!E){return}B=y[C+"-right"+F];if(E!=B){return}A=y[C+"-bottom"+F];if(B!=A){return}D=y[C+"-left"+F];if(A!=D){return}y[C+F]=D;delete y[C+"-top"+F];delete y[C+"-right"+F];delete y[C+"-bottom"+F];delete y[C+"-left"+F]}function t(B){var C=y[B],A;if(!C||C.indexOf(" ")<0){return}C=C.split(" ");A=C.length;while(A--){if(C[A]!==C[0]){return false}}y[B]=C[0];return true}function z(C,B,A,D){if(!t(B)){return}if(!t(A)){return}if(!t(D)){return}y[C]=y[B]+" "+y[A]+" "+y[D];delete y[B];delete y[A];delete y[D]}function s(A){q=true;return a[A]}function i(B,A){if(q){B=B.replace(/\uFEFF[0-9]/g,function(C){return a[C]})}if(!A){B=B.replace(/\\([\'\";:])/g,"$1")}return B}if(r){r=r.replace(/\\[\"\';:\uFEFF]/g,s).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(A){return A.replace(/[;:]/g,s)});while(p=b.exec(r)){n=p[1].replace(l,"").toLowerCase();v=p[2].replace(l,"");if(n&&v.length>0){if(n==="font-weight"&&v==="700"){v="bold"}else{if(n==="color"||n==="background-color"){v=v.toLowerCase()}}v=v.replace(k,c);v=v.replace(h,function(B,A,E,D,F,C){F=F||C;if(F){F=i(F);return"'"+F.replace(/\'/g,"\\'")+"'"}A=i(A||E||D);if(u){A=u.call(x,A,"style")}return"url('"+A.replace(/\'/g,"\\'")+"')"});y[n]=q?i(v,true):v}b.lastIndex=p.index+p[0].length}o("border","");o("border","-width");o("border","-color");o("border","-style");o("padding","");o("margin","");z("border","border-width","border-style","border-color");if(y.border==="medium none"){delete y.border}}return y},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u<s;u++){t=x[u];v=p[t];if(v!==e&&v.length>0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(m){var h={},j,l,g,f,c={},b,e,d=m.makeMap,k=m.each;function i(o,n){return o.split(n||",")}function a(r,q){var o,p={};function n(s){return s.replace(/[A-Z]+/g,function(t){return n(r[t])})}for(o in r){if(r.hasOwnProperty(o)){r[o]=n(r[o])}}n(q).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(v,t,s,u){s=i(s,"|");p[t]={attributes:d(s),attributesOrder:s,children:d(u,"|",{"#comment":{}})}});return p}l="h1,h2,h3,h4,h5,h6,hr,p,div,address,pre,form,table,tbody,thead,tfoot,th,tr,td,li,ol,ul,caption,blockquote,center,dl,dt,dd,dir,fieldset,noscript,menu,isindex,samp,header,footer,article,section,hgroup";l=d(l,",",d(l.toUpperCase()));h=a({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]");j=d("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected,autoplay,loop,controls");g=d("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,source");f=m.extend(d("td,th,iframe,video,audio,object"),g);b=d("pre,script,style,textarea");e=d("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");m.html.Schema=function(r){var A=this,n={},o={},y=[],q,p;r=r||{};if(r.verify_html===false){r.valid_elements="*[*]"}if(r.valid_styles){q={};k(r.valid_styles,function(C,B){q[B]=m.explode(C)})}p=r.whitespace_elements?d(r.whitespace_elements):b;function z(B){return new RegExp("^"+B.replace(/([?+*])/g,".$1")+"$")}function t(I){var H,D,W,S,X,C,F,R,U,N,V,Z,L,G,T,B,P,E,Y,aa,M,Q,K=/^([#+-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,O=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,J=/[*?+]/;if(I){I=i(I);if(n["@"]){P=n["@"].attributes;E=n["@"].attributesOrder}for(H=0,D=I.length;H<D;H++){C=K.exec(I[H]);if(C){T=C[1];N=C[2];B=C[3];U=C[4];L={};G=[];F={attributes:L,attributesOrder:G};if(T==="#"){F.paddEmpty=true}if(T==="-"){F.removeEmpty=true}if(P){for(aa in P){L[aa]=P[aa]}G.push.apply(G,E)}if(U){U=i(U,"|");for(W=0,S=U.length;W<S;W++){C=O.exec(U[W]);if(C){R={};Z=C[1];V=C[2].replace(/::/g,":");T=C[3];Q=C[4];if(Z==="!"){F.attributesRequired=F.attributesRequired||[];F.attributesRequired.push(V);R.required=true}if(Z==="-"){delete L[V];G.splice(m.inArray(G,V),1);continue}if(T){if(T==="="){F.attributesDefault=F.attributesDefault||[];F.attributesDefault.push({name:V,value:Q});R.defaultValue=Q}if(T===":"){F.attributesForced=F.attributesForced||[];F.attributesForced.push({name:V,value:Q});R.forcedValue=Q}if(T==="<"){R.validValues=d(Q,"?")}}if(J.test(V)){F.attributePatterns=F.attributePatterns||[];R.pattern=z(V);F.attributePatterns.push(R)}else{if(!L[V]){G.push(V)}L[V]=R}}}}if(!P&&N=="@"){P=L;E=G}if(B){F.outputName=N;n[B]=F}if(J.test(N)){F.pattern=z(N);y.push(F)}else{n[N]=F}}}}}function v(B){n={};y=[];t(B);k(h,function(D,C){o[C]=D.children})}function s(C){var B=/^(~)?(.+)$/;if(C){k(i(C),function(G){var E=B.exec(G),F=E[1]==="~",H=F?"span":"div",D=E[2];o[D]=o[H];c[D]=H;if(!F){l[D]={}}k(o,function(I,J){if(I[H]){I[D]=I[H]}})})}}function u(C){var B=/^([+\-]?)(\w+)\[([^\]]+)\]$/;if(C){k(i(C),function(G){var F=B.exec(G),D,E;if(F){E=F[1];if(E){D=o[F[2]]}else{D=o[F[2]]={"#comment":{}}}D=o[F[2]];k(i(F[3],"|"),function(H){if(E==="-"){delete D[H]}else{D[H]={}}})}})}}function x(B){var D=n[B],C;if(D){return D}C=y.length;while(C--){D=y[C];if(D.pattern.test(B)){return D}}}if(!r.valid_elements){k(h,function(C,B){n[B]={attributes:C.attributes,attributesOrder:C.attributesOrder};o[B]=C.children});k(i("strong/b,em/i"),function(B){B=i(B,"/");n[B[1]].outputName=B[0]});n.img.attributesDefault=[{name:"alt",value:""}];k(i("ol,ul,sub,sup,blockquote,span,font,a,table,tbody,tr"),function(B){n[B].removeEmpty=true});k(i("p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption"),function(B){n[B].paddEmpty=true})}else{v(r.valid_elements)}s(r.custom_elements);u(r.valid_children);t(r.extended_valid_elements);u("+ol[ul|ol],+ul[ul|ol]");if(!x("span")){t("span[!data-mce-type|*]")}if(r.invalid_elements){m.each(m.explode(r.invalid_elements),function(B){if(n[B]){delete n[B]}})}A.children=o;A.styles=q;A.getBoolAttrs=function(){return j};A.getBlockElements=function(){return l};A.getShortEndedElements=function(){return g};A.getSelfClosingElements=function(){return e};A.getNonEmptyElements=function(){return f};A.getWhiteSpaceElements=function(){return p};A.isValidChild=function(B,D){var C=o[B];return !!(C&&C[D])};A.getElementRule=x;A.getCustomElements=function(){return c};A.addValidElements=t;A.setValidElements=v;A.addCustomElements=s;A.addValidChildren=u};m.html.Schema.boolAttrMap=j;m.html.Schema.blockElementsMap=l})(tinymce);(function(a){a.html.SaxParser=function(c,e){var b=this,d=function(){};c=c||{};b.schema=e=e||new a.html.Schema();if(c.fix_self_closing!==false){c.fix_self_closing=true}a.each("comment cdata text start end pi doctype".split(" "),function(f){if(f){b[f]=c[f]||d}});b.parse=function(D){var n=this,g,F=0,H,A,z=[],M,P,B,q,y,r,L,G,N,u,m,k,s,Q,o,O,E,R,K,f,I,l,C,J,h,v=0,j=a.html.Entities.decode,x,p;function t(S){var U,T;U=z.length;while(U--){if(z[U].name===S){break}}if(U>=0){for(T=z.length-1;T>=U;T--){S=z[T];if(S.valid){n.end(S.name)}}z.length=U}}l=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([^\\s\\/<>]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/)>))","g");C=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;J={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};L=e.getShortEndedElements();I=e.getSelfClosingElements();G=e.getBoolAttrs();u=c.validate;r=c.remove_internals;x=c.fix_self_closing;p=a.isIE;o=/^:/;while(g=l.exec(D)){if(F<g.index){n.text(j(D.substr(F,g.index-F)))}if(H=g[6]){H=H.toLowerCase();if(p&&o.test(H)){H=H.substr(1)}t(H)}else{if(H=g[7]){H=H.toLowerCase();if(p&&o.test(H)){H=H.substr(1)}N=H in L;if(x&&I[H]&&z.length>0&&z[z.length-1].name===H){t(H)}if(!u||(m=e.getElementRule(H))){k=true;if(u){O=m.attributes;E=m.attributePatterns}if(Q=g[8]){y=Q.indexOf("data-mce-type")!==-1;if(y&&r){k=false}M=[];M.map={};Q.replace(C,function(T,S,X,W,V){var Y,U;S=S.toLowerCase();X=S in G?S:j(X||W||V||"");if(u&&!y&&S.indexOf("data-")!==0){Y=O[S];if(!Y&&E){U=E.length;while(U--){Y=E[U];if(Y.pattern.test(S)){break}}if(U===-1){Y=null}}if(!Y){return}if(Y.validValues&&!(X in Y.validValues)){return}}M.map[S]=X;M.push({name:S,value:X})})}else{M=[];M.map={}}if(u&&!y){R=m.attributesRequired;K=m.attributesDefault;f=m.attributesForced;if(f){P=f.length;while(P--){s=f[P];q=s.name;h=s.value;if(h==="{$uid}"){h="mce_"+v++}M.map[q]=h;M.push({name:q,value:h})}}if(K){P=K.length;while(P--){s=K[P];q=s.name;if(!(q in M.map)){h=s.value;if(h==="{$uid}"){h="mce_"+v++}M.map[q]=h;M.push({name:q,value:h})}}}if(R){P=R.length;while(P--){if(R[P] in M.map){break}}if(P===-1){k=false}}if(M.map["data-mce-bogus"]){k=false}}if(k){n.start(H,M,N)}}else{k=false}if(A=J[H]){A.lastIndex=F=g.index+g[0].length;if(g=A.exec(D)){if(k){B=D.substr(F,g.index-F)}F=g.index+g[0].length}else{B=D.substr(F);F=D.length}if(k&&B.length>0){n.text(B,true)}if(k){n.end(H)}l.lastIndex=F;continue}if(!N){if(!Q||Q.indexOf("/")!=Q.length-1){z.push({name:H,valid:k})}else{if(k){n.end(H)}}}}else{if(H=g[1]){n.comment(H)}else{if(H=g[2]){n.cdata(H)}else{if(H=g[3]){n.doctype(H)}else{if(H=g[4]){n.pi(H,g[5])}}}}}}F=g.index+g[0].length}if(F<D.length){n.text(j(D.substr(F)))}for(P=z.length-1;P>=0;P--){H=z[P];if(H.valid){n.end(H.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h<f;h++){j=m[h];if(j.name!=="id"){k[k.length]={name:j.name,value:j.value};k.map[j.name]=j.value}}n.attributes=k}n.value=g.value;n.shortEnded=g.shortEnded;return n},wrap:function(g){var f=this;f.parent.insert(g,f);g.append(f);return f},unwrap:function(){var f=this,h,g;for(h=f.firstChild;h;){g=h.next;f.insert(h,f,true);h=g}f.remove()},remove:function(){var f=this,h=f.parent,g=f.next,i=f.prev;if(h){if(h.firstChild===f){h.firstChild=g;if(g){g.prev=null}}else{i.next=g}if(h.lastChild===f){h.lastChild=i;if(i){i.next=null}}else{g.prev=i}f.parent=f.next=f.prev=null}return f},append:function(h){var f=this,g;if(h.parent){h.remove()}g=f.lastChild;if(g){g.next=h;h.prev=g;f.lastChild=h}else{f.lastChild=f.firstChild=h}h.parent=f;return h},insert:function(h,f,i){var g;if(h.parent){h.remove()}g=f.parent||this;if(i){if(f===g.firstChild){g.firstChild=h}else{f.prev.next=h}h.prev=f.prev;h.next=f;f.prev=h}else{if(f===g.lastChild){g.lastChild=h}else{f.next.prev=h}h.next=f.next;h.prev=f;f.next=h}h.parent=g;return h},getAll:function(g){var f=this,h,i=[];for(h=f.firstChild;h;h=a(h,f)){if(h.name===g){i.push(h)}}return i},empty:function(){var g=this,f,h,j;if(g.firstChild){f=[];for(j=g.firstChild;j;j=a(j,g)){f.push(j)}h=f.length;while(h--){j=f[h];j.parent=j.firstChild=j.lastChild=j.next=j.prev=null}}g.firstChild=g.lastChild=null;return g},isEmpty:function(k){var f=this,j=f.firstChild,h,g;if(j){do{if(j.type===1){if(j.attributes.map["data-mce-bogus"]){continue}if(k[j.name]){return false}h=j.attributes.length;while(h--){g=j.attributes[h].name;if(g==="name"||g.indexOf("data-")===0){return false}}}if((j.type===3&&!c.test(j.value))){return false}}while(j=a(j,f))}return true},walk:function(f){return a(this,null,f)}});d.extend(b,{create:function(g,f){var i,h;i=new b(g,e[g]||1);if(f){for(h in f){i.attr(h,f[h])}}return i}});d.html.Node=b})(tinymce);(function(b){var a=b.html.Node;b.html.DomParser=function(g,h){var f=this,e={},d=[],i={},c={};g=g||{};g.validate="validate" in g?g.validate:true;g.root_name=g.root_name||"body";f.schema=h=h||new b.html.Schema();function j(m){var o,p,x,v,z,n,q,l,t,u,k,s,y,r;s=b.makeMap("tr,td,th,tbody,thead,tfoot,table");k=h.getNonEmptyElements();for(o=0;o<m.length;o++){p=m[o];if(!p.parent){continue}v=[p];for(x=p.parent;x&&!h.isValidChild(x.name,p.name)&&!s[x.name];x=x.parent){v.push(x)}if(x&&v.length>1){v.reverse();z=n=f.filterNode(v[0].clone());for(t=0;t<v.length-1;t++){if(h.isValidChild(n.name,v[t].name)){q=f.filterNode(v[t].clone());n.append(q)}else{q=n}for(l=v[t].firstChild;l&&l!=v[t+1];){r=l.next;q.append(l);l=r}n=q}if(!z.isEmpty(k)){x.insert(z,v[0],true);x.insert(p,z)}else{x.insert(p,v[0],true)}x=v[0];if(x.isEmpty(k)||x.firstChild===x.lastChild&&x.firstChild.name==="br"){x.empty().remove()}}else{if(p.parent){if(p.name==="li"){y=p.prev;if(y&&(y.name==="ul"||y.name==="ul")){y.append(p);continue}y=p.next;if(y&&(y.name==="ul"||y.name==="ul")){y.insert(p,y.firstChild,true);continue}p.wrap(f.filterNode(new a("ul",1)));continue}if(h.isValidChild(p.parent.name,"div")&&h.isValidChild("div",p.name)){p.wrap(f.filterNode(new a("div",1)))}else{if(p.name==="style"||p.name==="script"){p.empty().remove()}else{p.unwrap()}}}}}}f.filterNode=function(m){var l,k,n;if(k in e){n=i[k];if(n){n.push(m)}else{i[k]=[m]}}l=d.length;while(l--){k=d[l].name;if(k in m.attributes.map){n=c[k];if(n){n.push(m)}else{c[k]=[m]}}}return m};f.addNodeFilter=function(k,l){b.each(b.explode(k),function(m){var n=e[m];if(!n){e[m]=n=[]}n.push(l)})};f.addAttributeFilter=function(k,l){b.each(b.explode(k),function(m){var n;for(n=0;n<d.length;n++){if(d[n].name===m){d[n].callbacks.push(l);return}}d.push({name:m,callbacks:[l]})})};f.parse=function(v,m){var n,H,A,z,C,B,x,r,E,K,y,o,D,J=[],t,k,s,p,u,q;m=m||{};i={};c={};o=b.extend(b.makeMap("script,style,head,html,body,title,meta,param"),h.getBlockElements());u=h.getNonEmptyElements();p=h.children;y=g.validate;q="forced_root_block" in m?m.forced_root_block:g.forced_root_block;s=h.getWhiteSpaceElements();D=/^[ \t\r\n]+/;t=/[ \t\r\n]+$/;k=/[ \t\r\n]+/g;function F(){var L=H.firstChild,l,M;while(L){l=L.next;if(L.type==3||(L.type==1&&L.name!=="p"&&!o[L.name]&&!L.attr("data-mce-type"))){if(!M){M=I(q,1);H.insert(M,L);M.append(L)}else{M.append(L)}}else{M=null}L=l}}function I(l,L){var M=new a(l,L),N;if(l in e){N=i[l];if(N){N.push(M)}else{i[l]=[M]}}return M}function G(M){var N,l,L;for(N=M.prev;N&&N.type===3;){l=N.value.replace(t,"");if(l.length>0){N.value=l;N=N.prev}else{L=N.prev;N.remove();N=L}}}n=new b.html.SaxParser({validate:y,fix_self_closing:!y,cdata:function(l){A.append(I("#cdata",4)).value=l},text:function(M,l){var L;if(!s[A.name]){M=M.replace(k," ");if(A.lastChild&&o[A.lastChild.name]){M=M.replace(D,"")}}if(M.length!==0){L=I("#text",3);L.raw=!!l;A.append(L).value=M}},comment:function(l){A.append(I("#comment",8)).value=l},pi:function(l,L){A.append(I(l,7)).value=L;G(A)},doctype:function(L){var l;l=A.append(I("#doctype",10));l.value=L;G(A)},start:function(l,T,M){var R,O,N,L,P,U,S,Q;N=y?h.getElementRule(l):{};if(N){R=I(N.outputName||l,1);R.attributes=T;R.shortEnded=M;A.append(R);Q=p[A.name];if(Q&&p[R.name]&&!Q[R.name]){J.push(R)}O=d.length;while(O--){P=d[O].name;if(P in T.map){E=c[P];if(E){E.push(R)}else{c[P]=[R]}}}if(o[l]){G(R)}if(!M){A=R}}},end:function(l){var P,M,O,L,N;M=y?h.getElementRule(l):{};if(M){if(o[l]){if(!s[A.name]){for(P=A.firstChild;P&&P.type===3;){O=P.value.replace(D,"");if(O.length>0){P.value=O;P=P.next}else{L=P.next;P.remove();P=L}}for(P=A.lastChild;P&&P.type===3;){O=P.value.replace(t,"");if(O.length>0){P.value=O;P=P.prev}else{L=P.prev;P.remove();P=L}}}P=A.prev;if(P&&P.type===3){O=P.value.replace(D,"");if(O.length>0){P.value=O}else{P.remove()}}}if(M.removeEmpty||M.paddEmpty){if(A.isEmpty(u)){if(M.paddEmpty){A.empty().append(new a("#text","3")).value="\u00a0"}else{if(!A.attributes.map.name){N=A.parent;A.empty().remove();A=N;return}}}}A=A.parent}}},h);H=A=new a(m.context||g.root_name,11);n.parse(v);if(y&&J.length){if(!m.context){j(J)}else{m.invalid=true}}if(q&&H.name=="body"){F()}if(!m.invalid){for(K in i){E=e[K];z=i[K];x=z.length;while(x--){if(!z[x].parent){z.splice(x,1)}}for(C=0,B=E.length;C<B;C++){E[C](z,K,m)}}for(C=0,B=d.length;C<B;C++){E=d[C];if(E.name in c){z=c[E.name];x=z.length;while(x--){if(!z[x].parent){z.splice(x,1)}}for(x=0,r=E.callbacks.length;x<r;x++){E.callbacks[x](z,E.name,m)}}}}return H};if(g.remove_trailing_brs){f.addNodeFilter("br",function(n,m){var r,q=n.length,o,u=h.getBlockElements(),k=h.getNonEmptyElements(),s,p,t;u.body=1;for(r=0;r<q;r++){o=n[r];s=o.parent;if(u[o.parent.name]&&o===s.lastChild){p=o.prev;while(p){t=p.name;if(t!=="span"||p.attr("data-mce-type")!=="bookmark"){if(t!=="br"){break}if(t==="br"){o=null;break}}p=p.prev}if(o){o.remove();if(s.isEmpty(k)){elementRule=h.getElementRule(s.name);if(elementRule){if(elementRule.removeEmpty){s.remove()}else{if(elementRule.paddEmpty){s.empty().append(new b.html.Node("#text",3)).value="\u00a0"}}}}}}}})}}})(tinymce);tinymce.html.Writer=function(e){var c=[],a,b,d,f,g;e=e||{};a=e.indent;b=tinymce.makeMap(e.indent_before||"");d=tinymce.makeMap(e.indent_after||"");f=tinymce.html.Entities.getEncodeFunc(e.entity_encoding||"raw",e.entities);g=e.element_format=="html";return{start:function(m,k,p){var n,j,h,o;if(a&&b[m]&&c.length>0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n<j;n++){h=k[n];c.push(" ",h.name,'="',f(h.value,true),'"')}}if(!p||g){c[c.length]=">"}else{c[c.length]=" />"}if(p&&a&&d[m]&&c.length>0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("</",h,">");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("<![CDATA[",h,"]]>")},comment:function(h){c.push("<!--",h,"-->")},pi:function(h,i){if(i){c.push("<?",h," ",i,"?>")}else{c.push("<?",h,"?>")}if(a){c.push("\n")}},doctype:function(h){c.push("<!DOCTYPE",h,">",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n<m;n++){r=q.attributesOrder[n];if(r in s.map){p=s.map[r];u.map[r]=p;u.push({name:r,value:p})}}for(n=0,m=s.length;n<m;n++){r=s[n].name;if(!(r in u.map)){p=s.map[r];u.map[r]=p;u.push({name:r,value:p})}}s=u}e.start(k.name,s,o);if(!o){if((k=k.firstChild)){do{f(k)}while(k=k.next)}e.end(j)}}else{t(k)}}if(h.type==1&&!c.inner){f(h)}else{g[11](h)}return e.getContent()}}})(tinymce);(function(h){var f=h.each,e=h.is,d=h.isWebKit,b=h.isIE,c=h.html.Entities,a=/^([a-z0-9],?)+$/i,g=h.html.Schema.blockElementsMap,i=/^[ \t\r\n]*$/;h.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(o,m){var l=this,j,k;l.doc=o;l.win=window;l.files={};l.cssFlicker=false;l.counter=0;l.stdMode=!h.isIE||o.documentMode>=8;l.boxModel=!h.isIE||o.compatMode=="CSS1Compat"||l.stdMode;l.hasOuterHTML="outerHTML" in o.createElement("a");l.settings=m=h.extend({keep_values:false,hex_colors:1},m);l.schema=m.schema;l.styles=new h.html.Styles({url_converter:m.url_converter,url_converter_scope:m.url_converter_scope},m.schema);if(h.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(n){l.cssFlicker=true}}if(b&&m.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(p){o.createElement(p)});for(k in m.schema.getCustomElements()){o.createElement(k)}}h.addUnload(l.destroy,l)},getRoot:function(){var j=this,k=j.settings;return(k&&j.get(k.root_element))||j.doc.body},getViewPort:function(k){var l,j;k=!k?this.win:k;l=k.document;j=this.boxModel?l.documentElement:l.body;return{x:k.pageXOffset||j.scrollLeft,y:k.pageYOffset||j.scrollTop,w:k.innerWidth||j.clientWidth,h:k.innerHeight||j.clientHeight}},getRect:function(m){var l,j=this,k;m=j.get(m);l=j.getPos(m);k=j.getSize(m);return{x:l.x,y:l.y,w:k.w,h:k.h}},getSize:function(m){var k=this,j,l;m=k.get(m);j=k.getStyle(m,"width");l=k.getStyle(m,"height");if(j.indexOf("px")===-1){j=0}if(l.indexOf("px")===-1){l=0}return{w:parseInt(j)||m.offsetWidth||m.clientWidth,h:parseInt(l)||m.offsetHeight||m.clientHeight}},getParent:function(l,k,j){return this.getParents(l,k,j,false)},getParents:function(u,p,l,s){var k=this,j,m=k.settings,q=[];u=k.get(u);s=s===undefined;if(m.strict_root){l=l||k.getRoot()}if(e(p,"string")){j=p;if(p==="*"){p=function(o){return o.nodeType==1}}else{p=function(o){return k.is(o,j)}}}while(u){if(u==l||!u.nodeType||u.nodeType===9){break}if(!p||p(u)){if(s){q.push(u)}else{return u}}u=u.parentNode}return s?q:null},get:function(j){var k;if(j&&this.doc&&typeof(j)=="string"){k=j;j=this.doc.getElementById(j);if(j&&j.id!==k){return this.doc.getElementsByName(k)[1]}}return j},getNext:function(k,j){return this._findSib(k,j,"nextSibling")},getPrev:function(k,j){return this._findSib(k,j,"previousSibling")},select:function(l,k){var j=this;return h.dom.Sizzle(l,j.get(k)||j.get(j.settings.root_element)||j.doc,[])},is:function(l,j){var k;if(l.length===undefined){if(j==="*"){return l.nodeType==1}if(a.test(j)){j=j.toLowerCase().split(/,/);l=l.nodeName.toLowerCase();for(k=j.length-1;k>=0;k--){if(j[k]==l){return true}}return false}}return h.dom.Sizzle.matches(j,l.nodeType?[l]:l).length>0},add:function(m,q,j,l,o){var k=this;return this.run(m,function(s){var r,n;r=e(q,"string")?k.doc.createElement(q):q;k.setAttribs(r,j);if(l){if(l.nodeType){r.appendChild(l)}else{k.setHTML(r,l)}}return !o?s.appendChild(r):r})},create:function(l,j,k){return this.add(this.doc.createElement(l),l,j,k,1)},createHTML:function(r,j,p){var q="",m=this,l;q+="<"+r;for(l in j){if(j.hasOwnProperty(l)){q+=" "+l+'="'+m.encode(j[l])+'"'}}if(typeof(p)!="undefined"){return q+">"+p+"</"+r+">"}return q+" />"},remove:function(j,k){return this.run(j,function(m){var n,l=m.parentNode;if(!l){return null}if(k){while(n=m.firstChild){if(!h.isIE||n.nodeType!==3||n.nodeValue){l.insertBefore(n,m)}else{m.removeChild(n)}}}return l.removeChild(m)})},setStyle:function(m,j,k){var l=this;return l.run(m,function(p){var o,n;o=p.style;j=j.replace(/-(\D)/g,function(r,q){return q.toUpperCase()});if(l.pixelStyles.test(j)&&(h.is(k,"number")||/^[\-0-9\.]+$/.test(k))){k+="px"}switch(j){case"opacity":if(b){o.filter=k===""?"":"alpha(opacity="+(k*100)+")";if(!m.currentStyle||!m.currentStyle.hasLayout){o.display="inline-block"}}o[j]=o["-moz-opacity"]=o["-khtml-opacity"]=k||"";break;case"float":b?o.styleFloat=k:o.cssFloat=k;break;default:o[j]=k||""}if(l.settings.update_styles){l.setAttrib(p,"data-mce-style")}})},getStyle:function(m,j,l){m=this.get(m);if(!m){return}if(this.doc.defaultView&&l){j=j.replace(/[A-Z]/g,function(n){return"-"+n});try{return this.doc.defaultView.getComputedStyle(m,null).getPropertyValue(j)}catch(k){return null}}j=j.replace(/-(\D)/g,function(o,n){return n.toUpperCase()});if(j=="float"){j=b?"styleFloat":"cssFloat"}if(m.currentStyle&&l){return m.currentStyle[j]}return m.style?m.style[j]:undefined},setStyles:function(m,n){var k=this,l=k.settings,j;j=l.update_styles;l.update_styles=0;f(n,function(o,p){k.setStyle(m,p,o)});l.update_styles=j;if(l.update_styles){k.setAttrib(m,l.cssText)}},removeAllAttribs:function(j){return this.run(j,function(m){var l,k=m.attributes;for(l=k.length-1;l>=0;l--){m.removeAttributeNode(k.item(l))}})},setAttrib:function(l,m,j){var k=this;if(!l||!m){return}if(k.settings.strict){m=m.toLowerCase()}return this.run(l,function(o){var n=k.settings;if(j!==null){switch(m){case"style":if(!e(j,"string")){f(j,function(p,q){k.setStyle(o,q,p)});return}if(n.keep_values){if(j&&!k._isRes(j)){o.setAttribute("data-mce-style",j,2)}else{o.removeAttribute("data-mce-style",2)}}o.style.cssText=j;break;case"class":o.className=j||"";break;case"src":case"href":if(n.keep_values){if(n.url_converter){j=n.url_converter.call(n.url_converter_scope||k,j,m,o)}k.setAttrib(o,"data-mce-"+m,j,2)}break;case"shape":o.setAttribute("data-mce-style",j);break}}if(e(j)&&j!==null&&j.length!==0){o.setAttribute(m,""+j,2)}else{o.removeAttribute(m,2)}})},setAttribs:function(k,l){var j=this;return this.run(k,function(m){f(l,function(o,p){j.setAttrib(m,p,o)})})},getAttrib:function(o,p,l){var j,k=this,m;o=k.get(o);if(!o||o.nodeType!==1){return l===m?false:l}if(!e(l)){l=""}if(/^(src|href|style|coords|shape)$/.test(p)){j=o.getAttribute("data-mce-"+p);if(j){return j}}if(b&&k.props[p]){j=o[k.props[p]];j=j&&j.nodeValue?j.nodeValue:j}if(!j){j=o.getAttribute(p,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(p)){if(o[k.props[p]]===true&&j===""){return p}return j?p:""}if(o.nodeName==="FORM"&&o.getAttributeNode(p)){return o.getAttributeNode(p).nodeValue}if(p==="style"){j=j||o.style.cssText;if(j){j=k.serializeStyle(k.parseStyle(j),o.nodeName);if(k.settings.keep_values&&!k._isRes(j)){o.setAttribute("data-mce-style",j)}}}if(d&&p==="class"&&j){j=j.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(p){case"rowspan":case"colspan":if(j===1){j=""}break;case"size":if(j==="+0"||j===20||j===0){j=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(j===0){j=""}break;case"hspace":if(j===-1){j=""}break;case"maxlength":case"tabindex":if(j===32768||j===2147483647||j==="32768"){j=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(j===65535){return p}return l;case"shape":j=j.toLowerCase();break;default:if(p.indexOf("on")===0&&j){j=h._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+j)}}}return(j!==m&&j!==null&&j!=="")?""+j:l},getPos:function(s,m){var k=this,j=0,q=0,o,p=k.doc,l;s=k.get(s);m=m||p.body;if(s){if(s.getBoundingClientRect){s=s.getBoundingClientRect();o=k.boxModel?p.documentElement:p.body;j=s.left+(p.documentElement.scrollLeft||p.body.scrollLeft)-o.clientTop;q=s.top+(p.documentElement.scrollTop||p.body.scrollTop)-o.clientLeft;return{x:j,y:q}}l=s;while(l&&l!=m&&l.nodeType){j+=l.offsetLeft||0;q+=l.offsetTop||0;l=l.offsetParent}l=s.parentNode;while(l&&l!=m&&l.nodeType){j-=l.scrollLeft||0;q-=l.scrollTop||0;l=l.parentNode}}return{x:j,y:q}},parseStyle:function(j){return this.styles.parse(j)},serializeStyle:function(k,j){return this.styles.serialize(k,j)},loadCSS:function(j){var l=this,m=l.doc,k;if(!j){j=""}k=l.select("head")[0];f(j.split(","),function(n){var o;if(l.files[n]){return}l.files[n]=true;o=l.create("link",{rel:"stylesheet",href:h._addVer(n)});if(b&&m.documentMode&&m.recalc){o.onload=function(){if(m.recalc){m.recalc()}o.onload=null}}k.appendChild(o)})},addClass:function(j,k){return this.run(j,function(l){var m;if(!k){return 0}if(this.hasClass(l,k)){return l.className}m=this.removeClass(l,k);return l.className=(m!=""?(m+" "):"")+k})},removeClass:function(l,m){var j=this,k;return j.run(l,function(o){var n;if(j.hasClass(o,m)){if(!k){k=new RegExp("(^|\\s+)"+m+"(\\s+|$)","g")}n=o.className.replace(k," ");n=h.trim(n!=" "?n:"");o.className=n;if(!n){o.removeAttribute("class");o.removeAttribute("className")}return n}return o.className})},hasClass:function(k,j){k=this.get(k);if(!k||!j){return false}return(" "+k.className+" ").indexOf(" "+j+" ")!==-1},show:function(j){return this.setStyle(j,"display","block")},hide:function(j){return this.setStyle(j,"display","none")},isHidden:function(j){j=this.get(j);return !j||j.style.display=="none"||this.getStyle(j,"display")=="none"},uniqueId:function(j){return(!j?"mce_":j)+(this.counter++)},setHTML:function(l,k){var j=this;return j.run(l,function(n){if(b){while(n.firstChild){n.removeChild(n.firstChild)}try{n.innerHTML="<br />"+k;n.removeChild(n.firstChild)}catch(m){n=j.create("div");n.innerHTML="<br />"+k;f(n.childNodes,function(p,o){if(o){n.appendChild(p)}})}}else{n.innerHTML=k}return k})},getOuterHTML:function(l){var k,j=this;l=j.get(l);if(!l){return null}if(l.nodeType===1&&j.hasOuterHTML){return l.outerHTML}k=(l.ownerDocument||j.doc).createElement("body");k.appendChild(l.cloneNode(true));return k.innerHTML},setOuterHTML:function(m,k,n){var j=this;function l(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){j.insertAfter(s.cloneNode(true),p);s=s.previousSibling}j.remove(p)}return this.run(m,function(p){p=j.get(p);if(p.nodeType==1){n=n||p.ownerDocument||j.doc;if(b){try{if(b&&p.nodeType==1){p.outerHTML=k}else{l(p,k,n)}}catch(o){l(p,k,n)}}else{l(p,k,n)}}})},decode:c.decode,encode:c.encodeAllRaw,insertAfter:function(j,k){k=this.get(k);return this.run(j,function(m){var l,n;l=k.parentNode;n=k.nextSibling;if(n){l.insertBefore(m,n)}else{l.appendChild(m)}return m})},isBlock:function(k){var j=k.nodeType;if(j){return !!(j===1&&g[k.nodeName])}return !!g[k]},replace:function(p,m,j){var l=this;if(e(m,"array")){p=p.cloneNode(true)}return l.run(m,function(k){if(j){f(h.grep(k.childNodes),function(n){p.appendChild(n)})}return k.parentNode.replaceChild(p,k)})},rename:function(m,j){var l=this,k;if(m.nodeName!=j.toUpperCase()){k=l.create(j);f(l.getAttribs(m),function(n){l.setAttrib(k,n.nodeName,l.getAttrib(m,n.nodeName))});l.replace(k,m,1)}return k||m},findCommonAncestor:function(l,j){var m=l,k;while(m){k=j;while(k&&m!=k){k=k.parentNode}if(m==k){break}m=m.parentNode}if(!m&&l.ownerDocument){return l.ownerDocument.documentElement}return m},toHex:function(j){var l=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(j);function k(m){m=parseInt(m).toString(16);return m.length>1?m:"0"+m}if(l){j="#"+k(l[1])+k(l[2])+k(l[3]);return j}return j},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(r){f(r.imports,function(s){q(s)});f(r.cssRules||r.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){f(s.selectorText.split(","),function(t){t=t.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(t)||!/\.[\w\-]+$/.test(t)){return}l=t;t=h._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",t);if(p&&!(t=p(t,l))){return}if(!o[t]){j.push({"class":t});o[t]=1}})}break;case 3:q(s.styleSheet);break}})}try{f(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(m,l,k){var j=this,n;if(j.doc&&typeof(m)==="string"){m=j.get(m)}if(!m){return false}k=k||this;if(!m.nodeType&&(m.length||m.length===0)){n=[];f(m,function(p,o){if(p){if(typeof(p)=="string"){p=j.doc.getElementById(p)}n.push(l.call(k,p,o))}});return n}return l.call(k,m)},getAttribs:function(k){var j;k=this.get(k);if(!k){return[]}if(b){j=[];if(k.nodeName=="OBJECT"){return k.attributes}if(k.nodeName==="OPTION"&&this.getAttrib(k,"selected")){j.push({specified:1,nodeName:"selected"})}k.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(l){j.push({specified:1,nodeName:l})});return j}return k.attributes},isEmpty:function(m,k){var r=this,o,n,q,j,l,p;m=m.firstChild;if(m){j=new h.dom.TreeWalker(m);k=k||r.schema?r.schema.getNonEmptyElements():null;do{q=m.nodeType;if(q===1){if(m.getAttribute("data-mce-bogus")){continue}l=m.nodeName.toLowerCase();if(k&&k[l]){p=m.parentNode;if(l==="br"&&r.isBlock(p)&&p.firstChild===m&&p.lastChild===m){continue}return false}n=r.getAttribs(m);o=m.attributes.length;while(o--){l=m.attributes[o].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if((q===3&&!i.test(m.nodeValue))){return false}}while(m=j.next())}return true},destroy:function(k){var j=this;if(j.events){j.events.destroy()}j.win=j.doc=j.root=j.events=null;if(!k){h.removeUnload(j.destroy)}},createRng:function(){var j=this.doc;return j.createRange?j.createRange():new h.dom.Range(this)},nodeIndex:function(n,o){var j=0,l,m,k;if(n){for(l=n.nodeType,n=n.previousSibling,m=n;n;n=n.previousSibling){k=n.nodeType;if(o&&k==3){if(k==l||!n.nodeValue.length){continue}}j++;l=k}}return j},split:function(n,m,q){var s=this,j=s.createRng(),o,l,p;function k(v){var t,r=v.childNodes,u=v.nodeType;if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=r.length-1;t>=0;t--){k(r[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){if(!s.isBlock(v.parentNode)||h.trim(v.nodeValue).length>0){return}}else{if(u==1){r=v.childNodes;if(r.length==1&&r[0]&&r[0].nodeType==1&&r[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(r[0],v)}if(r.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}s.remove(v)}return v}if(n&&m){j.setStart(n.parentNode,s.nodeIndex(n));j.setEnd(m.parentNode,s.nodeIndex(m));o=j.extractContents();j=s.createRng();j.setStart(m.parentNode,s.nodeIndex(m)+1);j.setEnd(n.parentNode,s.nodeIndex(n)+1);l=j.extractContents();p=n.parentNode;p.insertBefore(k(o),n);if(q){p.replaceChild(q,m)}else{p.insertBefore(m,n)}p.insertBefore(k(l),n);s.remove(n);return q||m}},bind:function(n,j,m,l){var k=this;if(!k.events){k.events=new h.dom.EventUtils()}return k.events.add(n,j,m,l||this)},unbind:function(m,j,l){var k=this;if(!k.events){k.events=new h.dom.EventUtils()}return k.events.remove(m,j,l)},_findSib:function(m,j,k){var l=this,n=j;if(m){if(e(n,"string")){n=function(o){return l.is(o,j)}}for(m=m[k];m;m=m[k]){if(n(m)){return m}}}return null},_isRes:function(j){return/^(top|left|bottom|right|width|height)/i.test(j)||/;\s*(top|left|bottom|right|width|height)/i.test(j)}});h.DOM=new h.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var N=this,e=c.doc,S=0,E=1,j=2,D=true,R=false,U="startOffset",h="startContainer",P="endContainer",z="endOffset",k=tinymce.extend,n=c.nodeIndex;k(N,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:D,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:I,setEndBefore:J,setEndAfter:u,collapse:A,selectNode:x,selectNodeContents:F,compareBoundaryPoints:v,deleteContents:p,extractContents:H,cloneContents:d,insertNode:C,surroundContents:M,cloneRange:K});function q(V,t){B(D,V,t)}function s(V,t){B(R,V,t)}function g(t){q(t.parentNode,n(t))}function I(t){q(t.parentNode,n(t)+1)}function J(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function A(t){if(t){N[P]=N[h];N[z]=N[U]}else{N[h]=N[P];N[U]=N[z]}N.collapsed=D}function x(t){g(t);u(t)}function F(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(Y,t){var ab=N[h],W=N[U],aa=N[P],V=N[z],Z=t.startContainer,ad=t.startOffset,X=t.endContainer,ac=t.endOffset;if(Y===0){return G(ab,W,Z,ad)}if(Y===1){return G(aa,V,Z,ad)}if(Y===2){return G(aa,V,X,ac)}if(Y===3){return G(ab,W,X,ac)}}function p(){m(j)}function H(){return m(S)}function d(){return m(E)}function C(Y){var V=this[h],t=this[U],X,W;if((V.nodeType===3||V.nodeType===4)&&V.nodeValue){if(!t){V.parentNode.insertBefore(Y,V)}else{if(t>=V.nodeValue.length){c.insertAfter(Y,V)}else{X=V.splitText(t);V.parentNode.insertBefore(Y,X)}}}else{if(V.childNodes.length>0){W=V.childNodes[t]}if(W){V.insertBefore(Y,W)}else{V.appendChild(Y)}}}function M(V){var t=N.extractContents();N.insertNode(V);V.appendChild(t);N.selectNode(V)}function K(){return k(new b(c),{startContainer:N[h],startOffset:N[U],endContainer:N[P],endOffset:N[z],collapsed:N.collapsed,commonAncestorContainer:N.commonAncestorContainer})}function O(t,V){var W;if(t.nodeType==3){return t}if(V<0){return t}W=t.firstChild;while(W&&V>0){--V;W=W.nextSibling}if(W){return W}return t}function l(){return(N[h]==N[P]&&N[U]==N[z])}function G(X,Z,V,Y){var aa,W,t,ab,ad,ac;if(X==V){if(Z==Y){return 0}if(Z<Y){return -1}return 1}aa=V;while(aa&&aa.parentNode!=X){aa=aa.parentNode}if(aa){W=0;t=X.firstChild;while(t!=aa&&W<Z){W++;t=t.nextSibling}if(Z<=W){return -1}return 1}aa=X;while(aa&&aa.parentNode!=V){aa=aa.parentNode}if(aa){W=0;t=V.firstChild;while(t!=aa&&W<Y){W++;t=t.nextSibling}if(W<Y){return -1}return 1}ab=c.findCommonAncestor(X,V);ad=X;while(ad&&ad.parentNode!=ab){ad=ad.parentNode}if(!ad){ad=ab}ac=V;while(ac&&ac.parentNode!=ab){ac=ac.parentNode}if(!ac){ac=ab}if(ad==ac){return 0}t=ab.firstChild;while(t){if(t==ad){return -1}if(t==ac){return 1}t=t.nextSibling}}function B(V,Y,X){var t,W;if(V){N[h]=Y;N[U]=X}else{N[P]=Y;N[z]=X}t=N[P];while(t.parentNode){t=t.parentNode}W=N[h];while(W.parentNode){W=W.parentNode}if(W==t){if(G(N[h],N[U],N[P],N[z])>0){N.collapse(V)}}else{N.collapse(V)}N.collapsed=l();N.commonAncestorContainer=c.findCommonAncestor(N[h],N[P])}function m(ab){var aa,X=0,ad=0,V,Z,W,Y,t,ac;if(N[h]==N[P]){return f(ab)}for(aa=N[P],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[h]){return r(aa,ab)}++X}for(aa=N[h],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[P]){return T(aa,ab)}++ad}Z=ad-X;W=N[h];while(Z>0){W=W.parentNode;Z--}Y=N[P];while(Z<0){Y=Y.parentNode;Z++}for(t=W.parentNode,ac=Y.parentNode;t!=ac;t=t.parentNode,ac=ac.parentNode){W=t;Y=ac}return o(W,Y,ab)}function f(Z){var ab,Y,X,aa,t,W,V;if(Z!=j){ab=e.createDocumentFragment()}if(N[U]==N[z]){return ab}if(N[h].nodeType==3){Y=N[h].nodeValue;X=Y.substring(N[U],N[z]);if(Z!=E){N[h].deleteData(N[U],N[z]-N[U]);N.collapse(D)}if(Z==j){return}ab.appendChild(e.createTextNode(X));return ab}aa=O(N[h],N[U]);t=N[z]-N[U];while(t>0){W=aa.nextSibling;V=y(aa,Z);if(ab){ab.appendChild(V)}--t;aa=W}if(Z!=E){N.collapse(D)}return ab}function r(ab,Y){var aa,Z,V,t,X,W;if(Y!=j){aa=e.createDocumentFragment()}Z=i(ab,Y);if(aa){aa.appendChild(Z)}V=n(ab);t=V-N[U];if(t<=0){if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}Z=ab.previousSibling;while(t>0){X=Z.previousSibling;W=y(Z,Y);if(aa){aa.insertBefore(W,aa.firstChild)}--t;Z=X}if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}function T(Z,Y){var ab,V,aa,t,X,W;if(Y!=j){ab=e.createDocumentFragment()}aa=Q(Z,Y);if(ab){ab.appendChild(aa)}V=n(Z);++V;t=N[z]-V;aa=Z.nextSibling;while(t>0){X=aa.nextSibling;W=y(aa,Y);if(ab){ab.appendChild(W)}--t;aa=X}if(Y!=E){N.setStartAfter(Z);N.collapse(D)}return ab}function o(Z,t,ac){var W,ae,Y,aa,ab,V,ad,X;if(ac!=j){ae=e.createDocumentFragment()}W=Q(Z,ac);if(ae){ae.appendChild(W)}Y=Z.parentNode;aa=n(Z);ab=n(t);++aa;V=ab-aa;ad=Z.nextSibling;while(V>0){X=ad.nextSibling;W=y(ad,ac);if(ae){ae.appendChild(W)}ad=X;--V}W=i(t,ac);if(ae){ae.appendChild(W)}if(ac!=E){N.setStartAfter(Z);N.collapse(D)}return ae}function i(aa,ab){var W=O(N[P],N[z]-1),ac,Z,Y,t,V,X=W!=N[P];if(W==aa){return L(W,X,R,ab)}ac=W.parentNode;Z=L(ac,R,R,ab);while(ac){while(W){Y=W.previousSibling;t=L(W,X,R,ab);if(ab!=j){Z.insertBefore(t,Z.firstChild)}X=D;W=Y}if(ac==aa){return Z}W=ac.previousSibling;ac=ac.parentNode;V=L(ac,R,R,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function Q(aa,ab){var X=O(N[h],N[U]),Y=X!=N[h],ac,Z,W,t,V;if(X==aa){return L(X,Y,D,ab)}ac=X.parentNode;Z=L(ac,R,D,ab);while(ac){while(X){W=X.nextSibling;t=L(X,Y,D,ab);if(ab!=j){Z.appendChild(t)}Y=D;X=W}if(ac==aa){return Z}X=ac.nextSibling;ac=ac.parentNode;V=L(ac,R,D,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function L(t,Y,ab,ac){var X,W,Z,V,aa;if(Y){return y(t,ac)}if(t.nodeType==3){X=t.nodeValue;if(ab){V=N[U];W=X.substring(V);Z=X.substring(0,V)}else{V=N[z];W=X.substring(0,V);Z=X.substring(V)}if(ac!=E){t.nodeValue=Z}if(ac==j){return}aa=t.cloneNode(R);aa.nodeValue=W;return aa}if(ac==j){return}return t.cloneNode(R)}function y(V,t){if(t!=j){return t==E?V.cloneNode(D):V}V.parentNode.removeChild(V)}}a.Range=b})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p<0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}k.setEndPoint(j?"EndToStart":"EndToEnd",i);if(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)>0){k=i.duplicate();k.collapse(j);o=-1;while(s==k.parentElement()){if(k.move("character",-1)==0){break}o++}}o=o||k.text.replace("\r\n"," ").length}else{k.collapse(true);k.setEndPoint(j?"StartToStart":"StartToEnd",i);o=k.text.replace("\r\n"," ").length}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.firstChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var u,t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p&&t.nodeType!==9){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndPoint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,s,q,r=d.dom.doc,m=r.body;function j(z){var u,y,t,x,v;t=h.create("a");u=z?k:s;y=z?p:q;x=n.duplicate();if(u==r||u==r.documentElement){u=m;y=0}if(u.nodeType==3){u.parentNode.insertBefore(t,u);x.moveToElementText(t);x.moveStart("character",y);h.remove(t);n.setEndPoint(z?"StartToStart":"EndToEnd",x)}else{v=u.childNodes;if(v.length){if(y>=v.length){h.insertAfter(t,v[v.length-1])}else{u.insertBefore(t,v[y])}x.moveToElementText(t)}else{t=r.createTextNode("\uFEFF");u.appendChild(t);x.moveToElementText(t.parentNode);x.collapse(c)}n.setEndPoint(z?"StartToStart":"EndToEnd",x);h.remove(t)}}k=i.startContainer;p=i.startOffset;s=i.endContainer;q=i.endOffset;n=m.createTextRange();if(k==s&&k.nodeType==1&&p==q-1){if(p==q-1){try{l=m.createControlRange();l.addElement(k.childNodes[p]);l.select();return}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,j=0,d=Object.prototype.toString,o=false,i=true;[0,0].sort(function(){i=false;return 0});var b=function(v,e,z,A){z=z||[];e=e||document;var C=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!v||typeof v!=="string"){return z}var x=[],s,E,H,r,u=true,t=b.isXML(e),B=v,D,G,F,y;do{p.exec("");s=p.exec(B);if(s){B=s[3];x.push(s[1]);if(s[2]){r=s[3];break}}}while(s);if(x.length>1&&k.exec(v)){if(x.length===2&&f.relative[x[0]]){E=h(x[0]+x[1],e)}else{E=f.relative[x[0]]?[e]:b(x.shift(),e);while(x.length){v=x.shift();if(f.relative[v]){v+=x.shift()}E=h(v,E)}}}else{if(!A&&x.length>1&&e.nodeType===9&&!t&&f.match.ID.test(x[0])&&!f.match.ID.test(x[x.length-1])){D=b.find(x.shift(),e,t);e=D.expr?b.filter(D.expr,D.set)[0]:D.set[0]}if(e){D=A?{expr:x.pop(),set:a(A)}:b.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&e.parentNode?e.parentNode:e,t);E=D.expr?b.filter(D.expr,D.set):D.set;if(x.length>0){H=a(E)}else{u=false}while(x.length){G=x.pop();F=G;if(!f.relative[G]){G=""}else{F=x.pop()}if(F==null){F=e}f.relative[G](H,F,t)}}else{H=x=[]}}if(!H){H=E}if(!H){b.error(G||v)}if(d.call(H)==="[object Array]"){if(!u){z.push.apply(z,H)}else{if(e&&e.nodeType===1){for(y=0;H[y]!=null;y++){if(H[y]&&(H[y]===true||H[y].nodeType===1&&b.contains(e,H[y]))){z.push(E[y])}}}else{for(y=0;H[y]!=null;y++){if(H[y]&&H[y].nodeType===1){z.push(E[y])}}}}}else{a(H,z)}if(r){b(r,C,z,A);b.uniqueSort(z)}return z};b.uniqueSort=function(r){if(c){o=i;r.sort(c);if(o){for(var e=1;e<r.length;e++){if(r[e]===r[e-1]){r.splice(e--,1)}}}}return r};b.matches=function(e,r){return b(e,null,null,r)};b.find=function(y,e,z){var x;if(!y){return[]}for(var t=0,s=f.order.length;t<s;t++){var v=f.order[t],u;if((u=f.leftMatch[v].exec(y))){var r=u[1];u.splice(1,1);if(r.substr(r.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");x=f.find[v](u,e,z);if(x!=null){y=y.replace(f.match[v],"");break}}}}if(!x){x=e.getElementsByTagName("*")}return{set:x,expr:y}};b.filter=function(C,B,F,u){var s=C,H=[],z=B,x,e,y=B&&B[0]&&b.isXML(B[0]);while(C&&B.length){for(var A in f.filter){if((x=f.leftMatch[A].exec(C))!=null&&x[2]){var r=f.filter[A],G,E,t=x[1];e=false;x.splice(1,1);if(t.substr(t.length-1)==="\\"){continue}if(z===H){H=[]}if(f.preFilter[A]){x=f.preFilter[A](x,z,F,H,u,y);if(!x){e=G=true}else{if(x===true){continue}}}if(x){for(var v=0;(E=z[v])!=null;v++){if(E){G=r(E,x,v,z);var D=u^!!G;if(F&&G!=null){if(D){e=true}else{z[v]=false}}else{if(D){H.push(E);e=true}}}}}if(G!==undefined){if(!F){z=H}C=C.replace(f.match[A],"");if(!e){return[]}break}}}if(C===s){if(e==null){b.error(C)}else{break}}s=C}return z};b.error=function(e){throw"Syntax error, unrecognized expression: "+e};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(x,r){var t=typeof r==="string",v=t&&!/\W/.test(r),y=t&&!v;if(v){r=r.toLowerCase()}for(var s=0,e=x.length,u;s<e;s++){if((u=x[s])){while((u=u.previousSibling)&&u.nodeType!==1){}x[s]=y||u&&u.nodeName.toLowerCase()===r?u||false:u===r}}if(y){b.filter(r,x,true)}},">":function(x,r){var u=typeof r==="string",v,s=0,e=x.length;if(u&&!/\W/.test(r)){r=r.toLowerCase();for(;s<e;s++){v=x[s];if(v){var t=v.parentNode;x[s]=t.nodeName.toLowerCase()===r?t:false}}}else{for(;s<e;s++){v=x[s];if(v){x[s]=u?v.parentNode:v.parentNode===r}}if(u){b.filter(r,x,true)}}},"":function(t,r,v){var s=j++,e=q,u;if(typeof r==="string"&&!/\W/.test(r)){r=r.toLowerCase();u=r;e=n}e("parentNode",r,s,t,u,v)},"~":function(t,r,v){var s=j++,e=q,u;if(typeof r==="string"&&!/\W/.test(r)){r=r.toLowerCase();u=r;e=n}e("previousSibling",r,s,t,u,v)}},find:{ID:function(r,s,t){if(typeof s.getElementById!=="undefined"&&!t){var e=s.getElementById(r[1]);return e?[e]:[]}},NAME:function(s,v){if(typeof v.getElementsByName!=="undefined"){var r=[],u=v.getElementsByName(s[1]);for(var t=0,e=u.length;t<e;t++){if(u[t].getAttribute("name")===s[1]){r.push(u[t])}}return r.length===0?null:r}},TAG:function(e,r){return r.getElementsByTagName(e[1])}},preFilter:{CLASS:function(t,r,s,e,x,y){t=" "+t[1].replace(/\\/g,"")+" ";if(y){return t}for(var u=0,v;(v=r[u])!=null;u++){if(v){if(x^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(t)>=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){return r[1].toLowerCase()},CHILD:function(e){if(e[1]==="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=j++;return e},ATTR:function(u,r,s,e,v,x){var t=u[1].replace(/\\/g,"");if(!x&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if((p.exec(u[3])||"").length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toLowerCase()==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return r<e[3]-0},gt:function(s,r,e){return r>e[3]-0},nth:function(s,r,e){return e[3]-0===r},eq:function(s,r,e){return e[3]-0===r}},filter:{PSEUDO:function(s,y,x,z){var e=y[1],r=f.filters[e];if(r){return r(s,x,y,z)}else{if(e==="contains"){return(s.textContent||s.innerText||b.getText([s])||"").indexOf(y[3])>=0}else{if(e==="not"){var t=y[3];for(var v=0,u=t.length;v<u;v++){if(t[v]===s){return false}}return true}else{b.error("Syntax error, unrecognized expression: "+e)}}}},CHILD:function(e,t){var x=t[1],r=e;switch(x){case"only":case"first":while((r=r.previousSibling)){if(r.nodeType===1){return false}}if(x==="first"){return true}r=e;case"last":while((r=r.nextSibling)){if(r.nodeType===1){return false}}return true;case"nth":var s=t[2],A=t[3];if(s===1&&A===0){return true}var v=t[0],z=e.parentNode;if(z&&(z.sizcache!==v||!e.nodeIndex)){var u=0;for(r=z.firstChild;r;r=r.nextSibling){if(r.nodeType===1){r.nodeIndex=++u}}z.sizcache=v}var y=e.nodeIndex-A;if(s===0){return y===0}else{return(y%s===0&&y/s>=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName.toLowerCase()===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),x=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?x===r:u==="*="?x.indexOf(r)>=0:u==="~="?(" "+x+" ").indexOf(r)>=0:!r?x&&e!==false:u==="!="?x!==r:u==="^="?x.indexOf(r)===0:u==="$="?x.substr(x.length-r.length)===r:u==="|="?x===r||x.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var k=f.match.POS,g=function(r,e){return"\\"+(e-0+1)};for(var m in f.match){f.match[m]=new RegExp(f.match[m].source+(/(?![^\[]*\])(?![^\(]*\))/.source));f.leftMatch[m]=new RegExp(/(^(?:.|\r|\n)*?)/.source+f.match[m].source.replace(/\\(\d+)/g,g))}var a=function(r,e){r=Array.prototype.slice.call(r,0);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(l){a=function(u,t){var r=t||[],s=0;if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var e=u.length;s<e;s++){r.push(u[s])}}else{for(;u[s];s++){r.push(u[s])}}}return r}}var c;if(document.documentElement.compareDocumentPosition){c=function(r,e){if(!r.compareDocumentPosition||!e.compareDocumentPosition){if(r==e){o=true}return r.compareDocumentPosition?-1:1}var s=r.compareDocumentPosition(e)&4?-1:r===e?0:1;if(s===0){o=true}return s}}else{if("sourceIndex" in document.documentElement){c=function(r,e){if(!r.sourceIndex||!e.sourceIndex){if(r==e){o=true}return r.sourceIndex?-1:1}var s=r.sourceIndex-e.sourceIndex;if(s===0){o=true}return s}}else{if(document.createRange){c=function(t,r){if(!t.ownerDocument||!r.ownerDocument){if(t==r){o=true}return t.ownerDocument?-1:1}var s=t.ownerDocument.createRange(),e=r.ownerDocument.createRange();s.setStart(t,0);s.setEnd(t,0);e.setStart(r,0);e.setEnd(r,0);var u=s.compareBoundaryPoints(Range.START_TO_END,e);if(u===0){o=true}return u}}}}b.getText=function(e){var r="",t;for(var s=0;e[s];s++){t=e[s];if(t.nodeType===3||t.nodeType===4){r+=t.nodeValue}else{if(t.nodeType!==8){r+=b.getText(t.childNodes)}}}return r};(function(){var r=document.createElement("div"),s="script"+(new Date()).getTime();r.innerHTML="<a name='"+s+"'/>";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(document.getElementById(s)){f.find.ID=function(u,v,x){if(typeof v.getElementById!=="undefined"&&!x){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r);e=r=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="<p class='TEST'></p>";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(x,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!b.isXML(v)){try{return a(v.querySelectorAll(x),t)}catch(y){}}return e(x,v,t,u)};for(var r in e){b[r]=e[r]}s=null})()}(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}};e=null})();function n(r,x,v,A,y,z){for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1&&!z){e.sizcache=v;e.sizset=t}if(e.nodeName.toLowerCase()===x){u=e;break}e=e[r]}A[t]=u}}}function q(r,x,v,A,y,z){for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1){if(!z){e.sizcache=v;e.sizset=t}if(typeof x!=="string"){if(e===x){u=true;break}}else{if(b.filter(x,[e]).length>0){u=e;break}}}e=e[r]}A[t]=u}}}b.contains=document.compareDocumentPosition?function(r,e){return !!(r.compareDocumentPosition(e)&16)}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};b.isXML=function(e){var r=(e?e.ownerDocument||e:0).documentElement;return r?r.nodeName!=="HTML":false};var h=function(e,y){var t=[],u="",v,s=y.nodeType?[y]:y;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var x=0,r=s.length;x<r;x++){b(e,s[x],t)}return b.filter(u,t)};window.tinymce.dom.Sizzle=b})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(m,p,l,j){var g,h=this,i=h.events,k;if(p instanceof Array){k=[];f(p,function(o){k.push(h.add(m,o,l,j))});return k}if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.add(n,p,l,j))});return k}m=c.get(m);if(!m){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}d.extend(n,h._stoppers)}if(!j){return l(n)}return l.call(j,n)};if(p=="unload"){d.unloads.unshift({func:g});return g}if(p=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}i.push({obj:m,name:p,func:l,cfunc:g,scope:j});h._add(m,p,g);return l},remove:function(l,m,k){var h=this,g=h.events,i=false,j;if(l&&l.hasOwnProperty&&l instanceof Array){j=[];f(l,function(n){n=c.get(n);j.push(h.remove(n,m,k))});return j}l=c.get(l);f(g,function(o,n){if(o.obj==l&&o.name==m&&(!k||(o.func==k||o.cfunc==k))){g.splice(n,1);h._remove(l,m,o.cfunc);i=true;return false}});return i},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j<arguments.length;j++){h.push(arguments[j])}h=e[g].apply(e,h);b.update(g);return h}});a.extend(b,{on:function(i,h,g){return a.dom.Event.add(b.id,i,h,g)},getXY:function(){return{x:parseInt(b.getStyle("left")),y:parseInt(b.getStyle("top"))}},getSize:function(){var g=e.get(b.id);return{w:parseInt(b.getStyle("width")||g.clientWidth),h:parseInt(b.getStyle("height")||g.clientHeight)}},moveTo:function(g,h){b.setStyles({left:g,top:h})},moveBy:function(g,i){var h=b.getXY();b.moveTo(h.x+g,h.y+i)},resizeTo:function(g,i){b.setStyles({width:g,height:i})},resizeBy:function(g,j){var i=b.getSize();b.resizeTo(i.w+g,i.h+j)},update:function(h){var g;if(a.isIE6&&d.blocker){h=h||"";if(h.indexOf("get")===0||h.indexOf("has")===0||h.indexOf("is")===0){return}if(h=="remove"){e.remove(b.blocker);return}if(!b.blocker){b.blocker=e.uniqueId();g=e.add(d.container||e.getRoot(),"iframe",{id:b.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});e.setStyle(g,"opacity",0)}else{g=e.get(b.blocker)}e.setStyles(g,{left:b.getStyle("left",1),top:b.getStyle("top",1),width:b.getStyle("width",1),height:b.getStyle("height",1),display:b.getStyle("display",1),zIndex:parseInt(b.getStyle("zIndex",1)||0)-1})}}})}})(tinymce);(function(c){function e(f){return f.replace(/[\n\r]+/g,"")}var b=c.is,a=c.isIE,d=c.each;c.create("tinymce.dom.Selection",{Selection:function(i,h,g){var f=this;f.dom=i;f.win=h;f.serializer=g;d(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(j){f[j]=new c.util.Dispatcher(f)});if(!f.win.getSelection){f.tridentSel=new c.dom.TridentSelection(f)}if(c.isIE&&i.boxModel){this._fixIESelection()}c.addUnload(f.destroy,f)},setCursorLocation:function(h,i){var f=this;var g=f.dom.createRng();g.setStart(h,i);g.setEnd(h,i);f.setRng(g);f.collapse(false)},getContent:function(g){var f=this,h=f.getRng(),l=f.dom.create("body"),j=f.getSel(),i,k,m;g=g||{};i=k="";g.get=true;g.format=g.format||"html";g.forced_root_block="";f.onBeforeGetContent.dispatch(f,g);if(g.format=="text"){return f.isCollapsed()?"":(h.text||(j.toString?j.toString():""))}if(h.cloneContents){m=h.cloneContents();if(m){l.appendChild(m)}}else{if(b(h.item)||b(h.htmlText)){l.innerHTML="<br>"+(h.item?h.item(0).outerHTML:h.htmlText);l.removeChild(l.firstChild)}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(g,i){var n=this,f=n.getRng(),j,k=n.win.document,m,l;i=i||{format:"html"};i.set=true;g=i.content=g;if(!i.no_events){n.onBeforeSetContent.dispatch(n,i)}g=i.content;if(f.insertNode){g+='<span id="__caret">_</span>';if(f.startContainer==k&&f.endContainer==k){k.body.innerHTML=g}else{f.deleteContents();if(k.body.childNodes.length==0){k.body.innerHTML=g}else{if(f.createContextualFragment){f.insertNode(f.createContextualFragment(g))}else{m=k.createDocumentFragment();l=k.createElement("div");m.appendChild(l);l.outerHTML=g;f.insertNode(m)}}}j=n.dom.get("__caret");f=k.createRange();f.setStartBefore(j);f.setEndBefore(j);n.setRng(f);n.dom.remove("__caret");try{n.setRng(f)}catch(h){}}else{if(f.item){k.execCommand("Delete",false,null);f=n.getRng()}if(/^\s+/.test(g)){f.pasteHTML('<span id="__mce_tmp">_</span>'+g);n.dom.remove("__mce_tmp")}else{f.pasteHTML(g)}}if(!i.no_events){n.onSetContent.dispatch(n,i)}},getStart:function(){var g=this.getRng(),h,f,j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}j=g.duplicate();j.collapse(1);h=j.parentElement();f=i=g.parentElement();while(i=i.parentNode){if(i==h){h=f;break}}return h}else{h=g.startContainer;if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[Math.min(h.childNodes.length-1,g.startOffset)]}if(h&&h.nodeType==3){return h.parentNode}return h}},getEnd:function(){var g=this,h=g.getRng(),i,f;if(h.duplicate||h.item){if(h.item){return h.item(0)}h=h.duplicate();h.collapse(0);i=h.parentElement();if(i&&i.nodeName=="BODY"){return i.lastChild||i}return i}else{i=h.endContainer;f=h.endOffset;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[f>0?f-1:f]}if(i&&i.nodeType==3){return i.parentNode}return i}},getBookmark:function(r,s){var v=this,m=v.dom,g,j,i,n,h,o,p,l="\uFEFF",u;function f(x,y){var t=0;d(m.select(x),function(A,z){if(A==y){t=z}});return t}if(r==2){function k(){var x=v.getRng(true),t=m.getRoot(),y={};function z(C,H){var B=C[H?"startContainer":"endContainer"],G=C[H?"startOffset":"endOffset"],A=[],D,F,E=0;if(B.nodeType==3){if(s){for(D=B.previousSibling;D&&D.nodeType==3;D=D.previousSibling){G+=D.nodeValue.length}}A.push(G)}else{F=B.childNodes;if(G>=F.length&&F.length){E=1;G=Math.max(0,F.length-1)}A.push(v.dom.nodeIndex(F[G],s)+E)}for(;B&&B!=t;B=B.parentNode){A.push(v.dom.nodeIndex(B,s))}return A}y.start=z(x,true);if(!v.isCollapsed()){y.end=z(x)}return y}if(v.tridentSel){return v.tridentSel.getBookmark(r)}return k()}if(r){return{rng:v.getRng()}}g=v.getRng();i=m.uniqueId();n=tinyMCE.activeEditor.selection.isCollapsed();u="overflow:hidden;line-height:0px";if(g.duplicate||g.item){if(!g.item){j=g.duplicate();try{g.collapse();g.pasteHTML('<span data-mce-type="bookmark" id="'+i+'_start" style="'+u+'">'+l+"</span>");if(!n){j.collapse(false);g.moveToElementText(j.parentElement());if(g.compareEndPoints("StartToEnd",j)==0){j.move("character",-1)}j.pasteHTML('<span data-mce-type="bookmark" id="'+i+'_end" style="'+u+'">'+l+"</span>")}}catch(q){return null}}else{o=g.item(0);h=o.nodeName;return{name:h,index:f(h,o)}}}else{o=v.getNode();h=o.nodeName;if(h=="IMG"){return{name:h,index:f(h,o)}}j=g.cloneRange();if(!n){j.collapse(false);j.insertNode(m.create("span",{"data-mce-type":"bookmark",id:i+"_end",style:u},l))}g.collapse(true);g.insertNode(m.create("span",{"data-mce-type":"bookmark",id:i+"_start",style:u},l))}v.moveToBookmark({id:i,keep:1});return{id:i}},moveToBookmark:function(n){var r=this,l=r.dom,i,h,f,q,j,s,o,p;if(n){if(n.start){f=l.createRng();q=l.getRoot();function g(z){var t=n[z?"start":"end"],v,x,y,u;if(t){y=t[0];for(x=q,v=t.length-1;v>=1;v--){u=x.childNodes;if(t[v]>u.length-1){return}x=u[t[v]]}if(x.nodeType===3){y=Math.min(t[0],x.nodeValue.length)}if(x.nodeType===1){y=Math.min(t[0],x.childNodes.length)}if(z){f.setStart(x,y)}else{f.setEnd(x,y)}}return true}if(r.tridentSel){return r.tridentSel.moveToBookmark(n)}if(g(true)&&g()){r.setRng(f)}}else{if(n.id){function k(A){var u=l.get(n.id+"_"+A),z,t,x,y,v=n.keep;if(u){z=u.parentNode;if(A=="start"){if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}j=s=z;o=p=t}else{if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}s=z;p=t}if(!v){y=u.previousSibling;x=u.nextSibling;d(c.grep(u.childNodes),function(B){if(B.nodeType==3){B.nodeValue=B.nodeValue.replace(/\uFEFF/g,"")}});while(u=l.get(n.id+"_"+A)){l.remove(u,1)}if(y&&x&&y.nodeType==x.nodeType&&y.nodeType==3&&!c.isOpera){t=y.nodeValue.length;y.appendData(x.nodeValue);l.remove(x);if(A=="start"){j=s=y;o=p=t}else{s=y;p=t}}}}}function m(t){if(l.isBlock(t)&&!t.innerHTML){t.innerHTML=!a?'<br data-mce-bogus="1" />':" "}return t}k("start");k("end");if(j){f=l.createRng();f.setStart(m(j),o);f.setEnd(m(s),p);r.setRng(f)}}else{if(n.name){r.select(l.select(n.name)[n.index])}else{if(n.rng){r.setRng(n.rng)}}}}}},select:function(k,j){var i=this,l=i.dom,g=l.createRng(),f;if(k){f=l.nodeIndex(k);g.setStart(k.parentNode,f);g.setEnd(k.parentNode,f+1);if(j){function h(m,o){var n=new c.dom.TreeWalker(m,m);do{if(m.nodeType==3&&c.trim(m.nodeValue).length!=0){if(o){g.setStart(m,0)}else{g.setEnd(m,m.nodeValue.length)}return}if(m.nodeName=="BR"){if(o){g.setStartBefore(m)}else{g.setEndBefore(m)}return}}while(m=(o?n.next():n.prev()))}h(k,1);h(k)}i.setRng(g)}return k},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}if(h.compareEndPoints){return h.compareEndPoints("StartToEnd",h)===0}return !g||h.collapsed},collapse:function(f){var h=this,g=h.getRng(),i;if(g.item){i=g.item(0);g=h.win.document.body.createTextRange();g.moveToElementText(i)}g.collapse(!!f);h.setRng(g)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(l){var g=this,h,i,k,j=g.win.document;if(l&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():j.createRange())}}catch(f){}if(c.isIE&&i&&i.setStart&&j.selection.createRange().item){k=j.selection.createRange().item(0);i=j.createRange();i.setStartBefore(k);i.setEndAfter(k)}if(!i){i=j.createRange?j.createRange():j.body.createTextRange()}if(g.selectedRange&&g.explicitRange){if(i.compareBoundaryPoints(i.START_TO_START,g.selectedRange)===0&&i.compareBoundaryPoints(i.END_TO_END,g.selectedRange)===0){i=g.explicitRange}else{g.selectedRange=null;g.explicitRange=null}}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){g.explicitRange=i;try{h.removeAllRanges()}catch(f){}h.addRange(i);g.selectedRange=h.getRangeAt(0)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var h=this,g=h.getRng(),i=h.getSel(),l,k=g.startContainer,f=g.endContainer;if(!g){return h.dom.getRoot()}if(g.setStart){l=g.commonAncestorContainer;if(!g.collapsed){if(g.startContainer==g.endContainer){if(g.endOffset-g.startOffset<2){if(g.startContainer.hasChildNodes()){l=g.startContainer.childNodes[g.startOffset]}}}if(k.nodeType===3&&f.nodeType===3){function j(p,m){var o=p;while(p&&p.nodeType===3&&p.length===0){p=m?p.nextSibling:p.previousSibling}return p||o}if(k.length===g.startOffset){k=j(k.nextSibling,true)}else{k=k.parentNode}if(g.endOffset===0){f=j(f.previousSibling,false)}else{f=f.parentNode}if(k&&k===f){return k}}}if(l&&l.nodeType==3){return l.parentNode}return l}return g.item?g.item(0):g.parentElement()},getSelectedBlocks:function(o,g){var m=this,j=m.dom,l,k,h,i=[];l=j.getParent(o||m.getStart(),j.isBlock);k=j.getParent(g||m.getEnd(),j.isBlock);if(l){i.push(l)}if(l&&k&&l!=k){h=l;var f=new c.dom.TreeWalker(l,j.getRoot());while((h=f.next())&&h!=k){if(j.isBlock(h)){i.push(h)}}}if(k&&l!=k){i.push(k)}return i},normalize:function(){var g=this,f,i;if(c.isIE){return}function h(p){var k,o,n,m=g.dom,j=m.getRoot(),l;k=f[(p?"start":"end")+"Container"];o=f[(p?"start":"end")+"Offset"];if(k.nodeType===9){k=k.body;o=0}if(k===j){if(k.hasChildNodes()){k=k.childNodes[Math.min(!p&&o>0?o-1:o,k.childNodes.length-1)];o=0;if(k.hasChildNodes()){l=k;n=new c.dom.TreeWalker(k,j);do{if(l.nodeType===3){o=p?0:l.nodeValue.length-1;k=l;break}if(l.nodeName==="BR"){o=m.nodeIndex(l);k=l.parentNode;break}}while(l=(p?n.next():n.prev()));i=true}}}if(i){f["set"+(p?"Start":"End")](k,o)}}f=g.getRng();h(true);if(f.collapsed){h()}if(i){g.setRng(f)}},destroy:function(g){var f=this;f.win=null;if(!g){c.removeUnload(f.destroy)}},_fixIESelection:function(){var g=this.dom,m=g.doc,h=m.body,j,n,f;m.documentElement.unselectable=true;function i(o,r){var p=h.createTextRange();try{p.moveToPoint(o,r)}catch(q){p=null}return p}function l(p){var o;if(p.button){o=i(p.x,p.y);if(o){if(o.compareEndPoints("StartToStart",n)>0){o.setEndPoint("StartToStart",n)}else{o.setEndPoint("EndToEnd",n)}o.select()}}else{k()}}function k(){var o=m.selection.createRange();if(n&&!o.item&&o.compareEndPoints("StartToEnd",o)===0){n.select()}g.unbind(m,"mouseup",k);g.unbind(m,"mousemove",l);n=j=0}g.bind(m,["mousedown","contextmenu"],function(o){if(o.target.nodeName==="HTML"){if(j){k()}f=m.documentElement;if(f.scrollHeight>f.clientHeight){return}j=1;n=i(o.x,o.y);if(n){g.bind(m,"mouseup",k);g.bind(m,"mousemove",l);g.win.focus();n.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}e.remove_trailing_brs=true;i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/\s*mce(Item\w+|Selected)\s*/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g,"").replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// <![CDATA[\n"+j(o)+"\n// ]]>"}}else{if(o.length>0){n.firstChild.value="<!--\n"+j(o)+"\n-->"}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(m.getInner?o.innerHTML:a.trim(i.getOuterHTML(o),m),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF|\u200B/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],f={},d=[],g=0,e;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=q.create("script",{id:n,type:"text/javascript",src:a._addVer(m)});if(!a.isIE){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==e){j.push(m);l[m]=c}if(q){if(!f[m]){f[m]=[]}f[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(f[r],function(s){s.func.call(s.scope)});f[r]=e}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);tinymce.dom.TreeWalker=function(a,c){var b=a;function d(i,f,e,j){var h,g;if(i){if(!j&&i[f]){return i[f]}if(i!=c){h=i[e];if(h){return h}for(g=i.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","previousSibling",e))}};(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var i=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,g,o,h,r,q,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function f(u){var v;v=u[0];if(v.nodeType===3&&v===i&&l>=v.nodeValue.length){u.splice(0,1)}v=u[u.length-1];if(m===0&&u.length>0&&v===t&&v.nodeType===3){u.splice(u.length-1,1)}return u}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(h=x,r=h.parentNode;h&&h!=v;h=r){r=h.parentNode;q=p(h==x?h:h[u],u);if(q.length){if(!y){q.reverse()}s(f(q))}}}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}if(i==t){return s(f([i]))}j=c.findCommonAncestor(i,t);for(h=i;h;h=h.parentNode){if(h===t){return k(i,j,true)}if(h===j){break}}for(h=t;h;h=h.parentNode){if(h===i){return k(t,j)}if(h===j){break}}g=n(i,j)||i;o=n(t,j)||t;k(i,g,true);q=p(g==i?g:g.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(f(q))}k(t,o)};this.split=function(e){var h=e.startContainer,d=e.startOffset,i=e.endContainer,g=e.endOffset;function f(j,k){return j.splitText(k)}if(h==i&&h.nodeType==3){if(d>0&&d<h.nodeValue.length){i=f(h,d);h=i.previousSibling;if(g>d){g=g-d;h=i=f(i,g).previousSibling;g=i.nodeValue.length;d=0}else{g=0}}}else{if(h.nodeType==3&&d>0&&d<h.nodeValue.length){h=f(h,d);d=0}if(i.nodeType==3&&g>0&&g<i.nodeValue.length){i=f(i,g).previousSibling;g=i.nodeValue.length}}return{startContainer:h,startOffset:d,endContainer:i,endOffset:g}}};a.dom.RangeUtils.compareRanges=function(c,b){if(c&&b){if(c.item||c.duplicate){if(c.item&&b.item&&c.item(0)===b.item(0)){return true}if(c.isEqual&&b.isEqual&&b.isEqual(c)){return true}}else{return c.startContainer==b.startContainer&&c.startOffset==b.startOffset}}return false}})(tinymce);(function(b){var a=b.dom.Event,c=b.each;b.create("tinymce.ui.KeyboardNavigation",{KeyboardNavigation:function(e,f){var p=this,m=e.root,l=e.items,n=e.enableUpDown,i=e.enableLeftRight||!e.enableUpDown,k=e.excludeFromTabOrder,j,h,o,d,g;f=f||b.DOM;j=function(q){g=q.target.id};h=function(q){f.setAttrib(q.target.id,"tabindex","-1")};d=function(q){var r=f.get(g);f.setAttrib(r,"tabindex","0");r.focus()};p.focus=function(){f.get(g).focus()};p.destroy=function(){c(l,function(q){f.unbind(f.get(q.id),"focus",j);f.unbind(f.get(q.id),"blur",h)});f.unbind(f.get(m),"focus",d);f.unbind(f.get(m),"keydown",o);l=f=m=p.focus=j=h=o=d=null;p.destroy=function(){}};p.moveFocus=function(u,r){var q=-1,t=p.controls,s;if(!g){return}c(l,function(x,v){if(x.id===g){q=v;return false}});q+=u;if(q<0){q=l.length-1}else{if(q>=l.length){q=0}}s=l[q];f.setAttrib(g,"tabindex","-1");f.setAttrib(s.id,"tabindex","0");f.get(s.id).focus();if(e.actOnFocus){e.onAction(s.id)}if(r){a.cancel(r)}};o=function(y){var u=37,t=39,x=38,z=40,q=27,s=14,r=13,v=32;switch(y.keyCode){case u:if(i){p.moveFocus(-1)}break;case t:if(i){p.moveFocus(1)}break;case x:if(n){p.moveFocus(-1)}break;case z:if(n){p.moveFocus(1)}break;case q:if(e.onCancel){e.onCancel();a.cancel(y)}break;case s:case r:case v:if(e.onAction){e.onAction(g);a.cancel(y)}break}};c(l,function(s,q){var r;if(!s.id){s.id=f.uniqueId("_mce_item_")}if(k){f.bind(s.id,"blur",h);r="-1"}else{r=(q===0?"0":"-1")}f.setAttrib(s.id,"tabindex",r);f.bind(f.get(s.id),"focus",j)});if(l[0]){g=l[0].id}f.setAttrib(m,"tabindex","-1");f.bind(f.get(m),"focus",d);f.bind(f.get(m),"keydown",o)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.select("#menu_"+g.id)[0];h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a role="button" id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" aria-labelledby="'+this.id+'_voice" title="'+a.encode(e.title)+'">';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+='<img class="mceIcon" src="'+e.image+'" alt="'+a.encode(e.title)+'" />'+c}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")}d+='<span class="mceVoiceLabel mceIconOnly" style="display: none;" id="'+this.id+'_voice">'+e.title+"</span>";d+="</a>";return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(i,h,f){var g=this;g.parent(i,h,f);g.items=[];g.onChange=new a(g);g.onPostRender=new a(g);g.onAdd=new a(g);g.onRenderMenu=new d.util.Dispatcher(this);g.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var h=this,i,j,g;if(f!=h.selectedIndex){i=c.get(h.id+"_text");g=c.get(h.id+"_voiceDesc");j=h.items[f];if(j){h.selectedValue=j.value;h.selectedIndex=f;c.setHTML(i,c.encode(j.title));c.setHTML(g,h.settings.title+" - "+j.title);c.removeClass(i,"mceTitle");c.setAttrib(h.id,"aria-valuenow",j.title)}else{c.setHTML(i,c.encode(h.settings.title));c.setHTML(g,c.encode(h.settings.title));c.addClass(i,"mceTitle");h.selectedValue=h.selectedIndex=null;c.setAttrib(h.id,"aria-valuenow",h.settings.title)}i=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='<span role="listbox" aria-haspopup="true" aria-labelledby="'+f.id+'_voiceDesc" aria-describedby="'+f.id+'_voiceDesc"><table role="presentation" tabindex="0" id="'+f.id+'" cellpadding="0" cellspacing="0" class="'+j+" "+j+"Enabled"+(g["class"]?(" "+g["class"]):"")+'"><tbody><tr>';i+="<td>"+c.createHTML("span",{id:f.id+"_voiceDesc","class":"voiceLabel",style:"display:none;"},f.settings.title);i+=c.createHTML("a",{id:f.id+"_text",tabindex:-1,href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},c.encode(f.settings.title))+"</td>";i+="<td>"+c.createHTML("a",{id:f.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},'<span><span style="display:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span></span>')+"</td>";i+="</tr></tbody></table></span>";return i},showMenu:function(){var g=this,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(j){if(j.value===g.selectedValue){f.items[j.id].setSelected(1);g.oldID=j.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(f.menu&&f.menu.isMenuVisible){c.removeClass(f.id,f.classPrefix+"Selected");if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(function(){g.hideMenu();g.focus()});f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){if(h.value===undefined){f.add({title:h.title,role:"option","class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}})}else{h.id=c.uniqueId();h.role="option";h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)}});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id,"keydown",function(h){if(h.keyCode==32){f.showMenu(h);b.cancel(h)}});b.add(f.id,"focus",function(){if(!f._focused){f.keyDownHandler=b.add(f.id,"keydown",function(h){if(h.keyCode==40){f.showMenu();b.cancel(h)}});f.keyPressHandler=b.add(f.id,"keypress",function(i){var h;if(i.keyCode==13){h=f.selectedValue;f.selectedValue=null;b.cancel(i);f.settings.onselect(h)}})}f._focused=1});b.add(f.id,"blur",function(){b.remove(f.id,"keydown",f.keyDownHandler);b.remove(f.id,"keypress",f.keyPressHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f;this.setAriaProperty("disabled",f)},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox","aria-labelledby":f.id+"_aria"},g);g+=c.createHTML("span",{id:f.id+"_aria",style:"display: none"},f.settings.title);return g},postRender:function(){var g=this,h,i=true;g.rendered=true;function f(k){var j=g.items[k.target.selectedIndex-1];if(j&&(j=j.value)){g.onChange.dispatch(g,j);if(g.settings.onselect){g.settings.onselect(j)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(k){var j;b.remove(g.id,"change",h);i=false;j=b.add(g.id,"blur",function(){if(i){return}i=true;b.add(g.id,"change",f);b.remove(g.id,"blur",j)});if(d.isWebKit&&(k.keyCode==37||k.keyCode==39)){return b.prevent(k)}if(k.keyCode==13||k.keyCode==32){f(k);return b.cancel(k)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+="<td >"+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'<span style="display:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span>');i+="<td >"+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";i=b.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("div",{id:f.id,role:"button",tabindex:"0","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0;f.onHideMenu.dispatch()}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(i){i=i.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");g=c.add(g,"a",{role:"option",href:"javascript:;",style:{backgroundColor:"#"+i},title:p.editor.getLang("colors."+i,i),"data-mce-color":"#"+i});if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+i;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");new d.ui.KeyboardNavigation({root:p.id+"_menu",items:c.select("a",p.id+"_menu"),onCancel:function(){p.hideMenu();p.focus()}});a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return a.cancel(i)});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('<div id="'+f.id+'" role="group" aria-labelledby="'+f.id+'_voice">');i.push("<span role='application'>");i.push('<span id="'+f.id+'_voice" class="mceVoiceLabel" style="display:none;">'+d.encode(g.name)+"</span>");j(e,function(h){i.push(h.renderHTML())});i.push("</span>");i.push("</div>");return i.join("")},focus:function(){var e=this;d.get(e.id).focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){if(b.isWebKit){d.get(f.editor.id+"_ifr").focus()}f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e<l.length;e++){k=l[e];d=l[e-1];g=l[e+1];if(e===0){j="mceToolbarStart";if(k.Button){j+=" mceToolbarStartButton"}else{if(k.SplitButton){j+=" mceToolbarStartSplitButton"}else{if(k.ListBox){j+=" mceToolbarStartListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,"<!-- IE -->"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,"<!-- IE -->"))}}if(c.stdMode){f+='<td style="position: relative">'+k.renderHTML()+"</td>"}else{f+="<td>"+k.renderHTML()+"</td>"}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,"<!-- IE -->"))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,"<!-- IE -->"));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},"<tbody><tr>"+f+"</tr></tbody>")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}if(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(q){var n=this,p,l=j.ScriptLoader,u,o=[],m;function r(x,y,t){var v=x[y];if(!v){return}if(j.is(v,"string")){t=v.replace(/\.\w+$/,"");t=t?j.resolve(t):0;v=j.resolve(v)}return v.apply(t||this,Array.prototype.slice.call(arguments,2))}q=d({theme:"simple",language:"en"},q);n.settings=q;i.add(document,"init",function(){var s,v;r(q,"onpageload");switch(q.mode){case"exact":s=q.elements||"";if(s.length>0){g(e(s),function(x){if(k.get(x)){m=new j.Editor(x,q);o.push(m);m.render(1)}else{g(document.forms,function(y){g(y.elements,function(z){if(z.name===x){x="mce_editor_"+c++;k.setAttrib(z,"id",x);m=new j.Editor(x,q);o.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function t(y,x){return x.constructor===RegExp?x.test(y.className):k.hasClass(y,x)}g(k.select("textarea"),function(x){if(q.editor_deselector&&t(x,q.editor_deselector)){return}if(!q.editor_selector||t(x,q.editor_selector)){u=k.get(x.name);if(!x.id&&!u){x.id=x.name}if(!x.id||n.get(x.id)){x.id=k.uniqueId()}m=new j.Editor(x.id,q);o.push(m);m.render(1)}});break}if(q.oninit){s=v=0;g(o,function(x){v++;if(!x.initialized){x.onInit.add(function(){s++;if(s==v){r(q,"oninit")}})}else{s++}if(s==v){r(q,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l<o.length;l++){if(o[l]==n){o.splice(l,1);break}}if(m.activeEditor==n){m._setActive(o[0])}n.destroy();m.onRemoveEditor.dispatch(m,n);return n},execCommand:function(r,p,o){var q=this,n=q.get(o),l;switch(r){case"mceFocus":n.focus();return true;case"mceAddEditor":case"mceAddControl":if(!q.get(o)){new j.Editor(o,q.settings).render()}return true;case"mceAddFrameControl":l=o.window;l.tinyMCE=tinyMCE;l.tinymce=j;j.DOM.doc=l.document;j.DOM.win=l;n=new j.Editor(o.element_id,o);n.render();if(j.isIE){function m(){n.destroy();l.detachEvent("onunload",m);l=l.tinyMCE=l.tinymce=null}l.attachEvent("onunload",m)}o.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(n){n.remove()}return true;case"mceToggleEditor":if(!n){q.execCommand("mceAddControl",0,o);return true}if(n.isHidden()){n.show()}else{n.hide()}return true}if(q.activeEditor){return q.activeEditor.execCommand(r,p,o)}return false},execInstanceCommand:function(p,o,n,m){var l=this.get(p);if(l){return l.execCommand(o,n,m)}return false},triggerSave:function(){g(this.editors,function(l){l.save()})},addI18n:function(n,q){var l,m=this.i18n;if(!j.is(n,"string")){g(n,function(r,p){g(r,function(t,s){g(t,function(v,u){if(s==="common"){m[p+"."+u]=v}else{m[p+"."+s+"."+u]=v}})})})}else{g(q,function(r,p){m[n+"."+p]=r})}},_setActive:function(l){this.selectedInstance=this.activeEditor=l}})})(tinymce);(function(m){var n=m.DOM,j=m.dom.Event,f=m.extend,k=m.util.Dispatcher,i=m.each,a=m.isGecko,b=m.isIE,e=m.isWebKit,d=m.is,h=m.ThemeManager,c=m.PluginManager,o=m.inArray,l=m.grep,g=m.explode;m.create("tinymce.Editor",{Editor:function(r,q){var p=this;p.id=p.editorId=r;p.execCommands={};p.queryStateCommands={};p.queryValueCommands={};p.isNotDirty=false;p.plugins={};i(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(s){p[s]=new k(p)});p.settings=q=f({id:r,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:m.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:m.isIE6?'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">':"<!DOCTYPE>",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,inline_styles:1,convert_fonts_to_spans:true,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr",validate:true,entity_encoding:"named",url_converter:p.convertURL,url_converter_scope:p,ie7_compat:true},q);p.documentBaseURI=new m.util.URI(q.document_base_url||m.documentBaseURL,{base_uri:tinyMCE.baseURI});p.baseURI=m.baseURI;p.contentCSS=[];p.execCallback("setup",p)},render:function(r){var u=this,v=u.settings,x=u.id,p=m.ScriptLoader;if(!j.domLoaded){j.add(document,"init",function(){u.render()});return}tinyMCE.settings=v;if(!u.getElement()){return}if(m.isIDevice&&!m.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(u.getElement().nodeName)&&v.hidden_input&&n.getParent(x,"form")){n.insertAfter(n.create("input",{type:"hidden",name:x}),x)}if(m.WindowManager){u.windowManager=new m.WindowManager(u)}if(v.encoding=="xml"){u.onGetContent.add(function(s,t){if(t.save){t.content=n.encode(t.content)}})}if(v.add_form_submit_trigger){u.onSubmit.addToTop(function(){if(u.initialized){u.save();u.isNotDirty=1}})}if(v.add_unload_trigger){u._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(u.initialized&&!u.destroyed&&!u.isHidden()){u.save({format:"raw",no_events:true})}})}m.addUnload(u.destroy,u);if(v.submit_patch){u.onBeforeRenderUI.add(function(){var s=u.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){u.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){m.triggerSave();u.isNotDirty=1;return u.formElement._mceOldSubmit(u.formElement)}}s=null})}function q(){if(v.language&&v.language_load!==false){p.add(m.baseURL+"/langs/"+v.language+".js")}if(v.theme&&v.theme.charAt(0)!="-"&&!h.urls[v.theme]){h.load(v.theme,"themes/"+v.theme+"/editor_template"+m.suffix+".js")}i(g(v.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(z){var y={prefix:"plugins/",resource:z,suffix:"/editor_plugin"+m.suffix+".js"};var z=c.createUrl(y,z);c.load(z.resource,z)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+m.suffix+".js"})}}});p.loadQueue(function(){if(!u.removed){u.init()}})}q()},init:function(){var r,H=this,I=H.settings,E,A,D=H.getElement(),q,p,F,y,C,G,z,v=[];m.add(H);I.aria_label=I.aria_label||n.getAttrib(D,"aria-label",H.getLang("aria.rich_text_area"));if(I.theme){I.theme=I.theme.replace(/-/,"");q=h.get(I.theme);H.theme=new q();if(H.theme.init&&I.init_theme){H.theme.init(H,h.urls[I.theme]||m.documentBaseURL.replace(/\/$/,""))}}function B(J){var K=c.get(J),t=c.urls[J]||m.documentBaseURL.replace(/\/$/,""),s;if(K&&m.inArray(v,J)===-1){i(c.dependencies(J),function(u){B(u)});s=new K(H,t);H.plugins[J]=s;if(s.init){s.init(H,t);v.push(J)}}}i(g(I.plugins.replace(/\-/g,"")),B);if(I.popup_css!==false){if(I.popup_css){I.popup_css=H.documentBaseURI.toAbsolute(I.popup_css)}else{I.popup_css=H.baseURI.toAbsolute("themes/"+I.theme+"/skins/"+I.skin+"/dialog.css")}}if(I.popup_css_add){I.popup_css+=","+H.documentBaseURI.toAbsolute(I.popup_css_add)}H.controlManager=new m.ControlManager(H);if(I.custom_undo_redo){H.onBeforeExecCommand.add(function(t,J,u,K,s){if(J!="Undo"&&J!="Redo"&&J!="mceRepaint"&&(!s||!s.skip_undo)){H.undoManager.beforeChange()}});H.onExecCommand.add(function(t,J,u,K,s){if(J!="Undo"&&J!="Redo"&&J!="mceRepaint"&&(!s||!s.skip_undo)){H.undoManager.add()}})}H.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){H.nodeChanged()}});if(a){function x(s,t){if(!t||!t.initial){H.execCommand("mceRepaint")}}H.onUndo.add(x);H.onRedo.add(x);H.onSetContent.add(x)}H.onBeforeRenderUI.dispatch(H,H.controlManager);if(I.render_ui){E=I.width||D.style.width||D.offsetWidth;A=I.height||D.style.height||D.offsetHeight;H.orgDisplay=D.style.display;G=/^[0-9\.]+(|px)$/i;if(G.test(""+E)){E=Math.max(parseInt(E)+(q.deltaWidth||0),100)}if(G.test(""+A)){A=Math.max(parseInt(A)+(q.deltaHeight||0),100)}q=H.theme.renderUI({targetNode:D,width:E,height:A,deltaWidth:I.delta_width,deltaHeight:I.delta_height});H.editorContainer=q.editorContainer}if(document.domain&&location.hostname!=document.domain){m.relaxedDomain=document.domain}n.setStyles(q.sizeContainer||q.editorContainer,{width:E,height:A});if(I.content_css){m.each(g(I.content_css),function(s){H.contentCSS.push(H.documentBaseURI.toAbsolute(s))})}A=(q.iframeHeight||A)+(typeof(A)=="number"?(q.deltaHeight||0):"");if(A<100){A=100}H.iframeHTML=I.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(I.document_base_url!=m.documentBaseURL){H.iframeHTML+='<base href="'+H.documentBaseURI.getURI()+'" />'}if(I.ie7_compat){H.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" />'}else{H.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=edge" />'}H.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';for(z=0;z<H.contentCSS.length;z++){H.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+H.contentCSS[z]+'" />'}y=I.body_id||"tinymce";if(y.indexOf("=")!=-1){y=H.getParam("body_id","","hash");y=y[H.id]||y}C=I.body_class||"";if(C.indexOf("=")!=-1){C=H.getParam("body_class","","hash");C=C[H.id]||""}H.iframeHTML+='</head><body id="'+y+'" class="mceContentBody '+C+'"><br></body></html>';if(m.relaxedDomain&&(b||(m.isOpera&&parseFloat(opera.version())<11))){F='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+H.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}r=n.add(q.iframeContainer,"iframe",{id:H.id+"_ifr",src:F||'javascript:""',frameBorder:"0",allowTransparency:"true",title:I.aria_label,style:{width:"100%",height:A,display:"block"}});H.contentAreaContainer=q.iframeContainer;n.get(q.editorContainer).style.display=H.orgDisplay;n.get(H.id).style.display="none";n.setAttrib(H.id,"aria-hidden",true);if(!m.relaxedDomain||!F){H.setupIframe()}D=r=q=null},setupIframe:function(){var q=this,v=q.settings,x=n.get(q.id),y=q.getDoc(),u,p;if(!b||!m.relaxedDomain){y.open();y.write(q.iframeHTML);y.close();if(m.relaxedDomain){y.domain=m.relaxedDomain}}p=q.getBody();p.disabled=true;if(!v.readonly){p.contentEditable=true}p.disabled=false;q.schema=new m.html.Schema(v);q.dom=new m.dom.DOMUtils(q.getDoc(),{keep_values:true,url_converter:q.convertURL,url_converter_scope:q,hex_colors:v.force_hex_style_colors,class_filter:v.class_filter,update_styles:1,fix_ie_paragraphs:1,schema:q.schema});q.parser=new m.html.DomParser(v,q.schema);if(!q.settings.allow_html_in_named_anchor){q.parser.addAttributeFilter("name",function(s,t){var A=s.length,C,z,B,D;while(A--){D=s[A];if(D.name==="a"&&D.firstChild){B=D.parent;C=D.lastChild;do{z=C.prev;B.insert(C,D);C=z}while(C)}}})}q.parser.addAttributeFilter("src,href,style",function(s,t){var z=s.length,B,D=q.dom,C,A;while(z--){B=s[z];C=B.attr(t);A="data-mce-"+t;if(!B.attributes.map[A]){if(t==="style"){B.attr(A,D.serializeStyle(D.parseStyle(C),B.name))}else{B.attr(A,q.convertURL(C,t,B.name))}}}});q.parser.addNodeFilter("script",function(s,t){var z=s.length,A;while(z--){A=s[z];A.attr("type","mce-"+(A.attr("type")||"text/javascript"))}});q.parser.addNodeFilter("#cdata",function(s,t){var z=s.length,A;while(z--){A=s[z];A.type=8;A.name="#comment";A.value="[CDATA["+A.value+"]]"}});q.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(t,z){var A=t.length,B,s=q.schema.getNonEmptyElements();while(A--){B=t[A];if(B.isEmpty(s)){B.empty().append(new m.html.Node("br",1)).shortEnded=true}}});q.serializer=new m.dom.Serializer(v,q.dom,q.schema);q.selection=new m.dom.Selection(q.dom,q.getWin(),q.serializer);q.formatter=new m.Formatter(this);q.formatter.register({alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"}},{selector:"img,table",collapsed:false,styles:{"float":"left"}}],aligncenter:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"}},{selector:"img",collapsed:false,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:false,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"}},{selector:"img,table",collapsed:false,styles:{"float":"right"}}],alignfull:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"}}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:false},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:false},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},link:{inline:"a",selector:"a",remove:"all",split:true,deep:true,onmatch:function(s){return true},onformat:function(z,s,t){i(t,function(B,A){q.dom.setAttrib(z,A,B)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]});i("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(s){q.formatter.register(s,{block:s,remove:"all"})});q.formatter.register(q.settings.formats);q.undoManager=new m.UndoManager(q);q.undoManager.onAdd.add(function(t,s){if(t.hasUndo()){return q.onChange.dispatch(q,s,t)}});q.undoManager.onUndo.add(function(t,s){return q.onUndo.dispatch(q,s,t)});q.undoManager.onRedo.add(function(t,s){return q.onRedo.dispatch(q,s,t)});q.forceBlocks=new m.ForceBlocks(q,{forced_root_block:v.forced_root_block});q.editorCommands=new m.EditorCommands(q);q.serializer.onPreProcess.add(function(s,t){return q.onPreProcess.dispatch(q,t,s)});q.serializer.onPostProcess.add(function(s,t){return q.onPostProcess.dispatch(q,t,s)});q.onPreInit.dispatch(q);if(!v.gecko_spellcheck){q.getBody().spellcheck=0}if(!v.readonly){q._addEvents()}q.controlManager.onPostRender.dispatch(q,q.controlManager);q.onPostRender.dispatch(q);q.quirks=new m.util.Quirks(this);if(v.directionality){q.getBody().dir=v.directionality}if(v.nowrap){q.getBody().style.whiteSpace="nowrap"}if(v.handle_node_change_callback){q.onNodeChange.add(function(t,s,z){q.execCallback("handle_node_change_callback",q.id,z,-1,-1,true,q.selection.isCollapsed())})}if(v.save_callback){q.onSaveContent.add(function(s,z){var t=q.execCallback("save_callback",q.id,z.content,q.getBody());if(t){z.content=t}})}if(v.onchange_callback){q.onChange.add(function(t,s){q.execCallback("onchange_callback",q,s)})}if(v.protect){q.onBeforeSetContent.add(function(s,t){if(v.protect){i(v.protect,function(z){t.content=t.content.replace(z,function(A){return"<!--mce:protected "+escape(A)+"-->"})})}})}if(v.convert_newlines_to_brs){q.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"<br />")}})}if(v.preformatted){q.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*<pre.*?>/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='<pre class="mceItemHidden">'+t.content+"</pre>"}})}if(v.verify_css_classes){q.serializer.attribValueFilter=function(B,z){var A,t;if(B=="class"){if(!q.classesRE){t=q.dom.getClasses();if(t.length>0){A="";i(t,function(s){A+=(A?"|":"")+s["class"]});q.classesRE=new RegExp("("+A+")","gi")}}return !q.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(z)||q.classesRE.test(z)?z:""}return z}}if(v.cleanup_callback){q.onBeforeSetContent.add(function(s,t){t.content=q.execCallback("cleanup_callback","insert_to_editor",t.content,t)});q.onPreProcess.add(function(s,t){if(t.set){q.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){q.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});q.onPostProcess.add(function(s,t){if(t.set){t.content=q.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=q.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(v.save_callback){q.onGetContent.add(function(s,t){if(t.save){t.content=q.execCallback("save_callback",q.id,t.content,q.getBody())}})}if(v.handle_event_callback){q.onEvent.add(function(s,t,z){if(q.execCallback("handle_event_callback",t,s,z)===false){j.cancel(t)}})}q.onSetContent.add(function(){q.addVisual(q.getBody())});if(v.padd_empty_editor){q.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(a){function r(s,t){i(s.dom.select("a"),function(A){var z=A.parentNode;if(s.dom.isBlock(z)&&z.lastChild===A){s.dom.add(z,"br",{"data-mce-bogus":1})}})}q.onExecCommand.add(function(s,t){if(t==="CreateLink"){r(s)}});q.onSetContent.add(q.selection.onSetContent.add(r))}q.load({initial:true,format:"html"});q.startContent=q.getContent({format:"raw"});q.undoManager.add();q.initialized=true;q.onInit.dispatch(q);q.execCallback("setupcontent_callback",q.id,q.getBody(),q.getDoc());q.execCallback("init_instance_callback",q);q.focus(true);q.nodeChanged({initial:1});i(q.contentCSS,function(s){q.dom.loadCSS(s)});if(v.auto_focus){setTimeout(function(){var s=m.get(v.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getBody().focus();s.getWin().focus()},100)}x=null},focus:function(u){var y,q=this,s=q.selection,x=q.settings.content_editable,r,p,v=q.getDoc();if(!u){r=s.getRng();if(r.item){p=r.item(0)}q._refreshContentEditable();s.normalize();if(!x){q.getWin().focus()}if(m.isGecko){q.getBody().focus()}if(p&&p.ownerDocument==v){r=v.body.createControlRange();r.addElement(p);r.select()}}if(m.activeEditor!=q){if((y=m.activeEditor)!=null){y.onDeactivate.dispatch(y,q)}q.onActivate.dispatch(q,y)}m._setActive(q)},execCallback:function(u){var p=this,r=p.settings[u],q;if(!r){return}if(p.callbackLookup&&(q=p.callbackLookup[u])){r=q.func;q=q.scope}if(d(r,"string")){q=r.replace(/\.\w+$/,"");q=q?m.resolve(q):0;r=m.resolve(r);p.callbackLookup=p.callbackLookup||{};p.callbackLookup[u]={func:r,scope:q}}return r.apply(q||p,Array.prototype.slice.call(arguments,1))},translate:function(p){var r=this.settings.language||"en",q=m.i18n;if(!p){return""}return q[r+"."+p]||p.replace(/{\#([^}]+)\}/g,function(t,s){return q[r+"."+s]||"{#"+s+"}"})},getLang:function(q,p){return m.i18n[(this.settings.language||"en")+"."+q]||(d(p)?p:"{#"+q+"}")},getParam:function(u,r,p){var s=m.trim,q=d(this.settings[u])?this.settings[u]:r,t;if(p==="hash"){t={};if(d(q,"string")){i(q.indexOf("=")>0?q.split(/[;,](?![^=;,]*(?:[;,]|$))/):q.split(","),function(x){x=x.split("=");if(x.length>1){t[s(x[0])]=s(x[1])}else{t[s(x[0])]=s(x)}})}else{t=q}return t}return q},nodeChanged:function(r){var p=this,q=p.selection,u=q.getStart()||p.getBody();if(p.initialized){r=r||{};u=b&&u.ownerDocument!=p.getDoc()?p.getBody():u;r.parents=[];p.dom.getParent(u,function(s){if(s.nodeName=="BODY"){return true}r.parents.push(s)});p.onNodeChange.dispatch(p,r?r.controlManager||p.controlManager:p.controlManager,u,q.isCollapsed(),r)}},addButton:function(r,q){var p=this;p.buttons=p.buttons||{};p.buttons[r]=q},addCommand:function(p,r,q){this.execCommands[p]={func:r,scope:q||this}},addQueryStateHandler:function(p,r,q){this.queryStateCommands[p]={func:r,scope:q||this}},addQueryValueHandler:function(p,r,q){this.queryValueCommands[p]={func:r,scope:q||this}},addShortcut:function(r,u,p,s){var q=this,v;if(!q.settings.custom_shortcuts){return false}q.shortcuts=q.shortcuts||{};if(d(p,"string")){v=p;p=function(){q.execCommand(v,false,null)}}if(d(p,"object")){v=p;p=function(){q.execCommand(v[0],v[1],v[2])}}i(g(r),function(t){var x={func:p,scope:s||this,desc:u,alt:false,ctrl:false,shift:false};i(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});q.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=x});return true},execCommand:function(x,v,z,p){var r=this,u=0,y,q;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!p||!p.skip_focus)){r.focus()}y={};r.onBeforeExecCommand.dispatch(r,x,v,z,y);if(y.terminate){return false}if(r.execCallback("execcommand_callback",r.id,r.selection.getNode(),x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(y=r.execCommands[x]){q=y.func.call(y.scope,v,z);if(q!==true){r.onExecCommand.dispatch(r,x,v,z,p);return q}}i(r.plugins,function(s){if(s.execCommand&&s.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);u=1;return false}});if(u){return true}if(r.theme&&r.theme.execCommand&&r.theme.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(r.editorCommands.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}r.getDoc().execCommand(x,v,z);r.onExecCommand.dispatch(r,x,v,z,p)},queryCommandState:function(u){var q=this,v,r;if(q._isHidden()){return}if(v=q.queryStateCommands[u]){r=v.func.call(v.scope);if(r!==true){return r}}v=q.editorCommands.queryCommandState(u);if(v!==-1){return v}try{return this.getDoc().queryCommandState(u)}catch(p){}},queryCommandValue:function(v){var q=this,u,r;if(q._isHidden()){return}if(u=q.queryValueCommands[v]){r=u.func.call(u.scope);if(r!==true){return r}}u=q.editorCommands.queryCommandValue(v);if(d(u)){return u}try{return this.getDoc().queryCommandValue(v)}catch(p){}},show:function(){var p=this;n.show(p.getContainer());n.hide(p.id);p.load()},hide:function(){var p=this,q=p.getDoc();if(b&&q){q.execCommand("SelectAll")}p.save();n.hide(p.getContainer());n.setStyle(p.id,"display",p.orgDisplay)},isHidden:function(){return !n.isHidden(this.id)},setProgressState:function(p,q,r){this.onSetProgressState.dispatch(this,p,q,r);return p},load:function(s){var p=this,r=p.getElement(),q;if(r){s=s||{};s.load=true;q=p.setContent(d(r.value)?r.value:r.innerHTML,s);s.element=r;if(!s.no_events){p.onLoadContent.dispatch(p,s)}s.element=r=null;return q}},save:function(u){var p=this,s=p.getElement(),q,r;if(!s||!p.initialized){return}u=u||{};u.save=true;if(!u.no_events){p.undoManager.typing=false;p.undoManager.add()}u.element=s;q=u.content=p.getContent(u);if(!u.no_events){p.onSaveContent.dispatch(p,u)}q=u.content;if(!/TEXTAREA|INPUT/i.test(s.nodeName)){s.innerHTML=q;if(r=n.getParent(p.id,"form")){i(r.elements,function(t){if(t.name==p.id){t.value=q;return false}})}}else{s.value=q}u.element=s=null;return q},setContent:function(u,s){var r=this,q,p=r.getBody(),t;s=s||{};s.format=s.format||"html";s.set=true;s.content=u;if(!s.no_events){r.onBeforeSetContent.dispatch(r,s)}u=s.content;if(!m.isIE&&(u.length===0||/^\s+$/.test(u))){t=r.settings.forced_root_block;if(t){u="<"+t+'><br data-mce-bogus="1"></'+t+">"}else{u='<br data-mce-bogus="1">'}p.innerHTML=u;r.selection.select(p,true);r.selection.collapse(true);return}if(s.format!=="raw"){u=new m.html.Serializer({},r.schema).serialize(r.parser.parse(u))}s.content=m.trim(u);r.dom.setHTML(p,s.content);if(!s.no_events){r.onSetContent.dispatch(r,s)}r.selection.normalize();return s.content},getContent:function(q){var p=this,r;q=q||{};q.format=q.format||"html";q.get=true;if(!q.no_events){p.onBeforeGetContent.dispatch(p,q)}if(q.format=="raw"){r=p.getBody().innerHTML}else{r=p.serializer.serialize(p.getBody(),q)}q.content=m.trim(r);if(!q.no_events){p.onGetContent.dispatch(p,q)}return q.content},isDirty:function(){var p=this;return m.trim(p.startContent)!=m.trim(p.getContent({format:"raw",no_events:1}))&&!p.isNotDirty},getContainer:function(){var p=this;if(!p.container){p.container=n.get(p.editorContainer||p.id+"_parent")}return p.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return n.get(this.settings.content_element||this.id)},getWin:function(){var p=this,q;if(!p.contentWindow){q=n.get(p.id+"_ifr");if(q){p.contentWindow=q.contentWindow}}return p.contentWindow},getDoc:function(){var q=this,p;if(!q.contentDocument){p=q.getWin();if(p){q.contentDocument=p.document}}return q.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(p,x,v){var q=this,r=q.settings;if(r.urlconverter_callback){return q.execCallback("urlconverter_callback",p,v,true,x)}if(!r.convert_urls||(v&&v.nodeName=="LINK")||p.indexOf("file:")===0){return p}if(r.relative_urls){return q.documentBaseURI.toRelative(p)}p=q.documentBaseURI.toAbsolute(p,r.remove_script_host);return p},addVisual:function(r){var p=this,q=p.settings;r=r||p.getBody();if(!d(p.hasVisual)){p.hasVisual=q.visual}i(p.dom.select("table,a",r),function(t){var s;switch(t.nodeName){case"TABLE":s=p.dom.getAttrib(t,"border");if(!s||s=="0"){if(p.hasVisual){p.dom.addClass(t,q.visual_table_class)}else{p.dom.removeClass(t,q.visual_table_class)}}return;case"A":s=p.dom.getAttrib(t,"name");if(s){if(p.hasVisual){p.dom.addClass(t,"mceItemAnchor")}else{p.dom.removeClass(t,"mceItemAnchor")}}return}});p.onVisualAid.dispatch(p,r,p.hasVisual)},remove:function(){var p=this,q=p.getContainer();p.removed=1;p.hide();p.execCallback("remove_instance_callback",p);p.onRemove.dispatch(p);p.onExecCommand.listeners=[];m.remove(p);n.remove(q)},destroy:function(q){var p=this;if(p.destroyed){return}if(!q){m.removeUnload(p.destroy);tinyMCE.onBeforeUnload.remove(p._beforeUnload);if(p.theme&&p.theme.destroy){p.theme.destroy()}p.controlManager.destroy();p.selection.destroy();p.dom.destroy();if(!p.settings.content_editable){j.clear(p.getWin());j.clear(p.getDoc())}j.clear(p.getBody());j.clear(p.formElement)}if(p.formElement){p.formElement.submit=p.formElement._mceOldSubmit;p.formElement._mceOldSubmit=null}p.contentAreaContainer=p.formElement=p.container=p.settings.content_element=p.bodyElement=p.contentDocument=p.contentWindow=null;if(p.selection){p.selection=p.selection.win=p.selection.dom=p.selection.dom.doc=null}p.destroyed=1},_addEvents:function(){var B=this,r,C=B.settings,q=B.dom,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function p(t,D){var s=t.type;if(B.removed){return}if(B.onEvent.dispatch(B,t,D)!==false){B[x[t.fakeType||t.type]].dispatch(B,t,D)}}i(x,function(t,s){switch(s){case"contextmenu":q.bind(B.getDoc(),s,p);break;case"paste":q.bind(B.getBody(),s,function(D){p(D)});break;case"submit":case"reset":q.bind(B.getElement().form||n.getParent(B.id,"form"),s,p);break;default:q.bind(C.content_editable?B.getBody():B.getDoc(),s,p)}});q.bind(C.content_editable?B.getBody():(a?B.getDoc():B.getWin()),"focus",function(s){B.focus(true)});if(m.isGecko){q.bind(B.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("data-mce-src"))){t.src=B.documentBaseURI.toAbsolute(s)}})}if(a){function u(){var E=this,G=E.getDoc(),F=E.settings;if(a&&!F.readonly){E._refreshContentEditable();try{G.execCommand("styleWithCSS",0,false)}catch(D){if(!E._isHidden()){try{G.execCommand("useCSS",0,true)}catch(D){}}}if(!F.table_inline_editing){try{G.execCommand("enableInlineTableEditing",false,false)}catch(D){}}if(!F.object_resizing){try{G.execCommand("enableObjectResizing",false,false)}catch(D){}}}}B.onBeforeExecCommand.add(u);B.onMouseDown.add(u)}B.onMouseUp.add(B.nodeChanged);B.onKeyUp.add(function(s,t){var D=t.keyCode;if((D>=33&&D<=36)||(D>=37&&D<=40)||D==13||D==45||D==46||D==8||(m.isMac&&(D==91||D==93))||t.ctrlKey){B.nodeChanged()}});B.onKeyDown.add(function(t,D){if(D.keyCode!=8){return}var F=t.selection.getRng().startContainer;var E=t.selection.getRng().startOffset;while(F&&F.nodeType&&F.nodeType!=1&&F.parentNode){F=F.parentNode}if(F&&F.parentNode&&F.parentNode.tagName==="BLOCKQUOTE"&&F.parentNode.firstChild==F&&E==0){t.formatter.toggle("blockquote",null,F.parentNode);var s=t.selection.getRng();s.setStart(F,0);s.setEnd(F,0);t.selection.setRng(s);t.selection.collapse(false)}});B.onReset.add(function(){B.setContent(B.startContent,{format:"raw"})});if(C.custom_shortcuts){if(C.custom_undo_redo_keyboard_shortcuts){B.addShortcut("ctrl+z",B.getLang("undo_desc"),"Undo");B.addShortcut("ctrl+y",B.getLang("redo_desc"),"Redo")}B.addShortcut("ctrl+b",B.getLang("bold_desc"),"Bold");B.addShortcut("ctrl+i",B.getLang("italic_desc"),"Italic");B.addShortcut("ctrl+u",B.getLang("underline_desc"),"Underline");for(r=1;r<=6;r++){B.addShortcut("ctrl+"+r,"",["FormatBlock",false,"h"+r])}B.addShortcut("ctrl+7","",["FormatBlock",false,"p"]);B.addShortcut("ctrl+8","",["FormatBlock",false,"div"]);B.addShortcut("ctrl+9","",["FormatBlock",false,"address"]);function v(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}i(B.shortcuts,function(D){if(m.isMac&&D.ctrl!=t.metaKey){return}else{if(!m.isMac&&D.ctrl!=t.ctrlKey){return}}if(D.alt!=t.altKey){return}if(D.shift!=t.shiftKey){return}if(t.keyCode==D.keyCode||(t.charCode&&t.charCode==D.charCode)){s=D;return false}});return s}B.onKeyUp.add(function(s,t){var D=v(t);if(D){return j.cancel(t)}});B.onKeyPress.add(function(s,t){var D=v(t);if(D){return j.cancel(t)}});B.onKeyDown.add(function(s,t){var D=v(t);if(D){D.func.call(D.scope);return j.cancel(t)}})}if(m.isIE){q.bind(B.getDoc(),"controlselect",function(D){var t=B.resizeInfo,s;D=D.target;if(D.nodeName!=="IMG"){return}if(t){q.unbind(t.node,t.ev,t.cb)}if(!q.hasClass(D,"mceItemNoResize")){ev="resizeend";s=q.bind(D,ev,function(F){var E;F=F.target;if(E=q.getStyle(F,"width")){q.setAttrib(F,"width",E.replace(/[^0-9%]+/g,""));q.setStyle(F,"width","")}if(E=q.getStyle(F,"height")){q.setAttrib(F,"height",E.replace(/[^0-9%]+/g,""));q.setStyle(F,"height","")}})}else{ev="resizestart";s=q.bind(D,"resizestart",j.cancel,j)}t=B.resizeInfo={node:D,ev:ev,cb:s}})}if(m.isOpera){B.onClick.add(function(s,t){j.prevent(t)})}if(C.custom_undo_redo){function y(){B.undoManager.typing=false;B.undoManager.add()}q.bind(B.getDoc(),"focusout",function(s){if(!B.removed&&B.undoManager.typing){y()}});B.dom.bind(B.dom.getRoot(),"dragend",function(s){y()});B.onKeyUp.add(function(s,D){var t=D.keyCode;if((t>=33&&t<=36)||(t>=37&&t<=40)||t==13||t==45||D.ctrlKey){y()}});B.onKeyDown.add(function(s,E){var D=E.keyCode,t;if(D==8){t=B.getDoc().selection;if(t&&t.createRange&&t.createRange().item){B.undoManager.beforeChange();s.dom.remove(t.createRange().item(0));y();return j.cancel(E)}}if((D>=33&&D<=36)||(D>=37&&D<=40)||D==13||D==45){if(m.isIE&&D==13){B.undoManager.beforeChange()}if(B.undoManager.typing){y()}return}if((D<16||D>20)&&D!=224&&D!=91&&!B.undoManager.typing){B.undoManager.beforeChange();B.undoManager.typing=true;B.undoManager.add()}});B.onMouseDown.add(function(){if(B.undoManager.typing){y()}})}if(m.isGecko){function A(){var s=B.dom.getAttribs(B.selection.getStart().cloneNode(false));return function(){var t=B.selection.getStart();if(t!==B.getBody()){B.dom.setAttrib(t,"style",null);i(s,function(D){t.setAttributeNode(D.cloneNode(true))})}}}function z(){var t=B.selection;return !t.isCollapsed()&&t.getStart()!=t.getEnd()}B.onKeyPress.add(function(s,D){var t;if((D.keyCode==8||D.keyCode==46)&&z()){t=A();B.getDoc().execCommand("delete",false,null);t();return j.cancel(D)}});B.dom.bind(B.getDoc(),"cut",function(t){var s;if(z()){s=A();B.onKeyUp.addToTop(j.cancel,j);setTimeout(function(){s();B.onKeyUp.remove(j.cancel,j)},0)}})}},_refreshContentEditable:function(){var q=this,p,r;if(q._isHidden()){p=q.getBody();r=p.parentNode;r.removeChild(p);r.appendChild(p);p.focus()}},_isHidden:function(){var p;if(!a){return 0}p=this.selection.getSel();return(!p||!p.rangeCount||p.rangeCount==0)}})})(tinymce);(function(c){var d=c.each,e,a=true,b=false;c.EditorCommands=function(n){var m=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,q=n.formatter,o;function r(z,y,x){var v;z=z.toLowerCase();if(v=j.exec[z]){v(z,y,x);return a}return b}function l(x){var v;x=x.toLowerCase();if(v=j.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=j.value[x]){return v(x)}return b}function u(v,x){x=x||"exec";d(v,function(z,y){d(y.toLowerCase().split(","),function(A){j[x][A]=z})})}c.extend(this,{execCommand:r,queryCommandState:l,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===e){x=b}if(v===e){v=null}return n.getDoc().execCommand(y,x,v)}function t(v){return q.match(v)}function s(v,x){q.toggle(v,x?{value:x}:e)}function i(v){o=p.getBookmark(v)}function g(){p.moveToBookmark(o)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(z){var y=n.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(c.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(A){if(A){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(v){if(p.isCollapsed()){p.select(p.getNode())}f(v);p.collapse(b)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);d("left,center,right,full".split(","),function(y){if(x!=y){q.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(p.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){i();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=c.explode(k.font_size_style_values);v=c.explode(k.font_size_classes);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){q.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||p.getNode();if(v!=n.getBody()){i();n.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(p.getNode(),function(A){if(A.nodeType==1&&v++==x){p.select(A);return b}},n.getBody())},mceSelectNode:function(y,x,v){p.select(v)},mceInsertContent:function(B,I,K){var y,J,E,z,F,G,D,C,L,x,A,M,v,H;y=n.parser;J=new c.html.Serializer({},n.schema);v='<span id="mce_marker" data-mce-type="bookmark">\uFEFF</span>';G={content:K,format:"html"};p.onBeforeSetContent.dispatch(p,G);K=G.content;if(K.indexOf("{$caret}")==-1){K+="{$caret}"}K=K.replace(/\{\$caret\}/,v);if(!p.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}E=p.getNode();G={context:E.nodeName.toLowerCase()};F=y.parse(K,G);A=F.lastChild;if(A.attr("id")=="mce_marker"){D=A;for(A=A.prev;A;A=A.walk(true)){if(A.type==3||!m.isBlock(A.name)){A.parent.insert(D,A,A.name==="br");break}}}if(!G.invalid){K=J.serialize(F);A=E.firstChild;M=E.lastChild;if(!A||(A===M&&A.nodeName==="BR")){m.setHTML(E,K)}else{p.setContent(K)}}else{p.setContent(v);E=n.selection.getNode();z=n.getBody();if(E.nodeType==9){E=A=z}else{A=E}while(A!==z){E=A;A=A.parentNode}K=E==z?z.innerHTML:m.getOuterHTML(E);K=J.serialize(y.parse(K.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return J.serialize(F)})));if(E==z){m.setHTML(z,K)}else{m.setOuterHTML(E,K)}}D=m.get("mce_marker");C=m.getRect(D);L=m.getViewPort(n.getWin());if((C.y+C.h>L.y+L.h||C.y<L.y)||(C.x>L.x+L.w||C.x<L.x)){H=c.isIE?n.getDoc().documentElement:n.getBody();H.scrollLeft=C.x;H.scrollTop=C.y-L.h+25}x=m.createRng();A=D.previousSibling;if(A&&A.nodeType==3){x.setStart(A,A.nodeValue.length)}else{x.setStartBefore(D);x.setEndBefore(D)}m.remove(D);p.setRng(x);p.onSetContent.dispatch(p,G);n.addVisual()},mceInsertRawHTML:function(y,x,v){p.setContent("tiny_mce_marker");n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return v}))},mceSetContent:function(y,x,v){n.setContent(v)},"Indent,Outdent":function(z){var x,v,y;x=k.indentation;v=/[a-z%]+$/i.exec(x);x=parseInt(x);if(!l("InsertUnorderedList")&&!l("InsertOrderedList")){d(p.getSelectedBlocks(),function(A){if(z=="outdent"){y=Math.max(0,parseInt(A.style.paddingLeft||0)-x);m.setStyle(A,"paddingLeft",y?y+v:"")}else{m.setStyle(A,"paddingLeft",(parseInt(A.style.paddingLeft||0)+x)+v)}})}else{f(z)}},mceRepaint:function(){var x;if(c.isGecko){try{i(a);if(p.getSel()){p.getSel().selectAllChildren(n.getBody())}p.collapse(a);g()}catch(v){}}},mceToggleFormat:function(y,x,v){q.toggle(v)},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",false,"<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(y,x,v){n.execCommand("mceInsertContent",false,v.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(z,y,x){var v;if(typeof(x)=="string"){x={href:x}}v=m.getParent(p.getNode(),"a");x.href=x.href.replace(" ","%20");if(!v||!x.href){q.remove("link")}if(x.href){q.apply("link",x,v)}},selectAll:function(){var x=m.getRoot(),v=m.createRng();v.setStart(x,0);v.setEnd(x,x.childNodes.length);n.selection.setRng(v)}});u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){return t("align"+v.substring(7))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(k.inline_styles){if((v=m.getParent(p.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(p.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return l("InsertUnorderedList")||l("InsertOrderedList")||(!k.inline_styles&&!!m.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(v){return m.getParent(p.getNode(),v=="insertunorderedlist"?"UL":"OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(p.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");if(k.custom_undo_redo){u({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(f){var d,e=0,h=[],c;function g(){return b.trim(f.getContent({format:"raw",no_events:1}))}return d={typing:false,onAdd:new a(d),onUndo:new a(d),onRedo:new a(d),beforeChange:function(){c=f.selection.getBookmark(2,true)},add:function(m){var j,k=f.settings,l;m=m||{};m.content=g();l=h[e];if(l&&l.content==m.content){return null}if(h[e]){h[e].beforeBookmark=c}if(k.custom_undo_redo_levels){if(h.length>k.custom_undo_redo_levels){for(j=0;j<h.length-1;j++){h[j]=h[j+1]}h.length--;e=h.length}}m.bookmark=f.selection.getBookmark(2,true);if(e<h.length-1){h.length=e+1}h.push(m);e=h.length-1;d.onAdd.dispatch(d,m);f.isNotDirty=0;return m},undo:function(){var k,j;if(d.typing){d.add();d.typing=false}if(e>0){k=h[--e];f.setContent(k.content,{format:"raw"});f.selection.moveToBookmark(k.beforeBookmark);d.onUndo.dispatch(d,k)}return k},redo:function(){var i;if(e<h.length-1){i=h[++e];f.setContent(i.content,{format:"raw"});f.selection.moveToBookmark(i.bookmark);d.onRedo.dispatch(d,i)}return i},clear:function(){h=[];e=0;d.typing=false},hasUndo:function(){return e>0||this.typing},hasRedo:function(){return e<h.length-1&&!this.typing}}}})(tinymce);(function(l){var j=l.dom.Event,c=l.isIE,a=l.isGecko,b=l.isOpera,i=l.each,h=l.extend,d=true,g=false;function k(o){var p,n,m;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(o.nodeName)){if(p){n=o.cloneNode(false);n.appendChild(p);p=n}else{p=m=o.cloneNode(false)}p.removeAttribute("id")}}while(o=o.parentNode);if(p){return{wrapper:p,inner:m}}}function f(n,o){var m=o.ownerDocument.createRange();m.setStart(n.endContainer,n.endOffset);m.setEndAfter(o);return m.cloneContents().textContent.length==0}function e(o,q,m){var n,p;if(q.isEmpty(m)){n=q.getParent(m,"ul,ol");if(!q.getParent(n.parentNode,"ul,ol")){q.split(n,m);p=q.create("p",0,'<br data-mce-bogus="1" />');q.replace(p,m);o.select(p,1)}return g}return d}l.create("tinymce.ForceBlocks",{ForceBlocks:function(m){var n=this,o=m.settings,p;n.editor=m;n.dom=m.dom;p=(o.forced_root_block||"p").toLowerCase();o.element=p.toUpperCase();m.onPreInit.add(n.setup,n)},setup:function(){var n=this,m=n.editor,p=m.settings,u=m.dom,o=m.selection,q=m.schema.getBlockElements();if(p.forced_root_block){function v(){var y=o.getStart(),t=m.getBody(),s,z,D,F,E,x,A,B=-16777215;if(!y||y.nodeType!==1){return}while(y!=t){if(q[y.nodeName]){return}y=y.parentNode}s=o.getRng();if(s.setStart){z=s.startContainer;D=s.startOffset;F=s.endContainer;E=s.endOffset}else{if(s.item){s=m.getDoc().body.createTextRange();s.moveToElementText(s.item(0))}tmpRng=s.duplicate();tmpRng.collapse(true);D=tmpRng.move("character",B)*-1;if(!tmpRng.collapsed){tmpRng=s.duplicate();tmpRng.collapse(false);E=(tmpRng.move("character",B)*-1)-D}}for(y=t.firstChild;y;y){if(y.nodeType===3||(y.nodeType==1&&!q[y.nodeName])){if(!x){x=u.create(p.forced_root_block);y.parentNode.insertBefore(x,y)}A=y;y=y.nextSibling;x.appendChild(A)}else{x=null;y=y.nextSibling}}if(s.setStart){s.setStart(z,D);s.setEnd(F,E);o.setRng(s)}else{try{s=m.getDoc().body.createTextRange();s.moveToElementText(t);s.collapse(true);s.moveStart("character",D);if(E>0){s.moveEnd("character",E)}s.select()}catch(C){}}m.nodeChanged()}m.onKeyUp.add(v);m.onClick.add(v)}if(p.force_br_newlines){if(c){m.onKeyPress.add(function(s,t){var x;if(t.keyCode==13&&o.getNode().nodeName!="LI"){o.setContent('<br id="__" /> ',{format:"raw"});x=u.get("__");x.removeAttribute("id");o.select(x);o.collapse();return j.cancel(t)}})}}if(p.force_p_newlines){if(!c){m.onKeyPress.add(function(s,t){if(t.keyCode==13&&!t.shiftKey&&!n.insertPara(t)){j.cancel(t)}})}else{l.addUnload(function(){n._previousFormats=0});m.onKeyPress.add(function(s,t){n._previousFormats=0;if(t.keyCode==13&&!t.shiftKey&&s.selection.isCollapsed()&&p.keep_styles){n._previousFormats=k(s.selection.getStart())}});m.onKeyUp.add(function(t,y){if(y.keyCode==13&&!y.shiftKey){var x=t.selection.getStart(),s=n._previousFormats;if(!x.hasChildNodes()&&s){x=u.getParent(x,u.isBlock);if(x&&x.nodeName!="LI"){x.innerHTML="";if(n._previousFormats){x.appendChild(s.wrapper);s.inner.innerHTML="\uFEFF"}else{x.innerHTML="\uFEFF"}o.select(x,1);o.collapse(true);t.getDoc().execCommand("Delete",false,null);n._previousFormats=0}}}})}if(a){m.onKeyDown.add(function(s,t){if((t.keyCode==8||t.keyCode==46)&&!t.shiftKey){n.backspaceDelete(t,t.keyCode==8)}})}}if(l.isWebKit){function r(t){var s=o.getRng(),x,A=u.create("div",null," "),z,y=u.getViewPort(t.getWin()).h;s.insertNode(x=u.create("br"));s.setStartAfter(x);s.setEndAfter(x);o.setRng(s);if(o.getSel().focusNode==x.previousSibling){o.select(u.insertAfter(u.doc.createTextNode("\u00a0"),x));o.collapse(d)}u.insertAfter(A,x);z=u.getPos(A).y;u.remove(A);if(z>y){t.getWin().scrollTo(0,z)}}m.onKeyPress.add(function(s,t){if(t.keyCode==13&&(t.shiftKey||(p.force_br_newlines&&!u.getParent(o.getNode(),"h1,h2,h3,h4,h5,h6,ol,ul")))){r(s);j.cancel(t)}})}if(c){if(p.element!="P"){m.onKeyPress.add(function(s,t){n.lastElm=o.getNode().nodeName});m.onKeyUp.add(function(t,x){var z,y=o.getNode(),s=t.getBody();if(s.childNodes.length===1&&y.nodeName=="P"){y=u.rename(y,p.element);o.select(y);o.collapse();t.nodeChanged()}else{if(x.keyCode==13&&!x.shiftKey&&n.lastElm!="P"){z=u.getParent(y,"p");if(z){u.rename(z,p.element);t.nodeChanged()}}}})}}},getParentBlock:function(o){var m=this.dom;return m.getParent(o,m.isBlock)},insertPara:function(Q){var E=this,v=E.editor,M=v.dom,R=v.getDoc(),V=v.settings,F=v.selection.getSel(),G=F.getRangeAt(0),U=R.body;var J,K,H,O,N,q,o,u,z,m,C,T,p,x,I,L=M.getViewPort(v.getWin()),B,D,A;v.undoManager.beforeChange();J=R.createRange();J.setStart(F.anchorNode,F.anchorOffset);J.collapse(d);K=R.createRange();K.setStart(F.focusNode,F.focusOffset);K.collapse(d);H=J.compareBoundaryPoints(J.START_TO_END,K)<0;O=H?F.anchorNode:F.focusNode;N=H?F.anchorOffset:F.focusOffset;q=H?F.focusNode:F.anchorNode;o=H?F.focusOffset:F.anchorOffset;if(O===q&&/^(TD|TH)$/.test(O.nodeName)){if(O.firstChild.nodeName=="BR"){M.remove(O.firstChild)}if(O.childNodes.length==0){v.dom.add(O,V.element,null,"<br />");T=v.dom.add(O,V.element,null,"<br />")}else{I=O.innerHTML;O.innerHTML="";v.dom.add(O,V.element,null,I);T=v.dom.add(O,V.element,null,"<br />")}G=R.createRange();G.selectNodeContents(T);G.collapse(1);v.selection.setRng(G);return g}if(O==U&&q==U&&U.firstChild&&v.dom.isBlock(U.firstChild)){O=q=O.firstChild;N=o=0;J=R.createRange();J.setStart(O,0);K=R.createRange();K.setStart(q,0)}if(!R.body.hasChildNodes()){R.body.appendChild(M.create("br"))}O=O.nodeName=="HTML"?R.body:O;O=O.nodeName=="BODY"?O.firstChild:O;q=q.nodeName=="HTML"?R.body:q;q=q.nodeName=="BODY"?q.firstChild:q;u=E.getParentBlock(O);z=E.getParentBlock(q);m=u?u.nodeName:V.element;if(I=E.dom.getParent(u,"li,pre")){if(I.nodeName=="LI"){return e(v.selection,E.dom,I)}return d}if(u&&(u.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(M.getStyle(u,"position",1)))){m=V.element;u=null}if(z&&(z.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(M.getStyle(u,"position",1)))){m=V.element;z=null}if(/(TD|TABLE|TH|CAPTION)/.test(m)||(u&&m=="DIV"&&/left|right/gi.test(M.getStyle(u,"float",1)))){m=V.element;u=z=null}C=(u&&u.nodeName==m)?u.cloneNode(0):v.dom.create(m);T=(z&&z.nodeName==m)?z.cloneNode(0):v.dom.create(m);T.removeAttribute("id");if(/^(H[1-6])$/.test(m)&&f(G,u)){T=v.dom.create(V.element)}I=p=O;do{if(I==U||I.nodeType==9||E.dom.isBlock(I)||/(TD|TABLE|TH|CAPTION)/.test(I.nodeName)){break}p=I}while((I=I.previousSibling?I.previousSibling:I.parentNode));I=x=q;do{if(I==U||I.nodeType==9||E.dom.isBlock(I)||/(TD|TABLE|TH|CAPTION)/.test(I.nodeName)){break}x=I}while((I=I.nextSibling?I.nextSibling:I.parentNode));if(p.nodeName==m){J.setStart(p,0)}else{J.setStartBefore(p)}J.setEnd(O,N);C.appendChild(J.cloneContents()||R.createTextNode(""));try{K.setEndAfter(x)}catch(P){}K.setStart(q,o);T.appendChild(K.cloneContents()||R.createTextNode(""));G=R.createRange();if(!p.previousSibling&&p.parentNode.nodeName==m){G.setStartBefore(p.parentNode)}else{if(J.startContainer.nodeName==m&&J.startOffset==0){G.setStartBefore(J.startContainer)}else{G.setStart(J.startContainer,J.startOffset)}}if(!x.nextSibling&&x.parentNode.nodeName==m){G.setEndAfter(x.parentNode)}else{G.setEnd(K.endContainer,K.endOffset)}G.deleteContents();if(b){v.getWin().scrollTo(0,L.y)}if(C.firstChild&&C.firstChild.nodeName==m){C.innerHTML=C.firstChild.innerHTML}if(T.firstChild&&T.firstChild.nodeName==m){T.innerHTML=T.firstChild.innerHTML}function S(y,s){var r=[],X,W,t;y.innerHTML="";if(V.keep_styles){W=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(W.nodeName)){X=W.cloneNode(g);M.setAttrib(X,"id","");r.push(X)}}while(W=W.parentNode)}if(r.length>0){for(t=r.length-1,X=y;t>=0;t--){X=X.appendChild(r[t])}r[0].innerHTML=b?"\u00a0":"<br />";return r[0]}else{y.innerHTML=b?"\u00a0":"<br />"}}if(M.isEmpty(C)){S(C,O)}if(M.isEmpty(T)){A=S(T,q)}if(b&&parseFloat(opera.version())<9.5){G.insertNode(C);G.insertNode(T)}else{G.insertNode(T);G.insertNode(C)}T.normalize();C.normalize();v.selection.select(T,true);v.selection.collapse(true);B=v.dom.getPos(T).y;if(B<L.y||B+25>L.y+L.h){v.getWin().scrollTo(0,B<L.y?B:B-L.h+25)}v.undoManager.add();return g},backspaceDelete:function(u,B){var C=this,s=C.editor,y=s.getBody(),q=s.dom,p,v=s.selection,o=v.getRng(),x=o.startContainer,p,z,A,m;if(!B&&o.collapsed&&x.nodeType==1&&o.startOffset==x.childNodes.length){m=new l.dom.TreeWalker(x.lastChild,x);for(p=x.lastChild;p;p=m.prev()){if(p.nodeType==3){o.setStart(p,p.nodeValue.length);o.collapse(true);v.setRng(o);return}}}if(x&&s.dom.isBlock(x)&&!/^(TD|TH)$/.test(x.nodeName)&&B){if(x.childNodes.length==0||(x.childNodes.length==1&&x.firstChild.nodeName=="BR")){p=x;while((p=p.previousSibling)&&!s.dom.isBlock(p)){}if(p){if(x!=y.firstChild){z=s.dom.doc.createTreeWalker(p,NodeFilter.SHOW_TEXT,null,g);while(A=z.nextNode()){p=A}o=s.getDoc().createRange();o.setStart(p,p.nodeValue?p.nodeValue.length:0);o.setEnd(p,p.nodeValue?p.nodeValue.length:0);v.setRng(o);s.dom.remove(x)}return j.cancel(u)}}}}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){if(p.cmd){i.execCommand(p.cmd,p.ui||false,p.value)}}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(f,n,h){var l=this,j=l.editor,i,k,m;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,scope:n.scope,control_manager:l},n);f=l.prefix+f;function g(o){return o.settings.use_accessible_selects&&!c.isGecko}if(j.settings.use_native_selects||g(j)){k=new c.ui.NativeListBox(f,n)}else{m=h||l._cls.listbox||c.ui.ListBox;k=new m(f,n,j)}l.controls[f]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){j.bookmark=j.selection.getBookmark(1)});a.add(o,"focus",function(){j.selection.moveToBookmark(j.bookmark);j.bookmark=null})})}if(k.hideMenu){j.onMouseDown.add(k.hideMenu,k)}return l.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i,g);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i,g)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i,g));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n,j);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createToolbarGroup:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||this._cls.toolbarGroup||c.ui.ToolbarGroup;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},resizeBy:function(f,g,h){h.resizeBy(f,g)},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){a.Formatter=function(U){var M={},O=a.each,c=U.dom,q=U.selection,t=a.dom.TreeWalker,K=new a.dom.RangeUtils(c),d=U.schema.isValidChild,F=c.isBlock,l=U.settings.forced_root_block,s=c.nodeIndex,E="\uFEFF",e=/^(src|href|style)$/,R=false,B=true,p;function z(V){return V instanceof Array}function m(W,V){return c.getParents(W,V,c.getRoot())}function b(V){return V.nodeType===1&&(V.face==="mceinline"||V.style.fontFamily==="mceinline")}function Q(V){return V?M[V]:M}function k(V,W){if(V){if(typeof(V)!=="string"){O(V,function(Y,X){k(X,Y)})}else{W=W.length?W:[W];O(W,function(X){if(X.deep===p){X.deep=!X.selector}if(X.split===p){X.split=!X.selector||X.inline}if(X.remove===p&&X.selector&&!X.inline){X.remove="none"}if(X.selector&&X.inline){X.mixed=true;X.block_expand=true}if(typeof(X.classes)==="string"){X.classes=X.classes.split(/\s+/)}});M[V]=W}}}var i=function(W){var V;U.dom.getParent(W,function(X){V=U.dom.getStyle(X,"text-decoration");return V&&V!=="none"});return V};var I=function(V){var W;if(V.nodeType===1&&V.parentNode&&V.parentNode.nodeType===1){W=i(V.parentNode);if(U.dom.getStyle(V,"color")&&W){U.dom.setStyle(V,"text-decoration",W)}else{if(U.dom.getStyle(V,"textdecoration")===W){U.dom.setStyle(V,"text-decoration",null)}}}};function S(Y,ag,ab){var ac=Q(Y),ah=ac[0],af,W,ae,ad=q.isCollapsed();function Z(al){var ak=al.startContainer,ao=al.startOffset,an,am;if(ak.nodeType==1||ak.nodeValue===""){ak=ak.nodeType==1?ak.childNodes[ao]:ak;if(ak){an=new t(ak,ak.parentNode);for(am=an.current();am;am=an.next()){if(am.nodeType==3&&!f(am)){al.setStart(am,0);break}}}}return al}function V(al,ak){ak=ak||ah;if(al){if(ak.onformat){ak.onformat(al,ak,ag,ab)}O(ak.styles,function(an,am){c.setStyle(al,am,r(an,ag))});O(ak.attributes,function(an,am){c.setAttrib(al,am,r(an,ag))});O(ak.classes,function(am){am=r(am,ag);if(!c.hasClass(al,am)){c.addClass(al,am)}})}}function aa(){function am(at,aq){var ar=new t(aq);for(ab=ar.current();ab;ab=ar.prev()){if(ab.childNodes.length>1||ab==at){return ab}}}var al=U.selection.getRng();var ap=al.startContainer;var ak=al.endContainer;if(ap!=ak&&al.endOffset==0){var ao=am(ap,ak);var an=ao.nodeType==3?ao.length:ao.childNodes.length;al.setEnd(ao,an)}return al}function X(an,at,aq,ap,al){var ak=[],am=-1,ar,av=-1,ao=-1,au;O(an.childNodes,function(ax,aw){if(ax.nodeName==="UL"||ax.nodeName==="OL"){am=aw;ar=ax;return false}});O(an.childNodes,function(ax,aw){if(ax.nodeName==="SPAN"&&c.getAttrib(ax,"data-mce-type")=="bookmark"){if(ax.id==at.id+"_start"){av=aw}else{if(ax.id==at.id+"_end"){ao=aw}}}});if(am<=0||(av<am&&ao>am)){O(a.grep(an.childNodes),al);return 0}else{au=aq.cloneNode(R);O(a.grep(an.childNodes),function(ax,aw){if((av<am&&aw<am)||(av>am&&aw>am)){ak.push(ax);ax.parentNode.removeChild(ax)}});if(av<am){an.insertBefore(au,ar)}else{if(av>am){an.insertBefore(au,ar.nextSibling)}}ap.push(au);O(ak,function(aw){au.appendChild(aw)});return au}}function ai(al,an,ap){var ak=[],ao,am;ao=ah.inline||ah.block;am=c.create(ao);V(am);K.walk(al,function(aq){var ar;function at(au){var ax=au.nodeName.toLowerCase(),aw=au.parentNode.nodeName.toLowerCase(),av;if(g(ax,"br")){ar=0;if(ah.block){c.remove(au)}return}if(ah.wrapper&&x(au,Y,ag)){ar=0;return}if(ah.block&&!ah.wrapper&&G(ax)){au=c.rename(au,ao);V(au);ak.push(au);ar=0;return}if(ah.selector){O(ac,function(ay){if("collapsed" in ay&&ay.collapsed!==ad){return}if(c.is(au,ay.selector)&&!b(au)){V(au,ay);av=true}});if(!ah.inline||av){ar=0;return}}if(d(ao,ax)&&d(aw,ao)&&!(!ap&&au.nodeType===3&&au.nodeValue.length===1&&au.nodeValue.charCodeAt(0)===65279)&&au.id!=="_mce_caret"){if(!ar){ar=am.cloneNode(R);au.parentNode.insertBefore(ar,au);ak.push(ar)}ar.appendChild(au)}else{if(ax=="li"&&an){ar=X(au,an,am,ak,at)}else{ar=0;O(a.grep(au.childNodes),at);ar=0}}}O(aq,at)});if(ah.wrap_links===false){O(ak,function(aq){function ar(aw){var av,au,at;if(aw.nodeName==="A"){au=am.cloneNode(R);ak.push(au);at=a.grep(aw.childNodes);for(av=0;av<at.length;av++){au.appendChild(at[av])}aw.appendChild(au)}O(a.grep(aw.childNodes),ar)}ar(aq)})}O(ak,function(at){var aq;function au(aw){var av=0;O(aw.childNodes,function(ax){if(!f(ax)&&!H(ax)){av++}});return av}function ar(av){var ax,aw;O(av.childNodes,function(ay){if(ay.nodeType==1&&!H(ay)&&!b(ay)){ax=ay;return R}});if(ax&&h(ax,ah)){aw=ax.cloneNode(R);V(aw);c.replace(aw,av,B);c.remove(ax,1)}return aw||av}aq=au(at);if((ak.length>1||!F(at))&&aq===0){c.remove(at,1);return}if(ah.inline||ah.wrapper){if(!ah.exact&&aq===1){at=ar(at)}O(ac,function(av){O(c.select(av.inline,at),function(ax){var aw;if(av.wrap_links===false){aw=ax.parentNode;do{if(aw.nodeName==="A"){return}}while(aw=aw.parentNode)}T(av,ag,ax,av.exact?ax:null)})});if(x(at.parentNode,Y,ag)){c.remove(at,1);at=0;return B}if(ah.merge_with_parents){c.getParent(at.parentNode,function(av){if(x(av,Y,ag)){c.remove(at,1);at=0;return B}})}if(at&&ah.merge_siblings!==false){at=u(C(at),at);at=u(at,C(at,B))}}})}if(ah){if(ab){if(ab.nodeType){W=c.createRng();W.setStartBefore(ab);W.setEndAfter(ab);ai(o(W,ac),null,true)}else{ai(ab,null,true)}}else{if(!ad||!ah.inline||c.select("td.mceSelected,th.mceSelected").length){var aj=U.selection.getNode();U.selection.setRng(aa());af=q.getBookmark();ai(o(q.getRng(B),ac),af);if(ah.styles&&(ah.styles.color||ah.styles.textDecoration)){a.walk(aj,I,"childNodes");I(aj)}q.moveToBookmark(af);q.setRng(Z(q.getRng(B)));U.nodeChanged()}else{P("apply",Y,ag)}}}}function A(X,ag,aa){var ab=Q(X),ai=ab[0],af,ae,W;function Z(al){var ak=al.startContainer,aq=al.startOffset,ap,ao,am,an;if(ak.nodeType==3&&aq>=ak.nodeValue.length-1){ak=ak.parentNode;aq=s(ak)+1}if(ak.nodeType==1){am=ak.childNodes;ak=am[Math.min(aq,am.length-1)];ap=new t(ak);if(aq>am.length-1){ap.next()}for(ao=ap.current();ao;ao=ap.next()){if(ao.nodeType==3&&!f(ao)){an=c.create("a",null,E);ao.parentNode.insertBefore(an,ao);al.setStart(ao,0);q.setRng(al);c.remove(an);return}}}}function Y(an){var am,al,ak;am=a.grep(an.childNodes);for(al=0,ak=ab.length;al<ak;al++){if(T(ab[al],ag,an,an)){break}}if(ai.deep){for(al=0,ak=am.length;al<ak;al++){Y(am[al])}}}function ac(ak){var al;O(m(ak.parentNode).reverse(),function(am){var an;if(!al&&am.id!="_start"&&am.id!="_end"){an=x(am,X,ag);if(an&&an.split!==false){al=am}}});return al}function V(an,ak,ap,at){var au,ar,aq,am,ao,al;if(an){al=an.parentNode;for(au=ak.parentNode;au&&au!=al;au=au.parentNode){ar=au.cloneNode(R);for(ao=0;ao<ab.length;ao++){if(T(ab[ao],ag,ar,ar)){ar=0;break}}if(ar){if(aq){ar.appendChild(aq)}if(!am){am=ar}aq=ar}}if(at&&(!ai.mixed||!F(an))){ak=c.split(an,ak)}if(aq){ap.parentNode.insertBefore(aq,ap);am.appendChild(ap)}}return ak}function ah(ak){return V(ac(ak),ak,ak,true)}function ad(am){var al=c.get(am?"_start":"_end"),ak=al[am?"firstChild":"lastChild"];if(H(ak)){ak=ak[am?"firstChild":"lastChild"]}c.remove(al,true);return ak}function aj(ak){var al,am;ak=o(ak,ab,B);if(ai.split){al=J(ak,B);am=J(ak);if(al!=am){al=N(al,"span",{id:"_start","data-mce-type":"bookmark"});am=N(am,"span",{id:"_end","data-mce-type":"bookmark"});ah(al);ah(am);al=ad(B);am=ad()}else{al=am=ah(al)}ak.startContainer=al.parentNode;ak.startOffset=s(al);ak.endContainer=am.parentNode;ak.endOffset=s(am)+1}K.walk(ak,function(an){O(an,function(ao){Y(ao);if(ao.nodeType===1&&U.dom.getStyle(ao,"text-decoration")==="underline"&&ao.parentNode&&i(ao.parentNode)==="underline"){T({deep:false,exact:true,inline:"span",styles:{textDecoration:"underline"}},null,ao)}})})}if(aa){if(aa.nodeType){W=c.createRng();W.setStartBefore(aa);W.setEndAfter(aa);aj(W)}else{aj(aa)}return}if(!q.isCollapsed()||!ai.inline||c.select("td.mceSelected,th.mceSelected").length){af=q.getBookmark();aj(q.getRng(B));q.moveToBookmark(af);if(ai.inline&&j(X,ag,q.getStart())){Z(q.getRng(true))}U.nodeChanged()}else{P("remove",X,ag)}if(a.isWebKit){U.execCommand("mceCleanup")}}function D(W,Y,X){var V=Q(W);if(j(W,Y,X)&&(!("toggle" in V[0])||V[0]["toggle"])){A(W,Y,X)}else{S(W,Y,X)}}function x(W,V,ab,Z){var X=Q(V),ac,aa,Y;function ad(ah,aj,ak){var ag,ai,ae=aj[ak],af;if(aj.onmatch){return aj.onmatch(ah,aj,ak)}if(ae){if(ae.length===p){for(ag in ae){if(ae.hasOwnProperty(ag)){if(ak==="attributes"){ai=c.getAttrib(ah,ag)}else{ai=L(ah,ag)}if(Z&&!ai&&!aj.exact){return}if((!Z||aj.exact)&&!g(ai,r(ae[ag],ab))){return}}}}else{for(af=0;af<ae.length;af++){if(ak==="attributes"?c.getAttrib(ah,ae[af]):L(ah,ae[af])){return aj}}}}return aj}if(X&&W){for(aa=0;aa<X.length;aa++){ac=X[aa];if(h(W,ac)&&ad(W,ac,"attributes")&&ad(W,ac,"styles")){if(Y=ac.classes){for(aa=0;aa<Y.length;aa++){if(!c.hasClass(W,Y[aa])){return}}}return ac}}}}function j(X,Z,Y){var W;function V(aa){aa=c.getParent(aa,function(ab){return !!x(ab,X,Z,true)});return x(aa,X,Z)}if(Y){return V(Y)}Y=q.getNode();if(V(Y)){return B}W=q.getStart();if(W!=Y){if(V(W)){return B}}return R}function v(ac,ab){var Z,aa=[],Y={},X,W,V;Z=q.getStart();c.getParent(Z,function(af){var ae,ad;for(ae=0;ae<ac.length;ae++){ad=ac[ae];if(!Y[ad]&&x(af,ad,ab)){Y[ad]=true;aa.push(ad)}}});return aa}function y(Z){var ab=Q(Z),Y,X,aa,W,V;if(ab){Y=q.getStart();X=m(Y);for(W=ab.length-1;W>=0;W--){V=ab[W].selector;if(!V){return B}for(aa=X.length-1;aa>=0;aa--){if(c.is(X[aa],V)){return B}}}}return R}a.extend(this,{get:Q,register:k,apply:S,remove:A,toggle:D,match:j,matchAll:v,matchNode:x,canApply:y});function h(V,W){if(g(V,W.inline)){return B}if(g(V,W.block)){return B}if(W.selector){return c.is(V,W.selector)}}function g(W,V){W=W||"";V=V||"";W=""+(W.nodeName||W);V=""+(V.nodeName||V);return W.toLowerCase()==V.toLowerCase()}function L(W,V){var X=c.getStyle(W,V);if(V=="color"||V=="backgroundColor"){X=c.toHex(X)}if(V=="fontWeight"&&X==700){X="bold"}return""+X}function r(V,W){if(typeof(V)!="string"){V=V(W)}else{if(W){V=V.replace(/%(\w+)/g,function(Y,X){return W[X]||Y})}}return V}function f(V){return V&&V.nodeType===3&&/^([\t \r\n]+|)$/.test(V.nodeValue)}function N(X,W,V){var Y=c.create(W,V);X.parentNode.insertBefore(Y,X);Y.appendChild(X);return Y}function o(V,ah,Y){var X=V.startContainer,ac=V.startOffset,ak=V.endContainer,ae=V.endOffset,aj,ag,ab,af;function ai(aq){var al,ao,ap,an,am;al=ao=aq?X:ak;am=aq?"previousSibling":"nextSibling";root=c.getRoot();if(al.nodeType==3&&!f(al)){if(aq?ac>0:ae<al.nodeValue.length){return al}}for(;;){if(ao==root||(!ah[0].block_expand&&F(ao))){return ao}for(an=ao[am];an;an=an[am]){if(!H(an)&&!f(an)){return ao}}ao=ao.parentNode}return al}function aa(al,am){if(am===p){am=al.nodeType===3?al.length:al.childNodes.length}while(al&&al.hasChildNodes()){al=al.childNodes[am];if(al){am=al.nodeType===3?al.length:al.childNodes.length}}return{node:al,offset:am}}if(X.nodeType==1&&X.hasChildNodes()){ag=X.childNodes.length-1;X=X.childNodes[ac>ag?ag:ac];if(X.nodeType==3){ac=0}}if(ak.nodeType==1&&ak.hasChildNodes()){ag=ak.childNodes.length-1;ak=ak.childNodes[ae>ag?ag:ae-1];if(ak.nodeType==3){ae=ak.nodeValue.length}}if(H(X.parentNode)||H(X)){X=H(X)?X:X.parentNode;X=X.nextSibling||X;if(X.nodeType==3){ac=0}}if(H(ak.parentNode)||H(ak)){ak=H(ak)?ak:ak.parentNode;ak=ak.previousSibling||ak;if(ak.nodeType==3){ae=ak.length}}if(ah[0].inline){if(V.collapsed){function ad(am,aq,at){var ap,an,ar,al;function ao(av,ax){var ay,au,aw=av.nodeValue;if(typeof(ax)=="undefined"){ax=at?aw.length:0}if(at){ay=aw.lastIndexOf(" ",ax);au=aw.lastIndexOf("\u00a0",ax);ay=ay>au?ay:au;if(ay!==-1&&!Y){ay++}}else{ay=aw.indexOf(" ",ax);au=aw.indexOf("\u00a0",ax);ay=ay!==-1&&(au===-1||ay<au)?ay:au}return ay}if(am.nodeType===3){ar=ao(am,aq);if(ar!==-1){return{container:am,offset:ar}}al=am}ap=new t(am,c.getParent(am,F)||U.getBody());while(an=ap[at?"prev":"next"]()){if(an.nodeType===3){al=an;ar=ao(an);if(ar!==-1){return{container:an,offset:ar}}}else{if(F(an)){break}}}if(al){if(at){aq=0}else{aq=al.length}return{container:al,offset:aq}}}af=ad(X,ac,true);if(af){X=af.container;ac=af.offset}af=ad(ak,ae);if(af){ak=af.container;ae=af.offset}}ab=aa(ak,ae);if(ab.node){while(ab.node&&ab.offset===0&&ab.node.previousSibling){ab=aa(ab.node.previousSibling)}if(ab.node&&ab.offset>0&&ab.node.nodeType===3&&ab.node.nodeValue.charAt(ab.offset-1)===" "){if(ab.offset>1){ak=ab.node;ak.splitText(ab.offset-1)}else{if(ab.node.previousSibling){}}}}}if(ah[0].inline||ah[0].block_expand){if(!ah[0].inline||(X.nodeType!=3||ac===0)){X=ai(true)}if(!ah[0].inline||(ak.nodeType!=3||ae===ak.nodeValue.length)){ak=ai()}}if(ah[0].selector&&ah[0].expand!==R&&!ah[0].inline){function Z(am,al){var an,ao,aq,ap;if(am.nodeType==3&&am.nodeValue.length==0&&am[al]){am=am[al]}an=m(am);for(ao=0;ao<an.length;ao++){for(aq=0;aq<ah.length;aq++){ap=ah[aq];if("collapsed" in ap&&ap.collapsed!==V.collapsed){continue}if(c.is(an[ao],ap.selector)){return an[ao]}}}return am}X=Z(X,"previousSibling");ak=Z(ak,"nextSibling")}if(ah[0].block||ah[0].selector){function W(am,al,ao){var an;if(!ah[0].wrapper){an=c.getParent(am,ah[0].block)}if(!an){an=c.getParent(am.nodeType==3?am.parentNode:am,F)}if(an&&ah[0].wrapper){an=m(an,"ul,ol").reverse()[0]||an}if(!an){an=am;while(an[al]&&!F(an[al])){an=an[al];if(g(an,"br")){break}}}return an||am}X=W(X,"previousSibling");ak=W(ak,"nextSibling");if(ah[0].block){if(!F(X)){X=ai(true)}if(!F(ak)){ak=ai()}}}if(X.nodeType==1){ac=s(X);X=X.parentNode}if(ak.nodeType==1){ae=s(ak)+1;ak=ak.parentNode}return{startContainer:X,startOffset:ac,endContainer:ak,endOffset:ae}}function T(ab,aa,Y,V){var X,W,Z;if(!h(Y,ab)){return R}if(ab.remove!="all"){O(ab.styles,function(ad,ac){ad=r(ad,aa);if(typeof(ac)==="number"){ac=ad;V=0}if(!V||g(L(V,ac),ad)){c.setStyle(Y,ac,"")}Z=1});if(Z&&c.getAttrib(Y,"style")==""){Y.removeAttribute("style");Y.removeAttribute("data-mce-style")}O(ab.attributes,function(ae,ac){var ad;ae=r(ae,aa);if(typeof(ac)==="number"){ac=ae;V=0}if(!V||g(c.getAttrib(V,ac),ae)){if(ac=="class"){ae=c.getAttrib(Y,ac);if(ae){ad="";O(ae.split(/\s+/),function(af){if(/mce\w+/.test(af)){ad+=(ad?" ":"")+af}});if(ad){c.setAttrib(Y,ac,ad);return}}}if(ac=="class"){Y.removeAttribute("className")}if(e.test(ac)){Y.removeAttribute("data-mce-"+ac)}Y.removeAttribute(ac)}});O(ab.classes,function(ac){ac=r(ac,aa);if(!V||c.hasClass(V,ac)){c.removeClass(Y,ac)}});W=c.getAttribs(Y);for(X=0;X<W.length;X++){if(W[X].nodeName.indexOf("_")!==0){return R}}}if(ab.remove!="none"){n(Y,ab);return B}}function n(X,Y){var V=X.parentNode,W;if(Y.block){if(!l){function Z(ab,aa,ac){ab=C(ab,aa,ac);return !ab||(ab.nodeName=="BR"||F(ab))}if(F(X)&&!F(V)){if(!Z(X,R)&&!Z(X.firstChild,B,1)){X.insertBefore(c.create("br"),X.firstChild)}if(!Z(X,B)&&!Z(X.lastChild,R,1)){X.appendChild(c.create("br"))}}}else{if(V==c.getRoot()){if(!Y.list_block||!g(X,Y.list_block)){O(a.grep(X.childNodes),function(aa){if(d(l,aa.nodeName.toLowerCase())){if(!W){W=N(aa,l)}else{W.appendChild(aa)}}else{W=0}})}}}}if(Y.selector&&Y.inline&&!g(Y.inline,X)){return}c.remove(X,1)}function C(W,V,X){if(W){V=V?"nextSibling":"previousSibling";for(W=X?W:W[V];W;W=W[V]){if(W.nodeType==1||!f(W)){return W}}}}function H(V){return V&&V.nodeType==1&&V.getAttribute("data-mce-type")=="bookmark"}function u(Z,Y){var V,X,W;function ab(ae,ad){if(ae.nodeName!=ad.nodeName){return R}function ac(ag){var ah={};O(c.getAttribs(ag),function(ai){var aj=ai.nodeName.toLowerCase();if(aj.indexOf("_")!==0&&aj!=="style"){ah[aj]=c.getAttrib(ag,aj)}});return ah}function af(aj,ai){var ah,ag;for(ag in aj){if(aj.hasOwnProperty(ag)){ah=ai[ag];if(ah===p){return R}if(aj[ag]!=ah){return R}delete ai[ag]}}for(ag in ai){if(ai.hasOwnProperty(ag)){return R}}return B}if(!af(ac(ae),ac(ad))){return R}if(!af(c.parseStyle(c.getAttrib(ae,"style")),c.parseStyle(c.getAttrib(ad,"style")))){return R}return B}if(Z&&Y){function aa(ad,ac){for(X=ad;X;X=X[ac]){if(X.nodeType==3&&X.nodeValue.length!==0){return ad}if(X.nodeType==1&&!H(X)){return X}}return ad}Z=aa(Z,"previousSibling");Y=aa(Y,"nextSibling");if(ab(Z,Y)){for(X=Z.nextSibling;X&&X!=Y;){W=X;X=X.nextSibling;Z.appendChild(W)}c.remove(Y);O(a.grep(Y.childNodes),function(ac){Z.appendChild(ac)});return Z}}return Y}function G(V){return/^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(V)}function J(W,aa){var V,Z,X,Y;V=W[aa?"startContainer":"endContainer"];Z=W[aa?"startOffset":"endOffset"];if(V.nodeType==1){X=V.childNodes.length-1;if(!aa&&Z){Z--}V=V.childNodes[Z>X?X:Z]}if(V.nodeType===3&&aa&&Z>=V.nodeValue.length){V=new t(V,U.getBody()).next()||V}if(V.nodeType===3&&!aa&&Z==0){V=new t(V,U.getBody()).prev()||V}return V}function P(ae,V,ac){var ah,af="_mce_caret",W=U.settings.caret_debug;ah=a.isGecko?"\u200B":E;function X(aj){var ai=c.create("span",{id:af,"data-mce-bogus":true,style:W?"color:red":""});if(aj){ai.appendChild(U.getDoc().createTextNode(ah))}return ai}function ad(aj,ai){while(aj){if((aj.nodeType===3&&aj.nodeValue!==ah)||aj.childNodes.length>1){return false}if(ai&&aj.nodeType===1){ai.push(aj)}aj=aj.firstChild}return true}function aa(ai){while(ai){if(ai.id===af){return ai}ai=ai.parentNode}}function Z(ai){var aj;if(ai){aj=new t(ai,ai);for(ai=aj.current();ai;ai=aj.next()){if(ai.nodeType===3){return ai}}}}function Y(ak,aj){var al,ai;if(!ak){ak=aa(q.getStart());if(!ak){while(ak=c.get(af)){Y(ak,false)}}}else{ai=q.getRng(true);if(ad(ak)){if(aj!==false){ai.setStartBefore(ak);ai.setEndBefore(ak)}c.remove(ak)}else{al=Z(ak);al=al.deleteData(0,1);c.remove(ak,1)}q.setRng(ai)}}function ab(){var ak,ai,ao,an,al,aj,am;ak=q.getRng(true);an=ak.startOffset;aj=ak.startContainer;am=aj.nodeValue;ai=aa(q.getStart());if(ai){ao=Z(ai)}if(am&&an>0&&an<am.length&&/\w/.test(am.charAt(an))&&/\w/.test(am.charAt(an-1))){al=q.getBookmark();ak.collapse(true);ak=o(ak,Q(V));ak=K.split(ak);S(V,ac,ak);q.moveToBookmark(al)}else{if(!ai||ao.nodeValue!==ah){ai=X(true);ao=ai.firstChild;ak.insertNode(ai);an=1;S(V,ac,ai)}else{S(V,ac,ai)}q.setCursorLocation(ao,an)}}function ag(){var ai=q.getRng(true),aj,al,ao,an,ak,ar,aq=[],am,ap;aj=ai.startContainer;al=ai.startOffset;ak=aj;if(aj.nodeType==3){if(al!=aj.nodeValue.length||aj.nodeValue===ah){an=true}ak=ak.parentNode}while(ak){if(x(ak,V,ac)){ar=ak;break}if(ak.nextSibling){an=true}aq.push(ak);ak=ak.parentNode}if(!ar){return}if(an){ao=q.getBookmark();ai.collapse(true);ai=o(ai,Q(V),true);ai=K.split(ai);A(V,ac,ai);q.moveToBookmark(ao)}else{ap=X();ak=ap;for(am=aq.length-1;am>=0;am--){ak.appendChild(aq[am].cloneNode(false));ak=ak.firstChild}ak.appendChild(c.doc.createTextNode(ah));ak=ak.firstChild;c.insertAfter(ap,ar);q.setCursorLocation(ak,1)}}U.onBeforeGetContent.addToTop(function(){var ai=[],aj;if(ad(aa(q.getStart()),ai)){aj=ai.length;while(aj--){c.setAttrib(ai[aj],"data-mce-bogus","1")}}});a.each("onMouseUp onKeyUp".split(" "),function(ai){U[ai].addToTop(function(){Y()})});U.onKeyDown.addToTop(function(ai,ak){var aj=ak.keyCode;if(aj==8||aj==37||aj==39){Y(aa(q.getStart()))}});if(ae=="apply"){ab()}else{ag()}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;if(c.inline_styles){h=e.explode(c.font_size_legacy_values);function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});
tiny_mce/tiny_mce_popup.js CHANGED
@@ -2,4 +2,4 @@
2
  // Uncomment and change this document.domain value if you are loading the script cross subdomains
3
  // document.domain = 'moxiecode.com';
4
 
5
- var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},0)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.domLoaded){return}b.domLoaded=1;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){tinymce.dom.Event._add(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_wait:function(){if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);tinyMCEPopup._onDOMLoaded()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(tinyMCEPopup.domLoaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}tinyMCEPopup._onDOMLoaded()})()}document.attachEvent("onload",tinyMCEPopup._onDOMLoaded)}else{if(document.addEventListener){window.addEventListener("DOMContentLoaded",tinyMCEPopup._onDOMLoaded,false);window.addEventListener("load",tinyMCEPopup._onDOMLoaded,false)}}}};tinyMCEPopup.init();tinyMCEPopup._wait();
2
  // Uncomment and change this document.domain value if you are loading the script cross subdomains
3
  // document.domain = 'moxiecode.com';
4
 
5
+ var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.domLoaded){return}b.domLoaded=1;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}if(!b.editor.getParam("browser_preferred_colors",false)||!b.isWindow){b.dom.addClass(document.body,"forceColors")}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){tinymce.dom.Event._add(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_wait:function(){if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);tinyMCEPopup._onDOMLoaded()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(tinyMCEPopup.domLoaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}tinyMCEPopup._onDOMLoaded()})()}document.attachEvent("onload",tinyMCEPopup._onDOMLoaded)}else{if(document.addEventListener){window.addEventListener("DOMContentLoaded",tinyMCEPopup._onDOMLoaded,false);window.addEventListener("load",tinyMCEPopup._onDOMLoaded,false)}}}};tinyMCEPopup.init();tinyMCEPopup._wait();
tiny_mce/utils/editable_selects.js CHANGED
@@ -16,7 +16,7 @@ var TinyMCE_EditableSelects = {
16
 
17
  for (i=0; i<nl.length; i++) {
18
  if (nl[i].className.indexOf('mceEditableSelect') != -1) {
19
- o = new Option('(value)', '__mce_add_custom__');
20
 
21
  o.className = 'mceAddSelectValue';
22
 
16
 
17
  for (i=0; i<nl.length; i++) {
18
  if (nl[i].className.indexOf('mceEditableSelect') != -1) {
19
+ o = new Option(tinyMCEPopup.editor.translate('value'), '__mce_add_custom__');
20
 
21
  o.className = 'mceAddSelectValue';
22
 
tiny_mce/utils/form_utils.js CHANGED
@@ -11,10 +11,14 @@
11
  var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
12
 
13
  function getColorPickerHTML(id, target_form_element) {
14
- var h = "";
15
 
16
- h += '<a id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">';
17
- h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '">&nbsp;</span></a>';
 
 
 
 
18
 
19
  return h;
20
  }
@@ -67,6 +71,9 @@ function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
67
  if (!form_obj || !form_obj.elements[field_name])
68
  return;
69
 
 
 
 
70
  var sel = form_obj.elements[field_name];
71
 
72
  var found = false;
@@ -171,7 +178,7 @@ function convertHexToRGB(col) {
171
  }
172
 
173
  function trimSize(size) {
174
- return size.replace(/([0-9\.]+)px|(%|in|cm|mm|em|ex|pt|pc)/, '$1$2');
175
  }
176
 
177
  function getCSSSize(size) {
@@ -183,6 +190,9 @@ function getCSSSize(size) {
183
  // Add px
184
  if (/^[0-9]+$/.test(size))
185
  size += 'px';
 
 
 
186
 
187
  return size;
188
  }
11
  var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
12
 
13
  function getColorPickerHTML(id, target_form_element) {
14
+ var h = "", dom = tinyMCEPopup.dom;
15
 
16
+ if (label = dom.select('label[for=' + target_form_element + ']')[0]) {
17
+ label.id = label.id || dom.uniqueId();
18
+ }
19
+
20
+ h += '<a role="button" aria-labelledby="' + id + '_label" id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">';
21
+ h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '">&nbsp;<span id="' + id + '_label" class="mceVoiceLabel mceIconOnly" style="display:none;">' + tinyMCEPopup.getLang('browse') + '</span></span></a>';
22
 
23
  return h;
24
  }
71
  if (!form_obj || !form_obj.elements[field_name])
72
  return;
73
 
74
+ if (!value)
75
+ value = "";
76
+
77
  var sel = form_obj.elements[field_name];
78
 
79
  var found = false;
178
  }
179
 
180
  function trimSize(size) {
181
+ return size.replace(/([0-9\.]+)(px|%|in|cm|mm|em|ex|pt|pc)/i, '$1$2');
182
  }
183
 
184
  function getCSSSize(size) {
190
  // Add px
191
  if (/^[0-9]+$/.test(size))
192
  size += 'px';
193
+ // Sanity check, IE doesn't like broken values
194
+ else if (!(/^[0-9\.]+(px|%|in|cm|mm|em|ex|pt|pc)$/i.test(size)))
195
+ return "";
196
 
197
  return size;
198
  }
tiny_mce/utils/mctabs.js CHANGED
@@ -10,6 +10,7 @@
10
 
11
  function MCTabs() {
12
  this.settings = [];
 
13
  };
14
 
15
  MCTabs.prototype.init = function(settings) {
@@ -28,26 +29,62 @@ MCTabs.prototype.getParam = function(name, default_value) {
28
  return value;
29
  };
30
 
31
- MCTabs.prototype.displayTab = function(tab_id, panel_id) {
32
- var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
  panelElm= document.getElementById(panel_id);
35
  panelContainerElm = panelElm ? panelElm.parentNode : null;
36
- tabElm = document.getElementById(tab_id);
37
  tabContainerElm = tabElm ? tabElm.parentNode : null;
38
- selectionClass = this.getParam('selection_class', 'current');
39
 
40
  if (tabElm && tabContainerElm) {
41
  nodes = tabContainerElm.childNodes;
42
 
43
  // Hide all other tabs
44
  for (i = 0; i < nodes.length; i++) {
45
- if (nodes[i].nodeName == "LI")
46
- nodes[i].className = '';
 
47
  }
48
 
49
  // Show selected tab
50
- tabElm.className = 'current';
51
  }
52
 
53
  if (panelElm && panelContainerElm) {
@@ -56,11 +93,15 @@ MCTabs.prototype.displayTab = function(tab_id, panel_id) {
56
  // Hide all other panels
57
  for (i = 0; i < nodes.length; i++) {
58
  if (nodes[i].nodeName == "DIV")
59
- nodes[i].className = 'panel';
 
 
 
 
60
  }
61
 
62
  // Show selected panel
63
- panelElm.className = 'current';
64
  }
65
  };
66
 
@@ -73,5 +114,49 @@ MCTabs.prototype.getAnchor = function() {
73
  return "";
74
  };
75
 
76
- // Global instance
 
77
  var mcTabs = new MCTabs();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
  function MCTabs() {
12
  this.settings = [];
13
+ this.onChange = tinyMCEPopup.editor.windowManager.createInstance('tinymce.util.Dispatcher');
14
  };
15
 
16
  MCTabs.prototype.init = function(settings) {
29
  return value;
30
  };
31
 
32
+ MCTabs.prototype.showTab =function(tab){
33
+ tab.className = 'current';
34
+ tab.setAttribute("aria-selected", true);
35
+ tab.setAttribute("aria-expanded", true);
36
+ tab.tabIndex = 0;
37
+ };
38
+
39
+ MCTabs.prototype.hideTab =function(tab){
40
+ var t=this;
41
+
42
+ tab.className = '';
43
+ tab.setAttribute("aria-selected", false);
44
+ tab.setAttribute("aria-expanded", false);
45
+ tab.tabIndex = -1;
46
+ };
47
+
48
+ MCTabs.prototype.showPanel = function(panel) {
49
+ panel.className = 'current';
50
+ panel.setAttribute("aria-hidden", false);
51
+ };
52
+
53
+ MCTabs.prototype.hidePanel = function(panel) {
54
+ panel.className = 'panel';
55
+ panel.setAttribute("aria-hidden", true);
56
+ };
57
+
58
+ MCTabs.prototype.getPanelForTab = function(tabElm) {
59
+ return tinyMCEPopup.dom.getAttrib(tabElm, "aria-controls");
60
+ };
61
+
62
+ MCTabs.prototype.displayTab = function(tab_id, panel_id, avoid_focus) {
63
+ var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i, t = this;
64
+
65
+ tabElm = document.getElementById(tab_id);
66
+
67
+ if (panel_id === undefined) {
68
+ panel_id = t.getPanelForTab(tabElm);
69
+ }
70
 
71
  panelElm= document.getElementById(panel_id);
72
  panelContainerElm = panelElm ? panelElm.parentNode : null;
 
73
  tabContainerElm = tabElm ? tabElm.parentNode : null;
74
+ selectionClass = t.getParam('selection_class', 'current');
75
 
76
  if (tabElm && tabContainerElm) {
77
  nodes = tabContainerElm.childNodes;
78
 
79
  // Hide all other tabs
80
  for (i = 0; i < nodes.length; i++) {
81
+ if (nodes[i].nodeName == "LI") {
82
+ t.hideTab(nodes[i]);
83
+ }
84
  }
85
 
86
  // Show selected tab
87
+ t.showTab(tabElm);
88
  }
89
 
90
  if (panelElm && panelContainerElm) {
93
  // Hide all other panels
94
  for (i = 0; i < nodes.length; i++) {
95
  if (nodes[i].nodeName == "DIV")
96
+ t.hidePanel(nodes[i]);
97
+ }
98
+
99
+ if (!avoid_focus) {
100
+ tabElm.focus();
101
  }
102
 
103
  // Show selected panel
104
+ t.showPanel(panelElm);
105
  }
106
  };
107
 
114
  return "";
115
  };
116
 
117
+
118
+ //Global instance
119
  var mcTabs = new MCTabs();
120
+
121
+ tinyMCEPopup.onInit.add(function() {
122
+ var tinymce = tinyMCEPopup.getWin().tinymce, dom = tinyMCEPopup.dom, each = tinymce.each;
123
+
124
+ each(dom.select('div.tabs'), function(tabContainerElm) {
125
+ var keyNav;
126
+
127
+ dom.setAttrib(tabContainerElm, "role", "tablist");
128
+
129
+ var items = tinyMCEPopup.dom.select('li', tabContainerElm);
130
+ var action = function(id) {
131
+ mcTabs.displayTab(id, mcTabs.getPanelForTab(id));
132
+ mcTabs.onChange.dispatch(id);
133
+ };
134
+
135
+ each(items, function(item) {
136
+ dom.setAttrib(item, 'role', 'tab');
137
+ dom.bind(item, 'click', function(evt) {
138
+ action(item.id);
139
+ });
140
+ });
141
+
142
+ dom.bind(dom.getRoot(), 'keydown', function(evt) {
143
+ if (evt.keyCode === 9 && evt.ctrlKey && !evt.altKey) { // Tab
144
+ keyNav.moveFocus(evt.shiftKey ? -1 : 1);
145
+ tinymce.dom.Event.cancel(evt);
146
+ }
147
+ });
148
+
149
+ each(dom.select('a', tabContainerElm), function(a) {
150
+ dom.setAttrib(a, 'tabindex', '-1');
151
+ });
152
+
153
+ keyNav = tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
154
+ root: tabContainerElm,
155
+ items: items,
156
+ onAction: action,
157
+ actOnFocus: true,
158
+ enableLeftRight: true,
159
+ enableUpDown: true
160
+ }, tinyMCEPopup.dom);
161
+ });
162
+ });
tiny_mce/utils/validate.js CHANGED
@@ -32,7 +32,7 @@ var Validator = {
32
  },
33
 
34
  isSize : function(s) {
35
- return this.test(s, '^[0-9]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
36
  },
37
 
38
  isId : function(s) {
@@ -96,8 +96,10 @@ var AutoValidator = {
96
  var i, nl, s = this.settings, c = 0;
97
 
98
  nl = this.tags(f, 'label');
99
- for (i=0; i<nl.length; i++)
100
  this.removeClass(nl[i], s.invalid_cls);
 
 
101
 
102
  c += this.validateElms(f, 'input');
103
  c += this.validateElms(f, 'select');
@@ -109,6 +111,33 @@ var AutoValidator = {
109
  invalidate : function(n) {
110
  this.mark(n.form, n);
111
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
 
113
  reset : function(e) {
114
  var t = ['label', 'input', 'select', 'textarea'];
@@ -119,8 +148,10 @@ var AutoValidator = {
119
 
120
  for (i=0; i<t.length; i++) {
121
  nl = this.tags(e.form ? e.form : e, t[i]);
122
- for (j=0; j<nl.length; j++)
123
  this.removeClass(nl[j], s.invalid_cls);
 
 
124
  }
125
  },
126
 
@@ -201,6 +232,7 @@ var AutoValidator = {
201
  var s = this.settings;
202
 
203
  this.addClass(n, s.invalid_cls);
 
204
  this.markLabels(f, n, s.invalid_cls);
205
 
206
  return false;
32
  },
33
 
34
  isSize : function(s) {
35
+ return this.test(s, '^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
36
  },
37
 
38
  isId : function(s) {
96
  var i, nl, s = this.settings, c = 0;
97
 
98
  nl = this.tags(f, 'label');
99
+ for (i=0; i<nl.length; i++) {
100
  this.removeClass(nl[i], s.invalid_cls);
101
+ nl[i].setAttribute('aria-invalid', false);
102
+ }
103
 
104
  c += this.validateElms(f, 'input');
105
  c += this.validateElms(f, 'select');
111
  invalidate : function(n) {
112
  this.mark(n.form, n);
113
  },
114
+
115
+ getErrorMessages : function(f) {
116
+ var nl, i, s = this.settings, field, msg, values, messages = [], ed = tinyMCEPopup.editor;
117
+ nl = this.tags(f, "label");
118
+ for (i=0; i<nl.length; i++) {
119
+ if (this.hasClass(nl[i], s.invalid_cls)) {
120
+ field = document.getElementById(nl[i].getAttribute("for"));
121
+ values = { field: nl[i].textContent };
122
+ if (this.hasClass(field, s.min_cls, true)) {
123
+ message = ed.getLang('invalid_data_min');
124
+ values.min = this.getNum(field, s.min_cls);
125
+ } else if (this.hasClass(field, s.number_cls)) {
126
+ message = ed.getLang('invalid_data_number');
127
+ } else if (this.hasClass(field, s.size_cls)) {
128
+ message = ed.getLang('invalid_data_size');
129
+ } else {
130
+ message = ed.getLang('invalid_data');
131
+ }
132
+
133
+ message = message.replace(/{\#([^}]+)\}/g, function(a, b) {
134
+ return values[b] || '{#' + b + '}';
135
+ });
136
+ messages.push(message);
137
+ }
138
+ }
139
+ return messages;
140
+ },
141
 
142
  reset : function(e) {
143
  var t = ['label', 'input', 'select', 'textarea'];
148
 
149
  for (i=0; i<t.length; i++) {
150
  nl = this.tags(e.form ? e.form : e, t[i]);
151
+ for (j=0; j<nl.length; j++) {
152
  this.removeClass(nl[j], s.invalid_cls);
153
+ nl[j].setAttribute('aria-invalid', false);
154
+ }
155
  }
156
  },
157
 
232
  var s = this.settings;
233
 
234
  this.addClass(n, s.invalid_cls);
235
+ n.setAttribute('aria-invalid', 'true');
236
  this.markLabels(f, n, s.invalid_cls);
237
 
238
  return false;
users-edit.php CHANGED
@@ -54,6 +54,15 @@ $options_profile = get_option('newsletter_profile');
54
  <?php $nc->select('status', array('C'=>'Confirmed', 'S'=>'Not confirmed', 'U'=>'Unsubscribed')); ?>
55
  </td>
56
  </tr>
 
 
 
 
 
 
 
 
 
57
  <tr valign="top">
58
  <th>Lists</th>
59
  <td>
54
  <?php $nc->select('status', array('C'=>'Confirmed', 'S'=>'Not confirmed', 'U'=>'Unsubscribed')); ?>
55
  </td>
56
  </tr>
57
+ <tr valign="top">
58
+ <th>Test subscriber?</th>
59
+ <td>
60
+ <?php $nc->yesno('test'); ?>
61
+ <div class="hints">
62
+ A test subscriber is a normal subscriber that is used when sending test are made, too.
63
+ </div>
64
+ </td>
65
+ </tr>
66
  <tr valign="top">
67
  <th>Lists</th>
68
  <td>