Version Description
- Stopped using jquery.form.js.
- Added custom REST API endpoints for Ajax form submissions.
- WPCF7_FormTag class implements ArrayAccess interface.
- WPCF7_FormTagsManager::filter() filters form-tags based on features they support.
- New form-tag features: do-not-store, display-block, and display-hidden
- Removed inappropriate content from h1 headings.
- Added the support of size:invisible option to the reCAPTCHA form-tag.
Download this release
Release Info
Developer | takayukister |
Plugin | Contact Form 7 |
Version | 4.8 |
Comparing to | |
See all releases |
Code changes from version 4.7 to 4.8
- admin/admin.php +10 -4
- admin/edit-contact-form.php +11 -5
- admin/js/scripts.js +15 -15
- admin/js/tag-generator.js +18 -18
- includes/config-validator.php +0 -2
- includes/contact-form.php +19 -18
- includes/controller.php +18 -129
- includes/form-tag.php +28 -5
- includes/form-tags-manager.php +56 -35
- includes/formatting.php +6 -1
- includes/js/jquery-ui/themes/smoothness/images/animated-overlay.gif +0 -0
- includes/js/jquery-ui/themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- includes/js/jquery-ui/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- includes/js/jquery-ui/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- includes/js/jquery-ui/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- includes/js/jquery-ui/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- includes/js/jquery-ui/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- includes/js/jquery-ui/themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- includes/js/jquery-ui/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- includes/js/jquery-ui/themes/smoothness/images/ui-icons_222222_256x240.png +0 -0
- includes/js/jquery-ui/themes/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- includes/js/jquery-ui/themes/smoothness/images/ui-icons_454545_256x240.png +0 -0
- includes/js/jquery-ui/themes/smoothness/images/ui-icons_888888_256x240.png +0 -0
- includes/js/jquery-ui/themes/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- includes/js/jquery-ui/themes/smoothness/jquery-ui.css +125 -77
- includes/js/jquery-ui/themes/smoothness/jquery-ui.min.css +5 -3
- includes/js/jquery-ui/themes/smoothness/{jquery.ui.theme.css → theme.css} +29 -25
- includes/js/jquery.form.js +0 -1277
- includes/js/jquery.form.min.js +0 -11
- includes/js/scripts.js +345 -372
- includes/mail.php +20 -25
- includes/rest-api.php +83 -0
- includes/submission.php +26 -4
- modules/acceptance.php +16 -10
- modules/akismet.php +5 -4
- modules/checkbox.php +16 -14
- modules/count.php +0 -3
- modules/date.php +2 -5
- modules/file.php +0 -4
- modules/flamingo.php +10 -6
- modules/hidden.php +6 -3
- modules/number.php +2 -5
- modules/quiz.php +24 -13
- modules/really-simple-captcha.php +169 -108
- modules/recaptcha.php +62 -39
- modules/response.php +2 -1
- modules/select.php +7 -6
- modules/submit.php +0 -2
- modules/text.php +17 -12
- modules/textarea.php +0 -4
- readme.txt +14 -21
- wp-contact-form-7.php +4 -4
admin/admin.php
CHANGED
@@ -330,7 +330,7 @@ function wpcf7_admin_enqueue_scripts( $hook_suffix ) {
|
|
330 |
$config_validator->collect_error_messages();
|
331 |
}
|
332 |
|
333 |
-
wp_localize_script( 'wpcf7-admin', '
|
334 |
|
335 |
add_thickbox();
|
336 |
|
@@ -361,11 +361,15 @@ function wpcf7_admin_management_page() {
|
|
361 |
?>
|
362 |
<div class="wrap">
|
363 |
|
364 |
-
<h1><?php
|
365 |
echo esc_html( __( 'Contact Forms', 'contact-form-7' ) );
|
|
|
366 |
|
|
|
367 |
if ( current_user_can( 'wpcf7_edit_contact_forms' ) ) {
|
368 |
-
echo '
|
|
|
|
|
369 |
}
|
370 |
|
371 |
if ( ! empty( $_REQUEST['s'] ) ) {
|
@@ -373,7 +377,9 @@ function wpcf7_admin_management_page() {
|
|
373 |
. __( 'Search results for “%s”', 'contact-form-7' )
|
374 |
. '</span>', esc_html( $_REQUEST['s'] ) );
|
375 |
}
|
376 |
-
|
|
|
|
|
377 |
|
378 |
<?php do_action( 'wpcf7_admin_warnings' ); ?>
|
379 |
<?php wpcf7_welcome_panel(); ?>
|
330 |
$config_validator->collect_error_messages();
|
331 |
}
|
332 |
|
333 |
+
wp_localize_script( 'wpcf7-admin', 'wpcf7', $args );
|
334 |
|
335 |
add_thickbox();
|
336 |
|
361 |
?>
|
362 |
<div class="wrap">
|
363 |
|
364 |
+
<h1 class="wp-heading-inline"><?php
|
365 |
echo esc_html( __( 'Contact Forms', 'contact-form-7' ) );
|
366 |
+
?></h1>
|
367 |
|
368 |
+
<?php
|
369 |
if ( current_user_can( 'wpcf7_edit_contact_forms' ) ) {
|
370 |
+
echo sprintf( '<a href="%1$s" class="add-new-h2">%2$s</a>',
|
371 |
+
esc_url( menu_page_url( 'wpcf7-new', false ) ),
|
372 |
+
esc_html( __( 'Add New', 'contact-form-7' ) ) );
|
373 |
}
|
374 |
|
375 |
if ( ! empty( $_REQUEST['s'] ) ) {
|
377 |
. __( 'Search results for “%s”', 'contact-form-7' )
|
378 |
. '</span>', esc_html( $_REQUEST['s'] ) );
|
379 |
}
|
380 |
+
?>
|
381 |
+
|
382 |
+
<hr class="wp-header-end">
|
383 |
|
384 |
<?php do_action( 'wpcf7_admin_warnings' ); ?>
|
385 |
<?php wpcf7_welcome_panel(); ?>
|
admin/edit-contact-form.php
CHANGED
@@ -31,18 +31,24 @@ function wpcf7_admin_save_button( $post_id ) {
|
|
31 |
|
32 |
?><div class="wrap">
|
33 |
|
34 |
-
<h1><?php
|
35 |
if ( $post->initial() ) {
|
36 |
echo esc_html( __( 'Add New Contact Form', 'contact-form-7' ) );
|
37 |
} else {
|
38 |
echo esc_html( __( 'Edit Contact Form', 'contact-form-7' ) );
|
39 |
-
|
40 |
-
if ( current_user_can( 'wpcf7_edit_contact_forms' ) ) {
|
41 |
-
echo ' <a href="' . esc_url( menu_page_url( 'wpcf7-new', false ) ) . '" class="add-new-h2">' . esc_html( __( 'Add New', 'contact-form-7' ) ) . '</a>';
|
42 |
-
}
|
43 |
}
|
44 |
?></h1>
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
<?php do_action( 'wpcf7_admin_warnings' ); ?>
|
47 |
<?php do_action( 'wpcf7_admin_notices' ); ?>
|
48 |
|
31 |
|
32 |
?><div class="wrap">
|
33 |
|
34 |
+
<h1 class="wp-heading-inline"><?php
|
35 |
if ( $post->initial() ) {
|
36 |
echo esc_html( __( 'Add New Contact Form', 'contact-form-7' ) );
|
37 |
} else {
|
38 |
echo esc_html( __( 'Edit Contact Form', 'contact-form-7' ) );
|
|
|
|
|
|
|
|
|
39 |
}
|
40 |
?></h1>
|
41 |
|
42 |
+
<?php
|
43 |
+
if ( ! $post->initial() && current_user_can( 'wpcf7_edit_contact_forms' ) ) {
|
44 |
+
echo sprintf( '<a href="%1$s" class="add-new-h2">%2$s</a>',
|
45 |
+
esc_url( menu_page_url( 'wpcf7-new', false ) ),
|
46 |
+
esc_html( __( 'Add New', 'contact-form-7' ) ) );
|
47 |
+
}
|
48 |
+
?>
|
49 |
+
|
50 |
+
<hr class="wp-header-end">
|
51 |
+
|
52 |
<?php do_action( 'wpcf7_admin_warnings' ); ?>
|
53 |
<?php do_action( 'wpcf7_admin_notices' ); ?>
|
54 |
|
admin/js/scripts.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
'use strict';
|
4 |
|
5 |
-
if ( typeof
|
6 |
return;
|
7 |
}
|
8 |
|
@@ -25,7 +25,7 @@
|
|
25 |
} );
|
26 |
|
27 |
$( '#contact-form-editor' ).tabs( {
|
28 |
-
active:
|
29 |
activate: function( event, ui ) {
|
30 |
$( '#active-tab' ).val( ui.newTab.index() );
|
31 |
}
|
@@ -77,14 +77,14 @@
|
|
77 |
|
78 |
$.ajax( {
|
79 |
method: 'POST',
|
80 |
-
url:
|
81 |
'contact-form-7/v1/contact-forms/' + postId,
|
82 |
beforeSend: function( xhr ) {
|
83 |
-
xhr.setRequestHeader( 'X-WP-Nonce',
|
84 |
},
|
85 |
data: data
|
86 |
} ).done( function( response ) {
|
87 |
-
|
88 |
$.wpcf7UpdateConfigErrors();
|
89 |
} );
|
90 |
} );
|
@@ -111,8 +111,8 @@
|
|
111 |
} );
|
112 |
|
113 |
if ( changed ) {
|
114 |
-
event.returnValue =
|
115 |
-
return
|
116 |
}
|
117 |
} );
|
118 |
|
@@ -140,7 +140,7 @@
|
|
140 |
};
|
141 |
|
142 |
$.wpcf7UpdateConfigErrors = function() {
|
143 |
-
var errors =
|
144 |
var errorCount = {
|
145 |
total: 0,
|
146 |
};
|
@@ -166,7 +166,7 @@
|
|
166 |
'class': 'external dashicons dashicons-external'
|
167 |
} ).append( $( '<span></span>' ).attr( {
|
168 |
'class': 'screen-reader-text'
|
169 |
-
} ).text(
|
170 |
|
171 |
$li = $li.append( ' ' ).append( $link );
|
172 |
}
|
@@ -212,11 +212,11 @@
|
|
212 |
.append( '<span class="dashicons dashicons-warning"></span> ' );
|
213 |
|
214 |
if ( 1 < errorCount[tab] ) {
|
215 |
-
var manyErrorsInTab =
|
216 |
.replace( '%d', errorCount[tab] );
|
217 |
$tabPanelError.append( manyErrorsInTab );
|
218 |
} else {
|
219 |
-
$tabPanelError.append(
|
220 |
}
|
221 |
}
|
222 |
} );
|
@@ -231,18 +231,18 @@
|
|
231 |
|
232 |
if ( 1 < errorCount.total ) {
|
233 |
$warning.append(
|
234 |
-
|
235 |
);
|
236 |
} else {
|
237 |
-
$warning.append(
|
238 |
}
|
239 |
|
240 |
var $link = $( '<a></a>' ).attr( {
|
241 |
-
'href':
|
242 |
'class': 'external dashicons dashicons-external'
|
243 |
} ).append( $( '<span></span>' ).attr( {
|
244 |
'class': 'screen-reader-text'
|
245 |
-
} ).text(
|
246 |
|
247 |
$warning.append( ' ' ).append( $link );
|
248 |
|
2 |
|
3 |
'use strict';
|
4 |
|
5 |
+
if ( typeof wpcf7 === 'undefined' || wpcf7 === null ) {
|
6 |
return;
|
7 |
}
|
8 |
|
25 |
} );
|
26 |
|
27 |
$( '#contact-form-editor' ).tabs( {
|
28 |
+
active: wpcf7.activeTab,
|
29 |
activate: function( event, ui ) {
|
30 |
$( '#active-tab' ).val( ui.newTab.index() );
|
31 |
}
|
77 |
|
78 |
$.ajax( {
|
79 |
method: 'POST',
|
80 |
+
url: wpcf7.apiSettings.root +
|
81 |
'contact-form-7/v1/contact-forms/' + postId,
|
82 |
beforeSend: function( xhr ) {
|
83 |
+
xhr.setRequestHeader( 'X-WP-Nonce', wpcf7.apiSettings.nonce );
|
84 |
},
|
85 |
data: data
|
86 |
} ).done( function( response ) {
|
87 |
+
wpcf7.configValidator.errors = response.config_errors;
|
88 |
$.wpcf7UpdateConfigErrors();
|
89 |
} );
|
90 |
} );
|
111 |
} );
|
112 |
|
113 |
if ( changed ) {
|
114 |
+
event.returnValue = wpcf7.saveAlert;
|
115 |
+
return wpcf7.saveAlert;
|
116 |
}
|
117 |
} );
|
118 |
|
140 |
};
|
141 |
|
142 |
$.wpcf7UpdateConfigErrors = function() {
|
143 |
+
var errors = wpcf7.configValidator.errors;
|
144 |
var errorCount = {
|
145 |
total: 0,
|
146 |
};
|
166 |
'class': 'external dashicons dashicons-external'
|
167 |
} ).append( $( '<span></span>' ).attr( {
|
168 |
'class': 'screen-reader-text'
|
169 |
+
} ).text( wpcf7.configValidator.howToCorrect ) );
|
170 |
|
171 |
$li = $li.append( ' ' ).append( $link );
|
172 |
}
|
212 |
.append( '<span class="dashicons dashicons-warning"></span> ' );
|
213 |
|
214 |
if ( 1 < errorCount[tab] ) {
|
215 |
+
var manyErrorsInTab = wpcf7.configValidator.manyErrorsInTab
|
216 |
.replace( '%d', errorCount[tab] );
|
217 |
$tabPanelError.append( manyErrorsInTab );
|
218 |
} else {
|
219 |
+
$tabPanelError.append( wpcf7.configValidator.oneErrorInTab );
|
220 |
}
|
221 |
}
|
222 |
} );
|
231 |
|
232 |
if ( 1 < errorCount.total ) {
|
233 |
$warning.append(
|
234 |
+
wpcf7.configValidator.manyErrors.replace( '%d', errorCount.total )
|
235 |
);
|
236 |
} else {
|
237 |
+
$warning.append( wpcf7.configValidator.oneError );
|
238 |
}
|
239 |
|
240 |
var $link = $( '<a></a>' ).attr( {
|
241 |
+
'href': wpcf7.configValidator.docUrl,
|
242 |
'class': 'external dashicons dashicons-external'
|
243 |
} ).append( $( '<span></span>' ).attr( {
|
244 |
'class': 'screen-reader-text'
|
245 |
+
} ).text( wpcf7.configValidator.howToCorrect ) );
|
246 |
|
247 |
$warning.append( ' ' ).append( $link );
|
248 |
|
admin/js/tag-generator.js
CHANGED
@@ -2,15 +2,15 @@
|
|
2 |
|
3 |
'use strict';
|
4 |
|
5 |
-
if ( typeof
|
6 |
return;
|
7 |
}
|
8 |
|
9 |
-
|
10 |
|
11 |
$( function() {
|
12 |
$( 'form.tag-generator-panel' ).each( function() {
|
13 |
-
|
14 |
} );
|
15 |
} );
|
16 |
|
@@ -20,19 +20,19 @@
|
|
20 |
|
21 |
$( 'form.tag-generator-panel .control-box :input' ).change( function() {
|
22 |
var $form = $( this ).closest( 'form.tag-generator-panel' );
|
23 |
-
|
24 |
-
|
25 |
} );
|
26 |
|
27 |
$( 'input.insert-tag' ).click( function() {
|
28 |
var $form = $( this ).closest( 'form.tag-generator-panel' );
|
29 |
var tag = $form.find( 'input.tag' ).val();
|
30 |
-
|
31 |
tb_remove(); // close thickbox
|
32 |
return false;
|
33 |
} );
|
34 |
|
35 |
-
|
36 |
var id = $form.attr( 'data-id' );
|
37 |
var name = '';
|
38 |
var name_fields = $form.find( 'input[name="name"]' );
|
@@ -46,8 +46,8 @@
|
|
46 |
}
|
47 |
}
|
48 |
|
49 |
-
if ( $.isFunction(
|
50 |
-
return
|
51 |
}
|
52 |
|
53 |
$form.find( 'input.tag' ).each( function() {
|
@@ -61,7 +61,7 @@
|
|
61 |
tag_type += '*';
|
62 |
}
|
63 |
|
64 |
-
var components =
|
65 |
$( this ).val( components );
|
66 |
} );
|
67 |
|
@@ -72,14 +72,14 @@
|
|
72 |
} );
|
73 |
};
|
74 |
|
75 |
-
|
76 |
-
var captchac =
|
77 |
-
var captchar =
|
78 |
|
79 |
$form.find( 'input.tag' ).val( captchac + ' ' + captchar );
|
80 |
};
|
81 |
|
82 |
-
|
83 |
var name = $form.find( 'input[name="name"]' ).val();
|
84 |
var scope = $form.find( '.scope.' + tagType );
|
85 |
|
@@ -156,7 +156,7 @@
|
|
156 |
return '[' + components + ']';
|
157 |
};
|
158 |
|
159 |
-
|
160 |
var val = $input.val();
|
161 |
|
162 |
if ( $input.is( 'input[name="name"]' ) ) {
|
@@ -205,17 +205,17 @@
|
|
205 |
$input.val( val );
|
206 |
|
207 |
if ( $input.is( ':checkbox.exclusive' ) ) {
|
208 |
-
|
209 |
}
|
210 |
};
|
211 |
|
212 |
-
|
213 |
if ( $cb.is( ':checked' ) ) {
|
214 |
$cb.siblings( ':checkbox.exclusive' ).prop( 'checked', false );
|
215 |
}
|
216 |
};
|
217 |
|
218 |
-
|
219 |
$( 'textarea#wpcf7-form' ).each( function() {
|
220 |
this.focus();
|
221 |
|
2 |
|
3 |
'use strict';
|
4 |
|
5 |
+
if ( typeof wpcf7 === 'undefined' || wpcf7 === null ) {
|
6 |
return;
|
7 |
}
|
8 |
|
9 |
+
wpcf7.taggen = {};
|
10 |
|
11 |
$( function() {
|
12 |
$( 'form.tag-generator-panel' ).each( function() {
|
13 |
+
wpcf7.taggen.update( $( this ) );
|
14 |
} );
|
15 |
} );
|
16 |
|
20 |
|
21 |
$( 'form.tag-generator-panel .control-box :input' ).change( function() {
|
22 |
var $form = $( this ).closest( 'form.tag-generator-panel' );
|
23 |
+
wpcf7.taggen.normalize( $( this ) );
|
24 |
+
wpcf7.taggen.update( $form );
|
25 |
} );
|
26 |
|
27 |
$( 'input.insert-tag' ).click( function() {
|
28 |
var $form = $( this ).closest( 'form.tag-generator-panel' );
|
29 |
var tag = $form.find( 'input.tag' ).val();
|
30 |
+
wpcf7.taggen.insert( tag );
|
31 |
tb_remove(); // close thickbox
|
32 |
return false;
|
33 |
} );
|
34 |
|
35 |
+
wpcf7.taggen.update = function( $form ) {
|
36 |
var id = $form.attr( 'data-id' );
|
37 |
var name = '';
|
38 |
var name_fields = $form.find( 'input[name="name"]' );
|
46 |
}
|
47 |
}
|
48 |
|
49 |
+
if ( $.isFunction( wpcf7.taggen.update[ id ] ) ) {
|
50 |
+
return wpcf7.taggen.update[ id ].call( this, $form );
|
51 |
}
|
52 |
|
53 |
$form.find( 'input.tag' ).each( function() {
|
61 |
tag_type += '*';
|
62 |
}
|
63 |
|
64 |
+
var components = wpcf7.taggen.compose( tag_type, $form );
|
65 |
$( this ).val( components );
|
66 |
} );
|
67 |
|
72 |
} );
|
73 |
};
|
74 |
|
75 |
+
wpcf7.taggen.update.captcha = function( $form ) {
|
76 |
+
var captchac = wpcf7.taggen.compose( 'captchac', $form );
|
77 |
+
var captchar = wpcf7.taggen.compose( 'captchar', $form );
|
78 |
|
79 |
$form.find( 'input.tag' ).val( captchac + ' ' + captchar );
|
80 |
};
|
81 |
|
82 |
+
wpcf7.taggen.compose = function( tagType, $form ) {
|
83 |
var name = $form.find( 'input[name="name"]' ).val();
|
84 |
var scope = $form.find( '.scope.' + tagType );
|
85 |
|
156 |
return '[' + components + ']';
|
157 |
};
|
158 |
|
159 |
+
wpcf7.taggen.normalize = function( $input ) {
|
160 |
var val = $input.val();
|
161 |
|
162 |
if ( $input.is( 'input[name="name"]' ) ) {
|
205 |
$input.val( val );
|
206 |
|
207 |
if ( $input.is( ':checkbox.exclusive' ) ) {
|
208 |
+
wpcf7.taggen.exclusiveCheckbox( $input );
|
209 |
}
|
210 |
};
|
211 |
|
212 |
+
wpcf7.taggen.exclusiveCheckbox = function( $cb ) {
|
213 |
if ( $cb.is( ':checked' ) ) {
|
214 |
$cb.siblings( ':checkbox.exclusive' ).prop( 'checked', false );
|
215 |
}
|
216 |
};
|
217 |
|
218 |
+
wpcf7.taggen.insert = function( content ) {
|
219 |
$( 'textarea#wpcf7-form' ).each( function() {
|
220 |
this.focus();
|
221 |
|
includes/config-validator.php
CHANGED
@@ -323,8 +323,6 @@ class WPCF7_ConfigValidator {
|
|
323 |
$fields_count = 0;
|
324 |
|
325 |
foreach ( $tags as $tag ) {
|
326 |
-
$tag = new WPCF7_FormTag( $tag );
|
327 |
-
|
328 |
$is_multiple_controls_container = wpcf7_form_tag_supports(
|
329 |
$tag->type, 'multiple-controls-container' );
|
330 |
|
323 |
$fields_count = 0;
|
324 |
|
325 |
foreach ( $tags as $tag ) {
|
|
|
|
|
326 |
$is_multiple_controls_container = wpcf7_form_tag_supports(
|
327 |
$tag->type, 'multiple-controls-container' );
|
328 |
|
includes/contact-form.php
CHANGED
@@ -398,14 +398,19 @@ class WPCF7_ContactForm {
|
|
398 |
|
399 |
private function form_hidden_fields() {
|
400 |
$hidden_fields = array(
|
401 |
-
'_wpcf7' => $this->id,
|
402 |
'_wpcf7_version' => WPCF7_VERSION,
|
403 |
-
'_wpcf7_locale' => $this->locale,
|
404 |
'_wpcf7_unit_tag' => $this->unit_tag,
|
|
|
405 |
);
|
406 |
|
|
|
|
|
|
|
|
|
407 |
if ( WPCF7_VERIFY_NONCE ) {
|
408 |
-
$hidden_fields['
|
409 |
}
|
410 |
|
411 |
$hidden_fields += (array) apply_filters(
|
@@ -592,7 +597,7 @@ class WPCF7_ContactForm {
|
|
592 |
$mailtags = array();
|
593 |
|
594 |
foreach ( (array) $tags as $tag ) {
|
595 |
-
$type =
|
596 |
|
597 |
if ( empty( $type ) ) {
|
598 |
continue;
|
@@ -606,7 +611,7 @@ class WPCF7_ContactForm {
|
|
606 |
}
|
607 |
}
|
608 |
|
609 |
-
$mailtags[] = $tag
|
610 |
}
|
611 |
|
612 |
$mailtags = array_unique( array_filter( $mailtags ) );
|
@@ -643,7 +648,7 @@ class WPCF7_ContactForm {
|
|
643 |
}
|
644 |
}
|
645 |
|
646 |
-
public function submit(
|
647 |
$submission = WPCF7_Submission::get_instance( $this );
|
648 |
|
649 |
$result = array(
|
@@ -658,23 +663,19 @@ class WPCF7_ContactForm {
|
|
658 |
}
|
659 |
|
660 |
if ( $submission->is( 'mail_sent' ) ) {
|
661 |
-
|
662 |
-
$on_sent_ok = $this->additional_setting( 'on_sent_ok', false );
|
663 |
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
}
|
668 |
}
|
669 |
}
|
670 |
|
671 |
-
|
672 |
-
$on_submit = $this->additional_setting( 'on_submit', false );
|
673 |
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
}
|
678 |
}
|
679 |
|
680 |
do_action( 'wpcf7_submit', $this, $result );
|
398 |
|
399 |
private function form_hidden_fields() {
|
400 |
$hidden_fields = array(
|
401 |
+
'_wpcf7' => $this->id(),
|
402 |
'_wpcf7_version' => WPCF7_VERSION,
|
403 |
+
'_wpcf7_locale' => $this->locale(),
|
404 |
'_wpcf7_unit_tag' => $this->unit_tag,
|
405 |
+
'_wpcf7_container_post' => 0,
|
406 |
);
|
407 |
|
408 |
+
if ( in_the_loop() ) {
|
409 |
+
$hidden_fields['_wpcf7_container_post'] = (int) get_the_ID();
|
410 |
+
}
|
411 |
+
|
412 |
if ( WPCF7_VERIFY_NONCE ) {
|
413 |
+
$hidden_fields['_wpcf7_nonce'] = wpcf7_create_nonce( $this->id );
|
414 |
}
|
415 |
|
416 |
$hidden_fields += (array) apply_filters(
|
597 |
$mailtags = array();
|
598 |
|
599 |
foreach ( (array) $tags as $tag ) {
|
600 |
+
$type = $tag->basetype;
|
601 |
|
602 |
if ( empty( $type ) ) {
|
603 |
continue;
|
611 |
}
|
612 |
}
|
613 |
|
614 |
+
$mailtags[] = $tag->name;
|
615 |
}
|
616 |
|
617 |
$mailtags = array_unique( array_filter( $mailtags ) );
|
648 |
}
|
649 |
}
|
650 |
|
651 |
+
public function submit() {
|
652 |
$submission = WPCF7_Submission::get_instance( $this );
|
653 |
|
654 |
$result = array(
|
663 |
}
|
664 |
|
665 |
if ( $submission->is( 'mail_sent' ) ) {
|
666 |
+
$on_sent_ok = $this->additional_setting( 'on_sent_ok', false );
|
|
|
667 |
|
668 |
+
if ( ! empty( $on_sent_ok ) ) {
|
669 |
+
$result['scripts_on_sent_ok'] = array_map(
|
670 |
+
'wpcf7_strip_quote', $on_sent_ok );
|
|
|
671 |
}
|
672 |
}
|
673 |
|
674 |
+
$on_submit = $this->additional_setting( 'on_submit', false );
|
|
|
675 |
|
676 |
+
if ( ! empty( $on_submit ) ) {
|
677 |
+
$result['scripts_on_submit'] = array_map(
|
678 |
+
'wpcf7_strip_quote', $on_submit );
|
|
|
679 |
}
|
680 |
|
681 |
do_action( 'wpcf7_submit', $this, $result );
|
includes/controller.php
CHANGED
@@ -3,127 +3,17 @@
|
|
3 |
add_action( 'wp_loaded', 'wpcf7_control_init' );
|
4 |
|
5 |
function wpcf7_control_init() {
|
6 |
-
if (
|
|
|
7 |
return;
|
8 |
}
|
9 |
|
10 |
-
if ( 'GET' == $_SERVER['REQUEST_METHOD'] ) {
|
11 |
-
if ( isset( $_GET['_wpcf7_is_ajax_call'] ) ) {
|
12 |
-
wpcf7_ajax_onload();
|
13 |
-
}
|
14 |
-
}
|
15 |
-
|
16 |
-
if ( 'POST' == $_SERVER['REQUEST_METHOD'] ) {
|
17 |
-
if ( isset( $_POST['_wpcf7_is_ajax_call'] ) ) {
|
18 |
-
wpcf7_ajax_json_echo();
|
19 |
-
}
|
20 |
-
|
21 |
-
wpcf7_submit_nonajax();
|
22 |
-
}
|
23 |
-
}
|
24 |
-
|
25 |
-
function wpcf7_ajax_onload() {
|
26 |
-
$echo = '';
|
27 |
-
$items = array();
|
28 |
-
|
29 |
-
if ( isset( $_GET['_wpcf7'] )
|
30 |
-
&& $contact_form = wpcf7_contact_form( (int) $_GET['_wpcf7'] ) ) {
|
31 |
-
$items = apply_filters( 'wpcf7_ajax_onload', $items );
|
32 |
-
}
|
33 |
-
|
34 |
-
$echo = wp_json_encode( $items );
|
35 |
-
|
36 |
-
if ( wpcf7_is_xhr() ) {
|
37 |
-
@header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
|
38 |
-
echo $echo;
|
39 |
-
}
|
40 |
-
|
41 |
-
exit();
|
42 |
-
}
|
43 |
-
|
44 |
-
function wpcf7_ajax_json_echo() {
|
45 |
-
$echo = '';
|
46 |
-
|
47 |
if ( isset( $_POST['_wpcf7'] ) ) {
|
48 |
-
$
|
49 |
-
$unit_tag = wpcf7_sanitize_unit_tag( $_POST['_wpcf7_unit_tag'] );
|
50 |
-
|
51 |
-
if ( $contact_form = wpcf7_contact_form( $id ) ) {
|
52 |
-
$items = array(
|
53 |
-
'mailSent' => false,
|
54 |
-
'into' => '#' . $unit_tag,
|
55 |
-
'captcha' => null,
|
56 |
-
);
|
57 |
-
|
58 |
-
$result = $contact_form->submit( true );
|
59 |
-
|
60 |
-
if ( ! empty( $result['message'] ) ) {
|
61 |
-
$items['message'] = $result['message'];
|
62 |
-
}
|
63 |
-
|
64 |
-
if ( 'mail_sent' == $result['status'] ) {
|
65 |
-
$items['mailSent'] = true;
|
66 |
-
}
|
67 |
-
|
68 |
-
if ( 'validation_failed' == $result['status'] ) {
|
69 |
-
$invalids = array();
|
70 |
-
|
71 |
-
foreach ( $result['invalid_fields'] as $name => $field ) {
|
72 |
-
$invalids[] = array(
|
73 |
-
'into' => 'span.wpcf7-form-control-wrap.'
|
74 |
-
. sanitize_html_class( $name ),
|
75 |
-
'message' => $field['reason'],
|
76 |
-
'idref' => $field['idref'],
|
77 |
-
);
|
78 |
-
}
|
79 |
-
|
80 |
-
$items['invalids'] = $invalids;
|
81 |
-
}
|
82 |
-
|
83 |
-
if ( 'spam' == $result['status'] ) {
|
84 |
-
$items['spam'] = true;
|
85 |
-
}
|
86 |
-
|
87 |
-
if ( ! empty( $result['scripts_on_sent_ok'] ) ) {
|
88 |
-
$items['onSentOk'] = $result['scripts_on_sent_ok'];
|
89 |
-
}
|
90 |
-
|
91 |
-
if ( ! empty( $result['scripts_on_submit'] ) ) {
|
92 |
-
$items['onSubmit'] = $result['scripts_on_submit'];
|
93 |
-
}
|
94 |
-
|
95 |
-
$items = apply_filters( 'wpcf7_ajax_json_echo', $items, $result );
|
96 |
-
}
|
97 |
-
}
|
98 |
-
|
99 |
-
$echo = wp_json_encode( $items );
|
100 |
-
|
101 |
-
if ( wpcf7_is_xhr() ) {
|
102 |
-
@header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
|
103 |
-
echo $echo;
|
104 |
-
} else {
|
105 |
-
@header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
|
106 |
-
echo '<textarea>' . $echo . '</textarea>';
|
107 |
-
}
|
108 |
-
|
109 |
-
exit();
|
110 |
-
}
|
111 |
-
|
112 |
-
function wpcf7_is_xhr() {
|
113 |
-
if ( ! isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) ) {
|
114 |
-
return false;
|
115 |
-
}
|
116 |
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
function wpcf7_submit_nonajax() {
|
121 |
-
if ( ! isset( $_POST['_wpcf7'] ) ) {
|
122 |
-
return;
|
123 |
-
}
|
124 |
-
|
125 |
-
if ( $contact_form = wpcf7_contact_form( (int) $_POST['_wpcf7'] ) ) {
|
126 |
-
$contact_form->submit();
|
127 |
}
|
128 |
}
|
129 |
|
@@ -154,13 +44,6 @@ function wpcf7_do_enqueue_scripts() {
|
|
154 |
}
|
155 |
|
156 |
function wpcf7_enqueue_scripts() {
|
157 |
-
// jquery.form.js originally bundled with WordPress is out of date and deprecated
|
158 |
-
// so we need to deregister it and re-register the latest one
|
159 |
-
wp_deregister_script( 'jquery-form' );
|
160 |
-
wp_register_script( 'jquery-form',
|
161 |
-
wpcf7_plugin_url( 'includes/js/jquery.form.min.js' ),
|
162 |
-
array( 'jquery' ), '3.51.0-2014.06.20', true );
|
163 |
-
|
164 |
$in_footer = true;
|
165 |
|
166 |
if ( 'header' === wpcf7_load_js() ) {
|
@@ -169,9 +52,13 @@ function wpcf7_enqueue_scripts() {
|
|
169 |
|
170 |
wp_enqueue_script( 'contact-form-7',
|
171 |
wpcf7_plugin_url( 'includes/js/scripts.js' ),
|
172 |
-
array( 'jquery'
|
173 |
|
174 |
-
$
|
|
|
|
|
|
|
|
|
175 |
'recaptcha' => array(
|
176 |
'messages' => array(
|
177 |
'empty' =>
|
@@ -181,14 +68,14 @@ function wpcf7_enqueue_scripts() {
|
|
181 |
);
|
182 |
|
183 |
if ( defined( 'WP_CACHE' ) && WP_CACHE ) {
|
184 |
-
$
|
185 |
}
|
186 |
|
187 |
if ( wpcf7_support_html5_fallback() ) {
|
188 |
-
$
|
189 |
}
|
190 |
|
191 |
-
wp_localize_script( 'contact-form-7', '
|
192 |
|
193 |
do_action( 'wpcf7_enqueue_scripts' );
|
194 |
}
|
@@ -231,6 +118,8 @@ function wpcf7_html5_fallback() {
|
|
231 |
|
232 |
if ( wpcf7_style_is() ) {
|
233 |
wp_enqueue_style( 'jquery-ui-smoothness',
|
234 |
-
wpcf7_plugin_url(
|
|
|
|
|
235 |
}
|
236 |
}
|
3 |
add_action( 'wp_loaded', 'wpcf7_control_init' );
|
4 |
|
5 |
function wpcf7_control_init() {
|
6 |
+
if ( isset( $_SERVER['HTTP_X_REQUESTED_WITH'] )
|
7 |
+
&& 'XMLHttpRequest' == $_SERVER['HTTP_X_REQUESTED_WITH'] ) {
|
8 |
return;
|
9 |
}
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
if ( isset( $_POST['_wpcf7'] ) ) {
|
12 |
+
$contact_form = wpcf7_contact_form( (int) $_POST['_wpcf7'] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
+
if ( $contact_form ) {
|
15 |
+
$contact_form->submit();
|
16 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
}
|
18 |
}
|
19 |
|
44 |
}
|
45 |
|
46 |
function wpcf7_enqueue_scripts() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
$in_footer = true;
|
48 |
|
49 |
if ( 'header' === wpcf7_load_js() ) {
|
52 |
|
53 |
wp_enqueue_script( 'contact-form-7',
|
54 |
wpcf7_plugin_url( 'includes/js/scripts.js' ),
|
55 |
+
array( 'jquery' ), WPCF7_VERSION, $in_footer );
|
56 |
|
57 |
+
$wpcf7 = array(
|
58 |
+
'apiSettings' => array(
|
59 |
+
'root' => esc_url_raw( get_rest_url() ),
|
60 |
+
'namespace' => 'contact-form-7/v1',
|
61 |
+
),
|
62 |
'recaptcha' => array(
|
63 |
'messages' => array(
|
64 |
'empty' =>
|
68 |
);
|
69 |
|
70 |
if ( defined( 'WP_CACHE' ) && WP_CACHE ) {
|
71 |
+
$wpcf7['cached'] = 1;
|
72 |
}
|
73 |
|
74 |
if ( wpcf7_support_html5_fallback() ) {
|
75 |
+
$wpcf7['jqueryUi'] = 1;
|
76 |
}
|
77 |
|
78 |
+
wp_localize_script( 'contact-form-7', 'wpcf7', $wpcf7 );
|
79 |
|
80 |
do_action( 'wpcf7_enqueue_scripts' );
|
81 |
}
|
118 |
|
119 |
if ( wpcf7_style_is() ) {
|
120 |
wp_enqueue_style( 'jquery-ui-smoothness',
|
121 |
+
wpcf7_plugin_url(
|
122 |
+
'includes/js/jquery-ui/themes/smoothness/jquery-ui.min.css' ),
|
123 |
+
array(), '1.11.4', 'screen' );
|
124 |
}
|
125 |
}
|
includes/form-tag.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class WPCF7_FormTag {
|
4 |
|
5 |
public $type;
|
6 |
public $basetype;
|
@@ -13,10 +13,12 @@ class WPCF7_FormTag {
|
|
13 |
public $attr = '';
|
14 |
public $content = '';
|
15 |
|
16 |
-
public function __construct( $tag ) {
|
17 |
-
|
18 |
-
|
19 |
-
$
|
|
|
|
|
20 |
}
|
21 |
}
|
22 |
}
|
@@ -319,4 +321,25 @@ class WPCF7_FormTag {
|
|
319 |
|
320 |
return $result;
|
321 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
322 |
}
|
1 |
<?php
|
2 |
|
3 |
+
class WPCF7_FormTag implements ArrayAccess {
|
4 |
|
5 |
public $type;
|
6 |
public $basetype;
|
13 |
public $attr = '';
|
14 |
public $content = '';
|
15 |
|
16 |
+
public function __construct( $tag = array() ) {
|
17 |
+
if ( is_array( $tag ) || $tag instanceof self ) {
|
18 |
+
foreach ( $tag as $key => $value ) {
|
19 |
+
if ( property_exists( __CLASS__, $key ) ) {
|
20 |
+
$this->{$key} = $value;
|
21 |
+
}
|
22 |
}
|
23 |
}
|
24 |
}
|
321 |
|
322 |
return $result;
|
323 |
}
|
324 |
+
|
325 |
+
public function offsetSet( $offset, $value ) {
|
326 |
+
if ( property_exists( __CLASS__, $offset ) ) {
|
327 |
+
$this->{$offset} = $value;
|
328 |
+
}
|
329 |
+
}
|
330 |
+
|
331 |
+
public function offsetGet( $offset ) {
|
332 |
+
if ( property_exists( __CLASS__, $offset ) ) {
|
333 |
+
return $this->{$offset};
|
334 |
+
}
|
335 |
+
|
336 |
+
return null;
|
337 |
+
}
|
338 |
+
|
339 |
+
public function offsetExists( $offset ) {
|
340 |
+
return property_exists( __CLASS__, $offset );
|
341 |
+
}
|
342 |
+
|
343 |
+
public function offsetUnset( $offset ) {
|
344 |
+
}
|
345 |
}
|
includes/form-tags-manager.php
CHANGED
@@ -85,13 +85,35 @@ class WPCF7_FormTagsManager {
|
|
85 |
}
|
86 |
|
87 |
public function tag_type_supports( $tag, $feature ) {
|
|
|
|
|
88 |
if ( isset( $this->tag_types[$tag]['features'] ) ) {
|
89 |
-
return
|
|
|
|
|
90 |
}
|
91 |
|
92 |
return false;
|
93 |
}
|
94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
private function sanitize_tag_type( $tag ) {
|
96 |
$tag = preg_replace( '/[^a-zA-Z0-9_*]+/', '_', $tag );
|
97 |
$tag = rtrim( $tag, '_' );
|
@@ -172,11 +194,11 @@ class WPCF7_FormTagsManager {
|
|
172 |
}
|
173 |
}
|
174 |
|
175 |
-
public function filter( $
|
176 |
-
if ( is_array( $
|
177 |
-
$tags = $
|
178 |
-
} elseif ( is_string( $
|
179 |
-
$tags = $this->scan( $
|
180 |
} else {
|
181 |
$tags = $this->scanned_tags;
|
182 |
}
|
@@ -185,42 +207,39 @@ class WPCF7_FormTagsManager {
|
|
185 |
return array();
|
186 |
}
|
187 |
|
188 |
-
|
189 |
-
|
190 |
-
|
|
|
|
|
191 |
|
192 |
-
|
|
|
|
|
|
|
193 |
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
if ( ! in_array( $tags[$i]['type'], $cond['type'] ) ) {
|
202 |
-
unset( $tags[$i] );
|
203 |
-
continue;
|
204 |
-
}
|
205 |
-
}
|
206 |
}
|
207 |
|
208 |
-
if (
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
if ( ! in_array( $tags[$i]['name'], $cond['name'] ) ) {
|
216 |
-
unset( $tags[$i] );
|
217 |
-
continue;
|
218 |
-
}
|
219 |
-
}
|
220 |
}
|
|
|
|
|
221 |
}
|
222 |
|
223 |
-
return
|
224 |
}
|
225 |
|
226 |
private function tag_regex() {
|
@@ -298,6 +317,8 @@ class WPCF7_FormTagsManager {
|
|
298 |
|
299 |
$scanned_tag = apply_filters( 'wpcf7_form_tag', $scanned_tag, $replace );
|
300 |
|
|
|
|
|
301 |
$this->scanned_tags[] = $scanned_tag;
|
302 |
|
303 |
if ( $replace ) {
|
85 |
}
|
86 |
|
87 |
public function tag_type_supports( $tag, $feature ) {
|
88 |
+
$feature = array_filter( (array) $feature );
|
89 |
+
|
90 |
if ( isset( $this->tag_types[$tag]['features'] ) ) {
|
91 |
+
return (bool) array_intersect(
|
92 |
+
array_keys( array_filter( $this->tag_types[$tag]['features'] ) ),
|
93 |
+
$feature );
|
94 |
}
|
95 |
|
96 |
return false;
|
97 |
}
|
98 |
|
99 |
+
public function collect_tag_types( $feature = null ) {
|
100 |
+
$tag_types = array_keys( $this->tag_types );
|
101 |
+
|
102 |
+
if ( empty( $feature ) ) {
|
103 |
+
return $tag_types;
|
104 |
+
}
|
105 |
+
|
106 |
+
$output = array();
|
107 |
+
|
108 |
+
foreach ( $tag_types as $tag ) {
|
109 |
+
if ( $this->tag_type_supports( $tag, $feature ) ) {
|
110 |
+
$output[] = $tag;
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
return $output;
|
115 |
+
}
|
116 |
+
|
117 |
private function sanitize_tag_type( $tag ) {
|
118 |
$tag = preg_replace( '/[^a-zA-Z0-9_*]+/', '_', $tag );
|
119 |
$tag = rtrim( $tag, '_' );
|
194 |
}
|
195 |
}
|
196 |
|
197 |
+
public function filter( $input, $cond ) {
|
198 |
+
if ( is_array( $input ) ) {
|
199 |
+
$tags = $input;
|
200 |
+
} elseif ( is_string( $input ) ) {
|
201 |
+
$tags = $this->scan( $input );
|
202 |
} else {
|
203 |
$tags = $this->scanned_tags;
|
204 |
}
|
207 |
return array();
|
208 |
}
|
209 |
|
210 |
+
$cond = wp_parse_args( $cond, array(
|
211 |
+
'type' => array(),
|
212 |
+
'name' => array(),
|
213 |
+
'feature' => '',
|
214 |
+
) );
|
215 |
|
216 |
+
$cond['type'] = array_filter( (array) $cond['type'] );
|
217 |
+
$cond['name'] = array_filter( (array) $cond['name'] );
|
218 |
+
$cond['feature'] = is_string( $cond['feature'] )
|
219 |
+
? trim( $cond['feature'] ) : '';
|
220 |
|
221 |
+
$output = array();
|
222 |
+
|
223 |
+
foreach ( $tags as $tag ) {
|
224 |
+
$tag = new WPCF7_FormTag( $tag );
|
225 |
+
|
226 |
+
if ( $cond['type'] && ! in_array( $tag->type, $cond['type'], true ) ) {
|
227 |
+
continue;
|
|
|
|
|
|
|
|
|
|
|
228 |
}
|
229 |
|
230 |
+
if ( $cond['name'] && ! in_array( $tag->name, $cond['name'], true ) ) {
|
231 |
+
continue;
|
232 |
+
}
|
233 |
+
|
234 |
+
if ( $cond['feature']
|
235 |
+
&& ! $this->tag_type_supports( $tag->type, $cond['feature'] ) ) {
|
236 |
+
continue;
|
|
|
|
|
|
|
|
|
|
|
237 |
}
|
238 |
+
|
239 |
+
$output[] = $tag;
|
240 |
}
|
241 |
|
242 |
+
return $output;
|
243 |
}
|
244 |
|
245 |
private function tag_regex() {
|
317 |
|
318 |
$scanned_tag = apply_filters( 'wpcf7_form_tag', $scanned_tag, $replace );
|
319 |
|
320 |
+
$scanned_tag = new WPCF7_FormTag( $scanned_tag );
|
321 |
+
|
322 |
$this->scanned_tags[] = $scanned_tag;
|
323 |
|
324 |
if ( $replace ) {
|
includes/formatting.php
CHANGED
@@ -14,7 +14,12 @@ function wpcf7_autop( $pee, $br = 1 ) {
|
|
14 |
$pee = preg_replace( '!(</' . $allblocks . '>)!', "$1\n\n", $pee );
|
15 |
|
16 |
/* wpcf7: take care of [response], [recaptcha], and [hidden] tags */
|
17 |
-
$
|
|
|
|
|
|
|
|
|
|
|
18 |
$pee = preg_replace( '!(\[' . $block_hidden_form_tags . '[^]]*\])!',
|
19 |
"\n$1\n\n", $pee );
|
20 |
|
14 |
$pee = preg_replace( '!(</' . $allblocks . '>)!', "$1\n\n", $pee );
|
15 |
|
16 |
/* wpcf7: take care of [response], [recaptcha], and [hidden] tags */
|
17 |
+
$form_tags_manager = WPCF7_FormTagsManager::get_instance();
|
18 |
+
$block_hidden_form_tags = $form_tags_manager->collect_tag_types(
|
19 |
+
array( 'display-block', 'display-hidden' ) );
|
20 |
+
$block_hidden_form_tags = sprintf( '(?:%s)',
|
21 |
+
implode( '|', $block_hidden_form_tags ) );
|
22 |
+
|
23 |
$pee = preg_replace( '!(\[' . $block_hidden_form_tags . '[^]]*\])!',
|
24 |
"\n$1\n\n", $pee );
|
25 |
|
includes/js/jquery-ui/themes/smoothness/images/animated-overlay.gif
DELETED
Binary file
|
includes/js/jquery-ui/themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
CHANGED
Binary file
|
includes/js/jquery-ui/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
CHANGED
Binary file
|
includes/js/jquery-ui/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
CHANGED
Binary file
|
includes/js/jquery-ui/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
CHANGED
Binary file
|
includes/js/jquery-ui/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png
CHANGED
Binary file
|
includes/js/jquery-ui/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
CHANGED
Binary file
|
includes/js/jquery-ui/themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
CHANGED
Binary file
|
includes/js/jquery-ui/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
CHANGED
Binary file
|
includes/js/jquery-ui/themes/smoothness/images/ui-icons_222222_256x240.png
CHANGED
Binary file
|
includes/js/jquery-ui/themes/smoothness/images/ui-icons_2e83ff_256x240.png
CHANGED
Binary file
|
includes/js/jquery-ui/themes/smoothness/images/ui-icons_454545_256x240.png
CHANGED
Binary file
|
includes/js/jquery-ui/themes/smoothness/images/ui-icons_888888_256x240.png
CHANGED
Binary file
|
includes/js/jquery-ui/themes/smoothness/images/ui-icons_cd0a0a_256x240.png
CHANGED
Binary file
|
includes/js/jquery-ui/themes/smoothness/jquery-ui.css
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
/*! jQuery UI - v1.
|
2 |
* http://jqueryui.com
|
3 |
-
* Includes:
|
4 |
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
|
5 |
-
* Copyright
|
6 |
|
7 |
/* Layout helpers
|
8 |
----------------------------------*/
|
@@ -48,7 +48,7 @@
|
|
48 |
left: 0;
|
49 |
position: absolute;
|
50 |
opacity: 0;
|
51 |
-
filter:Alpha(Opacity=0);
|
52 |
}
|
53 |
|
54 |
.ui-front {
|
@@ -90,16 +90,14 @@
|
|
90 |
display: block;
|
91 |
cursor: pointer;
|
92 |
position: relative;
|
93 |
-
margin
|
94 |
padding: .5em .5em .5em .7em;
|
95 |
min-height: 0; /* support: IE7 */
|
|
|
96 |
}
|
97 |
.ui-accordion .ui-accordion-icons {
|
98 |
padding-left: 2.2em;
|
99 |
}
|
100 |
-
.ui-accordion .ui-accordion-noicons {
|
101 |
-
padding-left: .7em;
|
102 |
-
}
|
103 |
.ui-accordion .ui-accordion-icons .ui-accordion-icons {
|
104 |
padding-left: 2.2em;
|
105 |
}
|
@@ -274,12 +272,9 @@ button.ui-button::-moz-focus-inner {
|
|
274 |
font-size: 1em;
|
275 |
margin: 1px 0;
|
276 |
}
|
277 |
-
.ui-datepicker select.ui-datepicker-month-year {
|
278 |
-
width: 100%;
|
279 |
-
}
|
280 |
.ui-datepicker select.ui-datepicker-month,
|
281 |
.ui-datepicker select.ui-datepicker-year {
|
282 |
-
width:
|
283 |
}
|
284 |
.ui-datepicker table {
|
285 |
width: 100%;
|
@@ -393,6 +388,7 @@ button.ui-button::-moz-focus-inner {
|
|
393 |
border-left-width: 1px;
|
394 |
}
|
395 |
.ui-dialog {
|
|
|
396 |
position: absolute;
|
397 |
top: 0;
|
398 |
left: 0;
|
@@ -415,7 +411,7 @@ button.ui-button::-moz-focus-inner {
|
|
415 |
position: absolute;
|
416 |
right: .3em;
|
417 |
top: 50%;
|
418 |
-
width:
|
419 |
margin: -10px 0 0 0;
|
420 |
padding: 1px;
|
421 |
height: 20px;
|
@@ -451,74 +447,62 @@ button.ui-button::-moz-focus-inner {
|
|
451 |
.ui-draggable .ui-dialog-titlebar {
|
452 |
cursor: move;
|
453 |
}
|
|
|
|
|
|
|
|
|
454 |
.ui-menu {
|
455 |
list-style: none;
|
456 |
-
padding:
|
457 |
margin: 0;
|
458 |
display: block;
|
459 |
outline: none;
|
460 |
}
|
461 |
.ui-menu .ui-menu {
|
462 |
-
margin-top: -3px;
|
463 |
position: absolute;
|
464 |
}
|
465 |
.ui-menu .ui-menu-item {
|
|
|
466 |
margin: 0;
|
467 |
-
padding:
|
468 |
-
|
|
|
469 |
/* support: IE10, see #8844 */
|
470 |
-
list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);
|
471 |
}
|
472 |
.ui-menu .ui-menu-divider {
|
473 |
-
margin: 5px
|
474 |
height: 0;
|
475 |
font-size: 0;
|
476 |
line-height: 0;
|
477 |
border-width: 1px 0 0 0;
|
478 |
}
|
479 |
-
.ui-menu .ui-
|
480 |
-
|
481 |
-
display: block;
|
482 |
-
padding: 2px .4em;
|
483 |
-
line-height: 1.5;
|
484 |
-
min-height: 0; /* support: IE7 */
|
485 |
-
font-weight: normal;
|
486 |
-
}
|
487 |
-
.ui-menu .ui-menu-item a.ui-state-focus,
|
488 |
-
.ui-menu .ui-menu-item a.ui-state-active {
|
489 |
-
font-weight: normal;
|
490 |
margin: -1px;
|
491 |
}
|
492 |
|
493 |
-
.ui-menu .ui-state-disabled {
|
494 |
-
font-weight: normal;
|
495 |
-
margin: .4em 0 .2em;
|
496 |
-
line-height: 1.5;
|
497 |
-
}
|
498 |
-
.ui-menu .ui-state-disabled a {
|
499 |
-
cursor: default;
|
500 |
-
}
|
501 |
-
|
502 |
/* icon support */
|
503 |
.ui-menu-icons {
|
504 |
position: relative;
|
505 |
}
|
506 |
-
.ui-menu-icons .ui-menu-item
|
507 |
-
position: relative;
|
508 |
padding-left: 2em;
|
509 |
}
|
510 |
|
511 |
/* left-aligned */
|
512 |
.ui-menu .ui-icon {
|
513 |
position: absolute;
|
514 |
-
top:
|
|
|
515 |
left: .2em;
|
|
|
516 |
}
|
517 |
|
518 |
/* right-aligned */
|
519 |
.ui-menu .ui-menu-icon {
|
520 |
-
|
521 |
-
|
522 |
}
|
523 |
.ui-progressbar {
|
524 |
height: 2em;
|
@@ -530,9 +514,9 @@ button.ui-button::-moz-focus-inner {
|
|
530 |
height: 100%;
|
531 |
}
|
532 |
.ui-progressbar .ui-progressbar-overlay {
|
533 |
-
background: url("
|
534 |
height: 100%;
|
535 |
-
filter: alpha(opacity=25);
|
536 |
opacity: 0.25;
|
537 |
}
|
538 |
.ui-progressbar-indeterminate .ui-progressbar-value {
|
@@ -545,6 +529,8 @@ button.ui-button::-moz-focus-inner {
|
|
545 |
position: absolute;
|
546 |
font-size: 0.1px;
|
547 |
display: block;
|
|
|
|
|
548 |
}
|
549 |
.ui-resizable-disabled .ui-resizable-handle,
|
550 |
.ui-resizable-autohide .ui-resizable-handle {
|
@@ -606,11 +592,64 @@ button.ui-button::-moz-focus-inner {
|
|
606 |
right: -5px;
|
607 |
top: -5px;
|
608 |
}
|
|
|
|
|
|
|
|
|
609 |
.ui-selectable-helper {
|
610 |
position: absolute;
|
611 |
z-index: 100;
|
612 |
border: 1px dotted black;
|
613 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
614 |
.ui-slider {
|
615 |
position: relative;
|
616 |
text-align: left;
|
@@ -621,6 +660,8 @@ button.ui-button::-moz-focus-inner {
|
|
621 |
width: 1.2em;
|
622 |
height: 1.2em;
|
623 |
cursor: default;
|
|
|
|
|
624 |
}
|
625 |
.ui-slider .ui-slider-range {
|
626 |
position: absolute;
|
@@ -631,7 +672,7 @@ button.ui-button::-moz-focus-inner {
|
|
631 |
background-position: 0 0;
|
632 |
}
|
633 |
|
634 |
-
/*
|
635 |
.ui-slider.ui-state-disabled .ui-slider-handle,
|
636 |
.ui-slider.ui-state-disabled .ui-slider-range {
|
637 |
filter: inherit;
|
@@ -674,6 +715,10 @@ button.ui-button::-moz-focus-inner {
|
|
674 |
.ui-slider-vertical .ui-slider-range-max {
|
675 |
top: 0;
|
676 |
}
|
|
|
|
|
|
|
|
|
677 |
.ui-spinner {
|
678 |
position: relative;
|
679 |
display: inline-block;
|
@@ -704,13 +749,13 @@ button.ui-button::-moz-focus-inner {
|
|
704 |
overflow: hidden;
|
705 |
right: 0;
|
706 |
}
|
707 |
-
/* more specificity required here to
|
708 |
.ui-spinner a.ui-spinner-button {
|
709 |
border-top: none;
|
710 |
border-bottom: none;
|
711 |
border-right: none;
|
712 |
}
|
713 |
-
/*
|
714 |
.ui-spinner .ui-icon {
|
715 |
position: absolute;
|
716 |
margin-top: -8px;
|
@@ -747,7 +792,7 @@ button.ui-button::-moz-focus-inner {
|
|
747 |
padding: 0;
|
748 |
white-space: nowrap;
|
749 |
}
|
750 |
-
.ui-tabs .ui-tabs-nav
|
751 |
float: left;
|
752 |
padding: .5em 1em;
|
753 |
text-decoration: none;
|
@@ -756,13 +801,12 @@ button.ui-button::-moz-focus-inner {
|
|
756 |
margin-bottom: -1px;
|
757 |
padding-bottom: 1px;
|
758 |
}
|
759 |
-
.ui-tabs .ui-tabs-nav li.ui-tabs-active
|
760 |
-
.ui-tabs .ui-tabs-nav li.ui-state-disabled
|
761 |
-
.ui-tabs .ui-tabs-nav li.ui-tabs-loading
|
762 |
cursor: text;
|
763 |
}
|
764 |
-
.ui-tabs .ui-tabs-nav li
|
765 |
-
.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a {
|
766 |
cursor: pointer;
|
767 |
}
|
768 |
.ui-tabs .ui-tabs-panel {
|
@@ -801,7 +845,7 @@ body .ui-tooltip {
|
|
801 |
}
|
802 |
.ui-widget-content {
|
803 |
border: 1px solid #aaaaaa;
|
804 |
-
background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
|
805 |
color: #222222;
|
806 |
}
|
807 |
.ui-widget-content a {
|
@@ -809,7 +853,7 @@ body .ui-tooltip {
|
|
809 |
}
|
810 |
.ui-widget-header {
|
811 |
border: 1px solid #aaaaaa;
|
812 |
-
background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;
|
813 |
color: #222222;
|
814 |
font-weight: bold;
|
815 |
}
|
@@ -823,7 +867,7 @@ body .ui-tooltip {
|
|
823 |
.ui-widget-content .ui-state-default,
|
824 |
.ui-widget-header .ui-state-default {
|
825 |
border: 1px solid #d3d3d3;
|
826 |
-
background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;
|
827 |
font-weight: normal;
|
828 |
color: #555555;
|
829 |
}
|
@@ -840,14 +884,18 @@ body .ui-tooltip {
|
|
840 |
.ui-widget-content .ui-state-focus,
|
841 |
.ui-widget-header .ui-state-focus {
|
842 |
border: 1px solid #999999;
|
843 |
-
background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;
|
844 |
font-weight: normal;
|
845 |
color: #212121;
|
846 |
}
|
847 |
.ui-state-hover a,
|
848 |
.ui-state-hover a:hover,
|
849 |
.ui-state-hover a:link,
|
850 |
-
.ui-state-hover a:visited
|
|
|
|
|
|
|
|
|
851 |
color: #212121;
|
852 |
text-decoration: none;
|
853 |
}
|
@@ -855,7 +903,7 @@ body .ui-tooltip {
|
|
855 |
.ui-widget-content .ui-state-active,
|
856 |
.ui-widget-header .ui-state-active {
|
857 |
border: 1px solid #aaaaaa;
|
858 |
-
background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;
|
859 |
font-weight: normal;
|
860 |
color: #212121;
|
861 |
}
|
@@ -872,7 +920,7 @@ body .ui-tooltip {
|
|
872 |
.ui-widget-content .ui-state-highlight,
|
873 |
.ui-widget-header .ui-state-highlight {
|
874 |
border: 1px solid #fcefa1;
|
875 |
-
background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;
|
876 |
color: #363636;
|
877 |
}
|
878 |
.ui-state-highlight a,
|
@@ -884,7 +932,7 @@ body .ui-tooltip {
|
|
884 |
.ui-widget-content .ui-state-error,
|
885 |
.ui-widget-header .ui-state-error {
|
886 |
border: 1px solid #cd0a0a;
|
887 |
-
background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;
|
888 |
color: #cd0a0a;
|
889 |
}
|
890 |
.ui-state-error a,
|
@@ -906,18 +954,18 @@ body .ui-tooltip {
|
|
906 |
.ui-widget-content .ui-priority-secondary,
|
907 |
.ui-widget-header .ui-priority-secondary {
|
908 |
opacity: .7;
|
909 |
-
filter:Alpha(Opacity=70);
|
910 |
font-weight: normal;
|
911 |
}
|
912 |
.ui-state-disabled,
|
913 |
.ui-widget-content .ui-state-disabled,
|
914 |
.ui-widget-header .ui-state-disabled {
|
915 |
opacity: .35;
|
916 |
-
filter:Alpha(Opacity=35);
|
917 |
background-image: none;
|
918 |
}
|
919 |
.ui-state-disabled .ui-icon {
|
920 |
-
filter:Alpha(Opacity=35); /*
|
921 |
}
|
922 |
|
923 |
/* Icons
|
@@ -930,27 +978,27 @@ body .ui-tooltip {
|
|
930 |
}
|
931 |
.ui-icon,
|
932 |
.ui-widget-content .ui-icon {
|
933 |
-
background-image: url(images/ui-icons_222222_256x240.png);
|
934 |
}
|
935 |
.ui-widget-header .ui-icon {
|
936 |
-
background-image: url(images/ui-icons_222222_256x240.png);
|
937 |
}
|
938 |
.ui-state-default .ui-icon {
|
939 |
-
background-image: url(images/ui-icons_888888_256x240.png);
|
940 |
}
|
941 |
.ui-state-hover .ui-icon,
|
942 |
.ui-state-focus .ui-icon {
|
943 |
-
background-image: url(images/ui-icons_454545_256x240.png);
|
944 |
}
|
945 |
.ui-state-active .ui-icon {
|
946 |
-
background-image: url(images/ui-icons_454545_256x240.png);
|
947 |
}
|
948 |
.ui-state-highlight .ui-icon {
|
949 |
-
background-image: url(images/ui-icons_2e83ff_256x240.png);
|
950 |
}
|
951 |
.ui-state-error .ui-icon,
|
952 |
.ui-state-error-text .ui-icon {
|
953 |
-
background-image: url(images/ui-icons_cd0a0a_256x240.png);
|
954 |
}
|
955 |
|
956 |
/* positioning */
|
@@ -1163,15 +1211,15 @@ body .ui-tooltip {
|
|
1163 |
|
1164 |
/* Overlays */
|
1165 |
.ui-widget-overlay {
|
1166 |
-
background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
|
1167 |
opacity: .3;
|
1168 |
-
filter: Alpha(Opacity=30);
|
1169 |
}
|
1170 |
.ui-widget-shadow {
|
1171 |
margin: -8px 0 0 -8px;
|
1172 |
padding: 8px;
|
1173 |
-
background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
|
1174 |
opacity: .3;
|
1175 |
-
filter: Alpha(Opacity=30);
|
1176 |
border-radius: 8px;
|
1177 |
}
|
1 |
+
/*! jQuery UI - v1.11.4 - 2015-03-11
|
2 |
* http://jqueryui.com
|
3 |
+
* Includes: core.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, draggable.css, menu.css, progressbar.css, resizable.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
|
4 |
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
|
5 |
+
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
|
6 |
|
7 |
/* Layout helpers
|
8 |
----------------------------------*/
|
48 |
left: 0;
|
49 |
position: absolute;
|
50 |
opacity: 0;
|
51 |
+
filter:Alpha(Opacity=0); /* support: IE8 */
|
52 |
}
|
53 |
|
54 |
.ui-front {
|
90 |
display: block;
|
91 |
cursor: pointer;
|
92 |
position: relative;
|
93 |
+
margin: 2px 0 0 0;
|
94 |
padding: .5em .5em .5em .7em;
|
95 |
min-height: 0; /* support: IE7 */
|
96 |
+
font-size: 100%;
|
97 |
}
|
98 |
.ui-accordion .ui-accordion-icons {
|
99 |
padding-left: 2.2em;
|
100 |
}
|
|
|
|
|
|
|
101 |
.ui-accordion .ui-accordion-icons .ui-accordion-icons {
|
102 |
padding-left: 2.2em;
|
103 |
}
|
272 |
font-size: 1em;
|
273 |
margin: 1px 0;
|
274 |
}
|
|
|
|
|
|
|
275 |
.ui-datepicker select.ui-datepicker-month,
|
276 |
.ui-datepicker select.ui-datepicker-year {
|
277 |
+
width: 45%;
|
278 |
}
|
279 |
.ui-datepicker table {
|
280 |
width: 100%;
|
388 |
border-left-width: 1px;
|
389 |
}
|
390 |
.ui-dialog {
|
391 |
+
overflow: hidden;
|
392 |
position: absolute;
|
393 |
top: 0;
|
394 |
left: 0;
|
411 |
position: absolute;
|
412 |
right: .3em;
|
413 |
top: 50%;
|
414 |
+
width: 20px;
|
415 |
margin: -10px 0 0 0;
|
416 |
padding: 1px;
|
417 |
height: 20px;
|
447 |
.ui-draggable .ui-dialog-titlebar {
|
448 |
cursor: move;
|
449 |
}
|
450 |
+
.ui-draggable-handle {
|
451 |
+
-ms-touch-action: none;
|
452 |
+
touch-action: none;
|
453 |
+
}
|
454 |
.ui-menu {
|
455 |
list-style: none;
|
456 |
+
padding: 0;
|
457 |
margin: 0;
|
458 |
display: block;
|
459 |
outline: none;
|
460 |
}
|
461 |
.ui-menu .ui-menu {
|
|
|
462 |
position: absolute;
|
463 |
}
|
464 |
.ui-menu .ui-menu-item {
|
465 |
+
position: relative;
|
466 |
margin: 0;
|
467 |
+
padding: 3px 1em 3px .4em;
|
468 |
+
cursor: pointer;
|
469 |
+
min-height: 0; /* support: IE7 */
|
470 |
/* support: IE10, see #8844 */
|
471 |
+
list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
|
472 |
}
|
473 |
.ui-menu .ui-menu-divider {
|
474 |
+
margin: 5px 0;
|
475 |
height: 0;
|
476 |
font-size: 0;
|
477 |
line-height: 0;
|
478 |
border-width: 1px 0 0 0;
|
479 |
}
|
480 |
+
.ui-menu .ui-state-focus,
|
481 |
+
.ui-menu .ui-state-active {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
482 |
margin: -1px;
|
483 |
}
|
484 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
485 |
/* icon support */
|
486 |
.ui-menu-icons {
|
487 |
position: relative;
|
488 |
}
|
489 |
+
.ui-menu-icons .ui-menu-item {
|
|
|
490 |
padding-left: 2em;
|
491 |
}
|
492 |
|
493 |
/* left-aligned */
|
494 |
.ui-menu .ui-icon {
|
495 |
position: absolute;
|
496 |
+
top: 0;
|
497 |
+
bottom: 0;
|
498 |
left: .2em;
|
499 |
+
margin: auto 0;
|
500 |
}
|
501 |
|
502 |
/* right-aligned */
|
503 |
.ui-menu .ui-menu-icon {
|
504 |
+
left: auto;
|
505 |
+
right: 0;
|
506 |
}
|
507 |
.ui-progressbar {
|
508 |
height: 2em;
|
514 |
height: 100%;
|
515 |
}
|
516 |
.ui-progressbar .ui-progressbar-overlay {
|
517 |
+
background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
|
518 |
height: 100%;
|
519 |
+
filter: alpha(opacity=25); /* support: IE8 */
|
520 |
opacity: 0.25;
|
521 |
}
|
522 |
.ui-progressbar-indeterminate .ui-progressbar-value {
|
529 |
position: absolute;
|
530 |
font-size: 0.1px;
|
531 |
display: block;
|
532 |
+
-ms-touch-action: none;
|
533 |
+
touch-action: none;
|
534 |
}
|
535 |
.ui-resizable-disabled .ui-resizable-handle,
|
536 |
.ui-resizable-autohide .ui-resizable-handle {
|
592 |
right: -5px;
|
593 |
top: -5px;
|
594 |
}
|
595 |
+
.ui-selectable {
|
596 |
+
-ms-touch-action: none;
|
597 |
+
touch-action: none;
|
598 |
+
}
|
599 |
.ui-selectable-helper {
|
600 |
position: absolute;
|
601 |
z-index: 100;
|
602 |
border: 1px dotted black;
|
603 |
}
|
604 |
+
.ui-selectmenu-menu {
|
605 |
+
padding: 0;
|
606 |
+
margin: 0;
|
607 |
+
position: absolute;
|
608 |
+
top: 0;
|
609 |
+
left: 0;
|
610 |
+
display: none;
|
611 |
+
}
|
612 |
+
.ui-selectmenu-menu .ui-menu {
|
613 |
+
overflow: auto;
|
614 |
+
/* Support: IE7 */
|
615 |
+
overflow-x: hidden;
|
616 |
+
padding-bottom: 1px;
|
617 |
+
}
|
618 |
+
.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
|
619 |
+
font-size: 1em;
|
620 |
+
font-weight: bold;
|
621 |
+
line-height: 1.5;
|
622 |
+
padding: 2px 0.4em;
|
623 |
+
margin: 0.5em 0 0 0;
|
624 |
+
height: auto;
|
625 |
+
border: 0;
|
626 |
+
}
|
627 |
+
.ui-selectmenu-open {
|
628 |
+
display: block;
|
629 |
+
}
|
630 |
+
.ui-selectmenu-button {
|
631 |
+
display: inline-block;
|
632 |
+
overflow: hidden;
|
633 |
+
position: relative;
|
634 |
+
text-decoration: none;
|
635 |
+
cursor: pointer;
|
636 |
+
}
|
637 |
+
.ui-selectmenu-button span.ui-icon {
|
638 |
+
right: 0.5em;
|
639 |
+
left: auto;
|
640 |
+
margin-top: -8px;
|
641 |
+
position: absolute;
|
642 |
+
top: 50%;
|
643 |
+
}
|
644 |
+
.ui-selectmenu-button span.ui-selectmenu-text {
|
645 |
+
text-align: left;
|
646 |
+
padding: 0.4em 2.1em 0.4em 1em;
|
647 |
+
display: block;
|
648 |
+
line-height: 1.4;
|
649 |
+
overflow: hidden;
|
650 |
+
text-overflow: ellipsis;
|
651 |
+
white-space: nowrap;
|
652 |
+
}
|
653 |
.ui-slider {
|
654 |
position: relative;
|
655 |
text-align: left;
|
660 |
width: 1.2em;
|
661 |
height: 1.2em;
|
662 |
cursor: default;
|
663 |
+
-ms-touch-action: none;
|
664 |
+
touch-action: none;
|
665 |
}
|
666 |
.ui-slider .ui-slider-range {
|
667 |
position: absolute;
|
672 |
background-position: 0 0;
|
673 |
}
|
674 |
|
675 |
+
/* support: IE8 - See #6727 */
|
676 |
.ui-slider.ui-state-disabled .ui-slider-handle,
|
677 |
.ui-slider.ui-state-disabled .ui-slider-range {
|
678 |
filter: inherit;
|
715 |
.ui-slider-vertical .ui-slider-range-max {
|
716 |
top: 0;
|
717 |
}
|
718 |
+
.ui-sortable-handle {
|
719 |
+
-ms-touch-action: none;
|
720 |
+
touch-action: none;
|
721 |
+
}
|
722 |
.ui-spinner {
|
723 |
position: relative;
|
724 |
display: inline-block;
|
749 |
overflow: hidden;
|
750 |
right: 0;
|
751 |
}
|
752 |
+
/* more specificity required here to override default borders */
|
753 |
.ui-spinner a.ui-spinner-button {
|
754 |
border-top: none;
|
755 |
border-bottom: none;
|
756 |
border-right: none;
|
757 |
}
|
758 |
+
/* vertically center icon */
|
759 |
.ui-spinner .ui-icon {
|
760 |
position: absolute;
|
761 |
margin-top: -8px;
|
792 |
padding: 0;
|
793 |
white-space: nowrap;
|
794 |
}
|
795 |
+
.ui-tabs .ui-tabs-nav .ui-tabs-anchor {
|
796 |
float: left;
|
797 |
padding: .5em 1em;
|
798 |
text-decoration: none;
|
801 |
margin-bottom: -1px;
|
802 |
padding-bottom: 1px;
|
803 |
}
|
804 |
+
.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
|
805 |
+
.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
|
806 |
+
.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
|
807 |
cursor: text;
|
808 |
}
|
809 |
+
.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
|
|
|
810 |
cursor: pointer;
|
811 |
}
|
812 |
.ui-tabs .ui-tabs-panel {
|
845 |
}
|
846 |
.ui-widget-content {
|
847 |
border: 1px solid #aaaaaa;
|
848 |
+
background: #ffffff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;
|
849 |
color: #222222;
|
850 |
}
|
851 |
.ui-widget-content a {
|
853 |
}
|
854 |
.ui-widget-header {
|
855 |
border: 1px solid #aaaaaa;
|
856 |
+
background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;
|
857 |
color: #222222;
|
858 |
font-weight: bold;
|
859 |
}
|
867 |
.ui-widget-content .ui-state-default,
|
868 |
.ui-widget-header .ui-state-default {
|
869 |
border: 1px solid #d3d3d3;
|
870 |
+
background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;
|
871 |
font-weight: normal;
|
872 |
color: #555555;
|
873 |
}
|
884 |
.ui-widget-content .ui-state-focus,
|
885 |
.ui-widget-header .ui-state-focus {
|
886 |
border: 1px solid #999999;
|
887 |
+
background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;
|
888 |
font-weight: normal;
|
889 |
color: #212121;
|
890 |
}
|
891 |
.ui-state-hover a,
|
892 |
.ui-state-hover a:hover,
|
893 |
.ui-state-hover a:link,
|
894 |
+
.ui-state-hover a:visited,
|
895 |
+
.ui-state-focus a,
|
896 |
+
.ui-state-focus a:hover,
|
897 |
+
.ui-state-focus a:link,
|
898 |
+
.ui-state-focus a:visited {
|
899 |
color: #212121;
|
900 |
text-decoration: none;
|
901 |
}
|
903 |
.ui-widget-content .ui-state-active,
|
904 |
.ui-widget-header .ui-state-active {
|
905 |
border: 1px solid #aaaaaa;
|
906 |
+
background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
|
907 |
font-weight: normal;
|
908 |
color: #212121;
|
909 |
}
|
920 |
.ui-widget-content .ui-state-highlight,
|
921 |
.ui-widget-header .ui-state-highlight {
|
922 |
border: 1px solid #fcefa1;
|
923 |
+
background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;
|
924 |
color: #363636;
|
925 |
}
|
926 |
.ui-state-highlight a,
|
932 |
.ui-widget-content .ui-state-error,
|
933 |
.ui-widget-header .ui-state-error {
|
934 |
border: 1px solid #cd0a0a;
|
935 |
+
background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
|
936 |
color: #cd0a0a;
|
937 |
}
|
938 |
.ui-state-error a,
|
954 |
.ui-widget-content .ui-priority-secondary,
|
955 |
.ui-widget-header .ui-priority-secondary {
|
956 |
opacity: .7;
|
957 |
+
filter:Alpha(Opacity=70); /* support: IE8 */
|
958 |
font-weight: normal;
|
959 |
}
|
960 |
.ui-state-disabled,
|
961 |
.ui-widget-content .ui-state-disabled,
|
962 |
.ui-widget-header .ui-state-disabled {
|
963 |
opacity: .35;
|
964 |
+
filter:Alpha(Opacity=35); /* support: IE8 */
|
965 |
background-image: none;
|
966 |
}
|
967 |
.ui-state-disabled .ui-icon {
|
968 |
+
filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
|
969 |
}
|
970 |
|
971 |
/* Icons
|
978 |
}
|
979 |
.ui-icon,
|
980 |
.ui-widget-content .ui-icon {
|
981 |
+
background-image: url("images/ui-icons_222222_256x240.png");
|
982 |
}
|
983 |
.ui-widget-header .ui-icon {
|
984 |
+
background-image: url("images/ui-icons_222222_256x240.png");
|
985 |
}
|
986 |
.ui-state-default .ui-icon {
|
987 |
+
background-image: url("images/ui-icons_888888_256x240.png");
|
988 |
}
|
989 |
.ui-state-hover .ui-icon,
|
990 |
.ui-state-focus .ui-icon {
|
991 |
+
background-image: url("images/ui-icons_454545_256x240.png");
|
992 |
}
|
993 |
.ui-state-active .ui-icon {
|
994 |
+
background-image: url("images/ui-icons_454545_256x240.png");
|
995 |
}
|
996 |
.ui-state-highlight .ui-icon {
|
997 |
+
background-image: url("images/ui-icons_2e83ff_256x240.png");
|
998 |
}
|
999 |
.ui-state-error .ui-icon,
|
1000 |
.ui-state-error-text .ui-icon {
|
1001 |
+
background-image: url("images/ui-icons_cd0a0a_256x240.png");
|
1002 |
}
|
1003 |
|
1004 |
/* positioning */
|
1211 |
|
1212 |
/* Overlays */
|
1213 |
.ui-widget-overlay {
|
1214 |
+
background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
|
1215 |
opacity: .3;
|
1216 |
+
filter: Alpha(Opacity=30); /* support: IE8 */
|
1217 |
}
|
1218 |
.ui-widget-shadow {
|
1219 |
margin: -8px 0 0 -8px;
|
1220 |
padding: 8px;
|
1221 |
+
background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
|
1222 |
opacity: .3;
|
1223 |
+
filter: Alpha(Opacity=30); /* support: IE8 */
|
1224 |
border-radius: 8px;
|
1225 |
}
|
includes/js/jquery-ui/themes/smoothness/jquery-ui.min.css
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
-
/*! jQuery UI - v1.
|
2 |
* http://jqueryui.com
|
3 |
-
* Includes:
|
4 |
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
|
5 |
-
* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:2px;padding:.5em .5em .5em .7em;min-height:0}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:21px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:0}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:400}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:400;margin:-1px}.ui-menu .ui-state-disabled{font-weight:400;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url(images/animated-overlay.gif);height:100%;filter:alpha(opacity=25);opacity:.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted #000}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:0;background:0;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:0;border-bottom:0;border-right:0}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:0}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
|
|
|
|
1 |
+
/*! jQuery UI - v1.11.4 - 2015-03-11
|
2 |
* http://jqueryui.com
|
3 |
+
* Includes: core.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, draggable.css, menu.css, progressbar.css, resizable.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
|
4 |
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
|
5 |
+
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
|
6 |
+
|
7 |
+
.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;min-height:0;font-size:100%}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{overflow:hidden;position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:none}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{position:relative;margin:0;padding:3px 1em 3px .4em;cursor:pointer;min-height:0;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{font-size:1em;font-weight:bold;line-height:1.5;padding:2px 0.4em;margin:0.5em 0 0 0;height:auto;border:0}.ui-selectmenu-open{display:block}.ui-selectmenu-button{display:inline-block;overflow:hidden;position:relative;text-decoration:none;cursor:pointer}.ui-selectmenu-button span.ui-icon{right:0.5em;left:auto;margin-top:-8px;position:absolute;top:50%}.ui-selectmenu-button span.ui-selectmenu-text{text-align:left;padding:0.4em 2.1em 0.4em 1em;display:block;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:none;border-bottom:none;border-right:none}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-state-default .ui-icon{background-image:url("images/ui-icons_888888_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-active .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("images/ui-icons_2e83ff_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cd0a0a_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
|
includes/js/jquery-ui/themes/smoothness/{jquery.ui.theme.css → theme.css}
RENAMED
@@ -1,12 +1,12 @@
|
|
1 |
/*!
|
2 |
-
* jQuery UI CSS Framework 1.
|
3 |
* http://jqueryui.com
|
4 |
*
|
5 |
-
* Copyright
|
6 |
* Released under the MIT license.
|
7 |
* http://jquery.org/license
|
8 |
*
|
9 |
-
* http://
|
10 |
*
|
11 |
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
|
12 |
*/
|
@@ -30,7 +30,7 @@
|
|
30 |
}
|
31 |
.ui-widget-content {
|
32 |
border: 1px solid #aaaaaa;
|
33 |
-
background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
|
34 |
color: #222222;
|
35 |
}
|
36 |
.ui-widget-content a {
|
@@ -38,7 +38,7 @@
|
|
38 |
}
|
39 |
.ui-widget-header {
|
40 |
border: 1px solid #aaaaaa;
|
41 |
-
background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;
|
42 |
color: #222222;
|
43 |
font-weight: bold;
|
44 |
}
|
@@ -52,7 +52,7 @@
|
|
52 |
.ui-widget-content .ui-state-default,
|
53 |
.ui-widget-header .ui-state-default {
|
54 |
border: 1px solid #d3d3d3;
|
55 |
-
background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;
|
56 |
font-weight: normal;
|
57 |
color: #555555;
|
58 |
}
|
@@ -69,14 +69,18 @@
|
|
69 |
.ui-widget-content .ui-state-focus,
|
70 |
.ui-widget-header .ui-state-focus {
|
71 |
border: 1px solid #999999;
|
72 |
-
background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;
|
73 |
font-weight: normal;
|
74 |
color: #212121;
|
75 |
}
|
76 |
.ui-state-hover a,
|
77 |
.ui-state-hover a:hover,
|
78 |
.ui-state-hover a:link,
|
79 |
-
.ui-state-hover a:visited
|
|
|
|
|
|
|
|
|
80 |
color: #212121;
|
81 |
text-decoration: none;
|
82 |
}
|
@@ -84,7 +88,7 @@
|
|
84 |
.ui-widget-content .ui-state-active,
|
85 |
.ui-widget-header .ui-state-active {
|
86 |
border: 1px solid #aaaaaa;
|
87 |
-
background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;
|
88 |
font-weight: normal;
|
89 |
color: #212121;
|
90 |
}
|
@@ -101,7 +105,7 @@
|
|
101 |
.ui-widget-content .ui-state-highlight,
|
102 |
.ui-widget-header .ui-state-highlight {
|
103 |
border: 1px solid #fcefa1;
|
104 |
-
background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;
|
105 |
color: #363636;
|
106 |
}
|
107 |
.ui-state-highlight a,
|
@@ -113,7 +117,7 @@
|
|
113 |
.ui-widget-content .ui-state-error,
|
114 |
.ui-widget-header .ui-state-error {
|
115 |
border: 1px solid #cd0a0a;
|
116 |
-
background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;
|
117 |
color: #cd0a0a;
|
118 |
}
|
119 |
.ui-state-error a,
|
@@ -135,18 +139,18 @@
|
|
135 |
.ui-widget-content .ui-priority-secondary,
|
136 |
.ui-widget-header .ui-priority-secondary {
|
137 |
opacity: .7;
|
138 |
-
filter:Alpha(Opacity=70);
|
139 |
font-weight: normal;
|
140 |
}
|
141 |
.ui-state-disabled,
|
142 |
.ui-widget-content .ui-state-disabled,
|
143 |
.ui-widget-header .ui-state-disabled {
|
144 |
opacity: .35;
|
145 |
-
filter:Alpha(Opacity=35);
|
146 |
background-image: none;
|
147 |
}
|
148 |
.ui-state-disabled .ui-icon {
|
149 |
-
filter:Alpha(Opacity=35); /*
|
150 |
}
|
151 |
|
152 |
/* Icons
|
@@ -159,27 +163,27 @@
|
|
159 |
}
|
160 |
.ui-icon,
|
161 |
.ui-widget-content .ui-icon {
|
162 |
-
background-image: url(images/ui-icons_222222_256x240.png);
|
163 |
}
|
164 |
.ui-widget-header .ui-icon {
|
165 |
-
background-image: url(images/ui-icons_222222_256x240.png);
|
166 |
}
|
167 |
.ui-state-default .ui-icon {
|
168 |
-
background-image: url(images/ui-icons_888888_256x240.png);
|
169 |
}
|
170 |
.ui-state-hover .ui-icon,
|
171 |
.ui-state-focus .ui-icon {
|
172 |
-
background-image: url(images/ui-icons_454545_256x240.png);
|
173 |
}
|
174 |
.ui-state-active .ui-icon {
|
175 |
-
background-image: url(images/ui-icons_454545_256x240.png);
|
176 |
}
|
177 |
.ui-state-highlight .ui-icon {
|
178 |
-
background-image: url(images/ui-icons_2e83ff_256x240.png);
|
179 |
}
|
180 |
.ui-state-error .ui-icon,
|
181 |
.ui-state-error-text .ui-icon {
|
182 |
-
background-image: url(images/ui-icons_cd0a0a_256x240.png);
|
183 |
}
|
184 |
|
185 |
/* positioning */
|
@@ -392,15 +396,15 @@
|
|
392 |
|
393 |
/* Overlays */
|
394 |
.ui-widget-overlay {
|
395 |
-
background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
|
396 |
opacity: .3;
|
397 |
-
filter: Alpha(Opacity=30);
|
398 |
}
|
399 |
.ui-widget-shadow {
|
400 |
margin: -8px 0 0 -8px;
|
401 |
padding: 8px;
|
402 |
-
background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
|
403 |
opacity: .3;
|
404 |
-
filter: Alpha(Opacity=30);
|
405 |
border-radius: 8px;
|
406 |
}
|
1 |
/*!
|
2 |
+
* jQuery UI CSS Framework 1.11.4
|
3 |
* http://jqueryui.com
|
4 |
*
|
5 |
+
* Copyright jQuery Foundation and other contributors
|
6 |
* Released under the MIT license.
|
7 |
* http://jquery.org/license
|
8 |
*
|
9 |
+
* http://api.jqueryui.com/category/theming/
|
10 |
*
|
11 |
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
|
12 |
*/
|
30 |
}
|
31 |
.ui-widget-content {
|
32 |
border: 1px solid #aaaaaa;
|
33 |
+
background: #ffffff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;
|
34 |
color: #222222;
|
35 |
}
|
36 |
.ui-widget-content a {
|
38 |
}
|
39 |
.ui-widget-header {
|
40 |
border: 1px solid #aaaaaa;
|
41 |
+
background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;
|
42 |
color: #222222;
|
43 |
font-weight: bold;
|
44 |
}
|
52 |
.ui-widget-content .ui-state-default,
|
53 |
.ui-widget-header .ui-state-default {
|
54 |
border: 1px solid #d3d3d3;
|
55 |
+
background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;
|
56 |
font-weight: normal;
|
57 |
color: #555555;
|
58 |
}
|
69 |
.ui-widget-content .ui-state-focus,
|
70 |
.ui-widget-header .ui-state-focus {
|
71 |
border: 1px solid #999999;
|
72 |
+
background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;
|
73 |
font-weight: normal;
|
74 |
color: #212121;
|
75 |
}
|
76 |
.ui-state-hover a,
|
77 |
.ui-state-hover a:hover,
|
78 |
.ui-state-hover a:link,
|
79 |
+
.ui-state-hover a:visited,
|
80 |
+
.ui-state-focus a,
|
81 |
+
.ui-state-focus a:hover,
|
82 |
+
.ui-state-focus a:link,
|
83 |
+
.ui-state-focus a:visited {
|
84 |
color: #212121;
|
85 |
text-decoration: none;
|
86 |
}
|
88 |
.ui-widget-content .ui-state-active,
|
89 |
.ui-widget-header .ui-state-active {
|
90 |
border: 1px solid #aaaaaa;
|
91 |
+
background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
|
92 |
font-weight: normal;
|
93 |
color: #212121;
|
94 |
}
|
105 |
.ui-widget-content .ui-state-highlight,
|
106 |
.ui-widget-header .ui-state-highlight {
|
107 |
border: 1px solid #fcefa1;
|
108 |
+
background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;
|
109 |
color: #363636;
|
110 |
}
|
111 |
.ui-state-highlight a,
|
117 |
.ui-widget-content .ui-state-error,
|
118 |
.ui-widget-header .ui-state-error {
|
119 |
border: 1px solid #cd0a0a;
|
120 |
+
background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
|
121 |
color: #cd0a0a;
|
122 |
}
|
123 |
.ui-state-error a,
|
139 |
.ui-widget-content .ui-priority-secondary,
|
140 |
.ui-widget-header .ui-priority-secondary {
|
141 |
opacity: .7;
|
142 |
+
filter:Alpha(Opacity=70); /* support: IE8 */
|
143 |
font-weight: normal;
|
144 |
}
|
145 |
.ui-state-disabled,
|
146 |
.ui-widget-content .ui-state-disabled,
|
147 |
.ui-widget-header .ui-state-disabled {
|
148 |
opacity: .35;
|
149 |
+
filter:Alpha(Opacity=35); /* support: IE8 */
|
150 |
background-image: none;
|
151 |
}
|
152 |
.ui-state-disabled .ui-icon {
|
153 |
+
filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
|
154 |
}
|
155 |
|
156 |
/* Icons
|
163 |
}
|
164 |
.ui-icon,
|
165 |
.ui-widget-content .ui-icon {
|
166 |
+
background-image: url("images/ui-icons_222222_256x240.png");
|
167 |
}
|
168 |
.ui-widget-header .ui-icon {
|
169 |
+
background-image: url("images/ui-icons_222222_256x240.png");
|
170 |
}
|
171 |
.ui-state-default .ui-icon {
|
172 |
+
background-image: url("images/ui-icons_888888_256x240.png");
|
173 |
}
|
174 |
.ui-state-hover .ui-icon,
|
175 |
.ui-state-focus .ui-icon {
|
176 |
+
background-image: url("images/ui-icons_454545_256x240.png");
|
177 |
}
|
178 |
.ui-state-active .ui-icon {
|
179 |
+
background-image: url("images/ui-icons_454545_256x240.png");
|
180 |
}
|
181 |
.ui-state-highlight .ui-icon {
|
182 |
+
background-image: url("images/ui-icons_2e83ff_256x240.png");
|
183 |
}
|
184 |
.ui-state-error .ui-icon,
|
185 |
.ui-state-error-text .ui-icon {
|
186 |
+
background-image: url("images/ui-icons_cd0a0a_256x240.png");
|
187 |
}
|
188 |
|
189 |
/* positioning */
|
396 |
|
397 |
/* Overlays */
|
398 |
.ui-widget-overlay {
|
399 |
+
background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
|
400 |
opacity: .3;
|
401 |
+
filter: Alpha(Opacity=30); /* support: IE8 */
|
402 |
}
|
403 |
.ui-widget-shadow {
|
404 |
margin: -8px 0 0 -8px;
|
405 |
padding: 8px;
|
406 |
+
background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
|
407 |
opacity: .3;
|
408 |
+
filter: Alpha(Opacity=30); /* support: IE8 */
|
409 |
border-radius: 8px;
|
410 |
}
|
includes/js/jquery.form.js
DELETED
@@ -1,1277 +0,0 @@
|
|
1 |
-
/*!
|
2 |
-
* jQuery Form Plugin
|
3 |
-
* version: 3.51.0-2014.06.20
|
4 |
-
* Requires jQuery v1.5 or later
|
5 |
-
* Copyright (c) 2014 M. Alsup
|
6 |
-
* Examples and documentation at: http://malsup.com/jquery/form/
|
7 |
-
* Project repository: https://github.com/malsup/form
|
8 |
-
* Dual licensed under the MIT and GPL licenses.
|
9 |
-
* https://github.com/malsup/form#copyright-and-license
|
10 |
-
*/
|
11 |
-
/*global ActiveXObject */
|
12 |
-
|
13 |
-
// AMD support
|
14 |
-
(function (factory) {
|
15 |
-
"use strict";
|
16 |
-
if (typeof define === 'function' && define.amd) {
|
17 |
-
// using AMD; register as anon module
|
18 |
-
define(['jquery'], factory);
|
19 |
-
} else {
|
20 |
-
// no AMD; invoke directly
|
21 |
-
factory( (typeof(jQuery) != 'undefined') ? jQuery : window.Zepto );
|
22 |
-
}
|
23 |
-
}
|
24 |
-
|
25 |
-
(function($) {
|
26 |
-
"use strict";
|
27 |
-
|
28 |
-
/*
|
29 |
-
Usage Note:
|
30 |
-
-----------
|
31 |
-
Do not use both ajaxSubmit and ajaxForm on the same form. These
|
32 |
-
functions are mutually exclusive. Use ajaxSubmit if you want
|
33 |
-
to bind your own submit handler to the form. For example,
|
34 |
-
|
35 |
-
$(document).ready(function() {
|
36 |
-
$('#myForm').on('submit', function(e) {
|
37 |
-
e.preventDefault(); // <-- important
|
38 |
-
$(this).ajaxSubmit({
|
39 |
-
target: '#output'
|
40 |
-
});
|
41 |
-
});
|
42 |
-
});
|
43 |
-
|
44 |
-
Use ajaxForm when you want the plugin to manage all the event binding
|
45 |
-
for you. For example,
|
46 |
-
|
47 |
-
$(document).ready(function() {
|
48 |
-
$('#myForm').ajaxForm({
|
49 |
-
target: '#output'
|
50 |
-
});
|
51 |
-
});
|
52 |
-
|
53 |
-
You can also use ajaxForm with delegation (requires jQuery v1.7+), so the
|
54 |
-
form does not have to exist when you invoke ajaxForm:
|
55 |
-
|
56 |
-
$('#myForm').ajaxForm({
|
57 |
-
delegation: true,
|
58 |
-
target: '#output'
|
59 |
-
});
|
60 |
-
|
61 |
-
When using ajaxForm, the ajaxSubmit function will be invoked for you
|
62 |
-
at the appropriate time.
|
63 |
-
*/
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Feature detection
|
67 |
-
*/
|
68 |
-
var feature = {};
|
69 |
-
feature.fileapi = $("<input type='file'/>").get(0).files !== undefined;
|
70 |
-
feature.formdata = window.FormData !== undefined;
|
71 |
-
|
72 |
-
var hasProp = !!$.fn.prop;
|
73 |
-
|
74 |
-
// attr2 uses prop when it can but checks the return type for
|
75 |
-
// an expected string. this accounts for the case where a form
|
76 |
-
// contains inputs with names like "action" or "method"; in those
|
77 |
-
// cases "prop" returns the element
|
78 |
-
$.fn.attr2 = function() {
|
79 |
-
if ( ! hasProp ) {
|
80 |
-
return this.attr.apply(this, arguments);
|
81 |
-
}
|
82 |
-
var val = this.prop.apply(this, arguments);
|
83 |
-
if ( ( val && val.jquery ) || typeof val === 'string' ) {
|
84 |
-
return val;
|
85 |
-
}
|
86 |
-
return this.attr.apply(this, arguments);
|
87 |
-
};
|
88 |
-
|
89 |
-
/**
|
90 |
-
* ajaxSubmit() provides a mechanism for immediately submitting
|
91 |
-
* an HTML form using AJAX.
|
92 |
-
*/
|
93 |
-
$.fn.ajaxSubmit = function(options) {
|
94 |
-
/*jshint scripturl:true */
|
95 |
-
|
96 |
-
// fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
|
97 |
-
if (!this.length) {
|
98 |
-
log('ajaxSubmit: skipping submit process - no element selected');
|
99 |
-
return this;
|
100 |
-
}
|
101 |
-
|
102 |
-
var method, action, url, $form = this;
|
103 |
-
|
104 |
-
if (typeof options == 'function') {
|
105 |
-
options = { success: options };
|
106 |
-
}
|
107 |
-
else if ( options === undefined ) {
|
108 |
-
options = {};
|
109 |
-
}
|
110 |
-
|
111 |
-
method = options.type || this.attr2('method');
|
112 |
-
action = options.url || this.attr2('action');
|
113 |
-
|
114 |
-
url = (typeof action === 'string') ? $.trim(action) : '';
|
115 |
-
url = url || window.location.href || '';
|
116 |
-
if (url) {
|
117 |
-
// clean url (don't include hash vaue)
|
118 |
-
url = (url.match(/^([^#]+)/)||[])[1];
|
119 |
-
}
|
120 |
-
|
121 |
-
options = $.extend(true, {
|
122 |
-
url: url,
|
123 |
-
success: $.ajaxSettings.success,
|
124 |
-
type: method || $.ajaxSettings.type,
|
125 |
-
iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
|
126 |
-
}, options);
|
127 |
-
|
128 |
-
// hook for manipulating the form data before it is extracted;
|
129 |
-
// convenient for use with rich editors like tinyMCE or FCKEditor
|
130 |
-
var veto = {};
|
131 |
-
this.trigger('form-pre-serialize', [this, options, veto]);
|
132 |
-
if (veto.veto) {
|
133 |
-
log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
|
134 |
-
return this;
|
135 |
-
}
|
136 |
-
|
137 |
-
// provide opportunity to alter form data before it is serialized
|
138 |
-
if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
|
139 |
-
log('ajaxSubmit: submit aborted via beforeSerialize callback');
|
140 |
-
return this;
|
141 |
-
}
|
142 |
-
|
143 |
-
var traditional = options.traditional;
|
144 |
-
if ( traditional === undefined ) {
|
145 |
-
traditional = $.ajaxSettings.traditional;
|
146 |
-
}
|
147 |
-
|
148 |
-
var elements = [];
|
149 |
-
var qx, a = this.formToArray(options.semantic, elements);
|
150 |
-
if (options.data) {
|
151 |
-
options.extraData = options.data;
|
152 |
-
qx = $.param(options.data, traditional);
|
153 |
-
}
|
154 |
-
|
155 |
-
// give pre-submit callback an opportunity to abort the submit
|
156 |
-
if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
|
157 |
-
log('ajaxSubmit: submit aborted via beforeSubmit callback');
|
158 |
-
return this;
|
159 |
-
}
|
160 |
-
|
161 |
-
// fire vetoable 'validate' event
|
162 |
-
this.trigger('form-submit-validate', [a, this, options, veto]);
|
163 |
-
if (veto.veto) {
|
164 |
-
log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
|
165 |
-
return this;
|
166 |
-
}
|
167 |
-
|
168 |
-
var q = $.param(a, traditional);
|
169 |
-
if (qx) {
|
170 |
-
q = ( q ? (q + '&' + qx) : qx );
|
171 |
-
}
|
172 |
-
if (options.type.toUpperCase() == 'GET') {
|
173 |
-
options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
|
174 |
-
options.data = null; // data is null for 'get'
|
175 |
-
}
|
176 |
-
else {
|
177 |
-
options.data = q; // data is the query string for 'post'
|
178 |
-
}
|
179 |
-
|
180 |
-
var callbacks = [];
|
181 |
-
if (options.resetForm) {
|
182 |
-
callbacks.push(function() { $form.resetForm(); });
|
183 |
-
}
|
184 |
-
if (options.clearForm) {
|
185 |
-
callbacks.push(function() { $form.clearForm(options.includeHidden); });
|
186 |
-
}
|
187 |
-
|
188 |
-
// perform a load on the target only if dataType is not provided
|
189 |
-
if (!options.dataType && options.target) {
|
190 |
-
var oldSuccess = options.success || function(){};
|
191 |
-
callbacks.push(function(data) {
|
192 |
-
var fn = options.replaceTarget ? 'replaceWith' : 'html';
|
193 |
-
$(options.target)[fn](data).each(oldSuccess, arguments);
|
194 |
-
});
|
195 |
-
}
|
196 |
-
else if (options.success) {
|
197 |
-
callbacks.push(options.success);
|
198 |
-
}
|
199 |
-
|
200 |
-
options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
|
201 |
-
var context = options.context || this ; // jQuery 1.4+ supports scope context
|
202 |
-
for (var i=0, max=callbacks.length; i < max; i++) {
|
203 |
-
callbacks[i].apply(context, [data, status, xhr || $form, $form]);
|
204 |
-
}
|
205 |
-
};
|
206 |
-
|
207 |
-
if (options.error) {
|
208 |
-
var oldError = options.error;
|
209 |
-
options.error = function(xhr, status, error) {
|
210 |
-
var context = options.context || this;
|
211 |
-
oldError.apply(context, [xhr, status, error, $form]);
|
212 |
-
};
|
213 |
-
}
|
214 |
-
|
215 |
-
if (options.complete) {
|
216 |
-
var oldComplete = options.complete;
|
217 |
-
options.complete = function(xhr, status) {
|
218 |
-
var context = options.context || this;
|
219 |
-
oldComplete.apply(context, [xhr, status, $form]);
|
220 |
-
};
|
221 |
-
}
|
222 |
-
|
223 |
-
// are there files to upload?
|
224 |
-
|
225 |
-
// [value] (issue #113), also see comment:
|
226 |
-
// https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219
|
227 |
-
var fileInputs = $('input[type=file]:enabled', this).filter(function() { return $(this).val() !== ''; });
|
228 |
-
|
229 |
-
var hasFileInputs = fileInputs.length > 0;
|
230 |
-
var mp = 'multipart/form-data';
|
231 |
-
var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
|
232 |
-
|
233 |
-
var fileAPI = feature.fileapi && feature.formdata;
|
234 |
-
log("fileAPI :" + fileAPI);
|
235 |
-
var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI;
|
236 |
-
|
237 |
-
var jqxhr;
|
238 |
-
|
239 |
-
// options.iframe allows user to force iframe mode
|
240 |
-
// 06-NOV-09: now defaulting to iframe mode if file input is detected
|
241 |
-
if (options.iframe !== false && (options.iframe || shouldUseFrame)) {
|
242 |
-
// hack to fix Safari hang (thanks to Tim Molendijk for this)
|
243 |
-
// see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
|
244 |
-
if (options.closeKeepAlive) {
|
245 |
-
$.get(options.closeKeepAlive, function() {
|
246 |
-
jqxhr = fileUploadIframe(a);
|
247 |
-
});
|
248 |
-
}
|
249 |
-
else {
|
250 |
-
jqxhr = fileUploadIframe(a);
|
251 |
-
}
|
252 |
-
}
|
253 |
-
else if ((hasFileInputs || multipart) && fileAPI) {
|
254 |
-
jqxhr = fileUploadXhr(a);
|
255 |
-
}
|
256 |
-
else {
|
257 |
-
jqxhr = $.ajax(options);
|
258 |
-
}
|
259 |
-
|
260 |
-
$form.removeData('jqxhr').data('jqxhr', jqxhr);
|
261 |
-
|
262 |
-
// clear element array
|
263 |
-
for (var k=0; k < elements.length; k++) {
|
264 |
-
elements[k] = null;
|
265 |
-
}
|
266 |
-
|
267 |
-
// fire 'notify' event
|
268 |
-
this.trigger('form-submit-notify', [this, options]);
|
269 |
-
return this;
|
270 |
-
|
271 |
-
// utility fn for deep serialization
|
272 |
-
function deepSerialize(extraData){
|
273 |
-
var serialized = $.param(extraData, options.traditional).split('&');
|
274 |
-
var len = serialized.length;
|
275 |
-
var result = [];
|
276 |
-
var i, part;
|
277 |
-
for (i=0; i < len; i++) {
|
278 |
-
// #252; undo param space replacement
|
279 |
-
serialized[i] = serialized[i].replace(/\+/g,' ');
|
280 |
-
part = serialized[i].split('=');
|
281 |
-
// #278; use array instead of object storage, favoring array serializations
|
282 |
-
result.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])]);
|
283 |
-
}
|
284 |
-
return result;
|
285 |
-
}
|
286 |
-
|
287 |
-
// XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz)
|
288 |
-
function fileUploadXhr(a) {
|
289 |
-
var formdata = new FormData();
|
290 |
-
|
291 |
-
for (var i=0; i < a.length; i++) {
|
292 |
-
formdata.append(a[i].name, a[i].value);
|
293 |
-
}
|
294 |
-
|
295 |
-
if (options.extraData) {
|
296 |
-
var serializedData = deepSerialize(options.extraData);
|
297 |
-
for (i=0; i < serializedData.length; i++) {
|
298 |
-
if (serializedData[i]) {
|
299 |
-
formdata.append(serializedData[i][0], serializedData[i][1]);
|
300 |
-
}
|
301 |
-
}
|
302 |
-
}
|
303 |
-
|
304 |
-
options.data = null;
|
305 |
-
|
306 |
-
var s = $.extend(true, {}, $.ajaxSettings, options, {
|
307 |
-
contentType: false,
|
308 |
-
processData: false,
|
309 |
-
cache: false,
|
310 |
-
type: method || 'POST'
|
311 |
-
});
|
312 |
-
|
313 |
-
if (options.uploadProgress) {
|
314 |
-
// workaround because jqXHR does not expose upload property
|
315 |
-
s.xhr = function() {
|
316 |
-
var xhr = $.ajaxSettings.xhr();
|
317 |
-
if (xhr.upload) {
|
318 |
-
xhr.upload.addEventListener('progress', function(event) {
|
319 |
-
var percent = 0;
|
320 |
-
var position = event.loaded || event.position; /*event.position is deprecated*/
|
321 |
-
var total = event.total;
|
322 |
-
if (event.lengthComputable) {
|
323 |
-
percent = Math.ceil(position / total * 100);
|
324 |
-
}
|
325 |
-
options.uploadProgress(event, position, total, percent);
|
326 |
-
}, false);
|
327 |
-
}
|
328 |
-
return xhr;
|
329 |
-
};
|
330 |
-
}
|
331 |
-
|
332 |
-
s.data = null;
|
333 |
-
var beforeSend = s.beforeSend;
|
334 |
-
s.beforeSend = function(xhr, o) {
|
335 |
-
//Send FormData() provided by user
|
336 |
-
if (options.formData) {
|
337 |
-
o.data = options.formData;
|
338 |
-
}
|
339 |
-
else {
|
340 |
-
o.data = formdata;
|
341 |
-
}
|
342 |
-
if(beforeSend) {
|
343 |
-
beforeSend.call(this, xhr, o);
|
344 |
-
}
|
345 |
-
};
|
346 |
-
return $.ajax(s);
|
347 |
-
}
|
348 |
-
|
349 |
-
// private function for handling file uploads (hat tip to YAHOO!)
|
350 |
-
function fileUploadIframe(a) {
|
351 |
-
var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
|
352 |
-
var deferred = $.Deferred();
|
353 |
-
|
354 |
-
// #341
|
355 |
-
deferred.abort = function(status) {
|
356 |
-
xhr.abort(status);
|
357 |
-
};
|
358 |
-
|
359 |
-
if (a) {
|
360 |
-
// ensure that every serialized input is still enabled
|
361 |
-
for (i=0; i < elements.length; i++) {
|
362 |
-
el = $(elements[i]);
|
363 |
-
if ( hasProp ) {
|
364 |
-
el.prop('disabled', false);
|
365 |
-
}
|
366 |
-
else {
|
367 |
-
el.removeAttr('disabled');
|
368 |
-
}
|
369 |
-
}
|
370 |
-
}
|
371 |
-
|
372 |
-
s = $.extend(true, {}, $.ajaxSettings, options);
|
373 |
-
s.context = s.context || s;
|
374 |
-
id = 'jqFormIO' + (new Date().getTime());
|
375 |
-
if (s.iframeTarget) {
|
376 |
-
$io = $(s.iframeTarget);
|
377 |
-
n = $io.attr2('name');
|
378 |
-
if (!n) {
|
379 |
-
$io.attr2('name', id);
|
380 |
-
}
|
381 |
-
else {
|
382 |
-
id = n;
|
383 |
-
}
|
384 |
-
}
|
385 |
-
else {
|
386 |
-
$io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />');
|
387 |
-
$io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
|
388 |
-
}
|
389 |
-
io = $io[0];
|
390 |
-
|
391 |
-
|
392 |
-
xhr = { // mock object
|
393 |
-
aborted: 0,
|
394 |
-
responseText: null,
|
395 |
-
responseXML: null,
|
396 |
-
status: 0,
|
397 |
-
statusText: 'n/a',
|
398 |
-
getAllResponseHeaders: function() {},
|
399 |
-
getResponseHeader: function() {},
|
400 |
-
setRequestHeader: function() {},
|
401 |
-
abort: function(status) {
|
402 |
-
var e = (status === 'timeout' ? 'timeout' : 'aborted');
|
403 |
-
log('aborting upload... ' + e);
|
404 |
-
this.aborted = 1;
|
405 |
-
|
406 |
-
try { // #214, #257
|
407 |
-
if (io.contentWindow.document.execCommand) {
|
408 |
-
io.contentWindow.document.execCommand('Stop');
|
409 |
-
}
|
410 |
-
}
|
411 |
-
catch(ignore) {}
|
412 |
-
|
413 |
-
$io.attr('src', s.iframeSrc); // abort op in progress
|
414 |
-
xhr.error = e;
|
415 |
-
if (s.error) {
|
416 |
-
s.error.call(s.context, xhr, e, status);
|
417 |
-
}
|
418 |
-
if (g) {
|
419 |
-
$.event.trigger("ajaxError", [xhr, s, e]);
|
420 |
-
}
|
421 |
-
if (s.complete) {
|
422 |
-
s.complete.call(s.context, xhr, e);
|
423 |
-
}
|
424 |
-
}
|
425 |
-
};
|
426 |
-
|
427 |
-
g = s.global;
|
428 |
-
// trigger ajax global events so that activity/block indicators work like normal
|
429 |
-
if (g && 0 === $.active++) {
|
430 |
-
$.event.trigger("ajaxStart");
|
431 |
-
}
|
432 |
-
if (g) {
|
433 |
-
$.event.trigger("ajaxSend", [xhr, s]);
|
434 |
-
}
|
435 |
-
|
436 |
-
if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
|
437 |
-
if (s.global) {
|
438 |
-
$.active--;
|
439 |
-
}
|
440 |
-
deferred.reject();
|
441 |
-
return deferred;
|
442 |
-
}
|
443 |
-
if (xhr.aborted) {
|
444 |
-
deferred.reject();
|
445 |
-
return deferred;
|
446 |
-
}
|
447 |
-
|
448 |
-
// add submitting element to data if we know it
|
449 |
-
sub = form.clk;
|
450 |
-
if (sub) {
|
451 |
-
n = sub.name;
|
452 |
-
if (n && !sub.disabled) {
|
453 |
-
s.extraData = s.extraData || {};
|
454 |
-
s.extraData[n] = sub.value;
|
455 |
-
if (sub.type == "image") {
|
456 |
-
s.extraData[n+'.x'] = form.clk_x;
|
457 |
-
s.extraData[n+'.y'] = form.clk_y;
|
458 |
-
}
|
459 |
-
}
|
460 |
-
}
|
461 |
-
|
462 |
-
var CLIENT_TIMEOUT_ABORT = 1;
|
463 |
-
var SERVER_ABORT = 2;
|
464 |
-
|
465 |
-
function getDoc(frame) {
|
466 |
-
/* it looks like contentWindow or contentDocument do not
|
467 |
-
* carry the protocol property in ie8, when running under ssl
|
468 |
-
* frame.document is the only valid response document, since
|
469 |
-
* the protocol is know but not on the other two objects. strange?
|
470 |
-
* "Same origin policy" http://en.wikipedia.org/wiki/Same_origin_policy
|
471 |
-
*/
|
472 |
-
|
473 |
-
var doc = null;
|
474 |
-
|
475 |
-
// IE8 cascading access check
|
476 |
-
try {
|
477 |
-
if (frame.contentWindow) {
|
478 |
-
doc = frame.contentWindow.document;
|
479 |
-
}
|
480 |
-
} catch(err) {
|
481 |
-
// IE8 access denied under ssl & missing protocol
|
482 |
-
log('cannot get iframe.contentWindow document: ' + err);
|
483 |
-
}
|
484 |
-
|
485 |
-
if (doc) { // successful getting content
|
486 |
-
return doc;
|
487 |
-
}
|
488 |
-
|
489 |
-
try { // simply checking may throw in ie8 under ssl or mismatched protocol
|
490 |
-
doc = frame.contentDocument ? frame.contentDocument : frame.document;
|
491 |
-
} catch(err) {
|
492 |
-
// last attempt
|
493 |
-
log('cannot get iframe.contentDocument: ' + err);
|
494 |
-
doc = frame.document;
|
495 |
-
}
|
496 |
-
return doc;
|
497 |
-
}
|
498 |
-
|
499 |
-
// Rails CSRF hack (thanks to Yvan Barthelemy)
|
500 |
-
var csrf_token = $('meta[name=csrf-token]').attr('content');
|
501 |
-
var csrf_param = $('meta[name=csrf-param]').attr('content');
|
502 |
-
if (csrf_param && csrf_token) {
|
503 |
-
s.extraData = s.extraData || {};
|
504 |
-
s.extraData[csrf_param] = csrf_token;
|
505 |
-
}
|
506 |
-
|
507 |
-
// take a breath so that pending repaints get some cpu time before the upload starts
|
508 |
-
function doSubmit() {
|
509 |
-
// make sure form attrs are set
|
510 |
-
var t = $form.attr2('target'),
|
511 |
-
a = $form.attr2('action'),
|
512 |
-
mp = 'multipart/form-data',
|
513 |
-
et = $form.attr('enctype') || $form.attr('encoding') || mp;
|
514 |
-
|
515 |
-
// update form attrs in IE friendly way
|
516 |
-
form.setAttribute('target',id);
|
517 |
-
if (!method || /post/i.test(method) ) {
|
518 |
-
form.setAttribute('method', 'POST');
|
519 |
-
}
|
520 |
-
if (a != s.url) {
|
521 |
-
form.setAttribute('action', s.url);
|
522 |
-
}
|
523 |
-
|
524 |
-
// ie borks in some cases when setting encoding
|
525 |
-
if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {
|
526 |
-
$form.attr({
|
527 |
-
encoding: 'multipart/form-data',
|
528 |
-
enctype: 'multipart/form-data'
|
529 |
-
});
|
530 |
-
}
|
531 |
-
|
532 |
-
// support timout
|
533 |
-
if (s.timeout) {
|
534 |
-
timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);
|
535 |
-
}
|
536 |
-
|
537 |
-
// look for server aborts
|
538 |
-
function checkState() {
|
539 |
-
try {
|
540 |
-
var state = getDoc(io).readyState;
|
541 |
-
log('state = ' + state);
|
542 |
-
if (state && state.toLowerCase() == 'uninitialized') {
|
543 |
-
setTimeout(checkState,50);
|
544 |
-
}
|
545 |
-
}
|
546 |
-
catch(e) {
|
547 |
-
log('Server abort: ' , e, ' (', e.name, ')');
|
548 |
-
cb(SERVER_ABORT);
|
549 |
-
if (timeoutHandle) {
|
550 |
-
clearTimeout(timeoutHandle);
|
551 |
-
}
|
552 |
-
timeoutHandle = undefined;
|
553 |
-
}
|
554 |
-
}
|
555 |
-
|
556 |
-
// add "extra" data to form if provided in options
|
557 |
-
var extraInputs = [];
|
558 |
-
try {
|
559 |
-
if (s.extraData) {
|
560 |
-
for (var n in s.extraData) {
|
561 |
-
if (s.extraData.hasOwnProperty(n)) {
|
562 |
-
// if using the $.param format that allows for multiple values with the same name
|
563 |
-
if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {
|
564 |
-
extraInputs.push(
|
565 |
-
$('<input type="hidden" name="'+s.extraData[n].name+'">').val(s.extraData[n].value)
|
566 |
-
.appendTo(form)[0]);
|
567 |
-
} else {
|
568 |
-
extraInputs.push(
|
569 |
-
$('<input type="hidden" name="'+n+'">').val(s.extraData[n])
|
570 |
-
.appendTo(form)[0]);
|
571 |
-
}
|
572 |
-
}
|
573 |
-
}
|
574 |
-
}
|
575 |
-
|
576 |
-
if (!s.iframeTarget) {
|
577 |
-
// add iframe to doc and submit the form
|
578 |
-
$io.appendTo('body');
|
579 |
-
}
|
580 |
-
if (io.attachEvent) {
|
581 |
-
io.attachEvent('onload', cb);
|
582 |
-
}
|
583 |
-
else {
|
584 |
-
io.addEventListener('load', cb, false);
|
585 |
-
}
|
586 |
-
setTimeout(checkState,15);
|
587 |
-
|
588 |
-
try {
|
589 |
-
form.submit();
|
590 |
-
} catch(err) {
|
591 |
-
// just in case form has element with name/id of 'submit'
|
592 |
-
var submitFn = document.createElement('form').submit;
|
593 |
-
submitFn.apply(form);
|
594 |
-
}
|
595 |
-
}
|
596 |
-
finally {
|
597 |
-
// reset attrs and remove "extra" input elements
|
598 |
-
form.setAttribute('action',a);
|
599 |
-
form.setAttribute('enctype', et); // #380
|
600 |
-
if(t) {
|
601 |
-
form.setAttribute('target', t);
|
602 |
-
} else {
|
603 |
-
$form.removeAttr('target');
|
604 |
-
}
|
605 |
-
$(extraInputs).remove();
|
606 |
-
}
|
607 |
-
}
|
608 |
-
|
609 |
-
if (s.forceSync) {
|
610 |
-
doSubmit();
|
611 |
-
}
|
612 |
-
else {
|
613 |
-
setTimeout(doSubmit, 10); // this lets dom updates render
|
614 |
-
}
|
615 |
-
|
616 |
-
var data, doc, domCheckCount = 50, callbackProcessed;
|
617 |
-
|
618 |
-
function cb(e) {
|
619 |
-
if (xhr.aborted || callbackProcessed) {
|
620 |
-
return;
|
621 |
-
}
|
622 |
-
|
623 |
-
doc = getDoc(io);
|
624 |
-
if(!doc) {
|
625 |
-
log('cannot access response document');
|
626 |
-
e = SERVER_ABORT;
|
627 |
-
}
|
628 |
-
if (e === CLIENT_TIMEOUT_ABORT && xhr) {
|
629 |
-
xhr.abort('timeout');
|
630 |
-
deferred.reject(xhr, 'timeout');
|
631 |
-
return;
|
632 |
-
}
|
633 |
-
else if (e == SERVER_ABORT && xhr) {
|
634 |
-
xhr.abort('server abort');
|
635 |
-
deferred.reject(xhr, 'error', 'server abort');
|
636 |
-
return;
|
637 |
-
}
|
638 |
-
|
639 |
-
if (!doc || doc.location.href == s.iframeSrc) {
|
640 |
-
// response not received yet
|
641 |
-
if (!timedOut) {
|
642 |
-
return;
|
643 |
-
}
|
644 |
-
}
|
645 |
-
if (io.detachEvent) {
|
646 |
-
io.detachEvent('onload', cb);
|
647 |
-
}
|
648 |
-
else {
|
649 |
-
io.removeEventListener('load', cb, false);
|
650 |
-
}
|
651 |
-
|
652 |
-
var status = 'success', errMsg;
|
653 |
-
try {
|
654 |
-
if (timedOut) {
|
655 |
-
throw 'timeout';
|
656 |
-
}
|
657 |
-
|
658 |
-
var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
|
659 |
-
log('isXml='+isXml);
|
660 |
-
if (!isXml && window.opera && (doc.body === null || !doc.body.innerHTML)) {
|
661 |
-
if (--domCheckCount) {
|
662 |
-
// in some browsers (Opera) the iframe DOM is not always traversable when
|
663 |
-
// the onload callback fires, so we loop a bit to accommodate
|
664 |
-
log('requeing onLoad callback, DOM not available');
|
665 |
-
setTimeout(cb, 250);
|
666 |
-
return;
|
667 |
-
}
|
668 |
-
// let this fall through because server response could be an empty document
|
669 |
-
//log('Could not access iframe DOM after mutiple tries.');
|
670 |
-
//throw 'DOMException: not available';
|
671 |
-
}
|
672 |
-
|
673 |
-
//log('response detected');
|
674 |
-
var docRoot = doc.body ? doc.body : doc.documentElement;
|
675 |
-
xhr.responseText = docRoot ? docRoot.innerHTML : null;
|
676 |
-
xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
|
677 |
-
if (isXml) {
|
678 |
-
s.dataType = 'xml';
|
679 |
-
}
|
680 |
-
xhr.getResponseHeader = function(header){
|
681 |
-
var headers = {'content-type': s.dataType};
|
682 |
-
return headers[header.toLowerCase()];
|
683 |
-
};
|
684 |
-
// support for XHR 'status' & 'statusText' emulation :
|
685 |
-
if (docRoot) {
|
686 |
-
xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;
|
687 |
-
xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
|
688 |
-
}
|
689 |
-
|
690 |
-
var dt = (s.dataType || '').toLowerCase();
|
691 |
-
var scr = /(json|script|text)/.test(dt);
|
692 |
-
if (scr || s.textarea) {
|
693 |
-
// see if user embedded response in textarea
|
694 |
-
var ta = doc.getElementsByTagName('textarea')[0];
|
695 |
-
if (ta) {
|
696 |
-
xhr.responseText = ta.value;
|
697 |
-
// support for XHR 'status' & 'statusText' emulation :
|
698 |
-
xhr.status = Number( ta.getAttribute('status') ) || xhr.status;
|
699 |
-
xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
|
700 |
-
}
|
701 |
-
else if (scr) {
|
702 |
-
// account for browsers injecting pre around json response
|
703 |
-
var pre = doc.getElementsByTagName('pre')[0];
|
704 |
-
var b = doc.getElementsByTagName('body')[0];
|
705 |
-
if (pre) {
|
706 |
-
xhr.responseText = pre.textContent ? pre.textContent : pre.innerText;
|
707 |
-
}
|
708 |
-
else if (b) {
|
709 |
-
xhr.responseText = b.textContent ? b.textContent : b.innerText;
|
710 |
-
}
|
711 |
-
}
|
712 |
-
}
|
713 |
-
else if (dt == 'xml' && !xhr.responseXML && xhr.responseText) {
|
714 |
-
xhr.responseXML = toXml(xhr.responseText);
|
715 |
-
}
|
716 |
-
|
717 |
-
try {
|
718 |
-
data = httpData(xhr, dt, s);
|
719 |
-
}
|
720 |
-
catch (err) {
|
721 |
-
status = 'parsererror';
|
722 |
-
xhr.error = errMsg = (err || status);
|
723 |
-
}
|
724 |
-
}
|
725 |
-
catch (err) {
|
726 |
-
log('error caught: ',err);
|
727 |
-
status = 'error';
|
728 |
-
xhr.error = errMsg = (err || status);
|
729 |
-
}
|
730 |
-
|
731 |
-
if (xhr.aborted) {
|
732 |
-
log('upload aborted');
|
733 |
-
status = null;
|
734 |
-
}
|
735 |
-
|
736 |
-
if (xhr.status) { // we've set xhr.status
|
737 |
-
status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';
|
738 |
-
}
|
739 |
-
|
740 |
-
// ordering of these callbacks/triggers is odd, but that's how $.ajax does it
|
741 |
-
if (status === 'success') {
|
742 |
-
if (s.success) {
|
743 |
-
s.success.call(s.context, data, 'success', xhr);
|
744 |
-
}
|
745 |
-
deferred.resolve(xhr.responseText, 'success', xhr);
|
746 |
-
if (g) {
|
747 |
-
$.event.trigger("ajaxSuccess", [xhr, s]);
|
748 |
-
}
|
749 |
-
}
|
750 |
-
else if (status) {
|
751 |
-
if (errMsg === undefined) {
|
752 |
-
errMsg = xhr.statusText;
|
753 |
-
}
|
754 |
-
if (s.error) {
|
755 |
-
s.error.call(s.context, xhr, status, errMsg);
|
756 |
-
}
|
757 |
-
deferred.reject(xhr, 'error', errMsg);
|
758 |
-
if (g) {
|
759 |
-
$.event.trigger("ajaxError", [xhr, s, errMsg]);
|
760 |
-
}
|
761 |
-
}
|
762 |
-
|
763 |
-
if (g) {
|
764 |
-
$.event.trigger("ajaxComplete", [xhr, s]);
|
765 |
-
}
|
766 |
-
|
767 |
-
if (g && ! --$.active) {
|
768 |
-
$.event.trigger("ajaxStop");
|
769 |
-
}
|
770 |
-
|
771 |
-
if (s.complete) {
|
772 |
-
s.complete.call(s.context, xhr, status);
|
773 |
-
}
|
774 |
-
|
775 |
-
callbackProcessed = true;
|
776 |
-
if (s.timeout) {
|
777 |
-
clearTimeout(timeoutHandle);
|
778 |
-
}
|
779 |
-
|
780 |
-
// clean up
|
781 |
-
setTimeout(function() {
|
782 |
-
if (!s.iframeTarget) {
|
783 |
-
$io.remove();
|
784 |
-
}
|
785 |
-
else { //adding else to clean up existing iframe response.
|
786 |
-
$io.attr('src', s.iframeSrc);
|
787 |
-
}
|
788 |
-
xhr.responseXML = null;
|
789 |
-
}, 100);
|
790 |
-
}
|
791 |
-
|
792 |
-
var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
|
793 |
-
if (window.ActiveXObject) {
|
794 |
-
doc = new ActiveXObject('Microsoft.XMLDOM');
|
795 |
-
doc.async = 'false';
|
796 |
-
doc.loadXML(s);
|
797 |
-
}
|
798 |
-
else {
|
799 |
-
doc = (new DOMParser()).parseFromString(s, 'text/xml');
|
800 |
-
}
|
801 |
-
return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
|
802 |
-
};
|
803 |
-
var parseJSON = $.parseJSON || function(s) {
|
804 |
-
/*jslint evil:true */
|
805 |
-
return window['eval']('(' + s + ')');
|
806 |
-
};
|
807 |
-
|
808 |
-
var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4
|
809 |
-
|
810 |
-
var ct = xhr.getResponseHeader('content-type') || '',
|
811 |
-
xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
|
812 |
-
data = xml ? xhr.responseXML : xhr.responseText;
|
813 |
-
|
814 |
-
if (xml && data.documentElement.nodeName === 'parsererror') {
|
815 |
-
if ($.error) {
|
816 |
-
$.error('parsererror');
|
817 |
-
}
|
818 |
-
}
|
819 |
-
if (s && s.dataFilter) {
|
820 |
-
data = s.dataFilter(data, type);
|
821 |
-
}
|
822 |
-
if (typeof data === 'string') {
|
823 |
-
if (type === 'json' || !type && ct.indexOf('json') >= 0) {
|
824 |
-
data = parseJSON(data);
|
825 |
-
} else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
|
826 |
-
$.globalEval(data);
|
827 |
-
}
|
828 |
-
}
|
829 |
-
return data;
|
830 |
-
};
|
831 |
-
|
832 |
-
return deferred;
|
833 |
-
}
|
834 |
-
};
|
835 |
-
|
836 |
-
/**
|
837 |
-
* ajaxForm() provides a mechanism for fully automating form submission.
|
838 |
-
*
|
839 |
-
* The advantages of using this method instead of ajaxSubmit() are:
|
840 |
-
*
|
841 |
-
* 1: This method will include coordinates for <input type="image" /> elements (if the element
|
842 |
-
* is used to submit the form).
|
843 |
-
* 2. This method will include the submit element's name/value data (for the element that was
|
844 |
-
* used to submit the form).
|
845 |
-
* 3. This method binds the submit() method to the form for you.
|
846 |
-
*
|
847 |
-
* The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely
|
848 |
-
* passes the options argument along after properly binding events for submit elements and
|
849 |
-
* the form itself.
|
850 |
-
*/
|
851 |
-
$.fn.ajaxForm = function(options) {
|
852 |
-
options = options || {};
|
853 |
-
options.delegation = options.delegation && $.isFunction($.fn.on);
|
854 |
-
|
855 |
-
// in jQuery 1.3+ we can fix mistakes with the ready state
|
856 |
-
if (!options.delegation && this.length === 0) {
|
857 |
-
var o = { s: this.selector, c: this.context };
|
858 |
-
if (!$.isReady && o.s) {
|
859 |
-
log('DOM not ready, queuing ajaxForm');
|
860 |
-
$(function() {
|
861 |
-
$(o.s,o.c).ajaxForm(options);
|
862 |
-
});
|
863 |
-
return this;
|
864 |
-
}
|
865 |
-
// is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
|
866 |
-
log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
|
867 |
-
return this;
|
868 |
-
}
|
869 |
-
|
870 |
-
if ( options.delegation ) {
|
871 |
-
$(document)
|
872 |
-
.off('submit.form-plugin', this.selector, doAjaxSubmit)
|
873 |
-
.off('click.form-plugin', this.selector, captureSubmittingElement)
|
874 |
-
.on('submit.form-plugin', this.selector, options, doAjaxSubmit)
|
875 |
-
.on('click.form-plugin', this.selector, options, captureSubmittingElement);
|
876 |
-
return this;
|
877 |
-
}
|
878 |
-
|
879 |
-
return this.ajaxFormUnbind()
|
880 |
-
.bind('submit.form-plugin', options, doAjaxSubmit)
|
881 |
-
.bind('click.form-plugin', options, captureSubmittingElement);
|
882 |
-
};
|
883 |
-
|
884 |
-
// private event handlers
|
885 |
-
function doAjaxSubmit(e) {
|
886 |
-
/*jshint validthis:true */
|
887 |
-
var options = e.data;
|
888 |
-
if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
|
889 |
-
e.preventDefault();
|
890 |
-
$(e.target).ajaxSubmit(options); // #365
|
891 |
-
}
|
892 |
-
}
|
893 |
-
|
894 |
-
function captureSubmittingElement(e) {
|
895 |
-
/*jshint validthis:true */
|
896 |
-
var target = e.target;
|
897 |
-
var $el = $(target);
|
898 |
-
if (!($el.is("[type=submit],[type=image]"))) {
|
899 |
-
// is this a child element of the submit el? (ex: a span within a button)
|
900 |
-
var t = $el.closest('[type=submit]');
|
901 |
-
if (t.length === 0) {
|
902 |
-
return;
|
903 |
-
}
|
904 |
-
target = t[0];
|
905 |
-
}
|
906 |
-
var form = this;
|
907 |
-
form.clk = target;
|
908 |
-
if (target.type == 'image') {
|
909 |
-
if (e.offsetX !== undefined) {
|
910 |
-
form.clk_x = e.offsetX;
|
911 |
-
form.clk_y = e.offsetY;
|
912 |
-
} else if (typeof $.fn.offset == 'function') {
|
913 |
-
var offset = $el.offset();
|
914 |
-
form.clk_x = e.pageX - offset.left;
|
915 |
-
form.clk_y = e.pageY - offset.top;
|
916 |
-
} else {
|
917 |
-
form.clk_x = e.pageX - target.offsetLeft;
|
918 |
-
form.clk_y = e.pageY - target.offsetTop;
|
919 |
-
}
|
920 |
-
}
|
921 |
-
// clear form vars
|
922 |
-
setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
|
923 |
-
}
|
924 |
-
|
925 |
-
|
926 |
-
// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
|
927 |
-
$.fn.ajaxFormUnbind = function() {
|
928 |
-
return this.unbind('submit.form-plugin click.form-plugin');
|
929 |
-
};
|
930 |
-
|
931 |
-
/**
|
932 |
-
* formToArray() gathers form element data into an array of objects that can
|
933 |
-
* be passed to any of the following ajax functions: $.get, $.post, or load.
|
934 |
-
* Each object in the array has both a 'name' and 'value' property. An example of
|
935 |
-
* an array for a simple login form might be:
|
936 |
-
*
|
937 |
-
* [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
|
938 |
-
*
|
939 |
-
* It is this array that is passed to pre-submit callback functions provided to the
|
940 |
-
* ajaxSubmit() and ajaxForm() methods.
|
941 |
-
*/
|
942 |
-
$.fn.formToArray = function(semantic, elements) {
|
943 |
-
var a = [];
|
944 |
-
if (this.length === 0) {
|
945 |
-
return a;
|
946 |
-
}
|
947 |
-
|
948 |
-
var form = this[0];
|
949 |
-
var formId = this.attr('id');
|
950 |
-
var els = semantic ? form.getElementsByTagName('*') : form.elements;
|
951 |
-
var els2;
|
952 |
-
|
953 |
-
if (els && !/MSIE [678]/.test(navigator.userAgent)) { // #390
|
954 |
-
els = $(els).get(); // convert to standard array
|
955 |
-
}
|
956 |
-
|
957 |
-
// #386; account for inputs outside the form which use the 'form' attribute
|
958 |
-
if ( formId ) {
|
959 |
-
els2 = $(':input[form="' + formId + '"]').get(); // hat tip @thet
|
960 |
-
if ( els2.length ) {
|
961 |
-
els = (els || []).concat(els2);
|
962 |
-
}
|
963 |
-
}
|
964 |
-
|
965 |
-
if (!els || !els.length) {
|
966 |
-
return a;
|
967 |
-
}
|
968 |
-
|
969 |
-
var i,j,n,v,el,max,jmax;
|
970 |
-
for(i=0, max=els.length; i < max; i++) {
|
971 |
-
el = els[i];
|
972 |
-
n = el.name;
|
973 |
-
if (!n || el.disabled) {
|
974 |
-
continue;
|
975 |
-
}
|
976 |
-
|
977 |
-
if (semantic && form.clk && el.type == "image") {
|
978 |
-
// handle image inputs on the fly when semantic == true
|
979 |
-
if(form.clk == el) {
|
980 |
-
a.push({name: n, value: $(el).val(), type: el.type });
|
981 |
-
a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
|
982 |
-
}
|
983 |
-
continue;
|
984 |
-
}
|
985 |
-
|
986 |
-
v = $.fieldValue(el, true);
|
987 |
-
if (v && v.constructor == Array) {
|
988 |
-
if (elements) {
|
989 |
-
elements.push(el);
|
990 |
-
}
|
991 |
-
for(j=0, jmax=v.length; j < jmax; j++) {
|
992 |
-
a.push({name: n, value: v[j]});
|
993 |
-
}
|
994 |
-
}
|
995 |
-
else if (feature.fileapi && el.type == 'file') {
|
996 |
-
if (elements) {
|
997 |
-
elements.push(el);
|
998 |
-
}
|
999 |
-
var files = el.files;
|
1000 |
-
if (files.length) {
|
1001 |
-
for (j=0; j < files.length; j++) {
|
1002 |
-
a.push({name: n, value: files[j], type: el.type});
|
1003 |
-
}
|
1004 |
-
}
|
1005 |
-
else {
|
1006 |
-
// #180
|
1007 |
-
a.push({ name: n, value: '', type: el.type });
|
1008 |
-
}
|
1009 |
-
}
|
1010 |
-
else if (v !== null && typeof v != 'undefined') {
|
1011 |
-
if (elements) {
|
1012 |
-
elements.push(el);
|
1013 |
-
}
|
1014 |
-
a.push({name: n, value: v, type: el.type, required: el.required});
|
1015 |
-
}
|
1016 |
-
}
|
1017 |
-
|
1018 |
-
if (!semantic && form.clk) {
|
1019 |
-
// input type=='image' are not found in elements array! handle it here
|
1020 |
-
var $input = $(form.clk), input = $input[0];
|
1021 |
-
n = input.name;
|
1022 |
-
if (n && !input.disabled && input.type == 'image') {
|
1023 |
-
a.push({name: n, value: $input.val()});
|
1024 |
-
a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
|
1025 |
-
}
|
1026 |
-
}
|
1027 |
-
return a;
|
1028 |
-
};
|
1029 |
-
|
1030 |
-
/**
|
1031 |
-
* Serializes form data into a 'submittable' string. This method will return a string
|
1032 |
-
* in the format: name1=value1&name2=value2
|
1033 |
-
*/
|
1034 |
-
$.fn.formSerialize = function(semantic) {
|
1035 |
-
//hand off to jQuery.param for proper encoding
|
1036 |
-
return $.param(this.formToArray(semantic));
|
1037 |
-
};
|
1038 |
-
|
1039 |
-
/**
|
1040 |
-
* Serializes all field elements in the jQuery object into a query string.
|
1041 |
-
* This method will return a string in the format: name1=value1&name2=value2
|
1042 |
-
*/
|
1043 |
-
$.fn.fieldSerialize = function(successful) {
|
1044 |
-
var a = [];
|
1045 |
-
this.each(function() {
|
1046 |
-
var n = this.name;
|
1047 |
-
if (!n) {
|
1048 |
-
return;
|
1049 |
-
}
|
1050 |
-
var v = $.fieldValue(this, successful);
|
1051 |
-
if (v && v.constructor == Array) {
|
1052 |
-
for (var i=0,max=v.length; i < max; i++) {
|
1053 |
-
a.push({name: n, value: v[i]});
|
1054 |
-
}
|
1055 |
-
}
|
1056 |
-
else if (v !== null && typeof v != 'undefined') {
|
1057 |
-
a.push({name: this.name, value: v});
|
1058 |
-
}
|
1059 |
-
});
|
1060 |
-
//hand off to jQuery.param for proper encoding
|
1061 |
-
return $.param(a);
|
1062 |
-
};
|
1063 |
-
|
1064 |
-
/**
|
1065 |
-
* Returns the value(s) of the element in the matched set. For example, consider the following form:
|
1066 |
-
*
|
1067 |
-
* <form><fieldset>
|
1068 |
-
* <input name="A" type="text" />
|
1069 |
-
* <input name="A" type="text" />
|
1070 |
-
* <input name="B" type="checkbox" value="B1" />
|
1071 |
-
* <input name="B" type="checkbox" value="B2"/>
|
1072 |
-
* <input name="C" type="radio" value="C1" />
|
1073 |
-
* <input name="C" type="radio" value="C2" />
|
1074 |
-
* </fieldset></form>
|
1075 |
-
*
|
1076 |
-
* var v = $('input[type=text]').fieldValue();
|
1077 |
-
* // if no values are entered into the text inputs
|
1078 |
-
* v == ['','']
|
1079 |
-
* // if values entered into the text inputs are 'foo' and 'bar'
|
1080 |
-
* v == ['foo','bar']
|
1081 |
-
*
|
1082 |
-
* var v = $('input[type=checkbox]').fieldValue();
|
1083 |
-
* // if neither checkbox is checked
|
1084 |
-
* v === undefined
|
1085 |
-
* // if both checkboxes are checked
|
1086 |
-
* v == ['B1', 'B2']
|
1087 |
-
*
|
1088 |
-
* var v = $('input[type=radio]').fieldValue();
|
1089 |
-
* // if neither radio is checked
|
1090 |
-
* v === undefined
|
1091 |
-
* // if first radio is checked
|
1092 |
-
* v == ['C1']
|
1093 |
-
*
|
1094 |
-
* The successful argument controls whether or not the field element must be 'successful'
|
1095 |
-
* (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
|
1096 |
-
* The default value of the successful argument is true. If this value is false the value(s)
|
1097 |
-
* for each element is returned.
|
1098 |
-
*
|
1099 |
-
* Note: This method *always* returns an array. If no valid value can be determined the
|
1100 |
-
* array will be empty, otherwise it will contain one or more values.
|
1101 |
-
*/
|
1102 |
-
$.fn.fieldValue = function(successful) {
|
1103 |
-
for (var val=[], i=0, max=this.length; i < max; i++) {
|
1104 |
-
var el = this[i];
|
1105 |
-
var v = $.fieldValue(el, successful);
|
1106 |
-
if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
|
1107 |
-
continue;
|
1108 |
-
}
|
1109 |
-
if (v.constructor == Array) {
|
1110 |
-
$.merge(val, v);
|
1111 |
-
}
|
1112 |
-
else {
|
1113 |
-
val.push(v);
|
1114 |
-
}
|
1115 |
-
}
|
1116 |
-
return val;
|
1117 |
-
};
|
1118 |
-
|
1119 |
-
/**
|
1120 |
-
* Returns the value of the field element.
|
1121 |
-
*/
|
1122 |
-
$.fieldValue = function(el, successful) {
|
1123 |
-
var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
|
1124 |
-
if (successful === undefined) {
|
1125 |
-
successful = true;
|
1126 |
-
}
|
1127 |
-
|
1128 |
-
if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
|
1129 |
-
(t == 'checkbox' || t == 'radio') && !el.checked ||
|
1130 |
-
(t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
|
1131 |
-
tag == 'select' && el.selectedIndex == -1)) {
|
1132 |
-
return null;
|
1133 |
-
}
|
1134 |
-
|
1135 |
-
if (tag == 'select') {
|
1136 |
-
var index = el.selectedIndex;
|
1137 |
-
if (index < 0) {
|
1138 |
-
return null;
|
1139 |
-
}
|
1140 |
-
var a = [], ops = el.options;
|
1141 |
-
var one = (t == 'select-one');
|
1142 |
-
var max = (one ? index+1 : ops.length);
|
1143 |
-
for(var i=(one ? index : 0); i < max; i++) {
|
1144 |
-
var op = ops[i];
|
1145 |
-
if (op.selected) {
|
1146 |
-
var v = op.value;
|
1147 |
-
if (!v) { // extra pain for IE...
|
1148 |
-
v = (op.attributes && op.attributes.value && !(op.attributes.value.specified)) ? op.text : op.value;
|
1149 |
-
}
|
1150 |
-
if (one) {
|
1151 |
-
return v;
|
1152 |
-
}
|
1153 |
-
a.push(v);
|
1154 |
-
}
|
1155 |
-
}
|
1156 |
-
return a;
|
1157 |
-
}
|
1158 |
-
return $(el).val();
|
1159 |
-
};
|
1160 |
-
|
1161 |
-
/**
|
1162 |
-
* Clears the form data. Takes the following actions on the form's input fields:
|
1163 |
-
* - input text fields will have their 'value' property set to the empty string
|
1164 |
-
* - select elements will have their 'selectedIndex' property set to -1
|
1165 |
-
* - checkbox and radio inputs will have their 'checked' property set to false
|
1166 |
-
* - inputs of type submit, button, reset, and hidden will *not* be effected
|
1167 |
-
* - button elements will *not* be effected
|
1168 |
-
*/
|
1169 |
-
$.fn.clearForm = function(includeHidden) {
|
1170 |
-
return this.each(function() {
|
1171 |
-
$('input,select,textarea', this).clearFields(includeHidden);
|
1172 |
-
});
|
1173 |
-
};
|
1174 |
-
|
1175 |
-
/**
|
1176 |
-
* Clears the selected form elements.
|
1177 |
-
*/
|
1178 |
-
$.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
|
1179 |
-
var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list
|
1180 |
-
return this.each(function() {
|
1181 |
-
var t = this.type, tag = this.tagName.toLowerCase();
|
1182 |
-
if (re.test(t) || tag == 'textarea') {
|
1183 |
-
this.value = '';
|
1184 |
-
}
|
1185 |
-
else if (t == 'checkbox' || t == 'radio') {
|
1186 |
-
this.checked = false;
|
1187 |
-
}
|
1188 |
-
else if (tag == 'select') {
|
1189 |
-
this.selectedIndex = -1;
|
1190 |
-
}
|
1191 |
-
else if (t == "file") {
|
1192 |
-
if (/MSIE/.test(navigator.userAgent)) {
|
1193 |
-
$(this).replaceWith($(this).clone(true));
|
1194 |
-
} else {
|
1195 |
-
$(this).val('');
|
1196 |
-
}
|
1197 |
-
}
|
1198 |
-
else if (includeHidden) {
|
1199 |
-
// includeHidden can be the value true, or it can be a selector string
|
1200 |
-
// indicating a special test; for example:
|
1201 |
-
// $('#myForm').clearForm('.special:hidden')
|
1202 |
-
// the above would clean hidden inputs that have the class of 'special'
|
1203 |
-
if ( (includeHidden === true && /hidden/.test(t)) ||
|
1204 |
-
(typeof includeHidden == 'string' && $(this).is(includeHidden)) ) {
|
1205 |
-
this.value = '';
|
1206 |
-
}
|
1207 |
-
}
|
1208 |
-
});
|
1209 |
-
};
|
1210 |
-
|
1211 |
-
/**
|
1212 |
-
* Resets the form data. Causes all form elements to be reset to their original value.
|
1213 |
-
*/
|
1214 |
-
$.fn.resetForm = function() {
|
1215 |
-
return this.each(function() {
|
1216 |
-
// guard against an input with the name of 'reset'
|
1217 |
-
// note that IE reports the reset function as an 'object'
|
1218 |
-
if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
|
1219 |
-
this.reset();
|
1220 |
-
}
|
1221 |
-
});
|
1222 |
-
};
|
1223 |
-
|
1224 |
-
/**
|
1225 |
-
* Enables or disables any matching elements.
|
1226 |
-
*/
|
1227 |
-
$.fn.enable = function(b) {
|
1228 |
-
if (b === undefined) {
|
1229 |
-
b = true;
|
1230 |
-
}
|
1231 |
-
return this.each(function() {
|
1232 |
-
this.disabled = !b;
|
1233 |
-
});
|
1234 |
-
};
|
1235 |
-
|
1236 |
-
/**
|
1237 |
-
* Checks/unchecks any matching checkboxes or radio buttons and
|
1238 |
-
* selects/deselects and matching option elements.
|
1239 |
-
*/
|
1240 |
-
$.fn.selected = function(select) {
|
1241 |
-
if (select === undefined) {
|
1242 |
-
select = true;
|
1243 |
-
}
|
1244 |
-
return this.each(function() {
|
1245 |
-
var t = this.type;
|
1246 |
-
if (t == 'checkbox' || t == 'radio') {
|
1247 |
-
this.checked = select;
|
1248 |
-
}
|
1249 |
-
else if (this.tagName.toLowerCase() == 'option') {
|
1250 |
-
var $sel = $(this).parent('select');
|
1251 |
-
if (select && $sel[0] && $sel[0].type == 'select-one') {
|
1252 |
-
// deselect all other options
|
1253 |
-
$sel.find('option').selected(false);
|
1254 |
-
}
|
1255 |
-
this.selected = select;
|
1256 |
-
}
|
1257 |
-
});
|
1258 |
-
};
|
1259 |
-
|
1260 |
-
// expose debug var
|
1261 |
-
$.fn.ajaxSubmit.debug = false;
|
1262 |
-
|
1263 |
-
// helper fn for console logging
|
1264 |
-
function log() {
|
1265 |
-
if (!$.fn.ajaxSubmit.debug) {
|
1266 |
-
return;
|
1267 |
-
}
|
1268 |
-
var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
|
1269 |
-
if (window.console && window.console.log) {
|
1270 |
-
window.console.log(msg);
|
1271 |
-
}
|
1272 |
-
else if (window.opera && window.opera.postError) {
|
1273 |
-
window.opera.postError(msg);
|
1274 |
-
}
|
1275 |
-
}
|
1276 |
-
|
1277 |
-
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/js/jquery.form.min.js
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
/*!
|
2 |
-
* jQuery Form Plugin
|
3 |
-
* version: 3.51.0-2014.06.20
|
4 |
-
* Requires jQuery v1.5 or later
|
5 |
-
* Copyright (c) 2014 M. Alsup
|
6 |
-
* Examples and documentation at: http://malsup.com/jquery/form/
|
7 |
-
* Project repository: https://github.com/malsup/form
|
8 |
-
* Dual licensed under the MIT and GPL licenses.
|
9 |
-
* https://github.com/malsup/form#copyright-and-license
|
10 |
-
*/
|
11 |
-
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e("undefined"!=typeof jQuery?jQuery:window.Zepto)}(function(e){"use strict";function t(t){var r=t.data;t.isDefaultPrevented()||(t.preventDefault(),e(t.target).ajaxSubmit(r))}function r(t){var r=t.target,a=e(r);if(!a.is("[type=submit],[type=image]")){var n=a.closest("[type=submit]");if(0===n.length)return;r=n[0]}var i=this;if(i.clk=r,"image"==r.type)if(void 0!==t.offsetX)i.clk_x=t.offsetX,i.clk_y=t.offsetY;else if("function"==typeof e.fn.offset){var o=a.offset();i.clk_x=t.pageX-o.left,i.clk_y=t.pageY-o.top}else i.clk_x=t.pageX-r.offsetLeft,i.clk_y=t.pageY-r.offsetTop;setTimeout(function(){i.clk=i.clk_x=i.clk_y=null},100)}function a(){if(e.fn.ajaxSubmit.debug){var t="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(t):window.opera&&window.opera.postError&&window.opera.postError(t)}}var n={};n.fileapi=void 0!==e("<input type='file'/>").get(0).files,n.formdata=void 0!==window.FormData;var i=!!e.fn.prop;e.fn.attr2=function(){if(!i)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},e.fn.ajaxSubmit=function(t){function r(r){var a,n,i=e.param(r,t.traditional).split("&"),o=i.length,s=[];for(a=0;o>a;a++)i[a]=i[a].replace(/\+/g," "),n=i[a].split("="),s.push([decodeURIComponent(n[0]),decodeURIComponent(n[1])]);return s}function o(a){for(var n=new FormData,i=0;i<a.length;i++)n.append(a[i].name,a[i].value);if(t.extraData){var o=r(t.extraData);for(i=0;i<o.length;i++)o[i]&&n.append(o[i][0],o[i][1])}t.data=null;var s=e.extend(!0,{},e.ajaxSettings,t,{contentType:!1,processData:!1,cache:!1,type:u||"POST"});t.uploadProgress&&(s.xhr=function(){var r=e.ajaxSettings.xhr();return r.upload&&r.upload.addEventListener("progress",function(e){var r=0,a=e.loaded||e.position,n=e.total;e.lengthComputable&&(r=Math.ceil(a/n*100)),t.uploadProgress(e,a,n,r)},!1),r}),s.data=null;var c=s.beforeSend;return s.beforeSend=function(e,r){r.data=t.formData?t.formData:n,c&&c.call(this,e,r)},e.ajax(s)}function s(r){function n(e){var t=null;try{e.contentWindow&&(t=e.contentWindow.document)}catch(r){a("cannot get iframe.contentWindow document: "+r)}if(t)return t;try{t=e.contentDocument?e.contentDocument:e.document}catch(r){a("cannot get iframe.contentDocument: "+r),t=e.document}return t}function o(){function t(){try{var e=n(g).readyState;a("state = "+e),e&&"uninitialized"==e.toLowerCase()&&setTimeout(t,50)}catch(r){a("Server abort: ",r," (",r.name,")"),s(k),j&&clearTimeout(j),j=void 0}}var r=f.attr2("target"),i=f.attr2("action"),o="multipart/form-data",c=f.attr("enctype")||f.attr("encoding")||o;w.setAttribute("target",p),(!u||/post/i.test(u))&&w.setAttribute("method","POST"),i!=m.url&&w.setAttribute("action",m.url),m.skipEncodingOverride||u&&!/post/i.test(u)||f.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),m.timeout&&(j=setTimeout(function(){T=!0,s(D)},m.timeout));var l=[];try{if(m.extraData)for(var d in m.extraData)m.extraData.hasOwnProperty(d)&&l.push(e.isPlainObject(m.extraData[d])&&m.extraData[d].hasOwnProperty("name")&&m.extraData[d].hasOwnProperty("value")?e('<input type="hidden" name="'+m.extraData[d].name+'">').val(m.extraData[d].value).appendTo(w)[0]:e('<input type="hidden" name="'+d+'">').val(m.extraData[d]).appendTo(w)[0]);m.iframeTarget||v.appendTo("body"),g.attachEvent?g.attachEvent("onload",s):g.addEventListener("load",s,!1),setTimeout(t,15);try{w.submit()}catch(h){var x=document.createElement("form").submit;x.apply(w)}}finally{w.setAttribute("action",i),w.setAttribute("enctype",c),r?w.setAttribute("target",r):f.removeAttr("target"),e(l).remove()}}function s(t){if(!x.aborted&&!F){if(M=n(g),M||(a("cannot access response document"),t=k),t===D&&x)return x.abort("timeout"),void S.reject(x,"timeout");if(t==k&&x)return x.abort("server abort"),void S.reject(x,"error","server abort");if(M&&M.location.href!=m.iframeSrc||T){g.detachEvent?g.detachEvent("onload",s):g.removeEventListener("load",s,!1);var r,i="success";try{if(T)throw"timeout";var o="xml"==m.dataType||M.XMLDocument||e.isXMLDoc(M);if(a("isXml="+o),!o&&window.opera&&(null===M.body||!M.body.innerHTML)&&--O)return a("requeing onLoad callback, DOM not available"),void setTimeout(s,250);var u=M.body?M.body:M.documentElement;x.responseText=u?u.innerHTML:null,x.responseXML=M.XMLDocument?M.XMLDocument:M,o&&(m.dataType="xml"),x.getResponseHeader=function(e){var t={"content-type":m.dataType};return t[e.toLowerCase()]},u&&(x.status=Number(u.getAttribute("status"))||x.status,x.statusText=u.getAttribute("statusText")||x.statusText);var c=(m.dataType||"").toLowerCase(),l=/(json|script|text)/.test(c);if(l||m.textarea){var f=M.getElementsByTagName("textarea")[0];if(f)x.responseText=f.value,x.status=Number(f.getAttribute("status"))||x.status,x.statusText=f.getAttribute("statusText")||x.statusText;else if(l){var p=M.getElementsByTagName("pre")[0],h=M.getElementsByTagName("body")[0];p?x.responseText=p.textContent?p.textContent:p.innerText:h&&(x.responseText=h.textContent?h.textContent:h.innerText)}}else"xml"==c&&!x.responseXML&&x.responseText&&(x.responseXML=X(x.responseText));try{E=_(x,c,m)}catch(y){i="parsererror",x.error=r=y||i}}catch(y){a("error caught: ",y),i="error",x.error=r=y||i}x.aborted&&(a("upload aborted"),i=null),x.status&&(i=x.status>=200&&x.status<300||304===x.status?"success":"error"),"success"===i?(m.success&&m.success.call(m.context,E,"success",x),S.resolve(x.responseText,"success",x),d&&e.event.trigger("ajaxSuccess",[x,m])):i&&(void 0===r&&(r=x.statusText),m.error&&m.error.call(m.context,x,i,r),S.reject(x,"error",r),d&&e.event.trigger("ajaxError",[x,m,r])),d&&e.event.trigger("ajaxComplete",[x,m]),d&&!--e.active&&e.event.trigger("ajaxStop"),m.complete&&m.complete.call(m.context,x,i),F=!0,m.timeout&&clearTimeout(j),setTimeout(function(){m.iframeTarget?v.attr("src",m.iframeSrc):v.remove(),x.responseXML=null},100)}}}var c,l,m,d,p,v,g,x,y,b,T,j,w=f[0],S=e.Deferred();if(S.abort=function(e){x.abort(e)},r)for(l=0;l<h.length;l++)c=e(h[l]),i?c.prop("disabled",!1):c.removeAttr("disabled");if(m=e.extend(!0,{},e.ajaxSettings,t),m.context=m.context||m,p="jqFormIO"+(new Date).getTime(),m.iframeTarget?(v=e(m.iframeTarget),b=v.attr2("name"),b?p=b:v.attr2("name",p)):(v=e('<iframe name="'+p+'" src="'+m.iframeSrc+'" />'),v.css({position:"absolute",top:"-1000px",left:"-1000px"})),g=v[0],x={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var r="timeout"===t?"timeout":"aborted";a("aborting upload... "+r),this.aborted=1;try{g.contentWindow.document.execCommand&&g.contentWindow.document.execCommand("Stop")}catch(n){}v.attr("src",m.iframeSrc),x.error=r,m.error&&m.error.call(m.context,x,r,t),d&&e.event.trigger("ajaxError",[x,m,r]),m.complete&&m.complete.call(m.context,x,r)}},d=m.global,d&&0===e.active++&&e.event.trigger("ajaxStart"),d&&e.event.trigger("ajaxSend",[x,m]),m.beforeSend&&m.beforeSend.call(m.context,x,m)===!1)return m.global&&e.active--,S.reject(),S;if(x.aborted)return S.reject(),S;y=w.clk,y&&(b=y.name,b&&!y.disabled&&(m.extraData=m.extraData||{},m.extraData[b]=y.value,"image"==y.type&&(m.extraData[b+".x"]=w.clk_x,m.extraData[b+".y"]=w.clk_y)));var D=1,k=2,A=e("meta[name=csrf-token]").attr("content"),L=e("meta[name=csrf-param]").attr("content");L&&A&&(m.extraData=m.extraData||{},m.extraData[L]=A),m.forceSync?o():setTimeout(o,10);var E,M,F,O=50,X=e.parseXML||function(e,t){return window.ActiveXObject?(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!=t.documentElement.nodeName?t:null},C=e.parseJSON||function(e){return window.eval("("+e+")")},_=function(t,r,a){var n=t.getResponseHeader("content-type")||"",i="xml"===r||!r&&n.indexOf("xml")>=0,o=i?t.responseXML:t.responseText;return i&&"parsererror"===o.documentElement.nodeName&&e.error&&e.error("parsererror"),a&&a.dataFilter&&(o=a.dataFilter(o,r)),"string"==typeof o&&("json"===r||!r&&n.indexOf("json")>=0?o=C(o):("script"===r||!r&&n.indexOf("javascript")>=0)&&e.globalEval(o)),o};return S}if(!this.length)return a("ajaxSubmit: skipping submit process - no element selected"),this;var u,c,l,f=this;"function"==typeof t?t={success:t}:void 0===t&&(t={}),u=t.type||this.attr2("method"),c=t.url||this.attr2("action"),l="string"==typeof c?e.trim(c):"",l=l||window.location.href||"",l&&(l=(l.match(/^([^#]+)/)||[])[1]),t=e.extend(!0,{url:l,success:e.ajaxSettings.success,type:u||e.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var m={};if(this.trigger("form-pre-serialize",[this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(t.beforeSerialize&&t.beforeSerialize(this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var d=t.traditional;void 0===d&&(d=e.ajaxSettings.traditional);var p,h=[],v=this.formToArray(t.semantic,h);if(t.data&&(t.extraData=t.data,p=e.param(t.data,d)),t.beforeSubmit&&t.beforeSubmit(v,this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[v,this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var g=e.param(v,d);p&&(g=g?g+"&"+p:p),"GET"==t.type.toUpperCase()?(t.url+=(t.url.indexOf("?")>=0?"&":"?")+g,t.data=null):t.data=g;var x=[];if(t.resetForm&&x.push(function(){f.resetForm()}),t.clearForm&&x.push(function(){f.clearForm(t.includeHidden)}),!t.dataType&&t.target){var y=t.success||function(){};x.push(function(r){var a=t.replaceTarget?"replaceWith":"html";e(t.target)[a](r).each(y,arguments)})}else t.success&&x.push(t.success);if(t.success=function(e,r,a){for(var n=t.context||this,i=0,o=x.length;o>i;i++)x[i].apply(n,[e,r,a||f,f])},t.error){var b=t.error;t.error=function(e,r,a){var n=t.context||this;b.apply(n,[e,r,a,f])}}if(t.complete){var T=t.complete;t.complete=function(e,r){var a=t.context||this;T.apply(a,[e,r,f])}}var j=e("input[type=file]:enabled",this).filter(function(){return""!==e(this).val()}),w=j.length>0,S="multipart/form-data",D=f.attr("enctype")==S||f.attr("encoding")==S,k=n.fileapi&&n.formdata;a("fileAPI :"+k);var A,L=(w||D)&&!k;t.iframe!==!1&&(t.iframe||L)?t.closeKeepAlive?e.get(t.closeKeepAlive,function(){A=s(v)}):A=s(v):A=(w||D)&&k?o(v):e.ajax(t),f.removeData("jqxhr").data("jqxhr",A);for(var E=0;E<h.length;E++)h[E]=null;return this.trigger("form-submit-notify",[this,t]),this},e.fn.ajaxForm=function(n){if(n=n||{},n.delegation=n.delegation&&e.isFunction(e.fn.on),!n.delegation&&0===this.length){var i={s:this.selector,c:this.context};return!e.isReady&&i.s?(a("DOM not ready, queuing ajaxForm"),e(function(){e(i.s,i.c).ajaxForm(n)}),this):(a("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)")),this)}return n.delegation?(e(document).off("submit.form-plugin",this.selector,t).off("click.form-plugin",this.selector,r).on("submit.form-plugin",this.selector,n,t).on("click.form-plugin",this.selector,n,r),this):this.ajaxFormUnbind().bind("submit.form-plugin",n,t).bind("click.form-plugin",n,r)},e.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")},e.fn.formToArray=function(t,r){var a=[];if(0===this.length)return a;var i,o=this[0],s=this.attr("id"),u=t?o.getElementsByTagName("*"):o.elements;if(u&&!/MSIE [678]/.test(navigator.userAgent)&&(u=e(u).get()),s&&(i=e(':input[form="'+s+'"]').get(),i.length&&(u=(u||[]).concat(i))),!u||!u.length)return a;var c,l,f,m,d,p,h;for(c=0,p=u.length;p>c;c++)if(d=u[c],f=d.name,f&&!d.disabled)if(t&&o.clk&&"image"==d.type)o.clk==d&&(a.push({name:f,value:e(d).val(),type:d.type}),a.push({name:f+".x",value:o.clk_x},{name:f+".y",value:o.clk_y}));else if(m=e.fieldValue(d,!0),m&&m.constructor==Array)for(r&&r.push(d),l=0,h=m.length;h>l;l++)a.push({name:f,value:m[l]});else if(n.fileapi&&"file"==d.type){r&&r.push(d);var v=d.files;if(v.length)for(l=0;l<v.length;l++)a.push({name:f,value:v[l],type:d.type});else a.push({name:f,value:"",type:d.type})}else null!==m&&"undefined"!=typeof m&&(r&&r.push(d),a.push({name:f,value:m,type:d.type,required:d.required}));if(!t&&o.clk){var g=e(o.clk),x=g[0];f=x.name,f&&!x.disabled&&"image"==x.type&&(a.push({name:f,value:g.val()}),a.push({name:f+".x",value:o.clk_x},{name:f+".y",value:o.clk_y}))}return a},e.fn.formSerialize=function(t){return e.param(this.formToArray(t))},e.fn.fieldSerialize=function(t){var r=[];return this.each(function(){var a=this.name;if(a){var n=e.fieldValue(this,t);if(n&&n.constructor==Array)for(var i=0,o=n.length;o>i;i++)r.push({name:a,value:n[i]});else null!==n&&"undefined"!=typeof n&&r.push({name:this.name,value:n})}}),e.param(r)},e.fn.fieldValue=function(t){for(var r=[],a=0,n=this.length;n>a;a++){var i=this[a],o=e.fieldValue(i,t);null===o||"undefined"==typeof o||o.constructor==Array&&!o.length||(o.constructor==Array?e.merge(r,o):r.push(o))}return r},e.fieldValue=function(t,r){var a=t.name,n=t.type,i=t.tagName.toLowerCase();if(void 0===r&&(r=!0),r&&(!a||t.disabled||"reset"==n||"button"==n||("checkbox"==n||"radio"==n)&&!t.checked||("submit"==n||"image"==n)&&t.form&&t.form.clk!=t||"select"==i&&-1==t.selectedIndex))return null;if("select"==i){var o=t.selectedIndex;if(0>o)return null;for(var s=[],u=t.options,c="select-one"==n,l=c?o+1:u.length,f=c?o:0;l>f;f++){var m=u[f];if(m.selected){var d=m.value;if(d||(d=m.attributes&&m.attributes.value&&!m.attributes.value.specified?m.text:m.value),c)return d;s.push(d)}}return s}return e(t).val()},e.fn.clearForm=function(t){return this.each(function(){e("input,select,textarea",this).clearFields(t)})},e.fn.clearFields=e.fn.clearInputs=function(t){var r=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var a=this.type,n=this.tagName.toLowerCase();r.test(a)||"textarea"==n?this.value="":"checkbox"==a||"radio"==a?this.checked=!1:"select"==n?this.selectedIndex=-1:"file"==a?/MSIE/.test(navigator.userAgent)?e(this).replaceWith(e(this).clone(!0)):e(this).val(""):t&&(t===!0&&/hidden/.test(a)||"string"==typeof t&&e(this).is(t))&&(this.value="")})},e.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},e.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},e.fn.selected=function(t){return void 0===t&&(t=!0),this.each(function(){var r=this.type;if("checkbox"==r||"radio"==r)this.checked=t;else if("option"==this.tagName.toLowerCase()){var a=e(this).parent("select");t&&a[0]&&"select-one"==a[0].type&&a.find("option").selected(!1),this.selected=t}})},e.fn.ajaxSubmit.debug=!1});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/js/scripts.js
CHANGED
@@ -2,488 +2,461 @@
|
|
2 |
|
3 |
'use strict';
|
4 |
|
5 |
-
if ( typeof
|
6 |
return;
|
7 |
}
|
8 |
|
9 |
-
|
10 |
cached: 0,
|
11 |
inputs: []
|
12 |
-
},
|
13 |
-
|
14 |
-
$.fn.wpcf7InitForm = function() {
|
15 |
-
this.ajaxForm( {
|
16 |
-
beforeSubmit: function( arr, $form, options ) {
|
17 |
-
$form.wpcf7ClearResponseOutput();
|
18 |
-
$form.find( '[aria-invalid]' ).attr( 'aria-invalid', 'false' );
|
19 |
-
$form.find( '.ajax-loader' ).addClass( 'is-active' );
|
20 |
-
return true;
|
21 |
-
},
|
22 |
-
beforeSerialize: function( $form, options ) {
|
23 |
-
$form.find( '[placeholder].placeheld' ).each( function( i, n ) {
|
24 |
-
$( n ).val( '' );
|
25 |
-
} );
|
26 |
-
return true;
|
27 |
-
},
|
28 |
-
data: { '_wpcf7_is_ajax_call': 1 },
|
29 |
-
dataType: 'json',
|
30 |
-
success: $.wpcf7AjaxSuccess,
|
31 |
-
error: function( xhr, status, error, $form ) {
|
32 |
-
var e = $( '<div class="ajax-error"></div>' ).text( error.message );
|
33 |
-
$form.after( e );
|
34 |
-
}
|
35 |
-
} );
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
40 |
|
41 |
-
|
42 |
|
43 |
-
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
48 |
|
49 |
-
|
|
|
50 |
|
51 |
-
|
|
|
52 |
|
53 |
-
|
|
|
|
|
|
|
54 |
|
55 |
-
|
56 |
-
|
57 |
-
$( this ).datepicker( {
|
58 |
-
dateFormat: 'yy-mm-dd',
|
59 |
-
minDate: new Date( $( this ).attr( 'min' ) ),
|
60 |
-
maxDate: new Date( $( this ).attr( 'max' ) )
|
61 |
-
} );
|
62 |
} );
|
63 |
-
}
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
} );
|
72 |
} );
|
73 |
-
}
|
74 |
|
75 |
-
|
|
|
|
|
|
|
|
|
76 |
|
77 |
-
|
78 |
-
$(
|
79 |
-
|
|
|
80 |
|
81 |
-
|
82 |
-
|
|
|
|
|
|
|
83 |
|
84 |
-
|
85 |
-
|
86 |
-
return;
|
87 |
-
}
|
88 |
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
|
91 |
-
|
|
|
|
|
|
|
|
|
92 |
|
93 |
-
|
|
|
|
|
|
|
|
|
94 |
|
95 |
-
|
96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
|
98 |
-
|
99 |
-
|
100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
|
102 |
-
|
103 |
-
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
|
106 |
-
|
107 |
-
|
108 |
-
$
|
109 |
-
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
|
113 |
-
|
114 |
-
|
|
|
|
|
|
|
|
|
115 |
|
116 |
-
|
|
|
117 |
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
$recaptcha.wpcf7NotValidTip( _wpcf7.recaptcha.messages.empty );
|
123 |
-
}
|
124 |
} );
|
125 |
|
126 |
-
$
|
127 |
-
|
128 |
|
129 |
-
|
|
|
|
|
|
|
|
|
130 |
|
131 |
-
|
132 |
-
|
133 |
-
$form.addClass( 'sent' );
|
134 |
|
135 |
-
if (
|
136 |
-
|
137 |
}
|
|
|
|
|
138 |
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
$responseOutput.addClass( 'wpcf7-mail-sent-ng' );
|
143 |
-
$form.addClass( 'failed' );
|
144 |
|
145 |
-
|
146 |
-
|
147 |
|
148 |
-
|
149 |
-
|
150 |
-
}
|
151 |
|
152 |
-
|
|
|
153 |
|
154 |
-
if (
|
155 |
-
|
156 |
}
|
157 |
|
158 |
-
$form.
|
159 |
-
$( n ).val( $( n ).attr( 'placeholder' ) );
|
160 |
-
} );
|
161 |
-
|
162 |
-
$responseOutput.append( data.message ).slideDown( 'fast' );
|
163 |
-
$responseOutput.attr( 'role', 'alert' );
|
164 |
|
165 |
-
|
166 |
-
|
|
|
|
|
|
|
|
|
167 |
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
|
|
|
|
|
|
|
|
179 |
}
|
180 |
} );
|
181 |
|
182 |
-
|
183 |
-
|
184 |
-
/* jQuery event */
|
185 |
-
$( this ).trigger( 'wpcf7:' + name );
|
186 |
-
$( this ).trigger( name + '.wpcf7' ); // deprecated
|
187 |
-
} );
|
188 |
-
};
|
189 |
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
|
|
|
|
|
|
196 |
|
197 |
-
|
198 |
-
|
199 |
-
return this;
|
200 |
-
}
|
201 |
|
202 |
-
|
203 |
-
|
204 |
-
|
|
|
|
|
205 |
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
|
|
211 |
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
$
|
216 |
-
|
217 |
-
} );
|
218 |
-
} );
|
219 |
-
};
|
220 |
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
} );
|
225 |
-
};
|
226 |
-
|
227 |
-
$.fn.wpcf7ToggleSubmit = function() {
|
228 |
-
return this.each( function() {
|
229 |
-
var form = $( this );
|
230 |
|
231 |
-
|
232 |
-
|
233 |
-
|
|
|
|
|
|
|
|
|
234 |
|
235 |
-
|
236 |
-
return;
|
237 |
}
|
238 |
|
239 |
-
|
240 |
|
241 |
-
if (
|
242 |
-
|
243 |
}
|
244 |
|
245 |
-
|
246 |
|
247 |
-
if (
|
248 |
-
|
|
|
|
|
249 |
}
|
250 |
|
251 |
-
|
252 |
-
|
253 |
-
n = $( n );
|
254 |
-
|
255 |
-
if ( n.hasClass( 'wpcf7-invert' ) && n.is( ':checked' )
|
256 |
-
|| ! n.hasClass( 'wpcf7-invert' ) && ! n.is( ':checked' ) ) {
|
257 |
-
submit.attr( 'disabled', 'disabled' );
|
258 |
-
}
|
259 |
} );
|
260 |
-
} );
|
261 |
-
};
|
262 |
|
263 |
-
|
264 |
-
|
265 |
-
var $wrap = $( this ).closest( '.wpcf7-form-control' );
|
266 |
|
267 |
-
|
268 |
-
$
|
269 |
-
|
270 |
-
$( this ).find( ':input.wpcf7-free-text' ).prop( 'disabled', true );
|
271 |
-
}
|
272 |
|
273 |
-
|
274 |
-
|
275 |
-
var $freetext = $( ':input.wpcf7-free-text', $wrap );
|
276 |
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
} );
|
284 |
-
};
|
285 |
|
286 |
-
|
287 |
-
|
288 |
-
var $count = $( this );
|
289 |
-
var name = $count.attr( 'data-target-name' );
|
290 |
-
var down = $count.hasClass( 'down' );
|
291 |
-
var starting = parseInt( $count.attr( 'data-starting-value' ), 10 );
|
292 |
-
var maximum = parseInt( $count.attr( 'data-maximum-value' ), 10 );
|
293 |
-
var minimum = parseInt( $count.attr( 'data-minimum-value' ), 10 );
|
294 |
-
|
295 |
-
var updateCount = function( $target ) {
|
296 |
-
var length = $target.val().length;
|
297 |
-
var count = down ? starting - length : length;
|
298 |
-
$count.attr( 'data-current-value', count );
|
299 |
-
$count.text( count );
|
300 |
-
|
301 |
-
if ( maximum && maximum < length ) {
|
302 |
-
$count.addClass( 'too-long' );
|
303 |
-
} else {
|
304 |
-
$count.removeClass( 'too-long' );
|
305 |
-
}
|
306 |
|
307 |
-
|
308 |
-
$count.addClass( 'too-short' );
|
309 |
-
} else {
|
310 |
-
$count.removeClass( 'too-short' );
|
311 |
}
|
312 |
-
};
|
313 |
|
314 |
-
|
315 |
-
updateCount( $( this ) );
|
316 |
-
|
317 |
-
$( this ).keyup( function() {
|
318 |
-
updateCount( $( this ) );
|
319 |
-
} );
|
320 |
} );
|
321 |
-
}
|
322 |
-
};
|
323 |
-
|
324 |
-
$.fn.wpcf7NormalizeUrl = function() {
|
325 |
-
return this.each( function() {
|
326 |
-
var val = $.trim( $( this ).val() );
|
327 |
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
} );
|
336 |
};
|
337 |
|
338 |
-
|
339 |
-
|
340 |
-
var $into = $( this );
|
341 |
|
342 |
-
|
343 |
-
|
|
|
|
|
|
|
344 |
|
345 |
-
|
346 |
-
$( '.wpcf7-not-valid-tip', $into ).mouseover( function() {
|
347 |
-
$( this ).wpcf7FadeOut();
|
348 |
-
} );
|
349 |
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
}
|
354 |
-
} );
|
355 |
};
|
356 |
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
opacity: 0
|
361 |
-
}, 'fast', function() {
|
362 |
-
$( this ).css( { 'z-index': -100 } );
|
363 |
-
} );
|
364 |
-
} );
|
365 |
-
};
|
366 |
|
367 |
-
|
368 |
-
|
369 |
-
|
|
|
370 |
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
|
375 |
-
|
376 |
-
var unitTag = $( this ).find( 'input[name="_wpcf7_unit_tag"]' ).val();
|
377 |
|
378 |
-
|
379 |
-
|
380 |
-
function( data ) {
|
381 |
-
if ( data && data.captcha ) {
|
382 |
-
$( '#' + unitTag ).wpcf7RefillCaptcha( data.captcha );
|
383 |
-
}
|
384 |
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
} );
|
391 |
};
|
392 |
|
393 |
-
|
394 |
-
|
395 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
396 |
|
397 |
-
|
398 |
-
|
399 |
-
form.find( 'img.wpcf7-captcha-' + i ).attr( 'src', n );
|
400 |
-
var match = /([0-9]+)\.(png|gif|jpeg)$/.exec( n );
|
401 |
-
form.find( 'input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]' ).attr( 'value', match[ 1 ] );
|
402 |
} );
|
403 |
-
} );
|
404 |
-
};
|
405 |
-
|
406 |
-
$.fn.wpcf7RefillQuiz = function( quiz ) {
|
407 |
-
return this.each( function() {
|
408 |
-
var form = $( this );
|
409 |
|
410 |
-
|
411 |
-
|
412 |
-
form.find( ':input[name="' + i + '"]' ).siblings( 'span.wpcf7-quiz-label' ).text( n[ 0 ] );
|
413 |
-
form.find( 'input:hidden[name="_wpcf7_quiz_answer_' + i + '"]' ).attr( 'value', n[ 1 ] );
|
414 |
} );
|
415 |
-
}
|
416 |
-
}
|
417 |
|
418 |
-
|
419 |
-
|
420 |
-
$( this ).find( 'div.wpcf7-response-output' ).hide().empty().removeClass( 'wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked' ).removeAttr( 'role' );
|
421 |
-
$( this ).find( 'span.wpcf7-not-valid-tip' ).remove();
|
422 |
-
$( this ).find( '.ajax-loader' ).removeClass( 'is-active' );
|
423 |
-
} );
|
424 |
-
};
|
425 |
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
grecaptcha.reset( value );
|
433 |
-
} );
|
434 |
-
}
|
435 |
} );
|
436 |
-
}
|
437 |
-
};
|
438 |
-
|
439 |
-
$.wpcf7UpdateScreenReaderResponse = function( $form, data ) {
|
440 |
-
$( '.wpcf7 .screen-reader-response' ).html( '' ).attr( 'role', '' );
|
441 |
-
|
442 |
-
if ( data.message ) {
|
443 |
-
var $response = $form.siblings( '.screen-reader-response' ).first();
|
444 |
-
$response.append( data.message );
|
445 |
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
455 |
|
456 |
-
|
457 |
-
|
|
|
|
|
458 |
|
459 |
-
|
|
|
|
|
460 |
}
|
461 |
|
462 |
-
|
|
|
|
|
463 |
}
|
464 |
};
|
465 |
|
466 |
-
|
467 |
-
var
|
468 |
-
|
469 |
-
|
470 |
-
features.placeholder = 'placeholder' in input;
|
471 |
-
|
472 |
-
var inputTypes = [ 'email', 'url', 'tel', 'number', 'range', 'date' ];
|
473 |
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
} );
|
478 |
|
479 |
-
|
|
|
|
|
480 |
};
|
481 |
|
482 |
-
$( function() {
|
483 |
-
_wpcf7.supportHtml5 = $.wpcf7SupportHtml5();
|
484 |
-
$( 'div.wpcf7 > form' ).wpcf7InitForm();
|
485 |
-
} );
|
486 |
-
|
487 |
} )( jQuery );
|
488 |
|
489 |
/*
|
2 |
|
3 |
'use strict';
|
4 |
|
5 |
+
if ( typeof wpcf7 === 'undefined' || wpcf7 === null ) {
|
6 |
return;
|
7 |
}
|
8 |
|
9 |
+
wpcf7 = $.extend( {
|
10 |
cached: 0,
|
11 |
inputs: []
|
12 |
+
}, wpcf7 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
+
$( function() {
|
15 |
+
wpcf7.supportHtml5 = ( function() {
|
16 |
+
var features = {};
|
17 |
+
var input = document.createElement( 'input' );
|
18 |
|
19 |
+
features.placeholder = 'placeholder' in input;
|
20 |
|
21 |
+
var inputTypes = [ 'email', 'url', 'tel', 'number', 'range', 'date' ];
|
22 |
|
23 |
+
$.each( inputTypes, function( index, value ) {
|
24 |
+
input.setAttribute( 'type', value );
|
25 |
+
features[ value ] = input.type !== 'text';
|
26 |
+
} );
|
27 |
|
28 |
+
return features;
|
29 |
+
} )();
|
30 |
|
31 |
+
$( 'div.wpcf7 > form' ).each( function() {
|
32 |
+
var $form = $( this );
|
33 |
|
34 |
+
$form.submit( function( event ) {
|
35 |
+
if ( typeof window.FormData !== 'function' ) {
|
36 |
+
return;
|
37 |
+
}
|
38 |
|
39 |
+
wpcf7.submit( $form );
|
40 |
+
event.preventDefault();
|
|
|
|
|
|
|
|
|
|
|
41 |
} );
|
|
|
42 |
|
43 |
+
$( '.wpcf7-submit', $form ).after( '<span class="ajax-loader"></span>' );
|
44 |
+
|
45 |
+
wpcf7.toggleSubmit( $form );
|
46 |
+
|
47 |
+
$form.on( 'click', '.wpcf7-acceptance', function() {
|
48 |
+
wpcf7.toggleSubmit( $form );
|
|
|
49 |
} );
|
|
|
50 |
|
51 |
+
// Exclusive Checkbox
|
52 |
+
$( '.wpcf7-exclusive-checkbox', $form ).on( 'click', 'input:checkbox', function() {
|
53 |
+
var name = $( this ).attr( 'name' );
|
54 |
+
$form.find( 'input:checkbox[name="' + name + '"]' ).not( this ).prop( 'checked', false );
|
55 |
+
} );
|
56 |
|
57 |
+
// Free Text Option for Checkboxes and Radio Buttons
|
58 |
+
$( '.wpcf7-list-item.has-free-text', $form ).each( function() {
|
59 |
+
var $freetext = $( ':input.wpcf7-free-text', this );
|
60 |
+
var $wrap = $( this ).closest( '.wpcf7-form-control' );
|
61 |
|
62 |
+
if ( $( ':checkbox, :radio', this ).is( ':checked' ) ) {
|
63 |
+
$freetext.prop( 'disabled', false );
|
64 |
+
} else {
|
65 |
+
$freetext.prop( 'disabled', true );
|
66 |
+
}
|
67 |
|
68 |
+
$wrap.on( 'change', ':checkbox, :radio', function() {
|
69 |
+
var $cb = $( '.has-free-text', $wrap ).find( ':checkbox, :radio' );
|
|
|
|
|
70 |
|
71 |
+
if ( $cb.is( ':checked' ) ) {
|
72 |
+
$freetext.prop( 'disabled', false ).focus();
|
73 |
+
} else {
|
74 |
+
$freetext.prop( 'disabled', true );
|
75 |
+
}
|
76 |
+
} );
|
77 |
+
} );
|
78 |
|
79 |
+
// Placeholder Fallback
|
80 |
+
if ( ! wpcf7.supportHtml5.placeholder ) {
|
81 |
+
$( '[placeholder]', $form ).each( function() {
|
82 |
+
$( this ).val( $( this ).attr( 'placeholder' ) );
|
83 |
+
$( this ).addClass( 'placeheld' );
|
84 |
|
85 |
+
$( this ).focus( function() {
|
86 |
+
if ( $( this ).hasClass( 'placeheld' ) ) {
|
87 |
+
$( this ).val( '' ).removeClass( 'placeheld' );
|
88 |
+
}
|
89 |
+
} );
|
90 |
|
91 |
+
$( this ).blur( function() {
|
92 |
+
if ( '' === $( this ).val() ) {
|
93 |
+
$( this ).val( $( this ).attr( 'placeholder' ) );
|
94 |
+
$( this ).addClass( 'placeheld' );
|
95 |
+
}
|
96 |
+
} );
|
97 |
+
} );
|
98 |
+
}
|
99 |
|
100 |
+
if ( wpcf7.jqueryUi && ! wpcf7.supportHtml5.date ) {
|
101 |
+
$form.find( 'input.wpcf7-date[type="date"]' ).each( function() {
|
102 |
+
$( this ).datepicker( {
|
103 |
+
dateFormat: 'yy-mm-dd',
|
104 |
+
minDate: new Date( $( this ).attr( 'min' ) ),
|
105 |
+
maxDate: new Date( $( this ).attr( 'max' ) )
|
106 |
+
} );
|
107 |
+
} );
|
108 |
+
}
|
109 |
|
110 |
+
if ( wpcf7.jqueryUi && ! wpcf7.supportHtml5.number ) {
|
111 |
+
$form.find( 'input.wpcf7-number[type="number"]' ).each( function() {
|
112 |
+
$( this ).spinner( {
|
113 |
+
min: $( this ).attr( 'min' ),
|
114 |
+
max: $( this ).attr( 'max' ),
|
115 |
+
step: $( this ).attr( 'step' )
|
116 |
+
} );
|
117 |
+
} );
|
118 |
+
}
|
119 |
|
120 |
+
// Character Count
|
121 |
+
$( '.wpcf7-character-count', $form ).each( function() {
|
122 |
+
var $count = $( this );
|
123 |
+
var name = $count.attr( 'data-target-name' );
|
124 |
+
var down = $count.hasClass( 'down' );
|
125 |
+
var starting = parseInt( $count.attr( 'data-starting-value' ), 10 );
|
126 |
+
var maximum = parseInt( $count.attr( 'data-maximum-value' ), 10 );
|
127 |
+
var minimum = parseInt( $count.attr( 'data-minimum-value' ), 10 );
|
128 |
+
|
129 |
+
var updateCount = function( target ) {
|
130 |
+
var $target = $( target );
|
131 |
+
var length = $target.val().length;
|
132 |
+
var count = down ? starting - length : length;
|
133 |
+
$count.attr( 'data-current-value', count );
|
134 |
+
$count.text( count );
|
135 |
+
|
136 |
+
if ( maximum && maximum < length ) {
|
137 |
+
$count.addClass( 'too-long' );
|
138 |
+
} else {
|
139 |
+
$count.removeClass( 'too-long' );
|
140 |
+
}
|
141 |
|
142 |
+
if ( minimum && length < minimum ) {
|
143 |
+
$count.addClass( 'too-short' );
|
144 |
+
} else {
|
145 |
+
$count.removeClass( 'too-short' );
|
146 |
+
}
|
147 |
+
};
|
148 |
|
149 |
+
$( ':input[name="' + name + '"]', $form ).each( function() {
|
150 |
+
updateCount( this );
|
151 |
|
152 |
+
$( this ).keyup( function() {
|
153 |
+
updateCount( this );
|
154 |
+
} );
|
155 |
+
} );
|
|
|
|
|
156 |
} );
|
157 |
|
158 |
+
$form.on( 'change', '.wpcf7-validates-as-url', function() {
|
159 |
+
var val = $.trim( $( this ).val() );
|
160 |
|
161 |
+
// check the scheme part
|
162 |
+
if ( val && ! val.match( /^[a-z][a-z0-9.+-]*:/i ) ) {
|
163 |
+
val = val.replace( /^\/+/, '' );
|
164 |
+
val = 'http://' + val;
|
165 |
+
}
|
166 |
|
167 |
+
$( this ).val( val );
|
168 |
+
} );
|
|
|
169 |
|
170 |
+
if ( wpcf7.cached ) {
|
171 |
+
wpcf7.refill( $form );
|
172 |
}
|
173 |
+
} );
|
174 |
+
} );
|
175 |
|
176 |
+
wpcf7.getId = function( form ) {
|
177 |
+
return parseInt( $( 'input[name="_wpcf7"]', form ).val(), 10 );
|
178 |
+
};
|
|
|
|
|
179 |
|
180 |
+
wpcf7.submit = function( form ) {
|
181 |
+
var $form = $( form );
|
182 |
|
183 |
+
$( '[placeholder].placeheld', $form ).each( function( i, n ) {
|
184 |
+
$( n ).val( '' );
|
185 |
+
} );
|
186 |
|
187 |
+
wpcf7.clearResponse( $form );
|
188 |
+
$( '.ajax-loader', $form ).addClass( 'is-active' );
|
189 |
|
190 |
+
if ( typeof window.FormData !== 'function' ) {
|
191 |
+
return;
|
192 |
}
|
193 |
|
194 |
+
var formData = new FormData( $form.get( 0 ) );
|
|
|
|
|
|
|
|
|
|
|
195 |
|
196 |
+
var ajaxSuccess = function( data, status, xhr, $form ) {
|
197 |
+
var detail = {
|
198 |
+
id: $( data.into ).attr( 'id' ),
|
199 |
+
status: data.status,
|
200 |
+
inputs: []
|
201 |
+
};
|
202 |
|
203 |
+
$.each( $form.serializeArray(), function( i, field ) {
|
204 |
+
if ( '_wpcf7' == field.name ) {
|
205 |
+
detail.contactFormId = field.value;
|
206 |
+
} else if ( '_wpcf7_version' == field.name ) {
|
207 |
+
detail.pluginVersion = field.value;
|
208 |
+
} else if ( '_wpcf7_locale' == field.name ) {
|
209 |
+
detail.contactFormLocale = field.value;
|
210 |
+
} else if ( '_wpcf7_unit_tag' == field.name ) {
|
211 |
+
detail.unitTag = field.value;
|
212 |
+
} else if ( '_wpcf7_container_post' == field.name ) {
|
213 |
+
detail.containerPostId = field.value;
|
214 |
+
} else if ( field.name.match( /^_/ ) ) {
|
215 |
+
// do nothing
|
216 |
+
} else {
|
217 |
+
detail.inputs.push( field );
|
218 |
}
|
219 |
} );
|
220 |
|
221 |
+
var $message = $( '.wpcf7-response-output', $form );
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
|
223 |
+
switch ( data.status ) {
|
224 |
+
case 'validation_failed':
|
225 |
+
$.each( data.invalidFields, function( i, n ) {
|
226 |
+
$( n.into, $form ).each( function() {
|
227 |
+
wpcf7.notValidTip( this, n.message );
|
228 |
+
$( '.wpcf7-form-control', this ).addClass( 'wpcf7-not-valid' );
|
229 |
+
$( '[aria-invalid]', this ).attr( 'aria-invalid', 'true' );
|
230 |
+
} );
|
231 |
+
} );
|
232 |
|
233 |
+
$message.addClass( 'wpcf7-validation-errors' );
|
234 |
+
$form.addClass( 'invalid' );
|
|
|
|
|
235 |
|
236 |
+
wpcf7.triggerEvent( data.into, 'invalid', detail );
|
237 |
+
break;
|
238 |
+
case 'spam':
|
239 |
+
$message.addClass( 'wpcf7-spam-blocked' );
|
240 |
+
$form.addClass( 'spam' );
|
241 |
|
242 |
+
$( '[name="g-recaptcha-response"]', $form ).each( function() {
|
243 |
+
if ( '' === $( this ).val() ) {
|
244 |
+
var $recaptcha = $( this ).closest( '.wpcf7-form-control-wrap' );
|
245 |
+
wpcf7.notValidTip( $recaptcha, wpcf7.recaptcha.messages.empty );
|
246 |
+
}
|
247 |
+
} );
|
248 |
|
249 |
+
wpcf7.triggerEvent( data.into, 'spam', detail );
|
250 |
+
break;
|
251 |
+
case 'mail_sent':
|
252 |
+
$message.addClass( 'wpcf7-mail-sent-ok' );
|
253 |
+
$form.addClass( 'sent' );
|
|
|
|
|
|
|
254 |
|
255 |
+
if ( data.onSentOk ) {
|
256 |
+
$.each( data.onSentOk, function( i, n ) { eval( n ) } );
|
257 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
|
259 |
+
wpcf7.triggerEvent( data.into, 'mailsent', detail );
|
260 |
+
break;
|
261 |
+
case 'mail_failed':
|
262 |
+
case 'acceptance_missing':
|
263 |
+
default:
|
264 |
+
$message.addClass( 'wpcf7-mail-sent-ng' );
|
265 |
+
$form.addClass( 'failed' );
|
266 |
|
267 |
+
wpcf7.triggerEvent( data.into, 'mailfailed', detail );
|
|
|
268 |
}
|
269 |
|
270 |
+
wpcf7.refill( $form, data );
|
271 |
|
272 |
+
if ( data.onSubmit ) {
|
273 |
+
$.each( data.onSubmit, function( i, n ) { eval( n ) } );
|
274 |
}
|
275 |
|
276 |
+
wpcf7.triggerEvent( data.into, 'submit', detail );
|
277 |
|
278 |
+
if ( 'mail_sent' == data.status ) {
|
279 |
+
$form.each( function() {
|
280 |
+
this.reset();
|
281 |
+
} );
|
282 |
}
|
283 |
|
284 |
+
$form.find( '[placeholder].placeheld' ).each( function( i, n ) {
|
285 |
+
$( n ).val( $( n ).attr( 'placeholder' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
} );
|
|
|
|
|
287 |
|
288 |
+
$message.append( data.message ).slideDown( 'fast' );
|
289 |
+
$message.attr( 'role', 'alert' );
|
|
|
290 |
|
291 |
+
$( '.screen-reader-response', $form.closest( '.wpcf7' ) ).each( function() {
|
292 |
+
var $response = $( this );
|
293 |
+
$response.html( '' ).attr( 'role', '' ).append( data.message );
|
|
|
|
|
294 |
|
295 |
+
if ( data.invalidFields ) {
|
296 |
+
var $invalids = $( '<ul></ul>' );
|
|
|
297 |
|
298 |
+
$.each( data.invalidFields, function( i, n ) {
|
299 |
+
if ( n.idref ) {
|
300 |
+
var $li = $( '<li></li>' ).append( $( '<a></a>' ).attr( 'href', '#' + n.idref ).append( n.message ) );
|
301 |
+
} else {
|
302 |
+
var $li = $( '<li></li>' ).append( n.message );
|
303 |
+
}
|
|
|
|
|
304 |
|
305 |
+
$invalids.append( $li );
|
306 |
+
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
307 |
|
308 |
+
$response.append( $invalids );
|
|
|
|
|
|
|
309 |
}
|
|
|
310 |
|
311 |
+
$response.attr( 'role', 'alert' ).focus();
|
|
|
|
|
|
|
|
|
|
|
312 |
} );
|
313 |
+
};
|
|
|
|
|
|
|
|
|
|
|
314 |
|
315 |
+
$.ajax( {
|
316 |
+
type: 'POST',
|
317 |
+
url: wpcf7.apiSettings.root + wpcf7.apiSettings.namespace +
|
318 |
+
'/contact-forms/' + wpcf7.getId( $form ) + '/feedback',
|
319 |
+
data: formData,
|
320 |
+
dataType: 'json',
|
321 |
+
processData: false,
|
322 |
+
contentType: false
|
323 |
+
} ).done( function( data, status, xhr ) {
|
324 |
+
ajaxSuccess( data, status, xhr, $form );
|
325 |
+
$( '.ajax-loader', $form ).removeClass( 'is-active' );
|
326 |
+
} ).fail( function( xhr, status, error ) {
|
327 |
+
var $e = $( '<div class="ajax-error"></div>' ).text( error.message );
|
328 |
+
$form.after( $e );
|
329 |
} );
|
330 |
};
|
331 |
|
332 |
+
wpcf7.triggerEvent = function( target, name, detail ) {
|
333 |
+
var $target = $( target );
|
|
|
334 |
|
335 |
+
/* DOM event */
|
336 |
+
var event = new CustomEvent( 'wpcf7' + name, {
|
337 |
+
bubbles: true,
|
338 |
+
detail: detail
|
339 |
+
} );
|
340 |
|
341 |
+
$target.get( 0 ).dispatchEvent( event );
|
|
|
|
|
|
|
342 |
|
343 |
+
/* jQuery event */
|
344 |
+
$target.trigger( 'wpcf7:' + name, detail );
|
345 |
+
$target.trigger( name + '.wpcf7', detail ); // deprecated
|
|
|
|
|
346 |
};
|
347 |
|
348 |
+
wpcf7.toggleSubmit = function( form, state ) {
|
349 |
+
var $form = $( form );
|
350 |
+
var $submit = $( 'input:submit', $form );
|
|
|
|
|
|
|
|
|
|
|
|
|
351 |
|
352 |
+
if ( typeof state !== 'undefined' ) {
|
353 |
+
$submit.prop( 'disabled', ! state );
|
354 |
+
return;
|
355 |
+
}
|
356 |
|
357 |
+
if ( $form.hasClass( 'wpcf7-acceptance-as-validation' ) ) {
|
358 |
+
return;
|
359 |
+
}
|
360 |
|
361 |
+
$submit.prop( 'disabled', false );
|
|
|
362 |
|
363 |
+
$( 'input:checkbox.wpcf7-acceptance', $form ).each( function() {
|
364 |
+
var $a = $( this );
|
|
|
|
|
|
|
|
|
365 |
|
366 |
+
if ( $a.hasClass( 'wpcf7-invert' ) && $a.is( ':checked' )
|
367 |
+
|| ! $a.hasClass( 'wpcf7-invert' ) && ! $a.is( ':checked' ) ) {
|
368 |
+
$submit.prop( 'disabled', true );
|
369 |
+
return false;
|
370 |
+
}
|
371 |
} );
|
372 |
};
|
373 |
|
374 |
+
wpcf7.notValidTip = function( target, message ) {
|
375 |
+
var $target = $( target );
|
376 |
+
$( '.wpcf7-not-valid-tip', $target ).remove();
|
377 |
+
$( '<span role="alert" class="wpcf7-not-valid-tip"></span>' )
|
378 |
+
.text( message ).appendTo( $target );
|
379 |
+
|
380 |
+
if ( $target.is( '.use-floating-validation-tip *' ) ) {
|
381 |
+
var fadeOut = function( target ) {
|
382 |
+
$( target ).not( ':hidden' ).animate( {
|
383 |
+
opacity: 0
|
384 |
+
}, 'fast', function() {
|
385 |
+
$( this ).css( { 'z-index': -100 } );
|
386 |
+
} );
|
387 |
+
}
|
388 |
|
389 |
+
$target.on( 'mouseover', '.wpcf7-not-valid-tip', function() {
|
390 |
+
fadeOut( this );
|
|
|
|
|
|
|
391 |
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
392 |
|
393 |
+
$target.on( 'focus', ':input', function() {
|
394 |
+
fadeOut( $( '.wpcf7-not-valid-tip', $target ) );
|
|
|
|
|
395 |
} );
|
396 |
+
}
|
397 |
+
}
|
398 |
|
399 |
+
wpcf7.refill = function( form, data ) {
|
400 |
+
var $form = $( form );
|
|
|
|
|
|
|
|
|
|
|
401 |
|
402 |
+
var refillCaptcha = function( $form, items ) {
|
403 |
+
$.each( items, function( i, n ) {
|
404 |
+
$form.find( ':input[name="' + i + '"]' ).val( '' );
|
405 |
+
$form.find( 'img.wpcf7-captcha-' + i ).attr( 'src', n );
|
406 |
+
var match = /([0-9]+)\.(png|gif|jpeg)$/.exec( n );
|
407 |
+
$form.find( 'input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]' ).attr( 'value', match[ 1 ] );
|
|
|
|
|
|
|
408 |
} );
|
409 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
410 |
|
411 |
+
var refillQuiz = function( $form, items ) {
|
412 |
+
$.each( items, function( i, n ) {
|
413 |
+
$form.find( ':input[name="' + i + '"]' ).val( '' );
|
414 |
+
$form.find( ':input[name="' + i + '"]' ).siblings( 'span.wpcf7-quiz-label' ).text( n[ 0 ] );
|
415 |
+
$form.find( 'input:hidden[name="_wpcf7_quiz_answer_' + i + '"]' ).attr( 'value', n[ 1 ] );
|
416 |
+
} );
|
417 |
+
};
|
418 |
+
|
419 |
+
if ( typeof data === 'undefined' ) {
|
420 |
+
$.ajax( {
|
421 |
+
type: 'GET',
|
422 |
+
url: wpcf7.apiSettings.root + wpcf7.apiSettings.namespace +
|
423 |
+
'/contact-forms/' + wpcf7.getId( $form ) + '/refill',
|
424 |
+
dataType: 'json'
|
425 |
+
} ).done( function( data, status, xhr ) {
|
426 |
+
if ( data.captcha ) {
|
427 |
+
refillCaptcha( $form, data.captcha );
|
428 |
+
}
|
429 |
|
430 |
+
if ( data.quiz ) {
|
431 |
+
refillQuiz( $form, data.quiz );
|
432 |
+
}
|
433 |
+
} );
|
434 |
|
435 |
+
} else {
|
436 |
+
if ( data.captcha ) {
|
437 |
+
refillCaptcha( $form, data.captcha );
|
438 |
}
|
439 |
|
440 |
+
if ( data.quiz ) {
|
441 |
+
refillQuiz( $form, data.quiz );
|
442 |
+
}
|
443 |
}
|
444 |
};
|
445 |
|
446 |
+
wpcf7.clearResponse = function( form ) {
|
447 |
+
var $form = $( form );
|
448 |
+
$form.removeClass( 'invalid spam sent failed' );
|
449 |
+
$form.siblings( '.screen-reader-response' ).html( '' ).attr( 'role', '' );
|
|
|
|
|
|
|
450 |
|
451 |
+
$( '.wpcf7-not-valid-tip', $form ).remove();
|
452 |
+
$( '[aria-invalid]', $form ).attr( 'aria-invalid', 'false' );
|
453 |
+
$( '.wpcf7-form-control', $form ).removeClass( 'wpcf7-not-valid' );
|
|
|
454 |
|
455 |
+
$( '.wpcf7-response-output', $form )
|
456 |
+
.hide().empty().removeAttr( 'role' )
|
457 |
+
.removeClass( 'wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked' );
|
458 |
};
|
459 |
|
|
|
|
|
|
|
|
|
|
|
460 |
} )( jQuery );
|
461 |
|
462 |
/*
|
includes/mail.php
CHANGED
@@ -399,38 +399,33 @@ function wpcf7_special_mail_tag( $output, $name, $html ) {
|
|
399 |
}
|
400 |
|
401 |
if ( '_post_' == substr( $name, 0, 6 ) ) {
|
402 |
-
$
|
403 |
|
404 |
-
if ( $
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
if ( $post = get_post( $post_id ) ) {
|
409 |
-
if ( '_post_id' == $name ) {
|
410 |
-
return (string) $post->ID;
|
411 |
-
}
|
412 |
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
|
425 |
-
|
426 |
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
|
431 |
-
|
432 |
-
|
433 |
-
}
|
434 |
}
|
435 |
}
|
436 |
|
399 |
}
|
400 |
|
401 |
if ( '_post_' == substr( $name, 0, 6 ) ) {
|
402 |
+
$post_id = (int) $submission->get_meta( 'container_post_id' );
|
403 |
|
404 |
+
if ( $post = get_post( $post_id ) ) {
|
405 |
+
if ( '_post_id' == $name ) {
|
406 |
+
return (string) $post->ID;
|
407 |
+
}
|
|
|
|
|
|
|
|
|
408 |
|
409 |
+
if ( '_post_name' == $name ) {
|
410 |
+
return $post->post_name;
|
411 |
+
}
|
412 |
|
413 |
+
if ( '_post_title' == $name ) {
|
414 |
+
return $html ? esc_html( $post->post_title ) : $post->post_title;
|
415 |
+
}
|
416 |
|
417 |
+
if ( '_post_url' == $name ) {
|
418 |
+
return get_permalink( $post->ID );
|
419 |
+
}
|
420 |
|
421 |
+
$user = new WP_User( $post->post_author );
|
422 |
|
423 |
+
if ( '_post_author' == $name ) {
|
424 |
+
return $user->display_name;
|
425 |
+
}
|
426 |
|
427 |
+
if ( '_post_author_email' == $name ) {
|
428 |
+
return $user->user_email;
|
|
|
429 |
}
|
430 |
}
|
431 |
|
includes/rest-api.php
CHANGED
@@ -36,6 +36,26 @@ function wpcf7_rest_api_init() {
|
|
36 |
),
|
37 |
)
|
38 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
}
|
40 |
|
41 |
function wpcf7_rest_get_contact_forms( WP_REST_Request $request ) {
|
@@ -246,3 +266,66 @@ function wpcf7_rest_delete_contact_form( WP_REST_Request $request ) {
|
|
246 |
|
247 |
return rest_ensure_response( $response );
|
248 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
),
|
37 |
)
|
38 |
);
|
39 |
+
|
40 |
+
register_rest_route( $namespace,
|
41 |
+
'/contact-forms/(?P<id>\d+)/feedback',
|
42 |
+
array(
|
43 |
+
array(
|
44 |
+
'methods' => WP_REST_Server::CREATABLE,
|
45 |
+
'callback' => 'wpcf7_rest_create_feedback',
|
46 |
+
),
|
47 |
+
)
|
48 |
+
);
|
49 |
+
|
50 |
+
register_rest_route( $namespace,
|
51 |
+
'/contact-forms/(?P<id>\d+)/refill',
|
52 |
+
array(
|
53 |
+
array(
|
54 |
+
'methods' => WP_REST_Server::READABLE,
|
55 |
+
'callback' => 'wpcf7_rest_get_refill',
|
56 |
+
),
|
57 |
+
)
|
58 |
+
);
|
59 |
}
|
60 |
|
61 |
function wpcf7_rest_get_contact_forms( WP_REST_Request $request ) {
|
266 |
|
267 |
return rest_ensure_response( $response );
|
268 |
}
|
269 |
+
|
270 |
+
function wpcf7_rest_create_feedback( WP_REST_Request $request ) {
|
271 |
+
$id = (int) $request->get_param( 'id' );
|
272 |
+
$item = wpcf7_contact_form( $id );
|
273 |
+
|
274 |
+
if ( ! $item ) {
|
275 |
+
return new WP_Error( 'wpcf7_not_found',
|
276 |
+
__( "The requested contact form was not found.", 'contact-form-7' ),
|
277 |
+
array( 'status' => 404 ) );
|
278 |
+
}
|
279 |
+
|
280 |
+
$result = $item->submit();
|
281 |
+
|
282 |
+
$unit_tag = $request->get_param( '_wpcf7_unit_tag' );
|
283 |
+
|
284 |
+
$response = array(
|
285 |
+
'into' => '#' . wpcf7_sanitize_unit_tag( $unit_tag ),
|
286 |
+
'status' => $result['status'],
|
287 |
+
'message' => $result['message'],
|
288 |
+
);
|
289 |
+
|
290 |
+
if ( 'validation_failed' == $result['status'] ) {
|
291 |
+
$invalid_fields = array();
|
292 |
+
|
293 |
+
foreach ( (array) $result['invalid_fields'] as $name => $field ) {
|
294 |
+
$invalid_fields[] = array(
|
295 |
+
'into' => 'span.wpcf7-form-control-wrap.'
|
296 |
+
. sanitize_html_class( $name ),
|
297 |
+
'message' => $field['reason'],
|
298 |
+
'idref' => $field['idref'],
|
299 |
+
);
|
300 |
+
}
|
301 |
+
|
302 |
+
$response['invalidFields'] = $invalid_fields;
|
303 |
+
}
|
304 |
+
|
305 |
+
if ( ! empty( $result['scripts_on_sent_ok'] ) ) {
|
306 |
+
$response['onSentOk'] = $result['scripts_on_sent_ok'];
|
307 |
+
}
|
308 |
+
|
309 |
+
if ( ! empty( $result['scripts_on_submit'] ) ) {
|
310 |
+
$response['onSubmit'] = $result['scripts_on_submit'];
|
311 |
+
}
|
312 |
+
|
313 |
+
$response = apply_filters( 'wpcf7_ajax_json_echo', $response, $result );
|
314 |
+
|
315 |
+
return rest_ensure_response( $response );
|
316 |
+
}
|
317 |
+
|
318 |
+
function wpcf7_rest_get_refill( WP_REST_Request $request ) {
|
319 |
+
$id = (int) $request->get_param( 'id' );
|
320 |
+
$item = wpcf7_contact_form( $id );
|
321 |
+
|
322 |
+
if ( ! $item ) {
|
323 |
+
return new WP_Error( 'wpcf7_not_found',
|
324 |
+
__( "The requested contact form was not found.", 'contact-form-7' ),
|
325 |
+
array( 'status' => 404 ) );
|
326 |
+
}
|
327 |
+
|
328 |
+
$response = apply_filters( 'wpcf7_ajax_onload', array() );
|
329 |
+
|
330 |
+
return rest_ensure_response( $response );
|
331 |
+
}
|
includes/submission.php
CHANGED
@@ -71,7 +71,8 @@ class WPCF7_Submission {
|
|
71 |
|
72 |
private function setup_posted_data() {
|
73 |
$posted_data = (array) $_POST;
|
74 |
-
$posted_data = array_diff_key(
|
|
|
75 |
$posted_data = $this->sanitize_posted_data( $posted_data );
|
76 |
|
77 |
$tags = $this->contact_form->scan_form_tags();
|
@@ -134,11 +135,12 @@ class WPCF7_Submission {
|
|
134 |
'remote_ip' => $this->get_remote_ip_addr(),
|
135 |
'user_agent' => isset( $_SERVER['HTTP_USER_AGENT'] )
|
136 |
? substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 ) : '',
|
137 |
-
'url' =>
|
138 |
-
untrailingslashit( home_url() ) ) . wpcf7_get_request_uri(),
|
139 |
'timestamp' => current_time( 'timestamp' ),
|
140 |
'unit_tag' =>
|
141 |
isset( $_POST['_wpcf7_unit_tag'] ) ? $_POST['_wpcf7_unit_tag'] : '',
|
|
|
|
|
142 |
);
|
143 |
|
144 |
$contact_form = $this->contact_form;
|
@@ -182,6 +184,25 @@ class WPCF7_Submission {
|
|
182 |
return '';
|
183 |
}
|
184 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
private function validate() {
|
186 |
if ( $this->invalid_fields ) {
|
187 |
return false;
|
@@ -229,7 +250,8 @@ class WPCF7_Submission {
|
|
229 |
}
|
230 |
|
231 |
private function verify_nonce() {
|
232 |
-
return wpcf7_verify_nonce(
|
|
|
233 |
}
|
234 |
|
235 |
private function blacklist_check() {
|
71 |
|
72 |
private function setup_posted_data() {
|
73 |
$posted_data = (array) $_POST;
|
74 |
+
$posted_data = array_diff_key(
|
75 |
+
$posted_data, array( '_wpcf7_nonce' => '' ) );
|
76 |
$posted_data = $this->sanitize_posted_data( $posted_data );
|
77 |
|
78 |
$tags = $this->contact_form->scan_form_tags();
|
135 |
'remote_ip' => $this->get_remote_ip_addr(),
|
136 |
'user_agent' => isset( $_SERVER['HTTP_USER_AGENT'] )
|
137 |
? substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 ) : '',
|
138 |
+
'url' => $this->get_request_url(),
|
|
|
139 |
'timestamp' => current_time( 'timestamp' ),
|
140 |
'unit_tag' =>
|
141 |
isset( $_POST['_wpcf7_unit_tag'] ) ? $_POST['_wpcf7_unit_tag'] : '',
|
142 |
+
'container_post_id' => isset( $_POST['_wpcf7_container_post'] )
|
143 |
+
? (int) $_POST['_wpcf7_container_post'] : 0,
|
144 |
);
|
145 |
|
146 |
$contact_form = $this->contact_form;
|
184 |
return '';
|
185 |
}
|
186 |
|
187 |
+
private function get_request_url() {
|
188 |
+
$home_url = untrailingslashit( home_url() );
|
189 |
+
|
190 |
+
if ( isset( $_SERVER['HTTP_X_REQUESTED_WITH'] )
|
191 |
+
&& 'XMLHttpRequest' == $_SERVER['HTTP_X_REQUESTED_WITH'] ) {
|
192 |
+
$referer = isset( $_SERVER['HTTP_REFERER'] )
|
193 |
+
? trim( $_SERVER['HTTP_REFERER'] ) : '';
|
194 |
+
|
195 |
+
if ( $referer && 0 === strpos( $referer, $home_url ) ) {
|
196 |
+
return esc_url_raw( $referer );
|
197 |
+
}
|
198 |
+
}
|
199 |
+
|
200 |
+
$url = preg_replace( '%(?<!:|/)/.*$%', '', $home_url )
|
201 |
+
. wpcf7_get_request_uri();
|
202 |
+
|
203 |
+
return $url;
|
204 |
+
}
|
205 |
+
|
206 |
private function validate() {
|
207 |
if ( $this->invalid_fields ) {
|
208 |
return false;
|
250 |
}
|
251 |
|
252 |
private function verify_nonce() {
|
253 |
+
return wpcf7_verify_nonce(
|
254 |
+
$_POST['_wpcf7_nonce'], $this->contact_form->id() );
|
255 |
}
|
256 |
|
257 |
private function blacklist_check() {
|
modules/acceptance.php
CHANGED
@@ -9,12 +9,15 @@ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_acceptance' );
|
|
9 |
|
10 |
function wpcf7_add_form_tag_acceptance() {
|
11 |
wpcf7_add_form_tag( 'acceptance',
|
12 |
-
'wpcf7_acceptance_form_tag_handler',
|
|
|
|
|
|
|
|
|
|
|
13 |
}
|
14 |
|
15 |
function wpcf7_acceptance_form_tag_handler( $tag ) {
|
16 |
-
$tag = new WPCF7_FormTag( $tag );
|
17 |
-
|
18 |
if ( empty( $tag->name ) ) {
|
19 |
return '';
|
20 |
}
|
@@ -66,8 +69,6 @@ function wpcf7_acceptance_validation_filter( $result, $tag ) {
|
|
66 |
return $result;
|
67 |
}
|
68 |
|
69 |
-
$tag = new WPCF7_FormTag( $tag );
|
70 |
-
|
71 |
$name = $tag->name;
|
72 |
$value = ( ! empty( $_POST[$name] ) ? 1 : 0 );
|
73 |
|
@@ -86,8 +87,9 @@ function wpcf7_acceptance_validation_filter( $result, $tag ) {
|
|
86 |
add_filter( 'wpcf7_acceptance', 'wpcf7_acceptance_filter' );
|
87 |
|
88 |
function wpcf7_acceptance_filter( $accepted ) {
|
89 |
-
if ( ! $accepted )
|
90 |
return $accepted;
|
|
|
91 |
|
92 |
$fes = wpcf7_scan_form_tags( array( 'type' => 'acceptance' ) );
|
93 |
|
@@ -95,15 +97,17 @@ function wpcf7_acceptance_filter( $accepted ) {
|
|
95 |
$name = $fe['name'];
|
96 |
$options = (array) $fe['options'];
|
97 |
|
98 |
-
if ( empty( $name ) )
|
99 |
continue;
|
|
|
100 |
|
101 |
$value = ( ! empty( $_POST[$name] ) ? 1 : 0 );
|
102 |
|
103 |
$invert = (bool) preg_grep( '%^invert$%', $options );
|
104 |
|
105 |
-
if ( $invert && $value || ! $invert && ! $value )
|
106 |
$accepted = false;
|
|
|
107 |
}
|
108 |
|
109 |
return $accepted;
|
@@ -112,15 +116,17 @@ function wpcf7_acceptance_filter( $accepted ) {
|
|
112 |
add_filter( 'wpcf7_form_class_attr', 'wpcf7_acceptance_form_class_attr' );
|
113 |
|
114 |
function wpcf7_acceptance_form_class_attr( $class ) {
|
115 |
-
if ( wpcf7_acceptance_as_validation() )
|
116 |
return $class . ' wpcf7-acceptance-as-validation';
|
|
|
117 |
|
118 |
return $class;
|
119 |
}
|
120 |
|
121 |
function wpcf7_acceptance_as_validation() {
|
122 |
-
if ( ! $contact_form = wpcf7_get_current_contact_form() )
|
123 |
return false;
|
|
|
124 |
|
125 |
return $contact_form->is_true( 'acceptance_as_validation' );
|
126 |
}
|
9 |
|
10 |
function wpcf7_add_form_tag_acceptance() {
|
11 |
wpcf7_add_form_tag( 'acceptance',
|
12 |
+
'wpcf7_acceptance_form_tag_handler',
|
13 |
+
array(
|
14 |
+
'name-attr' => true,
|
15 |
+
'do-not-store' => true,
|
16 |
+
)
|
17 |
+
);
|
18 |
}
|
19 |
|
20 |
function wpcf7_acceptance_form_tag_handler( $tag ) {
|
|
|
|
|
21 |
if ( empty( $tag->name ) ) {
|
22 |
return '';
|
23 |
}
|
69 |
return $result;
|
70 |
}
|
71 |
|
|
|
|
|
72 |
$name = $tag->name;
|
73 |
$value = ( ! empty( $_POST[$name] ) ? 1 : 0 );
|
74 |
|
87 |
add_filter( 'wpcf7_acceptance', 'wpcf7_acceptance_filter' );
|
88 |
|
89 |
function wpcf7_acceptance_filter( $accepted ) {
|
90 |
+
if ( ! $accepted ) {
|
91 |
return $accepted;
|
92 |
+
}
|
93 |
|
94 |
$fes = wpcf7_scan_form_tags( array( 'type' => 'acceptance' ) );
|
95 |
|
97 |
$name = $fe['name'];
|
98 |
$options = (array) $fe['options'];
|
99 |
|
100 |
+
if ( empty( $name ) ) {
|
101 |
continue;
|
102 |
+
}
|
103 |
|
104 |
$value = ( ! empty( $_POST[$name] ) ? 1 : 0 );
|
105 |
|
106 |
$invert = (bool) preg_grep( '%^invert$%', $options );
|
107 |
|
108 |
+
if ( $invert && $value || ! $invert && ! $value ) {
|
109 |
$accepted = false;
|
110 |
+
}
|
111 |
}
|
112 |
|
113 |
return $accepted;
|
116 |
add_filter( 'wpcf7_form_class_attr', 'wpcf7_acceptance_form_class_attr' );
|
117 |
|
118 |
function wpcf7_acceptance_form_class_attr( $class ) {
|
119 |
+
if ( wpcf7_acceptance_as_validation() ) {
|
120 |
return $class . ' wpcf7-acceptance-as-validation';
|
121 |
+
}
|
122 |
|
123 |
return $class;
|
124 |
}
|
125 |
|
126 |
function wpcf7_acceptance_as_validation() {
|
127 |
+
if ( ! $contact_form = wpcf7_get_current_contact_form() ) {
|
128 |
return false;
|
129 |
+
}
|
130 |
|
131 |
return $contact_form->is_true( 'acceptance_as_validation' );
|
132 |
}
|
modules/akismet.php
CHANGED
@@ -43,8 +43,9 @@ function wpcf7_akismet( $spam ) {
|
|
43 |
$ignore = array( 'HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW' );
|
44 |
|
45 |
foreach ( $_SERVER as $key => $value ) {
|
46 |
-
if ( ! in_array( $key, (array) $ignore ) )
|
47 |
$c["$key"] = $value;
|
|
|
48 |
}
|
49 |
|
50 |
return wpcf7_akismet_comment_check( $c );
|
@@ -67,12 +68,13 @@ function wpcf7_akismet_submitted_params() {
|
|
67 |
'author' => '',
|
68 |
'author_email' => '',
|
69 |
'author_url' => '',
|
70 |
-
'content' => ''
|
|
|
71 |
|
72 |
$has_akismet_option = false;
|
73 |
|
74 |
foreach ( (array) $_POST as $key => $val ) {
|
75 |
-
if ( '_wpcf7' == substr( $key, 0, 6 )
|
76 |
continue;
|
77 |
}
|
78 |
|
@@ -88,7 +90,6 @@ function wpcf7_akismet_submitted_params() {
|
|
88 |
|
89 |
if ( $tags = wpcf7_scan_form_tags( array( 'name' => $key ) ) ) {
|
90 |
$tag = $tags[0];
|
91 |
-
$tag = new WPCF7_FormTag( $tag );
|
92 |
|
93 |
$akismet = $tag->get_option( 'akismet',
|
94 |
'(author|author_email|author_url)', true );
|
43 |
$ignore = array( 'HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW' );
|
44 |
|
45 |
foreach ( $_SERVER as $key => $value ) {
|
46 |
+
if ( ! in_array( $key, (array) $ignore ) ) {
|
47 |
$c["$key"] = $value;
|
48 |
+
}
|
49 |
}
|
50 |
|
51 |
return wpcf7_akismet_comment_check( $c );
|
68 |
'author' => '',
|
69 |
'author_email' => '',
|
70 |
'author_url' => '',
|
71 |
+
'content' => '',
|
72 |
+
);
|
73 |
|
74 |
$has_akismet_option = false;
|
75 |
|
76 |
foreach ( (array) $_POST as $key => $val ) {
|
77 |
+
if ( '_wpcf7' == substr( $key, 0, 6 ) ) {
|
78 |
continue;
|
79 |
}
|
80 |
|
90 |
|
91 |
if ( $tags = wpcf7_scan_form_tags( array( 'name' => $key ) ) ) {
|
92 |
$tag = $tags[0];
|
|
|
93 |
|
94 |
$akismet = $tag->get_option( 'akismet',
|
95 |
'(author|author_email|author_url)', true );
|
modules/checkbox.php
CHANGED
@@ -9,15 +9,16 @@ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_checkbox' );
|
|
9 |
|
10 |
function wpcf7_add_form_tag_checkbox() {
|
11 |
wpcf7_add_form_tag( array( 'checkbox', 'checkbox*', 'radio' ),
|
12 |
-
'wpcf7_checkbox_form_tag_handler',
|
|
|
13 |
'name-attr' => true,
|
14 |
'selectable-values' => true,
|
15 |
-
|
|
|
|
|
16 |
}
|
17 |
|
18 |
function wpcf7_checkbox_form_tag_handler( $tag ) {
|
19 |
-
$tag = new WPCF7_FormTag( $tag );
|
20 |
-
|
21 |
if ( empty( $tag->name ) ) {
|
22 |
return '';
|
23 |
}
|
@@ -114,17 +115,19 @@ function wpcf7_checkbox_form_tag_handler( $tag ) {
|
|
114 |
$checked = in_array( $key + 1, (array) $defaults );
|
115 |
}
|
116 |
|
117 |
-
if ( isset( $labels[$key] ) )
|
118 |
$label = $labels[$key];
|
119 |
-
else
|
120 |
$label = $value;
|
|
|
121 |
|
122 |
$item_atts = array(
|
123 |
'type' => $tag->basetype,
|
124 |
'name' => $tag->name . ( $multiple ? '[]' : '' ),
|
125 |
'value' => $value,
|
126 |
'checked' => $checked ? 'checked' : '',
|
127 |
-
'tabindex' => $tabindex ? $tabindex : ''
|
|
|
128 |
|
129 |
$item_atts = wpcf7_format_atts( $item_atts );
|
130 |
|
@@ -138,11 +141,13 @@ function wpcf7_checkbox_form_tag_handler( $tag ) {
|
|
138 |
esc_html( $label ), $item_atts );
|
139 |
}
|
140 |
|
141 |
-
if ( $use_label_element )
|
142 |
$item = '<label>' . $item . '</label>';
|
|
|
143 |
|
144 |
-
if ( false !== $tabindex )
|
145 |
$tabindex += 1;
|
|
|
146 |
|
147 |
$count += 1;
|
148 |
|
@@ -160,7 +165,8 @@ function wpcf7_checkbox_form_tag_handler( $tag ) {
|
|
160 |
$free_text_atts = array(
|
161 |
'name' => $free_text_name,
|
162 |
'class' => 'wpcf7-free-text',
|
163 |
-
'tabindex' => $tabindex ? $tabindex : ''
|
|
|
164 |
|
165 |
if ( wpcf7_is_posted() && isset( $_POST[$free_text_name] ) ) {
|
166 |
$free_text_atts['value'] = wp_unslash(
|
@@ -196,8 +202,6 @@ add_filter( 'wpcf7_validate_checkbox*', 'wpcf7_checkbox_validation_filter', 10,
|
|
196 |
add_filter( 'wpcf7_validate_radio', 'wpcf7_checkbox_validation_filter', 10, 2 );
|
197 |
|
198 |
function wpcf7_checkbox_validation_filter( $result, $tag ) {
|
199 |
-
$tag = new WPCF7_FormTag( $tag );
|
200 |
-
|
201 |
$type = $tag->type;
|
202 |
$name = $tag->name;
|
203 |
|
@@ -224,8 +228,6 @@ function wpcf7_checkbox_posted_data( $posted_data ) {
|
|
224 |
}
|
225 |
|
226 |
foreach ( $tags as $tag ) {
|
227 |
-
$tag = new WPCF7_FormTag( $tag );
|
228 |
-
|
229 |
if ( ! isset( $posted_data[$tag->name] ) ) {
|
230 |
continue;
|
231 |
}
|
9 |
|
10 |
function wpcf7_add_form_tag_checkbox() {
|
11 |
wpcf7_add_form_tag( array( 'checkbox', 'checkbox*', 'radio' ),
|
12 |
+
'wpcf7_checkbox_form_tag_handler',
|
13 |
+
array(
|
14 |
'name-attr' => true,
|
15 |
'selectable-values' => true,
|
16 |
+
'multiple-controls-container' => true,
|
17 |
+
)
|
18 |
+
);
|
19 |
}
|
20 |
|
21 |
function wpcf7_checkbox_form_tag_handler( $tag ) {
|
|
|
|
|
22 |
if ( empty( $tag->name ) ) {
|
23 |
return '';
|
24 |
}
|
115 |
$checked = in_array( $key + 1, (array) $defaults );
|
116 |
}
|
117 |
|
118 |
+
if ( isset( $labels[$key] ) ) {
|
119 |
$label = $labels[$key];
|
120 |
+
} else {
|
121 |
$label = $value;
|
122 |
+
}
|
123 |
|
124 |
$item_atts = array(
|
125 |
'type' => $tag->basetype,
|
126 |
'name' => $tag->name . ( $multiple ? '[]' : '' ),
|
127 |
'value' => $value,
|
128 |
'checked' => $checked ? 'checked' : '',
|
129 |
+
'tabindex' => $tabindex ? $tabindex : '',
|
130 |
+
);
|
131 |
|
132 |
$item_atts = wpcf7_format_atts( $item_atts );
|
133 |
|
141 |
esc_html( $label ), $item_atts );
|
142 |
}
|
143 |
|
144 |
+
if ( $use_label_element ) {
|
145 |
$item = '<label>' . $item . '</label>';
|
146 |
+
}
|
147 |
|
148 |
+
if ( false !== $tabindex ) {
|
149 |
$tabindex += 1;
|
150 |
+
}
|
151 |
|
152 |
$count += 1;
|
153 |
|
165 |
$free_text_atts = array(
|
166 |
'name' => $free_text_name,
|
167 |
'class' => 'wpcf7-free-text',
|
168 |
+
'tabindex' => $tabindex ? $tabindex : '',
|
169 |
+
);
|
170 |
|
171 |
if ( wpcf7_is_posted() && isset( $_POST[$free_text_name] ) ) {
|
172 |
$free_text_atts['value'] = wp_unslash(
|
202 |
add_filter( 'wpcf7_validate_radio', 'wpcf7_checkbox_validation_filter', 10, 2 );
|
203 |
|
204 |
function wpcf7_checkbox_validation_filter( $result, $tag ) {
|
|
|
|
|
205 |
$type = $tag->type;
|
206 |
$name = $tag->name;
|
207 |
|
228 |
}
|
229 |
|
230 |
foreach ( $tags as $tag ) {
|
|
|
|
|
231 |
if ( ! isset( $posted_data[$tag->name] ) ) {
|
232 |
continue;
|
233 |
}
|
modules/count.php
CHANGED
@@ -13,8 +13,6 @@ function wpcf7_add_form_tag_count() {
|
|
13 |
}
|
14 |
|
15 |
function wpcf7_count_form_tag_handler( $tag ) {
|
16 |
-
$tag = new WPCF7_FormTag( $tag );
|
17 |
-
|
18 |
if ( empty( $tag->name ) ) {
|
19 |
return '';
|
20 |
}
|
@@ -24,7 +22,6 @@ function wpcf7_count_form_tag_handler( $tag ) {
|
|
24 |
|
25 |
while ( $targets ) {
|
26 |
$target = array_shift( $targets );
|
27 |
-
$target = new WPCF7_FormTag( $target );
|
28 |
|
29 |
if ( 'count' != $target->type ) {
|
30 |
$maxlength = $target->get_maxlength_option();
|
13 |
}
|
14 |
|
15 |
function wpcf7_count_form_tag_handler( $tag ) {
|
|
|
|
|
16 |
if ( empty( $tag->name ) ) {
|
17 |
return '';
|
18 |
}
|
22 |
|
23 |
while ( $targets ) {
|
24 |
$target = array_shift( $targets );
|
|
|
25 |
|
26 |
if ( 'count' != $target->type ) {
|
27 |
$maxlength = $target->get_maxlength_option();
|
modules/date.php
CHANGED
@@ -14,8 +14,6 @@ function wpcf7_add_form_tag_date() {
|
|
14 |
}
|
15 |
|
16 |
function wpcf7_date_form_tag_handler( $tag ) {
|
17 |
-
$tag = new WPCF7_FormTag( $tag );
|
18 |
-
|
19 |
if ( empty( $tag->name ) ) {
|
20 |
return '';
|
21 |
}
|
@@ -86,8 +84,6 @@ add_filter( 'wpcf7_validate_date', 'wpcf7_date_validation_filter', 10, 2 );
|
|
86 |
add_filter( 'wpcf7_validate_date*', 'wpcf7_date_validation_filter', 10, 2 );
|
87 |
|
88 |
function wpcf7_date_validation_filter( $result, $tag ) {
|
89 |
-
$tag = new WPCF7_FormTag( $tag );
|
90 |
-
|
91 |
$name = $tag->name;
|
92 |
|
93 |
$min = $tag->get_date_option( 'min' );
|
@@ -130,7 +126,8 @@ function wpcf7_date_messages( $messages ) {
|
|
130 |
'date_too_late' => array(
|
131 |
'description' => __( "Date is later than maximum limit", 'contact-form-7' ),
|
132 |
'default' => __( "The date is after the latest one allowed.", 'contact-form-7' )
|
133 |
-
)
|
|
|
134 |
}
|
135 |
|
136 |
|
14 |
}
|
15 |
|
16 |
function wpcf7_date_form_tag_handler( $tag ) {
|
|
|
|
|
17 |
if ( empty( $tag->name ) ) {
|
18 |
return '';
|
19 |
}
|
84 |
add_filter( 'wpcf7_validate_date*', 'wpcf7_date_validation_filter', 10, 2 );
|
85 |
|
86 |
function wpcf7_date_validation_filter( $result, $tag ) {
|
|
|
|
|
87 |
$name = $tag->name;
|
88 |
|
89 |
$min = $tag->get_date_option( 'min' );
|
126 |
'date_too_late' => array(
|
127 |
'description' => __( "Date is later than maximum limit", 'contact-form-7' ),
|
128 |
'default' => __( "The date is after the latest one allowed.", 'contact-form-7' )
|
129 |
+
),
|
130 |
+
) );
|
131 |
}
|
132 |
|
133 |
|
modules/file.php
CHANGED
@@ -13,8 +13,6 @@ function wpcf7_add_form_tag_file() {
|
|
13 |
}
|
14 |
|
15 |
function wpcf7_file_form_tag_handler( $tag ) {
|
16 |
-
$tag = new WPCF7_FormTag( $tag );
|
17 |
-
|
18 |
if ( empty( $tag->name ) ) {
|
19 |
return '';
|
20 |
}
|
@@ -74,8 +72,6 @@ add_filter( 'wpcf7_validate_file', 'wpcf7_file_validation_filter', 10, 2 );
|
|
74 |
add_filter( 'wpcf7_validate_file*', 'wpcf7_file_validation_filter', 10, 2 );
|
75 |
|
76 |
function wpcf7_file_validation_filter( $result, $tag ) {
|
77 |
-
$tag = new WPCF7_FormTag( $tag );
|
78 |
-
|
79 |
$name = $tag->name;
|
80 |
$id = $tag->get_id_option();
|
81 |
|
13 |
}
|
14 |
|
15 |
function wpcf7_file_form_tag_handler( $tag ) {
|
|
|
|
|
16 |
if ( empty( $tag->name ) ) {
|
17 |
return '';
|
18 |
}
|
72 |
add_filter( 'wpcf7_validate_file*', 'wpcf7_file_validation_filter', 10, 2 );
|
73 |
|
74 |
function wpcf7_file_validation_filter( $result, $tag ) {
|
|
|
|
|
75 |
$name = $tag->name;
|
76 |
$id = $tag->get_id_option();
|
77 |
|
modules/flamingo.php
CHANGED
@@ -31,8 +31,8 @@ function wpcf7_flamingo_submit( $contactform, $result ) {
|
|
31 |
return;
|
32 |
}
|
33 |
|
34 |
-
$fields_senseless =
|
35 |
-
|
36 |
|
37 |
$exclude_names = array();
|
38 |
|
@@ -63,12 +63,14 @@ function wpcf7_flamingo_submit( $contactform, $result ) {
|
|
63 |
'', '_' . $smt, false );
|
64 |
}
|
65 |
|
66 |
-
$akismet = isset( $submission->akismet )
|
|
|
67 |
|
68 |
if ( 'mail_sent' == $result['status'] ) {
|
69 |
$flamingo_contact = Flamingo_Contact::add( array(
|
70 |
'email' => $email,
|
71 |
-
'name' => $name
|
|
|
72 |
}
|
73 |
|
74 |
$channel_id = wpcf7_flamingo_add_channel(
|
@@ -96,7 +98,8 @@ function wpcf7_flamingo_submit( $contactform, $result ) {
|
|
96 |
'fields' => $posted_data,
|
97 |
'meta' => $meta,
|
98 |
'akismet' => $akismet,
|
99 |
-
'spam' => ( 'spam' == $result['status'] )
|
|
|
100 |
|
101 |
$flamingo_inbound = Flamingo_Inbound_Message::add( $args );
|
102 |
|
@@ -104,7 +107,8 @@ function wpcf7_flamingo_submit( $contactform, $result ) {
|
|
104 |
'flamingo_contact_id' =>
|
105 |
empty( $flamingo_contact ) ? 0 : absint( $flamingo_contact->id ),
|
106 |
'flamingo_inbound_id' =>
|
107 |
-
empty( $flamingo_inbound ) ? 0 : absint( $flamingo_inbound->id )
|
|
|
108 |
|
109 |
do_action( 'wpcf7_after_flamingo', $result );
|
110 |
}
|
31 |
return;
|
32 |
}
|
33 |
|
34 |
+
$fields_senseless =
|
35 |
+
$contactform->scan_form_tags( array( 'feature' => 'do-not-store' ) );
|
36 |
|
37 |
$exclude_names = array();
|
38 |
|
63 |
'', '_' . $smt, false );
|
64 |
}
|
65 |
|
66 |
+
$akismet = isset( $submission->akismet )
|
67 |
+
? (array) $submission->akismet : null;
|
68 |
|
69 |
if ( 'mail_sent' == $result['status'] ) {
|
70 |
$flamingo_contact = Flamingo_Contact::add( array(
|
71 |
'email' => $email,
|
72 |
+
'name' => $name,
|
73 |
+
) );
|
74 |
}
|
75 |
|
76 |
$channel_id = wpcf7_flamingo_add_channel(
|
98 |
'fields' => $posted_data,
|
99 |
'meta' => $meta,
|
100 |
'akismet' => $akismet,
|
101 |
+
'spam' => ( 'spam' == $result['status'] ),
|
102 |
+
);
|
103 |
|
104 |
$flamingo_inbound = Flamingo_Inbound_Message::add( $args );
|
105 |
|
107 |
'flamingo_contact_id' =>
|
108 |
empty( $flamingo_contact ) ? 0 : absint( $flamingo_contact->id ),
|
109 |
'flamingo_inbound_id' =>
|
110 |
+
empty( $flamingo_inbound ) ? 0 : absint( $flamingo_inbound->id ),
|
111 |
+
);
|
112 |
|
113 |
do_action( 'wpcf7_after_flamingo', $result );
|
114 |
}
|
modules/hidden.php
CHANGED
@@ -4,12 +4,15 @@ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_hidden' );
|
|
4 |
|
5 |
function wpcf7_add_form_tag_hidden() {
|
6 |
wpcf7_add_form_tag( 'hidden',
|
7 |
-
'wpcf7_hidden_form_tag_handler',
|
|
|
|
|
|
|
|
|
|
|
8 |
}
|
9 |
|
10 |
function wpcf7_hidden_form_tag_handler( $tag ) {
|
11 |
-
$tag = new WPCF7_FormTag( $tag );
|
12 |
-
|
13 |
if ( empty( $tag->name ) ) {
|
14 |
return '';
|
15 |
}
|
4 |
|
5 |
function wpcf7_add_form_tag_hidden() {
|
6 |
wpcf7_add_form_tag( 'hidden',
|
7 |
+
'wpcf7_hidden_form_tag_handler',
|
8 |
+
array(
|
9 |
+
'name-attr' => true,
|
10 |
+
'display-hidden' => true,
|
11 |
+
)
|
12 |
+
);
|
13 |
}
|
14 |
|
15 |
function wpcf7_hidden_form_tag_handler( $tag ) {
|
|
|
|
|
16 |
if ( empty( $tag->name ) ) {
|
17 |
return '';
|
18 |
}
|
modules/number.php
CHANGED
@@ -15,8 +15,6 @@ function wpcf7_add_form_tag_number() {
|
|
15 |
}
|
16 |
|
17 |
function wpcf7_number_form_tag_handler( $tag ) {
|
18 |
-
$tag = new WPCF7_FormTag( $tag );
|
19 |
-
|
20 |
if ( empty( $tag->name ) ) {
|
21 |
return '';
|
22 |
}
|
@@ -89,8 +87,6 @@ add_filter( 'wpcf7_validate_range', 'wpcf7_number_validation_filter', 10, 2 );
|
|
89 |
add_filter( 'wpcf7_validate_range*', 'wpcf7_number_validation_filter', 10, 2 );
|
90 |
|
91 |
function wpcf7_number_validation_filter( $result, $tag ) {
|
92 |
-
$tag = new WPCF7_FormTag( $tag );
|
93 |
-
|
94 |
$name = $tag->name;
|
95 |
|
96 |
$value = isset( $_POST[$name] )
|
@@ -133,7 +129,8 @@ function wpcf7_number_messages( $messages ) {
|
|
133 |
'number_too_large' => array(
|
134 |
'description' => __( "Number is larger than maximum limit", 'contact-form-7' ),
|
135 |
'default' => __( "The number is larger than the maximum allowed.", 'contact-form-7' )
|
136 |
-
)
|
|
|
137 |
}
|
138 |
|
139 |
|
15 |
}
|
16 |
|
17 |
function wpcf7_number_form_tag_handler( $tag ) {
|
|
|
|
|
18 |
if ( empty( $tag->name ) ) {
|
19 |
return '';
|
20 |
}
|
87 |
add_filter( 'wpcf7_validate_range*', 'wpcf7_number_validation_filter', 10, 2 );
|
88 |
|
89 |
function wpcf7_number_validation_filter( $result, $tag ) {
|
|
|
|
|
90 |
$name = $tag->name;
|
91 |
|
92 |
$value = isset( $_POST[$name] )
|
129 |
'number_too_large' => array(
|
130 |
'description' => __( "Number is larger than maximum limit", 'contact-form-7' ),
|
131 |
'default' => __( "The number is larger than the maximum allowed.", 'contact-form-7' )
|
132 |
+
),
|
133 |
+
) );
|
134 |
}
|
135 |
|
136 |
|
modules/quiz.php
CHANGED
@@ -9,12 +9,15 @@ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_quiz' );
|
|
9 |
|
10 |
function wpcf7_add_form_tag_quiz() {
|
11 |
wpcf7_add_form_tag( 'quiz',
|
12 |
-
'wpcf7_quiz_form_tag_handler',
|
|
|
|
|
|
|
|
|
|
|
13 |
}
|
14 |
|
15 |
function wpcf7_quiz_form_tag_handler( $tag ) {
|
16 |
-
$tag = new WPCF7_FormTag( $tag );
|
17 |
-
|
18 |
if ( empty( $tag->name ) ) {
|
19 |
return '';
|
20 |
}
|
@@ -78,8 +81,6 @@ function wpcf7_quiz_form_tag_handler( $tag ) {
|
|
78 |
add_filter( 'wpcf7_validate_quiz', 'wpcf7_quiz_validation_filter', 10, 2 );
|
79 |
|
80 |
function wpcf7_quiz_validation_filter( $result, $tag ) {
|
81 |
-
$tag = new WPCF7_FormTag( $tag );
|
82 |
-
|
83 |
$name = $tag->name;
|
84 |
|
85 |
$answer = isset( $_POST[$name] ) ? wpcf7_canonicalize( $_POST[$name] ) : '';
|
@@ -105,13 +106,15 @@ add_filter( 'wpcf7_ajax_onload', 'wpcf7_quiz_ajax_refill' );
|
|
105 |
add_filter( 'wpcf7_ajax_json_echo', 'wpcf7_quiz_ajax_refill' );
|
106 |
|
107 |
function wpcf7_quiz_ajax_refill( $items ) {
|
108 |
-
if ( ! is_array( $items ) )
|
109 |
return $items;
|
|
|
110 |
|
111 |
$fes = wpcf7_scan_form_tags( array( 'type' => 'quiz' ) );
|
112 |
|
113 |
-
if ( empty( $fes ) )
|
114 |
return $items;
|
|
|
115 |
|
116 |
$refill = array();
|
117 |
|
@@ -119,8 +122,9 @@ function wpcf7_quiz_ajax_refill( $items ) {
|
|
119 |
$name = $fe['name'];
|
120 |
$pipes = $fe['pipes'];
|
121 |
|
122 |
-
if ( empty( $name ) )
|
123 |
continue;
|
|
|
124 |
|
125 |
if ( $pipes instanceof WPCF7_Pipes && ! $pipes->zero() ) {
|
126 |
$pipe = $pipes->random_pipe();
|
@@ -137,8 +141,9 @@ function wpcf7_quiz_ajax_refill( $items ) {
|
|
137 |
$refill[$name] = array( $question, wp_hash( $answer, 'wpcf7_quiz' ) );
|
138 |
}
|
139 |
|
140 |
-
if ( ! empty( $refill ) )
|
141 |
$items['quiz'] = $refill;
|
|
|
142 |
|
143 |
return $items;
|
144 |
}
|
@@ -149,10 +154,16 @@ function wpcf7_quiz_ajax_refill( $items ) {
|
|
149 |
add_filter( 'wpcf7_messages', 'wpcf7_quiz_messages' );
|
150 |
|
151 |
function wpcf7_quiz_messages( $messages ) {
|
152 |
-
|
153 |
-
'
|
154 |
-
|
155 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
}
|
157 |
|
158 |
|
9 |
|
10 |
function wpcf7_add_form_tag_quiz() {
|
11 |
wpcf7_add_form_tag( 'quiz',
|
12 |
+
'wpcf7_quiz_form_tag_handler',
|
13 |
+
array(
|
14 |
+
'name-attr' => true,
|
15 |
+
'do-not-store' => true,
|
16 |
+
)
|
17 |
+
);
|
18 |
}
|
19 |
|
20 |
function wpcf7_quiz_form_tag_handler( $tag ) {
|
|
|
|
|
21 |
if ( empty( $tag->name ) ) {
|
22 |
return '';
|
23 |
}
|
81 |
add_filter( 'wpcf7_validate_quiz', 'wpcf7_quiz_validation_filter', 10, 2 );
|
82 |
|
83 |
function wpcf7_quiz_validation_filter( $result, $tag ) {
|
|
|
|
|
84 |
$name = $tag->name;
|
85 |
|
86 |
$answer = isset( $_POST[$name] ) ? wpcf7_canonicalize( $_POST[$name] ) : '';
|
106 |
add_filter( 'wpcf7_ajax_json_echo', 'wpcf7_quiz_ajax_refill' );
|
107 |
|
108 |
function wpcf7_quiz_ajax_refill( $items ) {
|
109 |
+
if ( ! is_array( $items ) ) {
|
110 |
return $items;
|
111 |
+
}
|
112 |
|
113 |
$fes = wpcf7_scan_form_tags( array( 'type' => 'quiz' ) );
|
114 |
|
115 |
+
if ( empty( $fes ) ) {
|
116 |
return $items;
|
117 |
+
}
|
118 |
|
119 |
$refill = array();
|
120 |
|
122 |
$name = $fe['name'];
|
123 |
$pipes = $fe['pipes'];
|
124 |
|
125 |
+
if ( empty( $name ) ) {
|
126 |
continue;
|
127 |
+
}
|
128 |
|
129 |
if ( $pipes instanceof WPCF7_Pipes && ! $pipes->zero() ) {
|
130 |
$pipe = $pipes->random_pipe();
|
141 |
$refill[$name] = array( $question, wp_hash( $answer, 'wpcf7_quiz' ) );
|
142 |
}
|
143 |
|
144 |
+
if ( ! empty( $refill ) ) {
|
145 |
$items['quiz'] = $refill;
|
146 |
+
}
|
147 |
|
148 |
return $items;
|
149 |
}
|
154 |
add_filter( 'wpcf7_messages', 'wpcf7_quiz_messages' );
|
155 |
|
156 |
function wpcf7_quiz_messages( $messages ) {
|
157 |
+
$messages = array_merge( $messages, array(
|
158 |
+
'quiz_answer_not_correct' => array(
|
159 |
+
'description' =>
|
160 |
+
__( "Sender doesn't enter the correct answer to the quiz", 'contact-form-7' ),
|
161 |
+
'default' =>
|
162 |
+
__( "The answer to the quiz is incorrect.", 'contact-form-7' ),
|
163 |
+
),
|
164 |
+
) );
|
165 |
+
|
166 |
+
return $messages;
|
167 |
}
|
168 |
|
169 |
|
modules/really-simple-captcha.php
CHANGED
@@ -8,114 +8,132 @@
|
|
8 |
add_action( 'wpcf7_init', 'wpcf7_add_form_tag_captcha' );
|
9 |
|
10 |
function wpcf7_add_form_tag_captcha() {
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
}
|
14 |
|
15 |
-
function
|
16 |
-
|
|
|
|
|
|
|
17 |
|
18 |
-
|
19 |
-
return '<em>' . __( 'To use CAPTCHA, you need <a href="http://wordpress.org/extend/plugins/really-simple-captcha/">Really Simple CAPTCHA</a> plugin installed.', 'contact-form-7' ) . '</em>';
|
20 |
}
|
21 |
|
22 |
if ( empty( $tag->name ) ) {
|
23 |
return '';
|
24 |
}
|
25 |
|
26 |
-
$validation_error = wpcf7_get_validation_error( $tag->name );
|
27 |
-
|
28 |
$class = wpcf7_form_controls_class( $tag->type );
|
|
|
29 |
|
30 |
-
|
31 |
-
|
|
|
32 |
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
-
|
36 |
-
$atts['id'] = $tag->get_id_option();
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
'font_size' => 14,
|
42 |
-
'font_char_width' => 15 );
|
43 |
|
44 |
-
|
|
|
|
|
|
|
45 |
|
46 |
-
if (
|
47 |
-
|
48 |
}
|
|
|
49 |
|
50 |
-
|
51 |
-
|
52 |
-
$atts['width'] = $op['img_size'][0];
|
53 |
-
}
|
54 |
|
55 |
-
|
56 |
-
$atts['height'] = $op['img_size'][1];
|
57 |
-
}
|
58 |
-
}
|
59 |
|
60 |
-
|
61 |
-
$atts['src'] = wpcf7_captcha_url( $filename );
|
62 |
|
63 |
-
|
|
|
|
|
64 |
|
65 |
-
|
|
|
66 |
|
67 |
-
|
68 |
-
|
69 |
-
|
|
|
70 |
|
71 |
-
|
72 |
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
|
|
77 |
|
78 |
-
|
79 |
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
|
95 |
-
|
96 |
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
|
111 |
-
|
112 |
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
|
117 |
-
|
118 |
-
}
|
119 |
}
|
120 |
|
121 |
|
@@ -124,8 +142,6 @@ function wpcf7_captcha_form_tag_handler( $tag ) {
|
|
124 |
add_filter( 'wpcf7_validate_captchar', 'wpcf7_captcha_validation_filter', 10, 2 );
|
125 |
|
126 |
function wpcf7_captcha_validation_filter( $result, $tag ) {
|
127 |
-
$tag = new WPCF7_FormTag( $tag );
|
128 |
-
|
129 |
$type = $tag->type;
|
130 |
$name = $tag->name;
|
131 |
|
@@ -153,13 +169,15 @@ add_filter( 'wpcf7_ajax_onload', 'wpcf7_captcha_ajax_refill' );
|
|
153 |
add_filter( 'wpcf7_ajax_json_echo', 'wpcf7_captcha_ajax_refill' );
|
154 |
|
155 |
function wpcf7_captcha_ajax_refill( $items ) {
|
156 |
-
if ( ! is_array( $items ) )
|
157 |
return $items;
|
|
|
158 |
|
159 |
$fes = wpcf7_scan_form_tags( array( 'type' => 'captchac' ) );
|
160 |
|
161 |
-
if ( empty( $fes ) )
|
162 |
return $items;
|
|
|
163 |
|
164 |
$refill = array();
|
165 |
|
@@ -167,8 +185,9 @@ function wpcf7_captcha_ajax_refill( $items ) {
|
|
167 |
$name = $fe['name'];
|
168 |
$options = $fe['options'];
|
169 |
|
170 |
-
if ( empty( $name ) )
|
171 |
continue;
|
|
|
172 |
|
173 |
$op = wpcf7_captchac_options( $options );
|
174 |
if ( $filename = wpcf7_generate_captcha( $op ) ) {
|
@@ -177,8 +196,9 @@ function wpcf7_captcha_ajax_refill( $items ) {
|
|
177 |
}
|
178 |
}
|
179 |
|
180 |
-
if ( ! empty( $refill ) )
|
181 |
$items['captcha'] = $refill;
|
|
|
182 |
|
183 |
return $items;
|
184 |
}
|
@@ -189,10 +209,16 @@ function wpcf7_captcha_ajax_refill( $items ) {
|
|
189 |
add_filter( 'wpcf7_messages', 'wpcf7_captcha_messages' );
|
190 |
|
191 |
function wpcf7_captcha_messages( $messages ) {
|
192 |
-
|
193 |
-
'
|
194 |
-
|
195 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
}
|
197 |
|
198 |
|
@@ -218,7 +244,7 @@ function wpcf7_tag_generator_captcha( $contact_form, $args = '' ) {
|
|
218 |
?>
|
219 |
<div class="control-box">
|
220 |
<fieldset>
|
221 |
-
<legend><?php echo sprintf( esc_html( __( "To use CAPTCHA, you first need to install and activate %s plugin.", 'contact-form-7' ) ), wpcf7_link( '
|
222 |
</fieldset>
|
223 |
</div>
|
224 |
<?php
|
@@ -376,17 +402,19 @@ function wpcf7_init_captcha() {
|
|
376 |
}
|
377 |
|
378 |
function wpcf7_captcha_tmp_dir() {
|
379 |
-
if ( defined( 'WPCF7_CAPTCHA_TMP_DIR' ) )
|
380 |
return WPCF7_CAPTCHA_TMP_DIR;
|
381 |
-
else
|
382 |
return wpcf7_upload_dir( 'dir' ) . '/wpcf7_captcha';
|
|
|
383 |
}
|
384 |
|
385 |
function wpcf7_captcha_tmp_url() {
|
386 |
-
if ( defined( 'WPCF7_CAPTCHA_TMP_URL' ) )
|
387 |
return WPCF7_CAPTCHA_TMP_URL;
|
388 |
-
else
|
389 |
return wpcf7_upload_dir( 'url' ) . '/wpcf7_captcha';
|
|
|
390 |
}
|
391 |
|
392 |
function wpcf7_captcha_url( $filename ) {
|
@@ -404,32 +432,47 @@ function wpcf7_generate_captcha( $options = null ) {
|
|
404 |
return false;
|
405 |
}
|
406 |
|
407 |
-
if ( ! is_dir( $captcha->tmp_dir )
|
|
|
408 |
return false;
|
|
|
409 |
|
410 |
$img_type = imagetypes();
|
411 |
-
|
|
|
412 |
$captcha->img_type = 'png';
|
413 |
-
elseif ( $img_type & IMG_GIF )
|
414 |
$captcha->img_type = 'gif';
|
415 |
-
elseif ( $img_type & IMG_JPG )
|
416 |
$captcha->img_type = 'jpeg';
|
417 |
-
else
|
418 |
return false;
|
|
|
419 |
|
420 |
if ( is_array( $options ) ) {
|
421 |
-
if ( isset( $options['img_size'] ) )
|
422 |
$captcha->img_size = $options['img_size'];
|
423 |
-
|
|
|
|
|
424 |
$captcha->base = $options['base'];
|
425 |
-
|
|
|
|
|
426 |
$captcha->font_size = $options['font_size'];
|
427 |
-
|
|
|
|
|
428 |
$captcha->font_char_width = $options['font_char_width'];
|
429 |
-
|
|
|
|
|
430 |
$captcha->fg = $options['fg'];
|
431 |
-
|
|
|
|
|
432 |
$captcha->bg = $options['bg'];
|
|
|
433 |
}
|
434 |
|
435 |
$prefix = wp_rand();
|
@@ -450,8 +493,10 @@ function wpcf7_remove_captcha( $prefix ) {
|
|
450 |
return false;
|
451 |
}
|
452 |
|
453 |
-
|
|
|
454 |
return false;
|
|
|
455 |
|
456 |
$captcha->remove( $prefix );
|
457 |
}
|
@@ -463,36 +508,44 @@ function wpcf7_cleanup_captcha_files() {
|
|
463 |
return false;
|
464 |
}
|
465 |
|
466 |
-
if ( is_callable( array( $captcha, 'cleanup' ) ) )
|
467 |
return $captcha->cleanup();
|
|
|
468 |
|
469 |
$dir = trailingslashit( wpcf7_captcha_tmp_dir() );
|
470 |
|
471 |
-
if ( ! is_dir( $dir ) || ! is_readable( $dir ) || ! wp_is_writable( $dir ) )
|
472 |
return false;
|
|
|
473 |
|
474 |
if ( $handle = @opendir( $dir ) ) {
|
475 |
while ( false !== ( $file = readdir( $handle ) ) ) {
|
476 |
-
if ( ! preg_match( '/^[0-9]+\.(php|txt|png|gif|jpeg)$/', $file ) )
|
477 |
continue;
|
|
|
478 |
|
479 |
$stat = @stat( $dir . $file );
|
480 |
-
|
|
|
481 |
@unlink( $dir . $file );
|
|
|
482 |
}
|
|
|
483 |
closedir( $handle );
|
484 |
}
|
485 |
}
|
486 |
|
487 |
function wpcf7_captchac_options( $options ) {
|
488 |
-
if ( ! is_array( $options ) )
|
489 |
return array();
|
|
|
490 |
|
491 |
$op = array();
|
492 |
$image_size_array = preg_grep( '%^size:[smlSML]$%', $options );
|
493 |
|
494 |
if ( $image_size = array_shift( $image_size_array ) ) {
|
495 |
preg_match( '%^size:([smlSML])$%', $image_size, $is_matches );
|
|
|
496 |
switch ( strtolower( $is_matches[1] ) ) {
|
497 |
case 's':
|
498 |
$op['img_size'] = array( 60, 20 );
|
@@ -515,9 +568,13 @@ function wpcf7_captchac_options( $options ) {
|
|
515 |
}
|
516 |
}
|
517 |
|
518 |
-
$fg_color_array = preg_grep(
|
|
|
|
|
519 |
if ( $fg_color = array_shift( $fg_color_array ) ) {
|
520 |
-
preg_match( '%^fg:#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$%',
|
|
|
|
|
521 |
if ( 3 == strlen( $fc_matches[1] ) ) {
|
522 |
$r = substr( $fc_matches[1], 0, 1 );
|
523 |
$g = substr( $fc_matches[1], 1, 1 );
|
@@ -531,9 +588,13 @@ function wpcf7_captchac_options( $options ) {
|
|
531 |
}
|
532 |
}
|
533 |
|
534 |
-
$bg_color_array = preg_grep(
|
|
|
|
|
535 |
if ( $bg_color = array_shift( $bg_color_array ) ) {
|
536 |
-
preg_match( '%^bg:#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$%',
|
|
|
|
|
537 |
if ( 3 == strlen( $bc_matches[1] ) ) {
|
538 |
$r = substr( $bc_matches[1], 0, 1 );
|
539 |
$g = substr( $bc_matches[1], 1, 1 );
|
8 |
add_action( 'wpcf7_init', 'wpcf7_add_form_tag_captcha' );
|
9 |
|
10 |
function wpcf7_add_form_tag_captcha() {
|
11 |
+
// CAPTCHA-Challenge (image)
|
12 |
+
wpcf7_add_form_tag( 'captchac',
|
13 |
+
'wpcf7_captchac_form_tag_handler',
|
14 |
+
array( 'name-attr' => true )
|
15 |
+
);
|
16 |
+
|
17 |
+
// CAPTCHA-Response (input)
|
18 |
+
wpcf7_add_form_tag( 'captchar',
|
19 |
+
'wpcf7_captchar_form_tag_handler',
|
20 |
+
array(
|
21 |
+
'name-attr' => true,
|
22 |
+
'do-not-store' => true,
|
23 |
+
)
|
24 |
+
);
|
25 |
}
|
26 |
|
27 |
+
function wpcf7_captchac_form_tag_handler( $tag ) {
|
28 |
+
if ( ! class_exists( 'ReallySimpleCaptcha' ) ) {
|
29 |
+
$error = sprintf(
|
30 |
+
esc_html( __( "To use CAPTCHA, you need %s plugin installed.", 'contact-form-7' ) ),
|
31 |
+
wpcf7_link( 'https://wordpress.org/plugins/really-simple-captcha/', 'Really Simple CAPTCHA' ) );
|
32 |
|
33 |
+
return sprintf( '<em>%s</em>', $error );
|
|
|
34 |
}
|
35 |
|
36 |
if ( empty( $tag->name ) ) {
|
37 |
return '';
|
38 |
}
|
39 |
|
|
|
|
|
40 |
$class = wpcf7_form_controls_class( $tag->type );
|
41 |
+
$class .= ' wpcf7-captcha-' . $tag->name;
|
42 |
|
43 |
+
$atts = array();
|
44 |
+
$atts['class'] = $tag->get_class_option( $class );
|
45 |
+
$atts['id'] = $tag->get_id_option();
|
46 |
|
47 |
+
$op = array( // Default
|
48 |
+
'img_size' => array( 72, 24 ),
|
49 |
+
'base' => array( 6, 18 ),
|
50 |
+
'font_size' => 14,
|
51 |
+
'font_char_width' => 15,
|
52 |
+
);
|
53 |
|
54 |
+
$op = array_merge( $op, wpcf7_captchac_options( $tag->options ) );
|
|
|
55 |
|
56 |
+
if ( ! $filename = wpcf7_generate_captcha( $op ) ) {
|
57 |
+
return '';
|
58 |
+
}
|
|
|
|
|
59 |
|
60 |
+
if ( ! empty( $op['img_size'] ) ) {
|
61 |
+
if ( isset( $op['img_size'][0] ) ) {
|
62 |
+
$atts['width'] = $op['img_size'][0];
|
63 |
+
}
|
64 |
|
65 |
+
if ( isset( $op['img_size'][1] ) ) {
|
66 |
+
$atts['height'] = $op['img_size'][1];
|
67 |
}
|
68 |
+
}
|
69 |
|
70 |
+
$atts['alt'] = 'captcha';
|
71 |
+
$atts['src'] = wpcf7_captcha_url( $filename );
|
|
|
|
|
72 |
|
73 |
+
$atts = wpcf7_format_atts( $atts );
|
|
|
|
|
|
|
74 |
|
75 |
+
$prefix = substr( $filename, 0, strrpos( $filename, '.' ) );
|
|
|
76 |
|
77 |
+
$html = sprintf(
|
78 |
+
'<input type="hidden" name="_wpcf7_captcha_challenge_%1$s" value="%2$s" /><img %3$s />',
|
79 |
+
$tag->name, $prefix, $atts );
|
80 |
|
81 |
+
return $html;
|
82 |
+
}
|
83 |
|
84 |
+
function wpcf7_captchar_form_tag_handler( $tag ) {
|
85 |
+
if ( empty( $tag->name ) ) {
|
86 |
+
return '';
|
87 |
+
}
|
88 |
|
89 |
+
$validation_error = wpcf7_get_validation_error( $tag->name );
|
90 |
|
91 |
+
$class = wpcf7_form_controls_class( $tag->type );
|
92 |
+
|
93 |
+
if ( $validation_error ) {
|
94 |
+
$class .= ' wpcf7-not-valid';
|
95 |
+
}
|
96 |
|
97 |
+
$atts = array();
|
98 |
|
99 |
+
$atts['size'] = $tag->get_size_option( '40' );
|
100 |
+
$atts['maxlength'] = $tag->get_maxlength_option();
|
101 |
+
$atts['minlength'] = $tag->get_minlength_option();
|
102 |
|
103 |
+
if ( $atts['maxlength'] && $atts['minlength']
|
104 |
+
&& $atts['maxlength'] < $atts['minlength'] ) {
|
105 |
+
unset( $atts['maxlength'], $atts['minlength'] );
|
106 |
+
}
|
107 |
|
108 |
+
$atts['class'] = $tag->get_class_option( $class );
|
109 |
+
$atts['id'] = $tag->get_id_option();
|
110 |
+
$atts['tabindex'] = $tag->get_option( 'tabindex', 'int', true );
|
111 |
+
$atts['autocomplete'] = 'off';
|
112 |
+
$atts['aria-invalid'] = $validation_error ? 'true' : 'false';
|
113 |
|
114 |
+
$value = (string) reset( $tag->values );
|
115 |
|
116 |
+
if ( wpcf7_is_posted() ) {
|
117 |
+
$value = '';
|
118 |
+
}
|
119 |
|
120 |
+
if ( $tag->has_option( 'placeholder' )
|
121 |
+
|| $tag->has_option( 'watermark' ) ) {
|
122 |
+
$atts['placeholder'] = $value;
|
123 |
+
$value = '';
|
124 |
+
}
|
125 |
|
126 |
+
$atts['value'] = $value;
|
127 |
+
$atts['type'] = 'text';
|
128 |
+
$atts['name'] = $tag->name;
|
129 |
|
130 |
+
$atts = wpcf7_format_atts( $atts );
|
131 |
|
132 |
+
$html = sprintf(
|
133 |
+
'<span class="wpcf7-form-control-wrap %1$s"><input %2$s />%3$s</span>',
|
134 |
+
sanitize_html_class( $tag->name ), $atts, $validation_error );
|
135 |
|
136 |
+
return $html;
|
|
|
137 |
}
|
138 |
|
139 |
|
142 |
add_filter( 'wpcf7_validate_captchar', 'wpcf7_captcha_validation_filter', 10, 2 );
|
143 |
|
144 |
function wpcf7_captcha_validation_filter( $result, $tag ) {
|
|
|
|
|
145 |
$type = $tag->type;
|
146 |
$name = $tag->name;
|
147 |
|
169 |
add_filter( 'wpcf7_ajax_json_echo', 'wpcf7_captcha_ajax_refill' );
|
170 |
|
171 |
function wpcf7_captcha_ajax_refill( $items ) {
|
172 |
+
if ( ! is_array( $items ) ) {
|
173 |
return $items;
|
174 |
+
}
|
175 |
|
176 |
$fes = wpcf7_scan_form_tags( array( 'type' => 'captchac' ) );
|
177 |
|
178 |
+
if ( empty( $fes ) ) {
|
179 |
return $items;
|
180 |
+
}
|
181 |
|
182 |
$refill = array();
|
183 |
|
185 |
$name = $fe['name'];
|
186 |
$options = $fe['options'];
|
187 |
|
188 |
+
if ( empty( $name ) ) {
|
189 |
continue;
|
190 |
+
}
|
191 |
|
192 |
$op = wpcf7_captchac_options( $options );
|
193 |
if ( $filename = wpcf7_generate_captcha( $op ) ) {
|
196 |
}
|
197 |
}
|
198 |
|
199 |
+
if ( ! empty( $refill ) ) {
|
200 |
$items['captcha'] = $refill;
|
201 |
+
}
|
202 |
|
203 |
return $items;
|
204 |
}
|
209 |
add_filter( 'wpcf7_messages', 'wpcf7_captcha_messages' );
|
210 |
|
211 |
function wpcf7_captcha_messages( $messages ) {
|
212 |
+
$messages = array_merge( $messages, array(
|
213 |
+
'captcha_not_match' => array(
|
214 |
+
'description' =>
|
215 |
+
__( "The code that sender entered does not match the CAPTCHA", 'contact-form-7' ),
|
216 |
+
'default' =>
|
217 |
+
__( 'Your entered code is incorrect.', 'contact-form-7' ),
|
218 |
+
),
|
219 |
+
) );
|
220 |
+
|
221 |
+
return $messages;
|
222 |
}
|
223 |
|
224 |
|
244 |
?>
|
245 |
<div class="control-box">
|
246 |
<fieldset>
|
247 |
+
<legend><?php echo sprintf( esc_html( __( "To use CAPTCHA, you first need to install and activate %s plugin.", 'contact-form-7' ) ), wpcf7_link( 'https://wordpress.org/plugins/really-simple-captcha/', 'Really Simple CAPTCHA' ) ); ?></legend>
|
248 |
</fieldset>
|
249 |
</div>
|
250 |
<?php
|
402 |
}
|
403 |
|
404 |
function wpcf7_captcha_tmp_dir() {
|
405 |
+
if ( defined( 'WPCF7_CAPTCHA_TMP_DIR' ) ) {
|
406 |
return WPCF7_CAPTCHA_TMP_DIR;
|
407 |
+
} else {
|
408 |
return wpcf7_upload_dir( 'dir' ) . '/wpcf7_captcha';
|
409 |
+
}
|
410 |
}
|
411 |
|
412 |
function wpcf7_captcha_tmp_url() {
|
413 |
+
if ( defined( 'WPCF7_CAPTCHA_TMP_URL' ) ) {
|
414 |
return WPCF7_CAPTCHA_TMP_URL;
|
415 |
+
} else {
|
416 |
return wpcf7_upload_dir( 'url' ) . '/wpcf7_captcha';
|
417 |
+
}
|
418 |
}
|
419 |
|
420 |
function wpcf7_captcha_url( $filename ) {
|
432 |
return false;
|
433 |
}
|
434 |
|
435 |
+
if ( ! is_dir( $captcha->tmp_dir )
|
436 |
+
|| ! wp_is_writable( $captcha->tmp_dir ) ) {
|
437 |
return false;
|
438 |
+
}
|
439 |
|
440 |
$img_type = imagetypes();
|
441 |
+
|
442 |
+
if ( $img_type & IMG_PNG ) {
|
443 |
$captcha->img_type = 'png';
|
444 |
+
} elseif ( $img_type & IMG_GIF ) {
|
445 |
$captcha->img_type = 'gif';
|
446 |
+
} elseif ( $img_type & IMG_JPG ) {
|
447 |
$captcha->img_type = 'jpeg';
|
448 |
+
} else {
|
449 |
return false;
|
450 |
+
}
|
451 |
|
452 |
if ( is_array( $options ) ) {
|
453 |
+
if ( isset( $options['img_size'] ) ) {
|
454 |
$captcha->img_size = $options['img_size'];
|
455 |
+
}
|
456 |
+
|
457 |
+
if ( isset( $options['base'] ) ) {
|
458 |
$captcha->base = $options['base'];
|
459 |
+
}
|
460 |
+
|
461 |
+
if ( isset( $options['font_size'] ) ) {
|
462 |
$captcha->font_size = $options['font_size'];
|
463 |
+
}
|
464 |
+
|
465 |
+
if ( isset( $options['font_char_width'] ) ) {
|
466 |
$captcha->font_char_width = $options['font_char_width'];
|
467 |
+
}
|
468 |
+
|
469 |
+
if ( isset( $options['fg'] ) ) {
|
470 |
$captcha->fg = $options['fg'];
|
471 |
+
}
|
472 |
+
|
473 |
+
if ( isset( $options['bg'] ) ) {
|
474 |
$captcha->bg = $options['bg'];
|
475 |
+
}
|
476 |
}
|
477 |
|
478 |
$prefix = wp_rand();
|
493 |
return false;
|
494 |
}
|
495 |
|
496 |
+
// Contact Form 7 generates $prefix with wp_rand()
|
497 |
+
if ( preg_match( '/[^0-9]/', $prefix ) ) {
|
498 |
return false;
|
499 |
+
}
|
500 |
|
501 |
$captcha->remove( $prefix );
|
502 |
}
|
508 |
return false;
|
509 |
}
|
510 |
|
511 |
+
if ( is_callable( array( $captcha, 'cleanup' ) ) ) {
|
512 |
return $captcha->cleanup();
|
513 |
+
}
|
514 |
|
515 |
$dir = trailingslashit( wpcf7_captcha_tmp_dir() );
|
516 |
|
517 |
+
if ( ! is_dir( $dir ) || ! is_readable( $dir ) || ! wp_is_writable( $dir ) ) {
|
518 |
return false;
|
519 |
+
}
|
520 |
|
521 |
if ( $handle = @opendir( $dir ) ) {
|
522 |
while ( false !== ( $file = readdir( $handle ) ) ) {
|
523 |
+
if ( ! preg_match( '/^[0-9]+\.(php|txt|png|gif|jpeg)$/', $file ) ) {
|
524 |
continue;
|
525 |
+
}
|
526 |
|
527 |
$stat = @stat( $dir . $file );
|
528 |
+
|
529 |
+
if ( $stat['mtime'] + 3600 < time() ) { // 3600 secs == 1 hour
|
530 |
@unlink( $dir . $file );
|
531 |
+
}
|
532 |
}
|
533 |
+
|
534 |
closedir( $handle );
|
535 |
}
|
536 |
}
|
537 |
|
538 |
function wpcf7_captchac_options( $options ) {
|
539 |
+
if ( ! is_array( $options ) ) {
|
540 |
return array();
|
541 |
+
}
|
542 |
|
543 |
$op = array();
|
544 |
$image_size_array = preg_grep( '%^size:[smlSML]$%', $options );
|
545 |
|
546 |
if ( $image_size = array_shift( $image_size_array ) ) {
|
547 |
preg_match( '%^size:([smlSML])$%', $image_size, $is_matches );
|
548 |
+
|
549 |
switch ( strtolower( $is_matches[1] ) ) {
|
550 |
case 's':
|
551 |
$op['img_size'] = array( 60, 20 );
|
568 |
}
|
569 |
}
|
570 |
|
571 |
+
$fg_color_array = preg_grep(
|
572 |
+
'%^fg:#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$%', $options );
|
573 |
+
|
574 |
if ( $fg_color = array_shift( $fg_color_array ) ) {
|
575 |
+
preg_match( '%^fg:#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$%',
|
576 |
+
$fg_color, $fc_matches );
|
577 |
+
|
578 |
if ( 3 == strlen( $fc_matches[1] ) ) {
|
579 |
$r = substr( $fc_matches[1], 0, 1 );
|
580 |
$g = substr( $fc_matches[1], 1, 1 );
|
588 |
}
|
589 |
}
|
590 |
|
591 |
+
$bg_color_array = preg_grep(
|
592 |
+
'%^bg:#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$%', $options );
|
593 |
+
|
594 |
if ( $bg_color = array_shift( $bg_color_array ) ) {
|
595 |
+
preg_match( '%^bg:#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$%',
|
596 |
+
$bg_color, $bc_matches );
|
597 |
+
|
598 |
if ( 3 == strlen( $bc_matches[1] ) ) {
|
599 |
$r = substr( $bc_matches[1], 0, 1 );
|
600 |
$g = substr( $bc_matches[1], 1, 1 );
|
modules/recaptcha.php
CHANGED
@@ -77,7 +77,9 @@ class WPCF7_RECAPTCHA extends WPCF7_Service {
|
|
77 |
'body' => array(
|
78 |
'secret' => $secret,
|
79 |
'response' => $response_token,
|
80 |
-
'remoteip' => $_SERVER['REMOTE_ADDR']
|
|
|
|
|
81 |
|
82 |
if ( 200 != wp_remote_retrieve_response_code( $response ) ) {
|
83 |
return $is_human;
|
@@ -114,15 +116,18 @@ class WPCF7_RECAPTCHA extends WPCF7_Service {
|
|
114 |
if ( $sitekey && $secret ) {
|
115 |
WPCF7::update_option( 'recaptcha', array( $sitekey => $secret ) );
|
116 |
$redirect_to = $this->menu_page_url( array(
|
117 |
-
'message' => 'success'
|
|
|
118 |
} elseif ( '' === $sitekey && '' === $secret ) {
|
119 |
WPCF7::update_option( 'recaptcha', null );
|
120 |
$redirect_to = $this->menu_page_url( array(
|
121 |
-
'message' => 'success'
|
|
|
122 |
} else {
|
123 |
$redirect_to = $this->menu_page_url( array(
|
124 |
'action' => 'setup',
|
125 |
-
'message' => 'invalid'
|
|
|
126 |
}
|
127 |
|
128 |
wp_safe_redirect( $redirect_to );
|
@@ -215,14 +220,16 @@ function wpcf7_recaptcha_register_service() {
|
|
215 |
$integration = WPCF7_Integration::get_instance();
|
216 |
|
217 |
$categories = array(
|
218 |
-
'captcha' => __( 'CAPTCHA', 'contact-form-7' )
|
|
|
219 |
|
220 |
foreach ( $categories as $name => $category ) {
|
221 |
$integration->add_category( $name, $category );
|
222 |
}
|
223 |
|
224 |
$services = array(
|
225 |
-
'recaptcha' => WPCF7_RECAPTCHA::get_instance()
|
|
|
226 |
|
227 |
foreach ( $services as $name => $service ) {
|
228 |
$integration->add_service( $name, $service );
|
@@ -235,7 +242,8 @@ function wpcf7_recaptcha_enqueue_scripts() {
|
|
235 |
$url = 'https://www.google.com/recaptcha/api.js';
|
236 |
$url = add_query_arg( array(
|
237 |
'onload' => 'recaptchaCallback',
|
238 |
-
'render' => 'explicit'
|
|
|
239 |
|
240 |
wp_register_script( 'google-recaptcha', $url, array(), '2.0', true );
|
241 |
}
|
@@ -251,43 +259,55 @@ function wpcf7_recaptcha_callback_script() {
|
|
251 |
<script type="text/javascript">
|
252 |
var recaptchaWidgets = [];
|
253 |
var recaptchaCallback = function() {
|
254 |
-
var forms = document.getElementsByTagName('form');
|
255 |
var pattern = /(^|\s)g-recaptcha(\s|$)/;
|
256 |
|
257 |
-
for (var i = 0; i < forms.length; i++) {
|
258 |
-
var divs = forms[i].getElementsByTagName('div');
|
259 |
|
260 |
-
for (var j = 0; j < divs.length; j++) {
|
261 |
-
var sitekey = divs[j].getAttribute('data-sitekey');
|
262 |
|
263 |
-
if (divs[j].className && divs[j].className.match(pattern) && sitekey) {
|
264 |
var params = {
|
265 |
'sitekey': sitekey,
|
266 |
-
'
|
267 |
-
'
|
268 |
-
'
|
269 |
-
'
|
|
|
270 |
};
|
271 |
|
272 |
-
var callback = divs[j].getAttribute('data-callback');
|
273 |
|
274 |
-
if (callback && 'function' == typeof window[callback]) {
|
275 |
-
params['callback'] = window[callback];
|
276 |
}
|
277 |
|
278 |
-
var expired_callback = divs[j].getAttribute('data-expired-callback');
|
279 |
|
280 |
-
if (expired_callback && 'function' == typeof window[expired_callback]) {
|
281 |
-
params['expired-callback'] = window[expired_callback];
|
282 |
}
|
283 |
|
284 |
-
var widget_id = grecaptcha.render(divs[j], params);
|
285 |
-
recaptchaWidgets.push(widget_id);
|
286 |
break;
|
287 |
}
|
288 |
}
|
289 |
}
|
290 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
</script>
|
292 |
<?php
|
293 |
}
|
@@ -298,7 +318,8 @@ function wpcf7_recaptcha_add_form_tag_recaptcha() {
|
|
298 |
$recaptcha = WPCF7_RECAPTCHA::get_instance();
|
299 |
|
300 |
if ( $recaptcha->is_active() ) {
|
301 |
-
wpcf7_add_form_tag( 'recaptcha', 'wpcf7_recaptcha_form_tag_handler'
|
|
|
302 |
}
|
303 |
}
|
304 |
|
@@ -309,15 +330,16 @@ function wpcf7_recaptcha_form_tag_handler( $tag ) {
|
|
309 |
|
310 |
wp_enqueue_script( 'google-recaptcha' );
|
311 |
|
312 |
-
$tag = new WPCF7_FormTag( $tag );
|
313 |
-
|
314 |
$atts = array();
|
315 |
|
316 |
$recaptcha = WPCF7_RECAPTCHA::get_instance();
|
317 |
$atts['data-sitekey'] = $recaptcha->get_sitekey();
|
318 |
-
$atts['data-theme'] = $tag->get_option( 'theme', '(dark|light)', true );
|
319 |
$atts['data-type'] = $tag->get_option( 'type', '(audio|image)', true );
|
320 |
-
$atts['data-size'] = $tag->get_option(
|
|
|
|
|
|
|
|
|
321 |
$atts['data-tabindex'] = $tag->get_option( 'tabindex', 'int', true );
|
322 |
$atts['data-callback'] = $tag->get_option( 'callback', '', true );
|
323 |
$atts['data-expired-callback'] =
|
@@ -337,7 +359,8 @@ function wpcf7_recaptcha_form_tag_handler( $tag ) {
|
|
337 |
|
338 |
function wpcf7_recaptcha_noscript( $args = '' ) {
|
339 |
$args = wp_parse_args( $args, array(
|
340 |
-
'sitekey' => ''
|
|
|
341 |
|
342 |
if ( empty( $args['sitekey'] ) ) {
|
343 |
return;
|
@@ -435,25 +458,25 @@ function wpcf7_tag_generator_recaptcha( $contact_form, $args = '' ) {
|
|
435 |
<table class="form-table">
|
436 |
<tbody>
|
437 |
<tr>
|
438 |
-
<th scope="row"><?php echo esc_html( __( '
|
439 |
<td>
|
440 |
<fieldset>
|
441 |
-
<legend class="screen-reader-text"><?php echo esc_html( __( '
|
442 |
-
<label for="<?php echo esc_attr( $args['content'] . '-
|
443 |
<br />
|
444 |
-
<label for="<?php echo esc_attr( $args['content'] . '-
|
445 |
</fieldset>
|
446 |
</td>
|
447 |
</tr>
|
448 |
|
449 |
<tr>
|
450 |
-
<th scope="row"><?php echo esc_html( __( '
|
451 |
<td>
|
452 |
<fieldset>
|
453 |
-
<legend class="screen-reader-text"><?php echo esc_html( __( '
|
454 |
-
<label for="<?php echo esc_attr( $args['content'] . '-
|
455 |
<br />
|
456 |
-
<label for="<?php echo esc_attr( $args['content'] . '-
|
457 |
</fieldset>
|
458 |
</td>
|
459 |
</tr>
|
77 |
'body' => array(
|
78 |
'secret' => $secret,
|
79 |
'response' => $response_token,
|
80 |
+
'remoteip' => $_SERVER['REMOTE_ADDR'],
|
81 |
+
),
|
82 |
+
) );
|
83 |
|
84 |
if ( 200 != wp_remote_retrieve_response_code( $response ) ) {
|
85 |
return $is_human;
|
116 |
if ( $sitekey && $secret ) {
|
117 |
WPCF7::update_option( 'recaptcha', array( $sitekey => $secret ) );
|
118 |
$redirect_to = $this->menu_page_url( array(
|
119 |
+
'message' => 'success',
|
120 |
+
) );
|
121 |
} elseif ( '' === $sitekey && '' === $secret ) {
|
122 |
WPCF7::update_option( 'recaptcha', null );
|
123 |
$redirect_to = $this->menu_page_url( array(
|
124 |
+
'message' => 'success',
|
125 |
+
) );
|
126 |
} else {
|
127 |
$redirect_to = $this->menu_page_url( array(
|
128 |
'action' => 'setup',
|
129 |
+
'message' => 'invalid',
|
130 |
+
) );
|
131 |
}
|
132 |
|
133 |
wp_safe_redirect( $redirect_to );
|
220 |
$integration = WPCF7_Integration::get_instance();
|
221 |
|
222 |
$categories = array(
|
223 |
+
'captcha' => __( 'CAPTCHA', 'contact-form-7' ),
|
224 |
+
);
|
225 |
|
226 |
foreach ( $categories as $name => $category ) {
|
227 |
$integration->add_category( $name, $category );
|
228 |
}
|
229 |
|
230 |
$services = array(
|
231 |
+
'recaptcha' => WPCF7_RECAPTCHA::get_instance(),
|
232 |
+
);
|
233 |
|
234 |
foreach ( $services as $name => $service ) {
|
235 |
$integration->add_service( $name, $service );
|
242 |
$url = 'https://www.google.com/recaptcha/api.js';
|
243 |
$url = add_query_arg( array(
|
244 |
'onload' => 'recaptchaCallback',
|
245 |
+
'render' => 'explicit',
|
246 |
+
), $url );
|
247 |
|
248 |
wp_register_script( 'google-recaptcha', $url, array(), '2.0', true );
|
249 |
}
|
259 |
<script type="text/javascript">
|
260 |
var recaptchaWidgets = [];
|
261 |
var recaptchaCallback = function() {
|
262 |
+
var forms = document.getElementsByTagName( 'form' );
|
263 |
var pattern = /(^|\s)g-recaptcha(\s|$)/;
|
264 |
|
265 |
+
for ( var i = 0; i < forms.length; i++ ) {
|
266 |
+
var divs = forms[ i ].getElementsByTagName( 'div' );
|
267 |
|
268 |
+
for ( var j = 0; j < divs.length; j++ ) {
|
269 |
+
var sitekey = divs[ j ].getAttribute( 'data-sitekey' );
|
270 |
|
271 |
+
if ( divs[ j ].className && divs[ j ].className.match( pattern ) && sitekey ) {
|
272 |
var params = {
|
273 |
'sitekey': sitekey,
|
274 |
+
'type': divs[ j ].getAttribute( 'data-type' ),
|
275 |
+
'size': divs[ j ].getAttribute( 'data-size' ),
|
276 |
+
'theme': divs[ j ].getAttribute( 'data-theme' ),
|
277 |
+
'badge': divs[ j ].getAttribute( 'data-badge' ),
|
278 |
+
'tabindex': divs[ j ].getAttribute( 'data-tabindex' )
|
279 |
};
|
280 |
|
281 |
+
var callback = divs[ j ].getAttribute( 'data-callback' );
|
282 |
|
283 |
+
if ( callback && 'function' == typeof window[ callback ] ) {
|
284 |
+
params[ 'callback' ] = window[ callback ];
|
285 |
}
|
286 |
|
287 |
+
var expired_callback = divs[ j ].getAttribute( 'data-expired-callback' );
|
288 |
|
289 |
+
if ( expired_callback && 'function' == typeof window[ expired_callback ] ) {
|
290 |
+
params[ 'expired-callback' ] = window[ expired_callback ];
|
291 |
}
|
292 |
|
293 |
+
var widget_id = grecaptcha.render( divs[ j ], params );
|
294 |
+
recaptchaWidgets.push( widget_id );
|
295 |
break;
|
296 |
}
|
297 |
}
|
298 |
}
|
299 |
}
|
300 |
+
|
301 |
+
document.addEventListener( 'wpcf7submit', function( event ) {
|
302 |
+
switch ( event.detail.status ) {
|
303 |
+
case 'spam':
|
304 |
+
case 'mail_sent':
|
305 |
+
case 'mail_failed':
|
306 |
+
for ( var i = 0; i < recaptchaWidgets.length; i++ ) {
|
307 |
+
grecaptcha.reset( recaptchaWidgets[ i ] );
|
308 |
+
}
|
309 |
+
}
|
310 |
+
}, false );
|
311 |
</script>
|
312 |
<?php
|
313 |
}
|
318 |
$recaptcha = WPCF7_RECAPTCHA::get_instance();
|
319 |
|
320 |
if ( $recaptcha->is_active() ) {
|
321 |
+
wpcf7_add_form_tag( 'recaptcha', 'wpcf7_recaptcha_form_tag_handler',
|
322 |
+
array( 'display-block' => true ) );
|
323 |
}
|
324 |
}
|
325 |
|
330 |
|
331 |
wp_enqueue_script( 'google-recaptcha' );
|
332 |
|
|
|
|
|
333 |
$atts = array();
|
334 |
|
335 |
$recaptcha = WPCF7_RECAPTCHA::get_instance();
|
336 |
$atts['data-sitekey'] = $recaptcha->get_sitekey();
|
|
|
337 |
$atts['data-type'] = $tag->get_option( 'type', '(audio|image)', true );
|
338 |
+
$atts['data-size'] = $tag->get_option(
|
339 |
+
'size', '(compact|normal|invisible)', true );
|
340 |
+
$atts['data-theme'] = $tag->get_option( 'theme', '(dark|light)', true );
|
341 |
+
$atts['data-badge'] = $tag->get_option(
|
342 |
+
'badge', '(bottomright|bottomleft|inline)', true );
|
343 |
$atts['data-tabindex'] = $tag->get_option( 'tabindex', 'int', true );
|
344 |
$atts['data-callback'] = $tag->get_option( 'callback', '', true );
|
345 |
$atts['data-expired-callback'] =
|
359 |
|
360 |
function wpcf7_recaptcha_noscript( $args = '' ) {
|
361 |
$args = wp_parse_args( $args, array(
|
362 |
+
'sitekey' => '',
|
363 |
+
) );
|
364 |
|
365 |
if ( empty( $args['sitekey'] ) ) {
|
366 |
return;
|
458 |
<table class="form-table">
|
459 |
<tbody>
|
460 |
<tr>
|
461 |
+
<th scope="row"><?php echo esc_html( __( 'Size', 'contact-form-7' ) ); ?></th>
|
462 |
<td>
|
463 |
<fieldset>
|
464 |
+
<legend class="screen-reader-text"><?php echo esc_html( __( 'Size', 'contact-form-7' ) ); ?></legend>
|
465 |
+
<label for="<?php echo esc_attr( $args['content'] . '-size-normal' ); ?>"><input type="radio" name="size" class="option default" id="<?php echo esc_attr( $args['content'] . '-size-normal' ); ?>" value="normal" checked="checked" /> <?php echo esc_html( __( 'Normal', 'contact-form-7' ) ); ?></label>
|
466 |
<br />
|
467 |
+
<label for="<?php echo esc_attr( $args['content'] . '-size-compact' ); ?>"><input type="radio" name="size" class="option" id="<?php echo esc_attr( $args['content'] . '-size-compact' ); ?>" value="compact" /> <?php echo esc_html( __( 'Compact', 'contact-form-7' ) ); ?></label>
|
468 |
</fieldset>
|
469 |
</td>
|
470 |
</tr>
|
471 |
|
472 |
<tr>
|
473 |
+
<th scope="row"><?php echo esc_html( __( 'Theme', 'contact-form-7' ) ); ?></th>
|
474 |
<td>
|
475 |
<fieldset>
|
476 |
+
<legend class="screen-reader-text"><?php echo esc_html( __( 'Theme', 'contact-form-7' ) ); ?></legend>
|
477 |
+
<label for="<?php echo esc_attr( $args['content'] . '-theme-light' ); ?>"><input type="radio" name="theme" class="option default" id="<?php echo esc_attr( $args['content'] . '-theme-light' ); ?>" value="light" checked="checked" /> <?php echo esc_html( __( 'Light', 'contact-form-7' ) ); ?></label>
|
478 |
<br />
|
479 |
+
<label for="<?php echo esc_attr( $args['content'] . '-theme-dark' ); ?>"><input type="radio" name="theme" class="option" id="<?php echo esc_attr( $args['content'] . '-theme-dark' ); ?>" value="dark" /> <?php echo esc_html( __( 'Dark', 'contact-form-7' ) ); ?></label>
|
480 |
</fieldset>
|
481 |
</td>
|
482 |
</tr>
|
modules/response.php
CHANGED
@@ -8,7 +8,8 @@
|
|
8 |
add_action( 'wpcf7_init', 'wpcf7_add_form_tag_response' );
|
9 |
|
10 |
function wpcf7_add_form_tag_response() {
|
11 |
-
wpcf7_add_form_tag( 'response', 'wpcf7_response_form_tag_handler'
|
|
|
12 |
}
|
13 |
|
14 |
function wpcf7_response_form_tag_handler( $tag ) {
|
8 |
add_action( 'wpcf7_init', 'wpcf7_add_form_tag_response' );
|
9 |
|
10 |
function wpcf7_add_form_tag_response() {
|
11 |
+
wpcf7_add_form_tag( 'response', 'wpcf7_response_form_tag_handler',
|
12 |
+
array( 'display-block' => true ) );
|
13 |
}
|
14 |
|
15 |
function wpcf7_response_form_tag_handler( $tag ) {
|
modules/select.php
CHANGED
@@ -10,12 +10,14 @@ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_select' );
|
|
10 |
function wpcf7_add_form_tag_select() {
|
11 |
wpcf7_add_form_tag( array( 'select', 'select*' ),
|
12 |
'wpcf7_select_form_tag_handler',
|
13 |
-
array(
|
|
|
|
|
|
|
|
|
14 |
}
|
15 |
|
16 |
function wpcf7_select_form_tag_handler( $tag ) {
|
17 |
-
$tag = new WPCF7_FormTag( $tag );
|
18 |
-
|
19 |
if ( empty( $tag->name ) ) {
|
20 |
return '';
|
21 |
}
|
@@ -114,7 +116,8 @@ function wpcf7_select_form_tag_handler( $tag ) {
|
|
114 |
|
115 |
$item_atts = array(
|
116 |
'value' => $value,
|
117 |
-
'selected' => $selected ? 'selected' : ''
|
|
|
118 |
|
119 |
$item_atts = wpcf7_format_atts( $item_atts );
|
120 |
|
@@ -146,8 +149,6 @@ add_filter( 'wpcf7_validate_select', 'wpcf7_select_validation_filter', 10, 2 );
|
|
146 |
add_filter( 'wpcf7_validate_select*', 'wpcf7_select_validation_filter', 10, 2 );
|
147 |
|
148 |
function wpcf7_select_validation_filter( $result, $tag ) {
|
149 |
-
$tag = new WPCF7_FormTag( $tag );
|
150 |
-
|
151 |
$name = $tag->name;
|
152 |
|
153 |
if ( isset( $_POST[$name] ) && is_array( $_POST[$name] ) ) {
|
10 |
function wpcf7_add_form_tag_select() {
|
11 |
wpcf7_add_form_tag( array( 'select', 'select*' ),
|
12 |
'wpcf7_select_form_tag_handler',
|
13 |
+
array(
|
14 |
+
'name-attr' => true,
|
15 |
+
'selectable-values' => true,
|
16 |
+
)
|
17 |
+
);
|
18 |
}
|
19 |
|
20 |
function wpcf7_select_form_tag_handler( $tag ) {
|
|
|
|
|
21 |
if ( empty( $tag->name ) ) {
|
22 |
return '';
|
23 |
}
|
116 |
|
117 |
$item_atts = array(
|
118 |
'value' => $value,
|
119 |
+
'selected' => $selected ? 'selected' : '',
|
120 |
+
);
|
121 |
|
122 |
$item_atts = wpcf7_format_atts( $item_atts );
|
123 |
|
149 |
add_filter( 'wpcf7_validate_select*', 'wpcf7_select_validation_filter', 10, 2 );
|
150 |
|
151 |
function wpcf7_select_validation_filter( $result, $tag ) {
|
|
|
|
|
152 |
$name = $tag->name;
|
153 |
|
154 |
if ( isset( $_POST[$name] ) && is_array( $_POST[$name] ) ) {
|
modules/submit.php
CHANGED
@@ -12,8 +12,6 @@ function wpcf7_add_form_tag_submit() {
|
|
12 |
}
|
13 |
|
14 |
function wpcf7_submit_form_tag_handler( $tag ) {
|
15 |
-
$tag = new WPCF7_FormTag( $tag );
|
16 |
-
|
17 |
$class = wpcf7_form_controls_class( $tag->type );
|
18 |
|
19 |
$atts = array();
|
12 |
}
|
13 |
|
14 |
function wpcf7_submit_form_tag_handler( $tag ) {
|
|
|
|
|
15 |
$class = wpcf7_form_controls_class( $tag->type );
|
16 |
|
17 |
$atts = array();
|
modules/text.php
CHANGED
@@ -18,8 +18,6 @@ function wpcf7_add_form_tag_text() {
|
|
18 |
}
|
19 |
|
20 |
function wpcf7_text_form_tag_handler( $tag ) {
|
21 |
-
$tag = new WPCF7_FormTag( $tag );
|
22 |
-
|
23 |
if ( empty( $tag->name ) ) {
|
24 |
return '';
|
25 |
}
|
@@ -107,8 +105,6 @@ add_filter( 'wpcf7_validate_tel', 'wpcf7_text_validation_filter', 10, 2 );
|
|
107 |
add_filter( 'wpcf7_validate_tel*', 'wpcf7_text_validation_filter', 10, 2 );
|
108 |
|
109 |
function wpcf7_text_validation_filter( $result, $tag ) {
|
110 |
-
$tag = new WPCF7_FormTag( $tag );
|
111 |
-
|
112 |
$name = $tag->name;
|
113 |
|
114 |
$value = isset( $_POST[$name] )
|
@@ -173,21 +169,30 @@ function wpcf7_text_validation_filter( $result, $tag ) {
|
|
173 |
add_filter( 'wpcf7_messages', 'wpcf7_text_messages' );
|
174 |
|
175 |
function wpcf7_text_messages( $messages ) {
|
176 |
-
|
177 |
'invalid_email' => array(
|
178 |
-
'description' =>
|
179 |
-
|
|
|
|
|
180 |
),
|
181 |
|
182 |
'invalid_url' => array(
|
183 |
-
'description' =>
|
184 |
-
|
|
|
|
|
185 |
),
|
186 |
|
187 |
'invalid_tel' => array(
|
188 |
-
'description' =>
|
189 |
-
|
190 |
-
|
|
|
|
|
|
|
|
|
|
|
191 |
}
|
192 |
|
193 |
|
18 |
}
|
19 |
|
20 |
function wpcf7_text_form_tag_handler( $tag ) {
|
|
|
|
|
21 |
if ( empty( $tag->name ) ) {
|
22 |
return '';
|
23 |
}
|
105 |
add_filter( 'wpcf7_validate_tel*', 'wpcf7_text_validation_filter', 10, 2 );
|
106 |
|
107 |
function wpcf7_text_validation_filter( $result, $tag ) {
|
|
|
|
|
108 |
$name = $tag->name;
|
109 |
|
110 |
$value = isset( $_POST[$name] )
|
169 |
add_filter( 'wpcf7_messages', 'wpcf7_text_messages' );
|
170 |
|
171 |
function wpcf7_text_messages( $messages ) {
|
172 |
+
$messages = array_merge( $messages, array(
|
173 |
'invalid_email' => array(
|
174 |
+
'description' =>
|
175 |
+
__( "Email address that the sender entered is invalid", 'contact-form-7' ),
|
176 |
+
'default' =>
|
177 |
+
__( "The e-mail address entered is invalid.", 'contact-form-7' ),
|
178 |
),
|
179 |
|
180 |
'invalid_url' => array(
|
181 |
+
'description' =>
|
182 |
+
__( "URL that the sender entered is invalid", 'contact-form-7' ),
|
183 |
+
'default' =>
|
184 |
+
__( "The URL is invalid.", 'contact-form-7' ),
|
185 |
),
|
186 |
|
187 |
'invalid_tel' => array(
|
188 |
+
'description' =>
|
189 |
+
__( "Telephone number that the sender entered is invalid", 'contact-form-7' ),
|
190 |
+
'default' =>
|
191 |
+
__( "The telephone number is invalid.", 'contact-form-7' ),
|
192 |
+
),
|
193 |
+
) );
|
194 |
+
|
195 |
+
return $messages;
|
196 |
}
|
197 |
|
198 |
|
modules/textarea.php
CHANGED
@@ -13,8 +13,6 @@ function wpcf7_add_form_tag_textarea() {
|
|
13 |
}
|
14 |
|
15 |
function wpcf7_textarea_form_tag_handler( $tag ) {
|
16 |
-
$tag = new WPCF7_FormTag( $tag );
|
17 |
-
|
18 |
if ( empty( $tag->name ) ) {
|
19 |
return '';
|
20 |
}
|
@@ -87,8 +85,6 @@ add_filter( 'wpcf7_validate_textarea', 'wpcf7_textarea_validation_filter', 10, 2
|
|
87 |
add_filter( 'wpcf7_validate_textarea*', 'wpcf7_textarea_validation_filter', 10, 2 );
|
88 |
|
89 |
function wpcf7_textarea_validation_filter( $result, $tag ) {
|
90 |
-
$tag = new WPCF7_FormTag( $tag );
|
91 |
-
|
92 |
$type = $tag->type;
|
93 |
$name = $tag->name;
|
94 |
|
13 |
}
|
14 |
|
15 |
function wpcf7_textarea_form_tag_handler( $tag ) {
|
|
|
|
|
16 |
if ( empty( $tag->name ) ) {
|
17 |
return '';
|
18 |
}
|
85 |
add_filter( 'wpcf7_validate_textarea*', 'wpcf7_textarea_validation_filter', 10, 2 );
|
86 |
|
87 |
function wpcf7_textarea_validation_filter( $result, $tag ) {
|
|
|
|
|
88 |
$type = $tag->type;
|
89 |
$name = $tag->name;
|
90 |
|
readme.txt
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
Contributors: takayukister
|
3 |
Donate link: https://contactform7.com/donate/
|
4 |
Tags: contact, form, contact form, feedback, email, ajax, captcha, akismet, multilingual
|
5 |
-
Requires at least: 4.
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 4.
|
8 |
License: GPLv2 or later
|
9 |
-
License URI:
|
10 |
|
11 |
Just another contact form plugin. Simple but flexible.
|
12 |
|
@@ -62,6 +62,16 @@ Do you have questions or issues with Contact Form 7? Use these support channels
|
|
62 |
|
63 |
For more information, see [Releases](https://contactform7.com/category/releases/).
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
= 4.7 =
|
66 |
|
67 |
* Added REST API custom endpoints to manipulate contact form data.
|
@@ -70,20 +80,3 @@ For more information, see [Releases](https://contactform7.com/category/releases/
|
|
70 |
* New action hook: `wpcf7_after_flamingo`.
|
71 |
* Added `size` option to `select` and `select*` form-tag types.
|
72 |
* Made it possible to use the 3rd parameter of `wpcf7_add_form_tag()` to specify "features" of the form-tag type.
|
73 |
-
|
74 |
-
= 4.6.1 =
|
75 |
-
|
76 |
-
* Fixed: "0" input could pass the `minlength` validation.
|
77 |
-
* Fixed: `exclude_blank` option was applied to all mail fields, not only to the message body.
|
78 |
-
* Fixed: `wpcf7_autop()` incorrectly inserted `<br />` around hidden and block-type form-tags.
|
79 |
-
* Fixed: Applying `strtolower()` to uploaded file names was unnecessary and could cause troubles in a non-English environment.
|
80 |
-
|
81 |
-
= 4.6 =
|
82 |
-
|
83 |
-
* Ajax loader: HTML markup changed to `<span>` to be easily customizable with CSS.
|
84 |
-
* Appends a proper header and footer to HTML mail content automatically.
|
85 |
-
* `[_serial_number]` special mail-tag.
|
86 |
-
* New form-tag type for hidden fields.
|
87 |
-
* `default:shortcode_attr` form-tag option.
|
88 |
-
* `WPCF7_Shortcode`, `WPCF7_ShortcodeManager`, `wpcf7_add_shortcode()`, `wpcf7_scan_shortcode()`, and some other classes and functions have become deprecated.
|
89 |
-
* Removed all language files from the _languages_ folder. Translations have moved to [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/contact-form-7).
|
2 |
Contributors: takayukister
|
3 |
Donate link: https://contactform7.com/donate/
|
4 |
Tags: contact, form, contact form, feedback, email, ajax, captcha, akismet, multilingual
|
5 |
+
Requires at least: 4.7
|
6 |
+
Tested up to: 4.8
|
7 |
+
Stable tag: 4.8
|
8 |
License: GPLv2 or later
|
9 |
+
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
Just another contact form plugin. Simple but flexible.
|
12 |
|
62 |
|
63 |
For more information, see [Releases](https://contactform7.com/category/releases/).
|
64 |
|
65 |
+
= 4.8 =
|
66 |
+
|
67 |
+
* Stopped using jquery.form.js.
|
68 |
+
* Added custom REST API endpoints for Ajax form submissions.
|
69 |
+
* WPCF7_FormTag class implements ArrayAccess interface.
|
70 |
+
* WPCF7_FormTagsManager::filter() filters form-tags based on features they support.
|
71 |
+
* New form-tag features: do-not-store, display-block, and display-hidden
|
72 |
+
* Removed inappropriate content from h1 headings.
|
73 |
+
* Added the support of size:invisible option to the reCAPTCHA form-tag.
|
74 |
+
|
75 |
= 4.7 =
|
76 |
|
77 |
* Added REST API custom endpoints to manipulate contact form data.
|
80 |
* New action hook: `wpcf7_after_flamingo`.
|
81 |
* Added `size` option to `select` and `select*` form-tag types.
|
82 |
* Made it possible to use the 3rd parameter of `wpcf7_add_form_tag()` to specify "features" of the form-tag type.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wp-contact-form-7.php
CHANGED
@@ -4,15 +4,15 @@ Plugin Name: Contact Form 7
|
|
4 |
Plugin URI: https://contactform7.com/
|
5 |
Description: Just another contact form plugin. Simple but flexible.
|
6 |
Author: Takayuki Miyoshi
|
7 |
-
Author URI:
|
8 |
Text Domain: contact-form-7
|
9 |
Domain Path: /languages/
|
10 |
-
Version: 4.
|
11 |
*/
|
12 |
|
13 |
-
define( 'WPCF7_VERSION', '4.
|
14 |
|
15 |
-
define( 'WPCF7_REQUIRED_WP_VERSION', '4.
|
16 |
|
17 |
define( 'WPCF7_PLUGIN', __FILE__ );
|
18 |
|
4 |
Plugin URI: https://contactform7.com/
|
5 |
Description: Just another contact form plugin. Simple but flexible.
|
6 |
Author: Takayuki Miyoshi
|
7 |
+
Author URI: https://ideasilo.wordpress.com/
|
8 |
Text Domain: contact-form-7
|
9 |
Domain Path: /languages/
|
10 |
+
Version: 4.8
|
11 |
*/
|
12 |
|
13 |
+
define( 'WPCF7_VERSION', '4.8' );
|
14 |
|
15 |
+
define( 'WPCF7_REQUIRED_WP_VERSION', '4.7' );
|
16 |
|
17 |
define( 'WPCF7_PLUGIN', __FILE__ );
|
18 |
|