Help - Search - Members - Calendar
Full Version: foo_httpcontrol
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
Pages: 1, 2, 3, 4, 5
oblikoamorale
I guess this is where the saga ends. I reached all the goals I aimed to, and the idea within its restraints pretty much exhausted itself. thank you all for the fun time I spent here, it was a very interesting experience. Peter's foobar architectural techniques is something unique and, why not, have the right to be called perfect :-)
CODE
    v0.66 20 Apr 2008
        add: previously browsed directory remembering;
        fix: and again, invisible consistency fixes;
Hamallainen
Thanks a lot for your work.
Much appreciated, really.

Chipicui
Yes!... Thank you very much for such a nice and useful plugin.
Cutter
Your plugin is impressive but is there a way to set the next song to be played?

Edit: sometimes the page is very slow to load after a song change even though the playlist is very short and I'm connected to localhost. Once I even got a 404 error. What may be the problem?
oblikoamorale
QUOTE(Cutter @ May 8 2008, 11:49) *

Your plugin is impressive but is there a way to set the next song to be played?

nope, I didn't even think in this direction as I don't need this feauture at all. what do you suggest?
QUOTE(Cutter @ May 8 2008, 11:49) *

Edit: sometimes the page is very slow to load after a song change even though the playlist is very short and I'm connected to localhost. Once I even got a 404 error. What may be the problem?

I've never encountered anything even remotely close to your problem. 404? weird, I didn't code this error response at all. please be more descriptive and perhaps we'll be able to pin-point the possible bug.
kanuac
Nice work. smile.gif
Thanks!
Cutter
QUOTE(oblikoamorale @ May 8 2008, 17:34) *

QUOTE(Cutter @ May 8 2008, 11:49) *

Your plugin is impressive but is there a way to set the next song to be played?

nope, I didn't even think in this direction as I don't need this feauture at all. what do you suggest?

There could be a checkbox next to each playlist item. Checking one box would add the corresponding item to the playback queue.
Or there could be a difference between single click and double-click. Double click would start playback, single click would just put the cursor on an item, just as the foobar interface behaves. If "Playback follows cursor" is enabled, the next song will be the highlighted one.
QUOTE(oblikoamorale @ May 8 2008, 17:34) *

QUOTE(Cutter @ May 8 2008, 11:49) *

Edit: sometimes the page is very slow to load after a song change even though the playlist is very short and I'm connected to localhost. Once I even got a 404 error. What may be the problem?

I've never encountered anything even remotely close to your problem. 404? weird, I didn't code this error response at all. please be more descriptive and perhaps we'll be able to pin-point the possible bug.

No, it was not a template error 404, it was just a message from my browser saying that the page is unavailable. Most of the time the pages load slowly or the loading freezes halfway. I'm not behind a proxy nor a firewall for local connections.
Tim Schuhmacher
First: oblikoamorale thanks for this component, I like it very much.

I also would like an option to enqueue tracks, but not by handling a double click. I use a smart phone and it doesn't no anything like double click. My idea is to add just an extra link (an 'e' or +) after the track and the delete sign. By clicking the webpage puts that specific track in the queue, and refreshes.
I don't care if enqueued files are visually indicated. But than you need cwb_hooks and maybe it is preferably better to be less dependant on other components?

Another small request of mine. Could you add an extra checkbox that disable automatic refreshing of the webpage? Again because I use my smart phone I have to pay for the bandwidth I use. Maybe it isn't much, but when I leave the page open and put the browser to the background it still consumes unnessesary data.

@Cutter: when you get a error, how large is the requested playlist?
oblikoamorale
QUOTE(Tim Schuhmacher @ May 11 2008, 02:43) *

I also would like an option to enqueue tracks, but not by handling a double click. I use a smart phone and it doesn't no anything like double click. My idea is to add just an extra link (an 'e' or +) after the track and the delete sign. By clicking the webpage puts that specific track in the queue, and refreshes.
I don't care if enqueued files are visually indicated. But than you need cwb_hooks and maybe it is preferably better to be less dependant on other components?

I'm thinking of a better way of implementing queue and cursor management controls. I don't want to add extra control buttons to playlist itself, as it is going to unneccessary increase of page size. and I'm removing the delete button from there.
I guess I'll end up with something like this: at first, user presses some button, choosing action (delete, queue, focus), then he clicks desired track in playlist.
QUOTE(Tim Schuhmacher @ May 11 2008, 02:43) *

Another small request of mine. Could you add an extra checkbox that disable automatic refreshing of the webpage? Again because I use my smart phone I have to pay for the bandwidth I use. Maybe it isn't much, but when I leave the page open and put the browser to the background it still consumes unnessesary data.

autorefresh can be turned off by fiddling with javascript in template, but I'll think what can be done.
QUOTE(Tim Schuhmacher @ May 11 2008, 02:43) *

@Cutter: when you get a error, how large is the requested playlist?

it doesn't seem like a matter of big playlist, it's something else. i have a test playlist consisting of 23 thousand tracks, and stress testing the plugin page with apache benchmark reveals no problems. no memory leaks, no handle leaks, nothing suspicious.
Hamallainen
QUOTE(oblikoamorale @ May 11 2008, 05:06) *
I'm thinking of a better way of implementing queue and cursor management controls. I don't want to add extra control buttons to playlist itself, as it is going to unnecessary increase of page size. and I'm removing the delete button from there.
I guess I'll end up with something like this: at first, user presses some button, choosing action (delete, queue, focus), then he clicks desired track in playlist.
Yes that would be great that way.
Like radio buttons or dropdown menu maybe for : play now, delete, enqueue (and dequeue?) and then just single click a track.
Also it would be nice if there was a way to see enqueued tracks and a way to set the default action between 'play now' and 'enqueue' (or something else)
Tim Schuhmacher
QUOTE(Hamallainen @ May 11 2008, 11:02) *

...
Also it would be nice if there was a way to see enqueued tracks...

That can be achieved by requesting the content of the queue playlist, so that funcionality is already present.

Oblikoamorale, your new idea of implementing queue and cursor management controls, does that mean extra refreshing of the webpage?

And would it be possible to come up with variations of [PLAYLIST]. So maybe [PLAYLIST_WITH_DELETE] and [PLAYLIST_WITH_ENQUEUE] etc? So that I has a user can 'create' my best configuration for the webpage? Or some options in the properties in foobar with checkboxes that represent the items to be included in the webpage? The last option is maybe more user friendly.
oblikoamorale
QUOTE(Tim Schuhmacher @ May 11 2008, 18:21) *

QUOTE(Hamallainen @ May 11 2008, 11:02) *

...
Also it would be nice if there was a way to see enqueued tracks...

That can be achieved by requesting the content of the queue playlist, so that funcionality is already present.

not quite right, queue information has to be requested separately. I'm still considering the best way of showing queue within the existing playlist without introducing any other (table) data. color highlighting might be a good compromise even although it introduces some problems, for example, when one track is queued several times.

QUOTE(Tim Schuhmacher @ May 11 2008, 18:21) *

Oblikoamorale, your new idea of implementing queue and cursor management controls, does that mean extra refreshing of the webpage?

one refresh per one action, that is the way it is designed.

QUOTE(Tim Schuhmacher @ May 11 2008, 18:21) *

And would it be possible to come up with variations of [PLAYLIST]. So maybe [PLAYLIST_WITH_DELETE] and [PLAYLIST_WITH_ENQUEUE] etc? So that I has a user can 'create' my best configuration for the webpage? Or some options in the properties in foobar with checkboxes that represent the items to be included in the webpage? The last option is maybe more user friendly.

the ultimate way to satisfy any end user wishes would be to transfer all web page playlist formatting to user end. what I mean is that template's javascript receives some sort of playlist data array, and generates the playlist section of the page by itself. I didn't benchmark this approach yet, but my guess it's going to be quite expensive, considering this stuff is being used on some mobile devices.
Tim Schuhmacher
QUOTE(oblikoamorale @ May 11 2008, 15:48) *

...
the ultimate way to satisfy any end user wishes would be to transfer all web page playlist formatting to user end. what I mean is that template's javascript receives some sort of playlist data array, and generates the playlist section of the page by itself. I didn't benchmark this approach yet, but my guess it's going to be quite expensive, considering this stuff is being used on some mobile devices.


