Make regex more lenient. Nest redirect logic.
This commit is contained in:
@@ -154,10 +154,6 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match = new RegExp(/\?redirected\_from=([^?]*)/).exec(window.location.href)) {
|
|
||||||
notice = "The page you requested was renamed or moved. You've been successfully redirected to its new location.";
|
|
||||||
flashNotice('success', notice);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($('#minibutton-upload-page').length) {
|
if ($('#minibutton-upload-page').length) {
|
||||||
new ClipboardJS('#ClipboardJSlink');
|
new ClipboardJS('#ClipboardJSlink');
|
||||||
@@ -611,7 +607,11 @@ $(document).ready(function() {
|
|||||||
if($('.markdown-body').length ){
|
if($('.markdown-body').length ){
|
||||||
// Set text direction (LTR or RTL)
|
// Set text direction (LTR or RTL)
|
||||||
preparePage();
|
preparePage();
|
||||||
|
// Check if there was a redirect here
|
||||||
|
if (match = new RegExp(/[?&]redirected\_from=([^?]*)/).exec(window.location.href)) {
|
||||||
|
notice = "The page you requested was renamed or moved. You've been successfully redirected to its new location.";
|
||||||
|
flashNotice('success', notice);
|
||||||
|
}
|
||||||
// Set the 'e' hotkey for editing pages.
|
// Set the 'e' hotkey for editing pages.
|
||||||
Mousetrap.bind(['e'], function( e ) {
|
Mousetrap.bind(['e'], function( e ) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
Reference in New Issue
Block a user