26 if (typeof(
Cc) ==
"undefined")
27 window.Cc = Components.classes;
28 if (typeof(
Ci) ==
"undefined")
29 window.Ci = Components.interfaces;
30 if (typeof(
Cu) ==
"undefined")
31 window.Cu = Components.utils;
32 if (typeof(
Cr) ==
"undefined")
33 window.Cr = Components.results;
36 Cu.import(
"resource://app/jsmodules/sbProperties.jsm");
37 Cu.import(
"resource://app/jsmodules/sbLibraryUtils.jsm");
38 Cu.import(
"resource://app/jsmodules/kPlaylistCommands.jsm");
65 return this._mediaListView;
74 set mediaListView(
value) {
76 if (!this._mediaListView) {
77 this._mediaListView =
value;
79 throw new Error(
"mediaListView may only be set once. Please reload the page");
87 get isOnlyView()
false,
96 if (!this._mediaListView) {
97 Components.utils.reportError(
"playlistPage.xul did not receive " +
98 "a mediaListView before the onload event!");
102 var servicePaneNode =
103 Cc[
"@songbirdnest.com/servicepane/library;1"]
104 .getService(
Ci.sbILibraryServicePaneService)
105 .getNodeFromMediaListView(this._mediaListView);
106 if (servicePaneNode) {
107 document.title = servicePaneNode.displayName;
111 document.title = this._mediaListView.mediaList.name;
114 this._playlist = document.getElementById(
"playlist");
117 this._clearFilterLists();
122 Components.classes[
"@songbirdnest.com/Songbird/PlaylistCommandsManager;1"]
123 .createInstance(Components.interfaces.sbIPlaylistCommandsManager);
124 var cmds = mgr.request(kPlaylistCommands.MEDIAITEM_DEFAULT);
127 this._playlist.bind(this._mediaListView, cmds);
135 if (this._playlist) {
136 this._playlist.destroy();
137 this._playlist =
null;
146 highlightItem:
function(aIndex) {
147 this._playlist.highlightItem(aIndex);
154 canDrop:
function(aEvent, aSession) {
155 return this._playlist._canDrop(aEvent);
162 onDrop:
function(aEvent, aSession) {
163 return this._playlist.
165 Ci.sbIMediaListViewTreeViewObserver.DROP_AFTER,
175 _parseQueryString:
function() {
176 var queryString = (location.search ||
"?").substr(1).split(
"&");
177 var queryObject = {};
179 for each (var pair
in queryString) {
181 queryObject[
key] = unescape(value);
190 _clearFilterLists:
function() {
192 var filters = this._mediaListView.cascadeFilterSet;
194 for (var
i = filters.length - 1;
i > 0;
i--) {
197 if (filters.length == 0 || !filters.isSearch(0)) {
198 if (filters.length == 1) {
201 filters.appendSearch([
"*"], 1);
function onUnload()
onUnload - called when the cover preview window unloads.
_getSelectedPageStyle s i