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

IRC log for #mojo, 2013-12-08

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

All times shown according to UTC.

Time Nick Message
01:12 asarch joined #mojo
02:29 KindTwo joined #mojo
02:55 crab i really wish there was some way to make <%= content %> work inside widgets the way it does in layouts.
02:56 crab it's probably silly to obsess about it, but oh well.
02:56 jberger_ widgets?
02:56 purl widgets is the XWindows control language widgets, Tk is another language for working with widgets
02:58 crab jberger: i have a helper named widget that works almost exactly the way "include" does, except it takes some content (string or block) and makes it available to the included template as $content
02:59 crab so it can be used to wrap a common template around some caller-specified content, the way a layout is wrapped around a template.
02:59 crab i wrote it before the built-in include helper localised stash values, and used a gross-ish hack to do so. so i just cleaned that up, and now the only thing i dislike about it as the $content thing. :-)
02:59 jberger_ content_for doesn't help?
03:00 crab well, content_for 'what'?
03:01 crab i could make my helper do soething like content_for('widgetname', $content), and use <%= content_for 'widgetname' %> in the widget
03:01 crab but hardcoding the name in the widget seems suboptimal too
03:04 crab it's probably not worth worrying about
03:04 crab i find this helper quite useful, but nobody else has ever been particularly interested in it anyway.
03:05 jberger_ I can get by with content_for and template blocks well enough
03:06 jberger_ maybe if I saw an example I would understand your helper better
03:06 jovial_chat can't you make a template helper if you wanted to include it at a particular point?
03:29 d4rkie joined #mojo
03:35 Adura joined #mojo
03:42 crab i don't have a good example handy. let me make one.
03:44 crab ok, i have one. http://nopaste.info/37469a34d3.html
03:45 crab that's a search thingy, whose caller can override the default single-text-box contents of the search dialog
03:45 crab <%= widget 'search' => begin %><%= hidden_field ...%>...<% end %>
03:48 crab i have another one where there's a link that says "Add a thingy", and if you click it, it shows a form with a submit button and if you click submit it does AJAXy stuff. but the caller can specify what actually goes into the form. that way i can keep the appearance/behaviour (css, js) in one place, and just put an addform widget in the places that need it.
03:48 crab and that sort of thing
03:48 purl that sort of thing is an interesting idea
04:19 preflex_ joined #mojo
04:24 russum joined #mojo
05:05 russum joined #mojo
05:12 jberger_ anyone think this is interesting? https://gist.github.com/jberger/7853569
05:14 jberger_ obviously it would need a little more hardening
05:15 jberger_ but every time I try to use Mojo::UserAgent like wget I find this missing set of tools
05:33 russum joined #mojo
05:34 jberger_ sri: sub Mojo::Path::to_file { my $p = shift; $p->trailing_slash ? $p->[-1] : '' }
05:34 jberger_ a complement to to_dir
05:55 russum joined #mojo
06:37 Vandal joined #mojo
07:04 russum joined #mojo
07:05 russum joined #mojo
07:18 russum joined #mojo
07:19 russum left #mojo
07:54 hellyna joined #mojo
08:03 rem_lex joined #mojo
08:38 d4rkie_ joined #mojo
08:41 KindOne joined #mojo
08:43 denisboyun joined #mojo
08:56 d4rkie joined #mojo
09:00 dotan joined #mojo
09:09 dod joined #mojo
09:14 dod joined #mojo
09:31 basiliscos joined #mojo
09:53 Adura joined #mojo
10:38 marcus sri: Looking at implementing validations for convos now. Can I do a check with async calls?
10:41 crab does convos use canvas?
10:52 denis_boyun joined #mojo
10:54 d4rkie_ joined #mojo
11:04 marcus crab: no, why would it?
11:04 d4rkie joined #mojo
11:11 batman marcus: i'm pushing to the convos repo any second now...
11:12 batman at least any minute ;)
11:12 marcus batman: your rename? :)
11:12 batman yup
11:12 marcus batman: I hope I won't have too much hell merging my branch then
11:12 batman a bit of a pain renaming, since we have web_irc, wirc, Wirc, WIRC, .... :)
11:12 batman marcus: i would like if you didn't merge.
11:12 batman just copy the changes over in a new commit
11:13 marcus I guess it'll be nice to get everything sane
11:13 batman shouldn't be too much work
11:13 batman make a patch
11:13 marcus batman: I'm mostly only touching User.pm and index/user/register templates
11:13 marcus oh, and relevant tests
11:13 marcus I guess I can move over the changes fairly easily
11:13 batman i hate the cpanfile change. how the hell does this shit work..? :(
11:13 marcus hmm?
11:13 marcus cpanm supports cpanfile directly
11:13 marcus + carton
11:14 marcus I've grown to really love bundle on ruby, and carton is more or less a straight port.
11:14 batman ah. not too bad then
11:14 batman BUT IT NEED TO BE DOCUMENTED
11:14 marcus NEEDS
11:14 marcus :)
11:14 batman i know
11:15 marcus I've actually got a change to use carton directly from vendor/bin in script/web_irc.dev
11:15 batman don't have edit message support in wirc yet ;)
11:15 marcus just as well, I kind of hate that feature in slack
11:15 marcus batman: do you know about async validation btw?
11:16 marcus Wanted to write a validator for username available
11:16 batman no. don't see how that's possible
11:16 batman i would solve it in two steps
11:16 marcus Mojo::Delay?
11:17 marcus heh
11:17 marcus Mojo::IOLoop::Delay even
11:17 marcus Guess that won't work
11:17 marcus Ok, guess I'll keep your code for doing that bit then. Would like to inject the errors into validation at least tho
11:18 marcus https://www.evernote.com/shard/s22/sh/9be717dc-462c-499c-a3f6-3d49d477d47a/f31b08cb1e011a8af18004dc863d0836/deep/0/Nordaaker---Convos.png how login looks here atm :)
11:19 batman that looks bad :(
11:20 marcus batman: I think it's an improvement
11:20 marcus at it will work on mobile at least
11:20 marcus I hated the mixing of login/register
11:20 batman do you need to click on anything to log in?
11:21 marcus batman: what do you mean?
11:21 marcus You fill in the form and click the login button?
11:22 marcus We can iterate over the look to improve, but I wanted a reboot to make it simpler.
11:22 marcus I'd like the headings to align with the form for instance.
11:24 batman okidoki
11:24 batman https://wrapbootstrap.com/ # maybe we can get inspiration from here
11:27 marcus wow, that bugged out completely here
11:27 marcus https://www.evernote.com/shard/s22/sh/37127cb9-1a59-46e4-ae87-07b3ac1ad15c/b6d28e737432966ef991f346cd11cb77/deep/0/wirc.pl---Chat.png
11:28 batman i hope this is in a branch...
11:28 marcus No, that's on production. I see why
11:28 marcus I logged out in another tab
11:28 marcus to look at the frontpage
11:29 marcus so when it tries to handle the url, it pushes the frontpage...
11:30 hummeleBop joined #mojo
11:32 marcus (My register work is in a branch btw :)
11:34 hrupp joined #mojo
11:35 batman marcus: why is the repo private?
11:35 marcus batman: Because we wanted to do the refactor/cleanup before we opened it?
11:36 batman we do..?
11:36 marcus That is what we said last week
11:36 batman ok :)
11:36 sh4 joined #mojo
11:36 marcus and that we would open it after two weeks when you finished the port to mango
11:36 batman if i was drunk, it must have been the right thing to do :)
11:36 batman i've pushed
11:36 marcus but now I think we should just finish the readme and cleanup then open
11:36 batman i'm going to use mandel
11:37 marcus Yeah, I'm a bit worried about that
11:37 batman going to = want to
11:37 marcus as I mentioned yesterday
11:37 batman what did you mention?
11:37 marcus I'm worried that it's going to be a bigger job than you expect
11:37 marcus I said maybe we should open it up based on redis as it is.
11:37 marcus since it's working quite stable and nicely.
11:37 batman i agree
11:38 marcus I'm worried a huge port will cause instability, so I want to keep that separate.
11:38 marcus So we don't have a time pressure on it.
11:38 batman what? a huge rewrite never-ever cause instability
11:38 batman ......................
11:38 batman :D
11:44 batman convos got the first ticket
11:44 batman i'm out of here.
11:44 batman enjoy the branch marcus
11:44 batman all tests are ok
11:44 batman branch = new repo
11:45 marcus batman: thanks. Looks great. Will reapply my new branch manually there.
11:45 batman marcus++
11:45 marcus Very nice to have it streamlined.
11:45 marcus (One name)
11:47 marcus batman: guess we're targetting public release tomorrow then.
11:47 batman :)
11:49 * batman will get his boots
11:49 batman snow has arrived!
11:56 ka2u joined #mojo
12:31 crab marcus: because convos sounds like canvas, of course
12:32 crab and, y'know, html5
13:16 maxhq joined #mojo
13:21 SuperOSX joined #mojo
13:23 SuperOSX joined #mojo
13:29 mire_ joined #mojo
13:47 asarch joined #mojo
14:53 denis_boyun joined #mojo
15:04 jberger_ o/
15:05 jberger_ so when anyone has used Mojo::UserAgent in place of wget to download files, did anyone else miss the ability to detect file names easily?
15:06 jberger_ I'm curious if anyone has thoughts on a "plugin" like this: https://gist.github.com/jberger/7853569
15:06 jberger_ I put plugin in quotes since it doesn't really need a controller
15:16 denis_boyun_ joined #mojo
15:19 sh4 joined #mojo
15:21 batman jberger: i don't get the helpers... can you make a synopsis?
15:22 jberger the helpers can be ignored really, its just two functions
15:22 jberger first one tries to figure out the name of the file you just downloaded
15:22 batman yeah, but i don't see how they will help me :)
15:23 jberger $ua->get('/will/send/some/file')->res->content->asset->move_to( <<where>> )
15:24 jberger wget /will/send/some/file # saves to myfile.ext
15:24 jberger save($ua->get('/will/send/some/file')) # saves to myfile.ext
15:25 jberger and yes the functional interface is not beautiful, but its a useful prototype
15:26 batman so... i still don't get the helper() part :(
15:26 jberger ignore that for now :-)
15:26 jberger in fact, I'm blowing it away right now
15:26 jberger because its the wrong tx
15:27 batman thanks :)
15:27 jberger I really would rather see these be methods on the tx object returned by the ua
15:29 batman minor thing... i think this is more readable: return $1 if $disp =~ /filename\=\"([^"]+)\"/;
15:29 jberger yeah, I think I originally had something more after that, but yeah
15:29 jberger thanks
15:30 batman i also think $1 might also contain more than just the basename
15:30 batman so you probably want to do basename($1) or something
15:31 batman not sure how to make that portable (and i might be wrong)
15:31 batman filename="../../..///etc/something" # probably not a good thing
15:32 batman i'm not sure if it should be part of the Mojo::Transaction class though
15:32 batman i consider it more like Mojo::Util::spurt()
15:33 jberger I said it is useful in the transaction class, for chaining style
15:33 jberger I'm not saying it should be core functionality
15:34 jberger batman, is the convos repo public?
15:34 batman would you enable it with monkey_patch() ?
15:34 batman jberger: not yet. probably tomorrow
15:34 jberger I was just working on that :-)
15:34 russum joined #mojo
15:35 jberger https://gist.github.com/jberger/7853569
15:35 * batman will probably start using Scalar::In
15:36 batman not sure why you add this as a plugin... i would rather go MojoX::Transaction::Util; and then monkey_patch() in import()
15:36 jberger sure, its no different really
15:37 jberger my use is inside a webapp
15:37 jberger but there's no reason why that has to be true
15:38 batman the plugin doesn't really do anything with the app, nor the controller. that's why i think it's confusing
15:39 batman jberger: you will probably see a tween once convos is public...
15:39 batman *tweet
15:40 batman marcus: maybe we should blog about it as well...
15:40 jberger you should! and I will retweet you for sure
15:40 * batman is off to the gym *bbl*
15:40 batman :)
15:40 jberger o/
15:41 jberger you might also look at Smart::Match
15:41 jberger (re: Scalar::In)
15:42 batman yeah, i think Smart::Match is a bit too much. Scalar::In was so clean...
15:42 batman i might be wrong.
15:42 batman marcus: do we have the domain set up for convos?
15:54 mire_ joined #mojo
16:04 russum left #mojo
16:10 itz_ left #mojo
16:10 kanishka joined #mojo
16:29 marcus batman: convos.by
16:32 hellyna hello again.. is there any way i can loop through to print available labels for label_for?
16:33 hellyna like all the fields i have added through $validation->optional() or ->required()
16:33 hellyna let's say i have a huge number of fields... do i have to specify one by one? or can I just loop through?
16:36 marcus batman: /join #convos ?
16:38 jberger sri: any chance of getting a Mojo::Asset::Memory::handle method?
16:39 jberger (and thus a Mojo::Asset::handle method)
16:39 jberger (abstract)
16:53 ka2u joined #mojo
17:00 rem_lex joined #mojo
17:14 ka2u joined #mojo
17:43 kanishka joined #mojo
17:57 jberger joined #mojo
18:17 Adura joined #mojo
18:51 ka2u joined #mojo
18:52 jberger joined #mojo
19:04 abra joined #mojo
19:17 dod joined #mojo
19:17 meshl joined #mojo
19:17 hellyna joined #mojo
20:08 chansen marcus: seen <https://metacpan.org/release/Time-Moment>?
20:08 purl I haven't seen '<https://metacpan.org/release/Time-Moment>', chansen
20:09 chansen purl, I love U 2
20:09 purl chansen: what?
20:12 chansen purl: ????
20:12 purl chansen: huh?
20:12 chansen purl: \x{0xF09F9293}
20:12 purl chansen: excuse me?
20:13 chansen fucking stupid bot!
20:13 chansen sri: where is your Mojo bot?
20:40 batman chansen: Time::Moment looks good. first impression: datetime without all the fuzz
20:45 asarch joined #mojo
20:47 lukep joined #mojo
20:53 hellyna joined #mojo
21:00 hellyna joined #mojo
21:03 hellyna um. i have a question. how can i make the $self->redirect_to call at /some/subdir/somescript.cgi redirect to an absolute url?
21:03 hellyna because currently... $self->redirect_to('/anothersubdir'); is redirected to /some/subdir/somescript.cgi/anothersubdir instead
21:05 dsteinbrunner joined #mojo
21:10 marcus chansen: pretty neat :)
21:11 tianon hellyna: doesn't redirect_to accept a Mojo::URL object? ;)
21:12 tianon see also http://mojolicio.us/perldoc/Mojolicious/Controller#redirect_to
21:12 tianon <3 Mojo::URL
21:12 tianon I've imported Mojo for small scripts just to get Mojo::URL, too :D
21:37 hellyna tianon: thanks :) it works.
22:05 dsteinbrunner_ joined #mojo
22:09 dvinciguerra joined #mojo
22:29 dsteinbrunner joined #mojo
22:30 chansen batman: =)
22:30 chansen marcus: =)
22:31 chansen please try to break it =)
22:48 meshl joined #mojo
23:10 dsteinbrunner joined #mojo

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