Skip to content

Commit

Permalink
Merge branch 'release-0.4.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
akhodakivskiy committed Mar 26, 2013
2 parents ef7b45c + 392b792 commit 1902cc5
Show file tree
Hide file tree
Showing 16 changed files with 295 additions and 175 deletions.
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Global shortcut to enable/disable VimFx: `Shift-Alt-v`
p Navigate to the address in the clipboard
P Open new tab and navigate to the address in the clipboard
yf Copy link url to the clipboard
vf Focus element
yy Copy current page link to the clipboard
r Reload current page
R Reload current page and all the assets (js, css, etc.)
Expand All @@ -57,8 +58,8 @@ Global shortcut to enable/disable VimFx: `Shift-Alt-v`

gg Scroll to the Top of the page
G Scroll to the Bottom of the page
j c-e Scroll Down
k c-y Scroll Up
j,c-e Scroll Down
k,c-y Scroll Up
h Scroll Left
l Scroll Right
d Scroll half a Page Down
Expand All @@ -69,13 +70,13 @@ Global shortcut to enable/disable VimFx: `Shift-Alt-v`
### Tabs

t Open New Blank tab
J gT Go to the Previous tab
K gt Go to the Next tab
J,gT Go to the Previous tab
K,gt Go to the Next tab
c-J Move current tab to the Left
c-K Move current tab to the Right
gh Navigate to the Home Page
gH g0 Go to the First tab
gL g$ Go to the Last tab
gH,g0 Go to the First tab
gL,g$ Go to the Last tab
x Close current tab
X Restore last closed tab

Expand All @@ -89,6 +90,7 @@ Global shortcut to enable/disable VimFx: `Shift-Alt-v`
### Misc

.,/ Enter Find mode
a.,a/ Enter Find mode to highlight all matches
n Go to the next Find match
N Go to the previous Find match
?,> Show Help Dialog
Expand Down Expand Up @@ -169,3 +171,12 @@ Global shortcut to enable/disable VimFx: `Shift-Alt-v`
- 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
2 changes: 1 addition & 1 deletion 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.5</em:version>
<em:version>0.4.6</em:version>
<em:type>2</em:type>
<em:bootstrap>true</em:bootstrap>
<em:optionsType>2</em:optionsType>
Expand Down
4 changes: 3 additions & 1 deletion extension/locale/en-US/vimfx.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ help_section_urls =Dealing with URLs
help_command_o =Focus the Address Bar
help_command_p =Navigate to the address in the clipboard
help_command_P =Open new tab and navigate to the address in the clipboard
help_command_yf =Copy link url to the clipboard
help_command_yf =Copy link url or text input value to the clipboard
help_command_vf =Focus element
help_command_yy =Copy current page link to the clipboard
help_command_r =Reload current page
help_command_R =Reload current page and all assets (js, css, img)
Expand Down Expand Up @@ -51,6 +52,7 @@ help_section_misc =Misc
help_command_help =Show Help Dialog
help_command_Esc =Close this dialog and cancel hint markers
help_command_find =Enter Find mode
help_command_find_hl=Enter Find mode highlighting all matches
help_command_n =Go to the next Find match
help_command_N =Go to the previous Find match
help_command_dev =Open Developer Toolbar
Expand Down
4 changes: 3 additions & 1 deletion extension/locale/hu-HU/vimfx.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ help_section_urls =URL műveletek
help_command_o =Fókusz a címsorra
help_command_p =A vágólapon található link megnyitása
help_command_P =A vágólapon található link megnyitása új tabban
help_command_yf =Link címének másolása vágólapra
help_command_yf =Copy link url or text input value to the clipboard (needs translation)
help_command_vf =Focus element (needs translation)
help_command_yy =Aktuális oldal címének másolása vágólapra
help_command_r =Oldal újratöltése
help_command_R =Oldal újratöltése minden elemmel együtt (js, css, img)
Expand Down Expand Up @@ -50,6 +51,7 @@ help_section_misc =Általános
help_command_help =Súgó megjelenítése
help_command_Esc =Ennek az ablaknak bezárása és segédletek elrejtése
help_command_find =Keresési módba lépés
help_command_find_hl=Enter Find mode highlighting all matches(needs translation)
help_command_n =Következő találatra ugrás
help_command_N =Előző találatra ugrás
help_command_dev =Open Developer Toolbar(needs translation)
Expand Down
4 changes: 3 additions & 1 deletion extension/locale/hu/vimfx.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ help_section_urls =URL műveletek
help_command_o =Fókusz a címsorra
help_command_p =A vágólapon található link megnyitása
help_command_P =A vágólapon található link megnyitása új tabban
help_command_yf =Link címének másolása vágólapra
help_command_yf =Copy link url or text input value to the clipboard (needs translation)
help_command_vf =Focus element (needs translation)
help_command_yy =Aktuális oldal címének másolása vágólapra
help_command_r =Oldal újratöltése
help_command_R =Oldal újratöltése minden elemmel együtt (js, css, img)
Expand Down Expand Up @@ -50,6 +51,7 @@ help_section_misc =Általános
help_command_help =Súgó megjelenítése
help_command_Esc =Ennek az ablaknak bezárása és segédletek elrejtése
help_command_find =Keresési módba lépés
help_command_find_hl=Enter Find mode highlighting all matches (needs translation)
help_command_n =Következő találatra ugrás
help_command_N =Előző találatra ugrás
help_command_dev =Open Developer Toolbar(needs translation)
Expand Down
4 changes: 3 additions & 1 deletion extension/locale/pl/vimfx.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ help_section_urls =Praca z adresami
help_command_o =Przejdź do paska adresu
help_command_p =Przejdź pod adres w schowku
help_command_P =Przejdź pod adres w schowku w nowej karcie
help_command_yf =Kopiuj adres linku do schowka
help_command_yf =Copy link url or text input value to the clipboard (needs translation)
help_command_vf =Focus element (needs translation)
help_command_yy =Kopiuj adres bieżącej strony do schowka
help_command_r =Odśwież bieżącą stronę
help_command_R =Odśwież bieżącą stronę wraz z zasobami (js, css, img)
Expand Down Expand Up @@ -51,6 +52,7 @@ help_section_misc =Różne
help_command_help =Wyświetl okno pomocy
help_command_Esc =Zamknij to okno / ukryj podpowiedzi przy linkach
help_command_find =Znajdź
help_command_find_hl=Enter Find mode highlighting all matches(needs translation)
help_command_n =Znajdź następne
help_command_N =Znajdź poprzednie
help_command_dev =Open Developer Toolbar(needs translation)
Expand Down
10 changes: 6 additions & 4 deletions extension/locale/ru/vimfx.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ help_section_urls =Адресная Строка
help_command_o =Фокус на адресную строку
help_command_p =Перейти по адресу в буфере обмена
help_command_P =Открыть новую вкладку и перейти по адресу в буфере обмена
help_command_yf =Скопировать в буфер обмена адрес ссылки на сранице при помощи маркеров
help_command_yf =Скопировать в буфер обмена адрес ссылки или текст в элементе ввода
help_command_vf =Сфокусироваться на элемент
help_command_yy =Скопировать в буфер обмена адрес текцщей сраницы
help_command_r =Перезагрузить текущую страницу
help_command_R =Перезагрузить текущую страницу и все ресурсы (js, css, img)
Expand Down Expand Up @@ -42,15 +43,16 @@ help_command_X =Восстановить последнюю закрыту


