Version Description
- Applied fix for warning displayed on the abandoned orders page.
Download this release
Release Info
Developer | ashokrane |
Plugin | Abandoned Cart Lite for WooCommerce |
Version | 2.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.8 to 2.0.1
- cron/send_email.php +82 -89
- js/jquery.tipTip.minified.js +20 -20
- js/tinymce/changelog.txt +477 -477
- js/tinymce/examples/accessibility.html +10 -10
- js/tinymce/jscripts/tiny_mce/plugins/autolink/editor_plugin_src.js +184 -184
- js/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js +119 -119
- js/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js +1 -1
- js/tinymce/jscripts/tiny_mce/plugins/example_dependency/editor_plugin_src.js +50 -50
- js/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +90 -90
- js/tinymce/jscripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +2 -2
- js/tinymce/jscripts/tiny_mce/plugins/lists/editor_plugin_src.js +955 -955
- js/tinymce/jscripts/tiny_mce/plugins/media/langs/en_dlg.js +1 -1
- js/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js +52 -52
- js/tinymce/jscripts/tiny_mce/plugins/style/langs/en_dlg.js +1 -1
- js/tinymce/jscripts/tiny_mce/plugins/style/props.htm +845 -845
- js/tinymce/jscripts/tiny_mce/plugins/style/readme.txt +19 -19
- js/tinymce/jscripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js +122 -122
- js/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js +1456 -1456
- js/tinymce/jscripts/tiny_mce/plugins/table/js/table.js +3 -3
- js/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js +345 -345
- js/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js +1 -1
- js/tinymce/jscripts/tiny_mce/tiny_mce_popup.js +4 -4
- languages/messages.pot +268 -268
- languages/woocommerce-ac-he_IL.mo +0 -0
- languages/woocommerce-ac-he_IL.po +281 -0
- languages/woocommerce-ac.po +269 -269
- readme.txt +50 -16
- woo-includes/class-wc-dependencies.php +29 -29
- woo-includes/woo-functions.php +96 -96
- woocommerce-ac.php +873 -858
cron/send_email.php
CHANGED
@@ -3,11 +3,10 @@
|
|
3 |
require_once( ABSPATH . 'wp-load.php' );
|
4 |
//if (is_woocommerce_active())
|
5 |
{
|
6 |
-
|
7 |
/**
|
8 |
* woocommerce_abandon_cart_cron class
|
9 |
**/
|
10 |
-
if (!class_exists('woocommerce_abandon_cart_cron')) {
|
11 |
|
12 |
class woocommerce_abandon_cart_cron {
|
13 |
|
@@ -16,10 +15,9 @@ require_once( ABSPATH . 'wp-load.php' );
|
|
16 |
|
17 |
public function __construct() {
|
18 |
|
19 |
-
$this->cart_settings_cron = json_decode(get_option('woocommerce_ac_settings'));
|
20 |
-
|
21 |
-
$this->cart_abandon_cut_off_time_cron = ($this->cart_settings_cron[0]->cart_time) * 60;
|
22 |
|
|
|
23 |
}
|
24 |
|
25 |
/*-----------------------------------------------------------------------------------*/
|
@@ -31,76 +29,73 @@ require_once( ABSPATH . 'wp-load.php' );
|
|
31 |
*/
|
32 |
function woocommerce_ac_send_email() {
|
33 |
|
34 |
-
|
35 |
-
{
|
36 |
-
|
37 |
global $wpdb, $woocommerce;
|
38 |
|
39 |
//Grab the cart abandoned cut-off time from database.
|
40 |
-
$cart_settings = json_decode(get_option('woocommerce_ac_settings'));
|
41 |
-
|
42 |
-
$cart_abandon_cut_off_time = ($cart_settings[0]->cart_time) * 60;
|
43 |
|
44 |
//Fetch all active templates present in the system
|
45 |
$query = "SELECT wpet . *
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
$results = $wpdb->get_results( $query );
|
50 |
|
51 |
-
$hour_seconds = 3600;
|
52 |
-
$day_seconds
|
53 |
-
foreach ($results as $key => $value)
|
54 |
{
|
55 |
-
if ($value->day_or_hour == 'Days')
|
56 |
{
|
57 |
$time_to_send_template_after = $value->frequency * $day_seconds;
|
58 |
}
|
59 |
-
elseif ($value->day_or_hour == 'Hours')
|
60 |
{
|
61 |
$time_to_send_template_after = $value->frequency * $hour_seconds;
|
62 |
}
|
63 |
|
64 |
-
$carts = $this->get_carts($time_to_send_template_after, $cart_abandon_cut_off_time);
|
65 |
-
|
66 |
-
$email_frequency = $value->frequency;
|
67 |
-
$email_body_template = $value->body;
|
68 |
|
69 |
-
$
|
70 |
-
$
|
71 |
-
$
|
72 |
-
$
|
73 |
-
$
|
|
|
|
|
74 |
|
75 |
-
foreach ($carts as $key => $value )
|
76 |
{
|
77 |
-
$cart_info_db_field = json_decode($value->abandoned_cart_info);
|
78 |
-
if (count($cart_info_db_field->cart) > 0 )
|
79 |
{
|
80 |
$cart_update_time = $value->abandoned_cart_time;
|
81 |
|
82 |
-
$new_user = $this->check_sent_history($value->user_id, $cart_update_time, $template_id, $value->id );
|
83 |
-
if ( $new_user == true)
|
84 |
{
|
85 |
$cart_info_db = $value->abandoned_cart_info;
|
86 |
|
87 |
$email_body = $email_body_template;
|
88 |
|
89 |
-
$email_body = str_replace("{{customer.firstname}}", get_user_meta($value->user_id, 'first_name', true), $email_body);
|
90 |
-
$email_body = str_replace("{{customer.lastname}}", get_user_meta($value->user_id, 'last_name', true), $email_body);
|
91 |
-
$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);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
-
$query_sent = "INSERT INTO `".$wpdb->prefix."ac_sent_history_lite` (template_id, abandoned_order_id, sent_time, sent_email_id)
|
94 |
-
VALUES ('".$template_id."', '".$value->id."', '".current_time('mysql')."', '".$value->user_email."' )";
|
95 |
-
|
96 |
-
$wpdb->query($query_sent);
|
97 |
-
|
98 |
-
$query_id = "SELECT * FROM `".$wpdb->prefix."ac_sent_history_lite` WHERE template_id='".$template_id."' AND abandoned_order_id='".$value->id."'
|
99 |
-
ORDER BY id DESC
|
100 |
-
LIMIT 1 ";
|
101 |
-
|
102 |
-
$results_sent = $wpdb->get_results( $query_id );
|
103 |
-
|
104 |
$email_sent_id = $results_sent[0]->id;
|
105 |
|
106 |
$var = '';
|
@@ -120,11 +115,11 @@ require_once( ABSPATH . 'wp-load.php' );
|
|
120 |
$sub_line_prod_name = '';
|
121 |
foreach ( $cart_details as $k => $v ) {
|
122 |
$quantity_total = $v->quantity;
|
123 |
-
$product_id
|
124 |
-
$prod_name
|
125 |
$product_link_track = get_permalink( $product_id );
|
126 |
$product_name = $prod_name->post_title;
|
127 |
-
if ($sub_line_prod_name == '') {
|
128 |
$sub_line_prod_name = $product_name;
|
129 |
}
|
130 |
// Item subtotal is calculated as product total including taxes
|
@@ -135,16 +130,16 @@ require_once( ABSPATH . 'wp-load.php' );
|
|
135 |
}
|
136 |
|
137 |
// Line total
|
138 |
-
$item_total
|
139 |
-
$item_subtotal
|
140 |
$item_total_display = number_format( $item_total, 2 );
|
141 |
-
$item_subtotal
|
142 |
-
$product
|
143 |
-
$prod_image
|
144 |
-
$image_url
|
145 |
$var .='<tr align="center">
|
146 |
<td> <a href="'.$product_link_track.'"> <img src="' . $image_url . '" alt="" height="42" width="42" /> </a></td>
|
147 |
-
<td> <a href="'.$product_link_track.'">'.__($product_name, "woocommerce-ac").'</a></td>
|
148 |
<td> '.$quantity_total.'</td>
|
149 |
<td> '.get_woocommerce_currency_symbol()."".$item_subtotal.'</td>
|
150 |
<td> '.get_woocommerce_currency_symbol()."".$item_total_display.'</td>
|
@@ -162,71 +157,69 @@ require_once( ABSPATH . 'wp-load.php' );
|
|
162 |
</tr>';
|
163 |
$var .= '</table>
|
164 |
';
|
165 |
-
$email_body
|
166 |
$email_subject = str_replace( "{{product.name}}", __( $sub_line_prod_name, "woocommerce-ac" ), $email_subject );
|
167 |
}
|
168 |
|
169 |
$user_email = $value->user_email;
|
170 |
|
171 |
-
|
172 |
-
$email_body_final = stripslashes($email_body);
|
173 |
wp_mail( $user_email, $email_subject, __( $email_body_final, 'woocommerce-ac' ), $headers );
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
}
|
178 |
|
179 |
}
|
180 |
}
|
181 |
|
182 |
}
|
183 |
-
|
184 |
}
|
185 |
|
186 |
/**
|
187 |
* get all carts which have the creation time earlier than the one that is passed
|
188 |
*
|
189 |
*/
|
190 |
-
function get_carts($template_to_send_after_time, $cart_abandon_cut_off_time) {
|
191 |
|
192 |
global $wpdb;
|
193 |
|
194 |
-
$cart_time = current_time('timestamp') - $template_to_send_after_time - $cart_abandon_cut_off_time;
|
195 |
-
|
|
|
196 |
$query = "SELECT wpac . * , wpu.user_login, wpu.user_email
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
$results = $wpdb->get_results( $query );
|
204 |
-
|
205 |
return $results;
|
206 |
|
207 |
exit;
|
208 |
}
|
209 |
|
210 |
-
function check_sent_history($user_id, $cart_update_time, $template_id, $id) {
|
211 |
|
212 |
global $wpdb;
|
|
|
213 |
$query = "SELECT wpcs . * , wpac . abandoned_cart_time , wpac . user_id
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
$results = $wpdb->get_results( $query );
|
224 |
-
|
225 |
-
if (count($results) == 0)
|
226 |
{
|
227 |
return true;
|
228 |
}
|
229 |
-
elseif ($results[0]->abandoned_cart_time < $cart_update_time)
|
230 |
{
|
231 |
return true;
|
232 |
}
|
3 |
require_once( ABSPATH . 'wp-load.php' );
|
4 |
//if (is_woocommerce_active())
|
5 |
{
|
|
|
6 |
/**
|
7 |
* woocommerce_abandon_cart_cron class
|
8 |
**/
|
9 |
+
if ( !class_exists( 'woocommerce_abandon_cart_cron' ) ) {
|
10 |
|
11 |
class woocommerce_abandon_cart_cron {
|
12 |
|
15 |
|
16 |
public function __construct() {
|
17 |
|
18 |
+
$this->cart_settings_cron = json_decode( get_option( 'woocommerce_ac_settings' ) );
|
|
|
|
|
19 |
|
20 |
+
$this->cart_abandon_cut_off_time_cron = ( $this->cart_settings_cron[0]->cart_time ) * 60;
|
21 |
}
|
22 |
|
23 |
/*-----------------------------------------------------------------------------------*/
|
29 |
*/
|
30 |
function woocommerce_ac_send_email() {
|
31 |
|
|
|
|
|
|
|
32 |
global $wpdb, $woocommerce;
|
33 |
|
34 |
//Grab the cart abandoned cut-off time from database.
|
35 |
+
$cart_settings = json_decode( get_option( 'woocommerce_ac_settings' ) );
|
36 |
+
|
37 |
+
$cart_abandon_cut_off_time = ( $cart_settings[0]->cart_time ) * 60;
|
38 |
|
39 |
//Fetch all active templates present in the system
|
40 |
$query = "SELECT wpet . *
|
41 |
+
FROM `".$wpdb->prefix."ac_email_templates_lite` AS wpet
|
42 |
+
WHERE wpet.is_active = '1'
|
43 |
+
ORDER BY `day_or_hour` DESC, `frequency` ASC ";
|
44 |
$results = $wpdb->get_results( $query );
|
45 |
|
46 |
+
$hour_seconds = 3600; // 60 * 60
|
47 |
+
$day_seconds = 86400; // 24 * 60 * 60
|
48 |
+
foreach ( $results as $key => $value )
|
49 |
{
|
50 |
+
if ( $value->day_or_hour == 'Days' )
|
51 |
{
|
52 |
$time_to_send_template_after = $value->frequency * $day_seconds;
|
53 |
}
|
54 |
+
elseif ( $value->day_or_hour == 'Hours' )
|
55 |
{
|
56 |
$time_to_send_template_after = $value->frequency * $hour_seconds;
|
57 |
}
|
58 |
|
59 |
+
$carts = $this->get_carts( $time_to_send_template_after, $cart_abandon_cut_off_time );
|
|
|
|
|
|
|
60 |
|
61 |
+
$email_frequency = $value->frequency;
|
62 |
+
$email_body_template = $value->body;
|
63 |
+
$email_subject = $value->subject;
|
64 |
+
$user_email_from = get_option( 'admin_email' );
|
65 |
+
$headers[] = "From: ".$value->from_name." <".$user_email_from.">"."\r\n";
|
66 |
+
$headers[] = "Content-Type: text/html"."\r\n";
|
67 |
+
$template_id = $value->id;
|
68 |
|
69 |
+
foreach ( $carts as $key => $value )
|
70 |
{
|
71 |
+
$cart_info_db_field = json_decode( $value->abandoned_cart_info );
|
72 |
+
if ( count( $cart_info_db_field->cart ) > 0 )
|
73 |
{
|
74 |
$cart_update_time = $value->abandoned_cart_time;
|
75 |
|
76 |
+
$new_user = $this->check_sent_history( $value->user_id, $cart_update_time, $template_id, $value->id );
|
77 |
+
if ( $new_user == true )
|
78 |
{
|
79 |
$cart_info_db = $value->abandoned_cart_info;
|
80 |
|
81 |
$email_body = $email_body_template;
|
82 |
|
83 |
+
$email_body = str_replace( "{{customer.firstname}}", get_user_meta( $value->user_id, 'first_name', true ), $email_body );
|
84 |
+
$email_body = str_replace( "{{customer.lastname}}", get_user_meta( $value->user_id, 'last_name', true ), $email_body );
|
85 |
+
$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 );
|
86 |
+
$query_sent = "INSERT INTO `".$wpdb->prefix."ac_sent_history_lite` ( template_id, abandoned_order_id, sent_time, sent_email_id )
|
87 |
+
VALUES ( %s, %s, '".current_time( 'mysql' )."', %s )";
|
88 |
+
|
89 |
+
$wpdb->query( $wpdb->prepare( $query_sent, $template_id, $value->id, $value->user_email ) );
|
90 |
+
|
91 |
+
$query_id = "SELECT * FROM `".$wpdb->prefix."ac_sent_history_lite`
|
92 |
+
WHERE template_id = %s AND abandoned_order_id = %s
|
93 |
+
ORDER BY id DESC
|
94 |
+
LIMIT 1 ";
|
95 |
+
|
96 |
+
$results_sent = $wpdb->get_results( $wpdb->prepare( $query_id, $template_id, $value->id ) );
|
97 |
+
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
$email_sent_id = $results_sent[0]->id;
|
100 |
|
101 |
$var = '';
|
115 |
$sub_line_prod_name = '';
|
116 |
foreach ( $cart_details as $k => $v ) {
|
117 |
$quantity_total = $v->quantity;
|
118 |
+
$product_id = $v->product_id;
|
119 |
+
$prod_name = get_post( $product_id );
|
120 |
$product_link_track = get_permalink( $product_id );
|
121 |
$product_name = $prod_name->post_title;
|
122 |
+
if ( $sub_line_prod_name == '' ) {
|
123 |
$sub_line_prod_name = $product_name;
|
124 |
}
|
125 |
// Item subtotal is calculated as product total including taxes
|
130 |
}
|
131 |
|
132 |
// Line total
|
133 |
+
$item_total = $item_subtotal;
|
134 |
+
$item_subtotal = $item_subtotal / $quantity_total;
|
135 |
$item_total_display = number_format( $item_total, 2 );
|
136 |
+
$item_subtotal = number_format( $item_subtotal, 2 );
|
137 |
+
$product = get_product( $product_id );
|
138 |
+
$prod_image = $product->get_image();
|
139 |
+
$image_url = wp_get_attachment_url( get_post_thumbnail_id( $product_id ) );
|
140 |
$var .='<tr align="center">
|
141 |
<td> <a href="'.$product_link_track.'"> <img src="' . $image_url . '" alt="" height="42" width="42" /> </a></td>
|
142 |
+
<td> <a href="'.$product_link_track.'">'.__( $product_name, "woocommerce-ac" ).'</a></td>
|
143 |
<td> '.$quantity_total.'</td>
|
144 |
<td> '.get_woocommerce_currency_symbol()."".$item_subtotal.'</td>
|
145 |
<td> '.get_woocommerce_currency_symbol()."".$item_total_display.'</td>
|
157 |
</tr>';
|
158 |
$var .= '</table>
|
159 |
';
|
160 |
+
$email_body = str_replace( "{{products.cart}}", $var, $email_body );
|
161 |
$email_subject = str_replace( "{{product.name}}", __( $sub_line_prod_name, "woocommerce-ac" ), $email_subject );
|
162 |
}
|
163 |
|
164 |
$user_email = $value->user_email;
|
165 |
|
166 |
+
$email_body_final = stripslashes( $email_body );
|
|
|
167 |
wp_mail( $user_email, $email_subject, __( $email_body_final, 'woocommerce-ac' ), $headers );
|
168 |
+
|
|
|
|
|
169 |
}
|
170 |
|
171 |
}
|
172 |
}
|
173 |
|
174 |
}
|
175 |
+
|
176 |
}
|
177 |
|
178 |
/**
|
179 |
* get all carts which have the creation time earlier than the one that is passed
|
180 |
*
|
181 |
*/
|
182 |
+
function get_carts( $template_to_send_after_time, $cart_abandon_cut_off_time ) {
|
183 |
|
184 |
global $wpdb;
|
185 |
|
186 |
+
$cart_time = current_time( 'timestamp' ) - $template_to_send_after_time - $cart_abandon_cut_off_time;
|
187 |
+
|
188 |
+
$cart_ignored = 0;
|
189 |
$query = "SELECT wpac . * , wpu.user_login, wpu.user_email
|
190 |
+
FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` AS wpac
|
191 |
+
LEFT JOIN ".$wpdb->base_prefix."users AS wpu ON wpac.user_id = wpu.id
|
192 |
+
WHERE cart_ignored = %s
|
193 |
+
AND abandoned_cart_time < $cart_time
|
194 |
+
ORDER BY `id` ASC ";
|
195 |
+
|
196 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, $cart_ignored ) );
|
197 |
+
|
198 |
return $results;
|
199 |
|
200 |
exit;
|
201 |
}
|
202 |
|
203 |
+
function check_sent_history( $user_id, $cart_update_time, $template_id, $id ) {
|
204 |
|
205 |
global $wpdb;
|
206 |
+
|
207 |
$query = "SELECT wpcs . * , wpac . abandoned_cart_time , wpac . user_id
|
208 |
+
FROM `".$wpdb->prefix."ac_sent_history_lite` AS wpcs
|
209 |
+
LEFT JOIN ".$wpdb->prefix."ac_abandoned_cart_history_lite AS wpac ON wpcs.abandoned_order_id = wpac.id
|
210 |
+
WHERE
|
211 |
+
template_id = %s
|
212 |
+
AND
|
213 |
+
wpcs.abandoned_order_id = %d
|
214 |
+
ORDER BY 'id' DESC
|
215 |
+
LIMIT 1 ";
|
216 |
+
|
217 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, $template_id, $id ) );
|
218 |
+
if ( count( $results ) == 0 )
|
|
|
219 |
{
|
220 |
return true;
|
221 |
}
|
222 |
+
elseif ( $results[0]->abandoned_cart_time < $cart_update_time )
|
223 |
{
|
224 |
return true;
|
225 |
}
|
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, , 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, , 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 < > 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(" ")); // 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 < > 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(" ")); // 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> </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> </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"> </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"> </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"> </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> </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> </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> </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> </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> </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> </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> <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> </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> <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> </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> </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> </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> </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> </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> </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> </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> </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> </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> </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"> </td>
|
475 |
-
<td class="tdelim delim"> </td>
|
476 |
-
<td class="tdelim">{#style_dlg.style}</td>
|
477 |
-
<td class="tdelim delim"> </td>
|
478 |
-
<td class="tdelim">{#style_dlg.width}</td>
|
479 |
-
<td class="tdelim delim"> </td>
|
480 |
-
<td class="tdelim">{#style_dlg.color}</td>
|
481 |
-
</tr>
|
482 |
-
|
483 |
-
<tr>
|
484 |
-
<td> </td>
|
485 |
-
<td class="delim"> </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"> </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"> </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"> </td>
|
496 |
-
<td><select id="border_style_top" name="border_style_top" class="mceEditableSelect"></select></td>
|
497 |
-
<td class="delim"> </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> </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"> </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"> </td>
|
516 |
-
</tr>
|
517 |
-
</table>
|
518 |
-
</td>
|
519 |
-
</tr>
|
520 |
-
|
521 |
-
<tr>
|
522 |
-
<td>{#style_dlg.right}</td>
|
523 |
-
<td class="delim"> </td>
|
524 |
-
<td><select id="border_style_right" name="border_style_right" class="mceEditableSelect" disabled="disabled"></select></td>
|
525 |
-
<td class="delim"> </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> </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"> </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"> </td>
|
544 |
-
</tr>
|
545 |
-
</table>
|
546 |
-
</td>
|
547 |
-
</tr>
|
548 |
-
|
549 |
-
<tr>
|
550 |
-
<td>{#style_dlg.bottom}</td>
|
551 |
-
<td class="delim"> </td>
|
552 |
-
<td><select id="border_style_bottom" name="border_style_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
|
553 |
-
<td class="delim"> </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> </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"> </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"> </td>
|
572 |
-
</tr>
|
573 |
-
</table>
|
574 |
-
</td>
|
575 |
-
</tr>
|
576 |
-
|
577 |
-
<tr>
|
578 |
-
<td>{#style_dlg.left}</td>
|
579 |
-
<td class="delim"> </td>
|
580 |
-
<td><select id="border_style_left" name="border_style_left" class="mceEditableSelect" disabled="disabled"></select></td>
|
581 |
-
<td class="delim"> </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> </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"> </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"> </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> <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> </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> <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> </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> <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> </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> </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> </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> </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> </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> </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> </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> </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> </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> </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> </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> </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"> </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"> </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"> </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> </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> </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> </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> </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> </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> </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> <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> </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> <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> </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> </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> </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> </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> </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> </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> </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> </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> </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> </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"> </td>
|
475 |
+
<td class="tdelim delim"> </td>
|
476 |
+
<td class="tdelim">{#style_dlg.style}</td>
|
477 |
+
<td class="tdelim delim"> </td>
|
478 |
+
<td class="tdelim">{#style_dlg.width}</td>
|
479 |
+
<td class="tdelim delim"> </td>
|
480 |
+
<td class="tdelim">{#style_dlg.color}</td>
|
481 |
+
</tr>
|
482 |
+
|
483 |
+
<tr>
|
484 |
+
<td> </td>
|
485 |
+
<td class="delim"> </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"> </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"> </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"> </td>
|
496 |
+
<td><select id="border_style_top" name="border_style_top" class="mceEditableSelect"></select></td>
|
497 |
+
<td class="delim"> </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> </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"> </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"> </td>
|
516 |
+
</tr>
|
517 |
+
</table>
|
518 |
+
</td>
|
519 |
+
</tr>
|
520 |
+
|
521 |
+
<tr>
|
522 |
+
<td>{#style_dlg.right}</td>
|
523 |
+
<td class="delim"> </td>
|
524 |
+
<td><select id="border_style_right" name="border_style_right" class="mceEditableSelect" disabled="disabled"></select></td>
|
525 |
+
<td class="delim"> </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> </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"> </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"> </td>
|
544 |
+
</tr>
|
545 |
+
</table>
|
546 |
+
</td>
|
547 |
+
</tr>
|
548 |
+
|
549 |
+
<tr>
|
550 |
+
<td>{#style_dlg.bottom}</td>
|
551 |
+
<td class="delim"> </td>
|
552 |
+
<td><select id="border_style_bottom" name="border_style_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
|
553 |
+
<td class="delim"> </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> </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"> </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"> </td>
|
572 |
+
</tr>
|
573 |
+
</table>
|
574 |
+
</td>
|
575 |
+
</tr>
|
576 |
+
|
577 |
+
<tr>
|
578 |
+
<td>{#style_dlg.left}</td>
|
579 |
+
<td class="delim"> </td>
|
580 |
+
<td><select id="border_style_left" name="border_style_left" class="mceEditableSelect" disabled="disabled"></select></td>
|
581 |
+
<td class="delim"> </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> </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"> </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"> </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> <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> </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> <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> </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> <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> </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> </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> </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> </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> </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> </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> </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> </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> </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> </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 ? ' ' : '<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 ? ' ' : '<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 ? ' ' : '<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 ? ' ' : '<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();
|
languages/messages.pot
CHANGED
@@ -1,268 +1,268 @@
|
|
1 |
-
# SOME DESCRIPTIVE TITLE.
|
2 |
-
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3 |
-
# This file is distributed under the same license as the PACKAGE package.
|
4 |
-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
-
#
|
6 |
-
#, fuzzy
|
7 |
-
msgid ""
|
8 |
-
msgstr ""
|
9 |
-
"Project-Id-Version: PACKAGE VERSION\n"
|
10 |
-
"Report-Msgid-Bugs-To: \n"
|
11 |
-
"POT-Creation-Date: 2015-07-08 16:30+0530\n"
|
12 |
-
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15 |
-
"Language: \n"
|
16 |
-
"MIME-Version: 1.0\n"
|
17 |
-
"Content-Type: text/plain; charset=CHARSET\n"
|
18 |
-
"Content-Transfer-Encoding: 8bit\n"
|
19 |
-
|
20 |
-
#: woocommerce-ac.php:22
|
21 |
-
msgid "Once Every Five Minutes"
|
22 |
-
msgstr ""
|
23 |
-
|
24 |
-
#: woocommerce-ac.php:204
|
25 |
-
#, php-format
|
26 |
-
msgid ""
|
27 |
-
"You can upgrade to the <a href=\"https://www.tychesoftwares.com/store/"
|
28 |
-
"premium-plugins/woocommerce-abandoned-cart-pro/\">PRO version of WooCommerce "
|
29 |
-
"Abandoned Cart plugin</a> at a <b>20% discount</b>. Use the coupon code: "
|
30 |
-
"<b>ACPRO20</b>.<a href=\"https://www.tychesoftwares.com/store/premium-"
|
31 |
-
"plugins/woocommerce-abandoned-cart-pro/\"> Purchase now </a> & save $24!"
|
32 |
-
msgstr ""
|
33 |
-
|
34 |
-
#: woocommerce-ac.php:314
|
35 |
-
msgid "Abandoned Carts"
|
36 |
-
msgstr ""
|
37 |
-
|
38 |
-
#: woocommerce-ac.php:516
|
39 |
-
msgid "Abandoned Orders"
|
40 |
-
msgstr ""
|
41 |
-
|
42 |
-
#: woocommerce-ac.php:517
|
43 |
-
msgid "Email Templates"
|
44 |
-
msgstr ""
|
45 |
-
|
46 |
-
#: woocommerce-ac.php:518 woocommerce-ac.php:712
|
47 |
-
msgid "Settings"
|
48 |
-
msgstr ""
|
49 |
-
|
50 |
-
#: woocommerce-ac.php:519
|
51 |
-
msgid "Recovered Orders"
|
52 |
-
msgstr ""
|
53 |
-
|
54 |
-
#: woocommerce-ac.php:661
|
55 |
-
msgid "You do not have sufficient permissions to access this page."
|
56 |
-
msgstr ""
|
57 |
-
|
58 |
-
#: woocommerce-ac.php:670
|
59 |
-
msgid "WooCommerce - Abandon Cart Lite"
|
60 |
-
msgstr ""
|
61 |
-
|
62 |
-
#: woocommerce-ac.php:696
|
63 |
-
msgid "Your settings have been saved."
|
64 |
-
msgstr ""
|
65 |
-
|
66 |
-
#: woocommerce-ac.php:718
|
67 |
-
msgid "Cart abandoned cut-off time"
|
68 |
-
msgstr ""
|
69 |
-
|
70 |
-
#: woocommerce-ac.php:741
|
71 |
-
msgid "minutes"
|
72 |
-
msgstr ""
|
73 |
-
|
74 |
-
#: woocommerce-ac.php:742 woocommerce-ac.php:743
|
75 |
-
msgid ""
|
76 |
-
"Consider cart abandoned after X minutes of item being added to cart & order "
|
77 |
-
"not placed"
|
78 |
-
msgstr ""
|
79 |
-
|
80 |
-
#: woocommerce-ac.php:753
|
81 |
-
msgid "Save Changes"
|
82 |
-
msgstr ""
|
83 |
-
|
84 |
-
#: woocommerce-ac.php:763
|
85 |
-
msgid ""
|
86 |
-
"The list below shows all Abandoned Carts which have remained in cart for a "
|
87 |
-
"time higher than the \"Cart abandoned cut-off time\" setting."
|
88 |
-
msgstr ""
|
89 |
-
|
90 |
-
#: woocommerce-ac.php:858 woocommerce-ac.php:1501
|
91 |
-
msgid "Customer"
|
92 |
-
msgstr ""
|
93 |
-
|
94 |
-
#: woocommerce-ac.php:859 woocommerce-ac.php:1514
|
95 |
-
msgid "Order Total"
|
96 |
-
msgstr ""
|
97 |
-
|
98 |
-
#: woocommerce-ac.php:862
|
99 |
-
msgid "Date"
|
100 |
-
msgstr ""
|
101 |
-
|
102 |
-
#: woocommerce-ac.php:868
|
103 |
-
msgid "Status"
|
104 |
-
msgstr ""
|
105 |
-
|
106 |
-
#: woocommerce-ac.php:872 woocommerce-ac.php:1159
|
107 |
-
msgid "Actions"
|
108 |
-
msgstr ""
|
109 |
-
|
110 |
-
#: woocommerce-ac.php:953
|
111 |
-
msgid ""
|
112 |
-
"Add email templates at different intervals to maximize the possibility of "
|
113 |
-
"recovering your abandoned carts."
|
114 |
-
msgstr ""
|
115 |
-
|
116 |
-
#: woocommerce-ac.php:1054
|
117 |
-
msgid "The Email Template has been successfully added."
|
118 |
-
msgstr ""
|
119 |
-
|
120 |
-
#: woocommerce-ac.php:1057
|
121 |
-
msgid "The Email Template has been successfully updated."
|
122 |
-
msgstr ""
|
123 |
-
|
124 |
-
#: woocommerce-ac.php:1145
|
125 |
-
msgid "Sr"
|
126 |
-
msgstr ""
|
127 |
-
|
128 |
-
#: woocommerce-ac.php:1148
|
129 |
-
msgid "Template Name"
|
130 |
-
msgstr ""
|
131 |
-
|
132 |
-
#: woocommerce-ac.php:1154
|
133 |
-
msgid "Sent"
|
134 |
-
msgstr ""
|
135 |
-
|
136 |
-
#: woocommerce-ac.php:1158
|
137 |
-
msgid "Active ?"
|
138 |
-
msgstr ""
|
139 |
-
|
140 |
-
#: woocommerce-ac.php:1276
|
141 |
-
msgid ""
|
142 |
-
"The Report below shows how many Abandoned Carts we were able to recover for "
|
143 |
-
"you by sending automatic emails to encourage shoppers."
|
144 |
-
msgstr ""
|
145 |
-
|
146 |
-
#: woocommerce-ac.php:1331
|
147 |
-
msgid "Start Date:"
|
148 |
-
msgstr ""
|
149 |
-
|
150 |
-
#: woocommerce-ac.php:1334
|
151 |
-
msgid "End Date:"
|
152 |
-
msgstr ""
|
153 |
-
|
154 |
-
#: woocommerce-ac.php:1337
|
155 |
-
msgid "Go"
|
156 |
-
msgstr ""
|
157 |
-
|
158 |
-
#: woocommerce-ac.php:1495
|
159 |
-
msgid "During the selected range"
|
160 |
-
msgstr ""
|
161 |
-
|
162 |
-
#: woocommerce-ac.php:1495
|
163 |
-
msgid "carts totaling"
|
164 |
-
msgstr ""
|
165 |
-
|
166 |
-
#: woocommerce-ac.php:1495
|
167 |
-
msgid "were abandoned. We were able to recover"
|
168 |
-
msgstr ""
|
169 |
-
|
170 |
-
#: woocommerce-ac.php:1495
|
171 |
-
msgid "of them, which led to an extra"
|
172 |
-
msgstr ""
|
173 |
-
|
174 |
-
#: woocommerce-ac.php:1495
|
175 |
-
msgid "in sales"
|
176 |
-
msgstr ""
|
177 |
-
|
178 |
-
#: woocommerce-ac.php:1504
|
179 |
-
msgid "Created On"
|
180 |
-
msgstr ""
|
181 |
-
|
182 |
-
#: woocommerce-ac.php:1510
|
183 |
-
msgid "Recovered Date"
|
184 |
-
msgstr ""
|
185 |
-
|
186 |
-
#: woocommerce-ac.php:1561
|
187 |
-
msgid "Template Name:"
|
188 |
-
msgstr ""
|
189 |
-
|
190 |
-
#: woocommerce-ac.php:1572
|
191 |
-
msgid "Enter a template name for reference"
|
192 |
-
msgstr ""
|
193 |
-
|
194 |
-
#: woocommerce-ac.php:1577
|
195 |
-
msgid "Send From This Name:"
|
196 |
-
msgstr ""
|
197 |
-
|
198 |
-
#: woocommerce-ac.php:1588
|
199 |
-
msgid "Enter the name that should appear in the email sent"
|
200 |
-
msgstr ""
|
201 |
-
|
202 |
-
#: woocommerce-ac.php:1594
|
203 |
-
msgid "Subject:"
|
204 |
-
msgstr ""
|
205 |
-
|
206 |
-
#: woocommerce-ac.php:1605
|
207 |
-
msgid "Enter the subject that should appear in the email sent"
|
208 |
-
msgstr ""
|
209 |
-
|
210 |
-
#: woocommerce-ac.php:1611
|
211 |
-
msgid "Email Body:"
|
212 |
-
msgstr ""
|
213 |
-
|
214 |
-
#: woocommerce-ac.php:1627
|
215 |
-
msgid "Message to be sent in the reminder email."
|
216 |
-
msgstr ""
|
217 |
-
|
218 |
-
#: woocommerce-ac.php:1634
|
219 |
-
msgid "Send this email:"
|
220 |
-
msgstr ""
|
221 |
-
|
222 |
-
#: woocommerce-ac.php:1686
|
223 |
-
msgid "after cart is abandoned."
|
224 |
-
msgstr ""
|
225 |
-
|
226 |
-
#: woocommerce-ac.php:1693
|
227 |
-
msgid "Send a test email to:"
|
228 |
-
msgstr ""
|
229 |
-
|
230 |
-
#: woocommerce-ac.php:1699
|
231 |
-
msgid "Enter the email id to which the test email needs to be sent."
|
232 |
-
msgstr ""
|
233 |
-
|
234 |
-
#: woocommerce-ac.php:1835 send_email.php:109
|
235 |
-
msgid "Your Shopping Cart"
|
236 |
-
msgstr ""
|
237 |
-
|
238 |
-
#: woocommerce-ac.php:1838 send_email.php:112
|
239 |
-
msgid "Item"
|
240 |
-
msgstr ""
|
241 |
-
|
242 |
-
#: woocommerce-ac.php:1839 send_email.php:113
|
243 |
-
msgid "Name"
|
244 |
-
msgstr ""
|
245 |
-
|
246 |
-
#: woocommerce-ac.php:1840 send_email.php:114
|
247 |
-
msgid "Quantity"
|
248 |
-
msgstr ""
|
249 |
-
|
250 |
-
#: woocommerce-ac.php:1841 send_email.php:115
|
251 |
-
msgid "Price"
|
252 |
-
msgstr ""
|
253 |
-
|
254 |
-
#: woocommerce-ac.php:1842 send_email.php:116
|
255 |
-
msgid "Line Subtotal"
|
256 |
-
msgstr ""
|
257 |
-
|
258 |
-
#: woocommerce-ac.php:1846
|
259 |
-
msgid "Men\\'\\s Formal Shoes"
|
260 |
-
msgstr ""
|
261 |
-
|
262 |
-
#: woocommerce-ac.php:1853
|
263 |
-
msgid "Woman\\'\\s Hand Bags"
|
264 |
-
msgstr ""
|
265 |
-
|
266 |
-
#: woocommerce-ac.php:1862 send_email.php:160
|
267 |
-
msgid "Cart Total:"
|
268 |
-
msgstr ""
|
1 |
+
# SOME DESCRIPTIVE TITLE.
|
2 |
+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3 |
+
# This file is distributed under the same license as the PACKAGE package.
|
4 |
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
+
#
|
6 |
+
#, fuzzy
|
7 |
+
msgid ""
|
8 |
+
msgstr ""
|
9 |
+
"Project-Id-Version: PACKAGE VERSION\n"
|
10 |
+
"Report-Msgid-Bugs-To: \n"
|
11 |
+
"POT-Creation-Date: 2015-07-08 16:30+0530\n"
|
12 |
+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15 |
+
"Language: \n"
|
16 |
+
"MIME-Version: 1.0\n"
|
17 |
+
"Content-Type: text/plain; charset=CHARSET\n"
|
18 |
+
"Content-Transfer-Encoding: 8bit\n"
|
19 |
+
|
20 |
+
#: woocommerce-ac.php:22
|
21 |
+
msgid "Once Every Five Minutes"
|
22 |
+
msgstr ""
|
23 |
+
|
24 |
+
#: woocommerce-ac.php:204
|
25 |
+
#, php-format
|
26 |
+
msgid ""
|
27 |
+
"You can upgrade to the <a href=\"https://www.tychesoftwares.com/store/"
|
28 |
+
"premium-plugins/woocommerce-abandoned-cart-pro/\">PRO version of WooCommerce "
|
29 |
+
"Abandoned Cart plugin</a> at a <b>20% discount</b>. Use the coupon code: "
|
30 |
+
"<b>ACPRO20</b>.<a href=\"https://www.tychesoftwares.com/store/premium-"
|
31 |
+
"plugins/woocommerce-abandoned-cart-pro/\"> Purchase now </a> & save $24!"
|
32 |
+
msgstr ""
|
33 |
+
|
34 |
+
#: woocommerce-ac.php:314
|
35 |
+
msgid "Abandoned Carts"
|
36 |
+
msgstr ""
|
37 |
+
|
38 |
+
#: woocommerce-ac.php:516
|
39 |
+
msgid "Abandoned Orders"
|
40 |
+
msgstr ""
|
41 |
+
|
42 |
+
#: woocommerce-ac.php:517
|
43 |
+
msgid "Email Templates"
|
44 |
+
msgstr ""
|
45 |
+
|
46 |
+
#: woocommerce-ac.php:518 woocommerce-ac.php:712
|
47 |
+
msgid "Settings"
|
48 |
+
msgstr ""
|
49 |
+
|
50 |
+
#: woocommerce-ac.php:519
|
51 |
+
msgid "Recovered Orders"
|
52 |
+
msgstr ""
|
53 |
+
|
54 |
+
#: woocommerce-ac.php:661
|
55 |
+
msgid "You do not have sufficient permissions to access this page."
|
56 |
+
msgstr ""
|
57 |
+
|
58 |
+
#: woocommerce-ac.php:670
|
59 |
+
msgid "WooCommerce - Abandon Cart Lite"
|
60 |
+
msgstr ""
|
61 |
+
|
62 |
+
#: woocommerce-ac.php:696
|
63 |
+
msgid "Your settings have been saved."
|
64 |
+
msgstr ""
|
65 |
+
|
66 |
+
#: woocommerce-ac.php:718
|
67 |
+
msgid "Cart abandoned cut-off time"
|
68 |
+
msgstr ""
|
69 |
+
|
70 |
+
#: woocommerce-ac.php:741
|
71 |
+
msgid "minutes"
|
72 |
+
msgstr ""
|
73 |
+
|
74 |
+
#: woocommerce-ac.php:742 woocommerce-ac.php:743
|
75 |
+
msgid ""
|
76 |
+
"Consider cart abandoned after X minutes of item being added to cart & order "
|
77 |
+
"not placed"
|
78 |
+
msgstr ""
|
79 |
+
|
80 |
+
#: woocommerce-ac.php:753
|
81 |
+
msgid "Save Changes"
|
82 |
+
msgstr ""
|
83 |
+
|
84 |
+
#: woocommerce-ac.php:763
|
85 |
+
msgid ""
|
86 |
+
"The list below shows all Abandoned Carts which have remained in cart for a "
|
87 |
+
"time higher than the \"Cart abandoned cut-off time\" setting."
|
88 |
+
msgstr ""
|
89 |
+
|
90 |
+
#: woocommerce-ac.php:858 woocommerce-ac.php:1501
|
91 |
+
msgid "Customer"
|
92 |
+
msgstr ""
|
93 |
+
|
94 |
+
#: woocommerce-ac.php:859 woocommerce-ac.php:1514
|
95 |
+
msgid "Order Total"
|
96 |
+
msgstr ""
|
97 |
+
|
98 |
+
#: woocommerce-ac.php:862
|
99 |
+
msgid "Date"
|
100 |
+
msgstr ""
|
101 |
+
|
102 |
+
#: woocommerce-ac.php:868
|
103 |
+
msgid "Status"
|
104 |
+
msgstr ""
|
105 |
+
|
106 |
+
#: woocommerce-ac.php:872 woocommerce-ac.php:1159
|
107 |
+
msgid "Actions"
|
108 |
+
msgstr ""
|
109 |
+
|
110 |
+
#: woocommerce-ac.php:953
|
111 |
+
msgid ""
|
112 |
+
"Add email templates at different intervals to maximize the possibility of "
|
113 |
+
"recovering your abandoned carts."
|
114 |
+
msgstr ""
|
115 |
+
|
116 |
+
#: woocommerce-ac.php:1054
|
117 |
+
msgid "The Email Template has been successfully added."
|
118 |
+
msgstr ""
|
119 |
+
|
120 |
+
#: woocommerce-ac.php:1057
|
121 |
+
msgid "The Email Template has been successfully updated."
|
122 |
+
msgstr ""
|
123 |
+
|
124 |
+
#: woocommerce-ac.php:1145
|
125 |
+
msgid "Sr"
|
126 |
+
msgstr ""
|
127 |
+
|
128 |
+
#: woocommerce-ac.php:1148
|
129 |
+
msgid "Template Name"
|
130 |
+
msgstr ""
|
131 |
+
|
132 |
+
#: woocommerce-ac.php:1154
|
133 |
+
msgid "Sent"
|
134 |
+
msgstr ""
|
135 |
+
|
136 |
+
#: woocommerce-ac.php:1158
|
137 |
+
msgid "Active ?"
|
138 |
+
msgstr ""
|
139 |
+
|
140 |
+
#: woocommerce-ac.php:1276
|
141 |
+
msgid ""
|
142 |
+
"The Report below shows how many Abandoned Carts we were able to recover for "
|
143 |
+
"you by sending automatic emails to encourage shoppers."
|
144 |
+
msgstr ""
|
145 |
+
|
146 |
+
#: woocommerce-ac.php:1331
|
147 |
+
msgid "Start Date:"
|
148 |
+
msgstr ""
|
149 |
+
|
150 |
+
#: woocommerce-ac.php:1334
|
151 |
+
msgid "End Date:"
|
152 |
+
msgstr ""
|
153 |
+
|
154 |
+
#: woocommerce-ac.php:1337
|
155 |
+
msgid "Go"
|
156 |
+
msgstr ""
|
157 |
+
|
158 |
+
#: woocommerce-ac.php:1495
|
159 |
+
msgid "During the selected range"
|
160 |
+
msgstr ""
|
161 |
+
|
162 |
+
#: woocommerce-ac.php:1495
|
163 |
+
msgid "carts totaling"
|
164 |
+
msgstr ""
|
165 |
+
|
166 |
+
#: woocommerce-ac.php:1495
|
167 |
+
msgid "were abandoned. We were able to recover"
|
168 |
+
msgstr ""
|
169 |
+
|
170 |
+
#: woocommerce-ac.php:1495
|
171 |
+
msgid "of them, which led to an extra"
|
172 |
+
msgstr ""
|
173 |
+
|
174 |
+
#: woocommerce-ac.php:1495
|
175 |
+
msgid "in sales"
|
176 |
+
msgstr ""
|
177 |
+
|
178 |
+
#: woocommerce-ac.php:1504
|
179 |
+
msgid "Created On"
|
180 |
+
msgstr ""
|
181 |
+
|
182 |
+
#: woocommerce-ac.php:1510
|
183 |
+
msgid "Recovered Date"
|
184 |
+
msgstr ""
|
185 |
+
|
186 |
+
#: woocommerce-ac.php:1561
|
187 |
+
msgid "Template Name:"
|
188 |
+
msgstr ""
|
189 |
+
|
190 |
+
#: woocommerce-ac.php:1572
|
191 |
+
msgid "Enter a template name for reference"
|
192 |
+
msgstr ""
|
193 |
+
|
194 |
+
#: woocommerce-ac.php:1577
|
195 |
+
msgid "Send From This Name:"
|
196 |
+
msgstr ""
|
197 |
+
|
198 |
+
#: woocommerce-ac.php:1588
|
199 |
+
msgid "Enter the name that should appear in the email sent"
|
200 |
+
msgstr ""
|
201 |
+
|
202 |
+
#: woocommerce-ac.php:1594
|
203 |
+
msgid "Subject:"
|
204 |
+
msgstr ""
|
205 |
+
|
206 |
+
#: woocommerce-ac.php:1605
|
207 |
+
msgid "Enter the subject that should appear in the email sent"
|
208 |
+
msgstr ""
|
209 |
+
|
210 |
+
#: woocommerce-ac.php:1611
|
211 |
+
msgid "Email Body:"
|
212 |
+
msgstr ""
|
213 |
+
|
214 |
+
#: woocommerce-ac.php:1627
|
215 |
+
msgid "Message to be sent in the reminder email."
|
216 |
+
msgstr ""
|
217 |
+
|
218 |
+
#: woocommerce-ac.php:1634
|
219 |
+
msgid "Send this email:"
|
220 |
+
msgstr ""
|
221 |
+
|
222 |
+
#: woocommerce-ac.php:1686
|
223 |
+
msgid "after cart is abandoned."
|
224 |
+
msgstr ""
|
225 |
+
|
226 |
+
#: woocommerce-ac.php:1693
|
227 |
+
msgid "Send a test email to:"
|
228 |
+
msgstr ""
|
229 |
+
|
230 |
+
#: woocommerce-ac.php:1699
|
231 |
+
msgid "Enter the email id to which the test email needs to be sent."
|
232 |
+
msgstr ""
|
233 |
+
|
234 |
+
#: woocommerce-ac.php:1835 send_email.php:109
|
235 |
+
msgid "Your Shopping Cart"
|
236 |
+
msgstr ""
|
237 |
+
|
238 |
+
#: woocommerce-ac.php:1838 send_email.php:112
|
239 |
+
msgid "Item"
|
240 |
+
msgstr ""
|
241 |
+
|
242 |
+
#: woocommerce-ac.php:1839 send_email.php:113
|
243 |
+
msgid "Name"
|
244 |
+
msgstr ""
|
245 |
+
|
246 |
+
#: woocommerce-ac.php:1840 send_email.php:114
|
247 |
+
msgid "Quantity"
|
248 |
+
msgstr ""
|
249 |
+
|
250 |
+
#: woocommerce-ac.php:1841 send_email.php:115
|
251 |
+
msgid "Price"
|
252 |
+
msgstr ""
|
253 |
+
|
254 |
+
#: woocommerce-ac.php:1842 send_email.php:116
|
255 |
+
msgid "Line Subtotal"
|
256 |
+
msgstr ""
|
257 |
+
|
258 |
+
#: woocommerce-ac.php:1846
|
259 |
+
msgid "Men\\'\\s Formal Shoes"
|
260 |
+
msgstr ""
|
261 |
+
|
262 |
+
#: woocommerce-ac.php:1853
|
263 |
+
msgid "Woman\\'\\s Hand Bags"
|
264 |
+
msgstr ""
|
265 |
+
|
266 |
+
#: woocommerce-ac.php:1862 send_email.php:160
|
267 |
+
msgid "Cart Total:"
|
268 |
+
msgstr ""
|
languages/woocommerce-ac-he_IL.mo
ADDED
Binary file
|
languages/woocommerce-ac-he_IL.po
ADDED
@@ -0,0 +1,281 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SOME DESCRIPTIVE TITLE.
|
2 |
+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3 |
+
# This file is distributed under the same license as the PACKAGE package.
|
4 |
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
+
#
|
6 |
+
msgid ""
|
7 |
+
msgstr ""
|
8 |
+
"Project-Id-Version: \n"
|
9 |
+
"Report-Msgid-Bugs-To: \n"
|
10 |
+
"POT-Creation-Date: 2015-08-11 18:39+0300\n"
|
11 |
+
"PO-Revision-Date: 2015-08-11 19:03+0300\n"
|
12 |
+
"Language-Team: \n"
|
13 |
+
"MIME-Version: 1.0\n"
|
14 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
15 |
+
"Content-Transfer-Encoding: 8bit\n"
|
16 |
+
"X-Generator: Poedit 1.8.4\n"
|
17 |
+
"Last-Translator: \n"
|
18 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
19 |
+
"Language: he_IL\n"
|
20 |
+
|
21 |
+
#: woocommerce-ac.php:22
|
22 |
+
msgid "Once Every Five Minutes"
|
23 |
+
msgstr "פעם אחת כל חמש דקות"
|
24 |
+
|
25 |
+
#: woocommerce-ac.php:204
|
26 |
+
#, php-format
|
27 |
+
msgid ""
|
28 |
+
"You can upgrade to the <a href=\"https://www.tychesoftwares.com/store/"
|
29 |
+
"premium-plugins/woocommerce-abandoned-cart-pro/\">PRO version of WooCommerce "
|
30 |
+
"Abandoned Cart plugin</a> at a <b>20% discount</b>. Use the coupon code: "
|
31 |
+
"<b>ACPRO20</b>.<a href=\"https://www.tychesoftwares.com/store/premium-"
|
32 |
+
"plugins/woocommerce-abandoned-cart-pro/\"> Purchase now </a> & save $24!"
|
33 |
+
msgstr ""
|
34 |
+
"You can upgrade to the <a href=\"https://www.tychesoftwares.com/store/"
|
35 |
+
"premium-plugins/woocommerce-abandoned-cart-pro/\">PRO version of WooCommerce "
|
36 |
+
"Abandoned Cart plugin</a> at a <b>20% discount</b>. Use the coupon code: "
|
37 |
+
"<b>ACPRO20</b>.<a href=\"https://www.tychesoftwares.com/store/premium-"
|
38 |
+
"plugins/woocommerce-abandoned-cart-pro/\"> Purchase now </a> & save $24!"
|
39 |
+
|
40 |
+
#: woocommerce-ac.php:314
|
41 |
+
msgid "Abandoned Carts"
|
42 |
+
msgstr "עגלות שננטשו"
|
43 |
+
|
44 |
+
#: woocommerce-ac.php:516
|
45 |
+
msgid "Abandoned Orders"
|
46 |
+
msgstr "הזמנות שננטשו"
|
47 |
+
|
48 |
+
#: woocommerce-ac.php:517
|
49 |
+
msgid "Email Templates"
|
50 |
+
msgstr "תבניות אימייל"
|
51 |
+
|
52 |
+
#: woocommerce-ac.php:518 woocommerce-ac.php:712
|
53 |
+
msgid "Settings"
|
54 |
+
msgstr "הגדרות"
|
55 |
+
|
56 |
+
#: woocommerce-ac.php:519
|
57 |
+
msgid "Recovered Orders"
|
58 |
+
msgstr "הזמנות ששוחזרו"
|
59 |
+
|
60 |
+
#: woocommerce-ac.php:661
|
61 |
+
msgid "You do not have sufficient permissions to access this page."
|
62 |
+
msgstr "אין לך הרשאה מתאימה לגשת לעמוד זה."
|
63 |
+
|
64 |
+
#: woocommerce-ac.php:670
|
65 |
+
msgid "WooCommerce - Abandon Cart Lite"
|
66 |
+
msgstr "Woocommerce - עגלות נטושות לייט"
|
67 |
+
|
68 |
+
#: woocommerce-ac.php:696
|
69 |
+
msgid "Your settings have been saved."
|
70 |
+
msgstr "ההגדרות שלך נשמרו"
|
71 |
+
|
72 |
+
#: woocommerce-ac.php:718
|
73 |
+
msgid "Cart abandoned cut-off time"
|
74 |
+
msgstr "זמן חישוב עגלה כנטושה"
|
75 |
+
|
76 |
+
#: woocommerce-ac.php:741
|
77 |
+
msgid "minutes"
|
78 |
+
msgstr "דקות"
|
79 |
+
|
80 |
+
#: woocommerce-ac.php:742 woocommerce-ac.php:743
|
81 |
+
msgid ""
|
82 |
+
"Consider cart abandoned after X minutes of item being added to cart & order "
|
83 |
+
"not placed"
|
84 |
+
msgstr ""
|
85 |
+
"החשב עגלה כנטושה אחרי X דקות מאז הפריט הוסף לעגלת הקניות וההזמנה לא בוצעה"
|
86 |
+
|
87 |
+
#: woocommerce-ac.php:753
|
88 |
+
msgid "Save Changes"
|
89 |
+
msgstr "שמור שינויים"
|
90 |
+
|
91 |
+
#: woocommerce-ac.php:763
|
92 |
+
msgid ""
|
93 |
+
"The list below shows all Abandoned Carts which have remained in cart for a "
|
94 |
+
"time higher than the \"Cart abandoned cut-off time\" setting."
|
95 |
+
msgstr ""
|
96 |
+
"רשימה זו מציגה את כל העגלות שננטשו אשר נותרו בעגלה לפרק זמן העולה על ״זמן "
|
97 |
+
"חישוב עגלה כנטושה״."
|
98 |
+
|
99 |
+
#: woocommerce-ac.php:858 woocommerce-ac.php:1501
|
100 |
+
msgid "Customer"
|
101 |
+
msgstr "לקוח"
|
102 |
+
|
103 |
+
#: woocommerce-ac.php:859 woocommerce-ac.php:1514
|
104 |
+
msgid "Order Total"
|
105 |
+
msgstr "סה״כ להזמנה"
|
106 |
+
|
107 |
+
#: woocommerce-ac.php:862
|
108 |
+
msgid "Date"
|
109 |
+
msgstr "תאריך"
|
110 |
+
|
111 |
+
#: woocommerce-ac.php:868
|
112 |
+
msgid "Status"
|
113 |
+
msgstr "סטטוס"
|
114 |
+
|
115 |
+
#: woocommerce-ac.php:872 woocommerce-ac.php:1159
|
116 |
+
msgid "Actions"
|
117 |
+
msgstr "פעולות"
|
118 |
+
|
119 |
+
#: woocommerce-ac.php:953
|
120 |
+
msgid ""
|
121 |
+
"Add email templates at different intervals to maximize the possibility of "
|
122 |
+
"recovering your abandoned carts."
|
123 |
+
msgstr ""
|
124 |
+
"הוסף תבניות אימייל בפרקי זמן שונים כדי למקסם את האפשרות לשחזר עגלות נטושות "
|
125 |
+
"שלך."
|
126 |
+
|
127 |
+
#: woocommerce-ac.php:1054
|
128 |
+
msgid "The Email Template has been successfully added."
|
129 |
+
msgstr "תבנית אימייל התווספה בהצלחה."
|
130 |
+
|
131 |
+
#: woocommerce-ac.php:1057
|
132 |
+
msgid "The Email Template has been successfully updated."
|
133 |
+
msgstr "תבנית אימייל עודכנה בהצלחה."
|
134 |
+
|
135 |
+
#: woocommerce-ac.php:1145
|
136 |
+
msgid "Sr"
|
137 |
+
msgstr "Sr"
|
138 |
+
|
139 |
+
#: woocommerce-ac.php:1148
|
140 |
+
msgid "Template Name"
|
141 |
+
msgstr "שם תבנית"
|
142 |
+
|
143 |
+
#: woocommerce-ac.php:1154
|
144 |
+
msgid "Sent"
|
145 |
+
msgstr "נשלח"
|
146 |
+
|
147 |
+
#: woocommerce-ac.php:1158
|
148 |
+
msgid "Active ?"
|
149 |
+
msgstr "פעיל?"
|
150 |
+
|
151 |
+
#: woocommerce-ac.php:1276
|
152 |
+
msgid ""
|
153 |
+
"The Report below shows how many Abandoned Carts we were able to recover for "
|
154 |
+
"you by sending automatic emails to encourage shoppers."
|
155 |
+
msgstr ""
|
156 |
+
"הדו״ח שלהלן מציג כמה עגלות שננטשו שוחזרו עבורך על ידי שליחה אוטומטית של "
|
157 |
+
"אימיילים לטובת עידוד קונים."
|
158 |
+
|
159 |
+
#: woocommerce-ac.php:1331
|
160 |
+
msgid "Start Date:"
|
161 |
+
msgstr "תאריך התחלה:"
|
162 |
+
|
163 |
+
#: woocommerce-ac.php:1334
|
164 |
+
msgid "End Date:"
|
165 |
+
msgstr "תאריך סיום:"
|
166 |
+
|
167 |
+
#: woocommerce-ac.php:1337
|
168 |
+
msgid "Go"
|
169 |
+
msgstr "שלח"
|
170 |
+
|
171 |
+
#: woocommerce-ac.php:1495
|
172 |
+
msgid "During the selected range"
|
173 |
+
msgstr "במהלך התקופה הנקובה"
|
174 |
+
|
175 |
+
#: woocommerce-ac.php:1495
|
176 |
+
msgid "carts totaling"
|
177 |
+
msgstr "עגלות בסך"
|
178 |
+
|
179 |
+
#: woocommerce-ac.php:1495
|
180 |
+
msgid "were abandoned. We were able to recover"
|
181 |
+
msgstr "ננטשו. הצלחנו לשחזר"
|
182 |
+
|
183 |
+
#: woocommerce-ac.php:1495
|
184 |
+
msgid "of them, which led to an extra"
|
185 |
+
msgstr "מתוכן, אשר הוביל לתוספת של"
|
186 |
+
|
187 |
+
#: woocommerce-ac.php:1495
|
188 |
+
msgid "in sales"
|
189 |
+
msgstr "במכירות"
|
190 |
+
|
191 |
+
#: woocommerce-ac.php:1504
|
192 |
+
msgid "Created On"
|
193 |
+
msgstr "נוצר ב"
|
194 |
+
|
195 |
+
#: woocommerce-ac.php:1510
|
196 |
+
msgid "Recovered Date"
|
197 |
+
msgstr "תאריך שחזור"
|
198 |
+
|
199 |
+
#: woocommerce-ac.php:1561
|
200 |
+
msgid "Template Name:"
|
201 |
+
msgstr "שם תבנית:"
|
202 |
+
|
203 |
+
#: woocommerce-ac.php:1572
|
204 |
+
msgid "Enter a template name for reference"
|
205 |
+
msgstr "הכנס שם לתבנית לטובת סימוכין"
|
206 |
+
|
207 |
+
#: woocommerce-ac.php:1577
|
208 |
+
msgid "Send From This Name:"
|
209 |
+
msgstr "מאת:"
|
210 |
+
|
211 |
+
#: woocommerce-ac.php:1588
|
212 |
+
msgid "Enter the name that should appear in the email sent"
|
213 |
+
msgstr "הכנס את השם אשר יופיע באימייל שיישלח"
|
214 |
+
|
215 |
+
#: woocommerce-ac.php:1594
|
216 |
+
msgid "Subject:"
|
217 |
+
msgstr "נושא:"
|
218 |
+
|
219 |
+
#: woocommerce-ac.php:1605
|
220 |
+
msgid "Enter the subject that should appear in the email sent"
|
221 |
+
msgstr "הכנס את הנושא אשר יופיע באימייל שיישלח"
|
222 |
+
|
223 |
+
#: woocommerce-ac.php:1611
|
224 |
+
msgid "Email Body:"
|
225 |
+
msgstr "גוף האימייל:"
|
226 |
+
|
227 |
+
#: woocommerce-ac.php:1627
|
228 |
+
msgid "Message to be sent in the reminder email."
|
229 |
+
msgstr "הודעה אשר תישלח באימייל תזכורת."
|
230 |
+
|
231 |
+
#: woocommerce-ac.php:1634
|
232 |
+
msgid "Send this email:"
|
233 |
+
msgstr "שלח אימייל זה:"
|
234 |
+
|
235 |
+
#: woocommerce-ac.php:1686
|
236 |
+
msgid "after cart is abandoned."
|
237 |
+
msgstr "אחרי שננטשת עגלה."
|
238 |
+
|
239 |
+
#: woocommerce-ac.php:1693
|
240 |
+
msgid "Send a test email to:"
|
241 |
+
msgstr "שלח מייל בדיקה אל:"
|
242 |
+
|
243 |
+
#: woocommerce-ac.php:1699
|
244 |
+
msgid "Enter the email id to which the test email needs to be sent."
|
245 |
+
msgstr "הכנס את כתובת האימייל אליה יישלח מייל בדיקה."
|
246 |
+
|
247 |
+
#: woocommerce-ac.php:1835 send_email.php:109
|
248 |
+
msgid "Your Shopping Cart"
|
249 |
+
msgstr "עגלת הקניות שלך"
|
250 |
+
|
251 |
+
#: woocommerce-ac.php:1838 send_email.php:112
|
252 |
+
msgid "Item"
|
253 |
+
msgstr "פריט"
|
254 |
+
|
255 |
+
#: woocommerce-ac.php:1839 send_email.php:113
|
256 |
+
msgid "Name"
|
257 |
+
msgstr "שם"
|
258 |
+
|
259 |
+
#: woocommerce-ac.php:1840 send_email.php:114
|
260 |
+
msgid "Quantity"
|
261 |
+
msgstr "כמות"
|
262 |
+
|
263 |
+
#: woocommerce-ac.php:1841 send_email.php:115
|
264 |
+
msgid "Price"
|
265 |
+
msgstr "מחיר"
|
266 |
+
|
267 |
+
#: woocommerce-ac.php:1842 send_email.php:116
|
268 |
+
msgid "Line Subtotal"
|
269 |
+
msgstr "סכום ביניים"
|
270 |
+
|
271 |
+
#: woocommerce-ac.php:1846
|
272 |
+
msgid "Men\\'\\s Formal Shoes"
|
273 |
+
msgstr "נעלי גברים"
|
274 |
+
|
275 |
+
#: woocommerce-ac.php:1853
|
276 |
+
msgid "Woman\\'\\s Hand Bags"
|
277 |
+
msgstr "תיקי יד של נשים"
|
278 |
+
|
279 |
+
#: woocommerce-ac.php:1862 send_email.php:160
|
280 |
+
msgid "Cart Total:"
|
281 |
+
msgstr "סה״כ בעגלה:"
|
languages/woocommerce-ac.po
CHANGED
@@ -1,269 +1,269 @@
|
|
1 |
-
# SOME DESCRIPTIVE TITLE.
|
2 |
-
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3 |
-
# This file is distributed under the same license as the PACKAGE package.
|
4 |
-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
-
#
|
6 |
-
msgid ""
|
7 |
-
msgstr ""
|
8 |
-
"Project-Id-Version: woocommerce-ac\n"
|
9 |
-
"Report-Msgid-Bugs-To: \n"
|
10 |
-
"POT-Creation-Date: 2015-07-08 16:30+0530\n"
|
11 |
-
"PO-Revision-Date: 2015-07-16 11:02+0530\n"
|
12 |
-
"Last-Translator: \n"
|
13 |
-
"Language-Team: \n"
|
14 |
-
"MIME-Version: 1.0\n"
|
15 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
16 |
-
"Content-Transfer-Encoding: 8bit\n"
|
17 |
-
"X-Generator: Poedit 1.5.7\n"
|
18 |
-
"X-Poedit-KeywordsList: __;_e\n"
|
19 |
-
"X-Poedit-Basepath: .\n"
|
20 |
-
|
21 |
-
#: woocommerce-ac.php:22
|
22 |
-
msgid "Once Every Five Minutes"
|
23 |
-
msgstr ""
|
24 |
-
|
25 |
-
#: woocommerce-ac.php:204
|
26 |
-
#, php-format
|
27 |
-
msgid ""
|
28 |
-
"You can upgrade to the <a href=\"https://www.tychesoftwares.com/store/"
|
29 |
-
"premium-plugins/woocommerce-abandoned-cart-pro/\">PRO version of WooCommerce "
|
30 |
-
"Abandoned Cart plugin</a> at a <b>20% discount</b>. Use the coupon code: "
|
31 |
-
"<b>ACPRO20</b>.<a href=\"https://www.tychesoftwares.com/store/premium-"
|
32 |
-
"plugins/woocommerce-abandoned-cart-pro/\"> Purchase now </a> & save $24!"
|
33 |
-
msgstr ""
|
34 |
-
|
35 |
-
#: woocommerce-ac.php:314
|
36 |
-
msgid "Abandoned Carts"
|
37 |
-
msgstr ""
|
38 |
-
|
39 |
-
#: woocommerce-ac.php:516
|
40 |
-
msgid "Abandoned Orders"
|
41 |
-
msgstr ""
|
42 |
-
|
43 |
-
#: woocommerce-ac.php:517
|
44 |
-
msgid "Email Templates"
|
45 |
-
msgstr ""
|
46 |
-
|
47 |
-
#: woocommerce-ac.php:518 woocommerce-ac.php:712
|
48 |
-
msgid "Settings"
|
49 |
-
msgstr ""
|
50 |
-
|
51 |
-
#: woocommerce-ac.php:519
|
52 |
-
msgid "Recovered Orders"
|
53 |
-
msgstr ""
|
54 |
-
|
55 |
-
#: woocommerce-ac.php:661
|
56 |
-
msgid "You do not have sufficient permissions to access this page."
|
57 |
-
msgstr ""
|
58 |
-
|
59 |
-
#: woocommerce-ac.php:670
|
60 |
-
msgid "WooCommerce - Abandon Cart Lite"
|
61 |
-
msgstr ""
|
62 |
-
|
63 |
-
#: woocommerce-ac.php:696
|
64 |
-
msgid "Your settings have been saved."
|
65 |
-
msgstr ""
|
66 |
-
|
67 |
-
#: woocommerce-ac.php:718
|
68 |
-
msgid "Cart abandoned cut-off time"
|
69 |
-
msgstr ""
|
70 |
-
|
71 |
-
#: woocommerce-ac.php:741
|
72 |
-
msgid "minutes"
|
73 |
-
msgstr ""
|
74 |
-
|
75 |
-
#: woocommerce-ac.php:742 woocommerce-ac.php:743
|
76 |
-
msgid ""
|
77 |
-
"Consider cart abandoned after X minutes of item being added to cart & order "
|
78 |
-
"not placed"
|
79 |
-
msgstr ""
|
80 |
-
|
81 |
-
#: woocommerce-ac.php:753
|
82 |
-
msgid "Save Changes"
|
83 |
-
msgstr ""
|
84 |
-
|
85 |
-
#: woocommerce-ac.php:763
|
86 |
-
msgid ""
|
87 |
-
"The list below shows all Abandoned Carts which have remained in cart for a "
|
88 |
-
"time higher than the \"Cart abandoned cut-off time\" setting."
|
89 |
-
msgstr ""
|
90 |
-
|
91 |
-
#: woocommerce-ac.php:858 woocommerce-ac.php:1501
|
92 |
-
msgid "Customer"
|
93 |
-
msgstr ""
|
94 |
-
|
95 |
-
#: woocommerce-ac.php:859 woocommerce-ac.php:1514
|
96 |
-
msgid "Order Total"
|
97 |
-
msgstr ""
|
98 |
-
|
99 |
-
#: woocommerce-ac.php:862
|
100 |
-
msgid "Date"
|
101 |
-
msgstr ""
|
102 |
-
|
103 |
-
#: woocommerce-ac.php:868
|
104 |
-
msgid "Status"
|
105 |
-
msgstr ""
|
106 |
-
|
107 |
-
#: woocommerce-ac.php:872 woocommerce-ac.php:1159
|
108 |
-
msgid "Actions"
|
109 |
-
msgstr ""
|
110 |
-
|
111 |
-
#: woocommerce-ac.php:953
|
112 |
-
msgid ""
|
113 |
-
"Add email templates at different intervals to maximize the possibility of "
|
114 |
-
"recovering your abandoned carts."
|
115 |
-
msgstr ""
|
116 |
-
|
117 |
-
#: woocommerce-ac.php:1054
|
118 |
-
msgid "The Email Template has been successfully added."
|
119 |
-
msgstr ""
|
120 |
-
|
121 |
-
#: woocommerce-ac.php:1057
|
122 |
-
msgid "The Email Template has been successfully updated."
|
123 |
-
msgstr ""
|
124 |
-
|
125 |
-
#: woocommerce-ac.php:1145
|
126 |
-
msgid "Sr"
|
127 |
-
msgstr ""
|
128 |
-
|
129 |
-
#: woocommerce-ac.php:1148
|
130 |
-
msgid "Template Name"
|
131 |
-
msgstr ""
|
132 |
-
|
133 |
-
#: woocommerce-ac.php:1154
|
134 |
-
msgid "Sent"
|
135 |
-
msgstr ""
|
136 |
-
|
137 |
-
#: woocommerce-ac.php:1158
|
138 |
-
msgid "Active ?"
|
139 |
-
msgstr ""
|
140 |
-
|
141 |
-
#: woocommerce-ac.php:1276
|
142 |
-
msgid ""
|
143 |
-
"The Report below shows how many Abandoned Carts we were able to recover for "
|
144 |
-
"you by sending automatic emails to encourage shoppers."
|
145 |
-
msgstr ""
|
146 |
-
|
147 |
-
#: woocommerce-ac.php:1331
|
148 |
-
msgid "Start Date:"
|
149 |
-
msgstr ""
|
150 |
-
|
151 |
-
#: woocommerce-ac.php:1334
|
152 |
-
msgid "End Date:"
|
153 |
-
msgstr ""
|
154 |
-
|
155 |
-
#: woocommerce-ac.php:1337
|
156 |
-
msgid "Go"
|
157 |
-
msgstr ""
|
158 |
-
|
159 |
-
#: woocommerce-ac.php:1495
|
160 |
-
msgid "During the selected range"
|
161 |
-
msgstr ""
|
162 |
-
|
163 |
-
#: woocommerce-ac.php:1495
|
164 |
-
msgid "carts totaling"
|
165 |
-
msgstr ""
|
166 |
-
|
167 |
-
#: woocommerce-ac.php:1495
|
168 |
-
msgid "were abandoned. We were able to recover"
|
169 |
-
msgstr ""
|
170 |
-
|
171 |
-
#: woocommerce-ac.php:1495
|
172 |
-
msgid "of them, which led to an extra"
|
173 |
-
msgstr ""
|
174 |
-
|
175 |
-
#: woocommerce-ac.php:1495
|
176 |
-
msgid "in sales"
|
177 |
-
msgstr ""
|
178 |
-
|
179 |
-
#: woocommerce-ac.php:1504
|
180 |
-
msgid "Created On"
|
181 |
-
msgstr ""
|
182 |
-
|
183 |
-
#: woocommerce-ac.php:1510
|
184 |
-
msgid "Recovered Date"
|
185 |
-
msgstr ""
|
186 |
-
|
187 |
-
#: woocommerce-ac.php:1561
|
188 |
-
msgid "Template Name:"
|
189 |
-
msgstr ""
|
190 |
-
|
191 |
-
#: woocommerce-ac.php:1572
|
192 |
-
msgid "Enter a template name for reference"
|
193 |
-
msgstr ""
|
194 |
-
|
195 |
-
#: woocommerce-ac.php:1577
|
196 |
-
msgid "Send From This Name:"
|
197 |
-
msgstr ""
|
198 |
-
|
199 |
-
#: woocommerce-ac.php:1588
|
200 |
-
msgid "Enter the name that should appear in the email sent"
|
201 |
-
msgstr ""
|
202 |
-
|
203 |
-
#: woocommerce-ac.php:1594
|
204 |
-
msgid "Subject:"
|
205 |
-
msgstr ""
|
206 |
-
|
207 |
-
#: woocommerce-ac.php:1605
|
208 |
-
msgid "Enter the subject that should appear in the email sent"
|
209 |
-
msgstr ""
|
210 |
-
|
211 |
-
#: woocommerce-ac.php:1611
|
212 |
-
msgid "Email Body:"
|
213 |
-
msgstr ""
|
214 |
-
|
215 |
-
#: woocommerce-ac.php:1627
|
216 |
-
msgid "Message to be sent in the reminder email."
|
217 |
-
msgstr ""
|
218 |
-
|
219 |
-
#: woocommerce-ac.php:1634
|
220 |
-
msgid "Send this email:"
|
221 |
-
msgstr ""
|
222 |
-
|
223 |
-
#: woocommerce-ac.php:1686
|
224 |
-
msgid "after cart is abandoned."
|
225 |
-
msgstr ""
|
226 |
-
|
227 |
-
#: woocommerce-ac.php:1693
|
228 |
-
msgid "Send a test email to:"
|
229 |
-
msgstr ""
|
230 |
-
|
231 |
-
#: woocommerce-ac.php:1699
|
232 |
-
msgid "Enter the email id to which the test email needs to be sent."
|
233 |
-
msgstr ""
|
234 |
-
|
235 |
-
#: woocommerce-ac.php:1835 send_email.php:109
|
236 |
-
msgid "Your Shopping Cart"
|
237 |
-
msgstr ""
|
238 |
-
|
239 |
-
#: woocommerce-ac.php:1838 send_email.php:112
|
240 |
-
msgid "Item"
|
241 |
-
msgstr ""
|
242 |
-
|
243 |
-
#: woocommerce-ac.php:1839 send_email.php:113
|
244 |
-
msgid "Name"
|
245 |
-
msgstr ""
|
246 |
-
|
247 |
-
#: woocommerce-ac.php:1840 send_email.php:114
|
248 |
-
msgid "Quantity"
|
249 |
-
msgstr ""
|
250 |
-
|
251 |
-
#: woocommerce-ac.php:1841 send_email.php:115
|
252 |
-
msgid "Price"
|
253 |
-
msgstr ""
|
254 |
-
|
255 |
-
#: woocommerce-ac.php:1842 send_email.php:116
|
256 |
-
msgid "Line Subtotal"
|
257 |
-
msgstr ""
|
258 |
-
|
259 |
-
#: woocommerce-ac.php:1846
|
260 |
-
msgid "Men\\'\\s Formal Shoes"
|
261 |
-
msgstr ""
|
262 |
-
|
263 |
-
#: woocommerce-ac.php:1853
|
264 |
-
msgid "Woman\\'\\s Hand Bags"
|
265 |
-
msgstr ""
|
266 |
-
|
267 |
-
#: woocommerce-ac.php:1862 send_email.php:160
|
268 |
-
msgid "Cart Total:"
|
269 |
-
msgstr ""
|
1 |
+
# SOME DESCRIPTIVE TITLE.
|
2 |
+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3 |
+
# This file is distributed under the same license as the PACKAGE package.
|
4 |
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
+
#
|
6 |
+
msgid ""
|
7 |
+
msgstr ""
|
8 |
+
"Project-Id-Version: woocommerce-ac\n"
|
9 |
+
"Report-Msgid-Bugs-To: \n"
|
10 |
+
"POT-Creation-Date: 2015-07-08 16:30+0530\n"
|
11 |
+
"PO-Revision-Date: 2015-07-16 11:02+0530\n"
|
12 |
+
"Last-Translator: \n"
|
13 |
+
"Language-Team: \n"
|
14 |
+
"MIME-Version: 1.0\n"
|
15 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
16 |
+
"Content-Transfer-Encoding: 8bit\n"
|
17 |
+
"X-Generator: Poedit 1.5.7\n"
|
18 |
+
"X-Poedit-KeywordsList: __;_e\n"
|
19 |
+
"X-Poedit-Basepath: .\n"
|
20 |
+
|
21 |
+
#: woocommerce-ac.php:22
|
22 |
+
msgid "Once Every Five Minutes"
|
23 |
+
msgstr ""
|
24 |
+
|
25 |
+
#: woocommerce-ac.php:204
|
26 |
+
#, php-format
|
27 |
+
msgid ""
|
28 |
+
"You can upgrade to the <a href=\"https://www.tychesoftwares.com/store/"
|
29 |
+
"premium-plugins/woocommerce-abandoned-cart-pro/\">PRO version of WooCommerce "
|
30 |
+
"Abandoned Cart plugin</a> at a <b>20% discount</b>. Use the coupon code: "
|
31 |
+
"<b>ACPRO20</b>.<a href=\"https://www.tychesoftwares.com/store/premium-"
|
32 |
+
"plugins/woocommerce-abandoned-cart-pro/\"> Purchase now </a> & save $24!"
|
33 |
+
msgstr ""
|
34 |
+
|
35 |
+
#: woocommerce-ac.php:314
|
36 |
+
msgid "Abandoned Carts"
|
37 |
+
msgstr ""
|
38 |
+
|
39 |
+
#: woocommerce-ac.php:516
|
40 |
+
msgid "Abandoned Orders"
|
41 |
+
msgstr ""
|
42 |
+
|
43 |
+
#: woocommerce-ac.php:517
|
44 |
+
msgid "Email Templates"
|
45 |
+
msgstr ""
|
46 |
+
|
47 |
+
#: woocommerce-ac.php:518 woocommerce-ac.php:712
|
48 |
+
msgid "Settings"
|
49 |
+
msgstr ""
|
50 |
+
|
51 |
+
#: woocommerce-ac.php:519
|
52 |
+
msgid "Recovered Orders"
|
53 |
+
msgstr ""
|
54 |
+
|
55 |
+
#: woocommerce-ac.php:661
|
56 |
+
msgid "You do not have sufficient permissions to access this page."
|
57 |
+
msgstr ""
|
58 |
+
|
59 |
+
#: woocommerce-ac.php:670
|
60 |
+
msgid "WooCommerce - Abandon Cart Lite"
|
61 |
+
msgstr ""
|
62 |
+
|
63 |
+
#: woocommerce-ac.php:696
|
64 |
+
msgid "Your settings have been saved."
|
65 |
+
msgstr ""
|
66 |
+
|
67 |
+
#: woocommerce-ac.php:718
|
68 |
+
msgid "Cart abandoned cut-off time"
|
69 |
+
msgstr ""
|
70 |
+
|
71 |
+
#: woocommerce-ac.php:741
|
72 |
+
msgid "minutes"
|
73 |
+
msgstr ""
|
74 |
+
|
75 |
+
#: woocommerce-ac.php:742 woocommerce-ac.php:743
|
76 |
+
msgid ""
|
77 |
+
"Consider cart abandoned after X minutes of item being added to cart & order "
|
78 |
+
"not placed"
|
79 |
+
msgstr ""
|
80 |
+
|
81 |
+
#: woocommerce-ac.php:753
|
82 |
+
msgid "Save Changes"
|
83 |
+
msgstr ""
|
84 |
+
|
85 |
+
#: woocommerce-ac.php:763
|
86 |
+
msgid ""
|
87 |
+
"The list below shows all Abandoned Carts which have remained in cart for a "
|
88 |
+
"time higher than the \"Cart abandoned cut-off time\" setting."
|
89 |
+
msgstr ""
|
90 |
+
|
91 |
+
#: woocommerce-ac.php:858 woocommerce-ac.php:1501
|
92 |
+
msgid "Customer"
|
93 |
+
msgstr ""
|
94 |
+
|
95 |
+
#: woocommerce-ac.php:859 woocommerce-ac.php:1514
|
96 |
+
msgid "Order Total"
|
97 |
+
msgstr ""
|
98 |
+
|
99 |
+
#: woocommerce-ac.php:862
|
100 |
+
msgid "Date"
|
101 |
+
msgstr ""
|
102 |
+
|
103 |
+
#: woocommerce-ac.php:868
|
104 |
+
msgid "Status"
|
105 |
+
msgstr ""
|
106 |
+
|
107 |
+
#: woocommerce-ac.php:872 woocommerce-ac.php:1159
|
108 |
+
msgid "Actions"
|
109 |
+
msgstr ""
|
110 |
+
|
111 |
+
#: woocommerce-ac.php:953
|
112 |
+
msgid ""
|
113 |
+
"Add email templates at different intervals to maximize the possibility of "
|
114 |
+
"recovering your abandoned carts."
|
115 |
+
msgstr ""
|
116 |
+
|
117 |
+
#: woocommerce-ac.php:1054
|
118 |
+
msgid "The Email Template has been successfully added."
|
119 |
+
msgstr ""
|
120 |
+
|
121 |
+
#: woocommerce-ac.php:1057
|
122 |
+
msgid "The Email Template has been successfully updated."
|
123 |
+
msgstr ""
|
124 |
+
|
125 |
+
#: woocommerce-ac.php:1145
|
126 |
+
msgid "Sr"
|
127 |
+
msgstr ""
|
128 |
+
|
129 |
+
#: woocommerce-ac.php:1148
|
130 |
+
msgid "Template Name"
|
131 |
+
msgstr ""
|
132 |
+
|
133 |
+
#: woocommerce-ac.php:1154
|
134 |
+
msgid "Sent"
|
135 |
+
msgstr ""
|
136 |
+
|
137 |
+
#: woocommerce-ac.php:1158
|
138 |
+
msgid "Active ?"
|
139 |
+
msgstr ""
|
140 |
+
|
141 |
+
#: woocommerce-ac.php:1276
|
142 |
+
msgid ""
|
143 |
+
"The Report below shows how many Abandoned Carts we were able to recover for "
|
144 |
+
"you by sending automatic emails to encourage shoppers."
|
145 |
+
msgstr ""
|
146 |
+
|
147 |
+
#: woocommerce-ac.php:1331
|
148 |
+
msgid "Start Date:"
|
149 |
+
msgstr ""
|
150 |
+
|
151 |
+
#: woocommerce-ac.php:1334
|
152 |
+
msgid "End Date:"
|
153 |
+
msgstr ""
|
154 |
+
|
155 |
+
#: woocommerce-ac.php:1337
|
156 |
+
msgid "Go"
|
157 |
+
msgstr ""
|
158 |
+
|
159 |
+
#: woocommerce-ac.php:1495
|
160 |
+
msgid "During the selected range"
|
161 |
+
msgstr ""
|
162 |
+
|
163 |
+
#: woocommerce-ac.php:1495
|
164 |
+
msgid "carts totaling"
|
165 |
+
msgstr ""
|
166 |
+
|
167 |
+
#: woocommerce-ac.php:1495
|
168 |
+
msgid "were abandoned. We were able to recover"
|
169 |
+
msgstr ""
|
170 |
+
|
171 |
+
#: woocommerce-ac.php:1495
|
172 |
+
msgid "of them, which led to an extra"
|
173 |
+
msgstr ""
|
174 |
+
|
175 |
+
#: woocommerce-ac.php:1495
|
176 |
+
msgid "in sales"
|
177 |
+
msgstr ""
|
178 |
+
|
179 |
+
#: woocommerce-ac.php:1504
|
180 |
+
msgid "Created On"
|
181 |
+
msgstr ""
|
182 |
+
|
183 |
+
#: woocommerce-ac.php:1510
|
184 |
+
msgid "Recovered Date"
|
185 |
+
msgstr ""
|
186 |
+
|
187 |
+
#: woocommerce-ac.php:1561
|
188 |
+
msgid "Template Name:"
|
189 |
+
msgstr ""
|
190 |
+
|
191 |
+
#: woocommerce-ac.php:1572
|
192 |
+
msgid "Enter a template name for reference"
|
193 |
+
msgstr ""
|
194 |
+
|
195 |
+
#: woocommerce-ac.php:1577
|
196 |
+
msgid "Send From This Name:"
|
197 |
+
msgstr ""
|
198 |
+
|
199 |
+
#: woocommerce-ac.php:1588
|
200 |
+
msgid "Enter the name that should appear in the email sent"
|
201 |
+
msgstr ""
|
202 |
+
|
203 |
+
#: woocommerce-ac.php:1594
|
204 |
+
msgid "Subject:"
|
205 |
+
msgstr ""
|
206 |
+
|
207 |
+
#: woocommerce-ac.php:1605
|
208 |
+
msgid "Enter the subject that should appear in the email sent"
|
209 |
+
msgstr ""
|
210 |
+
|
211 |
+
#: woocommerce-ac.php:1611
|
212 |
+
msgid "Email Body:"
|
213 |
+
msgstr ""
|
214 |
+
|
215 |
+
#: woocommerce-ac.php:1627
|
216 |
+
msgid "Message to be sent in the reminder email."
|
217 |
+
msgstr ""
|
218 |
+
|
219 |
+
#: woocommerce-ac.php:1634
|
220 |
+
msgid "Send this email:"
|
221 |
+
msgstr ""
|
222 |
+
|
223 |
+
#: woocommerce-ac.php:1686
|
224 |
+
msgid "after cart is abandoned."
|
225 |
+
msgstr ""
|
226 |
+
|
227 |
+
#: woocommerce-ac.php:1693
|
228 |
+
msgid "Send a test email to:"
|
229 |
+
msgstr ""
|
230 |
+
|
231 |
+
#: woocommerce-ac.php:1699
|
232 |
+
msgid "Enter the email id to which the test email needs to be sent."
|
233 |
+
msgstr ""
|
234 |
+
|
235 |
+
#: woocommerce-ac.php:1835 send_email.php:109
|
236 |
+
msgid "Your Shopping Cart"
|
237 |
+
msgstr ""
|
238 |
+
|
239 |
+
#: woocommerce-ac.php:1838 send_email.php:112
|
240 |
+
msgid "Item"
|
241 |
+
msgstr ""
|
242 |
+
|
243 |
+
#: woocommerce-ac.php:1839 send_email.php:113
|
244 |
+
msgid "Name"
|
245 |
+
msgstr ""
|
246 |
+
|
247 |
+
#: woocommerce-ac.php:1840 send_email.php:114
|
248 |
+
msgid "Quantity"
|
249 |
+
msgstr ""
|
250 |
+
|
251 |
+
#: woocommerce-ac.php:1841 send_email.php:115
|
252 |
+
msgid "Price"
|
253 |
+
msgstr ""
|
254 |
+
|
255 |
+
#: woocommerce-ac.php:1842 send_email.php:116
|
256 |
+
msgid "Line Subtotal"
|
257 |
+
msgstr ""
|
258 |
+
|
259 |
+
#: woocommerce-ac.php:1846
|
260 |
+
msgid "Men\\'\\s Formal Shoes"
|
261 |
+
msgstr ""
|
262 |
+
|
263 |
+
#: woocommerce-ac.php:1853
|
264 |
+
msgid "Woman\\'\\s Hand Bags"
|
265 |
+
msgstr ""
|
266 |
+
|
267 |
+
#: woocommerce-ac.php:1862 send_email.php:160
|
268 |
+
msgid "Cart Total:"
|
269 |
+
msgstr ""
|
readme.txt
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
=== Woocommerce Abandoned Cart Lite ===
|
2 |
-
Contributors: ashokrane
|
3 |
Tags: abandon cart, shopping cart abandonment
|
4 |
Requires at least: 1.3
|
5 |
-
Tested up to: 4.
|
6 |
Stable tag: trunk
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -16,32 +16,33 @@ Abandoned Cart plugin works in the background, sending email notifications to yo
|
|
16 |
|
17 |
The Abandoned Cart plugin allows you to recover orders that were just a step away from closing. It enables you to create automatic & well-timed email reminders to be sent to your customers who have added your products to their cart, but did not complete the order. As a result, with this plugin you will start recovering at least 30% or more of your lost sales. Why let this 30% revenue go unclaimed?
|
18 |
|
19 |
-
Abandoned Cart plugin enables
|
20 |
<ol>
|
21 |
<li>Recover their abandoned carts in a single click</li>
|
22 |
-
<li>
|
|
|
|
|
|
|
|
|
|
|
23 |
</ol>
|
24 |
|
25 |
-
Abandoned Cart plugin enables
|
26 |
<ol>
|
27 |
-
<li>
|
28 |
-
<li>Offer incentives to customers to return and complete their checkout with discounts and coupons
|
29 |
-
<li>Create unlimited email templates to be sent at intervals that you set</li>
|
30 |
<li>Add custom variables like Customer Name, Product Information, Coupons, etc. in the email template</li>
|
31 |
-
<li>Embed Woocommerce coupons in the emails being sent to customers</li>
|
32 |
-
<li>Copy HTML from anywhere & create templates using the powerful Rich Text Editor</li>
|
33 |
<li>Track whether expired coupons are causing cart abandonment</li>
|
34 |
-
<li>
|
35 |
-
<li>Track abandoned orders value v/s recovered orders value</li>
|
36 |
<li>Track emails sent, emails opened, links clicked for each template/email</li>
|
37 |
-
<li>
|
|
|
38 |
</ol>
|
39 |
|
40 |
-
Note: Some features are available in the PRO version only.
|
41 |
-
|
42 |
**Pro Version:**
|
43 |
|
44 |
-
**[WooCommerce Abandoned Cart Pro 1
|
45 |
|
46 |
|
47 |
**Email Sending Setup:**
|
@@ -68,6 +69,10 @@ Currently there is no provision for tracking guest carts. This is planned in a f
|
|
68 |
|
69 |
Please ensure you have followed the instructions in "Email Sending Setup" right above this FAQ. Additionally, if you have the PRO version, please verify that you have selected "Enable abandoned cart notifications" option in Settings. With this option turned off, the abandoned carts are recorded, but emails are not sent.
|
70 |
|
|
|
|
|
|
|
|
|
71 |
== Screenshots ==
|
72 |
|
73 |
1. Lists all Abandoned Orders.
|
@@ -80,6 +85,35 @@ Please ensure you have followed the instructions in "Email Sending Setup" right
|
|
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 |
|
1 |
=== Woocommerce Abandoned Cart Lite ===
|
2 |
+
Contributors: ashokrane, pinal.shah, mansishah, dharakothari
|
3 |
Tags: abandon cart, shopping cart abandonment
|
4 |
Requires at least: 1.3
|
5 |
+
Tested up to: 4.2.2
|
6 |
Stable tag: trunk
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
16 |
|
17 |
The Abandoned Cart plugin allows you to recover orders that were just a step away from closing. It enables you to create automatic & well-timed email reminders to be sent to your customers who have added your products to their cart, but did not complete the order. As a result, with this plugin you will start recovering at least 30% or more of your lost sales. Why let this 30% revenue go unclaimed?
|
18 |
|
19 |
+
Abandoned Cart Lite plugin enables to do the following things:
|
20 |
<ol>
|
21 |
<li>Recover their abandoned carts in a single click</li>
|
22 |
+
<li>Identify the Abandoned Orders information, including the products that were abandoned</li>
|
23 |
+
<li>Track abandoned orders value v/s recovered orders value</li>
|
24 |
+
<li>Create unlimited email templates to be sent at intervals that you set - Intervals start from 1 hour after cart is abandoned</li>
|
25 |
+
<li>Add custom variables like Customer First Name, Customer Last name, Customer full name & Product Cart Information in the email template</li>
|
26 |
+
<li>Copy HTML from anywhere & create templates using the powerful Rich Text Editor</li>
|
27 |
+
<li>Automatically stops email notifications when a customer makes a purchase or uses the cart recovery link</li>
|
28 |
</ol>
|
29 |
|
30 |
+
Abandoned Cart PRO plugin enables to do the following additional things:
|
31 |
<ol>
|
32 |
+
<li>Works off-the-shelf as it comes with 3 default email templates</li>
|
33 |
+
<li>Offer incentives to customers to return and complete their checkout with discounts and coupons</li>
|
|
|
34 |
<li>Add custom variables like Customer Name, Product Information, Coupons, etc. in the email template</li>
|
35 |
+
<li>Embed Woocommerce coupons & also generate unique coupons in the emails being sent to customers</li>
|
|
|
36 |
<li>Track whether expired coupons are causing cart abandonment</li>
|
37 |
+
<li>Admin is notified by email when an order is recovered</li>
|
|
|
38 |
<li>Track emails sent, emails opened, links clicked for each template/email</li>
|
39 |
+
<li>Product report allows you to see which products are being abandoned & which are being recovered the most</li>
|
40 |
+
<li>Create unlimited email templates to be sent at intervals that you set - Intervals start from 1 minute after cart is abandoned</li>
|
41 |
</ol>
|
42 |
|
|
|
|
|
43 |
**Pro Version:**
|
44 |
|
45 |
+
**[WooCommerce Abandoned Cart Pro 2.4.1](http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro "WooCommerce Abandoned Cart Pro")** - The PRO version allows you to track products in abandoned carts, create unlimited email templates, track coupons, keep a track of sent emails & much more.
|
46 |
|
47 |
|
48 |
**Email Sending Setup:**
|
69 |
|
70 |
Please ensure you have followed the instructions in "Email Sending Setup" right above this FAQ. Additionally, if you have the PRO version, please verify that you have selected "Enable abandoned cart notifications" option in Settings. With this option turned off, the abandoned carts are recorded, but emails are not sent.
|
71 |
|
72 |
+
= Where can I find the documentation on how to setup the plugin? =
|
73 |
+
|
74 |
+
The documentation can be found **[here](https://www.tychesoftwares.com/woocommerce-abandon-cart-plugin-documentation/ "WooCommerce Abandoned Cart Pro")**. The Lite version is a subset of the Pro version, so the same documentation can be used to refer for the Lite version of the plugin.
|
75 |
+
|
76 |
== Screenshots ==
|
77 |
|
78 |
1. Lists all Abandoned Orders.
|
85 |
|
86 |
== Changelog ==
|
87 |
|
88 |
+
= 2.0.1 =
|
89 |
+
* Applied fix for warning displayed on the abandoned orders page.
|
90 |
+
|
91 |
+
= 2.0 =
|
92 |
+
* The image link was coming broken while creating or editing the template if the image is present on the same server. This is fixed now.
|
93 |
+
* Added translations file for Hebrew which was contributed by a user.
|
94 |
+
|
95 |
+
= 1.9 =
|
96 |
+
* Fixed security issues pointed out by Wordpress.org review team.
|
97 |
+
|
98 |
+
= 1.8 =
|
99 |
+
* The strings for the products table, added using the shortcode {{products.cart}} in email templates have been added to the .pot, .po and .mo files of the plugin. Now the cart data will be translated to the respective language in the reminder emails as well as the test emails.
|
100 |
+
|
101 |
+
= 1.7 =
|
102 |
+
* Merge fields like {{products.cart}}, {{customer.firstname}}, etc. will be replaced with dummy data in the test emails that are sent from the template add / edit page. This ensures that you get a very close approximation of the actual email that will be delivered to your customers.
|
103 |
+
* Product image size in the abandon cart notification emails is set to a fixed height & width now.
|
104 |
+
* On WordPress Multisite, incorrect table prefix was used due to which the plugin was not functioning correctly on multisite installs. This is fixed now.
|
105 |
+
|
106 |
+
= 1.6 =
|
107 |
+
* We have included .po, .pot and .mo files in the plugin. The plugin strings can now be translated to any language using these files.
|
108 |
+
|
109 |
+
= 1.5 =
|
110 |
+
* A shortcode {{products.cart}} can now be added in the abandoned cart notification emails. It will add the product information in the email like Product image, Product name, Quantity, Price & Total. The shortcode needs to be added from the AC menu from the template editor.
|
111 |
+
* The default value of the field "Cart abandoned cut-off time" in Settings tab was blank when the plugin is installed. This is now set to 60 minutes upon plugin activation.
|
112 |
+
|
113 |
+
= 1.4 =
|
114 |
+
* The abandoned cart emails were being sent multiple times for a single email template due to a bug. This is fixed.
|
115 |
+
* The plugin will now work on WordPress Multisite too.
|
116 |
+
|
117 |
= 1.3 =
|
118 |
* The abandoned cart email notifications are now sent out automatically without the necessity of having to set up a cron job manually.
|
119 |
|
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,14 +3,13 @@
|
|
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
|
7 |
Author: Tyche Softwares
|
8 |
Author URI: http://www.tychesoftwares.com/
|
9 |
*/
|
10 |
|
11 |
-
|
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' );
|
@@ -18,8 +17,8 @@ add_filter( 'cron_schedules', 'woocommerce_ac_add_cron_schedule' );
|
|
18 |
function woocommerce_ac_add_cron_schedule( $schedules ) {
|
19 |
|
20 |
$schedules['5_minutes'] = array(
|
21 |
-
'interval'
|
22 |
-
'display'
|
23 |
);
|
24 |
return $schedules;
|
25 |
}
|
@@ -40,38 +39,38 @@ function woocommerce_ac_delete(){
|
|
40 |
global $wpdb;
|
41 |
$table_name_ac_abandoned_cart_history = $wpdb->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->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->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);
|
55 |
|
56 |
-
$query
|
57 |
$results = $wpdb->get_results( $query );
|
58 |
|
59 |
foreach( $results as $key => $value ) {
|
60 |
|
61 |
$table_name_ac_abandoned_cart_history = $wpdb->prefix .$value->blog_id."_"."ac_abandoned_cart_history_lite";
|
62 |
$sql_ac_abandoned_cart_history = "DROP TABLE " . $table_name_ac_abandoned_cart_history ;
|
63 |
-
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
64 |
-
$wpdb->get_results($sql_ac_abandoned_cart_history);
|
65 |
|
66 |
$table_name_ac_email_templates = $wpdb->prefix .$value->blog_id."_"."ac_email_templates_lite";
|
67 |
$sql_ac_email_templates = "DROP TABLE " . $table_name_ac_email_templates ;
|
68 |
-
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
69 |
-
$wpdb->get_results($sql_ac_email_templates);
|
70 |
|
71 |
$table_name_ac_sent_history = $wpdb->prefix .$value->blog_id."_"."ac_sent_history_lite";
|
72 |
$sql_ac_sent_history = "DROP TABLE " . $table_name_ac_sent_history ;
|
73 |
-
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
74 |
-
$wpdb->get_results($sql_ac_sent_history);
|
75 |
|
76 |
}
|
77 |
|
@@ -79,19 +78,10 @@ function woocommerce_ac_delete(){
|
|
79 |
delete_option ( 'woocommerce_ac_settings' );
|
80 |
|
81 |
}
|
82 |
-
//include_once("lang.php");
|
83 |
-
|
84 |
-
//if (is_woocommerce_active())
|
85 |
-
{
|
86 |
-
/**
|
87 |
-
* Localisation
|
88 |
-
**/
|
89 |
-
// load_plugin_textdomain('woocommerce-ac', false, dirname( plugin_basename( __FILE__ ) ) . '/');
|
90 |
-
|
91 |
/**
|
92 |
* woocommerce_abandon_cart class
|
93 |
**/
|
94 |
-
if (!class_exists('woocommerce_abandon_cart')) {
|
95 |
|
96 |
class woocommerce_abandon_cart {
|
97 |
|
@@ -103,78 +93,78 @@ function woocommerce_ac_delete(){
|
|
103 |
var $one_week;
|
104 |
|
105 |
var $duration_range_select = array();
|
106 |
-
var $start_end_dates
|
107 |
|
108 |
public function __construct() {
|
109 |
|
110 |
-
$this->one_hour
|
111 |
-
$this->three_hours
|
112 |
-
$this->six_hours
|
113 |
$this->twelve_hours = 12 * $this->one_hour;
|
114 |
-
$this->one_day
|
115 |
-
$this->one_week
|
116 |
|
117 |
-
$this->duration_range_select = array('yesterday'
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
|
|
124 |
|
125 |
-
$this->start_end_dates = array('yesterday'
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
|
|
139 |
|
140 |
|
141 |
// Initialize settings
|
142 |
-
register_activation_hook( __FILE__, array(&$this, 'woocommerce_ac_activate'));
|
143 |
|
144 |
// WordPress Administration Menu
|
145 |
-
add_action('admin_menu', array(&$this, 'woocommerce_ac_admin_menu'));
|
146 |
|
147 |
// Actions to be done on cart update
|
148 |
-
add_action('woocommerce_cart_updated', array(&$this, 'woocommerce_ac_store_cart_timestamp'));
|
149 |
|
150 |
// delete added temp fields after order is placed
|
151 |
-
add_filter('woocommerce_order_details_after_order_table', array(&$this, 'action_after_delivery_session'));
|
152 |
|
153 |
-
add_action( 'admin_init', array(&$this, 'action_admin_init' ));
|
154 |
-
add_action( 'admin_init', array(&$this, 'ac_lite_update_db_check' ));
|
155 |
|
156 |
// Language Translation
|
157 |
-
add_action( 'init', array(&$this, 'update_po_file' ));
|
158 |
|
159 |
//Discount Coupon Notice
|
160 |
-
add_action( 'admin_notices', array(&$this, 'ac_lite_coupon_notice' ));
|
161 |
|
162 |
-
add_action( 'admin_enqueue_scripts', array(&$this, 'my_enqueue_scripts_js' ));
|
163 |
-
add_action( 'admin_enqueue_scripts', array(&$this, 'my_enqueue_scripts_css' ));
|
164 |
|
165 |
-
if( is_admin() )
|
166 |
-
|
167 |
-
|
168 |
-
{
|
169 |
-
add_action('admin_head', array(&$this, 'tinyMCE_ac'));
|
170 |
}
|
171 |
|
172 |
// Load "admin-only" scripts here
|
173 |
-
add_action('admin_head', array(&$this, 'my_action_javascript'));
|
174 |
-
add_action('wp_ajax_remove_cart_data', array(&$this, 'remove_cart_data'));
|
175 |
|
176 |
-
add_action('admin_head', array(&$this, 'my_action_send_preview'));
|
177 |
-
add_action('wp_ajax_preview_email_sent', array(&$this, 'preview_email_sent'));
|
178 |
|
179 |
}
|
180 |
|
@@ -185,34 +175,30 @@ function woocommerce_ac_delete(){
|
|
185 |
/*-----------------------------------------------------------------------------------*/
|
186 |
|
187 |
// Language Translation
|
188 |
-
function update_po_file(){
|
189 |
$domain = 'woocommerce-ac';
|
190 |
$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
|
191 |
if ( $loaded = load_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . $domain . '-' . $locale . '.mo' ) ) {
|
192 |
return $loaded;
|
193 |
} else {
|
194 |
-
|
195 |
-
|
196 |
-
}
|
197 |
}
|
198 |
|
199 |
function ac_lite_coupon_notice() {
|
200 |
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
}
|
209 |
/*-----------------------------------------------------------------------------------*/
|
210 |
/* Class Functions */
|
211 |
-
/*-----------------------------------------------------------------------------------*/
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
function woocommerce_ac_activate() {
|
217 |
|
218 |
global $wpdb;
|
@@ -220,98 +206,98 @@ function woocommerce_ac_delete(){
|
|
220 |
$table_name = $wpdb->prefix . "ac_email_templates_lite";
|
221 |
|
222 |
$sql = "CREATE TABLE IF NOT EXISTS $table_name (
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
235 |
-
dbDelta($sql);
|
236 |
|
237 |
$sent_table_name = $wpdb->prefix . "ac_sent_history_lite";
|
238 |
|
239 |
$sql_query = "CREATE TABLE IF NOT EXISTS $sent_table_name (
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
|
248 |
-
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
249 |
-
dbDelta($sql_query);
|
250 |
|
251 |
$ac_history_table_name = $wpdb->prefix . "ac_abandoned_cart_history_lite";
|
252 |
|
253 |
$history_query = "CREATE TABLE IF NOT EXISTS $ac_history_table_name (
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
|
263 |
-
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
264 |
-
dbDelta($history_query);
|
265 |
|
266 |
-
$ac_settings
|
267 |
-
$ac_settings->cart_time
|
268 |
-
$woo_ac_settings[]
|
269 |
-
$woocommerce_ac_settings = json_encode($woo_ac_settings);
|
270 |
add_option ( 'woocommerce_ac_settings', $woocommerce_ac_settings );
|
271 |
}
|
272 |
|
273 |
function ac_lite_update_db_check() {
|
274 |
global $wpdb;
|
275 |
|
276 |
-
if(get_option('ac_lite_delete_alter_table_queries') != 'yes') {
|
277 |
-
update_option( 'ac_lite_alter_table_queries', '');
|
278 |
update_option( 'ac_lite_delete_alter_table_queries', 'yes' );
|
279 |
}
|
280 |
-
if( get_option('ac_lite_alter_table_queries') != 'yes') {
|
281 |
-
if( $wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "ac_email_templates'") === $wpdb->prefix . 'ac_email_templates') {
|
282 |
$old_table_name = $wpdb->prefix . "ac_email_templates";
|
283 |
-
$table_name
|
284 |
|
285 |
$alter_ac_email_table_query = "ALTER TABLE $old_table_name
|
286 |
-
|
287 |
$wpdb->get_results ( $alter_ac_email_table_query );
|
288 |
|
289 |
}
|
290 |
|
291 |
-
if($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "ac_sent_history'") === $wpdb->prefix . 'ac_sent_history') {
|
292 |
$old_sent_table_name = $wpdb->prefix . "ac_sent_history";
|
293 |
-
$sent_table_name
|
294 |
$alter_ac_sent_history_table_query = "ALTER TABLE $old_sent_table_name
|
295 |
-
|
296 |
$wpdb->get_results ( $alter_ac_sent_history_table_query );
|
297 |
}
|
298 |
|
299 |
-
if( $wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "ac_abandoned_cart_history'") === $wpdb->prefix . 'ac_abandoned_cart_history') {
|
300 |
$old_ac_history_table_name = $wpdb->prefix . "ac_abandoned_cart_history";
|
301 |
-
$ac_history_table_name
|
302 |
|
303 |
$alter_ac_abandoned_cart_history_table_query = "ALTER TABLE $old_ac_history_table_name
|
304 |
-
|
305 |
$wpdb->get_results ( $alter_ac_abandoned_cart_history_table_query );
|
306 |
}
|
307 |
|
308 |
-
update_option('ac_lite_alter_table_queries','yes');
|
309 |
}
|
310 |
}
|
311 |
|
312 |
-
function woocommerce_ac_admin_menu(){
|
313 |
|
314 |
-
$page = add_submenu_page('woocommerce', __( 'Abandoned Carts', 'woocommerce-ac' ), __( 'Abandoned Carts', 'woocommerce-ac' ), 'manage_woocommerce', 'woocommerce_ac_page', array(&$this, 'woocommerce_ac_page' ));
|
315 |
|
316 |
}
|
317 |
|
@@ -320,95 +306,107 @@ function woocommerce_ac_delete(){
|
|
320 |
if ( is_user_logged_in() )
|
321 |
{
|
322 |
global $wpdb;
|
323 |
-
$user_id
|
324 |
-
$current_time = current_time('timestamp');
|
325 |
-
$cut_off_time = json_decode(get_option('woocommerce_ac_settings'));
|
326 |
-
if(isset($cut_off_time[0]->cart_time)) {
|
327 |
$cart_cut_off_time = $cut_off_time[0]->cart_time * 60;
|
328 |
} else {
|
329 |
$cart_cut_off_time = 60 * 60;
|
330 |
}
|
331 |
|
332 |
$compare_time = $current_time - $cart_cut_off_time;
|
|
|
|
|
|
|
333 |
$query = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
$results = $wpdb->get_results( $query );
|
338 |
-
|
339 |
-
{
|
340 |
-
|
|
|
|
|
341 |
$insert_query = "INSERT INTO `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
342 |
-
|
343 |
-
|
344 |
-
$wpdb->query($insert_query);
|
345 |
-
}
|
346 |
-
elseif ( isset($results[0]->abandoned_cart_time) && $compare_time > $results[0]->abandoned_cart_time )
|
347 |
-
{
|
348 |
-
$updated_cart_info = json_encode(get_user_meta($user_id, '_woocommerce_persistent_cart', true));
|
349 |
-
if (! $this->compare_carts( $user_id, $results[0]->abandoned_cart_info) )
|
350 |
-
{
|
351 |
-
$query_ignored = "UPDATE `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
352 |
-
SET cart_ignored = '1'
|
353 |
-
WHERE user_id='".$user_id."'";
|
354 |
-
$wpdb->query($query_ignored);
|
355 |
-
$query_update = "INSERT INTO `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
356 |
-
(user_id, abandoned_cart_info, abandoned_cart_time, cart_ignored)
|
357 |
-
VALUES ('".$user_id."', '".$updated_cart_info."', '".$current_time."', '0')";
|
358 |
-
$wpdb->query($query_update);
|
359 |
-
update_user_meta($user_id, '_woocommerce_ac_modified_cart', md5("yes"));
|
360 |
-
}
|
361 |
-
else
|
362 |
-
{
|
363 |
-
update_user_meta($user_id, '_woocommerce_ac_modified_cart', md5("no"));
|
364 |
-
}
|
365 |
}
|
366 |
-
|
367 |
-
|
368 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
369 |
$query_update = "UPDATE `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
|
|
375 |
}
|
376 |
}
|
377 |
|
378 |
-
function compare_carts($user_id, $last_abandoned_cart)
|
379 |
{
|
380 |
-
$current_woo_cart
|
381 |
-
$abandoned_cart_arr = json_decode($last_abandoned_cart,true);
|
382 |
|
383 |
$temp_variable = "";
|
384 |
-
if ( count($current_woo_cart['cart']) >= count($abandoned_cart_arr['cart']) )
|
385 |
-
{
|
386 |
//do nothing
|
387 |
-
}
|
388 |
-
|
389 |
-
|
390 |
-
$temp_variable = $current_woo_cart;
|
391 |
-
$current_woo_cart = $abandoned_cart_arr;
|
392 |
$abandoned_cart_arr = $temp_variable;
|
393 |
}
|
394 |
-
foreach ($current_woo_cart as $key => $value)
|
395 |
{
|
396 |
-
foreach ($value as $item_key => $item_value)
|
397 |
{
|
398 |
-
$current_cart_product_id
|
399 |
$current_cart_variation_id = $item_value['variation_id'];
|
400 |
-
$current_cart_quantity
|
401 |
-
|
402 |
-
if (isset($abandoned_cart_arr[$key][$item_key]['product_id']))
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
412 |
{
|
413 |
return false;
|
414 |
}
|
@@ -421,47 +419,48 @@ function woocommerce_ac_delete(){
|
|
421 |
|
422 |
global $wpdb;
|
423 |
$user_id = get_current_user_id();
|
424 |
-
delete_user_meta($user_id, '_woocommerce_ac_persistent_cart_time');
|
425 |
-
delete_user_meta($user_id, '_woocommerce_ac_persistent_cart_temp_time');
|
426 |
|
427 |
// get all latest abandoned carts that were modified
|
|
|
|
|
|
|
428 |
$query = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
$results = $wpdb->get_results( $query );
|
435 |
-
if (count($results) > 0){
|
436 |
-
if ( get_user_meta($user_id, '_woocommerce_ac_modified_cart', true) == md5("yes") ||
|
437 |
-
|
438 |
{
|
439 |
-
|
440 |
-
|
|
|
441 |
$query_order = "UPDATE `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
$wpdb->query($query_order);
|
446 |
-
delete_user_meta($user_id, '_woocommerce_ac_modified_cart');
|
447 |
-
}
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
id='".$results[0]->id."' ";
|
453 |
-
$wpdb->query( $delete_query );
|
454 |
}
|
455 |
}
|
456 |
}
|
457 |
|
458 |
function action_admin_init() {
|
459 |
// only hook up these filters if we're in the admin panel, and the current user has permission
|
460 |
-
// to edit posts and pages
|
461 |
-
//echo "hii";
|
462 |
if ( current_user_can( 'edit_posts' ) && current_user_can( 'edit_pages' ) ) {
|
463 |
-
add_filter( 'mce_buttons', array(&$this, 'filter_mce_button' ));
|
464 |
-
add_filter( 'mce_external_plugins', array(&$this, 'filter_mce_plugin' ));
|
465 |
}
|
466 |
}
|
467 |
|
@@ -479,38 +478,31 @@ function woocommerce_ac_delete(){
|
|
479 |
|
480 |
function display_tabs() {
|
481 |
|
482 |
-
if (isset($_GET['action']))
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
{
|
492 |
$active_listcart = "nav-tab-active";
|
493 |
-
}
|
494 |
-
|
495 |
-
if ($action == 'emailtemplates')
|
496 |
-
{
|
497 |
$active_emailtemplates = "nav-tab-active";
|
498 |
}
|
499 |
-
|
500 |
-
if ($action == 'emailsettings')
|
501 |
-
{
|
502 |
$active_settings = "nav-tab-active";
|
503 |
}
|
504 |
-
|
505 |
-
if ($action == 'stats')
|
506 |
-
{
|
507 |
$active_stats = "nav-tab-active";
|
508 |
}
|
509 |
|
510 |
?>
|
511 |
|
512 |
-
<div style="background-image: url('<?php echo plugins_url(); ?>/woocommerce-abandoned-cart/images/ac_tab_icon.png') !important;" class="icon32"><br></div>
|
513 |
-
<!--<span class="mce_abandoncart_email_variables"><br></span>-->
|
514 |
|
515 |
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
516 |
<a href="admin.php?page=woocommerce_ac_page&action=listcart" class="nav-tab <?php echo $active_listcart; ?>"> <?php _e( 'Abandoned Orders', 'woocommerce-ac' );?> </a>
|
@@ -524,52 +516,43 @@ function woocommerce_ac_delete(){
|
|
524 |
|
525 |
function my_enqueue_scripts_js( $hook ) {
|
526 |
|
527 |
-
if ( $hook != 'woocommerce_page_woocommerce_ac_page' )
|
528 |
-
{
|
529 |
return;
|
530 |
-
}
|
531 |
-
else
|
532 |
-
{
|
533 |
-
|
534 |
wp_enqueue_script( 'jquery' );
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
);
|
542 |
wp_enqueue_script( 'jquery-ui-datepicker' );
|
543 |
|
544 |
-
//wp_enqueue_script('suggest');
|
545 |
wp_enqueue_script(
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
);
|
552 |
-
wp_register_script( 'woocommerce_admin', plugins_url() . '/woocommerce/assets/js/admin/woocommerce_admin.js', array('jquery', 'jquery-ui-widget', 'jquery-ui-core'));
|
553 |
wp_enqueue_script( 'woocommerce_admin' );
|
554 |
|
555 |
-
////////////////////////////////////////////////////////////////
|
556 |
-
|
557 |
?>
|
558 |
<script type="text/javascript" >
|
559 |
function delete_email_template( id )
|
560 |
{
|
561 |
-
var y=confirm('Are you sure you want to delete this Email Template');
|
562 |
-
if(y==true)
|
563 |
-
{
|
564 |
location.href='admin.php?page=woocommerce_ac_page&action=emailtemplates&mode=removetemplate&id='+id;
|
565 |
}
|
566 |
}
|
567 |
</script>
|
568 |
-
<!-- /////////////////////////////////////////////////////////////// -->
|
569 |
|
570 |
<?php
|
571 |
-
wp_enqueue_script('tinyMCE_ac', plugins_url() . '/woocommerce-abandoned-cart/js/tinymce/jscripts/tiny_mce/tiny_mce.js');
|
572 |
-
wp_enqueue_script('ac_email_variables', plugins_url() . '/woocommerce-abandoned-cart/js/abandoncart_plugin_button.js');
|
573 |
?>
|
574 |
|
575 |
<?php
|
@@ -611,7 +594,7 @@ function woocommerce_ac_delete(){
|
|
611 |
table_cell_limit : 100,
|
612 |
table_row_limit : 5,
|
613 |
table_col_limit : 5,
|
614 |
-
|
615 |
});
|
616 |
|
617 |
</script>
|
@@ -620,18 +603,14 @@ function woocommerce_ac_delete(){
|
|
620 |
|
621 |
function my_enqueue_scripts_css( $hook ) {
|
622 |
|
623 |
-
if ( $hook != 'woocommerce_page_woocommerce_ac_page' )
|
624 |
-
{
|
625 |
return;
|
626 |
-
}
|
627 |
-
|
628 |
-
{
|
629 |
-
wp_enqueue_style( 'jquery-ui', "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" , '', '', false);
|
630 |
-
|
631 |
wp_enqueue_style( 'woocommerce_admin_styles', plugins_url() . '/woocommerce/assets/css/admin.css' );
|
632 |
wp_enqueue_style( 'jquery-ui-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' );
|
633 |
|
634 |
-
|
635 |
|
636 |
<style>
|
637 |
span.mce_abandoncart_email_variables
|
@@ -651,16 +630,13 @@ function woocommerce_ac_delete(){
|
|
651 |
*/
|
652 |
function woocommerce_ac_page()
|
653 |
{
|
654 |
-
if ( is_user_logged_in() )
|
655 |
-
{
|
656 |
global $wpdb;
|
657 |
|
658 |
// Check the user capabilities
|
659 |
-
if ( !current_user_can( 'manage_woocommerce' ) )
|
660 |
-
{
|
661 |
wp_die( __( 'You do not have sufficient permissions to access this page.', 'woocommerce-ac' ) );
|
662 |
-
}
|
663 |
-
|
664 |
?>
|
665 |
|
666 |
<div class="wrap">
|
@@ -670,39 +646,44 @@ function woocommerce_ac_delete(){
|
|
670 |
<h2><?php _e( 'WooCommerce - Abandon Cart Lite', 'woocommerce-ac' ); ?></h2>
|
671 |
<?php
|
672 |
|
673 |
-
|
674 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
675 |
|
676 |
-
|
677 |
-
else $mode = "";
|
678 |
-
|
679 |
-
$this->display_tabs();
|
680 |
|
681 |
-
if ($action == 'emailsettings')
|
682 |
-
{
|
683 |
// Save the field values
|
684 |
-
if ( isset( $_POST['ac_settings_frm'] ) && $_POST['ac_settings_frm'] == 'save' )
|
685 |
-
{
|
686 |
-
$ac_settings = new stdClass();
|
687 |
-
$ac_settings->cart_time = $_POST['cart_abandonment_time'];
|
688 |
-
$woo_ac_settings[] = $ac_settings;
|
689 |
-
$woocommerce_ac_settings = json_encode($woo_ac_settings);
|
690 |
|
691 |
-
|
|
|
|
|
|
|
|
|
|
|
692 |
}
|
693 |
?>
|
694 |
|
695 |
-
<?php if ( isset( $_POST['ac_settings_frm'] ) && $_POST['ac_settings_frm'] == 'save' ) { ?>
|
696 |
<div id="message" class="updated fade"><p><strong><?php _e( 'Your settings have been saved.', 'woocommerce-ac' ); ?></strong></p></div>
|
697 |
<?php } ?>
|
698 |
|
699 |
<?php
|
700 |
|
701 |
$enable_email_sett_arr = array();
|
702 |
-
$enable_email_sett
|
703 |
-
|
704 |
$enable_email_sett_arr = json_decode( $enable_email_sett );
|
705 |
-
|
|
|
706 |
?>
|
707 |
<div id="content">
|
708 |
<form method="post" action="" id="ac_settings">
|
@@ -722,26 +703,23 @@ function woocommerce_ac_delete(){
|
|
722 |
|
723 |
$cart_time = "";
|
724 |
|
725 |
-
if ( count($enable_email_sett_arr) > 0 ) {
|
726 |
|
727 |
-
if ( ( isset($enable_email_sett_arr[0]->cart_time) ) && ($enable_email_sett_arr[0]->cart_time != '' || $enable_email_sett_arr[0]->cart_time != 'null' )) {
|
728 |
|
729 |
$cart_time = $enable_email_sett_arr[0]->cart_time;
|
|
|
730 |
} else {
|
731 |
|
732 |
$cart_time = 60;
|
733 |
}
|
734 |
-
}
|
735 |
-
else {
|
736 |
-
|
737 |
$cart_time = 60;
|
738 |
}
|
739 |
|
740 |
?>
|
741 |
<input type="text" name="cart_abandonment_time" id="cart_abandonment_time" size="5" value="<?php echo $cart_time; ?> "> <?php _e( 'minutes', 'woocommerce-ac' );?>
|
742 |
-
<img class="help_tip" width="16" height="16" data-tip='<?php _e( 'Consider cart abandoned after X minutes of item being added to cart & order not placed', 'woocommerce-ac') ?>' src="<?php echo plugins_url(); ?>/woocommerce/assets/images/help.png" /></p>
|
743 |
-
<!-- <span class="description"><?php _e( 'Consider cart abandoned after X minutes of item being added to cart & order not placed', 'woocommerce-ac' );
|
744 |
-
?></span> -->
|
745 |
</td>
|
746 |
</tr>
|
747 |
|
@@ -749,188 +727,174 @@ function woocommerce_ac_delete(){
|
|
749 |
</div>
|
750 |
</div>
|
751 |
</div>
|
752 |
-
|
753 |
<input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e( 'Save Changes', 'woocommerce-ac' ); ?>" />
|
754 |
-
|
755 |
</form>
|
756 |
</div>
|
757 |
<?php
|
758 |
-
|
759 |
-
|
760 |
-
{
|
761 |
-
?>
|
762 |
|
763 |
-
<p> <?php _e('The list below shows all Abandoned Carts which have remained in cart for a time higher than the "Cart abandoned cut-off time" setting.', 'woocommerce-ac');?> </p>
|
764 |
|
765 |
<?php
|
766 |
-
|
767 |
include_once( "pagination.class.php");
|
768 |
|
769 |
/* Find the number of rows returned from a query; Note: Do NOT use a LIMIT clause in this query */
|
770 |
-
|
771 |
-
|
|
|
|
|
772 |
LEFT JOIN ".$wpdb->base_prefix."users AS wpu ON wpac.user_id = wpu.id
|
773 |
-
WHERE recovered_cart=
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
|
|
778 |
$p = new pagination;
|
779 |
-
$p->items($count);
|
780 |
-
$p->limit(10); // Limit entries per page
|
781 |
-
$p->target("admin.php?page=woocommerce_ac_page&action=listcart");
|
782 |
|
783 |
-
if (isset($p->paging)) {
|
784 |
-
|
785 |
}
|
786 |
$p->calculate(); // Calculates what to show
|
787 |
-
$p->parameterName('paging');
|
788 |
-
$p->adjacents(1); //No. of page away from the current page
|
789 |
-
$p->showCounter(true);
|
790 |
|
791 |
-
if(!isset($_GET['paging'])) {
|
792 |
$p->page = 1;
|
793 |
} else {
|
794 |
-
$p->page = $_GET['paging'];
|
795 |
}
|
796 |
|
797 |
//Query for limit paging
|
798 |
$limit = "LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
|
799 |
|
800 |
-
}
|
801 |
-
|
802 |
|
803 |
?>
|
804 |
|
805 |
<div class="tablenav">
|
806 |
<div class='tablenav-pages'>
|
807 |
-
<?php if ($count > 0) echo $p->show(); // Echo out the list of paging. ?>
|
808 |
</div>
|
809 |
</div>
|
810 |
|
811 |
<?php
|
812 |
|
813 |
$order = "";
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
if ( $order == "" )
|
818 |
-
|
819 |
-
|
820 |
-
$order_next = "asc";
|
821 |
}
|
822 |
-
elseif ( $order == "asc" )
|
823 |
-
{
|
824 |
$order_next = "desc";
|
825 |
-
}
|
826 |
-
elseif ( $order == "desc" )
|
827 |
-
{
|
828 |
$order_next = "asc";
|
829 |
}
|
830 |
|
831 |
$order_by = "";
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
$order_by = "abandoned_cart_time";
|
838 |
}
|
839 |
/* Now we use the LIMIT clause to grab a range of rows */
|
840 |
-
|
841 |
-
|
|
|
842 |
LEFT JOIN ".$wpdb->base_prefix."users AS wpu ON wpac.user_id = wpu.id
|
843 |
-
WHERE recovered_cart=
|
844 |
-
ORDER BY
|
845 |
$limit";
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
/* From here you can do whatever you want with the data from the $result link. */
|
850 |
|
851 |
$ac_cutoff_time = json_decode(get_option('woocommerce_ac_settings'));
|
852 |
|
853 |
-
?>
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
<th> <?php _e( 'Actions', 'woocommerce-ac' ); ?> </th>
|
873 |
-
</tr>
|
874 |
|
875 |
<?php
|
876 |
-
foreach ($results as $key => $value)
|
877 |
{
|
878 |
$abandoned_order_id = $value->id;
|
879 |
-
$user_id
|
880 |
-
$user_login
|
881 |
-
$user_email
|
882 |
-
$user_first_name
|
883 |
-
$user_last_name
|
884 |
-
|
885 |
-
$cart_info = json_decode($value->abandoned_cart_info);
|
886 |
|
887 |
$order_date = "";
|
888 |
$cart_update_time = $value->abandoned_cart_time;
|
889 |
-
if ($cart_update_time != "" && $cart_update_time != 0)
|
890 |
-
|
891 |
-
$order_date = date('d M, Y h:i A', $cart_update_time);
|
892 |
}
|
893 |
|
894 |
-
$ac_cutoff_time = json_decode(get_option('woocommerce_ac_settings'));
|
895 |
-
if(isset($ac_cutoff_time[0]->cart_time)) {
|
896 |
-
|
897 |
} else {
|
898 |
-
|
899 |
}
|
900 |
-
$current_time = current_time('timestamp');
|
901 |
-
|
902 |
-
$
|
903 |
-
|
904 |
-
$cart_details = $cart_info->cart;
|
905 |
|
906 |
$line_total = 0;
|
907 |
-
foreach ($cart_details as $k => $v)
|
908 |
{
|
909 |
$line_total = $line_total + $v->line_total;
|
910 |
}
|
911 |
|
912 |
-
if( $value->cart_ignored == 0 && $value->recovered_cart == 0 )
|
913 |
-
{
|
914 |
$ac_status = "Abandoned";
|
915 |
}
|
916 |
-
elseif( $value->cart_ignored == 1 && $value->recovered_cart == 0 )
|
917 |
-
{
|
918 |
$ac_status = "Abandoned but new </br>cart created after this";
|
919 |
-
}
|
920 |
-
else
|
921 |
-
{
|
922 |
$ac_status = "";
|
923 |
}
|
924 |
|
925 |
?>
|
926 |
|
927 |
<?php
|
928 |
-
if ($compare_time > $cut_off_time && $ac_status != "" )
|
929 |
{
|
930 |
-
{
|
931 |
?>
|
932 |
<tr id="row_<?php echo $abandoned_order_id; ?>">
|
933 |
-
<td><strong><?php echo "Abandoned Order #".$abandoned_order_id;?></strong><?php
|
934 |
<td><?php echo get_woocommerce_currency_symbol()." ".$line_total; ?></td>
|
935 |
<td><?php echo $order_date; ?></td>
|
936 |
<td><?php echo $ac_status; ?>
|
@@ -940,203 +904,266 @@ function woocommerce_ac_delete(){
|
|
940 |
|
941 |
</tr>
|
942 |
|
943 |
-
<?php
|
944 |
-
}
|
945 |
}
|
946 |
}
|
947 |
echo "</table>";
|
948 |
-
}
|
949 |
-
|
950 |
-
|
951 |
-
?>
|
952 |
-
|
953 |
-
<p> <?php _e('Add email templates at different intervals to maximize the possibility of recovering your abandoned carts.', 'woocommerce-ac');?> </p>
|
954 |
-
|
955 |
<?php
|
|
|
956 |
// Save the field values
|
957 |
-
if ( isset( $_POST['ac_settings_frm'] ) && $_POST['ac_settings_frm'] == 'save' )
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
if ( $active_post == 1 )
|
963 |
-
|
964 |
-
$
|
965 |
-
|
966 |
-
$
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
979 |
}
|
980 |
-
else
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
998 |
}
|
999 |
}
|
1000 |
}
|
1001 |
|
1002 |
-
if ( isset( $_POST['ac_settings_frm'] ) && $_POST['ac_settings_frm'] == 'update' )
|
1003 |
{
|
1004 |
-
//$active = (empty($_POST['is_active'])) ? '0' : '1';
|
1005 |
$active = 1;
|
1006 |
if ( $active == 1 )
|
1007 |
-
{
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1011 |
if (count($check_results) == 0 )
|
1012 |
{
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1023 |
}
|
1024 |
-
else
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1042 |
}
|
1043 |
}
|
1044 |
}
|
1045 |
|
1046 |
-
if ( $action == 'emailtemplates' && $mode == 'removetemplate' )
|
1047 |
-
|
1048 |
-
|
1049 |
-
$query_remove = "DELETE FROM `".$wpdb->prefix."ac_email_templates_lite` WHERE id=
|
1050 |
-
$wpdb->query($query_remove);
|
1051 |
}
|
1052 |
|
1053 |
-
if ( isset( $_POST['ac_settings_frm'] ) && $_POST['ac_settings_frm'] == 'save' ) { ?>
|
1054 |
<div id="message" class="updated fade"><p><strong><?php _e( 'The Email Template has been successfully added.', 'woocommerce-ac' ); ?></strong></p></div>
|
1055 |
<?php }
|
1056 |
-
if ( isset( $_POST['ac_settings_frm'] ) && $_POST['ac_settings_frm'] == 'update' ) { ?>
|
1057 |
<div id="message" class="updated fade"><p><strong><?php _e( 'The Email Template has been successfully updated.', 'woocommerce-ac' ); ?></strong></p></div>
|
1058 |
<?php }?>
|
1059 |
|
1060 |
<div class="tablenav">
|
1061 |
<p style="float:left;">
|
1062 |
-
<input type="button" value="+ Add New Template" id="add_new_template" onclick="location.href='admin.php?page=woocommerce_ac_page&action=emailtemplates&mode=addnewtemplate';" style="font-weight: bold; color: green; font-size: 18px; cursor: pointer;">
|
1063 |
-
<!--<a href="admin.php?page=woocommerce_ac_page&action=emailtemplates&mode=addnewtemplate">Add New Template</a>-->
|
1064 |
</p>
|
1065 |
|
1066 |
<?php
|
1067 |
-
include_once(
|
1068 |
|
1069 |
/* Find the number of rows returned from a query; Note: Do NOT use a LIMIT clause in this query */
|
1070 |
-
$wpdb->get_results("SELECT wpet . *
|
1071 |
-
|
1072 |
-
|
1073 |
|
1074 |
-
|
1075 |
|
1076 |
-
if($count > 0) {
|
1077 |
$p = new pagination;
|
1078 |
-
$p->items($count);
|
1079 |
-
$p->limit(10); // Limit entries per page
|
1080 |
-
$p->target("admin.php?page=woocommerce_ac_page&action=emailtemplates");
|
1081 |
-
if (isset($p->paging))
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
|
|
1085 |
$p->calculate(); // Calculates what to show
|
1086 |
-
$p->parameterName('paging');
|
1087 |
-
$p->adjacents(1); //No. of page away from the current page
|
1088 |
-
$p->showCounter(true);
|
1089 |
|
1090 |
-
if(!isset($_GET['paging'])) {
|
1091 |
$p->page = 1;
|
1092 |
} else {
|
1093 |
-
$p->page = $_GET['paging'];
|
1094 |
}
|
1095 |
|
1096 |
//Query for limit paging
|
1097 |
-
$limit = "LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
|
1098 |
|
1099 |
}
|
1100 |
-
|
1101 |
|
1102 |
?>
|
1103 |
|
1104 |
<div class='tablenav-pages'>
|
1105 |
-
<?php if ($count>0) echo $p->show(); // Echo out the list of paging. ?>
|
1106 |
</div>
|
1107 |
</div>
|
1108 |
|
1109 |
<?php
|
1110 |
|
1111 |
$order = "";
|
1112 |
-
if (isset($_GET['order']))
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
|
|
1116 |
$order_next = "desc";
|
1117 |
-
}
|
1118 |
-
elseif ( $order == "asc" )
|
1119 |
-
{
|
1120 |
$order_next = "desc";
|
1121 |
-
}
|
1122 |
-
elseif ( $order == "desc" )
|
1123 |
-
{
|
1124 |
$order_next = "asc";
|
1125 |
}
|
1126 |
|
1127 |
$order_by = "";
|
1128 |
-
if (isset($_GET['orderby']))
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
|
|
1132 |
}
|
1133 |
|
1134 |
-
$query = "SELECT wpet . *
|
1135 |
-
FROM `".$wpdb->prefix."ac_email_templates_lite` AS wpet
|
1136 |
-
ORDER BY
|
1137 |
$limit";
|
1138 |
-
$results = $wpdb->get_results( $query );
|
1139 |
-
|
1140 |
/* From here you can do whatever you want with the data from the $result link. */
|
1141 |
?>
|
1142 |
|
@@ -1160,10 +1187,13 @@ function woocommerce_ac_delete(){
|
|
1160 |
</tr>
|
1161 |
|
1162 |
<?php
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
|
|
|
|
|
|
1167 |
{
|
1168 |
$id = $value->id;
|
1169 |
|
@@ -1176,105 +1206,103 @@ function woocommerce_ac_delete(){
|
|
1176 |
{
|
1177 |
$active = "No";
|
1178 |
}
|
1179 |
-
$frequency
|
1180 |
$day_or_hour = $value->day_or_hour;
|
1181 |
?>
|
1182 |
|
1183 |
<tr id="row_<?php echo $id; ?>">
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
<td>
|
1190 |
<a href="admin.php?page=woocommerce_ac_page&action=emailtemplates&mode=edittemplate&id=<?php echo $id; ?>"> <img src="<?php echo plugins_url(); ?>/woocommerce-abandoned-cart/images/edit.png" alt="Edit" title="Edit" width="20" height="20"> </a>
|
1191 |
<a href="#" onclick="delete_email_template( <?php echo $id; ?> )" > <img src="<?php echo plugins_url(); ?>/woocommerce-abandoned-cart/images/delete.png" alt="Delete" title="Delete" width="20" height="20"> </a>
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
</tr>
|
1196 |
|
1197 |
<?php
|
1198 |
$i++;
|
1199 |
}
|
1200 |
echo "</table>";
|
1201 |
-
//echo "</p>";
|
1202 |
|
1203 |
}
|
1204 |
elseif ($action == 'stats' || $action == '')
|
1205 |
-
{
|
1206 |
-
|
1207 |
?>
|
1208 |
<p>
|
1209 |
<script language='javascript'>
|
1210 |
-
jQuery(document).ready(function()
|
1211 |
-
{
|
1212 |
-
jQuery('#duration_select').change(function()
|
1213 |
-
{
|
1214 |
-
var group_name = jQuery('#duration_select').val();
|
1215 |
-
var today = new Date();
|
1216 |
-
var start_date = "";
|
1217 |
-
var end_date = "";
|
1218 |
-
if ( group_name == "yesterday")
|
1219 |
-
{
|
1220 |
-
start_date = new Date(today.getFullYear(), today.getMonth(), today.getDate() - 1);
|
1221 |
-
end_date = new Date(today.getFullYear(), today.getMonth(), today.getDate() - 1);
|
1222 |
-
}
|
1223 |
-
else if ( group_name == "today")
|
1224 |
-
{
|
1225 |
-
start_date = new Date(today.getFullYear(), today.getMonth(), today.getDate());
|
1226 |
-
end_date = new Date(today.getFullYear(), today.getMonth(), today.getDate());
|
1227 |
-
}
|
1228 |
-
else if ( group_name == "last_seven")
|
1229 |
-
{
|
1230 |
-
start_date = new Date(today.getFullYear(), today.getMonth(), today.getDate() - 7);
|
1231 |
-
end_date = new Date(today.getFullYear(), today.getMonth(), today.getDate());
|
1232 |
-
}
|
1233 |
-
else if ( group_name == "last_fifteen")
|
1234 |
-
{
|
1235 |
-
start_date = new Date(today.getFullYear(), today.getMonth(), today.getDate() - 15);
|
1236 |
-
end_date = new Date(today.getFullYear(), today.getMonth(), today.getDate());
|
1237 |
-
}
|
1238 |
-
else if ( group_name == "last_thirty")
|
1239 |
-
{
|
1240 |
-
start_date = new Date(today.getFullYear(), today.getMonth(), today.getDate() - 30);
|
1241 |
-
end_date = new Date(today.getFullYear(), today.getMonth(), today.getDate());
|
1242 |
-
}
|
1243 |
-
else if ( group_name == "last_ninety")
|
1244 |
{
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1264 |
});
|
1265 |
</script>
|
1266 |
<?php
|
1267 |
|
1268 |
-
if (isset($_POST['duration_select']))
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
|
|
|
|
|
|
|
|
1273 |
}
|
1274 |
if ($duration_range == "") $duration_range = "last_seven";
|
1275 |
-
//global $this->duration_range_select,$this->start_end_dates;
|
1276 |
|
1277 |
-
|
1278 |
_e( 'The Report below shows how many Abandoned Carts we were able to recover for you by sending automatic emails to encourage shoppers.', 'woocommerce-ac');
|
1279 |
?>
|
1280 |
<div id="recovered_stats" class="postbox" style="display:block">
|
@@ -1286,46 +1314,48 @@ function woocommerce_ac_delete(){
|
|
1286 |
foreach ( $this->duration_range_select as $key => $value )
|
1287 |
{
|
1288 |
$sel = "";
|
1289 |
-
if ($key == $duration_range)
|
1290 |
-
{
|
1291 |
$sel = " selected ";
|
1292 |
}
|
1293 |
echo"<option value='$key' $sel> $value </option>";
|
1294 |
}
|
1295 |
|
1296 |
-
$date_sett = $this->start_end_dates[$duration_range];
|
1297 |
|
1298 |
?>
|
1299 |
</select>
|
1300 |
|
1301 |
<script type="text/javascript">
|
1302 |
-
jQuery(document).ready(function()
|
1303 |
{
|
1304 |
-
|
1305 |
-
|
1306 |
});
|
1307 |
|
1308 |
-
jQuery(document).ready(function()
|
1309 |
{
|
1310 |
-
|
1311 |
-
|
1312 |
});
|
1313 |
</script>
|
1314 |
-
|
1315 |
-
|
1316 |
<?php
|
1317 |
|
1318 |
-
if (isset($_POST['start_date']))
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
|
|
|
|
1323 |
}
|
1324 |
-
if (isset($_POST['end_date']))
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
|
|
|
|
1329 |
}
|
1330 |
|
1331 |
?>
|
@@ -1343,44 +1373,41 @@ function woocommerce_ac_delete(){
|
|
1343 |
<?php
|
1344 |
|
1345 |
global $wpdb;
|
1346 |
-
$start_date = strtotime($start_date_range." 00:01:01");
|
1347 |
-
$end_date
|
1348 |
|
1349 |
-
include_once(
|
1350 |
|
1351 |
/* Find the number of rows returned from a query; Note: Do NOT use a LIMIT clause in this query */
|
1352 |
-
|
1353 |
-
$wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "ac_abandoned_cart_history_lite
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
|
1360 |
-
if($count > 0) {
|
1361 |
$p = new pagination;
|
1362 |
-
$p->items($count);
|
1363 |
-
$p->limit(10); // Limit entries per page
|
1364 |
-
$p->target("admin.php?page=woocommerce_ac_page&action=stats&duration_select=$duration_range");
|
1365 |
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
}
|
1370 |
$p->calculate(); // Calculates what to show
|
1371 |
-
$p->parameterName('paging');
|
1372 |
-
$p->adjacents(1); //No. of page away from the current page
|
1373 |
-
$p->showCounter(true);
|
1374 |
|
1375 |
-
if(!isset($_GET['paging'])) {
|
1376 |
$p->page = 1;
|
1377 |
} else {
|
1378 |
-
$p->page = $_GET['paging'];
|
1379 |
}
|
1380 |
-
|
1381 |
-
|
1382 |
-
$limit = "LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
|
1383 |
-
|
1384 |
}
|
1385 |
else
|
1386 |
$limit = "";
|
@@ -1388,60 +1415,59 @@ function woocommerce_ac_delete(){
|
|
1388 |
|
1389 |
<div class="tablenav">
|
1390 |
<div class='tablenav-pages'>
|
1391 |
-
<?php if ($count>0) echo $p->show(); // Echo out the list of paging. ?>
|
1392 |
</div>
|
1393 |
</div>
|
1394 |
|
1395 |
<?php
|
1396 |
|
1397 |
$order = "";
|
1398 |
-
if (isset($_GET['order']))
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
elseif ( $order == "asc" )
|
1405 |
-
|
1406 |
-
|
1407 |
-
}
|
1408 |
-
elseif ( $order == "desc" )
|
1409 |
{
|
1410 |
-
|
1411 |
}
|
1412 |
|
1413 |
$order_by = "";
|
1414 |
-
if (isset($_GET['orderby']))
|
1415 |
-
|
1416 |
-
|
1417 |
-
|
|
|
1418 |
}
|
1419 |
|
1420 |
-
$
|
1421 |
-
|
1422 |
-
|
1423 |
-
AND
|
1424 |
-
|
1425 |
-
|
1426 |
-
|
|
|
1427 |
$query_ac_carts = "SELECT * FROM " . $wpdb->prefix . "ac_abandoned_cart_history_lite
|
1428 |
-
WHERE abandoned_cart_time >=
|
1429 |
-
AND abandoned_cart_time <= "
|
1430 |
-
$ac_carts_results = $wpdb->get_results(
|
1431 |
|
1432 |
$recovered_item = $recovered_total = $count_carts = $total_value = $order_total = 0;
|
1433 |
-
foreach ( $ac_carts_results as $key => $value)
|
1434 |
{
|
1435 |
-
|
1436 |
-
//if( $value->recovered_cart == 0 )
|
1437 |
{
|
1438 |
$count_carts += 1;
|
1439 |
|
1440 |
-
$cart_detail
|
1441 |
$product_details = $cart_detail->cart;
|
1442 |
|
1443 |
$line_total = 0;
|
1444 |
-
foreach ($product_details as $k => $v)
|
1445 |
{
|
1446 |
$line_total = $line_total + $v->line_total;
|
1447 |
}
|
@@ -1450,36 +1476,35 @@ function woocommerce_ac_delete(){
|
|
1450 |
}
|
1451 |
}
|
1452 |
$table_data = "";
|
1453 |
-
foreach ( $ac_results as $key => $value)
|
1454 |
{
|
1455 |
if( $value->recovered_cart != 0 )
|
1456 |
{
|
1457 |
-
$recovered_id
|
1458 |
-
$rec_order
|
1459 |
-
$woo_order
|
1460 |
-
$recovered_date
|
1461 |
-
$recovered_date_new = date('d M, Y h:i A', $recovered_date);
|
1462 |
-
$recovered_item
|
1463 |
-
if (isset($rec_order['_order_total'][0])) {
|
1464 |
-
$recovered_total
|
1465 |
}
|
1466 |
-
$abandoned_date = date('d M, Y h:i A', $value->abandoned_cart_time);
|
1467 |
|
1468 |
-
$
|
1469 |
-
|
1470 |
-
$billing_first_name
|
1471 |
-
$recovered_order_total
|
1472 |
-
if (isset($rec_order['_billing_first_name'][0])) {
|
1473 |
-
$billing_first_name
|
1474 |
}
|
1475 |
-
if (isset($rec_order['_billing_last_name'][0])) {
|
1476 |
-
$billing_last_name
|
1477 |
}
|
1478 |
-
if (isset($rec_order['_billing_email'][0])) {
|
1479 |
-
$billing_email
|
1480 |
}
|
1481 |
-
if (isset($rec_order['_order_total'][0])) {
|
1482 |
-
$recovered_order_total = $rec_order['_order_total'][0];
|
1483 |
}
|
1484 |
|
1485 |
$table_data .="<tr>
|
@@ -1494,7 +1519,7 @@ function woocommerce_ac_delete(){
|
|
1494 |
?>
|
1495 |
<div id="recovered_stats" class="postbox" style="display:block">
|
1496 |
<div class="inside" >
|
1497 |
-
|
1498 |
</div>
|
1499 |
</div>
|
1500 |
|
@@ -1518,37 +1543,46 @@ function woocommerce_ac_delete(){
|
|
1518 |
</tr>
|
1519 |
<?php
|
1520 |
echo $table_data;
|
1521 |
-
print('</table>');
|
1522 |
}
|
1523 |
|
1524 |
-
if (isset($_GET['action']))
|
1525 |
-
|
1526 |
-
|
1527 |
-
if ( $
|
|
|
|
|
|
|
1528 |
{
|
1529 |
-
if($mode=='edittemplate')
|
1530 |
-
{
|
1531 |
-
$edit_id
|
1532 |
-
|
1533 |
-
$
|
|
|
1534 |
}
|
1535 |
|
1536 |
-
$active_post = (empty($_POST['is_active'])) ? '0' : '1';
|
1537 |
|
1538 |
?>
|
1539 |
|
1540 |
<div id="content">
|
1541 |
<form method="post" action="admin.php?page=woocommerce_ac_page&action=emailtemplates" id="ac_settings">
|
1542 |
-
|
1543 |
-
|
1544 |
-
|
|
|
|
|
|
|
|
|
|
|
1545 |
|
1546 |
<?php
|
1547 |
-
$button_mode
|
1548 |
$display_message = "Add Email Template";
|
1549 |
if ( $mode == 'edittemplate' )
|
1550 |
{
|
1551 |
-
$button_mode
|
1552 |
$display_message = "Edit Email Template";
|
1553 |
}
|
1554 |
print'<input type="hidden" name="ac_settings_frm" value="'.$button_mode.'">';?>
|
@@ -1580,15 +1614,15 @@ function woocommerce_ac_delete(){
|
|
1580 |
</th>
|
1581 |
<td>
|
1582 |
<?php
|
1583 |
-
$from_name="Admin";
|
1584 |
-
if ( $mode == 'edittemplate')
|
1585 |
{
|
1586 |
$from_name=$results[0]->from_name;
|
1587 |
}
|
1588 |
|
1589 |
print'<input type="text" name="woocommerce_ac_from_name" id="woocommerce_ac_from_name" class="regular-text" value="'.$from_name.'">';?>
|
1590 |
<img class="help_tip" width="16" height="16" data-tip='<?php _e('Enter the name that should appear in the email sent', 'woocommerce-ac') ?>' src="<?php echo plugins_url(); ?>/woocommerce/assets/images/help.png" /></p>
|
1591 |
-
|
1592 |
</tr>
|
1593 |
|
1594 |
<tr>
|
@@ -1597,15 +1631,15 @@ function woocommerce_ac_delete(){
|
|
1597 |
</th>
|
1598 |
<td>
|
1599 |
<?php
|
1600 |
-
$subject_edit="";
|
1601 |
-
if ( $mode == 'edittemplate')
|
1602 |
{
|
1603 |
$subject_edit=$results[0]->subject;
|
1604 |
}
|
1605 |
|
1606 |
print'<input type="text" name="woocommerce_ac_email_subject" id="woocommerce_ac_email_subject" class="regular-text" value="'.$subject_edit.'">';?>
|
1607 |
<img class="help_tip" width="16" height="16" data-tip='<?php _e('Enter the subject that should appear in the email sent', 'woocommerce-ac') ?>' src="<?php echo plugins_url(); ?>/woocommerce/assets/images/help.png" /></p>
|
1608 |
-
|
1609 |
</tr>
|
1610 |
|
1611 |
<tr>
|
@@ -1615,16 +1649,16 @@ function woocommerce_ac_delete(){
|
|
1615 |
<td>
|
1616 |
|
1617 |
<?php
|
1618 |
-
$initial_data = ""
|
1619 |
-
if ( $mode == 'edittemplate')
|
1620 |
{
|
1621 |
-
$initial_data = $results[0]->body;
|
1622 |
}
|
1623 |
|
1624 |
echo "<textarea id='woocommerce_ac_email_body' name='woocommerce_ac_email_body' rows='15'' cols='80'>".$initial_data."</textarea>";
|
1625 |
?>
|
1626 |
|
1627 |
-
|
1628 |
<span class="description"><?php
|
1629 |
echo __( 'Message to be sent in the reminder email.', 'woocommerce-ac' );
|
1630 |
?></span>
|
@@ -1640,13 +1674,13 @@ function woocommerce_ac_delete(){
|
|
1640 |
<select name="email_frequency" id="email_frequency">
|
1641 |
|
1642 |
<?php
|
1643 |
-
$frequency_edit="";
|
1644 |
if( $mode == 'edittemplate')
|
1645 |
{
|
1646 |
-
$frequency_edit
|
1647 |
}
|
1648 |
|
1649 |
-
for ($i=1
|
1650 |
{
|
1651 |
printf( "<option %s value='%s'>%s</option>\n",
|
1652 |
selected( $i, $frequency_edit, false ),
|
@@ -1665,13 +1699,14 @@ function woocommerce_ac_delete(){
|
|
1665 |
$days_or_hours_edit = "";
|
1666 |
if ( $mode == 'edittemplate')
|
1667 |
{
|
1668 |
-
$days_or_hours_edit
|
1669 |
}
|
1670 |
|
1671 |
-
$days_or_hours=array(
|
1672 |
-
'Days'
|
1673 |
-
'Hours' => 'Hour(s)'
|
1674 |
-
|
|
|
1675 |
{
|
1676 |
printf( "<option %s value='%s'>%s</option>\n",
|
1677 |
selected( $k, $days_or_hours_edit, false ),
|
@@ -1682,8 +1717,7 @@ function woocommerce_ac_delete(){
|
|
1682 |
?>
|
1683 |
|
1684 |
</select>
|
1685 |
-
|
1686 |
-
|
1687 |
<span class="description"><?php
|
1688 |
echo __( 'after cart is abandoned.', 'woocommerce-ac' );
|
1689 |
?></span>
|
@@ -1703,9 +1737,7 @@ function woocommerce_ac_delete(){
|
|
1703 |
</p>
|
1704 |
|
1705 |
</td>
|
1706 |
-
</tr>
|
1707 |
-
|
1708 |
-
|
1709 |
</table>
|
1710 |
</div>
|
1711 |
</div>
|
@@ -1722,46 +1754,39 @@ function woocommerce_ac_delete(){
|
|
1722 |
</form>
|
1723 |
</div>
|
1724 |
<?php
|
1725 |
-
}
|
1726 |
-
|
1727 |
-
|
1728 |
-
|
1729 |
}
|
1730 |
|
1731 |
-
}
|
1732 |
-
|
1733 |
-
|
1734 |
-
////////////////////////////////////////////////////////////////
|
1735 |
|
1736 |
function my_action_javascript()
|
1737 |
{
|
1738 |
?>
|
1739 |
<script type="text/javascript" >
|
1740 |
-
jQuery(document).ready(function($)
|
1741 |
{
|
1742 |
-
$("table#cart_data a.remove_cart").click(function()
|
1743 |
{
|
1744 |
-
|
1745 |
-
|
1746 |
-
if(y==true)
|
1747 |
{
|
1748 |
-
var passed_id
|
1749 |
-
var arr
|
1750 |
var abandoned_order_id = arr[0];
|
1751 |
-
var user_id
|
1752 |
-
var data
|
1753 |
-
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
|
1758 |
// since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
|
1759 |
-
$.post(ajaxurl, data, function(response)
|
1760 |
{
|
1761 |
//alert('Got this from the server: ' + response);
|
1762 |
-
$("#row_" + abandoned_order_id).hide();
|
1763 |
});
|
1764 |
-
|
1765 |
});
|
1766 |
});
|
1767 |
</script>
|
@@ -1773,50 +1798,46 @@ function woocommerce_ac_delete(){
|
|
1773 |
|
1774 |
global $wpdb; // this is how you get access to the database
|
1775 |
|
1776 |
-
$abandoned_order_id = $_POST['abandoned_order_id'];
|
1777 |
-
$user_id
|
1778 |
-
$action
|
1779 |
|
1780 |
-
$query = "DELETE FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
1781 |
-
|
1782 |
-
|
1783 |
-
//echo $query;
|
1784 |
-
$results = $wpdb->get_results( $query );
|
1785 |
|
|
|
1786 |
die();
|
1787 |
}
|
1788 |
|
1789 |
-
//////////////////////////////////////////////////////////////
|
1790 |
-
|
1791 |
function my_action_send_preview()
|
1792 |
{
|
1793 |
?>
|
1794 |
<script type="text/javascript" >
|
1795 |
|
1796 |
-
jQuery(document).ready(function($)
|
1797 |
{
|
1798 |
-
$("table#addedit_template input#preview_email").click(function()
|
1799 |
{
|
1800 |
-
|
1801 |
-
var from_name_preview
|
1802 |
-
var subject_email_preview = $('#woocommerce_ac_email_subject').val();
|
1803 |
-
var body_email_preview
|
1804 |
-
var send_email_id
|
1805 |
-
var data
|
1806 |
-
|
1807 |
-
|
1808 |
-
|
1809 |
-
|
1810 |
-
|
1811 |
-
};
|
1812 |
-
|
1813 |
|
1814 |
// since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
|
1815 |
-
$.post(ajaxurl, data, function(response)
|
1816 |
{
|
1817 |
-
$("#preview_email_sent_msg").html("<img src='<?php echo plugins_url(); ?>/woocommerce-abandoned-cart/images/check.jpg'> Email has been sent successfully.");
|
1818 |
-
$("#preview_email_sent_msg").fadeIn();
|
1819 |
-
setTimeout(function(){$("#preview_email_sent_msg").fadeOut();},3000);
|
1820 |
//alert('Got this from the server: ' + response);
|
1821 |
});
|
1822 |
});
|
@@ -1827,12 +1848,12 @@ function woocommerce_ac_delete(){
|
|
1827 |
|
1828 |
function preview_email_sent() {
|
1829 |
|
1830 |
-
$from_email_name
|
1831 |
-
$subject_email_preview = $_POST['subject_email_preview'];
|
1832 |
-
$body_email_preview
|
1833 |
-
$body_email_preview
|
1834 |
-
$body_email_preview
|
1835 |
-
$body_email_preview
|
1836 |
|
1837 |
$var = '<h3>'.__( "Your Shopping Cart", "woocommerce-ac" ).'</h3>
|
1838 |
<table border="0" cellpadding="10" cellspacing="0" class="templateDataTable">
|
@@ -1866,35 +1887,29 @@ function woocommerce_ac_delete(){
|
|
1866 |
</tr>
|
1867 |
</table>';
|
1868 |
|
1869 |
-
$body_email_preview = str_replace('{{products.cart}}', $var, $body_email_preview);
|
1870 |
-
if (isset($_POST['send_email_id'])) {
|
1871 |
-
$to_email_preview = $_POST['send_email_id'];
|
1872 |
} else {
|
1873 |
$to_email_preview = "";
|
1874 |
-
|
1875 |
-
$user_email_from = get_option('admin_email');
|
1876 |
$headers[] = "From: ".$from_email_name." <".$user_email_from.">"."\r\n";
|
1877 |
$headers[] = "Content-Type: text/html"."\r\n";
|
1878 |
|
1879 |
-
$body_email_final_preview = stripslashes($body_email_preview);
|
1880 |
wp_mail( $to_email_preview, $subject_email_preview, __( $body_email_final_preview, 'woocommerce-ac' ), $headers );
|
1881 |
|
1882 |
echo "email sent";
|
1883 |
|
1884 |
die();
|
1885 |
-
}
|
1886 |
-
|
1887 |
-
/////////////////////////////////////////////////////////////////////////////////
|
1888 |
-
|
1889 |
-
|
1890 |
-
|
1891 |
-
|
1892 |
}
|
1893 |
|
1894 |
}
|
1895 |
|
1896 |
$woocommerce_abandon_cart = new woocommerce_abandon_cart();
|
1897 |
|
1898 |
-
|
1899 |
|
1900 |
?>
|
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: 2.0.1
|
7 |
Author: Tyche Softwares
|
8 |
Author URI: http://www.tychesoftwares.com/
|
9 |
*/
|
10 |
|
|
|
11 |
// Deletion Settings
|
12 |
+
register_uninstall_hook( __FILE__, 'woocommerce_ac_delete' );
|
13 |
|
14 |
// Add a new interval of 5 minutes
|
15 |
add_filter( 'cron_schedules', 'woocommerce_ac_add_cron_schedule' );
|
17 |
function woocommerce_ac_add_cron_schedule( $schedules ) {
|
18 |
|
19 |
$schedules['5_minutes'] = array(
|
20 |
+
'interval' => 300 , // 5 minutes in seconds
|
21 |
+
'display' => __( 'Once Every Five Minutes' ),
|
22 |
);
|
23 |
return $schedules;
|
24 |
}
|
39 |
global $wpdb;
|
40 |
$table_name_ac_abandoned_cart_history = $wpdb->prefix . "ac_abandoned_cart_history_lite";
|
41 |
$sql_ac_abandoned_cart_history = "DROP TABLE " . $table_name_ac_abandoned_cart_history ;
|
42 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
43 |
+
$wpdb->get_results( $sql_ac_abandoned_cart_history );
|
44 |
|
45 |
$table_name_ac_email_templates = $wpdb->prefix . "ac_email_templates_lite";
|
46 |
$sql_ac_email_templates = "DROP TABLE " . $table_name_ac_email_templates ;
|
47 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
48 |
+
$wpdb->get_results( $sql_ac_email_templates );
|
49 |
|
50 |
$table_name_ac_sent_history = $wpdb->prefix . "ac_sent_history_lite";
|
51 |
$sql_ac_sent_history = "DROP TABLE " . $table_name_ac_sent_history ;
|
52 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
53 |
+
$wpdb->get_results( $sql_ac_sent_history );
|
54 |
|
55 |
+
$query = "SELECT blog_id FROM `".$wpdb->prefix."blogs`";
|
56 |
$results = $wpdb->get_results( $query );
|
57 |
|
58 |
foreach( $results as $key => $value ) {
|
59 |
|
60 |
$table_name_ac_abandoned_cart_history = $wpdb->prefix .$value->blog_id."_"."ac_abandoned_cart_history_lite";
|
61 |
$sql_ac_abandoned_cart_history = "DROP TABLE " . $table_name_ac_abandoned_cart_history ;
|
62 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
63 |
+
$wpdb->get_results( $sql_ac_abandoned_cart_history );
|
64 |
|
65 |
$table_name_ac_email_templates = $wpdb->prefix .$value->blog_id."_"."ac_email_templates_lite";
|
66 |
$sql_ac_email_templates = "DROP TABLE " . $table_name_ac_email_templates ;
|
67 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
68 |
+
$wpdb->get_results( $sql_ac_email_templates );
|
69 |
|
70 |
$table_name_ac_sent_history = $wpdb->prefix .$value->blog_id."_"."ac_sent_history_lite";
|
71 |
$sql_ac_sent_history = "DROP TABLE " . $table_name_ac_sent_history ;
|
72 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
73 |
+
$wpdb->get_results( $sql_ac_sent_history );
|
74 |
|
75 |
}
|
76 |
|
78 |
delete_option ( 'woocommerce_ac_settings' );
|
79 |
|
80 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
/**
|
82 |
* woocommerce_abandon_cart class
|
83 |
**/
|
84 |
+
if ( !class_exists( 'woocommerce_abandon_cart' ) ) {
|
85 |
|
86 |
class woocommerce_abandon_cart {
|
87 |
|
93 |
var $one_week;
|
94 |
|
95 |
var $duration_range_select = array();
|
96 |
+
var $start_end_dates = array();
|
97 |
|
98 |
public function __construct() {
|
99 |
|
100 |
+
$this->one_hour = 60 * 60;
|
101 |
+
$this->three_hours = 3 * $this->one_hour;
|
102 |
+
$this->six_hours = 6 * $this->one_hour;
|
103 |
$this->twelve_hours = 12 * $this->one_hour;
|
104 |
+
$this->one_day = 24 * $this->one_hour;
|
105 |
+
$this->one_week = 7 * $this->one_day;
|
106 |
|
107 |
+
$this->duration_range_select = array( 'yesterday' => 'Yesterday',
|
108 |
+
'today' => 'Today',
|
109 |
+
'last_seven' => 'Last 7 days',
|
110 |
+
'last_fifteen' => 'Last 15 days',
|
111 |
+
'last_thirty' => 'Last 30 days',
|
112 |
+
'last_ninety' => 'Last 90 days',
|
113 |
+
'last_year_days' => 'Last 365'
|
114 |
+
);
|
115 |
|
116 |
+
$this->start_end_dates = array( 'yesterday' => array( 'start_date' => date( "d M Y", ( current_time( 'timestamp' ) - 24*60*60 ) ),
|
117 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) - 7*24*60*60 ) ) ),
|
118 |
+
'today' => array( 'start_date' => date( "d M Y", ( current_time( 'timestamp' ) ) ),
|
119 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) ) ) ),
|
120 |
+
'last_seven' => array( 'start_date' => date( "d M Y", ( current_time( 'timestamp' ) - 7*24*60*60 ) ),
|
121 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) ) ) ),
|
122 |
+
'last_fifteen' => array( 'start_date' => date( "d M Y", ( current_time( 'timestamp' ) - 15*24*60*60 ) ),
|
123 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) ) ) ),
|
124 |
+
'last_thirty' => array( 'start_date' => date( "d M Y", ( current_time( 'timestamp' ) - 30*24*60*60 ) ),
|
125 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) ) ) ),
|
126 |
+
'last_ninety' => array( 'start_date' => date( "d M Y", ( current_time( 'timestamp' ) - 90*24*60*60 ) ),
|
127 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) ) ) ),
|
128 |
+
'last_year_days' => array( 'start_date' => date( "d M Y", ( current_time( 'timestamp' ) - 365*24*60*60 ) ),
|
129 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) ) ) )
|
130 |
+
);
|
131 |
|
132 |
|
133 |
// Initialize settings
|
134 |
+
register_activation_hook ( __FILE__, array( &$this, 'woocommerce_ac_activate' ) );
|
135 |
|
136 |
// WordPress Administration Menu
|
137 |
+
add_action ( 'admin_menu', array( &$this, 'woocommerce_ac_admin_menu' ) );
|
138 |
|
139 |
// Actions to be done on cart update
|
140 |
+
add_action ( 'woocommerce_cart_updated', array( &$this, 'woocommerce_ac_store_cart_timestamp' ) );
|
141 |
|
142 |
// delete added temp fields after order is placed
|
143 |
+
add_filter ( 'woocommerce_order_details_after_order_table', array( &$this, 'action_after_delivery_session' ) );
|
144 |
|
145 |
+
add_action ( 'admin_init', array( &$this, 'action_admin_init' ) );
|
146 |
+
add_action ( 'admin_init', array( &$this, 'ac_lite_update_db_check' ) );
|
147 |
|
148 |
// Language Translation
|
149 |
+
add_action ( 'init', array( &$this, 'update_po_file' ) );
|
150 |
|
151 |
//Discount Coupon Notice
|
152 |
+
add_action ( 'admin_notices', array( &$this, 'ac_lite_coupon_notice' ) );
|
153 |
|
154 |
+
add_action ( 'admin_enqueue_scripts', array( &$this, 'my_enqueue_scripts_js' ) );
|
155 |
+
add_action ( 'admin_enqueue_scripts', array( &$this, 'my_enqueue_scripts_css' ) );
|
156 |
|
157 |
+
if ( is_admin() ) {
|
158 |
+
if ( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] == "woocommerce_ac_page" ) {
|
159 |
+
add_action ( 'admin_head', array( &$this, 'tinyMCE_ac' ) );
|
|
|
|
|
160 |
}
|
161 |
|
162 |
// Load "admin-only" scripts here
|
163 |
+
add_action ( 'admin_head', array( &$this, 'my_action_javascript' ) );
|
164 |
+
add_action ( 'wp_ajax_remove_cart_data', array( &$this, 'remove_cart_data' ) );
|
165 |
|
166 |
+
add_action ( 'admin_head', array( &$this, 'my_action_send_preview' ) );
|
167 |
+
add_action ( 'wp_ajax_preview_email_sent', array( &$this, 'preview_email_sent' ) );
|
168 |
|
169 |
}
|
170 |
|
175 |
/*-----------------------------------------------------------------------------------*/
|
176 |
|
177 |
// Language Translation
|
178 |
+
function update_po_file() {
|
179 |
$domain = 'woocommerce-ac';
|
180 |
$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
|
181 |
if ( $loaded = load_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . $domain . '-' . $locale . '.mo' ) ) {
|
182 |
return $loaded;
|
183 |
} else {
|
184 |
+
load_plugin_textdomain( $domain, FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
|
185 |
+
}
|
|
|
186 |
}
|
187 |
|
188 |
function ac_lite_coupon_notice() {
|
189 |
|
190 |
+
if ( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] == "woocommerce_ac_page" ) {
|
191 |
+
?>
|
192 |
+
<div class = "updated">
|
193 |
+
<p><?php _e( 'You can upgrade to the <a href = "https://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro/">PRO version of WooCommerce Abandoned Cart plugin</a> at a <b>20% discount</b>. Use the coupon code: <b>ACPRO20</b>.<a href="https://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro/"> Purchase now </a> & save $24!', 'woocommerce-ac' ); ?></p>
|
194 |
+
</div>
|
195 |
+
<?php
|
196 |
+
}
|
197 |
}
|
198 |
/*-----------------------------------------------------------------------------------*/
|
199 |
/* Class Functions */
|
200 |
+
/*-----------------------------------------------------------------------------------*/
|
201 |
+
|
|
|
|
|
|
|
202 |
function woocommerce_ac_activate() {
|
203 |
|
204 |
global $wpdb;
|
206 |
$table_name = $wpdb->prefix . "ac_email_templates_lite";
|
207 |
|
208 |
$sql = "CREATE TABLE IF NOT EXISTS $table_name (
|
209 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
210 |
+
`subject` text COLLATE utf8_unicode_ci NOT NULL,
|
211 |
+
`body` mediumtext COLLATE utf8_unicode_ci NOT NULL,
|
212 |
+
`is_active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL,
|
213 |
+
`frequency` int(11) NOT NULL,
|
214 |
+
`day_or_hour` enum('Days','Hours') COLLATE utf8_unicode_ci NOT NULL,
|
215 |
+
`template_name` text COLLATE utf8_unicode_ci NOT NULL,
|
216 |
+
`from_name` text COLLATE utf8_unicode_ci NOT NULL,
|
217 |
+
PRIMARY KEY (`id`)
|
218 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ";
|
219 |
+
|
220 |
+
require_once ( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
221 |
+
dbDelta( $sql );
|
222 |
|
223 |
$sent_table_name = $wpdb->prefix . "ac_sent_history_lite";
|
224 |
|
225 |
$sql_query = "CREATE TABLE IF NOT EXISTS $sent_table_name (
|
226 |
+
`id` int(11) NOT NULL auto_increment,
|
227 |
+
`template_id` varchar(40) collate utf8_unicode_ci NOT NULL,
|
228 |
+
`abandoned_order_id` int(11) NOT NULL,
|
229 |
+
`sent_time` datetime NOT NULL,
|
230 |
+
`sent_email_id` text COLLATE utf8_unicode_ci NOT NULL,
|
231 |
+
PRIMARY KEY (`id`)
|
232 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ";
|
233 |
|
234 |
+
require_once ( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
235 |
+
dbDelta ( $sql_query );
|
236 |
|
237 |
$ac_history_table_name = $wpdb->prefix . "ac_abandoned_cart_history_lite";
|
238 |
|
239 |
$history_query = "CREATE TABLE IF NOT EXISTS $ac_history_table_name (
|
240 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
241 |
+
`user_id` int(11) NOT NULL,
|
242 |
+
`abandoned_cart_info` text COLLATE utf8_unicode_ci NOT NULL,
|
243 |
+
`abandoned_cart_time` int(11) NOT NULL,
|
244 |
+
`cart_ignored` enum('0','1') COLLATE utf8_unicode_ci NOT NULL,
|
245 |
+
`recovered_cart` int(11) NOT NULL,
|
246 |
+
PRIMARY KEY (`id`)
|
247 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
|
248 |
|
249 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
250 |
+
dbDelta( $history_query );
|
251 |
|
252 |
+
$ac_settings = new stdClass();
|
253 |
+
$ac_settings->cart_time = '60';
|
254 |
+
$woo_ac_settings[] = $ac_settings;
|
255 |
+
$woocommerce_ac_settings = json_encode( $woo_ac_settings );
|
256 |
add_option ( 'woocommerce_ac_settings', $woocommerce_ac_settings );
|
257 |
}
|
258 |
|
259 |
function ac_lite_update_db_check() {
|
260 |
global $wpdb;
|
261 |
|
262 |
+
if( get_option( 'ac_lite_delete_alter_table_queries' ) != 'yes' ) {
|
263 |
+
update_option( 'ac_lite_alter_table_queries', '' );
|
264 |
update_option( 'ac_lite_delete_alter_table_queries', 'yes' );
|
265 |
}
|
266 |
+
if( get_option( 'ac_lite_alter_table_queries' ) != 'yes' ) {
|
267 |
+
if( $wpdb->get_var( "SHOW TABLES LIKE '" . $wpdb->prefix . "ac_email_templates'" ) === $wpdb->prefix . 'ac_email_templates' ) {
|
268 |
$old_table_name = $wpdb->prefix . "ac_email_templates";
|
269 |
+
$table_name = $wpdb->prefix . "ac_email_templates_lite";
|
270 |
|
271 |
$alter_ac_email_table_query = "ALTER TABLE $old_table_name
|
272 |
+
RENAME TO $table_name";
|
273 |
$wpdb->get_results ( $alter_ac_email_table_query );
|
274 |
|
275 |
}
|
276 |
|
277 |
+
if( $wpdb->get_var( "SHOW TABLES LIKE '" . $wpdb->prefix . "ac_sent_history'" ) === $wpdb->prefix . 'ac_sent_history' ) {
|
278 |
$old_sent_table_name = $wpdb->prefix . "ac_sent_history";
|
279 |
+
$sent_table_name = $wpdb->prefix . "ac_sent_history_lite";
|
280 |
$alter_ac_sent_history_table_query = "ALTER TABLE $old_sent_table_name
|
281 |
+
RENAME TO $sent_table_name";
|
282 |
$wpdb->get_results ( $alter_ac_sent_history_table_query );
|
283 |
}
|
284 |
|
285 |
+
if( $wpdb->get_var( "SHOW TABLES LIKE '" . $wpdb->prefix . "ac_abandoned_cart_history'" ) === $wpdb->prefix . 'ac_abandoned_cart_history' ) {
|
286 |
$old_ac_history_table_name = $wpdb->prefix . "ac_abandoned_cart_history";
|
287 |
+
$ac_history_table_name = $wpdb->prefix . "ac_abandoned_cart_history_lite";
|
288 |
|
289 |
$alter_ac_abandoned_cart_history_table_query = "ALTER TABLE $old_ac_history_table_name
|
290 |
+
RENAME TO $ac_history_table_name";
|
291 |
$wpdb->get_results ( $alter_ac_abandoned_cart_history_table_query );
|
292 |
}
|
293 |
|
294 |
+
update_option( 'ac_lite_alter_table_queries', 'yes' );
|
295 |
}
|
296 |
}
|
297 |
|
298 |
+
function woocommerce_ac_admin_menu() {
|
299 |
|
300 |
+
$page = add_submenu_page ( 'woocommerce', __( 'Abandoned Carts', 'woocommerce-ac' ), __( 'Abandoned Carts', 'woocommerce-ac' ), 'manage_woocommerce', 'woocommerce_ac_page', array( &$this, 'woocommerce_ac_page' ) );
|
301 |
|
302 |
}
|
303 |
|
306 |
if ( is_user_logged_in() )
|
307 |
{
|
308 |
global $wpdb;
|
309 |
+
$user_id = get_current_user_id();
|
310 |
+
$current_time = current_time( 'timestamp' );
|
311 |
+
$cut_off_time = json_decode( get_option( 'woocommerce_ac_settings' ) );
|
312 |
+
if( isset( $cut_off_time[0]->cart_time ) ) {
|
313 |
$cart_cut_off_time = $cut_off_time[0]->cart_time * 60;
|
314 |
} else {
|
315 |
$cart_cut_off_time = 60 * 60;
|
316 |
}
|
317 |
|
318 |
$compare_time = $current_time - $cart_cut_off_time;
|
319 |
+
|
320 |
+
$cart_ignored = 0;
|
321 |
+
$recovered_cart = 0;
|
322 |
$query = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
323 |
+
WHERE user_id = %d
|
324 |
+
AND cart_ignored = %s
|
325 |
+
AND recovered_cart = %d ";
|
326 |
+
$results = $wpdb->get_results($wpdb->prepare( $query, $user_id, $cart_ignored, $recovered_cart ) );
|
327 |
+
|
328 |
+
if ( count($results) == 0 ) {
|
329 |
+
|
330 |
+
$cart_info = json_encode( get_user_meta( $user_id, '_woocommerce_persistent_cart', true ) );
|
331 |
+
|
332 |
$insert_query = "INSERT INTO `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
333 |
+
( user_id, abandoned_cart_info, abandoned_cart_time, cart_ignored )
|
334 |
+
VALUES ( %d, %s, %d, %s )";
|
335 |
+
$wpdb->query( $wpdb->prepare( $insert_query, $user_id, $cart_info,$current_time, $cart_ignored ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
336 |
}
|
337 |
+
elseif ( isset( $results[0]->abandoned_cart_time ) && $compare_time > $results[0]->abandoned_cart_time ) {
|
338 |
+
|
339 |
+
$updated_cart_info = json_encode( get_user_meta( $user_id, '_woocommerce_persistent_cart', true ) );
|
340 |
+
|
341 |
+
if ( ! $this->compare_carts( $user_id, $results[0]->abandoned_cart_info ) ) {
|
342 |
+
|
343 |
+
$updated_cart_ignored = 1;
|
344 |
+
$query_ignored = "UPDATE `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
345 |
+
SET cart_ignored = %s
|
346 |
+
WHERE user_id = %d ";
|
347 |
+
$wpdb->query( $wpdb->prepare( $query_ignored, $updated_cart_ignored, $user_id ) );
|
348 |
+
|
349 |
+
$query_update = "INSERT INTO `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
350 |
+
(user_id, abandoned_cart_info, abandoned_cart_time, cart_ignored)
|
351 |
+
VALUES (%d, %s, %d, %s)";
|
352 |
+
$wpdb->query( $wpdb->prepare( $query_update, $user_id, $updated_cart_info, $current_time, $cart_ignored ) );
|
353 |
+
|
354 |
+
update_user_meta ( $user_id, '_woocommerce_ac_modified_cart', md5( "yes" ) );
|
355 |
+
} else {
|
356 |
+
update_user_meta ( $user_id, '_woocommerce_ac_modified_cart', md5( "no" ) );
|
357 |
+
}
|
358 |
+
} else {
|
359 |
+
$updated_cart_info = json_encode( get_user_meta( $user_id, '_woocommerce_persistent_cart', true ) );
|
360 |
+
|
361 |
$query_update = "UPDATE `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
362 |
+
SET abandoned_cart_info = %s,
|
363 |
+
abandoned_cart_time = %d
|
364 |
+
WHERE user_id = %d
|
365 |
+
AND cart_ignored = %s ";
|
366 |
+
$wpdb->query( $wpdb->prepare( $query_update, $updated_cart_info, $current_time, $user_id, $cart_ignored ) );
|
367 |
+
}
|
368 |
}
|
369 |
}
|
370 |
|
371 |
+
function compare_carts( $user_id, $last_abandoned_cart )
|
372 |
{
|
373 |
+
$current_woo_cart = get_user_meta( $user_id, '_woocommerce_persistent_cart', true );
|
374 |
+
$abandoned_cart_arr = json_decode( $last_abandoned_cart, true );
|
375 |
|
376 |
$temp_variable = "";
|
377 |
+
if ( count( $current_woo_cart['cart'] ) >= count( $abandoned_cart_arr['cart'] ) ) {
|
|
|
378 |
//do nothing
|
379 |
+
} else {
|
380 |
+
$temp_variable = $current_woo_cart;
|
381 |
+
$current_woo_cart = $abandoned_cart_arr;
|
|
|
|
|
382 |
$abandoned_cart_arr = $temp_variable;
|
383 |
}
|
384 |
+
foreach ( $current_woo_cart as $key => $value )
|
385 |
{
|
386 |
+
foreach ( $value as $item_key => $item_value )
|
387 |
{
|
388 |
+
$current_cart_product_id = $item_value['product_id'];
|
389 |
$current_cart_variation_id = $item_value['variation_id'];
|
390 |
+
$current_cart_quantity = $item_value['quantity'];
|
391 |
+
|
392 |
+
if ( isset( $abandoned_cart_arr[ $key ][ $item_key ][ 'product_id' ] ) ) {
|
393 |
+
$abandoned_cart_product_id = $abandoned_cart_arr[$key][$item_key]['product_id'];
|
394 |
+
} else {
|
395 |
+
$abandoned_cart_product_id = "";
|
396 |
+
}
|
397 |
+
if ( isset( $abandoned_cart_arr[$key][$item_key]['variation_id'] ) ) {
|
398 |
+
$abandoned_cart_variation_id = $abandoned_cart_arr[$key][$item_key]['variation_id'];
|
399 |
+
} else {
|
400 |
+
$abandoned_cart_variation_id = "";
|
401 |
+
}
|
402 |
+
if ( isset( $abandoned_cart_arr[$key][$item_key]['quantity'] ) ) {
|
403 |
+
$abandoned_cart_quantity = $abandoned_cart_arr[$key][$item_key]['quantity'];
|
404 |
+
} else {
|
405 |
+
$abandoned_cart_quantity = "";
|
406 |
+
}
|
407 |
+
if ( ( $current_cart_product_id != $abandoned_cart_product_id ) ||
|
408 |
+
( $current_cart_variation_id != $abandoned_cart_variation_id ) ||
|
409 |
+
( $current_cart_quantity != $abandoned_cart_quantity ) )
|
410 |
{
|
411 |
return false;
|
412 |
}
|
419 |
|
420 |
global $wpdb;
|
421 |
$user_id = get_current_user_id();
|
422 |
+
delete_user_meta( $user_id, '_woocommerce_ac_persistent_cart_time' );
|
423 |
+
delete_user_meta( $user_id, '_woocommerce_ac_persistent_cart_temp_time' );
|
424 |
|
425 |
// get all latest abandoned carts that were modified
|
426 |
+
|
427 |
+
$cart_ignored = 0;
|
428 |
+
$recovered_cart = 0;
|
429 |
$query = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
430 |
+
WHERE user_id = %d
|
431 |
+
AND cart_ignored = %s
|
432 |
+
AND recovered_cart = %d
|
433 |
+
ORDER BY id DESC
|
434 |
+
LIMIT 1";
|
435 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, $user_id, $cart_ignored, $recovered_cart ) );
|
436 |
+
if ( count( $results ) > 0 ) {
|
437 |
+
if ( get_user_meta( $user_id, '_woocommerce_ac_modified_cart', true ) == md5( "yes" ) ||
|
438 |
+
get_user_meta( $user_id, '_woocommerce_ac_modified_cart', true ) == md5( "no" ) )
|
439 |
{
|
440 |
+
$order_id = $order->id;
|
441 |
+
|
442 |
+
$updated_cart_ignored = 1;
|
443 |
$query_order = "UPDATE `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
444 |
+
SET recovered_cart = %d,
|
445 |
+
cart_ignored = %s
|
446 |
+
WHERE id = %d ";
|
447 |
+
$wpdb->query( $wpdb->prepare( $query_order, $order_id, $updated_cart_ignored, $results[0]->id ) );
|
448 |
+
delete_user_meta( $user_id, '_woocommerce_ac_modified_cart' );
|
449 |
+
} else {
|
450 |
+
$delete_query = "DELETE FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
451 |
+
WHERE
|
452 |
+
id= %d ";
|
453 |
+
$wpdb->query( $wpdb->prepare( $delete_query, $results[0]->id ) );
|
|
|
|
|
454 |
}
|
455 |
}
|
456 |
}
|
457 |
|
458 |
function action_admin_init() {
|
459 |
// only hook up these filters if we're in the admin panel, and the current user has permission
|
460 |
+
// to edit posts and pages
|
|
|
461 |
if ( current_user_can( 'edit_posts' ) && current_user_can( 'edit_pages' ) ) {
|
462 |
+
add_filter( 'mce_buttons', array( &$this, 'filter_mce_button' ) );
|
463 |
+
add_filter( 'mce_external_plugins', array( &$this, 'filter_mce_plugin' ) );
|
464 |
}
|
465 |
}
|
466 |
|
478 |
|
479 |
function display_tabs() {
|
480 |
|
481 |
+
if ( isset( $_GET[ 'action' ] ) ) {
|
482 |
+
$action = $_GET[ 'action' ];
|
483 |
+
} else {
|
484 |
+
$action = "";
|
485 |
+
$active_listcart = "";
|
486 |
+
$active_emailtemplates = "";
|
487 |
+
$active_settings = "";
|
488 |
+
$active_stats = "";
|
489 |
+
}
|
490 |
+
if ( ( $action == 'listcart' || $action == 'orderdetails' ) || $action == '' ) {
|
491 |
$active_listcart = "nav-tab-active";
|
492 |
+
}
|
493 |
+
if ( $action == 'emailtemplates' ) {
|
|
|
|
|
494 |
$active_emailtemplates = "nav-tab-active";
|
495 |
}
|
496 |
+
if ( $action == 'emailsettings' ) {
|
|
|
|
|
497 |
$active_settings = "nav-tab-active";
|
498 |
}
|
499 |
+
if ( $action == 'stats' ) {
|
|
|
|
|
500 |
$active_stats = "nav-tab-active";
|
501 |
}
|
502 |
|
503 |
?>
|
504 |
|
505 |
+
<div style="background-image: url('<?php echo plugins_url(); ?>/woocommerce-abandoned-cart/images/ac_tab_icon.png') !important;" class="icon32"><br></div>
|
|
|
506 |
|
507 |
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
508 |
<a href="admin.php?page=woocommerce_ac_page&action=listcart" class="nav-tab <?php echo $active_listcart; ?>"> <?php _e( 'Abandoned Orders', 'woocommerce-ac' );?> </a>
|
516 |
|
517 |
function my_enqueue_scripts_js( $hook ) {
|
518 |
|
519 |
+
if ( $hook != 'woocommerce_page_woocommerce_ac_page' ) {
|
|
|
520 |
return;
|
521 |
+
} else {
|
|
|
|
|
|
|
522 |
wp_enqueue_script( 'jquery' );
|
523 |
+
wp_enqueue_script(
|
524 |
+
'jquery-ui-min',
|
525 |
+
'//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js',
|
526 |
+
'',
|
527 |
+
'',
|
528 |
+
false
|
529 |
);
|
530 |
wp_enqueue_script( 'jquery-ui-datepicker' );
|
531 |
|
|
|
532 |
wp_enqueue_script(
|
533 |
+
'jquery-tip',
|
534 |
+
plugins_url( '/js/jquery.tipTip.minified.js', __FILE__ ),
|
535 |
+
'',
|
536 |
+
'',
|
537 |
+
false
|
538 |
);
|
539 |
+
wp_register_script( 'woocommerce_admin', plugins_url() . '/woocommerce/assets/js/admin/woocommerce_admin.js', array( 'jquery', 'jquery-ui-widget', 'jquery-ui-core' ) );
|
540 |
wp_enqueue_script( 'woocommerce_admin' );
|
541 |
|
|
|
|
|
542 |
?>
|
543 |
<script type="text/javascript" >
|
544 |
function delete_email_template( id )
|
545 |
{
|
546 |
+
var y=confirm( 'Are you sure you want to delete this Email Template' );
|
547 |
+
if( y==true ) {
|
|
|
548 |
location.href='admin.php?page=woocommerce_ac_page&action=emailtemplates&mode=removetemplate&id='+id;
|
549 |
}
|
550 |
}
|
551 |
</script>
|
|
|
552 |
|
553 |
<?php
|
554 |
+
wp_enqueue_script( 'tinyMCE_ac', plugins_url() . '/woocommerce-abandoned-cart/js/tinymce/jscripts/tiny_mce/tiny_mce.js' );
|
555 |
+
wp_enqueue_script( 'ac_email_variables', plugins_url() . '/woocommerce-abandoned-cart/js/abandoncart_plugin_button.js' );
|
556 |
?>
|
557 |
|
558 |
<?php
|
594 |
table_cell_limit : 100,
|
595 |
table_row_limit : 5,
|
596 |
table_col_limit : 5,
|
597 |
+
convert_urls : false
|
598 |
});
|
599 |
|
600 |
</script>
|
603 |
|
604 |
function my_enqueue_scripts_css( $hook ) {
|
605 |
|
606 |
+
if ( $hook != 'woocommerce_page_woocommerce_ac_page' ) {
|
|
|
607 |
return;
|
608 |
+
} else {
|
609 |
+
wp_enqueue_style( 'jquery-ui', "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" , '', '', false );
|
|
|
|
|
|
|
610 |
wp_enqueue_style( 'woocommerce_admin_styles', plugins_url() . '/woocommerce/assets/css/admin.css' );
|
611 |
wp_enqueue_style( 'jquery-ui-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' );
|
612 |
|
613 |
+
?>
|
614 |
|
615 |
<style>
|
616 |
span.mce_abandoncart_email_variables
|
630 |
*/
|
631 |
function woocommerce_ac_page()
|
632 |
{
|
633 |
+
if ( is_user_logged_in() ) {
|
|
|
634 |
global $wpdb;
|
635 |
|
636 |
// Check the user capabilities
|
637 |
+
if ( !current_user_can( 'manage_woocommerce' ) ) {
|
|
|
638 |
wp_die( __( 'You do not have sufficient permissions to access this page.', 'woocommerce-ac' ) );
|
639 |
+
}
|
|
|
640 |
?>
|
641 |
|
642 |
<div class="wrap">
|
646 |
<h2><?php _e( 'WooCommerce - Abandon Cart Lite', 'woocommerce-ac' ); ?></h2>
|
647 |
<?php
|
648 |
|
649 |
+
if ( isset( $_GET[ 'action' ] ) ) {
|
650 |
+
$action = $_GET[ 'action' ];
|
651 |
+
} else {
|
652 |
+
$action = "";
|
653 |
+
}
|
654 |
+
if ( isset( $_GET[ 'mode' ] ) ) {
|
655 |
+
$mode = $_GET[ 'mode' ];
|
656 |
+
} else {
|
657 |
+
$mode = "";
|
658 |
+
}
|
659 |
|
660 |
+
$this->display_tabs();
|
|
|
|
|
|
|
661 |
|
662 |
+
if ( $action == 'emailsettings' ) {
|
|
|
663 |
// Save the field values
|
664 |
+
if ( isset( $_POST[ 'ac_settings_frm' ] ) && $_POST[ 'ac_settings_frm' ] == 'save' ) {
|
|
|
|
|
|
|
|
|
|
|
665 |
|
666 |
+
$ac_settings = new stdClass();
|
667 |
+
$ac_settings->cart_time = $_POST[ 'cart_abandonment_time' ];
|
668 |
+
$woo_ac_settings[] = $ac_settings;
|
669 |
+
$woocommerce_ac_settings = json_encode( $woo_ac_settings );
|
670 |
+
|
671 |
+
update_option( 'woocommerce_ac_settings', $woocommerce_ac_settings );
|
672 |
}
|
673 |
?>
|
674 |
|
675 |
+
<?php if ( isset( $_POST[ 'ac_settings_frm' ] ) && $_POST[ 'ac_settings_frm' ] == 'save' ) { ?>
|
676 |
<div id="message" class="updated fade"><p><strong><?php _e( 'Your settings have been saved.', 'woocommerce-ac' ); ?></strong></p></div>
|
677 |
<?php } ?>
|
678 |
|
679 |
<?php
|
680 |
|
681 |
$enable_email_sett_arr = array();
|
682 |
+
$enable_email_sett = get_option( 'woocommerce_ac_settings' );
|
683 |
+
if ( $enable_email_sett != '' && $enable_email_sett != '{}' && $enable_email_sett != '[]' && $enable_email_sett != 'null' ) {
|
684 |
$enable_email_sett_arr = json_decode( $enable_email_sett );
|
685 |
+
}
|
686 |
+
|
687 |
?>
|
688 |
<div id="content">
|
689 |
<form method="post" action="" id="ac_settings">
|
703 |
|
704 |
$cart_time = "";
|
705 |
|
706 |
+
if ( count( $enable_email_sett_arr ) > 0 ) {
|
707 |
|
708 |
+
if ( ( isset( $enable_email_sett_arr[0]->cart_time ) ) && ( $enable_email_sett_arr[0]->cart_time != '' || $enable_email_sett_arr[0]->cart_time != 'null' ) ) {
|
709 |
|
710 |
$cart_time = $enable_email_sett_arr[0]->cart_time;
|
711 |
+
|
712 |
} else {
|
713 |
|
714 |
$cart_time = 60;
|
715 |
}
|
716 |
+
} else {
|
|
|
|
|
717 |
$cart_time = 60;
|
718 |
}
|
719 |
|
720 |
?>
|
721 |
<input type="text" name="cart_abandonment_time" id="cart_abandonment_time" size="5" value="<?php echo $cart_time; ?> "> <?php _e( 'minutes', 'woocommerce-ac' );?>
|
722 |
+
<img class="help_tip" width="16" height="16" data-tip='<?php _e( 'Consider cart abandoned after X minutes of item being added to cart & order not placed', 'woocommerce-ac') ?>' src="<?php echo plugins_url(); ?>/woocommerce/assets/images/help.png" /></p>
|
|
|
|
|
723 |
</td>
|
724 |
</tr>
|
725 |
|
727 |
</div>
|
728 |
</div>
|
729 |
</div>
|
730 |
+
<p class="submit">
|
731 |
<input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e( 'Save Changes', 'woocommerce-ac' ); ?>" />
|
732 |
+
</p>
|
733 |
</form>
|
734 |
</div>
|
735 |
<?php
|
736 |
+
} elseif ( $action == 'listcart' || $action == '' ) {
|
737 |
+
?>
|
|
|
|
|
738 |
|
739 |
+
<p> <?php _e( 'The list below shows all Abandoned Carts which have remained in cart for a time higher than the "Cart abandoned cut-off time" setting.', 'woocommerce-ac' );?> </p>
|
740 |
|
741 |
<?php
|
742 |
+
|
743 |
include_once( "pagination.class.php");
|
744 |
|
745 |
/* Find the number of rows returned from a query; Note: Do NOT use a LIMIT clause in this query */
|
746 |
+
|
747 |
+
$recoverd_cart = 0;
|
748 |
+
$query = "SELECT wpac . * , wpu.user_login, wpu.user_email
|
749 |
+
FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` AS wpac
|
750 |
LEFT JOIN ".$wpdb->base_prefix."users AS wpu ON wpac.user_id = wpu.id
|
751 |
+
WHERE recovered_cart= %d ";
|
752 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, $recoverd_cart ) );
|
753 |
+
|
754 |
+
$count = $wpdb->num_rows;
|
755 |
+
|
756 |
+
if( $count > 0 ) {
|
757 |
$p = new pagination;
|
758 |
+
$p->items( $count );
|
759 |
+
$p->limit( 10 ); // Limit entries per page
|
760 |
+
$p->target( "admin.php?page=woocommerce_ac_page&action=listcart" );
|
761 |
|
762 |
+
if ( isset( $p->paging ) ) {
|
763 |
+
if ( isset( $_GET[ $p->paging ] ) ) $p->currentPage( $_GET[ $p->paging ] ); // Gets and validates the current page
|
764 |
}
|
765 |
$p->calculate(); // Calculates what to show
|
766 |
+
$p->parameterName( 'paging' );
|
767 |
+
$p->adjacents( 1 ); //No. of page away from the current page
|
768 |
+
$p->showCounter( true );
|
769 |
|
770 |
+
if( !isset( $_GET[ 'paging' ] ) ) {
|
771 |
$p->page = 1;
|
772 |
} else {
|
773 |
+
$p->page = $_GET[ 'paging' ];
|
774 |
}
|
775 |
|
776 |
//Query for limit paging
|
777 |
$limit = "LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
|
778 |
|
779 |
+
} else
|
780 |
+
$limit = "";
|
781 |
|
782 |
?>
|
783 |
|
784 |
<div class="tablenav">
|
785 |
<div class='tablenav-pages'>
|
786 |
+
<?php if ( $count > 0 ) echo $p->show(); // Echo out the list of paging. ?>
|
787 |
</div>
|
788 |
</div>
|
789 |
|
790 |
<?php
|
791 |
|
792 |
$order = "";
|
793 |
+
if( isset( $_GET[ 'order' ] ) ){
|
794 |
+
$order = $_GET[ 'order' ];
|
795 |
+
}
|
796 |
+
if ( $order == "" ) {
|
797 |
+
$order = "desc";
|
798 |
+
$order_next = "asc";
|
|
|
799 |
}
|
800 |
+
elseif ( $order == "asc" ) {
|
|
|
801 |
$order_next = "desc";
|
802 |
+
} elseif ( $order == "desc" ) {
|
|
|
|
|
803 |
$order_next = "asc";
|
804 |
}
|
805 |
|
806 |
$order_by = "";
|
807 |
+
if( isset( $_GET[ 'orderby' ] ) ){
|
808 |
+
$order_by = $_GET[ 'orderby' ];
|
809 |
+
}
|
810 |
+
if ( $order_by == "" ) {
|
811 |
+
$order_by = "abandoned_cart_time";
|
|
|
812 |
}
|
813 |
/* Now we use the LIMIT clause to grab a range of rows */
|
814 |
+
|
815 |
+
$query = "SELECT wpac . * , wpu.user_login, wpu.user_email
|
816 |
+
FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` AS wpac
|
817 |
LEFT JOIN ".$wpdb->base_prefix."users AS wpu ON wpac.user_id = wpu.id
|
818 |
+
WHERE recovered_cart = %d
|
819 |
+
ORDER BY %s %s
|
820 |
$limit";
|
821 |
+
|
822 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, $recoverd_cart, $order_by, $order ) );
|
823 |
+
|
824 |
/* From here you can do whatever you want with the data from the $result link. */
|
825 |
|
826 |
$ac_cutoff_time = json_decode(get_option('woocommerce_ac_settings'));
|
827 |
|
828 |
+
?>
|
829 |
+
<table class='wp-list-table widefat fixed posts' cellspacing='0' id='cart_data'>
|
830 |
+
<tr>
|
831 |
+
<th> <?php _e( 'Customer', 'woocommerce-ac' ); ?> </th>
|
832 |
+
<th> <?php _e( 'Order Total', 'woocommerce-ac' ); ?> </th>
|
833 |
+
<th scope="col" id="date_ac" class="manage-column column-date_ac sorted <?php echo $order;?>" style="">
|
834 |
+
<a href="admin.php?page=woocommerce_ac_page&action=listcart&orderby=abandoned_cart_time&order=<?php echo $order_next;?>">
|
835 |
+
<span> <?php _e( 'Date', 'woocommerce-ac' ); ?> </span>
|
836 |
+
<span class="sorting-indicator"></span>
|
837 |
+
</a>
|
838 |
+
</th>
|
839 |
+
<th scope="col" id="status_ac" class="manage-column column-status_ac sorted <?php echo $order;?>" style="">
|
840 |
+
<a href="admin.php?page=woocommerce_ac_page&action=listcart&orderby=cart_ignored&order=<?php echo $order_next;?>">
|
841 |
+
<span> <?php _e( 'Status', 'woocommerce-ac' ); ?> </span>
|
842 |
+
<span class="sorting-indicator"></span>
|
843 |
+
</a>
|
844 |
+
</th>
|
845 |
+
<th> <?php _e( 'Actions', 'woocommerce-ac' ); ?> </th>
|
846 |
+
</tr>
|
|
|
|
|
847 |
|
848 |
<?php
|
849 |
+
foreach ( $results as $key => $value )
|
850 |
{
|
851 |
$abandoned_order_id = $value->id;
|
852 |
+
$user_id = $value->user_id;
|
853 |
+
$user_login = $value->user_login;
|
854 |
+
$user_email = $value->user_email;
|
855 |
+
$user_first_name = get_user_meta( $value->user_id, 'first_name' );
|
856 |
+
$user_last_name = get_user_meta( $value->user_id, 'last_name' );
|
857 |
+
$cart_info = json_decode( $value->abandoned_cart_info );
|
|
|
858 |
|
859 |
$order_date = "";
|
860 |
$cart_update_time = $value->abandoned_cart_time;
|
861 |
+
if ( $cart_update_time != "" && $cart_update_time != 0 ) {
|
862 |
+
$order_date = date( 'd M, Y h:i A', $cart_update_time );
|
|
|
863 |
}
|
864 |
|
865 |
+
$ac_cutoff_time = json_decode( get_option( 'woocommerce_ac_settings' ) );
|
866 |
+
if ( isset( $ac_cutoff_time[0]->cart_time ) ) {
|
867 |
+
$cut_off_time = $ac_cutoff_time[0]->cart_time * 60;
|
868 |
} else {
|
869 |
+
$cut_off_time = 60 * 60;
|
870 |
}
|
871 |
+
$current_time = current_time( 'timestamp' );
|
872 |
+
$compare_time = $current_time - $cart_update_time;
|
873 |
+
$cart_details = $cart_info->cart;
|
|
|
|
|
874 |
|
875 |
$line_total = 0;
|
876 |
+
foreach ( $cart_details as $k => $v )
|
877 |
{
|
878 |
$line_total = $line_total + $v->line_total;
|
879 |
}
|
880 |
|
881 |
+
if( $value->cart_ignored == 0 && $value->recovered_cart == 0 ) {
|
|
|
882 |
$ac_status = "Abandoned";
|
883 |
}
|
884 |
+
elseif( $value->cart_ignored == 1 && $value->recovered_cart == 0 ) {
|
|
|
885 |
$ac_status = "Abandoned but new </br>cart created after this";
|
886 |
+
} else {
|
|
|
|
|
887 |
$ac_status = "";
|
888 |
}
|
889 |
|
890 |
?>
|
891 |
|
892 |
<?php
|
893 |
+
if ( $compare_time > $cut_off_time && $ac_status != "" )
|
894 |
{
|
|
|
895 |
?>
|
896 |
<tr id="row_<?php echo $abandoned_order_id; ?>">
|
897 |
+
<td><strong><?php echo "Abandoned Order #".$abandoned_order_id;?></strong><?php if( isset( $user_first_name[0] ) && isset( $user_last_name[0] ) ) { $user_name = $user_first_name[0]." ".$user_last_name[0]; } echo "</br>Name: ".$user_name." <br><a href='mailto:$user_email'>".$user_email."</a>"; ?></td>
|
898 |
<td><?php echo get_woocommerce_currency_symbol()." ".$line_total; ?></td>
|
899 |
<td><?php echo $order_date; ?></td>
|
900 |
<td><?php echo $ac_status; ?>
|
904 |
|
905 |
</tr>
|
906 |
|
907 |
+
<?php
|
|
|
908 |
}
|
909 |
}
|
910 |
echo "</table>";
|
911 |
+
} elseif ( $action == 'emailtemplates' && ( $mode != 'edittemplate' && $mode != 'addnewtemplate' ) ) {
|
912 |
+
?>
|
913 |
+
<p> <?php _e( 'Add email templates at different intervals to maximize the possibility of recovering your abandoned carts.', 'woocommerce-ac' );?> </p>
|
|
|
|
|
|
|
|
|
914 |
<?php
|
915 |
+
|
916 |
// Save the field values
|
917 |
+
if ( isset( $_POST[ 'ac_settings_frm' ] ) && $_POST[ 'ac_settings_frm' ] == 'save' ) {
|
918 |
+
|
919 |
+
$active_post = 1;
|
920 |
+
|
921 |
+
|
922 |
+
if ( $active_post == 1 ) {
|
923 |
+
|
924 |
+
$is_active = 1;
|
925 |
+
$email_frequency = trim( $_POST[ 'email_frequency' ] );
|
926 |
+
$day_or_hour = trim( $_POST[ 'day_or_hour' ] );
|
927 |
+
|
928 |
+
$check_query = "SELECT * FROM `".$wpdb->prefix."ac_email_templates_lite`
|
929 |
+
WHERE is_active = %s
|
930 |
+
AND frequency = %d
|
931 |
+
AND day_or_hour = %s ";
|
932 |
+
$check_results = $wpdb->get_results( $wpdb->prepare( $check_query, $is_active, $email_frequency, $day_or_hour ) );
|
933 |
+
|
934 |
+
|
935 |
+
if ( count( $check_results ) == 0 ) {
|
936 |
+
|
937 |
+
$active_post = 1;
|
938 |
+
$woocommerce_ac_email_subject = trim( $_POST[ 'woocommerce_ac_email_subject' ] );
|
939 |
+
$woocommerce_ac_email_body = trim( $_POST[ 'woocommerce_ac_email_body' ] );
|
940 |
+
$woocommerce_ac_template_name = trim( $_POST[ 'woocommerce_ac_template_name' ] );
|
941 |
+
$woocommerce_ac_from_name = trim( $_POST[ 'woocommerce_ac_from_name' ] );
|
942 |
+
|
943 |
+
$query = "INSERT INTO `".$wpdb->prefix."ac_email_templates_lite`
|
944 |
+
(subject, body, is_active, frequency, day_or_hour, template_name, from_name)
|
945 |
+
VALUES ( %s, %s, %s, %d, %s, %s, %s )";
|
946 |
+
|
947 |
+
$wpdb->query( $wpdb->prepare( $query,
|
948 |
+
$woocommerce_ac_email_subject,
|
949 |
+
$woocommerce_ac_email_body,
|
950 |
+
$active_post,
|
951 |
+
$email_frequency,
|
952 |
+
$day_or_hour,
|
953 |
+
$woocommerce_ac_template_name,
|
954 |
+
$woocommerce_ac_from_name )
|
955 |
+
);
|
956 |
+
|
957 |
}
|
958 |
+
else {
|
959 |
+
|
960 |
+
$update_is_active = 0;
|
961 |
+
$query_update = "UPDATE `".$wpdb->prefix."ac_email_templates_lite`
|
962 |
+
SET
|
963 |
+
is_active = %s
|
964 |
+
WHERE frequency = %d
|
965 |
+
AND day_or_hour = %s ";
|
966 |
+
$wpdb->query($wpdb->prepare( $query_update, $update_is_active, $email_frequency, $day_or_hour ) );
|
967 |
+
|
968 |
+
$woocommerce_ac_email_subject = trim( $_POST[ 'woocommerce_ac_email_subject' ] );
|
969 |
+
$woocommerce_ac_email_body = trim( $_POST[ 'woocommerce_ac_email_body' ] );
|
970 |
+
$woocommerce_ac_template_name = trim( $_POST[ 'woocommerce_ac_template_name' ] );
|
971 |
+
$woocommerce_ac_from_name = trim( $_POST[ 'woocommerce_ac_from_name' ] );
|
972 |
+
|
973 |
+
$query_insert_new = "INSERT INTO `".$wpdb->prefix."ac_email_templates_lite`
|
974 |
+
(subject, body, is_active, frequency, day_or_hour, template_name, from_name)
|
975 |
+
VALUES ( %s, %s, %s, %d, %s, %s, %s )";
|
976 |
+
|
977 |
+
$wpdb->query( $wpdb->prepare( $query_insert_new,
|
978 |
+
$woocommerce_ac_email_subject,
|
979 |
+
$woocommerce_ac_email_body,
|
980 |
+
$active_post,
|
981 |
+
$email_frequency,
|
982 |
+
$day_or_hour,
|
983 |
+
$woocommerce_ac_template_name,
|
984 |
+
$woocommerce_ac_from_name )
|
985 |
+
);
|
986 |
}
|
987 |
}
|
988 |
}
|
989 |
|
990 |
+
if ( isset( $_POST[ 'ac_settings_frm' ] ) && $_POST[ 'ac_settings_frm' ] == 'update' )
|
991 |
{
|
|
|
992 |
$active = 1;
|
993 |
if ( $active == 1 )
|
994 |
+
{
|
995 |
+
$is_active = 1;
|
996 |
+
$email_frequency = trim( $_POST[ 'email_frequency' ] );
|
997 |
+
$day_or_hour = trim( $_POST[ 'day_or_hour' ] );
|
998 |
+
$check_query = "SELECT * FROM `".$wpdb->prefix."ac_email_templates_lite`
|
999 |
+
WHERE is_active= %s
|
1000 |
+
AND frequency = %d
|
1001 |
+
AND day_or_hour= %s ";
|
1002 |
+
$check_results = $wpdb->get_results( $wpdb->prepare( $check_query, $is_active, $email_frequency, $day_or_hour ) );
|
1003 |
+
|
1004 |
if (count($check_results) == 0 )
|
1005 |
{
|
1006 |
+
|
1007 |
+
$woocommerce_ac_email_subject = trim( $_POST[ 'woocommerce_ac_email_subject' ] );
|
1008 |
+
$woocommerce_ac_email_body = trim( $_POST[ 'woocommerce_ac_email_body' ] );
|
1009 |
+
$woocommerce_ac_template_name = trim( $_POST[ 'woocommerce_ac_template_name' ] );
|
1010 |
+
$woocommerce_ac_from_name = trim( $_POST[ 'woocommerce_ac_from_name' ] );
|
1011 |
+
$id = trim( $_POST[ 'id' ] );
|
1012 |
+
|
1013 |
+
$query_update = "UPDATE `".$wpdb->prefix."ac_email_templates_lite`
|
1014 |
+
SET
|
1015 |
+
subject = %s,
|
1016 |
+
body = %s,
|
1017 |
+
is_active = %s,
|
1018 |
+
frequency = %d,
|
1019 |
+
day_or_hour = %s,
|
1020 |
+
template_name = %s,
|
1021 |
+
from_name = %s
|
1022 |
+
WHERE id = %d ";
|
1023 |
+
$wpdb->query($wpdb->prepare( $query_update,
|
1024 |
+
$woocommerce_ac_email_subject,
|
1025 |
+
$woocommerce_ac_email_body,
|
1026 |
+
$active,
|
1027 |
+
$email_frequency,
|
1028 |
+
$day_or_hour,
|
1029 |
+
$woocommerce_ac_template_name,
|
1030 |
+
$woocommerce_ac_from_name,
|
1031 |
+
$id )
|
1032 |
+
|
1033 |
+
);
|
1034 |
}
|
1035 |
+
else {
|
1036 |
+
|
1037 |
+
$updated_is_active = 0;
|
1038 |
+
$query_update_new = "UPDATE `".$wpdb->prefix."ac_email_templates_lite`
|
1039 |
+
SET is_active = %s
|
1040 |
+
WHERE frequency = %d
|
1041 |
+
AND day_or_hour = %s ";
|
1042 |
+
$wpdb->query( $wpdb->prepare( $query_update_new, $updated_is_active, $email_frequency, $day_or_hour ) );
|
1043 |
+
|
1044 |
+
$woocommerce_ac_email_subject = trim( $_POST[ 'woocommerce_ac_email_subject' ] );
|
1045 |
+
$woocommerce_ac_email_body = trim( $_POST[ 'woocommerce_ac_email_body' ] );
|
1046 |
+
$woocommerce_ac_template_name = trim( $_POST[ 'woocommerce_ac_template_name' ] );
|
1047 |
+
$woocommerce_ac_from_name = trim( $_POST[ 'woocommerce_ac_from_name' ] );
|
1048 |
+
$id = trim( $_POST[ 'id' ] );
|
1049 |
+
|
1050 |
+
$query_update_latest = "UPDATE `".$wpdb->prefix."ac_email_templates_lite`
|
1051 |
+
SET
|
1052 |
+
subject = %s,
|
1053 |
+
body = %s,
|
1054 |
+
is_active = %s,
|
1055 |
+
frequency = %d,
|
1056 |
+
day_or_hour = %s,
|
1057 |
+
template_name = %s,
|
1058 |
+
from_name = %s
|
1059 |
+
WHERE id = %d ";
|
1060 |
+
$wpdb->query($wpdb->prepare( $query_update_latest,
|
1061 |
+
$woocommerce_ac_email_subject,
|
1062 |
+
$woocommerce_ac_email_body,
|
1063 |
+
$active,
|
1064 |
+
$email_frequency,
|
1065 |
+
$day_or_hour,
|
1066 |
+
$woocommerce_ac_template_name,
|
1067 |
+
$woocommerce_ac_from_name,
|
1068 |
+
$id )
|
1069 |
+
|
1070 |
+
);
|
1071 |
+
|
1072 |
}
|
1073 |
}
|
1074 |
}
|
1075 |
|
1076 |
+
if ( $action == 'emailtemplates' && $mode == 'removetemplate' ){
|
1077 |
+
$id_remove = $_GET[ 'id' ];
|
1078 |
+
|
1079 |
+
$query_remove = "DELETE FROM `".$wpdb->prefix."ac_email_templates_lite` WHERE id= %d ";
|
1080 |
+
$wpdb->query( $wpdb->prepare( $query_remove, $id_remove ) );
|
1081 |
}
|
1082 |
|
1083 |
+
if ( isset( $_POST[ 'ac_settings_frm' ] ) && $_POST[ 'ac_settings_frm' ] == 'save' ) { ?>
|
1084 |
<div id="message" class="updated fade"><p><strong><?php _e( 'The Email Template has been successfully added.', 'woocommerce-ac' ); ?></strong></p></div>
|
1085 |
<?php }
|
1086 |
+
if ( isset( $_POST[ 'ac_settings_frm' ] ) && $_POST[ 'ac_settings_frm' ] == 'update' ) { ?>
|
1087 |
<div id="message" class="updated fade"><p><strong><?php _e( 'The Email Template has been successfully updated.', 'woocommerce-ac' ); ?></strong></p></div>
|
1088 |
<?php }?>
|
1089 |
|
1090 |
<div class="tablenav">
|
1091 |
<p style="float:left;">
|
1092 |
+
<input type="button" value="+ Add New Template" id="add_new_template" onclick="location.href='admin.php?page=woocommerce_ac_page&action=emailtemplates&mode=addnewtemplate';" style="font-weight: bold; color: green; font-size: 18px; cursor: pointer;">
|
|
|
1093 |
</p>
|
1094 |
|
1095 |
<?php
|
1096 |
+
include_once( "pagination.class.php" );
|
1097 |
|
1098 |
/* Find the number of rows returned from a query; Note: Do NOT use a LIMIT clause in this query */
|
1099 |
+
$wpdb->get_results( "SELECT wpet . *
|
1100 |
+
FROM `".$wpdb->prefix."ac_email_templates_lite` AS wpet
|
1101 |
+
");
|
1102 |
|
1103 |
+
$count = $wpdb->num_rows;
|
1104 |
|
1105 |
+
if( $count > 0 ) {
|
1106 |
$p = new pagination;
|
1107 |
+
$p->items( $count );
|
1108 |
+
$p->limit( 10 ); // Limit entries per page
|
1109 |
+
$p->target( "admin.php?page=woocommerce_ac_page&action=emailtemplates" );
|
1110 |
+
if ( isset( $p->paging ) ) {
|
1111 |
+
if ( isset( $_GET[ $p->paging ] ) ){
|
1112 |
+
$p->currentPage( $_GET[ $p->paging ] ); // Gets and validates the current page
|
1113 |
+
}
|
1114 |
+
}
|
1115 |
$p->calculate(); // Calculates what to show
|
1116 |
+
$p->parameterName( 'paging' );
|
1117 |
+
$p->adjacents( 1 ); //No. of page away from the current page
|
1118 |
+
$p->showCounter( true );
|
1119 |
|
1120 |
+
if( !isset( $_GET[ 'paging' ] ) ) {
|
1121 |
$p->page = 1;
|
1122 |
} else {
|
1123 |
+
$p->page = $_GET[ 'paging' ];
|
1124 |
}
|
1125 |
|
1126 |
//Query for limit paging
|
1127 |
+
$limit = "LIMIT " . ( $p->page - 1 ) * $p->limit . ", " . $p->limit;
|
1128 |
|
1129 |
}
|
1130 |
+
else $limit = "";
|
1131 |
|
1132 |
?>
|
1133 |
|
1134 |
<div class='tablenav-pages'>
|
1135 |
+
<?php if ( $count>0 ) echo $p->show(); // Echo out the list of paging. ?>
|
1136 |
</div>
|
1137 |
</div>
|
1138 |
|
1139 |
<?php
|
1140 |
|
1141 |
$order = "";
|
1142 |
+
if ( isset( $_GET[ 'order' ] ) ) {
|
1143 |
+
$order = $_GET[ 'order' ];
|
1144 |
+
}
|
1145 |
+
if ( $order == "" ) {
|
1146 |
+
$order = "asc";
|
1147 |
$order_next = "desc";
|
1148 |
+
} elseif ( $order == "asc" ) {
|
|
|
|
|
1149 |
$order_next = "desc";
|
1150 |
+
} elseif ( $order == "desc" ) {
|
|
|
|
|
1151 |
$order_next = "asc";
|
1152 |
}
|
1153 |
|
1154 |
$order_by = "";
|
1155 |
+
if ( isset($_GET[ 'orderby' ] ) ) {
|
1156 |
+
$order_by = $_GET[ 'orderby' ];
|
1157 |
+
}
|
1158 |
+
if ( $order_by == "" ) {
|
1159 |
+
$order_by = "frequency";
|
1160 |
}
|
1161 |
|
1162 |
+
$query = "SELECT wpet . *
|
1163 |
+
FROM `".$wpdb->prefix."ac_email_templates_lite` AS wpet
|
1164 |
+
ORDER BY %s %s
|
1165 |
$limit";
|
1166 |
+
$results = $wpdb->get_results($wpdb->prepare( $query, $order_by, $order ) );
|
|
|
1167 |
/* From here you can do whatever you want with the data from the $result link. */
|
1168 |
?>
|
1169 |
|
1187 |
</tr>
|
1188 |
|
1189 |
<?php
|
1190 |
+
if ( isset( $_GET[ 'pageno' ] ) ){
|
1191 |
+
$add_var = ($_GET['pageno'] - 1) * $limit;
|
1192 |
+
} else {
|
1193 |
+
$add_var = "";
|
1194 |
+
}
|
1195 |
+
$i = 1 + $add_var;
|
1196 |
+
foreach ( $results as $key => $value )
|
1197 |
{
|
1198 |
$id = $value->id;
|
1199 |
|
1206 |
{
|
1207 |
$active = "No";
|
1208 |
}
|
1209 |
+
$frequency = $value->frequency;
|
1210 |
$day_or_hour = $value->day_or_hour;
|
1211 |
?>
|
1212 |
|
1213 |
<tr id="row_<?php echo $id; ?>">
|
1214 |
+
<td><?php echo $i; ?></td>
|
1215 |
+
<td><?php echo $value->template_name; ?></td>
|
1216 |
+
<td><?php echo $frequency." ".$day_or_hour." After Abandonment";?></td>
|
1217 |
+
<td><?php echo $active; ?></td>
|
1218 |
+
<td>
|
|
|
1219 |
<a href="admin.php?page=woocommerce_ac_page&action=emailtemplates&mode=edittemplate&id=<?php echo $id; ?>"> <img src="<?php echo plugins_url(); ?>/woocommerce-abandoned-cart/images/edit.png" alt="Edit" title="Edit" width="20" height="20"> </a>
|
1220 |
<a href="#" onclick="delete_email_template( <?php echo $id; ?> )" > <img src="<?php echo plugins_url(); ?>/woocommerce-abandoned-cart/images/delete.png" alt="Delete" title="Delete" width="20" height="20"> </a>
|
1221 |
+
</td>
|
1222 |
+
</tr>
|
|
|
|
|
1223 |
|
1224 |
<?php
|
1225 |
$i++;
|
1226 |
}
|
1227 |
echo "</table>";
|
|
|
1228 |
|
1229 |
}
|
1230 |
elseif ($action == 'stats' || $action == '')
|
1231 |
+
{
|
|
|
1232 |
?>
|
1233 |
<p>
|
1234 |
<script language='javascript'>
|
1235 |
+
jQuery( document ).ready( function()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1236 |
{
|
1237 |
+
jQuery( '#duration_select' ).change( function()
|
1238 |
+
{
|
1239 |
+
var group_name = jQuery( '#duration_select' ).val();
|
1240 |
+
var today = new Date();
|
1241 |
+
var start_date = "";
|
1242 |
+
var end_date = "";
|
1243 |
+
if ( group_name == "yesterday" )
|
1244 |
+
{
|
1245 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 1 );
|
1246 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 1 );
|
1247 |
+
}
|
1248 |
+
else if ( group_name == "today")
|
1249 |
+
{
|
1250 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
1251 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
1252 |
+
}
|
1253 |
+
else if ( group_name == "last_seven" )
|
1254 |
+
{
|
1255 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 7 );
|
1256 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
1257 |
+
}
|
1258 |
+
else if ( group_name == "last_fifteen" )
|
1259 |
+
{
|
1260 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 15 );
|
1261 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
1262 |
+
}
|
1263 |
+
else if ( group_name == "last_thirty" )
|
1264 |
+
{
|
1265 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 30 );
|
1266 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
1267 |
+
}
|
1268 |
+
else if ( group_name == "last_ninety" )
|
1269 |
+
{
|
1270 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 90 );
|
1271 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
1272 |
+
}
|
1273 |
+
else if ( group_name == "last_year_days" )
|
1274 |
+
{
|
1275 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 365 );
|
1276 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
1277 |
+
}
|
1278 |
+
|
1279 |
+
var monthNames = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
1280 |
+
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ];
|
1281 |
+
|
1282 |
+
var start_date_value = start_date.getDate() + " " + monthNames[start_date.getMonth()] + " " + start_date.getFullYear();
|
1283 |
+
var end_date_value = end_date.getDate() + " " + monthNames[end_date.getMonth()] + " " + end_date.getFullYear();
|
1284 |
+
|
1285 |
+
jQuery( '#start_date' ).val( start_date_value );
|
1286 |
+
jQuery( '#end_date' ).val( end_date_value );
|
1287 |
+
|
1288 |
+
});
|
1289 |
});
|
1290 |
</script>
|
1291 |
<?php
|
1292 |
|
1293 |
+
if ( isset( $_POST[ 'duration_select' ] ) ){
|
1294 |
+
$duration_range = $_POST['duration_select'];
|
1295 |
+
} else {
|
1296 |
+
$duration_range = "";
|
1297 |
+
}
|
1298 |
+
if ( $duration_range == "" ) {
|
1299 |
+
if ( isset( $_GET[ 'duration_select' ] ) ){
|
1300 |
+
$duration_range = $_GET[ 'duration_select' ];
|
1301 |
+
}
|
1302 |
}
|
1303 |
if ($duration_range == "") $duration_range = "last_seven";
|
|
|
1304 |
|
1305 |
+
|
1306 |
_e( 'The Report below shows how many Abandoned Carts we were able to recover for you by sending automatic emails to encourage shoppers.', 'woocommerce-ac');
|
1307 |
?>
|
1308 |
<div id="recovered_stats" class="postbox" style="display:block">
|
1314 |
foreach ( $this->duration_range_select as $key => $value )
|
1315 |
{
|
1316 |
$sel = "";
|
1317 |
+
if ($key == $duration_range) {
|
|
|
1318 |
$sel = " selected ";
|
1319 |
}
|
1320 |
echo"<option value='$key' $sel> $value </option>";
|
1321 |
}
|
1322 |
|
1323 |
+
$date_sett = $this->start_end_dates[ $duration_range ];
|
1324 |
|
1325 |
?>
|
1326 |
</select>
|
1327 |
|
1328 |
<script type="text/javascript">
|
1329 |
+
jQuery( document ).ready( function()
|
1330 |
{
|
1331 |
+
var formats = [ "d.m.y", "d M yy","MM d, yy" ];
|
1332 |
+
jQuery( "#start_date" ).datepicker( { dateFormat: formats[ 1 ] } );
|
1333 |
});
|
1334 |
|
1335 |
+
jQuery( document ).ready( function()
|
1336 |
{
|
1337 |
+
var formats = [ "d.m.y", "d M yy","MM d, yy" ];
|
1338 |
+
jQuery( "#end_date" ).datepicker( { dateFormat: formats[ 1 ] } );
|
1339 |
});
|
1340 |
</script>
|
1341 |
+
|
|
|
1342 |
<?php
|
1343 |
|
1344 |
+
if ( isset( $_POST[ 'start_date' ] ) ){
|
1345 |
+
$start_date_range = $_POST[ 'start_date' ];
|
1346 |
+
} else {
|
1347 |
+
$start_date_range = "";
|
1348 |
+
}
|
1349 |
+
if ( $start_date_range == "" ){
|
1350 |
+
$start_date_range = $date_sett[ 'start_date' ];
|
1351 |
}
|
1352 |
+
if ( isset( $_POST[ 'end_date' ] ) ){
|
1353 |
+
$end_date_range = $_POST[ 'end_date' ];
|
1354 |
+
} else {
|
1355 |
+
$end_date_range = "";
|
1356 |
+
}
|
1357 |
+
if ( $end_date_range == "" ){
|
1358 |
+
$end_date_range = $date_sett[ 'end_date' ];
|
1359 |
}
|
1360 |
|
1361 |
?>
|
1373 |
<?php
|
1374 |
|
1375 |
global $wpdb;
|
1376 |
+
$start_date = strtotime( $start_date_range." 00:01:01" );
|
1377 |
+
$end_date = strtotime( $end_date_range." 23:59:59" );
|
1378 |
|
1379 |
+
include_once( "pagination.class.php" );
|
1380 |
|
1381 |
/* Find the number of rows returned from a query; Note: Do NOT use a LIMIT clause in this query */
|
1382 |
+
$recoverd_cart = 0;
|
1383 |
+
$wpdb->get_results( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "ac_abandoned_cart_history_lite
|
1384 |
+
WHERE abandoned_cart_time >= %d
|
1385 |
+
AND abandoned_cart_time <= %d
|
1386 |
+
AND recovered_cart > %d
|
1387 |
+
",$start_date,$end_date,$recoverd_cart ) );
|
1388 |
+
$count = $wpdb->num_rows;
|
1389 |
|
1390 |
+
if ( $count > 0 ) {
|
1391 |
$p = new pagination;
|
1392 |
+
$p->items( $count );
|
1393 |
+
$p->limit( 10 ); // Limit entries per page
|
1394 |
+
$p->target( "admin.php?page=woocommerce_ac_page&action=stats&duration_select=$duration_range" );
|
1395 |
|
1396 |
+
if ( isset( $p->paging ) ) {
|
1397 |
+
if ( isset( $_GET[ $p->paging ] ) ) $p->currentPage( $_GET[$p->paging ] ); // Gets and validates the current page
|
1398 |
+
}
|
|
|
1399 |
$p->calculate(); // Calculates what to show
|
1400 |
+
$p->parameterName( 'paging' );
|
1401 |
+
$p->adjacents( 1 ); //No. of page away from the current page
|
1402 |
+
$p->showCounter( true );
|
1403 |
|
1404 |
+
if ( !isset( $_GET[ 'paging' ] ) ) {
|
1405 |
$p->page = 1;
|
1406 |
} else {
|
1407 |
+
$p->page = $_GET[ 'paging' ];
|
1408 |
}
|
1409 |
+
//Query for limit paging
|
1410 |
+
$limit = "LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
|
|
|
|
|
1411 |
}
|
1412 |
else
|
1413 |
$limit = "";
|
1415 |
|
1416 |
<div class="tablenav">
|
1417 |
<div class='tablenav-pages'>
|
1418 |
+
<?php if ( $count>0 ) echo $p->show(); // Echo out the list of paging. ?>
|
1419 |
</div>
|
1420 |
</div>
|
1421 |
|
1422 |
<?php
|
1423 |
|
1424 |
$order = "";
|
1425 |
+
if ( isset( $_GET[ 'order' ] ) ){
|
1426 |
+
$order = $_GET[ 'order' ];
|
1427 |
+
}
|
1428 |
+
if ( $order == "" ){
|
1429 |
+
$order = "desc";
|
1430 |
+
$order_next = "asc";
|
1431 |
+
} elseif ( $order == "asc" ){
|
1432 |
+
$order_next = "desc";
|
1433 |
+
} elseif ( $order == "desc" )
|
|
|
|
|
1434 |
{
|
1435 |
+
$order_next = "asc";
|
1436 |
}
|
1437 |
|
1438 |
$order_by = "";
|
1439 |
+
if ( isset( $_GET[ 'orderby' ] ) ){
|
1440 |
+
$order_by = $_GET[ 'orderby' ];
|
1441 |
+
}
|
1442 |
+
if ( $order_by == "" ){
|
1443 |
+
$order_by = "recovered_cart";
|
1444 |
}
|
1445 |
|
1446 |
+
$recoverd_cart = 0;
|
1447 |
+
$query_ac = "SELECT * FROM " . $wpdb->prefix . "ac_abandoned_cart_history_lite
|
1448 |
+
WHERE abandoned_cart_time >= %d
|
1449 |
+
AND abandoned_cart_time <= %d
|
1450 |
+
AND recovered_cart > %d
|
1451 |
+
ORDER BY %s %s $limit";
|
1452 |
+
$ac_results = $wpdb->get_results( $wpdb->prepare( $query_ac, $start_date, $end_date, $recoverd_cart, $order_by,$order ) );
|
1453 |
+
|
1454 |
$query_ac_carts = "SELECT * FROM " . $wpdb->prefix . "ac_abandoned_cart_history_lite
|
1455 |
+
WHERE abandoned_cart_time >= %d
|
1456 |
+
AND abandoned_cart_time <= %d ";
|
1457 |
+
$ac_carts_results = $wpdb->get_results($wpdb->prepare($query_ac_carts, $start_date, $end_date) );
|
1458 |
|
1459 |
$recovered_item = $recovered_total = $count_carts = $total_value = $order_total = 0;
|
1460 |
+
foreach ( $ac_carts_results as $key => $value )
|
1461 |
{
|
1462 |
+
|
|
|
1463 |
{
|
1464 |
$count_carts += 1;
|
1465 |
|
1466 |
+
$cart_detail = json_decode( $value->abandoned_cart_info );
|
1467 |
$product_details = $cart_detail->cart;
|
1468 |
|
1469 |
$line_total = 0;
|
1470 |
+
foreach ( $product_details as $k => $v )
|
1471 |
{
|
1472 |
$line_total = $line_total + $v->line_total;
|
1473 |
}
|
1476 |
}
|
1477 |
}
|
1478 |
$table_data = "";
|
1479 |
+
foreach ( $ac_results as $key => $value )
|
1480 |
{
|
1481 |
if( $value->recovered_cart != 0 )
|
1482 |
{
|
1483 |
+
$recovered_id = $value->recovered_cart;
|
1484 |
+
$rec_order = get_post_meta( $recovered_id );
|
1485 |
+
$woo_order = new WC_Order( $recovered_id );
|
1486 |
+
$recovered_date = strtotime( $woo_order->order_date );
|
1487 |
+
$recovered_date_new = date( 'd M, Y h:i A', $recovered_date );
|
1488 |
+
$recovered_item += 1;
|
1489 |
+
if ( isset( $rec_order[ '_order_total' ][ 0 ] ) ) {
|
1490 |
+
$recovered_total += $rec_order[ '_order_total' ][ 0 ];
|
1491 |
}
|
|
|
1492 |
|
1493 |
+
$abandoned_date = date( 'd M, Y h:i A', $value->abandoned_cart_time );
|
1494 |
+
$abandoned_order_id = $value->id;
|
1495 |
+
$billing_first_name = $billing_last_name = $billing_email = '';
|
1496 |
+
$recovered_order_total = 0;
|
1497 |
+
if ( isset( $rec_order[ '_billing_first_name' ][ 0 ] ) ) {
|
1498 |
+
$billing_first_name = $rec_order[ '_billing_first_name' ][ 0 ];
|
1499 |
}
|
1500 |
+
if ( isset( $rec_order[ '_billing_last_name' ][ 0 ] ) ) {
|
1501 |
+
$billing_last_name = $rec_order[ '_billing_last_name' ][ 0 ];
|
1502 |
}
|
1503 |
+
if ( isset( $rec_order[ '_billing_email' ][ 0 ] ) ) {
|
1504 |
+
$billing_email = $rec_order[ '_billing_email' ][ 0 ];
|
1505 |
}
|
1506 |
+
if ( isset( $rec_order[ '_order_total' ][ 0 ] ) ) {
|
1507 |
+
$recovered_order_total = $rec_order[ '_order_total' ][ 0 ];
|
1508 |
}
|
1509 |
|
1510 |
$table_data .="<tr>
|
1519 |
?>
|
1520 |
<div id="recovered_stats" class="postbox" style="display:block">
|
1521 |
<div class="inside" >
|
1522 |
+
<p style="font-size: 15px"> <?php _e('During the selected range', 'woocommerce-ac');?> <strong> <?php echo $count_carts; ?> </strong> <?php _e('carts totaling', 'woocommerce-ac');?> <strong> <?php echo get_woocommerce_currency_symbol()." ".$total_value; ?> </strong> <?php _e('were abandoned. We were able to recover', 'woocommerce-ac');?> <strong> <?php echo $recovered_item; ?> </strong> <?php _e('of them, which led to an extra', 'woocommerce-ac');?> <strong> <?php echo get_woocommerce_currency_symbol()." ".$recovered_total; ?> </strong> <?php _e('in sales', 'woocommerce-ac');?></p>
|
1523 |
</div>
|
1524 |
</div>
|
1525 |
|
1543 |
</tr>
|
1544 |
<?php
|
1545 |
echo $table_data;
|
1546 |
+
print ('</table>');
|
1547 |
}
|
1548 |
|
1549 |
+
if ( isset( $_GET[ 'action' ] ) ){
|
1550 |
+
$action = $_GET[ 'action' ];
|
1551 |
+
}
|
1552 |
+
if ( isset( $_GET[ 'mode' ] ) ){
|
1553 |
+
$mode = $_GET[ 'mode' ];
|
1554 |
+
}
|
1555 |
+
if ( $action == 'emailtemplates' && ( $mode == 'addnewtemplate' || $mode == 'edittemplate' ) )
|
1556 |
{
|
1557 |
+
if( $mode=='edittemplate' )
|
1558 |
+
{
|
1559 |
+
$edit_id = $_GET[ 'id' ];
|
1560 |
+
|
1561 |
+
$query="SELECT wpet . * FROM `".$wpdb->prefix."ac_email_templates_lite` AS wpet WHERE id = %d ";
|
1562 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, $edit_id ) );
|
1563 |
}
|
1564 |
|
1565 |
+
$active_post = ( empty( $_POST[ 'is_active' ] ) ) ? '0' : '1';
|
1566 |
|
1567 |
?>
|
1568 |
|
1569 |
<div id="content">
|
1570 |
<form method="post" action="admin.php?page=woocommerce_ac_page&action=emailtemplates" id="ac_settings">
|
1571 |
+
<input type="hidden" name="mode" value="<?php echo $mode;?>" />
|
1572 |
+
<?php
|
1573 |
+
$id_by = "";
|
1574 |
+
if ( isset( $_GET[ 'id' ] ) ){
|
1575 |
+
$id_by = $_GET[ 'id' ];
|
1576 |
+
}
|
1577 |
+
?>
|
1578 |
+
<input type="hidden" name="id" value="<?php echo $id_by ;?>" />
|
1579 |
|
1580 |
<?php
|
1581 |
+
$button_mode = "save";
|
1582 |
$display_message = "Add Email Template";
|
1583 |
if ( $mode == 'edittemplate' )
|
1584 |
{
|
1585 |
+
$button_mode = "update";
|
1586 |
$display_message = "Edit Email Template";
|
1587 |
}
|
1588 |
print'<input type="hidden" name="ac_settings_frm" value="'.$button_mode.'">';?>
|
1614 |
</th>
|
1615 |
<td>
|
1616 |
<?php
|
1617 |
+
$from_name = "Admin";
|
1618 |
+
if ( $mode == 'edittemplate' )
|
1619 |
{
|
1620 |
$from_name=$results[0]->from_name;
|
1621 |
}
|
1622 |
|
1623 |
print'<input type="text" name="woocommerce_ac_from_name" id="woocommerce_ac_from_name" class="regular-text" value="'.$from_name.'">';?>
|
1624 |
<img class="help_tip" width="16" height="16" data-tip='<?php _e('Enter the name that should appear in the email sent', 'woocommerce-ac') ?>' src="<?php echo plugins_url(); ?>/woocommerce/assets/images/help.png" /></p>
|
1625 |
+
|
1626 |
</tr>
|
1627 |
|
1628 |
<tr>
|
1631 |
</th>
|
1632 |
<td>
|
1633 |
<?php
|
1634 |
+
$subject_edit = "";
|
1635 |
+
if ( $mode == 'edittemplate' )
|
1636 |
{
|
1637 |
$subject_edit=$results[0]->subject;
|
1638 |
}
|
1639 |
|
1640 |
print'<input type="text" name="woocommerce_ac_email_subject" id="woocommerce_ac_email_subject" class="regular-text" value="'.$subject_edit.'">';?>
|
1641 |
<img class="help_tip" width="16" height="16" data-tip='<?php _e('Enter the subject that should appear in the email sent', 'woocommerce-ac') ?>' src="<?php echo plugins_url(); ?>/woocommerce/assets/images/help.png" /></p>
|
1642 |
+
|
1643 |
</tr>
|
1644 |
|
1645 |
<tr>
|
1649 |
<td>
|
1650 |
|
1651 |
<?php
|
1652 |
+
$initial_data = "";
|
1653 |
+
if ( $mode == 'edittemplate' )
|
1654 |
{
|
1655 |
+
$initial_data = stripslashes( $results[0]->body );
|
1656 |
}
|
1657 |
|
1658 |
echo "<textarea id='woocommerce_ac_email_body' name='woocommerce_ac_email_body' rows='15'' cols='80'>".$initial_data."</textarea>";
|
1659 |
?>
|
1660 |
|
1661 |
+
<?php echo stripslashes(get_option( 'woocommerce_ac_email_body' )); ?>
|
1662 |
<span class="description"><?php
|
1663 |
echo __( 'Message to be sent in the reminder email.', 'woocommerce-ac' );
|
1664 |
?></span>
|
1674 |
<select name="email_frequency" id="email_frequency">
|
1675 |
|
1676 |
<?php
|
1677 |
+
$frequency_edit = "";
|
1678 |
if( $mode == 'edittemplate')
|
1679 |
{
|
1680 |
+
$frequency_edit = $results[0]->frequency;
|
1681 |
}
|
1682 |
|
1683 |
+
for ( $i = 1; $i < 4; $i++ )
|
1684 |
{
|
1685 |
printf( "<option %s value='%s'>%s</option>\n",
|
1686 |
selected( $i, $frequency_edit, false ),
|
1699 |
$days_or_hours_edit = "";
|
1700 |
if ( $mode == 'edittemplate')
|
1701 |
{
|
1702 |
+
$days_or_hours_edit = $results[0]->day_or_hour;
|
1703 |
}
|
1704 |
|
1705 |
+
$days_or_hours = array(
|
1706 |
+
'Days' => 'Day(s)',
|
1707 |
+
'Hours' => 'Hour(s)'
|
1708 |
+
);
|
1709 |
+
foreach( $days_or_hours as $k => $v )
|
1710 |
{
|
1711 |
printf( "<option %s value='%s'>%s</option>\n",
|
1712 |
selected( $k, $days_or_hours_edit, false ),
|
1717 |
?>
|
1718 |
|
1719 |
</select>
|
1720 |
+
|
|
|
1721 |
<span class="description"><?php
|
1722 |
echo __( 'after cart is abandoned.', 'woocommerce-ac' );
|
1723 |
?></span>
|
1737 |
</p>
|
1738 |
|
1739 |
</td>
|
1740 |
+
</tr>
|
|
|
|
|
1741 |
</table>
|
1742 |
</div>
|
1743 |
</div>
|
1754 |
</form>
|
1755 |
</div>
|
1756 |
<?php
|
1757 |
+
}
|
|
|
|
|
|
|
1758 |
}
|
1759 |
|
1760 |
+
}
|
|
|
|
|
|
|
1761 |
|
1762 |
function my_action_javascript()
|
1763 |
{
|
1764 |
?>
|
1765 |
<script type="text/javascript" >
|
1766 |
+
jQuery( document ).ready( function($)
|
1767 |
{
|
1768 |
+
$( "table#cart_data a.remove_cart" ).click( function()
|
1769 |
{
|
1770 |
+
var y = confirm( 'Are you sure you want to delete this Abandoned Order' );
|
1771 |
+
if( y == true )
|
|
|
1772 |
{
|
1773 |
+
var passed_id = this.id;
|
1774 |
+
var arr = passed_id.split('-');
|
1775 |
var abandoned_order_id = arr[0];
|
1776 |
+
var user_id = arr[1];
|
1777 |
+
var data = {
|
1778 |
+
abandoned_order_id: abandoned_order_id,
|
1779 |
+
user_id : user_id,
|
1780 |
+
action : 'remove_cart_data'
|
1781 |
+
};
|
1782 |
|
1783 |
// since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
|
1784 |
+
$.post( ajaxurl, data, function( response )
|
1785 |
{
|
1786 |
//alert('Got this from the server: ' + response);
|
1787 |
+
$( "#row_" + abandoned_order_id ).hide();
|
1788 |
});
|
1789 |
+
}
|
1790 |
});
|
1791 |
});
|
1792 |
</script>
|
1798 |
|
1799 |
global $wpdb; // this is how you get access to the database
|
1800 |
|
1801 |
+
$abandoned_order_id = $_POST[ 'abandoned_order_id' ];
|
1802 |
+
$user_id = $_POST[ 'user_id' ];
|
1803 |
+
$action = $_POST[ 'action' ];
|
1804 |
|
1805 |
+
$query = "DELETE FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
1806 |
+
WHERE
|
1807 |
+
id = '%d' ";
|
|
|
|
|
1808 |
|
1809 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, $abandoned_order_id ) );
|
1810 |
die();
|
1811 |
}
|
1812 |
|
|
|
|
|
1813 |
function my_action_send_preview()
|
1814 |
{
|
1815 |
?>
|
1816 |
<script type="text/javascript" >
|
1817 |
|
1818 |
+
jQuery( document ).ready( function( $ )
|
1819 |
{
|
1820 |
+
$( "table#addedit_template input#preview_email" ).click( function()
|
1821 |
{
|
1822 |
+
|
1823 |
+
var from_name_preview = $( '#woocommerce_ac_from_name' ).val();
|
1824 |
+
var subject_email_preview = $( '#woocommerce_ac_email_subject' ).val();
|
1825 |
+
var body_email_preview = tinyMCE.activeEditor.getContent();
|
1826 |
+
var send_email_id = $( '#send_test_email' ).val();
|
1827 |
+
var data = {
|
1828 |
+
from_name_preview : from_name_preview,
|
1829 |
+
subject_email_preview: subject_email_preview,
|
1830 |
+
body_email_preview : body_email_preview,
|
1831 |
+
send_email_id : send_email_id,
|
1832 |
+
action : 'preview_email_sent'
|
1833 |
+
};
|
|
|
1834 |
|
1835 |
// since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
|
1836 |
+
$.post( ajaxurl, data, function( response )
|
1837 |
{
|
1838 |
+
$( "#preview_email_sent_msg" ).html( "<img src='<?php echo plugins_url(); ?>/woocommerce-abandoned-cart/images/check.jpg'> Email has been sent successfully." );
|
1839 |
+
$( "#preview_email_sent_msg" ).fadeIn();
|
1840 |
+
setTimeout( function(){$( "#preview_email_sent_msg" ).fadeOut();}, 3000 );
|
1841 |
//alert('Got this from the server: ' + response);
|
1842 |
});
|
1843 |
});
|
1848 |
|
1849 |
function preview_email_sent() {
|
1850 |
|
1851 |
+
$from_email_name = $_POST[ 'from_name_preview' ];
|
1852 |
+
$subject_email_preview = $_POST[ 'subject_email_preview' ];
|
1853 |
+
$body_email_preview = $_POST[ 'body_email_preview' ];
|
1854 |
+
$body_email_preview = str_replace( '{{customer.firstname}}', 'John', $body_email_preview );
|
1855 |
+
$body_email_preview = str_replace( '{{customer.lastname}}', 'Doe', $body_email_preview );
|
1856 |
+
$body_email_preview = str_replace( '{{customer.fullname}}', 'John'." ".'Doe', $body_email_preview );
|
1857 |
|
1858 |
$var = '<h3>'.__( "Your Shopping Cart", "woocommerce-ac" ).'</h3>
|
1859 |
<table border="0" cellpadding="10" cellspacing="0" class="templateDataTable">
|
1887 |
</tr>
|
1888 |
</table>';
|
1889 |
|
1890 |
+
$body_email_preview = str_replace( '{{products.cart}}', $var, $body_email_preview );
|
1891 |
+
if ( isset( $_POST[ 'send_email_id' ] ) ) {
|
1892 |
+
$to_email_preview = $_POST[ 'send_email_id' ];
|
1893 |
} else {
|
1894 |
$to_email_preview = "";
|
1895 |
+
}
|
1896 |
+
$user_email_from = get_option( 'admin_email' );
|
1897 |
$headers[] = "From: ".$from_email_name." <".$user_email_from.">"."\r\n";
|
1898 |
$headers[] = "Content-Type: text/html"."\r\n";
|
1899 |
|
1900 |
+
$body_email_final_preview = stripslashes( $body_email_preview );
|
1901 |
wp_mail( $to_email_preview, $subject_email_preview, __( $body_email_final_preview, 'woocommerce-ac' ), $headers );
|
1902 |
|
1903 |
echo "email sent";
|
1904 |
|
1905 |
die();
|
1906 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1907 |
}
|
1908 |
|
1909 |
}
|
1910 |
|
1911 |
$woocommerce_abandon_cart = new woocommerce_abandon_cart();
|
1912 |
|
1913 |
+
|
1914 |
|
1915 |
?>
|