PageSourceSearch

https://forum.ircam.fr/static/bundler/assets/ProfileBiography.ce.849d3571.js

js ircam.fr collected 2026-09-24 07:34:03 UTC 6,324 bytes, 3 lines download raw bytes

1import{d as V,k as I,B as $,Z as U,f as B,g as o,a2 as j,u as n,m as _,s as P,a7 as F,a8 as H,a as z,L as R,aa as W,ab as Z,o as L}from"./vendor.ab282fad.js";import{i as A,u as G,c as J}from"../main.ae189850.js";import"./preload-helper.ae39bab8.js";import{b as K,a as O}from"./profile.0a789c0d.js";import{f as Q}from"./format-date.e077bff2.js";import{_ as X}from"./BtnSubmit.f3034115.js";var Y=`.character_counter[data-v-0f62afe6]{float:right}
2`;const ee=f=>(W("data-v-0f62afe6"),f=f(),Z(),f),te={id:"biography-container",class:"c-form__fields"},ae={class:"c-container"},oe={key:0,class:"c-message c-message--error u-mbm"},re={key:0},ie={class:"c-form__field c-field"},ne={id:"profile_biography",class:"c-field__wrapper"},le={class:"c-profile__biography-edit u-hide"},se=["maxlength","placeholder"],ce=ee(()=>o("div",{class:"character_counter"},[o("small",{class:"c-field__hint"},"0/0")],-1)),ue={class:"c-form__actions u-hide"},de={id:"biography-empty",class:"biography-no-text u-hide"},me=V({props:{userId:null,userName:null,profileId:null,profileName:null,profileBio:null},setup(f){const r=f,{t:d}=G({messages:{en:{name:"Name",required:"required",tags:"Tags",updateProfile:"Update",updateProfileError:"Error while updating profile.",biographyDefault:"This user hasn't added a biography yet.",biographyPlaceholder:"Write a paragraph about yourself (in english, 1200 characters maximum)",characterLimit:"Maximum number of characters is limited to 1200."},fr:{name:"Nom",required:"requis",tags:"Tags",updateProfile:"Mettre \xE0 jour",updateProfileError:"Erreur lors de la mise \xE0 jour du profil.",biographyDefault:"Cet utilisateur n'a pas encore ajout\xE9 de biographie.",biographyPlaceholder:"Ecrivez un paragraphe \xE0 propos de vous (en anglais, 1200 caract\xE8res maximum)",characterLimit:"Le nombre de caract\xE8res maximum est limit\xE9 \xE0 1200."}}});let y,N,b,C,k;const e={reference:I(r.profileBio),text:I(r.profileBio),isEditable:!1,charLength:0,charMaxLength:1200,editIcon:document.getElementsByClassName("biography-edit__icon")[0],cancelIcon:document.querySelector(".biography-cancel__icon"),confirmIcon:document.getElementsByClassName("biography-confirm__icon")[0],element:document.getElementsByClassName("c-profile__biography-text")[0],inputElement:document.getElementsByClassName("c-profile__biography-edit")[0]};let x=!0,l=r.profileBio.length>0&&e.text.value!==null&&e.text.value!=="None",m,p;const E=I();let s,c;$(()=>{S(),w(),k&&(T(),q())}),U(()=>{e.editIcon&&(e.editIcon.removeEventListener("click",()=>{h()}),e.cancelIcon.removeEventListener("click",()=>{e.text.value=m,m.length>0&&e.text.value!=="None"&&(l=!0),e.text.value==="None"&&(e.text.value=d("biographyPlaceholder")),h()}));const a=document.querySelector(".biography-confirm__icon");a&&a.removeEventListener("click",M)});function S(){y=parseInt(r.userId),b=r.profileId,N=r.userName,C=r.profileName,k=N===C}function w(a=!0){e.text.value==="None"&&(e.text.value=""),s=document.querySelector("#biography-container"),c=document.querySelector("#biography-empty"),l?(t(s,a),t(c,!a)):(t(s,!a),t(c,a)),m=r.profileBio}function T(){e.element=document.getElementsByClassName("c-profile__biography-text")[0],e.inputElement=document.getElementsByClassName("c-profile__biography-edit")[0],e.editIcon&&(e.editIcon.addEventListener("click",()=>{h()}),e.cancelIcon.addEventListener("click",()=>{e.text.value=m,m.length>0&&e.text.value!=="None"&&(l=!0),e.text.value==="None"&&(e.text.value=""),h()})),p=document.getElementById("button-submit-profile");const a=document.querySelector(".biography-confirm__icon");a&&a.addEventListener("click",M)}function M(){p&&(p.click(),e.isEditable=!1,t(e.element,!0),t(e.inputElement,!1),t(e.editIcon,!0),t(e.cancelIcon,!1),t(e.confirmIcon,!1),l?(t(s,!0),t(c,!1)):(t(s,!1),t(c,!0)))}function t(a,i){i?(a.classList.add("u-show"),a.classList.remove("u-hide")):(a.classList.add("u-hide"),a.classList.remove("u-show"))}function h(){e.isEditable=!e.isEditable,e.isEditable?(t(e.editIcon,!1),t(e.cancelIcon,!0),t(e.confirmIcon,!0),t(e.element,!1),t(e.inputElement,!0),l?m=e.text.value:(t(s,!0),t(c,!1))):(t(e.editIcon,!0),t(e.cancelIcon,!1),t(e.confirmIcon,!1),t(e.element,!0),t(e.inputElement,!1),l||(t(s,!1),t(c,!0)))}function q(){if(r.profileBio==="None"?e.charLength=0:r.profileBio!=="None"&&(e.charLength=r.profileBio.length),r.profileBio.length>0&&r.profileBio!==null){const a=document.getElementsByClassName("character_counter")[0];a.innerHTML=`${e.charLength}/${e.charMaxLength}`}}function D(a){const i=a.target;if(i){if(x){const v=document.getElementsByClassName("c-profile__biography-text")[0];v.classList.add("u-hide"),e.element=v,x=!1}
2e.charLength=i.value.length,e.charLength===0&&(x=!0,l=!1,document.getElementsByClassName("c-profile__biography-text")[0].classList.add("u-hide")),e.charLength>0&&(l=!0);const u=document.getElementsByClassName("character_counter")[0];u.innerHTML=`${e.charLength}/${e.charMaxLength}`}}const g=J(async()=>{const a={user:b,biography:e.text.value},i=await K(y,a),u={user:b,date_modified:Q(new Date)};return await O(y,u),i},{error(){E.value&&E.value.scrollIntoView({behavior:"smooth"})}});return(a,i)=>(L(),B(R,null,[o("fieldset",te,[o("div",ae,[o("form",{ref_key:"form",ref:E,class:"c-form",onSubmit:i[1]||(i[1]=j((...u)=>n(g).exec&&n(g).exec(...u),["prevent"]))},[n(g).err?(L(),B("div",oe,[o("p",null,_(n(d)("updateProfileError")),1),e.charLength>e.charMaxLength?(L(),B("div",re,[o("p",null,"("+_(n(d)("characterLimit"))+")",1)])):P("",!0)])):P("",!0),o("div",ie,[o("div",ne,[o("p",{ref:"biography-text",class:"c-presentation__text c-profile__biography-text"},_(e.text.value),513),o("div",le,[F(o("textarea",{ref:"biography-textarea","onUpdate:modelValue":i[0]||(i[0]=u=>e.text.value=u),cols:"30",rows:"10",maxlength:e.charMaxLength,placeholder:n(d)("biographyPlaceholder"),class:"c-field__input c-profile__biography-textarea",onInput:D},null,40,se),[[H,e.text.value,void 0,{trim:!0}]]),ce])])]),o("fieldset",ue,[z(X,{id:"button-submit-profile",ref_key:"buttonSubmit",ref:p,loading:n(g).loading,label:n(d)("updateProfile"),class:"c-profile__button-submit"},null,8,["loading","label"])])],544)])]),o("p",de,_(n(d)("biographyDefault")),1)],64))}});var be=A(me,[["styles",[Y]],["__scopeId","data-v-0f62afe6"]]);export{be as default};
3//# sourceMappingURL=ProfileBiography.ce.849d3571.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.