Version Description
- New feature - width and height styling properties for radio elements
- New feature - width and height styling properties for checkbox elements
- Improvements - general bugfixing
Download this release
Release Info
Developer | mlehelsz |
Plugin | Contact Form 7 Style |
Version | 3.0.1 |
Comparing to | |
See all releases |
Code changes from version 3.0 to 3.0.1
- admin/js/admin.js +1 -28
- admin/js/overall.js +27 -0
- cf7-style.php +5 -3
- css/frontend.css +7 -4
- misc/tracking.php +20 -7
- options.php +3 -3
- readme.txt +9 -12
admin/js/admin.js
CHANGED
@@ -80,6 +80,7 @@ function getPreviewElements(previewType) {
|
|
80 |
newValue = _t.val();
|
81 |
}
|
82 |
}
|
|
|
83 |
$('.preview-form-container ' + newElem).css(splitArray[1], newValue);
|
84 |
}
|
85 |
});
|
@@ -276,18 +277,6 @@ function codeMirrorInit() {
|
|
276 |
}
|
277 |
}
|
278 |
|
279 |
-
function dismissRemoveMessage() {
|
280 |
-
$.ajax({
|
281 |
-
'url': ajaxurl,
|
282 |
-
'method': 'POST',
|
283 |
-
'data': {
|
284 |
-
'action': 'cf7_style_remove_box'
|
285 |
-
},
|
286 |
-
'success': function(data) {}
|
287 |
-
});
|
288 |
-
}
|
289 |
-
|
290 |
-
|
291 |
jQuery(document).ready(function($) {
|
292 |
|
293 |
var previewEl = $(".generate-preview"),
|
@@ -378,11 +367,6 @@ jQuery(document).ready(function($) {
|
|
378 |
});
|
379 |
}
|
380 |
});
|
381 |
-
$('.remove_template_notice').on('click', function(e) {
|
382 |
-
e.preventDefault();
|
383 |
-
$('.template-message-box').fadeOut('slow');
|
384 |
-
dismissRemoveMessage();
|
385 |
-
});
|
386 |
$('.close-cf7-panel').on('click', function(e) {
|
387 |
e.preventDefault();
|
388 |
$.ajax({
|
@@ -396,15 +380,4 @@ jQuery(document).ready(function($) {
|
|
396 |
}
|
397 |
});
|
398 |
});
|
399 |
-
$(document).on('change', '#cf7_style_allow_tracking', function() {
|
400 |
-
$.post(ajaxurl, "action=cf7_style_allow_tracking&cf7_style_allow_tracking=1", function(res) {});
|
401 |
-
$('.cf7style-pointer').hide();
|
402 |
-
return false;
|
403 |
-
});
|
404 |
-
$(document).on('click', '.cf7style-pointer a.close', function() {
|
405 |
-
$.post(ajaxurl, "action=cf7_style_allow_tracking&cf7_style_allow_tracking=0", function(res) {});
|
406 |
-
$('.cf7style-pointer').hide();
|
407 |
-
return false;
|
408 |
-
});
|
409 |
-
|
410 |
}); /*doc.ready end*/
|
80 |
newValue = _t.val();
|
81 |
}
|
82 |
}
|
83 |
+
newElem = (newElem == 'radio') ? 'input[type="radio"]' : (newElem == 'checkbox') ? 'input[type="checkbox"]' : newElem;
|
84 |
$('.preview-form-container ' + newElem).css(splitArray[1], newValue);
|
85 |
}
|
86 |
});
|
277 |
}
|
278 |
}
|
279 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
jQuery(document).ready(function($) {
|
281 |
|
282 |
var previewEl = $(".generate-preview"),
|
367 |
});
|
368 |
}
|
369 |
});
|
|
|
|
|
|
|
|
|
|
|
370 |
$('.close-cf7-panel').on('click', function(e) {
|
371 |
e.preventDefault();
|
372 |
$.ajax({
|
380 |
}
|
381 |
});
|
382 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
383 |
}); /*doc.ready end*/
|
admin/js/overall.js
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var $ = jQuery.noConflict();
|
2 |
+
function dismissRemoveMessage() {
|
3 |
+
$.ajax({
|
4 |
+
'url': ajaxurl,
|
5 |
+
'method': 'POST',
|
6 |
+
'data': {
|
7 |
+
'action': 'cf7_style_remove_box'
|
8 |
+
},
|
9 |
+
'success': function(data) {}
|
10 |
+
});
|
11 |
+
}
|
12 |
+
$(document).ready(function() {
|
13 |
+
$('.remove_template_notice').on('click', function(e) {
|
14 |
+
e.preventDefault();
|
15 |
+
$('.template-message-box').fadeOut('slow');
|
16 |
+
dismissRemoveMessage();
|
17 |
+
});
|
18 |
+
$(document).on('click', '.cf7style-pointer a.close', function() {
|
19 |
+
if($('#cf7_style_allow_tracking').is(":checked")){
|
20 |
+
$.post(ajaxurl, "action=cf7_style_allow_tracking&cf7_style_allow_tracking=1", function(res) {});
|
21 |
+
} else {
|
22 |
+
$.post(ajaxurl, "action=cf7_style_show_tracking&cf7_style_allow_tracking=0", function(res) {});
|
23 |
+
}
|
24 |
+
$('.cf7style-pointer').hide();
|
25 |
+
return false;
|
26 |
+
});
|
27 |
+
});
|
cf7-style.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Contact Form 7 Style
|
4 |
Plugin URI: http://wordpress.reea.net/contact-form-7-style/
|
5 |
Description: Simple style customization and templating for Contact Form 7 forms. Requires Contact Form 7 plugin installed.
|
6 |
-
Version: 3.0
|
7 |
Author: Johnny, dorumarginean, mlehelsz, MirceaR
|
8 |
Author URI: http://cf7style.com
|
9 |
License: GPL2
|
@@ -17,7 +17,7 @@ define( 'WPCF7S_PLUGIN', __FILE__ );
|
|
17 |
define( 'WPCF7S_PLUGIN_DIR', untrailingslashit( dirname( WPCF7S_PLUGIN ) ) );
|
18 |
|
19 |
function set_styleversion(){
|
20 |
-
return "3.0";
|
21 |
}
|
22 |
|
23 |
function get_predefined_cf7_style_template_data() {
|
@@ -231,6 +231,7 @@ function cf7_style_admin_scripts($hook){
|
|
231 |
global $post_type;
|
232 |
$cur_plug_url = plugin_dir_url( __FILE__ );
|
233 |
wp_enqueue_style( "cf7-style-bar-style", $cur_plug_url . "css/admin-bar.css", array(), set_styleversion(), "all");
|
|
|
234 |
if( 'cf7_style_page_cf7style-css-editor' == $hook ){
|
235 |
wp_enqueue_script( "cf7_style_codemirror_js", $cur_plug_url . "admin/js/codemirror.js", array( 'jquery' ), false, true );
|
236 |
wp_enqueue_style( "cf7-style-codemirror-style", $cur_plug_url . "admin/css/codemirror.css", array(), set_styleversion(), "all" );
|
@@ -501,6 +502,7 @@ function cf7style_load_elements(){
|
|
501 |
require_once( 'cf7-style-match-old.php' );
|
502 |
$new_settings = get_new_styler_data( $cf7s_custom_old_settings );
|
503 |
update_post_meta( $cur_style_id, 'cf7_style_manual_styles', '');
|
|
|
504 |
update_post_meta( $cur_style_id, 'cf7_style_custom_styler', serialize( $new_settings ), "");
|
505 |
}
|
506 |
}
|
@@ -663,7 +665,7 @@ add_action( 'wp_ajax_cf7_style_remove_welcome_box', 'cf7_style_remove_welcome_bo
|
|
663 |
|
664 |
function cf7_style_frontend_edit_link( $form ) {
|
665 |
|
666 |
-
if( is_user_logged_in() && current_user_can( 'manage_options' ) ) {
|
667 |
|
668 |
$cf7 = wpcf7_get_current_contact_form(); // Current contact form 7 object
|
669 |
$form_id = get_form_id( $cf7 );
|
3 |
Plugin Name: Contact Form 7 Style
|
4 |
Plugin URI: http://wordpress.reea.net/contact-form-7-style/
|
5 |
Description: Simple style customization and templating for Contact Form 7 forms. Requires Contact Form 7 plugin installed.
|
6 |
+
Version: 3.0.1
|
7 |
Author: Johnny, dorumarginean, mlehelsz, MirceaR
|
8 |
Author URI: http://cf7style.com
|
9 |
License: GPL2
|
17 |
define( 'WPCF7S_PLUGIN_DIR', untrailingslashit( dirname( WPCF7S_PLUGIN ) ) );
|
18 |
|
19 |
function set_styleversion(){
|
20 |
+
return "3.0.1";
|
21 |
}
|
22 |
|
23 |
function get_predefined_cf7_style_template_data() {
|
231 |
global $post_type;
|
232 |
$cur_plug_url = plugin_dir_url( __FILE__ );
|
233 |
wp_enqueue_style( "cf7-style-bar-style", $cur_plug_url . "css/admin-bar.css", array(), set_styleversion(), "all");
|
234 |
+
wp_enqueue_script( "cf7_style_overall", $cur_plug_url . "admin/js/overall.js", array(), false, true );
|
235 |
if( 'cf7_style_page_cf7style-css-editor' == $hook ){
|
236 |
wp_enqueue_script( "cf7_style_codemirror_js", $cur_plug_url . "admin/js/codemirror.js", array( 'jquery' ), false, true );
|
237 |
wp_enqueue_style( "cf7-style-codemirror-style", $cur_plug_url . "admin/css/codemirror.css", array(), set_styleversion(), "all" );
|
502 |
require_once( 'cf7-style-match-old.php' );
|
503 |
$new_settings = get_new_styler_data( $cf7s_custom_old_settings );
|
504 |
update_post_meta( $cur_style_id, 'cf7_style_manual_styles', '');
|
505 |
+
update_post_meta( $cur_style_id, 'cf7_style_custom_styles', '');
|
506 |
update_post_meta( $cur_style_id, 'cf7_style_custom_styler', serialize( $new_settings ), "");
|
507 |
}
|
508 |
}
|
665 |
|
666 |
function cf7_style_frontend_edit_link( $form ) {
|
667 |
|
668 |
+
if( is_user_logged_in() && current_user_can( 'manage_options' ) && !is_admin()) {
|
669 |
|
670 |
$cf7 = wpcf7_get_current_contact_form(); // Current contact form 7 object
|
671 |
$form_id = get_form_id( $cf7 );
|
css/frontend.css
CHANGED
@@ -1496,13 +1496,16 @@ body .twenty-fifteen-pattern input[type="submit"]:hover {
|
|
1496 |
-webkit-box-shadow: none;
|
1497 |
box-shadow: none;
|
1498 |
text-decoration: none;
|
1499 |
-
background: #
|
1500 |
-
color: #
|
1501 |
-
opacity: 0.8;
|
1502 |
-webkit-border-radius: 5px;
|
1503 |
border-radius: 5px;
|
|
|
|
|
|
|
1504 |
}
|
1505 |
|
1506 |
.logged-in .frontend-edit-style-link:hover {
|
1507 |
-
|
|
|
1508 |
}
|
1496 |
-webkit-box-shadow: none;
|
1497 |
box-shadow: none;
|
1498 |
text-decoration: none;
|
1499 |
+
background: #E74C3C;
|
1500 |
+
color: #FFF;
|
|
|
1501 |
-webkit-border-radius: 5px;
|
1502 |
border-radius: 5px;
|
1503 |
+
border: 1px solid #E74C3C;
|
1504 |
+
font-size: 13px;
|
1505 |
+
line-height: 135%;
|
1506 |
}
|
1507 |
|
1508 |
.logged-in .frontend-edit-style-link:hover {
|
1509 |
+
background-color: #fff;
|
1510 |
+
color: #E74C3C;
|
1511 |
}
|
misc/tracking.php
CHANGED
@@ -40,9 +40,10 @@ if ( !function_exists( 'cf7_style_tracking_enque_script' ) ) {
|
|
40 |
*/
|
41 |
if ( !function_exists( 'cf7_style_print_tooltip' ) ) {
|
42 |
function cf7_style_print_tooltip() {
|
43 |
-
$pointer_content = '<h3>Contact Form 7 Style
|
44 |
-
$pointer_content .= '<p>
|
45 |
-
$pointer_content .= '<p
|
|
|
46 |
<script type="text/javascript">
|
47 |
//<![CDATA[
|
48 |
jQuery(document).ready( function($) {
|
@@ -51,7 +52,6 @@ if ( !function_exists( 'cf7_style_print_tooltip' ) ) {
|
|
51 |
content: '<?php echo $pointer_content; ?>',
|
52 |
position: 'left',
|
53 |
close: function() {
|
54 |
-
$.post( ajaxurl, "action=cf7_style_allow_tracking&cf7_style_allow_tracking=0", function(res){});
|
55 |
$('.cf7style-pointer').hide();
|
56 |
return false;
|
57 |
}
|
@@ -82,15 +82,28 @@ if ( !function_exists( 'cf7_style_allow_tracking' ) ) {
|
|
82 |
if ( $allowedornot == '1' ) {
|
83 |
update_option( 'cf7_style_allow_tracking', '1' );
|
84 |
cf7style_send_tracking_info( $allowedornot, '1' );
|
85 |
-
} else {
|
86 |
-
update_option( 'cf7_style_allow_tracking', '0' );
|
87 |
-
cf7style_send_tracking_info( $allowedornot, '1' );
|
88 |
}
|
89 |
die();
|
90 |
}
|
91 |
}
|
92 |
add_action( 'wp_ajax_cf7_style_allow_tracking', 'cf7_style_allow_tracking' );
|
93 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
|
95 |
/*
|
96 |
* send traciking info function
|
40 |
*/
|
41 |
if ( !function_exists( 'cf7_style_print_tooltip' ) ) {
|
42 |
function cf7_style_print_tooltip() {
|
43 |
+
$pointer_content = '<h3>Thank You for choosing<br/>Contact Form 7 Style!</h3>';
|
44 |
+
$pointer_content .= '<p>Want to help make CF7 Style even more better? Allow Us to collect non-sensitive diagnostic data.</p>';
|
45 |
+
$pointer_content .= '<p>We will only collect your website URL, WordPress version, CF7Style plugin version and active status.</p>';
|
46 |
+
$pointer_content .= '<p><label for="cf7_style_allow_tracking">Allow collecting data:</label> <input id="cf7_style_allow_tracking" type="checkbox" checked="checked" value="1" name="cf7_style_allow_tracking" /></p>'; ?>
|
47 |
<script type="text/javascript">
|
48 |
//<![CDATA[
|
49 |
jQuery(document).ready( function($) {
|
52 |
content: '<?php echo $pointer_content; ?>',
|
53 |
position: 'left',
|
54 |
close: function() {
|
|
|
55 |
$('.cf7style-pointer').hide();
|
56 |
return false;
|
57 |
}
|
82 |
if ( $allowedornot == '1' ) {
|
83 |
update_option( 'cf7_style_allow_tracking', '1' );
|
84 |
cf7style_send_tracking_info( $allowedornot, '1' );
|
|
|
|
|
|
|
85 |
}
|
86 |
die();
|
87 |
}
|
88 |
}
|
89 |
add_action( 'wp_ajax_cf7_style_allow_tracking', 'cf7_style_allow_tracking' );
|
90 |
}
|
91 |
+
if ( !function_exists( 'cf7_style_show_tracking' ) ) {
|
92 |
+
function cf7_style_show_tracking() {
|
93 |
+
if ( $_POST['action'] == 'cf7_style_show_tracking' ) {
|
94 |
+
if ( !is_numeric( $_POST['cf7_style_allow_tracking'] ) ) {
|
95 |
+
die();
|
96 |
+
}
|
97 |
+
$allowedornot = $_POST['cf7_style_allow_tracking'];
|
98 |
+
if ( $allowedornot == '0' ) {
|
99 |
+
update_option( 'cf7_style_allow_tracking', '0' );
|
100 |
+
}
|
101 |
+
die();
|
102 |
+
}
|
103 |
+
}
|
104 |
+
add_action( 'wp_ajax_cf7_style_show_tracking', 'cf7_style_show_tracking' );
|
105 |
+
}
|
106 |
+
|
107 |
|
108 |
/*
|
109 |
* send traciking info function
|
options.php
CHANGED
@@ -171,12 +171,12 @@ $elements = array(
|
|
171 |
'checkbox' => array(
|
172 |
'name' => 'checkboxes',
|
173 |
'description' => '',
|
174 |
-
'settings' => array("
|
175 |
),
|
176 |
-
'radio
|
177 |
'name' => 'radio buttons',
|
178 |
'description' => '',
|
179 |
-
'settings' => array("
|
180 |
),
|
181 |
'file' => array(
|
182 |
'name' => 'file',
|
171 |
'checkbox' => array(
|
172 |
'name' => 'checkboxes',
|
173 |
'description' => '',
|
174 |
+
'settings' => array( "width", "height" )
|
175 |
),
|
176 |
+
'radio' => array(
|
177 |
'name' => 'radio buttons',
|
178 |
'description' => '',
|
179 |
+
'settings' => array( "width", "height" )
|
180 |
),
|
181 |
'file' => array(
|
182 |
'name' => 'file',
|
readme.txt
CHANGED
@@ -60,6 +60,11 @@ You will find 'Contact Style' menu in your WordPress admin panel.
|
|
60 |
|
61 |
== Changelog ==
|
62 |
|
|
|
|
|
|
|
|
|
|
|
63 |
= 3.0.0 =
|
64 |
* UI rework, update, redesign
|
65 |
* New feature - Live Preview on all element changes with the actual Contact Form 7 form where the styling is applied
|
@@ -142,15 +147,7 @@ You will find 'Contact Style' menu in your WordPress admin panel.
|
|
142 |
* First plugin version.
|
143 |
|
144 |
== Upgrade Notice ==
|
145 |
-
= Contact Form 7 Style Version 3.0.
|
146 |
-
*
|
147 |
-
* New feature -
|
148 |
-
*
|
149 |
-
* New feature - Style Selector Slider on Contact Form 7 Settings page, for quick style selection
|
150 |
-
* New feature - Introduced new unit selector
|
151 |
-
* New feature - Introduced new background-image add-on
|
152 |
-
* New feature - Introduced new styling properties
|
153 |
-
* New feature - Introduced fieldset, dropdowns, radio, checkbox
|
154 |
-
* Improvements - Bugfixing, running process, code updates
|
155 |
-
* Improvements - Modified Custom Styling logic and add it to new settings page
|
156 |
-
* Improvements - Message boxes behaviour
|
60 |
|
61 |
== Changelog ==
|
62 |
|
63 |
+
= 3.0.1 =
|
64 |
+
* New feature - width and height styling properties for radio elements
|
65 |
+
* New feature - width and height styling properties for checkbox elements
|
66 |
+
* Improvements - general bugfixing
|
67 |
+
|
68 |
= 3.0.0 =
|
69 |
* UI rework, update, redesign
|
70 |
* New feature - Live Preview on all element changes with the actual Contact Form 7 form where the styling is applied
|
147 |
* First plugin version.
|
148 |
|
149 |
== Upgrade Notice ==
|
150 |
+
= Contact Form 7 Style Version 3.0.1 =
|
151 |
+
* New feature - width and height styling properties for radio elements
|
152 |
+
* New feature - width and height styling properties for checkbox elements
|
153 |
+
* Improvements - general bugfixing
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|