Skip to content

Instantly share code, notes, and snippets.

@extremeheat
Last active November 14, 2015 05:16
Show Gist options
  • Save extremeheat/d3235cc045aef341675e to your computer and use it in GitHub Desktop.
Save extremeheat/d3235cc045aef341675e to your computer and use it in GitHub Desktop.
re-implement select-based driver picking on downloadcenter.intel.com
javascript:$("#searchModule").after('<div id="findCategoryModule" class="findCategoryModule primary-content-box" style="display: none;"> <h2>Find By Category</h2> <div class="selector active"> <label for="prodFam" id="prodFamLabel" class="select-category-txt active"> 1. </label> <select id="prodFam" name="prodFam"><option value="">Select a product family</option><option value="24">Processors</option><option value="36">Desktop Boards</option><option value="37">Server Products</option><option value="38">Network Connectivity</option><option value="39">Graphics Drivers</option><option value="42">Software</option><option value="44">Embedded Components</option><option value="45">PC Accessories</option><option value="1093">Programs and Services</option><option value="1783">Wireless Networking</option><option value="2273">I/O Products</option><option value="2280">Ethernet Components</option><option value="3124">Solid-State Drives</option><option value="3796">Education</option><option value="3865">Boards and Kits</option><option value="3866">Innovative Devices</option><option value="2974">Mobile Boards</option></select> </div> <div class="selector"> <label for="prodLine" id="prodLineLabel" class="select-category-txt disabled"> 2. </label> <select id="prodLine" name="prodLine"> <option>Select a product line</option> </select> </div> <div class="selector"> <label for="prodName" id="prodNameLabel" class="select-category-txt disabled"> 3. </label> <select id="prodName" name="prodName"> <option>Select a product name</option> </select> </div> <div class="button-container"> <a id="filter-submit" href="#" class="updater button-slider-blue disabled"><span>Find</span></a> <div class="clearFloat"> </div> </div> </div>'),$("#findCategoryModule").show(),"complete"==document.readyState&&($("#findCategoryModule").show(),$("#prodFam").on("change",function(){familyChange($(this).val())}),$("#prodLine").on("change",function(){lineChange($(this).val())}),$("#prodName").on("change",function(){prodChange($(this).val())}),DefaultProductPicker());
// ==UserScript==
// @name IntelDC Manual Download Adder
// @namespace https://downloadcenter.intel.com/
// @version 1.0
// @description Re-implement select-based driver picking on downloadcenter.intel.com
// @match https://downloadcenter.intel.com/
// @grant none
// @run-at document-end
// ==/UserScript==
// Append the HTML code
$("#searchModule").after('<div id="findCategoryModule" class="findCategoryModule primary-content-box" style="display: none;"> <h2>Find By Category</h2> <div class="selector active"> <label for="prodFam" id="prodFamLabel" class="select-category-txt active"> 1. </label> <select id="prodFam" name="prodFam"><option value="">Select a product family</option><option value="24">Processors</option><option value="36">Desktop Boards</option><option value="37">Server Products</option><option value="38">Network Connectivity</option><option value="39">Graphics Drivers</option><option value="42">Software</option><option value="44">Embedded Components</option><option value="45">PC Accessories</option><option value="1093">Programs and Services</option><option value="1783">Wireless Networking</option><option value="2273">I/O Products</option><option value="2280">Ethernet Components</option><option value="3124">Solid-State Drives</option><option value="3796">Education</option><option value="3865">Boards and Kits</option><option value="3866">Innovative Devices</option><option value="2974">Mobile Boards</option></select> </div> <div class="selector"> <label for="prodLine" id="prodLineLabel" class="select-category-txt disabled"> 2. </label> <select id="prodLine" name="prodLine"> <option>Select a product line</option> </select> </div> <div class="selector"> <label for="prodName" id="prodNameLabel" class="select-category-txt disabled"> 3. </label> <select id="prodName" name="prodName"> <option>Select a product name</option> </select> </div> <div class="button-container"> <a id="filter-submit" href="#" class="updater button-slider-blue disabled"><span>Find</span></a> <div class="clearFloat"> </div> </div> </div>');
// Show the injected code
$("#findCategoryModule").show();
// downloadcenter.intel.com already adds its own listeners so to avoid duplicate
// listeners, we check the ready state. This is because their initilization code runs after
// the page has finished loading. If the page has already loaded, then their initialization
// code won't run so we have to initialize it manually. This shouldn't be an issue if you're
// using Tamper/Greasemonkey with @run-at document-end set.
if (document.readyState == "complete") {
$("#prodFam").on('change', function () { familyChange($(this).val()); });
$("#prodLine").on('change', function () { lineChange($(this).val()); });
$("#prodName").on('change', function () { prodChange($(this).val()); });
DefaultProductPicker();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment