cb-mini

Minimize menus, hide banners and maximize the cam screen on chaturbate.com

2016/03/02のページです。最新版はこちら

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @author       @leoncastro
// @namespace    https://github.com/leoncastro
// @name         cb-mini
// @version      0.05
// @description  Minimize menus, hide banners and maximize the cam screen on chaturbate.com
// @icon         https://github.com/leoncastro/us-cb/raw/master/img/icon.png
// @require      https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js
// @include      /^(?:https?:)?\/\/(?:[^\.\/]*\.)*chaturbate\.com\/*.*/
// @exclude      /^(?:https?:)?\/\/(?:public|blog|shop)\.chaturbate\.com\/*.*/
// @compatible   firefox+greasemonkey
// @compatible   chrome+tampermonkey
// @grant        none
// @run-at       document-start
// ==/UserScript==
/*
 v0.01: hide popup (body div#main div#overlay)+(body div#main div#entrance_terms)
        hide banner top (body div#header div.ad)
        edit logo (body div#header div.section div.logo-zone strong.logo), smaller
        hide slogan (body div#header div.section div.logo-zone strong.logo+strong)
        hide main menu (body div#header div.nav-bar), except login
        hide sub menu advanced items (body div#main div.top-section div.advanced_search_button_shell)
        edit sub menu position (body div#main div.top-section ul.sub-nav)
        hide banner right (body div#main div.content div.ad)
        hide contents footer extra info (body div#main divcontent div.featured_blog_posts)+(body div#main divcontent div.featured_text)
        resize contents (body div#main div.content)
        hide banner botom (body div#main div.banner)
        hide footer (body div#footer-holder)
 v0.02: make sub menu with blue style like main menu
        style(body div#main div.top-section ul.sub-nav li a) = style(body div#header div.nav-bar ul#nav li a)
        hide login menu too (body div#header div.nav-bar li.login-link)|(body div#header div.nav-bar)
 v0.03: edit sub menu position, now is fixed
 v0.04: require jquery, rewrite some vanilla-js
        remove redirection in external links (a[href^="/external_link/?url="])
        make player on top of bio elements with absolute or fixed position (element.style.position=absolute|fixed)
        add login (body div#header div.nav-bar ul#nav li.login-link) to sub-menu (body div#main div.top-section ul.sub-nav)
        remove watermark on flash video
        remove tip sound
        add a scroll-to-top button
        add href to profile menu link
 v0.05: [css] edit style in home page preview to make it more compact
        [ js] add broadcast menu (body div#header div.nav-bar ul#nav li a[href^="/b/"]) to sub-menu (body div#main div.top-section ul.sub-nav)
        [ js] script optimized for add login in sub-menu
        [css] edit style of scroll-to-top button, now is blue, to make more difference with normal paging buttons
        [css] add paging styles with background, thinking on nightly version
        [ js][css] change style in the night (early nightly version; for now, only background)
        [css] enable advanced search
        [ js] fix absolute image processing
*/
// // fast vanilla-js code:
// set styles
function add_css(css,id)
{
 var dad,obj;
 dad=document.getElementsByTagName('head')[0];
 dad||(dad=document);
 if(id&&(obj=document.getElementById(id)))
 {
  obj.innerHTML=css;
 }
 else
 {
  obj=document.createElement('style');
  id&&obj.setAttribute('id',id);
  obj.setAttribute('type','text/css');
  obj.innerHTML=css;
  dad.appendChild(obj);
 }
}
add_css('\
body{min-width:0!important}\
body.night{background-color:#7f7f7f}\
#header .ad{display:none!important}\
#header .section{position:fixed;top:0;width:100%;height:36px!important;padding-top:3px;background:#0c6a93;border-bottom:3px solid #f47321;z-index:9900}\
#header .section .logo-zone{padding:0 15px}\
#header .section .logo-zone .logo{width:100px;height:39px;padding:0;background-image:url("https://ssl-ccstatic.highwebmedia.com/images/flashwatermark.png")}\
#header .section .logo-zone .logo+strong{display:none}\
#header .nav-bar{display:none}\
#main{padding-top:42px}\
#main .top-section{position:fixed;top:0;height:39px;margin-left:140px;padding:0;overflow:hidden;background:#0c6a93;border-bottom:3px solid #f47321;font:inherit;z-index:9900}\
#main .top-section:after{display:inherit;content:inherit;clear:inherit}\
#main .top-section .advanced_search_button_shell{top:10px;right:0;width:20px;height:20px}\
#main .top-section .advanced_search_button,#main .top-section .hide_advanced_search_button{color:transparent}\
#main .top-section .advanced_search_button:after,\
#main .top-section .hide_advanced_search_button:after{position:absolute;top:0;left:0;font:1.166em "UbuntuMedium",Arial,Helvetica,sans-serif;text-shadow:1px 1px 0 #000;color:#fff;font-weight:900;cursor:pointer}\
#main .top-section .advanced_search_button:after{content:"+";font-size:2em}\
#main .top-section .hide_advanced_search_button:after{content:"--";font-size:2em}\
#main .top-section .actions{display:none}\
#main .top-section .sub-nav{display:inline-block;position:relative;top:inherit;min-width:0;height:inherit;overflow:inherit;margin:0;padding:6px 0 0;list-style:none;text-shadow:1px 1px 0 #000;font:1.166em "UbuntuMedium",Arial,Helvetica,sans-serif;line-height:30px;z-index:9900}\
#main .top-section .sub-nav li{height:30px;margin:0 20px 0 0;padding:0;line-height:30px}\
#main .top-section .sub-nav li.active{position:relative;margin-right:25px;padding:3px 15px 0 15px;background:#f47321;color:#fff;border-radius:4px 4px 0 0;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0}\
#main .top-section .sub-nav li.selected{font-size:inherit}\
#main .top-section .sub-nav li a{float:left;height:100%;padding:0;background:transparent;color:#fff;border:none;border-radius:none;-webkit-border-radius:none;-moz-border-radius:none;cursor:pointer}\
#main .top-section .sub-nav li a:hover{background:transparent;color:#fff;border-bottom:none;text-decoration:underline}\
#main .top-section .sub-nav li.active a{margin:0;padding:0;background:none;text-decoration:none}\
#main .content{padding:4px!important}\
#main .content .ad{display:none}\
#main .content .ad.top_tags{display:none}\
#main .content .advanced_search_options input#id_show_location, label[for="id_show_location"]{display:none}\
#main .content .c-1{margin:0!important}\
#main .content .c-1>div>h2:empty{margin:0}\
#main .content .c-1 .list{min-width:0!important}\
#main .content .c-1 .list>li{margin:0 0 5px 5px!important}\
#main .content .c-1 .list .thumbnail_label,\
#main .content .c-1 .list .thumbnail_label_featured{top:3px}\
#main .content .c-1 .list .details{position:absolute;bottom:0;width:174px;padding:3px}\
#main .content .c-1 .list .details .title{border:none!important}\
#main .content .c-1 .list .details .title>a{position:absolute;left:3px;bottom:3px;width:auto;max-width:135px;min-height:16px;padding:1px 3px;overflow:hidden;text-overflow:ellipsis;background-color:rgba(252,234,219,0.8)}\
#main .content .c-1 .list .title .age{position:absolute;right:3px;bottom:3px;background-color:rgba(252,234,219,0.8)}\
#main .content .c-1 .list>li .details .subject{visibility:hidden;width:174px;height:32px}\
#main .content .c-1 .list>li:hover .details .subject{visibility:visible;margin-bottom:2px;}\
#main .content .c-1 .list>li .details .subject li{width:174px;height:32px;background-color:rgba(252,234,219,0.8);border-radius:0}\
#main .content .c-1 .list>li .details .subject li:empty{display:none}\
#main .content .c-1 .list .thumbnail_label_exhibitionist+.details .subject{display:none}\
#main .content .c-1 .list .details .sub-info{visibility:hidden;width:174px;height:12px;background-color:rgba(252,234,219,0.8)}\
#main .content .c-1 .list>li:hover .details .sub-info{visibility:visible;margin-bottom:20px;}\
#main .content .c-1 .list>li .thumbnail_label,\
#main .content .c-1 .list>li .details>ul{opacity:0.5; -webkit-transition:all 0.5s ease-in-out;transition:all 0.5s ease-in-out;}\
#main .content .c-1 .list>li:hover .thumbnail_label,\
#main .content .c-1 .list>li:hover .details>ul{opacity:1}\
#main .content .c-1 .paging a:hover{background-color:#fff;border-color:#dc5500}\
#main .content .c-1 .paging .active a{background-color:#dc5500!important;color:#fff!important;border-color:#dc5500!important}\
#main .content .c-1 .section .video-box #player{z-index:90}\
#main .content .paging.to_top{position:fixed!important;bottom:10px;right:10px;opacity:1; -webkit-transition:all 0.5s ease-in-out;transition:all 0.5s ease-in-out;}\
#main .content .paging.to_top.on_top{bottom:-10px;opacity:0}\
#main .content .paging.to_top a{background:#71a4d7 url("https://ssl-ccstatic.highwebmedia.com/images/arrow-left-white.png") no-repeat 50% 50%;border:1px solid #3C6793;transform:rotate(90deg)}\
#main .content .featured_blog_posts{display:none}\
#main .content .featured_text{display:none}\
#main .banner{display:none}\
#main #overlay{display:none!important}\
#main #entrance_terms{display:none!important}\
.footer-holder{display:none}\
\
','cb-mini');
// // jquery on-load code:
(function($,undefined){$(function(){$(document).ready(function(){
// ==jQ==
//
// remove redirection in external links (/external_link/?url=...)
$('a[href]').each(function(i,e){
 var x=$(this).attr('href');
 x=/\/external_link\/\?url=(.*)&domain=.*/i.exec(x);
 if(x&&x[1]&&(x=decodeURIComponent(x[1])))$(this).attr('href',x);
});
// make player on top of bio elements with absolute or fixed position (element.style.position=absolute|fixed)
$('.info-user .bio dl').each(rem_fix);
function rem_fix(i,e)
{
 if( $(this).attr('style') && /(fixed|absolute)/.test($(this).css('position')) )
  // just ignore it, change z-index lower than player
  $(this).css('zIndex',-1);
 $.each($(e).children(),rem_fix);
}
// add login (body div#header div.nav-bar ul#nav li.login-link) to sub-menu (body div#main div.top-section ul.sub-nav)
if(!$('#user_information').length)
  //-v0.04-// $('#main .top-section .sub-nav').append($('<li>'+$('#header .nav-bar .login-link').clone().wrap('<p>').parent().html()+'</li>'));
 $('#main .top-section .sub-nav').append($('#header .nav-bar .login-link').parent().detach()); // -v0.05- //
// add broadcast menu (body div#header div.nav-bar ul#nav li a[href^="/b/"]) to sub-menu (body div#main div.top-section ul.sub-nav)
else
 $('#main .top-section .sub-nav').append($('#header .nav-bar li a[href^="/b/"]').parent().detach());
// remove watermark on flash video
var x=$('#xmovie');
if(x.length)
{
 x.attr('value',x.attr('value').replace('&elu=https://ssl-ccstatic.highwebmedia.com/images/flashwatermark.png',''));
}
else
{
 if(typeof window.EmbedViewerSwf!='undefined')
 {
  var u=window.EmbedViewerSwf;
  window.EmbedViewerSwf=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t){return u(a,b,c,d,e,f,g,h,i,j,k,l,m,'',o,p,q,r,s,t)}
 }
}
// remove tip sound
window.PlayBeep=function(a){};
window.play_html_sound_level=function(a,b){};
// add a scroll-to-top button
$('<ul class="paging to_top on_top"><li><a href="#to_top" class="prev">To top</a></li></ul>').insertAfter($('#main .content .c-1'));
$(window).scroll(function(){$(this).scrollTop()>100?$('.to_top').removeClass('on_top')/*.fadeIn()*/:$('.to_top').addClass('on_top')/*.fadeOut()*/});
$('.to_top').click(function(){$('html, body').stop().animate({scrollTop:0},500);return false});
// add href to profile menu link
var x=$('#main .top-section .active a[href="#"]');
if(x.length)x.attr('href',window.location.href);
// change style in the night
function checkNight(){var x=(new Date()).getHours();if(x>=20||x<8)$('body').addClass('night')}checkNight();setInterval(checkNight,20*60*1000);
//
// ==/jQ==
});});})(window.jQuery.noConflict(true));