Skip to content


BinaryKitten Presents…

I’d Like to (possibly Prematurely, but definitely Proudly) Announce that I’m going to be giving a 2 day workshop entitled HTML/CSS for Novices.
Continued…

Posted in Personal, Web Development.

Tagged with , , , , , , , .


Speaking at PHPNW10

Just a quick note as am really shocked and grateful to be speaking at this years PHP North West Conference in the UK.
I shall be presenting a talk entitled “Using Zend_Tool” which I hope that many people will find useful.

If you haven’t got your ticket yet, please do. The Conference is not only a great way to learn new things but it’s also a great place to socialise with your fellow developers.

I Hope to see you all there.

Posted in Personal.


Active Module Config V2

A brand new version of my previously Released Front controller plugin for Zend Framework.
Continued…

Posted in Zend Framework.


HTML5 Data attributes and jQuery’s .data – pairing made in heaven

I really like the idea of the data-* properties in the spec for HTML5, unfortunately they’re not supported directly by any browser it seems yet; even jQuery 1.4.2 doesn’t really support them (due to the non-browser support I guess).

Anyway, I really wanted to make use of them in an application I’ve been using and after reading John Resig’s (@jresig) post on the subject (http://ejohn.org/blog/html-5-data-attributes/) I set about adding a little snippet to extend jQuery’s .data so that it would support these parameters. So here is the small plugin that will extend the data function in jQuery to enable access to this functionality.

Enjoy

(function($){
    $.fn.extend({
        '_data': $.fn.data,
        'data' : function( key, value ) {
            if ( typeof key === "undefined" && this.length ) {
                return jQuery.data( this[0] );
            } else if ( typeof key === "object" ) {
                return this.each(function() {
                    jQuery.data( this, key );
                });
            }
            var retValue;
            retValue = $.fn._data(key, value);
            if ('undefined' == (typeof retValue) || retValue.length == 0) {
                var nakedElem = this.get(0);
                if (nakedElem.hasOwnProperty('dataset')) {
                    if ('undefined' != (typeof nakedElem.dataset[key])) {
                        retValue = nakedElem.dataset[key];
                    }
                } else {
                    retValue = this.attr('data-'+key);
                }
            }
            return retValue;
        }
    });
})(jQuery);

All comments are gratefully received :)

Posted in jQuery Plugins.


Plans

Recently i’ve been working on new bits and pieces for projects.. updating existing items and working towards having a nice base of extended components for both Zend Framework and jQuery.

On My Workbench at the moment is an update to the keyz jQuery plugin which adds all but the keychain functionality to the system. Also have been working on a multi page form component for Zend Framework.

Still working on working out the kinks in both before making a release.

Yesterday (May 4th — Star Wars Day .. lol) saw me sign the Zend Framwork Contributor License Agreement and send it off to Zend. Still no word as yet, but fingers crossed.

I’ve also bought myself an XBOX 360 (and a few games), you’ll find me on XBL as my usual nick.

Things seem to be going well at the moment, but only time will tell.

Posted in Personal.


Per form stylesheet with Zend_Form

I needed to have certain form styles attached when a form is in use. I didn’t want to do this from the controller each and every time as it was really was only to do with the form and I might want to use the form with it’s own stylesheet in other places.
Continued…

Posted in Zend Framework.


jQuery Keyz Plugin

The purpose of this plugin is to easily facilitate the end user to create and hook key presses for their own use. Usually you would need to know what key links with which keycode etc.

Usage

It’s as easy as these steps:

  1. Include jquery – either from CDN or local source
  2. Include jquery.keyz.js
  3. call the following within your document ready or after the item exists
$('selector').keyz({
"enter": function(ctl,sft,alt,event) {
alert('you pressed enter!');
}
});

this will hook the enter key and raise an alert when pressed.

If you want to cancel the key either return false from the function or set the value to false like so:

$('selector').keyz({
"enter": function(ctl,sft,alt,event) {
return false;
}
});

OR

$('selector').keyz({
"enter":false
});

You can either use the key names in singular or in a grouping like so:

$('selector').keyz({
"enter": function(ctl,sft,alt,event) {
/* single key */
return false;
},
"F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12": function(ctl,sft,alt,event) {
/* mapped to all F-Keys */
return false;
}
});

Download jquery.keyz.js here: Full Source && Google Closure Compiled version

Visit the demo page here: Full Source

Planned Features

  • support for keypress chains .. passing a sequence of keys and an event firing upon completion
  • support for all three key states – presently only triggers on key down – Added in 1.0.2
  • to add some duck punching to add the keyname to the event for the three standard events

Supported Keys

The keys listed below are the current ones supported by the plugin.
They also support the hyphenated name eg numpad-1 or in upper case like “F1″ or “f1″

  • enter
  • return
  • esc
  • escape
  • numerics
  • upper
  • lower
  • alphanumeric
  • tab
  • shift
  • alt
  • ctrl
  • f1
  • f2
  • f3
  • f4
  • f5
  • f6
  • f7
  • f8
  • f9
  • f10
  • f11
  • f12
  • caps
  • capslock
  • numlock
  • winflag
  • winkey
  • windows
  • scrolllock
  • left
  • up
  • right
  • down
  • volumeup
  • volumedown
  • menu
  • contextmenu
  • backspace
  • pause
  • break
  • pausebreak
  • pageup
  • pagedown
  • end
  • home
  • insert
  • del
  • delete
  • numpad0
  • numpad1
  • numpad2
  • numpad3
  • numpad4
  • numpad5
  • numpad6
  • numpad7
  • numpad8
  • numpad9
  • *
  • multiply
  • +
  • add
  • -
  • subtract
  • .
  • fullstop
  • decimal
  • /
  • divide
  • ;
  • semicolon

Posted in jQuery Plugins.

Tagged with , , , .


Integrating PHP CodeSniffer with Activestate Komodo Edit

I’ve recently been looking into standards of code and how they would apply to myself and my code. To enable this, I’ve recently installed PHP_CodeSniffer and for a few days been using this on the command line.. which by itself isn’t bad, though I really wanted to have something inside my editor of choice (happens to be Komodo Edit). Continued…

Posted in Web Development.

Tagged with , , , , , .


Word of the Day: “Spalooch”

Yep another delightful new word you can add to your dictionaries.
Today’s Buzzword of the day is:

Spalooch

This is the sound that comes when you spill a liquid over the edge of its container onto your clothes.

When it happens, you have been Spalooched..  it is accidental and you can’t spalooch someone.

Posted in Buzzword of the day, General.


Active Module Based Config with Zend Framework

I’ve recently taken to using Zend Framework for a project that I needed to bring up to date. I won’t go into the pros and cons of choosing a framework as there are many much more qualified people who have done a much better job of this subject than I would or could. So Instead I bring to you How I managed to get Active Module Based Configuration within Zend Framework.

The Problem

The Concept I wanted to achieve was to have unique Configuration based upon the module that was active. The Issue with this is that the Bootstrap files and the _init functions for ALL modules are called with no bias as to which module is active. Thus if you created a 3 modules wanted to make menu alterations in one, those alterations will be applied to all. I also wanted to have a a system where if i added extra modules i could just add extra functions to the bootstrap file and it would work in a similar way.

With this in mind, I set about trying to figure out the solution.
Continued…

Posted in Zend Framework.

Tagged with , , , , , , .



Get Adobe Flash playerPlugin by wpburn.com wordpress themes