diff --git a/README.md b/README.md index d03b0c3..d0477a4 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,7 @@ Spray is an open-source speed-reading application written in Javascript. It was ## Demo -The demo is hosted by the project's [GitHub Pages](http://the-happy-hippo.github.io/spray). - -To view the demo, click on the following link: http://the-happy-hippo.github.io/spray/content +Fully functional demo: http://the-happy-hippo.github.io/spray/content ## Installation @@ -30,4 +28,5 @@ Please contribute bug reports, feature requests, etc. * [@chaimpeck](https://github.com/chaimpeck) * [@the-happy-hippo](https://github.com/the-happy-hippo) +* [@maddes](https://github.com/maddes) diff --git a/content/js/spray-reader.js b/content/js/spray-reader.js index 23e6df3..dad688c 100644 --- a/content/js/spray-reader.js +++ b/content/js/spray-reader.js @@ -9,16 +9,16 @@ SprayReader.prototype = { words: null, isRunning: false, timers: [], - + setInput: function(input) { this.input = input; - + // Split on spaces var allWords = input.split(/\s+/); - + var word = ''; var result = ''; - + // Preprocess words var tmpWords = allWords.slice(0); // copy Array var t = 0; @@ -53,35 +53,35 @@ SprayReader.prototype = { this.words = tmpWords.slice(0); this.wordIdx = 0; }, - + setWpm: function(wpm) { this.wpm = parseInt(wpm, 10); this.msPerWord = 60000/wpm; }, - + start: function() { this.isRunning = true; - + thisObj = this; - + this.timers.push(setInterval(function() { thisObj.displayWordAndIncrement(); }, this.msPerWord)); }, - + stop: function() { this.isRunning = false; - + for(var i = 0; i < this.timers.length; i++) { clearTimeout(this.timers[i]); } }, - + displayWordAndIncrement: function() { var pivotedWord = pivot(this.words[this.wordIdx]); - + this.container.html(pivotedWord); - + this.wordIdx++; if (thisObj.wordIdx >= thisObj.words.length) { this.wordIdx = 0; @@ -153,5 +153,5 @@ function pivot(word){ // Let strings repeat themselves, // because JavaScript isn't as awesome as Python. String.prototype.repeat = function( num ){ - return new Array( num + 1 ).join( this ); + return (num<=0) ? "" : new Array( num + 1 ).join( this ); } diff --git a/index.html b/index.html index a0a8b4b..d0e8c58 100644 --- a/index.html +++ b/index.html @@ -1,86 +1,22 @@ - - - - - - Spray - - - - - - - -
-
-

Spray

-

An open-source speed-reading application written in Javascript

- -

View the Project on GitHub the-happy-hippo/spray

- - - -
-
-

-Spray Speed-Reader

- +Spray

Spray

An open-source speed-reading application written in Javascript

View the Project on GitHubthe-happy-hippo/spray

Spray Speed-Reader

An open-source speed-reading application written in Javascript.

- -

-About

- +

About

Spray is an open-source speed-reading application written in Javascript. It was inspired by OpenSpritz and currently contains the algorithm from that project, as well as the same styles.

- -

-Demo

- -

The demo is hosted by the project's GitHub Pages.

- -

-To view the demo, click on the following link: - -http://the-happy-hippo.github.io/spray/content

- -

-Installation

- +

Demo

+

Fully functional demo: http://the-happy-hippo.github.io/spray/content

+

Installation

    -
  1. Copy all files in content/ to some directory on your webserver.
  2. -
  3. Enjoy speed-reading.
  4. +
  5. Copy all files in content/ to some directory on your webserver.
  6. +
  7. Enjoy speed-reading.
- -

-Features

- +

Features

Coming soon...

- -

-Contributing

- +

Contributing

Please contribute bug reports, feature requests, etc.

- -

-Contributors

- +

Contributors

-
- -
- - - - - +
\ No newline at end of file diff --git a/index.jade b/index.jade new file mode 100644 index 0000000..9a37752 --- /dev/null +++ b/index.jade @@ -0,0 +1,46 @@ + +html + head + meta(charset='utf-8') + meta(http-equiv='X-UA-Compatible', content='chrome=1') + title Spray + link(rel='stylesheet', href='stylesheets/styles.css') + link(rel='stylesheet', href='stylesheets/pygment_trac.css') + meta(name='viewport', content='width=device-width, initial-scale=1, user-scalable=no') + //if lt IE 9 + script(src='//html5shiv.googlecode.com/svn/trunk/html5.js') + body + .wrapper + header + h1 Spray + p An open-source speed-reading application written in Javascript + p.view + a(href='https://github.com/the-happy-hippo/spray') + | View the Project on GitHub + small the-happy-hippo/spray + ul + li + a(href='https://github.com/the-happy-hippo/spray/zipball/master') + | Download + strong ZIP File + li + a(href='https://github.com/the-happy-hippo/spray/tarball/master') + | Download + strong TAR Ball + li + a(href='https://github.com/the-happy-hippo/spray') + | View On + strong GitHub + section + include:md README.md + + footer + p + | This project is maintained by + a(href='https://github.com/the-happy-hippo') the-happy-hippo + p + small + | Hosted on GitHub Pages — Theme by + a(href='https://github.com/orderedlist') orderedlist + script(src='javascripts/scale.fix.js') +