• Resolved aliakseyenkaihar

    (@aliakseyenkaihar)


    At simple-board-job/public/js/simple-job-board-public.js on line 55 is a typo

    jobpost_submit_button.attr(‘disabled’, ‘diabled’);

    which should be diSabled:
    jobpost_submit_button.attr(‘disabled’, ‘disabled’);

Viewing 3 replies - 1 through 3 (of 3 total)
  • Chang

    (@changf)

    Hi,

    Thank you for reaching out to us and we hope you’re doing well. Also, thank you for bringing up the typo error, we will fix this in our next release.

    Please reach out to us in case of any other questions or concerns.

    Regards,

    Thread Starter aliakseyenkaihar

    (@aliakseyenkaihar)

    Hi, Chang! Thanks for a quick reply!

    Well, maybe, it’s not concerns or question, it’s more like a suggestions, but I don’t know, where can I propose it.

    So, in admin/settings/class-simple-board-settings-upload-file-extensions.php from line 79
    do_action('sjb_file_extension_options_start');
    till
    do_action('sjb_file_extension_options_end');
    are extension checkboxes.

    I wanna add ppt and pptx support, so I’ve simply copied one of the form-field, replace all extensions and hooked into ‘sjb_file_extension_options_start’. It works fine, but I think, all extensions should be in array and loop them throw foreach like this

    <?php
    /**
     * Action -> Add new extension at the start of list.
     *
     * @since 2.8.3
     */
    do_action('sjb_file_extension_options_start');
    ?>
    
    <?php
    $exts = ['pdf', 'doc', 'docx', 'odt', 'rtf', 'txt']; // Default
    $exts = apply_filters('sjb_available_exts', $exts);
    
    $exts = array_map('esc_html', $exts);
    $exts = array_unique($exts);
    
    foreach( $exts as $ext ) { ?>
    
        <div class="sjb-form-group sjb-extensions">
            <?php
            if( FALSE !== get_option('job_board_all_extensions_check')){
                if( 'no' === get_option('job_board_all_extensions_check') ){
                    if( FALSE !== get_option('job_board_upload_file_ext')){
                        if(in_array($ext, get_option('job_board_upload_file_ext'))){
                            $selected = 'checked';
                        }
                        else{
                            $selected = '';
                        }
                    }
                    else{
                        $selected = 'checked';
                    }
                }
                else{
                    $selected = 'checked';
                }
            }
            else{
                $selected = 'checked';
            }
    
            if( file_exists(plugin_dir_url(dirname(dirname(__FILE__))) . 'admin/images/' . $ext . '.png') ) {
                $icon =  'admin/images/' . $ext . '.png';
            } else {
                $icon = 'admin/images/doc.png'; // Backup icon for unknown extension
            }
            ?>
    
            <input type="checkbox" id="upload_file_ext_<?php echo $ext; ?>" name="file_extensions[]" value="<?php echo $ext; ?>" <?php echo $selected; ?>>
            <input type="hidden" name="upload_file_ext_<?php echo $ext; ?>" value="upload_file_ext_<?php echo $ext; ?>">
            <label for="upload_file_ext_<?php echo $ext; ?>">
                <img src="<?php echo plugin_dir_url(dirname(dirname(__FILE__))) . $icon ?>">
                <span><?php echo esc_html( $ext ); ?></span>
            </label>
        </div>
    <?php }
    
    /**
     * Action -> Add new extension at the end of list.
     *
     * @since 2.2.0
     */
    do_action('sjb_file_extension_options_end');

    In that case all I need to do in my functions.php is

    function add_powerpoint_extensions($exts) {
    	$new_exts = ['pptx', 'ppt'];
    	return array_merge($exts, $new_exts);
    }
    add_filter( 'sjb_available_exts', 'add_powerpoint_extensions');

    Which is much easier.

    Also there is a little UX-problem – when ‘all extensions’-checkbox is checked (true === job_board_all_extensions_check), I still able to uncheck any extension and when I hit save, it still checked, because ‘all extensions’ is overwriting it. It’s a little bit confusing. So I have to uncheck ‘all extensions’ first, and then uncheck my unneeded extension.
    I guess, it possible to add ‘change’-event on input in js, which will set #all-file-ext checked property to false or something similar to that.

    Chang

    (@changf)

    Hi,

    Thank you for sharing your suggestion and we have noted it down.

    For further suggestions, you can contact : [email protected]

    You have a great rest of the day ahead.

    Regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Typo in plugin’ is closed to new replies.