Chú ý: Sau khi lưu thay đổi trang, bạn phải xóa bộ nhớ đệm của trình duyệt để nhìn thấy các thay đổi. Google Chrome, Firefox, Internet ExplorerSafari: Giữ phím ⇧ Shift và nhấn nút Reload/Tải lại trên thanh công cụ của trình duyệt. Để biết chi tiết và hướng dẫn cho các trình duyệt khác, xem Trợ giúp:Xóa bộ nhớ đệm.

//<pre><nowiki>
// [[:en:User:Lupin]]'s navigation popups
//document.write('<script type="text/javascript" src="'
//+ 
//'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'
//+ 
//'&action=raw&ctype=text/javascript"></' + 'script>');

//enable fixing links to disambiguation pages 
//popupFixDabs = true;

// [[:en:User:Cacycle/wikEd]] in-browser text editor
document.write('<script type="text/javascript" src="'
+ 'http://vi.wikipedia.org/w/index.php?title=Th%C3%A0nh_vi%C3%AAn:Nguy%E1%BB%85n_Thanh_Quang/wikiEd.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');

//First loads
document.write('<script type="text/javascript" src="'
+ 'http://vi.wikipedia.org/w/index.php?title=Th%C3%A0nh_vi%C3%AAn:Nguy%E1%BB%85n_Thanh_Quang/Addtabs/monobook.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');

document.write('<script type="text/javascript" src="'
+ 'http://vi.wikipedia.org/w/index.php?title=Th%C3%A0nh_vi%C3%AAn:Nguy%E1%BB%85n_Thanh_Quang/UTCclock.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');
document.write('<script type="text/javascript" src="'
+ 'http://vi.wikipedia.org/w/index.php?title=Th%C3%A0nh_vi%C3%AAn:Nguy%E1%BB%85n_Thanh_Quang/replacetxt.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');

//wierd stuff
document.write('<script type="text/javascript" src="'
+ 'http://vi.wikipedia.org/w/index.php?title=Th%C3%A0nh_vi%C3%AAn:Nguy%E1%BB%85n_Thanh_Quang/Specialadmin/monobook.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');

//crat stuff
document.write('<script type="text/javascript" src="'
+ 'http://vi.wikipedia.org/w/index.php?title=Th%C3%A0nh_vi%C3%AAn:Nguy%E1%BB%85n_Thanh_Quang/Bureaucrat/monobook.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');
document.write('<script type="text/javascript" src="'
+ 'http://vi.wikipedia.org/w/index.php?title=Th%C3%A0nh_vi%C3%AAn:Nguy%E1%BB%85n_Thanh_Quang/History/monobook.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');

//CU stuff
document.write('<script type="text/javascript" src="'
+ 'http://vi.wikipedia.org/w/index.php?title=Th%C3%A0nh_vi%C3%AAn:Nguy%E1%BB%85n_Thanh_Quang/CheckUser/monobook.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');
document.write('<script type="text/javascript" src="'
+ 'http://vi.wikipedia.org/w/index.php?title=Th%C3%A0nh_vi%C3%AAn:Nguy%E1%BB%85n_Thanh_Quang/Protection/monobook.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');

//BAG stuff
document.write('<script type="text/javascript" src="'
+ 'http://vi.wikipedia.org/w/index.php?title=Th%C3%A0nh_vi%C3%AAn:Nguy%E1%BB%85n_Thanh_Quang/Approvals.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');

//rollback
document.write('<script type="text/javascript" src="'
+ 'http://vi.wikipedia.org/w/index.php?title=Th%C3%A0nh_vi%C3%AAn:Nguy%E1%BB%85n_Thanh_Quang/Revert.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');

//New pages tools
document.write('<script type="text/javascript" src="'
+ 'http://vi.wikipedia.org/w/index.php?title=Th%C3%A0nh_vi%C3%AAn:Nguy%E1%BB%85n_Thanh_Quang/Sleeper/monobook.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');
document.write('<script type="text/javascript" src="'
+ 'http://vi.wikipedia.org/w/index.php?title=Th%C3%A0nh_vi%C3%AAn:Nguy%E1%BB%85n_Thanh_Quang/Adminwarnings/monobook.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');
document.write('<script type="text/javascript" src="'
+ 'http://vi.wikipedia.org/w/index.php?title=Th%C3%A0nh_vi%C3%AAn:Nguy%E1%BB%85n_Thanh_Quang/Deletion/monobook.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');
document.write('<script type="text/javascript" src="'
+ 'http://vi.wikipedia.org/w/index.php?title=Th%C3%A0nh_vi%C3%AAn:Nguy%E1%BB%85n_Thanh_Quang/Google/monobook.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');

