Last active
February 8, 2016 15:41
-
-
Save mk-pmb/ecf98d5cabce572e8352 to your computer and use it in GitHub Desktop.
Bookmarklet: Netsh commands for Interface IP … identified as headlines.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint indent: 2, maxlen: 80, browser: true *//* | |
Netsh commands for Interface IP | |
=============================== | |
… identified as headlines: | |
1. visit https://technet.microsoft.com/en-us/library/bb490943.aspx | |
2. apply bookmarklet | |
*/ | |
(function () { | |
'use strict'; | |
document.getElementById('provideFeedback2').outerHTML = [ | |
'<style type="text/css">', | |
'.cmd-name {', | |
' font-size: 200%;', | |
' background-color: lightgray;', | |
' display: block;', | |
' margin-top: 2em;', | |
' font-family: monospace;', | |
' font-weight: bold;', | |
' padding-left: 0.2em;', | |
' transform-origin: left top 0px;', | |
' transform: scaleX(1.25);', | |
' width: 80%;', | |
' margin-bottom: 0.5em;', | |
'}', | |
'</style>'].join('\n'); | |
Array.from(document.getElementsByTagName('h3')).forEach(function (hl) { | |
var cmd, newHl, pn; | |
if (hl.innerHTML !== 'Syntax') { return; } | |
hl = hl.previousElementSibling; | |
if (String(hl.tagName).toLowerCase() === 'div') { | |
hl = hl.previousElementSibling; | |
} | |
hl = hl.previousElementSibling; | |
cmd = hl.innerHTML; | |
newHl = document.createElement('h2'); | |
newHl.className = 'cmd-name'; | |
newHl.innerHTML = cmd; | |
newHl.id = 'cmd-' + cmd.replace(/\s+/g, '-'); | |
pn = hl.parentNode; | |
pn.insertBefore(newHl, hl); | |
pn.removeChild(hl); | |
return newHl; | |
}); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment