Christian Heilmann

Author Archive

Presentations2.0 for a world2.0 with Slackrpoint!

Friday, August 3rd, 2007

If you ever wondered how to make a fast presentation2.0 and you have no time to look up imagery and thought provoking thoughtshowers, don’t wait any longer!

Slackrpoint is the solution to all of these problems! Check out the presentation2.0 featurette (click anywhere on the screen to go to the next slide) and download Slackrpoint to create your own! Simply add the JSON object in slides.json.js to fit your slides! Slackrpoint will illustrate and annotate for you, by pure web2.0 entrepreneurial spirit and witchcraft!


slackrpoint = {
title:"slackrpoint",
subtitle:'the presenter's timesaver',
author:'Chris Heilmann',
date:'3rd August 2007',
current:0,  // start slide
slides : [
{
mood:'problem',  // this defines what picture to load
thoughts:true,  // Boolean to show thoughts or not
title:'oh dear...',
content:[  // bullet points
'we all know the problem:',
'you need to give a presentation,',
'and there is no time to find good mood images'
]
},
{
mood:'finding',
title:'the solution',
content:[
'you can ask your PA to collect photos',
'you can only go with text',
'or you can use slackrpoint'
]
}
]
}

To Do:

  • Hosted version
  • Offline version using Google Gears
  • Facebook plugin
  • Air version for your desktop
  • twitter integration

If you are a venture capital company or you are looking to support up and coming web2.5 superstars contact me. I have a suit and can spend other people’s money if I need to!

Happy Friday!

[tags]web2.0,shiny,presentations,slides,generator,json,maybeajax,gradients,parody,flickr,json[/tags]

Yummy – add del.icio.us boomarks to your wordpress blog with a simple plugin

Wednesday, August 1st, 2007

Ok, time to release another plugin for WordPress. This time I wanted to easily implement del.icio.us bookmarks into blog posts without having to use a server-side component and add to the already slow loading of this blog. The solution was to use JavaScript and load the bookmark data only when you request it. This means that my blog post does not show a lot of links and thus become suspicious to search engines and it also means that I don’t create lots and lots of trackbacks to other blogs (I hate following a trackback just to find another “my links for the day” post).

Anyways get the dynamic delicious plugin for WordPress, install it and start showing links in your posts without messing up the social web.

The plugin allows you to use a special syntax for del.icio.us links, which is the following:

[ delicious:Link Text,user,amount of links,tag]

For example:

[ delicious:My Links on JavaScript,codepo8,10,JavaScript] becomes

[delicious:My Links on JavaScript,codepo8,10,JavaScript]

The tag is optional, so you can also use:

[ delicious:My Latest Links,codepo8,10] becomes:

[delicious:My Latest Links,codepo8,10]

The plugin is licensed Creative Commons Share-Alike. Enjoy.

[tags]delicious,bookmarks,plugin,wordpress,creative commons[/tags]

YUI 2.3.0 released!

Wednesday, August 1st, 2007

Finally I can announce the 2.3.0 release of the Yahoo! User Interface Library. Internally we had a chance to play with some of the library news already and there is a lot of cool stuff to see:

It is also cool to see that a lot of minor bugs and improvements found and reported by the team in the UK have been implemented by the YUI folks. Most of these are way under the hood, like a long overdue insertAfter method and next and previous sibling methods that don’t report linebreaks.

[tags]YUI,yahoo,library,javascript,rich text editor,testing[/tags]

Looking for inline code editors

Monday, July 30th, 2007

Hmm, now here is an interesting task. I was asked to find an inline “code editor” which means a script or a flash widget or a (shudder) applet that allows for editing of code (PHP, JavaScript, HTML, CSS) inside an application. There are a lot of inline Rich Text editors and even some WYSIWYG editors, but the online editor that allows you to properly code inside an HTML document is CodePress.

Have you come across others?

[tags]CMS,inline editing,code editors,syntax highlighting[/tags]

Show love to the Module Pattern

Tuesday, July 24th, 2007

