ctrl+shift opens result in new window

This commit is contained in:
Johannes Findeisen 2015-07-24 05:15:25 +02:00
commit 5aff3781c5
3 changed files with 8 additions and 5 deletions

View file

@ -10,7 +10,7 @@
<groupbox align="center" orient="horizontal">
<vbox>
<text value="Leo Search" style="font-weight: bold; font-size: x-large;"/>
<text value="&version; 1.3.1"/>
<text value="&version; 1.4.0"/>
<separator class="thin"/>
<text value="&createdBy;" style="font-weight: bold;"/>
<text value="Johannes Findeisen"/>

View file

@ -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) {

View file

@ -4,7 +4,7 @@
<em:id>{c666c018-6409-4479-afa3-68e4129e7eff}</em:id>
<em:type>2</em:type><!-- Extension -->
<em:name>Leo Search</em:name>
<em:version>1.3.1</em:version>
<em:version>1.4.0</em:version>
<em:creator>Johannes Findeisen</em:creator>
<em:homepageURL>http://hanez.org/leo-search.html</em:homepageURL>
<em:localized>