fantasti.cc image loader

Shows images instead of thumbnails on fantasti.cc

当前为 2015-04-19 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name           fantasti.cc image loader
// @namespace      https://greasyfork.org/users/5174-jesuis-parapluie
// @author         jesuis-parapluie
// @description	   Shows images instead of thumbnails on fantasti.cc
//
// @include        http://fantasti.cc/images/*
//
// @require        http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
//
// @version		   0.0.4
// @grant          none
// ==/UserScript==

var autoLoadImages = false;

function loadImgs()
{
    var xx = $("div.HoldPhotos a img.collection_image").parent();
    var a = $("<div>")
    for (i=0; i < xx.length; i++) {
        $.get($(xx[i]).attr("href"), function( data ) {
            $($(data).find("div.s").find("img")[1]).appendTo(a);
        });
     $("div#loop").last().html($("<div id='loop'><br></div>"));
     $("div#loop").last().append(a);
     $("div#loadImgs").text("Show Thumbnails").click(loadThumbs);
    }
}


function loadThumbs()
{
    $("div#loop").html(thumbs);
    $("div#loadImgs").text("Show Images").click(loadImgs);
}

var thumbs;
$(function ()
{
    thumbs = $("div#loop").html();
    var l = $('<div>', {id: 'loadImgs', style: 'margin-left: 110px;text-decoration: underline;color:#f00;cursor:pointer;font-weight: bolder;', text: 'Show Images'}).click(loadImgs);
    l.insertAfter($(".search_result_cams_2"));


    $(document).bind('DOMNodeInserted', function(e)
    {
        if ((e.target.tagName === 'DIV') && (e.target.getAttribute('id') && e.target.getAttribute('id').indexOf('content') !== -1) && ($("div#loadImgs").text().indexOf("Show Thumbnails") !== 1))
            loadImgs();
    });

    if (autoLoadImages)
        loadImgs();
});