VanDragt.com

Commentary on Digital Media and Usability

Hide elements that will be shown by jQuery later

without comments

I stumbled upon this gem by Jerph on Stackoverflow:

Right after the body tag, put a script tag with this javascript:

jQuery('body').addClass('js');

This gives you a style hook for any elements that will look different in some way when Javascript enabled, and it happens immediately.

via css – Hide jQuery Accordion while loading – Stack Overflow.

Written by Sander

January 30th, 2012 at 10:51 am

Posted in Uncategorized

Preprocessing CCK field output

without comments

So I spent a totally unproductive morning figuring out how to override a single field’s output in Drupal without rewriting my complete template code for the content type – I want to keep using the $content variable. After many a fruitless attempt luckily Grag Harvey has the answer:

Actually, control over CCK fields can be gained using CCK’s own templates.

Consider the situation where your field is called field_test.

Copy content-field.tpl.php to your theme directory and copy it again for the field whose mark-up you wish to alter, naming it content-field-field_test.tpl.php in this case.

Then change the mark-up in the file and it will alter the output of that specific CCK field.

No need to touch node.tpl.php!

Adapted via greg.harvey’s answer at node.tpl.php | Drupal API.

Written by Sander

December 7th, 2011 at 2:10 pm

Posted in Uncategorized

Tagged with , ,

Project Cars

without comments

Sign up to WMD, the somewhat unfortunate acronym chosen for Slightly Mad’s World of Mass Development platform, and you’re granted access to regularly released builds of the game, which you’re then free to pick apart in the official forums. That feedback then gets absorbed by Slightly Mad Studios, a simple loop that means that, when the game is eventually released, it’ll be as much a product of the community as it is of the studio.

via Project Cars Preview • Eurogamer.net.

Looks like an interesting development strategy, made famous by Minecraft.

Written by Sander

November 25th, 2011 at 2:35 pm

Posted in Uncategorized

Tagged with

Asynchronous UIs – the future of web user interfaces

without comments

Discovered this javascript MVC framework SpineJS. The ToDo app is extremely impressive. Try and manipulate items as quickly as possible. Tthen close and reopen the browser. Nice.

via Asynchronous UIs – the future of web user interfaces.

Written by Sander

November 22nd, 2011 at 4:10 pm

Posted in Uncategorized

Tagged with

The price of a messy codebase: No LaTeX for the iPad

without comments

The price of a messy codebase: No LaTeX for the iPad – Valletta Ventures.

The first step in compiling WEB code is to run TANGLE to produce unhelpful Pascal source files. Thoughtfully the TeX build system includes a translator to produce compilable C files. Although WEB was hugely influential as the progenitor of modern source code documentation it is now obsolete, and modern extensions to TeX have been written in C. This is compiled alongside the translated WEB code. It is not hard to imagine the effect this has on the readability of the codebase.

Why programming is not yet as advanced as nature in evolution.

Written by Sander

November 22nd, 2011 at 12:34 pm

Posted in Uncategorized

Tagged with

Combining multiple Subversion repositories

without comments

This post describes a step by step guide on how to combine multiple Subversion repositories whilst keeping individual history (and commit messages).

Dumping

Exporting from pagefeedbacktool repository the /trunk/public folder and integrating that into the services repository under /trunk/public/pagefeedback:

Dump the repository including only /trunk/public as follows:

E:\Repositories\pagefeedbacktool>svnadmin dump .| svndumpfilter include --drop-empty-revs --renumber-revs trunk/public > ..\services\filtered.dump

Loading

However as pathnames are stored as part of the dump (and replacing the path with a texteditor corrupts the dump), we have to include the full path under a different parent directory:

In VisualSVN create a /trunk/public/pagefeedback/trunk/public folder structure (try without the final public if import fails) then load the dump as follows:

E:\Repositories\services>svnadmin load . --parent-dir "trunk/public/pagefeedback" < filtered.dump

The dump is successful but at the wrong path:

currently: /trunk/public/pagefeedback/trunk/public
should be: /trunk/public/pagefeedback/

Post-correction

Open two Windows Explorer windows with both paths side by side, select all the files that should be moved, then RIGHT click drag them to the destination folder and choose SVN Move versioned files here...

Commit from the repository root.

It is now safe to remove the trunk/public folders under /trunk/public/pagefeedback/

Commit again.

Written by Sander

November 10th, 2011 at 3:30 pm

Posted in Uncategorized

Tagged with , , ,

Useful Coding Tools and JavaScript Libraries For Web Developers

without comments

Here are some of the most useful coding and workflow tools released recently.

via Useful Coding Tools and JavaScript Libraries For Web Developers

Written by Sander

October 31st, 2011 at 2:12 pm

Posted in Uncategorized

Tagged with , ,