Created
April 15, 2016 15:59
-
-
Save gregtatum/85fe6367e3b6c57368219a360022347f to your computer and use it in GitHub Desktop.
Greasemonkey bugzilla
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Saved Searches | |
| // @namespace gregtatum | |
| // @include https://bugzilla.mozilla.org* | |
| // @version 1 | |
| // @grant none | |
| // ==/UserScript== | |
| // Moves the saved searches to the top of the page and formats them into buttons | |
| try { | |
| var $ = document.querySelector.bind(document); | |
| var $$ = document.querySelectorAll.bind(document); | |
| var div = $('#links-saved'); | |
| div.parentElement.removeChild(div); | |
| Object.assign(div.style, { | |
| position: 'relative', | |
| top: 0, | |
| width: '100%', | |
| backgroundColor: 'rgb(61, 156, 219)', | |
| padding: '0.5em 2em', | |
| boxShadow: '0px 0px 1.3em rgba(0, 0, 0, 0.17) inset', | |
| textAlign: 'center', | |
| boxSizing: 'border-box', | |
| margin:0 | |
| }); | |
| var header = $('#header'); | |
| header.insertBefore(div, header.firstElementChild); | |
| var lis = $$('#links-saved li'); | |
| Array.from(lis).forEach(li => { | |
| Object.assign(li.style, { | |
| display: 'inline-block', | |
| padding: '0.1em', | |
| background: '#fff', | |
| margin: '0.2em', | |
| marginLeft: '0', | |
| borderRadius: '0.3em', | |
| boxShadow: '0.1em 0.1em 0.1em RGBA(0, 0, 0, 0.21)' | |
| }); | |
| }); | |
| } catch (e) { | |
| console.log(e); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment