Skip to content

Focusing: focus/blur #160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Nov 16, 2020
Merged

Focusing: focus/blur #160

merged 11 commits into from
Nov 16, 2020

Conversation

Pazmy
Copy link
Contributor

@Pazmy Pazmy commented Oct 24, 2020

No description provided.

Copy link
Member

@juuni26 juuni26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tolong diperbaiki beberapa bahasanya gan. terimakasih telah membantu projek open source ini berkembang 👋

3. Focus on the textarea.
4. Show buttons OK/CANCEL under the cell, handle clicks on them.
1. Saat diklik -- ganti `innerHTML` dari sel oleh `<textarea>`dengan ukuran yang sama dan tanpa border. Bisa menggunakan JavaScript atau CSS untuk mengatur ukuran yang sesuai.
2. Set `textarea.value` ke `td.innerHTML`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set belum diterjemahin, bisa diubah jadi atur atau ubah

2. Set `textarea.value` to `td.innerHTML`.
3. Focus on the textarea.
4. Show buttons OK/CANCEL under the cell, handle clicks on them.
1. Saat diklik -- ganti `innerHTML` dari sel oleh `<textarea>`dengan ukuran yang sama dan tanpa border. Bisa menggunakan JavaScript atau CSS untuk mengatur ukuran yang sesuai.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sepertinya lebih baik kata "oleh" nya dihilangkan, agar mempermudah pembacaan dan jangan lupa spasi setelah <textarea>

- Only one cell may be editable at a moment. While a `<td>` is in "edit mode", clicks on other cells are ignored.
- The table may have many cells. Use event delegation.
- Saat diklik -- sel akan menjadi "editable" (textarea muncul dalam), kita bisa mengubah HTML. Tidak boleh mengubah ukurannya, semua geometri harus tetap sama..
- Tombol OK and CANCEL muncul di bawah sel untuk finish/cancel editing.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kata finish/cancel bisa diterjemahkan lagi , contoh kalimat: "tombol ok dan cancel muncul dibawah sel untuk menyelesaikan atau membatalkan proses sunting/perubahan."

- The table may have many cells. Use event delegation.
- Saat diklik -- sel akan menjadi "editable" (textarea muncul dalam), kita bisa mengubah HTML. Tidak boleh mengubah ukurannya, semua geometri harus tetap sama..
- Tombol OK and CANCEL muncul di bawah sel untuk finish/cancel editing.
- Hanya satu sel yang dapat diedit setiap saat. Sementara `<td>` dalam "edit mode", klik pada sel lain akan diabaikan.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saran tambahkan imbuhan "nya "agar menekankan di satu moment . "Hanya satu sel yang dapat diedit setiap saatnya"

@@ -1,6 +1,6 @@

We can use `mouse.onclick` to handle the click and make the mouse "moveable" with `position:fixed`, then `mouse.onkeydown` to handle arrow keys.
Kita bisa gunakan `mouse.onclick` untuk menghandle klik dan membuat mouse "moveable/bergerak" dengan `position:fixed`, kemudian `mouse.onkeydown` untuk handle tombol panah.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

menghandle bisa diubah menjadi menangani/mengatur


The only pitfall is that `keydown` only triggers on elements with focus. So we need to add `tabindex` to the element. As we're forbidden to change HTML, we can use `mouse.tabIndex` property for that.
Satu-satunya jebakan ialah `keydown` hanya trigger pada elemen dengan fokus. Jadi kita perlu untuk menambahkan `tabindex` pada elemen. Karena kita dilarang mengubah HTML, kita bisa gunakan `mouse.tabIndex` properti untuk itu.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trigger bisa diubah menjadi memicu, contoh: keydown hanya memicu pada elemen yang memiliki fokus. dan properti bisa diletakkan didepan agar sesuai dengan kaidah bahasa , contoh : kita bisa gunakan propertimouse.tabIndex untuk itu.


[demo src="solution"]

P.S. Don't put event handlers anywhere except the `#mouse` element.
P.P.S. Don't modify HTML/CSS, the approach should be generic and work with any element.
P.S. Jangan letakkan event handler dimanapun kecuali elemen `#mouse`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tambahkan kata "pada" agar lebih menjelaskan dimana elemen mouse. contoh: "Jangan letakkan event handler dimanapun kecuali pada elemen #mouse."

P.S. Don't put event handlers anywhere except the `#mouse` element.
P.P.S. Don't modify HTML/CSS, the approach should be generic and work with any element.
P.S. Jangan letakkan event handler dimanapun kecuali elemen `#mouse`.
P.P.S. Jangan modif HTML/CSS, pendekatannya harus umum dan bekerja dengan elemen manapun.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modif bisa diubah menjadi kata yang lebih baku seperti ubah atau modifikasi sekalian.

@javascript-translate-bot

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

@Pazmy
Copy link
Contributor Author

Pazmy commented Nov 12, 2020

/done

@juuni26 juuni26 merged commit 37e138e into javascript-tutorial:master Nov 16, 2020
@javascript-translate-bot

Thank you 💖 I updated the Progress Issue #1 🎉 🎉 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 participants