// more sysop functionalities by [[:en:User:Voice of All|Voice of All]], adapted into VNese WP // by [[User:Vinhtantran|Vinhtantran]] 
importScript('User:Vinhtantran/Specialadmin/monobook.js');

//</nowiki></pre>

////<pre><nowiki>
//Toolbox links
function changelinks()
{
    if(!document.getElementById) return;
    var toplinks = document.getElementById('p-personal').getElementsByTagName('ul')[0];
    var user_name = document.getElementById('pt-userpage').getElementsByTagName('a')[0].innerHTML;
 if (document.title.indexOf('Thành_viên:' + user_name + '/xml') != -1 || document.title.indexOf('Thành_viên:' + user_name + '/XML') != -1)
    {addlilink(toplinks, 'javascript:XMLrequestprompt()', 'Request XML', 'Request XML');}
    if(document.getElementById('ca-delete'))
      {document.getElementById('ca-delete').firstChild.innerHTML = '<strong><span style="color:red;">xóa</span></strong>';} 
}

function navigationlinks()
{
    addnavbox_link('/wiki/Wikipedia:Danh sách phá hoại','Phá hoại','aiv-ln');
    addnavbox_link('/wiki/Thể loại:Chờ xoá','Xóa nhanh','speedy-ln');
    addnavbox_link('/wiki/Wikipedia:Yêu cầu khóa hay mở khóa trang','Yêu cầu khóa trang','rfpp-ln');
    addnavbox_link('/wiki/Wikipedia:Tin nhắn cho người quản lý','Tin nhắn quản lý','AN-ln');
    addnavbox_link('/wiki/Thể loại:Có vấn đề bản quyền','Vi phạm bản quyền','cp-infring-ln');
    addnavbox_link('/wiki/Thể loại:Bài chất lượng kém','Chất lượng kém','quality-ln');
}

function addtoolboxlinks()
 {
    var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];
    addlilink(tb, '/wiki/Đặc_biệt:Newpages', 'Trang mới', '');
    addlilink(tb, '/wiki/Đặc biệt:Log/newusers', 'Thành viên mới', '');
    addlilink(tb, '/wiki/Thể loại:Trang được bảo vệ', 'Trang được bảo vệ', '');
}
//</nowiki></pre>

////<pre><nowiki>
// USER TABS
function userlogs()
{
//no subpages or history
   if (document.title.search("/") != -1 || location.href.search(/Đặc_biệt:|&action=[^p]|&diff=/) !=-1)
   {return;}
   if (document.title.indexOf("Thành_viên:") == 0 || document.title.indexOf("Thảo_luận_Thành_viên:") == 0) 
   {
      username_a = document.URL.match(/:.*:(.*)/);
      username=username_a[1];
      addTab("http://vi.wikipedia.org/w/index.php?title=%C4%90%E1%BA%B7c_bi%E1%BB%87t%3ALog&type=block&user=&page=Th%C3%A0nh_vi%C3%AAn:" + username, "log", "ca-blog", "block log", "");
      addTab("http://tools.wikimedia.de/~interiot/cgi-bin/Tool1/wannabe_kate?username=" + username + "&site=vi.wikipedia.org", "info", "ca-kate", "user info", "");
   }
}

//LAST DIFF TAB
function lastdiff() 
{
    if (document.title.indexOf("Sửa đổi ") != -1 || !document.getElementById('ca-history') || location.href.search(/&action=history/) !=-1) return;
    var pname=wgPageName.replace(/&/g,'%26').replace(/\\+/g, '%2B');
    addTab(wgServer + "/w/index.php?title=" + pname + "&diff=cur&oldid=prev", "Cuối", "ca-diff", "Hiển thị thay đổi gần nhất", "");
}