Back in February 2006 I declared my love for the object literal explaining that it is a great way of making sure your scripts don’t interfere with others as all you expose to the world is a single object name. Instead of

function init(){}
function doStuff(){}
var myMessage = 'oi, gerrof!';

which might be easily overwritten you can use

myScript = {
  init:function(){}, 
  doStuff:function(){}, 
  myMessage:'oi, gerrof!'
}

and this way make sure that they don’t get overwritten or overwrite other methods or variables. You can access them as myScript.init(), myScript.doStuff() and myScript.myMessage. I liked this idea so much I argued for a length of time with my technical editor at that time that I want my book to be based on this kind of scripting or not at all.

The only annoyance I had with this is that it still leads to rather big methods, as you have to use the long name for every call of variables inside the object. True, you can use this, but when you use event handling and you don’t use the scope correction of the YUI event you’ll use that for the element the event occured on.

myScript = {
  init:function(){
    this.doStuff();
  }, 
  doStuff:function(){}, 
  myMessage:'oi, gerrof!'
}

Is therefore not necessarily possible, so you need to use:

myScript = {
  init:function(){
    myScript.doStuff();
  }, 
  doStuff:function(){}, 
  myMessage:'oi, gerrof!'
}

This, in much more complex scripts, can lead to a lot of code and typing (unless you use an IDE) and just seems bloated. I had a lot of problems fitting object literal scripts into 80 character code templates for the book and magazine articles for example.

The solution to shorter code is once again a thing from the mad JavaScript scientist’s lab of Douglas Crockford called the Module Pattern. If you want a very detailed and good explanation of what it does in terms of OO sorcery, check out the easy to follow explanation of the Module Pattern by Eric Miraglia on the YUI blog.

What the Module Pattern does for me on top of that is that it keeps my code short. I only expose those methods as public that need to be and then I can call them inside the main object by name of the method and not by objectname.methodname.

myScript = {
  massivelyLongVariableProbablyGerman:1,
  thisIsReallyLong:function(n){},
  doStuff:function(n){},
  init:function(){
    myScript.doStuff(myScript.massivelyLongVariableProbablyGerman);
    myScript.thisIsReallyLong(myScript.massivelyLongVariableProbablyGerman);
  }
}
myScript.init();

becomes

myScript = function(){
  var massivelyLongVariableProbablyGerman = 1;
  function thisIsReallyLong(n){};
  function doStuff(n){};
  return {
    init:function(){
      doStuff(massivelyLongVariableProbablyGerman);
      thisIsReallyLong(massivelyLongVariableProbablyGerman);
    }
  };
}();
myScript.init();

However, there are two problems remaining: if you want to call one public method from another public method you’d still need to go either via the this route or by prepending the main object name:

myScript = function(){
  var massivelyLongVariableProbablyGerman = 1;
  function thisIsReallyLong(n){};
  function doStuff(n){};
  return {
    init:function(){
      doStuff(massivelyLongVariableProbablyGerman);
      thisIsReallyLong(massivelyLongVariableProbablyGerman);
 
      otherPublic() // < - has MASSIVE FAIL! 
      this.otherPublic() // <- works 
      myScript.otherPublic() // <- works 
 
    },
    otherPublic:function(){
    }
  };
}();
myScript.init();</>

The other problem is that I am not too happy about the return {} with all the public methods in it, it still looks a bit alien to me. Caridy Patiño offered a solution to that problem on the YUIblog by simply creating an object with a short name inside the main object that can act as a shortcut for public methods to call each other:

var myScript = function(){
  var pub = {};
  var massivelyLongVariableProbablyGerman = 1;
  function thisIsReallyLong(n){};
  function doStuff(n){};
  pub.init = function(){
    doStuff(massivelyLongVariableProbablyGerman);
    thisIsReallyLong(massivelyLongVariableProbablyGerman);
    pub.otherPublic();
  };
  pub.otherPublic = function(){
  };
  return pub;
}();
myScript.init();

This also saves me one level of indentation which means I can fit even more code in 80 characters. I will use that much more in earnest now.

UPDATE

If you like what you see here, take it up another notch with the revealing module pattern