/* SA_PREMIUM_AVATAR_UPLOAD v4 — replace 22182.txt */ (function(){ 'use strict'; if(window.__SA_PREMIUM_AVATAR_UPLOAD_V4__)return; window.__SA_PREMIUM_AVATAR_UPLOAD_V4__=1; function id(){var m=location.search.match(/[?&]id=(\d+)/i);return m?m[1]:''} function owner(){ var r=document.getElementById('sa-dossier-clean');if(!r)return false; return /ÐÅÄÀÊÒÈÐÎÂÀÒÜ ÏÐÎÔÈËÜ/i.test(r.textContent||''); } function css(){ if(document.getElementById('sa-up-v4-css'))return; var s=document.createElement('style');s.id='sa-up-v4-css';s.textContent=` #sa-dossier-clean .sa-up-v4{position:absolute!important;z-index:30!important;left:50%!important;bottom:86px!important; transform:translateX(-50%)!important;width:180px!important;height:28px!important;box-sizing:border-box!important; border:1px solid rgba(211,162,75,.62)!important;background:linear-gradient(180deg,rgba(14,47,49,.98),rgba(5,27,30,.98))!important; color:#e0b568!important;font:600 8px/26px Arial,sans-serif!important;letter-spacing:1.45px!important;text-align:center!important; cursor:pointer!important;padding:0 10px!important;margin:0!important;overflow:hidden!important; box-shadow:inset 0 1px rgba(255,224,157,.06),0 5px 13px rgba(0,0,0,.20)!important} #sa-dossier-clean .sa-up-v4 .i{display:inline-block!important;margin-right:7px!important;color:#d7a650!important; font:400 12px/1 Georgia,"Times New Roman",serif!important;vertical-align:-1px!important;transition:transform .22s ease!important} #sa-dossier-clean .sa-up-v4:hover .i{transform:rotate(90deg)!important} #sa-dossier-clean .sa-up-v4[disabled]{opacity:.55!important;cursor:wait!important}`; document.head.appendChild(s); } function mount(){ if(!/\/profile\.php$/i.test(location.pathname)||!owner())return; var r=document.getElementById('sa-dossier-clean'),p=r&&r.querySelector('.portrait');if(!p)return; p.querySelectorAll('.sa-avatar-upload-safe,.sa-avatar-upload-v2,.sa-avatar-upload-v3').forEach(function(x){x.remove()}); if(p.querySelector('.sa-up-v4'))return; css(); var b=document.createElement('button');b.type='button';b.className='sa-up-v4'; b.innerHTML='+ÇÀÃÐÓÇÈÒÜ ÀÂÀÒÀÐ'; var f=document.createElement('input');f.type='file';f.accept='image/*'; f.style.cssText='position:fixed;left:-9999px;top:-9999px;width:1px;height:1px;opacity:0'; document.body.appendChild(f); b.onclick=function(e){e.preventDefault();e.stopPropagation();f.value='';f.click()}; f.onchange=function(){ var file=f.files&&f.files[0];if(!file)return;b.disabled=true; var iframe=document.createElement('iframe'); iframe.name='sa_av_'+Date.now(); iframe.style.cssText='position:fixed;left:-9999px;top:-9999px;width:1px;height:1px;border:0;opacity:0'; document.body.appendChild(iframe); var phase=0,done=false; function finish(){ if(done)return;done=true; setTimeout(function(){location.replace('/profile.php?id='+encodeURIComponent(id())+'&_av='+Date.now())},250); } var timer=setTimeout(finish,9000); iframe.onload=function(){ if(done)return; try{ var d=iframe.contentDocument||iframe.contentWindow.document; if(phase===0){ var inp=d.querySelector('input[type=file]'); if(!inp||!inp.form){clearTimeout(timer);finish();return} var dt=new DataTransfer();dt.items.add(file);inp.files=dt.files; inp.dispatchEvent(new Event('change',{bubbles:true})); var form=inp.form,sub=form.querySelector('input[type=submit],button[type=submit]'); phase=1; if(form.requestSubmit){sub?form.requestSubmit(sub):form.requestSubmit()} else if(sub)sub.click();else form.submit(); }else{ clearTimeout(timer);finish(); } }catch(e){clearTimeout(timer);finish()} }; iframe.src='/profile.php?section=avatar&id='+encodeURIComponent(id())+'&_='+Date.now(); }; p.appendChild(b); } function start(){mount();[200,500,900,1500].forEach(function(n){setTimeout(mount,n)})} if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',start,{once:true});else start(); })(); /* DEFAULT PORTRAIT — runs inside the already confirmed working 22182 */ (function(){ 'use strict'; function add(){ if(document.getElementById('sa-default-inside-upload-css'))return; var s=document.createElement('style'); s.id='sa-default-inside-upload-css'; s.textContent=` #sa-dossier-clean .portrait .placeholder{ position:absolute!important; z-index:5!important; left:calc(50% + 6px)!important; top:50%!important; right:auto!important; bottom:auto!important; transform:translate(-50%,-50%)!important; width:180px!important; height:250px!important; min-width:180px!important; min-height:250px!important; max-width:180px!important; max-height:250px!important; box-sizing:content-box!important; margin:0!important; padding:4px!important; flex:none!important; overflow:hidden!important; background:#071b1e!important; border:1px solid rgba(222,174,84,.72)!important; outline:0!important; box-shadow:0 0 0 7px #092327,0 0 0 8px rgba(205,158,70,.28),0 13px 26px rgba(0,0,0,.30)!important; } #sa-dossier-clean .portrait .placeholder:before{ position:absolute!important; left:50%!important; top:50%!important; width:72px!important; height:72px!important; transform:translate(-50%,-65%)!important; margin:0!important; border:1px solid rgba(216,169,79,.52)!important; border-radius:50%!important; } #sa-dossier-clean .portrait .placeholder strong{ position:absolute!important; left:50%!important; top:50%!important; transform:translate(-50%,-65%)!important; margin:0!important; padding:0!important; color:#d8a94f!important; font:400 38px/72px Georgia,"Times New Roman",serif!important; } #sa-dossier-clean .portrait .placeholder small{ position:absolute!important; left:50%!important; top:calc(50% + 48px)!important; bottom:auto!important; width:auto!important; transform:translateX(-50%)!important; margin:0!important; padding:0!important; color:rgba(216,169,79,.68)!important; font:500 6px/1.2 Arial,sans-serif!important; letter-spacing:1.25px!important; white-space:nowrap!important; } #sa-dossier-clean .portrait:has(.placeholder)>.vertical{ display:none!important; } `; document.head.appendChild(s); } if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',add,{once:true});else add(); })(); /* SAN AVELIO — UNIFIED CIVIC HEADER v15 The portrait styling is intentionally untouched. The header is laid out as two separate rows for every viewed profile. */ (function(){ 'use strict'; function norm(s){return String(s||'').replace(/\s+/g,' ').trim()} function good(s){return !!s&&!/^(north|profile|ïðîôèëü|ëè÷íûé ðàçäåë|ïðîñìîòð ïðîôèëÿ)$/i.test(s)} function name(){ var native=norm(document.querySelector('#profile-name strong')?.textContent); var og=norm(document.querySelector('meta[property="og:title"]')?.content); var identity=norm(document.querySelector('#sa-dossier-clean .identity h1')?.textContent); var stored=norm(document.querySelector('#sa-dossier-clean .sa-id-top-work>b')?.textContent); var candidates=[identity,stored,native,og].filter(good); // A character's full name may be longer than their Rusff account login. // Prefer the longest valid value, never reduce a name to a login/initial. candidates.sort(function(a,b){return b.length-a.length}); return candidates[0]||''; } function css(){ if(document.getElementById('sa-unified-header-v15'))return; var s=document.createElement('style');s.id='sa-unified-header-v15'; s.textContent=` #sa-dossier-clean .portrait .sa-id-top-work.sa-unified-header-v15{ position:absolute!important;top:30px!important;left:48px!important;right:36px!important; width:auto!important;height:57px!important;display:block!important; grid-template-columns:none!important;align-items:initial!important; margin:0!important;padding:0!important;border:0!important;background:none!important; box-shadow:none!important;overflow:visible!important;pointer-events:none!important; } #sa-dossier-clean .portrait .sa-id-top-work.sa-unified-header-v15:before, #sa-dossier-clean .portrait .sa-id-top-work.sa-unified-header-v15:after{ display:none!important;content:none!important; } #sa-dossier-clean .portrait .sa-id-top-work.sa-unified-header-v15 .sa-uh-label{ position:absolute!important;top:0!important;left:0!important;right:0!important; display:block!important;width:auto!important;height:11px!important; margin:0!important;padding:0!important;border:0!important; color:#d1a252!important;font:600 8px/11px Georgia,serif!important; letter-spacing:1.35px!important;text-align:center!important;white-space:nowrap!important; } #sa-dossier-clean .portrait .sa-id-top-work.sa-unified-header-v15 .sa-uh-name{ position:absolute!important;top:19px!important;left:0!important;right:0!important; display:block!important;width:auto!important;max-width:none!important;height:16px!important; margin:0!important;padding:0!important;border:0!important; color:#e6ba70!important;font:600 11px/16px Georgia,serif!important; letter-spacing:.25px!important;text-align:center!important;white-space:nowrap!important; overflow:visible!important;text-overflow:clip!important; } #sa-dossier-clean .portrait .sa-id-top-work.sa-unified-header-v15 .sa-uh-rule{ position:absolute!important;top:46px!important;left:12%!important;right:12%!important; display:block!important;width:auto!important;height:1px!important; margin:0!important;padding:0!important; background:linear-gradient(90deg,transparent,rgba(211,162,75,.75),transparent)!important; opacity:.85!important; } `; document.head.appendChild(s); } function render(){ var root=document.getElementById('sa-dossier-clean'); var bar=root&&root.querySelector('.sa-id-top-work'); if(!bar)return; var full=name(); if(!full)return; if(!bar.classList.contains('sa-unified-header-v15')){ bar.replaceChildren(); bar.className='sa-id-top-work sa-unified-header-v15'; var l=document.createElement('span');l.className='sa-uh-label';l.textContent='ARCHIVIO CIVICO'; var n=document.createElement('b');n.className='sa-uh-name'; var i=document.createElement('i');i.className='sa-uh-rule'; bar.append(l,n,i); } var b=bar.querySelector('.sa-uh-name'); if(!b)return; if(b.textContent!==full)b.textContent=full; var size=11; b.style.setProperty('font-size',size+'px','important'); // Measure text with a canvas so overflow:hidden cannot mask truncation. var canvas=render.canvas||(render.canvas=document.createElement('canvas')); var ctx=canvas.getContext('2d'); if(ctx){ while(size>7){ ctx.font='600 '+size+'px Georgia'; if(ctx.measureText(full).width+Math.max(0,full.length-1)*.25<=bar.clientWidth-4)break; size-=.25; } b.style.setProperty('font-size',size+'px','important'); } } function start(){ css();render(); [80,200,450,900,1600,3000].forEach(function(ms){setTimeout(render,ms)}); var timer; new MutationObserver(function(){clearTimeout(timer);timer=setTimeout(render,80)}) .observe(document.getElementById('sa-dossier-clean')||document.documentElement, {childList:true,subtree:true,characterData:true}); } if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',start,{once:true}); else start(); })();