Skip to content

Miscelaneous improvements#5

Open
rbrito wants to merge 27 commits intolrem:masterfrom
rbrito:improvements
Open

Miscelaneous improvements#5
rbrito wants to merge 27 commits intolrem:masterfrom
rbrito:improvements

Conversation

@rbrito
Copy link
Copy Markdown
Collaborator

@rbrito rbrito commented May 2, 2014

Hi.

The code for enjoyreading is in a very bad state and I started working a little bit on it. Some of the commits here are janitorial, some are functional. My commit messages are a bit on the verbose side, explaining why I am taking a given decision.

Unfortunately, it seems like a huge amount of effort is needed to bring this extension up to shape (and some static analysis tools are badly needed here).

I think that with the right amount of focused effort, we may get it to be offered on addons.mozilla.org.

I am badly interested in anything that improves the readability of some sites, since I have very poor eyesight and working on an extension is a good excuse to learn some javascript and some creation of extensions.

Please, review and consider merging these commits.

Thanks,

Rogério Brito.

Rogério Brito added 27 commits May 2, 2014 11:32
This was taken straight from

   https://github.com/jashkenas/underscore/releases/tag/1.2.2

and should address issue lrem#2.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
The file is terrible as is and should be reindented, passed through a
[lint-like utility][0], refactored and [optimized][1] both for computers as
well as for humans.

[0]: http://csslint.net/
[1]: http://cleancss.com/

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
It is not like we are after saving the last few bytes. And, in the case
where we are, we can always minify the files before including them in the
resulting xpi.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
These are pesky things, but they make the code more readable.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
This shouldn't affect the rendering of the page.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
This (and other comments) should quite probably be removed from the source
code. It will, after all, be available in the git history, in case it is
needed in the future.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
These data files should not be part of the CSS (which is supposed to be
"source code") and, if possible, should be sourced from external files.

If we are really looking to squeeze the last bytes (which we weren't, since
base64 encoded files are usually 4/3 the original size), we can consider the
option of using sprites for this purpose, but that's a decision for the
future.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
I optimized (losslessly) the PNG files with the following sequence of
commands:

    optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 *.png
    advpng -z3 *.png
    advpng -z4 -i2500 *.png
    advdef -z3 *.png
    advdef -z4 -i2500 *.png

and the savings were amazing in relation with what we had before: about 10KB
(which, and if we convert back with base64 encoding, would result in 4/3 *
10 = 13 fewer KB).

This goes on to show that the previous strategy of mixing the code with data
renders both unreadable code as well as hindering software maintenance.
Furthermore, any review process might consider this an improvement, as there
are no blobs embedded in the code (once we remove them from the CSS files).

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
This dark mode is based on the original Athelas mode from Readability (with
the same colors), but, of course, without font blobs. Furthermore, only Free
fonts are used.

Note that the icon for the dark mode is currently the same as the one for
terminal mode, but once things get working, this is simply a matter of
cosmetics.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
This should be moved out from there, but let's keep it simple first.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
Otherwise, we get a lot of warnings when using `cfx xpi`.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
It is still not that great, but better than the previous situation.  We
should probably use dimensinons that are not fixed, but dependent on the
size of the window.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
Since we are basing our work on the original Enjoy Reading, the original
license is at:

    https://addons.mozilla.org/en-Us/firefox/addon/enjoy-reading/license/1.0.1

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
According to [the reference][0], the `fullName` field is deprecated in favor
of the `title` field.

This patch changes this accordingly.

[0]: https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/package_json

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
I also took the opportunity to remove the generic (and misleading) label of
the previous icon.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
This is more in line with what the previous author (jblanche) adopted.  I am
thinking about changing the name of the extention, anyway.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
This will allow us to change things frequently.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant