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: Spider Monkey Panel (foo_spider_monkey_panel) (Read 362859 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

 

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #951
Great. Btw, I can provide you the images for my scripts if you want to add them.
Sure, but it needs to be
- static (i.e. no animations).
- compact (i.e. minimal zooming required).
- display the actual functionality of the script without showing a lot of unrelated things.

It should also not look very out of place in the dark theme of the site.

Would it be possible to add a framework category? To add there base scripts which can be used by users to create its own full scripts.
I need to think a bit about how to organize it, but I think it's doable. (I've zero UI sense, so it takes a lot of time to decide on those things...)

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #952
Currently working on an options framework: as you can see it's pretty much equal to Wilb html's one, but within an SMP panel, so functional for non IE and wine users. And it would work with arbitrary input, so valid for any type of script.
Cool stuff. Randomly, I also started down this road, but decided to build out a full UI library first before generating config pages from json schemas. I went with material design as my basis because I thought it'd be fun and challenging. Here's what I've got so far:



It's pretty accurate, even down to the subtle onhover effects (see Blue Toggle). Had to make some changes to FSM to get the text box highlighting stuff to work correctly, but now that 1.5 is released I'll probably start back working on this. The color pickers are a little janky, and need some way to type in values, and I need to make some usability improvements to how you create controls, but otherwise it's pretty much done. If you're interested i can share the code before it makes it to Georgia.
That would be great! As long as it works out of the box for other scripts, I really think these things would really make it easier to create new scripts without reinventing the wheel for every new one.

Great. Btw, I can provide you the images for my scripts if you want to add them.
Sure, but it needs to be
- static (i.e. no animations).
- compact (i.e. minimal zooming required).
- display the actual functionality of the script without showing a lot of unrelated things.

It should also not look very out of place in the dark theme of the site.

Ok! No problem, easy. (the bg colours are configurable in 2 of them anyway)

Would it be possible to add a framework category? To add there base scripts which can be used by users to create its own full scripts.
I need to think a bit about how to organize it, but I think it's doable. (I've zero UI sense, so it takes a lot of time to decide on those things...)
At first I thought about editing the foobar wiki, but I do really think it would make more sense some kind of list at the place people already download SMP (having a wiki as a secondary resource if anything). Maybe a mix of both would do, links to github on your site (following your simple ui approach), with a link to +info at the wiki.

PD: about the known wine issues, don't forget html popups are totally broken, so other methods are needed (like editing ini files, json, menus, drawing options panel within the panel using js, etc.)

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #953
Added a page containing known issues and workarounds for WINE: https://theqwertiest.github.io/foo_spider_monkey_panel/docs/wine/
Also add: TrueType (.ttf) fonts need to be called via the 'UniqueID' TTF name or the fonts will not be found and recognized via utils.CheckFont() and gdi.Font().
Best would be to have both 'UniqueID' TTF and 'Family' PS/TTF named the same to have Windows and Linux compatibility.
This took me a LONG time through trial and error because there really is no documentation online...

Also as @regor mentioned, WilB's biography script will crash on right click ( option popup ) in Wine...

And this is the drag n drop issue in Wine, you can drag ( selection is displayed ) the music folder onto the playlist,
a plus icon will be also displayed but if you drop nothing happens. No music files are added, the command/execution will be ignored:

Spoiler (click to show/hide)

But native drag n drop in original foobar in Wine works...

More info see here: https://github.com/TT-ReBORN/Georgia-ReBORN/issues/2


-TT

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #954
Added a page containing known issues and workarounds for WINE: https://theqwertiest.github.io/foo_spider_monkey_panel/docs/wine/

I always had to comment out this in scripts, is related with copy and paste i think.

Code: [Select]
const docTxt = ''s.doc.parentWindow.clipboardData.getData('text')*; let idx, Index = 1;

Scripts in sample folder complain about AppliedDPI, this can be avoid adding to the registry

Code: [Select]
HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics
AppliedDPI REG_DWORD 0x00000060 (96)

