Skip to main content
Topic: WSH Panel Mod script discussion/help (Read 961320 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

WSH Panel Mod script discussion/help

Reply #3550
Hi guys

I'm hoping someone can help me out here.

At the moment I'm running a modded version of marc's Now Playing script but I've hit a brick wall trying to adjust the alignment of certain elements. I've done a search through this thread and haven't found anything on it.

So here's what the panel looks like so far:



Firstly, I'm trying to figure out a way to a $drawtextex string to align each row horizontally along the x axis.

Is there are way it can be added here, or am I barking up the wrong tree?

Code: [Select]
var line2 = {
    text: "",
    tf: "%title%",
    font: gdi.Font("Amble", 21, 1),
    colour: RGB(218, 132, 44),
    y: 43
}

I also want to center the weblink buttons too, which I'm guessing might be possible here:

Code: [Select]
this.buttons = {
            google: new button(im.x + im.w - 160, bar2y + 1, 28, 28, {normal: "google.png", hover: "google_h.png"}, function() { p.browser(google); }, google),

Sorry for the newbie questions but my understanding of scripting is quite basic!

WSH Panel Mod script discussion/help

Reply #3551
@wcs10, right click>Update script

@hucifer

1) that's easy. inside the on_paint function rename the 3 p.left_text functions to p.centre_text

2) replace

Code: [Select]
im.x + im.w - 160


with

Code: [Select]
im.x + Math.round((im.w - 140) / 2)


add 28 to the second button, 56 for the third and so on...

also, any chance you could upload those images? i'm useless at editing them myself and they're much nicer than the old ones i use.

WSH Panel Mod script discussion/help

Reply #3552
1) that's easy. inside the on_paint function rename the 3 p.left_text functions to p.centre_text

2) replace

Code: [Select]
im.x + im.w - 160


with

Code: [Select]
im.x + Math.round((im.w - 140) / 2)


add 28 to the second button, 56 for the third and so on...


That did the trick. Thanks very much!

Quote
also, any chance you could upload those images? i'm useless at editing them myself and they're much nicer than the old ones i use.


Sure, no worries  Download


WSH Panel Mod script discussion/help

Reply #3553
Sure, no worries  Download


Thanks! They look lovely on dark background as well. Though, last.fm are hard to see, both on hover and not on. Per any chance have some others for it in same style, just brighter?


WSH Panel Mod script discussion/help

Reply #3554
Sure, no worries  Download


Thanks! They look lovely on dark background as well. Though, last.fm are hard to see, both on hover and not on. Per any chance have some others for it in same style, just brighter?




I don't but it's fairly easy to do.

Just open the coloured "hot" pngs with Photoshop / GIMP / other image editing program etc, desaturate them and then set their opacity to something like 90%. Save as .png (not jpeg!) and you're done.

WSH Panel Mod script discussion/help

Reply #3555
Thanks again! Had to apply some lightning to that process, and now looks pretty awesome for my needs.

WSH Panel Mod script discussion/help

Reply #3556
Hi,

Thanks very much marc for everything you've put together here - your scripts are amazing.

I've just tried to follow your customisation tutorial (because otherwise this code is utterly opaque to me) and was going OK until the button-adding section. You say that the buttons should be visible but non-functional, but at that point you've not mentioned adding "b.draw(gr);" in the "function on_paint(gr)" section. The additional code (about adding the bio) makes that clear - but it could be clearer in the guide.

Cheers!

WSH Panel Mod script discussion/help

Reply #3557
^thanks for spotting that. i'll update it tomorrow. i can't do it now because the computer/internet connection i'm using right now is unbelievably restricted meaning i can barely do anything. i can't even open notepad. it's a miracle i can even post here as most message boards are blocked!

@hucifer, thanks for uploading the images. i'll grab them tomorrow when i have some better internet access.

WSH Panel Mod script discussion/help

Reply #3558
Thank's for your geat job, marc

My folder marc2003 look like this, it's not a problem ? I have older scripts because i don't want update for example "now playing", but i don't now if it's a problem or not


 

WSH Panel Mod script discussion/help

