Last active
January 5, 2017 07:23
-
-
Save sirtony/d46ea4e2e43940a78c9e to your computer and use it in GitHub Desktop.
Revisions
-
sirtony revised this gist
Jan 5, 2017 . 1 changed file with 35 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,28 +1,56 @@ // ==UserScript== // @name Togethertube Fullscreen // @namespace https://github.com/SirTony // @version 0.2 // @description Enables fullscreen on togethertube.com // @author Tony J. Ellis // @match https://togethertube.com/rooms/* // @grant none // @require https://cdnjs.cloudflare.com/ajax/libs/URI.js/1.18.4/URI.min.js // @require https://cdnjs.cloudflare.com/ajax/libs/URI.js/1.18.4/SecondLevelDomains.min.js // ==/UserScript== let registeredClick = false; $( "div#bs-example-navbar-collapse-1:nth-of-type(1) ul.nav.navbar-nav.navbar-right" ) .append( "<li><a id=\"btn-fullscreen\"><i class=\"fa fa-arrows-alt\"></i></a></li>" ); $( "a#btn-fullscreen" ).click( function() { var frame = $( "div#player div iframe" )[0]; var func = frame.requestFullscreen || frame.mozRequestFullScreen || frame.msRequestFullscreen || frame.webkitRequestFullScreen; if( typeof func !== "function" ) { alert( "Fullscreen not available" ); return; } func.call( frame ); } ); const search = $( "#videoSearchInput" ); search.on( "input", function() { const url = URI.parse( search.val() ); if( !url.hostname ) return; ( function() { /* Brute-force this event by trying to register it constantly until it works because togethertube is a huge pain in the ass */ const buttonId = setInterval( function() { const voteUpButton = $( "div[data-ng-hide='searchInProgress'].ng-isolate-scope button.btn.btn-success.btn-block" ); if( voteUpButton.length === 0 ) return; voteUpButton.click( function() { angular.element( document.getElementById( "videoSearchInput" ) ).scope().videoSearchInput = ""; } ); clearInterval( buttonId ); }, 1 ); } )(); } ); -
sirtony revised this gist
Oct 16, 2015 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,10 @@ $( "div#bs-example-navbar-collapse-1:nth-of-type(1) ul.nav.navbar-nav.navbar-rig $( "a#btn-fullscreen" ).click( function() { var frame = $( "div#player div iframe" )[0]; var func = frame.requestFullscreen || frame.mozRequestFullScreen || frame.msRequestFullscreen || frame.webkitRequestFullScreen; if( typeof func !== "function" ) { -
sirtony created this gist
Oct 16, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ // ==UserScript== // @name Togethertube Fullscreen // @namespace https://github.com/SirTony // @version 0.1 // @description Enables fullscreen on togethertube.com // @author Tony J. Ellis // @match https://togethertube.com/rooms/* // @grant none // ==/UserScript== $( "div#bs-example-navbar-collapse-1:nth-of-type(1) ul.nav.navbar-nav.navbar-right" ) .append( "<li><a id=\"btn-fullscreen\"><i class=\"fa fa-arrows-alt\"></i></a></li>" ); $( "a#btn-fullscreen" ).click( function() { var frame = $( "div#player div iframe" )[0]; var func = frame.requestFullscreen || frame.mozRequestFullScreen || frame.msRequestFullscreen || frame.webkitRequestFullScreen; if( typeof func !== "function" ) { alert( "Fullscreen not available" ); return; } func.call( frame ); } );