<fkchang>
meh`_: can I have Lissio::Model that has an array as a property?
<fkchang>
apparently I can
<fkchang>
just looked through the Property code
<meh`_>
fkchang, ye
<meh`_>
fkchang, do you know if there's an unicode symbol for a catapult or similar siege machinery?
<fkchang>
meh`_: I have no idea
<fkchang>
I didn't think we had unicode for weapons
<meh`_>
snap
<meh`_>
I need it :D
<meh`_>
whatever, I'll just use a +
<fkchang>
meh`_: if I have say a model and it has property comes over as an array of json objects, not certain how I parse that into an array of hashes. I think I tried a number of things before, but it didn't quite work out
<meh`_>
fkchang, did you look at gwentoo?
<fkchang>
sorry for such a vague question, I can probably re ask when I'm closer to getting the result
<meh`_>
it has a lot of model transformation and stuff
<fkchang>
meh`_: I have at times, I'll look again
<meh`_>
everything should be covered there
<meh`_>
I know it's an even more vague response, but it's actually what I use myself to remember how to do stuff lol
skofo has quit [Ping timeout: 245 seconds]
fkchang has quit [Ping timeout: 250 seconds]
meh`_ has quit [Ping timeout: 245 seconds]
dimaursu16 has joined #opal
adambeynon has quit [Ping timeout: 260 seconds]
bcavileer has quit [Ping timeout: 260 seconds]
adambeynon has joined #opal
dimaursu16 has quit [Ping timeout: 245 seconds]
bcavileer has joined #opal
ryanstout has quit [Quit: ryanstout]
dimaursu16 has joined #opal
dimaursu16 has quit [Ping timeout: 245 seconds]
dimaursu16 has joined #opal
dimaursu16 has quit [Ping timeout: 255 seconds]
dimaursu16 has joined #opal
meh` has joined #opal
e_dub has quit [Quit: ZZZzzz…]
e_dub has joined #opal
GitHub67 has joined #opal
<GitHub67>
[opal] adambeynon pushed 1 new commit to operators: http://git.io/WzqWIw
GitHub67 has left #opal [#opal]
<GitHub67>
opal/operators 4528316 Adam Beynon: Very simple implementation of benchmark
skofo has joined #opal
travis-ci has joined #opal
travis-ci has left #opal [#opal]
<travis-ci>
[travis-ci] opal/opal#1919 (operators - 4528316 : Adam Beynon): The build is still failing.
e_dub has quit [Read error: Connection reset by peer]
e_dub has joined #opal
fkchang has joined #opal
e_dub has quit [Read error: Connection reset by peer]
e_dub has joined #opal
dimaursu16 has joined #opal
meh` has joined #opal
meh` has quit [Ping timeout: 244 seconds]
dimaursu16 has quit [Ping timeout: 245 seconds]
dimaursu16 has joined #opal
meh` has joined #opal
meh` has quit [Ping timeout: 260 seconds]
meh` has joined #opal
meh` has quit [Ping timeout: 255 seconds]
meh` has joined #opal
fkchang has quit [Ping timeout: 272 seconds]
meh` has quit [Ping timeout: 272 seconds]
ryanstout has quit [Quit: ryanstout]
ryanstout has joined #opal
meh` has joined #opal
fkchang has joined #opal
<fkchang>
meh`: how do you expose a js function or get to @native on Browser::DOM::Element or similar?
<meh`>
fkchang, #to_n
<meh`>
or how do you mean?
<meh`>
if something is missing from the wrapper, it should be added
<fkchang>
I want to expose scrollIntoView() for my app, I did it by monkey patching Browser::DOM::Node to have it and to run `#@native.scrollIntoViewIfNeeded()` -- I figure if could get the @native attr, I could hit it that way, i.e. node.native.scrollIntoView()
<meh`>
is scrollIntoView a standard thing?
<meh`>
or is it a library?
<meh`>
looks like it's an actual thing
<meh`>
fkchang, yeah, it should be added to opal-browser
<meh`>
adding it
<meh`>
if I can find the screen window
<fkchang>
cool, I went with scrollIntoViewIfNeeded() too, which isn't supported as widely, but there easy js to patch it in
<fkchang>
but there should be an easier way to get the @native so every request doesn't require opal-browser to be extended, IMO
<meh`>
fkchang, you can do Native(el.to_n)
<fkchang>
where el is of type Browser::DOM::Element ?
<meh`>
yes
<meh`>
or Node
<meh`>
so any Node
<meh`>
every Node has a #to_n
<fkchang>
ok, I'll probably queue up any additions I have and make a PR
<meh`>
fkchang, what's the functional difference between scrollIntoView and scrollIntoViewIfNeeded?
<meh`>
as in, should we even expose scrollIntoView?
<meh`>
it will be something like el.scroll.to
<fkchang>
scrollIntoView always aligns either to top or bottom of the screen, whether or not it's showing, scrollIntoViewIfNeeded only scrolls if it's not showing. The 2nd one is better interface for my app, but I could see scrollIntoView being more appropriate for other uses
<meh`>
I see
<meh`>
ok
<meh`>
then scroll.to for scrollIntoViewIfNeeded
<meh`>
and scroll.to! for scrollIntoView
<meh`>
the polyfill is still to be made, but at least the base is there
GitHub172 has joined #opal
<GitHub172>
[opal-browser] meh pushed 1 new commit to master: http://git.io/9slivg
GitHub172 has left #opal [#opal]
<GitHub172>
opal-browser/master 8fa1636 meh: dom/element/scroll: add #to and #to!
<fkchang>
cool, thx
<fkchang>
is there a way to set attributes on Lissio::Component aside from using element.set() ?
skofo[work] is now known as skofo
<meh`>
nope
<meh`>
the component should implement methods to do it
<meh`>
but in that case it's as easy as adding a def_delegator
ryanstout has quit [Quit: ryanstout]
skofo has quit [Ping timeout: 240 seconds]
travis-ci has joined #opal
<travis-ci>
[travis-ci] opal/opal-browser#192 (master - 8fa1636 : meh): The build is still failing.
<fkchang>
what if I don't to put it in a _.p but directly into the doc, _ << Lissio::Component::Markdown.render(@content) seems to escape the html tags
<fkchang>
meh`: it's escaped inside of the <p> too, is there an equivalent of html_safe() that I should be using?
<meh`>
because _ << thing is literally @children << thing
<meh`>
so no escape mechanism is involved
<fkchang>
_.p { Lissio::Component::Markdown.render(@content) } looks right, but _ << { Lissio::Component::Markdown.render(@content) } has escaped html tags
<fkchang>
I can live with _.p {} for now, but I thought it would work too
<meh`>
why between {}?
<meh`>
just _ << Lissio::Component::Markdown.render(@content)
<fkchang>
actually, no {}, having {} doesn't parse
<meh`>
ah wait
<meh`>
yeah
<meh`>
it should be _ << Lissio::Component::Markdown.new(@content) in that case
<meh`>
you're appending a string, so it gets escaped
<meh`>
you should append the component instance instead
<fkchang>
that works, thx
<fkchang>
I need to edit todays Q&A as a document
<meh`>
haha
<fkchang>
so when I change '_div "class" => "modal-dialog" do' to '_.div.modal[:dialog] do' I get a parse error, 'parse error on value "do" (kDO) :components/modal:27'
<meh`>
it should be .do { }
<meh`>
it's calling #do
<meh`>
sadly there's no way to pass a block to #[]
<fkchang>
oh, then it changes to '_.div.modal[:dialog].do do' which looks like it's calling me a "do do"
<meh`>
lol
<meh`>
yeah, I know
<meh`>
that's why I go with .do {} instead of .do do