imak1to / Google Mail - Gmail attachment on top

// ==UserScript==
// @name       			Google Mail - Gmail attachment on top
// @version    			1.0c
// @description			Just an easy script that moves Gmail attachments from bottom to the top of your email.
// @match      https://mail.google.com/mail/*
// @require http://code.jquery.com/jquery-latest.js
// @grant    GM_addStyle
// @license MIT
// ==/UserScript==

//don't run on frames or iframes
if (window.top != window.self)
    return;

//Observe DOM changes
var observer = new MutationObserver(function(mutations) {
//Move div
$(".hq").contents().appendTo(".aHl");
});

observer.observe(document, {childList: true, subtree: true, attributes: false, characterData: false,
});

// Visual upgrades
GM_addStyle(".gH { padding-right:16px;}");
GM_addStyle(".aHl { margin-left: -2px !important; background: rgb(245, 245, 245); padding-left:16px; -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px; padding-right:16px;padding-top:10px; border-bottom: 1px dashed #ccc;margin-bottom: 10px;}");
GM_addStyle(".aVW { color: rgb(251, 76, 47);font-size: 12px;}");
GM_addStyle(".aYp { font-size:8px!important;display:run-in!important;");
GM_addStyle(".aQH { margin-bottom:0!important;");