|
|
@ -34,6 +34,7 @@ export default class Follow { |
|
|
|
this.win = win; |
|
|
|
this.win = win; |
|
|
|
this.store = store; |
|
|
|
this.store = store; |
|
|
|
this.newTab = false; |
|
|
|
this.newTab = false; |
|
|
|
|
|
|
|
this.background = false; |
|
|
|
this.hints = {}; |
|
|
|
this.hints = {}; |
|
|
|
this.targets = []; |
|
|
|
this.targets = []; |
|
|
|
|
|
|
|
|
|
|
@ -68,6 +69,7 @@ export default class Follow { |
|
|
|
type: messages.OPEN_URL, |
|
|
|
type: messages.OPEN_URL, |
|
|
|
url: element.href, |
|
|
|
url: element.href, |
|
|
|
newTab: true, |
|
|
|
newTab: true, |
|
|
|
|
|
|
|
background: this.background, |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -79,12 +81,13 @@ export default class Follow { |
|
|
|
}), '*'); |
|
|
|
}), '*'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
createHints(keysArray, newTab) { |
|
|
|
createHints(keysArray, newTab, background) { |
|
|
|
if (keysArray.length !== this.targets.length) { |
|
|
|
if (keysArray.length !== this.targets.length) { |
|
|
|
throw new Error('illegal hint count'); |
|
|
|
throw new Error('illegal hint count'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.newTab = newTab; |
|
|
|
this.newTab = newTab; |
|
|
|
|
|
|
|
this.background = background; |
|
|
|
this.hints = {}; |
|
|
|
this.hints = {}; |
|
|
|
for (let i = 0; i < keysArray.length; ++i) { |
|
|
|
for (let i = 0; i < keysArray.length; ++i) { |
|
|
|
let keys = keysArray[i]; |
|
|
|
let keys = keysArray[i]; |
|
|
@ -150,7 +153,8 @@ export default class Follow { |
|
|
|
case messages.FOLLOW_REQUEST_COUNT_TARGETS: |
|
|
|
case messages.FOLLOW_REQUEST_COUNT_TARGETS: |
|
|
|
return this.countHints(sender, message.viewSize, message.framePosition); |
|
|
|
return this.countHints(sender, message.viewSize, message.framePosition); |
|
|
|
case messages.FOLLOW_CREATE_HINTS: |
|
|
|
case messages.FOLLOW_CREATE_HINTS: |
|
|
|
return this.createHints(message.keysArray, message.newTab); |
|
|
|
return this.createHints( |
|
|
|
|
|
|
|
message.keysArray, message.newTab, message.background); |
|
|
|
case messages.FOLLOW_SHOW_HINTS: |
|
|
|
case messages.FOLLOW_SHOW_HINTS: |
|
|
|
return this.showHints(message.keys); |
|
|
|
return this.showHints(message.keys); |
|
|
|
case messages.FOLLOW_ACTIVATE: |
|
|
|
case messages.FOLLOW_ACTIVATE: |
|
|
|