Класс!
А из tmp_Biography можно научить подхватывать?
(опционно)
Список разделов › foobar2000 › Секреты foobar2000
function fnCopyHereJ()
{
var objShell = new ActiveXObject("Shell.Application");
var objFolder = new Object;
var source = fb.TitleFormat("%path%").EvalWithMetadb(fb.GetFocusItem());
objFolder = objShell.NameSpace("D:\\test");
if (objFolder != null){
objFolder.CopyHere(source,1024);
} else {
objFolder = objShell.NameSpace("D:\\");
objFolder.NewFolder("test")
objFolder.CopyHere(source,1024);
}
}
count = plman.GetPlaylistSelectedItems(plman.ActivePlaylist).Count;
objFolder = objShell.NameSpace("D:\\test");
if (objFolder != null){
for (var i = 0; i < count; i++) {
item = plman.GetPlaylistSelectedItems(plman.ActivePlaylist).Item(i);
source = fb.Titleformat("%path%").EvalWithMetadb(item);
objFolder.CopyHere(source,1024);
}
} else{
objFolder = objShell.NameSpace("D:\\");
objFolder.NewFolder("test")
}
try{
fso.DeleteFolder(set_path + "*.*");
};
seriousstas:но нужно убить их все в подпапках artists
var path = fb.ProfilePath + "\\wsh_data\\artists\\";
var dir = fso.GetFolder(path);
var e = new Enumerator( dir.SubFolders );
for(; !e.atEnd(); e.moveNext() ) {
del_from_SubFolders(e.item());
}
function del_from_SubFolders(d) {
var e = new Enumerator(d.Files);
while ( !e.atEnd() ) {
var name = e.item().Name;
if (name.match(/(jpg|jpeg|gif|png)$/i)) {
try {
fso.deleteFile( e.item().Path );
} catch(e) {};
}
e.moveNext();
}
}
window.SetTimeout(function () {
window.Reload();
}, 4250);
Иначе удаляемые файлы не успеваю стеретьсяА для чего задержка
Из проблем, которые я сам надыбал - в моей версии Вашей панели Биографии сделано так, что при отсутствии инфы она схлопывается до 17пикселей - только имя исполнителя. И на время поиска так и работает, но если ничего не найдено - то где-то появляется многоточие " . . . " и это воспринимается как инфа и немного увеличивается размер пустой (только . . .) панели, т.к. высота у меня адаптивна к тексту. Это ". . ." идет не с инета, т.к. появляется и в отсутствии оного. Как бы его удавить? Еще - во второй части этого скрипта - показ картинок у меня постоянно в цикле, но показ не начинается пока уже после заполнения папки тмп био таймер не отработает 12 сек, и только тогда начинается показ первой картинки серии. Как исключить задержку в 12 сек после того, как папка заполнена?No_mad:Если найдете косяки
var if_not_found = new Array(". . .", ". . .");
if (text == "") text = if_not_found[abc];
Тут я немного не понял. Что за 12 секунд. Вроде такого условия я не предусматривал.No_mad:Как исключить задержку в 12
Время цикла (если выбрано) сохраняется в Properties. После закрытия и открытия Фубара значение сохраняется. Т.е. если установлено время, то будет "крутить всегда".No_mad:Можно ли по другому жестко задать время автоцикла и чтобы он крутил всегда
// ==PREPROCESSOR==
// @name "Biography Text && Picture. www.last.fm"
// @author "kgena_ua"
// @version "23022016"
// @feature "v1.4"
// @feature "watch-metadb"
// ==/PREPROCESSOR==
function RGB(r,g,b) { return (0xff000000|(r<<16)|(g<<8)|(b)); }
function RGBA(r,g,b,a) { return ((a << 24) | (r << 16) | (g << 8) | (b)); }
function getRed(color) {return ((color >> 16) & 0xff);};
function getGreen(color) {return ((color >> 8) & 0xff);};
function getBlue(color) {return (color & 0xff);};
var a_font = gdi.Font("Arial",12, 1);
var b_font = gdi.Font("Arial",12, 0);
var ww,wh;
var on_mouse = false;
DT_LEFT = 0x00000000;
DT_RIGHT = 0x00000002;
DT_CENTER = 0x00000001;
DT_VCENTER = 0x00000004;
DT_SINGLELINE = 0x00000020;
DT_WORD_ELLIPSIS = 0x00040000;
DT_WORDBREAK = 0x00000010;
DT_CALCRECT = 0x00000400;
DT_NOPREFIX = 0x00000800;
var bgcolor = RGB(31,41,48);
var a_color = RGB(220,220,220);
var b_color = RGB(255,255,230);
var transparent = 200;
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
var doc = new ActiveXObject("htmlfile");
var fso = new ActiveXObject("Scripting.FileSystemObject");
var WshShell = new ActiveXObject("WScript.Shell");
var script_path = fb.ProfilePath + "\\tmp_Biography\\download\\";
var vbs = "cscript //nologo \"" + script_path + "download.vbs\"";
var tmp_b_path = fb.ProfilePath + "\\tmp_Biography\\";
if(!fso.FolderExists(tmp_b_path)) {fso.CreateFolder(tmp_b_path)};
if(!fso.FolderExists(tmp_b_path + "\\download\\")) {fso.CreateFolder(tmp_b_path + "\\download\\")};
if(!fso.FileExists(tmp_b_path + "\\download\\" + "download.vbs")) {create_download_file()};
var nocover_path = fb.ProfilePath + "nocover.png";
var nocover = window.GetProperty("nocover image", false);
var last_fm_logo;
load_last_fm_logo();
var artist, old_artis;
var g_img = null;
var p_margn = 10;
var files = [], selected = 0;
var limit = window.GetProperty("download limit",5);
var cycle = window.GetProperty("auto cycle (sec)", 0);
var txt_x = window.GetProperty("txt_x", window.Width / 2);
var txt_y = window.GetProperty("txt_y", window.Height / 2);
var delta_x, delta_y;
var k_down = false;
var text_scroll = false;
var pic_scroll = false;
var scrollbar = window.GetProperty("scrollbar", false);
var sb_down = false;
var sb_scroll = false;
var scrollbar_k;
var posy = 0;
var t_margin = 10;
var artist_x, artist_y;
var b_x = 0, b_y = 0;
var text = "";
var s_text = 0;
var string_width;
var strings_array = [];
var b_text_rows = 0;
var b_text_row_height = 0;
var b_text_visable_rows = 0;
var b_text_visable_height = 0;
var b_text_array = [];
var abc_lang = new Array("", "ru/");
var abc = window.GetProperty("abc", 0);
var if_not_found = new Array(". . .", ". . .");
var select_p_a = window.GetProperty("pictures/albums", 0);
var select_p_a_old;
var p_a = new Array("images", "albums");
var selection_mode = window.GetProperty("selection mode", 0);
var metadb;
on_item_focus_change();
function on_paint(gr){
!window.IsTransparent && gr.FillSolidRect(0, 0, ww, wh, bgcolor);
paint(gr);
if(set_cycle){
gr.FillSolidRect(0, 0, ww, wh, RGBA(getRed(bgcolor),getGreen(bgcolor),getBlue(bgcolor),transparent));
var txt_cycle = cycle == 0 ? "off" : cycle + " sec";
set_cycle && gr.GdiDrawText("auto cycle \n" + txt_cycle, b_font, b_color, 15, 15, ww, wh, DT_LEFT | DT_WORD_ELLIPSIS );
} else{
gr.FillSolidRect(txt_x, txt_y, ww - txt_x, wh - txt_y, RGBA(getRed(bgcolor),getGreen(bgcolor),getBlue(bgcolor),transparent));
}
//gr.GdiDrawText(artist, a_font, RGB(0,0,0), artist_x + 1, artist_y + 2, ww - artist_x, wh, DT_LEFT | DT_WORD_ELLIPSIS );
gr.GdiDrawText(artist, a_font, a_color, artist_x, artist_y, ww - artist_x, wh, DT_LEFT | DT_WORD_ELLIPSIS );
for (var i = 0; i < b_text_visable_rows; i++) {
//gr.GdiDrawText(b_text_array[i + s_text], b_font, RGB(0,0,0), b_x + 1, b_y + b_text_row_height * i + 2, ww, wh, DT_LEFT );
gr.GdiDrawText(b_text_array[i + s_text], b_font, b_color, b_x, b_y + b_text_row_height * i, ww, wh, DT_LEFT );
}
scrollbar && draw_scrollbar(gr);
gr.GdiDrawText("", b_font, b_color, 15, 0, ww, wh, DT_LEFT | DT_WORD_ELLIPSIS );
}
function paint(gr){
g_img = gdi.Image(files[selected]);
if (!g_img && nocover){
try {
g_img = gdi.Image(nocover_path);
} catch(e) {};
}
if (g_img){
var scale_w = (ww - p_margn * 2) / g_img.Width;
var scale_h = (wh - p_margn * 2) / g_img.Height;
var scale = Math.min(scale_w, scale_h);
g_img = g_img.CreateRawBitmap();
gr.GdiDrawBitmap(g_img, p_margn, p_margn, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height);
}
logo_img = gdi.Image(tmp_b_path + "\\download\\" + "last_fm_logo.jpg");
if (logo_img && files.length == 0 && !nocover){
gr.DrawImage(logo_img, p_margn, p_margn, logo_img.Width * 0.8, logo_img.Height * 0.8, 0, 0, logo_img.Width, logo_img.Height, 0, 255);
}
}
function draw_scrollbar(gr){
scrollbar_h = b_text_rows > b_text_visable_rows ? b_text_visable_height * (b_text_visable_rows / b_text_rows) : 0;
scrollbar_y = s_text > 0 ? s_text * scrollbar_k : 0;
gr.FillSolidRect(ww - 4, b_y + scrollbar_y, 2, scrollbar_h, b_color);
}
function on_playlist_switch() {
on_item_focus_change();
}
function on_playback_new_track() {
on_item_focus_change();
}
//function on_playback_dynamic_info_track() {
// on_item_focus_change();
//}
function on_playback_stop() {
on_item_focus_change();
}
function on_selection_changed(metadb) {
on_item_focus_change();
}
function on_item_focus_change() {
switch (selection_mode) {
case 0:
metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
break;
case 1:
metadb = fb.GetFocusItem();
break;
}
if (metadb) on_metadb_changed();
}
function Eval(field) {
if (!metadb) return;
path = fb.Titleformat("%path%").EvalWithMetadb(metadb);
//return path.indexOf('://') > 0 ? fb.TitleFormat("[" + field + "]").Eval() : fb.TitleFormat("[" + field + "]").EvalWithMetadb(metadb);
return fb.Titleformat("[" + field + "]").EvalWithMetadb(metadb) ? fb.TitleFormat("[" + field + "]").EvalWithMetadb(metadb) : fb.TitleFormat("[" + field + "]").Eval(true);
}
function on_metadb_changed() {
if (!metadb) return;
artist = Eval("%artist%");
if (artist != old_artis || select_p_a != select_p_a_old){
CollectGarbage();
g_img = null;
files = [];
del_files_from_dir();
selected = 0;
s_text = 0;
text = "";
get_b_text_array()
get_pic();
old_artis = artist;
select_p_a_old = select_p_a;
}
}
function get_pic(){
var url1 = ("http://www.last.fm/music/" + encodeURIComponent(artist) + "/+" + p_a[select_p_a]);
xmlhttp.open("GET", url1, true);
xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
xmlhttp.send();
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
doc.open();
var div = doc.createElement("div");
div.innerHTML = xmlhttp.responsetext;
var data = div.getElementsByTagName("img");
var urls = [];
for (i = 0; i < data.length; i++) {
if (data[i].className == "image-list-image"){
if (data[i].src.indexOf("http://img2-ak.lst.fm/i/u/avatar170s") == 0) urls.push(data[i].src.replace("avatar170s", ""));
}
if (data[i].className == "album-grid-album-art"){
if (data[i].src.indexOf("http://img2-ak.lst.fm/i/u/300") == 0 && data[i].src.indexOf("c6f59c1e5e7240a4c0d427abd71f3dbb") < 0) urls.push(data[i].src.replace("300", ""));
}
}
for (i = 0; i < Math.min(urls.length, limit); i++) {
file = "\"" + tmp_b_path + artist + "_" + i + "_" +p_a[select_p_a] + ".jpg" + "\"";
WshShell.Run(vbs + " " + urls[i] + " " + file, false);
}
doc.close();
}
get_b_text();
}
}
}
function get_files_from_dir() {
files = [];
var e = new Enumerator( fso.GetFolder(tmp_b_path).Files );
while ( !e.atEnd() ) {
var name = e.item().Name;
if (name.indexOf(artist) == 0){
files.push(tmp_b_path + name);
}
e.moveNext();
}
}
/*function get_files_from_dir() {
files = [];
files = utils.Glob(tmp_b_path + artist + "*.*").toArray();
}
*/
function get_b_text(){
var url2 = ("http://www.last.fm/" + abc_lang[abc] + "music/" + encodeURIComponent(artist) + "/+wiki");
xmlhttp.open("GET", url2, true);
xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
xmlhttp.send();
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
doc.open();
var div = doc.createElement("div");
div.innerHTML = xmlhttp.responsetext;
var data = div.getElementsByTagName("div");
for (i = 0; i < data.length; i++) {
if (data[i].className == "wiki-content") {
text = strip_tags(data[i].innerHTML);
break;
}
}
doc.close();
}
if (text == "") text = if_not_found[abc];
get_b_text_array();
}
}
}
function strip_tags(t) {
doc.open();
var div = doc.createElement("div");
div.innerHTML = t.replace(/<[Pp][^>]*>/g, "").replace(/<\/[Pp]>/g, "<br>").replace(/\n/g, "<br>");
var text = div.innerText;
doc.close();
return text;
}
function get_b_text_array() {
artist_x = txt_x + t_margin;
artist_y = txt_y + t_margin;
strings_array = [];
b_text_array = [];
temp_bmp = gdi.CreateImage(1, 1);
temp_gr = temp_bmp.GetGraphics();
b_x = txt_x + t_margin;
b_y = txt_y + temp_gr.CalcTextHeight("text", a_font) + t_margin * 2;
b_text_row_height = temp_gr.CalcTextHeight("text", b_font)
string_width = Math.max(ww - b_x - 10, 0);
if (text) strings_array = temp_gr.EstimateLineWrap(text, b_font, string_width).toArray();
for (var i = 0; i < strings_array.length; i += 2) {
b_text_array.push(strings_array[i].replace(/^\s+|\s+$/g, ""));
}
b_text_rows = b_text_array.length;
b_text_visable_rows = Math.round((wh - b_y - 10) / b_text_row_height);
b_text_visable_height = Math.round(wh - b_y - 10);
// b_text_height = b_text_array.length * b_text_row_height;
temp_bmp.ReleaseGraphics(temp_gr);
temp_bmp.Dispose();
temp_gr = null;
temp_bmp = null;
if (b_text_visable_rows + s_text > b_text_rows && s_text > 0) {
s_text = b_text_rows - b_text_visable_rows;
};
scrollbar_k = b_text_visable_height / b_text_rows;
window.Repaint();
}
function on_mouse_rbtn_up (x, y){
var _menu = window.CreatePopupMenu();
var i = 1;
MF_ENABLED = 0x00000000;
MF_GRAYED = 0x00000001;
MF_SEPARATOR = 0x00000800;
_menu.AppendMenuItem(MF_ENABLED, i++, "EN text");
_menu.AppendMenuItem(MF_ENABLED, i++, "RU text");
_menu.CheckMenuRadioItem(1, i, abc + 1);
_menu.EnableMenuItem(abc + 1, 1);
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_ENABLED, i++, "Prefer now playing");
_menu.AppendMenuItem(MF_ENABLED, i++, "Follow selected track");
_menu.CheckMenuRadioItem(i - 2, i , selection_mode + 3);
_menu.EnableMenuItem(selection_mode + 3, 1);
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_ENABLED, i++, "Artist pictures");
_menu.AppendMenuItem(MF_ENABLED, i++, "Albums pictures");
_menu.CheckMenuRadioItem(i - 2, i , select_p_a + 5);
_menu.EnableMenuItem(select_p_a + 5, 1);
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
var is_artist = artist ? MF_ENABLED : MF_GRAYED;
_menu.AppendMenuItem(is_artist, i++, "last.fm Artist");
// if (ShiftDown) {
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_ENABLED, 10, "Reload");
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_ENABLED, 20, "Properties");
_menu.AppendMenuItem(MF_ENABLED, 30, "Configure ...");
// }
ret = _menu.TrackPopupMenu(x,y);
switch (ret) {
case 1:
abc = 0;
window.SetProperty("abc", abc);
s_text = 0;
text = "";
get_b_text();
break;
case 2:
abc = 1;
window.SetProperty("abc", abc);
s_text = 0;
text = "";
get_b_text();
break;
case 3:
selection_mode = 0;
window.SetProperty("selection_mode", selection_mode);
on_item_focus_change();
break;
case 4:
selection_mode = 1;
window.SetProperty("selection_mode", selection_mode);
on_item_focus_change();
break;
case 5:
select_p_a = 0;
window.SetProperty("pictures/albums", select_p_a);
on_metadb_changed();
break;
case 6:
select_p_a = 1;
window.SetProperty("pictures/albums", select_p_a);
on_metadb_changed();
break;
case 7:
WshShell.run("http://www.last.fm/music/" + encodeURIComponent(artist));
break;
case 10:
window.Reload();
break;
case 20:
window.ShowProperties();
break;
case 30:
window.ShowConfigure();
break;
}
_menu.Dispose();
return true;
}
var timer = window.SetInterval(on_timer, 1000);
var step = 0;
var set_cycle = false;
var dis_timer, dis = 0;
function on_timer(id) {
step = set_cycle || cycle == 0 ? 0 : step + 1;
if (files.length == 0) {get_files_from_dir(); window.Repaint();};
if (cycle > 0 && step >= cycle){
selected = selected >= files.length - 1 ? 0 : selected = selected + 1;
window.Repaint();
step = 0;
}
}
function on_key_down(vkey) {
if (vkey == 16){
set_cycle = true;
dis_set();
window.Repaint();
}
}
function dis_set(){
dis = 0;
dis_timer && window.ClearInterval(dis_timer);
dis_timer = window.SetInterval(function() {
if (set_cycle) {
dis++;
if(dis == 1) {
set_cycle = false;
window.ClearInterval(dis_timer);
window.Repaint();
};
}
}, 1000 );
}
var delay = false;
function fdelay(){
var delay_timer = window.SetTimeout(function() {
delay = false;
window.ClearTimeout(delay_timer);
}, 200);
}
function del_files_from_dir() {
var del_files = [];
var e = new Enumerator( fso.GetFolder(tmp_b_path).Files );
while ( !e.atEnd() ) {
var name = e.item().Name;
try {
fso.deleteFile(tmp_b_path + name );
} catch(e) {};
e.moveNext();
}
}
/*
function del_files_from_dir() {
del_files = [];
del_files = utils.Glob(tmp_b_path + "*.*").toArray();
for (i in del_files) {
try {
fso.deleteFile(del_files[i]);
} catch(e) {};
}
}
*/
function load_last_fm_logo(){
if(!fso.FileExists(tmp_b_path + "\\download\\" + "last_fm_logo.jpg")) {
var url = "http://www.last.fm/static/images/logo_beta.png?eb6d3ca20e73"
var file = "\"" + tmp_b_path + "\\download\\" + "last_fm_logo.jpg" + "\"";
WshShell.Run(vbs + " " + url + " " + file, false);
var url = "http://static-web.last.fm/static/images/favicon.702b239b6194.ico"
var file = "\"" + tmp_b_path + "\\download\\" + "last_fm_ico.ico" + "\"";
WshShell.Run(vbs + " " + url + " " + file, false);
}
}
function create_download_file() {
try {
file = fso.CreateTextFile(tmp_b_path + "\\download\\" + "download.vbs" )
var text =
"If (WScript.Arguments.Count <> 2) Then" + "\n\r" +
" WScript.Quit" + "\n\r" +
"End If" + "\n\r" + "\n\r" +
"url = WScript.Arguments(0)" + "\n\r" +
"file = WScript.Arguments(1)" + "\n\r" + "\n\r" +
"Set objFSO = Createobject(" + '"Scripting.FileSystemObject"' + ")" + "\n\r" +
"If objFSO.Fileexists(file) Then" + "\n\r" +
" Set objFSO = Nothing" + "\n\r" +
" WScript.Quit" + "\n\r" +
"End If" + "\n\r" + "\n\r" +
"Set objXMLHTTP = CreateObject(" + '"MSXML2.XMLHTTP"' + ")" + "\n\r" +
"objXMLHTTP.open " + '"GET"' + ", url,false" + "\n\r" +
"objXMLHTTP.send()" + "\n\r" + "\n\r" +
"If objXMLHTTP.Status = 200 Then" + "\n\r" +
" Set objADOStream = CreateObject(" + '"ADODB.Stream"' + ")" + "\n\r" +
" objADOStream.Open" + "\n\r" +
" objADOStream.Type = 1" + "\n\r" +
" objADOStream.Write objXMLHTTP.ResponseBody" + "\n\r" +
" objADOStream.Position = 0" + "\n\r" +
" objADOStream.SaveToFile file" + "\n\r" +
" objADOStream.Close" + "\n\r" +
" Set objADOStream = Nothing" + "\n\r" +
"End If" + "\n\r" + "\n\r" +
"Set objFSO = Nothing" + "\n\r" +
"Set objXMLHTTP = Nothing"
;
file.WriteLine(text);
file.Close();
} catch(e) {};
}
function on_mouse_move(x, y) {
window.SetCursor(32649);
if (k_down){
txt_x = x - delta_x ;
txt_y = y - delta_y;
txt_x = txt_x <= 0 ? 0 : txt_x >= ww - 50 ? ww - 50: txt_x;
txt_y = txt_y <= 0 ? 0 : txt_y >= wh - 50 ? wh - 50: txt_y;
//if (b_text_visable_rows + s_text > b_text_rows && s_text > 0){ s_text -= 1};
get_b_text_array();
}
text_scroll = x >= txt_x && x < ww - 20 && y >= txt_y ? true : false;
sb_scroll = x > ww - 20 && y >= txt_y ? true : false;
pic_scroll = !text_scroll && !sb_scroll ? true : false;
if (sb_down && scrollbar){
posy = y + delta_y;
s_text = y + delta_y >= 0 ? y + delta_y <= (b_text_rows - b_text_visable_rows) * scrollbar_k ? Math.round(posy / scrollbar_k) : b_text_rows - b_text_visable_rows : 0;
window.Repaint();
}
}
function on_mouse_wheel(delta) {
ShiftDown = utils.IsKeyPressed(0x10) ? true : false;
if (!delay && pic_scroll && !ShiftDown){
delay = true;
fdelay();
get_files_from_dir();
if (delta < 0) {selected = selected <= 0 ? files.length - 1 : selected = selected - 1};
if (delta > 0) {selected = selected >= files.length - 1 ? 0 : selected = selected + 1};
}
if (text_scroll && !ShiftDown){
if (b_text_rows > b_text_visable_rows){
if (delta < 0) {s_text = b_text_rows - s_text <= b_text_visable_rows ? b_text_rows - b_text_visable_rows : s_text += 1}
if (delta > 0) {s_text = s_text <= 0 ? 0 : s_text -= 1}
}
}
if (set_cycle) {
if (delta < 0) {cycle = cycle <= 0 ? 0 : cycle - 5;};
if (delta > 0) {cycle = cycle >= 60 ? 60 : cycle + 5;};
window.SetProperty("auto cycle (sec)", cycle);
}
window.Repaint();
}
function on_mouse_lbtn_down(x,y){
if (text_scroll){
k_down = true;
delta_x = x - txt_x;
delta_y = y - txt_y;
}
if (sb_scroll){
sb_down = true;
posy = s_text * scrollbar_k;
delta_y = posy - y;
}
}
function on_mouse_lbtn_up(x,y){
window.SetProperty("txt_x", txt_x);
window.SetProperty("txt_y", txt_y);
k_down = false;
sb_down = false;
}
function on_mouse_lbtn_dblclk (x,y){
if (text_scroll){
abc = abc == 1 ? 0 : 1;
window.SetProperty("abc", abc);
s_text = 0;
b_text_array = [];
text = "";
get_b_text();
}
if (files[selected] && pic_scroll) WshShell.run( '"' + files[selected] + '"' );
}
function on_mouse_leave() {
window.SetCursor(32512);
window.Repaint();
}
function on_size(){
ww = window.Width;
wh = window.Height;
txt_x = window.GetProperty("txt_x");
txt_y = window.GetProperty("txt_y");
txt_x = txt_x >= ww - 50 && txt_x >= 0 ? ww - 50 : txt_x;
txt_y = txt_y >= wh - 50 && txt_y >= 0 ? wh - 50 : txt_y;
// if (b_text_visable_rows + s_text > b_text_rows && s_text > 0) {s_text -= 1};
get_b_text_array();
}
вова_сбрат:в заголовке выводит название активного (звучащего) плейлиста....
Как в WSH выглядят эти строки?
plist_name = plman.GetPlaylistName(plman.ActivePlaylist);
Наверное не получится.вова_сбрат:выводить в Status bar (DUI)
case 7:
WshShell.run("http://www.last.fm/" + abc_lang[abc] + "music/" + encodeURIComponent(artist));
Ух ты! Скролла действительно не хватало на больших текстах, спасибо.kgena_ua:добавлен scrollbar
Вернуться в Секреты foobar2000