Abandoned Cart Lite for WooCommerce - Version 1.4

Version Description

Download this release

Release Info

Developer ashokrane
Plugin Icon 128x128 Abandoned Cart Lite for WooCommerce
Version 1.4
Comparing to
See all releases

Code changes from version 1.1 to 1.4

Files changed (26) hide show
  1. cron/send_email.php +10 -12
  2. js/jquery.tipTip.minified.js +20 -20
  3. js/tinymce/changelog.txt +477 -477
  4. js/tinymce/examples/accessibility.html +10 -10
  5. js/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin_src.js +184 -184
  6. js/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js +119 -119
  7. js/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js +1 -1
  8. js/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin_src.js +50 -50
  9. js/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +90 -90
  10. js/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +2 -2
  11. js/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js +955 -955
  12. js/tinymce/jscripts/tiny_mce/plugins/media/langs/en_dlg.js +1 -1
  13. js/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js +52 -52
  14. js/tinymce/jscripts/tiny_mce/plugins/style/langs/en_dlg.js +1 -1
  15. js/tinymce/jscripts/tiny_mce/plugins/style/props.htm +845 -845
  16. js/tinymce/jscripts/tiny_mce/plugins/style/readme.txt +19 -19
  17. js/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js +122 -122
  18. js/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js +1456 -1456
  19. js/tinymce/jscripts/tiny_mce/plugins/table/js/table.js +3 -3
  20. js/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js +345 -345
  21. js/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js +1 -1
  22. js/tinymce/jscripts/tiny_mce/tiny_mce_popup.js +4 -4
  23. readme.txt +11 -3
  24. woo-includes/class-wc-dependencies.php +29 -29
  25. woo-includes/woo-functions.php +96 -96
  26. woocommerce-ac.php +243 -114
cron/send_email.php CHANGED
@@ -1,7 +1,6 @@
1
  <?php
2
 
3
- require_once('../../../../wp-load.php');
4
-
5
  //if (is_woocommerce_active())
6
  {
7
 
@@ -47,7 +46,7 @@ require_once('../../../../wp-load.php');
47
 
48
  //Fetch all active templates present in the system
49
  $query = "SELECT wpet . *
50
- FROM `".$wpdb->prefix."ac_email_templates` AS wpet
51
  WHERE wpet.is_active = '1'
52
  ORDER BY `day_or_hour` DESC, `frequency` ASC ";
53
  $results = $wpdb->get_results( $query );
@@ -72,9 +71,8 @@ require_once('../../../../wp-load.php');
72
 
73
  $email_subject = $value->subject;
74
  $user_email_from = get_option('admin_email');
75
- $headers[] = "From: ".$value->from_name." <".$user_email_from.">";
76
- $headers[] = "Content-Type: text/html";
77
-
78
  $template_id = $value->id;
79
 
80
  foreach ($carts as $key => $value )
@@ -95,12 +93,12 @@ require_once('../../../../wp-load.php');
95
  $email_body = str_replace("{{customer.lastname}}", get_user_meta($value->user_id, 'last_name', true), $email_body);
96
  $email_body = str_replace("{{customer.fullname}}", get_user_meta($value->user_id, 'first_name', true)." ".get_user_meta($value->user_id, 'last_name', true), $email_body);
97
 
98
- $query_sent = "INSERT INTO `".$wpdb->prefix."ac_sent_history` (template_id, abandoned_order_id, sent_time, sent_email_id)
99
  VALUES ('".$template_id."', '".$value->id."', '".current_time('mysql')."', '".$value->user_email."' )";
100
 
101
- mysql_query($query_sent);
102
 
103
- $query_id = "SELECT * FROM `".$wpdb->prefix."ac_sent_history` WHERE template_id='".$template_id."' AND abandoned_order_id='".$value->id."'
104
  ORDER BY id DESC
105
  LIMIT 1 ";
106
 
@@ -134,7 +132,7 @@ require_once('../../../../wp-load.php');
134
  $cart_time = current_time('timestamp') - $template_to_send_after_time - $cart_abandon_cut_off_time;
135
 
136
  $query = "SELECT wpac . * , wpu.user_login, wpu.user_email
137
- FROM `".$wpdb->prefix."ac_abandoned_cart_history` AS wpac
138
  LEFT JOIN ".$wpdb->prefix."users AS wpu ON wpac.user_id = wpu.id
139
  WHERE cart_ignored = '0'
140
  AND abandoned_cart_time < $cart_time
@@ -151,8 +149,8 @@ require_once('../../../../wp-load.php');
151
 
152
  global $wpdb;
153
  $query = "SELECT wpcs . * , wpac . abandoned_cart_time , wpac . user_id
154
- FROM `".$wpdb->prefix."ac_sent_history` AS wpcs
155
- LEFT JOIN ".$wpdb->prefix."ac_abandoned_cart_history AS wpac ON wpcs.abandoned_order_id = wpac.id
156
  WHERE
157
  template_id='".$template_id."'
158
  AND
1
  <?php
2
 
3
+ require_once( ABSPATH . 'wp-load.php' );
 
4
  //if (is_woocommerce_active())
5
  {
6
 
46
 
47
  //Fetch all active templates present in the system
48
  $query = "SELECT wpet . *
49
+ FROM `".$wpdb->prefix."ac_email_templates_lite` AS wpet
50
  WHERE wpet.is_active = '1'
51
  ORDER BY `day_or_hour` DESC, `frequency` ASC ";
52
  $results = $wpdb->get_results( $query );
71
 
72
  $email_subject = $value->subject;
73
  $user_email_from = get_option('admin_email');
74
+ $headers[] = "From: ".$value->from_name." <".$user_email_from.">"."\r\n";
75
+ $headers[] = "Content-Type: text/html"."\r\n";
 
76
  $template_id = $value->id;
77
 
78
  foreach ($carts as $key => $value )
93
  $email_body = str_replace("{{customer.lastname}}", get_user_meta($value->user_id, 'last_name', true), $email_body);
94
  $email_body = str_replace("{{customer.fullname}}", get_user_meta($value->user_id, 'first_name', true)." ".get_user_meta($value->user_id, 'last_name', true), $email_body);
95
 
96
+ $query_sent = "INSERT INTO `".$wpdb->prefix."ac_sent_history_lite` (template_id, abandoned_order_id, sent_time, sent_email_id)
97
  VALUES ('".$template_id."', '".$value->id."', '".current_time('mysql')."', '".$value->user_email."' )";
98
 
99
+ $wpdb->query($query_sent);
100
 
101
+ $query_id = "SELECT * FROM `".$wpdb->prefix."ac_sent_history_lite` WHERE template_id='".$template_id."' AND abandoned_order_id='".$value->id."'
102
  ORDER BY id DESC
103
  LIMIT 1 ";
104
 
132
  $cart_time = current_time('timestamp') - $template_to_send_after_time - $cart_abandon_cut_off_time;
133
 
134
  $query = "SELECT wpac . * , wpu.user_login, wpu.user_email
135
+ FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` AS wpac
136
  LEFT JOIN ".$wpdb->prefix."users AS wpu ON wpac.user_id = wpu.id
137
  WHERE cart_ignored = '0'
138
  AND abandoned_cart_time < $cart_time
149
 
150
  global $wpdb;
151
  $query = "SELECT wpcs . * , wpac . abandoned_cart_time , wpac . user_id
152
+ FROM `".$wpdb->prefix."ac_sent_history_lite` AS wpcs
153
+ LEFT JOIN ".$wpdb->prefix."ac_abandoned_cart_history_lite AS wpac ON wpcs.abandoned_order_id = wpac.id
154
  WHERE
155
  template_id='".$template_id."'
156
  AND
js/jquery.tipTip.minified.js CHANGED
@@ -1,21 +1,21 @@
1
- /*
2
- * TipTip
3
- * Copyright 2010 Drew Wilson
4
- * www.drewwilson.com
5
- * code.drewwilson.com/entry/tiptip-jquery-plugin
6
- *
7
- * Version 1.3 - Updated: Mar. 23, 2010
8
- *
9
- * This Plug-In will create a custom tooltip to replace the default
10
- * browser tooltip. It is extremely lightweight and very smart in
11
- * that it detects the edges of the browser window and will make sure
12
- * the tooltip stays within the current window size. As a result the
13
- * tooltip will adjust itself to be displayed above, below, to the left
14
- * or to the right depending on what is necessary to stay within the
15
- * browser window. It is completely customizable as well via CSS.
16
- *
17
- * This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses:
18
- * http://www.opensource.org/licenses/mit-license.php
19
- * http://www.gnu.org/licenses/gpl.html
20
- */
21
  (function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="max-width:'+opts.maxWidth+';"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)<parseInt($(window).scrollLeft());var left_compare=(tip_w+left)>parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery);
1
+ /*
2
+ * TipTip
3
+ * Copyright 2010 Drew Wilson
4
+ * www.drewwilson.com
5
+ * code.drewwilson.com/entry/tiptip-jquery-plugin
6
+ *
7
+ * Version 1.3 - Updated: Mar. 23, 2010
8
+ *
9
+ * This Plug-In will create a custom tooltip to replace the default
10
+ * browser tooltip. It is extremely lightweight and very smart in
11
+ * that it detects the edges of the browser window and will make sure
12
+ * the tooltip stays within the current window size. As a result the
13
+ * tooltip will adjust itself to be displayed above, below, to the left
14
+ * or to the right depending on what is necessary to stay within the
15
+ * browser window. It is completely customizable as well via CSS.
16
+ *
17
+ * This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses:
18
+ * http://www.opensource.org/licenses/mit-license.php
19
+ * http://www.gnu.org/licenses/gpl.html
20
+ */
21
  (function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="max-width:'+opts.maxWidth+';"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)<parseInt($(window).scrollLeft());var left_compare=(tip_w+left)>parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery);
js/tinymce/changelog.txt CHANGED
@@ -1,477 +1,477 @@
1
- Version 3.5.8 (2012-11-20)
2
- Fixed bug where html5 data attributes where stripped from contents.
3
- Fixed bug where toolbar was annouced multiple times with JAWS on Firefox.
4
- Fixed bug where the editor view whouldn't scroll to BR elements when using shift+enter or br enter mode.
5
- Fixed bug where a JS error would be thrown when trying to paste table rows then the rows clipboard was empty.
6
- Fixed bug with auto detection logic for youtube urls in the media plugin.
7
- Fixed bug where the formatter would throw errors if you used the jQuery version of TinyMCE and the latest jQuery.
8
- Fixed bug where the latest WebKit versions would produce span elements when deleting text between blocks.
9
- Fixed bug where the autolink plugin would produce DOM exceptions when pressing shift+enter inside a block element.
10
- Fixed bug where toggling of blockquotes when using br enter mode would produce an exception.
11
- Fixed bug where focusing out of the body of the editor wouldn't properly add an undo level.
12
- Fixed issue with warning message being displayed on IE 9+ about the meta header fix for IE 8.
13
- Version 3.5.7 (2012-09-20)
14
- Changed table row properties dialog to not update multiple rows when row type is header or footer.
15
- Fixed bug in hyperlink dialog for IE9 where links with no target attr set had target value of --
16
- Changing toolbars to have a toolbar role for FF keyboard navigation works correctly.
17
- Fixed bug where applying formatting to an empty block element would produce redundant spans.
18
- Fixed bug where caret formatting on IE wouldn't properly apply if you pressed enter/return.
19
- Fixed bug where loading TinyMCE using an async script wouldn't properly initialize editors.
20
- Fixed bug where some white space would be removed after inline elements before block elements.
21
- Fixed bug where it wouldn't properly parse attributes with a single backslash as it's contents.
22
- Fixed bug where noscript elements would loose it's contents on older IE versions.
23
- Fixed bug where backspace inside empty blockquote wouldn't delete it properly.
24
- Fixed bug where custom elements with . in their names wouldn't work properly.
25
- Fixed bug where the custom_elements option didn't properly setup the block elements schema structure.
26
- Fixed bug where the custom_elements option didn't auto populate the extended_valid_elements.
27
- Fixed bug where the whole TD element would get blcok formatted when there where BR elements in it.
28
- Fixed bug where IE 9 might crash if the editor was hidden and specific styles where applied to surrounding contents.
29
- Fixed bug where shift+enter inside a table cell on Gecko would produce an zero width non breaking space between tr:s.
30
- Fixed bug where the advlink dialog wouldn't properly populate the anchors dropdown if the HTML5 schema was used.
31
- Fixed issue with missing autofocus attribute on input element when using the HTML5 schema.
32
- Fixed issue where enter inside a block contained within an LI element wouldn't produce a new LI.
33
- Version 3.5.6 (2012-07-26)
34
- Added "text" as a valid option to the editor.getContent format option. Makes it easier to get a text representation of the editor contents.
35
- Fixed bug where resizing an image to less that 0x0 pixels would display the ghost image at an incorrect position.
36
- Fixed bug where the remove format button would produce extra paragraphs on WebKit if all of the contents was selected.
37
- Fixed issue where edge resize handles on images of wouldn't scale it with the same aspect ratio.
38
- Fixed so force_p_newlines option works again since some users want mixed mode paragraphs.
39
- Fixed so directionality plugin modifies the dir attribute of all selected blocks in the editor.
40
- Fixed bug where backspace/delete of a custom element would move it's attributes to the parent block on Gecko.
41
- Version 3.5.5 (2012-07-19)
42
- Added full resize support for images and tables on WebKit/Opera. It now behaves just like Gecko.
43
- Added automatic embed support for Vimeo, Stream.cz and Google Maps in media plugin. Patch contributed by Jakub Matas.
44
- Fixed bug where the lists plugin wouldn't properly remove all li elements when toggling selected items of. Patched by Taku AMANO.
45
- Fixed bug where the lists plugin would remove the entire list if you pressed deleted at the beginning of the first element. Patched by Taku AMANO.
46
- Fixed bug where the ordered/unordered list buttons could both be enabled if you nested lists. Patch contributed by Craig Petchell.
47
- Fixed bug where shift+enter wouldn't produce a BR in a LI when having forced_root_blocks set to false.
48
- Fixed bug where scrollbars aren't visible in fullscreen when window is resized.
49
- Fixed bug with updating the border size using the advimage dialog on IE 9.
50
- Fixed bug where the selection of inner elements on IE 8 in contentEditable mode would select the whole parent element.
51
- Fixed bug where the enter key would produce an empty anchor if you pressed it at the space after a link on IE.
52
- Fixed bug where autolink plugin would produce an exception for specific html see bug #5365
53
- Fixed so the formatChanged function takes an optional "similar" parameter to use while matching the format.
54
- Version 3.5.4.1 (2012-06-24)
55
- Fixed issue with Shift+A selecting all contents on Chrome.
56
- Version 3.5.4 (2012-06-21)
57
- Added missing mouse events to HTML5 schema. Some events needs to be manually defined though since the spec is huge.
58
- Added image resizing for WebKit browsers by faking the whole resize behavior.
59
- Fixed bug in context menu plugin where listener to hide menu wasn't removed correctly.
60
- Fixed bug where media plugin wouldn't use placeholder size for the object/video elements.
61
- Fixed bug where jQuery plugin would break attr function in jQuery 1.7.2.
62
- Fixed bug where jQuery plugin would throw an error if you used the tinymce pseudo selector when TinyMCE wasn't loaded.
63
- Fixed so encoding option gets applied when using jQuery val() or attr() to extract the contents.
64
- Fixed so any non valid width/height passed to media plugin would get parsed to proper integer or percent values.
65
- Version 3.5.3 (2012-06-19)
66
- Added missing wbr element to HTML5 schema.
67
- Added new mceToggleFormat command. Enabled you to toggle a specific format on/off.
68
- Fixed bug where undo/redo state didn't update correctly after executing an execCommand call.
69
- Fixed bug where the editor would get auto focused on IE running in quirks mode.
70
- Fixed bug where pressing enter before an IMG or INPUT element wouldn't properly split the block.
71
- Fixed bug where backspace would navigate back when selecting control types on IE.
72
- Fixed bug where the editor remove method would unbind events for controls outside the editor instance UI.
73
- Fixed bug where the autosave plugin would try to store a draft copy of editors that where removed.
74
- Fixed bug where floated elements wouldn't expand the block created when pressing enter on non IE browsers.
75
- Fixed bug where the caret would be placed in the wrong location when pressing enter at the beginning of a block.
76
- Fixed bug where it wasn't possible to block events using the handle_event_callback option.
77
- Fixed bug where keyboard navigation of the ColorSplitButton.js didn't work correctly.
78
- Fixed bug where keyboard navigation didn't work correctly on split buttons.
79
- Fixed bug where the legacy Event.add function didn't properly handle multiple id:s passed in.
80
- Fixed bug where the caret would disappear on IE when selecting all contents and pressing backspace/delete.
81
- Fixed bug where the getStart/getEnd methods would sometimes return elements from the wrong document on IE.
82
- Fixed so paragraphs gets created if you press enter inside a form element.
83
- Version 3.5.2 (2012-05-31)
84
- Added new formatChanged method to tinymce.Formatter class. Enables easier state change handling of formats.
85
- Added new selectorChanged method to tinymce.dom.Selection class. Enables easier state change handling of matching CSS selectors.
86
- Changed the default theme to be advanced instead of simple since most users uses the advanced theme.
87
- Changed so the theme_advanced_buttons doesn't have a default set if one button row is specified.
88
- Changed the theme_advanced_toolbar_align default value to "left".
89
- Changed the theme_advanced_toolbar_location default value to "top".
90
- Changed the theme_advanced_statusbar_location default value to "bottom".
91
- Fixed bug where the simple link dialog would remove class and target attributes from links when updating them if the drop downs wasn't visible.
92
- Fixed bug where the link/unlink buttons wouldn't get disabled once a link was created by the autolink plugin logic.
93
- Fixed bug where the border attribute was missing in the HTML5 schema.
94
- Fixed bug where the legacyoutput plugin would use inline styles for font color.
95
- Fixed bug where editing of anchor names wouldn't produce an undo level.
96
- Fixed bug where the table plugin would delete the last empty block element in the editor.
97
- Fixed bug where pasting table rows when they where selected would make it impossible to editor that table row.
98
- Fixed bug with pressing enter in IE while having a select list focused would produce a JS error.
99
- Fixed bug where it wasn't possible to merge table cells by selecting them and using merge from context menu.
100
- Removed summary from HTML5 table attributes and fixed so this and other deprecated table fields gets hidden in the table dialog.
101
- Version 3.5.1.1 (2012-05-25)
102
- Fixed bug with control creation where plugin specific controls didn't work as expected.
103
- Version 3.5.1 (2012-05-25)
104
- Added new onBeforeAdd event to UndoManager patch contributed by Dan Rumney.
105
- Added support for overriding the theme rendering logic by using a custom function.
106
- Fixed bug where links wasn't automatically created by the autolink plugin on old IE versions when pressing enter in BR mode.
107
- Fixed bug where enter on older IE versions wouldn't produce a new paragraph if the previous sibling paragraph was empty.
108
- Fixed bug where toString on a faked DOM range on older IE versions wouldn't return a proper string.
109
- Fixed bug where named anchors wouldn't work properly when schema was set to HTML5.
110
- Fixed bug where HTML5 datalist options wasn't correctly parsed or indented.
111
- Fixed bug where linking would add anchors around block elements when the HTML5 schema was used.
112
- Fixed issue where the autolink plugin wouldn't properly handle mailto:user@domain.com.
113
- Optimized initialization and reduced rendering flicker by hiding the target element while initializing.
114
- Version 3.5.0.1 (2012-05-10)
115
- Fixed bug where selection normalization logic would break the selections of parent elements using the element path.
116
- Fixed bug where the autolink plugin would include trailing dots in domain names in the link creation.
117
- Fixed bug where the autolink plugin would produce an error on older IE versions when pressing enter.
118
- Fixed bug where old IE versions would throw an error during initialization when the editor was placed in an size restricted div.
119
- Version 3.5 (2012-05-03)
120
- Fixed menu rendering issue if the document was in rtl mode.
121
- Fixed bug where the hide function would throw an error about a missing variable.
122
- Fixed bug where autolink wouldn't convert URLs when hitting enter on IE due to the new enter key logic.
123
- Fixed bug where formatting using shortcuts like ctrl+b wouldn't work properly the first time.
124
- Fixed bug where selection.setContent after a formatter call wouldn't generate formatted contents.
125
- Fixed bug where whitespace would be removed before/after invalid_elements when they where removed.
126
- Fixed bug where updating styles using the theme image dialog in non inline mode on IE9 would produce errors.
127
- Fixed bug where IE 8 would produce an error when using the contextmenu plugin.
128
- Fixed bug where delete/backspace could remove contents of noneditable elements.
129
- Fixed so background color in style preview gets computed from body element if the current style element is transparent.
130
- Version 3.5b3 (2012-03-29)
131
- Added cancel button to colour picker dialog.
132
- Added figure and figcaption to the html5 visualblocks plugin.
133
- Added default alignment options for the figure element.
134
- Fixed bug where empty inline elements within block elements would sometimes produce a br child element.
135
- Fixed bug where urls pointing to the same domain as the current one would cause undefined errors. Patch contributed by Paul Giberson.
136
- Fixed bug where enter inside an editable element inside an non editable element would split the element.
137
- Fixed bug where cut/copy/paste of noneditable elements didn't work.
138
- Fixed bug where backspace would sometimes produce font elements on WebKit.
139
- Fixed bug where WebKit would produce spans out of various inline elements when using backspace.
140
- Fixed bug where IE9 wouldn't properly update image styles when images where resized.
141
- Fixed bug where drag/drop of noneditable elements didn't work correctly.
142
- Fixed bug where applying formatting to all contents wouldn't work correctly when an end point was inside an empty bock. Patch contributed by Jose Luiz.
143
- Fixed bug where IE10 removed the scopeName from the DOM element interface and there for it produced an undefined string in element path.
144
- Fixed bug where the caret would be placed at an incorrect location if you applied block formatting while having the caret at the end of the block.
145
- Fixed bug where applying column changes using the cell dialog would only update the first column. Patch contributed by krzyko.
146
- Fixed bug where the visualblocks plugin would force editor focus if it was turned on by default.
147
- Fixed bug where the tabfocus plugin would tab to iframes these are now ignored.
148
- Fixed bug where format drop down list wouldn't show the currently active format for a parent element.
149
- Fixed bug where paste of plain text in IE 9 would remove the new line characters from text.
150
- Fixed bug where the menu buttons/split button menus wouldn't be opened at the right location on older IE versions.
151
- Fixed bug where Gecko browsers wouldn't properly display the right format when having the selection as specific places.
152
- Fixed bug where shift+enter inside the body when having forced_root_blocks set to false would throw an error.
153
- Fixed bug where the jQuery plugin would break the attr method of jQuery 1.7.2. Patch contributed by Markus Kemmerling.
154
- Fixed so options like content_css accepts and array as well as a comma separated string as input.
155
- Restructured the internal logic to make it more separate from Editor.js.
156
- Updated the Sizzle engine to the latest version.
157
- Version 3.5b2 (2012-03-15)
158
- Rewrote the enter key logic to normalize browser behavior.
159
- Fixed so enter within PRE elements produces a BR and shift+enter breaks/end the PRE. Can be disabled using the br_in_pre option.
160
- Fixed bug where the selection wouldn't be correct after applying formatting and having the caret at the end of the new format node.
161
- Fixed bug where the noneditable plugin would process contents on raw input calls for example on undo/redo calls.
162
- Fixed bug where WebKit could produce an exception when a bookmark was requested when there wasn't a proper selection.
163
- Fixed bug where WebKit would fail to open the image dialog since it would be returning false for a class name instead of a string.
164
- Fixed so alignment and indentation works properly when forced_root_blocks is set to false. It will produce a DIV by default.
165
- Version 3.5b1 (2012-03-08)
166
- Added new event class that is faster and enables support for faking events.
167
- Added new self_closing_elements, short_ended_elements, boolean_attributes, non_empty_elements and block_elements options to control the HTML Schema.
168
- Added new schema option and support for the HTML5 schema.
169
- Added new visualblocks plugin that shows html5 blocks with visual borders.
170
- Added new types and selector options to make it easier to create editor instances with different configs.
171
- Added new preview of formatting options in various listboxes.
172
- Added new preview_styles option that enables control over what gets previewed.
173
- Fixed bug where content css would be loaded twice into iframe.
174
- Fixed bug where start elements with only whitespace in the attribute part wouldn't be correctly parsed.
175
- Fixed bug where the advlink dialog would produce an error about the addSelectAccessibility function not being defined.
176
- Fixed bug where the caret would be placed at an incorrect position if span was removed by the invalid_elements setting.
177
- Fixed bug where elements inside a white space preserve element like pre didn't inherit the behavior while parsing.
178
- Version 3.4.9 (2012-02-23)
179
- Added settings to wordcount plugin to configure update rate and checking wordcount on backspace and delete using wordcount_update_rate and wordcount_update_on_delete.
180
- Fixed bug in Webkit and IE where deleting empty paragraphs would remove entire editor contents.
181
- Fixed bug where pressing enter on end of list item with a heading would create a new item with heading.
182
- Fixed edit css style dialog text-decoration none checkbox so it disables other text-decoration options when enabled.
183
- Fixed bug in Gecko where undo wasn't added when focus was lost.
184
- Fixed bug in Gecko where shift-enter in table cell ending with BR doesn't move caret to new line.
185
- Fixed bug where right-click on formatted text in IE selected the entire line.
186
- Fixed bug where text ending with space could not be unformatted in IE.
187
- Fixed bug where caret formatting would be removed when moving the caret when a selector expression was used.
188
- Fixed bug where formatting would be applied to the body element when all contents where selected and format had both inline and selector parts.
189
- Fixed bug where the media plugin would throw errors if you had iframe set as an invalid element in config.
190
- Fixed bug where the caret would be placed at the top of the document if you inserted a table and undo:ed that operation. Patch contributed by Wesley Walser.
191
- Fixed bug where content css files where loaded twice into the iframe.
192
- Fixed so elements with comments would be trated as non empty elements. Patch contributed by Arjan Scherpenisse.
193
- Version 3.4.8 (2012-02-02)
194
- Fixed bug in IE where selected text ending with space cannot be formatted then formatted again to get original text.
195
- Fixed bug in IE where images larger than editor area were being deselected when toolbar buttons are clicked.
196
- Fixed bug where wrong text align buttons are active when multiple block elements are selected.
197
- Fixed bug where selected link not showing in target field of link dialog in some selection cases.
198
- Use settings for remove_trailing_br so this can be turned off instead of hard coding the value.
199
- Fixed bug in IE where the media plugin displayed null text when some values aren't filled in.
200
- Added API method 'onSetAttrib' that fires when the attribute value on a node changes.
201
- Fix font size dropdown value not being updated when text already has a font size in the advanced template.
202
- Fixed bug in IE where IE doesn't use ARIA attributes properly on options - causing labels to be read out 2 times.
203
- Fixed bug where caret cannot be placed after table if table is at end of document in IE.
204
- Fixed bug where adding range isn't always successful so we need to check range count otherwise an exception can occur.
205
- Added spacebar onclick handler to toolbar buttons to ensure that the accessibility behaviour works correctly.
206
- Fixed bug where a stranded bullet point would get created in WebKit.
207
- Fixed bug where selecting text in a blockquote and pressing backspace toggles the style.
208
- Fixed bug where pressing enter from a heading in IE, the resulting P tag below it shares the style property.
209
- Fix white space in between spans from being deleted.
210
- Fixed bug where scrollbars where visible in the character map dialog on Gecko.
211
- Fixed issue with missing translation for one of the emoticons.
212
- Fixed bug where dots in id:s where causing problems. Patch provided by Abhishek Dev.
213
- Fixed bug where urls with an at sign in the path wouldn't be parsed correctly. Patch contributed by Jason Grout.
214
- Fixed bug where Opera would remove the first character of a inline formatted word if you pressed backspace.
215
- Fixed bugs with the autoresize plugin on various browsers and removed the need for the throbber.
216
- Fixed performance issue where the contextmenu plugin would try to remove the menu even if it was removed. Patch contributed by mhu.
217
- Version 3.4.7 (2011-11-03)
218
- Modified the caret formatting behavior to word similar to common desktop wordprocessors like Word or Libre Office.
219
- Fixed bug in Webkit - Cursor positioning does not work vertically within a table cell with multiple lines of text.
220
- Fixed bug in IE where Inserting a table in IE8 places cursor in the second cell of the first row.
221
- Fixed bug in IE where editor in a frame doesn't give focus to the toolbar using ALT-F10.
222
- Fix for webkit and gecko so that deleting bullet from start of list outdents inner list items and moves first item into paragraph.
223
- Fix new list items in IE8 not displayed on a new line when list contains nested list items.
224
- Clear formatting in table cell breaks the cell.
225
- Made media type list localisable.
226
- Fix out of memory error when using prototype in media dialog.
227
- Fixed bug where could not add a space in the middle of a th cell.
228
- Fixed bug where adding a bullet between two existing bullets adds an extra one
229
- Fixed bug where trying to insert a new entry midway through a bulleted list fails dismally when the next entry is tabbed in.
230
- Fixed bug where pressing enter on an empty list item does not outdent properly in FF
231
- Fixed bug where adding a heading after a list item in a table cell changes all styles in that cell
232
- Fixed bug where hitting enter to exit from a bullet list moves cursor to the top of the page in Firefox.
233
- Fixed bug where pressing backspace would not delete HRs in Firefox and IE when next to an empty paragraph.
234
- Fixed bug where deleting part of the link text can cause a link with no destination to be saved.
235
- Fixed bug where css style border widths wasn't handled correctly in table dialog.
236
- Fixed bug where parsing invalid html contents on IE or WebKit could produce an infinite loop.
237
- Fixed bug where scripts with custom script types wasn't properly passed though the editor.
238
- Fixed issue where some Japanese kanji characters wasn't properly entity encoded when numeric entity mode was enabled.
239
- Made emoticons dialog use the keyboard naviation.
240
- Added navigation instructions to the symbols dialog.
241
- Added ability to set default values for the media plugin.
242
- Added new font_size_legacy_values option for converting old font element sizes to span with font-size properties.
243
- Fixed bug where the symbols dialog was not accessible.
244
- Added quirk for IE ensuring that the body of the document containing tinyMCE has a role="application" for accessibility.
245
- Fixed bug where the advanced color picker wasn't working properly on FF 7.
246
- Fixed issue where the advanced color picker was producing uppercase hex codes.
247
- Fixed bug where IE 8 could throw exceptions if the contents contained resizable content elements.
248
- Fixed bug where caret formatting wouldn't be correctly applied to previous sibling on WebKit.
249
- Fixed bug where the select boxes for font size/family would loose it's value on WebKit due to recent iOS fixes.
250
- Version 3.4.6 (2011-09-29)
251
- Fixed bug where list items were being created for empty divs.
252
- Added support in Media plugin for audio media using the embed tag
253
- Fixed accessibility bugs in WebKit and IE8 where toolbar items were not being read.
254
- Added new use_accessible_selects option to ensure accessible list boxes are used in all browsers (custom widget in firefox native on other browsers)
255
- Fixed bug where classid attribute was not being checked from embed objects.
256
- Fixed bug in jsrobot tests with intermittently failing.
257
- Fixed bug where anchors wasn't updated properly if you edited them using IE 8.
258
- Fixed bug where input method on WebKit on Mac OS X would fail to initialize when sometimes focusing the editor.
259
- Fixed bug where it wasn't possible to select HR elements on WebKit by simply clicking on them.
260
- Fixed bug where the media plugin wouldn't work on IE9 when not using the inlinepopups plugin.
261
- Fixed bug where hspace,vspace,align and bgcolor would be removed from object elements in the media plugin.
262
- Fixed bug where the new youtube format wouldn't be properly parsed by the media plugin.
263
- Fixed bug where the style attribute of layers wasn't properly updated on IE and Gecko.
264
- Fixed bug where editing contents in a layer would fail on Gecko since contentEditable doesn't inherit properly.
265
- Fixed bug where IE 6/7 would produce JS errors when serializing contents containing layers.
266
- Version 3.4.5 (2011-09-06)
267
- Fixed accessibility bug in WebKit where the right and left arrow keys would update native list boxes.
268
- Added new whitespace_elements option to enable users to specify specific elements where the whitespace is preserved.
269
- Added new merge_siblings option to formats. This option makes it possible to disable the auto merging of siblings when applying formats.
270
- Fixed bug in IE where trailing comma in paste plugin would cause plugin to not run correctly.
271
- Fixed bug in WebKit where console messages would be logged when deleting an empty document.
272
- Fixed bug in IE8 where caret positioned is on list item instead of paragraph when outdent splits the list
273
- Fixed bug with image dialogs not inserting an image if id was omitted from valid_elements.
274
- Fixed bug where the selection normalization logic wouldn't properly handle image elements in specific config cases.
275
- Fixed bug where the map elements coords attribute would be messed up by IE when serializing the DOM.
276
- Fixed bug where IE wouldn't properly handle custom elements when the contents was serialized.
277
- Fixed bug where you couldn't move the caret in Gecko if you focused the editor using the API or a UI control.
278
- Fixed bug where adjacent links would get merged on IE due to bugs in their link command.
279
- Fixed bug where the color split buttons would loose the selection on IE if the editor was placed in a frame/iframe.
280
- Fixed bug where floated images in WebKit wouldn't get properly linked.
281
- Fixed bug where the fullscreen mode in a separate window wasn't forced into IE9+ standards mode.
282
- Fixed bug where pressing enter in an empty editor on WebKit could produce DIV elements instead of P.
283
- Fixed bug where spans would get removed incorrectly when merging two blocks on backspace/delete on WebKit.
284
- Fixed bug where the editor contents wouldn't be completely removed on backspace/delete on WebKit.
285
- Fixed bug where the fullpage plugin wouldn't properly render style elements in the head on IE 6/7.
286
- Fixed bug where the nonbreaking_force_tab option in the nonbreaking plugin wouldn't work on Gecko/WebKit.
287
- Fixed bug where the isDirty state would become true on non IE browsers if there was an table at the end of the contents.
288
- Fixed bug where entities wasn't properly encoded on WebKit when pasting text as plain text.
289
- Fixed bug where empty editors would produce an exception of valid_elements didn't include body and forced_root_blocks where disabled.
290
- Fixed bug where the fullscreen mode wouldn't retain the header/footer in the fullpage plugin.
291
- Fixed issue where the plaintext_mode and plaintext_mode_sticky language keys where swapped.
292
- Version 3.4.4 (2011-08-04)
293
- Added new html5 audio support. Patch contributed by Ronald M. Clifford.
294
- Added mute option for video elements and preload options for video/audio patch contributed by Dmitry Kalinkin.
295
- Fixed selection to match visual selection before applying formatting changes.
296
- Fixed browser specific bugs in lists for WebKit and IE.
297
- Fixed bug where IE would scroll the window if you closed an inline dialog that was larger than the viewport. Patch by Laurence Keijmel.
298
- Fixed bug where pasting contents near a span element could remove parts of that span. Patch contributed by Wesley Walser.
299
- Fixed bug where formatting change would be lost after pressing enter.
300
- Fixed bug in WebKit where deleting across blocks would add extra styles.
301
- Fixed bug where moving cursor vertically in tables in WebKit wasn't working.
302
- Fixed bug in IE where deleting would cause error in console.
303
- Fixed bug where the formatter was not applying formats across list elements.
304
- Fixed bug where the wordcount plugin would try and update the wordcount if tinymce had been destroyed.
305
- Fixed bug where tabfocus plugin would attempt to focus elements not displayed when their parent element was hidden.
306
- Fixed bug where the contentEditable state would sometimes be removed if you deleted contents in Gecko.
307
- Fixed bug where inserting contents using mceInsertContent would fail if "span" was disabled in valid_elements.
308
- Fixed bug where initialization might fail if some resource on gecko wouldn't load properly and fire the onload event.
309
- Fixed bug where ctrl+7/8/9 keys wouldn't properly add the specific formats associated with them.
310
- Fixed bug where the HTML tags wasn't properly closed in the style plugins properties dialog.
311
- Fixed bug where the list plugin would produce an exception if the user tried to delete an element at the very first location.
312
- Version 3.4.3.2 (2011-06-30)
313
- Fixed bug where deleting all of a paragraph inside a table cell would behave badly in webkit.
314
- Fixed bugs in tests in firefox5 and WebKit.
315
- Fixed bug where selection of table cells would produce an exception on Gecko.
316
- Fixed bug where the caret wasn't properly rendered on Gecko when the editor was hidden.
317
- Fixed bug where pasting plain text into WebKit would produce a pre element it will now produce more semantic markup.
318
- Fixed bug where selecting list type formats using the advlist plugin on IE8 would loose editor selection.
319
- Fixed bug where forced root blocks logic wouldn't properly pad elements created if they contained data attributes.
320
- Fixed bug where it would remove all contents of the editor if you inserted an image when not having a caret in the document.
321
- Fixed bug where the YUI compressor wouldn't properly encode strings with only a quote in them.
322
- Fixed bug where WebKit on iOS5 wouldn't call nodeChanged when the selection was changed.
323
- Fixed bug where mceFocus command wouldn't work properly on Gecko since it didn't focus the body element.
324
- Fixed performance issue with the noneditable plugin where it would enable/disable controls to often.
325
- Version 3.4.3.1 (2011-06-16)
326
- Fixed bug where listboxes were not being handled correctly by JAWS in firefox with the o2k7 skin.
327
- Fixed bug where custom buttons were not being rendered correctly when in high contrast mode.
328
- Added support for iOS 5 that now supporting contentEditable in it's latest beta.
329
- Fixed bug where urls in style attributes with a _ character followed by a number would cause incorrect output.
330
- Fixed bug where custom_elements option wasn't working properly on IE browsers.
331
- Fixed bug where custom_elements marked as block elements wouldn't get correctly treated as block elements.
332
- Fixed bug where attributes with </> wasn't properly encoded as XML entities.
333
- Version 3.4.3 (2011-06-09)
334
- Fixed bug where deleting backwards before an image into a list would put the cursor in the wrong location.
335
- Fixed bug where styles plugin would not apply styles across multiple selected block elements correctly.
336
- Fixed bug where cursor would jump to start of document when selection contained empty table cells in IE8.
337
- Fixed bug where applied styles wouldn't be kept if you pressed enter twice to produce two paragraphs.
338
- Fixed bug where a ghost like caret would appear on Gecko when pressing enter while having a text color applied.
339
- Fixed bug where IE would produce absolute urls if you inserted a image/link and reloaded the page.
340
- Fixed bug where applying a heading style to a list item would cascade style to children list items.
341
- Fixed bug where Editor loses focus when backspacing and changing styles in WebKit.
342
- Fixed bug where exception was thrown in tinymce.util.URI when parsing a relative URI and no base_uri setting was provided.
343
- Fixed bug where alt-f10 was not always giving focus to the toolbar on Safari.
344
- Added new 'allow_html_in_named_anchor' option to allow html to occur within a named anchor tag. Use at own risk.
345
- Added plugin dependency support. Will autoload plugins specified as a dependency if they haven't been loaded.
346
- Fixed bug where the autolink plugin didn't work with non-English keyboards when pressing ).
347
- Added possibility to change properties of all table cells in a column.
348
- Added external_image_list option to get images list from user-defined variable or function.
349
- Fixed bug where the autoresize plugin wouldn't reduce the editors height on Chrome.
350
- Fixed bug where table size inputs were to small for values with size units.
351
- Fixed bug where table cell/row size input values were not validated.
352
- Fixed bug where menu item line-height would be set to wrong value by external styles.
353
- Fixed bug where hasUndo() would return wrong answer.
354
- Fixed bug where page title would be set to undefined by fullpage plugin.
355
- Fixed bug where HTML5 video properties were not updated in embedded media settings.
356
- Fixed bug where HTML comment on the first line would cause an error.
357
- Fixed bug where spellchecker menu was positioned incorrectly on IE.
358
- Fixed bug where breaking out of list elements on WebKit would produce a DIV instead of P after the list.
359
- Fixed bug where pasting from Word in IE9 would add extra BR elements when text was word wrapped.
360
- Fixed bug where numeric entities with leading zeros would produce incorrect decoding.
361
- Fixed bug where hexadecimal entities wasn't properly decoded.
362
- Fixed bug where bookmarks wasn't properly stored/restored on undo/redo.
363
- Fixed bug where the mceInsertCommand didn't retain the values of links if they contained non url contents.
364
- Fixed bug where the valid_styles option wouldn't be properly used on styles for specific elements.
365
- Fixed so contentEditable is used for the body of the editor if it's supported.
366
- Fixed so trailing BR elements gets removed even when forced_root_blocks option was set to false/null.
367
- Fixed performance issue with mceInsertCommand and inserting very simple contents.
368
- Fixed performance issue with older IE version and huge documents by optimizing the forced root blocks logic.
369
- Fixed performance issue with table plugin where it checked for selected cells to often.
370
- Fixed bug where creating a link on centered/floated image would produce an error on WebKit browsers.
371
- Fixed bug where Gecko would remove single paragraphs if there where contents before/after it.
372
- Fixed bug where the scrollbar would move up/down when pasting contents using the paste plugin.
373
- Version 3.4.2 (2011-04-07)
374
- Added new 'paste_text_sticky_default' option to paste plugin, enables you to set the default state for paste as plain text.
375
- Added new autoresize_bottom_margin option to autoresize plugin that enables you to add an extra margin at the bottom. Patch contributed by Andrew Ozz.
376
- Rewritten the fullpage plugin to handle style contents better and have a more normalized behavior across browsers.
377
- Fixed bug where contents inserted with mceInsertContent wasn't parsed using the default dom parser.
378
- Fixed bug where blocks containing a single anchor element would be treated as empty.
379
- Fixed bug where merging of table cells on IE 6, 7 wouldn't look correctly until the contents was refreshed.
380
- Fixed bug where context menu wouldn't work properly on Safari since it was passing out the ctrl key as pressed.
381
- Fixed bug where image border color/style values were overwritten by advimage plugin.
382
- Fixed bug where setting border in advimage plugin would throw error in IE.
383
- Fixed bug where empty anchors list in link settings wasn't hidden.
384
- Fixed bug where xhtmlextras popups were missing localized popup-size parameters.
385
- Fixed bug where the context menu wouldn't select images on WebKit browsers.
386
- Fixed bug where paste plugin wouldn't properly extract the contents on WebKit due to recent changes in browser behavior.
387
- Fixed bug where focus of the editor would get on control contents on IE lost due to a bug in the ColorSplitButton control.
388
- Fixed bug where contextmenu wasn't disabled on noneditable elements.
389
- Fixed bug where getStyle function would trigger error when called on element without style property.
390
- Fixed bug where editor fail to load if Javascript Compressor was used.
391
- Fixed bug where list-style-type=lower-greek would produce errors in IE<8.
392
- Fixed bug where spellchecker plugin would produce errors on IE6-7.
393
- Fixed bug where theme_advanced_containers configuration option causes error.
394
- Fixed bug where the mceReplaceContent command would produce an error since it didn't correctly handle a return value.
395
- Fixed bug where you couldn't enter float point values for em in dialog input fields since it wouldn't be considered a valid size.
396
- Fixed bug in xhtmlxtras plugin where it wasn't possible to remove some attributes in the attributes dialog.
397
- Version 3.4.1 (2011-03-24)
398
- Added significantly improved list handling via the new 'lists' plugin.
399
- Added 'autolink' plugin to enable automatically linking URLs. Similar to the behavior IE has by default.
400
- Added 'theme_advanced_show_current_color' setting to enable the forecolor and backcolor buttons to continuously show the current text color.
401
- Added 'contextmenu_never_use_native' setting to disable the ctrl-right-click showing the native browser context menu behaviour.
402
- Added 'paste_enable_default_filters' setting to enable the default paste filters to be disabled.
403
- Fixed bug where selection locations on undo/redo didn't work correctly on specific contents.
404
- Fixed bug where an exception would be trown on IE when loading TinyMCE inside an iframe.
405
- Fixed bug where some ascii numeric entities wasn't properly decoded.
406
- Fixed bug where some non western language codes wasn't properly decoded/encoded.
407
- Fixed bug where undo levels wasn't created when deleting contents on IE.
408
- Fixed bug where the initial undo levels bookmark wasn't updated correctly.
409
- Fixed bug where search/replace wouldn't be scoped to editor instances on IE8.
410
- Fixed bug where IE9 would produce two br elements after block elements when pasting.
411
- Fixed bug where IE would place the caret at an incorrect position after a paste operation.
412
- Fixed bug where a paste operation using the keyboard would add an extra undo level.
413
- Fixed bug where some attributes/elements wasn't correctly filtered when invalid contents was inserted.
414
- Fixed bug where the table plugin couldn't correctly handle invalid table structures.
415
- Fixed bug where charset and title of the page were handled incorrectly by the fullpage plugin.
416
- Fixed bug where toggle states on some of the list boxes didn't update correctly.
417
- Fixed bug where sub/sub wouldn't work correctly when done as a caret action in Chrome 10.
418
- Fixed bug where the constrain proportions checkbox wouldn't work in the media plugin.
419
- Fixed bug where block elements containing trailing br elements wouldn't treated properly if they where invalid.
420
- Fixed bug where the color picker dialog wouldn't be rendered correctly when using the o2k7 theme.
421
- Fixed bug where setting border=0 using advimage plugin invalid style attribute content was created in Chrome.
422
- Fixed bug with references to non-existing images in css of fullpage plugin.
423
- Fixed bug where item could be unselected in spellchecker's language selector.
424
- Fixed bug where some mispelled words could be not highlighted using spellchecker plugin.
425
- Fixed bug where spellchecking would merge some words on IE.
426
- Fixed bug where spellchecker context menu was not always positioned correctly.
427
- Fixed bug with empty anchors list in advlink popup when Invisible Elements feature was disabled.
428
- Fixed bug where older IE versions wouldn't properly handle some elements if they where placed at the top of editor contents.
429
- Fixed bug where selecting the whole table would enable table tools for cells and rows.
430
- Fixed bug where it wasn't possible to replace selected contents on IE when pasting using the paste plugin.
431
- Fixed bug where setting text color in fullpage plugin doesn't work.
432
- Fixed bug where the state of checkboxes in media plugin wouldn't be set correctly.
433
- Fixed bug where black spade suit character was not included in special character selector.
434
- Fixed bug where setting invalid values for table cell size would throw an error in IE.
435
- Fixed bug where spellchecking would remove whitespace characters from PRE block in IE.
436
- Fixed bug where HR was inserted inside P elements instead of splitting them.
437
- Fixed bug where extra, empty span tags were added when using a format with both selector and inline modes.
438
- Fixed bug where bullet lists weren't always detected correctly.
439
- Fixed bug where deleting some paragraphs on IE would cause an exception.
440
- Fixed bug where the json encoder logic wouldn't properly encode \ characters.
441
- Fixed bug where the onChange event would be fired when the editor was first initialized.
442
- Fixed bug where mceSelected wouldn't be removed properly from output even if it's an internal class.
443
- Fixed issue with table background colors not being transparent. This improves compliance with users browser color preferences.
444
- Fixed issue where styles were not included when using the full page plugin.
445
- Fixed issue where drag/drop operations wasn't properly added to the undo levels.
446
- Fixed issue where colors wasn't correctly applied to elements with underline decoration.
447
- Fixed issue where deleting some paragraphs on IE would cause an exception.
448
- Version 3.4 (2011-03-10)
449
- Added accessibility example with various accessibility options contributed by Ephox.
450
- Fixed bug where attributes wasn't properly handled in the xhtmlxtras plugin.
451
- Fixed bug where the image.htm had some strange td artifacts probably due to auto merging.
452
- Fixed bug where the ToolbarGroup had an missing reference to this in it's destroy method.
453
- Fixed bug with the resizeBy function in the advanced theme where it was scaled by the wrong parent.
454
- Fixed bug where an exception would be thrown by the element if the page was served in xhtml mode.
455
- Fixed bug where mceInsertContent would throw an exception when page was served in xhtml mode.
456
- Fixed bug where you couldn't select a forground/background color when page was served in xhtml mode.
457
- Fixed bug where the editor would scroll to the toolbar when clicked due to a call to focus in ListBox.
458
- Fixed bug where pages with rtl dir wouldn't render split buttons correctly when using the o2k7 theme.
459
- Fixed bug where anchor elements with names wasn't properly collapsed as they where in 3.3.x.
460
- Fixed bug where WebKit wouldn't properly handle image selection if it was done left to right.
461
- Fixed bug where the formatter would align images when the selection range was collapsed.
462
- Fixed bug where the image button would be active when the selection range was collapsed.
463
- Fixed bug where the element_format option wasn't used by the new (X)HTML serializer logic.
464
- Fixed bug where the table cell/row dialogs would produce empty attributes.
465
- Fixed bug where the tfoot wouldn't be added to the top of the table.
466
- Fixed bug where the formatter would merge siblings with white space between them.
467
- Fixed bug where pasting headers and paragraphs would produce an extra paragraph.
468
- Fixed bug where the ColorSplitButton would throw an exception if you clicked out side a color.
469
- Fixed bug where IE9 wouldn't properly produce new paragraphs on enter if the current paragraph had formatting.
470
- Fixed bug where multiple BR elements at end of block elements where removed.
471
- Fixed bug where fullscreen plugin wouldn't correctly display the edit area on IE6 for long pages.
472
- Fixed bug where paste plugin wouldn't properly encode raw entities when pasting in plain text mode.
473
- Fixed bug where the search/replace plugin wouldn't work correctly on IE 9.
474
- Fixed so the drop menus doesn't get an outline border visible when focused, patch contributed by Ephox.
475
- Fixed so the values entered in the color picker are forced to hex values.
476
- Removed dialog workaround for IE 9 beta since the RC is now out and people should upgrade.
477
- Removed obsolete calls in various plugins to the mceBeginUndoLevel command.
1
+ Version 3.5.8 (2012-11-20)
2
+ Fixed bug where html5 data attributes where stripped from contents.
3
+ Fixed bug where toolbar was annouced multiple times with JAWS on Firefox.
4
+ Fixed bug where the editor view whouldn't scroll to BR elements when using shift+enter or br enter mode.
5
+ Fixed bug where a JS error would be thrown when trying to paste table rows then the rows clipboard was empty.
6
+ Fixed bug with auto detection logic for youtube urls in the media plugin.
7
+ Fixed bug where the formatter would throw errors if you used the jQuery version of TinyMCE and the latest jQuery.
8
+ Fixed bug where the latest WebKit versions would produce span elements when deleting text between blocks.
9
+ Fixed bug where the autolink plugin would produce DOM exceptions when pressing shift+enter inside a block element.
10
+ Fixed bug where toggling of blockquotes when using br enter mode would produce an exception.
11
+ Fixed bug where focusing out of the body of the editor wouldn't properly add an undo level.
12
+ Fixed issue with warning message being displayed on IE 9+ about the meta header fix for IE 8.
13
+ Version 3.5.7 (2012-09-20)
14
+ Changed table row properties dialog to not update multiple rows when row type is header or footer.
15
+ Fixed bug in hyperlink dialog for IE9 where links with no target attr set had target value of --
16
+ Changing toolbars to have a toolbar role for FF keyboard navigation works correctly.
17
+ Fixed bug where applying formatting to an empty block element would produce redundant spans.
18
+ Fixed bug where caret formatting on IE wouldn't properly apply if you pressed enter/return.
19
+ Fixed bug where loading TinyMCE using an async script wouldn't properly initialize editors.
20
+ Fixed bug where some white space would be removed after inline elements before block elements.
21
+ Fixed bug where it wouldn't properly parse attributes with a single backslash as it's contents.
22
+ Fixed bug where noscript elements would loose it's contents on older IE versions.
23
+ Fixed bug where backspace inside empty blockquote wouldn't delete it properly.
24
+ Fixed bug where custom elements with . in their names wouldn't work properly.
25
+ Fixed bug where the custom_elements option didn't properly setup the block elements schema structure.
26
+ Fixed bug where the custom_elements option didn't auto populate the extended_valid_elements.
27
+ Fixed bug where the whole TD element would get blcok formatted when there where BR elements in it.
28
+ Fixed bug where IE 9 might crash if the editor was hidden and specific styles where applied to surrounding contents.
29
+ Fixed bug where shift+enter inside a table cell on Gecko would produce an zero width non breaking space between tr:s.
30
+ Fixed bug where the advlink dialog wouldn't properly populate the anchors dropdown if the HTML5 schema was used.
31
+ Fixed issue with missing autofocus attribute on input element when using the HTML5 schema.
32
+ Fixed issue where enter inside a block contained within an LI element wouldn't produce a new LI.
33
+ Version 3.5.6 (2012-07-26)
34
+ Added "text" as a valid option to the editor.getContent format option. Makes it easier to get a text representation of the editor contents.
35
+ Fixed bug where resizing an image to less that 0x0 pixels would display the ghost image at an incorrect position.
36
+ Fixed bug where the remove format button would produce extra paragraphs on WebKit if all of the contents was selected.
37
+ Fixed issue where edge resize handles on images of wouldn't scale it with the same aspect ratio.
38
+ Fixed so force_p_newlines option works again since some users want mixed mode paragraphs.
39
+ Fixed so directionality plugin modifies the dir attribute of all selected blocks in the editor.
40
+ Fixed bug where backspace/delete of a custom element would move it's attributes to the parent block on Gecko.
41
+ Version 3.5.5 (2012-07-19)
42
+ Added full resize support for images and tables on WebKit/Opera. It now behaves just like Gecko.
43
+ Added automatic embed support for Vimeo, Stream.cz and Google Maps in media plugin. Patch contributed by Jakub Matas.
44
+ Fixed bug where the lists plugin wouldn't properly remove all li elements when toggling selected items of. Patched by Taku AMANO.
45
+ Fixed bug where the lists plugin would remove the entire list if you pressed deleted at the beginning of the first element. Patched by Taku AMANO.
46
+ Fixed bug where the ordered/unordered list buttons could both be enabled if you nested lists. Patch contributed by Craig Petchell.
47
+ Fixed bug where shift+enter wouldn't produce a BR in a LI when having forced_root_blocks set to false.
48
+ Fixed bug where scrollbars aren't visible in fullscreen when window is resized.
49
+ Fixed bug with updating the border size using the advimage dialog on IE 9.
50
+ Fixed bug where the selection of inner elements on IE 8 in contentEditable mode would select the whole parent element.
51
+ Fixed bug where the enter key would produce an empty anchor if you pressed it at the space after a link on IE.
52
+ Fixed bug where autolink plugin would produce an exception for specific html see bug #5365
53
+ Fixed so the formatChanged function takes an optional "similar" parameter to use while matching the format.
54
+ Version 3.5.4.1 (2012-06-24)
55
+ Fixed issue with Shift+A selecting all contents on Chrome.
56
+ Version 3.5.4 (2012-06-21)
57
+ Added missing mouse events to HTML5 schema. Some events needs to be manually defined though since the spec is huge.
58
+ Added image resizing for WebKit browsers by faking the whole resize behavior.
59
+ Fixed bug in context menu plugin where listener to hide menu wasn't removed correctly.
60
+ Fixed bug where media plugin wouldn't use placeholder size for the object/video elements.
61
+ Fixed bug where jQuery plugin would break attr function in jQuery 1.7.2.
62
+ Fixed bug where jQuery plugin would throw an error if you used the tinymce pseudo selector when TinyMCE wasn't loaded.
63
+ Fixed so encoding option gets applied when using jQuery val() or attr() to extract the contents.
64
+ Fixed so any non valid width/height passed to media plugin would get parsed to proper integer or percent values.
65
+ Version 3.5.3 (2012-06-19)
66
+ Added missing wbr element to HTML5 schema.
67
+ Added new mceToggleFormat command. Enabled you to toggle a specific format on/off.
68
+ Fixed bug where undo/redo state didn't update correctly after executing an execCommand call.
69
+ Fixed bug where the editor would get auto focused on IE running in quirks mode.
70
+ Fixed bug where pressing enter before an IMG or INPUT element wouldn't properly split the block.
71
+ Fixed bug where backspace would navigate back when selecting control types on IE.
72
+ Fixed bug where the editor remove method would unbind events for controls outside the editor instance UI.
73
+ Fixed bug where the autosave plugin would try to store a draft copy of editors that where removed.
74
+ Fixed bug where floated elements wouldn't expand the block created when pressing enter on non IE browsers.
75
+ Fixed bug where the caret would be placed in the wrong location when pressing enter at the beginning of a block.
76
+ Fixed bug where it wasn't possible to block events using the handle_event_callback option.
77
+ Fixed bug where keyboard navigation of the ColorSplitButton.js didn't work correctly.
78
+ Fixed bug where keyboard navigation didn't work correctly on split buttons.
79
+ Fixed bug where the legacy Event.add function didn't properly handle multiple id:s passed in.
80
+ Fixed bug where the caret would disappear on IE when selecting all contents and pressing backspace/delete.
81
+ Fixed bug where the getStart/getEnd methods would sometimes return elements from the wrong document on IE.
82
+ Fixed so paragraphs gets created if you press enter inside a form element.
83
+ Version 3.5.2 (2012-05-31)
84
+ Added new formatChanged method to tinymce.Formatter class. Enables easier state change handling of formats.
85
+ Added new selectorChanged method to tinymce.dom.Selection class. Enables easier state change handling of matching CSS selectors.
86
+ Changed the default theme to be advanced instead of simple since most users uses the advanced theme.
87
+ Changed so the theme_advanced_buttons doesn't have a default set if one button row is specified.
88
+ Changed the theme_advanced_toolbar_align default value to "left".
89
+ Changed the theme_advanced_toolbar_location default value to "top".
90
+ Changed the theme_advanced_statusbar_location default value to "bottom".
91
+ Fixed bug where the simple link dialog would remove class and target attributes from links when updating them if the drop downs wasn't visible.
92
+ Fixed bug where the link/unlink buttons wouldn't get disabled once a link was created by the autolink plugin logic.
93
+ Fixed bug where the border attribute was missing in the HTML5 schema.
94
+ Fixed bug where the legacyoutput plugin would use inline styles for font color.
95
+ Fixed bug where editing of anchor names wouldn't produce an undo level.
96
+ Fixed bug where the table plugin would delete the last empty block element in the editor.
97
+ Fixed bug where pasting table rows when they where selected would make it impossible to editor that table row.
98
+ Fixed bug with pressing enter in IE while having a select list focused would produce a JS error.
99
+ Fixed bug where it wasn't possible to merge table cells by selecting them and using merge from context menu.
100
+ Removed summary from HTML5 table attributes and fixed so this and other deprecated table fields gets hidden in the table dialog.
101
+ Version 3.5.1.1 (2012-05-25)
102
+ Fixed bug with control creation where plugin specific controls didn't work as expected.
103
+ Version 3.5.1 (2012-05-25)
104
+ Added new onBeforeAdd event to UndoManager patch contributed by Dan Rumney.
105
+ Added support for overriding the theme rendering logic by using a custom function.
106
+ Fixed bug where links wasn't automatically created by the autolink plugin on old IE versions when pressing enter in BR mode.
107
+ Fixed bug where enter on older IE versions wouldn't produce a new paragraph if the previous sibling paragraph was empty.
108
+ Fixed bug where toString on a faked DOM range on older IE versions wouldn't return a proper string.
109
+ Fixed bug where named anchors wouldn't work properly when schema was set to HTML5.
110
+ Fixed bug where HTML5 datalist options wasn't correctly parsed or indented.
111
+ Fixed bug where linking would add anchors around block elements when the HTML5 schema was used.
112
+ Fixed issue where the autolink plugin wouldn't properly handle mailto:user@domain.com.
113
+ Optimized initialization and reduced rendering flicker by hiding the target element while initializing.
114
+ Version 3.5.0.1 (2012-05-10)
115
+ Fixed bug where selection normalization logic would break the selections of parent elements using the element path.
116
+ Fixed bug where the autolink plugin would include trailing dots in domain names in the link creation.
117
+ Fixed bug where the autolink plugin would produce an error on older IE versions when pressing enter.
118
+ Fixed bug where old IE versions would throw an error during initialization when the editor was placed in an size restricted div.
119
+ Version 3.5 (2012-05-03)
120
+ Fixed menu rendering issue if the document was in rtl mode.
121
+ Fixed bug where the hide function would throw an error about a missing variable.
122
+ Fixed bug where autolink wouldn't convert URLs when hitting enter on IE due to the new enter key logic.
123
+ Fixed bug where formatting using shortcuts like ctrl+b wouldn't work properly the first time.
124
+ Fixed bug where selection.setContent after a formatter call wouldn't generate formatted contents.
125
+ Fixed bug where whitespace would be removed before/after invalid_elements when they where removed.
126
+ Fixed bug where updating styles using the theme image dialog in non inline mode on IE9 would produce errors.
127
+ Fixed bug where IE 8 would produce an error when using the contextmenu plugin.
128
+ Fixed bug where delete/backspace could remove contents of noneditable elements.
129
+ Fixed so background color in style preview gets computed from body element if the current style element is transparent.
130
+ Version 3.5b3 (2012-03-29)
131
+ Added cancel button to colour picker dialog.
132
+ Added figure and figcaption to the html5 visualblocks plugin.
133
+ Added default alignment options for the figure element.
134
+ Fixed bug where empty inline elements within block elements would sometimes produce a br child element.
135
+ Fixed bug where urls pointing to the same domain as the current one would cause undefined errors. Patch contributed by Paul Giberson.
136
+ Fixed bug where enter inside an editable element inside an non editable element would split the element.
137
+ Fixed bug where cut/copy/paste of noneditable elements didn't work.
138
+ Fixed bug where backspace would sometimes produce font elements on WebKit.
139
+ Fixed bug where WebKit would produce spans out of various inline elements when using backspace.
140
+ Fixed bug where IE9 wouldn't properly update image styles when images where resized.
141
+ Fixed bug where drag/drop of noneditable elements didn't work correctly.
142
+ Fixed bug where applying formatting to all contents wouldn't work correctly when an end point was inside an empty bock. Patch contributed by Jose Luiz.
143
+ Fixed bug where IE10 removed the scopeName from the DOM element interface and there for it produced an undefined string in element path.
144
+ Fixed bug where the caret would be placed at an incorrect location if you applied block formatting while having the caret at the end of the block.
145
+ Fixed bug where applying column changes using the cell dialog would only update the first column. Patch contributed by krzyko.
146
+ Fixed bug where the visualblocks plugin would force editor focus if it was turned on by default.
147
+ Fixed bug where the tabfocus plugin would tab to iframes these are now ignored.
148
+ Fixed bug where format drop down list wouldn't show the currently active format for a parent element.
149
+ Fixed bug where paste of plain text in IE 9 would remove the new line characters from text.
150
+ Fixed bug where the menu buttons/split button menus wouldn't be opened at the right location on older IE versions.
151
+ Fixed bug where Gecko browsers wouldn't properly display the right format when having the selection as specific places.
152
+ Fixed bug where shift+enter inside the body when having forced_root_blocks set to false would throw an error.
153
+ Fixed bug where the jQuery plugin would break the attr method of jQuery 1.7.2. Patch contributed by Markus Kemmerling.
154
+ Fixed so options like content_css accepts and array as well as a comma separated string as input.
155
+ Restructured the internal logic to make it more separate from Editor.js.
156
+ Updated the Sizzle engine to the latest version.
157
+ Version 3.5b2 (2012-03-15)
158
+ Rewrote the enter key logic to normalize browser behavior.
159
+ Fixed so enter within PRE elements produces a BR and shift+enter breaks/end the PRE. Can be disabled using the br_in_pre option.
160
+ Fixed bug where the selection wouldn't be correct after applying formatting and having the caret at the end of the new format node.
161
+ Fixed bug where the noneditable plugin would process contents on raw input calls for example on undo/redo calls.
162
+ Fixed bug where WebKit could produce an exception when a bookmark was requested when there wasn't a proper selection.
163
+ Fixed bug where WebKit would fail to open the image dialog since it would be returning false for a class name instead of a string.
164
+ Fixed so alignment and indentation works properly when forced_root_blocks is set to false. It will produce a DIV by default.
165
+ Version 3.5b1 (2012-03-08)
166
+ Added new event class that is faster and enables support for faking events.
167
+ Added new self_closing_elements, short_ended_elements, boolean_attributes, non_empty_elements and block_elements options to control the HTML Schema.
168
+ Added new schema option and support for the HTML5 schema.
169
+ Added new visualblocks plugin that shows html5 blocks with visual borders.
170
+ Added new types and selector options to make it easier to create editor instances with different configs.
171
+ Added new preview of formatting options in various listboxes.
172
+ Added new preview_styles option that enables control over what gets previewed.
173
+ Fixed bug where content css would be loaded twice into iframe.
174
+ Fixed bug where start elements with only whitespace in the attribute part wouldn't be correctly parsed.
175
+ Fixed bug where the advlink dialog would produce an error about the addSelectAccessibility function not being defined.
176
+ Fixed bug where the caret would be placed at an incorrect position if span was removed by the invalid_elements setting.
177
+ Fixed bug where elements inside a white space preserve element like pre didn't inherit the behavior while parsing.
178
+ Version 3.4.9 (2012-02-23)
179
+ Added settings to wordcount plugin to configure update rate and checking wordcount on backspace and delete using wordcount_update_rate and wordcount_update_on_delete.
180
+ Fixed bug in Webkit and IE where deleting empty paragraphs would remove entire editor contents.
181
+ Fixed bug where pressing enter on end of list item with a heading would create a new item with heading.
182
+ Fixed edit css style dialog text-decoration none checkbox so it disables other text-decoration options when enabled.
183
+ Fixed bug in Gecko where undo wasn't added when focus was lost.
184
+ Fixed bug in Gecko where shift-enter in table cell ending with BR doesn't move caret to new line.
185
+ Fixed bug where right-click on formatted text in IE selected the entire line.
186
+ Fixed bug where text ending with space could not be unformatted in IE.
187
+ Fixed bug where caret formatting would be removed when moving the caret when a selector expression was used.
188
+ Fixed bug where formatting would be applied to the body element when all contents where selected and format had both inline and selector parts.
189
+ Fixed bug where the media plugin would throw errors if you had iframe set as an invalid element in config.
190
+ Fixed bug where the caret would be placed at the top of the document if you inserted a table and undo:ed that operation. Patch contributed by Wesley Walser.
191
+ Fixed bug where content css files where loaded twice into the iframe.
192
+ Fixed so elements with comments would be trated as non empty elements. Patch contributed by Arjan Scherpenisse.
193
+ Version 3.4.8 (2012-02-02)
194
+ Fixed bug in IE where selected text ending with space cannot be formatted then formatted again to get original text.
195
+ Fixed bug in IE where images larger than editor area were being deselected when toolbar buttons are clicked.
196
+ Fixed bug where wrong text align buttons are active when multiple block elements are selected.
197
+ Fixed bug where selected link not showing in target field of link dialog in some selection cases.
198
+ Use settings for remove_trailing_br so this can be turned off instead of hard coding the value.
199
+ Fixed bug in IE where the media plugin displayed null text when some values aren't filled in.
200
+ Added API method 'onSetAttrib' that fires when the attribute value on a node changes.
201
+ Fix font size dropdown value not being updated when text already has a font size in the advanced template.
202
+ Fixed bug in IE where IE doesn't use ARIA attributes properly on options - causing labels to be read out 2 times.
203
+ Fixed bug where caret cannot be placed after table if table is at end of document in IE.
204
+ Fixed bug where adding range isn't always successful so we need to check range count otherwise an exception can occur.
205
+ Added spacebar onclick handler to toolbar buttons to ensure that the accessibility behaviour works correctly.
206
+ Fixed bug where a stranded bullet point would get created in WebKit.
207
+ Fixed bug where selecting text in a blockquote and pressing backspace toggles the style.
208
+ Fixed bug where pressing enter from a heading in IE, the resulting P tag below it shares the style property.
209
+ Fix white space in between spans from being deleted.
210
+ Fixed bug where scrollbars where visible in the character map dialog on Gecko.
211
+ Fixed issue with missing translation for one of the emoticons.
212
+ Fixed bug where dots in id:s where causing problems. Patch provided by Abhishek Dev.
213
+ Fixed bug where urls with an at sign in the path wouldn't be parsed correctly. Patch contributed by Jason Grout.
214
+ Fixed bug where Opera would remove the first character of a inline formatted word if you pressed backspace.
215
+ Fixed bugs with the autoresize plugin on various browsers and removed the need for the throbber.
216
+ Fixed performance issue where the contextmenu plugin would try to remove the menu even if it was removed. Patch contributed by mhu.
217
+ Version 3.4.7 (2011-11-03)
218
+ Modified the caret formatting behavior to word similar to common desktop wordprocessors like Word or Libre Office.
219
+ Fixed bug in Webkit - Cursor positioning does not work vertically within a table cell with multiple lines of text.
220
+ Fixed bug in IE where Inserting a table in IE8 places cursor in the second cell of the first row.
221
+ Fixed bug in IE where editor in a frame doesn't give focus to the toolbar using ALT-F10.
222
+ Fix for webkit and gecko so that deleting bullet from start of list outdents inner list items and moves first item into paragraph.
223
+ Fix new list items in IE8 not displayed on a new line when list contains nested list items.
224
+ Clear formatting in table cell breaks the cell.
225
+ Made media type list localisable.
226
+ Fix out of memory error when using prototype in media dialog.
227
+ Fixed bug where could not add a space in the middle of a th cell.
228
+ Fixed bug where adding a bullet between two existing bullets adds an extra one
229
+ Fixed bug where trying to insert a new entry midway through a bulleted list fails dismally when the next entry is tabbed in.
230
+ Fixed bug where pressing enter on an empty list item does not outdent properly in FF
231
+ Fixed bug where adding a heading after a list item in a table cell changes all styles in that cell
232
+ Fixed bug where hitting enter to exit from a bullet list moves cursor to the top of the page in Firefox.
233
+ Fixed bug where pressing backspace would not delete HRs in Firefox and IE when next to an empty paragraph.
234
+ Fixed bug where deleting part of the link text can cause a link with no destination to be saved.
235
+ Fixed bug where css style border widths wasn't handled correctly in table dialog.
236
+ Fixed bug where parsing invalid html contents on IE or WebKit could produce an infinite loop.
237
+ Fixed bug where scripts with custom script types wasn't properly passed though the editor.
238
+ Fixed issue where some Japanese kanji characters wasn't properly entity encoded when numeric entity mode was enabled.
239
+ Made emoticons dialog use the keyboard naviation.
240
+ Added navigation instructions to the symbols dialog.
241
+ Added ability to set default values for the media plugin.
242
+ Added new font_size_legacy_values option for converting old font element sizes to span with font-size properties.
243
+ Fixed bug where the symbols dialog was not accessible.
244
+ Added quirk for IE ensuring that the body of the document containing tinyMCE has a role="application" for accessibility.
245
+ Fixed bug where the advanced color picker wasn't working properly on FF 7.
246
+ Fixed issue where the advanced color picker was producing uppercase hex codes.
247
+ Fixed bug where IE 8 could throw exceptions if the contents contained resizable content elements.
248
+ Fixed bug where caret formatting wouldn't be correctly applied to previous sibling on WebKit.
249
+ Fixed bug where the select boxes for font size/family would loose it's value on WebKit due to recent iOS fixes.
250
+ Version 3.4.6 (2011-09-29)
251
+ Fixed bug where list items were being created for empty divs.
252
+ Added support in Media plugin for audio media using the embed tag
253
+ Fixed accessibility bugs in WebKit and IE8 where toolbar items were not being read.
254
+ Added new use_accessible_selects option to ensure accessible list boxes are used in all browsers (custom widget in firefox native on other browsers)
255
+ Fixed bug where classid attribute was not being checked from embed objects.
256
+ Fixed bug in jsrobot tests with intermittently failing.
257
+ Fixed bug where anchors wasn't updated properly if you edited them using IE 8.
258
+ Fixed bug where input method on WebKit on Mac OS X would fail to initialize when sometimes focusing the editor.
259
+ Fixed bug where it wasn't possible to select HR elements on WebKit by simply clicking on them.
260
+ Fixed bug where the media plugin wouldn't work on IE9 when not using the inlinepopups plugin.
261
+ Fixed bug where hspace,vspace,align and bgcolor would be removed from object elements in the media plugin.
262
+ Fixed bug where the new youtube format wouldn't be properly parsed by the media plugin.
263
+ Fixed bug where the style attribute of layers wasn't properly updated on IE and Gecko.
264
+ Fixed bug where editing contents in a layer would fail on Gecko since contentEditable doesn't inherit properly.
265
+ Fixed bug where IE 6/7 would produce JS errors when serializing contents containing layers.
266
+ Version 3.4.5 (2011-09-06)
267
+ Fixed accessibility bug in WebKit where the right and left arrow keys would update native list boxes.
268
+ Added new whitespace_elements option to enable users to specify specific elements where the whitespace is preserved.
269
+ Added new merge_siblings option to formats. This option makes it possible to disable the auto merging of siblings when applying formats.
270
+ Fixed bug in IE where trailing comma in paste plugin would cause plugin to not run correctly.
271
+ Fixed bug in WebKit where console messages would be logged when deleting an empty document.
272
+ Fixed bug in IE8 where caret positioned is on list item instead of paragraph when outdent splits the list
273
+ Fixed bug with image dialogs not inserting an image if id was omitted from valid_elements.
274
+ Fixed bug where the selection normalization logic wouldn't properly handle image elements in specific config cases.
275
+ Fixed bug where the map elements coords attribute would be messed up by IE when serializing the DOM.
276
+ Fixed bug where IE wouldn't properly handle custom elements when the contents was serialized.
277
+ Fixed bug where you couldn't move the caret in Gecko if you focused the editor using the API or a UI control.
278
+ Fixed bug where adjacent links would get merged on IE due to bugs in their link command.
279
+ Fixed bug where the color split buttons would loose the selection on IE if the editor was placed in a frame/iframe.
280
+ Fixed bug where floated images in WebKit wouldn't get properly linked.
281
+ Fixed bug where the fullscreen mode in a separate window wasn't forced into IE9+ standards mode.
282
+ Fixed bug where pressing enter in an empty editor on WebKit could produce DIV elements instead of P.
283
+ Fixed bug where spans would get removed incorrectly when merging two blocks on backspace/delete on WebKit.
284
+ Fixed bug where the editor contents wouldn't be completely removed on backspace/delete on WebKit.
285
+ Fixed bug where the fullpage plugin wouldn't properly render style elements in the head on IE 6/7.
286
+ Fixed bug where the nonbreaking_force_tab option in the nonbreaking plugin wouldn't work on Gecko/WebKit.
287
+ Fixed bug where the isDirty state would become true on non IE browsers if there was an table at the end of the contents.
288
+ Fixed bug where entities wasn't properly encoded on WebKit when pasting text as plain text.
289
+ Fixed bug where empty editors would produce an exception of valid_elements didn't include body and forced_root_blocks where disabled.
290
+ Fixed bug where the fullscreen mode wouldn't retain the header/footer in the fullpage plugin.
291
+ Fixed issue where the plaintext_mode and plaintext_mode_sticky language keys where swapped.
292
+ Version 3.4.4 (2011-08-04)
293
+ Added new html5 audio support. Patch contributed by Ronald M. Clifford.
294
+ Added mute option for video elements and preload options for video/audio patch contributed by Dmitry Kalinkin.
295
+ Fixed selection to match visual selection before applying formatting changes.
296
+ Fixed browser specific bugs in lists for WebKit and IE.
297
+ Fixed bug where IE would scroll the window if you closed an inline dialog that was larger than the viewport. Patch by Laurence Keijmel.
298
+ Fixed bug where pasting contents near a span element could remove parts of that span. Patch contributed by Wesley Walser.
299
+ Fixed bug where formatting change would be lost after pressing enter.
300
+ Fixed bug in WebKit where deleting across blocks would add extra styles.
301
+ Fixed bug where moving cursor vertically in tables in WebKit wasn't working.
302
+ Fixed bug in IE where deleting would cause error in console.
303
+ Fixed bug where the formatter was not applying formats across list elements.
304
+ Fixed bug where the wordcount plugin would try and update the wordcount if tinymce had been destroyed.
305
+ Fixed bug where tabfocus plugin would attempt to focus elements not displayed when their parent element was hidden.
306
+ Fixed bug where the contentEditable state would sometimes be removed if you deleted contents in Gecko.
307
+ Fixed bug where inserting contents using mceInsertContent would fail if "span" was disabled in valid_elements.
308
+ Fixed bug where initialization might fail if some resource on gecko wouldn't load properly and fire the onload event.
309
+ Fixed bug where ctrl+7/8/9 keys wouldn't properly add the specific formats associated with them.
310
+ Fixed bug where the HTML tags wasn't properly closed in the style plugins properties dialog.
311
+ Fixed bug where the list plugin would produce an exception if the user tried to delete an element at the very first location.
312
+ Version 3.4.3.2 (2011-06-30)
313
+ Fixed bug where deleting all of a paragraph inside a table cell would behave badly in webkit.
314
+ Fixed bugs in tests in firefox5 and WebKit.
315
+ Fixed bug where selection of table cells would produce an exception on Gecko.
316
+ Fixed bug where the caret wasn't properly rendered on Gecko when the editor was hidden.
317
+ Fixed bug where pasting plain text into WebKit would produce a pre element it will now produce more semantic markup.
318
+ Fixed bug where selecting list type formats using the advlist plugin on IE8 would loose editor selection.
319
+ Fixed bug where forced root blocks logic wouldn't properly pad elements created if they contained data attributes.
320
+ Fixed bug where it would remove all contents of the editor if you inserted an image when not having a caret in the document.
321
+ Fixed bug where the YUI compressor wouldn't properly encode strings with only a quote in them.
322
+ Fixed bug where WebKit on iOS5 wouldn't call nodeChanged when the selection was changed.
323
+ Fixed bug where mceFocus command wouldn't work properly on Gecko since it didn't focus the body element.
324
+ Fixed performance issue with the noneditable plugin where it would enable/disable controls to often.
325
+ Version 3.4.3.1 (2011-06-16)
326
+ Fixed bug where listboxes were not being handled correctly by JAWS in firefox with the o2k7 skin.
327
+ Fixed bug where custom buttons were not being rendered correctly when in high contrast mode.
328
+ Added support for iOS 5 that now supporting contentEditable in it's latest beta.
329
+ Fixed bug where urls in style attributes with a _ character followed by a number would cause incorrect output.
330
+ Fixed bug where custom_elements option wasn't working properly on IE browsers.
331
+ Fixed bug where custom_elements marked as block elements wouldn't get correctly treated as block elements.
332
+ Fixed bug where attributes with </> wasn't properly encoded as XML entities.
333
+ Version 3.4.3 (2011-06-09)
334
+ Fixed bug where deleting backwards before an image into a list would put the cursor in the wrong location.
335
+ Fixed bug where styles plugin would not apply styles across multiple selected block elements correctly.
336
+ Fixed bug where cursor would jump to start of document when selection contained empty table cells in IE8.
337
+ Fixed bug where applied styles wouldn't be kept if you pressed enter twice to produce two paragraphs.
338
+ Fixed bug where a ghost like caret would appear on Gecko when pressing enter while having a text color applied.
339
+ Fixed bug where IE would produce absolute urls if you inserted a image/link and reloaded the page.
340
+ Fixed bug where applying a heading style to a list item would cascade style to children list items.
341
+ Fixed bug where Editor loses focus when backspacing and changing styles in WebKit.
342
+ Fixed bug where exception was thrown in tinymce.util.URI when parsing a relative URI and no base_uri setting was provided.
343
+ Fixed bug where alt-f10 was not always giving focus to the toolbar on Safari.
344
+ Added new 'allow_html_in_named_anchor' option to allow html to occur within a named anchor tag. Use at own risk.
345
+ Added plugin dependency support. Will autoload plugins specified as a dependency if they haven't been loaded.
346
+ Fixed bug where the autolink plugin didn't work with non-English keyboards when pressing ).
347
+ Added possibility to change properties of all table cells in a column.
348
+ Added external_image_list option to get images list from user-defined variable or function.
349
+ Fixed bug where the autoresize plugin wouldn't reduce the editors height on Chrome.
350
+ Fixed bug where table size inputs were to small for values with size units.
351
+ Fixed bug where table cell/row size input values were not validated.
352
+ Fixed bug where menu item line-height would be set to wrong value by external styles.
353
+ Fixed bug where hasUndo() would return wrong answer.
354
+ Fixed bug where page title would be set to undefined by fullpage plugin.
355
+ Fixed bug where HTML5 video properties were not updated in embedded media settings.
356
+ Fixed bug where HTML comment on the first line would cause an error.
357
+ Fixed bug where spellchecker menu was positioned incorrectly on IE.
358
+ Fixed bug where breaking out of list elements on WebKit would produce a DIV instead of P after the list.
359
+ Fixed bug where pasting from Word in IE9 would add extra BR elements when text was word wrapped.
360
+ Fixed bug where numeric entities with leading zeros would produce incorrect decoding.
361
+ Fixed bug where hexadecimal entities wasn't properly decoded.
362
+ Fixed bug where bookmarks wasn't properly stored/restored on undo/redo.
363
+ Fixed bug where the mceInsertCommand didn't retain the values of links if they contained non url contents.
364
+ Fixed bug where the valid_styles option wouldn't be properly used on styles for specific elements.
365
+ Fixed so contentEditable is used for the body of the editor if it's supported.
366
+ Fixed so trailing BR elements gets removed even when forced_root_blocks option was set to false/null.
367
+ Fixed performance issue with mceInsertCommand and inserting very simple contents.
368
+ Fixed performance issue with older IE version and huge documents by optimizing the forced root blocks logic.
369
+ Fixed performance issue with table plugin where it checked for selected cells to often.
370
+ Fixed bug where creating a link on centered/floated image would produce an error on WebKit browsers.
371
+ Fixed bug where Gecko would remove single paragraphs if there where contents before/after it.
372
+ Fixed bug where the scrollbar would move up/down when pasting contents using the paste plugin.
373
+ Version 3.4.2 (2011-04-07)
374
+ Added new 'paste_text_sticky_default' option to paste plugin, enables you to set the default state for paste as plain text.
375
+ Added new autoresize_bottom_margin option to autoresize plugin that enables you to add an extra margin at the bottom. Patch contributed by Andrew Ozz.
376
+ Rewritten the fullpage plugin to handle style contents better and have a more normalized behavior across browsers.
377
+ Fixed bug where contents inserted with mceInsertContent wasn't parsed using the default dom parser.
378
+ Fixed bug where blocks containing a single anchor element would be treated as empty.
379
+ Fixed bug where merging of table cells on IE 6, 7 wouldn't look correctly until the contents was refreshed.
380
+ Fixed bug where context menu wouldn't work properly on Safari since it was passing out the ctrl key as pressed.
381
+ Fixed bug where image border color/style values were overwritten by advimage plugin.
382
+ Fixed bug where setting border in advimage plugin would throw error in IE.
383
+ Fixed bug where empty anchors list in link settings wasn't hidden.
384
+ Fixed bug where xhtmlextras popups were missing localized popup-size parameters.
385
+ Fixed bug where the context menu wouldn't select images on WebKit browsers.
386
+ Fixed bug where paste plugin wouldn't properly extract the contents on WebKit due to recent changes in browser behavior.
387
+ Fixed bug where focus of the editor would get on control contents on IE lost due to a bug in the ColorSplitButton control.
388
+ Fixed bug where contextmenu wasn't disabled on noneditable elements.
389
+ Fixed bug where getStyle function would trigger error when called on element without style property.
390
+ Fixed bug where editor fail to load if Javascript Compressor was used.
391
+ Fixed bug where list-style-type=lower-greek would produce errors in IE<8.
392
+ Fixed bug where spellchecker plugin would produce errors on IE6-7.
393
+ Fixed bug where theme_advanced_containers configuration option causes error.
394
+ Fixed bug where the mceReplaceContent command would produce an error since it didn't correctly handle a return value.
395
+ Fixed bug where you couldn't enter float point values for em in dialog input fields since it wouldn't be considered a valid size.
396
+ Fixed bug in xhtmlxtras plugin where it wasn't possible to remove some attributes in the attributes dialog.
397
+ Version 3.4.1 (2011-03-24)
398
+ Added significantly improved list handling via the new 'lists' plugin.
399
+ Added 'autolink' plugin to enable automatically linking URLs. Similar to the behavior IE has by default.
400
+ Added 'theme_advanced_show_current_color' setting to enable the forecolor and backcolor buttons to continuously show the current text color.
401
+ Added 'contextmenu_never_use_native' setting to disable the ctrl-right-click showing the native browser context menu behaviour.
402
+ Added 'paste_enable_default_filters' setting to enable the default paste filters to be disabled.
403
+ Fixed bug where selection locations on undo/redo didn't work correctly on specific contents.
404
+ Fixed bug where an exception would be trown on IE when loading TinyMCE inside an iframe.
405
+ Fixed bug where some ascii numeric entities wasn't properly decoded.
406
+ Fixed bug where some non western language codes wasn't properly decoded/encoded.
407
+ Fixed bug where undo levels wasn't created when deleting contents on IE.
408
+ Fixed bug where the initial undo levels bookmark wasn't updated correctly.
409
+ Fixed bug where search/replace wouldn't be scoped to editor instances on IE8.
410
+ Fixed bug where IE9 would produce two br elements after block elements when pasting.
411
+ Fixed bug where IE would place the caret at an incorrect position after a paste operation.
412
+ Fixed bug where a paste operation using the keyboard would add an extra undo level.
413
+ Fixed bug where some attributes/elements wasn't correctly filtered when invalid contents was inserted.
414
+ Fixed bug where the table plugin couldn't correctly handle invalid table structures.
415
+ Fixed bug where charset and title of the page were handled incorrectly by the fullpage plugin.
416
+ Fixed bug where toggle states on some of the list boxes didn't update correctly.
417
+ Fixed bug where sub/sub wouldn't work correctly when done as a caret action in Chrome 10.
418
+ Fixed bug where the constrain proportions checkbox wouldn't work in the media plugin.
419
+ Fixed bug where block elements containing trailing br elements wouldn't treated properly if they where invalid.
420
+ Fixed bug where the color picker dialog wouldn't be rendered correctly when using the o2k7 theme.
421
+ Fixed bug where setting border=0 using advimage plugin invalid style attribute content was created in Chrome.
422
+ Fixed bug with references to non-existing images in css of fullpage plugin.
423
+ Fixed bug where item could be unselected in spellchecker's language selector.
424
+ Fixed bug where some mispelled words could be not highlighted using spellchecker plugin.
425
+ Fixed bug where spellchecking would merge some words on IE.
426
+ Fixed bug where spellchecker context menu was not always positioned correctly.
427
+ Fixed bug with empty anchors list in advlink popup when Invisible Elements feature was disabled.
428
+ Fixed bug where older IE versions wouldn't properly handle some elements if they where placed at the top of editor contents.
429
+ Fixed bug where selecting the whole table would enable table tools for cells and rows.
430
+ Fixed bug where it wasn't possible to replace selected contents on IE when pasting using the paste plugin.
431
+ Fixed bug where setting text color in fullpage plugin doesn't work.
432
+ Fixed bug where the state of checkboxes in media plugin wouldn't be set correctly.
433
+ Fixed bug where black spade suit character was not included in special character selector.
434
+ Fixed bug where setting invalid values for table cell size would throw an error in IE.
435
+ Fixed bug where spellchecking would remove whitespace characters from PRE block in IE.
436
+ Fixed bug where HR was inserted inside P elements instead of splitting them.
437
+ Fixed bug where extra, empty span tags were added when using a format with both selector and inline modes.
438
+ Fixed bug where bullet lists weren't always detected correctly.
439
+ Fixed bug where deleting some paragraphs on IE would cause an exception.
440
+ Fixed bug where the json encoder logic wouldn't properly encode \ characters.
441
+ Fixed bug where the onChange event would be fired when the editor was first initialized.
442
+ Fixed bug where mceSelected wouldn't be removed properly from output even if it's an internal class.
443
+ Fixed issue with table background colors not being transparent. This improves compliance with users browser color preferences.
444
+ Fixed issue where styles were not included when using the full page plugin.
445
+ Fixed issue where drag/drop operations wasn't properly added to the undo levels.
446
+ Fixed issue where colors wasn't correctly applied to elements with underline decoration.
447
+ Fixed issue where deleting some paragraphs on IE would cause an exception.
448
+ Version 3.4 (2011-03-10)
449
+ Added accessibility example with various accessibility options contributed by Ephox.
450
+ Fixed bug where attributes wasn't properly handled in the xhtmlxtras plugin.
451
+ Fixed bug where the image.htm had some strange td artifacts probably due to auto merging.
452
+ Fixed bug where the ToolbarGroup had an missing reference to this in it's destroy method.
453
+ Fixed bug with the resizeBy function in the advanced theme where it was scaled by the wrong parent.
454
+ Fixed bug where an exception would be thrown by the element if the page was served in xhtml mode.
455
+ Fixed bug where mceInsertContent would throw an exception when page was served in xhtml mode.
456
+ Fixed bug where you couldn't select a forground/background color when page was served in xhtml mode.
457
+ Fixed bug where the editor would scroll to the toolbar when clicked due to a call to focus in ListBox.
458
+ Fixed bug where pages with rtl dir wouldn't render split buttons correctly when using the o2k7 theme.
459
+ Fixed bug where anchor elements with names wasn't properly collapsed as they where in 3.3.x.
460
+ Fixed bug where WebKit wouldn't properly handle image selection if it was done left to right.
461
+ Fixed bug where the formatter would align images when the selection range was collapsed.
462
+ Fixed bug where the image button would be active when the selection range was collapsed.
463
+ Fixed bug where the element_format option wasn't used by the new (X)HTML serializer logic.
464
+ Fixed bug where the table cell/row dialogs would produce empty attributes.
465
+ Fixed bug where the tfoot wouldn't be added to the top of the table.
466
+ Fixed bug where the formatter would merge siblings with white space between them.
467
+ Fixed bug where pasting headers and paragraphs would produce an extra paragraph.
468
+ Fixed bug where the ColorSplitButton would throw an exception if you clicked out side a color.
469
+ Fixed bug where IE9 wouldn't properly produce new paragraphs on enter if the current paragraph had formatting.
470
+ Fixed bug where multiple BR elements at end of block elements where removed.
471
+ Fixed bug where fullscreen plugin wouldn't correctly display the edit area on IE6 for long pages.
472
+ Fixed bug where paste plugin wouldn't properly encode raw entities when pasting in plain text mode.
473
+ Fixed bug where the search/replace plugin wouldn't work correctly on IE 9.
474
+ Fixed so the drop menus doesn't get an outline border visible when focused, patch contributed by Ephox.
475
+ Fixed so the values entered in the color picker are forced to hex values.
476
+ Removed dialog workaround for IE 9 beta since the RC is now out and people should upgrade.
477
+ Removed obsolete calls in various plugins to the mceBeginUndoLevel command.
js/tinymce/examples/accessibility.html CHANGED
@@ -24,9 +24,9 @@
24
 
25
  // Example content CSS (should be your site CSS)
26
  // using false to ensure that the default browser settings are used for best Accessibility
27
- // ACCESSIBILITY SETTINGS
28
  content_css : false,
29
- // Use browser preferred colors for dialogs.
30
  browser_preferred_colors : true,
31
  detect_highcontrast : true,
32
 
@@ -65,13 +65,13 @@
65
 
66
  <p>
67
  This page has got the TinyMCE set up to work with configurations related to accessiblity enabled.
68
- In particular
69
- <ul>
70
- <li>the <strong>content_css</strong> is set to false, to ensure that all default browser styles are used, </li>
71
- <li>the <strong>browser_preferred_colors</strong> dialog option is used to ensure that default css is used for dialogs, </li>
72
- <li>and the <strong>detect_highcontrast</strong> option has been set to ensure that highcontrast mode in Windows browsers
73
- is detected and the toolbars are displayed in a high contrast mode.</li>
74
- </ul>
75
  </p>
76
 
77
  <!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
@@ -98,4 +98,4 @@ if (document.location.protocol == 'file:') {
98
  }
99
  </script>
100
  </body>
101
- </html>
24
 
25
  // Example content CSS (should be your site CSS)
26
  // using false to ensure that the default browser settings are used for best Accessibility
27
+ // ACCESSIBILITY SETTINGS
28
  content_css : false,
29
+ // Use browser preferred colors for dialogs.
30
  browser_preferred_colors : true,
31
  detect_highcontrast : true,
32
 
65
 
66
  <p>
67
  This page has got the TinyMCE set up to work with configurations related to accessiblity enabled.
68
+ In particular
69
+ <ul>
70
+ <li>the <strong>content_css</strong> is set to false, to ensure that all default browser styles are used, </li>
71
+ <li>the <strong>browser_preferred_colors</strong> dialog option is used to ensure that default css is used for dialogs, </li>
72
+ <li>and the <strong>detect_highcontrast</strong> option has been set to ensure that highcontrast mode in Windows browsers
73
+ is detected and the toolbars are displayed in a high contrast mode.</li>
74
+ </ul>
75
  </p>
76
 
77
  <!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
98
  }
99
  </script>
100
  </body>
101
+ </html>
js/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin_src.js CHANGED
@@ -1,184 +1,184 @@
1
- /**
2
- * editor_plugin_src.js
3
- *
4
- * Copyright 2011, 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.AutolinkPlugin', {
13
- /**
14
- * Initializes the plugin, this will be executed after the plugin has been created.
15
- * This call is done before the editor instance has finished it's initialization so use the onInit event
16
- * of the editor instance to intercept that event.
17
- *
18
- * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
19
- * @param {string} url Absolute URL to where the plugin is located.
20
- */
21
-
22
- init : function(ed, url) {
23
- var t = this;
24
-
25
- // Add a key down handler
26
- ed.onKeyDown.addToTop(function(ed, e) {
27
- if (e.keyCode == 13)
28
- return t.handleEnter(ed);
29
- });
30
-
31
- // Internet Explorer has built-in automatic linking for most cases
32
- if (tinyMCE.isIE)
33
- return;
34
-
35
- ed.onKeyPress.add(function(ed, e) {
36
- if (e.which == 41)
37
- return t.handleEclipse(ed);
38
- });
39
-
40
- // Add a key up handler
41
- ed.onKeyUp.add(function(ed, e) {
42
- if (e.keyCode == 32)
43
- return t.handleSpacebar(ed);
44
- });
45
- },
46
-
47
- handleEclipse : function(ed) {
48
- this.parseCurrentLine(ed, -1, '(', true);
49
- },
50
-
51
- handleSpacebar : function(ed) {
52
- this.parseCurrentLine(ed, 0, '', true);
53
- },
54
-
55
- handleEnter : function(ed) {
56
- this.parseCurrentLine(ed, -1, '', false);
57
- },
58
-
59
- parseCurrentLine : function(ed, end_offset, delimiter, goback) {
60
- var r, end, start, endContainer, bookmark, text, matches, prev, len;
61
-
62
- // We need at least five characters to form a URL,
63
- // hence, at minimum, five characters from the beginning of the line.
64
- r = ed.selection.getRng(true).cloneRange();
65
- if (r.startOffset < 5) {
66
- // During testing, the caret is placed inbetween two text nodes.
67
- // The previous text node contains the URL.
68
- prev = r.endContainer.previousSibling;
69
- if (prev == null) {
70
- if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null)
71
- return;
72
-
73
- prev = r.endContainer.firstChild.nextSibling;
74
- }
75
- len = prev.length;
76
- r.setStart(prev, len);
77
- r.setEnd(prev, len);
78
-
79
- if (r.endOffset < 5)
80
- return;
81
-
82
- end = r.endOffset;
83
- endContainer = prev;
84
- } else {
85
- endContainer = r.endContainer;
86
-
87
- // Get a text node
88
- if (endContainer.nodeType != 3 && endContainer.firstChild) {
89
- while (endContainer.nodeType != 3 && endContainer.firstChild)
90
- endContainer = endContainer.firstChild;
91
-
92
- // Move range to text node
93
- if (endContainer.nodeType == 3) {
94
- r.setStart(endContainer, 0);
95
- r.setEnd(endContainer, endContainer.nodeValue.length);
96
- }
97
- }
98
-
99
- if (r.endOffset == 1)
100
- end = 2;
101
- else
102
- end = r.endOffset - 1 - end_offset;
103
- }
104
-
105
- start = end;
106
-
107
- do
108
- {
109
- // Move the selection one character backwards.
110
- r.setStart(endContainer, end >= 2 ? end - 2 : 0);
111
- r.setEnd(endContainer, end >= 1 ? end - 1 : 0);
112
- end -= 1;
113
-
114
- // Loop until one of the following is found: a blank space, &nbsp;, delimeter, (end-2) >= 0
115
- } while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter);
116
-
117
- if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) {
118
- r.setStart(endContainer, end);
119
- r.setEnd(endContainer, start);
120
- end += 1;
121
- } else if (r.startOffset == 0) {
122
- r.setStart(endContainer, 0);
123
- r.setEnd(endContainer, start);
124
- }
125
- else {
126
- r.setStart(endContainer, end);
127
- r.setEnd(endContainer, start);
128
- }
129
-
130
- // Exclude last . from word like "www.site.com."
131
- var text = r.toString();
132
- if (text.charAt(text.length - 1) == '.') {
133
- r.setEnd(endContainer, start - 1);
134
- }
135
-
136
- text = r.toString();
137
- matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);
138
-
139
- if (matches) {
140
- if (matches[1] == 'www.') {
141
- matches[1] = 'http://www.';
142
- } else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) {
143
- matches[1] = 'mailto:' + matches[1];
144
- }
145
-
146
- bookmark = ed.selection.getBookmark();
147
-
148
- ed.selection.setRng(r);
149
- tinyMCE.execCommand('createlink',false, matches[1] + matches[2]);
150
- ed.selection.moveToBookmark(bookmark);
151
- ed.nodeChanged();
152
-
153
- // TODO: Determine if this is still needed.
154
- if (tinyMCE.isWebKit) {
155
- // move the caret to its original position
156
- ed.selection.collapse(false);
157
- var max = Math.min(endContainer.length, start + 1);
158
- r.setStart(endContainer, max);
159
- r.setEnd(endContainer, max);
160
- ed.selection.setRng(r);
161
- }
162
- }
163
- },
164
-
165
- /**
166
- * Returns information about the plugin as a name/value array.
167
- * The current keys are longname, author, authorurl, infourl and version.
168
- *
169
- * @return {Object} Name/value array containing information about the plugin.
170
- */
171
- getInfo : function() {
172
- return {
173
- longname : 'Autolink',
174
- author : 'Moxiecode Systems AB',
175
- authorurl : 'http://tinymce.moxiecode.com',
176
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink',
177
- version : tinymce.majorVersion + "." + tinymce.minorVersion
178
- };
179
- }
180
- });
181
-
182
- // Register plugin
183
- tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin);
184
- })();
1
+ /**
2
+ * editor_plugin_src.js
3
+ *
4
+ * Copyright 2011, 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.AutolinkPlugin', {
13
+ /**
14
+ * Initializes the plugin, this will be executed after the plugin has been created.
15
+ * This call is done before the editor instance has finished it's initialization so use the onInit event
16
+ * of the editor instance to intercept that event.
17
+ *
18
+ * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
19
+ * @param {string} url Absolute URL to where the plugin is located.
20
+ */
21
+
22
+ init : function(ed, url) {
23
+ var t = this;
24
+
25
+ // Add a key down handler
26
+ ed.onKeyDown.addToTop(function(ed, e) {
27
+ if (e.keyCode == 13)
28
+ return t.handleEnter(ed);
29
+ });
30
+
31
+ // Internet Explorer has built-in automatic linking for most cases
32
+ if (tinyMCE.isIE)
33
+ return;
34
+
35
+ ed.onKeyPress.add(function(ed, e) {
36
+ if (e.which == 41)
37
+ return t.handleEclipse(ed);
38
+ });
39
+
40
+ // Add a key up handler
41
+ ed.onKeyUp.add(function(ed, e) {
42
+ if (e.keyCode == 32)
43
+ return t.handleSpacebar(ed);
44
+ });
45
+ },
46
+
47
+ handleEclipse : function(ed) {
48
+ this.parseCurrentLine(ed, -1, '(', true);
49
+ },
50
+
51
+ handleSpacebar : function(ed) {
52
+ this.parseCurrentLine(ed, 0, '', true);
53
+ },
54
+
55
+ handleEnter : function(ed) {
56
+ this.parseCurrentLine(ed, -1, '', false);
57
+ },
58
+
59
+ parseCurrentLine : function(ed, end_offset, delimiter, goback) {
60
+ var r, end, start, endContainer, bookmark, text, matches, prev, len;
61
+
62
+ // We need at least five characters to form a URL,
63
+ // hence, at minimum, five characters from the beginning of the line.
64
+ r = ed.selection.getRng(true).cloneRange();
65
+ if (r.startOffset < 5) {
66
+ // During testing, the caret is placed inbetween two text nodes.
67
+ // The previous text node contains the URL.
68
+ prev = r.endContainer.previousSibling;
69
+ if (prev == null) {
70
+ if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null)
71
+ return;
72
+
73
+ prev = r.endContainer.firstChild.nextSibling;
74
+ }
75
+ len = prev.length;
76
+ r.setStart(prev, len);
77
+ r.setEnd(prev, len);
78
+
79
+ if (r.endOffset < 5)
80
+ return;
81
+
82
+ end = r.endOffset;
83
+ endContainer = prev;
84
+ } else {
85
+ endContainer = r.endContainer;
86
+
87
+ // Get a text node
88
+ if (endContainer.nodeType != 3 && endContainer.firstChild) {
89
+ while (endContainer.nodeType != 3 && endContainer.firstChild)
90
+ endContainer = endContainer.firstChild;
91
+
92
+ // Move range to text node
93
+ if (endContainer.nodeType == 3) {
94
+ r.setStart(endContainer, 0);
95
+ r.setEnd(endContainer, endContainer.nodeValue.length);
96
+ }
97
+ }
98
+
99
+ if (r.endOffset == 1)
100
+ end = 2;
101
+ else
102
+ end = r.endOffset - 1 - end_offset;
103
+ }
104
+
105
+ start = end;
106
+
107
+ do
108
+ {
109
+ // Move the selection one character backwards.
110
+ r.setStart(endContainer, end >= 2 ? end - 2 : 0);
111
+ r.setEnd(endContainer, end >= 1 ? end - 1 : 0);
112
+ end -= 1;
113
+
114
+ // Loop until one of the following is found: a blank space, &nbsp;, delimeter, (end-2) >= 0
115
+ } while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter);
116
+
117
+ if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) {
118
+ r.setStart(endContainer, end);
119
+ r.setEnd(endContainer, start);
120
+ end += 1;
121
+ } else if (r.startOffset == 0) {
122
+ r.setStart(endContainer, 0);
123
+ r.setEnd(endContainer, start);
124
+ }
125
+ else {
126
+ r.setStart(endContainer, end);
127
+ r.setEnd(endContainer, start);
128
+ }
129
+
130
+ // Exclude last . from word like "www.site.com."
131
+ var text = r.toString();
132
+ if (text.charAt(text.length - 1) == '.') {
133
+ r.setEnd(endContainer, start - 1);
134
+ }
135
+
136
+ text = r.toString();
137
+ matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);
138
+
139
+ if (matches) {
140
+ if (matches[1] == 'www.') {
141
+ matches[1] = 'http://www.';
142
+ } else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) {
143
+ matches[1] = 'mailto:' + matches[1];
144
+ }
145
+
146
+ bookmark = ed.selection.getBookmark();
147
+
148
+ ed.selection.setRng(r);
149
+ tinyMCE.execCommand('createlink',false, matches[1] + matches[2]);
150
+ ed.selection.moveToBookmark(bookmark);
151
+ ed.nodeChanged();
152
+
153
+ // TODO: Determine if this is still needed.
154
+ if (tinyMCE.isWebKit) {
155
+ // move the caret to its original position
156
+ ed.selection.collapse(false);
157
+ var max = Math.min(endContainer.length, start + 1);
158
+ r.setStart(endContainer, max);
159
+ r.setEnd(endContainer, max);
160
+ ed.selection.setRng(r);
161
+ }
162
+ }
163
+ },
164
+
165
+ /**
166
+ * Returns information about the plugin as a name/value array.
167
+ * The current keys are longname, author, authorurl, infourl and version.
168
+ *
169
+ * @return {Object} Name/value array containing information about the plugin.
170
+ */
171
+ getInfo : function() {
172
+ return {
173
+ longname : 'Autolink',
174
+ author : 'Moxiecode Systems AB',
175
+ authorurl : 'http://tinymce.moxiecode.com',
176
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink',
177
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
178
+ };
179
+ }
180
+ });
181
+
182
+ // Register plugin
183
+ tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin);
184
+ })();
js/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js CHANGED
@@ -1,119 +1,119 @@
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
- /**
13
- * Auto Resize
14
- *
15
- * This plugin automatically resizes the content area to fit its content height.
16
- * It will retain a minimum height, which is the height of the content area when
17
- * it's initialized.
18
- */
19
- tinymce.create('tinymce.plugins.AutoResizePlugin', {
20
- /**
21
- * Initializes the plugin, this will be executed after the plugin has been created.
22
- * This call is done before the editor instance has finished it's initialization so use the onInit event
23
- * of the editor instance to intercept that event.
24
- *
25
- * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
26
- * @param {string} url Absolute URL to where the plugin is located.
27
- */
28
- init : function(ed, url) {
29
- var t = this, oldSize = 0;
30
-
31
- if (ed.getParam('fullscreen_is_enabled'))
32
- return;
33
-
34
- /**
35
- * This method gets executed each time the editor needs to resize.
36
- */
37
- function resize() {
38
- var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
39
-
40
- // Get height differently depending on the browser used
41
- myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight);
42
-
43
- // Don't make it smaller than the minimum height
44
- if (myHeight > t.autoresize_min_height)
45
- resizeHeight = myHeight;
46
-
47
- // If a maximum height has been defined don't exceed this height
48
- if (t.autoresize_max_height && myHeight > t.autoresize_max_height) {
49
- resizeHeight = t.autoresize_max_height;
50
- body.style.overflowY = "auto";
51
- de.style.overflowY = "auto"; // Old IE
52
- } else {
53
- body.style.overflowY = "hidden";
54
- de.style.overflowY = "hidden"; // Old IE
55
- body.scrollTop = 0;
56
- }
57
-
58
- // Resize content element
59
- if (resizeHeight !== oldSize) {
60
- deltaSize = resizeHeight - oldSize;
61
- DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
62
- oldSize = resizeHeight;
63
-
64
- // WebKit doesn't decrease the size of the body element until the iframe gets resized
65
- // So we need to continue to resize the iframe down until the size gets fixed
66
- if (tinymce.isWebKit && deltaSize < 0)
67
- resize();
68
- }
69
- };
70
-
71
- t.editor = ed;
72
-
73
- // Define minimum height
74
- t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight));
75
-
76
- // Define maximum height
77
- t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0));
78
-
79
- // Add padding at the bottom for better UX
80
- ed.onInit.add(function(ed){
81
- ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px');
82
- });
83
-
84
- // Add appropriate listeners for resizing content area
85
- ed.onChange.add(resize);
86
- ed.onSetContent.add(resize);
87
- ed.onPaste.add(resize);
88
- ed.onKeyUp.add(resize);
89
- ed.onPostRender.add(resize);
90
-
91
- if (ed.getParam('autoresize_on_init', true)) {
92
- ed.onLoad.add(resize);
93
- ed.onLoadContent.add(resize);
94
- }
95
-
96
- // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
97
- ed.addCommand('mceAutoResize', resize);
98
- },
99
-
100
- /**
101
- * Returns information about the plugin as a name/value array.
102
- * The current keys are longname, author, authorurl, infourl and version.
103
- *
104
- * @return {Object} Name/value array containing information about the plugin.
105
- */
106
- getInfo : function() {
107
- return {
108
- longname : 'Auto Resize',
109
- author : 'Moxiecode Systems AB',
110
- authorurl : 'http://tinymce.moxiecode.com',
111
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
112
- version : tinymce.majorVersion + "." + tinymce.minorVersion
113
- };
114
- }
115
- });
116
-
117
- // Register plugin
118
- tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
119
- })();
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
+ /**
13
+ * Auto Resize
14
+ *
15
+ * This plugin automatically resizes the content area to fit its content height.
16
+ * It will retain a minimum height, which is the height of the content area when
17
+ * it's initialized.
18
+ */
19
+ tinymce.create('tinymce.plugins.AutoResizePlugin', {
20
+ /**
21
+ * Initializes the plugin, this will be executed after the plugin has been created.
22
+ * This call is done before the editor instance has finished it's initialization so use the onInit event
23
+ * of the editor instance to intercept that event.
24
+ *
25
+ * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
26
+ * @param {string} url Absolute URL to where the plugin is located.
27
+ */
28
+ init : function(ed, url) {
29
+ var t = this, oldSize = 0;
30
+
31
+ if (ed.getParam('fullscreen_is_enabled'))
32
+ return;
33
+
34
+ /**
35
+ * This method gets executed each time the editor needs to resize.
36
+ */
37
+ function resize() {
38
+ var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
39
+
40
+ // Get height differently depending on the browser used
41
+ myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight);
42
+
43
+ // Don't make it smaller than the minimum height
44
+ if (myHeight > t.autoresize_min_height)
45
+ resizeHeight = myHeight;
46
+
47
+ // If a maximum height has been defined don't exceed this height
48
+ if (t.autoresize_max_height && myHeight > t.autoresize_max_height) {
49
+ resizeHeight = t.autoresize_max_height;
50
+ body.style.overflowY = "auto";
51
+ de.style.overflowY = "auto"; // Old IE
52
+ } else {
53
+ body.style.overflowY = "hidden";
54
+ de.style.overflowY = "hidden"; // Old IE
55
+ body.scrollTop = 0;
56
+ }
57
+
58
+ // Resize content element
59
+ if (resizeHeight !== oldSize) {
60
+ deltaSize = resizeHeight - oldSize;
61
+ DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
62
+ oldSize = resizeHeight;
63
+
64
+ // WebKit doesn't decrease the size of the body element until the iframe gets resized
65
+ // So we need to continue to resize the iframe down until the size gets fixed
66
+ if (tinymce.isWebKit && deltaSize < 0)
67
+ resize();
68
+ }
69
+ };
70
+
71
+ t.editor = ed;
72
+
73
+ // Define minimum height
74
+ t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight));
75
+
76
+ // Define maximum height
77
+ t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0));
78
+
79
+ // Add padding at the bottom for better UX
80
+ ed.onInit.add(function(ed){
81
+ ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px');
82
+ });
83
+
84
+ // Add appropriate listeners for resizing content area
85
+ ed.onChange.add(resize);
86
+ ed.onSetContent.add(resize);
87
+ ed.onPaste.add(resize);
88
+ ed.onKeyUp.add(resize);
89
+ ed.onPostRender.add(resize);
90
+
91
+ if (ed.getParam('autoresize_on_init', true)) {
92
+ ed.onLoad.add(resize);
93
+ ed.onLoadContent.add(resize);
94
+ }
95
+
96
+ // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
97
+ ed.addCommand('mceAutoResize', resize);
98
+ },
99
+
100
+ /**
101
+ * Returns information about the plugin as a name/value array.
102
+ * The current keys are longname, author, authorurl, infourl and version.
103
+ *
104
+ * @return {Object} Name/value array containing information about the plugin.
105
+ */
106
+ getInfo : function() {
107
+ return {
108
+ longname : 'Auto Resize',
109
+ author : 'Moxiecode Systems AB',
110
+ authorurl : 'http://tinymce.moxiecode.com',
111
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
112
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
113
+ };
114
+ }
115
+ });
116
+
117
+ // Register plugin
118
+ tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
119
+ })();
js/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js CHANGED
@@ -1 +1 @@
1
- tinyMCE.addI18n('en.emotions_dlg',{cry:"Cry",cool:"Cool",desc:"Emotions",title:"Insert Emotion",usage:"Use left and right arrows to navigate.",yell:"Yell",wink:"Wink",undecided:"Undecided","tongue_out":"Tongue Out",surprised:"Surprised",smile:"Smile",sealed:"Sealed","money_mouth":"Money Mouth",laughing:"Laughing",kiss:"Kiss",innocent:"Innocent",frown:"Frown","foot_in_mouth":"Foot in Mouth",embarassed:"Embarassed"});
1
+ tinyMCE.addI18n('en.emotions_dlg',{cry:"Cry",cool:"Cool",desc:"Emotions",title:"Insert Emotion",usage:"Use left and right arrows to navigate.",yell:"Yell",wink:"Wink",undecided:"Undecided","tongue_out":"Tongue Out",surprised:"Surprised",smile:"Smile",sealed:"Sealed","money_mouth":"Money Mouth",laughing:"Laughing",kiss:"Kiss",innocent:"Innocent",frown:"Frown","foot_in_mouth":"Foot in Mouth",embarassed:"Embarassed"});
js/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin_src.js CHANGED
@@ -1,50 +1,50 @@
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
-
13
- tinymce.create('tinymce.plugins.ExampleDependencyPlugin', {
14
- /**
15
- * Initializes the plugin, this will be executed after the plugin has been created.
16
- * This call is done before the editor instance has finished it's initialization so use the onInit event
17
- * of the editor instance to intercept that event.
18
- *
19
- * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
20
- * @param {string} url Absolute URL to where the plugin is located.
21
- */
22
- init : function(ed, url) {
23
- },
24
-
25
-
26
- /**
27
- * Returns information about the plugin as a name/value array.
28
- * The current keys are longname, author, authorurl, infourl and version.
29
- *
30
- * @return {Object} Name/value array containing information about the plugin.
31
- */
32
- getInfo : function() {
33
- return {
34
- longname : 'Example Dependency plugin',
35
- author : 'Some author',
36
- authorurl : 'http://tinymce.moxiecode.com',
37
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency',
38
- version : "1.0"
39
- };
40
- }
41
- });
42
-
43
- /**
44
- * Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, with the list loaded in order.
45
- * plugins in this list will be initialised when this plugin is initialized. (before the init method is called).
46
- * plugins in a depends list should typically be specified using the short name). If neccesary this can be done
47
- * with an object which has the url to the plugin and the shortname.
48
- */
49
- tinymce.PluginManager.add('example_dependency', tinymce.plugins.ExampleDependencyPlugin, ['example']);
50
- })();
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
+
13
+ tinymce.create('tinymce.plugins.ExampleDependencyPlugin', {
14
+ /**
15
+ * Initializes the plugin, this will be executed after the plugin has been created.
16
+ * This call is done before the editor instance has finished it's initialization so use the onInit event
17
+ * of the editor instance to intercept that event.
18
+ *
19
+ * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
20
+ * @param {string} url Absolute URL to where the plugin is located.
21
+ */
22
+ init : function(ed, url) {
23
+ },
24
+
25
+
26
+ /**
27
+ * Returns information about the plugin as a name/value array.
28
+ * The current keys are longname, author, authorurl, infourl and version.
29
+ *
30
+ * @return {Object} Name/value array containing information about the plugin.
31
+ */
32
+ getInfo : function() {
33
+ return {
34
+ longname : 'Example Dependency plugin',
35
+ author : 'Some author',
36
+ authorurl : 'http://tinymce.moxiecode.com',
37
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency',
38
+ version : "1.0"
39
+ };
40
+ }
41
+ });
42
+
43
+ /**
44
+ * Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, with the list loaded in order.
45
+ * plugins in this list will be initialised when this plugin is initialized. (before the init method is called).
46
+ * plugins in a depends list should typically be specified using the short name). If neccesary this can be done
47
+ * with an object which has the url to the plugin and the shortname.
48
+ */
49
+ tinymce.PluginManager.add('example_dependency', tinymce.plugins.ExampleDependencyPlugin, ['example']);
50
+ })();
js/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css CHANGED
@@ -1,90 +1,90 @@
1
- /* Clearlooks 2 */
2
-
3
- /* Reset */
4
- .clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block}
5
-
6
- /* General */
7
- .clearlooks2 {position:absolute; direction:ltr}
8
- .clearlooks2 .mceWrapper {position:static}
9
- .mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%}
10
- .clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)}
11
- .clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none}
12
-
13
- /* Top */
14
- .clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px}
15
- .clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)}
16
- .clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)}
17
- .clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0}
18
- .clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold}
19
- .clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0}
20
- .clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px}
21
- .clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0}
22
- .clearlooks2 .mceFocus .mceTop span {color:#FFF}
23
-
24
- /* Middle */
25
- .clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0}
26
- .clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)}
27
- .clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0}
28
- .clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF}
29
- .clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)}
30
-
31
- /* Bottom */
32
- .clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px}
33
- .clearlooks2 .mceBottom {left:0; bottom:0; width:100%}
34
- .clearlooks2 .mceBottom div {top:0}
35
- .clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px}
36
- .clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px}
37
- .clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0}
38
- .clearlooks2 .mceBottom span {display:none}
39
- .clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px}
40
- .clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0}
41
- .clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px}
42
- .clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0}
43
- .clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px}
44
-
45
- /* Actions */
46
- .clearlooks2 a {width:29px; height:16px; top:3px;}
47
- .clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0}
48
- .clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0}
49
- .clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0}
50
- .clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0}
51
- .clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px}
52
- .clearlooks2 .mceMovable .mceMove {display:block}
53
- .clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px}
54
- .clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px}
55
- .clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px}
56
- .clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px}
57
- .clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
58
- .clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
59
- .clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px}
60
- .clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px}
61
- .clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px}
62
-
63
- /* Resize */
64
- .clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px}
65
- .clearlooks2 .mceResizable .mceResize {display:block}
66
- .clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none}
67
- .clearlooks2 .mceMinimizable .mceMin {display:block}
68
- .clearlooks2 .mceMaximizable .mceMax {display:block}
69
- .clearlooks2 .mceMaximized .mceMed {display:block}
70
- .clearlooks2 .mceMaximized .mceMax {display:none}
71
- .clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize}
72
- .clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize}
73
- .clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize}
74
- .clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;}
75
- .clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize}
76
- .clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize}
77
- .clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize}
78
- .clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize}
79
-
80
- /* Alert/Confirm */
81
- .clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0}
82
- .clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px}
83
- .clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal}
84
- .clearlooks2 a:hover {font-weight:bold;}
85
- .clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5}
86
- .clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px}
87
- .clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)}
88
- .clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px}
89
- .clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto}
90
- .clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)}
1
+ /* Clearlooks 2 */
2
+
3
+ /* Reset */
4
+ .clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block}
5
+
6
+ /* General */
7
+ .clearlooks2 {position:absolute; direction:ltr}
8
+ .clearlooks2 .mceWrapper {position:static}
9
+ .mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%}
10
+ .clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)}
11
+ .clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none}
12
+
13
+ /* Top */
14
+ .clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px}
15
+ .clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)}
16
+ .clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)}
17
+ .clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0}
18
+ .clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold}
19
+ .clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0}
20
+ .clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px}
21
+ .clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0}
22
+ .clearlooks2 .mceFocus .mceTop span {color:#FFF}
23
+
24
+ /* Middle */
25
+ .clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0}
26
+ .clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)}
27
+ .clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0}
28
+ .clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF}
29
+ .clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)}
30
+
31
+ /* Bottom */
32
+ .clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px}
33
+ .clearlooks2 .mceBottom {left:0; bottom:0; width:100%}
34
+ .clearlooks2 .mceBottom div {top:0}
35
+ .clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px}
36
+ .clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px}
37
+ .clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0}
38
+ .clearlooks2 .mceBottom span {display:none}
39
+ .clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px}
40
+ .clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0}
41
+ .clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px}
42
+ .clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0}
43
+ .clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px}
44
+
45
+ /* Actions */
46
+ .clearlooks2 a {width:29px; height:16px; top:3px;}
47
+ .clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0}
48
+ .clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0}
49
+ .clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0}
50
+ .clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0}
51
+ .clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px}
52
+ .clearlooks2 .mceMovable .mceMove {display:block}
53
+ .clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px}
54
+ .clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px}
55
+ .clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px}
56
+ .clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px}
57
+ .clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
58
+ .clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
59
+ .clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px}
60
+ .clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px}
61
+ .clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px}
62
+
63
+ /* Resize */
64
+ .clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px}
65
+ .clearlooks2 .mceResizable .mceResize {display:block}
66
+ .clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none}
67
+ .clearlooks2 .mceMinimizable .mceMin {display:block}
68
+ .clearlooks2 .mceMaximizable .mceMax {display:block}
69
+ .clearlooks2 .mceMaximized .mceMed {display:block}
70
+ .clearlooks2 .mceMaximized .mceMax {display:none}
71
+ .clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize}
72
+ .clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize}
73
+ .clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize}
74
+ .clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;}
75
+ .clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize}
76
+ .clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize}
77
+ .clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize}
78
+ .clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize}
79
+
80
+ /* Alert/Confirm */
81
+ .clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0}
82
+ .clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px}
83
+ .clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal}
84
+ .clearlooks2 a:hover {font-weight:bold;}
85
+ .clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5}
86
+ .clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px}
87
+ .clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)}
88
+ .clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px}
89
+ .clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto}
90
+ .clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)}
js/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js CHANGED
@@ -36,7 +36,7 @@
36
  alignright : {selector : alignElements, attributes : {align : 'right'}},
37
  alignfull : {selector : alignElements, attributes : {align : 'justify'}},
38
 
39
- // Change the basic formatting elements to use deprecated element types
40
  bold : [
41
  {inline : 'b', remove : 'all'},
42
  {inline : 'strong', remove : 'all'},
@@ -54,7 +54,7 @@
54
  strikethrough : [
55
  {inline : 'strike', remove : 'all'},
56
  {inline : 'span', styles : {textDecoration: 'line-through'}, exact : true}
57
- ],
58
 
59
  // Change font size and font family to use the deprecated font element
60
  fontname : {inline : 'font', attributes : {face : '%value'}},
36
  alignright : {selector : alignElements, attributes : {align : 'right'}},
37
  alignfull : {selector : alignElements, attributes : {align : 'justify'}},
38
 
39
+ // Change the basic formatting elements to use deprecated element types
40
  bold : [
41
  {inline : 'b', remove : 'all'},
42
  {inline : 'strong', remove : 'all'},
54
  strikethrough : [
55
  {inline : 'strike', remove : 'all'},
56
  {inline : 'span', styles : {textDecoration: 'line-through'}, exact : true}
57
+ ],
58
 
59
  // Change font size and font family to use the deprecated font element
60
  fontname : {inline : 'font', attributes : {face : '%value'}},
js/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js CHANGED
@@ -1,955 +1,955 @@
1
- /**
2
- * editor_plugin_src.js
3
- *
4
- * Copyright 2011, 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, Event = tinymce.dom.Event, bookmark;
13
-
14
- // Skips text nodes that only contain whitespace since they aren't semantically important.
15
- function skipWhitespaceNodes(e, next) {
16
- while (e && (e.nodeType === 8 || (e.nodeType === 3 && /^[ \t\n\r]*$/.test(e.nodeValue)))) {
17
- e = next(e);
18
- }
19
- return e;
20
- }
21
-
22
- function skipWhitespaceNodesBackwards(e) {
23
- return skipWhitespaceNodes(e, function(e) {
24
- return e.previousSibling;
25
- });
26
- }
27
-
28
- function skipWhitespaceNodesForwards(e) {
29
- return skipWhitespaceNodes(e, function(e) {
30
- return e.nextSibling;
31
- });
32
- }
33
-
34
- function hasParentInList(ed, e, list) {
35
- return ed.dom.getParent(e, function(p) {
36
- return tinymce.inArray(list, p) !== -1;
37
- });
38
- }
39
-
40
- function isList(e) {
41
- return e && (e.tagName === 'OL' || e.tagName === 'UL');
42
- }
43
-
44
- function splitNestedLists(element, dom) {
45
- var tmp, nested, wrapItem;
46
- tmp = skipWhitespaceNodesBackwards(element.lastChild);
47
- while (isList(tmp)) {
48
- nested = tmp;
49
- tmp = skipWhitespaceNodesBackwards(nested.previousSibling);
50
- }
51
- if (nested) {
52
- wrapItem = dom.create('li', { style: 'list-style-type: none;'});
53
- dom.split(element, nested);
54
- dom.insertAfter(wrapItem, nested);
55
- wrapItem.appendChild(nested);
56
- wrapItem.appendChild(nested);
57
- element = wrapItem.previousSibling;
58
- }
59
- return element;
60
- }
61
-
62
- function attemptMergeWithAdjacent(e, allowDifferentListStyles, mergeParagraphs) {
63
- e = attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs);
64
- return attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs);
65
- }
66
-
67
- function attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs) {
68
- var prev = skipWhitespaceNodesBackwards(e.previousSibling);
69
- if (prev) {
70
- return attemptMerge(prev, e, allowDifferentListStyles ? prev : false, mergeParagraphs);
71
- } else {
72
- return e;
73
- }
74
- }
75
-
76
- function attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs) {
77
- var next = skipWhitespaceNodesForwards(e.nextSibling);
78
- if (next) {
79
- return attemptMerge(e, next, allowDifferentListStyles ? next : false, mergeParagraphs);
80
- } else {
81
- return e;
82
- }
83
- }
84
-
85
- function attemptMerge(e1, e2, differentStylesMasterElement, mergeParagraphs) {
86
- if (canMerge(e1, e2, !!differentStylesMasterElement, mergeParagraphs)) {
87
- return merge(e1, e2, differentStylesMasterElement);
88
- } else if (e1 && e1.tagName === 'LI' && isList(e2)) {
89
- // Fix invalidly nested lists.
90
- e1.appendChild(e2);
91
- }
92
- return e2;
93
- }
94
-
95
- function canMerge(e1, e2, allowDifferentListStyles, mergeParagraphs) {
96
- if (!e1 || !e2) {
97
- return false;
98
- } else if (e1.tagName === 'LI' && e2.tagName === 'LI') {
99
- return e2.style.listStyleType === 'none' || containsOnlyAList(e2);
100
- } else if (isList(e1)) {
101
- return (e1.tagName === e2.tagName && (allowDifferentListStyles || e1.style.listStyleType === e2.style.listStyleType)) || isListForIndent(e2);
102
- } else return mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P';
103
- }
104
-
105
- function isListForIndent(e) {
106
- var firstLI = skipWhitespaceNodesForwards(e.firstChild), lastLI = skipWhitespaceNodesBackwards(e.lastChild);
107
- return firstLI && lastLI && isList(e) && firstLI === lastLI && (isList(firstLI) || firstLI.style.listStyleType === 'none' || containsOnlyAList(firstLI));
108
- }
109
-
110
- function containsOnlyAList(e) {
111
- var firstChild = skipWhitespaceNodesForwards(e.firstChild), lastChild = skipWhitespaceNodesBackwards(e.lastChild);
112
- return firstChild && lastChild && firstChild === lastChild && isList(firstChild);
113
- }
114
-
115
- function merge(e1, e2, masterElement) {
116
- var lastOriginal = skipWhitespaceNodesBackwards(e1.lastChild), firstNew = skipWhitespaceNodesForwards(e2.firstChild);
117
- if (e1.tagName === 'P') {
118
- e1.appendChild(e1.ownerDocument.createElement('br'));
119
- }
120
- while (e2.firstChild) {
121
- e1.appendChild(e2.firstChild);
122
- }
123
- if (masterElement) {
124
- e1.style.listStyleType = masterElement.style.listStyleType;
125
- }
126
- e2.parentNode.removeChild(e2);
127
- attemptMerge(lastOriginal, firstNew, false);
128
- return e1;
129
- }
130
-
131
- function findItemToOperateOn(e, dom) {
132
- var item;
133
- if (!dom.is(e, 'li,ol,ul')) {
134
- item = dom.getParent(e, 'li');
135
- if (item) {
136
- e = item;
137
- }
138
- }
139
- return e;
140
- }
141
-
142
- tinymce.create('tinymce.plugins.Lists', {
143
- init: function(ed) {
144
- var LIST_TABBING = 'TABBING';
145
- var LIST_EMPTY_ITEM = 'EMPTY';
146
- var LIST_ESCAPE = 'ESCAPE';
147
- var LIST_PARAGRAPH = 'PARAGRAPH';
148
- var LIST_UNKNOWN = 'UNKNOWN';
149
- var state = LIST_UNKNOWN;
150
-
151
- function isTabInList(e) {
152
- // Don't indent on Ctrl+Tab or Alt+Tab
153
- return e.keyCode === tinymce.VK.TAB && !(e.altKey || e.ctrlKey) &&
154
- (ed.queryCommandState('InsertUnorderedList') || ed.queryCommandState('InsertOrderedList'));
155
- }
156
-
157
- function isOnLastListItem() {
158
- var li = getLi();
159
- var grandParent = li.parentNode.parentNode;
160
- var isLastItem = li.parentNode.lastChild === li;
161
- return isLastItem && !isNestedList(grandParent) && isEmptyListItem(li);
162
- }
163
-
164
- function isNestedList(grandParent) {
165
- if (isList(grandParent)) {
166
- return grandParent.parentNode && grandParent.parentNode.tagName === 'LI';
167
- } else {
168
- return grandParent.tagName === 'LI';
169
- }
170
- }
171
-
172
- function isInEmptyListItem() {
173
- return ed.selection.isCollapsed() && isEmptyListItem(getLi());
174
- }
175
-
176
- function getLi() {
177
- var n = ed.selection.getStart();
178
- // Get start will return BR if the LI only contains a BR or an empty element as we use these to fix caret position
179
- return ((n.tagName == 'BR' || n.tagName == '') && n.parentNode.tagName == 'LI') ? n.parentNode : n;
180
- }
181
-
182
- function isEmptyListItem(li) {
183
- var numChildren = li.childNodes.length;
184
- if (li.tagName === 'LI') {
185
- return numChildren == 0 ? true : numChildren == 1 && (li.firstChild.tagName == '' || li.firstChild.tagName == 'BR' || isEmptyIE9Li(li));
186
- }
187
- return false;
188
- }
189
-
190
- function isEmptyIE9Li(li) {
191
- // only consider this to be last item if there is no list item content or that content is nbsp or space since IE9 creates these
192
- var lis = tinymce.grep(li.parentNode.childNodes, function(n) {return n.tagName == 'LI'});
193
- var isLastLi = li == lis[lis.length - 1];
194
- var child = li.firstChild;
195
- return tinymce.isIE9 && isLastLi && (child.nodeValue == String.fromCharCode(160) || child.nodeValue == String.fromCharCode(32));
196
- }
197
-
198
- function isEnter(e) {
199
- return e.keyCode === tinymce.VK.ENTER;
200
- }
201
-
202
- function isEnterWithoutShift(e) {
203
- return isEnter(e) && !e.shiftKey;
204
- }
205
-
206
- function getListKeyState(e) {
207
- if (isTabInList(e)) {
208
- return LIST_TABBING;
209
- } else if (isEnterWithoutShift(e) && isOnLastListItem()) {
210
- // Returns LIST_UNKNOWN since breaking out of lists is handled by the EnterKey.js logic now
211
- //return LIST_ESCAPE;
212
- return LIST_UNKNOWN;
213
- } else if (isEnterWithoutShift(e) && isInEmptyListItem()) {
214
- return LIST_EMPTY_ITEM;
215
- } else {
216
- return LIST_UNKNOWN;
217
- }
218
- }
219
-
220
- function cancelDefaultEvents(ed, e) {
221
- // list escape is done manually using outdent as it does not create paragraphs correctly in td's
222
- if (state == LIST_TABBING || state == LIST_EMPTY_ITEM || tinymce.isGecko && state == LIST_ESCAPE) {
223
- Event.cancel(e);
224
- }
225
- }
226
-
227
- function isCursorAtEndOfContainer() {
228
- var range = ed.selection.getRng(true);
229
- var startContainer = range.startContainer;
230
- if (startContainer.nodeType == 3) {
231
- var value = startContainer.nodeValue;
232
- if (tinymce.isIE9 && value.length > 1 && value.charCodeAt(value.length-1) == 32) {
233
- // IE9 places a space on the end of the text in some cases so ignore last char
234
- return (range.endOffset == value.length-1);
235
- } else {
236
- return (range.endOffset == value.length);
237
- }
238
- } else if (startContainer.nodeType == 1) {
239
- return range.endOffset == startContainer.childNodes.length;
240
- }
241
- return false;
242
- }
243
-
244
- /*
245
- If we are at the end of a list item surrounded with an element, pressing enter should create a
246
- new list item instead without splitting the element e.g. don't want to create new P or H1 tag
247
- */
248
- function isEndOfListItem() {
249
- var node = ed.selection.getNode();
250
- var validElements = 'h1,h2,h3,h4,h5,h6,p,div';
251
- var isLastParagraphOfLi = ed.dom.is(node, validElements) && node.parentNode.tagName === 'LI' && node.parentNode.lastChild === node;
252
- return ed.selection.isCollapsed() && isLastParagraphOfLi && isCursorAtEndOfContainer();
253
- }
254
-
255
- // Creates a new list item after the current selection's list item parent
256
- function createNewLi(ed, e) {
257
- if (isEnterWithoutShift(e) && isEndOfListItem()) {
258
- var node = ed.selection.getNode();
259
- var li = ed.dom.create("li");
260
- var parentLi = ed.dom.getParent(node, 'li');
261
- ed.dom.insertAfter(li, parentLi);
262
-
263
- // Move caret to new list element.
264
- if (tinymce.isIE6 || tinymce.isIE7 || tinyMCE.isIE8) {
265
- // Removed this line since it would create an odd <&nbsp;> tag and placing the caret inside an empty LI is handled and should be handled by the selection logic
266
- //li.appendChild(ed.dom.create("&nbsp;")); // IE needs an element within the bullet point
267
- ed.selection.setCursorLocation(li, 1);
268
- } else {
269
- ed.selection.setCursorLocation(li, 0);
270
- }
271
- e.preventDefault();
272
- }
273
- }
274
-
275
- function imageJoiningListItem(ed, e) {
276
- var prevSibling;
277
-
278
- if (!tinymce.isGecko)
279
- return;
280
-
281
- var n = ed.selection.getStart();
282
- if (e.keyCode != tinymce.VK.BACKSPACE || n.tagName !== 'IMG')
283
- return;
284
-
285
- function lastLI(node) {
286
- var child = node.firstChild;
287
- var li = null;
288
- do {
289
- if (!child)
290
- break;
291
-
292
- if (child.tagName === 'LI')
293
- li = child;
294
- } while (child = child.nextSibling);
295
-
296
- return li;
297
- }
298
-
299
- function addChildren(parentNode, destination) {
300
- while (parentNode.childNodes.length > 0)
301
- destination.appendChild(parentNode.childNodes[0]);
302
- }
303
-
304
- // Check if there is a previous sibling
305
- prevSibling = n.parentNode.previousSibling;
306
- if (!prevSibling)
307
- return;
308
-
309
- var ul;
310
- if (prevSibling.tagName === 'UL' || prevSibling.tagName === 'OL')
311
- ul = prevSibling;
312
- else if (prevSibling.previousSibling && (prevSibling.previousSibling.tagName === 'UL' || prevSibling.previousSibling.tagName === 'OL'))
313
- ul = prevSibling.previousSibling;
314
- else
315
- return;
316
-
317
- var li = lastLI(ul);
318
-
319
- // move the caret to the end of the list item
320
- var rng = ed.dom.createRng();
321
- rng.setStart(li, 1);
322
- rng.setEnd(li, 1);
323
- ed.selection.setRng(rng);
324
- ed.selection.collapse(true);
325
-
326
- // save a bookmark at the end of the list item
327
- var bookmark = ed.selection.getBookmark();
328
-
329
- // copy the image an its text to the list item
330
- var clone = n.parentNode.cloneNode(true);
331
- if (clone.tagName === 'P' || clone.tagName === 'DIV')
332
- addChildren(clone, li);
333
- else
334
- li.appendChild(clone);
335
-
336
- // remove the old copy of the image
337
- n.parentNode.parentNode.removeChild(n.parentNode);
338
-
339
- // move the caret where we saved the bookmark
340
- ed.selection.moveToBookmark(bookmark);
341
- }
342
-
343
- // fix the cursor position to ensure it is correct in IE
344
- function setCursorPositionToOriginalLi(li) {
345
- var list = ed.dom.getParent(li, 'ol,ul');
346
- if (list != null) {
347
- var lastLi = list.lastChild;
348
- // Removed this line since IE9 would report an DOM character error and placing the caret inside an empty LI is handled and should be handled by the selection logic
349
- //lastLi.appendChild(ed.getDoc().createElement(''));
350
- ed.selection.setCursorLocation(lastLi, 0);
351
- }
352
- }
353
-
354
- this.ed = ed;
355
- ed.addCommand('Indent', this.indent, this);
356
- ed.addCommand('Outdent', this.outdent, this);
357
- ed.addCommand('InsertUnorderedList', function() {
358
- this.applyList('UL', 'OL');
359
- }, this);
360
- ed.addCommand('InsertOrderedList', function() {
361
- this.applyList('OL', 'UL');
362
- }, this);
363
-
364
- ed.onInit.add(function() {
365
- ed.editorCommands.addCommands({
366
- 'outdent': function() {
367
- var sel = ed.selection, dom = ed.dom;
368
-
369
- function hasStyleIndent(n) {
370
- n = dom.getParent(n, dom.isBlock);
371
- return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0;
372
- }
373
-
374
- return hasStyleIndent(sel.getStart()) || hasStyleIndent(sel.getEnd()) || ed.queryCommandState('InsertOrderedList') || ed.queryCommandState('InsertUnorderedList');
375
- }
376
- }, 'state');
377
- });
378
-
379
- ed.onKeyUp.add(function(ed, e) {
380
- if (state == LIST_TABBING) {
381
- ed.execCommand(e.shiftKey ? 'Outdent' : 'Indent', true, null);
382
- state = LIST_UNKNOWN;
383
- return Event.cancel(e);
384
- } else if (state == LIST_EMPTY_ITEM) {
385
- var li = getLi();
386
- var shouldOutdent = ed.settings.list_outdent_on_enter === true || e.shiftKey;
387
- ed.execCommand(shouldOutdent ? 'Outdent' : 'Indent', true, null);
388
- if (tinymce.isIE) {
389
- setCursorPositionToOriginalLi(li);
390
- }
391
-
392
- return Event.cancel(e);
393
- } else if (state == LIST_ESCAPE) {
394
- if (tinymce.isIE6 || tinymce.isIE7 || tinymce.isIE8) {
395
- // append a zero sized nbsp so that caret is positioned correctly in IE after escaping and applying formatting.
396
- // if there is no text then applying formatting for e.g a H1 to the P tag immediately following list after
397
- // escaping from it will cause the caret to be positioned on the last li instead of staying the in P tag.
398
- var n = ed.getDoc().createTextNode('\uFEFF');
399
- ed.selection.getNode().appendChild(n);
400
- } else if (tinymce.isIE9 || tinymce.isGecko) {
401
- // IE9 does not escape the list so we use outdent to do this and cancel the default behaviour
402
- // Gecko does not create a paragraph outdenting inside a TD so default behaviour is cancelled and we outdent ourselves
403
- ed.execCommand('Outdent');
404
- return Event.cancel(e);
405
- }
406
- }
407
- });
408
-
409
- function fixListItem(parent, reference) {
410
- // a zero-sized non-breaking space is placed in the empty list item so that the nested list is
411
- // displayed on the below line instead of next to it
412
- var n = ed.getDoc().createTextNode('\uFEFF');
413
- parent.insertBefore(n, reference);
414
- ed.selection.setCursorLocation(n, 0);
415
- // repaint to remove rendering artifact. only visible when creating new list
416
- ed.execCommand('mceRepaint');
417
- }
418
-
419
- function fixIndentedListItemForGecko(ed, e) {
420
- if (isEnter(e)) {
421
- var li = getLi();
422
- if (li) {
423
- var parent = li.parentNode;
424
- var grandParent = parent && parent.parentNode;
425
- if (grandParent && grandParent.nodeName == 'LI' && grandParent.firstChild == parent && li == parent.firstChild) {
426
- fixListItem(grandParent, parent);
427
- }
428
- }
429
- }
430
- }
431
-
432
- function fixIndentedListItemForIE8(ed, e) {
433
- if (isEnter(e)) {
434
- var li = getLi();
435
- if (ed.dom.select('ul li', li).length === 1) {
436
- var list = li.firstChild;
437
- fixListItem(li, list);
438
- }
439
- }
440
- }
441
-
442
- function fixDeletingFirstCharOfList(ed, e) {
443
- function listElements(li) {
444
- var elements = [];
445
- var walker = new tinymce.dom.TreeWalker(li.firstChild, li);
446
- for (var node = walker.current(); node; node = walker.next()) {
447
- if (ed.dom.is(node, 'ol,ul,li')) {
448
- elements.push(node);
449
- }
450
- }
451
- return elements;
452
- }
453
-
454
- if (e.keyCode == tinymce.VK.BACKSPACE) {
455
- var li = getLi();
456
- if (li) {
457
- var list = ed.dom.getParent(li, 'ol,ul'),
458
- rng = ed.selection.getRng();
459
- if (list && list.firstChild === li && rng.startOffset == 0) {
460
- var elements = listElements(li);
461
- elements.unshift(li);
462
- ed.execCommand("Outdent", false, elements);
463
- ed.undoManager.add();
464
- return Event.cancel(e);
465
- }
466
- }
467
- }
468
- }
469
-
470
- function fixDeletingEmptyLiInWebkit(ed, e) {
471
- var li = getLi();
472
- if (e.keyCode === tinymce.VK.BACKSPACE && ed.dom.is(li, 'li') && li.parentNode.firstChild!==li) {
473
- if (ed.dom.select('ul,ol', li).length === 1) {
474
- var prevLi = li.previousSibling;
475
- ed.dom.remove(ed.dom.select('br', li));
476
- ed.dom.remove(li, true);
477
- var textNodes = tinymce.grep(prevLi.childNodes, function(n){ return n.nodeType === 3 });
478
- if (textNodes.length === 1) {
479
- var textNode = textNodes[0];
480
- ed.selection.setCursorLocation(textNode, textNode.length);
481
- }
482
- ed.undoManager.add();
483
- return Event.cancel(e);
484
- }
485
- }
486
- }
487
-
488
- ed.onKeyDown.add(function(_, e) { state = getListKeyState(e); });
489
- ed.onKeyDown.add(cancelDefaultEvents);
490
- ed.onKeyDown.add(imageJoiningListItem);
491
- ed.onKeyDown.add(createNewLi);
492
-
493
- if (tinymce.isGecko) {
494
- ed.onKeyUp.add(fixIndentedListItemForGecko);
495
- }
496
- if (tinymce.isIE8) {
497
- ed.onKeyUp.add(fixIndentedListItemForIE8);
498
- }
499
- if (tinymce.isGecko || tinymce.isWebKit) {
500
- ed.onKeyDown.add(fixDeletingFirstCharOfList);
501
- }
502
- if (tinymce.isWebKit) {
503
- ed.onKeyDown.add(fixDeletingEmptyLiInWebkit);
504
- }
505
- },
506
-
507
- applyList: function(targetListType, oppositeListType) {
508
- var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions,
509
- selectedBlocks = ed.selection.getSelectedBlocks();
510
-
511
- function cleanupBr(e) {
512
- if (e && e.tagName === 'BR') {
513
- dom.remove(e);
514
- }
515
- }
516
-
517
- function makeList(element) {
518
- var list = dom.create(targetListType), li;
519
-
520
- function adjustIndentForNewList(element) {
521
- // If there's a margin-left, outdent one level to account for the extra list margin.
522
- if (element.style.marginLeft || element.style.paddingLeft) {
523
- t.adjustPaddingFunction(false)(element);
524
- }
525
- }
526
-
527
- if (element.tagName === 'LI') {
528
- // No change required.
529
- } else if (element.tagName === 'P' || element.tagName === 'DIV' || element.tagName === 'BODY') {
530
- processBrs(element, function(startSection, br) {
531
- doWrapList(startSection, br, element.tagName === 'BODY' ? null : startSection.parentNode);
532
- li = startSection.parentNode;
533
- adjustIndentForNewList(li);
534
- cleanupBr(br);
535
- });
536
- if (li) {
537
- if (li.tagName === 'LI' && (element.tagName === 'P' || selectedBlocks.length > 1)) {
538
- dom.split(li.parentNode.parentNode, li.parentNode);
539
- }
540
- attemptMergeWithAdjacent(li.parentNode, true);
541
- }
542
- return;
543
- } else {
544
- // Put the list around the element.
545
- li = dom.create('li');
546
- dom.insertAfter(li, element);
547
- li.appendChild(element);
548
- adjustIndentForNewList(element);
549
- element = li;
550
- }
551
- dom.insertAfter(list, element);
552
- list.appendChild(element);
553
- attemptMergeWithAdjacent(list, true);
554
- applied.push(element);
555
- }
556
-
557
- function doWrapList(start, end, template) {
558
- var li, n = start, tmp;
559
- while (!dom.isBlock(start.parentNode) && start.parentNode !== dom.getRoot()) {
560
- start = dom.split(start.parentNode, start.previousSibling);
561
- start = start.nextSibling;
562
- n = start;
563
- }
564
- if (template) {
565
- li = template.cloneNode(true);
566
- start.parentNode.insertBefore(li, start);
567
- while (li.firstChild) dom.remove(li.firstChild);
568
- li = dom.rename(li, 'li');
569
- } else {
570
- li = dom.create('li');
571
- start.parentNode.insertBefore(li, start);
572
- }
573
- while (n && n != end) {
574
- tmp = n.nextSibling;
575
- li.appendChild(n);
576
- n = tmp;
577
- }
578
- if (li.childNodes.length === 0) {
579
- li.innerHTML = '<br _mce_bogus="1" />';
580
- }
581
- makeList(li);
582
- }
583
-
584
- function processBrs(element, callback) {
585
- var startSection, previousBR, END_TO_START = 3, START_TO_END = 1,
586
- breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl';
587
-
588
- function isAnyPartSelected(start, end) {
589
- var r = dom.createRng(), sel;
590
- bookmark.keep = true;
591
- ed.selection.moveToBookmark(bookmark);
592
- bookmark.keep = false;
593
- sel = ed.selection.getRng(true);
594
- if (!end) {
595
- end = start.parentNode.lastChild;
596
- }
597
- r.setStartBefore(start);
598
- r.setEndAfter(end);
599
- return !(r.compareBoundaryPoints(END_TO_START, sel) > 0 || r.compareBoundaryPoints(START_TO_END, sel) <= 0);
600
- }
601
-
602
- function nextLeaf(br) {
603
- if (br.nextSibling)
604
- return br.nextSibling;
605
- if (!dom.isBlock(br.parentNode) && br.parentNode !== dom.getRoot())
606
- return nextLeaf(br.parentNode);
607
- }
608
-
609
- // Split on BRs within the range and process those.
610
- startSection = element.firstChild;
611
- // First mark the BRs that have any part of the previous section selected.
612
- var trailingContentSelected = false;
613
- each(dom.select(breakElements, element), function(br) {
614
- if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
615
- return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
616
- }
617
- if (isAnyPartSelected(startSection, br)) {
618
- dom.addClass(br, '_mce_tagged_br');
619
- startSection = nextLeaf(br);
620
- }
621
- });
622
- trailingContentSelected = (startSection && isAnyPartSelected(startSection, undefined));
623
- startSection = element.firstChild;
624
- each(dom.select(breakElements, element), function(br) {
625
- // Got a section from start to br.
626
- var tmp = nextLeaf(br);
627
- if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
628
- return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
629
- }
630
- if (dom.hasClass(br, '_mce_tagged_br')) {
631
- callback(startSection, br, previousBR);
632
- previousBR = null;
633
- } else {
634
- previousBR = br;
635
- }
636
- startSection = tmp;
637
- });
638
- if (trailingContentSelected) {
639
- callback(startSection, undefined, previousBR);
640
- }
641
- }
642
-
643
- function wrapList(element) {
644
- processBrs(element, function(startSection, br, previousBR) {
645
- // Need to indent this part
646
- doWrapList(startSection, br);
647
- cleanupBr(br);
648
- cleanupBr(previousBR);
649
- });
650
- }
651
-
652
- function changeList(element) {
653
- if (tinymce.inArray(applied, element) !== -1) {
654
- return;
655
- }
656
- if (element.parentNode.tagName === oppositeListType) {
657
- dom.split(element.parentNode, element);
658
- makeList(element);
659
- attemptMergeWithNext(element.parentNode, false);
660
- }
661
- applied.push(element);
662
- }
663
-
664
- function convertListItemToParagraph(element) {
665
- var child, nextChild, mergedElement, splitLast;
666
- if (tinymce.inArray(applied, element) !== -1) {
667
- return;
668
- }
669
- element = splitNestedLists(element, dom);
670
- while (dom.is(element.parentNode, 'ol,ul,li')) {
671
- dom.split(element.parentNode, element);
672
- }
673
- // Push the original element we have from the selection, not the renamed one.
674
- applied.push(element);
675
- element = dom.rename(element, 'p');
676
- mergedElement = attemptMergeWithAdjacent(element, false, ed.settings.force_br_newlines);
677
- if (mergedElement === element) {
678
- // Now split out any block elements that can't be contained within a P.
679
- // Manually iterate to ensure we handle modifications correctly (doesn't work with tinymce.each)
680
- child = element.firstChild;
681
- while (child) {
682
- if (dom.isBlock(child)) {
683
- child = dom.split(child.parentNode, child);
684
- splitLast = true;
685
- nextChild = child.nextSibling && child.nextSibling.firstChild;
686
- } else {
687
- nextChild = child.nextSibling;
688
- if (splitLast && child.tagName === 'BR') {
689
- dom.remove(child);
690
- }
691
- splitLast = false;
692
- }
693
- child = nextChild;
694
- }
695
- }
696
- }
697
-
698
- each(selectedBlocks, function(e) {
699
- e = findItemToOperateOn(e, dom);
700
- if (e.tagName === oppositeListType || (e.tagName === 'LI' && e.parentNode.tagName === oppositeListType)) {
701
- hasOppositeType = true;
702
- } else if (e.tagName === targetListType || (e.tagName === 'LI' && e.parentNode.tagName === targetListType)) {
703
- hasSameType = true;
704
- } else {
705
- hasNonList = true;
706
- }
707
- });
708
-
709
- if (hasNonList &&!hasSameType || hasOppositeType || selectedBlocks.length === 0) {
710
- actions = {
711
- 'LI': changeList,
712
- 'H1': makeList,
713
- 'H2': makeList,
714
- 'H3': makeList,
715
- 'H4': makeList,
716
- 'H5': makeList,
717
- 'H6': makeList,
718
- 'P': makeList,
719
- 'BODY': makeList,
720
- 'DIV': selectedBlocks.length > 1 ? makeList : wrapList,
721
- defaultAction: wrapList,
722
- elements: this.selectedBlocks()
723
- };
724
- } else {
725
- actions = {
726
- defaultAction: convertListItemToParagraph,
727
- elements: this.selectedBlocks(),
728
- processEvenIfEmpty: true
729
- };
730
- }
731
- this.process(actions);
732
- },
733
-
734
- indent: function() {
735
- var ed = this.ed, dom = ed.dom, indented = [];
736
-
737
- function createWrapItem(element) {
738
- var wrapItem = dom.create('li', { style: 'list-style-type: none;'});
739
- dom.insertAfter(wrapItem, element);
740
- return wrapItem;
741
- }
742
-
743
- function createWrapList(element) {
744
- var wrapItem = createWrapItem(element),
745
- list = dom.getParent(element, 'ol,ul'),
746
- listType = list.tagName,
747
- listStyle = dom.getStyle(list, 'list-style-type'),
748
- attrs = {},
749
- wrapList;
750
- if (listStyle !== '') {
751
- attrs.style = 'list-style-type: ' + listStyle + ';';
752
- }
753
- wrapList = dom.create(listType, attrs);
754
- wrapItem.appendChild(wrapList);
755
- return wrapList;
756
- }
757
-
758
- function indentLI(element) {
759
- if (!hasParentInList(ed, element, indented)) {
760
- element = splitNestedLists(element, dom);
761
- var wrapList = createWrapList(element);
762
- wrapList.appendChild(element);
763
- attemptMergeWithAdjacent(wrapList.parentNode, false);
764
- attemptMergeWithAdjacent(wrapList, false);
765
- indented.push(element);
766
- }
767
- }
768
-
769
- this.process({
770
- 'LI': indentLI,
771
- defaultAction: this.adjustPaddingFunction(true),
772
- elements: this.selectedBlocks()
773
- });
774
-
775
- },
776
-
777
- outdent: function(ui, elements) {
778
- var t = this, ed = t.ed, dom = ed.dom, outdented = [];
779
-
780
- function outdentLI(element) {
781
- var listElement, targetParent, align;
782
- if (!hasParentInList(ed, element, outdented)) {
783
- if (dom.getStyle(element, 'margin-left') !== '' || dom.getStyle(element, 'padding-left') !== '') {
784
- return t.adjustPaddingFunction(false)(element);
785
- }
786
- align = dom.getStyle(element, 'text-align', true);
787
- if (align === 'center' || align === 'right') {
788
- dom.setStyle(element, 'text-align', 'left');
789
- return;
790
- }
791
- element = splitNestedLists(element, dom);
792
- listElement = element.parentNode;
793
- targetParent = element.parentNode.parentNode;
794
- if (targetParent.tagName === 'P') {
795
- dom.split(targetParent, element.parentNode);
796
- } else {
797
- dom.split(listElement, element);
798
- if (targetParent.tagName === 'LI') {
799
- // Nested list, need to split the LI and go back out to the OL/UL element.
800
- dom.split(targetParent, element);
801
- } else if (!dom.is(targetParent, 'ol,ul')) {
802
- dom.rename(element, 'p');
803
- }
804
- }
805
- outdented.push(element);
806
- }
807
- }
808
-
809
- var listElements = elements && tinymce.is(elements, 'array') ? elements : this.selectedBlocks();
810
- this.process({
811
- 'LI': outdentLI,
812
- defaultAction: this.adjustPaddingFunction(false),
813
- elements: listElements
814
- });
815
-
816
- each(outdented, attemptMergeWithAdjacent);
817
- },
818
-
819
- process: function(actions) {
820
- var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r;
821
-
822
- function isEmptyElement(element) {
823
- var excludeBrsAndBookmarks = tinymce.grep(element.childNodes, function(n) {
824
- return !(n.nodeName === 'BR' || n.nodeName === 'SPAN' && dom.getAttrib(n, 'data-mce-type') == 'bookmark'
825
- || n.nodeType == 3 && (n.nodeValue == String.fromCharCode(160) || n.nodeValue == ''));
826
- });
827
- return excludeBrsAndBookmarks.length === 0;
828
- }
829
-
830
- function processElement(element) {
831
- dom.removeClass(element, '_mce_act_on');
832
- if (!element || element.nodeType !== 1 || ! actions.processEvenIfEmpty && selectedBlocks.length > 1 && isEmptyElement(element)) {
833
- return;
834
- }
835
- element = findItemToOperateOn(element, dom);
836
- var action = actions[element.tagName];
837
- if (!action) {
838
- action = actions.defaultAction;
839
- }
840
- action(element);
841
- }
842
-
843
- function recurse(element) {
844
- t.splitSafeEach(element.childNodes, processElement, true);
845
- }
846
-
847
- function brAtEdgeOfSelection(container, offset) {
848
- return offset >= 0 && container.hasChildNodes() && offset < container.childNodes.length &&
849
- container.childNodes[offset].tagName === 'BR';
850
- }
851
-
852
- function isInTable() {
853
- var n = sel.getNode();
854
- var p = dom.getParent(n, 'td');
855
- return p !== null;
856
- }
857
-
858
- selectedBlocks = actions.elements;
859
-
860
- r = sel.getRng(true);
861
- if (!r.collapsed) {
862
- if (brAtEdgeOfSelection(r.endContainer, r.endOffset - 1)) {
863
- r.setEnd(r.endContainer, r.endOffset - 1);
864
- sel.setRng(r);
865
- }
866
- if (brAtEdgeOfSelection(r.startContainer, r.startOffset)) {
867
- r.setStart(r.startContainer, r.startOffset + 1);
868
- sel.setRng(r);
869
- }
870
- }
871
-
872
-
873
- if (tinymce.isIE8) {
874
- // append a zero sized nbsp so that caret is restored correctly using bookmark
875
- var s = t.ed.selection.getNode();
876
- if (s.tagName === 'LI' && !(s.parentNode.lastChild === s)) {
877
- var i = t.ed.getDoc().createTextNode('\uFEFF');
878
- s.appendChild(i);
879
- }
880
- }
881
-
882
- bookmark = sel.getBookmark();
883
- actions.OL = actions.UL = recurse;
884
- t.splitSafeEach(selectedBlocks, processElement);
885
- sel.moveToBookmark(bookmark);
886
- bookmark = null;
887
-
888
- // we avoid doing repaint in a table as this will move the caret out of the table in Firefox 3.6
889
- if (!isInTable()) {
890
- // Avoids table or image handles being left behind in Firefox.
891
- t.ed.execCommand('mceRepaint');
892
- }
893
- },
894
-
895
- splitSafeEach: function(elements, f, forceClassBase) {
896
- if (forceClassBase ||
897
- (tinymce.isGecko &&
898
- (/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) ||
899
- /Firefox\/3\.[0-4]/.test(navigator.userAgent)))) {
900
- this.classBasedEach(elements, f);
901
- } else {
902
- each(elements, f);
903
- }
904
- },
905
-
906
- classBasedEach: function(elements, f) {
907
- var dom = this.ed.dom, nodes, element;
908
- // Mark nodes
909
- each(elements, function(element) {
910
- dom.addClass(element, '_mce_act_on');
911
- });
912
- nodes = dom.select('._mce_act_on');
913
- while (nodes.length > 0) {
914
- element = nodes.shift();
915
- dom.removeClass(element, '_mce_act_on');
916
- f(element);
917
- nodes = dom.select('._mce_act_on');
918
- }
919
- },
920
-
921
- adjustPaddingFunction: function(isIndent) {
922
- var indentAmount, indentUnits, ed = this.ed;
923
- indentAmount = ed.settings.indentation;
924
- indentUnits = /[a-z%]+/i.exec(indentAmount);
925
- indentAmount = parseInt(indentAmount, 10);
926
- return function(element) {
927
- var currentIndent, newIndentAmount;
928
- currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10);
929
- if (isIndent) {
930
- newIndentAmount = currentIndent + indentAmount;
931
- } else {
932
- newIndentAmount = currentIndent - indentAmount;
933
- }
934
- ed.dom.setStyle(element, 'padding-left', '');
935
- ed.dom.setStyle(element, 'margin-left', newIndentAmount > 0 ? newIndentAmount + indentUnits : '');
936
- };
937
- },
938
-
939
- selectedBlocks: function() {
940
- var ed = this.ed, selectedBlocks = ed.selection.getSelectedBlocks();
941
- return selectedBlocks.length == 0 ? [ ed.dom.getRoot() ] : selectedBlocks;
942
- },
943
-
944
- getInfo: function() {
945
- return {
946
- longname : 'Lists',
947
- author : 'Moxiecode Systems AB',
948
- authorurl : 'http://tinymce.moxiecode.com',
949
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists',
950
- version : tinymce.majorVersion + "." + tinymce.minorVersion
951
- };
952
- }
953
- });
954
- tinymce.PluginManager.add("lists", tinymce.plugins.Lists);
955
- }());
1
+ /**
2
+ * editor_plugin_src.js
3
+ *
4
+ * Copyright 2011, 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, Event = tinymce.dom.Event, bookmark;
13
+
14
+ // Skips text nodes that only contain whitespace since they aren't semantically important.
15
+ function skipWhitespaceNodes(e, next) {
16
+ while (e && (e.nodeType === 8 || (e.nodeType === 3 && /^[ \t\n\r]*$/.test(e.nodeValue)))) {
17
+ e = next(e);
18
+ }
19
+ return e;
20
+ }
21
+
22
+ function skipWhitespaceNodesBackwards(e) {
23
+ return skipWhitespaceNodes(e, function(e) {
24
+ return e.previousSibling;
25
+ });
26
+ }
27
+
28
+ function skipWhitespaceNodesForwards(e) {
29
+ return skipWhitespaceNodes(e, function(e) {
30
+ return e.nextSibling;
31
+ });
32
+ }
33
+
34
+ function hasParentInList(ed, e, list) {
35
+ return ed.dom.getParent(e, function(p) {
36
+ return tinymce.inArray(list, p) !== -1;
37
+ });
38
+ }
39
+
40
+ function isList(e) {
41
+ return e && (e.tagName === 'OL' || e.tagName === 'UL');
42
+ }
43
+
44
+ function splitNestedLists(element, dom) {
45
+ var tmp, nested, wrapItem;
46
+ tmp = skipWhitespaceNodesBackwards(element.lastChild);
47
+ while (isList(tmp)) {
48
+ nested = tmp;
49
+ tmp = skipWhitespaceNodesBackwards(nested.previousSibling);
50
+ }
51
+ if (nested) {
52
+ wrapItem = dom.create('li', { style: 'list-style-type: none;'});
53
+ dom.split(element, nested);
54
+ dom.insertAfter(wrapItem, nested);
55
+ wrapItem.appendChild(nested);
56
+ wrapItem.appendChild(nested);
57
+ element = wrapItem.previousSibling;
58
+ }
59
+ return element;
60
+ }
61
+
62
+ function attemptMergeWithAdjacent(e, allowDifferentListStyles, mergeParagraphs) {
63
+ e = attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs);
64
+ return attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs);
65
+ }
66
+
67
+ function attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs) {
68
+ var prev = skipWhitespaceNodesBackwards(e.previousSibling);
69
+ if (prev) {
70
+ return attemptMerge(prev, e, allowDifferentListStyles ? prev : false, mergeParagraphs);
71
+ } else {
72
+ return e;
73
+ }
74
+ }
75
+
76
+ function attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs) {
77
+ var next = skipWhitespaceNodesForwards(e.nextSibling);
78
+ if (next) {
79
+ return attemptMerge(e, next, allowDifferentListStyles ? next : false, mergeParagraphs);
80
+ } else {
81
+ return e;
82
+ }
83
+ }
84
+
85
+ function attemptMerge(e1, e2, differentStylesMasterElement, mergeParagraphs) {
86
+ if (canMerge(e1, e2, !!differentStylesMasterElement, mergeParagraphs)) {
87
+ return merge(e1, e2, differentStylesMasterElement);
88
+ } else if (e1 && e1.tagName === 'LI' && isList(e2)) {
89
+ // Fix invalidly nested lists.
90
+ e1.appendChild(e2);
91
+ }
92
+ return e2;
93
+ }
94
+
95
+ function canMerge(e1, e2, allowDifferentListStyles, mergeParagraphs) {
96
+ if (!e1 || !e2) {
97
+ return false;
98
+ } else if (e1.tagName === 'LI' && e2.tagName === 'LI') {
99
+ return e2.style.listStyleType === 'none' || containsOnlyAList(e2);
100
+ } else if (isList(e1)) {
101
+ return (e1.tagName === e2.tagName && (allowDifferentListStyles || e1.style.listStyleType === e2.style.listStyleType)) || isListForIndent(e2);
102
+ } else return mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P';
103
+ }
104
+
105
+ function isListForIndent(e) {
106
+ var firstLI = skipWhitespaceNodesForwards(e.firstChild), lastLI = skipWhitespaceNodesBackwards(e.lastChild);
107
+ return firstLI && lastLI && isList(e) && firstLI === lastLI && (isList(firstLI) || firstLI.style.listStyleType === 'none' || containsOnlyAList(firstLI));
108
+ }
109
+
110
+ function containsOnlyAList(e) {
111
+ var firstChild = skipWhitespaceNodesForwards(e.firstChild), lastChild = skipWhitespaceNodesBackwards(e.lastChild);
112
+ return firstChild && lastChild && firstChild === lastChild && isList(firstChild);
113
+ }
114
+
115
+ function merge(e1, e2, masterElement) {
116
+ var lastOriginal = skipWhitespaceNodesBackwards(e1.lastChild), firstNew = skipWhitespaceNodesForwards(e2.firstChild);
117
+ if (e1.tagName === 'P') {
118
+ e1.appendChild(e1.ownerDocument.createElement('br'));
119
+ }
120
+ while (e2.firstChild) {
121
+ e1.appendChild(e2.firstChild);
122
+ }
123
+ if (masterElement) {
124
+ e1.style.listStyleType = masterElement.style.listStyleType;
125
+ }
126
+ e2.parentNode.removeChild(e2);
127
+ attemptMerge(lastOriginal, firstNew, false);
128
+ return e1;
129
+ }
130
+
131
+ function findItemToOperateOn(e, dom) {
132
+ var item;
133
+ if (!dom.is(e, 'li,ol,ul')) {
134
+ item = dom.getParent(e, 'li');
135
+ if (item) {
136
+ e = item;
137
+ }
138
+ }
139
+ return e;
140
+ }
141
+
142
+ tinymce.create('tinymce.plugins.Lists', {
143
+ init: function(ed) {
144
+ var LIST_TABBING = 'TABBING';
145
+ var LIST_EMPTY_ITEM = 'EMPTY';
146
+ var LIST_ESCAPE = 'ESCAPE';
147
+ var LIST_PARAGRAPH = 'PARAGRAPH';
148
+ var LIST_UNKNOWN = 'UNKNOWN';
149
+ var state = LIST_UNKNOWN;
150
+
151
+ function isTabInList(e) {
152
+ // Don't indent on Ctrl+Tab or Alt+Tab
153
+ return e.keyCode === tinymce.VK.TAB && !(e.altKey || e.ctrlKey) &&
154
+ (ed.queryCommandState('InsertUnorderedList') || ed.queryCommandState('InsertOrderedList'));
155
+ }
156
+
157
+ function isOnLastListItem() {
158
+ var li = getLi();
159
+ var grandParent = li.parentNode.parentNode;
160
+ var isLastItem = li.parentNode.lastChild === li;
161
+ return isLastItem && !isNestedList(grandParent) && isEmptyListItem(li);
162
+ }
163
+
164
+ function isNestedList(grandParent) {
165
+ if (isList(grandParent)) {
166
+ return grandParent.parentNode && grandParent.parentNode.tagName === 'LI';
167
+ } else {
168
+ return grandParent.tagName === 'LI';
169
+ }
170
+ }
171
+
172
+ function isInEmptyListItem() {
173
+ return ed.selection.isCollapsed() && isEmptyListItem(getLi());
174
+ }
175
+
176
+ function getLi() {
177
+ var n = ed.selection.getStart();
178
+ // Get start will return BR if the LI only contains a BR or an empty element as we use these to fix caret position
179
+ return ((n.tagName == 'BR' || n.tagName == '') && n.parentNode.tagName == 'LI') ? n.parentNode : n;
180
+ }
181
+
182
+ function isEmptyListItem(li) {
183
+ var numChildren = li.childNodes.length;
184
+ if (li.tagName === 'LI') {
185
+ return numChildren == 0 ? true : numChildren == 1 && (li.firstChild.tagName == '' || li.firstChild.tagName == 'BR' || isEmptyIE9Li(li));
186
+ }
187
+ return false;
188
+ }
189
+
190
+ function isEmptyIE9Li(li) {
191
+ // only consider this to be last item if there is no list item content or that content is nbsp or space since IE9 creates these
192
+ var lis = tinymce.grep(li.parentNode.childNodes, function(n) {return n.tagName == 'LI'});
193
+ var isLastLi = li == lis[lis.length - 1];
194
+ var child = li.firstChild;
195
+ return tinymce.isIE9 && isLastLi && (child.nodeValue == String.fromCharCode(160) || child.nodeValue == String.fromCharCode(32));
196
+ }
197
+
198
+ function isEnter(e) {
199
+ return e.keyCode === tinymce.VK.ENTER;
200
+ }
201
+
202
+ function isEnterWithoutShift(e) {
203
+ return isEnter(e) && !e.shiftKey;
204
+ }
205
+
206
+ function getListKeyState(e) {
207
+ if (isTabInList(e)) {
208
+ return LIST_TABBING;
209
+ } else if (isEnterWithoutShift(e) && isOnLastListItem()) {
210
+ // Returns LIST_UNKNOWN since breaking out of lists is handled by the EnterKey.js logic now
211
+ //return LIST_ESCAPE;
212
+ return LIST_UNKNOWN;
213
+ } else if (isEnterWithoutShift(e) && isInEmptyListItem()) {
214
+ return LIST_EMPTY_ITEM;
215
+ } else {
216
+ return LIST_UNKNOWN;
217
+ }
218
+ }
219
+
220
+ function cancelDefaultEvents(ed, e) {
221
+ // list escape is done manually using outdent as it does not create paragraphs correctly in td's
222
+ if (state == LIST_TABBING || state == LIST_EMPTY_ITEM || tinymce.isGecko && state == LIST_ESCAPE) {
223
+ Event.cancel(e);
224
+ }
225
+ }
226
+
227
+ function isCursorAtEndOfContainer() {
228
+ var range = ed.selection.getRng(true);
229
+ var startContainer = range.startContainer;
230
+ if (startContainer.nodeType == 3) {
231
+ var value = startContainer.nodeValue;
232
+ if (tinymce.isIE9 && value.length > 1 && value.charCodeAt(value.length-1) == 32) {
233
+ // IE9 places a space on the end of the text in some cases so ignore last char
234
+ return (range.endOffset == value.length-1);
235
+ } else {
236
+ return (range.endOffset == value.length);
237
+ }
238
+ } else if (startContainer.nodeType == 1) {
239
+ return range.endOffset == startContainer.childNodes.length;
240
+ }
241
+ return false;
242
+ }
243
+
244
+ /*
245
+ If we are at the end of a list item surrounded with an element, pressing enter should create a
246
+ new list item instead without splitting the element e.g. don't want to create new P or H1 tag
247
+ */
248
+ function isEndOfListItem() {
249
+ var node = ed.selection.getNode();
250
+ var validElements = 'h1,h2,h3,h4,h5,h6,p,div';
251
+ var isLastParagraphOfLi = ed.dom.is(node, validElements) && node.parentNode.tagName === 'LI' && node.parentNode.lastChild === node;
252
+ return ed.selection.isCollapsed() && isLastParagraphOfLi && isCursorAtEndOfContainer();
253
+ }
254
+
255
+ // Creates a new list item after the current selection's list item parent
256
+ function createNewLi(ed, e) {
257
+ if (isEnterWithoutShift(e) && isEndOfListItem()) {
258
+ var node = ed.selection.getNode();
259
+ var li = ed.dom.create("li");
260
+ var parentLi = ed.dom.getParent(node, 'li');
261
+ ed.dom.insertAfter(li, parentLi);
262
+
263
+ // Move caret to new list element.
264
+ if (tinymce.isIE6 || tinymce.isIE7 || tinyMCE.isIE8) {
265
+ // Removed this line since it would create an odd <&nbsp;> tag and placing the caret inside an empty LI is handled and should be handled by the selection logic
266
+ //li.appendChild(ed.dom.create("&nbsp;")); // IE needs an element within the bullet point
267
+ ed.selection.setCursorLocation(li, 1);
268
+ } else {
269
+ ed.selection.setCursorLocation(li, 0);
270
+ }
271
+ e.preventDefault();
272
+ }
273
+ }
274
+
275
+ function imageJoiningListItem(ed, e) {
276
+ var prevSibling;
277
+
278
+ if (!tinymce.isGecko)
279
+ return;
280
+
281
+ var n = ed.selection.getStart();
282
+ if (e.keyCode != tinymce.VK.BACKSPACE || n.tagName !== 'IMG')
283
+ return;
284
+
285
+ function lastLI(node) {
286
+ var child = node.firstChild;
287
+ var li = null;
288
+ do {
289
+ if (!child)
290
+ break;
291
+
292
+ if (child.tagName === 'LI')
293
+ li = child;
294
+ } while (child = child.nextSibling);
295
+
296
+ return li;
297
+ }
298
+
299
+ function addChildren(parentNode, destination) {
300
+ while (parentNode.childNodes.length > 0)
301
+ destination.appendChild(parentNode.childNodes[0]);
302
+ }
303
+
304
+ // Check if there is a previous sibling
305
+ prevSibling = n.parentNode.previousSibling;
306
+ if (!prevSibling)
307
+ return;
308
+
309
+ var ul;
310
+ if (prevSibling.tagName === 'UL' || prevSibling.tagName === 'OL')
311
+ ul = prevSibling;
312
+ else if (prevSibling.previousSibling && (prevSibling.previousSibling.tagName === 'UL' || prevSibling.previousSibling.tagName === 'OL'))
313
+ ul = prevSibling.previousSibling;
314
+ else
315
+ return;
316
+
317
+ var li = lastLI(ul);
318
+
319
+ // move the caret to the end of the list item
320
+ var rng = ed.dom.createRng();
321
+ rng.setStart(li, 1);
322
+ rng.setEnd(li, 1);
323
+ ed.selection.setRng(rng);
324
+ ed.selection.collapse(true);
325
+
326
+ // save a bookmark at the end of the list item
327
+ var bookmark = ed.selection.getBookmark();
328
+
329
+ // copy the image an its text to the list item
330
+ var clone = n.parentNode.cloneNode(true);
331
+ if (clone.tagName === 'P' || clone.tagName === 'DIV')
332
+ addChildren(clone, li);
333
+ else
334
+ li.appendChild(clone);
335
+
336
+ // remove the old copy of the image
337
+ n.parentNode.parentNode.removeChild(n.parentNode);
338
+
339
+ // move the caret where we saved the bookmark
340
+ ed.selection.moveToBookmark(bookmark);
341
+ }
342
+
343
+ // fix the cursor position to ensure it is correct in IE
344
+ function setCursorPositionToOriginalLi(li) {
345
+ var list = ed.dom.getParent(li, 'ol,ul');
346
+ if (list != null) {
347
+ var lastLi = list.lastChild;
348
+ // Removed this line since IE9 would report an DOM character error and placing the caret inside an empty LI is handled and should be handled by the selection logic
349
+ //lastLi.appendChild(ed.getDoc().createElement(''));
350
+ ed.selection.setCursorLocation(lastLi, 0);
351
+ }
352
+ }
353
+
354
+ this.ed = ed;
355
+ ed.addCommand('Indent', this.indent, this);
356
+ ed.addCommand('Outdent', this.outdent, this);
357
+ ed.addCommand('InsertUnorderedList', function() {
358
+ this.applyList('UL', 'OL');
359
+ }, this);
360
+ ed.addCommand('InsertOrderedList', function() {
361
+ this.applyList('OL', 'UL');
362
+ }, this);
363
+
364
+ ed.onInit.add(function() {
365
+ ed.editorCommands.addCommands({
366
+ 'outdent': function() {
367
+ var sel = ed.selection, dom = ed.dom;
368
+
369
+ function hasStyleIndent(n) {
370
+ n = dom.getParent(n, dom.isBlock);
371
+ return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0;
372
+ }
373
+
374
+ return hasStyleIndent(sel.getStart()) || hasStyleIndent(sel.getEnd()) || ed.queryCommandState('InsertOrderedList') || ed.queryCommandState('InsertUnorderedList');
375
+ }
376
+ }, 'state');
377
+ });
378
+
379
+ ed.onKeyUp.add(function(ed, e) {
380
+ if (state == LIST_TABBING) {
381
+ ed.execCommand(e.shiftKey ? 'Outdent' : 'Indent', true, null);
382
+ state = LIST_UNKNOWN;
383
+ return Event.cancel(e);
384
+ } else if (state == LIST_EMPTY_ITEM) {
385
+ var li = getLi();
386
+ var shouldOutdent = ed.settings.list_outdent_on_enter === true || e.shiftKey;
387
+ ed.execCommand(shouldOutdent ? 'Outdent' : 'Indent', true, null);
388
+ if (tinymce.isIE) {
389
+ setCursorPositionToOriginalLi(li);
390
+ }
391
+
392
+ return Event.cancel(e);
393
+ } else if (state == LIST_ESCAPE) {
394
+ if (tinymce.isIE6 || tinymce.isIE7 || tinymce.isIE8) {
395
+ // append a zero sized nbsp so that caret is positioned correctly in IE after escaping and applying formatting.
396
+ // if there is no text then applying formatting for e.g a H1 to the P tag immediately following list after
397
+ // escaping from it will cause the caret to be positioned on the last li instead of staying the in P tag.
398
+ var n = ed.getDoc().createTextNode('\uFEFF');
399
+ ed.selection.getNode().appendChild(n);
400
+ } else if (tinymce.isIE9 || tinymce.isGecko) {
401
+ // IE9 does not escape the list so we use outdent to do this and cancel the default behaviour
402
+ // Gecko does not create a paragraph outdenting inside a TD so default behaviour is cancelled and we outdent ourselves
403
+ ed.execCommand('Outdent');
404
+ return Event.cancel(e);
405
+ }
406
+ }
407
+ });
408
+
409
+ function fixListItem(parent, reference) {
410
+ // a zero-sized non-breaking space is placed in the empty list item so that the nested list is
411
+ // displayed on the below line instead of next to it
412
+ var n = ed.getDoc().createTextNode('\uFEFF');
413
+ parent.insertBefore(n, reference);
414
+ ed.selection.setCursorLocation(n, 0);
415
+ // repaint to remove rendering artifact. only visible when creating new list
416
+ ed.execCommand('mceRepaint');
417
+ }
418
+
419
+ function fixIndentedListItemForGecko(ed, e) {
420
+ if (isEnter(e)) {
421
+ var li = getLi();
422
+ if (li) {
423
+ var parent = li.parentNode;
424
+ var grandParent = parent && parent.parentNode;
425
+ if (grandParent && grandParent.nodeName == 'LI' && grandParent.firstChild == parent && li == parent.firstChild) {
426
+ fixListItem(grandParent, parent);
427
+ }
428
+ }
429
+ }
430
+ }
431
+
432
+ function fixIndentedListItemForIE8(ed, e) {
433
+ if (isEnter(e)) {
434
+ var li = getLi();
435
+ if (ed.dom.select('ul li', li).length === 1) {
436
+ var list = li.firstChild;
437
+ fixListItem(li, list);
438
+ }
439
+ }
440
+ }
441
+
442
+ function fixDeletingFirstCharOfList(ed, e) {
443
+ function listElements(li) {
444
+ var elements = [];
445
+ var walker = new tinymce.dom.TreeWalker(li.firstChild, li);
446
+ for (var node = walker.current(); node; node = walker.next()) {
447
+ if (ed.dom.is(node, 'ol,ul,li')) {
448
+ elements.push(node);
449
+ }
450
+ }
451
+ return elements;
452
+ }
453
+
454
+ if (e.keyCode == tinymce.VK.BACKSPACE) {
455
+ var li = getLi();
456
+ if (li) {
457
+ var list = ed.dom.getParent(li, 'ol,ul'),
458
+ rng = ed.selection.getRng();
459
+ if (list && list.firstChild === li && rng.startOffset == 0) {
460
+ var elements = listElements(li);
461
+ elements.unshift(li);
462
+ ed.execCommand("Outdent", false, elements);
463
+ ed.undoManager.add();
464
+ return Event.cancel(e);
465
+ }
466
+ }
467
+ }
468
+ }
469
+
470
+ function fixDeletingEmptyLiInWebkit(ed, e) {
471
+ var li = getLi();
472
+ if (e.keyCode === tinymce.VK.BACKSPACE && ed.dom.is(li, 'li') && li.parentNode.firstChild!==li) {
473
+ if (ed.dom.select('ul,ol', li).length === 1) {
474
+ var prevLi = li.previousSibling;
475
+ ed.dom.remove(ed.dom.select('br', li));
476
+ ed.dom.remove(li, true);
477
+ var textNodes = tinymce.grep(prevLi.childNodes, function(n){ return n.nodeType === 3 });
478
+ if (textNodes.length === 1) {
479
+ var textNode = textNodes[0];
480
+ ed.selection.setCursorLocation(textNode, textNode.length);
481
+ }
482
+ ed.undoManager.add();
483
+ return Event.cancel(e);
484
+ }
485
+ }
486
+ }
487
+
488
+ ed.onKeyDown.add(function(_, e) { state = getListKeyState(e); });
489
+ ed.onKeyDown.add(cancelDefaultEvents);
490
+ ed.onKeyDown.add(imageJoiningListItem);
491
+ ed.onKeyDown.add(createNewLi);
492
+
493
+ if (tinymce.isGecko) {
494
+ ed.onKeyUp.add(fixIndentedListItemForGecko);
495
+ }
496
+ if (tinymce.isIE8) {
497
+ ed.onKeyUp.add(fixIndentedListItemForIE8);
498
+ }
499
+ if (tinymce.isGecko || tinymce.isWebKit) {
500
+ ed.onKeyDown.add(fixDeletingFirstCharOfList);
501
+ }
502
+ if (tinymce.isWebKit) {
503
+ ed.onKeyDown.add(fixDeletingEmptyLiInWebkit);
504
+ }
505
+ },
506
+
507
+ applyList: function(targetListType, oppositeListType) {
508
+ var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions,
509
+ selectedBlocks = ed.selection.getSelectedBlocks();
510
+
511
+ function cleanupBr(e) {
512
+ if (e && e.tagName === 'BR') {
513
+ dom.remove(e);
514
+ }
515
+ }
516
+
517
+ function makeList(element) {
518
+ var list = dom.create(targetListType), li;
519
+
520
+ function adjustIndentForNewList(element) {
521
+ // If there's a margin-left, outdent one level to account for the extra list margin.
522
+ if (element.style.marginLeft || element.style.paddingLeft) {
523
+ t.adjustPaddingFunction(false)(element);
524
+ }
525
+ }
526
+
527
+ if (element.tagName === 'LI') {
528
+ // No change required.
529
+ } else if (element.tagName === 'P' || element.tagName === 'DIV' || element.tagName === 'BODY') {
530
+ processBrs(element, function(startSection, br) {
531
+ doWrapList(startSection, br, element.tagName === 'BODY' ? null : startSection.parentNode);
532
+ li = startSection.parentNode;
533
+ adjustIndentForNewList(li);
534
+ cleanupBr(br);
535
+ });
536
+ if (li) {
537
+ if (li.tagName === 'LI' && (element.tagName === 'P' || selectedBlocks.length > 1)) {
538
+ dom.split(li.parentNode.parentNode, li.parentNode);
539
+ }
540
+ attemptMergeWithAdjacent(li.parentNode, true);
541
+ }
542
+ return;
543
+ } else {
544
+ // Put the list around the element.
545
+ li = dom.create('li');
546
+ dom.insertAfter(li, element);
547
+ li.appendChild(element);
548
+ adjustIndentForNewList(element);
549
+ element = li;
550
+ }
551
+ dom.insertAfter(list, element);
552
+ list.appendChild(element);
553
+ attemptMergeWithAdjacent(list, true);
554
+ applied.push(element);
555
+ }
556
+
557
+ function doWrapList(start, end, template) {
558
+ var li, n = start, tmp;
559
+ while (!dom.isBlock(start.parentNode) && start.parentNode !== dom.getRoot()) {
560
+ start = dom.split(start.parentNode, start.previousSibling);
561
+ start = start.nextSibling;
562
+ n = start;
563
+ }
564
+ if (template) {
565
+ li = template.cloneNode(true);
566
+ start.parentNode.insertBefore(li, start);
567
+ while (li.firstChild) dom.remove(li.firstChild);
568
+ li = dom.rename(li, 'li');
569
+ } else {
570
+ li = dom.create('li');
571
+ start.parentNode.insertBefore(li, start);
572
+ }
573
+ while (n && n != end) {
574
+ tmp = n.nextSibling;
575
+ li.appendChild(n);
576
+ n = tmp;
577
+ }
578
+ if (li.childNodes.length === 0) {
579
+ li.innerHTML = '<br _mce_bogus="1" />';
580
+ }
581
+ makeList(li);
582
+ }
583
+
584
+ function processBrs(element, callback) {
585
+ var startSection, previousBR, END_TO_START = 3, START_TO_END = 1,
586
+ breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl';
587
+
588
+ function isAnyPartSelected(start, end) {
589
+ var r = dom.createRng(), sel;
590
+ bookmark.keep = true;
591
+ ed.selection.moveToBookmark(bookmark);
592
+ bookmark.keep = false;
593
+ sel = ed.selection.getRng(true);
594
+ if (!end) {
595
+ end = start.parentNode.lastChild;
596
+ }
597
+ r.setStartBefore(start);
598
+ r.setEndAfter(end);
599
+ return !(r.compareBoundaryPoints(END_TO_START, sel) > 0 || r.compareBoundaryPoints(START_TO_END, sel) <= 0);
600
+ }
601
+
602
+ function nextLeaf(br) {
603
+ if (br.nextSibling)
604
+ return br.nextSibling;
605
+ if (!dom.isBlock(br.parentNode) && br.parentNode !== dom.getRoot())
606
+ return nextLeaf(br.parentNode);
607
+ }
608
+
609
+ // Split on BRs within the range and process those.
610
+ startSection = element.firstChild;
611
+ // First mark the BRs that have any part of the previous section selected.
612
+ var trailingContentSelected = false;
613
+ each(dom.select(breakElements, element), function(br) {
614
+ if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
615
+ return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
616
+ }
617
+ if (isAnyPartSelected(startSection, br)) {
618
+ dom.addClass(br, '_mce_tagged_br');
619
+ startSection = nextLeaf(br);
620
+ }
621
+ });
622
+ trailingContentSelected = (startSection && isAnyPartSelected(startSection, undefined));
623
+ startSection = element.firstChild;
624
+ each(dom.select(breakElements, element), function(br) {
625
+ // Got a section from start to br.
626
+ var tmp = nextLeaf(br);
627
+ if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
628
+ return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
629
+ }
630
+ if (dom.hasClass(br, '_mce_tagged_br')) {
631
+ callback(startSection, br, previousBR);
632
+ previousBR = null;
633
+ } else {
634
+ previousBR = br;
635
+ }
636
+ startSection = tmp;
637
+ });
638
+ if (trailingContentSelected) {
639
+ callback(startSection, undefined, previousBR);
640
+ }
641
+ }
642
+
643
+ function wrapList(element) {
644
+ processBrs(element, function(startSection, br, previousBR) {
645
+ // Need to indent this part
646
+ doWrapList(startSection, br);
647
+ cleanupBr(br);
648
+ cleanupBr(previousBR);
649
+ });
650
+ }
651
+
652
+ function changeList(element) {
653
+ if (tinymce.inArray(applied, element) !== -1) {
654
+ return;
655
+ }
656
+ if (element.parentNode.tagName === oppositeListType) {
657
+ dom.split(element.parentNode, element);
658
+ makeList(element);
659
+ attemptMergeWithNext(element.parentNode, false);
660
+ }
661
+ applied.push(element);
662
+ }
663
+
664
+ function convertListItemToParagraph(element) {
665
+ var child, nextChild, mergedElement, splitLast;
666
+ if (tinymce.inArray(applied, element) !== -1) {
667
+ return;
668
+ }
669
+ element = splitNestedLists(element, dom);
670
+ while (dom.is(element.parentNode, 'ol,ul,li')) {
671
+ dom.split(element.parentNode, element);
672
+ }
673
+ // Push the original element we have from the selection, not the renamed one.
674
+ applied.push(element);
675
+ element = dom.rename(element, 'p');
676
+ mergedElement = attemptMergeWithAdjacent(element, false, ed.settings.force_br_newlines);
677
+ if (mergedElement === element) {
678
+ // Now split out any block elements that can't be contained within a P.
679
+ // Manually iterate to ensure we handle modifications correctly (doesn't work with tinymce.each)
680
+ child = element.firstChild;
681
+ while (child) {
682
+ if (dom.isBlock(child)) {
683
+ child = dom.split(child.parentNode, child);
684
+ splitLast = true;
685
+ nextChild = child.nextSibling && child.nextSibling.firstChild;
686
+ } else {
687
+ nextChild = child.nextSibling;
688
+ if (splitLast && child.tagName === 'BR') {
689
+ dom.remove(child);
690
+ }
691
+ splitLast = false;
692
+ }
693
+ child = nextChild;
694
+ }
695
+ }
696
+ }
697
+
698
+ each(selectedBlocks, function(e) {
699
+ e = findItemToOperateOn(e, dom);
700
+ if (e.tagName === oppositeListType || (e.tagName === 'LI' && e.parentNode.tagName === oppositeListType)) {
701
+ hasOppositeType = true;
702
+ } else if (e.tagName === targetListType || (e.tagName === 'LI' && e.parentNode.tagName === targetListType)) {
703
+ hasSameType = true;
704
+ } else {
705
+ hasNonList = true;
706
+ }
707
+ });
708
+
709
+ if (hasNonList &&!hasSameType || hasOppositeType || selectedBlocks.length === 0) {
710
+ actions = {
711
+ 'LI': changeList,
712
+ 'H1': makeList,
713
+ 'H2': makeList,
714
+ 'H3': makeList,
715
+ 'H4': makeList,
716
+ 'H5': makeList,
717
+ 'H6': makeList,
718
+ 'P': makeList,
719
+ 'BODY': makeList,
720
+ 'DIV': selectedBlocks.length > 1 ? makeList : wrapList,
721
+ defaultAction: wrapList,
722
+ elements: this.selectedBlocks()
723
+ };
724
+ } else {
725
+ actions = {
726
+ defaultAction: convertListItemToParagraph,
727
+ elements: this.selectedBlocks(),
728
+ processEvenIfEmpty: true
729
+ };
730
+ }
731
+ this.process(actions);
732
+ },
733
+
734
+ indent: function() {
735
+ var ed = this.ed, dom = ed.dom, indented = [];
736
+
737
+ function createWrapItem(element) {
738
+ var wrapItem = dom.create('li', { style: 'list-style-type: none;'});
739
+ dom.insertAfter(wrapItem, element);
740
+ return wrapItem;
741
+ }
742
+
743
+ function createWrapList(element) {
744
+ var wrapItem = createWrapItem(element),
745
+ list = dom.getParent(element, 'ol,ul'),
746
+ listType = list.tagName,
747
+ listStyle = dom.getStyle(list, 'list-style-type'),
748
+ attrs = {},
749
+ wrapList;
750
+ if (listStyle !== '') {
751
+ attrs.style = 'list-style-type: ' + listStyle + ';';
752
+ }
753
+ wrapList = dom.create(listType, attrs);
754
+ wrapItem.appendChild(wrapList);
755
+ return wrapList;
756
+ }
757
+
758
+ function indentLI(element) {
759
+ if (!hasParentInList(ed, element, indented)) {
760
+ element = splitNestedLists(element, dom);
761
+ var wrapList = createWrapList(element);
762
+ wrapList.appendChild(element);
763
+ attemptMergeWithAdjacent(wrapList.parentNode, false);
764
+ attemptMergeWithAdjacent(wrapList, false);
765
+ indented.push(element);
766
+ }
767
+ }
768
+
769
+ this.process({
770
+ 'LI': indentLI,
771
+ defaultAction: this.adjustPaddingFunction(true),
772
+ elements: this.selectedBlocks()
773
+ });
774
+
775
+ },
776
+
777
+ outdent: function(ui, elements) {
778
+ var t = this, ed = t.ed, dom = ed.dom, outdented = [];
779
+
780
+ function outdentLI(element) {
781
+ var listElement, targetParent, align;
782
+ if (!hasParentInList(ed, element, outdented)) {
783
+ if (dom.getStyle(element, 'margin-left') !== '' || dom.getStyle(element, 'padding-left') !== '') {
784
+ return t.adjustPaddingFunction(false)(element);
785
+ }
786
+ align = dom.getStyle(element, 'text-align', true);
787
+ if (align === 'center' || align === 'right') {
788
+ dom.setStyle(element, 'text-align', 'left');
789
+ return;
790
+ }
791
+ element = splitNestedLists(element, dom);
792
+ listElement = element.parentNode;
793
+ targetParent = element.parentNode.parentNode;
794
+ if (targetParent.tagName === 'P') {
795
+ dom.split(targetParent, element.parentNode);
796
+ } else {
797
+ dom.split(listElement, element);
798
+ if (targetParent.tagName === 'LI') {
799
+ // Nested list, need to split the LI and go back out to the OL/UL element.
800
+ dom.split(targetParent, element);
801
+ } else if (!dom.is(targetParent, 'ol,ul')) {
802
+ dom.rename(element, 'p');
803
+ }
804
+ }
805
+ outdented.push(element);
806
+ }
807
+ }
808
+
809
+ var listElements = elements && tinymce.is(elements, 'array') ? elements : this.selectedBlocks();
810
+ this.process({
811
+ 'LI': outdentLI,
812
+ defaultAction: this.adjustPaddingFunction(false),
813
+ elements: listElements
814
+ });
815
+
816
+ each(outdented, attemptMergeWithAdjacent);
817
+ },
818
+
819
+ process: function(actions) {
820
+ var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r;
821
+
822
+ function isEmptyElement(element) {
823
+ var excludeBrsAndBookmarks = tinymce.grep(element.childNodes, function(n) {
824
+ return !(n.nodeName === 'BR' || n.nodeName === 'SPAN' && dom.getAttrib(n, 'data-mce-type') == 'bookmark'
825
+ || n.nodeType == 3 && (n.nodeValue == String.fromCharCode(160) || n.nodeValue == ''));
826
+ });
827
+ return excludeBrsAndBookmarks.length === 0;
828
+ }
829
+
830
+ function processElement(element) {
831
+ dom.removeClass(element, '_mce_act_on');
832
+ if (!element || element.nodeType !== 1 || ! actions.processEvenIfEmpty && selectedBlocks.length > 1 && isEmptyElement(element)) {
833
+ return;
834
+ }
835
+ element = findItemToOperateOn(element, dom);
836
+ var action = actions[element.tagName];
837
+ if (!action) {
838
+ action = actions.defaultAction;
839
+ }
840
+ action(element);
841
+ }
842
+
843
+ function recurse(element) {
844
+ t.splitSafeEach(element.childNodes, processElement, true);
845
+ }
846
+
847
+ function brAtEdgeOfSelection(container, offset) {
848
+ return offset >= 0 && container.hasChildNodes() && offset < container.childNodes.length &&
849
+ container.childNodes[offset].tagName === 'BR';
850
+ }
851
+
852
+ function isInTable() {
853
+ var n = sel.getNode();
854
+ var p = dom.getParent(n, 'td');
855
+ return p !== null;
856
+ }
857
+
858
+ selectedBlocks = actions.elements;
859
+
860
+ r = sel.getRng(true);
861
+ if (!r.collapsed) {
862
+ if (brAtEdgeOfSelection(r.endContainer, r.endOffset - 1)) {
863
+ r.setEnd(r.endContainer, r.endOffset - 1);
864
+ sel.setRng(r);
865
+ }
866
+ if (brAtEdgeOfSelection(r.startContainer, r.startOffset)) {
867
+ r.setStart(r.startContainer, r.startOffset + 1);
868
+ sel.setRng(r);
869
+ }
870
+ }
871
+
872
+
873
+ if (tinymce.isIE8) {
874
+ // append a zero sized nbsp so that caret is restored correctly using bookmark
875
+ var s = t.ed.selection.getNode();
876
+ if (s.tagName === 'LI' && !(s.parentNode.lastChild === s)) {
877
+ var i = t.ed.getDoc().createTextNode('\uFEFF');
878
+ s.appendChild(i);
879
+ }
880
+ }
881
+
882
+ bookmark = sel.getBookmark();
883
+ actions.OL = actions.UL = recurse;
884
+ t.splitSafeEach(selectedBlocks, processElement);
885
+ sel.moveToBookmark(bookmark);
886
+ bookmark = null;
887
+
888
+ // we avoid doing repaint in a table as this will move the caret out of the table in Firefox 3.6
889
+ if (!isInTable()) {
890
+ // Avoids table or image handles being left behind in Firefox.
891
+ t.ed.execCommand('mceRepaint');
892
+ }
893
+ },
894
+
895
+ splitSafeEach: function(elements, f, forceClassBase) {
896
+ if (forceClassBase ||
897
+ (tinymce.isGecko &&
898
+ (/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) ||
899
+ /Firefox\/3\.[0-4]/.test(navigator.userAgent)))) {
900
+ this.classBasedEach(elements, f);
901
+ } else {
902
+ each(elements, f);
903
+ }
904
+ },
905
+
906
+ classBasedEach: function(elements, f) {
907
+ var dom = this.ed.dom, nodes, element;
908
+ // Mark nodes
909
+ each(elements, function(element) {
910
+ dom.addClass(element, '_mce_act_on');
911
+ });
912
+ nodes = dom.select('._mce_act_on');
913
+ while (nodes.length > 0) {
914
+ element = nodes.shift();
915
+ dom.removeClass(element, '_mce_act_on');
916
+ f(element);
917
+ nodes = dom.select('._mce_act_on');
918
+ }
919
+ },
920
+
921
+ adjustPaddingFunction: function(isIndent) {
922
+ var indentAmount, indentUnits, ed = this.ed;
923
+ indentAmount = ed.settings.indentation;
924
+ indentUnits = /[a-z%]+/i.exec(indentAmount);
925
+ indentAmount = parseInt(indentAmount, 10);
926
+ return function(element) {
927
+ var currentIndent, newIndentAmount;
928
+ currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10);
929
+ if (isIndent) {
930
+ newIndentAmount = currentIndent + indentAmount;
931
+ } else {
932
+ newIndentAmount = currentIndent - indentAmount;
933
+ }
934
+ ed.dom.setStyle(element, 'padding-left', '');
935
+ ed.dom.setStyle(element, 'margin-left', newIndentAmount > 0 ? newIndentAmount + indentUnits : '');
936
+ };
937
+ },
938
+
939
+ selectedBlocks: function() {
940
+ var ed = this.ed, selectedBlocks = ed.selection.getSelectedBlocks();
941
+ return selectedBlocks.length == 0 ? [ ed.dom.getRoot() ] : selectedBlocks;
942
+ },
943
+
944
+ getInfo: function() {
945
+ return {
946
+ longname : 'Lists',
947
+ author : 'Moxiecode Systems AB',
948
+ authorurl : 'http://tinymce.moxiecode.com',
949
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists',
950
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
951
+ };
952
+ }
953
+ });
954
+ tinymce.PluginManager.add("lists", tinymce.plugins.Lists);
955
+ }());
js/tinymce/jscripts/tiny_mce/plugins/media/langs/en_dlg.js CHANGED
@@ -1 +1 @@
1
- tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert/Edit Embedded Media","align_top_left":"Top Left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed RTSP resources should be added to the QT Source field under the Advanced tab.\nYou should also add a non-streamed version to the Source field.",qtsrc:"QT Source",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch Style",scriptcallbacks:"Script Callbacks","align_top_right":"Top Right",uimode:"UI Mode",rate:"Rate",playcount:"Play Count",defaultframe:"Default Frame",currentposition:"Current Position",currentmarker:"Current Marker",captioningid:"Captioning ID",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless Video",stretchtofit:"Stretch to Fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Full Screen",enabled:"Enabled",autostart:"Auto Start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"End Time",starttime:"Start Time",enablejavascript:"Enable JavaScript",correction:"No Correction",targetcache:"Target Cache",playeveryframe:"Play Every Frame",kioskmode:"Kiosk Mode",controller:"Controller",menu:"Show Menu",loop:"Loop",play:"Auto Play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"ID",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain Proportions",controls:"Controls",numloop:"Num Loops",console:"Console",cache:"Cache",autohref:"Auto HREF",liveconnect:"SWLiveConnect",flashvars:"Flash Vars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain Aspect",imagestatus:"Image Status",center:"Center",autogotourl:"Auto Goto URL","shockwave_options":"Shockwave Options","rmp_options":"Real Media Player Options","wmp_options":"Windows Media Player Options","qt_options":"QuickTime Options","flash_options":"Flash Options",hidden:"Hidden","align_bottom_left":"Bottom Left","align_bottom_right":"Bottom Right","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source","html5_audio_options":"Audio Options","preload_none":"Don\'t Preload","preload_metadata":"Preload video metadata","preload_auto":"Let user\'s browser decide", "embedded_audio_options":"Embedded Audio Options", video:"HTML5 Video", audio:"HTML5 Audio", flash:"Flash", quicktime:"QuickTime", shockwave:"Shockwave", windowsmedia:"Windows Media", realmedia:"Real Media", iframe:"Iframe", embeddedaudio:"Embedded Audio" });
1
+ tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert/Edit Embedded Media","align_top_left":"Top Left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed RTSP resources should be added to the QT Source field under the Advanced tab.\nYou should also add a non-streamed version to the Source field.",qtsrc:"QT Source",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch Style",scriptcallbacks:"Script Callbacks","align_top_right":"Top Right",uimode:"UI Mode",rate:"Rate",playcount:"Play Count",defaultframe:"Default Frame",currentposition:"Current Position",currentmarker:"Current Marker",captioningid:"Captioning ID",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless Video",stretchtofit:"Stretch to Fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Full Screen",enabled:"Enabled",autostart:"Auto Start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"End Time",starttime:"Start Time",enablejavascript:"Enable JavaScript",correction:"No Correction",targetcache:"Target Cache",playeveryframe:"Play Every Frame",kioskmode:"Kiosk Mode",controller:"Controller",menu:"Show Menu",loop:"Loop",play:"Auto Play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"ID",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain Proportions",controls:"Controls",numloop:"Num Loops",console:"Console",cache:"Cache",autohref:"Auto HREF",liveconnect:"SWLiveConnect",flashvars:"Flash Vars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain Aspect",imagestatus:"Image Status",center:"Center",autogotourl:"Auto Goto URL","shockwave_options":"Shockwave Options","rmp_options":"Real Media Player Options","wmp_options":"Windows Media Player Options","qt_options":"QuickTime Options","flash_options":"Flash Options",hidden:"Hidden","align_bottom_left":"Bottom Left","align_bottom_right":"Bottom Right","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source","html5_audio_options":"Audio Options","preload_none":"Don\'t Preload","preload_metadata":"Preload video metadata","preload_auto":"Let user\'s browser decide", "embedded_audio_options":"Embedded Audio Options", video:"HTML5 Video", audio:"HTML5 Audio", flash:"Flash", quicktime:"QuickTime", shockwave:"Shockwave", windowsmedia:"Windows Media", realmedia:"Real Media", iframe:"Iframe", embeddedaudio:"Embedded Audio" });
js/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js CHANGED
@@ -1,53 +1,53 @@
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.Preview', {
13
- init : function(ed, url) {
14
- var t = this, css = tinymce.explode(ed.settings.content_css);
15
-
16
- t.editor = ed;
17
-
18
- // Force absolute CSS urls
19
- tinymce.each(css, function(u, k) {
20
- css[k] = ed.documentBaseURI.toAbsolute(u);
21
- });
22
-
23
- ed.addCommand('mcePreview', function() {
24
- ed.windowManager.open({
25
- file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"),
26
- width : parseInt(ed.getParam("plugin_preview_width", "550")),
27
- height : parseInt(ed.getParam("plugin_preview_height", "600")),
28
- resizable : "yes",
29
- scrollbars : "yes",
30
- popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"),
31
- inline : ed.getParam("plugin_preview_inline", 1)
32
- }, {
33
- base : ed.documentBaseURI.getURI()
34
- });
35
- });
36
-
37
- ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'});
38
- },
39
-
40
- getInfo : function() {
41
- return {
42
- longname : 'Preview',
43
- author : 'Moxiecode Systems AB',
44
- authorurl : 'http://tinymce.moxiecode.com',
45
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',
46
- version : tinymce.majorVersion + "." + tinymce.minorVersion
47
- };
48
- }
49
- });
50
-
51
- // Register plugin
52
- tinymce.PluginManager.add('preview', tinymce.plugins.Preview);
53
  })();
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.Preview', {
13
+ init : function(ed, url) {
14
+ var t = this, css = tinymce.explode(ed.settings.content_css);
15
+
16
+ t.editor = ed;
17
+
18
+ // Force absolute CSS urls
19
+ tinymce.each(css, function(u, k) {
20
+ css[k] = ed.documentBaseURI.toAbsolute(u);
21
+ });
22
+
23
+ ed.addCommand('mcePreview', function() {
24
+ ed.windowManager.open({
25
+ file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"),
26
+ width : parseInt(ed.getParam("plugin_preview_width", "550")),
27
+ height : parseInt(ed.getParam("plugin_preview_height", "600")),
28
+ resizable : "yes",
29
+ scrollbars : "yes",
30
+ popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"),
31
+ inline : ed.getParam("plugin_preview_inline", 1)
32
+ }, {
33
+ base : ed.documentBaseURI.getURI()
34
+ });
35
+ });
36
+
37
+ ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'});
38
+ },
39
+
40
+ getInfo : function() {
41
+ return {
42
+ longname : 'Preview',
43
+ author : 'Moxiecode Systems AB',
44
+ authorurl : 'http://tinymce.moxiecode.com',
45
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',
46
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
47
+ };
48
+ }
49
+ });
50
+
51
+ // Register plugin
52
+ tinymce.PluginManager.add('preview', tinymce.plugins.Preview);
53
  })();
js/tinymce/jscripts/tiny_mce/plugins/style/langs/en_dlg.js CHANGED
@@ -1 +1 @@
1
- tinyMCE.addI18n('en.style_dlg',{"text_lineheight":"Line Height","text_variant":"Variant","text_style":"Style","text_weight":"Weight","text_size":"Size","text_font":"Font","text_props":"Text","positioning_tab":"Positioning","list_tab":"List","border_tab":"Border","box_tab":"Box","block_tab":"Block","background_tab":"Background","text_tab":"Text",apply:"Apply",toggle_insert_span:"Insert span at selection",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility","positioning_type":"Type",position:"Position","bullet_image":"Bullet Image","list_type":"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for All",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Height","box_width":"Width","block_display":"Display","block_whitespace":"Whitespace","block_text_indent":"Text Indent","block_text_align":"Text Align","block_vertical_alignment":"Vertical Alignment","block_letterspacing":"Letter Spacing","block_wordspacing":"Word Spacing","background_vpos":"Vertical Position","background_hpos":"Horizontal Position","background_attachment":"Attachment","background_repeat":"Repeat","background_image":"Background Image","background_color":"Background Color","text_none":"None","text_blink":"Blink","text_case":"Case","text_striketrough":"Strikethrough","text_underline":"Underline","text_overline":"Overline","text_decoration":"Decoration","text_color":"Color",text:"Text",background:"Background",block:"Block",box:"Box",border:"Border",list:"List"});
1
+ tinyMCE.addI18n('en.style_dlg',{"text_lineheight":"Line Height","text_variant":"Variant","text_style":"Style","text_weight":"Weight","text_size":"Size","text_font":"Font","text_props":"Text","positioning_tab":"Positioning","list_tab":"List","border_tab":"Border","box_tab":"Box","block_tab":"Block","background_tab":"Background","text_tab":"Text",apply:"Apply",toggle_insert_span:"Insert span at selection",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility","positioning_type":"Type",position:"Position","bullet_image":"Bullet Image","list_type":"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for All",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Height","box_width":"Width","block_display":"Display","block_whitespace":"Whitespace","block_text_indent":"Text Indent","block_text_align":"Text Align","block_vertical_alignment":"Vertical Alignment","block_letterspacing":"Letter Spacing","block_wordspacing":"Word Spacing","background_vpos":"Vertical Position","background_hpos":"Horizontal Position","background_attachment":"Attachment","background_repeat":"Repeat","background_image":"Background Image","background_color":"Background Color","text_none":"None","text_blink":"Blink","text_case":"Case","text_striketrough":"Strikethrough","text_underline":"Underline","text_overline":"Overline","text_decoration":"Decoration","text_color":"Color",text:"Text",background:"Background",block:"Block",box:"Box",border:"Border",list:"List"});
js/tinymce/jscripts/tiny_mce/plugins/style/props.htm CHANGED
@@ -1,845 +1,845 @@
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>{#style_dlg.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/props.js"></script>
10
- <link href="css/props.css" rel="stylesheet" type="text/css" />
11
- </head>
12
-
13
- <body id="styleprops" style="display: none" role="application" aria-labelledby="app_title">
14
- <span id="app_title" style="display:none">{#style_dlg.title}</span>
15
- <form onsubmit="updateAction();return false;" action="#">
16
- <div class="tabs">
17
- <ul>
18
- <li id="text_tab" class="current" aria-controls="text_panel"><span><a href="javascript:mcTabs.displayTab('text_tab','text_panel');" onMouseDown="return false;">{#style_dlg.text_tab}</a></span></li>
19
- <li id="background_tab" aria-controls="background_panel"><span><a href="javascript:mcTabs.displayTab('background_tab','background_panel');" onMouseDown="return false;">{#style_dlg.background_tab}</a></span></li>
20
- <li id="block_tab" aria-controls="block_panel"><span><a href="javascript:mcTabs.displayTab('block_tab','block_panel');" onMouseDown="return false;">{#style_dlg.block_tab}</a></span></li>
21
- <li id="box_tab" aria-controls="box_panel"><span><a href="javascript:mcTabs.displayTab('box_tab','box_panel');" onMouseDown="return false;">{#style_dlg.box_tab}</a></span></li>
22
- <li id="border_tab" aria-controls="border_panel"><span><a href="javascript:mcTabs.displayTab('border_tab','border_panel');" onMouseDown="return false;">{#style_dlg.border_tab}</a></span></li>
23
- <li id="list_tab" aria-controls="list_panel"><span><a href="javascript:mcTabs.displayTab('list_tab','list_panel');" onMouseDown="return false;">{#style_dlg.list_tab}</a></span></li>
24
- <li id="positioning_tab" aria-controls="positioning_panel"><span><a href="javascript:mcTabs.displayTab('positioning_tab','positioning_panel');" onMouseDown="return false;">{#style_dlg.positioning_tab}</a></span></li>
25
- </ul>
26
- </div>
27
-
28
- <div class="panel_wrapper">
29
- <div id="text_panel" class="panel current">
30
- <fieldset>
31
- <legend>{#style_dlg.text}</legend>
32
- <table role="presentation" border="0" width="100%">
33
- <tr>
34
- <td><label for="text_font">{#style_dlg.text_font}</label></td>
35
- <td colspan="3">
36
- <select id="text_font" name="text_font" class="mceEditableSelect mceFocus"></select>
37
- </td>
38
- </tr>
39
- <tr>
40
- <td><label for="text_size">{#style_dlg.text_size}</label></td>
41
- <td>
42
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
43
- <tr>
44
- <td><select id="text_size" name="text_size" class="mceEditableSelect"></select></td>
45
- <td>&nbsp;</td>
46
- <td>
47
- <label id="text_size_measurement_label" for="text_size_measurement" style="display: none; visibility: hidden;">Text Size Measurement Unit</label>
48
- <select id="text_size_measurement" name="text_size_measurement" aria-labelledby="text_size_measurement_label"></select>
49
- </td>
50
- </tr>
51
- </table>
52
- </td>
53
- <td><label for="text_weight">{#style_dlg.text_weight}</label></td>
54
- <td>
55
- <select id="text_weight" name="text_weight"></select>
56
- </td>
57
- </tr>
58
- <tr>
59
- <td><label for="text_style">{#style_dlg.text_style}</label></td>
60
- <td>
61
- <select id="text_style" name="text_style" class="mceEditableSelect"></select>
62
- </td>
63
- <td><label for="text_variant">{#style_dlg.text_variant}</label></td>
64
- <td>
65
- <select id="text_variant" name="text_variant"></select>
66
- </td>
67
- </tr>
68
- <tr>
69
- <td><label for="text_lineheight">{#style_dlg.text_lineheight}</label></td>
70
- <td>
71
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
72
- <tr>
73
- <td>
74
- <select id="text_lineheight" name="text_lineheight" class="mceEditableSelect"></select>
75
- </td>
76
- <td>&nbsp;</td>
77
- <td>
78
- <label id="text_lineheight_measurement_label" for="text_lineheight_measurement" style="display: none; visibility: hidden;">Line Height Measurement Unit</label>
79
- <select id="text_lineheight_measurement" name="text_lineheight_measurement" aria-labelledby="text_lineheight_measurement_label"></select>
80
- </td>
81
- </tr>
82
- </table>
83
- </td>
84
- <td><label for="text_case">{#style_dlg.text_case}</label></td>
85
- <td>
86
- <select id="text_case" name="text_case"></select>
87
- </td>
88
- </tr>
89
- <tr>
90
- <td><label for="text_color">{#style_dlg.text_color}</label></td>
91
- <td colspan="2">
92
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
93
- <tr>
94
- <td><input id="text_color" name="text_color" type="text" value="" size="9" onChange="updateColor('text_color_pick','text_color');" /></td>
95
- <td id="text_color_pickcontainer">&nbsp;</td>
96
- </tr>
97
- </table>
98
- </td>
99
- </tr>
100
- <tr>
101
- <td valign="top" style="vertical-align: top; padding-top: 3px;">{#style_dlg.text_decoration}</td>
102
- <td colspan="2">
103
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
104
- <tr>
105
- <td><input id="text_underline" name="text_underline" class="checkbox" type="checkbox" /></td>
106
- <td><label for="text_underline">{#style_dlg.text_underline}</label></td>
107
- </tr>
108
- <tr>
109
- <td><input id="text_overline" name="text_overline" class="checkbox" type="checkbox" /></td>
110
- <td><label for="text_overline">{#style_dlg.text_overline}</label></td>
111
- </tr>
112
- <tr>
113
- <td><input id="text_linethrough" name="text_linethrough" class="checkbox" type="checkbox" /></td>
114
- <td><label for="text_linethrough">{#style_dlg.text_striketrough}</label></td>
115
- </tr>
116
- <tr>
117
- <td><input id="text_blink" name="text_blink" class="checkbox" type="checkbox" /></td>
118
- <td><label for="text_blink">{#style_dlg.text_blink}</label></td>
119
- </tr>
120
- <tr>
121
- <td><input id="text_none" name="text_none" class="checkbox" type="checkbox" onclick="updateTextDecorations();"/></td>
122
- <td><label for="text_none">{#style_dlg.text_none}</label></td>
123
- </tr>
124
- </table>
125
- </td>
126
- </tr>
127
- </table>
128
- </fieldset>
129
- </div>
130
-
131
- <div id="background_panel" class="panel">
132
- <fieldset>
133
- <legend>{#style_dlg.background}</legend>
134
- <table role="presentation" border="0">
135
- <tr>
136
- <td><label for="background_color">{#style_dlg.background_color}</label></td>
137
- <td>
138
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
139
- <tr>
140
- <td><input id="background_color" name="background_color" type="text" value="" size="9" onChange="updateColor('background_color_pick','background_color');" /></td>
141
- <td id="background_color_pickcontainer">&nbsp;</td>
142
- </tr>
143
- </table>
144
- </td>
145
- </tr>
146
-
147
- <tr>
148
- <td><label for="background_image">{#style_dlg.background_image}</label></td>
149
- <td><table role="presentation" border="0" cellspacing="0" cellpadding="0">
150
- <tr>
151
- <td><input id="background_image" name="background_image" type="text" /></td>
152
- <td id="background_image_browser">&nbsp;</td>
153
- </tr>
154
- </table>
155
- </td>
156
- </tr>
157
-
158
- <tr>
159
- <td><label for="background_repeat">{#style_dlg.background_repeat}</label></td>
160
- <td><select id="background_repeat" name="background_repeat" class="mceEditableSelect"></select></td>
161
- </tr>
162
-
163
- <tr>
164
- <td><label for="background_attachment">{#style_dlg.background_attachment}</label></td>
165
- <td><select id="background_attachment" name="background_attachment" class="mceEditableSelect"></select></td>
166
- </tr>
167
-
168
- <tr>
169
- <td><label for="background_hpos">{#style_dlg.background_hpos}</label></td>
170
- <td>
171
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
172
- <tr>
173
- <td><select id="background_hpos" name="background_hpos" class="mceEditableSelect"></select></td>
174
- <td>&nbsp;</td>
175
- <td>
176
- <label id="background_hpos_measurement_label" for="background_hpos_measurement" style="display: none; visibility: hidden;">Horizontal position measurement unit</label>
177
- <select id="background_hpos_measurement" name="background_hpos_measurement" aria-labelledby="background_hpos_measurement_label"></select>
178
- </td>
179
- </tr>
180
- </table>
181
- </td>
182
- </tr>
183
-
184
- <tr>
185
- <td><label for="background_vpos">{#style_dlg.background_vpos}</label></td>
186
- <td>
187
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
188
- <tr>
189
- <td><select id="background_vpos" name="background_vpos" class="mceEditableSelect"></select></td>
190
- <td>&nbsp;</td>
191
- <td>
192
-
193
- <label id="background_vpos_measurement_label" for="background_vpos_measurement" style="display: none; visibility: hidden;">Vertical position measurement unit</label>
194
- <select id="background_vpos_measurement" name="background_vpos_measurement" aria-labelledby="background_vpos_measurement_label">></select></td>
195
- </tr>
196
- </table>
197
- </td>
198
- </tr>
199
- </table>
200
- </fieldset>
201
- </div>
202
-
203
- <div id="block_panel" class="panel">
204
- <fieldset>
205
- <legend>{#style_dlg.block}</legend>
206
- <table role="presentation" border="0">
207
- <tr>
208
- <td><label for="block_wordspacing">{#style_dlg.block_wordspacing}</label></td>
209
- <td>
210
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
211
- <tr>
212
- <td><select id="block_wordspacing" name="block_wordspacing" class="mceEditableSelect"></select></td>
213
- <td>&nbsp;</td>
214
- <td>
215
- <label id="block_wordspacing_measurement_label" for="block_wordspacing_measurement" style="display: none; visibility: hidden;">Word spacing measurement unit</label>
216
- <select id="block_wordspacing_measurement" name="block_wordspacing_measurement" aria-labelledby="block_wordspacing_measurement_label"></select>
217
- </td>
218
- </tr>
219
- </table>
220
- </td>
221
- </tr>
222
-
223
- <tr>
224
- <td><label for="block_letterspacing">{#style_dlg.block_letterspacing}</label></td>
225
- <td>
226
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
227
- <tr>
228
- <td><select id="block_letterspacing" name="block_letterspacing" class="mceEditableSelect"></select></td>
229
- <td>&nbsp;</td>
230
- <td>
231
- <label id="block_letterspacing_measurement_label" for="block_letterspacing_measurement" style="display: none; visibility: hidden;">Letter spacing measurement unit</label>
232
- <select id="block_letterspacing_measurement" name="block_letterspacing_measurement" aria-labelledby="block_letterspacing_measurement_label"></select>
233
- </td>
234
- </tr>
235
- </table>
236
- </td>
237
- </tr>
238
-
239
- <tr>
240
- <td><label for="block_vertical_alignment">{#style_dlg.block_vertical_alignment}</label></td>
241
- <td><select id="block_vertical_alignment" name="block_vertical_alignment" class="mceEditableSelect"></select></td>
242
- </tr>
243
-
244
- <tr>
245
- <td><label for="block_text_align">{#style_dlg.block_text_align}</label></td>
246
- <td><select id="block_text_align" name="block_text_align" class="mceEditableSelect"></select></td>
247
- </tr>
248
-
249
- <tr>
250
- <td><label for="block_text_indent">{#style_dlg.block_text_indent}</label></td>
251
- <td>
252
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
253
- <tr>
254
- <td><input type="text" id="block_text_indent" name="block_text_indent" /></td>
255
- <td>&nbsp;</td>
256
- <td>
257
- <label id="block_text_indent_measurement_label" for="block_text_indent_measurement" style="display: none; visibility: hidden;">Text Indent Measurement Unit</label>
258
-
259
- <select id="block_text_indent_measurement" name="block_text_indent_measurement" aria-labelledby="block_text_indent_measurement_label"></select>
260
- </td>
261
- </tr>
262
- </table>
263
- </td>
264
- </tr>
265
-
266
- <tr>
267
- <td><label for="block_whitespace">{#style_dlg.block_whitespace}</label></td>
268
- <td><select id="block_whitespace" name="block_whitespace" class="mceEditableSelect"></select></td>
269
- </tr>
270
-
271
- <tr>
272
- <td><label for="block_display">{#style_dlg.block_display}</label></td>
273
- <td><select id="block_display" name="block_display" class="mceEditableSelect"></select></td>
274
- </tr>
275
- </table>
276
- </fieldset>
277
- </div>
278
-
279
- <div id="box_panel" class="panel">
280
- <fieldset>
281
- <legend>{#style_dlg.box}</legend>
282
- <table role="presentation" border="0">
283
- <tr>
284
- <td><label for="box_width">{#style_dlg.box_width}</label></td>
285
- <td>
286
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
287
- <tr>
288
- <td><input type="text" id="box_width" name="box_width" class="mceEditableSelect" onChange="synch('box_width','positioning_width');" /></td>
289
- <td>&nbsp;</td>
290
- <td>
291
- <label id="box_width_measurement_label" for="box_width_measurement" style="display: none; visibility: hidden;">Box Width Measurement Unit</label>
292
- <select id="box_width_measurement" name="box_width_measurement" aria-labelledby="box_width_measurement_label"></select>
293
- </td>
294
- </tr>
295
- </table>
296
- </td>
297
- <td>&nbsp;&nbsp;&nbsp;<label for="box_float">{#style_dlg.box_float}</label></td>
298
- <td><select id="box_float" name="box_float" class="mceEditableSelect"></select></td>
299
- </tr>
300
-
301
- <tr>
302
- <td><label for="box_height">{#style_dlg.box_height}</label></td>
303
- <td>
304
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
305
- <tr>
306
- <td><input type="text" id="box_height" name="box_height" class="mceEditableSelect" onChange="synch('box_height','positioning_height');" /></td>
307
- <td>&nbsp;</td>
308
- <td>
309
- <label id="box_height_measurement_label" for="box_height_measurement" style="display: none; visibility: hidden;">Box Height Measurement Unit</label>
310
- <select id="box_height_measurement" name="box_height_measurement" aria-labelledby="box_height_measurement_label"></select>
311
- </td>
312
- </tr>
313
- </table>
314
- </td>
315
- <td>&nbsp;&nbsp;&nbsp;<label for="box_clear">{#style_dlg.box_clear}</label></td>
316
- <td><select id="box_clear" name="box_clear" class="mceEditableSelect"></select></td>
317
- </tr>
318
- </table>
319
- </fieldset>
320
-
321
- <div style="float: left; width: 49%">
322
- <fieldset>
323
- <legend>{#style_dlg.padding}</legend>
324
-
325
- <table role="presentation" border="0">
326
- <tr>
327
- <td>&nbsp;</td>
328
- <td><input type="checkbox" id="box_padding_same" name="box_padding_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_padding');" /> <label for="box_padding_same">{#style_dlg.same}</label></td>
329
- </tr>
330
- <tr>
331
- <td><label for="box_padding_top">{#style_dlg.top}</label></td>
332
- <td>
333
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
334
- <tr>
335
- <td><input type="text" id="box_padding_top" name="box_padding_top" class="mceEditableSelect" /></td>
336
- <td>&nbsp;</td>
337
- <td>
338
- <label id="box_padding_top_measurement_label" for="box_padding_top_measurement" style="display: none; visibility: hidden;">Padding Top Measurement Unit</label>
339
- <select id="box_padding_top_measurement" name="box_padding_top_measurement" aria-labelledby="box_padding_top_measurement_label"></select>
340
- </td>
341
- </tr>
342
- </table>
343
- </td>
344
- </tr>
345
- <tr>
346
- <td><label for="box_padding_right">{#style_dlg.right}</label></td>
347
- <td>
348
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
349
- <tr>
350
- <td><input type="text" id="box_padding_right" name="box_padding_right" class="mceEditableSelect" disabled="disabled" /></td>
351
- <td>&nbsp;</td>
352
- <td>
353
- <label id="box_padding_right_measurement_label" for="box_padding_right_measurement" style="display: none; visibility: hidden;">Padding Right Measurement Unit</label>
354
- <select id="box_padding_right_measurement" name="box_padding_right_measurement" disabled="disabled" aria-labelledby="box_padding_right_measurement_label"></select>
355
- </td>
356
- </tr>
357
- </table>
358
- </td>
359
- </tr>
360
- <tr>
361
- <td><label for="box_padding_bottom">{#style_dlg.bottom}</label></td>
362
- <td>
363
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
364
- <tr>
365
- <td><input type="text" id="box_padding_bottom" name="box_padding_bottom" class="mceEditableSelect" disabled="disabled" /></td>
366
- <td>&nbsp;</td>
367
- <td>
368
- <label id="box_padding_bottom_measurement_label" for="box_padding_bottom_measurement" style="display: none; visibility: hidden;">Padding Bottom Measurement Unit</label>
369
- <select id="box_padding_bottom_measurement" name="box_padding_bottom_measurement" disabled="disabled" aria-labelledby="box_padding_bottom_measurement_label"></select>
370
- </td>
371
- </tr>
372
- </table>
373
- </td>
374
- </tr>
375
- <tr>
376
- <td><label for="box_padding_left">{#style_dlg.left}</label></td>
377
- <td>
378
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
379
- <tr>
380
- <td><input type="text" id="box_padding_left" name="box_padding_left" class="mceEditableSelect" disabled="disabled" /></td>
381
- <td>&nbsp;</td>
382
- <td>
383
- <label id="box_padding_left_measurement_label" for="box_padding_left_measurement" style="display: none; visibility: hidden;">Padding Left Measurement Unit</label>
384
- <select id="box_padding_left_measurement" name="box_padding_left_measurement" disabled="disabled" aria-labelledby="box_padding_left_measurement_label"></select>
385
- </td>
386
- </tr>
387
- </table>
388
- </td>
389
- </tr>
390
- </table>
391
- </fieldset>
392
- </div>
393
-
394
- <div style="float: right; width: 49%">
395
- <fieldset>
396
- <legend>{#style_dlg.margin}</legend>
397
-
398
- <table role="presentation" border="0">
399
- <tr>
400
- <td>&nbsp;</td>
401
- <td><input type="checkbox" id="box_margin_same" name="box_margin_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_margin');" /> <label for="box_margin_same">{#style_dlg.same}</label></td>
402
- </tr>
403
- <tr>
404
- <td><label for="box_margin_top">{#style_dlg.top}</label></td>
405
- <td>
406
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
407
- <tr>
408
- <td><input type="text" id="box_margin_top" name="box_margin_top" class="mceEditableSelect" /></td>
409
- <td>&nbsp;</td>
410
- <td>
411
- <label id="box_margin_top_measurement_label" for="box_margin_top_measurement" style="display: none; visibility: hidden;">Margin Top Measurement Unit</label>
412
- <select id="box_margin_top_measurement" name="box_margin_top_measurement" aria-labelledby="box_margin_top_measurement_label"></select>
413
- </td>
414
- </tr>
415
- </table>
416
- </td>
417
- </tr>
418
- <tr>
419
- <td><label for="box_margin_right">{#style_dlg.right}</label></td>
420
- <td>
421
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
422
- <tr>
423
- <td><input type="text" id="box_margin_right" name="box_margin_right" class="mceEditableSelect" disabled="disabled" /></td>
424
- <td>&nbsp;</td>
425
- <td>
426
- <label id="box_margin_right_measurement_label" for="box_margin_right_measurement" style="display: none; visibility: hidden;">Margin Right Measurement Unit</label>
427
- <select id="box_margin_right_measurement" name="box_margin_right_measurement" disabled="disabled" aria-labelledby="box_margin_right_measurement_label"></select>
428
- </td>
429
- </tr>
430
- </table>
431
- </td>
432
- </tr>
433
- <tr>
434
- <td><label for="box_margin_bottom">{#style_dlg.bottom}</label></td>
435
- <td>
436
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
437
- <tr>
438
- <td><input type="text" id="box_margin_bottom" name="box_margin_bottom" class="mceEditableSelect" disabled="disabled" /></td>
439
- <td>&nbsp;</td>
440
- <td>
441
- <label id="box_margin_bottom_measurement_label" for="box_margin_bottom_measurement" style="display: none; visibility: hidden;">Margin Bottom Measurement Unit</label>
442
- <select id="box_margin_bottom_measurement" name="box_margin_bottom_measurement" disabled="disabled" aria-labelledby="box_margin_bottom_measurement_label"></select>
443
- </td>
444
- </tr>
445
- </table>
446
- </td>
447
- </tr>
448
- <tr>
449
- <td><label for="box_margin_left">{#style_dlg.left}</label></td>
450
- <td>
451
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
452
- <tr>
453
- <td><input type="text" id="box_margin_left" name="box_margin_left" class="mceEditableSelect" disabled="disabled" /></td>
454
- <td>&nbsp;</td>
455
- <td>
456
- <label id="box_margin_left_measurement_label" for="box_margin_left_measurement" style="display: none; visibility: hidden;">Margin Left Measurement Unit</label>
457
- <select id="box_margin_left_measurement" name="box_margin_left_measurement" disabled="disabled" aria-labelledby="box_margin_left_measurement_label"></select>
458
- </td>
459
- </tr>
460
- </table>
461
- </td>
462
- </tr>
463
- </table>
464
- </fieldset>
465
- </div>
466
- <br style="clear: both" />
467
- </div>
468
-
469
- <div id="border_panel" class="panel">
470
- <fieldset>
471
- <legend>{#style_dlg.border}</legend>
472
- <table role="presentation" border="0" cellspacing="0" cellpadding="0" width="100%">
473
- <tr>
474
- <td class="tdelim">&nbsp;</td>
475
- <td class="tdelim delim">&nbsp;</td>
476
- <td class="tdelim">{#style_dlg.style}</td>
477
- <td class="tdelim delim">&nbsp;</td>
478
- <td class="tdelim">{#style_dlg.width}</td>
479
- <td class="tdelim delim">&nbsp;</td>
480
- <td class="tdelim">{#style_dlg.color}</td>
481
- </tr>
482
-
483
- <tr>
484
- <td>&nbsp;</td>
485
- <td class="delim">&nbsp;</td>
486
- <td><input type="checkbox" id="border_style_same" name="border_style_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_style');" /> <label for="border_style_same">{#style_dlg.same}</label></td>
487
- <td class="delim">&nbsp;</td>
488
- <td><input type="checkbox" id="border_width_same" name="border_width_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_width');" /> <label for="border_width_same">{#style_dlg.same}</label></td>
489
- <td class="delim">&nbsp;</td>
490
- <td><input type="checkbox" id="border_color_same" name="border_color_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_color');" /> <label for="border_color_same">{#style_dlg.same}</label></td>
491
- </tr>
492
-
493
- <tr>
494
- <td>{#style_dlg.top}</td>
495
- <td class="delim">&nbsp;</td>
496
- <td><select id="border_style_top" name="border_style_top" class="mceEditableSelect"></select></td>
497
- <td class="delim">&nbsp;</td>
498
- <td>
499
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
500
- <tr>
501
- <td><select id="border_width_top" name="border_width_top" class="mceEditableSelect"></select></td>
502
- <td>&nbsp;</td>
503
- <td>
504
- <label id="border_width_top_measurement_label" for="border_width_top_measurement" style="display: none; visibility: hidden;">Width top Measurement Unit</label>
505
- <select id="border_width_top_measurement" name="border_width_top_measurement" aria-labelledby="border_width_top_measurement_label"></select>
506
- </td>
507
- </tr>
508
- </table>
509
- </td>
510
- <td class="delim">&nbsp;</td>
511
- <td>
512
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
513
- <tr>
514
- <td><input id="border_color_top" name="border_color_top" type="text" value="" size="9" onChange="updateColor('border_color_top_pick','border_color_top');" /></td>
515
- <td id="border_color_top_pickcontainer">&nbsp;</td>
516
- </tr>
517
- </table>
518
- </td>
519
- </tr>
520
-
521
- <tr>
522
- <td>{#style_dlg.right}</td>
523
- <td class="delim">&nbsp;</td>
524
- <td><select id="border_style_right" name="border_style_right" class="mceEditableSelect" disabled="disabled"></select></td>
525
- <td class="delim">&nbsp;</td>
526
- <td>
527
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
528
- <tr>
529
- <td><select id="border_width_right" name="border_width_right" class="mceEditableSelect" disabled="disabled"></select></td>
530
- <td>&nbsp;</td>
531
- <td>
532
- <label id="border_width_right_measurement_label" for="border_width_right_measurement" style="display: none; visibility: hidden;">Width Right Measurement Unit</label>
533
- <select id="border_width_right_measurement" name="border_width_right_measurement" disabled="disabled" aria-labelledby="border_width_right_measurement_label"></select>
534
- </td>
535
- </tr>
536
- </table>
537
- </td>
538
- <td class="delim">&nbsp;</td>
539
- <td>
540
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
541
- <tr>
542
- <td><input id="border_color_right" name="border_color_right" type="text" value="" size="9" onChange="updateColor('border_color_right_pick','border_color_right');" disabled="disabled" /></td>
543
- <td id="border_color_right_pickcontainer">&nbsp;</td>
544
- </tr>
545
- </table>
546
- </td>
547
- </tr>
548
-
549
- <tr>
550
- <td>{#style_dlg.bottom}</td>
551
- <td class="delim">&nbsp;</td>
552
- <td><select id="border_style_bottom" name="border_style_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
553
- <td class="delim">&nbsp;</td>
554
- <td>
555
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
556
- <tr>
557
- <td><select id="border_width_bottom" name="border_width_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
558
- <td>&nbsp;</td>
559
- <td>
560
- <label id="border_width_bottom_measurement_label" for="border_width_bottom_measurement" style="display: none; visibility: hidden;">Width Bottom Measurement Unit</label>
561
- <select id="border_width_bottom_measurement" name="border_width_bottom_measurement" disabled="disabled" aria-labelledby="border_width_bottom_measurement_label"></select>
562
- </td>
563
- </tr>
564
- </table>
565
- </td>
566
- <td class="delim">&nbsp;</td>
567
- <td>
568
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
569
- <tr>
570
- <td><input id="border_color_bottom" name="border_color_bottom" type="text" value="" size="9" onChange="updateColor('border_color_bottom_pick','border_color_bottom');" disabled="disabled" /></td>
571
- <td id="border_color_bottom_pickcontainer">&nbsp;</td>
572
- </tr>
573
- </table>
574
- </td>
575
- </tr>
576
-
577
- <tr>
578
- <td>{#style_dlg.left}</td>
579
- <td class="delim">&nbsp;</td>
580
- <td><select id="border_style_left" name="border_style_left" class="mceEditableSelect" disabled="disabled"></select></td>
581
- <td class="delim">&nbsp;</td>
582
- <td>
583
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
584
- <tr>
585
- <td><select id="border_width_left" name="border_width_left" class="mceEditableSelect" disabled="disabled"></select></td>
586
- <td>&nbsp;</td>
587
- <td>
588
- <label id="border_width_left_measurement_label" for="border_width_left_measurement" style="display: none; visibility: hidden;">Width Left Measurement Unit</label>
589
- <select id="border_width_left_measurement" name="border_width_left_measurement" disabled="disabled" aria-labelledby="border_width_left_measurement_label"></select>
590
- </td>
591
- </tr>
592
- </table>
593
- </td>
594
- <td class="delim">&nbsp;</td>
595
- <td>
596
- <table role="presentation" border="0" cellpadding="0" cellspacing="0">
597
- <tr>
598
- <td><input id="border_color_left" name="border_color_left" type="text" value="" size="9" onChange="updateColor('border_color_left_pick','border_color_left');" disabled="disabled" /></td>
599
- <td id="border_color_left_pickcontainer">&nbsp;</td>
600
- </tr>
601
- </table>
602
- </td>
603
- </tr>
604
- </table>
605
- </fieldset>
606
- </div>
607
-
608
- <div id="list_panel" class="panel">
609
- <fieldset>
610
- <legend>{#style_dlg.list}</legend>
611
- <table role="presentation" border="0">
612
- <tr>
613
- <td><label for="list_type">{#style_dlg.list_type}</label></td>
614
- <td><select id="list_type" name="list_type" class="mceEditableSelect"></select></td>
615
- </tr>
616
-
617
- <tr>
618
- <td><label for="list_bullet_image">{#style_dlg.bullet_image}</label></td>
619
- <td><input id="list_bullet_image" name="list_bullet_image" type="text" /></td>
620
- </tr>
621
-
622
- <tr>
623
- <td><label for="list_position">{#style_dlg.position}</label></td>
624
- <td><select id="list_position" name="list_position" class="mceEditableSelect"></select></td>
625
- </tr>
626
- </table>
627
- </fieldset>
628
- </div>
629
-
630
- <div id="positioning_panel" class="panel">
631
- <fieldset>
632
- <legend>{#style_dlg.position}</legend>
633
- <table role="presentation" border="0">
634
- <tr>
635
- <td><label for="positioning_type">{#style_dlg.positioning_type}</label></td>
636
- <td><select id="positioning_type" name="positioning_type" class="mceEditableSelect"></select></td>
637
- <td>&nbsp;&nbsp;&nbsp;<label for="positioning_visibility">{#style_dlg.visibility}</label></td>
638
- <td><select id="positioning_visibility" name="positioning_visibility" class="mceEditableSelect"></select></td>
639
- </tr>
640
-
641
- <tr>
642
- <td><label for="positioning_width">{#style_dlg.width}</label></td>
643
- <td>
644
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
645
- <tr>
646
- <td><input type="text" id="positioning_width" name="positioning_width" onChange="synch('positioning_width','box_width');" /></td>
647
- <td>&nbsp;</td>
648
- <td>
649
- <label id="positioning_width_measurement_label" for="positioning_width_measurement" style="display: none; visibility: hidden;">Positioning width Measurement Unit</label>
650
- <select id="positioning_width_measurement" name="positioning_width_measurement" aria-labelledby="positioning_width_measurement_label"></select>
651
- </td>
652
- </tr>
653
- </table>
654
- </td>
655
- <td>&nbsp;&nbsp;&nbsp;<label for="positioning_zindex">{#style_dlg.zindex}</label></td>
656
- <td><input type="text" id="positioning_zindex" name="positioning_zindex" /></td>
657
- </tr>
658
-
659
- <tr>
660
- <td><label for="positioning_height">{#style_dlg.height}</label></td>
661
- <td>
662
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
663
- <tr>
664
- <td><input type="text" id="positioning_height" name="positioning_height" onChange="synch('positioning_height','box_height');" /></td>
665
- <td>&nbsp;</td>
666
- <td>
667
- <label id="positioning_height_measurement_label" for="positioning_height_measurement" style="display: none; visibility: hidden;">Positioning Height Measurement Unit</label>
668
- <select id="positioning_height_measurement" name="positioning_height_measurement" aria-labelledby="positioning_height_measurement_label"></select>
669
- </td>
670
- </tr>
671
- </table>
672
- </td>
673
- <td>&nbsp;&nbsp;&nbsp;<label for="positioning_overflow">{#style_dlg.overflow}</label></td>
674
- <td><select id="positioning_overflow" name="positioning_overflow" class="mceEditableSelect"></select></td>
675
- </tr>
676
- </table>
677
- </fieldset>
678
-
679
- <div style="float: left; width: 49%">
680
- <fieldset>
681
- <legend>{#style_dlg.placement}</legend>
682
-
683
- <table role="presentation" border="0">
684
- <tr>
685
- <td>&nbsp;</td>
686
- <td><input type="checkbox" id="positioning_placement_same" name="positioning_placement_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_placement');" /> <label for="positioning_placement_same">{#style_dlg.same}</label></td>
687
- </tr>
688
- <tr>
689
- <td>{#style_dlg.top}</td>
690
- <td>
691
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
692
- <tr>
693
- <td><input type="text" id="positioning_placement_top" name="positioning_placement_top" /></td>
694
- <td>&nbsp;</td>
695
- <td>
696
- <label id="positioning_placement_top_measurement_label" for="positioning_placement_top_measurement" style="display: none; visibility: hidden;">Placement Top Measurement Unit</label>
697
- <select id="positioning_placement_top_measurement" name="positioning_placement_top_measurement" aria-labelledby="positioning_placement_top_measurement_label"></select>
698
- </td>
699
- </tr>
700
- </table>
701
- </td>
702
- </tr>
703
- <tr>
704
- <td>{#style_dlg.right}</td>
705
- <td>
706
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
707
- <tr>
708
- <td><input type="text" id="positioning_placement_right" name="positioning_placement_right" disabled="disabled" /></td>
709
- <td>&nbsp;</td>
710
- <td>
711
- <label id="positioning_placement_right_measurement_label" for="positioning_placement_right_measurement" style="display: none; visibility: hidden;">Placement Right Measurement Unit</label>
712
- <select id="positioning_placement_right_measurement" name="positioning_placement_right_measurement" disabled="disabled" aria-labelledby="positioning_placement_right_measurement_label"></select>
713
- </td>
714
- </tr>
715
- </table>
716
- </td>
717
- </tr>
718
- <tr>
719
- <td>{#style_dlg.bottom}</td>
720
- <td>
721
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
722
- <tr>
723
- <td><input type="text" id="positioning_placement_bottom" name="positioning_placement_bottom" disabled="disabled" /></td>
724
- <td>&nbsp;</td>
725
- <td>
726
- <label id="positioning_placement_bottom_measurement_label" for="positioning_placement_bottom_measurement" style="display: none; visibility: hidden;">Placement Bottom Measurement Unit</label>
727
- <select id="positioning_placement_bottom_measurement" name="positioning_placement_bottom_measurement" disabled="disabled" aria-labelledby="positioning_placement_bottom_measurement_label"></select>
728
- </td>
729
- </tr>
730
- </table>
731
- </td>
732
- </tr>
733
- <tr>
734
- <td>{#style_dlg.left}</td>
735
- <td>
736
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
737
- <tr>
738
- <td><input type="text" id="positioning_placement_left" name="positioning_placement_left" disabled="disabled" /></td>
739
- <td>&nbsp;</td>
740
- <td>
741
- <label id="positioning_placement_left_measurement_label" for="positioning_placement_left_measurement" style="display: none; visibility: hidden;">Placement Left Measurement Unit</label>
742
- <select id="positioning_placement_left_measurement" name="positioning_placement_left_measurement" disabled="disabled" aria-labelledby="positioning_placement_left_measurement_label"></select>
743
- </td>
744
- </tr>
745
- </table>
746
- </td>
747
- </tr>
748
- </table>
749
- </fieldset>
750
- </div>
751
-
752
- <div style="float: right; width: 49%">
753
- <fieldset>
754
- <legend>{#style_dlg.clip}</legend>
755
-
756
- <table role="presentation" border="0">
757
- <tr>
758
- <td>&nbsp;</td>
759
- <td><input type="checkbox" id="positioning_clip_same" name="positioning_clip_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_clip');" /> <label for="positioning_clip_same">{#style_dlg.same}</label></td>
760
- </tr>
761
- <tr>
762
- <td>{#style_dlg.top}</td>
763
- <td>
764
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
765
- <tr>
766
- <td><input type="text" id="positioning_clip_top" name="positioning_clip_top" /></td>
767
- <td>&nbsp;</td>
768
- <td>
769
- <label id="positioning_clip_top_measurement_label" for="positioning_clip_top_measurement" style="display: none; visibility: hidden;">Clip Top Measurement Unit</label>
770
- <select id="positioning_clip_top_measurement" name="positioning_clip_top_measurement" aria-labelledby="positioning_clip_top_measurement_label"></select>
771
- </td>
772
- </tr>
773
- </table>
774
- </td>
775
- </tr>
776
- <tr>
777
- <td>{#style_dlg.right}</td>
778
- <td>
779
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
780
- <tr>
781
- <td><input type="text" id="positioning_clip_right" name="positioning_clip_right" disabled="disabled" /></td>
782
- <td>&nbsp;</td>
783
- <td>
784
- <label id="positioning_clip_right_measurement_label" for="positioning_clip_right_measurement" style="display: none; visibility: hidden;">Clip Right Measurement Unit</label>
785
- <select id="positioning_clip_right_measurement" name="positioning_clip_right_measurement" disabled="disabled" aria-labelledby="positioning_clip_right_measurement_label"></select>
786
- </td>
787
- </tr>
788
- </table>
789
- </td>
790
- </tr>
791
- <tr>
792
- <td>{#style_dlg.bottom}</td>
793
- <td>
794
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
795
- <tr>
796
- <td><input type="text" id="positioning_clip_bottom" name="positioning_clip_bottom" disabled="disabled" /></td>
797
- <td>&nbsp;</td>
798
- <td>
799
- <label id="positioning_clip_bottom_measurement_label" for="positioning_clip_bottom_measurement" style="display: none; visibility: hidden;">Clip Bottom Measurement Unit</label>
800
- <select id="positioning_clip_bottom_measurement" name="positioning_clip_bottom_measurement" disabled="disabled" aria-labelledby="positioning_clip_bottom_measurement_label"></select>
801
- </td>
802
- </tr>
803
- </table>
804
- </td>
805
- </tr>
806
- <tr>
807
- <td>{#style_dlg.left}</td>
808
- <td>
809
- <table role="presentation" border="0" cellspacing="0" cellpadding="0">
810
- <tr>
811
- <td><input type="text" id="positioning_clip_left" name="positioning_clip_left" disabled="disabled" /></td>
812
- <td>&nbsp;</td>
813
- <td>
814
- <label id="positioning_clip_left_measurement_label" for="positioning_clip_left_measurement" style="display: none; visibility: hidden;">Clip Left Measurement Unit</label>
815
- <select id="positioning_clip_left_measurement" name="positioning_clip_left_measurement" disabled="disabled" aria-labelledby="positioning_clip_left_measurement_label"></select>
816
- </td>
817
- </tr>
818
- </table>
819
- </td>
820
- </tr>
821
- </table>
822
- </fieldset>
823
- </div>
824
- <br style="clear: both" />
825
- </div>
826
- </div>
827
-
828
- <div class="panel_toggle_insert_span">
829
- <input type="checkbox" class="checkbox" id="toggle_insert_span" name="toggle_insert_span" onClick="toggleApplyAction();" />
830
- <label for="toggle_insert_span">{#style_dlg.toggle_insert_span}</label>
831
- </div>
832
-
833
- <div class="mceActionPanel">
834
- <input type="submit" id="insert" name="insert" value="{#update}" />
835
- <input type="button" class="button" id="apply" name="apply" value="{#style_dlg.apply}" onClick="applyAction();" />
836
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onClick="tinyMCEPopup.close();" />
837
- </div>
838
- </form>
839
-
840
- <div style="display: none">
841
- <div id="container"></div>
842
- </div>
843
-
844
- </body>
845
- </html>
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>{#style_dlg.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/props.js"></script>
10
+ <link href="css/props.css" rel="stylesheet" type="text/css" />
11
+ </head>
12
+
13
+ <body id="styleprops" style="display: none" role="application" aria-labelledby="app_title">
14
+ <span id="app_title" style="display:none">{#style_dlg.title}</span>
15
+ <form onsubmit="updateAction();return false;" action="#">
16
+ <div class="tabs">
17
+ <ul>
18
+ <li id="text_tab" class="current" aria-controls="text_panel"><span><a href="javascript:mcTabs.displayTab('text_tab','text_panel');" onMouseDown="return false;">{#style_dlg.text_tab}</a></span></li>
19
+ <li id="background_tab" aria-controls="background_panel"><span><a href="javascript:mcTabs.displayTab('background_tab','background_panel');" onMouseDown="return false;">{#style_dlg.background_tab}</a></span></li>
20
+ <li id="block_tab" aria-controls="block_panel"><span><a href="javascript:mcTabs.displayTab('block_tab','block_panel');" onMouseDown="return false;">{#style_dlg.block_tab}</a></span></li>
21
+ <li id="box_tab" aria-controls="box_panel"><span><a href="javascript:mcTabs.displayTab('box_tab','box_panel');" onMouseDown="return false;">{#style_dlg.box_tab}</a></span></li>
22
+ <li id="border_tab" aria-controls="border_panel"><span><a href="javascript:mcTabs.displayTab('border_tab','border_panel');" onMouseDown="return false;">{#style_dlg.border_tab}</a></span></li>
23
+ <li id="list_tab" aria-controls="list_panel"><span><a href="javascript:mcTabs.displayTab('list_tab','list_panel');" onMouseDown="return false;">{#style_dlg.list_tab}</a></span></li>
24
+ <li id="positioning_tab" aria-controls="positioning_panel"><span><a href="javascript:mcTabs.displayTab('positioning_tab','positioning_panel');" onMouseDown="return false;">{#style_dlg.positioning_tab}</a></span></li>
25
+ </ul>
26
+ </div>
27
+
28
+ <div class="panel_wrapper">
29
+ <div id="text_panel" class="panel current">
30
+ <fieldset>
31
+ <legend>{#style_dlg.text}</legend>
32
+ <table role="presentation" border="0" width="100%">
33
+ <tr>
34
+ <td><label for="text_font">{#style_dlg.text_font}</label></td>
35
+ <td colspan="3">
36
+ <select id="text_font" name="text_font" class="mceEditableSelect mceFocus"></select>
37
+ </td>
38
+ </tr>
39
+ <tr>
40
+ <td><label for="text_size">{#style_dlg.text_size}</label></td>
41
+ <td>
42
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
43
+ <tr>
44
+ <td><select id="text_size" name="text_size" class="mceEditableSelect"></select></td>
45
+ <td>&nbsp;</td>
46
+ <td>
47
+ <label id="text_size_measurement_label" for="text_size_measurement" style="display: none; visibility: hidden;">Text Size Measurement Unit</label>
48
+ <select id="text_size_measurement" name="text_size_measurement" aria-labelledby="text_size_measurement_label"></select>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+ </td>
53
+ <td><label for="text_weight">{#style_dlg.text_weight}</label></td>
54
+ <td>
55
+ <select id="text_weight" name="text_weight"></select>
56
+ </td>
57
+ </tr>
58
+ <tr>
59
+ <td><label for="text_style">{#style_dlg.text_style}</label></td>
60
+ <td>
61
+ <select id="text_style" name="text_style" class="mceEditableSelect"></select>
62
+ </td>
63
+ <td><label for="text_variant">{#style_dlg.text_variant}</label></td>
64
+ <td>
65
+ <select id="text_variant" name="text_variant"></select>
66
+ </td>
67
+ </tr>
68
+ <tr>
69
+ <td><label for="text_lineheight">{#style_dlg.text_lineheight}</label></td>
70
+ <td>
71
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
72
+ <tr>
73
+ <td>
74
+ <select id="text_lineheight" name="text_lineheight" class="mceEditableSelect"></select>
75
+ </td>
76
+ <td>&nbsp;</td>
77
+ <td>
78
+ <label id="text_lineheight_measurement_label" for="text_lineheight_measurement" style="display: none; visibility: hidden;">Line Height Measurement Unit</label>
79
+ <select id="text_lineheight_measurement" name="text_lineheight_measurement" aria-labelledby="text_lineheight_measurement_label"></select>
80
+ </td>
81
+ </tr>
82
+ </table>
83
+ </td>
84
+ <td><label for="text_case">{#style_dlg.text_case}</label></td>
85
+ <td>
86
+ <select id="text_case" name="text_case"></select>
87
+ </td>
88
+ </tr>
89
+ <tr>
90
+ <td><label for="text_color">{#style_dlg.text_color}</label></td>
91
+ <td colspan="2">
92
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
93
+ <tr>
94
+ <td><input id="text_color" name="text_color" type="text" value="" size="9" onChange="updateColor('text_color_pick','text_color');" /></td>
95
+ <td id="text_color_pickcontainer">&nbsp;</td>
96
+ </tr>
97
+ </table>
98
+ </td>
99
+ </tr>
100
+ <tr>
101
+ <td valign="top" style="vertical-align: top; padding-top: 3px;">{#style_dlg.text_decoration}</td>
102
+ <td colspan="2">
103
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
104
+ <tr>
105
+ <td><input id="text_underline" name="text_underline" class="checkbox" type="checkbox" /></td>
106
+ <td><label for="text_underline">{#style_dlg.text_underline}</label></td>
107
+ </tr>
108
+ <tr>
109
+ <td><input id="text_overline" name="text_overline" class="checkbox" type="checkbox" /></td>
110
+ <td><label for="text_overline">{#style_dlg.text_overline}</label></td>
111
+ </tr>
112
+ <tr>
113
+ <td><input id="text_linethrough" name="text_linethrough" class="checkbox" type="checkbox" /></td>
114
+ <td><label for="text_linethrough">{#style_dlg.text_striketrough}</label></td>
115
+ </tr>
116
+ <tr>
117
+ <td><input id="text_blink" name="text_blink" class="checkbox" type="checkbox" /></td>
118
+ <td><label for="text_blink">{#style_dlg.text_blink}</label></td>
119
+ </tr>
120
+ <tr>
121
+ <td><input id="text_none" name="text_none" class="checkbox" type="checkbox" onclick="updateTextDecorations();"/></td>
122
+ <td><label for="text_none">{#style_dlg.text_none}</label></td>
123
+ </tr>
124
+ </table>
125
+ </td>
126
+ </tr>
127
+ </table>
128
+ </fieldset>
129
+ </div>
130
+
131
+ <div id="background_panel" class="panel">
132
+ <fieldset>
133
+ <legend>{#style_dlg.background}</legend>
134
+ <table role="presentation" border="0">
135
+ <tr>
136
+ <td><label for="background_color">{#style_dlg.background_color}</label></td>
137
+ <td>
138
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
139
+ <tr>
140
+ <td><input id="background_color" name="background_color" type="text" value="" size="9" onChange="updateColor('background_color_pick','background_color');" /></td>
141
+ <td id="background_color_pickcontainer">&nbsp;</td>
142
+ </tr>
143
+ </table>
144
+ </td>
145
+ </tr>
146
+
147
+ <tr>
148
+ <td><label for="background_image">{#style_dlg.background_image}</label></td>
149
+ <td><table role="presentation" border="0" cellspacing="0" cellpadding="0">
150
+ <tr>
151
+ <td><input id="background_image" name="background_image" type="text" /></td>
152
+ <td id="background_image_browser">&nbsp;</td>
153
+ </tr>
154
+ </table>
155
+ </td>
156
+ </tr>
157
+
158
+ <tr>
159
+ <td><label for="background_repeat">{#style_dlg.background_repeat}</label></td>
160
+ <td><select id="background_repeat" name="background_repeat" class="mceEditableSelect"></select></td>
161
+ </tr>
162
+
163
+ <tr>
164
+ <td><label for="background_attachment">{#style_dlg.background_attachment}</label></td>
165
+ <td><select id="background_attachment" name="background_attachment" class="mceEditableSelect"></select></td>
166
+ </tr>
167
+
168
+ <tr>
169
+ <td><label for="background_hpos">{#style_dlg.background_hpos}</label></td>
170
+ <td>
171
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
172
+ <tr>
173
+ <td><select id="background_hpos" name="background_hpos" class="mceEditableSelect"></select></td>
174
+ <td>&nbsp;</td>
175
+ <td>
176
+ <label id="background_hpos_measurement_label" for="background_hpos_measurement" style="display: none; visibility: hidden;">Horizontal position measurement unit</label>
177
+ <select id="background_hpos_measurement" name="background_hpos_measurement" aria-labelledby="background_hpos_measurement_label"></select>
178
+ </td>
179
+ </tr>
180
+ </table>
181
+ </td>
182
+ </tr>
183
+
184
+ <tr>
185
+ <td><label for="background_vpos">{#style_dlg.background_vpos}</label></td>
186
+ <td>
187
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
188
+ <tr>
189
+ <td><select id="background_vpos" name="background_vpos" class="mceEditableSelect"></select></td>
190
+ <td>&nbsp;</td>
191
+ <td>
192
+
193
+ <label id="background_vpos_measurement_label" for="background_vpos_measurement" style="display: none; visibility: hidden;">Vertical position measurement unit</label>
194
+ <select id="background_vpos_measurement" name="background_vpos_measurement" aria-labelledby="background_vpos_measurement_label">></select></td>
195
+ </tr>
196
+ </table>
197
+ </td>
198
+ </tr>
199
+ </table>
200
+ </fieldset>
201
+ </div>
202
+
203
+ <div id="block_panel" class="panel">
204
+ <fieldset>
205
+ <legend>{#style_dlg.block}</legend>
206
+ <table role="presentation" border="0">
207
+ <tr>
208
+ <td><label for="block_wordspacing">{#style_dlg.block_wordspacing}</label></td>
209
+ <td>
210
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
211
+ <tr>
212
+ <td><select id="block_wordspacing" name="block_wordspacing" class="mceEditableSelect"></select></td>
213
+ <td>&nbsp;</td>
214
+ <td>
215
+ <label id="block_wordspacing_measurement_label" for="block_wordspacing_measurement" style="display: none; visibility: hidden;">Word spacing measurement unit</label>
216
+ <select id="block_wordspacing_measurement" name="block_wordspacing_measurement" aria-labelledby="block_wordspacing_measurement_label"></select>
217
+ </td>
218
+ </tr>
219
+ </table>
220
+ </td>
221
+ </tr>
222
+
223
+ <tr>
224
+ <td><label for="block_letterspacing">{#style_dlg.block_letterspacing}</label></td>
225
+ <td>
226
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
227
+ <tr>
228
+ <td><select id="block_letterspacing" name="block_letterspacing" class="mceEditableSelect"></select></td>
229
+ <td>&nbsp;</td>
230
+ <td>
231
+ <label id="block_letterspacing_measurement_label" for="block_letterspacing_measurement" style="display: none; visibility: hidden;">Letter spacing measurement unit</label>
232
+ <select id="block_letterspacing_measurement" name="block_letterspacing_measurement" aria-labelledby="block_letterspacing_measurement_label"></select>
233
+ </td>
234
+ </tr>
235
+ </table>
236
+ </td>
237
+ </tr>
238
+
239
+ <tr>
240
+ <td><label for="block_vertical_alignment">{#style_dlg.block_vertical_alignment}</label></td>
241
+ <td><select id="block_vertical_alignment" name="block_vertical_alignment" class="mceEditableSelect"></select></td>
242
+ </tr>
243
+
244
+ <tr>
245
+ <td><label for="block_text_align">{#style_dlg.block_text_align}</label></td>
246
+ <td><select id="block_text_align" name="block_text_align" class="mceEditableSelect"></select></td>
247
+ </tr>
248
+
249
+ <tr>
250
+ <td><label for="block_text_indent">{#style_dlg.block_text_indent}</label></td>
251
+ <td>
252
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
253
+ <tr>
254
+ <td><input type="text" id="block_text_indent" name="block_text_indent" /></td>
255
+ <td>&nbsp;</td>
256
+ <td>
257
+ <label id="block_text_indent_measurement_label" for="block_text_indent_measurement" style="display: none; visibility: hidden;">Text Indent Measurement Unit</label>
258
+
259
+ <select id="block_text_indent_measurement" name="block_text_indent_measurement" aria-labelledby="block_text_indent_measurement_label"></select>
260
+ </td>
261
+ </tr>
262
+ </table>
263
+ </td>
264
+ </tr>
265
+
266
+ <tr>
267
+ <td><label for="block_whitespace">{#style_dlg.block_whitespace}</label></td>
268
+ <td><select id="block_whitespace" name="block_whitespace" class="mceEditableSelect"></select></td>
269
+ </tr>
270
+
271
+ <tr>
272
+ <td><label for="block_display">{#style_dlg.block_display}</label></td>
273
+ <td><select id="block_display" name="block_display" class="mceEditableSelect"></select></td>
274
+ </tr>
275
+ </table>
276
+ </fieldset>
277
+ </div>
278
+
279
+ <div id="box_panel" class="panel">
280
+ <fieldset>
281
+ <legend>{#style_dlg.box}</legend>
282
+ <table role="presentation" border="0">
283
+ <tr>
284
+ <td><label for="box_width">{#style_dlg.box_width}</label></td>
285
+ <td>
286
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
287
+ <tr>
288
+ <td><input type="text" id="box_width" name="box_width" class="mceEditableSelect" onChange="synch('box_width','positioning_width');" /></td>
289
+ <td>&nbsp;</td>
290
+ <td>
291
+ <label id="box_width_measurement_label" for="box_width_measurement" style="display: none; visibility: hidden;">Box Width Measurement Unit</label>
292
+ <select id="box_width_measurement" name="box_width_measurement" aria-labelledby="box_width_measurement_label"></select>
293
+ </td>
294
+ </tr>
295
+ </table>
296
+ </td>
297
+ <td>&nbsp;&nbsp;&nbsp;<label for="box_float">{#style_dlg.box_float}</label></td>
298
+ <td><select id="box_float" name="box_float" class="mceEditableSelect"></select></td>
299
+ </tr>
300
+
301
+ <tr>
302
+ <td><label for="box_height">{#style_dlg.box_height}</label></td>
303
+ <td>
304
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
305
+ <tr>
306
+ <td><input type="text" id="box_height" name="box_height" class="mceEditableSelect" onChange="synch('box_height','positioning_height');" /></td>
307
+ <td>&nbsp;</td>
308
+ <td>
309
+ <label id="box_height_measurement_label" for="box_height_measurement" style="display: none; visibility: hidden;">Box Height Measurement Unit</label>
310
+ <select id="box_height_measurement" name="box_height_measurement" aria-labelledby="box_height_measurement_label"></select>
311
+ </td>
312
+ </tr>
313
+ </table>
314
+ </td>
315
+ <td>&nbsp;&nbsp;&nbsp;<label for="box_clear">{#style_dlg.box_clear}</label></td>
316
+ <td><select id="box_clear" name="box_clear" class="mceEditableSelect"></select></td>
317
+ </tr>
318
+ </table>
319
+ </fieldset>
320
+
321
+ <div style="float: left; width: 49%">
322
+ <fieldset>
323
+ <legend>{#style_dlg.padding}</legend>
324
+
325
+ <table role="presentation" border="0">
326
+ <tr>
327
+ <td>&nbsp;</td>
328
+ <td><input type="checkbox" id="box_padding_same" name="box_padding_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_padding');" /> <label for="box_padding_same">{#style_dlg.same}</label></td>
329
+ </tr>
330
+ <tr>
331
+ <td><label for="box_padding_top">{#style_dlg.top}</label></td>
332
+ <td>
333
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
334
+ <tr>
335
+ <td><input type="text" id="box_padding_top" name="box_padding_top" class="mceEditableSelect" /></td>
336
+ <td>&nbsp;</td>
337
+ <td>
338
+ <label id="box_padding_top_measurement_label" for="box_padding_top_measurement" style="display: none; visibility: hidden;">Padding Top Measurement Unit</label>
339
+ <select id="box_padding_top_measurement" name="box_padding_top_measurement" aria-labelledby="box_padding_top_measurement_label"></select>
340
+ </td>
341
+ </tr>
342
+ </table>
343
+ </td>
344
+ </tr>
345
+ <tr>
346
+ <td><label for="box_padding_right">{#style_dlg.right}</label></td>
347
+ <td>
348
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
349
+ <tr>
350
+ <td><input type="text" id="box_padding_right" name="box_padding_right" class="mceEditableSelect" disabled="disabled" /></td>
351
+ <td>&nbsp;</td>
352
+ <td>
353
+ <label id="box_padding_right_measurement_label" for="box_padding_right_measurement" style="display: none; visibility: hidden;">Padding Right Measurement Unit</label>
354
+ <select id="box_padding_right_measurement" name="box_padding_right_measurement" disabled="disabled" aria-labelledby="box_padding_right_measurement_label"></select>
355
+ </td>
356
+ </tr>
357
+ </table>
358
+ </td>
359
+ </tr>
360
+ <tr>
361
+ <td><label for="box_padding_bottom">{#style_dlg.bottom}</label></td>
362
+ <td>
363
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
364
+ <tr>
365
+ <td><input type="text" id="box_padding_bottom" name="box_padding_bottom" class="mceEditableSelect" disabled="disabled" /></td>
366
+ <td>&nbsp;</td>
367
+ <td>
368
+ <label id="box_padding_bottom_measurement_label" for="box_padding_bottom_measurement" style="display: none; visibility: hidden;">Padding Bottom Measurement Unit</label>
369
+ <select id="box_padding_bottom_measurement" name="box_padding_bottom_measurement" disabled="disabled" aria-labelledby="box_padding_bottom_measurement_label"></select>
370
+ </td>
371
+ </tr>
372
+ </table>
373
+ </td>
374
+ </tr>
375
+ <tr>
376
+ <td><label for="box_padding_left">{#style_dlg.left}</label></td>
377
+ <td>
378
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
379
+ <tr>
380
+ <td><input type="text" id="box_padding_left" name="box_padding_left" class="mceEditableSelect" disabled="disabled" /></td>
381
+ <td>&nbsp;</td>
382
+ <td>
383
+ <label id="box_padding_left_measurement_label" for="box_padding_left_measurement" style="display: none; visibility: hidden;">Padding Left Measurement Unit</label>
384
+ <select id="box_padding_left_measurement" name="box_padding_left_measurement" disabled="disabled" aria-labelledby="box_padding_left_measurement_label"></select>
385
+ </td>
386
+ </tr>
387
+ </table>
388
+ </td>
389
+ </tr>
390
+ </table>
391
+ </fieldset>
392
+ </div>
393
+
394
+ <div style="float: right; width: 49%">
395
+ <fieldset>
396
+ <legend>{#style_dlg.margin}</legend>
397
+
398
+ <table role="presentation" border="0">
399
+ <tr>
400
+ <td>&nbsp;</td>
401
+ <td><input type="checkbox" id="box_margin_same" name="box_margin_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_margin');" /> <label for="box_margin_same">{#style_dlg.same}</label></td>
402
+ </tr>
403
+ <tr>
404
+ <td><label for="box_margin_top">{#style_dlg.top}</label></td>
405
+ <td>
406
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
407
+ <tr>
408
+ <td><input type="text" id="box_margin_top" name="box_margin_top" class="mceEditableSelect" /></td>
409
+ <td>&nbsp;</td>
410
+ <td>
411
+ <label id="box_margin_top_measurement_label" for="box_margin_top_measurement" style="display: none; visibility: hidden;">Margin Top Measurement Unit</label>
412
+ <select id="box_margin_top_measurement" name="box_margin_top_measurement" aria-labelledby="box_margin_top_measurement_label"></select>
413
+ </td>
414
+ </tr>
415
+ </table>
416
+ </td>
417
+ </tr>
418
+ <tr>
419
+ <td><label for="box_margin_right">{#style_dlg.right}</label></td>
420
+ <td>
421
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
422
+ <tr>
423
+ <td><input type="text" id="box_margin_right" name="box_margin_right" class="mceEditableSelect" disabled="disabled" /></td>
424
+ <td>&nbsp;</td>
425
+ <td>
426
+ <label id="box_margin_right_measurement_label" for="box_margin_right_measurement" style="display: none; visibility: hidden;">Margin Right Measurement Unit</label>
427
+ <select id="box_margin_right_measurement" name="box_margin_right_measurement" disabled="disabled" aria-labelledby="box_margin_right_measurement_label"></select>
428
+ </td>
429
+ </tr>
430
+ </table>
431
+ </td>
432
+ </tr>
433
+ <tr>
434
+ <td><label for="box_margin_bottom">{#style_dlg.bottom}</label></td>
435
+ <td>
436
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
437
+ <tr>
438
+ <td><input type="text" id="box_margin_bottom" name="box_margin_bottom" class="mceEditableSelect" disabled="disabled" /></td>
439
+ <td>&nbsp;</td>
440
+ <td>
441
+ <label id="box_margin_bottom_measurement_label" for="box_margin_bottom_measurement" style="display: none; visibility: hidden;">Margin Bottom Measurement Unit</label>
442
+ <select id="box_margin_bottom_measurement" name="box_margin_bottom_measurement" disabled="disabled" aria-labelledby="box_margin_bottom_measurement_label"></select>
443
+ </td>
444
+ </tr>
445
+ </table>
446
+ </td>
447
+ </tr>
448
+ <tr>
449
+ <td><label for="box_margin_left">{#style_dlg.left}</label></td>
450
+ <td>
451
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
452
+ <tr>
453
+ <td><input type="text" id="box_margin_left" name="box_margin_left" class="mceEditableSelect" disabled="disabled" /></td>
454
+ <td>&nbsp;</td>
455
+ <td>
456
+ <label id="box_margin_left_measurement_label" for="box_margin_left_measurement" style="display: none; visibility: hidden;">Margin Left Measurement Unit</label>
457
+ <select id="box_margin_left_measurement" name="box_margin_left_measurement" disabled="disabled" aria-labelledby="box_margin_left_measurement_label"></select>
458
+ </td>
459
+ </tr>
460
+ </table>
461
+ </td>
462
+ </tr>
463
+ </table>
464
+ </fieldset>
465
+ </div>
466
+ <br style="clear: both" />
467
+ </div>
468
+
469
+ <div id="border_panel" class="panel">
470
+ <fieldset>
471
+ <legend>{#style_dlg.border}</legend>
472
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0" width="100%">
473
+ <tr>
474
+ <td class="tdelim">&nbsp;</td>
475
+ <td class="tdelim delim">&nbsp;</td>
476
+ <td class="tdelim">{#style_dlg.style}</td>
477
+ <td class="tdelim delim">&nbsp;</td>
478
+ <td class="tdelim">{#style_dlg.width}</td>
479
+ <td class="tdelim delim">&nbsp;</td>
480
+ <td class="tdelim">{#style_dlg.color}</td>
481
+ </tr>
482
+
483
+ <tr>
484
+ <td>&nbsp;</td>
485
+ <td class="delim">&nbsp;</td>
486
+ <td><input type="checkbox" id="border_style_same" name="border_style_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_style');" /> <label for="border_style_same">{#style_dlg.same}</label></td>
487
+ <td class="delim">&nbsp;</td>
488
+ <td><input type="checkbox" id="border_width_same" name="border_width_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_width');" /> <label for="border_width_same">{#style_dlg.same}</label></td>
489
+ <td class="delim">&nbsp;</td>
490
+ <td><input type="checkbox" id="border_color_same" name="border_color_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_color');" /> <label for="border_color_same">{#style_dlg.same}</label></td>
491
+ </tr>
492
+
493
+ <tr>
494
+ <td>{#style_dlg.top}</td>
495
+ <td class="delim">&nbsp;</td>
496
+ <td><select id="border_style_top" name="border_style_top" class="mceEditableSelect"></select></td>
497
+ <td class="delim">&nbsp;</td>
498
+ <td>
499
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
500
+ <tr>
501
+ <td><select id="border_width_top" name="border_width_top" class="mceEditableSelect"></select></td>
502
+ <td>&nbsp;</td>
503
+ <td>
504
+ <label id="border_width_top_measurement_label" for="border_width_top_measurement" style="display: none; visibility: hidden;">Width top Measurement Unit</label>
505
+ <select id="border_width_top_measurement" name="border_width_top_measurement" aria-labelledby="border_width_top_measurement_label"></select>
506
+ </td>
507
+ </tr>
508
+ </table>
509
+ </td>
510
+ <td class="delim">&nbsp;</td>
511
+ <td>
512
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
513
+ <tr>
514
+ <td><input id="border_color_top" name="border_color_top" type="text" value="" size="9" onChange="updateColor('border_color_top_pick','border_color_top');" /></td>
515
+ <td id="border_color_top_pickcontainer">&nbsp;</td>
516
+ </tr>
517
+ </table>
518
+ </td>
519
+ </tr>
520
+
521
+ <tr>
522
+ <td>{#style_dlg.right}</td>
523
+ <td class="delim">&nbsp;</td>
524
+ <td><select id="border_style_right" name="border_style_right" class="mceEditableSelect" disabled="disabled"></select></td>
525
+ <td class="delim">&nbsp;</td>
526
+ <td>
527
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
528
+ <tr>
529
+ <td><select id="border_width_right" name="border_width_right" class="mceEditableSelect" disabled="disabled"></select></td>
530
+ <td>&nbsp;</td>
531
+ <td>
532
+ <label id="border_width_right_measurement_label" for="border_width_right_measurement" style="display: none; visibility: hidden;">Width Right Measurement Unit</label>
533
+ <select id="border_width_right_measurement" name="border_width_right_measurement" disabled="disabled" aria-labelledby="border_width_right_measurement_label"></select>
534
+ </td>
535
+ </tr>
536
+ </table>
537
+ </td>
538
+ <td class="delim">&nbsp;</td>
539
+ <td>
540
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
541
+ <tr>
542
+ <td><input id="border_color_right" name="border_color_right" type="text" value="" size="9" onChange="updateColor('border_color_right_pick','border_color_right');" disabled="disabled" /></td>
543
+ <td id="border_color_right_pickcontainer">&nbsp;</td>
544
+ </tr>
545
+ </table>
546
+ </td>
547
+ </tr>
548
+
549
+ <tr>
550
+ <td>{#style_dlg.bottom}</td>
551
+ <td class="delim">&nbsp;</td>
552
+ <td><select id="border_style_bottom" name="border_style_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
553
+ <td class="delim">&nbsp;</td>
554
+ <td>
555
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
556
+ <tr>
557
+ <td><select id="border_width_bottom" name="border_width_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
558
+ <td>&nbsp;</td>
559
+ <td>
560
+ <label id="border_width_bottom_measurement_label" for="border_width_bottom_measurement" style="display: none; visibility: hidden;">Width Bottom Measurement Unit</label>
561
+ <select id="border_width_bottom_measurement" name="border_width_bottom_measurement" disabled="disabled" aria-labelledby="border_width_bottom_measurement_label"></select>
562
+ </td>
563
+ </tr>
564
+ </table>
565
+ </td>
566
+ <td class="delim">&nbsp;</td>
567
+ <td>
568
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
569
+ <tr>
570
+ <td><input id="border_color_bottom" name="border_color_bottom" type="text" value="" size="9" onChange="updateColor('border_color_bottom_pick','border_color_bottom');" disabled="disabled" /></td>
571
+ <td id="border_color_bottom_pickcontainer">&nbsp;</td>
572
+ </tr>
573
+ </table>
574
+ </td>
575
+ </tr>
576
+
577
+ <tr>
578
+ <td>{#style_dlg.left}</td>
579
+ <td class="delim">&nbsp;</td>
580
+ <td><select id="border_style_left" name="border_style_left" class="mceEditableSelect" disabled="disabled"></select></td>
581
+ <td class="delim">&nbsp;</td>
582
+ <td>
583
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
584
+ <tr>
585
+ <td><select id="border_width_left" name="border_width_left" class="mceEditableSelect" disabled="disabled"></select></td>
586
+ <td>&nbsp;</td>
587
+ <td>
588
+ <label id="border_width_left_measurement_label" for="border_width_left_measurement" style="display: none; visibility: hidden;">Width Left Measurement Unit</label>
589
+ <select id="border_width_left_measurement" name="border_width_left_measurement" disabled="disabled" aria-labelledby="border_width_left_measurement_label"></select>
590
+ </td>
591
+ </tr>
592
+ </table>
593
+ </td>
594
+ <td class="delim">&nbsp;</td>
595
+ <td>
596
+ <table role="presentation" border="0" cellpadding="0" cellspacing="0">
597
+ <tr>
598
+ <td><input id="border_color_left" name="border_color_left" type="text" value="" size="9" onChange="updateColor('border_color_left_pick','border_color_left');" disabled="disabled" /></td>
599
+ <td id="border_color_left_pickcontainer">&nbsp;</td>
600
+ </tr>
601
+ </table>
602
+ </td>
603
+ </tr>
604
+ </table>
605
+ </fieldset>
606
+ </div>
607
+
608
+ <div id="list_panel" class="panel">
609
+ <fieldset>
610
+ <legend>{#style_dlg.list}</legend>
611
+ <table role="presentation" border="0">
612
+ <tr>
613
+ <td><label for="list_type">{#style_dlg.list_type}</label></td>
614
+ <td><select id="list_type" name="list_type" class="mceEditableSelect"></select></td>
615
+ </tr>
616
+
617
+ <tr>
618
+ <td><label for="list_bullet_image">{#style_dlg.bullet_image}</label></td>
619
+ <td><input id="list_bullet_image" name="list_bullet_image" type="text" /></td>
620
+ </tr>
621
+
622
+ <tr>
623
+ <td><label for="list_position">{#style_dlg.position}</label></td>
624
+ <td><select id="list_position" name="list_position" class="mceEditableSelect"></select></td>
625
+ </tr>
626
+ </table>
627
+ </fieldset>
628
+ </div>
629
+
630
+ <div id="positioning_panel" class="panel">
631
+ <fieldset>
632
+ <legend>{#style_dlg.position}</legend>
633
+ <table role="presentation" border="0">
634
+ <tr>
635
+ <td><label for="positioning_type">{#style_dlg.positioning_type}</label></td>
636
+ <td><select id="positioning_type" name="positioning_type" class="mceEditableSelect"></select></td>
637
+ <td>&nbsp;&nbsp;&nbsp;<label for="positioning_visibility">{#style_dlg.visibility}</label></td>
638
+ <td><select id="positioning_visibility" name="positioning_visibility" class="mceEditableSelect"></select></td>
639
+ </tr>
640
+
641
+ <tr>
642
+ <td><label for="positioning_width">{#style_dlg.width}</label></td>
643
+ <td>
644
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
645
+ <tr>
646
+ <td><input type="text" id="positioning_width" name="positioning_width" onChange="synch('positioning_width','box_width');" /></td>
647
+ <td>&nbsp;</td>
648
+ <td>
649
+ <label id="positioning_width_measurement_label" for="positioning_width_measurement" style="display: none; visibility: hidden;">Positioning width Measurement Unit</label>
650
+ <select id="positioning_width_measurement" name="positioning_width_measurement" aria-labelledby="positioning_width_measurement_label"></select>
651
+ </td>
652
+ </tr>
653
+ </table>
654
+ </td>
655
+ <td>&nbsp;&nbsp;&nbsp;<label for="positioning_zindex">{#style_dlg.zindex}</label></td>
656
+ <td><input type="text" id="positioning_zindex" name="positioning_zindex" /></td>
657
+ </tr>
658
+
659
+ <tr>
660
+ <td><label for="positioning_height">{#style_dlg.height}</label></td>
661
+ <td>
662
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
663
+ <tr>
664
+ <td><input type="text" id="positioning_height" name="positioning_height" onChange="synch('positioning_height','box_height');" /></td>
665
+ <td>&nbsp;</td>
666
+ <td>
667
+ <label id="positioning_height_measurement_label" for="positioning_height_measurement" style="display: none; visibility: hidden;">Positioning Height Measurement Unit</label>
668
+ <select id="positioning_height_measurement" name="positioning_height_measurement" aria-labelledby="positioning_height_measurement_label"></select>
669
+ </td>
670
+ </tr>
671
+ </table>
672
+ </td>
673
+ <td>&nbsp;&nbsp;&nbsp;<label for="positioning_overflow">{#style_dlg.overflow}</label></td>
674
+ <td><select id="positioning_overflow" name="positioning_overflow" class="mceEditableSelect"></select></td>
675
+ </tr>
676
+ </table>
677
+ </fieldset>
678
+
679
+ <div style="float: left; width: 49%">
680
+ <fieldset>
681
+ <legend>{#style_dlg.placement}</legend>
682
+
683
+ <table role="presentation" border="0">
684
+ <tr>
685
+ <td>&nbsp;</td>
686
+ <td><input type="checkbox" id="positioning_placement_same" name="positioning_placement_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_placement');" /> <label for="positioning_placement_same">{#style_dlg.same}</label></td>
687
+ </tr>
688
+ <tr>
689
+ <td>{#style_dlg.top}</td>
690
+ <td>
691
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
692
+ <tr>
693
+ <td><input type="text" id="positioning_placement_top" name="positioning_placement_top" /></td>
694
+ <td>&nbsp;</td>
695
+ <td>
696
+ <label id="positioning_placement_top_measurement_label" for="positioning_placement_top_measurement" style="display: none; visibility: hidden;">Placement Top Measurement Unit</label>
697
+ <select id="positioning_placement_top_measurement" name="positioning_placement_top_measurement" aria-labelledby="positioning_placement_top_measurement_label"></select>
698
+ </td>
699
+ </tr>
700
+ </table>
701
+ </td>
702
+ </tr>
703
+ <tr>
704
+ <td>{#style_dlg.right}</td>
705
+ <td>
706
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
707
+ <tr>
708
+ <td><input type="text" id="positioning_placement_right" name="positioning_placement_right" disabled="disabled" /></td>
709
+ <td>&nbsp;</td>
710
+ <td>
711
+ <label id="positioning_placement_right_measurement_label" for="positioning_placement_right_measurement" style="display: none; visibility: hidden;">Placement Right Measurement Unit</label>
712
+ <select id="positioning_placement_right_measurement" name="positioning_placement_right_measurement" disabled="disabled" aria-labelledby="positioning_placement_right_measurement_label"></select>
713
+ </td>
714
+ </tr>
715
+ </table>
716
+ </td>
717
+ </tr>
718
+ <tr>
719
+ <td>{#style_dlg.bottom}</td>
720
+ <td>
721
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
722
+ <tr>
723
+ <td><input type="text" id="positioning_placement_bottom" name="positioning_placement_bottom" disabled="disabled" /></td>
724
+ <td>&nbsp;</td>
725
+ <td>
726
+ <label id="positioning_placement_bottom_measurement_label" for="positioning_placement_bottom_measurement" style="display: none; visibility: hidden;">Placement Bottom Measurement Unit</label>
727
+ <select id="positioning_placement_bottom_measurement" name="positioning_placement_bottom_measurement" disabled="disabled" aria-labelledby="positioning_placement_bottom_measurement_label"></select>
728
+ </td>
729
+ </tr>
730
+ </table>
731
+ </td>
732
+ </tr>
733
+ <tr>
734
+ <td>{#style_dlg.left}</td>
735
+ <td>
736
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
737
+ <tr>
738
+ <td><input type="text" id="positioning_placement_left" name="positioning_placement_left" disabled="disabled" /></td>
739
+ <td>&nbsp;</td>
740
+ <td>
741
+ <label id="positioning_placement_left_measurement_label" for="positioning_placement_left_measurement" style="display: none; visibility: hidden;">Placement Left Measurement Unit</label>
742
+ <select id="positioning_placement_left_measurement" name="positioning_placement_left_measurement" disabled="disabled" aria-labelledby="positioning_placement_left_measurement_label"></select>
743
+ </td>
744
+ </tr>
745
+ </table>
746
+ </td>
747
+ </tr>
748
+ </table>
749
+ </fieldset>
750
+ </div>
751
+
752
+ <div style="float: right; width: 49%">
753
+ <fieldset>
754
+ <legend>{#style_dlg.clip}</legend>
755
+
756
+ <table role="presentation" border="0">
757
+ <tr>
758
+ <td>&nbsp;</td>
759
+ <td><input type="checkbox" id="positioning_clip_same" name="positioning_clip_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_clip');" /> <label for="positioning_clip_same">{#style_dlg.same}</label></td>
760
+ </tr>
761
+ <tr>
762
+ <td>{#style_dlg.top}</td>
763
+ <td>
764
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
765
+ <tr>
766
+ <td><input type="text" id="positioning_clip_top" name="positioning_clip_top" /></td>
767
+ <td>&nbsp;</td>
768
+ <td>
769
+ <label id="positioning_clip_top_measurement_label" for="positioning_clip_top_measurement" style="display: none; visibility: hidden;">Clip Top Measurement Unit</label>
770
+ <select id="positioning_clip_top_measurement" name="positioning_clip_top_measurement" aria-labelledby="positioning_clip_top_measurement_label"></select>
771
+ </td>
772
+ </tr>
773
+ </table>
774
+ </td>
775
+ </tr>
776
+ <tr>
777
+ <td>{#style_dlg.right}</td>
778
+ <td>
779
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
780
+ <tr>
781
+ <td><input type="text" id="positioning_clip_right" name="positioning_clip_right" disabled="disabled" /></td>
782
+ <td>&nbsp;</td>
783
+ <td>
784
+ <label id="positioning_clip_right_measurement_label" for="positioning_clip_right_measurement" style="display: none; visibility: hidden;">Clip Right Measurement Unit</label>
785
+ <select id="positioning_clip_right_measurement" name="positioning_clip_right_measurement" disabled="disabled" aria-labelledby="positioning_clip_right_measurement_label"></select>
786
+ </td>
787
+ </tr>
788
+ </table>
789
+ </td>
790
+ </tr>
791
+ <tr>
792
+ <td>{#style_dlg.bottom}</td>
793
+ <td>
794
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
795
+ <tr>
796
+ <td><input type="text" id="positioning_clip_bottom" name="positioning_clip_bottom" disabled="disabled" /></td>
797
+ <td>&nbsp;</td>
798
+ <td>
799
+ <label id="positioning_clip_bottom_measurement_label" for="positioning_clip_bottom_measurement" style="display: none; visibility: hidden;">Clip Bottom Measurement Unit</label>
800
+ <select id="positioning_clip_bottom_measurement" name="positioning_clip_bottom_measurement" disabled="disabled" aria-labelledby="positioning_clip_bottom_measurement_label"></select>
801
+ </td>
802
+ </tr>
803
+ </table>
804
+ </td>
805
+ </tr>
806
+ <tr>
807
+ <td>{#style_dlg.left}</td>
808
+ <td>
809
+ <table role="presentation" border="0" cellspacing="0" cellpadding="0">
810
+ <tr>
811
+ <td><input type="text" id="positioning_clip_left" name="positioning_clip_left" disabled="disabled" /></td>
812
+ <td>&nbsp;</td>
813
+ <td>
814
+ <label id="positioning_clip_left_measurement_label" for="positioning_clip_left_measurement" style="display: none; visibility: hidden;">Clip Left Measurement Unit</label>
815
+ <select id="positioning_clip_left_measurement" name="positioning_clip_left_measurement" disabled="disabled" aria-labelledby="positioning_clip_left_measurement_label"></select>
816
+ </td>
817
+ </tr>
818
+ </table>
819
+ </td>
820
+ </tr>
821
+ </table>
822
+ </fieldset>
823
+ </div>
824
+ <br style="clear: both" />
825
+ </div>
826
+ </div>
827
+
828
+ <div class="panel_toggle_insert_span">
829
+ <input type="checkbox" class="checkbox" id="toggle_insert_span" name="toggle_insert_span" onClick="toggleApplyAction();" />
830
+ <label for="toggle_insert_span">{#style_dlg.toggle_insert_span}</label>
831
+ </div>
832
+
833
+ <div class="mceActionPanel">
834
+ <input type="submit" id="insert" name="insert" value="{#update}" />
835
+ <input type="button" class="button" id="apply" name="apply" value="{#style_dlg.apply}" onClick="applyAction();" />
836
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onClick="tinyMCEPopup.close();" />
837
+ </div>
838
+ </form>
839
+
840
+ <div style="display: none">
841
+ <div id="container"></div>
842
+ </div>
843
+
844
+ </body>
845
+ </html>
js/tinymce/jscripts/tiny_mce/plugins/style/readme.txt CHANGED
@@ -1,19 +1,19 @@
1
- Edit CSS Style plug-in notes
2
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3
- Unlike WYSIWYG editor functionality that operates only on the selected text,
4
- typically by inserting new HTML elements with the specified styles.
5
- This plug-in operates on the HTML blocks surrounding the selected text.
6
- No new HTML elements are created.
7
-
8
- This plug-in only operates on the surrounding blocks and not the nearest
9
- parent node. This means that if a block encapsulates a node,
10
- e.g <p><span>text</span></p>, then only the styles in the block are
11
- recognized, not those in the span.
12
-
13
- When selecting text that includes multiple blocks at the same level (peers),
14
- this plug-in accumulates the specified styles in all of the surrounding blocks
15
- and populates the dialogue checkboxes accordingly. There is no differentiation
16
- between styles set in all the blocks versus styles set in some of the blocks.
17
-
18
- When the [Update] or [Apply] buttons are pressed, the styles selected in the
19
- checkboxes are applied to all blocks that surround the selected text.
1
+ Edit CSS Style plug-in notes
2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3
+ Unlike WYSIWYG editor functionality that operates only on the selected text,
4
+ typically by inserting new HTML elements with the specified styles.
5
+ This plug-in operates on the HTML blocks surrounding the selected text.
6
+ No new HTML elements are created.
7
+
8
+ This plug-in only operates on the surrounding blocks and not the nearest
9
+ parent node. This means that if a block encapsulates a node,
10
+ e.g <p><span>text</span></p>, then only the styles in the block are
11
+ recognized, not those in the span.
12
+
13
+ When selecting text that includes multiple blocks at the same level (peers),
14
+ this plug-in accumulates the specified styles in all of the surrounding blocks
15
+ and populates the dialogue checkboxes accordingly. There is no differentiation
16
+ between styles set in all the blocks versus styles set in some of the blocks.
17
+
18
+ When the [Update] or [Apply] buttons are pressed, the styles selected in the
19
+ checkboxes are applied to all blocks that surround the selected text.
js/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js CHANGED
@@ -1,122 +1,122 @@
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 DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode;
13
-
14
- tinymce.create('tinymce.plugins.TabFocusPlugin', {
15
- init : function(ed, url) {
16
- function tabCancel(ed, e) {
17
- if (e.keyCode === 9)
18
- return Event.cancel(e);
19
- }
20
-
21
- function tabHandler(ed, e) {
22
- var x, i, f, el, v;
23
-
24
- function find(d) {
25
- el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
26
-
27
- function canSelectRecursive(e) {
28
- return e.nodeName==="BODY" || (e.type != 'hidden' &&
29
- !(e.style.display == "none") &&
30
- !(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode));
31
- }
32
- function canSelectInOldIe(el) {
33
- return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA";
34
- }
35
- function isOldIe() {
36
- return tinymce.isIE6 || tinymce.isIE7;
37
- }
38
- function canSelect(el) {
39
- return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el);
40
- }
41
-
42
- each(el, function(e, i) {
43
- if (e.id == ed.id) {
44
- x = i;
45
- return false;
46
- }
47
- });
48
- if (d > 0) {
49
- for (i = x + 1; i < el.length; i++) {
50
- if (canSelect(el[i]))
51
- return el[i];
52
- }
53
- } else {
54
- for (i = x - 1; i >= 0; i--) {
55
- if (canSelect(el[i]))
56
- return el[i];
57
- }
58
- }
59
-
60
- return null;
61
- }
62
-
63
- if (e.keyCode === 9) {
64
- v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next')));
65
-
66
- if (v.length == 1) {
67
- v[1] = v[0];
68
- v[0] = ':prev';
69
- }
70
-
71
- // Find element to focus
72
- if (e.shiftKey) {
73
- if (v[0] == ':prev')
74
- el = find(-1);
75
- else
76
- el = DOM.get(v[0]);
77
- } else {
78
- if (v[1] == ':next')
79
- el = find(1);
80
- else
81
- el = DOM.get(v[1]);
82
- }
83
-
84
- if (el) {
85
- if (el.id && (ed = tinymce.get(el.id || el.name)))
86
- ed.focus();
87
- else
88
- window.setTimeout(function() {
89
- if (!tinymce.isWebKit)
90
- window.focus();
91
- el.focus();
92
- }, 10);
93
-
94
- return Event.cancel(e);
95
- }
96
- }
97
- }
98
-
99
- ed.onKeyUp.add(tabCancel);
100
-
101
- if (tinymce.isGecko) {
102
- ed.onKeyPress.add(tabHandler);
103
- ed.onKeyDown.add(tabCancel);
104
- } else
105
- ed.onKeyDown.add(tabHandler);
106
-
107
- },
108
-
109
- getInfo : function() {
110
- return {
111
- longname : 'Tabfocus',
112
- author : 'Moxiecode Systems AB',
113
- authorurl : 'http://tinymce.moxiecode.com',
114
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus',
115
- version : tinymce.majorVersion + "." + tinymce.minorVersion
116
- };
117
- }
118
- });
119
-
120
- // Register plugin
121
- tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin);
122
- })();
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 DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode;
13
+
14
+ tinymce.create('tinymce.plugins.TabFocusPlugin', {
15
+ init : function(ed, url) {
16
+ function tabCancel(ed, e) {
17
+ if (e.keyCode === 9)
18
+ return Event.cancel(e);
19
+ }
20
+
21
+ function tabHandler(ed, e) {
22
+ var x, i, f, el, v;
23
+
24
+ function find(d) {
25
+ el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
26
+
27
+ function canSelectRecursive(e) {
28
+ return e.nodeName==="BODY" || (e.type != 'hidden' &&
29
+ !(e.style.display == "none") &&
30
+ !(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode));
31
+ }
32
+ function canSelectInOldIe(el) {
33
+ return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA";
34
+ }
35
+ function isOldIe() {
36
+ return tinymce.isIE6 || tinymce.isIE7;
37
+ }
38
+ function canSelect(el) {
39
+ return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el);
40
+ }
41
+
42
+ each(el, function(e, i) {
43
+ if (e.id == ed.id) {
44
+ x = i;
45
+ return false;
46
+ }
47
+ });
48
+ if (d > 0) {
49
+ for (i = x + 1; i < el.length; i++) {
50
+ if (canSelect(el[i]))
51
+ return el[i];
52
+ }
53
+ } else {
54
+ for (i = x - 1; i >= 0; i--) {
55
+ if (canSelect(el[i]))
56
+ return el[i];
57
+ }
58
+ }
59
+
60
+ return null;
61
+ }
62
+
63
+ if (e.keyCode === 9) {
64
+ v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next')));
65
+
66
+ if (v.length == 1) {
67
+ v[1] = v[0];
68
+ v[0] = ':prev';
69
+ }
70
+
71
+ // Find element to focus
72
+ if (e.shiftKey) {
73
+ if (v[0] == ':prev')
74
+ el = find(-1);
75
+ else
76
+ el = DOM.get(v[0]);
77
+ } else {
78
+ if (v[1] == ':next')
79
+ el = find(1);
80
+ else
81
+ el = DOM.get(v[1]);
82
+ }
83
+
84
+ if (el) {
85
+ if (el.id && (ed = tinymce.get(el.id || el.name)))
86
+ ed.focus();
87
+ else
88
+ window.setTimeout(function() {
89
+ if (!tinymce.isWebKit)
90
+ window.focus();
91
+ el.focus();
92
+ }, 10);
93
+
94
+ return Event.cancel(e);
95
+ }
96
+ }
97
+ }
98
+
99
+ ed.onKeyUp.add(tabCancel);
100
+
101
+ if (tinymce.isGecko) {
102
+ ed.onKeyPress.add(tabHandler);
103
+ ed.onKeyDown.add(tabCancel);
104
+ } else
105
+ ed.onKeyDown.add(tabHandler);
106
+
107
+ },
108
+
109
+ getInfo : function() {
110
+ return {
111
+ longname : 'Tabfocus',
112
+ author : 'Moxiecode Systems AB',
113
+ authorurl : 'http://tinymce.moxiecode.com',
114
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus',
115
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
116
+ };
117
+ }
118
+ });
119
+
120
+ // Register plugin
121
+ tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin);
122
+ })();
js/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js CHANGED
@@ -1,1456 +1,1456 @@
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
- startPos = endPos = null;
291
-
292
- // Calculate start/end pos by checking for selected cells in grid works better with context menu
293
- each(grid, function(row, y) {
294
- each(row, function(cell, x) {
295
- if (isCellSelected(cell)) {
296
- if (!startPos) {
297
- startPos = {x: x, y: y};
298
- }
299
-
300
- endPos = {x: x, y: y};
301
- }
302
- });
303
- });
304
-
305
- // Use selection
306
- startX = startPos.x;
307
- startY = startPos.y;
308
- endX = endPos.x;
309
- endY = endPos.y;
310
- }
311
-
312
- // Find start/end cells
313
- startCell = getCell(startX, startY);
314
- endCell = getCell(endX, endY);
315
-
316
- // Check if the cells exists and if they are of the same part for example tbody = tbody
317
- if (startCell && endCell && startCell.part == endCell.part) {
318
- // Split and rebuild grid
319
- split();
320
- buildGrid();
321
-
322
- // Set row/col span to start cell
323
- startCell = getCell(startX, startY).elm;
324
- setSpanVal(startCell, 'colSpan', (endX - startX) + 1);
325
- setSpanVal(startCell, 'rowSpan', (endY - startY) + 1);
326
-
327
- // Remove other cells and add it's contents to the start cell
328
- for (y = startY; y <= endY; y++) {
329
- for (x = startX; x <= endX; x++) {
330
- if (!grid[y] || !grid[y][x])
331
- continue;
332
-
333
- cell = grid[y][x].elm;
334
-
335
- if (cell != startCell) {
336
- // Move children to startCell
337
- children = tinymce.grep(cell.childNodes);
338
- each(children, function(node) {
339
- startCell.appendChild(node);
340
- });
341
-
342
- // Remove bogus nodes if there is children in the target cell
343
- if (children.length) {
344
- children = tinymce.grep(startCell.childNodes);
345
- count = 0;
346
- each(children, function(node) {
347
- if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1)
348
- startCell.removeChild(node);
349
- });
350
- }
351
-
352
- // Remove cell
353
- dom.remove(cell);
354
- }
355
- }
356
- }
357
-
358
- // Remove empty rows etc and restore caret location
359
- cleanup();
360
- }
361
- };
362
-
363
- function insertRow(before) {
364
- var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan;
365
-
366
- // Find first/last row
367
- each(grid, function(row, y) {
368
- each(row, function(cell, x) {
369
- if (isCellSelected(cell)) {
370
- cell = cell.elm;
371
- rowElm = cell.parentNode;
372
- newRow = cloneNode(rowElm, false);
373
- posY = y;
374
-
375
- if (before)
376
- return false;
377
- }
378
- });
379
-
380
- if (before)
381
- return !posY;
382
- });
383
-
384
- for (x = 0; x < grid[0].length; x++) {
385
- // Cell not found could be because of an invalid table structure
386
- if (!grid[posY][x])
387
- continue;
388
-
389
- cell = grid[posY][x].elm;
390
-
391
- if (cell != lastCell) {
392
- if (!before) {
393
- rowSpan = getSpanVal(cell, 'rowspan');
394
- if (rowSpan > 1) {
395
- setSpanVal(cell, 'rowSpan', rowSpan + 1);
396
- continue;
397
- }
398
- } else {
399
- // Check if cell above can be expanded
400
- if (posY > 0 && grid[posY - 1][x]) {
401
- otherCell = grid[posY - 1][x].elm;
402
- rowSpan = getSpanVal(otherCell, 'rowSpan');
403
- if (rowSpan > 1) {
404
- setSpanVal(otherCell, 'rowSpan', rowSpan + 1);
405
- continue;
406
- }
407
- }
408
- }
409
-
410
- // Insert new cell into new row
411
- newCell = cloneCell(cell);
412
- setSpanVal(newCell, 'colSpan', cell.colSpan);
413
-
414
- newRow.appendChild(newCell);
415
-
416
- lastCell = cell;
417
- }
418
- }
419
-
420
- if (newRow.hasChildNodes()) {
421
- if (!before)
422
- dom.insertAfter(newRow, rowElm);
423
- else
424
- rowElm.parentNode.insertBefore(newRow, rowElm);
425
- }
426
- };
427
-
428
- function insertCol(before) {
429
- var posX, lastCell;
430
-
431
- // Find first/last column
432
- each(grid, function(row, y) {
433
- each(row, function(cell, x) {
434
- if (isCellSelected(cell)) {
435
- posX = x;
436
-
437
- if (before)
438
- return false;
439
- }
440
- });
441
-
442
- if (before)
443
- return !posX;
444
- });
445
-
446
- each(grid, function(row, y) {
447
- var cell, rowSpan, colSpan;
448
-
449
- if (!row[posX])
450
- return;
451
-
452
- cell = row[posX].elm;
453
- if (cell != lastCell) {
454
- colSpan = getSpanVal(cell, 'colspan');
455
- rowSpan = getSpanVal(cell, 'rowspan');
456
-
457
- if (colSpan == 1) {
458
- if (!before) {
459
- dom.insertAfter(cloneCell(cell), cell);
460
- fillLeftDown(posX, y, rowSpan - 1, colSpan);
461
- } else {
462
- cell.parentNode.insertBefore(cloneCell(cell), cell);
463
- fillLeftDown(posX, y, rowSpan - 1, colSpan);
464
- }
465
- } else
466
- setSpanVal(cell, 'colSpan', cell.colSpan + 1);
467
-
468
- lastCell = cell;
469
- }
470
- });
471
- };
472
-
473
- function deleteCols() {
474
- var cols = [];
475
-
476
- // Get selected column indexes
477
- each(grid, function(row, y) {
478
- each(row, function(cell, x) {
479
- if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) {
480
- each(grid, function(row) {
481
- var cell = row[x].elm, colSpan;
482
-
483
- colSpan = getSpanVal(cell, 'colSpan');
484
-
485
- if (colSpan > 1)
486
- setSpanVal(cell, 'colSpan', colSpan - 1);
487
- else
488
- dom.remove(cell);
489
- });
490
-
491
- cols.push(x);
492
- }
493
- });
494
- });
495
-
496
- cleanup();
497
- };
498
-
499
- function deleteRows() {
500
- var rows;
501
-
502
- function deleteRow(tr) {
503
- var nextTr, pos, lastCell;
504
-
505
- nextTr = dom.getNext(tr, 'tr');
506
-
507
- // Move down row spanned cells
508
- each(tr.cells, function(cell) {
509
- var rowSpan = getSpanVal(cell, 'rowSpan');
510
-
511
- if (rowSpan > 1) {
512
- setSpanVal(cell, 'rowSpan', rowSpan - 1);
513
- pos = getPos(cell);
514
- fillLeftDown(pos.x, pos.y, 1, 1);
515
- }
516
- });
517
-
518
- // Delete cells
519
- pos = getPos(tr.cells[0]);
520
- each(grid[pos.y], function(cell) {
521
- var rowSpan;
522
-
523
- cell = cell.elm;
524
-
525
- if (cell != lastCell) {
526
- rowSpan = getSpanVal(cell, 'rowSpan');
527
-
528
- if (rowSpan <= 1)
529
- dom.remove(cell);
530
- else
531
- setSpanVal(cell, 'rowSpan', rowSpan - 1);
532
-
533
- lastCell = cell;
534
- }
535
- });
536
- };
537
-
538
- // Get selected rows and move selection out of scope
539
- rows = getSelectedRows();
540
-
541
- // Delete all selected rows
542
- each(rows.reverse(), function(tr) {
543
- deleteRow(tr);
544
- });
545
-
546
- cleanup();
547
- };
548
-
549
- function cutRows() {
550
- var rows = getSelectedRows();
551
-
552
- dom.remove(rows);
553
- cleanup();
554
-
555
- return rows;
556
- };
557
-
558
- function copyRows() {
559
- var rows = getSelectedRows();
560
-
561
- each(rows, function(row, i) {
562
- rows[i] = cloneNode(row, true);
563
- });
564
-
565
- return rows;
566
- };
567
-
568
- function pasteRows(rows, before) {
569
- // If we don't have any rows in the clipboard, return immediately
570
- if(!rows)
571
- return;
572
-
573
- var selectedRows = getSelectedRows(),
574
- targetRow = selectedRows[before ? 0 : selectedRows.length - 1],
575
- targetCellCount = targetRow.cells.length;
576
-
577
- // Calc target cell count
578
- each(grid, function(row) {
579
- var match;
580
-
581
- targetCellCount = 0;
582
- each(row, function(cell, x) {
583
- if (cell.real)
584
- targetCellCount += cell.colspan;
585
-
586
- if (cell.elm.parentNode == targetRow)
587
- match = 1;
588
- });
589
-
590
- if (match)
591
- return false;
592
- });
593
-
594
- if (!before)
595
- rows.reverse();
596
-
597
- each(rows, function(row) {
598
- var cellCount = row.cells.length, cell;
599
-
600
- // Remove col/rowspans
601
- for (i = 0; i < cellCount; i++) {
602
- cell = row.cells[i];
603
- setSpanVal(cell, 'colSpan', 1);
604
- setSpanVal(cell, 'rowSpan', 1);
605
- }
606
-
607
- // Needs more cells
608
- for (i = cellCount; i < targetCellCount; i++)
609
- row.appendChild(cloneCell(row.cells[cellCount - 1]));
610
-
611
- // Needs less cells
612
- for (i = targetCellCount; i < cellCount; i++)
613
- dom.remove(row.cells[i]);
614
-
615
- // Add before/after
616
- if (before)
617
- targetRow.parentNode.insertBefore(row, targetRow);
618
- else
619
- dom.insertAfter(row, targetRow);
620
- });
621
-
622
- // Remove current selection
623
- dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
624
- };
625
-
626
- function getPos(target) {
627
- var pos;
628
-
629
- each(grid, function(row, y) {
630
- each(row, function(cell, x) {
631
- if (cell.elm == target) {
632
- pos = {x : x, y : y};
633
- return false;
634
- }
635
- });
636
-
637
- return !pos;
638
- });
639
-
640
- return pos;
641
- };
642
-
643
- function setStartCell(cell) {
644
- startPos = getPos(cell);
645
- };
646
-
647
- function findEndPos() {
648
- var pos, maxX, maxY;
649
-
650
- maxX = maxY = 0;
651
-
652
- each(grid, function(row, y) {
653
- each(row, function(cell, x) {
654
- var colSpan, rowSpan;
655
-
656
- if (isCellSelected(cell)) {
657
- cell = grid[y][x];
658
-
659
- if (x > maxX)
660
- maxX = x;
661
-
662
- if (y > maxY)
663
- maxY = y;
664
-
665
- if (cell.real) {
666
- colSpan = cell.colspan - 1;
667
- rowSpan = cell.rowspan - 1;
668
-
669
- if (colSpan) {
670
- if (x + colSpan > maxX)
671
- maxX = x + colSpan;
672
- }
673
-
674
- if (rowSpan) {
675
- if (y + rowSpan > maxY)
676
- maxY = y + rowSpan;
677
- }
678
- }
679
- }
680
- });
681
- });
682
-
683
- return {x : maxX, y : maxY};
684
- };
685
-
686
- function setEndCell(cell) {
687
- var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan;
688
-
689
- endPos = getPos(cell);
690
-
691
- if (startPos && endPos) {
692
- // Get start/end positions
693
- startX = Math.min(startPos.x, endPos.x);
694
- startY = Math.min(startPos.y, endPos.y);
695
- endX = Math.max(startPos.x, endPos.x);
696
- endY = Math.max(startPos.y, endPos.y);
697
-
698
- // Expand end positon to include spans
699
- maxX = endX;
700
- maxY = endY;
701
-
702
- // Expand startX
703
- for (y = startY; y <= maxY; y++) {
704
- cell = grid[y][startX];
705
-
706
- if (!cell.real) {
707
- if (startX - (cell.colspan - 1) < startX)
708
- startX -= cell.colspan - 1;
709
- }
710
- }
711
-
712
- // Expand startY
713
- for (x = startX; x <= maxX; x++) {
714
- cell = grid[startY][x];
715
-
716
- if (!cell.real) {
717
- if (startY - (cell.rowspan - 1) < startY)
718
- startY -= cell.rowspan - 1;
719
- }
720
- }
721
-
722
- // Find max X, Y
723
- for (y = startY; y <= endY; y++) {
724
- for (x = startX; x <= endX; x++) {
725
- cell = grid[y][x];
726
-
727
- if (cell.real) {
728
- colSpan = cell.colspan - 1;
729
- rowSpan = cell.rowspan - 1;
730
-
731
- if (colSpan) {
732
- if (x + colSpan > maxX)
733
- maxX = x + colSpan;
734
- }
735
-
736
- if (rowSpan) {
737
- if (y + rowSpan > maxY)
738
- maxY = y + rowSpan;
739
- }
740
- }
741
- }
742
- }
743
-
744
- // Remove current selection
745
- dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
746
-
747
- // Add new selection
748
- for (y = startY; y <= maxY; y++) {
749
- for (x = startX; x <= maxX; x++) {
750
- if (grid[y][x])
751
- dom.addClass(grid[y][x].elm, 'mceSelected');
752
- }
753
- }
754
- }
755
- };
756
-
757
- // Expose to public
758
- tinymce.extend(this, {
759
- deleteTable : deleteTable,
760
- split : split,
761
- merge : merge,
762
- insertRow : insertRow,
763
- insertCol : insertCol,
764
- deleteCols : deleteCols,
765
- deleteRows : deleteRows,
766
- cutRows : cutRows,
767
- copyRows : copyRows,
768
- pasteRows : pasteRows,
769
- getPos : getPos,
770
- setStartCell : setStartCell,
771
- setEndCell : setEndCell
772
- });
773
- };
774
-
775
- tinymce.create('tinymce.plugins.TablePlugin', {
776
- init : function(ed, url) {
777
- var winMan, clipboardRows, hasCellSelection = true; // Might be selected cells on reload
778
-
779
- function createTableGrid(node) {
780
- var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table');
781
-
782
- if (tblElm)
783
- return new TableGrid(tblElm, ed.dom, selection);
784
- };
785
-
786
- function cleanup() {
787
- // Restore selection possibilities
788
- ed.getBody().style.webkitUserSelect = '';
789
-
790
- if (hasCellSelection) {
791
- ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
792
- hasCellSelection = false;
793
- }
794
- };
795
-
796
- // Register buttons
797
- each([
798
- ['table', 'table.desc', 'mceInsertTable', true],
799
- ['delete_table', 'table.del', 'mceTableDelete'],
800
- ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'],
801
- ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'],
802
- ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'],
803
- ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'],
804
- ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'],
805
- ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'],
806
- ['row_props', 'table.row_desc', 'mceTableRowProps', true],
807
- ['cell_props', 'table.cell_desc', 'mceTableCellProps', true],
808
- ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true],
809
- ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true]
810
- ], function(c) {
811
- ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]});
812
- });
813
-
814
- // Select whole table is a table border is clicked
815
- if (!tinymce.isIE) {
816
- ed.onClick.add(function(ed, e) {
817
- e = e.target;
818
-
819
- if (e.nodeName === 'TABLE') {
820
- ed.selection.select(e);
821
- ed.nodeChanged();
822
- }
823
- });
824
- }
825
-
826
- ed.onPreProcess.add(function(ed, args) {
827
- var nodes, i, node, dom = ed.dom, value;
828
-
829
- nodes = dom.select('table', args.node);
830
- i = nodes.length;
831
- while (i--) {
832
- node = nodes[i];
833
- dom.setAttrib(node, 'data-mce-style', '');
834
-
835
- if ((value = dom.getAttrib(node, 'width'))) {
836
- dom.setStyle(node, 'width', value);
837
- dom.setAttrib(node, 'width', '');
838
- }
839
-
840
- if ((value = dom.getAttrib(node, 'height'))) {
841
- dom.setStyle(node, 'height', value);
842
- dom.setAttrib(node, 'height', '');
843
- }
844
- }
845
- });
846
-
847
- // Handle node change updates
848
- ed.onNodeChange.add(function(ed, cm, n) {
849
- var p;
850
-
851
- n = ed.selection.getStart();
852
- p = ed.dom.getParent(n, 'td,th,caption');
853
- cm.setActive('table', n.nodeName === 'TABLE' || !!p);
854
-
855
- // Disable table tools if we are in caption
856
- if (p && p.nodeName === 'CAPTION')
857
- p = 0;
858
-
859
- cm.setDisabled('delete_table', !p);
860
- cm.setDisabled('delete_col', !p);
861
- cm.setDisabled('delete_table', !p);
862
- cm.setDisabled('delete_row', !p);
863
- cm.setDisabled('col_after', !p);
864
- cm.setDisabled('col_before', !p);
865
- cm.setDisabled('row_after', !p);
866
- cm.setDisabled('row_before', !p);
867
- cm.setDisabled('row_props', !p);
868
- cm.setDisabled('cell_props', !p);
869
- cm.setDisabled('split_cells', !p);
870
- cm.setDisabled('merge_cells', !p);
871
- });
872
-
873
- ed.onInit.add(function(ed) {
874
- var startTable, startCell, dom = ed.dom, tableGrid;
875
-
876
- winMan = ed.windowManager;
877
-
878
- // Add cell selection logic
879
- ed.onMouseDown.add(function(ed, e) {
880
- if (e.button != 2) {
881
- cleanup();
882
-
883
- startCell = dom.getParent(e.target, 'td,th');
884
- startTable = dom.getParent(startCell, 'table');
885
- }
886
- });
887
-
888
- dom.bind(ed.getDoc(), 'mouseover', function(e) {
889
- var sel, table, target = e.target;
890
-
891
- if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) {
892
- table = dom.getParent(target, 'table');
893
- if (table == startTable) {
894
- if (!tableGrid) {
895
- tableGrid = createTableGrid(table);
896
- tableGrid.setStartCell(startCell);
897
-
898
- ed.getBody().style.webkitUserSelect = 'none';
899
- }
900
-
901
- tableGrid.setEndCell(target);
902
- hasCellSelection = true;
903
- }
904
-
905
- // Remove current selection
906
- sel = ed.selection.getSel();
907
-
908
- try {
909
- if (sel.removeAllRanges)
910
- sel.removeAllRanges();
911
- else
912
- sel.empty();
913
- } catch (ex) {
914
- // IE9 might throw errors here
915
- }
916
-
917
- e.preventDefault();
918
- }
919
- });
920
-
921
- ed.onMouseUp.add(function(ed, e) {
922
- var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode;
923
-
924
- // Move selection to startCell
925
- if (startCell) {
926
- if (tableGrid)
927
- ed.getBody().style.webkitUserSelect = '';
928
-
929
- function setPoint(node, start) {
930
- var walker = new tinymce.dom.TreeWalker(node, node);
931
-
932
- do {
933
- // Text node
934
- if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) {
935
- if (start)
936
- rng.setStart(node, 0);
937
- else
938
- rng.setEnd(node, node.nodeValue.length);
939
-
940
- return;
941
- }
942
-
943
- // BR element
944
- if (node.nodeName == 'BR') {
945
- if (start)
946
- rng.setStartBefore(node);
947
- else
948
- rng.setEndBefore(node);
949
-
950
- return;
951
- }
952
- } while (node = (start ? walker.next() : walker.prev()));
953
- }
954
-
955
- // Try to expand text selection as much as we can only Gecko supports cell selection
956
- selectedCells = dom.select('td.mceSelected,th.mceSelected');
957
- if (selectedCells.length > 0) {
958
- rng = dom.createRng();
959
- node = selectedCells[0];
960
- endNode = selectedCells[selectedCells.length - 1];
961
- rng.setStartBefore(node);
962
- rng.setEndAfter(node);
963
-
964
- setPoint(node, 1);
965
- walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table'));
966
-
967
- do {
968
- if (node.nodeName == 'TD' || node.nodeName == 'TH') {
969
- if (!dom.hasClass(node, 'mceSelected'))
970
- break;
971
-
972
- lastNode = node;
973
- }
974
- } while (node = walker.next());
975
-
976
- setPoint(lastNode);
977
-
978
- sel.setRng(rng);
979
- }
980
-
981
- ed.nodeChanged();
982
- startCell = tableGrid = startTable = null;
983
- }
984
- });
985
-
986
- ed.onKeyUp.add(function(ed, e) {
987
- cleanup();
988
- });
989
-
990
- ed.onKeyDown.add(function (ed, e) {
991
- fixTableCellSelection(ed);
992
- });
993
-
994
- ed.onMouseDown.add(function (ed, e) {
995
- if (e.button != 2) {
996
- fixTableCellSelection(ed);
997
- }
998
- });
999
- function tableCellSelected(ed, rng, n, currentCell) {
1000
- // The decision of when a table cell is selected is somewhat involved. The fact that this code is
1001
- // required is actually a pointer to the root cause of this bug. A cell is selected when the start
1002
- // and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases)
1003
- // or the parent of the table (in the case of the selection containing the last cell of a table).
1004
- var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'),
1005
- tableParent, allOfCellSelected, tableCellSelection;
1006
- if (table)
1007
- tableParent = table.parentNode;
1008
- allOfCellSelected =rng.startContainer.nodeType == TEXT_NODE &&
1009
- rng.startOffset == 0 &&
1010
- rng.endOffset == 0 &&
1011
- currentCell &&
1012
- (n.nodeName=="TR" || n==tableParent);
1013
- tableCellSelection = (n.nodeName=="TD"||n.nodeName=="TH")&& !currentCell;
1014
- return allOfCellSelected || tableCellSelection;
1015
- // return false;
1016
- }
1017
-
1018
- // this nasty hack is here to work around some WebKit selection bugs.
1019
- function fixTableCellSelection(ed) {
1020
- if (!tinymce.isWebKit)
1021
- return;
1022
-
1023
- var rng = ed.selection.getRng();
1024
- var n = ed.selection.getNode();
1025
- var currentCell = ed.dom.getParent(rng.startContainer, 'TD,TH');
1026
-
1027
- if (!tableCellSelected(ed, rng, n, currentCell))
1028
- return;
1029
- if (!currentCell) {
1030
- currentCell=n;
1031
- }
1032
-
1033
- // Get the very last node inside the table cell
1034
- var end = currentCell.lastChild;
1035
- while (end.lastChild)
1036
- end = end.lastChild;
1037
-
1038
- // Select the entire table cell. Nothing outside of the table cell should be selected.
1039
- rng.setEnd(end, end.nodeValue.length);
1040
- ed.selection.setRng(rng);
1041
- }
1042
- ed.plugins.table.fixTableCellSelection=fixTableCellSelection;
1043
-
1044
- // Add context menu
1045
- if (ed && ed.plugins.contextmenu) {
1046
- ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
1047
- var sm, se = ed.selection, el = se.getNode() || ed.getBody();
1048
-
1049
- if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) {
1050
- m.removeAll();
1051
-
1052
- if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) {
1053
- m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});
1054
- m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});
1055
- m.addSeparator();
1056
- }
1057
-
1058
- if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) {
1059
- m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
1060
- m.addSeparator();
1061
- }
1062
-
1063
- m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}});
1064
- m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'});
1065
- m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'});
1066
- m.addSeparator();
1067
-
1068
- // Cell menu
1069
- sm = m.addMenu({title : 'table.cell'});
1070
- sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'});
1071
- sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'});
1072
- sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'});
1073
-
1074
- // Row menu
1075
- sm = m.addMenu({title : 'table.row'});
1076
- sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'});
1077
- sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'});
1078
- sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'});
1079
- sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'});
1080
- sm.addSeparator();
1081
- sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'});
1082
- sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'});
1083
- sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows);
1084
- sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows);
1085
-
1086
- // Column menu
1087
- sm = m.addMenu({title : 'table.col'});
1088
- sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'});
1089
- sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'});
1090
- sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'});
1091
- } else
1092
- m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'});
1093
- });
1094
- }
1095
-
1096
- // Fix to allow navigating up and down in a table in WebKit browsers.
1097
- if (tinymce.isWebKit) {
1098
- function moveSelection(ed, e) {
1099
- var VK = tinymce.VK;
1100
- var key = e.keyCode;
1101
-
1102
- function handle(upBool, sourceNode, event) {
1103
- var siblingDirection = upBool ? 'previousSibling' : 'nextSibling';
1104
- var currentRow = ed.dom.getParent(sourceNode, 'tr');
1105
- var siblingRow = currentRow[siblingDirection];
1106
-
1107
- if (siblingRow) {
1108
- moveCursorToRow(ed, sourceNode, siblingRow, upBool);
1109
- tinymce.dom.Event.cancel(event);
1110
- return true;
1111
- } else {
1112
- var tableNode = ed.dom.getParent(currentRow, 'table');
1113
- var middleNode = currentRow.parentNode;
1114
- var parentNodeName = middleNode.nodeName.toLowerCase();
1115
- if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) {
1116
- var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody');
1117
- if (targetParent !== null) {
1118
- return moveToRowInTarget(upBool, targetParent, sourceNode, event);
1119
- }
1120
- }
1121
- return escapeTable(upBool, currentRow, siblingDirection, tableNode, event);
1122
- }
1123
- }
1124
-
1125
- function getTargetParent(upBool, topNode, secondNode, nodeName) {
1126
- var tbodies = ed.dom.select('>' + nodeName, topNode);
1127
- var position = tbodies.indexOf(secondNode);
1128
- if (upBool && position === 0 || !upBool && position === tbodies.length - 1) {
1129
- return getFirstHeadOrFoot(upBool, topNode);
1130
- } else if (position === -1) {
1131
- var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1;
1132
- return tbodies[topOrBottom];
1133
- } else {
1134
- return tbodies[position + (upBool ? -1 : 1)];
1135
- }
1136
- }
1137
-
1138
- function getFirstHeadOrFoot(upBool, parent) {
1139
- var tagName = upBool ? 'thead' : 'tfoot';
1140
- var headOrFoot = ed.dom.select('>' + tagName, parent);
1141
- return headOrFoot.length !== 0 ? headOrFoot[0] : null;
1142
- }
1143
-
1144
- function moveToRowInTarget(upBool, targetParent, sourceNode, event) {
1145
- var targetRow = getChildForDirection(targetParent, upBool);
1146
- targetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool);
1147
- tinymce.dom.Event.cancel(event);
1148
- return true;
1149
- }
1150
-
1151
- function escapeTable(upBool, currentRow, siblingDirection, table, event) {
1152
- var tableSibling = table[siblingDirection];
1153
- if (tableSibling) {
1154
- moveCursorToStartOfElement(tableSibling);
1155
- return true;
1156
- } else {
1157
- var parentCell = ed.dom.getParent(table, 'td,th');
1158
- if (parentCell) {
1159
- return handle(upBool, parentCell, event);
1160
- } else {
1161
- var backUpSibling = getChildForDirection(currentRow, !upBool);
1162
- moveCursorToStartOfElement(backUpSibling);
1163
- return tinymce.dom.Event.cancel(event);
1164
- }
1165
- }
1166
- }
1167
-
1168
- function getChildForDirection(parent, up) {
1169
- var child = parent && parent[up ? 'lastChild' : 'firstChild'];
1170
- // BR is not a valid table child to return in this case we return the table cell
1171
- return child && child.nodeName === 'BR' ? ed.dom.getParent(child, 'td,th') : child;
1172
- }
1173
-
1174
- function moveCursorToStartOfElement(n) {
1175
- ed.selection.setCursorLocation(n, 0);
1176
- }
1177
-
1178
- function isVerticalMovement() {
1179
- return key == VK.UP || key == VK.DOWN;
1180
- }
1181
-
1182
- function isInTable(ed) {
1183
- var node = ed.selection.getNode();
1184
- var currentRow = ed.dom.getParent(node, 'tr');
1185
- return currentRow !== null;
1186
- }
1187
-
1188
- function columnIndex(column) {
1189
- var colIndex = 0;
1190
- var c = column;
1191
- while (c.previousSibling) {
1192
- c = c.previousSibling;
1193
- colIndex = colIndex + getSpanVal(c, "colspan");
1194
- }
1195
- return colIndex;
1196
- }
1197
-
1198
- function findColumn(rowElement, columnIndex) {
1199
- var c = 0;
1200
- var r = 0;
1201
- each(rowElement.children, function(cell, i) {
1202
- c = c + getSpanVal(cell, "colspan");
1203
- r = i;
1204
- if (c > columnIndex)
1205
- return false;
1206
- });
1207
- return r;
1208
- }
1209
-
1210
- function moveCursorToRow(ed, node, row, upBool) {
1211
- var srcColumnIndex = columnIndex(ed.dom.getParent(node, 'td,th'));
1212
- var tgtColumnIndex = findColumn(row, srcColumnIndex);
1213
- var tgtNode = row.childNodes[tgtColumnIndex];
1214
- var rowCellTarget = getChildForDirection(tgtNode, upBool);
1215
- moveCursorToStartOfElement(rowCellTarget || tgtNode);
1216
- }
1217
-
1218
- function shouldFixCaret(preBrowserNode) {
1219
- var newNode = ed.selection.getNode();
1220
- var newParent = ed.dom.getParent(newNode, 'td,th');
1221
- var oldParent = ed.dom.getParent(preBrowserNode, 'td,th');
1222
- return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent)
1223
- }
1224
-
1225
- function checkSameParentTable(nodeOne, NodeTwo) {
1226
- return ed.dom.getParent(nodeOne, 'TABLE') === ed.dom.getParent(NodeTwo, 'TABLE');
1227
- }
1228
-
1229
- if (isVerticalMovement() && isInTable(ed)) {
1230
- var preBrowserNode = ed.selection.getNode();
1231
- setTimeout(function() {
1232
- if (shouldFixCaret(preBrowserNode)) {
1233
- handle(!e.shiftKey && key === VK.UP, preBrowserNode, e);
1234
- }
1235
- }, 0);
1236
- }
1237
- }
1238
-
1239
- ed.onKeyDown.add(moveSelection);
1240
- }
1241
-
1242
- // Fixes an issue on Gecko where it's impossible to place the caret behind a table
1243
- // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled
1244
- function fixTableCaretPos() {
1245
- var last;
1246
-
1247
- // Skip empty text nodes form the end
1248
- for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;
1249
-
1250
- if (last && last.nodeName == 'TABLE') {
1251
- if (ed.settings.forced_root_block)
1252
- ed.dom.add(ed.getBody(), ed.settings.forced_root_block, null, tinymce.isIE ? '&nbsp;' : '<br data-mce-bogus="1" />');
1253
- else
1254
- ed.dom.add(ed.getBody(), 'br', {'data-mce-bogus': '1'});
1255
- }
1256
- };
1257
-
1258
- // Fixes an bug where it's impossible to place the caret before a table in Gecko
1259
- // this fix solves it by detecting when the caret is at the beginning of such a table
1260
- // and then manually moves the caret infront of the table
1261
- if (tinymce.isGecko) {
1262
- ed.onKeyDown.add(function(ed, e) {
1263
- var rng, table, dom = ed.dom;
1264
-
1265
- // On gecko it's not possible to place the caret before a table
1266
- if (e.keyCode == 37 || e.keyCode == 38) {
1267
- rng = ed.selection.getRng();
1268
- table = dom.getParent(rng.startContainer, 'table');
1269
-
1270
- if (table && ed.getBody().firstChild == table) {
1271
- if (isAtStart(rng, table)) {
1272
- rng = dom.createRng();
1273
-
1274
- rng.setStartBefore(table);
1275
- rng.setEndBefore(table);
1276
-
1277
- ed.selection.setRng(rng);
1278
-
1279
- e.preventDefault();
1280
- }
1281
- }
1282
- }
1283
- });
1284
- }
1285
-
1286
- ed.onKeyUp.add(fixTableCaretPos);
1287
- ed.onSetContent.add(fixTableCaretPos);
1288
- ed.onVisualAid.add(fixTableCaretPos);
1289
-
1290
- ed.onPreProcess.add(function(ed, o) {
1291
- var last = o.node.lastChild;
1292
-
1293
- if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 && (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) && last.previousSibling && last.previousSibling.nodeName == "TABLE") {
1294
- ed.dom.remove(last);
1295
- }
1296
- });
1297
-
1298
-
1299
- /**
1300
- * Fixes bug in Gecko where shift-enter in table cell does not place caret on new line
1301
- *
1302
- * Removed: Since the new enter logic seems to fix this one.
1303
- */
1304
- /*
1305
- if (tinymce.isGecko) {
1306
- ed.onKeyDown.add(function(ed, e) {
1307
- if (e.keyCode === tinymce.VK.ENTER && e.shiftKey) {
1308
- var node = ed.selection.getRng().startContainer;
1309
- var tableCell = dom.getParent(node, 'td,th');
1310
- if (tableCell) {
1311
- var zeroSizedNbsp = ed.getDoc().createTextNode("\uFEFF");
1312
- dom.insertAfter(zeroSizedNbsp, node);
1313
- }
1314
- }
1315
- });
1316
- }
1317
- */
1318
-
1319
- fixTableCaretPos();
1320
- ed.startContent = ed.getContent({format : 'raw'});
1321
- });
1322
-
1323
- // Register action commands
1324
- each({
1325
- mceTableSplitCells : function(grid) {
1326
- grid.split();
1327
- },
1328
-
1329
- mceTableMergeCells : function(grid) {
1330
- var rowSpan, colSpan, cell;
1331
-
1332
- cell = ed.dom.getParent(ed.selection.getNode(), 'th,td');
1333
- if (cell) {
1334
- rowSpan = cell.rowSpan;
1335
- colSpan = cell.colSpan;
1336
- }
1337
-
1338
- if (!ed.dom.select('td.mceSelected,th.mceSelected').length) {
1339
- winMan.open({
1340
- url : url + '/merge_cells.htm',
1341
- width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)),
1342
- height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)),
1343
- inline : 1
1344
- }, {
1345
- rows : rowSpan,
1346
- cols : colSpan,
1347
- onaction : function(data) {
1348
- grid.merge(cell, data.cols, data.rows);
1349
- },
1350
- plugin_url : url
1351
- });
1352
- } else
1353
- grid.merge();
1354
- },
1355
-
1356
- mceTableInsertRowBefore : function(grid) {
1357
- grid.insertRow(true);
1358
- },
1359
-
1360
- mceTableInsertRowAfter : function(grid) {
1361
- grid.insertRow();
1362
- },
1363
-
1364
- mceTableInsertColBefore : function(grid) {
1365
- grid.insertCol(true);
1366
- },
1367
-
1368
- mceTableInsertColAfter : function(grid) {
1369
- grid.insertCol();
1370
- },
1371
-
1372
- mceTableDeleteCol : function(grid) {
1373
- grid.deleteCols();
1374
- },
1375
-
1376
- mceTableDeleteRow : function(grid) {
1377
- grid.deleteRows();
1378
- },
1379
-
1380
- mceTableCutRow : function(grid) {
1381
- clipboardRows = grid.cutRows();
1382
- },
1383
-
1384
- mceTableCopyRow : function(grid) {
1385
- clipboardRows = grid.copyRows();
1386
- },
1387
-
1388
- mceTablePasteRowBefore : function(grid) {
1389
- grid.pasteRows(clipboardRows, true);
1390
- },
1391
-
1392
- mceTablePasteRowAfter : function(grid) {
1393
- grid.pasteRows(clipboardRows);
1394
- },
1395
-
1396
- mceTableDelete : function(grid) {
1397
- grid.deleteTable();
1398
- }
1399
- }, function(func, name) {
1400
- ed.addCommand(name, function() {
1401
- var grid = createTableGrid();
1402
-
1403
- if (grid) {
1404
- func(grid);
1405
- ed.execCommand('mceRepaint');
1406
- cleanup();
1407
- }
1408
- });
1409
- });
1410
-
1411
- // Register dialog commands
1412
- each({
1413
- mceInsertTable : function(val) {
1414
- winMan.open({
1415
- url : url + '/table.htm',
1416
- width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)),
1417
- height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)),
1418
- inline : 1
1419
- }, {
1420
- plugin_url : url,
1421
- action : val ? val.action : 0
1422
- });
1423
- },
1424
-
1425
- mceTableRowProps : function() {
1426
- winMan.open({
1427
- url : url + '/row.htm',
1428
- width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)),
1429
- height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)),
1430
- inline : 1
1431
- }, {
1432
- plugin_url : url
1433
- });
1434
- },
1435
-
1436
- mceTableCellProps : function() {
1437
- winMan.open({
1438
- url : url + '/cell.htm',
1439
- width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)),
1440
- height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)),
1441
- inline : 1
1442
- }, {
1443
- plugin_url : url
1444
- });
1445
- }
1446
- }, function(func, name) {
1447
- ed.addCommand(name, function(ui, val) {
1448
- func(val);
1449
- });
1450
- });
1451
- }
1452
- });
1453
-
1454
- // Register plugin
1455
- tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin);
1456
- })(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
+ startPos = endPos = null;
291
+
292
+ // Calculate start/end pos by checking for selected cells in grid works better with context menu
293
+ each(grid, function(row, y) {
294
+ each(row, function(cell, x) {
295
+ if (isCellSelected(cell)) {
296
+ if (!startPos) {
297
+ startPos = {x: x, y: y};
298
+ }
299
+
300
+ endPos = {x: x, y: y};
301
+ }
302
+ });
303
+ });
304
+
305
+ // Use selection
306
+ startX = startPos.x;
307
+ startY = startPos.y;
308
+ endX = endPos.x;
309
+ endY = endPos.y;
310
+ }
311
+
312
+ // Find start/end cells
313
+ startCell = getCell(startX, startY);
314
+ endCell = getCell(endX, endY);
315
+
316
+ // Check if the cells exists and if they are of the same part for example tbody = tbody
317
+ if (startCell && endCell && startCell.part == endCell.part) {
318
+ // Split and rebuild grid
319
+ split();
320
+ buildGrid();
321
+
322
+ // Set row/col span to start cell
323
+ startCell = getCell(startX, startY).elm;
324
+ setSpanVal(startCell, 'colSpan', (endX - startX) + 1);
325
+ setSpanVal(startCell, 'rowSpan', (endY - startY) + 1);
326
+
327
+ // Remove other cells and add it's contents to the start cell
328
+ for (y = startY; y <= endY; y++) {
329
+ for (x = startX; x <= endX; x++) {
330
+ if (!grid[y] || !grid[y][x])
331
+ continue;
332
+
333
+ cell = grid[y][x].elm;
334
+
335
+ if (cell != startCell) {
336
+ // Move children to startCell
337
+ children = tinymce.grep(cell.childNodes);
338
+ each(children, function(node) {
339
+ startCell.appendChild(node);
340
+ });
341
+
342
+ // Remove bogus nodes if there is children in the target cell
343
+ if (children.length) {
344
+ children = tinymce.grep(startCell.childNodes);
345
+ count = 0;
346
+ each(children, function(node) {
347
+ if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1)
348
+ startCell.removeChild(node);
349
+ });
350
+ }
351
+
352
+ // Remove cell
353
+ dom.remove(cell);
354
+ }
355
+ }
356
+ }
357
+
358
+ // Remove empty rows etc and restore caret location
359
+ cleanup();
360
+ }
361
+ };
362
+
363
+ function insertRow(before) {
364
+ var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan;
365
+
366
+ // Find first/last row
367
+ each(grid, function(row, y) {
368
+ each(row, function(cell, x) {
369
+ if (isCellSelected(cell)) {
370
+ cell = cell.elm;
371
+ rowElm = cell.parentNode;
372
+ newRow = cloneNode(rowElm, false);
373
+ posY = y;
374
+
375
+ if (before)
376
+ return false;
377
+ }
378
+ });
379
+
380
+ if (before)
381
+ return !posY;
382
+ });
383
+
384
+ for (x = 0; x < grid[0].length; x++) {
385
+ // Cell not found could be because of an invalid table structure
386
+ if (!grid[posY][x])
387
+ continue;
388
+
389
+ cell = grid[posY][x].elm;
390
+
391
+ if (cell != lastCell) {
392
+ if (!before) {
393
+ rowSpan = getSpanVal(cell, 'rowspan');
394
+ if (rowSpan > 1) {
395
+ setSpanVal(cell, 'rowSpan', rowSpan + 1);
396
+ continue;
397
+ }
398
+ } else {
399
+ // Check if cell above can be expanded
400
+ if (posY > 0 && grid[posY - 1][x]) {
401
+ otherCell = grid[posY - 1][x].elm;
402
+ rowSpan = getSpanVal(otherCell, 'rowSpan');
403
+ if (rowSpan > 1) {
404
+ setSpanVal(otherCell, 'rowSpan', rowSpan + 1);
405
+ continue;
406
+ }
407
+ }
408
+ }
409
+
410
+ // Insert new cell into new row
411
+ newCell = cloneCell(cell);
412
+ setSpanVal(newCell, 'colSpan', cell.colSpan);
413
+
414
+ newRow.appendChild(newCell);
415
+
416
+ lastCell = cell;
417
+ }
418
+ }
419
+
420
+ if (newRow.hasChildNodes()) {
421
+ if (!before)
422
+ dom.insertAfter(newRow, rowElm);
423
+ else
424
+ rowElm.parentNode.insertBefore(newRow, rowElm);
425
+ }
426
+ };
427
+
428
+ function insertCol(before) {
429
+ var posX, lastCell;
430
+
431
+ // Find first/last column
432
+ each(grid, function(row, y) {
433
+ each(row, function(cell, x) {
434
+ if (isCellSelected(cell)) {
435
+ posX = x;
436
+
437
+ if (before)
438
+ return false;
439
+ }
440
+ });
441
+
442
+ if (before)
443
+ return !posX;
444
+ });
445
+
446
+ each(grid, function(row, y) {
447
+ var cell, rowSpan, colSpan;
448
+
449
+ if (!row[posX])
450
+ return;
451
+
452
+ cell = row[posX].elm;
453
+ if (cell != lastCell) {
454
+ colSpan = getSpanVal(cell, 'colspan');
455
+ rowSpan = getSpanVal(cell, 'rowspan');
456
+
457
+ if (colSpan == 1) {
458
+ if (!before) {
459
+ dom.insertAfter(cloneCell(cell), cell);
460
+ fillLeftDown(posX, y, rowSpan - 1, colSpan);
461
+ } else {
462
+ cell.parentNode.insertBefore(cloneCell(cell), cell);
463
+ fillLeftDown(posX, y, rowSpan - 1, colSpan);
464
+ }
465
+ } else
466
+ setSpanVal(cell, 'colSpan', cell.colSpan + 1);
467
+
468
+ lastCell = cell;
469
+ }
470
+ });
471
+ };
472
+
473
+ function deleteCols() {
474
+ var cols = [];
475
+
476
+ // Get selected column indexes
477
+ each(grid, function(row, y) {
478
+ each(row, function(cell, x) {
479
+ if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) {
480
+ each(grid, function(row) {
481
+ var cell = row[x].elm, colSpan;
482
+
483
+ colSpan = getSpanVal(cell, 'colSpan');
484
+
485
+ if (colSpan > 1)
486
+ setSpanVal(cell, 'colSpan', colSpan - 1);
487
+ else
488
+ dom.remove(cell);
489
+ });
490
+
491
+ cols.push(x);
492
+ }
493
+ });
494
+ });
495
+
496
+ cleanup();
497
+ };
498
+
499
+ function deleteRows() {
500
+ var rows;
501
+
502
+ function deleteRow(tr) {
503
+ var nextTr, pos, lastCell;
504
+
505
+ nextTr = dom.getNext(tr, 'tr');
506
+
507
+ // Move down row spanned cells
508
+ each(tr.cells, function(cell) {
509
+ var rowSpan = getSpanVal(cell, 'rowSpan');
510
+
511
+ if (rowSpan > 1) {
512
+ setSpanVal(cell, 'rowSpan', rowSpan - 1);
513
+ pos = getPos(cell);
514
+ fillLeftDown(pos.x, pos.y, 1, 1);
515
+ }
516
+ });
517
+
518
+ // Delete cells
519
+ pos = getPos(tr.cells[0]);
520
+ each(grid[pos.y], function(cell) {
521
+ var rowSpan;
522
+
523
+ cell = cell.elm;
524
+
525
+ if (cell != lastCell) {
526
+ rowSpan = getSpanVal(cell, 'rowSpan');
527
+
528
+ if (rowSpan <= 1)
529
+ dom.remove(cell);
530
+ else
531
+ setSpanVal(cell, 'rowSpan', rowSpan - 1);
532
+
533
+ lastCell = cell;
534
+ }
535
+ });
536
+ };
537
+
538
+ // Get selected rows and move selection out of scope
539
+ rows = getSelectedRows();
540
+
541
+ // Delete all selected rows
542
+ each(rows.reverse(), function(tr) {
543
+ deleteRow(tr);
544
+ });
545
+
546
+ cleanup();
547
+ };
548
+
549
+ function cutRows() {
550
+ var rows = getSelectedRows();
551
+
552
+ dom.remove(rows);
553
+ cleanup();
554
+
555
+ return rows;
556
+ };
557
+
558
+ function copyRows() {
559
+ var rows = getSelectedRows();
560
+
561
+ each(rows, function(row, i) {
562
+ rows[i] = cloneNode(row, true);
563
+ });
564
+
565
+ return rows;
566
+ };
567
+
568
+ function pasteRows(rows, before) {
569
+ // If we don't have any rows in the clipboard, return immediately
570
+ if(!rows)
571
+ return;
572
+
573
+ var selectedRows = getSelectedRows(),
574
+ targetRow = selectedRows[before ? 0 : selectedRows.length - 1],
575
+ targetCellCount = targetRow.cells.length;
576
+
577
+ // Calc target cell count
578
+ each(grid, function(row) {
579
+ var match;
580
+
581
+ targetCellCount = 0;
582
+ each(row, function(cell, x) {
583
+ if (cell.real)
584
+ targetCellCount += cell.colspan;
585
+
586
+ if (cell.elm.parentNode == targetRow)
587
+ match = 1;
588
+ });
589
+
590
+ if (match)
591
+ return false;
592
+ });
593
+
594
+ if (!before)
595
+ rows.reverse();
596
+
597
+ each(rows, function(row) {
598
+ var cellCount = row.cells.length, cell;
599
+
600
+ // Remove col/rowspans
601
+ for (i = 0; i < cellCount; i++) {
602
+ cell = row.cells[i];
603
+ setSpanVal(cell, 'colSpan', 1);
604
+ setSpanVal(cell, 'rowSpan', 1);
605
+ }
606
+
607
+ // Needs more cells
608
+ for (i = cellCount; i < targetCellCount; i++)
609
+ row.appendChild(cloneCell(row.cells[cellCount - 1]));
610
+
611
+ // Needs less cells
612
+ for (i = targetCellCount; i < cellCount; i++)
613
+ dom.remove(row.cells[i]);
614
+
615
+ // Add before/after
616
+ if (before)
617
+ targetRow.parentNode.insertBefore(row, targetRow);
618
+ else
619
+ dom.insertAfter(row, targetRow);
620
+ });
621
+
622
+ // Remove current selection
623
+ dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
624
+ };
625
+
626
+ function getPos(target) {
627
+ var pos;
628
+
629
+ each(grid, function(row, y) {
630
+ each(row, function(cell, x) {
631
+ if (cell.elm == target) {
632
+ pos = {x : x, y : y};
633
+ return false;
634
+ }
635
+ });
636
+
637
+ return !pos;
638
+ });
639
+
640
+ return pos;
641
+ };
642
+
643
+ function setStartCell(cell) {
644
+ startPos = getPos(cell);
645
+ };
646
+
647
+ function findEndPos() {
648
+ var pos, maxX, maxY;
649
+
650
+ maxX = maxY = 0;
651
+
652
+ each(grid, function(row, y) {
653
+ each(row, function(cell, x) {
654
+ var colSpan, rowSpan;
655
+
656
+ if (isCellSelected(cell)) {
657
+ cell = grid[y][x];
658
+
659
+ if (x > maxX)
660
+ maxX = x;
661
+
662
+ if (y > maxY)
663
+ maxY = y;
664
+
665
+ if (cell.real) {
666
+ colSpan = cell.colspan - 1;
667
+ rowSpan = cell.rowspan - 1;
668
+
669
+ if (colSpan) {
670
+ if (x + colSpan > maxX)
671
+ maxX = x + colSpan;
672
+ }
673
+
674
+ if (rowSpan) {
675
+ if (y + rowSpan > maxY)
676
+ maxY = y + rowSpan;
677
+ }
678
+ }
679
+ }
680
+ });
681
+ });
682
+
683
+ return {x : maxX, y : maxY};
684
+ };
685
+
686
+ function setEndCell(cell) {
687
+ var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan;
688
+
689
+ endPos = getPos(cell);
690
+
691
+ if (startPos && endPos) {
692
+ // Get start/end positions
693
+ startX = Math.min(startPos.x, endPos.x);
694
+ startY = Math.min(startPos.y, endPos.y);
695
+ endX = Math.max(startPos.x, endPos.x);
696
+ endY = Math.max(startPos.y, endPos.y);
697
+
698
+ // Expand end positon to include spans
699
+ maxX = endX;
700
+ maxY = endY;
701
+
702
+ // Expand startX
703
+ for (y = startY; y <= maxY; y++) {
704
+ cell = grid[y][startX];
705
+
706
+ if (!cell.real) {
707
+ if (startX - (cell.colspan - 1) < startX)
708
+ startX -= cell.colspan - 1;
709
+ }
710
+ }
711
+
712
+ // Expand startY
713
+ for (x = startX; x <= maxX; x++) {
714
+ cell = grid[startY][x];
715
+
716
+ if (!cell.real) {
717
+ if (startY - (cell.rowspan - 1) < startY)
718
+ startY -= cell.rowspan - 1;
719
+ }
720
+ }
721
+
722
+ // Find max X, Y
723
+ for (y = startY; y <= endY; y++) {
724
+ for (x = startX; x <= endX; x++) {
725
+ cell = grid[y][x];
726
+
727
+ if (cell.real) {
728
+ colSpan = cell.colspan - 1;
729
+ rowSpan = cell.rowspan - 1;
730
+
731
+ if (colSpan) {
732
+ if (x + colSpan > maxX)
733
+ maxX = x + colSpan;
734
+ }
735
+
736
+ if (rowSpan) {
737
+ if (y + rowSpan > maxY)
738
+ maxY = y + rowSpan;
739
+ }
740
+ }
741
+ }
742
+ }
743
+
744
+ // Remove current selection
745
+ dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
746
+
747
+ // Add new selection
748
+ for (y = startY; y <= maxY; y++) {
749
+ for (x = startX; x <= maxX; x++) {
750
+ if (grid[y][x])
751
+ dom.addClass(grid[y][x].elm, 'mceSelected');
752
+ }
753
+ }
754
+ }
755
+ };
756
+
757
+ // Expose to public
758
+ tinymce.extend(this, {
759
+ deleteTable : deleteTable,
760
+ split : split,
761
+ merge : merge,
762
+ insertRow : insertRow,
763
+ insertCol : insertCol,
764
+ deleteCols : deleteCols,
765
+ deleteRows : deleteRows,
766
+ cutRows : cutRows,
767
+ copyRows : copyRows,
768
+ pasteRows : pasteRows,
769
+ getPos : getPos,
770
+ setStartCell : setStartCell,
771
+ setEndCell : setEndCell
772
+ });
773
+ };
774
+
775
+ tinymce.create('tinymce.plugins.TablePlugin', {
776
+ init : function(ed, url) {
777
+ var winMan, clipboardRows, hasCellSelection = true; // Might be selected cells on reload
778
+
779
+ function createTableGrid(node) {
780
+ var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table');
781
+
782
+ if (tblElm)
783
+ return new TableGrid(tblElm, ed.dom, selection);
784
+ };
785
+
786
+ function cleanup() {
787
+ // Restore selection possibilities
788
+ ed.getBody().style.webkitUserSelect = '';
789
+
790
+ if (hasCellSelection) {
791
+ ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
792
+ hasCellSelection = false;
793
+ }
794
+ };
795
+
796
+ // Register buttons
797
+ each([
798
+ ['table', 'table.desc', 'mceInsertTable', true],
799
+ ['delete_table', 'table.del', 'mceTableDelete'],
800
+ ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'],
801
+ ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'],
802
+ ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'],
803
+ ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'],
804
+ ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'],
805
+ ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'],
806
+ ['row_props', 'table.row_desc', 'mceTableRowProps', true],
807
+ ['cell_props', 'table.cell_desc', 'mceTableCellProps', true],
808
+ ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true],
809
+ ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true]
810
+ ], function(c) {
811
+ ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]});
812
+ });
813
+
814
+ // Select whole table is a table border is clicked
815
+ if (!tinymce.isIE) {
816
+ ed.onClick.add(function(ed, e) {
817
+ e = e.target;
818
+
819
+ if (e.nodeName === 'TABLE') {
820
+ ed.selection.select(e);
821
+ ed.nodeChanged();
822
+ }
823
+ });
824
+ }
825
+
826
+ ed.onPreProcess.add(function(ed, args) {
827
+ var nodes, i, node, dom = ed.dom, value;
828
+
829
+ nodes = dom.select('table', args.node);
830
+ i = nodes.length;
831
+ while (i--) {
832
+ node = nodes[i];
833
+ dom.setAttrib(node, 'data-mce-style', '');
834
+
835
+ if ((value = dom.getAttrib(node, 'width'))) {
836
+ dom.setStyle(node, 'width', value);
837
+ dom.setAttrib(node, 'width', '');
838
+ }
839
+
840
+ if ((value = dom.getAttrib(node, 'height'))) {
841
+ dom.setStyle(node, 'height', value);
842
+ dom.setAttrib(node, 'height', '');
843
+ }
844
+ }
845
+ });
846
+
847
+ // Handle node change updates
848
+ ed.onNodeChange.add(function(ed, cm, n) {
849
+ var p;
850
+
851
+ n = ed.selection.getStart();
852
+ p = ed.dom.getParent(n, 'td,th,caption');
853
+ cm.setActive('table', n.nodeName === 'TABLE' || !!p);
854
+
855
+ // Disable table tools if we are in caption
856
+ if (p && p.nodeName === 'CAPTION')
857
+ p = 0;
858
+
859
+ cm.setDisabled('delete_table', !p);
860
+ cm.setDisabled('delete_col', !p);
861
+ cm.setDisabled('delete_table', !p);
862
+ cm.setDisabled('delete_row', !p);
863
+ cm.setDisabled('col_after', !p);
864
+ cm.setDisabled('col_before', !p);
865
+ cm.setDisabled('row_after', !p);
866
+ cm.setDisabled('row_before', !p);
867
+ cm.setDisabled('row_props', !p);
868
+ cm.setDisabled('cell_props', !p);
869
+ cm.setDisabled('split_cells', !p);
870
+ cm.setDisabled('merge_cells', !p);
871
+ });
872
+
873
+ ed.onInit.add(function(ed) {
874
+ var startTable, startCell, dom = ed.dom, tableGrid;
875
+
876
+ winMan = ed.windowManager;
877
+
878
+ // Add cell selection logic
879
+ ed.onMouseDown.add(function(ed, e) {
880
+ if (e.button != 2) {
881
+ cleanup();
882
+
883
+ startCell = dom.getParent(e.target, 'td,th');
884
+ startTable = dom.getParent(startCell, 'table');
885
+ }
886
+ });
887
+
888
+ dom.bind(ed.getDoc(), 'mouseover', function(e) {
889
+ var sel, table, target = e.target;
890
+
891
+ if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) {
892
+ table = dom.getParent(target, 'table');
893
+ if (table == startTable) {
894
+ if (!tableGrid) {
895
+ tableGrid = createTableGrid(table);
896
+ tableGrid.setStartCell(startCell);
897
+
898
+ ed.getBody().style.webkitUserSelect = 'none';
899
+ }
900
+
901
+ tableGrid.setEndCell(target);
902
+ hasCellSelection = true;
903
+ }
904
+
905
+ // Remove current selection
906
+ sel = ed.selection.getSel();
907
+
908
+ try {
909
+ if (sel.removeAllRanges)
910
+ sel.removeAllRanges();
911
+ else
912
+ sel.empty();
913
+ } catch (ex) {
914
+ // IE9 might throw errors here
915
+ }
916
+
917
+ e.preventDefault();
918
+ }
919
+ });
920
+
921
+ ed.onMouseUp.add(function(ed, e) {
922
+ var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode;
923
+
924
+ // Move selection to startCell
925
+ if (startCell) {
926
+ if (tableGrid)
927
+ ed.getBody().style.webkitUserSelect = '';
928
+
929
+ function setPoint(node, start) {
930
+ var walker = new tinymce.dom.TreeWalker(node, node);
931
+
932
+ do {
933
+ // Text node
934
+ if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) {
935
+ if (start)
936
+ rng.setStart(node, 0);
937
+ else
938
+ rng.setEnd(node, node.nodeValue.length);
939
+
940
+ return;
941
+ }
942
+
943
+ // BR element
944
+ if (node.nodeName == 'BR') {
945
+ if (start)
946
+ rng.setStartBefore(node);
947
+ else
948
+ rng.setEndBefore(node);
949
+
950
+ return;
951
+ }
952
+ } while (node = (start ? walker.next() : walker.prev()));
953
+ }
954
+
955
+ // Try to expand text selection as much as we can only Gecko supports cell selection
956
+ selectedCells = dom.select('td.mceSelected,th.mceSelected');
957
+ if (selectedCells.length > 0) {
958
+ rng = dom.createRng();
959
+ node = selectedCells[0];
960
+ endNode = selectedCells[selectedCells.length - 1];
961
+ rng.setStartBefore(node);
962
+ rng.setEndAfter(node);
963
+
964
+ setPoint(node, 1);
965
+ walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table'));
966
+
967
+ do {
968
+ if (node.nodeName == 'TD' || node.nodeName == 'TH') {
969
+ if (!dom.hasClass(node, 'mceSelected'))
970
+ break;
971
+
972
+ lastNode = node;
973
+ }
974
+ } while (node = walker.next());
975
+
976
+ setPoint(lastNode);
977
+
978
+ sel.setRng(rng);
979
+ }
980
+
981
+ ed.nodeChanged();
982
+ startCell = tableGrid = startTable = null;
983
+ }
984
+ });
985
+
986
+ ed.onKeyUp.add(function(ed, e) {
987
+ cleanup();
988
+ });
989
+
990
+ ed.onKeyDown.add(function (ed, e) {
991
+ fixTableCellSelection(ed);
992
+ });
993
+
994
+ ed.onMouseDown.add(function (ed, e) {
995
+ if (e.button != 2) {
996
+ fixTableCellSelection(ed);
997
+ }
998
+ });
999
+ function tableCellSelected(ed, rng, n, currentCell) {
1000
+ // The decision of when a table cell is selected is somewhat involved. The fact that this code is
1001
+ // required is actually a pointer to the root cause of this bug. A cell is selected when the start
1002
+ // and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases)
1003
+ // or the parent of the table (in the case of the selection containing the last cell of a table).
1004
+ var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'),
1005
+ tableParent, allOfCellSelected, tableCellSelection;
1006
+ if (table)
1007
+ tableParent = table.parentNode;
1008
+ allOfCellSelected =rng.startContainer.nodeType == TEXT_NODE &&
1009
+ rng.startOffset == 0 &&
1010
+ rng.endOffset == 0 &&
1011
+ currentCell &&
1012
+ (n.nodeName=="TR" || n==tableParent);
1013
+ tableCellSelection = (n.nodeName=="TD"||n.nodeName=="TH")&& !currentCell;
1014
+ return allOfCellSelected || tableCellSelection;
1015
+ // return false;
1016
+ }
1017
+
1018
+ // this nasty hack is here to work around some WebKit selection bugs.
1019
+ function fixTableCellSelection(ed) {
1020
+ if (!tinymce.isWebKit)
1021
+ return;
1022
+
1023
+ var rng = ed.selection.getRng();
1024
+ var n = ed.selection.getNode();
1025
+ var currentCell = ed.dom.getParent(rng.startContainer, 'TD,TH');
1026
+
1027
+ if (!tableCellSelected(ed, rng, n, currentCell))
1028
+ return;
1029
+ if (!currentCell) {
1030
+ currentCell=n;
1031
+ }
1032
+
1033
+ // Get the very last node inside the table cell
1034
+ var end = currentCell.lastChild;
1035
+ while (end.lastChild)
1036
+ end = end.lastChild;
1037
+
1038
+ // Select the entire table cell. Nothing outside of the table cell should be selected.
1039
+ rng.setEnd(end, end.nodeValue.length);
1040
+ ed.selection.setRng(rng);
1041
+ }
1042
+ ed.plugins.table.fixTableCellSelection=fixTableCellSelection;
1043
+
1044
+ // Add context menu
1045
+ if (ed && ed.plugins.contextmenu) {
1046
+ ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
1047
+ var sm, se = ed.selection, el = se.getNode() || ed.getBody();
1048
+
1049
+ if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) {
1050
+ m.removeAll();
1051
+
1052
+ if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) {
1053
+ m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});
1054
+ m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});
1055
+ m.addSeparator();
1056
+ }
1057
+
1058
+ if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) {
1059
+ m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
1060
+ m.addSeparator();
1061
+ }
1062
+
1063
+ m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}});
1064
+ m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'});
1065
+ m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'});
1066
+ m.addSeparator();
1067
+
1068
+ // Cell menu
1069
+ sm = m.addMenu({title : 'table.cell'});
1070
+ sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'});
1071
+ sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'});
1072
+ sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'});
1073
+
1074
+ // Row menu
1075
+ sm = m.addMenu({title : 'table.row'});
1076
+ sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'});
1077
+ sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'});
1078
+ sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'});
1079
+ sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'});
1080
+ sm.addSeparator();
1081
+ sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'});
1082
+ sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'});
1083
+ sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows);
1084
+ sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows);
1085
+
1086
+ // Column menu
1087
+ sm = m.addMenu({title : 'table.col'});
1088
+ sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'});
1089
+ sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'});
1090
+ sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'});
1091
+ } else
1092
+ m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'});
1093
+ });
1094
+ }
1095
+
1096
+ // Fix to allow navigating up and down in a table in WebKit browsers.
1097
+ if (tinymce.isWebKit) {
1098
+ function moveSelection(ed, e) {
1099
+ var VK = tinymce.VK;
1100
+ var key = e.keyCode;
1101
+
1102
+ function handle(upBool, sourceNode, event) {
1103
+ var siblingDirection = upBool ? 'previousSibling' : 'nextSibling';
1104
+ var currentRow = ed.dom.getParent(sourceNode, 'tr');
1105
+ var siblingRow = currentRow[siblingDirection];
1106
+
1107
+ if (siblingRow) {
1108
+ moveCursorToRow(ed, sourceNode, siblingRow, upBool);
1109
+ tinymce.dom.Event.cancel(event);
1110
+ return true;
1111
+ } else {
1112
+ var tableNode = ed.dom.getParent(currentRow, 'table');
1113
+ var middleNode = currentRow.parentNode;
1114
+ var parentNodeName = middleNode.nodeName.toLowerCase();
1115
+ if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) {
1116
+ var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody');
1117
+ if (targetParent !== null) {
1118
+ return moveToRowInTarget(upBool, targetParent, sourceNode, event);
1119
+ }
1120
+ }
1121
+ return escapeTable(upBool, currentRow, siblingDirection, tableNode, event);
1122
+ }
1123
+ }
1124
+
1125
+ function getTargetParent(upBool, topNode, secondNode, nodeName) {
1126
+ var tbodies = ed.dom.select('>' + nodeName, topNode);
1127
+ var position = tbodies.indexOf(secondNode);
1128
+ if (upBool && position === 0 || !upBool && position === tbodies.length - 1) {
1129
+ return getFirstHeadOrFoot(upBool, topNode);
1130
+ } else if (position === -1) {
1131
+ var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1;
1132
+ return tbodies[topOrBottom];
1133
+ } else {
1134
+ return tbodies[position + (upBool ? -1 : 1)];
1135
+ }
1136
+ }
1137
+
1138
+ function getFirstHeadOrFoot(upBool, parent) {
1139
+ var tagName = upBool ? 'thead' : 'tfoot';
1140
+ var headOrFoot = ed.dom.select('>' + tagName, parent);
1141
+ return headOrFoot.length !== 0 ? headOrFoot[0] : null;
1142
+ }
1143
+
1144
+ function moveToRowInTarget(upBool, targetParent, sourceNode, event) {
1145
+ var targetRow = getChildForDirection(targetParent, upBool);
1146
+ targetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool);
1147
+ tinymce.dom.Event.cancel(event);
1148
+ return true;
1149
+ }
1150
+
1151
+ function escapeTable(upBool, currentRow, siblingDirection, table, event) {
1152
+ var tableSibling = table[siblingDirection];
1153
+ if (tableSibling) {
1154
+ moveCursorToStartOfElement(tableSibling);
1155
+ return true;
1156
+ } else {
1157
+ var parentCell = ed.dom.getParent(table, 'td,th');
1158
+ if (parentCell) {
1159
+ return handle(upBool, parentCell, event);
1160
+ } else {
1161
+ var backUpSibling = getChildForDirection(currentRow, !upBool);
1162
+ moveCursorToStartOfElement(backUpSibling);
1163
+ return tinymce.dom.Event.cancel(event);
1164
+ }
1165
+ }
1166
+ }
1167
+
1168
+ function getChildForDirection(parent, up) {
1169
+ var child = parent && parent[up ? 'lastChild' : 'firstChild'];
1170
+ // BR is not a valid table child to return in this case we return the table cell
1171
+ return child && child.nodeName === 'BR' ? ed.dom.getParent(child, 'td,th') : child;
1172
+ }
1173
+
1174
+ function moveCursorToStartOfElement(n) {
1175
+ ed.selection.setCursorLocation(n, 0);
1176
+ }
1177
+
1178
+ function isVerticalMovement() {
1179
+ return key == VK.UP || key == VK.DOWN;
1180
+ }
1181
+
1182
+ function isInTable(ed) {
1183
+ var node = ed.selection.getNode();
1184
+ var currentRow = ed.dom.getParent(node, 'tr');
1185
+ return currentRow !== null;
1186
+ }
1187
+
1188
+ function columnIndex(column) {
1189
+ var colIndex = 0;
1190
+ var c = column;
1191
+ while (c.previousSibling) {
1192
+ c = c.previousSibling;
1193
+ colIndex = colIndex + getSpanVal(c, "colspan");
1194
+ }
1195
+ return colIndex;
1196
+ }
1197
+
1198
+ function findColumn(rowElement, columnIndex) {
1199
+ var c = 0;
1200
+ var r = 0;
1201
+ each(rowElement.children, function(cell, i) {
1202
+ c = c + getSpanVal(cell, "colspan");
1203
+ r = i;
1204
+ if (c > columnIndex)
1205
+ return false;
1206
+ });
1207
+ return r;
1208
+ }
1209
+
1210
+ function moveCursorToRow(ed, node, row, upBool) {
1211
+ var srcColumnIndex = columnIndex(ed.dom.getParent(node, 'td,th'));
1212
+ var tgtColumnIndex = findColumn(row, srcColumnIndex);
1213
+ var tgtNode = row.childNodes[tgtColumnIndex];
1214
+ var rowCellTarget = getChildForDirection(tgtNode, upBool);
1215
+ moveCursorToStartOfElement(rowCellTarget || tgtNode);
1216
+ }
1217
+
1218
+ function shouldFixCaret(preBrowserNode) {
1219
+ var newNode = ed.selection.getNode();
1220
+ var newParent = ed.dom.getParent(newNode, 'td,th');
1221
+ var oldParent = ed.dom.getParent(preBrowserNode, 'td,th');
1222
+ return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent)
1223
+ }
1224
+
1225
+ function checkSameParentTable(nodeOne, NodeTwo) {
1226
+ return ed.dom.getParent(nodeOne, 'TABLE') === ed.dom.getParent(NodeTwo, 'TABLE');
1227
+ }
1228
+
1229
+ if (isVerticalMovement() && isInTable(ed)) {
1230
+ var preBrowserNode = ed.selection.getNode();
1231
+ setTimeout(function() {
1232
+ if (shouldFixCaret(preBrowserNode)) {
1233
+ handle(!e.shiftKey && key === VK.UP, preBrowserNode, e);
1234
+ }
1235
+ }, 0);
1236
+ }
1237
+ }
1238
+
1239
+ ed.onKeyDown.add(moveSelection);
1240
+ }
1241
+
1242
+ // Fixes an issue on Gecko where it's impossible to place the caret behind a table
1243
+ // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled
1244
+ function fixTableCaretPos() {
1245
+ var last;
1246
+
1247
+ // Skip empty text nodes form the end
1248
+ for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;
1249
+
1250
+ if (last && last.nodeName == 'TABLE') {
1251
+ if (ed.settings.forced_root_block)
1252
+ ed.dom.add(ed.getBody(), ed.settings.forced_root_block, null, tinymce.isIE ? '&nbsp;' : '<br data-mce-bogus="1" />');
1253
+ else
1254
+ ed.dom.add(ed.getBody(), 'br', {'data-mce-bogus': '1'});
1255
+ }
1256
+ };
1257
+
1258
+ // Fixes an bug where it's impossible to place the caret before a table in Gecko
1259
+ // this fix solves it by detecting when the caret is at the beginning of such a table
1260
+ // and then manually moves the caret infront of the table
1261
+ if (tinymce.isGecko) {
1262
+ ed.onKeyDown.add(function(ed, e) {
1263
+ var rng, table, dom = ed.dom;
1264
+
1265
+ // On gecko it's not possible to place the caret before a table
1266
+ if (e.keyCode == 37 || e.keyCode == 38) {
1267
+ rng = ed.selection.getRng();
1268
+ table = dom.getParent(rng.startContainer, 'table');
1269
+
1270
+ if (table && ed.getBody().firstChild == table) {
1271
+ if (isAtStart(rng, table)) {
1272
+ rng = dom.createRng();
1273
+
1274
+ rng.setStartBefore(table);
1275
+ rng.setEndBefore(table);
1276
+
1277
+ ed.selection.setRng(rng);
1278
+
1279
+ e.preventDefault();
1280
+ }
1281
+ }
1282
+ }
1283
+ });
1284
+ }
1285
+
1286
+ ed.onKeyUp.add(fixTableCaretPos);
1287
+ ed.onSetContent.add(fixTableCaretPos);
1288
+ ed.onVisualAid.add(fixTableCaretPos);
1289
+
1290
+ ed.onPreProcess.add(function(ed, o) {
1291
+ var last = o.node.lastChild;
1292
+
1293
+ if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 && (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) && last.previousSibling && last.previousSibling.nodeName == "TABLE") {
1294
+ ed.dom.remove(last);
1295
+ }
1296
+ });
1297
+
1298
+
1299
+ /**
1300
+ * Fixes bug in Gecko where shift-enter in table cell does not place caret on new line
1301
+ *
1302
+ * Removed: Since the new enter logic seems to fix this one.
1303
+ */
1304
+ /*
1305
+ if (tinymce.isGecko) {
1306
+ ed.onKeyDown.add(function(ed, e) {
1307
+ if (e.keyCode === tinymce.VK.ENTER && e.shiftKey) {
1308
+ var node = ed.selection.getRng().startContainer;
1309
+ var tableCell = dom.getParent(node, 'td,th');
1310
+ if (tableCell) {
1311
+ var zeroSizedNbsp = ed.getDoc().createTextNode("\uFEFF");
1312
+ dom.insertAfter(zeroSizedNbsp, node);
1313
+ }
1314
+ }
1315
+ });
1316
+ }
1317
+ */
1318
+
1319
+ fixTableCaretPos();
1320
+ ed.startContent = ed.getContent({format : 'raw'});
1321
+ });
1322
+
1323
+ // Register action commands
1324
+ each({
1325
+ mceTableSplitCells : function(grid) {
1326
+ grid.split();
1327
+ },
1328
+
1329
+ mceTableMergeCells : function(grid) {
1330
+ var rowSpan, colSpan, cell;
1331
+
1332
+ cell = ed.dom.getParent(ed.selection.getNode(), 'th,td');
1333
+ if (cell) {
1334
+ rowSpan = cell.rowSpan;
1335
+ colSpan = cell.colSpan;
1336
+ }
1337
+
1338
+ if (!ed.dom.select('td.mceSelected,th.mceSelected').length) {
1339
+ winMan.open({
1340
+ url : url + '/merge_cells.htm',
1341
+ width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)),
1342
+ height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)),
1343
+ inline : 1
1344
+ }, {
1345
+ rows : rowSpan,
1346
+ cols : colSpan,
1347
+ onaction : function(data) {
1348
+ grid.merge(cell, data.cols, data.rows);
1349
+ },
1350
+ plugin_url : url
1351
+ });
1352
+ } else
1353
+ grid.merge();
1354
+ },
1355
+
1356
+ mceTableInsertRowBefore : function(grid) {
1357
+ grid.insertRow(true);
1358
+ },
1359
+
1360
+ mceTableInsertRowAfter : function(grid) {
1361
+ grid.insertRow();
1362
+ },
1363
+
1364
+ mceTableInsertColBefore : function(grid) {
1365
+ grid.insertCol(true);
1366
+ },
1367
+
1368
+ mceTableInsertColAfter : function(grid) {
1369
+ grid.insertCol();
1370
+ },
1371
+
1372
+ mceTableDeleteCol : function(grid) {
1373
+ grid.deleteCols();
1374
+ },
1375
+
1376
+ mceTableDeleteRow : function(grid) {
1377
+ grid.deleteRows();
1378
+ },
1379
+
1380
+ mceTableCutRow : function(grid) {
1381
+ clipboardRows = grid.cutRows();
1382
+ },
1383
+
1384
+ mceTableCopyRow : function(grid) {
1385
+ clipboardRows = grid.copyRows();
1386
+ },
1387
+
1388
+ mceTablePasteRowBefore : function(grid) {
1389
+ grid.pasteRows(clipboardRows, true);
1390
+ },
1391
+
1392
+ mceTablePasteRowAfter : function(grid) {
1393
+ grid.pasteRows(clipboardRows);
1394
+ },
1395
+
1396
+ mceTableDelete : function(grid) {
1397
+ grid.deleteTable();
1398
+ }
1399
+ }, function(func, name) {
1400
+ ed.addCommand(name, function() {
1401
+ var grid = createTableGrid();
1402
+
1403
+ if (grid) {
1404
+ func(grid);
1405
+ ed.execCommand('mceRepaint');
1406
+ cleanup();
1407
+ }
1408
+ });
1409
+ });
1410
+
1411
+ // Register dialog commands
1412
+ each({
1413
+ mceInsertTable : function(val) {
1414
+ winMan.open({
1415
+ url : url + '/table.htm',
1416
+ width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)),
1417
+ height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)),
1418
+ inline : 1
1419
+ }, {
1420
+ plugin_url : url,
1421
+ action : val ? val.action : 0
1422
+ });
1423
+ },
1424
+
1425
+ mceTableRowProps : function() {
1426
+ winMan.open({
1427
+ url : url + '/row.htm',
1428
+ width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)),
1429
+ height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)),
1430
+ inline : 1
1431
+ }, {
1432
+ plugin_url : url
1433
+ });
1434
+ },
1435
+
1436
+ mceTableCellProps : function() {
1437
+ winMan.open({
1438
+ url : url + '/cell.htm',
1439
+ width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)),
1440
+ height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)),
1441
+ inline : 1
1442
+ }, {
1443
+ plugin_url : url
1444
+ });
1445
+ }
1446
+ }, function(func, name) {
1447
+ ed.addCommand(name, function(ui, val) {
1448
+ func(val);
1449
+ });
1450
+ });
1451
+ }
1452
+ });
1453
+
1454
+ // Register plugin
1455
+ tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin);
1456
+ })(tinymce);
js/tinymce/jscripts/tiny_mce/plugins/table/js/table.js CHANGED
@@ -242,16 +242,16 @@ function insertTable() {
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
  // Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document
249
  if (tinymce.isIE && node.nextSibling == null) {
250
  if (inst.settings.forced_root_block)
251
  dom.insertAfter(dom.create(inst.settings.forced_root_block), node);
252
  else
253
  dom.insertAfter(dom.create('br', {'data-mce-bogus': '1'}), node);
254
- }
255
 
256
  try {
257
  // IE9 might fail to do this selection
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
  // Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document
249
  if (tinymce.isIE && node.nextSibling == null) {
250
  if (inst.settings.forced_root_block)
251
  dom.insertAfter(dom.create(inst.settings.forced_root_block), node);
252
  else
253
  dom.insertAfter(dom.create('br', {'data-mce-bogus': '1'}), node);
254
+ }
255
 
256
  try {
257
  // IE9 might fail to do this selection
js/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js CHANGED
@@ -1,345 +1,345 @@
1
- tinyMCEPopup.requireLangPack();
2
-
3
- var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;
4
-
5
- var colors = [
6
- "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
7
- "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
8
- "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
9
- "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
10
- "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
11
- "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
12
- "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
13
- "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
14
- "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
15
- "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
16
- "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
17
- "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
18
- "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
19
- "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
20
- "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
21
- "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
22
- "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
23
- "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
24
- "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
25
- "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
26
- "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
27
- "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
28
- "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
29
- "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
30
- "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
31
- "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
32
- "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
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);
74
-
75
- col = convertHexToRGB(inputColor);
76
-
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 = tinymce.trim(color);
97
- color = color.replace(/^[#]/, '').toLowerCase(); // remove leading '#'
98
- color = namedLookup[color] || color;
99
-
100
- matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/.exec(color);
101
-
102
- if (matches) {
103
- red = toInt(matches[1]);
104
- green = toInt(matches[2]);
105
- blue = toInt(matches[3]);
106
- } else {
107
- matches = /^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color);
108
-
109
- if (matches) {
110
- red = toInt(matches[1], 16);
111
- green = toInt(matches[2], 16);
112
- blue = toInt(matches[3], 16);
113
- } else {
114
- matches = /^([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color);
115
-
116
- if (matches) {
117
- red = toInt(matches[1] + matches[1], 16);
118
- green = toInt(matches[2] + matches[2], 16);
119
- blue = toInt(matches[3] + matches[3], 16);
120
- } else {
121
- return '';
122
- }
123
- }
124
- }
125
-
126
- return '#' + hex(red) + hex(green) + hex(blue);
127
- }
128
-
129
- function insertAction() {
130
- var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func');
131
-
132
- var hexColor = toHexColor(color);
133
-
134
- if (hexColor === '') {
135
- var text = tinyMCEPopup.editor.getLang('advanced_dlg.invalid_color_value');
136
- tinyMCEPopup.alert(text + ': ' + color);
137
- }
138
- else {
139
- tinyMCEPopup.restoreSelection();
140
-
141
- if (f)
142
- f(hexColor);
143
-
144
- tinyMCEPopup.close();
145
- }
146
- }
147
-
148
- function showColor(color, name) {
149
- if (name)
150
- document.getElementById("colorname").innerHTML = name;
151
-
152
- document.getElementById("preview").style.backgroundColor = color;
153
- document.getElementById("color").value = color.toUpperCase();
154
- }
155
-
156
- function convertRGBToHex(col) {
157
- var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
158
-
159
- if (!col)
160
- return col;
161
-
162
- var rgb = col.replace(re, "$1,$2,$3").split(',');
163
- if (rgb.length == 3) {
164
- r = parseInt(rgb[0]).toString(16);
165
- g = parseInt(rgb[1]).toString(16);
166
- b = parseInt(rgb[2]).toString(16);
167
-
168
- r = r.length == 1 ? '0' + r : r;
169
- g = g.length == 1 ? '0' + g : g;
170
- b = b.length == 1 ? '0' + b : b;
171
-
172
- return "#" + r + g + b;
173
- }
174
-
175
- return col;
176
- }
177
-
178
- function convertHexToRGB(col) {
179
- if (col.indexOf('#') != -1) {
180
- col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
181
-
182
- r = parseInt(col.substring(0, 2), 16);
183
- g = parseInt(col.substring(2, 4), 16);
184
- b = parseInt(col.substring(4, 6), 16);
185
-
186
- return {r : r, g : g, b : b};
187
- }
188
-
189
- return null;
190
- }
191
-
192
- function generatePicker() {
193
- var el = document.getElementById('light'), h = '', i;
194
-
195
- for (i = 0; i < detail; i++){
196
- h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'
197
- + ' onclick="changeFinalColor(this.style.backgroundColor)"'
198
- + ' onmousedown="isMouseDown = true; return false;"'
199
- + ' onmouseup="isMouseDown = false;"'
200
- + ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'
201
- + ' onmouseover="isMouseOver = true;"'
202
- + ' onmouseout="isMouseOver = false;"'
203
- + '></div>';
204
- }
205
-
206
- el.innerHTML = h;
207
- }
208
-
209
- function generateWebColors() {
210
- var el = document.getElementById('webcolors'), h = '', i;
211
-
212
- if (el.className == 'generated')
213
- return;
214
-
215
- // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby.
216
- h += '<div role="listbox" aria-labelledby="webcolors_title" tabindex="0"><table role="presentation" border="0" cellspacing="1" cellpadding="0">'
217
- + '<tr>';
218
-
219
- for (i=0; i<colors.length; i++) {
220
- h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'
221
- + '<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;">';
222
- if (tinyMCEPopup.editor.forcedHighContrastMode) {
223
- h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
224
- }
225
- h += '<span class="mceVoiceLabel" style="display:none;" id="web_colors_' + i + '">' + colors[i].toUpperCase() + '</span>';
226
- h += '</a></td>';
227
- if ((i+1) % 18 == 0)
228
- h += '</tr><tr>';
229
- }
230
-
231
- h += '</table></div>';
232
-
233
- el.innerHTML = h;
234
- el.className = 'generated';
235
-
236
- paintCanvas(el);
237
- enableKeyboardNavigation(el.firstChild);
238
- }
239
-
240
- function paintCanvas(el) {
241
- tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) {
242
- var context;
243
- if (canvas.getContext && (context = canvas.getContext("2d"))) {
244
- context.fillStyle = canvas.getAttribute('data-color');
245
- context.fillRect(0, 0, 10, 10);
246
- }
247
- });
248
- }
249
- function generateNamedColors() {
250
- var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
251
-
252
- if (el.className == 'generated')
253
- return;
254
-
255
- for (n in named) {
256
- v = named[n];
257
- 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 + '">';
258
- if (tinyMCEPopup.editor.forcedHighContrastMode) {
259
- h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
260
- }
261
- h += '<span class="mceVoiceLabel" style="display:none;" id="named_colors_' + i + '">' + v + '</span>';
262
- h += '</a>';
263
- i++;
264
- }
265
-
266
- el.innerHTML = h;
267
- el.className = 'generated';
268
-
269
- paintCanvas(el);
270
- enableKeyboardNavigation(el);
271
- }
272
-
273
- function enableKeyboardNavigation(el) {
274
- tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
275
- root: el,
276
- items: tinyMCEPopup.dom.select('a', el)
277
- }, tinyMCEPopup.dom);
278
- }
279
-
280
- function dechex(n) {
281
- return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);
282
- }
283
-
284
- function computeColor(e) {
285
- var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target);
286
-
287
- x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0);
288
- y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0);
289
-
290
- partWidth = document.getElementById('colors').width / 6;
291
- partDetail = detail / 2;
292
- imHeight = document.getElementById('colors').height;
293
-
294
- r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;
295
- g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);
296
- b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);
297
-
298
- coef = (imHeight - y) / imHeight;
299
- r = 128 + (r - 128) * coef;
300
- g = 128 + (g - 128) * coef;
301
- b = 128 + (b - 128) * coef;
302
-
303
- changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));
304
- updateLight(r, g, b);
305
- }
306
-
307
- function updateLight(r, g, b) {
308
- var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;
309
-
310
- for (i=0; i<detail; i++) {
311
- if ((i>=0) && (i<partDetail)) {
312
- finalCoef = i / partDetail;
313
- finalR = dechex(255 - (255 - r) * finalCoef);
314
- finalG = dechex(255 - (255 - g) * finalCoef);
315
- finalB = dechex(255 - (255 - b) * finalCoef);
316
- } else {
317
- finalCoef = 2 - i / partDetail;
318
- finalR = dechex(r * finalCoef);
319
- finalG = dechex(g * finalCoef);
320
- finalB = dechex(b * finalCoef);
321
- }
322
-
323
- color = finalR + finalG + finalB;
324
-
325
- setCol('gs' + i, '#'+color);
326
- }
327
- }
328
-
329
- function changeFinalColor(color) {
330
- if (color.indexOf('#') == -1)
331
- color = convertRGBToHex(color);
332
-
333
- setCol('preview', color);
334
- document.getElementById('color').value = color;
335
- }
336
-
337
- function setCol(e, c) {
338
- try {
339
- document.getElementById(e).style.backgroundColor = c;
340
- } catch (ex) {
341
- // Ignore IE warning
342
- }
343
- }
344
-
345
- tinyMCEPopup.onInit.add(init);
1
+ tinyMCEPopup.requireLangPack();
2
+
3
+ var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;
4
+
5
+ var colors = [
6
+ "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
7
+ "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
8
+ "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
9
+ "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
10
+ "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
11
+ "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
12
+ "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
13
+ "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
14
+ "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
15
+ "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
16
+ "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
17
+ "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
18
+ "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
19
+ "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
20
+ "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
21
+ "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
22
+ "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
23
+ "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
24
+ "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
25
+ "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
26
+ "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
27
+ "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
28
+ "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
29
+ "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
30
+ "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
31
+ "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
32
+ "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
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);
74
+
75
+ col = convertHexToRGB(inputColor);
76
+
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 = tinymce.trim(color);
97
+ color = color.replace(/^[#]/, '').toLowerCase(); // remove leading '#'
98
+ color = namedLookup[color] || color;
99
+
100
+ matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/.exec(color);
101
+
102
+ if (matches) {
103
+ red = toInt(matches[1]);
104
+ green = toInt(matches[2]);
105
+ blue = toInt(matches[3]);
106
+ } else {
107
+ matches = /^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color);
108
+
109
+ if (matches) {
110
+ red = toInt(matches[1], 16);
111
+ green = toInt(matches[2], 16);
112
+ blue = toInt(matches[3], 16);
113
+ } else {
114
+ matches = /^([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color);
115
+
116
+ if (matches) {
117
+ red = toInt(matches[1] + matches[1], 16);
118
+ green = toInt(matches[2] + matches[2], 16);
119
+ blue = toInt(matches[3] + matches[3], 16);
120
+ } else {
121
+ return '';
122
+ }
123
+ }
124
+ }
125
+
126
+ return '#' + hex(red) + hex(green) + hex(blue);
127
+ }
128
+
129
+ function insertAction() {
130
+ var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func');
131
+
132
+ var hexColor = toHexColor(color);
133
+
134
+ if (hexColor === '') {
135
+ var text = tinyMCEPopup.editor.getLang('advanced_dlg.invalid_color_value');
136
+ tinyMCEPopup.alert(text + ': ' + color);
137
+ }
138
+ else {
139
+ tinyMCEPopup.restoreSelection();
140
+
141
+ if (f)
142
+ f(hexColor);
143
+
144
+ tinyMCEPopup.close();
145
+ }
146
+ }
147
+
148
+ function showColor(color, name) {
149
+ if (name)
150
+ document.getElementById("colorname").innerHTML = name;
151
+
152
+ document.getElementById("preview").style.backgroundColor = color;
153
+ document.getElementById("color").value = color.toUpperCase();
154
+ }
155
+
156
+ function convertRGBToHex(col) {
157
+ var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
158
+
159
+ if (!col)
160
+ return col;
161
+
162
+ var rgb = col.replace(re, "$1,$2,$3").split(',');
163
+ if (rgb.length == 3) {
164
+ r = parseInt(rgb[0]).toString(16);
165
+ g = parseInt(rgb[1]).toString(16);
166
+ b = parseInt(rgb[2]).toString(16);
167
+
168
+ r = r.length == 1 ? '0' + r : r;
169
+ g = g.length == 1 ? '0' + g : g;
170
+ b = b.length == 1 ? '0' + b : b;
171
+
172
+ return "#" + r + g + b;
173
+ }
174
+
175
+ return col;
176
+ }
177
+
178
+ function convertHexToRGB(col) {
179
+ if (col.indexOf('#') != -1) {
180
+ col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
181
+
182
+ r = parseInt(col.substring(0, 2), 16);
183
+ g = parseInt(col.substring(2, 4), 16);
184
+ b = parseInt(col.substring(4, 6), 16);
185
+
186
+ return {r : r, g : g, b : b};
187
+ }
188
+
189
+ return null;
190
+ }
191
+
192
+ function generatePicker() {
193
+ var el = document.getElementById('light'), h = '', i;
194
+
195
+ for (i = 0; i < detail; i++){
196
+ h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'
197
+ + ' onclick="changeFinalColor(this.style.backgroundColor)"'
198
+ + ' onmousedown="isMouseDown = true; return false;"'
199
+ + ' onmouseup="isMouseDown = false;"'
200
+ + ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'
201
+ + ' onmouseover="isMouseOver = true;"'
202
+ + ' onmouseout="isMouseOver = false;"'
203
+ + '></div>';
204
+ }
205
+
206
+ el.innerHTML = h;
207
+ }
208
+
209
+ function generateWebColors() {
210
+ var el = document.getElementById('webcolors'), h = '', i;
211
+
212
+ if (el.className == 'generated')
213
+ return;
214
+
215
+ // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby.
216
+ h += '<div role="listbox" aria-labelledby="webcolors_title" tabindex="0"><table role="presentation" border="0" cellspacing="1" cellpadding="0">'
217
+ + '<tr>';
218
+
219
+ for (i=0; i<colors.length; i++) {
220
+ h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'
221
+ + '<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;">';
222
+ if (tinyMCEPopup.editor.forcedHighContrastMode) {
223
+ h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
224
+ }
225
+ h += '<span class="mceVoiceLabel" style="display:none;" id="web_colors_' + i + '">' + colors[i].toUpperCase() + '</span>';
226
+ h += '</a></td>';
227
+ if ((i+1) % 18 == 0)
228
+ h += '</tr><tr>';
229
+ }
230
+
231
+ h += '</table></div>';
232
+
233
+ el.innerHTML = h;
234
+ el.className = 'generated';
235
+
236
+ paintCanvas(el);
237
+ enableKeyboardNavigation(el.firstChild);
238
+ }
239
+
240
+ function paintCanvas(el) {
241
+ tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) {
242
+ var context;
243
+ if (canvas.getContext && (context = canvas.getContext("2d"))) {
244
+ context.fillStyle = canvas.getAttribute('data-color');
245
+ context.fillRect(0, 0, 10, 10);
246
+ }
247
+ });
248
+ }
249
+ function generateNamedColors() {
250
+ var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
251
+
252
+ if (el.className == 'generated')
253
+ return;
254
+
255
+ for (n in named) {
256
+ v = named[n];
257
+ 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 + '">';
258
+ if (tinyMCEPopup.editor.forcedHighContrastMode) {
259
+ h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
260
+ }
261
+ h += '<span class="mceVoiceLabel" style="display:none;" id="named_colors_' + i + '">' + v + '</span>';
262
+ h += '</a>';
263
+ i++;
264
+ }
265
+
266
+ el.innerHTML = h;
267
+ el.className = 'generated';
268
+
269
+ paintCanvas(el);
270
+ enableKeyboardNavigation(el);
271
+ }
272
+
273
+ function enableKeyboardNavigation(el) {
274
+ tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
275
+ root: el,
276
+ items: tinyMCEPopup.dom.select('a', el)
277
+ }, tinyMCEPopup.dom);
278
+ }
279
+
280
+ function dechex(n) {
281
+ return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);
282
+ }
283
+
284
+ function computeColor(e) {
285
+ var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target);
286
+
287
+ x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0);
288
+ y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0);
289
+
290
+ partWidth = document.getElementById('colors').width / 6;
291
+ partDetail = detail / 2;
292
+ imHeight = document.getElementById('colors').height;
293
+
294
+ r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;
295
+ g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);
296
+ b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);
297
+
298
+ coef = (imHeight - y) / imHeight;
299
+ r = 128 + (r - 128) * coef;
300
+ g = 128 + (g - 128) * coef;
301
+ b = 128 + (b - 128) * coef;
302
+
303
+ changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));
304
+ updateLight(r, g, b);
305
+ }
306
+
307
+ function updateLight(r, g, b) {
308
+ var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;
309
+
310
+ for (i=0; i<detail; i++) {
311
+ if ((i>=0) && (i<partDetail)) {
312
+ finalCoef = i / partDetail;
313
+ finalR = dechex(255 - (255 - r) * finalCoef);
314
+ finalG = dechex(255 - (255 - g) * finalCoef);
315
+ finalB = dechex(255 - (255 - b) * finalCoef);
316
+ } else {
317
+ finalCoef = 2 - i / partDetail;
318
+ finalR = dechex(r * finalCoef);
319
+ finalG = dechex(g * finalCoef);
320
+ finalB = dechex(b * finalCoef);
321
+ }
322
+
323
+ color = finalR + finalG + finalB;
324
+
325
+ setCol('gs' + i, '#'+color);
326
+ }
327
+ }
328
+
329
+ function changeFinalColor(color) {
330
+ if (color.indexOf('#') == -1)
331
+ color = convertRGBToHex(color);
332
+
333
+ setCol('preview', color);
334
+ document.getElementById('color').value = color;
335
+ }
336
+
337
+ function setCol(e, c) {
338
+ try {
339
+ document.getElementById(e).style.backgroundColor = c;
340
+ } catch (ex) {
341
+ // Ignore IE warning
342
+ }
343
+ }
344
+
345
+ tinyMCEPopup.onInit.add(init);
js/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js CHANGED
@@ -1 +1 @@
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","invalid_color_value":"Invalid color value","":""});
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","invalid_color_value":"Invalid color value","":""});
js/tinymce/jscripts/tiny_mce/tiny_mce_popup.js CHANGED
@@ -1,5 +1,5 @@
1
-
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,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);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.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){b.dom.bind(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){var b=a.target||a.srcElement;if(b.onchange){b.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_eventProxy:function(a){return function(b){tinyMCEPopup.dom.events.callNativeHandler(a,b)}}};tinyMCEPopup.init();
1
+
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,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);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.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){b.dom.bind(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){var b=a.target||a.srcElement;if(b.onchange){b.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_eventProxy:function(a){return function(b){tinyMCEPopup.dom.events.callNativeHandler(a,b)}}};tinyMCEPopup.init();
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: ashokrane
3
  Tags: abandon cart, shopping cart abandonment
4
  Requires at least: 1.3
5
- Tested up to: 2.0.8
6
  Stable tag: trunk
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -46,9 +46,9 @@ Note: Some features are available in the PRO version only.
46
 
47
  **Email Sending Setup:**
48
 
49
- You need to schedule the following script present in the plugin folder so emails are sent out: "woocommerce-abandon-cart-lite/cron/send_email.php"
50
 
51
- **[Create Cron Jobs](http://wpdailybits.com/blog/replace-wordpress-cron-with-real-cron-job/74 "Create Cron Jobs")**
52
 
53
  == Installation ==
54
 
@@ -80,6 +80,14 @@ Please ensure you have followed the instructions in "Email Sending Setup" right
80
 
81
  == Changelog ==
82
 
 
 
 
 
 
 
 
 
83
  = 1.1 =
84
  * Compatibility with WooCommerce 2.x versions
85
  * Fixed 404 errors with images & other files
2
  Contributors: ashokrane
3
  Tags: abandon cart, shopping cart abandonment
4
  Requires at least: 1.3
5
+ Tested up to: 4.1.1
6
  Stable tag: trunk
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
46
 
47
  **Email Sending Setup:**
48
 
49
+ From version 1.3, it is not mandatory to set a cron job via CPanel for the abandoned cart email notifications to be sent. We are now using WP-Cron that sends the emails automatically whenever a page is requested.
50
 
51
+ Abandoned Cart Plugin relies on a function called WP-Cron, and this function only runs when there is a page requested. So, if there are no visits to your website, then the scheduled jobs are not run. Generally this method of sending the abandoned cart notification emails is reliable. However, if you are not very confident about the traffic volume of your website, then you can set a manual cron job via Cpanel or any other control panel that your host provides.
52
 
53
  == Installation ==
54
 
80
 
81
  == Changelog ==
82
 
83
+ = 1.3 =
84
+ * The abandoned cart email notifications are now sent out automatically without the necessity of having to set up a cron job manually.
85
+
86
+ = 1.2 =
87
+ * The test emails were not getting sent.
88
+ * Warnings fixed for some of the plugin setting pages.
89
+ * The image urls in the email were coming broken, this is fixed.
90
+
91
  = 1.1 =
92
  * Compatibility with WooCommerce 2.x versions
93
  * Fixed 404 errors with images & other files
woo-includes/class-wc-dependencies.php CHANGED
@@ -1,29 +1,29 @@
1
- <?php
2
- /**
3
- * WC Dependency Checker
4
- *
5
- * Checks if WooCommerce is enabled
6
- */
7
- class WC_Dependencies {
8
-
9
- private static $active_plugins;
10
-
11
- function init() {
12
-
13
- self::$active_plugins = (array) get_option( 'active_plugins', array() );
14
-
15
- if ( is_multisite() )
16
- self::$active_plugins = array_merge( self::$active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
17
- }
18
-
19
- function woocommerce_active_check() {
20
-
21
- if ( ! self::$active_plugins ) self::init();
22
-
23
- return in_array( 'woocommerce/woocommerce.php', self::$active_plugins ) || array_key_exists( 'woocommerce/woocommerce.php', self::$active_plugins );
24
-
25
- }
26
-
27
- }
28
-
29
-
1
+ <?php
2
+ /**
3
+ * WC Dependency Checker
4
+ *
5
+ * Checks if WooCommerce is enabled
6
+ */
7
+ class WC_Dependencies {
8
+
9
+ private static $active_plugins;
10
+
11
+ function init() {
12
+
13
+ self::$active_plugins = (array) get_option( 'active_plugins', array() );
14
+
15
+ if ( is_multisite() )
16
+ self::$active_plugins = array_merge( self::$active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
17
+ }
18
+
19
+ function woocommerce_active_check() {
20
+
21
+ if ( ! self::$active_plugins ) self::init();
22
+
23
+ return in_array( 'woocommerce/woocommerce.php', self::$active_plugins ) || array_key_exists( 'woocommerce/woocommerce.php', self::$active_plugins );
24
+
25
+ }
26
+
27
+ }
28
+
29
+
woo-includes/woo-functions.php CHANGED
@@ -1,97 +1,97 @@
1
- <?php
2
- /**
3
- * Functions used by plugins
4
- */
5
- if ( ! class_exists( 'WC_Dependencies' ) )
6
- require_once 'class-wc-dependencies.php';
7
-
8
- /**
9
- * WC Detection
10
- */
11
- if ( ! function_exists( 'is_woocommerce_active' ) ) {
12
- function is_woocommerce_active() {
13
- return WC_Dependencies::woocommerce_active_check();
14
- }
15
- }
16
-
17
- /**
18
- * Queue updates for the WooUpdater
19
- */
20
- if ( ! function_exists( 'woothemes_queue_update' ) ) {
21
- function woothemes_queue_update( $file, $file_id, $product_id ) {
22
- global $woothemes_queued_updates;
23
-
24
- if ( ! isset( $woothemes_queued_updates ) )
25
- $woothemes_queued_updates = array();
26
-
27
- $plugin = new stdClass();
28
- $plugin->file = $file;
29
- $plugin->file_id = $file_id;
30
- $plugin->product_id = $product_id;
31
-
32
- $woothemes_queued_updates[] = $plugin;
33
- }
34
- }
35
-
36
- /**
37
- * Load installer for the WooThemes Updater.
38
- * @return $api Object
39
- */
40
- if ( ! class_exists( 'WooThemes_Updater' ) && ! function_exists( 'woothemes_updater_install' ) ) {
41
- function woothemes_updater_install( $api, $action, $args ) {
42
- $download_url = 'http://woodojo.s3.amazonaws.com/downloads/woothemes-updater/woothemes-updater.zip';
43
-
44
- if ( 'plugin_information' != $action ||
45
- false !== $api ||
46
- ! isset( $args->slug ) ||
47
- 'woothemes-updater' != $args->slug
48
- ) return $api;
49
-
50
- $api = new stdClass();
51
- $api->name = 'WooThemes Updater';
52
- $api->version = '1.0.0';
53
- $api->download_link = esc_url( $download_url );
54
- return $api;
55
- }
56
-
57
- add_filter( 'plugins_api', 'woothemes_updater_install', 10, 3 );
58
- }
59
-
60
- /**
61
- * WooUpdater Installation Prompts
62
- */
63
- if ( ! class_exists( 'WooThemes_Updater' ) && ! function_exists( 'woothemes_updater_notice' ) ) {
64
-
65
- /**
66
- * Display a notice if the "WooThemes Updater" plugin hasn't been installed.
67
- * @return void
68
- */
69
- function woothemes_updater_notice() {
70
- $active_plugins = apply_filters( 'active_plugins', get_option('active_plugins' ) );
71
- if ( in_array( 'woothemes-updater/woothemes-updater.php', $active_plugins ) ) return;
72
-
73
- $slug = 'woothemes-updater';
74
- $install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $slug ), 'install-plugin_' . $slug );
75
- $activate_url = 'plugins.php?action=activate&plugin=' . urlencode( 'woothemes-updater/woothemes-updater.php' ) . '&plugin_status=all&paged=1&s&_wpnonce=' . urlencode( wp_create_nonce( 'activate-plugin_woothemes-updater/woothemes-updater.php' ) );
76
-
77
- $message = '<a href="' . esc_url( $install_url ) . '">Install the WooThemes Updater plugin</a> to get updates for your WooThemes plugins.';
78
- $is_downloaded = false;
79
- $plugins = array_keys( get_plugins() );
80
- foreach ( $plugins as $plugin ) {
81
- if ( strpos( $plugin, 'woothemes-updater.php' ) !== false ) {
82
- $is_downloaded = true;
83
- $message = '<a href="' . esc_url( admin_url( $activate_url ) ) . '">Activate the WooThemes Updater plugin</a> to get updates for your WooThemes plugins.';
84
- }
85
- }
86
- echo '<div class="updated fade"><p>' . $message . '</p></div>' . "\n";
87
- }
88
-
89
- add_action( 'admin_notices', 'woothemes_updater_notice' );
90
- }
91
-
92
- /**
93
- * Prevent conflicts with older versions
94
- */
95
- if ( ! class_exists( 'WooThemes_Plugin_Updater' ) ) {
96
- class WooThemes_Plugin_Updater { function init() {} }
97
  }
1
+ <?php
2
+ /**
3
+ * Functions used by plugins
4
+ */
5
+ if ( ! class_exists( 'WC_Dependencies' ) )
6
+ require_once 'class-wc-dependencies.php';
7
+
8
+ /**
9
+ * WC Detection
10
+ */
11
+ if ( ! function_exists( 'is_woocommerce_active' ) ) {
12
+ function is_woocommerce_active() {
13
+ return WC_Dependencies::woocommerce_active_check();
14
+ }
15
+ }
16
+
17
+ /**
18
+ * Queue updates for the WooUpdater
19
+ */
20
+ if ( ! function_exists( 'woothemes_queue_update' ) ) {
21
+ function woothemes_queue_update( $file, $file_id, $product_id ) {
22
+ global $woothemes_queued_updates;
23
+
24
+ if ( ! isset( $woothemes_queued_updates ) )
25
+ $woothemes_queued_updates = array();
26
+
27
+ $plugin = new stdClass();
28
+ $plugin->file = $file;
29
+ $plugin->file_id = $file_id;
30
+ $plugin->product_id = $product_id;
31
+
32
+ $woothemes_queued_updates[] = $plugin;
33
+ }
34
+ }
35
+
36
+ /**
37
+ * Load installer for the WooThemes Updater.
38
+ * @return $api Object
39
+ */
40
+ if ( ! class_exists( 'WooThemes_Updater' ) && ! function_exists( 'woothemes_updater_install' ) ) {
41
+ function woothemes_updater_install( $api, $action, $args ) {
42
+ $download_url = 'http://woodojo.s3.amazonaws.com/downloads/woothemes-updater/woothemes-updater.zip';
43
+
44
+ if ( 'plugin_information' != $action ||
45
+ false !== $api ||
46
+ ! isset( $args->slug ) ||
47
+ 'woothemes-updater' != $args->slug
48
+ ) return $api;
49
+
50
+ $api = new stdClass();
51
+ $api->name = 'WooThemes Updater';
52
+ $api->version = '1.0.0';
53
+ $api->download_link = esc_url( $download_url );
54
+ return $api;
55
+ }
56
+
57
+ add_filter( 'plugins_api', 'woothemes_updater_install', 10, 3 );
58
+ }
59
+
60
+ /**
61
+ * WooUpdater Installation Prompts
62
+ */
63
+ if ( ! class_exists( 'WooThemes_Updater' ) && ! function_exists( 'woothemes_updater_notice' ) ) {
64
+
65
+ /**
66
+ * Display a notice if the "WooThemes Updater" plugin hasn't been installed.
67
+ * @return void
68
+ */
69
+ function woothemes_updater_notice() {
70
+ $active_plugins = apply_filters( 'active_plugins', get_option('active_plugins' ) );
71
+ if ( in_array( 'woothemes-updater/woothemes-updater.php', $active_plugins ) ) return;
72
+
73
+ $slug = 'woothemes-updater';
74
+ $install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $slug ), 'install-plugin_' . $slug );
75
+ $activate_url = 'plugins.php?action=activate&plugin=' . urlencode( 'woothemes-updater/woothemes-updater.php' ) . '&plugin_status=all&paged=1&s&_wpnonce=' . urlencode( wp_create_nonce( 'activate-plugin_woothemes-updater/woothemes-updater.php' ) );
76
+
77
+ $message = '<a href="' . esc_url( $install_url ) . '">Install the WooThemes Updater plugin</a> to get updates for your WooThemes plugins.';
78
+ $is_downloaded = false;
79
+ $plugins = array_keys( get_plugins() );
80
+ foreach ( $plugins as $plugin ) {
81
+ if ( strpos( $plugin, 'woothemes-updater.php' ) !== false ) {
82
+ $is_downloaded = true;
83
+ $message = '<a href="' . esc_url( admin_url( $activate_url ) ) . '">Activate the WooThemes Updater plugin</a> to get updates for your WooThemes plugins.';
84
+ }
85
+ }
86
+ echo '<div class="updated fade"><p>' . $message . '</p></div>' . "\n";
87
+ }
88
+
89
+ add_action( 'admin_notices', 'woothemes_updater_notice' );
90
+ }
91
+
92
+ /**
93
+ * Prevent conflicts with older versions
94
+ */
95
+ if ( ! class_exists( 'WooThemes_Plugin_Updater' ) ) {
96
+ class WooThemes_Plugin_Updater { function init() {} }
97
  }
woocommerce-ac.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WooCommerce Abandon Cart Lite Plugin
4
  Plugin URI: http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro
5
  Description: This plugin captures abandoned carts by logged-in users & emails them about it. <strong><a href="http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro">Click here to get the PRO Version.</a></strong>
6
- Version: 1.1
7
  Author: Ashok Rane
8
  Author URI: http://www.tychesoftwares.com/
9
  */
@@ -12,20 +12,43 @@ Author URI: http://www.tychesoftwares.com/
12
  // Deletion Settings
13
  register_uninstall_hook( __FILE__, 'woocommerce_ac_delete');
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  function woocommerce_ac_delete(){
16
 
17
  global $wpdb;
18
- $table_name_ac_abandoned_cart_history = $wpdb->prefix . "ac_abandoned_cart_history";
19
  $sql_ac_abandoned_cart_history = "DROP TABLE " . $table_name_ac_abandoned_cart_history ;
20
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
21
  $wpdb->get_results($sql_ac_abandoned_cart_history);
22
 
23
- $table_name_ac_email_templates = $wpdb->prefix . "ac_email_templates";
24
  $sql_ac_email_templates = "DROP TABLE " . $table_name_ac_email_templates ;
25
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
26
  $wpdb->get_results($sql_ac_email_templates);
27
 
28
- $table_name_ac_sent_history = $wpdb->prefix . "ac_sent_history";
29
  $sql_ac_sent_history = "DROP TABLE " . $table_name_ac_sent_history ;
30
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
31
  $wpdb->get_results($sql_ac_sent_history);
@@ -103,13 +126,14 @@ function woocommerce_ac_delete(){
103
  add_filter('woocommerce_order_details_after_order_table', array(&$this, 'action_after_delivery_session'));
104
 
105
  add_action( 'admin_init', array(&$this, 'action_admin_init' ));
 
106
 
107
  add_action( 'admin_enqueue_scripts', array(&$this, 'my_enqueue_scripts_js' ));
108
  add_action( 'admin_enqueue_scripts', array(&$this, 'my_enqueue_scripts_css' ));
109
 
110
  if( is_admin() )
111
  {
112
- if ( $_GET['page'] == "woocommerce_ac_page")
113
  {
114
  add_action('admin_head', array(&$this, 'tinyMCE_ac'));
115
  }
@@ -134,7 +158,7 @@ function woocommerce_ac_delete(){
134
 
135
  global $wpdb;
136
 
137
- $table_name = $wpdb->prefix . "ac_email_templates";
138
 
139
  $sql = "CREATE TABLE IF NOT EXISTS $table_name (
140
  `id` int(11) NOT NULL AUTO_INCREMENT,
@@ -151,7 +175,7 @@ function woocommerce_ac_delete(){
151
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
152
  dbDelta($sql);
153
 
154
- $sent_table_name = $wpdb->prefix . "ac_sent_history";
155
 
156
  $sql_query = "CREATE TABLE IF NOT EXISTS $sent_table_name (
157
  `id` int(11) NOT NULL auto_increment,
@@ -165,7 +189,7 @@ function woocommerce_ac_delete(){
165
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
166
  dbDelta($sql_query);
167
 
168
- $ac_history_table_name = $wpdb->prefix . "ac_abandoned_cart_history";
169
 
170
  $history_query = "CREATE TABLE IF NOT EXISTS $ac_history_table_name (
171
  `id` int(11) NOT NULL AUTO_INCREMENT,
@@ -179,7 +203,35 @@ function woocommerce_ac_delete(){
179
 
180
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
181
  dbDelta($history_query);
 
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  }
184
 
185
  function woocommerce_ac_admin_menu(){
@@ -198,7 +250,7 @@ function woocommerce_ac_delete(){
198
  $cut_off_time = json_decode(get_option('woocommerce_ac_settings'));
199
  $cart_cut_off_time = $cut_off_time[0]->cart_time * 60;
200
  $compare_time = $current_time - $cart_cut_off_time;
201
- $query = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history`
202
  WHERE user_id = '".$user_id."'
203
  AND cart_ignored = '0'
204
  AND recovered_cart = '0'";
@@ -206,24 +258,27 @@ function woocommerce_ac_delete(){
206
  if ( count($results) == 0 )
207
  {
208
  $cart_info = json_encode(get_user_meta($user_id, '_woocommerce_persistent_cart', true));
209
- $insert_query = "INSERT INTO `".$wpdb->prefix."ac_abandoned_cart_history`
210
  (user_id, abandoned_cart_info, abandoned_cart_time, cart_ignored)
211
  VALUES ('".$user_id."', '".$cart_info."', '".$current_time."', '0')";
212
- mysql_query($insert_query);
 
213
  }
214
  elseif ( $compare_time > $results[0]->abandoned_cart_time )
215
  {
216
  $updated_cart_info = json_encode(get_user_meta($user_id, '_woocommerce_persistent_cart', true));
217
  if (! $this->compare_carts( $user_id, $results[0]->abandoned_cart_info) )
218
  {
219
- $query_ignored = "UPDATE `".$wpdb->prefix."ac_abandoned_cart_history`
220
  SET cart_ignored = '1'
221
  WHERE user_id='".$user_id."'";
222
- mysql_query($query_ignored);
223
- $query_update = "INSERT INTO `".$wpdb->prefix."ac_abandoned_cart_history`
 
224
  (user_id, abandoned_cart_info, abandoned_cart_time, cart_ignored)
225
  VALUES ('".$user_id."', '".$updated_cart_info."', '".$current_time."', '0')";
226
- mysql_query($query_update);
 
227
  update_user_meta($user_id, '_woocommerce_ac_modified_cart', md5("yes"));
228
  }
229
  else
@@ -234,11 +289,12 @@ function woocommerce_ac_delete(){
234
  else
235
  {
236
  $updated_cart_info = json_encode(get_user_meta($user_id, '_woocommerce_persistent_cart', true));
237
- $query_update = "UPDATE `".$wpdb->prefix."ac_abandoned_cart_history`
238
  SET abandoned_cart_info = '".$updated_cart_info."',
239
  abandoned_cart_time = '".$current_time."'
240
  WHERE user_id='".$user_id."' AND cart_ignored='0' ";
241
- mysql_query($query_update);
 
242
  }
243
  }
244
  }
@@ -267,9 +323,12 @@ function woocommerce_ac_delete(){
267
  $current_cart_variation_id = $item_value['variation_id'];
268
  $current_cart_quantity = $item_value['quantity'];
269
 
270
- $abandoned_cart_product_id = $abandoned_cart_arr[$key][$item_key]['product_id'];
271
- $abandoned_cart_variation_id = $abandoned_cart_arr[$key][$item_key]['variation_id'];
272
- $abandoned_cart_quantity = $abandoned_cart_arr[$key][$item_key]['quantity'];
 
 
 
273
 
274
  if (($current_cart_product_id != $abandoned_cart_product_id) ||
275
  ($current_cart_variation_id != $abandoned_cart_variation_id) ||
@@ -290,7 +349,7 @@ function woocommerce_ac_delete(){
290
  delete_user_meta($user_id, '_woocommerce_ac_persistent_cart_temp_time');
291
 
292
  // get all latest abandoned carts that were modified
293
- $query = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history`
294
  WHERE user_id = '".$user_id."'
295
  AND cart_ignored = '0'
296
  AND recovered_cart = '0'
@@ -303,19 +362,21 @@ function woocommerce_ac_delete(){
303
  {
304
 
305
  $order_id = $order->id;
306
- $query_order = "UPDATE `".$wpdb->prefix."ac_abandoned_cart_history`
307
  SET recovered_cart= '".$order_id."',
308
  cart_ignored = '1'
309
  WHERE id='".$results[0]->id."' ";
310
- mysql_query($query_order);
 
311
  delete_user_meta($user_id, '_woocommerce_ac_modified_cart');
312
  }
313
  else
314
  {
315
- $delete_query = "DELETE FROM `".$wpdb->prefix."ac_abandoned_cart_history`
316
  WHERE
317
  id='".$results[0]->id."' ";
318
- mysql_query( $delete_query );
 
319
  }
320
 
321
 
@@ -345,7 +406,8 @@ function woocommerce_ac_delete(){
345
 
346
  function display_tabs() {
347
 
348
- $action = $_GET['action'];
 
349
 
350
  $active_listcart = "";
351
  $active_emailtemplates = "";
@@ -397,6 +459,13 @@ function woocommerce_ac_delete(){
397
  {
398
 
399
  wp_enqueue_script( 'jquery' );
 
 
 
 
 
 
 
400
  wp_enqueue_script( 'jquery-ui-datepicker' );
401
 
402
  //wp_enqueue_script('suggest');
@@ -528,10 +597,12 @@ function woocommerce_ac_delete(){
528
  <h2><?php _e( 'WooCommerce - Abandon Cart Lite', 'woocommerce-ac' ); ?></h2>
529
  <?php
530
 
531
- $action = $_GET['action'];
532
-
533
- $mode = $_GET['mode'];
534
 
 
 
 
535
  $this->display_tabs();
536
 
537
  if ($action == 'emailsettings')
@@ -607,17 +678,23 @@ function woocommerce_ac_delete(){
607
  include_once( "pagination.class.php");
608
 
609
  /* Find the number of rows returned from a query; Note: Do NOT use a LIMIT clause in this query */
610
- $count = mysql_num_rows(mysql_query("SELECT wpac . * , wpu.user_login, wpu.user_email
611
- FROM `".$wpdb->prefix."ac_abandoned_cart_history` AS wpac
612
- LEFT JOIN ".$wpdb->prefix."users AS wpu ON wpac.user_id = wpu.id
613
- WHERE recovered_cart='0' "));
 
 
614
 
615
  if($count > 0) {
616
  $p = new pagination;
617
  $p->items($count);
618
  $p->limit(10); // Limit entries per page
619
  $p->target("admin.php?page=woocommerce_ac_page&action=listcart");
620
- $p->currentPage($_GET[$p->paging]); // Gets and validates the current page
 
 
 
 
621
  $p->calculate(); // Calculates what to show
622
  $p->parameterName('paging');
623
  $p->adjacents(1); //No. of page away from the current page
@@ -632,7 +709,8 @@ function woocommerce_ac_delete(){
632
  //Query for limit paging
633
  $limit = "LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
634
 
635
- }
 
636
 
637
  ?>
638
 
@@ -645,7 +723,9 @@ function woocommerce_ac_delete(){
645
  <?php
646
 
647
  $order = "";
 
648
  $order = $_GET['order'];
 
649
  if ( $order == "" )
650
  {
651
  $order = "desc";
@@ -661,15 +741,17 @@ function woocommerce_ac_delete(){
661
  }
662
 
663
  $order_by = "";
 
664
  $order_by = $_GET['orderby'];
 
665
  if ( $order_by == "" )
666
  {
667
  $order_by = "abandoned_cart_time";
668
  }
669
  /* Now we use the LIMIT clause to grab a range of rows */
670
  $query = "SELECT wpac . * , wpu.user_login, wpu.user_email
671
- FROM `".$wpdb->prefix."ac_abandoned_cart_history` AS wpac
672
- LEFT JOIN ".$wpdb->prefix."users AS wpu ON wpac.user_id = wpu.id
673
  WHERE recovered_cart='0'
674
  ORDER BY `$order_by` $order
675
  $limit";
@@ -792,43 +874,46 @@ function woocommerce_ac_delete(){
792
  $active_post = 1;
793
  if ( $active_post == 1 )
794
  {
795
- $check_query = "SELECT * FROM `".$wpdb->prefix."ac_email_templates`
796
- WHERE is_active='1' AND frequency='".$_POST[email_frequency]."' AND day_or_hour='".$_POST[day_or_hour]."' ";
797
  $check_results = $wpdb->get_results($check_query);
798
  if (count($check_results) == 0 )
799
  {
800
- $query = "INSERT INTO `".$wpdb->prefix."ac_email_templates`
801
  (subject, body, is_active, frequency, day_or_hour, template_name, from_name)
802
- VALUES ('".$_POST[woocommerce_ac_email_subject]."',
803
- '".$_POST[woocommerce_ac_email_body]."',
804
  '".$active_post."',
805
- '".$_POST[email_frequency]."',
806
- '".$_POST[day_or_hour]."',
807
- '".$_POST[woocommerce_ac_template_name]."',
808
- '".$_POST[woocommerce_ac_from_name]."' )";
809
  //echo $query;
810
- mysql_query($query);
 
811
  }
812
  else
813
  {
814
- $query_update = "UPDATE `".$wpdb->prefix."ac_email_templates`
815
  SET
816
  is_active='0'
817
- WHERE frequency='".$_POST[email_frequency]."' AND day_or_hour='".$_POST[day_or_hour]."' ";
818
  //echo $query_update;
819
- mysql_query($query_update);
 
820
 
821
- $query_insert_new = "INSERT INTO `".$wpdb->prefix."ac_email_templates`
822
  ( subject, body, is_active, frequency, day_or_hour, template_name, from_name)
823
- VALUES ('".$_POST[woocommerce_ac_email_subject]."',
824
- '".$_POST[woocommerce_ac_email_body]."',
825
  '".$active_post."',
826
- '".$_POST[email_frequency]."',
827
- '".$_POST[day_or_hour]."',
828
- '".$_POST[woocommerce_ac_template_name]."',
829
- '".$_POST[woocommerce_ac_from_name]."' )";
830
  //echo $query;
831
- mysql_query($query_insert_new);
 
832
  }
833
  }
834
  }
@@ -839,40 +924,43 @@ function woocommerce_ac_delete(){
839
  $active = 1;
840
  if ( $active == 1 )
841
  {
842
- $check_query = "SELECT * FROM `".$wpdb->prefix."ac_email_templates`
843
- WHERE is_active='1' AND frequency='".$_POST[email_frequency]."' AND day_or_hour='".$_POST[day_or_hour]."' ";
844
  $check_results = $wpdb->get_results($check_query);
845
  if (count($check_results) == 0 )
846
  {
847
- $query_update = "UPDATE `".$wpdb->prefix."ac_email_templates`
848
  SET
849
- subject='".$_POST[woocommerce_ac_email_subject]."',
850
- body='".$_POST[woocommerce_ac_email_body]."',
851
- is_active='".$active."', frequency='".$_POST[email_frequency]."',
852
- day_or_hour='".$_POST[day_or_hour]."',
853
- template_name='".$_POST[woocommerce_ac_template_name]."',
854
- from_name='".$_POST[woocommerce_ac_from_name]."'
855
- WHERE id='".$_POST[id]."' ";
856
- mysql_query($query_update);
 
857
  }
858
  else
859
  {
860
- $query_update_new = "UPDATE `".$wpdb->prefix."ac_email_templates`
861
  SET
862
  is_active='0'
863
- WHERE frequency='".$_POST[email_frequency]."' AND day_or_hour='".$_POST[day_or_hour]."' ";
864
- mysql_query($query_update_new);
 
865
 
866
- $query_update_latest = "UPDATE `".$wpdb->prefix."ac_email_templates`
867
  SET
868
- subject='".$_POST[woocommerce_ac_email_subject]."',
869
- body='".$_POST[woocommerce_ac_email_body]."',
870
- is_active='".$active."', frequency='".$_POST[email_frequency]."',
871
- day_or_hour='".$_POST[day_or_hour]."',
872
- template_name='".$_POST[woocommerce_ac_template_name]."',
873
- from_name='".$_POST[woocommerce_ac_from_name]."'
874
- WHERE id='".$_POST[id]."' ";
875
- mysql_query($query_update_latest);
 
876
  }
877
  }
878
  }
@@ -880,8 +968,9 @@ function woocommerce_ac_delete(){
880
  if ( $action == 'emailtemplates' && $mode == 'removetemplate' )
881
  {
882
  $id_remove = $_GET['id'];
883
- $query_remove = "DELETE FROM `".$wpdb->prefix."ac_email_templates` WHERE id='".$id_remove."' ";
884
- mysql_query($query_remove);
 
885
  }
886
 
887
  if ( isset( $_POST['ac_settings_frm'] ) && $_POST['ac_settings_frm'] == 'save' ) { ?>
@@ -901,16 +990,21 @@ function woocommerce_ac_delete(){
901
  include_once( "pagination.class.php");
902
 
903
  /* Find the number of rows returned from a query; Note: Do NOT use a LIMIT clause in this query */
904
- $count = mysql_num_rows(mysql_query("SELECT wpet . *
905
- FROM `".$wpdb->prefix."ac_email_templates` AS wpet
906
- "));
 
 
907
 
908
  if($count > 0) {
909
  $p = new pagination;
910
  $p->items($count);
911
  $p->limit(10); // Limit entries per page
912
  $p->target("admin.php?page=woocommerce_ac_page&action=emailtemplates");
913
- $p->currentPage($_GET[$p->paging]); // Gets and validates the current page
 
 
 
914
  $p->calculate(); // Calculates what to show
915
  $p->parameterName('paging');
916
  $p->adjacents(1); //No. of page away from the current page
@@ -926,6 +1020,7 @@ function woocommerce_ac_delete(){
926
  $limit = "LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
927
 
928
  }
 
929
 
930
  ?>
931
 
@@ -937,7 +1032,7 @@ function woocommerce_ac_delete(){
937
  <?php
938
 
939
  $order = "";
940
- $order = $_GET['order'];
941
  if ( $order == "" )
942
  {
943
  $order = "asc";
@@ -953,14 +1048,14 @@ function woocommerce_ac_delete(){
953
  }
954
 
955
  $order_by = "";
956
- $order_by = $_GET['orderby'];
957
  if ( $order_by == "" )
958
  {
959
  $order_by = "frequency";
960
  }
961
 
962
  $query = "SELECT wpet . *
963
- FROM `".$wpdb->prefix."ac_email_templates` AS wpet
964
  ORDER BY $order_by $order
965
  $limit";
966
  $results = $wpdb->get_results( $query );
@@ -988,7 +1083,8 @@ function woocommerce_ac_delete(){
988
  </tr>
989
 
990
  <?php
991
- $add_var = ($_GET['pageno'] - 1) * $limit;
 
992
  $i = 1 + $add_var;
993
  foreach ($results as $key => $value)
994
  {
@@ -1092,10 +1188,11 @@ function woocommerce_ac_delete(){
1092
  </script>
1093
  <?php
1094
 
1095
- $duration_range = $_POST['duration_select'];
 
1096
  if ($duration_range == "")
1097
  {
1098
- $duration_range = $_GET['duration_select'];
1099
  }
1100
  if ($duration_range == "") $duration_range = "last_seven";
1101
  //global $this->duration_range_select,$this->start_end_dates;
@@ -1140,12 +1237,14 @@ function woocommerce_ac_delete(){
1140
 
1141
  <?php
1142
 
1143
- $start_date_range = $_POST['start_date'];
 
1144
  if ($start_date_range == "")
1145
  {
1146
  $start_date_range = $date_sett['start_date'];
1147
  }
1148
- $end_date_range = $_POST['end_date'];
 
1149
  if ($end_date_range == "")
1150
  {
1151
  $end_date_range = $date_sett['end_date'];
@@ -1172,18 +1271,28 @@ function woocommerce_ac_delete(){
1172
  include_once( "pagination.class.php");
1173
 
1174
  /* Find the number of rows returned from a query; Note: Do NOT use a LIMIT clause in this query */
1175
- $count = mysql_num_rows(mysql_query("SELECT * FROM " . $wpdb->prefix . "ac_abandoned_cart_history
1176
- WHERE abandoned_cart_time >= " . $start_date . "
1177
- AND abandoned_cart_time <= " . $end_date . "
 
 
 
 
 
1178
  AND recovered_cart > '0'
1179
- "));
 
1180
 
1181
  if($count > 0) {
1182
  $p = new pagination;
1183
  $p->items($count);
1184
  $p->limit(10); // Limit entries per page
1185
  $p->target("admin.php?page=woocommerce_ac_page&action=stats&duration_select=$duration_range");
1186
- $p->currentPage($_GET[$p->paging]); // Gets and validates the current page
 
 
 
 
1187
  $p->calculate(); // Calculates what to show
1188
  $p->parameterName('paging');
1189
  $p->adjacents(1); //No. of page away from the current page
@@ -1199,7 +1308,8 @@ function woocommerce_ac_delete(){
1199
  $limit = "LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
1200
 
1201
  }
1202
-
 
1203
  ?>
1204
 
1205
  <div class="tablenav">
@@ -1211,7 +1321,7 @@ function woocommerce_ac_delete(){
1211
  <?php
1212
 
1213
  $order = "";
1214
- $order = $_GET['order'];
1215
  if ( $order == "" )
1216
  {
1217
  $order = "desc";
@@ -1227,20 +1337,20 @@ function woocommerce_ac_delete(){
1227
  }
1228
 
1229
  $order_by = "";
1230
- $order_by = $_GET['orderby'];
1231
  if ( $order_by == "" )
1232
  {
1233
  $order_by = "recovered_cart";
1234
  }
1235
 
1236
- $query_ac = "SELECT * FROM " . $wpdb->prefix . "ac_abandoned_cart_history
1237
  WHERE abandoned_cart_time >= " . $start_date . "
1238
  AND abandoned_cart_time <= " . $end_date . "
1239
  AND recovered_cart > 0
1240
  ORDER BY $order_by $order $limit";
1241
  $ac_results = $wpdb->get_results( $query_ac );
1242
 
1243
- $query_ac_carts = "SELECT * FROM " . $wpdb->prefix . "ac_abandoned_cart_history
1244
  WHERE abandoned_cart_time >= " . $start_date . "
1245
  AND abandoned_cart_time <= " . $end_date;
1246
  $ac_carts_results = $wpdb->get_results( $query_ac_carts );
@@ -1265,7 +1375,7 @@ function woocommerce_ac_delete(){
1265
  $total_value += $line_total;
1266
  }
1267
  }
1268
-
1269
  foreach ( $ac_results as $key => $value)
1270
  {
1271
  if( $value->recovered_cart != 0 )
@@ -1286,12 +1396,27 @@ function woocommerce_ac_delete(){
1286
  $abandoned_date = date('d M, Y h:i A', $value->abandoned_cart_time);
1287
 
1288
  $abandoned_order_id = $value->id;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1289
 
1290
  $table_data .="<tr>
1291
- <td>Name: ".$rec_order['_billing_first_name'][0]." ".$rec_order['_billing_last_name'][0]."</br><a href='mailto:'".$rec_order->_billing_email."'>".$rec_order['_billing_email'][0]."</td>
1292
  <td>".$abandoned_date."</td>
1293
  <td>".$recovered_date_new."</td>
1294
- <td>".get_woocommerce_currency_symbol()." ".$rec_order['_order_total'][0]."</td>
1295
  <td> <a href=\"post.php?post=". $recovered_id."&action=edit\">View Details</td>";
1296
  }
1297
  }
@@ -1326,15 +1451,15 @@ function woocommerce_ac_delete(){
1326
  print('</table>');
1327
  }
1328
 
1329
- $action = $_GET['action'];
1330
- $mode = $_GET['mode'];
1331
 
1332
  if ( $action == 'emailtemplates' && ($mode == 'addnewtemplate' || $mode == 'edittemplate' ))
1333
  {
1334
  if($mode=='edittemplate')
1335
  {
1336
  $edit_id=$_GET['id'];
1337
- $query="SELECT wpet . * FROM `".$wpdb->prefix."ac_email_templates` AS wpet WHERE id='".$edit_id."'";
1338
  $results = $wpdb->get_results( $query );
1339
  }
1340
 
@@ -1593,7 +1718,7 @@ function woocommerce_ac_delete(){
1593
  $user_id = $_POST['user_id'];
1594
  $action = $_POST['action'];
1595
 
1596
- $query = "DELETE FROM `".$wpdb->prefix."ac_abandoned_cart_history`
1597
  WHERE
1598
  id = '$abandoned_order_id' ";
1599
  //echo $query;
@@ -1651,8 +1776,12 @@ function woocommerce_ac_delete(){
1651
  $to_email_preview = $_POST['send_email_id'];
1652
 
1653
  $user_email_from = get_option('admin_email');
1654
- $headers[] = "From: ".$from_email_name." <".$user_email_from.">";
1655
- $headers[] = "Content-Type: text/html";
 
 
 
 
1656
 
1657
  wp_mail( $to_email_preview, $subject_email_preview, stripslashes($body_email_preview), $headers );
1658
 
3
  Plugin Name: WooCommerce Abandon Cart Lite Plugin
4
  Plugin URI: http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro
5
  Description: This plugin captures abandoned carts by logged-in users & emails them about it. <strong><a href="http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro">Click here to get the PRO Version.</a></strong>
6
+ Version: 1.4
7
  Author: Ashok Rane
8
  Author URI: http://www.tychesoftwares.com/
9
  */
12
  // Deletion Settings
13
  register_uninstall_hook( __FILE__, 'woocommerce_ac_delete');
14
 
15
+ // Add a new interval of 5 minutes
16
+ add_filter( 'cron_schedules', 'woocommerce_ac_add_cron_schedule' );
17
+
18
+ function woocommerce_ac_add_cron_schedule( $schedules ) {
19
+
20
+ $schedules['5_minutes'] = array(
21
+ 'interval' => 300 , // 5 minutes in seconds
22
+ 'display' => __( 'Once Every Five Minutes' ),
23
+ );
24
+ return $schedules;
25
+ }
26
+
27
+ // Schedule an action if it's not already scheduled
28
+ if ( ! wp_next_scheduled( 'woocommerce_ac_send_email_action' ) ) {
29
+ wp_schedule_event( time(), '5_minutes', 'woocommerce_ac_send_email_action' );
30
+ }
31
+
32
+ // Hook into that action that'll fire every 5 minutes
33
+ add_action( 'woocommerce_ac_send_email_action', 'woocommerce_ac_send_email_cron' );
34
+ function woocommerce_ac_send_email_cron() {
35
+ require_once( ABSPATH.'wp-content/plugins/woocommerce-abandoned-cart/cron/send_email.php' );
36
+ }
37
+
38
  function woocommerce_ac_delete(){
39
 
40
  global $wpdb;
41
+ $table_name_ac_abandoned_cart_history = $wpdb->base_prefix . "ac_abandoned_cart_history_lite";
42
  $sql_ac_abandoned_cart_history = "DROP TABLE " . $table_name_ac_abandoned_cart_history ;
43
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
44
  $wpdb->get_results($sql_ac_abandoned_cart_history);
45
 
46
+ $table_name_ac_email_templates = $wpdb->base_prefix . "ac_email_templates_lite";
47
  $sql_ac_email_templates = "DROP TABLE " . $table_name_ac_email_templates ;
48
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
49
  $wpdb->get_results($sql_ac_email_templates);
50
 
51
+ $table_name_ac_sent_history = $wpdb->base_prefix . "ac_sent_history_lite";
52
  $sql_ac_sent_history = "DROP TABLE " . $table_name_ac_sent_history ;
53
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
54
  $wpdb->get_results($sql_ac_sent_history);
126
  add_filter('woocommerce_order_details_after_order_table', array(&$this, 'action_after_delivery_session'));
127
 
128
  add_action( 'admin_init', array(&$this, 'action_admin_init' ));
129
+ add_action( 'admin_init', array(&$this, 'ac_lite_update_db_check' ));
130
 
131
  add_action( 'admin_enqueue_scripts', array(&$this, 'my_enqueue_scripts_js' ));
132
  add_action( 'admin_enqueue_scripts', array(&$this, 'my_enqueue_scripts_css' ));
133
 
134
  if( is_admin() )
135
  {
136
+ if (isset($_GET['page']) && $_GET['page'] == "woocommerce_ac_page")
137
  {
138
  add_action('admin_head', array(&$this, 'tinyMCE_ac'));
139
  }
158
 
159
  global $wpdb;
160
 
161
+ $table_name = $wpdb->base_prefix . "ac_email_templates_lite";
162
 
163
  $sql = "CREATE TABLE IF NOT EXISTS $table_name (
164
  `id` int(11) NOT NULL AUTO_INCREMENT,
175
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
176
  dbDelta($sql);
177
 
178
+ $sent_table_name = $wpdb->base_prefix . "ac_sent_history_lite";
179
 
180
  $sql_query = "CREATE TABLE IF NOT EXISTS $sent_table_name (
181
  `id` int(11) NOT NULL auto_increment,
189
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
190
  dbDelta($sql_query);
191
 
192
+ $ac_history_table_name = $wpdb->base_prefix . "ac_abandoned_cart_history_lite";
193
 
194
  $history_query = "CREATE TABLE IF NOT EXISTS $ac_history_table_name (
195
  `id` int(11) NOT NULL AUTO_INCREMENT,
203
 
204
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
205
  dbDelta($history_query);
206
+ }
207
 
208
+ function ac_lite_update_db_check() {
209
+ global $wpdb;
210
+ if( get_option('ac_lite_alter_table_queries') != 'yes') {
211
+
212
+ $old_table_name = $wpdb->base_prefix . "ac_email_templates";
213
+ $table_name = $wpdb->base_prefix . "ac_email_templates_lite";
214
+
215
+ $alter_ac_email_table_query = "ALTER TABLE $old_table_name
216
+ RENAME TO $table_name";
217
+ $wpdb->get_results ( $alter_ac_email_table_query );
218
+
219
+ $old_sent_table_name = $wpdb->base_prefix . "ac_sent_history";
220
+ $sent_table_name = $wpdb->base_prefix . "ac_sent_history_lite";
221
+
222
+ $alter_ac_sent_history_table_query = "ALTER TABLE $old_sent_table_name
223
+ RENAME TO $sent_table_name";
224
+ $wpdb->get_results ( $alter_ac_sent_history_table_query );
225
+
226
+ $old_ac_history_table_name = $wpdb->base_prefix . "ac_abandoned_cart_history";
227
+ $ac_history_table_name = $wpdb->base_prefix . "ac_abandoned_cart_history_lite";
228
+
229
+ $alter_ac_abandoned_cart_history_table_query = "ALTER TABLE $old_ac_history_table_name
230
+ RENAME TO $ac_history_table_name";
231
+ $wpdb->get_results ( $alter_ac_abandoned_cart_history_table_query );
232
+
233
+ update_option('ac_lite_alter_table_queries','yes');
234
+ }
235
  }
236
 
237
  function woocommerce_ac_admin_menu(){
250
  $cut_off_time = json_decode(get_option('woocommerce_ac_settings'));
251
  $cart_cut_off_time = $cut_off_time[0]->cart_time * 60;
252
  $compare_time = $current_time - $cart_cut_off_time;
253
+ $query = "SELECT * FROM `".$wpdb->base_prefix."ac_abandoned_cart_history_lite`
254
  WHERE user_id = '".$user_id."'
255
  AND cart_ignored = '0'
256
  AND recovered_cart = '0'";
258
  if ( count($results) == 0 )
259
  {
260
  $cart_info = json_encode(get_user_meta($user_id, '_woocommerce_persistent_cart', true));
261
+ $insert_query = "INSERT INTO `".$wpdb->base_prefix."ac_abandoned_cart_history_lite`
262
  (user_id, abandoned_cart_info, abandoned_cart_time, cart_ignored)
263
  VALUES ('".$user_id."', '".$cart_info."', '".$current_time."', '0')";
264
+ //mysql_query($insert_query);
265
+ $wpdb->query($insert_query);
266
  }
267
  elseif ( $compare_time > $results[0]->abandoned_cart_time )
268
  {
269
  $updated_cart_info = json_encode(get_user_meta($user_id, '_woocommerce_persistent_cart', true));
270
  if (! $this->compare_carts( $user_id, $results[0]->abandoned_cart_info) )
271
  {
272
+ $query_ignored = "UPDATE `".$wpdb->base_prefix."ac_abandoned_cart_history_lite`
273
  SET cart_ignored = '1'
274
  WHERE user_id='".$user_id."'";
275
+ //mysql_query($query_ignored);
276
+ $wpdb->query($query_ignored);
277
+ $query_update = "INSERT INTO `".$wpdb->base_prefix."ac_abandoned_cart_history_lite`
278
  (user_id, abandoned_cart_info, abandoned_cart_time, cart_ignored)
279
  VALUES ('".$user_id."', '".$updated_cart_info."', '".$current_time."', '0')";
280
+ //mysql_query($query_update);
281
+ $wpdb->query($query_update);
282
  update_user_meta($user_id, '_woocommerce_ac_modified_cart', md5("yes"));
283
  }
284
  else
289
  else
290
  {
291
  $updated_cart_info = json_encode(get_user_meta($user_id, '_woocommerce_persistent_cart', true));
292
+ $query_update = "UPDATE `".$wpdb->base_prefix."ac_abandoned_cart_history_lite`
293
  SET abandoned_cart_info = '".$updated_cart_info."',
294
  abandoned_cart_time = '".$current_time."'
295
  WHERE user_id='".$user_id."' AND cart_ignored='0' ";
296
+ //mysql_query($query_update);
297
+ $wpdb->query($query_update);
298
  }
299
  }
300
  }
323
  $current_cart_variation_id = $item_value['variation_id'];
324
  $current_cart_quantity = $item_value['quantity'];
325
 
326
+ if (isset($abandoned_cart_arr[$key][$item_key]['product_id'])) $abandoned_cart_product_id = $abandoned_cart_arr[$key][$item_key]['product_id'];
327
+ else $abandoned_cart_product_id = "";
328
+ if (isset($abandoned_cart_arr[$key][$item_key]['variation_id'])) $abandoned_cart_variation_id = $abandoned_cart_arr[$key][$item_key]['variation_id'];
329
+ else $abandoned_cart_variation_id = "";
330
+ if (isset($abandoned_cart_arr[$key][$item_key]['quantity'])) $abandoned_cart_quantity = $abandoned_cart_arr[$key][$item_key]['quantity'];
331
+ else $abandoned_cart_quantity = "";
332
 
333
  if (($current_cart_product_id != $abandoned_cart_product_id) ||
334
  ($current_cart_variation_id != $abandoned_cart_variation_id) ||
349
  delete_user_meta($user_id, '_woocommerce_ac_persistent_cart_temp_time');
350
 
351
  // get all latest abandoned carts that were modified
352
+ $query = "SELECT * FROM `".$wpdb->base_prefix."ac_abandoned_cart_history_lite`
353
  WHERE user_id = '".$user_id."'
354
  AND cart_ignored = '0'
355
  AND recovered_cart = '0'
362
  {
363
 
364
  $order_id = $order->id;
365
+ $query_order = "UPDATE `".$wpdb->base_prefix."ac_abandoned_cart_history_lite`
366
  SET recovered_cart= '".$order_id."',
367
  cart_ignored = '1'
368
  WHERE id='".$results[0]->id."' ";
369
+ //mysql_query($query_order);
370
+ $wpdb->query($query_order);
371
  delete_user_meta($user_id, '_woocommerce_ac_modified_cart');
372
  }
373
  else
374
  {
375
+ $delete_query = "DELETE FROM `".$wpdb->base_prefix."ac_abandoned_cart_history_lite`
376
  WHERE
377
  id='".$results[0]->id."' ";
378
+ //mysql_query( $delete_query );
379
+ $wpdb->query( $delete_query );
380
  }
381
 
382
 
406
 
407
  function display_tabs() {
408
 
409
+ if (isset($_GET['action'])) $action = $_GET['action'];
410
+ else $action = "";
411
 
412
  $active_listcart = "";
413
  $active_emailtemplates = "";
459
  {
460
 
461
  wp_enqueue_script( 'jquery' );
462
+ wp_enqueue_script(
463
+ 'jquery-ui-min',
464
+ '//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js',
465
+ '',
466
+ '',
467
+ false
468
+ );
469
  wp_enqueue_script( 'jquery-ui-datepicker' );
470
 
471
  //wp_enqueue_script('suggest');
597
  <h2><?php _e( 'WooCommerce - Abandon Cart Lite', 'woocommerce-ac' ); ?></h2>
598
  <?php
599
 
600
+ if (isset($_GET['action'])) $action = $_GET['action'];
601
+ else $action = "";
 
602
 
603
+ if (isset($_GET['mode'])) $mode = $_GET['mode'];
604
+ else $mode = "";
605
+
606
  $this->display_tabs();
607
 
608
  if ($action == 'emailsettings')
678
  include_once( "pagination.class.php");
679
 
680
  /* Find the number of rows returned from a query; Note: Do NOT use a LIMIT clause in this query */
681
+ $wpdb->get_results("SELECT wpac . * , wpu.user_login, wpu.user_email
682
+ FROM `".$wpdb->base_prefix."ac_abandoned_cart_history_lite` AS wpac
683
+ LEFT JOIN ".$wpdb->base_prefix."users AS wpu ON wpac.user_id = wpu.id
684
+ WHERE recovered_cart='0' ");
685
+
686
+ $count = $wpdb->num_rows;
687
 
688
  if($count > 0) {
689
  $p = new pagination;
690
  $p->items($count);
691
  $p->limit(10); // Limit entries per page
692
  $p->target("admin.php?page=woocommerce_ac_page&action=listcart");
693
+ //$p->currentPage($_GET[$p->paging]); // Gets and validates the current page
694
+ if (isset($p->paging))
695
+ {
696
+ if (isset($_GET[$p->paging])) $p->currentPage($_GET[$p->paging]); // Gets and validates the current page
697
+ }
698
  $p->calculate(); // Calculates what to show
699
  $p->parameterName('paging');
700
  $p->adjacents(1); //No. of page away from the current page
709
  //Query for limit paging
710
  $limit = "LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
711
 
712
+ }
713
+ else $limit = "";
714
 
715
  ?>
716
 
723
  <?php
724
 
725
  $order = "";
726
+ if(isset($_GET['order'])){
727
  $order = $_GET['order'];
728
+ }
729
  if ( $order == "" )
730
  {
731
  $order = "desc";
741
  }
742
 
743
  $order_by = "";
744
+ if(isset($_GET['orderby'])){
745
  $order_by = $_GET['orderby'];
746
+ }
747
  if ( $order_by == "" )
748
  {
749
  $order_by = "abandoned_cart_time";
750
  }
751
  /* Now we use the LIMIT clause to grab a range of rows */
752
  $query = "SELECT wpac . * , wpu.user_login, wpu.user_email
753
+ FROM `".$wpdb->base_prefix."ac_abandoned_cart_history_lite` AS wpac
754
+ LEFT JOIN ".$wpdb->base_prefix."users AS wpu ON wpac.user_id = wpu.id
755
  WHERE recovered_cart='0'
756
  ORDER BY `$order_by` $order
757
  $limit";
874
  $active_post = 1;
875
  if ( $active_post == 1 )
876
  {
877
+ $check_query = "SELECT * FROM `".$wpdb->base_prefix."ac_email_templates_lite`
878
+ WHERE is_active='1' AND frequency='".$_POST['email_frequency']."' AND day_or_hour='".$_POST['day_or_hour']."' ";
879
  $check_results = $wpdb->get_results($check_query);
880
  if (count($check_results) == 0 )
881
  {
882
+ $query = "INSERT INTO `".$wpdb->base_prefix."ac_email_templates_lite`
883
  (subject, body, is_active, frequency, day_or_hour, template_name, from_name)
884
+ VALUES ('".$_POST['woocommerce_ac_email_subject']."',
885
+ '".$_POST['woocommerce_ac_email_body']."',
886
  '".$active_post."',
887
+ '".$_POST['email_frequency']."',
888
+ '".$_POST['day_or_hour']."',
889
+ '".$_POST['woocommerce_ac_template_name']."',
890
+ '".$_POST['woocommerce_ac_from_name']."' )";
891
  //echo $query;
892
+ //mysql_query($query);
893
+ $wpdb->query($query);
894
  }
895
  else
896
  {
897
+ $query_update = "UPDATE `".$wpdb->base_prefix."ac_email_templates_lite`
898
  SET
899
  is_active='0'
900
+ WHERE frequency='".$_POST['email_frequency']."' AND day_or_hour='".$_POST['day_or_hour']."' ";
901
  //echo $query_update;
902
+ //mysql_query($query_update);
903
+ $wpdb->query($query_update);
904
 
905
+ $query_insert_new = "INSERT INTO `".$wpdb->base_prefix."ac_email_templates_lite`
906
  ( subject, body, is_active, frequency, day_or_hour, template_name, from_name)
907
+ VALUES ('".$_POST['woocommerce_ac_email_subject']."',
908
+ '".$_POST['woocommerce_ac_email_body']."',
909
  '".$active_post."',
910
+ '".$_POST['email_frequency']."',
911
+ '".$_POST['day_or_hour']."',
912
+ '".$_POST['woocommerce_ac_template_name']."',
913
+ '".$_POST['woocommerce_ac_from_name']."' )";
914
  //echo $query;
915
+ //mysql_query($query_insert_new);
916
+ $wpdb->query($query_insert_new);
917
  }
918
  }
919
  }
924
  $active = 1;
925
  if ( $active == 1 )
926
  {
927
+ $check_query = "SELECT * FROM `".$wpdb->base_prefix."ac_email_templates_lite`
928
+ WHERE is_active='1' AND frequency='".$_POST['email_frequency']."' AND day_or_hour='".$_POST['day_or_hour']."' ";
929
  $check_results = $wpdb->get_results($check_query);
930
  if (count($check_results) == 0 )
931
  {
932
+ $query_update = "UPDATE `".$wpdb->base_prefix."ac_email_templates_lite`
933
  SET
934
+ subject='".$_POST['woocommerce_ac_email_subject']."',
935
+ body='".$_POST['woocommerce_ac_email_body']."',
936
+ is_active='".$active."', frequency='".$_POST['email_frequency']."',
937
+ day_or_hour='".$_POST['day_or_hour']."',
938
+ template_name='".$_POST['woocommerce_ac_template_name']."',
939
+ from_name='".$_POST['woocommerce_ac_from_name']."'
940
+ WHERE id='".$_POST['id']."' ";
941
+ //mysql_query($query_update);
942
+ $wpdb->query($query_update);
943
  }
944
  else
945
  {
946
+ $query_update_new = "UPDATE `".$wpdb->base_prefix."ac_email_templates_lite`
947
  SET
948
  is_active='0'
949
+ WHERE frequency='".$_POST['email_frequency']."' AND day_or_hour='".$_POST['day_or_hour']."' ";
950
+ //mysql_query($query_update_new);
951
+ $wpdb->query($query_update_new);
952
 
953
+ $query_update_latest = "UPDATE `".$wpdb->base_prefix."ac_email_templates_lite`
954
  SET
955
+ subject='".$_POST['woocommerce_ac_email_subject']."',
956
+ body='".$_POST['woocommerce_ac_email_body']."',
957
+ is_active='".$active."', frequency='".$_POST['email_frequency']."',
958
+ day_or_hour='".$_POST['day_or_hour']."',
959
+ template_name='".$_POST['woocommerce_ac_template_name']."',
960
+ from_name='".$_POST['woocommerce_ac_from_name']."'
961
+ WHERE id='".$_POST['id']."' ";
962
+ //mysql_query($query_update_latest);
963
+ $wpdb->query($query_update_latest);
964
  }
965
  }
966
  }
968
  if ( $action == 'emailtemplates' && $mode == 'removetemplate' )
969
  {
970
  $id_remove = $_GET['id'];
971
+ $query_remove = "DELETE FROM `".$wpdb->base_prefix."ac_email_templates_lite` WHERE id='".$id_remove."' ";
972
+ //mysql_mysql_query($query_remove);
973
+ $wpdb->query($query_remove);
974
  }
975
 
976
  if ( isset( $_POST['ac_settings_frm'] ) && $_POST['ac_settings_frm'] == 'save' ) { ?>
990
  include_once( "pagination.class.php");
991
 
992
  /* Find the number of rows returned from a query; Note: Do NOT use a LIMIT clause in this query */
993
+ $wpdb->get_results("SELECT wpet . *
994
+ FROM `".$wpdb->base_prefix."ac_email_templates_lite` AS wpet
995
+ ");
996
+
997
+ $count = $wpdb->num_rows;
998
 
999
  if($count > 0) {
1000
  $p = new pagination;
1001
  $p->items($count);
1002
  $p->limit(10); // Limit entries per page
1003
  $p->target("admin.php?page=woocommerce_ac_page&action=emailtemplates");
1004
+ if (isset($p->paging))
1005
+ {
1006
+ if (isset($_GET[$p->paging])) $p->currentPage($_GET[$p->paging]); // Gets and validates the current page
1007
+ }
1008
  $p->calculate(); // Calculates what to show
1009
  $p->parameterName('paging');
1010
  $p->adjacents(1); //No. of page away from the current page
1020
  $limit = "LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
1021
 
1022
  }
1023
+ else $limit = "";
1024
 
1025
  ?>
1026
 
1032
  <?php
1033
 
1034
  $order = "";
1035
+ if (isset($_GET['order'])) $order = $_GET['order'];
1036
  if ( $order == "" )
1037
  {
1038
  $order = "asc";
1048
  }
1049
 
1050
  $order_by = "";
1051
+ if (isset($_GET['orderby'])) $order_by = $_GET['orderby'];
1052
  if ( $order_by == "" )
1053
  {
1054
  $order_by = "frequency";
1055
  }
1056
 
1057
  $query = "SELECT wpet . *
1058
+ FROM `".$wpdb->base_prefix."ac_email_templates_lite` AS wpet
1059
  ORDER BY $order_by $order
1060
  $limit";
1061
  $results = $wpdb->get_results( $query );
1083
  </tr>
1084
 
1085
  <?php
1086
+ if (isset($_GET['pageno'])) $add_var = ($_GET['pageno'] - 1) * $limit;
1087
+ else $add_var = "";
1088
  $i = 1 + $add_var;
1089
  foreach ($results as $key => $value)
1090
  {
1188
  </script>
1189
  <?php
1190
 
1191
+ if (isset($_POST['duration_select'])) $duration_range = $_POST['duration_select'];
1192
+ else $duration_range = "";
1193
  if ($duration_range == "")
1194
  {
1195
+ if (isset($_GET['duration_select'])) $duration_range = $_GET['duration_select'];
1196
  }
1197
  if ($duration_range == "") $duration_range = "last_seven";
1198
  //global $this->duration_range_select,$this->start_end_dates;
1237
 
1238
  <?php
1239
 
1240
+ if (isset($_POST['start_date'])) $start_date_range = $_POST['start_date'];
1241
+ else $start_date_range = "";
1242
  if ($start_date_range == "")
1243
  {
1244
  $start_date_range = $date_sett['start_date'];
1245
  }
1246
+ if (isset($_POST['end_date'])) $end_date_range = $_POST['end_date'];
1247
+ else $end_date_range = "";
1248
  if ($end_date_range == "")
1249
  {
1250
  $end_date_range = $date_sett['end_date'];
1271
  include_once( "pagination.class.php");
1272
 
1273
  /* Find the number of rows returned from a query; Note: Do NOT use a LIMIT clause in this query */
1274
+ // $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->base_prefix . "ac_abandoned_cart_history_lite
1275
+ // WHERE abandoned_cart_time >= " . $start_date . "
1276
+ // AND abandoned_cart_time <= " . $end_date . "
1277
+ // AND recovered_cart > '0'
1278
+ // "));
1279
+ $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->base_prefix . "ac_abandoned_cart_history_lite
1280
+ WHERE abandoned_cart_time >= %d
1281
+ AND abandoned_cart_time <= %d
1282
  AND recovered_cart > '0'
1283
+ ",$start_date,$end_date));
1284
+ $count = $wpdb->num_rows;
1285
 
1286
  if($count > 0) {
1287
  $p = new pagination;
1288
  $p->items($count);
1289
  $p->limit(10); // Limit entries per page
1290
  $p->target("admin.php?page=woocommerce_ac_page&action=stats&duration_select=$duration_range");
1291
+ //$p->currentPage($_GET[$p->paging]); // Gets and validates the current page
1292
+ if (isset($p->paging))
1293
+ {
1294
+ if (isset($_GET[$p->paging])) $p->currentPage($_GET[$p->paging]); // Gets and validates the current page
1295
+ }
1296
  $p->calculate(); // Calculates what to show
1297
  $p->parameterName('paging');
1298
  $p->adjacents(1); //No. of page away from the current page
1308
  $limit = "LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
1309
 
1310
  }
1311
+ else
1312
+ $limit = "";
1313
  ?>
1314
 
1315
  <div class="tablenav">
1321
  <?php
1322
 
1323
  $order = "";
1324
+ if (isset($_GET['order'])) $order = $_GET['order'];
1325
  if ( $order == "" )
1326
  {
1327
  $order = "desc";
1337
  }
1338
 
1339
  $order_by = "";
1340
+ if (isset($_GET['orderby'])) $order_by = $_GET['orderby'];
1341
  if ( $order_by == "" )
1342
  {
1343
  $order_by = "recovered_cart";
1344
  }
1345
 
1346
+ $query_ac = "SELECT * FROM " . $wpdb->base_prefix . "ac_abandoned_cart_history_lite
1347
  WHERE abandoned_cart_time >= " . $start_date . "
1348
  AND abandoned_cart_time <= " . $end_date . "
1349
  AND recovered_cart > 0
1350
  ORDER BY $order_by $order $limit";
1351
  $ac_results = $wpdb->get_results( $query_ac );
1352
 
1353
+ $query_ac_carts = "SELECT * FROM " . $wpdb->base_prefix . "ac_abandoned_cart_history_lite
1354
  WHERE abandoned_cart_time >= " . $start_date . "
1355
  AND abandoned_cart_time <= " . $end_date;
1356
  $ac_carts_results = $wpdb->get_results( $query_ac_carts );
1375
  $total_value += $line_total;
1376
  }
1377
  }
1378
+ $table_data = "";
1379
  foreach ( $ac_results as $key => $value)
1380
  {
1381
  if( $value->recovered_cart != 0 )
1396
  $abandoned_date = date('d M, Y h:i A', $value->abandoned_cart_time);
1397
 
1398
  $abandoned_order_id = $value->id;
1399
+
1400
+ $billing_first_name = $billing_last_name = $billing_email = '';
1401
+ $recovered_order_total = 0;
1402
+ if (isset($rec_order['_billing_first_name'][0])) {
1403
+ $billing_first_name = $rec_order['_billing_first_name'][0];
1404
+ }
1405
+ if (isset($rec_order['_billing_last_name'][0])) {
1406
+ $billing_last_name = $rec_order['_billing_last_name'][0];
1407
+ }
1408
+ if (isset($rec_order['_billing_email'][0])) {
1409
+ $billing_email = $rec_order['_billing_email'][0];
1410
+ }
1411
+ if (isset($rec_order['_order_total'][0])) {
1412
+ $recovered_order_total = $rec_order['_order_total'][0];
1413
+ }
1414
 
1415
  $table_data .="<tr>
1416
+ <td>Name: ".$billing_first_name." ".$billing_last_name."</br><a href='mailto:'".$billing_email."'>".$billing_email."</td>
1417
  <td>".$abandoned_date."</td>
1418
  <td>".$recovered_date_new."</td>
1419
+ <td>".get_woocommerce_currency_symbol()." ".$recovered_order_total."</td>
1420
  <td> <a href=\"post.php?post=". $recovered_id."&action=edit\">View Details</td>";
1421
  }
1422
  }
1451
  print('</table>');
1452
  }
1453
 
1454
+ if (isset($_GET['action'])) $action = $_GET['action'];
1455
+ if (isset($_GET['mode'])) $mode = $_GET['mode'];
1456
 
1457
  if ( $action == 'emailtemplates' && ($mode == 'addnewtemplate' || $mode == 'edittemplate' ))
1458
  {
1459
  if($mode=='edittemplate')
1460
  {
1461
  $edit_id=$_GET['id'];
1462
+ $query="SELECT wpet . * FROM `".$wpdb->base_prefix."ac_email_templates_lite` AS wpet WHERE id='".$edit_id."'";
1463
  $results = $wpdb->get_results( $query );
1464
  }
1465
 
1718
  $user_id = $_POST['user_id'];
1719
  $action = $_POST['action'];
1720
 
1721
+ $query = "DELETE FROM `".$wpdb->base_prefix."ac_abandoned_cart_history_lite`
1722
  WHERE
1723
  id = '$abandoned_order_id' ";
1724
  //echo $query;
1776
  $to_email_preview = $_POST['send_email_id'];
1777
 
1778
  $user_email_from = get_option('admin_email');
1779
+ $headers[] = "From: ".$from_email_name." <".$user_email_from.">"."\r\n";
1780
+ $headers[] = "Content-Type: text/html"."\r\n";
1781
+
1782
+ // $headers = "From: ".$from_email_name." <".$from_email_preview.">"."\r\n";
1783
+ // $headers .= "Content-Type: text/html"."\r\n";
1784
+ // $headers .= "Reply-To: <".$reply_name_preview.">"."\r\n";
1785
 
1786
  wp_mail( $to_email_preview, $subject_email_preview, stripslashes($body_email_preview), $headers );
1787