Add upstream

This commit is contained in:
root
2019-10-24 00:12:05 +02:00
parent 85d41e4216
commit ac980f592c
3504 changed files with 1049983 additions and 29971 deletions

View File

@@ -0,0 +1,897 @@
<?php
use Automattic\Jetpack\Assets;
/**
* Add a contact form button to the post composition screen
*/
add_action( 'media_buttons', 'grunion_media_button', 999 );
function grunion_media_button() {
global $post_ID, $temp_ID, $pagenow;
if ( 'press-this.php' === $pagenow ) {
return;
}
$iframe_post_id = (int) ( 0 == $post_ID ? $temp_ID : $post_ID );
$title = __( 'Add Contact Form', 'jetpack' );
$plugin_url = esc_url( GRUNION_PLUGIN_URL );
$site_url = esc_url( admin_url( "/admin-ajax.php?post_id={$iframe_post_id}&action=grunion_form_builder&TB_iframe=true&width=768" ) );
?>
<a id="insert-jetpack-contact-form" class="button thickbox" title="<?php echo esc_attr( $title ); ?>" data-editor="content" href="<?php echo $site_url; ?>&id=add_form">
<span class="jetpack-contact-form-icon"></span> <?php echo esc_html( $title ); ?>
</a>
<?php
}
add_action( 'wp_ajax_grunion_form_builder', 'grunion_display_form_view' );
function grunion_display_form_view() {
if ( current_user_can( 'edit_posts' ) ) {
require_once GRUNION_PLUGIN_DIR . 'grunion-form-view.php';
}
exit;
}
// feedback specific css items
add_action( 'admin_print_styles', 'grunion_admin_css' );
function grunion_admin_css() {
global $current_screen;
if ( is_null( $current_screen ) ) {
return;
}
if ( 'edit-feedback' !== $current_screen->id ) {
return;
}
wp_enqueue_script( 'wp-lists' );
?>
<style type='text/css'>
.add-new-h2, .view-switch, body.no-js .tablenav select[name^=action], body.no-js #doaction, body.no-js #doaction2 {
display: none
}
.column-feedback_from img {
float:left;
margin-right:10px;
margin-top:3px;
}
.widefat .column-feedback_from {
width: 17%;
}
.widefat .column-feedback_date {
width: 17%;
}
.spam a {
color: #BC0B0B;
}
.untrash a {
color: #D98500;
}
.unspam a {
color: #D98500;
}
</style>
<?php
}
/**
* Hack a 'Bulk Spam' option for bulk edit in other than spam view
* Hack a 'Bulk Delete' option for bulk edit in spam view
*
* There isn't a better way to do this until
* http://core.trac.wordpress.org/changeset/17297 is resolved
*/
add_action( 'admin_head', 'grunion_add_bulk_edit_option' );
function grunion_add_bulk_edit_option() {
$screen = get_current_screen();
if ( is_null( $screen ) ) {
return;
}
if ( 'edit-feedback' != $screen->id ) {
return;
}
// When viewing spam we want to be able to be able to bulk delete
// When viewing anything we want to be able to bulk move to spam
if ( isset( $_GET['post_status'] ) && 'spam' == $_GET['post_status'] ) {
// Create Delete Permanently bulk item
$option_val = 'delete';
$option_txt = __( 'Delete Permanently', 'jetpack' );
$pseudo_selector = 'last-child';
} else {
// Create Mark Spam bulk item
$option_val = 'spam';
$option_txt = __( 'Mark as Spam', 'jetpack' );
$pseudo_selector = 'first-child';
}
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#posts-filter .actions select').filter('[name=action], [name=action2]').find('option:<?php echo $pseudo_selector; ?>').after('<option value="<?php echo $option_val; ?>"><?php echo esc_attr( $option_txt ); ?></option>' );
})
</script>
<?php
}
/**
* Hack an 'Empty Spam' button to spam view
*
* Leverages core's delete_all functionality
*/
add_action( 'admin_head', 'grunion_add_empty_spam_button' );
function grunion_add_empty_spam_button() {
$screen = get_current_screen();
if ( is_null( $screen ) ) {
return;
}
// Only add to feedback, only to spam view
if ( 'edit-feedback' != $screen->id
|| empty( $_GET['post_status'] )
|| 'spam' !== $_GET['post_status'] ) {
return;
}
// Get HTML for the button
$button_html = wp_nonce_field( 'bulk-destroy', '_destroy_nonce', true, false );
$button_html .= get_submit_button( __( 'Empty Spam', 'jetpack' ), 'apply', 'delete_all', false );
// Add the button next to the filter button via js
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#posts-filter #post-query-submit').after('<?php echo $button_html; ?>' );
})
</script>
<?php
}
/**
* Handle a bulk spam report
*/
add_action( 'admin_init', 'grunion_handle_bulk_spam' );
function grunion_handle_bulk_spam() {
global $pagenow;
if ( 'edit.php' != $pagenow
|| ( empty( $_REQUEST['post_type'] ) || 'feedback' != $_REQUEST['post_type'] ) ) {
return;
}
// Slip in a success message
if ( ! empty( $_REQUEST['message'] ) && 'marked-spam' == $_REQUEST['message'] ) {
add_action( 'admin_notices', 'grunion_message_bulk_spam' );
}
if ( ( empty( $_REQUEST['action'] ) || 'spam' != $_REQUEST['action'] ) && ( empty( $_REQUEST['action2'] ) || 'spam' != $_REQUEST['action2'] ) ) {
return;
}
check_admin_referer( 'bulk-posts' );
if ( empty( $_REQUEST['post'] ) ) {
wp_safe_redirect( wp_get_referer() );
exit;
}
$post_ids = array_map( 'intval', $_REQUEST['post'] );
foreach ( $post_ids as $post_id ) {
if ( ! current_user_can( 'edit_page', $post_id ) ) {
wp_die( __( 'You are not allowed to manage this item.', 'jetpack' ) );
}
$post = array(
'ID' => $post_id,
'post_status' => 'spam',
);
$akismet_values = get_post_meta( $post_id, '_feedback_akismet_values', true );
wp_update_post( $post );
/**
* Fires after a comment has been marked by Akismet.
*
* Typically this means the comment is spam.
*
* @module contact-form
*
* @since 2.2.0
*
* @param string $comment_status Usually is 'spam', otherwise 'ham'.
* @param array $akismet_values From '_feedback_akismet_values' in comment meta
*/
do_action( 'contact_form_akismet', 'spam', $akismet_values );
}
$redirect_url = add_query_arg( 'message', 'marked-spam', wp_get_referer() );
wp_safe_redirect( $redirect_url );
exit;
}
function grunion_message_bulk_spam() {
echo '<div class="updated"><p>' . __( 'Feedback(s) marked as spam', 'jetpack' ) . '</p></div>';
}
// remove admin UI parts that we don't support in feedback management
add_action( 'admin_menu', 'grunion_admin_menu' );
function grunion_admin_menu() {
global $menu, $submenu;
unset( $submenu['edit.php?post_type=feedback'] );
}
add_filter( 'bulk_actions-edit-feedback', 'grunion_admin_bulk_actions' );
function grunion_admin_bulk_actions( $actions ) {
global $current_screen;
if ( 'edit-feedback' != $current_screen->id ) {
return $actions;
}
unset( $actions['edit'] );
return $actions;
}
add_filter( 'views_edit-feedback', 'grunion_admin_view_tabs' );
function grunion_admin_view_tabs( $views ) {
global $current_screen;
if ( 'edit-feedback' != $current_screen->id ) {
return $views;
}
unset( $views['publish'] );
preg_match( '|post_type=feedback\'( class="current")?\>(.*)\<span class=|', $views['all'], $match );
if ( ! empty( $match[2] ) ) {
$views['all'] = str_replace( $match[2], __( 'Messages', 'jetpack' ) . ' ', $views['all'] );
}
return $views;
}
add_filter( 'manage_feedback_posts_columns', 'grunion_post_type_columns_filter' );
function grunion_post_type_columns_filter( $cols ) {
$cols = array(
'cb' => '<input type="checkbox" />',
'feedback_from' => __( 'From', 'jetpack' ),
'feedback_message' => __( 'Message', 'jetpack' ),
'feedback_date' => __( 'Date', 'jetpack' ),
);
return $cols;
}
add_action( 'manage_posts_custom_column', 'grunion_manage_post_columns', 10, 2 );
function grunion_manage_post_columns( $col, $post_id ) {
global $post;
/**
* Only call parse_fields_from_content if we're dealing with a Grunion custom column.
*/
if ( ! in_array( $col, array( 'feedback_date', 'feedback_from', 'feedback_message' ) ) ) {
return;
}
$content_fields = Grunion_Contact_Form_Plugin::parse_fields_from_content( $post_id );
switch ( $col ) {
case 'feedback_from':
$author_name = isset( $content_fields['_feedback_author'] ) ? $content_fields['_feedback_author'] : '';
$author_email = isset( $content_fields['_feedback_author_email'] ) ? $content_fields['_feedback_author_email'] : '';
$author_url = isset( $content_fields['_feedback_author_url'] ) ? $content_fields['_feedback_author_url'] : '';
$author_ip = isset( $content_fields['_feedback_ip'] ) ? $content_fields['_feedback_ip'] : '';
$form_url = isset( $post->post_parent ) ? get_permalink( $post->post_parent ) : null;
$author_name_line = '';
if ( ! empty( $author_name ) ) {
if ( ! empty( $author_email ) ) {
$author_name_line = get_avatar( $author_email, 32 );
}
$author_name_line .= sprintf( '<strong>%s</strong><br />', esc_html( $author_name ) );
}
$author_email_line = '';
if ( ! empty( $author_email ) ) {
$author_email_line = sprintf( "<a href='%1\$s' target='_blank'>%2\$s</a><br />", esc_url( 'mailto:' . $author_email ), esc_html( $author_email ) );
}
$author_url_line = '';
if ( ! empty( $author_url ) ) {
$author_url_line = sprintf( "<a href='%1\$s'>%1\$s</a><br />", esc_url( $author_url ) );
}
echo $author_name_line;
echo $author_email_line;
echo $author_url_line;
echo "<a href='edit.php?post_type=feedback&s=" . urlencode( $author_ip );
echo "&mode=detail'>" . esc_html( $author_ip ) . '</a><br />';
if ( $form_url ) {
echo '<a href="' . esc_url( $form_url ) . '">' . esc_html( $form_url ) . '</a>';
}
break;
case 'feedback_message':
$post_type_object = get_post_type_object( $post->post_type );
if ( isset( $content_fields['_feedback_subject'] ) ) {
echo '<strong>';
echo esc_html( $content_fields['_feedback_subject'] );
echo '</strong>';
echo '<br />';
}
echo sanitize_text_field( get_the_content( '' ) );
echo '<br />';
$extra_fields = get_post_meta( $post_id, '_feedback_extra_fields', true );
if ( ! empty( $extra_fields ) ) {
echo '<br /><hr />';
echo '<table cellspacing="0" cellpadding="0" style="">' . "\n";
foreach ( (array) $extra_fields as $k => $v ) {
// Remove prefix from exta fields
echo "<tr><td align='right'><b>" . esc_html( preg_replace( '#^\d+_#', '', $k ) ) . '</b></td><td>' . sanitize_text_field( $v ) . "</td></tr>\n";
}
echo '</table>';
}
echo '<div class="row-actions">';
if ( $post->post_status == 'trash' ) {
echo '<span class="untrash" id="feedback-restore-' . $post_id;
echo '"><a title="';
echo esc_attr__( 'Restore this item from the Trash', 'jetpack' );
echo '" href="' . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $post->ID ) ), 'untrash-' . $post->post_type . '_' . $post->ID );
echo '">' . __( 'Restore', 'jetpack' ) . '</a></span> | ';
echo "<span class='delete'> <a class='submitdelete' title='";
echo esc_attr( __( 'Delete this item permanently', 'jetpack' ) );
echo "' href='" . get_delete_post_link( $post->ID, '', true );
echo "'>" . __( 'Delete Permanently', 'jetpack' ) . '</a></span>';
?>
<script>
jQuery(document).ready(function($) {
$('#feedback-restore-<?php echo $post_id; ?>').click(function(e) {
e.preventDefault();
$.post(ajaxurl, {
action: 'grunion_ajax_spam',
post_id: '<?php echo $post_id; ?>',
make_it: 'publish',
sub_menu: jQuery('.subsubsub .current').attr('href'),
_ajax_nonce: '<?php echo wp_create_nonce( 'grunion-post-status-' . $post_id ); ?>'
},
function(r) {
$('#post-<?php echo $post_id; ?>')
.css({backgroundColor: '#59C859'})
.fadeOut(350, function() {
$(this).remove();
$('.subsubsub').html(r);
});
}
);
});
});
</script>
<?php
} elseif ( $post->post_status == 'publish' ) {
echo '<span class="spam" id="feedback-spam-' . $post_id;
echo '"><a title="';
echo __( 'Mark this message as spam', 'jetpack' );
echo '" href="' . wp_nonce_url( admin_url( 'admin-ajax.php?post_id=' . $post_id . '&amp;action=spam' ), 'spam-feedback_' . $post_id );
echo '">Spam</a></span>';
echo ' | ';
echo '<span class="delete" id="feedback-trash-' . $post_id;
echo '">';
echo '<a class="submitdelete" title="' . esc_attr__( 'Trash', 'jetpack' );
echo '" href="' . get_delete_post_link( $post_id );
echo '">' . __( 'Trash', 'jetpack' ) . '</a></span>';
?>
<script>
jQuery(document).ready( function($) {
$('#feedback-spam-<?php echo $post_id; ?>').click( function(e) {
e.preventDefault();
$.post( ajaxurl, {
action: 'grunion_ajax_spam',
post_id: '<?php echo $post_id; ?>',
make_it: 'spam',
sub_menu: jQuery('.subsubsub .current').attr('href'),
_ajax_nonce: '<?php echo wp_create_nonce( 'grunion-post-status-' . $post_id ); ?>'
},
function( r ) {
$('#post-<?php echo $post_id; ?>')
.css( {backgroundColor:'#FF7979'} )
.fadeOut(350, function() {
$(this).remove();
$('.subsubsub').html(r);
});
});
});
$('#feedback-trash-<?php echo $post_id; ?>').click(function(e) {
e.preventDefault();
$.post(ajaxurl, {
action: 'grunion_ajax_spam',
post_id: '<?php echo $post_id; ?>',
make_it: 'trash',
sub_menu: jQuery('.subsubsub .current').attr('href'),
_ajax_nonce: '<?php echo wp_create_nonce( 'grunion-post-status-' . $post_id ); ?>'
},
function(r) {
$('#post-<?php echo $post_id; ?>')
.css({backgroundColor: '#FF7979'})
.fadeOut(350, function() {
$(this).remove();
$('.subsubsub').html(r);
});
}
);
});
});
</script>
<?php
} elseif ( $post->post_status == 'spam' ) {
echo '<span class="unspam unapprove" id="feedback-ham-' . $post_id;
echo '"><a title="';
echo __( 'Mark this message as NOT spam', 'jetpack' );
echo '" href="">Not Spam</a></span>';
echo ' | ';
echo "<span class='delete' id='feedback-trash-" . $post_id;
echo "'> <a class='submitdelete' title='";
echo esc_attr( __( 'Delete this item permanently', 'jetpack' ) );
echo "' href='" . get_delete_post_link( $post->ID, '', true );
echo "'>" . __( 'Delete Permanently', 'jetpack' ) . '</a></span>';
?>
<script>
jQuery(document).ready( function($) {
$('#feedback-ham-<?php echo $post_id; ?>').click( function(e) {
e.preventDefault();
$.post( ajaxurl, {
action: 'grunion_ajax_spam',
post_id: '<?php echo $post_id; ?>',
make_it: 'ham',
sub_menu: jQuery('.subsubsub .current').attr('href'),
_ajax_nonce: '<?php echo wp_create_nonce( 'grunion-post-status-' . $post_id ); ?>'
},
function( r ) {
$('#post-<?php echo $post_id; ?>')
.css( {backgroundColor:'#59C859'} )
.fadeOut(350, function() {
$(this).remove();
$('.subsubsub').html(r);
});
});
});
});
</script>
<?php
}
break;
case 'feedback_date':
$date_time_format = _x( '%1$s \a\t %2$s', '{$date_format} \a\t {$time_format}', 'jetpack' );
$date_time_format = sprintf( $date_time_format, get_option( 'date_format' ), get_option( 'time_format' ) );
$time = date_i18n( $date_time_format, get_the_time( 'U' ) );
echo $time;
break;
}
}
function grunion_esc_attr( $attr ) {
$out = esc_attr( $attr );
// we also have to entity-encode square brackets so they don't interfere with the shortcode parser
// FIXME: do this better - just stripping out square brackets for now since they mysteriously keep reappearing
$out = str_replace( '[', '', $out );
$out = str_replace( ']', '', $out );
return $out;
}
function grunion_sort_objects( $a, $b ) {
if ( isset( $a['order'] ) && isset( $b['order'] ) ) {
return $a['order'] - $b['order'];
}
return 0;
}
// take an array of field types from the form builder, and construct a shortcode form
// returns both the shortcode form, and HTML markup representing a preview of the form
function grunion_ajax_shortcode() {
check_ajax_referer( 'grunion_shortcode' );
if ( ! current_user_can( 'edit_posts' ) ) {
die( '-1' );
}
$attributes = array();
foreach ( array( 'subject', 'to' ) as $attribute ) {
if ( isset( $_POST[ $attribute ] ) && strlen( $_POST[ $attribute ] ) ) {
$attributes[ $attribute ] = stripslashes( $_POST[ $attribute ] );
}
}
if ( is_array( $_POST['fields'] ) ) {
$fields = stripslashes_deep( $_POST['fields'] );
usort( $fields, 'grunion_sort_objects' );
$field_shortcodes = array();
foreach ( $fields as $field ) {
$field_attributes = array();
if ( isset( $field['required'] ) && 'true' === $field['required'] ) {
$field_attributes['required'] = 'true';
}
foreach ( array( 'options', 'label', 'type' ) as $attribute ) {
if ( isset( $field[ $attribute ] ) ) {
$field_attributes[ $attribute ] = $field[ $attribute ];
}
}
$field_shortcodes[] = new Grunion_Contact_Form_Field( $field_attributes );
}
}
$grunion = new Grunion_Contact_Form( $attributes, $field_shortcodes );
die( "\n$grunion\n" );
}
// takes a post_id, extracts the contact-form shortcode from that post (if there is one), parses it,
// and constructs a json object representing its contents and attributes
function grunion_ajax_shortcode_to_json() {
global $post, $grunion_form;
check_ajax_referer( 'grunion_shortcode_to_json' );
if ( ! empty( $_POST['post_id'] ) && ! current_user_can( 'edit_post', $_POST['post_id'] ) ) {
die( '-1' );
} elseif ( ! current_user_can( 'edit_posts' ) ) {
die( '-1' );
}
if ( ! isset( $_POST['content'] ) || ! is_numeric( $_POST['post_id'] ) ) {
die( '-1' );
}
$content = stripslashes( $_POST['content'] );
// doesn't look like a post with a [contact-form] already.
if ( false === has_shortcode( $content, 'contact-form' ) ) {
die( '' );
}
$post = get_post( $_POST['post_id'] );
do_shortcode( $content );
$grunion = Grunion_Contact_Form::$last;
$out = array(
'to' => '',
'subject' => '',
'fields' => array(),
);
foreach ( $grunion->fields as $field ) {
$out['fields'][ $field->get_attribute( 'id' ) ] = $field->attributes;
}
$to = $grunion->get_attribute( 'to' );
$subject = $grunion->get_attribute( 'subject' );
foreach ( array( 'to', 'subject' ) as $attribute ) {
$value = $grunion->get_attribute( $attribute );
if ( isset( $grunion->defaults[ $attribute ] ) && $value == $grunion->defaults[ $attribute ] ) {
$value = '';
}
$out[ $attribute ] = $value;
}
die( json_encode( $out ) );
}
add_action( 'wp_ajax_grunion_shortcode', 'grunion_ajax_shortcode' );
add_action( 'wp_ajax_grunion_shortcode_to_json', 'grunion_ajax_shortcode_to_json' );
// process row-action spam/not spam clicks
add_action( 'wp_ajax_grunion_ajax_spam', 'grunion_ajax_spam' );
function grunion_ajax_spam() {
global $wpdb;
if ( empty( $_POST['make_it'] ) ) {
return;
}
$post_id = (int) $_POST['post_id'];
check_ajax_referer( 'grunion-post-status-' . $post_id );
if ( ! current_user_can( 'edit_page', $post_id ) ) {
wp_die( __( 'You are not allowed to manage this item.', 'jetpack' ) );
}
require_once dirname( __FILE__ ) . '/grunion-contact-form.php';
$current_menu = '';
if ( isset( $_POST['sub_menu'] ) && preg_match( '|post_type=feedback|', $_POST['sub_menu'] ) ) {
if ( preg_match( '|post_status=spam|', $_POST['sub_menu'] ) ) {
$current_menu = 'spam';
} elseif ( preg_match( '|post_status=trash|', $_POST['sub_menu'] ) ) {
$current_menu = 'trash';
} else {
$current_menu = 'messages';
}
}
$post = get_post( $post_id );
$post_type_object = get_post_type_object( $post->post_type );
$akismet_values = get_post_meta( $post_id, '_feedback_akismet_values', true );
if ( $_POST['make_it'] == 'spam' ) {
$post->post_status = 'spam';
$status = wp_insert_post( $post );
wp_transition_post_status( 'spam', 'publish', $post );
/** This action is already documented in modules/contact-form/admin.php */
do_action( 'contact_form_akismet', 'spam', $akismet_values );
} elseif ( $_POST['make_it'] == 'ham' ) {
$post->post_status = 'publish';
$status = wp_insert_post( $post );
wp_transition_post_status( 'publish', 'spam', $post );
/** This action is already documented in modules/contact-form/admin.php */
do_action( 'contact_form_akismet', 'ham', $akismet_values );
$comment_author_email = $reply_to_addr = $message = $to = $headers = false;
$blog_url = wp_parse_url( site_url() );
// resend the original email
$email = get_post_meta( $post_id, '_feedback_email', true );
$content_fields = Grunion_Contact_Form_Plugin::parse_fields_from_content( $post_id );
if ( ! empty( $email ) && ! empty( $content_fields ) ) {
if ( isset( $content_fields['_feedback_author_email'] ) ) {
$comment_author_email = $content_fields['_feedback_author_email'];
}
if ( isset( $email['to'] ) ) {
$to = $email['to'];
}
if ( isset( $email['message'] ) ) {
$message = $email['message'];
}
if ( isset( $email['headers'] ) ) {
$headers = $email['headers'];
} else {
$headers = 'From: "' . $content_fields['_feedback_author'] . '" <wordpress@' . $blog_url['host'] . ">\r\n";
if ( ! empty( $comment_author_email ) ) {
$reply_to_addr = $comment_author_email;
} elseif ( is_array( $to ) ) {
$reply_to_addr = $to[0];
}
if ( $reply_to_addr ) {
$headers .= 'Reply-To: "' . $content_fields['_feedback_author'] . '" <' . $reply_to_addr . ">\r\n";
}
$headers .= 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . '"';
}
/**
* Filters the subject of the email sent after a contact form submission.
*
* @module contact-form
*
* @since 3.0.0
*
* @param string $content_fields['_feedback_subject'] Feedback's subject line.
* @param array $content_fields['_feedback_all_fields'] Feedback's data from old fields.
*/
$subject = apply_filters( 'contact_form_subject', $content_fields['_feedback_subject'], $content_fields['_feedback_all_fields'] );
Grunion_Contact_Form::wp_mail( $to, $subject, $message, $headers );
}
} elseif ( $_POST['make_it'] == 'publish' ) {
if ( ! current_user_can( $post_type_object->cap->delete_post, $post_id ) ) {
wp_die( __( 'You are not allowed to move this item out of the Trash.', 'jetpack' ) );
}
if ( ! wp_untrash_post( $post_id ) ) {
wp_die( __( 'Error in restoring from Trash.', 'jetpack' ) );
}
} elseif ( $_POST['make_it'] == 'trash' ) {
if ( ! current_user_can( $post_type_object->cap->delete_post, $post_id ) ) {
wp_die( __( 'You are not allowed to move this item to the Trash.', 'jetpack' ) );
}
if ( ! wp_trash_post( $post_id ) ) {
wp_die( __( 'Error in moving to Trash.', 'jetpack' ) );
}
}
$sql = "
SELECT post_status,
COUNT( * ) AS post_count
FROM `{$wpdb->posts}`
WHERE post_type = 'feedback'
GROUP BY post_status
";
$status_count = (array) $wpdb->get_results( $sql, ARRAY_A );
$status = array();
$status_html = '';
foreach ( $status_count as $i => $row ) {
$status[ $row['post_status'] ] = $row['post_count'];
}
if ( isset( $status['publish'] ) ) {
$status_html .= '<li><a href="edit.php?post_type=feedback"';
if ( $current_menu == 'messages' ) {
$status_html .= ' class="current"';
}
$status_html .= '>' . __( 'Messages', 'jetpack' ) . ' <span class="count">';
$status_html .= '(' . number_format( $status['publish'] ) . ')';
$status_html .= '</span></a> |</li>';
}
if ( isset( $status['trash'] ) ) {
$status_html .= '<li><a href="edit.php?post_status=trash&amp;post_type=feedback"';
if ( $current_menu == 'trash' ) {
$status_html .= ' class="current"';
}
$status_html .= '>' . __( 'Trash', 'jetpack' ) . ' <span class="count">';
$status_html .= '(' . number_format( $status['trash'] ) . ')';
$status_html .= '</span></a>';
if ( isset( $status['spam'] ) ) {
$status_html .= ' |';
}
$status_html .= '</li>';
}
if ( isset( $status['spam'] ) ) {
$status_html .= '<li><a href="edit.php?post_status=spam&amp;post_type=feedback"';
if ( $current_menu == 'spam' ) {
$status_html .= ' class="current"';
}
$status_html .= '>' . __( 'Spam', 'jetpack' ) . ' <span class="count">';
$status_html .= '(' . number_format( $status['spam'] ) . ')';
$status_html .= '</span></a></li>';
}
echo $status_html;
exit;
}
/**
* Add the scripts that will add the "Check for Spam" button to the Feedbacks dashboard page.
*/
function grunion_enable_spam_recheck() {
if ( ! defined( 'AKISMET_VERSION' ) ) {
return;
}
$screen = get_current_screen();
// Only add to feedback, only to non-spam view
if ( 'edit-feedback' != $screen->id || ( ! empty( $_GET['post_status'] ) && 'spam' == $_GET['post_status'] ) ) {
return;
}
// Add the scripts that handle the spam check event.
wp_register_script(
'grunion-admin',
Assets::get_file_url_for_environment(
'_inc/build/contact-form/js/grunion-admin.min.js',
'modules/contact-form/js/grunion-admin.js'
),
array( 'jquery' )
);
wp_enqueue_script( 'grunion-admin' );
wp_enqueue_style( 'grunion.css' );
// Add the actual "Check for Spam" button.
add_action( 'admin_head', 'grunion_check_for_spam_button' );
}
add_action( 'admin_enqueue_scripts', 'grunion_enable_spam_recheck' );
/**
* Add the "Check for Spam" button to the Feedbacks dashboard page.
*/
function grunion_check_for_spam_button() {
// Get HTML for the button
$button_html = get_submit_button(
__( 'Check for Spam', 'jetpack' ),
'secondary',
'jetpack-check-feedback-spam',
false,
array( 'class' => 'jetpack-check-feedback-spam' )
);
$button_html .= '<span class="jetpack-check-feedback-spam-spinner"></span>';
// Add the button next to the filter button via js
?>
<script type="text/javascript">
jQuery( function( $ ) {
$( '#posts-filter #post-query-submit' ).after( '<?php echo $button_html; ?>' );
} );
</script>
<?php
}
/**
* Recheck all approved feedbacks for spam.
*/
function grunion_recheck_queue() {
global $wpdb;
$query = 'post_type=feedback&post_status=publish';
if ( isset( $_POST['limit'], $_POST['offset'] ) ) {
$query .= '&posts_per_page=' . intval( $_POST['limit'] ) . '&offset=' . intval( $_POST['offset'] );
}
$approved_feedbacks = get_posts( $query );
foreach ( $approved_feedbacks as $feedback ) {
$meta = get_post_meta( $feedback->ID, '_feedback_akismet_values', true );
/**
* Filter whether the submitted feedback is considered as spam.
*
* @module contact-form
*
* @since 3.4.0
*
* @param bool false Is the submitted feedback spam? Default to false.
* @param array $meta Feedack values returned by the Akismet plugin.
*/
$is_spam = apply_filters( 'jetpack_contact_form_is_spam', false, $meta );
if ( $is_spam ) {
wp_update_post(
array(
'ID' => $feedback->ID,
'post_status' => 'spam',
)
);
/** This action is already documented in modules/contact-form/admin.php */
do_action( 'contact_form_akismet', 'spam', $meta );
}
}
wp_send_json(
array(
'processed' => count( $approved_feedbacks ),
)
);
}
add_action( 'wp_ajax_grunion_recheck_queue', 'grunion_recheck_queue' );

