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

Re: JScript Panel

Reply #1325
Both of the above have toggles for displaying the text to the right or to the bottom of the main image.
You can alter the ratio for image/text display by holding down Ctrl while you scroll.

Great, Bravo, Wonderful.
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD 490 PRO, DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY ULT WEAR (made a Upgrade/Balanced Cable by myself)

Re: JScript Panel

Reply #1326
3.3.21

https://github.com/jscript-panel/release/releases

https://jscript-panel.github.io/docs/changes/

last.fm bio / last.bio + images / allmusic /allmusic + album art users will need to update scripts in their panels from the samples button.

For country flag display to work, there has been a change to the required font that was used in various test versions in the script discussion thread. You should now install Twemoji Mozilla.

https://github.com/mozilla/twemoji-colr/releases/tag/v0.7.0

If you previously used Twitter Color Emoji in Text Display title formatting, it's recommended that you update and use $font(Twemoji Mozilla,16) or whatever.

edit: just to be clear, flags in bio scripts can come from file tags or pulled from last.fm. If you don't have file tags, you have to rely on the country being present in the Born In / Founded In section of the display. These sections are not always present.

Re: JScript Panel

Reply #1327
3.3.22

https://github.com/jscript-panel/release/releases

https://jscript-panel.github.io/docs/changes/

Just sample fixes really. And sorry once again but last.fm bio / last.fm + images / thumbs users will need to update again from the Samples button after installing.

I've also updated the docs site with a page on making web requests.

https://jscript-panel.github.io/docs/web-requests/


Re: JScript Panel

Reply #1329
3.3.24

https://github.com/jscript-panel/release/releases

https://jscript-panel.github.io/docs/changes/

No changes for samples users.

Just because it's Christmas, there is a breaking change in a minor release. But I figured the number of people making their own POST requests with utils.HTTPRequestAsync is somewhere around zero. Updated docs links are on the changes page.

 

Re: JScript Panel

Reply #1330
3.3.25

https://github.com/jscript-panel/release/releases

https://jscript-panel.github.io/docs/changes/

edited: I originally stated I'd fixed a bad last.fm bio bug which triggered more web requests than it should. But now I don't think it was as bad as I thought. I think my file age checks would have prevented spurious lookups. Updating is still recommended.


Re: JScript Panel

Reply #1332
hi everyone, in js-playlist, how to put back "Auto Collapse", thanks


Re: JScript Panel

Reply #1334
Thx marc2k3.


Re: JScript Panel

Reply #1336
NEED HELP ON MY SCRIPT in Panel script 3 :
it is a biography and thumb panel together . but i need to right click " reload " to make it work . the text overwhise is not showing .
if someone can help me ? thanks a lot
the script :

// ==PREPROCESSOR==
// @name "jul"
// @author "marc2003"
// @import "%fb2k_component_path%helpers.txt"
// @import "%fb2k_component_path%samples\js\lodash.min.js"
// @import "%fb2k_component_path%samples\js\common.js"
// @import "%fb2k_component_path%samples\js\panel.js"
// @import "%fb2k_component_path%samples\js\thumbs.js"
// @import "%fb2k_component_path%samples\js\rating.js"
// @import "%fb2k_component_path%samples\js\lastfm.js"
// @import "%fb2k_component_path%samples\js\albumart.js"
// @import "%fb2k_component_path%samples\js\text.js"


// ==/PREPROCESSOR==

// https://jscript-panel.github.io/gallery/thumbs/
// https://jscript-panel.github.io/gallery/lastfm-bio/
// https://jscript-panel.github.io/gallery/album-art/

var panel = new _panel({ custom_background : true });
var thumbs = new _thumbs();
//var rating = new _rating(40, 580, 16, RGB(255, 128, 0)); // x, y, height, colour
var albumart = new _albumart(40, 60, 230, 230);
var lastfm = new _lastfm();
var text = new _text('lastfm_bio', LM * 68, TM * 5 , 0, 0);
var lastfm_textlogo = utils.LoadImage(fb.ComponentPath + 'samples\\images\\Lastfm2.png');
var button_left = utils.LoadImage(fb.ComponentPath + 'samples\\images\\left.png');
var button_left_hover = utils.LoadImage(fb.ComponentPath + 'samples\\images\\left_hover.png');
var button_right = utils.LoadImage(fb.ComponentPath + 'samples\\images\\right.png');
var button_right_hover = utils.LoadImage(fb.ComponentPath + 'samples\\images\\right_hover.png');
var cover_img = null;
var cover_array = [];
var g_img = null;
var bs = _scale(22);
var ww = window.Width;
var wh = window.Height;
var init_ww = window.Width;

