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 @@ - - -
- - -An open-source speed-reading application written in Javascript
- - - - - -An open-source speed-reading application written in Javascript
An open-source speed-reading application written in Javascript.
- -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.
- -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
- -Fully functional demo: http://the-happy-hippo.github.io/spray/content
+content/
to some directory on your webserver.content/
to some directory on your webserver.Coming soon...
- -Please contribute bug reports, feature requests, etc.
- -