diff --git a/README.md b/README.md index f5cf528..a7c2c39 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,12 @@ Wikipedia Search is free to use in any browser extension, but I would like a lin __Wikipedia is a trademark of the Wikimedia Foundation. OmniProxy icon from the [Faenza](http://tiheum.deviantart.com/art/Faenza-Icons-173323228) icon pack.__ --------------------------------------------------------- +__New in Wikipedia Search 6.1:__ +* __HTTPS by default:__ Wikipedia Search added support for HTTPS search in version 6.0, but now it's default. +* __New Language:__ Wikipedia Search now supports Ellīniká as a language. +* __Easier options access:__ You can now get to the extensions options straight from the OmniBar while searching!. +* __Bug fixes:__ This release contains various bug fixes. + __New in Wikipedia Search 6.0:__ * __ANTP Widget:__ Wikipedia Search now includes a widget for the popular New Tab Page replacement, Awesome New Tab Page. If you have ANTP installed, just drag the Wikipedia Search widget to an empty slot. * __HTTPS Search:__ You can now enable searching with HTTPS from the options, which makes your searches more secure and private. diff --git a/background.js b/background.js index 7a2b8e5..e90cc5b 100644 --- a/background.js +++ b/background.js @@ -11,19 +11,18 @@ You should have received a copy of the GNU General Public License along with thi chrome.runtime.onInstalled.addListener(function(details){ if(details.reason == "update" || "install"){ if(localStorage.getItem("language") === null){ - var language = "en"; - localStorage["language"] = language; - console.log("no language selected, defaulting to english"); + localStorage["language"] = "en"; } if(localStorage.getItem("protocol") === null){ - var protocol = "https://"; - localStorage["protocol"] = protocol; - console.log("no protocol selected, defaulting to https (secure)"); + localStorage["protocol"] = "https://"; + } + if(localStorage.getItem("donation") === null){ + localStorage["donation"] = "yes"; } } if(localStorage.getItem("version") != chrome.runtime.getManifest().version){ chrome.tabs.create({'url': chrome.extension.getURL('welcome.html')}); - localStorage["version"] = chrome.runtime.getManifest().version + localStorage["version"] = chrome.runtime.getManifest().version; } }); @@ -68,7 +67,7 @@ function onSearch(info, tab) { } var id = chrome.contextMenus.create({ "title": "Wikipedia Search", "contexts": ["selection"], "onclick": onSearch - }); +}); // Omnibox Search // Derived from OmniWiki (github.com/hamczu/OmniWiki) @@ -76,6 +75,7 @@ function onSearch(info, tab) { var currentRequest = null; chrome.omnibox.onInputChanged.addListener(function(text, suggest) { + if (currentRequest != null) { currentRequest.onreadystatechange = null; currentRequest.abort(); @@ -87,32 +87,37 @@ chrome.omnibox.onInputChanged.addListener(function(text, suggest) { if(text.length > 0){ currentRequest = suggests(text, function(data) { var results = []; - for(var i = 0; i < data[1].length; i++){ + for(var i = 0; i < 4; i++){ results.push({ content: data[1][i], description: data[1][i] }); } + results.push({ + content: "options", + description: "Open Wikipedia Search options" + }); suggest(results); }); } else { } + }); function resetDefaultSuggestion() { chrome.omnibox.setDefaultSuggestion({ description: ' ' }); -} +}; resetDefaultSuggestion(); var searchLabel = chrome.i18n.getMessage('search_label'); function updateDefaultSuggestion(text) { chrome.omnibox.setDefaultSuggestion({ - description: searchLabel + ': %s' + description: searchLabel + 'Search on Wikipedia: %s' }); -} +}; chrome.omnibox.onInputStarted.addListener(function() { updateDefaultSuggestion(''); @@ -149,5 +154,9 @@ function suggests(query, callback) { chrome.omnibox.onInputEntered.addListener(function(text) { var language = localStorage["language"]; var protocol = localStorage["protocol"]; - chrome.tabs.update(null, {url: protocol + language + ".wikipedia.org/w/index.php?search=" + text}); + if (text == "options") { + chrome.tabs.update(null, {url: chrome.extension.getURL('options.html')}); + } else { + chrome.tabs.update(null, {url: protocol + language + ".wikipedia.org/w/index.php?search=" + text}); + } }); \ No newline at end of file diff --git a/manifest.json b/manifest.json index 4846bb3..0c47ce1 100644 --- a/manifest.json +++ b/manifest.json @@ -1,14 +1,15 @@ { "manifest_version": 2, "name": "Wikipedia Search", - "version": "6.0", + "version": "6.1", "description": "Search Wikipedia in every language from the search bar.", "options_page": "options.html", "omnibox": { "keyword": "wiki" }, "web_accessible_resources": [ - "widget.html" + "widget.html", + "options.html" ], "permissions": [ "contextMenus", diff --git a/options.html b/options.html index 769fd10..2e3c956 100644 --- a/options.html +++ b/options.html @@ -16,6 +16,13 @@

Wikipedia Search - Settings

+
+

Donate

+

If you find Wikipedia Search useful, please donate to support continued development. It would mean a lot!

+
+ +
+

Settings

@@ -35,6 +42,7 @@

Settings

+ @@ -54,12 +62,12 @@

Settings

- + - + @@ -67,7 +75,7 @@

Settings

- + diff --git a/styles.css b/styles.css index 6cf402b..bc8ac5b 100644 --- a/styles.css +++ b/styles.css @@ -23,7 +23,7 @@ header, hgroup, menu, nav, section { html { background: #fff; color: #333; - font: 81.25% arial, sans-serif; + font: 18px arial, sans-serif; line-height: 1; -webkit-text-size-adjust: none; } @@ -584,4 +584,8 @@ input { .search { width: 520px; +} + +#disabled { + color: #FF0000; } \ No newline at end of file diff --git a/welcome.html b/welcome.html index 453528f..14779f7 100644 --- a/welcome.html +++ b/welcome.html @@ -14,13 +14,12 @@
-

Welcome to Wikipedia Search 6.0!

+

Welcome to Wikipedia Search 6.1!

What's New?

-

ANTP Widget: Wikipedia Search now includes a widget for the popular New Tab Page replacement, Awesome New Tab Page. If you have ANTP installed, just drag the Wikipedia Search widget to an empty slot.

-

HTTPS Search: You can now enable searching with HTTPS from the options, which makes your searches more secure and private.

-

New Icon: Wikipedia Search now has a new icon from the Faenza icon pack.

-

New Language: Wikipedia Search now supports Azərbaycanca as a language.

+

HTTPS by default: Wikipedia Search added support for HTTPS search in version 6.0, but now it's default.

+

New Language: Wikipedia Search now supports Ellīniká as a language.

+

Bug fixes: This release contains various bug fixes.

Getting Started

diff --git a/wikipedia.js b/wikipedia.js index 70cfa8d..4f9757b 100644 --- a/wikipedia.js +++ b/wikipedia.js @@ -36,6 +36,10 @@ function restore_options() { } } +function doDonation(){ + chrome.tabs.create({ url: "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=4SZVSMJKDS35J&lc=US&item_name=Corbin%20Davenport¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted" }); +} + window.addEventListener('load',function(){ var select1 = document.getElementById("language"); for (var i = 0; i < select1.children.length; i++) { @@ -58,4 +62,8 @@ window.addEventListener('load',function(){ function startSearch(event) {document.getElementById("searchform").submit(); } -window.onload = function(){document.querySelector('input[value="Save"]').onclick=save_options;} \ No newline at end of file +window.onload = function(){ + document.querySelector('input[value="Save"]').onclick=save_options; + document.querySelector('input[value="Donate via PayPal"]').onclick=doDonation; +\\ +} \ No newline at end of file