Skip to main content

Topic: JScript Panel (Read 49292 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • marc2003
  • [*][*][*][*][*]
  • Developer
Re: JScript Panel
Reply #225
I dug around in my old files git history and found a copy which may fix your issue...

https://gist.githubusercontent.com/19379/a6f823ad7e0ba3177746e343caddf24a/raw/62cd2c843bc78236fe99ea677c3d4ed8768c5469/list.js

Try replacing list.js inside the js_marc2003\js folder. Make a backup of the old file first just in case.

  • arhipov_rp
  • [*]
Re: JScript Panel
Reply #226
There is problem with JS Smooth Browser (downloaded from here https://github.com/19379/JS-Smooth-Scripts-By-Br3tt) and JScript Panel v1.2. Genre list in Smooth Browser is not the same as Album list. Can this be fixed?

  • marc2003
  • [*][*][*][*][*]
  • Developer
Re: JScript Panel
Reply #227
Is it definitely set in Library mode and not playlist? I don't know much else about it as I don't use day to day but it seemed to list all genres when I tested it just now.

edit: I see it doesn't appear to support multi-value tags. You'll have to ask @Falstaff about that.

http://br3tt.deviantart.com/art/JS-Smooth-Browser-571376160
  • Last Edit: 02 February, 2017, 08:56:51 PM by marc2003

  • marc2003
  • [*][*][*][*][*]
  • Developer
Re: JScript Panel
Reply #228
This component is now live on the official component repository. There have been no changes since the last release but future updates will be available via the built-in update mechanism.

http://www.foobar2000.org/components/view/foo_jscript_panel

  • juniiflow
  • [*][*]
Re: JScript Panel
Reply #229
js_br3tt\jssp\js\JScommon.js
Line: 540, Col: 8
    }; else {

How to fix?

  • marc2003
  • [*][*][*][*][*]
  • Developer
Re: JScript Panel
Reply #230
Replace all files and update scripts in panels with this...

https://github.com/19379/JS-Smooth-Scripts-By-Br3tt

  • TheQwertiest
  • [*][*]
Re: JScript Panel
Reply #231
This component is now live on the official component repository. There have been no changes since the last release but future updates will be available via the built-in update mechanism.

http://www.foobar2000.org/components/view/foo_jscript_panel
Congratulations! It was long due =)

  • Coreda
  • [*][*][*][*]
Re: JScript Panel
Reply #232
Just noticed the JSPlaylist mod is no longer at marc2003's Github repo. Any reason for this? It's a port of panel I'm constantly recommending to others.

Noticed this as I had a question about how to force group sorting, since I found it doesn't appear to auto apply the group sorting settings but manually requires it to be applied each time. I'd only just discovered this as most of my library is naturally sorted via filenames but some recent directories have filenames whose naming differs from the track number order and I discovered the panel sorted them by the filename order instead.
  • Last Edit: 19 February, 2017, 02:27:42 AM by Coreda

  • marc2003
  • [*][*][*][*][*]
  • Developer
Re: JScript Panel
Reply #233
JSplaylist is now bundled with the component itself.

https://github.com/19379/foo-jscript-panel/tree/master/component/samples

  • Coreda
  • [*][*][*][*]
Re: JScript Panel
Reply #234
JSplaylist is now bundled with the component itself.

https://github.com/19379/foo-jscript-panel/tree/master/component/samples

Ah, good to know.

With regard to force sorting in the panel, any ideas? I find I have to right-click the columns header>Groups>Apply group sorting to override the filename sorting and apply track number order, but the option doesn't seem to be able to be permanently set.


  • marc2003
  • [*][*][*][*][*]
  • Developer
Re: JScript Panel
Reply #235
It's never been a playlist viewer's job to sort or "force" sort. How a playlist is originally sorted depends entirely on how the files were added in the first place. If you're adding from the File menu or drag/dropping from explorer, check the setting under File>Preferences>Shell Integration>Sort incoming files by. If you're using Album list, the playlist items are always sorted the same way they are displayed. Other 3rd party library viewers may have their own sorting preferences.

This has never been something any other playlist viewer has dealt with so I'm unsure why you're questioning it now.

  • Coreda
  • [*][*][*][*]
Re: JScript Panel
Reply #236
How a playlist is originally sorted depends entirely on how the files were added in the first place. If you're adding from the File menu or drag/dropping from explorer, check the setting under File>Preferences>Shell Integration>Sort incoming files by. If you're using Album list, the playlist items are always sorted the same way they are displayed. Other 3rd party library viewers may have their own sorting preferences.

Turned out to be the Facets component sort order. Apologies for the mix-up. Was due to having previously always formatted the collection using filenames that naturally sort, and seeing how carefully I customized the JSPlaylist panel title formatting wondered why it wasn't following the order there. Had I noticed it in a default playlist panel I probably would have realized the source of the issue sooner. Thanks.

  • wcs13
  • [*][*][*]
Re: JScript Panel
Reply #237
So, abour JScript Smooth Playlist Manager, here's a feature request : folders.
And by this I mean a way to hierarchically group playlists in a tree view. Virtual folders containing playlists.
Example : Folder name = "New Year's Party" and then 3 sub-playlists : "Ambient", "Slow & Sexy", "Fast & Furious".
You get the idea.
Thanks.

  • colagen
  • [*]
Re: JScript Panel
Reply #238
Hi,

I wondered : can't we find a generous developper who would be willing to add the ability to drag a list of tracks outside a Jscript panel ? It's clearly the big missing feature of this component. I've got no idea of the time it would take to code it, i tried to take a look myself, i saw that the initial developper began this task (there is a bunch of lines related to that in some files), but i'm completely not able to finish the work myself, so i gave up.

  • widerock
  • [*][*][*]
Re: JScript Panel
Reply #239
I'd like to know if there is any method to import different 'js file' according to "if" condition.

What I want to to is that one specific panel show differnet JScript after getting notified with "function on_notify_data(name, info)"
The below is something what I'd like to do.
Code: [Select]
function on_notify_data(name, info) {
    switch(name) {
        case "chk_yt":
            if(info == "youtube") {
                 here I'd like to import "biography.js"
            } else {
                here I'd like to import "playlist view.js"
            }
       }
}
I'm not sure if this kind of thing is possle or not. Any comment or tip would be appreciated.

  • marc2003
  • [*][*][*][*][*]
  • Developer
Re: JScript Panel
Reply #240
Yes, I've done this before - with a little help from foosion...

Code: [Select]
// ==PREPROCESSOR==
// @author "marc2003 / foosion"
// @name "Panel Receiver"
// ==/PREPROCESSOR==

var script = window.GetProperty("current_script", "path\\to\\biography.js");
var pre = "";
var text = utils.ReadTextFile(fb.ProfilePath + script);
var lines = text.split("\n");
if (lines[0].indexOf("// ==PREPROCESSOR==") == 0) {
for (var i = 0; i < lines.length; i++) {
if (lines[i].indexOf("// @import") == 0) {
var fq = lines[i].indexOf("\"") + 1;
var lq = lines[i].lastIndexOf("\"") - fq;
var file = lines[i].substr(fq, lq).replace("%fb2k_profile_path%", fb.ProfilePath).replace("%fb2k_component_path%", fb.ComponentPath);
pre += utils.ReadTextFile(file) + "\n";
} else if (lines[i].indexOf("// ==/PREPROCESSOR==") == 0) {
break;
}
}
}
eval(pre + text);
(function (global) {
var original_callback = global.on_notify_data;
global.on_notify_data = function (name, info) {
if (name == "load_script") {
if (utils.FileTest(fb.ProfilePath + info, "e")) {
window.SetProperty("current_script", info);
window.Reload();
}
} else if (original_callback) {
original_callback(name, info);
}
}
})(this);

The only thing you should edit is the default script it loads on the first line...

Code: [Select]
"path\\to\\biography.js"

It must be in subfolder of your profile path.

Then in your other panel...

Code: [Select]
window.NotifyOthers("load_script", "path\\to\\biography.js");
or
Code: [Select]
window.NotifyOthers("load_script", "path\\to\\playlist view.js");

Again these must be relative in your profile folder.
  • Last Edit: 21 March, 2017, 03:32:26 AM by marc2003

  • widerock
  • [*][*][*]
Re: JScript Panel
Reply #241
Yes, I've done this before - with a little help from foosion...
Thank you very much, marc2003 & foosion.
I've succeeded in setting up my foobar as I wanted.
I have one more question.
Could you let me know how to check if 'the current playlist name' includes a specific string such as "Library"?
  • Last Edit: 21 March, 2017, 05:42:14 AM by widerock

  • marc2003
  • [*][*][*][*][*]
  • Developer
Re: JScript Panel
Reply #242
Code: [Select]
var playlist_name = plman.GetPlaylistName(plman.ActivePlaylist);
if (playlist_name.toLowerCase().indexOf("library") > -1) {
    //do something
}

  • widerock
  • [*][*][*]
Re: JScript Panel
Reply #243
Thank you, marc2003. That is exactly what I wanted.

  • marc2003
  • [*][*][*][*][*]
  • Developer
Re: JScript Panel
Reply #244
edit: WINE setup instructions removed. They can now be found here:

https://github.com/19379/foo-jscript-panel/wiki/WINE



  • Last Edit: 31 July, 2017, 07:08:25 AM by marc2003

  • randomuser
  • [*]
Re: JScript Panel
Reply #245
Hi guys! I was previously ranting in ColumnsUI subforum, hope you don't mind seeing me here too :)
Problem was net radio stream not showing artist/title correctly, not sure is it exactly CUI, PSS, ELP or something else.
Then I used Falstaff's JScript playlist and there it was
Code: [Select]
fb.TitleFormat("%title%").Eval(true)
Tested that in old WSH panel, shows exactly what it should show (title).
Maybe someone could give a hint, why or how this script version works differently compared to usual titleformat %title%?
  • Last Edit: 01 April, 2017, 06:51:15 PM by randomuser

  • marc2003
  • [*][*][*][*][*]
  • Developer
Re: JScript Panel
Reply #246
I could give a technical answer explaining the difference but what's the point? You have a problem with some other component you can't even identify so nothing I say is going to help.

  • randomuser
  • [*]
Re: JScript Panel
Reply #247
Ok, fair enough.

  • marc2003
  • [*][*][*][*][*]
  • Developer
Re: JScript Panel
Reply #248
Since the Last.fm Charts API is working again, I've decided to restore the sample along with Musicbrainz...

Code: [Select]
v1.2.0.1
- CHG: Minor code cleanups but no new component features for now.
- ADD: Add Last.fm Similar Artists / Charts & Musicbrainz samples.

https://github.com/19379/foo-jscript-panel/releases

It's also on the official component repository here: http://www.foobar2000.org/components/view/foo_jscript_panel
If you have a previous version installed, you can update from the Help menu>Check for updated components.
  • Last Edit: 24 April, 2017, 05:51:20 AM by marc2003

  • TheQwertiest
  • [*][*]
Re: JScript Panel
Reply #249
Since the Last.fm Charts API is working again, I've decided to restore the sample along with Musicbrainz...

Code: [Select]
v1.2.0.1
- CHG: Minor code cleanups but no new component features for now.
- ADD: Add Last.fm Similar Artists / Charts & Musicbrainz samples.
Nice! Finally I can retire the old script folder (/js_marc2003) and use the one in the component!

PS: Since my PM was blocked, I'll try asking here: you've included your lastfm API key in the script - was it intentional?