Scripts do not download images. I don't know why

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #955
That would be great! As long as it works out of the box for other scripts, I really think these things would really make it easier to create new scripts without reinventing the wheel for every new one.
Agreed. The only issue with any UI framework is handling the callbacks well. I've paired mine down to the bare minimum but still need to handle: on_mouse_move, on_mouse_lbtn_up, on_mouse_lbtn_down, on_char, and on_key_down (maybe on_mouse_wheel too?). If you do things in a sane way (so *not* the way I ever do things) and have separate FSM windows for these things it's no problem, but if you need to combine them in an existing theme which already has its own callbacks, then things get a little more complex.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #956
Agreed. The only issue with any UI framework is handling the callbacks well. I've paired mine down to the bare minimum but still need to handle: on_mouse_move, on_mouse_lbtn_up, on_mouse_lbtn_down, on_char, and on_key_down (maybe on_mouse_wheel too?). If you do things in a sane way (so *not* the way I ever do things) and have separate FSM windows for these things it's no problem, but if you need to combine them in an existing theme which already has its own callbacks, then things get a little more complex.
Are you talking about this? =)
https://github.com/TheQwertiest/foo_spider_monkey_panel/projects/1#card-14354341

PS: This can be easily emulated even in current SMP - https://github.com/TheQwertiest/CaTRoX_QWR/blob/78032d1e8af94d9c97a3a313c7c40bf5624119f6/package_content/%7B1583C4B7-53AD-403F-8F7E-CB20490AAA26%7D/scripts/js_marc2003/js/helpers.js#L52 and https://github.com/TheQwertiest/CaTRoX_QWR/blob/61eecfa4159e3714d58f53ae942d5f1861e83fb2/theme/Scripts/js_marc2003/js/helpers.js#L989

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #957
Are you talking about this? =)
https://github.com/TheQwertiest/foo_spider_monkey_panel/projects/1#card-14354341

PS: This can be easily emulated even in current SMP
Ha! That would simplify things.

I know it's not that difficult to emulate, but I was thinking more from a "User Regor wants to add my UI buttons into his theme so he'll need to call my callbacks from his" perspective. You could go the other way and make anyone integrating this framework register their callbacks with mine, but if you're going to be adding event listeners probably no point in worrying about it now.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #958
@TheQwertiest 1.5 appears to be causing foobar itself to completely hang when loading themes in some situations. I cannot tell why this is but repeated reloads of Georgia (and Georgia-reborn) cause it to happen. Just load the theme in a FSM panel, reload a few times and it should happen -- but it's not related to reloading quickly. @dwmartin0906 reported this to me, and I was easily able to repro. Unfortunately foobar completely becomes unresponsive and needs to be killed so there's no crash report to point to anything. It's happening in the async include calls my theme uses at startup, and happens at a different file each time it seems. If I disable calling include inside async promises it stops occurring.



Edit: I've tried to create a minimally reproducible sample, but no dice. Just including some simple files async even if they busy wait for a while inside doesn't seem to do anything.

BTW, I'd debug this myself, but for some reason when ever I attach to the debugger, VS doesn't think the FSM dll is loaded or something. It's a pain.



Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #961
Regarding the issue with Georgia hanging up on reloads with FSM 1.5, I just tried your latest dev build and Georgia hung up on the fourth reload.  Thank you for looking at this.


Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #963
Tried to attach before catching the file size. This is from the latest dev build: removed.


Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #965
That would be great! As long as it works out of the box for other scripts, I really think these things would really make it easier to create new scripts without reinventing the wheel for every new one.
Agreed. The only issue with any UI framework is handling the callbacks well. I've paired mine down to the bare minimum but still need to handle: on_mouse_move, on_mouse_lbtn_up, on_mouse_lbtn_down, on_char, and on_key_down (maybe on_mouse_wheel too?). If you do things in a sane way (so *not* the way I ever do things) and have separate FSM windows for these things it's no problem, but if you need to combine them in an existing theme which already has its own callbacks, then things get a little more complex.

