+45 70 27 40 08

sales@meeho.net

— Archive for the ‘HTML and CSS’ category:

» Tip for the web developers: Raphaël

Posted by Kasper Tidemann on Tuesday 16th of February 2010 02:40:16 AM

For all you web developers out there always on the lookout for new and exciting things, why don’t you have a look at Raphaël? It’s a JavaScript library that does vector graphics in a really neat way. Go check out Raphaël here, or for a quick look at some of the capabilities, have a look at this example.

... it certainly seems so!

... it certainly seems so!

0

Comment on this post

» The proper way of using the ORGANIZER attribute in iCalendar format

Posted by Kasper Tidemann on Monday 11th of January 2010 03:24:15 AM

Working with the iCalendar format using Ruby on Rails brings many possibilities of quickly getting data generated by using gems such as iCalendar. However, the gem seems not to handle the ORGANIZER attribute in a proper way. What it does is the following:

ORGANIZER:Kasper Tidemann

… which will make the ORGANIZER info not show in iCal. However, it will work if you remove the spaces in the attribute’s value, that is, it will work if you do the following:

ORGANIZER:KasperTidemann

… but while it may work, it’s not really what we want. The organizer’s name is not “KasperTidemann” to be exact, but “Kasper Tidemann”. Now, while this post deals with fixing the use of the iCalendar gem to make the organizer tag show properly in iCal, the following principle is general and should always be followed.

To make iCal show you the name of the organizer plus the person’s e-mail address, what you need is for the ORGANIZER attribute to look like this:

ORGANIZER;CN=Kasper Tidemann:mailto:kt@meeho.dk

This way, it will show up in iCal like this:

Screenshot of iCal showing the organizer info. Please do not mind the Danish attribute names.

Screenshot of iCal showing the organizer info. Please do not mind the Danish attribute names.

I have written the maintenance guys of the gem, but they haven’t replied me yet. Until then, you can either modify the gem yourself or use the custom_property method they’ve supplied the gem with:

event.custom_property("ORGANIZER;CN=Kasper Tidemann:mailto", "kt@meeho.dk")

It’s kind of not the way you would use the method, since you’re really supposed to simply type in an attribute name as the first parameter and the attribute value as the second, but hey, the above works and will help you out until the gem itself is fixed.

0

Comment on this post

» Find out which HTML element has focus using JavaScript

Posted by Kasper Tidemann on Tuesday 5th of January 2010 04:35:55 AM

If you need to know which element on your HTML page has the current focus, you can use the document.activeElement attribute recently introduced in all the major browsers (it works in Firefox 3, Safari 4, Internet Explorer 8 etc.).

For example, this is very useful if you need to determine whether an input field has focus or not. You might have a user typing stuff in a form, and you do not wish for the user to leave the page (by mistake) in the middle of typing text in one of your input fields.

As an example of the use of document.activeElement, have a look at the following piece of code:

<html>
<head>
<title>My test page</title>
<script type="text/javascript">

 window.onkeypress = getActiveHTMLElement;

 function getActiveHTMLElement(keyevent) {

  keyevent = (keyevent) ? keyevent : ((window.event) ? event : null);

  if (keyevent) {

   switch (keyevent.keyCode) {
    case 8:
     alert(document.activeElement.tagName);
    break;
   }

  }

 }
</script>
</head>

<body>

This is my test page. Now, press backspace!

</body>
</html>

The above code will return the tag name of the element that has focus each time you press the backspace button on the page.

The document.activeElement attribute is a part of the coming HTML 5 specification. For more info, please click here and read up on the changes to come.

1

Comment on this post

» Google Browser Size

Posted by Kasper Tidemann on Monday 28th of December 2009 09:45:15 AM

Google has developed a very interesting tool based on the browser window sizes of the millions of users that visit Google every single day. The tool is named Browser Size and it enables you to ensure that the most important parts of your web page is viewable by the majority of your visitors, at least as seen through the optic of Google.

You can have a look at Browser Size at http://browsersize.googlelabs.com.

0

Comment on this post

 
OLDER POSTS
NEWER POSTS

+45 70 27 40 08
Open office hours

info@meeho.net

support@meeho.net

News from the Meeho!™ Blog:

02/14 2011 » Fixing the "NoMethodError: undefined method ‘to_sym' for false:FalseClass" error when working with I18n in Ruby on Rails

02/03 2011 » Soon to come: IMAP integration

01/27 2011 » Meeho!™ App version 1.0.3 is out!

01/26 2011 » Cool new iPad stand

We live at Diplomvej 381, 2800 Kgs. Lyngby, Denmark: