6e328012dc1a4a4ca291cc628435617d28cb0671
[myslice.git] / plugins / univbris / __init__.py
1 from __future__ import print_function
2
3 from unfold.plugin import Plugin
4
5 class Univbris(Plugin):
6     
7     def __init__ (self, query=None, **settings):
8         Plugin.__init__ (self, **settings)
9         self.query=query
10         self.query_uuid = query.query_uuid if query else None
11         print("called univbris plugin")
12
13     def template_file (self):
14         try:
15             return "univbris_welcome.html"
16         except Exception:
17             print("error template")
18
19     def requirements (self):
20         reqs = {
21             'js_files' : [ "js/spin-presets.js", "js/spin.min.js", "js/jquery.spin.js",
22                            "js/manifold.js", "js/manifold-query.js",
23                            "js/unfold-helper.js",
24                            'js/univbris.js',
25             ],
26             'css_files': [
27                 'css/univbris.css',
28             ]
29         }
30         return reqs
31
32     def json_settings_list (self):
33         # query_uuid will pass self.query results to the javascript
34         # and will be available as "record" in :
35         # on_new_record: function(record)
36         return ['plugin_uuid', 'domid', 'query_uuid', 'init_key', ]
37
38     def export_json_settings (self):
39         return True