IP-Phone-Forum

Einige Anpassungen für den neuen Style

目前為 2017-10-17 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         IP-Phone-Forum
// @version      0.3
// @description  Einige Anpassungen für den neuen Style
// @author       rabe85
// @include      *ip-phone-forum.de/*
// @exclude      *ip-phone-forum.de/conversations/*
// @grant        none
// @namespace    https://greasyfork.org/users/156194
// ==/UserScript==

(function() {
    'use strict';

    var url_path = window.location.pathname;
    var url_array = url_path.split("/");
    var url_array_lenght = url_array.length - 1;
    var url_switch = url_array[url_array_lenght];


    // Reservierte Werbefläche ausblenden
    $('.funbox').remove();

    // Sidebar ausblenden (außer bei PNs / Unterhaltungen)
    $('.uix_mainSidebar').remove();

    // Posts breiter darstellen
    var ippf1 = document.getElementsByClassName('mainContainer');
    for(var a = 0; a < ippf1.length; a++) {
        ippf1[a].style.float = 'none';
        ippf1[a].style.width = 'auto';
    }

    // Abstand bei Signatur löschen
    var ippf2 = document.getElementsByClassName('signature');
    for(var b = 0; b < ippf2.length; b++) {
        ippf2[b].style.marginBottom = '0px';
        ippf2[b].style.paddingTop = '0px';
        ippf2[b].style.paddingBottom = '0px';
    }

    // Unterforen in der Übersicht schmaler darstellen
    var ippf3 = document.getElementsByClassName('nodeTitle');
    for(var c = 0; c < ippf3.length; c++) {
        ippf3[c].style.paddingTop = '1px';
        ippf3[c].style.paddingRight = '1px';
        ippf3[c].style.paddingBottom = '1px';
        ippf3[c].style.paddingLeft = '1px';
        ippf3[c].style.display = 'inline';
    }

    // Zitate breiter darstellen
    var ippf4 = document.getElementsByClassName('bbCodeBlock');
    for(var d = 0; d < ippf4.length; d++) {
        ippf4[d].style.marginTop = '1em';
        ippf4[d].style.marginRight = '0px';
        ippf4[d].style.marginBottom = '20px';
        ippf4[d].style.marginLeft = '0px';
    }

    // Abstand bei Zitaten schmaler darstellen - Titelzeile
    var ippf5 = document.getElementsByClassName('type');
    for(var e = 0; e < ippf5.length; e++) {
        ippf5[e].style.paddingTop = '1px';
        ippf5[e].style.paddingRight = '5px';
        ippf5[e].style.paddingBottom = '1px';
        ippf5[e].style.paddingLeft = '5px';
    }

    // Abstand bei Zitaten schmaler darstellen - Text
    var ippf6 = document.getElementsByClassName('quoteContainer');
    for(var f = 0; f < ippf6.length; f++) {
        ippf6[f].style.paddingTop = '5px';
        ippf6[f].style.paddingRight = '5px';
        ippf6[f].style.paddingBottom = '5px';
        ippf6[f].style.paddingLeft = '5px';
    }

    // Footer erweitern
    var ippf7 = document.getElementsByClassName('choosers');
    for(var g = 0; g < ippf7.length; g++) {
        ippf7[g].style.display = 'inline';
        ippf7[g].insertAdjacentHTML('afterbegin', '<dt>Style</dt><dd><a href="misc/style?redirect=%2F" class="OverlayTrigger Tooltip" rel="nofollow" style="">Xenith</a></dd>');
    }

    // Fehlende CSS laden
    var css_style = document.createElement("STYLE");
    var css_text = document.createTextNode(".xenOverlay #jumpMenu .jumpMenuColumn{float:left;width:50%}.xenOverlay #jumpMenu .blockLinksList{height:250px;overflow:auto}#jumpMenu .blockLinksList ul, #jumpMenu .nodeList li.d0{padding-top:5px;border-top:1px solid rgb(250, 250, 250);margin-top:5px}#jumpMenu .blockLinksList ul:first-child, #jumpMenu .nodeList li.d0:first-child{padding-top:0;border-top:none;margin-top:0}.xenOverlay #jumpMenu .nodeList{border-left:1px solid rgb(250, 250, 250)}#jumpMenu .blockLinksList li{vertical-align:bottom}@media (max-width:480px){.Responsive .xenOverlay #jumpMenu .jumpMenuColumn{float:none;width:auto}.Responsive .xenOverlay #jumpMenu .blockLinksList{max-height:250px;height:auto}}");
    css_style.appendChild(css_text);
    document.head.appendChild(css_style);

    if(url_array[1] == 'forums' && !url_array[2]) {
        // BreadBox anzeigen
        var ippf8 = document.getElementsByClassName('uix_contentFix');
        for(var h = 0; h < ippf8.length; h++) {
            ippf8[h].insertAdjacentHTML('beforebegin', '<div class="breadBoxTop" style="margin-top:25px; margin-right:0px; margin-bottom:25px; margin-left:0px;"><div class="topCtrl homeTopButton"><a href="find-new/posts?recent=1" class="callToAction" rel="nofollow"><span>Aktuelle Themen</span></a></div><div class="topCtrl homeTopButton findNewPostsButton"><a href="find-new/posts" class="callToAction" rel="nofollow"><span>Neue Beiträge</span></a></div><nav><fieldset class="breadcrumb" style=""><a href="misc/quick-navigation-menu" class="OverlayTrigger jumpMenuTrigger" data-cacheoverlay="true" title="Nützliche Links anzeigen"><i class="uix_icon uix_icon-sitemap"></i><!--Gehe zu...--></a><div class="boardTitle"><strong>IP-Phone-Forum</strong></div><span class="crumbs"><span class="crust homeCrumb" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.ip-phone-forum.de/forums/" class="crumb" rel="up" itemprop="url"><span itemprop="title"><i class="uix_icon uix_icon-home" title="Startseite"></i><span class="uix_breadcrumb__home__title">Startseite</span></span></a><span class="arrow"><i class="uix_icon uix_icon-breadcrumbSeparator"></i></span></span><span class="crust selectedTabCrumb" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://www.ip-phone-forum.de/forums/" class="crumb" rel="up" itemprop="url"><span itemprop="title">Foren</span></a><span class="arrow"><i class="uix_icon uix_icon-breadcrumbSeparator"></i></span></span></span></fieldset></nav></div>');
        }
    } else {
        // BreadBox erweitern
        var ippf9 = document.getElementsByClassName('breadBoxTop');
        for(var i = 0; i < ippf9.length; i++) {
            ippf9[i].insertAdjacentHTML('afterbegin', '<div class="topCtrl homeTopButton"><a href="find-new/posts?recent=1" class="callToAction" rel="nofollow"><span>Aktuelle Themen</span></a></div><div class="topCtrl homeTopButton findNewPostsButton"><a href="find-new/posts" class="callToAction" rel="nofollow"><span>Neue Beiträge</span></a></div>');
        }
    }

    // Abstand zwischen BreadBox und Content erzwingen
    var ippf10 = document.getElementsByClassName('breadBoxTop');
    for(var j = 0; j < ippf10.length; j++) {
        ippf10[j].style.marginTop = '25px';
        ippf10[j].style.marginRight = '0px';
        ippf10[j].style.marginBottom = '25px';
        ippf10[j].style.marginLeft = '0px';
    }


    // Styleauswahl in den Einstellungen anzeigen (!!! StyleID wird gespeichert, aber ausgewählter Style wird nicht aktuell angezeigt und es werden nicht alle Styles des Forums angezeigt)
    document.getElementsByName('style_id')[0].insertAdjacentHTML('afterend', '<dl class="ctrlUnit"><dt><label for="ctrl_style_id">Style:</label></dt><dd><select name="style_id" class="textCtrl OptOut" id="ctrl_style_id" autofocus="on"><option value="0">(Standard-Style verwenden: IP-Phone-Forum Standard)</option><option value="2" class="" selected="selected">Xenith</option></optgroup></select><p class="explain">Du kannst die Seite in einem der an dieser Stelle angebotenen Styles anzeigen lassen.</p></dd></dl>');

    // Option sticky_userbar anzeigen
    document.getElementsByClassName('uix_sticky_userbar')[0].style.display = 'block';

})();