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 script discussion/help (Read 301427 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

Re: JScript Panel script discussion/help

Reply #150
All samples I find for playback order button work fine in wsh panel but in js panel they give error -
Quote
JavaScript runtime error:
Overflow
File: <main>
Line: 132, Col: 2
<source text only available at compile time>
line is   k.CheckMenuRadioItem(1, 7, fb.PlayBackOrder + 1);

removing +1/-1 stops crashing but then the menu doesn't actually do anything. Is there a way to make it JS panel friendly?


Re: JScript Panel script discussion/help

Reply #152
Perfect, thanks again.

Re: JScript Panel script discussion/help

Reply #153
Last.fm updated their website today and it broke image downloading in my thumbs/now playing (simple) scripts. This fixes it...

https://raw.githubusercontent.com/19379/js-marc2003/master/js/thumbs.js

Just save it inside js_marc2003\js.

Thank you.
Each folder is now duplicates example:
Medeski, Martin & Wood 100596f6218c45c69164896428acb00a.jpg
Medeski, Martin & Wood_100596f6218c45c69164896428acb00a.jpg.jpg
This can be fixed?


Re: JScript Panel script discussion/help

Reply #155
I'm having a problem with the on_mouse_wheel callback. (jscript panel & wsh panel)
Any help is appreciated.

Using an external mouse with my laptop , scrolling is possible and  the callback returns step of 1 or -1 .

Using the touchpad though , with Asus Smart Gesture drivers , two-finger scrolling returns multiple steps of 0  and scrolling does not work right.

Is it a crappy driver issue , or an issue with the callback ?

Native playlists views , scollbars and volume are working fine with the two-finger scroll.

Re: JScript Panel script discussion/help

Reply #156
Code: [Select]
function on_mouse_wheel(a, b, c) {
    fb.trace("a: " + a);
    fb.trace("b: " + b);
    fb.trace("c: " + c);
}

Can you report the value of b when you scroll up/down with your trackpad.

Re: JScript Panel script discussion/help

Reply #157
Down
Code: [Select]
b: -80 
b: -82
b: -82
b: -46
b: -46
b: -46
b: -46
b: -46
b: -46
b: -46
b: -46
b: -46
b: -46
b: -46
b: -45
b: -45
b: -45
b: -45
b: -45
b: -45
b: -45
b: -44
b: -44
b: -44
b: -44
b: -44
b: -43
b: -43
b: -43
b: -43
b: -42
b: -42
b: -42
b: -42
b: -41
b: -41
b: -41
b: -40
b: -40
b: -40
b: -39
b: -39
b: -38
b: -38
b: -38
b: -37
b: -37
b: -36
b: -36
b: -35
b: -35
b: -35
b: -34
b: -34
b: -33
b: -33
b: -32
b: -31
b: -31
b: -30
b: -30
b: -29
b: -29
b: -28
b: -27
b: -27
b: -26
b: -26
b: -25
b: -24
b: -24
b: -23
b: -22
b: -22
b: -21
b: -20
b: -19
b: -19
b: -18
b: -17
b: -16
b: -16
b: -15
b: -14
b: -13
b: -13
b: -12
b: -11
b: -10
b: -9
b: -8
b: -7
b: -7
b: -6
b: -5
b: -4
b: -3
b: -2
b: -1
 
Up
Code: [Select]
b: 112 
b: 112
b: 40
b: 64
b: 64
b: 64
b: 64
b: 64
b: 64
b: 64
b: 64
b: 64
b: 64
b: 64
b: 63
b: 63
b: 63
b: 63
b: 63
b: 63
b: 63
b: 62
b: 62
b: 62
b: 62
b: 62
b: 61
b: 61
b: 61
b: 61
b: 60
b: 60
b: 60
b: 60
b: 59
b: 59
b: 59
b: 58
b: 58
b: 58
b: 57
b: 57
b: 56
b: 56
b: 56
b: 55
b: 55
b: 54
b: 54
b: 53
b: 53
b: 52
b: 52
b: 52
b: 51
b: 50
b: 50
b: 49
b: 49
b: 48
b: 48
b: 47
b: 47
b: 46
b: 45
b: 45
b: 44
b: 44
b: 43
b: 42
b: 42
b: 41
b: 40
b: 40
b: 39
b: 38
b: 37
b: 37
b: 36
b: 35
b: 34
b: 34
b: 33
b: 32
b: 31
b: 30
b: 30
b: 29
b: 28
b: 27
b: 26
b: 25
b: 24
b: 24
b: 23
b: 22
b: 21
b: 20
b: 19
b: 18
b: 17
b: 16
b: 15
b: 14
b: 13
b: 12
b: 11
b: 10
b: 9
b: 8
b: 7
b: 6
b: 5
b: 4
b: 2
b: 1
b: 2
b: 2
b: 2
b: 2
b: 2
b: 2
b: 2
b: 2
b: 2
b: 2
b: 2
b: 2
b: 2
b: 2
b: 2

a = 0
c = 120

Re: JScript Panel script discussion/help

Reply #158
Can you try this updated component. It's just the dll but I'm sure you know where to put it.

edit: temporary link removed. I'll publish a proper update later.

Re: JScript Panel script discussion/help

Reply #159
Thanks for your help marc2003.

The updated component resolved the problem and works fine. :)

