T-Rex Family Forum script

Modify display of Forum pages.

当前为 2015-06-30 提交的版本,查看 最新版本

// ==UserScript==
// @namespace           http://t-rex-club-forum.soforums.com
// @grant               GM_xmlhttpRequest
// @grant               GM_deleteValue
// @grant               GM_getValue
// @grant               GM_listValues
// @grant               GM_setValue
// @version             20150630.02
//
// @name                T-Rex Family Forum script
// @description         Modify display of Forum pages.
// @include             http://t-rex-club-forum.soforums.com/*
// ==/UserScript==
//------------------------------------------------------------------------------

console.log("Starting T-Rex Family Forum script from:", window.parent.location);

function run() {
    //console.log("Run() ...");

    // jQuery loading
    function addJQuery(callback) {
        var script = document.createElement("script");
        script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js");
        script.addEventListener('load', function() {
            var script = document.createElement("script");
            script.textContent = "window.JQ=jQuery.noConflict(true);(" + callback.toString() + ")();";
            document.body.appendChild(script);
        }, false);
        document.body.appendChild(script);
    }

    // Do Main modifications !!!
    function main() {
        
        //console.log('*** Remove Text signatures')
        //JQ('[class=postbody]').remove();
        //-------------

        if ( JQ('.postdetails > img').length ) {
            console.log('*** Change Author profile image size')
            JQ('.postdetails > img').width('25%');
        }   //-------------

        if ( JQ('[class$=photo]').length ) {
            console.log('*** Reduce Author Avatar image size')
            JQ('[class$=photo]').height('50%').width('50%')
        }   //-------------

        if ( JQ('[title$=Zodiaque]').length ) {
            console.log('*** Remove Chinois, Zodiac, Sexe signs from Profile')
            JQ('[title$=Zodiaque]').remove();
            JQ('[title$=Sexe]').remove();
            JQ('[title$=Chinois]').remove();
        }   //-------------

        var TARGET = document.getElementById('wysiwyg_frame_1')
        if (TARGET) {
            console.log('*** Change Comment width to fit automatically page');
            TARGET.style.width = "90%";
        }   //-------------

        if ( JQ('#XOOITTOOLBARFRAME').length ) {
            console.log('*** Remove XOOIT toolbar')
            JQ('#XOOITTOOLBARFRAME').remove(); 
            JQ('#XOOITTOOLBARHELP').remove(); 
        }   //-------------

        console.log('*** Ads #1: Change BODY padding to 0px')
        document.body.style.padding = "0px";
        
        var TARGET2 = document.getElementById(document._tmpFrameIdX)
        if (TARGET2) {
            console.log(' ** Ads #2: Found DIV for %s :', document._tmpFrameIdX, TARGET2);
            TARGET2.style.display = "none";
            TARGET2.remove();
        }   //-------------
        
        if ( JQ('.postdetails:contains("Sujet du message")').length ) {
            console.log('*** Remove "Sujet" text line from comments & highlight Post date/time')
            JQ('.postdetails:contains("Sujet du message")').each( function(){
                JQ(this).css('font-weight', 'bold');
                JQ(this).css('color', 'red');
                JQ(this).html(JQ(this).html().replace(/Sujet du message.*-->/, '').replace(/Posté le:/,''));
            });        
        }   //-------------
        
        if ( JQ('.thLeft').length ) {
            console.log('*** Remove Comment TD Head text (Auteur / Message)')
            JQ('.thLeft').height('5');
            JQ('.thLeft').text('');
            JQ('.thRight').height('5');
            JQ('.thRight').text('');
            console.log('*** Reduce left column width from 150px to 130px (more comment text available)')
            JQ('.thLeft').width('130px');
        }   //-------------

        if ( JQ('.maintitle').length ) {
            console.log('*** Add Topic Title on top of page')
            var TITLE = JQ('.maintitle').text() 
            var TITLEURL = JQ('.maintitle').attr('href');
            JQ("body").append("<div id='TitleOverlay'></div>");

            JQ("#TitleOverlay")
            .css({
                'opacity': 0.9,
                'position': 'fixed',
                'top': 0,
                'left': 0,
                'background-color': 'darkgrey',
                'text-align': 'center',
                'width': '100%'})
            JQ("#TitleOverlay").text(TITLE);
            JQ("#TitleOverlay").prepend('[  ');
            JQ("#TitleOverlay").append( '  ] <img width=10% valign=center height=10% style="PADDING-LEFT: 30px; text-align:center;" src="http://i61.tinypic.com/t5je46.jpg" >');
            JQ("#TitleOverlay").addClass('maintitle');
        }   //-------------

    } // END MAIN

    // load jQuery and execute the main function
    console.time('MODIFICATION TIME')
    addJQuery(main); 
    console.timeEnd('MODIFICATION TIME')

};

//------------------------------------------------------------------------------
window.setTimeout(run, 500)
//------------------------------------------------------------------------------

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址