Plugin Directory

Changeset 2581779


Ignore:
Timestamp:
08/12/2021 12:02:47 AM (5 years ago)
Author:
simpleform
Message:

fix: incorrect display of form description and line breaks converted into a single space
feat: button to permanently remove a form and borders color option for transparent form style
refactor: removal of the limit of only one widget per page

Location:
simpleform
Files:
59 added
26 edited

Legend:

Unmodified
Added
Removed
  • simpleform/trunk/README.txt

    r2568608 r2581779  
    77Tested up to: 5.8
    88Requires PHP: 5.6
    9 Stable tag: 2.0.3
     9Stable tag: 2.0.4
    1010License: GPLv2 or later
    1111License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    107107= Can I display multiple forms on the same page? =
    108108
    109 Yes and no. You cannot show more forms to the same type of user. This might cause a conflict. But you can create more than one form, each of which is shown to a different kind of user.
     109Yes. You can display more than one form on the same page.
    110110
    111111= Will I be notified when someone submits a form? =
     
    159159
    160160== Changelog ==
     161
     162= 2.0.4 (12 August 2021) =
     163* Fixed: incorrect display of description above and below the form if the widget is used
     164* Fixed: line breaks converted into a single space when filling in the form
     165* Fixed: minor issues in code
     166* Changed: removal of the limit of only one widget per page
     167* Changed: display of form is prevented if the same is used more than once on the same page
     168* Added: button to permanently remove a form from forms list
     169* Added: borders color option when transparent form style is used
    161170
    162171= 2.0.3 (21 July 2021) =
  • simpleform/trunk/admin/class-admin.php

    r2568608 r2581779  
    530530       $spinner = isset($_POST['spinner']) ? 'true' : 'false';
    531531       $template = isset($_POST['form-template']) ? sanitize_text_field($_POST['form-template']) : 'default';
     532       $form_borders = isset($_POST['form-borders']) ? sanitize_text_field($_POST['form-borders']) : 'dark';       
    532533       $stylesheet = isset($_POST['stylesheet']) ? 'true' : 'false';
    533534       $cssfile = isset($_POST['stylesheet-file']) ? 'true' : 'false';
    534535       $javascript = isset($_POST['javascript']) ? 'true' : 'false';
    535536       $uninstall = isset($_POST['deletion']) ? 'true' : 'false';
     537       $multiple_spaces = isset($_POST['multiple-spaces']) ? 'true' : 'false';
    536538       $outside_error = isset($_POST['outside-error']) ? sanitize_text_field($_POST['outside-error']) : 'bottom';
    537539       $characters_length = isset($_POST['characters-length']) ? 'true' : 'false';
     
    604606 
    605607       if ( $stylesheet != 'true' )  { $cssfile = 'false'; }
     608       if ( $template != 'transparent' )  { $form_borders = 'dark'; }
    606609       if ( $ajax_submission != 'true' )  { $spinner = 'false'; }
    607610       if ( $success_action == 'message' )  { $confirmation_page = ''; }
     
    682685                 'focus' => $focus,
    683686                 'form_template' => $template,
     687                 'form_borders' => $form_borders,
    684688                 'stylesheet' => $stylesheet,
    685689                 'stylesheet_file' => $cssfile,
    686690                 'javascript' => $javascript,
    687                  'deletion_data' => $uninstall,
     691                 'deletion_data' => $uninstall,
     692                 'multiple_spaces' => $multiple_spaces,
    688693                 'outside_error' => $outside_error,
    689694                 'empty_fields' => $empty_fields,
     
    772777             $form_settings['admin_color'] = $admin_color;
    773778             $form_settings['deletion_data'] = $uninstall;
     779             $form_settings['multiple_spaces'] = $multiple_spaces;
    774780             $form_settings['server_smtp'] = $server_smtp;
    775781             $form_settings['smtp_host'] = $smtp_host;
     
    794800         $widget_editor = ! empty($main_settings['widget_editor']) ? esc_attr($main_settings['widget_editor']) : 'false';       
    795801         $admin_color = ! empty($main_settings['admin_color']) ? esc_attr($main_settings['admin_color']) : 'default';       
    796          $uninstall = ! empty($main_settings['deletion_data']) ? esc_attr($main_settings['deletion_data']) : 'false';       
     802         $uninstall = ! empty($main_settings['deletion_data']) ? esc_attr($main_settings['deletion_data']) : 'false';
     803         $multiple_spaces = ! empty($main_settings['multiple_spaces']) ? esc_attr($main_settings['multiple_spaces']) : 'false';
    797804         $server_smtp = ! empty($main_settings['server_smtp']) ? esc_attr($main_settings['server_smtp']) : 'false';       
    798805         $smtp_host = ! empty($main_settings['smtp_host']) ? esc_attr($main_settings['smtp_host']) : '';
     
    817824                 'spinner' => $spinner,
    818825                 'form_template' => $template,
     826                 'form_borders' => $form_borders,
    819827                 'stylesheet' => $stylesheet,
    820828                 'stylesheet_file' => $cssfile,
    821829                 'javascript' => $javascript,
    822                  'deletion_data' => $uninstall,                 
     830                 'deletion_data' => $uninstall,
     831                 'multiple_spaces' => $multiple_spaces,
    823832                 'outside_error' => $outside_error,
    824833                 'characters_length' => $characters_length,
     
    11361145      $id = array($post_id);
    11371146      $util = new SimpleForm_Util();     
    1138    
    1139       $shortcode_pages = get_option('sform_shortcode_pages');
    1140       if ( empty($shortcode_pages) ) { $shortcode_pages = $util->shortcode_pages(); }
    1141 
    1142       // If the post content contains the shortcode
    1143       if ( strpos($post->post_content,'[simpleform') !== false ) {
    1144        
    1145          global $wpdb;
    1146          $table_name = "{$wpdb->prefix}sform_shortcodes";
    1147          // List of all forms IDs that have been created
    1148          $form_ids = $util->sform_ids();
     1147      // List of all forms IDs that have been created
     1148      $form_ids = $util->sform_ids();
     1149      // List of all forms IDs used in the post content
     1150      $used_forms = $util->used_shortcodes($post->post_content);
     1151     
     1152      global $wpdb;
     1153      $table_name = "{$wpdb->prefix}sform_shortcodes";
     1154
     1155      if ( ! empty($used_forms) ) {
     1156
    11491157         // List of all forms IDs used in the post content
    1150          $used_forms = $util->used_shortcodes($post->post_content);
    1151      
    11521158         foreach ($form_ids as $form_id) {         
    11531159           
    1154            $used_in = $wpdb->get_var( "SELECT pages FROM $table_name WHERE id = {$form_id}" );
     1160           $used_in = $wpdb->get_var( "SELECT shortcode_pages FROM $table_name WHERE id = {$form_id}" );
    11551161           $ids = ! empty($used_in) ? explode(",", $used_in) : array();           
    11561162           
    1157            // If the form ID is among those used in the post content
     1163           // If a form ID is among those used in the post
    11581164           if ( in_array($form_id,$used_forms) ) {
    1159              // Include the page ID if it is not present on the pages used
     1165             // Include the post ID in the list if not yet inserted
    11601166             if ( !in_array($post_id,$ids) ) {
    11611167               $updated_used_in = array_unique(array_merge($id,$ids));
    11621168               // Turn it as string and update the value
    11631169               $new_used_in = implode(",", $updated_used_in);
    1164                $wpdb->query( $wpdb->prepare("UPDATE $table_name SET pages = '$new_used_in' WHERE id = %d", $form_id) );
     1170               $wpdb->query( $wpdb->prepare("UPDATE $table_name SET shortcode_pages = '$new_used_in' WHERE id = %d", $form_id) );
    11651171             }
    11661172           }   
    11671173
    1168            // If the form ID is not among those used
     1174           // If a form ID is not among those used
    11691175           else {
    1170              // Exclude the page ID if it is present on the pages used
     1176             // Exclude the post ID from the list
    11711177             if ( in_array($post_id,$ids) ) {
    11721178               $updated_used_in = array_diff($ids,$id);
    11731179               $new_used_in = implode(",", $updated_used_in);
    1174                $wpdb->query( $wpdb->prepare("UPDATE $table_name SET pages = '$new_used_in' WHERE id = %d", $form_id) );
     1180               $wpdb->query( $wpdb->prepare("UPDATE $table_name SET shortcode_pages = '$new_used_in' WHERE id = %d", $form_id) );
    11751181             } 
    11761182           }
    11771183           
    11781184         }
    1179        
    1180          // Update the pages lists where the simpleform is shown   
    1181          if ( !in_array($post_id,$shortcode_pages) ) {
    1182            $ids_update = array_unique(array_merge($id,$shortcode_pages));
    1183          }
    1184          else {
    1185            $ids_update = $shortcode_pages;
    1186          }
    1187        
    1188          // Update the pages lists where the widget is shown - ## CODE NEEDS TO BE FIXED FOR USERS ROLE! ##
    1189          $sform_widget = get_option('widget_sform_widget');
    1190          if ( $sform_widget != false ) { 
    1191            unset($sform_widget['_multiwidget']);
    1192            foreach ( $sform_widget as $widget_id => $value ) {
    1193            // Create an array of hidden pages and include post id if not exists
    1194            $hidden_pages = ! empty($value['sform_widget_hidden_pages']) ? explode(',',$value['sform_widget_hidden_pages']) : array();
    1195            $updated_hidden_pages = array_unique(array_merge($id,$hidden_pages));
    1196            $new_hidden_pages = implode(",", $updated_hidden_pages);
    1197            $sform_widget[$widget_id]['sform_widget_hidden_pages'] = $new_hidden_pages;
    1198            // Create an array of visible pages and exclude post id if exists
    1199            $visible_pages = ! empty($value['sform_widget_visible_pages']) ? explode(',',$value['sform_widget_visible_pages']) : array();
    1200            $updated_visible_pages = array_diff($visible_pages,$id);
    1201            $new_visible_pages = implode(",", $updated_visible_pages);
    1202            $sform_widget[$widget_id]['sform_widget_visible_pages'] = $new_visible_pages;
    1203            update_option('widget_sform_widget', $sform_widget);
    1204            }
    1205          } 
    1206        
     1185         
    12071186      }
    12081187     
     
    12101189      else {
    12111190         
    1212        global $wpdb;
    1213        $table_name = "{$wpdb->prefix}sform_shortcodes";
    1214        $used_in_array = $wpdb->get_col( "SELECT pages FROM $table_name" );
    1215        $form_ids = $wpdb->get_col( "SELECT id FROM $table_name" );
    1216        if ( $used_in_array ) {
    1217        foreach ( $used_in_array as $used_in ) {
    1218          $index = array_search($used_in, $used_in_array);   
     1191       foreach ($form_ids as $form_id) {           
     1192         $used_in = $wpdb->get_var( "SELECT shortcode_pages FROM $table_name WHERE id = {$form_id}" );
    12191193         $ids = ! empty($used_in) ? explode(",", $used_in) : array();
    12201194         if ( in_array($post_id,$ids) ) {
    12211195            $updated_used_in = array_diff($ids,$id);
    12221196            $new_used_in = implode(",", $updated_used_in);
    1223             $form = $form_ids[$index];
    1224             $wpdb->query( $wpdb->prepare("UPDATE $table_name SET pages = '$new_used_in' WHERE id = %d", $form) );
     1197            $wpdb->query( $wpdb->prepare("UPDATE $table_name SET shortcode_pages = '$new_used_in' WHERE id = %d", $form_id) );
    12251198         }
    1226        }
    12271199       } 
    12281200
    1229        if ( in_array($post_id,$shortcode_pages) ) {
    1230            $ids_update = array_diff($shortcode_pages,$post_id);
    1231        }
    1232        else {
    1233            $ids_update = $shortcode_pages;
    1234        }
    1235 
    12361201      }
    1237      
    1238       update_option('sform_shortcode_pages', $ids_update);
    1239    
     1202               
    12401203    }
    1241        
    1242     /**
    1243      * Remove the shortcode if the form id does not exist
     1204           
     1205    /**
     1206     * Clean up the post content of any non-existent and redundant form.
    12441207     *
    12451208     * @since    2.0.2
    12461209     */
    12471210   
    1248     public function sanitize_shortcode($content) {
    1249  
     1211    public function clean_up_post_content($content) {
     1212          
    12501213       $util = new SimpleForm_Util();
    12511214       $form_ids = $util->sform_ids();
    12521215       $used_forms = $util->used_shortcodes($content);
    12531216     
    1254        foreach ($used_forms as $shortcode_id) {
    1255           $id = str_replace('\\','',$shortcode_id);         
    1256           if ( ! in_array($id,$form_ids) ) {         
    1257             $find = '[simpleform id=\"'.$id.'\"]';
     1217       // Return the duplicate shortcodes
     1218       $duplicates = array_unique(array_diff_key($used_forms,array_unique($used_forms)));
     1219       // Search all simpleform blocks and place all matches in an array
     1220       $search_block = '/<!-- wp:simpleform(.*)\/-->/';
     1221       preg_match_all($search_block, $content, $matches_block);     
     1222       // Search all shortcode blocks and place all matches in an array
     1223       $search_shortcode = '/<!-- wp:shortcode([^>]*)-->(.*?)<!-- \/wp:shortcode -->/s';
     1224       preg_match_all($search_shortcode, $content, $matches_shortcode);
     1225
     1226       if ( $matches_block ) {
     1227           
     1228         foreach ( $matches_block[0] as $block ) {
     1229           
     1230           // Remove blocks that cannot be displayed
     1231           if ( strpos($block, '\"formDisplay\":false') !== false ) {
     1232              $content = str_replace($block, '', $content);
     1233           }
     1234           
     1235         }
     1236         
     1237       }
     1238   
     1239       if ( $duplicates ) {
     1240           
     1241         foreach ($duplicates as $duplicate ) {
     1242           
     1243           $find = stripslashes($duplicate) != '1' ? '[simpleform id=\"'.stripslashes($duplicate).'\"]' : '[simpleform]';
     1244             
     1245             // If at least one shortcode block exists
     1246             if ( $matches_shortcode ) {
     1247               foreach ( $matches_shortcode[0] as $shortcode ) {
     1248                 // Check if the shortcode block is simpleform and it's using one of duplicate IDs
     1249                 if ( strpos($shortcode,$find) !== false ) {
     1250                   $splitted_content = explode($shortcode, $content, 2);
     1251                   // Verify if there is also a classic shortcode and if it has been used before
     1252                   if ( strpos($splitted_content[0],$find) !== false ) {
     1253                      $new_splitted_content = explode($find, $content, 2);
     1254                      // Remove all subsequent blocks
     1255                      $content = $new_splitted_content[0] . $find . str_replace($find, '', str_replace($shortcode, '', $new_splitted_content[1]));
     1256                     
     1257                   }
     1258                   else {
     1259                   // Keep the first block and remove all subsequent blocks and all classic shortcodes where these exist
     1260                   $content = $splitted_content[0] . $shortcode . str_replace($find, '', str_replace($shortcode, '', $splitted_content[1]));
     1261                   }
     1262                  // break;
     1263                 }
     1264               }
     1265             }
     1266             
     1267             // Verify if at least one classic shortcode exists
     1268               if ( strpos($content,$find) !== false ) {
     1269                  $splitted_content = explode($find, $content, 2);
     1270                  // Keep the first and remove all subsequent
     1271                  $content = $splitted_content[0] . $find . str_replace($find, '', $splitted_content[1]);
     1272                  // break;
     1273               }
     1274                                       
     1275         }
     1276       
     1277       }
     1278       
     1279       // In the absence of duplicates remove shortcode that is using the same form id inserted after the block
     1280       else {
     1281         
     1282         if ( $matches_block ) {
     1283             
     1284           foreach ( $matches_block[0] as $block ) {
     1285           
     1286             if ( strpos($block, '\"formDisplay\":true') !== false ) {
     1287               $split_block = isset(explode('\"formId\":\"', $block)[1]) ? explode('\"formId\":\"', $block)[1] : '';
     1288               $form_id = ! empty($split_block) ? explode('\"', $split_block)[0] : '';
     1289               $find = $form_id != '1' ? '[simpleform id=\"'.$form_id.'\"]' : '[simpleform]';               
     1290               // Remove any shortcode block that is using the same form id
     1291               if ( $matches_shortcode ) {
     1292                 foreach ( $matches_shortcode[0] as $shortcode ) {
     1293                   if ( strpos($shortcode,$find) !== false ) {
     1294                      $content = str_replace($shortcode, '', $content);
     1295                      break;
     1296                   }
     1297                 }
     1298               }
     1299               // Remove any classic shortcode that is using the same form id
     1300               $content = str_replace($find, '', $content);
     1301             }
     1302
     1303           }
     1304           
     1305         }
     1306
     1307       }
     1308       
     1309       // Remove any shortcode using an inesistent form id
     1310       foreach ($used_forms as $shortcode_id) {       
     1311         
     1312          if ( ! in_array(stripslashes($shortcode_id),$form_ids) ) {   
     1313            $find = '[simpleform id=\"'.stripslashes($shortcode_id).'\"]';
     1314           
     1315            // Search all shortcode blocks and place all matches in an array
     1316            $search_shortcode = '/<!-- wp:shortcode([^>]*)-->(.*?)<!-- \/wp:shortcode -->/s';
     1317            preg_match_all($search_shortcode, $content, $matches_shortcode);
     1318           
     1319            // If at least one shortcode block exists
     1320            if ( $matches_shortcode ) {
     1321              foreach ( $matches_shortcode[0] as $shortcode ) {
     1322                // Check if the shortcode block is simpleform and it's using an inesistent form id
     1323                if ( strpos($shortcode,$find) !== false ) {
     1324                  // Remove all inesistent blocks
     1325                  $content = str_replace($shortcode, '', $content);
     1326                  break;
     1327                }
     1328              }
     1329            }
     1330             
     1331            // Remove all classic shortcodes using an inesistent form id
    12581332            $content = str_replace( $find,'', $content );
    12591333          }
    1260        }
    1261 
    1262        return $content;
     1334
     1335       }
     1336       
     1337       // Remove empty shortcodes
     1338       $empty_shortcode_blocks = '<!-- wp:shortcode /-->';
     1339       $content = str_replace($empty_shortcode_blocks,'',$content);
     1340       
     1341       return $content;
    12631342 
    12641343    }
     
    13531432    }
    13541433   
     1434    /**
     1435     * Delete form.
     1436     *
     1437     * @since    2.0.4
     1438     */
     1439   
     1440    public function sform_delete_form() {
     1441
     1442      if( $_SERVER['REQUEST_METHOD'] !== 'POST' ) { die ( 'Security checked!'); }
     1443      if ( ! wp_verify_nonce( $_POST['sform_nonce'], "sform_nonce_deletion")) { exit("Security checked!"); }   
     1444      if ( ! current_user_can('manage_options')) { exit("Security checked!"); }   
     1445     
     1446      else {
     1447        $form_id = isset( $_POST['form-id'] ) ? absint($_POST['form-id']) : '1';
     1448        global $wpdb;
     1449        $table = "{$wpdb->prefix}sform_shortcodes";
     1450        $submission_table = "{$wpdb->prefix}sform_submissions";
     1451        $table_post = $wpdb->prefix . 'posts';
     1452        // $sql = $wpdb->prepare("SELECT pages, shortcode_pages, block_pages, widget, widget_id FROM {$table} WHERE id = '%d'", $form_id );
     1453        // $form_data = $wpdb->get_results( $sql, ARRAY_A );
     1454        $pages_list = $wpdb->get_var( "SELECT pages FROM {$table} WHERE id = {$form_id}" );
     1455        $shortcode_pages_list = $wpdb->get_var( "SELECT shortcode_pages FROM {$table} WHERE id = {$form_id}" );
     1456        $block_pages_list = $wpdb->get_var( "SELECT block_pages FROM {$table} WHERE id = {$form_id}" );
     1457        $widget = $wpdb->get_var( "SELECT widget FROM {$table} WHERE id = {$form_id} AND widget != 0" );
     1458        $widget_id = $wpdb->get_var( "SELECT widget_id FROM {$table} WHERE id = {$form_id}" );
     1459        $pages = $pages_list ? explode(',',$pages_list) : array();
     1460        $shortcode_pages = $shortcode_pages_list ? explode(',',$shortcode_pages_list) : array();
     1461        $block_pages = $block_pages_list ? explode(',',$block_pages_list) : array();
     1462        $form_pages = array_unique(array_merge($shortcode_pages,$block_pages,$pages));
     1463       
     1464        $deletion = $wpdb->query($wpdb->prepare("DELETE FROM {$table} WHERE id = '%d'", $form_id));
     1465       
     1466        if ( $deletion ) {
     1467           
     1468          $post_cleaning = '';
     1469           
     1470          $wpdb->delete( $submission_table, array( 'form' => $form_id ) );
     1471          $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name = 'sform_{$form_id}_settings' OR option_name = 'sform_{$form_id}_attributes' OR option_name = '_transient_sform_last_{$form_id}_message'" );
     1472          if ( $form_pages ) {
     1473            foreach ($form_pages as $postID) {
     1474              $post = get_post($postID);
     1475              $content = $post->post_content;
     1476              $search_shortcode = $form_id != '1' ? '[simpleform id="'.$form_id.'"]' : '[simpleform]';
     1477             
     1478              if ( has_blocks($content) ) {
     1479               $plugin_block = '/<!-- wp:simpleform(.*)\/-->/';
     1480               preg_match_all($plugin_block, $content, $matches_block);     
     1481               if ( $matches_block ) {
     1482                foreach ( $matches_block[0] as $block ) {
     1483                  if ( strpos($block, '"formId":"'.$form_id.'"') !== false ) {
     1484                     $content = str_replace($block, '', $content);
     1485                  }
     1486                }
     1487               }
     1488               $shortcode_block = '/<!-- wp:shortcode([^>]*)-->(.*?)<!-- \/wp:shortcode -->/s';
     1489               preg_match_all($shortcode_block, $content, $matches_shortcode);
     1490               if ( $matches_shortcode ) {
     1491                foreach ( $matches_shortcode[0] as $shortcode ) {
     1492                  if ( strpos($shortcode,$search_shortcode) !== false ) {
     1493                    $content = str_replace($shortcode, '', $content);
     1494                    break;
     1495                  }
     1496                }
     1497               }
     1498              }
     1499             
     1500              // Remove shortcode not included in a block
     1501              if ( strpos($content, $search_shortcode) !== false ) {
     1502                $content = str_replace($search_shortcode, '', $content);
     1503              }
     1504               
     1505              $cleaning = $wpdb->update( $table_post, array( 'post_content' => $content ), array( 'ID' => $postID ) );
     1506                           
     1507              if ( $cleaning ) { $post_cleaning .= 'done'; }
     1508             
     1509            } 
     1510          }
     1511         
     1512          if ( $widget ) {
     1513            $sform_widget = get_option('widget_sform_widget');         
     1514            unset($sform_widget[$widget]);
     1515            update_option('widget_sform_widget', $sform_widget);
     1516            $sidebars_widgets = get_option('sidebars_widgets');
     1517            foreach ( $sidebars_widgets as $sidebar => $widgets ) {
     1518              if ( is_array( $widgets ) ) {
     1519                foreach ( $widgets as $index => $widget_id ) {
     1520                  if ( $widget_id == 'sform_widget-'.$widget ) {
     1521                    unset($sidebars_widgets[$sidebar][$index]);
     1522                    update_option('sidebars_widgets', $sidebars_widgets);
     1523                  }
     1524                }
     1525              }
     1526            }
     1527          }
     1528         
     1529          if ( $widget_id ) {
     1530            $widget_block = get_option('widget_block');         
     1531            if ( !empty($widget_block) ) {
     1532              foreach ($widget_block as $key => $value ) {
     1533                if ( is_array($value) ) {   
     1534                   $string = implode('',$value);
     1535                   if ( strpos($string, 'wp:simpleform/form-selector' ) !== false ) {
     1536                      $split_id = ! empty($string) ? explode('formId":"', $string) : '';
     1537                      $id = isset($split_id[1]) ? explode('"', $split_id[1])[0] : '';
     1538                      if ( $id == $form_id ) {
     1539                        unset($widget_block[$key]);
     1540                        update_option('widget_block', $widget_block);
     1541                      }
     1542                   }
     1543                   if ( ( strpos($string,'wp:shortcode') && strpos($string,'[simpleform') ) !== false ) {
     1544                     $split_shortcode = ! empty($string) ? explode('[simpleform', $string) : '';
     1545                     $split_id = isset($split_shortcode[1]) ? explode(']', $split_shortcode[1])[0] : '';
     1546                     $id = empty($split_id) ? '1' : filter_var($split_id, FILTER_SANITIZE_NUMBER_INT);
     1547                     if ( $id == $form_id ) {
     1548                       unset($widget_block[$key]);
     1549                       update_option('widget_block', $widget_block);
     1550                     }
     1551                   }
     1552                }
     1553              }
     1554            }
     1555            $sidebars_widgets = get_option('sidebars_widgets');
     1556            foreach ( $sidebars_widgets as $sidebar => $widgets ) {
     1557              if ( is_array( $widgets ) ) {
     1558                foreach ( $widgets as $index => $id ) {
     1559                  if ( $id == $widget_id ) {
     1560                    unset($sidebars_widgets[$sidebar][$index]);
     1561                    update_option('sidebars_widgets', $sidebars_widgets);
     1562                  }
     1563                }
     1564              }
     1565            }
     1566          }
     1567           
     1568          if ( ! empty($post_cleaning) ) {
     1569            $message = sprintf( __( 'Form with ID: %s permanently deleted', 'simpleform' ), $form_id ) . '.&nbsp;' . __( 'All the pages containing the form have been cleaned up', 'simpleform' );
     1570            echo json_encode(array('error' => false, 'message' => $message, 'redirect_url' => admin_url('admin.php?page=sform-submissions') ));
     1571            exit;
     1572          }
     1573          else {
     1574            echo json_encode(array('error' => false, 'message' => sprintf( __( 'Form with ID: %s permanently deleted', 'simpleform' ), $form_id ), 'redirect_url' => admin_url('admin.php?page=sform-submissions') ));
     1575            exit;
     1576          }
     1577
     1578        }
     1579        else {
     1580            echo json_encode(array('error' => true, 'message' => __( 'Error occurred deleting the form. Try again!', 'simpleform' ) ));
     1581            exit;
     1582        }
     1583        die();
     1584      }
     1585
     1586    } 
     1587   
    13551588}
  • simpleform/trunk/admin/class-block.php

    r2568608 r2581779  
    2020   
    2121    public function __construct() {
     22       
     23        // Restore the classic widgets editor
     24        add_action( 'after_setup_theme',  array( $this, 'widgets_block_editor' ));
    2225        // Register the block
    2326        add_action( 'init', array( $this, 'register_block' ) );
    24         // Register block scripts and styles.
     27        // Register block scripts and styles
    2528        add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_assets' ) );
    26         // Update the pages list containing the block when a page is edited.
     29        // Update the pages list containing the block when a page is edited
    2730        add_action( 'save_post', array( $this, 'sform_block_pages'), 10, 2 );
    28         // Return the pages list containing the block
    29         add_filter( 'sform_block_pages', array( $this, 'block_pages_list'), 10, 2 );
    3031        // Add filter for hiding text above the form
    31         add_filter( 'sform_block_description', array( $this, 'form_description'));
     32        add_filter( 'sform_block_description', array( $this, 'form_description'), 10, 1);
    3233        // Add filter for hiding text below the form
    33         add_filter( 'sform_block_ending', array( $this, 'form_ending'));
    34         // Restore the classic widgets editor
    35         add_action( 'after_setup_theme',  array( $this, 'widgets_block_editor' ));
    36    
     34        add_filter( 'sform_block_ending', array( $this, 'form_ending'), 10, 1);
     35        // Clean up the widget areas of any non-existent and redundant form
     36        add_action( 'widgets_init',array( $this, 'clean_up_widget_areas')); // OR init priority of 1
     37        // Hide widget blocks if the form already appears in the post content.
     38        add_filter( 'sidebars_widgets', array( $this, 'hide_widgets' ));       
     39
    3740    }
    3841   
     
    6063               
    6164        if ( $widget_editor == 'false' && ! empty($simpleform_widgets) ) {
    62        
    63            remove_theme_support( 'widgets-block-editor' );
    64        }
     65          remove_theme_support( 'widgets-block-editor' );
     66        }
    6567       
    6668    }
     
    100102          'rightPadding' => array('type' => 'integer'),
    101103          'bottomPadding' => array('type' => 'integer'),
    102           'leftPadding' => array('type' => 'integer')
     104          'leftPadding' => array('type' => 'integer'),
     105          'formDisplay' => array('type' => 'boolean'),
     106          'formShortcode' => array('type' => 'boolean'),
     107          'formWidget' => array('type' => 'boolean')
    103108        );
    104109       
     
    132137        global $wpdb;
    133138        $table_name = "{$wpdb->prefix}sform_shortcodes";
    134         $forms = $wpdb->get_results( "SELECT id, name FROM $table_name WHERE widget = '0' and area = 'page'", 'ARRAY_A' );
    135         $empty_value = array( 'id' => '', 'name' => __( 'Select an existing form', 'simpleform' ) );
     139        $forms = $wpdb->get_results( "SELECT id, name FROM $table_name WHERE widget = '0'", 'ARRAY_A' );       
     140        $empty_value = array( 'id' => '', 'name' => __( 'Select an existing form', 'simpleform' ), 'block_pages' => '' );
    136141       
    137142        // Get all values of id key without foreach loop
     
    139144        $above_ids = array();
    140145        $below_ids = array();
     146               
    141147        foreach ($id_list as $id) {
    142148          $attributes_option = get_option('sform_'.$id.'_attributes');
     
    148154            array_push($below_ids, $id);
    149155          }
    150         }
     156         
     157        }
     158       
    151159        array_unshift($forms , $empty_value);
    152 
     160       
    153161        $script_vars = array(
    154162            'blocktitle' => __( 'SimpleForm', 'simpleform' ),
     
    198206    public function sform_block_render($attributes) {
    199207
    200         $form_id = ! empty( $attributes['formId'] ) ? absint( $attributes['formId'] ) : '';
     208        $form_id = ! empty( $attributes['formId'] ) && absint($attributes['formId']) ? $attributes['formId'] : '';
    201209       
    202210        if ( empty( $form_id ) ) {
    203211            return '';
    204212        }
    205        
     213
    206214        $anchor = ! empty( $attributes['anchor'] ) ? 'id="' . $attributes['anchor'] . '"' : '';
    207215        $topmargin = ! empty( $attributes['topMargin'] ) && absint( $attributes['topMargin'] ) ? 'margin-top:'. $attributes['topMargin'] .'px;' : '';
     
    224232        $cssfile = ! empty( $settings['stylesheet_file'] ) ? esc_attr($settings['stylesheet_file']) : 'false';
    225233
    226         if ( $form_id != '1' ) {
    227            $shortcode = '[simpleform id="'.$form_id.'"]';
    228         }
    229            
    230         else {
    231            $shortcode = '[simpleform]';
    232         }           
     234        if ( $form_id != '1' ) { $shortcode = '[simpleform id="'.$form_id.'"]'; }
     235        else { $shortcode = '[simpleform]'; }           
    233236         
    234237        $title  = ! empty( $attributes['displayTitle'] ) ? true : false;
     
    246249        $bottom_text = $ending == true && ! empty( $form_attributes['bottom_text'] ) ? stripslashes(wp_kses_post($form_attributes['bottom_text'])) : '';
    247250        $is_gb_editor = defined( 'REST_REQUEST' ) && REST_REQUEST && ! empty( $_REQUEST['context'] ) && 'edit' === $_REQUEST['context'];
    248        
    249         if ( $is_gb_editor ) {  //  editor used for posts and pages
     251        $form_display = ! empty( $attributes['formDisplay'] ) && $attributes['formDisplay'] == true ? true : false;
     252        $form_shortcode = ! empty( $attributes['formShortcode'] ) && $attributes['formShortcode'] == true ? true : false;
     253        $form_widget = ! empty( $attributes['formWidget'] ) && $attributes['formWidget'] == true ? true : false;
     254
     255        if ( $is_gb_editor ) {
    250256           
    251           if ( $stylesheet == 'false') { 
     257          if ( $stylesheet == 'false') { $css_content = file_get_contents(SIMPLEFORM_URL . 'public/css/public-min.css'); }
     258         
     259          else {
    252260             
    253               $css_content = file_get_contents(SIMPLEFORM_URL . 'public/css/public-min.css');
    254      
    255           }
    256              
    257           else {
    258 
    259261            $css_content = 'input, select, textarea {width: 100%;} #captcha-field-'.$form_id.' { width: 150px; height: intrinsic; } #captcha-question-'.$form_id.' { width: 80px; height: inherit; cursor: text; border: none !important; outline: none; display: inline-block; background-color: transparent; padding-right: 0; padding-left: 0; box-shadow: none; } #sform-captcha-'.$form_id.' { width: 50px; border: none !important; outline: none; display: inline-block; background-color: transparent; padding-left: 5px ; box-shadow: none; } input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } input[type=number] { -moz-appearance: textfield; } .carrots { opacity: 0; position: absolute; top: 0; left: 0; height: 0; width: 0; z-index: -1; } .error-des { line-height: 1; color: #dc3545; font-size: 14px; height: 14px; margin-top: 5px; margin-bottom: 5px; } .error-des span { display: none; } .sform-field.is-invalid + .error-des span { display: block; } #errors-'.$form_id.' { padding: 5px 0 25px 0; position: relative; outline: none; } #errors-'.$form_id.' span { display: block; visibility: hidden; text-align: center; } .captcha-error { display: none !important; } .noscript { position: absolute; top: 0; width: 100%; } #errors-'.$form_id.'.top { margin-bottom: 20px; } .form.confirmation { outline: none; } .form.confirmation { text-align: center; padding-top: 50px; } .form.confirmation > img, .form.confirmation > p > img { margin: 30px auto; width: 250px; } #sform-confirmation-'.$form_id.' { outline: 0; } .d-block { display: inline-block; } .d-none { display: none !important; } .v-visible { visibility: visible !important; } .v-invisible { visibility: hidden !important; opacity: 0; } .align-left { text-align: left; } .align-center { text-align: center; } .align-right { text-align: right; } h1.sform,h2.sform,h3.sform,h4.sform,h5.sform,h6.sform { color: inherit; }';
    260262           
     
    275277          }
    276278         
    277           $css = '<style>' . $css_content . $custom_css . '</style>';
    278           $return_html = $start_wrap . $form_title . $form_description . '<fieldset disabled>' . do_shortcode($shortcode) .'</fieldset>' . $bottom_text . $end_wrap . $css;     
     279          if ( $form_display == false ) {
     280             
     281             global $wpdb;
     282             $table_name = "{$wpdb->prefix}sform_shortcodes";
     283             $query = "SELECT name FROM `$table_name` WHERE id = %s";
     284             $name = '"'. $wpdb->get_var( $wpdb->prepare( $query, $form_id ) ) .'"';
     285             
     286             if ( $form_widget == false ) {
     287             $message =  $form_shortcode == false ? __( 'The block cannot be displayed on this page since the same block has been used.', 'simpleform' ) . '<br>' . sprintf( __( 'You may display the form %s only once to make it work properly.', 'simpleform' ), $name ) . '&nbsp;' . __( 'Remove the block or select a different one.', 'simpleform' ) : sprintf( __( 'The block cannot be displayed on this page since the shortcode %s has been used.', 'simpleform' ), $shortcode ) . '<br>' . sprintf( __( 'You may display the form %s only once to make it work properly.', 'simpleform' ), $name ) . '&nbsp;' . __( 'Remove the block or select a different one.', 'simpleform' );
     288             } else {
     289             $message =  $form_shortcode == false ? __( 'The block cannot be displayed on this widget area since the same block has been used.', 'simpleform' ) . '<br>' . sprintf( __( 'You may display the form %s only once to make it work properly.', 'simpleform' ), $name ) . '&nbsp;' . __( 'Remove the block or select a different one.', 'simpleform' ) : sprintf( __( 'The block cannot be displayed on this widget area since the shortcode %s has been used.', 'simpleform' ), $shortcode ) . '<br>' . sprintf( __( 'You may display the form %s only once to make it work properly.', 'simpleform' ), $name ) . '&nbsp;' . __( 'Remove the block or select a different one.', 'simpleform' );
     290             }
     291             
     292             $return_html = '<div id="duplication-notice"><label class="components-placeholder__label"><svg viewBox="0 0 180 180" xmlns="http://www.w3.org/2000/svg" width="24" height="24" role="img" aria-hidden="true" focusable="false"><path d="M96.326,111.597c0-18.193-0.167-36.391,0.053-54.58 c0.188-15.525,3.512-29.949,12.957-41.421c9.567-11.622,21.017-11.457,30.737-0.01c7.372,8.682,10.607,19.568,12.215,31.381 c0.732,5.379,0.851,10.786,0.849,16.214c-0.011,29.197-0.002,58.396-0.007,87.595c-0.002,6.48-4.014,10.405-9.378,9.323 c-1.924-0.389-1.816-2.022-1.926-3.624c-0.695-10.047-0.688-10.011-8.982-7.314c-6.804,2.212-13.586,4.543-20.463,6.387 c-3.582,0.962-5.123,2.99-4.787,7.271c0.146,1.889,0.034,3.815-0.05,5.717c-0.121,2.802-1.362,4.579-3.627,5.479 c-6.666,2.648-7.592,1.872-7.592-6.516C96.325,148.864,96.325,130.23,96.326,111.597z" fill="currentColor"></path><path d="M27.769,107.198c0-15.412-0.03-30.824,0.006-46.234 c0.066-28.643,17.508-50.748,41.681-53.416c10.049-1.108,20.08-0.48,30.118-0.75c0.936-0.025,2.139-0.439,2.631,0.961 c0.478,1.368-0.575,2.092-1.229,2.922c-0.76,0.967-1.845,1.741-2.281,2.873c-2.752,7.121-7.72,7.832-13.544,7.427 c-6.419-0.445-12.871-0.373-19.217,1.558C49.624,27.498,38.989,43.42,39.058,63.261c0.029,8.499,0.51,16.996,0.485,25.493 c-0.039,13.634-0.362,27.268-0.496,40.901c-0.065,6.679,1.043,7.76,6.557,8.476c12.062,1.562,24.085,3.49,36.146,5.019 c3.442,0.438,4.282,2.441,4.271,6.104c-0.025,9.025-0.132,8.982-7.748,7.741c-11.527-1.878-23.107-3.308-34.656-5.002 c-3.365-0.496-4.713,0.846-4.562,5.06c0.346,9.731,0.213,8.388-7.725,7.188c-2.969-0.446-3.621-2.725-3.603-5.963 C27.816,141.25,27.769,124.225,27.769,107.198z" fill="currentColor"></path><path d="M75.697,51.212c-5.191-0.897-10.416-0.479-15.628-0.553 c-2.054-0.029-2.659-0.985-2.13-3.342c1.504-6.724,6.782-12.072,12.691-12.477c3.083-0.211,6.184-0.019,9.271-0.12 c1.641-0.054,1.945,0.99,1.602,2.487c-0.899,3.906-1.4,7.864-1.404,11.914c-0.002,1.369-0.648,2.056-1.787,2.086 C77.44,51.23,76.568,51.212,75.697,51.212z" fill="currentColor"></path><path d="M73.535,48.245c-3.321-0.574-6.665-0.307-10.001-0.354 c-1.313-0.019-1.702-0.63-1.362-2.139c0.963-4.303,4.34-7.726,8.121-7.986c1.975-0.135,3.959-0.012,5.936-0.076 c1.049-0.035,1.244,0.633,1.024,1.592c-0.577,2.5-0.897,5.033-0.899,7.625c0,0.875-0.414,1.316-1.144,1.335 C74.651,48.256,74.094,48.245,73.535,48.245z" fill="transparent"></path></svg>'. __( 'SimpleForm', 'simpleform' ) .'</label>' . $message . '</div>';
     293           
     294          }
     295
     296          else {
     297             
     298            $css = '<style>' . $css_content . $custom_css . '</style>';
     299            $return_html = $start_wrap . $form_title . $form_description . '<fieldset disabled>' . do_shortcode($shortcode) .'</fieldset>' . $bottom_text . $end_wrap . $css;   
     300         
     301          }
    279302
    280303        }
    281304
    282305        else {
    283            
    284           $return_html = $start_wrap . $form_title . do_shortcode($shortcode) . $end_wrap;
    285          
     306         
     307          $util = new SimpleForm_Util();
     308          $form_pages = $util->form_pages($form_id);
     309          global $post;
     310          if ( $form_display == false || ( ! is_admin() && $form_widget == true && in_array($post->ID,$form_pages) ) ) { $return_html = ''; }   
     311          else { $return_html = $start_wrap . $form_title . do_shortcode($shortcode) . $end_wrap; }
     312
    286313        }
    287314       
     
    290317    }   
    291318       
    292     /**
    293      * Return a pages list containing the SimpleForm block.
    294      *
    295      * @since    2.0
    296      */
    297      
    298     public function block_pages_list($id, $control) {
    299        
    300       if ( $id == '0' ) {
    301         $block_pages = get_option("sform_block_pages");
    302         $ids = $block_pages != false && is_array($block_pages) && !empty($block_pages) ? $block_pages : array();
    303       }
    304      
    305       else  {
    306         $block_pages = get_option("sform_{$id}_block_pages");
    307         $ids = $block_pages != false && is_array($block_pages) && !empty($block_pages) ? $block_pages : array();
    308       }
    309 
    310       return $ids; 
    311 
    312     }
    313    
    314     /**
    315      * Add filter for hiding text above the form for the public-facing side of the site
    316      *
    317      * @since    2.0
    318      */
    319      
    320     public function form_description() {
    321      
    322       // NEEDS TO BE FIXED
    323       // WORKS ONLY IF FORM IS EMBEDDED IN THE POST CONTENT NOT IN A WIDGET AREA
    324      
    325       global $post;
    326       $text = '';
    327      
    328       if ( ! is_admin() && has_blocks( $post->post_content ) ) {
    329          
    330         $blocks = parse_blocks( $post->post_content );
    331         foreach ( $blocks as $block ) {
    332           $sform_block = $this->get_simpleform_block($block);
    333           if($sform_block && isset($sform_block['attrs']['formDescription']) && $sform_block['attrs']['formDescription'] === false ) {
    334              $text .= 'false';
    335           }
    336         }
    337       }
    338 
    339       return $text;
    340 
    341     }
    342        
    343     /**
    344      * Add filter for hiding text below the form for the public-facing side of the site
    345      *
    346      * @since    2.0
    347      */
    348      
    349     public function form_ending() {
    350      
    351       // NEEDS TO BE FIXED
    352       // WORKS ONLY IF FORM IS EMBEDDED IN THE POST CONTENT NOT IN A WIDGET AREA
    353 
    354       global $post;
    355       $text = '';
    356      
    357       if ( ! is_admin() && has_blocks( $post->post_content ) ) {
    358         $blocks = parse_blocks( $post->post_content );
    359         foreach ( $blocks as $block ) {
    360           $sform_block = $this->get_simpleform_block($block);
    361           if($sform_block && isset($sform_block['attrs']['formEnding']) && $sform_block['attrs']['formEnding'] === false ) {
    362              $text .= 'false';
    363           }
    364         }
    365       }
    366 
    367       return $text;
    368 
    369     }
    370319   
    371320    /**
     
    427376
    428377    /**
    429      * Update pages list containing the SimpleForm block when a page is edited.
     378     * Update pages list containing a block form when a page is edited.
    430379     *
    431380     * @since    2.0
     
    438387        return;
    439388      }
     389     
     390      // List of all forms IDs that have been created
     391      $util = new SimpleForm_Util();     
     392      $form_ids = $util->sform_ids();
     393      global $wpdb;
     394      $table_name = "{$wpdb->prefix}sform_shortcodes";
     395      $id = array($post_id);
    440396 
    441397      // If the post content contains a block   
    442398      if ( has_blocks( $post->post_content ) ) {
    443         $id = array($post_id);
     399       
     400        $blocks = parse_blocks( $post->post_content );
     401        $used_forms = array();
     402       
     403        foreach ( $blocks as $block ) {
     404          $sform_block = $this->get_simpleform_block($block);
     405          // If the post content contains the simpleform block create a list of used forms
     406          if ( $sform_block && isset($sform_block['attrs']['formId']) && ! empty($sform_block['attrs']['formId']) ) {
     407             $used_forms[] = $sform_block['attrs']['formId'];
     408          }
     409        }
     410       
     411        foreach ($form_ids as $form_id) {
     412          // Check if the form is used and include the post ID in the list if not yet inserted
     413          if ( ! empty($used_forms) && in_array($form_id,$used_forms) ) {   
     414             $form_pages = $wpdb->get_var( "SELECT block_pages FROM $table_name WHERE id = {$form_id}" );
     415             $pages = ! empty($form_pages) ? explode(',',$form_pages) : array();
     416             if ( ! in_array($post_id,$pages) ) {
     417                $new_pages = implode(",", array_unique(array_merge($id,$pages)));
     418                $wpdb->update($table_name, array('block_pages' => $new_pages), array('id' => $form_id ));
     419             }
     420          }
     421         
     422          // Update the lists for the unused forms
     423          else {       
     424             $form_pages = $wpdb->get_var( "SELECT block_pages FROM $table_name WHERE id = {$form_id}" );
     425             $pages = ! empty($form_pages) ? explode(",", $form_pages) : array();
     426             if ( in_array($post_id,$pages) ) {
     427                $new_pages = implode(",", array_diff($pages,$id));
     428                $wpdb->update($table_name, array('block_pages' => $new_pages), array('id' => $form_id ));
     429             }
     430          }
     431        }
     432       
     433      }
     434     
     435      // If the post content does not contain any block   
     436      else {         
     437       foreach ($form_ids as $form_id) {           
     438         $form_pages = $wpdb->get_var( "SELECT block_pages FROM $table_name WHERE id = {$form_id}" );
     439         $pages = ! empty($form_pages) ? explode(",", $form_pages) : array();
     440         if ( in_array($post_id,$pages) ) {
     441            $new_pages = implode(",", array_diff($pages,$id));
     442            $wpdb->update($table_name, array('block_pages' => $new_pages), array('id' => $form_id ));
     443         }
     444       } 
     445      }
     446               
     447    }
     448   
     449    /**
     450     * Add filter for hiding text above the form for the public-facing side of the site
     451     *
     452     * @since    2.0
     453     */
     454     
     455    public function form_description($form_id) {
     456     
     457      if ( is_admin() )
     458      return;
     459   
     460      global $post;
     461      $text = '';
     462      $occurrence = false;
     463
     464      if ( has_blocks( $post->post_content ) ) {
    444465        $blocks = parse_blocks( $post->post_content );
    445466        foreach ( $blocks as $block ) {
    446467          $sform_block = $this->get_simpleform_block($block);
     468          if ( $sform_block && $sform_block['attrs']['formId'] == $form_id ) {
     469             $occurrence = true;
     470             if ( isset($sform_block['attrs']['formDescription']) && $sform_block['attrs']['formDescription'] === true ) {
     471               $text .= 'true';
     472               break;
     473             }
     474          }
     475        }
     476       
     477        $widget_block = get_option("widget_block") != false ? get_option("widget_block") : array();
     478       
     479        if ( !empty($widget_block) ) {
     480          foreach ($widget_block as $key => $value ) {
     481            if ( is_array($value) ) {   
     482               $string = implode('',$value);
     483               if ( strpos($string, 'wp:simpleform/form-selector' ) !== false ) {
     484                 $split_des = ! empty($string) ? explode('formDescription":', $string) : '';
     485                 $formDescription = isset($split_des[1]) ? explode(',"', $split_des[1])[0] : '';
     486                 $split_id = ! empty($string) ? explode('formId":"', $string) : '';
     487                 $id = isset($split_id[1]) ? explode('"', $split_id[1])[0] : '';             
     488                 if ( $id == $form_id && $formDescription == 'true' && $occurrence == false ) {   
     489                    $text .= 'true';
     490                    break;
     491                }               
     492               }
     493            }         
     494          }
     495        }
     496      }
     497     
     498      else {
     499
     500        $widget_block = get_option("widget_block") != false ? get_option("widget_block") : array();
     501       
     502        if ( !empty($widget_block) ) {
     503          foreach ($widget_block as $key => $value ) {
     504            if ( is_array($value) ) {   
     505               $string = implode('',$value);
     506               if ( strpos($string, 'wp:simpleform/form-selector' ) !== false ) {
     507                 $split_des = ! empty($string) ? explode('formDescription":', $string) : '';
     508                 $formDescription = isset($split_des[1]) ? explode(',"', $split_des[1])[0] : '';
     509                 $split_id = ! empty($string) ? explode('formId":"', $string) : '';
     510                 $id = isset($split_id[1]) ? explode('"', $split_id[1])[0] : '';             
     511                 if ( $id == $form_id && $formDescription == 'true' ) {   
     512                    $text .= 'true';
     513                    break;
     514                }               
     515               }
     516            }         
     517          }
     518        }
     519         
     520      }
     521
     522      return $text;
     523
     524    }
     525       
     526    /**
     527     * Add filter for hiding text below the form for the public-facing side of the site
     528     *
     529     * @since    2.0
     530     */
     531     
     532    public function form_ending($form_id) {
     533     
     534      if ( is_admin() )
     535      return;
     536   
     537      global $post;
     538      $text = '';
     539      $occurrence = false;
     540     
     541      if ( has_blocks( $post->post_content ) ) {
     542        $blocks = parse_blocks( $post->post_content );
     543        foreach ( $blocks as $block ) {
     544          $sform_block = $this->get_simpleform_block($block);
     545          if ( $sform_block && $sform_block['attrs']['formId'] == $form_id ) {
     546             $occurrence = true;
     547             if ( isset($sform_block['attrs']['formEnding']) && $sform_block['attrs']['formEnding'] === true ) {
     548               $text .= 'true';
     549               break;
     550             }
     551          }
     552
     553        }
     554       
     555        $widget_block = get_option("widget_block") != false ? get_option("widget_block") : array();
     556
     557        if ( !empty($widget_block) ) {
     558          foreach ($widget_block as $key => $value ) {
     559            if ( is_array($value) ) {   
     560               $string = implode('',$value);
     561               if ( strpos($string, 'wp:simpleform/form-selector' ) !== false ) {
     562                 $split_des = ! empty($string) ? explode('formEnding":', $string) : '';
     563                 $formEnding = isset($split_des[1]) ? explode(',"', $split_des[1])[0] : '';
     564                 $split_id = ! empty($string) ? explode('formId":"', $string) : '';
     565                 $id = isset($split_id[1]) ? explode('"', $split_id[1])[0] : '';
     566                 if ( $id == $form_id && $formEnding == 'true' && $occurrence == false ) {   
     567                    $text .= 'true';
     568                    break;
     569                }               
     570               }
     571            }         
     572          }
     573        }
     574      }
     575     
     576      else {
     577         
     578        $widget_block = get_option("widget_block") != false ? get_option("widget_block") : array();
     579
     580        if ( !empty($widget_block) ) {
     581          foreach ($widget_block as $key => $value ) {
     582            if ( is_array($value) ) {   
     583               $string = implode('',$value);
     584               if ( strpos($string, 'wp:simpleform/form-selector' ) !== false ) {
     585                 $split_des = ! empty($string) ? explode('formEnding":', $string) : '';
     586                 $formEnding = isset($split_des[1]) ? explode(',"', $split_des[1])[0] : '';
     587                 $split_id = ! empty($string) ? explode('formId":"', $string) : '';
     588                 $id = isset($split_id[1]) ? explode('"', $split_id[1])[0] : '';             
     589                 if ( $id == $form_id && $formEnding == 'true' ) {   
     590                    $text .= 'true';
     591                    break;
     592                }               
     593               }
     594            }         
     595          }
     596        }
     597      }
     598
     599      return $text;
     600     
     601    }
     602   
     603    /**
     604     * Clean up the widget areas of any non-existent and redundant form.
     605     *
     606     * @since    2.0.4
     607     */
     608   
     609     public function clean_up_widget_areas(){
     610         
     611        $widget_block = get_option("widget_block") != false ? get_option("widget_block") : array();
     612        $used_ids = array();
     613        global $wpdb;
     614        $table_name = "{$wpdb->prefix}sform_shortcodes";
     615       
     616        if ( !empty($widget_block) ) {
     617          foreach ($widget_block as $key => $value ) {
     618            if ( is_array($value) ) {   
     619               $string = implode('',$value);
     620               
     621               if ( strpos($string, 'wp:simpleform/form-selector' ) !== false ) {
     622                 $split_display = ! empty($string) ? explode('formDisplay":', $string) : '';
     623                 $formDisplay = isset($split_display[1]) ? explode(',"', $split_display[1])[0] : '';
     624                 $split_id = ! empty($string) ? explode('formId":"', $string) : '';
     625                 $id = isset($split_id[1]) ? explode('"', $split_id[1])[0] : '';
     626                 // Remove blocks that cannot be displayed or blocks containing a form already used         
     627                 if ( $formDisplay == 'false' || in_array($id, $used_ids) ) {
     628                  unset($widget_block[$key]);
     629                  update_option('widget_block', $widget_block);
     630                  break;
     631                 }
     632                 else {
     633                  if ( !empty($id)) {                             
     634                  $used_ids[] = $id;
     635                  $widget_id = 'block-'.$key;
     636                  $array_widget_id = array($widget_id);
     637                  $widget_ids = $wpdb->get_var( "SELECT widget_id FROM $table_name WHERE id = {$id}" );
     638                  $ids = ! empty($widget_ids) ? explode(',',$widget_ids) : array();
     639                  if ( ! in_array($widget_id,$ids) ) {
     640                  $new_ids = implode(",", array_unique(array_merge($array_widget_id,$ids)));
     641                  $wpdb->update($table_name, array('widget_id' => $new_ids), array('id' => $id ));
     642                  }
     643                  // Remove widget id from the list where not used
     644                  $widget_ids_list = $wpdb->get_results( "SELECT id, widget_id FROM $table_name WHERE id != {$id}", 'ARRAY_A' );
     645                  foreach($widget_ids_list as $list) {
     646                      $form_id = $list['id'];
     647                      $form_widget_ids = ! empty($list['widget_id']) ? explode(',',$list['widget_id']) : array();
     648                     if ( in_array($widget_id,$form_widget_ids) ) {
     649                     $new_ids = implode(",", array_diff($form_widget_ids,$array_widget_id));
     650                     $wpdb->update($table_name, array('widget_id' => $new_ids), array('id' => $form_id ));
     651                     }
     652                  }
     653                  }
     654                  else {
     655                    // Remove blocks where form id has not been selected
     656                    unset($widget_block[$key]);
     657                    update_option('widget_block', $widget_block);
     658                 }
     659
     660                 }
     661               }
     662
     663               if ( ( strpos($string,'wp:shortcode') && strpos($string,'[simpleform') ) !== false ) {
     664                 $split_shortcode = ! empty($string) ? explode('[simpleform', $string) : '';
     665                 $split_id = isset($split_shortcode[1]) ? explode(']', $split_shortcode[1])[0] : '';
     666                 $id = empty($split_id) ? '1' : filter_var($split_id, FILTER_SANITIZE_NUMBER_INT);
     667                 $util = new SimpleForm_Util();
     668                 $form_ids = $util->sform_ids();
     669                 // Remove blocks containing a form already used or containing an inesistent form id         
     670                 if (in_array($id, $used_ids) || ! in_array($id, $form_ids) ) {                     
     671                  unset($widget_block[$key]);
     672                  update_option('widget_block', $widget_block);
     673                  break;
     674                 }
     675                 else {                             
     676                  if ($id) {                             
     677                  $used_ids[] = $id;
     678                  $widget_id = 'block-'.$key;
     679                  $array_widget_id = array($widget_id);
     680                  $widget_ids = $wpdb->get_var( "SELECT widget_id FROM $table_name WHERE id = {$id}" );
     681                  $ids = ! empty($widget_ids) ? explode(',',$widget_ids) : array();
     682                  if ( ! in_array($widget_id,$ids) ) {
     683                  $new_ids = implode(",", array_unique(array_merge($array_widget_id,$ids)));
     684                  $wpdb->update($table_name, array('widget_id' => $new_ids), array('id' => $id ));
     685                  }
     686                  // Remove widget id from the list where not used
     687                  $widget_ids_list = $wpdb->get_results( "SELECT id, widget_id FROM $table_name WHERE id != {$id}", 'ARRAY_A' );
     688                  foreach($widget_ids_list as $list) {
     689                      $form_id = $list['id'];
     690                      $form_widget_ids = ! empty($list['widget_id']) ? explode(',',$list['widget_id']) : array();
     691                     if ( in_array($widget_id,$form_widget_ids) ) {
     692                     $new_ids = implode(",", array_diff($form_widget_ids,$array_widget_id));
     693                     $wpdb->update($table_name, array('widget_id' => $new_ids), array('id' => $form_id ));
     694                     }
     695                  }
     696                  }
     697                 }
     698               }
     699               
     700               // RENDER SHORTCODE BLOCK JUST INSERTED TO ALERT BEFORE UPDATE WIDGETS (transient)
     701               
     702            }
     703          }
     704        }
     705
     706     }     
     707     
     708     
     709     
     710    /**
     711     * Hide widget blocks if the form already appears in the post content.
     712     *
     713     * @since    2.0.4
     714     */
     715   
     716     public function hide_widgets( $sidebars_widgets ) {
     717     
     718       global $wpdb;
     719       $table_name = "{$wpdb->prefix}sform_shortcodes";       
     720       
     721       foreach( $sidebars_widgets as $widget_area => $widget_list ){
     722     
     723         foreach( $widget_list as $pos => $widget_id ){
     724                   
     725           $query_shortcode = "SELECT shortcode_pages FROM `$table_name` WHERE widget_id = %s";
     726           $query_block = "SELECT block_pages FROM `$table_name` WHERE widget_id = %s";
     727           $result_shortcode_pages = $wpdb->get_var( $wpdb->prepare( $query_shortcode, $widget_id ) );
     728           $result_block_pages = $wpdb->get_var( $wpdb->prepare( $query_block, $widget_id ) );
     729           $shortcode_pages = $result_shortcode_pages ? explode(',',$result_shortcode_pages) : array();
     730           $block_pages = $result_block_pages ? explode(',',$result_block_pages) : array();
     731           $form_pages = array_merge($shortcode_pages, $block_pages);
     732
     733           if ( ! empty($form_pages) && is_page($form_pages) ) {
     734 
     735             unset( $sidebars_widgets[$widget_area][$pos] );
    447736         
    448           // If the post content contains the simpleform block
    449           if($sform_block && isset($sform_block['attrs']['formId']) && ! empty($sform_block['attrs']['formId']) ){
    450             // Pages containing the block with the form
    451             $option_name = "sform_{$sform_block['attrs']['formId']}_block_pages";   
    452             $ids = get_option($option_name) != false && ! empty(get_option($option_name)) ? get_option($option_name) : array();           
    453             // Previously used form as block in the page
    454             $used_block = get_option("sform_block_{$post_id}");
    455            
    456             // If the block already existed before and the form id is changed
    457             if ( $used_block != false && ! empty($used_block) && $used_block != $sform_block['attrs']['formId'] ) {
    458                  $previous_id = array($used_block);
    459                  $clean_ids = array_diff($ids,$previous_id);
    460                  $new_ids = array_unique(array_merge($id,$clean_ids));
    461                  $all_ids = get_option("sform_block_pages") != false ? get_option("sform_block_pages") : array();
    462                  $clean_all_ids = array_diff($all_ids,$previous_id);
    463                  $new_all_ids = array_unique(array_merge($id,$clean_all_ids));
    464                  update_option($option_name, $new_ids);           
    465                  $previous_form_pages = get_option("sform_{$used_block}_block_pages");
    466                  $clean_previous_form_pages = array_diff($previous_form_pages,$id);
    467                  update_option("sform_{$used_block}_block_pages", $clean_previous_form_pages);
    468                  update_option("sform_block_pages", $new_all_ids);             
    469                  update_option("sform_block_{$post_id}", $sform_block['attrs']['formId']);
    470             }
    471            
    472             else {
    473               // If the block did not exist yet
    474                   $new_ids = array_unique(array_merge($id,$ids));
    475                   $all_ids = get_option("sform_block_pages") != false ? get_option("sform_block_pages") : array();
    476                   $new_all_ids = array_unique(array_merge($id,$all_ids));
    477                   update_option($option_name, $new_ids);           
    478                   update_option("sform_block_pages", $new_all_ids);             
    479                   update_option("sform_block_{$post_id}", $sform_block['attrs']['formId']);
    480             }
    481 
    482             break; // Exit from loop when found and option are updated
    483           }
    484          
    485           // If the post content does not contain the simpleform block
    486           else {
    487             $option_to_search = "sform_block_{$post_id}";
    488             $form_id = get_option($option_to_search);
    489             if ( $form_id != false && ! empty($form_id) ) {
    490                $option_name = "sform_{$form_id}_block_pages";
    491                $ids = get_option($option_name) != false && ! empty(get_option($option_name)) ? get_option($option_name) : array();
    492                $id = array($post_id);
    493                $new_ids = array_diff($ids,$id);
    494                update_option($option_name, $new_ids);
    495                $all_ids = get_option("sform_block_pages") != false ? get_option("sform_block_pages") : array();
    496                $new_all_ids = array_diff($all_ids,$id);
    497                update_option("sform_block_pages", $new_all_ids);
    498                delete_option($option_to_search);
    499                if ( strpos($post->post_content,'[simpleform') === false ) {
    500                 // Update the pages lists where the widget is shown
    501                 $sform_widget = get_option('widget_sform_widget');
    502                 unset($sform_widget['_multiwidget']);
    503                 foreach ( $sform_widget as $widget_id => $value ) {
    504                   // Create an array of hidden pages and exclude post id if exists
    505                   $hidden_pages = ! empty($value['sform_widget_hidden_pages']) ? explode(',',$value['sform_widget_hidden_pages']) : array();
    506                   $updated_hidden_pages = array_diff($hidden_pages,$id);
    507                   // Turn it as string and update the hidden pages list
    508                   $new_hidden_pages = implode(",", $updated_hidden_pages);
    509                   $sform_widget[$widget_id]['sform_widget_hidden_pages'] = $new_hidden_pages;
    510                   update_option('widget_sform_widget', $sform_widget);
    511                 }
    512                }
    513             }
    514           }
    515          
    516         }
    517       }
    518 
    519       // If the post content does not contain any block   
    520       else {
    521         $option_to_search = "sform_block_{$post_id}";
    522         // Previously used form as block in the page
    523         $used_block = get_option("sform_block_{$post_id}");
    524         // If a block existed before
    525         if ( $used_block != false && ! empty($used_block) ) {
    526           // Update the pages list containing the block with the form
    527           $option_name = "sform_{$used_block}_block_pages";
    528           $ids = get_option($option_name) != false && ! empty(get_option($option_name)) ? get_option($option_name) : array();
    529           $id = array($post_id);
    530           $new_ids = array_diff($ids,$id);
    531           update_option($option_name, $new_ids);
    532           $all_ids = get_option("sform_block_pages") != false ? get_option("sform_block_pages") : array();
    533           $new_all_ids = array_diff($all_ids,$id);
    534           update_option("sform_block_pages", $new_all_ids);
    535           delete_option($option_to_search);
    536         }
    537         if ( strpos($post->post_content,'[simpleform') === false ) {
    538          // Update the pages lists where the widget is shown
    539          $sform_widget = get_option('widget_sform_widget');
    540          if ( $sform_widget != false ) { 
    541          unset($sform_widget['_multiwidget']);
    542          foreach ( $sform_widget as $widget_id => $value ) {
    543            // Create an array of hidden pages and exclude post id if exists
    544            $hidden_pages = ! empty($value['sform_widget_hidden_pages']) ? explode(',',$value['sform_widget_hidden_pages']) : array();
    545            $id = array($post_id);
    546            $updated_hidden_pages = array_diff($hidden_pages,$id);
    547            // Turn it as string and update the hidden pages list
    548            $new_hidden_pages = implode(",", $updated_hidden_pages);
    549            $sform_widget[$widget_id]['sform_widget_hidden_pages'] = $new_hidden_pages;
    550            update_option('widget_sform_widget', $sform_widget);
    551          }
    552          }
    553         }   
    554       }
    555          
    556     }
    557 
     737           }
     738     
     739         }
     740       }
     741
     742       return $sidebars_widgets;
     743       
     744     }
     745             
    558746}
    559747
  • simpleform/trunk/admin/class-utilities.php

    r2553077 r2581779  
    3232    /**
    3333     * Search all used shortcodes in the post content
    34      *
     34     * Used in: class-admin.php:1256
    3535     * @since    2.0.2
    3636     */
     
    5454         if ( $shortcode == '[simpleform' ) {
    5555             $form_id = '1';
    56          } else {
     56         }
     57         else {
    5758             $form_id = strpos($shortcode, 'id') !== false && isset(explode('id', $shortcode)[1]) && trim(str_replace(array( '=', '"' ), '', explode('id', $shortcode)[1])) != '' ? str_replace(array( '=', '"' ), '', explode('id', $shortcode)[1]) : '';
    5859         }
     
    7172     * @since    2.0.2
    7273     */
     74   
     75    public static function form_pages($form_id) {
     76       
     77       $id = explode(':',$form_id)[0];
     78       $type = isset(explode(':',$form_id)[1]) ? explode(':',$form_id)[1] : '';
     79       $where = ! empty($type) && $type == 'widget' ? 'widget = %d' : 'id = %d';
     80       global $wpdb;
     81       $table_name = "{$wpdb->prefix}sform_shortcodes";
     82       $query_shortcode = "SELECT shortcode_pages FROM `$table_name` WHERE $where";
     83       $result_shortcode_pages = $wpdb->get_var( $wpdb->prepare( $query_shortcode, $id ) );
     84       $query_block = "SELECT block_pages FROM `$table_name` WHERE $where";
     85       $result_block_pages = $wpdb->get_var( $wpdb->prepare( $query_block, $id ) );
     86       $shortcode_pages = $result_shortcode_pages ? explode(',',$result_shortcode_pages) : array();
     87       $block_pages = $result_block_pages ? explode(',',$result_block_pages) : array();
     88       $form_pages = array_merge($shortcode_pages, $block_pages);
     89             
     90       return $form_pages;
     91 
     92    }
     93       
     94    /**
     95     * Get widget area name
     96     *
     97     * @since    2.0.2
     98     */
    7399
    74     public static function shortcode_pages() {
    75        
    76        global $wpdb;
    77        $table_post = $wpdb->prefix . 'posts';
    78        $shortcode = '%[simpleform%';
    79        $sql = $wpdb->prepare("SELECT ID FROM $table_post WHERE post_content LIKE %s AND post_type != 'attachment' AND post_type != 'revision' AND post_status != 'trash' AND post_title != ''", $shortcode);
    80        $shortcode_pages = $wpdb->get_col($sql);
    81        update_option('sform_shortcode_pages', $shortcode_pages);
    82              
    83        return $shortcode_pages;
     100    public static function widget_area_name($key) {
     101       
     102       $widget_area = '';
     103       $sidebars_widgets = get_option('sidebars_widgets');
     104       global $wp_registered_sidebars;
     105
     106       foreach ( $sidebars_widgets as $sidebar => $widgets ) {
     107         if ( is_array( $widgets ) ) {
     108            $search = 'block-'.$key;
     109            if ( in_array($search, $widgets) ) {
     110                 $widget_area = isset($wp_registered_sidebars[$sidebar]['name']) ? $wp_registered_sidebars[$sidebar]['name'] : '';
     111            }
     112         }
     113       }
     114
     115       return $widget_area;
    84116 
    85     }   
     117    }
    86118
    87119}
  • simpleform/trunk/admin/class-widget.php

    r2568608 r2581779  
    2222        add_action('delete_widget', array($this, 'cleanup_sform_shortcodes'), 10, 3 );     
    2323        add_filter('get_sform_shortcode_id', array($this, 'get_sform_shortcode_id') );
    24         add_filter( 'widget_types_to_hide_from_legacy_widget_block',  array( $this, 'hide_sform_widget' ));
     24        add_filter( 'widget_types_to_hide_from_legacy_widget_block', array( $this, 'hide_sform_widget' ));
    2525
    2626    }
    27 
    28     /**
    29      * Hide the simpleform widget from the "select widget" dropdown and from the block inserter.
    30      * Eencourages users to use the block that replaces the widget.
    31      *
    32      * @since    2.0.3
    33      */
    34    
    35     public function hide_sform_widget( $widget_types ) {
    36      
    37        $widget_types[] = 'sform_widget';
    38        return $widget_types;
    39    
    40     }
    4127   
    4228    /**
     
    5440        $widget_id = ! empty( $instance['sform_widget_id'] ) ? $instance['sform_widget_id'] : '';
    5541        $class   = ! empty( $instance['sform_widget_class'] ) ? $instance['sform_widget_class'] : '';
    56         $sform_widget_all = get_option('sform_widget_all');
    57         $sform_widget_out = get_option('sform_widget_out');
    58         $sform_widget_in = get_option('sform_widget_in');
    59         $sform_widget = get_option('widget_sform_widget');
    60         unset($sform_widget['_multiwidget']);
    61         $noempty_values = wp_list_pluck( $sform_widget, 'sform_widget_audience' );
    62         $values = array_count_values($noempty_values);     
    63         $all = !empty($values['all']) ? $values['all'] : '0';
    64         $out = !empty($values['out']) ? $values['out'] : '0';
    65         $in = !empty($values['in']) ? $values['in'] : '0';
    66         $roles =array();
    67         if (!empty($sform_widget_in)) {
    68           foreach ( $sform_widget_in as $cod ) {
    69             $role_value = explode("-", $cod)[1]; 
    70             array_push($roles,$role_value);
    71           }
    72         }
    73         $role_values = array_count_values($roles);
    74 
    75         $widget_alert = '';
    76         $alert = '';
    77         // If there's more than 1, prioritize first widget visible to all
    78         if ( $audience == 'all' && ( $all > '1' || $in != '0' || $out != '0' ) ) { $widget_alert = 'true'; }
    79         // If there's more than 1, prioritize first widget visible to all or first visible to anonymous users
    80         if ( $audience == 'out' && ( $out > '1' || $all != '0' ) ) { $widget_alert = 'true'; }
    81         // If there's more than 1, prioritize first widget visible to all or first visible to all logged-in users or first visible to logged-in users with the same role
    82         if ( $audience == 'in' && ( $in > '1' && !empty($role_values[$role]) && $role_values[$role] > '1' || $all != '0' || $in > '1' && !empty($role_values['any']) && $role_values['any'] != '0' ) ) { $widget_alert = 'true'; }
     42        $visibility = ! empty( $instance['sform_widget_visibility'] ) ? $instance['sform_widget_visibility'] : 'all';
     43        $hidden_pages = ! empty( $instance['sform_widget_hidden_pages'] ) ? $instance['sform_widget_hidden_pages'] : '';       
     44        $visible_pages = ! empty( $instance['sform_widget_visible_pages'] ) ? $instance['sform_widget_visible_pages'] : '';
     45        $id = is_int($this->number) ? $this->number : '0';       
     46        $util = new SimpleForm_Util();
     47        $placeholder = $id . ':widget';     
     48        $pages = $util->form_pages($placeholder);
     49        $hidden_pages_array = ! empty($hidden_pages) ? explode(',',$hidden_pages) : array();
     50        $visible_pages_array = ! empty($visible_pages) ? explode(',',$visible_pages) : array();
     51        $pages_list = '';
     52        $counter = 0;
    8353       
    84         if ( !empty($widget_alert) ) {
    85            $alert = '<div>' . __( 'You may only display one widget per page to make it work properly. Please check the settings before using!', 'simpleform' ) . '</div>';
    86            echo '<script type="text/javascript">var notice = document.getElementsByClassName("widget-alert"); for (var i = 0; i < notice.length; i++) { notice[i].innerHTML = "' .$alert . '"; } var removeButton = document.getElementsByClassName("widget-control-remove"); for (var x = 0; x < removeButton.length; x++) { removeButton[x].onclick = function() { for (var i = 0; i < notice.length; i++) { notice[i].innerHTML = ""; } } }</script>';
    87         }
     54        switch ($visibility) {
     55          case 'all':
     56          if ( ! empty($pages) ) { $total = count($pages); foreach ( $pages as $page ) { ++$counter; $separator = $counter < $total ? ',' : '' ; $pages_list .= '<a href="' . get_page_link($page) . '" target="_blank" style="text-decoration: none; color:#b12938;">'. $page .'</a>' . $separator; } }
     57          break;
     58          case 'visible':
     59          if ( ! empty($pages) && ! empty(array_intersect($pages, $visible_pages_array) ) ) { $total = count(array_intersect($pages, $visible_pages_array)); foreach ( array_intersect($pages, $visible_pages_array) as $page ) { ++$counter; $separator = $counter < $total ? ',' : '' ; $pages_list .= '<a href="' . get_page_link($page) . '" target="_blank" style="text-decoration: none; color:#b12938;">'. $page .'</a>' . $separator; } }
     60          break; 
     61          case 'hidden':
     62          if ( ! empty($pages) ) { foreach ( $pages as $page ) { if ( ! in_array($page,$hidden_pages_array) ) { ++$counter; $pages_list .= '<a href="' . get_page_link($page) . '" target="_blank" style="text-decoration: none; color:#b12938;">'. $page .'</a>,'; } } $total = $counter; if (!empty($pages_list)) { $pages_list = substr($pages_list, 0, -1); } }
     63        }
     64           
     65        if ( ! empty($pages_list) )  { 
     66           $alert = '<div>' . _n( 'The widget cannot be displayed on this page', 'The widget cannot be displayed on these pages', $total, 'simpleform' ) . ': ' . $pages_list . '<br>' . __( 'You may display the form only once to make it work properly.', 'simpleform' ) . '</div>';
     67        }
    8868        else {
    89            echo '<script type="text/javascript">var notice = document.getElementsByClassName("widget-alert"); for (var i = 0; i < notice.length; i++) { notice[i].innerHTML = ""; } </script>';
    90         } 
    91        
     69           $alert = '';         
     70        }
     71
    9272        echo '<div class="widget-alert">'.$alert.'</div>';
    93         ?>
     73        ?>
    9474                       
    9575        <p><label for="<?php echo $this->get_field_id( 'sform_widget_title' ); ?>"><?php _e( 'Title:', 'simpleform' ); ?></label><input type="text" name="<?php echo $this->get_field_name( 'sform_widget_title' ); ?>" id="<?php echo $this->get_field_id('sform_widget_title') ?>" class="widefat" value="<?php echo esc_attr( $title ); ?>"></p>
     
    10484        $widget_options = ! empty( $settings['widget'] ) ? esc_attr($settings['widget']) : 'true';
    10585        if ( $widget_options == 'true' ) {
    106         $pages = '';   
    107         $util = new SimpleForm_Util();     
    108         $shortcode_pages = get_option('sform_shortcode_pages'); // distinction should be made between users role! Ex: sform_shortcode_pages_ROLE. Get target col info!
    109         if ( empty($shortcode_pages) ) { $shortcode_pages = $util->shortcode_pages(); }
    110         $extra_ids = array();       
    111         if( has_filter('sform_block_pages') ) {
    112         $pages_id = array_merge($shortcode_pages, apply_filters( 'sform_block_pages', $id = 0, $extra_ids ));
    113         }
    114         else {
    115         $pages_id = $shortcode_pages;
    116         }
    117         if ( $pages_id ) {
    118           $counter = 0;
    119           $total = count($pages_id);   
    120           foreach ($pages_id as $page) {
    121            ++$counter;
    122            $separator = $counter < $total ? ',' : '' ;
    123            $pages .= $page . $separator;
    124           }
    125         }
    126        
    127         $visibility = ! empty( $instance['sform_widget_visibility'] ) ? $instance['sform_widget_visibility'] : 'all';
    128         $hidden_pages = ! empty( $instance['sform_widget_hidden_pages'] ) ? $instance['sform_widget_hidden_pages'] : $pages;       
    129         $visible_pages = ! empty( $instance['sform_widget_visible_pages'] ) ? $instance['sform_widget_visible_pages'] : '';
    13086        ?>   
    13187       
     
    193149        $instance['sform_widget_role'] = $instance['sform_widget_audience'] == 'in' && isset($new_instance['sform_widget_role']) && in_array($new_instance['sform_widget_role'], $role_values) ? $new_instance['sform_widget_role'] : 'any';
    194150
    195         $widget_id = array($this->number);
    196         $widget_cod_value = $this->number . '-'. $instance['sform_widget_role'];
    197         $widget_cod = array($this->number . '-'. $instance['sform_widget_role']);
    198         $needle = is_int($this->number) ? $this->number .'-' : '*';
    199         $sform_widget_all = get_option('sform_widget_all') != false && ! empty(get_option('sform_widget_all')) ? get_option('sform_widget_all') : array();
    200         $sform_widget_out = get_option('sform_widget_out') != false && ! empty(get_option('sform_widget_out')) ? get_option('sform_widget_out') : array();
    201         $sform_widget_in = get_option('sform_widget_in') != false && ! empty(get_option('sform_widget_in')) ? get_option('sform_widget_in') : array();
    202        
    203         if ( $instance['sform_widget_audience'] == 'all' ) {
    204           $new_sform_widget_all = array_unique(array_merge($sform_widget_all,$widget_id));
    205           update_option('sform_widget_all', $new_sform_widget_all);
    206           $new_sform_widget_out = array_diff($sform_widget_out,$widget_id);
    207           update_option('sform_widget_out', $new_sform_widget_out);
    208           if ( !empty($sform_widget_in) ) {
    209            foreach($sform_widget_in as $key => $value ) {
    210             if( strpos($value, $needle) !== false )
    211             unset($sform_widget_in[$key]);
    212             update_option('sform_widget_in', $sform_widget_in);
    213            }
    214           }         
    215         }
    216         elseif ( $instance['sform_widget_audience'] == 'out' ) {
    217           $new_sform_widget_out = array_unique(array_merge($sform_widget_out,$widget_id));
    218           update_option('sform_widget_out', $new_sform_widget_out);
    219           $new_sform_widget_all = array_diff($sform_widget_all,$widget_id);
    220           update_option('sform_widget_all', $new_sform_widget_all);
    221           if ( !empty($sform_widget_in) ) {
    222            foreach($sform_widget_in as $key => $value ) {
    223             if( strpos($value, $needle) !== false )
    224             unset($sform_widget_in[$key]);
    225             update_option('sform_widget_in', $sform_widget_in);
    226            }
    227           }         
    228         }
    229         else {
    230           $check = '';
    231           if ( !empty($sform_widget_in) ) {
    232           foreach($sform_widget_in as $key => $value ) {
    233             if( strpos($value, $needle) !== false ) {
    234               $sform_widget_in[$key] = $widget_cod_value;
    235               $new_sform_widget_in = $sform_widget_in;
    236               $check = 'done';
    237             }
    238           }   
    239           }   
    240          if ( $check == '' ) {
    241               $new_sform_widget_in = array_unique(array_merge($sform_widget_in,$widget_cod));         
    242           }
    243           update_option('sform_widget_in', $new_sform_widget_in);
    244           $new_sform_widget_all = array_diff($sform_widget_all,$widget_id);
    245           update_option('sform_widget_all', $new_sform_widget_all);
    246           $new_sform_widget_out = array_diff($sform_widget_out,$widget_id);
    247           update_option('sform_widget_out', $new_sform_widget_out);
    248          
    249           $sform_widget = get_option('widget_sform_widget');
    250           unset($sform_widget['_multiwidget']);
    251           $noempty_values = wp_list_pluck( $sform_widget, 'sform_widget_role' );
    252           $values = array_count_values($noempty_values);               
    253         }   
    254 
    255151        global $wpdb;
    256152        $table_name = $wpdb->prefix . 'sform_shortcodes';
     
    269165        if ( $widget_options == 'true' ) {
    270166        $instance['sform_widget_visibility'] = isset($new_instance['sform_widget_visibility']) && in_array($new_instance['sform_widget_visibility'], array('all', 'hidden', 'visible')) ? $new_instance['sform_widget_visibility'] : 'all';
    271 
    272         $shortcode_pages = get_option( 'sform_shortcode_pages' );
    273         $extra_ids = array();       
    274         if( has_filter('sform_block_pages') ) {
    275         $pages_id = array_merge($shortcode_pages, apply_filters( 'sform_block_pages', $id = 0, $extra_ids ));
    276         }
    277         else {
    278         $pages_id = $shortcode_pages;
    279         }
    280 
     167       
    281168        $checked_hidden_pages = preg_match('/^[0-9, ]+$/', $new_instance['sform_widget_hidden_pages']) ? str_replace(' ', '', $new_instance['sform_widget_hidden_pages']) : '';
    282169        if ( ! empty($checked_hidden_pages) ) {   
     
    284171        $hidden_pages_array = explode(',',$checked_hidden_pages);
    285172          foreach ($hidden_pages_array as $key => $post) {
    286             if ( empty($post) || empty(get_the_title($post)) ) {
     173            if ( empty($post) || get_post_status($post) === FALSE ) {
    287174            unset($hidden_pages_array[$key]);
    288175            }
    289176          }
    290         // Include all pages in whose content there's the shortcode
    291         $instance_hidden_pages = ! empty($hidden_pages_array) ? implode(",", array_unique(array_merge($hidden_pages_array,$pages_id))) : '';
    292         }
     177        $instance_hidden_pages = ! empty($hidden_pages_array) ? implode(",", array_unique($hidden_pages_array)) : '';
     178       }
    293179        else {
    294180        $instance_hidden_pages = '';
    295181        }
     182       
    296183        $instance['sform_widget_hidden_pages'] = $instance_hidden_pages;
    297184       
     
    301188        $visible_pages_array = explode(',',$checked_visible_pages);
    302189        foreach ($visible_pages_array as $key => $post) {
    303           // Exclude all pages in whose content there's the shortcode
    304           if ( empty($post) || empty(get_the_title($post)) || in_array($post,$pages_id) ) {
     190          if ( empty($post) || get_post_status($post) === FALSE ) {
    305191            unset($visible_pages_array[$key]);
    306192            }
     
    336222        $class = isset( $instance['sform_widget_class'] ) ? $instance['sform_widget_class'] : '';
    337223        $shortcode_id = isset( $instance['shortcode_id'] ) ? $instance['shortcode_id'] : '';
     224        global $wpdb;
     225        $table_name = "{$wpdb->prefix}sform_shortcodes";
    338226       
    339227        if ( empty($shortcode_id) ) {
    340228        $widget_id = $this->number;
    341         global $wpdb;
    342         $table_name = $wpdb->prefix . 'sform_shortcodes';
    343229        $sql = "SELECT id FROM `$table_name` WHERE widget = %s";
    344230        $shortcode_id = $wpdb->get_var( $wpdb->prepare( $sql, $widget_id ) );
     
    349235        global $post;
    350236
    351        if ( ( current_user_can('manage_options') && $admin_limits != 'true' && $widget_audience == 'out' && is_user_logged_in() ) || ( !current_user_can('manage_options') && $widget_audience == 'out' && is_user_logged_in() ) || ( $widget_audience == 'in' && ! is_user_logged_in() ) )
    352        return;
    353        
    354        $current_user = wp_get_current_user();
    355        if ( ( current_user_can('manage_options') && $admin_limits != 'true' || !current_user_can('manage_options') ) && $widget_audience != 'all' && $role != 'any' && ! in_array( $role, (array) $current_user->roles ) )
    356        return;
    357 
    358        if ( $widget_options == 'true' ) {
     237        if ( ( current_user_can('manage_options') && $admin_limits != 'true' && $widget_audience == 'out' && is_user_logged_in() ) || ( !current_user_can('manage_options') && $widget_audience == 'out' && is_user_logged_in() ) || ( $widget_audience == 'in' && ! is_user_logged_in() ) )
     238        return;
     239       
     240        $current_user = wp_get_current_user();
     241        if ( ( current_user_can('manage_options') && $admin_limits != 'true' || !current_user_can('manage_options') ) && $widget_audience != 'all' && $role != 'any' && ! in_array( $role, (array) $current_user->roles ) )
     242        return;
     243
     244        if ( $widget_options == 'true' ) {
     245           
    359246        $widget_visibility = isset( $instance['sform_widget_visibility']) ? $instance['sform_widget_visibility'] : 'all';         
     247        $hidden_pages = isset( $instance['sform_widget_hidden_pages'] ) ? explode(',',$instance['sform_widget_hidden_pages']) : array();       
     248        $visible_pages = isset( $instance['sform_widget_visible_pages'] ) ? explode(',',$instance['sform_widget_visible_pages']) : array();
     249
    360250        $util = new SimpleForm_Util();     
    361         $shortcode_pages = get_option('sform_shortcode_pages'); // distinction should be made between users role! Ex: sform_shortcode_pages_ROLE. Get target col info!
    362         if ( empty($shortcode_pages) ) { $shortcode_pages = $util->shortcode_pages(); }
    363         $extra_ids = array();
    364         if( has_filter('sform_block_pages') ) {
    365         $pages_id = array_merge($shortcode_pages, apply_filters( 'sform_block_pages', $id = 0, $extra_ids ));
     251        $pages = $util->form_pages($shortcode_id);
     252       
     253        If ( ! empty($pages) ) {
     254           if ( is_admin() || ( $widget_visibility == 'all' && in_array($post->ID,$pages) ) || ( $widget_visibility == 'hidden' && in_array($post->ID,$pages) && ! in_array($post->ID,$hidden_pages) ) || ( $widget_visibility == 'visible' && in_array($post->ID,$pages) && in_array($post->ID,$visible_pages) ) )
     255           return;
    366256        }
    367257        else {
    368         $pages_id = $shortcode_pages;
    369         }
    370        
    371         $hidden_pages = isset( $instance['sform_widget_hidden_pages'] ) ? explode(',',$instance['sform_widget_hidden_pages']) : $pages_id;       
    372         $visible_pages = isset( $instance['sform_widget_visible_pages'] ) ? explode(',',$instance['sform_widget_visible_pages']) : array();
    373  
    374         if ( is_admin() || ( $widget_visibility == 'hidden' && in_array($post->ID,$hidden_pages) ) || ( $widget_visibility == 'visible' && ! in_array($post->ID,$visible_pages) ) || ( $widget_visibility == 'all' && in_array($post->ID,$pages_id) ) )
    375         return;
     258           if ( is_admin() || ( $widget_visibility == 'hidden' && in_array($post->ID,$hidden_pages) ) || ( $widget_visibility == 'visible' && ! in_array($post->ID,$visible_pages) ) )
     259           return;
     260        }
     261               
    376262       }
    377        
    378        $sform_widget_all = get_option('sform_widget_all');
    379        $sform_widget_out = get_option('sform_widget_out');
    380        $sform_widget_in = get_option('sform_widget_in');
    381        $sform_widget = get_option('widget_sform_widget');
    382        unset($sform_widget['_multiwidget']);
    383        $noempty_values = wp_list_pluck( $sform_widget, 'sform_widget_audience' );
    384        $values = array_count_values($noempty_values);     
    385        $all = !empty($values['all']) ? $values['all'] : '0';
    386        $out = !empty($values['out']) ? $values['out'] : '0';
    387        $in = !empty($values['in']) ? $values['in'] : '0';
    388        $roles =array();
    389        if (!empty($sform_widget_in)) {
    390           foreach ( $sform_widget_in as $cod ) {
    391             $role_value = explode("-", $cod)[1]; 
    392             array_push($roles,$role_value);
    393           }
    394        }
    395        $role_values = array_count_values($roles);
    396 
    397        // Prioritize first widget visible to all
    398        if ( $widget_audience == 'all' && array_values($sform_widget_all)[0] != $this->number )
    399        return;
    400        // Prioritize first widget visible to anonymous users or first visible to all
    401        if ( $widget_audience == 'out' && ( array_values($sform_widget_out)[0] != $this->number || ( array_values($sform_widget_out)[0] == $this->number && $all != '0' ) ) )
    402        return;
    403        // Prioritize first widget visible to logged-in users with any role or first visible to all     
    404        if ( $widget_audience == 'in' && ( ( $role != 'any' && !empty($role_values['any']) && $role_values['any'] != '0' ) || ( array_values($sform_widget_in)[0] != $this->number && $role_values[$role] > '1'  ) || $all != '0' ) )
    405        return;
    406263       
    407264       echo $args['before_widget'] . '<div id="'.$id.'" class="sforms-widget '.$class.'">';
     
    412269       
    413270       echo do_shortcode( $shortcode );
     271       
    414272       echo '</div>' . $args['after_widget'];
    415273       
     
    461319                 $id =  explode("sform_widget-", $widget_id)[1];
    462320                 global $wp_registered_sidebars;
    463                  // $widget_area = $wp_registered_sidebars[$sidebar]['name'];
    464321                 $widget_area = isset($wp_registered_sidebars[$sidebar]['name']) ? $wp_registered_sidebars[$sidebar]['name'] : '';               
    465322                 global $wpdb;
     
    490347                    $sform_widget[$id]['shortcode_id'] = $shortcode_id;
    491348                    update_option('widget_sform_widget', $sform_widget);
    492                     // $form_attributes = get_option("sform_{$shortcode}_attributes");
    493                     // if ( $form_attributes != false ) {
    494349                    $default_attributes = get_option("sform_attributes");                   
    495350                    $default_attributes['form_name'] = $form_name;
    496351                    add_option("sform_{$shortcode_id}_attributes", $default_attributes);
    497                     // }
    498                     // else {
    499                     // $form_attributes['form_name'] = $form_name;
    500                     // update_option("sform_{$shortcode}_attributes", $form_attributes);
    501                     // update_option("sform_{$shortcode_id}_attributes", $form_attributes);
    502                     // }
     352                    $default_settings = get_option("sform_settings");                   
     353                    add_option("sform_{$shortcode_id}_settings", $default_settings);
    503354                 }
    504355                 else {
     
    509360                    }                   
    510361                 }
    511                  
    512                  $sform_widget = get_option('widget_sform_widget');
    513                  unset($sform_widget['_multiwidget']);
    514                  $target_values = array_count_values(wp_list_pluck( $sform_widget, 'sform_widget_audience' ));
    515                  $all = ! empty($target_values['all']) ? $target_values['all'] : 0;
    516                  $out = ! empty($target_values['out']) ? $target_values['out'] : 0;
    517                  $in = ! empty($target_values['in']) ? $target_values['in'] : 0;
    518                  $val = $all.';'.$out.';'.$in;
    519                  update_option('widget_sform_target', $val);
    520                  
    521362            }
    522363          }
     
    529370   
    530371    /**
    531      * Delete the shortcode after a widget has been marked for deletion and cleanup the widget option
     372     * Delete the shortcode after a widget has been marked for deletion and update the widget option
    532373     *
    533374     * @since    1.10
     
    544385         $wpdb->delete($table_name, array('widget' => $id ));
    545386         $table_submissions = "{$wpdb->prefix}sform_submissions";
    546          $wpdb->update($table_submissions, array('form' => '1'), array( 'form' => $form_id));       
    547          $option = 'sform_'.$form_id.'_attributes';
    548          $attributes_option = get_option($option);
    549          if ( $attributes_option != false ) { $wpdb->query( $wpdb->prepare("DELETE FROM {$wpdb->options} WHERE option_name = '%s'", $option) ); }
    550          $sform_widget = get_option('widget_sform_widget');
     387         // Use a new option to ask if the submissions should be saved and should be included in the main form or deleted
     388         $wpdb->update($table_submissions, array('form' => '1'), array( 'form' => $form_id));
     389         $attributes_option = 'sform_'.$form_id.'_attributes';
     390         $attributes = get_option($attributes_option);
     391         if ( $attributes != false ) { $wpdb->query( $wpdb->prepare("DELETE FROM {$wpdb->options} WHERE option_name = '%s'", $attributes_option) ); }
     392         $settings_option = 'sform_'.$form_id.'_settings';
     393         $settings = get_option('sform_'.$form_id.'_settings');
     394         if ( $settings != false ) { $wpdb->query( $wpdb->prepare("DELETE FROM {$wpdb->options} WHERE option_name = '%s'", $settings_option) ); }
    551395         
    552          if ( $sform_widget[$id]['sform_widget_audience'] == 'all' ) {
    553           $sform_widget_all = get_option('sform_widget_all') != false && ! empty(get_option('sform_widget_all')) ? get_option('sform_widget_all') : array();
    554           $new_sform_widget_all = array_diff($sform_widget_all,array($id));
    555           update_option('sform_widget_all', $new_sform_widget_all);
    556          }
    557          if ( $sform_widget[$id]['sform_widget_audience'] == 'out' ) {
    558           $sform_widget_out = get_option('sform_widget_out') != false && ! empty(get_option('sform_widget_out')) ? get_option('sform_widget_out') : array();
    559           $new_sform_widget_out = array_diff($sform_widget_out,array($id));
    560           update_option('sform_widget_out', $new_sform_widget_out);
    561          }
    562          if ( $sform_widget[$id]['sform_widget_audience'] == 'in' ) {
    563           $sform_widget_in = get_option('sform_widget_in') != false && ! empty(get_option('sform_widget_in')) ? get_option('sform_widget_in') : array();
    564            $needle = $id .'-';
    565            foreach($sform_widget_in as $key => $value ) {
    566             if( strpos($value, $needle) !== false )
    567             unset($sform_widget_in[$key]);
    568             update_option('sform_widget_in', $sform_widget_in);
    569            }
    570          }
    571 
     396         // DELETE LAST MESSAGE TRANSIENT
     397         $sform_widget = get_option('widget_sform_widget');         
    572398         unset($sform_widget[$id]);
    573399         update_option('widget_sform_widget', $sform_widget);
    574          
    575400      }
    576401     
     
    593418
    594419    }
     420    /**
     421     * Hide the simpleform widget from the "select widget" dropdown and from the block inserter.
     422     *
     423     * @since    2.0.3
     424     */
     425   
     426    public function hide_sform_widget( $widget_types ) {
     427     
     428       $widget_types[] = 'sform_widget';
     429       
     430       return $widget_types;
     431   
     432    }
    595433           
    596434}
  • simpleform/trunk/admin/css/admin-min.css

    r2568608 r2581779  
    1 .invisible{visibility:hidden}.removed,.secret,.unseen{display:none!important}#new-release{font-size:13px!important;line-height:1;color:#bbb;padding:14px 0!important;float:left}#new-release a{color:#bbb;text-decoration:none}#new-release .update a{color:#f6866f}.wrap div.error,.wrap div.notice-success{margin:15px 0 10px}.full-width-bar{margin:0 -9999rem;padding:0 9999rem;clear:both}body,html{overflow-x:hidden}.full-width-bar>h1{margin:0}.sform.wrap>h1>div{float:right}h1.title{color:#fff;line-height:36px;font-size:22px;font-weight:500}h1.title>span{display:inline-block;padding:0 20px 0 0;position:relative;vertical-align:sub;font-size:28px;top:1px}.full-width-bar.default,h1.title.default{background-color:#2271b1!important}.full-width-bar.light,h1.title.light{background-color:#04a4cc!important}.full-width-bar.modern,h1.title.modern{background-color:#4664eb!important}.full-width-bar.blue,h1.title.blue{background-color:#e3af55!important}.full-width-bar.coffee,h1.title.coffee{background-color:#c7a589!important}.full-width-bar.ectoplasm,h1.title.ectoplasm{background-color:#a9bd4f!important}.full-width-bar.midnight,h1.title.midnight{background-color:#e35950!important}.full-width-bar.ocean,h1.title.ocean{background-color:#9ebaa0!important}.full-width-bar.sunrise,h1.title.sunrise{background-color:#dd823b!important}.full-width-bar.foggy,h1.title.foggy{background-color:#8993ab!important}.full-width-bar.polar,h1.title.polar{background-color:#fff!important;color:inherit}div.selector{display:inline-block;float:right}#wrap-selector{font-size:.6em;padding-right:10px;float:left}.form-selector{float:right;padding:0;top:0}select#form{line-height:34px;vertical-align:top}select#form.default{border-color:rgb(34 113 177 / 25%)}select#form.light{border-color:rgb(4 164 204 / 25%)}select#form.modern{border-color:rgb(56 88 233 / 25%)}select#form.blue{border-color:rgb(9 100 132 / 25%)}select#form.coffee{border-color:rgb(199 165 137 / 25%)}select#form.ectoplasm{border-color:rgb(163 183 69 / 25%)}select#form.midnight{border-color:rgb(225 77 67 / 25%)}select#form.ocean{border-color:rgb(158 186 160 / 25%)}select#form.sunrise{border-color:rgb(221 130 59 / 25%)}select#form.foggy{border-color:rgb(34 113 177 / 25%)}select#form.polar{border-color:#8993ab}select.default:focus,select.default:hover{color:#2271b1;border-color:#2271b1;box-shadow:none}select.light:focus,select.light:hover{color:#04a4cc;border-color:#04a4cc;box-shadow:none}select.modern:focus,select.modern:hover{color:#3858e9;border-color:#3858e9;box-shadow:none}select.blue:focus,select.blue:hover{color:#2271b1;border-color:#2271b1;box-shadow:none}select.coffee:focus,select.coffee:hover{color:#2271b1;border-color:#c7a589;box-shadow:none}select.ectoplasm:focus,select.ectoplasm:hover{color:#2271b1;border-color:#a3b745;box-shadow:none}select.midnight:focus,select.midnight:hover{color:#2271b1;border-color:#e14d43;box-shadow:none}select.ocean:focus,select.ocean:hover{color:#2271b1;border-color:#9ebaa0;box-shadow:none}select.sunrise:focus,select.sunrise:hover{color:#dd823b;border-color:#dcdfe6;box-shadow:none}select.foggy:focus,select.foggy:hover{color:#2271b1;border-color:#2271b1;box-shadow:none}select.polar:focus,select.polar:hover{color:#53a0de;border-color:#53a0de;box-shadow:none}#page-description{padding:10px 0}#editor-tabs,#settings-tabs{margin-left:15px;position:relative;right:0;left:0;min-height:36px;font-size:0;z-index:1;border-bottom:0}.nav-tab{padding:5px 25px;margin-left:5px;border-bottom:none!important;color:#8993ab!important;background:#dcdfe6}.nav-tab-active,.nav-tab-active:focus,.nav-tab-active:hover,.nav-tab.nav-tab-active:hover{background:#fff!important;color:#8993ab!important;border-bottom:1px solid #fff!important;margin-bottom:-1px}.nav-tab:focus,.nav-tab:hover{background-color:#8993ab;color:#fff!important;cursor:pointer}a .dashicons{line-height:26px;transition:none;-webkit-transition:none;-moz-transition:none;-o-transition:none;text-decoration:none}#editor-tabs a,#settings-tabs a{position:relative;display:inline-block;margin:0;border-bottom:0;margin-bottom:-1px;text-decoration:none;transition:none;-webkit-transition:none;-moz-transition:none;-o-transition:none}#editor-tabs a.form-button,#settings-tabs a.form-button{margin-right:0;float:right}#editor-tabs a.last,#settings-tabs a.last{margin-right:0!important}.form-button{background:#dcdfe6;color:#8993ab;border-bottom:none!important;border:1px solid #dcdfe6;line-height:25px}.form-button:focus{box-shadow:none;outline:0}.form-button>span{white-space:nowrap}.form-button>span>span.text{margin-left:5px}.form-button.default:hover{background:#f0f0f1;color:#2271b1}.form-button.light:hover{background:#f0f0f1;color:#04a4cc}.form-button.modern:hover{background:#f0f0f1;color:#3858e9}.form-button.blue:hover{background:#f0f0f1;color:#096484}.form-button.coffee:hover{background:#59524c;color:#fff}.form-button.ectoplasm:hover{background:#f0f0f1;color:#829237}.form-button.midnight:hover{background:#f0f0f1;color:#d02c21}.form-button.ocean:hover{background:#738e96;color:#fff}.form-button.sunrise:hover{background:#f0f0f1;color:#dd823b}.form-button.foggy:hover{background:#2271b1;color:#fff}.form-button.polar:hover{background:#53a0de;color:#fff}#attributes,#settings{background:#fff;padding-top:25px}.options-heading span{cursor:pointer}.options-heading span span{padding-left:10px}.toggle.dashicons{color:#dcdfe6}.dashicons-arrow-up-alt2:hover{color:#f6866f}.dashicons-arrow-down-alt2:hover{color:#9bcc79}.options-heading.closed{margin-bottom:1.85em}.icon-button{color:#dcdfe6;font-size:26px;margin:-3px 0;float:right}.icon-button.default:hover{color:#2271b1}.icon-button.light:hover{color:#04a4cc}.icon-button.modern:hover{color:#3858e9}.icon-button.blue:hover{color:#096484}.icon-button.coffee:hover{color:#59524c}.icon-button.ectoplasm:hover{color:#a3b745}.icon-button.midnight:hover{color:#e14d43}.icon-button.ocean:hover{color:#738e96}.icon-button.sunrise:hover{color:#dd823b}.icon-button.foggy:hover{color:#72aee6}.icon-button.polar:hover{color:#53a0de}.settings-page.button,.widgets-page.button{text-align:center;float:right;margin-top:15px!important;padding:0 10px;border-radius:3px;font-size:13px;font-weight:600;cursor:pointer}.section.admin.collapsed,.section.akismet.collapsed,.section.auto.collapsed,.section.custom.collapsed,.section.fields.collapsed,.section.formdescription.collapsed,.section.formfields.collapsed,.section.layout.collapsed,.section.notification.collapsed,.section.recaptcha.collapsed,.section.sending.collapsed,.section.smtp.collapsed,.section.spam.collapsed,.section.specifics.collapsed,.section.storage.collapsed,.section.style.collapsed,.section.submission.collapsed,.section.success.collapsed,.section.uninstall.collapsed{font-size:0;margin:0;opacity:0;padding:0;max-height:0;overflow:hidden;transition:max-height .3s linear,opacity .15s,font-size .15s,margin .15s,padding .15s;-webkit-transition:max-height .3s linear,opacity .15s,font-size .15s,margin .15s,padding .15s;-moz-transition:max-height .3s linear,opacity .15s,font-size .15s,margin .15s,padding .15s;-o-transition:max-height .3s linear,opacity .15s,font-size .15s,margin .15s,padding .15s}.section.admin,.section.akismet,.section.custom,.section.formdescription,.section.layout,.section.sending,.section.spam,.section.style,.section.submission,.section.success,.section.uninstall{max-height:800px;transition:max-height .5s linear,opacity 1s,font-size 1s,margin 1s,padding 1s;-webkit-transition:max-height .5s linear,opacity 1s,font-size 1s,margin 1s,padding 1s;-moz-transition:max-height .5s linear,opacity 1s,font-size 1s,margin 1s,padding 1s;-o-transition:max-height .5s linear,opacity 1s,font-size 1s,margin 1s,padding 1s}.section.auto,.section.notification,.section.recaptcha,.section.smtp,.section.specifics,.section.storage{max-height:1500px;transition:max-height 1.25s linear,opacity 1.5s,font-size 1.5s,margin 1.5s,padding 1.5s}.section.fields{max-height:3500px;transition:max-height 1.75s linear,opacity 2s,font-size 2s,margin 2s,padding 2s;-webkit-transition:max-height 1.75s linear,opacity 2s,font-size 2s,margin 2s,padding 2s;-moz-transition:max-height 1.75s linear,opacity 2s,font-size 2s,margin 2s,padding 2s;-o-transition:max-height 1.75s linear,opacity 2s,font-size 2s,margin 2s,padding 2s}.section.formfields{max-height:5500px;transition:max-height 2s linear,opacity 2.25s,font-size 2.25s,margin 2.25s,padding 2.25s;-webkit-transition:max-height 2s linear,opacity 2.25s,font-size 2.25s,margin 2.25s,padding 2.25s;-moz-transition:max-height 2s linear,opacity 2.25s,font-size 2.25s,margin 2.25s,padding 2.25s;-o-transition:max-height 2s linear,opacity 2.25s,font-size 2.25s,margin 2.25s,padding 2.25s}th>span{cursor:default}.switch-box{display:inline-table;width:100%;position:relative;height:20px;line-height:20px}.switch-input{position:relative;display:inline-block;float:left;margin-right:10px;width:40px;height:20px}.switch-input input{top:2px;left:4px;margin:0;position:absolute;opacity:0!important;width:20px;height:20px}.switch-input input:active+span{outline:0;box-shadow:none}.switch-label{display:inline-block;vertical-align:middle;width:calc(100% - 50px)}.switch-input input+span{position:absolute;z-index:1;cursor:pointer;top:0;left:0;right:0;bottom:0;background:#dcdfe6;-webkit-transition:.4s;transition:.4s;-moz-transition:.4s;-o-transition:.4s;border-radius:20px;border:2px solid #dcdfe6}.switch-input input+span:before{position:absolute;content:"";height:16px;width:16px;background-color:#fff;-webkit-transition:.4s;transition:.4s;-moz-transition:.4s;-o-transition:.4s;border-radius:50%}.switch-input input:checked+span:before{-webkit-transform:translateX(20px);-ms-transform:translateX(20px);transform:translateX(20px)}label.multiselect{position:relative;cursor:pointer;display:inline-block;padding-left:34px;line-height:24px;margin-right:10px;margin-bottom:10px}label.multiselect.last{margin-right:0}input[type=checkbox].multiselect{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.checkmark{position:absolute;cursor:pointer;top:0;left:0;height:20px;width:20px;border-radius:4px;background-color:#dcdfe6;border:2px solid #dcdfe6}.checkmark:after{left:7px;top:2px;width:4px;height:10px;border:solid #fff;border-width:0 3px 3px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);content:"";position:absolute;display:none}input[type=checkbox]:checked+.checkmark{background-color:#0d6efd;border:2px solid #0d6efd}input[type=checkbox]:checked+.checkmark:after{display:block}#columns-description.description{margin-top:-3px}form.default .switch-input input:checked+span,form.default input[type=checkbox]:checked+.checkmark{background:#2271b1;border:2px solid #2271b1}form.default .switch-input input:active+span{outline:0;box-shadow:none}form.light .switch-input input:checked+span,form.light input[type=checkbox]:checked+.checkmark{background:#04a4cc;border:2px solid #04a4cc}form.light .switch-input input:active+span{outline:0;box-shadow:none}form.modern .switch-input input:checked+span,form.modern input[type=checkbox]:checked+.checkmark{background:#3858e9;border:2px solid #3858e9}form.modern .switch-input input:active+span{outline:0;box-shadow:none}form.blue .switch-input input:checked+span,form.blue input[type=checkbox]:checked+.checkmark{background:#096484;border:2px solid #096484}form.blue .switch-input input:active+span{outline:0;box-shadow:none}form.coffee .switch-input input:checked+span,form.coffee input[type=checkbox]:checked+.checkmark{background:#c7a589;border:2px solid #c7a589}form.coffee .switch-input input:active+span{outline:0;box-shadow:none}form.ectoplasm .switch-input input:checked+span,form.ectoplasm input[type=checkbox]:checked+.checkmark{background:#a3b745;border:2px solid #a3b745}form.ectoplasm .switch-input input:active+span{outline:0;box-shadow:none}form.midnight .switch-input input:checked+span,form.midnight input[type=checkbox]:checked+.checkmark{background:#e14d43;border:2px solid #e14d43}form.midnight .switch-input input:active+span{outline:0;box-shadow:none}form.ocean .switch-input input:checked+span,form.ocean input[type=checkbox]:checked+.checkmark{background:#9ebaa0;border:2px solid #9ebaa0}form.ocean .switch-input input:active+span{outline:0;box-shadow:none}form.sunrise .switch-input input:checked+span,form.sunrise input[type=checkbox]:checked+.checkmark{background:#dd823b;border:2px solid #dd823b}form.sunrise .switch-input input:active+span{outline:0;box-shadow:none}form.foggy .switch-input input:checked+span,form.foggy input[type=checkbox]:checked+.checkmark{background:#2271b1;border:2px solid #2271b1}form.foggy .switch-input input:active+span{outline:0;box-shadow:none}form.polar .switch-input input:checked+span,form.polar input[type=checkbox]:checked+.checkmark{background:#53a0de;border:2px solid #53a0de}form.polar .switch-input input:active+span{outline:0;box-shadow:none}input[type=radio]{border:2px solid #dcdfe6;height:18px;width:18px;margin-top:-3px!important;margin-right:10px!important}form.default input[type=radio]:checked,form.foggy input[type=radio]:checked{background:#2271b1;border-color:#2271b1}form.default input[type=radio]:active,form.default input[type=radio]:focus,form.foggy input[type=radio]:active,form.foggy input[type=radio]:focus{border-color:#2271b1;outline:0;box-shadow:none}form.light input[type=radio]:active,form.light input[type=radio]:focus{border-color:#04a4cc;outline:0;box-shadow:none}form.light input[type=radio]:checked{background:#04a4cc;border-color:#04a4cc}form.modern input[type=radio]:active,form.modern input[type=radio]:focus{border-color:#3858e9;outline:0;box-shadow:none}form.modern input[type=radio]:checked{background:#3858e9;border-color:#3858e9}form.blue input[type=radio]:active,form.blue input[type=radio]:focus{border-color:#096484;outline:0;box-shadow:none}form.blue input[type=radio]:checked{background:#096484;border-color:#096484}form.coffee input[type=radio]:active,form.coffee input[type=radio]:focus{border-color:#c7a589;outline:0;box-shadow:none}form.coffee input[type=radio]:checked{background:#c7a589;border-color:#c7a589}form.ectoplasm input[type=radio]:active,form.ectoplasm input[type=radio]:focus{border-color:#a3b745;outline:0;box-shadow:none}form.ectoplasm input[type=radio]:checked{background:#a3b745;border-color:#a3b745}form.midnight input[type=radio]:active,form.midnight input[type=radio]:focus{border-color:#e14d43;outline:0;box-shadow:none}form.midnight input[type=radio]:checked{background:#e14d43;border-color:#e14d43}form.ocean input[type=radio]:active,form.ocean input[type=radio]:focus{border-color:#9ebaa0;outline:0;box-shadow:none}form.ocean input[type=radio]:checked{background:#9ebaa0;border-color:#9ebaa0}form.sunrise input[type=radio]:active,input[type=radio]:focus{border-color:#dd823b;outline:0;box-shadow:none}form.sunrise input[type=radio]:checked{background:#dd823b;border-color:#dd823b}form.polar input[type=radio]:active,form.polar input[type=radio]:focus{border-color:#53a0de;outline:0;box-shadow:none}form.polar input[type=radio]:checked{background:#53a0de;border-color:#53a0de}input[type=radio]:checked::before{background-color:#fff}.form-table td fieldset label{margin-right:20px!important}textarea{height:230px!important;width:100%;padding:10px 15px;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;background-color:#fff!important;border:2px solid #dcdfe6;font-size:14px!important;line-height:24px!important;color:#444}textarea.description{height:148px!important}textarea.labels{height:100px!important}input.sform{width:100%}input.sform[type=number]{width:90px!important;text-align:center}form.default input[type=number]:focus,form.default input[type=text]:focus,form.default select.sform:focus,form.default textarea:focus{border:2px solid #2271b1!important;border-color:#2271b1;outline:0;box-shadow:none}form.light input[type=number]:focus,form.light input[type=text]:focus,form.light select.sform:focus,form.light textarea:focus{border:2px solid #04a4cc!important;border-color:#04a4cc;outline:0;box-shadow:none}form.modern input[type=number]:focus,form.modern input[type=text]:focus,form.modern select.sform:focus,form.modern textarea:focus{border:2px solid #3858e9!important;border-color:#3858e9;outline:0;box-shadow:none}form.blue input[type=number]:focus,form.blue input[type=text]:focus,form.blue select.sform:focus,form.blue textarea:focus{border:2px solid #096484!important;border-color:#096484;outline:0;box-shadow:none}form.coffee input[type=number]:focus,form.coffee input[type=text]:focus,form.coffee select.sform:focus,form.coffee textarea:focus{border:2px solid #c7a589!important;border-color:#c7a589;outline:0;box-shadow:none}form.ectoplasm input[type=number]:focus,form.ectoplasm input[type=text]:focus,form.ectoplasm select.sform:focus,form.ectoplasm textarea:focus{border:2px solid #a3b745!important;border-color:#a3b745;outline:0;box-shadow:none}form.midnight input[type=number]:focus,form.midnight input[type=text]:focus,form.midnight select.sform:focus,form.midnight textarea:focus{border:2px solid #e14d43!important;border-color:#e14d43;outline:0;box-shadow:none}form.ocean input[type=number]:focus,form.ocean input[type=text]:focus,form.ocean select.sform:focus,form.ocean textarea:focus{border:2px solid #9ebaa0!important;border-color:#9ebaa0;outline:0;box-shadow:none}form.sunrise input[type=number]:focus,form.sunrise input[type=text]:focus,form.sunrise select.sform:focus,form.sunrise textarea:focus{border-color:#dd823b;border:2px solid #dd823b!important;color:#dd823b;outline:0;box-shadow:none}form.foggy input[type=number]:focus,form.foggy input[type=text]:focus,form.foggy select.sform:focus,form.foggy textarea:focus{border:2px solid #2271b1!important;border-color:#2271b1;outline:0;box-shadow:none}form.polar input[type=number]:focus,form.polar input[type=text]:focus,form.polar select.sform:focus,form.polar textarea:focus{border:2px solid #53a0de;border-color:#53a0de;outline:0;box-shadow:none}input.sform[type=number],input.sform[type=text],select.sform{height:42px!important;padding:10px 15px;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;background-color:#fff!important;border:2px solid #dcdfe6;font-size:14px!important;line-height:24px!important;color:#444}select.sform{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:2px 20px 2px 8px!important;padding-right:30px!important}form.default select.sform:focus,form.default select.sform:hover{color:#2271b1}form.light select.sform:focus,form.light select.sform:hover{color:#04a4cc}form.modern select.sform:focus,form.modern select.sform:hover{color:#3858e9}form.blue select.sform:focus,form.modern blue.sform:hover{color:#2271b1}form.coffee select.sform:focus,form.coffee select.sform:hover{color:#2271b1}form.ectoplasm select.sform:focus,form.ectoplasm select.sform:hover{color:#2271b1}form.midnight select.sform:focus,form.midnight select.sform:hover{color:#2271b1}form.ocean select.sform:focus,form.ocean select.sform:hover{color:#2271b1}form.sunrise select.sform:hover{color:#dd823b}form.foggy select.sform:focus,form.foggy select.sform:hover{color:#2271b1}form.polar select.sform:focus,form.polar select.sform:hover{color:#53a0de}td>p.description{margin-bottom:-2px;letter-spacing:-.6px}#smpt-warnings.default,form.default .privacy-setting.button,form.default .settings-page.button,form.default .widgets-page.button,span.default.button.unavailable{color:#2271b1;border-color:#2271b1}#smpt-warnings.light,form.light .privacy-setting.button,form.light .settings-page.button,form.light .widgets-page.button,span.light.button.unavailable{color:#04a4cc;border-color:#04a4cc}#smpt-warnings.modern,form.modern .privacy-setting.button,form.modern .settings-page.button,form.modern .widgets-page.button,span.modern.button.unavailable{color:#3858e9;border-color:#3858e9}#smpt-warnings.blue,form.blue .privacy-setting.button,form.blue .settings-page.button,form.blue .widgets-page.button,span.blue.button.unavailable{color:#096484;border-color:#096484}#smpt-warnings.coffee,form.coffee .privacy-setting.button,form.coffee .settings-page.button,form.coffee .widgets-page.button,span.coffee.button.unavailable{color:#2271b1;border-color:#2271b1}#smpt-warnings.coffee:hover,form.coffee .privacy-setting.button:hover,form.coffee .settings-page.button:hover,form.coffee .widgets-page.button:hover,span.coffee.button.unavailable:hover{color:#fff;border-color:#59524c;background-color:#59524c}#smpt-warnings.ectoplasm,form.ectoplasm .privacy-setting.button,form.ectoplasm .settings-page.button,form.ectoplasm .widgets-page.button,span.ectoplasm.button.unavailable{color:#a3b745;border-color:#a3b745}#smpt-warnings.ectoplasm:hover,form.ectoplasm .privacy-setting.button:hover,form.ectoplasm .settings-page.button:hover,form.ectoplasm .widgets-page.button:hover,span.ectoplasm.button.unavailable:hover{color:#829237;border-color:#829237}#smpt-warnings.midnight,form.midnight .privacy-setting.button,form.midnight .settings-page.button,form.midnight .widgets-page.button,span.midnight.button.unavailable{color:#e14d43;border-color:#e14d43}#smpt-warnings.midnight:hover,form.midnight .privacy-setting.button:hover,form.midnight .settings-page.button:hover,form.midnight .widgets-page.button:hover,span.midnight.button.unavailable:hover{color:#d02c21;border-color:#d02c21}#smpt-warnings.ocean,form.ocean .privacy-setting.button,form.ocean .settings-page.button,form.ocean .widgets-page.button,span.ocean.button.unavailable{color:#2271b1;border-color:#2271b1}#smpt-warnings.ocean:hover,form.ocean .privacy-setting.button:hover,form.ocean .settings-page.button:hover,form.ocean .widgets-page.button:hover,span.ocean.button.unavailable:hover{color:#fff;border-color:#0a4b78;background-color:#738e96}#smpt-warnings.sunrise,form.sunrise .privacy-setting.button,form.sunrise .settings-page.button,form.sunrise .widgets-page.button,span.sunrise.button.unavailable{color:#dd823b;border-color:#dd823b}#smpt-warnings.foggy,form.foggy .privacy-setting.button,form.foggy .settings-page.button,form.foggy .widgets-page.button,span.foggy.button.unavailable{color:#72aee6;border-color:#72aee6}#smpt-warnings.polar,form.polar .privacy-setting.button,form.polar .settings-page.button,form.polar .widgets-page.button,span.polar.button.unavailable{color:#53a0de;border-color:#53a0de}#smpt-warnings.polar:hover,form.polar .privacy-setting.button:hover,form.polar .settings-page.button:hover,form.polar .widgets-page.button:hover,span.polar.button.unavailable:hover{color:#fff;background-color:#53a0de}select.sform:disabled:hover{color:#a7aaad!important}.switch-input input:disabled+span{cursor:default;box-shadow:none!important}label.disabled{cursor:default}.switch-input input:disabled:checked+span{opacity:.7}input[type=radio]:disabled,input[type=radio]:disabled:checked{cursor:default;box-shadow:none!important}input[type=radio]:disabled:active,input[type=radio]:disabled:focus{border-color:#dcdfe6!important}input[type=radio]:disabled:active:checked,input[type=radio]:disabled:focus:checked{border-color:#53a0de!important}#submit-wrap{margin:0 auto;text-align:center;padding:0 40px 100px}#alert-wrap{position:relative}#noscript{position:absolute;left:0;right:0;color:#fff;border-radius:8px;background:#dc3545;margin:0 75px 25px;line-height:30px;height:30px;padding:9px}#message-wrap{visibility:hidden;color:#909090;border-radius:8px;background:#f2f2f2;margin:0 75px 38px;line-height:30px;height:30px;padding:9px}#message-wrap.error{background:#f6866f;border:0;color:#fff}#message-wrap.success{background:#9bcc79;color:#fff}#message-wrap.unchanged{background:#f8cd5e;color:#fff}#message-wrap.seen{visibility:visible}.submit-button{padding:5px 12px;outline:0;border-radius:8px;font-size:13px;text-transform:uppercase;cursor:pointer;line-height:2.15384615;min-height:30px;border:none}form.default .submit-button{background:#2271b1;color:#fff}form.default .submit-button:hover{background:#135e96;color:#fff}form.default .submit-button:active{background:#135e96;color:#fff}form.light .submit-button{background:#04a4cc;color:#fff}form.light .submit-button:hover{background:#04b0db;color:#fff}form.light .submit-button:active{background:#0490b3;color:#fff}form.modern .submit-button{background:#3858e9;color:#fff}form.modern .submit-button:hover{background:#4664eb;color:#fff}form.modern .submit-button:active{background:#2145e6;color:#fff}form.blue .submit-button{background:#e1a948;color:#fff}form.blue .submit-button:hover{background:#e3af55;color:#fff}form.blue .submit-button:active{background:#dd9f32;color:#fff}form.coffee .submit-button{background:#c7a589;color:#fff}form.coffee .submit-button:hover{background:#ccad93;color:#fff}form.coffee .submit-button:active{background:#bf9878;color:#fff}form.ectoplasm .submit-button{background:#a3b745;color:#fff}form.ectoplasm .submit-button:hover{background:#a9bd4f;color:#fff}form.ectoplasm .submit-button:active{background:#93a43e;color:#fff}form.midnight .submit-button{background:#e14d43;color:#fff}form.midnight .submit-button:hover{background:#e35950;color:#fff}form.midnight .submit-button:active{background:#dd382d;color:#fff}form.ocean .submit-button{background:#9ebaa0;color:#fff}form.ocean .submit-button:hover{background:#a7c0a9;color:#fff}form.ocean .submit-button:active{background:#8faf91;color:#fff}form.sunrise .submit-button{background:#dd823b;color:#fff}form.sunrise .submit-button:hover{background:#c36922;color:#fff}form.sunrise .submit-button:active{background:#d97426;color:#fff}form.foggy .submit-button{background:#2271b1;color:#fff}form.foggy .submit-button:hover{background:#135e96;color:#fff}form.foggy .submit-button:active{background:#135e96;color:#fff}form.polar .submit-button{background:#53a0de;color:#fff}form.polar .submit-button:hover{background:#77b4e5;color:#fff}form.polar .submit-button:active{background:#318dd7;color:#fff}span.button.unavailable{float:left;margin-right:10px}span.button.unavailable a{color:#fff;text-decoration:none}span.button.unavailable:hover a{color:#fff}#set-page-icon.default:hover,span.default.button.unavailable a{color:#2271b1}#set-page-icon.light:hover,span.light.button.unavailable a{color:#04a4cc}#set-page-icon.modern:hover,span.modern.button.unavailable a{color:#3858e9}#set-page-icon.blue:hover,span.blue.button.unavailable a{color:#096484}#set-page-icon.coffee:hover,span.coffee.button.unavailable a{color:#2271b1}span.coffee.button.unavailable:hover a{color:#fff}#set-page-icon.ectoplasm:hover,span.ectoplasm.button.unavailable a{color:#a3b745}span.ectoplasm.button.unavailable:hover a{color:#829237}#set-page-icon.midnight:hover,span.midnight.button.unavailable a{color:#e14d43}#set-page-icon.ocean:hover,span.ocean.button.unavailable a{color:#2271b1}span.ocean.button.unavailable:hover a{color:#fff}#set-page-icon.sunrise:hover,span.sunrise.button.unavailable a{color:#dd823b}#set-page-icon.foggy:hover,span.foggy.button.unavailable a{color:#72aee6}#set-page-icon.polar:hover,span.polar.button.unavailable a{color:#53a0de}span.polar.button.unavailable:hover a{color:#fff}.publish-link{text-decoration:none;color:#9ccc79}.publish-link:hover{color:#9ccc79}input[placeholder]{text-overflow:ellipsis}::-moz-placeholder{text-overflow:ellipsis}input:-moz-placeholder{text-overflow:ellipsis}.head-bracket{font-style:italic;font-weight:400;padding-left:10px}#shortcode-copy{margin-left:5px;border:none;outline:0;background-color:transparent;line-height:inherit;width:40px;height:40px;padding:8px;border-radius:40px;cursor:pointer}#shortcode-copy:hover{background-color:#eee!important}#shortcode-copy:active{background-color:#dcdfe6!important}#shortcode-copy img{vertical-align:middle;width:24px}#shortcode-tooltip{background-color:#8993ab;display:none;color:#fff!important;padding:4px 7px;border-radius:5px;font-size:.75rem;margin-left:5px}.widgets-page.button{text-align:center;float:right;margin-top:6px!important;border-radius:4px;font-size:.9em;font-weight:600;cursor:pointer}.slug{margin-left:10px}.privacy-setting.button{text-align:center;float:none;margin-top:6px!important;border-radius:4px;font-size:.9em;font-weight:600;cursor:pointer}#label-error,.privacy-setting{margin-left:10px!important}#label-error-top{margin-left:10px!important;font-weight:400!important;color:#f6866f}#set-page-icon{float:right;margin-top:-17px;cursor:pointer}#post-status{margin-right:25px}span.description.left{font-size:13px;font-style:italic;padding-left:10px}#smpt-warnings{margin-top:15px!important;border-radius:4px;font-size:13px;font-weight:600;cursor:pointer}tr.smpt-warnings{background-color:#e4e7ec}div.description h4{margin:1.3em 0}tr.smpt-warnings>td{padding:18px 41px 30px 36px;vertical-align:none;border-width:0 0 0 5px;border-style:solid;background:#e5f5fa;border-color:#00a0d2}.description pre{white-space:pre-wrap}#smpt-warnings{text-align:center;float:right;border-radius:4px;font-weight:400;cursor:pointer}#smpt-warnings:hover{background:#f0f0f1}.notice-toggle{white-space:nowrap}.submission-notice>.notice{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:15px}#submissions-data{padding:0;display:flex}#submissions-data li{float:left;padding:20px 0;width:19%;text-align:center;background:#dcdfe6;opacity:.65;padding-bottom:26px}#submissions-data li:hover{opacity:1}.type{margin-right:1.25%}.label{color:#666;text-transform:uppercase;font-size:.8em}.value{display:block;clear:both;font-size:2em;font-weight:300;line-height:40px}#empty-submission,#last-submission,#submissions-notice{padding:30px 30px 50px;margin-top:20px;background:#fff}#empty-submission h3,#last-submission h3,#submissions-notice h3{line-height:30px}#empty-submission span.dashicons,#last-submission span.dashicons,#submissions-notice span.dashicons{font-size:30px;width:30px;height:30px;padding-right:10px}.row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.columns-body{padding:10px}.columns-body>h4{margin-top:15px;margin-bottom:5px}@media only screen and (min-width:75em),all{.columns-wrap{-webkit-flex-basis:50%;-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%;box-sizing:border-box;-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;padding-right:.5rem;padding-left:.5rem}}@media only screen and (min-width:48em),all{.columns-wrap{-webkit-flex-basis:50%;-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}}@media only screen and (min-width:64em),all{.columns-wrap{-webkit-flex-basis:50%;-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}}@media only screen and (max-width:36em){.columns-wrap{-webkit-flex-basis:100%;-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}}#visibility-notes{font-size:12px;margin-top:5px;letter-spacing:-.25px}.widget-pages p.first{margin-bottom:5px!important}p.last,p.visibility{margin-bottom:0!important}.widget-alert{margin-top:15px;margin-right:-15px;margin-left:-15px;padding:0 15px;color:#fff;background:#f6866f}.widget-alert div{padding:6px 0}.sform-widget-notes{font-size:12px;margin-top:5px;letter-spacing:-.25px}.sform-widget-boxes{margin-top:30px}.sform-widget-boxes.buttons p label{line-height:40px}.sform-widget-description{font-size:12px;margin-top:5px;letter-spacing:-.25px}.widget-button{padding:6px 10px;background:#007cba;border-color:#007cba;color:#fff;font-size:12px;width:90px;margin-top:6px;text-align:center;cursor:pointer}.widget-button:hover{background:#0071a1;border-color:#0071a1}#widget-button-editor{float:left}#widget-button-settings{float:right}#widget-button-editor,#widget-button-settings{text-align:center;padding:0 10px;border-radius:4px;font-weight:600;cursor:pointer}p#widget-buttons{margin-top:1em;height:42px}#widget-button-editor.default,#widget-button-settings.default,.support.button.default{color:#2271b1;border-color:#2271b1}#widget-button-editor.light,#widget-button-settings.light,.support.button.light{color:#04a4cc;border-color:#04a4cc}#widget-button-editor.modern,#widget-button-settings.modern,.support.button.modern{color:#3858e9;border-color:#3858e9}#widget-button-editor.blue,#widget-button-settings.blue,.support.button.blue{color:#096484;border-color:#096484}#widget-button-editor.coffee,#widget-button-settings.coffee,.support.button.coffee{color:#2271b1;border-color:#2271b1}#widget-button-editor.coffee:hover,#widget-button-settings.coffee:hover,.support.button.coffee:hover{color:#fff;border-color:#59524c;background-color:#59524c}#widget-button-editor.ectoplasm,#widget-button-settings.ectoplasm,.support.button.ectoplasm{color:#a3b745;border-color:#a3b745}#widget-button-editor.ectoplasm:hover,#widget-button-settings.ectoplasm:hover,.support.button.ectoplasm:hover{color:#829237;border-color:#829237}#widget-button-editor.midnight,#widget-button-settings.midnight,.support.button.midnight{color:#e14d43;border-color:#e14d43}#widget-button-editor.midnight:hover,#widget-button-settings.midnight:hover,.support.button.midnight:hover{color:#d02c21;border-color:#d02c21}#widget-button-editor.ocean,#widget-button-settings.ocean,.support.button.ocean{color:#2271b1;border-color:#2271b1}#widget-button-editor.ocean:hover,#widget-button-settings.ocean:hover,.support.button.ocean:hover{color:#fff;border-color:#0a4b78;background-color:#738e96}#widget-button-editor.sunrise,#widget-button-settings.sunrise,.support.button.sunrise{color:#dd823b;border-color:#dd823b}#widget-button-editor.foggy,#widget-button-settings.foggy,.support.button.foggy{color:#72aee6;border-color:#72aee6}#widget-button-editor.polar,#widget-button-settings.polar,.support.button.polar{color:#53a0de;border-color:#53a0de}#widget-button-editor.polar:hover,#widget-button-settings.polar:hover,.support.button.polar:hover{color:#fff;background-color:#53a0de}@media screen and (max-width:374px){#editor-tabs a,#settings-tabs a{font-size:.75rem}}@media screen and (max-width:520px){.type{margin-right:0!important;border-right:1px solid #8993ab!important}#submissions-data{margin:15px 0!important}#submissions-data li{padding:20px 7px!important;width:calc(20% -1px)!important}.label{font-size:.7em!important;letter-spacing:-.5px}.value{font-size:1.5em!important}#empty-submission,#last-submission,#submissions-notice{padding:10px 15px 30px!important;margin:20px 0!important}#last-submission{overflow:auto}label.multiselect{width:100%}}@media screen and (max-width:782px){.submissions-list .notice{margin:20px}#page-description.overview{padding:10px 0!important;margin-left:-10px!important;margin-right:-10px!important}#submissions-data li{width:20%}.type{margin-right:0;border-right:1px solid #8993ab!important}.label{font-size:.75em}#empty-submission,#last-submission,#submissions-notice{padding:30px 20px 50px!important}#sform-wrap{padding-right:10px}#page-description{padding:10px}form{padding:10px}.sform.wrap{margin-top:0}.responsive{display:none!important}h1.title{padding:10px}select#form{padding:0 24px 0 8px;min-height:34px;font-size:13px}.wrap{margin-right:0;padding-right:10px;margin-left:-10px;padding-left:10px}.nav-tab{border:none;line-height:26px}#editor-tabs,#settings-tabs,form#attributes,form#settings{margin:0 -10px}#editor-tabs,#settings-tabs{overflow:hidden;padding:0 0 0 10px;height:auto;margin-left:-10px!important}#editor-tabs a,#settings-tabs a{margin-right:0!important;padding:5px 8px!important;font-weight:400}#attributes,#settings{border:none}.options-heading{padding:0 10px 10px}.options-heading.closed>a>.icon-button,.options-heading.closed>span>.icon-button{display:none}.options-heading>a>.icon-button,.options-heading>span>.icon-button{display:block}th.option{padding:15px 10px}td.checkbox-switch,td.checkbox-switch.notes,td.multicheckbox.notes,td.plaintext,td.radio,td.radio.notes,td.radio.notes.last,td.select,td.select.notes,td.text,td.text.notes,td.textarea,td.used-page{padding:10px}td.plaintext.icon{padding:0 10px}td.plaintext.widget #edit-widget{margin-top:-11px!important;margin-bottom:0!important}td.checkbox-switch.last,td.checkbox-switch.last.notes,td.last.radio,td.last.select,td.last.select.notes,td.last.text,td.last.text.notes,td.last.textarea,td.last.used-page{padding:10px 10px 40px}#label-error,#set-page{display:none}label-error-top{display:block}label.radio{width:100%}#smpt-warnings.text,.privacy-setting.button,.settings-page.button,.widgets-page.button,a .text{display:none}input[type=radio]:checked::before{width:.5rem;height:.5rem;margin:.1875rem}}@media screen and (min-width:783px){.submissions-list .notice{margin:5px 0 2px}#sform-wrap{padding-right:20px}.sform.wrap{margin:38px 20px 0 2px}h1.title{padding:10px 0}.nav-tab{border:1px solid #dcdfe6;line-height:25px}#editor-tabs a,#settings-tabs a{font-size:14px;margin-right:5px!important;padding:5px 25px}#attributes,#settings{border:1px solid #dcdfe6}.options-heading,.options-heading span span{line-height:60px}.options-heading{padding:0 41px}.options-heading.closed>a>.settings-page,.options-heading.closed>a>.widgets-page,.options-heading.closed>span>#smpt-warnings{display:none}.options-heading>a>.settings-page,.options-heading>a>.widgets-page,.options-heading>span>#smpt-warnings{display:block}#set-page-icon,.icon-button{display:none}th.option{padding:36px 41px 30px;width:275px}td.checkbox-switch.notes{padding:34px 50px 12px 10px}td.checkbox-switch{padding:34px 50px 35px 10px}td.multicheckbox.notes{padding:33px 50px 7px 10px}td.last.select{padding:24px 50px 54px 9px}td.last.radio{padding:30px 50px 60px 10px}td.select.notes{padding:24px 50px 1px 9px}td.checkbox-switch.last.notes{padding:34px 50px 42px 10px}td.checkbox-switch.last{padding:34px 50px 65px 10px}td.text{padding:24px 50px 24px 9px}td.last.text{padding:24px 50px 54px 9px}td.radio{padding:30px 50px 30px 9px}td.last.select.notes{padding:24px 50px 31px 9px}td.textarea{padding:21px 50px 24px 9px}td.text.notes{padding:23px 50px 2px 9px}td.radio.notes{padding:30px 50px 7px 10px}td.radio.notes.last{padding:30px 50px 37px 10px}td.last.text.notes{padding:23px 50px 32px 9px}td.select{padding:24px 50px 24px 9px}td>p.description{padding-right:50px}td.plaintext{padding:36px 50px 36px 9px}td.plaintext.widget{padding:24px 50px 24px 9px;line-height:42px}td.plaintext.icon{padding:26px 50px 24px 9px}td.used-page{padding:36px 50px 58px 9px}td.last.textarea{padding:21px 50px 24px 9px}}.notice.trwidget{margin-top:30px}
     1.invisible{visibility:hidden}.removed,.secret,.unseen{display:none!important}#new-release{font-size:13px!important;line-height:1;color:#bbb;padding:14px 0!important;float:left}#new-release a{color:#bbb;text-decoration:none}#new-release .update a{color:#f6866f}.wrap div.error,.wrap div.notice-success{margin:15px 0 10px}.full-width-bar{margin:0 -9999rem;padding:0 9999rem;clear:both}body,html{overflow-x:hidden}.full-width-bar>h1{margin:0}.sform.wrap>h1>div{float:right}h1.title{color:#fff;line-height:36px;font-size:22px;font-weight:500}h1.title>span{display:inline-block;padding:0 20px 0 0;position:relative;vertical-align:sub;font-size:28px;top:1px}.full-width-bar.default,h1.title.default{background-color:#2271b1!important}.full-width-bar.light,h1.title.light{background-color:#04a4cc!important}.full-width-bar.modern,h1.title.modern{background-color:#4664eb!important}.full-width-bar.blue,h1.title.blue{background-color:#e3af55!important}.full-width-bar.coffee,h1.title.coffee{background-color:#c7a589!important}.full-width-bar.ectoplasm,h1.title.ectoplasm{background-color:#a9bd4f!important}.full-width-bar.midnight,h1.title.midnight{background-color:#e35950!important}.full-width-bar.ocean,h1.title.ocean{background-color:#9ebaa0!important}.full-width-bar.sunrise,h1.title.sunrise{background-color:#dd823b!important}.full-width-bar.foggy,h1.title.foggy{background-color:#8993ab!important}.full-width-bar.polar,h1.title.polar{background-color:#fff!important;color:inherit}div.selector{display:inline-block;float:right}#wrap-selector{font-size:.6em;padding-right:10px;float:left}.form-selector{float:right;padding:0;top:0}select#form{line-height:34px;vertical-align:top}select#form.default{border-color:rgb(34 113 177 / 25%)}select#form.light{border-color:rgb(4 164 204 / 25%)}select#form.modern{border-color:rgb(56 88 233 / 25%)}select#form.blue{border-color:rgb(9 100 132 / 25%)}select#form.coffee{border-color:rgb(199 165 137 / 25%)}select#form.ectoplasm{border-color:rgb(163 183 69 / 25%)}select#form.midnight{border-color:rgb(225 77 67 / 25%)}select#form.ocean{border-color:rgb(158 186 160 / 25%)}select#form.sunrise{border-color:rgb(221 130 59 / 25%)}select#form.foggy{border-color:rgb(34 113 177 / 25%)}select#form.polar{border-color:#8993ab}select.default:focus,select.default:hover{color:#2271b1;border-color:#2271b1;box-shadow:none}select.light:focus,select.light:hover{color:#04a4cc;border-color:#04a4cc;box-shadow:none}select.modern:focus,select.modern:hover{color:#3858e9;border-color:#3858e9;box-shadow:none}select.blue:focus,select.blue:hover{color:#2271b1;border-color:#2271b1;box-shadow:none}select.coffee:focus,select.coffee:hover{color:#2271b1;border-color:#c7a589;box-shadow:none}select.ectoplasm:focus,select.ectoplasm:hover{color:#2271b1;border-color:#a3b745;box-shadow:none}select.midnight:focus,select.midnight:hover{color:#2271b1;border-color:#e14d43;box-shadow:none}select.ocean:focus,select.ocean:hover{color:#2271b1;border-color:#9ebaa0;box-shadow:none}select.sunrise:focus,select.sunrise:hover{color:#dd823b;border-color:#dcdfe6;box-shadow:none}select.foggy:focus,select.foggy:hover{color:#2271b1;border-color:#2271b1;box-shadow:none}select.polar:focus,select.polar:hover{color:#53a0de;border-color:#53a0de;box-shadow:none}#page-description{padding:10px 0}.notice.trwidget{margin-top:30px}#editor-tabs,#settings-tabs{margin-left:15px;position:relative;right:0;left:0;min-height:36px;font-size:0;z-index:1;border-bottom:0}.nav-tab{padding:5px 25px;margin-left:5px;border-bottom:none!important;color:#8993ab!important;background:#dcdfe6}.nav-tab-active,.nav-tab-active:focus,.nav-tab-active:hover,.nav-tab.nav-tab-active:hover{background:#fff!important;color:#8993ab!important;border-bottom:1px solid #fff!important;margin-bottom:-1px}.nav-tab:focus,.nav-tab:hover{background-color:#8993ab;color:#fff!important;cursor:pointer}a .dashicons{line-height:26px;transition:none;-webkit-transition:none;-moz-transition:none;-o-transition:none;text-decoration:none}#editor-tabs a,#settings-tabs a{position:relative;display:inline-block;margin:0;border-bottom:0;margin-bottom:-1px;text-decoration:none;transition:none;-webkit-transition:none;-moz-transition:none;-o-transition:none}#editor-tabs a.form-button,#settings-tabs a.form-button{margin-right:0;float:right}#editor-tabs a.last,#settings-tabs a.last{margin-right:0!important}.form-button{background:#dcdfe6;color:#8993ab;border-bottom:none!important;border:1px solid #dcdfe6;line-height:25px}.form-button:focus{box-shadow:none;outline:0}.form-button>span{white-space:nowrap}.form-button>span>span.text{margin-left:5px}.form-button.default:hover{background:#f0f0f1;color:#2271b1}.form-button.light:hover{background:#f0f0f1;color:#04a4cc}.form-button.modern:hover{background:#f0f0f1;color:#3858e9}.form-button.blue:hover{background:#f0f0f1;color:#096484}.form-button.coffee:hover{background:#59524c;color:#fff}.form-button.ectoplasm:hover{background:#f0f0f1;color:#829237}.form-button.midnight:hover{background:#f0f0f1;color:#d02c21}.form-button.ocean:hover{background:#738e96;color:#fff}.form-button.sunrise:hover{background:#f0f0f1;color:#dd823b}.form-button.foggy:hover{background:#2271b1;color:#fff}.form-button.polar:hover{background:#53a0de;color:#fff}#attributes,#settings{background:#fff;padding-top:25px}.options-heading span{cursor:pointer}.options-heading span span{padding-left:10px}.toggle.dashicons{color:#dcdfe6}.dashicons-arrow-up-alt2:hover{color:#f6866f}.dashicons-arrow-down-alt2:hover{color:#9bcc79}.options-heading.closed{margin-bottom:1.85em}.icon-button{color:#dcdfe6;font-size:26px;margin:-3px 0;float:right}.icon-button.default:hover{color:#2271b1}.icon-button.light:hover{color:#04a4cc}.icon-button.modern:hover{color:#3858e9}.icon-button.blue:hover{color:#096484}.icon-button.coffee:hover{color:#59524c}.icon-button.ectoplasm:hover{color:#a3b745}.icon-button.midnight:hover{color:#e14d43}.icon-button.ocean:hover{color:#738e96}.icon-button.sunrise:hover{color:#dd823b}.icon-button.foggy:hover{color:#72aee6}.icon-button.polar:hover{color:#53a0de}.settings-page.button,.widgets-page.button{text-align:center;float:right;margin-top:15px!important;padding:0 10px;border-radius:3px;font-size:13px;font-weight:600;cursor:pointer}.section.admin.collapsed,.section.akismet.collapsed,.section.auto.collapsed,.section.custom.collapsed,.section.fields.collapsed,.section.formdescription.collapsed,.section.formfields.collapsed,.section.layout.collapsed,.section.notification.collapsed,.section.recaptcha.collapsed,.section.rules.collapsed,.section.sending.collapsed,.section.smtp.collapsed,.section.spam.collapsed,.section.specifics.collapsed,.section.storage.collapsed,.section.style.collapsed,.section.submission.collapsed,.section.success.collapsed,.section.uninstall.collapsed{font-size:0;margin:0;opacity:0;padding:0;max-height:0;overflow:hidden;transition:max-height .3s linear,opacity .15s,font-size .15s,margin .15s,padding .15s;-webkit-transition:max-height .3s linear,opacity .15s,font-size .15s,margin .15s,padding .15s;-moz-transition:max-height .3s linear,opacity .15s,font-size .15s,margin .15s,padding .15s;-o-transition:max-height .3s linear,opacity .15s,font-size .15s,margin .15s,padding .15s}.section.admin,.section.akismet,.section.custom,.section.formdescription,.section.layout,.section.rules,.section.sending,.section.spam,.section.style,.section.submission,.section.success,.section.uninstall{max-height:800px;transition:max-height .5s linear,opacity 1s,font-size 1s,margin 1s,padding 1s;-webkit-transition:max-height .5s linear,opacity 1s,font-size 1s,margin 1s,padding 1s;-moz-transition:max-height .5s linear,opacity 1s,font-size 1s,margin 1s,padding 1s;-o-transition:max-height .5s linear,opacity 1s,font-size 1s,margin 1s,padding 1s}.section.auto,.section.notification,.section.recaptcha,.section.smtp,.section.specifics,.section.storage{max-height:1500px;transition:max-height 1.25s linear,opacity 1.5s,font-size 1.5s,margin 1.5s,padding 1.5s}.section.fields{max-height:3500px;transition:max-height 1.75s linear,opacity 2s,font-size 2s,margin 2s,padding 2s;-webkit-transition:max-height 1.75s linear,opacity 2s,font-size 2s,margin 2s,padding 2s;-moz-transition:max-height 1.75s linear,opacity 2s,font-size 2s,margin 2s,padding 2s;-o-transition:max-height 1.75s linear,opacity 2s,font-size 2s,margin 2s,padding 2s}.section.formfields{max-height:5500px;transition:max-height 2s linear,opacity 2.25s,font-size 2.25s,margin 2.25s,padding 2.25s;-webkit-transition:max-height 2s linear,opacity 2.25s,font-size 2.25s,margin 2.25s,padding 2.25s;-moz-transition:max-height 2s linear,opacity 2.25s,font-size 2.25s,margin 2.25s,padding 2.25s;-o-transition:max-height 2s linear,opacity 2.25s,font-size 2.25s,margin 2.25s,padding 2.25s}th>span{cursor:default}.switch-box{display:inline-table;width:100%;position:relative;height:20px;line-height:20px}.switch-input{position:relative;display:inline-block;float:left;margin-right:10px;width:40px;height:20px}.switch-input input{top:2px;left:4px;margin:0;position:absolute;opacity:0!important;width:20px;height:20px}.switch-input input:active+span{outline:0;box-shadow:none}.switch-label{display:inline-block;vertical-align:middle;width:calc(100% - 50px)}.switch-input input+span{position:absolute;z-index:1;cursor:pointer;top:0;left:0;right:0;bottom:0;background:#dcdfe6;-webkit-transition:.4s;transition:.4s;-moz-transition:.4s;-o-transition:.4s;border-radius:20px;border:2px solid #dcdfe6}.switch-input input+span:before{position:absolute;content:"";height:16px;width:16px;background-color:#fff;-webkit-transition:.4s;transition:.4s;-moz-transition:.4s;-o-transition:.4s;border-radius:50%}.switch-input input:checked+span:before{-webkit-transform:translateX(20px);-ms-transform:translateX(20px);transform:translateX(20px)}label.multiselect{position:relative;cursor:pointer;display:inline-block;padding-left:34px;line-height:24px;margin-right:10px;margin-bottom:10px}label.multiselect.last{margin-right:0}input[type=checkbox].multiselect{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.checkmark{position:absolute;cursor:pointer;top:0;left:0;height:20px;width:20px;border-radius:4px;background-color:#dcdfe6;border:2px solid #dcdfe6}.checkmark:after{left:7px;top:2px;width:4px;height:10px;border:solid #fff;border-width:0 3px 3px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);content:"";position:absolute;display:none}input[type=checkbox]:checked+.checkmark{background-color:#0d6efd;border:2px solid #0d6efd}input[type=checkbox]:checked+.checkmark:after{display:block}#columns-description.description{margin-top:-3px}form.default .switch-input input:checked+span,form.default input[type=checkbox]:checked+.checkmark{background:#2271b1;border:2px solid #2271b1}form.default .switch-input input:active+span{outline:0;box-shadow:none}form.light .switch-input input:checked+span,form.light input[type=checkbox]:checked+.checkmark{background:#04a4cc;border:2px solid #04a4cc}form.light .switch-input input:active+span{outline:0;box-shadow:none}form.modern .switch-input input:checked+span,form.modern input[type=checkbox]:checked+.checkmark{background:#3858e9;border:2px solid #3858e9}form.modern .switch-input input:active+span{outline:0;box-shadow:none}form.blue .switch-input input:checked+span,form.blue input[type=checkbox]:checked+.checkmark{background:#096484;border:2px solid #096484}form.blue .switch-input input:active+span{outline:0;box-shadow:none}form.coffee .switch-input input:checked+span,form.coffee input[type=checkbox]:checked+.checkmark{background:#c7a589;border:2px solid #c7a589}form.coffee .switch-input input:active+span{outline:0;box-shadow:none}form.ectoplasm .switch-input input:checked+span,form.ectoplasm input[type=checkbox]:checked+.checkmark{background:#a3b745;border:2px solid #a3b745}form.ectoplasm .switch-input input:active+span{outline:0;box-shadow:none}form.midnight .switch-input input:checked+span,form.midnight input[type=checkbox]:checked+.checkmark{background:#e14d43;border:2px solid #e14d43}form.midnight .switch-input input:active+span{outline:0;box-shadow:none}form.ocean .switch-input input:checked+span,form.ocean input[type=checkbox]:checked+.checkmark{background:#9ebaa0;border:2px solid #9ebaa0}form.ocean .switch-input input:active+span{outline:0;box-shadow:none}form.sunrise .switch-input input:checked+span,form.sunrise input[type=checkbox]:checked+.checkmark{background:#dd823b;border:2px solid #dd823b}form.sunrise .switch-input input:active+span{outline:0;box-shadow:none}form.foggy .switch-input input:checked+span,form.foggy input[type=checkbox]:checked+.checkmark{background:#2271b1;border:2px solid #2271b1}form.foggy .switch-input input:active+span{outline:0;box-shadow:none}form.polar .switch-input input:checked+span,form.polar input[type=checkbox]:checked+.checkmark{background:#53a0de;border:2px solid #53a0de}form.polar .switch-input input:active+span{outline:0;box-shadow:none}input[type=radio]{border:2px solid #dcdfe6;height:18px;width:18px;margin-top:-3px!important;margin-right:10px!important}form.default input[type=radio]:checked,form.foggy input[type=radio]:checked{background:#2271b1;border-color:#2271b1}form.default input[type=radio]:active,form.default input[type=radio]:focus,form.foggy input[type=radio]:active,form.foggy input[type=radio]:focus{border-color:#2271b1;outline:0;box-shadow:none}form.light input[type=radio]:active,form.light input[type=radio]:focus{border-color:#04a4cc;outline:0;box-shadow:none}form.light input[type=radio]:checked{background:#04a4cc;border-color:#04a4cc}form.modern input[type=radio]:active,form.modern input[type=radio]:focus{border-color:#3858e9;outline:0;box-shadow:none}form.modern input[type=radio]:checked{background:#3858e9;border-color:#3858e9}form.blue input[type=radio]:active,form.blue input[type=radio]:focus{border-color:#096484;outline:0;box-shadow:none}form.blue input[type=radio]:checked{background:#096484;border-color:#096484}form.coffee input[type=radio]:active,form.coffee input[type=radio]:focus{border-color:#c7a589;outline:0;box-shadow:none}form.coffee input[type=radio]:checked{background:#c7a589;border-color:#c7a589}form.ectoplasm input[type=radio]:active,form.ectoplasm input[type=radio]:focus{border-color:#a3b745;outline:0;box-shadow:none}form.ectoplasm input[type=radio]:checked{background:#a3b745;border-color:#a3b745}form.midnight input[type=radio]:active,form.midnight input[type=radio]:focus{border-color:#e14d43;outline:0;box-shadow:none}form.midnight input[type=radio]:checked{background:#e14d43;border-color:#e14d43}form.ocean input[type=radio]:active,form.ocean input[type=radio]:focus{border-color:#9ebaa0;outline:0;box-shadow:none}form.ocean input[type=radio]:checked{background:#9ebaa0;border-color:#9ebaa0}form.sunrise input[type=radio]:active,input[type=radio]:focus{border-color:#dd823b;outline:0;box-shadow:none}form.sunrise input[type=radio]:checked{background:#dd823b;border-color:#dd823b}form.polar input[type=radio]:active,form.polar input[type=radio]:focus{border-color:#53a0de;outline:0;box-shadow:none}form.polar input[type=radio]:checked{background:#53a0de;border-color:#53a0de}input[type=radio]:checked::before{background-color:#fff}.form-table td fieldset label{margin-right:20px!important}textarea{height:230px!important;width:100%;padding:10px 15px;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;background-color:#fff!important;border:2px solid #dcdfe6;font-size:14px!important;line-height:24px!important;color:#444}textarea.description{height:148px!important}textarea.labels{height:100px!important}input.sform{width:100%}input.sform[type=number]{width:90px!important;text-align:center}form.default input[type=number]:focus,form.default input[type=text]:focus,form.default select.sform:focus,form.default textarea:focus{border:2px solid #2271b1!important;border-color:#2271b1;outline:0;box-shadow:none}form.light input[type=number]:focus,form.light input[type=text]:focus,form.light select.sform:focus,form.light textarea:focus{border:2px solid #04a4cc!important;border-color:#04a4cc;outline:0;box-shadow:none}form.modern input[type=number]:focus,form.modern input[type=text]:focus,form.modern select.sform:focus,form.modern textarea:focus{border:2px solid #3858e9!important;border-color:#3858e9;outline:0;box-shadow:none}form.blue input[type=number]:focus,form.blue input[type=text]:focus,form.blue select.sform:focus,form.blue textarea:focus{border:2px solid #096484!important;border-color:#096484;outline:0;box-shadow:none}form.coffee input[type=number]:focus,form.coffee input[type=text]:focus,form.coffee select.sform:focus,form.coffee textarea:focus{border:2px solid #c7a589!important;border-color:#c7a589;outline:0;box-shadow:none}form.ectoplasm input[type=number]:focus,form.ectoplasm input[type=text]:focus,form.ectoplasm select.sform:focus,form.ectoplasm textarea:focus{border:2px solid #a3b745!important;border-color:#a3b745;outline:0;box-shadow:none}form.midnight input[type=number]:focus,form.midnight input[type=text]:focus,form.midnight select.sform:focus,form.midnight textarea:focus{border:2px solid #e14d43!important;border-color:#e14d43;outline:0;box-shadow:none}form.ocean input[type=number]:focus,form.ocean input[type=text]:focus,form.ocean select.sform:focus,form.ocean textarea:focus{border:2px solid #9ebaa0!important;border-color:#9ebaa0;outline:0;box-shadow:none}form.sunrise input[type=number]:focus,form.sunrise input[type=text]:focus,form.sunrise select.sform:focus,form.sunrise textarea:focus{border-color:#dd823b;border:2px solid #dd823b!important;color:#dd823b;outline:0;box-shadow:none}form.foggy input[type=number]:focus,form.foggy input[type=text]:focus,form.foggy select.sform:focus,form.foggy textarea:focus{border:2px solid #2271b1!important;border-color:#2271b1;outline:0;box-shadow:none}form.polar input[type=number]:focus,form.polar input[type=text]:focus,form.polar select.sform:focus,form.polar textarea:focus{border:2px solid #53a0de;border-color:#53a0de;outline:0;box-shadow:none}input.sform[type=number],input.sform[type=text],select.sform{height:42px!important;padding:10px 15px;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;background-color:#fff!important;border:2px solid #dcdfe6;font-size:14px!important;line-height:24px!important;color:#444}select.sform{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:2px 20px 2px 8px!important;padding-right:30px!important}form.default select.sform:focus,form.default select.sform:hover{color:#2271b1}form.light select.sform:focus,form.light select.sform:hover{color:#04a4cc}form.modern select.sform:focus,form.modern select.sform:hover{color:#3858e9}form.blue select.sform:focus,form.modern blue.sform:hover{color:#2271b1}form.coffee select.sform:focus,form.coffee select.sform:hover{color:#2271b1}form.ectoplasm select.sform:focus,form.ectoplasm select.sform:hover{color:#2271b1}form.midnight select.sform:focus,form.midnight select.sform:hover{color:#2271b1}form.ocean select.sform:focus,form.ocean select.sform:hover{color:#2271b1}form.sunrise select.sform:hover{color:#dd823b}form.foggy select.sform:focus,form.foggy select.sform:hover{color:#2271b1}form.polar select.sform:focus,form.polar select.sform:hover{color:#53a0de}td>p.description{margin-bottom:-2px;letter-spacing:-.6px}#deletion-toggle.default,#smpt-warnings.default,form.default .privacy-setting.button,form.default .settings-page.button,form.default .widgets-page.button,span.default.button.unavailable{color:#2271b1;border-color:#2271b1}#deletion-toggle.light,#smpt-warnings.light,form.light .privacy-setting.button,form.light .settings-page.button,form.light .widgets-page.button,span.light.button.unavailable{color:#04a4cc;border-color:#04a4cc}#deletion-toggle.modern,#smpt-warnings.modern,form.modern .privacy-setting.button,form.modern .settings-page.button,form.modern .widgets-page.button,span.modern.button.unavailable{color:#3858e9;border-color:#3858e9}#deletion-toggle.blue,#smpt-warnings.blue,form.blue .privacy-setting.button,form.blue .settings-page.button,form.blue .widgets-page.button,span.blue.button.unavailable{color:#096484;border-color:#096484}#deletion-toggle.coffee,#smpt-warnings.coffee,form.coffee .privacy-setting.button,form.coffee .settings-page.button,form.coffee .widgets-page.button,span.coffee.button.unavailable{color:#2271b1;border-color:#2271b1}#deletion-toggle.coffee:hover,#smpt-warnings.coffee:hover,form.coffee .privacy-setting.button:hover,form.coffee .settings-page.button:hover,form.coffee .widgets-page.button:hover,span.coffee.button.unavailable:hover{color:#fff;border-color:#59524c;background-color:#59524c}#deletion-toggle.ectoplasm,#smpt-warnings.ectoplasm,form.ectoplasm .privacy-setting.button,form.ectoplasm .settings-page.button,form.ectoplasm .widgets-page.button,span.ectoplasm.button.unavailable{color:#a3b745;border-color:#a3b745}#deletion-toggle.ectoplasm:hover,#smpt-warnings.ectoplasm:hover,form.ectoplasm .privacy-setting.button:hover,form.ectoplasm .settings-page.button:hover,form.ectoplasm .widgets-page.button:hover,span.ectoplasm.button.unavailable:hover{color:#829237;border-color:#829237}#deletion-toggle.midnight,#smpt-warnings.midnight,form.midnight .privacy-setting.button,form.midnight .settings-page.button,form.midnight .widgets-page.button,span.midnight.button.unavailable{color:#e14d43;border-color:#e14d43}#deletion-toggle.midnight:hover,#smpt-warnings.midnight:hover,form.midnight .privacy-setting.button:hover,form.midnight .settings-page.button:hover,form.midnight .widgets-page.button:hover,span.midnight.button.unavailable:hover{color:#d02c21;border-color:#d02c21}#deletion-toggle.ocean,#smpt-warnings.ocean,form.ocean .privacy-setting.button,form.ocean .settings-page.button,form.ocean .widgets-page.button,span.ocean.button.unavailable{color:#2271b1;border-color:#2271b1}#deletion-toggle.ocean:hover,#smpt-warnings.ocean:hover,form.ocean .privacy-setting.button:hover,form.ocean .settings-page.button:hover,form.ocean .widgets-page.button:hover,span.ocean.button.unavailable:hover{color:#fff;border-color:#0a4b78;background-color:#738e96}#deletion-toggle.sunrise,#smpt-warnings.sunrise,form.sunrise .privacy-setting.button,form.sunrise .settings-page.button,form.sunrise .widgets-page.button,span.sunrise.button.unavailable{color:#dd823b;border-color:#dd823b}#deletion-toggle.foggy,#smpt-warnings.foggy,form.foggy .privacy-setting.button,form.foggy .settings-page.button,form.foggy .widgets-page.button,span.foggy.button.unavailable{color:#72aee6;border-color:#72aee6}#deletion-toggle.polar,#smpt-warnings.polar,form.polar .privacy-setting.button,form.polar .settings-page.button,form.polar .widgets-page.button,span.polar.button.unavailable{color:#53a0de;border-color:#53a0de}#deletion-toggle.polar:hover,#smpt-warnings.polar:hover,form.polar .privacy-setting.button:hover,form.polar .settings-page.button:hover,form.polar .widgets-page.button:hover,span.polar.button.unavailable:hover{color:#fff;background-color:#53a0de}select.sform:disabled:hover{color:#a7aaad!important}.switch-input input:disabled+span{cursor:default;box-shadow:none!important}label.disabled{cursor:default}.switch-input input:disabled:checked+span{opacity:.7}input[type=radio]:disabled,input[type=radio]:disabled:checked{cursor:default;box-shadow:none!important}input[type=radio]:disabled:active,input[type=radio]:disabled:focus{border-color:#dcdfe6!important}input[type=radio]:disabled:active:checked,input[type=radio]:disabled:focus:checked{border-color:#53a0de!important}#submit-wrap{margin:0 auto;text-align:center;padding:0 40px 100px}#alert-wrap{position:relative}#noscript{position:absolute;left:0;right:0;color:#fff;border-radius:8px;background:#dc3545;margin:0 75px 25px;line-height:30px;height:30px;padding:9px}#message-wrap{visibility:hidden;color:#909090;border-radius:8px;background:#f2f2f2;margin:0 75px 38px;line-height:30px;height:30px;padding:9px}#message-wrap.error{background:#f6866f;border:0;color:#fff}#message-wrap.success{background:#9bcc79;color:#fff}#message-wrap.unchanged{background:#f8cd5e;color:#fff}#message-wrap.seen{visibility:visible}.submit-button{padding:5px 12px;outline:0;border-radius:8px;font-size:13px;text-transform:uppercase;cursor:pointer;line-height:2.15384615;min-height:30px;border:none}form.default .submit-button{background:#2271b1;color:#fff}form.default .submit-button:hover{background:#135e96;color:#fff}form.default .submit-button:active{background:#135e96;color:#fff}form.light .submit-button{background:#04a4cc;color:#fff}form.light .submit-button:hover{background:#04b0db;color:#fff}form.light .submit-button:active{background:#0490b3;color:#fff}form.modern .submit-button{background:#3858e9;color:#fff}form.modern .submit-button:hover{background:#4664eb;color:#fff}form.modern .submit-button:active{background:#2145e6;color:#fff}form.blue .submit-button{background:#e1a948;color:#fff}form.blue .submit-button:hover{background:#e3af55;color:#fff}form.blue .submit-button:active{background:#dd9f32;color:#fff}form.coffee .submit-button{background:#c7a589;color:#fff}form.coffee .submit-button:hover{background:#ccad93;color:#fff}form.coffee .submit-button:active{background:#bf9878;color:#fff}form.ectoplasm .submit-button{background:#a3b745;color:#fff}form.ectoplasm .submit-button:hover{background:#a9bd4f;color:#fff}form.ectoplasm .submit-button:active{background:#93a43e;color:#fff}form.midnight .submit-button{background:#e14d43;color:#fff}form.midnight .submit-button:hover{background:#e35950;color:#fff}form.midnight .submit-button:active{background:#dd382d;color:#fff}form.ocean .submit-button{background:#9ebaa0;color:#fff}form.ocean .submit-button:hover{background:#a7c0a9;color:#fff}form.ocean .submit-button:active{background:#8faf91;color:#fff}form.sunrise .submit-button{background:#dd823b;color:#fff}form.sunrise .submit-button:hover{background:#c36922;color:#fff}form.sunrise .submit-button:active{background:#d97426;color:#fff}form.foggy .submit-button{background:#2271b1;color:#fff}form.foggy .submit-button:hover{background:#135e96;color:#fff}form.foggy .submit-button:active{background:#135e96;color:#fff}form.polar .submit-button{background:#53a0de;color:#fff}form.polar .submit-button:hover{background:#77b4e5;color:#fff}form.polar .submit-button:active{background:#318dd7;color:#fff}span.button.unavailable{float:left;margin-right:10px}span.button.unavailable a{color:#fff;text-decoration:none}span.button.unavailable:hover a{color:#fff}#set-page-icon.default:hover,span.default.button.unavailable a{color:#2271b1}#set-page-icon.light:hover,span.light.button.unavailable a{color:#04a4cc}#set-page-icon.modern:hover,span.modern.button.unavailable a{color:#3858e9}#set-page-icon.blue:hover,span.blue.button.unavailable a{color:#096484}#set-page-icon.coffee:hover,span.coffee.button.unavailable a{color:#2271b1}span.coffee.button.unavailable:hover a{color:#fff}#set-page-icon.ectoplasm:hover,span.ectoplasm.button.unavailable a{color:#a3b745}span.ectoplasm.button.unavailable:hover a{color:#829237}#set-page-icon.midnight:hover,span.midnight.button.unavailable a{color:#e14d43}#set-page-icon.ocean:hover,span.ocean.button.unavailable a{color:#2271b1}span.ocean.button.unavailable:hover a{color:#fff}#set-page-icon.sunrise:hover,span.sunrise.button.unavailable a{color:#dd823b}#set-page-icon.foggy:hover,span.foggy.button.unavailable a{color:#72aee6}#set-page-icon.polar:hover,span.polar.button.unavailable a{color:#53a0de}span.polar.button.unavailable:hover a{color:#fff}.publish-link{text-decoration:none;color:#9ccc79}.publish-link:hover{color:#9ccc79}input[placeholder]{text-overflow:ellipsis}::-moz-placeholder{text-overflow:ellipsis}input:-moz-placeholder{text-overflow:ellipsis}.head-bracket{font-style:italic;font-weight:400;padding-left:10px}#shortcode-copy{margin-left:5px;border:none;outline:0;background-color:transparent;line-height:inherit;width:40px;height:40px;padding:8px;border-radius:40px;cursor:pointer}#shortcode-copy:hover{background-color:#eee!important}#shortcode-copy:active{background-color:#dcdfe6!important}#shortcode-copy img{vertical-align:middle;width:24px}#shortcode-tooltip{background-color:#8993ab;display:none;color:#fff!important;padding:4px 7px;border-radius:5px;font-size:.75rem;margin-left:5px}.widgets-page.button{text-align:center;float:right;margin-top:6px!important;border-radius:4px;font-size:.9em;font-weight:600;cursor:pointer}.slug{margin-left:10px}.privacy-setting.button{text-align:center;float:none;margin-top:6px!important;border-radius:4px;font-size:.9em;font-weight:600;cursor:pointer}#label-error,.privacy-setting{margin-left:10px!important}#label-error-top{margin-left:10px!important;font-weight:400!important;color:#f6866f}#set-page-icon{float:right;margin-top:-17px;cursor:pointer}#post-status{margin-right:25px}span.description.left{font-size:13px;font-style:italic;padding-left:10px}#form-borders{margin-left:20px}#smpt-warnings{margin-top:15px!important;font-size:13px;text-align:center;float:right;border-radius:4px;font-weight:400;cursor:pointer}tr.smpt-warnings{background-color:#e4e7ec}div.description h4{margin:1.3em 0}tr.smpt-warnings>td{padding:18px 41px 30px 36px;vertical-align:none;border-width:0 0 0 5px;border-style:solid;background:#e5f5fa;border-color:#00a0d2}.description pre{white-space:pre-wrap}#smpt-warnings:hover{background:#f0f0f1}.notice-toggle{white-space:nowrap}.submission-notice>.notice{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:15px}#submissions-data{padding:0;display:flex}#submissions-data li{float:left;padding:20px 0;width:19%;text-align:center;background:#dcdfe6;opacity:.65;padding-bottom:26px}#submissions-data li:hover{opacity:1}.type{margin-right:1.25%}.label{color:#666;text-transform:uppercase;font-size:.8em}.value{display:block;clear:both;font-size:2em;font-weight:300;line-height:40px}#empty-submission,#last-submission,#submissions-notice{padding:30px 30px 50px;margin-top:20px;background:#fff}#empty-submission h3,#last-submission h3,#submissions-notice h3{line-height:30px}#deletion-notice{padding:5px 30px 30px;margin-top:30px;background:#eb8a84;color:#fff}#deletion-notice h3{line-height:30px;color:#fff}#deletion-notice .disclaimer{display:inline-block;padding:6px 0;width:60%}#deletion-notice .delete{display:inline-block;padding:6px 10px;background:#fff;color:#e35950;border-radius:5px;cursor:pointer}#deletion-notice .cancel{margin-right:20px}input.delete{font-size:inherit;margin:0;border:0;line-height:inherit}#deletion-toggle{margin-top:30px;font-size:13px;font-weight:600;text-align:center;float:right;border-radius:4px;font-weight:400;cursor:pointer;padding:6px 10px;background:#fff;border-style:solid;border-width:1px}#deletion-toggle:hover{background:#f0f0f1}#deletion-buttons{float:right;width:auto}@media screen and (max-width:960px){#deletion-notice .disclaimer{width:100%}#deletion-buttons{width:100%;text-align:center;float:none;margin:20px 0 0}}#deletion-notice span.dashicons,#empty-submission span.dashicons,#last-submission span.dashicons,#submissions-notice span.dashicons{font-size:30px;width:30px;height:30px;padding-right:10px}.row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.columns-body{padding:10px}.columns-body>h4{margin-top:15px;margin-bottom:5px}@media only screen and (min-width:75em),all{.columns-wrap{-webkit-flex-basis:50%;-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%;box-sizing:border-box;-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;padding-right:.5rem;padding-left:.5rem}}@media only screen and (min-width:48em),all{.columns-wrap{-webkit-flex-basis:50%;-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}}@media only screen and (min-width:64em),all{.columns-wrap{-webkit-flex-basis:50%;-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}}@media only screen and (max-width:36em){.columns-wrap{-webkit-flex-basis:100%;-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}}#visibility-notes{font-size:12px;margin-top:5px;letter-spacing:-.25px}.widget-pages p.first{margin-bottom:5px!important}p.last,p.visibility{margin-bottom:0!important}.widget-alert{margin-top:15px;margin-right:-15px;margin-left:-15px;padding:0 15px;color:#fff;background:#f6866f}.widget-alert div{padding:6px 0}.sform-widget-notes{font-size:12px;margin-top:5px;letter-spacing:-.25px}.sform-widget-boxes{margin-top:30px}.sform-widget-boxes.buttons p label{line-height:40px}.sform-widget-description{font-size:12px;margin-top:5px;letter-spacing:-.25px}.widget-button{padding:6px 10px;background:#007cba;border-color:#007cba;color:#fff;font-size:12px;width:90px;margin-top:6px;text-align:center;cursor:pointer}.widget-button:hover{background:#0071a1;border-color:#0071a1}#widget-button-editor{float:left}#widget-button-settings{float:right}#widget-button-editor,#widget-button-settings{text-align:center;padding:0 10px;border-radius:4px;font-weight:600;cursor:pointer}p#widget-buttons{margin-top:1em;height:42px}#widget-button-editor.default,#widget-button-settings.default,.support.button.default{color:#2271b1;border-color:#2271b1}#widget-button-editor.light,#widget-button-settings.light,.support.button.light{color:#04a4cc;border-color:#04a4cc}#widget-button-editor.modern,#widget-button-settings.modern,.support.button.modern{color:#3858e9;border-color:#3858e9}#widget-button-editor.blue,#widget-button-settings.blue,.support.button.blue{color:#096484;border-color:#096484}#widget-button-editor.coffee,#widget-button-settings.coffee,.support.button.coffee{color:#2271b1;border-color:#2271b1}#widget-button-editor.coffee:hover,#widget-button-settings.coffee:hover,.support.button.coffee:hover{color:#fff;border-color:#59524c;background-color:#59524c}#widget-button-editor.ectoplasm,#widget-button-settings.ectoplasm,.support.button.ectoplasm{color:#a3b745;border-color:#a3b745}#widget-button-editor.ectoplasm:hover,#widget-button-settings.ectoplasm:hover,.support.button.ectoplasm:hover{color:#829237;border-color:#829237}#widget-button-editor.midnight,#widget-button-settings.midnight,.support.button.midnight{color:#e14d43;border-color:#e14d43}#widget-button-editor.midnight:hover,#widget-button-settings.midnight:hover,.support.button.midnight:hover{color:#d02c21;border-color:#d02c21}#widget-button-editor.ocean,#widget-button-settings.ocean,.support.button.ocean{color:#2271b1;border-color:#2271b1}#widget-button-editor.ocean:hover,#widget-button-settings.ocean:hover,.support.button.ocean:hover{color:#fff;border-color:#0a4b78;background-color:#738e96}#widget-button-editor.sunrise,#widget-button-settings.sunrise,.support.button.sunrise{color:#dd823b;border-color:#dd823b}#widget-button-editor.foggy,#widget-button-settings.foggy,.support.button.foggy{color:#72aee6;border-color:#72aee6}#widget-button-editor.polar,#widget-button-settings.polar,.support.button.polar{color:#53a0de;border-color:#53a0de}#widget-button-editor.polar:hover,#widget-button-settings.polar:hover,.support.button.polar:hover{color:#fff;background-color:#53a0de}@media screen and (max-width:374px){#editor-tabs a,#settings-tabs a{font-size:.75rem}}@media screen and (max-width:520px){.type{margin-right:0!important;border-right:1px solid #8993ab!important}#submissions-data{margin:15px 0!important}#submissions-data li{padding:20px 7px!important;width:calc(20% -1px)!important}.label{font-size:.7em!important;letter-spacing:-.5px}.value{font-size:1.5em!important}#empty-submission,#last-submission,#submissions-notice{padding:10px 15px 30px!important;margin:20px 0!important}#last-submission{overflow:auto}label.multiselect{width:100%}}@media screen and (max-width:782px){.submissions-list .notice{margin:20px}#deletion-toggle{margin:20px;margin-top:30px}#page-description.overview{padding:10px 0!important;margin-left:-10px!important;margin-right:-10px!important}#submissions-data li{width:20%}.type{margin-right:0;border-right:1px solid #8993ab!important}.label{font-size:.75em}#empty-submission,#last-submission,#submissions-notice{padding:30px 20px 50px!important}#sform-wrap{padding-right:10px}#page-description{padding:10px}form{padding:10px}.sform.wrap{margin-top:0}.responsive{display:none!important}h1.title{padding:10px}select#form{padding:0 24px 0 8px;min-height:34px;font-size:13px}.wrap{margin-right:0;padding-right:10px;margin-left:-10px;padding-left:10px}.nav-tab{border:none;line-height:26px}#editor-tabs,#settings-tabs,form#attributes,form#settings{margin:0 -10px}#editor-tabs,#settings-tabs{overflow:hidden;padding:0 0 0 10px;height:auto;margin-left:-10px!important}#editor-tabs a,#settings-tabs a{margin-right:0!important;padding:5px 8px!important;font-weight:400}#attributes,#settings{border:none}.options-heading{padding:0 10px 10px}.options-heading.closed>a>.icon-button,.options-heading.closed>span>.icon-button{display:none}.options-heading>a>.icon-button,.options-heading>span>.icon-button{display:block}th.option{padding:15px 10px}td.checkbox-switch,td.checkbox-switch.notes,td.multicheckbox.notes,td.plaintext,td.radio,td.radio.notes,td.radio.notes.last,td.select,td.select.notes,td.text,td.text.notes,td.textarea,td.used-page{padding:10px}td.plaintext.icon{padding:0 10px}td.plaintext.widget #edit-widget{margin-top:-11px!important;margin-bottom:0!important}td.checkbox-switch.last,td.checkbox-switch.last.notes,td.last.radio,td.last.select,td.last.select.notes,td.last.text,td.last.text.notes,td.last.textarea,td.last.used-page{padding:10px 10px 40px}#label-error,#set-page{display:none}label-error-top{display:block}label.radio{width:100%}#smpt-warnings.text,.privacy-setting.button,.settings-page.button,.widgets-page.button,a .text{display:none}input[type=radio]:checked::before{width:.5rem;height:.5rem;margin:.1875rem}}@media screen and (min-width:783px){.submissions-list .notice{margin:5px 0 2px}#sform-wrap{padding-right:20px}.sform.wrap{margin:38px 20px 0 2px}h1.title{padding:10px 0}.nav-tab{border:1px solid #dcdfe6;line-height:25px}#editor-tabs a,#settings-tabs a{font-size:14px;margin-right:5px!important;padding:5px 25px}#attributes,#settings{border:1px solid #dcdfe6}.options-heading,.options-heading span span{line-height:60px}.options-heading{padding:0 41px}.options-heading.closed>a>.settings-page,.options-heading.closed>a>.widgets-page,.options-heading.closed>span>#smpt-warnings{display:none}.options-heading>a>.settings-page,.options-heading>a>.widgets-page,.options-heading>span>#smpt-warnings{display:block}#set-page-icon,.icon-button{display:none}th.option{padding:36px 41px 30px;width:275px}td.checkbox-switch.notes{padding:34px 50px 12px 10px}td.checkbox-switch{padding:34px 50px 35px 10px}td.multicheckbox.notes{padding:33px 50px 7px 10px}td.last.select{padding:24px 50px 54px 9px}td.last.radio{padding:30px 50px 60px 10px}td.select.notes{padding:24px 50px 1px 9px}td.checkbox-switch.last.notes{padding:34px 50px 42px 10px}td.checkbox-switch.last{padding:34px 50px 65px 10px}td.text{padding:24px 50px 24px 9px}td.last.text{padding:24px 50px 54px 9px}td.radio{padding:30px 50px 30px 9px}td.last.select.notes{padding:24px 50px 31px 9px}td.textarea{padding:21px 50px 24px 9px}td.text.notes{padding:23px 50px 2px 9px}td.radio.notes{padding:30px 50px 7px 10px}td.radio.notes.last{padding:30px 50px 37px 10px}td.last.text.notes{padding:23px 50px 32px 9px}td.select{padding:24px 50px 24px 9px}td>p.description{padding-right:50px}td.plaintext{padding:36px 50px 36px 9px}td.plaintext.widget{padding:24px 50px 24px 9px;line-height:42px}td.plaintext.icon{padding:26px 50px 24px 9px}td.used-page{padding:36px 50px 58px 9px}td.last.textarea{padding:21px 50px 24px 9px}}
  • simpleform/trunk/admin/css/admin.css

    r2568608 r2581779  
    104104.icon-button.polar:hover { color: #53a0de; }
    105105.widgets-page.button, .settings-page.button { text-align: center; float: right; margin-top: 15px !important; padding: 0 10px; border-radius: 3px; font-size: 13px; font-weight: 600; cursor: pointer; }
    106 .section.specifics.collapsed, .section.formdescription.collapsed, .section.formfields.collapsed, .section.layout.collapsed, .section.style.collapsed, .section.admin.collapsed, .section.storage.collapsed, .section.submission.collapsed, .section.custom.collapsed, .section.uninstall.collapsed, .section.fields.collapsed, .section.sending.collapsed, .section.success.collapsed, .section.smtp.collapsed, .section.notification.collapsed, .section.auto.collapsed, .section.spam.collapsed, .section.akismet.collapsed, .section.recaptcha.collapsed { font-size: 0; margin: 0; opacity: 0; padding: 0; max-height: 0; overflow: hidden; transition: max-height 0.3s linear, opacity 0.15s, font-size 0.15s, margin .15s, padding .15s; -webkit-transition: max-height 0.3s linear, opacity 0.15s, font-size .15s, margin .15s, padding .15s; -moz-transition: max-height 0.3s linear, opacity 0.15s, font-size .15s, margin .15s, padding .15s; -o-transition: max-height 0.3s linear, opacity 0.15s, font-size .15s, margin .15s, padding .15s; }
    107 .section.formdescription, .section.layout, .section.style, .section.admin, .section.submission, .section.custom, .section.uninstall, .section.sending, .section.success, .section.spam, .section.akismet { max-height: 800px; transition: max-height 0.5s linear, opacity 1.0s, font-size 1.0s, margin 1.0s, padding 1.0s; -webkit-transition: max-height 0.5s linear, opacity 1.0s, font-size 1.0s, margin 1.0s, padding 1.0s; -moz-transition: max-height 0.5s linear, opacity 1.0s, font-size 1.0s, margin 1.0s, padding 1.0s; -o-transition: max-height 0.5s linear, opacity 1.0s, font-size 1.0s, margin 1.0s, padding 1.0s;   }
     106.section.specifics.collapsed, .section.formdescription.collapsed, .section.formfields.collapsed, .section.layout.collapsed, .section.style.collapsed, .section.admin.collapsed, .section.storage.collapsed, .section.submission.collapsed, .section.custom.collapsed, .section.uninstall.collapsed, .section.rules.collapsed, .section.fields.collapsed, .section.sending.collapsed, .section.success.collapsed, .section.smtp.collapsed, .section.notification.collapsed, .section.auto.collapsed, .section.spam.collapsed, .section.akismet.collapsed, .section.recaptcha.collapsed { font-size: 0; margin: 0; opacity: 0; padding: 0; max-height: 0; overflow: hidden; transition: max-height 0.3s linear, opacity 0.15s, font-size 0.15s, margin .15s, padding .15s; -webkit-transition: max-height 0.3s linear, opacity 0.15s, font-size .15s, margin .15s, padding .15s; -moz-transition: max-height 0.3s linear, opacity 0.15s, font-size .15s, margin .15s, padding .15s; -o-transition: max-height 0.3s linear, opacity 0.15s, font-size .15s, margin .15s, padding .15s; }
     107.section.formdescription, .section.layout, .section.style, .section.admin, .section.submission, .section.custom, .section.uninstall, .section.rules, .section.sending, .section.success, .section.spam, .section.akismet { max-height: 800px; transition: max-height 0.5s linear, opacity 1.0s, font-size 1.0s, margin 1.0s, padding 1.0s; -webkit-transition: max-height 0.5s linear, opacity 1.0s, font-size 1.0s, margin 1.0s, padding 1.0s; -moz-transition: max-height 0.5s linear, opacity 1.0s, font-size 1.0s, margin 1.0s, padding 1.0s; -o-transition: max-height 0.5s linear, opacity 1.0s, font-size 1.0s, margin 1.0s, padding 1.0s;   }
    108108.section.specifics, .section.smtp, .section.notification, .section.auto, .section.storage, .section.recaptcha { max-height: 1500px; transition:  max-height 1.25s linear, opacity 1.5s, font-size 1.5s, margin 1.5s, padding 1.5s; }
    109109.section.fields { max-height: 3500px; transition: max-height 1.75s linear, opacity 2.0s, font-size 2.0s, margin 2.0s, padding 2.0s; -webkit-transition: max-height 1.75s linear, opacity 2.0s, font-size 2.0s, margin 2.0s, padding 2.0s; -moz-transition: max-height 1.75s linear, opacity 2.0s, font-size 2.0s, margin 2.0s, padding 2.0s; -o-transition: max-height 1.75s linear, opacity 2.0s, font-size 2.0s, margin 2.0s, padding 2.0s; }
     
    202202form.polar select.sform:focus, form.polar select.sform:hover { color: #53a0de; }
    203203td > p.description { margin-bottom: -2px; letter-spacing: -.6px }
    204 form.default .widgets-page.button, form.default .privacy-setting.button, form.default .settings-page.button, span.default.button.unavailable, #smpt-warnings.default { color: #2271b1; border-color: #2271b1; }
    205 form.light .widgets-page.button,  form.light .privacy-setting.button, form.light .settings-page.button, span.light.button.unavailable, #smpt-warnings.light { color: #04a4cc; border-color: #04a4cc; }
    206 form.modern .widgets-page.button, form.modern .privacy-setting.button, form.modern .settings-page.button, span.modern.button.unavailable, #smpt-warnings.modern { color: #3858e9; border-color: #3858e9; }
    207 form.blue .widgets-page.button, form.blue .privacy-setting.button, form.blue .settings-page.button, span.blue.button.unavailable, #smpt-warnings.blue { color: #096484; border-color: #096484; }
    208 form.coffee .widgets-page.button, form.coffee .privacy-setting.button, form.coffee .settings-page.button, span.coffee.button.unavailable, #smpt-warnings.coffee { color: #2271b1; border-color: #2271b1; }
    209 form.coffee .widgets-page.button:hover, form.coffee .privacy-setting.button:hover, form.coffee .settings-page.button:hover, span.coffee.button.unavailable:hover, #smpt-warnings.coffee:hover { color: #fff; border-color: #59524c; background-color: #59524c; }
    210 form.ectoplasm .widgets-page.button, form.ectoplasm .privacy-setting.button, form.ectoplasm .settings-page.button, span.ectoplasm.button.unavailable, #smpt-warnings.ectoplasm { color: #a3b745; border-color: #a3b745; }
    211 form.ectoplasm .widgets-page.button:hover, form.ectoplasm .privacy-setting.button:hover, form.ectoplasm .settings-page.button:hover, span.ectoplasm.button.unavailable:hover, #smpt-warnings.ectoplasm:hover { color: #829237; border-color: #829237; }
    212 form.midnight .widgets-page.button, form.midnight .privacy-setting.button, form.midnight .settings-page.button, span.midnight.button.unavailable, #smpt-warnings.midnight { color: #e14d43; border-color: #e14d43; }
    213 form.midnight .widgets-page.button:hover, form.midnight .privacy-setting.button:hover, form.midnight .settings-page.button:hover, span.midnight.button.unavailable:hover, #smpt-warnings.midnight:hover { color: #d02c21; border-color: #d02c21; }
    214 form.ocean .widgets-page.button, form.ocean .privacy-setting.button, form.ocean .settings-page.button, span.ocean.button.unavailable, #smpt-warnings.ocean { color: #2271b1; border-color: #2271b1; }
    215 form.ocean .widgets-page.button:hover, form.ocean .privacy-setting.button:hover, form.ocean .settings-page.button:hover, span.ocean.button.unavailable:hover, #smpt-warnings.ocean:hover { color: #fff; border-color: #0a4b78; background-color: #738e96; }
    216 form.sunrise .widgets-page.button, form.sunrise .privacy-setting.button, form.sunrise .settings-page.button, span.sunrise.button.unavailable, #smpt-warnings.sunrise { color: #dd823b; border-color: #dd823b; }
    217 form.foggy .widgets-page.button, form.foggy .privacy-setting.button, form.foggy .settings-page.button, span.foggy.button.unavailable, #smpt-warnings.foggy { color: #72aee6; border-color: #72aee6; }
    218 form.polar .widgets-page.button, form.polar .privacy-setting.button, form.polar .settings-page.button, span.polar.button.unavailable, #smpt-warnings.polar { color: #53a0de; border-color: #53a0de; }
    219 form.polar .widgets-page.button:hover, form.polar .privacy-setting.button:hover, form.polar .settings-page.button:hover, span.polar.button.unavailable:hover, #smpt-warnings.polar:hover  { color: #fff; background-color: #53a0de; }
     204form.default .widgets-page.button, form.default .privacy-setting.button, form.default .settings-page.button, span.default.button.unavailable, #smpt-warnings.default, #deletion-toggle.default { color: #2271b1; border-color: #2271b1; }
     205form.light .widgets-page.button,  form.light .privacy-setting.button, form.light .settings-page.button, span.light.button.unavailable, #smpt-warnings.light, #deletion-toggle.light { color: #04a4cc; border-color: #04a4cc; }
     206form.modern .widgets-page.button, form.modern .privacy-setting.button, form.modern .settings-page.button, span.modern.button.unavailable, #smpt-warnings.modern, #deletion-toggle.modern { color: #3858e9; border-color: #3858e9; }
     207form.blue .widgets-page.button, form.blue .privacy-setting.button, form.blue .settings-page.button, span.blue.button.unavailable, #smpt-warnings.blue, #deletion-toggle.blue { color: #096484; border-color: #096484; }
     208form.coffee .widgets-page.button, form.coffee .privacy-setting.button, form.coffee .settings-page.button, span.coffee.button.unavailable, #smpt-warnings.coffee, #deletion-toggle.coffee { color: #2271b1; border-color: #2271b1; }
     209form.coffee .widgets-page.button:hover, form.coffee .privacy-setting.button:hover, form.coffee .settings-page.button:hover, span.coffee.button.unavailable:hover, #smpt-warnings.coffee:hover, #deletion-toggle.coffee:hover { color: #fff; border-color: #59524c; background-color: #59524c; }
     210form.ectoplasm .widgets-page.button, form.ectoplasm .privacy-setting.button, form.ectoplasm .settings-page.button, span.ectoplasm.button.unavailable, #smpt-warnings.ectoplasm, #deletion-toggle.ectoplasm { color: #a3b745; border-color: #a3b745; }
     211form.ectoplasm .widgets-page.button:hover, form.ectoplasm .privacy-setting.button:hover, form.ectoplasm .settings-page.button:hover, span.ectoplasm.button.unavailable:hover, #smpt-warnings.ectoplasm:hover, #deletion-toggle.ectoplasm:hover { color: #829237; border-color: #829237; }
     212form.midnight .widgets-page.button, form.midnight .privacy-setting.button, form.midnight .settings-page.button, span.midnight.button.unavailable, #smpt-warnings.midnight, #deletion-toggle.midnight { color: #e14d43; border-color: #e14d43; }
     213form.midnight .widgets-page.button:hover, form.midnight .privacy-setting.button:hover, form.midnight .settings-page.button:hover, span.midnight.button.unavailable:hover, #smpt-warnings.midnight:hover, #deletion-toggle.midnight:hover { color: #d02c21; border-color: #d02c21; }
     214form.ocean .widgets-page.button, form.ocean .privacy-setting.button, form.ocean .settings-page.button, span.ocean.button.unavailable, #smpt-warnings.ocean, #deletion-toggle.ocean { color: #2271b1; border-color: #2271b1; }
     215form.ocean .widgets-page.button:hover, form.ocean .privacy-setting.button:hover, form.ocean .settings-page.button:hover, span.ocean.button.unavailable:hover, #smpt-warnings.ocean:hover, #deletion-toggle.ocean:hover { color: #fff; border-color: #0a4b78; background-color: #738e96; }
     216form.sunrise .widgets-page.button, form.sunrise .privacy-setting.button, form.sunrise .settings-page.button, span.sunrise.button.unavailable, #smpt-warnings.sunrise, #deletion-toggle.sunrise { color: #dd823b; border-color: #dd823b; }
     217form.foggy .widgets-page.button, form.foggy .privacy-setting.button, form.foggy .settings-page.button, span.foggy.button.unavailable, #smpt-warnings.foggy, #deletion-toggle.foggy { color: #72aee6; border-color: #72aee6; }
     218form.polar .widgets-page.button, form.polar .privacy-setting.button, form.polar .settings-page.button, span.polar.button.unavailable, #smpt-warnings.polar, #deletion-toggle.polar { color: #53a0de; border-color: #53a0de; }
     219form.polar .widgets-page.button:hover, form.polar .privacy-setting.button:hover, form.polar .settings-page.button:hover, span.polar.button.unavailable:hover, #smpt-warnings.polar:hover, #deletion-toggle.polar:hover  { color: #fff; background-color: #53a0de; }
    220220select.sform:disabled:hover { color: #a7aaad !important; }
    221221.switch-input input:disabled + span { cursor: default; box-shadow: none !important; }
     
    308308
    309309/* Settings page */
    310 #smpt-warnings {margin-top: 15px !important; border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer; }
     310#form-borders { margin-left: 20px; }
     311
     312#smpt-warnings { margin-top: 15px !important; font-size: 13px; text-align: center; float: right; border-radius: 4px; font-weight: 400; cursor: pointer; }
    311313tr.smpt-warnings { background-color: #e4e7ec; }
    312314div.description h4 { margin: 1.3em 0; }
    313315tr.smpt-warnings > td { padding: 18px 41px 30px 36px; vertical-align: none; border-width: 0 0 0 5px; border-style: solid; background: #e5f5fa; border-color: #00a0d2; }
    314316.description pre { white-space: pre-wrap; }
    315 #smpt-warnings { text-align: center; float: right; border-radius: 4px; font-weight: 400; cursor: pointer; }
    316317#smpt-warnings:hover { background: #f0f0f1; }
    317318.notice-toggle { white-space: nowrap; }
     
    327328#empty-submission, #last-submission, #submissions-notice { padding: 30px 30px 50px; margin-top: 20px; background: #fff; }
    328329#empty-submission h3, #last-submission h3, #submissions-notice h3 { line-height: 30px; }
    329 #empty-submission span.dashicons, #last-submission span.dashicons, #submissions-notice span.dashicons { font-size: 30px; width: 30px; height: 30px; padding-right: 10px; }
     330#deletion-notice { padding: 5px 30px 30px; margin-top: 30px; background: #eb8a84; color: #FFF; }
     331#deletion-notice h3 { line-height: 30px; color: #FFF; }
     332#deletion-notice .disclaimer { display: inline-block; padding: 6px 0; width: 60%; }
     333#deletion-notice .delete { display: inline-block; padding: 6px 10px; background: #fff; color: #e35950; border-radius: 5px; cursor: pointer; }
     334#deletion-notice .cancel { margin-right: 20px; }
     335input.delete { font-size: inherit; margin: 0; border: 0; line-height: inherit; }
     336#deletion-toggle { margin-top: 30px; font-size: 13px; font-weight: 600; text-align: center; float: right; border-radius: 4px; font-weight: 400; cursor: pointer; padding: 6px 10px; background: #fff; border-style: solid; border-width: 1px; }
     337#deletion-toggle:hover { background: #f0f0f1; }
     338#deletion-buttons { float: right; width: auto; }
     339@media screen and (max-width: 960px) {
     340#deletion-notice .disclaimer { width: 100%; }
     341#deletion-buttons { width: 100%; text-align: center; float: none; margin: 20px 0 0; }
     342}
     343#empty-submission span.dashicons, #last-submission span.dashicons, #submissions-notice span.dashicons, #deletion-notice span.dashicons { font-size: 30px; width: 30px; height: 30px; padding-right: 10px; }
    330344
    331345/* Support page */
     
    397411@media screen and (max-width: 782px) {
    398412.submissions-list .notice { margin: 20px; }
     413#deletion-toggle { margin: 20px; margin-top: 30px; }
    399414#page-description.overview { padding: 10px 0 !important; margin-left: -10px !important; margin-right: -10px !important; }
    400415#submissions-data li { width: 20%; }
  • simpleform/trunk/admin/css/block-min.css

    r2568608 r2581779  
    1 .d-none{display:none!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important;opacity:0}fieldset:disabled .checkmark,fieldset:disabled button,fieldset:disabled input,fieldset:disabled label{cursor:default!important}.wp-block fieldset:disabled a,fieldset:disabled input{color:inherit}fieldset:disabled a,fieldset:disabled button{pointer-events:none!important}button:disabled{border:none}input[type=checkbox]:disabled{opacity:0}.transparent textarea:disabled,.minimal textarea:disabled{background-color:transparent!important}.edit-post-visual-editor .sform-block-selector-wrap,.sform-block-selector-wrap{background:#545454!important;color:#fff!important}.sform-block-selector-wrap div{text-align:center;justify-content:center}.sform-block-selector-wrap h3{width:100%;margin-bottom:0!important;font-weight:700}.sform-block-selector-wrap img{height:100px;width:auto}span.selector-message{width:100%}.sform-block-selector-wrap select{padding-left:20px!important;height:40px!important}.sform-block-selector-wrap .components-base-control{margin:20px 0 10px}.newform{margin-bottom:24px}.sform-options{padding-bottom:0!important}.titleoptions{height:52px;margin-bottom:24px;margin-top:-5px}.heading-level:first-child{max-width:45%}.heading-alignment:last-child{max-width:45%}.sformbuttons{height:62px;padding:16px;margin:0 -16px;background:#f7f7f7;border-top:1px solid #e0e0e0}.sform-button{height:28px;line-height:22px;padding:3px 7px;font-size:12px}.rangeoptions{margin-bottom:0!important}.heading-level,.sform-button.left{float:left}.heading-alignment,.sform-button.right{float:right}
     1.d-none{display:none!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important;opacity:0}fieldset:disabled .checkmark,fieldset:disabled button,fieldset:disabled input,fieldset:disabled label{cursor:default!important}.wp-block fieldset:disabled a,fieldset:disabled input{color:inherit}fieldset:disabled a,fieldset:disabled button{pointer-events:none!important}button:disabled{border:none}input[type=checkbox]:disabled{opacity:0}.transparent textarea:disabled,.minimal textarea:disabled{background-color:transparent!important}.edit-post-visual-editor .sform-block-selector-wrap,.sform-block-selector-wrap{background:#545454!important;color:#fff!important}.sform-block-selector-wrap div{text-align:center;justify-content:center}.sform-block-selector-wrap h3{width:100%;margin-bottom:0!important;font-weight:700}.sform-block-selector-wrap img{height:100px;width:auto}span.selector-message{width:100%}.sform-block-selector-wrap select{padding-left:20px!important;height:40px!important}.sform-block-selector-wrap .components-base-control{margin:20px 0 10px}.newform{margin-bottom:24px}.sform-options{padding-bottom:0!important}.titleoptions{height:52px;margin-bottom:24px;margin-top:-5px}.heading-level:first-child{max-width:45%}.heading-alignment:last-child{max-width:45%}.sformbuttons{height:62px;padding:16px;margin:0 -16px;background:#f7f7f7;border-top:1px solid #e0e0e0}.sform-button{height:28px;line-height:22px;padding:3px 7px;font-size:12px}.rangeoptions{margin-bottom:0!important}.heading-level,.sform-button.left{float:left}.heading-alignment,.sform-button.right{float:right}#duplication-notice{box-sizing:border-box;cursor:pointer;position:relative;padding:1em;min-height:200px;width:100%;text-align:left;margin:0;color:inherit;-moz-font-smoothing:subpixel-antialiased;-webkit-font-smoothing:subpixel-antialiased;border-radius:2px;background-color:#fff;box-shadow:inset 0 0 0 1px;outline:1px solid transparent}
  • simpleform/trunk/admin/css/block.css

    r2568608 r2581779  
    3030.heading-level, .sform-button.left { float: left; }
    3131.heading-alignment, .sform-button.right { float: right; }
     32
     33#duplication-notice { box-sizing: border-box; cursor: pointer; position: relative; padding: 1em; min-height: 200px; width: 100%; text-align: left; margin: 0; color: inherit; -moz-font-smoothing: subpixel-antialiased; -webkit-font-smoothing: subpixel-antialiased; border-radius: 2px; background-color: #fff; box-shadow: inset 0 0 0 1px; outline: 1px solid transparent; }
  • simpleform/trunk/admin/js/admin-min.js

    r2568608 r2581779  
    1 !function(o){"use strict";o(window).load(function(){o("ul#submissions-data").hover(function(){o("#last-submission").addClass("unseen"),o("#submissions-notice").removeClass("unseen")},function(){o("#last-submission").removeClass("unseen"),o("#submissions-notice").addClass("unseen")}),o("#shortcode-copy").click(function(){event.preventDefault();var e=document.createElement("input");e.style="position: absolute; left: -1000px; top: -1000px",document.body.appendChild(e),e.value=o("#shortcode").text(),e.select(),document.execCommand("copy"),document.body.removeChild(e),o("#shortcode-tooltip").text(ajax_sform_settings_options_object.copied),setTimeout(function(){o("#shortcode-tooltip").hide()},1500)}),o("#shortcode-copy").hover(function(){o("#shortcode-tooltip").text(ajax_sform_settings_options_object.copy),o("#shortcode-tooltip").show()},function(){o("#shortcode-tooltip").hide()}),o("#show-for").change(function(){var e=o(this).val(),e=o(location).attr("href")+"&showfor="+e;document.location.href=e}),o("#name-field").on("change",function(){"hidden"==o("#name-field option:selected").val()?o(".trname").addClass("unseen"):(o(".trname").removeClass("unseen"),1==o("#namelabel").prop("checked")?o("tr.namelabel").addClass("unseen"):o("tr.namelabel").removeClass("unseen"))}),o("#lastname-field").on("change",function(){"hidden"==o("#lastname-field option:selected").val()?o(".trlastname").addClass("unseen"):(o(".trlastname").removeClass("unseen"),1==o("#lastnamelabel").prop("checked")?o("tr.lastnamelabel").addClass("unseen"):o("tr.lastnamelabel").removeClass("unseen"))}),o("#email-field").on("change",function(){"hidden"==o("#email-field option:selected").val()?o(".tremail").addClass("unseen"):(o(".tremail").removeClass("unseen"),1==o("#emaillabel").prop("checked")?o("tr.emaillabel").addClass("unseen"):o("tr.emaillabel").removeClass("unseen"))}),o("#phone-field").on("change",function(){"hidden"==o("#phone-field option:selected").val()?o(".trphone").addClass("unseen"):(o(".trphone").removeClass("unseen"),1==o("#phonelabel").prop("checked")?o("tr.phonelabel").addClass("unseen"):o("tr.phonelabel").removeClass("unseen"))}),o("#subject-field").on("change",function(){"hidden"==o("#subject-field option:selected").val()?o(".trsubject").addClass("unseen"):(o(".trsubject").removeClass("unseen"),1==o("#subjectlabel").prop("checked")?o("tr.subjectlabel").addClass("unseen"):o("tr.subjectlabel").removeClass("unseen"))}),o("#captcha-field").on("change",function(){"hidden"==o("#captcha-field option:selected").val()?o(".trcaptchalabel").addClass("unseen"):o(".trcaptchalabel").removeClass("unseen")}),o("#preference-field").on("change",function(){"hidden"==o("#preference-field option:selected").val()?o(".trpreference").addClass("unseen"):o(".trpreference").removeClass("unseen")}),o("#consent-field").on("change",function(){"hidden"==o("#consent-field option:selected").val()?o(".trconsent").addClass("unseen"):(o(".trconsent").removeClass("unseen"),1==o("#privacy-link").prop("checked")?o(".trpage").removeClass("unseen"):o(".trpage").addClass("unseen"))}),o("#privacy-link").on("click",function(){var e,s=o("#consent-label").val(),t=ajax_sform_settings_options_object.privacy;1==o(this).prop("checked")?o(".trpage").removeClass("unseen"):(o(".trpage").addClass("unseen"),e=new RegExp("<a [^>]*>"+t+"</a>","i"),t=s.replace(e,t),o("#consent-label").val(t),o("#privacy-page").val(""),o("#set-page, #set-page-icon").addClass("unseen"),o("#set-page, #set-page-icon").attr("page",0),o("#post-status").html("&nbsp;"))}),o("#privacy-page").on("change",function(){var e=o(this).val(),s=o("#set-page").attr("page");""!=e?(o("#page-id").val(e),e==s?o("#set-page, #set-page-icon").addClass("unseen"):o("#set-page, #set-page-icon").removeClass("unseen")):(o("#set-page, #set-page-icon").addClass("unseen"),o("#privacy-link").click())}),o("#set-page").click(function(e){o("#label-error").html("");var s=o('textarea[name="consent-label"]').val(),t=o('input[name="page-id"]').val(),a=o('input[name="verification_nonce"]').val();return o.ajax({type:"POST",dataType:"json",url:ajax_sform_settings_options_object.ajaxurl,data:{action:"setting_privacy",verification_nonce:a,"page-id":t,"consent-label":s},success:function(e){!0===e.error&&o("#label-error").html("Error occurred during creation of the link"),!1===e.error&&(o("#consent-label").val(e.label),o("#set-page").addClass("unseen"),o("#set-page").attr("page",t))},error:function(e){o("#label-error").html("Error occurred during creation of the link")}}),e.preventDefault(),!1}),o("#set-page-icon").click(function(e){var s=o('textarea[name="consent-label"]').val(),t=o('input[name="page-id"]').val(),a=o('input[name="verification_nonce"]').val();return o.ajax({type:"POST",dataType:"json",url:ajax_sform_settings_options_object.ajaxurl,data:{action:"setting_privacy",verification_nonce:a,"page-id":t,"consent-label":s},success:function(e){!0===e.error&&o("#label-error-top").html("Error occurred during creation of the link"),!1===e.error&&(o("#consent-label").val(e.label),o("#set-page-icon").addClass("unseen"),o("#set-page-icon").attr("page",t))},error:function(e){o("#label-error-top").html("Error occurred during creation of the link")}}),e.preventDefault(),!1}),o(".field-label").on("click",function(){var e=o(this).attr("id");1==o(this).prop("checked")?o("tr."+e).addClass("unseen"):o("tr."+e).removeClass("unseen")}),o("#required-sign").on("click",function(){1==o(this).prop("checked")?o(".trsign").addClass("unseen"):o(".trsign").removeClass("unseen")}),o("#optional-labelling").on("click",function(){o("#required-word").val()==ajax_sform_settings_options_object.required&&o("#required-word").val(ajax_sform_settings_options_object.optional)}),o("#required-labelling").on("click",function(){o("#required-word").val()==ajax_sform_settings_options_object.optional&&o("#required-word").val(ajax_sform_settings_options_object.required)}),o(".nav-tab").on("click",function(){var e=o(this).attr("id");o(".nav-tab-active").removeClass("nav-tab-active"),o(".navtab").addClass("unseen"),o("#tab-"+e).removeClass("unseen"),o(this).addClass("nav-tab-active"),"appearance"==e?o(".editorpage").text(ajax_sform_settings_options_object.appearance):o(".editorpage").text(ajax_sform_settings_options_object.builder)}),o("#widget-editor").on("click",function(){1==o(this).prop("checked")?o(".trwidget").addClass("unseen"):o(".trwidget").removeClass("unseen")}),o("#form-template").on("change",function(){"customized"==o("#form-template option:selected").val()?o("#template-notice").text(ajax_sform_settings_options_object.notes):o("#template-notice").html("&nbsp;")}),o("#stylesheet").on("click",function(){1==o(this).prop("checked")?o(".trstylesheet").removeClass("unseen"):o(".trstylesheet").addClass("unseen")}),o("#stylesheet-file").on("click",function(){1==o(this).prop("checked")?o("#stylesheet-description").html(ajax_sform_settings_options_object.cssenabled):o("#stylesheet-description").html(ajax_sform_settings_options_object.cssdisabled)}),o("#javascript").on("click",function(){1==o(this).prop("checked")?o("#javascript-description").html(ajax_sform_settings_options_object.jsenabled):o("#javascript-description").html(ajax_sform_settings_options_object.jsdisabled)}),o("#outside-error").on("change",function(){var a=o("#outside-error option:selected").val(),e=o("label#focusout").html();"none"!=a&&o(".out").each(function(e,s){var t,s=o(s);"top"==a&&(t=s.attr("placeholder").replace(ajax_sform_settings_options_object.bottom,ajax_sform_settings_options_object.top)),"bottom"==a&&(t=s.attr("placeholder").replace(ajax_sform_settings_options_object.top,ajax_sform_settings_options_object.bottom)),console.log(s.attr("placeholder")),s.attr("placeholder",t)}),"top"==a?(o("label#focusout").html(e.replace(ajax_sform_settings_options_object.nofocus,ajax_sform_settings_options_object.focusout)),o("#outside-notice").text(ajax_sform_settings_options_object.topnotes),o(".trout").removeClass("removed"),(o("#trcaptcha").hasClass("unseen")?o(".messagecell"):o(".captchacell")).removeClass("last")):"bottom"==a?(o("label#focusout").html(e.replace(ajax_sform_settings_options_object.nofocus,ajax_sform_settings_options_object.focusout)),o("#outside-notice").text(ajax_sform_settings_options_object.bottomnotes),o(".trout").removeClass("removed"),(o("#trcaptcha").hasClass("unseen")?o(".messagecell"):o(".captchacell")).removeClass("last")):(o("label#focusout").html(e.replace(ajax_sform_settings_options_object.focusout,ajax_sform_settings_options_object.nofocus)),o("#outside-notice").html("&nbsp;"),o(".trout").addClass("removed"),(o("#trcaptcha").hasClass("unseen")?o(".messagecell"):o(".captchacell")).addClass("last"))}),o("#characters-length").on("click",function(){1==o(this).prop("checked")?(o("#characters-description").html(ajax_sform_settings_options_object.showcharacters),o("#incomplete-name").val(ajax_sform_settings_options_object.numnamer),o("#incomplete-lastname").val(ajax_sform_settings_options_object.numlster),o("#incomplete-subject").val(ajax_sform_settings_options_object.numsuber),o("#incomplete-message").val(ajax_sform_settings_options_object.nummsger)):(o("#characters-description").html(ajax_sform_settings_options_object.hidecharacters),o("#incomplete-name").val(ajax_sform_settings_options_object.gennamer),o("#incomplete-lastname").val(ajax_sform_settings_options_object.genlster),o("#incomplete-subject").val(ajax_sform_settings_options_object.gensuber),o("#incomplete-message").val(ajax_sform_settings_options_object.genmsger))}),o("#ajax-submission").on("click",function(){1==o(this).prop("checked")?o(".trajax").removeClass("unseen"):o(".trajax").addClass("unseen")}),o("#confirmation-message").on("click",function(){1==o(this).prop("checked")&&(o(".trsuccessmessage").removeClass("unseen"),o(".trsuccessredirect").addClass("unseen"),o("#confirmation-page").val(""),o("#post-status").html("&nbsp;"))}),o("#success-redirect").on("click",function(){1==o(this).prop("checked")&&(o(".trsuccessmessage").addClass("unseen"),o(".trsuccessredirect").removeClass("unseen"))}),o("#confirmation-page, #privacy-page").on("change",function(){var e=o(this).find("option:selected"),s=e.attr("value");"draft"==e.attr("Tag")?o("#post-status").html(ajax_sform_settings_options_object.status+' - <strong><a href="'+ajax_sform_settings_options_object.adminurl+"post.php?post="+s+'&action=edit" target="_blank" style="text-decoration: none; color: #9ccc79;">'+ajax_sform_settings_options_object.publish+"</a></strong>"):""!=s?(e='<strong><a href="'+ajax_sform_settings_options_object.adminurl+"post.php?post="+s+'&action=edit" target="_blank" style="text-decoration: none;">'+ajax_sform_settings_options_object.edit+"</a></strong>",s='<strong><a href="'+ajax_sform_settings_options_object.pageurl+"/?page_id="+s+'" target="_blank" style="text-decoration: none;">'+ajax_sform_settings_options_object.view+"</a></strong>",s=ajax_sform_settings_options_object.pagelinks.replace(ajax_sform_settings_options_object.edit,e).replace(ajax_sform_settings_options_object.view,s),o("#post-status").html(s)):o("#post-status").html("&nbsp;")}),o(".notice-toggle").on("click",function(){o(".smpt-warnings").hasClass("unseen")?(o("#smpt-warnings").text(ajax_sform_settings_options_object.hide),o(".smpt-settings").addClass("unseen"),o(".smpt-warnings").removeClass("unseen")):(o("#smpt-warnings").text(ajax_sform_settings_options_object.show),o("#trsmtpon").removeClass("unseen"),o(".smpt-warnings").addClass("unseen"),1==o("#server-smtp").prop("checked")?(o(".trsmtp").removeClass("unseen"),1==o("#smtp-authentication").prop("checked")?o(".trauthentication").removeClass("unseen"):o(".trauthentication").addClass("unseen")):o(".trsmtp").addClass("unseen"))}),o("#server-smtp").on("click",function(){1==o(this).prop("checked")?(o(".trsmtp").removeClass("unseen"),o("#tdsmtp").removeClass("last"),o("#smtp-notice").text(ajax_sform_settings_options_object.smtpnotes),1==o("#smtp-authentication").prop("checked")?o(".trauthentication").removeClass("unseen"):o(".trauthentication").addClass("unseen")):(o(".trsmtp").addClass("unseen"),o("#tdsmtp").addClass("last"),o("#smtp-notice").text(""))}),o("#smtp-authentication").on("click",function(){1==o(this).prop("checked")?(o("#tdauthentication").removeClass("last"),o(".trauthentication").removeClass("unseen")):(o("#tdauthentication").addClass("last"),o(".trauthentication").addClass("unseen"))}),o("#notification").on("click",function(){1==o(this).prop("checked")?(o(".trnotification").removeClass("unseen"),o("#tdnotification").removeClass("last"),1==o("#custom-name").prop("checked")?o(".trcustomname").removeClass("unseen"):o(".trcustomname").addClass("unseen"),1==o("#default-subject").prop("checked")?o(".trcustomsubject").removeClass("unseen"):o(".trcustomsubject").addClass("unseen")):(o(".trnotification").addClass("unseen"),o("#tdnotification").addClass("last"))}),o("#requester-name").on("click",function(){1==o(this).prop("checked")?o(".trcustomname").addClass("unseen"):o(".trcustomname").removeClass("unseen")}),o("#form-name").on("click",function(){1==o(this).prop("checked")?o(".trcustomname").addClass("unseen"):o(".trcustomname").removeClass("unseen")}),o("#custom-name").on("click",function(){1==o(this).prop("checked")?o(".trcustomname").removeClass("unseen"):o(".trcustomname").addClass("unseen")}),o("#request-subject").on("click",function(){1==o(this).prop("checked")?o(".trcustomsubject").addClass("unseen"):o(".trcustomsubject").removeClass("unseen")}),o("#default-subject").on("click",function(){1==o(this).prop("checked")?o(".trcustomsubject").removeClass("unseen"):o(".trcustomsubject").addClass("unseen")}),o("#autoresponder").on("click",function(){1==o(this).prop("checked")?(o(".trauto").removeClass("unseen"),o("#tdconfirmation").removeClass("last")):(o(".trauto").addClass("unseen"),o("#tdconfirmation").addClass("last"))}),o("#save-settings").click(function(e){o(".message").removeClass("error success unchanged"),o(".message").addClass("seen"),o(".message").html(ajax_sform_settings_options_object.loading);var s=o("form#settings").serialize();return o.ajax({type:"POST",dataType:"json",url:ajax_sform_settings_options_object.ajaxurl,data:s+"&action=sform_edit_options",success:function(e){var s=e.error,t=(e.message,e.update);!0===s&&(o(".message").addClass("error"),o(".message").html(e.message)),!1===s&&(o(".message").html(e.message),!1===t&&o(".message").addClass("unchanged"),!0===t&&o(".message").addClass("success"))},error:function(e){o(".message").html("AJAX call failed")}}),e.preventDefault(),!1}),o(document).on("change","input[type=checkbox], input[type=radio], select",function(){o(".message").removeClass("seen error success unchanged")}),o(document).on("input","input[type=text], input[type=email], textarea",function(){o(".message").removeClass("seen error success unchanged")}),o("#save-attributes").click(function(e){o(".message").removeClass("error success unchanged"),o(".message").addClass("seen"),o(".message").text(ajax_sform_settings_options_object.saving);var s=o("form#attributes").serialize();return o.ajax({type:"POST",dataType:"json",url:ajax_sform_settings_options_object.ajaxurl,data:s+"&action=shortcode_costruction",success:function(e){var s=e.error,t=(e.message,e.update),a=e.redirect,n=e.url;!0===s&&(o(".message").addClass("error"),o(".message").html(e.message)),!1===s&&(o(".message").html(e.message),!1===t&&o(".message").addClass("unchanged"),!0===t&&(!0===a?document.location.href=n:o(".message").addClass("success")))},error:function(e){o(".message").html("AJAX call failed")}}),e.preventDefault(),!1}),o(document).on("change",".sform-target",function(){var e=o(this).val(),s=o(this).attr("field");"in"===e?o("p#usertype.role-"+s).removeClass("unseen"):o("p#usertype.role-"+s).addClass("unseen")}),o(document).on("change",".sfwidget",function(){var e=o(this).attr("box"),s=o(this).val();"all"===s?(o("div#sform-widget-hidden-pages."+e).addClass("unseen"),o("div#sform-widget-visible-pages."+e).addClass("unseen"),o("p#visibility-notes").removeClass("unseen"),o("p#visibility").addClass("visibility")):(o("p#visibility-notes").addClass("unseen"),o("p#visibility").removeClass("visibility"),"hidden"===s?(o("div#sform-widget-hidden-pages."+e).removeClass("unseen"),o("div#sform-widget-visible-pages."+e).addClass("unseen")):(o("div#sform-widget-hidden-pages."+e).addClass("unseen"),o("div#sform-widget-visible-pages."+e).removeClass("unseen")))}),o("#form").change(function(){var e=o(this).val(),s=o(location).attr("href"),t=new URLSearchParams(s),a=t.get("form");s=-1<s.indexOf("form=")?e?s.replace("&form="+a,"&form="+e):s.replace("&form="+a,""):e?s+"&form="+e:s;t=t.get("paged");s=-1<s.indexOf("paged=")?s.replace("&paged="+t,""):s,document.location.href=s}),o(".cbfield").on("click",function(){var e=o(this).attr("field");1==o(this).prop("checked")?o(".tr"+e).addClass("secret"):(o(".tr"+e).removeClass("secret"),1==o("#"+e+"label").prop("checked")?o("tr."+e+"label").addClass("unseen"):o("tr."+e+"label").removeClass("unseen"))}),o("#admin-notices").on("click",function(){1==o(this).prop("checked")?o(".admin-notices").addClass("invisible"):o(".admin-notices").removeClass("invisible")}),o("#duplicate").on("click",function(){1==o(this).prop("checked")?o(".trduplicate").removeClass("unseen"):o(".trduplicate").addClass("unseen")}),o(".sform-switch").on("click",function(){0==o(this).prop("checked")?o(this).val("false"):o(this).val("true")}),o("#admin-color").on("change",function(e){var s=o(this).val(),t=o("#settings").attr("class"),a=o('input[name="verification_nonce"]').val();return o.ajax({type:"POST",dataType:"json",url:ajax_sform_settings_options_object.ajaxurl,data:{action:"admin_color_scheme",verification_nonce:a,"admin-color":s},success:function(e){e.error;var s=e.color;!0===e.error&&o("#label-error").html("Error occurred during creation of the link"),!1===e.error&&(o(".full-width-bar, h1.title, select#form, .form-button, #settings, #smpt-warnings, .icon-button").removeClass(t),o(".full-width-bar, h1.title, select#form, .form-button, #settings, #smpt-warnings, .icon-button").addClass(s))},error:function(e){o("#label-error").html("Error occurred during creation of the link")}}),e.preventDefault(),!1}),o("span.heading").on("click",function(){var e=o(this).attr("section");o(".section."+e).toggleClass("collapsed"),o(".section."+e).hasClass("collapsed")?(o("span.toggle."+e).removeClass("dashicons-arrow-up-alt2"),o("span.toggle."+e).addClass("dashicons-arrow-down-alt2"),o("#h2-"+e).addClass("closed")):(o("span.toggle."+e).removeClass("dashicons-arrow-down-alt2"),o("span.toggle."+e).addClass("dashicons-arrow-up-alt2"),o("#h2-"+e).removeClass("closed"))})})}(jQuery);
     1!function(o){"use strict";o(window).load(function(){o("ul#submissions-data").hover(function(){o("#last-submission").addClass("unseen"),o("#submissions-notice").removeClass("unseen")},function(){o("#last-submission").removeClass("unseen"),o("#submissions-notice").addClass("unseen")}),o("#shortcode-copy").click(function(){event.preventDefault();var e=document.createElement("input");e.style="position: absolute; left: -1000px; top: -1000px",document.body.appendChild(e),e.value=o("#shortcode").text(),e.select(),document.execCommand("copy"),document.body.removeChild(e),o("#shortcode-tooltip").text(ajax_sform_settings_options_object.copied),setTimeout(function(){o("#shortcode-tooltip").hide()},1500)}),o("#shortcode-copy").hover(function(){o("#shortcode-tooltip").text(ajax_sform_settings_options_object.copy),o("#shortcode-tooltip").show()},function(){o("#shortcode-tooltip").hide()}),o("#show-for").change(function(){var e=o(this).val(),e=o(location).attr("href")+"&showfor="+e;document.location.href=e}),o("#name-field").on("change",function(){"hidden"==o("#name-field option:selected").val()?o(".trname").addClass("unseen"):(o(".trname").removeClass("unseen"),1==o("#namelabel").prop("checked")?o("tr.namelabel").addClass("unseen"):o("tr.namelabel").removeClass("unseen"))}),o("#lastname-field").on("change",function(){"hidden"==o("#lastname-field option:selected").val()?o(".trlastname").addClass("unseen"):(o(".trlastname").removeClass("unseen"),1==o("#lastnamelabel").prop("checked")?o("tr.lastnamelabel").addClass("unseen"):o("tr.lastnamelabel").removeClass("unseen"))}),o("#email-field").on("change",function(){"hidden"==o("#email-field option:selected").val()?o(".tremail").addClass("unseen"):(o(".tremail").removeClass("unseen"),1==o("#emaillabel").prop("checked")?o("tr.emaillabel").addClass("unseen"):o("tr.emaillabel").removeClass("unseen"))}),o("#phone-field").on("change",function(){"hidden"==o("#phone-field option:selected").val()?o(".trphone").addClass("unseen"):(o(".trphone").removeClass("unseen"),1==o("#phonelabel").prop("checked")?o("tr.phonelabel").addClass("unseen"):o("tr.phonelabel").removeClass("unseen"))}),o("#subject-field").on("change",function(){"hidden"==o("#subject-field option:selected").val()?o(".trsubject").addClass("unseen"):(o(".trsubject").removeClass("unseen"),1==o("#subjectlabel").prop("checked")?o("tr.subjectlabel").addClass("unseen"):o("tr.subjectlabel").removeClass("unseen"))}),o("#captcha-field").on("change",function(){"hidden"==o("#captcha-field option:selected").val()?o(".trcaptchalabel").addClass("unseen"):o(".trcaptchalabel").removeClass("unseen")}),o("#preference-field").on("change",function(){"hidden"==o("#preference-field option:selected").val()?o(".trpreference").addClass("unseen"):o(".trpreference").removeClass("unseen")}),o("#consent-field").on("change",function(){"hidden"==o("#consent-field option:selected").val()?o(".trconsent").addClass("unseen"):(o(".trconsent").removeClass("unseen"),1==o("#privacy-link").prop("checked")?o(".trpage").removeClass("unseen"):o(".trpage").addClass("unseen"))}),o("#privacy-link").on("click",function(){var e,s=o("#consent-label").val(),t=ajax_sform_settings_options_object.privacy;1==o(this).prop("checked")?o(".trpage").removeClass("unseen"):(o(".trpage").addClass("unseen"),e=new RegExp("<a [^>]*>"+t+"</a>","i"),t=s.replace(e,t),o("#consent-label").val(t),o("#privacy-page").val(""),o("#set-page, #set-page-icon").addClass("unseen"),o("#set-page, #set-page-icon").attr("page",0),o("#post-status").html("&nbsp;"))}),o("#privacy-page").on("change",function(){var e=o(this).val(),s=o("#set-page").attr("page");""!=e?(o("#page-id").val(e),e==s?o("#set-page, #set-page-icon").addClass("unseen"):o("#set-page, #set-page-icon").removeClass("unseen")):(o("#set-page, #set-page-icon").addClass("unseen"),o("#privacy-link").click())}),o("#set-page").click(function(e){o("#label-error").html("");var s=o('textarea[name="consent-label"]').val(),t=o('input[name="page-id"]').val(),n=o('input[name="verification_nonce"]').val();return o.ajax({type:"POST",dataType:"json",url:ajax_sform_settings_options_object.ajaxurl,data:{action:"setting_privacy",verification_nonce:n,"page-id":t,"consent-label":s},success:function(e){!0===e.error&&o("#label-error").html("Error occurred during creation of the link"),!1===e.error&&(o("#consent-label").val(e.label),o("#set-page").addClass("unseen"),o("#set-page").attr("page",t))},error:function(e){o("#label-error").html("Error occurred during creation of the link")}}),e.preventDefault(),!1}),o("#set-page-icon").click(function(e){var s=o('textarea[name="consent-label"]').val(),t=o('input[name="page-id"]').val(),n=o('input[name="verification_nonce"]').val();return o.ajax({type:"POST",dataType:"json",url:ajax_sform_settings_options_object.ajaxurl,data:{action:"setting_privacy",verification_nonce:n,"page-id":t,"consent-label":s},success:function(e){!0===e.error&&o("#label-error-top").html("Error occurred during creation of the link"),!1===e.error&&(o("#consent-label").val(e.label),o("#set-page-icon").addClass("unseen"),o("#set-page-icon").attr("page",t))},error:function(e){o("#label-error-top").html("Error occurred during creation of the link")}}),e.preventDefault(),!1}),o(".field-label").on("click",function(){var e=o(this).attr("id");1==o(this).prop("checked")?o("tr."+e).addClass("unseen"):o("tr."+e).removeClass("unseen")}),o("#required-sign").on("click",function(){1==o(this).prop("checked")?o(".trsign").addClass("unseen"):o(".trsign").removeClass("unseen")}),o("#optional-labelling").on("click",function(){o("#required-word").val()==ajax_sform_settings_options_object.required&&o("#required-word").val(ajax_sform_settings_options_object.optional)}),o("#required-labelling").on("click",function(){o("#required-word").val()==ajax_sform_settings_options_object.optional&&o("#required-word").val(ajax_sform_settings_options_object.required)}),o(".nav-tab").on("click",function(){var e=o(this).attr("id");o(".nav-tab-active").removeClass("nav-tab-active"),o(".navtab").addClass("unseen"),o("#tab-"+e).removeClass("unseen"),o(this).addClass("nav-tab-active"),"appearance"==e?o(".editorpage").text(ajax_sform_settings_options_object.appearance):o(".editorpage").text(ajax_sform_settings_options_object.builder)}),o("#widget-editor").on("click",function(){1==o(this).prop("checked")?o(".trwidget").addClass("unseen"):o(".trwidget").removeClass("unseen")}),o("#form-template").on("change",function(){var e=o("#form-template option:selected").val();"transparent"==e?o("#form-borders").removeClass("unseen"):o("#form-borders").addClass("unseen"),"customized"==e?o("#template-notice").text(ajax_sform_settings_options_object.notes):o("#template-notice").html("&nbsp;")}),o("#stylesheet").on("click",function(){1==o(this).prop("checked")?o(".trstylesheet").removeClass("unseen"):o(".trstylesheet").addClass("unseen")}),o("#stylesheet-file").on("click",function(){1==o(this).prop("checked")?o("#stylesheet-description").html(ajax_sform_settings_options_object.cssenabled):o("#stylesheet-description").html(ajax_sform_settings_options_object.cssdisabled)}),o("#javascript").on("click",function(){1==o(this).prop("checked")?o("#javascript-description").html(ajax_sform_settings_options_object.jsenabled):o("#javascript-description").html(ajax_sform_settings_options_object.jsdisabled)}),o("#outside-error").on("change",function(){var n=o("#outside-error option:selected").val(),e=o("label#focusout").html();"none"!=n&&o(".out").each(function(e,s){var t,s=o(s);"top"==n&&(t=s.attr("placeholder").replace(ajax_sform_settings_options_object.bottom,ajax_sform_settings_options_object.top)),"bottom"==n&&(t=s.attr("placeholder").replace(ajax_sform_settings_options_object.top,ajax_sform_settings_options_object.bottom)),console.log(s.attr("placeholder")),s.attr("placeholder",t)}),"top"==n?(o("label#focusout").html(e.replace(ajax_sform_settings_options_object.nofocus,ajax_sform_settings_options_object.focusout)),o("#outside-notice").text(ajax_sform_settings_options_object.topnotes),o(".trout").removeClass("removed"),(o("#trcaptcha").hasClass("unseen")?o(".messagecell"):o(".captchacell")).removeClass("last")):"bottom"==n?(o("label#focusout").html(e.replace(ajax_sform_settings_options_object.nofocus,ajax_sform_settings_options_object.focusout)),o("#outside-notice").text(ajax_sform_settings_options_object.bottomnotes),o(".trout").removeClass("removed"),(o("#trcaptcha").hasClass("unseen")?o(".messagecell"):o(".captchacell")).removeClass("last")):(o("label#focusout").html(e.replace(ajax_sform_settings_options_object.focusout,ajax_sform_settings_options_object.nofocus)),o("#outside-notice").html("&nbsp;"),o(".trout").addClass("removed"),(o("#trcaptcha").hasClass("unseen")?o(".messagecell"):o(".captchacell")).addClass("last"))}),o("#characters-length").on("click",function(){1==o(this).prop("checked")?(o("#characters-description").html(ajax_sform_settings_options_object.showcharacters),o("#incomplete-name").val(ajax_sform_settings_options_object.numnamer),o("#incomplete-lastname").val(ajax_sform_settings_options_object.numlster),o("#incomplete-subject").val(ajax_sform_settings_options_object.numsuber),o("#incomplete-message").val(ajax_sform_settings_options_object.nummsger)):(o("#characters-description").html(ajax_sform_settings_options_object.hidecharacters),o("#incomplete-name").val(ajax_sform_settings_options_object.gennamer),o("#incomplete-lastname").val(ajax_sform_settings_options_object.genlster),o("#incomplete-subject").val(ajax_sform_settings_options_object.gensuber),o("#incomplete-message").val(ajax_sform_settings_options_object.genmsger))}),o("#ajax-submission").on("click",function(){1==o(this).prop("checked")?o(".trajax").removeClass("unseen"):o(".trajax").addClass("unseen")}),o("#confirmation-message").on("click",function(){1==o(this).prop("checked")&&(o(".trsuccessmessage").removeClass("unseen"),o(".trsuccessredirect").addClass("unseen"),o("#confirmation-page").val(""),o("#post-status").html("&nbsp;"))}),o("#success-redirect").on("click",function(){1==o(this).prop("checked")&&(o(".trsuccessmessage").addClass("unseen"),o(".trsuccessredirect").removeClass("unseen"))}),o("#confirmation-page, #privacy-page").on("change",function(){var e=o(this).find("option:selected"),s=e.attr("value");"draft"==e.attr("Tag")?o("#post-status").html(ajax_sform_settings_options_object.status+' - <strong><a href="'+ajax_sform_settings_options_object.adminurl+"post.php?post="+s+'&action=edit" target="_blank" style="text-decoration: none; color: #9ccc79;">'+ajax_sform_settings_options_object.publish+"</a></strong>"):""!=s?(e='<strong><a href="'+ajax_sform_settings_options_object.adminurl+"post.php?post="+s+'&action=edit" target="_blank" style="text-decoration: none;">'+ajax_sform_settings_options_object.edit+"</a></strong>",s='<strong><a href="'+ajax_sform_settings_options_object.pageurl+"/?page_id="+s+'" target="_blank" style="text-decoration: none;">'+ajax_sform_settings_options_object.view+"</a></strong>",s=ajax_sform_settings_options_object.pagelinks.replace(ajax_sform_settings_options_object.edit,e).replace(ajax_sform_settings_options_object.view,s),o("#post-status").html(s)):o("#post-status").html("&nbsp;")}),o(".notice-toggle").on("click",function(){o(".smpt-warnings").hasClass("unseen")?(o("#smpt-warnings").text(ajax_sform_settings_options_object.hide),o(".smpt-settings").addClass("unseen"),o(".smpt-warnings").removeClass("unseen")):(o("#smpt-warnings").text(ajax_sform_settings_options_object.show),o("#trsmtpon").removeClass("unseen"),o(".smpt-warnings").addClass("unseen"),1==o("#server-smtp").prop("checked")?(o(".trsmtp").removeClass("unseen"),1==o("#smtp-authentication").prop("checked")?o(".trauthentication").removeClass("unseen"):o(".trauthentication").addClass("unseen")):o(".trsmtp").addClass("unseen"))}),o("#server-smtp").on("click",function(){1==o(this).prop("checked")?(o(".trsmtp").removeClass("unseen"),o("#tdsmtp").removeClass("last"),o("#smtp-notice").text(ajax_sform_settings_options_object.smtpnotes),1==o("#smtp-authentication").prop("checked")?o(".trauthentication").removeClass("unseen"):o(".trauthentication").addClass("unseen")):(o(".trsmtp").addClass("unseen"),o("#tdsmtp").addClass("last"),o("#smtp-notice").text(""))}),o("#smtp-authentication").on("click",function(){1==o(this).prop("checked")?(o("#tdauthentication").removeClass("last"),o(".trauthentication").removeClass("unseen")):(o("#tdauthentication").addClass("last"),o(".trauthentication").addClass("unseen"))}),o("#notification").on("click",function(){1==o(this).prop("checked")?(o(".trnotification").removeClass("unseen"),o("#tdnotification").removeClass("last"),1==o("#custom-name").prop("checked")?o(".trcustomname").removeClass("unseen"):o(".trcustomname").addClass("unseen"),1==o("#default-subject").prop("checked")?o(".trcustomsubject").removeClass("unseen"):o(".trcustomsubject").addClass("unseen")):(o(".trnotification").addClass("unseen"),o("#tdnotification").addClass("last"))}),o("#requester-name").on("click",function(){1==o(this).prop("checked")?o(".trcustomname").addClass("unseen"):o(".trcustomname").removeClass("unseen")}),o("#form-name").on("click",function(){1==o(this).prop("checked")?o(".trcustomname").addClass("unseen"):o(".trcustomname").removeClass("unseen")}),o("#custom-name").on("click",function(){1==o(this).prop("checked")?o(".trcustomname").removeClass("unseen"):o(".trcustomname").addClass("unseen")}),o("#request-subject").on("click",function(){1==o(this).prop("checked")?o(".trcustomsubject").addClass("unseen"):o(".trcustomsubject").removeClass("unseen")}),o("#default-subject").on("click",function(){1==o(this).prop("checked")?o(".trcustomsubject").removeClass("unseen"):o(".trcustomsubject").addClass("unseen")}),o("#autoresponder").on("click",function(){1==o(this).prop("checked")?(o(".trauto").removeClass("unseen"),o("#tdconfirmation").removeClass("last")):(o(".trauto").addClass("unseen"),o("#tdconfirmation").addClass("last"))}),o("#save-settings").click(function(e){o(".message").removeClass("error success unchanged"),o(".message").addClass("seen"),o(".message").html(ajax_sform_settings_options_object.loading);var s=o("form#settings").serialize();return o.ajax({type:"POST",dataType:"json",url:ajax_sform_settings_options_object.ajaxurl,data:s+"&action=sform_edit_options",success:function(e){var s=e.error,t=(e.message,e.update);!0===s&&(o(".message").addClass("error"),o(".message").html(e.message)),!1===s&&(o(".message").html(e.message),!1===t&&o(".message").addClass("unchanged"),!0===t&&o(".message").addClass("success"))},error:function(e){o(".message").html("AJAX call failed")}}),e.preventDefault(),!1}),o(document).on("change","input[type=checkbox], input[type=radio], select",function(){o(".message").removeClass("seen error success unchanged")}),o(document).on("input","input[type=text], input[type=email], textarea",function(){o(".message").removeClass("seen error success unchanged")}),o("#save-attributes").click(function(e){o(".message").removeClass("error success unchanged"),o(".message").addClass("seen"),o(".message").text(ajax_sform_settings_options_object.saving);var s=o("form#attributes").serialize();return o.ajax({type:"POST",dataType:"json",url:ajax_sform_settings_options_object.ajaxurl,data:s+"&action=shortcode_costruction",success:function(e){var s=e.error,t=(e.message,e.update),n=e.redirect,a=e.url;!0===s&&(o(".message").addClass("error"),o(".message").html(e.message)),!1===s&&(o(".message").html(e.message),!1===t&&o(".message").addClass("unchanged"),!0===t&&(!0===n?document.location.href=a:o(".message").addClass("success")))},error:function(e){o(".message").html("AJAX call failed")}}),e.preventDefault(),!1}),o(document).on("change",".sform-target",function(){var e=o(this).val(),s=o(this).attr("field");"in"===e?o("p#usertype.role-"+s).removeClass("unseen"):o("p#usertype.role-"+s).addClass("unseen")}),o(document).on("change",".sfwidget",function(){var e=o(this).attr("box"),s=o(this).val();"all"===s?(o("div#sform-widget-hidden-pages."+e).addClass("unseen"),o("div#sform-widget-visible-pages."+e).addClass("unseen"),o("p#visibility-notes").removeClass("unseen"),o("p#visibility").addClass("visibility")):(o("p#visibility-notes").addClass("unseen"),o("p#visibility").removeClass("visibility"),"hidden"===s?(o("div#sform-widget-hidden-pages."+e).removeClass("unseen"),o("div#sform-widget-visible-pages."+e).addClass("unseen")):(o("div#sform-widget-hidden-pages."+e).addClass("unseen"),o("div#sform-widget-visible-pages."+e).removeClass("unseen")))}),o("#form").change(function(){var e=o(this).val(),s=o(location).attr("href"),t=new URLSearchParams(s),n=t.get("form");s=-1<s.indexOf("form=")?e?s.replace("&form="+n,"&form="+e):s.replace("&form="+n,""):e?s+"&form="+e:s;t=t.get("paged");s=-1<s.indexOf("paged=")?s.replace("&paged="+t,""):s,document.location.href=s}),o(".cbfield").on("click",function(){var e=o(this).attr("field");1==o(this).prop("checked")?o(".tr"+e).addClass("secret"):(o(".tr"+e).removeClass("secret"),1==o("#"+e+"label").prop("checked")?o("tr."+e+"label").addClass("unseen"):o("tr."+e+"label").removeClass("unseen"))}),o("#admin-notices").on("click",function(){1==o(this).prop("checked")?o(".admin-notices").addClass("invisible"):o(".admin-notices").removeClass("invisible")}),o("#duplicate").on("click",function(){1==o(this).prop("checked")?o(".trduplicate").removeClass("unseen"):o(".trduplicate").addClass("unseen")}),o(".sform-switch").on("click",function(){0==o(this).prop("checked")?o(this).val("false"):o(this).val("true")}),o("#admin-color").on("change",function(e){var s=o(this).val(),t=o("#settings").attr("class"),n=o('input[name="verification_nonce"]').val();return o.ajax({type:"POST",dataType:"json",url:ajax_sform_settings_options_object.ajaxurl,data:{action:"admin_color_scheme",verification_nonce:n,"admin-color":s},success:function(e){e.error;var s=e.color;!0===e.error&&o("#label-error").html("Error occurred during creation of the link"),!1===e.error&&(o(".full-width-bar, h1.title, select#form, .form-button, #settings, #smpt-warnings, .icon-button").removeClass(t),o(".full-width-bar, h1.title, select#form, .form-button, #settings, #smpt-warnings, .icon-button").addClass(s))},error:function(e){o("#label-error").html("Error occurred during creation of the link")}}),e.preventDefault(),!1}),o("span.heading").on("click",function(){var e=o(this).attr("section");o(".section."+e).toggleClass("collapsed"),o(".section."+e).hasClass("collapsed")?(o("span.toggle."+e).removeClass("dashicons-arrow-up-alt2"),o("span.toggle."+e).addClass("dashicons-arrow-down-alt2"),o("#h2-"+e).addClass("closed")):(o("span.toggle."+e).removeClass("dashicons-arrow-down-alt2"),o("span.toggle."+e).addClass("dashicons-arrow-up-alt2"),o("#h2-"+e).removeClass("closed"))}),o("#deletion-toggle, .cancel.delete").on("click",function(){o("#deletion-notice").hasClass("unseen")?(o("#deletion-toggle").addClass("unseen"),o("#deletion-notice").removeClass("unseen")):(o("#deletion-toggle").removeClass("unseen"),o("#deletion-notice").addClass("unseen"))}),o("#deletion-confirm").click(function(e){var s=o("form#deletion").serialize();return o.ajax({type:"POST",dataType:"json",url:ajax_sform_settings_options_object.ajaxurl,data:s+"&action=sform_delete_form",success:function(e){e.error;var s=e.message,t=e.redirect_url;!0===e.error&&o(".disclaimer").html(s),!1===e.error&&(o(".disclaimer").html(s),o("#deletion-buttons").addClass("unseen"),setTimeout(function(){document.location.href=t},1500))},error:function(e){o(".disclaimer").html("AJAX call failed")}}),e.preventDefault(),!1})})}(jQuery);
  • simpleform/trunk/admin/js/admin.js

    r2568608 r2581779  
    274274       $('#form-template').on('change', function () {
    275275          var selectVal = $("#form-template option:selected").val();
     276          if ( selectVal == 'transparent' ) { $("#form-borders").removeClass('unseen'); }
     277          else { $("#form-borders").addClass('unseen'); }
    276278          if ( selectVal == 'customized' ) { $("#template-notice").text(ajax_sform_settings_options_object.notes); }
    277           else { $("#template-notice").html('&nbsp;'); }       
     279          else { $("#template-notice").html('&nbsp;'); }
    278280       });         
    279281       
     
    734736          }
    735737       });
    736 
     738       
     739       $("#deletion-toggle, .cancel.delete").on("click", function() {
     740         if( $('#deletion-notice').hasClass('unseen') ) {
     741             $('#deletion-toggle').addClass('unseen');
     742             $('#deletion-notice').removeClass('unseen');
     743         }
     744         else {
     745           $('#deletion-toggle').removeClass('unseen');
     746           $('#deletion-notice').addClass('unseen');
     747         }
     748       });
     749   
     750       $('#deletion-confirm').click(function(e){
     751         var formData = $('form#deletion').serialize();
     752         $.ajax({
     753            type: 'POST',
     754            dataType: 'json',
     755            url: ajax_sform_settings_options_object.ajaxurl,
     756            data: formData + '&action=sform_delete_form',
     757            success: function(data){
     758              var error = data['error'];
     759              var message = data['message'];
     760              var redirect_url = data['redirect_url'];
     761              if( data.error === true ){
     762                $('.disclaimer').html(message);
     763              }
     764              if( data.error === false ){               
     765                $('.disclaimer').html(message);
     766                $('#deletion-buttons').addClass('unseen');
     767                setTimeout(function(){ document.location.href = redirect_url; }, 1500);
     768              }
     769            },
     770            error: function(data){
     771                $('.disclaimer').html('AJAX call failed');
     772            }   
     773          });
     774          e.preventDefault();
     775          return false;
     776       });
     777       
    737778     });
    738779
  • simpleform/trunk/admin/js/block-min.js

    r2568608 r2581779  
    1 !function(){var O=wp.element.createElement,e=wp.blocks.registerBlockType,F=wp.blockEditor.InspectorControls,x=wp.blockEditor.useBlockProps,{SelectControl:H,ToggleControl:D,Placeholder:B,Button:T,RangeControl:A}=wp.components,t=O("svg",{width:32,height:32,viewBox:"0 0 180 180",className:"dashicon"},O("path",{fill:"currentColor",d:"M96.326,111.597c0-18.193-0.167-36.391,0.053-54.58 c0.188-15.525,3.512-29.949,12.957-41.421c9.567-11.622,21.017-11.457,30.737-0.01c7.372,8.682,10.607,19.568,12.215,31.381 c0.732,5.379,0.851,10.786,0.849,16.214c-0.011,29.197-0.002,58.396-0.007,87.595c-0.002,6.48-4.014,10.405-9.378,9.323 c-1.924-0.389-1.816-2.022-1.926-3.624c-0.695-10.047-0.688-10.011-8.982-7.314c-6.804,2.212-13.586,4.543-20.463,6.387 c-3.582,0.962-5.123,2.99-4.787,7.271c0.146,1.889,0.034,3.815-0.05,5.717c-0.121,2.802-1.362,4.579-3.627,5.479 c-6.666,2.648-7.592,1.872-7.592-6.516C96.325,148.864,96.325,130.23,96.326,111.597z"}),O("path",{fill:"currentColor",d:"M27.769,107.198c0-15.412-0.03-30.824,0.006-46.234 c0.066-28.643,17.508-50.748,41.681-53.416c10.049-1.108,20.08-0.48,30.118-0.75c0.936-0.025,2.139-0.439,2.631,0.961 c0.478,1.368-0.575,2.092-1.229,2.922c-0.76,0.967-1.845,1.741-2.281,2.873c-2.752,7.121-7.72,7.832-13.544,7.427 c-6.419-0.445-12.871-0.373-19.217,1.558C49.624,27.498,38.989,43.42,39.058,63.261c0.029,8.499,0.51,16.996,0.485,25.493 c-0.039,13.634-0.362,27.268-0.496,40.901c-0.065,6.679,1.043,7.76,6.557,8.476c12.062,1.562,24.085,3.49,36.146,5.019 c3.442,0.438,4.282,2.441,4.271,6.104c-0.025,9.025-0.132,8.982-7.748,7.741c-11.527-1.878-23.107-3.308-34.656-5.002 c-3.365-0.496-4.713,0.846-4.562,5.06c0.346,9.731,0.213,8.388-7.725,7.188c-2.969-0.446-3.621-2.725-3.603-5.963 C27.816,141.25,27.769,124.225,27.769,107.198z"}),O("path",{fill:"currentColor",d:"M75.697,51.212c-5.191-0.897-10.416-0.479-15.628-0.553 c-2.054-0.029-2.659-0.985-2.13-3.342c1.504-6.724,6.782-12.072,12.691-12.477c3.083-0.211,6.184-0.019,9.271-0.12 c1.641-0.054,1.945,0.99,1.602,2.487c-0.899,3.906-1.4,7.864-1.404,11.914c-0.002,1.369-0.648,2.056-1.787,2.086 C77.44,51.23,76.568,51.212,75.697,51.212z"}),O("path",{fill:"#FFF",d:"M73.535,48.245c-3.321-0.574-6.665-0.307-10.001-0.354 c-1.313-0.019-1.702-0.63-1.362-2.139c0.963-4.303,4.34-7.726,8.121-7.986c1.975-0.135,3.959-0.012,5.936-0.076 c1.049-0.035,1.244,0.633,1.024,1.592c-0.577,2.5-0.897,5.033-0.899,7.625c0,0.875-0.414,1.316-1.144,1.335 C74.651,48.256,74.094,48.245,73.535,48.245z"}));e("simpleform/form-selector",{title:sformblock.blocktitle,description:sformblock.blockdescription,icon:t,category:"widgets",attributes:{displayTitle:{type:"boolean"},formDescription:{type:"boolean"},formEnding:{type:"boolean"},formId:{type:"string"},optionNew:{type:"string"},formOptions:{type:"string"},titleOptions:{type:"string"},titleHeading:{type:"string"},titleAlignment:{type:"string"},displayDescription:{type:"string"},displayEnding:{type:"string"},imgUrl:{type:"string",default:sformblock.img},preview:{type:"boolean",default:!1},anchor:{type:"string"},topMargin:{type:"integer"},rightMargin:{type:"integer"},bottomMargin:{type:"integer"},leftMargin:{type:"integer"},topPadding:{type:"integer"},rightPadding:{type:"integer"},bottomPadding:{type:"integer"},leftPadding:{type:"integer"}},example:{attributes:{preview:!0}},supports:{multiple:!0,anchor:!0},edit:function(e){const{attributes:{formId:t="",optionNew:o="visible",formOptions:n="d-none",displayTitle:i=!1,titleOptions:l="d-none",titleHeading:a="h4",titleAlignment:r="left",displayDescription:s="d-none",formDescription:c=!1,displayEnding:m="d-none",formEnding:g=!1,imgUrl:p=sformblock.img,preview:d=!1,topMargin:b=0,rightMargin:f=0,bottomMargin:h=0,leftMargin:u=0,topPadding:v=0,rightPadding:k=0,bottomPadding:w=0,leftPadding:y=0},setAttributes:C}=e;if(d)return O("div",{},O("img",{src:sformblock.preview},null));var N=sformblock.forms.map(function(e){return{label:e.name,value:e.id}});function I(e){C({formId:e}),""!=e?(C({formOptions:"visible",optionNew:"d-none"}),i?C({titleOptions:"visible"}):C({titleOptions:"d-none"})):C({formOptions:"d-none",titleOptions:"d-none",optionNew:"visible"})}var P=sformblock.above,e=sformblock.below;function M(e){return e===t}0!==P.length&&P.find(M)?C({displayDescription:"visible"}):C({displayDescription:"d-none"}),0!==e.length&&e.find(M)?C({displayEnding:"visible"}):C({displayEnding:"d-none"});const E=new URLSearchParams(window.location.search);e=E.get("post"),e=[O(F,{},O(wp.components.PanelBody,{title:sformblock.formsettings,className:"sform-options"},O(H,{className:"formselector",label:sformblock.formlabel,value:t,options:N,onChange:I}),O("div",{className:"newform "+o},O(T,{className:"is-link",href:"admin.php?page=sform-new&post="+e},sformblock.addnew)),O("div",{className:n},O(D,{label:sformblock.titlelabel,checked:!!i,onChange:function(e){C({displayTitle:e}),1==e?C({titleOptions:"visible"}):C({titleOptions:"d-none"})}}),O("div",{className:"titleoptions "+l},O(H,{label:sformblock.headinglabel,value:a,className:"heading-level",options:[{value:"h1",label:"H1"},{value:"h2",label:"H2"},{value:"h3",label:"H3"},{value:"h4",label:"H4"},{value:"h5",label:"H5"},{value:"h6",label:"H6"}],onChange:e=>C({titleHeading:e})}),O(H,{label:sformblock.titlealignment,value:r,className:"heading-alignment",options:[{value:"left",label:sformblock.leftvalue},{value:"center",label:sformblock.centervalue},{value:"right",label:sformblock.rightvalue}],onChange:e=>C({titleAlignment:e})})),O(D,{label:sformblock.descriptionabove,className:s,checked:!!c,onChange:e=>C({formDescription:e})}),O(D,{label:sformblock.descriptionbelow,className:m,checked:!!g,onChange:e=>C({formEnding:e})}),O("div",{className:"sformbuttons"},O(T,{className:"is-primary sform-button left",href:"admin.php?page=sform-editor&form="+t,target:"_blank"},sformblock.formeditor),O(T,{className:"is-primary sform-button right",href:"admin.php?page=sform-settings&form="+t,target:"_blank"},sformblock.settings)))),O(wp.components.PanelBody,{title:sformblock.spacing,initialOpen:!1},O(A,{label:sformblock.topmargin,value:b,min:"0",max:"100",beforeIcon:"admin-settings",withInputField:!0,onChange:e=>C({topMargin:e}),className:"rangeoptions"}),O(A,{label:sformblock.rightmargin,value:f,min:"0",max:"100",beforeIcon:"admin-settings",withInputField:!0,onChange:e=>C({rightMargin:e}),className:"rangeoptions"}),O(A,{label:sformblock.bottommargin,value:h,min:"0",max:"100",beforeIcon:"admin-settings",withInputField:!0,onChange:e=>C({bottomMargin:e}),className:"rangeoptions"}),O(A,{label:sformblock.leftmargin,value:u,min:"0",max:"100",beforeIcon:"admin-settings",withInputField:!0,onChange:e=>C({leftMargin:e})}),O(A,{label:sformblock.toppadding,value:v,min:"0",max:"100",beforeIcon:"admin-settings",withInputField:!0,onChange:e=>C({topPadding:e}),className:"rangeoptions"}),O(A,{label:sformblock.rightpadding,value:k,min:"0",max:"100",beforeIcon:"admin-settings",withInputField:!0,onChange:e=>C({rightPadding:e}),className:"rangeoptions"}),O(A,{label:sformblock.bottompadding,value:w,min:"0",max:"100",beforeIcon:"admin-settings",withInputField:!0,onChange:e=>C({bottomPadding:e}),className:"rangeoptions"}),O(A,{label:sformblock.leftpadding,value:y,min:"0",max:"100",beforeIcon:"admin-settings",withInputField:!0,onChange:e=>C({leftPadding:e})})))],N=[O(B,{className:"sform-block-selector-wrap"},O("img",{src:sformblock.img},null),O("h3",{},sformblock.blocktitle),O("span",{className:"selector-message"},sformblock.selectormessage),O(H,{value:t,options:N,onChange:I}))];if(""==t)return[e,N];N=x();return[e,[O("div",N,O(wp.serverSideRender,{block:"simpleform/form-selector",attributes:{formId:t,displayTitle:i,titleHeading:a,titleAlignment:r,formDescription:c,formEnding:g,topMargin:b,rightMargin:f,bottomMargin:h,leftMargin:u,topPadding:v,rightPadding:k,bottomPadding:w,leftPadding:y}}))]]},save:function(e){return null}})}((window.wp.blocks,window.wp.blockEditor,window.wp.element,window.wp.components));
     1!function(){var H=wp.element.createElement,e=wp.blocks.registerBlockType,S=wp.blockEditor.InspectorControls,B=wp.blockEditor.useBlockProps,{SelectControl:T,ToggleControl:A,Placeholder:z,Button:W,RangeControl:_}=wp.components,o=H("svg",{width:32,height:32,viewBox:"0 0 180 180",className:"dashicon"},H("path",{fill:"currentColor",d:"M96.326,111.597c0-18.193-0.167-36.391,0.053-54.58 c0.188-15.525,3.512-29.949,12.957-41.421c9.567-11.622,21.017-11.457,30.737-0.01c7.372,8.682,10.607,19.568,12.215,31.381 c0.732,5.379,0.851,10.786,0.849,16.214c-0.011,29.197-0.002,58.396-0.007,87.595c-0.002,6.48-4.014,10.405-9.378,9.323 c-1.924-0.389-1.816-2.022-1.926-3.624c-0.695-10.047-0.688-10.011-8.982-7.314c-6.804,2.212-13.586,4.543-20.463,6.387 c-3.582,0.962-5.123,2.99-4.787,7.271c0.146,1.889,0.034,3.815-0.05,5.717c-0.121,2.802-1.362,4.579-3.627,5.479 c-6.666,2.648-7.592,1.872-7.592-6.516C96.325,148.864,96.325,130.23,96.326,111.597z"}),H("path",{fill:"currentColor",d:"M27.769,107.198c0-15.412-0.03-30.824,0.006-46.234 c0.066-28.643,17.508-50.748,41.681-53.416c10.049-1.108,20.08-0.48,30.118-0.75c0.936-0.025,2.139-0.439,2.631,0.961 c0.478,1.368-0.575,2.092-1.229,2.922c-0.76,0.967-1.845,1.741-2.281,2.873c-2.752,7.121-7.72,7.832-13.544,7.427 c-6.419-0.445-12.871-0.373-19.217,1.558C49.624,27.498,38.989,43.42,39.058,63.261c0.029,8.499,0.51,16.996,0.485,25.493 c-0.039,13.634-0.362,27.268-0.496,40.901c-0.065,6.679,1.043,7.76,6.557,8.476c12.062,1.562,24.085,3.49,36.146,5.019 c3.442,0.438,4.282,2.441,4.271,6.104c-0.025,9.025-0.132,8.982-7.748,7.741c-11.527-1.878-23.107-3.308-34.656-5.002 c-3.365-0.496-4.713,0.846-4.562,5.06c0.346,9.731,0.213,8.388-7.725,7.188c-2.969-0.446-3.621-2.725-3.603-5.963 C27.816,141.25,27.769,124.225,27.769,107.198z"}),H("path",{fill:"currentColor",d:"M75.697,51.212c-5.191-0.897-10.416-0.479-15.628-0.553 c-2.054-0.029-2.659-0.985-2.13-3.342c1.504-6.724,6.782-12.072,12.691-12.477c3.083-0.211,6.184-0.019,9.271-0.12 c1.641-0.054,1.945,0.99,1.602,2.487c-0.899,3.906-1.4,7.864-1.404,11.914c-0.002,1.369-0.648,2.056-1.787,2.086 C77.44,51.23,76.568,51.212,75.697,51.212z"}),H("path",{fill:"#FFF",d:"M73.535,48.245c-3.321-0.574-6.665-0.307-10.001-0.354 c-1.313-0.019-1.702-0.63-1.362-2.139c0.963-4.303,4.34-7.726,8.121-7.986c1.975-0.135,3.959-0.012,5.936-0.076 c1.049-0.035,1.244,0.633,1.024,1.592c-0.577,2.5-0.897,5.033-0.899,7.625c0,0.875-0.414,1.316-1.144,1.335 C74.651,48.256,74.094,48.245,73.535,48.245z"})),t=(window.location.pathname,window.location.pathname.split("/")),R=(t.length,!1);for(i=0;i<t.length;i++)"widgets.php"==t[i]&&(R=!0);e("simpleform/form-selector",{title:sformblock.blocktitle,description:sformblock.blockdescription,icon:o,category:"widgets",attributes:{displayTitle:{type:"boolean"},formDescription:{type:"boolean"},formEnding:{type:"boolean"},formId:{type:"string"},optionNew:{type:"string"},formOptions:{type:"string"},titleOptions:{type:"string"},titleHeading:{type:"string"},titleAlignment:{type:"string"},displayDescription:{type:"string"},displayEnding:{type:"string"},imgUrl:{type:"string",default:sformblock.img},preview:{type:"boolean",default:!1},anchor:{type:"string"},topMargin:{type:"integer"},rightMargin:{type:"integer"},bottomMargin:{type:"integer"},leftMargin:{type:"integer"},topPadding:{type:"integer"},rightPadding:{type:"integer"},bottomPadding:{type:"integer"},leftPadding:{type:"integer"},formDisplay:{type:"boolean"},formShortcode:{type:"boolean"},formWidget:{type:"boolean"}},example:{attributes:{preview:!0}},supports:{multiple:!0,anchor:!0},edit:function(e){const{attributes:{formId:o="",optionNew:t="visible",formOptions:n="d-none",displayTitle:l=!1,titleOptions:i="d-none",titleHeading:a="h4",titleAlignment:r="left",displayDescription:s="d-none",formDescription:m=!1,displayEnding:c="d-none",formEnding:p=!1,imgUrl:g=sformblock.img,preview:d=!1,topMargin:f=0,rightMargin:b=0,bottomMargin:h=0,leftMargin:u=0,topPadding:v=0,rightPadding:k=0,bottomPadding:w=0,leftPadding:y=0,formDisplay:C=!0,formShortcode:N=!1,formWidget:I=!1},setAttributes:P}=e;if(d)return H("div",{},H("img",{src:sformblock.preview},null));var M=sformblock.forms.map(function(e){return{label:e.name,value:e.id}});const D=new URLSearchParams(window.location.search);var E=D.get("post");function x(e){var o;P({formDisplay:!0}),P({formShortcode:!1}),o=1==e?"[simpleform]":'[simpleform id="'+e+'"]',P({formId:e}),""!=e?(P({formOptions:"visible",optionNew:"d-none"}),l?P({titleOptions:"visible"}):P({titleOptions:"d-none"})):P({formOptions:"d-none",titleOptions:"d-none",optionNew:"visible"});var t=document.getElementsByClassName("blocks-shortcode__textarea");if(0<t.length)for(var n=0;n<t.length;n++)if(""==t[n].value&&t[n].parentNode.remove(),o==t[n].value){P({formDisplay:!1}),P({formShortcode:!0});break}var i=document.getElementsByClassName("wp-block-paragraph");if(0<i.length)for(n=0;n<i.length;n++){i[n].innerText;if(o==i[n].innerText){P({formDisplay:!1}),P({formShortcode:!0});break}}e="form#form-"+e;1<=document.querySelectorAll(e).length&&P({formDisplay:!1})}var O=sformblock.above,e=sformblock.below;function F(e){return e===o}0!==O.length&&O.find(F)?P({displayDescription:"visible"}):P({displayDescription:"d-none"}),0!==e.length&&e.find(F)?P({displayEnding:"visible"}):P({displayEnding:"d-none"});E=[H(S,{},H(wp.components.PanelBody,{title:sformblock.formsettings,className:"sform-options"},H(T,{className:"formselector",label:sformblock.formlabel,value:o,options:M,onChange:x}),H("div",{className:"newform "+t},H(W,{className:"is-link",href:"admin.php?page=sform-new&post="+E},sformblock.addnew)),H("div",{className:n},H(A,{label:sformblock.titlelabel,checked:!!l,onChange:function(e){P({displayTitle:e}),1==e?P({titleOptions:"visible"}):P({titleOptions:"d-none"})}}),H("div",{className:"titleoptions "+i},H(T,{label:sformblock.headinglabel,value:a,className:"heading-level",options:[{value:"h1",label:"H1"},{value:"h2",label:"H2"},{value:"h3",label:"H3"},{value:"h4",label:"H4"},{value:"h5",label:"H5"},{value:"h6",label:"H6"}],onChange:e=>P({titleHeading:e})}),H(T,{label:sformblock.titlealignment,value:r,className:"heading-alignment",options:[{value:"left",label:sformblock.leftvalue},{value:"center",label:sformblock.centervalue},{value:"right",label:sformblock.rightvalue}],onChange:e=>P({titleAlignment:e})})),H(A,{label:sformblock.descriptionabove,className:s,checked:!!m,onChange:e=>P({formDescription:e})}),H(A,{label:sformblock.descriptionbelow,className:c,checked:!!p,onChange:e=>P({formEnding:e})}),H("div",{className:"sformbuttons"},H(W,{className:"is-primary sform-button left",href:"admin.php?page=sform-editor&form="+o,target:"_blank"},sformblock.formeditor),H(W,{className:"is-primary sform-button right",href:"admin.php?page=sform-settings&form="+o,target:"_blank"},sformblock.settings)))),H(wp.components.PanelBody,{title:sformblock.spacing,initialOpen:!1},H(_,{label:sformblock.topmargin,value:f,min:"0",max:"100",beforeIcon:"admin-settings",withInputField:!0,onChange:e=>P({topMargin:e}),className:"rangeoptions"}),H(_,{label:sformblock.rightmargin,value:b,min:"0",max:"100",beforeIcon:"admin-settings",withInputField:!0,onChange:e=>P({rightMargin:e}),className:"rangeoptions"}),H(_,{label:sformblock.bottommargin,value:h,min:"0",max:"100",beforeIcon:"admin-settings",withInputField:!0,onChange:e=>P({bottomMargin:e}),className:"rangeoptions"}),H(_,{label:sformblock.leftmargin,value:u,min:"0",max:"100",beforeIcon:"admin-settings",withInputField:!0,onChange:e=>P({leftMargin:e})}),H(_,{label:sformblock.toppadding,value:v,min:"0",max:"100",beforeIcon:"admin-settings",withInputField:!0,onChange:e=>P({topPadding:e}),className:"rangeoptions"}),H(_,{label:sformblock.rightpadding,value:k,min:"0",max:"100",beforeIcon:"admin-settings",withInputField:!0,onChange:e=>P({rightPadding:e}),className:"rangeoptions"}),H(_,{label:sformblock.bottompadding,value:w,min:"0",max:"100",beforeIcon:"admin-settings",withInputField:!0,onChange:e=>P({bottomPadding:e}),className:"rangeoptions"}),H(_,{label:sformblock.leftpadding,value:y,min:"0",max:"100",beforeIcon:"admin-settings",withInputField:!0,onChange:e=>P({leftPadding:e})})))],M=[H(z,{className:"sform-block-selector-wrap"},H("img",{src:sformblock.img},null),H("h3",{},sformblock.blocktitle),H("span",{className:"selector-message"},sformblock.selectormessage),H(T,{value:o,options:M,onChange:x}))];if(""==o)return[E,M];1==R&&P({formWidget:!0});M=B();return[E,[H("div",M,H(wp.serverSideRender,{block:"simpleform/form-selector",attributes:{formId:o,displayTitle:l,titleHeading:a,titleAlignment:r,formDescription:m,formEnding:p,topMargin:f,rightMargin:b,bottomMargin:h,leftMargin:u,topPadding:v,rightPadding:k,bottomPadding:w,leftPadding:y,formDisplay:C,formShortcode:N,formWidget:I}}))]]},save:function(e){return null}})}((window.wp.blocks,window.wp.blockEditor,window.wp.element,window.wp.components));
  • simpleform/trunk/admin/js/block.js

    r2568608 r2581779  
    88       
    99    var sformIcon = el( 'svg', { width: 32, height: 32, viewBox: '0 0 180 180', className: 'dashicon' }, el( 'path', { fill: 'currentColor', d: 'M96.326,111.597c0-18.193-0.167-36.391,0.053-54.58 c0.188-15.525,3.512-29.949,12.957-41.421c9.567-11.622,21.017-11.457,30.737-0.01c7.372,8.682,10.607,19.568,12.215,31.381 c0.732,5.379,0.851,10.786,0.849,16.214c-0.011,29.197-0.002,58.396-0.007,87.595c-0.002,6.48-4.014,10.405-9.378,9.323 c-1.924-0.389-1.816-2.022-1.926-3.624c-0.695-10.047-0.688-10.011-8.982-7.314c-6.804,2.212-13.586,4.543-20.463,6.387 c-3.582,0.962-5.123,2.99-4.787,7.271c0.146,1.889,0.034,3.815-0.05,5.717c-0.121,2.802-1.362,4.579-3.627,5.479 c-6.666,2.648-7.592,1.872-7.592-6.516C96.325,148.864,96.325,130.23,96.326,111.597z'} ),el( 'path', {fill: 'currentColor', d: 'M27.769,107.198c0-15.412-0.03-30.824,0.006-46.234 c0.066-28.643,17.508-50.748,41.681-53.416c10.049-1.108,20.08-0.48,30.118-0.75c0.936-0.025,2.139-0.439,2.631,0.961 c0.478,1.368-0.575,2.092-1.229,2.922c-0.76,0.967-1.845,1.741-2.281,2.873c-2.752,7.121-7.72,7.832-13.544,7.427 c-6.419-0.445-12.871-0.373-19.217,1.558C49.624,27.498,38.989,43.42,39.058,63.261c0.029,8.499,0.51,16.996,0.485,25.493 c-0.039,13.634-0.362,27.268-0.496,40.901c-0.065,6.679,1.043,7.76,6.557,8.476c12.062,1.562,24.085,3.49,36.146,5.019 c3.442,0.438,4.282,2.441,4.271,6.104c-0.025,9.025-0.132,8.982-7.748,7.741c-11.527-1.878-23.107-3.308-34.656-5.002 c-3.365-0.496-4.713,0.846-4.562,5.06c0.346,9.731,0.213,8.388-7.725,7.188c-2.969-0.446-3.621-2.725-3.603-5.963 C27.816,141.25,27.769,124.225,27.769,107.198z'} ), el( 'path', {fill: 'currentColor', d: 'M75.697,51.212c-5.191-0.897-10.416-0.479-15.628-0.553 c-2.054-0.029-2.659-0.985-2.13-3.342c1.504-6.724,6.782-12.072,12.691-12.477c3.083-0.211,6.184-0.019,9.271-0.12 c1.641-0.054,1.945,0.99,1.602,2.487c-0.899,3.906-1.4,7.864-1.404,11.914c-0.002,1.369-0.648,2.056-1.787,2.086 C77.44,51.23,76.568,51.212,75.697,51.212z' } ), el( 'path', {fill: '#FFF', d: 'M73.535,48.245c-3.321-0.574-6.665-0.307-10.001-0.354 c-1.313-0.019-1.702-0.63-1.362-2.139c0.963-4.303,4.34-7.726,8.121-7.986c1.975-0.135,3.959-0.012,5.936-0.076 c1.049-0.035,1.244,0.633,1.024,1.592c-0.577,2.5-0.897,5.033-0.899,7.625c0,0.875-0.414,1.316-1.144,1.335 C74.651,48.256,74.094,48.245,73.535,48.245z' } ));
     10 
     11    var pagename = window.location.pathname;
     12    var pathArray = window.location.pathname.split('/');
     13    var pathArrayLength = pathArray.length;
     14    var widgets = false;
     15    for (i = 0; i < pathArray.length; i++) { if ( 'widgets.php' == pathArray[i] ) { widgets = true; } }
    1016       
    1117    registerBlockType('simpleform/form-selector', {
     
    1824                      displayDescription: {type: 'string'}, displayEnding: {type: 'string'}, imgUrl: {type: 'string', default: sformblock.img}, preview: {type: 'boolean', default: false},
    1925                      anchor: {type: 'string'}, topMargin: {type: 'integer'}, rightMargin: {type: 'integer'}, bottomMargin: {type: 'integer'}, leftMargin: {type: 'integer'},
    20                       topPadding: {type: 'integer'}, rightPadding: {type: 'integer'}, bottomPadding: {type: 'integer'}, leftPadding: {type: 'integer'} },
     26                      topPadding: {type: 'integer'}, rightPadding: {type: 'integer'}, bottomPadding: {type: 'integer'}, leftPadding: {type: 'integer'}, formDisplay: {type: 'boolean'}, formShortcode: {type: 'boolean'}, formWidget: {type: 'boolean'} },
    2127        example: { attributes: {'preview' : true } },
    2228       
     
    2430       
    2531        edit: function( props ) {
    26             const { attributes: { formId = '', optionNew = 'visible', formOptions = 'd-none', displayTitle = false, titleOptions = 'd-none', titleHeading = 'h4', titleAlignment = 'left', displayDescription = 'd-none', formDescription = false, displayEnding = 'd-none', formEnding = false, imgUrl = sformblock.img, preview = false,  topMargin = 0, rightMargin = 0, bottomMargin = 0, leftMargin = 0, topPadding = 0, rightPadding = 0, bottomPadding = 0, leftPadding = 0  }, setAttributes } = props;
     32            const { attributes: { formId = '', optionNew = 'visible', formOptions = 'd-none', displayTitle = false, titleOptions = 'd-none', titleHeading = 'h4', titleAlignment = 'left', displayDescription = 'd-none', formDescription = false, displayEnding = 'd-none', formEnding = false, imgUrl = sformblock.img, preview = false,  topMargin = 0, rightMargin = 0, bottomMargin = 0, leftMargin = 0, topPadding = 0, rightPadding = 0, bottomPadding = 0, leftPadding = 0, formDisplay = true, formShortcode = false, formWidget = false }, setAttributes } = props;
    2733           
    2834            if (preview) {
     
    3339               
    3440            var options = sformblock.forms.map(function (f) { return { label: f.name, value: f.id }; });
    35    
    36             function selectForm( value ) {
     41           
     42            const urlParams = new URLSearchParams(window.location.search);
     43            const pageId = urlParams.get('post');
     44
     45            function selectForm( value ) {
     46               
     47              setAttributes( { formDisplay: true } ); setAttributes( { formShortcode: false } );
     48
     49              if ( value == 1 ) { var searchShortcode = '[simpleform]'; }
     50              else { var searchShortcode = '[simpleform id="'+value+'"]'; }     
     51
    3752              setAttributes( { formId: value } );
    3853              if ( value != '' ) {
     
    4358                  setAttributes( { formOptions: 'd-none', titleOptions: 'd-none', optionNew: 'visible' } );
    4459              }
     60                         
     61              var blocksShortcode = document.getElementsByClassName("blocks-shortcode__textarea");
     62             
     63              if ( blocksShortcode.length > 0 ) {
     64                 for ( var i = 0; i < blocksShortcode.length; i++ ) {
     65                     var shortcodeBlock = blocksShortcode[i].value;
     66                     if ( shortcodeBlock == '' ) {   
     67                         blocksShortcode[i].parentNode.remove();
     68                     }
     69                     if ( searchShortcode == blocksShortcode[i].value ) { setAttributes( { formDisplay: false } ); setAttributes( { formShortcode: true } ); break; }
     70                 }
     71              }
     72
     73              var blocksParagraph = document.getElementsByClassName("wp-block-paragraph");
     74             
     75              if ( blocksParagraph.length > 0 ) { 
     76                 for ( var i = 0; i < blocksParagraph.length; i++ ) {
     77                     var shortcodeParagraph = blocksParagraph[i].innerText;
     78                     if ( searchShortcode == blocksParagraph[i].innerText ) { setAttributes( { formDisplay: false } ); setAttributes( { formShortcode: true } ); break; }
     79                 }
     80              }
     81
     82              var selectedForm = 'form#form-' + value;
     83              var countForm = document.querySelectorAll(selectedForm).length;     
     84             
     85              if ( countForm >= 1 ) { setAttributes( { formDisplay: false } ); }
     86
    4587            }
    46        
     88
    4789            function toggleDisplayTitle( value ) {
    4890              setAttributes( { displayTitle: value } );
     
    63105          if ( belowIds.length !== 0 && belowIds.find(findId) ) { setAttributes( { displayEnding: 'visible' } ); }
    64106          else { setAttributes( { displayEnding: 'd-none' } ); }
    65          
    66           const urlParams = new URLSearchParams(window.location.search);
    67           const pageId = urlParams.get('post');
    68          
     107                 
    69108          const controls = [
    70109            el(InspectorControls,{},
     
    115154               
    116155          if ( formId != '' ) {
     156             if ( widgets == true ) {  setAttributes( { formWidget: true } ); }
    117157             var blockProps = useBlockProps();
    118158             const Form = [
    119159               el('div',blockProps,
    120                 el( wp.serverSideRender, {block: 'simpleform/form-selector', attributes: {formId:formId,displayTitle:displayTitle,titleHeading:titleHeading,titleAlignment:titleAlignment,formDescription:formDescription,formEnding:formEnding,topMargin:topMargin,rightMargin:rightMargin,bottomMargin:bottomMargin,leftMargin:leftMargin,topPadding:topPadding,rightPadding:rightPadding,bottomPadding:bottomPadding,leftPadding:leftPadding}} )
     160                el( wp.serverSideRender, {block: 'simpleform/form-selector', attributes: {formId:formId,displayTitle:displayTitle,titleHeading:titleHeading,titleAlignment:titleAlignment,formDescription:formDescription,formEnding:formEnding,topMargin:topMargin,rightMargin:rightMargin,bottomMargin:bottomMargin,leftMargin:leftMargin,topPadding:topPadding,rightPadding:rightPadding,bottomPadding:bottomPadding,leftPadding:leftPadding,formDisplay:formDisplay,formShortcode:formShortcode,formWidget:formWidget }} )
    121161               )           
    122162             ];
  • simpleform/trunk/admin/partials/editor.php

    r2568608 r2581779  
    1818<h1 class="title <?php echo $color ?>"><span class="dashicons dashicons-editor-table responsive"></span><?php _e( 'Editor', 'simpleform' );
    1919global $wpdb;
    20 $table_name = "{$wpdb->prefix}sform_shortcodes"; 
    21 $page_forms = $wpdb->get_results( "SELECT id, name FROM $table_name WHERE area = 'page' ORDER BY name ASC", 'ARRAY_A' );
    22 $widget_forms = $wpdb->get_results( "SELECT id, name FROM $table_name WHERE area != 'page' AND area != 'draft' ORDER BY name ASC", 'ARRAY_A' );
     20$table_name = "{$wpdb->prefix}sform_shortcodes";
     21$page_forms = $wpdb->get_results( "SELECT id, name FROM $table_name WHERE widget = '0' ORDER BY name ASC", 'ARRAY_A' );
     22$widget_forms = $wpdb->get_results( "SELECT id, name FROM $table_name WHERE widget != '0' ORDER BY name ASC", 'ARRAY_A' );
    2323$page_ids = array_column($page_forms, 'id');
    2424$widget_ids = array_column($widget_forms, 'id');
     
    8383$privacy_link = ! empty( $attributes['privacy_link'] ) ? esc_attr($attributes['privacy_link']) : 'false';
    8484$privacy_page = ! empty( $attributes['privacy_page'] ) ? esc_attr($attributes['privacy_page']) : '0';
    85 $edit_page = '<a href="' . get_edit_post_link($privacy_page) . '" target="_blank" style="text-decoration: none; color: #9ccc79;">' . __( 'Publish now','simpleform') . '</a>'; 
     85$edit_page = '<a href="' . get_edit_post_link($privacy_page) . '" target="_blank" style="text-decoration: none; color: #9ccc79;">' . __( 'Publish now','simpleform') . '</a>';
    8686$privacy_url = $privacy_page != '0' ? get_page_link($privacy_page) : '';
    8787/* translators: It is used in place of placeholder %1$s in the string: "%1$s or %2$s the page content" */
     
    113113
    114114<?php
    115    
    116115// Contact forms embedded in page
    117116if ( in_array($id, $page_ids) ) {
     
    131130
    132131<tr><th class="option"><span><?php _e('Used in','simpleform') ?></span></th><td class="used-page last">
    133 <?php
    134    
    135 $used_in = $wpdb->get_var( "SELECT pages FROM $table_name WHERE id = {$id}" );
    136 $ids = ! empty($used_in) ? explode(",", $used_in) : array();
    137 if ( empty($ids) ) {
    138 $table_post = $wpdb->prefix . 'posts';
    139 $shortcode = $id == '1' ? '%[simpleform]%' : '%[simpleform id="'.$id.'"]%';
    140 $sql = $wpdb->prepare("SELECT ID FROM {$table_post} WHERE post_content LIKE %s AND post_type != 'attachment' AND post_type != 'revision' AND post_status != 'trash' AND post_title != ''", $shortcode);
    141 $ids = $wpdb->get_col($sql);
    142 $ids_list = implode(',',$ids);
    143 $wpdb->query( $wpdb->prepare("UPDATE $table_name SET pages = '$ids_list' WHERE id = %d", $id) );
    144 }   
    145 $extra_ids = array();
    146 if( has_filter('sform_block_pages') ) { $ids_array = array_merge($ids, apply_filters( 'sform_block_pages', $id, $extra_ids )); }
    147 else { $ids_array = $ids; }
     132
     133<?php
     134$util = new SimpleForm_Util();
     135$ids_array = $util->form_pages($id);
    148136$ordered_list = array_intersect($allpagesid,$ids_array);
    149137$pages = '';   
     138
    150139if( !empty($ordered_list) ) {
    151140foreach ($ordered_list as $page) {
     
    156145}
    157146}
    158 $message = '';
     147}
    159148
    160149$widget_block = get_option("widget_block") != false ? get_option("widget_block") : array();
    161 $sidebars_widgets = get_option('sidebars_widgets');
    162 global $wp_registered_sidebars;
    163 
    164 if ( !empty($widget_block) ) {
    165 foreach ($widget_block as $key => $value ) {
    166   if ( is_array($value) ) {   
    167      $string = implode('',$value);
    168      $sfblock = 'wp:simpleform/form-selector';
    169      if ( strpos($string, $sfblock) !== false ) {
    170         $split =  explode('formId":"', $string)[1];
    171         $formId=  explode('"', $split)[0];
    172         if ( $formId == $id ) {       
    173          foreach ( $sidebars_widgets as $sidebar => $widgets ) {
    174            if ( is_array( $widgets ) ) {
    175              $search = 'block-'.$key;
    176              if (in_array($search, $widgets)) {
    177                   $widget_area = isset($wp_registered_sidebars[$sidebar]['name']) ? $wp_registered_sidebars[$sidebar]['name'] : '';   
    178                     if ( !empty($widget_area)) {
    179                         $pages .=  $widget_area .'&nbsp;'.__('widget area','simpleform').'&nbsp;[&nbsp;<strong><a href="' . self_admin_url('widgets.php') . '" target="_blank" style="text-decoration: none;">'. __( 'Edit','simpleform') .'</a></strong>&nbsp;]<br>';
    180                     } 
    181              }
    182          }   
    183         }
    184      }
    185      }
    186   }
    187 }
    188 }
    189 }
    190 else { $message = '<span>' . __('Still not used. Create a new page or choose an existing one and add the shortcode','simpleform') . '</span>'; }
    191 echo $pages . $message . '</td></tr>'; }
     150if ( !empty($widget_block) ) {     
     151$sql = "SELECT widget_id FROM `$table_name` WHERE id = %d";
     152$block_id_list = $wpdb->get_var( $wpdb->prepare( $sql, $id ) );
     153$block_id_array = $block_id_list ? explode(',',$block_id_list) : array();
     154if ($block_id_array) {
     155   foreach($block_id_array as $item) {
     156   $split_key = ! empty($item) ? explode('block-', $item) : '';
     157   $block_key = isset($split_key[1]) ? $split_key[1] : '0';
     158   // Remove any non-existent ids
     159   if ( !in_array($block_key,array_keys($widget_block)) ) {
     160    $remove_id = array($item);
     161    $new_ids = implode(",", array_diff($block_id_array,$remove_id));
     162    $wpdb->update($table_name, array('widget_id' => $new_ids), array('id' => $id ));
     163   }
     164   else {
     165    $widget_area = $util->widget_area_name($block_key);
     166    $pages .=  $widget_area ? $widget_area .'&nbsp;'.__('widget area','simpleform').'&nbsp;[&nbsp;<strong><a href="' . self_admin_url('widgets.php') . '" target="_blank" style="text-decoration: none;">'. __( 'Edit','simpleform') .'</a></strong>&nbsp;]<br>' : '';
     167   }
     168   }
     169}   
     170}
     171 
     172if ( empty($pages) ) { $pages = '<span>' . __('Still not used. Create a new page or choose an existing one and add the shortcode','simpleform') . '</span>'; }
     173
     174echo $pages . '</td></tr>';
     175
     176}
    192177
    193178// Contact forms embedded in widget area
     
    196181$widget_id = $wpdb->get_var( "SELECT widget FROM $table_name WHERE id = {$id}" );
    197182if ( in_array($widget_id, array_keys($sform_widget)) ) {
    198 // $sidebars_widgets = get_option('sidebars_widgets');
    199183$widget_area = $wpdb->get_var( "SELECT area FROM $table_name WHERE id = {$id}" );
    200184$widget_for = ! empty($sform_widget[$widget_id]['sform_widget_audience']) ? $sform_widget[$widget_id]['sform_widget_audience'] : 'all';
     
    214198}
    215199
    216 $util = new SimpleForm_Util();     
    217 $shortcode_pages = get_option('sform_shortcode_pages'); // distinction should be made between users role! Ex: sform_shortcode_pages_ROLE. Get target col info!
    218 if ( empty($shortcode_pages) ) { $shortcode_pages = $util->shortcode_pages(); }
    219 $extra_ids = array(); // distinction should be made between users role! Ex: sform_block_pages_ROLE
    220 if( has_filter('sform_block_pages') ) { $pages_id = array_merge($shortcode_pages, apply_filters( 'sform_block_pages', $any = 0, $extra_ids )); }
    221 else { $pages_id = $shortcode_pages; }
    222 
    223200$widget_visibility = ! empty($sform_widget[$widget_id]['sform_widget_visibility']) ? $sform_widget[$widget_id]['sform_widget_visibility'] : 'all';
    224 $hidden_pages = ! empty($sform_widget[$widget_id]['sform_widget_hidden_pages']) ? array_unique(array_merge(explode(',',$sform_widget[$widget_id]['sform_widget_hidden_pages']) , $pages_id)) : $pages_id;       
     201$hidden_pages = ! empty($sform_widget[$widget_id]['sform_widget_hidden_pages']) ? $sform_widget[$widget_id]['sform_widget_hidden_pages'] : '';       
    225202$visible_pages = ! empty($sform_widget[$widget_id]['sform_widget_visible_pages']) ? $sform_widget[$widget_id]['sform_widget_visible_pages'] : '';
    226203       
    227204if ( $widget_visibility == 'hidden' ) {
    228205   if ( ! empty($hidden_pages)) {
     206     $pages_array = explode(',',$hidden_pages);
     207     $ordered_pages_array = array_intersect( $allpagesid, $pages_array);
    229208     $hidden_list = '';
    230      // Order by name
    231      $ordered_pages_array = array_intersect( $allpagesid, $hidden_pages);
    232209     foreach ($ordered_pages_array as $post) {
    233210     if ( get_post_status($post) == 'draft' || get_post_status($post) == 'publish' ) {
     
    258235}
    259236else {
    260    $ids = array_intersect($allpagesid,$pages_id);
    261    if ( $ids ) {
    262      $pages = '';
    263      foreach ($ids as $page) {   
    264      if( get_post_status($page) == 'draft' || get_post_status($page) == 'publish' ) {
    265       $publish_link = '<strong><a href="' . get_edit_post_link($page) . '" target="_blank" class="publish-link">' . __( 'Publish now','simpleform') . '</a></strong>'; 
    266       $post_status = get_post_status($page) == 'draft' ? __( 'Page in draft status not yet published','simpleform').'&nbsp;-&nbsp;' . $publish_link : sprintf( __('%1$s or %2$s the page content', 'simpleform'), '<strong><a href="' . get_edit_post_link($page) .'" target="_blank" style="text-decoration: none;">'. $edit .'</a></strong>', '<strong><a href="' . get_page_link($page) . '" target="_blank" style="text-decoration: none;">'. $view .'</a></strong>' );
    267       $pages .= '<span>' . get_the_title($page). '</span><span class="slug">[&nbsp;' . $post_status . '&nbsp;]<br>';
    268      }
    269      }
    270      $widget_pages = '<span>' . __( 'All Pages except:','simpleform') . '</span><br>' . $pages;
    271    }
    272    else { $widget_pages = __( 'All Pages','simpleform'); }
    273 }
    274 ?>   
     237   $widget_pages = __( 'All Pages','simpleform');
     238} ?>     
    275239
    276240<tr><th class="option"><span><?php _e('Widget Name','simpleform') ?></span></th><td class="plaintext widget"><span><?php _e( 'SimpleForm Contact Form','simpleform') ?></span><a href="<?php echo self_admin_url('widgets.php') ?>" target="_blank"><span class="dashicons dashicons-admin-appearance icon-button <?php echo $color ?>"></span><span class="widgets-page wp-core-ui button"><?php _e( 'Edit Widget', 'simpleform' ) ?></span></a></td></tr>
     
    394358   
    395359<tr class="tremail <?php if ( $email_field =='hidden' ) {echo 'unseen';}?>" ><th class="option"><span><?php _e('Email Field Placeholder','simpleform') ?></span></th><td class="text"><input class="sform" name="email-placeholder" placeholder="<?php esc_attr_e('Enter a placeholder for the email field. If blank, it will not be used!','simpleform') ?>" id="email-placeholder" type="text" value='<?php echo $email_placeholder; ?>'</td></tr>       
    396        
    397360<tr class="tremail <?php if ( $email_field =='hidden') {echo 'unseen';} ?>"><th class="option"><span><?php _e('Email Field Requirement','simpleform') ?></span></th><td class="checkbox-switch"><div class="switch-box"><label class="switch-input"><input type="checkbox" name="email-requirement" id="email-requirement" class="sform-switch" value="required" <?php checked( $email_requirement, 'required'); ?>><span></span></label><label for="email-requirement" class="switch-label"><?php _e('Make this a required field','simpleform') ?></label></div></td></tr>
    398361
  • simpleform/trunk/admin/partials/settings.php

    r2568608 r2581779  
    77$admin_notices = ! empty( $settings['admin_notices'] ) ? esc_attr($settings['admin_notices']) : 'false';
    88$widget_editor = ! empty( $settings['widget_editor'] ) ? esc_attr($settings['widget_editor']) : 'false';
    9 
    109$color = ! empty( $settings['admin_color'] ) ? esc_attr($settings['admin_color']) : 'default';
    1110$notice = '';
     
    2120global $wpdb;
    2221$table_name = "{$wpdb->prefix}sform_shortcodes";
    23 $page_forms = $wpdb->get_results( "SELECT id, name FROM $table_name WHERE area = 'page' ORDER BY name ASC", 'ARRAY_A' );
    24 $widget_forms = $wpdb->get_results( "SELECT id, name FROM $table_name WHERE area != 'page' AND area != 'draft' ORDER BY name ASC", 'ARRAY_A' );
     22$page_forms = $wpdb->get_results( "SELECT id, name FROM $table_name WHERE widget = '0' ORDER BY name ASC", 'ARRAY_A' );
     23$widget_forms = $wpdb->get_results( "SELECT id, name FROM $table_name WHERE widget != '0' ORDER BY name ASC", 'ARRAY_A' );
    2524$page_ids = array_column($page_forms, 'id');
    2625$widget_ids = array_column($widget_forms, 'id');
     
    6665$spinner = ! empty( $settings['spinner'] ) ? esc_attr($settings['spinner']) : 'false';
    6766$form_template = ! empty( $settings['form_template'] ) ? esc_attr($settings['form_template']) : 'default';
     67$form_borders = ! empty( $settings['form_borders'] ) ? esc_attr($settings['form_borders']) : 'dark';
    6868$style_notes = $form_template == 'customized' ? __('Create a directory inside your active theme\'s directory, name it "simpleform", copy one of the template files, and name it "custom-template.php"', 'simpleform' ) : '&nbsp;';
    6969$stylesheet = ! empty( $settings['stylesheet'] ) ? esc_attr($settings['stylesheet']) : 'false';
     
    9090
    9191<?php if ( version_compare(get_bloginfo('version'),'5.8', '>=') && ! empty($simpleform_widgets) ) { ?>
    92 
    9392<tr><th class="option"><span><?php _e( 'Widgets Block Editor', 'simpleform' ) ?></span></th><td class="checkbox-switch notes"><div class="switch-box"><label class="switch-input"><input type="checkbox" id="widget-editor" name="widget-editor" class="sform-switch" value="true" <?php checked( $widget_editor, 'true'); if ( $id != '1' ) { echo $disabled; } ?>><span></span></label><label for="widget-editor" class="switch-label <?php if ( $id != '1' ) { echo 'disabled'; } ?>"><?php _e( 'Use the widgets editor introduced in WordPress 5.8', 'simpleform' ); ?></label></div><p class="description"><?php _e('Keep unchecked if you want to continue using the classic widgets editor', 'simpleform' ); ?></p></td></tr>
    94 
    9593<?php } ?>
    9694   
    9795<?php if ( version_compare(get_bloginfo('version'),'5.8', '<') || ( version_compare(get_bloginfo('version'),'5.8', '>=') && ! empty($simpleform_widgets) ) ) { ?>
    98    
    9996<tr class="trwidget <?php if ( version_compare(get_bloginfo('version'),'5.8', '>=') && function_exists('wp_use_widgets_block_editor') && wp_use_widgets_block_editor() ) { echo 'unseen'; } ?>"><th class="option"><span><?php _e( 'Widget\'s Options', 'simpleform' ) ?></span></th><td class="checkbox-switch notes"><div class="switch-box"><label class="switch-input"><input type="checkbox" id="widget-options" name="widget-options" class="sform-switch" value="true" <?php checked( $widget_options, 'true'); if ( $id != '1' ) { echo $disabled; } ?>><span></span></label><label for="widget-options" class="switch-label <?php if ( $id != '1' ) { echo 'disabled'; } ?>"><?php _e( 'Use the default options for choosing where to display the SimpleForm widget', 'simpleform' ); ?></label></div><p class="description"><?php _e('Keep unchecked if you want to use a customized code or a third-party plugin to define where you want the widget to appear', 'simpleform' ); ?></p></td></tr>
    100 
    10197<?php } ?>
    10298
     
    129125<div class="section custom"><table class="form-table custom"><tbody>
    130126
    131 <tr><th class="option"><span><?php _e('Form Style','simpleform') ?></span></th><td class="select notes"><select name="form-template" id="form-template" class="sform"><option value="default" <?php selected( $form_template, 'default'); ?>><?php _e('Default','simpleform') ?></option><option value="basic" <?php selected( $form_template, 'basic'); ?>><?php _e('Basic','simpleform') ?></option><option value="rounded" <?php selected( $form_template, 'rounded'); ?>><?php _e('Rounded','simpleform') ?></option><option value="minimal" <?php selected( $form_template, 'minimal'); ?>><?php _e('Minimal','simpleform') ?></option><option value="transparent" <?php selected( $form_template, 'transparent'); ?>><?php _e('Transparent','simpleform') ?></option><option value="highlighted" <?php selected( $form_template, 'highlighted'); ?>><?php _e('Highlighted','simpleform') ?></option><option value="customized" <?php selected( $form_template, 'customized'); ?>><?php _e('Customized','simpleform') ?></option></select><p id="template-notice" class="description"><?php echo $style_notes; ?></p></td></tr>
     127<tr><th class="option"><span><?php _e('Form Style','simpleform') ?></span></th><td class="select notes"><select name="form-template" id="form-template" class="sform"><option value="default" <?php selected( $form_template, 'default'); ?>><?php _e('Default','simpleform') ?></option><option value="basic" <?php selected( $form_template, 'basic'); ?>><?php _e('Basic','simpleform') ?></option><option value="rounded" <?php selected( $form_template, 'rounded'); ?>><?php _e('Rounded','simpleform') ?></option><option value="minimal" <?php selected( $form_template, 'minimal'); ?>><?php _e('Minimal','simpleform') ?></option><option value="transparent" <?php selected( $form_template, 'transparent'); ?>><?php _e('Transparent','simpleform') ?></option><option value="highlighted" <?php selected( $form_template, 'highlighted'); ?>><?php _e('Highlighted','simpleform') ?></option><option value="customized" <?php selected( $form_template, 'customized'); ?>><?php _e('Customized','simpleform') ?></option></select><select name="form-borders" id="form-borders" class="sform borders <?php if ($form_template !='transparent') { echo 'unseen'; } ?>"><option value="dark" <?php selected( $form_borders, 'dark'); ?>><?php _e('Dark borders','simpleform') ?></option><option value="light" <?php selected( $form_borders, 'light'); ?>><?php _e('Light borders','simpleform') ?></option></select><p id="template-notice" class="description"><?php echo $style_notes; ?></p></td></tr>
    132128
    133129<tr><th class="option"><span><?php _e('Form CSS Stylesheet','simpleform') ?></span></th><td class="checkbox-switch"><div class="switch-box"><label class="switch-input"><input type="checkbox" name="stylesheet" id="stylesheet" class="sform-switch" value="false" <?php checked( $stylesheet, 'true'); ?>><span></span></label><label for="stylesheet" class="switch-label"><?php _e( 'Disable the SimpleForm CSS stylesheet and use your own CSS stylesheet','simpleform') ?></label></div></td></tr>
     
    163159  $error_notes = "&nbsp;";
    164160}
     161$multiple_spaces = ! empty( $settings['multiple_spaces'] ) ? esc_attr($settings['multiple_spaces']) : 'false';
    165162$empty_fields = ! empty( $settings['empty_fields'] ) ? stripslashes(esc_attr($settings['empty_fields'])) : esc_attr__ ( 'There were some errors that need to be fixed', 'simpleform' );
    166163$chars_length = ! empty( $settings['characters_length'] ) ? esc_attr($settings['characters_length']) : 'true';
     
    245242?> 
    246243
     244<h2 id="h2-rules" class="options-heading"><span class="heading" section="rules"><?php _e( 'Fields Validation Rules', 'simpleform' ); ?><span class="toggle dashicons dashicons-arrow-up-alt2 rules"></span></span><?php if ( $id != '1' ) { ?><a href="<?php echo menu_page_url( 'sform-settings', false ); ?>"><span class="dashicons dashicons-edit icon-button <?php echo $color ?>"></span><span class="settings-page wp-core-ui button"><?php _e( 'Go to main settings for edit', 'simpleform' ) ?></span></a><?php } ?></h2>
     245
     246<div class="section rules"><table class="form-table rules"><tbody>
     247   
     248<tr><th class="option"><span><?php _e('Multiple spaces','simpleform') ?></span></th><td class="checkbox-switch last"><div class="switch-box"><label class="switch-input"><input type="checkbox" name="multiple-spaces" id="multiple-spaces" class="sform-switch" value="false" <?php checked( $multiple_spaces, 'true'); if ( $id != '1' ) { echo $disabled; } ?>><span></span></label><label for="multiple-spaces" class="switch-label <?php if ( $id != '1' ) { echo 'disabled'; } ?>"><?php _e( 'Prevent the user from entering multiple white spaces in the fields','simpleform') ?></label></div></td></tr>
     249
     250</tbody></table></div>
     251
    247252<h2 id="h2-fields" class="options-heading"><span class="heading" section="fields"><?php _e( 'Fields Error Messages', 'simpleform' ); ?><span class="toggle dashicons dashicons-arrow-up-alt2 fields"></span></span></h2>
    248253
  • simpleform/trunk/admin/partials/submissions.php

    r2544675 r2581779  
    1616global $wpdb;
    1717$table_name = "{$wpdb->prefix}sform_shortcodes";
    18 $page_forms = $wpdb->get_results( "SELECT id, name FROM $table_name WHERE area = 'page' ORDER BY name ASC", 'ARRAY_A' );
    19 $widget_forms = $wpdb->get_results( "SELECT id, name FROM $table_name WHERE area != 'page' AND area != 'draft' ORDER BY name ASC", 'ARRAY_A' );
     18$page_forms = $wpdb->get_results( "SELECT id, name FROM $table_name WHERE widget = '0' ORDER BY name ASC", 'ARRAY_A' );
     19$widget_forms = $wpdb->get_results( "SELECT id, name FROM $table_name WHERE widget != '0' ORDER BY name ASC", 'ARRAY_A' );
    2020$page_ids = array_column($page_forms, 'id');
    2121$widget_ids = array_column($widget_forms, 'id');
    2222$shortcode_ids = array_merge($page_ids, $widget_ids);
    2323$all_forms = count($page_forms) + count($widget_forms);
     24
    2425if ( $all_forms > 1 ) { ?>
    2526<div class="selector"><div id="wrap-selector" class="responsive"><?php echo _e( 'Select Form', 'simpleform' ) ?>:</div><div class="form-selector"><select name="form" id="form" class="<?php echo $color ?>"><option value="" <?php selected( $id, '' ); ?>><?php echo _e( 'All Forms', 'simpleform' ); ?></option><?php if ( $page_forms && $widget_forms ) {  echo '<optgroup label="'.esc_attr__( 'Embedded in page', 'simpleform' ).'">'; } foreach($page_forms as $form) { $form_id = $form['id']; $form_name = $form['name']; echo '<option value="'.$form_id.'" '.selected( $id, $form_id ) .'>'.$form_name.'</option>'; } if ( $page_forms && $widget_forms ) {  echo '</optgroup>'; } if ( $page_forms && $widget_forms ) {  echo '<optgroup label="'.esc_attr__( 'Embedded in widget area', 'simpleform' ).'">'; } foreach($widget_forms as $form) { $form_id = $form['id']; $form_name = $form['name']; echo '<option value="'.$form_id.'" '.selected( $id, $form_id ) .'>'.$form_name.'</option>'; } if ( $page_forms && $widget_forms ) {  echo '</optgroup>'; }?></select></div></div>
     
    9293    }
    9394    }
     95       
     96    if ( $id != '' ) {
     97    global $wpdb;
     98    $table_name = "{$wpdb->prefix}sform_shortcodes";
     99    $form_name = $wpdb->get_var( "SELECT name FROM $table_name WHERE id = {$id}" );
     100    ?>
     101    <span id="deletion-toggle" class="deletion <?php echo $color ?>"><?php _e( 'Delete Form', 'simpleform' ) ?></span>
     102    <div id="deletion-notice" class="unseen">
     103    <form id="deletion" method="post">
     104    <input type="hidden" id="form-id" name="form-id" value="<?php echo $id ?>">
     105    <h3><span class="dashicons dashicons-trash"></span><?php _e( 'Delete Form', 'simpleform' ); echo ':&nbsp;' . $form_name; ?></h3><div class="disclaimer"><?php _e( 'Deleting a form is permanent. Once a form is deleted, it can\'t be restored. All submissions to that form are permanently deleted too.', 'simpleform' ) ?></div><div id="deletion-buttons"><div class="delete cancel"><?php _e( 'Cancel', 'simpleform' ) ?></div><input type="submit" class="delete" id="deletion-confirm" name="deletion-confirm" value="<?php esc_attr_e( 'Continue with deletion', 'simpleform' ) ?>"></div><?php wp_nonce_field( 'sform_nonce_deletion', 'sform_nonce'); ?>
     106    </form>
     107    </div> 
     108    <?php }
     109   
    94110  }
    95111 
  • simpleform/trunk/changelog.txt

    r2568608 r2581779  
    11== Changelog ==
     2
     3= 2.0.4 (12 August 2021) =
     4* Fixed: incorrect display of description above and below the form if the widget is used
     5* Fixed: line breaks converted into a single space when filling in the form
     6* Fixed: minor issues in code
     7* Changed: removal of the limit of only one widget per page
     8* Changed: display of form is prevented if the same is used more than once on the same page
     9* Added: button to permanently remove a form from forms list
     10* Added: borders color option when transparent form style is used
    211
    312= 2.0.3 (21 July 2021) =
  • simpleform/trunk/includes/class-activator.php

    r2568608 r2581779  
    4646
    4747    /**
     48     * Create custom tables.
     49     *
     50     * @since    1.0
     51     */
     52 
     53    public static function create_db() {
     54
     55        $current_db_version = SIMPLEFORM_DB_VERSION;
     56
     57        global $wpdb;
     58        $charset_collate = $wpdb->get_charset_collate();
     59        $installed_version = get_option('sform_db_version');
     60        $prefix = $wpdb->prefix;
     61        require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
     62
     63        if ( $installed_version != $current_db_version ) {
     64       
     65          $shortcodes_table = $prefix . 'sform_shortcodes';
     66          $sql = "CREATE TABLE " . $shortcodes_table . " (
     67            id int(11) NOT NULL AUTO_INCREMENT,
     68            shortcode tinytext NOT NULL,
     69            area varchar(250) NOT NULL DEFAULT 'page',
     70            name tinytext NOT NULL,
     71            pages text NOT NULL,
     72            shortcode_pages text NOT NULL,
     73            block_pages text NOT NULL,
     74            widget_id text NOT NULL,
     75            widget smallint(5) UNSIGNED NOT NULL DEFAULT 0,
     76            target tinytext NOT NULL,
     77            creation datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
     78            PRIMARY KEY  (id)
     79          ) ". $charset_collate .";";
     80          dbDelta($sql);
     81
     82          $submissions_table = $prefix . 'sform_submissions';
     83          $sql = "CREATE TABLE " . $submissions_table . " (
     84            id int(11) NOT NULL AUTO_INCREMENT,
     85            form int(7) NOT NULL DEFAULT 1,
     86            requester_type tinytext NOT NULL,
     87            requester_id int(15) NOT NULL,
     88            date datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
     89            notes text NOT NULL,
     90            PRIMARY KEY  (id)
     91          ) ". $charset_collate .";";
     92          dbDelta($sql);
     93         
     94          update_option('sform_db_version', $current_db_version);
     95         
     96        }
     97   
     98    }
     99 
     100    /**
     101     * Save default properties.
     102     *
     103     * @since    1.0
     104     */
     105
     106    public static function default_data_entry() {
     107     
     108        global $wpdb;
     109        $prefix = $wpdb->prefix;
     110        $shortcodes_table = $prefix . 'sform_shortcodes';
     111        $shortcode = 'simpleform';
     112        $name = __( 'Contact Us Page','simpleform');
     113        $shortcode_data = $wpdb->get_results("SELECT * FROM {$shortcodes_table}");
     114        if(count($shortcode_data) == 0) { $wpdb->insert( $shortcodes_table, array( 'shortcode' => $shortcode, 'name' => $name ) ); }
     115               
     116    }
     117   
     118    /**
     119     *  Create a table whenever a new blog is created in a WordPress Multisite installation.
     120     *
     121     * @since    1.2
     122     */
     123
     124    public static function on_create_blog($params) {
     125       
     126       if ( is_plugin_active_for_network( 'simpleform/simpleform.php' ) ) {
     127       switch_to_blog( $params->blog_id );
     128       self::create_db();
     129       self::default_data_entry();
     130       restore_current_blog();
     131       }
     132
     133    }
     134   
     135    /**
    48136     *  Specify the initial settings.
    49137     *
     
    80168                 'focus' => 'field',
    81169                 'form_template' => 'default',
     170                 'form_borders' => 'dark',
    82171                 'stylesheet' => 'false',
    83172                 'stylesheet_file' => 'false',
    84173                 'javascript' => 'false',
    85174                 'deletion_data' => 'false',
     175                 'multiple_spaces' => 'false',
    86176                 'outside_error' => 'bottom',
    87177                 'empty_fields' => __( 'There were some errors that need to be fixed', 'simpleform' ),
     
    250340       
    251341    }
    252 
    253     /**
    254      * Create custom tables.
    255      *
    256      * @since    1.0
    257      */
    258  
    259     public static function create_db() {
    260 
    261         $current_db_version = SIMPLEFORM_DB_VERSION;
    262 
    263         global $wpdb;
    264         $charset_collate = $wpdb->get_charset_collate();
    265         $installed_version = get_option('sform_db_version');
    266         $prefix = $wpdb->prefix;
    267         require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    268 
    269         if ( $installed_version != $current_db_version ) {
    270        
    271           $shortcodes_table = $prefix . 'sform_shortcodes';
    272           $sql = "CREATE TABLE " . $shortcodes_table . " (
    273             id int(11) NOT NULL AUTO_INCREMENT,
    274             shortcode tinytext NOT NULL,
    275             area varchar(250) NOT NULL DEFAULT 'page',
    276             name tinytext NOT NULL,
    277             pages text NOT NULL,
    278             widget smallint(5) UNSIGNED NOT NULL DEFAULT 0,
    279             target tinytext NOT NULL,
    280             creation datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    281             PRIMARY KEY  (id)
    282           ) ". $charset_collate .";";
    283           dbDelta($sql);
    284 
    285           $submissions_table = $prefix . 'sform_submissions';
    286           $sql = "CREATE TABLE " . $submissions_table . " (
    287             id int(11) NOT NULL AUTO_INCREMENT,
    288             form int(7) NOT NULL DEFAULT 1,
    289             requester_type tinytext NOT NULL,
    290             requester_id int(15) NOT NULL,
    291             date datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    292             notes text NOT NULL,
    293             PRIMARY KEY  (id)
    294           ) ". $charset_collate .";";
    295           dbDelta($sql);
    296          
    297           update_option('sform_db_version', $current_db_version);
    298          
    299         }
    300    
    301     }
    302  
    303     /**
    304      * Save default properties.
    305      *
    306      * @since    1.0
    307      */
    308 
    309     public static function default_data_entry() {
    310      
    311         global $wpdb;
    312         $prefix = $wpdb->prefix;
    313         $shortcodes_table = $prefix . 'sform_shortcodes';
    314         $shortcode = 'simpleform';
    315         $name = __( 'Contact Us Page','simpleform');
    316         $shortcode_data = $wpdb->get_results("SELECT * FROM {$shortcodes_table}");
    317         if(count($shortcode_data) == 0) { $wpdb->insert( $shortcodes_table, array( 'shortcode' => $shortcode, 'name' => $name ) ); }
    318                
    319     }
    320    
    321     /**
    322      *  Create a table whenever a new blog is created in a WordPress Multisite installation.
    323      *
    324      * @since    1.2
    325      */
    326 
    327     public static function on_create_blog($params) {
    328        
    329        if ( is_plugin_active_for_network( 'simpleform/simpleform.php' ) ) {
    330        switch_to_blog( $params->blog_id );
    331        self::create_db();
    332        self::default_data_entry();
    333        restore_current_blog();
    334        }
    335 
    336     }   
    337342   
    338343}
  • simpleform/trunk/includes/class-core.php

    r2568608 r2581779  
    4242       
    4343        if ( defined( 'SIMPLEFORM_VERSION' ) ) { $this->version = SIMPLEFORM_VERSION; }
    44         else { $this->version = '2.0.3'; }
     44        else { $this->version = '2.0.4'; }
    4545        $this->plugin_name = 'simpleform';
    4646        $this->load_dependencies();
     
    119119        // Register ajax callback for change admin color scheme
    120120        $this->loader->add_action('wp_ajax_admin_color_scheme', $plugin_admin, 'admin_color_scheme');
    121         // Remove the shortcode if the form id does not exist
    122         $this->loader->add_filter('content_save_pre', $plugin_admin, 'sanitize_shortcode', 10, 1 );
     121        // Clean up the post content of any non-existent and redundant form
     122        $this->loader->add_filter('content_save_pre', $plugin_admin, 'clean_up_post_content', 10, 1 );
    123123        // Display an admin notice in case there are any SimpleForm widgets running on WordPress 5.8
    124124        if ( version_compare(get_bloginfo('version'),'5.8', '>=') ) {   
    125125        $this->loader->add_action('admin_notices', $plugin_admin, 'general_admin_notice');
    126         }
     126        }       
     127        // Register ajax callback for form deleting
     128        $this->loader->add_action('wp_ajax_sform_delete_form', $plugin_admin, 'sform_delete_form');
    127129
    128130    }
  • simpleform/trunk/public/class-public.php

    r2568608 r2581779  
    165165      $outside_error = ! empty( $settings['outside_error'] ) ? esc_attr($settings['outside_error']) : 'bottom';
    166166      $outside = $outside_error == 'top' || $outside_error == 'bottom' ? 'true' : 'false';
     167      $multiple_spaces = ! empty( $settings['multiple_spaces'] ) ? esc_attr($settings['multiple_spaces']) : 'false';
    167168     
    168169      wp_localize_script('sform_public_script', 'ajax_sform_processing', array('ajaxurl' => admin_url('admin-ajax.php'), 'ajax_error' => $ajax_error, 'outside' => $outside ));
     
    171172      if( $ajax == 'true' ) {
    172173       wp_enqueue_script( 'sform_public_script');
    173       }       
     174      }
     175
     176      if ( $multiple_spaces != 'false' )
     177      wp_add_inline_script( 'sform_form_script', 'jQuery(document).ready(function(){jQuery("input,textarea").on("input",function(){jQuery(this).val(jQuery(this).val().replace(/\s\s+/g," "));});});' );
     178     
    174179      if ( $javascript == 'true' ) {
    175180        if (is_child_theme() ) {
     
    187192      if ( $is_gb_editor ) {         
    188193          return $contact_form;
    189       } else { 
     194      } else {
    190195          return $above_form . $contact_form . $below_form;
    191196      }
  • simpleform/trunk/public/css/public-min.css

    r2568608 r2581779  
    1 .d-block{display:inline-block}.d-none{display:none!important}.v-visible{visibility:visible!important}.v-invisible{visibility:hidden!important;opacity:0}.align-left{text-align:left}.align-center{text-align:center}.align-right{text-align:right}h1.sform,h2.sform,h3.sform,h4.sform,h5.sform,h6.sform{color:inherit}.sform-introduction{padding-bottom:15px;clear:both}.sform-bottom{margin:0 auto;clear:both}.sform-field-group{line-height:1;padding-bottom:3px;clear:both}.sform-field-group label{display:block;margin-bottom:5px}label.sform{font-size:inherit;color:inherit;font-weight:400}label.sform.smaller{font-size:.9em}label.sform.larger{font-size:1.1em}.required-symbol.mark{color:#dc3545;padding-left:3px;background-color:transparent}.required-symbol.word{color:inherit;padding-left:3px;font-weight:300;font-size:.8em;font-style:italic}input.sform-field{width:100%;margin-bottom:0;outline:0;font-size:inherit;color:inherit;font-weight:400;line-height:normal}textarea.sform-field{width:100%;height:auto;outline:0;line-height:1.5;font-size:inherit;color:inherit;font-weight:400}.half{clear:none}.email.half,.name.half{width:47.5%;float:left}.lastname.half,.phone.half{width:47.5%;float:right}.default input.sform-field{border-width:1px;border-color:#ccc;border-style:solid;border-radius:5px;background-color:#fff;padding:10px 16px}.basic input.sform-field{border-width:1px;border-color:#aaa;border-style:solid;border-radius:0;background-color:#fff;padding:10px 32px 10px 16px}.rounded input.sform-field{border-width:1px;border-color:#6c757d;border-style:solid;border-radius:5px;background-color:#fff;padding:10px 32px 10px 16px}.minimal input.sform-field{border:none;border-bottom:2px solid #ccc;border-radius:0;background-color:transparent;padding:10px 0}.transparent input.sform-field{border-width:2px;border-color:#333;border-style:solid;border-radius:0;background-color:transparent;padding:10px 16px}.highlighted input.sform-field{border:none;border-radius:5px;background-color:#eaeaea;padding:10px 16px}.default textarea.sform-field{border-width:1px;border-color:#ccc;border-style:solid;border-radius:5px;background-color:#fff;padding:10px 16px}.basic textarea.sform-field{border-width:1px;border-color:#aaa;border-style:solid;border-radius:0;background-color:#fff;padding:10px 32px 10px 16px}.rounded textarea.sform-field{border-width:1px;border-color:#6c757d;border-style:solid;border-radius:5px;background-color:#fff;padding:10px 32px 10px 16px}.minimal textarea.sform-field{border:none;border-bottom:2px solid #ccc;border-radius:0;background-color:transparent;padding:10px 0}.transparent textarea.sform-field{border-width:2px;border-color:#333;border-style:solid;border-radius:0;background-color:transparent;padding:10px 16px}.highlighted textarea.sform-field{border:none;border-radius:5px;background-color:#eaeaea;padding:10px 16px}.sform-field-group.checkbox{margin-top:20px}input.checkbox{position:absolute;opacity:0;height:1px;width:1px;appearance:none;-webkit-appearance:none;-moz-appearance:none}input.checkbox+label{position:relative;cursor:default;display:inline-block;margin-left:0;width:100%;font-size:inherit}input.checkbox+label a{color:inherit;text-decoration:underline;text-decoration-style:dotted}.checkmark{position:absolute;cursor:pointer;top:0;left:0;height:34px;width:34px}input.checkbox:checked+label .checkmark:after{display:block}.default input.checkbox+label,.highlighted input.checkbox+label,.minimal input.checkbox+label,.transparent input.checkbox+label{padding-left:50px;line-height:34px;margin-bottom:25px}.default .checkmark{border-width:1px;border-color:#ccc;border-style:solid;border-radius:5px;background-color:#fff}.default .checkmark:after,.highlighted .checkmark:after,.minimal .checkmark:after,.transparent .checkmark:after{left:10px;top:5px;width:12px;height:18px;border:solid #fff;border-width:0 4px 4px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);content:"";position:absolute;box-sizing:border-box;display:none}.default input.checkbox:checked+label .checkmark{border-color:#8bc34a;background-color:#8bc34a}.basic .checkmark{border-width:1px;border-color:#aaa;border-style:solid;border-radius:0;background-color:#fff;margin-top:10px;height:20px;width:20px;line-height:20px;text-align:center;color:#fff;font-size:18px;font-weight:600}.basic .checkmark:after{display:none;box-sizing:border-box}.basic input.checkbox:checked+label .checkmark{background-color:#007bff;border-color:#007bff}.basic input.checkbox:checked+label .checkmark:after{content:"\2713";display:block}.basic input.checkbox+label{padding-left:30px;margin-top:10px;margin-bottom:30px;line-height:40px}.rounded .checkmark{width:52px;height:26px;border-radius:26px;background-color:#6c757d}.rounded .checkmark:after{position:absolute;content:"";height:18px;width:18px;left:4px;bottom:4px;border-radius:50%;background-color:#fff;-webkit-transition:.4s;transition:.4s}.rounded input.checkbox:checked+label .checkmark{background-color:#8bc34a}.rounded input.checkbox:checked+label .checkmark:after{-webkit-transform:translateX(26px);-ms-transform:translateX(26px);transform:translateX(26px)}.rounded input.checkbox+label{margin-bottom:22px;line-height:26px;padding-left:72px}.minimal .checkmark{border-width:2px;border-color:#ccc;border-style:solid;border-radius:5px;background-color:transparent}.minimal input.checkbox:checked+label .checkmark{border-color:#8bc34a;background-color:#8bc34a}.transparent .checkmark{border-width:2px;border-color:#333;border-style:solid;border-radius:0;background-color:transparent}.transparent input.checkbox:checked+label .checkmark{border-color:#0d6efd;background-color:#0d6efd}.highlighted .checkmark{border-width:1px;border-color:#eaeaea;border-style:solid;border-radius:5px;background-color:#eaeaea}.highlighted input.checkbox:checked+label .checkmark{border-color:#0d6efd;background-color:#0d6efd}div.captcha{width:200px;height:intrinsic}input.sform-field.question{width:110px;height:inherit;cursor:text;border:none;outline:0;display:inline-block;background-color:transparent;padding-right:0;padding-left:0;text-align:right;box-shadow:none}input.sform-field.captcha{width:75px;border:none;outline:0;display:inline-block;background-color:transparent;padding-right:0;padding-left:5px;box-shadow:none}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{appearance:textfield;-moz-appearance:textfield;-webkit-appearance:textfield}.default div.captcha{border-width:1px;border-color:#ccc;border-style:solid;border-radius:5px;background-color:#fff}.basic .sform-field-group.checkbox{margin-top:0}.basic div.captcha{border-width:1px;border-color:#aaa;border-style:solid;border-radius:0;background-color:#fff}.rounded div.captcha{border-width:1px;border-color:#6c757d;border-style:solid;border-radius:5px;background-color:#fff}.minimal div.captcha{border-bottom:2px solid #ccc;background-color:transparent}.transparent div.captcha{border-width:2px;border-color:#333;border-style:solid;border-radius:0;background-color:transparent}.highlighted div.captcha{border:none;border-radius:5px;background-color:#eaeaea}#gcaptcha-wrap,.gcaptcha-wrap{margin:16px 0 30px}.rc-anchor-error-msg-container{letter-spacing:-.5px}.sizelabel{font-size:inherit;margin-bottom:22px}.sizelabel.smaller{font-size:.9em}.sizelabel.larger{font-size:1.1em}.submit-wrap{margin:22px 0}.submit-wrap button.sform{outline:0;font-size:inherit;text-transform:uppercase;font-weight:600;line-height:1.25;text-decoration:none;box-shadow:none;padding:10px 16px}.submit-wrap button.sform:hover{box-shadow:none}.default .submit-wrap button.sform{border-width:1px;border-color:#0090d5;border-style:solid;border-radius:25px;background-color:#0090d5;color:#fff}.default .submit-wrap button.sform:hover{color:#0090d5;background-color:#fff}.basic .submit-wrap button.sform{border-width:1px;border-color:#007bff;border-style:solid;border-radius:0;background-color:#007bff;color:#fff}.basic .submit-wrap button.sform:hover{border-color:#0062cc;background-color:#0069d9}.rounded .submit-wrap button.sform{border-width:1px;border-color:#6c757d;border-style:solid;border-radius:50px;background-color:transparent;color:inherit}.rounded .submit-wrap button.sform:hover{border-color:#6c757d;color:#fff;background-color:#6c757d}.minimal .submit-wrap button.sform{border-width:2px;border-color:#0090d5;border-style:solid;border-radius:5px;background-color:#0090d5;color:#fff}.minimal .submit-wrap button.sform:hover{border-color:#0090d5;color:#0090d5;background-color:#fff}.transparent .submit-wrap button.sform{border-width:2px;border-color:#333;border-style:solid;border-radius:0;background-color:#333;color:#fff}.transparent .submit-wrap button.sform:hover{border-color:#0d6efd;color:#fff;background-color:#0d6efd}.highlighted .submit-wrap button.sform{border-width:1px;border-color:#333;border-style:solid;border-radius:5px;background-color:#333;color:#fff}.highlighted .submit-wrap button.sform:hover{border-color:#0d6efd;color:#fff;background-color:#0d6efd}.submit-wrap button.smaller{font-size:.9em}.submit-wrap button.larger{font-size:1.1em}.submit-wrap button:focus{outline:0}.submit-wrap button:hover{color:#fff;background-color:#0d6efd;border-color:#0d6efd;box-shadow:none}.submit-wrap.left{text-align:left}.submit-wrap.right{text-align:right}.submit-wrap.center{text-align:center}.submit-wrap.full{text-align:center}.submit-wrap button.fullwidth{width:100%}.carrots{opacity:0;position:absolute;top:0;left:0;height:0;width:0;z-index:-1}div.captcha.is-invalid,input.sform-field.is-invalid,input.sform-field.is-invalid+label .checkmark,textarea.sform-field.is-invalid{border-color:#dc3545}.sform-field.is-invalid:focus,div.captcha.is-invalid.focus{box-shadow:none}div.captcha.is-invalid+.error-des span{display:block}label.checkbox.is-invalid{color:#dc3545}.basic .sform-field.is-invalid,.basic div.captcha.is-invalid,.rounded .sform-field.is-invalid,.rounded div.captcha.is-invalid{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right 5px center;background-size:1em}.basic textarea.sform-field.is-invalid,.rounded textarea.sform-field.is-invalid{background-position:top 14px right 5px}.basic input.sform-field.captcha.is-invalid,.basic input.sform-field.question.is-invalid,.rounded input.sform-field.captcha.is-invalid,.rounded input.sform-field.question.is-invalid{background-image:none}.rounded input.sform-field.is-invalid+label .checkmark{background-color:#dc3545}.highlighted div.captcha.is-invalid,.highlighted input.sform-field.is-invalid,.highlighted input.sform-field.is-invalid+label .checkmark,.highlighted textarea.sform-field.is-invalid{border:none;background-color:#f1abb2}input:focus,textarea:focus{-webkit-transition:none;-moz-transition:none;-ms-transition:none;-o-transition:none;transition:none}.sform-field.captcha:focus{background-color:transparent;box-shadow:none}.default div.captcha.focus,.default input.sform-field:focus,.default textarea.sform-field:focus{border-color:#0090d5;background-color:#fafafa;outline:0}.default div.captcha.is-invalid.focus,.default input.sform-field.is-invalid:focus,.default textarea.sform-field.is-invalid:focus,.minimal div.captcha.is-invalid.focus,.minimal input.sform-field.is-invalid:focus,.minimal textarea.sform-field.is-invalid:focus{border-color:#dc3545}.basic input.sform-field.captcha:focus,.basic input.sform-field.question:focus,.default input.sform-field.captcha:focus,.default input.sform-field.question:focus,.highlighted input.sform-field.captcha:focus,.highlighted input.sform-field.question:focus{background-color:transparent}.basic div.captcha.focus,.basic input.sform-field:focus,.basic textarea.sform-field:focus,.rounded div.captcha.focus,.rounded input.sform-field:focus,.rounded textarea.sform-field:focus{border-color:#007bff;box-shadow:0 0 0 2px rgba(0,123,255,.25);outline:0}.basic .sform-field.captcha:focus,.basic .sform-field.is-invalid.captcha:focus,.basic .sform-field.is-invalid.question:focus,.basic .sform-field.question:focus{box-shadow:none}.basic div.captcha.is-invalid.focus,.basic input.sform-field.is-invalid:focus,.basic textarea.sform-field.is-invalid:focus,.rounded div.captcha.is-invalid.focus,.rounded input.sform-field.is-invalid:focus,.rounded textarea.sform-field.is-invalid:focus{border-color:#dc3545;box-shadow:0 0 0 2px rgba(220,53,69,.25)}.rounded .sform-field.captcha:focus,.rounded .sform-field.is-invalid.captcha:focus,.rounded .sform-field.is-invalid.question:focus,.rounded .sform-field.question:focus{box-shadow:none}.minimal div.captcha.focus,.minimal input.sform-field:focus,.minimal textarea.sform-field:focus{border-color:#0090d5;outline:0;box-shadow:none}.transparent div.captcha.focus,.transparent input.sform-field:focus,.transparent textarea.sform-field:focus{border-color:#0d6efd;background-color:#e8f0fe;outline:0;box-shadow:none}.transparent .sform-field.captcha:focus,.transparent .sform-field.is-invalid.captcha:focus,.transparent .sform-field.is-invalid.question:focus,.transparent .sform-field.question:focus{background-color:transparent;box-shadow:none}.transparent div.captcha.is-invalid.focus,.transparent input.sform-field.is-invalid:focus,.transparent textarea.sform-field.is-invalid:focus{border-color:#dc3545;background-color:#f1b1b7}.highlighted div.captcha.focus,.highlighted input.sform-field:focus,.highlighted textarea.sform-field:focus{border:none;background-color:rgba(13,110,253,.5);outline:0;box-shadow:none}.highlighted div.captcha.is-invalid.focus,.highlighted input.sform-field.is-invalid:focus,.highlighted textarea.sform-field.is-invalid:focus{background-color:#f1abb2}.error-des{line-height:1;color:#dc3545;font-size:14px;height:14px;margin-top:5px;margin-bottom:5px}.error-des span{display:none}.sform-field.is-invalid+.error-des span{display:block}.msgoutside{padding:0 0 5px 0;position:relative;outline:0}.msgoutside span{display:block;visibility:hidden;text-align:center;font-size:16px;padding:7.5px 12.5px}.default .msgoutside span,.highlighted .msgoutside span,.transparent .msgoutside span{border-radius:5px;background-color:#dc3545;color:#fff}.basic .msgoutside span{border-radius:0;background-color:#f8d7da;color:#721c24}.rounded .msgoutside span{border-radius:5px;background-color:#dc3545;color:#fff;opacity:.75}.minimal .msgoutside span{border-radius:5px;background-color:#f8d7da;color:#dc3545}.noscript{position:absolute;top:0;width:100%}.msgoutside.top{margin-bottom:20px}.form.confirmation{text-align:center;padding-top:50px;outline:0}.form.confirmation>img,.form.confirmation>p>img{margin:30px auto;width:250px}.sform-confirmation{position:relative;outline:0}.sform.spinner{height:44px;line-height:44px;width:120px;padding:3px 0}.minimal .sform.spinner,.transparent .sform.spinner{height:46px;line-height:46px}.sform.spinner.left{margin:0 auto 0 0}.sform.spinner.right{margin:0 0 0 auto}.sform.spinner.center{margin:0 auto}.sform.spinner>div{width:18px;height:18px;border-radius:100%;display:inline-block;-webkit-animation:sk-bouncedelay 1.2s infinite ease-in-out both;animation:sk-bouncedelay 1.2s infinite ease-in-out both;margin:0 3px}.default .sform.spinner>div,.highlighted .sform.spinner>div,.minimal .sform.spinner>div{background-color:#0090d5}.basic .sform.spinner>div{background-color:#0069d9}.rounded .sform.spinner>div{background-color:#6c757d}.transparent .sform.spinner>div{background-color:#0d6efd}.sform.spinner .bounce1{-webkit-animation-delay:-.4s;animation-delay:-.4s}.sform.spinner .bounce2{-webkit-animation-delay:-.3s;animation-delay:-.3s}.sform.spinner .bounce3{-webkit-animation-delay:-.2s;animation-delay:-.2s}.sform.spinner .bounce4{-webkit-animation-delay:-.1s;animation-delay:-.1s}@-webkit-keyframes sk-bouncedelay{0%,100%,80%{-webkit-transform:scale(0)}40%{-webkit-transform:scale(1)}}@keyframes sk-bouncedelay{0%,100%,80%{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}.row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;clear:right}.row .captcha-error{width:100%;padding-left:135px}.col-sm-10{position:relative;width:100%;min-height:1px}.checkbox.col-sm-10,.msgoutside.col-sm-10,.nolabel.col-sm-10,.submit-wrap.col-sm-10{float:right}.row.checkbox{float:right;width:calc(100% - 135px)}label.sform.col-sm-2{letter-spacing:-.05em}@media (min-width:576px){.col-sm-10{-ms-flex:0 0 calc(100% - 135px);flex:0 0 calc(100% - 135px);max-width:calc(100% - 135px)}.col-sm-2{-ms-flex:135px;flex:135px;max-width:135px;line-height:41px;padding-right:15px}}@media (max-width:575px){.col-sm-10{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.col-sm-2{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}}@media (max-width:1023px){.email.half,.name.half{width:100%;float:left}.lastname.half,.phone.half{width:100%;float:right}}.sform-bottom.rtl,.sform-introduction.rtl,form.sform.rtl{direction:rtl}.rtl .sform-field-group label span{display:inline-block;padding-right:5px;padding-left:0}.rtl .lastname.half,.rtl .phone.half{float:left}.rtl .email.half,.rtl .name.half{float:right}.rtl .row{clear:left}.rtl .checkbox.col-sm-10,.rtl .nolabel.col-sm-10{float:left}.rtl .checkmark{right:0}.rtl label.sform.checkbox:before{right:0}.rtl.basic label.sform.checkbox{padding-right:35px;padding-left:0}.rtl.rounded label.sform.checkbox{padding-right:72px;padding-left:0}.rtl.basic input.sform-field,.rtl.basic textarea.sform-field,.rtl.rounded input.sform-field,.rtl.rounded textarea.sform-field{padding:10px 16px 10px 32px}.rtl.basic div.captcha.is-invalid,.rtl.basic input.sform-field.is-invalid,.rtl.rounded div.captcha.is-invalid,.rtl.rounded input.sform-field.is-invalid{background-position:left 5px center}.rtl.basic textarea.sform-field.is-invalid,.rtl.rounded textarea.sform-field.is-invalid{background-position:top 14px left 5px}.rtl .sform-field.question{text-align:left;padding-left:0}.rtl .sform-field.captcha{padding-right:5px}.rtl.basic input.sform-field.question,.rtl.rounded input.sform-field.question{padding-right:0;padding-left:0}.rtl.basic input.sform-field.captcha,.rtl.rounded input.sform-field.captcha{padding-right:5px;padding-left:32px}.rtl .captcha-error.row{padding-right:135px}.rtl .error-des span{text-align:right}.rtl .msgoutside,.rtl .submit-wrap{float:left;width:100%}.rtl .sform-field-group .col-sm-2{padding-right:0}.rtl label.checkbox span{padding-left:0;padding-right:0}.rtl label.checkbox span.required-symbol{padding-right:5px}.rtl .sform-field-group label span.d-none{display:none}.rtl label.checkbox{margin-right:0;padding-right:50px;padding-left:0}.rtl .sform-field-group label{text-align:right}.rtl .row.checkbox{float:left}
     1.d-block{display:inline-block}.d-none{display:none!important}.v-visible{visibility:visible!important}.v-invisible{visibility:hidden!important;opacity:0}.align-left{text-align:left}.align-center{text-align:center}.align-right{text-align:right}h1.sform,h2.sform,h3.sform,h4.sform,h5.sform,h6.sform{color:inherit}.sform-introduction{padding-bottom:15px;clear:both}.sform-bottom{margin:0 auto;clear:both}.sform-field-group{line-height:1;padding-bottom:3px;clear:both}.sform-field-group label{display:block;margin-bottom:5px}label.sform{font-size:inherit;color:inherit;font-weight:400}label.sform.smaller{font-size:.9em}label.sform.larger{font-size:1.1em}.required-symbol.mark{color:#dc3545;padding-left:3px;background-color:transparent}.required-symbol.word{color:inherit;padding-left:3px;font-weight:300;font-size:.8em;font-style:italic}input.sform-field{width:100%;margin-bottom:0;outline:0;font-size:inherit;color:inherit;font-weight:400;line-height:normal}textarea.sform-field{width:100%;height:auto;outline:0;line-height:1.5;font-size:inherit;color:inherit;font-weight:400}.half{clear:none}.email.half,.name.half{width:47.5%;float:left}.lastname.half,.phone.half{width:47.5%;float:right}.default input.sform-field{border-width:1px;border-color:#ccc;border-style:solid;border-radius:5px;background-color:#fff;padding:10px 16px}.basic input.sform-field{border-width:1px;border-color:#aaa;border-style:solid;border-radius:0;background-color:#fff;padding:10px 32px 10px 16px}.rounded input.sform-field{border-width:1px;border-color:#6c757d;border-style:solid;border-radius:5px;background-color:#fff;padding:10px 32px 10px 16px}.minimal input.sform-field{border:none;border-bottom:2px solid #ccc;border-radius:0;background-color:transparent;padding:10px 0}.transparent input.sform-field{border-width:2px;border-color:#333;border-style:solid;border-radius:0;background-color:transparent;padding:10px 16px}.transparent.light .checkmark,.transparent.light div.captcha,.transparent.light input.sform-field,.transparent.light textarea.sform-field{border-color:#f8f8f8}.highlighted input.sform-field{border:none;border-radius:5px;background-color:#eaeaea;padding:10px 16px}.default textarea.sform-field{border-width:1px;border-color:#ccc;border-style:solid;border-radius:5px;background-color:#fff;padding:10px 16px}.basic textarea.sform-field{border-width:1px;border-color:#aaa;border-style:solid;border-radius:0;background-color:#fff;padding:10px 32px 10px 16px}.rounded textarea.sform-field{border-width:1px;border-color:#6c757d;border-style:solid;border-radius:5px;background-color:#fff;padding:10px 32px 10px 16px}.minimal textarea.sform-field{border:none;border-bottom:2px solid #ccc;border-radius:0;background-color:transparent;padding:10px 0}.transparent textarea.sform-field{border-width:2px;border-color:#333;border-style:solid;border-radius:0;background-color:transparent;padding:10px 16px}.highlighted textarea.sform-field{border:none;border-radius:5px;background-color:#eaeaea;padding:10px 16px}.sform-field-group.checkbox{margin-top:20px}input.checkbox{position:absolute;opacity:0;height:1px;width:1px;appearance:none;-webkit-appearance:none;-moz-appearance:none}input.checkbox+label{position:relative;cursor:default;display:inline-block;margin-left:0;width:100%;font-size:inherit}input.checkbox+label a{color:inherit;text-decoration:underline;text-decoration-style:dotted}.checkmark{position:absolute;cursor:pointer;top:0;left:0;height:34px;width:34px}input.checkbox:checked+label .checkmark:after{display:block}.default input.checkbox+label,.highlighted input.checkbox+label,.minimal input.checkbox+label,.transparent input.checkbox+label{padding-left:50px;line-height:34px;margin-bottom:25px}.default .checkmark{border-width:1px;border-color:#ccc;border-style:solid;border-radius:5px;background-color:#fff}.default .checkmark:after,.highlighted .checkmark:after,.minimal .checkmark:after,.transparent .checkmark:after{left:10px;top:5px;width:12px;height:18px;border:solid #fff;border-width:0 4px 4px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);content:"";position:absolute;box-sizing:border-box;display:none}.default input.checkbox:checked+label .checkmark{border-color:#8bc34a;background-color:#8bc34a}.basic .checkmark{border-width:1px;border-color:#aaa;border-style:solid;border-radius:0;background-color:#fff;margin-top:10px;height:20px;width:20px;line-height:20px;text-align:center;color:#fff;font-size:18px;font-weight:600}.basic .checkmark:after{display:none;box-sizing:border-box}.basic input.checkbox:checked+label .checkmark{background-color:#007bff;border-color:#007bff}.basic input.checkbox:checked+label .checkmark:after{content:"\2713";display:block}.basic input.checkbox+label{padding-left:30px;margin-top:10px;margin-bottom:30px;line-height:40px}.rounded .checkmark{width:52px;height:26px;border:none;border-radius:26px;background-color:#6c757d}.rounded .checkmark:after{position:absolute;display:inherit;content:"";height:18px;width:18px;left:4px;top:4px;border-radius:50%;background-color:#fff;-webkit-transition:.4s;transition:.4s}.rounded input.checkbox:checked+label .checkmark{background-color:#8bc34a}.rounded input.checkbox:checked+label .checkmark:after{-webkit-transform:translateX(26px);-ms-transform:translateX(26px);transform:translateX(26px)}.rounded input.checkbox+label{margin-bottom:22px;line-height:26px;padding-left:72px}.minimal .checkmark{border-width:2px;border-color:#ccc;border-style:solid;border-radius:5px;background-color:transparent}.minimal input.checkbox:checked+label .checkmark{border-color:#8bc34a;background-color:#8bc34a}.transparent .checkmark{border-width:2px;border-color:#333;border-style:solid;border-radius:0;background-color:transparent}.transparent input.checkbox:checked+label .checkmark{border-color:#0d6efd;background-color:#0d6efd}.highlighted .checkmark{border-width:1px;border-color:#eaeaea;border-style:solid;border-radius:5px;background-color:#eaeaea}.highlighted input.checkbox:checked+label .checkmark{border-color:#0d6efd;background-color:#0d6efd}div.captcha{width:200px;height:intrinsic}input.sform-field.question{width:110px;height:inherit;cursor:text;border:none;outline:0;display:inline-block;background-color:transparent;padding-right:0;padding-left:0;text-align:right;box-shadow:none}input.sform-field.captcha{width:75px;border:none;outline:0;display:inline-block;background-color:transparent;padding-right:0;padding-left:5px;box-shadow:none}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{appearance:textfield;-moz-appearance:textfield;-webkit-appearance:textfield}.default div.captcha{border-width:1px;border-color:#ccc;border-style:solid;border-radius:5px;background-color:#fff}.basic .sform-field-group.checkbox{margin-top:0}.basic div.captcha{border-width:1px;border-color:#aaa;border-style:solid;border-radius:0;background-color:#fff}.rounded div.captcha{border-width:1px;border-color:#6c757d;border-style:solid;border-radius:5px;background-color:#fff}.minimal div.captcha{border-bottom:2px solid #ccc;background-color:transparent}.transparent div.captcha{border-width:2px;border-color:#333;border-style:solid;border-radius:0;background-color:transparent}.highlighted div.captcha{border:none;border-radius:5px;background-color:#eaeaea}#gcaptcha-wrap,.gcaptcha-wrap{margin:16px 0 30px}.rc-anchor-error-msg-container{letter-spacing:-.5px}.sizelabel{font-size:inherit;margin-bottom:22px}.sizelabel.smaller{font-size:.9em}.sizelabel.larger{font-size:1.1em}.submit-wrap{margin:22px 0}.submit-wrap button.sform{outline:0;font-size:inherit;text-transform:uppercase;font-weight:600;line-height:1.25;text-decoration:none;box-shadow:none;padding:10px 16px}.submit-wrap button.sform:hover{box-shadow:none}.default .submit-wrap button.sform{border-width:1px;border-color:#0090d5;border-style:solid;border-radius:25px;background-color:#0090d5;color:#fff}.default .submit-wrap button.sform:hover{color:#0090d5;background-color:#fff}.basic .submit-wrap button.sform{border-width:1px;border-color:#007bff;border-style:solid;border-radius:0;background-color:#007bff;color:#fff}.basic .submit-wrap button.sform:hover{border-color:#0062cc;background-color:#0069d9}.rounded .submit-wrap button.sform{border-width:1px;border-color:#6c757d;border-style:solid;border-radius:50px;background-color:transparent;color:inherit}.rounded .submit-wrap button.sform:hover{border-color:#6c757d;color:#fff;background-color:#6c757d}.minimal .submit-wrap button.sform{border-width:2px;border-color:#0090d5;border-style:solid;border-radius:5px;background-color:#0090d5;color:#fff}.minimal .submit-wrap button.sform:hover{border-color:#0090d5;color:#0090d5;background-color:#fff}.transparent .submit-wrap button.sform{border-width:2px;border-color:#333;border-style:solid;border-radius:0;background-color:#333;color:#fff}.transparent .submit-wrap button.sform:hover{border-color:#0d6efd;color:#fff;background-color:#0d6efd}.highlighted .submit-wrap button.sform{border-width:1px;border-color:#333;border-style:solid;border-radius:5px;background-color:#333;color:#fff}.highlighted .submit-wrap button.sform:hover{border-color:#0d6efd;color:#fff;background-color:#0d6efd}.submit-wrap button.smaller{font-size:.9em}.submit-wrap button.larger{font-size:1.1em}.submit-wrap button:focus{outline:0}.submit-wrap button:hover{color:#fff;background-color:#0d6efd;border-color:#0d6efd;box-shadow:none}.submit-wrap.left{text-align:left}.submit-wrap.right{text-align:right}.submit-wrap.center{text-align:center}.submit-wrap.full{text-align:center}.submit-wrap button.fullwidth{width:100%}.carrots{opacity:0;position:absolute;top:0;left:0;height:0;width:0;z-index:-1}div.captcha.is-invalid,input.sform-field.is-invalid,input.sform-field.is-invalid+label .checkmark,textarea.sform-field.is-invalid{border-color:#dc3545}.sform-field.is-invalid:focus,div.captcha.is-invalid.focus{box-shadow:none}div.captcha.is-invalid+.error-des span{display:block}label.checkbox.is-invalid{color:#dc3545}.basic .sform-field.is-invalid,.basic div.captcha.is-invalid,.rounded .sform-field.is-invalid,.rounded div.captcha.is-invalid{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right 5px center;background-size:1em}.basic textarea.sform-field.is-invalid,.rounded textarea.sform-field.is-invalid{background-position:top 14px right 5px}.basic input.sform-field.captcha.is-invalid,.basic input.sform-field.question.is-invalid,.rounded input.sform-field.captcha.is-invalid,.rounded input.sform-field.question.is-invalid{background-image:none}.rounded input.sform-field.is-invalid+label .checkmark{background-color:#dc3545}.highlighted div.captcha.is-invalid,.highlighted input.sform-field.is-invalid,.highlighted input.sform-field.is-invalid+label .checkmark,.highlighted textarea.sform-field.is-invalid{border:none;background-color:#f1abb2}input:focus,textarea:focus{-webkit-transition:none;-moz-transition:none;-ms-transition:none;-o-transition:none;transition:none}.sform-field.captcha:focus{background-color:transparent;box-shadow:none}.default div.captcha.focus,.default input.sform-field:focus,.default textarea.sform-field:focus{border-color:#0090d5;background-color:#fafafa;outline:0}.default div.captcha.is-invalid.focus,.default input.sform-field.is-invalid:focus,.default textarea.sform-field.is-invalid:focus,.minimal div.captcha.is-invalid.focus,.minimal input.sform-field.is-invalid:focus,.minimal textarea.sform-field.is-invalid:focus{border-color:#dc3545}.basic input.sform-field.captcha:focus,.basic input.sform-field.question:focus,.default input.sform-field.captcha:focus,.default input.sform-field.question:focus,.highlighted input.sform-field.captcha:focus,.highlighted input.sform-field.question:focus{background-color:transparent}.basic div.captcha.focus,.basic input.sform-field:focus,.basic textarea.sform-field:focus,.rounded div.captcha.focus,.rounded input.sform-field:focus,.rounded textarea.sform-field:focus{border-color:#007bff;box-shadow:0 0 0 2px rgba(0,123,255,.25);outline:0}.basic .sform-field.captcha:focus,.basic .sform-field.is-invalid.captcha:focus,.basic .sform-field.is-invalid.question:focus,.basic .sform-field.question:focus{box-shadow:none}.basic div.captcha.is-invalid.focus,.basic input.sform-field.is-invalid:focus,.basic textarea.sform-field.is-invalid:focus,.rounded div.captcha.is-invalid.focus,.rounded input.sform-field.is-invalid:focus,.rounded textarea.sform-field.is-invalid:focus{border-color:#dc3545;box-shadow:0 0 0 2px rgba(220,53,69,.25)}.rounded .sform-field.captcha:focus,.rounded .sform-field.is-invalid.captcha:focus,.rounded .sform-field.is-invalid.question:focus,.rounded .sform-field.question:focus{box-shadow:none}.minimal div.captcha.focus,.minimal input.sform-field:focus,.minimal textarea.sform-field:focus{border-color:#0090d5;outline:0;box-shadow:none}.transparent div.captcha.focus,.transparent input.sform-field:focus,.transparent textarea.sform-field:focus{border-color:#0d6efd;background-color:#e8f0fe;outline:0;box-shadow:none}.transparent .sform-field.captcha:focus,.transparent .sform-field.is-invalid.captcha:focus,.transparent .sform-field.is-invalid.question:focus,.transparent .sform-field.question:focus{background-color:transparent;box-shadow:none}.transparent div.captcha.is-invalid.focus,.transparent input.sform-field.is-invalid:focus,.transparent textarea.sform-field.is-invalid:focus{border-color:#dc3545;background-color:#f1b1b7}.highlighted div.captcha.focus,.highlighted input.sform-field:focus,.highlighted textarea.sform-field:focus{border:none;background-color:rgba(13,110,253,.5);outline:0;box-shadow:none}.highlighted div.captcha.is-invalid.focus,.highlighted input.sform-field.is-invalid:focus,.highlighted textarea.sform-field.is-invalid:focus{background-color:#f1abb2}.error-des{line-height:1;color:#dc3545;font-size:14px;height:14px;margin-top:5px;margin-bottom:5px}.error-des span{display:none}.sform-field.is-invalid+.error-des span{display:block}.msgoutside{padding:0 0 5px 0;position:relative;outline:0}.msgoutside span{display:block;visibility:hidden;text-align:center;font-size:16px;padding:7.5px 12.5px}.default .msgoutside span,.highlighted .msgoutside span,.transparent .msgoutside span{border-radius:5px;background-color:#dc3545;color:#fff}.basic .msgoutside span{border-radius:0;background-color:#f8d7da;color:#721c24}.rounded .msgoutside span{border-radius:5px;background-color:#dc3545;color:#fff;opacity:.75}.minimal .msgoutside span{border-radius:5px;background-color:#f8d7da;color:#dc3545}.noscript{position:absolute;top:0;width:100%}.msgoutside.top{margin-bottom:20px}.form.confirmation{text-align:center;padding-top:50px;outline:0}.form.confirmation>img,.form.confirmation>p>img{margin:30px auto;width:250px}.sform-confirmation{position:relative;outline:0}.sform.spinner{height:44px;line-height:44px;width:120px;padding:3px 0}.minimal .sform.spinner,.transparent .sform.spinner{height:46px;line-height:46px}.sform.spinner.left{margin:0 auto 0 0}.sform.spinner.right{margin:0 0 0 auto}.sform.spinner.center{margin:0 auto}.sform.spinner>div{width:18px;height:18px;border-radius:100%;display:inline-block;-webkit-animation:sk-bouncedelay 1.2s infinite ease-in-out both;animation:sk-bouncedelay 1.2s infinite ease-in-out both;margin:0 3px}.default .sform.spinner>div,.highlighted .sform.spinner>div,.minimal .sform.spinner>div{background-color:#0090d5}.basic .sform.spinner>div{background-color:#0069d9}.rounded .sform.spinner>div{background-color:#6c757d}.transparent .sform.spinner>div{background-color:#0d6efd}.sform.spinner .bounce1{-webkit-animation-delay:-.4s;animation-delay:-.4s}.sform.spinner .bounce2{-webkit-animation-delay:-.3s;animation-delay:-.3s}.sform.spinner .bounce3{-webkit-animation-delay:-.2s;animation-delay:-.2s}.sform.spinner .bounce4{-webkit-animation-delay:-.1s;animation-delay:-.1s}@-webkit-keyframes sk-bouncedelay{0%,100%,80%{-webkit-transform:scale(0)}40%{-webkit-transform:scale(1)}}@keyframes sk-bouncedelay{0%,100%,80%{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}.row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;clear:right}.row .captcha-error{width:100%;padding-left:135px}.col-sm-10{position:relative;width:100%;min-height:1px}.checkbox.col-sm-10,.msgoutside.col-sm-10,.nolabel.col-sm-10,.submit-wrap.col-sm-10{float:right}.row.checkbox{float:right;width:calc(100% - 135px)}label.sform.col-sm-2{letter-spacing:-.05em}@media (min-width:576px){.col-sm-10{-ms-flex:0 0 calc(100% - 135px);flex:0 0 calc(100% - 135px);max-width:calc(100% - 135px)}.col-sm-2{-ms-flex:135px;flex:135px;max-width:135px;line-height:41px;padding-right:15px}}@media (max-width:575px){.col-sm-10{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.col-sm-2{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}}@media (max-width:1023px){.email.half,.name.half{width:100%;float:left}.lastname.half,.phone.half{width:100%;float:right}}.sform-bottom.rtl,.sform-introduction.rtl,form.sform.rtl{direction:rtl}.rtl .sform-field-group label span{display:inline-block;padding-right:5px;padding-left:0}.rtl .lastname.half,.rtl .phone.half{float:left}.rtl .email.half,.rtl .name.half{float:right}.rtl .row{clear:left}.rtl .checkbox.col-sm-10,.rtl .nolabel.col-sm-10{float:left}.rtl .checkmark{right:0}.rtl label.sform.checkbox:before{right:0}.rtl.basic label.sform.checkbox{padding-right:35px;padding-left:0}.rtl.rounded label.sform.checkbox{padding-right:72px;padding-left:0}.rtl.basic input.sform-field,.rtl.basic textarea.sform-field,.rtl.rounded input.sform-field,.rtl.rounded textarea.sform-field{padding:10px 16px 10px 32px}.rtl.basic div.captcha.is-invalid,.rtl.basic input.sform-field.is-invalid,.rtl.rounded div.captcha.is-invalid,.rtl.rounded input.sform-field.is-invalid{background-position:left 5px center}.rtl.basic textarea.sform-field.is-invalid,.rtl.rounded textarea.sform-field.is-invalid{background-position:top 14px left 5px}.rtl .sform-field.question{text-align:left;padding-left:0}.rtl .sform-field.captcha{padding-right:5px}.rtl.basic input.sform-field.question,.rtl.rounded input.sform-field.question{padding-right:0;padding-left:0}.rtl.basic input.sform-field.captcha,.rtl.rounded input.sform-field.captcha{padding-right:5px;padding-left:32px}.rtl .captcha-error.row{padding-right:135px}.rtl .error-des span{text-align:right}.rtl .msgoutside,.rtl .submit-wrap{float:left;width:100%}.rtl .sform-field-group .col-sm-2{padding-right:0}.rtl label.checkbox span{padding-left:0;padding-right:0}.rtl label.checkbox span.required-symbol{padding-right:5px}.rtl .sform-field-group label span.d-none{display:none}.rtl label.checkbox{margin-right:0;padding-right:50px;padding-left:0}.rtl .sform-field-group label{text-align:right}.rtl .row.checkbox{float:left}
  • simpleform/trunk/public/css/public.css

    r2568608 r2581779  
    4141.minimal input.sform-field { border: none; border-bottom: 2px solid #ccc; border-radius: 0; background-color: transparent; padding: 10px 0; }
    4242.transparent input.sform-field { border-width: 2px; border-color: #333; border-style: solid; border-radius: 0; background-color: transparent; padding: 10px 16px; }
     43.transparent.light input.sform-field, .transparent.light textarea.sform-field, .transparent.light .checkmark, .transparent.light div.captcha { border-color: #f8f8f8; }
    4344.highlighted input.sform-field { border: none; border-radius: 5px; background-color: #eaeaea; padding: 10px 16px; }
    4445.default textarea.sform-field { border-width: 1px; border-color: #ccc; border-style: solid; border-radius: 5px; background-color: #FFF; padding: 10px 16px; }
     
    6566.basic input.checkbox:checked + label .checkmark:after { content: "\2713"; display: block; }
    6667.basic input.checkbox + label { padding-left: 30px; margin-top: 10px; margin-bottom: 30px; line-height: 40px; }
    67 .rounded .checkmark { width: 52px; height: 26px; border-radius: 26px; background-color: #6c757d; }
    68 .rounded .checkmark:after { position: absolute; content: ""; height: 18px; width: 18px; left: 4px; bottom: 4px; border-radius: 50%; background-color: #FFF; -webkit-transition: .4s; transition: .4s; }
     68.rounded .checkmark { width: 52px; height: 26px; border: none; border-radius: 26px; background-color: #6c757d; }
     69.rounded .checkmark:after { position: absolute; display: inherit; content: ""; height: 18px; width: 18px; left: 4px; top: 4px; border-radius: 50%; background-color: #FFF; -webkit-transition: .4s; transition: .4s; }
    6970.rounded input.checkbox:checked + label .checkmark { background-color: #8bc34a; }
    7071.rounded input.checkbox:checked + label .checkmark:after { -webkit-transform: translateX(26px); -ms-transform: translateX(26px); transform: translateX(26px); }
  • simpleform/trunk/public/js/script-min.js

    r2568608 r2581779  
    1 !function(e){"use strict";e(window).load(function(){e("form.sform").submit(function(s){-1<window.location.href.indexOf("sending")&&window.history.pushState({},"",window.location.href.split("&sending")[0]),e(".sform-field,label.checkbox,div.captcha").removeClass("is-invalid"),e("form.sform").removeClass("was-validated"),e("form.sform").addClass("needs-validation"),e(".msgoutside span").removeClass("v-visible");var i=e(this).attr("form");e(this).addClass("was-validated");var a=!0;e(this).hasClass("needs-validation")&&""==e('input[name="url"]').val()&&""==e('input[name="telephone"]').val()&&(!1===e(this)[0].checkValidity()?(a=!1,e(this).find(".sform-field").each(function(){var s=e(this).attr("parent");e(this).is(":invalid")&&s==i&&(e(this).addClass("is-invalid"),e(this).parent(".captcha").addClass("is-invalid"))}),e(this).find("#errors-"+i+" span").addClass("v-visible"),1==e("#sform-consent-"+i).prop("required")&&0==e("#sform-consent-"+i).prop("checked")&&(e(this).find("#sform-consent-"+i).addClass("is-invalid"),e(this).find('label[for="sform-consent-'+i+'"]').addClass("is-invalid")),(e(this).hasClass("needs-focus")?e(this).find(":invalid").first():e(this).find("#errors-"+i)).focus()):e("#form-"+i).removeClass("needs-validation")),!1!==a&&""==e('input[name="url"]').val()&&""==e('input[name="telephone"]').val()||s.preventDefault()}),e("input,textarea").on("input",function(){var s=e(this).attr("parent"),i=e(this).attr("id");e(this).val(e(this).val().replace(/\s\s+/g," ")),e(this).is(":valid")?(e(this).removeClass("is-invalid"),e(this).prop("required")&&e("label[for="+i+"] span.mark").addClass("d-none"),e('label[for="'+e(this).attr("id")+'"]').removeClass("is-invalid"),e(this).next().children("span.required-symbol").removeClass("d-block"),e(this).parent(".captcha").removeClass("is-invalid"),e("#form-"+s).hasClass("needs-validation")?e("#form-"+s).find(":invalid").length||e(".message").removeClass("v-visible"):e("#form-"+s).find(".is-invalid").length||e(".message").removeClass("v-visible")):(e("#form-"+s).hasClass("was-validated")&&(e(this).addClass("is-invalid"),e('label[for="'+e(this).attr("id")+'"]').addClass("is-invalid"),e(this).parent(".captcha").addClass("is-invalid"),e(".message").hasClass("v-visible")||(s=e("input[name=multiple-errors]").val(),e(".message").addClass("v-visible"),e(".message").text(s))),e(this).prop("required")&&(e('label[for="'+i+'"] span.mark').removeClass("d-none"),e(this).next().children("span.required-symbol").addClass("d-block")))}),e(":checkbox").on("click",function(){0==e(this).prop("checked")?e(this).val("false"):e(this).val("true")}),e(".sform-field.captcha").focus(function(){e(this).parent().addClass("focus"),e(this).prev().addClass("focus")}).blur(function(){e(this).parent().removeClass("focus"),e(this).prev().removeClass("focus")}),e(".sform-field.question").on("click",function(){e(this).next().focus()}),e(".sform-field.captcha").on("input",function(s){var i=e(this).attr("id"),a=e(this).attr("parent");e(this).is(":valid")&&(e('label[for="'+i+'"] span.mark').addClass("d-none"),e(this).removeClass("is-invalid"),e("#"+i).removeClass("is-invalid"),e("#captcha-error-"+a+" span").removeClass("d-block"))}),e(".sform-field.captcha").on("keypress",function(s){48!==s.which||this.value.length||s.preventDefault()}),e("input, textarea").on("keypress",function(s){32!==s.which||this.value.length||s.preventDefault()})})}(jQuery);
     1!function(e){"use strict";e(window).load(function(){e("form.sform").submit(function(s){-1<window.location.href.indexOf("sending")&&window.history.pushState({},"",window.location.href.split("&sending")[0]),e(".sform-field,label.checkbox,div.captcha").removeClass("is-invalid"),e("form.sform").removeClass("was-validated"),e("form.sform").addClass("needs-validation"),e(".msgoutside span").removeClass("v-visible");var i=e(this).attr("form");e(this).addClass("was-validated");var a=!0;e(this).hasClass("needs-validation")&&""==e('input[name="url"]').val()&&""==e('input[name="telephone"]').val()&&(!1===e(this)[0].checkValidity()?(a=!1,e(this).find(".sform-field").each(function(){var s=e(this).attr("parent");e(this).is(":invalid")&&s==i&&(e(this).addClass("is-invalid"),e(this).parent(".captcha").addClass("is-invalid"))}),e(this).find("#errors-"+i+" span").addClass("v-visible"),1==e("#sform-consent-"+i).prop("required")&&0==e("#sform-consent-"+i).prop("checked")&&(e(this).find("#sform-consent-"+i).addClass("is-invalid"),e(this).find('label[for="sform-consent-'+i+'"]').addClass("is-invalid")),(e(this).hasClass("needs-focus")?e(this).find(":invalid").first():e(this).find("#errors-"+i)).focus()):e("#form-"+i).removeClass("needs-validation")),!1!==a&&""==e('input[name="url"]').val()&&""==e('input[name="telephone"]').val()||s.preventDefault()}),e("input,textarea").on("input",function(){var s=e(this).attr("parent"),i=e(this).attr("id");e(this).is(":valid")?(e(this).removeClass("is-invalid"),e(this).prop("required")&&e("label[for="+i+"] span.mark").addClass("d-none"),e('label[for="'+e(this).attr("id")+'"]').removeClass("is-invalid"),e(this).next().children("span.required-symbol").removeClass("d-block"),e(this).parent(".captcha").removeClass("is-invalid"),e("#form-"+s).hasClass("needs-validation")?e("#form-"+s).find(":invalid").length||e(".message").removeClass("v-visible"):e("#form-"+s).find(".is-invalid").length||e(".message").removeClass("v-visible")):(e("#form-"+s).hasClass("was-validated")&&(e(this).addClass("is-invalid"),e('label[for="'+e(this).attr("id")+'"]').addClass("is-invalid"),e(this).parent(".captcha").addClass("is-invalid"),e(".message").hasClass("v-visible")||(s=e("input[name=multiple-errors]").val(),e(".message").addClass("v-visible"),e(".message").text(s))),e(this).prop("required")&&(e('label[for="'+i+'"] span.mark').removeClass("d-none"),e(this).next().children("span.required-symbol").addClass("d-block")))}),e(":checkbox").on("click",function(){0==e(this).prop("checked")?e(this).val("false"):e(this).val("true")}),e(".sform-field.captcha").focus(function(){e(this).parent().addClass("focus"),e(this).prev().addClass("focus")}).blur(function(){e(this).parent().removeClass("focus"),e(this).prev().removeClass("focus")}),e(".sform-field.question").on("click",function(){e(this).next().focus()}),e(".sform-field.captcha").on("input",function(s){var i=e(this).attr("id"),a=e(this).attr("parent");e(this).is(":valid")&&(e('label[for="'+i+'"] span.mark').addClass("d-none"),e(this).removeClass("is-invalid"),e("#"+i).removeClass("is-invalid"),e("#captcha-error-"+a+" span").removeClass("d-block"))}),e(".sform-field.captcha").on("keypress",function(s){48!==s.which||this.value.length||s.preventDefault()}),e("input, textarea").on("keypress",function(s){32!==s.which||this.value.length||s.preventDefault()})})}(jQuery);
  • simpleform/trunk/public/js/script.js

    r2568608 r2581779  
    44     $( window ).load(function() {
    55 
    6  
    7        // If AJAX Submission is disabled and the form has already been validated unblock the submit
    8        // if ( $("#sform").find(".is-invalid").length ) {     
    9         //  $("#sform").addClass("was-validated");
    10         //  $("#sform").removeClass("needs-validation");
    11       // }   
    12 
    136       $("form.sform").submit(function(event) {
    14            
    157         // Clear url parameters if the form has been submitted
    168         if ( window.location.href.indexOf("sending") > -1 ) {
    179            window.history.pushState({}, "", window.location.href.split("&sending")[0]);
    1810         }
    19            
    20          // Clear all invalid fields if any
     11         // Clear all invalid fields if any in all forms found on the page
    2112         $(".sform-field,label.checkbox,div.captcha").removeClass("is-invalid");
    2213         $("form.sform").removeClass("was-validated");
    2314         $("form.sform").addClass("needs-validation");
    2415         $(".msgoutside span").removeClass("v-visible");
    25          
    2616         var form = $(this).attr('form');
    2717         $(this).addClass("was-validated");
    2818         var submit = true;
    29          
    3019         if( $(this).hasClass("needs-validation") && $('input[name="url"]').val() == '' && $('input[name="telephone"]').val() == '' ) {
    31            
    3220           if ($(this)[0].checkValidity() === false ) {
    3321             submit = false;
    34              
    3522             $(this).find('.sform-field').each(function(){
    36              
    3723               var parent = $(this).attr('parent'); 
    38 
    3924               if ($(this).is(":invalid") && parent == form ) {
    4025                 $(this).addClass("is-invalid");
     
    4227               }
    4328             })
    44              
    4529             $(this).find('#errors-' + form + ' span').addClass('v-visible');   
    46              
    4730             if( $('#sform-consent-' + form).prop('required') == true && $('#sform-consent-' + form ).prop("checked") == false ) {
    4831                 $(this).find('#sform-consent-' + form).addClass("is-invalid");
    4932                 $(this).find('label[for="sform-consent-' + form + '"]').addClass('is-invalid');
    5033             } 
    51              
    5234             if( $(this).hasClass("needs-focus") ) {
    5335                 $(this).find(":invalid").first().focus();
     
    6143           }
    6244         }
    63          
    6445         if ( submit === false || $('input[name="url"]').val() != '' || $('input[name="telephone"]').val() != '' ) {
    6546           event.preventDefault();
    6647         }
    67          
    6848       });
    6949   
    7050       $( "input,textarea" ).on("input", function()  {
    71            
    7251         var form = $(this).attr('parent');
    73          var field = $(this).attr('id');         
    74          $(this).val($(this).val().replace(/\s\s+/g, " "));
    75 
     52         var field = $(this).attr('id');
    7653         if ( $(this).is(":valid") ) {   
    7754            $(this).removeClass("is-invalid");
     
    8865              }
    8966            }
    90            
    9167            else {     
    9268              if ( ! $('#form-' + form).find(".is-invalid").length ) { 
     
    9470              }
    9571            }
    96            
    9772         }
    9873         else {   
     
    131106       }) 
    132107       
    133        $( ".sform-field.captcha" ).on('input', function(e)  {
     108       $(".sform-field.captcha").on('input', function(e)  {
    134109          var field = $(this).attr('id');
    135110          var form = $(this).attr('parent');     
  • simpleform/trunk/public/partials/form-variables.php

    r2568608 r2581779  
    2222$form_template = ! empty( $settings['form_template'] ) ? esc_attr($settings['form_template']) : 'default';
    2323$form_style = ' ' . $form_template;
     24$borders = ! empty( $settings['form_borders'] ) ? esc_attr($settings['form_borders']) : 'dark';
     25$form_borders = ' ' . $borders;
    2426$characters_length = ! empty( $settings['characters_length'] ) ? esc_attr($settings['characters_length']) : 'true';
    25 $form_description = apply_filters( 'sform_block_description', $check_var );
    26 $introduction_text = ! empty ( $attributes['introduction_text'] ) && empty($form_description) ? stripslashes(wp_kses_post($attributes['introduction_text'])) : '';
    27 $form_ending = apply_filters( 'sform_block_ending', $check_var );
    28 $bottom_text = ! empty( $attributes['bottom_text'] ) && empty($form_ending) ? stripslashes(wp_kses_post($attributes['bottom_text'])) : '';
     27$form_description = apply_filters( 'sform_block_description', $atts_array['id'], $check_var );
     28$introduction_text = ! empty ( $attributes['introduction_text'] ) && ! empty($form_description) ? stripslashes(wp_kses_post($attributes['introduction_text'])) : '';
     29$form_ending = apply_filters( 'sform_block_ending', $atts_array['id'], $check_var );
     30$bottom_text = ! empty( $attributes['bottom_text'] ) && ! empty($form_ending) ? stripslashes(wp_kses_post($attributes['bottom_text'])) : '';
    2931$required_sign = ! empty( $attributes['required_sign'] ) ? esc_attr($attributes['required_sign']) : 'true';
    3032$required_word = ! empty( $attributes['required_word'] ) ? esc_attr($attributes['required_word']) : '';
     
    254256$ajax_form = $ajax == 'true' ? ' ajax' : '';
    255257$form_focus = $focus != 'alert' ? ' needs-focus' : '';
    256 $form_class = $form_direction == 'rtl' ? 'rtl ' . $form_validation . $form_focus . $form_style . $ajax_form : $form_validation . $form_focus . $form_style . $ajax_form;
     258$form_class = $form_direction == 'rtl' ? 'rtl ' . $form_validation . $form_focus . $form_style . $form_borders . $ajax_form : $form_validation . $form_focus . $form_style . $form_borders . $ajax_form;
    257259$preference_field = ! empty( $attributes['preference_field'] ) ? esc_attr($attributes['preference_field']) : 'hidden';
    258260$preference_label = ! empty( $attributes['preference_label'] ) ? stripslashes(wp_kses_post($attributes['preference_label'])) : '';
  • simpleform/trunk/simpleform.php

    r2568608 r2581779  
    66 * Plugin URI:        https://wpsform.com
    77 * Description:       Create a basic contact form for your website. Lightweight and very simple to manage, SimpleForm is immediately ready to use.
    8  * Version:           2.0.3
     8 * Version:           2.0.4
    99 * Requires at least: 5.2
    1010 * Requires PHP:      5.6
     
    2727 
    2828define( 'SIMPLEFORM_NAME', 'SimpleForm' );
    29 define( 'SIMPLEFORM_VERSION', '2.0.3' );
    30 define( 'SIMPLEFORM_DB_VERSION', '2.0.2' );
     29define( 'SIMPLEFORM_VERSION', '2.0.4' );
     30define( 'SIMPLEFORM_DB_VERSION', '2.0.4' );
    3131define( 'SIMPLEFORM_PATH', plugin_dir_path( __FILE__ ) );
    3232define( 'SIMPLEFORM_URL', plugin_dir_url( __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.