kbuffington / Georgia

Dynamic foobar2000 theme
286 stars 16 forks source link

JS Panel crashes on several interactions #56

Closed Sieboldianus closed 3 years ago

Sieboldianus commented 3 years ago

I just installed this theme, but I'll get js scrashes, the JPanel turns red with a white "Error" showing.

This happens e.g. when I click on text (artist, title), with:

JScript Panel v2.4.1.1 (Georgia by Mordred)
JavaScript runtime error:
Number expected
File: %AppData%\Roaming\foobar2000\georgia\js\helpers.js
Line: 192, Col: 5

.. at other times, I get:

JScript Panel v2.4.1.1 (Georgia by Mordred)
JavaScript runtime error:
Object doesn't support this action
File: %AppData%\Roaming\foobar2000\georgia\js\georgia-main.js
Line: 41, Col: 2

Anything I possibly did wrong?

Sieboldianus commented 3 years ago

Fixed one issue by adding:

function calcAgeDateString(date) {
    if ( typeof date !== 'number' )
        return;
    var str = '';
    if (date.length) {
    ...
marc2k3 commented 3 years ago

I think the 2nd issue is caused by resizing the window above/below 3000px wide. You can fix it by installing the very latest version of JScript Panel here:

https://github.com/marc2k3/foo_jscript_panel/releases

Then replace this code at line 41 of georgia-main.js

    g_tooltip = window.CreateTooltip('Segoe UI', scaleForDisplay(15));
    g_tooltip.setMaxWidth(scaleForDisplay(300));
    g_tooltip.text = '';    // just in case

with

    if (!g_tooltip) {
        g_tooltip = window.CreateTooltip();
    }
    window.SetTooltipFont('Segoe UI', scaleForDisplay(15));
    g_tooltip.SetMaxWidth(scaleForDisplay(300));
    g_tooltip.text = '';    // just in case
kbuffington commented 3 years ago

The second issue should be fixed out of the box in the new beta. Not sure what was causing your first issue, but let me know if it's still a problem if you can.