Plugin Directory

Changeset 3372829


Ignore:
Timestamp:
10/04/2025 12:21:36 PM (5 months ago)
Author:
newcodebyte
Message:

Reset button moved

Location:
smart-external-links-manager
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • smart-external-links-manager/tags/1.3.4/css/welm-admin.css

    r3372798 r3372829  
    265265    color: #fff !important;
    266266}
     267
     268/* --- Stili per il Contenitore delle Azioni del Form --- */
     269.welm-form-actions {
     270    display: flex;
     271    align-items: center; /* Allinea verticalmente i pulsanti */
     272    gap: 10px; /* Aggiunge un piccolo spazio tra i pulsanti */
     273}
     274
     275/* Rimuove il margine dal paragrafo del pulsante Salva per un allineamento corretto */
     276.welm-form-actions .submit {
     277    margin: 0;
     278    padding: 0;
     279}
  • smart-external-links-manager/tags/1.3.4/js/welm-admin.js

    r3372798 r3372829  
    4444
    4545        // Gestione conferma per il reset delle impostazioni
    46         $('#welm-reset-form').on('submit', function(e) {
     46        $('#welm-reset-button-trigger').on('click', function(e) {
     47            e.preventDefault(); // Previene qualsiasi azione di default del pulsante
     48
    4749            // Usa la funzione di conferma nativa del browser
    48             if (!confirm('Are you sure you want to reset all settings to their default values? This action cannot be undone.')) {
    49                 e.preventDefault(); // Annulla l'invio del form se l'utente clicca "Annulla"
     50            if (confirm('Are you sure you want to reset all settings to their default values? This action cannot be undone.')) {
     51                // Se l'utente clicca "OK", invia il form nascosto
     52                $('#welm-reset-form').submit();
    5053            }
    51         });       
     54        });     
    5255
    5356        // --- GESTIONE LISTE (Force/Ignore) ---
  • smart-external-links-manager/tags/1.3.4/smart-external-links-manager.php

    r3372798 r3372829  
    530530        <?php
    531531    }
    532 
    533     // Aggiungi queste due funzioni dentro la classe
    534532
    535533    public function render_field_enable_tooltip() {
     
    630628            <!-- Scheda 1: Settings -->
    631629            <div id="tab-settings" class="tab-content">
     630                <!-- Form principale per il salvataggio -->
    632631                <form method="post" action="options.php">
    633632                    <?php
    634633                        settings_fields('welm_options_group');
    635634                        do_settings_sections('smart_external_links_manager');
    636                         submit_button();
    637635                    ?>
     636                    <!-- Contenitore per i pulsanti -->
     637                    <div class="welm-form-actions">
     638                        <?php submit_button(); ?>
     639                        <!-- Qui mettiamo solo un pulsante finto, non un form -->
     640                        <button type="button" id="welm-reset-button-trigger" class="button button-large welm-reset-button">
     641                            <?php esc_html_e('Reset to Default Settings', 'smart-external-links-manager'); ?>
     642                        </button>
     643                    </div>
    638644                </form>
    639                 <form method="post" id="welm-reset-form" style="margin-top: 20px;">
     645
     646                <!-- Form di reset, nascosto e separato -->
     647                <form method="post" id="welm-reset-form" style="display: none;">
    640648                    <input type="hidden" name="welm_action" value="reset_settings" />
    641649                    <?php wp_nonce_field('welm_reset_nonce_action'); ?>
    642                     <button type="submit" class="button button-large welm-reset-button">
    643                         <?php esc_html_e('Reset to Default Settings', 'smart-external-links-manager'); ?>
    644                     </button>
    645                 </form>               
     650                </form>
    646651            </div>
    647652
  • smart-external-links-manager/trunk/css/welm-admin.css

    r3372798 r3372829  
    265265    color: #fff !important;
    266266}
     267
     268/* --- Stili per il Contenitore delle Azioni del Form --- */
     269.welm-form-actions {
     270    display: flex;
     271    align-items: center; /* Allinea verticalmente i pulsanti */
     272    gap: 10px; /* Aggiunge un piccolo spazio tra i pulsanti */
     273}
     274
     275/* Rimuove il margine dal paragrafo del pulsante Salva per un allineamento corretto */
     276.welm-form-actions .submit {
     277    margin: 0;
     278    padding: 0;
     279}
  • smart-external-links-manager/trunk/js/welm-admin.js

    r3372798 r3372829  
    4444
    4545        // Gestione conferma per il reset delle impostazioni
    46         $('#welm-reset-form').on('submit', function(e) {
     46        $('#welm-reset-button-trigger').on('click', function(e) {
     47            e.preventDefault(); // Previene qualsiasi azione di default del pulsante
     48
    4749            // Usa la funzione di conferma nativa del browser
    48             if (!confirm('Are you sure you want to reset all settings to their default values? This action cannot be undone.')) {
    49                 e.preventDefault(); // Annulla l'invio del form se l'utente clicca "Annulla"
     50            if (confirm('Are you sure you want to reset all settings to their default values? This action cannot be undone.')) {
     51                // Se l'utente clicca "OK", invia il form nascosto
     52                $('#welm-reset-form').submit();
    5053            }
    51         });       
     54        });     
    5255
    5356        // --- GESTIONE LISTE (Force/Ignore) ---
  • smart-external-links-manager/trunk/smart-external-links-manager.php

    r3372798 r3372829  
    530530        <?php
    531531    }
    532 
    533     // Aggiungi queste due funzioni dentro la classe
    534532
    535533    public function render_field_enable_tooltip() {
     
    630628            <!-- Scheda 1: Settings -->
    631629            <div id="tab-settings" class="tab-content">
     630                <!-- Form principale per il salvataggio -->
    632631                <form method="post" action="options.php">
    633632                    <?php
    634633                        settings_fields('welm_options_group');
    635634                        do_settings_sections('smart_external_links_manager');
    636                         submit_button();
    637635                    ?>
     636                    <!-- Contenitore per i pulsanti -->
     637                    <div class="welm-form-actions">
     638                        <?php submit_button(); ?>
     639                        <!-- Qui mettiamo solo un pulsante finto, non un form -->
     640                        <button type="button" id="welm-reset-button-trigger" class="button button-large welm-reset-button">
     641                            <?php esc_html_e('Reset to Default Settings', 'smart-external-links-manager'); ?>
     642                        </button>
     643                    </div>
    638644                </form>
    639                 <form method="post" id="welm-reset-form" style="margin-top: 20px;">
     645
     646                <!-- Form di reset, nascosto e separato -->
     647                <form method="post" id="welm-reset-form" style="display: none;">
    640648                    <input type="hidden" name="welm_action" value="reset_settings" />
    641649                    <?php wp_nonce_field('welm_reset_nonce_action'); ?>
    642                     <button type="submit" class="button button-large welm-reset-button">
    643                         <?php esc_html_e('Reset to Default Settings', 'smart-external-links-manager'); ?>
    644                     </button>
    645                 </form>               
     650                </form>
    646651            </div>
    647652
Note: See TracChangeset for help on using the changeset viewer.