Contact Form 7 Style - Version 3.0.3

Version Description

  • Major Fix JQuery conflict with Siteorigin Page Builder and Visual Composer
Download this release

Release Info

Developer mlehelsz
Plugin Icon 128x128 Contact Form 7 Style
Version 3.0.3
Comparing to
See all releases

Code changes from version 3.0.2 to 3.0.3

Files changed (4) hide show
  1. admin/js/admin.js +251 -254
  2. admin/js/overall.js +2 -4
  3. cf7-style.php +6 -3
  4. readme.txt +6 -6
admin/js/admin.js CHANGED
@@ -1,291 +1,288 @@
1
  /*
2
  jQuery functions for the Admin area
3
  */
4
- var $ = jQuery.noConflict();
5
-
6
- String.prototype.filename = function(extension) {
7
- var s = this.replace(/\\/g, '/');
8
- s = s.substring(s.lastIndexOf('/') + 1);
9
- return extension ? s.replace(/[?#].+$/, '') : s.split('.')[0];
10
- }
11
-
12
- function changeFont(value) {
13
- $(".google-fontos").remove();
14
- if ("none" != value && "undefined" != typeof value) {
15
- $("head").append('<link class="google-fontos" rel="stylesheet" href="http://fonts.googleapis.com/css?family=' + value + ':100,200,300,400,500,600,700,800,900&subset=latin,latin-ext,cyrillic,cyrillic-ext,greek-ext,greek,vietnamese" />');
16
- $(".cf7-style.preview-zone p").css("font-family", "'" + value + "', sans-serif");
17
- $('.preview-form-container .wpcf7').css("font-family", "'" + value + "', sans-serif");
18
  }
19
- }
20
-
21
- function scrolling(element) {
22
- $(window).scroll(function() {
23
- if ($(window).width() > 1600) {
24
- var offset = element.find('.panel-header').offset(),
25
- cf7styleOffset = $('#cf7_style_meta_box_style_customizer').offset(),
26
- diff = $(window).scrollTop() - cf7styleOffset.top;
27
- if (diff > 0) {
28
- element.find('.panel-header').css('top', diff);
29
- }
30
- if (diff <= 0) {
31
- element.find('.panel-header').css('top', 0);
32
- }
33
- }
34
- if ($(window).scrollTop() > 700) {
35
- $('.fixed-save-style').show();
36
- } else {
37
- $('.fixed-save-style').hide();
38
- }
39
 
40
- }).trigger('scroll');
41
- }
42
-
43
- function autoCompleteOtherValues() {
44
- $("input[type='number']").on("change", function() {
45
- var value = $(this).val(),
46
- indexor = $(this).index(),
47
- allInput = $(this).parent().find("input[type=number]");
48
- switch (indexor) {
49
- case 2:
50
- allInput.val(value);
51
- break;
52
- case 5:
53
- allInput.eq(3).val(value);
54
- break;
55
  }
56
- });
57
- }
58
-
59
- function getPreviewElements(previewType) {
60
- var notElem = (previewType == "hover") ? "" : ",[name*='hover']";
61
- $('[name^=cf7stylecustom]').not("[name*='unit']" + notElem).each(function() {
62
- var _t = $(this);
63
- if (_t.attr('value').length > 0) {
64
- var elem_name = _t.attr('name'),
65
- splitArray = elem_name.substr(15).replace("]", "").split("_"),
66
- newElem = splitArray[0],
67
- unit = _t.parent().find('select[name*="unit"]').val();
68
- if (splitArray[0] == "submit") {
69
- newElem = "input[type='submit']";
 
 
 
 
 
70
  }
71
- if (splitArray[0] == "form") {
72
- newElem = ".wpcf7";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
 
75
- unit = (typeof unit == 'undefined' || _t.val() == "") ? "" : unit;
76
- var newValue = _t.val() + unit;
77
- if (_t.hasClass('cf7-style-upload-field')) {
78
- newValue = 'url(' + _t.val() + ')';
79
- if (_t.val() == "") {
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
- });
87
- }
88
 
89
- function selectAllForms(element) {
90
- element.on("click", function() {
91
- $(".cf7style_body_select_all input").prop('checked', ($(this).is(":checked")) ? true : false);
92
- });
93
- }
94
-
95
- function cf7_slider(elem, slideWidth, animationSpeed, showArrows) {
96
-
97
- var active = elem.find('.active'),
98
- index = active.index() + 1,
99
- slide = elem.find('li'),
100
- sliderViewport = elem.find('ul'),
101
- arrow = elem.find('.narrow'),
102
- arrowLeft = elem.find('.narrow.left'),
103
- arrowRight = elem.find('.narrow.right'),
104
- totalSlides = elem.find('li').length;
105
-
106
- arrowRight.addClass('visible');
107
- sliderViewport.css('width', totalSlides * slideWidth);
108
-
109
- if (showArrows == false) {
110
- elem.mouseenter(function() {
111
- elem.find('.visible').stop().show();
112
- }).mouseleave(function() {
113
- elem.find('.visible').stop().hide();
114
  });
115
  }
116
 
117
- arrow.on('click', function(e) {
118
- e.stopPropagation();
119
- e.preventDefault();
120
- var direction = $(this).attr('data-direction');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
 
122
- if (direction == "left" && index !== 1) {
123
- sliderViewport.stop(true, true).animate({
124
- marginLeft: "+=" + (slideWidth) + "px"
125
- }, animationSpeed);
126
 
127
- index--;
128
- }
 
 
129
 
130
- if (direction == "right" && index !== totalSlides) {
131
- sliderViewport.stop(true, true).animate({
132
- marginLeft: -(slideWidth * index) + "px"
133
- }, animationSpeed);
134
 
135
- index++;
136
- }
 
 
137
 
138
- if (index == 1) {
139
- arrowLeft.hide().removeClass('visible');
140
- arrowRight.show().addClass('visible');
141
- }
142
 
143
- if (index == totalSlides) {
144
- arrowRight.hide().removeClass('visible');
145
- }
 
146
 
147
- if (index < totalSlides) {
148
- arrowRight.show().addClass('visible');
149
- }
150
 
151
- if (index > 1) {
152
- arrowLeft.show().addClass('visible');
153
- }
154
 
155
- slide.removeClass('active').eq(index - 1).addClass('active');
156
- });
157
- sliderViewport.css({
158
- 'margin-left': '-' + (index - 1) * slideWidth + 'px'
159
- });
160
- }
161
-
162
- function sliderInit(element) {
163
- cf7_slider(element, 202, 500, true);
164
- element.find('li').on('click', function() {
165
- if (!$(this).hasClass('current-saved')) {
166
- element.find('li').removeClass('current-saved');
167
- $(this).addClass('current-saved');
168
- element.find('.overlay em').html('Not Active');
169
- $(this).find('.overlay em').html('Active');
170
- $('.cf7style_template').removeAttr('checked');
171
- $(this).find('.cf7style_template').attr("checked", "checked");
172
- }
173
- });
174
- }
175
 
176
- function showTheOption() {
177
- $('#form-tag a.button').on('click', function(e) {
178
- e.preventDefault();
179
- var _t = $(this);
180
- var currentElement = $('.' + _t.attr('data-property') + '-panel');
181
- if (!_t.hasClass('button-primary')) {
182
- $('.panel').stop(true, true).animate({
183
- 'opacity': 0
184
- }, 300, function() {
185
- $('.panel').addClass('hidden');
186
- currentElement.css('opacity', '0');
187
- currentElement.removeClass('hidden');
188
- currentElement.stop(true, true).animate({
189
- 'opacity': 1
190
- }, 300);
191
- });
192
 
193
- $(".element-selector input:eq(0)").prop("checked", true);
194
- }
195
- $('#form-tag a.button').removeClass('button-primary');
196
- _t.addClass('button-primary');
197
- $('input[name="cf7styleactivepane"]').val(_t.attr('data-property'));
198
- });
 
 
 
 
 
 
 
199
 
200
- $('.element-selector input').on('change', function() {
201
- $('.element-selector input').prop('checked', false);
202
- $(this).prop('checked', true);
203
- if ($(this).val() == "hover") {
204
- $('.panel:visible li').addClass('hidden');
205
- $('.panel:visible li.hover-element').removeClass('hidden');
206
- getPreviewElements("hover");
207
- } else {
208
- $('.panel:visible li.hover-element').addClass('hidden');
209
- $('.panel:visible li').not('.hover-element').removeClass('hidden');
210
- getPreviewElements();
211
- }
212
- });
213
- $('#form-preview').on('change', function() {
214
- $('.preview-form-container').addClass('hidden');
215
- $('.preview-form-container').eq($(this).val()).removeClass('hidden');
216
- });
217
- $('[name^="cf7stylecustom"]').on("change", function() {
218
- if ($('input[name="element-type"]:checked').val() == "hover") {
219
- getPreviewElements('hover');
220
- } else {
221
- getPreviewElements();
222
- }
223
- });
224
- $('[name^="cf7stylecustom"]').on("keyup", function() {
225
- if ($('input[name="element-type"]:checked').val() == "hover") {
226
- getPreviewElements('hover');
227
- } else {
228
- getPreviewElements();
229
- }
230
- });
231
- }
232
 
233
- function removePreviewfields(element) {
234
- element.remove();
235
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
 
237
- function disableSubmit(element) {
238
- element.on('click', function(e) {
239
- e.preventDefault();
240
- });
241
- }
242
-
243
- function addBgImage() {
244
- var bgFormInput = $('.cf7-style-upload-field');
245
- bgFormInput.addClass('hidden');
246
- bgFormInput.each(function() {
247
- var _t = $(this);
248
- $('<span class="image-info-box"></span>').insertAfter(_t);
249
- if (_t.val() != "") {
250
- _t.parent().find('.image-info-box').text(_t.val().filename('yes'));
251
- }
252
- });
253
- if ($('.upload-btn').length <= 0) {
254
- $("<a href='javascript: void(0);' class='remove-btn button'>Remove</a>").insertAfter(bgFormInput);
255
- $("<a href='javascript: void(0);' class='upload-btn button'>Upload</a>").insertAfter(bgFormInput);
256
  }
257
- $('.upload-btn').on('click', function() {
258
- var _t = $(this),
259
- currentimage = _t.parent().find('.cf7-style-upload-field');
260
- tb_show('New Banner', 'media-upload.php?type=image&TB_iframe=1');
261
- window.send_to_editor = function(html) {
262
- currentimage.val($(html).attr('src'));
263
- currentimage.trigger('change');
264
- _t.parent().find('.image-info-box').text($(html).attr('src').filename('yes'));
265
- tb_remove();
 
 
 
 
 
 
 
 
 
 
 
266
  }
267
- });
268
- $('.remove-btn').on('click', function() {
269
- var _t = $(this),
270
- currentimage = _t.parent().find('.cf7-style-upload-field');
271
- currentimage.val(' ');
272
- currentimage.attr('value', ' ');
273
- currentimage.trigger('change');
274
- _t.parent().find('.image-info-box').text('');
275
- });
276
- }
277
-
278
- function codeMirrorInit() {
279
- if ($("#cf7_style_manual_style").length > 0) {
280
- var editor = CodeMirror.fromTextArea(document.getElementById("cf7_style_manual_style"), {
281
- lineNumbers: true,
282
- theme: "default",
283
- mode: "text/css"
 
284
  });
285
  }
286
- }
287
 
288
- jQuery(document).ready(function($) {
 
 
 
 
 
 
 
 
289
  if ($('.cf7style-no-forms-added').length > 0) {
290
  $('.generate-preview-button, .generate-preview-option').show();
291
  } else {
1
  /*
2
  jQuery functions for the Admin area
3
  */
4
+ jQuery(document).ready(function($) {
5
+ String.prototype.filename = function(extension) {
6
+ var s = this.replace(/\\/g, '/');
7
+ s = s.substring(s.lastIndexOf('/') + 1);
8
+ return extension ? s.replace(/[?#].+$/, '') : s.split('.')[0];
 
 
 
 
 
 
 
 
 
9
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
+ function changeFont(value) {
12
+ $(".google-fontos").remove();
13
+ if ("none" != value && "undefined" != typeof value) {
14
+ $("head").append('<link class="google-fontos" rel="stylesheet" href="http://fonts.googleapis.com/css?family=' + value + ':100,200,300,400,500,600,700,800,900&subset=latin,latin-ext,cyrillic,cyrillic-ext,greek-ext,greek,vietnamese" />');
15
+ $(".cf7-style.preview-zone p").css("font-family", "'" + value + "', sans-serif");
16
+ $('.preview-form-container .wpcf7').css("font-family", "'" + value + "', sans-serif");
 
 
 
 
 
 
 
 
 
17
  }
18
+ }
19
+
20
+ function scrolling(element) {
21
+ $(window).scroll(function() {
22
+ if ($(window).width() > 1600) {
23
+ var offset = element.find('.panel-header').offset(),
24
+ cf7styleOffset = $('#cf7_style_meta_box_style_customizer').offset(),
25
+ diff = $(window).scrollTop() - cf7styleOffset.top;
26
+ if (diff > 0) {
27
+ element.find('.panel-header').css('top', diff);
28
+ }
29
+ if (diff <= 0) {
30
+ element.find('.panel-header').css('top', 0);
31
+ }
32
+ }
33
+ if ($(window).scrollTop() > 700) {
34
+ $('.fixed-save-style').show();
35
+ } else {
36
+ $('.fixed-save-style').hide();
37
  }
38
+
39
+ }).trigger('scroll');
40
+ }
41
+
42
+ function autoCompleteOtherValues() {
43
+ $("input[type='number']").on("change", function() {
44
+ var value = $(this).val(),
45
+ indexor = $(this).index(),
46
+ allInput = $(this).parent().find("input[type=number]");
47
+ switch (indexor) {
48
+ case 2:
49
+ allInput.val(value);
50
+ break;
51
+ case 5:
52
+ allInput.eq(3).val(value);
53
+ break;
54
  }
55
+ });
56
+ }
57
+
58
+ function getPreviewElements(previewType) {
59
+ var notElem = (previewType == "hover") ? "" : ",[name*='hover']";
60
+ $('[name^=cf7stylecustom]').not("[name*='unit']" + notElem).each(function() {
61
+ var _t = $(this);
62
+ if (_t.attr('value').length > 0) {
63
+ var elem_name = _t.attr('name'),
64
+ splitArray = elem_name.substr(15).replace("]", "").split("_"),
65
+ newElem = splitArray[0],
66
+ unit = _t.parent().find('select[name*="unit"]').val();
67
+ if (splitArray[0] == "submit") {
68
+ newElem = "input[type='submit']";
69
+ }
70
+ if (splitArray[0] == "form") {
71
+ newElem = ".wpcf7";
72
+ }
73
 
74
+ unit = (typeof unit == 'undefined' || _t.val() == "") ? "" : unit;
75
+ var newValue = _t.val() + unit;
76
+ if (_t.hasClass('cf7-style-upload-field')) {
77
+ newValue = 'url(' + _t.val() + ')';
78
+ if (_t.val() == "") {
79
+ newValue = _t.val();
80
+ }
81
  }
82
+ newElem = (newElem == 'radio') ? 'input[type="radio"]' : (newElem == 'checkbox') ? 'input[type="checkbox"]' : newElem;
83
+ $('.preview-form-container ' + newElem).css(splitArray[1], newValue);
84
  }
85
+ });
86
+ }
 
 
 
87
 
88
+ function selectAllForms(element) {
89
+ element.on("click", function() {
90
+ $(".cf7style_body_select_all input").prop('checked', ($(this).is(":checked")) ? true : false);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  });
92
  }
93
 
94
+ function cf7_slider(elem, slideWidth, animationSpeed, showArrows) {
95
+
96
+ var active = elem.find('.active'),
97
+ index = active.index() + 1,
98
+ slide = elem.find('li'),
99
+ sliderViewport = elem.find('ul'),
100
+ arrow = elem.find('.narrow'),
101
+ arrowLeft = elem.find('.narrow.left'),
102
+ arrowRight = elem.find('.narrow.right'),
103
+ totalSlides = elem.find('li').length;
104
+
105
+ arrowRight.addClass('visible');
106
+ sliderViewport.css('width', totalSlides * slideWidth);
107
+
108
+ if (showArrows == false) {
109
+ elem.mouseenter(function() {
110
+ elem.find('.visible').stop().show();
111
+ }).mouseleave(function() {
112
+ elem.find('.visible').stop().hide();
113
+ });
114
+ }
115
 
116
+ arrow.on('click', function(e) {
117
+ e.stopPropagation();
118
+ e.preventDefault();
119
+ var direction = $(this).attr('data-direction');
120
 
121
+ if (direction == "left" && index !== 1) {
122
+ sliderViewport.stop(true, true).animate({
123
+ marginLeft: "+=" + (slideWidth) + "px"
124
+ }, animationSpeed);
125
 
126
+ index--;
127
+ }
 
 
128
 
129
+ if (direction == "right" && index !== totalSlides) {
130
+ sliderViewport.stop(true, true).animate({
131
+ marginLeft: -(slideWidth * index) + "px"
132
+ }, animationSpeed);
133
 
134
+ index++;
135
+ }
 
 
136
 
137
+ if (index == 1) {
138
+ arrowLeft.hide().removeClass('visible');
139
+ arrowRight.show().addClass('visible');
140
+ }
141
 
142
+ if (index == totalSlides) {
143
+ arrowRight.hide().removeClass('visible');
144
+ }
145
 
146
+ if (index < totalSlides) {
147
+ arrowRight.show().addClass('visible');
148
+ }
149
 
150
+ if (index > 1) {
151
+ arrowLeft.show().addClass('visible');
152
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
 
154
+ slide.removeClass('active').eq(index - 1).addClass('active');
155
+ });
156
+ sliderViewport.css({
157
+ 'margin-left': '-' + (index - 1) * slideWidth + 'px'
158
+ });
159
+ }
 
 
 
 
 
 
 
 
 
 
160
 
161
+ function sliderInit(element) {
162
+ cf7_slider(element, 202, 500, true);
163
+ element.find('li').on('click', function() {
164
+ if (!$(this).hasClass('current-saved')) {
165
+ element.find('li').removeClass('current-saved');
166
+ $(this).addClass('current-saved');
167
+ element.find('.overlay em').html('Not Active');
168
+ $(this).find('.overlay em').html('Active');
169
+ $('.cf7style_template').removeAttr('checked');
170
+ $(this).find('.cf7style_template').attr("checked", "checked");
171
+ }
172
+ });
173
+ }
174
 
175
+ function showTheOption() {
176
+ $('#form-tag a.button').on('click', function(e) {
177
+ e.preventDefault();
178
+ var _t = $(this);
179
+ var currentElement = $('.' + _t.attr('data-property') + '-panel');
180
+ if (!_t.hasClass('button-primary')) {
181
+ $('.panel').stop(true, true).animate({
182
+ 'opacity': 0
183
+ }, 300, function() {
184
+ $('.panel').addClass('hidden');
185
+ currentElement.css('opacity', '0');
186
+ currentElement.removeClass('hidden');
187
+ currentElement.stop(true, true).animate({
188
+ 'opacity': 1
189
+ }, 300);
190
+ });
191
+
192
+ $(".element-selector input:eq(0)").prop("checked", true);
193
+ }
194
+ $('#form-tag a.button').removeClass('button-primary');
195
+ _t.addClass('button-primary');
196
+ $('input[name="cf7styleactivepane"]').val(_t.attr('data-property'));
197
+ });
 
 
 
 
 
 
 
 
 
198
 
199
+ $('.element-selector input').on('change', function() {
200
+ $('.element-selector input').prop('checked', false);
201
+ $(this).prop('checked', true);
202
+ if ($(this).val() == "hover") {
203
+ $('.panel:visible li').addClass('hidden');
204
+ $('.panel:visible li.hover-element').removeClass('hidden');
205
+ getPreviewElements("hover");
206
+ } else {
207
+ $('.panel:visible li.hover-element').addClass('hidden');
208
+ $('.panel:visible li').not('.hover-element').removeClass('hidden');
209
+ getPreviewElements();
210
+ }
211
+ });
212
+ $('#form-preview').on('change', function() {
213
+ $('.preview-form-container').addClass('hidden');
214
+ $('.preview-form-container').eq($(this).val()).removeClass('hidden');
215
+ });
216
+ $('[name^="cf7stylecustom"]').on("change", function() {
217
+ if ($('input[name="element-type"]:checked').val() == "hover") {
218
+ getPreviewElements('hover');
219
+ } else {
220
+ getPreviewElements();
221
+ }
222
+ });
223
+ $('[name^="cf7stylecustom"]').on("keyup", function() {
224
+ if ($('input[name="element-type"]:checked').val() == "hover") {
225
+ getPreviewElements('hover');
226
+ } else {
227
+ getPreviewElements();
228
+ }
229
+ });
230
+ }
231
 
232
+ function removePreviewfields(element) {
233
+ element.remove();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  }
235
+
236
+ function disableSubmit(element) {
237
+ element.on('click', function(e) {
238
+ e.preventDefault();
239
+ });
240
+ }
241
+
242
+ function addBgImage() {
243
+ var bgFormInput = $('.cf7-style-upload-field');
244
+ bgFormInput.addClass('hidden');
245
+ bgFormInput.each(function() {
246
+ var _t = $(this);
247
+ $('<span class="image-info-box"></span>').insertAfter(_t);
248
+ if (_t.val() != "") {
249
+ _t.parent().find('.image-info-box').text(_t.val().filename('yes'));
250
+ }
251
+ });
252
+ if ($('.upload-btn').length <= 0) {
253
+ $("<a href='javascript: void(0);' class='remove-btn button'>Remove</a>").insertAfter(bgFormInput);
254
+ $("<a href='javascript: void(0);' class='upload-btn button'>Upload</a>").insertAfter(bgFormInput);
255
  }
256
+ $('.upload-btn').on('click', function() {
257
+ var _t = $(this),
258
+ currentimage = _t.parent().find('.cf7-style-upload-field');
259
+ tb_show('New Banner', 'media-upload.php?type=image&TB_iframe=1');
260
+ window.send_to_editor = function(html) {
261
+ currentimage.val($(html).attr('src'));
262
+ currentimage.trigger('change');
263
+ _t.parent().find('.image-info-box').text($(html).attr('src').filename('yes'));
264
+ tb_remove();
265
+ }
266
+ });
267
+ $('.remove-btn').on('click', function() {
268
+ var _t = $(this),
269
+ currentimage = _t.parent().find('.cf7-style-upload-field');
270
+ currentimage.val(' ');
271
+ currentimage.attr('value', ' ');
272
+ currentimage.trigger('change');
273
+ _t.parent().find('.image-info-box').text('');
274
  });
275
  }
 
276
 
277
+ function codeMirrorInit() {
278
+ if ($("#cf7_style_manual_style").length > 0) {
279
+ var editor = CodeMirror.fromTextArea(document.getElementById("cf7_style_manual_style"), {
280
+ lineNumbers: true,
281
+ theme: "default",
282
+ mode: "text/css"
283
+ });
284
+ }
285
+ }
286
  if ($('.cf7style-no-forms-added').length > 0) {
287
  $('.generate-preview-button, .generate-preview-option').show();
288
  } else {
admin/js/overall.js CHANGED
@@ -1,5 +1,5 @@
1
- var $ = jQuery.noConflict();
2
- function dismissRemoveMessage() {
3
  $.ajax({
4
  'url': ajaxurl,
5
  'method': 'POST',
@@ -9,13 +9,11 @@ function dismissRemoveMessage() {
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
-
19
  $(document).on('click', '.cf7style-pointer a.close', function(e) {
20
  e.preventDefault();
21
  if( $('#cf7_style_allow_tracking').is(':checked') ){
1
+ jQuery(document).ready(function($) {
2
+ function dismissRemoveMessage() {
3
  $.ajax({
4
  'url': ajaxurl,
5
  'method': 'POST',
9
  'success': function(data) {}
10
  });
11
  }
 
12
  $('.remove_template_notice').on('click', function(e) {
13
  e.preventDefault();
14
  $('.template-message-box').fadeOut('slow');
15
  dismissRemoveMessage();
16
  });
 
17
  $(document).on('click', '.cf7style-pointer a.close', function(e) {
18
  e.preventDefault();
19
  if( $('#cf7_style_allow_tracking').is(':checked') ){
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.2
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.2";
21
  }
22
 
23
  function get_predefined_cf7_style_template_data() {
@@ -230,8 +230,11 @@ function cf7_style_custom_css_generator(){
230
  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
- 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" );
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.3
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.3";
21
  }
22
 
23
  function get_predefined_cf7_style_template_data() {
230
  function cf7_style_admin_scripts($hook){
231
  global $post_type;
232
  $cur_plug_url = plugin_dir_url( __FILE__ );
233
+ if (!wp_script_is( 'jquery', 'enqueued' )) {
234
+ wp_enqueue_script('jquery');
235
+ }
236
  wp_enqueue_style( "cf7-style-bar-style", $cur_plug_url . "css/admin-bar.css", array(), set_styleversion(), "all");
237
+ wp_enqueue_script( "cf7_style_overall", $cur_plug_url . "admin/js/overall.js", array('jquery'), false, true );
238
  if( 'cf7_style_page_cf7style-css-editor' == $hook ){
239
  wp_enqueue_script( "cf7_style_codemirror_js", $cur_plug_url . "admin/js/codemirror.js", array( 'jquery' ), false, true );
240
  wp_enqueue_style( "cf7-style-codemirror-style", $cur_plug_url . "admin/css/codemirror.css", array(), set_styleversion(), "all" );
readme.txt CHANGED
@@ -60,6 +60,10 @@ You will find 'Contact Style' menu in your WordPress admin panel.
60
 
61
  == Changelog ==
62
 
 
 
 
 
63
  = 3.0.2 =
64
  * [Major Fix](https://wordpress.org/support/topic/does-not-work-639?replies=7)
65
  * [Collection data settings page](https://wordpress.org/support/topic/how-to-disable-data-collection?replies=2)
@@ -154,9 +158,5 @@ You will find 'Contact Style' menu in your WordPress admin panel.
154
  * First plugin version.
155
 
156
  == Upgrade Notice ==
157
- = Contact Form 7 Style Version 3.0.2 =
158
- * [Major Fix](https://wordpress.org/support/topic/does-not-work-639?replies=7)
159
- * [Collection data settings page](https://wordpress.org/support/topic/how-to-disable-data-collection?replies=2)
160
- * New feature - generate cf7 form preview buttons added when creating new custom style
161
- * Improvements - preview generations on various user interactions
162
- * Improvements - general bugfixing
60
 
61
  == Changelog ==
62
 
63
+ = 3.0.3 =
64
+ * [Major Fix](https://wordpress.org/support/topic/existing-styling-deleted?replies=3) JQuery conflict with Siteorigin Page Builder and Visual Composer
65
+
66
+
67
  = 3.0.2 =
68
  * [Major Fix](https://wordpress.org/support/topic/does-not-work-639?replies=7)
69
  * [Collection data settings page](https://wordpress.org/support/topic/how-to-disable-data-collection?replies=2)
158
  * First plugin version.
159
 
160
  == Upgrade Notice ==
161
+ = Contact Form 7 Style Version 3.0.3 =
162
+ * [Major Fix](https://wordpress.org/support/topic/existing-styling-deleted?replies=3) JQuery conflict with Siteorigin Page Builder and Visual Composer