tag: JavaScript

Packaging web apps

2 Feb, 2006 - 4 minutes

Have you been frustrated lately by speed of web applications? Typically they have a lot of art, and structured into a nice set of JavaScript and CSS files. They look beautiful, aren’t they? But do you have the patience to wait them load? And proceed from step to step?

Of course, it is possible to prepare a web application to high-demand life: merge all stylesheets, and JavaScript files, and compress the result, structure your GUI in such a way that it is possible to combine all small images in one, and so on. This is very tedious low-level work. There are some tools, which can take care of the problem. For example, Dojo compressor merges JavaScript files and transforms the code to minimize its size. There are some tools to “compress” CSS. But the task of general optimization of your web app is up to you. Otherwise you will have a lot of frustrated users.

Django Dojo

28 Jan, 2006 - 2 minutes

Django-Dojo alliance was finally announced to the world by our very own Jacob Kaplan-Moss:

Starting with version 0.92 (which should be out in a few weeks, Murphy willing), Django is going to bundle Dojo with the toolkit. Specifically as part of Django’s admin interface (but available to user apps as well).

Read all about it in Jacob’s post.

I am overjoyed to see such cool high quality open source projects are working together. Clearly it will make it easy to create kick-ass highly interactive web applications in Django and it will advance Dojo positions as a premier AJAX toolkit. It is a rare win-win situation for everybody involved including users of both frameworks.

OpenWrt QoS

27 Jan, 2006 - 1 minutes

It looks like nbd was able to find the problem, which plagued many people (including me) with QoS. You can find details in this thread on OpenWrt forum. Instructions on how to install QoS package can be found in this FAQ entry. Give it a whirl and don’t forget to thank Felix Fietkau (nbd).

QoS was the biggest feature on my "wanted" list. It means now I can produce an OpenWrt GUI (webui) module to deal with it. It coincides well with release of Dojo 0.2.2. But most probably I’ll be using a snapshot because guys added so much new stuff to Dojo preparing for Dojo 0.3 (widget release). Given the stability of OpenWrt GUI Homunculus Alpha release, I may upgrade new release to Beta status.

Clients: thin vs. thick

15 Jan, 2006 - 5 minutes

Brad Neuberg wrote a good article, which compares two different approaches to AJAX: thick client (e.g., Dojo style) and thin client (e.g., Prototype style). While it does a good job contrasting two approaches, I want to underscore that the underlying problem is a clash of two cultures between "local application" developers, and "web site" developers.

There is no doubt that local applications create the most satisfying end-user experience. Their typical weakness is in restriction of underlying data to local installation, which makes any collaboration impossible. "Connected applications" can help to alleviate this problem, but networking is hard in general and many local app programmers try to avoid it. They don’t have proper culture to do it, existing network APIs are hard to combine with GUI, and so on. In general they don’t get it.

Live Filtering

Update on 11/25/2007: today this article presents mostly historical interest. Since Dojo 0.2 a lot of versions were published and many things were changed. At the time of this writing Dojo is at ripe 1.0. I had to disable all Ajax action in examples because I don’t use Dojo 0.2 anymore.

What is Filtering? It is a selection of items using some criteria (filter). In this tutorial I am going to filter documents of my blog (made with Django, of course) matching titles against user-specified substring. Later on I’ll talk about generalization of this approach.

DIY and NIH syndromes

16 Dec, 2005 - 3 minutes

Many programmers have DIY attitude. It is understandable: they want to do new exciting stuff themselves. In some cases it is perfectly reasonable: exotic functionality, special requirements, performance enhancements, and so on. Sometimes incorporating 3rd-party library makes overall API inconsistent, which is bad especially for programming tools, or big projects.

There is a fine line between DIY and NIH, when DIY part is used without rational explanations. Of course, in some cases NIH is reasonable too, e.g., high price of acquisition of required 3rd-party tools, or intellectual property concerns.

Django Ajax Redux

10 Dec, 2005 - 9 minutes

Three weeks ago we had a discussion about Ajax support in Django, which resulted in "Ajax and Django" wiki page. A short recap: it lists a vague goal, some general considerations, and possible strategies; it scratches the surface of existing implementations (mostly RoR), existing third-party toolkits (Mochikit/Dojo), and related RPC-style and REST-style services. No code was produced, no consensus was reached, but now it is a part of Django’s Version One roadmap.

OpenWrt GUI: alpha released!

27 Nov, 2005 - 1 minutes

Finally I released WebUI 0.1 (Homunculus) alpha — AJAX-based web interface for OpenWrt made with Dojo! Highlights of this release: 5 more applets including firewall configurator and more network settings. Now proceed to install the package and to read release notes.

The package is here: webui-0.1-alpha.ipk. You can install it using following command in OpenWrt shell:

ipkg install http://lazutkin.com/download/webui-0.1-alpha.ipk

