6e09733735741ecc1ee354ddc3adc6c3f4ccdc34
[samba.git] / swat / apps / swat / source / class / swat / module / documentation / Documentation.js
1 /*
2  * Copyright:
3  *   (C) 2006 by Derrell Lipman
4  *       All rights reserved
5  *
6  * License:
7  *   LGPL 2.1: http://creativecommons.org/licenses/LGPL/2.1/
8  */
9
10 /**
11  * Swat statistics class
12  */
13 qx.OO.defineClass("swat.module.documentation.Documentation",
14                   swat.module.AbstractModule,
15 function()
16 {
17   swat.module.AbstractModule.call(this);
18 });
19
20
21 /**
22  * Load the documentation data
23  *
24  * This function is called the first time a module is actually selected to
25  * appear.  Creation of the module's GUI has been deferred until it was
26  * actually needed (now), so we need to create it.
27  *
28  * @param module {Object} @see AbstractModule
29  */
30 qx.Proto.initialAppear = function(module)
31 {
32   qx.manager.object.AliasManager.getInstance().add("api", "./resource/image");
33
34   // Include CSS file.
35   // (This is the hard way; I can't get qx.dom.StyleSheet.includeFile to load)
36   var el = document.createElement("link");
37   el.type = "text/css";
38   el.rel = "stylesheet";
39   el.href = "./resource/css/apiviewer.css";
40   var head = document.getElementsByTagName("head")[0];
41   head.appendChild(el);
42
43   // avoid redundant naming by api viewer
44   qx.Settings.setCustomOfClass("apiviewer.Viewer", "title", ""); 
45
46   var viewer = new api.Viewer();
47   module.canvas.add(viewer);
48   viewer.load("script/data.js");
49 };
50
51
52 /**
53  * Singleton Instance Getter
54  */
55 qx.Class.getInstance = qx.util.Return.returnInstance;