/static/scripts/tiny_mce/plugins/iespell/editor_plugin_src.js

http://n23.googlecode.com/ · JavaScript · 51 lines · 35 code · 7 blank · 9 comment · 4 complexity · 1b6edd8a54b4fcb9f184510f27fe4a1a MD5 · raw file

  1. /**
  2. * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
  3. *
  4. * @author Moxiecode
  5. * @copyright Copyright Š 2004-2008, Moxiecode Systems AB, All rights reserved.
  6. */
  7. (function() {
  8. tinymce.create('tinymce.plugins.IESpell', {
  9. init : function(ed, url) {
  10. var t = this, sp;
  11. if (!tinymce.isIE)
  12. return;
  13. t.editor = ed;
  14. // Register commands
  15. ed.addCommand('mceIESpell', function() {
  16. try {
  17. sp = new ActiveXObject("ieSpell.ieSpellExtension");
  18. sp.CheckDocumentNode(ed.getDoc().documentElement);
  19. } catch (e) {
  20. if (e.number == -2146827859) {
  21. ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) {
  22. if (s)
  23. window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');
  24. });
  25. } else
  26. ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number);
  27. }
  28. });
  29. // Register buttons
  30. ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'});
  31. },
  32. getInfo : function() {
  33. return {
  34. longname : 'IESpell (IE Only)',
  35. author : 'Moxiecode Systems AB',
  36. authorurl : 'http://tinymce.moxiecode.com',
  37. infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',
  38. version : tinymce.majorVersion + "." + tinymce.minorVersion
  39. };
  40. }
  41. });
  42. // Register plugin
  43. tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell);
  44. })();