Just wrap them.
Code: [Select]
function onNotifyData(name, info) { 
switch (name) {
case 'Playlist manager: playlistPath': {
if (info && info.length) {
const properties =  getPropertiesPairs((typeof buttons === 'undefined' ? menu_properties : menu_panelProperties), 'menu_');
const playlistPath = JSON.parse(properties.playlistPath[1]);
let bDone = false;
if (isArrayStrings(info)) {
if (!new Set(playlistPath).isSuperset(new Set(info))) {
playlistPath.concat([...new Set(info).difference(new Set(playlistPath))])
bDone = true;
}
} else if (isStringWeak(info)) {
if (playlistPath.indexOf(info) === -1) {
playlistPath.push(info);
bDone = true;
}
}
if (bDone) {
properties.playlistPath[1] = JSON.stringify(playlistPath);
overwriteProperties(properties); // Updates panel
}
}
break;
}
}
}
if (typeof on_notify_data !== 'undefined') {
const oldFunc = on_notify_data;
on_notify_data = function(name, info) {
oldFunc(name, info);
onNotifyData(name, info);
}
} else {var on_notify_data = onNotifyData;}



Had that problem when merging arbitrary buttons/scripts in my buttons bar, not anymore. Now I don't care at all about callbacks being rewritten no matter what I merge.

Obviously if another method is added it would be great too.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #966
@MordredKLB, @dwmartin0906 , I've added a workaround that should fix your issue (once dev build is finished building).

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #967
Your latest build seems to have fixed the reload issue. I tested both Georgias and gave up after 25 reloads each.  Thank you very much.  And thank you, @MordredKLB, for your help.  Now I'll be ready if you or TT make any future changes requiring FSM 1.5.  You guys are the best.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #968
Got it, thanks... Sigh... I hate COM objects with every fiber of my being...


Breaking change for v2... drop support for all of them. :D

You could implement a few file/folder creation/deletion methods so fso is no longer needed. Expose ShellExecute/MessageBox so WshShell isn't required. Exposing the http_client from the SDK would be more effort but maybe less hassle in the long run??


Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #969
Breaking change for v2... drop support for all of them. :D
I've actually considered doing this multiple times, but (for now?) the pain required to reimplement everything is much bigger than the pain from having to deal with COM...

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #970
Cache not working in JS Smooth Browser


Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #972
Currently working on an options framework: as you can see it's pretty much equal to Wilb html's one, but within an SMP panel, so functional for non IE and wine users. And it would work with arbitrary input, so valid for any type of script.
It's pretty accurate, even down to the subtle onhover effects (see Blue Toggle). Had to make some changes to FSM to get the text box highlighting stuff to work correctly, but now that 1.5 is released I'll probably start back working on this. The color pickers are a little janky, and need some way to type in values, and I need to make some usability improvements to how you create controls, but otherwise it's pretty much done. If you're interested i can share the code before it makes it to Georgia.
Why you had to do such changes? I got it working pretty similar without any problem.
Spoiler (click to show/hide)

Found it more simple to change colors directly with ColourPicker and just display the result.

Right now I got 2 themes working (I find yours prettier than WIilbs approach I tried to mimic), also tabs width can be set to according to text width or splitting the window width. But did not care about reproducing the toogle and dropdown lists since the former is essentially a themed checkbox and the latter can be simulated 100% with menus and changing the button title dynamically.

Also found the circle checks are pretty sensitive to size, sometimes being a bit pixelated. Did you have the same problem?

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #973
Why you had to do such changes? I got it working pretty similar without any problem.
It's all in the PR: https://github.com/TheQwertiest/foo_spider_monkey_panel/pull/140

Quote
Right now I got 2 themes working (I find yours prettier than WIilbs approach I tried to mimic), also tabs width can be set to according to text width or splitting the window width. But did not care about reproducing the toogle and dropdown lists since the former is essentially a themed checkbox and the latter can be simulated 100% with menus and changing the button title dynamically.
You're not wrong. I just wanted to see if I could do them... and it's always nice to have options.

Quote
Also found the circle checks are pretty sensitive to size, sometimes being a bit pixelated. Did you have the same problem?
The GDI+ circle anti-aliasing is not amazing. You definitely need to find some magic numbers and stick with them.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #974
This is a VERY ugly, hacked together stand alone version that you can play around with if you want. Requires FSM 1.5. There are no callbacks when you do anything yet and things like the tabs don't actually do anything. Also the initialization of the page is entirely manual and not generated from a schema. I stand by the UI Objects (outside the color picker) which I believe have been implemented pretty well, and nothing else.

You might also want to play around with the fonts listed in on_init and make sure you're choosing ones you have installed.