Simon Lydell [Tue, 10 Sep 2013 10:40:34 +0000 (12:40 +0200)]
Fix #192: Clarify customization is in help dialog
- Add button in settings page to customize keyboard shortcuts (open the
help dialog)
- Change "Help" to "Keyboard shortcuts"
- Fix bug: Help dialog broke the layout in XUL pages
Simon Lydell [Wed, 4 Sep 2013 22:30:15 +0000 (00:30 +0200)]
Move `z-index` out of `.VimFxReset`
The hint markers need to set `z-index` dynamically (to rotate overlapping
markers). style.css is inserted as an agent sheet and uses `!important`
everywhere (this is needed to override userstyles, see commit 6145382),
and can therefore not be overrided by inline styles.
Therefore, I've moved `z-index` out of `.VimFxReset`, to each place that
actually _needs_ it: A few positioned elements.
1. It changed from "agent" sheets to "author" sheets
2. It removed all `!important`
That caused problems with userstyles in userContent.css or Stylish.
Website themes installed by the user often make the hint markers
unreadable, for example.
LordJZ [Fri, 2 Aug 2013 01:56:50 +0000 (05:56 +0400)]
Makefile cleanup.
Removed *.lint.coffee targets as they are never actually created.
Simplified lint target, now coffeelint runs for all the files at once.
Removed gen and zip phony targets.
Removed uglifyjs command text output.
Fixed order of operations when minifying js.
Simon Lydell [Tue, 30 Jul 2013 22:00:21 +0000 (00:00 +0200)]
Enhance performance
Instead of sorting the whole array of elements in each iteration of the
huffman tree construction, we now search backwards for the first index
where the sum to insert is equal to or greater than the weight at that
index. Directly after that index the sum is inserted. According to some
tests I made, this is about 3 times faster than before.
Simon Lydell [Tue, 30 Jul 2013 12:47:26 +0000 (14:47 +0200)]
Group all hint injection code in hints.coffee
Before, the hint/marker injection code was spread out in both hints.coffee
and marker.coffee. Creation and injection of markers does not really
belong to the Marker class. It is just a wrapper around a single markable
element.
Now, all hint/marker creation and injection is done in hints.coffee. This
has several benefits: The code is a lot easier to understand, and the
number of loops over arrays of markers could be reduced a lot, enhancing
performance.
I've also cleaned the code up, as well as removed code that was totally
useless: Before, `element.getClientRects()` was scanned for rectangles
matching the `isRectOk()` test. However, none of them could ever pass,
since `isRectOk()` looks for width and height properties on the
rectangles, which do not even exist (however, they do on the rectangle
returned by `element.getBoundingClientRect()`). This also fixes the uncaught
ReferenceErrors complaining about undefined width and height properties.
This also removed unnecessary loops, which enhances performance even more.
Some of these changes could have been made outside the huffman branch, I
realize now. However, it would take some work, and I'm not sure it is
worth it.
An improvement I noticed with this patch: It is now possible to click the
green, hidden until hover install buttons on AMO:
https://addons.mozilla.org/firefox/addon/VimFx/versions/
Simon Lydell [Tue, 30 Jul 2013 09:44:56 +0000 (11:44 +0200)]
Refactor to clarify and enhance performance
The code should be easier to understand now, and has a more flexible API.
Thanks to the latter, we now get better performance. Before, we had to
iterate the whole array of markers generated by `injectHints` both before
and after `addHuffmanCodeWordsTo`. Now, that is not necessary anymore.
Simon Lydell [Mon, 29 Jul 2013 21:19:00 +0000 (23:19 +0200)]
Change `markers?.length` into `markers.length`
The existence check is no longer needed, since `injectHints` now always
returns an array: Where it before returned `undefined`, it now returns an
empty array.