forked from corbindavenport/wikipedia-search
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump version to 10.1, update welcome and settings pages
- Loading branch information
1 parent
5898e77
commit 717bbfc
Showing
13 changed files
with
123 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.jumbotron .container { | ||
background-image: url('chrome-extension://__MSG_@@extension_id__/img/icon128.png'); | ||
background-size: 80px; | ||
background-repeat: no-repeat; | ||
background-position: 0 center; | ||
padding-left: 120px; | ||
min-height: 80px; | ||
} | ||
|
||
/* Fix for Firefox's different URL scheme */ | ||
@supports (-moz-appearance:none) { | ||
.jumbotron .container { | ||
background-image: url('moz-extension://__MSG_@@extension_id__/img/icon128.png'); | ||
} | ||
} | ||
|
||
#supporters { | ||
margin-bottom: 0; | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,24 @@ | ||
// Function for retrieving parameters from URLs | ||
// Credit: https://stackoverflow.com/a/901144/2255592 | ||
function getParameterByName(name, url) { | ||
if (!url) { | ||
url = window.location.href | ||
} | ||
name = name.replace(/[\[\]]/g, '\\$&') | ||
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), | ||
results = regex.exec(url) | ||
if (!results) return null | ||
if (!results[2]) return '' | ||
return decodeURIComponent(results[2].replace(/\+/g, ' ')) | ||
} | ||
|
||
// Add version number to welcome page | ||
document.querySelector('.version').innerHTML = chrome.runtime.getManifest().version | ||
|
||
// Add language to welcome page | ||
var lang = decodeURIComponent(getParameterByName('lang')) | ||
document.querySelector(".wikipedia-search-language").innerHTML = 'The search language is currently set to <b>' + lang + '</b>.' | ||
document.querySelector(".version").innerHTML = chrome.runtime.getManifest().version | ||
|
||
// Button links | ||
// Link buttons | ||
document.querySelectorAll('.link-btn').forEach(function (el) { | ||
el.addEventListener('click', function () { | ||
chrome.tabs.create({ url: el.getAttribute('data-url') }) | ||
}) | ||
}) | ||
|
||
// Show instructions for leaving a review based on the browser being used | ||
const useragent = navigator.userAgent | ||
const review = document.querySelector('.review-info') | ||
// Opera has to be checked before Chrome, because Opera has both "Chrome" and "OPR" in the user agent string | ||
if (useragent.includes("OPR")) { | ||
review.innerHTML = 'Leaving a review on the <a href="https://addons.opera.com/en/extensions/details/wikipedia-search/" target="_blank">Opera add-ons site</a> is also greatly appreciated!' | ||
} else if (useragent.includes("Chrome")) { | ||
review.innerHTML = 'Leaving a review on the <a href="https://chrome.google.com/webstore/detail/wikipedia-search/lipakennkogpodadpikgipnogamhklmk" target="_blank">Chrome Web Store</a> is also greatly appreciated!' | ||
} | ||
// Show credits | ||
fetch('https://corbin.io/supporters.json').then(function (response) { | ||
response.json().then(function (data) { | ||
var creditsList = 'Diamond supporters: ' | ||
for (var i = 0; i < data['supporters'].length; i++) { | ||
creditsList += data['supporters'][i] + ', ' | ||
} | ||
creditsList = creditsList.substring(0, creditsList.length - 2) | ||
document.getElementById('supporters').innerText = creditsList | ||
}) | ||
}) | ||
.catch(function (err) { | ||
document.getElementById('supporters').innerText = 'There was an error fetching Wikipedia Search supporters.' | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,135 +6,68 @@ | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="icon" type="image/png" href="img/icon16.png"> | ||
<title>Wikipedia Search</title> | ||
<title>Wikipedia Search Settings</title> | ||
<link href="css/bootstrap.min.css" rel="stylesheet"> | ||
<style> | ||
body { | ||
padding-top: 60px; | ||
} | ||
</style> | ||
<link href="css/styles.css" rel="stylesheet"> | ||
</head> | ||
|
||
<body> | ||
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top"> | ||
<body class="settings"> | ||
<div class="jumbotron"> | ||
<div class="container"> | ||
<span class="navbar-brand"> | ||
<img src="img/icon48.png" width="30" height="30" class="d-inline-block align-top" alt=""> | ||
Wikipedia Search | ||
</span> | ||
<h1>Wikipedia Search settings</h1> | ||
<p>Here you can change all the options for Wikipedia Search. Your changes are automatically saved.</p> | ||
</div> | ||
</nav> | ||
</div> | ||
|
||
<div class="container"> | ||
|
||
<div class="row"> | ||
<div class="col-md-12"> | ||
<p> | ||
<h2>Language</h2> | ||
</p> | ||
<p>Here you can change the language that Wikipedia Search uses. The language list is automatically updated every time you open this settings page, using the <a href="https://www.mediawiki.org/wiki/API:Query" target="_blank">Wikipedia Query API</a>.</p> | ||
<p> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
<select id="wikipedia-search-language-select" class="custom-select" disabled> | ||
<option value="loading" selected>Loading languages...</option> | ||
</select> | ||
</div> | ||
<div class="col-md-6"> | ||
<button type="button" class="btn btn-primary btn-block" id="wikipedia-search-reset-language" disabled>Reset to system language</button> | ||
</div> | ||
</div> | ||
</p> | ||
<hr /> | ||
<p>You must restart your browser or click the button below for some changes to take effect. Clicking the button will close this settings page.</p> | ||
<p> | ||
<button type="button" class="btn btn-primary btn-block" id="wikipedia-search-apply-settings">Apply settings</button> | ||
</p> | ||
<div class="col-12"> | ||
<b>Having issues?</b> If you find a bug, or have a suggestion for a new feature, <a href="https://discord.com/invite/59wfy5cNHw" target="_blank">join the Discord server</a> or <a href="https://github.com/corbindavenport/wikipedia-search/issues" target="_blank">create an issue on the GitHub repository</a>. | ||
</div> | ||
</div> | ||
<hr /> | ||
|
||
<hr> | ||
|
||
<div class="row"> | ||
<div class="col-md-6"> | ||
<h2>Basic searches</h2> | ||
<p>To perform a search, just type 'wiki' in your browser's address bar, then a space, then the name of the article you want. Live suggestions from Wikipedia are displayed as you type.</p> | ||
</div> | ||
<div class="col-md-6"> | ||
<h2>Right-click search</h2> | ||
<p>You can also highlight any word or phrase on the web, and an option to search in Wikipedia will appear in the context menu. Results open in a new tab, so your current page is not lost.</p> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
<p> | ||
<img src="img/screen1.png" style="width: 100%; max-width:764px;"> | ||
</p> | ||
</div> | ||
<div class="col-md-6"> | ||
<p> | ||
<img src="img/screen4.png" style="width: 100%; max-width:764px;"> | ||
</p> | ||
</div> | ||
</div> | ||
<br> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
<h2>Settings page</h2> | ||
<p>Type in "wiki settings" into the address bar and press the Enter key to open the extension settings. You can change the default search language to any of the 300+ languages supported by Wikipedia.</p> | ||
</div> | ||
<div class="col-md-6"> | ||
<h2>Multi-language</h2> | ||
<p>You can override the default language by typing a Wikipedia language prefix before your search. For example, to search for Google in the French Wikipedia, you would type "fr Google".</p> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
<p> | ||
<img src="img/screen3.png" style="width: 100%; max-width:764px;"> | ||
</p> | ||
</div> | ||
<div class="col-md-6"> | ||
<p> | ||
<img src="img/screen2.png" style="width: 100%; max-width:764px;"> | ||
</p> | ||
</div> | ||
</div> | ||
<br> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<h2>Having issues?</h2> | ||
<p>If you find a bug, or have a suggestion for a new feature, please <a href="https://github.com/corbindavenport/noplugin/issues" target="_blank">create an issue on the NoPlugin GitHub repository</a> or <a href="mailto:[email protected]?subject=Wikipedia%20Search%20Bug%20Report">submit an issue via email</a>.</p> | ||
<div class="col-md-12"> | ||
<!-- Language --> | ||
<div class="form-group row"> | ||
<label for="wikipedia-search-language-select" class="col-sm-2 col-form-label">Language</label> | ||
<div class="col-sm-10"> | ||
<select id="wikipedia-search-language-select" class="custom-select" disabled> | ||
<option value="loading" selected>Loading languages...</option> | ||
</select> | ||
<small class="form-text text-muted">This is the language used for searches. The language list is automatically updated every time you open this settings page, using the <a href="https://www.mediawiki.org/wiki/API:Query" target="_blank">Wikipedia Query API</a>.</small> | ||
</div> | ||
</div> | ||
</div> | ||
<br> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<h2>Donate</h2> | ||
</div> | ||
<div class="col-md-6"> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="col-12"> | ||
<div class="alert alert-info" role="alert"> | ||
<p>If you find Wikipedia Search useful, please donate to support continued development. It would mean a lot!</p> | ||
<p><b>Note:</b> Wikipedia Search is not affliated with Wikipedia or the Wikimedia Foundation. If you wish to donate to the Wikimedia Foundation, you can do so <a href="https://donate.wikimedia.org" target="_blank">here</a>.</p> | ||
<p class="review-info"></p> | ||
</div> | ||
<div class="col-md-6"> | ||
<p> | ||
<button type="button" class="btn btn-success btn-block link-btn" data-url="https://www.patreon.com/corbindavenport">Donate via Patreon</button> | ||
</p> | ||
<p> | ||
<button type="button" class="btn btn-success btn-block link-btn" data-url="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=4SZVSMJKDS35J&lc=US&item_name=Wikipedia%20Search%20Donation¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted">Donate via PayPal</button> | ||
<div class="row"> | ||
<div class="col-6"> | ||
<button type="button" class="btn btn-block btn-primary link-btn" data-url='https://www.patreon.com/corbindavenport'>Donate via Patreon</button> | ||
</div> | ||
<div class="col-6"> | ||
<button type="button" class="btn btn-block btn-primary link-btn" data-url="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=4SZVSMJKDS35J&lc=US&item_name=Wikipedia%20Search%20Donation¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted">Donate via PayPal</button> | ||
</div> | ||
</div> | ||
</p> | ||
<p id="supporters">Loading supporters...</p> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
<hr> | ||
|
||
<footer> | ||
<p>Wikipedia Search uses code from <a href="https://jquery.com/" target="_blank">jQuery</a>, <a href="https://getbootstrap.com/" target="_blank">Bootstrap</a>, and <a href="https://github.com/hamczu/OmniWiki" target="_blank">OmniWiki</a>. You can find Wikipedia Search's source code <a href="https://github.com/corbindavenport/wikipedia-search" target="_blank">on GitHub</a>.</p> | ||
</footer> | ||
</div> <!-- /container --> | ||
|
||
<script src="js/jquery-3.4.1.min.js"></script> | ||
<script src="js/shared.js"></script> | ||
<script src="js/settings.js"></script> | ||
<script src="js/bootstrap.min.js"></script> | ||
|
||
</body> | ||
|
||
</html> |
Oops, something went wrong.