<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[19178] trunk/wp-includes: Update the spellchecker plugin for TinyMCE to 2.0.6, fixes #19105</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/19178">19178</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2011-11-05 18:32:47 +0000 (Sat, 05 Nov 2011)</dd>
</dl>

<h3>Log Message</h3>
<pre>Update the spellchecker plugin for TinyMCE to 2.0.6, fixes <a href="http://core.trac.wordpress.org/ticket/19105">#19105</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesjstinymcepluginsspellcheckerchangelogtxt">trunk/wp-includes/js/tinymce/plugins/spellchecker/changelog.txt</a></li>
<li><a href="#trunkwpincludesjstinymcepluginsspellcheckerclassesEnchantSpellphp">trunk/wp-includes/js/tinymce/plugins/spellchecker/classes/EnchantSpell.php</a></li>
<li><a href="#trunkwpincludesjstinymcepluginsspellcheckerclassesPSpellShellphp">trunk/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpellShell.php</a></li>
<li><a href="#trunkwpincludesjstinymcepluginsspellcheckereditor_pluginjs">trunk/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js</a></li>
<li><a href="#trunkwpincludesjstinymcewptinymcejsgz">trunk/wp-includes/js/tinymce/wp-tinymce.js.gz</a></li>
<li><a href="#trunkwpincludesversionphp">trunk/wp-includes/version.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesjstinymcepluginsspellcheckerchangelogtxt"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/spellchecker/changelog.txt (19177 => 19178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/spellchecker/changelog.txt        2011-11-05 18:09:38 UTC (rev 19177)
+++ trunk/wp-includes/js/tinymce/plugins/spellchecker/changelog.txt        2011-11-05 18:32:47 UTC (rev 19178)
</span><span class="lines">@@ -1,3 +1,8 @@
</span><ins>+Version 2.0.6 (2011-09-29)
+        Fixed incorrect position of suggestion menu.
+        Fixed handling of mispelled words with no suggestions in PSpellShell engine.
+        Fixed PSpellShell command on Windows.
+        Fixed bug where Javascript error is produced when enchant_dict_suggest() returns unexpected result.
</ins><span class="cx"> Version 2.0.5 (2011-03-24)
</span><span class="cx">         Merged with the latest TinyMCE spellchecker version.
</span><span class="cx"> Version 2.0.4 (2010-12-20)
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginsspellcheckerclassesEnchantSpellphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/spellchecker/classes/EnchantSpell.php (19177 => 19178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/spellchecker/classes/EnchantSpell.php        2011-11-05 18:09:38 UTC (rev 19177)
+++ trunk/wp-includes/js/tinymce/plugins/spellchecker/classes/EnchantSpell.php        2011-11-05 18:32:47 UTC (rev 19178)
</span><span class="lines">@@ -48,16 +48,20 @@
</span><span class="cx">          */
</span><span class="cx">         function &amp;getSuggestions($lang, $word) {
</span><span class="cx">                 $r = enchant_broker_init();
</span><del>-                $suggs = array();
</del><span class="cx"> 
</span><span class="cx">                 if (enchant_broker_dict_exists($r,$lang)) {
</span><span class="cx">                         $d = enchant_broker_request_dict($r, $lang);
</span><span class="cx">                         $suggs = enchant_dict_suggest($d, $word);
</span><span class="cx"> 
</span><ins>+                        // enchant_dict_suggest() sometimes returns NULL
+                        if (!is_array($suggs))
+                                $suggs = array();
+
</ins><span class="cx">                         enchant_broker_free_dict($d);
</span><span class="cx">                 } else {
</span><ins>+                        $suggs = array();
+                }
</ins><span class="cx"> 
</span><del>-                }
</del><span class="cx">                 enchant_broker_free($r);
</span><span class="cx"> 
</span><span class="cx">                 return $suggs;
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginsspellcheckerclassesPSpellShellphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpellShell.php (19177 => 19178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpellShell.php        2011-11-05 18:09:38 UTC (rev 19177)
+++ trunk/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpellShell.php        2011-11-05 18:32:47 UTC (rev 19178)
</span><span class="lines">@@ -38,13 +38,13 @@
</span><span class="cx">                         $matches = array();
</span><span class="cx"> 
</span><span class="cx">                         // Skip this line.
</span><del>-                        if (strpos($dstr, &quot;@&quot;) === 0)
</del><ins>+                        if ($dstr[0] == &quot;@&quot;)
</ins><span class="cx">                                 continue;
</span><span class="cx"> 
</span><del>-                        preg_match(&quot;/\&amp; ([^ ]+) .*/i&quot;, $dstr, $matches);
</del><ins>+                        preg_match(&quot;/(\&amp;|#) ([^ ]+) .*/i&quot;, $dstr, $matches);
</ins><span class="cx"> 
</span><del>-                        if (!empty($matches[1]))
-                                $returnData[] = utf8_encode(trim($matches[1]));
</del><ins>+                        if (!empty($matches[2]))
+                                $returnData[] = utf8_encode(trim($matches[2]));
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 return $returnData;
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx">                         $matches = array();
</span><span class="cx"> 
</span><span class="cx">                         // Skip this line.
</span><del>-                        if (strpos($dstr, &quot;@&quot;) === 0)
</del><ins>+                        if ($dstr[0] == &quot;@&quot;)
</ins><span class="cx">                                 continue;
</span><span class="cx"> 
</span><span class="cx">                         preg_match(&quot;/\&amp;[^:]+:(.*)/i&quot;, $dstr, $matches);
</span><span class="lines">@@ -103,10 +103,14 @@
</span><span class="cx">         function _getCMD($lang) {
</span><span class="cx">                 $this-&gt;_tmpfile = tempnam($this-&gt;_config['PSpellShell.tmp'], &quot;tinyspell&quot;);
</span><span class="cx"> 
</span><del>-                if(preg_match(&quot;#win#i&quot;, php_uname()))
-                        return $this-&gt;_config['PSpellShell.aspell'] . &quot; -a --lang=&quot;. escapeshellarg($lang) . &quot; --encoding=utf-8 -H &lt; &quot; . $this-&gt;_tmpfile . &quot; 2&gt;&amp;1&quot;;
</del><ins>+                $file = $this-&gt;_tmpfile;
+                $lang = preg_replace(&quot;/[^-_a-z]/&quot;, &quot;&quot;, strtolower($lang));
+                $bin  = $this-&gt;_config['PSpellShell.aspell'];
</ins><span class="cx"> 
</span><del>-                return &quot;cat &quot;. $this-&gt;_tmpfile .&quot; | &quot; . $this-&gt;_config['PSpellShell.aspell'] . &quot; -a --encoding=utf-8 -H --lang=&quot;. escapeshellarg($lang);
</del><ins>+                if (preg_match(&quot;#win#i&quot;, php_uname()))
+                        return &quot;$bin -a --lang=$lang --encoding=utf-8 -H &lt; $file 2&gt;&amp;1&quot;;
+
+                return &quot;cat $file | $bin -a --lang=$lang --encoding=utf-8 -H&quot;;
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginsspellcheckereditor_pluginjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js (19177 => 19178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js        2011-11-05 18:09:38 UTC (rev 19177)
+++ trunk/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js        2011-11-05 18:32:47 UTC (rev 19178)
</span><span class="lines">@@ -1 +1 @@
</span><del>-(function(){var a=tinymce.util.JSONRequest,c=tinymce.each,b=tinymce.DOM;tinymce.create(&quot;tinymce.plugins.SpellcheckerPlugin&quot;,{getInfo:function(){return{longname:&quot;Spellchecker&quot;,author:&quot;Moxiecode Systems AB&quot;,authorurl:&quot;http://tinymce.moxiecode.com&quot;,infourl:&quot;http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker&quot;,version:tinymce.majorVersion+&quot;.&quot;+tinymce.minorVersion}},init:function(e,f){var g=this,d;g.url=f;g.editor=e;g.rpcUrl=e.getParam(&quot;spellchecker_rpc_url&quot;,this.url+'/rpc.php');if(g.rpcUrl==&quot;{backend}&quot;){if(tinymce.isIE){return}g.hasSupport=true;e.onContextMenu.addToTop(function(h,i){if(g.active){return false}})}e.addCommand(&quot;mceSpellCheck&quot;,function(){if(g.rpcUrl==&quot;{backend}&quot;){g.editor.getBody().spellcheck=g.active=!g.active;return}if(!g.active){e.setProgressState(1);g._sendRPC(&quot;checkWords&quot;,[g.selectedLang,g._getWords()],function(h){if(h.length&gt
 ;0){g.active=1;g._markWords(h);e.setProgressState(0);e.nodeChanged()}else{e.setProgressState(0);if(e.getParam(&quot;spellchecker_report_no_misspellings&quot;,true)){e.windowManager.alert(&quot;spellchecker.no_mpell&quot;)}}})}else{g._done()}});if(e.settings.content_css!==false){e.contentCSS.push(f+&quot;/css/content.css&quot;)}e.onClick.add(g._showMenu,g);e.onContextMenu.add(g._showMenu,g);e.onBeforeGetContent.add(function(){if(g.active){g._removeWords()}});e.onNodeChange.add(function(i,h){h.setActive(&quot;spellchecker&quot;,g.active)});e.onSetContent.add(function(){g._done()});e.onBeforeGetContent.add(function(){g._done()});e.onBeforeExecCommand.add(function(h,i){if(i==&quot;mceFullScreen&quot;){g._done()}});g.languages={};c(e.getParam(&quot;spellchecker_languages&quot;,&quot;+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv&quot;,&quot;hash&quot;),function(i,h){if(h.indexOf(&quot;+&quot;)===0){h=h.substr
 ing(1);g.selectedLang=i}g.languages[h]=i})},createControl:function(h,d){var f=this,g,e=f.editor;if(h==&quot;spellchecker&quot;){if(f.rpcUrl==&quot;{backend}&quot;){if(f.hasSupport){g=d.createButton(h,{title:&quot;spellchecker.desc&quot;,cmd:&quot;mceSpellCheck&quot;,scope:f})}return g}g=d.createSplitButton(h,{title:&quot;spellchecker.desc&quot;,cmd:&quot;mceSpellCheck&quot;,scope:f});g.onRenderMenu.add(function(j,i){i.add({title:&quot;spellchecker.langs&quot;,&quot;class&quot;:&quot;mceMenuItemTitle&quot;}).setDisabled(1);c(f.languages,function(n,m){var p={icon:1},l;p.onclick=function(){if(n==f.selectedLang){return}l.setSelected(1);f.selectedItem.setSelected(0);f.selectedItem=l;f.selectedLang=n};p.title=m;l=i.add(p);l.setSelected(n==f.selectedLang);if(n==f.selectedLang){f.selectedItem=l}})});return g}},_walk:function(i,g){var h=this.editor.getDoc(),e;if(h.createTreeWalker){e=h.createTreeWalker(i,NodeFilter.SHOW_TEXT,null,false);while((i=e.nextNode())!=null){g.call(this,i)}}e
 lse{tinymce.walk(i,g,&quot;childNodes&quot;)}},_getSeparators:function(){var e=&quot;&quot;,d,f=this.editor.getParam(&quot;spellchecker_word_separator_chars&quot;,'\\s!&quot;#$%&amp;()*+,-./:;&lt;=&gt;?@[]^_{|}\xA7\xA9\xAB\xAE\xB1\xB6\xB7\xB8\xBB\xBC\xBD\xBE\xBF\xD7\xF7\xA4\u201d\u201c');for(d=0;d&lt;f.length;d++){e+=&quot;\\&quot;+f.charAt(d)}return e},_getWords:function(){var e=this.editor,g=[],d=&quot;&quot;,f={},h=[];this._walk(e.getBody(),function(i){if(i.nodeType==3){d+=i.nodeValue+&quot; &quot;}});if(e.getParam(&quot;spellchecker_word_pattern&quot;)){h=d.match(&quot;(&quot;+e.getParam(&quot;spellchecker_word_pattern&quot;)+&quot;)&quot;,&quot;gi&quot;)}else{d=d.replace(new RegExp(&quot;([0-9]|[&quot;+this._getSeparators()+&quot;])&quot;,&quot;g&quot;),&quot; &quot;);d=tinymce.trim(d.replace(/(\s+)/g,&quot; &quot;));h=d.split(&quot; &quot;)}c(h,function(i){if(!f[i]){g.push(i);f[i]=1}});return g},_removeWords:function(e){var f=this.editor,h=f.dom,g=f.selection,d=g.getBo
 okmark();c(h.select(&quot;span&quot;).reverse(),function(i){if(i&amp;&amp;(h.hasClass(i,&quot;mceItemHiddenSpellWord&quot;)||h.hasClass(i,&quot;mceItemHidden&quot;))){if(!e||h.decode(i.innerHTML)==e){h.remove(i,1)}}});g.moveToBookmark(d)},_markWords:function(k){var g=this.editor,f=g.dom,h=g.selection,i=h.getBookmark(),d=[],j=k.join(&quot;|&quot;),l=this._getSeparators(),e=new RegExp(&quot;(^|[&quot;+l+&quot;])(&quot;+j+&quot;)(?=[&quot;+l+&quot;]|$)&quot;,&quot;g&quot;);this._walk(g.getBody(),function(m){if(m.nodeType==3){d.push(m)}});c(d,function(s){var q,p,m,r,o=s.nodeValue;if(e.test(o)){o=f.encode(o);p=f.create(&quot;span&quot;,{&quot;class&quot;:&quot;mceItemHidden&quot;});if(tinymce.isIE){o=o.replace(e,&quot;$1&lt;mcespell&gt;$2&lt;/mcespell&gt;&quot;);while((r=o.indexOf(&quot;&lt;mcespell&gt;&quot;))!=-1){m=o.substring(0,r);if(m.length){q=document.createTextNode(f.decode(m));p.appendChild(q)}o=o.substring(r+10);r=o.indexOf(&quot;&lt;/mcespell&gt;&quot;);m=o.substring(0
 ,r);o=o.substring(r+11);p.appendChild(f.create(&quot;span&quot;,{&quot;class&quot;:&quot;mceItemHiddenSpellWord&quot;},m))}if(o.length){q=document.createTextNode(f.decode(o));p.appendChild(q)}}else{p.innerHTML=o.replace(e,'$1&lt;span class=&quot;mceItemHiddenSpellWord&quot;&gt;$2&lt;/span&gt;')}f.replace(p,s)}});h.moveToBookmark(i)},_showMenu:function(h,j){var i=this,h=i.editor,d=i._menu,l,k=h.dom,g=k.getViewPort(h.getWin()),f=j.target;j=0;if(!d){d=h.controlManager.createDropMenu(&quot;spellcheckermenu&quot;,{&quot;class&quot;:&quot;mceNoIcons&quot;});i._menu=d}if(k.hasClass(f,&quot;mceItemHiddenSpellWord&quot;)){d.removeAll();d.add({title:&quot;spellchecker.wait&quot;,&quot;class&quot;:&quot;mceMenuItemTitle&quot;}).setDisabled(1);i._sendRPC(&quot;getSuggestions&quot;,[i.selectedLang,k.decode(f.innerHTML)],function(m){var e;d.removeAll();if(m.length&gt;0){d.add({title:&quot;spellchecker.sug&quot;,&quot;class&quot;:&quot;mceMenuItemTitle&quot;}).setDisabled(1);c(m,function(n
 ){d.add({title:n,onclick:function(){k.replace(h.getDoc().createTextNode(n),f);i._checkDone()}})});d.addSeparator()}else{d.add({title:&quot;spellchecker.no_sug&quot;,&quot;class&quot;:&quot;mceMenuItemTitle&quot;}).setDisabled(1)}e=i.editor.getParam(&quot;spellchecker_enable_ignore_rpc&quot;,&quot;&quot;);d.add({title:&quot;spellchecker.ignore_word&quot;,onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();if(e){h.setProgressState(1);i._sendRPC(&quot;ignoreWord&quot;,[i.selectedLang,n],function(o){h.setProgressState(0)})}}});d.add({title:&quot;spellchecker.ignore_words&quot;,onclick:function(){var n=f.innerHTML;i._removeWords(k.decode(n));i._checkDone();if(e){h.setProgressState(1);i._sendRPC(&quot;ignoreWords&quot;,[i.selectedLang,n],function(o){h.setProgressState(0)})}}});if(i.editor.getParam(&quot;spellchecker_enable_learn_rpc&quot;)){d.add({title:&quot;spellchecker.learn_word&quot;,onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();h.setProgress
 State(1);i._sendRPC(&quot;learnWord&quot;,[i.selectedLang,n],function(o){h.setProgressState(0)})}})}d.update()});l=k.getPos(h.getContentAreaContainer());d.settings.offset_x=l.x;d.settings.offset_y=l.y;h.selection.select(f);l=k.getPos(f);d.showMenu(l.x,l.y+f.offsetHeight-g.y);return tinymce.dom.Event.cancel(j)}else{d.hideMenu()}},_checkDone:function(){var e=this,d=e.editor,g=d.dom,f;c(g.select(&quot;span&quot;),function(h){if(h&amp;&amp;g.hasClass(h,&quot;mceItemHiddenSpellWord&quot;)){f=true;return false}});if(!f){e._done()}},_done:function(){var d=this,e=d.active;if(d.active){d.active=0;d._removeWords();if(d._menu){d._menu.hideMenu()}if(e){d.editor.nodeChanged()}}},_sendRPC:function(e,g,d){var f=this;a.sendRPC({url:f.rpcUrl,method:e,params:g,success:d,error:function(i,h){f.editor.setProgressState(0);f.editor.windowManager.alert(i.errstr||(&quot;Error response: &quot;+h.responseText))}})}});tinymce.PluginManager.add(&quot;spellchecker&quot;,tinymce.plugins.SpellcheckerPlugin
 )})();
</del><span class="cx">\ No newline at end of file
</span><ins>+(function(){var a=tinymce.util.JSONRequest,c=tinymce.each,b=tinymce.DOM;tinymce.create(&quot;tinymce.plugins.SpellcheckerPlugin&quot;,{getInfo:function(){return{longname:&quot;Spellchecker&quot;,author:&quot;Moxiecode Systems AB&quot;,authorurl:&quot;http://tinymce.moxiecode.com&quot;,infourl:&quot;http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker&quot;,version:tinymce.majorVersion+&quot;.&quot;+tinymce.minorVersion}},init:function(e,f){var g=this,d;g.url=f;g.editor=e;g.rpcUrl=e.getParam(&quot;spellchecker_rpc_url&quot;,this.url+'/rpc.php');if(g.rpcUrl==&quot;{backend}&quot;){if(tinymce.isIE){return}g.hasSupport=true;e.onContextMenu.addToTop(function(h,i){if(g.active){return false}})}e.addCommand(&quot;mceSpellCheck&quot;,function(){if(g.rpcUrl==&quot;{backend}&quot;){g.editor.getBody().spellcheck=g.active=!g.active;return}if(!g.active){e.setProgressState(1);g._sendRPC(&quot;checkWords&quot;,[g.selectedLang,g._getWords()],function(h){if(h.length&gt
 ;0){g.active=1;g._markWords(h);e.setProgressState(0);e.nodeChanged()}else{e.setProgressState(0);if(e.getParam(&quot;spellchecker_report_no_misspellings&quot;,true)){e.windowManager.alert(&quot;spellchecker.no_mpell&quot;)}}})}else{g._done()}});if(e.settings.content_css!==false){e.contentCSS.push(f+&quot;/css/content.css&quot;)}e.onClick.add(g._showMenu,g);e.onContextMenu.add(g._showMenu,g);e.onBeforeGetContent.add(function(){if(g.active){g._removeWords()}});e.onNodeChange.add(function(i,h){h.setActive(&quot;spellchecker&quot;,g.active)});e.onSetContent.add(function(){g._done()});e.onBeforeGetContent.add(function(){g._done()});e.onBeforeExecCommand.add(function(h,i){if(i==&quot;mceFullScreen&quot;){g._done()}});g.languages={};c(e.getParam(&quot;spellchecker_languages&quot;,&quot;+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv&quot;,&quot;hash&quot;),function(i,h){if(h.indexOf(&quot;+&quot;)===0){h=h.substr
 ing(1);g.selectedLang=i}g.languages[h]=i})},createControl:function(h,d){var f=this,g,e=f.editor;if(h==&quot;spellchecker&quot;){if(f.rpcUrl==&quot;{backend}&quot;){if(f.hasSupport){g=d.createButton(h,{title:&quot;spellchecker.desc&quot;,cmd:&quot;mceSpellCheck&quot;,scope:f})}return g}g=d.createSplitButton(h,{title:&quot;spellchecker.desc&quot;,cmd:&quot;mceSpellCheck&quot;,scope:f});g.onRenderMenu.add(function(j,i){i.add({title:&quot;spellchecker.langs&quot;,&quot;class&quot;:&quot;mceMenuItemTitle&quot;}).setDisabled(1);c(f.languages,function(n,m){var p={icon:1},l;p.onclick=function(){if(n==f.selectedLang){return}l.setSelected(1);f.selectedItem.setSelected(0);f.selectedItem=l;f.selectedLang=n};p.title=m;l=i.add(p);l.setSelected(n==f.selectedLang);if(n==f.selectedLang){f.selectedItem=l}})});return g}},_walk:function(i,g){var h=this.editor.getDoc(),e;if(h.createTreeWalker){e=h.createTreeWalker(i,NodeFilter.SHOW_TEXT,null,false);while((i=e.nextNode())!=null){g.call(this,i)}}e
 lse{tinymce.walk(i,g,&quot;childNodes&quot;)}},_getSeparators:function(){var e=&quot;&quot;,d,f=this.editor.getParam(&quot;spellchecker_word_separator_chars&quot;,'\\s!&quot;#$%&amp;()*+,-./:;&lt;=&gt;?@[]^_{|}\xA7\xA9\xAB\xAE\xB1\xB6\xB7\xB8\xBB\xBC\xBD\xBE\xBF\xD7\xF7\xA4\u201d\u201c');for(d=0;d&lt;f.length;d++){e+=&quot;\\&quot;+f.charAt(d)}return e},_getWords:function(){var e=this.editor,g=[],d=&quot;&quot;,f={},h=[];this._walk(e.getBody(),function(i){if(i.nodeType==3){d+=i.nodeValue+&quot; &quot;}});if(e.getParam(&quot;spellchecker_word_pattern&quot;)){h=d.match(&quot;(&quot;+e.getParam(&quot;spellchecker_word_pattern&quot;)+&quot;)&quot;,&quot;gi&quot;)}else{d=d.replace(new RegExp(&quot;([0-9]|[&quot;+this._getSeparators()+&quot;])&quot;,&quot;g&quot;),&quot; &quot;);d=tinymce.trim(d.replace(/(\s+)/g,&quot; &quot;));h=d.split(&quot; &quot;)}c(h,function(i){if(!f[i]){g.push(i);f[i]=1}});return g},_removeWords:function(e){var f=this.editor,h=f.dom,g=f.selection,d=g.getBo
 okmark();c(h.select(&quot;span&quot;).reverse(),function(i){if(i&amp;&amp;(h.hasClass(i,&quot;mceItemHiddenSpellWord&quot;)||h.hasClass(i,&quot;mceItemHidden&quot;))){if(!e||h.decode(i.innerHTML)==e){h.remove(i,1)}}});g.moveToBookmark(d)},_markWords:function(l){var g=this.editor,f=g.dom,j=g.getDoc(),h=g.selection,i=h.getBookmark(),d=[],k=l.join(&quot;|&quot;),m=this._getSeparators(),e=new RegExp(&quot;(^|[&quot;+m+&quot;])(&quot;+k+&quot;)(?=[&quot;+m+&quot;]|$)&quot;,&quot;g&quot;);this._walk(g.getBody(),function(o){if(o.nodeType==3){d.push(o)}});c(d,function(t){var r,q,o,s,p=t.nodeValue;if(e.test(p)){p=f.encode(p);q=f.create(&quot;span&quot;,{&quot;class&quot;:&quot;mceItemHidden&quot;});if(tinymce.isIE){p=p.replace(e,&quot;$1&lt;mcespell&gt;$2&lt;/mcespell&gt;&quot;);while((s=p.indexOf(&quot;&lt;mcespell&gt;&quot;))!=-1){o=p.substring(0,s);if(o.length){r=j.createTextNode(f.decode(o));q.appendChild(r)}p=p.substring(s+10);s=p.indexOf(&quot;&lt;/mcespell&gt;&quot;);o=p.subst
 ring(0,s);p=p.substring(s+11);q.appendChild(f.create(&quot;span&quot;,{&quot;class&quot;:&quot;mceItemHiddenSpellWord&quot;},o))}if(p.length){r=j.createTextNode(f.decode(p));q.appendChild(r)}}else{q.innerHTML=p.replace(e,'$1&lt;span class=&quot;mceItemHiddenSpellWord&quot;&gt;$2&lt;/span&gt;')}f.replace(q,t)}});h.moveToBookmark(i)},_showMenu:function(h,j){var i=this,h=i.editor,d=i._menu,l,k=h.dom,g=k.getViewPort(h.getWin()),f=j.target;j=0;if(!d){d=h.controlManager.createDropMenu(&quot;spellcheckermenu&quot;,{&quot;class&quot;:&quot;mceNoIcons&quot;});i._menu=d}if(k.hasClass(f,&quot;mceItemHiddenSpellWord&quot;)){d.removeAll();d.add({title:&quot;spellchecker.wait&quot;,&quot;class&quot;:&quot;mceMenuItemTitle&quot;}).setDisabled(1);i._sendRPC(&quot;getSuggestions&quot;,[i.selectedLang,k.decode(f.innerHTML)],function(m){var e;d.removeAll();if(m.length&gt;0){d.add({title:&quot;spellchecker.sug&quot;,&quot;class&quot;:&quot;mceMenuItemTitle&quot;}).setDisabled(1);c(m,function(n)
 {d.add({title:n,onclick:function(){k.replace(h.getDoc().createTextNode(n),f);i._checkDone()}})});d.addSeparator()}else{d.add({title:&quot;spellchecker.no_sug&quot;,&quot;class&quot;:&quot;mceMenuItemTitle&quot;}).setDisabled(1)}if(h.getParam(&quot;show_ignore_words&quot;,true)){e=i.editor.getParam(&quot;spellchecker_enable_ignore_rpc&quot;,&quot;&quot;);d.add({title:&quot;spellchecker.ignore_word&quot;,onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();if(e){h.setProgressState(1);i._sendRPC(&quot;ignoreWord&quot;,[i.selectedLang,n],function(o){h.setProgressState(0)})}}});d.add({title:&quot;spellchecker.ignore_words&quot;,onclick:function(){var n=f.innerHTML;i._removeWords(k.decode(n));i._checkDone();if(e){h.setProgressState(1);i._sendRPC(&quot;ignoreWords&quot;,[i.selectedLang,n],function(o){h.setProgressState(0)})}}})}if(i.editor.getParam(&quot;spellchecker_enable_learn_rpc&quot;)){d.add({title:&quot;spellchecker.learn_word&quot;,onclick:function(){var n=f.in
 nerHTML;k.remove(f,1);i._checkDone();h.setProgressState(1);i._sendRPC(&quot;learnWord&quot;,[i.selectedLang,n],function(o){h.setProgressState(0)})}})}d.update()});l=b.getPos(h.getContentAreaContainer());d.settings.offset_x=l.x;d.settings.offset_y=l.y;h.selection.select(f);l=k.getPos(f);d.showMenu(l.x,l.y+f.offsetHeight-g.y);return tinymce.dom.Event.cancel(j)}else{d.hideMenu()}},_checkDone:function(){var e=this,d=e.editor,g=d.dom,f;c(g.select(&quot;span&quot;),function(h){if(h&amp;&amp;g.hasClass(h,&quot;mceItemHiddenSpellWord&quot;)){f=true;return false}});if(!f){e._done()}},_done:function(){var d=this,e=d.active;if(d.active){d.active=0;d._removeWords();if(d._menu){d._menu.hideMenu()}if(e){d.editor.nodeChanged()}}},_sendRPC:function(e,g,d){var f=this;a.sendRPC({url:f.rpcUrl,method:e,params:g,success:d,error:function(i,h){f.editor.setProgressState(0);f.editor.windowManager.alert(i.errstr||(&quot;Error response: &quot;+h.responseText))}})}});tinymce.PluginManager.add(&quot;spe
 llchecker&quot;,tinymce.plugins.SpellcheckerPlugin)})();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjstinymcewptinymcejsgz"></a>
<div class="binary"><h4>Modified: trunk/wp-includes/js/tinymce/wp-tinymce.js.gz</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkwpincludesversionphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/version.php (19177 => 19178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/version.php        2011-11-05 18:09:38 UTC (rev 19177)
+++ trunk/wp-includes/version.php        2011-11-05 18:32:47 UTC (rev 19178)
</span><span class="lines">@@ -18,7 +18,7 @@
</span><span class="cx">  *
</span><span class="cx">  * @global string $tinymce_version
</span><span class="cx">  */
</span><del>-$tinymce_version = '345-20110918';
</del><ins>+$tinymce_version = '345-20111105';
</ins><span class="cx"> 
</span><span class="cx"> /**
</span><span class="cx">  * Holds the cache manifest version
</span></span></pre>
</div>
</div>

</body>
</html>