<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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 #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#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>
<title>[17687] trunk/wp-includes: Use wpLink in the HTML editor too,
  props koopersmith, fixes #16631</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/17687">17687</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2011-04-23 02:12:56 +0000 (Sat, 23 Apr 2011)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use wpLink in the HTML editor too, props koopersmith, fixes <a href="http://trac.wordpress.org/ticket/16631">#16631</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesjsquicktagsdevjs">trunk/wp-includes/js/quicktags.dev.js</a></li>
<li><a href="#trunkwpincludesjsquicktagsjs">trunk/wp-includes/js/quicktags.js</a></li>
<li><a href="#trunkwpincludesjstinymcepluginswpdialogseditor_plugindevjs">trunk/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.dev.js</a></li>
<li><a href="#trunkwpincludesjstinymcepluginswpdialogseditor_pluginjs">trunk/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.js</a></li>
<li><a href="#trunkwpincludesjstinymcepluginswplinkjswplinkdevjs">trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.dev.js</a></li>
<li><a href="#trunkwpincludesjstinymcepluginswplinkjswplinkjs">trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.js</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkwpincludesjstinymcepluginswpdialogsjswpdialogdevjs">trunk/wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.dev.js</a></li>
<li><a href="#trunkwpincludesjstinymcepluginswpdialogsjswpdialogjs">trunk/wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesjsquicktagsdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/quicktags.dev.js (17686 => 17687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/quicktags.dev.js        2011-04-22 19:09:48 UTC (rev 17686)
+++ trunk/wp-includes/js/quicktags.dev.js        2011-04-23 02:12:56 UTC (rev 17687)
</span><span class="lines">@@ -360,19 +360,23 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function edInsertLink(myField, i, defaultValue) {
</span><del>-        if (!defaultValue) {
-                defaultValue = 'http://';
-        }
-        if (!edCheckOpenTags(i)) {
-                var URL = prompt(quicktagsL10n.enterURL, defaultValue);
-                if (URL) {
-                        edButtons[i].tagStart = '&lt;a href=&quot;' + URL + '&quot;&gt;';
</del><ins>+        if ( 'object' == typeof(wpLink) ) {
+                wpLink.open();
+        } else {
+                if (!defaultValue) {
+                        defaultValue = 'http://';
+                }
+                if (!edCheckOpenTags(i)) {
+                        var URL = prompt(quicktagsL10n.enterURL, defaultValue);
+                        if (URL) {
+                                edButtons[i].tagStart = '&lt;a href=&quot;' + URL + '&quot;&gt;';
+                                edInsertTag(myField, i);
+                        }
+                }
+                else {
</ins><span class="cx">                         edInsertTag(myField, i);
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        else {
-                edInsertTag(myField, i);
-        }
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function edInsertImage(myField) {
</span></span></pre></div>
<a id="trunkwpincludesjsquicktagsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/quicktags.js (17686 => 17687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/quicktags.js        2011-04-22 19:09:48 UTC (rev 17686)
+++ trunk/wp-includes/js/quicktags.js        2011-04-23 02:12:56 UTC (rev 17687)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var edButtons=new Array(),edLinks=new Array(),edOpenTags=new Array(),now=new Date(),datetime;function edButton(f,e,c,b,a,d){this.id=f;this.display=e;this.tagStart=c;this.tagEnd=b;this.access=a;this.open=d}function zeroise(b,a){var c=b.toString();if(b&lt;0){c=c.substr(1,c.length)}while(c.length&lt;a){c=&quot;0&quot;+c}if(b&lt;0){c=&quot;-&quot;+c}return c}datetime=now.getUTCFullYear()+&quot;-&quot;+zeroise(now.getUTCMonth()+1,2)+&quot;-&quot;+zeroise(now.getUTCDate(),2)+&quot;T&quot;+zeroise(now.getUTCHours(),2)+&quot;:&quot;+zeroise(now.getUTCMinutes(),2)+&quot;:&quot;+zeroise(now.getUTCSeconds(),2)+&quot;+00:00&quot;;edButtons[edButtons.length]=new edButton(&quot;ed_strong&quot;,&quot;b&quot;,&quot;&lt;strong&gt;&quot;,&quot;&lt;/strong&gt;&quot;,&quot;b&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_em&quot;,&quot;i&quot;,&quot;&lt;em&gt;&quot;,&quot;&lt;/em&gt;&quot;,&quot;i&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_link&quot;,&quot;link&quot;,&quot;&quot;,&quot;&lt;/a&gt;&quot;,&quot;a&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_block&quot;,&quot;b-quote&quot;,&quot;\n\n&lt;blockquote&gt;&quot;,&quot;&lt;/blockquote&gt;\n\n&quot;,&quot;q&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_del&quot;,&quot;del&quot;,'&lt;del datetime=&quot;'+datetime+'&quot;&gt;',&quot;&lt;/del&gt;&quot;,&quot;d&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_ins&quot;,&quot;ins&quot;,'&lt;ins datetime=&quot;'+datetime+'&quot;&gt;',&quot;&lt;/ins&gt;&quot;,&quot;s&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_img&quot;,&quot;img&quot;,&quot;&quot;,&quot;&quot;,&quot;m&quot;,-1);edButtons[edButtons.length]=new edButton(&quot;ed_ul&quot;,&quot;ul&quot;,&quot;&lt;ul&gt;\n&quot;,&quot;&lt;/ul&gt;\n\n&quot;,&quot;u&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_ol&quot;,&quot;ol&quot;,&quot;&lt;ol&gt;\n&quot;,&quot;&lt;/ol&gt;\n\n&quot;,&quot;o&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_li&quot;,&quot;li&quot;,&quot;\t&lt;li&gt;&quot;,&quot;&lt;/li&gt;\n&quot;,&quot;l&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_code&quot;,&quot;code&quot;,&quot;&lt;code&gt;&quot;,&quot;&lt;/code&gt;&quot;,&quot;c&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_more&quot;,&quot;more&quot;,&quot;&lt;!--more--&gt;&quot;,&quot;&quot;,&quot;t&quot;,-1);function edLink(){this.display=&quot;&quot;;this.URL=&quot;&quot;;this.newWin=0}edLinks[edLinks.length]=new edLink(&quot;WordPress&quot;,&quot;http://wordpress.org/&quot;);edLinks[edLinks.length]=new edLink(&quot;alexking.org&quot;,&quot;http://www.alexking.org/&quot;);function edShowButton(b,a){if(b.id==&quot;ed_img&quot;){document.write('&lt;input type=&quot;button&quot; id=&quot;'+b.id+'&quot; accesskey=&quot;'+b.access+'&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertImage(edCanvas);&quot; value=&quot;'+b.display+'&quot; /&gt;')}else{if(b.id==&quot;ed_link&quot;){document.write('&lt;input type=&quot;button&quot; id=&quot;'+b.id+'&quot; accesskey=&quot;'+b.access+'&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertLink(edCanvas, '+a+');&quot; value=&quot;'+b.display+'&quot; /&gt;')}else{document.write('&lt;input type=&quot;button&quot; id=&quot;'+b.id+'&quot; accesskey=&quot;'+b.access+'&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertTag(edCanvas, '+a+');&quot; value=&quot;'+b.display+'&quot;  /&gt;')}}}function edShowLinks(){var a='&lt;select onchange=&quot;edQuickLink(this.options[this.selectedIndex].value, this);&quot;&gt;&lt;option value=&quot;-1&quot; selected&gt;'+quicktagsL10n.quickLinks+&quot;&lt;/option&gt;&quot;,b;for(b=0;b&lt;edLinks.length;b++){a+='&lt;option value=&quot;'+b+'&quot;&gt;'+edLinks[b].display+&quot;&lt;/option&gt;&quot;}a+=&quot;&lt;/select&gt;&quot;;document.write(a)}function edAddTag(a){if(edButtons[a].tagEnd!=&quot;&quot;){edOpenTags[edOpenTags.length]=a;document.getElementById(edButtons[a].id).value=&quot;/&quot;+document.getElementById(edButtons[a].id).value}}function edRemoveTag(b){for(var a=0;a&lt;edOpenTags.length;a++){if(edOpenTags[a]==b){edOpenTags.splice(a,1);document.getElementById(edButtons[b].id).value=document.getElementById(edButtons[b].id).value.replace(&quot;/&quot;,&quot;&quot;)}}}function edCheckOpenTags(c){var a=0,b;for(b=0;b&lt;edOpenTags.length;b++){if(edOpenTags[b]==c){a++}}if(a&gt;0){return true}else{return false}}function edCloseAllTags(){var a=edOpenTags.length,b;for(b=0;b&lt;a;b++){edInsertTag(edCanvas,edOpenTags[edOpenTags.length-1])}}function edQuickLink(c,d){if(c&gt;-1){var b=&quot;&quot;,a;if(edLinks[c].newWin==1){b=' target=&quot;_blank&quot;'}a='&lt;a href=&quot;'+edLinks[c].URL+'&quot;'+b+&quot;&gt;&quot;+edLinks[c].display+&quot;&lt;/a&gt;&quot;;d.selectedIndex=0;edInsertContent(edCanvas,a)}else{d.selectedIndex=0}}function edSpell(c){var e=&quot;&quot;,d,b,a;if(document.selection){c.focus();d=document.selection.createRange();if(d.text.length&gt;0){e=d.text}}else{if(c.selectionStart||c.selectionStart==&quot;0&quot;){b=c.selectionStart;a=c.selectionEnd;if(b!=a){e=c.value.substring(b,a)}}}if(e==&quot;&quot;){e=prompt(quicktagsL10n.wordLookup,&quot;&quot;)}if(e!==null&amp;&amp;/^\w[\w ]*$/.test(e)){window.open(&quot;http://www.answers.com/&quot;+escape(e))}}function edToolbar(){document.write('&lt;div id=&quot;ed_toolbar&quot;&gt;');for(var a=0;a&lt;edButtons.length;a++){edShowButton(edButtons[a],a)}document.write('&lt;input type=&quot;button&quot; id=&quot;ed_spell&quot; class=&quot;ed_button&quot; onclick=&quot;edSpell(edCanvas);&quot; title=&quot;'+quicktagsL10n.dictionaryLookup+'&quot; value=&quot;'+quicktagsL10n.lookup+'&quot; /&gt;');document.write('&lt;input type=&quot;button&quot; id=&quot;ed_close&quot; class=&quot;ed_button&quot; onclick=&quot;edCloseAllTags();&quot; title=&quot;'+quicktagsL10n.closeAllOpenTags+'&quot; value=&quot;'+quicktagsL10n.closeTags+'&quot; /&gt;');document.write(&quot;&lt;/div&gt;&quot;)}function edInsertTag(d,c){if(document.selection){d.focus();var e=document.selection.createRange();if(e.text.length&gt;0){e.text=edButtons[c].tagStart+e.text+edButtons[c].tagEnd}else{if(!edCheckOpenTags(c)||edButtons[c].tagEnd==&quot;&quot;){e.text=edButtons[c].tagStart;edAddTag(c)}else{e.text=edButtons[c].tagEnd;edRemoveTag(c)}}d.focus()}else{if(d.selectionStart||d.selectionStart==&quot;0&quot;){var b=d.selectionStart,a=d.selectionEnd,g=a,f=d.scrollTop;if(b!=a){d.value=d.value.substring(0,b)+edButtons[c].tagStart+d.value.substring(b,a)+edButtons[c].tagEnd+d.value.substring(a,d.value.length);g+=edButtons[c].tagStart.length+edButtons[c].tagEnd.length}else{if(!edCheckOpenTags(c)||edButtons[c].tagEnd==&quot;&quot;){d.value=d.value.substring(0,b)+edButtons[c].tagStart+d.value.substring(a,d.value.length);edAddTag(c);g=b+edButtons[c].tagStart.length}else{d.value=d.value.substring(0,b)+edButtons[c].tagEnd+d.value.substring(a,d.value.length);edRemoveTag(c);g=b+edButtons[c].tagEnd.length}}d.focus();d.selectionStart=g;d.selectionEnd=g;d.scrollTop=f}else{if(!edCheckOpenTags(c)||edButtons[c].tagEnd==&quot;&quot;){d.value+=edButtons[c].tagStart;edAddTag(c)}else{d.value+=edButtons[c].tagEnd;edRemoveTag(c)}d.focus()}}}function edInsertContent(d,c){var e,b,a,f;if(document.selection){d.focus();e=document.selection.createRange();e.text=c;d.focus()}else{if(d.selectionStart||d.selectionStart==&quot;0&quot;){b=d.selectionStart;a=d.selectionEnd;f=d.scrollTop;d.value=d.value.substring(0,b)+c+d.value.substring(a,d.value.length);d.focus();d.selectionStart=b+c.length;d.selectionEnd=b+c.length;d.scrollTop=f}else{d.value+=c;d.focus()}}}function edInsertLink(d,c,b){if(!b){b=&quot;http://&quot;}if(!edCheckOpenTags(c)){var a=prompt(quicktagsL10n.enterURL,b);if(a){edButtons[c].tagStart='&lt;a href=&quot;'+a+'&quot;&gt;';edInsertTag(d,c)}}else{edInsertTag(d,c)}}function edInsertImage(b){var a=prompt(quicktagsL10n.enterImageURL,&quot;http://&quot;);if(a){a='&lt;img src=&quot;'+a+'&quot; alt=&quot;'+prompt(quicktagsL10n.enterImageDescription,&quot;&quot;)+'&quot; /&gt;';edInsertContent(b,a)}}var QTags=function(a,c,b,f){var j=this,k=document.getElementById(b),g,l,e,h,d;j.Buttons=[];j.Links=[];j.OpenTags=[];j.Canvas=document.getElementById(c);if(!j.Canvas||!k){return}f=(typeof f!=&quot;undefined&quot;)?&quot;,&quot;+f+&quot;,&quot;:&quot;&quot;;j.edShowButton=function(n,m){if(f&amp;&amp;(f.indexOf(&quot;,&quot;+n.display+&quot;,&quot;)!=-1)){return&quot;&quot;}else{if(n.id==a+&quot;_img&quot;){return'&lt;input type=&quot;button&quot; id=&quot;'+n.id+'&quot; accesskey=&quot;'+n.access+'&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertImage('+a+'.Canvas);&quot; value=&quot;'+n.display+'&quot; /&gt;'}else{if(n.id==a+&quot;_link&quot;){return'&lt;input type=&quot;button&quot; id=&quot;'+n.id+'&quot; accesskey=&quot;'+n.access+'&quot; class=&quot;ed_button&quot; onclick=&quot;'+a+&quot;.edInsertLink(&quot;+m+');&quot; value=&quot;'+n.display+'&quot; /&gt;'}else{return'&lt;input type=&quot;button&quot; id=&quot;'+n.id+'&quot; accesskey=&quot;'+n.access+'&quot; class=&quot;ed_button&quot; onclick=&quot;'+a+&quot;.edInsertTag(&quot;+m+');&quot; value=&quot;'+n.display+'&quot; /&gt;'}}}};j.edAddTag=function(i){if(j.Buttons[i].tagEnd!=&quot;&quot;){j.OpenTags[j.OpenTags.length]=i;document.getElementById(j.Buttons[i].id).value=&quot;/&quot;+document.getElementById(j.Buttons[i].id).value}};j.edRemoveTag=function(i){for(g=0;g&lt;j.OpenTags.length;g++){if(j.OpenTags[g]==i){j.OpenTags.splice(g,1);document.getElementById(j.Buttons[i].id).value=document.getElementById(j.Buttons[i].id).value.replace(&quot;/&quot;,&quot;&quot;)}}};j.edCheckOpenTags=function(n){l=0;for(var m=0;m&lt;j.OpenTags.length;m++){if(j.OpenTags[m]==n){l++}}if(l&gt;0){return true}else{return false}};this.edCloseAllTags=function(){var i=j.OpenTags.length;for(var m=0;m&lt;i;m++){j.edInsertTag(j.OpenTags[j.OpenTags.length-1])}};this.edQuickLink=function(o,p){if(o&gt;-1){var n=&quot;&quot;,m;if(Links[o].newWin==1){n=' target=&quot;_blank&quot;'}m='&lt;a href=&quot;'+Links[o].URL+'&quot;'+n+&quot;&gt;&quot;+Links[o].display+&quot;&lt;/a&gt;&quot;;p.selectedIndex=0;edInsertContent(j.Canvas,m)}else{p.selectedIndex=0}};j.edInsertTag=function(o){if(document.selection){j.Canvas.focus();d=document.selection.createRange();if(d.text.length&gt;0){d.text=j.Buttons[o].tagStart+d.text+j.Buttons[o].tagEnd}else{if(!j.edCheckOpenTags(o)||j.Buttons[o].tagEnd==&quot;&quot;){d.text=j.Buttons[o].tagStart;j.edAddTag(o)}else{d.text=j.Buttons[o].tagEnd;j.edRemoveTag(o)}}j.Canvas.focus()}else{if(j.Canvas.selectionStart||j.Canvas.selectionStart==&quot;0&quot;){var n=j.Canvas.selectionStart,m=j.Canvas.selectionEnd,q=m,p=j.Canvas.scrollTop;if(n!=m){j.Canvas.value=j.Canvas.value.substring(0,n)+j.Buttons[o].tagStart+j.Canvas.value.substring(n,m)+j.Buttons[o].tagEnd+j.Canvas.value.substring(m,j.Canvas.value.length);q+=j.Buttons[o].tagStart.length+j.Buttons[o].tagEnd.length}else{if(!j.edCheckOpenTags(o)||j.Buttons[o].tagEnd==&quot;&quot;){j.Canvas.value=j.Canvas.value.substring(0,n)+j.Buttons[o].tagStart+j.Canvas.value.substring(m,j.Canvas.value.length);j.edAddTag(o);q=n+j.Buttons[o].tagStart.length}else{j.Canvas.value=j.Canvas.value.substring(0,n)+j.Buttons[o].tagEnd+j.Canvas.value.substring(m,j.Canvas.value.length);j.edRemoveTag(o);q=n+j.Buttons[o].tagEnd.length}}j.Canvas.focus();j.Canvas.selectionStart=q;j.Canvas.selectionEnd=q;j.Canvas.scrollTop=p}else{if(!j.edCheckOpenTags(o)||j.Buttons[o].tagEnd==&quot;&quot;){j.Canvas.value+=Buttons[o].tagStart;j.edAddTag(o)}else{j.Canvas.value+=Buttons[o].tagEnd;j.edRemoveTag(o)}j.Canvas.focus()}}};this.edInsertLink=function(o,n){if(!n){n=&quot;http://&quot;}if(!j.edCheckOpenTags(o)){var m=prompt(quicktagsL10n.enterURL,n);if(m){j.Buttons[o].tagStart='&lt;a href=&quot;'+m+'&quot;&gt;';j.edInsertTag(o)}}else{j.edInsertTag(o)}};this.edInsertImage=function(){var i=prompt(quicktagsL10n.enterImageURL,&quot;http://&quot;);if(i){i='&lt;img src=&quot;'+i+'&quot; alt=&quot;'+prompt(quicktagsL10n.enterImageDescription,&quot;&quot;)+'&quot; /&gt;';edInsertContent(j.Canvas,i)}};j.Buttons[j.Buttons.length]=new edButton(a+&quot;_strong&quot;,&quot;b&quot;,&quot;&lt;strong&gt;&quot;,&quot;&lt;/strong&gt;&quot;,&quot;b&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_em&quot;,&quot;i&quot;,&quot;&lt;em&gt;&quot;,&quot;&lt;/em&gt;&quot;,&quot;i&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_link&quot;,&quot;link&quot;,&quot;&quot;,&quot;&lt;/a&gt;&quot;,&quot;a&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_block&quot;,&quot;b-quote&quot;,&quot;\n\n&lt;blockquote&gt;&quot;,&quot;&lt;/blockquote&gt;\n\n&quot;,&quot;q&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_del&quot;,&quot;del&quot;,'&lt;del datetime=&quot;'+datetime+'&quot;&gt;',&quot;&lt;/del&gt;&quot;,&quot;d&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_ins&quot;,&quot;ins&quot;,'&lt;ins datetime=&quot;'+datetime+'&quot;&gt;',&quot;&lt;/ins&gt;&quot;,&quot;s&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_img&quot;,&quot;img&quot;,&quot;&quot;,&quot;&quot;,&quot;m&quot;,-1);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_ul&quot;,&quot;ul&quot;,&quot;&lt;ul&gt;\n&quot;,&quot;&lt;/ul&gt;\n\n&quot;,&quot;u&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_ol&quot;,&quot;ol&quot;,&quot;&lt;ol&gt;\n&quot;,&quot;&lt;/ol&gt;\n\n&quot;,&quot;o&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_li&quot;,&quot;li&quot;,&quot;\t&lt;li&gt;&quot;,&quot;&lt;/li&gt;\n&quot;,&quot;l&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_code&quot;,&quot;code&quot;,&quot;&lt;code&gt;&quot;,&quot;&lt;/code&gt;&quot;,&quot;c&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_more&quot;,&quot;more&quot;,&quot;&lt;!--more--&gt;&quot;,&quot;&quot;,&quot;t&quot;,-1);e=document.createElement(&quot;div&quot;);e.id=a+&quot;_qtags&quot;;h='&lt;div id=&quot;'+a+'_toolbar&quot;&gt;';for(g=0;g&lt;j.Buttons.length;g++){h+=j.edShowButton(j.Buttons[g],g)}h+='&lt;input type=&quot;button&quot; id=&quot;'+a+'_ed_spell&quot; class=&quot;ed_button&quot; onclick=&quot;edSpell('+a+'.Canvas);&quot; title=&quot;'+quicktagsL10n.dictionaryLookup+'&quot; value=&quot;'+quicktagsL10n.lookup+'&quot; /&gt;';h+='&lt;input type=&quot;button&quot; id=&quot;'+a+'_ed_close&quot; class=&quot;ed_button&quot; onclick=&quot;'+a+'.edCloseAllTags();&quot; title=&quot;'+quicktagsL10n.closeAllOpenTags+'&quot; value=&quot;'+quicktagsL10n.closeTags+'&quot; /&gt;&lt;/div&gt;';e.innerHTML=h;k.parentNode.insertBefore(e,k)};
</del><span class="cx">\ No newline at end of file
</span><ins>+var edButtons=new Array(),edLinks=new Array(),edOpenTags=new Array(),now=new Date(),datetime;function edButton(f,e,c,b,a,d){this.id=f;this.display=e;this.tagStart=c;this.tagEnd=b;this.access=a;this.open=d}function zeroise(b,a){var c=b.toString();if(b&lt;0){c=c.substr(1,c.length)}while(c.length&lt;a){c=&quot;0&quot;+c}if(b&lt;0){c=&quot;-&quot;+c}return c}datetime=now.getUTCFullYear()+&quot;-&quot;+zeroise(now.getUTCMonth()+1,2)+&quot;-&quot;+zeroise(now.getUTCDate(),2)+&quot;T&quot;+zeroise(now.getUTCHours(),2)+&quot;:&quot;+zeroise(now.getUTCMinutes(),2)+&quot;:&quot;+zeroise(now.getUTCSeconds(),2)+&quot;+00:00&quot;;edButtons[edButtons.length]=new edButton(&quot;ed_strong&quot;,&quot;b&quot;,&quot;&lt;strong&gt;&quot;,&quot;&lt;/strong&gt;&quot;,&quot;b&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_em&quot;,&quot;i&quot;,&quot;&lt;em&gt;&quot;,&quot;&lt;/em&gt;&quot;,&quot;i&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_link&quot;,&quot;link&quot;,&quot;&quot;,&quot;&lt;/a&gt;&quot;,&quot;a&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_block&quot;,&quot;b-quote&quot;,&quot;\n\n&lt;blockquote&gt;&quot;,&quot;&lt;/blockquote&gt;\n\n&quot;,&quot;q&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_del&quot;,&quot;del&quot;,'&lt;del datetime=&quot;'+datetime+'&quot;&gt;',&quot;&lt;/del&gt;&quot;,&quot;d&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_ins&quot;,&quot;ins&quot;,'&lt;ins datetime=&quot;'+datetime+'&quot;&gt;',&quot;&lt;/ins&gt;&quot;,&quot;s&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_img&quot;,&quot;img&quot;,&quot;&quot;,&quot;&quot;,&quot;m&quot;,-1);edButtons[edButtons.length]=new edButton(&quot;ed_ul&quot;,&quot;ul&quot;,&quot;&lt;ul&gt;\n&quot;,&quot;&lt;/ul&gt;\n\n&quot;,&quot;u&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_ol&quot;,&quot;ol&quot;,&quot;&lt;ol&gt;\n&quot;,&quot;&lt;/ol&gt;\n\n&quot;,&quot;o&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_li&quot;,&quot;li&quot;,&quot;\t&lt;li&gt;&quot;,&quot;&lt;/li&gt;\n&quot;,&quot;l&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_code&quot;,&quot;code&quot;,&quot;&lt;code&gt;&quot;,&quot;&lt;/code&gt;&quot;,&quot;c&quot;);edButtons[edButtons.length]=new edButton(&quot;ed_more&quot;,&quot;more&quot;,&quot;&lt;!--more--&gt;&quot;,&quot;&quot;,&quot;t&quot;,-1);function edLink(){this.display=&quot;&quot;;this.URL=&quot;&quot;;this.newWin=0}edLinks[edLinks.length]=new edLink(&quot;WordPress&quot;,&quot;http://wordpress.org/&quot;);edLinks[edLinks.length]=new edLink(&quot;alexking.org&quot;,&quot;http://www.alexking.org/&quot;);function edShowButton(b,a){if(b.id==&quot;ed_img&quot;){document.write('&lt;input type=&quot;button&quot; id=&quot;'+b.id+'&quot; accesskey=&quot;'+b.access+'&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertImage(edCanvas);&quot; value=&quot;'+b.display+'&quot; /&gt;')}else{if(b.id==&quot;ed_link&quot;){document.write('&lt;input type=&quot;button&quot; id=&quot;'+b.id+'&quot; accesskey=&quot;'+b.access+'&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertLink(edCanvas, '+a+');&quot; value=&quot;'+b.display+'&quot; /&gt;')}else{document.write('&lt;input type=&quot;button&quot; id=&quot;'+b.id+'&quot; accesskey=&quot;'+b.access+'&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertTag(edCanvas, '+a+');&quot; value=&quot;'+b.display+'&quot;  /&gt;')}}}function edShowLinks(){var a='&lt;select onchange=&quot;edQuickLink(this.options[this.selectedIndex].value, this);&quot;&gt;&lt;option value=&quot;-1&quot; selected&gt;'+quicktagsL10n.quickLinks+&quot;&lt;/option&gt;&quot;,b;for(b=0;b&lt;edLinks.length;b++){a+='&lt;option value=&quot;'+b+'&quot;&gt;'+edLinks[b].display+&quot;&lt;/option&gt;&quot;}a+=&quot;&lt;/select&gt;&quot;;document.write(a)}function edAddTag(a){if(edButtons[a].tagEnd!=&quot;&quot;){edOpenTags[edOpenTags.length]=a;document.getElementById(edButtons[a].id).value=&quot;/&quot;+document.getElementById(edButtons[a].id).value}}function edRemoveTag(b){for(var a=0;a&lt;edOpenTags.length;a++){if(edOpenTags[a]==b){edOpenTags.splice(a,1);document.getElementById(edButtons[b].id).value=document.getElementById(edButtons[b].id).value.replace(&quot;/&quot;,&quot;&quot;)}}}function edCheckOpenTags(c){var a=0,b;for(b=0;b&lt;edOpenTags.length;b++){if(edOpenTags[b]==c){a++}}if(a&gt;0){return true}else{return false}}function edCloseAllTags(){var a=edOpenTags.length,b;for(b=0;b&lt;a;b++){edInsertTag(edCanvas,edOpenTags[edOpenTags.length-1])}}function edQuickLink(c,d){if(c&gt;-1){var b=&quot;&quot;,a;if(edLinks[c].newWin==1){b=' target=&quot;_blank&quot;'}a='&lt;a href=&quot;'+edLinks[c].URL+'&quot;'+b+&quot;&gt;&quot;+edLinks[c].display+&quot;&lt;/a&gt;&quot;;d.selectedIndex=0;edInsertContent(edCanvas,a)}else{d.selectedIndex=0}}function edSpell(c){var e=&quot;&quot;,d,b,a;if(document.selection){c.focus();d=document.selection.createRange();if(d.text.length&gt;0){e=d.text}}else{if(c.selectionStart||c.selectionStart==&quot;0&quot;){b=c.selectionStart;a=c.selectionEnd;if(b!=a){e=c.value.substring(b,a)}}}if(e==&quot;&quot;){e=prompt(quicktagsL10n.wordLookup,&quot;&quot;)}if(e!==null&amp;&amp;/^\w[\w ]*$/.test(e)){window.open(&quot;http://www.answers.com/&quot;+escape(e))}}function edToolbar(){document.write('&lt;div id=&quot;ed_toolbar&quot;&gt;');for(var a=0;a&lt;edButtons.length;a++){edShowButton(edButtons[a],a)}document.write('&lt;input type=&quot;button&quot; id=&quot;ed_spell&quot; class=&quot;ed_button&quot; onclick=&quot;edSpell(edCanvas);&quot; title=&quot;'+quicktagsL10n.dictionaryLookup+'&quot; value=&quot;'+quicktagsL10n.lookup+'&quot; /&gt;');document.write('&lt;input type=&quot;button&quot; id=&quot;ed_close&quot; class=&quot;ed_button&quot; onclick=&quot;edCloseAllTags();&quot; title=&quot;'+quicktagsL10n.closeAllOpenTags+'&quot; value=&quot;'+quicktagsL10n.closeTags+'&quot; /&gt;');document.write(&quot;&lt;/div&gt;&quot;)}function edInsertTag(d,c){if(document.selection){d.focus();var e=document.selection.createRange();if(e.text.length&gt;0){e.text=edButtons[c].tagStart+e.text+edButtons[c].tagEnd}else{if(!edCheckOpenTags(c)||edButtons[c].tagEnd==&quot;&quot;){e.text=edButtons[c].tagStart;edAddTag(c)}else{e.text=edButtons[c].tagEnd;edRemoveTag(c)}}d.focus()}else{if(d.selectionStart||d.selectionStart==&quot;0&quot;){var b=d.selectionStart,a=d.selectionEnd,g=a,f=d.scrollTop;if(b!=a){d.value=d.value.substring(0,b)+edButtons[c].tagStart+d.value.substring(b,a)+edButtons[c].tagEnd+d.value.substring(a,d.value.length);g+=edButtons[c].tagStart.length+edButtons[c].tagEnd.length}else{if(!edCheckOpenTags(c)||edButtons[c].tagEnd==&quot;&quot;){d.value=d.value.substring(0,b)+edButtons[c].tagStart+d.value.substring(a,d.value.length);edAddTag(c);g=b+edButtons[c].tagStart.length}else{d.value=d.value.substring(0,b)+edButtons[c].tagEnd+d.value.substring(a,d.value.length);edRemoveTag(c);g=b+edButtons[c].tagEnd.length}}d.focus();d.selectionStart=g;d.selectionEnd=g;d.scrollTop=f}else{if(!edCheckOpenTags(c)||edButtons[c].tagEnd==&quot;&quot;){d.value+=edButtons[c].tagStart;edAddTag(c)}else{d.value+=edButtons[c].tagEnd;edRemoveTag(c)}d.focus()}}}function edInsertContent(d,c){var e,b,a,f;if(document.selection){d.focus();e=document.selection.createRange();e.text=c;d.focus()}else{if(d.selectionStart||d.selectionStart==&quot;0&quot;){b=d.selectionStart;a=d.selectionEnd;f=d.scrollTop;d.value=d.value.substring(0,b)+c+d.value.substring(a,d.value.length);d.focus();d.selectionStart=b+c.length;d.selectionEnd=b+c.length;d.scrollTop=f}else{d.value+=c;d.focus()}}}function edInsertLink(d,c,b){if(&quot;object&quot;==typeof(wpLink)){wpLink.open()}else{if(!b){b=&quot;http://&quot;}if(!edCheckOpenTags(c)){var a=prompt(quicktagsL10n.enterURL,b);if(a){edButtons[c].tagStart='&lt;a href=&quot;'+a+'&quot;&gt;';edInsertTag(d,c)}}else{edInsertTag(d,c)}}}function edInsertImage(b){var a=prompt(quicktagsL10n.enterImageURL,&quot;http://&quot;);if(a){a='&lt;img src=&quot;'+a+'&quot; alt=&quot;'+prompt(quicktagsL10n.enterImageDescription,&quot;&quot;)+'&quot; /&gt;';edInsertContent(b,a)}}var QTags=function(a,c,b,f){var j=this,k=document.getElementById(b),g,l,e,h,d;j.Buttons=[];j.Links=[];j.OpenTags=[];j.Canvas=document.getElementById(c);if(!j.Canvas||!k){return}f=(typeof f!=&quot;undefined&quot;)?&quot;,&quot;+f+&quot;,&quot;:&quot;&quot;;j.edShowButton=function(n,m){if(f&amp;&amp;(f.indexOf(&quot;,&quot;+n.display+&quot;,&quot;)!=-1)){return&quot;&quot;}else{if(n.id==a+&quot;_img&quot;){return'&lt;input type=&quot;button&quot; id=&quot;'+n.id+'&quot; accesskey=&quot;'+n.access+'&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertImage('+a+'.Canvas);&quot; value=&quot;'+n.display+'&quot; /&gt;'}else{if(n.id==a+&quot;_link&quot;){return'&lt;input type=&quot;button&quot; id=&quot;'+n.id+'&quot; accesskey=&quot;'+n.access+'&quot; class=&quot;ed_button&quot; onclick=&quot;'+a+&quot;.edInsertLink(&quot;+m+');&quot; value=&quot;'+n.display+'&quot; /&gt;'}else{return'&lt;input type=&quot;button&quot; id=&quot;'+n.id+'&quot; accesskey=&quot;'+n.access+'&quot; class=&quot;ed_button&quot; onclick=&quot;'+a+&quot;.edInsertTag(&quot;+m+');&quot; value=&quot;'+n.display+'&quot; /&gt;'}}}};j.edAddTag=function(i){if(j.Buttons[i].tagEnd!=&quot;&quot;){j.OpenTags[j.OpenTags.length]=i;document.getElementById(j.Buttons[i].id).value=&quot;/&quot;+document.getElementById(j.Buttons[i].id).value}};j.edRemoveTag=function(i){for(g=0;g&lt;j.OpenTags.length;g++){if(j.OpenTags[g]==i){j.OpenTags.splice(g,1);document.getElementById(j.Buttons[i].id).value=document.getElementById(j.Buttons[i].id).value.replace(&quot;/&quot;,&quot;&quot;)}}};j.edCheckOpenTags=function(n){l=0;for(var m=0;m&lt;j.OpenTags.length;m++){if(j.OpenTags[m]==n){l++}}if(l&gt;0){return true}else{return false}};this.edCloseAllTags=function(){var i=j.OpenTags.length;for(var m=0;m&lt;i;m++){j.edInsertTag(j.OpenTags[j.OpenTags.length-1])}};this.edQuickLink=function(o,p){if(o&gt;-1){var n=&quot;&quot;,m;if(Links[o].newWin==1){n=' target=&quot;_blank&quot;'}m='&lt;a href=&quot;'+Links[o].URL+'&quot;'+n+&quot;&gt;&quot;+Links[o].display+&quot;&lt;/a&gt;&quot;;p.selectedIndex=0;edInsertContent(j.Canvas,m)}else{p.selectedIndex=0}};j.edInsertTag=function(o){if(document.selection){j.Canvas.focus();d=document.selection.createRange();if(d.text.length&gt;0){d.text=j.Buttons[o].tagStart+d.text+j.Buttons[o].tagEnd}else{if(!j.edCheckOpenTags(o)||j.Buttons[o].tagEnd==&quot;&quot;){d.text=j.Buttons[o].tagStart;j.edAddTag(o)}else{d.text=j.Buttons[o].tagEnd;j.edRemoveTag(o)}}j.Canvas.focus()}else{if(j.Canvas.selectionStart||j.Canvas.selectionStart==&quot;0&quot;){var n=j.Canvas.selectionStart,m=j.Canvas.selectionEnd,q=m,p=j.Canvas.scrollTop;if(n!=m){j.Canvas.value=j.Canvas.value.substring(0,n)+j.Buttons[o].tagStart+j.Canvas.value.substring(n,m)+j.Buttons[o].tagEnd+j.Canvas.value.substring(m,j.Canvas.value.length);q+=j.Buttons[o].tagStart.length+j.Buttons[o].tagEnd.length}else{if(!j.edCheckOpenTags(o)||j.Buttons[o].tagEnd==&quot;&quot;){j.Canvas.value=j.Canvas.value.substring(0,n)+j.Buttons[o].tagStart+j.Canvas.value.substring(m,j.Canvas.value.length);j.edAddTag(o);q=n+j.Buttons[o].tagStart.length}else{j.Canvas.value=j.Canvas.value.substring(0,n)+j.Buttons[o].tagEnd+j.Canvas.value.substring(m,j.Canvas.value.length);j.edRemoveTag(o);q=n+j.Buttons[o].tagEnd.length}}j.Canvas.focus();j.Canvas.selectionStart=q;j.Canvas.selectionEnd=q;j.Canvas.scrollTop=p}else{if(!j.edCheckOpenTags(o)||j.Buttons[o].tagEnd==&quot;&quot;){j.Canvas.value+=Buttons[o].tagStart;j.edAddTag(o)}else{j.Canvas.value+=Buttons[o].tagEnd;j.edRemoveTag(o)}j.Canvas.focus()}}};this.edInsertLink=function(o,n){if(!n){n=&quot;http://&quot;}if(!j.edCheckOpenTags(o)){var m=prompt(quicktagsL10n.enterURL,n);if(m){j.Buttons[o].tagStart='&lt;a href=&quot;'+m+'&quot;&gt;';j.edInsertTag(o)}}else{j.edInsertTag(o)}};this.edInsertImage=function(){var i=prompt(quicktagsL10n.enterImageURL,&quot;http://&quot;);if(i){i='&lt;img src=&quot;'+i+'&quot; alt=&quot;'+prompt(quicktagsL10n.enterImageDescription,&quot;&quot;)+'&quot; /&gt;';edInsertContent(j.Canvas,i)}};j.Buttons[j.Buttons.length]=new edButton(a+&quot;_strong&quot;,&quot;b&quot;,&quot;&lt;strong&gt;&quot;,&quot;&lt;/strong&gt;&quot;,&quot;b&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_em&quot;,&quot;i&quot;,&quot;&lt;em&gt;&quot;,&quot;&lt;/em&gt;&quot;,&quot;i&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_link&quot;,&quot;link&quot;,&quot;&quot;,&quot;&lt;/a&gt;&quot;,&quot;a&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_block&quot;,&quot;b-quote&quot;,&quot;\n\n&lt;blockquote&gt;&quot;,&quot;&lt;/blockquote&gt;\n\n&quot;,&quot;q&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_del&quot;,&quot;del&quot;,'&lt;del datetime=&quot;'+datetime+'&quot;&gt;',&quot;&lt;/del&gt;&quot;,&quot;d&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_ins&quot;,&quot;ins&quot;,'&lt;ins datetime=&quot;'+datetime+'&quot;&gt;',&quot;&lt;/ins&gt;&quot;,&quot;s&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_img&quot;,&quot;img&quot;,&quot;&quot;,&quot;&quot;,&quot;m&quot;,-1);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_ul&quot;,&quot;ul&quot;,&quot;&lt;ul&gt;\n&quot;,&quot;&lt;/ul&gt;\n\n&quot;,&quot;u&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_ol&quot;,&quot;ol&quot;,&quot;&lt;ol&gt;\n&quot;,&quot;&lt;/ol&gt;\n\n&quot;,&quot;o&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_li&quot;,&quot;li&quot;,&quot;\t&lt;li&gt;&quot;,&quot;&lt;/li&gt;\n&quot;,&quot;l&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_code&quot;,&quot;code&quot;,&quot;&lt;code&gt;&quot;,&quot;&lt;/code&gt;&quot;,&quot;c&quot;);j.Buttons[j.Buttons.length]=new edButton(a+&quot;_more&quot;,&quot;more&quot;,&quot;&lt;!--more--&gt;&quot;,&quot;&quot;,&quot;t&quot;,-1);e=document.createElement(&quot;div&quot;);e.id=a+&quot;_qtags&quot;;h='&lt;div id=&quot;'+a+'_toolbar&quot;&gt;';for(g=0;g&lt;j.Buttons.length;g++){h+=j.edShowButton(j.Buttons[g],g)}h+='&lt;input type=&quot;button&quot; id=&quot;'+a+'_ed_spell&quot; class=&quot;ed_button&quot; onclick=&quot;edSpell('+a+'.Canvas);&quot; title=&quot;'+quicktagsL10n.dictionaryLookup+'&quot; value=&quot;'+quicktagsL10n.lookup+'&quot; /&gt;';h+='&lt;input type=&quot;button&quot; id=&quot;'+a+'_ed_close&quot; class=&quot;ed_button&quot; onclick=&quot;'+a+'.edCloseAllTags();&quot; title=&quot;'+quicktagsL10n.closeAllOpenTags+'&quot; value=&quot;'+quicktagsL10n.closeTags+'&quot; /&gt;&lt;/div&gt;';e.innerHTML=h;k.parentNode.insertBefore(e,k)};
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswpdialogseditor_plugindevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.dev.js (17686 => 17687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.dev.js        2011-04-22 19:09:48 UTC (rev 17686)
+++ trunk/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.dev.js        2011-04-23 02:12:56 UTC (rev 17687)
</span><span class="lines">@@ -8,18 +8,56 @@
</span><span class="cx">  * Contributing: http://tinymce.moxiecode.com/contributing
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-(function($) {
-        var wpDialogFn = function( fn ) {
-                return function() {
-                        if ( this.features.wpDialog )
-                                return fn.apply( this, arguments );
-                        else
-                                return this.parent.apply( this, arguments );
-                };
-        };
-
</del><ins>+(function() {
</ins><span class="cx">         tinymce.create('tinymce.plugins.WPDialogs', {
</span><span class="cx">                 init : function(ed, url) {
</span><ins>+                        tinymce.create('tinymce.WPWindowManager:tinymce.InlineWindowManager', {
+                                WPWindowManager : function(ed) {
+                                        this.parent(ed);
+                                },
+
+                                open : function(f, p) {
+                                        var t = this, element;
+
+                                        if ( ! f.wpDialog )
+                                                return this.parent( f, p );
+                                        else if ( ! f.id )
+                                                return;
+
+                                        element = jQuery('#' + f.id);
+                                        if ( ! element.length )
+                                                return;
+
+                                        t.features = f;
+                                        t.params = p;
+                                        t.onOpen.dispatch(t, f, p);
+                                        t.element = t.windows[ f.id ] = element;
+
+                                        // Store selection
+                                        t.bookmark = t.editor.selection.getBookmark(1);
+
+                                        // Create the dialog if necessary
+                                        if ( ! element.data('wpdialog') ) {
+                                                element.wpdialog({
+                                                        title: f.title,
+                                                        width: f.width,
+                                                        height: f.height,
+                                                        modal: true,
+                                                        dialogClass: 'wp-dialog',
+                                                        zIndex: 300000
+                                                });
+                                        }
+
+                                        element.wpdialog('open');
+                                },
+                                close : function() {
+                                        if ( ! this.features.wpDialog )
+                                                return this.parent.apply( this, arguments );
+
+                                        this.element.wpdialog('close');
+                                }
+                        });
+
</ins><span class="cx">                         // Replace window manager
</span><span class="cx">                         ed.onBeforeRenderUI.add(function() {
</span><span class="cx">                                 ed.windowManager = new tinymce.WPWindowManager(ed);
</span><span class="lines">@@ -36,62 +74,7 @@
</span><span class="cx">                         };
</span><span class="cx">                 }
</span><span class="cx">         });
</span><del>-        
-        $(document).ready(function() {
-                $.widget(&quot;wp.wpdialog&quot;, $.ui.dialog, {
-                        open: function() {
-                                // Initialize tinyMCEPopup if it exists.
-                                if ( tinyMCEPopup )
-                                        tinyMCEPopup.init();
-                                // Open the dialog.
-                                $.ui.dialog.prototype.open.apply( this, arguments );
-                                // WebKit leaves focus in the TinyMCE editor unless we shift focus.
-                                this.element.focus();
-                                this._trigger('refresh');
-                        }
-                });
-        });
</del><span class="cx"> 
</span><del>-        tinymce.create('tinymce.WPWindowManager:tinymce.InlineWindowManager', {
-                WPWindowManager : function(ed) {
-                        this.parent(ed);
-                },
-
-                open : function(f, p) {
-                        var t = this, element;
-                        // Can't use wpDialogFn here; this.features isn't set yet.
-                        if ( ! f.wpDialog )
-                                return this.parent( f, p );
-                        else if ( ! f.id )
-                                return;
-                        
-                        element = $('#' + f.id);
-                        if ( ! element.length )
-                                return;
-                        
-                        t.features = f;
-                        t.params = p;
-                        t.onOpen.dispatch(t, f, p);
-                        t.element = t.windows[ f.id ] = element;
-                        
-                        // Store selection
-                        t.bookmark = t.editor.selection.getBookmark(1);
-                        
-                        element.wpdialog({
-                                title: f.title,
-                                width: f.width,
-                                height: f.height,
-                                modal: true,
-                                dialogClass: 'wp-dialog',
-                                zIndex: 300000
-                        });
-                },
-                close : wpDialogFn(function() {
-                        this.element.wpdialog('close');
-                })
-        });
-
</del><span class="cx">         // Register plugin
</span><span class="cx">         tinymce.PluginManager.add('wpdialogs', tinymce.plugins.WPDialogs);
</span><del>-})(jQuery);
-
</del><ins>+})();
</ins></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswpdialogseditor_pluginjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.js (17686 => 17687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.js        2011-04-22 19:09:48 UTC (rev 17686)
+++ trunk/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin.js        2011-04-23 02:12:56 UTC (rev 17687)
</span><span class="lines">@@ -1 +1 @@
</span><del>-(function(b){var a=function(c){return function(){if(this.features.wpDialog){return c.apply(this,arguments)}else{return this.parent.apply(this,arguments)}}};tinymce.create(&quot;tinymce.plugins.WPDialogs&quot;,{init:function(c,d){c.onBeforeRenderUI.add(function(){c.windowManager=new tinymce.WPWindowManager(c)})},getInfo:function(){return{longname:&quot;WPDialogs&quot;,author:&quot;WordPress&quot;,authorurl:&quot;http://wordpress.org&quot;,infourl:&quot;http://wordpress.org&quot;,version:&quot;0.1&quot;}}});b(document).ready(function(){b.widget(&quot;wp.wpdialog&quot;,b.ui.dialog,{open:function(){if(tinyMCEPopup){tinyMCEPopup.init()}b.ui.dialog.prototype.open.apply(this,arguments);this.element.focus();this._trigger(&quot;refresh&quot;)}})});tinymce.create(&quot;tinymce.WPWindowManager:tinymce.InlineWindowManager&quot;,{WPWindowManager:function(c){this.parent(c)},open:function(e,g){var d=this,c;if(!e.wpDialog){return this.parent(e,g)}else{if(!e.id){return}}c=b(&quot;#&quot;+e.id);if(!c.length){return}d.features=e;d.params=g;d.onOpen.dispatch(d,e,g);d.element=d.windows[e.id]=c;d.bookmark=d.editor.selection.getBookmark(1);c.wpdialog({title:e.title,width:e.width,height:e.height,modal:true,dialogClass:&quot;wp-dialog&quot;,zIndex:300000})},close:a(function(){this.element.wpdialog(&quot;close&quot;)})});tinymce.PluginManager.add(&quot;wpdialogs&quot;,tinymce.plugins.WPDialogs)})(jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+(function(){tinymce.create(&quot;tinymce.plugins.WPDialogs&quot;,{init:function(a,b){tinymce.create(&quot;tinymce.WPWindowManager:tinymce.InlineWindowManager&quot;,{WPWindowManager:function(c){this.parent(c)},open:function(e,g){var d=this,c;if(!e.wpDialog){return this.parent(e,g)}else{if(!e.id){return}}c=jQuery(&quot;#&quot;+e.id);if(!c.length){return}d.features=e;d.params=g;d.onOpen.dispatch(d,e,g);d.element=d.windows[e.id]=c;d.bookmark=d.editor.selection.getBookmark(1);if(!c.data(&quot;wpdialog&quot;)){c.wpdialog({title:e.title,width:e.width,height:e.height,modal:true,dialogClass:&quot;wp-dialog&quot;,zIndex:300000})}c.wpdialog(&quot;open&quot;)},close:function(){if(!this.features.wpDialog){return this.parent.apply(this,arguments)}this.element.wpdialog(&quot;close&quot;)}});a.onBeforeRenderUI.add(function(){a.windowManager=new tinymce.WPWindowManager(a)})},getInfo:function(){return{longname:&quot;WPDialogs&quot;,author:&quot;WordPress&quot;,authorurl:&quot;http://wordpress.org&quot;,infourl:&quot;http://wordpress.org&quot;,version:&quot;0.1&quot;}}});tinymce.PluginManager.add(&quot;wpdialogs&quot;,tinymce.plugins.WPDialogs)})();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswpdialogsjswpdialogdevjs"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.dev.js (0 => 17687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.dev.js                                (rev 0)
+++ trunk/wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.dev.js        2011-04-23 02:12:56 UTC (rev 17687)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+(function($){
+        $.widget(&quot;wp.wpdialog&quot;, $.ui.dialog, {
+                open: function() {
+                        var ed;
+
+                        // Initialize tinyMCEPopup if it exists and is the editor is active.
+                        if ( tinyMCEPopup &amp;&amp; typeof tinyMCE != 'undefined' &amp;&amp; ( ed = tinyMCE.activeEditor ) &amp;&amp; !ed.isHidden() ) {
+                                tinyMCEPopup.init();
+                        }
+
+                        // Add beforeOpen event.
+                        if ( this._isOpen || false === this._trigger('beforeOpen') ) {
+                                return;
+                        }
+
+                        // Open the dialog.
+                        $.ui.dialog.prototype.open.apply( this, arguments );
+                        // WebKit leaves focus in the TinyMCE editor unless we shift focus.
+                        this.element.focus();
+                        this._trigger('refresh');
+                }
+        });
+})(jQuery);
</ins></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswpdialogsjswpdialogjs"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.js (0 => 17687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.js                                (rev 0)
+++ trunk/wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.js        2011-04-23 02:12:56 UTC (rev 17687)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+(function(a){a.widget(&quot;wp.wpdialog&quot;,a.ui.dialog,{open:function(){var b;if(tinyMCEPopup&amp;&amp;typeof tinyMCE!=&quot;undefined&quot;&amp;&amp;(b=tinyMCE.activeEditor)&amp;&amp;!b.isHidden()){tinyMCEPopup.init()}if(this._isOpen||false===this._trigger(&quot;beforeOpen&quot;)){return}a.ui.dialog.prototype.open.apply(this,arguments);this.element.focus();this._trigger(&quot;refresh&quot;)}})})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswplinkjswplinkdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.dev.js (17686 => 17687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.dev.js        2011-04-22 19:09:48 UTC (rev 17686)
+++ trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.dev.js        2011-04-23 02:12:56 UTC (rev 17687)
</span><span class="lines">@@ -9,6 +9,8 @@
</span><span class="cx">                 riverBottomThreshold: 5,
</span><span class="cx">                 keySensitivity: 100,
</span><span class="cx">                 lastSearch: '',
</span><ins>+                textarea: edCanvas,
+
</ins><span class="cx">                 init : function() {
</span><span class="cx">                         inputs.dialog = $('#wp-link');
</span><span class="cx">                         inputs.submit = $('#wp-link-submit');
</span><span class="lines">@@ -31,7 +33,7 @@
</span><span class="cx">                                 wpLink.update();
</span><span class="cx">                                 e.preventDefault();
</span><span class="cx">                         });
</span><del>-                        $('#wp-link-cancel').click( wpLink.cancel );
</del><ins>+                        $('#wp-link-cancel').click( wpLink.close );
</ins><span class="cx">                         $('#internal-toggle').click( wpLink.toggleInternalLinking );
</span><span class="cx"> 
</span><span class="cx">                         rivers.elements.bind('river-select', wpLink.updateFields );
</span><span class="lines">@@ -39,16 +41,62 @@
</span><span class="cx">                         inputs.search.keyup( wpLink.searchInternalLinks );
</span><span class="cx"> 
</span><span class="cx">                         inputs.dialog.bind('wpdialogrefresh', wpLink.refresh);
</span><ins>+                        inputs.dialog.bind('wpdialogbeforeopen', wpLink.beforeOpen);
+                        inputs.dialog.bind('wpdialogclose', wpLink.onClose);
</ins><span class="cx">                 },
</span><span class="cx"> 
</span><ins>+                beforeOpen : function() {
+                        wpLink.range = null;
+
+                        if ( ! wpLink.isMCE() &amp;&amp; document.selection ) {
+                                wpLink.textarea.focus();
+                                wpLink.range = document.selection.createRange();
+                        }
+                },
+
+                open : function() {
+                        // Initialize the dialog if necessary (html mode).
+                        if ( ! inputs.dialog.data('wpdialog') ) {
+                                inputs.dialog.wpdialog({
+                                        title: wpLinkL10n.title,
+                                        width: 480,
+                                        height: 'auto',
+                                        modal: true,
+                                        dialogClass: 'wp-dialog',
+                                        zIndex: 300000
+                                });
+                        }
+
+                        inputs.dialog.wpdialog('open');
+                },
+
+                isMCE : function() {
+                        return tinyMCEPopup &amp;&amp; ( ed = tinyMCEPopup.editor ) &amp;&amp; ! ed.isHidden();
+                },
+
</ins><span class="cx">                 refresh : function() {
</span><del>-                        var e;
-                        ed = tinyMCEPopup.editor;
-
</del><span class="cx">                         // Refresh rivers (clear links, check visibility)
</span><span class="cx">                         rivers.search.refresh();
</span><span class="cx">                         rivers.recent.refresh();
</span><span class="cx"> 
</span><ins>+                        if ( wpLink.isMCE() )
+                                wpLink.mceRefresh();
+                        else
+                                wpLink.setDefaultValues();
+
+                        // Focus the URL field and highlight its contents.
+                        //     If this is moved above the selection changes,
+                        //     IE will show a flashing cursor over the dialog.
+                        inputs.url.focus()[0].select();
+                        // Load the most recent results if this is the first time opening the panel.
+                        if ( ! rivers.recent.ul.children().length )
+                                rivers.recent.ajax();
+                },
+
+                mceRefresh : function() {
+                        var e;
+                        ed = tinyMCEPopup.editor;
+
</ins><span class="cx">                         tinyMCEPopup.restoreSelection();
</span><span class="cx"> 
</span><span class="cx">                         // If link exists, select proper values.
</span><span class="lines">@@ -65,31 +113,106 @@
</span><span class="cx">                         // If there's no link, set the default values.
</span><span class="cx">                         } else {
</span><span class="cx">                                 wpLink.setDefaultValues();
</span><del>-                                // Update save prompt.
-                                inputs.submit.val( wpLinkL10n.save );
</del><span class="cx">                         }
</span><span class="cx"> 
</span><span class="cx">                         tinyMCEPopup.storeSelection();
</span><del>-                        // Focus the URL field and highlight its contents.
-                        //     If this is moved above the selection changes,
-                        //     IE will show a flashing cursor over the dialog.
-                        inputs.url.focus()[0].select();
-                        // Load the most recent results if this is the first time opening the panel.
-                        if ( ! rivers.recent.ul.children().length )
-                                rivers.recent.ajax();
</del><span class="cx">                 },
</span><span class="cx"> 
</span><del>-                cancel : function() {
-                        tinyMCEPopup.close();
</del><ins>+                close : function() {
+                        if ( wpLink.isMCE() )
+                                tinyMCEPopup.close();
+                        else
+                                inputs.dialog.wpdialog('close');
</ins><span class="cx">                 },
</span><span class="cx"> 
</span><ins>+                onClose: function() {
+                        if ( ! wpLink.isMCE() ) {
+                                wpLink.textarea.focus();
+                                if ( wpLink.range ) {
+                                        wpLink.range.moveToBookmark( wpLink.range.getBookmark() );
+                                        wpLink.range.select();
+                                }
+                        }
+                },
+
+                getAttrs : function() {
+                        return {
+                                href : inputs.url.val(),
+                                title : inputs.title.val(),
+                                target : inputs.openInNewTab.attr('checked') ? '_blank' : ''
+                        };
+                },
+
</ins><span class="cx">                 update : function() {
</span><ins>+                        if ( wpLink.isMCE() )
+                                wpLink.mceUpdate();
+                        else
+                                wpLink.htmlUpdate();
+                },
+
+                htmlUpdate : function() {
+                        var attrs, html, start, end, cursor,
+                                textarea = wpLink.textarea;
+
+                        if ( ! textarea )
+                                return;
+
+                        attrs = wpLink.getAttrs();
+
+                        // If there's no href, return.
+                        if ( ! attrs.href || attrs.href == 'http://' )
+                                return;
+
+                        // Build HTML
+                        html = '&lt;a href=&quot;' + attrs.href + '&quot;';
+
+                        if ( attrs.title )
+                                html += ' title=&quot;' + attrs.title + '&quot;';
+                        if ( attrs.target )
+                                html += ' target=&quot;' + attrs.target + '&quot;';
+
+                        html += '&gt;';
+
+                        // Insert HTML
+                        // W3C
+                        if ( typeof textarea.selectionStart !== 'undefined' ) {
+                                start       = textarea.selectionStart;
+                                end         = textarea.selectionEnd;
+                                selection   = textarea.value.substring( start, end );
+                                html        = html + selection + '&lt;/a&gt;';
+                                cursor      = start + html.length;
+
+                                // If no next is selected, place the cursor inside the closing tag.
+                                if ( start == end )
+                                        cursor -= '&lt;/a&gt;'.length;
+
+                                textarea.value = textarea.value.substring( 0, start )
+                                               + html
+                                               + textarea.value.substring( end, textarea.value.length );
+
+                                // Update cursor position
+                                textarea.selectionStart = textarea.selectionEnd = cursor;
+
+                        // IE
+                        // Note: If no text is selected, IE will not place the cursor
+                        //       inside the closing tag.
+                        } else if ( document.selection &amp;&amp; wpLink.range ) {
+                                textarea.focus();
+                                wpLink.range.text = html + wpLink.range.text + '&lt;/a&gt;';
+                                wpLink.range.moveToBookmark( wpLink.range.getBookmark() );
+                                wpLink.range.select();
+
+                                wpLink.range = null;
+                        }
+
+                        wpLink.close();
+                        textarea.focus();
+                },
+
+                mceUpdate : function() {
</ins><span class="cx">                         var ed = tinyMCEPopup.editor,
</span><del>-                                attrs = {
-                                        href : inputs.url.val(),
-                                        title : inputs.title.val(),
-                                        target : inputs.openInNewTab.attr('checked') ? '_blank' : ''
-                                }, e, b;
</del><ins>+                                attrs = wpLink.getAttrs(),
+                                e, b;
</ins><span class="cx"> 
</span><span class="cx">                         tinyMCEPopup.restoreSelection();
</span><span class="cx">                         e = ed.dom.getParent(ed.selection.getNode(), 'A');
</span><span class="lines">@@ -102,7 +225,7 @@
</span><span class="cx">                                         ed.dom.remove(e, 1);
</span><span class="cx">                                         ed.selection.moveToBookmark(b);
</span><span class="cx">                                         tinyMCEPopup.execCommand(&quot;mceEndUndoLevel&quot;);
</span><del>-                                        tinyMCEPopup.close();
</del><ins>+                                        wpLink.close();
</ins><span class="cx">                                 }
</span><span class="cx">                                 return;
</span><span class="cx">                         }
</span><span class="lines">@@ -140,7 +263,7 @@
</span><span class="cx">                         }
</span><span class="cx"> 
</span><span class="cx">                         tinyMCEPopup.execCommand(&quot;mceEndUndoLevel&quot;);
</span><del>-                        tinyMCEPopup.close();
</del><ins>+                        wpLink.close();
</ins><span class="cx">                 },
</span><span class="cx"> 
</span><span class="cx">                 updateFields : function( e, li, originalEvent ) {
</span><span class="lines">@@ -154,6 +277,9 @@
</span><span class="cx">                         // Leave the new tab setting as-is.
</span><span class="cx">                         inputs.url.val('http://');
</span><span class="cx">                         inputs.title.val('');
</span><ins>+
+                        // Update save prompt.
+                        inputs.submit.val( wpLinkL10n.save );
</ins><span class="cx">                 },
</span><span class="cx"> 
</span><span class="cx">                 searchInternalLinks : function() {
</span><span class="lines">@@ -210,7 +336,7 @@
</span><span class="cx"> 
</span><span class="cx">                         switch( event.which ) {
</span><span class="cx">                                 case key.ESCAPE:
</span><del>-                                        wpLink.cancel();
</del><ins>+                                        wpLink.close();
</ins><span class="cx">                                         break;
</span><span class="cx">                                 case key.UP:
</span><span class="cx">                                 case key.DOWN:
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswplinkjswplinkjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.js (17686 => 17687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.js        2011-04-22 19:09:48 UTC (rev 17686)
+++ trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.js        2011-04-23 02:12:56 UTC (rev 17687)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var wpLink;(function(f){var b={},e={},d,a,c;wpLink={timeToTriggerRiver:150,minRiverAJAXDuration:200,riverBottomThreshold:5,keySensitivity:100,lastSearch:&quot;&quot;,init:function(){b.dialog=f(&quot;#wp-link&quot;);b.submit=f(&quot;#wp-link-submit&quot;);b.url=f(&quot;#url-field&quot;);b.title=f(&quot;#link-title-field&quot;);b.openInNewTab=f(&quot;#link-target-checkbox&quot;);b.search=f(&quot;#search-field&quot;);e.search=new a(f(&quot;#search-results&quot;));e.recent=new a(f(&quot;#most-recent-results&quot;));e.elements=f(&quot;.query-results&quot;,b.dialog);b.dialog.keydown(wpLink.keydown);b.dialog.keyup(wpLink.keyup);b.submit.click(function(g){wpLink.update();g.preventDefault()});f(&quot;#wp-link-cancel&quot;).click(wpLink.cancel);f(&quot;#internal-toggle&quot;).click(wpLink.toggleInternalLinking);e.elements.bind(&quot;river-select&quot;,wpLink.updateFields);b.search.keyup(wpLink.searchInternalLinks);b.dialog.bind(&quot;wpdialogrefresh&quot;,wpLink.refresh)},refresh:function(){var g;d=tinyMCEPopup.editor;e.search.refresh();e.recent.refresh();tinyMCEPopup.restoreSelection();if(g=d.dom.getParent(d.selection.getNode(),&quot;A&quot;)){b.url.val(g.href);b.title.val(d.dom.getAttrib(g,&quot;title&quot;));if(&quot;_blank&quot;==d.dom.getAttrib(g,&quot;target&quot;)){b.openInNewTab.attr(&quot;checked&quot;,&quot;checked&quot;)}b.submit.val(wpLinkL10n.update)}else{wpLink.setDefaultValues();b.submit.val(wpLinkL10n.save)}tinyMCEPopup.storeSelection();b.url.focus()[0].select();if(!e.recent.ul.children().length){e.recent.ajax()}},cancel:function(){tinyMCEPopup.close()},update:function(){var h=tinyMCEPopup.editor,i={href:b.url.val(),title:b.title.val(),target:b.openInNewTab.attr(&quot;checked&quot;)?&quot;_blank&quot;:&quot;&quot;},j,g;tinyMCEPopup.restoreSelection();j=h.dom.getParent(h.selection.getNode(),&quot;A&quot;);if(!i.href||i.href==&quot;http://&quot;){if(j){tinyMCEPopup.execCommand(&quot;mceBeginUndoLevel&quot;);g=h.selection.getBookmark();h.dom.remove(j,1);h.selection.moveToBookmark(g);tinyMCEPopup.execCommand(&quot;mceEndUndoLevel&quot;);tinyMCEPopup.close()}return}tinyMCEPopup.execCommand(&quot;mceBeginUndoLevel&quot;);if(j==null){h.getDoc().execCommand(&quot;unlink&quot;,false,null);tinyMCEPopup.execCommand(&quot;CreateLink&quot;,false,&quot;#mce_temp_url#&quot;,{skip_undo:1});tinymce.each(h.dom.select(&quot;a&quot;),function(k){if(h.dom.getAttrib(k,&quot;href&quot;)==&quot;#mce_temp_url#&quot;){j=k;h.dom.setAttribs(j,i)}});if(f(j).text()==&quot;#mce_temp_url#&quot;){h.dom.remove(j);j=null}}else{h.dom.setAttribs(j,i)}if(j&amp;&amp;(j.childNodes.length!=1||j.firstChild.nodeName!=&quot;IMG&quot;)){h.focus();h.selection.select(j);h.selection.collapse(0);tinyMCEPopup.storeSelection()}tinyMCEPopup.execCommand(&quot;mceEndUndoLevel&quot;);tinyMCEPopup.close()},updateFields:function(i,h,g){b.url.val(h.children(&quot;.item-permalink&quot;).val());b.title.val(h.hasClass(&quot;no-title&quot;)?&quot;&quot;:h.children(&quot;.item-title&quot;).text());if(g&amp;&amp;g.type==&quot;click&quot;){b.url.focus()}},setDefaultValues:function(){b.url.val(&quot;http://&quot;);b.title.val(&quot;&quot;)},searchInternalLinks:function(){var h=f(this),i,g=h.val();if(g.length&gt;2){e.recent.hide();e.search.show();if(wpLink.lastSearch==g){return}wpLink.lastSearch=g;i=h.siblings(&quot;img.waiting&quot;).show();e.search.change(g);e.search.ajax(function(){i.hide()})}else{e.search.hide();e.recent.show()}},next:function(){e.search.next();e.recent.next()},prev:function(){e.search.prev();e.recent.prev()},keydown:function(i){var h,g=f.ui.keyCode;switch(i.which){case g.UP:h=&quot;prev&quot;;case g.DOWN:h=h||&quot;next&quot;;clearInterval(wpLink.keyInterval);wpLink[h]();wpLink.keyInterval=setInterval(wpLink[h],wpLink.keySensitivity);break;default:return}i.preventDefault()},keyup:function(h){var g=f.ui.keyCode;switch(h.which){case g.ESCAPE:wpLink.cancel();break;case g.UP:case g.DOWN:clearInterval(wpLink.keyInterval);break;default:return}h.preventDefault()},delayedCallback:function(i,g){var l,k,j,h;if(!g){return i}setTimeout(function(){if(k){return i.apply(h,j)}l=true},g);return function(){if(l){return i.apply(this,arguments)}j=arguments;h=this;k=true}},toggleInternalLinking:function(h){var g=f(&quot;#search-panel&quot;),i=b.dialog.wpdialog(&quot;widget&quot;),k=!g.is(&quot;:visible&quot;),j=f(window);f(this).toggleClass(&quot;toggle-arrow-active&quot;,k);b.dialog.height(&quot;auto&quot;);g.slideToggle(300,function(){setUserSetting(&quot;wplink&quot;,k?&quot;1&quot;:&quot;0&quot;);b[k?&quot;search&quot;:&quot;url&quot;].focus();var l=j.scrollTop(),o=i.offset().top,m=o+i.outerHeight(),n=m-j.height();if(n&gt;l){i.animate({top:n&lt;o?o-n:l},200)}});h.preventDefault()}};a=function(i,h){var g=this;this.element=i;this.ul=i.children(&quot;ul&quot;);this.waiting=i.find(&quot;.river-waiting&quot;);this.change(h);this.refresh();i.scroll(function(){g.maybeLoad()});i.delegate(&quot;li&quot;,&quot;click&quot;,function(j){g.select(f(this),j)})};f.extend(a.prototype,{refresh:function(){this.deselect();this.visible=this.element.is(&quot;:visible&quot;)},show:function(){if(!this.visible){this.deselect();this.element.show();this.visible=true}},hide:function(){this.element.hide();this.visible=false},select:function(h,k){var j,i,l,g;if(h.hasClass(&quot;unselectable&quot;)||h==this.selected){return}this.deselect();this.selected=h.addClass(&quot;selected&quot;);j=h.outerHeight();i=this.element.height();l=h.position().top;g=this.element.scrollTop();if(l&lt;0){this.element.scrollTop(g+l)}else{if(l+j&gt;i){this.element.scrollTop(g+l-i+j)}}this.element.trigger(&quot;river-select&quot;,[h,k,this])},deselect:function(){if(this.selected){this.selected.removeClass(&quot;selected&quot;)}this.selected=false},prev:function(){if(!this.visible){return}var g;if(this.selected){g=this.selected.prev(&quot;li&quot;);if(g.length){this.select(g)}}},next:function(){if(!this.visible){return}var g=this.selected?this.selected.next(&quot;li&quot;):f(&quot;li:not(.unselectable):first&quot;,this.element);if(g.length){this.select(g)}},ajax:function(j){var h=this,i=this.query.page==1?0:wpLink.minRiverAJAXDuration,g=wpLink.delayedCallback(function(k,l){h.process(k,l);if(j){j(k,l)}},i);this.query.ajax(g)},change:function(g){if(this.query&amp;&amp;this._search==g){return}this._search=g;this.query=new c(g);this.element.scrollTop(0)},process:function(h,l){var i=&quot;&quot;,j=true,g=&quot;&quot;,k=l.page==1;if(!h){if(k){i+='&lt;li class=&quot;unselectable&quot;&gt;&lt;span class=&quot;item-title&quot;&gt;&lt;em&gt;'+wpLinkL10n.noMatchesFound+&quot;&lt;/em&gt;&lt;/span&gt;&lt;/li&gt;&quot;}}else{f.each(h,function(){g=j?&quot;alternate&quot;:&quot;&quot;;g+=this[&quot;title&quot;]?&quot;&quot;:&quot; no-title&quot;;i+=g?'&lt;li class=&quot;'+g+'&quot;&gt;':&quot;&lt;li&gt;&quot;;i+='&lt;input type=&quot;hidden&quot; class=&quot;item-permalink&quot; value=&quot;'+this[&quot;permalink&quot;]+'&quot; /&gt;';i+='&lt;span class=&quot;item-title&quot;&gt;';i+=this[&quot;title&quot;]?this[&quot;title&quot;]:wpLinkL10n.noTitle;i+='&lt;/span&gt;&lt;span class=&quot;item-info&quot;&gt;'+this[&quot;info&quot;]+&quot;&lt;/span&gt;&lt;/li&gt;&quot;;j=!j})}this.ul[k?&quot;html&quot;:&quot;append&quot;](i)},maybeLoad:function(){var h=this,i=this.element,g=i.scrollTop()+i.height();if(!this.query.ready()||g&lt;this.ul.height()-wpLink.riverBottomThreshold){return}setTimeout(function(){var j=i.scrollTop(),k=j+i.height();if(!h.query.ready()||k&lt;h.ul.height()-wpLink.riverBottomThreshold){return}h.waiting.show();i.scrollTop(j+h.waiting.outerHeight());h.ajax(function(){h.waiting.hide()})},wpLink.timeToTriggerRiver)}});c=function(g){this.page=1;this.allLoaded=false;this.querying=false;this.search=g};f.extend(c.prototype,{ready:function(){return !(this.querying||this.allLoaded)},ajax:function(i){var g=this,h={action:&quot;wp-link-ajax&quot;,page:this.page,_ajax_linking_nonce:f(&quot;#_ajax_linking_nonce&quot;).val()};if(this.search){h.search=this.search}this.querying=true;f.post(ajaxurl,h,function(j){g.page++;g.querying=false;g.allLoaded=!j;i(j,h)},&quot;json&quot;)}});f(document).ready(wpLink.init)})(jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+var wpLink;(function(f){var b={},e={},d,a,c;wpLink={timeToTriggerRiver:150,minRiverAJAXDuration:200,riverBottomThreshold:5,keySensitivity:100,lastSearch:&quot;&quot;,textarea:edCanvas,init:function(){b.dialog=f(&quot;#wp-link&quot;);b.submit=f(&quot;#wp-link-submit&quot;);b.url=f(&quot;#url-field&quot;);b.title=f(&quot;#link-title-field&quot;);b.openInNewTab=f(&quot;#link-target-checkbox&quot;);b.search=f(&quot;#search-field&quot;);e.search=new a(f(&quot;#search-results&quot;));e.recent=new a(f(&quot;#most-recent-results&quot;));e.elements=f(&quot;.query-results&quot;,b.dialog);b.dialog.keydown(wpLink.keydown);b.dialog.keyup(wpLink.keyup);b.submit.click(function(g){wpLink.update();g.preventDefault()});f(&quot;#wp-link-cancel&quot;).click(wpLink.close);f(&quot;#internal-toggle&quot;).click(wpLink.toggleInternalLinking);e.elements.bind(&quot;river-select&quot;,wpLink.updateFields);b.search.keyup(wpLink.searchInternalLinks);b.dialog.bind(&quot;wpdialogrefresh&quot;,wpLink.refresh);b.dialog.bind(&quot;wpdialogbeforeopen&quot;,wpLink.beforeOpen);b.dialog.bind(&quot;wpdialogclose&quot;,wpLink.onClose)},beforeOpen:function(){wpLink.range=null;if(!wpLink.isMCE()&amp;&amp;document.selection){wpLink.textarea.focus();wpLink.range=document.selection.createRange()}},open:function(){if(!b.dialog.data(&quot;wpdialog&quot;)){b.dialog.wpdialog({title:wpLinkL10n.title,width:480,height:&quot;auto&quot;,modal:true,dialogClass:&quot;wp-dialog&quot;,zIndex:300000})}b.dialog.wpdialog(&quot;open&quot;)},isMCE:function(){return tinyMCEPopup&amp;&amp;(d=tinyMCEPopup.editor)&amp;&amp;!d.isHidden()},refresh:function(){e.search.refresh();e.recent.refresh();if(wpLink.isMCE()){wpLink.mceRefresh()}else{wpLink.setDefaultValues()}b.url.focus()[0].select();if(!e.recent.ul.children().length){e.recent.ajax()}},mceRefresh:function(){var g;d=tinyMCEPopup.editor;tinyMCEPopup.restoreSelection();if(g=d.dom.getParent(d.selection.getNode(),&quot;A&quot;)){b.url.val(g.href);b.title.val(d.dom.getAttrib(g,&quot;title&quot;));if(&quot;_blank&quot;==d.dom.getAttrib(g,&quot;target&quot;)){b.openInNewTab.attr(&quot;checked&quot;,&quot;checked&quot;)}b.submit.val(wpLinkL10n.update)}else{wpLink.setDefaultValues()}tinyMCEPopup.storeSelection()},close:function(){if(wpLink.isMCE()){tinyMCEPopup.close()}else{b.dialog.wpdialog(&quot;close&quot;)}},onClose:function(){if(!wpLink.isMCE()){wpLink.textarea.focus();if(wpLink.range){wpLink.range.moveToBookmark(wpLink.range.getBookmark());wpLink.range.select()}}},getAttrs:function(){return{href:b.url.val(),title:b.title.val(),target:b.openInNewTab.attr(&quot;checked&quot;)?&quot;_blank&quot;:&quot;&quot;}},update:function(){if(wpLink.isMCE()){wpLink.mceUpdate()}else{wpLink.htmlUpdate()}},htmlUpdate:function(){var i,j,l,h,k,g=wpLink.textarea;if(!g){return}i=wpLink.getAttrs();if(!i.href||i.href==&quot;http://&quot;){return}j='&lt;a href=&quot;'+i.href+'&quot;';if(i.title){j+=' title=&quot;'+i.title+'&quot;'}if(i.target){j+=' target=&quot;'+i.target+'&quot;'}j+=&quot;&gt;&quot;;if(typeof g.selectionStart!==&quot;undefined&quot;){l=g.selectionStart;h=g.selectionEnd;selection=g.value.substring(l,h);j=j+selection+&quot;&lt;/a&gt;&quot;;k=l+j.length;if(l==h){k-=&quot;&lt;/a&gt;&quot;.length}g.value=g.value.substring(0,l)+j+g.value.substring(h,g.value.length);g.selectionStart=g.selectionEnd=k}else{if(document.selection&amp;&amp;wpLink.range){g.focus();wpLink.range.text=j+wpLink.range.text+&quot;&lt;/a&gt;&quot;;wpLink.range.moveToBookmark(wpLink.range.getBookmark());wpLink.range.select();wpLink.range=null}}wpLink.close();g.focus()},mceUpdate:function(){var h=tinyMCEPopup.editor,i=wpLink.getAttrs(),j,g;tinyMCEPopup.restoreSelection();j=h.dom.getParent(h.selection.getNode(),&quot;A&quot;);if(!i.href||i.href==&quot;http://&quot;){if(j){tinyMCEPopup.execCommand(&quot;mceBeginUndoLevel&quot;);g=h.selection.getBookmark();h.dom.remove(j,1);h.selection.moveToBookmark(g);tinyMCEPopup.execCommand(&quot;mceEndUndoLevel&quot;);wpLink.close()}return}tinyMCEPopup.execCommand(&quot;mceBeginUndoLevel&quot;);if(j==null){h.getDoc().execCommand(&quot;unlink&quot;,false,null);tinyMCEPopup.execCommand(&quot;CreateLink&quot;,false,&quot;#mce_temp_url#&quot;,{skip_undo:1});tinymce.each(h.dom.select(&quot;a&quot;),function(k){if(h.dom.getAttrib(k,&quot;href&quot;)==&quot;#mce_temp_url#&quot;){j=k;h.dom.setAttribs(j,i)}});if(f(j).text()==&quot;#mce_temp_url#&quot;){h.dom.remove(j);j=null}}else{h.dom.setAttribs(j,i)}if(j&amp;&amp;(j.childNodes.length!=1||j.firstChild.nodeName!=&quot;IMG&quot;)){h.focus();h.selection.select(j);h.selection.collapse(0);tinyMCEPopup.storeSelection()}tinyMCEPopup.execCommand(&quot;mceEndUndoLevel&quot;);wpLink.close()},updateFields:function(i,h,g){b.url.val(h.children(&quot;.item-permalink&quot;).val());b.title.val(h.hasClass(&quot;no-title&quot;)?&quot;&quot;:h.children(&quot;.item-title&quot;).text());if(g&amp;&amp;g.type==&quot;click&quot;){b.url.focus()}},setDefaultValues:function(){b.url.val(&quot;http://&quot;);b.title.val(&quot;&quot;);b.submit.val(wpLinkL10n.save)},searchInternalLinks:function(){var h=f(this),i,g=h.val();if(g.length&gt;2){e.recent.hide();e.search.show();if(wpLink.lastSearch==g){return}wpLink.lastSearch=g;i=h.siblings(&quot;img.waiting&quot;).show();e.search.change(g);e.search.ajax(function(){i.hide()})}else{e.search.hide();e.recent.show()}},next:function(){e.search.next();e.recent.next()},prev:function(){e.search.prev();e.recent.prev()},keydown:function(i){var h,g=f.ui.keyCode;switch(i.which){case g.UP:h=&quot;prev&quot;;case g.DOWN:h=h||&quot;next&quot;;clearInterval(wpLink.keyInterval);wpLink[h]();wpLink.keyInterval=setInterval(wpLink[h],wpLink.keySensitivity);break;default:return}i.preventDefault()},keyup:function(h){var g=f.ui.keyCode;switch(h.which){case g.ESCAPE:wpLink.close();break;case g.UP:case g.DOWN:clearInterval(wpLink.keyInterval);break;default:return}h.preventDefault()},delayedCallback:function(i,g){var l,k,j,h;if(!g){return i}setTimeout(function(){if(k){return i.apply(h,j)}l=true},g);return function(){if(l){return i.apply(this,arguments)}j=arguments;h=this;k=true}},toggleInternalLinking:function(h){var g=f(&quot;#search-panel&quot;),i=b.dialog.wpdialog(&quot;widget&quot;),k=!g.is(&quot;:visible&quot;),j=f(window);f(this).toggleClass(&quot;toggle-arrow-active&quot;,k);b.dialog.height(&quot;auto&quot;);g.slideToggle(300,function(){setUserSetting(&quot;wplink&quot;,k?&quot;1&quot;:&quot;0&quot;);b[k?&quot;search&quot;:&quot;url&quot;].focus();var l=j.scrollTop(),o=i.offset().top,m=o+i.outerHeight(),n=m-j.height();if(n&gt;l){i.animate({top:n&lt;o?o-n:l},200)}});h.preventDefault()}};a=function(i,h){var g=this;this.element=i;this.ul=i.children(&quot;ul&quot;);this.waiting=i.find(&quot;.river-waiting&quot;);this.change(h);this.refresh();i.scroll(function(){g.maybeLoad()});i.delegate(&quot;li&quot;,&quot;click&quot;,function(j){g.select(f(this),j)})};f.extend(a.prototype,{refresh:function(){this.deselect();this.visible=this.element.is(&quot;:visible&quot;)},show:function(){if(!this.visible){this.deselect();this.element.show();this.visible=true}},hide:function(){this.element.hide();this.visible=false},select:function(h,k){var j,i,l,g;if(h.hasClass(&quot;unselectable&quot;)||h==this.selected){return}this.deselect();this.selected=h.addClass(&quot;selected&quot;);j=h.outerHeight();i=this.element.height();l=h.position().top;g=this.element.scrollTop();if(l&lt;0){this.element.scrollTop(g+l)}else{if(l+j&gt;i){this.element.scrollTop(g+l-i+j)}}this.element.trigger(&quot;river-select&quot;,[h,k,this])},deselect:function(){if(this.selected){this.selected.removeClass(&quot;selected&quot;)}this.selected=false},prev:function(){if(!this.visible){return}var g;if(this.selected){g=this.selected.prev(&quot;li&quot;);if(g.length){this.select(g)}}},next:function(){if(!this.visible){return}var g=this.selected?this.selected.next(&quot;li&quot;):f(&quot;li:not(.unselectable):first&quot;,this.element);if(g.length){this.select(g)}},ajax:function(j){var h=this,i=this.query.page==1?0:wpLink.minRiverAJAXDuration,g=wpLink.delayedCallback(function(k,l){h.process(k,l);if(j){j(k,l)}},i);this.query.ajax(g)},change:function(g){if(this.query&amp;&amp;this._search==g){return}this._search=g;this.query=new c(g);this.element.scrollTop(0)},process:function(h,l){var i=&quot;&quot;,j=true,g=&quot;&quot;,k=l.page==1;if(!h){if(k){i+='&lt;li class=&quot;unselectable&quot;&gt;&lt;span class=&quot;item-title&quot;&gt;&lt;em&gt;'+wpLinkL10n.noMatchesFound+&quot;&lt;/em&gt;&lt;/span&gt;&lt;/li&gt;&quot;}}else{f.each(h,function(){g=j?&quot;alternate&quot;:&quot;&quot;;g+=this[&quot;title&quot;]?&quot;&quot;:&quot; no-title&quot;;i+=g?'&lt;li class=&quot;'+g+'&quot;&gt;':&quot;&lt;li&gt;&quot;;i+='&lt;input type=&quot;hidden&quot; class=&quot;item-permalink&quot; value=&quot;'+this[&quot;permalink&quot;]+'&quot; /&gt;';i+='&lt;span class=&quot;item-title&quot;&gt;';i+=this[&quot;title&quot;]?this[&quot;title&quot;]:wpLinkL10n.noTitle;i+='&lt;/span&gt;&lt;span class=&quot;item-info&quot;&gt;'+this[&quot;info&quot;]+&quot;&lt;/span&gt;&lt;/li&gt;&quot;;j=!j})}this.ul[k?&quot;html&quot;:&quot;append&quot;](i)},maybeLoad:function(){var h=this,i=this.element,g=i.scrollTop()+i.height();if(!this.query.ready()||g&lt;this.ul.height()-wpLink.riverBottomThreshold){return}setTimeout(function(){var j=i.scrollTop(),k=j+i.height();if(!h.query.ready()||k&lt;h.ul.height()-wpLink.riverBottomThreshold){return}h.waiting.show();i.scrollTop(j+h.waiting.outerHeight());h.ajax(function(){h.waiting.hide()})},wpLink.timeToTriggerRiver)}});c=function(g){this.page=1;this.allLoaded=false;this.querying=false;this.search=g};f.extend(c.prototype,{ready:function(){return !(this.querying||this.allLoaded)},ajax:function(i){var g=this,h={action:&quot;wp-link-ajax&quot;,page:this.page,_ajax_linking_nonce:f(&quot;#_ajax_linking_nonce&quot;).val()};if(this.search){h.search=this.search}this.querying=true;f.post(ajaxurl,h,function(j){g.page++;g.querying=false;g.allLoaded=!j;i(j,h)},&quot;json&quot;)}});f(document).ready(wpLink.init)})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (17686 => 17687)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2011-04-22 19:09:48 UTC (rev 17686)
+++ trunk/wp-includes/script-loader.php        2011-04-23 02:12:56 UTC (rev 17687)
</span><span class="lines">@@ -267,8 +267,10 @@
</span><span class="cx">         $scripts-&gt;add( 'admin-bar', &quot;/wp-includes/js/admin-bar$suffix.js&quot;, false, '20110131' );
</span><span class="cx">         $scripts-&gt;add_data( 'admin-bar', 'group', 1 );
</span><span class="cx"> 
</span><del>-        $scripts-&gt;add( 'wplink', &quot;/wp-includes/js/tinymce/plugins/wplink/js/wplink$suffix.js&quot;, array('jquery'), '20110111' );
</del><ins>+        $scripts-&gt;add( 'wplink', &quot;/wp-includes/js/tinymce/plugins/wplink/js/wplink$suffix.js&quot;, array( 'jquery', 'wpdialogs' ), '20110421' );
+        $scripts-&gt;add_data( 'wplink', 'group', 1 );
</ins><span class="cx">         $scripts-&gt;localize( 'wplink', 'wpLinkL10n', array(
</span><ins>+                'title' =&gt; __('Insert/edit link'),
</ins><span class="cx">                 'update' =&gt; __('Update'),
</span><span class="cx">                 'save' =&gt; __('Add Link'),
</span><span class="cx">                 'noTitle' =&gt; __('(no title)'),
</span><span class="lines">@@ -276,8 +278,12 @@
</span><span class="cx">                 'l10n_print_after' =&gt; 'try{convertEntities(wpLinkL10n);}catch(e){};',
</span><span class="cx">         ) );
</span><span class="cx"> 
</span><del>-        $scripts-&gt;add( 'wpdialogs-popup', &quot;/wp-includes/js/tinymce/plugins/wpdialogs/js/popup$suffix.js&quot;, array( 'jquery-ui-dialog' ), '20101119' );
</del><ins>+        $scripts-&gt;add( 'wpdialogs', &quot;/wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog$suffix.js&quot;, array( 'jquery-ui-dialog' ), '20110421' );
+        $scripts-&gt;add_data( 'wpdialogs', 'group', 1 );
</ins><span class="cx"> 
</span><ins>+        $scripts-&gt;add( 'wpdialogs-popup', &quot;/wp-includes/js/tinymce/plugins/wpdialogs/js/popup$suffix.js&quot;, array( 'wpdialogs' ), '20110421' );
+        $scripts-&gt;add_data( 'wpdialogs-popup', 'group', 1 );
+
</ins><span class="cx">         if ( is_admin() ) {
</span><span class="cx">                 $scripts-&gt;add( 'ajaxcat', &quot;/wp-admin/js/cat$suffix.js&quot;, array( 'wp-lists' ), '20090102' );
</span><span class="cx">                 $scripts-&gt;add_data( 'ajaxcat', 'group', 1 );
</span></span></pre>
</div>
</div>

</body>
</html>