E-com DevBlog Spider-ball-vacuum

24Nov/081

Going Beyond Macros…kind of

As the QA guy I'm always looking for tools to automate my testing to make things easier and quicker (not too mention easier to spot problems).  My first macro tool was iMAcros for firefox which has to be the coolest thing since sliced bread.  Then Drew found Xenu which was like another heaven sent goodie for finding errors and stuff.  And of course we have always been using a web checking service to monitor for downtime and the like.

Well, last month I found a pretty powerful tool in order to do all that stuff.  I just needed to build it.  The tool is called Autoit v3.  To quote from their website:

AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying "runtimes" required!

After learning how to manipulate windows and create a few COM objects I've come up with a tool that I've already used to check the links and search for errors on the sites.  So here it is for beta testing and criticism, the Link-O Matic website checker.

it's configurable, supports a proxy,  searches for a string on a site's page, has customizable error reporting, and even email alerts.  And it even plays the tada wav upon completion.

Missing is documentation so if you have questions you'll have to ask and I have yet to create a GUI so the only feedback it gives is a tray popup box which can be kind of annoying.

Print This Post Print This Post
19Nov/082

Web Developer Training – jQuery

And now for our quarterly Web Developer Training (because monthly just wasn't happening).  This quarters training is on the infamous (and my personal favorite js framework) jQuery.  After recieving some requests for a training session on it, I finally got one put together and hope that it benefits everyone in some way.  Also this training is sampling my new training template (not that the old team awesome template wasn't good enough, it just... well it wasn't as cool as this one ;) ) If you have any questions etc. throw them in the comments.  Enjoy!

Web Developer Training - jQuery

Print This Post Print This Post
6Nov/080

Brillar Resurrected and perfected.

Remember long ago when Sid, and Remo and I (and Bryce but he probably doesn't remember this cuz he is in infernal apps) started and there was this javascript function called Brillar? Well nobody seemed to understand the brillar function but we had to use it over and over again for image swapping, and I was just getting to the point that I almost knew how to use it without cheating. But then Phil killed it with jQuery and we have all partied since.

WELL THE PARTY IS OVER! Recently I've needed to do a rollover effect on some Input images and wasn't sure exactly how to do it with jQuery, come to think of it I am not sure how to do much with jQuery, so I turned back the clock and resurrected the Brillar function. only now it's hotter, better, more dynamic smaller and yes hotter. In fact it's so hot Phil and I renamed it to "BrillarCaliente".

Now instead of passing Two or three (can't remember for sure but it was a lot) parameters in your onmouseover/onmouseout calls, you only need to pass one.

?View Code HTML4STRICT
onmouseover="javascript:BrillarCaliente(this);" onmouseout="javascript:BrillarCaliente(this);"

The rest is in the Javascript function, thus making it easier to change what images/path's are to be used.

?View Code JAVASCRIPT
<script type="text/javascript">
function BrillarCaliente(image){
	var hostpath = '<c:out value="${standardUrlPrefix}${jspStoreImgDir}" escapeXml="true" />';
	var id = image.id;
	var source = document.getElementById(id).src;
	if(source == hostpath+'sml-addcart.gif'){
		document.getElementById(id).src = hostpath+'sml-addcart-on.gif';
	} else {
		document.getElementById(id).src = hostpath+'sml-addcart.gif';
	}
}
</script>

Ok so maybe it's not perfect but it's whole lot better than it was. The only thing I don't love is that I had to set up the "id" var in order to set up the "source" var, if there is a way around it I'd love to know.

Now for those of you who are reformists and love jQuery, I'm quite confident that this is doable in jQ with about 3 lines of code. Either way is better than what we used to do.

Alternativley if you wanted to make this more dynamic you could do the following:

?View Code HTML4STRICT
onmouseover="javascript:BrillarCaliente(this, 'newimage.jpg');" onmouseout="javascript:BrillarCaliente(this, 'oldimage.jpg');"
?View Code JAVASCRIPT
<script type="text/javascript">
function BrillarCaliente(image, swapImage){
	var hostpath = '<c:out value="${standardUrlPrefix}${jspStoreImgDir}" escapeXml="true" />';
	var id = image.id;
	var source = document.getElementById(id).src;
	if(source == hostpath+'sml-addcart.gif'){
		document.getElementById(id).src = hostpath+swapImage;
	} else {
		document.getElementById(id).src = hostpath+swapImage;
	}
}
</script>

note the extra param passed through to the function, I haven't actually tested it but it should work.

Print This Post Print This Post
1Nov/081

Unhide the “X” when displaying flash in fancybox

If it ever strikes your fancy to use FancyBox to display consoles or other flash content, you may run into a problem with the close button not displaying properly.

To correct this problem, you will need to add the line "so.addParam("wmode", "transparent");" to the
ProductNumber.html file, as shown below:

?View Code HTML4STRICT
<script type="text/javascript">
	// <![CDATA[
	var so = new SWFObject("console.swf", "console", "533", "531", "8");
	so.addVariable("xmlloc", "data/console.html");
	so.addVariable("product", "ProForm 450 Elliptical");
	so.addParam("wmode", "transparent");
	so.addVariable("image", "images/PFEL03907.jpg");
	so.write("flashcontent");
	// ]]>
</script>

This allows the flash content to show the button properly.

I discovered this after visiting the website of the providers of our SWFObject.js script: http://blog.deconcept.com/swfobject/"

Print This Post Print This Post