What's been happening?

April 19th, 2008

Posted at 12:00am by Stan

When Ruby came onto the scene there was a change of philosophy in shared code. Ruby, in my opinion, really helped to pioneer the idea of a fully developed framework for rapid application development. Rails is the one-stop resource for web development in Ruby, hands down. Before Ruby, the language all others looked up to was Perl and it's idea of shared code is CPAN. If you know CPAN, it's a mess - great console access, but there's no consistency amongst code, documentation is at your leisure and at times there are almost too many options.

Meanwhile, in the background is Java, which just kind of does its own thing in this area, like it always does... suffering from shared code packages and frameworks and everything in between. PHP hasn't been original in this field, for the better perhaps. Originally the big thing was PEAR, which was PHP's solution to CPAN but fixing some of the obvious flaws with CPAN (Note, the originality to this problem for PHP really lies in the PEAR-folks efforts to unify a shared code repository). Lately, though, it's been frameworks! Have you seen, Symfony, Cake, The Zend Framework or Solar?

[ read more ]

April 15th, 2008

Posted at 12:00am by Stan

The Higher Things website uses a really cool jQuery plugin called Superfish for it's black navigational bar. I first stumbled across this plugin while dealing with an animation problem for a home-grown implementation when we were redesigning the site. Rather then re-invent the wheel I decided to just use Superfish. One of the things that I was never really keen on was the lack of an animation to close the menu when, it just disappears as opposed to when it appears it slides in to view.

As a result I've modified superfish for HT's website and thought I would share the hack here for anyone else interesting in getting superfish to animate when a menu item closes.

First, we need to change some options around, we're going to remove the "defaults" for "animation" and replace it with the following (this should be at line 20):

animationOpen : {opacity:'show'}, animationClose : {opacity:'hide'},

Second, around line 78 we need to change how the method responsible for hiding a superfish menu functions, replace the "hideSuperfishUl" and "showSuperfishUl" method with this one:

hideSuperfishUl : function(){ var o = $.superfish.op, $ul = $('li.'+o.hoverClass,this).add(this); $ul.find('>ul').animate(o.animationClose, o.speed, function() { $(this).css('visibility','hidden'); $ul.removeClass(o.hoverClass); o.onBeforeShow.call($ul); }); return this; }, showSuperfishUl : function(){ var o = $.superfish.op, $ul = this.addClass(o.hoverClass) .find('>ul:hidden').css('visibility','visible'); o.onBeforeShow.call($ul); $ul.animate(o.animationOpen,o.speed,function(){ o.onShow.call(this); }); return this; }

That's it! I set the above defaults following the release to use opacity for animating, however on HT's we use { height: 'show' } and { height: 'hide' } respectively for the animations. You'll note in the hide method we added an animation and then after that animation has finished executing, in a call back we remove the hover class and call the closing callback. In the show method all we did was change the name of the animation property to be used, since we now have two.

April 12th, 2008

Posted at 12:00am by Stan

Mac users usually have the best software options in the computing world. For example, iTunes is the cutting edge online music solution, or VMWare Fusion and Parallels which both put their sister Linux & Windows solutions to shame, and if you're a biblical scholar you know the BibleWorks just doesn't have anything on Accordance. One are, though, where the Mac is sorely lacking is in financial software. There are a variety of options, but each leave something to be desired in terms of features, functionality, interface and bank integration. Quicken's own product for the Mac is nothing short of insulting, but that's exactly what I've been using for the last three years.

I moved to Quicken because the Windows product was nothing short of amazing. While I have the option of running Quicken for Windows in a VM, that's just not me. I use my VM's for development and testing and that's it! I'm not one of those guys who keeps Windows running 24/7 in Unity mode. In the last couple of months I've endured just about every headache imaginable in terms of integrating with PNC Bank and then data loss. Ask my wife how happy I am when I lose a week's worth of transactions in the QuickEntry widget. This is all to say nothing of the fact that Quicken is a Rosetta-based Mac app, which means it's slow. Just not satisfactory, and I've been looking for alternatives to no avail.

[ read more ]

March 29th, 2008

Posted at 12:00am by Stan

Earlier today I release jGrowl 1.0.2 on the jQuery plugin page, and I also uploaded the release locally as well. This release is bundled into a zip file and contained within it is a demo page and an accompanying stylesheet. There are some pretty substantial changes in this release, including...

  • Styling is now done externally, not inline.
  • Messages can have an optional "theme" passed in, which defines secondary classes to be applied to messages. This allows for messages to be themed on a per-message basis.
  • Animation speed can be customized.
  • The global closer can be disabled.
  • Added an optional callback to the global closer.
  • Added an optional open and close callback to the individual notifications.
  • Customize the life of a message on a per-message basis.
  • jGrowl automatically starts itself up with the first message.
  • When there are no messages jGrowl will automatically shut itself down.
  • ...fixed various bugs in 1.0.1.

Overall this release is quite a bit better then the previous one. If you have any ideas for future features, or if you discover any bugs please feel free to contact me.

The new release can be downloaded at: http://stanlemon.net/files/jgrowl-1.0.2.zip

March 23rd, 2008

Posted at 6:47pm by Stan

