~ubuntu-branches/ubuntu/oneiric/moin/oneiric-security

« back to all changes in this revision

Viewing changes to wiki/htdocs/applets/FCKeditor/editor/_source/fckscriptloader.js

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-03-30 12:55:34 UTC
  • mfrom: (0.1.17 sid)
  • Revision ID: james.westby@ubuntu.com-20100330125534-4c2ufc1rok24447l
Tags: 1.9.2-2ubuntu1
* Merge from Debian testing (LP: #521834). Based on work by Stefan Ebner.
  Remaining changes:
 - Remove python-xml from Suggests field, the package isn't anymore in
   sys.path.
 - Demote fckeditor from Recommends to Suggests; the code was previously
   embedded in moin, but it was also disabled, so there's no reason for us
   to pull this in by default currently. Note: This isn't necessary anymore
   but needs a MIR for fckeditor, so postpone dropping this change until
   lucid+1
* debian/rules:
  - Replace hardcoded python2.5 with python* and hardcore python2.6 for ln
* debian/control.in: drop versioned depends on cdbs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
 
 * Copyright (C) 2003-2009 Frederico Caldeira Knabben
4
 
 *
5
 
 * == BEGIN LICENSE ==
6
 
 *
7
 
 * Licensed under the terms of any of the following licenses at your
8
 
 * choice:
9
 
 *
10
 
 *  - GNU General Public License Version 2 or later (the "GPL")
11
 
 *    http://www.gnu.org/licenses/gpl.html
12
 
 *
13
 
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
 
 *    http://www.gnu.org/licenses/lgpl.html
15
 
 *
16
 
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
17
 
 *    http://www.mozilla.org/MPL/MPL-1.1.html
18
 
 *
19
 
 * == END LICENSE ==
20
 
 *
21
 
 * This is a utility object which can be used to load specific components of
22
 
 * FCKeditor, including all dependencies.
23
 
 */
24
 
 
25
 
var FCK_GENERIC = 1 ;
26
 
var FCK_GENERIC_SPECIFIC = 2 ;
27
 
var FCK_SPECIFIC = 3 ;
28
 
 
29
 
var FCKScriptLoader = new Object() ;
30
 
FCKScriptLoader.FCKeditorPath = '/fckeditor/' ;
31
 
 
32
 
FCKScriptLoader._Scripts = new Object() ;
33
 
FCKScriptLoader._LoadedScripts = new Object() ;
34
 
 
35
 
FCKScriptLoader._IsIE = (/msie/).test( navigator.userAgent.toLowerCase() ) ;
36
 
 
37
 
FCKScriptLoader.Load = function( scriptName )
38
 
{
39
 
        // Check if the script has already been loaded.
40
 
        if ( scriptName in FCKScriptLoader._LoadedScripts )
41
 
                return ;
42
 
 
43
 
        FCKScriptLoader._LoadedScripts[ scriptName ] = true ;
44
 
 
45
 
        var oScriptInfo = this._Scripts[ scriptName ] ;
46
 
 
47
 
        if ( !oScriptInfo )
48
 
        {
49
 
                alert( 'FCKScriptLoader: The script "' + scriptName + '" could not be loaded' ) ;
50
 
                return ;
51
 
        }
52
 
 
53
 
        for ( var i = 0 ; i < oScriptInfo.Dependency.length ; i++ )
54
 
        {
55
 
                this.Load( oScriptInfo.Dependency[i] ) ;
56
 
        }
57
 
 
58
 
        var sBaseScriptName = oScriptInfo.BasePath + scriptName.toLowerCase() ;
59
 
 
60
 
        if ( oScriptInfo.Compatibility == FCK_GENERIC || oScriptInfo.Compatibility == FCK_GENERIC_SPECIFIC )
61
 
                this._LoadScript( sBaseScriptName + '.js' ) ;
62
 
 
63
 
        if ( oScriptInfo.Compatibility == FCK_SPECIFIC || oScriptInfo.Compatibility == FCK_GENERIC_SPECIFIC )
64
 
        {
65
 
                if ( this._IsIE )
66
 
                        this._LoadScript( sBaseScriptName + '_ie.js' ) ;
67
 
                else
68
 
                        this._LoadScript( sBaseScriptName + '_gecko.js' ) ;
69
 
        }
70
 
}
71
 
 
72
 
FCKScriptLoader._LoadScript = function( scriptPathFromSource )
73
 
{
74
 
        document.write( '<script type="text/javascript" src="' + this.FCKeditorPath + 'editor/_source/' + scriptPathFromSource + '"><\/script>' ) ;
75
 
}
76
 
 
77
 
FCKScriptLoader.AddScript = function( scriptName, scriptBasePath, dependency, compatibility )
78
 
{
79
 
        this._Scripts[ scriptName ] =
80
 
        {
81
 
                BasePath : scriptBasePath || '',
82
 
                Dependency : dependency || [],
83
 
                Compatibility : compatibility || FCK_GENERIC
84
 
        } ;
85
 
}
86
 
 
87
 
/*
88
 
 * ####################################
89
 
 * ### Scripts Definition List
90
 
 */
91
 
 
92
 
FCKScriptLoader.AddScript( 'FCKConstants' ) ;
93
 
FCKScriptLoader.AddScript( 'FCKJSCoreExtensions' ) ;
94
 
 
95
 
FCKScriptLoader.AddScript( 'FCK_Xhtml10Transitional', '../dtd/' ) ;
96
 
 
97
 
FCKScriptLoader.AddScript( 'FCKDataProcessor'   , 'classes/'    , ['FCKConfig','FCKBrowserInfo','FCKRegexLib','FCKXHtml'] ) ;
98
 
FCKScriptLoader.AddScript( 'FCKDocumentFragment', 'classes/'    , ['FCKDomTools'], FCK_SPECIFIC ) ;
99
 
FCKScriptLoader.AddScript( 'FCKDomRange'                , 'classes/'    , ['FCKBrowserInfo','FCKJSCoreExtensions','FCKW3CRange','FCKElementPath','FCKDomTools','FCKTools','FCKDocumentFragment'], FCK_GENERIC_SPECIFIC ) ;
100
 
FCKScriptLoader.AddScript( 'FCKDomRangeIterator', 'classes/'    , ['FCKDomRange','FCKListsLib'], FCK_GENERIC ) ;
101
 
FCKScriptLoader.AddScript( 'FCKElementPath'             , 'classes/'    , ['FCKListsLib'], FCK_GENERIC ) ;
102
 
FCKScriptLoader.AddScript( 'FCKEnterKey'                , 'classes/'    , ['FCKDomRange','FCKDomTools','FCKTools','FCKKeystrokeHandler','FCKListHandler'], FCK_GENERIC ) ;
103
 
FCKScriptLoader.AddScript( 'FCKPanel'                   , 'classes/'    , ['FCKBrowserInfo','FCKConfig','FCKTools'], FCK_GENERIC ) ;
104
 
FCKScriptLoader.AddScript( 'FCKImagePreloader'  , 'classes/' ) ;
105
 
FCKScriptLoader.AddScript( 'FCKKeystrokeHandler', 'classes/'    , ['FCKConstants','FCKBrowserInfo','FCKTools'], FCK_GENERIC ) ;
106
 
FCKScriptLoader.AddScript( 'FCKStyle'                   , 'classes/'    , ['FCKConstants','FCKDomRange','FCKDomRangeIterator','FCKDomTools','FCKListsLib','FCK_Xhtml10Transitional'], FCK_GENERIC ) ;
107
 
FCKScriptLoader.AddScript( 'FCKW3CRange'                , 'classes/'    , ['FCKDomTools','FCKTools','FCKDocumentFragment'], FCK_GENERIC ) ;
108
 
 
109
 
FCKScriptLoader.AddScript( 'FCKBrowserInfo'             , 'internals/'  , ['FCKJSCoreExtensions'] ) ;
110
 
FCKScriptLoader.AddScript( 'FCKCodeFormatter'   , 'internals/' ) ;
111
 
FCKScriptLoader.AddScript( 'FCKConfig'                  , 'internals/'  , ['FCKBrowserInfo','FCKConstants'] ) ;
112
 
FCKScriptLoader.AddScript( 'FCKDebug'                   , 'internals/'  , ['FCKConfig'] ) ;
113
 
FCKScriptLoader.AddScript( 'FCKDomTools'                , 'internals/'  , ['FCKJSCoreExtensions','FCKBrowserInfo','FCKTools','FCKDomRange'], FCK_GENERIC ) ;
114
 
FCKScriptLoader.AddScript( 'FCKListsLib'                , 'internals/' ) ;
115
 
FCKScriptLoader.AddScript( 'FCKListHandler'             , 'internals/'  , ['FCKConfig', 'FCKDocumentFragment', 'FCKJSCoreExtensions','FCKDomTools'], FCK_GENERIC ) ;
116
 
FCKScriptLoader.AddScript( 'FCKRegexLib'                , 'internals/' ) ;
117
 
FCKScriptLoader.AddScript( 'FCKStyles'                  , 'internals/'  , ['FCKConfig', 'FCKDocumentFragment', 'FCKDomRange','FCKDomTools','FCKElementPath','FCKTools'], FCK_GENERIC ) ;
118
 
FCKScriptLoader.AddScript( 'FCKTools'                   , 'internals/'  , ['FCKJSCoreExtensions','FCKBrowserInfo'], FCK_GENERIC_SPECIFIC ) ;
119
 
FCKScriptLoader.AddScript( 'FCKXHtml'                   , 'internals/'  , ['FCKBrowserInfo','FCKCodeFormatter','FCKConfig','FCKDomTools','FCKListsLib','FCKRegexLib','FCKTools','FCKXHtmlEntities'], FCK_GENERIC_SPECIFIC ) ;
120
 
FCKScriptLoader.AddScript( 'FCKXHtmlEntities'   , 'internals/'  , ['FCKConfig'] ) ;
121
 
 
122
 
// ####################################