Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: JScript Panel (Read 298436 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Re: JScript Panel

Reply #825
I've installed foo_jscript_panel-3.0.3 under FB2K 1.6.11.  I've installed FontAwesome in Win7.

Basic lack of understanding here.  I want to try out JS Smooth Playlist Manager in the Default UI.

I've added a tab to a tabbed panel, and loaded Jscript Panel in it.  I get "JavaScript error".  Right-click > Configure > Samples > JS Smooth Playlist Manager.  Edit window shows the (presumably) relevant JS.  Then what?  There's no "save" option under File.  Trying to close the window complains the changes haven't been saved.

What am I missing?
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: JScript Panel

Reply #826
There is no save because clicking OK saves any changes you've made in the editor. Making changes and then using the close or cancel buttons will prompt you and that means clicking OK (or Apply to test any script while the configuration window remains open).

---

As for the error... if you're getting it immediately after loading it on windows 7, it usually means you've not installed all windows updates.

If you check the foobar2000 console from the View menu, you might see one of these 2 errors

This component requires a system with IE9 or later. << I don't really need to explain what is missing. Windows 7 users really should have IE11 installed even though it's functionally useless and you must be using another browser to browse the web right now!

Critical graphics initialisation failure. << This means you've not installed the windows 7 platform update. There are special instructions with a link for windows 7 users here... (edit: thinking about it, you wouldn't see the javascript error text if this was missing!!)

https://marc2k3.github.io/jscript-panel/docs/#minimum-requirements

If you have these requirements installed then any errors would be due to a bug in the script you're using in which case that would also be detailed in the foobar2000 Console (and a popup window should show too).

I'd like to think any script included with the component wouldn't throw an error on first use but it does happen but I need reports of errors to fix them.

Here's an example of me using it on windows 8.1 (the oldest OS I have access to right now)...





Re: JScript Panel

Reply #827
I'm not bumping the version number because I can't recompile the component just now but I've reuploaded the current version 3.0.3 which fixes a few sample bugs (mostly Smooth / JS Playlist related).

https://github.com/marc2k3/jscript-panel/releases


Re: JScript Panel

Reply #828
OK, thanks, I'm clearly being too naive about this.

There is no save because clicking OK saves any changes you've made in the editor.
That's as maybe, but I don't see an "OK" on my screen.  I'm not getting the "Reset" "OK" "Apply" "Cancel" panel rendered.  For one thing the screen is only 1024x600 so even the minimum size edit window doesn't fit, but then if I use Move to push it up there are no buttons along the bottom.

As for the error... if you're getting it immediately after loading it on windows 7, it usually means you've not installed all windows updates.
It's WIn7 Starter Edition.  I've checked for updates but all I get is an error.

If you check the foobar2000 console from the View menu, you might see one of these 2 errors

This component requires a system with IE9 or later. << I don't really need to explain what is missing. Windows 7 users really should have IE11 installed even though it's functionally useless and you must be using another browser to browse the web right now!
That's not the error I'm getting, but you're right I'm not running IE.  I have Chrome installed on the target system for when I really need a web browser (but this is basically a netbook dedicated to music), but mostly (and right now) I use other means to interact with the Internet.

Critical graphics initialisation failure. << This means you've not installed the windows 7 platform update. There are special instructions with a link for windows 7 users here... (edit: thinking about it, you wouldn't see the javascript error text if this was missing!!)
That's what I see in the console.  Nonetheless, the JScript Panel is orange with "JavaScript error" in white.

https://marc2k3.github.io/jscript-panel/docs/#minimum-requirements
So basically my netbook is never going to satisfy the requirements.  Shame you're relying on so much support from things which are basically nothing to do with the operating system.  Couldn't you just package up the necessary DLLs?

If you have these requirements installed then any errors would be due to a bug in the script you're using
That's a bit tough considering I haven't input *any* scripts!

Here's an example of me using it on windows 8.1 (the oldest OS I have access to right now)...
At least that helped me identify there is no "OK" button!



It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: JScript Panel

Reply #829
I might have a play with whether I can install SP1, but not until I've taken a disk image!  Only then does it appear I could do the Platform Update (whatever that might be).  But then, what about IE11?  Really?
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: JScript Panel

Reply #830
Well it looks like I need to update the requirements to include a 1024x768 screen. If you meet the windows requirements, you could actually get around it by using the keyboard shortcut CTRL+S to Apply changes and then close the window without getting any prompts.

And sorry about my edit being incorrect. Text rendering doesn't need the platform update like I thought it did. But it is required for all image handling which most scripts are heavily dependent on.

As for IE, the requirements/potential error was clearly stating that IE9 is required. I only mentioned IE11 because having that installed is just a side effect of most windows 7 users being fully up to date. I know windows 7 shipped with IE8 in 2009 but I did a quick check and IE9 was shipped in 2011.

edited: I included the wrong keyboard modifier in my original post - it's CTRL, not ALT.

Re: JScript Panel

Reply #831
Thanks for looking into this.

Ctrl+S does indeed get me past the save problem, but no further.  IE8 is installed.  I will (in the fullness of time) attempt to install Platform Update and IE9.
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: JScript Panel

Reply #832
I didn't really want to point new people towards my now abandoned old version of the component but this has no requirement for the platform update.

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

