1 const Cc = Components.classes;
2 const CcID = Components.classesByID;
3 const Ci = Components.interfaces;
4 const Cr = Components.results;
5 const Cu = Components.utils;
13 if (typeof(
gMM) ==
"undefined")
14 var
gMM =
Cc[
"@songbirdnest.com/Songbird/Mediacore/Manager;1"]
15 .getService(
Ci.sbIMediacoreManager);
17 if (typeof(gBrowser) ==
"undefined")
18 var gBrowser =
Cc[
'@mozilla.org/appshell/window-mediator;1']
19 .getService(
Ci.nsIWindowMediator).getMostRecentWindow(
'Songbird:Main')
22 #ifdef METRICS_ENABLED
23 if (typeof(gMetrics) ==
"undefined")
24 var gMetrics =
Cc[
"@songbirdnest.com/Songbird/Metrics;1"]
25 .createInstance(
Ci.sbIMetrics);
28 if (typeof(SBProperties) ==
"undefined") {
29 Cu.import(
"resource://app/jsmodules/sbProperties.jsm");
31 throw new Error(
"Import of sbProperties module failed");
34 if (typeof(mtUtils) ==
"undefined")
35 Cu.import(
"resource://mashTape/mtUtils.jsm");
37 if (typeof mashTape ==
"undefined")
48 mashTape.firstRun =
function() {
49 Application.prefs.setValue(
"extensions.mashTape.firstrun",
false);
51 #ifdef METRICS_ENABLED
54 gMetrics.metricsInc(
"mashtape",
"defaultpane",
"info");
55 gMetrics.metricsInc(
"mashtape",
"autohide",
"enabled");
56 gMetrics.metricsInc(
"mashtape",
"info",
"tab.disabled");
57 gMetrics.metricsInc(
"mashtape",
"review",
"tab.disabled");
58 gMetrics.metricsInc(
"mashtape",
"rss",
"tab.disabled");
59 gMetrics.metricsInc(
"mashtape",
"photo",
"tab.disabled");
60 gMetrics.metricsInc(
"mashtape",
"flash",
"tab.disabled");
64 mashTape.log =
function(
msg) {
65 mtUtils.log(
"mashTape",
msg);
72 mashTape.init =
function(e) {
74 window.removeEventListener(
"DOMContentLoaded", mashTape.init,
false);
76 if (
Application.prefs.getValue(
"extensions.mashTape.firstrun",
false))
80 Components.manager.QueryInterface(
Ci.nsIComponentRegistrar);
82 mashTape.prevArtist =
"";
85 var
count =
Application.prefs.getValue(
"extensions.mashTape.firstRunCount",0);
88 Application.prefs.setValue(
"extensions.mashTape.firstRunCount", ++count);
90 document.getElementById(
"mashTape-deck").selectedIndex = mashTape.npDeck;
93 var displayPaneMgr =
Cc[
"@songbirdnest.com/Songbird/DisplayPane/Manager;1"]
94 .getService(
Ci.sbIDisplayPaneManager);
95 var dpInstantiator = displayPaneMgr.getInstantiatorForWindow(
window);
96 mashTape.displayPane = dpInstantiator.displayPane;
99 mashTape.strings = Components.classes[
"@mozilla.org/intl/stringbundle;1"]
100 .getService(Components.interfaces.nsIStringBundleService)
101 .createBundle(
"chrome://mashtape/locale/mashtape.properties");
104 gBrowser.addProgressListener(mashTape.locationListener,
105 Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT);
108 mashTape.mgr =
Cc[
"@songbirdnest.com/mashTape/manager;1"]
109 .getService(
Ci.sbIMashTapeManager);
112 mashTape._prefBranch =
Cc[
"@mozilla.org/preferences-service;1"]
113 .getService(
Ci.nsIPrefService).getBranch(
"extensions.mashTape.")
114 .QueryInterface(
Ci.nsIPrefBranch2);
115 mashTape._prefBranch.addObserver(
"", mashTape.prefObserver,
false);
118 mashTape.classes = [
"row-odd",
"row-even"];
121 mashTape.providers =
new Array();
122 mashTape.providers[
"info"] =
new Array();
123 mashTape.providers[
"review"] =
new Array();
124 mashTape.providers[
"rss"] =
new Array();
125 mashTape.providers[
"photo"] =
new Array();
126 mashTape.providers[
"flash"] =
new Array();
129 mashTape.enabledProviders =
new Array();
132 "extensions.mashTape.providers.all_previous",
"").split(
",");
133 var newProviders =
new Array();
135 for (var component in
Cc) {
136 if (component.indexOf(
"mashTape/provider") >= 0) {
137 var mtClass = component.substring(
138 component.indexOf(
"mashTape/provider") + 18, component.length);
139 mtClass = mtClass.substring(0, mtClass.indexOf(
"/"));
140 mashTape.providers[mtClass].push(component);
141 mashTape.log(
"Found " + mtClass +
" provider: " + component);
143 var existedPrior =
false;
144 var clsid = mashTape.compMgr.contractIDToCID(component);
145 clsid = clsid.toString();
146 newProviders.push(clsid);
147 for each (var prev
in oldProviders) {
152 mashTape.log(component +
" is new, auto-enabling");
153 mashTape.enableProvider(clsid, mtClass);
157 Application.prefs.setValue(
"extensions.mashTape.providers.all_previous",
158 newProviders.join(
","));
161 mashTape.infoTab = document.getElementById(
"mashTape-nav-tab-info");
162 mashTape.reviewTab = document.getElementById(
"mashTape-nav-tab-review");
163 mashTape.rssTab = document.getElementById(
"mashTape-nav-tab-rss");
164 mashTape.photoTab = document.getElementById(
"mashTape-nav-tab-photo");
165 mashTape.flashTab = document.getElementById(
"mashTape-nav-tab-flash");
168 var radioGroup = document.getElementById(
"mashTape-nav-radiogroup");
169 radioGroup.addEventListener(
"click", mashTape.navChange,
false);
172 var defTab =
Application.prefs.getValue(
"extensions.mashTape.defaultpane",
174 radioGroup.selectedItem = document.getElementById(
"mashTape-nav-tab-"+defTab);
175 mashTape.selectPane();
178 mashTape.autoHidden =
false;
181 mashTape.updateNav();
183 mashTape.photoFrame = document.getElementById(
"mashTape-frame-photo");
185 gMM.addListener(mashTape);
188 "@songbirdnest.com/Songbird/DataRemote;1",
"sbIDataRemote",
"init");
190 mashTape.pausedDr.bindObserver(mashTape.playingObserver,
true);
197 mashTape.setupAlreadyPlaying();
201 mashTape.navChange =
function(e) {
202 var selectedTab = e.currentTarget.selectedItem.id;
203 var newTab = selectedTab.replace(/^mashTape-nav-
tab-/,
'');
204 mashTape.selectPane(newTab);
207 mashTape.playPausePhotoListener(newTab ==
"photo");
208 mashTape.selectedTab = newTab;
214 mashTape.updateNav =
function() {
215 if (mashTape.providers[
"info"].length == 0 ||
216 !
Application.prefs.getValue(
"extensions.mashTape.info.enabled",
true))
217 mashTape.infoTab.style.visibility =
"collapse";
219 mashTape.infoTab.style.visibility =
"visible";
220 if (mashTape.providers[
"review"].length == 0 ||
221 !
Application.prefs.getValue(
"extensions.mashTape.review.enabled",
true))
222 mashTape.reviewTab.style.visibility =
"collapse";
224 mashTape.reviewTab.style.visibility =
"visible";
225 if (mashTape.providers[
"rss"].length == 0 ||
226 !
Application.prefs.getValue(
"extensions.mashTape.rss.enabled",
true))
227 mashTape.rssTab.style.visibility =
"collapse";
229 mashTape.rssTab.style.visibility =
"visible";
230 if (mashTape.providers[
"photo"].length == 0 ||
231 !
Application.prefs.getValue(
"extensions.mashTape.photo.enabled",
true))
232 mashTape.photoTab.style.visibility =
"collapse";
234 mashTape.photoTab.style.visibility =
"visible";
235 if (mashTape.providers[
"flash"].length == 0 ||
236 !
Application.prefs.getValue(
"extensions.mashTape.flash.enabled",
true))
237 mashTape.flashTab.style.visibility =
"collapse";
239 mashTape.flashTab.style.visibility =
"visible";
244 mashTape.selectPane =
function(pane) {
245 var contentDeck = document.getElementById(
"mashTape-content-deck");
247 pane =
Application.prefs.getValue(
"extensions.mashTape.defaultpane",
"info");
250 document.getElementById(
"mashTape-nav-radiogroup").selectedItem =
251 document.getElementById(
"mashTape-nav-tab-" + pane);
255 if (mashTape.infoTab.style.visibility !=
"collapse") {
256 contentDeck.selectedIndex = 0;
260 if (mashTape.reviewTab.style.visibility !=
"collapse") {
261 contentDeck.selectedIndex = 1;
265 if (mashTape.rssTab.style.visibility !=
"collapse") {
266 contentDeck.selectedIndex = 2;
270 if (mashTape.photoTab.style.visibility !=
"collapse") {
271 contentDeck.selectedIndex = 3;
275 if (mashTape.flashTab.style.visibility !=
"collapse") {
276 contentDeck.selectedIndex = 4;
284 mashTape.unload =
function() {
286 window.removeEventListener(
"unload", mashTape.unload,
false);
289 gBrowser.removeProgressListener(mashTape.locationListener);
290 mashTape._prefBranch.removeObserver(
"", mashTape.prefObserver);
291 gMM.removeListener(mashTape);
294 Application.prefs.setValue(
"extensions.mashTape.expanded", mashTape.expanded);
303 mashTape.pausedDr.unbind();
306 mashTape.setupAlreadyPlaying =
function() {
307 if ((gMM.status.state ==
Ci.sbIMediacoreStatus.STATUS_PLAYING) ||
308 (gMM.status.state ==
Ci.sbIMediacoreStatus.STATUS_PAUSED) ||
309 (gMM.status.state ==
Ci.sbIMediacoreStatus.STATUS_BUFFERING)
312 mashTape.iframeLoadCount = 0;
313 for each (var iframe
in document.getElementsByTagName(
"iframe")) {
314 if (typeof(iframe) ==
"object") {
315 iframe.addEventListener(
"DOMContentLoaded",
316 mashTape.iframeLoadListener,
false);
317 mashTape.iframeLoadCount++;
323 mashTape.iframeLoadListener =
function(e) {
324 mashTape.iframeLoadCount--;
325 if (mashTape.iframeLoadCount == 0) {
326 mashTape.showTabPanels();
331 var
i = gMM.sequencer.view.getItemByIndex(
332 gMM.sequencer.viewPosition);
333 var
artist = i.getProperty(SBProperties.artistName);
334 var album = i.getProperty(SBProperties.albumName);
335 var track = i.getProperty(SBProperties.trackName);
337 if (artist ==
null || artist ==
"") {
338 mashTape.noDataTab(
"info");
339 mashTape.noDataTab(
"review");
340 mashTape.noDataTab(
"rss");
341 mashTape.noDataTab(
"photo");
342 mashTape.noDataTab(
"flash");
345 mashTape.update(artist, album, track);
353 mashTape.showTabPanels =
function() {
354 var deck = document.getElementById(
"mashTape-deck");
355 deck.selectedIndex = 2;
357 for each (var prov
in [
"info",
"review",
"rss",
"photo",
"flash"]) {
358 var provDeck = document.getElementById(
"mashTape-panel-" + prov);
359 provDeck.selectedIndex = 0;
363 mashTape.onMediacoreEvent =
function(ev) {
365 case Ci.sbIMediacoreEvent.TRACK_CHANGE:
366 mashTape.onTrackChange(ev.data);
368 case Ci.sbIMediacoreEvent.STREAM_END:
369 case Ci.sbIMediacoreEvent.STREAM_STOP:
374 if (gMM.status.state ==
Ci.sbIMediacoreStatus.STATUS_STOPPED)
386 mashTape.onStop =
function() {
387 var deck = document.getElementById(
"mashTape-deck");
388 deck.selectedIndex = mashTape.npDeck;
391 mashTape.onTrackChange =
function(item, view, index) {
392 mashTape.showTabPanels();
393 var artist = item.getProperty(SBProperties.artistName);
394 var album = item.getProperty(SBProperties.albumName);
395 var track = item.getProperty(SBProperties.trackName);
397 if (artist ==
null || artist ==
"") {
398 mashTape.noDataTab(
"info");
399 mashTape.noDataTab(
"review");
400 mashTape.noDataTab(
"rss");
401 mashTape.noDataTab(
"photo");
402 mashTape.noDataTab(
"flash");
404 mashTape.update(artist, album, track);
407 mashTape.playingObserver = {
409 if (gMM.status.state ==
Ci.sbIMediacoreStatus.STATUS_PLAYING
410 && topic ==
"faceplate.paused" &&
data ==
"0")
413 var detailFrame = document.getElementById(
"mashTape-panel-flash-detail");
414 var videoWindow = detailFrame.contentWindow;
415 var
event = videoWindow.document.createEvent(
"Events");
416 event.initEvent(
"songbirdPlaybackResumed",
false,
false);
417 videoWindow.dispatchEvent(
event);
425 mashTape.noDataTab =
function(providerType) {
426 var thisDeck = document.getElementById(
"mashTape-panel-" + providerType);
427 thisDeck.selectedIndex = 1;
440 mashTape.updateEnabledProviders =
function(providerType) {
441 var prefKey =
"extensions.mashTape." + providerType +
".providers";
442 mashTape.enabledProviders[providerType] =
443 Application.prefs.getValue(prefKey,
"").split(
",");
446 while (i<mashTape.enabledProviders[providerType].length) {
447 var clsid = mashTape.enabledProviders[providerType][
i];
448 if (typeof(
CcID[clsid]) ==
"undefined") {
450 mashTape.log(
"provider " + clsid +
" is uninstalled, disabling");
451 mashTape.enabledProviders[providerType].splice(i, 1);
459 mashTape.enabledProviders[providerType].join(
","));
465 mashTape.enableProvider =
function(clsid, providerType) {
466 var prefKey =
"extensions.mashTape." + providerType +
".providers";
467 mashTape.enabledProviders[providerType] =
468 Application.prefs.getValue(prefKey,
"").split(
",");
470 switch (providerType) {
475 mashTape.enabledProviders[providerType].push(clsid);
477 mashTape.enabledProviders[providerType].join(
","));
482 mashTape.enabledProviders[providerType] =
new Array(clsid);
492 mashTape.update =
function(
artist, album, track) {
493 mashTape.pendingCallbacks =
new Array();
494 mashTape.pendingCallbacks[
"info"] =
new Object;
495 mashTape.pendingCallbacks[
"review"] =
new Object;
496 mashTape.pendingCallbacks[
"rss"] =
new Object;
497 mashTape.pendingCallbacks[
"photo"] =
new Object;
498 mashTape.pendingCallbacks[
"flash"] =
new Object;
499 mashTape.pendingCallbacks[
"info"].pending = 0;
500 mashTape.pendingCallbacks[
"review"].pending = 0;
501 mashTape.pendingCallbacks[
"rss"].pending = 0;
502 mashTape.pendingCallbacks[
"photo"].pending = 0;
503 mashTape.pendingCallbacks[
"flash"].pending = 0;
504 mashTape.pendingCallbacks[
"info"].valid = 0;
505 mashTape.pendingCallbacks[
"review"].valid = 0;
506 mashTape.pendingCallbacks[
"rss"].valid = 0;
507 mashTape.pendingCallbacks[
"photo"].valid = 0;
508 mashTape.pendingCallbacks[
"flash"].valid = 0;
515 if (mashTape.prevArtist != artist) {
516 mashTape.resetInfo();
517 mashTape.updateEnabledProviders(
"info");
518 if (mashTape.enabledProviders[
"info"].length > 0 &&
519 Application.prefs.getValue(
"extensions.mashTape.info.enabled",
525 var clsid = mashTape.enabledProviders[
"info"][0];
526 var infoProvider =
CcID[clsid].createInstance(
527 Ci.sbIMashTapeInfoProvider);
528 var
callback =
new mashTape.displayCallback(uid);
529 mashTape.pendingCallbacks[
"info"].pending +=
530 infoProvider.numSections;
531 infoProvider.query(artist, callback);
535 if (mashTape.providers[
"review"].length > 0) {
536 mashTape.resetReviewFrame();
537 mashTape.updateEnabledProviders(
"review");
538 if (
Application.prefs.getValue(
"extensions.mashTape.review.enabled",
true))
540 for (var i=0; i<mashTape.enabledProviders[
"review"].length; i++) {
541 var clsid = mashTape.enabledProviders[
"review"][
i];
542 var prov =
CcID[clsid].createInstance(
Ci.sbIMashTapeReviewProvider);
543 var callback =
new mashTape.displayCallback(uid);
544 prov.queryFull(artist, album, track, callback);
545 mashTape.pendingCallbacks[
"review"].pending++;
550 mashTape.resetRssFrame();
551 mashTape.updateEnabledProviders(
"rss");
552 if (
Application.prefs.getValue(
"extensions.mashTape.rss.enabled",
true))
554 for (var i=0; i<mashTape.enabledProviders[
"rss"].length; i++) {
555 var clsid = mashTape.enabledProviders[
"rss"][
i];
556 var prov =
CcID[clsid].createInstance(
Ci.sbIMashTapeRSSProvider);
557 var callback =
new mashTape.displayCallback(uid);
558 prov.query(artist, callback);
559 mashTape.pendingCallbacks[
"rss"].pending++;
563 if (mashTape.prevArtist != artist || !mashTape.photoFrameLoaded) {
564 mashTape.photoFrameLoaded =
false;
565 mashTape.photosReady =
null;
566 mashTape.resetPhotoFrame();
567 mashTape.updateEnabledProviders(
"photo");
568 if (
Application.prefs.getValue(
"extensions.mashTape.photo.enabled",
571 for (var i=0; i<mashTape.enabledProviders[
"photo"].length; i++) {
572 var clsid = mashTape.enabledProviders[
"photo"][
i];
573 var provider =
CcID[clsid].createInstance(
574 Ci.sbIMashTapePhotoProvider);
575 var callback =
new mashTape.displayCallback(uid);
576 provider.query(artist, callback);
577 mashTape.pendingCallbacks[
"photo"].pending++;
582 mashTape.resetFlashFrame();
583 mashTape.updateEnabledProviders(
"flash");
584 if (
Application.prefs.getValue(
"extensions.mashTape.flash.enabled",
true))
586 setTimeout(mashTape.loadFirstFlashFeed, 10000);
587 for (var i=0; i<mashTape.enabledProviders[
"flash"].length; i++) {
588 var clsid = mashTape.enabledProviders[
"flash"][
i];
589 var prov =
CcID[clsid].createInstance(
Ci.sbIMashTapeFlashProvider);
590 var callback =
new mashTape.displayCallback(uid);
591 prov.query(artist, callback);
592 mashTape.pendingCallbacks[
"flash"].pending++;
596 mashTape.prevArtist =
artist;
608 mashTape.displayCallback =
function(uid) {
609 this.wrappedJSObject =
this;
612 mashTape.displayCallback.prototype = {
613 update:
function(contractId, results, section) {
616 if (typeof(gMM) ==
"undefined")
618 var i = gMM.sequencer.view.getItemByIndex(
619 gMM.sequencer.viewPosition);
621 + i.getProperty(SBProperties.albumName)
622 + i.getProperty(SBProperties.trackName));
623 if (this.uid != thisUID) {
627 var clsid = mashTape.compMgr.contractIDToCID(contractId);
628 var provider = Cc[contractId].createInstance(
Ci.sbIMashTapeProvider);
630 var classPending = mashTape.pendingCallbacks[provider.providerType];
631 if (results !=
null &&
632 (provider.providerType ==
"info" || results.length > 0))
636 classPending.valid++;
638 classPending.pending--;
651 if (classPending.pending == 0 && classPending.valid == 0) {
654 mashTape.noDataTab(provider.providerType);
657 switch(provider.providerType) {
659 mashTape.updateInfo(provider, results, section);
663 document.getElementById(
"mashTape-panel-review-splitter");
664 mashTape.updateReviewFeeds(provider, results);
665 if (results !=
null &&
666 splitter.getAttribute(
"state") ==
"collapsed")
668 splitter.setAttribute(
"state",
"open");
670 if (classPending.pending == 0)
671 mashTape.loadFirstReviewFeed()
674 var splitter = document.getElementById(
"mashTape-panel-rss-splitter");
675 mashTape.updateRssFeeds(provider, results);
676 if (results !=
null &&
677 splitter.getAttribute(
"state") ==
"collapsed")
679 splitter.setAttribute(
"state",
"open");
681 if (classPending.pending == 0)
682 mashTape.loadFirstRssFeed()
685 mashTape.updatePhoto(provider, results);
689 document.getElementById(
"mashTape-panel-flash-splitter");
690 mashTape.updateFlash(provider, results);
691 if (results !=
null && results.length > 0 && !mashTape.expanded
692 && splitter.getAttribute(
"state") ==
"collapsed")
694 splitter.setAttribute(
"state",
"open");
696 if (classPending.pending == 0)
697 mashTape.loadFirstFlashFeed()
700 alert(
"Unrecognised provider callback: " + providerType);
708 mashTape.resetInfo =
function() {
709 var infoFrame = document.getElementById(
"mashTape-frame-info");
710 infoFrame.contentWindow.scrollTo(0,0);
711 var
doc = infoFrame.contentWindow.document;
712 var photoDiv = doc.getElementById(
"artist-photo");
713 while (photoDiv.firstChild)
714 photoDiv.removeChild(photoDiv.firstChild);
715 var discoDiv = doc.getElementById(
"discography-text");
716 while (discoDiv.firstChild)
717 discoDiv.removeChild(discoDiv.firstChild);
718 var membersDiv = doc.getElementById(
"members-text");
719 while (membersDiv.firstChild)
720 membersDiv.removeChild(membersDiv.firstChild);
721 var tagsDiv = doc.getElementById(
"tags-text");
722 while (tagsDiv.firstChild)
723 tagsDiv.removeChild(tagsDiv.firstChild);
724 var linksDiv = doc.getElementById(
"links-text");
725 while (linksDiv.firstChild)
726 linksDiv.removeChild(linksDiv.firstChild);
727 var bioText = doc.getElementById(
"bio-text");
728 while (bioText.firstChild)
729 bioText.removeChild(bioText.firstChild);
731 bioText.style.height =
"auto";
732 discoDiv.style.height =
"auto";
733 bioText.setAttribute(
"mashTape-collapsed",
true);
734 discoDiv.setAttribute(
"mashTape-collapsed",
true);
735 doc.getElementById(
"bio-toggle-text").innerHTML =
736 mashTape.strings.GetStringFromName(
"extensions.mashTape.msg.readmore");
737 doc.getElementById(
"discography-toggle-text").innerHTML =
738 mashTape.strings.GetStringFromName(
"extensions.mashTape.msg.viewmore");
741 doc.getElementById(
"bio").style.display =
"none";
742 doc.getElementById(
"artist-photo").style.display =
"none";
743 doc.getElementById(
"discography").style.display =
"none";
744 doc.getElementById(
"members").style.display =
"none";
745 doc.getElementById(
"tags").style.display =
"none";
746 doc.getElementById(
"links").style.display =
"none";
749 mashTape.updateInfo =
function(provider, results, section) {
750 if (results ==
null && section !=
"photo")
752 var infoFrame = document.getElementById(
"mashTape-frame-info");
753 var doc = infoFrame.contentWindow.document;
754 var body = doc.getElementsByTagName(
"body")[0];
756 provider = provider.QueryInterface(
Ci.sbIMashTapeInfoProvider);
763 doc.getElementById(
"bio").style.display =
"block";
764 var bioDiv = doc.getElementById(
"bio-text");
765 faviconSrc = provider.providerIconBio;
766 faviconUrl = results.bioUrl;
768 if (typeof(results.bioText) ==
"undefined" ||
769 results.bioText ==
null)
771 var noBioFound = mashTape.strings.formatStringFromName(
772 "extensions.mashTape.info.no_bio", [mashTape.prevArtist],1);
773 var bioText = noBioFound;
774 if (typeof(results.bioEditUrl) !=
"undefined")
775 bioText +=
" <a href='" +
776 results.bioEditUrl +
"'>" +
777 mashTape.strings.GetStringFromName(
778 "extensions.mashTape.info.create") +
"</a>";
779 bioDiv.innerHTML = bioText;
780 doc.getElementById(
"bio-toggle-text").style.display =
"none";
783 bioDiv.innerHTML = results.bioText.toString();
784 bioDiv.setAttribute(
"mashTape-full-height", bioDiv.scrollHeight);
789 if (bioDiv.scrollHeight > 98) {
792 for (var i=0; i<bioDiv.childNodes.length; i++) {
793 if (bioDiv.childNodes[i].offsetTop <= 100)
794 height = bioDiv.childNodes[
i].offsetTop + 5;
798 doc.getElementById(
"bio-toggle-text").style.display =
"block";
799 bioDiv.style.height = height +
"px";
801 doc.getElementById(
"bio-toggle-text").style.display =
"none";
804 mashTape.mgr.updateInfo(
"bio", results.bioText.toString());
806 var bioUrl = results.bioUrl;
807 if (typeof(bioUrl) !=
"string")
808 bioUrl = bioUrl.toString();
809 mashTape.mgr.updateInfo(
"biourl", bioUrl);
813 doc.getElementById(
"artist-photo").style.display =
"block";
814 var photoDiv = doc.getElementById(
"artist-photo");
815 var artistImage = doc.createElement(
"img");
817 artistImage.addEventListener(
"load",
function() {
818 var
width = this.naturalWidth +
"px";
819 if (this.naturalWidth > 150)
821 doc.getElementById(
"artist-photo").style.width =
width;
822 doc.getElementById(
"content").style.marginLeft =
width;
825 mashTape.mgr.updateInfo(
"photo", this.src);
828 artistImage.src = results;
830 artistImage.onerror =
function() {
832 "chrome://mashtape/skin/generic-artist-photo.jpg";
835 "chrome://songbird/skin/artist-info/default-photo.png";
837 artistImage.className =
"artistImage";
838 photoDiv.appendChild(artistImage);
842 doc.getElementById(
"discography").style.display =
"block";
843 var discoDiv = doc.getElementById(
"discography-text");
846 results.discography.sort(
function(a,b) {
847 var a = (a.release_date ==
null) ?
"" : a.release_date;
848 var b = (b.release_date ==
null) ?
"" : b.release_date;
852 results.discography.forEach(
function(
val, i, arr) {
853 var albumName =
val.title;
854 var albumImage =
val.artwork;
857 var albumDiv = doc.createElement(
"div");
858 albumDiv.className =
"discography-album";
860 var imageLink = doc.createElement(
"a");
862 imageLink.href =
url;
863 var image = doc.createElement(
"img");
864 image.className =
"album-art";
865 image.setAttribute(
"title",
val.tooltip);
867 image.src = albumImage;
870 "chrome://songbird/skin/album-art/default-cover.png";
873 imageLink.appendChild(image);
874 albumDiv.appendChild(imageLink);
876 var
name = doc.createElement(
"span");
877 name.class =
"album-name";
878 name.innerHTML = albumName;
880 var link = doc.createElement(
"a");
882 link.setAttribute(
"title",
val.tooltip);
883 link.appendChild(name);
884 albumDiv.appendChild(link);
886 albumDiv.appendChild(name);
888 if (
val.release_date !=
null) {
889 var release = doc.createElement(
"span");
890 release.className =
"release-date";
891 release.innerHTML =
"<br />(" +
892 val.release_date.substr(0,4) +
")";
893 albumDiv.appendChild(release);
896 discoDiv.appendChild(albumDiv);
899 discoDiv.setAttribute(
"mashTape-full-height",discoDiv.scrollHeight);
900 if (discoDiv.scrollHeight > 70) {
901 doc.getElementById(
"discography-toggle-text").style.display =
903 discoDiv.style.height =
"70px";
905 doc.getElementById(
"discography-toggle-text").style.display =
908 faviconSrc = provider.providerIconDiscography;
909 faviconUrl = results.url;
913 if (results.members.length == 0)
915 doc.getElementById(
"members").style.display =
"block";
916 var membersDiv = doc.getElementById(
"members-text");
917 var list = doc.createElement(
"ul");
918 list.className =
"flat";
919 results.members.forEach(
function(
val, i, arr) {
920 var li = doc.createElement(
"li");
922 if (i == arr.length-1)
923 li.className =
"last";
925 list.appendChild(li);
927 membersDiv.appendChild(list);
929 faviconSrc = provider.providerIconMembers;
930 faviconUrl = results.url;
934 doc.getElementById(
"tags").style.display =
"block";
935 var tagsDiv = doc.getElementById(
"tags-text");
936 var list = doc.createElement(
"ul");
937 list.className =
"flat";
938 results.tags.forEach(
function(
val, i, arr) {
939 if (
val.count >= 10) {
940 var li = doc.createElement(
"li");
941 var link = doc.createElement(
"a");
943 var tagName = doc.createTextNode(
val.name);
944 link.appendChild(tagName);
945 li.appendChild(link);
946 if (i == arr.length-1 ||
947 (i < arr.length-1 && arr[i+1].count < 10))
948 li.className =
"last";
949 list.appendChild(li);
952 tagsDiv.appendChild(list);
954 faviconSrc = provider.providerIconTags;
955 faviconUrl = results.url;
959 if (results.links.length == 0)
961 doc.getElementById(
"links").style.display =
"block";
962 var linksDiv = doc.getElementById(
"links-text");
963 results.links.sort(
function(a,b) {
964 if (a.name ==
"Homepage")
966 else if (b.name ==
"Homepage")
969 return a.name < b.name;
971 var table = doc.createElement(
"table");
972 table.className =
"table-links";
973 results.links.forEach(
function(
val, i, arr) {
974 var tr = doc.createElement(
"tr");
975 var colName = doc.createElement(
"td");
976 var colUrl = doc.createElement(
"td");
977 colUrl.className =
"url";
978 var textNode = doc.createElement(
"span");
979 textNode.className =
"linkType";
980 textNode.innerHTML = decodeURIComponent(
val.name) +
":";
981 colName.appendChild(textNode);
982 var link = doc.createElement(
"a");
984 link.innerHTML =
val.url;
985 colUrl.appendChild(link);
986 tr.appendChild(colName);
987 tr.appendChild(colUrl);
988 table.appendChild(tr);
990 linksDiv.appendChild(table);
992 faviconSrc = provider.providerIconLinks;
993 faviconUrl = results.url;
997 dump(
"*** updateInfo called for unknown section: "+section+
"\n");
1000 if (section !=
"photo") {
1001 var favicon = doc.getElementById(
"favicon-" + section);
1002 favicon.src = faviconSrc;
1003 favicon.setAttribute(
"title", mashTape.strings.formatStringFromName(
1004 "extensions.mashTape.msg.provider_tooltip", [results.provider],
1006 var link = doc.getElementById(
"link-" + section);
1007 link.href = faviconUrl;
1015 mashTape.resetReviewFrame =
function() {
1017 var indexFrame = document.getElementById(
"mashTape-panel-review-index");
1018 var body = indexFrame.contentWindow.document.getElementsByTagName(
"body")[0];
1019 while (body.firstChild)
1020 body.removeChild(body.firstChild);
1022 var detailFrame = document.getElementById(
"mashTape-panel-review-detail");
1023 var doc = detailFrame.contentWindow.document;
1026 var content = doc.getElementById(
"actual-content");
1027 content.style.display =
"none";
1030 var splitter = document.getElementById(
"mashTape-panel-review-splitter");
1031 splitter.setAttribute(
"state",
"collapsed");
1034 var loading = doc.getElementById(
"loading");
1035 loading.style.display =
"block";
1036 var paneHeight = doc.getElementsByTagName(
"html")[0].clientHeight;
1038 loading.style.marginTop = (paneHeight-64)/2 +
"px";
1041 mashTape.loadFirstReviewFeed =
function() {
1042 var detailFrame = document.getElementById(
"mashTape-panel-review-detail");
1043 var indexFrame = document.getElementById(
"mashTape-panel-review-index");
1046 if (detailFrame.contentWindow.document
1047 .getElementById(
"loading").style.display ==
"block")
1049 var doc = indexFrame.contentWindow.document;
1050 var body = doc.getElementsByTagName(
"body")[0];
1051 var
first = body.getElementsByTagName(
"div")[0];
1052 mashTape.loadReviewDetail(first);
1056 mashTape.loadReviewDetail =
function(
entry) {
1057 if (typeof(
entry) ==
"undefined")
1059 while (!
entry.hasAttribute(
"mashTape-title"))
1061 var title =
entry.getAttribute(
"mashTape-title");
1062 var author =
entry.getAttribute(
"mashTape-author");
1063 var authorUrl =
entry.getAttribute(
"mashTape-authorUrl");
1064 var src =
entry.getAttribute(
"mashTape-src");
1065 var time =
entry.getAttribute(
"mashTape-time");
1066 var url =
entry.getAttribute(
"mashTape-url");
1067 var favicon =
entry.getAttribute(
"mashTape-favicon");
1068 var content =
entry.getAttribute(
"mashTape-content");
1069 var
rating =
entry.getAttribute(
"mashTape-rating");
1071 var detailFrame = document.getElementById(
"mashTape-panel-review-detail");
1072 var doc = detailFrame.contentWindow.document;
1073 detailFrame.contentWindow.scrollTo(0,0);
1074 var detailTitle = doc.getElementById(
"title");
1075 var detailFavicon = doc.getElementById(
"favicon");
1076 var detailFaviconLink = doc.getElementById(
"link");
1077 var detailSubtitle = doc.getElementById(
"subtitle");
1078 var detailContent = doc.getElementById(
"content");
1079 var detailMore = doc.getElementById(
"write-review");
1082 var loading = doc.getElementById(
"loading");
1083 loading.style.display =
"none";
1086 var actualContent = doc.getElementById(
"actual-content");
1087 actualContent.style.display =
"block";
1089 var containingDiv =
entry;
1090 if (mashTape.selectedReview)
1091 mashTape.selectedReview.className =
1092 mashTape.selectedReview.className.replace(
"row-selected",
1094 while (containingDiv.className.indexOf(
"row-") != 0)
1095 containingDiv = containingDiv.parentNode;
1096 containingDiv.className +=
" row-selected";
1097 mashTape.selectedReview = containingDiv;
1099 detailTitle.innerHTML = title;
1100 detailFavicon.src = favicon;
1101 detailFavicon.setAttribute(
"title", mashTape.strings.formatStringFromName(
1102 "extensions.mashTape.msg.review_tooltip", [src], 1));
1103 detailFaviconLink.href =
url;
1105 while (detailSubtitle.firstChild)
1106 detailSubtitle.removeChild(detailSubtitle.firstChild);
1107 detailSubtitle.appendChild(doc.createTextNode(
1108 mashTape.strings.GetStringFromName(
"extensions.mashTape.msg.by") +
" "));
1109 var provider = doc.createElement(
"a");
1110 provider.href = authorUrl;
1111 provider.innerHTML = author;
1112 detailSubtitle.appendChild(provider);
1115 var dateObj =
new Date(parseInt(time));
1116 var timestamp = doc.createElement(
"span");
1117 timestamp.className =
"time";
1118 timestamp.innerHTML = dateObj.ago();
1119 detailSubtitle.appendChild(timestamp);
1122 detailSubtitle.appendChild(doc.createElement(
"br"));
1125 var ratings = doc.createElement(
"div");
1126 ratings.className =
"ratings rate" + rating.toString();
1127 detailSubtitle.appendChild(ratings);
1131 detailContent.innerHTML = content;
1132 detailMore.innerHTML =
"<a href='" + url +
"'>" +
1133 mashTape.strings.GetStringFromName(
"extensions.mashTape.msg.review") +
1137 mashTape.updateReviewFeeds =
function(provider, results) {
1138 if (results ==
null)
1140 var indexFrame = document.getElementById(
"mashTape-panel-review-index");
1141 var doc = indexFrame.contentWindow.document;
1142 var body = doc.getElementsByTagName(
"body")[0];
1144 var favicon = provider.QueryInterface(
Ci.sbIMashTapeReviewProvider)
1146 for (var i=0; i<results.length; i++) {
1147 var entryDiv = doc.createElement(
"div");
1148 entryDiv.className =
"row-unselected";
1149 var img = doc.createElement(
"img");
1150 img.className =
"favicon";
1152 img.setAttribute(
"title", provider.providerName);
1153 entryDiv.appendChild(img);
1155 var metadata = doc.createElement(
"div");
1156 metadata.className =
"metadata-review";
1157 var link = doc.createElement(
"span");
1158 entryDiv.setAttribute(
"mashTape-title", results[i].title);
1159 entryDiv.setAttribute(
"mashTape-favicon", favicon);
1160 entryDiv.setAttribute(
"mashTape-author", results[i].author);
1161 entryDiv.setAttribute(
"mashTape-authorUrl", results[i].authorUrl);
1162 entryDiv.setAttribute(
"mashTape-src", results[i].provider);
1163 entryDiv.setAttribute(
"mashTape-url", results[i].url);
1164 entryDiv.setAttribute(
"mashTape-time", results[i].time);
1165 entryDiv.setAttribute(
"mashTape-rating", results[i].rating);
1166 entryDiv.setAttribute(
"mashTape-content", results[i].content);
1167 entryDiv.addEventListener(
"click",
function(e) {
1168 mashTape.loadReviewDetail(e.target);
1169 e.stopPropagation();
1172 link.innerHTML = results[
i].title;
1173 metadata.appendChild(link);
1175 if (results[i].time > 0) {
1176 var dateObj =
new Date(results[i].time);
1177 var dateSpan = doc.createElement(
"span");
1178 dateSpan.className =
"time";
1179 dateSpan.innerHTML = dateObj.ago();
1180 metadata.appendChild(dateSpan);
1183 if (results[i].rating > -1) {
1184 var ratings = doc.createElement(
"div");
1185 ratings.className =
"ratings rate" + results[
i].rating.toString();
1186 metadata.appendChild(ratings);
1189 entryDiv.appendChild(metadata);
1192 entryDiv.setAttribute(
"mashTape-timestamp", results[i].time);
1193 entryDiv.setAttribute(
"mashTape-title", results[i].title);
1194 var divs = body.getElementsByTagName(
"div");
1195 var inserted =
false;
1197 for (var j=0; j<divs.length; j++) {
1198 if (divs[j].
className.indexOf(
"row-") == -1)
1203 var otherTimestamp = divs[j].getAttribute(
"mashTape-timestamp");
1204 if ((otherTimestamp < results[i].time && !inserted &&
1206 || (results[i].time == 0 && !inserted))
1217 body.insertBefore(entryDiv, divs[j]);
1223 body.appendChild(entryDiv);
1231 mashTape.resetRssFrame =
function() {
1233 var indexFrame = document.getElementById(
"mashTape-panel-rss-index");
1234 var detailFrame = document.getElementById(
"mashTape-panel-rss-detail");
1235 var doc = indexFrame.contentWindow.document;
1236 var body = doc.getElementsByTagName(
"body")[0];
1237 while (body.firstChild)
1238 body.removeChild(body.firstChild);
1240 doc = detailFrame.contentWindow.document;
1243 var content = doc.getElementById(
"actual-content");
1244 content.style.display =
"none";
1247 var splitter = document.getElementById(
"mashTape-panel-rss-splitter");
1248 splitter.setAttribute(
"state",
"collapsed");
1251 var loading = doc.getElementById(
"loading");
1252 loading.style.display =
"block";
1253 var paneHeight = doc.getElementsByTagName(
"html")[0].clientHeight;
1255 loading.style.marginTop = (paneHeight-64)/2 +
"px";
1258 mashTape.loadFirstRssFeed =
function() {
1261 var indexFrame = document.getElementById(
"mashTape-panel-rss-index");
1262 var detailFrame = document.getElementById(
"mashTape-panel-rss-detail");
1263 if (detailFrame.contentWindow.document
1264 .getElementById(
"loading").style.display ==
"block")
1266 var doc = indexFrame.contentWindow.document;
1267 var body = doc.getElementsByTagName(
"body")[0];
1268 var first = body.getElementsByTagName(
"div")[0];
1269 mashTape.loadRssDetail(first);
1273 mashTape.loadRssDetail =
function(
entry) {
1274 if (typeof(
entry) ==
"undefined")
1276 while (!
entry.hasAttribute(
"mashTape-title"))
1278 var title =
entry.getAttribute(
"mashTape-title");
1279 var src =
entry.getAttribute(
"mashTape-src");
1280 var srcUrl =
entry.getAttribute(
"mashTape-srcUrl");
1281 var time =
entry.getAttribute(
"mashTape-time");
1282 var url =
entry.getAttribute(
"mashTape-url");
1283 var favicon =
entry.getAttribute(
"mashTape-favicon");
1284 var content =
entry.getAttribute(
"mashTape-content");
1286 var detailFrame = document.getElementById(
"mashTape-panel-rss-detail");
1287 var doc = detailFrame.contentWindow.document;
1288 detailFrame.contentWindow.scrollTo(0,0);
1289 var detailTitle = doc.getElementById(
"title");
1290 var detailFavicon = doc.getElementById(
"favicon");
1291 var detailFaviconLink = doc.getElementById(
"link");
1292 var detailSubtitle = doc.getElementById(
"subtitle");
1293 var detailContent = doc.getElementById(
"content");
1294 var detailMore = doc.getElementById(
"read-more");
1297 var loading = doc.getElementById(
"loading");
1298 loading.style.display =
"none";
1301 var actualContent = doc.getElementById(
"actual-content");
1302 actualContent.style.display =
"block";
1304 var containingDiv =
entry;
1305 if (mashTape.selectedRss)
1306 mashTape.selectedRss.className =
1307 mashTape.selectedRss.className.replace(
"row-selected",
"row-unselected");
1308 while (containingDiv.className.indexOf(
"row-") != 0)
1309 containingDiv = containingDiv.parentNode;
1310 containingDiv.className +=
" row-selected";
1311 mashTape.selectedRss = containingDiv;
1313 detailTitle.innerHTML = title;
1314 detailFavicon.src = favicon;
1315 detailFavicon.setAttribute(
"title", mashTape.strings.formatStringFromName(
1316 "extensions.mashTape.msg.rss_tooltip", [src], 1));
1317 detailFaviconLink.href =
url;
1319 while (detailSubtitle.firstChild)
1320 detailSubtitle.removeChild(detailSubtitle.firstChild);
1321 detailSubtitle.appendChild(doc.createTextNode(
1322 mashTape.strings.GetStringFromName(
"extensions.mashTape.msg.by") +
" "));
1323 var provider = doc.createElement(
"a");
1324 provider.href = srcUrl;
1325 provider.innerHTML = src;
1326 detailSubtitle.appendChild(provider);
1327 var dateObj =
new Date(parseInt(time));
1328 var timestamp = doc.createElement(
"span");
1329 timestamp.className =
"time";
1330 timestamp.innerHTML = dateObj.ago();
1331 detailSubtitle.appendChild(timestamp);
1333 detailContent.innerHTML = content;
1334 detailMore.innerHTML =
"<a href='" + url +
"'>" +
1335 mashTape.strings.GetStringFromName(
"extensions.mashTape.msg.readorig") +
"</a>";
1339 mashTape.updateRssFeeds =
function(provider, results) {
1340 if (results ==
null)
1342 var indexFrame = document.getElementById(
"mashTape-panel-rss-index");
1343 var doc = indexFrame.contentWindow.document;
1344 var body = doc.getElementsByTagName(
"body")[0];
1346 var favicon = provider.QueryInterface(
Ci.sbIMashTapeRSSProvider)
1348 for (var i=0; i<results.length; i++) {
1349 var entryDiv = doc.createElement(
"div");
1350 entryDiv.className =
"row-unselected";
1351 var img = doc.createElement(
"img");
1352 img.className =
"favicon";
1354 img.setAttribute(
"title", provider.providerName);
1355 entryDiv.appendChild(img);
1357 var metadata = doc.createElement(
"div");
1358 metadata.className =
"metadata-rss";
1359 var link = doc.createElement(
"span");
1360 entryDiv.setAttribute(
"mashTape-title", results[i].title);
1361 entryDiv.setAttribute(
"mashTape-favicon", favicon);
1362 entryDiv.setAttribute(
"mashTape-src", results[i].provider);
1363 entryDiv.setAttribute(
"mashTape-srcUrl", results[i].providerUrl);
1364 entryDiv.setAttribute(
"mashTape-time", results[i].time);
1365 entryDiv.setAttribute(
"mashTape-url", results[i].url);
1366 entryDiv.setAttribute(
"mashTape-content", results[i].content);
1367 entryDiv.addEventListener(
"click",
function(e) {
1368 mashTape.loadRssDetail(e.target);
1369 e.stopPropagation();
1372 link.innerHTML = results[
i].title;
1373 metadata.appendChild(link);
1375 var dateObj =
new Date(results[i].time);
1376 var dateSpan = doc.createElement(
"span");
1377 dateSpan.className =
"time";
1378 dateSpan.innerHTML = dateObj.ago();
1379 metadata.appendChild(dateSpan);
1380 if (results[i].content.indexOf(
"<img") >= 0) {
1381 var img = doc.createElement(
"img");
1382 img.src =
"chrome://mashtape/skin/photos.png";
1383 img.setAttribute(
"title", mashTape.strings.GetStringFromName(
1384 "extensions.mashTape.rss.photo"));
1385 img.className =
"legend";
1386 metadata.appendChild(img);
1388 if (results[i].content.indexOf(
"<object") >= 0 ||
1389 results[
i].content.indexOf(
"<embed") >= 0) {
1390 var img = doc.createElement(
"img");
1391 img.src =
"chrome://mashtape/skin/video.png";
1392 img.setAttribute(
"title", mashTape.strings.GetStringFromName(
1393 "extensions.mashTape.rss.video"));
1394 img.className =
"legend";
1395 metadata.appendChild(img);
1397 entryDiv.appendChild(metadata);
1400 entryDiv.setAttribute(
"mashTape-timestamp", results[i].time);
1401 entryDiv.setAttribute(
"mashTape-title", results[i].title);
1402 var divs = body.getElementsByTagName(
"div");
1403 var inserted =
false;
1405 for (var j=0; j<divs.length; j++) {
1406 if (divs[j].
className.indexOf(
"row-") == -1)
1409 nextClass = Math.abs(nextClass-1);
1411 var otherTimestamp = divs[j].getAttribute(
"mashTape-timestamp");
1412 if (otherTimestamp < results[i].time && !inserted) {
1422 body.insertBefore(entryDiv, divs[j]);
1428 body.appendChild(entryDiv);
1436 mashTape.resetPhotoFrame =
function() {
1439 var photoPanel = document.getElementById(
"mashTape-panel-photo");
1440 var iframe = document.getElementById(
"mashTape-frame-photo");
1441 photoPanel.removeChild(iframe);
1443 var iframe = document.createElement(
"iframe");
1444 iframe.id =
"mashTape-frame-photo";
1445 iframe.className =
"content-frame";
1446 iframe.setAttribute(
"flex", 1);
1447 iframe.setAttribute(
"tooltip",
"aHTMLTooltip");
1448 iframe.setAttribute(
"src",
"chrome://mashtape/content/iframePhoto.html");
1450 iframe.addEventListener(
"DOMContentLoaded", mashTape.photoLoadListener,
false);
1451 photoPanel.insertBefore(iframe, photoPanel.firstChild);
1452 mashTape.photoFrame = iframe;
1454 mashTape.photoLoadListener =
function(e) {
1455 var iframe = e.currentTarget;
1456 iframe.removeEventListener(
"DOMContentLoaded",
1457 mashTape.photoLoadListener,
false);
1460 var doc = mashTape.photoFrame.contentWindow.document;
1461 var loading = doc.getElementById(
"loading");
1462 loading.style.display =
"block";
1463 var paneHeight = doc.getElementsByTagName(
"html")[0].clientHeight;
1465 loading.style.marginTop = (paneHeight-32)/2 +
"px";
1466 mashTape.photoFrameLoaded =
true;
1467 if (mashTape.photosReady !=
null)
1468 mashTape.drawPhotoStream(mashTape.photosReady.provider,
1469 mashTape.photosReady.results);
1472 mashTape.updatePhoto =
function(provider, results) {
1473 if (!mashTape.photoFrameLoaded) {
1474 mashTape.photosReady = {
1475 provider : provider,
1479 mashTape.drawPhotoStream(provider, results);
1482 var photos =
new Array();
1483 for (var i=0; i<results.length; i++) {
1484 var result = results[
i];
1486 imageUrl : result.medium,
1487 imageTitle : result.title,
1488 authorName : result.owner,
1489 authorUrl : result.ownerUrl,
1490 timestamp: result.time
1494 mashTape.mgr.updatePhotos(photos, photos.length);
1497 mashTape.drawPhotoStream =
function(provider, results) {
1498 var doc = mashTape.photoFrame.contentWindow.document;
1499 var body = doc.getElementsByTagName(
"body")[0];
1501 var paneWidth = doc.width;
1502 var paneHeight = doc.getElementsByTagName(
"html")[0].clientHeight;
1505 var loading = doc.getElementById(
"loading");
1506 loading.style.display =
"none";
1509 doc.getElementById(
"buttons").style.visibility =
"visible";
1511 var images = doc.getElementById(
"box");
1514 doc.getElementById(
"mask").style.height = paneHeight +
"px";
1515 doc.getElementById(
"mask").style.display =
"block";
1518 mashTape.photoFrame.contentWindow.addEventListener(
"resize",
function(e) {
1520 e.stopPropagation();
1522 var mTWindow = mashTape.photoFrame.contentWindow;
1524 var
nS5 = mTWindow.nS5;
1527 var frameWidth = doc.getElementsByTagName(
"html")[0].clientWidth;
1528 var frameHeight = doc.getElementsByTagName(
"html")[0].clientHeight;
1531 doc.getElementById(
"mask").style.height = frameHeight +
"px";
1532 var imageElements = images.getElementsByTagName(
"img");
1533 for (var i=0; i<imageElements.length; i++) {
1534 var img = imageElements[
i];
1536 var ratio = img.height / frameHeight;
1537 img.height = frameHeight;
1542 if (mTWindow.imageItems[i].small == img.src &&
1545 img.src = mTWindow.imageItems[
i].medium;
1550 if (typeof(nS5) ==
"undefined")
1552 var current = nS5.currentIndex;
1556 for (var i=current; i<imageElements.length; i++)
1557 mTWindow.imageItems[i].offset =
null;
1560 mTWindow.imageItems[0].offset = 0;
1561 for (var i=1; i<=current; i++) {
1562 var previousOffset = mTWindow.imageItems[i-1].offset;
1563 var currentOffset = previousOffset - imageElements[i-1].width;
1565 mTWindow.imageItems[
i].offset = currentOffset;
1569 mTWindow.nS5.gotoSlide(current);
1574 mashTape.photoFrame.contentWindow.imageItems =
new Array();
1578 mashTape.imageLoadCount = results.length;
1579 mashTape.imageResults = results;
1580 mashTape.photoStreamReady =
false;
1581 mashTape.photoStreamRunning =
false;
1582 for (var i=0; i<mashTape.imageLoadCount; i++) {
1583 var item = results[
i];
1584 var imgcontainer = doc.createElement(
"span");
1585 var img = doc.createElement(
"img");
1588 img.addEventListener(
"load", mashTape.imageLoadListener,
false);
1590 img.src = item.small;
1592 img.src = item.medium;
1593 img.setAttribute(
"mashTape-href", item.url);
1594 img.addEventListener(
"click",
function() {
1595 mashTape.photoFrame.contentWindow.mashTape_openLink(
1598 img.height = paneHeight;
1599 imgcontainer.appendChild(img);
1600 images.appendChild(imgcontainer);
1602 var title = item.title.replace(/
'/g, "\\'");
1603 var author = item.owner.replace(/'/g, "\\
'");
1604 var timestamp = item.time;
1605 mashTape.photoFrame.contentWindow.imageItems.push({
1608 authorUrl: item.ownerUrl,
1618 mashTape.imageLoadListener = function(e) {
1619 e.target.removeEventListener("load", mashTape.imageLoadListener, false);
1620 mashTape.imageLoadCount--;
1621 var doc = mashTape.photoFrame.contentWindow.document;
1623 if (mashTape.imageLoadCount > 0)
1626 // once we hit 0, we've
loaded all our initial batch of images
1630 var images = doc.getElementById(
"box");
1631 var paneHeight = doc.getElementsByTagName(
"html")[0].clientHeight;
1633 for (var i=
PHOTO_PRELOAD; i<mashTape.imageResults.length; i++) {
1634 var item = mashTape.imageResults[
i];
1635 var imgcontainer = doc.createElement(
"span");
1636 var img = doc.createElement(
"img");
1638 img.src = item.small;
1640 img.src = item.medium;
1641 img.setAttribute(
"mashTape-href", item.url);
1642 img.addEventListener(
"click",
function() {
1643 mashTape.photoFrame.contentWindow.mashTape_openLink(
1646 img.height = paneHeight;
1647 imgcontainer.appendChild(img);
1648 images.appendChild(imgcontainer);
1650 mashTape.photoFrame.contentWindow.imageItems.push({
1651 title: item.title.replace(/
'/g, "\\'"),
1652 author: item.owner.replace(/'/g, "\\
'"),
1653 authorUrl: item.ownerUrl,
1663 // if the Photos tab is currently focused, then start the photo stream
1664 // otherwise add a listener to delay triggering the photo stream until
1665 // the tab is in focus
1666 if (document.getElementById("mashTape-nav-radiogroup").selectedItem ==
1667 document.getElementById("mashTape-nav-tab-photo"))
1669 mashTape.photoFrame.contentWindow.mashTape_triggerPhotoStream(
1670 mashTape.photoFrame.contentWindow.imageItems, doc.width);
1672 mashTape.photoStreamReady = true;
1673 mashTape.photoStreamRunning = false;
1677 mashTape.playPausePhotoListener = function(inPhotoTab) {
1679 // switched to the photo tab, need to resume or start it
1680 if (!mashTape.photoStreamRunning) {
1681 mashTape.photoStreamRunning = true;
1682 var doc = mashTape.photoFrame.contentWindow.document;
1683 mashTape.photoFrame.contentWindow.mashTape_triggerPhotoStream(
1684 mashTape.photoFrame.contentWindow.imageItems, doc.width);
1686 var mTWindow = mashTape.photoFrame.contentWindow;
1687 mTWindow.nS5.playpause(mTWindow.nS5.interval, 'next');
1689 } else if (mashTape.selectedTab == "photo") {
1690 // previously selected tab was the photo tab, need to pause it
1691 var mTWindow = mashTape.photoFrame.contentWindow;
1692 mTWindow.nS5.playpause(mTWindow.nS5.interval, 'next');
1696 /****************************************************************************
1697 * FLASH PROVIDER FUNCTIONS
1698 ****************************************************************************/
1699 mashTape.resetFlashFrame = function() {
1700 // Reset the index frame contents
1701 var indexFrame = document.getElementById("mashTape-panel-flash-index");
1702 var detailFrame = document.getElementById("mashTape-panel-flash-detail");
1703 var doc = indexFrame.contentWindow.document;
1704 var body = doc.getElementsByTagName("body")[0];
1705 while (body.firstChild)
1706 body.removeChild(body.firstChild);
1708 doc = detailFrame.contentWindow.document;
1710 // Hide any existing content
1711 var content = doc.getElementById("actual-content");
1712 content.style.display = "none";
1714 // Collapse the splitter
1715 var splitter = document.getElementById("mashTape-panel-flash-splitter");
1716 splitter.setAttribute("state", "collapsed");
1718 // Put in the loading image for the detail frame
1719 var loading = doc.getElementById("loading");
1720 loading.style.display = "block";
1721 var paneHeight = doc.getElementsByTagName("html")[0].clientHeight;
1722 // 32 is the height of the load.gif
1723 loading.style.marginTop = (paneHeight-32)/2 + "px";
1726 mashTape.durationFromSeconds = function(seconds) {
1727 // Calculate the duration
1728 var minutes = parseInt(seconds / 60);
1729 seconds = seconds % 60;
1730 var hours = parseInt(minutes / 60);
1731 minutes = minutes % 60;
1734 if (parseInt(seconds) < 10)
1735 str = "0" + seconds.toString();
1736 if (minutes > 0 || hours > 0) {
1738 minutes = "0" + minutes.toString();
1739 str = minutes + ":" + str;
1741 str = hours.toString() + ":" + str;
1746 mashTape.loadFirstFlashFeed = function() {
1747 // only load if the loading is still showing (meaning the user hasn't
1749 var indexFrame = document.getElementById(
"mashTape-panel-flash-index");
1750 var detailFrame = document.getElementById(
"mashTape-panel-flash-detail");
1751 if (detailFrame.contentWindow.document
1752 .getElementById(
"loading").style.display ==
"block")
1754 var doc = indexFrame.contentWindow.document;
1755 var body = doc.getElementsByTagName(
"body")[0];
1757 if (body.getElementsByTagName(
"div").length <= 0) {
1758 mashTape.noDataTab(
"flash");
1761 var first = body.getElementsByTagName(
"div")[0];
1762 mashTape.loadFlashDetail(first);
1767 mashTape.loadFlashDetail =
function(el) {
1768 if (typeof(el) ==
"undefined")
1770 var title = el.getAttribute(
"mashTape-title");
1771 var time = el.getAttribute(
"mashTape-time");
1772 var url = el.getAttribute(
"mashTape-url");
1773 var favicon = el.getAttribute(
"mashTape-favicon");
1774 var swfUrl = el.getAttribute(
"mashTape-video");
1775 var description = el.getAttribute(
"mashTape-description");
1776 var author = el.getAttribute(
"mashTape-author");
1777 var authorUrl = el.getAttribute(
"mashTape-author-url");
1778 var
duration = el.getAttribute(
"mashTape-duration");
1779 var width = el.getAttribute(
"mashTape-width");
1780 var ratio = el.getAttribute(
"mashTape-ratio");
1781 var height = el.getAttribute(
"mashTape-height");
1782 var provider = el.getAttribute(
"mashTape-provider");
1784 if (el.hasAttribute(
"mashTape-flashvars"))
1785 flashVars = el.getAttribute(
"mashTape-flashvars");
1788 var indexFrame = document.getElementById(
"mashTape-panel-flash-index");
1789 var detailFrame = document.getElementById(
"mashTape-panel-flash-detail");
1790 var flashWindow = detailFrame.contentWindow;
1791 var doc = detailFrame.contentWindow.document;
1793 var script = doc.createElement(
"script");
1794 script.setAttribute(
"src",
"chrome://mashtape/content/iframe-flash.js");
1795 doc.body.appendChild(script);
1797 doc.setUserData(
"mashTapeRatio", ratio,
null);
1799 function openLink(e) {
1801 e.stopPropagation();
1803 while (target !=
null && !target.href) {
1804 target = target.parentNode;
1809 Components.classes[
'@mozilla.org/appshell/window-mediator;1']
1810 .getService(Components.interfaces.nsIWindowMediator)
1811 .getMostRecentWindow(
'Songbird:Main').gBrowser
1812 .loadOneTab(target.href);
1816 if (typeof(mashTape.flashListenerAdded) ==
"undefined") {
1817 flashWindow.addEventListener(
'click', openLink,
false);
1818 mashTape.flashListenerAdded =
true;
1821 var detailVideo = doc.getElementById(
"video");
1822 var detailFavicon = doc.getElementById(
"favicon");
1823 var detailFaviconLink = doc.getElementById(
"link");
1824 var detailTitle = doc.getElementById(
"title");
1825 var detailTime = doc.getElementById(
"time");
1826 var detailAuthor = doc.getElementById(
"author");
1827 var detailDescr = doc.getElementById(
"description");
1830 var loading = doc.getElementById(
"loading");
1831 loading.style.display =
"none";
1834 var actualContent = doc.getElementById(
"actual-content");
1835 actualContent.style.display =
"block";
1836 doc.getElementById(
"caption").href =
url;
1838 var containingDiv = el;
1839 if (mashTape.selectedFlash)
1840 mashTape.selectedFlash.className =
1841 mashTape.selectedFlash.className.replace(
"row-selected",
"");
1842 while (containingDiv.className.indexOf(
"row-") != 0)
1843 containingDiv = containingDiv.parentNode;
1844 containingDiv.className +=
" row-selected";
1845 mashTape.selectedFlash = containingDiv;
1848 while (detailTitle.firstChild)
1849 detailTitle.removeChild(detailTitle.firstChild);
1850 while (detailAuthor.firstChild)
1851 detailAuthor.removeChild(detailAuthor.firstChild);
1852 while (detailVideo.firstChild)
1853 detailVideo.removeChild(detailVideo.firstChild);
1856 var swf = doc.createElement(
"object");
1857 swf.setAttribute(
"data", swfUrl);
1859 mashTape.log(
"Loading movie from: " + swfUrl,
true);
1861 swf.setAttribute(
"type",
"application/x-shockwave-flash");
1862 swf.setAttribute(
"id",
"mTFlashObject");
1863 swf.setAttribute(
"name",
"mTFlashObject");
1864 swf.setAttribute(
"width", parseInt(width));
1865 swf.setAttribute(
"height", parseInt(height));
1866 if (el.hasAttribute(
"mashTape-flashvars"))
1867 swf.setAttribute(
"flashVars", flashVars);
1868 swf.setAttribute(
"mashTape-provider", provider);
1870 var param = doc.createElement(
"param");
1871 param.setAttribute(
"name",
"allowScriptAccess");
1872 param.setAttribute(
"value",
"always");
1873 swf.appendChild(param);
1875 param = doc.createElement(
"param");
1876 param.setAttribute(
"name",
"quality");
1877 param.setAttribute(
"value",
"high");
1878 swf.appendChild(param);
1880 param = doc.createElement(
"param");
1881 param.setAttribute(
"name",
"allowFullScreen");
1882 param.setAttribute(
"value",
"true");
1883 swf.appendChild(param);
1885 param = doc.createElement(
"param");
1886 param.setAttribute(
"name",
"bgcolor");
1887 param.setAttribute(
"value",
"#000000");
1888 swf.appendChild(param);
1890 detailVideo.appendChild(swf);
1893 var detailLink = doc.createElement(
"a");
1894 detailLink.href =
url;
1896 detailLink.innerHTML = title;
1897 detailTitle.appendChild(detailLink);
1900 detailFavicon.src = favicon;
1901 detailFavicon.setAttribute(
"title", mashTape.strings.formatStringFromName(
1902 "extensions.mashTape.msg.flash_tooltip", [provider], 1));
1903 detailFaviconLink.href =
url;
1905 detailTime.innerHTML = mashTape.durationFromSeconds(duration);
1908 detailAuthor.appendChild(doc.createTextNode(
1909 mashTape.strings.GetStringFromName(
"extensions.mashTape.msg.by") +
" "));
1910 var authorPage = doc.createElement(
"a");
1911 authorPage.href = authorUrl;
1912 authorPage.innerHTML = author;
1913 detailAuthor.appendChild(authorPage);
1916 var e = doc.createEvent(
"UIEvents");
1917 e.initUIEvent(
"resize",
true,
true,
window, 1);
1918 doc.dispatchEvent(e);
1924 mashTape.updateFlash =
function(provider, results) {
1925 if (results ==
null)
1928 var indexFrame = document.getElementById(
"mashTape-panel-flash-index");
1929 var doc = indexFrame.contentWindow.document;
1930 var body = doc.getElementsByTagName(
"body")[0];
1932 var favicon = provider.QueryInterface(
Ci.sbIMashTapeFlashProvider)
1934 for (var i=0; i<results.length; i++) {
1935 var entryDiv = doc.createElement(
"div");
1936 entryDiv.className =
"row-unselected";
1937 var video = results[
i];
1939 entryDiv.setAttribute(
"mashTape-title", video.title);
1940 entryDiv.setAttribute(
"mashTape-favicon", favicon);
1941 entryDiv.setAttribute(
"mashTape-time", video.time);
1942 entryDiv.setAttribute(
"mashTape-url", video.url);
1943 entryDiv.setAttribute(
"mashTape-video", video.swfUrl);
1944 entryDiv.setAttribute(
"mashTape-description", video.description);
1945 entryDiv.setAttribute(
"mashTape-author", video.author);
1946 entryDiv.setAttribute(
"mashTape-author-url", video.authorUrl);
1947 entryDiv.setAttribute(
"mashTape-duration", video.duration);
1948 entryDiv.setAttribute(
"mashTape-width", video.width);
1949 entryDiv.setAttribute(
"mashTape-ratio", video.ratio);
1950 entryDiv.setAttribute(
"mashTape-height", video.height);
1951 entryDiv.setAttribute(
"mashTape-provider", provider.providerName);
1953 if (video.flashVars)
1954 entryDiv.setAttribute(
"mashTape-flashvars", video.flashVars);
1955 entryDiv.addEventListener(
"click",
function(e) {
1956 var
node = e.target;
1957 while (!node.hasAttribute(
"mashTape-title"))
1958 node = node.parentNode;
1959 mashTape.loadFlashDetail(node);
1960 e.stopPropagation();
1964 var thumbLink = doc.createElement(
"span");
1965 var thumbImg = doc.createElement(
"img");
1966 thumbImg.className =
"thumbnail";
1967 thumbImg.src = results[
i].thumbnail;
1968 thumbImg.width =
"60";
1969 thumbLink.appendChild(thumbImg);
1970 entryDiv.appendChild(thumbLink);
1971 thumbImg.addEventListener(
"load",
function() {
1974 if (this.parentNode ==
null)
1976 var theDiv = this.parentNode.parentNode;
1978 if (theDiv.clientHeight-10 < theImg.clientHeight)
1979 theDiv.style.height = (theImg.clientHeight + 5) +
"px";
1982 var faviconImg = doc.createElement(
"img");
1983 faviconImg.className =
"favicon favicon-flash";
1984 faviconImg.src = favicon;
1985 faviconImg.setAttribute(
"title", provider.providerName);
1986 entryDiv.appendChild(faviconImg);
1988 var metadata = doc.createElement(
"div");
1989 metadata.className =
"metadata-flash";
1990 var link = doc.createElement(
"span");
1991 link.innerHTML = results[
i].title;
1992 metadata.appendChild(link);
1993 metadata.appendChild(doc.createElement(
"br"));
1995 if (results[i].time != 0) {
1996 var dateObj =
new Date(results[i].time);
1997 var dateSpan = doc.createElement(
"span");
1998 dateSpan.className =
"time";
1999 dateSpan.innerHTML = dateObj.ago();
2000 metadata.appendChild(dateSpan);
2003 entryDiv.appendChild(metadata);
2006 entryDiv.setAttribute(
"mashTape-timestamp", results[i].time);
2007 entryDiv.setAttribute(
"mashTape-title", results[i].title);
2008 var divs = body.getElementsByTagName(
"div");
2009 var inserted =
false;
2011 for (var j=0; j<divs.length; j++) {
2012 if (divs[j].
className.indexOf(
"row-") == -1)
2015 nextClass = Math.abs(nextClass-1);
2017 var otherTimestamp = divs[j].getAttribute(
"mashTape-timestamp");
2018 if (otherTimestamp < results[i].time && !inserted) {
2028 body.insertBefore(entryDiv, divs[j]);
2034 body.appendChild(entryDiv);
2043 mashTape.maximiseDisplayPane =
function(ev) {
2044 var flashSplitter = document.getElementById(
"mashTape-panel-flash-splitter");
2046 var mainDoc = Cc[
'@mozilla.org/appshell/window-mediator;1']
2047 .getService(
Ci.nsIWindowMediator).getMostRecentWindow(
'Songbird:Main')
2049 var dp = mashTape.displayPane;
2050 var splitterId = mashTape.displayPane.getAttribute(
"splitter");
2051 var dpSplitter = mainDoc.getElementById(splitterId);
2053 if (mashTape.expanded) {
2055 mashTape.expanded =
false;
2057 dp.setAttribute(
"flex", 0);
2060 flashSplitter.setAttribute(
"state",
"open");
2063 dpSplitter.setAttribute(
"collapse",
"after");
2064 dpSplitter.setAttribute(
"state",
"open");
2066 dp.height = mashTape.height;
2068 mashTape.displayPaneMaxButton.style.listStyleImage =
2069 "url('chrome://songbird/skin/display-pane/button-maximize.png')";
2072 mashTape.expanded =
true;
2074 mashTape.height = dp.height;
2076 dp.setAttribute(
"flex", 1);
2078 flashSplitter.setAttribute(
"state",
"collapsed");
2081 dpSplitter.setAttribute(
"collapse",
"before");
2082 dpSplitter.setAttribute(
"state",
"collapsed");
2084 mashTape.displayPaneMaxButton.style.listStyleImage =
2085 "url('chrome://songbird/skin/display-pane/button-restore.png')";
2090 mashTape.locationListener = {
2092 if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
2093 aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
2094 aIID.equals(Components.interfaces.nsISupports))
2096 throw Components.results.NS_NOINTERFACE;
2098 onStateChange:
function(aProgress, aRequest, aFlag, aStatus) {
return(0); },
2099 onLocationChange:
function(a, request,
url) {
2103 if (!
Application.prefs.getValue(
"extensions.mashTape.autohide",
false))
2107 if (url.spec ==
"chrome://songbird/content/mediapages/firstrun.xul")
2109 if (typeof(mashTape) ==
"undefined") {
2112 var mainDoc = Cc[
'@mozilla.org/appshell/window-mediator;1']
2113 .getService(
Ci.nsIWindowMediator)
2114 .getMostRecentWindow(
'Songbird:Main').window.document;
2115 var splitterId = mashTape.displayPane.getAttribute(
"splitter");
2116 var dpSplitter = mainDoc.getElementById(splitterId);
2118 if ((gBrowser.currentMediaListView &&
2119 gBrowser.selectedTab == gBrowser.mediaTab) ||
2120 url.spec.indexOf(
"chrome://shoutcast-radio/") == 0)
2123 if (mashTape.autoHidden) {
2124 mashTape.displayPane.collapsed =
false;
2125 mashTape.autoHidden =
false;
2129 if (!mashTape.displayPane.collapsed) {
2130 mashTape.displayPane.collapsed =
true;
2131 mashTape.autoHidden =
true;
2135 onProgressChange:
function() {
return 0;},
2136 onStatusChange:
function() {
return 0;},
2137 onSecurityChange:
function() {
return 0;},
2138 onLinkIconAvailable:
function() {
return 0;}
2143 mashTape.prefObserver = {
2145 if (subject instanceof Components.interfaces.nsIPrefBranch) {
2147 if (pref.length == 2 && pref[1] ==
"enabled") {
2149 var enabled = subject.getBoolPref(
data);
2152 tab = mashTape.infoTab;
2155 tab = mashTape.reviewTab;
2158 tab = mashTape.rssTab;
2161 tab = mashTape.photoTab;
2164 tab = mashTape.flashTab;
2168 tab.style.visibility =
"visible";
2169 #ifdef METRICS_ENABLED
2170 gMetrics.metricsInc(
"mashtape", pref[0],
"tab.enabled");
2172 mashTape.noDataTab(pref[0]);
2174 tab.style.visibility =
"collapse";
2175 #ifdef METRICS_ENABLED
2176 gMetrics.metricsInc(
"mashtape", pref[0],
"tab.disabled");
2180 mashTape.selectPane();
2182 }
else if (
data ==
"autohide") {
2183 #ifdef METRICS_ENABLED
2184 var enabled = subject.getBoolPref(
data);
2186 gMetrics.metricsInc(
"mashtape",
"autohide",
"enabled");
2188 gMetrics.metricsInc(
"mashtape",
"autohide",
"disabled");
2190 }
else if (
data ==
"defaultpane") {
2191 var which = subject.getCharPref(
data);
2192 #ifdef METRICS_ENABLED
2193 gMetrics.metricsInc(
"mashtape",
"defaultpane", which);
2195 mashTape.selectPane();
2196 }
else if (
data ==
"photo.speed") {
2197 mashTape.photoFrame.contentWindow.mashTape_updatePhotoStreamSpeed();
2203 window.addEventListener(
"DOMContentLoaded", mashTape.init,
false);
2204 window.addEventListener(
"unload", mashTape.unload,
false);
2206 mashTape.tooltip =
function(tipElement)
2209 if (tipElement.namespaceURI ==
2210 "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul")
2213 const XLinkNS =
"http://www.w3.org/1999/xlink";
2216 var titleText =
null;
2217 var XLinkTitleText =
null;
2218 var direction = tipElement.ownerDocument.dir;
2220 while (!titleText && !XLinkTitleText && tipElement) {
2221 if (tipElement.nodeType == Node.ELEMENT_NODE) {
2222 titleText = tipElement.getAttribute(
"title");
2223 XLinkTitleText = tipElement.getAttributeNS(
XLinkNS,
"title");
2224 var defView = tipElement.ownerDocument.defaultView;
2229 direction = defView.getComputedStyle(tipElement,
"")
2230 .getPropertyValue(
"direction");
2232 tipElement = tipElement.parentNode;
2235 var tipNode = document.getElementById(
"aHTMLTooltip");
2236 tipNode.style.direction = direction;
2238 for each (var
t in [titleText, XLinkTitleText]) {
2239 if (t && /\S/.
test(t)) {
2246 t = t.replace(/[\r\t]/g,
' ');
2247 t = t.replace(/\n/g,
'');
2249 tipNode.setAttribute(
"label", t);
nsString encodeURIComponent(const nsString &c)
dataSBHighestRatedArtists SBProperties rating
sbOSDControlService prototype className
function doc() browser.contentDocument
for(let i=0;i< aHistory.count;i++)
sbOSDControlService prototype QueryInterface
while((node=formNodes.iterateNext()))
var getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow('Songbird SBProperties artist
this _dialogInput val(dateText)
aWindow setTimeout(function(){_this.restoreHistory(aWindow, aTabs, aTabData, aIdMap);}, 0)
if(typeof(gMM)=="undefined") var gMM
return aWindow document documentElement getAttribute(aAttribute)||dimension
ContinuingWebProgressListener prototype onStateChange
_getSelectedPageStyle s i
sbDeviceFirmwareAutoCheckForUpdate prototype observe