var tfo = {
   artist : fb.TitleFormat('%artist%'),
   lfm_loved : fb.TitleFormat('$if2(%lfm_loved%,0)'),
   title : fb.TitleFormat('%title%'),
   date : fb.TitleFormat(('%date%')),
   genre : fb.TitleFormat(('%genre%')),
   album : fb.TitleFormat(('%album%')),
   albumartist : fb.TitleFormat(('%album artist%')),
   codec : fb.TitleFormat(('%codec%')),
   copyright : fb.TitleFormat(('%encoding%')),
        label : fb.TitleFormat(('%label%')),
   play_count : fb.TitleFormat(('%play_count%')),
   totalplay : fb.TitleFormat(('%totalplayed%')),
   country : fb.TitleFormat(('%countryperformer%')),
   bitrate : fb.TitleFormat(('%bitrate%')),
   tool : fb.TitleFormat(('%tool%')),
   playback_time : fb.TitleFormat('[%playback_time%]'),
   length : fb.TitleFormat('$if2(%length%,LIVE)'),
   samplerate : fb.TitleFormat(('%samplerate%')),
};

//flags
var cfg_foobarpath = window.GetProperty("foobar path:", fb.Profilepath);
var cfg_flag = window.GetProperty("flag folder:", "flags");
var flag_file = cfg_foobarpath + cfg_flag + "\\noflag.svg";
var svg_content = utils.ReadUTF8(flag_file);
var country = fb.TitleFormat("%country%").Eval();
var flags = utils.LoadSVG(cfg_foobarpath + cfg_flag + "\\" + country + ".svg");  //utils.LoadSVG(flag_file);

panel.item_focus_change();

function on_colours_changed() {
   panel.colours_changed();
   window.Repaint();
}

function on_http_request_done(task_id, success, response_text) {
   thumbs.http_request_done(task_id, success, response_text);
}

function on_item_focus_change() {
   if (panel.selection.value == 0 && fb.IsPlaying) return;
   panel.item_focus_change();
}

function on_download_file_done(path, success, error_text) {
   text.download_file_done(path, success, error_text);
}

function on_font_changed() {
   panel.font_changed();
   window.Repaint();
}

function on_key_down(k) {
   thumbs.key_down(k);
   text.key_down(k);
}

function on_metadb_changed(handles, fromhook) {
   if (fromhook) return;
    text.metadb_changed();
}

function on_metadb_changed() {
   thumbs.metadb_changed();
   albumart.metadb_changed();
}

function on_mouse_leave() {
   //rating.leave();
}

function on_mouse_lbtn_dblclk(x, y) {
   thumbs.lbtn_dblclk(x, y);
}

function on_mouse_lbtn_up(x, y) {
   thumbs.lbtn_up(x, y);
//   rating.lbtn_up(x, y);
   text.lbtn_up(x, y);
        if(x < ww - 30 && x > ww - 55 && y > 5 && y < 30) {
           if(ww >= init_ww - 60) {
              window.MaxWidth = ww - 50;
              window.MinWidth = ww - 50;
              ww -= 50;
              window.Repaint();
           }
        }
        if( x > ww - 26 && x < ww && y > 5 && y < 30) {
            if(ww <= init_ww + 60) {
               window.MaxWidth = ww + 50;
               window.MinWidth = ww + 50;
               ww += 50;
               window.Repaint();
            }
        }
              
}

function on_mouse_move(x, y) {
   thumbs.move(x, y);
//   rating.move(x, y);
   if ( x > 350 && x < ww && y > 50 && y < wh ) {
           text.move(x, y);
        }
         // Left Over
    window.SetCursor(x > ww - 50 && x < ww - 5 && y > 5 && y < 30 ? IDC_HAND : IDC_ARROW);
         if( x > ww - 50 && x < ww - 30 && y > 5 && y < 30){
                  button_left = utils.LoadImage(fb.ComponentPath + 'samples\\images\\left_hover.png');
                  window.Repaint();
         } else {
                  button_left = utils.LoadImage(fb.ComponentPath + 'samples\\images\\left.png');
                  window.Repaint();
         }
         // Right Over
   
         if( x > ww - 27 && x < ww - 5 && y > 5 && y < 30){
                  button_right = utils.LoadImage(fb.ComponentPath + 'samples\\images\\right_hover.png');
                  window.Repaint();
         } else {
                  button_right = utils.LoadImage(fb.ComponentPath + 'samples\\images\\right.png');
                  window.Repaint();
         }
}

