Skip to content

Commit

Permalink
Fixed search highlight bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kura52 authored and kura52 committed Jul 16, 2018
1 parent 7b48782 commit a750bd0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
12 changes: 7 additions & 5 deletions src/render/TabPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,9 @@ export default class TabPanel extends Component {
else{
if(sharedState.searchWords[tabId]){
const navbar = refs2[`navbar-${tab.key}`].state
const url = navbar.historyList[navbar.currentIndex -1]
const currentUrl = this.getWebContents(tab).getURL()
const currentIndex = navbar.historyList[navbar.currentIndex][0] == currentUrl ? navbar.currentIndex : navbar.currentIndex + 1
const url = navbar.historyList[currentIndex -1]
if(url && url[0].match(REG_HIGHLIGHT_SITES)){
word = sharedState.searchWords[tabId]
}
Expand Down Expand Up @@ -1290,9 +1292,9 @@ export default class TabPanel extends Component {
console.log('onDidFinishLoading',e)
if (!self.mounted) return

if(!sharedState.searchWordHighlightRecursive && sharedState.searchWordHighlight){
self.searchWordHighlight(tab)
}
// if(!sharedState.searchWordHighlightRecursive && sharedState.searchWordHighlight){
// self.searchWordHighlight(tab)
// }

ipc.send('chrome-webNavigation-onCompleted',{
tabId:tab.wvId,
Expand Down Expand Up @@ -1437,7 +1439,7 @@ export default class TabPanel extends Component {
console.log('onDomReady',e,tab,Date.now())
if (!self.mounted) return

if(sharedState.searchWordHighlightRecursive && sharedState.searchWordHighlight){
if(sharedState.searchWordHighlight){
self.searchWordHighlight(tab)
}

Expand Down
1 change: 1 addition & 0 deletions tools/productionBuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function escapeRegExp(string){


function fileContentsReplace(file, reg, after) {
if(file.includes('tui-editor-Editor-all.min.js')) return
if(typeof reg == "string"){
reg = new RegExp(escapeRegExp(reg))
}
Expand Down
6 changes: 4 additions & 2 deletions tools/versionUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ Fixed a bug in bookmark drop.
fixed Bug of bookmark import.
Fixed many download bugs.
"Almost the same as as Chrome" was added to "When closing current tab, focus".
Fixed bug that Audio Extract, and Video Converter do not start.`
Fixed bug that Audio Extract, and Video Converter do not start.
Fixed Search Highlight bug.`

const CHANGE_JAPANESE = `Noteのmarkdownモードに行番号を追加
Noteのmarkdownのプレビューモードをtabとverticalで切り替えるボタン(P)を追加
Expand All @@ -52,7 +53,8 @@ Top Page下部の履歴にPV、滞在時間、削除ボタンを表示するよ
ブックマークインポートの不具合修正
ダウンロードに関する不具合を多数修正
「現在のタブを閉じたときのフォーカスの移動場所」に「Almost the same as Chrome」を追加
Audio Extract, Video Converterが起動しない不具合を修正`
Audio Extract, Video Converterが起動しない不具合を修正
Search Highlightの不具合修正`

const isWindows = process.platform === 'win32'
const isDarwin = process.platform === 'darwin'
Expand Down
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ delete baseConfig2.devtool
// delete baseConfig.plugins

module.exports = [
// merge({fileName:"base.js",src:path.join(__dirname,"./src/render")},baseConfig),
merge({fileName:"top.js",src:path.join(__dirname,"./src/toolPages"),dest:path.join(__dirname,"./resource/extension/default/1.0_0/js")},baseConfig2),
merge({fileName:"base.js",src:path.join(__dirname,"./src/render")},baseConfig),
// merge({fileName:"top.js",src:path.join(__dirname,"./src/toolPages"),dest:path.join(__dirname,"./resource/extension/default/1.0_0/js")},baseConfig2),
// merge({fileName:"downloader.js",src:path.join(__dirname,"./src/toolPages"),dest:path.join(__dirname,"./resource/extension/default/1.0_0/js")},baseConfig2),
// merge({fileName:"download.js",src:path.join(__dirname,"./src/toolPages"),dest:path.join(__dirname,"./resource/extension/default/1.0_0/js")},baseConfig2),
// merge({fileName:"selector.js",src:path.join(__dirname,"./src/toolPages"),dest:path.join(__dirname,"./resource/extension/default/1.0_0/js")},baseConfig2),
Expand Down

0 comments on commit a750bd0

Please sign in to comment.