lingua-libre / RecordWizard

🌻 MediaWiki extension allowing mass recording of clean, well cut, well named pronunciation files.
https://lingualibre.org
GNU General Public License v2.0
15 stars 3 forks source link

"Do you want to leave the page? All your unsaved changes will be lost." #14

Closed hugolpz closed 2 years ago

hugolpz commented 2 years ago

MediaWiki:Common.js add a modal warning on leaving :

/* *************************************************************** */
/* RECORD WIZARD SUGAR ******************************************* */
/*Confirmation message when users try to leave the Record Wizard
(works from the second step onwards) */
$(function() {
if (mw.config.get('wgPageName') !== 'Special:RecordWizard') {
    return;
}
window.onbeforeunload = function() {
    return "Do you want to leave the page? All your unsaved changes will be lost.";
};
});
/*
if (mw.config.get('wgPageName') === 'Special:RecordWizard') {
    window.onbeforeunload = function() {
        return "Do you want to leave the page? All your unsaved changes will be lost.";
    };
}
*/

This could be integrated to the plugin itself.

Poslovitch commented 2 years ago

Duplicate of https://phabricator.wikimedia.org/T274864