Reply #3559
Here's another alternate biography script using theaudiodb.com.

Current stats.
21,899 Artist biographies.
+ various Language Translations.



Code: [Select]
// ==PREPROCESSOR==
// @name "Biography Text theaudiodb.com"
// @author "zeremy"
// @import "%fb2k_profile_path%marc2003\common8.js"
// @feature "v1.4"
// @feature "watch-metadb"
// ==/PREPROCESSOR==
var p = new panel("Biographies theaudiodb.com", ["metadb", "remap", "custom_menu"]);
var t = new text("bio", 6, 30, p.w - 12, p.h - 30);

var source = window.GetProperty("download_source", "theaudiodb.com");
var lang = window.GetProperty("language", "EN");
var a_lang = "";

var folder = fb.ProfilePath + "wsh_theaudiodb\\";
folder.create();

var artist_folder = folder + t.artist.validate() + "\\";
artist_folder.create();

on_item_focus_change();

function on_size()
{
p.size();
t.w = p.w - 12;
t.h = p.h - 30;
t.size();
p.menu_btn.x = p.w - p.menu_btn.w;
}

function on_paint(gr)
{

p.draw_background(gr);
p.left_text(gr, t.artist, p.title_font, p.textcolour_hl, 6, 6, p.w - 12, 24);
gr.DrawLine(6, 29, p.w - 6, 29, 1, p.textcolour_hl);
t.draw(gr);
p.menu_btn.draw(gr);
gr.DrawLine(6, 50, p.w - 6, 50, 1, p.textcolour_hl);
p.left_text(gr, t.a_lang, p.normal_font, p.textcolour, 6, 26, p.w - 12, 24);
p.right_text(gr, "[theaudiodb.com] " + lang, p.normal_font, p.textcolour, 6, 6, p.w - 12, 24);

}

function on_playback_stop()
{
// t.artist = "";
t.a_lang = "";
// t.text = "";
t.update();
window.Repaint();
}

function on_metadb_changed()
{
if (!p.metadb)
return;
p.artist = p.eval(p.artist_tf);
if (t.artist == p.artist)
return;
t.artist = p.artist;
t.text = "";

var artist_folder = folder + t.artist.validate() + "\\";
artist_folder.create();

t.filename = artist_folder + source + "." + lang + ".txt";
if (t.filename.is_file())
{
t.text = p.open(t.filename);

}
else
{
get();

}
    get_a_lang();
t.update();
window.Repaint();
}

function on_mouse_wheel(step)
{
t.wheel(step);
}

function on_mouse_move(x, y)
{
p.move(x, y);
t.move(x, y);
}

function on_mouse_lbtn_up(x, y)
{
if (p.menu_btn.lbtn_up(x, y))
return;
t.lbtn_up(x, y);
}

