Bước tới nội dung

Thảo luận Thành viên:Bennylin

Nội dung trang không được hỗ trợ ở ngôn ngữ khác.
Thêm đề tài
Bách khoa toàn thư mở Wikipedia
Bình luận mới nhất: 11 năm trước bởi Mxn trong đề tài AVIM

Hoan nghênh

[sửa mã nguồn]
Xin chào Bennylin!

Wikipedia tiếng Việt đến nay đã có 1.294.339 bài, đó là kết quả đóng góp quý báu của rất nhiều thành viên trong Wikipedia, mà mọi người đều bắt đầu như bạn. Bạn đã khởi đầu rất tốt và mong rằng bạn sẽ mang đến những đóng góp có giá trị cho quyển bách khoa toàn thư mở này.

Mời bạn giới thiệu về bản thân tại trang thành viên:Bennylin.
Khi thảo luận, bạn nhớ ký tên bằng cách dùng 4 dấu ngã ~~~~!.

Bạn hãy nhớ các nguyên tắc
không viết những gì không bách khoa,
không truyền lên hình ảnh thiếu nguồn gốc,
không vi phạm quyền tác giả.

Đầu tiên bạn nên mạnh dạn
thử mọi liên kết mà bạn muốn,
thử sửa bài thoải mái tại đây,
đề nghị giúp đỡ của bất cứ ai.

Những chỉ dẫn có ích: các câu thường hỏi, cách viết bài mới, soạn thảo bài, trình bày bài, sách hướng dẫn.
Welcome to the Vietnamese Wikipedia, and thank you for registering! If you do not speak Vietnamese, feel free to use our guestbook for non-Vietnamese speakers.

Lời khuyên cuối cùng, bạn hãy làm lần lượt: thử, đọc, hỏi rồi hẵng viết. Chúc bạn thành công.

  Vietbio--15:44, ngày 28 tháng 5 năm 2008 (UTC)Trả lời

AVIM

[sửa mã nguồn]

I think you should contact Mxn. He is the co-author of this script.--Tham Gia Cho Vui (thảo luận) 16:39, ngày 17 tháng 4 năm 2013 (UTC)Trả lời

sự cám ơn! Bennylin (thảo luận) 16:56, ngày 17 tháng 4 năm 2013 (UTC)Trả lời

Hi, Bennylin. Unfortunately, AVIM probably isn't a good starting point for your input method, because no one really knows how AVIM works. (I "coauthored" it by virtue of adapting it to a Firefox extension a few years ago, and I still only understand roughly half of the code.) Besides, AVIM is designed specifically for the Latin-based Vietnamese alphabet, so I don't think the code would be very useful for a transliterating input method.

At this point, jquery.ime is a much better foundation for any input method. I see that you've already written a ruleset for Narayam. That ruleset has been copied into jquery.ime, because Narayam and jquery.ime are largely compatible. If your ruleset is suitable for the Javanese wikis, I would suggest filing a bug in Bugzilla about installing the Narayam extension at those wikis. For other websites, I would recommend jquery.ime rather than developing an independent script.

I hope this helps. If you have any questions about improving the Narayam ruleset, I'm sure the jquery.ime developers would be able to assist you.

 – Nguyễn Xuân Minh (thảo luận, đóng góp) 07:15, ngày 18 tháng 4 năm 2013 (UTC)Trả lời

Here's a high-level overview of the basic functionality (not including contentEditable, iframe, or legacy browser support): register a listener for the keypress event using window.addEventListener(). (It's also possible to do things more manually by listening for the keyup and keydown events, but don't do that, because you'd have to mess with raw key codes, which can vary by physical keyboard layout.) In the listener function (called keyPressHandler() in AVIM), first make sure that a textbox has focus and that the pressed key isn't a Ctrl key combo or the like. Get the textbox's value up to the index of the text selection, transliterate the end of the string, append the rest of the textbox's value, set the textbox's value to the new string, shift the text selection if the word has gotten longer for some reason, and if there's no need for the browser to insert the original Latin letter, call evt.preventDefault(), where evt is the event object passed in to the listener function.

For iframe support, pass true as the third argument to addEventListener(). For easy cross-browser support, you'd ideally use jquery.textSelection, which is enabled by default on Wikimedia wikis, and instead of addEventListener(), use $.keypress() from jQuery. VisualEditor requires contentEditable support. As far as I know, AVIM for Firefox (source) and AVIM Typing for Chrome are literally the only two IMEs for Vietnamese that can handle VisualEditor, thanks to mozGetText() and replaceChar(). (Unfortunately, that's the part I don't know very well.) I'm not sure why AVIM.js can't handle VisualEditor, because it uses the same code.

JavaScript IMEs are notoriously hard to get right, but I hope this is enough to get you started.

 – Nguyễn Xuân Minh (thảo luận, đóng góp) 06:10, ngày 19 tháng 4 năm 2013 (UTC)Trả lời