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 288712 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Re: JScript Panel script discussion/help

Reply #825
I've never had anything to do with that particular script. Obviously the first thing you need to do is make all the changes necessary for it to work in SMP. If it works in JSP v2.4.0 right now, there is absolutely no way it's going to work without some tweaks. @TheQwertiest has detailed documentation on the changes required...

https://theqwertiest.github.io/foo_spider_monkey_panel/docs/guides/jsp_to_smp_migration_guide/

Re: JScript Panel script discussion/help

Reply #826
Hi, this is not working:
Code: [Select]
var objShell = new ActiveXObject('Shell.Application');
objShell.NameSpace(panel.tf('$directory_path(%path%)')).ParseName(panel.tf('%filename_ext%')).ModifyDate = '2018/09/07 15:51';
both panel.tf('$directory_path(%path%)') and panel.tf('%filename_ext%') return a correct value for the file to be changed, but date does not get modified.
If I run the same code, replacing 'panel.tf' values, from WSH, it does work. Any clue? Thanks.

 

Re: JScript Panel script discussion/help

Reply #827
Seems to work fine for me?? Bear in mind that if you have a last modified column in your playlist, it won't update automatically since you're updating the file externally. Running this directly after may help...

Code: [Select]
fb.RunContextCommandWithMetadb("Tagging/Reload info from file(s) if changed", panel.metadb);

Re: JScript Panel script discussion/help

Reply #828
Seems to work fine for me??
Actually it works. The reason my code is not working is because there are three lines just before,
Code: [Select]
var handles = fb.CreateHandleList(panel.metadb);
handles.UpdateFileInfoFromJSON(JSON.stringify(obj));
_.dispose(handles);
And it takes some time to update the file, i guess asynchronously, so when my code is run the file is not available. Is there any way to make sure UpdateFileInfoFromJSON has done its job before I update file modified time?

Quote
Bear in mind that if you have a last modified column in your playlist, it won't update automatically since you're updating the file externally. Running this directly after may help...
Code: [Select]
fb.RunContextCommandWithMetadb("Tagging/Reload info from file(s) if changed", panel.metadb);
Thanks for that tip!

Re: JScript Panel script discussion/help

Reply #829
Yes it's async but I would expect a single track to get updated pretty much instantly?? You get a progress dialog for longer operations and the component has no way of knowing when it's complete.

Anyway, check File>Preferences>Advanced>Tagging>General>Preserve file creation/access/modification time. That probably bypasses the need to write old timestamps back??

Re: JScript Panel script discussion/help

Reply #830
Yes it's async but I would expect a single track to get updated pretty much instantly??
Not really, otherwise my code would have worked. I solved it with a window.setTimeout call.

Quote
Anyway, check File>Preferences>Advanced>Tagging>General>Preserve file creation/access/modification time. That probably bypasses the need to write old timestamps back??
That could help. Thanks!.

Re: JScript Panel script discussion/help

Reply #831
In the sample script "Thumbs", I can search with %artist% in the last fm artist database. I have a lot of classical music and I'm interested in composer pictures. The composers name is stored in my %performer% tag. How can I search in the last fm database with %performer%?

Re: JScript Panel script discussion/help

Reply #832
Open the configuration window and enter this as the first line of the script before var panel...

Code: [Select]
DEFAULT_ARTIST = '$meta(performer,0)';

You could use %performer% if you were sure all tags are single value. Lookups of multi-value tags would not work well.


Re: JScript Panel script discussion/help

Reply #834
Hello all, i use JS Smooth Browser to see my new album in my librairie, i would like to have the most recent at the beginning so i add this in the Panel properties "sort order album :  $date(%last_modified%) | %album% | %discnumber% | %tracknumber% | %title% ".
l works fine but my newest albums are at the end of the list ...is it possible to sort the list by descending ?
i try : SORT BY DESCENDING  $date(%last_modified%) but nothing changed.....
thanks for your help.


Re: JScript Panel script discussion/help

Reply #836
 ;)  ;)  ;)
Fine, thank you !


Re: JScript Panel script discussion/help

Reply #838
Replace existing buttons.update function with this...

