javascriptpluginsjquery-pluginszepto

Write a simple zepto plugin


I'm writing a couple of simple zepto plugins that I would like to use in my application:

https://github.com/Pherserk/symfony2_demo_article_feed/tree/partial/feature-user-creation/src/AppBundle/Resources/public/js/JsonApiAjax.js

https://github.com/Pherserk/symfony2_demo_article_feed/tree/partial/feature-user-creation/src/AppBundle/Resources/public/js/JwtAjax.js

Including the zepto library and the two files above I get the error TypeError: $.JwtAjax is not a function

Here is the code of the page calling it:

https://github.com/Pherserk/symfony2_demo_article_feed/blob/partial/feature-user-creation/src/AppBundle/Resources/views/Web/Main/writeArticle.html.twig

Any help would be appreciated.


Solution

  • I was missing this:

    $.JwtToken = $.fn.JwtToken;

    That is declaring the function a the level of the $ namespace as alias of the function defintion at $.fn namespace.