-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
23 lines (22 loc) · 5.05 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Speed Reader Bookmarklet</title>
</head>
<body>
<h1>Speed Reader Bookmarklet</h1>
<p><a href="javascript:(function(){var d=null,e,g;function j(a){this.c=a;this.b=this.c.document;this.body=this.b.body;this.event=this.c.event}e=j.prototype;e.createElement=function(a){return this.b.createElement(a)};e.appendChild=function(a){return this.body.appendChild(a)};e.removeChild=function(a){return this.body.removeChild(a)};e.B=function(){return this.c.getSelection?this.c.getSelection().toString():this.b.getSelection?this.b.getSelection():this.b.selection?this.b.selection.createRange().text:''};
e.setInterval=function(a,b){return this.c.setInterval(a,b)};e.clearInterval=function(a){return this.c.clearInterval(a)};function l(){}l.o=function(a){return a.split('').reverse().join('')};l.M=function(a){return''!==a};l.K=function(a){return a.split(/\s+/).filter(l.M)};l.t=function(a){return 0<a.length};l.s=function(a){return a.concat('')};l.J=function(a){return this.o(a).split(/(?=[\s\n\r]+["']?[.?!]+)/).map(l.o).reverse().map(l.K).filter(l.t).map(l.s)};function m(a){this.l=a;this.f=this.e=0}
m.prototype.D=function(){return this.e<this.l.length};m.prototype.j=function(){var a;a=this.l[this.e][this.f];this.f+=1;this.f===this.l[this.e].length&&(this.f=0,this.e+=1);return a};function n(a){this.page=a}var p;p=function(a){var b,c,h;h=[];for(b in a)c=a[b],a.hasOwnProperty(b)&&h.push(b+':'+c);return h.join(';')};n.prototype.create=function(a,b,c){a=this.page.createElement(a);a.id=b;a.style.cssText=p(c);return a};
n.prototype.v=function(){return this.create('div','srDialog',{'background-color':'white',opacity:'.95',filter:'alpha(opacity=95)',position:'fixed',top:'0',left:'0',width:'100%25',height:'100%25','z-index':'1000'})};n.prototype.w=function(){return this.create('p','srWord',{'text-align':'center','background-color':'white',color:'black','font-size':'40px',position:'fixed',top:'50%25',left:'50%25',width:'400px','margin-left':'-200px',height:'100px','margin-top':'-50px'})};
function q(a,b){this.page=a;this.n=b;this.i=this.a=d;this.h={}}e=q.prototype;e.create=function(){this.a=this.n.v();this.a.tabIndex=0;this.i=this.n.w();this.i.innerHTML='';this.a.appendChild(this.i);this.page.appendChild(this.a);return this.a.focus()};e.remove=function(){if(this.a!==d)return this.page.removeChild(this.a)};e.F=function(a){a=a||this.page.event;if(this.h.hasOwnProperty(a.keyCode))return this.h[a.keyCode](),a.preventDefault?a.preventDefault():event.returnValue=!1};
e.G=function(a){a=a||this.page.event;return!this.h.hasOwnProperty(a.keyCode)};e.m=function(a,b){var c=this;this.a.onkeydown===d&&(this.a.onkeydown=function(a){return c.F(a)},this.a.onkeypress=function(a){return c.G(a)});this.h[a]=b};e.I=function(a){return this.i.innerHTML=a};function r(a,b,c){this.p=a;this.L=b;this.A=c}r.prototype.j=function(){return this.p.D()?this.L.I(this.p.j()):this.A()};function s(a,b,c){this.page=a;this.u=b;this.time=c;this.g=d}
s.prototype.start=function(){return this.g=this.page.setInterval(this.u,this.time)};s.prototype.stop=function(){return this.page.clearInterval(this.g)};function t(a,b,c){this.page=a;this.a=b;this.g=c;this.d=d;this.k=!0;this.q=27;this.r=32}t.prototype.finish=function(){this.d.stop();return this.a.remove()};t.prototype.H=function(){this.k?this.d.stop():this.d.start();return this.k=!this.k};t.prototype.C=function(){var a=this;this.a.m(this.q,function(){return a.finish()});this.a.m(this.r,function(){return a.H()})};
t.prototype.z=function(a){var b,c=this;b=new r(a,this.a,function(){return c.finish()});this.d=new s(this.page,function(){return b.j()},this.g);this.d.start()};function u(){}u.N=function(a){return Math.round(6E4/a)};g=function(a,b){var c,h,f,k;f=new j(a);k=l.J(f.B());0!==k.length&&(k=new m(k),c=new n(f),c=new q(f,c),c.create(),h=u.N(b),f=new t(f,c,h),f.C(),f.z(k))};'undefined'!==typeof exports&&exports!==d?(exports.O=j,exports.P=l):(this.speedRead=g,g(this,350));}).call(this);">Speed Reader</a> (inline edition) <-- drag this to the bookmark bar.</p>
<p><a href="javascript:(function(){var a;null===document.getElementById('speedReaderScript')?(a=document.createElement('script'),a.id='speedReaderScript',a.src='http://markwithall.github.io/speedreader/build/speedread-mini.js',a.type='text/javascript',document.body.appendChild(a)):speedRead(window,350);}).call(this);
">Speed Reader</a> (downloads from github each time) <-- drag this to the bookmark bar.</p>
<p>To use it, just select some text in a webpage and then click on the bookmark. The Escape key cancels reading and the space bar pauses/resumes.</p>
<a href="https://github.com/MarkWithall/speedreader/"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>
</body>
</html>