The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2017-04-23

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:02 jonasbn joined #mojo
00:11 dikim joined #mojo
00:17 cheako joined #mojo
00:26 cheako Mojolicious::Plugin::Recaptcha, Mojolicious::Plugin::ReCAPTCHAv2, or Mojolicious::Plugin::Captcha::reCAPTCHA?
00:31 cheako Plugin::Recaptcha looks like it modifies the stash for you while the others need a few extra lines of code to do that.
00:36 jonasbn joined #mojo
00:48 Lee joined #mojo
00:55 cheako Are there conventions for plugins' stash names?  Plugin::Recaptcha uses recaptcha_html, for example.
01:05 jonasbn joined #mojo
01:14 sri no, but using a prefix related to the plugin name is customary, so i would consider recaptcha_html pretty good style
01:21 aborazmeh joined #mojo
01:28 cheako http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Content-blocks    Should have an example that makes use of a sidebar, so we can see how it's supposed to be used.
01:30 jonasbn joined #mojo
02:00 jonasbn joined #mojo
02:02 cheako http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Form-validation  'e' to 't' is a little arbitrary.  Try qr/^[a-z_][a-z0-9_-]*\$?$/   from https://unix.stackexchange.com/questions/157426/what-is-the-regex-to-validate-linux-users/157431#157431
02:05 noganex joined #mojo
02:31 jonasbn joined #mojo
02:41 jonasbn joined #mojo
03:01 jonasbn joined #mojo
04:03 TBSliver joined #mojo
04:03 BinGOs joined #mojo
04:03 garu joined #mojo
04:03 alilles joined #mojo
04:03 xdg joined #mojo
04:03 cosimo joined #mojo
04:03 eseyman joined #mojo
04:03 dabudabu joined #mojo
04:03 mattp joined #mojo
04:03 elik joined #mojo
04:03 ribasushi joined #mojo
04:03 kamyl joined #mojo
04:03 ssm joined #mojo
04:03 omega joined #mojo
04:03 cfedde joined #mojo
04:03 diegok joined #mojo
04:03 HtbaaPi joined #mojo
04:03 umask001 joined #mojo
04:03 Peppard joined #mojo
04:03 coolo joined #mojo
04:03 mishanti1 joined #mojo
04:03 jnbek joined #mojo
04:03 suede joined #mojo
04:03 phillipadsmith joined #mojo
04:03 Ralesk joined #mojo
04:03 jmac joined #mojo
04:03 noganex joined #mojo
04:04 dikim joined #mojo
04:04 disputin joined #mojo
04:04 stryx` joined #mojo
04:04 dboehmer_ joined #mojo
04:04 castaway joined #mojo
04:04 dexteruk joined #mojo
04:04 chandwki joined #mojo
04:04 genio joined #mojo
04:04 ashimema joined #mojo
04:04 romel joined #mojo
04:04 new_student joined #mojo
04:04 sawtooth joined #mojo
04:04 jlaffaye joined #mojo
04:04 nicomen joined #mojo
04:04 esh joined #mojo
04:04 pink_mist joined #mojo
04:04 mbudde joined #mojo
04:04 ranguard joined #mojo
04:04 cstamas joined #mojo
04:04 tianon joined #mojo
04:04 iamb joined #mojo
04:04 matt_ joined #mojo
04:04 Jonis joined #mojo
04:04 haarg joined #mojo
04:04 nic joined #mojo
04:04 oalders joined #mojo
04:04 abracadaniel joined #mojo
04:04 dboehmer joined #mojo
04:05 jonasbn joined #mojo
04:05 salv0 joined #mojo
04:05 zivester joined #mojo
04:05 jacobydave joined #mojo
04:05 bc547 joined #mojo
04:05 simcop2387 joined #mojo
04:05 meredith joined #mojo
04:05 arcanez joined #mojo
04:05 firnsy joined #mojo
04:05 tinita joined #mojo
04:05 caeles joined #mojo
04:05 tempire joined #mojo
04:05 saki joined #mojo
04:05 lari joined #mojo
04:05 charsbar joined #mojo
04:05 vytas joined #mojo
04:05 vinnix joined #mojo
04:05 Kundun joined #mojo
04:05 aborazmeh joined #mojo
04:05 jabberwok joined #mojo
04:05 mat_ joined #mojo
04:05 mpapec joined #mojo
04:05 marcus joined #mojo
04:05 salva joined #mojo
04:05 bwf joined #mojo
04:05 purl joined #mojo
04:05 Gedge joined #mojo
04:05 litwol joined #mojo
04:05 wouter joined #mojo
04:05 Bender joined #mojo
04:05 odc joined #mojo
04:05 inokenty joined #mojo
04:05 plicease joined #mojo
04:05 webart joined #mojo
04:05 tardisx joined #mojo
04:05 mtj joined #mojo
04:05 cng joined #mojo
04:05 mtths joined #mojo
04:05 augensalat joined #mojo
04:05 dustinm joined #mojo
04:05 crab joined #mojo
04:05 ccakes joined #mojo
04:05 tyldis joined #mojo
04:05 Caldrin joined #mojo
04:05 sri joined #mojo
04:05 mrallen1 joined #mojo
04:05 Phil21 joined #mojo
04:05 michael joined #mojo
04:05 Zx3 joined #mojo
04:05 jnap joined #mojo
04:05 bjakubski joined #mojo
04:05 preaction joined #mojo
04:05 Obbi joined #mojo
04:05 Eke joined #mojo
04:05 jesk joined #mojo
04:10 kaare joined #mojo
04:12 jonasbn joined #mojo
04:14 maschine joined #mojo
04:23 jonasbn joined #mojo
04:42 jonasbn joined #mojo
04:43 cheako joined #mojo
04:53 jonasbn joined #mojo
05:04 cheako Hello, I use a trick where default/current form data is stashed away in hidden fields.  I use these values to prevent concurrent edits.  I'll pastebin a small example.
05:05 cheako Obviously this can be done in mojo, but I'm wondering if there is a helper/plugin that already does this?
05:13 jonasbn joined #mojo
05:13 cheako I'm also interested in actually signing the hidden fields, not that it's necessary but it won't hurt.  and I thought that signing cookie data was ingenious.
05:15 cheako I'm not having luck with a simple pastebin example.
05:16 cheako What happens is a three way diff, the form fields are diffed to discover what the user changed and then the hidden fields are diffed with the "locked" database to see if there was an edit since the user loaded the form.
05:17 cheako If there is a conflict a vary explicit message can be presented to the user.  "Some one else made a change to foo and it is now bar.  Are you sure u want to continue?"
05:21 cheako I see the weblog and I'll read there for any answer and if I'm available I'll jump back on IRC.  Thanks!
05:33 jonasbn joined #mojo
05:44 jonasbn joined #mojo
05:54 jonasbn joined #mojo
06:04 jonasbn joined #mojo
06:14 jonasbn joined #mojo
06:21 cheako joined #mojo
06:23 cheako I've decided to look at TagHelpers.pm to see if I could figure out how to extend those functions, for the above.
06:34 dod joined #mojo
06:34 jonasbn joined #mojo
06:39 dod joined #mojo
06:55 jonasbn joined #mojo
06:57 cheako https://pastebin.com/tKqaUYJm   That should just about do it.
07:17 jonasbn joined #mojo
07:37 jonasbn joined #mojo
07:50 lari joined #mojo
08:30 Unrelated joined #mojo
08:57 sh14 joined #mojo
09:33 omega_ joined #mojo
09:56 omega_ joined #mojo
10:18 khfeng joined #mojo
11:09 omega joined #mojo
11:30 sri yea, i guess i would make mojolicious use promises if Perl had a good implementation of async/await https://twitter.com/manekinekko/status/855824609299636230
11:31 sri that illustrates the advantage really well
11:32 sri second example is raw promises and you can see how terrible it would be to pass data from the first async method to say the last
11:32 sri while the third makes it all super simple
11:48 avkhozov joined #mojo
11:51 kiwiroy joined #mojo
12:14 pink_mist sri: https://gist.github.com/genio/50d2046d65af9f0b48808ffff1cd6716
12:17 avkhozov joined #mojo
12:42 kaare_ joined #mojo
12:52 zivester joined #mojo
13:02 sri pink_mist: nothing has been implemented as far as i can see
13:05 sri and i guess the fact that it is meant to be tied to Future will make it not be usable for us
13:07 sri LeoNerd is doing promises very very wrong imo
13:07 sri but oh well, we always disagreed on api design
13:08 * sri thinks promises implementations should follow promises/a+ and be interoperable that way, and only extend functionality around such a core
13:09 avkhozov joined #mojo
13:22 someguy joined #mojo
13:34 noganex_ joined #mojo
14:01 sri btw
14:01 sri Mojo::Pg now also has Windows testing https://github.com/kraih/mojo-pg
14:01 dikim joined #mojo
14:01 sri and it fails
14:01 sri if anyone feels like trying to fix it
14:02 sri looks like DBD::Pg does not actually install on cygwin :S
14:14 jberger :s
14:14 good_news_everyon joined #mojo
14:14 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v9kvO
14:14 good_news_everyon mojo/master 7242e8b Sebastian Riedel: do not ignore .appveyor.* files
14:14 good_news_everyon left #mojo
14:15 pink_mist doesn't cygwin come with packages for this kind of thing?
14:15 pink_mist - i.e. use the cygwin-provided packages for such modules instead of cpan?
14:16 sri you're welcome to try and make that work on appveyor
14:16 pink_mist I ... have literally no idea how X_X
14:16 pink_mist Grinnz: help :PP
14:16 sri neither do i
14:17 sri and it appears all non-blocking Mojo::Pg is broken on windows currently
14:23 kaare_ joined #mojo
14:23 jberger I guess I should make a mailing list post about the search for a windows morbo backend maintainer
14:26 sri ok, i tried to make it work on windows https://ci.appveyor.com/project/kraih/mojo-pg/build/7/job/a47kfkse60vor8m7
14:26 sri looks like i can't
14:28 * sri has to give up https://github.com/kraih/mojo-pg/commit/dd12ad597ff46e352926324b42c3ccea654f8b3d
14:32 sri there's an existing issue https://github.com/kraih/mojo-pg/issues/40
14:32 sri if someone wants to make it work
14:36 tchaves joined #mojo
14:49 kiwiroy joined #mojo
15:33 Grinnz pink_mist: why would i know anything about appveyor or windows
15:39 PryMar56 joined #mojo
16:08 dod joined #mojo
16:19 pink_mist Grinnz: I thought you were one of the cygwin afficionados
16:20 Grinnz ive used it before, but not in like 6 months
16:31 Janos joined #mojo
16:32 jberger I think I'm going to release my dead-simple model system today
16:43 Grinnz jberger: i'd happily maintain it, but marcus said on the github issue he wants to release his now?
16:44 Grinnz oh, windows
16:44 Grinnz nvm :P
16:44 jberger yeah
16:44 jberger I spent most of an evening last weekend trying to setup a windows 10 vm so that I could do it
16:44 jberger mosterous waste of time
16:48 kiwiroy joined #mojo
17:01 jberger anyway, this is what I'm going to try to release today: https://github.com/jberger/Mojo-TypeModel
17:01 jberger I'm curious if people are interested, have comments, etc
17:07 cheako joined #mojo
17:15 Janos joined #mojo
17:30 cheako Looking at Mojolicious/Plugin/TagHelpers.pm I think there's an extra conditional that's irrelevant.  sub _input "delete $attrs{checked} if @values;"  This is in a block that's if(@values).
17:34 cheako This is more an HTML question, but relating to the same block.  Radio button's can't have multiple values, correct? and checkboxs' can't share the same name, right?
17:35 cheako so this "$attrs{checked} = undef if grep { $_ eq $attrs{value} } @values" makes no sense.
17:48 kiwiroy joined #mojo
17:51 marcus Grinnz: I've just shipped it.
17:52 Grinnz nice, marcus++
17:53 cheako The grep part, it should just be $values[-1] and actually the else part a few lines down should be around "my $type"...  I think it's all messed up, though it could be that I don't understand something.
17:54 Grinnz cheako: it looks like the grep has been that way for a long time. (5 years ago it was converted from smartmatch https://github.com/kraih/mojo/commit/392ac5b72b6d3ea2c3614e12309f6a2fb5bda581#diff-ab8c5553c5f71a9d70038dac95d4d07d)
17:55 Grinnz there probably has been no reason to change it, and the if block around changed
17:59 Grinnz cheako: radio buttons can't have multiple values, but the get/post parameters sure could
17:59 Grinnz cheako: this code is setting the default checked/selected item from whatever is in get/post
18:00 Grinnz it's a bit overly defensive but i think that's warranted here
18:27 cheako joined #mojo
18:49 kiwiroy joined #mojo
18:57 sri cheako: you're correct
18:57 good_news_everyon joined #mojo
18:57 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v9kG9
18:57 good_news_everyon mojo/master 99ab333 Sebastian Riedel: remove redundant check
18:57 good_news_everyon left #mojo
18:57 sri cheako: and incorrect
18:58 cheako joined #mojo
20:49 kiwiroy joined #mojo
21:06 cheako joined #mojo
21:49 kiwiroy joined #mojo
22:24 PryMar56 joined #mojo
23:40 cheako joined #mojo
23:42 cheako http://mojolicious.org/perldoc/Mojolicious/Plugin/TagHelpers#tag   $c->tag('meta', charset => 'UTF-8');   shouldn't that be "<meta name="charset" content="UTF-8" />" instead of "<meta charset="UTF-8" />"
23:44 pink_mist sounds likely
23:48 kiwiroy joined #mojo
23:49 cheako sri, thanks I think I've figured the checkbox thing out.  It deserves a JS Fiddle for testing but I'm not that into it.
23:51 cheako I'd just chalk any behavior observed when checkboxes share the same name as being browser specific.
23:52 preaction they must all be in the query string. not sure what you're meaning. there can always be multiple inputs with the same name, including checkboxes
23:53 stryx` joined #mojo
23:55 pink_mist what the browser actually sends for a given form matters little - the query string can be written by hand in order to try to exploit a weakness in the code

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary