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 139664 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1075
Here's a quick and dirty hack for autoplaylists that will sort by name if you middle click. Right click>Configure and add this...

Code: [Select]
function on_mouse_mbtn_up() {
    if (list.data.length < 2) return;
    list.data = _.orderBy(list.data, 'name');
    list.save();
    list.offset = 0;
    window.Repaint();
}

You can also click entries and move up/down but that's a bit cumbersome.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1076
TheQwertiest, v.1.6.0., my script "clock and timer" works well.
But i have a new problem.
I use pseodo-transparence.
After start Foobar i have black background now (pseodo-transparence does not work). If i go to "Show configure" - "Appearence" and press "OK" pseodo-transparence turns on.

Or I make mistake and must use version 1.5.2.

Thanks.
I.m. UR5EQF

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1077
Here's a quick and dirty hack for autoplaylists that will sort by name if you middle click. Right click>Configure and add this...

Code: [Select]
function on_mouse_mbtn_up() {
    if (list.data.length < 2) return;
    list.data = _.orderBy(list.data, 'name');
    list.save();
    list.offset = 0;
    window.Repaint();
}

You can also click entries and move up/down but that's a bit cumbersome.
Thanks!


Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1079
@kgena_ua , thanks, I'll take a look.
@regor , that's intentional: I want my download count and fb2k component section does not provide it (I need to feed my sense of importance after all :D)

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1080
@kgena_ua, wait, is this on 1.6.0 or on the dev build? If it's 1.6.0 can you try the dev build and see if this bug is present there?


Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1082
See the first post in this thread, there is a link called "Dev Build". This link always points to the latest dev build.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1083
See the first post in this thread, there is a link called "Dev Build".
Thanks.
Everything seems to work.
I.m. UR5EQF

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1084
For example, I made a simple script. Sometimes I get an error.
Code: [Select]
const objShellApp = new ActiveXObject("Shell.Application");

function get_folder() {
    var prompt = "\nSelect folder ...";   
    var folder = objShellApp.BrowseForFolder(0, prompt, 512, 17);
    if (folder != null) {
        /// do ...
    }
}

MF_ENABLED = 0x00000000;
MF_SEPARATOR = 0x00000800;

function on_mouse_rbtn_up(x, y){
    const _menu = window.CreatePopupMenu();
    _menu.AppendMenuItem( MF_ENABLED, 100, "Getfolder");
    _menu.AppendMenuItem( MF_SEPARATOR, 0, 0);
    _menu.AppendMenuItem( MF_ENABLED, 230, "Edit Script");

    ret = _menu.TrackPopupMenu(x, y);
   
    switch (ret) {
    case 100:
        get_folder();
        break;
    case 230:
        window.EditScript();  
        break; 
    }
    return true;  
}

This also happens with:
utils.InputBox();
WshShell.Popup();
Select a menu item and wait.
Sometimes the error occurs immediately.
I.m. UR5EQF

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1085
For example, I made a simple script. Sometimes I get an error.
Code: [Select]
const objShellApp = new ActiveXObject("Shell.Application");

function get_folder() {
    var prompt = "\nSelect folder ...";   
    var folder = objShellApp.BrowseForFolder(0, prompt, 512, 17);
    if (folder != null) {
        /// do ...
    }
}

MF_ENABLED = 0x00000000;
MF_SEPARATOR = 0x00000800;

function on_mouse_rbtn_up(x, y){
    const _menu = window.CreatePopupMenu();
    _menu.AppendMenuItem( MF_ENABLED, 100, "Getfolder");
    _menu.AppendMenuItem( MF_SEPARATOR, 0, 0);
    _menu.AppendMenuItem( MF_ENABLED, 230, "Edit Script");

    ret = _menu.TrackPopupMenu(x, y);
   
    switch (ret) {
    case 100:
        get_folder();
        break;
    case 230:
        window.EditScript();  
        break; 
    }
    return true;  
}

This also happens with:
utils.InputBox();
WshShell.Popup();
Select a menu item and wait.
Sometimes the error occurs immediately.
Does it happen with the dev build as well?


Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1087
Not sure if it has been already changed, but on v1.5.2-dev+28cbd05e I have just seen a BSOD and all packages being used have been corrupted, those panel reset and all properties lost.  ::)  Having a backup of the json files as fallback would come handy if that single file can break everything.

Does it happen with the dev build as well?
@TheQwertiest.
Happened before And now with the dev build.
Can also confirm that behavior when opening popups in any way.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1088
Happened before on this example. I had to abandon such a code.
Code: [Select]
MF_ENABLED = 0x00000000;
MF_SEPARATOR = 0x00000800;

var limit = 0;

