wyantb / HashMask

A browser addon for password fields, adding a visual hash to aid in memorability.
5 stars 0 forks source link

Create options.js #20

Closed nickserv closed 12 years ago

nickserv commented 12 years ago

For code style, organization, and caching reasons, it would be nice if we had the JavaScript for options.html all in one file (since all the JavaScript there is in one place at the bottom anyway, and we can just load this from a different file at the end of the page instead). Want me to do this? It's a really easy fix.

wyantb commented 12 years ago

Sure. Just the actual functions there, don't have it load all the other JS files or anything (no $.getScript). When you do, attribute it like src/inject.js

nickserv commented 12 years ago

Oh god yeah, that would be really derpy. I didn't even know you could do that in jQuery. o_o And alright.

wyantb commented 12 years ago

Sure. Basically, just append stuff to your <head>, and bam, new Javascript/CSS (just one method of including JS). My senior project uses it rather liberally, as it turns out.

nickserv commented 12 years ago

I was going to move crap to the head, but I realize it's probably a good idea to leave everything at the bottom for speed reasons. (The disadvantage is JavaScript might be wonky before the page is loaded, but the advantage is the page is visually loaded before all the JavaScript needs to be downloaded.)

Welp, the JavaScript is in a different file now. I'm leaving this issue open until I'm sure the credits on options.js are good, though. Please look at the file. I literally just copied the top comment block from src/inject.js. Is that enough? Should I mention that it requires Bootstrap? Anything else?

wyantb commented 12 years ago

Might as well mention that it requires Boostrap, sure. Not of terribly critical importance, though.