a better tiss for tiss-developers
Versión del día
// ==UserScript==
// @name tiss_developer_tweaks
// @namespace https://greasyfork.org/de/users/157797-lual
// @include *tiss.tuwien.ac.at*
// @include http://localhost:3*
// @version 0.7
// @author lual
// @description a better tiss for tiss-developers
// @author fg (csd)
// @grant GM_addStyle
// ==/UserScript==
// changes: 2017-11-01 publish on greasyfork
// https://greasyfork.org/de/scripts/34721-tiss-developer-tweaks
// 2017-11-03 mark current menu entry
// fill unused space - use whole screen width
////////////////////////////////////////////////////////////////////////////////
// list of links to environments
var linkListHref = ['localhost:3001','localhost:3002','localhost:3003','dev1.tiss.tuwien.ac.at','mig.tiss.tuwien.ac.at','tiss.tuwien.ac.at'];
var linkListProt = ['http://', 'http://', 'http://', 'https://', 'https://', 'https://' ];
var linkListText = ['lh:3001', 'lh:3002', 'lh:3003', 'dev1', 'mig', 'Echtsystem!' ];
function populateMenu() {
var menu = document.getElementsByClassName("clearfix toolNav")[0];
var li;
var newLink;
var text;
for (var i = 0; i < linkListHref.length; i++ ) {
li = document.createElement("li");
newSpan = document.createElement("span");
if (window.location.host == linkListHref[i])
{
text = document.createTextNode(linkListText[i]);
newSpan.appendChild(text);
newSpan.setAttribute("style", "color:grey; font-weight: bold;");
newSpan.setAttribute("style", "color:grey; font-weight: bold; background: #FFFFFF; border-left: 1px solid #CDDAE1; border-right: 1px solid #CDDAE1; border-top: 1px solid #CDDAE1; padding-left:4px; padding-right:4px; background: linear-gradient(to top, #F5FAFD, #FFFFFF);");
} else {
newLink = document.createElement("a");
newLink.setAttribute('href',linkListProt[i] + linkListHref[i] + window.location.pathname + window.location.search + window.location.hash);
newLink.innerHTML = linkListText[i];
newSpan.appendChild(newLink);
}
li.appendChild(newSpan);
menu.appendChild(li);
}
}
populateMenu();
////////////////////////////////////////////////////////////////////////////////
//include userstyle tiss-env-border
//https://userstyles.org/styles/121958/tiss-env-border
GM_addStyle(`
@-moz-document regexp(".*[^\.]tiss[\.]tuwien[\.]ac[\.]at.*") {
body:before {
content: "";
position: fixed;
background: #FF0000;
left: 0;
right: 0;
height: 11px;
z-index:100;
background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' height='11px' width='90px'><text x='9' y='9' fill='white' font-size='10' font-weight='bold' font-family='Arial, Helvetica, sans-serif' >ECHTSYSTEM ! </text></svg>");
top: 0;
}
body {
margin-top:11px;
}
}
`);
////////////////////////////////////////////////////////////////////////////////
// mark current menu entry
GM_addStyle(`
#supNav ul li.currentPageItem > span > a {
background: #FFFFFF;
background: -webkit-linear-gradient(left, #F5FAFD, #FFFFFF); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(right, #F5FAFD, #FFFFFF); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(right, #F5FAFD, #FFFFFF); /* For Firefox 3.6 to 15 */
background: linear-gradient(to right, #F5FAFD, #FFFFFF); /* Standard syntax */
border-bottom: 1px solid #CDDAE1;
border-top: 1px solid #CDDAE1;
}
#shadow_top {
z-index: 0;}
`);
////////////////////////////////////////////////////////////////////////////////
// fill unused space - use whole screen width
GM_addStyle("body>#wrapper {max-width: 98%!important;}");