function on_mouse_rbtn_up(x, y){
    const _menu = window.CreatePopupMenu();
    _menu.AppendMenuItem( MF_ENABLED, 100, "Set limit");
    _menu.AppendMenuItem( MF_SEPARATOR, 0, 0);
    _menu.AppendMenuItem( MF_ENABLED, 230, "Edit Script");

    ret = _menu.TrackPopupMenu(x, y);
   
    switch (ret) {
    case 100:
        download_limit(x, y);
        break;
    case 230:
        window.EditScript();  
        break; 
    }
    return true;   


function download_limit(x, y){
    const _menu = window.CreatePopupMenu();
    _menu.AppendMenuItem(MF_ENABLED, 1, "Increase");
    _menu.AppendMenuItem(MF_ENABLED, 2, "Limit : "  + limit + "     Return to main menu");
    _menu.AppendMenuItem(MF_ENABLED, 3, "Decrease");

    ret = _menu.TrackPopupMenu(x, y);

    switch (ret) {
    case 1:
        limit = limit + 1;
        // do
        download_limit(x, y);
        break;
    case 2:
        on_mouse_rbtn_up (x, y);
        break;
    case 3:
        limit = limit <= 1 ? 1 : limit - 1;
        // do
        download_limit(x, y);
        break;
    }
}
I.m. UR5EQF

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1089
Happened before on this example. I had to abandon such a code.
Code: [Select]
MF_ENABLED = 0x00000000;
MF_SEPARATOR = 0x00000800;

var limit = 0;

function on_mouse_rbtn_up(x, y){
    const _menu = window.CreatePopupMenu();
    _menu.AppendMenuItem( MF_ENABLED, 100, "Set limit");
    _menu.AppendMenuItem( MF_SEPARATOR, 0, 0);
    _menu.AppendMenuItem( MF_ENABLED, 230, "Edit Script");

    ret = _menu.TrackPopupMenu(x, y);
   
    switch (ret) {
    case 100:
        download_limit(x, y);
        break;
    case 230:
        window.EditScript();  
        break; 
    }
    return true;  
}

function download_limit(x, y){
    const _menu = window.CreatePopupMenu();
    _menu.AppendMenuItem(MF_ENABLED, 1, "Increase");
    _menu.AppendMenuItem(MF_ENABLED, 2, "Limit : "  + limit + "     Return to main menu");
    _menu.AppendMenuItem(MF_ENABLED, 3, "Decrease");

    ret = _menu.TrackPopupMenu(x, y);

    switch (ret) {
    case 1:
        limit = limit + 1;
        // do
        download_limit(x, y);
        break;
    case 2:
        on_mouse_rbtn_up (x, y);
        break;
    case 3:
        limit = limit <= 1 ? 1 : limit - 1;
        // do
        download_limit(x, y);
        break;
    }
}

It happens on every instance where the code is waiting for user input to continue execution. Menus, input boxes, etc. Obviously there is not a reason to open a menu and wait... but if you do, you get a warning about script taking too much time. You could bypass it using promises though... but agree a workaround on the base code would be better.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1090
Trying to switch Darkone theme to SMP and I was having great success until the Display. I get this...

Failed to create GdiPlus object (0x2): InvalidParameter
File: Display.js
Line: 162, Column: 18
Stack trace:
on_paint@Display.js:16218

Line 162 is: d_font = gdi.Font("Arial Black", f_size);

It happens on bootup. Reloading works fine.

I have made no changes to the code other than taking out Dispose. In fact, anything that has a line like this in it, whether it's Darkone or not, crashes . I can reload but it will crash on bootup.

EDIT: Ok, never mind. It stopped doing this after I "fixed" the Visual switch in the Panel Stack Splitter.  But the switch worked fine with JScript.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1091
Just guessing but I suspect the issue is related to the variable f_size being dependent on panel width/height which could be 0 on startup - this would explain why it works after reloading later. Ideally, it should be initialised with a sensible minimum value for a font and only grow if the panel gets bigger.

edit: with regard to JSP behaving differently, SMP is doing it better by throwing more errors. While it might seem like an inconvenience, it actually forces the creation of better scripts.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1092
Thanks for the reply. I'm back to that error again. I thought I had it licked. I actually have two displays on my Darkone. (I'm talking about the display with the Elapsed/Remaining time). It's fine with one display but when I add an additional one, it throws the error on bootup.

Only one display is visible at a time.

It used to throw the error when I cycled the displays with the Visual switch but I tweaked the "Switch code" a bit and now it errors only on bootup. 

So how would I go about initializing the width/height?

Thanks, again!

 

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #1093
Ok, I think I REALLY fixed it this time. :) I believe it had to do with the panel stack settings (as stated above), specifically the Panel List settings (Left, Top, Width, Height). I had duplicate values in both the splitter's $movepanel entries AND the Panel List.  Once I deleted the panel list entries the errors stopped.

Anyway, thanks for your time.

 
SimplePortal 1.0.0 RC1 © 2008-2021