<!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>[18611] trunk/wp-includes: Improve quicktags back-compat, add method instance.getButtonElement(id), see #16695</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/18611">18611</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2011-08-26 23:30:01 +0000 (Fri, 26 Aug 2011)</dd>
</dl>

<h3>Log Message</h3>
<pre>Improve quicktags back-compat, add method instance.getButtonElement(id), see <a href="http://core.trac.wordpress.org/ticket/16695">#16695</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="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</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 (18610 => 18611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/quicktags.dev.js        2011-08-26 20:31:30 UTC (rev 18610)
+++ trunk/wp-includes/js/quicktags.dev.js        2011-08-26 23:30:01 UTC (rev 18611)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">  * @see QTags.addButton()
</span><span class="cx">  */
</span><span class="cx"> function edButton(id, display, tagStart, tagEnd, access, open) {
</span><del>-        return QTags.addButton( id, display, tagStart, tagEnd, open, access );        
</del><ins>+        return QTags.addButton( id, display, tagStart, tagEnd, open, access, '', -1 );        
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> (function(){
</span><span class="lines">@@ -140,12 +140,9 @@
</span><span class="cx"> 
</span><span class="cx">                 var t = this,
</span><span class="cx">                         id = settings.id,
</span><del>-                        buttons = {},
-                        theButtons = {},
</del><span class="cx">                         canvas = document.getElementById(id),
</span><span class="cx">                         name = 'qt_' + id,
</span><del>-                        html = '',
-                        i, tb, qb, btn, onclick, toolbar_id;
</del><ins>+                        tb, onclick, toolbar_id;
</ins><span class="cx"> 
</span><span class="cx">                 if ( !id || !canvas )
</span><span class="cx">                         return false;
</span><span class="lines">@@ -153,17 +150,9 @@
</span><span class="cx">                 t.name = name;
</span><span class="cx">                 t.id = id;
</span><span class="cx">                 t.canvas = canvas;
</span><ins>+                t.settings = settings;
</ins><span class="cx"> 
</span><del>-                // default buttons
-                for ( i in edButtons ) {
-                        if ( !edButtons[i] )
-                                continue;
-
-                        buttons[edButtons[i].id] = edButtons[i];
-                }
-
</del><span class="cx">                 if ( id == 'content' &amp;&amp; adminpage &amp;&amp; ( adminpage == 'post-new-php' || adminpage == 'post-php' ) ) {
</span><del>-                        buttons['fullscreen'] = new qt.FullscreenButton();
</del><span class="cx">                         // back compat hack :-(
</span><span class="cx">                         edCanvas = canvas;
</span><span class="cx">                         toolbar_id = 'ed_toolbar';
</span><span class="lines">@@ -171,43 +160,11 @@
</span><span class="cx">                         toolbar_id = name + '_toolbar';
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                // add custom buttons
-                for ( i in t._customButtons ) {
-                        buttons[i] = new t._customButtons[i]();
-                }
-
-                if ( settings.buttons ) {
-                        qb = settings.buttons.split(',');
-
-                        for ( i in qb ) {
-                                btn = qb[i];
-                                if ( buttons[btn] )
-                                        theButtons[btn] = buttons[btn];
-                        }
-                } else {
-                        theButtons = buttons;
-                }
-
-                if ( settings.disabled_buttons ) {
-                        qb = settings.disabled_buttons.split(',');
-
-                        for ( i in qb ) {
-                                btn = qb[i];
-                                if ( theButtons[btn] )
-                                        delete(theButtons[btn]);
-                        }
-                }
-
-                for ( i in theButtons )
-                        html += theButtons[i].html(name + '_');
-
</del><span class="cx">                 tb = document.createElement('div');
</span><span class="cx">                 tb.id = toolbar_id;
</span><span class="cx">                 tb.className = 'quicktags-toolbar';
</span><span class="cx"> 
</span><span class="cx">                 canvas.parentNode.insertBefore(tb, canvas);
</span><del>-
-                tb.innerHTML = html;
</del><span class="cx">                 t.toolbar = tb;
</span><span class="cx"> 
</span><span class="cx">                 // listen for click events
</span><span class="lines">@@ -221,8 +178,8 @@
</span><span class="cx">                                 t.canvas = canvas = document.getElementById(id);
</span><span class="cx">                                 i = target.id.replace(name + '_', '');
</span><span class="cx"> 
</span><del>-                                if ( theButtons[i] )
-                                        theButtons[i].callback.call(theButtons[i], target, canvas, t);
</del><ins>+                                if ( t.theButtons[i] )
+                                        t.theButtons[i].callback.call(t.theButtons[i], target, canvas, t);
</ins><span class="cx">                         }
</span><span class="cx">                 };
</span><span class="cx"> 
</span><span class="lines">@@ -233,13 +190,19 @@
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 t.getButton = function(id) {
</span><del>-                        return buttons[id];
</del><ins>+                        return t.theButtons[id];
</ins><span class="cx">                 };
</span><span class="cx"> 
</span><ins>+                t.getButtonElement = function(id) {
+                        return document.getElementById(name + '_' + id);
+                };
+
</ins><span class="cx">                 qt.instances[id] = t;
</span><span class="cx"> 
</span><del>-                if ( !qt.instances[0] )
</del><ins>+                if ( !qt.instances[0] ) {
</ins><span class="cx">                         qt.instances[0] = qt.instances[id];
</span><ins>+                        _domReady( function(){ qt._buttonsInit(); } );
+                }
</ins><span class="cx">         };
</span><span class="cx"> 
</span><span class="cx">         qt.instances = {};
</span><span class="lines">@@ -251,7 +214,67 @@
</span><span class="cx">         qt.getInstance = function(id) {
</span><span class="cx">                 return qt.instances[id];
</span><span class="cx">         };
</span><del>-        
</del><ins>+
+        qt._buttonsInit = function() {
+                var t = this, instance, canvas, name, settings, buttons = {}, theButtons = {}, html = '', id, i, qb, btn;;
+
+                for ( id in t.instances ) {
+                        if ( id == 0 )
+                                continue;
+
+                        instance = t.instances[id];
+                        canvas = instance.canvas;
+                        name = instance.name;
+                        settings = instance.settings;
+
+                        // set buttons
+                        for ( i in edButtons ) {
+                                if ( !edButtons[i] )
+                                        continue;
+
+                                buttons[edButtons[i].id] = edButtons[i];
+                        }
+
+                        if ( id == 'content' &amp;&amp; adminpage &amp;&amp; ( adminpage == 'post-new-php' || adminpage == 'post-php' ) )
+                                buttons['fullscreen'] = new qt.FullscreenButton();
+
+                        // add custom buttons
+                        for ( i in t._customButtons ) {
+                                if ( !buttons[i] )
+                                        buttons[i] = new t._customButtons[i]();
+                        }
+
+                        if ( settings.buttons ) {
+                                qb = settings.buttons.split(',');
+
+                                for ( i in qb ) {
+                                        btn = qb[i];
+                                        if ( buttons[btn] )
+                                                theButtons[btn] = buttons[btn];
+                                }
+                        } else {
+                                theButtons = buttons;
+                        }
+
+                        if ( settings.disabled_buttons ) {
+                                qb = settings.disabled_buttons.split(',');
+
+                                for ( i in qb ) {
+                                        btn = qb[i];
+                                        if ( theButtons[btn] )
+                                                delete(theButtons[btn]);
+                                }
+                        }
+
+                        for ( i in theButtons )
+                                html += theButtons[i].html(name + '_');
+
+                        instance.toolbar.innerHTML = html;
+                        instance.theButtons = theButtons;
+                }
+                t.buttonsInitDone = true;
+        };
+
</ins><span class="cx">         /**
</span><span class="cx">          * Main API function for adding a button to Quicktags
</span><span class="cx">          * 
</span><span class="lines">@@ -283,16 +306,21 @@
</span><span class="cx">                 if ( !id || !display )
</span><span class="cx">                         return;
</span><span class="cx"> 
</span><ins>+                priority = priority || 0;
+
</ins><span class="cx">                 if ( typeof(arg1) == 'function' ) {
</span><span class="cx">                         btn = new qt.Button(id, display, access, title);
</span><span class="cx">                         btn.callback = arg1;
</span><del>-                } else if ( typeof(arg1) == 'string' &amp;&amp; arg1 &amp;&amp; arg2 ) {
</del><ins>+                } else if ( arg1 &amp;&amp; arg2 &amp;&amp; typeof(arg1) == 'string' ) {
</ins><span class="cx">                         btn = new qt.TagButton(id, display, arg1, arg2, access, arg3, title);
</span><span class="cx">                 } else {
</span><span class="cx">                         return;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                if ( priority ) {
</del><ins>+                if ( priority == -1 ) // back-compat
+                        return btn;
+
+                if ( priority &gt; 0 ) {
</ins><span class="cx">                         while ( typeof(edButtons[priority]) != 'undefined' ) {
</span><span class="cx">                                 priority++
</span><span class="cx">                         }
</span><span class="lines">@@ -301,6 +329,9 @@
</span><span class="cx">                 } else {
</span><span class="cx">                         edButtons[edButtons.length] = btn;
</span><span class="cx">                 }
</span><ins>+
+                if ( this.buttonsInitDone )
+                        this._buttonsInit(); // add the button HTML to all instances toolbars if addButton() was called too late
</ins><span class="cx">         };
</span><span class="cx"> 
</span><span class="cx">         qt.insertContent = function(content) {
</span></span></pre></div>
<a id="trunkwpincludesjsquicktagsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/quicktags.js (18610 => 18611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/quicktags.js        2011-08-26 20:31:30 UTC (rev 18610)
+++ trunk/wp-includes/js/quicktags.js        2011-08-26 23:30:01 UTC (rev 18611)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var QTags,edButtons=[],edCanvas;function quicktags(a){return new QTags(a)}function edInsertContent(b,a){return QTags.insertContent(a)}function edButton(f,e,c,b,a,d){return QTags.addButton(f,e,c,b,d,a)}(function(){var c=function(h){var g,f,e;if(typeof jQuery!=&quot;undefined&quot;){jQuery(document).ready(h)}else{g=c;g.funcs=[];g.ready=function(){if(!g.isReady){g.isReady=true;for(f=0;f&lt;g.funcs.length;f++){g.funcs[f]()}}};if(g.isReady){h()}else{g.funcs.push(h)}if(!g.eventAttached){if(document.addEventListener){e=function(){document.removeEventListener(&quot;DOMContentLoaded&quot;,e,false);g.ready()};document.addEventListener(&quot;DOMContentLoaded&quot;,e,false);window.addEventListener(&quot;load&quot;,g.ready,false)}else{if(document.attachEvent){e=function(){if(document.readyState===&quot;complete&quot;){document.detachEvent(&quot;onreadystatechange&quot;,e);g.ready()}};document.attachEvent(&quot;onreadystatechange&quot;,e);window.attachEvent(&quot;onload&quot;,
 g.ready);(function(){try{document.documentElement.doScroll(&quot;left&quot;)}catch(i){setTimeout(arguments.callee,50);return}g.ready()})()}}g.eventAttached=true}}},a=(function(){var e=new Date(),f;f=function(g){var h=g.toString();if(h.length&lt;2){h=&quot;0&quot;+h}return h};return e.getUTCFullYear()+&quot;-&quot;+f(e.getUTCMonth()+1)+&quot;-&quot;+f(e.getUTCDate())+&quot;T&quot;+f(e.getUTCHours())+&quot;:&quot;+f(e.getUTCMinutes())+&quot;:&quot;+f(e.getUTCSeconds())+&quot;+00:00&quot;})(),b={},d;d=QTags=function(k){if(typeof(k)==&quot;string&quot;){k={id:k}}else{if(typeof(k)!=&quot;object&quot;){return false}}var s=this,g=k.id,q={},p={},j=document.getElementById(g),e=&quot;qt_&quot;+g,o=&quot;&quot;,n,l,m,h,r,f;if(!g||!j){return false}s.name=e;s.id=g;s.canvas=j;for(n in edButtons){if(!edButtons[n]){continue}q[edButtons[n].id]=edButtons[n]}if(g==&quot;content&quot;&amp;&amp;adminpage&amp;&amp;(adminpage==&quot;post-new-php&quot;||adminpage==&quot;post-php&quot;)){q.fullscree
 n=new d.FullscreenButton();edCanvas=j;f=&quot;ed_toolbar&quot;}else{f=e+&quot;_toolbar&quot;}for(n in s._customButtons){q[n]=new s._customButtons[n]()}if(k.buttons){m=k.buttons.split(&quot;,&quot;);for(n in m){h=m[n];if(q[h]){p[h]=q[h]}}}else{p=q}if(k.disabled_buttons){m=k.disabled_buttons.split(&quot;,&quot;);for(n in m){h=m[n];if(p[h]){delete (p[h])}}}for(n in p){o+=p[n].html(e+&quot;_&quot;)}l=document.createElement(&quot;div&quot;);l.id=f;l.className=&quot;quicktags-toolbar&quot;;j.parentNode.insertBefore(l,j);l.innerHTML=o;s.toolbar=l;r=function(v){v=v||window.event;var u=v.target||v.srcElement,t;if(/\s+ed_button\s+/.test(&quot; &quot;+u.className+&quot; &quot;)){s.canvas=j=document.getElementById(g);t=u.id.replace(e+&quot;_&quot;,&quot;&quot;);if(p[t]){p[t].callback.call(p[t],u,j,s)}}};if(l.addEventListener){l.addEventListener(&quot;click&quot;,r,false)}else{if(l.attachEvent){l.attachEvent(&quot;onclick&quot;,r)}}s.getButton=function(i){return q[i]};d.instances[g]=s;if
 (!d.instances[0]){d.instances[0]=d.instances[g]}};d.instances={};d.registerButton=function(f,e){b[f]=e};d.getInstance=function(e){return d.instances[e]};d.addButton=function(e,k,j,i,h,g,l,m){var f;if(!e||!k){return}if(typeof(j)==&quot;function&quot;){f=new d.Button(e,k,g,l);f.callback=j}else{if(typeof(j)==&quot;string&quot;&amp;&amp;j&amp;&amp;i){f=new d.TagButton(e,k,j,i,g,h,l)}else{return}}if(m){while(typeof(edButtons[m])!=&quot;undefined&quot;){m++}edButtons[m]=f}else{edButtons[edButtons.length]=f}};d.insertContent=function(h){var i,g,f,j,k,e=document.getElementById(wpActiveEditor);if(!e){return false}if(document.selection){e.focus();i=document.selection.createRange();i.text=h;e.focus()}else{if(e.selectionStart||e.selectionStart==&quot;0&quot;){k=e.value;g=e.selectionStart;f=e.selectionEnd;j=e.scrollTop;e.value=k.substring(0,g)+h+k.substring(f,k.length);e.focus();e.selectionStart=g+h.length;e.selectionEnd=g+h.length;e.scrollTop=j}else{e.value+=h;e.focus()}}return true};d.
 Button=function(i,g,e,h){var f=this;f.id=i;f.display=g;f.access=e;f.title=h||&quot;&quot;};d.Button.prototype.html=function(f){var e=this.access?' accesskey=&quot;'+this.access+'&quot;':&quot;&quot;;return'&lt;input type=&quot;button&quot; id=&quot;'+f+this.id+'&quot;'+e+' class=&quot;ed_button&quot; title=&quot;'+this.title+'&quot; value=&quot;'+this.display+'&quot; /&gt;'};d.Button.prototype.callback=function(){};d.TagButton=function(l,j,g,f,e,h,k){var i=this;d.Button.call(i,l,j,e,k);i.tagStart=g;i.tagEnd=f;i.open=h};d.TagButton.prototype=new d.Button();d.TagButton.prototype.openTag=function(h,f){var g=this;if(!f.openTags){f.openTags=[]}if(g.tagEnd){f.openTags.push(g.id);h.value=&quot;/&quot;+h.value}};d.TagButton.prototype.closeTag=function(j,f){var h=this,g=h.isOpen(f);if(g!==false){f.openTags.splice(g,1)}j.value=h.display};d.TagButton.prototype.isOpen=function(e){var h=this,g=0,f=false;if(e.openTags){while(f===false&amp;&amp;g&lt;e.openTags.length){f=e.openTags[g]==h.id
 ?g:false;g++}}else{f=false}return f};d.TagButton.prototype.callback=function(p,j,q){var w=this,s,f,n,h,u=j.value,k,e,o,g,m=u?w.tagEnd:&quot;&quot;;if(document.selection){j.focus();g=document.selection.createRange();if(g.text.length&gt;0){g.text=w.tagStart+g.text+m}else{if(w.isOpen(q)===false||w.tagEnd===&quot;&quot;){g.text=w.tagStart;w.openTag(p,q)}else{g.text=m;w.closeTag(p,q)}}j.focus()}else{if(j.selectionStart||j.selectionStart==&quot;0&quot;){s=j.selectionStart;f=j.selectionEnd;n=f;h=j.scrollTop;k=u.substring(0,s);e=u.substring(f,u.length);o=u.substring(s,f);if(s!=f){j.value=k+w.tagStart+o+m+e;if(m===&quot;&quot;){n=s}n+=w.tagStart.length+m.length}else{if(w.isOpen(q)===false||w.tagEnd===&quot;&quot;){j.value=k+w.tagStart+e;w.openTag(p,q);n=s+w.tagStart.length}else{j.value=k+m+e;n=s+m.length;w.closeTag(p,q)}}j.focus();j.selectionStart=n;j.selectionEnd=n;j.scrollTop=h}else{if(w.isOpen(q)!==false||w.tagEnd===&quot;&quot;){j.value+=w.tagStart;w.openTag(p,q)}else{j.value+=m;
 w.closeTag(p,q)}j.focus()}}};d.SpellButton=function(){d.Button.call(this,&quot;spell&quot;,quicktagsL10n.lookup,&quot;&quot;,quicktagsL10n.dictionaryLookup)};d.SpellButton.prototype=new d.Button();d.SpellButton.prototype.callback=function(i,h,e){var k=&quot;&quot;,j,g,f;if(document.selection){h.focus();j=document.selection.createRange();if(j.text.length&gt;0){k=j.text}}else{if(h.selectionStart||h.selectionStart==&quot;0&quot;){g=h.selectionStart;f=h.selectionEnd;if(g!=f){k=h.value.substring(g,f)}}}if(k===&quot;&quot;){k=prompt(quicktagsL10n.wordLookup,&quot;&quot;)}if(k!==null&amp;&amp;/^\w[\w ]*$/.test(k)){window.open(&quot;http://www.answers.com/&quot;+encodeURIComponent(k))}};d.CloseButton=function(){d.Button.call(this,&quot;close&quot;,quicktagsL10n.closeTags,&quot;&quot;,quicktagsL10n.closeAllOpenTags)};d.CloseButton.prototype=new d.Button();d.CloseButton.prototype.callback=function(j,k,f){var h,g,i=f.openTags;if(i){while(i.length&gt;0){h=f.getButton(i[i.length-1]);g=do
 cument.getElementById(f.name+&quot;_&quot;+h.id);h.callback.call(h,g,k,f)}}};d.closeAllTags=function(g){var e=this.getInstance(g),f=e.getButton(&quot;close&quot;);f.callback.call(f,&quot;&quot;,e.canvas,e)};d.LinkButton=function(){d.TagButton.call(this,&quot;link&quot;,&quot;link&quot;,&quot;&quot;,&quot;&lt;/a&gt;&quot;,&quot;a&quot;)};d.LinkButton.prototype=new d.TagButton();d.LinkButton.prototype.callback=function(j,k,h,g){var f,i=this;if(typeof(wpLink)!=&quot;undefined&quot;){wpLink.open();return}if(!g){g=&quot;http://&quot;}if(i.isOpen(h)===false){f=prompt(quicktagsL10n.enterURL,g);if(f){i.tagStart='&lt;a href=&quot;'+f+'&quot;&gt;';d.TagButton.prototype.callback.call(i,j,k,h)}}else{d.TagButton.prototype.callback.call(i,j,k,h)}};d.ImgButton=function(){d.TagButton.call(this,&quot;img&quot;,&quot;img&quot;,&quot;&quot;,&quot;&quot;,&quot;m&quot;,-1)};d.ImgButton.prototype=new d.TagButton();d.ImgButton.prototype.callback=function(i,k,g,f){if(!f){f=&quot;http://&quot;}var j
 =prompt(quicktagsL10n.enterImageURL,f),h;if(j){h=prompt(quicktagsL10n.enterImageDescription,&quot;&quot;);this.tagStart='&lt;img src=&quot;'+j+'&quot; alt=&quot;'+h+'&quot; /&gt;';d.TagButton.prototype.callback.call(this,i,k,g)}};d.FullscreenButton=function(){d.Button.call(this,&quot;fullscreen&quot;,quicktagsL10n.fullscreen,&quot;f&quot;,quicktagsL10n.toggleFullscreen)};d.FullscreenButton.prototype=new d.Button();d.FullscreenButton.prototype.callback=function(f,g){if(g.id!=&quot;content&quot;||typeof(fullscreen)==&quot;undefined&quot;){return}fullscreen.on()};edButtons[10]=new d.TagButton(&quot;strong&quot;,&quot;b&quot;,&quot;&lt;strong&gt;&quot;,&quot;&lt;/strong&gt;&quot;,&quot;b&quot;);edButtons[20]=new d.TagButton(&quot;em&quot;,&quot;i&quot;,&quot;&lt;em&gt;&quot;,&quot;&lt;/em&gt;&quot;,&quot;i&quot;),edButtons[30]=new d.LinkButton(),edButtons[40]=new d.TagButton(&quot;block&quot;,&quot;b-quote&quot;,&quot;\n\n&lt;blockquote&gt;&quot;,&quot;&lt;/blockquote&gt;\n\n&qu
 ot;,&quot;q&quot;),edButtons[50]=new d.TagButton(&quot;del&quot;,&quot;del&quot;,'&lt;del datetime=&quot;'+a+'&quot;&gt;',&quot;&lt;/del&gt;&quot;,&quot;d&quot;),edButtons[60]=new d.TagButton(&quot;ins&quot;,&quot;ins&quot;,'&lt;ins datetime=&quot;'+a+'&quot;&gt;',&quot;&lt;/ins&gt;&quot;,&quot;s&quot;),edButtons[70]=new d.ImgButton(),edButtons[80]=new d.TagButton(&quot;ul&quot;,&quot;ul&quot;,&quot;&lt;ul&gt;\n&quot;,&quot;&lt;/ul&gt;\n\n&quot;,&quot;u&quot;),edButtons[90]=new d.TagButton(&quot;ol&quot;,&quot;ol&quot;,&quot;&lt;ol&gt;\n&quot;,&quot;&lt;/ol&gt;\n\n&quot;,&quot;o&quot;),edButtons[100]=new d.TagButton(&quot;li&quot;,&quot;li&quot;,&quot;\t&lt;li&gt;&quot;,&quot;&lt;/li&gt;\n&quot;,&quot;l&quot;),edButtons[110]=new d.TagButton(&quot;code&quot;,&quot;code&quot;,&quot;&lt;code&gt;&quot;,&quot;&lt;/code&gt;&quot;,&quot;c&quot;),edButtons[120]=new d.TagButton(&quot;more&quot;,&quot;more&quot;,&quot;&lt;!--more--&gt;&quot;,&quot;&quot;,&quot;t&quot;,-1),edButtons[13
 0]=new d.SpellButton(),edButtons[140]=new d.CloseButton()})();
</del><span class="cx">\ No newline at end of file
</span><ins>+var QTags,edButtons=[],edCanvas;function quicktags(a){return new QTags(a)}function edInsertContent(b,a){return QTags.insertContent(a)}function edButton(f,e,c,b,a,d){return QTags.addButton(f,e,c,b,d,a,&quot;&quot;,-1)}(function(){var c=function(h){var g,f,e;if(typeof jQuery!=&quot;undefined&quot;){jQuery(document).ready(h)}else{g=c;g.funcs=[];g.ready=function(){if(!g.isReady){g.isReady=true;for(f=0;f&lt;g.funcs.length;f++){g.funcs[f]()}}};if(g.isReady){h()}else{g.funcs.push(h)}if(!g.eventAttached){if(document.addEventListener){e=function(){document.removeEventListener(&quot;DOMContentLoaded&quot;,e,false);g.ready()};document.addEventListener(&quot;DOMContentLoaded&quot;,e,false);window.addEventListener(&quot;load&quot;,g.ready,false)}else{if(document.attachEvent){e=function(){if(document.readyState===&quot;complete&quot;){document.detachEvent(&quot;onreadystatechange&quot;,e);g.ready()}};document.attachEvent(&quot;onreadystatechange&quot;,e);window.attachEvent(&qu
 ot;onload&quot;,g.ready);(function(){try{document.documentElement.doScroll(&quot;left&quot;)}catch(i){setTimeout(arguments.callee,50);return}g.ready()})()}}g.eventAttached=true}}},a=(function(){var e=new Date(),f;f=function(g){var h=g.toString();if(h.length&lt;2){h=&quot;0&quot;+h}return h};return e.getUTCFullYear()+&quot;-&quot;+f(e.getUTCMonth()+1)+&quot;-&quot;+f(e.getUTCDate())+&quot;T&quot;+f(e.getUTCHours())+&quot;:&quot;+f(e.getUTCMinutes())+&quot;:&quot;+f(e.getUTCSeconds())+&quot;+00:00&quot;})(),b={},d;d=QTags=function(k){if(typeof(k)==&quot;string&quot;){k={id:k}}else{if(typeof(k)!=&quot;object&quot;){return false}}var j=this,l=k.id,i=document.getElementById(l),h=&quot;qt_&quot;+l,e,g,f;if(!l||!i){return false}j.name=h;j.id=l;j.canvas=i;j.settings=k;if(l==&quot;content&quot;&amp;&amp;adminpage&amp;&amp;(adminpage==&quot;post-new-php&quot;||adminpage==&quot;post-php&quot;)){edCanvas=i;f=&quot;ed_toolbar&quot;}else{f=h+&quot;_toolbar&quot;}e=document.createElement(&
 quot;div&quot;);e.id=f;e.className=&quot;quicktags-toolbar&quot;;i.parentNode.insertBefore(e,i);j.toolbar=e;g=function(o){o=o||window.event;var n=o.target||o.srcElement,m;if(/\s+ed_button\s+/.test(&quot; &quot;+n.className+&quot; &quot;)){j.canvas=i=document.getElementById(l);m=n.id.replace(h+&quot;_&quot;,&quot;&quot;);if(j.theButtons[m]){j.theButtons[m].callback.call(j.theButtons[m],n,i,j)}}};if(e.addEventListener){e.addEventListener(&quot;click&quot;,g,false)}else{if(e.attachEvent){e.attachEvent(&quot;onclick&quot;,g)}}j.getButton=function(m){return j.theButtons[m]};j.getButtonElement=function(m){return document.getElementById(h+&quot;_&quot;+m)};d.instances[l]=j;if(!d.instances[0]){d.instances[0]=d.instances[l];c(function(){d._buttonsInit()})}};d.instances={};d.registerButton=function(f,e){b[f]=e};d.getInstance=function(e){return d.instances[e]};d._buttonsInit=function(){var q=this,p,h,e,j,o={},n={},m=&quot;&quot;,f,l,k,g;for(f in q.instances){if(f==0){continue}p=q.insta
 nces[f];h=p.canvas;e=p.name;j=p.settings;for(l in edButtons){if(!edButtons[l]){continue}o[edButtons[l].id]=edButtons[l]}if(f==&quot;content&quot;&amp;&amp;adminpage&amp;&amp;(adminpage==&quot;post-new-php&quot;||adminpage==&quot;post-php&quot;)){o.fullscreen=new d.FullscreenButton()}for(l in q._customButtons){if(!o[l]){o[l]=new q._customButtons[l]()}}if(j.buttons){k=j.buttons.split(&quot;,&quot;);for(l in k){g=k[l];if(o[g]){n[g]=o[g]}}}else{n=o}if(j.disabled_buttons){k=j.disabled_buttons.split(&quot;,&quot;);for(l in k){g=k[l];if(n[g]){delete (n[g])}}}for(l in n){m+=n[l].html(e+&quot;_&quot;)}p.toolbar.innerHTML=m;p.theButtons=n}q.buttonsInitDone=true};d.addButton=function(e,k,j,i,h,g,l,m){var f;if(!e||!k){return}m=m||0;if(typeof(j)==&quot;function&quot;){f=new d.Button(e,k,g,l);f.callback=j}else{if(j&amp;&amp;i&amp;&amp;typeof(j)==&quot;string&quot;){f=new d.TagButton(e,k,j,i,g,h,l)}else{return}}if(m==-1){return f}if(m&gt;0){while(typeof(edButtons[m])!=&quot;undefined&quot;
 ){m++}edButtons[m]=f}else{edButtons[edButtons.length]=f}if(this.buttonsInitDone){this._buttonsInit()}};d.insertContent=function(h){var i,g,f,j,k,e=document.getElementById(wpActiveEditor);if(!e){return false}if(document.selection){e.focus();i=document.selection.createRange();i.text=h;e.focus()}else{if(e.selectionStart||e.selectionStart==&quot;0&quot;){k=e.value;g=e.selectionStart;f=e.selectionEnd;j=e.scrollTop;e.value=k.substring(0,g)+h+k.substring(f,k.length);e.focus();e.selectionStart=g+h.length;e.selectionEnd=g+h.length;e.scrollTop=j}else{e.value+=h;e.focus()}}return true};d.Button=function(i,g,e,h){var f=this;f.id=i;f.display=g;f.access=e;f.title=h||&quot;&quot;};d.Button.prototype.html=function(f){var e=this.access?' accesskey=&quot;'+this.access+'&quot;':&quot;&quot;;return'&lt;input type=&quot;button&quot; id=&quot;'+f+this.id+'&quot;'+e+' class=&quot;ed_button&quot; title=&quot;'+this.title+'&quot; value=&quot;'+this.display+'&quot; /&gt;'};d.Button.prototype.callback
 =function(){};d.TagButton=function(l,j,g,f,e,h,k){var i=this;d.Button.call(i,l,j,e,k);i.tagStart=g;i.tagEnd=f;i.open=h};d.TagButton.prototype=new d.Button();d.TagButton.prototype.openTag=function(h,f){var g=this;if(!f.openTags){f.openTags=[]}if(g.tagEnd){f.openTags.push(g.id);h.value=&quot;/&quot;+h.value}};d.TagButton.prototype.closeTag=function(j,f){var h=this,g=h.isOpen(f);if(g!==false){f.openTags.splice(g,1)}j.value=h.display};d.TagButton.prototype.isOpen=function(e){var h=this,g=0,f=false;if(e.openTags){while(f===false&amp;&amp;g&lt;e.openTags.length){f=e.openTags[g]==h.id?g:false;g++}}else{f=false}return f};d.TagButton.prototype.callback=function(p,j,q){var w=this,s,f,n,h,u=j.value,k,e,o,g,m=u?w.tagEnd:&quot;&quot;;if(document.selection){j.focus();g=document.selection.createRange();if(g.text.length&gt;0){g.text=w.tagStart+g.text+m}else{if(w.isOpen(q)===false||w.tagEnd===&quot;&quot;){g.text=w.tagStart;w.openTag(p,q)}else{g.text=m;w.closeTag(p,q)}}j.focus()}else{if(j.se
 lectionStart||j.selectionStart==&quot;0&quot;){s=j.selectionStart;f=j.selectionEnd;n=f;h=j.scrollTop;k=u.substring(0,s);e=u.substring(f,u.length);o=u.substring(s,f);if(s!=f){j.value=k+w.tagStart+o+m+e;if(m===&quot;&quot;){n=s}n+=w.tagStart.length+m.length}else{if(w.isOpen(q)===false||w.tagEnd===&quot;&quot;){j.value=k+w.tagStart+e;w.openTag(p,q);n=s+w.tagStart.length}else{j.value=k+m+e;n=s+m.length;w.closeTag(p,q)}}j.focus();j.selectionStart=n;j.selectionEnd=n;j.scrollTop=h}else{if(w.isOpen(q)!==false||w.tagEnd===&quot;&quot;){j.value+=w.tagStart;w.openTag(p,q)}else{j.value+=m;w.closeTag(p,q)}j.focus()}}};d.SpellButton=function(){d.Button.call(this,&quot;spell&quot;,quicktagsL10n.lookup,&quot;&quot;,quicktagsL10n.dictionaryLookup)};d.SpellButton.prototype=new d.Button();d.SpellButton.prototype.callback=function(i,h,e){var k=&quot;&quot;,j,g,f;if(document.selection){h.focus();j=document.selection.createRange();if(j.text.length&gt;0){k=j.text}}else{if(h.selectionStart||h.selec
 tionStart==&quot;0&quot;){g=h.selectionStart;f=h.selectionEnd;if(g!=f){k=h.value.substring(g,f)}}}if(k===&quot;&quot;){k=prompt(quicktagsL10n.wordLookup,&quot;&quot;)}if(k!==null&amp;&amp;/^\w[\w ]*$/.test(k)){window.open(&quot;http://www.answers.com/&quot;+encodeURIComponent(k))}};d.CloseButton=function(){d.Button.call(this,&quot;close&quot;,quicktagsL10n.closeTags,&quot;&quot;,quicktagsL10n.closeAllOpenTags)};d.CloseButton.prototype=new d.Button();d.CloseButton.prototype.callback=function(j,k,f){var h,g,i=f.openTags;if(i){while(i.length&gt;0){h=f.getButton(i[i.length-1]);g=document.getElementById(f.name+&quot;_&quot;+h.id);h.callback.call(h,g,k,f)}}};d.closeAllTags=function(g){var e=this.getInstance(g),f=e.getButton(&quot;close&quot;);f.callback.call(f,&quot;&quot;,e.canvas,e)};d.LinkButton=function(){d.TagButton.call(this,&quot;link&quot;,&quot;link&quot;,&quot;&quot;,&quot;&lt;/a&gt;&quot;,&quot;a&quot;)};d.LinkButton.prototype=new d.TagButton();d.LinkButton.prototype.ca
 llback=function(j,k,h,g){var f,i=this;if(typeof(wpLink)!=&quot;undefined&quot;){wpLink.open();return}if(!g){g=&quot;http://&quot;}if(i.isOpen(h)===false){f=prompt(quicktagsL10n.enterURL,g);if(f){i.tagStart='&lt;a href=&quot;'+f+'&quot;&gt;';d.TagButton.prototype.callback.call(i,j,k,h)}}else{d.TagButton.prototype.callback.call(i,j,k,h)}};d.ImgButton=function(){d.TagButton.call(this,&quot;img&quot;,&quot;img&quot;,&quot;&quot;,&quot;&quot;,&quot;m&quot;,-1)};d.ImgButton.prototype=new d.TagButton();d.ImgButton.prototype.callback=function(i,k,g,f){if(!f){f=&quot;http://&quot;}var j=prompt(quicktagsL10n.enterImageURL,f),h;if(j){h=prompt(quicktagsL10n.enterImageDescription,&quot;&quot;);this.tagStart='&lt;img src=&quot;'+j+'&quot; alt=&quot;'+h+'&quot; /&gt;';d.TagButton.prototype.callback.call(this,i,k,g)}};d.FullscreenButton=function(){d.Button.call(this,&quot;fullscreen&quot;,quicktagsL10n.fullscreen,&quot;f&quot;,quicktagsL10n.toggleFullscreen)};d.FullscreenButton.prototype=ne
 w d.Button();d.FullscreenButton.prototype.callback=function(f,g){if(g.id!=&quot;content&quot;||typeof(fullscreen)==&quot;undefined&quot;){return}fullscreen.on()};edButtons[10]=new d.TagButton(&quot;strong&quot;,&quot;b&quot;,&quot;&lt;strong&gt;&quot;,&quot;&lt;/strong&gt;&quot;,&quot;b&quot;);edButtons[20]=new d.TagButton(&quot;em&quot;,&quot;i&quot;,&quot;&lt;em&gt;&quot;,&quot;&lt;/em&gt;&quot;,&quot;i&quot;),edButtons[30]=new d.LinkButton(),edButtons[40]=new d.TagButton(&quot;block&quot;,&quot;b-quote&quot;,&quot;\n\n&lt;blockquote&gt;&quot;,&quot;&lt;/blockquote&gt;\n\n&quot;,&quot;q&quot;),edButtons[50]=new d.TagButton(&quot;del&quot;,&quot;del&quot;,'&lt;del datetime=&quot;'+a+'&quot;&gt;',&quot;&lt;/del&gt;&quot;,&quot;d&quot;),edButtons[60]=new d.TagButton(&quot;ins&quot;,&quot;ins&quot;,'&lt;ins datetime=&quot;'+a+'&quot;&gt;',&quot;&lt;/ins&gt;&quot;,&quot;s&quot;),edButtons[70]=new d.ImgButton(),edButtons[80]=new d.TagButton(&quot;ul&quot;,&quot;ul&quot;,&quot;&l
 t;ul&gt;\n&quot;,&quot;&lt;/ul&gt;\n\n&quot;,&quot;u&quot;),edButtons[90]=new d.TagButton(&quot;ol&quot;,&quot;ol&quot;,&quot;&lt;ol&gt;\n&quot;,&quot;&lt;/ol&gt;\n\n&quot;,&quot;o&quot;),edButtons[100]=new d.TagButton(&quot;li&quot;,&quot;li&quot;,&quot;\t&lt;li&gt;&quot;,&quot;&lt;/li&gt;\n&quot;,&quot;l&quot;),edButtons[110]=new d.TagButton(&quot;code&quot;,&quot;code&quot;,&quot;&lt;code&gt;&quot;,&quot;&lt;/code&gt;&quot;,&quot;c&quot;),edButtons[120]=new d.TagButton(&quot;more&quot;,&quot;more&quot;,&quot;&lt;!--more--&gt;&quot;,&quot;&quot;,&quot;t&quot;,-1),edButtons[130]=new d.SpellButton(),edButtons[140]=new d.CloseButton()})();
</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 (18610 => 18611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2011-08-26 20:31:30 UTC (rev 18610)
+++ trunk/wp-includes/script-loader.php        2011-08-26 23:30:01 UTC (rev 18611)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx"> 
</span><span class="cx">         $scripts-&gt;add( 'sack', &quot;/wp-includes/js/tw-sack$suffix.js&quot;, false, '1.6.1', 1 );
</span><span class="cx"> 
</span><del>-        $scripts-&gt;add( 'quicktags', &quot;/wp-includes/js/quicktags$suffix.js&quot;, false, '20110820', 1 );
</del><ins>+        $scripts-&gt;add( 'quicktags', &quot;/wp-includes/js/quicktags$suffix.js&quot;, false, '20110826', 1 );
</ins><span class="cx">         $scripts-&gt;add_script_data( 'quicktags', 'quicktagsL10n', array(
</span><span class="cx">                 'wordLookup' =&gt; __('Enter a word to look up:'),
</span><span class="cx">                 'dictionaryLookup' =&gt; esc_attr(__('Dictionary lookup')),
</span></span></pre>
</div>
</div>

</body>
</html>