An afternoon’s worth of code in three months.

Milestone i before the end of the month?

Posted: May 29th, 2009 | Author: | Filed under: Milestone i | Tags: , | No Comments »

It’s not unlikely.

1
2
3
4
5
6
var artistNames = this._mediaListView.getDistinctValuesForProperty(SBProperties.artistName);
while (artistNames.hasMore()) {
var someArtistName = document.createElement('label');
someArtistName.setAttribute('value',artistNames.getNext());
var mediaViewBox = document.getElementById("artistcloud-media-page-box"); mediaViewBox.appendChild(someArtistName);
}

Progress?? Impossible.

Posted: May 28th, 2009 | Author: | Filed under: Milestone i | Tags: , | No Comments »
1
2
3
4
5
6
for(var i=0;i<=10000;i++) {
  if(!this._mediaListView.getItemByIndex(i)) break;
  var randArtist = document.createElement('label');
  randArtist.setAttribute('value', this._mediaListView.getItemByIndex(i).getProperty(SBProperties.artistName));
  var mediaViewBox = document.getElementById("artistcloud-media-page-box"); mediaViewBox.appendChild(randArtist);
}

This code successfully lists all the artists in the current media list! Granted, they are heavily duplicated, because it lists the artist for each item in the list. And the Media View is not scrollable (probably need to set overflow: auto in some CSS?). And there is probably a much more efficient way to get this list. And it makes the media list itself disappear. And 10000 is a totally arbitrary number. But it’s something. (Is it obvious that I grew up on BASIC?)

How can I get a count of the number of items in this._mediaListView?


The First Feeble Steps

Posted: May 27th, 2009 | Author: | Filed under: Milestone i | Tags: , | No Comments »
1
2
3
var randArtist = document.createElement('label');
randArtist.setAttribute('value', this._mediaListView.getItemByIndex(287).getProperty(SBProperties.artistName));
var mediaViewBox = document.getElementById("artistcloud-media-page-box"); mediaViewBox.appendChild(randArtist);

I found this block of code that I created some time ago to perform the simple task of grabbing an artist name — any artist name — from the media library and displaying it in the Media View. It works, though I’m not quite sure how.

Also am taking a look at this article, since it seems able to get me closer to my first milestone.