November 2005

You are currently browsing the monthly archive for November 2005.

Rikki has been chipping away at me for months now about a relatively new OS X text editor called “TextMate“.

I’m a long time BBEdit user. I’ve used it ever since version 5 and I’ve never coded anything in any other text editor - so it was always going to be an uphill struggle to get me to switch. BBEdit is comfortable and feels totally natural. I don’t have to think about the interface, my mouse finds its own way around.

Rikki was selling me on many of TextMate’s features, including the “snippets” editor. This allows you to define “snippets” of text that are activated either via a hot key or via a keyword followed by a tab. TextMate comes with hundreds of pre-defined snippets, many for PHP. Not only can you define snippets of text, you can also use TextMate’s tagging system to allow you to tab through the result to change data.

For example:
You type: “array” then hit tab. It adds “$arrayName = array( ‘var’, );” to the document with ‘arrayName’ highlighted. You type in your desired variable name, hit tab and it moves to “var”, change that and hit tab and it moves to the comma, allowing you to delete it or to add more elements to the array.

I finally got around to trying out TextMate today and I’m sold. I’ve purchased a license and retired BBEdit. There are so many time-saving features: from the project display which allows you to list all your project files as a drawer (a common feature to IDEs but lacking in BBEdit) to being able to create your own snippets (I have created one where you type “ips” and hit tab and it adds “$this->ipsclass->” into the document and a few for comments, functions, etc). You can also create commands which can run bash / perl scripts. I have one that takes the highlighted text and runs it as a query on my test IP.D database.

It’s also very, very quick unlike most IDEs I’ve tried. There is no lag when typing and apart from a few seconds for the syntax colouring to kick in when loading a new document (you are free to edit and move around the document while it thinks about the colours, it doesn’t lock up the computer) everthing is instant.

I took a quick movie capture of it in use. Notice how the mouse doesn’t move until I double click on ‘require’ to show off the “Get Document for Word” feature (I set that to F3). The function block illustrates the ability to tab through the snippet elements. Sorry about the dodgy quality and the dark gray banding across the first fifth of the window.

If you’ve got OS X, go buy it now. If you’ve not got OS X, buy a Mac first. It’s almost a killer app.

TextMate.mov ( 2.5mb Quicktime .mov(ie) )

IP.Dynamic Again

I feel that I often start with “Work continues on IP.Dynamic…” so I’ll skip that bit and dive straight into what’s new.

I’ve all-but-finished the Articles manager. The articles manager rather unsurprisingly allows one to manage articles. Articles are contained in a hierarchical format (what’s the buzz-word of the day, ‘taxonomy’?). Articles are contained in article categories (which can be children of other categories) and article categories are contained in an article group.

So, for example, you can create a group called “Knowledge Base” and populate it with articles. Another group could be called “Matt’s Blog”. Each article group exports a ‘default view’ component tag (available via the ‘Insert Special’ menu). This default view shows the articles in the classic knowledge base format of a list of categories which, when clicked, show the category’s child categories and articles.

The really cool thing is that you can also create custom views. You can filter by category, creation / updated date as well as meta-data such as article title, content, etc. You can apply a template to handle the output and export it as a tag. IP.Dynamic will come with a few of these custom views already set up. On my test site I have a view set up as a blog, complete with Permalinks and links to comments. This gives great power over your articles and this single component is capable of providing content for your FAQs, KBs, news and blogs.

I’ve finished tweaking the skin, too. We’re thinking of posting a dev update after the weekend which will contain screenshots and some short movies of the really nifty stuff.

’till then…

Another day and another phising attempt landed in my inbox this morning.

Like millions of Christmas shoppers, I’ve recently ordered a few things from Amazon, so imagine my surprise when I receive an email telling me my account has been suspended pending termination.

A brief flicker of panic settled when I read the “From” email address: Amazon.com@epud.net

The email naturally asks me to click a link and enter my Amazon username and password so they can re-instate my account. Obviously you’d need to be all kinds of stupid to actually do that based on the say-so of an email anyway.

Dear Amazon member,

We regret to inform you that your Amazon account was been suspended for a period of 3-4 days,after that it will be terminated.
During our regularly schedule account maintenance and verification we have detected a slight error in your billing information on file with Amazon.
This might be due to either following reasons:

- A recent change in your personal information (i.e. change of address)
- Submitting invalid information during the initial sign up process.
- An inability to accurately verify your selected option of payment due an internal error within processors.

The link leads to: http://mynewestblog.com/exec/obidos/subst/index.html - although in the HTML email, it’s in a href tag which masks the actual URL.

Let’s hope that others take a moment before entering their details.

Improved HTML Logic

Work continues on IP.Dynamic at a good speed. The make-over is almost complete and everyone agrees that it’s looking good. I’ve finished the bulk of the page options including a “Proxy Options” tab that allows one to set a page as an alias of another (secret redirect while retaining the same URL), to redirect to another URL or to pass off to a custom module for pre-compilation and post-compilation processing (great extensibility right there).

There are rumblings around the web of the term ‘Ajax’ falling out of favour with the uber-geeks now that the media has raced in, coined the term ‘Web 2.0′ proclaimed it to be the best thing since ‘Web 1.0′ and subsequently disappeared in a trail of vapour after the next big thing. Ajax and Web 2.0 do seem to be pointless words that only exist in corporate presentations (”Our new AJAX enabled product is right at the cutting edge of the Web 2.0″) and the machinations of be-suited media types.

