diff --git a/docs/gotcha.txt b/docs/gotcha.txt index 3bdf15ea3..d3fa68268 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -36,6 +36,8 @@ save you many hours of grief. * WebGUI 8 does not support HTTP Basic Authentication any longer. + * Support for server-side spell checking in the Rich Editor TinyMCE has been removed. + 7.10.23 -------------------------------------------------------------------- * The default_search2 template had a bad template attachment pointing to diff --git a/etc/WebGUI.conf.original b/etc/WebGUI.conf.original index a5ce107ca..e2484b3fe 100644 --- a/etc/WebGUI.conf.original +++ b/etc/WebGUI.conf.original @@ -966,23 +966,6 @@ "WebGUI::Image::Graph::XYGraph::Line" ], -# Here you can define the dictionaries that are available through the tinyMCE spellchecker. You should set -# id to the name the dictionary is known by ASpell (eg. en or en_US or nl), use the name parameter to set -# the name the dictionary is displayed with in tinyMCE. To set the default dictionary please set the 'default' -# parameter. - -#"availableDictionaries" : [ -# { -# "id" : "en_US", -# "name" : "English", -# "default" : "1" -# }, -# { -# "id" : "nl", -# "name" : "Dutch" -# } -#], - # Optional script to run upon successful login. The script can contain macros # ex: /data/WebGUI/sbin/doLogin.pl --configFile=dev.localhost.localdomain.conf --loginPage=^PageUrl(); diff --git a/lib/WebGUI/Asset/RichEdit.pm b/lib/WebGUI/Asset/RichEdit.pm index fe2a3a341..83d73aeb8 100644 --- a/lib/WebGUI/Asset/RichEdit.pm +++ b/lib/WebGUI/Asset/RichEdit.pm @@ -259,7 +259,6 @@ override getEditForm => sub { 'save' => $i18n->get('save'), 'preview' => $i18n->get('preview'), 'print' => $i18n->get('print'), - 'spellchecker' => $i18n->get('Server Side Spell Checker'), 'code' => $i18n->get('code'), 'fullscreen' => $i18n->get('fullscreen'), 'help' => $i18n->get('help'), @@ -308,9 +307,6 @@ override getEditForm => sub { name=>"toolbarRow3", checked=>$checked3 }).''; - if ($key eq 'spellchecker' && !($self->session->config->get('availableDictionaries'))) { - $buttonGrid .= $i18n->get('no dictionaries'); - } $buttonGrid .= ' '; @@ -377,13 +373,6 @@ sub getConfig { wg_userIsVisitor => $self->session->user->isVisitor ? JSON::true() : JSON::false(), ); foreach my $button (@toolbarButtons) { - if ( $button eq "spellchecker" && $self->session->config->get('availableDictionaries') ) { - push( @plugins, "-wgspellchecker" ); - $config{spellchecker_rpc_url} = $self->session->url->gateway( '', "op=spellCheck" ); - $config{spellchecker_languages} = join( ',', - map { ( $_->{default} ? '+' : '' ) . $_->{name} . '=' . $_->{id} } - @{ $self->session->config->get('availableDictionaries') } ); - } push( @plugins, "table" ) if ( $button eq "tablecontrols" ); push( @plugins, "save" ) if ( $button eq "save" ); push( @plugins, "advhr" ) if ( $button eq "advhr" ); @@ -475,9 +464,6 @@ sub getLoadPlugins { my ( $self ) = @_; my %loadPlugins; for my $button ( $self->getAllButtons ) { - if ( $button eq 'spellchecker' ) { - $loadPlugins{wgspellchecker} = $self->session->url->extras("tinymce-webgui/plugins/wgspellchecker/editor_plugin.js"); - } if ( $button eq 'wginsertimage' ) { $loadPlugins{wginsertimage} = $self->session->url->extras("tinymce-webgui/plugins/wginsertimage/editor_plugin.js"); } diff --git a/lib/WebGUI/Operation.pm b/lib/WebGUI/Operation.pm index a5bc54e0e..c4f2db169 100644 --- a/lib/WebGUI/Operation.pm +++ b/lib/WebGUI/Operation.pm @@ -256,10 +256,6 @@ sub getOperations { 'moveColorDown' => 'Graphics', 'moveColorUp' => 'Graphics', 'removeColorFromPalette' => 'Graphics', - - 'spellCheck' => 'SpellCheck', - 'suggestWords' => 'SpellCheck', - 'addWordToDictionary' => 'SpellCheck', }; } diff --git a/www/extras/tinymce-webgui/plugins/wgspellchecker/add-word.diff b/www/extras/tinymce-webgui/plugins/wgspellchecker/add-word.diff deleted file mode 100644 index aea3a1c33..000000000 --- a/www/extras/tinymce-webgui/plugins/wgspellchecker/add-word.diff +++ /dev/null @@ -1,48 +0,0 @@ -diff --git a/editor_plugin_src.js b/editor_plugin_src.js -index 4e9ba99..a96e310 100644 ---- a/editor_plugin_src.js -+++ b/editor_plugin_src.js -@@ -7,6 +7,7 @@ - - (function() { - var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM; -+ tinymce.PluginManager.requireLangPack('wgspellchecker'); - - tinymce.create('tinymce.plugins.SpellcheckerPlugin', { - getInfo : function() { -@@ -269,6 +270,16 @@ - } - }); - -+ m.add({ -+ title : 'spellchecker.add_word', -+ onclick : function() { -+ t._sendRPC('addWord', [t.selectedLang, dom.decode(e.target.innerHTML)], function(r) { -+ t._removeWords(dom.decode(e.target.innerHTML)); -+ t._checkDone(); -+ }); -+ } -+ }); -+ - m.update(); - }); - -@@ -333,5 +344,5 @@ - }); - - // Register plugin -- tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin); --})(); -\ No newline at end of file -+ tinymce.PluginManager.add('wgspellchecker', tinymce.plugins.SpellcheckerPlugin); -+})(); -diff --git a/dev/null b/langs/en.js -new file mode 100644 -index 0000000..602b23c ---- /dev/null -+++ b/langs/en.js -@@ -0,0 +1,4 @@ -+tinyMCE.addI18n('en.spellchecker',{ -+ add_word : 'Add word to dictionary' -+}); -+ diff --git a/www/extras/tinymce-webgui/plugins/wgspellchecker/css/content.css b/www/extras/tinymce-webgui/plugins/wgspellchecker/css/content.css deleted file mode 100644 index 24efa0217..000000000 --- a/www/extras/tinymce-webgui/plugins/wgspellchecker/css/content.css +++ /dev/null @@ -1 +0,0 @@ -.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;} diff --git a/www/extras/tinymce-webgui/plugins/wgspellchecker/editor_plugin.js b/www/extras/tinymce-webgui/plugins/wgspellchecker/editor_plugin.js deleted file mode 100644 index b57bba602..000000000 --- a/www/extras/tinymce-webgui/plugins/wgspellchecker/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var JSONRequest=tinymce.util.JSONRequest,each=tinymce.each,DOM=tinymce.DOM;tinymce.PluginManager.requireLangPack('wgspellchecker');tinymce.create('tinymce.plugins.SpellcheckerPlugin',{getInfo:function(){return{longname:'Spellchecker',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker',version:tinymce.majorVersion+"."+tinymce.minorVersion}},init:function(ed,url){var t=this,cm;t.url=url;t.editor=ed;ed.addCommand('mceSpellCheck',function(){if(!t.active){ed.setProgressState(1);t._sendRPC('checkWords',[t.selectedLang,t._getWords()],function(r){if(r.length>0){t.active=1;t._markWords(r);ed.setProgressState(0);ed.nodeChanged()}else{ed.setProgressState(0);ed.windowManager.alert('spellchecker.no_mpell')}})}else t._done()});ed.onInit.add(function(){ed.dom.loadCSS(url+'/css/content.css')});ed.onClick.add(t._showMenu,t);ed.onContextMenu.add(t._showMenu,t);ed.onBeforeGetContent.add(function(){if(t.active)t._removeWords()});ed.onNodeChange.add(function(ed,cm){cm.setActive('spellchecker',t.active)});ed.onSetContent.add(function(){t._done()});ed.onBeforeGetContent.add(function(){t._done()});ed.onBeforeExecCommand.add(function(ed,cmd){if(cmd=='mceFullScreen')t._done()});t.languages={};each(ed.getParam('spellchecker_languages','+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv','hash'),function(v,k){if(k.indexOf('+')===0){k=k.substring(1);t.selectedLang=v}t.languages[k]=v})},createControl:function(n,cm){var t=this,c,ed=t.editor;if(n=='spellchecker'){c=cm.createSplitButton(n,{title:'spellchecker.desc',cmd:'mceSpellCheck',scope:t});c.onRenderMenu.add(function(c,m){m.add({title:'spellchecker.langs','class':'mceMenuItemTitle'}).setDisabled(1);each(t.languages,function(v,k){var o={icon:1},mi;o.onclick=function(){mi.setSelected(1);t.selectedItem.setSelected(0);t.selectedItem=mi;t.selectedLang=v};o.title=k;mi=m.add(o);mi.setSelected(v==t.selectedLang);if(v==t.selectedLang)t.selectedItem=mi})});return c}},_walk:function(n,f){var d=this.editor.getDoc(),w;if(d.createTreeWalker){w=d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false);while((n=w.nextNode())!=null)f.call(this,n)}else tinymce.walk(n,f,'childNodes')},_getSeparators:function(){var re='',i,str=this.editor.getParam('spellchecker_word_separator_chars','\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c');for(i=0;i$1$2');v=v.replace(r3,'$1$2');dom.replace(dom.create('span',{'class':'mceItemHidden'},v),n)}}});se.moveToBookmark(b)},_showMenu:function(ed,e){var t=this,ed=t.editor,m=t._menu,p1,dom=ed.dom,vp=dom.getViewPort(ed.getWin());if(!m){p1=DOM.getPos(ed.getContentAreaContainer());m=ed.controlManager.createDropMenu('spellcheckermenu',{offset_x:p1.x,offset_y:p1.y,'class':'noIcons'});t._menu=m}if(dom.hasClass(e.target,'mceItemHiddenSpellWord')){m.removeAll();m.add({title:'spellchecker.wait','class':'mceMenuItemTitle'}).setDisabled(1);t._sendRPC('getSuggestions',[t.selectedLang,dom.decode(e.target.innerHTML)],function(r){m.removeAll();if(r.length>0){m.add({title:'spellchecker.sug','class':'mceMenuItemTitle'}).setDisabled(1);each(r,function(v){m.add({title:v,onclick:function(){dom.replace(ed.getDoc().createTextNode(v),e.target);t._checkDone()}})});m.addSeparator()}else m.add({title:'spellchecker.no_sug','class':'mceMenuItemTitle'}).setDisabled(1);m.add({title:'spellchecker.ignore_word',onclick:function(){dom.remove(e.target,1);t._checkDone()}});m.add({title:'spellchecker.ignore_words',onclick:function(){t._removeWords(dom.decode(e.target.innerHTML));t._checkDone()}});m.add({title:'spellchecker.add_word',onclick:function(){t._sendRPC('addWord',[t.selectedLang,dom.decode(e.target.innerHTML)],function(r){t._removeWords(dom.decode(e.target.innerHTML));t._checkDone()})}});m.update()});ed.selection.select(e.target);p1=dom.getPos(e.target);m.showMenu(p1.x,p1.y+e.target.offsetHeight-vp.y);return tinymce.dom.Event.cancel(e)}else m.hideMenu()},_checkDone:function(){var t=this,ed=t.editor,dom=ed.dom,o;each(dom.select('span'),function(n){if(n&&dom.hasClass(n,'mceItemHiddenSpellWord')){o=true;return false}});if(!o)t._done()},_done:function(){var t=this,la=t.active;if(t.active){t.active=0;t._removeWords();if(t._menu)t._menu.hideMenu();if(la)t.editor.nodeChanged()}},_sendRPC:function(m,p,cb){var t=this,url=t.editor.getParam("spellchecker_rpc_url","{backend}");if(url=='{backend}'){t.editor.setProgressState(0);alert('Please specify: spellchecker_rpc_url');return}JSONRequest.sendRPC({url:url,method:m,params:p,success:cb,error:function(e,x){t.editor.setProgressState(0);t.editor.windowManager.alert(e.errstr||('Error response: '+x.responseText))}})}});tinymce.PluginManager.add('wgspellchecker',tinymce.plugins.SpellcheckerPlugin)})(); \ No newline at end of file diff --git a/www/extras/tinymce-webgui/plugins/wgspellchecker/editor_plugin_src.js b/www/extras/tinymce-webgui/plugins/wgspellchecker/editor_plugin_src.js deleted file mode 100644 index a96e310ab..000000000 --- a/www/extras/tinymce-webgui/plugins/wgspellchecker/editor_plugin_src.js +++ /dev/null @@ -1,348 +0,0 @@ -/** - * $Id: editor_plugin_src.js 425 2007-11-21 15:17:39Z spocke $ - * - * @author Moxiecode - * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM; - tinymce.PluginManager.requireLangPack('wgspellchecker'); - - tinymce.create('tinymce.plugins.SpellcheckerPlugin', { - getInfo : function() { - return { - longname : 'Spellchecker', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - init : function(ed, url) { - var t = this, cm; - - t.url = url; - t.editor = ed; - - // Register commands - ed.addCommand('mceSpellCheck', function() { - if (!t.active) { - ed.setProgressState(1); - t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) { - if (r.length > 0) { - t.active = 1; - t._markWords(r); - ed.setProgressState(0); - ed.nodeChanged(); - } else { - ed.setProgressState(0); - ed.windowManager.alert('spellchecker.no_mpell'); - } - }); - } else - t._done(); - }); - - ed.onInit.add(function() { - ed.dom.loadCSS(url + '/css/content.css'); - }); - - ed.onClick.add(t._showMenu, t); - ed.onContextMenu.add(t._showMenu, t); - ed.onBeforeGetContent.add(function() { - if (t.active) - t._removeWords(); - }); - - ed.onNodeChange.add(function(ed, cm) { - cm.setActive('spellchecker', t.active); - }); - - ed.onSetContent.add(function() { - t._done(); - }); - - ed.onBeforeGetContent.add(function() { - t._done(); - }); - - ed.onBeforeExecCommand.add(function(ed, cmd) { - if (cmd == 'mceFullScreen') - t._done(); - }); - - // Find selected language - t.languages = {}; - each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) { - if (k.indexOf('+') === 0) { - k = k.substring(1); - t.selectedLang = v; - } - - t.languages[k] = v; - }); - }, - - createControl : function(n, cm) { - var t = this, c, ed = t.editor; - - if (n == 'spellchecker') { - c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); - - c.onRenderMenu.add(function(c, m) { - m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - each(t.languages, function(v, k) { - var o = {icon : 1}, mi; - - o.onclick = function() { - mi.setSelected(1); - t.selectedItem.setSelected(0); - t.selectedItem = mi; - t.selectedLang = v; - }; - - o.title = k; - mi = m.add(o); - mi.setSelected(v == t.selectedLang); - - if (v == t.selectedLang) - t.selectedItem = mi; - }) - }); - - return c; - } - }, - - // Internal functions - - _walk : function(n, f) { - var d = this.editor.getDoc(), w; - - if (d.createTreeWalker) { - w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); - - while ((n = w.nextNode()) != null) - f.call(this, n); - } else - tinymce.walk(n, f, 'childNodes'); - }, - - _getSeparators : function() { - var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c'); - - // Build word separator regexp - for (i=0; i$1$2'); - v = v.replace(r3, '$1$2'); - - dom.replace(dom.create('span', {'class' : 'mceItemHidden'}, v), n); - } - } - }); - - se.moveToBookmark(b); - }, - - _showMenu : function(ed, e) { - var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()); - - if (!m) { - p1 = DOM.getPos(ed.getContentAreaContainer()); - //p2 = DOM.getPos(ed.getContainer()); - - m = ed.controlManager.createDropMenu('spellcheckermenu', { - offset_x : p1.x, - offset_y : p1.y, - 'class' : 'noIcons' - }); - - t._menu = m; - } - - if (dom.hasClass(e.target, 'mceItemHiddenSpellWord')) { - m.removeAll(); - m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - - t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(e.target.innerHTML)], function(r) { - m.removeAll(); - - if (r.length > 0) { - m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - each(r, function(v) { - m.add({title : v, onclick : function() { - dom.replace(ed.getDoc().createTextNode(v), e.target); - t._checkDone(); - }}); - }); - - m.addSeparator(); - } else - m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - - m.add({ - title : 'spellchecker.ignore_word', - onclick : function() { - dom.remove(e.target, 1); - t._checkDone(); - } - }); - - m.add({ - title : 'spellchecker.ignore_words', - onclick : function() { - t._removeWords(dom.decode(e.target.innerHTML)); - t._checkDone(); - } - }); - - m.add({ - title : 'spellchecker.add_word', - onclick : function() { - t._sendRPC('addWord', [t.selectedLang, dom.decode(e.target.innerHTML)], function(r) { - t._removeWords(dom.decode(e.target.innerHTML)); - t._checkDone(); - }); - } - }); - - m.update(); - }); - - ed.selection.select(e.target); - p1 = dom.getPos(e.target); - m.showMenu(p1.x, p1.y + e.target.offsetHeight - vp.y); - - return tinymce.dom.Event.cancel(e); - } else - m.hideMenu(); - }, - - _checkDone : function() { - var t = this, ed = t.editor, dom = ed.dom, o; - - each(dom.select('span'), function(n) { - if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) { - o = true; - return false; - } - }); - - if (!o) - t._done(); - }, - - _done : function() { - var t = this, la = t.active; - - if (t.active) { - t.active = 0; - t._removeWords(); - - if (t._menu) - t._menu.hideMenu(); - - if (la) - t.editor.nodeChanged(); - } - }, - - _sendRPC : function(m, p, cb) { - var t = this, url = t.editor.getParam("spellchecker_rpc_url", "{backend}"); - - if (url == '{backend}') { - t.editor.setProgressState(0); - alert('Please specify: spellchecker_rpc_url'); - return; - } - - JSONRequest.sendRPC({ - url : url, - method : m, - params : p, - success : cb, - error : function(e, x) { - t.editor.setProgressState(0); - t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText)); - } - }); - } - }); - - // Register plugin - tinymce.PluginManager.add('wgspellchecker', tinymce.plugins.SpellcheckerPlugin); -})(); diff --git a/www/extras/tinymce-webgui/plugins/wgspellchecker/img/wline.gif b/www/extras/tinymce-webgui/plugins/wgspellchecker/img/wline.gif deleted file mode 100644 index 7d0a4dbca..000000000 Binary files a/www/extras/tinymce-webgui/plugins/wgspellchecker/img/wline.gif and /dev/null differ diff --git a/www/extras/tinymce-webgui/plugins/wgspellchecker/langs/en.js b/www/extras/tinymce-webgui/plugins/wgspellchecker/langs/en.js deleted file mode 100644 index 602b23c24..000000000 --- a/www/extras/tinymce-webgui/plugins/wgspellchecker/langs/en.js +++ /dev/null @@ -1,4 +0,0 @@ -tinyMCE.addI18n('en.spellchecker',{ - add_word : 'Add word to dictionary' -}); -