Loading plugins/survey/survey.cpp +15 −3 Changes for plugins/survey/survey.cpp: 15 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -1238,6 +1238,8 @@ namespace blogi { } html << "</form>" << "<div class=\"survey-loading\"><div class=\"survey-spinner\"></div>" << "<div class=\"survey-loading-text\">" << tr(_lang, "Sending...") << "</div></div>" << "<div class=\"surveyMessage\"></div>"; // Inline CSS — scoped to .survey-page Loading Loading @@ -1284,6 +1286,11 @@ namespace blogi { << ".survey-page .image-item img{width:100%;height:100px;object-fit:cover;border-radius:6px;}" << ".survey-page .image-item .image-name{font-size:.8em;margin-top:6px;color:var(--blogi-text-muted,#444);word-break:break-all;}" << ".survey-page .image-item .file-remove{margin-top:6px;width:100%;background:var(--blogi-error,#F36947);color:var(--blogi-surface,#fff);border:none;padding:6px 10px;border-radius:999px;cursor:pointer;font-size:.85em;}" << ".survey-page .survey-loading{display:none;text-align:center;padding:32px;}" << ".survey-page .survey-loading.active{display:block;}" << ".survey-page .survey-spinner{display:inline-block;width:36px;height:36px;border:4px solid var(--blogi-border,#eaeaea);border-top-color:var(--blogi-accent,#84CB3A);border-radius:50%;animation:survey-spin .8s linear infinite;}" << "@keyframes survey-spin{to{transform:rotate(360deg);}}" << ".survey-page .survey-loading-text{margin-top:12px;color:var(--blogi-text-muted,#6b6b6b);font-size:.95em;}" << "</style>"; // Inline JS — scoped per survey instance Loading Loading @@ -1411,13 +1418,18 @@ namespace blogi { << "for(var k in excl){if(excl.hasOwnProperty(k))exclArr.push(k);}" << "if(exclArr.length>0)data['_excluded']=exclArr;" << "var xhr=new XMLHttpRequest();" << "var loading=root.querySelector('.survey-loading');" << "form.style.display='none';root.querySelector('.wizard-progress').style.display='none';" << "loading.classList.add('active');" << "xhr.open('POST','" << jsonEscape(submitUrl) << "',true);" << "xhr.setRequestHeader('Content-Type','application/json');" << "xhr.onreadystatechange=function(){" << "if(xhr.readyState===4){var m=root.querySelector('.surveyMessage'),p=root.querySelector('.wizard-progress');" << "if(xhr.readyState===4){loading.classList.remove('active');" << "var m=root.querySelector('.surveyMessage');" << "try{var r=JSON.parse(xhr.responseText);" << "if(xhr.status===200&&r.status==='ok'){m.className='success';m.textContent=r.message||'Thank you!';form.style.display='none';if(p)p.style.display='none';}" << "else{m.className='error';m.textContent=r.message||'Error';}}catch(e){m.className='error';m.textContent='Server error';}m.style.display='block';}};" << "if(xhr.status===200&&r.status==='ok'){m.className='surveyMessage success';m.textContent=r.message||'Thank you!';}" << "else{m.className='surveyMessage error';m.textContent=r.message||'Error';form.style.display='';root.querySelector('.wizard-progress').style.display='';}}" << "catch(e){m.className='surveyMessage error';m.textContent='Server error';form.style.display='';root.querySelector('.wizard-progress').style.display='';}}};" << "xhr.send(JSON.stringify(data));}" // event delegation << "root.addEventListener('click',function(e){" Loading Loading
plugins/survey/survey.cpp +15 −3 Changes for plugins/survey/survey.cpp: 15 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -1238,6 +1238,8 @@ namespace blogi { } html << "</form>" << "<div class=\"survey-loading\"><div class=\"survey-spinner\"></div>" << "<div class=\"survey-loading-text\">" << tr(_lang, "Sending...") << "</div></div>" << "<div class=\"surveyMessage\"></div>"; // Inline CSS — scoped to .survey-page Loading Loading @@ -1284,6 +1286,11 @@ namespace blogi { << ".survey-page .image-item img{width:100%;height:100px;object-fit:cover;border-radius:6px;}" << ".survey-page .image-item .image-name{font-size:.8em;margin-top:6px;color:var(--blogi-text-muted,#444);word-break:break-all;}" << ".survey-page .image-item .file-remove{margin-top:6px;width:100%;background:var(--blogi-error,#F36947);color:var(--blogi-surface,#fff);border:none;padding:6px 10px;border-radius:999px;cursor:pointer;font-size:.85em;}" << ".survey-page .survey-loading{display:none;text-align:center;padding:32px;}" << ".survey-page .survey-loading.active{display:block;}" << ".survey-page .survey-spinner{display:inline-block;width:36px;height:36px;border:4px solid var(--blogi-border,#eaeaea);border-top-color:var(--blogi-accent,#84CB3A);border-radius:50%;animation:survey-spin .8s linear infinite;}" << "@keyframes survey-spin{to{transform:rotate(360deg);}}" << ".survey-page .survey-loading-text{margin-top:12px;color:var(--blogi-text-muted,#6b6b6b);font-size:.95em;}" << "</style>"; // Inline JS — scoped per survey instance Loading Loading @@ -1411,13 +1418,18 @@ namespace blogi { << "for(var k in excl){if(excl.hasOwnProperty(k))exclArr.push(k);}" << "if(exclArr.length>0)data['_excluded']=exclArr;" << "var xhr=new XMLHttpRequest();" << "var loading=root.querySelector('.survey-loading');" << "form.style.display='none';root.querySelector('.wizard-progress').style.display='none';" << "loading.classList.add('active');" << "xhr.open('POST','" << jsonEscape(submitUrl) << "',true);" << "xhr.setRequestHeader('Content-Type','application/json');" << "xhr.onreadystatechange=function(){" << "if(xhr.readyState===4){var m=root.querySelector('.surveyMessage'),p=root.querySelector('.wizard-progress');" << "if(xhr.readyState===4){loading.classList.remove('active');" << "var m=root.querySelector('.surveyMessage');" << "try{var r=JSON.parse(xhr.responseText);" << "if(xhr.status===200&&r.status==='ok'){m.className='success';m.textContent=r.message||'Thank you!';form.style.display='none';if(p)p.style.display='none';}" << "else{m.className='error';m.textContent=r.message||'Error';}}catch(e){m.className='error';m.textContent='Server error';}m.style.display='block';}};" << "if(xhr.status===200&&r.status==='ok'){m.className='surveyMessage success';m.textContent=r.message||'Thank you!';}" << "else{m.className='surveyMessage error';m.textContent=r.message||'Error';form.style.display='';root.querySelector('.wizard-progress').style.display='';}}" << "catch(e){m.className='surveyMessage error';m.textContent='Server error';form.style.display='';root.querySelector('.wizard-progress').style.display='';}}};" << "xhr.send(JSON.stringify(data));}" // event delegation << "root.addEventListener('click',function(e){" Loading