From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.

// <pre><nowiki>



/////////////////////////////////////////////////////////////////////////////////////////////////////////

// Tabs by Korath - (http://en.wikipedia.org/wiki/User:Korath)

/////////////////////////////////////////////////////////////////////////////////////////////////////////



function addlilink(url, name) {

  var na = document.createElement('a');

  na.setAttribute('href', url);

  var txt = document.createTextNode(name);

  na.appendChild(txt);

  var li = document.createElement('li');



  li.appendChild(na);

  return li;

}



// appends msg to the currently-edited page, sets the summary to summ,

// and marks or unmarks the Watch this page checkbox according to watch.

function edit_summary_watch(msg, summ, watch) {

  var f = document.editform, t = f.wpTextbox1;

  if (t.value.length > 0)

    t.value += '\n';

  t.value += msg;

  f.wpSummary.value = summ;

//  f.wpWatchthis.checked = watch;

}



// appends msg to the currently-editted page, sets the summary to summ,

// and marks or unmarks the Watch this page checkbox according to watch.

function add_del_tag(msg, summ, watch) {

  var f = document.editform, t = f.wpTextbox1;

    msg += '\n';

    msg += t.value;

    t.value = msg;

  f.wpSummary.value = summ;

//  f.wpWatchthis.checked = watch;

}

  

// adds various tabs to call the above

function add_tabs() {

  var c1 = document.getElementById('column-one');

  var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0];



  // Only add for pages with "Editing User talk:" somewhere in the title

  if (document.title.indexOf("Editing User talk:") != -1) {



      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:User:Cactus.man/Templates/Welcome}} -- ~" + "~" + "~" + "~", "{{" + "Welcome}}", true, 1)',"Wel"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:User:Cactus.man/Templates/WelcomeIP}} -- ~" + "~" + "~" + "~", "{{" + "WelcomeIP}}", true, 1)',"W-IP"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:User:Cactus.man/Templates/WelcomeIP2}} -- ~" + "~" + "~" + "~", "{{" + "WelcomeIP2}}", true, 1)',"W-IP2"));



      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Selftest}} -- ~" + "~" + "~" + "~", "{{" + "Selftest}}", true, 1)',"S-tst"));



      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-test1}} -- ~" + "~" + "~" + "~", "{{" + "Uw-test1}}", true, 1)',"T1"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-test2}} -- ~" + "~" + "~" + "~", "{{" + "Uw-test2}}", true, 1)',"T2"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-test3}} -- ~" + "~" + "~" + "~", "{{" + "Uw-test3}}", true, 1)',"T3"));



      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-vand1}} -- ~" + "~" + "~" + "~", "{{" + "Uw-vand1}}", true, 1)',"V1"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-vand2}} -- ~" + "~" + "~" + "~", "{{" + "Uw-vand2}}", true, 1)',"V2"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-vand3}} -- ~" + "~" + "~" + "~", "{{" + "Uw-vand3}}", true, 1)',"V3"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-vand4}} -- ~" + "~" + "~" + "~", "{{" + "Uw-vand4}}", true, 1)',"V4"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-vand4im}} -- ~" + "~" + "~" + "~", "{{" + "Uw-vand4im}}", true, 1)',"V5"));



      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:uw-delete1}} -- ~" + "~" + "~" + "~", "{{" + "uw-delete1}}", true, 1)',"D1"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:uw-delete2}} -- ~" + "~" + "~" + "~", "{{" + "uw-delete2}}", true, 1)',"D2"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:uw-delete3}} -- ~" + "~" + "~" + "~", "{{" + "uw-delete3}}", true, 1)',"D3"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:uw-delete4}} -- ~" + "~" + "~" + "~", "{{" + "uw-delete4}}", true, 1)',"D4"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:uw-delete4im}} -- ~" + "~" + "~" + "~", "{{" + "uw-delete4im}}", true, 1)',"D5"));



      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-upv1}} -- ~" + "~" + "~" + "~", "{{" + "Uw-upv1}}", true, 1)',"U1"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-upv2}} -- ~" + "~" + "~" + "~", "{{" + "Uw-upv2}}", true, 1)',"U2"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-upv3}} -- ~" + "~" + "~" + "~", "{{" + "Uw-upv3}}", true, 1)',"U3"));



      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-npa1}} -- ~" + "~" + "~" + "~", "{{" + "Uw-npa1}}", true, 1)',"Npa1"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-npa2}} -- ~" + "~" + "~" + "~", "{{" + "Uw-npa2}}", true, 1)',"Npa2"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-npa3}} -- ~" + "~" + "~" + "~", "{{" + "Uw-npa3}}", true, 1)',"Npa3"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-npa4}} -- ~" + "~" + "~" + "~", "{{" + "Uw-npa4}}", true, 1)',"Npa4"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-npa4im}} -- ~" + "~" + "~" + "~", "{{" + "Uw-npa4im}}", true, 1)',"Npa5"));



      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-block1}} -- ~" + "~" + "~" + "~", "{{" + "Uw-block1}}", true, 1)',"B1"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-ablock}} -- ~" + "~" + "~" + "~", "{{" + "Uw-ablock}}", true, 1)',"B-IP"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-block3}} -- ~" + "~" + "~" + "~", "{{" + "Uw-block3}}", true, 1)',"B5"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-vblock}} -- ~" + "~" + "~" + "~", "{{" + "Uw-vblock}}", true, 1)',"B-V"));

      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-3block}} -- ~" + "~" + "~" + "~", "{{" + "Uw-3block}}", true, 1)',"B3RR"));



      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:Uw-copyright}} -- ~" + "~" + "~" + "~", "{{" + "Uw-copyright}}", true, 1)',"CPVio"));

  }

}



if (window.addEventListener) window.addEventListener("load", add_tabs, false);

else if (window.attachEvent) window.attachEvent("onload", add_tabs);



// </nowiki></pre>