יום חמישי, 10 ביולי 2025

צביעת שיחות ב-ChatGpt

הוספת אפשרות לצבוע שיחות (צאטים) ב-ChatGpt
  1. לחץ כאן כדי להעתיק את הקוד
  2. לחץ ctrl+d כדי ליצור סימניה
  3. שנה את שם הסימניה ל-צביעת שיחות, ובמקום הכתובת, הדבק את הטקסט שהעתקת בסעיף 1
  4. בזמן שימוש באתר ChatGPT, לחץ על הסימניה ששמרת כדי להציג את התפריט
javascript:(function(){
  let s = JSON.parse(localStorage.getItem('navMarkerSettings')) || {
    markers: [{symbol:'📌',bgColor:'#fff8b3',color:''}],
    minimized: false
  };
  function save() {
    localStorage.setItem('navMarkerSettings', JSON.stringify(s));
  }
  function h() {
    document.querySelectorAll('nav a').forEach(c=>{
      let t=c.textContent.trim();
      c.style.backgroundColor='';
      c.style.color='';
      s.markers.forEach(m=>{
        if(t.startsWith(m.symbol)||t.endsWith(m.symbol)){
          c.style.backgroundColor=m.bgColor||'';
          c.style.color=m.color||'';
        }
      });
      c.style.fontWeight='';
      if(c.hasAttribute('data-active')){
        c.style.fontWeight='bold';
      }
    });
  }
  h();
  const n=document.querySelector('nav');
  if(n){
    new MutationObserver(h).observe(n,{childList:true,subtree:true,attributes:true,attributeFilter:['data-active']});
  }
  if(!document.getElementById('markerConfigMenu')){
    const m=document.createElement('div');
    m.id='markerConfigMenu';
    m.style.position='fixed';
    m.style.top='55px';
    m.style.right='10px';
    m.style.width='270px';
    m.style.background='#fefefe';
    m.style.border='1px solid #333';
    m.style.borderRadius='8px';
    m.style.boxShadow='0 4px 12px rgba(0,0,0,0.2)';
    m.style.fontFamily='sans-serif';
    m.style.zIndex='9999';
    m.style.overflow='hidden';
    m.style.opacity='0.9';
    m.style.cursor='move';
    m.innerHTML='';
    document.body.appendChild(m);
    const hd=document.getElementById('menuHeader'),
          tb=document.getElementById('toggleMenu'),
          ct=document.getElementById('menuContent'),
          cl=document.getElementById('closeMenu');
    // מצב פתיחה/סגירה לפי saved
    ct.style.display = s.minimized ? 'none' : 'block';
    tb.textContent = s.minimized ? '+' : '−';
    tb.onclick=()=>{
      if(ct.style.display==='none'){
        ct.style.display='block';
        tb.textContent='−';
        s.minimized = false;
      }else{
        ct.style.display='none';
        tb.textContent='+';
        s.minimized = true;
      }
      save();
    };
    cl.onclick=()=>{
      m.style.transition='opacity 0.2s ease';
      m.style.opacity='0';
      setTimeout(()=>{m.remove();},500);
    };
    function r(){
      const l=document.getElementById('markerList');
      l.innerHTML='';
      if(s.markers.length===0){
        l.innerHTML='אין סימנים מוגדרים.';
      }
      s.markers.forEach((m,i)=>{
        const d=document.createElement('div');
        d.style.marginBottom='4px';
        d.style.background='#f0f0f0';
        d.style.padding='4px 30px 4px 4px';
        d.style.borderRadius='4px';
        d.style.position='relative';
        d.innerHTML=`${m.symbol} BG:       Text:     `;
        const b=document.createElement('button');
        b.textContent='🗑️';
        b.style.position='absolute';
        b.style.right='-25px';
        b.style.top='50%';
        b.style.transform='translateY(-50%)';
        b.style.background='none';
        b.style.border='none';
        b.style.cursor='pointer';
        b.onclick=()=>{
          s.markers.splice(i,1);
          save();
          r();
          h();
        };
        d.appendChild(b);
        l.appendChild(d);
      });
    }
    r();
    document.getElementById('addMarker').onclick=()=>{
      const sy=document.getElementById('newSymbol').value.trim(),
            bg=document.getElementById('newBg').value,
            co=document.getElementById('newColor').value;
      if(sy){
        s.markers.push({symbol:sy,bgColor:bg,color:co});
        save();
        r();
        h();
      }
    };
    document.getElementById('resetMarkers').onclick=()=>{
      if(confirm('לאפס הכל?')){
        localStorage.removeItem('navMarkerSettings');
        s={markers:[], minimized: false};
        r();
        h();
      }
    };
    let x=0,y=0,mx=0,my=0;hd.onmousedown=d;
    function d(e){
      e=e||window.event;e.preventDefault();
      mx=e.clientX;my=e.clientY;
      document.onmouseup=c;document.onmousemove=f;
    }
    function f(e){
      e=e||window.event;e.preventDefault();
      x=mx-e.clientX;y=my-e.clientY;
      mx=e.clientX;my=e.clientY;
      m.style.top=(m.offsetTop-y)+'px';
      m.style.left=(m.offsetLeft-x)+'px';
      m.style.right='auto';
    }
    function c(){document.onmouseup=null;document.onmousemove=null;}
  }
})();


שימוש בתוסף:
בתיבת התוסף יש להגדיר תו רצוי וצבעים - למשל
תוצבע רקעצבע טקסט
>      
יש לשנות את שם השיחה הרצויה שתתחיל או תסתיים בתו שנבחר.
כך, כל שיחה תיצבע בצבע ע"י התחלת או סיום השיחה בתו שהוגדר

אין תגובות:

הוסף רשומת תגובה