Recently in Javascript Category

As soon as you have a nice front end of your website, which should be functional (and compliant with current regulations), you will have to provide a contact form or a email-address somewhere. I have decided to show only my email-address, but wanted to protect it at least with a minimal encryption from mail-harvesters.

In an earlier version of my page I have used the template engine Smarty, which has some functions to encrypt your email-address with JavaScript. And I have to say that this worked fine for me so far. So my current page uses Zend Framework and I am not the great JavaScript-Coder. This is why I decided to try to merge this two codes together. And it works. Here comes how.

First you need to download Smarty.
You need a running Zend Framework Site.
And an editor.

I have already written here about the Dojo Editor. Generally this is a nice and clean Rich Text Editor (RTE), but with some deficits in the standard configuration. Two examples to this point: First the inserting of URLs respectively links is not enabled by default and second the inserting of images is not enabled either.

But this two options can be enabled quite easy. You can see a nice example of a quite good configured editor on this page here. The corresponding article for the how to is found on the page of rubicorp.com

There have been other articles around about the usage of the Dojo editor element in Zend Framework. The solution by Weier O'Phinney has been to write a view helper and use the editor in this way.

I have also started to use the Dojo components for my application and have been wondering how to access the editor, since I wanted an editor for my article bodies. So I looked a little bit around but found only the solutions which required to write own Javascript-functions and needed additionally hidden textareas to store the content respectively to access the content.

DijitEditor.png