[mythtv] [mythtv-users] ANN - Release of MythTV Web

Colin Guthrie mythtv at colin.guthr.ie
Mon Dec 18 01:01:20 UTC 2006


Steven Ellis wrote:
>> I've been looking for something like this for a while (primarily because
>> my LIRC interface is broken :().
> 
> Pleased to hear it.

You're happy my LIRC interface is broken..... well thanks /very/ much...
:p (hehe)

> True. I left the old files in for this release as i'm still merging some
> of the code contributions. The idea is eveyone should use backend.php now,
> with all of the core code removed from the gui html files.

Coolio.


> There are a lot of tweaks to fix IE bugs. If you have a submit image in IE
> it doesn't submit the value. Also there are some major tweaks to get the
> rollover button support working correctly in IE.

OK seems sensible. I just don't see *why* you need to use images at all.
For one it breaks when you don't use any style and although alt is
supplied for the text, Firefox at least doesn't show this when you
select "View -> Style -> No Style.

Personally I think the same can be acheived using normal submit buttons
and a huge, negative text-indent CSS value (e.g -1000em). This removes
the need for *any* javascript in the frontend at all which is presumably
"a good thing"(tm).

See the attached patch which makes this change (among other things).

I can't test in IE at the moment but it /should/ work.


>> I think what would help most however is an AJAX layer to prevent the
>> page reload. This should be fairly easy to bolt on with a post process
>> after the page has loaded so the whole thing will "just work" if the
>> browser can handle it, but fall back to the current normal form
>> submission if it can't. I'll work on this.
> 
> Might be interested if there is a reasonable fall back. Ideally we need to
> support a very basic web server, and most web browsers.

Yup. I can pretty much guarantee that I can write a javascript layer
that will not impact the HTML at all - just a simple call in "body
onload" plus the appropriate javascript code. It will traverse the DOM
looking for the nodes onto which to assign click handlers and thus
things will work very nicely in Javascript capable browser while giving
100% compatibility fallback for older/lower capability browsers.

>> I'll maybe play around a bit making some of the changes I think
>> appropriate and send you the patches back.... not sure if I'll really
>> have much time tho', so please don't hold your breath :p
> 
> No worries.

OK, just a summary of this patch.

remote.html:
 * Convert the images to be normal form submit buttons
 * Remove all javascript.

remote.css:
 * Cleaned up + removed duplicated definitions.
 * Converted the named classes for the graphic buttons to ids
 * Set the basic style for image buttons in the new class .img

backend.php:
 * Fix a few notices related to undefined indexes etc. by doing
defensive checks prior to access.
 * Converted the big if/else if to the more appropriate (IMO) "switch"
statement.
 * Use full tags (short tags will be dropped in future PHP versions and
default config is to have them turned off anyway)
 * Used // instead of # as comment marker but to be honest this isn't
needed at all and I don't really know why I did that!


I only tested the remote.html file, not remote-wide or PDA etc.

I only tested in FF 2.0 on Linux.

I believe IE /should/ work, but cannot test that right now.


Some future enhancements (IMO):

 * Rollovers: Rather than 3 images per button (or button type), combine
the images into 1 and set the offset on :hover and :active. This will
mean the images are pre-loaded and gives a more visually pleasing
experience rather than the current pause while the images are loaded for
the first time.
 * AJAX javascript interface to make the use nicer in capable browsers.

I'll probably play with the AJAX soon.

Let me know if you like these changes and if there is anything else I
can do!


I appreciate some of my changes are stylistic so feel free to say what
you prefer etc. and I'll try and stick to that, and appologies in
advance if the trivial changes annoy you. I have a habit of correcting
PHP to fit strict coding standards at work as I have to peer review it
quite a bit and I end up doing quite a lot of such "changes" and it's
almost second nature now.... find it hard to stop sometimes!!

See ya

Col.

-- 

+------------------------+
|     Colin Guthrie      |
+------------------------+
| myth(at)colin.guthr.ie |
| http://colin.guthr.ie/ |
+------------------------+
-------------- next part --------------
A non-text attachment was scrubbed...
Name: changes.diff
Type: text/x-patch
Size: 19738 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20061218/65f933da/attachment.bin 


More information about the mythtv-dev mailing list