function get()
{
if (t.artist == "" || t.artist == "?")
return;

var artist_folder = folder + t.artist.validate() + "\\";
artist_folder.create();

t.filename = artist_folder + source + ".json";
var fn = t.filename;
var url = ("http://www.theaudiodb.com/api/v1/json/1/search.php?s=" + encodeURIComponent(t.artist));
t.xmlhttp.open("GET", url, true);
t.xmlhttp.send();
t.xmlhttp.onreadystatechange = function ()
{
if (t.xmlhttp.readyState == 4)
{
if (t.xmlhttp.status == 200)
{
var text = t.xmlhttp.responsetext;
t.text = text;
}
else
{
p.console("HTTP error: " + t.xmlhttp.status);
t.text = "This artist does not have a biography";
}

p.save(t.text, fn);

if (t.filename.is_file())
{
t.text = p.open(t.filename);

try
{
t.filename = artist_folder + source;
data = t.text;
json_data = JSON.parse(data);
json_data = json_data.artists;
items = json_data.length;

//EN
for (i = 0; i < items; i++)
{
fn_en = t.filename + "." + "EN" + ".txt"
response = json_data[i].strBiographyEN;

if (response == null)
{}

else
{
p.save(response, fn_en);
}
}

//DE
for (i = 0; i < items; i++)
{
fn_de = t.filename + "." + "DE" + ".txt"
response = json_data[i].strBiographyDE;

if (response == null)
{}

else
{
p.save(response, fn_de);
}
}

//FR
for (i = 0; i < items; i++)
{
fn_fr = t.filename + "." + "FR" + ".txt"
response = json_data[i].strBiographyFR;

if (response == null)
{}

else
{
p.save(response, fn_fr);
}
}

//CN
for (i = 0; i < items; i++)
{
fn_cn = t.filename + "." + "CN" + ".txt"
response = json_data[i].strBiographyCN;

if (response == null)
{}

else
{
p.save(response, fn_cn);
}
}

//IT
for (i = 0; i < items; i++)
{
fn_it = t.filename + "." + "IT" + ".txt"
response = json_data[i].strBiographyIT;

if (response == null)
{}

else
{
p.save(response, fn_it);
}
}

//JP
for (i = 0; i < items; i++)
{
fn_jp = t.filename + "." + "JP" + ".txt"
response = json_data[i].strBiographyJP;

if (response == null)
{}

else
{
p.save(response, fn_jp);
}
}

//RU
for (i = 0; i < items; i++)
{
fn_ru = t.filename + "." + "RU" + ".txt"
response = json_data[i].strBiographyRU;

if (response == null)
{}

else
{
p.save(response, fn_ru);
}
}

//ES
for (i = 0; i < items; i++)
{
fn_es = t.filename + "." + "ES" + ".txt"
response = json_data[i].strBiographyES;

if (response == null)
{}

else
{
p.save(response, fn_es);
}
}

//PT
for (i = 0; i < items; i++)
{
fn_pt = t.filename + "." + "PT" + ".txt"
response = json_data[i].strBiographyPT;

if (response == null)
{}

else
{
p.save(response, fn_pt);
}
}

//SE
for (i = 0; i < items; i++)
{
fn_se = t.filename + "." + "SE" + ".txt"
response = json_data[i].strBiographySE;

if (response == null)
{}

else
{
p.save(response, fn_se);
}
}

//NL
for (i = 0; i < items; i++)
{
fn_nl = t.filename + "." + "NL" + ".txt"
response = json_data[i].strBiographyNL;

if (response == null)
{}

else
{
p.save(response, fn_nl);
}
}

//HU
for (i = 0; i < items; i++)
{
fn_hu = t.filename + "." + "HU" + ".txt"
response = json_data[i].strBiographyHU;

if (response == null)
{}

else
{
p.save(response, fn_hu);
}
}

//NO
for (i = 0; i < items; i++)
{
fn_no = t.filename + "." + "NO" + ".txt"
response = json_data[i].strBiographyNO;

if (response == null)
{}

else
{
p.save(response, fn_no);
}
}

//IL
for (i = 0; i < items; i++)
{
fn_il = t.filename + "." + "IL" + ".txt"
response = json_data[i].strBiographyIL;

if (response == null)
{}

else
{
p.save(response, fn_il);
}
}

//PL
for (i = 0; i < items; i++)
{
fn_pl = t.filename + "." + "PL" + ".txt"
response = json_data[i].strBiographyPL;

if (response == null)
{}

else
{
p.save(response, fn_pl);
}
}

get_a_lang();
t.update();
}
catch (err)
{}

}

t.artist = "";
on_item_focus_change();

}
}

}

