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

Nội dung trang không được hỗ trợ ở ngôn ngữ khác.
Từ điển mở Wiktionary

Hoan nghênh[sửa]

Xin chào Symane!

Wiktionary tiếng Việt đến nay đã có 267.677 mục từ, đó là kết quả đóng góp quý báu của rất nhiều thành viên trong Wiktionary, 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 từ điển mở này.

Mời bạn giới thiệu về bản thân tại trang thành viên:Symane.
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
chỉ viết những gì thuộc từ điển,
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,
viết thử 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 mục từ mới, soạn thảo mục từ, và những hướng dẫn khác.
Welcome to the Vietnamese Wiktionary, 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.

 Tranminh360 (thảo luận) 01:59, ngày 27 tháng 1 năm 2012 (UTC)[trả lời]

You can see MediaWiki:Gadget-main page.js and MediaWiki:Gadget-main page.css. Tranminh360 (thảo luận) 01:59, ngày 27 tháng 1 năm 2012 (UTC)[trả lời]

Yes, as Tranminh360 indicates, it's all done in JavaScript using both jQuery and the MediaWiki API. See the function refreshRandomEntryList() and the two lines below it in MediaWiki:Gadget-main page.js. We created the two interface messages you found in order to provide translations according to your preferences in English, French, and Spanish (and any other language that someone contributes). See MediaWiki:wiktionary-mp-examples/en for instance. If you need any further help implementing it at your wiki, please let me know. – Nguyễn Xuân Minh (thảo luận, đóng góp) 07:03, ngày 27 tháng 1 năm 2012 (UTC)[trả lời]

Thanks for your help.--Symane (thảo luận) 07:46, ngày 27 tháng 1 năm 2012 (UTC)[trả lời]

The JavaScript and CSS are only loaded if you turn them into a gadget: copy MediaWiki:Gadget-main page to your wiki and add the following entry to your gadgets definition, probably under "gadget-section-userif":

* main page[ResourceLoader|default]|main page.js|main page.css

The default flag causes the gadget to load for everyone, including anonymous users, on every page. If you aren't ready for everyone to use this gadget, take out [ResourceLoader|default] for now.

Also, you need the following rules in your Common.css, since it's an inline list:

/* Danh sách nội dòng */
.wiktvi-inline-list { display: inline; list-style: none; margin: 0; }
.wiktvi-inline-list > li { display: inline; margin-left: 0.5em; margin-right: 0.5em; }

Finally, I guess it helps to explain what all the JavaScript functions do:

  1. Places a background image behind the search header if {{Trang Chính/Hình nền}} is included on the page.
  2. Moves the search header to the top of the page and sticks the search field inside it.
  3. refreshRandomEntryList(): Fetches and displays random entries.

If you want the special search header, you need to replace all instances of "Trang_Chính" or "Trang Chính" with "封面" (or whatever page you want this feature to work on) in both the JavaScript and CSS files.

 – Nguyễn Xuân Minh (thảo luận, đóng góp) 09:30, ngày 27 tháng 1 năm 2012 (UTC)[trả lời]

  1. In Gadget-main page.js, delete the second function, "Di chuyển hộp tìm kiếm...". (You probably don't need the first one, either.)
  2. Delete Gadget-main page.css and remove |main page.css from Gadgets-definition.
  3. There isn't an easy way to choose prefixes or categories using the API's random function, but you can choose the namespace. So if you just want articles in the Wikipedia: namespace, replace rnnamespace=0 with rnnamespace=4 in Gadget-main page.js (since 4 is the Wikipedia: namespace's ID).

 – Nguyễn Xuân Minh (thảo luận, đóng góp) 18:15, ngày 27 tháng 1 năm 2012 (UTC)[trả lời]

The problem is the last edit you made to Gadgets-definition: don't delete the line, just remove the bit about the CSS file, so you'd end up with this line:

*main page[ResourceLoader|default]|main page.js

Because you still want the JavaScript to run, but don't have the CSS file anymore. Other than that, you did everything correctly. Hope this helps!

 – Nguyễn Xuân Minh (thảo luận, đóng góp) 06:05, ngày 28 tháng 1 năm 2012 (UTC)[trả lời]

Once again, you need to redo the following two steps:

  1. In Gadget-main page.js, delete the second function, "Di chuyển hộp tìm kiếm...". (You probably don't need the first one, either.)
  2. Replace rnnamespace=0 with rnnamespace=4 in Gadget-main page.js (since 4 is the Wikipedia: namespace's ID).

You did this right before but reverted the changes. As long as you don't touch anything else, the random Wikipedia: pages will show up correctly. :^)

 – Nguyễn Xuân Minh (thảo luận, đóng góp) 04:24, ngày 29 tháng 1 năm 2012 (UTC)[trả lời]