Skip to content

Instantly share code, notes, and snippets.

@mk-pmb
Last active February 8, 2016 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mk-pmb/ecf98d5cabce572e8352 to your computer and use it in GitHub Desktop.
Save mk-pmb/ecf98d5cabce572e8352 to your computer and use it in GitHub Desktop.
Bookmarklet: Netsh commands for Interface IP … identified as headlines.
/*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