function get_a_lang()
{

var artist_folder = folder + t.artist.validate() + "\\";
var a_lang = [];

//EN - 4
lang_filename = artist_folder + source + "." + "EN" + ".txt";
if (lang_filename.is_file())
{
a_lang.push("EN");
}
//DE - 5
lang_filename = artist_folder + source + "." + "DE" + ".txt";
if (lang_filename.is_file())
{
a_lang.push("DE");
}
//FR - 6
lang_filename = artist_folder + source + "." + "FR" + ".txt";
if (lang_filename.is_file())
{
a_lang.push("FR");
}
//CN - 7
lang_filename = artist_folder + source + "." + "CN" + ".txt";
if (lang_filename.is_file())
{
a_lang.push("CN");
}
//IT - 8
lang_filename = artist_folder + source + "." + "IT" + ".txt";
if (lang_filename.is_file())
{
a_lang.push("IT");
}
//JP - 9
lang_filename = artist_folder + source + "." + "JP" + ".txt";
if (lang_filename.is_file())
{
a_lang.push("JP");
}
//RU - 10
lang_filename = artist_folder + source + "." + "RU" + ".txt";
if (lang_filename.is_file())
{
a_lang.push("RU");
}
//ES - 11
lang_filename = artist_folder + source + "." + "ES" + ".txt";
if (lang_filename.is_file())
{
a_lang.push("ES");
}
//PT - 12
lang_filename = artist_folder + source + "." + "PT" + ".txt";
if (lang_filename.is_file())
{
a_lang.push("PT");
}
//SE - 13
lang_filename = artist_folder + source + "." + "SE" + ".txt";
if (lang_filename.is_file())
{
a_lang.push("SE");
}
//NL - 14
lang_filename = artist_folder + source + "." + "NL" + ".txt";
if (lang_filename.is_file())
{
a_lang.push("NL");
}
//HU - 15
lang_filename = artist_folder + source + "." + "HU" + ".txt";
if (lang_filename.is_file())
{
a_lang.push("HU");
}
//NO - 16
lang_filename = artist_folder + source + "." + "NO" + ".txt";
if (lang_filename.is_file())
{
a_lang.push("NO");
}
//IL - 17
lang_filename = artist_folder + source + "." + "IL" + ".txt";
if (lang_filename.is_file())
{
a_lang.push("IL");
}
//PL - 18
lang_filename = artist_folder + source + "." + "PL" + ".txt";
if (lang_filename.is_file())
{
a_lang.push("PL");
}

t.a_lang = "LNG : " + a_lang;
}

p.menu = function ()
{

var _menu = window.CreatePopupMenu();

_menu.AppendMenuItem(p.metadb ? MF_STRING : MF_GRAYED, 1, "Refresh (Download)");
_menu.AppendMenuItem(p.metadb ? MF_STRING : MF_GRAYED, 2, "Refresh (Avaliable Languages)");
_menu.AppendMenuSeparator();

_menu.AppendMenuItem(MF_STRING, 4, "EN");
_menu.AppendMenuItem(MF_STRING, 5, "DE");
_menu.AppendMenuItem(MF_STRING, 6, "FR");
_menu.AppendMenuItem(MF_STRING, 7, "CN");
_menu.AppendMenuItem(MF_STRING, 8, "IT");
_menu.AppendMenuItem(MF_STRING, 9, "JP");
_menu.AppendMenuItem(MF_STRING, 10, "RU");
_menu.AppendMenuItem(MF_STRING, 11, "ES");
_menu.AppendMenuItem(MF_STRING, 12, "PT");
_menu.AppendMenuItem(MF_STRING, 13, "SE");
_menu.AppendMenuItem(MF_STRING, 14, "NL");
_menu.AppendMenuItem(MF_STRING, 15, "HU");
_menu.AppendMenuItem(MF_STRING, 16, "NO");
_menu.AppendMenuItem(MF_STRING, 17, "IL");
_menu.AppendMenuItem(MF_STRING, 18, "PL");
_menu.CheckMenuRadioItem(4, 18, lang == "EN" ? 4 : lang == "DE" ? 5 : lang == "FR" ? 6 : lang == "CN" ? 7 : lang == "IT" ? 8 : lang == "JP" ? 9 : lang == "RU" ? 10 : lang == "ES" ? 11 : lang == "PT" ? 12 : lang == "SE" ? 13 : lang == "NL" ? 14 : lang == "HU" ? 15 : lang == "NO" ? 16 : lang == "IL" ? 17 : 18);

var idx = _menu.TrackPopupMenu(p.menu_btn.x, p.menu_btn.y);
switch (idx)
{
case 1:

if (p.metadb)
{
get();
}
break;
case 2:

if (p.metadb)
{
get_a_lang();
t.update();
window.Repaint();
}
break;
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
lang = idx == 4 ? "EN" : idx == 5 ? "DE" : idx == 6 ? "FR" : idx == 7 ? "CN" : idx == 8 ? "IT" : idx == 9 ? "JP" : idx == 10 ? "RU" : idx == 11 ? "ES" : idx == 12 ? "PT" : idx == 13 ? "SE" : idx == 14 ? "NL" : idx == 15 ? "HU" : idx == 16 ? "NO" : idx == 17 ? "IL" : "PL";
p.console("Language Changed To: " + lang);
window.SetProperty("language", lang);
var artist_folder = folder + t.artist.validate() + "\\";
get_a_lang();
t.filename = artist_folder + source + "." + lang + ".txt";
if (t.filename.is_file())
{
t.text = p.open(t.filename);

}
else
{
t.text = "No Biography Found";
}

t.update();
window.Repaint();

}

_menu.Dispose();

}

