maxlength vs longueur_maxi #211

Open
opened 9 months ago by maieul · 1 comments
maieul commented 9 months ago
Owner

Le ticket #210 souligne un problème : alors que la saisie input à une option maxlength, la saisie textarea a une option longueur_max, qui fait la même chose.

Proposition

  1. Déprécier l'option longueur_max
  2. Ajouter un mecanisme de doc pour dire qu'une option est déprécié (de type obsolete: true dans le .yaml.
  3. Pour ne pas perdre ce qui est existant, n'afficher dans le constructeur longueur_max que si pas déjà défini, et maxlenght uniquement si longueur_max est vide.
Le ticket #210 souligne un problème : alors que la saisie `input` à une option `maxlength`, la saisie `textarea` a une option `longueur_max`, qui fait la même chose. Proposition 1. Déprécier l'option `longueur_max` 2. Ajouter un mecanisme de doc pour dire qu'une option est déprécié (de type `obsolete: true` dans le `.yaml`. 3. Pour ne pas perdre ce qui est existant, n'afficher dans le constructeur `longueur_max` que si pas déjà défini, et `maxlenght` uniquement si `longueur_max` est vide.
Collaborator

je viens de remplacer la définition maxlenght par longueur_max pour le champ text_aera "texte" (en spip3.2)

le blocage de la saisie à 200 carateres fonctionne cependant j'ai une pluie d'erreurs js comme ci-dessous (spip3.2)

Uncaught TypeError: counter is null
    updateValue https://3w.plandecuques.fr/plugins/auto/saisies/v3.56.2/javascript/saisies_textarea_counter.js?1654529978:67
    handleInput https://3w.plandecuques.fr/plugins/auto/saisies/v3.56.2/javascript/saisies_textarea_counter.js?1654529978:29
    textareaCounter https://3w.plandecuques.fr/plugins/auto/saisies/v3.56.2/javascript/saisies_textarea_counter.js?1654529978:22
    textareaCounter https://3w.plandecuques.fr/plugins/auto/saisies/v3.56.2/javascript/saisies_textarea_counter.js?1654529978:13
    triggerAjaxLoad https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:32
    on_ajax_loaded https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:495
    success https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:607
    jQuery 7
    ajax https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:119
    loadAjax https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:603
    ajaxClick https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:714
    ajaxbloc https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:753
    jQuery 10
    ajaxbloc https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:753
    jQuery 2
    ajaxbloc https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:731
    <anonymous> https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:1058
    jQuery 13
saisies_textarea_counter.js:67:25
je viens de remplacer la définition maxlenght par longueur_max pour le champ text_aera "texte" (en spip3.2) le blocage de la saisie à 200 carateres fonctionne cependant j'ai une pluie d'erreurs js comme ci-dessous (spip3.2) ``` Uncaught TypeError: counter is null updateValue https://3w.plandecuques.fr/plugins/auto/saisies/v3.56.2/javascript/saisies_textarea_counter.js?1654529978:67 handleInput https://3w.plandecuques.fr/plugins/auto/saisies/v3.56.2/javascript/saisies_textarea_counter.js?1654529978:29 textareaCounter https://3w.plandecuques.fr/plugins/auto/saisies/v3.56.2/javascript/saisies_textarea_counter.js?1654529978:22 textareaCounter https://3w.plandecuques.fr/plugins/auto/saisies/v3.56.2/javascript/saisies_textarea_counter.js?1654529978:13 triggerAjaxLoad https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:32 on_ajax_loaded https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:495 success https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:607 jQuery 7 ajax https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:119 loadAjax https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:603 ajaxClick https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:714 ajaxbloc https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:753 jQuery 10 ajaxbloc https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:753 jQuery 2 ajaxbloc https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:731 <anonymous> https://3w.plandecuques.fr/prive/javascript/ajaxCallback.js?1653089268:1058 jQuery 13 saisies_textarea_counter.js:67:25 ```
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.