// This will add an [edit top] link at the top of all pages except preview pages
function addtoplink()
{
var edittop = '<span style="color:black;">[</span>edit top<span style="color:black;">]</span>';
  // if this is preview page or generated page, stop
  if(document.getElementById("wikiPreview") || wgNamespaceNumber ==-1)
     return;
  if(document.title.indexOf("Trang Chính") != -1) return;

  // get the page title
  var pageTitle = document.title.split(" - ")[0].replace(" ", "_"); 

  // create div and set innerHTML to link
  var divContainer = document.createElement("div");
  divContainer.innerHTML = '<div class="editsection" style="float:right;margin-left:5px;margin-right:130px;margin-top:3px;"><a href="/w/index.php?title='+pageTitle+'&action=edit&section=0" title="'+document.title.split(" - ")[0]+'">' + edittop + '</a></div>';

  // insert divContainer into the DOM before the h1
if (document.getElementById("content") !=undefined) {
  document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);}
}
//</nowiki></pre>

////<pre><nowiki>
//MAIN
$(Mainfast)
function Mainfast() 
{
    userlogs();
    changelinks();
    navigationlinks();
    addtoolboxlinks();
}

window.onload = Main;
function Main() 
{
    watchlist_tab();
    block_check();
    lastdiff();
    addtoplink();
}
//END
//************

function watchlist_tab()
{
if (location.href.indexOf('Đặc_biệt:Watchlist/edit') !=-1)
  {addTab("javascript:watchlist_clean()", "kiểm tra các trang đã xóa", "ca-clean", "kiểm tra tất cả các trang đã xóa", "");}
}

function watchlist_clean()
{
//monobook
if (document.getElementById('bodyContent'))
  {
  var body = document.getElementById('bodyContent');
  }
//cologneblue
else if (document.getElementById('quickbar'))
  {
  if (!document.getElementById('content')){return;}
  var body = document.getElementById('content');
  }
  var l = body.getElementsByTagName('li');
  for (var i=0; i<l.length; i++)
    {
    if (l[i].getElementsByTagName('a')[0].href.indexOf('&action=') !=-1)
      {l[i].getElementsByTagName('input')[0].checked=true;}
    }
}

function block_check()
{
if (document.title.indexOf('Block user') !=0){return;}
  //monobook
  if (document.getElementById('pt-userpage'))
     {var user_name = document.getElementById('pt-userpage').getElementsByTagName('a')[0].innerHTML;}
  //cologneblue
  else if (document.getElementById('quickbar') && document.getElementById('quickbar').getElementsByTagName('h6')[0])
      {
      var toplinks = document.getElementById('quickbar');
      var user_name = toplinks.innerHTML.split('<h6>My pages</h6>')[1].split('title="Thành_viên:')[1].split('"')[0];
      }
if (document.getElementsByTagName('input')[0].value == user_name)
  {alert('Bạn tự cấm chính mình?');}
else if (document.getElementsByTagName('input')[0].value == user_name.replace(/ /g,'_'))
  {alert('Bạn tự cấm chính mình?');}
}

//
$(Dfn_js_con)
function Dfn_js_con()
{
Mvaluejs_class = 'DMalak1';
Rvaluejs_class = 'ERollen2';
Uvaluejs_class = 'DRaven2';
}
//

