Zotonic
Zotonic
zotonic@conference.zotonic.com
Tuesday, 18 June 2013< ^ >
Arjan has set the subject to: Zotonic - The Erlang Web Framework & CMS
Room Configuration

GMT+2
[00:02:25] cillian.deroiste leaves the room
[01:45:44] mawuli.ypa leaves the room
[02:28:44] mawuli.ypa joins the room
[09:02:18] Arjan joins the room
[09:25:21] Arjan leaves the room
[09:28:48] Arjan joins the room
[09:37:58] Maas joins the room
[09:47:59] Arjan leaves the room
[09:48:03] Arjan joins the room
[09:48:10] <Arjan> hi guys
[09:48:19] <Arjan> any of you know how to do validation on a group of radio buttons?
[09:48:29] <Arjan> type={presence}
[09:50:03] <Arjan> keep getting: Uncaught Error: LiveValidation::initialize - No element reference or element id has been provided!
[09:50:59] <Maas> Oh, duh, the validation is tied to an id, radio's work with names...
[09:52:36] <Arjan> I suspect there is a trick to do it
[09:52:46] <Arjan> probably only Marc Worrell knows it :P
[09:57:21] <Maas> Looking at stackoverflow, http://stackoverflow.com/questions/1366935/livevalidation-and-group-of-checkbox-radio-select, seems like more people have this problem.
[10:03:10] <Maas> Seems like you can add custom validators. Fiddled with that once when I found discrepancy between regex in js and regex in erlang.
[10:04:56] <Arjan> I know but radio validation is pretty usual to have :p
[10:06:59] <Marc Worrell> @Arjan - just connect it to the name of the radio buttons.
[10:07:34] <Marc Worrell> actually the livevalidator will see that it is a radiobutton you connect to - and then will do the "magic" for you.
[10:07:40] <Marc Worrell> you can see examples in the survey code
[10:11:34] <Arjan> like this?
{% validate name="q2" type={presence} %}
[10:11:46] <Arjan> bc that doesnt work
[10:11:55] <Marc Worrell> also give the id
[10:12:26] <Arjan> still not
[10:12:29] <Arjan> <label class="radio">
<input type="radio" name="q2" id="q2" value="tv" />TV
</label>
<label class="radio">
<input type="radio" name="q2" value="radio" />Radio
</label>
{% validate name="q2" id="q2" type={presence} %}
[10:12:44] Arjan bangs head on keyboard
[10:13:13] <Marc Worrell> from the survey code:
[10:13:15] <Marc Worrell> {% if blk.is_required %}
{% validate id=#yes name=blk.name type={presence} %}
{% endif %}
[10:13:40] <Marc Worrell> <label class="radio inline">
<input type="radio" id="{{ #yes }}" name="{{ blk.name}}" {% if answers[blk.name] == "true" %}checked="checked"{% endif %} value="1" /> {{ blk.yes|default:_"True" }}
</label>
<label class="radio inline">
<input type="radio" id="{{ #no }}" name="{{ blk.name}}" {% if answers[blk.name] == "false" %}checked="checked"{% endif %} value="0" /> {{ blk.no|default:_"False" }}
</label>
{% if blk.is_required %}
{% validate id=#yes name=blk.name type={presence} %}
{% endif %}
[10:15:16] <Marc Worrell> look at this code in the zotonic-1.0.js
[10:15:20] <Marc Worrell> if (elt.attr('type') == 'radio')
{
$('input[name="'+elt.attr('name')+'"]').each(function() {
addLiveValidation(this, args);
});
}
[10:16:08] <Marc Worrell> basically if the validation is added to a radio input, then it is added to all inputs with the same name.
[10:16:18] <Arjan> yes
[10:16:32] <Arjan> found the problem
[10:16:38] <Arjan> ALL radio inputs NEED to have an id
[10:16:42] <Arjan> no matter what the id is
[10:16:50] <Arjan> not just the first
[10:16:58] <Marc Worrell> yes - all inputs must have an id… always
[10:17:25] <Marc Worrell> otherwise they are not posted - some strange thing in the form post code
[10:46:18] <Maas> Chrome js debugger is making me crazy these days. It is always breaking into jquery function even when all breakpoints are disabled.
[10:48:10] <Maas> Unusable piece of junk.
[10:50:57] <Arjan> I'm also debugging a weird JS error now
[10:51:16] <Arjan> locally the form I just made works fine
[10:51:21] <Arjan> on the server it JS errors
[10:51:27] <Arjan> server = 0.9.x
[10:52:25] <Maas> I don't even want to debug js, just want to do inspect element... What kind of js error do you get?
[10:52:34] <Arjan> Uncaught TypeError: object is not a function z.notice~z.cycle~z.imageviewer~z.dialog~livevalidation-1.3~z.inputoverlay~jquery.loadmask~63538764542.js:1936 <http://mediafonds.com:8000/lib/js/apps/zotonic-1.0~z.widgetmanager~/js/z.expolanationtooltip~modules/z.notice~z.cycle~z.imageviewer~z.dialog~livevalidation-1.3~z.inputoverlay~jquery.loadmask~63538764542.js>(anonymous function)
[10:52:43] <Arjan> I reproduced it locally
[10:52:45] <Arjan> on 0.9.x
[10:52:49] <Arjan> not happening on master
[10:53:21] <Maas> Something is different then. Jquery maybe?
[10:53:34] <Arjan> might be
[10:59:12] <Arjan> hopefully its not jquery..
[11:00:30] <Maas> Usually the stacktrace is helpful for these kind of anonymous function errors.
[11:00:52] <Arjan> hmm
[11:18:18] <Marc Worrell> didn't we have something to warn the admin user that fields were edited/changed but not saved (when leaving the page)
[11:19:18] <Arjan> yes
[11:19:21] <Marc Worrell> what is happening on that js line?
[11:19:37] <Arjan> I dont know. I suspect it is some client JS code
[11:19:42] <Marc Worrell> about the admin thing - where is it hiding? (can use if for the frontend admin)
[11:19:45] <Arjan> I changed the loading order of the JS and it finally disappeared
[11:19:51] <Arjan> Marc Worrell: its only for tinymce
[11:20:02] <Marc Worrell> oh :p
[11:20:13] <Marc Worrell> always better than nothing (only for tinymce)
[11:51:55] Andreas Stenius leaves the room
[11:56:36] <Marc Worrell> i need a small m.i18n for easy access to language lists
[11:56:51] <Marc Worrell> shall I put it in mod_translation or in the core models?
[12:00:23] <Arjan> in mod_translation
[12:06:42] <Marc Worrell> I was thinking of core - as the z_trans stuff is in core
[12:07:04] <Marc Worrell> tricky one
[12:07:17] Maas leaves the room
[12:07:35] Maas joins the room
[12:09:17] <Arjan> less core == beter imho
[12:09:24] <Arjan> you can also move z_trans into mod_translation/support/
[12:12:04] <Marc Worrell> one problem with moving that code is that lots of the system directly call into the z_trans code - so the module must be available
[12:12:14] <Marc Worrell> (and it is a bit strange to call into a disabled module…)
[12:19:56] Andreas Stenius joins the room
[12:20:54] Arjan leaves the room
[12:21:30] <Andreas Stenius> translation != localization in my opinion...
[12:21:53] <Andreas Stenius> localization holds meta data for translation...
[12:22:26] <Andreas Stenius> so m.i18n would fit in a mod_localization module.. or some such.. :p
[12:24:16] <Marc Worrell> I want to use that m.i18n to fetch the langauge lists etc (now done by directly digging into the m.config.i18n...)
[12:25:44] <Marc Worrell> then we could call it m.translation and move it into mod_translation (which should be enabled anyway….)
[12:34:36] <Andreas Stenius> Isn't just a tad bit scary that zotonic is 69% javascript and only 30% erlang code...?!
[12:35:01] <Marc Worrell> we could pull jquery et al from an external source - then it will go way down :p
[12:35:37] <Andreas Stenius> indeed.. :)
[12:35:55] <Marc Worrell> of course that 30% is functional programming, so in imperative code it would be 5-10x more :p
[12:36:07] <Andreas Stenius> heh
[12:36:21] <Andreas Stenius> I think I like github's new interface...
[12:40:25] <Marc Worrell> it is a bit different than all other interfaces
[12:40:45] <Marc Worrell> and I don't like the menu on the right - really hidden
[12:41:15] <Andreas Stenius> most of it is available as keyboard shortcuts any way..
[12:41:24] <Andreas Stenius> but sure, it's not "newbie" friendly.. :p
[12:41:40] <Andreas Stenius> I use T a lot to browse to specific files in a repo..
[12:41:52] <Marc Worrell> and my customers are perpetual newbies....
[12:42:08] <Andreas Stenius> does your customers need to use github then?
[12:42:29] <Marc Worrell> for issue lists
[12:42:34] <Andreas Stenius> oh, right..
[12:42:55] <Andreas Stenius> but there's an api for that :) just write a wrapper webapp for it... :p
[12:43:13] <Marc Worrell> lol - as if I haven't enough to do....
[12:43:20] <Andreas Stenius> not entirely serious.. ;)
[12:43:27] <Andreas Stenius> exactly
[13:18:50] mawuli.ypa leaves the room
[13:34:05] Arjan joins the room
[14:21:03] Arjan leaves the room
[14:58:52] Maas leaves the room
[14:59:00] Maas joins the room
[14:59:54] <Maas> Hmm, don't we have a proplist:get_value filter yet?
[15:00:51] <Maas> oh wait. duh
[15:01:03] <Andreas Stenius> heh :p
[15:01:16] <Maas> proplist["fool"]
[15:03:44] <Maas> It is getting hot here.
[15:04:16] <Andreas Stenius> it's just right (tm) here.. :)
[15:33:45] <Maas> Another stupid? question. Is it possible to remove the language part from a url generated by z_dispatcher:url_for?
[15:35:07] <Andreas Stenius> not at all stupid.. :)
[15:39:03] <Andreas Stenius> there's both a url_rewrite event and a dispatch_rewrite event... don't know why.. or what the difference is?? (Marc?) (haven't checked the docs yet, maybe it is explained already... :p )
[15:39:47] <Andreas Stenius> Maas, do you want it for all urls, or just a few?
[15:40:00] <Andreas Stenius> I just spotted there's a rewrite_url config you can set to false :)
[15:40:40] <Andreas Stenius> so "mod_translation rewrite_url false" should do it ;)
[15:40:42] <Maas> Just a few. I just want urls that ends up in something that goes outside of the user's session (mail/chat), possibly over a language barrier
[15:40:53] <Andreas Stenius> ah..
[15:41:59] <Maas> trying set_language trick
[15:42:49] <Maas> yes, that does it.
[15:43:21] <Maas> z_dispatcher:url_for(bla, [{id, 123}], z_context:set_language(undefined, Context)
[15:43:21] <Andreas Stenius> what's the set_language trick?
[15:43:33] <Andreas Stenius> ah
[15:43:35] <Maas> hmpf
[15:44:06] <Maas> works for now(tm)
[15:44:17] <Andreas Stenius> hehe
[15:45:07] <Maas> Maybe it is nice to use a proper language property here.
[16:33:07] <Marc Worrell> Might be done in two ways:
[16:33:17] <Marc Worrell> 1. integrate the whole translation stuff better
[16:33:43] <Marc Worrell> 2. Let the mod_translation add extra rewrite rules for dispatch rules with language codes
[16:34:24] <Marc Worrell> Option 2 (in cooperation with a dispatch rule compiler) might make the whole dispatch system quite a bit faster
[16:34:46] <Marc Worrell> uhhh "extra rewrite rules" ——> extra dispatch rules
[17:09:14] <Maas> Option two sounds really useful.
[17:10:38] <Marc Worrell> yes, to me as well - and good to speed up - you can even compile the acceptable languages into the generated dispatch module.
[17:10:54] <Maas> This context language trick helps me good enough right now. btw.
[17:11:21] <Maas> It is for url's which are likely to "escape" the current user's session.
[17:13:34] <Maas> For example, copied over chat, email whatever. Then they can be be across language barriers and you want zotonic to pick the language for these new sessions.
[17:15:25] <Maas> Gonna jump on my bike and row home very slowly...
[17:16:10] Maas leaves the room
[17:21:42] Arjan joins the room
[17:49:38] Arjan leaves the room
[17:49:38] Arjan joins the room
[17:49:38] Arjan leaves the room
[17:54:03] Arjan joins the room
[18:00:41] Arjan leaves the room
[18:30:18] Maas joins the room
[18:30:50] <Maas> http://thenextweb.com/apps/2013/06/18/google-hangouts-competitor-rounds-now-lets-users-browse-the-web-together-while-they-chat/?fromcat=all
[18:33:03] <Maas> http://gigaom.com/2013/06/18/now-thats-a-chathead-rounds-adds-co-browsing-to-its-mobile-video-chat-apps/
[18:34:24] <Maas> Also http://venturebeat.com/2013/06/18/rounds-co-web-browsing-app/
[18:35:18] <Maas> Interesting what will kind of traffic you get when your are on multiple popular blogs
[18:47:51] Maas leaves the room
[19:13:22] arcusfelis joins the room
[20:02:37] Arjan joins the room
[20:22:43] <Arjan> nice!
[20:34:07] Arjan leaves the room
[20:34:27] Arjan joins the room
[20:40:36] mawuli.ypa joins the room
[20:51:17] Maas joins the room
[21:00:07] <Maas> Quite impressive what the marketing lady did in the last two weeks. Now 12 blogs and counting.
[21:00:41] <Arjan> nice
[21:00:49] <Arjan> did you put up the "powered by" logo?
[21:00:53] <Arjan> :)
[21:01:55] <Maas> Justin did something in that area, have not seen it. We wanted to update our channel site, but eventually there where too many small loose ends so we decided to keep the old site running.
[21:02:29] <Maas> There is going to be one though :-)
[21:03:53] <Maas> Tomorrow we are updating that server. Ancient ubuntu server which can't even do apt-get anymore and does not have git. archh
[21:03:59] cillian.deroiste joins the room
[21:05:12] <Arjan> heh
[21:05:58] <Maas> We wanted to let the consumer version go and actually stop that site.
[21:09:44] <Maas> Sometimes plans change.
[21:22:17] <mawuli.ypa> Good Evening!
[21:23:42] <mawuli.ypa> Maas: Do you really use the rowingbike?
[21:24:47] <mawuli.ypa> Nice work btw. Still wondering how shared web browsing works!
[21:28:11] Maas leaves the room
[21:29:00] Maas joins the room
[21:31:23] <Maas> I use the rowingbike to get to work. It is really fun to do.
[21:33:58] <mawuli.ypa> wow!
[21:34:27] <Maas> Shared web browsing, is pretty complex to build actually. Requires parsing html, javascript and do on the fly transformations on them to keep thing in sync.
[21:34:57] <mawuli.ypa> I have signed up for a demo :)
[21:36:03] <Maas> Cool. If you have an iphone or android device you can try it with your friends via rounds.com <http://rounds.com>. We made the cobrowsing component in their app.
[21:36:30] <mawuli.ypa> Yh, checking it out :)
[21:37:39] <Arjan> my phone is not compatible with the rounds.com app
[21:38:03] <Arjan> not for phones?
[21:38:07] <Arjan> I have a nexus 4
[21:39:22] <Maas> huh, that is strange, i think from android 4.0 it should work
[21:39:46] <Maas> does it have a front facing camera?
[21:39:56] <Maas> they check for that too
[21:42:00] arcusfelis leaves the room
[21:43:37] <Arjan> yeah
[21:43:45] <Arjan> it is google's flagship phone
[21:43:47] <Arjan> :P
[21:44:18] <Maas> pff
[21:44:45] <Arjan> also not compatible with my nexus7 tablet
[21:44:54] <Arjan> they must have messed something up
[21:45:29] <Maas> Checking, I think so too.
[21:50:50] <Maas> Checked it should work from android 2.3
[21:59:52] <Maas> Mailing them tomorrow about it.
[22:00:59] Arjan leaves the room
[22:20:01] Maas leaves the room
[23:55:55] Maas joins the room
[23:56:05] Maas leaves the room
[23:58:47] mawuli.ypa leaves the room
Powered by ejabberd Powered by Erlang Valid XHTML 1.0 Transitional Valid CSS!