About a mont ago at one of my contract jobs we had a discussion about the Prototype design pattern and mixins. The discussion took place around javascript, which is by language construct a prototyped language. For those who don't know about the Prototype design pattern let me quote from the Gang-of-Four, "Specify the kinds of objects to create using a prototypical instance, and create new objects by coping this prototype." Or, Wikipedia, "Prototype-based programming is a style of object-oriented programming in which classes are not present, and behavior reuse (known as inheritance in class-based languages) is performed via a process of cloning existing objects that serve as prototypes. This model can also be known as class-less, prototype-oriented or instance-based programming."

[ read more ]

tags: patterns, php

March 22nd, 2008

Posted at 2:24pm by Stan

Those who know me by the work I did on sanctus.org are probably wondering where the progress on the re-write I mentioned back in February. Well, today I committed a little more source code for the project and updated my own projects page to include a link to the Google Code project page. This is where I am keeping the source code for the library I have been developing. Currently, the base loader and a set of calculators are there, the calculators determine how a particular lectionary behaves, ie. Historic, Michelmas, Three Year, etc. These calculators are supposed to determine the current Sunday of the Church year based upon a PHP DateTime object.

The library is far from complete, the calculators return a number correlating to the Sunday of the year - but right now you have no way of knowing what that Sunday of the year is. My next step is to develop a Sunday object with mapping, and setup a way so that the particular Sunday object in use can be changed and thus alternative mappings become available for different calculators.

As for sanctus.org, it's revival is based upon this library's completion. So, this is progress. It's taking me so long because, as I've said before, I'm no longer a full-time student with lots of free time, and between my commitments to work and my family I have very little spare time these days. It really stinks to grow up! If you're really anxious to get sanctus.org back up you either need to be patient, or you can always consider a PayPal donation - which does help development.

Stay tuned...

tags: lectionary, php

March 22nd, 2008

Posted at 12:03am by Stan

I just setup jQuery Templates and jGrowl in the jQuery plugin repository, and then I added them on my own projects page. I'll try and keep the plugin page's release piece up to date as I make modifications, and I also promise to do my best in following up on any bugs reported.

March 21st, 2008

Posted at 10:59pm by Stan

I just uploaded a new copy of jQuery templates with a fix for $.fn.text() and $.fn.html(), I was not passing the options object in correctly (silly mistake) and thanks to Chris Jaure, if you were using either of these methods to simply return a value they now work correctly as well.

jQuery Templates available at: http://stanlemon.net/files/jquery.template.js

March 20th, 2008

Posted at 11:36pm by Stan

Growl

Back in November I wanted a mechanism to communicate messages after an ajax request to my PageSite users. I experimented with a number of things and initially had a terribly ugly manipulation of the green and red message boxes you'll see on this type from time to time. There were a couple of big problems though, first the code was originally written for Prototype so it sucked, and second it was not very portable. Ultimately I wanted something that looked good, was well written and could be reused in a number of different ways.

When PageSite was converted to using jQuery for all of its javascript I rehashed a lot of stuff. There was some old javascript code that had been floating around since 2004 when I first prototyped out PageSite 4.0's admin panel. To cut to the chase... I stumbled across Humanized Messages, which was close to what I wanted to do, but not yet there. This plugin got me to thinking, though, what I'd really like is something that looked like Growl. For those not on OS X, take a look at the website and you'll see that Growl is a system-wide notification system.

As a result, while Erich was out here visiting I fleshed out an initial concept. I called it jGrowl, spinning off of the OS X solution. It's pretty simple to use out of the box:

// Normal notification $.jGrowl("Here is my message!"); // Sticky notification $.jGrowl("This message is stuck!", { sticky: true });

Today I sat down and cleaned up some of the plugin, namely I removed a dependency on the metadata plugin in favor of $.fn.data() and I also namespaced all of the events, which should allow you to attach other events to the jGrowl nodes and deal with them without jGrowl unbinding them on you.

The plugin still needs some work, I'm not sure how much I like styling it with javascript - at the same rate, I like the idea of styling different notifications differently as well. I'd also like to see some callback options, the animations customizable and I'd like to potentially add some internal sorting using the "header" option. These things, though, will come in time - for now I just want to get the plugin out so I can get some feedback.

Updated 03/24/08: The plugin is available at: http://stanlemon.net/files/jgrowl-1.0.2.zip, please let me know what you think!

March 20th, 2008

Posted at 12:27pm by Stan

As I continue to get feedback on the jQuery Templates plugin I've ported from Ext I'm trying to implement the suggestions I've received. Subsequently, I've uploaded another round (or two) of changes. The changes I've made are:

  • Moved the $template object to $.template.instance, so that the object can be access from the jQuery object and extended easily - what was I thinking before??
  • Renamed the "re" property to "regx", and this is now an object containing several different regular expression options (jsp, jtemplates and ext for starters).
  • You can now change the standard regular expression by setting $.template.regx.standard = $.template.regx.myregexp;
  • Templates can utilize custom regular expressions on a per-template basis, ie. var t = $.template("<div>...</div>", { regx: 'ext' });
  • In addition to the methods that use domManip() I've updated html() and text() to handle receiving jQuery Templates as well.

I hope to add some kind of callback to the plugin as well, so that you can specify a method to be called after a template has been created or applied. I'm still thinking this through and will post more once I implement it.

[1]      «    1    |    2    |    3    »    [3]
Powered by BlogSCL3 0.3.0alpha