View File

@@ -0,0 +1,52 @@
<?php
/*
* Plugin Name: Feedback CPT Permissions over-ride
*/
if ( class_exists( 'WP_REST_Posts_Controller' ) ) {
/**
* Class Grunion_Contact_Form_Endpoint
* Used as 'rest_controller_class' parameter when 'feedback' post type is registered in modules/contact-form/grunion-contact-form.php.
*/
class Grunion_Contact_Form_Endpoint extends WP_REST_Posts_Controller {
/**
* Check whether a given request has proper authorization to view feedback items.
*
* @param WP_REST_Request $request Full details about the request.
* @return WP_Error|boolean
*/
public function get_items_permissions_check( $request ) {
if ( ! is_user_member_of_blog( get_current_user_id(), get_current_blog_id() ) ) {
return new WP_Error(
'rest_cannot_view',
esc_html__( 'Sorry, you cannot view this resource.', 'jetpack' ),
array( 'status' => 401 )
);
}
return true;
}
/**
* Check whether a given request has proper authorization to view feedback item.
*
* @param WP_REST_Request $request Full details about the request.
* @return WP_Error|boolean
*/
public function get_item_permissions_check( $request ) {
if ( ! is_user_member_of_blog( get_current_user_id(), get_current_blog_id() ) ) {
return new WP_Error(
'rest_cannot_view',
esc_html__( 'Sorry, you cannot view this resource.', 'jetpack' ),
array( 'status' => 401 )
);
}
return true;
}
}
}

View File

