elia has quit [Quit: Computer has gone to sleep.]
ryanstout has quit [Quit: ryanstout]
e_dub has quit [Quit: It's a hard knock life]
ryanstout has joined #opal
fkchang has quit [Ping timeout: 240 seconds]
ryanstout has quit [Quit: ryanstout]
Steve445 has joined #opal
ryanstout has joined #opal
ani__ has joined #opal
<
ani__>
I am looking for help on how to call a different javascript library.
<
ani__>
I have a javascript library called tweenlight
<
ani__>
I want to call the following javsacript statements as ruby
<
ani__>
TweenLite.to("#horizontal-bar", 2, {width:100});
<
ani__>
Could someone help me on how to do this.
<
ani__>
Thanks for your help.
Steve445 has quit [Read error: Connection reset by peer]
Steve445 has joined #opal
ani__ has quit [Read error: Connection reset by peer]
ani__ has joined #opal
ani__ has quit [Read error: Connection reset by peer]
ani__ has joined #opal
ani__ is now known as AnandAlaghu
AnandAlaghu has quit [Quit: AnandAlaghu]
AnandAlaghu has joined #opal
<
ryanstout>
AnandAlaghu: you still around?
<
AnandAlaghu>
Hi Ryan
<
AnandAlaghu>
I changed my name to AnandAlaghu
<
ryanstout>
the easiest way to figure out how to call things is to do: Opal.compile("TweenLite.to(\"#horizontal-bar\", 2, {width:100});")
<
ryanstout>
it will spit out the code it would use
<
AnandAlaghu>
ok, let me try it
<
ryanstout>
I'm not sure on the constant, but method calls are usually just prefixed with a $
<
ryanstout>
I think ruby hashes have a special initialization syntax also
<
AnandAlaghu>
OK, so got */\n(function($opal) {\n var self = $opal.top, $scope = $opal, nil = $opal.nil, $breaker = $opal.breaker, $slice = $opal.slice, $hash2 = $opal.hash2;\n $opal.add_stubs(['$to']);\n return $scope.TweenLite.$to(\"#horizontal-bar\", 2, $hash2([\"width\"], {\"width\": 100}))\n})(Opal);\n"
<
ryanstout>
yea, its a little confusing
<
AnandAlaghu>
HI Ryan, a basic question.
<
ryanstout>
I'm not quite sure why Opal is passed in instead of being referenced directly
<
ryanstout>
but both $scope and $opal are Opal
<
AnandAlaghu>
Other than the query integration, if I were to try and call functions in javasscript, would I need toy use opal.compile()?
<
AnandAlaghu>
other than jquery integration
<
ryanstout>
no, you can just write JS that calls into the ruby
<
ryanstout>
though I'm not 100% sure
<
ryanstout>
it probably needs more documenting
<
ryanstout>
I have some code in my projects that call ruby from JS without using the compiled output
<
AnandAlaghu>
hi Ryan, could you send me the url , if your project is on github and public(open source)
<
ryanstout>
the stuff calling ruby from JS isn't public yet
<
AnandAlaghu>
Since I am newbie, I am trying to limit my programming skills to rub, therefore the inclination to use opal.
<
AnandAlaghu>
No problem.
<
ryanstout>
most of the time, I end up calling JS from opal
<
ryanstout>
so I use query, but I just call it from opal
<
ryanstout>
using the back-tick notation
<
AnandAlaghu>
I figured some basic jquery.
<
AnandAlaghu>
I need to figure the back tick notation.
<
ryanstout>
its really simple
<
ryanstout>
`console.log(a);`
<
AnandAlaghu>
I will go through the documentation.
<
ryanstout>
for example
<
ryanstout>
basically anything in between ` and ` or %x{ .. } will run as JS
<
AnandAlaghu>
oh! so 'TweenLite.to(\"#horizontal-bar\", 2, {width:100});'
<
ryanstout>
and local variables in ruby are the same. Opal provides a self object to JS, which has all of the ruby methods
<
AnandAlaghu>
should work
<
AnandAlaghu>
let me try
<
ryanstout>
yea, make sure its the right kind of quote (the ones over the tab)
<
ryanstout>
also, you shouldn't need to escape quotes in it
<
AnandAlaghu>
`TweenLite.to("#horizontal-bar", 2, {width:100});`
<
AnandAlaghu>
tried this , did not work.
<
ryanstout>
does it work from the console?
<
ryanstout>
JS console
<
AnandAlaghu>
Let me try the plain javascript.
<
AnandAlaghu>
Give me a minute
AnandAlaghu has quit [Read error: Connection reset by peer]
AnandAlaghu has joined #opal
<
AnandAlaghu>
hi Ryan, thank you very much for your help
<
ryanstout>
no problem, did it work?
<
AnandAlaghu>
I am having trouble getting the vanilla javscript work
<
AnandAlaghu>
with tweenlite
Steve445 has quit [Quit: Steve445]
<
AnandAlaghu>
I need to get my head around that first
<
ryanstout>
are you coming from a flash background?
<
AnandAlaghu>
but your back tick notation is of great help
<
AnandAlaghu>
nope. I am just learning programming
<
ryanstout>
what are you using TweenLite for?
<
AnandAlaghu>
Just trying to stitch things together , and hoping to learn Ruby well.
<
ryanstout>
jquery has animations in it, fyi.
<
ryanstout>
might be easier to use than tweenlite
<
AnandAlaghu>
Few of the animations I want is impressive in TweenLight
meh`_ has quit [Ping timeout: 240 seconds]
<
AnandAlaghu>
I have started with jquery.
<
AnandAlaghu>
Probably will stick to it for some time.
<
ryanstout>
sounds good
<
AnandAlaghu>
That brings me to another questiom
<
AnandAlaghu>
I need to use .effect :fade_out, 'slow' on an elemnet
<
AnandAlaghu>
However, when I try passing a easing parameter it does not work.
<
AnandAlaghu>
Any ideas?
<
ryanstout>
some other people might know better than me, but try doing .to_n on the parameter
<
ryanstout>
(to native)
<
AnandAlaghu>
Thanks very much for your help
<
AnandAlaghu>
Have a great day.
<
ryanstout>
no problem, you too
AnandAlaghu has quit [Read error: Connection reset by peer]
AnandAlaghu has joined #opal
AnandAlaghu has quit [Read error: Connection reset by peer]
AnandAlaghu has joined #opal
AnandAlaghu has quit [Read error: Connection reset by peer]
AnandAlaghu has joined #opal
AnandAlaghu has quit [Read error: Connection reset by peer]
AnandAlaghu has joined #opal
dimaursu16 has quit [Ping timeout: 264 seconds]
dimaursu16 has joined #opal
e_dub has joined #opal
AnandAlaghu has quit [Quit: AnandAlaghu]
fkchang has joined #opal
ryanstout has quit [Quit: ryanstout]
fkchang has quit [Ping timeout: 264 seconds]
fntzr has joined #opal
elia has joined #opal
kludge` has quit [Ping timeout: 240 seconds]
kludge` has joined #opal
e_dub has quit [Ping timeout: 240 seconds]
e_dub has joined #opal
elia has quit [Quit: Computer has gone to sleep.]
meh` has joined #opal
elia has joined #opal
e_dub has quit [Quit: It's a hard knock life]
DrShoggoth has quit [Quit: Leaving]
DrShoggoth has joined #opal
fntzr has quit [Quit: Leaving]
GitHub128 has joined #opal
GitHub128 has left #opal [#opal]
<
GitHub128>
[opal-rails] benjamintanweihao opened pull request #22: Fix slightly misleading instructions. (master...patch-1)
http://git.io/V4UYHw
ryanstout has joined #opal
e_dub has joined #opal
elia has quit [Quit: Computer has gone to sleep.]
e_dub has quit [Quit: ZZZzzz…]
e_dub has joined #opal
fkchang has joined #opal
e_dub has quit [Quit: ZZZzzz…]
newlix has joined #opal
e_dub has joined #opal
korollev has joined #opal
korollev has quit [Remote host closed the connection]
bazhov has joined #opal
bazhov has quit [Remote host closed the connection]
DrShoggoth has quit [Quit: Leaving]
meh` has quit [Ping timeout: 240 seconds]
lintex has joined #opal
lintex has quit [Remote host closed the connection]
dragonkh has joined #opal
elia has joined #opal
didivi has joined #opal
[o__o] has left #opal [#opal]
[o__o] has joined #opal
didivi has quit [Remote host closed the connection]
[o__o] has left #opal [#opal]
[o__o] has joined #opal
newlix has quit [Quit: Page closed]
_whitelogger has joined #opal
antonishen has quit [*.net *.split]
Todd has quit [*.net *.split]
Todd has joined #opal
elia has quit [*.net *.split]
AndrzejK1zywda has quit [*.net *.split]
[spoiler] has quit [*.net *.split]
dragonkh has quit [*.net *.split]
dimaursu16 has quit [*.net *.split]
kludge` has quit [*.net *.split]
adambeynon has quit [*.net *.split]
lectrick_ has quit [*.net *.split]
siruf has quit [*.net *.split]
lacrosse_ has quit [*.net *.split]
antonishen has joined #opal
AndrzejK1zywda has joined #opal
kludge` has joined #opal
dimaursu16 has joined #opal
lacrosse_ has joined #opal
siruf has joined #opal
dragonkh has joined #opal
adambeynon has joined #opal
lectrick_ has joined #opal
[spoiler] has joined #opal
siruf has quit [Read error: Connection reset by peer]
e_dub has quit [Ping timeout: 240 seconds]
siruf has joined #opal
siruf has quit [Ping timeout: 265 seconds]
siruf has joined #opal
siruf has quit [Ping timeout: 245 seconds]
siruf has joined #opal
elia has joined #opal
siruf has quit [Read error: Connection reset by peer]
siruf has joined #opal
[spoiler] has quit [Read error: Connection reset by peer]
siruf has quit [Ping timeout: 246 seconds]
siruf has joined #opal
siruf has quit [Read error: Connection reset by peer]
siruf has joined #opal
siruf has quit [Ping timeout: 246 seconds]
siruf has joined #opal
elia has quit [Quit: Computer has gone to sleep.]
siruf has quit [Ping timeout: 245 seconds]
siruf has joined #opal
siruf has quit [Ping timeout: 246 seconds]
siruf has joined #opal
fkchang has quit [Ping timeout: 240 seconds]
siruf has quit [Read error: Connection reset by peer]
siruf has joined #opal
siruf has quit [Ping timeout: 246 seconds]
siruf has joined #opal
siruf has quit [Ping timeout: 246 seconds]
siruf has joined #opal
siruf has quit [Ping timeout: 245 seconds]
siruf has joined #opal
siruf has quit [Ping timeout: 246 seconds]
siruf has joined #opal
supermarin has joined #opal
siruf has quit [Ping timeout: 246 seconds]
siruf has joined #opal
ryanstout has quit [Ping timeout: 240 seconds]
siruf has quit [Read error: Connection reset by peer]
siruf has joined #opal
siruf has quit [Ping timeout: 245 seconds]
dragonkh has quit [Ping timeout: 240 seconds]
siruf has joined #opal
supermarin has quit [Remote host closed the connection]