bbs archiver to thread

从搜索引擎搜索到discuz的页面,有时默认是一个简化版本(见Description部分的栗子表)。使用这个js之后,左上方悬浮一个‘完整版本’链接。可以通过设置var autoload=1,打开页面时自动打开完整版本(支持phpwind和discuz)

As of 2017-05-30. See the latest version.

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 or Violentmonkey 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        bbs archiver to thread
// @namespace   http://userscripts.org/users/tumuyan
// @include     http://*archiver/tid*
// @include     http:*/simple/*
// @version     2.3
// @description 从搜索引擎搜索到discuz的页面,有时默认是一个简化版本(见Description部分的栗子表)。使用这个js之后,左上方悬浮一个‘完整版本’链接。可以通过设置var autoload=1,打开页面时自动打开完整版本(支持phpwind和discuz)
// ==/UserScript==


var autoload=0

if (document.getElementById("end")){
    var endbot=document.getElementById("end").getElementsByTagName("a")
        if (endbot[0].href.match(/thread.{0,30}html/)) 
            add(endbot[0])
}
else if(document.getElementsByTagName("center"))
{ 
    var elepb85=document.getElementsByTagName("center")
      
    for (var i=elepb85.length-1;i>-1;i--)
    {
        var titlebot=elepb85[i].getElementsByTagName("b") 
            if ( titlebot[0].innerHTML.match(/^\s*查看完整版本.*/) )
             {
                 var endbot=titlebot[0].getElementsByTagName("a")  
				 add(endbot[0])
                 exit
               }  
    }

}
 

    
function add(endbot)
    
{   endbot.id="fulltextbot"
	endbot.innerHTML="完整版本" 
    if (autoload)
      endbot.click()
	  
var cssbot = document.createElement("style");
    cssbot.type="text/css";
    cssbot.innerHTML = ' a#fulltextbot {color:#336 !important;  position:fixed !important;display:block !important;  padding:4px !important;border-radius:0px 12px 12px 0px;  width:16px !important;max-height:120px !important;overflow:hidden !important;  top:40px;left:-2px;font-size: 12px !important;line-height: 30px !important;  background:#eed !important;box-shadow:5px 3px 6px #bbb  ;-o-transition: .3s ease-in;-moz-transition: .3s ease-in;-webkit-transition: .3s ease-in;}      a#fulltextbot:hover    {background:#fdd !important;box-shadow:4px 4px 5px #bcd;  -o-transition: .3s ease-in;-moz-transition: .3s ease-in;-webkit-transition: .3s ease-in;} ';
    document.head.appendChild(cssbot);   
}