KG - move details

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

目前為 2014-05-10 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        KG - move details
// @description splits the long torrent details table into two side-by-side boxes
// @namespace   KG
// @include     http*://*karagarga.net/details.php?*
// @exclude	http*://forum.karagarga.net/*
// @grant	none
// @version     1.5
// ==/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);
}