WSH Panel Mod script discussion/help

Reply #3560
My folder marc2003 look like this, it's not a problem ? I have older scripts because i don't want update for example "now playing", but i don't now if it's a problem or not


no, it shouldn't be a problem. that's why i rename files when there are major changes so all scripts should work side by side. i'd try and get rid what is using common6 though - that is seriously old. but i suppose if it's not using anything online then it'll be fine.

you can save a whopping 8kb by deleting that file named art. that has been obsolete for quite some time now.

WSH Panel Mod script discussion/help

Reply #3561
Here's another alternate biography script using theaudiodb.com.


you've made that massively more complicated than it needs to be. i'll give you some tips on monday when i have access to a pc that i can run foobar on.

WSH Panel Mod script discussion/help

Reply #3562
Thanks for the greatest scripts.

I'd like to know if there is any method to change the vertical list of "Similar Artists" into the horizontal list of them.

According the default  'last.fm similar artists' script by marc2003, it's something liek this.

Quote
Peter Gabriel: similar artists
------------------------------------------------------------------------
Genesis
Steve Hackett
Tony Banks
Marillion
:
:


What I want is like this
Quote
Genesis, Steve Hackett, Tony Banks

Without "Head Title" & Horizontal bar,
Only similar artists no more than "3" or "4".

It would be very nice if someone could give me some hints.


WSH Panel Mod script discussion/help

Reply #3563
displaying them like that is easy enough but keeping them clickable would be a bit more more work.

for just the display, right click the panel>configure. replace the entire on_paint function with this.

Code: [Select]
function on_paint(gr) {
    p.draw_background(gr);
    var arr = li.names.splice(1, 5);
    p.left_text(gr, arr.join(", "), p.list_font, p.textcolour, 5, 0, p.w  - 10, p.row_height);
}

WSH Panel Mod script discussion/help

Reply #3564
Here's another alternate biography script using theaudiodb.com.


you've made that massively more complicated than it needs to be. i'll give you some tips on monday when i have access to a pc that i can run foobar on.


I would appreciate your advise to simplify it , when you have the time.

WSH Panel Mod script discussion/help

Reply #3565
I would appreciate your advise to simplify it , when you have the time.


sorry i haven't posted anything but i don't have proper access to a computer at the moment. although i'm on the internet now, i can't run foobar because the pc is a thin client running windows embedded with no access to hard drive space or even usb devices. also, the internet is heavily restricted meaning i can't even access my dropbox and most other file/image hosting sites. i could theoretically edit your code in a browser window but i can't test it. i might give it a go later if i get bored.




WSH Panel Mod script discussion/help

Reply #3566
displaying them like that is easy enough but keeping them clickable would be a bit more more work.

for just the display, right click the panel>configure. replace the entire on_paint function with this.

Code: [Select]
function on_paint(gr) {
    p.draw_background(gr);
    var arr = li.names.splice(1, 5);
    p.left_text(gr, arr.join(", "), p.list_font, p.textcolour, 5, 0, p.w  - 10, p.row_height);
}


It worked like a cham.
Thanks for your kind help from the author.

It would be very nice if you may spend your valuable time for making "the horizontal similar artists" clickable.
As you guess, the clickable function is very critical for us to enjoy much more music from the various artists which we didn't know.

