**** BEGIN LOGGING AT Fri Sep 12 02:59:58 2014 Sep 12 10:11:28 morning enyos Sep 12 15:20:45 Morning Sep 12 15:20:56 morning Sep 12 15:41:04 good morning Sep 12 15:59:08 Hello enyo folks, I have a challenge for you today. I would like a repeater that has images in it, that it's imperative that no more than 3 are loading from the server at a time. Sep 12 16:01:03 so... you want delayed image loads? Sep 12 16:01:57 Hmmm, I don't think I gave enough information. I want the repeater setup function to be called for the next item when there is an available slot Sep 12 16:02:19 when there is an available slot? Sep 12 16:02:56 so, after the image has finished loading, the next repeater setup function can be called. But only three can be loading at a time Sep 12 16:03:25 why is there a limit to 3 at a time? Sep 12 16:03:54 The setup function will have to get a time sensative signature for the image Sep 12 16:04:29 which it will get from the server via socket.io Sep 12 16:04:44 time-sensitive signature? You mean a generated URL? Sep 12 16:05:07 Well, yes Sep 12 16:05:31 but that URL will only be valid for X seconds (lets say 3) Sep 12 16:06:16 so, I have to get it the moment the client is about to load the image Sep 12 16:06:52 well, a simple braindead implementation would be to spinlock the setup function while numImages >= 3 Sep 12 16:07:54 then after it gets past the lock, it would increase numImages by one and display the image and make an ajax query that when it returns would decrease numImages by one in its callback Sep 12 16:08:22 or something along those lines Sep 12 16:09:29 how would you spinlock the setup function? Sep 12 16:10:00 empty while loop at the top of the function Sep 12 16:10:23 something like: while (numImages > 3); Sep 12 16:10:55 hmmm that sounds like it would prevent my images from loading :) Sep 12 16:11:11 trex0051: that's the point :P Sep 12 16:11:28 No, I mean the 3 that are supposed to be loading Sep 12 16:11:35 so it would never unlock Sep 12 16:11:44 No, because you would start w/ numImages = 0 Sep 12 16:11:51 it would freeze the program Sep 12 16:11:53 when you are loading an image, you would increase it by 1 Sep 12 16:12:24 maybe I could queue the setup calls, and use a timer to check and flush them Sep 12 16:12:47 right, but that while loop would take 100% of the processing power wouldn't it? Sep 12 16:12:53 "freeze", no, but it wouldn't allow you to do anything but loading the images while it was being displayed (I did say this was a braindead imp) Sep 12 16:13:41 Honestly, "repeater" and what you want to do do not really match up :\ Sep 12 16:14:11 Because you want to limit the rate that things appear Sep 12 16:14:56 Another method you could try Sep 12 16:15:02 is using a DataRepeater Sep 12 16:15:02 I want to display unlimited of a control on a page, as fast as possible Sep 12 16:16:26 Using a DataRepeater, you could add 3 to its collection, and write a callback for each of the images onload events that would add another image to the DataRepeater's collection Sep 12 16:20:47 I'm trying to work that out here :) Sep 12 16:27:02 this is the only datarepeater sample I can find and it doesn't seem to be working : http://jsfiddle.net/sugardave/fEwYd/ Sep 12 17:15:38 trex0051: oh man, that's an oldie Sep 12 17:15:52 back when bindings used to use "bindFrom" Sep 12 17:20:54 let me give you a better example, might take a little bit Sep 12 17:21:57 oh, heh, there are many updates to that one Sep 12 17:22:00 trex0051: http://jsfiddle.net/fEwYd/17/ Sep 12 17:45:28 sugardave: Thanks :) Sep 12 17:45:37 I'll play with that now Sep 12 17:58:54 it can be made simpler, I was still fighting bugs as it was all being developed (nightly is a dangerous place sometimes!) Sep 12 17:59:51 trex0051: 18 is a bit simpler/cleaner Sep 12 18:17:20 sugardave: it says 18 doesn't exist Sep 12 18:18:13 lol indeed it doesn't Sep 12 18:20:38 that's....odd Sep 12 18:20:41 try this one: http://jsfiddle.net/sugardave/fEwYd/19/ Sep 12 18:20:52 trex0051: ^^^ Sep 12 18:20:57 ah Sep 12 18:21:01 sugardave: Sep 12 18:21:04 the original link Sep 12 18:21:05 Thank you, you're right that is cleaner. Sep 12 18:21:08 did not have /sugardave Sep 12 18:21:13 oh, oops Sep 12 18:21:22 :) Sep 12 18:29:33 trex0051: also, if you truly want "unlimited" controls to display, you probably need to switch to DataList instead (works the same, but has its own Scroller embedded) Sep 12 18:30:10 the same limitations for switching between plain old Repeater and plain old List are the same for the Data variants Sep 12 18:32:23 trex0051: this may be a simpler example (no loops creating the collection) http://jsfiddle.net/L2vdkp69/ Sep 12 18:48:48 I can't even get my simple test working because I seem to have some syntax error or something that's making it so App is not found Sep 12 18:48:49 http://jsfiddle.net/#&togetherjs=wwcnsuKFKs Sep 12 18:50:53 it's got to be something obvious, but I've been looking and looking and can't see it Sep 12 18:54:37 trex0051: check Layout Sep 12 18:54:39 on the left Sep 12 18:54:50 FittableRows is part of enyo's Layout library Sep 12 18:59:22 trex0051: that fixed it for you, right? Sep 12 19:15:24 I think he's on his way now Sep 12 19:15:35 sugardave: yup Sep 12 19:15:42 I haven't done that collaborative thing on jsfiddle before, that's pretty cool! Sep 12 19:15:57 yes and no. It floods the console Sep 12 19:16:05 so you cannot view the errors as easily Sep 12 19:16:29 they should have a simulated console to deal with that Sep 12 19:17:29 So sugardave was Wild Wolf and GodGinrai was Observant Owl? Sep 12 19:17:38 I was Wild Wolf Sep 12 19:17:44 sugardave was Observant Owl Sep 12 19:17:47 ahhh man, had it backwards Sep 12 19:17:50 no, I was "me" Sep 12 19:17:55 sugardave: lol Sep 12 19:18:16 trex0051: you were "Silent Seal" Sep 12 19:19:28 So now, I need to just put an onload in the image to see if it loads them one at a time. Sep 12 19:20:05 trex0051: Yea, basically, you'll want your onload to add the next image to the repeater's collection Sep 12 19:20:11 trex0051: note that you don't have to have that collection in the main App kind, but if you do, you can manipulate it from various parts of your app to affect change whenever you need/want it Sep 12 19:20:32 I was hoping I could just onload:"functionName" but no such luck Sep 12 19:21:15 you should be able to do that, but the bindings will be screwy. if you define "functionName" on the repeater (maybe, or that wrapper component) it might work Sep 12 19:22:11 so break the repeater out into it's own kind? Sep 12 19:22:22 trex0051: nah, you don't need to do that Sep 12 19:22:26 I have it on the wrapper right now Sep 12 19:22:38 it's just addImage Sep 12 19:23:28 just a sec Sep 12 19:24:58 hrmm Sep 12 19:25:43 yea, that's not working Sep 12 19:27:00 trex0051: let's cheat Sep 12 19:27:08 oh wait Sep 12 19:27:10 that won't work Sep 12 19:27:10 nvm Sep 12 19:27:11 I'm ALL about cheating Sep 12 19:27:21 I call it being resourceful Sep 12 19:28:01 hrmm Sep 12 19:28:07 I thought there was a this.bindSafely Sep 12 19:28:13 is it just this.bind? Sep 12 19:28:55 Careful, Sages are powerful, you don't want to bind them Sep 12 19:29:16 lol Sep 12 19:29:56 god I never use bindSafely so I totally don't remember how it works XD Sep 12 19:32:13 back to the resourceful idea? Sep 12 19:32:28 nah, that idea wouldn't work Sep 12 19:33:01 what I don't understand Sep 12 19:33:24 is why that embedded function didn't work Sep 12 19:35:48 :) Sep 12 19:35:54 wow Sep 12 19:36:10 I didn't even know you could put functions there Sep 12 19:36:15 yup Sep 12 19:36:22 it's bad practice to, tho Sep 12 19:36:28 but you can, because they get mixed in Sep 12 19:37:15 So DataRepeater apparently has some special powers.... like a sage. Sep 12 19:40:27 I missed the error Sep 12 19:40:35 this.app is undefined Sep 12 19:40:55 which means I properly put the addImage function on the onload Sep 12 19:41:05 but it cannot access this.app Sep 12 19:42:22 lol Sep 12 19:42:48 too much recursion Sep 12 19:44:23 doh Sep 12 19:44:27 bad habit Sep 12 19:44:35 lol yup, still too much recursion Sep 12 19:44:46 honestly, semicolons are a good habit ;) Sep 12 19:44:49 saves you elsewhere Sep 12 19:45:00 I'd rather make that error than others :P Sep 12 19:45:53 let me check something real quick Sep 12 19:47:35 was worth hoping Sep 12 19:47:38 lol Sep 12 19:51:31 if this.bindSafely does not work, you can try enyo.bindSafely([theContext], [theFunction or function string]) Sep 12 19:51:54 sugardave: tried that, but did not receive the desired result :\ Sep 12 19:52:09 trex0051: I've got a solution in mind that may work Sep 12 19:52:15 but I need to leave work now Sep 12 19:52:40 I should be back home within an hour or so if you'll still be around for me to show you Sep 12 19:53:16 I'll be around for about an hour and a quarter then I must get my kids from daycare Sep 12 19:53:24 but I'll keep working on this :) Sep 12 19:53:35 oh wait, nvm. My idea wouldn't pan out anyway :/ Sep 12 19:53:55 I thought collections had unique ids that could be accessed from the enyo object Sep 12 19:54:08 (read something wrong in the api) Sep 12 19:54:43 anyway, cya guys later Sep 12 20:18:13 sugardave: / GodGinrai: apparently the having to access functions within the scope of the data repeater is a known issue as of 4 days ago : https://enyojs.atlassian.net/browse/ENYO-4058 Sep 12 20:18:27 (will repeat when GodGinrai is back) Sep 12 20:42:37 well, there you go! Sep 12 20:53:56 crowd debugging ? Sep 12 20:56:13 sugardave: now if only there were a workaround. Do you have any idea how to get "this" from a function within the dataRepeater? Sep 12 21:18:38 trex0051: do you have something that is trying to do it I can look at? Sep 12 21:26:15 eh, I will have to look later tonight, I have some fire drill stuff to do now Sep 12 21:26:16 woo Sep 12 21:26:33 sounds like my job :P Sep 12 21:29:51 heh, you're a literal fireperson, right? Sep 12 21:45:58 s/person/fighter/ Sep 12 21:45:58 sugardave meant: heh, you're a literal firefighter, right? Sep 12 22:00:57 sugardave, yup **** BEGIN LOGGING AT Fri Sep 12 22:40:38 2014 **** BEGIN LOGGING AT Fri Sep 12 23:15:27 2014 **** BEGIN LOGGING AT Sat Sep 13 01:26:41 2014 **** ENDING LOGGING AT Sat Sep 13 02:59:58 2014