It still requires IE9 though.


Re: JScript Panel

Reply #833
That might be good for me.  Thanks.
It's your privilege to disagree, but that doesn't make you right and me wrong.


Re: JScript Panel

Reply #835
Yowzer!

Easier said than done, but I managed to install IE9 and the (old version of) JScript Panel works fine (using the Ctrl+S hack).  I now have JS Smooth Playlist Manager running in a tab (replacing the default playlist manager).

What's more, that unlocks the possibility of other JS-based functionality in the future.

THANK YOU!
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: JScript Panel

Reply #836
I'm pretty sure you can update IE without SP1 so that should be easier.
Just in case anybody else follows this path:
  • The netbook I'm using for this runs Windows 7 Starter (32-bit) with IE8 (I actually use Chrome for web stuff, when required), and first I took a system image so I had a chance of reversing any damage.
  • I had previously installed FontAwesome (see https://marc2k3.github.io/jscript-panel/docs/#minimum-requirements).
  • I downloaded the IE9 installation file from here: https://www.techspot.com/downloads/5047-internet-explorer-9-windows-7-32bit.html, having first checked it for malware here (which lets you provide the download link, then runs the payload past a huge list of malware checkers): https://www.virustotal.com/gui/home/upload.  (Good luck if you try to get an official IE9 download from Microsoft!)
  • Running the IE9 installer complained that the OS needed an update (which got me worried), but I followed the KB (Microsoft Knowledge Base) links and found it was a minimal update which completed quickly.
  • After the update, the IE9 installer ran (with the Wi-Fi turned off by now, so I could tell if it was trying to download anything else).
  • In FB2K (v1.6.11), I uninstalled the current JScript Panel (v3.0.3) and installed v2.8.8.  As discussed in previous posts, v3.0.3 requires Windows Platform Update, which itself requires SP1... and I'm not sure Win7 Starter is even a candidate for SP1!
  • I am now able to run the sample scripts provided in v2.8.8, of which I am using the "JS Smooth Playlist Manager" script, within a tab using the DUI.  The script editor window does not have Save and Exit (etc) buttons at the bottom due to the 600px height of my netbook screen, but the workaround is to use Ctrl+S to save and the top right X to exit.
It's your privilege to disagree, but that doesn't make you right and me wrong.


Re: JScript Panel

Reply #838
Marc, I was wondering if it could be possible to have a callback for property change, it would make keeping track of the panel state easier, something like this:

Code: [Select]
window.SetProperty("SOME.PROP", VALUE);

And this would trigger a callback like:

Code: [Select]
on_property_change(prop_name, value) {
    // do something
    // or sync property with other panels
    window.NotifyOthers("propUpdate", {
        prop: prop_name,
        val: value
    });
}

Do you think something like this could be implemented?

Re: JScript Panel

Reply #839
I won't be implementing a callback but you do something similar with plain old javascript.

Old code might look something like this...

Code: [Select]
var colour = window.GetProperty("COLOUR", RGB(0,0,0));

function update_colour() { // triggered by clicking a button/menu/whatever
   colour = ...
   window.SetProperty("COLOUR", colour);
   window.Repaint();
}

You can use Object.defineProperty with your own custom getter/setter like this...

Code: [Select]
function property(name, default_) {
Object.defineProperty(this, 'value', {
get : function () {
return this.val;
},
set : function (value) {
this.val = value;
window.SetProperty(this.name, this.val);
}
});

this.name = name;
this.default_ = default_;
this.val = window.GetProperty(name, default_);
}

Updated code would be like this...

Code: [Select]
var colour = new property("COLOUR", RGB(0, 0, 0));

To "get" the value you need to use colour.value like this...

Code: [Select]
gr.FillRectangle(0, 0, 200, 200, colour.value);

Now when you update the value you can write...

Code: [Select]
colour.value = some_new_colour();

And that is it. Because window.SetProperty is inside the custom "setter", it automagically updates and if you really must you can put your notify others code inside the custom set function too.

Re: JScript Panel

Reply #840
Thank you! I did not think about it this way, I can work with this and adjust it to my needs.

Re: JScript Panel

Reply #841
Thanks for your improvements to the jssx series of scripts, many of them are great and work well. Could you consider returning the jssp's ⭐  icon to the original version? Now the FontAwesome version of the stars is not as strong as the texture it was before.

 

Re: JScript Panel

Reply #843
"strong texture"??
Purely personal opinion, the FontAwesome version of the ⭐ icon doesn't look as good as the GuifxV2 Transports version. it would be great if you could switch back to the GuifxV2 Transports version. if not, I found that the last version was v2.6.2.3 and I'll try to see if I can modify it myself. thank you very much for your efforts.


Re: JScript Panel

Reply #845
I may consider letting people choose the font/symbol used via the properties dialog.
It would be great if it could be selected via the properties dialog, looking forward to it.


Re: JScript Panel

Reply #847
No x64 for V2?

Re: JScript Panel

Reply #848
Of course there is. It's clearly mentioned in the 2nd sentence.

edit: since github likes being awkward for pre-releases, you have to expand the "Assets" link to get the download to show.

Re: JScript Panel

Reply #849
I mean foo_jscript_panel2. I see it is stopped v2.8.8 without x64 Fb2k 2 versione mention.