Plugin Directory

Changeset 3421337


Ignore:
Timestamp:
12/16/2025 06:31:30 PM (4 months ago)
Author:
viarete
Message:

Release 1.3.0: metabox restyle, extra brief field and validation

Location:
immobiliareai
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • immobiliareai/tags/1.3.0/css/admin.css

    r3321760 r3421337  
    1010
    1111#ai-fields label {
    12   display: block;
    13   margin-bottom: 8px;
     12  display: flex;
     13  flex-direction: column;
     14  margin-bottom: 20px;
     15}
     16
     17#ai-fields label.vuota {
     18  display: none;
    1419}
    1520
     
    1924  padding: 5px;
    2025  margin-top: 2px;
     26}
     27
     28#ai-fields input#ai_terrazzo {
     29  width: 1.5rem;
     30  height: 1.5rem;
     31  order: 2;
     32}
     33#ai-fields input#ai_terrazzo[type="checkbox"]:checked::before {
     34  height: 1.5rem;
     35  width: 1.7rem;
     36}
     37#ai_extra {
     38  display: block;
     39  width: 100%;
     40  padding: 5px;
     41  margin-top: 2px;
     42}
     43
     44#ai_extra::placeholder {
     45  font-style: italic;
     46  color: grey;
     47  font-size: 14px;
     48}
     49
     50.ai-extra-counter-wrapper {
     51  display: flex;
     52  justify-content: end;
     53  color: red;
     54  font-size: 15px;
     55}
     56#ai-fields .ai-extra-full label {
     57  margin-bottom: 10px;
    2158}
    2259
     
    5491  background-color: #dedede;
    5592}
    56 @media (min-width: 992px) {
     93
     94@media (min-width: 1200px) {
    5795  .col-tre {
    5896    display: flex;
     
    62100    width: 30%;
    63101  }
     102  .col-sei label {
     103    width: 50%;
     104  }
     105  .col-quattro label {
     106    width: 25%;
     107  }
     108  #ai-fields label.terrazzo {
     109    display: block;
     110    padding-top: 25px;
     111  }
     112  #ai-fields label.vuota {
     113    display: flex;
     114  }
     115  .col-tre:nth-child(3) label:nth-child(3) {
     116    display: block !important;
     117    height: 25px;
     118    margin-top: 25px;
     119  }
    64120}
  • immobiliareai/tags/1.3.0/immobiliareai.php

    r3390444 r3421337  
    33Plugin Name: ImmobiliareAI
    44Description: Generate real estate descriptions with AI (Artificial Intelligence) in the post editor.
    5 Version: 1.2.5
     5Version: 1.3.0
    66Author: Fabio Mario Giacomini
    77Author URI: https://viarete.it
     
    1717    exit; // Exit if accessed directly
    1818}
    19 
    2019add_action('add_meta_boxes', function () {
    2120    add_meta_box('immobi_ai_desc_box', __('Generate property description with AI', 'immobiliareai'), 'immobi_desc_box_html', 'post', 'normal', 'high');
    2221});
    23 
    2422function immobi_desc_box_html($post)
    2523{
    2624    ?>
    2725    <div id="ai-fields">
     26        <!-- Riga 1: Zona – Tipologia – Stato -->
    2827        <div class="col-tre">
     28            <label><?php esc_html_e('Area:', 'immobiliareai'); ?>
     29                <input type="text" id="ai_zona" maxlength="37">
     30            </label>
    2931            <label><?php esc_html_e('Property type:', 'immobiliareai'); ?>
    3032                <select id="ai_tipologia">
     
    4143                </select>
    4244            </label>
    43             <label><?php esc_html_e('Surface (sqm):', 'immobiliareai'); ?> <input type="number" id="ai_superficie"></label>
    44             <label><?php esc_html_e('Area:', 'immobiliareai'); ?> <input type="text" id="ai_zona"></label>
    45         </div>
    46 
     45            <label><?php esc_html_e('Condition:', 'immobiliareai'); ?>
     46                <select id="ai_stato">
     47                    <option value=""><?php esc_html_e('Select condition', 'immobiliareai'); ?></option>
     48                    <option value="Nuovo / In costruzione"><?php esc_html_e('New / Under construction', 'immobiliareai'); ?>
     49                    </option>
     50                    <option value="Ottimo / Ristrutturato"><?php esc_html_e('Excellent / Renovated', 'immobiliareai'); ?>
     51                    </option>
     52                    <option value="Buono / Abitabile"><?php esc_html_e('Good / Habitable', 'immobiliareai'); ?></option>
     53                    <option value="Da ristrutturare"><?php esc_html_e('To renovate', 'immobiliareai'); ?></option>
     54                </select>
     55            </label>
     56        </div>
     57
     58        <!-- Riga 2: Piano – Cucina -->
    4759        <div class="col-tre">
    4860            <label><?php esc_html_e('Floor:', 'immobiliareai'); ?>
     
    6072                </select>
    6173            </label>
    62             <label><?php esc_html_e('Bathrooms:', 'immobiliareai'); ?> <input type="number" id="ai_bagni"></label>
    6374            <label><?php esc_html_e('Kitchen:', 'immobiliareai'); ?>
    6475                <select id="ai_cucina">
     
    7081                </select>
    7182            </label>
    72         </div>
    73 
     83            <label><?php esc_html_e('Surface (sqm):', 'immobiliareai'); ?>
     84                <input type="number" id="ai_superficie" min="10" max="9999">
     85            </label>
     86        </div>
     87
     88        <!-- Riga 3: Superficie – Bagni – Terrazzo (checkbox) -->
    7489        <div class="col-tre">
    75             <label><?php esc_html_e('Terrace:', 'immobiliareai'); ?>
    76                 <select id="ai_terrazzo">
    77                     <option value="true"><?php esc_html_e('Yes', 'immobiliareai'); ?></option>
    78                     <option value="false" selected><?php esc_html_e('No', 'immobiliareai'); ?></option>
    79                 </select>
    80             </label>
    81             <label><?php esc_html_e('Condition:', 'immobiliareai'); ?>
    82                 <select id="ai_stato">
    83                     <option value=""><?php esc_html_e('Select condition', 'immobiliareai'); ?></option>
    84                     <option value="Nuovo / In costruzione"><?php esc_html_e('New / Under construction', 'immobiliareai'); ?>
    85                     </option>
    86                     <option value="Ottimo / Ristrutturato"><?php esc_html_e('Excellent / Renovated', 'immobiliareai'); ?>
    87                     </option>
    88                     <option value="Buono / Abitabile"><?php esc_html_e('Good / Habitable', 'immobiliareai'); ?></option>
    89                     <option value="Da ristrutturare"><?php esc_html_e('To renovate', 'immobiliareai'); ?></option>
    90                 </select>
    91             </label>
    92             <label><?php esc_html_e('Extra details:', 'immobiliareai'); ?> <input type="text" id="ai_extra"></label>
     90
     91            <label><?php esc_html_e('Bathrooms:', 'immobiliareai'); ?>
     92                <input type="number" id="ai_bagni">
     93            </label>
     94            <label class="terrazzo">
     95                <input type="checkbox" id="ai_terrazzo" value="true">
     96                <?php esc_html_e('Terrace / balcony present', 'immobiliareai'); ?>
     97            </label>
     98            <label class="vuota"> </label>
     99        </div>
     100
     101        <!-- Riga 4: Dettagli extra (textarea full width) -->
     102        <div class="ai-extra-full">
     103            <label><?php esc_html_e('Extra details: your brief for the AI', 'immobiliareai'); ?>
     104                <textarea id="ai_extra" rows="4" maxlength="300"
     105                    placeholder="<?php esc_attr_e('For example: the property overlooks the sea. Describe the beauty of the place with many details, with a romantic and evocative tone.', 'immobiliareai'); ?>"></textarea>
     106            </label>
     107            <div class="ai-extra-counter-wrapper">
     108                <small class="ai-extra-counter-text">
     109                    <?php esc_html_e('Characters remaining:', 'immobiliareai'); ?>
     110                    <span id="ai_extra_counter">300</span>
     111                </small>
     112            </div>
    93113        </div>
    94114
     
    104124}
    105125
     126
    106127add_action('admin_enqueue_scripts', function ($hook) {
    107128    if ($hook === 'post.php' || $hook === 'post-new.php') {
     
    109130        $script_path = plugin_dir_path(__FILE__) . 'js/admin.js';
    110131        //$script_version = filemtime($script_path);
    111         $debug_mode = true; // false in produzione
     132        $debug_mode = false; // false in produzione
    112133        $script_version = $debug_mode ? time() : filemtime($script_path);
    113134
  • immobiliareai/tags/1.3.0/js/admin.js

    r3329660 r3421337  
    99    const $btn = $("#ai_generate_button");
    1010    const $output = $("#ai_output");
     11    const $superficie = $("#ai_superficie");
     12    const $bagni = $("#ai_bagni");
     13    const $extra = $("#ai_extra");
     14    const $extraCounter = $("#ai_extra_counter");
     15    const extraMax = parseInt($extra.attr("maxlength"), 10) || 300;
     16
     17    // Limita la superficie a solo cifre e massimo 4 caratteri
     18    $superficie.on("input", function () {
     19      let value = $(this).val();
     20
     21      // Tieni solo le cifre 0-9
     22      value = value.replace(/\D/g, "");
     23
     24      // Tronca a massimo 4 cifre
     25      if (value.length > 4) {
     26        value = value.slice(0, 4);
     27      }
     28
     29      $(this).val(value);
     30    });
     31
     32    // Limita i bagni a solo cifre e massimo 2 caratteri
     33    $bagni.on("input", function () {
     34      let value = $(this).val();
     35
     36      // Tieni solo le cifre 0-9
     37      value = value.replace(/\D/g, "");
     38
     39      // Tronca a massimo 2 cifre
     40      if (value.length > 2) {
     41        value = value.slice(0, 2);
     42      }
     43
     44      $(this).val(value);
     45    });
     46
     47    // Contatore caratteri per Dettagli extra
     48    $extra.on("input", function () {
     49      let value = $(this).val();
     50
     51      // Se per qualsiasi motivo supera il maxlength, tronca
     52      if (value.length > extraMax) {
     53        value = value.slice(0, extraMax);
     54        $(this).val(value);
     55      }
     56
     57      if ($extraCounter.length) {
     58        $extraCounter.text(extraMax - value.length);
     59      }
     60    });
     61
     62    // Inizializza il contatore (utile se il campo è già precompilato)
     63    if ($extra.length) {
     64      $extra.trigger("input");
     65    }
    1166
    1267    const bindClickHandler = function () {
  • immobiliareai/tags/1.3.0/languages/immobiliareai-it_IT.po

    r3322745 r3421337  
    44"Report-Msgid-Bugs-To: https://immobiliareai.org\n"
    55"POT-Creation-Date: 2025-06-21\n"
    6 "PO-Revision-Date: 2025-07-03\n"
     6"PO-Revision-Date: 2025-12-16 18:41+0100\n"
    77"Last-Translator: \n"
    88"Language-Team: \n"
     
    1111"Content-Type: text/plain; charset=UTF-8\n"
    1212"Content-Transfer-Encoding: 8bit\n"
    13 "X-Generator: ChatGPT\n"
     13"X-Generator: Poedit 3.8\n"
    1414
    1515msgid "Generate property description with AI"
     
    139139msgstr "Non presente"
    140140
    141 
    142141msgid "Abitabile"
    143142msgstr "Cucina abitabile"
     
    155154msgstr "Terrazzo:"
    156155
     156msgid "Terrace / balcony present"
     157msgstr "Presenza terrazzo/balcone"
     158
    157159msgid "Yes"
    158160msgstr "Sì"
     
    191193msgstr "Da ristrutturare"
    192194
    193 msgid "Extra details:"
    194 msgstr "Dettagli extra:"
     195msgid "Extra details: your brief for the AI"
     196msgstr "Dettagli extra: il tuo brief per l’AI"
     197
     198msgid "For example: the property overlooks the sea. Describe the beauty of the place with many details, with a romantic and evocative tone."
     199msgstr "Per esempio: l’immobile affaccia sul mare. Descrivi la bellezza del luogo con molti dettagli, con un tono romantico ed evocativo."
     200
     201msgid "Characters remaining:"
     202msgstr "Caratteri restanti:"
    195203
    196204msgid "Generate automatic description"
     
    209217msgstr "Immobiliareai"
    210218
    211 msgid ""
    212 "This plugin allows you to generate high-quality real estate descriptions "
    213 "using artificial intelligence."
    214 msgstr ""
    215 "Questo plugin ti permette di generare contenuti di alta qualità per le "
    216 "agenzie immobiliari con l’aiuto dell’Intelligenza Artificiale."
     219msgid "This plugin allows you to generate high-quality real estate descriptions using artificial intelligence."
     220msgstr ""
     221"Questo plugin ti permette di generare contenuti di alta qualità per le agenzie immobiliari con l’aiuto dell’Intelligenza Artificiale."
    217222
    218223msgid "Commercial License Key"
     
    222227msgstr "Chiave Personale OpenAI"
    223228
    224 msgid ""
    225 "Note: If you do not have a commercial key, you can enter your OpenAI key to "
    226 "use the service for free (with your own credits)."
    227 msgstr ""
    228 "Nota: se non hai una chiave di licenza commerciale, puoi inserire la tua "
    229 "chiave OpenaAI e usare il plugin in modo gratuito in accordo col tuo piano "
    230 "dati e i tuoi crediti."
     229msgid "Note: If you do not have a commercial key, you can enter your OpenAI key to use the service for free (with your own credits)."
     230msgstr ""
     231"Nota: se non hai una chiave di licenza commerciale, puoi inserire la tua chiave OpenaAI e usare il plugin in modo gratuito in accordo col "
     232"tuo piano dati e i tuoi crediti."
    231233
    232234msgid "Generated description"
  • immobiliareai/tags/1.3.0/readme.txt

    r3402708 r3421337  
    33Tags: immobiliare, property description, real estate, AI, OpenAI
    44Requires at least: 5.0 
    5 Tested up to: 6.8 
     5Tested up to: 6.9 
    66Requires PHP: 7.4 
    7 Stable tag: 1.2.5 
     7Stable tag: 1.3.0 
    88License: GPL-2.0-or-later 
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html 
     
    6262== Changelog ==
    6363
     64= 1.3.0 =
     65* UX: reorganized the ImmobiliareAI metabox (fields grouped more logically and new full-width “Extra details” textarea).
     66* Brief: added a dedicated “Extra details: your brief for the AI” field with a 300-character limit and live character counter.
     67* Input validation: added length limits for Area and numeric-only constraints for Surface and Bathrooms to avoid invalid or excessive values.
     68* Prompt: updated the AI prompt logic to better use structured form data plus the optional brief, while keeping descriptions around 300 words.
     69
    6470= 1.2.5 =
    6571*   Compatibility: tested with WordPress 6.8.
     
    108114== Upgrade Notice ==
    109115
     116= 1.3.0 =
     117New metabox layout, dedicated “Extra details” brief field, stricter input validation, and improved AI prompt. Recommended update for better control and more consistent descriptions.
     118
    110119= 1.2.5 =
    111120Documentation and compatibility update. No changes to functionality. Safe to update.
  • immobiliareai/trunk/css/admin.css

    r3321760 r3421337  
    1010
    1111#ai-fields label {
    12   display: block;
    13   margin-bottom: 8px;
     12  display: flex;
     13  flex-direction: column;
     14  margin-bottom: 20px;
     15}
     16
     17#ai-fields label.vuota {
     18  display: none;
    1419}
    1520
     
    1924  padding: 5px;
    2025  margin-top: 2px;
     26}
     27
     28#ai-fields input#ai_terrazzo {
     29  width: 1.5rem;
     30  height: 1.5rem;
     31  order: 2;
     32}
     33#ai-fields input#ai_terrazzo[type="checkbox"]:checked::before {
     34  height: 1.5rem;
     35  width: 1.7rem;
     36}
     37#ai_extra {
     38  display: block;
     39  width: 100%;
     40  padding: 5px;
     41  margin-top: 2px;
     42}
     43
     44#ai_extra::placeholder {
     45  font-style: italic;
     46  color: grey;
     47  font-size: 14px;
     48}
     49
     50.ai-extra-counter-wrapper {
     51  display: flex;
     52  justify-content: end;
     53  color: red;
     54  font-size: 15px;
     55}
     56#ai-fields .ai-extra-full label {
     57  margin-bottom: 10px;
    2158}
    2259
     
    5491  background-color: #dedede;
    5592}
    56 @media (min-width: 992px) {
     93
     94@media (min-width: 1200px) {
    5795  .col-tre {
    5896    display: flex;
     
    62100    width: 30%;
    63101  }
     102  .col-sei label {
     103    width: 50%;
     104  }
     105  .col-quattro label {
     106    width: 25%;
     107  }
     108  #ai-fields label.terrazzo {
     109    display: block;
     110    padding-top: 25px;
     111  }
     112  #ai-fields label.vuota {
     113    display: flex;
     114  }
     115  .col-tre:nth-child(3) label:nth-child(3) {
     116    display: block !important;
     117    height: 25px;
     118    margin-top: 25px;
     119  }
    64120}
  • immobiliareai/trunk/immobiliareai.php

    r3390444 r3421337  
    33Plugin Name: ImmobiliareAI
    44Description: Generate real estate descriptions with AI (Artificial Intelligence) in the post editor.
    5 Version: 1.2.5
     5Version: 1.3.0
    66Author: Fabio Mario Giacomini
    77Author URI: https://viarete.it
     
    1717    exit; // Exit if accessed directly
    1818}
    19 
    2019add_action('add_meta_boxes', function () {
    2120    add_meta_box('immobi_ai_desc_box', __('Generate property description with AI', 'immobiliareai'), 'immobi_desc_box_html', 'post', 'normal', 'high');
    2221});
    23 
    2422function immobi_desc_box_html($post)
    2523{
    2624    ?>
    2725    <div id="ai-fields">
     26        <!-- Riga 1: Zona – Tipologia – Stato -->
    2827        <div class="col-tre">
     28            <label><?php esc_html_e('Area:', 'immobiliareai'); ?>
     29                <input type="text" id="ai_zona" maxlength="37">
     30            </label>
    2931            <label><?php esc_html_e('Property type:', 'immobiliareai'); ?>
    3032                <select id="ai_tipologia">
     
    4143                </select>
    4244            </label>
    43             <label><?php esc_html_e('Surface (sqm):', 'immobiliareai'); ?> <input type="number" id="ai_superficie"></label>
    44             <label><?php esc_html_e('Area:', 'immobiliareai'); ?> <input type="text" id="ai_zona"></label>
    45         </div>
    46 
     45            <label><?php esc_html_e('Condition:', 'immobiliareai'); ?>
     46                <select id="ai_stato">
     47                    <option value=""><?php esc_html_e('Select condition', 'immobiliareai'); ?></option>
     48                    <option value="Nuovo / In costruzione"><?php esc_html_e('New / Under construction', 'immobiliareai'); ?>
     49                    </option>
     50                    <option value="Ottimo / Ristrutturato"><?php esc_html_e('Excellent / Renovated', 'immobiliareai'); ?>
     51                    </option>
     52                    <option value="Buono / Abitabile"><?php esc_html_e('Good / Habitable', 'immobiliareai'); ?></option>
     53                    <option value="Da ristrutturare"><?php esc_html_e('To renovate', 'immobiliareai'); ?></option>
     54                </select>
     55            </label>
     56        </div>
     57
     58        <!-- Riga 2: Piano – Cucina -->
    4759        <div class="col-tre">
    4860            <label><?php esc_html_e('Floor:', 'immobiliareai'); ?>
     
    6072                </select>
    6173            </label>
    62             <label><?php esc_html_e('Bathrooms:', 'immobiliareai'); ?> <input type="number" id="ai_bagni"></label>
    6374            <label><?php esc_html_e('Kitchen:', 'immobiliareai'); ?>
    6475                <select id="ai_cucina">
     
    7081                </select>
    7182            </label>
    72         </div>
    73 
     83            <label><?php esc_html_e('Surface (sqm):', 'immobiliareai'); ?>
     84                <input type="number" id="ai_superficie" min="10" max="9999">
     85            </label>
     86        </div>
     87
     88        <!-- Riga 3: Superficie – Bagni – Terrazzo (checkbox) -->
    7489        <div class="col-tre">
    75             <label><?php esc_html_e('Terrace:', 'immobiliareai'); ?>
    76                 <select id="ai_terrazzo">
    77                     <option value="true"><?php esc_html_e('Yes', 'immobiliareai'); ?></option>
    78                     <option value="false" selected><?php esc_html_e('No', 'immobiliareai'); ?></option>
    79                 </select>
    80             </label>
    81             <label><?php esc_html_e('Condition:', 'immobiliareai'); ?>
    82                 <select id="ai_stato">
    83                     <option value=""><?php esc_html_e('Select condition', 'immobiliareai'); ?></option>
    84                     <option value="Nuovo / In costruzione"><?php esc_html_e('New / Under construction', 'immobiliareai'); ?>
    85                     </option>
    86                     <option value="Ottimo / Ristrutturato"><?php esc_html_e('Excellent / Renovated', 'immobiliareai'); ?>
    87                     </option>
    88                     <option value="Buono / Abitabile"><?php esc_html_e('Good / Habitable', 'immobiliareai'); ?></option>
    89                     <option value="Da ristrutturare"><?php esc_html_e('To renovate', 'immobiliareai'); ?></option>
    90                 </select>
    91             </label>
    92             <label><?php esc_html_e('Extra details:', 'immobiliareai'); ?> <input type="text" id="ai_extra"></label>
     90
     91            <label><?php esc_html_e('Bathrooms:', 'immobiliareai'); ?>
     92                <input type="number" id="ai_bagni">
     93            </label>
     94            <label class="terrazzo">
     95                <input type="checkbox" id="ai_terrazzo" value="true">
     96                <?php esc_html_e('Terrace / balcony present', 'immobiliareai'); ?>
     97            </label>
     98            <label class="vuota"> </label>
     99        </div>
     100
     101        <!-- Riga 4: Dettagli extra (textarea full width) -->
     102        <div class="ai-extra-full">
     103            <label><?php esc_html_e('Extra details: your brief for the AI', 'immobiliareai'); ?>
     104                <textarea id="ai_extra" rows="4" maxlength="300"
     105                    placeholder="<?php esc_attr_e('For example: the property overlooks the sea. Describe the beauty of the place with many details, with a romantic and evocative tone.', 'immobiliareai'); ?>"></textarea>
     106            </label>
     107            <div class="ai-extra-counter-wrapper">
     108                <small class="ai-extra-counter-text">
     109                    <?php esc_html_e('Characters remaining:', 'immobiliareai'); ?>
     110                    <span id="ai_extra_counter">300</span>
     111                </small>
     112            </div>
    93113        </div>
    94114
     
    104124}
    105125
     126
    106127add_action('admin_enqueue_scripts', function ($hook) {
    107128    if ($hook === 'post.php' || $hook === 'post-new.php') {
     
    109130        $script_path = plugin_dir_path(__FILE__) . 'js/admin.js';
    110131        //$script_version = filemtime($script_path);
    111         $debug_mode = true; // false in produzione
     132        $debug_mode = false; // false in produzione
    112133        $script_version = $debug_mode ? time() : filemtime($script_path);
    113134
  • immobiliareai/trunk/js/admin.js

    r3329660 r3421337  
    99    const $btn = $("#ai_generate_button");
    1010    const $output = $("#ai_output");
     11    const $superficie = $("#ai_superficie");
     12    const $bagni = $("#ai_bagni");
     13    const $extra = $("#ai_extra");
     14    const $extraCounter = $("#ai_extra_counter");
     15    const extraMax = parseInt($extra.attr("maxlength"), 10) || 300;
     16
     17    // Limita la superficie a solo cifre e massimo 4 caratteri
     18    $superficie.on("input", function () {
     19      let value = $(this).val();
     20
     21      // Tieni solo le cifre 0-9
     22      value = value.replace(/\D/g, "");
     23
     24      // Tronca a massimo 4 cifre
     25      if (value.length > 4) {
     26        value = value.slice(0, 4);
     27      }
     28
     29      $(this).val(value);
     30    });
     31
     32    // Limita i bagni a solo cifre e massimo 2 caratteri
     33    $bagni.on("input", function () {
     34      let value = $(this).val();
     35
     36      // Tieni solo le cifre 0-9
     37      value = value.replace(/\D/g, "");
     38
     39      // Tronca a massimo 2 cifre
     40      if (value.length > 2) {
     41        value = value.slice(0, 2);
     42      }
     43
     44      $(this).val(value);
     45    });
     46
     47    // Contatore caratteri per Dettagli extra
     48    $extra.on("input", function () {
     49      let value = $(this).val();
     50
     51      // Se per qualsiasi motivo supera il maxlength, tronca
     52      if (value.length > extraMax) {
     53        value = value.slice(0, extraMax);
     54        $(this).val(value);
     55      }
     56
     57      if ($extraCounter.length) {
     58        $extraCounter.text(extraMax - value.length);
     59      }
     60    });
     61
     62    // Inizializza il contatore (utile se il campo è già precompilato)
     63    if ($extra.length) {
     64      $extra.trigger("input");
     65    }
    1166
    1267    const bindClickHandler = function () {
  • immobiliareai/trunk/languages/immobiliareai-it_IT.po

    r3322745 r3421337  
    44"Report-Msgid-Bugs-To: https://immobiliareai.org\n"
    55"POT-Creation-Date: 2025-06-21\n"
    6 "PO-Revision-Date: 2025-07-03\n"
     6"PO-Revision-Date: 2025-12-16 18:41+0100\n"
    77"Last-Translator: \n"
    88"Language-Team: \n"
     
    1111"Content-Type: text/plain; charset=UTF-8\n"
    1212"Content-Transfer-Encoding: 8bit\n"
    13 "X-Generator: ChatGPT\n"
     13"X-Generator: Poedit 3.8\n"
    1414
    1515msgid "Generate property description with AI"
     
    139139msgstr "Non presente"
    140140
    141 
    142141msgid "Abitabile"
    143142msgstr "Cucina abitabile"
     
    155154msgstr "Terrazzo:"
    156155
     156msgid "Terrace / balcony present"
     157msgstr "Presenza terrazzo/balcone"
     158
    157159msgid "Yes"
    158160msgstr "Sì"
     
    191193msgstr "Da ristrutturare"
    192194
    193 msgid "Extra details:"
    194 msgstr "Dettagli extra:"
     195msgid "Extra details: your brief for the AI"
     196msgstr "Dettagli extra: il tuo brief per l’AI"
     197
     198msgid "For example: the property overlooks the sea. Describe the beauty of the place with many details, with a romantic and evocative tone."
     199msgstr "Per esempio: l’immobile affaccia sul mare. Descrivi la bellezza del luogo con molti dettagli, con un tono romantico ed evocativo."
     200
     201msgid "Characters remaining:"
     202msgstr "Caratteri restanti:"
    195203
    196204msgid "Generate automatic description"
     
    209217msgstr "Immobiliareai"
    210218
    211 msgid ""
    212 "This plugin allows you to generate high-quality real estate descriptions "
    213 "using artificial intelligence."
    214 msgstr ""
    215 "Questo plugin ti permette di generare contenuti di alta qualità per le "
    216 "agenzie immobiliari con l’aiuto dell’Intelligenza Artificiale."
     219msgid "This plugin allows you to generate high-quality real estate descriptions using artificial intelligence."
     220msgstr ""
     221"Questo plugin ti permette di generare contenuti di alta qualità per le agenzie immobiliari con l’aiuto dell’Intelligenza Artificiale."
    217222
    218223msgid "Commercial License Key"
     
    222227msgstr "Chiave Personale OpenAI"
    223228
    224 msgid ""
    225 "Note: If you do not have a commercial key, you can enter your OpenAI key to "
    226 "use the service for free (with your own credits)."
    227 msgstr ""
    228 "Nota: se non hai una chiave di licenza commerciale, puoi inserire la tua "
    229 "chiave OpenaAI e usare il plugin in modo gratuito in accordo col tuo piano "
    230 "dati e i tuoi crediti."
     229msgid "Note: If you do not have a commercial key, you can enter your OpenAI key to use the service for free (with your own credits)."
     230msgstr ""
     231"Nota: se non hai una chiave di licenza commerciale, puoi inserire la tua chiave OpenaAI e usare il plugin in modo gratuito in accordo col "
     232"tuo piano dati e i tuoi crediti."
    231233
    232234msgid "Generated description"
  • immobiliareai/trunk/readme.txt

    r3402708 r3421337  
    33Tags: immobiliare, property description, real estate, AI, OpenAI
    44Requires at least: 5.0 
    5 Tested up to: 6.8 
     5Tested up to: 6.9 
    66Requires PHP: 7.4 
    7 Stable tag: 1.2.5 
     7Stable tag: 1.3.0 
    88License: GPL-2.0-or-later 
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html 
     
    6262== Changelog ==
    6363
     64= 1.3.0 =
     65* UX: reorganized the ImmobiliareAI metabox (fields grouped more logically and new full-width “Extra details” textarea).
     66* Brief: added a dedicated “Extra details: your brief for the AI” field with a 300-character limit and live character counter.
     67* Input validation: added length limits for Area and numeric-only constraints for Surface and Bathrooms to avoid invalid or excessive values.
     68* Prompt: updated the AI prompt logic to better use structured form data plus the optional brief, while keeping descriptions around 300 words.
     69
    6470= 1.2.5 =
    6571*   Compatibility: tested with WordPress 6.8.
     
    108114== Upgrade Notice ==
    109115
     116= 1.3.0 =
     117New metabox layout, dedicated “Extra details” brief field, stricter input validation, and improved AI prompt. Recommended update for better control and more consistent descriptions.
     118
    110119= 1.2.5 =
    111120Documentation and compatibility update. No changes to functionality. Safe to update.
Note: See TracChangeset for help on using the changeset viewer.