function on_mouse_rbtn_up(x, y) {
        if ( x > 40 && x < 320 && y > 60 && y < 340 ) {
      return panel.rbtn_up(x, y, thumbs);
        }
   if ( x > 40 && x < 250 && y > 580 && y < 620 ) {
           return panel.rbtn_up(x, y, rating); 
   }
   if ( x > 350 && x < ww && y > 50 && y < wh ) {
      return panel.rbtn_up(x, y, text);
        }
      
}

function on_mouse_wheel(s) {
   //thumbs.wheel(s);
        text.wheel(s);
}

function on_paint(gr) {
   
   panel.paint(gr);
   gr.FillRectangle( 0, 0, panel.w, panel.h, RGB(60, 60, 60));
        country = fb.TitleFormat("%country%").Eval();
        flags = utils.LoadSVG(cfg_foobarpath + cfg_flag + "\\" + country + ".svg");  //utils.LoadSVG(flag_file);
   var metadb = fb.GetFocusItem();
        // getColor(gr);
   for (var i = 0; i < cover_array.length; i++) {
      var cover_colour = cover_array[5];
   }
        if (metadb) {
      g_img = metadb.GetAlbumArt();
      g_art = metadb.GetAlbumArt();
   }

   if (fb.IsPlaying) {
      panel.colours.text = RGB(255, 255, 255);
       panel.paint(gr);
      gr.FillRectangle( 0, 0, panel.w, panel.h, RGB(30, 30, 30));
      if (g_img) {
            g_img.StackBlur(250);
         _drawImage(gr, g_img, 0, 0, panel.w , panel.h , image.crop_top, 0.5);
      }
           var small_font = CreateFontString('Segoe UI', 10);
      var normal_font = CreateFontString('Segoe UI', 12);
      var big_font = CreateFontString('Segoe UI', 20);
      var big = CreateFontString('fontawesome ', 13, true);
      var bigtitle = CreateFontString('fontawesome ', 18, true);
      var bige = CreateFontString('fontawesome ', 11, true);
      var sma = CreateFontString('fontawesome ', 8 );
      var smal = CreateFontString('fontawesome ', 10 );
      gr.DrawRectangle(40, 60, 280, 280, 1, RGB(255, 255, 255));
       gr.WriteText(tfo.title.Eval(), big, RGB( 255, 255, 255), 40, 300, 260, 125, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, DWRITE_WORD_WRAPPING_NO_WRAP, DWRITE_TRIMMING_GRANULARITY_CHARACTER);
      gr.WriteText(tfo.album.Eval(), bige, RGB( 41, 140, 245), 40, 325, 240, 125, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, DWRITE_WORD_WRAPPING_NO_WRAP, DWRITE_TRIMMING_GRANULARITY_CHARACTER);
      gr.WriteText('Conductor : ' + tfo.albumartist.Eval(), bige, RGB( 255, 255, 255), 40, 380, 240, 125, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, DWRITE_WORD_WRAPPING_NO_WRAP, DWRITE_TRIMMING_GRANULARITY_CHARACTER);
      gr.WriteText('Played ' + tfo.play_count.Eval() + ' times', smal, RGB( 255,255, 255), 40, 400, 240, 125, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, DWRITE_WORD_WRAPPING_NO_WRAP, DWRITE_TRIMMING_GRANULARITY_CHARACTER);
      gr.WriteText('Released : ' + tfo.date.Eval(), sma, RGB( 255,255, 255), 40, 420, 240, 125, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, DWRITE_WORD_WRAPPING_NO_WRAP, DWRITE_TRIMMING_GRANULARITY_CHARACTER);
      gr.WriteText(tfo.codec.Eval() + ' | ' + tfo.samplerate.Eval() + ' Hz', sma, RGB( 255,255, 255), 40, 440, 240, 125, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, DWRITE_WORD_WRAPPING_NO_WRAP, DWRITE_TRIMMING_GRANULARITY_CHARACTER);
      gr.WriteText('BITRATE : ' + tfo.bitrate.Eval() + ' Kpbs', sma, RGB( 255,255, 255), 40, 460, 240, 125, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, DWRITE_WORD_WRAPPING_NO_WRAP, DWRITE_TRIMMING_GRANULARITY_CHARACTER);
      gr.WriteText(tfo.artist.Eval(), bigtitle, RGB( 41, 140, 245), 478, 7, 800, 125, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, DWRITE_WORD_WRAPPING_NO_WRAP, DWRITE_TRIMMING_GRANULARITY_CHARACTER);
      gr.WriteText('Last.fm',small_font, RGB(255, 255, 255), 478, 2, 290, 200, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, DWRITE_WORD_WRAPPING_NO_WRAP, DWRITE_TRIMMING_GRANULARITY_CHARACTER);
      //gr.WriteText('Audioscrobbler',small_font, RGB(255, 255, 255),window.Width - 106, -84, 290, 200, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, DWRITE_WORD_WRAPPING_NO_WRAP, DWRITE_TRIMMING_GRANULARITY_CHARACTER);
      gr.WriteText(tfo.genre.Eval(), small_font, RGB( 255,255, 255), 478, 2, 290, 235, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, DWRITE_WORD_WRAPPING_NO_WRAP, DWRITE_TRIMMING_GRANULARITY_CHARACTER);
   //   rating.paint(gr);
                text.paint(gr);
           thumbs.paint(gr);
                // Button left right
                gr.DrawImage(button_left, ww - 55, 5, 27, 25, 0, 0, 27, 25);
                gr.DrawImage(button_right, ww - 30, 5, 27, 25, 0, 0, 27, 25);
                //flags
                if (flags) {
                 flags = utils.LoadSVG(cfg_foobarpath + cfg_flag + "\\" + country + ".svg");
                 gr.DrawImage(flags, svg_flag_x, svg_flag_y, 50, 26, 0, 0, 640, 480);
                }
     }
   
    
}

