Xhamster Quick Links v.2.6

Adds handy links to the top/right of the Xhamster page (inculde USERSTYLE for HOVER)

Från och med 2016-01-23. Se den senaste versionen.

// ==UserScript== 
// @name          Xhamster Quick Links v.2.6
// @date          2016.01
// @version       2.6

// @description	  Adds handy links to the top/right of the Xhamster page (inculde USERSTYLE for HOVER)

// @namespace     https://greasyfork.org/users/7434
// @author        Andreas Schaefer [email protected]
// @author        janvier57

// @include       *xhamster.com*

// @exclude	  http*://services.addons.mozilla.org/*

// @grant       none
// @grant       GM_getValue
// @grant       GM_setValue

// ==/UserScript==

// (Credit Andreas Schaefer)



if (window.top != window.self)  //don't run on frames or iframes
{
    return;
}

// TWEAK FOR MY STYLE :	
//var customhtml = "<div style=\"position: absolute !important; top: -2px; left: 0px;  margin-left: 180px !important; px;height: 15px; color: #999999; z-index: 99; width: auto !important; font-size:10px; text-align: center; white-space: nowrap !important; outline: 1px solid gray;  \">" +

// TWEAK FOR NO STYLE :	
var customhtml = "<div style=\"outline: 1px solid gray; \">" +


// USAGE: You can put whatever links or html you want in .

// Simply Add/Edit your own links to the following variable:
// EXAMPLE:
//   "<a href=YOUR LINK>ITS LABEL</a> | " +


// MY FAVORITES
  "<a href=http://xhamster.com/user/video/janvier57/favorite-1.html>My Favs</a> | " +	

// My BLOG - Xhamster Tools
  "<a href=http://xhamster.com/user/janvier57/posts/479976.html>Xham Tools</a> | " +

// Xhamster Forum
  "<a href=http://suggestions.xhamster.com/forums/59059-general>Xham Forum</a> | ";
  "</div>";


var allspans = new Array();
//JANVIER57 TWEAK 2016
allspans = document.getElementsByClassName('menu');
if (allspans.length == 0) {
	allspans = document.getElementsByClassName('global-nav-content');
}
allspans[0].innerHTML += customhtml;



// ADD MY USERSTYLE for the Script :
// Test addGlolStyle STYLE technique for Chrome compatibility

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}
  addGlobalStyle('.menu.menuUser .main + div {position:fixed !important;height:14px !important;width:9px !important;left:0 !important;top: 1px !important;color: #999999; font-size:10px;text-align:left;overflow:hidden !important;z-index:50000 !important;outline:1px solid gray;background:red;}.menu.menuUser .main + div a {color:white !important;text-shadow:none !important; }');
  addGlobalStyle('.menu.menuUser .main + div:hover{position: fixed!important;display:inline-block !important;height:auto !important;width:auto !important;width:auto !important;top:1px !important;left:0 !important;color:#999999;font-size:10px;text-align:left;overflow:hidden;z-index:50000 !important;outline:1px solid gray;background:blue !important; }');
  addGlobalStyle('.menu.menuUser .main + div a {color:white !important;text-shadow:none !important; }');