Greasy Fork

Greasy Fork is available in English.

Bunpro: Buttons Bar

Adds an easy way to add buttons to the bunpro review page.

当前为 2018-12-15 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyfork.icu/scripts/370219/653809/Bunpro%3A%20Buttons%20Bar.js

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

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

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

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

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

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

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

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

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

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

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

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

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

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

var buttonsBar = function () {
		//add the button
		function addButton(ID, name, onclick) {
		    //add the bar if there is none
		    if (!$('#buttonsBar').length) addBar();
		    //append the button
		    $('#buttonsBar .flexWrapper').append('<div class="barButton"><input id="'+ID+'" type="button" value="'+name+'" onclick="'+onclick+'"></div>');
		}
		
		//adds the bar with buttons
		function addBar() {
				var bg = "";
				var cls = $('body')[0].className;
				if (cls.includes("modern-dark")) bg = "#424242";
				else if (cls.includes("modern")) bg = "#f5f5f6";
				else if (cls.includes("classic")) bg = "rgba(25,34,49,0.8)";
				else if (cls.includes("light")) bg = "#e6e6e6";
				$('#check-grammar').before('<div id="buttonsBar"><div class="flexWrapper"</div></div>');
				$('head').append('<style id="ButtonBarStyle">'+
								 '@media (max-width: 480px) {'+
								 '#buttonsBar .barButton {'+
								 'height: 30px;'+
								 'font-size: 12px;'+
								 '}'+
								 '}'+
								 '#buttonsBar {'+
								 'margin-top: 2.5px;'+
								 '}'+
								 '#buttonsBar .flexWrapper {'+
								 'height: 40px;'+
								 'display: flex;'+
								 'flex-wrap: wrap;'+
								 'margin: 0 -2.5px;'+
								 '}'+
								 '#buttonsBar .barButton {'+
								 'flex: 1;'+
								 'margin: 2.5px;'+
								 '}'+
								 '#buttonsBar .barButton input {'+
								 'background: ' + bg + ';'+
								 'height: 100% !important;'+
								 'color: white;'+
								 'border: 0;'+
								 '}'+
								 '#buttonsBar .barButton input:hover {'+
								 'color: rgb(103, 114, 124);'+
								 '}'+
								 '</style>');
		}
		return {addButton: addButton}
}();