_ _    _ _____  ___   __                       
 __      _(_) | _(_)___ / ( _ ) / /_   ___ ___  _ __ ___  
 \ \ /\ / / | |/ / | |_ \ / _ \| '_ \ / __/ _ \| '_ ` _ \ 
  \ V  V /| |   <| |___) | (_) | (_) | (_| (_) | | | | | |
   \_/\_/ |_|_|\_\_|____/ \___/ \___(_)___\___/|_| |_| |_|

User:Iceblock/prefixindexonecolumn.js

This time we will delve into the fascinating world of User:Iceblock/prefixindexonecolumn.js, a topic that has captured the attention of people of all ages and cultures. Since time immemorial, User:Iceblock/prefixindexonecolumn.js has been a source of study, debate and reflection, being a topic that arouses passions and arouses the curiosity of those who wish to know more about it. In this article we will explore the different aspects related to User:Iceblock/prefixindexonecolumn.js, from its origin to its implications in today's society. Join us on this journey of discovery and learning about User:Iceblock/prefixindexonecolumn.js.
/*
 * This script adds a tab to Special:Prefixindex and Special:Allpages
 * to reformat the list into one column. It also adds a tab to create
 * a numbered list.
 *
 * Made by ]
 */

function reorganizePrefixIndexTable() {
  var listTable = document.getElementById('mw-prefixindex-list-table');
  if (!listTable)
    var listTable = document.getElementsByClassName('mw-allpages-table-chunk');
  if (!listTable)
    return;
  var tableRows = listTable.children.children;
  var len = tableRows.length;
  for (x = 0; x < len; x++) {
    var tableRows = listTable.children.children;
    var len2 = tableRows.children.length;
    for (y = 0; y < len2; y++) {
       var trNode = document.createElement('tr');
       var tdNode = document.createElement('td');
       tdNode.innerHTML = tableRows.children.innerHTML;
       trNode.appendChild(tdNode);
       listTable.children.appendChild(trNode);
    }
    listTable.children.removeChild(tableRows);
  }  
}
function makeNumberedPrefixIndexTable() {
  var listTable = document.getElementById('mw-prefixindex-list-table');
  if (!listTable)
    var listTable = document.getElementsByClassName('mw-allpages-table-chunk');
  if (!listTable)
    return;
  var tableRows = listTable.children.children;
  var len = tableRows.length;
  if (/\<li\>/i.test(tableRows.innerHTML))
    return;
  var trNode = document.createElement('tr');
  var tdNode = document.createElement('td');
  var olNode = document.createElement('ol');
  tdNode.appendChild(olNode);
  trNode.appendChild(tdNode);
  listTable.children.appendChild(trNode);

  for (x = 0; x < len; x++) {
    var tableRows = listTable.children.children;
    var len2 = tableRows.children.length;
    for (y = 0; y < len2; y++) {
       var liNode = document.createElement('li');
       liNode.innerHTML = tableRows.children.innerHTML;
       olNode.appendChild(liNode);
    }
    listTable.children.removeChild(tableRows);
  }  
}

$ ( function () {
  if (wgCanonicalSpecialPageName == 'Prefixindex' || wgCanonicalSpecialPageName == 'Allpages') {
    mw.util.addPortletLink('p-cactions', 'javascript:reorganizePrefixIndexTable();', '1 column', null, 'Change the results list into one column');
    mw.util.addPortletLink('p-cactions', 'javascript:makeNumberedPrefixIndexTable();', 'Numbered list', null, 'Change the results list into a numbered list');
  }
} );