PluginProbe
Contact Forms by Cimatti / 1.9.2
Contact Forms by Cimatti v1.9.2
2.3.6 2.3.5 2.3.0 2.2.32 2.2.4 2.2.0 2.1.2 2.1.1 trunk 1.0 1.1 1.2 1.2.1 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 All 62 releases
← All changes | form-settings.js +112 -105 1.3.11.9.2 View file →
@@ -1,105 +1,112 @@
1 -jQuery(function($){
2 - $('#accua_form_style_border_color .accua_form_value').wpColorPicker();
3 - $('#accua_form_style_background_color .accua_form_value').wpColorPicker();
4 - $('#accua_form_style_color .accua_form_value').wpColorPicker();
5 - $('#accua_form_style_field_border_color .accua_form_value').wpColorPicker();
6 - $('#accua_form_style_field_background_color .accua_form_value').wpColorPicker();
7 - $('#accua_form_style_field_color .accua_form_value').wpColorPicker();
8 - $('#accua_form_style_submit_border_color .accua_form_value').wpColorPicker();
9 - $('#accua_form_style_submit_background_color .accua_form_value').wpColorPicker();
10 - $('#accua_form_style_submit_color .accua_form_value').wpColorPicker();
11 -
12 - function get_tinymce_content(name){
13 - if (jQuery("#"+name+" .wp-editor-wrap").hasClass("tmce-active")){
14 - return tinyMCE.get(name+'_textarea').getContent();
15 - } else
16 - {
17 - return jQuery("#" +name+ "_textarea").val();
18 - }
19 - }
20 -
21 - var save_button = $('.accua_form_save_settings_button');
22 - var save_status = $(".accua_form_save_settings_status");
23 - $('.accua_form_save_settings_button').click(function(){
24 - save_button.attr('disabled', 'disabled')
25 - save_status.empty();
26 - save_status.append("<span class='accua_form_api_throbbler'></span>");
27 -
28 - var form_id = $('#accua_form_save_settings_id').val();
29 -
30 - var data = {
31 - 'action': 'accua-save-form-settings',
32 - 'form-id': form_id,
33 - 'title': $('#title').val(),
34 - 'use_ajax': ($('#accua_form_use_ajax .accua_form_value').is(':checked') ? 1 : 0)
35 - };
36 -
37 - var layout = $('#accua_form_layout .accua_form_value').val();
38 - if (layout == 'toplabel' || layout == 'sidebyside') {
39 - data.layout = layout;
40 - }
41 -
42 - $.each(
43 - ['success_message','error_message','emails_from','admin_emails_to','emails_bcc','admin_emails_subject','admin_emails_message','confirmation_emails_subject','confirmation_emails_message','style_margin','style_border_color','style_border_width','style_border_radius','style_background_color','style_padding','style_color','style_font_size','style_field_spacing','style_field_border_color','style_field_border_width','style_field_border_radius','style_field_background_color','style_field_padding','style_field_color','style_submit_border_color','style_submit_border_width','style_submit_border_radius','style_submit_background_color','style_submit_padding','style_submit_color','style_submit_font_size'],
44 - function(i,key){
45 - var value = $('#accua_form_'+key+' .accua_form_check_override:checked').val();
46 - if(value!=undefined && value!=0) {
47 - if(value==-1)
48 - {
49 - data[key] ='';
50 - data[key+"_no_message"] = 1;
51 - }
52 - else {
53 - var element = $('#accua_form_'+key+' .accua_form_value');
54 - if(element.is('input')){
55 - data[key] = $('#accua_form_'+key+' .accua_form_value').val();
56 - }
57 - else if(element.is('textarea')) {
58 - data[key] = get_tinymce_content('accua_form_'+key);
59 - }
60 - }
61 - }
62 - }
63 - );
64 -
65 - /*
66 - $.post(
67 - ajaxurl,
68 - data,
69 - function(){},
70 - 'json'
71 - )
72 - */
73 -
74 - $.ajax(ajaxurl, {
75 - 'type': 'POST',
76 - 'data': data,
77 - 'success': function(){
78 - document.getElementById('accua_form_preview_area').src = 'admin-ajax.php?action=accua_forms_preview&fid=' + form_id;
79 - try {
80 - if (history.pushState && window.location.search.search('page=accua_forms_list') == -1) {
81 - history.pushState('', document.title, 'admin.php?page=accua_forms_list&fid=' + form_id);
82 - window.onpopstate = function(event) {
83 - location.reload();
84 - }
85 - }
86 - } catch (e) {}
87 -
88 - var success_message = $("<span style='color:#0C0'>Settings saved</span>");
89 - save_status.empty();
90 - save_status.append(success_message);
91 - var success_fadeout = function(){
92 - success_message.fadeOut(5000);
93 - }
94 - setTimeout(success_fadeout, 15000);
95 - save_button.removeAttr('disabled');
96 - },
97 - 'error': function(){
98 - save_status.empty();
99 - save_status.append("<span style='color:#c00'>Error saving settings, please retry</span>");
100 - save_button.removeAttr('disabled');
101 - }
102 - });
103 -
104 - });
105 -});
1 +jQuery(function($){
2 + $('#accua_form_style_border_color .accua_form_value').colorPicker();
3 + $('#accua_form_style_background_color .accua_form_value').colorPicker();
4 + $('#accua_form_style_color .accua_form_value').colorPicker();
5 + $('#accua_form_style_field_border_color .accua_form_value').colorPicker();
6 + $('#accua_form_style_field_background_color .accua_form_value').colorPicker();
7 + $('#accua_form_style_field_color .accua_form_value').colorPicker();
8 + $('#accua_form_style_submit_border_color .accua_form_value').colorPicker();
9 + $('#accua_form_style_submit_background_color .accua_form_value').colorPicker();
10 + $('#accua_form_style_submit_color .accua_form_value').colorPicker();
11 +
12 + function get_tinymce_content(name){
13 + if (jQuery("#"+name+" .wp-editor-wrap").hasClass("tmce-active")){
14 + return tinyMCE.get(name+'_textarea').getContent();
15 + } else
16 + {
17 + return jQuery("#" +name+ "_textarea").val();
18 + }
19 + }
20 +
21 + var save_button = $('.accua_form_save_settings_button');
22 + var save_status = $(".accua_form_save_settings_status");
23 + $('.accua_form_save_settings_button').click(function(){
24 + save_button.attr('disabled', 'disabled')
25 + save_status.empty();
26 + save_status.append("<span class='accua_form_api_throbbler'></span>");
27 +
28 + var form_id = $('#accua_form_save_settings_id').val();
29 +
30 + var data = {
31 + 'action': 'accua-save-form-settings',
32 + 'form-id': form_id,
33 + '_nonce_edit_form': $('#_nonce_edit_form').val(),
34 + 'title': $('#title').val(),
35 + 'use_ajax': ($('#accua_form_use_ajax .accua_form_value').is(':checked') ? 1 : 0)
36 + };
37 +
38 + var layout = $('#accua_form_layout .accua_form_value').val();
39 + if (layout == 'toplabel' || layout == 'sidebyside') {
40 + data.layout = layout;
41 + }
42 +
43 + $.each(
44 + ['success_message','error_message','emails_from_name','emails_from','admin_emails_to','emails_bcc','admin_emails_subject','admin_emails_message','confirmation_emails_subject','confirmation_emails_message','style_margin','style_border_color','style_border_width','style_border_radius','style_background_color','style_padding','style_color','style_font_size','style_field_spacing','style_field_border_color','style_field_border_width','style_field_border_radius','style_field_background_color','style_field_padding','style_field_color','style_submit_border_color','style_submit_border_width','style_submit_border_radius','style_submit_background_color','style_submit_padding','style_submit_color','style_submit_font_size'],
45 + function(i,key){
46 + var value = $('#accua_form_'+key+' .accua_form_check_override:checked').val();
47 + if(value!=undefined && value!=0) {
48 + if(value==-1)
49 + {
50 + data[key] ='';
51 + data[key+"_no_message"] = 1;
52 + }
53 + else {
54 + var element = $('#accua_form_'+key+' .accua_form_value');
55 + if(element.is('input')){
56 + data[key] = $('#accua_form_'+key+' .accua_form_value').val();
57 + }
58 + else if(element.is('textarea')) {
59 + data[key] = get_tinymce_content('accua_form_'+key);
60 + }
61 + }
62 + }
63 + }
64 + );
65 +
66 + /*
67 + $.post(
68 + ajaxurl,
69 + data,
70 + function(){},
71 + 'json'
72 + )
73 + */
74 +
75 + if (accuaWidgets) {
76 + $('#widgets-right .button-primary.widget-control-save').click();
77 + accuaWidgets.saveOrder();
78 + }
79 +
80 +
81 + setTimeout(function(){
82 + $.ajax(ajaxurl, {
83 + 'type': 'POST',
84 + 'data': data,
85 + 'success': function(){
86 + document.getElementById('accua_form_preview_area').src = 'admin-ajax.php?action=accua_forms_preview&fid=' + form_id;
87 + try {
88 + if (history.pushState && window.location.search.search('page=accua_forms_list') == -1) {
89 + history.pushState('', document.title, 'admin.php?page=accua_forms_list&fid=' + form_id);
90 + window.onpopstate = function(event) {
91 + location.reload();
92 + }
93 + }
94 + } catch (e) {}
95 +
96 + var success_message = $("<span class='savedsettings'>Settings saved</span>");
97 + save_status.empty();
98 + save_status.append(success_message);
99 + var success_fadeout = function(){
100 + success_message.fadeOut(5000);
101 + }
102 + setTimeout(success_fadeout, 15000);
103 + save_button.removeAttr('disabled');
104 + },
105 + 'error': function(){
106 + save_status.empty();
107 + save_status.append("<span class='error_savedsettings'>Error saving settings, please retry</span>");
108 + save_button.removeAttr('disabled');
109 + }
110 + }); }, 400);
111 + });
112 +});