Subversion Repositories Sites.tela-botanica.org

Rev

Rev 609 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
420 florian 1
/**
2
 * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
3
 *
4
 * @author Moxiecode
5
 * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
6
 */
7
 
8
/* Import plugin specific language pack */
9
tinyMCE.importPluginLanguagePack('iespell');
10
 
11
var TinyMCE_IESpellPlugin = {
12
	getInfo : function() {
13
		return {
14
			longname : 'IESpell (MSIE Only)',
15
			author : 'Moxiecode Systems AB',
16
			authorurl : 'http://tinymce.moxiecode.com',
17
			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',
18
			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
19
		};
20
	},
21
 
22
	/**
23
	 * Returns the HTML contents of the iespell control.
24
	 */
25
	getControlHTML : function(cn) {
26
		// Is it the iespell control and is the brower MSIE.
27
		if (cn == "iespell" && (tinyMCE.isMSIE && !tinyMCE.isOpera))
28
			return tinyMCE.getButtonHTML(cn, 'lang_iespell_desc', '{$pluginurl}/images/iespell.gif', 'mceIESpell');
29
 
30
		return "";
31
	},
32
 
33
	/**
34
	 * Executes the mceIESpell command.
35
	 */
36
	execCommand : function(editor_id, element, command, user_interface, value) {
37
		// Handle ieSpellCommand
38
		if (command == "mceIESpell") {
39
			try {
40
				var ieSpell = new ActiveXObject("ieSpell.ieSpellExtension");
41
				ieSpell.CheckDocumentNode(tinyMCE.getInstanceById(editor_id).contentDocument.documentElement);
42
			} catch (e) {
43
				if (e.number == -2146827859) {
44
					if (confirm(tinyMCE.getLang("lang_iespell_download", "", true)))
45
						window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');
46
				} else
47
					alert("Error Loading ieSpell: Exception " + e.number);
48
			}
49
 
50
			return true;
51
		}
52
 
53
		// Pass to next handler in chain
54
		return false;
55
	}
56
};
57
 
58
tinyMCE.addPlugin("iespell", TinyMCE_IESpellPlugin);