Release notes:

  • WebUI can be installed side-by side with webif (comes standard with OpenWrt White Russian RC4). To access it use following URL: http://your_router/webui.html.
  • Five more applets are added to this release:
    • System: provides a menu for existing applets.
    • Firewall configurator: simple management of DMZ and port forwarding.
    • Hosts configurator: manages a list of static hosts (used by DNS and by Firewall configurator).
    • Ethers configurator: manages a list of static assignment of IP by MACs.
    • WDS configurator: manages WDS connection settings.
  • General clean up of user interface:
    • More information is moved to tooltips.
    • Help is provided by tooltips.
    • Context-specific references to OpenWrt documentation.
  • Tested on following browsers:
    • Firefox: works.
    • IE6: works.
    • Opera 8.50: doesn’t work.
    • Konqueror: doesn’t work.
  • I decided to proceed with release in spite of Konqueror and Opera problems. I hope it will be solved later. For now use Firefox.
  • As always I appreciate your feedback: openwrt [@] lazutkin [.] com.

OpenWrt GUI: hosts editor

30 Oct, 2005 - 1 minutes

I didn’t have a lot of time this weekend. So I decided to implement the simplest part of upcoming OpenWrt GUI (webui) — hosts editor. It is a perfect candidate to write something in 15 minutes or less — it has almost no "business" logic in it: read/edit/verify/write cycle. The hardest part was to learn how to upload dynamically generated files without writing them to disk first.

It turned out to be very simple. Right now it is implemented using Dojo’s versatile dojo.io.bind() facility and some external code.

OpenWrt GUI: preview is released

26 Oct, 2005 - 2 minutes

Update: this document is officially obsolete — alpha is released!

Finally I released a preview: /webui-0.1-pre-alpha.ipk!

I included two information applets and a simple network configuration applet. I think it would be enough for a proof of concept. I borrowed heavily from nbd’s webif. So if it works for you, it is due to his OpenWrt expertise. If it doesn’t, it is my fault.

Both webif and webui can be installed side by side:

OpenWrt GUI: preview is ready, packaging

24 Oct, 2005 - 1 minutes

Finally I found time to finish it up. It is pre-alpha quality now, but shows the direction.

The only problem is a packaging. I didn’t mean OpenWrt’s IPKG. I am talking about creating a custom build of Dojo to reduce the foot print. Dojo has a special provision for that but so far I was not able to do it getting some strange errors. I hope I’ll get some help from developers.

OpenWrt GUI: good, bad news

6 Oct, 2005 - 1 minutes

Today I have good news and bad news.

The good news is tonight I was able to work on AJAX OpenWrt GUI a little bit more. It is coming together. I coded my first applet. It shows current stats, nothing fancy.

The bad news is I bricked my router apparently by running nvram show repeatedly. I suspect that nvram is corrupted beyond salvation. I have to reset it somehow. I tried simple recipies listed in OpenWrt Wiki but no luck so far. I’ll try to revive it on weekend. I have a feeling that my future lies with JTAG. Until the router is up I cannot debug OpenWrt GUI.

OpenWrt GUI: development

30 Sep, 2005 - 2 minutes

I was able to spend several hours this week to work on upcoming OpenWrt GUI. I use Dojo as a foundation. At this point I coded a skeleton, which works as a proof of concept. As soon as I finish putting in AJAX guts, I’ll switch to meaty functionality. Add some nice skin to it and we have our homunculus up and running.

Huh? AJAX? No, it’s not Ajax the detergent. No, I didn’t mean Ajax the pro soccer club. "Now I clearly remember that AJAX is a Trojan, and I don’t like Trojans and viruses" — clever, but no. Go see the movie about Greek heroes and the Wooden Horse. And let’s skip "Trojan" discussion altogether — I’m trying to be PG-13 rated.

New TinyMCE config for Django

25 Sep, 2005 - 1 minutes

For a long time I wanted to have two TinyMCE toolbars for Django Admin:

  • One-line toolbar with the most essential tools, which gives a lot of space for inline editing of text.
  • Full-featured toolbar with all tools for full-screen mode.

It finally happened. Spocke (the main developer of TinyMCE) helped me to figure out how to do it. I updated my article in Django Wiki with new config file, and removed my notes about space problem (new config file solves it) and flickering (new TinyMCE 2.0 RC2 works perfectly).

OpenWrt GUI

23 Sep, 2005 - 1 minutes

Finally I bit the bullet and decided to implement OpenWrt web-based user interface using Felix Fietkau’s code. Well, MIPS processors used by OpenWrt units are not race horses and GUI is slow to my taste. Yes, I know that stock firmware is not faster. "Slow" is absolute category for me.

How do we combat latencies and slow network speed? Exactly. We can apply the same for OpenWrt, where "slow network speed" is replaced with "slow processor on local network". So I decided to do The Right Thing(tm) and implement it using AJAX approach. I will use Dojo.