Wiki
Clone wikiCATI / Extending CATI.md
Search Modules
If you want to extend the search interface and functionality, you should add a new js file containing the extension class in:
#!python cati/browser/static/js/views/search_modules/
Such class should have, at least, a constructor and a loadTweets(data) message. All the modules shouls have this method, since they will be automatically called by it in the future.
#!javascript class DailyFrequencyModule extends SearchModule{ constructor(containerSelector, client) { super(containerSelector); // your required initialization code } loadTweets(data){ // your code making requests to the server and manipulating the DOM } }
At this stage of the project, it is also required that you add the reference to this file in the index file located at:
#!python cati/browser/templates/index.html
Then, instantiate this module and call the loadTweets method from the following file:
#!python cati/browser/static/js/views/tweets.js
This last step won't be necessary for the future, but right now you need to do it. An example of how to instantiate the class and call the proper method can be found in the same file:
#!javascript loadTweetsTimeline: function (data) { new DailyFrequencyModule().loadTweets(data); }
Updated