User:Vinhtantran/modern.js

From translatewiki.net

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
//<pre><nowiki>
//************************* wikiEd editor ****************************************
//install [[User:Cacycle/wikEd]] in-browser text editor
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');
 
//install the Vietnamese translation for [[:en:User:Cacycle/wikEd]]
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Vinhtantran/wikEd_international_vi.js'
+ '&action=raw&ctype=text/javascript"></script>');
//***********************************************************************************

/* 


==[[Wikipedia:Gõ tiếng Việt|Bộ gõ tiếng Việt]]==
{{Chính|MediaWiki:Him.js}}
*/
 
document.write('<script type="text/javascript" src="http://vi.wikipedia.org/w/index.php?title=MediaWiki:him.js&amp;action=raw&amp;ctype=text/javascript&amp;dontcountme=s"></script>');
var radio = true, runHIM = true; 
function HIM()
{
if (runHIM)
{
elCC = document.getElementById('p-tb');
if (elCC != null) 
{
if (radio)
{
HIMHTML = '<div class="portlet"><h5><a href="http://vi.wikipedia.org/wiki/Wikipedia:Gõ_tiếng_Việt" title="Wikipedia:Gõ tiếng Việt">Gõ tiếng Việt</a></h5><div class="pBody">';
HIMHTML += '<input id="him_auto" name="viet_method" type="radio" onclick="setMethod(0);"' + (method == 0 && on_off==1?'CHECKED':'') + '/>&nbsp;<label class="radio" for="him_auto">Tự động</label> <small>[F9]</small><br />';
HIMHTML += '<input id="him_telex" name="viet_method" type="radio" onclick="setMethod(1);"' + (method == 1 && on_off==1?'CHECKED':'') + ' />&nbsp;<label class="radio" for="him_telex">Telex</label> <a href="http://vi.wikipedia.org/wiki/Telex#Quy_.C6.B0.E1.BB.9Bc_telex" title="Telex#Quy ước telex" style="font-size: smaller">(?)</a><br />';
HIMHTML += '<input id="him_vni" name="viet_method" type="radio" onclick="setMethod(2);"' + (method == 2 && on_off==1?'CHECKED':'') + ' />&nbsp;<label class="radio" for="him_vni">VNI</label> <a href="http://vi.wikipedia.org/wiki/VNI#Quy_.C6.B0.E1.BB.9Bc" title="VNI#Quy ước" style="font-size: smaller">(?)</a><br />';
HIMHTML += '<input id="him_viqr" name="viet_method" type="radio" onclick="setMethod(3);"' + (method == 3 && on_off==1?'CHECKED':'') + ' />&nbsp;<label class="radio" for="him_viqr">VIQR</label> <a href="http://vi.wikipedia.org/wiki/VIQR" title="VIQR" style="font-size: smaller">(?)</a><br />';
HIMHTML += '<input id="him_viqr2" name="viet_method" type="radio" onclick="setMethod(4);"' + (method == 4 && on_off==1?'CHECKED':'') + ' />&nbsp;<label class="radio" for="him_viqr2">VIQR*</label><br />';
HIMHTML += '<input id="him_off" name="viet_method" type="radio" onclick="setMethod(-1);"' + (on_off==0?'CHECKED':'') + ' />&nbsp;<label class="radio" for="him_off">Tắt</label> <small>[F12]</small><hr />';
HIMHTML += '<input id="him_daucu" name="viet_method" type="checkbox" onclick="setDauCu(this);"' + (dauCu == 1?'CHECKED':'') + ' />&nbsp;<label  class="radio" for="him_daucu">Bỏ dấu kiểu cũ</label> <small>[F7]</small><br />';
HIMHTML += '<input id="him_ckspell" name="viet_method" type="checkbox" onclick="setSpell(this);"' + (dockspell == 1?'CHECKED':'') + ' />&nbsp;<label class="radio" for="him_ckspell">Đúng chính tả</label> <small>[F8]</small></div></div>';
elCC.innerHTML = HIMHTML + elCC.innerHTML;
}
if(useCookie==1) { setCookie=doSetCookie; getCookie=doGetCookie }
else { setCookie=noCookie; getCookie=noCookie }
setCookie();
if(support) statusMessage();
runHIM = false;
}
else
{
setTimeout("HIM()", 20);
}
}
return true;
}
HIM();
function stopHIM()
{   
HIM();
if (runHIM) 
{
if(useCookie==1) { setCookie=doSetCookie; getCookie=doGetCookie }
else { setCookie=noCookie; getCookie=noCookie }
setCookie();
if(support) statusMessage();
runHIM=false;
}
}
 
addOnloadHook(stopHIM);
 
/* Remove Vietnamese character pallete on edit screens if HIM is enabled - from [[Thành viên:Tttrung/thim.js]] and [[Thành viên:Ttrung/monobook.js]] */
function RemoveVietPallete() {
var pallete = document.getElementById("editpage-specialchars-viet");
var ime = document.getElementById("");
if (pallete && on_off == 1) pallete.innerHTML = "";
}
addOnloadHook(RemoveVietPallete);