windhamdavid 10 years ago
parent
commit
0c6f2b832a
6 changed files with 565 additions and 157 deletions
  1. 326 27
      css/form.css
  2. 1 0
      functions.php
  3. 136 0
      inc/form.php
  4. 0 38
      inc/tweaks.php
  5. 102 0
      js/form.js
  6. 0 92
      style.css

+ 326 - 27
css/form.css

@@ -1,3 +1,138 @@
+.gform_wrapper ul { padding-left: 0; list-style: none }
+
+.gform_wrapper li { margin-bottom: 15px }
+
+.gform_wrapper form { margin-bottom: 0 }
+
+.gform_wrapper .gfield_required { padding-left: 1px; color: #b94a48 }
+
+.ginput_container input[type="text"], .ginput_container select, .ginput_container textarea { 
+	display: block; width: 100%; height: 34px; 
+	padding: 6px 12px; font-size: 14px; 
+	line-height: 1.428571429; color: #555; 
+	vertical-align: middle; 
+	background-color: #fff; 
+	border: 1px solid #ccc; 
+	border-radius: 4px; 
+	-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); 
+	box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); 
+	-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; 
+	transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s 
+}
+.ginput_container input[type="checkbox"] {
+    margin-right: 5px;
+}
+.ginput_container input:-moz-placeholder, .ginput_container select:-moz-placeholder, .ginput_container textarea:-moz-placeholder {
+    color:#999
+}
+.ginput_container input::-moz-placeholder, .ginput_container select::-moz-placeholder, .ginput_container textarea::-moz-placeholder {
+    color:#999
+}
+.ginput_container input:-ms-input-placeholder, .ginput_container select:-ms-input-placeholder, .ginput_container textarea:-ms-input-placeholder {
+    color:#999
+}
+.ginput_container input::-webkit-input-placeholder, .ginput_container select::-webkit-input-placeholder, .ginput_container textarea::-webkit-input-placeholder {
+    color:#999
+}
+
+.ginput_container input:focus, .ginput_container select:focus, .ginput_container textarea:focus { 
+	border-color: #66afe9; 
+	outline: 0; 
+	-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(102,175,233,0.6); box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(102,175,233,0.6) 
+}
+
+.ginput_container input[disabled], .ginput_container select[disabled], .ginput_container textarea[disabled], .ginput_container input[readonly], .ginput_container select[readonly], .ginput_container textarea[readonly], fieldset[disabled] .ginput_container input, fieldset[disabled] .ginput_container select, fieldset[disabled] .ginput_container textarea { 
+	cursor: not-allowed; 
+	background-color: #eee 
+}
+
+textarea.ginput_container input, textarea.ginput_container select, textarea.ginput_container textarea { height: auto }
+
+.ginput_container textarea { height: auto }
+
+.gform_button { 
+	display: inline-block; 
+	padding: 6px 12px; 
+	margin-bottom: 0; 
+	font-size: 14px; 
+	font-weight: normal; 
+	line-height: 1.428571429; 
+	color: #fff !important; 
+	text-align: center; 
+	white-space: nowrap; 
+	vertical-align: middle; 
+	cursor: pointer; 
+	background-color: #428bca; 
+	border: 1px solid transparent; 
+	border-color: #357ebd; border-radius: 4px; 
+	-webkit-user-select: none; 
+	-moz-user-select: none; 
+	-ms-user-select: none; 
+	-o-user-select: none; 
+	user-select: none 
+}
+
+.gform_button:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px }
+
+.gform_button:hover, .gform_button:focus { color: #333; text-decoration: none }
+
+.gform_button:active, .gform_button.active { background-image: none; outline: 0; -webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,0.125); box-shadow: inset 0 3px 5px rgba(0,0,0,0.125) }
+
+.gform_button.disabled, .gform_button[disabled], fieldset[disabled] .gform_button { pointer-events: none; cursor: not-allowed; opacity: .65; filter: alpha(opacity=65); -webkit-box-shadow: none; box-shadow: none }
+
+.gform_button:hover, .gform_button:focus, .gform_button:active, .gform_button.active, .open .dropdown-toggle.gform_button { color: #fff; background-color: #3276b1; border-color: #285e8e }
+
+.gform_button:active, .gform_button.active, .open .dropdown-toggle.gform_button { background-image: none }
+
+.gform_button.disabled, .gform_button[disabled], fieldset[disabled] .gform_button, .gform_button.disabled:hover, .gform_button[disabled]:hover, fieldset[disabled] .gform_button:hover, .gform_button.disabled:focus, .gform_button[disabled]:focus, fieldset[disabled] .gform_button:focus, .gform_button.disabled:active, .gform_button[disabled]:active, fieldset[disabled] .gform_button:active, .gform_button.disabled.active, .gform_button[disabled].active, fieldset[disabled] .gform_button.active { background-color: #428bca; border-color: #357ebd }
+
+.gform_wrapper .gfield_error .gfield_label { color: #b94a48 }
+
+.gform_wrapper .gfield_error input, .gform_wrapper .gfield_error select, .gform_wrapper .gfield_error textarea { color: #b94a48; background-color: #f2dede; border-color: #eed3d7 }
+
+.gform_wrapper .gfield_error input:focus, .gform_wrapper .gfield_error select:focus, .gform_wrapper .gfield_error textarea:focus { border-color: #b94a48; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(185,74,72,0.6); box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(185,74,72,0.6) }
+
+.validation_error { padding: 15px; margin-bottom: 20px; color: #b94a48; background-color: #f2dede; border: 1px solid transparent; border-color: #eed3d7; border-radius: 4px }
+
+.validation_error h4 { margin-top: 0; color: inherit }
+
+.validation_error .alert-link { font-weight: bold }
+
+.validation_error>p, .validation_error>ul { margin-bottom: 0 }
+
+.validation_error>p+p { margin-top: 5px }
+
+.validation_error hr { border-top-color: #e6c1c7 }
+
+.validation_error .alert-link { color: #953b39 }
+
+#gforms_confirmation_message { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px }
+
+#gforms_confirmation_message h4 { margin-top: 0; color: inherit }
+
+#gforms_confirmation_message .alert-link { font-weight: bold }
+
+#gforms_confirmation_message>p, #gforms_confirmation_message>ul { margin-bottom: 0 }
+
+#gforms_confirmation_message>p+p { margin-top: 5px }
+
+.gfield_label { margin-bottom: 5px; font-size:  14px;}
+
+.ginput_complex > span > label { font-size: 11px; }
+
+.gform_validation_container,
+.gform_wrapper .gform_validation_container,
+body .gform_wrapper li.gform_validation_container,
+body .gform_wrapper .gform_body ul.gform_fields li.gfield.gform_validation_container,
+body .gform_wrapper ul.gform_fields li.gfield.gform_validation_container {
+    display: none !important;
+    position: absolute !important;
+    left: -9000px;
+}
+
+
+
+
 body .gform_wrapper.gf_reset_wrapper,
 body .gform_wrapper.gf_reset_wrapper div,
 body .gform_wrapper.gf_reset_wrapper span,
@@ -139,7 +274,6 @@ body .gform_wrapper.gf_reset_wrapper :focus {
 .gform_wrapper input[type=number],
 .gform_wrapper input[type=password] {
 	outline-style: none;
-	font-size: 11px;
 	font-family: inherit;
 	padding: 5px 2px 5px 2px;
 	letter-spacing: normal;
@@ -153,7 +287,6 @@ body .gform_wrapper.gf_reset_wrapper :focus {
 
 .gform_wrapper textarea {
 	outline-style: none;
-	font-size: 11px;
 	font-family: inherit;
 	letter-spacing: normal;
 	padding: 4px 2px 4px 2px;
@@ -215,7 +348,6 @@ html>body .entry ul,
 }
 
 .gform_wrapper select {
-	font-size: 11px;
 	font-family: inherit;
 	padding: 5px 0 5px 0;
 	letter-spacing: normal;
@@ -642,32 +774,18 @@ html>body .entry ul,
 
 .gform_wrapper li.gfield.gfield_error,
 .gform_wrapper li.gfield.gfield_error.gfield_contains_required.gfield_creditcard_warning {
-	background-color: #FFDFE0;
+
 	margin-bottom: 6px !important;
 	padding: 6px 6px 4px 6px !important;
-	border-top: 1px solid #C89797;
-	border-bottom: 1px solid #C89797;
+
 }
 
 .gform_wrapper li.gfield.gfield_creditcard_warning {
-	margin-bottom: 6px !important;
-	padding: 6px 6px 4px 6px !important;
-	border: 1px dashed #C89797;
+	display:none;
 }
 
 .gform_wrapper li.gfield.gfield_creditcard_warning div.gfield_creditcard_warning_message {
-	font-size:1em;
-	font-family: "Lucida Grande", "Lucida Sans", "Lucida Sans Unicode", "DejaVu Sans", "Bitstream Vera Sans", "Liberation Sans", Verdana, "Verdana Ref", sans-serif;
-	padding: 10px 20px 10px 45px;
-	min-height: 25px;
-	background-repeat: no-repeat;
-	background-position: 0 0;
-	background-color: #790000;
-	border-bottom: 1px solid #620101;
-	color: #FFF;
-	text-shadow: 0 1px 1px rgba(0,0,0,0.50);
-	line-height: 1.3em;
-	letter-spacing: 0.2pt;
+	display:none;
 }
 
 li.gfield + li.gfield.gfield_creditcard_warning {
@@ -715,14 +833,12 @@ li.gfield + li.gfield.gfield_creditcard_warning {
 .gform_wrapper div.validation_error {
 	color: #790000;
 	font-size: 1.2em;
-	font-weight: bold;
 	margin-bottom: 1.6em;
 }
 
 .gform_wrapper div.validation_error {
 	color: #790000;
 	font-size: 1.2em;
-	font-weight: bold;
 }
 
 div.gf_page_steps+div.validation_error {
@@ -731,7 +847,6 @@ div.gf_page_steps+div.validation_error {
 
 .gform_wrapper div.gfield_description.validation_error {
 	color: #790000;
-	font-weight: bold;
 	font-size: 14px;
 	line-height: 1.2em;
 	margin-bottom: 16px;
@@ -772,7 +887,7 @@ div.gf_page_steps+div.validation_error {
 
 .gform_wrapper .gform_footer input.button,
 .gform_wrapper .gform_footer input[type=submit] {
-	font-size: 1em;
+	font-size: 16px;
 }
 
 .gform_wrapper .gform_footer input[type=image] {
@@ -1778,7 +1893,7 @@ body .gform_wrapper div.gform_body ul.gform_fields li.gfield.gfield_html dl dd {
 .gform_wrapper div.gform_card_icon {
 	margin-right: 4px;
 	text-indent: -9000px;
-	background-image: url(../images/gf-creditcard-icons.png);
+	background-image: url(../img/gf-creditcard-icons.png);
 	background-repeat: no-repeat;
 	width: 36px;
 	height: 32px;
@@ -1989,7 +2104,7 @@ body .gform_wrapper div.gform_body ul.gform_fields li.gfield.gfield_html dl dd {
 .gform_wrapper .ginput_complex .ginput_cardinfo_right span.ginput_card_security_code_icon {
 	width: 32px;
 	height: 23px;
-	background-image: url(../images/gf-creditcard-icons.png);
+	background-image: url(../img/gf-creditcard-icons.png);
 	background-repeat: no-repeat;
 	background-position: 0 -128px;
 	position: relative;
@@ -2792,4 +2907,188 @@ div.gform_confirmation_wrapper.gf_confirmation_green_gradient:after {
 .entry .gform_wrapper.gf_browser_unknown ul li:before,
 .entry .gform_wrapper.gf_browser_unknown ul li:after {
 	content: none;
+}
+
+.ui-datepicker {
+	width: 216px;
+	height: auto;
+	margin: 5px auto 0;
+	font: 9pt Arial, sans-serif;
+	-webkit-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, .5);
+	-moz-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, .5);
+	box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, .5);
+}
+
+.ui-datepicker a {
+	text-decoration: none;
+}
+
+.ui-datepicker table {
+	width: 100%;
+	border-collapse: collapse;
+}
+
+.ui-datepicker-header {
+	background-color: #666; /* set the header background color */
+	color: #e0e0e0;
+	font-weight: bold;
+	-webkit-box-shadow: inset 0px 1px 1px 0px rgba(250, 250, 250, .2);
+	-moz-box-shadow: inset 0px 1px 1px 0px rgba(250, 250, 250, .2);
+	box-shadow: inset 0px 1px 1px 0px rgba(250, 250, 250, .2);
+	text-shadow: 1px -1px 0px #000;
+	filter: dropshadow(color=#000, offx=1, offy=-1);
+	line-height: 30px;
+	min-height: 30px !important;
+	border-width: 1px 0 0 0;
+	border-style: solid;
+	border-color: #666;
+}
+
+.ui-datepicker-title {
+	text-align: center;
+}
+
+.ui-datepicker-title select {
+	margin-top: 2.5%;
+}
+
+.ui-datepicker-prev, 
+.ui-datepicker-next {
+	display: inline-block;
+	width: 30px;
+	height: 30px;
+	text-align: center;
+	cursor: pointer;
+	background-image: url('../images/datepicker/arrow.png');
+	background-repeat: no-repeat;
+	line-height: 600%;
+	overflow: hidden;
+}
+
+.ui-datepicker-prev {
+	float: left;
+	background-position: center -30px;
+}
+
+.ui-datepicker-next {
+	float: right;
+	background-position: center 0px;
+}
+
+.ui-datepicker thead {
+	background: #f7f7f7;
+	background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y3ZjdmNyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmMWYxZjEiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
+	background: -moz-linear-gradient(top,  #f7f7f7 0%, #f1f1f1 100%);
+	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f7f7f7), color-stop(100%,#f1f1f1));
+	background: -webkit-linear-gradient(top,  #f7f7f7 0%,#f1f1f1 100%);
+	background: -o-linear-gradient(top,  #f7f7f7 0%,#f1f1f1 100%);
+	background: -ms-linear-gradient(top,  #f7f7f7 0%,#f1f1f1 100%);
+	background: linear-gradient(to bottom,  #f7f7f7 0%,#f1f1f1 100%);
+	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f7f7f7', endColorstr='#f1f1f1',GradientType=0 );
+	border-bottom: 1px solid #bbb;
+}
+
+.ui-datepicker th {
+	text-transform: uppercase;
+	text-align: center;
+	font-size: 6pt;
+	padding: 5px 0;
+	color: #666666;
+	text-shadow: 1px 0px 0px #fff;
+	filter: dropshadow(color=#fff, offx=1, offy=0);
+}
+
+.ui-datepicker tbody td {
+	padding: 0;
+	border-top: 1px solid #bbb;
+	border-right: 1px solid #bbb;
+}
+
+.ui-datepicker tbody td:last-child {
+	border-right: 0px;
+}
+
+.ui-datepicker tbody tr {
+	border-bottom: 1px solid #bbb;
+}
+
+.ui-datepicker tbody tr:last-child {
+	border-bottom: 0px;
+}
+
+.ui-datepicker td span, 
+.ui-datepicker td a {
+	display: inline-block;
+	font-weight: bold;
+	text-align: center;
+	width: 30px;
+	height: 30px;
+	line-height: 30px;
+	color: #666666;
+	text-shadow: 1px 1px 0px #fff;
+	filter: dropshadow(color=#fff, offx=1, offy=1);
+}
+
+.ui-datepicker-calendar .ui-state-default {
+	background: #ededed;
+	background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2VkZWRlZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNkZWRlZGUiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
+	background: -moz-linear-gradient(top,  #ededed 0%, #dedede 100%);
+	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ededed), color-stop(100%,#dedede));
+	background: -webkit-linear-gradient(top,  #ededed 0%,#dedede 100%);
+	background: -o-linear-gradient(top,  #ededed 0%,#dedede 100%);
+	background: -ms-linear-gradient(top,  #ededed 0%,#dedede 100%);
+	background: linear-gradient(to bottom,  #ededed 0%,#dedede 100%);
+	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ededed', endColorstr='#dedede',GradientType=0 );
+	-webkit-box-shadow: inset 1px 1px 0px 0px rgba(250, 250, 250, .5);
+	-moz-box-shadow: inset 1px 1px 0px 0px rgba(250, 250, 250, .5);
+	box-shadow: inset 1px 1px 0px 0px rgba(250, 250, 250, .5);
+}
+
+.ui-datepicker-calendar .ui-state-hover {
+	background: #f7f7f7;
+}
+
+.ui-datepicker-calendar .ui-state-active {
+	background: #FFF2AA; /* set the active date background color */
+	border: 1px solid #c19163; /* set the active date border color */
+	color: #666; /* set the active date font color */
+	-webkit-box-shadow: inset 0px 0px 10px 0px rgba(0, 0, 0, .1);
+	-moz-box-shadow: inset 0px 0px 10px 0px rgba(0, 0, 0, .1);
+	box-shadow: inset 0px 0px 10px 0px rgba(0, 0, 0, .1);
+	text-shadow: 0px 1px 0px #FFF;
+	filter: dropshadow(color=#FFF, offx=0, offy=1);
+	position: relative;
+	margin: -1px;
+}
+
+.ui-datepicker-unselectable .ui-state-default {
+	background: #f4f4f4;
+	color: #b4b3b3;
+}
+
+.ui-datepicker-calendar td:first-child .ui-state-active {
+	width: 29px;
+	margin-left: 0;
+}
+
+.ui-datepicker-calendar td:last-child .ui-state-active {
+	width: 29px;
+	margin-right: 0;
+}
+
+.ui-datepicker-calendar tr:last-child .ui-state-active {
+	height: 29px;
+	margin-bottom: 0;
+}
+
+td.ui-datepicker-unselectable.ui-state-disabled {
+	background-color: #d7d7d7;
+}
+
+table.ui-datepicker-calendar {
+	margin: 0 0 0 0 !important;
+}
+
+body div#ui-datepicker-div[style] {
+	z-index: 9999 !important;
 }

+ 1 - 0
functions.php

@@ -71,6 +71,7 @@ function dw_scripts() {
 	}
 	
 	elseif ( is_page('contact') ) {
+		require( get_template_directory() . '/inc/form.php' );
 		//gravity_form_enqueue_scripts(1, false);
 		wp_enqueue_style( 'forms', get_template_directory_uri() . '/css/form.css');
 		wp_enqueue_script('jquery', get_template_directory_uri() . '/js/jquery-2.1.1.min.js', array(), false, true);

+ 136 - 0
inc/form.php

@@ -0,0 +1,136 @@
+<?php 
+
+add_filter('gform_field_content', 'boot_gf', 10, 5);
+function boot_gf ($content, $field, $value, $lead_id, $form_id) {
+	if($field["type"] != 'hidden' && $field["type"] != 'list' && $field["type"] != 'multiselect' && $field["type"] != 'checkbox' && $field["type"] != 'fileupload' && $field["type"] != 'date' && $field["type"] != 'html' && $field["type"] != 'address') {
+		$content = str_replace('class=\'medium', 'class=\'form-control medium', $content);
+	}
+	if($field["type"] == 'name' || $field["type"] == 'address') {
+		//$content = str_replace('<input ', '<input class=\'form-control\' ', $content);
+	}
+	if($field["type"] == 'textarea') {
+		$content = str_replace('class=\'textarea', 'class=\'form-control medium textarea', $content);
+	}
+	if($field["type"] == 'checkbox') {
+		$content = str_replace('li class=\'', 'li class=\'checkbox ', $content);
+		$content = str_replace('<input ', '<input style=\'margin-left:1px;\' ', $content);
+	}
+	if($field["type"] == 'radio') {
+		$content = str_replace('li class=\'', 'li class=\'radio ', $content);
+		$content = str_replace('<input ', '<input style=\'margin-left:1px;\' ', $content);
+	}
+	return $content;
+}
+
+add_filter("gform_init_scripts_footer", "init_gscripts");
+function init_gscripts() {
+	return true;
+}
+
+add_action( 'wp_print_scripts', 'dw_deregister_gf_js', 100 );
+function dw_deregister_gf_js() {
+	if( is_page( 'contact' ) ) {
+		wp_deregister_script( 'gform_conditional_logic' );
+		wp_deregister_script( 'gform_json' );
+		//wp_deregister_script( 'gform_datepicker_init' );
+		wp_deregister_script( 'gforms_stripe_frontend' );	
+	}
+}
+
+add_filter('gform_validation_message', 'change_validation_message', 10, 2);
+function change_validation_message($message, $form)
+{
+    return "<div class='validation_error'><strong>Oops!</strong> Looks like something is missing.</div>";
+}
+
+add_filter( 'gform_submit_button', 'form_submit_button', 10, 5 );
+function form_submit_button ( $button, $form ){
+    $button = str_replace( "input", "button", $button );
+    $button = str_replace( "/", "", $button );
+    $button .= "{$form['button']['text']}</button>";
+    return $button;
+}
+
+
+
+/*============================================
+		 	GF- Date Assist
+==============================================*/
+
+class DW_GF_Date {
+    public function __construct( $args = array() ) {
+        $this->_args = wp_parse_args( $args, array(
+            'form_id'         => false,
+            'target_field_id' => false,
+            'source_field_id' => false,
+            'format'          => 'Y-m-d',
+            'modifier'        => false
+        ) );
+        if( ! $this->_args['form_id'] || ! $this->_args['target_field_id'] ) {
+            return;
+        }
+        add_action( 'init', array( $this, 'init' ) );
+    }
+
+    public function init() {
+        if( $this->_args['source_field_id'] ) {
+            add_action( 'gform_pre_submission', array( $this, 'populate_date_on_pre_submission' ) );
+        } else {
+            add_filter( 'gform_pre_render', array( $this, 'populate_date_on_pre_render' ) );
+        }
+    }
+
+    public function populate_date_on_pre_render( $form ) {
+
+        foreach( $form['fields'] as &$field ) {
+            if( $field['id'] == $this->_args['target_field_id'] ) {
+                $key = sprintf( 'gwpd_%d_%d', $form['id'], $field['id'] );
+                $value = $this->get_modified_date( $field );
+                $field['allowsPrepopulate'] = true;
+                $field['inputName'] = $key;
+                add_filter("gform_field_value_{$key}", create_function( '', 'return \'' . $value . '\';' ) );
+            }
+        }
+        return $form;
+    }
+
+    public function populate_date_on_pre_submission( $form ) {
+        foreach( $form['fields'] as &$field ) {
+            if( $field['id'] == $this->_args['target_field_id'] ) {
+                $timestamp = strtotime( rgpost( 'input_' . $this->_args['source_field_id'] ) );
+                $value = $this->get_modified_date( $field, $timestamp );
+                $_POST[ "input_{$field['id']}" ] = $value;
+            }
+        }
+    }
+
+    public function get_modified_date( $field, $timestamp = false ) {
+        if( ! $timestamp ) {
+            $timestamp = current_time( 'timestamp' );
+        }
+        if( GFFormsModel::get_input_type( $field ) == 'date' ) {
+            list( $format, $divider ) = $field['dateFormat'] ? array_pad( explode( '_', $field['dateFormat' ] ), 2, 'slash' ) : array( 'mdy', 'slash' );
+            $dividers = array( 'slash' => '/', 'dot' => '.', 'dash' => '-' );
+            $format = str_replace( 'y', 'Y', $format );
+            $divider = $dividers[$divider];
+            $format = implode( $divider, str_split( $format ) );
+        } else {
+            $format = $this->_args['format'];
+        }
+        if( $this->_args['modifier'] ) {
+            $date = date( $format, strtotime( $this->_args['modifier'], $timestamp ) );
+        } else {
+            $date = date( $format, $timestamp );
+        }
+        return $date;
+    }
+}
+
+
+new DW_GF_Date( array(
+    'form_id' => 1,
+    'target_field_id' => 17,
+    'modifier' => '+4 months'
+) );
+
+?>

+ 0 - 38
inc/tweaks.php

@@ -57,42 +57,4 @@ function dw_embed_oembed_html( $html ) {
     return preg_replace( '@src="https?:@', 'src="', $html );
 }
 
-
-add_filter("gform_field_content", "boot_gravity", 10, 5);
-function boot_gravity($content, $field, $value, $lead_id, $form_id){
-if($field["type"] != 'hidden' && $field["type"] != 'list' && $field["type"] != 'multiselect' && $field["type"] != 'checkbox' && $field["type"] != 'fileupload' && $field["type"] != 'date' && $field["type"] != 'html' && $field["type"] != 'address') {
-		$content = str_replace('class=\'medium', 'class=\'form-control medium', $content);
-	}
-	if($field["type"] == 'name' || $field["type"] == 'address') {
-		$content = str_replace('<input ', '<input class=\'form-control\' ', $content);
-	}
-	if($field["type"] == 'textarea') {
-		$content = str_replace('class=\'textarea', 'class=\'form-control textarea', $content);
-	}
-	if($field["type"] == 'checkbox') {
-		$content = str_replace('li class=\'', 'li class=\'checkbox ', $content);
-		$content = str_replace('<input ', '<input style=\'margin-left:1px;\' ', $content);
-	}
-	if($field["type"] == 'radio') {
-		$content = str_replace('li class=\'', 'li class=\'radio ', $content);
-		$content = str_replace('<input ', '<input style=\'margin-left:1px;\' ', $content);
-	}
-	return $content;
-}
-
-add_filter("gform_init_scripts_footer", "init_gscripts");
-function init_gscripts() {
-	return true;
-}
-
-add_action( 'wp_print_scripts', 'dw_deregister_gf_js', 100 );
-function dw_deregister_gf_js() {
-	if( is_page( 'contact' ) ) {
-		wp_deregister_script( 'gform_conditional_logic' );
-		wp_deregister_script( 'gform_json' );
-		wp_deregister_script( 'gforms_stripe_frontend' );	
-	}
-}
-
-
 ?>

+ 102 - 0
js/form.js

@@ -2061,3 +2061,105 @@ window.GFStripe = null;
     }
 
 })(jQuery);
+
+
+/*============================================
+				UI - Datepicker
+==============================================*/
+
+
+jQuery(document).ready(gformInitDatepicker);
+
+function gformInitDatepicker(){
+    jQuery('.datepicker').each(
+        function (){
+            var element = jQuery(this);
+            var format = "mm/dd/yy";
+
+            if(element.hasClass("mdy"))
+                format = "mm/dd/yy";
+            else if(element.hasClass("dmy"))
+                format = "dd/mm/yy";
+            else if(element.hasClass("dmy_dash"))
+                format = "dd-mm-yy";
+            else if(element.hasClass("dmy_dot"))
+                format = "dd.mm.yy";
+            else if(element.hasClass("ymd_slash"))
+                format = "yy/mm/dd";
+            else if(element.hasClass("ymd_dash"))
+                format = "yy-mm-dd";
+            else if(element.hasClass("ymd_dot"))
+                format = "yy.mm.dd";
+
+            var image = "";
+            var showOn = "focus";
+            if(element.hasClass("datepicker_with_icon")){
+                showOn = "both";
+                image = jQuery('#gforms_calendar_icon_' + this.id).val();
+            }
+
+            element.datepicker( {
+                yearRange:       '-0:+1',
+				minDate: 		 '+90',
+				maxDate: 		 '+18M',
+                showOn:          showOn,
+                buttonImage:     image,
+                buttonImageOnly: true,
+                dateFormat:      format,
+                changeMonth:     true,
+                changeYear:      true,
+                onClose: function () {
+                    element.closest('li').nextAll('li:visible:first').find(':input:first').focus();
+                }
+            } );
+        }
+    );
+}
+
+/*============================================
+			Conditional Date
+==============================================*/
+;(function($) {
+        "use strict";
+
+        function setOptionsByDate()
+        {
+            $('.booked, .unbooked').each(function() {
+                $(this).css('display', 'none');
+            });
+
+            var visiting = $('.book-date :input').val();
+            if (!visiting) {
+                return;
+            }
+            var visitdate = new Date(visiting);
+            var today = new Date().setHours(0, 0, 0, 0);
+
+            if (visitdate < today) {
+                alert("Hmm... that date is already booked. " + "Please pick another date.");
+                $('.visit-date :input').val('');
+                return;
+            }
+            var month = visitdate.getMonth();
+
+            if (month >= 5 && month <= 7) {
+                $('.summer, .year-round').each(function() {
+                    $(this).css('display', '');
+                });
+            } else {
+                $('.winter, .year-round').each(function() {
+                    $(this).css('display', '');
+                });
+            }
+        }
+
+        $(document).ready(function() {
+
+            setOptionsByDate();
+
+            $('.visit-date :input').change(function() {
+                setOptionsByDate();
+            });
+
+        });
+    }(jQuery, {}));

+ 0 - 92
style.css

@@ -2057,98 +2057,6 @@ img.me {
 form .actions button{
 	margin: 20px 0;
 }
-.gform_wrapper ul { padding-left: 0; list-style: none }
-
-.gform_wrapper li { margin-bottom: 15px }
-
-.gform_wrapper form { margin-bottom: 0 }
-
-.gform_wrapper .gfield_required { padding-left: 1px; color: #b94a48 }
-
-.ginput_container input[type="text"], .ginput_container select, .ginput_container textarea { display: block; width: 100%; height: 34px; padding: 6px 12px; font-size: 14px; line-height: 1.428571429; color: #555; vertical-align: middle; background-color: #fff; border: 1px solid #ccc; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s }
-.ginput_container input[type="checkbox"] {
-    margin-right: 5px;
-}
-.ginput_container input:-moz-placeholder, .ginput_container select:-moz-placeholder, .ginput_container textarea:-moz-placeholder {
-    color:#999
-}
-.ginput_container input::-moz-placeholder, .ginput_container select::-moz-placeholder, .ginput_container textarea::-moz-placeholder {
-    color:#999
-}
-.ginput_container input:-ms-input-placeholder, .ginput_container select:-ms-input-placeholder, .ginput_container textarea:-ms-input-placeholder {
-    color:#999
-}
-.ginput_container input::-webkit-input-placeholder, .ginput_container select::-webkit-input-placeholder, .ginput_container textarea::-webkit-input-placeholder {
-    color:#999
-}
-
-.ginput_container input:focus, .ginput_container select:focus, .ginput_container textarea:focus { border-color: #66afe9; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(102,175,233,0.6); box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(102,175,233,0.6) }
-
-.ginput_container input[disabled], .ginput_container select[disabled], .ginput_container textarea[disabled], .ginput_container input[readonly], .ginput_container select[readonly], .ginput_container textarea[readonly], fieldset[disabled] .ginput_container input, fieldset[disabled] .ginput_container select, fieldset[disabled] .ginput_container textarea { cursor: not-allowed; background-color: #eee }
-
-textarea.ginput_container input, textarea.ginput_container select, textarea.ginput_container textarea { height: auto }
-
-.ginput_container textarea { height: auto }
-
-.gform_button { display: inline-block; padding: 6px 12px; margin-bottom: 0; font-size: 14px; font-weight: normal; line-height: 1.428571429; color: #fff; text-align: center; white-space: nowrap; vertical-align: middle; cursor: pointer; background-color: #428bca; border: 1px solid transparent; border-color: #357ebd; border-radius: 4px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none }
-
-.gform_button:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px }
-
-.gform_button:hover, .gform_button:focus { color: #333; text-decoration: none }
-
-.gform_button:active, .gform_button.active { background-image: none; outline: 0; -webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,0.125); box-shadow: inset 0 3px 5px rgba(0,0,0,0.125) }
-
-.gform_button.disabled, .gform_button[disabled], fieldset[disabled] .gform_button { pointer-events: none; cursor: not-allowed; opacity: .65; filter: alpha(opacity=65); -webkit-box-shadow: none; box-shadow: none }
-
-.gform_button:hover, .gform_button:focus, .gform_button:active, .gform_button.active, .open .dropdown-toggle.gform_button { color: #fff; background-color: #3276b1; border-color: #285e8e }
-
-.gform_button:active, .gform_button.active, .open .dropdown-toggle.gform_button { background-image: none }
-
-.gform_button.disabled, .gform_button[disabled], fieldset[disabled] .gform_button, .gform_button.disabled:hover, .gform_button[disabled]:hover, fieldset[disabled] .gform_button:hover, .gform_button.disabled:focus, .gform_button[disabled]:focus, fieldset[disabled] .gform_button:focus, .gform_button.disabled:active, .gform_button[disabled]:active, fieldset[disabled] .gform_button:active, .gform_button.disabled.active, .gform_button[disabled].active, fieldset[disabled] .gform_button.active { background-color: #428bca; border-color: #357ebd }
-
-.gform_wrapper .gfield_error .gfield_label { color: #b94a48 }
-
-.gform_wrapper .gfield_error input, .gform_wrapper .gfield_error select, .gform_wrapper .gfield_error textarea { color: #b94a48; background-color: #f2dede; border-color: #eed3d7 }
-
-.gform_wrapper .gfield_error input:focus, .gform_wrapper .gfield_error select:focus, .gform_wrapper .gfield_error textarea:focus { border-color: #b94a48; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(185,74,72,0.6); box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 8px rgba(185,74,72,0.6) }
-
-.validation_error { padding: 15px; margin-bottom: 20px; color: #b94a48; background-color: #f2dede; border: 1px solid transparent; border-color: #eed3d7; border-radius: 4px }
-
-.validation_error h4 { margin-top: 0; color: inherit }
-
-.validation_error .alert-link { font-weight: bold }
-
-.validation_error>p, .validation_error>ul { margin-bottom: 0 }
-
-.validation_error>p+p { margin-top: 5px }
-
-.validation_error hr { border-top-color: #e6c1c7 }
-
-.validation_error .alert-link { color: #953b39 }
-
-#gforms_confirmation_message { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px }
-
-#gforms_confirmation_message h4 { margin-top: 0; color: inherit }
-
-#gforms_confirmation_message .alert-link { font-weight: bold }
-
-#gforms_confirmation_message>p, #gforms_confirmation_message>ul { margin-bottom: 0 }
-
-#gforms_confirmation_message>p+p { margin-top: 5px }
-
-.gfield_label { margin-bottom: 5px; font-size:  14px;}
-
-.ginput_complex > span > label { font-size: 11px; }
-
-.gform_validation_container,
-.gform_wrapper .gform_validation_container,
-body .gform_wrapper li.gform_validation_container,
-body .gform_wrapper .gform_body ul.gform_fields li.gfield.gform_validation_container,
-body .gform_wrapper ul.gform_fields li.gfield.gform_validation_container {
-    display: none !important;
-    position: absolute !important;
-    left: -9000px;
-}
 
 /*============================================
 					Music