Bunpro: Buttons Bar

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

נכון ליום 11-07-2018. ראה הגרסה האחרונה.

אין להתקין סקריפט זה ישירות. זוהי ספריה עבור סקריפטים אחרים // @require https://updategf.qytechs.cn/scripts/370219/612035/Bunpro%3A%20Buttons%20Bar.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

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() {
				$('#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: rgba(25,34,49,0.8);'+
								 'height: 100% !important;'+
								 'color: white;'+
								 'border: 0;'+
								 '}'+
								 '#buttonsBar .barButton input:hover {'+
								 'color: rgb(103, 114, 124);'+
								 '}'+
								 '</style>');
		}
		return {addButton: addButton}
}();