Archive for the ‘Uncategorized’ Category

This blog has got a new home http://the-taylors.org/blog

After running my blog on wordpress for several years now I felt it was time to integrate it in to my website so this blog has now got a new home:

http://the-taylors.org/blog

I have just added a new article on how to add jsLint checking directly in Visual Studio

You can subscribe to the feed at:

http://feed.the-taylors.org

Thank you for reading and keeping in touch.

Dave

Slow DNS response: Firefox on localhost and Visual Studio/Cassini

This post has been moved to http://the-taylors.org/blog/2010/03/16/slow-dns-response-firefox-on-localhost-and-visual-studio-cassini/

Finally managed to release a beta for juxtapo

Phew, I’ve been working hard at getting unit tests done, bugs ironed out and docs written so that I can get a release of juxtapo out and now it’s here.

juxtapo is a personal project I’ve been working on which gives in browser overlays and previews for template building. It’s been so valuable to me in my day to day work that I thought I should share it out.

So take a look and let me know what you think.

Javascript development and deployment strategy – Part 1

Javascript development and deployment strategy – Part 1

With the popularity of JavaScript rising significantly the amount of code within one project has grown to the extent where it needs to be separated in to separate files unless you want to be scrolling through thousands of lines of code. Whether you do this per class or namespace is another debate but I have been thinking through how all these separate files might be combined appropriately and compressed at deployment.

I have decided to itemise what I would ideally want to achieve and maybe some thoughts on how i could do it.

  1. I want to be able to split code in to appropriate sections so that i can save them across multiple files.
    • this will make it easier to find code
    • this will make code more modular and help to debug
  2. I only want one script reference within the html file even at dev time
    • i don’t want to annoy the back end devs with the hassle of different versions of the html head area
    • i want to manage easily the order in which scripts are loaded and which scripts are grouped together.
    • i want the dev to mimic the live environment as closely as possible
  3. I want a system which is flexible enough to allow me to specify which scripts get combined on deployment
    • if there are sub sections to the code which change more frequently to others i don’t want the client to have to download the full whack when something small has changed
  4. I want this to be extremely painless to implement
    • pain is not that desirable to me

With these four requirements in mind I set about my strategy and have come up with this:

  1. a root file for each set which at dev time dynamically adds the linked files to the page
  2. You can have as many root files as you want and you only need to maintain one list of links within each root file.
  3. It only takes 3 very simple steps:
    1. copy and paste short section of standalone code in to a root file
    2. set the root file js name
    3. include a list of files which will be combined on deployment
In part 2 I will give a demonstration of this in action.

Folder sharing in Google Docs

Finally – Folder sharing in Google Docs

Amazing…thank you Google for adding folder sharing into Google docs!

This has been a long anticipated update, now when you are in a folder you can use the “Share this folder” dropdown to share all the items within it.

Sitecore Certified

I have just completed my sitecore 6 training and am now a sitecore certified developer.

I have been really impressed by the way that sitecore is structured. It does a very good job of separating content from presentation, giving the developer huge flexibility whilst retaining an easy to use interface for the user.

I also think the way they have designed the content and a lot of the core system around the same granualar concept of a content item is amazing.

It’ll be interesting to start using it in a real working environment to see where the weaknesses are. I’m especially curious as to whether it can maintain XHTML Strict in a .Net world where people only seem to care about Transitional.

A couple of example sitecore projects completed at Aqueduct include Manchester City Football Club.

If you’ve used sitecore let me know your thoughts.

Client XSL Transformations from Asp.Net Webservice Response

I wrote previously about how you can use jQuery to query Asp.Net WebServices. We are now going to build on that by using xslt to transform the xml returned from your web service and insert it in to your document.

Download the full script

We are going to need two further functions, the first to load your xslt file and the second to do the transform.

Remember not to crowd the root namespace so start by building upon our previous DT namespace:

DT.xml = {}

Then add the functions:


DT.xml.loadXMLDoc = function(fname) {
var xmlDoc;
// code for IE
if (window.ActiveXObject) {
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
xmlDoc.load(fname);
return (xmlDoc);
}
// code for Mozilla, Firefox, Opera, etc.
else if (window.XMLHttpRequest) {
xmlDoc = new window.XMLHttpRequest();
xmlDoc.open("GET", fname, false);
xmlDoc.send("");
return xmlDoc.responseXML;
}
else {
alert('Your browser cannot handle this script');
}
}

DT.xml.xslTransform = function(xml, xsl) {
// code for IE
if (window.ActiveXObject) {
ex = xml.transformNode(xsl);
return ex;
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation && document.implementation.createDocument) {
xsltProcessor = new XSLTProcessor();
xsltProcessor.importStylesheet(xsl);
resultDocument = xsltProcessor.transformToFragment(xml, document);
return resultDocument;
}
}

Now we can update the HelloWorld method to add the transformed html to the DOM. This needs to be run once the DOM has been loaded so you would either put this code within the jQuery ready event or a user inititiated event.


DT.wsCustom.HelloWorld(function(xData,textStatus){
xsl = DT.xml.loadXMLDoc("yourxsl.xslt");
doc = DT.xml.xslTransform(xData.responseXML,xsl);
$("#HelloWorldDiv").html(doc);
});

As you can see this is extremely simple but has the potential to completely revolutionise the way that you create web applications.

Aqueduct

I have just taken up a new position as Front End Web Developer at Aqueduct who are a creative agency based in Farringdon.

This means I should be able to have more of a focus on front end technologies.

More to come…

Clergy Shirts

Recently I have been working on a website which sells clergy shirts and clergy accessories which has been an strange experience trying to make dog collars and gowns look attractive. Not sure if I have achieved it but it has been fun.

I will say of the Lord

Est and I have finally got this recorded, it’s a bit ropey but we had fun. God is good!!