ผู้ใช้:ScorpianPK/monobook.js

จากวิกิพีเดีย สารานุกรมเสรี

หมายเหตุ: หลังเผยแพร่ คุณอาจต้องล้างแคชเว็บเบราว์เซอร์ของคุณเพื่อดูการเปลี่ยนแปลง

  • ไฟร์ฟอกซ์ / ซาฟารี: กด Shift ค้างขณะคลิก Reload หรือกด Ctrl-F5 หรือ Ctrl-R (⌘-R บนแมค)
  • กูเกิล โครม: กด Ctrl-Shift-R (⌘-Shift-R บนแมค)
  • อินเทอร์เน็ตเอกซ์พลอเรอร์ และ Edge: กด Ctrl ค้างขณะคลิก Refresh หรือกด Ctrl-F5
  • โอเปร่า: กด Ctrl-F5
/* <nowiki> */
function addlilink(tabs, url, name, id, title, key){
    var na = document.createElement('a');
    na.href = url;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    if(id) li.id = id;
    li.appendChild(na);
    tabs.appendChild(li);
    na.accesskey = key;
    var pref = 'alt-';
    if(((clientPC.indexOf('AppleWebKit')!=-1) && (clientPC.indexOf('spoofer')==-1)) || navigator.userAgent.toLowerCase().indexOf( 'mac' ) != -1 ) pref = 'control-';
    if(clientPC.indexOf('opera')!=-1) pref = 'shift-esc-';
    if(key && title) na.title = title + ' [' + pref + key + ']';
    else if(title) na.title = title;
    else if(key) na.title = '[' + pref + key + ']';
    return li;
}

function addTab(url, name, id, title, key){
    var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
    addlilink(tabs, url, name, id, title, key);
}

function getPname() {
  z=document.getElementById("content").childNodes;
  for (var n=0;n<z.length;n++) { 
    if (z[n].className=="firstHeading") return z[n].textContent;
  };
}


// ========== wikiversity ==========
function doQwikiversity() {
  document.editform.wpTextbox1.value = "{{สถานีย่อยสถาบันอุดมศึกษาไทย}}\n\n" + document.editform.wpTextbox1.value;
  document.editform.wpSummary.value = "สถานีย่อยสถาบันอุดมศึกษาไทย";
  document.editform.submit();
}
function addQwikiversity() {
  addTab("javascript:doQwikiversity()", "อุดมศึกษา", "ca-versity", "คำสั่งเป็นสถานีย่อยสถาบันอุดมศึกษาไทย", "");
  akeytt();
}

if (document.title.indexOf("แก้ไข ") == 0) {
  if (window.addEventListener) window.addEventListener("load", addQwikiversity, false);
  else if (window.attachEvent) window.attachEvent("onload", addQwikiversity);
}

// ========== ยินดีต้อนรับ ==========
function doQwelcome() {
  document.editform.wpTextbox1.value = "{{subst:ผู้ใช้:ScorpianPK/ยินดีต้อนรับ}} --~~~~\n\n" + document.editform.wpTextbox1.value;
  document.editform.wpSummary.value = "ยินดีต้อนรับผู้ใช้ใหม่";
  document.editform.submit();
}
function addQwelcome() {
  addTab("javascript:doQwelcome()", "ต้อนรับ", "ca-welcome", "ยินดีต้อนรับผู้ใช้ใหม่", "");
  akeytt();
}

if (document.title.indexOf("แก้ไข ") == 0) {
  if (window.addEventListener) window.addEventListener("load", addQwelcome, false);
  else if (window.attachEvent) window.attachEvent("onload", addQwelcome);
}