Some tweaks to the GreySec page
#1
Well, as someone who visits greysec at least 2 or 3 times a day I get tired of having to scroll to the bottom of the page, so I used my magic to create some scripts.
You can use whatever userscript addon to run these, I use tampermonkey for chrome, but should work with greasemonkey on firefox too.

First of all, I changed the position of the posts table to the top.
Code:
// ==UserScript==
// @name         Greysec Post Table
// @namespace    https://greysec.net/
// @version      0.1
// @description  Simple script for changing latests posts to the top and the button "return to top"
// @author       enmafia2
// @match        https://greysec.net/
// @match        https://greysec.net/index.php
// @grant        none
// ==/UserScript==

// ---[MAIN]---
"use strict";
(function() {
ChangePos();

//  ---[CHANGE THE POSITION OF THE POSTS TABLE]---
function ChangePos() {
   //Add space for the table
   var d = document.querySelector("div.navigation");
   d.innerHTML += '<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>';
   var lu = d.offsetWidth;

   //Change position of the table
   var posts = document.getElementById("prostats_table");
   posts.style.position = "absolute";
   posts.style.top = '225px';
   posts.style.width = lu-25+"px";
}
//Change size of the table if event triggered
function fooOnResize() {
   var newlu = document.querySelector("div.navigation").offsetWidth;
   document.getElementById("prostats_table").style.width = newlu-25+"px"
}

//Event Listener
window.addEventListener("resize", fooOnResize)

})();

And I added a "Go to Top button":
Code:
// ==UserScript==
// @name         Greysec TopButton
// @namespace    https://greysec.net/
// @version      0.1
// @description  Simple script for changing latests posts to the top and the button "return to top"
// @author       enmafia2
// @match        https://greysec.net/*
// @grant        none
// ==/UserScript==

(function() {
CreateButton();
//  ---[CREATE THE BUTTON "TO TOP"] ---
function CreateButton() {
   var btn = document.createElement("BUTTON");
   var t = document.createTextNode("⇧");
   btn.appendChild(t);
   document.body.appendChild(btn);
   btn.style.position="fixed";
   btn.style.bottom="5px";
   btn.style.right="5px";
   btn.style.fontSize="18px"
   btn.onclick = function() {
       location.href = "#top";
   };
}
})();

Here you can see a preview:
[Image: JOTqmbi.png]

EDIT: There is also a new repository on the GS Devs about this Smile
Reply
#2
Awesome, thanks for the scripts. We should put in a suggestion to move that post table to the top though..
Reply
#3
(06-20-2018, 02:28 AM)Infinityex Wrote: Awesome, thanks for the scripts. We should put in a suggestion to move that post table to the top though..

Thanks, my code is not perfect tho. I'm using  position absolute to move the post table and there's probably better ways to achieve this. This was the first thing that came to my mind tho, and because it worked I decided to share it here.

About the suggestion thing I don't know, not sure if everyone would like to have that table there, it's just something personal I think.
Reply
#4
This looks prettier Tongue

[Image: 3UOrhxg.png]
Reply
#5
(07-12-2018, 02:23 AM)system32 Wrote: This looks prettier Tongue

[Image: 3UOrhxg.png]

You deleted top links, didn’t you?
I was going to do that, but I would miss the ‘mod cp’ link so I ended up not deleting it.

Nice to see that you are rocking my script tho :p
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  ATTN: GreySec Devs. Vector 3 194,040 05-01-2019, 05:01 PM
Last Post: Vector