|
|
Hi, I need some help, This script adds a link in youtube that says "cinema Toggle" (down below) But I want to use a key to toggle cinema mode, like F7 for example. Can anyone help me? thanks alot in advance :) // ==UserScript==
";
';
var sh="Cinema Toggle"; var db=document.body; var lc=document.getElementById('util-links'); db.style.height="100%"; lc.innerHTML=sh+lc.innerHTML; db.innerHTML=h+db.innerHTML+' var a=document.getElementById('cinema_a'); var s=document.getElementById('cinema_l'); var o=document.getElementById('cinema_o'); e.fo=function(selector, time, destroy) { var object = document.getElementById(selector); if (e.f_out == undefined) { e.f_out = false; } if (object.style.opacity == '' || object.style.opacity == undefined) { object.style.opacity = parseInt(1); } if (e.f_out === false) { var changes = Math.ceil(time / 50); e.fo_change = object.style.opacity / changes; e.fo_opacity = object.style.opacity; e.f_out = true; } e.fo_opacity = e.fo_opacity - e.fo_change; object.style.opacity = e.fo_opacity; time = time - 50; if (time > 0) { setTimeout(e.fo, 50, selector, time, destroy); } else { object.style.opacity = 0; if (destroy === true) { object.parentNode.removeChild(object); } else { object.style.display = 'none'; } e.f_out = false; } return true; } e.fi=function(selector, time) { var object = document.getElementById(selector); if (e.f_in == undefined) { e.f_in = false; } if (e.f_in === false) { object.style.opacity = parseInt(0); object.style.display = ''; var changes = Math.ceil(time / 50); e.fi_change = 1/changes; e.fi_opacity = parseInt(object.style.opacity); e.f_in = true; } e.fi_opacity = e.fi_opacity + e.fi_change; object.style.opacity = e.fi_opacity; time = time - 50; if (time > 0) { setTimeout(e.fi, 50, selector, time); } else { object.style.opacity = 1; e.f_in = false; } return true; } function toggle() { var od=document.getElementById('cinema_o'); if (v===false) { o.style.backgroundColor="rgba(0,0,0,0.8)"; e.fi('cinema_o',100); v=1; return; } else if(v==1) { o.style.backgroundColor="#000000"; v=2; return; }
|
|
|
This will add F7 to the toogle. Furthermore, please read this if you post again. |
|
|
THANKS! there's only one problem with the script, you have to press the link "Cinema Toggle" before you can use the key toggle "F7", would be greatful if you fixed it :) I read the guidelines, and I'm sorry. |