TTS Reader Extension

Cleans up https://ttsreader.com tts app for cleaner experience

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name			TTS Reader Extension
// @namespace		https://github.com/Amourspirit/TTS-Reader-Extension
// @version			0.3.0
// @description		Cleans up https://ttsreader.com tts app for cleaner experience
// @run-at			document-end
// @match			http://ttsreader.com/
// @match			https://ttsreader.com/
// @match			http://ttsreader.com/online-reader/
// @match			https://ttsreader.com/online-reader/
// @grant			none
// @noframes
// @license			MIT
// @homepageURL     https://github.com/Amourspirit/TTS-Reader-Extension
// @update			https://github.com/Amourspirit/TTS-Reader-Extension/raw/master/TTS_Reader_Extension.user.js
// @contributionURL https://github.com/Amourspirit/TTS-Reader-Extension/
// ==/UserScript==
(function() {
    'use strict';

	document.getElementById('app_ad_banner_right').style.display = 'none';
	document.getElementById('app_ad_banner_left').style.display = 'none';
	document.getElementById('app_container').style.position = 'static';
	document.getElementById('goPremiumBtn').style.display = 'none';

	setUiNotFullScreen();

	var appC = document.getElementById('app_container');
	appC.style.right = '0px';
	appC.style.left = '0px';
	appC.style.width = '100%';

	var appP = document.getElementById('app_panel');
	appP.style.top = '70px';

	$('#fullScreenBtn').off('click');
	$("#fullScreenBtn").on("click", function () {
		toggleFullScreen();
	});
	if (!isPremium()) {
		// localStorage.setItem("isPremium","true");
		$('.ad').hide();
		if (document.getElementById('removeAdsBtn')) {
			document.getElementById('removeAdsBtn').style.display = "none";
		}
		$('#app_panel').css('top', '67px');
		$('#app_panel').css('bottom', '0');
	}
	if ($('#helpBtn').length) {
		$('#helpBtn').off('click');
		$('#helpBtn').on('click', function () {
			if (isFullScreen) {
				toggleFullScreen();
			}
			invokeHelpDialog();
		});
	}

	function setUiNotFullScreen() {
		var app = $('#application');
		app.css('background-image', "url('../img/app/desk.jpeg')");
		app.css('background-size', "cover");
		app.css('height', "700px");
		app.css('width', "100%");
		app.css('max-height', "80vh");
		app.css('max-width', "100%");
		app.css('padding','0px');
		app.css('margin', '0px');
		app.css('left', '0px');
		app.css('right', '0px');
	}

	function toggleFullScreen() {
		var app = document.getElementById("application");
		if (!isFullScreen) {
			var reqF = app.requestFullScreen || app.webkitRequestFullScreen || app.mozRequestFullScreen || app.msRequestFullscreen;
			reqF.call(app);
			$(app).css('background', "white");
			$(app).css('height', "100vh");
			$(app).css('width', "100vh");
			$(app).css('max-height', "100vh");
		} else {
			var reqE = document.exitFullscreen || document.webkitExitFullscreen || document.mozCancelFullScreen || document.msExitFullscreen ;
			reqE.call(document);
			setUiNotFullScreen();
		}
		isFullScreen = !isFullScreen;
	}
})();