WSH Panel Mod script discussion/help

Reply #3567
@zeremy, i've been able to modify/test your script at my local library. here it is....

https://dl.dropboxusercontent.com/u/2280132...temp/zeremy.txt

i've put in a few comments and you might want to change the on_paint function because i just used my default so it doesn't show the language like yours did.

@widerock, i'll let you know if i think of something for clickable links.

WSH Panel Mod script discussion/help

Reply #3568
@zeremy, i've been able to modify/test your script at my local library. here it is....

https://dl.dropboxusercontent.com/u/2280132...temp/zeremy.txt

i've put in a few comments and you might want to change the on_paint function because i just used my default so it doesn't show the language like yours did.

@widerock, i'll let you know if i think of something for clickable links.


I try download, but

Quote
Unable to complete secure transaction

You tried to access the address https://dl.dropboxusercontent.com/u/2280132...temp/zeremy.txt, which is currently unavailable. Please make sure that the web address (URL) is correctly spelled and punctuated, then try reloading the page.

Secure connection: fatal error (49) from server.

https://dl.dropboxusercontent.com/u/2280132...temp/zeremy.txt

The certificate is valid, but permission denied.
Make sure your internet connection is active and check whether other applications that rely on the same connection are working.
Check that the setup of any internet security software is correct and does not interfere with ordinary web browsing.
If you are behind a firewall on a Local Area Network and think this may be causing problems, talk to your systems administrator.



WSH Panel Mod script discussion/help

Reply #3569
perhaps it was just a temporary error? did you try again? maybe you should check your system time to make sure it's correct (this is required when fetching files over https). also, try clearing your browser cache or another browser if you have one installed. or you could just modify the url in your address bar to use http instead.

WSH Panel Mod script discussion/help

Reply #3570
@zeremy, i've been able to modify/test your script at my local library. here it is....

https://dl.dropboxusercontent.com/u/2280132...temp/zeremy.txt

i've put in a few comments and you might want to change the on_paint function because i just used my default so it doesn't show the language like yours did.

Thanks for taking the time to share your knowledge.
Learning something new , everyday....

Works like a charm , just made a few fixes.

Here's my final script , with current selected language in title , available downloaded languages on a second row and a fix in the get() function not to download
when json returns {artists: null}.

Code: [Select]
// ==PREPROCESSOR==
// @name "Biography Text theaudiodb.com"
// @author "zeremy"
// @import "%fb2k_profile_path%marc2003\common8.js"
// @feature "v1.4"
// @feature "watch-metadb"
// ==/PREPROCESSOR==
var p = new panel("Biographies theaudiodb.com", ["metadb", "remap", "custom_menu"]);
var t = new text("custom", 6, 30, p.w - 12, p.h - 30);

var adb_langs = ["EN", "DE", "FR", "CN", "IT", "JP", "RU", "ES", "PT", "SE", "NL", "HU", "NO", "IL", "PL"];
var adb_lang = window.GetProperty("adb_lang", 0);

var folder = fb.ProfilePath + "wsh_theaudiodb\\";
folder.create();

text2 = "";

on_item_focus_change();

function on_size() {
    p.size();
    t.w = p.w - 12;
    t.h = p.h - 30;
    t.size();
    p.menu_btn.x = p.w - p.menu_btn.w;
}

function on_paint(gr) {
    p.draw_background(gr);
    p.left_text(gr, t.artist + ": theaudiodb.com" + "[" + adb_langs[adb_lang] + "]", p.title_font, p.textcolour_hl, 6, 6, p.w - 12, 24);
    gr.DrawLine(5, 29, p.w - 5, 29, 1, p.textcolour_hl & 0x45ffffff);
    p.left_text(gr, "Available Languages: " + t.text2, p.normal_font, p.textcolour_hl, 6, 26, p.w - 12, 24);
    t.draw(gr);
    p.menu_btn.draw(gr);
}

