Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some cleanup #95

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

some cleanup #95

wants to merge 9 commits into from

Conversation

splitbrain
Copy link

This patch mostly fixes problems when minifying the code by making sure needed semicolons exist. It also removes a bunch of unnecessary semicolons and fixes possible problems with parseInt(). I also fixed a problem with the demo page on casesensitive filesystems (like Linux).

For fixing the code I tried to run the code through http://www.jshint.com/ using the following options:

/*jshint latedef:false, forin:true, eqeqeq:false, eqnull:true, noarg:true, noempty:true, bitwise:true, undef:true, browser:true, indent:4, maxerr:150, multistr:true, sub:true, smarttabs:true, white:false */

JSHint still find a whole bunch of problems mostly related to undefined variables. It seems like you're relying on several global variables (like settings for example). These should ideally be moved to become class members instead.

The patches should be pretty selfcontained, so feel free to cherrypick if you don't like certain things.

curly brackets have special meaning in regular expressions and should be
escaped when used as literal strings
Semicolons are only needed to terminate statements and assignments, they
are not needed for control structures or function bodies (except the
function is defined by assigning a closure, then it's an assignment
again)
some image files used uppercase extensions (.JPG) which will not work on
file sensitive filesystems.
this caused javascript errors for me
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.

None yet

1 participant