It seems like the ABC is having some sort of an issue with media files: no new files have been added to the server, nor have podcast feeds been updated. The old media files are still there, but even in cases where the links to the files have been put on pages, the media files themselves aren’t available. Saturday’s programs were all updated (All In The Mind, By Design, Radio Eye and The Science Show, for instance), as was Ockham’s Razor at around lunchtime, but nothing since them has been. The feeds that should be there are: Background Briefing, National Interest, Rear Vision, Street Stories and The Night Air.
Ages ago, I wrote about how to (a) pass Pages through the Post template, and (b) use Smarty Tags in special Pages. I had an Archives page, that had a list of every Post I’d ever made. It’s getting kind of long, so I wrote a script that parses this list, and creates a structured list, dividing the posts up according to the month they were published. It then makes this list so that you can hide/show a whole month’s worth of posts in one go. In the Posts Template, I have the following lines:
You’ll notice a couple of strange comments, and what looks to be a closing all tag: these are because the Blogsome post editor kindly closes tags for me, even when they aren’t tags!
I spent hours last night working on this, and a fair bit of time today. I think I’ve got it pretty good, now. See my Templates page for an example. Now, instead of trying to get the data to appear immediately, which I could not do, I have four buttons that the user can select between the various template files, and it shows them in the <textarea> underneath.
<script type="text/javascript">varreq1=newXMLHttpRequest();req1.open("GET","/templates/index.html",true);req1.send("");varreq2=newXMLHttpRequest();req2.open("GET","/templates/post.html",true);req2.send("");varreq3=newXMLHttpRequest();req3.open("GET","/templates/comments.html",true);req3.send("");varreq4=newXMLHttpRequest();req4.open("GET","/templates/wp-layout.css",true);req4.send("");functionDisplay(text){document.getElementById('template').innerHTML=text;}</script><p>This is the current, up to date version of my conversion of Patricia Müller's Connections Template for Blogsome.</p><p>There are four files that Blogsome uses, you need to ensure that the correct data goes into each. Each one also has, by default some features enabled. There is commenting throughout that will enable you to disable that which you do not want.</p><p><aclass="button"onclick="Display(req1.responseText);">Main Page</a><aclass="button"onclick="Display(req2.responseText);">Post</a><aclass="button"onclick="Display(req3.responseText);">Comments</a><aclass="button"onclick="Display(req4.responseText);">Style Sheet</a></p><p><textareaid="template"wrap="off"style='width:95%;height:500px;'>Click on a button above to display the template contents.</textarea></p>
I probably could have saved the data to variables, and reused the XMLHttpRequest item, but then I would have had to find some way to wait for the response code, and that kept failing for me.
I bought Missing Sync for PalmOS - probably a bad decision as it’s not really that much better than the standard Palm Syncing software. Oh, it claims to be heaps better, but there are just too many things that don’t quite work right. For instance, it makes duplicate entries on my Palm of Read-Only calendars. I use but one of these, that has all of the Australian Public Holidays in it. However, I’ve stopped syncing, as by the end of a month I have 30 copies of each holiday in the database. Not cool. So, surely there’s a way (a-la iTunes/iPod syncing) to only choose some of the items. As it turns out, there is. If you select the Conduit (Events) and then Choose Settings…, you can choose to only sync selected calendars. Except you can’t get at anything other than the first 4 calendars. The scroll bar in this window is broken. Makes it pretty hard to deselect the ones you don’t want. I got around this by renaming my Holidays calendar to Aus Holidays, but I shouldn’t have to do this.
Now, I’m not talking here about using the “Show Source” feature of a Web Browser. Anyone worth even a quarter of a pinch of salt knows how to do that. What I’m trying to do is display the source of a web page as text/plain within another web page. This is so I can have a current version of my template available on a page of my blog. I’ve put a version up that I need to update, and I make so many changes to the template this is unsustainable.
Under Blogsome, the template files can be found in the /templates/ directory, and there are four of them: index.html, wp-layout.css, post.html and comments.html. Of these, only wp-layout.css is a plain text document, the rest are (naturally) text/html.
Now, HTML has a nice little feature called <object>, which should be able to display anything the browser can render. For example:
<object data="/templates/index.html"> </object>
Will display a rendering of the Main Page template. It looks somewhat ugly, since it’s not been pre-processed by the Smarty Templating engine, so is somewhat useless - it’s neither the source nor the full result:
This element also has an attribute that should allow you to choose the content type: codetype.
I fiddled around with this for about an hour or so last night, trying to get it to work. The DOM tells me it’s text/plain, but the browser won’t render it as such.
So, after much more rooting around, I finally figured out a way to get the source to display: use XMLHttpRequest() to grab the data, and DOM manipulation to put it into the required location. This is what my page looks like:
It’s not quite perfect: there are still some issues with the timings, but I’ll get there. At least it works, now. You may need to type javascript:Source() into the address bar to get it to work.
Don’t even get me started on the inanity of young people these days. The latest, and stupidest thing I just heard during an ad break in Video Hits (I despise their latest look, btw):
Get your personal Chinese symbol sent directly to your phone! Just SMS “c” plus your year of birth, for example 1980, to 19 XX XX.
This is just wrong on so many levels. For christ’s sake, every person born in the same year as you, which is probably most of your stupid little friends from school, has the same symbol as you. That’s hardly a personal symbol. Secondly, is the company seriously suggesting that it’s customers are so stupid as to require an example of what a year looks like? But then, these people will quite happily pay $4 to send a text message, and receive in return a sampled down version of a song on their mobile phone, rather than pay $1 to download it legally, and then use some simple software to convert it to a format suitable for use on said phone. And then probably only use it as their ringtone for about a week, before repeating the process.
I’ve got some serious JavaScript_age_ going on with my site: I sometimes wonder if it’s too much. One thing I have noticed is that on my iMac I get occasional “There is a script taking a long time to finish. Continue/Stop Script” errors, but never see these on the PC. I also don’t see them under IE/Win, the platform I am forced to use at work. I also get errors with Camino, but I’m not sure about Safari. I’ve gone into about:config, and changed dom.max_script_run_time from the default of 5 to 20, just to see if that makes a difference.
I had a standard Smarty function, {list_cats}, that under certain circumstances generates invalid XHTML. Specifically, when a feed_image is supplied, not alt tag is generated. This annoys me, as I have worked hard to make my template generate “nice” code. Smarty to the rescue. Whilst you cannot pass the results of a Smarty function through a Smarty filter, like replace, you can capture the results, and then pass this through the filter:
I have an Asides category, posts in which appear differently on my site. That’s all well and good, but I want these posts to appear normally if viewing the Asides category, or an individual Asides post. So, I need to be able to style stuff differently depending on a couple of factors. The most obvious method for this would be to have CSS changing if certain conditions are met. However, in practice this seems to be somewhat difficult. You cannot access the equivalent of a DOM tree in CSS. You can add new entries to a style description, but not find out much real information about the current styles. Approaching this from the other direction, however, looks to be more promising. Especially if you examine the code I use to style differently to begin with:
I’m not examining now the mechanics of how to change these styles, as that can be found in another post on my site: Styling Asides Differently. To remove the Aside class entry, I’ve restructured my post.html file to start with:
I have my Dock hidden, and aligned to the left of the screen. I don’t really use it for much other than a launcher, although I do have a couple of shortcuts to folders there as well. I tried to drag an image from a website into one of these folders. I can drag like this to the desktop, or any open window. Why can’t I do this to a folder Dock icon? This seems crazy!