Archive for August, 2006

Aug 29 2006

FAlbum & Lightbox Bug Fix

Published by under PHP

I’ve updated the latest version of my FAlbum with LightboxJS2 mashup in order to fix a bug that was brought to my attention by Martin. The error caused lightbox to fail to load when viewing the individual photo page. I have not bothered to update the version number as neither FAlbum nor WP-Lightbox versions have been updated.

THe fixed version can be downloaded from here (falbum-lightbox-preload-0.6.6.zip) or my downloads page.

Credit goes to:

31 responses so far

Aug 24 2006

Opening Moo.box From Javascript

Published by under Programming

In my previous article on the moo.box I showed you how to close the lightbox using javscript, rather than using the link method given in the Moo.box documentation.

This time I’m looking at how to open the lightbox using javascript rather than using the method given in the documentation. This again relies on creating an instance of the moo.box in the same way as in the previous artivle:

var myMoobox;
window.onload=function() {
myMoobox = new moobox({
closeText: "Want to close this? Click here",
ajaxLayout: "<div id='ajax'>%CONTENT%</div>",
imageLayout: "<img src='%SRC%' title='%TITLE%'/>"
});
}

Once you have created an instance of the moo.box you will be able to call the doEvent() code on it. Unlike in the last article, in order to open the moo.box we need to pass in an event “open”, a url to open to opened in the moo.box and a title.

Exampple:
<a href="javascript:myMoobox.doEvent('open','http://www.example.com','Example Lightbox');">Test moobox link</a>

Another example (as asked for in the Moo.fx forums) for opening on an ajax request completion:
new ajax('postbackUrl', {update:$('someid'), onComplete:myFunction});
function myFunction(request){
myMoobox.doEvent('open','http://www.example.com','Example Lightbox');
}

Thats all there is to it. If you wish you can also call the insert event, passing in the same arguments as for open, which will load the new url into the open moo.box without closing the moo.box.

No responses yet

Aug 21 2006

Ringing Round-up

Published by under Bell Ringing

I realised today that I haven’t posted much about bell ringing recently, which is one thing that II promised myself I would do when I started. So, seeing as I passed another milestone in my progress yesterday I thought I’d but post an update.

My last post was about my first quarter peal of Bob Doubles which was back in January. It seems that I have progessed quite a bit since then. I’m not sure about the dates (I need to check up in the tower records and make a note of it) but I’ve rung a quarter peal of Bob Doubles on the trebble (just plain hunting), I’ve also rung a quarter peal of Plain Bob Major on the trebble (also plain hunting) which was also only the third occasion that I’d tried ringing Plain Bob Major on the treble, which was kind of a shock for me but I managed to make it through somehow.

So yesterday was the first time that I rang a quarter peal of Plain Bob Doubles on the 2 (inside). I have previously been very nervous, and therefore made mistakes, when doing Bobs however yesterday it all seemed to come together. I did have a couple of slight hiccups along the way, and towards the end I was finding it difficult to consentrate on what work I had just done and what I should be doing next. Whilst we were ringing I felt that I could have rung it a little quicker but as it turns out we finished in 42 minutes which, apparently, is quite quick for a 21cwt tenor.

I’ve also had a go at Plain Bob Triples last Friday at St Peters. It wasn’t anywhere near as hard as I thought it was going to be and, appart from missing all the dodges, I managed to keep my place through two courses which most people seemed to be quite impressed with.

I’m also going to taken the opportunity to post a link to Fortran Friends. They have very kindly posted some ringing diagrams on their site which I have found to be very useful. Each ony only takes a side of A4 paper when printed, but contains all the information you need to ring the method such as the order of work, where you pass the treble, blue line diagrams for each start and what you do when a bob/single is called. Unfortunately they’ve only produced them for six methods, luckily they’re the methods I’ll be learning next:
http://fortran.orpheusweb.co.uk/Bells/Diagrams/IndPDF.htm.

2 responses so far

Aug 16 2006

More Flexibility From Moo.Box

Published by under General

I’ve been working on a website with a phrixus for some time now and have been making it nice and “Web 2.0″ey with the addition of ajax content, lightboxes and sliding panels. I’m sure there’ll be some DailyWTF code in there by the digital bucket full.

Any way, what I’m blogging about is that I have finally, after about an hour of hacking, figured out how to close the lightbox that we’re using and call another javascript function with one link. The lightbox we’re using is Moo.Box and is the best I found that can display ajaxed content and is based on the Moo.fx platform which we were already using.

The documentation for Moo.box is very light on the ground and the only method given for initialising the lightbox is by calling the following code:
window.onload=function() {
new moobox({
closeText: "Want to close this? Click here",
ajaxLayout: "<div id='ajax'>%CONTENT%</div>",
imageLayout: "<img src='%SRC%' title='%TITLE%'/>"
});
}

and the only method given for closing the lightbox with a link is by including the following in the content to be displayed in the lightbox:
<a href="#" class="moobox" rel="close">Close box</a>

If you try adding javascript into the href of the link it will not be called when the link is clicked and if you add an onClick event to the link the lightbox will not be called. I tried a miriad of ways I could think of to close or hide the lightbox through javascript but they all failed. Then, whilst trying to get something else working I noticed the piece of code used to load the Moo.fx accordion effect and thought I would give it a whirl.

