Do you really want to leave the page?

  • Is there a way to disable the popup confirmation messages? It's really not necessary to have to confirm that I want to log out if I click the logout button or that I want to close the page when I try to leave the site.


    Logout -> "Are you sure you want to log out?" -> YES!!! -> Ok, logout -> Close the webpage -> "Do you really want to leave the page?" -> YES!!! FFS CLOSE ALREADY!!


    Solution:
    To disable the prompt when leaving the page:
    Modify /usr/share/php/openmediavault/htmlpage.inc
    Find: "OMV.confirmPageUnload = true;" and change it to "OMV.confirmPageUnload = false;"


    Code
    // Request user confirmation before leaving page.
                            OMV.confirmPageUnload = false;
                            window.onbeforeunload = function() {
                                    if(true === OMV.confirmPageUnload) {
                                            OMV.confirmPageUnload = false;
                                            return _("Do you really want to leave the page?");
                                    }


    Disabling the logout nag is a little more complicated. Need to modify /var/www/openmediavault/js/omv/workspace/Workspace.js
    Find this bit of code:

    Code
    listeners: {
                                                            click: function(menu, item, e, eOpts) {
                                                                    if(!Ext.isDefined(item.action))
                                                                            return;
    OMV.MessageBox.show({
                                                                            title: _("Confirmation"),
                                                                            msg: item.msg,
                                                                            buttons: Ext.Msg.YESNO,
                                                                            fn: function(answer) {


    and add the following lines after "if(!Ext.isDefined(item.action))return;"


    Code
    if(item.action == "logout") {
                                                                            OMV.SessionManager.logout();
                                                                            return; }


    So it should look like this after modified:

    Code
    listeners: {
                                                            click: function(menu, item, e, eOpts) {
                                                                    if(!Ext.isDefined(item.action))
                                                                            return;
                                                                    if(item.action == "logout") {
                                                                            OMV.SessionManager.logout();
                                                                            return; }
                                                                    OMV.MessageBox.show({
                                                                            title: _("Confirmation"),
                                                                            msg: item.msg,


    OMV Erasmus 3.0.13.

  • Will these changes survive upgrades or will they have to be redone again and again?

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

    • Offizieller Beitrag

    They will have to be redone.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • I know this is a pretty old thread but I finally got fed up enough to try to do this in OMV 4. The location to step 1 has changed but step two is still the same.


    The htmlpage.inc file doesn't exist anymore but I searched through all the files until I found the "OMV.confirmPageUnload = true;" and the rest of the code specified above. It is now located here: /usr/share/php/openmediavault/controlpanel/administration.inc



    Thanks wolfpack for pointing me in the right direction!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!