How to use FCKeditor, or any other WYSIWYG editor, with Zend_Form? Another relatively common question. There are many ways you can do this, but let’s look at these two as they are the best in my opinion: Adding some JavaScript to your view script Creating a Zend_Form_Decorator We’ll be using FCKeditor, but you can apply the techniques shown to others, …
Object-Oriented JavaScript book review
I was recently contacted by Packt Publishing, and asked if I wanted to review a book they published – Object-Oriented JavaScript, written by Stoyan Stefanov. I hadn’t reviewed books before, but I decided to give it a shot! As stated on Packt’s website, by reading the book you will learn: Create scalable, reusable high-quality JavaScript applications and libraries Learn to …
Using Prototype Property in JavaScript
The following topics are discussed in this article: Every function has a prototype property and it contains an object, Adding properties to the prototype object, Using the properties added to the prototype, The difference between own properties and properties of the prototype, __proto__, the secret link every object keeps to its prototype, Methods such as isPrototypeOf(), hasOwnProperty(), and propertyIsEnumerable()
Ajax, high latency and user experience
Most of us probably have used at least one website which bases some major functionality on Ajax. But have you ever used a such site, done something, then moved on to another page, only to come back later to realize what you just did was never saved? What happens to XMLHttpRequests in a high latency situation, and how to deal …
Sandboxing Rhino in Java
I’ve been working on a Java app which needed Rhino for scripting. The app would need to run untrusted JavaScript code from 3rd parties, so I had to find a way to block access to all Java methods, except the ones I wanted. This would not be a problem if there was an easy way to disable LiveConnect – the …
JavaScript margin/block commenting system
On Djangobook, they used to have this interesting commenting mechanism on their book’s pages: Each paragraph in the book could have comments, by use of a JavaScript commenting system which would display the amount of comments on each paragraph when you hovered over them with the mouse. You could also click on the little bubble which displayed the count, and …
Common widget design patterns
I’ve worked on quite many widget projects, and very often they have certain patterns that keep appearing. I’m calling these “widget design patterns” – let’s take a look at a few.
Generating Sudoku puzzles using JavaScript
While I’m not the biggest fan of Sudoku puzzles, I wanted to make a sudoku widget for the Opera x-widgets challenge. This required me to study the algorithms used for generating sudokus, which was actually a quite interesting challenge. While there are some examples of generating sudokus online, such as this interesting approach, it seems there’s only one “true” way: …
How to get your saved passwords from almost any browser
Someone on ##opera in freenode was asking how to recover their saved password from Wand, Opera’s password manager. While there is apparently no “official” way of getting to them, I thought that maybe you could simply hook into the form, and read the password when it’s being submitted by Wand! Easy enough, add an event handler to onsubmit, collect passwords …
Creating a Dojo dijit.Tree with checkboxes
Dojo provides a useful component called dijit.Tree, which is basically a quite typical tree component. However, it doesn’t do much out of the box, and I needed it to make some tree nodes selectable with checkboxes for my Zend Framework based packageizer script. While Zend Framework has a Zend_Dojo component, it doesn’t quite do trees the way I want yet.