Advertisement
Guest User

Untitled

a guest
Feb 5th, 2010
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==PREPROCESSOR==
  2. // @import "%fb2k_path%scripts\marc2003\v2\common.js"
  3. // @import "%fb2k_path%scripts\marc2003\v2\tooltip_buttons.js"
  4. // ==/PREPROCESSOR==
  5.  
  6. var bw = 32;
  7. var bh = 32;
  8. var top_margin = 0;
  9. var left_margin = 0;
  10.  
  11. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  12.  
  13. var panel_id = window.GetProperty("panel_id", window.id);
  14. var custom_background_file = settings_path + panel_id + "buttons_background";
  15. var custom_background = read(custom_background_file);
  16.  
  17. on_item_focus_change();
  18.  
  19. function on_size() {
  20.     ww = window.Width;
  21.     wh = window.Height;
  22. }
  23.  
  24. function on_metadb_changed() {
  25.     if(!g_metadb) return;
  26.     title = fb.TitleFormat("%title%").EvalWithMetadb(g_metadb)
  27.     loved = fb.TitleFormat("%love%").EvalWithMetadb(g_metadb) == 1 ? 1 : 0;
  28.     if(loved) {
  29.         func = function() { fb.RunContextCommandWithMetadb("Unlove", g_metadb); }
  30.         tooltip =  "Unlove '" + title + "'";
  31.         normal = images_path + "love_h.png";
  32.         hover = images_path + "love.png";
  33.     } else {
  34.         func = function() { fb.RunContextCommandWithMetadb("Love", g_metadb); }
  35.         tooltip = "Love '" + title + "'";
  36.         normal = images_path + "love.png";
  37.         hover = images_path + "love_h.png";
  38.     }
  39.     Buttons = {
  40.         but1: new Button(left_margin,top_margin,bw,bh, {normal: normal, hover: hover}, func, tooltip)
  41.     }
  42.     window.Repaint();
  43. }
  44.  
  45. function on_playback_new_track() {
  46.     on_item_focus_change();
  47. }
  48.  
  49. function on_mouse_rbtn_up(x, y) {
  50.     buttons_menu(x,y);
  51.     return true;
  52. }
  53.  
  54. function on_paint(gr) {
  55.     buttons_background(gr);
  56.     buttonsDraw(gr);
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement