Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

JavaScript Libraries (SugarCube)

Is there anyway to easily add a library like MooTools to work with Jquery as well?

Comments

  • Not unless the other library (MooTools, whatever, doesn't matter) includes a way to not stomp all over $ (much like jQuery itself can).  At the present time, SugarCube uses $ internally as an alias for jQuery, so changing $ to something else would break all the things.  I also cannot simply "fix" that, as many SugarCube users already use $ as jQuery, so that has to remain the default.  Beyond that, you'd have to open the story format itself (/sugarcube/header.html) and add it to the correct area without breaking anything else, which might be problematic for some.

    That said, let me put this on my TODO list.  I'll look into making this both possible and as pain free as is feasible.

    [EDIT]: Also note that some libraries simply cannot play nicely together (especially true if the one or more of the libraries extends the natives).  And by "play nicely" I do not mean simply work together, but also that the libraries do not compromise each others performance (e.g. Lib-A makes significant use of native N1, Lib-B extends N1 adding features to it but also making it much slower, Lib-A becomes much slower by proxy for no benefit to it).


    TL;DR: Currently?  No, probably not (easily anyway).  However, I'll look into it.
  • TheMadExile wrote:

    Not unless the other library (MooTools, whatever, doesn't matter) includes a way to not stomp all over $ (much like jQuery itself can).  At the present time, SugarCube uses $ internally as an alias for jQuery, so changing $ to something else would break all the things.  I also cannot simply "fix" that, as many SugarCube users already use $ as jQuery, so that has to remain the default.  Beyond that, you'd have to open the story format itself (/sugarcube/header.html) and add it to the correct area without breaking anything else, which might be problematic for some.

    That said, let me put this on my TODO list.  I'll look into making this both possible and as pain free as is feasible.

    [EDIT]: Also note that some libraries simply cannot play nicely together (especially true if the one or more of the libraries extends the natives).  And by "play nicely" I do not mean simply work together, but also that the libraries do not compromise each others performance (e.g. Lib-A makes significant use of native N1, Lib-B extends N1 adding features to it but also making it much slower, Lib-A becomes much slower by proxy for no benefit to it).


    TL;DR: Currently?  No, probably not (easily anyway).  However, I'll look into it.

    Thanks Exile, that's kind of what I figured. By the way, I'm totally digging the new CsS layout. Your a whiz so I don't know if you know, but for beginners like me, it's now a lot easier to read and modify.
Sign In or Register to comment.