google chrome alert() is unusable, should be removed

Issue #91 resolved
dd1 created an issue

in latest google chrome, the alert() function is unusable - forces unexpected opening of tabs and windows, blocks most tab controls, alert dialog cannot be blocked, etc.

for this reason we should not use the alert() function for routine user interaction, such as reporting rpc errors. I guess simple things like confirming run start and stop is still okey.

K.O.

Comments (7)

  1. Stefan Ritt

    I wrote two new functions dlgAlert(string) and dlgConfirm(string, callback) which can replace alert() and confirm(). The new functions are however not blocking (nothing should be blocking in JavaScript), so you have to supply a callback function to dlgConfirm which gets called with true or false depending on what the user presses.

  2. dd1 reporter

    Pages with alert(): (there is also some alerts in midas.js and mhttpd.js)

    - alarms.html
    - messages.html
    - programs.html
    - start.html
    

    K.O.

  3. dd1 reporter

    Done. But there is still some alerts thrown by code in mhttpd.js, some of it is code used to load every page. To replace them with dlgAlert, we need to have the dialog html div present on every page. Right now not sure how to do this. Maybe crete this div from mhttpd_init(), same as the menu buttons are populated? K.O.

  4. Stefan Ritt

    Not necessary to create a <div> on every page, since dlgAlert creates this element dynamically via

    d = document.createElement("div");
    document.body.appendChild(d);
    
  5. Log in to comment