I recently created custom widget for Django Admin area.
It’s used to edit pickled set of weekly hours range day by day. There is also ability to check a day as closed. Pure client side control was implemented as jQuery plugin for using with Django:
Server side model and widget:
Several months ago I was involved into discussion about the best way to implement realtime light-weight web chat like FB or GTalk right in Web.
In way like Comet or WebSocket. And now I have prety simple but robust solution. I’m talking about node.js + socket.io.
There is working example (not even pure chat but rather web echo service). To try it you need to install node.js, npm and then socket.io by npm. Then just run sudo node echo_server.js and go to http://localhost:8000.
Linux needs root’s privileges to server correctly flash client as bridge (one of transport layers provided by socket.io) on port 843.
One more interesting feature in this example is auto-scroll-bottom widget on client side like real chat messages box.
Basically, this is just test example or start point to implement real chat service or multiplayer game.
Several weeks ago I implemented jQuery plugin to visualize statistics. There are horizontal bar, vertical bar and vertical bar as column of the grid. I didn’t find open source solution that comply with all features the project needed. So, I implemented my own one.
- ‘on click’ events
- colors customization
jQuery has 2 selectors :visible and :hidden.
They are not related to visibility (visible, hidden) but to more regular display:none CSS property.
There is interesting trick to catch ASPX runat=”server” controls by jQuery selector on client side:
<asp:DropDownList id=”ddlFirst” runat=”server”>
Regular jQuery(‘#ddlFirst’) doesn’t work because on client side ASPX used ClienID like ‘Something_ddlFirst’ instead of ‘ddlFirst’.