function on_metadb_changed() {
    if (!p.metadb) return;
    p.artist = p.eval(p.artist_tf);
    if (t.artist == p.artist) return;
    t.artist = p.artist;
    t.text = "";
    text2 = [];
    t.text2 = "";
    var artist_folder = folder + t.artist.validate() + "\\";
    artist_folder.create();
    t.filename = artist_folder + "audiodb.json";

    if (t.filename.is_file()) {
        var data = p.json_parse(p.open(t.filename), "artists");
        if (data.length > 0) {
            bio = data[0];
            t.text = bio["strBiography" + adb_langs[adb_lang]] || "";
        }

        if (data.length > 0) {
            for (var f = 0; f < adb_langs.length; f++) {
                if (bio["strBiography" + adb_langs[f]] == null) {} else {
                    text2.push(adb_langs[f]);
                }
            }
        }

        t.text2 = text2;

        if (t.filename.expired(ONE_DAY)) get();
        } else {
        get();
        }
       
    t.update();
    window.Repaint();
}

function on_mouse_wheel(step) {
    t.wheel(step);
}

function on_mouse_move(x, y) {
    p.move(x, y);
    t.move(x, y);
}

function on_mouse_lbtn_up(x, y) {
    if (p.menu_btn.lbtn_up(x, y)) return;
    t.lbtn_up(x, y);
}

function get() {
    if (t.artist == "" || t.artist == "?") return;
    var fn = t.filename;
    var url = ("http://www.theaudiodb.com/api/v1/json/1/search.php?s=" + encodeURIComponent(t.artist));
    t.xmlhttp.open("GET", url, true);
    t.xmlhttp.send();
    t.xmlhttp.onreadystatechange = function() {
        if (t.xmlhttp.readyState == 4) {
            if (t.xmlhttp.status == 200) {
                var data = p.json_parse(t.xmlhttp.responsetext, "artists");
                if (data == null){
                    //error {"artists":null}
                    }
                else
                {
                p.save(t.xmlhttp.responsetext, fn);
                }
                t.artist = "";
                p.item_focus_change();
            } else {
                //error
            }
        }
    }

}

p.menu = function() {
    var _menu = window.CreatePopupMenu();
    _menu.AppendMenuItem(p.metadb ? MF_STRING : MF_GRAYED, 1, "Refresh (Download)");
    for (var i = 0; i < adb_langs.length; i++) {
        _menu.AppendMenuItem(MF_STRING, i + 2, adb_langs[i]);
    }
    _menu.CheckMenuRadioItem(2, 16, adb_lang + 2);
    var idx = _menu.TrackPopupMenu(p.menu_btn.x + p.menu_btn.w, p.menu_btn.y, TPM_RIGHTALIGN);
    switch (idx) {
        case 0:
            break;
        case 1:
            get();
            break;
        default:
            adb_lang = idx - 2;
            window.SetProperty("adb_lang", adb_lang);
            t.artist = "";
            p.item_focus_change();
            break;
    }
    _menu.Dispose();
}

WSH Panel Mod script discussion/help

Reply #3571
perhaps it was just a temporary error? did you try again? maybe you should check your system time to make sure it's correct (this is required when fetching files over https). also, try clearing your browser cache or another browser if you have one installed. or you could just modify the url in your address bar to use http instead.


Try again - I can't download.
I think it is not because of sanctions against Russia.
I cant't download samles8.zip also from site http://marc2003.x10host.com/setup.
In the old year, everything was fine.
I used to raze browsers - the result is the same.


WSH Panel Mod script discussion/help

Reply #3572
I cant't download samles8.zip also from site http://marc2003.x10host.com/setup.


samples8 isn't hosted on that site. the link on that page points towards my dropbox account which is the same place where you're having problems with zeremy's file. perhaps it's dropbox who are blocking russia?? i'll think about mirroring the files on my webspace tomorrow - i can't do it now.

WSH Panel Mod script discussion/help

Reply #3573
marc2003

I download zeremy.txt now.
Thanks!

WSH Panel Mod script discussion/help

Reply #3574
theophile has stopped developing wsh panel mod for years but his work still alive ... surprising....
and now someone has started a new project - a v8 engine panel, maybe it'll be funny.
A rose will bloom, it then will fade.

 
SimplePortal 1.0.0 RC1 © 2008-2020