coverPreview.js
Go to the documentation of this file.
1 
2 const DROP_TARGET_IMAGE = "chrome://songbird/skin/album-art/drop-target.png";
3 const XLINK = "http://www.w3.org/1999/xlink";
4 
6 
10 function onLoad () {
11  if (window.arguments.length > 0 &&
12  window.arguments[0]) {
13  var coverPreviewImage = document.getElementById("coverPreviewImage");
14  coverPreviewImage.setAttributeNS(XLINK, "href", window.arguments[0]);
15  } else {
16  var imageObserver = {
17  observe: function(aSubject, aTopic, aData) {
18  var coverPreviewImage = document.getElementById("coverPreviewImage");
19  if (!aData) { aData = DROP_TARGET_IMAGE; }
20  coverPreviewImage.setAttributeNS(XLINK, "href", aData);
21  }
22  }
23  // Setup the dataremote for the now playing image.
24  var createDataRemote = new Components.Constructor(
25  "@songbirdnest.com/Songbird/DataRemote;1",
26  Components.interfaces.sbIDataRemote,
27  "init");
28  metadataImage = createDataRemote("metadata.imageURL", null);
29  metadataImage.bindObserver(imageObserver, false);
30  }
31 }
32 
36 function onUnload () {
37  if (metadataImage) {
38  metadataImage.unbind();
39  }
40 }
var metadataImage
Definition: coverPreview.js:5
let window
const DROP_TARGET_IMAGE
Definition: coverPreview.js:2
var createDataRemote
return null
Definition: FeedWriter.js:1143
const XLINK
Definition: coverPreview.js:3
function onLoad()
onLoad - called when the cover preview window loads.
Definition: coverPreview.js:10
function onUnload()
onUnload - called when the cover preview window unloads.
Definition: coverPreview.js:36
_updateTextAndScrollDataForFrame aData
sbDeviceFirmwareAutoCheckForUpdate prototype observe