function on_playback_dynamic_info_track() {
   panel.item_focus_change();
        //flags
        country = fb.TitleFormat("%countryperformer%").Eval();
   flags = utils.LoadSVG(cfg_foobarpath + cfg_flag + "\\" + country + ".svg");
       
}

function on_playback_new_track() {
   panel.item_focus_change();
   thumbs.playback_new_track();
   //flags
        country = fb.TitleFormat("%countryperformer%").Eval();
   flags = utils.LoadSVG(cfg_foobarpath + cfg_flag + "\\" + country + ".svg");
       
}

function on_playback_stop(reason) {
   if (reason != 2) {
      panel.item_focus_change();
   }
}

function on_playback_time(time) {
   thumbs.playback_time();
}

function on_playlist_switch() {
   on_item_focus_change();
}

function update_album_art(metadb) {
   _dispose(g_img);
   g_img = null;
   if (metadb) {
      g_img = metadb.GetAlbumArt();
   }
   window.Repaint();
}

function on_item_focus_change() {
   //focus
   handle = fb.GetFocusItem();
   //cover colour
   if (cover_img) {
      cover_img.Dispose();
      cover_img = null;
   }
   cover_array = [];
   var metadb = fb.GetFocusItem();
   if (metadb) {
      cover_img = metadb.GetAlbumArt(); // omitting the type defaults to front

      if (cover_img) {
         cover_array = cover_img.GetColourScheme(10).toArray();
      }
   }
   window.Repaint();
}

function on_size() {
   panel.size();
   thumbs.size();
   text.w = panel.w - (LM * 70);
   text.h = panel.h - (TM * 6);
   text.size();
   //flag
   svg_flag_x = 40
   svg_flag_y = 540
}

Re: JScript Panel

Reply #1337
Could you add Custom Path option for Allmusic Review Sample? I have store my cache files for album review in eksternal HDD. Thanks in advance for your hardwork, this Jscript component makes Foobar2000 theme more friendly.

Re: JScript Panel

Reply #1338
Hi Marc, happy new year.
Problem:
Quote
JScript Panel 3.3.27 (Rating by marc2003)
Laufzeitfehler in JavaScript
Die Eigenschaft "mode" eines undefinierten oder Nullverweises kann nicht abgerufen werden.
File: C:\Users\juerg\AppData\Roaming\foobar2000-v2\user-components-x64\foo_jscript_panel3\samples\js\rating.js
Line: 7, Col: 3







Re: JScript Panel

Reply #1345
3.3.29

https://github.com/jscript-panel/release/releases

https://jscript-panel.github.io/docs/changes/

Thumbs now has a multi-line edit box in Custom folder mode making it easier to set multiple folders.
Component changes are listed on the main changelog.

Re: JScript Panel

Reply #1346
How to display the slider at the beginning of the progress bar?
Like this:
X

X


Re: JScript Panel

Reply #1347
So you want the slider to be displayed even when it's not playing?

Code: [Select]
if (fb.IsPlaying) {
   // original code here
} else {
   gr.FillEllipse(seekbar.x + _scale(3), seekbar.y + _scale(3), _scale(6), _scale(6), colours.seekbar_knob);
}