      1 /*
      2     Copyright 2008-2011,
      3         Matthias Ehmann,
      4         Michael Gerhaeuser,
      5         Carsten Miller,
      6         Bianca Valentin,
      7         Alfred Wassermann,
      8         Peter Wilfahrt
      9
     10     This file is part of JSXGraph.
     11
     12     JSXGraph is free software: you can redistribute it and/or modify
     13     it under the terms of the GNU Lesser General Public License as published by
     14     the Free Software Foundation, either version 3 of the License, or
     15     (at your option) any later version.
     16
     17     JSXGraph is distributed in the hope that it will be useful,
     18     but WITHOUT ANY WARRANTY; without even the implied warranty of
     19     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     20     GNU Lesser General Public License for more details.
     21
     22     You should have received a copy of the GNU Lesser General Public License
     23     along with JSXGraph.  If not, see <http://www.gnu.org/licenses/>.
     24
     25 */
     26
     27 /**
     28  * JSXGraph namespace. Holds all classes, objects, functions and variables belonging to JSXGraph
     29  * to reduce the risc of interfering with other JavaScript code.
     30  * @namespace
     31  */
     32 var JXG = {};
     33
     34 (function(){ // Hide the initialization in an anonymous function
     35     var i, s, n, arr;
     36
     37     // Minified-Modus: ja, nein
     38     JXG.useMinify = false;
     39
     40     JXG.countDrawings = 0;
     41     JXG.countTime = 0;
     42     JXG.require = function(libraryName) {
     43         document.write('<script type="text/javascript" src="' + libraryName + '"><\/script>');
     44     };
     45 /*
     46     Not longer used: IntergeoReader, GeonextReader, Angle, Intersection
     47 */
     48     if (!JXG.useMinify) {
     49         JXG.baseFiles ='JXG,Math,MathNumerics,MathStatistics,MathSymbolic,MathGeometry,MathPoly,Complex,AbstractRenderer,FileReader,GeonextParser,Board,Options,jsxgraph,GeometryElement,Coords,Point,Line,Group,Circle,Conic,Polygon,Curve,Arc,Sector,Composition,Text,Image,Slider,Chart,Transformation,Turtle,RGBColor,Wrappers,Ticks,Util,Pstricks,Server,DataSource,JessieCode,Dump';
     50     } else {
     51         JXG.baseFiles = 'jxg';
     52     }
     53     JXG.rendererFiles = [];
     54     if (JXG.useMinify) {
     55         JXG.rendererFiles['svg'] = 'SVGRendererMinify';
     56         JXG.rendererFiles['vml'] = 'VMLRendererMinify';
     57     } else {
     58         JXG.rendererFiles['svg'] = 'SVGRenderer';
     59         JXG.rendererFiles['vml'] = 'VMLRenderer';
     60     }
     61     JXG.rendererFiles['canvas'] = 'CanvasRenderer';
     62     //JXG.rendererFiles['silverlight'] = 'Silverlight,createSilverlight,SilverlightRenderer';
     63     JXG.requirePath = '';
     64
     65     for (i=0;i<document.getElementsByTagName("script").length;i++) {
     66         s = document.getElementsByTagName("script")[i];
     67         if (s.src && s.src.match(/loadjsxgraph\.js(\?.*)?$/)) {
     68             JXG.requirePath = s.src.replace(/loadjsxgraph\.js(\?.*)?$/,'');
     69             arr = JXG.baseFiles.split(',');
     70             for (n=0;n<arr.length;n++) {
     71                 (function(include) { JXG.require(JXG.requirePath+include+'.js');})(arr[n]);
     72             }
     73         }
     74     }
     75
     76     JXG.baseFiles = null;
     77     JXG.serverBase = JXG.requirePath + 'server/';
     78 })();
     79