Putting all available playlist information in the webpage is indeed data expensive. But you didn't respond to my alternative option, putting some options in the properties in foobar with checkboxes that represent the items to be included in the webpage.

But I very like your efford in making this component!
oblikoamorale
QUOTE(Tim Schuhmacher @ May 11 2008, 22:13) *

Putting all available playlist information in the webpage is indeed data expensive. But you didn't respond to my alternative option, putting some options in the properties in foobar with checkboxes that represent the items to be included in the webpage.


I feel that introducing checkboxes in this case is leading to unneccessary mess. I'd like to try and do these things in a more elegant way.
oblikoamorale
something like should be appropriate for most of the uses. almost untested though, so proceed with care.
CODE

    v0.68 12 May 2008
        add: playback enqueue/dequeue (LIFO) control, q/w hotkeys;
        add: playlist focus control, shift hotkey;
        add: playlist entry remove control, ctrl hotkey;
        add: configurable page autorefresh;
        fix: compacted control template JS;
        fix: invisible glitches;
Hamallainen
Nice, it all seems to work fine here. Thanks for the improvements
IMO it would be better if the dropdown action list could remember the last action.

QUOTE(oblikoamorale @ May 11 2008, 15:48) *
not quite right, queue information has to be requested separately. I'm still considering the best way of showing queue within the existing playlist without introducing any other (table) data. color highlighting might be a good compromise even although it introduces some problems, for example, when one track is queued several times.
Color highlighting is ok for me. I don't know if it's possible but maybe a tooltip showing the queue position(s) would be enough, at least for me.

QUOTE(Tim Schuhmacher @ May 11 2008, 18:21) *
That can be achieved by requesting the content of the queue playlist, so that functionality is already present.
I had not thought about it. Thanks for the tip.
oblikoamorale
QUOTE(Hamallainen @ May 12 2008, 02:26) *

Color highlighting is ok for me. I don't know if it's possible but maybe a tooltip showing the queue position(s) would be enough, at least for me.

I'm not exactly sure what do you mean, a way of indicating the playback progress within the queue?

QUOTE(Hamallainen @ May 12 2008, 02:26) *

QUOTE(Tim Schuhmacher @ May 11 2008, 18:21) *
That can be achieved by requesting the content of the queue playlist, so that functionality is already present.
I had not thought about it. Thanks for the tip.

ah, right. he meant foosion's playback queue plugin, didn't he?

to everyone: can you post screen shots or screen photos of plugin running on your pda or mobile phone or whatever exotic or not so exotic devices? or perhaps some of you modified the front end appearance or behaviour in one or another way, what is also quite interesting for me. I absolutely wouldn't mind seeing or reading the feedback. thanks smile.gif
Hamallainen
QUOTE(oblikoamorale @ May 12 2008, 07:10) *
QUOTE(Hamallainen @ May 12 2008, 02:26) *
Color highlighting is ok for me. I don't know if it's possible but maybe a tooltip showing the queue position(s) would be enough, at least for me.
I'm not exactly sure what do you mean, a way of indicating the playback progress within the queue?
Well not the playback progress in minutes/seconds, i was just talking about eventually showing the enqueued tracks position(s)/index(es) within the playback queue. But with Tim Schuhmacher's suggestion it's maybe not needed except it requires to install an extra component. In fact I was suggesting this because you said :
QUOTE(oblikoamorale @ May 11 2008, 15:48) *
I'm still considering the best way of showing queue within the existing playlist without introducing any other (table) data. color highlighting might be a good compromise even although it introduces some problems, for example, when one track is queued several times.
Gerrit
Hello,

I have been looking for a control like this, it does nearly everything I need. Except....

Let me explain, I use foobar2000 to play music on a laptop attached to an amplifier. my music collection is on a server and has a web interface for browsing etc. I also control the foobar player with my own web interface, pausing, volume up/down, this is now done with another plugin (control_server) and a custom soap/perl script.

