Visa raderade svar/frågor överst för StackExchange

Byt plats på två div-element inuti en förälder

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         Show Deleted Answers/Questions at head for StackExchange
// @description  Swap two divs inside a parent
// @name:ar          إظهار الإجابات/الأسئلة المحذوفة في الأعلى لـ StackExchange
// @description:ar    تبديل قسمين داخل عنصر أب
// @name:bg          Показване на изтрити отговори/въпроси в горната част за StackExchange
// @description:bg    Размяна на два div елемента в рамките на родител
// @name:cs          Zobrazit smazané odpovědi/otázky nahoře pro StackExchange
// @description:cs    Prohození dvou div elementů uvnitř rodiče
// @name:da          Vis slettede svar/spørgsmål øverst for StackExchange
// @description:da    Byt om på to div'er inde i en forælder
// @name:de          Gelöschte Antworten/Fragen am Anfang für StackExchange anzeigen
// @description:de    Zwei Div-Elemente innerhalb eines Elternteils tauschen
// @name:el          Εμφάνιση διαγραμμένων απαντήσεων/ερωτήσεων στην αρχή για το StackExchange
// @description:el    Αντικατάσταση δύο div στοιχείων μέσα σε έναν γονέα
// @name:eo          Montri Forigitajn Respondojn/Demandojn ĉe la supro por StackExchange
// @description:eo    Interŝanĝi du div-ojn ene de patro
// @name:es          Mostrar respuestas/preguntas eliminadas en la parte superior para StackExchange
// @description:es    Intercambiar dos divs dentro de un padre
// @name:fi          Näytä poistetut vastaukset/kysymykset ylhäällä StackExchangea varten
// @description:fi    Vaihda kaksi div-elementtiä vanhemman sisällä
// @name:fr          Afficher les réponses/questions supprimées en haut pour StackExchange
// @description:fr    Échanger deux div à l'intérieur d'un parent
// @name:fr-CA       Afficher les réponses/questions supprimées en haut pour StackExchange
// @description:fr-CA    Échanger deux div à l'intérieur d'un parent
// @name:he          הצג תשובות/שאלות מחוקות בראש עבור StackExchange
// @description:he    החלף שני divים בתוך אב
// @name:hr          Prikaži izbrisane odgovore/pitanja na vrhu za StackExchange
// @description:hr    Zamijeni dva div elementa unutar roditelja
// @name:hu          Törölt válaszok/kérdések megjelenítése felül a StackExchange számára
// @description:hu    Két div felcserélése egy szülőben
// @name:id          Tampilkan Jawaban/Pertanyaan yang Dihapus di bagian atas untuk StackExchange
// @description:id    Tukar dua div di dalam induk
// @name:it          Mostra le risposte/domande eliminate in alto per StackExchange
// @description:it    Scambia due div all'interno di un elemento padre
// @name:ja          StackExchangeの削除された回答/質問を先頭に表示
// @description:ja    親の中にある2つのdivを入れ替える
// @name:ka          წაშლილი პასუხების/კითხვების ჩვენება სათავეში StackExchange-ისთვის
// @description:ka    ორი div-ის შეცვლა მშობლის შიგნით
// @name:ko          StackExchange에서 삭제된 답변/질문을 맨 위에 표시
// @description:ko    부모 요소 내부의 두 div를 바꿉니다.
// @name:nb          Vis slettede svar/spørsmål øverst for StackExchange
// @description:nb    Bytt to div-er inne i en forelder
// @name:nl          Toon verwijderde antwoorden/vragen bovenaan voor StackExchange
// @description:nl    Verwissel twee divs binnen een ouder
// @name:pl          Pokaż usunięte odpowiedzi/pytania na górze dla StackExchange
// @description:pl    Zamień dwa divy wewnątrz rodzica
// @name:pt-BR       Mostrar Respostas/Perguntas Excluídas no cabeçalho para StackExchange
// @description:pt-BR    Trocar duas divs dentro de um pai
// @name:ro          Afișează răspunsurile/întrebările șterse în partea de sus pentru StackExchange
// @description:ro    Schimbă două div-uri într-un părinte
// @name:ru          Показывать удаленные ответы/вопросы вверху для StackExchange
// @description:ru    Поменять местами два div внутри родителя
// @name:sk          Zobraziť odstránené odpovede/otázky navrchu pre StackExchange
// @description:sk    Prehoďte dva div prvky v rámci rodiča
// @name:sr          Прикажи обрисане одговоре/питања на врху за StackExchange
// @description:sr    Замени два div елемента унутар родитеља
// @name:sv          Visa raderade svar/frågor överst för StackExchange
// @description:sv    Byt plats på två div-element inuti en förälder
// @name:th          แสดงคำตอบ/คำถามที่ถูกลบที่หัวสำหรับ StackExchange
// @description:th    สลับ div สองอันภายในองค์ประกอบหลัก
// @name:tr          StackExchange için Silinen Cevapları/Soruları başta göster
// @description:tr    Bir ana öğe içindeki iki div'i değiştir
// @name:ug          StackExchange ئۈچۈن ئۆچۈرۈلگەن جاۋابلار / سوئاللارنى بېشىدا كۆرسىتىڭ
// @description:ug    ئاتا-ئانىسى ئىچىدىكى ئىككى بۆلەكنى ئالماشتۇرۇڭ
// @name:uk          Показати видалені відповіді/запитання вгорі для StackExchange
// @description:uk    Поміняти два div елементи всередині батьківського елемента
// @name:vi          Hiển thị Câu trả lời/Câu hỏi đã Xóa ở đầu trang cho StackExchange
// @description:vi    Hoán đổi hai div bên trong một phần tử cha
// @name:zh          在 StackExchange 上显示已删除的答案/问题
// @description:zh    交换父元素中的两个 div
// @name:zh-CN       在 StackExchange 上显示已删除的答案/问题
// @description:zh-CN    交换父元素中的两个 div
// @name:zh-HK       在 StackExchange 上顯示已刪除的答案/問題
// @description:zh-HK    交換父元素中的兩個 div
// @name:zh-SG       在 StackExchange 上显示已删除的答案/问题
// @description:zh-SG    交换父元素中的两个 div
// @name:zh-TW       在 StackExchange 上顯示已刪除的答案/問題
// @description:zh-TW    交換父元素中的兩個 div
// @namespace    http://tampermonkey.net/
// @version      1.2.4.1
// @author       aspen138
// @match        https://*.stackexchange.com/users/*/*?tab=answers*
// @match        https://*.stackexchange.com/users/*/*?tab=questions*
// @match        https://mathoverflow.net/users/*/*?tab=answers*
// @match        https://mathoverflow.net/users/*/*?tab=questions*
// @match        https://stackoverflow.com/users/*/*?tab=answers*
// @match        https://stackoverflow.com/users/*/*?tab=questions*
// @match          *://*.stackexchange.com/*
// @match          *://*.stackoverflow.com/questions/*
// @match          *://superuser.com/questions/*
// @match          *://meta.superuser.com/questions/*
// @match          *://serverfault.com/questions/*
// @match          *://meta.serverfault.com/questions/*
// @match          *://askubuntu.com/questions/*
// @match          *://meta.askubuntu.com/questions/*
// @match          *://mathoverflow.net/questions/*
// @match          *://meta.mathoverflow.net/questions/*
// @match          *://*.stackexchange.com/questions/*
// @match          *://answers.onstartups.com/questions/*
// @match          *://meta.answers.onstartups.com/questions/*
// @match          *://stackapps.com/questions/*
// @match          *://*.stackoverflow.com/review/*
// @match          *://superuser.com/review/*
// @match          *://meta.superuser.com/review/*
// @match          *://serverfault.com/review/*
// @match          *://meta.serverfault.com/review/*
// @match          *://askubuntu.com/review/*
// @match          *://meta.askubuntu.com/review/*
// @match          *://mathoverflow.net/review/*
// @match          *://meta.mathoverflow.net/review/*
// @match          *://*.stackexchange.com/review/*
// @match          *://answers.onstartups.com/review/*
// @match          *://meta.answers.onstartups.com/review/*
// @match          *://stackapps.com/review/*
// @match          *://*.stackoverflow.com/search*
// @match          *://superuser.com/search*
// @match          *://meta.superuser.com/search*
// @match          *://serverfault.com/search*
// @match          *://meta.serverfault.com/search*
// @match          *://askubuntu.com/search*
// @match          *://meta.askubuntu.com/search*
// @match          *://mathoverflow.net/search*
// @match          *://meta.mathoverflow.net/search*
// @match          *://*.stackexchange.com/search*
// @match          *://answers.onstartups.com/search*
// @match          *://meta.answers.onstartups.com/search*
// @match          *://stackapps.com/search*
// @grant        none
// @license     MIT
// ==/UserScript==

(function() {
    'use strict';

    // Function to swap divs
    function swapDivs() {
        let parentDiv = document.querySelector('.ba.bc-black-225.bar-md');
        let firstDiv = document.querySelector('#js-post-summaries');
        let secondDiv = document.querySelector('.bt.bc-black-200.p16');

        if (parentDiv && firstDiv && secondDiv) {
            let firstDivClone = firstDiv.cloneNode(true);
            let secondDivClone = secondDiv.cloneNode(true);
            parentDiv.removeChild(firstDiv);
            parentDiv.removeChild(secondDiv);
            parentDiv.appendChild(secondDivClone);
            parentDiv.appendChild(firstDivClone);
        }
    }

    // Swap divs on page load
    window.addEventListener('load', swapDivs, false);

    let tabs = document.querySelectorAll('.js-user-tab-sort');
    tabs.forEach(tab => {
        tab.addEventListener('click', () => {
            setTimeout(function(){ location.reload(); }, 0.3);
        }, false);
    });

})();