Skip to content

Commit

Permalink
Merge branch 'release-0.4.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
akhodakivskiy committed Jun 12, 2013
2 parents ba50ab5 + 49935f9 commit adb6f95
Show file tree
Hide file tree
Showing 13 changed files with 185 additions and 141 deletions.
95 changes: 95 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Release Notes

0.1 (26 Oct 2012)

- Initial Release

0.1.1 (27 Oct 2012)

- Just to deal with AMO - no changes

0.2 (5 Nov 2012)

- document.designMode='on' is now honored. Will also provide hint markers for iframes on the page.
- Bug fixed where it would completely reset the toolbar while installing the toolbar button.
- Bug fixed where it's not possible to change the text in the blaclisting textbox
- Changed u/d to scroll half a page, added c-f/c-b to scroll full page
- Added tab movement commands: c-J and c-K.
- Invisible markers bug fixed.
- Global hotkey to disable the commands (equal to the toolbar button click): Alt-Shift V
- ^u and ^d are removed from the command list. ^u is commonly used to show the page source code
- Opening new tab with now focuses the Address Bar
- Other small bugs nailed down.

0.3 (19 Nov 2012)

- Fixed [Desktop](https://addons.mozilla.org/en-us/firefox/addon/desktop/) extension compatibility problem
- Removed c-b/c-f for now. c-f is a standard search hotkey. Will put c-f back when proper Vim-like search with / is implemented
- Scrolling with G will now reach the bottom of the page
- Implemented localization, currently there is only Russian localization. Community is welcome
[to contribute your localizations](https://github.com/akhodakivskiy/VimFx/tree/master/extension/locale)!
- Implemented simple smooth scolling

0.3.2, 0.3.2, 0.3.3 (20-21 Nov 2012)

- Hotfixes for the build script to include localization related files and folders

0.4 (9 Dec 2012)

- Implemented find with `/` and `n/N`
- Added `ar` and `aR` commands to reload pages in all open tabs.
- Added a preference that enables bluring from any element that has input focus in the browser on Esc keydown (on by default)
- Fixed bug where markers and help dialog would blow up some of the pages.
- Marker hints are now sorted with respect to the underlying element area. Elements with larger area get shorter hints
- Added *mail.google.com* to the default black list
- Various bug fixed and improvements.

0.4.1, 0.4.2 (12-14 Dec 2012)

- Small tweaks of the find feature.
- Bugfix for keyboard handling on non-english keyboard layouts

0.4.3 (27 Dec 2012)

- Toolbar button bugfix
- Added an option to disable individual commands via the help dialog

0.4.4 (30 Jan 2013)

- Thanks to @mozillazg and @mcomella for translation contributions.
- Added `gh` command that will navigate to the home page.
- Added `o` command to focus address bar.
- `p` and `P` will parse the contents of the clipboard. If the string in the clipboard appears to be a url then it will navigate to this url. Otherwise it will search for the string in the clipboard using currently selected search provider.
- Now hint markers for links will stay on top of all the markers for different kinds of elements.
- Esc will now also close the focused default search bar.
- Fixed bugs related to keyboard events handling, XUL documents, and some other issues.
- Bug fixed where not all the commands could be disabled via the Help dialog.

0.4.5 (12 Mar 2013)

- `:` to open Firefox Developer Toolbar, `Esc` to close it.
- Add Hungarian locale (@thenonameguy).
- Add Polish locale (@grn).
- Don't close pinned tabs when pressing x (@grn).
- Switched to Makefile for building the extension release (@carno).
- Mrakers CSS tweaks (@helmuthdu)

0.4.6 (27 Mar 2013)

- Reimplemented find mode: CJK support, performace boost
- `a/` or `a.` to highlight all matches of the search string on the page
- Hint markers will now reach into iframes
- Key handling is disabled when a popupmenu or panel are shown
- `yf` will now also focus links and copy values from text/textarea element
- `vf` will show hit markers to focus the underlying element

0.4.7 (12 Jun 2013)

- `embed` and `object` tags will now have their own hints
- Bug fixes related to custom hint chars (@LordJZ)
- Fixed `t` - now it will be nice to other extensions
- Updated Chineese translations (@mozillazg)
- Reenter Normal mode on page reloads to avoid getting stuck in Hints mode withou any hints
- Search will focus element that contains matching text
- Fixed hint markers for iframes
- Marker bug fixes (@LordJZ)
85 changes: 0 additions & 85 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,88 +95,3 @@ Global shortcut to enable/disable VimFx: `Shift-Alt-v`
N Go to the previous Find match
?,> Show Help Dialog
Esc Close this dialog and cancel hint markers

## Release Notes

0.1 (26 Oct 2012)

- Initial Release

0.1.1 (27 Oct 2012)

- Just to deal with AMO - no changes

0.2 (5 Nov 2012)

- document.designMode='on' is now honored. Will also provide hint markers for iframes on the page.
- Bug fixed where it would completely reset the toolbar while installing the toolbar button.
- Bug fixed where it's not possible to change the text in the blaclisting textbox
- Changed u/d to scroll half a page, added c-f/c-b to scroll full page
- Added tab movement commands: c-J and c-K.
- Invisible markers bug fixed.
- Global hotkey to disable the commands (equal to the toolbar button click): Alt-Shift V
- ^u and ^d are removed from the command list. ^u is commonly used to show the page source code
- Opening new tab with now focuses the Address Bar
- Other small bugs nailed down.

0.3 (19 Nov 2012)

- Fixed [Desktop](https://addons.mozilla.org/en-us/firefox/addon/desktop/) extension compatibility problem
- Removed c-b/c-f for now. c-f is a standard search hotkey. Will put c-f back when proper Vim-like search with / is implemented
- Scrolling with G will now reach the bottom of the page
- Implemented localization, currently there is only Russian localization. Community is welcome
[to contribute your localizations](https://github.com/akhodakivskiy/VimFx/tree/master/extension/locale)!
- Implemented simple smooth scolling

0.3.2, 0.3.2, 0.3.3 (20-21 Nov 2012)

- Hotfixes for the build script to include localization related files and folders

0.4 (9 Dec 2012)

- Implemented find with `/` and `n/N`
- Added `ar` and `aR` commands to reload pages in all open tabs.
- Added a preference that enables bluring from any element that has input focus in the browser on Esc keydown (on by default)
- Fixed bug where markers and help dialog would blow up some of the pages.
- Marker hints are now sorted with respect to the underlying element area. Elements with larger area get shorter hints
- Added *mail.google.com* to the default black list
- Various bug fixed and improvements.

0.4.1, 0.4.2 (12-14 Dec 2012)

- Small tweaks of the find feature.
- Bugfix for keyboard handling on non-english keyboard layouts

0.4.3 (27 Dec 2012)

- Toolbar button bugfix
- Added an option to disable individual commands via the help dialog

0.4.4 (30 Jan 2013)

- Thanks to @mozillazg and @mcomella for translation contributions.
- Added `gh` command that will navigate to the home page.
- Added `o` command to focus address bar.
- `p` and `P` will parse the contents of the clipboard. If the string in the clipboard appears to be a url then it will navigate to this url. Otherwise it will search for the string in the clipboard using currently selected search provider.
- Now hint markers for links will stay on top of all the markers for different kinds of elements.
- Esc will now also close the focused default search bar.
- Fixed bugs related to keyboard events handling, XUL documents, and some other issues.
- Bug fixed where not all the commands could be disabled via the Help dialog.

0.4.5 (12 Mar 2013)

- `:` to open Firefox Developer Toolbar, `Esc` to close it.
- Add Hungarian locale (@thenonameguy).
- Add Polish locale (@grn).
- Don't close pinned tabs when pressing x (@grn).
- Switched to Makefile for building the extension release (@carno).
- Mrakers CSS tweaks (@helmuthdu)

0.4.6 (27 Mar 2013)

- Reimplemented find mode: CJK support, performace boost
- `a/` or `a.` to highlight all matches of the search string on the page
- Hint markers will now reach into iframes
- Key handling is disabled when a popupmenu or panel are shown
- `yf` will now also focus links and copy values from text/textarea element
- `vf` will show hit markers to focus the underlying element
4 changes: 2 additions & 2 deletions extension/install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>[email protected]</em:id>
<em:homepageURL>http://www.github.com/akhodakivskiy/VimFx</em:homepageURL>
<em:version>0.4.6</em:version>
<em:version>0.4.7</em:version>
<em:type>2</em:type>
<em:bootstrap>true</em:bootstrap>
<em:optionsType>2</em:optionsType>
Expand All @@ -24,7 +24,7 @@
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>12.0</em:minVersion>
<em:maxVersion>20.*</em:maxVersion>
<em:maxVersion>22.*</em:maxVersion>
</Description>
</em:targetApplication>

Expand Down
6 changes: 3 additions & 3 deletions extension/locale/zh-CN/options.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
<!ENTITY pref.scroll_step.desc "滚动步长">

<!ENTITY pref.blur_on_esc.title "Esc 键功能">
<!ENTITY pref.blur_on_esc.desc "当按下 Esc 键时光标将离开聚焦的浏览器输入框(比如地址栏)">
<!ENTITY pref.blur_on_esc.desc "当按下 Esc 键时光标将离开任何聚焦的输入框(比如地址栏)">

<!ENTITY pref.leave_dt_on_esc.title "Leave Developer Toolbar open on Esc">
<!ENTITY pref.leave_dt_on_esc.desc "Do not hide Developer Toolbar if it's visible and the Esc is pressed">
<!ENTITY pref.leave_dt_on_esc.title "按下 Esc 键时,光标将离开打开的开发者工具栏">
<!ENTITY pref.leave_dt_on_esc.desc "按下 Esc 键时,将不会隐藏打开的开发者工具栏,只是让它失去焦点">

<!ENTITY pref.scroll_time.title "平滑滚动">
<!ENTITY pref.smooth_time.disabled "禁用">
Expand Down
6 changes: 3 additions & 3 deletions extension/locale/zh-CN/vimfx.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ help_section_urls =处理 URL
help_command_o =聚焦地址栏
help_command_p =打开剪贴板中的链接
help_command_P =在新标签页中打开剪贴板中的链接
help_command_yf =Copy link url or text input value to the clipboard(needs translation)
help_command_vf =Focus element (needs translation)
help_command_yf =复制链接地址或输入框文本到剪贴板
help_command_vf =聚焦元素
help_command_yy =复制当前标签页链接到剪贴板
help_command_r =重新载入当前页面
help_command_R =重新载入当前页面及所有外部资源(js,css,img)
Expand Down Expand Up @@ -55,7 +55,7 @@ help_command_find =进入查找模式
help_command_find_hl=进入查找模式 (needs translation)
help_command_n =跳到下一个查找匹配项
help_command_N =跳到上一个查找匹配项
help_command_dev =Open Developer Toolbar(needs translation)
help_command_dev =打开开发者工具栏

help=帮助
help_version=版本
Expand Down
11 changes: 3 additions & 8 deletions extension/packages/commands.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,7 @@ command_P = (vim) ->
# Open new tab and focus the address bar
command_t = (vim) ->
if chromeWindow = utils.getRootWindow vim.window
if gBrowser = chromeWindow.gBrowser
# Get the default url for the new tab
newtab_url = getFirefoxPref 'browser.newtab.url'
gBrowser.selectedTab = gBrowser.addTab newtab_url
# Focus the address bar
chromeWindow.focusAndSelectUrlBar()
chromeWindow.BrowserOpenTab()

# Copy element URL to the clipboard
command_yf = (vim) ->
Expand Down Expand Up @@ -254,12 +249,12 @@ command_find_hl = (vim) ->
# Search for the last pattern
command_n = (vim) ->
if vim.findStr.length > 0
vim.findRng = find.find vim.window, vim.findStr, vim.findRng, find.DIRECTION_FORWARDS
vim.findRng = find.find vim.window, vim.findStr, vim.findRng, find.DIRECTION_FORWARDS, true

# Search for the last pattern backwards
command_N = (vim) ->
if vim.findStr.length > 0
vim.findRng = find.find vim.window, vim.findStr, vim.findRng, find.DIRECTION_BACKWARDS
vim.findRng = find.find vim.window, vim.findStr, vim.findRng, find.DIRECTION_BACKWARDS, true

# Close the Help dialog and cancel the pending hint marker action
command_Esc = (vim) ->
Expand Down
1 change: 1 addition & 0 deletions extension/packages/events.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ tabsListener =
onLocationChange: (browser, webProgress, request, location) ->
blacklisted = utils.isBlacklisted location.spec, getPref 'black_list'
if vim = vimBucket.get(browser.contentWindow)
vim.enterNormalMode()
vim.blacklisted = blacklisted
if rootWindow = utils.getRootWindow vim.window
setWindowBlacklisted rootWindow, vim.blacklisted
Expand Down
16 changes: 14 additions & 2 deletions extension/packages/find.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ injectFind = (document, cb) ->
# Call back on (Shift)-Enter with proper direction
input.addEventListener 'keypress', (event) ->
if event.keyCode == event.DOM_VK_RETURN
focusSelection(document, Ci.nsISelectionController.SELECTION_FIND)
removeFind(document, false)

document.documentElement.appendChild div
Expand All @@ -36,6 +37,14 @@ removeFind = (document, clear = true) ->
if clear
clearSelection(document.defaultView)

focusSelection = (document, selectionType) ->
if controller = getController(document.defaultView)
if selection = controller.getSelection(selectionType)
if selection.rangeCount > 0
element = selection.getRangeAt(0).commonAncestorContainer?.parentNode
if element.focus
element.focus()

createFindContainer = (document) ->
div = document.createElement 'div'
div.className = 'VimFxReset'
Expand All @@ -62,7 +71,7 @@ findFactory = (selectionType) ->
.createInstance()
.QueryInterface(Components.interfaces.nsIFind)

return (window, findStr, findRng = null, direction = DIRECTION_FORWARDS) ->
return (window, findStr, findRng = null, direction = DIRECTION_FORWARDS, focus = false) ->
# `find` will also recursively search in all frames. # `innerFind` does the work:
# searches, selects, scrolls, and optionally reaches into frames
innerFind = (window) ->
Expand All @@ -87,7 +96,10 @@ findFactory = (selectionType) ->

if range = finder.Find(findStr, searchRange, startPt, endPt)
controller.getSelection(selectionType).addRange(range)
controller.scrollSelectionIntoView(selectionType, range, 0)
controller.scrollSelectionIntoView(selectionType, range, Ci.nsISelectionController.SCROLL_CENTER_VERTICALLY)
if focus
focusSelection(window.document, selectionType)

return range

clearSelection(window, selectionType)
Expand Down
2 changes: 1 addition & 1 deletion extension/packages/hints.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ injectHints = (document) ->
document.documentElement.appendChild container

for frame in document.defaultView.frames
markers = markers.concat inner(frame.document, markers.length)
markers = markers.concat inner(frame.document, markers.length+1)

return markers

Expand Down
17 changes: 10 additions & 7 deletions extension/packages/marker.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ XPathResult = Ci.nsIDOMXPathResult

{ getPref } = require 'prefs'

utils = require 'utils'

# All elements that have one or more of the following properties
# qualify for their own marker in hints mode
MARKABLE_ELEMENT_PROPERTIES = [
Expand All @@ -26,9 +28,10 @@ MARKABLE_ELEMENTS = [
"button"
"select"
"input[not(@type='hidden' or @disabled or @readonly)]"
"embed"
"object"
]


# Marker class wraps the markable element and provides
# methods to manipulate the markers
class Marker
Expand Down Expand Up @@ -104,7 +107,7 @@ class Marker
#
# The array of markers is returned
Marker.createMarkers = (document, startIndex) ->
hintChars = getPref('hint_chars').toLowerCase()
hintChars = utils.getHintChars()

set = getMarkableElements(document)
markers = [];
Expand Down Expand Up @@ -230,12 +233,12 @@ getElementRect = (element) ->
for rect in rects
if rect.width == 0 or rect.height == 0
for childElement in element.children
computedStyle = window.getComputedStyle childElement, null
if computedStyle.getPropertyValue 'float' != 'none' or \
computedStyle.getPropertyValue 'position' == 'absolute'
if computedStyle = window.getComputedStyle childElement, null
if computedStyle.getPropertyValue('float') != 'none' or \
computedStyle.getPropertyValue('position') == 'absolute'

childRect if childRect = getElementRect childElement
return childRect if childRect = getElementRect childElement

return undefined

exports.Marker = Marker
exports.Marker = Marker
5 changes: 4 additions & 1 deletion extension/packages/prefs.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ getPref = do ->

return (key, defaultValue=undefined) ->
value = getBranchPref branch, key, defaultValue
return if value == undefined then DEFAULT_PREF_VALUES[key] else value
return if value == undefined then getDefaultPref(key) else value

getDefaultPref = (key) -> return DEFAULT_PREF_VALUES[key]

getFirefoxPref = do ->
prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService)
Expand Down Expand Up @@ -98,6 +100,7 @@ isCommandDisabled = (key) ->
return false

exports.getPref = getPref
exports.getDefaultPref = getDefaultPref
exports.getFirefoxPref = getFirefoxPref
exports.setPref = setPref
exports.isCommandDisabled = isCommandDisabled
Expand Down
Loading

0 comments on commit adb6f95

Please sign in to comment.