help_section_browse =Навигация
help_command_f =Перейти по ссылке при помощи маркеров
help_command_F =Перейти по ссылке в новой вкладке при помощи маркеров
help_command_f =Перейти по ссылке
help_command_F =Перейти по ссылке в новой вкладке
help_command_H =Предыдущая страница
help_command_L =Следующая страница

help_section_misc =Разное
help_command_help =Показать справку
help_command_Esc =Закрыть справку или отменить действие с маркерами
help_command_Esc =Закрыть справку, поиск или отменить действие с маркерами
help_command_find =Режим поиска
help_command_find_hl=Режим поиска с выделением всех совпадений
help_command_n =Перейти к следующему результату поиска
help_command_N =Перейти к предыдущему результату поиска
help_command_dev =Открыть Панель Разработки
Expand Down
4 changes: 3 additions & 1 deletion extension/locale/zh-CN/vimfx.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ help_section_urls =处理 URL
help_command_o =聚焦地址栏
help_command_p =打开剪贴板中的链接
help_command_P =在新标签页中打开剪贴板中的链接
help_command_yf =复制链接 URL 到剪贴板
help_command_yf =Copy link url or text input value to the clipboard(needs translation)
help_command_vf =Focus element (needs translation)
help_command_yy =复制当前标签页链接到剪贴板
help_command_r =重新载入当前页面
help_command_R =重新载入当前页面及所有外部资源(js,css,img)
Expand Down Expand Up @@ -51,6 +52,7 @@ help_section_misc =杂项
help_command_help =显示帮助对话框
help_command_Esc =关闭此对话框及取消提示(hint)标记
help_command_find =进入查找模式
help_command_find_hl=进入查找模式 (needs translation)
help_command_n =跳到下一个查找匹配项
help_command_N =跳到上一个查找匹配项
help_command_dev =Open Developer Toolbar(needs translation)
Expand Down
74 changes: 27 additions & 47 deletions extension/packages/commands.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,25 @@ command_t = (vim) ->
# Focus the address bar
chromeWindow.focusAndSelectUrlBar()

# Copy current URL to the clipboard
# Copy element URL to the clipboard
command_yf = (vim) ->
markers = hints.injectHints vim.window.document
if markers?.length > 0
# This callback will be called with the selected marker as argument
cb = (marker) ->
if url = marker.element.href
marker.element.focus()
utils.writeToClipboard vim.window, url
else if utils.isTextInputElement marker.element
utils.writeToClipboard vim.window, marker.element.value

vim.enterHintsMode(markers, cb)

# Focus element
command_vf = (vim) ->
markers = hints.injectHints vim.window.document
if markers?.length > 0
vim.enterHintsMode(markers, ((marker) -> marker.element.focus()))

