



http://flickr.com/services/hasAccount. When you call it as http://flickr.com/services/hasAccount?callback=myFunction, it looks to see if you, the user requesting the URL, are logged into Flickr. If you are, it returns this JavaScript:
myFunction(1);
otherwise (i.e., you don't have a Flickr account, or you do and you're not logged into it, or possibly you do and you are logged into it and you've ticked "hide my online status from other websites" in the Flickr account page) it returns
myFunction(0);
This would usefully let the Satisfaction signup page (and other services that want to offer the same sort of function) display which services it thinks you're a member of: so for me, it would leave Upcoming and Flickr in the list and disable or grey-out or otherwise de-emphasise Cork'd and Twitter because I don't have accounts there. This would be relatively trivial to do: Flickr just write somewhere "our hasAccount URL is http://flickr.com/services/hasAccount?callback=" and your code just calls that URL (by creating a <script> element with it in the src) and drops a callback-function name on the end of it so it can read the results. A nice usability enhancement, and it doesn't particularly invade privacy (it's a slight violation that site A can know that you've got an account at site B, but not a major one since they don't get any details, and you allow people to opt-out if they choose).
For extra ease-of-use bonuses, although a quantum leap of privacy violation above that, have a hasAccount URL return
myFunction({"username":"sil"});
instead, and then use hCard as above to automatically fetch the public information from that site. Obviously this is a lot less appealing from the point of view of keeping your information secret, though.
Apart from that it requires all the services to bother doing this, any reason why it shouldn't happen?
document.readyState, in IE you document.write a <script> element with defer set. See Dean's writeup.) If you're using a JavaScript library of some sort (jQuery, Prototype, Mootools, whatever) then all this complexity gets wrapped up for you and you don't have to worry about it, but if you're writing stand-alone scripts (like my sorttable), which don't depend on a library, then this is more of a problem; you have to include a big swathe of boilerplate code to emulate the DOMContentLoaded event.
Recently, Hedger Wang provided an alternative approach for IE that doesn't rely on document.write, which is rather neat. So, it should be possible to combine the existing Safari method, Opera and Mozilla's DOMContentLoaded support, and Hedger's IE approach into a short bit of boilerplate code that can be dropped into your standalone script. And indeed it is. See a simple demo, and more importantly, here is the short version of the code:
(function(i) {var u =navigator.userAgent;var e=/*@cc_on!@*/false; var st =
setTimeout;if(/webkit/i.test(u)){st(function(){var dr=document.readyState;
if(dr=="loaded"||dr=="complete"){i()}else{st(arguments.callee,10);}},10);}
else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
document.addEventListener("DOMContentLoaded",i,false); } else if(e){ (
function(){var t=document.createElement('doc:rdy');try{t.doScroll('left');
i();t=null;}catch(e){st(arguments.callee,0);}})();}else{window.onload=i;}})(init);
The init on the last line is the name of your "init" function; the one that you want to call on page load. (It could be an inline function if required.) Simply copy those 7 lines into your standalone script and change the name of the init function to be your init, and you're good to go on all browsers. Remember that if you're already using a JavaScript library then you don't need this, but if you're not then it's simpler than the current swathes of code, and less heavy than depending on a library just to get access to cross-browser onload event handling.
GNOME's file dialogs are still extremely weak in many respects. For instance, the file dialogs still do not support even basic file management tasks like renaming and deletion. The file dialogs also lack adequate support for thumbnail display. Dialogs in some applications will show a thumbnail for one item at a time, but the file dialog windows do not display thumbnails next to individual files in the list—a feature that can be found in both KDE and Windows. It's a serious deficiency that has long detracted from the general usefulness of GNOME's file dialogs. In many cases, when I use a file dialog in GNOME, I find myself opening up a Nautilus browser and navigating to the same path so that I can see thumbnails or perform file maintenance tasks before saving or loading.A long time ago, there was a patch for Gtk produced by the ROX team that added a draggable icon to the Gtk filepicker window -- to save your document, just drag that icon to a Nautilus window. Those of you who remember RISC OS might remember that that's the way you saved files there:
There are a few UI problems with filepickers, as mpt pointed out a while back, and the drag-icon-to-save model neatly avoids them. There are, of course, issues: the main one is that in order to properly implement drag-and-drop saving, apps should use the freedesktop X Direct Save protocol, which I think means that every app must be patched to allow its saving to be accessed as a stream (so you can "save" a file directly into another application). I might be wrong about that being hard, though -- my C-fu is not strong, which is pretty high on the list of reasons why I'm not trying to make this happen already.
The Tango project's Window Experiments mockups have the draggable icon living in the top corner of the window itself, which seems like a great idea to me.
Is anyone working on this? I'd love to see whether it works out in practice.
doScroll() method of an unattached DOM element until it stops throwing errors, and when it does, the DOM's loaded. This gives you the equivalent of the DOMContentLoaded event for IE, and in a rather nicer way than the current-best method of document.write-ing a script tag with a defer attribute. I like this a lot, although I'd like to see some more detail about whether it works in all IEs before switching to it!
I had to look two or three times to confirm that it wasn't a picture of me. In the end it was the presence of the Mac that gave it away. It's disturbing seeing yourself looking back out of your desktop.

This website belongs to Stuart Langridge. Contact details are available. Don't eat yellow snow. Valid HTML5, at least in theory, except for the bits that aren't because I'm that futuristic that I'm ahead of the spec, oh yes. HTML5 help from Bruce Lawson, among others. Fonts from the superb FontSquirrel. End.