Code: [Select]
buttons.update = function () {
var x_pos = (panel.w - (bs * 4)) / 2;
this.buttons.stop = new _.button(x_pos, 0, bs, bs, {normal : 'buttons\\stop.png'}, function (x, y, mask) { fb.Stop(); }, 'Stop');
this.buttons.play = new _.button(x_pos + bs, 0, bs, bs, {normal : !fb.IsPlaying || fb.IsPaused ? 'buttons\\play.png' : 'buttons\\pause.png'}, function (x, y, mask) { fb.PlayOrPause(); }, !fb.IsPlaying || fb.IsPaused ? 'Play' : 'Pause');
this.buttons.previous = new _.button(x_pos + (bs * 2), 0, bs, bs, {normal : 'buttons\\previous.png'}, function (x, y, mask) { fb.Prev(); }, 'Previous');
this.buttons.next = new _.button(x_pos + (bs * 3), 0, bs, bs, {normal : 'buttons\\next.png'}, function (x, y, mask) { fb.Next(); }, 'Next');
}

Re: JScript Panel script discussion/help

Reply #839
It's nice to see some Coverflow chatter here. Does anyone know how to highlight the cover of the now playing track, only? As opposed to highlighting any cover that's been selected. Thanks!

Re: JScript Panel script discussion/help

Reply #840
Actually, never mind. The Coverflow is buggy and doesn't work properly with JS Smooth playlist. If you click on the Coverflow's album cover, it will not highlight on JSS unless the cover happens to be in view. In other words JSS can't scroll up and down with coverflow. JS Playlist works fine.

I'm using  v1.5.2: Bug Fixes by MordredKLB

EDIT... Actually, it's JSS that's the culprit. Don't know why it started doing this. It wasn't doing this before.

Another EDIT. :) It would seem using 2.5.6 version of JSS causes it to behave this way when 2.6.1 DLL is installed. Problem solved.


Re: JScript Panel script discussion/help

Reply #842
LOL, I'm keeping you busy. Anyway, thanks for verifying that.

Re: JScript Panel script discussion/help

Reply #843
How easy/hard is it to fix a line like this (from Darkone) now that "Dispose" doesn't work anymore.

Quote
   this.onMouseOut = function() {
      g_tooltip.Deactivate();
      g_tooltip.Dispose();
   }

Re: JScript Panel script discussion/help

Reply #844
It should be as simple as removing the line of code that contains the .Dispose call.

However, that would imply the script is calling window.CreateTooltip more than once in a panel instance which no longer permitted. If you remove that line and still get errors, post the whole script and I'll tell you how to adjust it.

Re: JScript Panel script discussion/help

Reply #845
Hey, thanks again! There was a domino effect, so the next trouble line was...

Quote
g_tooltip = window.CreateTooltip();

I changed it to...

Quote
g_tooltip = window.Tooltip;

Then I got another error about mousein or something. Anyway, I deleted all these entries and surprisingly (to me) it worked:

Quote
var g_tooltip;

this.tiptext = tiptext;

   this.onMouseIn = function() {
      g_tooltip = window.CreateTooltip();
      g_tooltip.Text = this.tiptext;
      g_tooltip.Activate();
   }

   this.onMouseOut = function() {
      g_tooltip.Deactivate();
      g_tooltip.Dispose();

(Also deleted some mousein/out entries in the main script)


Re: JScript Panel script discussion/help

Reply #846
Well there's no such thing as window.Tooltip. It won't throw errors because window is a global object so you'll end up with an undefined variable meaning you can't do anything with it.

Removing all that code means no tooltips but obviously they're not even close to being required if the button text/icons are clear.

Re: JScript Panel script discussion/help

Reply #847
...

Re: JScript Panel script discussion/help

Reply #848
Right, so, with an interest in seeing whether I can use JS to create a custom transport button panel and maybe even tailor the speed/pitch/tempo control, I installed a fresh portable FB2K and added JScript Panel from Github.  So far so good.

I then added JScript Panel to the installed components, and simply replaced the whole Default UI default panel with a JScript Panel panel.  So far so good.

Then I clicked in the panel as instructed (which brought up the editor), clicked "samples", selected "Track Info +Seekbar + Buttons", and then "OK".  But this is what I ended up with:

X

Is that right?  If not, what's gone wrong?  What do I do now?
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: JScript Panel script discussion/help

Reply #849
^ I'm guessing last thing on the first page of the docs -
Quote
Nearly all included samples require the installation of FontAwesome which you can grab here ...