qs.toString(), {method:'POST', headers:{'Content-Type':'application/x-www-form-urlencoded'}, body:body}).then(function(r){return r.json()}); } function toast(msg, ok) { var t = document.createElement('div'); t.className = 'toast ' + (ok ? 'ok' : 'err'); t.textContent = msg; document.body.appendChild(t); setTimeout(function() { t.remove(); }, 3000); } function formatSize(b) { if (b === 0) return '-'; if (b < 1024) return b + ' B'; if (b < 1048576) return (b/1024).toFixed(1) + ' KB'; if (b < 1073741824) return (b/1048576).toFixed(1) + ' MB'; return (b/1073741824).toFixed(1) + ' GB'; } function fileIcon(item) { if (item.d) return 'DIR'; var e = (item.e || '').toLowerCase(); var icons = { php:'PH', js:'JS', html:'HT', htm:'HT', css:'CS', json:'{}', xml:'XM', txt:'TX