There are two things that I am looking for:
a) instead of a complete webpage returned I only need a string with the track info/file name etc.
b) Volume Up and Volume Down instead of setting the volume to a certain percentage (I might have the control interface on screen on more than one machine.

While writing this I realized that I can use both controls to do what I need (Control_server cannot add tracks to the playlist)
Tim Schuhmacher
QUOTE(oblikoamorale @ May 12 2008, 07:10) *

...
to everyone: can you post screen shots or screen photos of plugin running on your pda or mobile phone or whatever exotic or not so exotic devices? or perhaps some of you modified the front end appearance or behaviour in one or another way, what is also quite interesting for me. I absolutely wouldn't mind seeing or reading the feedback. thanks smile.gif

I will try to make a picture of your component in action on my SonyEricsson w950i phone.

The new version works great, thankt for the autorefresh checkbox.

I do experience one problem. Maybe this problem did also exists in the previous version. I have a playlist with online radio streams. When listening to a stream the progress bar shows some strange behaviour.

For example:
http://media.kxradio.nl/winamp shows this 'KXradio 1:00 / 71582788:15 #'
this is not a problem, but with http://www.omroep.nl/live/radio3-breed.asx (so mslive streams) shows this 'NOS [Radio 3FM #01] Radio 3FM #'. So no time indication. The result is that with autorefresh checked the page keeps on refreshing as soon as it is loaded.

When you look in foobar the first stream has '?' for its duration and the second stream '0:00'. So could you add a check on the duration and handle accordingly with the progress indicator and the time indication in the playlist overview?
oblikoamorale
QUOTE(Hamallainen @ May 12 2008, 13:46) *

Well not the playback progress in minutes/seconds, i was just talking about eventually showing the enqueued tracks position(s)/index(es) within the playback queue.

I've thought of adding an additional playlist column with serial number of enqueued track within playback queue, but considered it as a minor thing. if you think it'll improve usability, I'll add it, no problem.
It's just me who didn't (and still doesn't) use queueing at all.

QUOTE(Gerrit @ May 12 2008, 16:22) *

There are two things that I am looking for:
a) instead of a complete webpage returned I only need a string with the track info/file name etc.
b) Volume Up and Volume Down instead of setting the volume to a certain percentage (I might have the control interface on screen on more than one machine.

first request is possible by changing the page template. take a look at its inside, it isn't complicated. volume control in this way is not possible at the moment, but again, there's no big deal to implement it (if it is needed).

QUOTE(Tim Schuhmacher @ May 12 2008, 17:41) *

I will try to make a picture of your component in action on my SonyEricsson w950i phone.

thanks, much appreciated.
QUOTE(Tim Schuhmacher @ May 12 2008, 17:41) *

I do experience one problem. Maybe this problem did also exists in the previous version. I have a playlist with online radio streams. When listening to a stream the progress bar shows some strange behaviour.
[...]

well, it is no surprise radiostreams cause some problems considering the fact they don't have any fixed length. I'll fix it (or try to, at least).
foo_peter

to everyone: can you post screen shots or screen photos of plugin running on your pda or mobile phone or whatever exotic or not so exotic devices? or perhaps some of you modified the front end appearance or behaviour in one or another way, what is also quite interesting for me. I absolutely wouldn't mind seeing or reading the feedback. thanks smile.gif
[/quote]


Photo (cover) would be splendid that searches I since I Foobar!

+1

foo_peter

Hamallainen
QUOTE(oblikoamorale @ May 12 2008, 17:05) *
I've thought of adding an additional playlist column with serial number of enqueued track within playback queue
yep that would be fine thanks
oblikoamorale
CODE

    v0.69 13 May 2008
        add: VolumeUp/VolumeDown by degree of percent in param1 commands;
        add: remembering of previously selected playlist action;
        add: display order of enqueued tracks;
        fix: playback queue glitches;
        fix: proper handling of unknown length tracks;
Hamallainen
perfect thanks
Cutter
Small request: currently the page refreshes automatically when a song is over and playback jumps to the next item. Fine. However it doesn't refresh if the user changes the playing song using the foobar interface.
Could the plugin send a refresh request each time someone changes the played item (let's say after a 5 seconds delay so the browser doesn't become crazy if I hit "Random" repeatedly)?
oblikoamorale
QUOTE(Cutter @ May 13 2008, 18:43) *

Small request: currently the page refreshes automatically when a song is over and playback jumps to the next item. Fine. However it doesn't refresh if the user changes the playing song using the foobar interface.
Could the plugin send a refresh request each time someone changes the played item (let's say after a 5 seconds delay so the browser doesn't become crazy if I hit "Random" repeatedly)?

communication between plugin and client page in plugin-to-page direction is not possible. things work only in opposite.
Cutter
What about an element within the webpage code wich would regularly check if the playing song has changed?
oblikoamorale
QUOTE(Cutter @ May 13 2008, 19:30) *

What about an element within the webpage code wich would regularly check if the playing song has changed?

it would require too much work with code redesign as I haven't been planning AJAX'y behaviour from the very start.
I agree that this kind of behaviour would definitely be cool, but considering the fact that the main idea behind this component consists of controlling foobar running on machine you don't want or don't have any alternative access to, it seems a little bit unnneded.
Cutter
Yeah it would be overkill for quite a little improvement after all.

Another suggestion: could we set the default behaviour of the "playlist action"? I would like it to be set on "Focus" by default and to stay that way when I click on an item (currently it switches back to "Start" everytime).
oblikoamorale
QUOTE(Cutter @ May 13 2008, 22:26) *

Another suggestion: could we set the default behaviour of the "playlist action"? I would like it to be set on "Focus" by default and to stay that way when I click on an item (currently it switches back to "Start" everytime).

replacing the line N 140 in control template file:
CODE

    act = [LAST_ACTION];

with
CODE

    act = 3;

would do the trick
Cutter
Thanks.
oblikoamorale
I've organised some kind of radio streaming jukebox on localnet, and in terms of privacy it seems convinient to have a certain list of visible directories in file browser instead of all hard drive.
CODE

    v0.70 17 May 2008
        fix: failed reading template files when foobar path contained non-ascii characters;
        add: default playlist action reverts to 'Start' after any non-playlist related action;
        add: display of playback queue length;
        add: restrictive list of directories allowed to browse;
Hancoque
A small feature request: I'd like to be able to show only files with extensions that foobar2000 supports. Right now I'm just hiding unsupported file types via CSS, but that only fools the average Joe as the file names are still visible in the HTML source.

And another small request: Could you make it possible to separate HTML, CSS and JavaScript into different files? That would make it much easier to maintain customizations to the code. Defining a subdirectory in the components directory that would behave like the root directory of a "normal" web server would be great as it would also allow graphics to be used or any other files.
oblikoamorale
QUOTE(Hancoque @ May 17 2008, 09:53) *

A small feature request: I'd like to be able to show only files with extensions that foobar2000 supports. Right now I'm just hiding unsupported file types via CSS, but that only fools the average Joe as the file names are still visible in the HTML source.

what exactly for do you need this, may I ask? it's just that this thing is intended for personal use where seeing non playable files in list means no harm, I think.
QUOTE(Hancoque @ May 17 2008, 09:53) *
And another small request: Could you make it possible to separate HTML, CSS and JavaScript into different files? That would make it much easier to maintain customizations to the code. Defining a subdirectory in the components directory that would behave like the root directory of a "normal" web server would be great as it would also allow graphics to be used or any other files.

I'm not motivated and/or interested in going this way. I suppose the better, reliable and much faster way of achieving desired functionality would be a combination of apache, php and foobar COM automation server plugin.
Hancoque
QUOTE(oblikoamorale @ May 17 2008, 13:28) *
what exactly for do you need this, may I ask? it's just that this thing is intended for personal use where seeing non playable files in list means no harm, I think.
In the distant past people had to bring their CDs to parties. In the not so distant past they brought their external hard drives. But now they can can access all their music without bringing anything. wink.gif I use this plugin in combination with the Icecast server and set foobar2000 to null output and thereby have a remote music jukebox. Though I use password protection I want to leave access open to the "public" after the authentication. But people should do nothing more then to browse my music files. They should definitely not be able to see all my hard drives' contents. And there are music files scattered all over three different drives, so I cannot just restrict access to some folders, or the list of allowed folders would be really long.

QUOTE(oblikoamorale @ May 17 2008, 13:28) *
I'm not motivated and/or interested in going this way. I suppose the better, reliable and much faster way of achieving desired functionality would be a combination of apache, php and foobar COM automation server plugin.
Well, all right.
oblikoamorale
QUOTE(Hancoque @ May 17 2008, 19:18) *

QUOTE(oblikoamorale @ May 17 2008, 13:28) *
what exactly for do you need this, may I ask? it's just that this thing is intended for personal use where seeing non playable files in list means no harm, I think.
In the distant past people had to bring their CDs to parties. In the not so distant past they brought their external hard drives. But now they can can access all their music without bringing anything. wink.gif I use this plugin in combination with the Icecast server and set foobar2000 to null output and thereby have a remote music jukebox. Though I use password protection I want to leave access open to the "public" after the authentication. But people should do nothing more then to browse my music files. They should definitely not be able to see all my hard drives' contents. And there are music files scattered all over three different drives, so I cannot just restrict access to some folders, or the list of allowed folders would be really long.

eheh, thanks, you've made me chuckle, and that's definitely good! and it's interesting to know someone else is using it as a remote jukebox as well.
I guess one more preferences checkbox hiding non-playable files wouldn't hurt. will do!
Hancoque
Thanks! smile.gif
Jorgo
What for, really? In the foobar Media Library you can already define folders and filemasks... wouldn't this be redundant?
oblikoamorale
probably because the media library access interface is not implemented? or perhaps not everybody is using media library?

Hancoque: I've reuploaded current version with non playable files filter.
thuneau
This is a very cool component. Thank you very much for making it.
Question 1. I can't see the volume up/down control you added in 0.69. (Firefox 2.0.0.14). How do I add it?
do I replace :
CODE
<select title="Volume level" onchange="pc('Volume',this.value);">[VOLUME_OPTION]</select>%&nbsp;


with

CODE
<select title="Volume Up" onchange="pc('Volume',this.value);">[VOLUME_OPTION]</select>%&nbsp;
<select title="Volume Down" onchange="pc('Volume',this.value);">[VOLUME_OPTION]</select>%&nbsp;


if yes, where do I set the % change per up/down?

Question 2. Could the htm template be skinned using Flash?

Thanks again.
Hancoque
QUOTE(oblikoamorale @ May 18 2008, 18:02) *
Hancoque: I've reuploaded current version with non playable files filter.
Great! Thanks again. smile.gif
oblikoamorale
QUOTE(thuneau @ May 18 2008, 23:07) *

This is a very cool component. Thank you very much for making it.
Question 1. I can't see the volume up/down control you added in 0.69. (Firefox 2.0.0.14). How do I add it?

it isn't included in the template as it is going to be needed only on rare occasions. to control volume in this way you'll probably want something like
CODE

<input name="VolumeUp" type="button" value="V_Up" onClick="pc(this.name, 20);">
<input name="VolumeDown" type="button" value="V_Down" onClick="pc(this.name, 20);">

where 20 is step in percents.
QUOTE(thuneau @ May 18 2008, 23:07) *

Question 2. Could the htm template be skinned using Flash?

I don't really know how flash works from inside, but I suppose yes, it could. although it would be somewhat hard, I think, as you'll need to parse the html within the flash.
oblikoamorale
it seems that programming a threaded micro-webserver is no big deal at all, and is fun.
although I still have no sound idea what it might be needed for, I've already found one use, to set a page favicon. and foobar stock icon loads perfectly fine in opera smile.gif

btw, latest version has one nice bug: it doesn't display root page in file browser if 'hide non-playables' checkbox is on. but I guess it's ok, as no one noticed it yet.
oblikoamorale
well, at least I can enjoy the favicon now smile.gif
CODE

    v0.71 21 May 2008
        add: multithreaded (restricted up to four simultaneous sessions)
             mini-web-server, able to serve any files from home directory.
             the following mime types are supported: css, gif, htm, html, ico,
             jpg, jpe, jpeg, js, png, xml.
        add: optional logging of remote ip addresses in console;
Hancoque
So, finally you did it. smile.gif

There is still a problem when trying to separate the JavaScript code from the HTML template, though. The JavaScript code contains markers that are not replaced by the actual code if they are not in the main template file. Also parsing linked JavaScript files would solve the problem.

I'm trying to rewrite the HTML templates to the XHTML 1.1 specification using valid code, but there's one thing I cannot fix in the template: The plugin dynamically inserts checked (for checkboxes) and selected (for drop-down menu options) into the code. XHTML disallows this. Instead checked="checked" and selected="selected" has to be used to produce valid code. What speaks against using XHTML for the templates in general?

If you are willing to convert the templates to valid XHTML, here are some hints to solve issues that break the application in XHTML mode:

1. JavaScript code should be enclosed this way:
QUOTE
//<![CDATA[
...
//]]>

2. The form element must not contain the attributes name and target. Remove the latter altogether and replace the former by id and use document.getElementById('cmd_form') instead of document.cmd_form.

3. The CSS styles width, height and left need to have units specified (like px), otherwise they are not applied if the document is treated as XHTML. Simply adding +"px" to the corresponding JavaScript statements solves the problem:
QUOTE
document.getElementById('np').style.width=Math.floor(np_width * t_sec / t_length)+"px";
QUOTE
height=getElementById("np").offsetHeight*2-2+"px";
left=getElementById("npd").offsetLeft+"px";

4. Write all HTML event handlers small (onload instead of onLoad for example).

Edit: I just finished my XHTML 1.1 compliant (and working) versions of the templates. You might want to take a look: foo_httpcontrol_data.zip

Edit (2): The server sends a charset called utf8. I think it has to be utf-8 instead. The XHTML validator complains that there's a charset mismatch.
Ritsl
QUOTE(Hancoque @ May 21 2008, 23:48) *

I'm trying to rewrite the HTML templates to the XHTML 1.1 specification using valid code, but there's one thing I cannot fix in the template: The plugin dynamically inserts checked (for checkboxes) and selected (for drop-down menu options) into the code. XHTML disallows this. Instead checked="checked" and selected="selected" has to be used to produce valid code. What speaks against using XHTML for the templates in general?

What speaks in favor? This is a subject on which holy wars have been fought smile.gif Let's not go there...

QUOTE
2. The form element must not contain the attributes name and target. Remove the latter altogether and replace the former by id and use document.getElementById('cmd_form') instead of document.cmd_form.

3. The CSS styles width, height and left need to have units specified (like px), otherwise they are not applied if the document is treated as XHTML.

This is good advice even for a HTML purist like me. It would also be nice to use a Doctype that doesn't trigger Quirks mode. But this is already in reach of the intrepid customizers. I should try if I can make use of Opera's support for WebForms 2 to create a nicer interface smile.gif

QUOTE
The server sends a charset called utf8. I think it has to be utf-8 instead. The XHTML validator complains that there's a charset mismatch.
Yes, that should be utf-8 indeed, though my browser has no trouble recognizing it as such.
soulruins
Great plugin! Thanks.

My optimization for iPhone:

IPB Image

Download: http://rapidshare.com/files/116779129/foo_...l_data.zip.html
oblikoamorale
soulruins: looks great! very thanks for posting the shot, appreciated.

to those who are concerned, here are the guidelines I think I should be keeping to make customization process transparent:
1. don't generate any html formatted data within the plugin at all. perhaps the pregenerated playl- and file browser lists should be left alive, but necessarily with optional possibility to retrieve raw data, to be formatted on user-side by means of js.
2. move every macro substitution into a single javascript file containing as much foobar state data as possible, in form of defined variables/arrays. therefore including this js into any html page makes the page able to display foobar state information in any form.

perhaps this is an obvious overkill and such heavy relying on js isn't a very bright idea, but this way looks like the only reasonable one to give the user full control of any visual appearance aspect.

any thoughts?
Hancoque
I think it's no problem to generate (X)HTML code in the plugin *if* the code stays absolutely neutral concerning (X)HTML standards and visual styles. For the case that code differs between HTML and XHTML there might be a checkbox in the plugin options page what to use. But I think it's sufficient to generally conform to XHTML because it has more future potential and can be seen as the successor of HTML 4 where things are more standardized and unified. Concerning visual styles only IDs and classes should be used (no direct formatting).

By the way: I found malformed HTML in the browser list. The first entry ([ .. ]) contains this code:
CODE
<tr colspan=4><td>...</td>
instead of this:
CODE
<tr><td colspan="4">...</td>
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.