Skip to content

Commit

Permalink
v4.6.8
Browse files Browse the repository at this point in the history
  • Loading branch information
RensTillmann committed May 22, 2019
1 parent b2f4a5f commit 66c823c
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 26 deletions.
5 changes: 4 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
### May 16, 2019 - Version 4.6.7
### May 22, 2019 - Version 4.6.8
- Added: Option to specify field type for "Text" fields, allowing to determine what "Keyboard Layout" it should use on mobile devices. To name a few:
- `email` (for email keyboard layout)
- `tel` (for phone number keyboard layout)
- `url` (for URL keyboard layout)
- `number` (for number keyboard layout)
- `date` (for keyboard layout to choose a specific date
- `month` (for keyboard layout to choose a specific month)
- Added: A custom Ajax handler for faster Ajax requests (significant speed improvement for building/editing forms)
- Added: Translation feature (allows you to translate your form into multiple languages, this also includes translating specific form settings)
*when in translation mode, you won't be able to delete and change the layout of the form, just the strings of each element and the form settings*
- Improved: Currency field will now have field type set to `tel` for phonenumber keyboard layout to enter numbers easily on mobile devices
- Fix: Bug fix conditional logic when setting $_GET on radio buttons
- Fix: Radio buttons not responsding to predefined `$_GET` or `$_POST` parameters
- Fix: When doing custom POST and "Enable custom parameter string for POST method" is enabled file URL's where not parsed as data
- Fix: Bug in Ajax handler, make sure to not load external unrequired plugins, because they might depend on functions that we didn't load
Expand Down
2 changes: 1 addition & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ If after all the above steps you think everything is correctly setup, you can [C

#### Why do I get an error message when uploading a file?
If you are unable to upload files via your form the first thing you should try is to check if the server returns a 403 error (Forbidden) on the following URL:
http://yourdomain.com/`wp-content/plugins/super-forms/uploads/php/`
`http://yourdomain.com/wp-content/plugins/super-forms/uploads/php/`

If it returns a **403 error**, please contact your hosting company to let them fix this issue.
It should return a blank page in order for the file upload field to work correctly.
Expand Down
5 changes: 5 additions & 0 deletions src/assets/css/frontend/elements.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/assets/css/frontend/elements.css.map

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions src/assets/css/frontend/elements.sass
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,8 @@ h1.super-thanks-title
form
float: left
width: 100%
position: relative
z-index: 1
&.super-center-form
text-align: center
form
Expand Down Expand Up @@ -3530,6 +3532,8 @@ ul.super-multipart-steps .super-multipart-step
margin-bottom: 15px
visibility: visible
width: 100%
position: relative
z-index: 2
.super-dropdown
border: 1px solid #eaeaea
float: left
Expand Down Expand Up @@ -3577,6 +3581,7 @@ ul.super-multipart-steps .super-multipart-step
border-left: 1px solid #eaeaea
border-right: 1px solid #eaeaea
list-style: none
padding: 0
.super-active .super-dropdown-items
display: block
.super-dropdown-items li
Expand Down
18 changes: 9 additions & 9 deletions src/assets/js/backend/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,11 @@
var do_timeout;
data = jQuery.parseJSON(data);
if(data.offset>data.found){
$this.html('Completed ('+data.found+'/'+data.found+')');
setTimeout(function() {
$this.html('Completed ('+data.found+'/'+data.found+')');
window.location.href = data.file_url;
}, 10*limit);
return false;
}else{
do_timeout = true;
var prev_offset = data.offset-limit;
Expand All @@ -597,14 +601,10 @@
prev_offset++;
}, 20);
}
if(data.offset>data.found){
window.location.href = data.file_url;
}else{
if(typeof do_timeout !== 'undefined'){
setTimeout(function() {
super_export_forms($this, data.offset, data.found);
}, 10*limit);
}
if(typeof do_timeout !== 'undefined'){
setTimeout(function() {
super_export_forms($this, data.offset, data.found);
}, 10*limit);
}
},
error: function(){
Expand Down
5 changes: 4 additions & 1 deletion src/docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
### May 16, 2019 - Version 4.6.7
### May 22, 2019 - Version 4.6.8
- Added: Option to specify field type for "Text" fields, allowing to determine what "Keyboard Layout" it should use on mobile devices. To name a few:
- `email` (for email keyboard layout)
- `tel` (for phone number keyboard layout)
- `url` (for URL keyboard layout)
- `number` (for number keyboard layout)
- `date` (for keyboard layout to choose a specific date
- `month` (for keyboard layout to choose a specific month)
- Added: A custom Ajax handler for faster Ajax requests (significant speed improvement for building/editing forms)
- Added: Translation feature (allows you to translate your form into multiple languages, this also includes translating specific form settings)
*when in translation mode, you won't be able to delete and change the layout of the form, just the strings of each element and the form settings*
- Improved: Currency field will now have field type set to `tel` for phonenumber keyboard layout to enter numbers easily on mobile devices
- Fix: Bug fix conditional logic when setting $_GET on radio buttons
- Fix: Radio buttons not responsding to predefined `$_GET` or `$_POST` parameters
- Fix: When doing custom POST and "Enable custom parameter string for POST method" is enabled file URL's where not parsed as data
- Fix: Bug in Ajax handler, make sure to not load external unrequired plugins, because they might depend on functions that we didn't load
Expand Down
2 changes: 1 addition & 1 deletion src/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ If after all the above steps you think everything is correctly setup, you can [C

#### Why do I get an error message when uploading a file?
If you are unable to upload files via your form the first thing you should try is to check if the server returns a 403 error (Forbidden) on the following URL:
http://yourdomain.com/`wp-content/plugins/super-forms/uploads/php/`
`http://yourdomain.com/wp-content/plugins/super-forms/uploads/php/`

If it returns a **403 error**, please contact your hosting company to let them fix this issue.
It should return a blank page in order for the file upload field to work correctly.
Expand Down
6 changes: 5 additions & 1 deletion src/includes/class-common.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,11 @@ public static function get_entry_data_by_wc_order_id($order_id, $skip){
*/
public static function get_default_element_setting_value($shortcodes=false, $group, $tag, $tab, $name) {
if($shortcodes==false) $shortcodes = SUPER_Shortcodes::shortcodes();
return $shortcodes[$group]['shortcodes'][$tag]['atts'][$tab]['fields'][$name]['default'];
if(isset($shortcodes[$group]['shortcodes'][$tag]['atts'][$tab]['fields'][$name]['default'])){
return $shortcodes[$group]['shortcodes'][$tag]['atts'][$tab]['fields'][$name]['default'];
}else{
return '';
}
//'layout_elements', 'shortcodes', 'column', 'atts', 'general/advanced/', 'fields', 'fieldname'
//return $shortcodes;
}
Expand Down
20 changes: 11 additions & 9 deletions src/includes/class-shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,7 @@ public static function get_items($items=array(), $tag, $atts, $prefix='', $setti
$img_styles = '';
if( $v['max_width']!='' ) $img_styles .= 'max-width:' . $v['max_width'] . 'px;';
if( $v['max_height']!='' ) $img_styles .= 'max-height:' . $v['max_height'] . 'px;';

$item .= '<label class="' . ( !in_array($v['value'], $selected_items) ? ' super-has-image' : 'super-has-image super-active super-default-selected') . ($atts['class']!='' ? ' ' . $atts['class'] : '') . '">';
$item .= '<label class="' . (($v['checked']=='true') || ($v['value']==$atts['value']) || (in_array($v['value'], $selected_items)) ? 'super-has-image super-active super-default-selected' : 'super-has-image') . ($atts['class']!='' ? ' ' . $atts['class'] : '') . '">';
if( !empty( $image ) ) {
$item .= '<div class="image" style="background-image:url(\'' . $image . '\');"><img src="' . $image . '"' . ($img_styles!='' ? ' style="' . $img_styles . '"' : '') . '></div>';
}else{
Expand All @@ -230,14 +229,13 @@ public static function get_items($items=array(), $tag, $atts, $prefix='', $setti
if($v['label']!='') $item .= '<span class="super-item-label">' . stripslashes($v['label']) . '</span>';
$item .='</label>';
}else{
$item = '<label class="' . ( !in_array($v['value'], $selected_items) ? '' : 'super-active super-default-selected') . ($atts['class']!='' ? ' ' . $atts['class'] : '') . '"><input ' . ( (($v['checked']!=='true') && ($v['checked']!==true)) ? '' : 'checked="checked"' ) . ' type="checkbox" value="' . esc_attr( $v['value'] ) . '" />' . stripslashes($v['label']) . '</label>';
$item = '<label class="' . (($v['checked']=='true') || ($v['value']==$atts['value']) || (in_array($v['value'], $selected_items)) ? 'super-active super-default-selected' : '') . ($atts['class']!='' ? ' ' . $atts['class'] : '') . '"><input ' . ( (($v['checked']!=='true') && ($v['checked']!==true)) ? '' : 'checked="checked"' ) . ' type="checkbox" value="' . esc_attr( $v['value'] ) . '" />' . stripslashes($v['label']) . '</label>';
}
$items[] = $item;
}
}
if($tag==='radio'){
// radio -custom
$selected_found = false;
foreach( $atts['radio_items'] as $k => $v ) {
if( ( (!empty($v['checked'])) && ($v['checked']!='false') ) && ($atts['value']=='') ) $selected_items[] = $v['value'];
if( !isset( $v['image'] ) ) $v['image'] = '';
Expand All @@ -250,7 +248,7 @@ public static function get_items($items=array(), $tag, $atts, $prefix='', $setti
if( $v['max_width']!='' ) $img_styles .= 'max-width:' . $v['max_width'] . 'px;';
if( $v['max_height']!='' ) $img_styles .= 'max-height:' . $v['max_height'] . 'px;';

$item = '<label class="' . ( $v['value']==$atts['value'] ? 'super-has-image super-active super-default-selected' : 'super-has-image' ) . ($atts['class']!='' ? ' ' . $atts['class'] : '') . '">';
$item = '<label class="' . (($v['checked']=='true') || ($v['value']==$atts['value']) || (in_array($v['value'], $selected_items)) ? 'super-has-image super-active super-default-selected' : 'super-has-image' ) . ($atts['class']!='' ? ' ' . $atts['class'] : '') . '">';
if( !empty( $image ) ) {
$item .= '<div class="image" style="background-image:url(\'' . $image . '\');"><img src="' . $image . '"' . ($img_styles!='' ? ' style="' . $img_styles . '"' : '') . '></div>';
}else{
Expand All @@ -262,9 +260,8 @@ public static function get_items($items=array(), $tag, $atts, $prefix='', $setti
$item .='</label>';
$items[] = $item;
}else{
$items[] = '<label class="' . ( $v['value']==$atts['value'] ? 'super-active super-default-selected' : '' ) . ($atts['class']!='' ? ' ' . $atts['class'] : '') . '"><input ' . ( (($v['checked']!=='true') && ($v['checked']!==true)) ? '' : 'checked="checked"' ) . ' type="radio" value="' . esc_attr( $v['value'] ) . '" />' . stripslashes($v['label']) . '</label>';
$items[] = '<label class="' . (($v['checked']=='true') || ($v['value']==$atts['value']) || (in_array($v['value'], $selected_items)) ? 'super-active super-default-selected' : '' ) . ($atts['class']!='' ? ' ' . $atts['class'] : '') . '"><input ' . ( (($v['checked']!=='true') && ($v['checked']!==true)) ? '' : 'checked="checked"' ) . ' type="radio" value="' . esc_attr( $v['value'] ) . '" />' . stripslashes($v['label']) . '</label>';
}
if( in_array($v['value'], $selected_items)) $selected_found = true;
}
}
}
Expand Down Expand Up @@ -2088,7 +2085,7 @@ public static function currency( $tag, $atts, $inner, $shortcodes=null, $setting
// @since 1.9 - custom class
if( !isset( $atts['class'] ) ) $atts['class'] = '';

$result .= '<input class="super-shortcode-field' . ($atts['class']!='' ? ' ' . $atts['class'] : '') . '" type="text"';
$result .= '<input class="super-shortcode-field' . ($atts['class']!='' ? ' ' . $atts['class'] : '') . '" type="tel"';

// @since 1.1.8 - check if we can find parameters
if( isset( $_GET[$atts['name']] ) ) {
Expand Down Expand Up @@ -2135,6 +2132,11 @@ public static function text( $tag, $atts, $inner, $shortcodes=null, $settings=nu
$atts = wp_parse_args( $atts, $defaults );
$atts = self::merge_i18n($atts, $i18n); // @since 4.7.0 - translation

// @since 4.7.0 - field types
if( !isset( $atts['type'] ) ) $atts['type'] = 'text';
// Set validation to 'numeric' if field type was set to 'number'
if($atts['type'] == 'number') $atts['validation'] = 'numeric';

// @since 3.1.0 - google distance calculation between 2 addresses
$data_attributes = '';
$distance_calculator_class = '';
Expand Down Expand Up @@ -2209,8 +2211,8 @@ public static function text( $tag, $atts, $inner, $shortcodes=null, $settings=nu
}

// @since 4.7.0 - field types
if( !isset( $atts['type'] ) ) $atts['type'] = 'text';
$result .= '" type="' . $atts['type'] . '"';

if( $atts['enable_keywords']=='true' ) {
$result .= ' data-keyword-max="' . $atts['keyword_max'] . '" data-split-method="' . $atts['keyword_split_method'] . '"';
}
Expand Down
1 change: 1 addition & 0 deletions src/includes/shortcodes/form-elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
'email' => __( '[email] for entering email addresses', 'super-forms' ),
'tel' => __( '[tel] for entering phonenumbers', 'super-forms' ),
'url' => __( '[url] for entering URL\'s', 'super-forms' ),
'number' => __( '[number] for entering numbers (validation will automatically be set to "numeric")', 'super-forms' ),
'color' => __( '[color] for choosing HEX colors (or use the native Colorpicker element)', 'super-forms' ),
'date' => __( '[date] for choosing dates (or use the native Date element)', 'super-forms' ),
'datetime-local' => __( '[datetime-local] for choosing date + time', 'super-forms' ),
Expand Down
4 changes: 2 additions & 2 deletions src/super-forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Plugin Name: Super Forms - Drag & Drop Form Builder
* Plugin URI: http://codecanyon.net/user/feeling4design
* Description: Build forms anywhere on your website with ease.
* Version: 4.6.7
* Version: 4.6.8
* Author: feeling4design
* Author URI: http://codecanyon.net/user/feeling4design
* Text Domain: super-forms
Expand All @@ -41,7 +41,7 @@ final class SUPER_Forms {
*
* @since 1.0.0
*/
public $version = '4.6.7';
public $version = '4.6.8';
public $slug = 'super-forms';

/**
Expand Down

0 comments on commit 66c823c

Please sign in to comment.