(function(){ 'use strict'; if(window.SA_POST_PROFILE_TEST_V3)return;window.SA_POST_PROFILE_TEST_V3=true; function parseDossier(raw){var i=raw.indexOf('SA22:');if(i<0)return null;try{return JSON.parse(raw.slice(i+5).trim())}catch(e){return null}} function findVote(post){ // Move the ORIGINAL Rusff rating control, preserving its events and attributes. var rating=post.querySelector('.post-body .post-rating, .post-rating'); if(!rating)return null; return rating; } function makeCard(author){ if(author.querySelector('.sa-post-card'))return; var post=author.closest('.post'),uid=post.getAttribute('data-user-id'); var ul=author.querySelector('ul'),avatar=author.querySelector('.pa-avatar img'); if(!ul||!avatar)return; var dataNode=author.querySelector('.pa-fld1'),d=dataNode?parseDossier(dataNode.textContent):null; var name=(d&&d.fullName||'').trim()||((author.querySelector('.pa-author a')||{}).textContent||'Персонаж').trim(); var root=document.createElement('section');root.className='sa-post-card'; var heading=document.createElement('a');heading.className='sa-post-name';heading.href='/profile.php?id='+encodeURIComponent(uid);heading.textContent=name; var sub=document.createElement('div');sub.className='sa-post-sub';sub.textContent=[d&&d.age?d.age+' лет':'',d&&d.occupation||''].filter(Boolean).join(' · '); var portrait=document.createElement('div');portrait.className='sa-post-portrait';var photo=avatar.cloneNode(true);photo.removeAttribute('title');portrait.appendChild(photo); var footer=document.createElement('div');footer.className='sa-post-foot'; var user=author.querySelector('.pa-author a'),nick=document.createElement('a');nick.href='/profile.php?id='+encodeURIComponent(uid);nick.textContent=user?user.textContent.trim():name;nick.className='sa-post-user';footer.appendChild(nick); var stats=document.createElement('div');stats.className='sa-post-stats'; ['.pa-posts','.pa-respect','.pa-positive','.pa-online'].forEach(function(sel){ var e=author.querySelector(sel);if(!e)return; var line=document.createElement('div'); if(sel==='.pa-respect'){ line.className='sa-rep-inline'; var raw=e.textContent||'',match=raw.match(/\[\s*\+(\d+)\s*\/\s*-(\d+)\s*\]/); var title=document.createElement('span');title.className='sa-rep-title';title.textContent='РЕПУТАЦИЯ'; var score=document.createElement('span');score.className='sa-rep-count';score.textContent=match?('+'+match[1]+' / -'+match[2]):((e.querySelector(':scope > span:last-child')||{}).textContent||raw.replace(/^[^:]*:/,'').trim()); line.appendChild(title);line.appendChild(score); var slot=document.createElement('span');slot.className='sa-rep-native-slot';line.appendChild(slot); }else line.textContent=e.textContent.trim().replace(/\s+/g,' '); stats.appendChild(line); }); footer.appendChild(stats);root.appendChild(portrait);root.appendChild(heading);root.appendChild(sub);root.appendChild(footer); author.insertBefore(root,ul);author.classList.add('sa-post-ready'); } function run(){ if(!/viewtopic\.php/i.test(location.pathname))return; document.querySelectorAll('.topic .post[data-user-id] .post-author').forEach(function(author){ makeCard(author); var card=author.querySelector('.sa-post-card');if(!card)return; var slot=card.querySelector('.sa-rep-native-slot');if(!slot)return; var post=author.closest('.post');if(!post)return; var nativeRating=findVote(post); // The actual Rusff vote action is in #post-N-vote a.positive, // NOT in .post-rating (which merely opens the voting panel). var voteId=(post.id||'').replace(/^p/, ''); var original=post.querySelector('.post-vote a.positive[href*="relation.php"]') || (voteId && document.querySelector('#post-'+voteId+'-vote a.positive[href*="relation.php"]')); var existing=slot.querySelector('.sa-rep-vote-link'); if(!original){if(existing)existing.remove();return;} var href=original.getAttribute('href'); if(!href)return; if(!existing){ existing=document.createElement('a'); existing.className='sa-rep-vote-link'; existing.textContent='+'; existing.title='Повысить репутацию за сообщение';existing.setAttribute('aria-label','Повысить репутацию'); slot.appendChild(existing); } // Use the exact server-provided link, including its per-post token. existing.setAttribute('href',href);existing.dataset.saUser=post.getAttribute('data-user-id')||''; // Hide the native rating trigger only where a real vote link exists. if(nativeRating)nativeRating.classList.add('sa-rating-proxied'); }); } var style=document.createElement('style');style.textContent='.topic .post-author.sa-post-ready>ul{display:none!important}.topic .post-author .sa-post-card{box-sizing:border-box;width:216px;max-width:100%;margin:0 auto 12px;padding:12px;background:linear-gradient(145deg,#142725,#091617);border:1px solid #ad8647;box-shadow:inset 0 0 0 3px #12201e,0 7px 20px #0002;color:#e7d4ad;text-align:center;font-family:Georgia,serif}.sa-post-portrait{width:180px;max-width:100%;height:250px;margin:0 auto 12px;border:1px solid #b99456;overflow:hidden}.sa-post-portrait img{display:block;width:100%;height:100%;object-fit:cover}.sa-post-name{display:block;font-size:18px;line-height:1.25;color:#e9c47b!important;text-decoration:none!important;overflow-wrap:anywhere}.sa-post-name:hover{text-shadow:0 0 12px #d9a95b}.sa-post-sub{margin:6px 0 10px;font-size:12px;color:#c9b99a}.sa-post-foot{border-top:1px solid #79633e;padding-top:10px}.sa-post-user{font-size:12px;color:#dfb36a!important}.sa-post-stats{font-size:11px;line-height:1.7;margin-top:8px;color:#d6c9ad}.sa-post-stats>div{border-top:1px solid #ffffff14;padding:3px 0}.topic .post-author.sa-post-ready{min-width:216px}';document.head.appendChild(style); var pending=false;function schedule(){if(pending)return;pending=true;requestAnimationFrame(function(){pending=false;run()})} if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',schedule);else schedule(); var target=document.querySelector('.topic')||document.body; new MutationObserver(function(records){for(var i=0;i .container { display:grid !important; grid-template-columns: 232px minmax(0,1fr) !important; column-gap:18px !important; align-items:start !important; box-sizing:border-box !important; } .topic .post[data-user-id] > .container > .post-author { grid-column:1 !important; grid-row:1 !important; float:none !important; clear:none !important; position:relative !important; left:auto !important; right:auto !important; top:auto !important; width:232px !important; min-width:0 !important; max-width:232px !important; margin:0 !important; padding:0 !important; box-sizing:border-box !important; } .topic .post[data-user-id] > .container > .post-author .sa-post-card { width:216px !important; margin:0 auto 12px !important; } .topic .post[data-user-id] > .container > .post-body { grid-column:2 !important; grid-row:1 !important; float:none !important; clear:none !important; position:relative !important; left:auto !important; right:auto !important; top:auto !important; width:auto !important; min-width:0 !important; max-width:none !important; margin:0 !important; box-sizing:border-box !important; } .topic .post[data-user-id] > .container > .post-links { grid-column:1 / -1 !important; grid-row:2 !important; float:none !important; clear:both !important; width:auto !important; margin-top:10px !important; } .topic .post[data-user-id] > .container > .post-body .post-content { overflow-wrap:anywhere; min-width:0; } @media (max-width: 650px) { .topic .post[data-user-id] > .container { grid-template-columns:minmax(0,1fr) !important; row-gap:12px !important; } .topic .post[data-user-id] > .container > .post-author, .topic .post[data-user-id] > .container > .post-body, .topic .post[data-user-id] > .container > .post-links { grid-column:1 !important; width:auto !important; max-width:none !important; } .topic .post[data-user-id] > .container > .post-author {grid-row:1 !important;} .topic .post[data-user-id] > .container > .post-body {grid-row:2 !important;} .topic .post[data-user-id] > .container > .post-links {grid-row:3 !important;} } `; var el=document.createElement('style');el.id='sa-post-profile-v3-layout';el.textContent=css;document.head.appendChild(el); })(); /* v4: bottom action toolbar, no changes to original post-card code */ (function(){if(document.getElementById("sa-post-profile-v4-links"))return;var s=document.createElement("style");s.id="sa-post-profile-v4-links";s.textContent='/* SAN AVELIO — post action toolbar v4; preserves Rusff native links and handlers. */\n.topic .post[data-user-id] > .container > .post-links {\n grid-column:1 / -1!important;grid-row:2!important;display:block!important;\n width:100%!important;min-width:0!important;box-sizing:border-box!important;\n margin:14px 0 0!important;padding:10px 12px!important;\n border-top:1px solid rgba(170,125,60,.5)!important;\n background:linear-gradient(90deg,rgba(19,39,36,.055),rgba(189,146,77,.07),rgba(19,39,36,.055))!important;\n}\n.topic .post[data-user-id] > .container > .post-links > ul {\n display:flex!important;align-items:center!important;flex-wrap:wrap!important;\n gap:5px 9px!important;list-style:none!important;margin:0!important;padding:0!important;\n width:100%!important;float:none!important;clear:both!important;\n}\n.topic .post[data-user-id] > .container > .post-links > ul > li {\n display:block!important;float:none!important;position:static!important;\n width:auto!important;height:auto!important;list-style:none!important;\n margin:0!important;padding:0!important;background:none!important;\n border:0!important;flex:0 0 auto!important;\n}\n.topic .post[data-user-id] > .container > .post-links > ul > li.pl-delete {margin-left:auto!important;}\n.topic .post[data-user-id] > .container > .post-links > ul > li > a {\n display:inline-flex!important;align-items:center!important;justify-content:center!important;\n min-height:27px!important;box-sizing:border-box!important;\n padding:5px 9px!important;border:1px solid transparent!important;border-radius:2px!important;\n background:transparent!important;box-shadow:none!important;\n color:#76512e!important;font:normal 11px/1.35 Georgia,serif!important;\n text-decoration:none!important;text-shadow:none!important;white-space:nowrap!important;\n transition:background .2s ease,color .2s ease,border-color .2s ease!important;\n}\n.topic .post[data-user-id] > .container > .post-links > ul > li > a:hover,\n.topic .post[data-user-id] > .container > .post-links > ul > li > a:focus-visible {\n color:#153b35!important;background:rgba(189,146,77,.14)!important;\n border-color:rgba(159,117,55,.42)!important;\n}\n.topic .post[data-user-id] > .container > .post-links .acchide {display:none!important;}\n@media(max-width:760px){\n .topic .post[data-user-id] > .container > .post-links > ul {gap:3px 5px!important;}\n .topic .post[data-user-id] > .container > .post-links > ul > li.pl-delete {margin-left:0!important;}\n .topic .post[data-user-id] > .container > .post-links > ul > li > a {padding:5px 7px!important;}\n}\n@media(max-width:650px){\n .topic .post[data-user-id] > .container > .post-links {grid-column:1!important;grid-row:3!important;}\n}\n';document.head.appendChild(s)})(); /* v5: safe premium skin, preserves v4 mechanics and layout */ (function(){if(document.getElementById("sa-post-profile-v5-premium"))return;var el=document.createElement("style");el.id="sa-post-profile-v5-premium";el.textContent='\n/* Premium appearance only. No grid / positioning changes. */\n.topic .post[data-user-id] .post-author.sa-post-ready .sa-post-card{\n position:relative; isolation:isolate; overflow:hidden;\n background:radial-gradient(ellipse at 50% -14%,rgba(181,139,70,.19),transparent 54%),linear-gradient(155deg,#142c2a 0%,#0b1b1b 48%,#091313 100%)!important;\n border:1px solid #b38b4b!important;\n padding:14px 12px 17px!important;\n box-shadow:inset 0 0 0 3px #102522,inset 0 0 0 4px rgba(193,150,78,.34),0 10px 24px rgba(26,20,11,.19)!important;\n transition:box-shadow .3s ease,border-color .3s ease;\n}\n.topic .post[data-user-id] .post-author.sa-post-ready .sa-post-card:hover{\n border-color:#e0ba76!important;\n box-shadow:inset 0 0 0 3px #102522,inset 0 0 0 4px rgba(224,186,118,.5),0 14px 30px rgba(26,20,11,.25)!important;\n}\n.topic .post[data-user-id] .sa-post-card::before,\n.topic .post[data-user-id] .sa-post-card::after{\n content:"";position:absolute;pointer-events:none;z-index:3;width:18px;height:18px;border-color:#d6ae69;border-style:solid;opacity:.8;\n}\n.topic .post[data-user-id] .sa-post-card::before{top:6px;left:6px;border-width:1px 0 0 1px}\n.topic .post[data-user-id] .sa-post-card::after{bottom:6px;right:6px;border-width:0 1px 1px 0}\n.topic .post[data-user-id] .sa-post-portrait{\n position:relative;border:1px solid #cba66a!important;\n outline:1px solid rgba(216,170,96,.35);outline-offset:3px;\n box-shadow:0 7px 18px rgba(0,0,0,.38),inset 0 0 0 1px rgba(255,255,255,.08);\n margin-bottom:17px!important;\n}\n.topic .post[data-user-id] .sa-post-portrait img{transition:transform .65s cubic-bezier(.2,.7,.2,1),filter .5s ease;filter:saturate(.9) contrast(1.05)}\n.topic .post[data-user-id] .sa-post-card:hover .sa-post-portrait img{transform:scale(1.045);filter:saturate(1.03) contrast(1.06)}\n.topic .post[data-user-id] .sa-post-name{\n font-family:Georgia,\'Times New Roman\',serif!important;\n font-size:18px!important;letter-spacing:.35px;line-height:1.25!important;\n color:#f1d39a!important;text-shadow:0 1px 1px rgba(0,0,0,.6);\n transition:color .25s ease,text-shadow .25s ease;\n}\n.topic .post[data-user-id] .sa-post-name:hover{color:#fff0c8!important;text-shadow:0 0 12px rgba(244,198,110,.48)}\n.topic .post[data-user-id] .sa-post-sub{color:#d2bc90!important;letter-spacing:.3px;line-height:1.5!important;margin:7px 0 13px!important;min-height:0}\n.topic .post[data-user-id] .sa-post-sub:empty{display:none}\n.topic .post[data-user-id] .sa-post-foot{position:relative;border-top:1px solid rgba(192,147,75,.55)!important;padding-top:13px!important}\n.topic .post[data-user-id] .sa-post-foot::before{\n content:"";position:absolute;top:-3px;left:calc(50% - 3px);width:6px;height:6px;\n background:#bd965b;transform:rotate(45deg);box-shadow:0 0 0 3px #10201e;\n}\n.topic .post[data-user-id] .sa-post-user{color:#d9b77d!important;font-size:11px!important;letter-spacing:.5px;text-decoration:none!important}\n.topic .post[data-user-id] .sa-post-user:hover{color:#ffe0a1!important}\n.topic .post[data-user-id] .sa-post-stats{margin-top:10px!important;font:11px/1.65 Georgia,serif!important;color:#d9d1bc!important}\n.topic .post[data-user-id] .sa-post-stats>div{padding:5px 2px!important;border-top:1px solid rgba(218,183,117,.12)!important}\n.topic .post[data-user-id] .sa-post-stats>div:first-child{border-top:0!important}\n@media(prefers-reduced-motion:reduce){\n .topic .post[data-user-id] .sa-post-card,\n .topic .post[data-user-id] .sa-post-portrait img,\n .topic .post[data-user-id] .sa-post-name{transition:none!important}\n}\n';document.head.appendChild(el)})(); /* v20: precise SVG arrow and animated light sweep; preserves AJAX voting. */ (function(){ var st=document.createElement('style');st.id='sa-rep-v20';st.textContent=` .topic .post-author .sa-post-foot{padding-top:9px!important} .topic .post-author .sa-post-user{display:none!important} .topic .post-author .sa-post-stats{margin-top:0!important;font-size:11px!important} .topic .post-author .sa-post-stats>div{border-top:1px solid rgba(210,170,101,.14)!important} .topic .post-author .sa-post-stats>div:first-child{border-top:0!important} .topic .post-author .sa-rep-inline{display:flex!important;align-items:center!important;justify-content:center!important;flex-wrap:nowrap!important;gap:7px!important;margin:0!important;padding:8px 2px!important;background:none!important;border:0!important;text-align:center!important;min-height:26px!important} .topic .post-author .sa-rep-title{display:inline!important;flex:0 1 auto!important;color:#c5a574!important;font:normal 10px/1.4 Georgia,serif!important;letter-spacing:.045em!important;text-transform:none!important;white-space:nowrap!important} .topic .post-author .sa-rep-count{display:inline!important;flex:0 0 auto!important;color:#f2d29b!important;font:normal 13px/1.3 Georgia,serif!important;letter-spacing:0!important;font-variant-numeric:tabular-nums!important;transition:color .3s,text-shadow .3s!important} .topic .post-author .sa-rep-count.sa-rep-flash{color:#fff5d8!important;text-shadow:0 0 13px rgba(247,201,117,.85)!important} .topic .post-author .sa-rep-native-slot{display:inline-flex!important;flex:0 0 auto!important;align-items:center!important;justify-content:center!important;margin-left:1px!important} .topic .post-author .sa-rep-vote-link{box-sizing:border-box!important;display:inline-flex!important;position:relative!important;align-items:center!important;justify-content:center!important;width:23px!important;height:23px!important;min-width:23px!important;padding:0!important;border:1px solid rgba(187,149,88,.32)!important;border-radius:2px!important;background:rgba(181,144,78,.045)!important;box-shadow:none!important;color:transparent!important;font-size:0!important;line-height:0!important;text-decoration:none!important;cursor:pointer!important;vertical-align:middle!important;overflow:hidden!important;transition:background .2s,border-color .2s,box-shadow .2s!important} .topic .post-author .sa-rep-vote-link::before{content:''!important;position:absolute!important;inset:3px!important;width:auto!important;height:auto!important;display:block!important;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 19V5M6.5 10.5 12 5l5.5 5.5' fill='none' stroke='%23dfc38a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat!important;transform:none!important;border:0!important;pointer-events:none!important;z-index:2!important;transition:filter .28s ease!important} .topic .post-author .sa-rep-vote-link::after{content:''!important;position:absolute!important;display:block!important;inset:-12px!important;width:auto!important;height:auto!important;border:0!important;background:linear-gradient(108deg,transparent 36%,rgba(248,219,151,.0) 43%,rgba(248,219,151,.48) 50%,rgba(248,219,151,.0) 57%,transparent 64%)!important;transform:translateX(-145%)!important;pointer-events:none!important;z-index:1!important;opacity:0!important} @keyframes sa-rep-light-travel{0%{transform:translateX(-145%);opacity:0}12%{opacity:1}80%{opacity:1}100%{transform:translateX(145%);opacity:0}} .topic .post-author .sa-rep-vote-link:hover::after,.topic .post-author .sa-rep-vote-link:focus-visible::after{animation:sa-rep-light-travel .75s cubic-bezier(.24,.5,.3,1) both!important} .topic .post-author .sa-rep-vote-link:hover::before,.topic .post-author .sa-rep-vote-link:focus-visible::before{filter:drop-shadow(0 0 2px rgba(245,211,143,.65))!important} @media(prefers-reduced-motion:reduce){.topic .post-author .sa-rep-vote-link::after{animation:none!important}} .topic .post-author .sa-rep-vote-link:hover,.topic .post-author .sa-rep-vote-link:focus-visible{border-color:rgba(230,190,119,.8)!important;background:rgba(195,151,82,.14)!important;box-shadow:0 0 9px rgba(213,173,105,.14)!important;transform:none!important} .topic .post-author .sa-rep-vote-link.sa-rep-busy{opacity:.5!important;pointer-events:none!important} .topic .post-author .sa-rep-vote-link.sa-rep-error{border-color:#bd786a!important} .topic .post-author .sa-post-stats>div.sa-rep-inline{padding:8px 2px!important} .topic .post-author .sa-post-stats>div:not(.sa-rep-inline){text-align:center!important;padding:7px 3px!important;display:block!important} .topic .post-author .sa-post-stats>div:not(.sa-rep-inline):last-child{border-bottom:0!important} .topic .post .post-rating.sa-rating-proxied{position:absolute!important;left:-10000px!important;top:auto!important;width:1px!important;height:1px!important;overflow:hidden!important;opacity:0!important;pointer-events:none!important} `;document.head.appendChild(st); // Do not change the displayed score until the server confirms it on a fresh topic page. document.addEventListener('click',async function(ev){ var link=ev.target.closest&&ev.target.closest('.sa-rep-vote-link'); if(!link||link.classList.contains('sa-rep-busy'))return; if(!window.fetch||!window.DOMParser)return; // Native navigation fallback. ev.preventDefault(); var href=link.href; if(new URL(href,location.href).origin!==location.origin)return; link.classList.add('sa-rep-busy');link.setAttribute('aria-disabled','true'); try{ var vote=await fetch(href,{method:'GET',credentials:'same-origin',redirect:'follow',cache:'no-store'}); if(!vote.ok)throw new Error('Vote HTTP '+vote.status); var check=await fetch(location.pathname+location.search,{credentials:'same-origin',cache:'no-store'}); if(!check.ok)throw new Error('Refresh HTTP '+check.status); var html=await check.text(),doc=new DOMParser().parseFromString(html,'text/html'); var uid=link.dataset.saUser,post=link.closest('.post'); var current=post&&post.querySelector('.pa-respect > span:last-child'); var next=doc.querySelector('.post[data-user-id="'+CSS.escape(uid)+'"] .pa-respect > span:last-child'); if(!next||!current)throw new Error('Missing server reputation value'); var oldValue=(current.textContent||'').trim(),newValue=(next.textContent||'').trim(); if(newValue===oldValue)throw new Error('Vote was not confirmed'); document.querySelectorAll('.topic .post[data-user-id]').forEach(function(p){ if(p.getAttribute('data-user-id')!==uid)return; var original=p.querySelector('.pa-respect > span:last-child');if(original)original.textContent=newValue; var shown=p.querySelector('.sa-rep-count');if(shown){shown.textContent=newValue;shown.classList.add('sa-rep-flash');setTimeout(function(){shown.classList.remove('sa-rep-flash')},850)} }); link.remove(); // This message can no longer receive a second vote from the same viewer. }catch(err){ link.classList.remove('sa-rep-busy');link.removeAttribute('aria-disabled');link.classList.add('sa-rep-error'); link.title='Оценка не подтверждена сервером. Попробуйте обновить страницу.'; setTimeout(function(){link.classList.remove('sa-rep-error')},1600); console.warn('[SAN AVELIO] Reputation vote:',err); } },true); })(); /* SAN AVELIO v22: restore full-width map post; leave all other topics untouched. */ (function(){ if(document.getElementById('sa-map-fullwidth-v22'))return; var st=document.createElement('style'); st.id='sa-map-fullwidth-v22'; st.textContent=` /* The atlas iframe must not be confined to the profile/content split. */ .topic .post:has(#sa-map-frame) > .container { display:block!important; width:100%!important; min-width:0!important; } .topic .post:has(#sa-map-frame) > .container > .post-author { display:none!important; } .topic .post:has(#sa-map-frame) > .container > .post-body { display:block!important; width:100%!important; min-width:0!important; max-width:none!important; margin:0!important; padding:0!important; float:none!important; } .topic .post:has(#sa-map-frame) .post-content, .topic .post:has(#sa-map-frame) #sa-map-frame { display:block!important; width:100%!important; max-width:none!important; min-width:0!important; box-sizing:border-box!important; } `; document.head.appendChild(st); })();