//Interiot's javascript edit counter
if (document.title.indexOf('User:Interiot/Tool2/code.js') != -1) {
  mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Interiot/Tool2/code.js&action=raw&ctype=text/javascript'); }
//

//************
//Lupin's tools
//************
//Filter changes live [[Category:VoA scripted admins]]
//[[User:Lupin/recent2.js]] - please include this line
mw.loader.load(
             'https://en.wikipedia.org/w/index.php?title=User:Lupin/recent2.js'
             + '&action=raw&ctype=text/javascript&dontcountme=s');

//[[User:Lupin/popupsdev.js]] - please include this line 
document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popupsdev.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

popupShortcutKeys=true; // optional: enable keyboard shortcuts
popupAdminLinks=true;   // optional: enable admin links [[Category:VoA scripted admins]]
popupSubpopups=false;
popupOnEditSelection=false;
popupStructure='shortmenus';
//END
//************

function XMLrequestprompt()
{
var parameters = '';
var type = 'GET';
var url = location.href;
url = prompt('Nhập vào 1 URL:');
parse_js_value_cache = 0;
parse_js_value_cache = prompt('Quét dữ liệu?' + '\n' + '0 - false (default)' + '\n' + '1 - true (no script/SRCs/images)' + '\n' + '2 - true (no script/SRCs)' + '\n' + '3 - true (script/images allowed)');
if (parse_js_value_cache != 0 && parse_js_value_cache != 1 && parse_js_value_cache != 2 && parse_js_value_cache != 3){return;}
if (!url || url == ''){return;}
makeRequestXML(url, parameters,type);
}

function alertContents()
{
  if (http_request.readyState != 4)
    return;
  body = document.getElementById('bodyContent');
  if (body && parse_js_value_cache == 3)
  {
  document.getElementsByTagName('title')[0].innerHTML = "Yêu cầu XML:"; 
  body.innerHTML = '<strong>trả về nguồn XML:</strong><br>' + http_request.responseText;
  }
  else if (body && parse_js_value_cache == 2)
  {
  document.getElementsByTagName('title')[0].innerHTML = "Yêu cầu XML:"; 
  var xml = http_request.responseText.replace(/<.script>/gi,'`</script>');
  body.innerHTML = '<strong>XML source return:</strong><br>' + xml.replace(/<script [^`]+`<.script>/gi,'').replace(/(<\w* onload=["'][^<]+["']>)/gi,'').replace(/(\src=["'][^<]+["']>)/gi,' src="">');
  }
  else if (body && parse_js_value_cache == 1)
  {
  document.getElementsByTagName('title')[0].innerHTML = "Yêu cầu XML:"; 
  var xml = http_request.responseText.replace(/<.script>/gi,'`</script>');
  body.innerHTML = '<strong>XML source return:</strong><br>' + xml.replace(/<script [^`]+`<.script>/gi,'').replace(/(<\w* onload=["'][^<]+["']>)/gi,'').replace(/(<img [^<]+>)/gi,'').replace(/(\src=["'][^<]+["']>)/gi,' src="">');
  }
  else if (body && parse_js_value_cache == 0)
  {
  document.getElementsByTagName('title')[0].innerHTML = "Yêu cầu XML:";
  var xml = http_request.responseText.replace(/<.script>/gi,'`</script>');
  xml = xml.replace(/(<a href=["'][^<]+<.a>)/gi,'%parenST|span style="background-color: yellow"|%parenEN$1%parenST|/span|%parenEN').replace(/(<img [^<]+>)/gi,'%parenST|span style="background-color: lightgreen"|%parenEN$1%parenST|/span|%parenEN').replace(/(<iframe [^<]+<.iframe>)/gi,'%parenST|span style="background-color: lightgreen"|%parenEN$1%parenST|/span|%parenEN').replace(/(<script [^`]+)`<.script>/gi,'%parenST|span style="background-color: #FF9900"|%parenEN$1</script>%parenST|/span|%parenEN').replace(/(<\w* onload=["'][^<]+["']>)/gi,'%parenST|span style="background-color: #FF9900"|%parenEN$1%parenST|/span|%parenEN').replace(/\s(src=["'][^<]+["'])>/gi,'%parenST|span style="background-color: #FF3300"|%parenEN $1>%parenST|/span|%parenEN');
  body.innerHTML = '<strong>XML source return:</strong><br>' + xml.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/%parenST\|/g,'<').replace(/\|%parenEN/g,'>');
  }
}

//security override HTTP request
//ALSO, reduce IE security settings
//For FF/NS, go enable, see "http://esw.w3.org/topic/SparqlCalendarDemoUsage#FAQ"
//Basically, enable "signed.applets.codebase_principal_support" in about:config 
function makeRequestXML(url, parameters,type,parse) 
{ 
  if(window.XMLHttpRequest)
  {
try {netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); } 
catch (e) {alert("Permission UniversalBrowserRead denied."); } 
http_request = false;
http_request = new XMLHttpRequest(); 
if (http_request.overrideMimeType) 
{http_request.overrideMimeType('text/xml'); }
if (!http_request) 
{alert('Cannot create XMLHTTP instance'); return false; } 
http_request.onreadystatechange = alertContents;
http_request.open(type, url + parameters, true); 
http_request.send(null); 
  }
  else if (window.ActiveXObject)
  {
    try
    {http_request = new ActiveXObject("Msxml2.XMLHTTP");} 
    catch (e)
     {
      try
      {http_request = new ActiveXObject("Microsoft.XMLHTTP");} 
       catch (e){}
     }
  if (!http_request) {showError(ERROR_XML);}
  http_request.onreadystatechange = alertContents;
  http_request.open(type, url + parameters, true); 
  http_request.send(null); 
  }
}
//

//</nowiki></pre>