The other danger of “Ajax” (hey, lets call it Document Object Model Synchronous Information Transfer).. the other danger of “DOMSIT” is that suddenly there is an influx of “AJAX” feature requests from the inane to the banal. You know we’re heading the wrong way down a path when people are creating problems for an existing technology instead of creating technology to take care of existing problems.

I like Ajax/HTTPXMLRequest/DOMSIT and it does solve many genuine problems, for example: I wanted to allow one to create or edit a menu entry for a page while editing a page. In other words, while editing a page I wanted the user to be able to click a “Menu Options” tab and edit that pages entry in the menu. The problem with this is that IP.Dynamic allows multiple menu groups and allows multiple entries tied to a single page. I could load all the menu group data and all the menu item data at run time, populate a javascript array and filter select boxes based on the user’s choices. This would work, but it would create a potentially huge HTML page.
Aja.. DOMSIT makes this easier by simply asking the user which menu group they wish to modify (ping the server for that menu group’s list), then ask which menu entry of those linked to that page you wish to modify (ping back to the server for that menu item’s data) and finally present the form for editing.
A much neater solution.

AJAX digression aside, this entry was meant to be about the improved HTML logic handling in IP.Dynamic and IPB 3.0. So here we go.

I’ve finished the new template engine for IP.Dynamic which will also be used for IPB 3.0. The new template engine allows embedded IF logic and also FOREACH blocks. This is going to be a great template bit saver for IPB - I think we can cut the number of templates down by half, at least. It also means that in IPD I can have a single template for an article’s view (more about that later) rather than assinging multiple template bits. Needless to say, it’ll make things much easier on template editors.

Here’s an example of the what the new template engine can handle:

<if=”$data[’_in_parent’]”>
<if=”$data[’_this_parent’]”>
<foreach=”$data[’test’] as $me”>
<if=”$me != ‘you’>
<b>{$me}</b></div>
</if>
<div></foreach>
<div class=’nav-parent-selected’ style=’font-weight:bold;margin-left:{$data[’_depth’]}px’>
<else />
<div class=’nav-parent-selected’ style=’margin-left:{$data[’_depth’]}px’>
</if>
<else />
<div class=’nav-parent’ style=’margin-left:{$data[’_depth’]}px’>
</if>
<if=”$data[’menu_item_url’]”>
<a href=”{$data[’_real_url’]}” title=”{$data[’menu_item_alt’]}”>{$data[’_menu_item_title’]}</a>
<else />
{$data[’menu_item_title’]}
</if>
</div>
<div>

It still caches to PHP files in the same way too, making it just as quick as the current template engine.

So I was faced with either writing the AJAX menu selection system located in the “Menu” tab of the page content editor which interfaces with the Dynamic menu system to make it easier to add the current page to the menu, or start the IPD make-over.

The make-over won out. It’s nice to use the creative part of my brain after frying the logic side with pure coding over the past few months.

A while ago Rikki came up with a pretty cool new look for our IPS products, with an extra twist for IP.Nexus. Josh has taken this template design and started working it into Nexus. Now, the Nexus navigation is pretty unique because there are context sensitive options for certain pages. I’m not going to go into detail as I’m sure Josh would rather talk about that in a different blog at a different time. Needless to say, the new design wasn’t ideal for the IPD navigational structure.

With that in mind, I’ve created a very close proximation of the new design which cleans up IP.Dynamic and makes it feel much more open and less cluttered. Gone are the murky reds and grays and in comes… some new colours.

I’ve also written a new OOP javascript class to handle form ‘button’ generation. This new class accepts a DIV id name and turns it into a button. This means that IP.Dynamic administrators / editors must have javascript enabled to use IP.Dynamic but I think that’s acceptable. IP.Dynamic is a feature rich application and I don’t think a good interface can be created without the use of some client-side scripting.

It’s about now that I would post a screenshot and invite comment - but I’m not going to do this just yet. The reason being that we’re close to the first public beta test and I want to keep the interface under wraps until then.

It’s nice, though. Trust me.

I’ve spent most of the morning cleaning up some javascript classes to finish off IP Dynamic’s menu feature(s) and to try and find out why Firefox is freaking out when I load up the page content form.

To make the form cleaner, I’ve introduced a tabbed form concept which (via correctly marking up the HTML and using my tab-factory javascript class) allows the form to be broken up into different tabs.

This was going perfectly well until I stumbled across a rather odd javascript / Firefox bug. I’m using Firefox 1.5 RC 1 mainly because of the ability to re-order tabs and cleaned up dialogue boxes. Overall it’s a great release, but there are a few oddities (and it’s to be expected as it is only a release candidate).

One of these oddities has to do with Mozilla’s Midas engine (enableDesignMode) and changing the “display” attribute of a parent DIV after designMode has been enabled. The result is hard to explain, so here’s a little movie.

The fix was fairly straightforward (wrap the form with a DIV that has “display:block” set) but finding out what was the problem has cost me a morning.

IPD Gone Bad 132k Quicktime .Mov(ie)

About Me

Me
I'm a web developer (PHP / MySQL / DOM) based in the UK. I am the co-founder and C.S.A of Invision Power Services, Inc.

Last.fm Chart

XBox Live

Spam Monitor