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

IRC log for #mojo, 2016-09-21

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

All times shown according to UTC.

Time Nick Message
00:49 trobotham joined #mojo
01:16 disputin joined #mojo
02:15 noganex_ joined #mojo
02:25 ivi joined #mojo
02:29 asarch joined #mojo
02:43 ZzZombo joined #mojo
02:44 kaare_ joined #mojo
02:45 ZzZombo Hello. What is the procedure for POSTing a JSON to a Mojolicious app via AJAX? I get "not found" errors unless I use the GET method. And yes, my routes do have POST for this.
02:48 preaction are you trying to respond to a post request, or are you trying to create a post request?
02:48 preaction either way, paste your code to a paste site so we can see it
02:48 ZzZombo Respond to an AJAX request
02:49 ZzZombo Will do in a minute.
02:49 zivester joined #mojo
02:53 ZzZombo http://pastebin.com/eG4vDEqm
02:55 preaction line 22 of your paste already creates a get route. i'm not sure you can create a post route from a get route. perhaps you want $r->under( '/api' ) instead?
02:56 preaction and, like was asked in #perl, why are you duplicating a router in your sub handler?
02:57 ZzZombo Because I want it so. I have a central processing of result you seem to ignore.
02:57 ZzZombo Or rather, dont' notice.
02:58 Grinnz the parent needs to be ->all or a route which manually has both GET and POST set
02:58 Grinnz sorry, ->any
02:59 ZzZombo Hm?
02:59 Grinnz since $stuff is a ->get route all of its child routes will be restricted to GET
03:01 ZzZombo Seems so.
03:01 ZzZombo Thanks.
03:06 preaction or, if you don't want '/api' to be a valid endpoint, you can use under()
03:15 jberger any route with children is not a valid endpoint
03:16 jberger you can use my $api = $r->any('/api'); in the same way as my $api = $r->under('/api');
03:17 Grinnz actually ->under would make it a valid endpoint
03:32 kaare joined #mojo
04:17 firnsy sri: congrats on the new job
05:24 dod joined #mojo
05:30 dod joined #mojo
05:50 dod joined #mojo
06:45 mbudde joined #mojo
06:59 inokenty-w joined #mojo
07:02 AndrewIsh joined #mojo
07:04 Vandal joined #mojo
07:06 trone joined #mojo
07:25 Craftsmanship joined #mojo
07:33 jamesaxl joined #mojo
07:39 jamesaxl joined #mojo
07:41 kes joined #mojo
07:48 ksmadsen Regarding Mojo::DOM and text, it appears that innerText is now part of the HTML living standard: https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute
07:48 ksmadsen It appears to have been added in the middle of August
07:49 ksmadsen So it didn't exist when the original issue was raised
08:07 sri oh yea, lenovo being lenovo https://www.reddit.com/r/linux/comments/53ri0m/warning_microsoft_signature_pc_program_now/
08:09 sri and microsoft being old microsoft again, i suppose
08:09 osfabibisi joined #mojo
08:31 abra joined #mojo
08:31 polettix joined #mojo
08:40 nicomen innerText taking visibility into account? Has that always been the case?
08:42 abra joined #mojo
09:04 batman nicomen: is this the right channel...? pretty sure it's browser specific
09:05 batman where IE is most intuitive
09:18 nicomen I could ask that question in another channel, but it would be quite out of context given that it was a comment on ksmadsen's post
09:18 nicomen read up a bit here http://perfectionkills.com/the-poor-misunderstood-innerText/ - and it is a bit interesting in relation to the previuos ->text changes in Mojo::DOM ;)
09:28 sri batman: how is this the wrong channel for a Mojo::DOM comment? Oo
09:29 batman sri: what does "innerText" and visibility have to do with Mojo::DOM..?
09:29 sri see backlog
09:30 batman sorry, i don't get it :(
09:31 sri http://irclog.perlgeek.de/mojo/2016-09-20#i_13244431
09:31 sri read!
09:34 Crisewng joined #mojo
09:35 batman i still don't see how "visibility" is relevant.
09:36 batman from what i can see, it's the same old arguments and the same discussion.
09:36 * batman backs out
09:37 nicomen there's been a lot of debacle on what correct beahviour for ->text should be. Most solutions have inconsistencies in either direction. One of the now defined behaviours take things like display and visibility into account, so that makes it probably less relevant for how ->text should behave
09:37 nicomen IIRC ->text now behaves like textContent instead of trying to do black magic
09:38 nicomen amirite?
09:44 mib_47u9uu joined #mojo
09:54 dod joined #mojo
10:00 dod1 joined #mojo
10:15 dod joined #mojo
10:43 Crisewng joined #mojo
11:40 dod joined #mojo
11:41 polettix joined #mojo
11:49 ZzZombo Does Mojo handle HTTPS requests out of the box?
11:49 pink_mist it needs IO::Socket::SSL installed
11:50 ZzZombo And that's it then?
11:50 pink_mist yup
11:50 ZzZombo Cool, thanks.
11:51 ZzZombo BTW, where exactly does it "turn" routes into controller actions? I has been learning its code, and was puzzled as I couldn't find the place it happens.
11:52 pink_mist that question is out of my league so I'll leave it to the experts
12:07 jberger ZzZombo: i don't understand the question
12:08 ZzZombo Where does the route dispatcher loads controllers for matched routes and invokes corresponding actions?
12:11 asarch joined #mojo
12:13 jberger Mojolicious::Routes::dispatch
12:14 jberger Which is called from Mojolicious::dispatch which is the default subscriber to the around_dispatch hook
12:15 jberger Which is emitted from Mojolicious::handler
12:15 jberger And handler is the initiation point for all Mojo apps
12:16 anton joined #mojo
12:16 jberger (And in that wall of text, the distinction between Mojo and Mojolicious is intentional not colloquial)
12:17 ZzZombo I am looking there... I still can't find how does Mojo load controller modules nor invokes actions from them.
12:20 jberger You have to read into the private method calls contained in dispatch
12:28 gizmomathboy joined #mojo
12:34 ZzZombo joined #mojo
12:35 ZzZombo Am I missing something? Why 'return !!defined $new' instead of just 'return defined $new' in the _controller function in Mojolicious::Routes?
12:44 mpapec it seems like defined() is not to be trusted in what it returns, so !! forces boolean ;)
12:50 pink_mist I don't think that's accurate
12:50 pink_mist defined is documented to always return a boolean
13:09 ZzZombo Help! My controller method 'can' returns booleans instead of coderef.
13:12 ramortegui joined #mojo
13:39 eseyman joined #mojo
13:48 gizmomathboy joined #mojo
14:09 cpan_mojo Mojolicious-Plugin-OpenAPI-1.01 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-OpenAPI-1.01
14:31 cpan_mojo Mojolicious-Plugin-UniqueTagHelpers-0.01 by RSHADOW https://metacpan.org/release/RSHADOW/Mojolicious-Plugin-UniqueTagHelpers-0.01
14:39 disputin joined #mojo
14:49 cpan_mojo Mojolicious-Plugin-UniqueTagHelpers-0.02 by RSHADOW https://metacpan.org/release/RSHADOW/Mojolicious-Plugin-UniqueTagHelpers-0.02
15:04 jberger oooh http://blog.2ndquadrant.com/bdr-is-coming-to-postgresql-9-6/
15:08 gizmomathboy joined #mojo
15:34 disputin joined #mojo
15:55 jamesaxl joined #mojo
15:57 PryMar56 joined #mojo
16:24 dod joined #mojo
16:40 lluad joined #mojo
16:44 sri batman: you're not being constructive
16:45 sri batman: what they have brought up is very relevant, and i don't appreciate your dismissive comments at all
16:46 sri if this can safely be applied to Mojo::DOM, i think we should https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute
16:46 sri of course CSS visibility has no relavance for us, but the rest seems like it might be good enough
16:47 disputin joined #mojo
16:54 sri but maybe i've overestimated the interest in getting whitespace trimming back in Mojo::DOM, since nobody disagreed with batman other than me
16:54 sri so yea, i'll not be looking into it
16:54 sri but as usual, proposals welcome
17:00 sri in fact, lets just not call it a priority anymore
17:20 good_news_everyon joined #mojo
17:20 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/viQRu
17:20 good_news_everyon mojo/master 22bcc99 Sebastian Riedel: no need to typecast
17:20 good_news_everyon left #mojo
17:20 eseyman joined #mojo
17:36 disputin joined #mojo
17:48 jberger sri: nicomen disagreed, which is why I didn't jump in
18:03 jberger (meaning, the disagreeing had already been accomplished, I didn't want to pile on)
18:07 good_news_everyon joined #mojo
18:07 good_news_everyon [mojo] kraih pushed 2 new commits to master: https://git.io/viQaj
18:07 good_news_everyon mojo/master 8bb494d Nick Morrott: Fix a typo...
18:07 good_news_everyon mojo/master 6cd1a67 Sebastian Riedel: Merge pull request #1001 from knowledgejunkie/patch-1...
18:07 good_news_everyon left #mojo
18:08 good_news_everyon joined #mojo
18:08 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/viQVc
18:08 good_news_everyon mojo/master f6a27f6 Sebastian Riedel: fix formatting
18:08 good_news_everyon left #mojo
18:22 Janos joined #mojo
20:36 ptolemarch joined #mojo
20:56 sri bummer, f.lux for linux seems to suck
20:59 sri oh, looks like redshift is the one you're supposed to use
21:13 zivester joined #mojo
22:54 iamb joined #mojo

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