Re: JScript Panel script discussion/help

Reply #160
@marc2003   How can I change the Volume sample script so that it works vertically instead of horizontally?

Re: JScript Panel script discussion/help

Reply #161
Inside your panel, replace the on_paint function with this:

Code: [Select]
function on_paint(gr) {
gr.FillSolidRect(volume.x, volume.y, volume.w, volume.h, volume.c1);
gr.FillSolidRect(volume.x, volume.y + volume.h - volume.pos(), volume.w, volume.pos(), volume.c2);
}

Then open js_marc2003\js\volume.js and replace the this.move function with this:

Code: [Select]
		this.move = function (x, y) {
this.mx = x;
this.my = y;
if (this.trace(x, y)) {
y -= this.y;
var pos = y < 0 ? 1 : y > this.h ? 0 : 1 - (y / this.h);
this.drag_vol = 50 * Math.log(0.99 * pos + 0.01) / Math.LN10;
_.tt(this.drag_vol.toFixed(2) + " dB");
if (this.drag)
fb.Volume = this.drag_vol;
this.hover = true;
return true;
} else {
if (this.hover)
_.tt("");
this.hover = false;
this.drag = false;
return false;
}
}

and replace the this.pos function with this:

Code: [Select]
		this.pos = function () {
return _.ceil(this.h * (Math.pow(10, fb.Volume / 50) - 0.01) / 0.99);
}

Make sure reload the panel after editing the .js file.

Re: JScript Panel script discussion/help

Reply #162
@marc2003 I now have a vertical volume bar. Thank you!

Re: JScript Panel script discussion/help

Reply #163
marc2003, any way for different Autoplaylist panels to keep their own queries? As it is now, one will 'pick off' queries from another, and you'll end up with two panels with same queries on both.


Re: JScript Panel script discussion/help

Reply #164
Thanks for spotting that. The updated file can be downloaded using the same link:
https://raw.githubusercontent.com/19379/js-marc2003/master/js/thumbs.js
Hello !
Help please with thumbs. Is it possible to change the aspect of double-clicking on the screen?
I tried through window.SetProperty ( "2K3.THUMBS.ASPECT", 0);
window.SetProperty ( "2K3.THUMBS.ASPECT", 1);
window.SetProperty ( "2K3.THUMBS.ASPECT", 2);
window.SetProperty ( "2K3.THUMBS.ASPECT", 3);
but window.Repaint ();  does not work here.
After window.Reload (); do not load next images from the Internet
How to refresh the screen? Thank you!

 

Re: JScript Panel script discussion/help

Reply #165
OoNebsoO, autoplaylists is meant to be single instance only. However, you could try hacking it like this

Code: [Select]
var list = new _.list("autoplaylists", 10, 24, 0, 0); //original line - do not touch
list.filename = folders.settings + "autoplaylists2.json"; //only add this/modify filename in extra panels. autoplaylists.json is the original filename so don't use that
list.update();

seriousstas,

Code: [Select]
thumbs.aspect++;
if (thumbs.aspect > 3)
    thumbs.aspect = 0;
window.SetProperty("2K3.THUMBS.ASPECT", thumbs.aspect);
window.Repaint();



Re: JScript Panel script discussion/help

Reply #167
Much appreciated, yet again, marc. :)

Re: JScript Panel script discussion/help

Reply #168
Yet one question :):
Delete function for a single file:
Code: [Select]
this.delete_image = function () {
_.recycleFile (this.files [this.images]);
this.update (); }
How do delete all the files in the current folder?

Re: JScript Panel script discussion/help

Reply #169
Code: [Select]
		this.delete_image = function () {
_.map(this.files, _.recycleFile);
this.update();
}

Re: JScript Panel script discussion/help

Reply #170
Seems like if a character tabulation (U+0009) is present in a tag and a script tries to access it the result is a crash.
https://en.wikipedia.org/wiki/Whitespace_character



Don't expect to have any in my tags, just thought I'd mention it anyway.

Re: JScript Panel script discussion/help

Reply #171
There is no problem accessing/displaying tags with these characters in. The error is caused by the script trying to create a new folder based on the tag value. I'll look at handling this better.


Re: JScript Panel script discussion/help

Reply #173
Thank you for your work marc!

Re: JScript Panel script discussion/help

Reply #174
marc, in your sample track info + seekbar + buttons is it possible to have a notch/mark on the seekbar at a certain percent? Any directions if you don't mind?