Hi Monty,

> The script seems to fail to get the correct window
> dimensions the first time it connects to an rss
> feed..  You will notice the second time you solicit
> the comic, the window re-sizes as desired...   I
> dont know how to fix it.. Everything I have tried
> has failed..  Maybe Shawn can lend some expertise.

It's because the image file for the actual comic is not yet in the
browser cache, so it doesn't know how big to make the window. I see
several options:

* Download the file yourself and present it to the client using a
local cache of your own. There's sample code for downloading binaries,
such as images, in themeinst.xml I posted a while back.

* Don't set the popup height/width until the image has 'real' height
and width properties available. This occurs when the image has been
cached.

* I was hoping the RSS feed provided the dimensions, but it doesn't.
:( Oh well, next best option is to fake it. You can assume that Sunday
comics will all be a certain size (h=515, w=725) and every other day
will be regular strip size (h=213, w=300). Set the height and width of
the img tag during import, something like...
 s = s.replace(/(<img)[\s]*/g,"<img width=600 height=213 ");
...then stuff it into the content.

Determining the date would have to be some funky evaluation of the
title string of the comic. Strip off the first two words then set the
date to a date object, getting the weekday off of that. Messy, but it
should work (as long as the RSS format doesn't change).

Regards,

Shawn K. Hall
http://ReliableAnswers.com/

'// ========================================================
    Well who says life is fair?  Where is that written?
    Life isn't always fair.
      -- 'Grandfather', The Princess Bride




-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
DQSD-Devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dqsd-devel

Reply via email to