6c3cb21dac906c773a548204eb66b40684241723
[myslice.git] / plugins / querycode / querycode.py
1 from unfold.plugin import Plugin
2
3 class QueryCode (Plugin):
4
5     def __init__ (self, query, **settings):
6         Plugin.__init__ (self, **settings)
7         self.query=query
8         # our javascript requires the details of the manifold server
9         self.page.expose_js_manifold_config()
10
11     def template_file (self):
12         return "querycode.html"
13
14     def requirements (self):
15         return { 
16             'js_files' : [ "js/querycode.js", 
17                            "js/manifold.js", "js/manifold-query.js",
18                            "js/spin.presets.js", "js/spin.min.js", "js/jquery.spin.js", 
19                            
20 #        Plugins::add_js('/QueryCode/beautyofcode/scripts/shCore.js');
21 #        Plugins::add_js('/QueryCode/beautyofcode/scripts/shBrushPython.js');
22 #        Plugins::add_js('/QueryCode/beautyofcode/scripts/shBrushRuby.js');
23 #        Plugins::add_js('/QueryCode/beautyofcode/scripts/shAutoloader.js');
24                            ] ,
25 # thierry: see this file for details of why we turn this off for now            
26              'css_files': [
27 ###                "css/querycode.css" ,
28 #        Plugins::add_css('/QueryCode/beautyofcode/styles/shCore.css');
29 #        Plugins::add_css('/QueryCode/beautyofcode/styles/shCoreDefault.css');
30 #        Plugins::add_css('/QueryCode/beautyofcode/styles/shThemeDefault.css');
31                 ],
32             }
33
34     def json_settings_list (self): return ['plugin_uuid','query_uuid']
35         
36     # because we have a link to a query it looks like we need a spin, let's make this right
37     def start_with_spin (self): return False