// ==UserScript== // @name GoogleBarReturns2017 // @namespace http://jtg.ii.com/ // @version Alpha 0.1 // @run-at document-start // @description Google Bar Returns // @author James Griffing // @match https://*.google.com/* // @match https://www.youtube.com/ // @match https://greasyfork.org/* // @grant GM_addStyle // @grant GM_setValue // @grant GM_getValue // @grant GM_listValues // @grant GM_deleteValue // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js // @noframes // @downloadURL none // ==/UserScript== //============================required==================== // Spectrum Colorpicker v1.8.0 // https://github.com/bgrins/spectrum // Author: Brian Grinstead // License: MIT (function(factory){"use strict";if(typeof define==='function'&&define.amd){define(['jquery'],factory);} else if(typeof exports=="object"&&typeof module=="object"){module.exports=factory(require('jquery'));} else{factory(jQuery);}})(function($,undefined){"use strict";var defaultOpts={beforeShow:noop,move:noop,change:noop,show:noop,hide:noop,color:false,flat:false,showInput:false,allowEmpty:false,showButtons:true,clickoutFiresChange:true,showInitial:false,showPalette:false,showPaletteOnly:false,hideAfterPaletteSelect:false,togglePaletteOnly:false,showSelectionPalette:true,localStorageKey:false,appendTo:"body",maxSelectionSize:7,cancelText:"cancel",chooseText:"choose",togglePaletteMoreText:"more",togglePaletteLessText:"less",clearText:"Clear Color Selection",noColorSelectedText:"No Color Selected",preferredFormat:false,className:"",containerClassName:"",replacerClassName:"",showAlpha:false,theme:"sp-light",palette:[["#ffffff","#000000","#ff0000","#ff8000","#ffff00","#008000","#0000ff","#4b0082","#9400d3"]],selectionPalette:[],disabled:false,offset:null},spectrums=[],IE=!!/msie/i.exec(window.navigator.userAgent),rgbaSupport=(function(){function contains(str,substr){return!!~(''+str).indexOf(substr);} var elem=document.createElement('div');var style=elem.style;style.cssText='background-color:rgba(0,0,0,.5)';return contains(style.backgroundColor,'rgba')||contains(style.backgroundColor,'hsla');})(),replaceInput=["
","
","
","
"].join(''),markup=(function(){var gradientFix="";if(IE){for(var i=1;i<=6;i++){gradientFix+="
";}} return["
","
","
","
","","
","
","
","
","
","
","
","
","
","
","
","
","
","
","
","
","
",gradientFix,"
","
","
","
","
","","
","
","
","","","
","
","
"].join("");})();function paletteTemplate(p,color,className,opts){var html=[];for(var i=0;i');}else{var cls='sp-clear-display';html.push($('
').append($('').attr('title',opts.noColorSelectedText)).html());}} return"
"+html.join('')+"
";} function hideAll(){for(var i=0;iMath.abs(dragY-oldDragY);shiftMovementDirection=furtherFromX?"x":"y";} var setSaturation=!shiftMovementDirection||shiftMovementDirection==="x";var setValue=!shiftMovementDirection||shiftMovementDirection==="y";if(setSaturation){currentSaturation=parseFloat(dragX/dragWidth);} if(setValue){currentValue=parseFloat((dragHeight-dragY)/dragHeight);} isEmpty=false;if(!opts.showAlpha){currentAlpha=1;} move();},dragStart,dragStop);if(!!initialColor){set(initialColor);updateUI();currentPreferredFormat=opts.preferredFormat||tinycolor(initialColor).format;addColorToSelectionPalette(initialColor);} else{updateUI();} if(flat){show();} function paletteElementClick(e){if(e.data&&e.data.ignore){set($(e.target).closest(".sp-thumb-el").data("color"));move();} else{set($(e.target).closest(".sp-thumb-el").data("color"));move();updateOriginalInput(true);if(opts.hideAfterPaletteSelect){hide();}} return false;} var paletteEvent=IE?"mousedown.spectrum":"click.spectrum touchstart.spectrum";paletteContainer.delegate(".sp-thumb-el",paletteEvent,paletteElementClick);initialColorContainer.delegate(".sp-thumb-el:nth-child(1)",paletteEvent,{ignore:true},paletteElementClick);} function updateSelectionPaletteFromStorage(){if(localStorageKey&&window.localStorage){try{var oldPalette=window.localStorage[localStorageKey].split(",#");if(oldPalette.length>1){delete window.localStorage[localStorageKey];$.each(oldPalette,function(i,c){addColorToSelectionPalette(c);});}} catch(e){} try{selectionPalette=window.localStorage[localStorageKey].split(";");} catch(e){}}} function addColorToSelectionPalette(color){if(showSelectionPalette){var rgb=tinycolor(color).toRgbString();if(!paletteLookup[rgb]&&$.inArray(rgb,selectionPalette)===-1){selectionPalette.push(rgb);while(selectionPalette.length>maxSelectionSize){selectionPalette.shift();}} if(localStorageKey&&window.localStorage){try{window.localStorage[localStorageKey]=selectionPalette.join(";");} catch(e){}}}} function getUniqueSelectionPalette(){var unique=[];if(opts.showPalette){for(var i=0;iviewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0);offset.top-=Math.min(offset.top,((offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(dpHeight+inputHeight-extraY):extraY));return offset;} function noop(){} function stopPropagation(e){e.stopPropagation();} function bind(func,obj){var slice=Array.prototype.slice;var args=slice.call(arguments,2);return function(){return func.apply(obj,args.concat(slice.call(arguments)));};} function draggable(element,onmove,onstart,onstop){onmove=onmove||function(){};onstart=onstart||function(){};onstop=onstop||function(){};var doc=document;var dragging=false;var offset={};var maxHeight=0;var maxWidth=0;var hasTouch=('ontouchstart'in window);var duringDragEvents={};duringDragEvents["selectstart"]=prevent;duringDragEvents["dragstart"]=prevent;duringDragEvents["touchmove mousemove"]=move;duringDragEvents["touchend mouseup"]=stop;function prevent(e){if(e.stopPropagation){e.stopPropagation();} if(e.preventDefault){e.preventDefault();} e.returnValue=false;} function move(e){if(dragging){if(IE&&doc.documentMode<9&&!e.button){return stop();} var t0=e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches[0];var pageX=t0&&t0.pageX||e.pageX;var pageY=t0&&t0.pageY||e.pageY;var dragX=Math.max(0,Math.min(pageX-offset.left,maxWidth));var dragY=Math.max(0,Math.min(pageY-offset.top,maxHeight));if(hasTouch){prevent(e);} onmove.apply(element,[dragX,dragY,e]);}} function start(e){var rightclick=(e.which)?(e.which==3):(e.button==2);if(!rightclick&&!dragging){if(onstart.apply(element,arguments)!==false){dragging=true;maxHeight=$(element).height();maxWidth=$(element).width();offset=$(element).offset();$(doc).bind(duringDragEvents);$(doc.body).addClass("sp-dragging");move(e);prevent(e);}}} function stop(){if(dragging){$(doc).unbind(duringDragEvents);$(doc.body).removeClass("sp-dragging");setTimeout(function(){onstop.apply(element,arguments);},0);} dragging=false;} $(element).bind("touchstart mousedown",start);} function throttle(func,wait,debounce){var timeout;return function(){var context=this,args=arguments;var throttler=function(){timeout=null;func.apply(context,args);};if(debounce)clearTimeout(timeout);if(debounce||!timeout)timeout=setTimeout(throttler,wait);};} function inputTypeColorSupport(){return $.fn.spectrum.inputTypeColorSupport();} var dataID="spectrum.id";$.fn.spectrum=function(opts,extra){if(typeof opts=="string"){var returnValue=this;var args=Array.prototype.slice.call(arguments,1);this.each(function(){var spect=spectrums[$(this).data(dataID)];if(spect){var method=spect[opts];if(!method){throw new Error("Spectrum: no such method: '"+opts+"'");} if(opts=="get"){returnValue=spect.get();} else if(opts=="container"){returnValue=spect.container;} else if(opts=="option"){returnValue=spect.option.apply(spect,args);} else if(opts=="destroy"){spect.destroy();$(this).removeData(dataID);} else{method.apply(spect,args);}}});return returnValue;} return this.spectrum("destroy").each(function(){var options=$.extend({},opts,$(this).data());var spect=spectrum(this,options);$(this).data(dataID,spect.id);});};$.fn.spectrum.load=true;$.fn.spectrum.loadOpts={};$.fn.spectrum.draggable=draggable;$.fn.spectrum.defaults=defaultOpts;$.fn.spectrum.inputTypeColorSupport=function inputTypeColorSupport(){if(typeof inputTypeColorSupport._cachedResult==="undefined"){var colorInput=$("")[0];inputTypeColorSupport._cachedResult=colorInput.type==="color"&&colorInput.value!=="";} return inputTypeColorSupport._cachedResult;};$.spectrum={};$.spectrum.localization={};$.spectrum.palettes={};$.fn.spectrum.processNativeColorInputs=function(){var colorInputs=$("input[type=color]");if(colorInputs.length&&!inputTypeColorSupport()){colorInputs.spectrum({preferredFormat:"hex6"});}};(function(){var trimLeft=/^[\s,#]+/,trimRight=/\s+$/,tinyCounter=0,math=Math,mathRound=math.round,mathMin=math.min,mathMax=math.max,mathRandom=math.random;var tinycolor=function(color,opts){color=(color)?color:'';opts=opts||{};if(color instanceof tinycolor){return color;} if(!(this instanceof tinycolor)){return new tinycolor(color,opts);} var rgb=inputToRGB(color);this._originalInput=color,this._r=rgb.r,this._g=rgb.g,this._b=rgb.b,this._a=rgb.a,this._roundA=mathRound(100*this._a)/100,this._format=opts.format||rgb.format;this._gradientType=opts.gradientType;if(this._r<1){this._r=mathRound(this._r);} if(this._g<1){this._g=mathRound(this._g);} if(this._b<1){this._b=mathRound(this._b);} this._ok=rgb.ok;this._tc_id=tinyCounter++;};tinycolor.prototype={isDark:function(){return this.getBrightness()<128;},isLight:function(){return!this.isDark();},isValid:function(){return this._ok;},getOriginalInput:function(){return this._originalInput;},getFormat:function(){return this._format;},getAlpha:function(){return this._a;},getBrightness:function(){var rgb=this.toRgb();return(rgb.r*299+rgb.g*587+rgb.b*114)/1000;},setAlpha:function(value){this._a=boundAlpha(value);this._roundA=mathRound(100*this._a)/100;return this;},toHsv:function(){var hsv=rgbToHsv(this._r,this._g,this._b);return{h:hsv.h*360,s:hsv.s,v:hsv.v,a:this._a};},toHsvString:function(){var hsv=rgbToHsv(this._r,this._g,this._b);var h=mathRound(hsv.h*360),s=mathRound(hsv.s*100),v=mathRound(hsv.v*100);return(this._a==1)?"hsv("+h+", "+s+"%, "+v+"%)":"hsva("+h+", "+s+"%, "+v+"%, "+this._roundA+")";},toHsl:function(){var hsl=rgbToHsl(this._r,this._g,this._b);return{h:hsl.h*360,s:hsl.s,l:hsl.l,a:this._a};},toHslString:function(){var hsl=rgbToHsl(this._r,this._g,this._b);var h=mathRound(hsl.h*360),s=mathRound(hsl.s*100),l=mathRound(hsl.l*100);return(this._a==1)?"hsl("+h+", "+s+"%, "+l+"%)":"hsla("+h+", "+s+"%, "+l+"%, "+this._roundA+")";},toHex:function(allow3Char){return rgbToHex(this._r,this._g,this._b,allow3Char);},toHexString:function(allow3Char){return'#'+this.toHex(allow3Char);},toHex8:function(){return rgbaToHex(this._r,this._g,this._b,this._a);},toHex8String:function(){return'#'+this.toHex8();},toRgb:function(){return{r:mathRound(this._r),g:mathRound(this._g),b:mathRound(this._b),a:this._a};},toRgbString:function(){return(this._a==1)?"rgb("+mathRound(this._r)+", "+mathRound(this._g)+", "+mathRound(this._b)+")":"rgba("+mathRound(this._r)+", "+mathRound(this._g)+", "+mathRound(this._b)+", "+this._roundA+")";},toPercentageRgb:function(){return{r:mathRound(bound01(this._r,255)*100)+"%",g:mathRound(bound01(this._g,255)*100)+"%",b:mathRound(bound01(this._b,255)*100)+"%",a:this._a};},toPercentageRgbString:function(){return(this._a==1)?"rgb("+mathRound(bound01(this._r,255)*100)+"%, "+mathRound(bound01(this._g,255)*100)+"%, "+mathRound(bound01(this._b,255)*100)+"%)":"rgba("+mathRound(bound01(this._r,255)*100)+"%, "+mathRound(bound01(this._g,255)*100)+"%, "+mathRound(bound01(this._b,255)*100)+"%, "+this._roundA+")";},toName:function(){if(this._a===0){return"transparent";} if(this._a<1){return false;} return hexNames[rgbToHex(this._r,this._g,this._b,true)]||false;},toFilter:function(secondColor){var hex8String='#'+rgbaToHex(this._r,this._g,this._b,this._a);var secondHex8String=hex8String;var gradientType=this._gradientType?"GradientType = 1, ":"";if(secondColor){var s=tinycolor(secondColor);secondHex8String=s.toHex8String();} return"progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")";},toString:function(format){var formatSet=!!format;format=format||this._format;var formattedString=false;var hasAlpha=this._a<1&&this._a>=0;var needsAlphaFormat=!formatSet&&hasAlpha&&(format==="hex"||format==="hex6"||format==="hex3"||format==="name");if(needsAlphaFormat){if(format==="name"&&this._a===0){return this.toName();} return this.toRgbString();} if(format==="rgb"){formattedString=this.toRgbString();} if(format==="prgb"){formattedString=this.toPercentageRgbString();} if(format==="hex"||format==="hex6"){formattedString=this.toHexString();} if(format==="hex3"){formattedString=this.toHexString(true);} if(format==="hex8"){formattedString=this.toHex8String();} if(format==="name"){formattedString=this.toName();} if(format==="hsl"){formattedString=this.toHslString();} if(format==="hsv"){formattedString=this.toHsvString();} return formattedString||this.toHexString();},_applyModification:function(fn,args){var color=fn.apply(null,[this].concat([].slice.call(args)));this._r=color._r;this._g=color._g;this._b=color._b;this.setAlpha(color._a);return this;},lighten:function(){return this._applyModification(lighten,arguments);},brighten:function(){return this._applyModification(brighten,arguments);},darken:function(){return this._applyModification(darken,arguments);},desaturate:function(){return this._applyModification(desaturate,arguments);},saturate:function(){return this._applyModification(saturate,arguments);},greyscale:function(){return this._applyModification(greyscale,arguments);},spin:function(){return this._applyModification(spin,arguments);},_applyCombination:function(fn,args){return fn.apply(null,[this].concat([].slice.call(args)));},analogous:function(){return this._applyCombination(analogous,arguments);},complement:function(){return this._applyCombination(complement,arguments);},monochromatic:function(){return this._applyCombination(monochromatic,arguments);},splitcomplement:function(){return this._applyCombination(splitcomplement,arguments);},triad:function(){return this._applyCombination(triad,arguments);},tetrad:function(){return this._applyCombination(tetrad,arguments);}};tinycolor.fromRatio=function(color,opts){if(typeof color=="object"){var newColor={};for(var i in color){if(color.hasOwnProperty(i)){if(i==="a"){newColor[i]=color[i];} else{newColor[i]=convertToPercentage(color[i]);}}} color=newColor;} return tinycolor(color,opts);};function inputToRGB(color){var rgb={r:0,g:0,b:0};var a=1;var ok=false;var format=false;if(typeof color=="string"){color=stringInputToObject(color);} if(typeof color=="object"){if(color.hasOwnProperty("r")&&color.hasOwnProperty("g")&&color.hasOwnProperty("b")){rgb=rgbToRgb(color.r,color.g,color.b);ok=true;format=String(color.r).substr(-1)==="%"?"prgb":"rgb";} else if(color.hasOwnProperty("h")&&color.hasOwnProperty("s")&&color.hasOwnProperty("v")){color.s=convertToPercentage(color.s);color.v=convertToPercentage(color.v);rgb=hsvToRgb(color.h,color.s,color.v);ok=true;format="hsv";} else if(color.hasOwnProperty("h")&&color.hasOwnProperty("s")&&color.hasOwnProperty("l")){color.s=convertToPercentage(color.s);color.l=convertToPercentage(color.l);rgb=hslToRgb(color.h,color.s,color.l);ok=true;format="hsl";} if(color.hasOwnProperty("a")){a=color.a;}} a=boundAlpha(a);return{ok:ok,format:color.format||format,r:mathMin(255,mathMax(rgb.r,0)),g:mathMin(255,mathMax(rgb.g,0)),b:mathMin(255,mathMax(rgb.b,0)),a:a};} function rgbToRgb(r,g,b){return{r:bound01(r,255)*255,g:bound01(g,255)*255,b:bound01(b,255)*255};} function rgbToHsl(r,g,b){r=bound01(r,255);g=bound01(g,255);b=bound01(b,255);var max=mathMax(r,g,b),min=mathMin(r,g,b);var h,s,l=(max+min)/2;if(max==min){h=s=0;} else{var d=max-min;s=l>0.5?d/(2-max-min):d/(max+min);switch(max){case r:h=(g-b)/d+(g1)t-=1;if(t<1/6)return p+(q-p)*6*t;if(t<1/2)return q;if(t<2/3)return p+(q-p)*(2/3-t)*6;return p;} if(s===0){r=g=b=l;} else{var q=l<0.5?l*(1+s):l+s-l*s;var p=2*l-q;r=hue2rgb(p,q,h+1/3);g=hue2rgb(p,q,h);b=hue2rgb(p,q,h-1/3);} return{r:r*255,g:g*255,b:b*255};} function rgbToHsv(r,g,b){r=bound01(r,255);g=bound01(g,255);b=bound01(b,255);var max=mathMax(r,g,b),min=mathMin(r,g,b);var h,s,v=max;var d=max-min;s=max===0?0:d/max;if(max==min){h=0;} else{switch(max){case r:h=(g-b)/d+(g>1))+720)%360;--results;){hsl.h=(hsl.h+part)%360;ret.push(tinycolor(hsl));} return ret;} function monochromatic(color,results){results=results||6;var hsv=tinycolor(color).toHsv();var h=hsv.h,s=hsv.s,v=hsv.v;var ret=[];var modification=1/results;while(results--){ret.push(tinycolor({h:h,s:s,v:v}));v=(v+modification)%1;} return ret;} tinycolor.mix=function(color1,color2,amount){amount=(amount===0)?0:(amount||50);var rgb1=tinycolor(color1).toRgb();var rgb2=tinycolor(color2).toRgb();var p=amount/100;var w=p*2-1;var a=rgb2.a-rgb1.a;var w1;if(w*a==-1){w1=w;}else{w1=(w+a)/(1+w*a);} w1=(w1+1)/2;var w2=1-w1;var rgba={r:rgb2.r*w1+rgb1.r*w2,g:rgb2.g*w1+rgb1.g*w2,b:rgb2.b*w1+rgb1.b*w2,a:rgb2.a*p+rgb1.a*(1-p)};return tinycolor(rgba);};tinycolor.readability=function(color1,color2){var c1=tinycolor(color1);var c2=tinycolor(color2);var rgb1=c1.toRgb();var rgb2=c2.toRgb();var brightnessA=c1.getBrightness();var brightnessB=c2.getBrightness();var colorDiff=(Math.max(rgb1.r,rgb2.r)-Math.min(rgb1.r,rgb2.r)+ Math.max(rgb1.g,rgb2.g)-Math.min(rgb1.g,rgb2.g)+ Math.max(rgb1.b,rgb2.b)-Math.min(rgb1.b,rgb2.b));return{brightness:Math.abs(brightnessA-brightnessB),color:colorDiff};};tinycolor.isReadable=function(color1,color2){var readability=tinycolor.readability(color1,color2);return readability.brightness>125&&readability.color>500;};tinycolor.mostReadable=function(baseColor,colorList){var bestColor=null;var bestScore=0;var bestIsReadable=false;for(var i=0;i125&&readability.color>500;var score=3*(readability.brightness/125)+(readability.color/500);if((readable&&!bestIsReadable)||(readable&&bestIsReadable&&score>bestScore)||((!readable)&&(!bestIsReadable)&&score>bestScore)){bestIsReadable=readable;bestScore=score;bestColor=tinycolor(colorList[i]);}} return bestColor;};var names=tinycolor.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var hexNames=tinycolor.hexNames=flip(names);function flip(o){var flipped={};for(var i in o){if(o.hasOwnProperty(i)){flipped[o[i]]=i;}} return flipped;} function boundAlpha(a){a=parseFloat(a);if(isNaN(a)||a<0||a>1){a=1;} return a;} function bound01(n,max){if(isOnePointZero(n)){n="100%";} var processPercent=isPercentage(n);n=mathMin(max,mathMax(0,parseFloat(n)));if(processPercent){n=parseInt(n*max,10)/100;} if((math.abs(n-max)<0.000001)){return 1;} return(n%max)/parseFloat(max);} function clamp01(val){return mathMin(1,mathMax(0,val));} function parseIntFromHex(val){return parseInt(val,16);} function isOnePointZero(n){return typeof n=="string"&&n.indexOf('.')!=-1&&parseFloat(n)===1;} function isPercentage(n){return typeof n==="string"&&n.indexOf('%')!=-1;} function pad2(c){return c.length==1?'0'+c:''+c;} function convertToPercentage(n){if(n<=1){n=(n*100)+"%";} return n;} function convertDecimalToHex(d){return Math.round(parseFloat(d)*255).toString(16);} function convertHexToDecimal(h){return(parseIntFromHex(h)/255);} var matchers=(function(){var CSS_INTEGER="[-\\+]?\\d+%?";var CSS_NUMBER="[-\\+]?\\d*\\.\\d+%?";var CSS_UNIT="(?:"+CSS_NUMBER+")|(?:"+CSS_INTEGER+")";var PERMISSIVE_MATCH3="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?";var PERMISSIVE_MATCH4="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?";return{rgb:new RegExp("rgb"+PERMISSIVE_MATCH3),rgba:new RegExp("rgba"+PERMISSIVE_MATCH4),hsl:new RegExp("hsl"+PERMISSIVE_MATCH3),hsla:new RegExp("hsla"+PERMISSIVE_MATCH4),hsv:new RegExp("hsv"+PERMISSIVE_MATCH3),hsva:new RegExp("hsva"+PERMISSIVE_MATCH4),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};})();function stringInputToObject(color){color=color.replace(trimLeft,'').replace(trimRight,'').toLowerCase();var named=false;if(names[color]){color=names[color];named=true;} else if(color=='transparent'){return{r:0,g:0,b:0,a:0,format:"name"};} var match;if((match=matchers.rgb.exec(color))){return{r:match[1],g:match[2],b:match[3]};} if((match=matchers.rgba.exec(color))){return{r:match[1],g:match[2],b:match[3],a:match[4]};} if((match=matchers.hsl.exec(color))){return{h:match[1],s:match[2],l:match[3]};} if((match=matchers.hsla.exec(color))){return{h:match[1],s:match[2],l:match[3],a:match[4]};} if((match=matchers.hsv.exec(color))){return{h:match[1],s:match[2],v:match[3]};} if((match=matchers.hsva.exec(color))){return{h:match[1],s:match[2],v:match[3],a:match[4]};} if((match=matchers.hex8.exec(color))){return{a:convertHexToDecimal(match[1]),r:parseIntFromHex(match[2]),g:parseIntFromHex(match[3]),b:parseIntFromHex(match[4]),format:named?"name":"hex8"};} if((match=matchers.hex6.exec(color))){return{r:parseIntFromHex(match[1]),g:parseIntFromHex(match[2]),b:parseIntFromHex(match[3]),format:named?"name":"hex"};} if((match=matchers.hex3.exec(color))){return{r:parseIntFromHex(match[1]+''+match[1]),g:parseIntFromHex(match[2]+''+match[2]),b:parseIntFromHex(match[3]+''+match[3]),format:named?"name":"hex"};} return false;} window.tinycolor=tinycolor;})();$(function(){if($.fn.spectrum.load){$.fn.spectrum.processNativeColorInputs();}});});;(function(root,factory){if(typeof exports==='object'){var randomColor=factory();if(typeof module==='object'&&module&&module.exports){exports=module.exports=randomColor;} exports.randomColor=randomColor;}else if(typeof define==='function'&&define.amd){define([],factory);}else{root.randomColor=factory();}}(this,function(){var seed=null;var colorDictionary={};loadColorBounds();var randomColor=function(options){options=options||{};if(options.seed!==undefined&&options.seed!==null&&options.seed===parseInt(options.seed,10)){seed=options.seed;}else if(typeof options.seed==='string'){seed=stringToInteger(options.seed);}else if(options.seed!==undefined&&options.seed!==null){throw new TypeError('The seed value must be an integer or string');}else{seed=null;} var H,S,B;if(options.count!==null&&options.count!==undefined){var totalColors=options.count,colors=[];options.count=null;while(totalColors>colors.length){if(seed&&options.seed)options.seed+=1;colors.push(randomColor(options));} options.count=totalColors;return colors;} H=pickHue(options);S=pickSaturation(H,options);B=pickBrightness(H,S,options);return setFormat([H,S,B],options);};function pickHue(options){var hueRange=getHueRange(options.hue),hue=randomWithin(hueRange);if(hue<0){hue=360+hue;} return hue;} function pickSaturation(hue,options){if(options.hue==='monochrome'){return 0;} if(options.luminosity==='random'){return randomWithin([0,100]);} var saturationRange=getSaturationRange(hue);var sMin=saturationRange[0],sMax=saturationRange[1];switch(options.luminosity){case'bright':sMin=55;break;case'dark':sMin=sMax-10;break;case'light':sMax=55;break;} return randomWithin([sMin,sMax]);} function pickBrightness(H,S,options){var bMin=getMinimumBrightness(H,S),bMax=100;switch(options.luminosity){case'dark':bMax=bMin+20;break;case'light':bMin=(bMax+bMin)/2;break;case'random':bMin=0;bMax=100;break;} return randomWithin([bMin,bMax]);} function setFormat(hsv,options){switch(options.format){case'hsvArray':return hsv;case'hslArray':return HSVtoHSL(hsv);case'hsl':var hsl=HSVtoHSL(hsv);return'hsl('+hsl[0]+', '+hsl[1]+'%, '+hsl[2]+'%)';case'hsla':var hslColor=HSVtoHSL(hsv);var alpha=options.alpha||Math.random();return'hsla('+hslColor[0]+', '+hslColor[1]+'%, '+hslColor[2]+'%, '+alpha+')';case'rgbArray':return HSVtoRGB(hsv);case'rgb':var rgb=HSVtoRGB(hsv);return'rgb('+rgb.join(', ')+')';case'rgba':var rgbColor=HSVtoRGB(hsv);var alpha=options.alpha||Math.random();return'rgba('+rgbColor.join(', ')+', '+alpha+')';default:return HSVtoHex(hsv);}} function getMinimumBrightness(H,S){var lowerBounds=getColorInfo(H).lowerBounds;for(var i=0;i=s1&&S<=s2){var m=(v2-v1)/(s2-s1),b=v1-m*s1;return m*S+b;}} return 0;} function getHueRange(colorInput){if(typeof parseInt(colorInput)==='number'){var number=parseInt(colorInput);if(number<360&&number>0){return[number,number];}} if(typeof colorInput==='string'){if(colorDictionary[colorInput]){var color=colorDictionary[colorInput];if(color.hueRange){return color.hueRange;}}else if(colorInput.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)){const hue=HexToHSB(colorInput)[0];return[hue,hue];}} return[0,360];} function getSaturationRange(hue){return getColorInfo(hue).saturationRange;} function getColorInfo(hue){if(hue>=334&&hue<=360){hue-=360;} for(var colorName in colorDictionary){var color=colorDictionary[colorName];if(color.hueRange&&hue>=color.hueRange[0]&&hue<=color.hueRange[1]){return colorDictionary[colorName];}}return'Color not found';} function randomWithin(range){if(seed===null){return Math.floor(range[0]+Math.random()*(range[1]+1-range[0]));}else{var max=range[1]||1;var min=range[0]||0;seed=(seed*9301+49297)%233280;var rnd=seed/233280.0;return Math.floor(min+rnd*(max-min));}} function HSVtoHex(hsv){var rgb=HSVtoRGB(hsv);function componentToHex(c){var hex=c.toString(16);return hex.length==1?'0'+hex:hex;} var hex='#'+componentToHex(rgb[0])+componentToHex(rgb[1])+componentToHex(rgb[2]);return hex;} function defineColor(name,hueRange,lowerBounds){var sMin=lowerBounds[0][0],sMax=lowerBounds[lowerBounds.length-1][0],bMin=lowerBounds[lowerBounds.length-1][1],bMax=lowerBounds[0][1];colorDictionary[name]={hueRange:hueRange,lowerBounds:lowerBounds,saturationRange:[sMin,sMax],brightnessRange:[bMin,bMax]};} function loadColorBounds(){defineColor('monochrome',null,[[0,0],[100,0]]);defineColor('red',[-26,18],[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]);defineColor('orange',[19,46],[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]);defineColor('yellow',[47,62],[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]);defineColor('green',[63,178],[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]);defineColor('blue',[179,257],[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]);defineColor('purple',[258,282],[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]);defineColor('pink',[283,334],[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]);} function HSVtoRGB(hsv){var h=hsv[0];if(h===0){h=1;} if(h===360){h=359;} h=h/360;var s=hsv[1]/100,v=hsv[2]/100;var h_i=Math.floor(h*6),f=h*6-h_i,p=v*(1-s),q=v*(1-f*s),t=v*(1-(1-f)*s),r=256,g=256,b=256;switch(h_i){case 0:r=v;g=t;b=p;break;case 1:r=q;g=v;b=p;break;case 2:r=p;g=v;b=t;break;case 3:r=p;g=q;b=v;break;case 4:r=t;g=p;b=v;break;case 5:r=v;g=p;b=q;break;} var result=[Math.floor(r*255),Math.floor(g*255),Math.floor(b*255)];return result;} function HexToHSB(hex){hex=hex.replace(/^#/,'');hex=hex.length===3?hex.replace(/(.)/g,'$1$1'):hex;const red=parseInt(hex.substr(0,2),16)/255,green=parseInt(hex.substr(2,2),16)/255,blue=parseInt(hex.substr(4,2),16)/255;const cMax=Math.max(red,green,blue),delta=cMax-Math.min(red,green,blue),saturation=cMax?(delta/cMax):0;switch(cMax){case red:return[60*(((green-blue)/delta)%6)||0,saturation,cMax];case green:return[60*(((blue-red)/delta)+2)||0,saturation,cMax];case blue:return[60*(((red-green)/delta)+4)||0,saturation,cMax];}} function HSVtoHSL(hsv){var h=hsv[0],s=hsv[1]/100,v=hsv[2]/100,k=(2-s)*v;return[h,Math.round(s*v/(k<1?k:2-k)*10000)/100,k/2*100];} function stringToInteger(string){var total=0 for(var i=0;i!==string.length;i++){if(total>=Number.MAX_SAFE_INTEGER)break;total+=string.charCodeAt(i)} return total} return randomColor;})); (function() { 'use strict'; //==============================Default Settings============================== if (GM_getValue("GB_BGColor") === undefined) { // SetDefaults(); addGoogleFont(GM_getValue("GB_Font")); } function SetDefaults() { var AllSettings = GM_listValues(); for (var AllSettingsIndex = 0, key = null; key = AllSettings[AllSettingsIndex]; AllSettingsIndex++) { GM_deleteValue(key); } GM_setValue("GB_Url1", "https://plus.google.com/"); GM_setValue("GB_Url1text", "+You"); GM_setValue("GB_Url2", "https://www.google.com/webhp"); GM_setValue("GB_Url2text", "Search"); GM_setValue("GB_Url3", "https://www.google.com/imghp"); GM_setValue("GB_Url3text", "Images"); GM_setValue("GB_Url4", "https://www.youtube.com/"); GM_setValue("GB_Url4text", "YouTube"); GM_setValue("GB_Url5", "https://maps.google.com"); GM_setValue("GB_Url5text", "Maps"); GM_setValue("GB_Url6", "https://play.google.com/store"); GM_setValue("GB_Url6text", "Play"); GM_setValue("GB_Url7", "https://news.google.com/"); GM_setValue("GB_Url7text", "News"); GM_setValue("GB_Url8", "https://mail.google.com/"); GM_setValue("GB_Url8text", "Gmail"); GM_setValue("GB_Url9", "https://drive.google.com/drive/"); GM_setValue("GB_Url9text", "Drive"); GM_setValue("GB_Url10", "https://calendar.google.com"); GM_setValue("GB_Url10text", "Calendar"); GM_setValue("GB_Url11", "https://www.amazon.com"); GM_setValue("GB_Url11text", "Amazon"); GM_setValue("GB_Url12", "https://www.facebook.com"); GM_setValue("GB_Url12text", "Facebook"); GM_setValue("GB_DropDownUrl1", "https://greasyfork.org/"); GM_setValue("GB_DropDownUrl1text", "GreasyFork"); GM_setValue("GB_DropDownUrl2", "https://books.google.com/"); GM_setValue("GB_DropDownUrl2text", "Books"); GM_setValue("GB_DropDownUrl3", "https://finance.google.com"); GM_setValue("GB_DropDownUrl3text", "Finance"); GM_setValue("GB_DropDownUrl4", "http://translate.google.com/"); GM_setValue("GB_DropDownUrl4text", "Translate"); GM_setValue("GB_DropDownUrl5", "https://music.google.com"); GM_setValue("GB_DropDownUrl5text", "Music"); GM_setValue("GB_TotalBarLinks", 10); GM_setValue("GB_TotalBarMenuLinks", 5); GM_setValue("GB_Hover", 10); GM_setValue("GB_BGColor", "#333333"); GM_setValue("GB_LColor", "#FFFFFF"); GM_setValue("GB_BColor", "#dd4b39"); GM_setValue('GB_LColMode', "2"); GM_setValue('GB_Pos', "fixed"); GM_setValue('GB_RandCol', "0"); GM_setValue('GB_MenuDisplay', "1"); GM_setValue('GB_Font', "Source Code Pro"); GM_setValue('GB_ColorCycleDuration', 2500); } //==============================Getting Variables============================== var vCurrentWebpage = window.location.href; var vColCycleDuration = GM_getValue("GB_ColorCycleDuration"); var vGoogleBarFontType = GM_getValue("GB_Font"); var vGoogleBarBackgroundColor = GM_getValue("GB_BGColor"); var vGoogleBarLinkColor = GM_getValue("GB_LColor"); var vGoogleBarBorderColor = GM_getValue("GB_BColor"); var vBarPosition = GM_getValue('GB_Pos'); var vMenuDisplay = GM_getValue('GB_MenuDisplay'); var vTotalBarLinks = GM_getValue('GB_TotalBarLinks'); var vTotalMenuLinks = GM_getValue('GB_TotalBarMenuLinks'); var GoogleColorBorder = "#3CBA54" var GoogleColorBorderIndex = 0; var vLinkColorMode = GM_getValue('GB_LColMode'); var vRandomColorMode = GM_getValue('GB_RandCol'); //==============================Reusable Functions============================== function addGoogleFont(FontName) { $("head").append(""); } addGoogleFont(vGoogleBarFontType); function GenerateBarLinksFromGetValues() { var GoogleBarUrls = []; var LinkIndex; var vTotalBarLinks = GM_getValue('GB_TotalBarLinks'); for (LinkIndex = 1; LinkIndex <= GM_getValue("GB_TotalBarLinks"); LinkIndex++) { if (GM_getValue("GB_Url" + LinkIndex + "text") === undefined) { GM_setValue("GB_Url" + LinkIndex + "text", "Title"); GM_setValue("GB_Url" + LinkIndex, "https://www.example.com"); } GoogleBarUrls.push({ "title": GM_getValue("GB_Url" + LinkIndex + "text"), "link": GM_getValue("GB_Url" + LinkIndex) }); } $.each(GoogleBarUrls, function(key, val) { // if (val.LinkIndex.length > 0){ var $li = $("
  • " + val.title + "
  • "); $("#GoogleBar ul").append($li); }); } function GenerateBarMenuLinksFromGetValues() { var GoogleBarDropDownUrls = []; var LinkIndex; for (LinkIndex = 1; LinkIndex <= GM_getValue("GB_TotalBarMenuLinks"); LinkIndex++) { if (GM_getValue("GB_DropDownUrl" + LinkIndex + "text") === undefined) { GM_setValue("GB_DropDownUrl" + LinkIndex + "text", "Title"); GM_setValue("GB_DropDownUrl" + LinkIndex, "https://www.example.com"); } GoogleBarDropDownUrls.push({ "title": GM_getValue("GB_DropDownUrl" + LinkIndex + "text"), "link": GM_getValue("GB_DropDownUrl" + LinkIndex) }); } $.each(GoogleBarDropDownUrls, function(key, val) { // if (val.link.length > 0){ var $DropDownLink = $("" + val.title + ""); $(".dropdown-content").append($DropDownLink); }); if (vMenuDisplay === "0") { $('[name=GBMenuDisplay]').prop('checked', true); $(".dropdown").css("display", "none"); } else if (vMenuDisplay === "1") { $(".dropdown").css("display", "inline-block"); } } function GenerateSetBarLinkInput() { var table = $('
    ').addClass('SettingsGoogleBarLinksTable'); for (var i = 1; i <= GM_getValue("GB_TotalBarLinks"); i++) { var row = $('').html(''); table.append(row); }; $('#tab1').append(table); $('[name*= "barurl"]').keyup(function() { var Urlindex = $('[name*= "barurl"]').index(this); $('.GBLink').eq(Urlindex).attr("href", this.value); GM_setValue('GB_Url' + parseInt(Urlindex + 1) + '', this.value); GenerateExportSettings(); }); $('[name*= "texturl"]').keyup(function() { var Textindex = $('[name*= "texturl"]').index(this); $('.GBLink').eq(Textindex).html(this.value); GM_setValue('GB_Url' + parseInt(Textindex + 1) + 'text', this.value); GenerateExportSettings(); }); for (var i = 1; i <= GM_getValue("GB_TotalBarLinks"); i++) { $('[name = "barurl' + i + '"]').val(GM_getValue('GB_Url' + i + '')); $('[name = "texturl' + i + '"]').val(GM_getValue('GB_Url' + i + 'text')); } } function DestroyAndCreateBarLinksAndSettingInput(){ $(".SettingsGoogleBarLinksTable").remove(); $(".GBLinkBlock").remove(); GenerateBarLinksFromGetValues(); GenerateSetBarLinkInput(); $('.GBLinkBlock').eq(0).css("margin-left", "25px") $(".GBLinkBlock,.dropdown-content a,.GoogleBarDropDownButton").hover(function(e) { $(this).css("background-color", e.type === "mouseenter" ? shadeColor(GM_getValue("GB_BGColor"), parseInt(GM_getValue("GB_Hover"))) : "transparent") }); } function DestroyAndCreateMoreLinksAndSettingInput(){ var GoogleBarUrls = []; $(".SettingsGoogleBarMenuTable").remove(); $(".dropdown-content a").remove(); // $("").remove(); GenerateBarMenuLinksFromGetValues(); GenerateSetBarMenuLinkInputBoxes(); } function GenerateSetBarMenuLinkInputBoxes() { var table = $('
    ').addClass('SettingsGoogleBarMenuTable'); for (var i = 1; i <= GM_getValue("GB_TotalBarMenuLinks"); i++) { var row = $('').html(''); table.append(row); }; $('#tab2').append(table); $('[name*= "DropDownURL"]').keyup(function() { var Urlindex = $('[name*= "DropDownURL"]').index(this); $('.dropdown-content a').eq(Urlindex).attr("href", this.value); GM_setValue('GB_DropDownUrl' + parseInt(Urlindex + 1) + '', this.value); GenerateExportSettings(); }); $('[name*= "DropDownText"]').keyup(function() { var Textindex = $('[name*= "DropDownText"]').index(this); $('.dropdown-content a').eq(Textindex).html(this.value); GM_setValue('GB_DropDownUrl' + parseInt(Textindex + 1) + 'text', this.value); GenerateExportSettings(); }); } function GenerateExportSettings() { var ExportSettingsText = "|===============Google Bar===============|"; ExportSettingsText += "\n" + GM_getValue("GB_BGColor"); ExportSettingsText += "|" + GM_getValue("GB_BColor"); ExportSettingsText += "|" + GM_getValue("GB_LColor"); ExportSettingsText += "|" + GM_getValue('GB_Pos'); ExportSettingsText += "|" + GM_getValue('GB_TotalBarLinks'); ExportSettingsText += "|" + GM_getValue('GB_TotalBarMenuLinks'); ExportSettingsText += "|" + GM_getValue('GB_LColMode'); ExportSettingsText += "|" + GM_getValue('GB_RandCol'); ExportSettingsText += "|" + GM_getValue('GB_MenuDisplay'); ExportSettingsText += "|" + GM_getValue('GB_Font'); ExportSettingsText += "|" + GM_getValue('GB_ColorCycleDuration'); ExportSettingsText += "\n|============Google Bar Links============|\n"; for (var i = 1; i <= GM_getValue("GB_TotalBarLinks"); i++) { ExportSettingsText += GM_getValue('GB_Url' + i) + '|' + GM_getValue('GB_Url' + i + 'text') + "\n"; } ExportSettingsText += "|==========Google Bar More Links=========|\n"; for (var i = 1; i <= GM_getValue("GB_TotalBarMenuLinks"); i++) { ExportSettingsText += GM_getValue('GB_DropDownUrl' + i) + '|' + GM_getValue('GB_DropDownUrl' + i + 'text') + "\n"; } $('#ExportSettings').val(ExportSettingsText); } function extractHostname(url) { var hostname; //find & remove protocol (http, ftp, etc.) and get the hostname if (url.indexOf("://") > -1) { hostname = url.split('/')[2]; } else { hostname = url.split('/')[0]; } //find & remove port number hostname = hostname.split(':')[0]; return hostname; } function shadeColor(color, percent) { var R = parseInt(color.substring(1, 3), 16); var G = parseInt(color.substring(3, 5), 16); var B = parseInt(color.substring(5, 7), 16); R = parseInt(R * (100 + percent) / 100); G = parseInt(G * (100 + percent) / 100); B = parseInt(B * (100 + percent) / 100); R = (R < 255) ? R : 255; G = (G < 255) ? G : 255; B = (B < 255) ? B : 255; var RR = ((R.toString(16).length == 1) ? "0" + R.toString(16) : R.toString(16)); var GG = ((G.toString(16).length == 1) ? "0" + G.toString(16) : G.toString(16)); var BB = ((B.toString(16).length == 1) ? "0" + B.toString(16) : B.toString(16)); return "#" + RR + GG + BB; } function invertColor(hex, bw) { if (hex.indexOf('#') === 0) { hex = hex.slice(1); } // convert 3-digit hex to 6-digits. if (hex.length === 3) { hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]; } if (hex.length !== 6) { throw new Error('Invalid HEX color.'); } var r = parseInt(hex.slice(0, 2), 16), g = parseInt(hex.slice(2, 4), 16), b = parseInt(hex.slice(4, 6), 16); if (bw) { // http://stackoverflow.com/a/3943023/112731 return (r * 0.299 + g * 0.587 + b * 0.114) > 186 ? '#000000' : '#FFFFFF'; } // invert color components r = (255 - r).toString(16); g = (255 - g).toString(16); b = (255 - b).toString(16); // pad each with zeros and return return "#" + padZero(r) + padZero(g) + padZero(b); } function padZero(str, len) { len = len || 2; var zeros = new Array(len).join('0'); return (zeros + str).slice(-len); } function RandomizeBarColor() { var vLinkColorMode = GM_getValue('GB_LColMode'); var vRandomColorMode = GM_getValue('GB_RandCol'); if (vRandomColorMode === "1") { GM_addStyle(`#GoogleBar a,#GearIcon,.GoogleBarDropDownButton{ ms-transition:color ` + vColCycleDuration + `ms linear; transition:color ` + vColCycleDuration + `ms linear; webkit-transition:color ` + vColCycleDuration + `ms linear;} #GoogleBar,.dropdown-content{ ms-transition:background-color ` + vColCycleDuration + `ms linear; transition:background-color ` + vColCycleDuration + `ms linear; webkit-transition:background-color ` + vColCycleDuration + `ms linear;}`); var vLinkColorMode = GM_getValue("GB_LColMode"); var RandomColorCSS = randomColor({ luminosity: 'dark', hue: '' }); $(".GBLinkBlock,.dropdown-content a,.GoogleBarDropDownButton").hover(function(e) { $(this).css("background-color", e.type === "mouseenter" ? "transparent" : "transparent") }); $('#GBColRand').prop('checked', true); $('#GoogleBar,.dropdown-content').css("background-color", RandomColorCSS); $("#GBarColorPicker").spectrum("set", RandomColorCSS); if (vLinkColorMode === "1") { $('#GoogleBar a,#GearIcon,.GoogleBarDropDownButton').css("color", invertColor(RandomColorCSS, "")); $("#GBarLinkColorPicker").spectrum("set", invertColor(RandomColorCSS, "")); } else if (vLinkColorMode === "2") { $('#GoogleBar a,#GearIcon,.GoogleBarDropDownButton').css("color", invertColor(RandomColorCSS, "BW")); $("#GBarLinkColorPicker").spectrum("set", invertColor(RandomColorCSS, "BW")); } else if (vLinkColorMode === "3") {} } else { $(".GBLinkBlock,.dropdown-content a,.GoogleBarDropDownButton").hover(function(e) { $(this).css("background-color", e.type === "mouseenter" ? shadeColor(GM_getValue("GB_BGColor"), parseInt(GM_getValue("GB_Hover"))) : "transparent") }); } } function GoogleBarSearch(SearchURL, SearchPath = 0) { $('[name="q"]').keyup(function KeyUp() { var Gsearchterm = encodeURIComponent(this.value); var Hostname = extractHostname(SearchURL); if (SearchURL.indexOf(SearchPath) > 1) { Hostname = SearchPath; } var SearchURLwQ = SearchURL + Gsearchterm; $('#GoogleBar [href*="' + Hostname + '"]').attr("href", SearchURLwQ); }); } //==============================Initially Create Bar Links============================== function CreateGoogleBar(){ $("html").append(`
      x

      Google Bar Links

      Google Bar Drop Down Menu

      Google Bar Colors


      Bar ColorLink ColorBorder Color

      Google Bar Placement

      Google Bar Font

      Import/Export

      Import

      Export

      `); $("#GoogleBar").append(''); $("#GoogleBar").append('
      '); GenerateBarLinksFromGetValues(); GenerateBarMenuLinksFromGetValues(); GenerateExportSettings(); GenerateSetBarLinkInput(); GenerateSetBarMenuLinkInputBoxes(); addGoogleFont(GM_getValue("GB_Font")); $("#GoogleBar a,.GoogleBarDropDownButton").css("font-family", GM_getValue("GB_Font")); } CreateGoogleBar(); $(document).ready(function() { var allowedKeys = {37: 'left',38: 'up',39: 'right',40: 'down',65: 'a',66: 'b'}; var konamiCode = ['up', 'up', 'down', 'down', 'left', 'right', 'left', 'right', 'b', 'a']; var konamiCodePosition = 0; // a variable to remember the 'position' the user has reached so far. document.addEventListener('keydown', function(e) { // add keydown event listener var key = allowedKeys[e.keyCode]; // get the value of the key code from the key map var requiredKey = konamiCode[konamiCodePosition];// get the value of the required key from the konami code if (key == requiredKey) { // compare the key with the required key konamiCodePosition++; // move to the next key in the konami code sequence if (konamiCodePosition == konamiCode.length) // if the last key is reached, activate cheats activateCheats(); } else konamiCodePosition = 0; }); function activateCheats() { var OneUpAudio = new Audio('http://themushroomkingdom.net/sounds/wav/smw/smw_1-up.wav'); OneUpAudio.play(); OneUpAudio.addEventListener('ended', function() { this.currentTime = 0; this.play(); }, false); } $('[name=GoogleBarFont]').val(GM_getValue("GB_Font")); RandomizeBarColor(); if (vRandomColorMode === "1") { var ColorCycleFunction = setInterval(RandomizeBarColor, vColCycleDuration); } $('[name=GBMenuDisplay]').change(function() { var c = this.checked ? GM_setValue("GB_MenuDisplay", "0") : GM_setValue("GB_MenuDisplay", "1"); if (GM_getValue("GB_MenuDisplay") === "0") { $(".dropdown").css("display", "none"); } else if (GM_getValue("GB_MenuDisplay") === "1") { $(".dropdown").css("display", "inline-block"); } GenerateExportSettings(); }); $('#GBColRand').change(function() { var c = this.checked ? GM_setValue("GB_RandCol", "1") : GM_setValue("GB_RandCol", "0"); if (GM_getValue("GB_RandCol") === "1") { RandomizeBarColor(); ColorCycleFunction = setInterval(RandomizeBarColor, vColCycleDuration); GM_addStyle(`#GoogleBar a,#GearIcon,.GoogleBarDropDownButton{ color:` + GM_getValue('GB_LColor') + `; ms-transition:color ` + vColCycleDuration + `ms linear; transition:color ` + vColCycleDuration + `ms linear; webkit-transition:color ` + vColCycleDuration + `ms linear;} #GoogleBar,.dropdown-content{ background-color:` + GM_getValue('GB_BGColor') + `; ms-transition:background-color ` + vColCycleDuration + `ms linear; transition:background-color ` + vColCycleDuration + `ms linear; webkit-transition:background-color ` + vColCycleDuration + `ms linear;`); } else { $(".GBLinkBlock,.dropdown-content a,.GoogleBarDropDownButton").hover(function(e) { $(this).css("background-color", e.type === "mouseenter" ? shadeColor(GM_getValue("GB_BGColor"), parseInt(GM_getValue("GB_Hover"))) : "transparent") }); $('#GoogleBar a,#GearIcon,.GoogleBarDropDownButton').css("color", GM_getValue('GB_LColor')); $('#GoogleBar,.dropdown-content').css("background-color", GM_getValue('GB_BGColor')); GM_addStyle(`#GoogleBar a,#GearIcon,.GoogleBarDropDownButton{ color:` + GM_getValue('GB_LColor') + `; ms-transition:color 333ms linear; transition:color 333ms linear; webkit-transition:color 333ms linear;} #GoogleBar,.dropdown-content{ background-color:` + GM_getValue('GB_BGColor') + `; ms-transition:background-color 333ms linear; transition:background-color 333ms linear; webkit-transition:background-color 333ms linear;}`); } GenerateExportSettings(); }); $('input[type=radio][name=group-one]').change(function() { if (this.value === "1") { GM_setValue('GB_LColMode', "1"); GM_setValue('GB_LColor', invertColor(GM_getValue('GB_BGColor'), "")); GM_setValue('GB_BGColor', color.toHexString()); GenerateExportSettings(); $('#GoogleBar a,#GearIcon,.GoogleBarDropDownButton').css("color", invertColor(GM_getValue('GB_BGColor'), "")); $('#GoogleBar,.dropdown-content').css("background-color", color.toHexString()); } else if (this.value === "2") { GM_setValue('GB_LColMode', "2"); GM_setValue('GB_LColor', invertColor(GM_getValue('GB_BGColor'), "BW")); GM_setValue('GB_BGColor', color.toHexString()); GenerateExportSettings(); $('#GoogleBar a,#GearIcon,.GoogleBarDropDownButton').css("color", invertColor(GM_getValue('GB_BGColor'), "BW")); $('#GoogleBar,.dropdown-content').css("background-color", color.toHexString()); } else if (this.value === "3") { GM_setValue('GB_LColMode', "3"); GenerateExportSettings(); } }); $('input[type=number][name=BarLinkNumberInput]').bind('keyup input', function() { GM_setValue("GB_TotalBarLinks", this.value); DestroyAndCreateBarLinksAndSettingInput(); GenerateExportSettings(); }); $('input[type=number][name=vColCycleDuration]').bind('keyup input', function() { GM_setValue("GB_ColorCycleDuration;", this.value); clearTimeout(ColorCycleFunction); vColCycleDuration = this.value; ColorCycleFunction = setInterval(RandomizeBarColor, vColCycleDuration); if (vRandomColorMode === "1") { GM_addStyle(`#GoogleBar a,#GearIcon,.GoogleBarDropDownButton{ color:` + GM_getValue('GB_LColor') + `!important; ms-transition:color ` + vColCycleDuration + `ms linear; transition:color ` + vColCycleDuration + `ms linear; webkit-transition:color ` + vColCycleDuration + `ms linear;} #GoogleBar,.dropdown-content{ background-color:` + GM_getValue('GB_BGColor') + `; ms-transition:background-color ` + vColCycleDuration + `ms linear; transition:background-color ` + vColCycleDuration + `ms linear; webkit-transition:background-color ` + vColCycleDuration + `ms linear;}`); } GenerateExportSettings(); }); $('input[type=number][name=BarMenuNumberInput]').bind('keyup input', function() { GM_setValue("GB_TotalBarMenuLinks", this.value); DestroyAndCreateMoreLinksAndSettingInput(); GenerateExportSettings(); }); $('[name=StickyCheckBox]').change(function() { var c = this.checked ? GM_setValue("GB_Pos", "fixed") : GM_setValue("GB_Pos", "absolute"); if (GM_getValue("GB_Pos") === "fixed") { GM_setValue('GB_Pos', "fixed"); } else { GM_setValue('GB_Pos', "absolute"); } $('#GoogleBar').css("position", GM_getValue("GB_Pos")); GenerateExportSettings(); }); $('[name=GoogleBarFont]').change(function() { var fontID = $('[name=GoogleBarFont]').find(":selected").text(); GM_setValue("GB_Font", fontID); addGoogleFont(fontID); $("#GoogleBar a,.GoogleBarDropDownButton").css("font-family", fontID); GenerateExportSettings(); }); $('#ImportSettings').on('input',function(e){ var ImportedSettings = $('#ImportSettings').val(); if (ImportedSettings.startsWith("|===============Google Bar===============|")){ var ImportedRow = ImportedSettings.split(/\r?\n/); var ImportedBarSettings=ImportedRow[1]; var ImportedBarSettingsCell = ImportedBarSettings.split("|"); GM_setValue("GB_BGColor",ImportedBarSettingsCell[0]); GM_setValue("GB_BColor",ImportedBarSettingsCell[1]); GM_setValue("GB_LColor",ImportedBarSettingsCell[2]); GM_setValue("GB_Pos",ImportedBarSettingsCell[3]); GM_setValue("GB_TotalBarLinks",ImportedBarSettingsCell[4]); GM_setValue("GB_TotalBarMenuLinks",ImportedBarSettingsCell[5]); GM_setValue("GB_LColMode",ImportedBarSettingsCell[6]); GM_setValue("GB_RandCol",ImportedBarSettingsCell[7]); GM_setValue("GB_MenuDisplay",ImportedBarSettingsCell[8]); GM_setValue("GB_Font",ImportedBarSettingsCell[9]); GM_setValue("GB_ColorCycleDuration",ImportedBarSettingsCell[10]); $('#GoogleBar,.dropdown-content').css("background-color", ImportedBarSettingsCell[0]); $(".GBLinkBlock,.dropdown-content a,.GoogleBarDropDownButton").hover(function(e) { $(this).css("background-color", e.type === "mouseenter" ? shadeColor(GM_getValue("GB_BGColor"), parseInt(GM_getValue("GB_Hover"))) : "transparent") }); $('.GBLinkActive').css("borderTop", "2px solid " + ImportedBarSettingsCell[1]); $(".GBLinkBlock").hover(function(e) {$(this).css("borderTop", e.type === "mouseenter" ? "2px solid " + ImportedBarSettingsCell[1] : "2px solid transparent")}); $('#GoogleBar a,#GearIcon,.GoogleBarDropDownButton').css("color", ImportedBarSettingsCell[2]); $('#GoogleBar').css("position", ImportedBarSettingsCell[3]); if (ImportedBarSettingsCell[7] === "1") { RandomizeBarColor(); ColorCycleFunction = setInterval(RandomizeBarColor, ImportedBarSettingsCell[10]); GM_addStyle(`#GoogleBar a,#GearIcon,.GoogleBarDropDownButton{ms-transition:color ` + ImportedBarSettingsCell[10] + `ms linear; transition:color ` + ImportedBarSettingsCell[10] + `ms linear; webkit-transition:color ` + ImportedBarSettingsCell[10] + `ms linear;} #GoogleBar,.dropdown-content{ms-transition:background-color ` + ImportedBarSettingsCell[10] + `ms linear; transition:background-color ` + ImportedBarSettingsCell[10] + `ms linear; webkit-transition:background-color ` + ImportedBarSettingsCell[10] + `ms linear;`); }else{ GM_addStyle(`#GoogleBar a,#GearIcon,.GoogleBarDropDownButton{ms-transition:color 400ms linear; transition:color 400ms linear; webkit-transition:color 400ms linear;} #GoogleBar,.dropdown-content{ms-transition:background-color 400ms linear; transition:background-color 400ms linear; webkit-transition:background-color 400ms linear;`); } DestroyAndCreateBarLinksAndSettingInput(); DestroyAndCreateMoreLinksAndSettingInput(); } GenerateExportSettings(); }); if (vLinkColorMode === "1") { $("#ICol").prop("checked", true) } else if (vLinkColorMode === "2") { $("#BWCol").prop("checked", true) } else if (vLinkColorMode === "3") { $("#HPcol").prop("checked", true) } if (vBarPosition === "fixed") { $("#GBPosA").prop("checked", true) } $("#GBarColorPicker").spectrum({ flat: true, color: GM_getValue('GB_BGColor'), showPalette: false, showButtons: false, containerClassName: 'GBBGCP', move: function(color) {; var vLinkColorMode = GM_getValue('GB_LColMode') $(".GBLinkBlock,.dropdown-content a,.GoogleBarDropDownButton").hover(function(e) { $(this).css("background-color", e.type === "mouseenter" ? shadeColor(GM_getValue("GB_BGColor"), parseInt(GM_getValue("GB_Hover"))) : "transparent") }); if (vLinkColorMode === "1") { GM_setValue('GB_BGColor', color.toHexString()); GM_setValue('GB_LColor', invertColor(GM_getValue('GB_BGColor'), "")); $('#GoogleBar a,#GearIcon,.GoogleBarDropDownButton').css("color", invertColor(GM_getValue('GB_BGColor'), "")); $('#GoogleBar,.dropdown-content').css("background-color", color.toHexString()); } else if (vLinkColorMode === "2") { GM_setValue('GB_BGColor', color.toHexString()); GM_setValue('GB_LColor', invertColor(GM_getValue('GB_BGColor'), "BW")); $('#GoogleBar a,#GearIcon,.GoogleBarDropDownButton').css("color", invertColor(GM_getValue('GB_BGColor'), "BW")); $('#GoogleBar,.dropdown-content').css("background-color", color.toHexString()); } else if (vLinkColorMode === "3") { GM_setValue('GB_BGColor', color.toHexString()); $('#GoogleBar').css("background-color", color.toHexString()); } GenerateExportSettings(); } }); $("#GBarLinkColorPicker").spectrum({ flat: true, color: GM_getValue('GB_LColor'), showPalette: false, showButtons: false, containerClassName: 'GBLCP', move: function(color) {; $('#GoogleBar a,#GearIcon,.GoogleBarDropDownButton').css("color", color.toHexString()); GM_setValue('GB_LColor', color.toHexString()); GenerateExportSettings(); } }); $("#GBarBorderColorPicker").spectrum({ flat:true, color: GM_getValue('GB_BColor'), showPalette: false, showButtons: false, containerClassName: 'GBBCP', move: function(color) {; $('.GBLinkActive').css("borderTop", "2px solid " + GM_getValue("GB_BColor")); $(".GBLinkBlock").hover(function(e) { $(this).css("borderTop", e.type === "mouseenter" ? "2px solid " + GM_getValue("GB_BColor") : "2px solid transparent") }); GM_setValue('GB_BColor', color.toHexString()); GenerateExportSettings(); } }); $("#CopyButton").click(function() { var copyText = document.querySelector("#ExportSettings"); copyText.select(); document.execCommand("Copy"); }); $("#GearIcon,#close_button").click(function() { showsettings(); }); $('.tabs .tab-links a').on('click', function(e) { var currentAttrValue = $(this).attr('href'); GoogleColorBorderIndex++ if (GoogleColorBorderIndex === 1) { GoogleColorBorder = "#3CBA54"; } else if (GoogleColorBorderIndex === 2) { GoogleColorBorder = "#f4c20d"; } else if (GoogleColorBorderIndex === 3) { GoogleColorBorder = "#db3236"; } else if (GoogleColorBorderIndex === 4) { GoogleColorBorder = "#4885ed"; GoogleColorBorderIndex = 0 } // Show/Hide Tabs $('.tabs ' + currentAttrValue).slideDown(250); $('.tabs ' + currentAttrValue).siblings().slideUp(250); $("#GBarLinkColorPicker").spectrum("reflow"); $("#GBarColorPicker").spectrum("reflow"); $("#GBarBorderColorPicker").spectrum("reflow"); // Change/remove current tab to active $(this).parent('li').addClass('active').css('borderBottom', '2px solid ' + GoogleColorBorder).siblings().removeClass('active').css('borderBottom', '2px solid transparent'); e.preventDefault(); }); //loop to set value to all inpot boxes }); GoogleBarSearch("https://www.google.com/webhp#q=", "webhp"); GoogleBarSearch("https://www.google.com/search?site=imghp&tbm=isch&q=", "imghp"); GoogleBarSearch("https://books.google.com/?q=", ""); GoogleBarSearch("https://developers.google.com/s/results/?q=", ""); GoogleBarSearch("https://docs.google.com/document/u/0/?q=", ""); GoogleBarSearch("https://drive.google.com/drive/search?q=", ""); GoogleBarSearch("https://earth.google.com/web/search/", ""); GoogleBarSearch("https://www.google.com/finance?q=", "finance"); GoogleBarSearch("https://groups.google.com/forum/#!search/", ""); GoogleBarSearch("https://mail.google.com/mail/u/0/#search/", ""); GoogleBarSearch("https://inbox.google.com/search/", ""); GoogleBarSearch("https://keep.google.com/#search/text ", ""); GoogleBarSearch("https://maps.google.com/?q=", ""); GoogleBarSearch("https://myactivity.google.com/myactivity?q=", ""); GoogleBarSearch("https://news.google.com/news/section?cf=all&q=", ""); GoogleBarSearch("https://patents.google.com/?q=", ""); GoogleBarSearch("https://plus.google.com/s/", ""); GoogleBarSearch("https://photos.google.com/search/", ""); GoogleBarSearch("https://www.google.com/publicdata/directory#!q=", "publicdata"); GoogleBarSearch("https://scholar.google.com/scholar?hl=en&q=", ""); GoogleBarSearch("https://www.google.com/shopping?q=", "shopping"); GoogleBarSearch("https://support.google.com/search?q=", ""); //not gonna work....\/\/\/ //GoogleBarSearch("https://www.google.com/search?tbm=vid&hl=en&source=hp&q=","vid"); //not gonna work..../\/\/\ GoogleBarSearch("https://www.youtube.com/results?search_query=", ""); GoogleBarSearch("https://www.facebook.com/search/top/?q=", ""); GoogleBarSearch("https://www.reddit.com/search?q=", ""); GoogleBarSearch("https://www.amazon.com/s/?field-keywords=", ""); GoogleBarSearch("https://en.wikipedia.org/wiki/", ""); GoogleBarSearch("https://search.yahoo.com/search;?p=", ""); GoogleBarSearch("https://twitter.com/search?q=", ""); GoogleBarSearch("https://www.netflix.com/search?q=", ""); GoogleBarSearch("http://www.ntd.tv/?s=", ""); GoogleBarSearch("http://craigslist.org/search/sss?query=", ""); GoogleBarSearch("https://www.pinterest.com/search/pins/?q=", ""); GoogleBarSearch("http://www.espn.com/search/results?q=", ""); GoogleBarSearch("https://www.pornhub.com/video/search?search=", ""); GoogleBarSearch("http://www.cnn.com/search/?text=", ""); GoogleBarSearch("https://www.bing.com/search?q=", ""); GoogleBarSearch("http://www.imdb.com/find?q=", ""); GoogleBarSearch("https://query.nytimes.com/search/sitesearch/?&pgtype=Homepage#/", ""); GoogleBarSearch("http://stackoverflow.com/search?q=", ""); GoogleBarSearch("https://github.com/search?q=", ""); GoogleBarSearch("http://www.xvideos.com/?k=", ""); GoogleBarSearch("https://xhamster.com/search.php?q=", ""); GoogleBarSearch("https://greasyfork.org/en/scripts?&q=", ""); GoogleBarSearch("https://support.google.com/websearch/search?q=", ""); //https://research.google.com/bigpicture/music/#s%3Arascal%20flatts //play store //alerts function showsettings() { $("#settings_box").fadeToggle(250); $("#settings_box").css({ "visibility": "visible", "display": "block" }); } $('.GBLinkBlock').eq(0).css("margin-left", "25px") GM_addStyle(` #GoogleBar { height: 29px; position: ` + GM_getValue("GB_Pos") + `; top: 0; left: 0; width: 100%; z-index: 2999999998; } .GBLink, .GoogleBarDropDownButton { font-family: ` + vGoogleBarFontType + `; } #GoogleBar *, #settings_box * { font-size: 13px; text-decoration: none; } #GoogleBar h2 { Background-calendar: #ddd!important; } #GoogleBar ul { white-space: nowrap; margin: 0; padding: 0; } .GBLinkBlock { display: block; float: left; height: 27px; line-height: 27px!important; padding-left: 8px; padding-right: 8px; text-align: center; text-align: left; border-top: 2px solid transparent; } .GBLinkBlock:hover { border-top: 2px solid `+vGoogleBarBorderColor+`; } .GBLinkActive { border-top: 2px solid `+vGoogleBarBorderColor+`; } #GoogleBar, .dropdown-content { background-color: ` + vGoogleBarBackgroundColor + `; ms-transition: background-color 400ms ease; transition: background-color 400ms ease; webkit-transition: background-color 400ms ease; } #GoogleBar a, #GearIcon, .GoogleBarDropDownButton { color: ` + GM_getValue('GB_LColor') + `; ms-transition: color 400ms ease; transition: color 400ms ease; webkit-transition: color 400ms ease; } .GoogleBarDropDownButton { background-color: transparent; height: 29px; padding-left: 8px; padding-right: 8px; text-align: center; cursor: pointer; border: solid 0px transparent; } .dropdown { position: relative; } .dropdown-content { box-shadow: 0px 5px 7px 1px rgba(0, 0, 0, 0.2); display: none; min-width: 100px; position: relative; top: 0px; width: auto; z-index: 2999999998; } .dropdown-content a { color: black; display: block; padding: 10px 12px; text-decoration: none; } .dropdown:hover .dropdown-content { display: block; } #GearIcon { display: block; float: right; height: 29px; line-height: 29px!important; padding-left: 8px; padding-right: 8px; text-align: center; text-align: left; font-size: 20px; cursor: pointer; } #H3Right { float: right!important; width: 50%!important; } #H3Left { float: left!important; width: 50%!important; } #settings_box { background-color: #fff!important; border: 1px solid #acacac!important; box-shadow: rgba(0, 0, 0, .3) 0 4px 16px!important; display: none; position: fixed!important; right: 6px!important; top: 35px!important; visibility: hidden; min-width: 420px!important; max-width: 420px!important; z-index: 50000!important; font-family: helvetica, sans-serif; } #settings_box #cancel_button { background-color: grey; border: 1px solid #acacac; border: none; box-shadow: rgba(0, 0, 0, .2) 0 4px 16px; color: white; cursor: pointer; float: right; margin-bottom: 2px!important; margin-right: 2px!important; margin-top: 2px!important; padding: 5px; width: 16px; } #settings_box #info_text { background-color: #eee; clear: both; color: #6E6E6E; padding: 10px!important; } #settings_box h2 { display: block; font-size: 1.5em; font-weight: bold; webkit-margin-after: 0.83em; webkit-margin-before: 0.83em; webkit-margin-end: 0px; webkit-margin-start: 0px; } #settings_box h4 { font-size: 1.5em; font-weight: bold; webkit-margin-after: 0.83em; webkit-margin-before: 0.83em; webkit-margin-end: 0px; webkit-margin-start: 0px; width: 100px; display: table-cell; } #settings_box th, #settings_box td { padding: 0px; background-color: transparent; } #GoogleBarColorLabels { width: 100%; } #GoogleBarColorLabels td { width: 33.333333%; } #SettingsFooter { width: 100%; } #SubmitBug { float: right; } label[for="ICol"] { padding-left: 17px!important; } #settings_box #close_button { color: grey; cursor: pointer; float: right; font-size: 15px; height: 6px; position: relative; width: 11px; } .tabs { display: inline-block; width: 100%; } .tab-links:after { clear: both; content: ''; display: block; } .tab-links { margin: 0; padding: 0; } .tab-links li { float: left; list-style: none; margin: 0px 5px; } .tab-links a { color: #000!important; display: inline-block; font-size: 16px!important; font-weight: 100; padding: 3px 5px!important; padding-bottom: 12px; transition: all linear 0.15s; } .tab-links a:hover { background: #eee; text-decoration: none; } li.active a, li.active a:hover { color: #262626; font-weight: bold; padding-bottom: 18px; font-size: 20px; } .tab-content { background: #fff; border-radius: 3px; box-shadow: -1px 1px 1px rgba(0, 0, 0, 0.15); height: auto; max-height: 666px; overflow: auto; padding: 5px; } .tab { display: none; } .tab.active { display: block; } [name="BarLinkNumberInput"], [name="BarMenuNumberInput"] { margin-left: 5px; width: 30px; } [name=vColCycleDuration] { width: 50px; } #ExportSettings, #ImportSettings { font-size: 11px!important; width: 98%; } #CopyButton{float:right;} [name*="barurl"], [name*="DropDownURL"] { color: black!important; margin-right: 5px; margin-top: 2px; width: 280px!important; } [name*="texturl"], [name*="DropDownText"] { color: black!important; margin-right: 5px; margin-top: 2px; width: 100px!important; } /*====reset css====*/ .gb_eg.gb_eg .gb_Q,.gb_fa{display:none!important;} /*===spectrum=====*/ .sp-container { position: absolute; top: 0; left: 0; display: inline-block; *display: inline; *zoom: 1; z-index: 9999994; overflow: hidden } .sp-container.sp-flat { position: relative } .sp-container, .sp-container * { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box } .sp-top { position: relative; width: 100%; display: inline-block } .sp-top-inner { position: absolute; top: 0; left: 0; bottom: 0; right: 0 } .sp-color { position: absolute; top: 0; left: 0; bottom: 0; right: 20% } .sp-hue { position: absolute; top: 0; right: 0; bottom: 0; left: 84%; height: 100% } .sp-clear-enabled .sp-hue { top: 33px; height: 77.5% } .sp-fill { padding-top: 80% } .sp-sat, .sp-val { position: absolute; top: 0; left: 0; right: 0; bottom: 0 } .sp-alpha-enabled .sp-top { margin-bottom: 18px } .sp-alpha-enabled .sp-alpha { display: block } .sp-clear { display: none } .sp-clear.sp-clear-display { background-position: center } .sp-clear-enabled .sp-clear { display: block; position: absolute; top: 0px; right: 0; bottom: 0; left: 84%; height: 28px } .sp-container, .sp-replacer, .sp-preview, .sp-dragger, .sp-slider, .sp-alpha, .sp-clear, .sp-alpha-handle, .sp-container.sp-dragging .sp-input, .sp-container button { -webkit-user-select: none; -moz-user-select: -moz-none; -o-user-select: none; user-select: none } .sp-container.sp-input-disabled .sp-input-container { display: none } .sp-container.sp-buttons-disabled .sp-button-container { display: none } .sp-container.sp-palette-buttons-disabled .sp-palette-button-container { display: none } .sp-palette-only .sp-picker-container { display: none } .sp-palette-disabled .sp-palette-container { display: none } .sp-initial-disabled .sp-initial { display: none } .sp-sat { background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0))); background-image: -webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0)); background-image: -moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0)); background-image: -o-linear-gradient(left, #fff, rgba(204, 154, 129, 0)); background-image: -ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0)); background-image: linear-gradient(to right, #fff, rgba(204, 154, 129, 0)); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)"; filter: progid: DXImageTransform.Microsoft.gradient(GradientType 1, startColorstr='#FFFFFFFF', endColorstr='#00CC9A81') } .sp-val { background-image: -webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0))); background-image: -webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0)); background-image: -moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0)); background-image: -o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0)); background-image: -ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0)); background-image: linear-gradient(to top, #000, rgba(204, 154, 129, 0)); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)"; filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#00CC9A81', endColorstr='#FF000000') } .sp-hue { background: -moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); background: -ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); background: -o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); background: -webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000)); background: -webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); background: linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%) } .sp-1 { height: 17%; filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#ff0000', endColorstr='#ffff00') } .sp-2 { height: 16%; filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#ffff00', endColorstr='#00ff00') } .sp-3 { height: 17%; filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ffff') } .sp-4 { height: 17%; filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#00ffff', endColorstr='#0000ff') } .sp-5 { height: 16%; filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#0000ff', endColorstr='#ff00ff') } .sp-6 { height: 17%; filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#ff00ff', endColorstr='#ff0000') } .sp-hidden { display: none !important } .sp-cf:before, .sp-cf:after { content: ""; display: table } .sp-cf:after { clear: both } .sp-cf { *zoom: 1 } @media (max-device-width: 480px) { .sp-color { right: 40% } .sp-hue { left: 63% } .sp-fill { padding-top: 60% } } .sp-dragger { border-radius: 10px; height: 5px; width: 5px; border: 1px solid #fff; background: rgba(0,0,0,0.3); cursor: pointer; position: absolute; top: 0; left: 0 } .sp-slider { position: absolute; top: 0px; cursor: pointer; height: 3px; left: -1px; right: -1px; border: 1px solid rgba(255,255,255,0.5); background: rgba(0,0,0,0.3); opacity: 1; } .sp-container { border-radius: 0; border: solid 0px #f0c49B; padding: 0 } .sp-container, .sp-container button, .sp-container input, .sp-color, .sp-hue, .sp-clear { font: normal 12px "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box } .sp-top { margin-bottom: 3px } .sp-color, .sp-hue, .sp-clear { border: solid 1px #666 } .sp-input-container { float: right; width: 100px; margin-bottom: 4px } .sp-initial-disabled .sp-input-container { width: 100% } .sp-input { font-size: 12px !important; border: 1px inset; padding: 4px 5px; margin: 0; width: 100%; background: transparent; border-radius: 3px; color: #222 } .sp-input:focus { border: 1px solid orange } .sp-input.sp-validation-error { border: 1px solid red; background: #fdd } .sp-picker-container, .sp-palette-container { float: left; position: relative; padding: 1px; padding-bottom: 300px; margin-bottom: -290px } .sp-picker-container { width: 130px; border-left: solid 1px #fff } .sp-palette-container { border-right: solid 1px #ccc } .sp-palette-only .sp-palette-container { border: 0 } .sp-palette .sp-thumb-el { display: block; position: relative; float: left; width: 24px; height: 15px; margin: 3px; cursor: pointer; border: solid 2px transparent } .sp-palette .sp-thumb-el:hover, .sp-palette .sp-thumb-el.sp-thumb-active { border-color: orange } .sp-thumb-el { position: relative } .sp-initial { float: left; border: solid 1px #333 } .sp-initial span { width: 30px; height: 25px; border: none; display: block; float: left; margin: 0 } .sp-initial .sp-clear-display { background-position: center } .sp-palette-button-container, .sp-button-container { float: right } .sp-dd { padding: 2px 0; height: 16px; line-height: 16px; float: left; font-size: 10px } .sp-container { padding-bottom: 0 } .sp-palette span:hover, .sp-palette span.sp-thumb-active { border-color: #000 } .sp-preview, .sp-alpha, .sp-thumb-el { position: relative; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==) } .sp-preview-inner, .sp-alpha-inner, .sp-thumb-inner { display: block; position: absolute; top: 0; left: 0; bottom: 0; right: 0 } .sp-palette .sp-thumb-inner { background-position: 50% 50%; background-repeat: no-repeat } .sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=) } .sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=) } .sp-clear-display { background-repeat: no-repeat; background-position: center; background-image: url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==) }`); //================Keep //================Keep //================Keep $('.GBLinkBlock a').each(function(){ var $this = $(this); // if the current path is like this link, make it active if($this.attr('href')===vCurrentWebpage){ $this.parent().addClass('GBLinkActive'); } }); if (vCurrentWebpage == "https://www.google.com/") { GM_addStyle(` body{position:relative!important; top:29px!important;} `); } else if (/google.{2,14}about\/products/.test(vCurrentWebpage) == true || /google.{2,14}policies\//.test(vCurrentWebpage) == true || /google.{2,14}ads\//.test(vCurrentWebpage) == true || /google.{2,14}safetycenter\//.test(vCurrentWebpage) == true || /google.{2,14}about\//.test(vCurrentWebpage) == true || /.greasyfork.{2,6}/.test(vCurrentWebpage) == true || /calendar.google.{2,6}/.test(vCurrentWebpage) == true || /duo.google.{2,6}/.test(vCurrentWebpage) == true || /google.{2,6}#q=/.test(vCurrentWebpage) == true || /google.{2,6}#safe/.test(vCurrentWebpage) == true || /google.{2,6}?ei=/.test(vCurrentWebpage) == true || /google.{2,6}adsense/.test(vCurrentWebpage) == true || /google.{2,6}adwords/.test(vCurrentWebpage) == true || /google.{2,6}alerts/.test(vCurrentWebpage) == true || /google.{2,6}analytics/.test(vCurrentWebpage) == true || /google.{2,6}business/.test(vCurrentWebpage) == true || /google.{2,6}chrome\//.test(vCurrentWebpage) == true || /google.{2,6}earth\//.test(vCurrentWebpage) == true || /google.{2,6}finance/.test(vCurrentWebpage) == true || /google.{2,6}flights/.test(vCurrentWebpage) == true || /google.{2,6}imghp/.test(vCurrentWebpage) == true || /google.{2,6}preferences/.test(vCurrentWebpage) == true || /google.{2,6}settings/.test(vCurrentWebpage) == true || /google.{2,6}search/.test(vCurrentWebpage) == true || /google.{2,6}shopping/.test(vCurrentWebpage) == true || /google.{2,6}videohp/.test(vCurrentWebpage) == true || /google.{2,6}webhp/.test(vCurrentWebpage) == true || /adwords.google.{2,6}/.test(vCurrentWebpage) == true || /classroom.google.{2,6}/.test(vCurrentWebpage) == true || /mail.google.{2,6}/.test(vCurrentWebpage) == true || /myaccount.google.{2,6}/.test(vCurrentWebpage) == true || /news.google.{2,6}/.test(vCurrentWebpage) == true || /privacy.google.{2,6}/.test(vCurrentWebpage) == true || /play.google.{2,6}music/.test(vCurrentWebpage) == true || /support.google.{2,6}/.test(vCurrentWebpage) == true || /translate.google.{2,6}/.test(vCurrentWebpage) == true ) { GM_addStyle(` body{position:relative!important; top:29px!important;} `); } else if (/google.{2,14}about\/products/.test(vCurrentWebpage) == true) { GM_addStyle(` .products .glue-sticky.glue-sticky-active{top:98px!important;} .fixed-nav{top:29px!important;} body{position:relative!important; top:29px!important;} `); } else if (/google.{2,6}maps/.test(vCurrentWebpage) == true) { GM_addStyle(` #omnibox, .gb_6f{top:29px!important;} `); } else if (/google.{2,6}express/.test(vCurrentWebpage) == true) { GM_addStyle(` body{position:relative!important; top:29px!important;} .header,.stickyMobileHeader .mobileSearchWrapper,.mobileNavHeader{top:29px!important;} #GoogleBar{position:fixed!important;} `); } else if (/google.{2,6}forms/.test(vCurrentWebpage) == true || /google.{2,6}slides/.test(vCurrentWebpage) == true || /google.{2,6}sheets/.test(vCurrentWebpage) == true || /google.{2,6}docs/.test(vCurrentWebpage) == true || /google.{2,6}services/.test(vCurrentWebpage) == true || /google.{2,6}cloudprint/.test(vCurrentWebpage) == true ) { GM_addStyle(` body{position:relative!important; top:29px!important;} .header,.stickyMobileHeader .mobileSearchWrapper,.mobileNavHeader{top:29px!important;} #GoogleBar{position:fixed!important;} `); } else if (/store.google.{2,6}/.test(vCurrentWebpage) == true) { GM_addStyle(` body{position:relative!important; top:29px!important;} .sticky-stacky,.nav-panel{top:29px!important;} #GoogleBar{position:fixed!important;} `); } else if (/photos.google.{2,6}/.test(vCurrentWebpage) == true) { GM_addStyle(` body{position:relative!important; top:29px!important;} .SmZ4Wd,.scwMhd{top:29px;} #GoogleBar{position:fixed!important;} `); } else if (/docs.google.{2,6}/.test(vCurrentWebpage) == true) { GM_addStyle(` body{position:relative!important; top:29px!important;} .gb_qd{top:29px;} #GoogleBar{position:fixed!important;} `); } else if (/drive.google.{2,6}/.test(vCurrentWebpage) == true) { GM_addStyle(` body{position:relative!important; top:20px!important;} .a-D-Pe-Q{top:29px!important;} .a-s-tb-Pe-Q{top:8px!important;} #GoogleBar{position:fixed!important;} `); } else if (/keep.google.{2,6}/.test(vCurrentWebpage) == true) { GM_addStyle(` body{position:relative!important; top:29px!important;} .gb_qd{top:29px!important;} #GoogleBar{position:fixed!important;} `); } else if (/contacts.google.{2,6}/.test(vCurrentWebpage) == true) { GM_addStyle(` body{position:relative!important; top:29px!important;} #GoogleBar{position:fixed!important;} `); } else if (/books.google.{2,6}/.test(vCurrentWebpage) == true) { GM_addStyle(` .gb_6f{top:29px!important;} `); } else if (/voice.google.{2,6}/.test(vCurrentWebpage) == true || /.google.{2,6}voice/.test(vCurrentWebpage) == true) { GM_addStyle(` body{position:relative!important; top:29px!important;} `); } else if (/youtube.{2,6}/.test(vCurrentWebpage) == true) { GM_addStyle(` #masthead-container{top:29px!important;} #guide-spacer,#page-manager { margin-top: var(--ytd-masthead-height, 85px) !important;} #GoogleBar{position:fixed!important;} `); } else if (/youtube.{2,6}watch/.test(vCurrentWebpage) == true) { GM_addStyle(` #masthead-container,#contentContainer.app-drawer{top:29px!important;} `); } else if (/plus.google.{2,6}/.test(vCurrentWebpage) == true) { GM_addStyle(` .Wxeofe, /*Google Plus Images*/ .KXqTuf{top:29px!important;} .u5oEgd{top:120px!important;} #GoogleBar{position:fixed!important;} `); } else if (/google.{2,20}chromecast/.test(vCurrentWebpage) == true || /allo.google.{2,6}/.test(vCurrentWebpage) == true || /google.{2,20}chromebook/.test(vCurrentWebpage) == true ) { GM_addStyle(` header{top:29px!important;} body{position:relative!important; top:29px!important;} #GoogleBar{position:fixed!important;} `); } else if (/google.{2,10}chrome\/newtab/.test(vCurrentWebpage) == true) { GM_addStyle(` body{position:relative!important; top:10px!important;} `); } else if (/play.google.{2,6}store/.test(vCurrentWebpage) == true) { var vBarPosition = GM_getValue('GB_Pos'); //play nested if if (vBarPosition === "fixed") { GM_addStyle(` body{position:relative!important; top:29px!important;} .sticky,.action-bar{top:29px!important;} `); } GM_addStyle(` body{position:relative!important; top:29px!important;} `); } })();