geansai gorm

Archive for the 'kfm' Category

That time of year again, kiddies! KFM 1.2 has been released. This is the last KFM version (apart from bug-fixes on the 1.2.x tree) which will have support for PHP4.

New Features

Improvements

Bug Fixes

It’s not even been a month yet, but I think 1.1 is ready. 1.0 was the real test, and a load of bug fixes went into it on an almost daily rate until a week ago, when no more bugs were reported. I managed to squeeze in a number of the requested improvements, and KFM 1.1 is now ready for release.

I think the most important part of this current release is that SQLite PDO is now supported. This means that a person who does not have a MySQL or PostGres database as part of their hosting package might still be able to use KFM. This involved building a database abstraction layer abstraction layer (not a typo), so MDB2 can be used for the “normal” databases.

It was fun to solve the IE7 problem where normal JavaScript dialogs are considered to be “popups”. The way I solved it was to create a modal window which passes its value forward to a referred function. Those of you that are good JavaScript writers might be interested to read the source and see my solution - I’m damned proud of it!

There’s a lot of work to do to prepare KFM for the next big thing (changeable view types - icon view, details view, etc), and I’m “rearing at the bit” to get started on that!

Anyway, please download and try it!, and if you feel very happy that I’ve improved your customers’ online experiences, there is a handy PayPal button just below the big green Download button.

as part of KFM 1.1, I was asked to add a few key bindings to some parts. The trickier part was to treat the Esc key as a “Close” request in CodePress embedded text editors.

It was tricky, as I did not want to directly hack CodePress - I inevitably forget the hack when it comes to time for an upgrade, and overwrite my hack with the latest new copy.

So, the hack is slightly different. Instead, I have a setTimeout loop running in the parent window, testing to see if the CodePress window has finished loading yet. When it has, a keypress event function is manually inserted into the CodePress window, testing for the Esc key.

Code for the CodePress creation (I’m using MooTools in the parent window):

function kfm_textfile_createEditor(){
    CodePress.run();
    if($("kfm_tooltip"))$("kfm_tooltip").remove();
    kfm_textfile_attachKeyBinding();
}

Now, start the onload loop - note that I’m using browser-based event attaching here, as CodePress does not use mootools:

function kfm_textfile_attachKeyBinding(){
    if(!codepress.editor||!codepress.editor.body)return setTimeout('kfm_textfile_attachKeyBinding();',1);
    var doc=codepress.contentWindow.document;
    if(doc.attachEvent)doc.attachEvent('onkeypress',kfm_textfile_keybinding);
    else doc.addEventListener('keypress',kfm_textfile_keybinding,false);
}

And finally, the test for the esc key

function kfm_textfile_keybinding(e){
    e=new Event(e);
    if(e.code!=27)return;
    e.stopPropagation();
    kfm_textfile_close();
}

I don't have a geansai gorm, but if I did, I might sometimes wear it.