**** BEGIN LOGGING AT Tue Jan 05 05:58:14 2010 Jan 05 11:36:22 hello Jan 05 11:36:28 ayone happen to be around? Jan 05 11:36:57 i was wondering on how i get access to the widget models of widgets places with Ares Jan 05 12:04:27 frederic_h in the designer view, when you click the widget, on the right you have this model pane, there you can give out a model name, which can be used within the assistant Jan 05 12:05:12 I need something like a status LED... images or something? Jan 05 12:06:09 thanks joekinley, would i address it via this.modelName in the assistant then? Jan 05 12:06:18 exactly Jan 05 12:06:25 awesome, thanks Jan 05 12:06:32 no problem Jan 05 12:06:46 jettero just open paint, make a small circle with a black border Jan 05 12:06:50 color as wanted Jan 05 12:06:53 ;) Jan 05 12:07:27 :) Jan 05 12:07:43 I'll open inkscape and make an LED that looks good, but that was my idea also Jan 05 12:08:27 ya.. developers should start to just belive in their art and do crappy graphics... Jan 05 12:08:48 are you saying my inkscape foo is bad? Jan 05 12:10:44 no.... i just know mine totally is ^^ Jan 05 12:10:49 :) Jan 05 12:10:56 I'm no graphic designer, but I can do things in inkscape Jan 05 12:11:04 there's tutorials on youtube that get you up to speed Jan 05 12:11:16 yeah i once used it.. after 2 hours i was able to make a triangle Jan 05 12:16:28 ah Jan 05 12:16:42 sucks that the url of a webvew is defined in attributes Jan 05 12:17:12 element.mojo.openURL doesn't seem to work in assistant.reay Jan 05 12:17:15 ready* Jan 05 12:17:53 any idea? Jan 05 12:20:17 joekinley: I had something decent, but deleted it by accident. kids distract me terribly Jan 05 12:21:33 hm, webview placed in ares doesn't seem to work at all :o Jan 05 14:06:34 guten morgan everyone Jan 05 14:07:20 hello LoneStar20 Jan 05 14:08:16 how you doing today> Jan 05 14:08:17 ? Jan 05 14:11:38 fine fine Jan 05 14:13:05 same here working on app menu stuff Jan 05 14:15:38 anyone available? Jan 05 14:15:59 i cannot seem to get webviews to work via Ares Jan 05 14:16:42 frederic_h: does it work when not using ares? Jan 05 14:17:22 hi there fellows Jan 05 14:17:37 I'm completly new to Palm Pre and it's WebOS Jan 05 14:17:59 and I'm wondering if there ain't more than the ones showed on palms webpage... Jan 05 14:18:00 :S Jan 05 14:18:17 mor e what? Jan 05 14:20:24 i have the following in an app menu - but does not seem to push a scene.. what am I missing? http://www.pastebin.org/71353 Jan 05 14:22:08 LoneStar20: Jan 05 14:22:12 no it doesnt either Jan 05 14:22:29 i just found out the emulator is starting to have connection problems again Jan 05 14:22:34 i hate when that happens Jan 05 14:23:15 it is something with your code, I had a similar problem when i was testing webview Jan 05 14:23:27 LoneStar20: is this in handleCommand? Jan 05 14:25:06 LoneStar20: no its not the code, the browser app doesnt work either. Jan 05 14:25:32 haeffb_wirc: nope it is not in the handleCommand Jan 05 14:25:46 frederic_h: restart your emulator Jan 05 14:26:03 where is it then? Jan 05 14:28:38 morn'n folks Jan 05 14:34:15 hi Bmyers Jan 05 14:42:16 LoneStar20: did not work Jan 05 14:42:29 i am going to reinstall the SDK Jan 05 14:46:31 win7 + shady wifi = goodluck Jan 05 14:47:20 hrhr Jan 05 14:47:51 im on MacOSX 10.6.2 and 100Mbit/s Jan 05 14:47:56 luckily Jan 05 14:48:12 haeffb_wirc: i noticed that code is inside "FirstAssistant.prototype.handleCommand = function (event) {" Jan 05 14:48:17 nice Jan 05 14:48:37 have been having tons of problems with win7 and wifi Jan 05 14:49:02 win7 really slow to connect Jan 05 14:49:33 yea im having win7 at home Jan 05 14:52:14 http://www.webos101.com/WebView Jan 05 14:53:47 BAH Jan 05 14:53:58 now Ares wont launch the app in the emulator anymore Jan 05 14:54:52 thanks for the link, although i have determined it was the emulator not being able to connect to the internet Jan 05 14:56:01 yeah, the emulator flakes out once in awhile Jan 05 14:57:14 like if choose "save machine state" and reopen the emulator, the internet will not work Jan 05 14:59:08 well i always shut it down completely tho Jan 05 15:01:14 oh ok Jan 05 15:01:25 great Jan 05 15:01:33 now ares wont start my app in the emulator anymore Jan 05 15:01:35 what the hell Jan 05 15:01:53 i can even restart the emulator via ares, but it just wont launch my app Jan 05 15:02:01 I have a Nokia N900 and I'm thinking about moving to Palm Pre Jan 05 15:02:04 is this a good idea? Jan 05 15:02:05 :S Jan 05 15:02:19 whats wrong with you n900? Jan 05 15:02:26 your* Jan 05 15:02:36 the interface Jan 05 15:02:44 Palm Pre is more eye candy Jan 05 15:02:54 yea thats tru lol Jan 05 15:02:56 and on the exterior, Palm Pre looks much nicer Jan 05 15:03:19 however, I've been following N900 and Meamo...and everyday there's new stuff coming out Jan 05 15:03:31 there's repositories os SW and so on Jan 05 15:03:33 well if thats everything for you that counts Jan 05 15:03:39 but for Plam Pre, I know nothing... Jan 05 15:04:08 are there good apps? innovation? features? Jan 05 15:04:12 you can download the emulator and play with that to get an idea about webOS Jan 05 15:04:16 Pre reviews are sooooooo lame Jan 05 15:05:05 where can I find that emulator, and where can I find all apps for palm pre? Jan 05 15:05:10 :) Jan 05 15:05:15 developer.palm.com Jan 05 15:05:27 u cant buy apps with it tho Jan 05 15:05:41 http://catalog.webosschool.com/#main Jan 05 15:06:40 mh...is there a patch that turns the enter button to new line in messaging? i always send my sms to early because i press enter when i want to get to the next line^^ Jan 05 15:08:14 lol Jan 05 15:08:17 fuck me Jan 05 15:08:18 and the apps for palm pre being developed only by palm Jan 05 15:08:25 ofcourse it doesnt launch it in emulator Jan 05 15:08:29 or are there other people developing stuff for it? Jan 05 15:08:31 i have the device plugged in -.- Jan 05 15:08:43 frederic_h: did you try logging out of ares and back in? Jan 05 15:09:06 Sir_Lancelot: no, its third party devs, like ppl in this channel Jan 05 15:09:12 LoneStar2010: yes i have Jan 05 15:09:34 i had the device hooked up my mac so it launched on there and i didnt notice Jan 05 15:09:36 anyone having trouble with calendar events not alerting? Jan 05 15:09:48 and where can I find those 3rd party apps? Jan 05 15:10:05 via the palm app catalog Jan 05 15:10:10 or the link LoneStar2010 sent Jan 05 15:10:47 or precentral but thats kinda inofficial Jan 05 15:11:53 when i was testing out ares, i notices that that after a while apps launched in the emulator, so i think there is something in ares, that is weird, when sending to emulator Jan 05 15:13:15 I was told that the official apps are only available to those you have a SIm card from a country where Palm Pre is available Jan 05 15:13:17 is that true? Jan 05 15:13:33 because I'm living in a country whre Plam Pre is not available Jan 05 15:13:40 I would have to buy it outside Jan 05 15:14:54 no thats not Jan 05 15:15:03 i have an american device and im in germany Jan 05 15:15:12 only have working wlan Jan 05 15:15:15 still can get apps Jan 05 15:15:24 i do have activated the device in the us tho Jan 05 15:15:37 http://www.precentral.net/paid-app-catalog-expanding-europe-march Jan 05 15:15:42 but thats just the cdma - gsm incompatiblity Jan 05 15:15:48 what do they mean with this than? Jan 05 15:16:10 at the moment there are no paid apps for europe Jan 05 15:16:13 just free apps Jan 05 15:16:25 (sorry I'm making all these questions, but I don't to buy something from outisde, and than discover that it's useless where I live... ) Jan 05 15:16:47 but, how about the 3rd party apps? Jan 05 15:16:52 the unofficial ones Jan 05 15:17:01 its all third party apps Jan 05 15:17:14 the pal app catalog works much like appples app store Jan 05 15:17:53 but there's a "Cydia" app as well for palm pre? Jan 05 15:17:58 no Jan 05 15:18:01 ahhhhh Jan 05 15:18:04 ok Jan 05 15:18:09 Cydia is only available with Jailbreak Jan 05 15:18:10 but Jan 05 15:18:23 I know....but isn't there something similar Jan 05 15:18:25 for Palm Pre Jan 05 15:18:30 ? Jan 05 15:18:34 you can get apps no in the catalog on the phone by putting in in dev mode etc Jan 05 15:18:39 a "Pre cydia" ehehehe Jan 05 15:18:43 see precentral.net for that Jan 05 15:19:38 they call it homebrewed apps Jan 05 15:20:07 LoneStar2010: ping Jan 05 15:21:39 back haeffb_wirc Jan 05 15:21:47 had some wifi issues Jan 05 15:21:51 instead of Mojo.Controller, try this.controller.stageController Jan 05 15:22:03 so, summarizing: there's are 2 sources for apps. The official Palm store, and the Precentral.net Jan 05 15:22:04 right? Jan 05 15:22:32 in which, the Precentral is something like Cydia for iphone, with it's own repository and so on Jan 05 15:22:43 is my understanding, correct? Jan 05 15:24:41 Yes, essentially. Jan 05 15:25:12 in adddition to precentral, there are a couple of other app feeds. Jan 05 15:25:19 haeffb_wirc: this is what I have: http://www.pastebin.org/71374 Jan 05 15:26:30 yes, replace Mojo.Controller with this.controller please. Jan 05 15:28:57 really haeff_wirc? Jan 05 15:29:00 which ones? Jan 05 15:29:08 I'm starting to like Palm pre Jan 05 15:29:09 :D Jan 05 15:29:52 Hi, is it possible to write my own sync for my accountid ? To sync contacts/calendars against my own webservice. Jan 05 15:31:38 do palm folks idle here? there's an error in the 1.3.5 release notes on developer.palm.com Jan 05 15:32:20 palm-log-level should be palm-log Jan 05 15:32:35 and the argument could be clearer as well Jan 05 15:33:49 mainly webos-internals Jan 05 15:34:09 haeffb_wirc: did not work: do you think this is incorrect: "switch (event.type ) {" Jan 05 15:34:38 switch (event.command) ? Jan 05 15:35:58 log the event.command to see what is coming thru Jan 05 15:36:45 LoneStar2010: what's the problem u are experiencing= Jan 05 15:36:51 ? Jan 05 15:37:00 i can not pull up a scene Jan 05 15:38:19 haeffb_wirc: "pushScene('bg')" equals ="views/bg/bg-scene.html" is that correct? Jan 05 15:38:55 yes Jan 05 15:39:24 are you getting to the pushScene call? Jan 05 15:40:32 could it be something missing in the stage assistant? Jan 05 15:41:24 LoneStar2010: wrap everything in handleCommand in a try/catch Jan 05 15:41:35 also what kind of event is "background"? Jan 05 15:42:59 "background" = " {label: "Background", command: 'background'}," Jan 05 15:44:34 doent you have to check for event.command then? Jan 05 15:45:36 frederic_h: yeah probably Jan 05 15:46:04 this is what I have: http://www.pastebin.org/71374 Jan 05 15:46:46 maybe I can simply push a div, instead of a scene... Jan 05 15:47:17 hm Jan 05 15:47:35 well switch(event.command) is what you have to do Jan 05 15:47:39 but i think u did that already Jan 05 15:48:33 frederic_h: I think so... Jan 05 15:48:49 haeffb_wirc: "StageAssistant.prototype.setup = function() { Jan 05 15:48:49 this.controller.pushScene("first"); Jan 05 15:48:49 this.controller.pushScene("bg"); Jan 05 15:48:49 };" Jan 05 15:51:06 BrowserAdapter::setMinFontSize(int): Bad arguments. Jan 05 15:51:16 wow thats.... interesting Jan 05 15:55:14 frederic_h: does a stage need to have a "stage-assistant.js"? Jan 05 16:07:58 Happy New Year, everyone Jan 05 16:07:59 LoneStar2010: i do think so Jan 05 16:08:02 yes Jan 05 16:08:11 happy new year to you too sugardave Jan 05 16:08:16 how would i push my first scene by default and another when an option is choosen Jan 05 16:08:18 http://www.pastebin.org/71400 Jan 05 16:08:29 Happy New Year sugardave Jan 05 16:08:30 Lonestar2010: you should not push two scenes from stageAssistant. Jan 05 16:08:45 what you had is close Jan 05 16:08:57 LoneStar2010: store the option in a cookie that you check when you start up...if it's not there push the default scene, otherwise push the one you choose Jan 05 16:09:34 haeffb_wirc: i am able to see "bg" now but it overrides my first scene Jan 05 16:09:58 in your handleCommand, change to switch(event.command) Jan 05 16:10:21 and change Mojo.Controller to this.controller Jan 05 16:10:21 LoneStar2010: that is because u push two scenes right after another Jan 05 16:10:23 haeffb_wirc: got it working Jan 05 16:12:09 Was missing: bg-assistant.js // and also forgot to assign it in "source": "app\/assistants\/bg-assistant.js", "scenes": "bg", in "sources.json" Jan 05 16:13:01 sugardave: ok you brought up something, I will need: do you know of a cookie tutorial? Jan 05 16:13:46 ok Jan 05 16:15:04 LoneStar2010: no tutorials I know of, but cookies are pretty straightforward Jan 05 16:15:34 the only thing I can say for sure about them is they are "all or nothing"....meaning if you want to store multiple value pairs in the cookie, you have to write them EVERY time Jan 05 16:15:38 haeffb_wirc: so for every scene I need a "this-assistant.js" regardless of how simple? Jan 05 16:15:47 you can't write prop1=val1 and then later just do prop2=val2 Jan 05 16:15:59 you'll just end up with a cookie that contains prop2/val2 Jan 05 16:15:59 yes Jan 05 16:17:37 if I need to store the name of a city when the app is opened, is a cookie the best solution? but if the person travels, the name of the city might change... Jan 05 16:19:05 LoneStar2010: that might best be handled with a GPS call and a reverse location lookup? Jan 05 16:19:14 not sure what you are doing... Jan 05 16:21:31 sugardave: need to store a color value, but can be changed, when ever the user decides to change the color Jan 05 16:24:05 LoneStar2010: something like that should be saved in a cookie/depot/db, then....and when they change it, update, of course Jan 05 16:28:16 sugardave: i am looking for the simplest solution.... Jan 05 16:30:14 Anyone know if we need to remove all patches before the 1.3.5.1 update? Jan 05 16:30:35 Assuming so, but if it's a small delta... You never know. Jan 05 16:31:03 Roy - I didn't remove patches, and got hosed up and had to webDoctor it Jan 05 16:31:15 restore with older webos doctor Jan 05 16:31:38 Blah Jan 05 16:31:50 i cant seem to click any links in my webview anymore Jan 05 16:32:11 I wish I knew why the 4x4 launcher patches don't do a luna restart after installing so you can see the new launcher. Jan 05 16:32:48 view script Jan 05 16:32:50 should Jan 05 16:36:48 is there a trick to progress pills? Jan 05 16:37:05 if i update it too quickly, it never gets updated at all Jan 05 16:37:06 Bmyers: One pill makes you smaller... Jan 05 16:37:19 is alice around? Jan 05 16:37:29 need to ask her i guess Jan 05 16:38:43 seriously tho. if you call modelchanged to much, it doesnt updated the pill at all Jan 05 16:40:49 sounds like an old girlfriend. If I called her too mjch, she'd stop responding... Jan 05 16:40:55 Bmyers: how often do you call it Jan 05 16:41:58 once every 2 or 3 hundred milliseconds Jan 05 16:42:42 any more than that and it doesnt update at all Jan 05 16:42:52 that doesnt really make sense Jan 05 16:43:09 same behaviour on the device and in the emulator? Jan 05 16:43:38 only testing on device Jan 05 16:43:56 hm Jan 05 16:44:54 just to make sure, arial narrow is a font recognised by webos on the pre/pixi? Jan 05 16:44:54 whats a reasonable amount of time to expect the pill to update? Jan 05 16:47:16 everything should be reasonable Jan 05 16:49:18 okay i have tried Ares now for a small project Jan 05 16:49:26 alice: ping Jan 05 16:50:00 but in all honesty: i think it would have been done way faster with TextMate Jan 05 17:02:09 * hucksy is away: Away Jan 05 17:02:30 anyone have any pictures online that have gps coords in their exif headers? Jan 05 17:02:56 I'm trying to read the exif data from my Pre and all my tools are complaining about corrupt exif data Jan 05 17:03:18 for example, http://webos.pastebin.com/d795b73b0 Jan 05 17:09:38 looks like the Pre outputs broken exif data Jan 05 17:10:37 hi everyone Jan 05 17:10:50 Bmyers: when I was playing with progress pill (see webos101 extended widget examples) I got odd behavior if I tried to update it too often, as well...so I broke it out into 5% chunks in the logic Jan 05 17:11:16 That was a nice, fast update. Jan 05 17:11:21 LoneStar2010: the simplest way to store a color preference would be in a cookie Jan 05 17:11:30 I forgot to take a screen capture of the update for a post, though. Jan 05 17:11:59 * sugardave can't try to play Quake yet. Jan 05 17:12:13 package manager still hosed and I forgot to bring my cable in to work today Jan 05 17:12:20 so, no fixy yet Jan 05 17:24:27 sugardave; ok thanks Jan 05 17:25:33 you bring it to work? I have spare cable I can mail you if you want a spare. I have enough of them Jan 05 17:27:12 sugardave: this one? http://www.webos101.com/Extended_widgets#ProgressPill_.22widget.22 Jan 05 17:35:14 Bmyers: yeah, that's the one, though I notice I didn't really do the 'only send at 5%' thing...just updated the text every 5% Jan 05 17:36:04 would the following work on webOS "myAddEventListener(window, 'load', makeColorSelectors);" Jan 05 17:36:21 hi there Jan 05 17:36:24 i have a question Jan 05 17:36:30 howdy Jan 05 17:36:37 i tried working through the API, but I don't get it Jan 05 17:37:08 I wanna save some values in a cookie as soon as my app is closed, and I want it to load them again, when re-opened Jan 05 17:37:14 LoneStar2010: you can use "standard" event listeners however you want in webOS in addition to the Mojo ones Jan 05 17:37:18 but i just don't get how to do that Jan 05 17:38:07 svetter: read the cookie in stage or app assistant setup and write it in scene deactivate Jan 05 17:38:13 svetter: need the same solution =) Jan 05 17:38:22 yeah, i get that Jan 05 17:38:34 but i don't understand how to correctly code that Jan 05 17:38:39 let me eat this lunch and if nobody has given an example I will Jan 05 17:39:14 I would REALLY appreciate that Jan 05 17:39:16 OK, the clipboard has gotten me now :( Jan 05 17:39:59 g073nks: clipboard prbolem? Jan 05 17:40:25 LoneStar2010, yes, i am using the "Mojo.Controller.StageController.setClipboard(" but i must be using it wrong Jan 05 17:40:42 stageController Jan 05 17:40:55 "this.controller.stageController.setClipboard('hello webos',true);" Jan 05 17:41:16 lol that's a cut and paste offdeveloper.palm.com Jan 05 17:41:22 ok, i'll tweak that Jan 05 17:41:26 trust no one Jan 05 17:42:56 woo hooo thanks Jan 05 17:42:59 looks like all Pre images have broken exif headers. Jan 05 17:43:23 now to figure how to add to the menu XD Jan 05 17:44:11 var = 'poop'; "this.controller.stageController.setClipboard(poop, true);" Jan 05 17:44:58 sugardave: what is a standard event listener? Jan 05 17:46:42 sugardave: hurry up and eat will ya? we're all stuck here.. Jan 05 17:46:56 pill widget wont setup... Jan 05 17:47:03 sugardave: "myAddEventListener(window, 'load', makeColorSelectors);" works on all web browsers, but for some reason, i am sure it does not work with webOS Jan 05 17:47:31 i think there is an extra } in your example on that page Jan 05 17:47:44 lol i love how ares + firefox = 1GB ram usage by morning Jan 05 17:48:12 r u listening to a standard widget LS2010? Jan 05 17:49:31 Bmyers: i am listening to some external javascript code, not located in "this-assistant.js" Jan 05 17:50:15 the code works when using the webOS browser, but does not display on stage Jan 05 17:50:27 sorry webOS scene Jan 05 17:51:51 stupid lab Jan 05 17:52:32 LoneStar2010: I mean you can add an event listener the regular old js way (or even use Prototype's special one, which is what Mojo wraps, I believe) Jan 05 17:54:10 sugardave: if the code works in the webOS browser it should by theory work in "this-scene.html"? Jan 05 17:54:53 it's highly probable Jan 05 17:56:02 ok thanks, must be something I am overlooking then... Jan 05 17:56:33 I mean there MAY be some tweaking you might have to do here and there, but for the most part, if it works in the browser, it will probably work as a scene Jan 05 17:58:06 sugardave: is there an extra } in your example on web101? the progresspill widget var? Jan 05 17:58:46 sugardav1: if I pastebin the code and you do a quick look over, maybe it is something obvious I am missing Jan 05 17:58:57 i can get the widget to instantiate Jan 05 17:59:39 http://www.pastebin.org/71427 Jan 05 18:02:39 hold up a minute guys, real work is bothering me Jan 05 18:03:29 is sugardav1 a palm developer? Jan 05 18:04:16 he's just a glutton for punishment.. Jan 05 18:05:13 btw.: I vote for developer phones from palm! :-D My Pre dropped from a 8th floor window on new years eve... :-( Jan 05 18:05:36 svetter: wow! Jan 05 18:05:53 its not the falling that broke your phone Jan 05 18:05:59 yeah... a "wow" is what I deserve for that ;-) Jan 05 18:06:03 2nd the motion for Developer Pres! Jan 05 18:06:11 it was the stopping.. Jan 05 18:06:14 :-D Jan 05 18:06:16 right you are Jan 05 18:06:52 were you testing the accelorometer? Jan 05 18:07:23 8) Jan 05 18:07:52 the aerodynamics Jan 05 18:07:58 lol Jan 05 18:08:05 bounce test... Jan 05 18:08:34 hope you were logging the data via ajax and not sql.. Jan 05 18:09:04 couldn't convince palm that this was a case for insurance 9.9 Jan 05 18:09:39 so now I'm on my 4 year old samsung slider 8) Jan 05 18:09:49 did u tell them you've dropped it from higher than that and had it survive? Jan 05 18:10:08 damn Jan 05 18:10:12 should have tried that :) Jan 05 18:11:12 the phone shouldnt bust apart just cause you drop it on the ground one time.. Jan 05 18:11:36 hi Jan 05 18:11:59 (allbeit from 8 stories up) Jan 05 18:13:13 svettter: insurance? or warranty? Jan 05 18:13:24 is there any chance to implement sms sending reports on the pre? Jan 05 18:13:26 my bad Jan 05 18:13:29 warranty ;) Jan 05 18:14:34 u r missing some great one liners about svetters phone here heaffe Jan 05 18:21:45 so is anyone here who can help me with the cookie syntax? Jan 05 18:21:53 I don't know how to do it right+ Jan 05 18:22:37 svetter, http://www.javascripter.net/faq/settinga.htm Jan 05 18:22:38 like that? Jan 05 18:23:00 umm Jan 05 18:23:00 http://www.elated.com/articles/javascript-and-cookies/ Jan 05 18:23:02 I guess :) Jan 05 18:23:02 also pretty good Jan 05 18:34:40 what is JSON? Jan 05 18:35:46 json is a type of data transport like xml Jan 05 18:36:08 json is more efficient than xml Jan 05 18:38:05 is it possible to make code wait for an asynchronous db to finish a transaction before continuing? Jan 05 18:46:07 what does a cookie return, if it doesn't exist? Jan 05 18:46:14 undefined? Jan 05 18:48:10 Chriswebos: Should be as long as you have some way to confirm the transaction is complete, just live in the function until your condition is met. Assuming that this is all done withing JS and you have a way withing JS to check the status of the transaction Jan 05 18:49:46 Bmyers: yeah, looks like one too many }...I fixed it on webos101 Jan 05 18:50:56 bmatt: I'm using the sqlite db, which has callbacks. Basically, I have a model that is responsible for interacting with the db. I have a different function that calls the model, asking if a value is in the db. So, the model is supposed to send back true or false. however, since the callback is somewhere else, my model returns the result before the db has had a chance to react Jan 05 18:51:39 How could I make it live in the function until the db is finished? Jan 05 18:52:21 Chriswebos: Not exactly sure how you are all setup, but if you are initiating the transaction from within a JS function I would call the transaction and use a while loop on a boolean and poll the value until it returns true, of course I'd also implement a timestamp watch of some sort to exit the while loop if it doesn't get a true value within a certain timeframe Jan 05 18:52:59 ie I would setup a boolean for a while loop, done for example, and a success boolean to identify whether or not it was successful for user feedback. then another variable that stores a initial timestamp to check the duration of the execution Jan 05 18:53:31 also i'd throw a small sleep of some sort in the while loop so you dont kill cpu cycles Jan 05 18:53:53 i cant get the widget to instantiate Jan 05 18:55:21 bmatt: You don't want to do a while loop or sleep at all :) Jan 05 18:55:22 bmatt: I'm doing something similar. here's the code: this.valuecheck = 20; this.db.transaction( Jan 05 18:55:22 (function (transaction) { Jan 05 18:55:22 transaction.executeSql(mytext, [], onSuccess, onFailure); Jan 05 18:55:43 You need to build up chains of callbacks Jan 05 18:56:10 lmorchard: probably is a better way to do it, no one else was responding though Jan 05 18:56:11 haha Jan 05 18:56:23 var i = 0; Jan 05 18:56:23 do Jan 05 18:56:23 { Jan 05 18:56:23 i+=1; Jan 05 18:56:23 } Jan 05 18:56:24 while((i<20000) && (this.valuecheck == 20); Jan 05 18:56:28 at somepoint you have to have something poll, i'd assume, on a asynch transaction Jan 05 18:56:30 http://webos.pastebin.com/d482f24d2 Jan 05 18:56:35 No, never poll Jan 05 18:57:03 polling always seems to preempt the actual callback....it just whiles away the whole night Jan 05 18:57:09 sugardave: can u take a peek at that ^^^ Jan 05 18:57:16 Of course, the onsuccess function changes this.valuecheck Jan 05 18:57:33 well i assume the callback is the onsuccess, but he does not have any indication of whether it was successful Jan 05 18:57:36 Bmyers: sure, gimme a minute Jan 05 18:57:38 he wants to verify the data made it Jan 05 18:57:44 I'm trying to find a simple code example, but basically you need to have a succession of callbacks Jan 05 18:58:06 Same as with making a series of Ajax requests Jan 05 18:58:08 so I wrote http://pastebin.org/71457 this to create the cookie in the SecondAssistant.prototype.deactivate function. How can I read that out in my stage assistant and let it use the values when opened? Jan 05 18:58:13 so, basically I'm polling, which sugardave says wont work Jan 05 18:58:21 No, polling won't work Jan 05 18:58:36 hmm :( Jan 05 18:58:51 well what they are saying is a succession of callbacks to check the data Jan 05 18:59:14 oops Jan 05 18:59:27 i think i forgot to quote the pill name in setupwidget.. Jan 05 18:59:27 The most useful thing I've done so far is to throw together a utility to chain callbacks Jan 05 18:59:58 "chain callbacks"? Jan 05 19:00:08 Not sure if this helps, but: http://github.com/lmorchard/weave-webos/blob/master/src/tests/Decafbad/Silo_Tests.js#L297 Jan 05 19:00:33 Yeah, everything works on callbacks. You make a DB query, hand it a callback that executes the next step of your algorithm Jan 05 19:00:50 So if you need a sequence of DB queries, you need a sequence of callbacks to react to success/failure Jan 05 19:01:13 That github code might not be as helpful, because I built a layer atop the DB Jan 05 19:01:43 Bmyers: yeah, that will do it...you're trying to set up the var instead of the element Jan 05 19:01:53 otherwise looks like what I wrote :D Jan 05 19:02:24 i quoted it but still not working right.. Jan 05 19:02:32 lmorchard: i understand the callbacks, but still unclear how to make the original function return a result based on it Jan 05 19:02:47 Chriswebos: You can't return a result, only call another callback Jan 05 19:02:49 basically, a sceneassistant will call a model asking for a result Jan 05 19:03:05 the sceneassistant would call a model and supply a callback to receive the results Jan 05 19:03:12 you can't use a return value Jan 05 19:03:27 It's callbacks all the way down Jan 05 19:03:36 and then that callback would have to continue the algorithm? Jan 05 19:03:38 Bmyers: what are you getting in that log output? Jan 05 19:03:40 Exactly Jan 05 19:04:02 wow, this is gonna be SLOPPY!! basically, the db call is in the middle of a loop Jan 05 19:04:17 Yeah, so you'll need to rethink your loops in terms of callbacks Jan 05 19:04:18 i wanna check a bunch of values to see if they're in the db Jan 05 19:04:33 Yup, it's kind of brain-hurty Jan 05 19:04:54 have you used the synchronizer? Jan 05 19:04:57 Chriswebos: once you solve it once, though, you start thinking in that framework and it becomes SLIGHTLY less muddled Jan 05 19:04:57 You'll need to do something like set up an array and a function that calls itself and pops from the array until empty Jan 05 19:05:43 wow, that's very brain-hurty Jan 05 19:05:44 sugardave: no complaints about setupwidget, pill is there, seem to die with progressPill1.execute('start', 'Exporting...'); Jan 05 19:06:04 That's basically the core of webOS development, rethinking everything in terms of events and callbacks Jan 05 19:06:52 have you used the synchronizer? Jan 05 19:06:53 there is a method called syncronize which some ppl use to sync callbacks.. Jan 05 19:07:15 the synchronizer doesn't really help with this Jan 05 19:07:17 sugardave: it seems "jscolor.addEvent(window, 'load', jscolor.init); nor "myAddEventListener(window, 'load', makeColorSelectors);" so my conlusion is "window, load" do not function, what can i use to replace that? Jan 05 19:07:40 lmorchard: why wouldn't the synchronizer work here? Jan 05 19:07:51 LoneStar2010: I THINK window = scene controller Jan 05 19:08:06 That thing just ensures that a set of callbacks have fired before another one does. It's kind of awkward to set up a sequence or perform a loop Jan 05 19:08:07 i was thinking of trying it, but won't if it's no use Jan 05 19:08:22 sugardave: ok let me try that Jan 05 19:08:58 Bmyers: that's odd...I'll have to beg off on this for now, and pick it up later tonight when I get home Jan 05 19:09:22 pretty cool concept tho. thanks for posting it up there Jan 05 19:09:28 np Jan 05 19:10:07 so I wrote http://pastebin.org/71457 this to create the cookie in the SecondAssistant.prototype.deactivate function. How can I read that out in my stage assistant and let it use the values when opened? Jan 05 19:10:23 Not sure if this helps, but I wrote a callback chain utility to run sequences of callbacks: Jan 05 19:10:24 http://github.com/lmorchard/weave-webos/blob/master/src/tests/Decafbad/Silo_Tests.js#L297 Jan 05 19:10:26 svetter: haven't forgotten you, still working out these lab exercises :D Jan 05 19:10:51 okay, no problem. just thought it had gone under in the wild discussion :) Jan 05 19:10:55 That example sets up a series of DB calls through a utility I wrote, so that each step is a callback to the success of the previous Jan 05 19:12:15 anyone has "ares" running under ubuntu with firefox 3.5.x Jan 05 19:12:16 ? Jan 05 19:12:20 lmorchard: I'll try to look through it Jan 05 19:12:35 I'm having a little trouble following Jan 05 19:13:10 This'll hurt your head too, but I threw together a loop at one point like so: http://github.com/lmorchard/weave-webos/commit/3db077afea62ed8157da65f25c410b8a741acbb0#L2R100 Jan 05 19:13:33 That builds a list of chunks, then defines a self-calling function that shifts items off the list until done Jan 05 19:13:57 ares-faq says i have to accept the browser-plugin-related security-question in order to have debugging/logging/local-installation running - but see no such question and klicking on "run" etc. triggers nothing... Jan 05 19:14:10 Because it calls a web service to grab some items, then calls a database model to save them, then calls itself for the next chunk Jan 05 19:14:45 I wanna update an image and change it over... $("blarg").src = "something" works great. But I wish to change it back in a bit too. alarm()? Mojo.Animation? Jan 05 19:15:12 alarm() works, but it doesn't feel very mojo-y Jan 05 19:15:36 er... setTimeout() Jan 05 19:15:52 setTimeout() should be a fine way to do something like that Jan 05 19:16:46 Yeah, it works great. Just doesn't feel mojo-y Jan 05 19:16:49 I guess I'll stick with it Jan 05 19:17:04 sugardave: if you write var progressPill1= blah in setup you cant refer to it in another method that isnt setup. Jan 05 19:17:17 Not sure what would feel more Mojo-y, there isn't really a wrapper for setTimeout in Mojo itself Jan 05 19:17:23 another webos101 update perhaps. Jan 05 19:17:27 Prototype might have something, but I don't remember.. hmm Jan 05 19:18:21 There's Function#delay http://api.prototypejs.org/language/function.html#delay-instance_method Jan 05 19:19:34 Mojo's just a layer atop Prototype and native webkit JS after all :) Jan 05 19:20:05 Of course, if you can figure out how to do it with Mojo.Animation, you get the benefit of using a single global timer, but eh Jan 05 19:20:15 Bmyers: ah, a scope problem....move your var progressPill outside the prototype functions in the scene...might work then Jan 05 19:20:33 or make it global :) Jan 05 19:20:47 wait wait Jan 05 19:20:59 if it's in setup it should work from anywhere in that scene, I thought? Jan 05 19:21:23 it wasnt firing the way i pastebin'd it Jan 05 19:21:30 took out var Jan 05 19:21:36 it fires at least Jan 05 19:21:43 okay, will have to look at that Jan 05 19:22:09 i'm debugging it now.. Jan 05 19:22:14 will let u know.. Jan 05 19:22:21 great, thanks Jan 05 19:22:52 oh Jan 05 19:22:56 don't put it in setup Jan 05 19:23:02 put it in the constructor Jan 05 19:23:23 as var progressPill1 = widget....should be accessible across the rest of the scene Jan 05 19:23:57 and I put the widget function in my stage assistant so it's "global" enough Jan 05 19:25:09 ok, will try that Jan 05 19:30:23 anyone working successfully with ares? Jan 05 19:32:39 stage assistant constructor too for widget def or just in there? Jan 05 19:33:27 hello all Jan 05 19:36:35 hello Jan 05 19:38:59 Bmyers: I'd put the widget function definition in my stage assistant, doesn't have to be in the constructor, it can just be there. Then I'd define my scene widgets based off the widget function in the scene's constructor Jan 05 19:39:28 then do the setupWidget in the usual way Jan 05 19:47:00 the widget gets setup but i die at this.model.title = arguments[1]; in case: 'start' Jan 05 19:49:56 what if i had a this.model in another scene? is that gonna screw stuff up? Jan 05 20:01:35 sugardave: should i be doing set_model somewhere? Jan 05 20:02:54 Bmyers: if you use this.progressPill in setup, it will be avail in other functuons in the assistant Jan 05 20:03:35 var xxxx is only avail in that function Jan 05 20:04:11 haeffb: did u see what webos101 page i'm working off of? Jan 05 20:04:22 no Jan 05 20:04:34 o u r on your phone. never mind Jan 05 20:04:59 http://www.webos101.com/Extended_widgets#ProgressPill_.22widget.22 Jan 05 20:05:00 I have access to a desktop... Jan 05 20:05:23 its broken somewhere in the model setup Jan 05 20:05:40 if i try to changed this.model.title it craps out the script Jan 05 20:10:13 i get this if i want start plam-novacomd: start: Unknown job: palm-novacomd Jan 05 20:10:21 i'm on a kubuntu 9.10 64bit Jan 05 20:13:28 it has worked on my machine, but have made a fresh install of palm sdk, now something that i have changed in palm-novacomd.conf is gone.. Jan 05 20:18:49 when you are in the progressPill1 function, this.model refers to progressPill1.model. if I understand js scoping correctly, it shouldn't matter if you have a this.model elswhere as 'this' is different elsewhere Jan 05 20:19:53 would it help to add a 'titlel: '' to the original model definition? Jan 05 20:20:21 i trying that already.. i am sure it would help Jan 05 20:20:25 (blame all speling errees on Pre) Jan 05 20:20:35 modelchange doesnt get called to often.. Jan 05 20:20:50 update that title but no modelchanged? Jan 05 20:22:13 Don't suppose anyone could point me to a tutorial about throwing sprites around and the like? Jan 05 20:23:02 Or is that a bit of a no go until more of this sdl stuff makes it's way into an official sdk? Jan 05 20:23:17 burger king maybe? they dont have 7-up.. Jan 05 20:24:00 how would you make a toggleButton *look* disabled? model.disabled=true and modelChanged() do disable it, but it doesn't look like it doesn't work Jan 05 20:29:40 are there any more complex example-apps than "hello world" for me to look at? Jan 05 20:33:59 svetter: look in the SDK folder Jan 05 20:35:46 ah Jan 05 20:35:54 never saw that samples folder Jan 05 20:35:56 thanks Jan 05 20:36:09 jettero: perhaps you could change the class to be dismisal rather than affirmative Jan 05 20:36:11 fpauser: did you have a question about Ares? Jan 05 20:36:24 svetter: there is a cookie sample in the SDK? Jan 05 20:36:32 I dont know Jan 05 20:36:39 thats what I wanted to look up Jan 05 20:36:56 Bmyers: I'm not at all sure what you mean Jan 05 20:38:01 $('mydeadbutton').addclassname('dismisal'); and conversly removeclassname affirmative Jan 05 20:38:13 spelling and cap you'll have to look up Jan 05 20:38:31 okie... Jan 05 20:38:37 what are those classes? Jan 05 20:38:40 prototype functions Jan 05 20:38:53 yeah, I get that, ... but the css classes, where did you hear about them? Jan 05 20:39:02 svetter: had to reboot my machine, will you paste your current attempt at cookies again? I'm going to smoke, but will be back in a few minutes Jan 05 20:39:17 sure, thanks Jan 05 20:39:32 jettero: developer.palm.com search 'affirmative' Jan 05 20:39:54 http://pastebin.org/71457 this is how I create it Jan 05 20:39:57 jettro: also search for style excel Jan 05 20:40:17 there is an excel spread with those classes in there Jan 05 20:40:48 http://pastebin.org/71500 and this is how I tried to check if it is created and read it if so Jan 05 20:41:35 Bmyers: swwet. Jan 05 20:41:43 Bmyers: where do you get the "style matters" application? Jan 05 20:44:56 LoneStar2010 : there is a cookie sample Jan 05 20:45:10 in the "data" sample-application Jan 05 20:45:54 oh ok, will check it out after i get another code issue fixed. Jan 05 20:45:55 ahh, found it Jan 05 20:45:58 thanks Jan 05 20:51:30 lets say Im saving a users search history in my app.. If they logout should I delete the history? Jan 05 21:11:29 edektor: are there privacy concerns? i would assume most webos devices are single-user Jan 05 21:11:38 you could make history user-specific Jan 05 21:14:28 svetter: I may have left out some things, but this should give you a general method for cookie management: http://webos.pastebin.com/d552c320a Jan 05 21:15:10 with this, you just make sure to update the properties of cookieBlob any time you need to change the cookies, then cookie.put(cookieBlob); to keep the cookie updated, as well Jan 05 21:15:56 also remember that cookies are all or nothing....you can't set individual properties in a cookie, you must write the whole thing each time Jan 05 21:15:57 sugardave: the method dies if this.model.title is called. Jan 05 21:16:25 Bmyers: interesting....I wonder if the model changed? Jan 05 21:16:32 this.model the widget doesnt seem to be pointed at this.model Jan 05 21:16:37 no privacy concerns.. Just artist/album/song seraches Jan 05 21:16:42 searches* Jan 05 21:17:16 how do you get from progressPill1.get_model() to this.model? Jan 05 21:17:45 Bmyers: hang on, my connection is being bitchy Jan 05 21:18:31 progressPill1.get_model() in the widget setup to this.model.title in 'start' case.. that has me confused.. Jan 05 21:21:20 Meh... when are we GSM users getting updates? This is getting to be a joke :( Jan 05 21:22:55 Bmyers: let me see if I can remember this correctly....so, this is only referenced in the 'func' property of the new widget object, so it should be bound to that object, and 'this.model' should be the same as progressPill1.model Jan 05 21:24:02 so when widget.execute() is called, it takes 'func' as defined with 'this' and SHOULD be pointing to all the right pieces Jan 05 21:25:28 should " progressPill1 = widget({" be " progressPill1 = new widget({ " ? Jan 05 21:25:37 no Jan 05 21:26:14 I modeled this after Crockford's 'durable objects' discussion Jan 05 21:26:34 did it work? :) Jan 05 21:26:38 yes, it worked :P Jan 05 21:26:53 sorry man... had to ask.. Jan 05 21:26:54 did you try the simpler spinner one? Jan 05 21:26:57 just to see Jan 05 21:26:57 ? Jan 05 21:27:09 no, didnt need a spinner... Jan 05 21:27:11 spinner is a lame example because the mojo already exists for those two functions Jan 05 21:27:21 right, but it's the method you're testing Jan 05 21:27:40 its seem that the call to this.model.title in the 'start' case fails.. Jan 05 21:28:00 ah, you know what? I may not have tried it with a title Jan 05 21:28:07 I think I did, though.... Jan 05 21:28:15 try it without one and see what you get Jan 05 21:28:19 i dont think you did because its not in the model Jan 05 21:28:26 but it is in the 'start' method Jan 05 21:29:12 oh, I see...that shouldn't matter as long as 'title' is a valid model property for the widget Jan 05 21:29:27 because 'this' is var progressPill1 Jan 05 21:30:01 inside 'func' anyway Jan 05 21:35:39 Bmyers: I know it works, looking at the 'more concrete example'....that's practically a direct c&p from a test project I made for this and it uses title in the 'start' directive Jan 05 21:36:09 looks like it just dies once it gets inside the case statement. with no this.model calls Jan 05 21:36:31 i get in there but i dont come out Jan 05 21:37:12 debug output works in the case? Jan 05 21:37:31 if so, dump 'this' and see what it is Jan 05 21:37:36 hi Jan 05 21:37:48 is there somebody here ? Jan 05 21:37:56 * sugardave looks for somebody. Jan 05 21:37:59 %j dump it? Jan 05 21:37:59 nope Jan 05 21:38:10 I have an application on the app catalog Jan 05 21:38:24 but is there a way to track how many app i have sold ? Jan 05 21:38:25 Bmyers: yeah, or however....I usually just iterate through the properties and display them and their values in my messages log Jan 05 21:38:29 poiuytr: no Jan 05 21:38:32 not yet Jan 05 21:38:36 :'( Jan 05 21:39:17 or is there somebody from palm who can tell me ? Jan 05 21:39:40 poiuytr: I don't think even the mighty chuqui can give us the hard numbers Jan 05 21:39:45 unless things changed in the last 10 days or so Jan 05 21:39:52 (I've been away a bit) Jan 05 21:39:57 {"attributes": {"modelProperty": "progress"}, "model": {"progress": 0, "title": "Nothing"}} Jan 05 21:40:13 Bmyers: okay, so 'this' is proper Jan 05 21:40:26 hum, ok. But I hope it will be paid......................... Jan 05 21:40:28 how is title: 'Nothing' getting set? Jan 05 21:40:46 'model': { Jan 05 21:40:46 'progress': 0.0, Jan 05 21:40:46 'title': 'Nothing' Jan 05 21:40:46 }, Jan 05 21:41:00 in the = widget setup Jan 05 21:41:04 oh, you set it....when the widget is instantiated is it displaying 'Nothing'? Jan 05 21:41:13 yeah, just checking.. Jan 05 21:41:22 poiuytr: you will get paid Jan 05 21:41:22 i cant change it from nothing tho Jan 05 21:41:23 I did Jan 05 21:41:34 ok Jan 05 21:41:41 thanks Jan 05 21:41:43 poiuytr: Don't worry about it. Palm is not going to commit suicide by screwing their developers. Jan 05 21:41:55 lol ;) Jan 05 21:41:57 Bmyers: that's odd....how about dumping it after trying to set the title? Jan 05 21:42:06 right after the 'if' Jan 05 21:42:08 ok.. Jan 05 21:43:28 okay, so it is getting set in code.... Jan 05 21:44:19 oh ha-ha Jan 05 21:44:24 I think I know what is happening Jan 05 21:44:24 you dont have to call modelchanged? Jan 05 21:44:30 i sure as shit dont.. Jan 05 21:44:34 lay it on me.. Jan 05 21:44:46 you do call modelChanged, but my code you copied only calls it when the increment is 5% Jan 05 21:44:49 :D Jan 05 21:44:56 at 5% intervals, I mean Jan 05 21:45:39 so, copy that Mojo.Controller.stageController.activeScene().modelChanged(this.model); into 'start' at the end, just for the heck of it and see what happens Jan 05 21:45:40 so you dont expect to update the title until you're 5% complete Jan 05 21:45:55 no, that's a bad change I made to try and fix the issue you mentioned about trying to update too fast Jan 05 21:46:22 what I should probably do is have a modelChanged in start, complete, and as-is currently Jan 05 21:46:49 i tried that Jan 05 21:47:23 hmmm...stage controller or app controller? Jan 05 21:47:31 Mojo.Controller.stageController.activeScene().modelChanged(this.model); Jan 05 21:48:06 yeah, that should do it....hmmm.... Jan 05 21:48:17 for a stage assistant, I mean Jan 05 21:48:23 are you using an app assistant? Jan 05 21:48:25 yes Jan 05 21:48:30 ah Jan 05 21:48:33 multistage app Jan 05 21:48:39 my magic code only works with stage assistants Jan 05 21:48:49 that modelChanged line needs to change, I think Jan 05 21:48:50 i put it in a stage assistant Jan 05 21:49:14 the stage assistant is active for this card, i passed it in there.. Jan 05 21:49:26 when i created the stage Jan 05 21:49:40 hello Jan 05 21:49:41 Mojo.Controller.appController.getActiveSceneController().activeScene().modelChanged(this.model); perhaps? Jan 05 21:49:51 er getActiveStageController() Jan 05 21:49:59 i am looking for someone with pre to test some native application Jan 05 21:50:19 and volunteer Jan 05 21:50:27 It is a NES emulator Jan 05 21:51:00 bingo Jan 05 21:51:03 w00t Jan 05 21:51:11 catch u on _wirc Jan 05 21:51:18 gotta take my kid to karate Jan 05 21:51:25 coolio, later Jan 05 21:51:39 thx 4 your help and tut!! Jan 05 21:51:42 np Jan 05 21:51:58 I need to come up with a more generic way that it will work with app controllers AND stage controllers Jan 05 21:53:09 and volunteer for NES emulator testing on a real Pre? Jan 05 21:55:29 Howdy all Jan 05 21:55:57 hey kesne Jan 05 21:56:11 Hey sugardave! How goes it? Jan 05 21:56:55 pretty good, trying to get back into the fast-paced world of webOS Jan 05 21:57:04 lots changed while I was taking a breaking Jan 05 21:57:15 er, break Jan 05 21:58:37 any volunteer for NES emulator testing on a real Pre? Jan 05 21:59:11 photon70: my Pre is messed up enough, thanks :D Jan 05 21:59:30 ;) Jan 05 22:01:59 photon70: sure, I have a few handy, and a Pixi if you want. Jan 05 22:09:04 sugardave: still can't figure out the "window, load" problem... no error is produced... what is the equivelent of page load in mojo? Jan 05 22:13:38 thanks again sugardave. I never extended a widget b4. Jan 05 22:14:29 kesne: thnx. how can I send you the ipk? Jan 05 22:16:02 Bmyers: I've used Class.create with inheritance from a widget class to extend. If you need a to add a bunch of methods, its easier than than the wrapper on webos101 Jan 05 22:18:22 Does anyone know if the list item passed to the listTap event handler is a copy or a reference to the item in the list's model? Just wondering if I can update the item without having to splice it back into the list model array..... Jan 05 22:18:38 anyone know how to make the following work with webOS: "myAddEventListener(window, 'load', makeColorSelectors);" ---- 'window' does not work with webOS Jan 05 22:19:12 this.controller.window should Jan 05 22:19:31 I use it for getting selected text and what not Jan 05 22:20:34 both window and document should be tacked onto the scene controller object Jan 05 22:21:34 jfelectron: using non-mojo javascript Jan 05 22:22:04 http://jscolor.com/ Jan 05 22:22:48 photon70: messaged you Jan 05 22:23:46 LS20: so what? its still within a WebOS app.... Jan 05 22:24:14 isn't the 'window' the app window? Jan 05 22:24:34 window is "browser window Jan 05 22:24:46 webview? Jan 05 22:25:25 hi! anybody has tested the pre with a car bluetooth? my radiobluetooth resets after connect it, my blackberry works without problem Jan 05 22:25:58 since the code is written for web browsers, "window"is DOM object for browser window Jan 05 22:26:09 yes...but you'll have to Mojoize it Jan 05 22:26:25 the only window object that makes sense is this.controller.window Jan 05 22:26:56 jfelectron: but my widgets are private and un-touchable :P Jan 05 22:27:36 i get the following error: [20100105-14:19:05.957923] error: Error: Cannot read property 'window' of undefi Jan 05 22:27:36 ned, line undefined, file undefined Jan 05 22:27:40 sugardave: lol....I can touch 'em if I want...just watch me Jan 05 22:27:47 hehe Jan 05 22:27:56 "myAddEventListener(this.controller.window, 'load', makeColorSelectors);" Jan 05 22:28:01 heading home, see y'all in a bit Jan 05 22:29:05 Are you sure this.controller is pointing to the scene controller? Jan 05 22:29:27 kesne: messaged you Jan 05 22:30:18 LS20: is the myAddEventListener within your scene-assistant JS? Jan 05 22:30:31 the call to it rather Jan 05 22:30:33 jfelectron: let me check Jan 05 22:31:41 From Allen: "Do not use the window global; instead, use the window property of the stage, scene, or widget controller. You can still use the window global in the application assistant." Jan 05 22:33:00 jfelectron: http://www.pastebin.org/71518 Jan 05 22:33:40 i stuck the color picker javascript into "function BgAssistant() {" Jan 05 22:34:25 line 492: contains "myAddEventListener(this.controller.window, 'load', makeColorSelectors);" Jan 05 22:36:13 Is line 492 within a function? What function is it within? Can't tell from indents..... Jan 05 22:36:38 if its in a closure....this won't point to the scene assistant object Jan 05 22:38:07 pretty much all i did was paste the js code into an empty assistant function. no mods where made to Jan 05 22:38:33 yes 492 is within the "function BgAssistant()" Jan 05 22:40:15 OK....I don't see an intialize function Jan 05 22:40:33 essentially the entire thing is an intialize function Jan 05 22:40:46 this.controller doesn't yet exist within initialize Jan 05 22:41:16 how would I initialize it? Jan 05 22:41:47 hold on, I'll modify the code Jan 05 22:42:40 i am assuming I just need have BgAssistant load the code on scene load, instead of "window" load Jan 05 22:43:45 what is the widget with the divider you can expand and collapse? Jan 05 22:45:00 LS20: http://www.pastebin.org/71525 Jan 05 22:45:07 jfelectron: try changing the list item in event handler and see what happens. And tell us. Jan 05 22:45:09 PreGame: collapsible dividers Jan 05 22:45:34 haeffb: lol....yeah, just hoping someone else was the guinea pig Jan 05 22:46:10 LS20: Create the object, then extend the prototype of the object to for all the methods Jan 05 22:47:20 jfelectron: are you joking? Jan 05 22:47:44 jfelectron: testing Jan 05 22:47:57 PreGame: no that's what Palm calls them Jan 05 22:48:12 There is also the Drawer widget Jan 05 22:48:37 collapsible dividers aren't actually "widgets" though, are they? Jan 05 22:48:40 The collpasible dividers though aren't really a widget....just DOM manipulation to give the appearance of a drawers Jan 05 22:48:58 haeffb: yep, beat me too it :) Jan 05 22:49:02 you gotta stop reading my mind Jan 05 22:49:13 jfelectron: [20100105-14:47:08.402599] error: Uncaught ReferenceError: HUE_SLIDER_ARROWS_LOC Jan 05 22:49:13 ATION is not defined, app/assistants/bg-assistant.js:360 Jan 05 22:50:06 oh...you need to change all the vars in the initialize function to this.var Jan 05 22:50:33 and then reference them as this.var Jan 05 22:50:38 in your methods Jan 05 22:51:59 LS99: dude...you keep changing your handle :/ Jan 05 22:52:44 jfelectron: ok kinda lost... can you give an example of how to change the var? Jan 05 22:52:59 Sure...let me modify the code...just a sec Jan 05 22:53:24 thank you, been staring at the same code for hours... Jan 05 22:54:40 quake help please.. get his error when running from terminal... Jan 05 22:54:50 haeffb: do you have a a good reference on JS objects for LS20? Jan 05 22:54:55 rror: VID: Couldn't load SDL: No available video device Jan 05 22:55:02 no mytether, camera works fine Jan 05 22:55:27 any ideas? Jan 05 22:55:39 http://w3schools.com Jan 05 22:56:07 LS99: http://www.pastebin.org/71531 Jan 05 22:56:14 that's where/how I learned javascript (the small part of it that i have learned, that is) Jan 05 22:56:33 you need to change all the methods to be of the form BgAssistant.prototype.methoName=function() {} Jan 05 22:57:44 i am lookingfor the type of divider in the email application Jan 05 22:57:52 Basically you are create the assistant Object in the BgAssistant function. The vars you want accesible by the object's methods become properties of the object. You add methods to the object by extending its 'prototype' Jan 05 22:58:14 PreGame: those are collapsible dividers, they are hand coded DOM manipulation....i.e. innerHTML Jan 05 22:58:37 The drawer widget gives a similar look and feel Jan 05 22:58:59 PreGame: StyleMatters has a collapsible dividers example Jan 05 22:59:16 In my experience the overhead of the drawers sux...just do the DOM manipulation urself Jan 05 22:59:28 jfelectron: so pretty much what I am doing is modifying the code so it is "prototype" compatible... Jan 05 22:59:58 LoneStar1999: that is a different "prototype" than "Prototype" Jan 05 23:00:06 yes Jan 05 23:00:28 Prototype is a library the .prototype property adds methods to an object Jan 05 23:00:34 in JS everything is a object Jan 05 23:01:09 you can extend the 'prototype' of any object, which could mean adding static properties or methods Jan 05 23:02:00 so i convert line 72 to "BgAssistant.prototype.rgbToHex=function(r, g, b, includeHash)" Jan 05 23:02:07 .prototype is a javascript thing, not a Prototype library thing Jan 05 23:02:32 an alternative to doing the object.prototype stuff is to use Prototype's Class.create(): http://www.prototypejs.org/api/class/create Jan 05 23:02:33 LoneStar1999: yes, that is what you do. Jan 05 23:02:50 ok, will convert the rest brb Jan 05 23:02:52 thanks Jan 05 23:02:58 and, what that means is that you are adding a rgbToHex function to the BgAssistant object Jan 05 23:03:08 yup Jan 05 23:03:13 k Jan 05 23:04:08 LS99: The JS object model is different than class based languages like C++ or Java Jan 05 23:04:11 jfelectron: what are the advantages (if any) of using Class.create() versus using .prototype? Jan 05 23:05:59 saves typing...also Class create() implements class based inheritance... you can pass the name of another class as the first arg of Class.create and your new class inherits all the props and methods of the parent class Jan 05 23:07:00 could I use, though, myclass = new oldclass(); and then .prototype my way to the same thing? (assuming I like to type?) Jan 05 23:08:39 do i modifiy line: 128 a function within a function? Jan 05 23:09:15 in the latter you are creating an object of type oldclass and inheriting the reference to that object. So you could have something else that inherits that same object and they would all have the reference to that same object Jan 05 23:11:44 man, all this OOP stuff gets too abstract for me in a very short ordre Jan 05 23:11:46 order Jan 05 23:11:57 JFelectron: do u have an example you could pastebin of extending a widget using your method? Jan 05 23:12:08 that can be a powerful paradigm and really distinguishes JS from purely class based languages...however for those used to class based inheritance, like myself, its really weird to inherit objects Jan 05 23:13:17 Bmyers: I just used Class.create('WidgetClass',{ new methods})) Jan 05 23:13:55 LS99: that's called a closure...and is probably fine, though if you need to reference this, it won't point to the BgAssistant object Jan 05 23:15:14 a function within a function is a closure? Jan 05 23:15:20 yes Jan 05 23:15:52 they have strange properties...namely they 'see' all the parent functions variables and 'live' after the parent function returns Jan 05 23:16:06 jfelectron: will leave the "closures" and change all other functions,,, c what happens Jan 05 23:16:19 voodoo mojo man.. Jan 05 23:16:31 good voodoo mojo. I hope. Jan 05 23:16:52 what would be a situation that I would want to use a closure? Jan 05 23:17:16 for memory leaks.. Jan 05 23:17:22 :P Jan 05 23:17:36 I use duct tape for those. Jan 05 23:17:44 My pre is nearly all silver now. Jan 05 23:19:04 argh, what am i doing wrong now? I cannot get menu's to work Jan 05 23:20:24 precentral has had over 5,000,000 app downloads Jan 05 23:21:32 haeffb: closures canbe useful when you need to dynamically generate functions and have them be alive and have access to variables defined in the parent function after the parent function returns Jan 05 23:22:19 haeffb: like if you need to dynamically generate callbacks that need access to variables that are passed to the parent generator function Jan 05 23:23:09 does anyone know if this site is incorrect for menu setup? http://www.weboshelp.net/webos-mojo-development-resources/ui-widget-list/313-application-menu Jan 05 23:24:14 haeffb: As Bmyers mentioned, if you aren't careful you'll find yourself leaking memory all over the place Jan 05 23:24:18 bbl Jan 05 23:24:18 ] Jan 05 23:24:21 g073nks: from a quick look it looks correct. What issue are you seeing? Jan 05 23:24:43 jbjoerk, my screen locks white on emulator if i try to add the line on the scene Jan 05 23:25:04 log? syntax error? Jan 05 23:25:22 never starts, but i copy pasted from it Jan 05 23:25:40 it's ok, until i add this line: this.controller.setupWidget(Mojo.Menu.appMenu, newsMenuAttr, newsMenuModel); Jan 05 23:26:49 never mind, i added it to wrong place XD Jan 05 23:26:55 it works Jan 05 23:28:20 did u post your next ver of milez haeefe? Jan 05 23:28:46 jfelectron: get following error: [20100105-15:23:11.280245] error: Uncaught TypeError: Cannot read property 'window' of undefined, app/assistants/bg-assistant.js:251 Jan 05 23:28:49 http://www.pastebin.org/71543 Jan 05 23:29:14 above is the updated code Jan 05 23:30:17 Bmyers: just now. Jan 05 23:34:24 cool. Jan 05 23:34:24 Rick_work: ping Jan 05 23:36:46 http://forums.precentral.net/homebrew-apps/220436-milez.html Jan 05 23:37:19 think the warning is sufficient? Jan 05 23:38:27 hiya.. is it possible to wrap the pre browser into an official app? I'd like to build a set of new controls for it Jan 05 23:39:33 wife is gone for the evening. time to decide: should I work on coding? Or should I drink beer and chat in IRC? Jan 05 23:40:22 haeffb: why not both? Jan 05 23:41:28 haeffb, dude...both. I usually do :) Jan 05 23:41:43 well, drunk coding has made everything I've done so far Jan 05 23:41:43 LS99: explain how this fits into your app....i.e. is this a scene assistant we are looking at or just some class that you are using within a scene? Jan 05 23:41:49 so, yeah, why not? Jan 05 23:43:10 jfelectron: it is a generic color picker, which i only need to select a color value, do not need it built into scene Jan 05 23:43:52 this.controller has no meaning then, explicitly pass the scene assistant to the initalize function Jan 05 23:44:42 Also, myAddEventListener(this.controller.window, 'load', makeColorSelectors) is now not within a function Jan 05 23:46:14 something like this: 71545 Jan 05 23:46:23 oops: http://www.pastebin.org/71545 Jan 05 23:46:35 In my Agenda app, I load events from Calendar for a specific date range. If the date range is large and the user has mucho data, sometimes the load hangs. Jan 05 23:47:02 I saw on forums that webOS may stop a function that runs for "too long" Jan 05 23:47:21 anyone have additional info on what is "too long" and how to get around this issue? Jan 05 23:47:22 haeffb: hmm...bummer....would make sense that there is some framework timeout property Jan 05 23:51:59 jfelectron: [20100105-15:48:23.384351] error: Error: Cannot read property 'controller' of undefined, line undefined, file undefined Jan 05 23:52:57 LS99: how are you creating the BgAssistant object? From a scene? If so, you need to pass the scene assistant object ('this') to the BgAssistant constructor. Jan 05 23:54:23 haeffb: check with the webos-internals folks...I suspect something like that might be a property of LunaSysMgr Jan 05 23:54:49 jfelectron: this.controller.stageController.pushScene('bg'); Jan 05 23:55:21 huh....but you said its not a scene? Jan 05 23:55:54 This is just a class that you are using to render content within a scene no? Jan 05 23:56:15 jfelectron: yes exactly: Jan 05 23:57:02 so you want to do something like var myPicker=new BgAssistant(this) Jan 05 23:57:06 originally had the code in "" but and did not work Jan 05 23:57:30 Sure....makes sense Jan 05 23:57:34 so not i placed it in "bg-assistants.js" Jan 05 23:57:41 not= now Jan 05 23:58:05 you only need to have bg-assistant type naming for scene assistants Jan 05 23:59:28 the original code would work if "myAddEventListener(window, 'load', makeColorSelectors);" would be supported Jan 05 23:59:36 this is an abitrary class, so it can just be called Bg.js and the creator function can just be function Bg() Jan 06 00:00:30 works on the webOS browser, but not on a scene... Jan 06 00:01:06 LS99: its not going to work like that, while this is weblike content, how the scene is rendered is quite a bit different than a web page Jan 06 00:01:59 Just call makeColorSelectors from the Setup or Activate function of the scene you want to insert it into Jan 06 00:02:17 yeah, noticed that... i just need it do display =( http://jscolor.com/try.php Jan 06 00:02:17 I'll be back in a few Jan 06 00:02:20 ok Jan 06 00:10:35 Ok...is it setup to insert the picker into a particular element in the page? Jan 06 00:12:00 it works by simply clicking on a textbox Jan 06 00:12:30 Jan 06 00:12:44 Ok..looking at it now Jan 06 00:12:59 the document global should also be replaced with this.controller.document Jan 06 00:14:18 In the scene you want it to render in do something like this in your setup function: Jan 06 00:14:28 so, I get a response object that contains XXX days, each of which could have from zero to multiple events. I need to loop through the resp.days and massage the data Jan 06 00:14:33 var myBGpicker=new Bg(this) Jan 06 00:14:55 what do I do to keep the framework from shutting me down if the loop is long? Jan 06 00:15:39 myBGpicker.makeColorSelectors() Jan 06 00:16:05 what is myAddEventListener()? Jan 06 00:16:14 is that a function you define elsewhere? Jan 06 00:17:08 line 488 'myAddEventListener" http://www.pastebin.org/71545 Jan 06 00:17:58 LS99: You realize when using LGPL code...that you'll have to post the relevant source-code somewhere... Jan 06 00:18:06 haeffb: I missed what your major goal is....but can you just take the days "as-is" and store their events in a db/depot, and THEN go back and iterate through those? not sure what you're trying to avoid Jan 06 00:18:23 LS99: along with the license notification Jan 06 00:18:44 sugardave: the framework will kill a loop that lasts "too long" Jan 06 00:19:13 haeffb: that's a bummmer....what's too long? Jan 06 00:19:22 i dunno. but I've exceeded it. Jan 06 00:19:31 great job! Jan 06 00:19:55 do you have enough time to store them in that middle-man way? Jan 06 00:19:56 I'm searching for a post on forums from sgrafton or lemketron?? that mentions this, but can't find it at the moment Jan 06 00:20:38 I don't really need to store them. I'm pulling from Calendar and then displaying a list. Don't need to save the data myself. Jan 06 00:20:41 jfelectron: i can post the source later Jan 06 00:21:00 haeffb: right, you can clear it out when done...just a quick and dirty "make it work" try Jan 06 00:21:18 Ok...just making sure know about GPL/LGPL...sorry for the lecture Jan 06 00:21:27 g073nks Jan 06 00:21:29 that way you can process one at a time from the db Jan 06 00:21:53 jfelectron: no problem =) Jan 06 00:22:16 yes lemektron? Jan 06 00:22:16 I can post it on WebOS101, if it works for WebOS Jan 06 00:22:40 sorry lemketron Jan 06 00:22:53 huh, there is a lemketron right there... Jan 06 00:23:37 LS99: I don't see how that creates an event listener...also its a closure Jan 06 00:24:22 no wait....488 doesn't define that function Jan 06 00:24:29 where is it defined? Jan 06 00:24:36 Is that your function or from the script? Jan 06 00:25:01 Dude...when we get this to work I am totally using it, this thing is sweet Jan 06 00:26:08 sugardave: I already have all the data in an object as a . don't need a DB. just need a way to parse thru the object w/o the framework cutting me off. Jan 06 00:26:23 as an array of days Jan 06 00:26:42 yeah it works awesome, have it at www.buildasearch.com Jan 06 00:27:02 haeffb: some kind of callback that only process x number, then the next x number until the end Jan 06 00:27:29 that's why db hit me first, easy to do the callback there Jan 06 00:27:45 sorry g073nks, bad paste. Jan 06 00:28:15 gonna have to do some more research & probably rewrite the entire app. Jan 06 00:28:25 LS99: I'll be back in a few Jan 06 00:28:42 haeffb: data from the cloud? Jan 06 00:28:46 lemketron, what's the limit for time spent in a loop b4 it gets killed? any idea? Jan 06 00:29:08 K Jan 06 00:29:29 hi Jan 06 00:29:33 data from...uh...some other database. Jan 06 00:29:48 okay, on the phone or "away"? Jan 06 00:30:01 are you using ajax to get the data? Jan 06 00:30:11 and do you control the data source? Jan 06 00:30:20 do you know a simple (one-app-only) possibility for syncing remote ssh dirs. say, i have a user directory somewhere, and want to sync it with my local pre directory Jan 06 00:30:53 on the phone, using a serviceRequest and no I don't control the source. But I can probably easily change the way I get the data to grab smaller chunks. Which is what I probably should do. Jan 06 00:31:00 yes Jan 06 00:31:30 (blue pill almost working SD) Jan 06 00:31:55 doesn't have to be ssh, http is ok too Jan 06 00:31:56 well, serviceRequest should have a success callback? Jan 06 00:32:35 yes, it does Jan 06 00:33:00 get all the days so you know how many, then start grabbing them with a new serviceRequest in the callback....that would be my first attempt (disclaimer: I still don't know what I'm talking about most of the time) Jan 06 00:33:43 sugardave: pm Jan 06 00:33:47 I have a question about the synchronize function Jan 06 00:34:11 I'm having a hard time understanding it from the example Jan 06 00:35:01 psi_: Uhh...how about rsync? Jan 06 00:35:58 jfelectron: is there a frontend available? or how do you mean? Jan 06 00:36:08 basically, i want a certain callback to finish before another set of code starts Jan 06 00:36:59 google: rsync gui Jan 06 00:37:41 Chriswebos: yes, you'll want the synchronizer....what's your question? Jan 06 00:38:24 I have a call to a database, with callbacks onsuccess and onfailure Jan 06 00:38:30 jfelectron: gonna test a protoytype color picker Jan 06 00:38:32 btb Jan 06 00:38:34 brb Jan 06 00:38:41 I want onsuccess to be executed before some dummy function Jan 06 00:39:07 jfelectron: ah ok, you mean running rsync on the desktop side... i'd like to do it wireless. Jan 06 00:39:09 i tried doing var synchronize(callback: dummyfunction) Jan 06 00:39:25 then said synchronize.wrap(onsuccess) Jan 06 00:39:55 I put log statements in them (onsuccess and dummy), and dummy is definitely being called first Jan 06 00:40:09 what am i doing wrong? Jan 06 00:40:37 you need something: like var synchornizer=new new Mojo.Function.Synchronize({ Jan 06 00:40:37 syncCallback: dummyfunction}); Jan 06 00:40:56 yes... Jan 06 00:41:01 that's what i did Jan 06 00:42:14 the other day we were wondering if it works for one function, this might suggest it doesn't Jan 06 00:42:30 I've used it with two wrappers, the example has two as well Jan 06 00:42:43 why not just call dummmyfunction from the callback Jan 06 00:43:12 I believe I tried that as well...but I can try with two Jan 06 00:43:35 so, just so I know I'm doing it right, please take a look at this code: Jan 06 00:44:17 var syncrhonizer = new Mojo.function.synchronize({synccallback: dummyfunction}); Jan 06 00:46:00 db.transaction(function(transaction){transaction.executesql(mysqlstmt, synchronizer.wrap(onsuccess), onfailure)} Jan 06 00:46:46 that's all I have right now (no two functions); not sure what to do from here... Jan 06 00:47:25 hmmm....try var OnSuccess=synchronizer.wrap(onsuccess) and pass OnSuccess as the callback Jan 06 00:47:55 okay, but that's still just one wrapper...do I need another? Jan 06 00:48:04 man, synchronicity is hard Jan 06 00:48:11 you guys are killing me Jan 06 00:48:18 so is asynchronicity Jan 06 00:49:07 Bmyers: you're working on some "reality"-altering application? Jan 06 00:49:55 sugardave: just smoke pot before using your pre Jan 06 00:50:13 you say that like I don't... Jan 06 00:50:16 :D Jan 06 00:50:28 if i am using a prototype script which is dependent on prototype, how do I refer to prototype? Jan 06 00:50:35 hahah....;) Jan 06 00:50:52 LS99: what do you mean? Jan 06 00:50:53 sugardave: is this right? if (Math.round(this.model.progress * 100) % 25 === 0) { // updates ProgressPill at every 5% Jan 06 00:51:12 LS99: prototype.js is included by the framework Jan 06 00:51:17 ===? Jan 06 00:51:26 seem to work out as ( if model.progress > 25% ) Jan 06 00:51:32 yeah, but for some reason, it is not functioning Jan 06 00:51:33 PreGame: forces the type to also be equal Jan 06 00:51:44 that would update at 25%, let me check the syntax again Jan 06 00:51:48 http://myles.eftos.id.au/colour_picker_demo.html Jan 06 00:51:50 * PreGame shivers Jan 06 00:51:55 PreGame: so you can't do false===0 Jan 06 00:51:57 25% intervals Jan 06 00:52:06 but false==0 is true Jan 06 00:52:28 how do you get a false out of Math.round? Jan 06 00:52:37 seems to not be true until model.progress > 25 and then runs everytime Jan 06 00:52:52 LS99: OK. do you want to run this in a browser or in WebOS? Jan 06 00:53:07 jfelectron: my onsuccesswrapper isn't being called at all Jan 06 00:53:32 WebOS Jan 06 00:53:34 PreGame: that was just an example.....it will make sure the type of the two things being compared is the same so Int==Int Jan 06 00:53:37 Bmyers: what it SHOULD do is if the progress / 25 has a 0 remainder, then update....so at 25, 50, 75, and 100 Jan 06 00:53:38 if you want the progress pill at every 5% you need to do % 5 Jan 06 00:53:50 so i end with no updates then 100% because modelChanged called too fast Jan 06 00:53:59 In WebOS, prototype is already included by the framework, you don't have to include it yourself Jan 06 00:54:05 Bmyers: on device or emu? Jan 06 00:54:10 emu Jan 06 00:54:20 and device actually Jan 06 00:54:28 weird, I think I had that problem on one but not the other Jan 06 00:54:39 great! Jan 06 00:54:45 :) Jan 06 00:54:48 but, the code is correct :D Jan 06 00:54:53 jfelectron: oops, it is being called now. I had another attempt at doing another function. Jan 06 00:54:56 yeah...I gave up on a progress bar....went to quickly to actually render Jan 06 00:55:16 just scrim it and call it good.. Jan 06 00:55:37 spinner/scrim it.. yeah i know. i've been hacking on this all day Jan 06 00:55:46 jfelectron: however, the syncCallback is still being called first Jan 06 00:56:00 my spinner hangs while the list is rendering...its annoying Jan 06 00:56:22 jfelectron: i guess webOS does not like color pickers, 3rd one not to work and it is written for prototype... Jan 06 00:56:41 LS99: I think its comes down to how its rendering the thing Jan 06 00:56:54 hola all Jan 06 00:57:18 web code is not completely portable to WebOS.... Jan 06 00:57:18 having a problem w/ my Pre that I'm hoping you can point me in the right direction... Jan 06 00:57:33 when I install an app it fails Jan 06 00:57:34 that way ---------------> Jan 06 00:57:55 Bmyers: you COULD move the check for update code and the modelChange into the update case Jan 06 00:57:58 i get a yellow triangle in the upper right w/ a ! on it Jan 06 00:58:00 and see what it does Jan 06 00:58:06 jfelectron: yeah true Jan 06 00:58:26 mickdouglas: what do you mean it fails? Jan 06 00:58:39 but you'd still need to do modelChanged in the other cases, too, I think Jan 06 00:58:59 LS99: Still not clear where myAddEventListener is defined?? Jan 06 00:59:03 mickdouglas: is the app catalog saying it needs to update and restart after it fails to install an application? Jan 06 00:59:09 LS99: is that your function? Jan 06 00:59:19 sugardave: Yes! that's it! Jan 06 00:59:37 LS99: OK, I see it line 196 Jan 06 00:59:38 sugardave: did I bork something up w/ Preware or the other mods i've done? Jan 06 00:59:38 mickdouglas: I had that problem, too.....it's lame Jan 06 00:59:49 mickdouglas: you have to doctor the phone (well, I did mine) Jan 06 00:59:59 sugardave: OK will do. Jan 06 01:00:06 mickdouglas: I had the same problem, didn't doctor fone Jan 06 01:00:09 works now Jan 06 01:00:23 mickdouglas: my preware is messed up after that, so check it if you have that, too Jan 06 01:00:25 did u do the emergency patch repair Jan 06 01:00:38 Chriswebos: yes did the 1.3.5.1 Jan 06 01:00:46 mine was failing for 4 days before I finally decided to doctor it Jan 06 01:00:50 and my preware is jacked like everyone elses Jan 06 01:00:51 on 1.3.5 Jan 06 01:01:11 oh, i haven't updated to 1.3.5.1 yet, i'm still on 1.3.5 Jan 06 01:01:17 I just update today Jan 06 01:01:20 waiting for all the updates Jan 06 01:01:44 but, what i had to do was use webosqi to remove preware and manager service Jan 06 01:01:47 LS99: The problem with these pickers is that the events being used aren't neccesarily supported in WebOS and the way listeners are being created is using direct DOM methods, rather than the framework methods Jan 06 01:02:05 er... back in the olden days of 1.3.1, I used to ipkg -o /var install the things I'm building after I scp them over... Jan 06 01:02:13 where do you -o them now/ Jan 06 01:02:19 reinstalled manager service ( i had to grab an old one because the new one wouldn't start) Jan 06 01:02:29 reinstalled preware Jan 06 01:02:33 jettero: I remember those days Jan 06 01:02:36 ran the migration Jan 06 01:02:44 then it worked Jan 06 01:03:03 Chriswebos: interesting... Jan 06 01:03:05 no doctoring at all Jan 06 01:03:10 mickdouglas: try his way first Jan 06 01:03:23 I'm interested now...maybe that will fix my preware Jan 06 01:03:25 did you use ipkg from the command line or what? Jan 06 01:03:34 jfelectron: so pretty much it would have to be totally rewritten? Jan 06 01:03:40 nothing from command line...al webosQI Jan 06 01:03:46 all webosQI Jan 06 01:04:00 Chriswebos: ok will give QI a test Jan 06 01:04:16 LS99: not completely, but the event handling and element manipulation would need to be 'Mojoized' Jan 06 01:04:17 make sure you get the new one... Jan 06 01:04:22 * mickdouglas is a command line junky... has been doing things the hard way all along Jan 06 01:04:29 i got mine right after 1.3.5 came out Jan 06 01:05:55 LS99: like there are no onX events AFAIK Jan 06 01:06:06 LS99: they have different names in Mojo Jan 06 01:06:23 jfelectron: what about this code: http://pastebin.com/d86adf0a Jan 06 01:07:37 jfelectron: have you had a chance to look at my sync problem? Jan 06 01:07:38 jfelectron: you're right. on_X javascript doesn't work/exist in Mojo Jan 06 01:08:26 written for prototype library Jan 06 01:08:44 LS99: doesn't matter...those events don't exist outside a web browser Jan 06 01:10:16 LS99: And things like this make no sense either....navigator.appVersion.split("MSIE"); Jan 06 01:10:24 did you see: http://pastebin.com/d86adf0a Jan 06 01:12:24 Yes, I'm not sure what this is new Insertion.After(this.trigger, html); Jan 06 01:12:36 sugardave: i think i went FULL RETARD man.. i cant get this to work.. Jan 06 01:12:52 Is Insertion a Prototype class? Jan 06 01:14:34 LS99: Also not sure what trigger is that's passed to the constructor Jan 06 01:16:39 so i only need to .bind(this) when specifying a callback that needs access to the scene controller, right? Jan 06 01:17:18 jfelectron: trigger = "" Jan 06 01:19:28 where is that one running? Jan 06 01:20:19 inserted code in bg-assistant.js Jan 06 01:20:30 ambackstrom: You need to use .bind(this) whenever you're passing a callback that's a member of an object Jan 06 01:21:06 So, that might include members of a scene controller, but includes things beyond that :) Jan 06 01:21:12 LS99: No, mean is there a web example..? Jan 06 01:21:44 http://myles.eftos.id.au/colour_picker_demo.html Jan 06 01:21:50 LS99: There are still event probs with this one, you can't get around that. Browser GUI and events are different than WebOS GUI and events....similar but different Jan 06 01:22:29 http://uoid.me/picker1 Jan 06 01:23:28 The Insertion object is depracted in Prototype 1.6 Jan 06 01:23:32 depracated Jan 06 01:24:55 The major prob are the events. Fix that and make sure the rendering makes sense in the context of WebOS and these WILL work Jan 06 01:25:26 ok, will work on the simple code, form this latest example Jan 06 01:25:38 good luck! Jan 06 01:26:09 how much do you think I need to rewrite with the new code? Jan 06 01:30:10 lmorchard: what if the callback doesn't care about any of the object functionality? Jan 06 01:33:22 ambackstrom: You're probably safe, then. But, not making a habit of using .bind(this) may bite you later Jan 06 01:34:27 jfelectron: thanks for all your help, will find the simplest one and work my way up, will post a working color chooser, onced I get it working Jan 06 01:34:52 no prob.....was thinking about this type of thing a couple days ago...so food for thought :) Jan 06 01:38:20 funny thing this morning I thought it would take me an hour to figure out... well time to light up some fireworks outside Jan 06 01:42:13 what's up, doc? Jan 06 01:48:42 Just hating reviewers Jan 06 01:50:06 customers suck. Jan 06 01:50:11 unless you don't have any. Jan 06 01:50:51 hi all! Jan 06 01:51:32 Hey Jen Jan 06 01:51:44 hi doc! Jan 06 01:51:54 jenp Jan 06 01:52:12 Do we have any people from Canada on here regularly? Jan 06 01:52:18 hi haeffb!! Jan 06 01:53:12 get your dialog working? Jan 06 01:53:20 almost! Jan 06 01:53:34 the styling stuff is not good. Jan 06 01:53:48 yeah...i've already resolved that Jan 06 01:53:52 i think you'll like it Jan 06 01:53:57 new card etc Jan 06 01:54:50 new card instead of dialog? Jan 06 01:55:33 nope it's still a dialog but bigger Jan 06 01:55:49 so you guys know the early access program is ending soon right? Jan 06 01:56:59 still having trouble with the synchronize Jan 06 01:57:05 no, really? Jan 06 01:57:15 yes i got an email from handler... Jan 06 01:57:19 like, what, Thursday? Jan 06 01:57:26 if you have apps submit now Jan 06 01:57:29 yeah Jan 06 01:57:51 to save $50? Jan 06 01:58:00 yeah! Jan 06 01:58:15 and the $99 dev registration (is that still supposed to happen)? Jan 06 01:58:17 does anyone have an example of using synchronize to sync callbacks? Jan 06 01:59:11 not for those in early access Jan 06 01:59:20 http://webos.pastebin.com/d5b673bbf Jan 06 01:59:51 JenP: I might need your regex help in a day or two Jan 06 02:00:01 sure doc anytime Jan 06 02:00:17 sugardave: have a look, still runs everytime.. Jan 06 02:00:29 Hi Jenp, Doc Jan 06 02:00:40 Quattro got bought by Apple today so they're adding a tracking pixel which I need to extract out of some html Jan 06 02:00:42 hi Bmyers! Jan 06 02:00:47 Hey Bmyers Jan 06 02:01:10 Bmyers: how many info log entries are you getting? Jan 06 02:01:30 doc, jenp Jan 06 02:02:01 yes? Jan 06 02:02:02 sugardave: just the ones that say Widget Method modelChanged Jan 06 02:02:23 everytime i update. Jan 06 02:02:46 log the math.round.... stuff Jan 06 02:02:56 see what it's doing Jan 06 02:03:02 Chriswebos: What are you trying to do with synchronize? Jan 06 02:03:14 I've never really found it totally useful myself Jan 06 02:03:24 Bmyers: you should only get 10 :(....maybe it's in the code you're calling the update()? Jan 06 02:03:35 i'm trying to synchronize the callback from a database access Jan 06 02:03:39 er execute(update) Jan 06 02:04:06 Why are you trying to synchronize it? Jan 06 02:04:15 basically, I want to access the database, then have the function return a value of true or false Jan 06 02:04:38 well, maybe sync isn't the right word... Jan 06 02:04:52 What you really want is to access the database and have that pass the results to a callback as a parameter Jan 06 02:05:02 you'll never get useful return results Jan 06 02:05:18 oh, well how do I do what you mention? Jan 06 02:05:28 actually, here's what I want to do: Jan 06 02:05:29 Bmyers: sugardave: from earlier, the % xx should still work when your progress = 0 Jan 06 02:05:31 and 1 Jan 06 02:05:48 ah, so 11 Jan 06 02:05:51 right Jan 06 02:05:59 for( all values i want to lookup){ see if in db; if so, perform operation} Jan 06 02:06:03 this interval goes to 11 Jan 06 02:06:33 anything evenly divisible by your interval value should fire. Jan 06 02:06:34 Yup, loops are annoying. Jan 06 02:06:45 how could I do this? Jan 06 02:07:35 wouldnt it have to be exactly /10 with zero remainder? Jan 06 02:07:53 yes Jan 06 02:08:10 About the best thing I can offer is to use an array, and a callback that shifts values off the array and calls itself until the array is empty. And when the array is empty, call another callback to finish up Jan 06 02:08:10 but what's interesting is you say your else isn't firing at all Jan 06 02:08:10 isnt that amazingly improbable? Jan 06 02:08:48 it depends on how you're setting the update increment Jan 06 02:08:52 i never see it once.. Jan 06 02:09:00 always the if, never the else Jan 06 02:09:18 Last time I did that exact thing was here: http://github.com/lmorchard/weave-webos/commit/3db077afea62ed8157da65f25c410b8a741acbb0#L2R100 Jan 06 02:09:19 i know i am doing something DOM, i just cant see it.. Jan 06 02:09:33 instead of logging the result of the modulo, log the progress value and see what that's showing Jan 06 02:09:35 Bmyers: good point Jan 06 02:09:52 synchronize won't really help you do that Jan 06 02:10:06 you need to parseInt before *100 Jan 06 02:10:12 ? Jan 06 02:10:18 yeah, I'm beginning to see that Jan 06 02:10:36 don't listen to me, been drinking beer all night rather than coding. Turns out doing both is harder than I thought. Jan 06 02:10:39 no, going to have to fudge the increment value based on whatever your data "length" is for the progress Jan 06 02:10:40 Widget Method update 0.1 Jan 06 02:10:48 Widget Method update 0.2 Jan 06 02:10:51 and so on Jan 06 02:11:00 i already was logging it.. Jan 06 02:11:08 i have 10 records Jan 06 02:11:12 Bmyers: right, that should fire every time you update those hard numbers Jan 06 02:11:29 but if its 0.1123? Jan 06 02:11:42 haeffb: then it doesn't update the fill bar Jan 06 02:11:55 leme change the fire rate Jan 06 02:12:26 haeffb: it still adds that to the overall progress, but if it isn't remainder 0, no update to the fill graphic Jan 06 02:12:40 oh, it's adding to the progress. Jan 06 02:12:44 yeah Jan 06 02:13:07 so, what you want is "if I've exceeded the next x0%, fire. Jan 06 02:13:15 10, 20, 30, etc. Jan 06 02:13:18 right Jan 06 02:13:25 so you just change the % x Jan 06 02:13:28 to whatever Jan 06 02:13:31 not if I just happen to hit 10, 20, 30 Jan 06 02:13:58 boo, they didnt reject my app even tho i requested it.. oh well.. all is good cause i did fix the bug i thought i didnt :P Jan 06 02:13:59 yeah, then you call widget.execute('update', valueBasedOnWhateverIsBeingProcessed); Jan 06 02:14:17 lmorchard: so, I guess I need the sync.js file? Jan 06 02:14:17 way to go dawm! Jan 06 02:14:19 ok, now it wont fire UNTIL after 25% Jan 06 02:14:24 then fires everytime Jan 06 02:14:38 drag/swipe is now in the catalog version of swap & drop Jan 06 02:14:43 Chriswebos: Well, that's an example of the technique, but might not help you Jan 06 02:14:44 dawm_: sweet Jan 06 02:15:02 Bmyers: did you start logging the actual progress value yet? Jan 06 02:15:03 congrats dawm: Jan 06 02:15:16 Trying to see if someone has a blog entry or something about this kind of callback-based looping Jan 06 02:15:37 SD: yes i am Jan 06 02:15:42 cool...I'll wait Jan 06 02:15:43 I dropped it in my app to build a more general task queue Jan 06 02:15:49 Bmyers: what are they? :D Jan 06 02:17:24 Hmm, not much luck finding an explanation Jan 06 02:18:06 .1 no fire, .2 no fire, .3 no fire, .4 fires, .5 fires, .6 fires, .7 fires, .8 fires, .9 fires Jan 06 02:19:32 what is Math.round(this.model.progress * 100) % 10 for those values? Jan 06 02:19:56 i'm sure i'm not the first to try to do a bunch of db calls before Jan 06 02:20:23 Oh, no, I do it all the time with a chain utility or a self-calling function Jan 06 02:20:38 or occasionally nested callbacks, but that gets messy with indentation fast Jan 06 02:20:38 Chriswebos: you string them together like one giant rolled bugger Jan 06 02:21:01 i guess like the example you gave me? Jan 06 02:21:48 Yeah, though the example could be better because I'm using my own utilities rather than direct DB calls Jan 06 02:21:54 so it might be harder to see how it applies Jan 06 02:22:10 Like here, I'm doing a long series of DB calls in a test using my Chain util: http://github.com/lmorchard/weave-webos/blob/master/src/tests/Decafbad/Silo_Tests.js#L300 Jan 06 02:22:13 yeah, i was having some trouble understanding it Jan 06 02:22:22 but all the DB calls are through my Silo utility that sits atop the DB Jan 06 02:22:31 the principle's the same though Jan 06 02:23:14 JenP: if we have apps in the app store, will we still have to pay $99 buckaroos? Jan 06 02:23:25 basically you have to break your linear code up into separate functions, each calling the next one in sequence instead of relying on the return statement Jan 06 02:23:33 LoneStar1999 idk for sure but i do not believe so Jan 06 02:23:48 i think that's waved for those who already have apps Jan 06 02:24:02 but i think you can expect the $50 per app Jan 06 02:24:04 $99/year Jan 06 02:24:13 but this is me guessing Jan 06 02:24:15 whenever the "year" is up... Jan 06 02:24:56 from my handler: Early access is ending in the next couple of days. After that, you won’t need to be white listed the program will be open to the public. However, you will not have an account manager associated with new accounts and there will be a per app fee. Jan 06 02:25:00 JenP: oh ok, what about updates? $50 per updates? Jan 06 02:25:23 LoneStar1999 idk Jan 06 02:25:38 ok thanks, Jan 06 02:26:40 LoneStar1999: I highly doubt it Jan 06 02:27:38 yeah i doubt it also.... what does apple charge for stuff anyone know? Jan 06 02:27:45 yeh once the app is in there updates shouldnt be charged Jan 06 02:29:38 jsling coughed on this? arguments = arguments[0]; Jan 06 02:29:50 jslint Jan 06 02:30:25 probably because arguments is 'special' Jan 06 02:30:38 but I say "screw you, jslint!" Jan 06 02:30:40 Well, that and you re-used a variable name for possibly something different Jan 06 02:30:49 wont scan past that.. Jan 06 02:30:57 ie. an Array vs its first item, which might be a string. can be dangerous Jan 06 02:31:32 like makes checks bounce on my checking account dangerous or what? Jan 06 02:31:34 oh, this needs to be rewritten to use apply Jan 06 02:31:36 as nice as it is for it to look out for typecasts....umm that's our job :) Jan 06 02:31:38 right? Jan 06 02:31:58 I didn't know how to throw arguments around Jan 06 02:32:58 Chriswebos: Not sure if this helps, but here's a quick example I threw together showing a loop through DB calls http://pastebin.com/m7098d0ac Jan 06 02:33:07 simpler than mine and using fewer obscure JS tricks Jan 06 02:33:43 Oh wait, that never finishes. I forgot to throw in a terminating condition Jan 06 02:34:51 Chriswebos: Check this one out instead - http://pastebin.com/m341e653a Jan 06 02:35:17 I'm sure there's a bug in there somewhere Jan 06 02:35:31 Bmyers: I don't know why it's not working....I'll have to dig out my old projects and see if I can't make mine work now Jan 06 02:35:31 but quick untested back-of-napkin code :) Jan 06 02:36:28 lmorchard: thanks for simplifying it...i will give it a quick whirl and report back Jan 06 02:37:17 I get fancy with a lot of JS features, like arguments.callee.bind(this) is basically the same as loop_cb Jan 06 02:38:33 Also, if you're not using it already, I recommend looking into Mojo.Test for playing with code without the need to tap through a UI every time Jan 06 02:38:34 http://developer.palm.com/index.php?id=1827&option=com_content&view=article Jan 06 02:39:05 that code should only run if it EXACTLY .25 .50 .75 Jan 06 02:39:13 Bmyers: but, once I do get it working it won't be with the bad arguments = arguments[0]; Jan 06 02:39:19 if i'm doing % 25 Jan 06 02:39:20 I write some tests, write some library code, and just type `make tests` to see the results via palm-log Jan 06 02:39:25 Bmyers: right Jan 06 02:40:11 paste this Jan 06 02:40:13 if (Math.round(.51 * 100) % 25 === 0) { Jan 06 02:40:13 document.write("RUN IT"); Jan 06 02:40:13 } Jan 06 02:40:13 else { Jan 06 02:40:13 document.write("DO NOT RUN IT"); Jan 06 02:40:14 } Jan 06 02:40:19 here: http://writecodeonline.com/javascript/ Jan 06 02:41:23 it doesn't work... Jan 06 02:41:24 i guess i just need to fig'r a different way to determine if i should update Jan 06 02:41:44 which? Jan 06 02:41:58 Chriswebos: Oh, one possible bug... if (!next_value) { finished_cb(); } should probably be if (!list.length) { finished_cb(); } Jan 06 02:42:16 otherwise the loop will be "finished" if you use 0 or false as a value in the list Jan 06 02:42:22 has to be exactly .5 so .51 says DO NOT RUN Jan 06 02:42:25 Bmyers: it's not running the pasted code in that site you sent me Jan 06 02:42:27 oh, ok Jan 06 02:42:28 at all Jan 06 02:42:30 or if (0 === list.length) Jan 06 02:42:39 I get sloppy with these things and catch them in tests heh Jan 06 02:43:04 if (Math.round(.5 * 100) % 25 === 0) { Jan 06 02:43:04 document.write("RUN IT"); Jan 06 02:43:04 } Jan 06 02:43:04 else { Jan 06 02:43:04 document.write("DO NOT RUN IT"); Jan 06 02:43:05 } Jan 06 02:43:11 oh it's probably my browser Jan 06 02:43:16 i think so.. Jan 06 02:43:22 I can't change the 'hello world' text Jan 06 02:43:28 you paranoid about javascript or something? Jan 06 02:43:33 no, Iron beta 4 Jan 06 02:43:48 oh u got the apple Iron Jan 06 02:44:14 Chriswebos: So, if the previous gives you trouble try http://pastebin.com/m5ee700e1 Jan 06 02:44:18 it's some German guys that build it...just like Chrome without the Googleness Jan 06 02:44:51 cool Jan 06 02:44:57 * lmorchard goes back to breaking his own code Jan 06 02:44:58 i dunno, use another js runner.. Jan 06 02:45:23 is an ajax.request involved? Use safari... Jan 06 02:52:32 what's the best way to insert an element into the middle of an array? I'm doing slice().concat(newlement,restofarray)....is there a better way? Jan 06 02:54:02 jfelectron: search for array.splice Jan 06 02:54:44 jfelectron: eg. http://www.w3schools.com/jsref/jsref_splice.asp Jan 06 02:55:09 kind of a confusing method to use, but it's for adding and inserting elements Jan 06 02:55:10 okay..thanks Jan 06 02:55:22 yeah, I was confused by it when I read it before Jan 06 02:55:27 read about it rather Jan 06 02:56:45 I really wish they'd created separate methods for removing and adding rather than combining as splice Jan 06 02:58:14 so... x = [1,2,3,4,5]; x.splice(3, 0, 'a', 'b', 'c'); // x == [1, 2, 3, "a", "b", "c", 4, 5] Jan 06 02:58:16 push and pop **** ENDING LOGGING AT Wed Jan 06 02:59:57 2010