fckspellcheckcommand_ie.js
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:2k
源码类别:

OA系统

开发平台:

C#

  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: fckspellcheckcommand_ie.js
  14.  *  FCKStyleCommand Class: represents the "Spell Check" command.
  15.  *  (IE specific implementation)
  16.  * 
  17.  * File Authors:
  18.  *  Frederico Caldeira Knabben (fredck@fckeditor.net)
  19.  */
  20. var FCKSpellCheckCommand = function()
  21. {
  22. this.Name = 'SpellCheck' ;
  23. this.IsEnabled = ( FCKConfig.SpellChecker == 'ieSpell' || FCKConfig.SpellChecker == 'SpellerPages' ) ;
  24. }
  25. FCKSpellCheckCommand.prototype.Execute = function()
  26. {
  27. switch ( FCKConfig.SpellChecker )
  28. {
  29. case 'ieSpell' :
  30. this._RunIeSpell() ;
  31. break ;
  32. case 'SpellerPages' :
  33. FCKDialog.OpenDialog( 'FCKDialog_SpellCheck', 'Spell Check', 'dialog/fck_spellerpages.html', 440, 480 ) ;
  34. break ;
  35. }
  36. }
  37. FCKSpellCheckCommand.prototype._RunIeSpell = function()
  38. {
  39. try
  40. {
  41. var oIeSpell = new ActiveXObject( "ieSpell.ieSpellExtension" ) ;
  42. oIeSpell.CheckAllLinkedDocuments( FCK.EditorDocument ) ;
  43. }
  44. catch( e )
  45. {
  46. if( e.number == -2146827859 )
  47. {
  48. if ( confirm( FCKLang.IeSpellDownload ) )
  49. window.open( FCKConfig.IeSpellDownloadUrl , 'IeSpellDownload' ) ;
  50. }
  51. else
  52. alert( 'Error Loading ieSpell: ' + e.message + ' (' + e.number + ')' ) ;
  53. }
  54. }
  55. FCKSpellCheckCommand.prototype.GetState = function()
  56. {
  57. return this.IsEnabled ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
  58. }