Skip to content

Latest commit

 

History

History

spreadsheet

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Web Spreadsheet in 99 Lines

Author: Audrey Tang
Languages: JS (ES6), HTML5, CSS3
Dependencies: AngularJS (1.3), Web Workers, Traceur Compiler
Alternatives: ReactJS (0.12), LiveScript (1.3), CoffeeScript (1.9), JS (ES5)

Chapter Text

Online Demo

Local Demo

Simply open index.html with Firefox, Safari or IE11+, and enter some content.

Values starting with = are parsed as formula written in JavaScript, for example =A1*C1.

If you'd like to use Chrome, type make run or node extra/static-here.js and connect to localhost:8888 to view the demo.

Building the Code

To build from source, first install NodeJS 0.10 or later, and run make (only tested on Linux/OSX at the moment).

JS source code (main.js and worker.js) are written in ECMAScript 6 (aka Harmony), specifically the feature-frozen draft as of August 2014.

For backward compatibility with ECMAScript 5 browsers, we use Traceur to compile source files into the es5/ directory.

If you prefer to work directly with the 2010 edition of JS, the as-javascript-1.8.5 directory has main.js and worker.js written in the style of ES5; the source code is line-by-line comparable to the ES6 version with the same line count.

For people preferring a cleaner syntax, the as-livescript-1.3.0 directory uses LiveScript instead of ES6 to write main.ls and worker.ls; the source code is 20 lines shorter than the JS version.

Building on the LiveScript language, the as-react-livescript directory uses the ReactJS framework; the source code is 10 lines more than the AngularJS equivalent, but runs considerably faster.

For the version without AngularJS version, using only basic ES5 and raw DOM APIs, the source code still clocks at 99 lines, albeit with some short statements joined together.

Thanks also to @dominicwong617 for contributing the as-coffeescript-1.9.0 version.

CC0 1.0 Universal

To the extent possible under law, 唐鳳 has waived all copyright and related or neighboring rights to "Web Spreadsheet in 99 Lines".

This work is published from Taiwan.

http://creativecommons.org/publicdomain/zero/1.0