Pinacolada64 / NOW

A MUD under construction based on Evennia.
9 stars 8 forks source link

Web client options, help pop-ups do not display in Evennia 0.7 #19

Closed Pinacolada64 closed 6 years ago

Pinacolada64 commented 6 years ago

@Griatch They display for Firefox 52, but not for Chromium 57. Pop-ups are allowed, JavaScript is allowed.

I am no web dev, but this seems to work on both Firefox and Chrome: from https://stackoverflow.com/questions/19179403/javascript-open-popup-in-the-center-of-the-screen-chrome

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Home</title>

<script type="text/javascript">
     function popupCenter(url, title, w, h) {
      wLeft = window.screenLeft ? window.screenLeft : window.screenX;
      wTop = window.screenTop ? window.screenTop : window.screenY;

      var left = wLeft + (window.innerWidth / 2) - (w / 2);
      var top = wTop + (window.innerHeight / 2) - (h / 2);
      return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left + ', screenX=' + left + ', screenY=' + top);
  }
</script>

 </head>
  <body>

  <a onclick="popupCenter('http://www.commodoreserver.com', 'title',450,450);" href="javascript:void(0);">CLICK TO OPEN POPUP</a>

   </body>
</html>
Griatch commented 6 years ago

If this is an Evennia bug it belongs in the Evennia issue tracker, not here. Please add it there instead.

AmberFennek commented 6 years ago

Thank you for your response. When I was presented with this issue, I did explicitly (with this very link) suggest the Evennia issue tracker:

[OOC] Amber says, So my code is not making it fail? Rulan does not htink so. Thinks is JS in Chrome that isn't working? Dunno enough to even suggest a fix. [OOC] Amber says, "How to suggest a fix:" [OOC Amber] https://github.com/evennia/evennia/issues/new Rulan doesn't know what to suggest, only point out that the pop-ups are broken in Chrome. Amber yaps. The suggestion is that it's something for someone to look into more closely. [OOC] Rulan finds this: https://stackoverflow.com/questions/19179403/javascript-open-popup-in-the-center-of-the-screen-chrome Amber yaps. You could include that link in the issue. Amber can't fix it. Rulan okays.

It is an issue that bears some inspection. I could not get help popups to work in Firefox or Chrome under Windows 7, but I was also told:

Tricuspa intones, "It works fine in Windows so it something for the Linux folks to figure out"

As a work-around, I @set *#2/_saved_webclient_options={'helppopup': False, 'gagprompt': True, 'notification_popup': False, 'notification_sound': False} to my account.

I can run the latest server entirely free of modified code and database as a test to see if it truly is an Evennia issue, but those who have reported problems need to test their browsers and report which on which OS have the issue, otherwise the issue tracker might tag the issue post with "Needs more Information"

AmberFennek commented 6 years ago

This wasn't caused by edits to web/static/webclient/js/webclient_gui.js, but by customization in web/static/webclient/css/webclient.css that worked in 0.6.0. It is fixed by reverting to the default web folder, but in the process, we discovered an edge case that causes a traceback in Evennia 0.7.0 and will report it to Evennia's issue tracker.

Griatch commented 6 years ago

As a side note; all static file web modifications should happen under mygame/web/static_overrides; this will allow it to merge with the core Evennia defaults when the server reloads or evennia collectstatic is run.