Plugin Directory

Changeset 3422358


Ignore:
Timestamp:
12/17/2025 10:29:56 PM (3 months ago)
Author:
archaeopath
Message:

init 1.4.1

Location:
wp-tournament-registration/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • wp-tournament-registration/trunk/assets/load.php

    r2390367 r3422358  
    77        'wptournreg', // $handle
    88        WP_TOURNREG_JS_URL, // $url
    9         array( 'jquery', 'wptournregtablesorter' ), // $deps
     9        array( 'jquery', 'wptournreginputdropdown', 'wptournregtablesorter' ), // $deps
    1010        WP_TOURNREG_PLUGIN_VER, // $ver
    1111        true // $in_footer
     
    1515        'wptournreg', // $handle
    1616        WP_TOURNREG_CSS_URL, // $url
    17         array( 'wptournregtablesorter' ), // $deps
     17        array( 'wptournreginputdropdown', 'wptournregtablesorter' ), // $deps
    1818        WP_TOURNREG_PLUGIN_VER, // $ver
    1919        false // $in_footer
    2020    );
     21   
    2122}
    2223
  • wp-tournament-registration/trunk/assets/wptournreg.js

    r2390367 r3422358  
    3939    }
    4040});
     41
     42var wptournregsuggestions = false;
     43$( '.wptournreg-form [data-field-suggestions]').on( 'mouseover touchover', function() {
     44   
     45    if ( wptournregsuggestions === false ) {
     46       
     47        wptournregsuggestions = true;
     48        let elem = jQuery( this );
     49        let arr = elem.data('field-suggestions').split(',');
     50        let dataList = [];
     51       
     52        for (let index = 0; index < arr.length; ++index) {
     53            const element = arr[index];
     54            const value =
     55            dataList[index] = { name:element, value:element.replace(/\s+/g, '&nbsp;') }
     56        }
     57       
     58        elem.inputDropdown(dataList, {
     59            formatter: data => {
     60            return `<li language=${data.value}>${data.name}</li>`
     61        },
     62            valueKey: 'language' // default: data-value
     63        })
     64        elem.removeData( 'field-suggestions' );
     65    }
     66});
  • wp-tournament-registration/trunk/readme.md

    r3421479 r3422358  
    1111## License
    1212
    13 © 2020–2025 Ingram Braun [https://ingram-braun.net/](https://ingram-braun.net/#ib_campaign=wptournreg&ib_medium=repository&ib_source=readme&ib_content=copyright)
     13© 2020–2026 Ingram Braun [https://ingram-braun.net/](https://ingram-braun.net/#ib_campaign=wptournreg&ib_medium=repository&ib_source=readme&ib_content=copyright)
    1414
    1515This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
     
    1919`jQuery.tablesorter` is © Christian Bach and Rob Garrison [MIT or GPL](https://mottie.github.io/tablesorter/docs/)
    2020
     21`jquery.input-dropdown` is © Kohei Mizobata [MIT](https://github.com/kohei-kp/jquery.input-dropdown)
     22
    2123## Donate
    2224
  • wp-tournament-registration/trunk/readme.txt

    r3421476 r3422358  
    66Tested up to: 6.9
    77Requires PHP: 7.0
    8 Stable tag: 1.4.0
     8Stable tag: 1.4.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9696* `field` one of the field names (cf. list above).
    9797* `label` the label of the field.
     98* `options` a comma separated list of options for a suggestion list. Takes only effect in text input fields.
    9899* `placeholder` the placeholder is shown in an empty field.
    99100* `required` if set to any value the field is marked as required.
     
    103104The first example is a registration form. Several `wptournregfield` shortcodes are wrapped by a `wptournregfield` one. You can put HTML elements between (fi. fieldsets) in order to design your form:
    104105
    105 `[wptournregform tournament_id="my_tournament" css_id="my_tournament" email="subscription@example.com"]<p>Red labels indicate required fields!</p><fieldset><legend>Who you are</legend>[wptournregfield field="lastname" label="Family name" required="1" /][wptournregfield field="firstname" label="Christian name" required="1" /][wptournregfield field="affiliation" label="Club" required="1" placeholder="or 'free agent'" /][wptournregfield field="rating1" label="DWZ"  /]</fieldset><fieldset><legend>Your contact data (not to be published)</legend>[wptournregfield field="email" label="E-mail" /][wptournregfield field="phone1" label="Phone 1" required="1" /][wptournregfield field="phone2" label="Phone 2" /]</fieldset>[wptournregfield field="message" label="Your message" placeholder="Whatever you like to tell us." /][/wptournregform]`
     106`[wptournregform tournament_id="my_tournament" css_id="my_tournament" email="subscription@example.com"]<p>Red labels indicate required fields!</p><fieldset><legend>Who you are</legend>[wptournregfield field="lastname" label="Family name" required="1" /][wptournregfield field="firstname" label="Christian name" required="1" /][wptournregfield field="affiliation" label="Club" required="1" placeholder="or 'free agent'" options="Paris SG, Hertha Berlin, Oslo CC" /][wptournregfield field="rating1" label="DWZ"  /]</fieldset><fieldset><legend>Your contact data (not to be published)</legend>[wptournregfield field="email" label="E-mail" /][wptournregfield field="phone1" label="Phone 1" required="1" /][wptournregfield field="phone2" label="Phone 2" /]</fieldset>[wptournregfield field="message" label="Your message" placeholder="Whatever you like to tell us." /][/wptournregform]`
    106107
    107108The next instance is an editor for the data of the tournament. The non-approved players are highlihted in the selection list:
     
    172173== Changelog ==
    173174
     175= 1.4.1 =
     176
     177* dropdown lists for text fields
     178* some internal code optimizations
     179
    174180= 1.4.0 =
    175181
    176 * Security issue fixed
     182* security fix
    177183
    178184= 1.3.0 =
  • wp-tournament-registration/trunk/shortcodes/field.php

    r3421476 r3422358  
    2222        'field' => null,
    2323        'label' => null,
     24        'options' => null,
    2425        'placeholder' => null,
    2526        'required' => null,
     
    3031    $label = '<label for="' . $field . '">' . ( empty ( $a[ 'label' ] ) ? $field : sanitize_text_field( $a[ 'label' ] ) ) . '</label>';
    3132    $name=' name="' . $field . '"';
     33    $options =  ( empty ( $a[ 'options' ] ) ) ? '' : preg_split( '/\s*,\s*/', sanitize_text_field( trim(  $a[ 'options' ] ) ) );
     34    if ( is_array( $options ) ) {
     35        $options = "autocomplete='off' data-field-suggestions='" . implode( ',', $options ) . "'";
     36    }
    3237    $placeholder = ( empty ( $a[ 'placeholder' ] ) ) ? '' : ' placeholder="' . esc_attr( trim( $a[ 'placeholder' ] ) ) . '"';
    3338    $required = ( !isset( $a[ 'required' ] ) ) ? '' : ' required';
     
    6671    else if ( preg_match( '/char|string|text/i', $scheme[ $field ] ) ) {
    6772   
    68         return "<p$id$class$css>$label<input$id$class$name$required$disabled$placeholder type='text' size='$bigsize'></p>";
     73        return "<p$id$class$css>$label<input$id$class$name$required$disabled$placeholder$options type='text' size='$bigsize'></p>";
    6974    }
    7075    else if ( preg_match( '/bool|int\(1\)/i', $scheme[ $field ] ) ) {
  • wp-tournament-registration/trunk/shortcodes/list.php

    r2432703 r3422358  
    4343    $scheme = wptournreg_get_field_list();
    4444   
    45     $fields = preg_split( '/\s*,\s*/', $a[ 'display_fields' ]);
    46     $protected_fields = preg_split( '/\s*,\s*/', $a[ 'protected_fields' ]);
     45    $fields = preg_split( '/\s*,\s*/', sanitize_text_field( trim( $a[ 'display_fields' ] ) ) );
     46    $protected_fields = ( empty ( $a[ 'protected_fields' ] ) ) ? '' : preg_split( '/\s*,\s*/', sanitize_text_field( trim(  $a[ 'protected_fields' ] ) ) );
    4747   
    4848    /* add custom CSS */
  • wp-tournament-registration/trunk/wp-tournament-registration.php

    r3421476 r3422358  
    66* Plugin Name:         WP Tournament Registration
    77* Plugin URI:          https://ingram-braun.net/erga/wp-tournament-registration-wordpress-plugin/
    8 * Version:             1.4.0
     8* Version:             1.4.1
    99* Requires at least:   5.3
    1010* Requires PHP:        7.0
     
    2020/* VERSIONS */
    2121define( "WP_TOURNREG_DB_VER", 5 );
    22 define( "WP_TOURNREG_PLUGIN_VER", '1.4.0' );
     22define( "WP_TOURNREG_PLUGIN_VER", '1.4.1' );
    2323define( "WP_TOURNREG_TBSORT_VER", '2.31.3' );
    2424
     
    3939define( "WP_TOURNREG_TBSORTJS_URL", plugins_url( 'assets/jquery.tablesorter/js/jquery.tablesorter.min.js', __FILE__ ) );
    4040define( "WP_TOURNREG_TBSORTCSS_URL", plugins_url( 'assets/jquery.tablesorter/css/theme.default.min.css', __FILE__ ) );
     41define( "WP_TOURNREG_DROPDOWNJS_URL", plugins_url( 'assets/suggestion-input-dropdown/jquery.input-dropdown.js', __FILE__ ) );
     42define( "WP_TOURNREG_DROPDOWNCSS_URL", plugins_url( 'assets/suggestion-input-dropdown/jquery.input-dropdown.css', __FILE__ ) );
     43
    4144
    4245/* TABLE NAME */
     
    6972require_once WP_TOURNREG_SHORTCODE_PATH . 'export.php';
    7073
     74require_once WP_TOURNREG_ASSETS_PATH . 'input_dropdown.php';
    7175require_once WP_TOURNREG_ASSETS_PATH . 'tablesort.php';
    7276require_once WP_TOURNREG_ASSETS_PATH . 'load.php';
Note: See TracChangeset for help on using the changeset viewer.