@@ -0,0 +1,825 @@
/* Do not modify this file directly. It is concatenated from individual module CSS files. */
/* ==========================================================================
** Normalize
** ======================================================================== */
html {
direction: rtl;
}
body {
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
font-size: 16px;
line-height: 1.4em;
margin: 0;
}
/* Links */
a,
a:visited {
color: #0087be;
text-decoration: none;
}
a:hover,
a:focus,
a:active {
color: $link-highlight;
}
/* ==========================================================================
** Card
** ======================================================================= */
.card,
body {
display: block;
position: relative;
margin: 0 auto 10px auto;
padding: 16px;
box-sizing: border-box;
background: white;
box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3;
}
body {
margin: 0;
background: #f5f5f5;
}
.card:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.card:hover,
.card:focus {
box-shadow: 0 0 0 1px #999, 0 1px 2px #e9eff3;
}
.card .delete-field {
display: block;
float: left;
}
@media ( min-width: 481px ) {
.card {
margin-bottom: 16px;
padding: 24px;
}
body {
padding: 24px;
}
}
.card.is-compact {
margin-bottom: 1px;
}
@media ( min-width: 481px ) {
.card.is-compact {
margin-bottom: 1px;
padding: 16px 24px;
}
}
.card > div {
margin-top: 24px;
}
.card > div:first-child {
margin-top: 0;
}
/* ==========================================================================
** Labels
** ======================================================================= */
label {
display: block;
font-size: 14px;
font-weight: 600;
margin-bottom: 5px;
margin-top: 8px;
}
label:first-of-type {
margin-top: 4px;
}
/* ==========================================================================
** Text Inputs
** ======================================================================= */
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="url"] {
border-radius: 0;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
box-sizing: border-box;
margin: 0;
padding: 7px 14px;
width: 100%;
color: #2e4453;
font-size: 16px;
line-height: 1.5;
border: 1px solid #c8d7e1;
background-color: #fff;
transition: all .15s ease-in-out;
box-shadow: none;
}
input[type="text"]:-ms-input-placeholder,
input[type="tel"]:-ms-input-placeholder,
input[type="email"]:-ms-input-placeholder,
input[type="url"]:-ms-input-placeholder {
color: #87a6bc;
}
input[type="text"]::-ms-input-placeholder,
input[type="tel"]::-ms-input-placeholder,
input[type="email"]::-ms-input-placeholder,
input[type="url"]::-ms-input-placeholder {
color: #87a6bc;
}
input[type="text"]::placeholder,
input[type="tel"]::placeholder,
input[type="email"]::placeholder,
input[type="url"]::placeholder {
color: #87a6bc;
}
input[type="text"]:hover,
input[type="tel"]:hover,
input[type="email"]:hover,
input[type="url"]:hover {
border-color: #a8bece;
}
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
input[type="url"]:focus {
border-color: #0087be;
outline: none;
box-shadow: 0 0 0 2px #78dcfa;
}
input[type="text"]:focus::-ms-clear,
input[type="tel"]:focus::-ms-clear,
input[type="email"]:focus::-ms-clear,
input[type="url"]:focus::-ms-clear {
display: none;
}
input[type="text"]:disabled,
input[type="tel"]:disabled,
input[type="email"]:disabled,
input[type="url"]:disabled {
background: #f3f6f8;
border-color: #e9eff3;
color: #a8bece;
-webkit-text-fill-color: #a8bece;
}
input[type="text"]:disabled:hover,
input[type="tel"]:disabled:hover,
input[type="email"]:disabled:hover,
input[type="url"]:disabled:hover {
cursor: default;
}
input[type="text"]:disabled:-ms-input-placeholder,
input[type="tel"]:disabled:-ms-input-placeholder,
input[type="email"]:disabled:-ms-input-placeholder,
input[type="url"]:disabled:-ms-input-placeholder {
color: #a8bece;
}
input[type="text"]:disabled::-ms-input-placeholder,
input[type="tel"]:disabled::-ms-input-placeholder,
input[type="email"]:disabled::-ms-input-placeholder,
input[type="url"]:disabled::-ms-input-placeholder {
color: #a8bece;
}
input[type="text"]:disabled::placeholder,
input[type="tel"]:disabled::placeholder,
input[type="email"]:disabled::placeholder,
input[type="url"]:disabled::placeholder {
color: #a8bece;
}
/* ==========================================================================
** Textareas
** ======================================================================= */
textarea {
border-radius: 0;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
box-sizing: border-box;
margin: 0;
padding: 7px 14px;
height: 92px;
width: 100%;
color: #2e4453;
font-size: 16px;
line-height: 1.5;
border: 1px solid #c8d7e1;
background-color: #fff;
transition: all .15s ease-in-out;
box-shadow: none;
}
textarea:-ms-input-placeholder {
color: #87a6bc;
}
textarea::-ms-input-placeholder {
color: #87a6bc;
}
textarea::placeholder {
color: #87a6bc;
}
textarea:hover {
border-color: #a8bece;
}
textarea:focus {
border-color: #0087be;
outline: none;
box-shadow: 0 0 0 2px #78dcfa;
}
textarea:focus::-ms-clear {
display: none;
}
textarea:disabled {
background: #f3f6f8;
border-color: #e9eff3;
color: #a8bece;
-webkit-text-fill-color: #a8bece;
}
textarea:disabled:hover {
cursor: default;
}
textarea:disabled:-ms-input-placeholder {
color: #a8bece;
}
textarea:disabled::-ms-input-placeholder {
color: #a8bece;
}
textarea:disabled::placeholder {
color: #a8bece;
}
/* ==========================================================================
** Checkboxes
** ======================================================================= */
.checkbox,
input[type="checkbox"] {
-webkit-appearance: none;
display: inline-block;
box-sizing: border-box;
margin: 2px 0 0;
padding: 7px 14px;
width: 16px;
height: 16px;
float: right;
outline: 0;
padding: 0;
box-shadow: none;
background-color: #fff;
border: 1px solid #c8d7e1;
color: #2e4453;
font-size: 16px;
line-height: 0;
text-align: center;
vertical-align: middle;
-moz-appearance: none;
appearance: none;
transition: all .15s ease-in-out;
clear: none;
cursor: pointer;
}
.checkbox:checked:before,
input[type="checkbox"]:checked:before {
content: '\f147';
font-family: Dashicons;
margin: -3px -4px 0 0;
float: right;
display: inline-block;
vertical-align: middle;
width: 16px;
font-size: 20px;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
speak: none;
color: #00aadc;
}
.checkbox:disabled:checked:before,
input[type="checkbox"]:disabled:checked:before {
color: #a8bece;
}
.checkbox:hover,
input[type="checkbox"]:hover {
border-color: #a8bece;
}
.checkbox:focus,
input[type="checkbox"]:focus {
border-color: #0087be;
outline: none;
box-shadow: 0 0 0 2px #78dcfa;
}
.checkbox:disabled,
input[type="checkbox"]:disabled {
background: #f3f6f8;
border-color: #e9eff3;
color: #a8bece;
opacity: 1;
}
.checkbox:disabled:hover,
input[type="checkbox"]:disabled:hover {
cursor: default;
}
.checkbox + span,
input[type="checkbox"] + span {
display: block;
font-weight: normal;
margin-right: 24px;
}
/* ==========================================================================
** Radio buttons
** ======================================================================== */
.radio-button,
input[type=radio] {
color: #2e4453;
font-size: 16px;
border: 1px solid #c8d7e1;
background-color: #fff;
transition: all .15s ease-in-out;
box-sizing: border-box;
-webkit-appearance: none;
clear: none;
cursor: pointer;
display: inline-block;
line-height: 0;
height: 16px;
margin: 2px 0 0 4px;
float: right;
outline: 0;
padding: 0;
text-align: center;
vertical-align: middle;
width: 16px;
min-width: 16px;
-moz-appearance: none;
appearance: none;
border-radius: 50%;
line-height: 10px;
}
.radio-button:hover,
input[type="radio"]:hover {
border-color: #a8bece;
}
.radio-button:focus,
input[type="radio"]:focus {
border-color: #0087be;
outline: none;
box-shadow: 0 0 0 2px #78dcfa;
}
.radio-button:focus::-ms-clear,
input[type="radio"]:focus::-ms-clear {
display: none;
}
.radio-button:checked:before,
input[type="radio"]:checked:before {
float: right;
display: inline-block;
content: '\2022';
margin: 3px;
width: 8px;
height: 8px;
text-indent: -9999px;
background: #00aadc;
vertical-align: middle;
border-radius: 50%;
animation: grow .2s ease-in-out;
}
.radio-button:disabled,
input[type="radio"]:disabled {
background: #f3f6f8;
border-color: #e9eff3;
color: #a8bece;
opacity: 1;
-webkit-text-fill-color: #a8bece;
}
.radio-button:disabled:hover,
input[type="radio"]:disabled:hover {
cursor: default;
}
.radio-button:disabled:-ms-input-placeholder,
input[type="radio"]:disabled:-ms-input-placeholder {
color: #a8bece;
}
.radio-button:disabled::-ms-input-placeholder,
input[type="radio"]:disabled::-ms-input-placeholder {
color: #a8bece;
}
.radio-button:disabled::placeholder,
input[type="radio"]:disabled::placeholder {
color: #a8bece;
}
.radio-button:disabled:checked::before,
input[type="radio"]:disabled:checked:before {
background: #e9eff3;
}
.radio-button + span,
input[type="radio"] + span {
display: block;
font-weight: normal;
margin-right: 24px;
}
@keyframes grow {
0% {
transform: scale(0.3);
}
60% {
transform: scale(1.15);
}
100% {
transform: scale(1);
}
}
@keyframes grow {
0% {
transform: scale(0.3);
}
60% {
transform: scale(1.15);
}
100% {
transform: scale(1);
}
}
/* ==========================================================================
** Selects
** ======================================================================== */
select {
background: #fff url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiPiAgICAgICAgPHRpdGxlPmFycm93LWRvd248L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4gICAgPGRlZnM+PC9kZWZzPiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBza2V0Y2g6dHlwZT0iTVNQYWdlIj4gICAgICAgIDxnIGlkPSJhcnJvdy1kb3duIiBza2V0Y2g6dHlwZT0iTVNBcnRib2FyZEdyb3VwIiBmaWxsPSIjQzhEN0UxIj4gICAgICAgICAgICA8cGF0aCBkPSJNMTUuNSw2IEwxNyw3LjUgTDEwLjI1LDE0LjI1IEwzLjUsNy41IEw1LDYgTDEwLjI1LDExLjI1IEwxNS41LDYgWiIgaWQ9IkRvd24tQXJyb3ciIHNrZXRjaDp0eXBlPSJNU1NoYXBlR3JvdXAiPjwvcGF0aD4gICAgICAgIDwvZz4gICAgPC9nPjwvc3ZnPg==) no-repeat left 10px center;
border-color: #c8d7e1;
border-style: solid;
border-radius: 4px;
border-width: 1px 1px 2px;
color: #2e4453;
cursor: pointer;
display: inline-block;
margin: 0;
outline: 0;
overflow: hidden;
font-size: 14px;
line-height: 21px;
font-weight: 600;
text-overflow: ellipsis;
text-decoration: none;
vertical-align: top;
white-space: nowrap;
box-sizing: border-box;
/* Aligns the text to the 8px baseline grid and adds padding on right to allow for the arrow. */
padding: 7px 14px 9px 32px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
select:hover {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiPiAgICAgICAgPHRpdGxlPmFycm93LWRvd248L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4gICAgPGRlZnM+PC9kZWZzPiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBza2V0Y2g6dHlwZT0iTVNQYWdlIj4gICAgICAgIDxnIGlkPSJhcnJvdy1kb3duIiBza2V0Y2g6dHlwZT0iTVNBcnRib2FyZEdyb3VwIiBmaWxsPSIjYThiZWNlIj4gICAgICAgICAgICA8cGF0aCBkPSJNMTUuNSw2IEwxNyw3LjUgTDEwLjI1LDE0LjI1IEwzLjUsNy41IEw1LDYgTDEwLjI1LDExLjI1IEwxNS41LDYgWiIgaWQ9IkRvd24tQXJyb3ciIHNrZXRjaDp0eXBlPSJNU1NoYXBlR3JvdXAiPjwvcGF0aD4gICAgICAgIDwvZz4gICAgPC9nPjwvc3ZnPg==);
}
select:focus {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiPiA8dGl0bGU+YXJyb3ctZG93bjwvdGl0bGU+IDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPiA8ZGVmcz48L2RlZnM+IDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHNrZXRjaDp0eXBlPSJNU1BhZ2UiPiA8ZyBpZD0iYXJyb3ctZG93biIgc2tldGNoOnR5cGU9Ik1TQXJ0Ym9hcmRHcm91cCIgZmlsbD0iIzJlNDQ1MyI+IDxwYXRoIGQ9Ik0xNS41LDYgTDE3LDcuNSBMMTAuMjUsMTQuMjUgTDMuNSw3LjUgTDUsNiBMMTAuMjUsMTEuMjUgTDE1LjUsNiBaIiBpZD0iRG93bi1BcnJvdyIgc2tldGNoOnR5cGU9Ik1TU2hhcGVHcm91cCI+PC9wYXRoPiA8L2c+IDwvZz48L3N2Zz4=);
border-color: #00aadc;
box-shadow: 0 0 0 2px #78dcfa;
outline: 0;
-moz-outline:none;
-moz-user-focus:ignore;
}
select:disabled,
select:hover:disabled {
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiPiAgICAgICAgPHRpdGxlPmFycm93LWRvd248L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4gICAgPGRlZnM+PC9kZWZzPiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBza2V0Y2g6dHlwZT0iTVNQYWdlIj4gICAgICAgIDxnIGlkPSJhcnJvdy1kb3duIiBza2V0Y2g6dHlwZT0iTVNBcnRib2FyZEdyb3VwIiBmaWxsPSIjZTllZmYzIj4gICAgICAgICAgICA8cGF0aCBkPSJNMTUuNSw2IEwxNyw3LjUgTDEwLjI1LDE0LjI1IEwzLjUsNy41IEw1LDYgTDEwLjI1LDExLjI1IEwxNS41LDYgWiIgaWQ9IkRvd24tQXJyb3ciIHNrZXRjaDp0eXBlPSJNU1NoYXBlR3JvdXAiPjwvcGF0aD4gICAgICAgIDwvZz4gICAgPC9nPjwvc3ZnPg==) no-repeat left 10px center;;
}
select.is-compact {
min-width: 0;
padding: 0 6px 2px 20px;
margin: 0 4px;
background-position: left 5px center;
background-size: 12px 12px;
}
/* Make it display:block when it follows a label */
label select,
label + select {
display: block;
min-width: 200px;
}
label select.is-compact,
label + select.is-compact {
display: inline-block;
min-width: 0;
}
/* IE: Remove the default arrow */
select::-ms-expand {
display: none;
}
/* IE: Remove default background and color styles on focus */
select::-ms-value {
background: none;
color: #2e4453;
}
/* Firefox: Remove the focus outline, see http://stackoverflow.com/questions/3773430/remove-outline-from-select-box-in-ff/18853002#18853002 */
select:-moz-focusring {
color: transparent;
text-shadow: 0 0 0 #2e4453;
}
/* ==========================================================================
** Buttons
** ======================================================================== */
input[type="submit"] {
padding: 0;
font-size: 14px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
vertical-align: baseline;
background: white;
border-color: #c8d7e1;
border-style: solid;
border-width: 1px 1px 2px;
color: #2e4453;
cursor: pointer;
display: inline-block;
margin: 24px 0 0;
outline: 0;
overflow: hidden;
font-weight: 500;
text-overflow: ellipsis;
text-decoration: none;
vertical-align: top;
box-sizing: border-box;
font-size: 14px;
line-height: 21px;
border-radius: 4px;
padding: 7px 14px 9px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
input[type="submit"]:hover {
border-color: #a8bece;
color: #2e4453;
}
input[type="submit"]:active {
border-width: 2px 1px 1px;
}
input[type="submit"]:visited {
color: #2e4453;
}
input[type="submit"][disabled],
input[type="submit"]:disabled {
color: #e9eff3;
background: white;
border-color: #e9eff3;
cursor: default;
}
input[type="submit"][disabled]:active,
input[type="submit"]:disabled:active {
border-width: 1px 1px 2px;
}
input[type="submit"]:focus {
border-color: #00aadc;
box-shadow: 0 0 0 2px #78dcfa;
}
input[type="submit"].hidden {
display: none;
}
input[type="submit"] .gridicon {
position: relative;
top: 4px;
margin-top: -2px;
width: 18px;
height: 18px;
}
input[type="submit"].button-primary {
background: #00aadc;
border-color: #008ab3;
color: white;
}
input[type="submit"].button-primary:hover,
input[type="submit"].button-primary:focus {
border-color: #005082;
color: white;
}
input[type="submit"].button-primary[disabled],
input[type="submit"].button-primary:disabled {
background: #bceefd;
border-color: #8cc9e2;
color: white;
}
input[type="submit"].button-primary {
color: white;
}
/* ==========================================================================
** Inline editor styles
** ======================================================================== */
.ui-sortable-handle {
cursor: move;
}
.grunion-section-header {
font-size: 21px;
margin-top: 32px;
font-weight: 600;
}
.grunion-form-settings:hover {
box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3;
}
.grunion-section-header:first-child {
margin-top: 0;
}
.grunion-type-options {
display: flex;
flex-wrap: wrap;
}
.grunion-type {
flex-grow: 0;
flex-shrink: 0;
}
.grunion-type select {
-webkit-appearance: none;
width: 100%;
}
.grunion-required {
padding: 27px 16px 0 0;
flex-grow: 0;
flex-shrink: 0;
}
.grunion-options {
padding-top: 16px;
}
.grunion-options ol {
list-style: none;
padding: 0;
margin: 8px 0 0;
}
.grunion-options li {
display: flex;
margin-bottom: 16px;
}
.grunion-field-edit .grunion-options {
display: none;
}
.delete-option,
.delete-field {
color: #0087be;
text-decoration: none;
width: 40px;
line-height: 40px;
font-size: 21px;
text-align: center;
font-weight: 600;
}
.delete-field {
position: absolute;
top: 0;
left: 0;
}
.grunion-controls {
display: flex;
flex-wrap: wrap;
}
.grunion-update-controls {
text-align: left;
flex-grow: 1;
}
#add-field {
flex-grow: 0;
}
.delete-option:before,
.delete-field:before {
font-family: Dashicons;
/* content: "\f158"; /* This is the bolder X */
content: "\f335"; /* This is the thinner X */
display: inline-block;
speak: none;
}
.grunion-field-edit.grunion-field-checkbox-multiple .grunion-options,
.grunion-field-edit.grunion-field-radio .grunion-options,
.grunion-field-edit.grunion-field-select .grunion-options {
display: block;
}
.screen-reader-text {
position: absolute;
margin: -1px;
padding: 0;
height: 1px;
width: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
border: 0;
word-wrap: normal !important; /* many screen reader and browser combinations announce broken words as they would appear visually */
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,764 @@
/* ==========================================================================
** Normalize
** ======================================================================== */
html {
direction: ltr;
}
body {
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
font-size: 16px;
line-height: 1.4em;
margin: 0;
}
/* Links */
a,
a:visited {
color: #0087be;
text-decoration: none;
}
a:hover,
a:focus,
a:active {
color: $link-highlight;
}
/* ==========================================================================
** Card
** ======================================================================= */
.card,
body {
display: block;
position: relative;
margin: 0 auto 10px auto;
padding: 16px;
box-sizing: border-box;
background: white;
box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3;
}
body {
margin: 0;
background: #f5f5f5;
}
.card:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.card:hover,
.card:focus {
box-shadow: 0 0 0 1px #999, 0 1px 2px #e9eff3;
}
.card .delete-field {
display: block;
float: right;
}
@media ( min-width: 481px ) {
.card {
margin-bottom: 16px;
padding: 24px;
}
body {
padding: 24px;
}
}
.card.is-compact {
margin-bottom: 1px;
}
@media ( min-width: 481px ) {
.card.is-compact {
margin-bottom: 1px;
padding: 16px 24px;
}
}
.card > div {
margin-top: 24px;
}
.card > div:first-child {
margin-top: 0;
}
/* ==========================================================================
** Labels
** ======================================================================= */
label {
display: block;
font-size: 14px;
font-weight: 600;
margin-bottom: 5px;
margin-top: 8px;
}
label:first-of-type {
margin-top: 4px;
}
/* ==========================================================================
** Text Inputs
** ======================================================================= */
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="url"] {
border-radius: 0;
appearance: none;
box-sizing: border-box;
margin: 0;
padding: 7px 14px;
width: 100%;
color: #2e4453;
font-size: 16px;
line-height: 1.5;
border: 1px solid #c8d7e1;
background-color: #fff;
transition: all .15s ease-in-out;
box-shadow: none;
}
input[type="text"]::placeholder,
input[type="tel"]::placeholder,
input[type="email"]::placeholder,
input[type="url"]::placeholder {
color: #87a6bc;
}
input[type="text"]:hover,
input[type="tel"]:hover,
input[type="email"]:hover,
input[type="url"]:hover {
border-color: #a8bece;
}
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
input[type="url"]:focus {
border-color: #0087be;
outline: none;
box-shadow: 0 0 0 2px #78dcfa;
}
input[type="text"]:focus::-ms-clear,
input[type="tel"]:focus::-ms-clear,
input[type="email"]:focus::-ms-clear,
input[type="url"]:focus::-ms-clear {
display: none;
}
input[type="text"]:disabled,
input[type="tel"]:disabled,
input[type="email"]:disabled,
input[type="url"]:disabled {
background: #f3f6f8;
border-color: #e9eff3;
color: #a8bece;
-webkit-text-fill-color: #a8bece;
}
input[type="text"]:disabled:hover,
input[type="tel"]:disabled:hover,
input[type="email"]:disabled:hover,
input[type="url"]:disabled:hover {
cursor: default;
}
input[type="text"]:disabled::placeholder,
input[type="tel"]:disabled::placeholder,
input[type="email"]:disabled::placeholder,
input[type="url"]:disabled::placeholder {
color: #a8bece;
}
/* ==========================================================================
** Textareas
** ======================================================================= */
textarea {
border-radius: 0;
appearance: none;
box-sizing: border-box;
margin: 0;
padding: 7px 14px;
height: 92px;
width: 100%;
color: #2e4453;
font-size: 16px;
line-height: 1.5;
border: 1px solid #c8d7e1;
background-color: #fff;
transition: all .15s ease-in-out;
box-shadow: none;
}
textarea::placeholder {
color: #87a6bc;
}
textarea:hover {
border-color: #a8bece;
}
textarea:focus {
border-color: #0087be;
outline: none;
box-shadow: 0 0 0 2px #78dcfa;
}
textarea:focus::-ms-clear {
display: none;
}
textarea:disabled {
background: #f3f6f8;
border-color: #e9eff3;
color: #a8bece;
-webkit-text-fill-color: #a8bece;
}
textarea:disabled:hover {
cursor: default;
}
textarea:disabled::placeholder {
color: #a8bece;
}
/* ==========================================================================
** Checkboxes
** ======================================================================= */
.checkbox,
input[type="checkbox"] {
-webkit-appearance: none;
display: inline-block;
box-sizing: border-box;
margin: 2px 0 0;
padding: 7px 14px;
width: 16px;
height: 16px;
float: left;
outline: 0;
padding: 0;
box-shadow: none;
background-color: #fff;
border: 1px solid #c8d7e1;
color: #2e4453;
font-size: 16px;
line-height: 0;
text-align: center;
vertical-align: middle;
appearance: none;
transition: all .15s ease-in-out;
clear: none;
cursor: pointer;
}
.checkbox:checked:before,
input[type="checkbox"]:checked:before {
content: '\f147';
font-family: Dashicons;
margin: -3px 0 0 -4px;
float: left;
display: inline-block;
vertical-align: middle;
width: 16px;
font-size: 20px;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
speak: none;
color: #00aadc;
}
.checkbox:disabled:checked:before,
input[type="checkbox"]:disabled:checked:before {
color: #a8bece;
}
.checkbox:hover,
input[type="checkbox"]:hover {
border-color: #a8bece;
}
.checkbox:focus,
input[type="checkbox"]:focus {
border-color: #0087be;
outline: none;
box-shadow: 0 0 0 2px #78dcfa;
}
.checkbox:disabled,
input[type="checkbox"]:disabled {
background: #f3f6f8;
border-color: #e9eff3;
color: #a8bece;
opacity: 1;
}
.checkbox:disabled:hover,
input[type="checkbox"]:disabled:hover {
cursor: default;
}
.checkbox + span,
input[type="checkbox"] + span {
display: block;
font-weight: normal;
margin-left: 24px;
}
/* ==========================================================================
** Radio buttons
** ======================================================================== */
.radio-button,
input[type=radio] {
color: #2e4453;
font-size: 16px;
border: 1px solid #c8d7e1;
background-color: #fff;
transition: all .15s ease-in-out;
box-sizing: border-box;
-webkit-appearance: none;
clear: none;
cursor: pointer;
display: inline-block;
line-height: 0;
height: 16px;
margin: 2px 4px 0 0;
float: left;
outline: 0;
padding: 0;
text-align: center;
vertical-align: middle;
width: 16px;
min-width: 16px;
appearance: none;
border-radius: 50%;
line-height: 10px;
}
.radio-button:hover,
input[type="radio"]:hover {
border-color: #a8bece;
}
.radio-button:focus,
input[type="radio"]:focus {
border-color: #0087be;
outline: none;
box-shadow: 0 0 0 2px #78dcfa;
}
.radio-button:focus::-ms-clear,
input[type="radio"]:focus::-ms-clear {
display: none;
}
.radio-button:checked:before,
input[type="radio"]:checked:before {
float: left;
display: inline-block;
content: '\2022';
margin: 3px;
width: 8px;
height: 8px;
text-indent: -9999px;
background: #00aadc;
vertical-align: middle;
border-radius: 50%;
animation: grow .2s ease-in-out;
}
.radio-button:disabled,
input[type="radio"]:disabled {
background: #f3f6f8;
border-color: #e9eff3;
color: #a8bece;
opacity: 1;
-webkit-text-fill-color: #a8bece;
}
.radio-button:disabled:hover,
input[type="radio"]:disabled:hover {
cursor: default;
}
.radio-button:disabled::placeholder,
input[type="radio"]:disabled::placeholder {
color: #a8bece;
}
.radio-button:disabled:checked::before,
input[type="radio"]:disabled:checked:before {
background: #e9eff3;
}
.radio-button + span,
input[type="radio"] + span {
display: block;
font-weight: normal;
margin-left: 24px;
}
@keyframes grow {
0% {
transform: scale(0.3);
}
60% {
transform: scale(1.15);
}
100% {
transform: scale(1);
}
}
@keyframes grow {
0% {
transform: scale(0.3);
}
60% {
transform: scale(1.15);
}
100% {
transform: scale(1);
}
}
/* ==========================================================================
** Selects
** ======================================================================== */
select {
background: #fff url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiPiAgICAgICAgPHRpdGxlPmFycm93LWRvd248L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4gICAgPGRlZnM+PC9kZWZzPiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBza2V0Y2g6dHlwZT0iTVNQYWdlIj4gICAgICAgIDxnIGlkPSJhcnJvdy1kb3duIiBza2V0Y2g6dHlwZT0iTVNBcnRib2FyZEdyb3VwIiBmaWxsPSIjQzhEN0UxIj4gICAgICAgICAgICA8cGF0aCBkPSJNMTUuNSw2IEwxNyw3LjUgTDEwLjI1LDE0LjI1IEwzLjUsNy41IEw1LDYgTDEwLjI1LDExLjI1IEwxNS41LDYgWiIgaWQ9IkRvd24tQXJyb3ciIHNrZXRjaDp0eXBlPSJNU1NoYXBlR3JvdXAiPjwvcGF0aD4gICAgICAgIDwvZz4gICAgPC9nPjwvc3ZnPg==) no-repeat right 10px center;
border-color: #c8d7e1;
border-style: solid;
border-radius: 4px;
border-width: 1px 1px 2px;
color: #2e4453;
cursor: pointer;
display: inline-block;
margin: 0;
outline: 0;
overflow: hidden;
font-size: 14px;
line-height: 21px;
font-weight: 600;
text-overflow: ellipsis;
text-decoration: none;
vertical-align: top;
white-space: nowrap;
box-sizing: border-box;
/* Aligns the text to the 8px baseline grid and adds padding on right to allow for the arrow. */
padding: 7px 32px 9px 14px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
select:hover {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiPiAgICAgICAgPHRpdGxlPmFycm93LWRvd248L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4gICAgPGRlZnM+PC9kZWZzPiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBza2V0Y2g6dHlwZT0iTVNQYWdlIj4gICAgICAgIDxnIGlkPSJhcnJvdy1kb3duIiBza2V0Y2g6dHlwZT0iTVNBcnRib2FyZEdyb3VwIiBmaWxsPSIjYThiZWNlIj4gICAgICAgICAgICA8cGF0aCBkPSJNMTUuNSw2IEwxNyw3LjUgTDEwLjI1LDE0LjI1IEwzLjUsNy41IEw1LDYgTDEwLjI1LDExLjI1IEwxNS41LDYgWiIgaWQ9IkRvd24tQXJyb3ciIHNrZXRjaDp0eXBlPSJNU1NoYXBlR3JvdXAiPjwvcGF0aD4gICAgICAgIDwvZz4gICAgPC9nPjwvc3ZnPg==);
}
select:focus {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiPiA8dGl0bGU+YXJyb3ctZG93bjwvdGl0bGU+IDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPiA8ZGVmcz48L2RlZnM+IDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHNrZXRjaDp0eXBlPSJNU1BhZ2UiPiA8ZyBpZD0iYXJyb3ctZG93biIgc2tldGNoOnR5cGU9Ik1TQXJ0Ym9hcmRHcm91cCIgZmlsbD0iIzJlNDQ1MyI+IDxwYXRoIGQ9Ik0xNS41LDYgTDE3LDcuNSBMMTAuMjUsMTQuMjUgTDMuNSw3LjUgTDUsNiBMMTAuMjUsMTEuMjUgTDE1LjUsNiBaIiBpZD0iRG93bi1BcnJvdyIgc2tldGNoOnR5cGU9Ik1TU2hhcGVHcm91cCI+PC9wYXRoPiA8L2c+IDwvZz48L3N2Zz4=);
border-color: #00aadc;
box-shadow: 0 0 0 2px #78dcfa;
outline: 0;
-moz-outline:none;
-moz-user-focus:ignore;
}
select:disabled,
select:hover:disabled {
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiPiAgICAgICAgPHRpdGxlPmFycm93LWRvd248L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4gICAgPGRlZnM+PC9kZWZzPiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBza2V0Y2g6dHlwZT0iTVNQYWdlIj4gICAgICAgIDxnIGlkPSJhcnJvdy1kb3duIiBza2V0Y2g6dHlwZT0iTVNBcnRib2FyZEdyb3VwIiBmaWxsPSIjZTllZmYzIj4gICAgICAgICAgICA8cGF0aCBkPSJNMTUuNSw2IEwxNyw3LjUgTDEwLjI1LDE0LjI1IEwzLjUsNy41IEw1LDYgTDEwLjI1LDExLjI1IEwxNS41LDYgWiIgaWQ9IkRvd24tQXJyb3ciIHNrZXRjaDp0eXBlPSJNU1NoYXBlR3JvdXAiPjwvcGF0aD4gICAgICAgIDwvZz4gICAgPC9nPjwvc3ZnPg==) no-repeat right 10px center;;
}
select.is-compact {
min-width: 0;
padding: 0 20px 2px 6px;
margin: 0 4px;
background-position: right 5px center;
background-size: 12px 12px;
}
/* Make it display:block when it follows a label */
label select,
label + select {
display: block;
min-width: 200px;
}
label select.is-compact,
label + select.is-compact {
display: inline-block;
min-width: 0;
}
/* IE: Remove the default arrow */
select::-ms-expand {
display: none;
}
/* IE: Remove default background and color styles on focus */
select::-ms-value {
background: none;
color: #2e4453;
}
/* Firefox: Remove the focus outline, see http://stackoverflow.com/questions/3773430/remove-outline-from-select-box-in-ff/18853002#18853002 */
select:-moz-focusring {
color: transparent;
text-shadow: 0 0 0 #2e4453;
}
/* ==========================================================================
** Buttons
** ======================================================================== */
input[type="submit"] {
padding: 0;
font-size: 14px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
vertical-align: baseline;
background: white;
border-color: #c8d7e1;
border-style: solid;
border-width: 1px 1px 2px;
color: #2e4453;
cursor: pointer;
display: inline-block;
margin: 24px 0 0;
outline: 0;
overflow: hidden;
font-weight: 500;
text-overflow: ellipsis;
text-decoration: none;
vertical-align: top;
box-sizing: border-box;
font-size: 14px;
line-height: 21px;
border-radius: 4px;
padding: 7px 14px 9px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
input[type="submit"]:hover {
border-color: #a8bece;
color: #2e4453;
}
input[type="submit"]:active {
border-width: 2px 1px 1px;
}
input[type="submit"]:visited {
color: #2e4453;
}
input[type="submit"][disabled],
input[type="submit"]:disabled {
color: #e9eff3;
background: white;
border-color: #e9eff3;
cursor: default;
}
input[type="submit"][disabled]:active,
input[type="submit"]:disabled:active {
border-width: 1px 1px 2px;
}
input[type="submit"]:focus {
border-color: #00aadc;
box-shadow: 0 0 0 2px #78dcfa;
}
input[type="submit"].hidden {
display: none;
}
input[type="submit"] .gridicon {
position: relative;
top: 4px;
margin-top: -2px;
width: 18px;
height: 18px;
}
input[type="submit"].button-primary {
background: #00aadc;
border-color: #008ab3;
color: white;
}
input[type="submit"].button-primary:hover,
input[type="submit"].button-primary:focus {
border-color: #005082;
color: white;
}
input[type="submit"].button-primary[disabled],
input[type="submit"].button-primary:disabled {
background: #bceefd;
border-color: #8cc9e2;
color: white;
}
input[type="submit"].button-primary {
color: white;
}
/* ==========================================================================
** Inline editor styles
** ======================================================================== */
.ui-sortable-handle {
cursor: move;
}
.grunion-section-header {
font-size: 21px;
margin-top: 32px;
font-weight: 600;
}
.grunion-form-settings:hover {
box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3;
}
.grunion-section-header:first-child {
margin-top: 0;
}
.grunion-type-options {
display: flex;
flex-wrap: wrap;
}
.grunion-type {
flex-grow: 0;
flex-shrink: 0;
}
.grunion-type select {
-webkit-appearance: none;
width: 100%;
}
.grunion-required {
padding: 27px 0 0 16px;
flex-grow: 0;
flex-shrink: 0;
}
.grunion-options {
padding-top: 16px;
}
.grunion-options ol {
list-style: none;
padding: 0;
margin: 8px 0 0;
}
.grunion-options li {
display: flex;
margin-bottom: 16px;
}
.grunion-field-edit .grunion-options {
display: none;
}
.delete-option,
.delete-field {
color: #0087be;
text-decoration: none;
width: 40px;
line-height: 40px;
font-size: 21px;
text-align: center;
font-weight: 600;
}
.delete-field {
position: absolute;
top: 0;
right: 0;
}
.grunion-controls {
display: flex;
flex-wrap: wrap;
}
.grunion-update-controls {
text-align: right;
flex-grow: 1;
}
#add-field {
flex-grow: 0;
}
.delete-option:before,
.delete-field:before {
font-family: Dashicons;
/* content: "\f158"; /* This is the bolder X */
content: "\f335"; /* This is the thinner X */
display: inline-block;
speak: none;
}
.grunion-field-edit.grunion-field-checkbox-multiple .grunion-options,
.grunion-field-edit.grunion-field-radio .grunion-options,
.grunion-field-edit.grunion-field-select .grunion-options {
display: block;
}
.screen-reader-text {
position: absolute;
margin: -1px;
padding: 0;
height: 1px;
width: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
border: 0;
word-wrap: normal !important; /* many screen reader and browser combinations announce broken words as they would appear visually */
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,613 @@
/* Do not modify this file directly. It is concatenated from individual module CSS files. */
/* ==========================================================================
** Normalize
** ======================================================================== */
body,
label {
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
font-size: 16px;
line-height: 1.4em;
}
/* ==========================================================================
** Card
** ======================================================================= */
.card {
display: block;
position: relative;
margin: 0 auto;
padding: 16px;
box-sizing: border-box;
background: white;
box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3;
}
.card:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
@media ( min-width: 481px ) {
.card {
padding: 24px;
}
}
.card > div {
margin-top: 24px;
}
.card > div:first-child {
margin-top: 0;
}
/* ==========================================================================
** Labels
** ======================================================================= */
label {
display: block;
font-size: 14px;
font-weight: 600;
margin-bottom: 5px;
}
/* ==========================================================================
** Text Inputs
** ======================================================================= */
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="url"] {
border-radius: 0;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
box-sizing: border-box;
margin: 0;
padding: 7px 14px;
width: 100%;
color: #2e4453;
font-size: 16px;
line-height: 1.5;
border: 1px solid #c8d7e1;
background-color: #fff;
transition: all .15s ease-in-out;
box-shadow: none;
}
input[type="text"]:-ms-input-placeholder,
input[type="tel"]:-ms-input-placeholder,
input[type="email"]:-ms-input-placeholder,
input[type="url"]:-ms-input-placeholder {
color: #87a6bc;
}
input[type="text"]::-ms-input-placeholder,
input[type="tel"]::-ms-input-placeholder,
input[type="email"]::-ms-input-placeholder,
input[type="url"]::-ms-input-placeholder {
color: #87a6bc;
}
input[type="text"]::placeholder,
input[type="tel"]::placeholder,
input[type="email"]::placeholder,
input[type="url"]::placeholder {
color: #87a6bc;
}
input[type="text"]:hover,
input[type="tel"]:hover,
input[type="email"]:hover,
input[type="url"]:hover {
border-color: #a8bece;
}
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
input[type="url"]:focus {
border-color: #0087be;
outline: none;
box-shadow: 0 0 0 2px #78dcfa;
}
input[type="text"]:focus::-ms-clear,
input[type="tel"]:focus::-ms-clear,
input[type="email"]:focus::-ms-clear,
input[type="url"]:focus::-ms-clear {
display: none;
}
input[type="text"]:disabled,
input[type="tel"]:disabled,
input[type="email"]:disabled,
input[type="url"]:disabled {
background: #f3f6f8;
border-color: #e9eff3;
color: #a8bece;
-webkit-text-fill-color: #a8bece;
}
input[type="text"]:disabled:hover,
input[type="tel"]:disabled:hover,
input[type="email"]:disabled:hover,
input[type="url"]:disabled:hover {
cursor: default;
}
input[type="text"]:disabled:-ms-input-placeholder,
input[type="tel"]:disabled:-ms-input-placeholder,
input[type="email"]:disabled:-ms-input-placeholder,
input[type="url"]:disabled:-ms-input-placeholder {
color: #a8bece;
}
input[type="text"]:disabled::-ms-input-placeholder,
input[type="tel"]:disabled::-ms-input-placeholder,
input[type="email"]:disabled::-ms-input-placeholder,
input[type="url"]:disabled::-ms-input-placeholder {
color: #a8bece;
}
input[type="text"]:disabled::placeholder,
input[type="tel"]:disabled::placeholder,
input[type="email"]:disabled::placeholder,
input[type="url"]:disabled::placeholder {
color: #a8bece;
}
/* ==========================================================================
** Textareas
** ======================================================================= */
textarea {
border-radius: 0;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
box-sizing: border-box;
margin: 0;
padding: 7px 14px;
height: 92px;
width: 100%;
color: #2e4453;
font-size: 16px;
line-height: 1.5;
border: 1px solid #c8d7e1;
background-color: #fff;
transition: all .15s ease-in-out;
box-shadow: none;
}
textarea:-ms-input-placeholder {
color: #87a6bc;
}
textarea::-ms-input-placeholder {
color: #87a6bc;
}
textarea::placeholder {
color: #87a6bc;
}
textarea:hover {
border-color: #a8bece;
}
textarea:focus {
border-color: #0087be;
outline: none;
box-shadow: 0 0 0 2px #78dcfa;
}
textarea:focus::-ms-clear {
display: none;
}
textarea:disabled {
background: #f3f6f8;
border-color: #e9eff3;
color: #a8bece;
-webkit-text-fill-color: #a8bece;
}
textarea:disabled:hover {
cursor: default;
}
textarea:disabled:-ms-input-placeholder {
color: #a8bece;
}
textarea:disabled::-ms-input-placeholder {
color: #a8bece;
}
textarea:disabled::placeholder {
color: #a8bece;
}
/* ==========================================================================
** Checkboxes
** ======================================================================= */
input[type="checkbox"] {
-webkit-appearance: none;
display: inline-block;
box-sizing: border-box;
margin: 2px 0 0;
padding: 7px 14px;
width: 16px;
height: 16px;
float: right;
outline: 0;
padding: 0;
box-shadow: none;
background-color: #fff;
border: 1px solid #c8d7e1;
color: #2e4453;
font-size: 16px;
line-height: 0;
text-align: center;
vertical-align: middle;
-moz-appearance: none;
appearance: none;
transition: all .15s ease-in-out;
clear: none;
cursor: pointer;
}
input[type="checkbox"]:checked:before {
content: '\f147';
font-family: Dashicons;
margin: -3px -4px 0 0;
float: right;
display: inline-block;
vertical-align: middle;
width: 16px;
font-size: 20px;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
speak: none;
color: #00aadc;
}
input[type="checkbox"]:disabled:checked:before {
color: #a8bece;
}
input[type="checkbox"]:hover {
border-color: #a8bece;
}
input[type="checkbox"]:focus {
border-color: #0087be;
outline: none;
box-shadow: 0 0 0 2px #78dcfa;
}
input[type="checkbox"]:disabled {
background: #f3f6f8;
border-color: #e9eff3;
color: #a8bece;
opacity: 1;
}
input[type="checkbox"]:disabled:hover {
cursor: default;
}
input[type="checkbox"] + span {
display: block;
font-weight: normal;
margin-right: 24px;
}
/* ==========================================================================
** Radio buttons
** ======================================================================== */
input[type=radio] {
color: #2e4453;
font-size: 16px;
border: 1px solid #c8d7e1;
background-color: #fff;
transition: all .15s ease-in-out;
box-sizing: border-box;
-webkit-appearance: none;
clear: none;
cursor: pointer;
display: inline-block;
line-height: 0;
height: 16px;
margin: 2px 0 0 4px;
float: right;
outline: 0;
padding: 0;
text-align: center;
vertical-align: middle;
width: 16px;
min-width: 16px;
-moz-appearance: none;
appearance: none;
border-radius: 50%;
line-height: 10px;
}
input[type="radio"]:hover {
border-color: #a8bece;
}
input[type="radio"]:focus {
border-color: #0087be;
outline: none;
box-shadow: 0 0 0 2px #78dcfa;
}
input[type="radio"]:focus::-ms-clear {
display: none;
}
input[type="radio"]:checked:before {
float: right;
display: inline-block;
content: '\2022';
margin: 3px;
width: 8px;
height: 8px;
text-indent: -9999px;
background: #00aadc;
vertical-align: middle;
border-radius: 50%;
animation: grow .2s ease-in-out;
}
input[type="radio"]:disabled {
background: #f3f6f8;
border-color: #e9eff3;
color: #a8bece;
opacity: 1;
-webkit-text-fill-color: #a8bece;
}
input[type="radio"]:disabled:hover {
cursor: default;
}
input[type="radio"]:disabled:-ms-input-placeholder {
color: #a8bece;
}
input[type="radio"]:disabled::-ms-input-placeholder {
color: #a8bece;
}
input[type="radio"]:disabled::placeholder {
color: #a8bece;
}
input[type="radio"]:disabled:checked:before {
background: #e9eff3;
}
input[type="radio"] + span {
display: block;
font-weight: normal;
margin-right: 24px;
}
@keyframes grow {
0% {
transform: scale(0.3);
}
60% {
transform: scale(1.15);
}
100% {
transform: scale(1);
}
}
@keyframes grow {
0% {
transform: scale(0.3);
}
60% {
transform: scale(1.15);
}
100% {
transform: scale(1);
}
}
/* ==========================================================================
** Selects
** ======================================================================== */
select {
background: #fff url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiPiAgICAgICAgPHRpdGxlPmFycm93LWRvd248L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4gICAgPGRlZnM+PC9kZWZzPiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBza2V0Y2g6dHlwZT0iTVNQYWdlIj4gICAgICAgIDxnIGlkPSJhcnJvdy1kb3duIiBza2V0Y2g6dHlwZT0iTVNBcnRib2FyZEdyb3VwIiBmaWxsPSIjQzhEN0UxIj4gICAgICAgICAgICA8cGF0aCBkPSJNMTUuNSw2IEwxNyw3LjUgTDEwLjI1LDE0LjI1IEwzLjUsNy41IEw1LDYgTDEwLjI1LDExLjI1IEwxNS41LDYgWiIgaWQ9IkRvd24tQXJyb3ciIHNrZXRjaDp0eXBlPSJNU1NoYXBlR3JvdXAiPjwvcGF0aD4gICAgICAgIDwvZz4gICAgPC9nPjwvc3ZnPg==) no-repeat left 10px center;
border-color: #c8d7e1;
border-style: solid;
border-radius: 4px;
border-width: 1px 1px 2px;
color: #2e4453;
cursor: pointer;
display: inline-block;
margin: 0;
outline: 0;
overflow: hidden;
font-size: 14px;
line-height: 21px;
font-weight: 600;
text-overflow: ellipsis;
text-decoration: none;
vertical-align: top;
white-space: nowrap;
box-sizing: border-box;
/* Aligns the text to the 8px baseline grid and adds padding on right to allow for the arrow. */
padding: 7px 14px 9px 32px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
select:hover {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiPiAgICAgICAgPHRpdGxlPmFycm93LWRvd248L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4gICAgPGRlZnM+PC9kZWZzPiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBza2V0Y2g6dHlwZT0iTVNQYWdlIj4gICAgICAgIDxnIGlkPSJhcnJvdy1kb3duIiBza2V0Y2g6dHlwZT0iTVNBcnRib2FyZEdyb3VwIiBmaWxsPSIjYThiZWNlIj4gICAgICAgICAgICA8cGF0aCBkPSJNMTUuNSw2IEwxNyw3LjUgTDEwLjI1LDE0LjI1IEwzLjUsNy41IEw1LDYgTDEwLjI1LDExLjI1IEwxNS41LDYgWiIgaWQ9IkRvd24tQXJyb3ciIHNrZXRjaDp0eXBlPSJNU1NoYXBlR3JvdXAiPjwvcGF0aD4gICAgICAgIDwvZz4gICAgPC9nPjwvc3ZnPg==);
}
select:focus {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiPiA8dGl0bGU+YXJyb3ctZG93bjwvdGl0bGU+IDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPiA8ZGVmcz48L2RlZnM+IDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHNrZXRjaDp0eXBlPSJNU1BhZ2UiPiA8ZyBpZD0iYXJyb3ctZG93biIgc2tldGNoOnR5cGU9Ik1TQXJ0Ym9hcmRHcm91cCIgZmlsbD0iIzJlNDQ1MyI+IDxwYXRoIGQ9Ik0xNS41LDYgTDE3LDcuNSBMMTAuMjUsMTQuMjUgTDMuNSw3LjUgTDUsNiBMMTAuMjUsMTEuMjUgTDE1LjUsNiBaIiBpZD0iRG93bi1BcnJvdyIgc2tldGNoOnR5cGU9Ik1TU2hhcGVHcm91cCI+PC9wYXRoPiA8L2c+IDwvZz48L3N2Zz4=);
border-color: #00aadc;
box-shadow: 0 0 0 2px #78dcfa;
outline: 0;
-moz-outline:none;
-moz-user-focus:ignore;
}
select:disabled,
select:hover:disabled {
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiPiAgICAgICAgPHRpdGxlPmFycm93LWRvd248L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4gICAgPGRlZnM+PC9kZWZzPiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBza2V0Y2g6dHlwZT0iTVNQYWdlIj4gICAgICAgIDxnIGlkPSJhcnJvdy1kb3duIiBza2V0Y2g6dHlwZT0iTVNBcnRib2FyZEdyb3VwIiBmaWxsPSIjZTllZmYzIj4gICAgICAgICAgICA8cGF0aCBkPSJNMTUuNSw2IEwxNyw3LjUgTDEwLjI1LDE0LjI1IEwzLjUsNy41IEw1LDYgTDEwLjI1LDExLjI1IEwxNS41LDYgWiIgaWQ9IkRvd24tQXJyb3ciIHNrZXRjaDp0eXBlPSJNU1NoYXBlR3JvdXAiPjwvcGF0aD4gICAgICAgIDwvZz4gICAgPC9nPjwvc3ZnPg==) no-repeat left 10px center;;
}
select.is-compact {
min-width: 0;
padding: 0 6px 2px 20px;
margin: 0 4px;
background-position: left 5px center;
background-size: 12px 12px;
}
/* Make it display:block when it follows a label */
label select,
label + select {
display: block;
min-width: 200px;
}
label select.is-compact,
label + select.is-compact {
display: inline-block;
min-width: 0;
}
/* IE: Remove the default arrow */
select::-ms-expand {
display: none;
}
/* IE: Remove default background and color styles on focus */
select::-ms-value {
background: none;
color: #2e4453;
}
/* Firefox: Remove the focus outline, see http://stackoverflow.com/questions/3773430/remove-outline-from-select-box-in-ff/18853002#18853002 */
select:-moz-focusring {
color: transparent;
text-shadow: 0 0 0 #2e4453;
}
/* ==========================================================================
** Buttons
** ======================================================================== */
input[type="submit"] {
padding: 0;
font-size: 14px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
vertical-align: baseline;
background: white;
border-color: #c8d7e1;
border-style: solid;
border-width: 1px 1px 2px;
color: #2e4453;
cursor: pointer;
display: inline-block;
margin: 24px 0 0;
outline: 0;
overflow: hidden;
font-weight: 500;
text-overflow: ellipsis;
text-decoration: none;
vertical-align: top;
box-sizing: border-box;
font-size: 14px;
line-height: 21px;
border-radius: 4px;
padding: 7px 14px 9px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
input[type="submit"]:hover {
border-color: #a8bece;
color: #2e4453;
}
input[type="submit"]:active {
border-width: 2px 1px 1px;
}
input[type="submit"]:visited {
color: #2e4453;
}
input[type="submit"][disabled],
input[type="submit"]:disabled {
color: #e9eff3;
background: white;
border-color: #e9eff3;
cursor: default;
}
input[type="submit"][disabled]:active,
input[type="submit"]:disabled:active {
border-width: 1px 1px 2px;
}
input[type="submit"]:focus {
border-color: #00aadc;
box-shadow: 0 0 0 2px #78dcfa;
}
/* ==========================================================================
** Preview styles
** ======================================================================== */
.wpview.wpview-wrap[data-wpview-type=contact-form] iframe.inline-edit-contact-form {
width: 100%;
min-height: 500px;
border: 0;
overflow: hidden;
margin-bottom: 0;
display: block;
}
.contact-submit.contact-submit {
margin-top: 0;
margin-bottom: 0;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,554 @@
/* ==========================================================================
** Normalize
** ======================================================================== */
body,
label {
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
font-size: 16px;
line-height: 1.4em;
}
/* ==========================================================================
** Card
** ======================================================================= */
.card {
display: block;
position: relative;
margin: 0 auto;
padding: 16px;
box-sizing: border-box;
background: white;
box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3;
}
.card:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
@media ( min-width: 481px ) {
.card {
padding: 24px;
}
}
.card > div {
margin-top: 24px;
}
.card > div:first-child {
margin-top: 0;
}
/* ==========================================================================
** Labels
** ======================================================================= */
label {
display: block;
font-size: 14px;
font-weight: 600;
margin-bottom: 5px;
}
/* ==========================================================================
** Text Inputs
** ======================================================================= */
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="url"] {
border-radius: 0;
appearance: none;
box-sizing: border-box;
margin: 0;
padding: 7px 14px;
width: 100%;
color: #2e4453;
font-size: 16px;
line-height: 1.5;
border: 1px solid #c8d7e1;
background-color: #fff;
transition: all .15s ease-in-out;
box-shadow: none;
}
input[type="text"]::placeholder,
input[type="tel"]::placeholder,
input[type="email"]::placeholder,
input[type="url"]::placeholder {
color: #87a6bc;
}
input[type="text"]:hover,
input[type="tel"]:hover,
input[type="email"]:hover,
input[type="url"]:hover {
border-color: #a8bece;
}
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
input[type="url"]:focus {
border-color: #0087be;
outline: none;
box-shadow: 0 0 0 2px #78dcfa;
}
input[type="text"]:focus::-ms-clear,
input[type="tel"]:focus::-ms-clear,
input[type="email"]:focus::-ms-clear,
input[type="url"]:focus::-ms-clear {
display: none;
}
input[type="text"]:disabled,
input[type="tel"]:disabled,
input[type="email"]:disabled,
input[type="url"]:disabled {
background: #f3f6f8;
border-color: #e9eff3;
color: #a8bece;
-webkit-text-fill-color: #a8bece;
}
input[type="text"]:disabled:hover,
input[type="tel"]:disabled:hover,
input[type="email"]:disabled:hover,
input[type="url"]:disabled:hover {
cursor: default;
}
input[type="text"]:disabled::placeholder,
input[type="tel"]:disabled::placeholder,
input[type="email"]:disabled::placeholder,
input[type="url"]:disabled::placeholder {
color: #a8bece;
}
/* ==========================================================================
** Textareas
** ======================================================================= */
textarea {
border-radius: 0;
appearance: none;
box-sizing: border-box;
margin: 0;
padding: 7px 14px;
height: 92px;
width: 100%;
color: #2e4453;
font-size: 16px;
line-height: 1.5;
border: 1px solid #c8d7e1;
background-color: #fff;
transition: all .15s ease-in-out;
box-shadow: none;
}
textarea::placeholder {
color: #87a6bc;
}
textarea:hover {
border-color: #a8bece;
}
textarea:focus {
border-color: #0087be;
outline: none;
box-shadow: 0 0 0 2px #78dcfa;
}
textarea:focus::-ms-clear {
display: none;
}
textarea:disabled {
background: #f3f6f8;
border-color: #e9eff3;
color: #a8bece;
-webkit-text-fill-color: #a8bece;
}
textarea:disabled:hover {
cursor: default;
}
textarea:disabled::placeholder {
color: #a8bece;
}
/* ==========================================================================
** Checkboxes
** ======================================================================= */
input[type="checkbox"] {
-webkit-appearance: none;
display: inline-block;
box-sizing: border-box;
margin: 2px 0 0;
padding: 7px 14px;
width: 16px;
height: 16px;
float: left;
outline: 0;
padding: 0;
box-shadow: none;
background-color: #fff;
border: 1px solid #c8d7e1;
color: #2e4453;
font-size: 16px;
line-height: 0;
text-align: center;
vertical-align: middle;
appearance: none;
transition: all .15s ease-in-out;
clear: none;
cursor: pointer;
}
input[type="checkbox"]:checked:before {
content: '\f147';
font-family: Dashicons;
margin: -3px 0 0 -4px;
float: left;
display: inline-block;
vertical-align: middle;
width: 16px;
font-size: 20px;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
speak: none;
color: #00aadc;
}
input[type="checkbox"]:disabled:checked:before {
color: #a8bece;
}
input[type="checkbox"]:hover {
border-color: #a8bece;
}
input[type="checkbox"]:focus {
border-color: #0087be;
outline: none;
box-shadow: 0 0 0 2px #78dcfa;
}
input[type="checkbox"]:disabled {
background: #f3f6f8;
border-color: #e9eff3;
color: #a8bece;
opacity: 1;
}
input[type="checkbox"]:disabled:hover {
cursor: default;
}
input[type="checkbox"] + span {
display: block;
font-weight: normal;
margin-left: 24px;
}
/* ==========================================================================
** Radio buttons
** ======================================================================== */
input[type=radio] {
color: #2e4453;
font-size: 16px;
border: 1px solid #c8d7e1;
background-color: #fff;
transition: all .15s ease-in-out;
box-sizing: border-box;
-webkit-appearance: none;
clear: none;
cursor: pointer;
display: inline-block;
line-height: 0;
height: 16px;
margin: 2px 4px 0 0;
float: left;
outline: 0;
padding: 0;
text-align: center;
vertical-align: middle;
width: 16px;
min-width: 16px;
appearance: none;
border-radius: 50%;
line-height: 10px;
}
input[type="radio"]:hover {
border-color: #a8bece;
}
input[type="radio"]:focus {
border-color: #0087be;
outline: none;
box-shadow: 0 0 0 2px #78dcfa;
}
input[type="radio"]:focus::-ms-clear {
display: none;
}
input[type="radio"]:checked:before {
float: left;
display: inline-block;
content: '\2022';
margin: 3px;
width: 8px;
height: 8px;
text-indent: -9999px;
background: #00aadc;
vertical-align: middle;
border-radius: 50%;
animation: grow .2s ease-in-out;
}
input[type="radio"]:disabled {
background: #f3f6f8;
border-color: #e9eff3;
color: #a8bece;
opacity: 1;
-webkit-text-fill-color: #a8bece;
}
input[type="radio"]:disabled:hover {
cursor: default;
}
input[type="radio"]:disabled::placeholder {
color: #a8bece;
}
input[type="radio"]:disabled:checked:before {
background: #e9eff3;
}
input[type="radio"] + span {
display: block;
font-weight: normal;
margin-left: 24px;
}
@keyframes grow {
0% {
transform: scale(0.3);
}
60% {
transform: scale(1.15);
}
100% {
transform: scale(1);
}
}
@keyframes grow {
0% {
transform: scale(0.3);
}
60% {
transform: scale(1.15);
}
100% {
transform: scale(1);
}
}
/* ==========================================================================
** Selects
** ======================================================================== */
select {
background: #fff url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiPiAgICAgICAgPHRpdGxlPmFycm93LWRvd248L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4gICAgPGRlZnM+PC9kZWZzPiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBza2V0Y2g6dHlwZT0iTVNQYWdlIj4gICAgICAgIDxnIGlkPSJhcnJvdy1kb3duIiBza2V0Y2g6dHlwZT0iTVNBcnRib2FyZEdyb3VwIiBmaWxsPSIjQzhEN0UxIj4gICAgICAgICAgICA8cGF0aCBkPSJNMTUuNSw2IEwxNyw3LjUgTDEwLjI1LDE0LjI1IEwzLjUsNy41IEw1LDYgTDEwLjI1LDExLjI1IEwxNS41LDYgWiIgaWQ9IkRvd24tQXJyb3ciIHNrZXRjaDp0eXBlPSJNU1NoYXBlR3JvdXAiPjwvcGF0aD4gICAgICAgIDwvZz4gICAgPC9nPjwvc3ZnPg==) no-repeat right 10px center;
border-color: #c8d7e1;
border-style: solid;
border-radius: 4px;
border-width: 1px 1px 2px;
color: #2e4453;
cursor: pointer;
display: inline-block;
margin: 0;
outline: 0;
overflow: hidden;
font-size: 14px;
line-height: 21px;
font-weight: 600;
text-overflow: ellipsis;
text-decoration: none;
vertical-align: top;
white-space: nowrap;
box-sizing: border-box;
/* Aligns the text to the 8px baseline grid and adds padding on right to allow for the arrow. */
padding: 7px 32px 9px 14px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
select:hover {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiPiAgICAgICAgPHRpdGxlPmFycm93LWRvd248L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4gICAgPGRlZnM+PC9kZWZzPiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBza2V0Y2g6dHlwZT0iTVNQYWdlIj4gICAgICAgIDxnIGlkPSJhcnJvdy1kb3duIiBza2V0Y2g6dHlwZT0iTVNBcnRib2FyZEdyb3VwIiBmaWxsPSIjYThiZWNlIj4gICAgICAgICAgICA8cGF0aCBkPSJNMTUuNSw2IEwxNyw3LjUgTDEwLjI1LDE0LjI1IEwzLjUsNy41IEw1LDYgTDEwLjI1LDExLjI1IEwxNS41LDYgWiIgaWQ9IkRvd24tQXJyb3ciIHNrZXRjaDp0eXBlPSJNU1NoYXBlR3JvdXAiPjwvcGF0aD4gICAgICAgIDwvZz4gICAgPC9nPjwvc3ZnPg==);
}
select:focus {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiPiA8dGl0bGU+YXJyb3ctZG93bjwvdGl0bGU+IDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPiA8ZGVmcz48L2RlZnM+IDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHNrZXRjaDp0eXBlPSJNU1BhZ2UiPiA8ZyBpZD0iYXJyb3ctZG93biIgc2tldGNoOnR5cGU9Ik1TQXJ0Ym9hcmRHcm91cCIgZmlsbD0iIzJlNDQ1MyI+IDxwYXRoIGQ9Ik0xNS41LDYgTDE3LDcuNSBMMTAuMjUsMTQuMjUgTDMuNSw3LjUgTDUsNiBMMTAuMjUsMTEuMjUgTDE1LjUsNiBaIiBpZD0iRG93bi1BcnJvdyIgc2tldGNoOnR5cGU9Ik1TU2hhcGVHcm91cCI+PC9wYXRoPiA8L2c+IDwvZz48L3N2Zz4=);
border-color: #00aadc;
box-shadow: 0 0 0 2px #78dcfa;
outline: 0;
-moz-outline:none;
-moz-user-focus:ignore;
}
select:disabled,
select:hover:disabled {
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiPiAgICAgICAgPHRpdGxlPmFycm93LWRvd248L3RpdGxlPiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4gICAgPGRlZnM+PC9kZWZzPiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBza2V0Y2g6dHlwZT0iTVNQYWdlIj4gICAgICAgIDxnIGlkPSJhcnJvdy1kb3duIiBza2V0Y2g6dHlwZT0iTVNBcnRib2FyZEdyb3VwIiBmaWxsPSIjZTllZmYzIj4gICAgICAgICAgICA8cGF0aCBkPSJNMTUuNSw2IEwxNyw3LjUgTDEwLjI1LDE0LjI1IEwzLjUsNy41IEw1LDYgTDEwLjI1LDExLjI1IEwxNS41LDYgWiIgaWQ9IkRvd24tQXJyb3ciIHNrZXRjaDp0eXBlPSJNU1NoYXBlR3JvdXAiPjwvcGF0aD4gICAgICAgIDwvZz4gICAgPC9nPjwvc3ZnPg==) no-repeat right 10px center;;
}
select.is-compact {
min-width: 0;
padding: 0 20px 2px 6px;
margin: 0 4px;
background-position: right 5px center;
background-size: 12px 12px;
}
/* Make it display:block when it follows a label */
label select,
label + select {
display: block;
min-width: 200px;
}
label select.is-compact,
label + select.is-compact {
display: inline-block;
min-width: 0;
}
/* IE: Remove the default arrow */
select::-ms-expand {
display: none;
}
/* IE: Remove default background and color styles on focus */
select::-ms-value {
background: none;
color: #2e4453;
}
/* Firefox: Remove the focus outline, see http://stackoverflow.com/questions/3773430/remove-outline-from-select-box-in-ff/18853002#18853002 */
select:-moz-focusring {
color: transparent;
text-shadow: 0 0 0 #2e4453;
}
/* ==========================================================================
** Buttons
** ======================================================================== */
input[type="submit"] {
padding: 0;
font-size: 14px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
vertical-align: baseline;
background: white;
border-color: #c8d7e1;
border-style: solid;
border-width: 1px 1px 2px;
color: #2e4453;
cursor: pointer;
display: inline-block;
margin: 24px 0 0;
outline: 0;
overflow: hidden;
font-weight: 500;
text-overflow: ellipsis;
text-decoration: none;
vertical-align: top;
box-sizing: border-box;
font-size: 14px;
line-height: 21px;
border-radius: 4px;
padding: 7px 14px 9px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
input[type="submit"]:hover {
border-color: #a8bece;
color: #2e4453;
}
input[type="submit"]:active {
border-width: 2px 1px 1px;
}
input[type="submit"]:visited {
color: #2e4453;
}
input[type="submit"][disabled],
input[type="submit"]:disabled {
color: #e9eff3;
background: white;
border-color: #e9eff3;
cursor: default;
}
input[type="submit"][disabled]:active,
input[type="submit"]:disabled:active {
border-width: 1px 1px 2px;
}
input[type="submit"]:focus {
border-color: #00aadc;
box-shadow: 0 0 0 2px #78dcfa;
}
/* ==========================================================================
** Preview styles
** ======================================================================== */
.wpview.wpview-wrap[data-wpview-type=contact-form] iframe.inline-edit-contact-form {
width: 100%;
min-height: 500px;
border: 0;
overflow: hidden;
margin-bottom: 0;
display: block;
}
.contact-submit.contact-submit {
margin-top: 0;
margin-bottom: 0;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,27 @@
/* Do not modify this file directly. It is concatenated from individual module CSS files. */
i.mce-i-grunion {
font-size: 20px;
}
i.mce-i-grunion:before,
.jetpack-contact-form-icon:before {
width: 24px;
vertical-align: top;
content: '';
display: block;
height: 24px;
background-size: 24px;
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="rgb(85, 93, 102)" d="M13 7.5h5v2h-5zm0 7h5v2h-5zM19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM11 6H6v5h5V6zm-1 4H7V7h3v3zm1 3H6v5h5v-5zm-1 4H7v-3h3v3z"/></svg>');
margin-top: -4px;
}
i.mce-i-grunion:before {
margin-top: -2px;
margin-right: -2px;
}
.jetpack-contact-form-icon {
opacity: 0.7;
vertical-align: text-top;
display: inline-block;
height: 18px;
}

View File

@@ -0,0 +1 @@
i.mce-i-grunion{font-size:20px}.jetpack-contact-form-icon:before,i.mce-i-grunion:before{width:24px;vertical-align:top;content:'';display:block;height:24px;background-size:24px;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="rgb(85, 93, 102)" d="M13 7.5h5v2h-5zm0 7h5v2h-5zM19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM11 6H6v5h5V6zm-1 4H7V7h3v3zm1 3H6v5h5v-5zm-1 4H7v-3h3v3z"/></svg>');margin-top:-4px}i.mce-i-grunion:before{margin-top:-2px;margin-right:-2px}.jetpack-contact-form-icon{opacity:.7;vertical-align:text-top;display:inline-block;height:18px}

View File

@@ -0,0 +1,26 @@
i.mce-i-grunion {
font-size: 20px;
}
i.mce-i-grunion:before,
.jetpack-contact-form-icon:before {
width: 24px;
vertical-align: top;
content: '';
display: block;
height: 24px;
background-size: 24px;
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="rgb(85, 93, 102)" d="M13 7.5h5v2h-5zm0 7h5v2h-5zM19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM11 6H6v5h5V6zm-1 4H7V7h3v3zm1 3H6v5h5v-5zm-1 4H7v-3h3v3z"/></svg>');
margin-top: -4px;
}
i.mce-i-grunion:before {
margin-top: -2px;
margin-left: -2px;
}
.jetpack-contact-form-icon {
opacity: 0.7;
vertical-align: text-top;
display: inline-block;
height: 18px;
}

View File

@@ -0,0 +1,2 @@
/* Do not modify this file directly. It is concatenated from individual module CSS files. */
i.mce-i-grunion{font-size:20px}.jetpack-contact-form-icon:before,i.mce-i-grunion:before{width:24px;vertical-align:top;content:'';display:block;height:24px;background-size:24px;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="rgb(85, 93, 102)" d="M13 7.5h5v2h-5zm0 7h5v2h-5zM19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM11 6H6v5h5V6zm-1 4H7V7h3v3zm1 3H6v5h5v-5zm-1 4H7v-3h3v3z"/></svg>');margin-top:-4px}i.mce-i-grunion:before{margin-top:-2px;margin-left:-2px}.jetpack-contact-form-icon{opacity:.7;vertical-align:text-top;display:inline-block;height:18px}

View File

@@ -0,0 +1 @@
.contact-form .clear-form{clear:both}.contact-form input:-ms-input-placeholder{transition:opacity .3s ease-out}.contact-form input::-ms-input-placeholder{transition:opacity .3s ease-out}.contact-form input::placeholder{transition:opacity .3s ease-out}.contact-form input:hover:-ms-input-placeholder{opacity:.5}.contact-form input:hover::-ms-input-placeholder{opacity:.5}.contact-form input:hover::placeholder{opacity:.5}.contact-form input:focus:-ms-input-placeholder{opacity:.3}.contact-form input:focus::-ms-input-placeholder{opacity:.3}.contact-form input:focus::placeholder{opacity:.3}.contact-form input[type=email],.contact-form input[type=tel],.contact-form input[type=text],.contact-form input[type=url]{box-sizing:border-box;margin-bottom:.75em;width:100%}.contact-form select{margin-bottom:.75em}.contact-form textarea{box-sizing:border-box;float:none;height:200px;margin-bottom:.75em;width:100%}.contact-form input[type=checkbox],.contact-form input[type=radio]{float:none;margin-bottom:.75em;vertical-align:bottom;vertical-align:-webkit-baseline-middle;vertical-align:-moz-middle-with-baseline}.contact-form label{margin-bottom:.25em;float:none;font-weight:700;display:block}.contact-form label.checkbox,.contact-form label.checkbox-multiple,.contact-form label.radio{margin-bottom:.25em;float:none;font-weight:400;display:inline-block}.contact-form .grunion-field-checkbox-multiple-wrap,.contact-form .grunion-field-checkbox-wrap,.contact-form .grunion-field-radio-wrap{margin-bottom:.5em}.contact-form label span{color:#aaa;margin-right:.25em;font-weight:400}.contact-form-submission{margin-bottom:4em;padding:1.5em 1em}.contact-form-submission p{margin:0 auto;word-wrap:break-word}.form-errors .form-error-message{color:red}.textwidget .contact-form input[type=email],.textwidget .contact-form input[type=tel],.textwidget .contact-form input[type=text],.textwidget .contact-form input[type=url],.textwidget .contact-form textarea,.wp-block-column .contact-form input[type=email],.wp-block-column .contact-form input[type=tel],.wp-block-column .contact-form input[type=text],.wp-block-column .contact-form input[type=url],.wp-block-column .contact-form textarea{width:100%}#jetpack-check-feedback-spam{margin:1px 0 0 8px}.jetpack-check-feedback-spam-spinner{display:inline-block;margin-top:7px}@media only screen and (min-width:600px){.contact-form input[type=email],.contact-form input[type=tel],.contact-form input[type=text],.contact-form input[type=url]{width:50%}}

View File

@@ -0,0 +1,116 @@
.contact-form .clear-form {
clear: both;
}
.contact-form input::placeholder {
transition: opacity .3s ease-out;
}
.contact-form input:hover::placeholder {
opacity: 0.5;
}
.contact-form input:focus::placeholder {
opacity: 0.3;
}
.contact-form input[type='text'],
.contact-form input[type='email'],
.contact-form input[type='tel'],
.contact-form input[type='url'] {
box-sizing: border-box;
margin-bottom: 0.75em;
width: 100%;
}
.contact-form select {
margin-bottom: 0.75em;
}
.contact-form textarea {
box-sizing: border-box;
float: none;
height: 200px;
margin-bottom: 0.75em;
width: 100%;
}
.contact-form input[type='radio'],
.contact-form input[type='checkbox'] {
float: none;
margin-bottom: 0.75em;
vertical-align: bottom;
vertical-align: -webkit-baseline-middle;
vertical-align: -moz-middle-with-baseline;
}
.contact-form label {
margin-bottom: 0.25em;
float: none;
font-weight: bold;
display: block;
}
.contact-form label.checkbox,
.contact-form label.checkbox-multiple,
.contact-form label.radio {
margin-bottom: 0.25em;
float: none;
font-weight: normal;
display: inline-block;
}
.contact-form .grunion-field-checkbox-wrap,
.contact-form .grunion-field-checkbox-multiple-wrap,
.contact-form .grunion-field-radio-wrap {
margin-bottom: 0.5em;
}
.contact-form label span {
color: #AAA;
margin-left: 0.25em;
font-weight: normal;
}
.contact-form-submission {
margin-bottom: 4em;
padding: 1.5em 1em;
}
.contact-form-submission p {
margin: 0 auto;
word-wrap: break-word;
}
.form-errors .form-error-message {
color: red;
}
.textwidget .contact-form input[type='text'],
.textwidget .contact-form input[type='email'],
.textwidget .contact-form input[type='tel'],
.textwidget .contact-form input[type='url'],
.textwidget .contact-form textarea,
.wp-block-column .contact-form input[type='text'],
.wp-block-column .contact-form input[type='email'],
.wp-block-column .contact-form input[type='tel'],
.wp-block-column .contact-form input[type='url'],
.wp-block-column .contact-form textarea {
width: 100%;
}
#jetpack-check-feedback-spam {
margin: 1px 8px 0px 0px;
}
.jetpack-check-feedback-spam-spinner {
display: inline-block;
margin-top: 7px;
}
@media only screen and (min-width: 600px) {
.contact-form input[type='text'],
.contact-form input[type='email'],
.contact-form input[type='tel'],
.contact-form input[type='url'] {
width: 50%;
}
}

View File

@@ -0,0 +1,160 @@
.ui-datepicker {
padding: 0;
margin: 0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
background-color: #fff;
border: 1px solid #dfdfdf;
border-top: none;
-webkit-box-shadow: 0 3px 6px rgba(0, 0, 0, 0.075);
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.075);
width: auto;
}
.ui-datepicker * {
padding: 0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
.ui-datepicker table {
width: auto;
margin: 0;
border: none;
border-collapse: collapse;
}
.ui-datepicker .ui-widget-header,
.ui-datepicker .ui-datepicker-header {
background-image: none;
border: none;
font-weight: normal;
}
.ui-datepicker .ui-datepicker-header .ui-state-hover {
background: transparent;
border-color: transparent;
cursor: pointer;
}
.ui-datepicker .ui-datepicker-title {
margin: 0;
padding: 10px 0;
font-size: 14px;
line-height: 14px;
text-align: center;
}
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
position: relative;
top: 0;
height: 34px;
width: 34px;
}
.ui-datepicker .ui-state-hover.ui-datepicker-prev,
.ui-datepicker .ui-state-hover.ui-datepicker-next {
border: none;
}
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-prev-hover {
left: 0;
}
.ui-datepicker .ui-datepicker-next,
.ui-datepicker .ui-datepicker-next-hover {
right: 0;
}
.ui-datepicker .ui-datepicker-next span,
.ui-datepicker .ui-datepicker-prev span {
display: none;
}
.ui-datepicker .ui-datepicker-prev {
float: left;
}
.ui-datepicker .ui-datepicker-next {
float: right;
}
.ui-datepicker .ui-datepicker-prev:before,
.ui-datepicker .ui-datepicker-next:before {
font: normal 20px/34px 'dashicons';
padding-left: 7px;
speak: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
width: 34px;
height: 34px;
}
.ui-datepicker .ui-datepicker-prev:before {
content: '\f341';
}
.ui-datepicker .ui-datepicker-next:before {
content: '\f345';
}
.ui-datepicker .ui-datepicker-prev-hover:before,
.ui-datepicker .ui-datepicker-next-hover:before {
opacity: 0.7;
}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
width: 33%;
}
.ui-datepicker thead {
font-weight: 600;
}
.ui-datepicker th {
padding: 10px;
border-width: 1px;
}
.ui-datepicker td {
padding: 0;
border: 1px solid #f4f4f4;
}
.ui-datepicker td.ui-datepicker-other-month {
border: transparent;
}
.ui-datepicker td.ui-datepicker-week-end {
background-color: #f4f4f4;
border: 1px solid #f4f4f4;
}
.ui-datepicker td.ui-datepicker-today {
background-color: #f0f0c0;
}
.ui-datepicker td.ui-datepicker-current-day {
background: #bbdd88;
}
.ui-datepicker td .ui-state-default {
background: transparent;
border: none;
text-align: center;
text-decoration: none;
width: auto;
display: block;
padding: 5px 10px;
font-weight: normal;
color: #444;
}
.ui-datepicker td.ui-state-disabled .ui-state-default {
opacity: 0.5;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,301 @@
<?php
use Automattic\Jetpack\Assets;
/*
* A prototype to allow inline editing / editor views for contact forms.\
*
* Originally developed in: http://github.com/automattic/gm2016-grunion-editor
* Authors: Michael Arestad, Andrew Ozz, and George Stephanis
*/
class Grunion_Editor_View {
/**
* Add hooks according to screen.
*
* @param WP_Screen $screen Data about current screen.
*/
public static function add_hooks( $screen ) {
if ( isset( $screen->base ) && 'post' === $screen->base ) {
add_action( 'admin_notices', array( __CLASS__, 'handle_editor_view_js' ) );
add_action( 'admin_head', array( __CLASS__, 'admin_head' ) );
}
}
public static function admin_head() {
remove_action( 'media_buttons', 'grunion_media_button', 999 );
add_action( 'media_buttons', array( __CLASS__, 'grunion_media_button' ), 999 );
}
public static function grunion_media_button() {
$title = __( 'Add Contact Form', 'jetpack' );
?>
<button type="button" id="insert-jetpack-contact-form" class="button" title="<?php echo esc_attr( $title ); ?>" href="javascript:;">
<span class="jetpack-contact-form-icon"></span>
<?php echo esc_html( $title ); ?>
</button>
<?php
}
public static function mce_external_plugins( $plugin_array ) {
$plugin_array['grunion_form'] = Assets::get_file_url_for_environment(
'_inc/build/contact-form/js/tinymce-plugin-form-button.min.js',
'modules/contact-form/js/tinymce-plugin-form-button.js'
);
return $plugin_array;
}
public static function mce_buttons( $buttons ) {
$size = sizeof( $buttons );
$buttons1 = array_slice( $buttons, 0, $size - 1 );
$buttons2 = array_slice( $buttons, $size - 1 );
return array_merge(
$buttons1,
array( 'grunion' ),
$buttons2
);
}
/**
* WordPress Shortcode Editor View JS Code
*/
public static function handle_editor_view_js() {
add_action( 'admin_print_footer_scripts', array( __CLASS__, 'editor_view_js_templates' ), 1 );
add_filter( 'mce_external_plugins', array( __CLASS__, 'mce_external_plugins' ) );
add_filter( 'mce_buttons', array( __CLASS__, 'mce_buttons' ) );
wp_enqueue_style( 'grunion-editor-ui', plugins_url( 'css/editor-ui.css', __FILE__ ) );
wp_style_add_data( 'grunion-editor-ui', 'rtl', 'replace' );
wp_enqueue_script(
'grunion-editor-view',
Assets::get_file_url_for_environment(
'_inc/build/contact-form/js/editor-view.min.js',
'modules/contact-form/js/editor-view.js'
),
array( 'wp-util', 'jquery', 'quicktags' ),
false,
true
);
wp_localize_script(
'grunion-editor-view', 'grunionEditorView', array(
'inline_editing_style' => plugins_url( 'css/editor-inline-editing-style.css', __FILE__ ),
'inline_editing_style_rtl' => plugins_url( 'css/editor-inline-editing-style-rtl.css', __FILE__ ),
'dashicons_css_url' => includes_url( 'css/dashicons.css' ),
'default_form' => '[contact-field label="' . __( 'Name', 'jetpack' ) . '" type="name" required="true" /]' .
'[contact-field label="' . __( 'Email', 'jetpack' ) . '" type="email" required="true" /]' .
'[contact-field label="' . __( 'Website', 'jetpack' ) . '" type="url" /]' .
'[contact-field label="' . __( 'Message', 'jetpack' ) . '" type="textarea" /]',
'labels' => array(
'submit_button_text' => __( 'Submit', 'jetpack' ),
/** This filter is documented in modules/contact-form/grunion-contact-form.php */
'required_field_text' => apply_filters( 'jetpack_required_field_text', __( '(required)', 'jetpack' ) ),
'edit_close_ays' => __( 'Are you sure you\'d like to stop editing this form without saving your changes?', 'jetpack' ),
'quicktags_label' => __( 'contact form', 'jetpack' ),
'tinymce_label' => __( 'Add contact form', 'jetpack' ),
),
)
);
add_editor_style( plugin_dir_url( __FILE__ ) . 'css/editor-style.css' );
}
/**
* JS Templates.
*/
public static function editor_view_js_templates() {
?>
<script type="text/html" id="tmpl-grunion-contact-form">
<form class="card jetpack-contact-form-shortcode-preview" action='#' method='post' class='contact-form commentsblock' onsubmit="return false;">
{{{ data.body }}}
<p class='contact-submit'>
<input type='submit' value='{{ data.submit_button_text }}' class='pushbutton-wide'/>
</p>
</form>
</script>
<script type="text/html" id="tmpl-grunion-field-email">
<div>
<label for='{{ data.id }}' class='grunion-field-label email'>{{ data.label }}<# if ( data.required ) print( " <span>" + data.required + "</span>" ) #></label>
<input type='email' name='{{ data.id }}' id='{{ data.id }}' value='{{ data.value }}' class='{{ data.class }}' placeholder='{{ data.placeholder }}' />
</div>
</script>
<script type="text/html" id="tmpl-grunion-field-telephone">
<div>
<label for='{{ data.id }}' class='grunion-field-label telephone'>{{ data.label }}<# if ( data.required ) print( " <span>" + data.required + "</span>" ) #></label>
<input type='tel' name='{{ data.id }}' id='{{ data.id }}' value='{{ data.value }}' class='{{ data.class }}' placeholder='{{ data.placeholder }}' />
</div>
</script>
<script type="text/html" id="tmpl-grunion-field-textarea">
<div>
<label for='contact-form-comment-{{ data.id }}' class='grunion-field-label textarea'>{{ data.label }}<# if ( data.required ) print( " <span>" + data.required + "</span>" ) #></label>
<textarea name='{{ data.id }}' id='contact-form-comment-{{ data.id }}' rows='20' class='{{ data.class }}' placeholder='{{ data.placeholder }}'>{{ data.value }}</textarea>
</div>
</script>
<script type="text/html" id="tmpl-grunion-field-radio">
<div>
<label class='grunion-field-label'>{{ data.label }}<# if ( data.required ) print( " <span>" + data.required + "</span>" ) #></label>
<# _.each( data.options, function( option ) { #>
<label class='grunion-radio-label radio'>
<input type='radio' name='{{ data.id }}' value='{{ option }}' class="{{ data.class }}" <# if ( option === data.value ) print( "checked='checked'" ) #> />
<span>{{ option }}</span>
</label>
<# }); #>
<div class='clear-form'></div>
</div>
</script>
<script type="text/html" id="tmpl-grunion-field-checkbox">
<div>
<label class='grunion-field-label checkbox'>
<input type='checkbox' name='{{ data.id }}' value='<?php esc_attr__( 'Yes', 'jetpack' ); ?>' class="{{ data.class }}" <# if ( data.value ) print( 'checked="checked"' ) #> />
<span>{{ data.label }}</span><# if ( data.required ) print( " <span>" + data.required + "</span>" ) #>
</label>
<div class='clear-form'></div>
</div>
</script>
<script type="text/html" id="tmpl-grunion-field-checkbox-multiple">
<div>
<label class='grunion-field-label'>{{ data.label }}<# if ( data.required ) print( " <span>" + data.required + "</span>" ) #></label>
<# _.each( data.options, function( option ) { #>
<label class='grunion-checkbox-multiple-label checkbox-multiple'>
<input type='checkbox' name='{{ data.id }}[]' value='{{ option }}' class="{{ data.class }}" <# if ( option === data.value || _.contains( data.value, option ) ) print( "checked='checked'" ) #> />
<span>{{ option }}</span>
</label>
<# }); #>
<div class='clear-form'></div>
</div>
</script>
<script type="text/html" id="tmpl-grunion-field-select">
<div>
<label for='{{ data.id }}' class='grunion-field-label select'>{{ data.label }}<# if ( data.required ) print( " <span>" + data.required + "</span>" ) #></label>
<select name='{{ data.id }}' id='{{ data.id }}' class="{{ data.class }}">
<# _.each( data.options, function( option ) { #>
<option <# if ( option === data.value ) print( "selected='selected'" ) #>>{{ option }}</option>
<# }); #>
</select>
</div>
</script>
<script type="text/html" id="tmpl-grunion-field-date">
<div>
<label for='{{ data.id }}' class='grunion-field-label {{ data.type }}'>{{ data.label }}<# if ( data.required ) print( " <span>" + data.required + "</span>" ) #></label>
<input type='text' name='{{ data.id }}' id='{{ data.id }}' value='{{ data.value }}' class="{{ data.class }}" />
</div>
</script>
<script type="text/html" id="tmpl-grunion-field-text">
<div>
<label for='{{ data.id }}' class='grunion-field-label {{ data.type }}'>{{ data.label }}<# if ( data.required ) print( " <span>" + data.required + "</span>" ) #></label>
<input type='text' name='{{ data.id }}' id='{{ data.id }}' value='{{ data.value }}' class='{{ data.class }}' placeholder='{{ data.placeholder }}' />
</div>
</script>
<script type="text/html" id="tmpl-grunion-field-url">
<div>
<label for='{{ data.id }}' class='grunion-field-label {{ data.type }}'>{{ data.label }}<# if ( data.required ) print( " <span>" + data.required + "</span>" ) #></label>
<input type='url' name='{{ data.id }}' id='{{ data.id }}' value='{{ data.value }}' class='{{ data.class }}' placeholder='{{ data.placeholder }}' />
</div>
</script>
<script type="text/html" id="tmpl-grunion-field-edit">
<div class="card is-compact grunion-field-edit grunion-field-{{ data.type }}" aria-label="<?php esc_attr_e( 'Form Field', 'jetpack' ); ?>">
<label class="grunion-name">
<span><?php esc_html_e( 'Field Label', 'jetpack' ); ?></span>
<input type="text" name="label" placeholder="<?php esc_attr_e( 'Label', 'jetpack' ); ?>" value="{{ data.label }}"/>
</label>
<?php
$grunion_field_types = array(
'text' => __( 'Text', 'jetpack' ),
'name' => __( 'Name', 'jetpack' ),
'email' => __( 'Email', 'jetpack' ),
'url' => __( 'Website', 'jetpack' ),
'textarea' => __( 'Textarea', 'jetpack' ),
'checkbox' => __( 'Checkbox', 'jetpack' ),
'checkbox-multiple' => __( 'Checkbox with Multiple Items', 'jetpack' ),
'select' => __( 'Drop down', 'jetpack' ),
'radio' => __( 'Radio', 'jetpack' ),
'date' => __( 'Date', 'jetpack' ),
);
?>
<div class="grunion-type-options">
<label class="grunion-type">
<?php esc_html_e( 'Field Type', 'jetpack' ); ?>
<select name="type">
<?php foreach ( $grunion_field_types as $type => $label ) : ?>
<option <# if ( '<?php echo esc_js( $type ); ?>' === data.type ) print( "selected='selected'" ) #> value="<?php echo esc_attr( $type ); ?>">
<?php echo esc_html( $label ); ?>
</option>
<?php endforeach; ?>
</select>
</label>
<label class="grunion-required">
<input type="checkbox" name="required" value="1" <# if ( data.required ) print( 'checked="checked"' ) #> />
<span><?php esc_html_e( 'Required?', 'jetpack' ); ?></span>
</label>
</div>
<label class="grunion-options">
<?php esc_html_e( 'Options', 'jetpack' ); ?>
<ol>
<# if ( data.options ) { #>
<# _.each( data.options, function( option ) { #>
<li><input type="text" name="option" value="{{ option }}" /> <a class="delete-option" href="javascript:;"><span class="screen-reader-text"><?php esc_html_e( 'Delete Option', 'jetpack' ); ?></span></a></li>
<# }); #>
<# } else { #>
<li><input type="text" name="option" /> <a class="delete-option" href="javascript:;"><span class="screen-reader-text"><?php esc_html_e( 'Delete Option', 'jetpack' ); ?></span></a></li>
<li><input type="text" name="option" /> <a class="delete-option" href="javascript:;"><span class="screen-reader-text"><?php esc_html_e( 'Delete Option', 'jetpack' ); ?></span></a></li>
<li><input type="text" name="option" /> <a class="delete-option" href="javascript:;"><span class="screen-reader-text"><?php esc_html_e( 'Delete Option', 'jetpack' ); ?></span></a></li>
<# } #>
<li><a class="add-option" href="javascript:;"><?php esc_html_e( 'Add new option...', 'jetpack' ); ?></a></li>
</ol>
</label>
<a href="javascript:;" class="delete-field"><span class="screen-reader-text"><?php esc_html_e( 'Delete Field', 'jetpack' ); ?></span></a>
</div>
</script>
<script type="text/html" id="tmpl-grunion-field-edit-option">
<li><input type="text" name="option" /> <a class="delete-option" href="javascript:;"><span class="screen-reader-text"><?php esc_html_e( 'Delete Option', 'jetpack' ); ?></span></a></li>
</script>
<script type="text/html" id="tmpl-grunion-editor-inline">
<h1 id="form-settings-header" class="grunion-section-header"><?php esc_html_e( 'Contact form information', 'jetpack' ); ?></h1>
<section class="card grunion-form-settings" aria-labelledby="form-settings-header">
<label><?php esc_html_e( 'What would you like the subject of the email to be?', 'jetpack' ); ?>
<input type="text" name="subject" value="{{ data.subject }}" />
</label>
<label><?php esc_html_e( 'Which email address should we send the submissions to?', 'jetpack' ); ?>
<input type="text" name="to" value="{{ data.to }}" />
</label>
</section>
<h1 id="form-fields-header" class="grunion-section-header"><?php esc_html_e( 'Contact form fields', 'jetpack' ); ?></h1>
<section class="grunion-fields" aria-labelledby="form-fields-header">
{{{ data.fields }}}
</section>
<section class="grunion-controls">
<?php submit_button( esc_html__( 'Add Field', 'jetpack' ), 'secondary', 'add-field', false ); ?>
<div class="grunion-update-controls">
<?php submit_button( esc_html__( 'Cancel', 'jetpack' ), 'delete', 'cancel', false ); ?>
<?php submit_button( esc_html__( 'Update Form', 'jetpack' ), 'primary', 'submit', false ); ?>
</div>
</section>
</script>
</div>
<?php
}
}
add_action( 'current_screen', array( 'Grunion_Editor_View', 'add_hooks' ) );

View File

@@ -0,0 +1,269 @@
<?php
use Automattic\Jetpack\Assets;
/**
* Template for form builder
*/
/**
* Filter to modify the limit of 5 additional contact form fields.
*
* @module contact-form
*
* @since 3.2.0
*
* @param int 5 Maximum number of additional fields.
*/
$max_new_fields = apply_filters( 'grunion_max_new_fields', 5 );
wp_register_script(
'grunion',
Assets::get_file_url_for_environment(
'_inc/build/contact-form/js/grunion.min.js',
'modules/contact-form/js/grunion.js'
),
array( 'jquery-ui-sortable', 'jquery-ui-draggable' ),
JETPACK__VERSION
);
wp_localize_script(
'grunion', 'GrunionFB_i18n', array(
'nameLabel' => esc_attr( _x( 'Name', 'Label for HTML form "Name" field in contact form builder', 'jetpack' ) ),
'emailLabel' => esc_attr( _x( 'Email', 'Label for HTML form "Email" field in contact form builder', 'jetpack' ) ),
'urlLabel' => esc_attr( _x( 'Website', 'Label for HTML form "URL/Website" field in contact form builder', 'jetpack' ) ),
'commentLabel' => esc_attr( _x( 'Comment', 'noun', 'jetpack' ) ),
'newLabel' => esc_attr( _x( 'New Field', 'Default label for new HTML form field in contact form builder', 'jetpack' ) ),
'optionsLabel' => esc_attr( _x( 'Options', 'Label for the set of options to be included in a user-created dropdown in contact form builder', 'jetpack' ) ),
'optionsLabel' => esc_attr( _x( 'Option', 'Label for an option to be included in a user-created dropdown in contact form builder', 'jetpack' ) ),
'firstOptionLabel' => esc_attr( _x( 'First option', 'Default label for the first option to be included in a user-created dropdown in contact form builder', 'jetpack' ) ),
'problemGeneratingForm' => esc_attr( _x( "Oops, there was a problem generating your form. You'll likely need to try again.", 'error message in contact form builder', 'jetpack' ) ),
'moveInstructions' => esc_attr__( "Drag up or down\nto re-arrange", 'jetpack' ),
'moveLabel' => esc_attr( _x( 'move', 'Label to drag HTML form fields around to change their order in contact form builder', 'jetpack' ) ),
'editLabel' => esc_attr( _x( 'edit', 'Link to edit an HTML form field in contact form builder', 'jetpack' ) ),
'savedMessage' => esc_attr__( 'Saved successfully', 'jetpack' ),
'requiredLabel' => esc_attr( _x( '(required)', 'This HTML form field is marked as required by the user in contact form builder', 'jetpack' ) ),
'exitConfirmMessage' => esc_attr__( 'Are you sure you want to exit the form editor without saving? Any changes you have made will be lost.', 'jetpack' ),
'maxNewFields' => intval( $max_new_fields ),
)
);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php esc_html_e( 'Contact Form', 'jetpack' ); ?></title>
<script type="text/javascript">
var ajaxurl = '<?php echo admin_url( 'admin-ajax.php' ); ?>';
var postId = <?php echo absint( $_GET['post_id'] ); ?>;
var ajax_nonce_shortcode = '<?php echo wp_create_nonce( 'grunion_shortcode' ); ?>';
var ajax_nonce_json = '<?php echo wp_create_nonce( 'grunion_shortcode_to_json' ); ?>';
</script>
<?php wp_print_scripts( 'grunion' ); ?>
<script type="text/javascript">
jQuery(document).ready(function () {
FB.ContactForm.init();
FB.ContactForm.resizePop();
});
jQuery(window).resize(function() {
setTimeout(function () { FB.ContactForm.resizePop(); }, 50);
});
</script>
<style>
/* Reset */
html { height: 100%; }
body, div, ul, ol, li, h1, h2, h3, h4, h5, h6, form, fieldset, legend, input, button, textarea, p, blockquote, th, td { margin: 0; padding: 0; }
body { background: #F9F9F9; font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif; font-size:12px; color: #333; line-height:1.5em; height: 100%; width: 100%; padding-bottom: 20px !important; }
a { color: #21759B; text-decoration: none; }
a:hover { text-decoration: underline; text-shadow: none !important; }
h1 { font-size: 21px; color:#5A5A5A; font-family:Georgia,"Times New Roman",Times,serif; font-weight:normal; margin-bottom: 21px; }
h3 { font-size: 13px; color: #666; margin-bottom: 18px; }
input { width: 301px; }
input[type='text'] { padding: 3px 5px; margin-right: 4px; -moz-border-radius:3px; border-radius:3px; -webkit-border-radius:3px; }
input[type='text']:focus { border: 2px solid #80B8D9; outline: 0 !important; }
input[type='checkbox'], input[type='radio'] { width: auto !important; float: left; margin-top: 3px; margin-right: 8px; }
input.fieldError, select.fieldError, textarea.fieldError { border: 2px solid #D56F55; }
img { border: none; }
label { color: #222; font-weight: bold; display: block; margin-bottom: 4px; }
label.radio { width: auto; margin: -2px 0 0 5px; }
label span.label-required { color: #AAA; margin-left: 4px; font-weight: normal; }
td { vertical-align: top; }
select { width: 300px; }
textarea { height: 100px; width: 311px; }
/* Core */
#media-upload-header { border-bottom: 1px solid #DFDFDF; font-weight:bold; margin:0; padding:3px 5px 0 5px; position:relative; background: #FFF; }
#sidemenu { bottom:-1px; font-size:12px; list-style:none outside none; padding-left:10px; position:relative; left:0; margin:0 5px; overflow:hidden; }
#sidemenu a { text-decoration:none; border-top: 1px solid #FFF; display:block; float:left; line-height:28px; padding:0 13px; outline: none; }
#sidemenu a.current { background-color:#F9F9F9; border-color:#DFDFDF #DFDFDF #F9F9F9; color:#D54E21; -moz-border-radius:4px 4px 0 0; border-radius:4px 4px 0 0; -webkit-border-radius:4px 4px 0 0; border-style:solid; border-width:1px; font-weight:normal; }
#sidemenu li { display:inline; margin-bottom:6px; line-height:200%; list-style:none outside none; margin:0; padding:0; text-align:center; white-space:nowrap; }
.button { background-color:#f2f2f2; border-color:#BBBBBB; min-width:80px; text-align:center; color:#464646; text-shadow:0 1px 0 #FFFFFF; border-style:solid; border-width:1px; cursor:pointer; width: auto; font-size:11px !important; line-height:13px; padding:3px 11px; margin-top: 12px; text-decoration:none; -moz-border-radius:11px; border-radius:11px; -webkit-border-radius:11px }
.button-primary { background-color:#21759B; font-weight: bold; border-color:#298CBA; text-align:center; color:#EAF2FA; text-shadow:0 -1px 0 rgba(0, 0, 0, 0.3); border-style:solid; border-width:1px; cursor:pointer; width: auto; font-size:11px !important; line-height:13px; padding:3px 11px; margin-top: 21px; text-decoration:none; -moz-border-radius:11px; border-radius:11px; -webkit-border-radius:11px }
.clear { clear: both; }
.fb-add-field { padding-left: 10px; }
.fb-add-option { margin: 0 0 14px 100px; }
.fb-container { margin: 21px; padding-bottom: 20px; }
.fb-desc, #fb-add-field { margin-top: 34px; }
.fb-extra-fields { margin-bottom: 2px; }
.fb-form-case { background: #FFF; padding: 13px; border: 1px solid #E2E2E2; width: 336px; -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px }
.fb-form-case a { outline: none; }
.fb-form-case input[type='text'], .fb-form-case textarea { background: #E1E1E1; }
.fb-radio-label { display: inline-block; float: left; width: 290px; }
.fb-new-fields { position: relative; border: 1px dashed #FFF; background: #FFF; padding: 4px 10px 10px; cursor: default; }
.fb-new-fields:hover { border: 1px dashed #BBDBEA; background: #F7FBFD; }
.fb-options { width: 170px !important; }
.fb-remove { background: url('<?php echo GRUNION_PLUGIN_URL; ?>/images/grunion-remove-field.gif') no-repeat; position: absolute; cursor: pointer !important; right: -26px; top: 27px; width: 20px; height: 23px; }
.fb-remove:hover { background: url('<?php echo GRUNION_PLUGIN_URL; ?>/images/grunion-remove-field-hover.gif') no-repeat; }
.fb-remove-small { top: 2px !important; }
.fb-remove-option { position: absolute; top: 1px; right: 10px; width: 20px; height: 23px; background: url('<?php echo GRUNION_PLUGIN_URL; ?>/images/grunion-remove-option.gif') no-repeat; }
.fb-remove-option:hover { background: url('<?php echo GRUNION_PLUGIN_URL; ?>/images/grunion-remove-option-hover.gif') no-repeat; }
.fb-reorder { cursor: move; position: relative; }
.fb-reorder:hover div { display: block !important; width: 130px !important; position: absolute; top: 0; right: 0; z-index: 200; padding: 5px 10px; color: #555; font-size: 11px; background: #FFF; border: 1px solid #CCC; -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; }
.fb-right { position: absolute; right: 0; top: 0; width: 315px; margin: 57px 21px 0 0; }
.fb-right .fb-new-fields { border: none; background: #F9F9F9; padding: 0; }
.fb-right input[type='text'] { width: 195px; margin-bottom: 14px; }
.fb-right label { color: #444; width: 100px; float: left; font-weight: normal; }
.fb-right select { width: 195px !important; margin-bottom: 14px; }
.fb-right textarea { margin-bottom: 13px; }
.fb-right p { color: #999; line-height: 19px; }
.fb-settings input[type='text'], .fb-settings textarea { background-image: none !important; }
.fb-success { position: absolute; top: -3px; right: 100px; padding: 6px 23px 4px 23px; background: #FFFFE0; font-weight: normal; border: 1px solid #E6DB55; color: #333; -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; }
.right { float: right; }
/* rtl */
body.rtl{ direction: rtl; font-family:Tahoma,Arial,sans-serif}
.rtl input[type='text'] { margin-left: 4px; margin-right: 0; }
.rtl input[type='checkbox'], .rtl input[type='radio'] { float: right; }
.rtl input[type='radio'] { margin-left: 8px; margin-right: 0; }
.rtl label.radio { margin: -2px 5px 0 0; }
.rtl label span.label-required { margin-right: 4px; margin-left:0 }
.rtl #sidemenu { padding-right:10px; padding-left: 0; left:auto; right: 0; }
.rtl #sidemenu a { float:right; }
.rtl .fb-add-field { padding-right: 10px; padding-left: 0; }
.rtl .fb-add-option { margin: 0 100px 14px 0; }
.rtl .fb-radio-label { margin-right: 8px; margin-left: 0; float: right; }
.rtl .fb-remove { right: auto; left: -26px; transform: scaleX(-1); }
.rtl .fb-remove-option { right: auto; left: 10px; }
.rtl .fb-reorder:hover div { left: 0; right: auto; }
.rtl .fb-right { left: 0; right: auto; margin: 57px 0 0 21px; }
.rtl .fb-right label { float: right; }
.rtl .fb-success { right: auto; left: 100px;}
.rtl .right { float: left; }
@media only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) {
.fb-remove { background: url('<?php echo GRUNION_PLUGIN_URL; ?>/images/grunion-remove-field-2x.png') no-repeat; background-size: 20px 23px; }
.fb-remove:hover { background: url('<?php echo GRUNION_PLUGIN_URL; ?>/images/grunion-remove-field-hover-2x.png') no-repeat; background-size: 20px 23px; }
.fb-remove-option { background: url('<?php echo GRUNION_PLUGIN_URL; ?>/images/grunion-remove-option-2x.png') no-repeat; background-size: 20px 23px; }
.fb-remove-option:hover { background: url('<?php echo GRUNION_PLUGIN_URL; ?>/images/grunion-remove-option-hover-2x.png') no-repeat; background-size: 20px 23px; }
}
</style>
</head>
<body
<?php
if ( is_rtl() ) {
echo 'class="rtl"'; }
?>
>
<div id="media-upload-header">
<div id="fb-success" class="fb-success" style="display: none;"><?php esc_html_e( 'Your new field was saved successfully', 'jetpack' ); ?></div>
<ul id="sidemenu">
<li id="tab-preview"><a class="current" href=""><?php esc_html_e( 'Form builder', 'jetpack' ); ?></a></li>
<li id="tab-settings"><a href=""><?php esc_html_e( 'Email notifications', 'jetpack' ); ?></a></li>
</ul>
</div>
<div class="fb-right">
<div id="fb-desc" class="fb-desc">
<h3><?php esc_html_e( 'How does this work?', 'jetpack' ); ?></h3>
<p><?php esc_html_e( 'By adding a contact form, your readers will be able to submit feedback to you. All feedback is automatically scanned for spam, and the legitimate feedback will be emailed to you.', 'jetpack' ); ?></p>
<h3 style="margin-top: 21px;"><?php esc_html_e( 'Can I add more fields?', 'jetpack' ); ?></h3>
<p>
<?php
printf(
esc_html( _x( 'Sure thing. %1$s to add a new text box, textarea, radio, checkbox, or dropdown field.', '%1$s = "Click here" in an HTML link', 'jetpack' ) ),
'<a href="#" class="fb-add-field" style="padding-left: 0;">' . esc_html__( 'Click here', 'jetpack' ) . '</a>'
);
?>
</p>
<h3 style="margin-top: 21px;"><?php esc_html_e( 'Can I view my feedback within WordPress?', 'jetpack' ); ?></h3>
<p>
<?php
printf(
esc_html( _x( 'Yep, you can read your feedback at any time by clicking the "%1$s" link in the admin menu.', '%1$s = "Feedback" in an HTML link', 'jetpack' ) ),
'<a id="fb-feedback" href="' . admin_url( 'edit.php?post_type=feedback' ) . '">' . esc_html__( 'Feedback', 'jetpack' ) . '</a>'
);
?>
</p>
<div class="clear"></div>
</div>
<div id="fb-email-desc" class="fb-desc" style="display: none;">
<h3><?php esc_html_e( 'Do I need to fill this out?', 'jetpack' ); ?></h3>
<p><?php esc_html_e( 'Nope. However, if you&#8217;d like to modify where your feedback is sent, or the subject line you can. If you don&#8217;t make any changes here, feedback will be sent to the author of the page/post and the subject will be the name of this page/post.', 'jetpack' ); ?></p>
<h3 style="margin-top: 21px;"><?php esc_html_e( 'Can I send a notification to more than one person?', 'jetpack' ); ?></h3>
<p><?php esc_html_e( 'Yep. You can enter multiple email addresses in the Email address field, and separate them with commas. A notification email will then be sent to each email address.', 'jetpack' ); ?></p>
<div class="clear"></div>
</div>
<div id="fb-add-field" style="display: none;">
<h3><?php esc_html_e( 'Edit this new field', 'jetpack' ); ?></h3>
<label for="fb-new-label"><?php esc_html_e( 'Label', 'jetpack' ); ?></label>
<input type="text" id="fb-new-label" value="<?php esc_attr_e( 'New field', 'jetpack' ); ?>" />
<label for="fb-new-label"><?php esc_html_e( 'Field type', 'jetpack' ); ?></label>
<select id="fb-new-type">
<option value="checkbox"><?php esc_html_e( 'Checkbox', 'jetpack' ); ?></option>
<option value="checkbox-multiple"><?php esc_html_e( 'Checkbox with Multiple Items', 'jetpack' ); ?></option>
<option value="select"><?php esc_html_e( 'Drop down', 'jetpack' ); ?></option>
<option value="email"><?php esc_html_e( 'Email', 'jetpack' ); ?></option>
<option value="name"><?php esc_html_e( 'Name', 'jetpack' ); ?></option>
<option value="radio"><?php esc_html_e( 'Radio', 'jetpack' ); ?></option>
<option value="text" selected="selected"><?php esc_html_e( 'Text', 'jetpack' ); ?></option>
<option value="textarea"><?php esc_html_e( 'Textarea', 'jetpack' ); ?></option>
<option value="url"><?php esc_html_e( 'Website', 'jetpack' ); ?></option>
</select>
<div class="clear"></div>
<div id="fb-options" style="display: none;">
<div id="fb-new-options">
<label for="fb-option0"><?php esc_html_e( 'Options', 'jetpack' ); ?></label>
<input type="text" id="fb-option0" optionid="0" value="<?php esc_attr_e( 'First option', 'jetpack' ); ?>" class="fb-options" />
</div>
<div id="fb-add-option" class="fb-add-option">
<a href="#" id="fb-another-option"><?php esc_html_e( 'Add another option', 'jetpack' ); ?></a>
</div>
</div>
<div class="fb-required">
<label for="fb-new-label"></label>
<input type="checkbox" id="fb-new-required" />
<label for="fb-new-label" class="fb-radio-label"><?php esc_html_e( 'Required?', 'jetpack' ); ?></label>
<div class="clear"></div>
</div>
<input type="hidden" id="fb-field-id" />
<input type="submit" class="button" value="<?php esc_attr_e( 'Save this field', 'jetpack' ); ?>" id="fb-save-field" name="save">
</div>
</div>
<form id="fb-preview">
<div id="fb-preview-form" class="fb-container">
<h1><?php esc_html_e( 'Here&#8217;s what your form will look like', 'jetpack' ); ?></h1>
<div id="sortable" class="fb-form-case">
<div id="fb-extra-fields" class="fb-extra-fields"></div>
<a href="#" id="fb-new-field" class="fb-add-field"><?php esc_html_e( 'Add a new field', 'jetpack' ); ?></a>
</div>
<input type="submit" class="button-primary" tabindex="4" value="<?php esc_attr_e( 'Add this form to my post', 'jetpack' ); ?>" id="fb-save-form" name="save">
</div>
<div id="fb-email-settings" class="fb-container" style="display: none;">
<h1><?php esc_html_e( 'Email settings', 'jetpack' ); ?></h1>
<div class="fb-form-case fb-settings">
<label for="fb-fieldname"><?php esc_html_e( 'Enter your email address', 'jetpack' ); ?></label>
<input type="text" id="fb-field-my-email" style="background: #FFF !important;" />
<label for="fb-fieldemail" style="margin-top: 14px;"><?php esc_html_e( 'What should the subject line be?', 'jetpack' ); ?></label>
<input type="text" id="fb-field-subject" style="background: #FFF !important;" />
</div>
<input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save and go back to form builder', 'jetpack' ); ?>" id="fb-prev-form" name="save">
</div>
</form>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 B

View File

@@ -0,0 +1,284 @@
/* global grunionEditorView, tinyMCE, QTags, wp */
( function( $, wp, grunionEditorView ) {
wp.mce = wp.mce || {};
if ( 'undefined' === typeof wp.mce.views ) {
return;
}
wp.mce.grunion_wp_view_renderer = {
shortcode_string: 'contact-form',
template: wp.template( 'grunion-contact-form' ),
field_templates: {
email: wp.template( 'grunion-field-email' ),
telephone: wp.template( 'grunion-field-telephone' ),
textarea: wp.template( 'grunion-field-textarea' ),
radio: wp.template( 'grunion-field-radio' ),
checkbox: wp.template( 'grunion-field-checkbox' ),
'checkbox-multiple': wp.template( 'grunion-field-checkbox-multiple' ),
select: wp.template( 'grunion-field-select' ),
date: wp.template( 'grunion-field-date' ),
text: wp.template( 'grunion-field-text' ),
name: wp.template( 'grunion-field-text' ),
url: wp.template( 'grunion-field-url' ),
},
edit_template: wp.template( 'grunion-field-edit' ),
editor_inline: wp.template( 'grunion-editor-inline' ),
editor_option: wp.template( 'grunion-field-edit-option' ),
getContent: function() {
var content = this.shortcode.content,
index = 0,
field,
named,
body = '';
// If it's the legacy `[contact-form /]` syntax, populate default fields.
if ( ! content ) {
content = grunionEditorView.default_form;
}
// Render the fields.
while ( ( field = wp.shortcode.next( 'contact-field', content, index ) ) ) {
index = field.index + field.content.length;
named = field.shortcode.attrs.named;
if ( ! named.type || ! this.field_templates[ named.type ] ) {
named.type = 'text';
}
if ( named.required ) {
named.required = grunionEditorView.labels.required_field_text;
}
if ( named.options && 'string' === typeof named.options ) {
named.options = named.options.split( ',' );
}
body += this.field_templates[ named.type ]( named );
}
var options = {
body: body,
submit_button_text: grunionEditorView.labels.submit_button_text,
};
return this.template( options );
},
edit: function( data, update_callback ) {
var shortcode_data = wp.shortcode.next( this.shortcode_string, data ),
shortcode = shortcode_data.shortcode,
$tinyMCE_document = $( tinyMCE.activeEditor.getDoc() ),
$view = $tinyMCE_document.find( '.wpview.wpview-wrap' ).filter( function() {
return $( this ).attr( 'data-mce-selected' );
} ),
$editframe = $( '<iframe scrolling="no" class="inline-edit-contact-form" />' ),
index = 0,
named,
fields = '',
field;
if ( ! shortcode.content ) {
shortcode.content = grunionEditorView.default_form;
}
// Render the fields.
while ( ( field = wp.shortcode.next( 'contact-field', shortcode.content, index ) ) ) {
index = field.index + field.content.length;
named = field.shortcode.attrs.named;
if ( named.options && 'string' === typeof named.options ) {
named.options = named.options.split( ',' );
}
fields += this.edit_template( named );
}
$editframe.on( 'checkheight', function() {
var innerDoc = this.contentDocument ? this.contentDocument : this.contentWindow.document;
this.style.height = '10px';
this.style.height = 5 + innerDoc.body.scrollHeight + 'px';
tinyMCE.activeEditor.execCommand( 'wpAutoResize' );
} );
$editframe.on( 'load', function() {
var stylesheet_url =
1 === window.isRtl
? grunionEditorView.inline_editing_style_rtl
: grunionEditorView.inline_editing_style,
$stylesheet = $( '<link rel="stylesheet" href="' + stylesheet_url + '" />' ),
$dashicons_css = $(
'<link rel="stylesheet" href="' + grunionEditorView.dashicons_css_url + '" />'
);
$stylesheet.on( 'load', function() {
$editframe
.contents()
.find( 'body' )
.css( 'visibility', 'visible' );
$editframe.trigger( 'checkheight' );
} );
$editframe
.contents()
.find( 'head' )
.append( $stylesheet )
.append( $dashicons_css );
$editframe
.contents()
.find( 'body' )
.html(
wp.mce.grunion_wp_view_renderer.editor_inline( {
to: shortcode.attrs.named.to,
subject: shortcode.attrs.named.subject,
fields: fields,
} )
)
.css( 'visibility', 'hidden' );
$editframe
.contents()
.find( 'input:first' )
.focus();
setTimeout( function() {
$editframe.trigger( 'checkheight' );
}, 250 );
// Add a second timeout for super long forms racing, and to not slow it down for shorter forms unnecessarily.
setTimeout( function() {
$editframe.trigger( 'checkheight' );
}, 500 );
var $editfields = $editframe.contents().find( '.grunion-fields' ),
$buttons = $editframe.contents().find( '.grunion-controls' );
$editfields.sortable();
// Now, add all the listeners!
$editfields.on( 'change select', 'select[name=type]', function() {
$( this ).closest( '.grunion-field-edit' )[ 0 ].className =
'card is-compact grunion-field-edit grunion-field-' + $( this ).val();
$editframe.trigger( 'checkheight' );
} );
$editfields.on( 'click', '.delete-option', function( e ) {
e.preventDefault();
$( this )
.closest( 'li' )
.remove();
$editframe.trigger( 'checkheight' );
} );
$editfields.on( 'click', '.add-option', function( e ) {
var $new_option = $( wp.mce.grunion_wp_view_renderer.editor_option() );
e.preventDefault();
$( this )
.closest( 'li' )
.before( $new_option );
$editframe.trigger( 'checkheight' );
$new_option.find( 'input:first' ).focus();
} );
$editfields.on( 'click', '.delete-field', function( e ) {
e.preventDefault();
$( this )
.closest( '.card' )
.remove();
$editframe.trigger( 'checkheight' );
} );
$buttons.find( 'input[name=submit]' ).on( 'click', function() {
var new_data = shortcode;
new_data.type = 'closed';
new_data.attrs = {};
new_data.content = '';
$editfields.children().each( function() {
var field_shortcode = {
tag: 'contact-field',
type: 'single',
attrs: {
label: $( this )
.find( 'input[name=label]' )
.val(),
type: $( this )
.find( 'select[name=type]' )
.val(),
},
},
options = [];
if ( $( this ).find( 'input[name=required]:checked' ).length ) {
field_shortcode.attrs.required = '1';
}
$( this )
.find( 'input[name=option]' )
.each( function() {
if ( $( this ).val() ) {
options.push( $( this ).val() );
}
} );
if ( options.length ) {
field_shortcode.attrs.options = options.join( ',' );
}
new_data.content += wp.shortcode.string( field_shortcode );
} );
if (
$editframe
.contents()
.find( 'input[name=to]' )
.val()
) {
new_data.attrs.to = $editframe
.contents()
.find( 'input[name=to]' )
.val();
}
if (
$editframe
.contents()
.find( 'input[name=subject]' )
.val()
) {
new_data.attrs.subject = $editframe
.contents()
.find( 'input[name=subject]' )
.val();
}
update_callback( wp.shortcode.string( new_data ) );
} );
$buttons.find( 'input[name=cancel]' ).on( 'click', function() {
update_callback( wp.shortcode.string( shortcode ) );
} );
$buttons.find( 'input[name=add-field]' ).on( 'click', function() {
var $new_field = $( wp.mce.grunion_wp_view_renderer.edit_template( {} ) );
$editfields.append( $new_field );
$editfields.sortable( 'refresh' );
$editframe.trigger( 'checkheight' );
$new_field.find( 'input:first' ).focus();
} );
} );
$view.html( $editframe );
},
};
wp.mce.views.register( 'contact-form', wp.mce.grunion_wp_view_renderer );
// Add the 'text' editor button.
QTags.addButton( 'grunion_shortcode', grunionEditorView.labels.quicktags_label, function() {
QTags.insertContent( '[contact-form]' + grunionEditorView.default_form + '[/contact-form]' );
} );
var $wp_content_wrap = $( '#wp-content-wrap' );
$( '#insert-jetpack-contact-form' ).on( 'click', function( e ) {
e.preventDefault();
if ( $wp_content_wrap.hasClass( 'tmce-active' ) ) {
tinyMCE.execCommand( 'grunion_add_form' );
} else if ( $wp_content_wrap.hasClass( 'html-active' ) ) {
QTags.insertContent( '[contact-form]' + grunionEditorView.default_form + '[/contact-form]' );
} else {
window.console.error( 'Neither TinyMCE nor QuickTags is active. Unable to insert form.' );
}
} );
} )( jQuery, wp, grunionEditorView );

View File

@@ -0,0 +1,30 @@
/* global ajaxurl */
jQuery( function( $ ) {
$( document ).on( 'click', '#jetpack-check-feedback-spam:not(.button-disabled)', function( e ) {
e.preventDefault();
$( '#jetpack-check-feedback-spam:not(.button-disabled)' ).addClass( 'button-disabled' );
$( '.jetpack-check-feedback-spam-spinner' )
.addClass( 'spinner' )
.show();
grunion_check_for_spam( 0, 100 );
} );
function grunion_check_for_spam( offset, limit ) {
$.post(
ajaxurl,
{
action: 'grunion_recheck_queue',
offset: offset,
limit: limit,
},
function( result ) {
if ( result.processed < limit ) {
window.location.reload();
} else {
grunion_check_for_spam( offset + limit, limit );
}
}
);
}
} );

View File

@@ -0,0 +1,3 @@
jQuery( function( $ ) {
$( '.contact-form input.jp-contact-form-date' ).datepicker();
} );

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,37 @@
/* global grunionEditorView, tinymce */
( function() {
tinymce.create( 'tinymce.plugins.grunion_form', {
init: function( editor ) {
editor.addButton( 'grunion', {
title: grunionEditorView.labels.tinymce_label,
cmd: 'grunion_add_form',
icon: 'grunion',
} );
editor.addCommand( 'grunion_add_form', function() {
if ( grunionEditorView.default_form ) {
editor.execCommand(
'mceInsertContent',
0,
'[contact-form]' + grunionEditorView.default_form + '[/contact-form]'
);
} else {
editor.execCommand( 'mceInsertContent', 0, '[contact-form /]' );
}
} );
},
createControl: function() {
return null;
},
getInfo: function() {
return {
longname: 'Grunion Contact Form',
author: 'Automattic',
version: '1',
};
},
} );
tinymce.PluginManager.add( 'grunion_form', tinymce.plugins.grunion_form );
} )();