Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name SubGuns - Cleanup
- // @namespace Violentmonkey Scripts
- // @match *://*.machineguncentral.com/*
- // @grant none
- // @require http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js
- // @author Tyler Bennett
- // ==/UserScript==
- (function() {
- $(document).ready(function() {
- ///////////////////////////////
- // Fix content in the Header
- ///////////////////////////////
- // Remove the break used to offset the logo
- $('td.hdrstyle br').remove();
- // Correct the logo the right way using CSS
- $('td.hdrstyle div').css('position', 'relative');
- $('td.hdrstyle div').css('top', '3px');
- // Correct the header to be the minimal height
- $('td.hdrstyle').css('height', '85px');
- // Decrease the size of the logos
- $('.logosz').css("width", "330px");
- $('.logosz2').css("width", "140px");
- // Create a table after the table
- //$('table.yellowgradient').after("<table id=my-new-header><tbody></tbody></table>");
- //var $myheader = $('table#my-new-header');
- //var $mytablebody = $('table#my-new-header tbody');
- //var $header1 = $('td.hdrstyle');
- //$mytablebody.after('<tr>');
- //$mytablebody.after($header1);
- //$mytablebody.after('</tr>');
- //var $remaining = $('table .visible-lrg .visible-lg .visible-md tbody')
- //console.dir($remaining)
- // Remove the giant annoying video countdown
- $('div.embed-responsive').remove();
- // Cut down the huge header space
- $('p.topspace').css('height', "65px");
- // Decrease font-size and padding on navbar
- $('.topnav a').css("font-size", "0.8em");
- $('.topnav a').css("padding", "1px");
- // Resize the navbar buttons
- $('.topnav a').css("width", "120px");
- // remove the icons by the navbar
- $('.topnav a img').remove()
- // Remove the box shadow effect on rows
- $('.stdborder').css('box-shadow', '0px 0px 0px 0px rgba(0, 0, 0, 0');
- var $listingDiv = $('.stdborder').parent()
- $($listingDiv).children().each(function () {
- //get input and parent
- var $input = $(this).find("#ButtonViewDetails");
- var $inputParent = $input.parent()
- //get details links
- var base_url = "https://www.machineguncentral.com/ViewDetails.aspx?p=";
- var datalink = $input.attr("data-mylinko");
- var target = base_url+datalink;
- var markup = ""
- markup += "<button class='btn' onclick='window.open("
- markup += '"'+target+'"'
- markup += ', "_blank"'
- markup += ")'> Open link in new tab</button>"
- //append a link in parent for open in new tab
- $inputParent.append(markup);
- });
- setTimeout(
- function() {
- $( "#chat-widget-container" ).remove();
- $( "#livechat-eye-catcher" ).remove();
- }, 2200);
- }); //end ready
- // page is fully loaded, including all frames, objects and images
- $(window).load(function() {
- }); // end load
- })(); //end anon-func
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement