Advertisement
Guest User

subguns-userscript

a guest
Apr 21st, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 3.17 KB | None | 0 0
  1. // ==UserScript==
  2. // @name SubGuns - Cleanup
  3. // @namespace Violentmonkey Scripts
  4. // @match *://*.machineguncentral.com/*
  5. // @grant none
  6. // @require       http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js
  7. // @author Tyler Bennett
  8. // ==/UserScript==  
  9. (function() {
  10.     $(document).ready(function() {
  11.      
  12.       ///////////////////////////////
  13.       // Fix content in the Header
  14.       ///////////////////////////////
  15.       // Remove the break used to offset the logo
  16.       $('td.hdrstyle br').remove();
  17.       // Correct the logo the right way using CSS
  18.       $('td.hdrstyle div').css('position', 'relative');
  19.       $('td.hdrstyle div').css('top', '3px');
  20.       // Correct the header to be the minimal height
  21.       $('td.hdrstyle').css('height', '85px');
  22.      
  23.       // Decrease the size of the logos
  24.       $('.logosz').css("width", "330px");
  25.       $('.logosz2').css("width", "140px");
  26.      
  27.       // Create a table after the table
  28.       //$('table.yellowgradient').after("<table id=my-new-header><tbody></tbody></table>");
  29.       //var $myheader = $('table#my-new-header');
  30.       //var $mytablebody = $('table#my-new-header tbody');
  31.       //var $header1 = $('td.hdrstyle');
  32.       //$mytablebody.after('<tr>');
  33.       //$mytablebody.after($header1);
  34.       //$mytablebody.after('</tr>');
  35.  
  36.       //var $remaining = $('table .visible-lrg .visible-lg .visible-md tbody')
  37.       //console.dir($remaining)
  38.      
  39.       // Remove the giant annoying video countdown
  40.       $('div.embed-responsive').remove();
  41.       // Cut down the huge header space
  42.       $('p.topspace').css('height', "65px");
  43.      
  44.       // Decrease font-size and padding on navbar
  45.       $('.topnav a').css("font-size", "0.8em");
  46.       $('.topnav a').css("padding", "1px");
  47.       // Resize the navbar buttons
  48.       $('.topnav a').css("width", "120px");
  49.       // remove the icons by the navbar
  50.       $('.topnav a img').remove()
  51.  
  52.       // Remove the box shadow effect on rows
  53.       $('.stdborder').css('box-shadow', '0px 0px 0px 0px rgba(0, 0, 0, 0');
  54.      
  55.       var $listingDiv = $('.stdborder').parent()
  56.            
  57.       $($listingDiv).children().each(function () {
  58.         //get input and parent        
  59.         var $input = $(this).find("#ButtonViewDetails");
  60.         var $inputParent = $input.parent()
  61.        
  62.         //get details links
  63.         var base_url = "https://www.machineguncentral.com/ViewDetails.aspx?p=";
  64.         var datalink = $input.attr("data-mylinko");
  65.         var target = base_url+datalink;
  66.  
  67.         var markup  = ""
  68.             markup += "<button class='btn' onclick='window.open("
  69.             markup += '"'+target+'"'
  70.             markup += ', "_blank"'
  71.             markup += ")'> Open link in new tab</button>"
  72.        
  73.         //append a link in parent for open in new tab
  74.         $inputParent.append(markup);      
  75.       });
  76.      
  77.       setTimeout(
  78.         function() {
  79.           $( "#chat-widget-container" ).remove();
  80.           $( "#livechat-eye-catcher" ).remove();
  81.       }, 2200);
  82.  
  83.      
  84.     }); //end ready
  85.  
  86.     // page is fully loaded, including all frames, objects and images
  87.     $(window).load(function() {
  88.     }); // end load
  89.  
  90. })(); //end anon-func
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement