1 | /* |
---|
2 | * FCKeditor - The text editor for internet |
---|
3 | * Copyright (C) 2003-2006 Frederico Caldeira Knabben |
---|
4 | * |
---|
5 | * Licensed under the terms of the GNU Lesser General Public License: |
---|
6 | * http://www.opensource.org/licenses/lgpl-license.php |
---|
7 | * |
---|
8 | * For further information visit: |
---|
9 | * http://www.fckeditor.net/ |
---|
10 | * |
---|
11 | * "Support Open Source software. What about a donation today?" |
---|
12 | * |
---|
13 | * File Name: fckplugin.js |
---|
14 | * FCKPlugin Class: Represents a single plugin. |
---|
15 | * |
---|
16 | * File Authors: |
---|
17 | * Frederico Caldeira Knabben (fredck@fckeditor.net) |
---|
18 | */ |
---|
19 | |
---|
20 | var FCKPlugin = function( name, availableLangs, basePath ) |
---|
21 | { |
---|
22 | this.Name = name ; |
---|
23 | this.BasePath = basePath ? basePath : FCKConfig.PluginsPath ; |
---|
24 | this.Path = this.BasePath + name + '/' ; |
---|
25 | |
---|
26 | if ( !availableLangs || availableLangs.length == 0 ) |
---|
27 | this.AvailableLangs = new Array() ; |
---|
28 | else |
---|
29 | this.AvailableLangs = availableLangs.split(',') ; |
---|
30 | } |
---|
31 | |
---|
32 | FCKPlugin.prototype.Load = function() |
---|
33 | { |
---|
34 | // Load the language file, if defined. |
---|
35 | if ( this.AvailableLangs.length > 0 ) |
---|
36 | { |
---|
37 | var sLang ; |
---|
38 | |
---|
39 | // Check if the plugin has the language file for the active language. |
---|
40 | if ( this.AvailableLangs.indexOf( FCKLanguageManager.ActiveLanguage.Code ) >= 0 ) |
---|
41 | sLang = FCKLanguageManager.ActiveLanguage.Code ; |
---|
42 | else |
---|
43 | // Load the default language file (first one) if the current one is not available. |
---|
44 | sLang = this.AvailableLangs[0] ; |
---|
45 | |
---|
46 | // Add the main plugin script. |
---|
47 | LoadScript( this.Path + 'lang/' + sLang + '.js' ) ; |
---|
48 | } |
---|
49 | |
---|
50 | // Add the main plugin script. |
---|
51 | LoadScript( this.Path + 'fckplugin.js' ) ; |
---|
52 | } |
---|