editor_plugin_src.js 1.4 KB

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