mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-25 05:22:59 +00:00
Bugfix: Fix alt + enter search box submit failing with allow popups message
This commit is contained in:
parent
34da19e5b0
commit
7548c1e7ee
3 changed files with 29 additions and 13 deletions
|
@ -10,6 +10,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
|
||||||
- [security] Bugfix: Don't leak the PHP version in emails when expose_php is turned off
|
- [security] Bugfix: Don't leak the PHP version in emails when expose_php is turned off
|
||||||
- Fixed handling of Unicode characters when emailing users - added new `email_subject_utf8` and `email_body_utf8` settings to control the new behaviour
|
- Fixed handling of Unicode characters when emailing users - added new `email_subject_utf8` and `email_body_utf8` settings to control the new behaviour
|
||||||
- Add new `email_debug_dontsend` setting for debugging emails sent by Pepperminty Wiki
|
- Add new `email_debug_dontsend` setting for debugging emails sent by Pepperminty Wiki
|
||||||
|
- Fixed pressing alt + enter to open a search in a new tab - it should no longer fail and briefly prompt to allow popups
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
- Improved the search indexing system performance - again
|
- Improved the search indexing system performance - again
|
||||||
|
|
|
@ -556,17 +556,32 @@ if(!empty($settings->enable_math_rendering))
|
||||||
// alt+enter support in the search box
|
// alt+enter support in the search box
|
||||||
page_renderer::add_js_snippet('// Alt + Enter support in the top search box
|
page_renderer::add_js_snippet('// Alt + Enter support in the top search box
|
||||||
window.addEventListener("load", function(event) {
|
window.addEventListener("load", function(event) {
|
||||||
document.querySelector("input[type=search]").addEventListener("keyup", function(event) {
|
let search_box = document.querySelector("input[type=search]"),
|
||||||
// Listen for Alt + Enter
|
alt_pressed = false;
|
||||||
if(event.keyCode == 13 && event.altKey) {
|
document.addEventListener("keyup", (event) => {
|
||||||
event.stopPropagation();
|
if(event.keyCode !== 18) return;
|
||||||
event.preventDefault();
|
alt_pressed = false;
|
||||||
event.cancelBubble = true;
|
console.info("[search box/alt-tracker] alt released");
|
||||||
event.target.form.setAttribute("target", "_blank");
|
});
|
||||||
event.target.form.submit();
|
document.addEventListener("keydown", (event) => {
|
||||||
event.target.form.removeAttribute("target");
|
if(event.keyCode !== 18) return;
|
||||||
return false; // Required by some browsers
|
alt_pressed = true;
|
||||||
|
console.info("[search box/alt-tracker] alt pressed");
|
||||||
|
});
|
||||||
|
|
||||||
|
search_box.form.addEventListener("submit", (event) => {
|
||||||
|
if(!alt_pressed) {
|
||||||
|
console.log("[search box/form] Alt wasn\'t pressed");
|
||||||
|
event.target.removeAttribute("target");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("[search box/form] Fiddling target");
|
||||||
|
|
||||||
|
event.target.setAttribute("target", "_blank");
|
||||||
|
setTimeout(() => {
|
||||||
|
alt_pressed = false;
|
||||||
|
}, 100);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
');
|
');
|
||||||
|
|
|
@ -195,7 +195,7 @@
|
||||||
"version": "0.1",
|
"version": "0.1",
|
||||||
"author": "Starbeamrainbowlabs",
|
"author": "Starbeamrainbowlabs",
|
||||||
"description": "Adds per-user watchlists. When a page on a user's watchlist is edited, a notification email is sent.",
|
"description": "Adds per-user watchlists. When a page on a user's watchlist is edited, a notification email is sent.",
|
||||||
"lastupdate": 1577117779,
|
"lastupdate": 1577132588,
|
||||||
"optional": false,
|
"optional": false,
|
||||||
"extra_data": []
|
"extra_data": []
|
||||||
},
|
},
|
||||||
|
@ -232,10 +232,10 @@
|
||||||
{
|
{
|
||||||
"id": "page-edit",
|
"id": "page-edit",
|
||||||
"name": "Page editor",
|
"name": "Page editor",
|
||||||
"version": "0.17.6",
|
"version": "0.17.7",
|
||||||
"author": "Starbeamrainbowlabs",
|
"author": "Starbeamrainbowlabs",
|
||||||
"description": "Allows you to edit pages by adding the edit and save actions. You should probably include this one.",
|
"description": "Allows you to edit pages by adding the edit and save actions. You should probably include this one.",
|
||||||
"lastupdate": 1575835535,
|
"lastupdate": 1577118172,
|
||||||
"optional": false,
|
"optional": false,
|
||||||
"extra_data": {
|
"extra_data": {
|
||||||
"diff.min.js": "https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jsdiff\/2.2.2\/diff.min.js"
|
"diff.min.js": "https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jsdiff\/2.2.2\/diff.min.js"
|
||||||
|
|
Loading…
Reference in a new issue