How to use a jquery plugin ? (papa parser)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: How to use a jquery plugin ? (papa parser)

Herby Vojčík


Vicnet wrote:

> That's OK now.
>
> Thank you for your hep.
>
> I had multiple errors:
> - in my local papaparse.amd.json, I declare only 'papaparse' : '.'
> instead of 'papaparse' : 'papaparse'
> (there is only one js file papaparse(.min).js in papaparse dir)
> - I declare imports : { 'papaparse' } instead of { 'Papa' -> 'papaparse' }
> I saw that this is transformed in a require statement
> require(['papaparse], function(Papa) {...
>
> I suppose that Papa was available (in Workspace too) on linux because
> the papparse js file was just loaded but not injected in my package.
> With only this declaration imports :{ 'papa' -> 'papaparse' }, without
> amd correction, 'papa' variable was nil inside my package classses.

You should definitely use 'papa', not 'Papa'. Import variables are meant
as "local variables" of the package, so lowercase (uppercase was not
envisioned, so not supported, even if that might work atm). Using
uppercase, you:
1) make the access slower (Uppercase variables must be treated specially)
2) can shadow it with smalltalk class named Papa
3) can shadow an error in the loading mechanism, because you may as well
use plain JS global Papa.

> On linux, library was loaded and global function executed but not on
> windows ?
>
> Now, it is ok in two systems.
> Thanks,
>
> a+
> Vicnet
>
> Le lundi 4 mai 2015 20:32:53 UTC+2, Herby a écrit :
>
>     And if course, use same solution on all platforms.
>
>     Dňa 4. mája 2015 18:46:45 CEST používateľ Vicnet <[hidden email]
>     <javascript:>> napísal:
>
>         Thanks for your help.
>
>         I add "shim" : { "papaparse": { "exports": "Papa" } } in
>         papaparse.amd.json
>         and do a grunt devel.
>
>         config.js is filled with these informations and the.js also
>         contains the same values.
>
>         But if I enter Papa in Workspace and Ctrl-p, I get nil.
>
>         Remark: I am not using shim on linux and it is OK. I see the pb
>         only on windows.
>         Remark2: if I enter a random string and do Ctrl-P , nil is
>         displayed and also a error window. With Papa, only nil is
>         displayed, no error window.
>         A init pb ?
>
>         a+
>         Vincent
>
> --
> You received this message because you are subscribed to the Google
> Groups "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [hidden email]
> <mailto:[hidden email]>.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to use a jquery plugin ? (papa parser)

Vicnet-2
In reply to this post by Hannes Hirzel


Le mardi 5 mai 2015 22:29:40 UTC+2, Hannes a écrit :
> - I declare imports : { 'papaparse' } instead of { 'Papa' -> 'papaparse' }
> I saw that this is transformed in a require statement
>    require(['papaparse], function(Papa) {...
Which place are you refering to?

Inside the generated javascript src/Benevoles.js.
(to understand, I make a diff before and after transforming import as array to a set) 
 
> On linux, library was loaded and global function executed but not on
> windows ?
I wonder why the difference?

me too :-)

a+
Vicnet

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to use a jquery plugin ? (papa parser)

linlin269
This post was updated on .
In reply to this post by Vicnet-2
Reply | Threaded
Open this post in threaded view
|

Re: How to use a jquery plugin ? (papa parser)

summermobile
This post was updated on .
In reply to this post by Vicnet-2
You must shim the dependency. It is easy, you oppomobilephone just add one more option beyond paths to your config call.
Reply | Threaded
Open this post in threaded view
|

Re: How to use a jquery plugin ? (papa parser)

summermobile
In reply to this post by Vicnet-2
As said, I have add it with grunt, create amd file, declare in imports string of my package. www.oppomobilephone.com
Reply | Threaded
Open this post in threaded view
|

Re: How to use a jquery plugin ? (papa parser)

summermobile
This post was updated on .
In reply to this post by Vicnet-2
 I am not using shim on linux and it is OK. I see buy buy meizu mx4 pro the pb only on windows.
Reply | Threaded
Open this post in threaded view
|

Re: How to use a jquery plugin ? (papa parser)

summermobile
This post was updated on .
In reply to this post by Vicnet-2
With only this declaration imports :without amd correction,oppo mobile papa variable was nil inside my package classses.
On linux.
Reply | Threaded
Open this post in threaded view
|

Re: How to use a jquery plugin ? (papa parser)

summermobile
This post was updated on .
In reply to this post by Vicnet-2
I have download one js file cheap oppo phone and put it in lib dir into my amber project.
12