|
|
|
@ -4,14 +4,8 @@ import * as actions from '../shared/actions'; |
|
|
|
|
|
|
|
|
|
var footer = null; |
|
|
|
|
|
|
|
|
|
const invokeEvent = (action) => { |
|
|
|
|
if (typeof action === 'undefined' || action === null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
switch (action[0]) { |
|
|
|
|
case actions.CMD_OPEN: |
|
|
|
|
footer = new FooterLine(document); |
|
|
|
|
const createFooterLine = (initial = '') => { |
|
|
|
|
footer = new FooterLine(document, initial); |
|
|
|
|
footer.onPromptChange((e) => { |
|
|
|
|
let request = { |
|
|
|
|
type: 'event.cmd.suggest', |
|
|
|
@ -27,6 +21,24 @@ const invokeEvent = (action) => { |
|
|
|
|
browser.runtime.sendMessage(request); |
|
|
|
|
}); |
|
|
|
|
footer.focus(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const invokeEvent = (action) => { |
|
|
|
|
if (typeof action === 'undefined' || action === null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
switch (action[0]) { |
|
|
|
|
case actions.CMD_OPEN: |
|
|
|
|
createFooterLine(); |
|
|
|
|
break; |
|
|
|
|
case actions.CMD_TABS_OPEN: |
|
|
|
|
if (action[1] || false) { |
|
|
|
|
// alter url
|
|
|
|
|
createFooterLine('open ' + window.location.href); |
|
|
|
|
} else { |
|
|
|
|
createFooterLine('open '); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case actions.SCROLL_UP: |
|
|
|
|
scrolls.scrollUp(window, action[1] || 1); |
|
|
|
|