mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-30 13:24:05 +00:00
Merge pull request #1713 from xiaoyifang/opt/mark.js
opt:mark.js only highlight exact words
This commit is contained in:
commit
f2386193f0
|
@ -2106,7 +2106,7 @@ void ArticleView::highlightFTSResults()
|
||||||
QString script = QString(
|
QString script = QString(
|
||||||
"var context = document.querySelector(\"body\");\n"
|
"var context = document.querySelector(\"body\");\n"
|
||||||
"var instance = new Mark(context);\n instance.unmark();\n"
|
"var instance = new Mark(context);\n instance.unmark();\n"
|
||||||
"instance.mark(\"%1\");" )
|
"instance.mark(\"%1\",{\"accuracy\": \"exactly\"});" )
|
||||||
.arg( regString );
|
.arg( regString );
|
||||||
|
|
||||||
webview->page()->runJavaScript( script );
|
webview->page()->runJavaScript( script );
|
||||||
|
|
|
@ -2751,7 +2751,6 @@ void MainWindow::toggleMainWindow( bool onlyShow )
|
||||||
if ( !cfg.preferences.searchInDock )
|
if ( !cfg.preferences.searchInDock )
|
||||||
translateBox->setPopupEnabled( false );
|
translateBox->setPopupEnabled( false );
|
||||||
|
|
||||||
qDebug() << "Current state:" << isVisible() << isMinimized() << isActiveWindow() << onlyShow;
|
|
||||||
if ( !isVisible() ) {
|
if ( !isVisible() ) {
|
||||||
show();
|
show();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue