meh` changed the topic of #opal to: http://opalrb.org - Ruby runtime and library on top of Javascript | 1.0.0 is near | This channel is logged at https://botbot.me/freenode/opal/
e_dub has joined #opal
fkchang has joined #opal
<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.
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/32979995
ryanstout has joined #opal
skofo is now known as skofo[work]
skofo[work] has quit [Quit: Leaving]
skofo has joined #opal
skofo is now known as skofo[work]
dimaursu16 has quit [Ping timeout: 240 seconds]
dimaursu16 has joined #opal
dimaursu16 has quit [Ping timeout: 245 seconds]
meh` has quit [Ping timeout: 250 seconds]
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.
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal-browser/builds/33009946
travis-ci has left #opal [#opal]
skofo has joined #opal
skofo has quit [Ping timeout: 260 seconds]
<fkchang> meh`: can I do something less ugly than _.h4({ "class" => "modal-title"}) { @title}
<meh`> fkchang, _.h4.modal[:title].do { @title }
<meh`> but that's still ugly
<meh`> and doesn't do what you really want
<fkchang> sometimes I have more attributes, like: _.button( {"class" => "btn bt-primary", "type" => "button", "data-dismiss" => "modal"}) { "Close"}
<meh`> button.btn.bt[:primary].data(dismiss: :modal) { "Close" }
<meh`> shouldn't button type already be button?
<meh`> no
<meh`> button.btn.bt[:primary].type(:button).data(dismiss: :modal) { "Close" }
<meh`> fkchang, some elements have helpers in paggio
<meh`> the missing ones should be added
<meh`> but there really needs to be a way to add inline without a method supporting it
<meh`> mh
<fkchang> ok, the button part looks better
<fkchang> and then I don't need the final block either
<meh`> h4.modal[:title].text(@title)
<meh`> after I push this change to paggio
<meh`> and button.btn.bt[:primary].type(:button).data(dismiss: :modal).text("Close")
<meh`> or do you have a better name than #text in mind?
<meh`> #content, #value
<meh`> which would you go for?
<meh`> fkchang, ^
<fkchang> aren't those value in jquery and raw js?
<fkchang> I'd go with value coz it's the same as node.value = "blah"
<meh`> ye, sounds goood
<meh`> the problem that arises is
<meh`> button already has #value
<meh`> as an attribute
<meh`> so it's not really good
skofo has joined #opal
<meh`> it's used for other things as well
<fkchang> hmm, that must be why jquery uses val()
e_dub has quit [Quit: ZZZzzz…]
<meh`> every operator but #<< and #[] is available in the DSL
<meh`> one must be good
<meh`> and button.btn.bt[:primary].type(:button).data(dismiss: :modal) ~ "Close"
<meh`> and button.btn.bt[:primary].type(:button).data(dismiss: :modal).~("Close")
<meh`> and button.btn.bt[:primary].type(:button).data(dismiss: :modal).%("Close")
<meh`> and button.btn.bt[:primary].type(:button).data(dismiss: :modal) % "Close"
<meh`> and button.btn.bt[:primary].type(:button).data(dismiss: :modal) >> "Close"
elia has joined #opal
<fkchang> hmm, maybe a compound word node_value ?
<fkchang> elt_value
<fkchang> or just val the same as jquery
_elia has joined #opal
GitHub195 has joined #opal
<GitHub195> [opal] elia pushed 10 new commits to gh-pages: http://git.io/0bDWEQ
GitHub195 has left #opal [#opal]
<GitHub195> opal/gh-pages bdbc62f Elia Schito: HTML5!
<GitHub195> opal/gh-pages 53cef08 Elia Schito: Add sdoc style catch-all list
<GitHub195> opal/gh-pages e83cf7a Elia Schito: Fork the default yard template
<meh`> fkchang, doesn't fit much imho
<meh`> an operator sounds like a better option sincerel
<fkchang> I can't think of an operator that matches the intent, except =
skofo has quit [Ping timeout: 240 seconds]
elia has quit [Ping timeout: 255 seconds]
<fkchang> meh`: do I remember correctly you embedding markdown processing somewhere?
<meh`> fkchang, yep, 'lissio/component/markdown'
<fkchang> does it support github flavored?
<meh`> I don't know :D
<meh`> fkchang, https://github.com/chjj/marked it uses this
<fkchang> if in my html, I have the following
<fkchang> _.div({ "class" => "modal-body"} ) {
<fkchang> _.h4 "Description"
<fkchang> _.p @content
<fkchang> _.h4 "Activity"
<fkchang> }
<fkchang>
<fkchang> and I want to wrap the @content as markdown, how would I use the component?
<meh`> _.p Lissio::Component::Markdown.render(@content)
<meh`> that would be the easiest way
<meh`> also I'd rather do _.div.modal[:body].do { }
<meh`> or _.div(class: 'modal-body') { }
dimon_ has joined #opal
GitHub37 has joined #opal
<GitHub37> opal/master ffa9fc1 Elia Schito: Silence output using IO#write_proc=
<GitHub37> opal/master 3752f70 Elia Schito: Fix yard version
<GitHub37> [opal] elia pushed 4 new commits to master: http://git.io/oL-9qQ
<GitHub37> opal/master af2ff40 Elia Schito: Autoclone gh-pages repo when building docs
GitHub37 has left #opal [#opal]
dimaursu16 has quit [Ping timeout: 260 seconds]
travis-ci has joined #opal
<travis-ci> [travis-ci] Build details : http://travis-ci.org/opal/opal/builds/33019847
<travis-ci> [travis-ci] opal/opal#1920 (master - d0c745f : Elia Schito): The build passed.
travis-ci has left #opal [#opal]
<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`> _.p { Lissio::Component::Markdown.render(@content) }
<meh`> _.p "blabla" -> escape
<meh`> _.p { "blabla" } -> no escape
<fkchang> how about escaping into _ << ?
<meh`> that shouldn't happen
<meh`> are you sure it's happening?
<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