KG - move details

splits the long torrent details table into two side-by-side boxes

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        KG - move details
// @description splits the long torrent details table into two side-by-side boxes
// @namespace   KG
// @include     http*://*karagarga.in/details.php?*
// @exclude	http*://forum.karagarga.in/*
// @grant	none
// @version     1.6
// ==/UserScript==

var toMove = ["Language", "Subtitles", "Source", "Rip Specs", "Size", "Upped by", "Num files", "File list", "Added", "Snatched", "Peers", "Seeders", "Leechers", "Pots", "Visible", "Last\xA0seeder", "Filename"]

// don't run in iFrames
if (!window.frameElement) {

	// clear some anchor links as they'll jump to the wrong place	
    var links = document.links;
    for (i=0; i < links.length; i++) {
    	links[i].href = links[i].href.replace("#seeders", "");
    	links[i].href = links[i].href.replace("#filelist", "");
    	links[i].href = links[i].href.replace("#snatchers", "");
    }
    
    var headings = document.querySelectorAll(".heading");
    var wrapper = document.querySelector("table .outer");
    
    var newBox = document.createElement('Table');
    newBox.style.float = "right";
    newBox.style.marginTop = "10em";
    newBox.style.marginLeft = "0.5em";
    wrapper.parentNode.insertBefore(newBox, wrapper.nextSibling);
    
    newBox.parentNode.vAlign="top";
    
    for (i=0; i < headings.length; i++) {
            for (var h in toMove) {
                    if (headings[i].textContent.indexOf(toMove[h]) == 0) {
                            var row = headings[i].parentNode;
                            cloneItem(row, newBox);
                            row.innerHTML = '';
                    }
            }
    }
} // end iframe check


function cloneItem(item, target) {
   if (!item || !target) return;
  
   // clone the div
  item2 = item.cloneNode(true);

  // insert clone
  target.insertBefore(item2, target.nextSibling);
}