-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathse-top-bar.user.js
More file actions
103 lines (85 loc) · 3.04 KB
/
se-top-bar.user.js
File metadata and controls
103 lines (85 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// ==UserScript==
// @name SETopBar
// @namespace https://github.com/tziporaziegler/SETopBar/
// @description A user script for styling the Stack Exchange Network top-bar
// @author Tzipora Ziegler
// @include https://stackoverflow.com/*
// @include https://meta.stackoverflow.com/*
//// @include *.stackexchange.com/*
// @version 1.2.1
// @run-at document-body
// ==/UserScript==
(function() {
//Remove Tags tab
$('#nav-tags').parent().remove();
//Remove Tags tab
$('#nav-jobs').parent().remove();
//Set the Jobs tab name back to plain Jobs
//$('#nav-jobs').text('Jobs');
addMetaLink();
})();
function addMetaLink()
{
var a = document.createElement('a');
if(window.location.href.indexOf("meta") > -1)
{
a.href = 'https://stackoverflow.com/';
a.innerHTML = "<img src='https://cdn.sstatic.net/Sites/stackoverflow/company/img/logos/so/so-icon.svg?v=6e4af45f4d66' style='height:35px' />";
}
else {
a.href = 'https://meta.stackoverflow.com/';
a.innerHTML = "<img src='https://lh3.googleusercontent.com/proxy/rJXKmvckR8JowdIitBPHmtKFyNx4XBwV6vWtT5CAHqsG4FWULJ6cmmTKBJszS2rYEmApKGTOvmaGqGPjnu30LGsg2YlVE4963pACJuEVvk6BDQgTZY8b3FzDLRQry64qGQ9xmZy0Szkqx9AJm8LBerrvEfMNSPKeKQXT=s110-p' style='height:37px' />";
}
$('.-actions').append(a);
}
function addGlobalStyle(css) {
var head = document.getElementsByTagName('head')[0];
if (!head) { return; }
var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}
//Change background and border color to grey. Reduce box-shadow.
addGlobalStyle (
'header.so-header.js-so-header{ background-color:#f4f4f4; box-shadow:0 1px 0 rgba(12,13,14,0.1), 0 0 1px rgba(12,13,14,0.2) }'
);
//Change scrolling border to same grey and box-shadow as above
addGlobalStyle (
'.so-header._fixed._scrolling { box-shadow:0 1px 0 rgba(12,13,14,0.1), 0 0 1px rgba(12,13,14,0.2) }'
);
//Remove Tags tab
addGlobalStyle (
'#nav-tags{ display:none; }'
);
//Reduce spacing needed for sticky top-bar
addGlobalStyle (
'.so-header~.container { padding-top: 45px; }'
);
//Make Search Bar shorter
addGlobalStyle (
'.so-header .searchbar input[type="text"].f-input, .so-header .searchbar .btn { height: 32px; }'
);
//The remaining styles make the entire top-bar shorter
addGlobalStyle (
'.so-header { height:48px; }'
);
addGlobalStyle (
'.so-header .navigation .-list,' +
'.so-header .navigation .-link,' +
'.so-header .secondary-nav .-list,' +
'.so-header .secondary-nav .-link,' +
'.so-header .-logo { height:35px }'
);
addGlobalStyle (
'.so-header .navigation .-link, .so-header .secondary-nav .-link { line-height:35px }'
);
//Set the profile area padding to be match the rest of the top-bar elements
//This becomes noticable on hover
addGlobalStyle (
'.so-header .my-profile { padding:8px 10px; }'
);
//Hide suggested edits review queue number
addGlobalStyle (
'.indicator-badge.js-unread-count._reviews { display: none }'
);