Skip to main content

Topic: JScript Panel script discussion/help (Read 50082 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • marc2003
  • [*][*][*][*][*]
  • Developer
JScript Panel script discussion/help
To keep the main JScript Panel thread for component updates/issues only, I've started this.

Although many scripts should work in WSH Panel Mod and JScript Panel, there are incompatibilities which are only going to increase as time goes forward.

First of all, here is how to update WSH Panel Mod scripts for JScript Panel:

https://github.com/19379/foo-jscript-panel/...r-JScript-Panel
  • Last Edit: 30 January, 2017, 09:17:33 PM by marc2003

  • marc2003
  • [*][*][*][*][*]
  • Developer
JScript Panel script discussion/help
Reply #1
New JScript sample lastfm bio.txt used in chooser panel crashes. The other text samples I used (properties & thumbs) work fine. Error message below.

Code: [Select]
JScript Panel (Panel Receiver by marc2003): Microsoft JScript runtime error:
'this.content.length' is null or not an object
Line: 1, Col: 1
<source text only available at compile time>


Well it works for me so try putting the bio script in a fresh panel and see if you get the same error. If you do, try browsing wsh_data\artists\WHOEVER IT WAS and deleting the bio.www.last.fm.json file.

  • marc2003
  • [*][*][*][*][*]
  • Developer
JScript Panel script discussion/help
Reply #2
@Falstaff, I just installed your SmoothBrowser script and noticed a couple of things...

This can be removed from the preprocessor section...

Code: [Select]
// @feature "v1.4"
// @feature "watch-metadb"


Also...

Code: [Select]
if (!("FormatDuration" in utils))


That's in WSH Panel Mod v1.6.3 so you need to use something only available in JScript Panel...

Code: [Select]
if (!("ShowAutoPlaylistUI" in plman))
  • Last Edit: 11 November, 2015, 05:51:03 AM by marc2003

  • bdport67
  • [*]
JScript Panel script discussion/help
Reply #3
question concerning art viewer

is there a way to show a jpg in a top level folder that does not have media in it?
Kinda like a placeholder say for a band name folder when there are album directories below

currently if I have more than 1 folder in a band directory it defaults to the first found art in the first found folder
even if I have art in the "band" folder(but no media)

  • marc2003
  • [*][*][*][*][*]
  • Developer
JScript Panel script discussion/help
Reply #4
File>Preferences>Display>Album art

Code: [Select]
..\image.jpg



  • bdport67
  • [*]
JScript Panel script discussion/help
Reply #5
File>Preferences>Display>Album art

Code: [Select]
..\image.jpg

hmm?
doesnt seem to work or Im not understanding

  • marc2003
  • [*][*][*][*][*]
  • Developer
JScript Panel script discussion/help
Reply #6
the ..\ tells it to look in the parent folder. also, what image gets displayed depends on the order it appears in the list. if you put it before the pattern that gets the art from the same folder as the music then it will always override when it exists. if it goes after then it won't be displayed when there is art present in the same folder.

  • bdport67
  • [*]
JScript Panel script discussion/help
Reply #7
the ..\ tells it to look in the parent folder. also, what image gets displayed depends on the order it appears in the list. if you put it before the pattern that gets the art from the same folder as the music then it will always override when it exists. if it goes after then it won't be displayed when there is art present in the same folder.

ok I was thinking thats what you meant
poking a bit more
see if I can find a combo that works

  • bdport67
  • [*]
JScript Panel script discussion/help
Reply #8
the ..\ tells it to look in the parent folder. also, what image gets displayed depends on the order it appears in the list. if you put it before the pattern that gets the art from the same folder as the music then it will always override when it exists. if it goes after then it won't be displayed when there is art present in the same folder.

ok I was thinking thats what you meant
poking a bit more
see if I can find a combo that works

ok so maybe its my lazyness thats catching up with me 
my default art search pattern is *.jpg(*bmp,*.png) as I don't have my cover art all name formatted(Front,cover,back etc)
(put a jpg in the folder,whatever its name and wildcard it)

does this make a difference?


  • marc2003
  • [*][*][*][*][*]
  • Developer
JScript Panel script discussion/help
Reply #9
No. foobar works its way from top to the bottom of the list and stops whenever an image is found.

  • MachineHead
  • [*][*][*][*][*]
JScript Panel script discussion/help
Reply #10
Well it works for me so try putting the bio script in a fresh panel and see if you get the same error. If you do, try browsing wsh_data\artists\WHOEVER IT WAS and deleting the bio.www.last.fm.json file.


Removing the json file doesn't help entirely. It will repeatedly crash on one artist in particular every time. (hed)PE, if selected from any library browser or filter, causes it to fold instantly. Naming issue perhaps? WSH version works flawlessly yet.

  • marc2003
  • [*][*][*][*][*]
  • Developer
JScript Panel script discussion/help
Reply #11
That artist works fine for me with JScript panel so it's not that. I think your best bet is to stick with WSH panel mod.

  • MachineHead
  • [*][*][*][*][*]
JScript Panel script discussion/help
Reply #12
Already switched back. Error spam below.

Code: [Select]
JScript Panel (Panel Receiver by marc2003): JavaScript runtime error:
Unable to get property 'length' of undefined or null reference
Line: 1262, Col: 25
<source text only available at compile time>

  • marc2003
  • [*][*][*][*][*]
  • Developer
JScript Panel script discussion/help
Reply #13
If you're going to report errors, don't use the panel receiver script because it's impossible to tell what file/line it's referring to.

  • MachineHead
  • [*][*][*][*][*]
JScript Panel script discussion/help
Reply #14
Sorry about that. In this case it triggers on LastFM Bio.

  • marc2003
  • [*][*][*][*][*]
  • Developer
JScript Panel script discussion/help
Reply #15
Yeah, you mentioned that in your original post. How else do you think I tested it?

Seeing as my previous post was too cryptic, let's just forget it. You use WSH panel mod and don't ever bother me again. 

  • MachineHead
  • [*][*][*][*][*]
JScript Panel script discussion/help
Reply #16
File: Desktop\foobar2000-5555\js_marc2003\js\text.js
Line: 261, Col: 25

  • Skibbi
  • [*][*]
JScript Panel script discussion/help
Reply #17
Dragging & dropping folders with mp3 over JScript Paned doesn't work in Windows 10. Is it a limitation of the component?
Regards.

  • marc2003
  • [*][*][*][*][*]
  • Developer
JScript Panel script discussion/help
Reply #18
Drag/dropping files on to the panel works fine. You cannot drag files out though - that is a limitation of the component.

JSplaylist is a fully working example: https://github.com/19379/jsplaylist-mod

That script has been broken the last few days as I forgot to update paths in it when I renamed a folder. It is working now though.

  • bas
  • [*]
JScript Panel script discussion/help
Reply #19
I am using HiDPI settings on Windows 10 (200%), and with the new JScript Panel the tooltips are appearing very small.
With WSH Panel Mod the tooltips used to be properly scaled.



Hopefully this can be fixed.

Thanks & regards,
bas

  • marc2003
  • [*][*][*][*][*]
  • Developer
JScript Panel script discussion/help
Reply #20
Search your script for window.CreateTooltip and then add your font name/size/style.

https://github.com/19379/foo-jscript-panel/...es.txt#L546L549

BTW, WSH panel mod didn't make tooltips bigger automatically. They must have been coded in script somewhere using on_tooltip_custom_paint which JScript Panel doesn't support. I've updated my wiki page with this info...

https://github.com/19379/foo-jscript-panel/...r-JScript-Panel

  • Last Edit: 14 November, 2015, 10:55:14 PM by marc2003

  • Case
  • [*][*][*][*][*]
  • Developer (Donating)
JScript Panel script discussion/help
Reply #21
The LastFM bio panel crashes if the download fails for any reason. When the json file is zero bytes in size this.content is null at https://github.com/19379/js-marc2003/blob/m...js/text.js#L250 and you can't access length element of null object. You can fix crashing by adding "|| !this.content" before you check the length. It might also make sense to report to console potential issues with the bio download.

  • marc2003
  • [*][*][*][*][*]
  • Developer
JScript Panel script discussion/help
Reply #22
^That would also cause the script to crash in WSH panel mod but Machinehead insists that works ok...

edit: It has now been fixed...

https://github.com/19379/js-marc2003/releases
  • Last Edit: 15 November, 2015, 04:19:49 AM by marc2003

  • bas
  • [*]
JScript Panel script discussion/help
Reply #23
Search your script for window.CreateTooltip and then add your font name/size/style.

https://github.com/19379/foo-jscript-panel/...es.txt#L546L549

BTW, WSH panel mod didn't make tooltips bigger automatically. They must have been coded in script somewhere using on_tooltip_custom_paint which JScript Panel doesn't support. I've updated my wiki page with this info...

https://github.com/19379/foo-jscript-panel/...r-JScript-Panel


Thank you for your reply. I use window.CreateTooltip("Segoe UI", 24, 0) now in order to double the font size, which is working fine.
BTW, I didn't use on_tooltip_custom_paint anywhere in my scripts. But passing the font parameters explicitly resolves my issue anyway.

Regards, bas

  • WilB
  • [*][*][*][*][*]
JScript Panel script discussion/help
Reply #24
    I've ported YouTube Track Manager to work with  JScript Panel.

    YouTube Track Manager was originally a database search  companion for the foo_youtube plug-in,  but now offers much more, including comprehensive discography, track choosers, operation  with the media library and a nowplaying display. Here is an updated summary of  the main features:

   
  • Interactive discography with similar &  related artists, for choosing tracks & albums.
  • Support for last.fm top albums, top tracks,  top similar songs & MusicBrainz releases, including singles & remixes  as well as albums & compilations.
  • Builds albums &  optionally automatically creates m-TAGS files using track lists from  MusicBrainz & last.fm.
  • Offers auto-generation  of top 50 artist tracks & top 50 similar songs.
  • Offers auto-pick  radio modes for artist, genre / top tags, similar artists & similar songs  playback, based on track popularity data from last.fm, echonest  or your library. Radio modes  are great for listening to music of a chosen style. Last.fm & echonest also  work well for music discovery. Library radio offers a new way of playing your own music.
  • Tracks can be YouTube links, exclusively  media library tracks or a mixture of both where media library tracks are  preferred, according to settings. YouTube links are advert-free & can be  audio only up to 256 kbps AAC or video.
  • Improved nowplaying  panel that can act as a cover & artist artwork viewer if no longer wish to  look at album & track lists.
  • Options > right  click menu + properties (*USER...). Double click > album manager: loads  albums/tracks. Double click > nowplaying: toggles image/text types. Middle click > nowplaying: toggles image only mode vs  image + text. yT button > toggles nowplaying vs  album manager panels.
                                For further details, see earlier posts here or  here.  Download the latest release (YouTube Track Manager v2.2) here.

The updated screenshot  shows YouTube Track Manager in the left panel with a top 50 loaded into a  playlist on the right