Zotonic
Zotonic
zotonic@conference.zotonic.com
Friday, 2 November 2012< ^ >
arjan has set the subject to: Zotonic - the Erlang Content Management Framework
Room Configuration

GMT+1
[01:15:15] arjan leaves the room
[01:17:48] arjan joins the room
[01:31:18] arjan leaves the room
[02:25:56] Andreas Stenius joins the room
[02:30:26] Andreas Stenius leaves the room
[02:33:14] Andreas Stenius joins the room
[03:30:14] Andreas Stenius leaves the room
[03:32:25] Andreas Stenius joins the room
[04:30:56] Andreas Stenius leaves the room
[04:31:43] Andreas Stenius joins the room
[05:30:15] Andreas Stenius leaves the room
[05:31:48] Andreas Stenius joins the room
[06:30:31] Andreas Stenius leaves the room
[06:31:04] Andreas Stenius joins the room
[08:27:56] arjan joins the room
[08:31:35] arjan leaves the room
[09:05:04] arjan joins the room
[09:41:10] maas.maarten.zeeman joins the room
[10:31:05] Andreas Stenius leaves the room
[10:32:14] Andreas Stenius joins the room
[11:30:15] Andreas Stenius leaves the room
[11:32:16] Andreas Stenius joins the room
[12:07:26] Ilya Rezvov joins the room
[12:09:08] <maas.maarten.zeeman> arch... today i have to postback blues
[12:10:57] <maas.maarten.zeeman> passing everything in a query string makes strings from integers. Stuff like that.
[12:20:59] <arjan> uhoh
[12:30:16] Andreas Stenius leaves the room
[12:32:10] Andreas Stenius joins the room
[13:21:28] <maas.maarten.zeeman> Looking at what it would take to have json postbacks. This is driving me nuts. Type conversion all over the place.
[13:30:10] Andreas Stenius leaves the room
[13:33:06] Andreas Stenius joins the room
[15:28:25] <arjan> maas.maarten.zeeman: why 2 formats? why not switch everything to json?
[15:30:36] Andreas Stenius leaves the room
[15:31:39] Andreas Stenius joins the room
[15:50:41] Ilya Rezvov leaves the room
[15:59:20] <maas.maarten.zeeman> maybe slower?
[15:59:59] <maas.maarten.zeeman> 1 format easier of course :-)
[16:05:34] <arjan> json parsing is pretty fast, right
[16:05:53] <arjan> especially with eep0018
[16:06:10] <maas.maarten.zeeman> k, you think it is better than plain old qs
[16:06:42] <arjan> yes of course :)
[16:06:51] <arjan> like you say, typed variables, complex values, ...
[16:07:27] <arjan> im still wondering though about postback signing
[16:07:38] <maas.maarten.zeeman> the pickle thing
[16:07:40] <arjan> yes
[16:08:02] <arjan> that makes it hard to do stuff that initiates on the client
[16:08:03] <maas.maarten.zeeman> was wondering about that too. it encodes everyghing in base64 with something extra
[16:08:42] <arjan> I understand it is more secure
[16:09:06] <maas.maarten.zeeman> it contains the stuff you need to call the right module with the right trigger id and sucn
[16:09:26] <maas.maarten.zeeman> was also looking at that because for named z_events a lot of the data is redundant
[16:10:41] <maas.maarten.zeeman> It is basically a tuple with some stuff in it. It can probably be transferred as is. the signature can be a separate item
[16:10:58] <maas.maarten.zeeman> if you drop the qs that is.
[16:11:33] <arjan> yep
[16:11:57] <maas.maarten.zeeman> This is what is in a pickle: {named,window,window,
{mouse_event,[{id,"35798594"}]},
resource_cobrowse}
[16:12:09] <maas.maarten.zeeman> That would allow you to sent unsigned postbacks
[16:12:33] <maas.maarten.zeeman> Less secure, but if you know what you are doing...
[16:13:14] <arjan> yeah
[16:14:08] <arjan> I would prefer just passing JSON messages back and forth, for everything
[16:14:20] <maas.maarten.zeeman> k
[16:15:08] <arjan> only dont know about script pushes
[16:15:16] <maas.maarten.zeeman> also for the way back?
[16:15:26] <maas.maarten.zeeman> that is what I meant :-)
[16:15:29] <arjan> yes
[16:16:18] <maas.maarten.zeeman> we now just call eval :-)
[16:16:32] <arjan> pushing scripts is nice for quick hacks but it should be an "extra"
[16:16:57] <arjan> because scripts assume knowledge about the view state of the client on the server
[16:17:06] <arjan> and its nice that it can be done like that
[16:17:30] <arjan> but for big complex apps I think your view state is all contained in javascript
[16:17:55] <arjan> and the server just for passing events / data into the client
[16:18:11] <maas.maarten.zeeman> there is not much difference them. Either it is a call to display something or a message for a function to display something.
[16:18:20] <arjan> yes indeed
[16:20:52] <maas.maarten.zeeman> If you need to pull in data from js you can always use the service api. The downside is that this doesn't make use of the open websocket.
[16:21:20] <arjan> exactly
[16:21:47] <arjan> it would be nice to use websockets more for those kinds of things
[16:21:57] <arjan> also part of the whole "can I use zotonic without jQuery" discussion
[16:21:59] <maas.maarten.zeeman> the websocket can now only handle postbacks
[16:25:54] <maas.maarten.zeeman> No, you can't use it with another framework which uses $ right now. If we want that we need to make our own namespace, and call jQuery.noConflict() somewhere. Generated scripts and eval stuf should then be handled in our namespace
[16:30:26] Andreas Stenius leaves the room
[16:31:43] Andreas Stenius joins the room
[16:38:11] <maas.maarten.zeeman> That is a bit of a problem when pushing scripts to the client.
[16:42:19] <maas.maarten.zeeman> because eval runs with the this pointer being window and then $ could have been changed :-)
[16:42:42] <arjan> that's nasty
[16:42:51] <arjan> but,
[16:43:04] <arjan> we can wrap the script with a closure before eval?
[16:43:15] <arjan> and then apply the closure to the right namespace
[16:43:22] <arjan> e.g.,
[16:43:27] <maas.maarten.zeeman> maybe then call eval.call( different_ns, scrpt)
[16:43:47] <arjan> eval('function(){' + script + '}.apply(z);')
[16:43:56] <arjan> where z is our ns
[16:44:43] <maas.maarten.zeeman> that is also a cool way probably more cross platform than using eval.call
[16:44:59] <arjan> yes eval.call doesnt work in IE apparently
[16:45:12] <maas.maarten.zeeman> right.
[16:45:41] <arjan> actually, I think it's not with apply, but with .bind(z)
[16:45:46] <arjan> my JS is a bit rusty
[16:46:14] <maas.maarten.zeeman> bind is also old fashioned jquery nowadays
[16:46:42] <maas.maarten.zeeman> .on is the new bind
[16:47:58] <maas.maarten.zeeman> ow, just reading here. eval is run in the current context
[16:48:32] <maas.maarten.zeeman> So you can just pass the string to the zotonic ns and call eval there.
[16:48:50] <arjan> oh thats even better
[16:49:17] <maas.maarten.zeeman> jquery even has a special case globalEval to eval something in the global context
[16:49:54] <maas.maarten.zeeman> first things first.
[17:02:50] <maas.maarten.zeeman> I'm curious how marc thinks about this.
[17:06:21] <arjan> marc is not so much into javascript
[17:06:23] <arjan> or well,
[17:06:48] <arjan> his JS style is very function based and not really into the object / namespace thing
[17:07:03] <maas.maarten.zeeman> :-)
[17:07:25] <maas.maarten.zeeman> i've learned it the hard way that that is important.
[17:08:09] <maas.maarten.zeeman> especially if you mix things with other frameworks.
[17:08:54] <arjan> yes
[17:09:09] <arjan> Im also starting to like require.js
[17:09:36] <maas.maarten.zeeman> I have to go btw. <jumps on rowingbike>
[17:10:30] <arjan> roei-ze!
[17:12:10] <maas.maarten.zeeman> windje mee
[17:12:18] maas.maarten.zeeman leaves the room
[17:30:12] Andreas Stenius leaves the room
[17:33:39] Andreas Stenius joins the room
[18:16:59] arjan leaves the room
[18:30:04] Ilya Rezvov joins the room
[19:30:24] Andreas Stenius leaves the room
[19:31:52] Andreas Stenius joins the room
[20:30:22] Andreas Stenius leaves the room
[20:31:52] Andreas Stenius joins the room
[21:06:37] arjan joins the room
[21:10:01] Andreas Stenius leaves the room
[21:21:34] arjan leaves the room
Powered by ejabberd Powered by Erlang Valid XHTML 1.0 Transitional Valid CSS!