If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
I’ve managed to get some stuff done over this weekend, for the first time in many moons. Feels good! Ignoring tweaks and bug-fixes, this has been my longest drought on Renaissance work in a while.
So on what have I been working?
Well, for a long time, Renaissance has had a fairly decent JavaScript framework for the back end. It’s become messy as it’s grown over the years and it’s not nearly as mature or consistent as the PHP, but that will be remedied when everything gets moved over to the new version of our in-house JavaScript library (the Late Night web library—soon to be released as open source).
Unfortunately, the same cannot be said for the front end. Admittedly, there doesn’t need to be a lot of JavaScript here—every site built with Renaissance is very different and therefore each has very different needs from it’s front-end code (if it needs any at all).
That said, there are commonalities, and a small collection of functions has accrued over time. I also find myself writing suspiciously similar JavaScript for different web sites, especially where form handling is concerned. This is clearly not a good thing.
So, to cut an increasingly long story short, I’ve started work on a JavaScript framework for the front end of Renaissance based sites, which ties in directly with code written by the PHP. I’ve been working on a common use-case, which is requesting content using AJAX.
So, we have a global object defining the framework:
and within that, our object for working with content:
The fun continues with the methods so far:
RenFront.Content.fetch(…);
RenFront.Content.closeContent(…); //customisable
RenFront.Content.onUpdate(…); //customisable
So, that little lot, combined with the right view, allows a user to create a link for fetching new content via AJAX without writing any code, entirely through Renaissance’s interface, and optionally add a link to the new content for closing it again (useful for a JavaScript image pop-up, for example). The two customisable methods allow the site’s designer to create different loading and unloading effects (e.g. fading) or trigger other events.
Anyway, pretty simple stuff so far, as I said! I’m quite pleased with it though. My plan with it, combined with our JavaScript library, is to provide quite a comprehensive set of tools for the front end.
The JavaScript is really Adeline’s department though, so you might be hearing more from her about it soon!
No related posts.
{ 1 comment… read it below or add one }
Adeline 11.11.08 at 1:49 am
Heya,
That’s great. I was so tired the other night when you were asking me about the Ajax issue that it didn’t really click what you were up to. It’s good you’re working on this though.