From 5aff3781c520164ca661e4063ca8a82b053c0c10 Mon Sep 17 00:00:00 2001 From: Johannes Findeisen Date: Fri, 24 Jul 2015 05:15:25 +0200 Subject: [PATCH] ctrl+shift opens result in new window --- chrome/content/about.xul | 2 +- chrome/content/overlay.js | 9 ++++++--- install.rdf | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/chrome/content/about.xul b/chrome/content/about.xul index 3218fcc..8ca3754 100644 --- a/chrome/content/about.xul +++ b/chrome/content/about.xul @@ -10,7 +10,7 @@ - + diff --git a/chrome/content/overlay.js b/chrome/content/overlay.js index 1c413cc..ce30279 100644 --- a/chrome/content/overlay.js +++ b/chrome/content/overlay.js @@ -4,15 +4,18 @@ var leo_search = { this.strings = document.getElementById("leo_search-strings"); }, onSearchCommand: function(e, lang, sitelang) { - // evil but done in one line... ;) var query = window._content.window.getSelection(); if(query != null) { var url = "http://dict.leo.org/" + lang + "de?lang=" + sitelang + "&search=" + query; - if(e.ctrlKey == true) + if(e.ctrlKey == true && e.shiftKey == true) { + window = window.open(decodeURIComponent(url), "leo_search-resultwindow"); + window.focus(); + } else if(e.ctrlKey == true && e.shiftKey == false) { this.newTab(url, true); - else + } else { this.newTab(url, false); + } } }, onFirefoxLoad: function(event) { diff --git a/install.rdf b/install.rdf index 5970bb2..7990323 100644 --- a/install.rdf +++ b/install.rdf @@ -4,7 +4,7 @@ {c666c018-6409-4479-afa3-68e4129e7eff} 2 Leo Search - 1.3.1 + 1.4.0 Johannes Findeisen http://hanez.org/leo-search.html