Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript:(async function(){if(window.__bm_processing)return;window.__bm_processing=true;document.querySelectorAll('.alerts.confirm,.alerts').forEach(e=>e.remove());const st=document.createElement('style');st.textContent='@keyframes bm-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.bm-ovr{position:fixed;top:0;left:0;width:100vw;height:100vh;background:rgba(0,0,0,0.45);display:flex;align-items:center;justify-content:center;z-index:999999}.bm-spn{width:48px;height:48px;border:5px solid #ffffff;border-top:5px solid #3498db;border-radius:50%;animation:bm-spin .8s linear infinite}';document.head.appendChild(st);const ov=document.createElement('div');ov.className='bm-ovr';ov.innerHTML='<div class="bm-spn"></div>';document.body.appendChild(ov);if(window.CKEDITOR)for(let i in CKEDITOR.instances)CKEDITOR.instances[i].updateElement();if(window.tinymce)tinymce.triggerSave();const f=document.getElementById('ai-title-opt')?.closest('form')||document.querySelector('form[action*="ask"]')||document.querySelector('form');if(!f){ov.remove();window.__bm_processing=false;return alert('Form not found.');}const u=new URL(window.location.href);const id=u.searchParams.get('id');let p=new URL(f.getAttribute('action')||'/ask-question',window.location.origin);if(id)p.searchParams.set('id',id);const d=new FormData(f);let t=(d.get('Title')||'').trim();if(t&&!t.endsWith('?'))t+='?';d.set('Title',t);d.delete('AITitleCreate');d.set('ActionButton','preview');try{const r=await fetch(p.toString(),{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:new URLSearchParams(d).toString(),credentials:'include'});let target=new URL(r.url);target.searchParams.set('r','true');target.searchParams.delete('p');window.location.href=target.toString();}catch(e){ov.remove();window.__bm_processing=false;alert('Error: '+e);}})();
Advertisement
Add Comment
Please, Sign In to add comment