Instead of using the given method of loading the Moo.box I used the following:
var myMoobox;
window.onload=function() {
myMoobox = new moobox({
closeText: "Want to close this? Click here",
ajaxLayout: "<div id='ajax'>%CONTENT%</div>",
imageLayout: "<img src='%SRC%' title='%TITLE%'/>"
});
}

What this code does is give you a persistent handle to the Moo.box object that is created. As a result you can call all of the functions that are defined in the Moo.box. From digging around in the source code for Moo.box I found that the function I need is doEvent(). An example of how to use this new found functionality could be as follows:
<a href="javascript:myMoobox.doEvent('close','','');someOtherFunction();">Close box</a>

Notice that the class="moobox" and rel="close" have both gone. Note that the new link will close the lightbox before calling the other function.

Now, back to coding :)

One response so far

Aug 14 2006

FAlbum Lightbox with Pre-load

Published by under PHP

I’ve finally gotten around to updating my FAlbum lightbox mashup. This version adds a feature that several people have been asking for… pre-loading images so that users don’t click on them before the lightbox is loaded. I can’t take all the credit for this one, in fact I can probably take very little. All the ground work was done by Matthew Litherland and it appeared on his blog first.

I have also fixed a bug that has been in FAlbum for a while (I will be submitting a patch soon) which only allowed the default style to be selected in the Admin Options panel. You can now add more themes as you see fit. To celebrate this fix I have included a free style, for your use and abuse, called hemingway… after the name of the theme I’m using on this blog by Kyle Neath.

There is a slight bug when using IE to view the thumbnails, in that the image overlay doesn’t sit in the top left (as it should). This is because IE doesn’t play nicely with CSS as it works correctly with both Firefox and Opera. If anyone has a fix for this please send it over and I’ll be sure to credit you in the next release.

I’ve now stopped providing just the diff files as it was a right royal pain sorting them out and as I’m now including a modified wp-lightbox2 plugin – for the flickr link and image pre-loading – its a whole lot easier to bundle the whole lot together.

The new mashup can be download from here or my downloads page.

13 responses so far

Aug 09 2006

Environment NewLine Warning

Published by under .NET

I just found a site (via dotnetkicks.com) that is advocating the use of Environment.NewLine.

I would agree that it is good to go with the use of Environment.NewLine as it adds an extra layer of platform independance, i.e. you don’t need to worry about whether to use \r\n or just \n, and you don’t need to worry so much about what happens when you port the code from one .Net language to another. It isn’t however the answer to all problems.

Environment.NewLine only answers the problem of new line on the machine that it is running on. Where you may still run into problem is when you create a file using Environment.NewLine and then move the file to another platform. This is an age old problem and I don’t have a solution for it, just that you should be under no illusion that Environment.NewLine will solve this problem.

No responses yet

Aug 03 2006

Digimap Google Earth

Published by under Guernsey News

Digimap LogoThe Google Earth layer for Guernsey that I created has finally been updated a bit. This update just adds a couple of extra images and straightens up a couple of the existing ones. I’ve also added a new layer that contains a network link to the layer, if you use this new network link you will always get the latest version of the Guernsey layer as I update it.

I’ve been meaning to blog about Google Earth, Guernsey and Digimap for a couple of weeks now – yes I have seen you Digimap guys visiting my site! What I wanted to blog about was a mysterious meeting I had at the Digimap offices. A while back I was contacted (via a third party) by Digimap and was asked if you want to go for a meeting with them. No information was given as to what the meeting was about so, like the curious person I am, I went along.

Not knowing whether I was going to get a rollicking for using thier images, a job offer (for my great work on the Google Earth layer ;)) or some other reason I was, understandably, rather aprehensive. In the end it turn out to be them wanting to get to know the person behind the Google Earth layer and also a bit of a PR excercise… if I’m writing about Digimap they want to make sure that I know that they’re the good guys.

A couple of interesting points did come up in the meeting however:

  • Digimap is (I think) a subsidiary of the States of Guernsey but has to be completely self funding, therefore they need to sell the data in order to cover the cost of collection the data – no open source mapping in Guernsey using Digimap data then!
  • Digimap has contacted Google and Navteq offering Guernsey data but both turned down the offer saying they had sufficient coverage of Guernsey to not need new data.
  • Google Earth is soon going to have 60cm (IIRC) images of Guernsey – lets hope half the island isn’t going to be covered by cloud again!
  • Digimap try to do as much imagineering as possible – again this si contrained by the need to be self-funding.
  • Digimap will continue to monitor this blog for new ideas for them to try.
  • I can continue with the Google Earth layer using their images.
  • If I was I can host their images stitched together on my site for better alignment in Google Earth (I have written conscent).
  • If I wish they will try to provide better images for me to host for my Google Earth layer.

3 responses so far

Aug 03 2006

GrinGod.com DNA Profile

Published by under Bookmarks

gringod.com dna profileI found a cool site (via Makezine and Digg) that generates a DNA styled profile for a given url. Whilst its not terribly easy to understand what it means, it apparently show how the site is constructed, old style messy HTML or new style clean XHTML, and also about the content, whether it contains mostly text or if there is lots of images and flash.

The site seems to be down at the moment, which is not surprising as it is probably being link to quite heavily having made it onto the Makezine and Digg.

No responses yet