Search code examples
apostrophe-cms

I have a problem trying to integrate Paella Player with Apostrophe-CMS


Trying to implement Paella Player in Apostrophe, I've found an error applying the assets to my project.

The Javascript file that fails is jquery.js.

https://github.com/polimediaupv/paella/tree/develop/javascript

And this is my error.

Uncaught TypeError: $.cookie is not a function
    at always.js:140
    at Function.<anonymous> (jquery.js:4)
    at Function.each (jquery.js:2)
    at g (jquery.js:4)
    at wb (jquery.js:4)
    at Function.ajax (jquery.js:4)
    at Function.n.(anonymous function) [as post] (http://localhost:3000/modules/paella-player-widgets/js/jquery.js:4:12281)
    at Object.self.getTemplates (user.js:94)
    at getTemplates (user.js:6)
    at async.js:718

And finally that's the code for pushing the js assets.

module.exports = {
  extend: 'apostrophe-widgets',
  label: 'Paella player',

  construct: function(self, options) {

    self.pushAsset('script', 'swfobject');
    self.pushAsset('script', 'traceur-compiler');
    self.pushAsset('script', 'base');
    self.pushAsset('script', 'jquery');
    self.pushAsset('script', 'lunr.min');
    self.pushAsset('script', 'require');
    self.pushAsset('script', 'paella_player');
  }
};

Solution

  • I find solution, I didn't have to apply the Paella's JQuery file because it's enough with the JQuery file that Apostrophe provides to us.