|
View:
New views
1 Messages
—
Rating Filter:
Alert me
|
|
|
Moving buttons help :(Hi i recently downloaded the "Turn off the lights" youtube script for greasemonkey and I'm having problems with it
as you can see i use adblock plus and the buttons are a little 2 close for comfort notgood1.jpg also the buttons being there can sometimes trigger my real player download button to appear and block me from hitting it witch gets really annoying notgood2.jpg as you can see i didn't come running to the forums first thing crying like a little baby...i actually did some searching on google but to no avail :( triedgoogle.jpg so would one of you grease monkey guru's please help me out :D ty for reading and hope to hear from you soon :) P.S. this is the source if you need it // ==UserScript== // @name Turn Off the Lights // @author Tayfun Sen // @namespace tayfunsen.com // @version 0.2 // @description Enabling the lights out feature on YouTube on every video. // @source http://userscripts.org/scripts/show/49726 // @license GPL 2 or later // @include http://*.youtube.com/watch?* // @include http://youtube.com/watch?* // ==/UserScript== // // YouTube Lights-Out user script. // This is a Greasemonkey user script. // // To install, you need Greasemonkey: // https://addons.mozilla.org/en-US/firefox/addon/748 // // -------------------------------------------------- // // Started with me wanting the "lights out" feature on many videos that I like. // It is currently found on some YouTube videos but not all of them. // // Copyright (c) 21 May 2009, Tayfun Sen // See my web site: http://blog.tayfunsen.com (mostly in Turkish, sorry!) // // // Released under the GPL license // http://www.gnu.org/copyleft/gpl.html // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. (function(){ // Add longform style if it is not already existing. var vidTitleEl = document.getElementById("watch-vid-title"); if (vidTitleEl.getAttribute("class").indexOf("longform") == -1) { vidTitleEl.setAttribute("class", vidTitleEl.getAttribute("class") + " longform"); } // Get the child element whose children will be the new buttons. var buttonsEl = document.getElementById("watch-longform-buttons"); if (buttonsEl == null) { // YouTube pages must have changed. An update is needed then. return 0; } // Here comes the buttons. var lights_off_switch = document.createElement('div'); lights_off_switch.setAttribute('id', 'lights-off-switch'); lights_off_switch.setAttribute('class', 'reverse-tooltip-wrapper'); lights_off_switch.setAttribute('style', "z-index: 0;"); lights_off_switch.innerHTML = '<button id="watch-longform-lights-off" class="master-sprite" onmouseout="toggleSimpleTooltip(this, false)" onmouseover="toggleSimpleTooltip(this, true)" onclick="toggleLights(true); this.blur()"/> \ <div class="reverse-tooltip-wrapper-box hid" style="display: none;"> \ <div class="reverse-tooltip-box" style="background-image: url(/img/tooltip-reverse.gif);">Turn down the lights</div> \ </div>'; var lights_on_switch = document.createElement('div'); lights_on_switch.setAttribute('id', 'lights-on-switch'); lights_on_switch.setAttribute('class', 'reverse-tooltip-wrapper'); lights_on_switch.setAttribute('style', "z-index: 0;"); lights_on_switch.innerHTML = '<button id="watch-longform-lights-on" class="master-sprite" onmouseout="toggleSimpleTooltip(this, false)" onmouseover="toggleSimpleTooltip(this, true)" onclick="toggleLights(false); this.blur()"/> \ <div class="reverse-tooltip-wrapper-box hid" style="display: none;"> \ <div class="reverse-tooltip-box" style="background-image: url(/img/tooltip-reverse.gif);">Turn up the lights</div> \ </div>'; var player_toggle_switch = document.createElement('div'); player_toggle_switch.setAttribute('id', 'player-toggle-switch'); player_toggle_switch.setAttribute('class', 'reverse-tooltip-wrapper'); player_toggle_switch.setAttribute('style', "z-index: 0;"); player_toggle_switch.innerHTML = '<button id="watch-longform-player" class="master-sprite" onmouseout="toggleSimpleTooltip(this, false)" onmouseover="toggleSimpleTooltip(this, true)" onclick="toggleWidePlayer(!hasClass(_gel(\'baseDiv\'), \'watch-wide-mode\')); return false"/> \ <div class="reverse-tooltip-wrapper-box hid" style="display: none;"> \ <div class="reverse-tooltip-box" style="background-image: url(/img/tooltip-reverse.gif);">Change Player Size</div> \ </div>'; // Get the place to insert the buttons: // Currently buttons are inserted as the first buttons. var insertionPlace = buttonsEl.firstChild; // Add toggle view button. if (document.getElementById('player-toggle-switch') == null) { // Add the toggle video button. buttonsEl.insertBefore(player_toggle_switch, insertionPlace); } // Enable the lights out feature if it is not already enabled. if (document.getElementById('lights-off-switch') == null) { // Add the lights-off buttons. buttonsEl.insertBefore(lights_off_switch, insertionPlace); buttonsEl.insertBefore(lights_on_switch, insertionPlace); // Also add the needed JS var headEl = document.getElementsByTagName("head")[0]; var newScript = document.createElement('script'); newScript.type = "text/javascript"; newScript.innerHTML = 'function toggleLights(lightsOff) { \ if (lightsOff) { \ addClass(document.body, \'watch-lights-off\'); \ } else { \ removeClass(document.body, \'watch-lights-off\'); \ } \ \ if (!lightsOff) { \ hideDiv(\'watch-longform-shade\'); \ } else { \ _gel(\'watch-longform-shade\').style.height = parseInt(_gel(\'baseDiv\').offsetHeight) + \'px\'; \ showDiv(\'watch-longform-shade\'); \ } \ }'; // Append this JS headEl.appendChild(newScript); // Append the shade div as well. if (document.getElementById('watch-longform-shade') == null) { var shadeEl = document.createElement('div'); shadeEl.setAttribute("id","watch-longform-shade"); shadeEl.style.display = "none"; var baseDivEl = document.getElementById("baseDiv"); baseDivEl.appendChild(shadeEl); } } })(); |
| Free embeddable forum powered by Nabble | Forum Help |