webapp.css saying @import url(http://www.helvetireader.com/css/helvetireader.css); to greader.webapp, so you could do that yourself and add any extra customisation you want to that file.)
webapp.css saying @import url(http://www.helvetireader.com/css/helvetireader.css); to greader.webapp, so you could do that yourself and add any extra customisation you want to that file.)
$HOME/.gimp-2.6/plug-ins/ and mark it executable. It's a Gimp extension which makes two functions available over D-Bus: image_list and save_as. (This could be the starter for making all Gimp functions available over D-Bus, with a __getattr__ hook, the gimp.pdb object, and a bit of introspection.)$HOME/Open?) and python gimpfs.py $HOME/Open to mount the view of Gimp open documents on that folder.
#!/usr/bin/env python
import dbus, urllib
from dbus.mainloop.glib import DBusGMainLoop
START_TORRENTS = "http://localhost:9091/transmission/rpc?method=torrent-start"
STOP_TORRENTS = "http://localhost:9091/transmission/rpc?method=torrent-stop"
DBusGMainLoop(set_as_default=True)
sess=dbus.SessionBus()
def sig(screensaverActive):
if screensaverActive:
data = urllib.urlopen(START_TORRENTS).read()
else:
data = urllib.urlopen(STOP_TORRENTS).read()
sess.add_signal_receiver(sig, 'ActiveChanged','org.gnome.ScreenSaver')
import gobject
loop = gobject.MainLoop()
loop.run()
YUI({combine: true, timeout: 10000}).use("node",
function(Y) {
... code from the example...
});
Ah, OK, so that's onDOMContentLoaded, is it? a new YUI function. I'm sure it'll be explained later.
Moving on, the next example explains onAvailable, onContentReady, and event:ready -- three different "is the thing ready for me to use" load events. (All of which make sense at different times, and are potentially useful.) That's all good, but...the previous example, even after I'd looked in the code, didn't use any of them! How did that work?
Ah, a feeling of doom creeps over me. More disclosure: I really, really don't like the Yahoo practice of putting your JS inline at the bottom of the page. I think it means that my JS isn't separated out into different files where it's easy to edit, it makes refactoring the page hard because you have to care exactly where your script elements are and be careful if you move HTML elements around, and it's a lot easier to teach people to make their JS unobtrusive if you can offer the rule "Put all your JavaScript in separate files and don't have any anywhere in your HTML". I know there are good reasons why Yahoo do it, and I accept those reasons. If I build a site which gets as many hits as they do then I'll test both ways and the extra three milliseconds you get from having the JS in-page without DOMContentLoaded may make a big difference. For most of the stuff I write, though, I don't like it and try to not use it. So, the first example was obviously reliant on that (because it's not hooking any load event at all), but didn't say so. Moving on, the next example I read, about nodes, does the same thing. As far as I can tell, nothing anywhere in these examples has said "make sure you put this example code after the things it's referring to". If you don't do that (say, if you put it in the head because that's where you've been taught that JavaScript should go) then it plain won't work, and you won't know why. (Maybe I missed the 72-point red writing which says this? I hope I did.)
Next example I read (event delegation, a thing I like very much): doesn't show why the clicked items turn green (obviously CSS, and indeed it doesn't take long to find the link in the source), but also...when I click on one of the items and it turns green, there's a subtle animation effect to it, as if the green colour expands out from the centre of the item. It's quite a nice effect. I can't for the life of me find what's doing it, though. (Doesn't do it in Midori, a webkit browser, so maybe it's Firefox?)
I spent ten minutes trying to work out why clicking on an item sets a class ("yui-pass") on that item and then alters text in all non-yui-pass items, rather than just using e.target. Of course, the reason is that a second click on a different item should set that second item to green and not unset the first green item. Fine and dandy: a note about that in the example would have helped, though. Yes, the examples are there to demonstrate YUI, not to explain how to produce a specific effect, but...what people want is a specific effect. Explaining how it works would help with that. Explaining the YUI parts of an example but not putting them in the context of the rest of the code is like explaining how to build a house with a two-hour lecture on bricks without ever mentioning that you need mortar to stick them together. "The rest of the code" here is a couple of lines, but the example would make much more sense if it was all explained.
Once I'd got this far, I started thinking, hm, hasn't changed, still the docs are written for someone who isn't me and I don't get them. So I started dotting around picking and choosing bits to look at rather than going through step-by-step. One of the features I like most about jQuery is that I can call a JSON-P script and still specify my callback function inline, rather than having to separate it out and give it a name and pass that name as callback=myCallback to the JSON-P script. (It gets given a name under-the-covers by jQuery, of course, so that the callback does have something to call, but I don't have to think about it. I like inline functions.) It's be useful to me if YUI 3 could do that, so I thought I'd have a look to see if it's possible. I don't think it is, but...I can't tell. The docs don't seem to mention the idea of loading scripts that call a callback function at all. Instead, I think you're supposed to use YUI.Get.script and read the JSON out of the nodes array that you get passed. Perhaps. Here we come back to my problem with the YUI docs: I know what I want to do, but not how to do it, and there's no way to answer my question. If there isn't an example dealing with it, I am out of luck.
Someone tell me how I ought to be reading the documentation. Maybe I'm missing something. But it does rather feel to me like the docs are reference material: they're there for people who already understand YUI. The examples are incomplete -- focusing on just the part you're trying to show is understandable, but if the example won't work without the other parts then you have to show the other parts too! If your example only works if it's wrapped with YUI().use("node"), function(Y) { ... }) then you have to show that. If it only works if it's wrapped in DOMContentLoaded, or if it's placed at the bottom of the page in a script element, then you have to say that. Yes, it's a ballache to have to explain how events work and how loading works and not get to any real concrete examples until chapter 3 or 4 of your documentation. But people need to know that stuff or your examples will not work when someone uses them without knowing the context.
The whole country's pretty similar in colour, innit? I suppose this is what Obama was talking about with the "I'll be your president too" stuff...
(map from wikimedia (svg), election results from Google, map as SVG, script to generate map)
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.