KG - move details

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

当前为 2014-05-10 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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);
}