fluid-work IRC Logs-2009-07-03

[07:32:21 EDT(-0400)] * heidi_ (n=thesumme@bas5-oshawa95-1176479318.dsl.bell.ca) has joined #fluid-work
[08:22:28 EDT(-0400)] * Justin_o (n=Justin@142.150.154.171) has joined #fluid-work
[08:39:26 EDT(-0400)] * laurel (n=Laurel@142.150.154.178) has joined #fluid-work
[08:39:35 EDT(-0400)] <laurel> ol72eh
[08:39:55 EDT(-0400)] * Justin_o (n=Justin@142.150.154.171) has left #fluid-work
[09:02:17 EDT(-0400)] * hydee (n=hydee@70.31.166.86) has joined #fluid-work
[09:08:16 EDT(-0400)] * anastasiac (n=team@142.150.154.189) has joined #fluid-work
[09:09:48 EDT(-0400)] * yura1 (n=yura@142.150.82.64) has joined #fluid-work
[09:40:17 EDT(-0400)] * clown (n=clown@142.150.154.202) has joined #fluid-work
[09:43:11 EDT(-0400)] * jsilvaa (n=jsilva@CABLE-72-53-95-24.cia.com) has joined #fluid-work
[09:44:41 EDT(-0400)] * fj4000 (n=Jacob@142.150.154.106) has joined #fluid-work
[10:04:15 EDT(-0400)] * jessm (n=Jess@c-71-232-1-65.hsd1.ma.comcast.net) has joined #fluid-work
[10:38:57 EDT(-0400)] * Bosmo1 (n=Antranig@ginger.caret.cam.ac.uk) has joined #fluid-work
[10:39:08 EDT(-0400)] <anastasiac> hi Bosmo1, I have a question about using fluid.fetchResources()
[10:39:25 EDT(-0400)] <anastasiac> I want to retrieve a template from the current document, so that I can re-use it multiple times
[10:39:46 EDT(-0400)] <anastasiac> I'm assuming that I can use fetchResources by specifying the node - is this right?
[10:40:47 EDT(-0400)] <Bosmo1> Yes
[10:40:58 EDT(-0400)] <anastasiac> fluid.fetchResources({nodeId: "myID", callback);
[10:41:02 EDT(-0400)] <Bosmo1> Lots of interesting recent activity on CouchDB performance: http://davispj.com/2009/05/18/couchdb-timings.html
[10:41:36 EDT(-0400)] <anastasiac> so first question: my template is nothing but a <select>. Should I be providing the node of the <select>, or the node of the element containing the <select> ?
[10:41:57 EDT(-0400)] <Bosmo1> It would probably be safer to give it a node one higher up
[10:42:02 EDT(-0400)] <anastasiac> ok.
[10:42:15 EDT(-0400)] <Bosmo1> In theory it should work with the component itslef as a root element, but there is a greater chance of a bug...
[10:42:27 EDT(-0400)] <anastasiac> ?
[10:42:47 EDT(-0400)] <anastasiac> ok, well, I tried passing the ID of the parent of the <select>
[10:42:59 EDT(-0400)] <anastasiac> all the callback got was the same resoruceSpec, containing nothing but the nodeId
[10:47:02 EDT(-0400)] <anastasiac> ah, wait: Bosmo1, I think I may have found the problem
[10:47:17 EDT(-0400)] <anastasiac> what exactly should the first parameter to fetchResources look like??
[10:47:37 EDT(-0400)]

<anastasiac> fluid.fetchResources (

Unknown macro: {nodeId}

, callback); ?


[10:47:50 EDT(-0400)] <anastasiac> just a straight JS object with the nodeid?
[10:48:15 EDT(-0400)] <anastasiac> or should the thing be named:
[10:48:33 EDT(-0400)]

<anastasiac> fluid.fetchResources (

Unknown macro: { myThing}

, callback);


[10:49:56 EDT(-0400)] <Bosmo1> Yes
[10:49:58 EDT(-0400)] <Bosmo1> The latter
[10:50:11 EDT(-0400)] <Bosmo1> A resourceSpecs structure is a map of keys to resourceSpec objects
[10:50:36 EDT(-0400)] <anastasiac> ok, so I changed it, and it is now filling in the resource spec
[10:50:53 EDT(-0400)] <anastasiac> but all it's returning is the carriage return before the <select>!
[10:51:08 EDT(-0400)] <anastasiac> as the resourceText
[10:51:16 EDT(-0400)] <Bosmo1> Unusual
[10:51:38 EDT(-0400)] <Bosmo1> ah
[10:51:39 EDT(-0400)] <Bosmo1> I see
[10:51:56 EDT(-0400)] <Bosmo1> It is expecting the node's text to consist entirely of the template
[10:52:10 EDT(-0400)] <Bosmo1> I think this was written before we even dreamed it might be possible to just use innerHTML on the document...
[10:52:45 EDT(-0400)] <Bosmo1> I'm sorry, this isn't very helpful - it would probably be better for you to just fetch the resourceText yourself (tongue)
[10:53:09 EDT(-0400)] <anastasiac> ok, I'll try something like that.
[11:39:25 EDT(-0400)] <anastasiac> Bosmo1, if I'm just fetching the resourceText myself, I assume this is to fill in the resourceSpec to pass to parseTemplates, right?
[11:39:53 EDT(-0400)] <anastasiac> assuming this is so, what else do I need to fill in in resourceSpec?
[11:39:58 EDT(-0400)] <Bosmo1> yes, that's right
[11:40:14 EDT(-0400)] <anastasiac> do I need the href if I'm jsut working in the curren tdoc?
[11:40:19 EDT(-0400)] <Bosmo1> You don't need to fill in anything else except resourceKey
[11:40:48 EDT(-0400)] <anastasiac> resourceKey is not documented (smile)
[11:40:57 EDT(-0400)] <anastasiac> what should it be?
[11:42:11 EDT(-0400)] <Bosmo1> Just any unique key you want to use to identify your template...
[11:42:31 EDT(-0400)] <anastasiac> ok, I tried that - I'm still getting "resource.href is undefined
[11:42:31 EDT(-0400)] <anastasiac> [Break on this error] var lastslash = resource.href.lastIndexOf("/");
[11:42:41 EDT(-0400)] <anastasiac> line 520 of fluidParser.js
[11:42:53 EDT(-0400)] <anastasiac> it looks like it's still looking for the href...
[11:43:00 EDT(-0400)] <Bosmo1> Oh dear
[11:43:14 EDT(-0400)] <Bosmo1> You can make the href "." then
[11:43:36 EDT(-0400)] <Bosmo1> Oh well.... this is not very satisfactory
[11:43:58 EDT(-0400)] <anastasiac> that did the trick, but you're right
[11:44:02 EDT(-0400)] <anastasiac> you shouldn't have to do that
[11:44:07 EDT(-0400)] <anastasiac> is that a bug?? (wink)
[11:44:18 EDT(-0400)] <Bosmo1> Not exactly
[11:44:25 EDT(-0400)] <Bosmo1> I think we need a utility function to make this easier
[11:44:48 EDT(-0400)] <Bosmo1> The href is sort of required, since URLs within the document might need to be rebased
[11:45:41 EDT(-0400)] <anastasiac> ok
[11:56:50 EDT(-0400)] * Justin_o (n=Justin@142.150.154.171) has joined #fluid-work
[11:57:50 EDT(-0400)] <Justin_o> Bosmo1: Hello, just had a question about rendering
[12:49:28 EDT(-0400)] * Bosmon (n=Bosmon@78-105-207-102.zone3.bethere.co.uk) has joined #fluid-work
[12:49:48 EDT(-0400)] <Justin_o> hello Bosmon
[12:49:55 EDT(-0400)] <Justin_o> Just wondering about the renderer
[12:50:17 EDT(-0400)] <Justin_o> can i renderer a value and children inside the same element
[12:50:35 EDT(-0400)] <Bosmon> Well, no
[12:50:41 EDT(-0400)] <Bosmon> How could that be, in HTML
[12:50:46 EDT(-0400)] <Bosmon> Can you give me an example?
[12:51:14 EDT(-0400)] <Justin_o> so if i had something like <div> text <span> some more text</spa></text>
[12:51:29 EDT(-0400)] <Justin_o> i couldn't replace "text" and "some more text"
[12:51:35 EDT(-0400)] <Justin_o> that may not be a good example
[12:51:40 EDT(-0400)] <Bosmon> No, "text" needs to be inside its own node
[12:52:01 EDT(-0400)] <Bosmon> Otherwise, how could you identify it with a selector?
[12:52:24 EDT(-0400)] <fj4000> identify text itself?
[12:52:32 EDT(-0400)] <Bosmon> Say you had identified the node "div" with a selector - how would you then determine at which of the perhaps hundreds of positions as text nodes you wanted your text to appear?
[12:53:20 EDT(-0400)] <fj4000> could you not do what other libs do, which is to append/prepend text with reference to a potential sibling node?
[12:53:34 EDT(-0400)] <Bosmon> And which "potential sibling node" would that be?
[12:53:46 EDT(-0400)] <fj4000> whichever you want
[12:53:47 EDT(-0400)] <Bosmon> And, can you provide me with an instance of an "other lib" which works this way? (tongue)
[12:53:54 EDT(-0400)] <fj4000> in our case, above the last child
[12:54:03 EDT(-0400)] <Bosmon> And why above the last child?
[12:54:05 EDT(-0400)] <fj4000> one sec
[12:54:12 EDT(-0400)] <Bosmon> And not after it?
[12:54:30 EDT(-0400)] <Bosmon> Is there any reason to prefer the position before the last child, to the position after it?
[12:56:30 EDT(-0400)] <fj4000> .appendTo, prependTo, and I think wrapInner looks like it can work too
[12:56:36 EDT(-0400)] <fj4000> with jquery, that is
[12:56:47 EDT(-0400)] <Bosmon> Yes... now, say all you know about the node is the selector
[12:56:48 EDT(-0400)] <fj4000> in our case, it was the position before
[12:56:57 EDT(-0400)] <Bosmon> WHich one are you going to choose, out of those three?
[12:57:02 EDT(-0400)] <Bosmon> Are you going to throw a dice?
[12:57:17 EDT(-0400)] <Bosmon> Perhaps, look at what colour your toenails are today.....
[12:57:55 EDT(-0400)] <fj4000> how would you not know through inferrence?
[12:58:01 EDT(-0400)] <Bosmon> Now, say, further, that the node had three children?
[12:58:08 EDT(-0400)] <fj4000> wouldnt the way you define the children identify this?
[12:58:12 EDT(-0400)] <Bosmon> You now have four possible places to put markup
[12:58:26 EDT(-0400)] <fj4000> yes, but isnt all this defined in the array of children's order?
[12:58:39 EDT(-0400)] <fj4000> im just guessing here
[12:58:53 EDT(-0400)] <fj4000> seems like it would be, from the little I saw
[13:07:43 EDT(-0400)] * yura1 (n=yura@142.150.82.64) has joined #fluid-work
[15:49:58 EDT(-0400)] * jessm (n=Jess@c-71-232-1-65.hsd1.ma.comcast.net) has joined #fluid-work
[16:59:57 EDT(-0400)] * anastasiac (n=team@142.150.154.189) has left #fluid-work
[17:22:46 EDT(-0400)] * clown (n=clown@142.150.154.202) has left #fluid-work
[20:05:05 EDT(-0400)] * heidi_ (n=thesumme@bas5-oshawa95-1176479318.dsl.bell.ca) has joined #fluid-work
[20:39:12 EDT(-0400)] * heidi (n=thesumme@bas5-oshawa95-1176479318.dsl.bell.ca) has joined #fluid-work