-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbookmarklet.html
41 lines (32 loc) · 11.6 KB
/
bookmarklet.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html>
<head>
<title>HTML5 Outliner bookmarklet (v0.12.4)</title>
<style>
/* src: http://h5o.github.io/css/main.css */
body, h1, h2, h3, h4, h5, h6, p, blockquote, pre, hr, dl, dd, ol, ul, figure { margin: 0; padding: 0; }
body { font-family: Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.5; font-weight: 300; color: #111; -webkit-text-size-adjust: 100%; }
ul, ol { margin-left: 30px; }
body { padding: 5px; }
a { color: #2a7ae2; text-decoration: none; }
a:visited { color: #1756a9; }
a:hover { color: #111; text-decoration: underline; }
p { text-align: center; }
h1 a { text-align: center; font-weight: bold; display: block; margin: 5px; font-size: 22px; }
</style>
</head>
<body>
<p>Drag this to your favorites:</p>
<h1><a href="javascript:(function () { !function%20a(b%2Cc%2Cd)%7Bfunction%20e(g%2Ch)%7Bif(!c%5Bg%5D)%7Bif(!b%5Bg%5D)%7Bvar%20i%3D%22function%22%3D%3Dtypeof%20require%26%26require%3Bif(!h%26%26i)return%20i(g%2C!0)%3Bif(f)return%20f(g%2C!0)%3Bvar%20j%3Dnew%20Error(%22Cannot%20find%20module%20'%22%2Bg%2B%22'%22)%3Bthrow%20j.code%3D%22MODULE_NOT_FOUND%22%2Cj%7Dvar%20k%3Dc%5Bg%5D%3D%7Bexports%3A%7B%7D%7D%3Bb%5Bg%5D%5B0%5D.call(k.exports%2Cfunction(a)%7Bvar%20c%3Db%5Bg%5D%5B1%5D%5Ba%5D%3Breturn%20e(c%3Fc%3Aa)%7D%2Ck%2Ck.exports%2Ca%2Cb%2Cc%2Cd)%7Dreturn%20c%5Bg%5D.exports%7Dfor(var%20f%3D%22function%22%3D%3Dtypeof%20require%26%26require%2Cg%3D0%3Bg%3Cd.length%3Bg%2B%2B)e(d%5Bg%5D)%3Breturn%20e%7D(%7B1%3A%5Bfunction(a%2Cb%2Cc)%7Bb.exports%3D%22body%20%7B%5Cn%09padding%3A%200%3B%5Cn%09margin%3A%200%3B%5Cn%09font-size%3A%2013px%3B%5Cn%09font-family%3A%20Verdana%2C%20sans-serif%3B%5Cn%7D%5Cn%5Cna%20%7B%5Cn%09color%3A%20%23008%3B%5Cn%09text-decoration%3A%20underline%3B%5Cn%7D%5Cn%5Cna%3Ahover%20%7B%5Cn%09text-decoration%3A%20none%3B%5Cn%7D%5Cn%5Cn.h5o-close%20%7B%5Cn%09position%3A%20absolute%3B%5Cn%09top%3A%2015px%3B%5Cn%09right%3A%2015px%3B%5Cn%09padding%3A%205px%3B%5Cn%09border%3A%201px%20%23008%20solid%3B%5Cn%09color%3A%20%2300f%3B%5Cn%09background-color%3A%20%23eef%3B%5Cn%09cursor%3A%20pointer%3B%5Cn%7D%5Cn.h5o-close%3Ahover%20%7B%5Cn%09color%3A%20%23008%3B%5Cn%09background-color%3A%20rgba(239%2C239%2C255%2C.7)%3B%5Cn%7D%5Cn%5Cn.h5o-container%20%7B%5Cn%09white-space%3A%20nowrap%3B%5Cn%09overflow-x%3A%20hidden%3B%5Cn%09text-overflow%3A%20ellipsis%3B%5Cn%09padding%3A%2015px%2060px%2015px%2015px%3B%5Cn%7D%5Cn%5Cn.h5o-container%20ol%20%7B%5Cn%09margin%3A%200%3B%5Cn%09padding%3A%200%3B%5Cn%7D%5Cn%5Cn.h5o-container%20li%20%7B%5Cn%09list-style%3A%20decimal%20outside%3B%5Cn%09margin-left%3A%2020px%3B%5Cn%7D%5Cn%22%7D%2C%7B%7D%5D%2C2%3A%5Bfunction(a%2Cb%2Cc)%7Bvar%20d%3Da(%22h5o%22)%2Ce%3Da(%22cssify%22)%2Cf%3Da(%22.%2Fbookmarklet.css%22)%2Cg%3Da(%22iframeish%22)%2Ch%3Dfunction(a%2Cb%2Cc)%7Bfor(var%20d%3D0%3Bd%3Ca.length%3Bd%2B%2B)a%5Bd%5D.setAttribute(b%2Cc)%7D%2Ci%3D2%2Cj%3D%22position%3Afixed%3Btop%3A10px%3Bright%3A10px%3Bborder%3A%22%2Bi%2B%22px%20solid%20%23000%3Bbackground%3Argba(255%2C255%2C255%2C.9)%3Bz-index%3A999999%3Bwidth%3A90%25%3Bmax-width%3A90%25%3Bmax-width%3Acalc(100%25%20-%2020px)%3Bmin-height%3A50px%3B%22%2Ck%3Dd(document.body).asHTML(!0)%2Cl%3Ddocument.createElement(%22div%22)%3Bh(%5Bl%5D%2C%22class%22%2C%22h5o-container%22)%2Cl.innerHTML%3Dk%2Ch(l.getElementsByTagName(%22a%22)%2C%22target%22%2C%22_top%22)%3Bvar%20m%3Dl.insertBefore(document.createElement(%22button%22)%2Cl.firstChild)%3Bh(%5Bm%5D%2C%22class%22%2C%22h5o-close%22)%2Cm.innerHTML%3D%22Close%22%2Cg(function(a%2Cb)%7Breturn%20a%3Fvoid%20console.error(a)%3A(e(f%2Cb.document)%2Ch(%5Bb.iframe%5D%2C%22style%22%2Cj)%2Cb.document.body.appendChild(l)%2Cl.style.position%3D%22absolute%22%2Cb.iframe.style.width%3Dl.scrollWidth%2Bi%2B%22px%22%2Cb.iframe.style.height%3Dl.scrollHeight%2Bi%2B%22px%22%2Cl.style.position%3D%22static%22%2Cvoid%20m.addEventListener(%22click%22%2Cfunction()%7Bdocument.body.removeChild(b.iframe)%2Cl%3Dm%3Dnull%7D))%7D)%7D%2C%7B%22.%2Fbookmarklet.css%22%3A1%2Ccssify%3A3%2Ch5o%3A4%2Ciframeish%3A12%7D%5D%2C3%3A%5Bfunction(a%2Cb%2Cc)%7Bb.exports%3Dfunction(a%2Cb)%7Bvar%20c%3Db%7C%7Cdocument%3Bif(c.createStyleSheet)%7Bvar%20d%3Dc.createStyleSheet()%3Breturn%20d.cssText%3Da%2Cd.ownerNode%7Dvar%20e%3Dc.getElementsByTagName(%22head%22)%5B0%5D%2Cf%3Dc.createElement(%22style%22)%3Breturn%20f.type%3D%22text%2Fcss%22%2Cf.styleSheet%3Ff.styleSheet.cssText%3Da%3Af.appendChild(c.createTextNode(a))%2Ce.appendChild(f)%2Cf%7D%2Cb.exports.byUrl%3Dfunction(a)%7Bif(document.createStyleSheet)return%20document.createStyleSheet(a).ownerNode%3Bvar%20b%3Ddocument.getElementsByTagName(%22head%22)%5B0%5D%2Cc%3Ddocument.createElement(%22link%22)%3Breturn%20c.rel%3D%22stylesheet%22%2Cc.href%3Da%2Cb.appendChild(c)%2Cc%7D%7D%2C%7B%7D%5D%2C4%3A%5Bfunction(a%2Cb%2Cc)%7Bb.exports%3Da(%22.%2Fsrc%2FcreateOutline%22)%7D%2C%7B%22.%2Fsrc%2FcreateOutline%22%3A9%7D%5D%2C5%3A%5Bfunction(a%2Cb%2Cc)%7Bfunction%20d(a%2Cb)%7Bthis.startingNode%3Da.node%2Cthis.sections%3D%5Bb%5D%7Dvar%20e%3Da(%22.%2FasHTML%22)%3Bd.prototype.getLastSection%3Dfunction()%7Breturn%20this.sections%5Bthis.sections.length-1%5D%7D%2Cd.prototype.asHTML%3Dfunction(a)%7Breturn%20e(this.sections%2Ca)%7D%2Cb.exports%3Dd%7D%2C%7B%22.%2FasHTML%22%3A8%7D%5D%2C6%3A%5Bfunction(a%2Cb%2Cc)%7Bfunction%20d(a)%7Bthis.node%3Da%7Db.exports%3Dd%7D%2C%7B%7D%5D%2C7%3A%5Bfunction(a%2Cb%2Cc)%7Bfunction%20d(a)%7Bthis.sections%3D%5B%5D%2Cthis.startingNode%3Da%7Dd.prototype.append%3Dfunction(a)%7Ba.container%3Dthis%2Cthis.sections.push(a)%7D%2Cb.exports%3Dd%7D%2C%7B%7D%5D%2C8%3A%5Bfunction(a%2Cb%2Cc)%7Bfunction%20d(a)%7Bif(a.heading.implied)return%22%3Ci%3EUntitled%20%22%2Bg.getTagName(a.startingNode)%2B%22%3C%2Fi%3E%22%3Bvar%20b%3Dg.getRankingHeadingElement(a.heading)%3Bif(!b)return%22%3Ci%3EError%3A%20no%20H1-H6%20inside%20HGROUP%3C%2Fi%3E%22%3Bvar%20c%3Db.textContent%3Breturn%20c%3Fg.escapeHtml(c)%3A%22%3Ci%3ENo%20text%20content%20inside%20%22%2Bg.getTagName(b)%2B%22%3C%2Fi%3E%22%7Dfunction%20e(a%2Cb)%7Bvar%20c%3Da.startingNode.getAttribute(%22id%22)%3Bif(c)return%20c%3Bif(!a.heading.implied)%7Bvar%20d%3Da.heading.getAttribute(%22id%22)%3Bif(d)return%20d%7Dvar%20e%3Da.startingNode%3Bdo%20var%20f%3D%22h5o-%22%2B%20%2B%2Bb.linkCounter%3Bwhile(e.ownerDocument.getElementById(f))%3Breturn%20e.setAttribute(%22id%22%2Cf)%2Cf%7Dfunction%20f(a%2Cb)%7Bif(%22object%22!%3Dtypeof%20b%26%26(b%3D%7BcreateLinks%3A!!b%7D)%2C!a.length)return%22%22%3Bif(b.skipTopHeader)return%20f(a%5B0%5D.sections%2C%7BskipToHeader%3A!1%2CcreateLinks%3Ab.createLinks%7D)%3B%22undefined%22%3D%3Dtypeof%20b.linkCounter%26%26(b.linkCounter%3D0)%3Bvar%20c%3D!!b.createLinks%2Cg%3D%5B%5D%3Bg.push(%22%3Col%3E%22)%3Bfor(var%20h%3D0%3Bh%3Ca.length%3Bh%2B%2B)%7Bvar%20i%3Da%5Bh%5D%3Bg.push(%22%3Cli%3E%22)%2Cc%26%26g.push('%3Ca%20href%3D%22%23'%2Be(i%2Cb)%2B'%22%3E')%2Cg.push(d(i))%2Cc%26%26g.push(%22%3C%2Fa%3E%22)%2Cg.push(f(i.sections%2Cb))%2Cg.push(%22%3C%2Fli%3E%22)%7Dreturn%20g.push(%22%3C%2Fol%3E%22)%2Cg.join(%22%22)%7Dvar%20g%3Da(%22.%2Futils%22)%3Bb.exports%3Df%7D%2C%7B%22.%2Futils%22%3A10%7D%5D%2C9%3A%5Bfunction(a%2Cb%2Cc)%7Bfunction%20d()%7Breturn%20k.length%3Fk%5Bk.length-1%5D.node%3Avoid%200%7Dfunction%20e(a)%7Bvar%20b%3Dp.getRankingHeadingElement(a)%3Breturn%20b%3F-parseInt(p.getTagName(b).substr(1))%3A-1%7Dfunction%20f(a)%7Bvar%20b%3Dd()%3Bif(!p.isHeading(b)%26%26!p.hasHiddenAttribute(b))%7Bif(p.hasHiddenAttribute(a))return%20void%20k.push(%7Bnode%3Aa%7D)%3Bif(p.isSecContent(a))return%20null!%3Di%26%26(j.heading%7C%7C(j.heading%3D%7Bimplied%3A!0%7D)%2Ck.push(i))%2Ci%3Dnew%20n(a)%2Cj%3Dnew%20l(a)%2Cvoid(i.outline%3Dnew%20m(i.node%2Cj))%3Bif(p.isSecRoot(a))return%20null!%3Di%26%26k.push(i)%2Ci%3Dnew%20n(a)%2Ci.parentSection%3Dj%2Cj%3Dnew%20l(a)%2Cvoid(i.outline%3Dnew%20m(i.node%2Cj))%3Bif(p.isHeading(a))%7Bif(j.heading)if(i.outline.getLastSection().heading.implied%7C%7Ce(a)%3E%3De(i.outline.getLastSection().heading))%7Bvar%20c%3Dnew%20l(a)%3Bi.outline.sections.push(c)%2Cj%3Dc%2Cj.heading%3Da%7Delse%7Bvar%20f%3D!1%2Cg%3Dj%3Bdo%7Bif(e(a)%3Ce(g.heading))%7Bvar%20c%3Dnew%20l(a)%3Bg.append(c)%2Cj%3Dc%2Cj.heading%3Da%2Cf%3D!0%7Dvar%20h%3Dg.container%3Bg%3Dh%7Dwhile(!f)%7Delse%20j.heading%3Da%3Breturn%20void%20k.push(%7Bnode%3Aa%7D)%7D%7D%7Dfunction%20g(a)%7Bvar%20b%3Dd()%3Bif(b%3D%3D%3Da%26%26k.pop()%2C!p.isHeading(b)%26%26!p.hasHiddenAttribute(b))%7Bif(!(p.isSecContent(a)%26%26k.length%3E0))return%20p.isSecRoot(a)%26%26k.length%3E0%3F(j.heading%7C%7C(j.heading%3D%7Bimplied%3A!0%7D)%2Cj%3Di.parentSection%2Cvoid(i%3Dk.pop()))%3Ap.isSecContent(a)%7C%7Cp.isSecRoot(a)%3Fvoid(j.heading%7C%7C(j.heading%3D%7Bimplied%3A!0%7D))%3Avoid%200%3Bj.heading%7C%7C(j.heading%3D%7Bimplied%3A!0%7D)%3Bvar%20c%3Di%3Bi%3Dk.pop()%2Cj%3Di.outline.getLastSection()%3Bfor(var%20e%3D0%3Be%3Cc.outline.sections.length%3Be%2B%2B)j.append(c.outline.sections%5Be%5D)%7D%7Dfunction%20h(a)%7Bif(!p.isSecContent(a)%26%26!p.isSecRoot(a))throw%20new%20TypeError(%22Invalid%20argument%3A%20start%20element%20must%20either%20be%20sectioning%20root%20or%20sectioning%20content.%22)%3Breturn%20i%3Dnull%2Cj%3Dnull%2Ck%3D%5B%5D%2Co(a%2Cf%2Cg)%2Ci.outline%7Dvar%20i%2Cj%2Ck%2Cl%3Da(%22.%2FSection%22)%2Cm%3Da(%22.%2FOutline%22)%2Cn%3Da(%22.%2FOutlineTarget%22)%2Co%3Da(%22.%2Fwalk%22)%2Cp%3Da(%22.%2Futils%22)%3Bb.exports%3Dh%7D%2C%7B%22.%2FOutline%22%3A5%2C%22.%2FOutlineTarget%22%3A6%2C%22.%2FSection%22%3A7%2C%22.%2Futils%22%3A10%2C%22.%2Fwalk%22%3A11%7D%5D%2C10%3A%5Bfunction(a%2Cb%2Cc)%7Bfunction%20d(a)%7Breturn%20a.tagName.toUpperCase()%7Dfunction%20e(a)%7Breturn%20function(b)%7Breturn%20f(b)%26%26new%20RegExp(a%2C%22i%22).test(d(b))%7D%7Dfunction%20f(a)%7Breturn%20a%26%26a.tagName%7Dfunction%20g(a)%7Bif(!j(a))throw%20new%20Error(%22Not%20a%20heading%20element%22)%3Bvar%20b%3Dd(a)%3Bif(%22HGROUP%22!%3D%3Db)return%20a%3Bfor(var%20c%3D1%3B6%3E%3Dc%3Bc%2B%2B)%7Bvar%20e%3Da.getElementsByTagName(%22H%22%2Bc)%3Bif(e.length)return%20e%5B0%5D%7Dreturn%20null%7Dfunction%20h(a)%7Breturn(%22%22%2Ba).replace(%2F%26%2Fg%2C%22%26amp%3B%22).replace(%2F%3C%2Fg%2C%22%26lt%3B%22)%7Dfunction%20i(a)%7Breturn%20f(a)%26%26a.hasAttribute(%22hidden%22)%7Dvar%20j%3De(%22%5EH%5B1-6%5D%7CHGROUP%24%22)%3Bc.getTagName%3Dd%2Cc.hasHiddenAttribute%3Di%2Cc.isSecRoot%3De(%22%5E(BLOCKQUOTE%7CBODY%7CDETAILS%7CFIELDSET%7CFIGURE%7CTD)%24%22)%2Cc.isSecContent%3De(%22%5E(ARTICLE%7CASIDE%7CNAV%7CSECTION)%24%22)%2Cc.isHeading%3Dj%2Cc.getRankingHeadingElement%3Dg%2Cc.escapeHtml%3Dh%7D%2C%7B%7D%5D%2C11%3A%5Bfunction(a%2Cb%2Cc)%7Bb.exports%3Dfunction(a%2Cb%2Cc)%7Bvar%20d%3Da%3Ba%3Afor(%3Bd%3B)if(b(d)%2Cd.firstChild)d%3Dd.firstChild%3Belse%20for(%3Bd%3B)%7Bif(c(d)%2Cd.nextSibling)%7Bd%3Dd.nextSibling%3Bcontinue%20a%7Dd%3Dd%3D%3Da%3Fnull%3Ad.parentNode%7D%7D%7D%2C%7B%7D%5D%2C12%3A%5Bfunction(a%2Cb%2Cc)%7Bfunction%20d(a%2Cb)%7B%22undefined%22%3D%3Dtypeof%20b%26%26%22function%22%3D%3Dtypeof%20a%26%26(b%3Da%2Ca%3D%7B%7D)%3Bvar%20c%3Da.renderTo%7C%7Cdocument.body%2Cd%3Ddocument.createElement(%22iframe%22)%3Bd.style.border%3D%22none%22%3Bvar%20e%3D!1%2Cf%3Dfunction()%7Bif(!e)%7Bvar%20a%3Dd.contentDocument%3Btry%7Ba.open()%7Dcatch(c)%7Breturn%20void%20setTimeout(f%2C10)%7De%3D!0%2Ca.write(%22%3C!doctype%20html%3E%22)%2Ca.close()%2Cb(null%2C%7Biframe%3Ad%2Cdocument%3Aa%7D)%7D%7D%3Bd.addEventListener(%22load%22%2Cf)%2Cc.appendChild(d)%7Db.exports%3Dd%7D%2C%7B%7D%5D%7D%2C%7B%7D%2C%5B2%5D)%3B })()" title="H5O v0.12.4">H5O v0.12.4</a></h1>
<ul id="help">
<li><a target="_top" href="http://marklets.com/FAQ.aspx#howDoIAddABookmarkletToMyBrowser">Installation details</a> for common browsers.</li>
<li><a target="_top" href="https://github.com/h5o/h5o-js/wiki/Bookmarklet-problems-with-Internet-Explorer">Internet Explorer is not supported</a>.</li>
<li>Homepage for <a target="_top" href="http://h5o.github.io">HTML5 outliner</a>.</li>
</ul>
<script>
if (window !== window.top) {
document.getElementById("help").style.display = "none";
}
</script>
</body>
</html>