├── .editorconfig
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── bower.json
├── dist
├── typebetter.js
└── typebetter.min.js
├── example
└── index.html
├── package.json
├── scripts
└── build.sh
├── src
└── typebetter.js
└── typebetter.gif
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: http://EditorConfig.org
2 | root = true
3 |
4 | [*]
5 | end_of_line = lf
6 | indent_size = 2
7 | indent_style = space
8 | insert_final_newline = true
9 |
10 | [*.md]
11 | indent_style = tab
12 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to TypeBetter
2 |
3 | ## Install development dependencies
4 |
5 | TypeBetter's build process uses [npm](https://www.npmjs.com/) and [Node.js](http://nodejs.org/). If you're using a Mac, the easiest way to install npm and Node.js (and plenty of other great tools) is with [Homebrew](http://brew.sh/):
6 |
7 | brew install node
8 |
9 | If you're using a different operating system, use a different package manager, or prefer not to use Homebrew, check out the [Node.js Downloads page](http://nodejs.org/download/).
10 |
11 | ## Get set up to contribute
12 |
13 | Contributing to TypeBetter is pretty straightforward:
14 |
15 | 1. Fork the TypeBetter repo and clone your fork.
16 | 1. Install development dependencies by running `npm install` from the root of the project.
17 | 1. Create a feature branch for the issue or new feature you're looking to tackle: `git checkout -b your-descriptive-branch-name`.
18 | 1. _Write some code!_
19 | 1. Commit your changes: `git commit -am 'Add some new feature or fix some issue'`.
20 | 1. Push the branch to your fork of TypeBetter: `git push origin your-descriptive-branch-name`.
21 | 1. Create a new Pull Request and we'll give it a look!
22 |
23 | ## "But what files do I change?!?"
24 |
25 | Excellent question. TypeBetter's source code is in the file `src/typebetter.js`. Make your changes here!
26 |
27 | When you're done working (and before you push your code or issue a pull request), run `npm run build` from the root of the project to recreate the files in the `dist` folder. This task will generate compiled and compressed versions of the project.
28 |
29 | **Do not directly edit the files in the `dist` folder!**
30 |
31 | ## Code Style
32 |
33 | Code styles are like opinions: Everyone's got one and yours is better than mine. TypeBetter's coding styles are defined in the `.editorconfig` file which uses the [EditorConfig](http://editorconfig.org/) syntax. There are [a number of great plugins for a variety of editors](http://editorconfig.org/#download) that utilize the settings in the `.editorconfig` file.
34 |
35 | Basically, follow along with the conventions present in the existing code as best you can.
36 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2014 Vox Media Inc., Yuri Victor.
2 |
3 | BSD license
4 |
5 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6 |
7 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8 |
9 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
10 |
11 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
12 |
13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # TypeBetter
2 |
3 | Fixes typography while a user types. Making dumb quotes smart again.
4 |
5 | 
6 |
7 | [See it live!](http://yurivictor.com/smartquotes/)
8 |
9 | Perpetually a work in progress. Currently succeeds more than it fails.
10 |
11 | ## Replacements
12 |
13 |
14 |
15 |
16 |
17 |
Before
18 |
After
19 |
20 |
21 |
22 |
23 |
Smart Quotes
24 |
"Foo"
25 |
“Foo”
26 |
27 |
28 |
'Foo'
29 |
‘Foo’
30 |
31 |
32 |
Apostrophes
33 |
Foo's
34 |
Foo’s
35 |
36 |
37 |
Primes and Double Primes (feet, inches, latitude, and longitude)