Archive for the ‘javascript’ tag
Usability: Auto Saving users’ work
I have found many applications ( couple of them from Google) doing auto-save. This is amazing and a very thoughtful move towards better usability. But, though I dont seem to remember where, I was once searching for a “save” button and did not find it. And I realised the site was auto-saving my work and I didnt need to save anything specifically.
Maybe due to legacy, many of us have gotten used to actions like “edit” , and “save”. I feel one can actually design a site (and probably an application too) without requiring these. The only concern is, will it actually confuse the users more.
Thinking on those lines, I came up with this small little text box to give the user the assurance that his work is infact saved and he doesnt need to do anything extra. Go ahead! Type in a few characters and see it for yourself. I already know that one cannot click and go back to any part of the typed text and I dont have a solution for that yet. Do you think this is too flashy? Too many things moving? Or is it good ?
Update: Original idea was to paste the javascript here. But blogger is screwing the shit out of me. I dont seem to be able to do that!
Firing a native event with Javascript..
Tech post after a really long time. And probably my first real piece of advicing in Javascript. So, take it with a pinch of salt. And tell me if I am writing something incorrect.
Ever wondered if it was possible to simulate a native event from your javascript code? Yes it is! Generally, you would probably have registered for an event and written all the logic in that callback. But sometimes, a need to do execute the same logic arises due to a completely unrelated event. To give you a real example, head over to this view of Yahoo! India maps. If you notice, clicking on any of the “local search element” on the right pane shades the element and also opens the marker. Now, clicking marker does the same thing too.
Instead of writing the code to shade the element all over again on the marker’s click callback, what you could do is to fire a click element on the corresponding search element on the right pane.
As you would expect you would have to do this differently in firefox and IE. And it will look something like this:
var fireOnThis = document.getElementById(“yourunrelatedelement”);
If(IE) {
var e = document.createEventObject();
fireOnThis.fireEvent(“onclick”,e);
}
else {
var e = document.createEvent(“MouseEvents”);
e.initMouseEvent(‘click’,true,true,window,0,0,0,0,0,false,false,false,false,0,null);
fireOnThis.dispatchEvent(e);
}
}
Write in LJ and read in Blogspot
Do you like both Blogspot and LJ? Do you have your readers split between these two lovely blog provider sites ? Well, I do. I was telling
sunson the other day that I want to blog in LJ and then syndicate it into blogspot. Apparently, you can do this by paying LJ for a premium account. I dont know what else a premium account provides, but I really dont want to pay for something like this. Why would you do that when you have Greasemonkey and PHP? So, A bit of a night out and some ciggys amalgamated into the “LJ Blogspot integrator”.
What is good ?
Well, this entire thing, isint ?
What is bad ?
- You need to install this greasemonkey script. That means, you are stuck to firefox and you have to install it on all the firefox browsers you blog from.
- The backend is PHP. So you need a server to run it. Maybe, at a later point, I will write the entire thing in javascript.
- You have to switch to the “plain text mode” before you click “update”. This is because I dont know how to capture the text written inside the rich text editor. You can help me to fix this.
- LJ user links have a broken image. Will fix this later.
- Your update entries will not take effect in blogspot. Not sure if I want to fix this.
Go find the greasemonkey script from here. I am hoping you already have greasemonkey and know what I am talking about. Find the backend PHP code here.
Read up the code to see what all you have to change. And then you are all set to go!
Ensaai!
PS: If you find this blog on my blogspot, it got there because of what I just told you!
