Skip to content

Instantly share code, notes, and snippets.

@gusharr19
gusharr19 / content.js
Last active May 24, 2026 09:10
Pond5 Contributor Price Editor Extension v4.1
(function(){
var L=null,BON=false,BQ=[];
function P(){var e=document.getElementById('pp');var v=e?parseFloat(e.value):NaN;return(!isNaN(v)&&v>0)?v:89;}
function A(){var e=document.getElementById('pa');return!!(e&&e.checked);}
function log(m,t){var e=document.getElementById('pl');if(!e)return;var d=document.createElement('div');d.className='l'+(t||'i');d.textContent=new Date().toLocaleTimeString('id-ID')+' '+m;e.insertBefore(d,e.firstChild);while(e.children.length>25)e.removeChild(e.lastChild);}
function st(m,t){var e=document.getElementById('ps');if(e){e.textContent=m;e.className='ps s'+(t||'i');}}
function vis(el){if(!el)return false;var r=el.getBoundingClientRect();if(!r.width&&!r.height)return false;var s=window.getComputedStyle(el);return s.display!=='none'&&s.visibility!=='hidden';}
function fillV(inp,val){inp.focus();try{inp.select();}catch(e){}var ok=false;try{document.execCommand('selectAll',false,null);ok=document.execCommand('insertText',false,String(val));}catch(e){}if(!ok||String(inp.value)!==Stri