Chaturbate Better Full Screen

Adds a better full screen view that has the chat.

질문, 리뷰하거나, 이 스크립트를 신고하세요.
  1. // // ==UserScript==
  2. // @name Chaturbate Better Full Screen
  3. // @version 1.3
  4. // @include https://chaturbate.com/*
  5. // @include https://chaturbate.com/#*
  6. // @exclude https://chaturbate.com/*-cams/
  7. // @exclude https://chaturbate.com/accounts/*
  8. // @exclude https://chaturbate.com/photo_videos/*
  9. // @namespace https://greasyfork.org/en/scripts/7170-chaturbate-better-full-screen
  10. // @description:en Adds a better full screen view that has the chat.
  11. // @source https://greasyfork.org/en/scripts/7170-chaturbate-better-full-screen
  12. // @description Adds a better full screen view that has the chat.
  13. // ==/UserScript==
  14.  
  15. if (window.top != window.self) //-- Don't run on frames or iframes
  16. return;
  17.  
  18. var main = function() {
  19. var betterFullScreenOpen = false,
  20. prevHeight = 0;
  21.  
  22. if (typeof $ !== 'undefined') {
  23. $(document).ready(
  24. function() {
  25. var addActionBtn = function() {
  26. $('body').append('<div id="betterFullScreenBtn" onclick="toggleBetterFullScreen()"><i class="fa fa-arrows-alt"><i></div>');
  27. };
  28.  
  29. window.toggleBetterFullScreen = function(e) {
  30. betterFullScreenOpen = !betterFullScreenOpen;
  31. $('#defchat .section').toggleClass('betterFullScreen');
  32. $('#betterFullScreenBtn .fa').toggleClass('fa-arrows-alt').toggleClass('fa-compress');
  33. if (betterFullScreenOpen) {
  34. prevHeight = $('.video-box #player').css('height');
  35. var width = $('.video-box #player').width();
  36. $('.video-box #player').css('height', ((width*(664/842))-10)+'px');
  37. $('body').append('<div id="betterFullScreenOverlay"></div>');
  38. } else {
  39. $('.video-box #player').css('height', prevHeight);
  40. $('#betterFullScreenOverlay').remove();
  41. }
  42. };
  43.  
  44. var url = '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css';
  45. if (document.createStyleSheet) {
  46. document.createStyleSheet(url);
  47. } else if (typeof $ !== 'undefined') {
  48. $('<link rel="stylesheet" type="text/css" href="' + url + '" />').appendTo('head');
  49. }
  50.  
  51. addActionBtn();
  52. }
  53. );
  54. }
  55. };
  56.  
  57. var script = document.createElement('script');
  58. script.textContent = '(' + main.toString() + ')();';
  59. document.body.appendChild(script);
  60. var style = document.createElement('style');
  61. style.innerHTML = ''+
  62. '#betterFullScreenBtn {'+
  63. 'width: 25px !important;' +
  64. 'height: 25px !important;' +
  65. 'top: 10px !important;' +
  66. 'right: 10px !important;' +
  67. 'z-index: 2000 !important;' +
  68. 'position: fixed !important;' +
  69. 'cursor: pointer !important;' +
  70. 'background: #e0e0e0 !important;' +
  71. 'border: 1px solid #acacac !important;' +
  72. 'border-radius: 4px !important;' +
  73. '-webkit-border-radius: 4px !important;' +
  74. '-moz-border-radius: 4px !important;' +
  75. 'padding: 4px !important;' +
  76. 'font-size: 25px !important;' +
  77. 'text-align: center !important;' +
  78. '}' +
  79. '#betterFullScreenOverlay {' +
  80. 'top: 0;' +
  81. 'left: 0;' +
  82. 'right: 0;' +
  83. 'bottom: 0;' +
  84. 'position: fixed;' +
  85. 'background: #e0e0e0;' +
  86. 'z-index: 1998;' +
  87. '}' +
  88. '.betterFullScreen {' +
  89. 'top: 0 !important;' +
  90. 'left: 0 !important;' +
  91. 'right: 0 !important;' +
  92. 'bottom: 0 !important;' +
  93. 'position: fixed !important;' +
  94. 'z-index: 1999 !important;' +
  95. 'height: 100%!important;' +
  96. '}' +
  97. '.betterFullScreen .video-box {' +
  98. 'position: fixed !important;' +
  99. 'left: 0 !important;' +
  100. 'top: 0 !important;' +
  101. 'width: 60% !important;' +
  102. 'height: 100% !important;' +
  103. '}' +
  104. '.betterFullScreen .video-box #player {' +
  105. 'width: 100% !important;' +
  106. '}' +
  107. '.betterFullScreen .video-box .title {' +
  108. 'width: calc(100% - 15px);' +
  109. 'position: relative;' +
  110. 'overflow: visible;' +
  111. '}' +
  112. '.betterFullScreen .video-box .title #tooltip-subject {' +
  113. 'width: initial !important;' +
  114. 'right: 0;' +
  115. '}' +
  116. '.betterFullScreen .chat-holder {' +
  117. 'position: fixed !important;' +
  118. 'right: 0 !important;' +
  119. 'top: 0 !important;' +
  120. 'width: calc(40% - 10px) !important;' +
  121. 'height: 100% !important;' +
  122. '}' +
  123. '.betterFullScreen .chat-box {' +
  124. 'height: 100% !important;' +
  125. '}' +
  126. '.betterFullScreen .users-list, .betterFullScreen .settings-list, .betterFullScreen .chat-list {' +
  127. 'height: calc(100% - 75px) !important;' +
  128. '}';
  129. document.body.appendChild(style);