]> git.evergreen-ils.org Git - working/Evergreen.git/blob - stylesheets/evergreen_docbook_files/docbook-xsl-1.75.2/slides/browser/xbLibrary.js
Add stylesheets for our evergreen docbook site.
[working/Evergreen.git] / stylesheets / evergreen_docbook_files / docbook-xsl-1.75.2 / slides / browser / xbLibrary.js
1 /*\r
2  * xbLibrary.js\r
3  * $Revision: 1.3 $ $Date: 2003/03/17 03:44:20 $\r
4  */\r
5 \r
6 /* ***** BEGIN LICENSE BLOCK *****\r
7  * Version: MPL 1.1/GPL 2.0/LGPL 2.1\r
8  *\r
9  * The contents of this file are subject to the Mozilla Public License Version\r
10  * 1.1 (the "License"); you may not use this file except in compliance with\r
11  * the License. You may obtain a copy of the License at\r
12  * http://www.mozilla.org/MPL/\r
13  *\r
14  * Software distributed under the License is distributed on an "AS IS" basis,\r
15  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\r
16  * for the specific language governing rights and limitations under the\r
17  * License.\r
18  *\r
19  * The Original Code is Bob Clary code.\r
20  *\r
21  * The Initial Developer of the Original Code is\r
22  * Bob Clary.\r
23  * Portions created by the Initial Developer are Copyright (C) 2000\r
24  * the Initial Developer. All Rights Reserved.\r
25  *\r
26  * Contributor(s): Bob Clary <bc@bclary.com>\r
27  *\r
28  * ***** END LICENSE BLOCK ***** */\r
29 \r
30 if (!document.getElementById || navigator.userAgent.indexOf('Opera') != -1)\r
31 {\r
32   // assign error handler for downlevel browsers\r
33   // Note until Opera improves it's overall support\r
34   // for JavaScript and the DOM, it must be considered downlevel\r
35 \r
36   window.onerror = defaultOnError;\r
37   \r
38   function defaultOnError(msg, url, line)\r
39   {\r
40     // handle bug in NS6.1, N6.2\r
41     // where an Event is passed to error handlers\r
42     if (typeof(msg) != 'string')\r
43     {\r
44         msg = 'unknown error';\r
45     }\r
46     if (typeof(url) != 'string')\r
47     {\r
48         url = document.location;\r
49     }\r
50 \r
51     alert('An error has occurred at ' + url + ', line ' + line + ': ' + msg);\r
52   }\r
53 }\r
54 \r
55 function xbLibrary(path)\r
56 {\r
57   if (path.charAt(path.length-1) == '/')\r
58   {\r
59     path = path.substr(0, path.length-1)\r
60   }\r
61   this.path = path;\r
62 }\r
63 \r
64 // dynamically loaded scripts\r
65 //\r
66 // it is an error to reference anything from the dynamically loaded file inside the\r
67 // same script block.  This means that a file can not check its dependencies and\r
68 // load the files for it's own use.  someone else must do this.  \r
69   \r
70 xbLibrary.prototype.loadScript = \r
71 function (scriptName)\r
72 {\r
73   document.write('<script language="javascript" src="' + this.path + '/' + scriptName + '"><\/script>');\r
74 };\r
75 \r
76 // default xbLibrary\r
77 \r
78 xblibrary = new xbLibrary('./');\r
79 \r
80 \r