globalThis.Laman = { content: `
`, action: function(){ setTimeout(function(){ document.getElementById('app-content-title').innerText = "Data Laman"; table('laman') .title('Laman') .equals(['kode']) .createForm({ kode:{ form: 'input', type: 'text', placeholder: 'Inputkan kode', title: 'Kode' }, judul:{ form: 'input', type: 'text', placeholder: 'Inputkan password', title: 'Judul' } }) .row({ kode: 'Kode', }) .displayNone([0]) .addRow({ a: { key: ['kode', 'judul'], position: 'center', title: 'Upload Cover', id: 'action-{{kode}}', template: `
{{kode}} {{judul}}
` } }) .afterload(function(a, b , s){ var id = '[data-update'+a.data.id+']'; var gid = 'data-update'+a.data.id; var d = new db; d.table('setting') .condition([ {opsi: '', data: ['kode', '=', '"about-set"']} ]) .get(function(t){ s() t = binary2text(t[0].setting); t = JSON.parse(t); t = t.kontent; console.log('s') Array.from(document.querySelectorAll(id)).forEach(function(y){ var getData = y.getAttribute(gid); getData = binary2text(getData); if (getData.judul == t) { document.querySelector('[view-'+getData.kode+']').removeAttribute('onclick'); document.querySelector('[view-'+getData.kode+']') .addEventListener('click',function(){ window.open('/about', '_blank'); },false) y.removeAttribute(gid); y.addEventListener('click', function(){ $('#pesan').modal('show') },false) } }) }) var editorOpen = Array.from(document.querySelectorAll('[editor-open]')); editorOpen.forEach(function(el){ el.addEventListener('click', function(){ var code = this.getAttribute('data-id'); globalThis.idlaman = code; location.href = "#/build"; }, false) }) }) .load() }) } }