# Copy current URL to the clipboard
command_yy = (vim) ->
utils.writeToClipboard vim.window, vim.window.location.toString()
Expand Down Expand Up @@ -230,22 +238,28 @@ command_help = (vim) ->

# Switch into find mode
command_find = (vim) ->
vim.enterFindMode()
vim.findStr = ""

find.injectFind vim.window.document
find.injectFind vim.window.document, (findStr, direction) ->
# Reset region and find string if new find stirng has arrived
if vim.findStr != findStr
[vim.findStr, vim.findRng] = [findStr, null]
# Perform forward find and store found region
return vim.findRng = find.find vim.window, vim.findStr, vim.findRng, find.DIRECTION_FORWARDS

# Switch into find mode with highlighting
command_find_hl = (vim) ->
find.injectFind vim.window.document, (findStr) ->
# Reset region and find string if new find stirng has arrived
return find.highlight vim.window, findStr

# Search for the last pattern
command_n = (vim) ->
if vim.findStr.length > 0
if not find.find vim.window, vim.findStr, false
find.flashFind vim.window.document, "#{ vim.findStr } (Not Found)"

vim.findRng = find.find vim.window, vim.findStr, vim.findRng, find.DIRECTION_FORWARDS

# Search for the last pattern backwards
command_N = (vim) ->
if vim.findStr.length > 0
if not find.find vim.window, vim.findStr, true
find.flashFind vim.window.document, "#{ vim.findStr } (Not Found)"
vim.findRng = find.find vim.window, vim.findStr, vim.findRng, find.DIRECTION_BACKWARDS

# Close the Help dialog and cancel the pending hint marker action
command_Esc = (vim) ->
Expand Down Expand Up @@ -278,6 +292,7 @@ commandGroups =
'p': [ command_p, _('help_command_p') ]
'P': [ command_P, _('help_command_P') ]
'y,f': [ command_yf, _('help_command_yf') ]
'v,f': [ command_vf, _('help_command_vf') ]
'y,y': [ command_yy, _('help_command_yy') ]
'r': [ command_r, _('help_command_r') ]
'R': [ command_R, _('help_command_R') ]
Expand Down Expand Up @@ -314,6 +329,7 @@ commandGroups =
'misc':
# `.` is added to find command mapping to hack around Russian keyboard layout
'\.|/': [ command_find, _('help_command_find') ]
'a,\.|a,/': [ command_find_hl,_('help_command_find_hl') ]
'n': [ command_n, _('help_command_n') ]
'N': [ command_N, _('help_command_N') ]
# `>` is added to help command mapping to hack around Russian keyboard layout
Expand Down Expand Up @@ -360,42 +376,6 @@ hintCharHandler = (vim, keyStr, charCode) ->
vim.enterNormalMode()
break

# Called in find mode. Will process charCode, update find, or close the
findCharHandler = (vim, keyStr, charCode) ->
backwards = false

toNormalMode = ->
find.removeFind vim.window.document
vim.enterNormalMode()

if keyStr and keyStr.match(/.*Return/)
return toNormalMode()
else if keyStr == 'Backspace'
# Delete last available character from the query string
if vim.findStr.length > 0
vim.findStr = vim.findStr.substr(0, vim.findStr.length - 1)
# Leave Find Mode the query string is already empty
else
return toNormalMode()
else if charCode > 0
vim.findStr += String.fromCharCode(charCode)
else
return

# Update the interface string

# Clear selection to avoid jumping between matching search results
vim.window.getSelection().removeAllRanges()

# Search only if the query string isn't emply.
# Otherwise it will pop up Find dialog
if find.find vim.window, vim.findStr, backwards
find.setFindStr vim.window.document, vim.findStr
else
find.setFindStr vim.window.document, "#{ vim.findStr } (Not Found)"


exports.hintCharHandler = hintCharHandler
exports.findCharHandler = findCharHandler
exports.commands = commands
exports.commandsHelp = commandsHelp
17 changes: 15 additions & 2 deletions extension/packages/events.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ keyStrFromEvent = (event) ->

return keyStr

# Passthrough mode is activated when VimFx should temporarily stop processking
# keyboard input. For example when a context menu is whown
passthrough = false

# The following listeners are installed on every top level Chrome window
windowsListener =
'keydown': (event) ->

if getPref 'disabled'
if passthrough or getPref 'disabled'
return

try
Expand All @@ -57,7 +61,7 @@ windowsListener =

'keypress': (event) ->

if getPref 'disabled'
if passthrough or getPref 'disabled'
return

try
Expand Down Expand Up @@ -103,6 +107,15 @@ windowsListener =

vim.lastKeyStr = null

'popupshown': (event) ->
if event.target.tagName in [ 'menupopup', 'panel' ]
passthrough = true


'popuphidden': (event) ->
if event.target.tagName in [ 'menupopup', 'panel' ]
passthrough = false

# When the top level window closes we should release all Vims that were
# associated with tabs in this window
'DOMWindowClose': (event) ->
Expand Down
Loading

0 comments on commit 1902cc5

Please sign in to comment.