Skip to content

Instantly share code, notes, and snippets.

@stijnherreman
Created February 22, 2017 11:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stijnherreman/8c4ba734acf15393d73c408c79831dfc to your computer and use it in GitHub Desktop.
Save stijnherreman/8c4ba734acf15393d73c408c79831dfc to your computer and use it in GitHub Desktop.
Based on the Chrome extension of Travis J at http://meta.stackoverflow.com/a/344231/247702
// ==UserScript==
// @name StackTopReorder
// @description A top bar in a different order.
// @namespace TravisJ
// @author TravisJ
// @license GNU GPL v3 (http://www.gnu.org/copyleft/gpl.html)
// @include http://meta.stackoverflow.com/*
// @include http://stackoverflow.com/*
// @include *.stackexchange.com/*
// @grant GM_addStyle
//jQuery injection
function $$(f) {
var script = document.createElement("script");
script.type = "text/javascript";
script.textContent = "(" + f.toString() + ")(jQuery)";
document.body.appendChild(script).parentNode.removeChild(script);
};
//reorder the new topbar
$$(function($){
var logoLinks = $('.-main');
var logo = $('a.-logo._glyph',logoLinks);
logo.css('width','25px');
$('span',logo).css('width','25px');
var url = $('span',logo).css('background-image');
logoLinks.parent().append(logoLinks);
var name = $('div.-actions a.my-profile.js-gps-track');
name.parent().append(name);
name.css('margin-right','35px');
var actions = $('div.-actions ol.-list');
actions.append(actions.children('li.-item').get().reverse());
});
GM_addStyle(".topbar-dialog.dno { right:initial !important; }");
GM_addStyle(".so-header .-actions { margin-left: 0 !important; }")
// ==/UserScript==
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment