<!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>[18497] trunk: Refactor Quicktags, props garyc40, 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/18497">18497</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2011-08-03 10:11:12 +0000 (Wed, 03 Aug 2011)</dd>
</dl>
<h3>Log Message</h3>
<pre>Refactor Quicktags, props garyc40, see <a href="http://core.trac.wordpress.org/ticket/16695">#16695</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminjseditcommentsdevjs">trunk/wp-admin/js/edit-comments.dev.js</a></li>
<li><a href="#trunkwpadminjseditcommentsjs">trunk/wp-admin/js/edit-comments.js</a></li>
<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="trunkwpadminjseditcommentsdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/edit-comments.dev.js (18496 => 18497)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/edit-comments.dev.js        2011-08-03 01:54:29 UTC (rev 18496)
+++ trunk/wp-admin/js/edit-comments.dev.js        2011-08-03 10:11:12 UTC (rev 18497)
</span><span class="lines">@@ -548,8 +548,12 @@
</span><span class="cx">         commentReply.init();
</span><span class="cx">         $(document).delegate('span.delete a.delete', 'click', function(){return false;});
</span><span class="cx">
</span><del>-        if ( typeof QTags != 'undefined' )
-                ed_reply = new QTags('ed_reply', 'replycontent', 'replycontainer', 'more,fullscreen');
</del><ins>+        if ( typeof QTags != 'undefined' ) {
+                quicktags({quicktags_id: 'replycontent', quicktags_buttons: 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close'});
+        
+        
+        console.debug('typeof QTags')
+        }
</ins><span class="cx">
</span><span class="cx">         if ( typeof $.table_hotkeys != 'undefined' ) {
</span><span class="cx">                 make_hotkeys_redirect = function(which) {
</span></span></pre></div>
<a id="trunkwpadminjseditcommentsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/edit-comments.js (18496 => 18497)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/edit-comments.js        2011-08-03 01:54:29 UTC (rev 18496)
+++ trunk/wp-admin/js/edit-comments.js        2011-08-03 10:11:12 UTC (rev 18497)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var theList,theExtraList,toggleWithKeyboard=false,getCount,updateCount,updatePending,dashboardTotals;(function(a){setCommentsList=function(){var c,e,g,j=0,f,h,d,i,b;c=a('input[name="_total"]',"#comments-form");e=a('input[name="_per_page"]',"#comments-form");g=a('input[name="_page"]',"#comments-form");f=function(n,l){var p=a("#"+l.element),k,o,m;k=a("#replyrow");o=a("#comment_ID",k).val();m=a("#replybtn",k);if(p.is(".unapproved")){if(l.data.id==o){m.text(adminCommentsL10n.replyApprove)}p.find("div.comment_status").html("0")}else{if(l.data.id==o){m.text(adminCommentsL10n.reply)}p.find("div.comment_status").html("1")}a("span.pending-count").each(function(){var q=a(this),s,r;s=q.html().replace(/[^0-9]+/g,"");s=parseInt(s,10);if(isNaN(s)){return}r=a("#"+l.element).is("."+l.dimClass
)?1:-1;s=s+r;if(s<0){s=0}q.closest(".awaiting-mod")[0==s?"addClass":"removeClass"]("count-0");updateCount(q,s);dashboardTotals()})};h=function(o,s){var u=a(o.target).attr("class"),k,l,m,r,t,q,p=false;o.data._total=c.val()||0;o.data._per_page=e.val()||0;o.data._page=g.val()||0;o.data._url=document.location.href;o.data.comment_status=a('input[name="comment_status"]',"#comments-form").val();if(u.indexOf(":trash=1")!=-1){p="trash"}else{if(u.indexOf(":spam=1")!=-1){p="spam"}}if(p){k=u.replace(/.*?comment-([0-9]+).*/,"$1");l=a("#comment-"+k);note=a("#"+p+"-undo-holder").html();l.find(".check-column :checkbox").prop("checked",false);if(l.siblings("#replyrow").length&&commentReply.cid==k){commentReply.close()}if(l.is("tr")){m=l.children(":visible").length;q=a(".author st
rong",l).text();r=a('<tr id="undo-'+k+'" class="undo un'+p+'" style="display:none;"><td colspan="'+m+'">'+note+"</td></tr>")}else{q=a(".comment-author",l).text();r=a('<div id="undo-'+k+'" style="display:none;" class="undo un'+p+'">'+note+"</div>")}l.before(r);a("strong","#undo-"+k).text(q+" ");t=a(".undo a","#undo-"+k);t.attr("href","comment.php?action=un"+p+"comment&c="+k+"&_wpnonce="+o.data._ajax_nonce);t.attr("class","delete:the-comment-list:comment-"+k+"::un"+p+"=1 vim-z vim-destructive");a(".avatar",l).clone().prependTo("#undo-"+k+" ."+p+"-undo-inside");t.click(function(){s.wpList.del(this);a("#undo-"+k).css({backgroundColor:"#ceb"}).fad
eOut(350,function(){a(this).remove();a("#comment-"+k).css("backgroundColor","").fadeIn(300,function(){a(this).show()})});return false})}return o};d=function(k,l,m){if(l<j){return}if(m){j=l}c.val(k.toString());a("span.total-type-count").each(function(){updateCount(a(this),k)})};dashboardTotals=function(q){var p=a("#dashboard_right_now"),l,o,m,k;q=q||0;if(isNaN(q)||!p.length){return}l=a("span.total-count",p);o=a("span.approved-count",p);m=getCount(l);m=m+q;k=m-getCount(a("span.pending-count",p))-getCount(a("span.spam-count",p));updateCount(l,m);updateCount(o,k)};getCount=function(k){var l=parseInt(k.html().replace(/[^0-9]+/g,""),10);if(isNaN(l)){return 0}return l};updateCount=function(l,m){var k="";if(isNaN(m)){return}m=m<1?"0":m.toString();if(m.length>3){while(m.length>3){k=thousandsSeparator+m.substr(m.length-3)+k;m=m.substr(0,m.length-3)}m=m+k}
l.html(m)};updatePending=function(k){a("span.pending-count").each(function(){var l=a(this);if(k<0){k=0}l.closest(".awaiting-mod")[0==k?"addClass":"removeClass"]("count-0");updateCount(l,k);dashboardTotals()})};i=function(k,n){var q,o,u=a(n.target).parent().is("span.untrash"),m=a(n.target).parent().is("span.unspam"),t,s,l,p=a("#"+n.element).is(".unapproved");function v(r){if(a(n.target).parent().is("span."+r)){return 1}else{if(a("#"+n.element).is("."+r)){return -1}}return 0}t=v("spam");s=v("trash");if(u){s=-1}if(m){t=-1}l=getCount(a("span.pending-count").eq(0));if(a(n.target).parent().is("span.unapprove")||((u||m)&&p)){l=l+1}else{if(p){l=l-1}}updatePending(l);a("span.spam-count").each(function(){var r=a(this),w=getCount(r)+t;updateCount(r,w)});a("span.trash-count").each(function(){var r=a
(this),w=getCount(r)+s;updateCount(r,w)});if(a("#dashboard_right_now").length){o=s?-1*s:0;dashboardTotals(o)}else{q=c.val()?parseInt(c.val(),10):0;q=q-t-s;if(q<0){q=0}if(("object"==typeof k)&&j<n.parsed.responses[0].supplemental.time){total_items_i18n=n.parsed.responses[0].supplemental.total_items_i18n||"";if(total_items_i18n){a(".displaying-num").text(total_items_i18n);a(".total-pages").text(n.parsed.responses[0].supplemental.total_pages_i18n);a(".tablenav-pages").find(".next-page, .last-page").toggleClass("disabled",n.parsed.responses[0].supplemental.total_pages==a(".current-page").val())}d(q,n.parsed.responses[0].supplemental.time,true)}else{d(q,k,false)}}if(!theExtraList||theExtraList.size()==0||theExtraList.children().size()==0||u||m){return}theList.get(0).wpList.add(theExtraList.children(":eq(0)").remove().clone());b()};b=function(n){var l=a.query.get(),k=a
(".total-pages").text(),m=a('input[name="_per_page"]',"#comments-form").val();if(!l.paged){l.paged=1}if(l.paged>k){return}if(n){theExtraList.empty();l.number=Math.min(8,m)}else{l.number=1;l.offset=Math.min(8,m)-1}l.no_placeholder=true;l.paged++;if(true===l.comment_type){l.comment_type=""}l=a.extend(l,{action:"fetch-list",list_args:list_args,_ajax_fetch_list_nonce:a("#_ajax_fetch_list_nonce").val()});a.ajax({url:ajaxurl,global:false,dataType:"json",data:l,success:function(o){theExtraList.get(0).wpList.add(o.rows)}})};theExtraList=a("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"});theList=a("#the-comment-list").wpList({alt:"",delBefore:h,dimAfter:f,delAfter:i,addColor:"none"}).bind("wpListDelEnd",function(l,k){var m=k.element.replace(/[^0-9]+/g,"");if(k.target.className.indexOf(":trash
=1")!=-1||k.target.className.indexOf(":spam=1")!=-1){a("#undo-"+m).fadeIn(300,function(){a(this).show()})}})};commentReply={cid:"",act:"",init:function(){var b=a("#replyrow");a("a.cancel",b).click(function(){return commentReply.revert()});a("a.save",b).click(function(){return commentReply.send()});a("input#author, input#author-email, input#author-url",b).keypress(function(c){if(c.which==13){commentReply.send();c.preventDefault();return false}});a("#the-comment-list .column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())});a("#doaction, #doaction2, #post-query-submit").click(function(c){if(a("#the-comment-list #replyrow").length>0){commentReply.close()}});this.comments_listing=a('#comments-form > input[name="comment_status"]').val()||""},addEvents:function(b){b.each(function(){a(this).find(".column-comment
> p").dblclick(function(){commentReply.toggle(a(this).parent())})})},toggle:function(b){if(a(b).css("display")!="none"){a(b).find("a.vim-q").click()}},revert:function(){if(a("#the-comment-list #replyrow").length<1){return false}a("#replyrow").fadeOut("fast",function(){commentReply.close()});return false},close:function(){var b;if(this.cid){b=a("#comment-"+this.cid);if(this.act=="edit-comment"){b.fadeIn(300,function(){b.show()}).css("backgroundColor","")}a("#replyrow").hide();a("#com-reply").append(a("#replyrow"));a("#replycontent").val("");a("input","#edithead").val("");a(".error","#replysubmit").html("").hide();a(".waiting","#replysubmit").hide();if(a.browser.msie){a("#replycontainer, #replycontent").css("height",&qu
ot;120px")}else{a("#replycontainer").resizable("destroy").css("height","120px")}this.cid=""}},open:function(b,d,k){var m=this,e,f,i,g,j=a("#comment-"+b),l;m.close();m.cid=b;e=a("#replyrow");f=a("#inline-"+b);i=m.act=(k=="edit")?"edit-comment":"replyto-comment";a("#action",e).val(i);a("#comment_post_ID",e).val(d);a("#comment_ID",e).val(b);if(k=="edit"){a("#author",e).val(a("div.author",f).text());a("#author-email",e).val(a("div.author-email",f).text());a("#author-url",e).val(a("div.author-url",f).text());a("#status",e).val(a("div.comment_status",f).text());a("#replycontent",e).val(a("textarea.comment",f).val());a("#edithead, #savebtn",e).show();a("#replyhead, #replybtn",e).hide();g=j.height();if(g>220){
if(a.browser.msie){a("#replycontainer, #replycontent",e).height(g-105)}else{a("#replycontainer",e).height(g-105)}}j.after(e).fadeOut("fast",function(){a("#replyrow").fadeIn(300,function(){a(this).show()})})}else{l=a("#replybtn",e);a("#edithead, #savebtn",e).hide();a("#replyhead, #replybtn",e).show();j.after(e);if(j.hasClass("unapproved")){l.text(adminCommentsL10n.replyApprove)}else{l.text(adminCommentsL10n.reply)}a("#replyrow").fadeIn(300,function(){a(this).show()})}setTimeout(function(){var o,h,p,c,n;o=a("#replyrow").offset().top;h=o+a("#replyrow").height();p=window.pageYOffset||document.documentElement.scrollTop;c=document.documentElement.clientHeight||self.innerHeight||0;n=p+c;if(n-20<h){window.scroll(0,h-c+35)}else{if(o-20<p){window.scroll(0,o-35)}}a("#replycontent").focus().keyup(function(q){if(q.which==27){commentReply.revert()}})},600);return f
alse},send:function(){var b={};a("#replysubmit .error").hide();a("#replysubmit .waiting").show();a("#replyrow input").not(":button").each(function(){b[a(this).attr("name")]=a(this).val()});b.content=a("#replycontent").val();b.id=b.comment_post_ID;b.comments_listing=this.comments_listing;b.p=a('[name="p"]').val();if(a("#comment-"+a("#comment_ID").val()).hasClass("unapproved")){b.approve_parent=1}a.ajax({type:"POST",url:ajaxurl,data:b,success:function(c){commentReply.show(c)},error:function(c){commentReply.error(c)}});return false},show:function(d){var f=this,g,i,h,e,b;f.revert();if(typeof(d)=="string"){f.error({responseText:d});return false}g=wpAjax.parseAjaxResponse(d);if(g.errors){f.error({responseText:wpAjax.broken});return false}g=g.responses[0];i=g.data;h="#comment-"+g.id;if("edit-comment"==f.act){a(h).remove()}if(g.supplemental.pare
nt_approved){b=a("#comment-"+g.supplemental.parent_approved);updatePending(getCount(a("span.pending-count").eq(0))-1);if(this.comments_listing=="moderated"){b.animate({backgroundColor:"#CCEEBB"},400,function(){b.fadeOut()});return}}a(i).hide();a("#replyrow").after(i);h=a(h);f.addEvents(h);e=h.hasClass("unapproved")?"#FFFFE0":h.closest(".widefat").css("backgroundColor");h.animate({backgroundColor:"#CCEEBB"},300).animate({backgroundColor:e},300,function(){if(b&&b.length){b.animate({backgroundColor:"#CCEEBB"},300).animate({backgroundColor:e},300).removeClass("unapproved").addClass("approved").find("div.comment_status").html("1")}})},error:function(b){var c=b.statusText;a("#replysubmit .waiting").hide();if(b.responseText){c=b.responseText.replace(/<.[^<>]*?>/g,"")}if(c){a("#replysubmit .
error").html(c).show()}}};a(document).ready(function(){var e,b,c,d;setCommentsList();commentReply.init();a(document).delegate("span.delete a.delete","click",function(){return false});if(typeof QTags!="undefined"){ed_reply=new QTags("ed_reply","replycontent","replycontainer","more,fullscreen")}if(typeof a.table_hotkeys!="undefined"){e=function(f){return function(){var h,g;h="next"==f?"first":"last";g=a(".tablenav-pages ."+f+"-page:not(.disabled)");if(g.length){window.location=g[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g,"")+"&hotkeys_highlight_"+h+"=1"}}};b=function(g,f){window.location=a("span.edit a",f).attr("href")};c=function(){toggleWithKeyboard=true;a("input:checkbox","#cb").click().prop("checked",false);toggleWithKeyboard=false};d=function
(f){return function(){var g=a('select[name="action"]');a('option[value="'+f+'"]',g).prop("selected",true);a("#doaction").click()}};a.table_hotkeys(a("table.widefat"),["a","u","s","d","r","q","z",["e",b],["shift+x",c],["shift+a",d("approve")],["shift+s",d("spam")],["shift+d",d("delete")],["shift+t",d("trash")],["shift+z",d("untrash")],["shift+u",d("unapprove")]],{highlight_first:adminCommentsL10n.hotkeys_highlight_first,highlight_last:adminCommentsL10n.hotkeys_highlight_last,prev_page_link_cb:e("prev"),next_page_link_cb:e("next")})}})})(jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+var theList,theExtraList,toggleWithKeyboard=false,getCount,updateCount,updatePending,dashboardTotals;(function(a){setCommentsList=function(){var c,e,g,j=0,f,h,d,i,b;c=a('input[name="_total"]',"#comments-form");e=a('input[name="_per_page"]',"#comments-form");g=a('input[name="_page"]',"#comments-form");f=function(n,l){var p=a("#"+l.element),k,o,m;k=a("#replyrow");o=a("#comment_ID",k).val();m=a("#replybtn",k);if(p.is(".unapproved")){if(l.data.id==o){m.text(adminCommentsL10n.replyApprove)}p.find("div.comment_status").html("0")}else{if(l.data.id==o){m.text(adminCommentsL10n.reply)}p.find("div.comment_status").html("1")}a("span.pending-count").each(function(){var q=a(this),s,r;s=q.html().replace(/[^0-9]+/g,"");s=parseInt(s,10);if(isNaN(s)){return}r=a("#"+l.element).is("."+l.dimClass
)?1:-1;s=s+r;if(s<0){s=0}q.closest(".awaiting-mod")[0==s?"addClass":"removeClass"]("count-0");updateCount(q,s);dashboardTotals()})};h=function(o,s){var u=a(o.target).attr("class"),k,l,m,r,t,q,p=false;o.data._total=c.val()||0;o.data._per_page=e.val()||0;o.data._page=g.val()||0;o.data._url=document.location.href;o.data.comment_status=a('input[name="comment_status"]',"#comments-form").val();if(u.indexOf(":trash=1")!=-1){p="trash"}else{if(u.indexOf(":spam=1")!=-1){p="spam"}}if(p){k=u.replace(/.*?comment-([0-9]+).*/,"$1");l=a("#comment-"+k);note=a("#"+p+"-undo-holder").html();l.find(".check-column :checkbox").prop("checked",false);if(l.siblings("#replyrow").length&&commentReply.cid==k){commentReply.close()}if(l.is("tr")){m=l.children(":visible").length;q=a(".author st
rong",l).text();r=a('<tr id="undo-'+k+'" class="undo un'+p+'" style="display:none;"><td colspan="'+m+'">'+note+"</td></tr>")}else{q=a(".comment-author",l).text();r=a('<div id="undo-'+k+'" style="display:none;" class="undo un'+p+'">'+note+"</div>")}l.before(r);a("strong","#undo-"+k).text(q+" ");t=a(".undo a","#undo-"+k);t.attr("href","comment.php?action=un"+p+"comment&c="+k+"&_wpnonce="+o.data._ajax_nonce);t.attr("class","delete:the-comment-list:comment-"+k+"::un"+p+"=1 vim-z vim-destructive");a(".avatar",l).clone().prependTo("#undo-"+k+" ."+p+"-undo-inside");t.click(function(){s.wpList.del(this);a("#undo-"+k).css({backgroundColor:"#ceb"}).fad
eOut(350,function(){a(this).remove();a("#comment-"+k).css("backgroundColor","").fadeIn(300,function(){a(this).show()})});return false})}return o};d=function(k,l,m){if(l<j){return}if(m){j=l}c.val(k.toString());a("span.total-type-count").each(function(){updateCount(a(this),k)})};dashboardTotals=function(q){var p=a("#dashboard_right_now"),l,o,m,k;q=q||0;if(isNaN(q)||!p.length){return}l=a("span.total-count",p);o=a("span.approved-count",p);m=getCount(l);m=m+q;k=m-getCount(a("span.pending-count",p))-getCount(a("span.spam-count",p));updateCount(l,m);updateCount(o,k)};getCount=function(k){var l=parseInt(k.html().replace(/[^0-9]+/g,""),10);if(isNaN(l)){return 0}return l};updateCount=function(l,m){var k="";if(isNaN(m)){return}m=m<1?"0":m.toString();if(m.length>3){while(m.length>3){k=thousandsSeparator+m.substr(m.length-3)+k;m=m.substr(0,m.length-3)}m=m+k}
l.html(m)};updatePending=function(k){a("span.pending-count").each(function(){var l=a(this);if(k<0){k=0}l.closest(".awaiting-mod")[0==k?"addClass":"removeClass"]("count-0");updateCount(l,k);dashboardTotals()})};i=function(k,n){var q,o,u=a(n.target).parent().is("span.untrash"),m=a(n.target).parent().is("span.unspam"),t,s,l,p=a("#"+n.element).is(".unapproved");function v(r){if(a(n.target).parent().is("span."+r)){return 1}else{if(a("#"+n.element).is("."+r)){return -1}}return 0}t=v("spam");s=v("trash");if(u){s=-1}if(m){t=-1}l=getCount(a("span.pending-count").eq(0));if(a(n.target).parent().is("span.unapprove")||((u||m)&&p)){l=l+1}else{if(p){l=l-1}}updatePending(l);a("span.spam-count").each(function(){var r=a(this),w=getCount(r)+t;updateCount(r,w)});a("span.trash-count").each(function(){var r=a
(this),w=getCount(r)+s;updateCount(r,w)});if(a("#dashboard_right_now").length){o=s?-1*s:0;dashboardTotals(o)}else{q=c.val()?parseInt(c.val(),10):0;q=q-t-s;if(q<0){q=0}if(("object"==typeof k)&&j<n.parsed.responses[0].supplemental.time){total_items_i18n=n.parsed.responses[0].supplemental.total_items_i18n||"";if(total_items_i18n){a(".displaying-num").text(total_items_i18n);a(".total-pages").text(n.parsed.responses[0].supplemental.total_pages_i18n);a(".tablenav-pages").find(".next-page, .last-page").toggleClass("disabled",n.parsed.responses[0].supplemental.total_pages==a(".current-page").val())}d(q,n.parsed.responses[0].supplemental.time,true)}else{d(q,k,false)}}if(!theExtraList||theExtraList.size()==0||theExtraList.children().size()==0||u||m){return}theList.get(0).wpList.add(theExtraList.children(":eq(0)").remove().clone());b()};b=function(n){var l=a.query.get(),k=a
(".total-pages").text(),m=a('input[name="_per_page"]',"#comments-form").val();if(!l.paged){l.paged=1}if(l.paged>k){return}if(n){theExtraList.empty();l.number=Math.min(8,m)}else{l.number=1;l.offset=Math.min(8,m)-1}l.no_placeholder=true;l.paged++;if(true===l.comment_type){l.comment_type=""}l=a.extend(l,{action:"fetch-list",list_args:list_args,_ajax_fetch_list_nonce:a("#_ajax_fetch_list_nonce").val()});a.ajax({url:ajaxurl,global:false,dataType:"json",data:l,success:function(o){theExtraList.get(0).wpList.add(o.rows)}})};theExtraList=a("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"});theList=a("#the-comment-list").wpList({alt:"",delBefore:h,dimAfter:f,delAfter:i,addColor:"none"}).bind("wpListDelEnd",function(l,k){var m=k.element.replace(/[^0-9]+/g,"");if(k.target.className.indexOf(":trash
=1")!=-1||k.target.className.indexOf(":spam=1")!=-1){a("#undo-"+m).fadeIn(300,function(){a(this).show()})}})};commentReply={cid:"",act:"",init:function(){var b=a("#replyrow");a("a.cancel",b).click(function(){return commentReply.revert()});a("a.save",b).click(function(){return commentReply.send()});a("input#author, input#author-email, input#author-url",b).keypress(function(c){if(c.which==13){commentReply.send();c.preventDefault();return false}});a("#the-comment-list .column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())});a("#doaction, #doaction2, #post-query-submit").click(function(c){if(a("#the-comment-list #replyrow").length>0){commentReply.close()}});this.comments_listing=a('#comments-form > input[name="comment_status"]').val()||""},addEvents:function(b){b.each(function(){a(this).find(".column-comment
> p").dblclick(function(){commentReply.toggle(a(this).parent())})})},toggle:function(b){if(a(b).css("display")!="none"){a(b).find("a.vim-q").click()}},revert:function(){if(a("#the-comment-list #replyrow").length<1){return false}a("#replyrow").fadeOut("fast",function(){commentReply.close()});return false},close:function(){var b;if(this.cid){b=a("#comment-"+this.cid);if(this.act=="edit-comment"){b.fadeIn(300,function(){b.show()}).css("backgroundColor","")}a("#replyrow").hide();a("#com-reply").append(a("#replyrow"));a("#replycontent").val("");a("input","#edithead").val("");a(".error","#replysubmit").html("").hide();a(".waiting","#replysubmit").hide();if(a.browser.msie){a("#replycontainer, #replycontent").css("height",&qu
ot;120px")}else{a("#replycontainer").resizable("destroy").css("height","120px")}this.cid=""}},open:function(b,d,k){var m=this,e,f,i,g,j=a("#comment-"+b),l;m.close();m.cid=b;e=a("#replyrow");f=a("#inline-"+b);i=m.act=(k=="edit")?"edit-comment":"replyto-comment";a("#action",e).val(i);a("#comment_post_ID",e).val(d);a("#comment_ID",e).val(b);if(k=="edit"){a("#author",e).val(a("div.author",f).text());a("#author-email",e).val(a("div.author-email",f).text());a("#author-url",e).val(a("div.author-url",f).text());a("#status",e).val(a("div.comment_status",f).text());a("#replycontent",e).val(a("textarea.comment",f).val());a("#edithead, #savebtn",e).show();a("#replyhead, #replybtn",e).hide();g=j.height();if(g>220){
if(a.browser.msie){a("#replycontainer, #replycontent",e).height(g-105)}else{a("#replycontainer",e).height(g-105)}}j.after(e).fadeOut("fast",function(){a("#replyrow").fadeIn(300,function(){a(this).show()})})}else{l=a("#replybtn",e);a("#edithead, #savebtn",e).hide();a("#replyhead, #replybtn",e).show();j.after(e);if(j.hasClass("unapproved")){l.text(adminCommentsL10n.replyApprove)}else{l.text(adminCommentsL10n.reply)}a("#replyrow").fadeIn(300,function(){a(this).show()})}setTimeout(function(){var o,h,p,c,n;o=a("#replyrow").offset().top;h=o+a("#replyrow").height();p=window.pageYOffset||document.documentElement.scrollTop;c=document.documentElement.clientHeight||self.innerHeight||0;n=p+c;if(n-20<h){window.scroll(0,h-c+35)}else{if(o-20<p){window.scroll(0,o-35)}}a("#replycontent").focus().keyup(function(q){if(q.which==27){commentReply.revert()}})},600);return f
alse},send:function(){var b={};a("#replysubmit .error").hide();a("#replysubmit .waiting").show();a("#replyrow input").not(":button").each(function(){b[a(this).attr("name")]=a(this).val()});b.content=a("#replycontent").val();b.id=b.comment_post_ID;b.comments_listing=this.comments_listing;b.p=a('[name="p"]').val();if(a("#comment-"+a("#comment_ID").val()).hasClass("unapproved")){b.approve_parent=1}a.ajax({type:"POST",url:ajaxurl,data:b,success:function(c){commentReply.show(c)},error:function(c){commentReply.error(c)}});return false},show:function(d){var f=this,g,i,h,e,b;f.revert();if(typeof(d)=="string"){f.error({responseText:d});return false}g=wpAjax.parseAjaxResponse(d);if(g.errors){f.error({responseText:wpAjax.broken});return false}g=g.responses[0];i=g.data;h="#comment-"+g.id;if("edit-comment"==f.act){a(h).remove()}if(g.supplemental.pare
nt_approved){b=a("#comment-"+g.supplemental.parent_approved);updatePending(getCount(a("span.pending-count").eq(0))-1);if(this.comments_listing=="moderated"){b.animate({backgroundColor:"#CCEEBB"},400,function(){b.fadeOut()});return}}a(i).hide();a("#replyrow").after(i);h=a(h);f.addEvents(h);e=h.hasClass("unapproved")?"#FFFFE0":h.closest(".widefat").css("backgroundColor");h.animate({backgroundColor:"#CCEEBB"},300).animate({backgroundColor:e},300,function(){if(b&&b.length){b.animate({backgroundColor:"#CCEEBB"},300).animate({backgroundColor:e},300).removeClass("unapproved").addClass("approved").find("div.comment_status").html("1")}})},error:function(b){var c=b.statusText;a("#replysubmit .waiting").hide();if(b.responseText){c=b.responseText.replace(/<.[^<>]*?>/g,"")}if(c){a("#replysubmit .
error").html(c).show()}}};a(document).ready(function(){var e,b,c,d;setCommentsList();commentReply.init();a(document).delegate("span.delete a.delete","click",function(){return false});if(typeof QTags!="undefined"){quicktags({quicktags_id:"replycontent",quicktags_buttons:"strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close"});console.debug("typeof QTags")}if(typeof a.table_hotkeys!="undefined"){e=function(f){return function(){var h,g;h="next"==f?"first":"last";g=a(".tablenav-pages ."+f+"-page:not(.disabled)");if(g.length){window.location=g[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g,"")+"&hotkeys_highlight_"+h+"=1"}}};b=function(g,f){window.location=a("span.edit a",f).attr("href")};c=function(){toggleWithKeyboard=true;a("input:checkbox","#cb").click().prop(&quo
t;checked",false);toggleWithKeyboard=false};d=function(f){return function(){var g=a('select[name="action"]');a('option[value="'+f+'"]',g).prop("selected",true);a("#doaction").click()}};a.table_hotkeys(a("table.widefat"),["a","u","s","d","r","q","z",["e",b],["shift+x",c],["shift+a",d("approve")],["shift+s",d("spam")],["shift+d",d("delete")],["shift+t",d("trash")],["shift+z",d("untrash")],["shift+u",d("unapprove")]],{highlight_first:adminCommentsL10n.hotkeys_highlight_first,highlight_last:adminCommentsL10n.hotkeys_highlight_last,prev_page_link_cb:e("prev"),next_page_link_cb:e("next")})}})})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjsquicktagsdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/quicktags.dev.js (18496 => 18497)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/quicktags.dev.js        2011-08-03 01:54:29 UTC (rev 18496)
+++ trunk/wp-includes/js/quicktags.dev.js        2011-08-03 10:11:12 UTC (rev 18497)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+/*
+ * Quicktags
+ *
+ * This is the HTML editor in WordPress. It can be attached to any textarea and will
+ * append a toolbar above it. This script is self-contained (does not require external libraries).
+ *
+ * Run quicktags(settings) to initialize it, where settings is an object containing up to 3 properties:
+ * settings = {
+ * quicktags_id: 'myid', // required
+ * buttons: '', // optional
+ * disabled_buttons: '' // optional
+ * }
+ *
+ * The settings can also be a string quicktags_id.
+ *
+ * quicktags_id The ID of the textarea that will be the editor canvas
+ * buttons Comma separated list of the buttons IDs that will be shown. Buttons added by plugins
+ * will not show. Default: 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,spell,close'
+ * disabled_buttons Comma separated list of the buttons IDs that should be excluded. Buttons
+ * added by plugins will show unless specifically disabled.
+ */
+
</ins><span class="cx"> // new edit toolbar used with permission
</span><span class="cx"> // by Alex King
</span><span class="cx"> // http://www.alexking.org/
</span><span class="lines">@@ -2,579 +24,464 @@
</span><span class="cx">
</span><del>-var edButtons = new Array(), edLinks = new Array(), edOpenTags = new Array(), now = new Date(), datetime;
</del><ins>+var QTags, edButtons, edButton;
</ins><span class="cx">
</span><del>-function edButton(id, display, tagStart, tagEnd, access, open) {
-        this.id = id;                                // used to name the toolbar button
-        this.display = display;                // label on button
-        this.tagStart = tagStart;         // open tag
-        this.tagEnd = tagEnd;                // close tag
-        this.access = access;                // access key
-        this.open = open;                        // set to -1 if tag does not need to be closed
</del><ins>+function quicktags(settings) {
+        return new QTags(settings);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-function zeroise(number, threshold) {
-        // FIXME: or we could use an implementation of printf in js here
-        var str = number.toString();
-        if (number < 0) { str = str.substr(1, str.length) }
-        while (str.length < threshold) { str = "0" + str }
-        if (number < 0) { str = '-' + str }
-        return str;
-}
</del><ins>+(function(){
+        // private stuff is prefixed with an underscore
+        var _domReady = function(func) {
+                var t, i, DOMContentLoaded;
</ins><span class="cx">
</span><del>-datetime = now.getUTCFullYear() + '-' +
-zeroise(now.getUTCMonth() + 1, 2) + '-' +
-zeroise(now.getUTCDate(), 2) + 'T' +
-zeroise(now.getUTCHours(), 2) + ':' +
-zeroise(now.getUTCMinutes(), 2) + ':' +
-zeroise(now.getUTCSeconds() ,2) +
-'+00:00';
</del><ins>+                if ( typeof jQuery != 'undefined' ) {
+                        jQuery(document).ready(func);
+                } else {
+                        t = _domReady;
+                        t.funcs = [];
</ins><span class="cx">
</span><del>-edButtons[edButtons.length] =
-new edButton('ed_strong'
-,'b'
-,'<strong>'
-,'</strong>'
-,'b'
-);
</del><ins>+                        t.ready = function() {
+                                if ( ! t.isReady ) {
+                                        t.isReady = true;
+                                        for ( i = 0; i < t.funcs.length; i++ ) {
+                                                t.funcs[i]();
+                                        }
+                                }
+                        };
</ins><span class="cx">
</span><del>-edButtons[edButtons.length] =
-new edButton('ed_em'
-,'i'
-,'<em>'
-,'</em>'
-,'i'
-);
</del><ins>+                        if ( t.isReady ) {
+                                func();
+                        } else {
+                                t.funcs.push(func);
+                        }
</ins><span class="cx">
</span><del>-edButtons[edButtons.length] =
-new edButton('ed_link'
-,'link'
-,''
-,'</a>'
-,'a'
-); // special case
</del><ins>+                        if ( ! t.eventAttached ) {
+                                if ( document.addEventListener ) {
+                                        DOMContentLoaded = function(){document.removeEventListener('DOMContentLoaded', DOMContentLoaded, false);t.ready();};
+                                        document.addEventListener('DOMContentLoaded', DOMContentLoaded, false);
+                                        window.addEventListener('load', t.ready, false);
+                                } else if ( document.attachEvent ) {
+                                        DOMContentLoaded = function(){if (document.readyState === 'complete'){ document.detachEvent('onreadystatechange', DOMContentLoaded);t.ready();}};
+                                        document.attachEvent('onreadystatechange', DOMContentLoaded);
+                                        window.attachEvent('onload', t.ready);
</ins><span class="cx">
</span><del>-edButtons[edButtons.length] =
-new edButton('ed_block'
-,'b-quote'
-,'\n\n<blockquote>'
-,'</blockquote>\n\n'
-,'q'
-);
</del><ins>+                                        (function(){
+                                                try {
+                                                        document.documentElement.doScroll("left");
+                                                } catch(e) {
+                                                        setTimeout(arguments.callee, 50);
+                                                        return;
+                                                }
</ins><span class="cx">
</span><ins>+                                                t.ready();
+                                        })();
+                                }
</ins><span class="cx">
</span><del>-edButtons[edButtons.length] =
-new edButton('ed_del'
-,'del'
-,'<del datetime="' + datetime + '">'
-,'</del>'
-,'d'
-);
</del><ins>+                                t.eventAttached = true;
+                        }
+                }
+        },
</ins><span class="cx">
</span><del>-edButtons[edButtons.length] =
-new edButton('ed_ins'
-,'ins'
-,'<ins datetime="' + datetime + '">'
-,'</ins>'
-,'s'
-);
</del><ins>+        _datetime = (function() {
+                var now = new Date(), zeroise;
</ins><span class="cx">
</span><del>-edButtons[edButtons.length] =
-new edButton('ed_img'
-,'img'
-,''
-,''
-,'m'
-,-1
-); // special case
</del><ins>+                zeroise = function(number) {
+                        var str = number.toString();
</ins><span class="cx">
</span><del>-edButtons[edButtons.length] =
-new edButton('ed_ul'
-,'ul'
-,'<ul>\n'
-,'</ul>\n\n'
-,'u'
-);
</del><ins>+                        if ( str.length < 2 )
+                                str = "0" + str;
</ins><span class="cx">
</span><del>-edButtons[edButtons.length] =
-new edButton('ed_ol'
-,'ol'
-,'<ol>\n'
-,'</ol>\n\n'
-,'o'
-);
</del><ins>+                        return str;
+                }
</ins><span class="cx">
</span><del>-edButtons[edButtons.length] =
-new edButton('ed_li'
-,'li'
-,'\t<li>'
-,'</li>\n'
-,'l'
-);
</del><ins>+                return now.getUTCFullYear() + '-' +
+                        zeroise( now.getUTCMonth() + 1 ) + '-' +
+                        zeroise( now.getUTCDate() ) + 'T' +
+                        zeroise( now.getUTCHours() ) + ':' +
+                        zeroise( now.getUTCMinutes() ) + ':' +
+                        zeroise( now.getUTCSeconds() ) +
+                        '+00:00';
+        })(),
</ins><span class="cx">
</span><del>-edButtons[edButtons.length] =
-new edButton('ed_code'
-,'code'
-,'<code>'
-,'</code>'
-,'c'
-);
</del><ins>+        _customButtons = {},
+        qt;
</ins><span class="cx">
</span><del>-edButtons[edButtons.length] =
-new edButton('ed_more'
-,'more'
-,'<!--more-->'
-,''
-,'t'
-,-1
-);
-/*
-edButtons[edButtons.length] =
-new edButton('ed_next'
-,'page'
-,'<!--nextpage-->'
-,''
-,'p'
-,-1
-);
-*/
-function edLink() {
-        this.display = '';
-        this.URL = '';
-        this.newWin = 0;
-}
</del><ins>+        qt = QTags = function(settings) {
+                if ( typeof(settings) == 'string' )
+                        settings = {quicktags_id: settings};
+                else if ( typeof(settings) != 'object' )
+                        return false;
</ins><span class="cx">
</span><del>-edLinks[edLinks.length] = new edLink('WordPress'
- ,'http://wordpress.org/'
- );
</del><ins>+                var t = this,
+                        id = settings.quicktags_id,
+                        buttons = {},
+                        theButtons = {},
+                        canvas = document.getElementById(id),
+                        name = 'qt_' + id,
+                        html = '',
+                        i, tb, qb, btn, onclick;
</ins><span class="cx">
</span><del>-edLinks[edLinks.length] = new edLink('alexking.org'
- ,'http://www.alexking.org/'
- );
</del><ins>+                if ( !id || !canvas )
+                        return false;
</ins><span class="cx">
</span><del>-function edShowButton(button, i) {
-        if (button.id == 'ed_img') {
-                document.write('<input type="button" id="' + button.id + '" accesskey="' + button.access + '" class="ed_button" onclick="edInsertImage(edCanvas);" value="' + button.display + '" />');
-        }
-        else if (button.id == 'ed_link') {
-                document.write('<input type="button" id="' + button.id + '" accesskey="' + button.access + '" class="ed_button" onclick="edInsertLink(edCanvas, ' + i + ');" value="' + button.display + '" />');
-        }
-        else {
-                document.write('<input type="button" id="' + button.id + '" accesskey="' + button.access + '" class="ed_button" onclick="edInsertTag(edCanvas, ' + i + ');" value="' + button.display + '" />');
-        }
-}
</del><ins>+                t.name = name;
+                t.id = id;
</ins><span class="cx">
</span><del>-function edShowLinks() {
-        var tempStr = '<select onchange="edQuickLink(this.options[this.selectedIndex].value, this);"><option value="-1" selected>' + quicktagsL10n.quickLinks + '</option>', i;
-        for (i = 0; i < edLinks.length; i++) {
-                tempStr += '<option value="' + i + '">' + edLinks[i].display + '</option>';
-        }
-        tempStr += '</select>';
-        document.write(tempStr);
-}
</del><ins>+                // default buttons
+                for ( i in edButtons ) {
+                        buttons[edButtons[i].id] = edButtons[i];
+                }
</ins><span class="cx">
</span><del>-function edAddTag(button) {
-        if (edButtons[button].tagEnd != '') {
-                edOpenTags[edOpenTags.length] = button;
-                document.getElementById(edButtons[button].id).value = '/' + document.getElementById(edButtons[button].id).value;
-        }
-}
</del><ins>+                if ( id == 'content' && adminpage && ( adminpage == 'post-new-php' || adminpage == 'post-php' ) )
+                        buttons['fullscreen'] = new qt.FullscreenButton();
</ins><span class="cx">
</span><del>-function edRemoveTag(button) {
-        for (var i = 0; i < edOpenTags.length; i++) {
-                if (edOpenTags[i] == button) {
-                        edOpenTags.splice(i, 1);
-                        document.getElementById(edButtons[button].id).value =                 document.getElementById(edButtons[button].id).value.replace('/', '');
</del><ins>+                // add custom buttons
+                for ( i in t._customButtons ) {
+                        buttons[i] = new t._customButtons[i]();
</ins><span class="cx">                 }
</span><del>-        }
-}
</del><span class="cx">
</span><del>-function edCheckOpenTags(button) {
-        var tag = 0, i;
-        for (i = 0; i < edOpenTags.length; i++) {
-                if (edOpenTags[i] == button) {
-                        tag++;
</del><ins>+                if ( settings.quicktags_buttons ) {
+                        qb = settings.quicktags_buttons.split(',');
+
+                        for ( i in qb ) {
+                                btn = qb[i];
+                                if ( buttons[btn] )
+                                        theButtons[btn] = buttons[btn];
+                        }
+                } else {
+                        theButtons = buttons;
</ins><span class="cx">                 }
</span><del>-        }
-        if (tag > 0) {
-                return true; // tag found
-        }
-        else {
-                return false; // tag not found
-        }
-}
</del><span class="cx">
</span><del>-function edCloseAllTags() {
-        var count = edOpenTags.length, o;
-        for (o = 0; o < count; o++) {
-                edInsertTag(edCanvas, edOpenTags[edOpenTags.length - 1]);
-        }
-}
</del><ins>+                if ( settings.quicktags_disabled_buttons ) {
+                        qb = settings.quicktags_disabled_buttons.split(',');
</ins><span class="cx">
</span><del>-function edQuickLink(i, thisSelect) {
-        if (i > -1) {
-                var newWin = '', tempStr;
-                if (edLinks[i].newWin == 1) {
-                        newWin = ' target="_blank"';
</del><ins>+                        for ( i in qb ) {
+                                btn = qb[i];
+                                if ( theButtons[btn] )
+                                        delete(theButtons[btn]);
+                        }
</ins><span class="cx">                 }
</span><del>-                tempStr = '<a href="' + edLinks[i].URL + '"' + newWin + '>'
-                 + edLinks[i].display
-                 + '</a>';
-                thisSelect.selectedIndex = 0;
-                edInsertContent(edCanvas, tempStr);
-        }
-        else {
-                thisSelect.selectedIndex = 0;
-        }
-}
</del><span class="cx">
</span><del>-function edSpell(myField) {
-        var word = '', sel, startPos, endPos;
-        if (document.selection) {
-                myField.focus();
-         sel = document.selection.createRange();
-                if (sel.text.length > 0) {
-                        word = sel.text;
-                }
-        }
-        else if (myField.selectionStart || myField.selectionStart == '0') {
-                startPos = myField.selectionStart;
-                endPos = myField.selectionEnd;
-                if (startPos != endPos) {
-                        word = myField.value.substring(startPos, endPos);
-                }
-        }
-        if (word == '') {
-                word = prompt(quicktagsL10n.wordLookup, '');
-        }
-        if (word !== null && /^\w[\w ]*$/.test(word)) {
-                window.open('http://www.answers.com/' + escape(word));
-        }
-}
</del><ins>+                for ( i in theButtons )
+                        html += theButtons[i].html(name + '_');
</ins><span class="cx">
</span><del>-function edToolbar() {
-        document.write('<div id="ed_toolbar">');
-        for (var i = 0; i < edButtons.length; i++) {
-                edShowButton(edButtons[i], i);
-        }
-        document.write('<input type="button" id="ed_spell" class="ed_button" onclick="edSpell(edCanvas);" title="' + quicktagsL10n.dictionaryLookup + '" value="' + quicktagsL10n.lookup + '" />');
-        document.write('<input type="button" id="ed_close" class="ed_button" onclick="edCloseAllTags();" title="' + quicktagsL10n.closeAllOpenTags + '" value="' + quicktagsL10n.closeTags + '" />');
-        document.write('<input type="button" id="ed_fullscreen" class="ed_button" onclick="fullscreen.on();" title="' + quicktagsL10n.toggleFullscreen + '" value="' + quicktagsL10n.fullscreen + '" />');
-//        edShowLinks(); // disabled by default
-        document.write('</div>');
-}
</del><ins>+                tb = document.createElement('div');
+                tb.id = name + '_toolbar';
+                tb.className = 'quicktags-toolbar';
</ins><span class="cx">
</span><del>-// insertion code
</del><ins>+                canvas.parentNode.insertBefore(tb, canvas);
</ins><span class="cx">
</span><del>-function edInsertTag(myField, i) {
-        //IE support
-        if (document.selection) {
-                myField.focus();
-         var sel = document.selection.createRange();
-                if (sel.text.length > 0) {
-                        sel.text = edButtons[i].tagStart + sel.text + edButtons[i].tagEnd;
-                }
-                else {
-                        if (!edCheckOpenTags(i) || edButtons[i].tagEnd == '') {
-                                sel.text = edButtons[i].tagStart;
-                                edAddTag(i);
-                        }
-                        else {
-                                sel.text = edButtons[i].tagEnd;
-                                edRemoveTag(i);
-                        }
-                }
-                myField.focus();
-        }
-        //MOZILLA/NETSCAPE support
-        else if (myField.selectionStart || myField.selectionStart == '0') {
-                var startPos = myField.selectionStart, endPos = myField.selectionEnd, cursorPos = endPos, scrollTop = myField.scrollTop;
</del><ins>+                tb.innerHTML = html;
+                t.toolbar = tb;
</ins><span class="cx">
</span><del>-                if (startPos != endPos) {
-                        myField.value = myField.value.substring(0, startPos)
-                         + edButtons[i].tagStart
-                         + myField.value.substring(startPos, endPos)
-                         + edButtons[i].tagEnd
-                         + myField.value.substring(endPos, myField.value.length);
-                        cursorPos += edButtons[i].tagStart.length + edButtons[i].tagEnd.length;
-                }
-                else {
-                        if (!edCheckOpenTags(i) || edButtons[i].tagEnd == '') {
-                                myField.value = myField.value.substring(0, startPos)
-                                 + edButtons[i].tagStart
-                                 + myField.value.substring(endPos, myField.value.length);
-                                edAddTag(i);
-                                cursorPos = startPos + edButtons[i].tagStart.length;
-                        }
-                        else {
-                                myField.value = myField.value.substring(0, startPos)
-                                 + edButtons[i].tagEnd
-                                 + myField.value.substring(endPos, myField.value.length);
-                                edRemoveTag(i);
-                                cursorPos = startPos + edButtons[i].tagEnd.length;
-                        }
-                }
-                myField.focus();
-                myField.selectionStart = cursorPos;
-                myField.selectionEnd = cursorPos;
-                myField.scrollTop = scrollTop;
-        }
-        else {
-                if (!edCheckOpenTags(i) || edButtons[i].tagEnd == '') {
-                        myField.value += edButtons[i].tagStart;
-                        edAddTag(i);
-                }
-                else {
-                        myField.value += edButtons[i].tagEnd;
-                        edRemoveTag(i);
-                }
-                myField.focus();
-        }
-}
</del><ins>+                // listen for click events
+                onclick = function(e) {
+                        e = e || window.event;
+                        var target = e.target || e.srcElement, i;
</ins><span class="cx">
</span><del>-function edInsertContent(myField, myValue) {
-        var sel, startPos, endPos, scrollTop;
</del><ins>+                        // as long as it has the class ed_button, execute the callback
+                        if ( /\s+ed_button\s+/.test(' ' + target.className + ' ' ) ) {
+                                // we have to reassign canvas here
+                                t.canvas = canvas = document.getElementById(id);
+                                i = target.id.replace(name + '_', '');
</ins><span class="cx">
</span><del>-        //IE support
-        if (document.selection) {
-                myField.focus();
-                sel = document.selection.createRange();
-                sel.text = myValue;
-                myField.focus();
-        }
-        //MOZILLA/NETSCAPE support
-        else if (myField.selectionStart || myField.selectionStart == '0') {
-                startPos = myField.selectionStart;
-                endPos = myField.selectionEnd;
-                scrollTop = myField.scrollTop;
-                myField.value = myField.value.substring(0, startPos)
-                 + myValue
- + myField.value.substring(endPos, myField.value.length);
-                myField.focus();
-                myField.selectionStart = startPos + myValue.length;
-                myField.selectionEnd = startPos + myValue.length;
-                myField.scrollTop = scrollTop;
-        } else {
-                myField.value += myValue;
-                myField.focus();
-        }
-}
</del><ins>+                                if ( theButtons[i] )
+                                        theButtons[i].callback.call(theButtons[i], target, canvas, t);
+                        }
+                };
</ins><span class="cx">
</span><del>-function edInsertLink(myField, i, defaultValue) {
-        if ( 'object' == typeof(wpLink) ) {
-                wpLink.open();
-        } else {
-                if (!defaultValue) {
-                        defaultValue = 'http://';
</del><ins>+                if ( tb.addEventListener ) {
+                        tb.addEventListener('click', onclick, false);
+                } else if ( tb.attachEvent ) {
+                        tb.attachEvent('onclick', onclick);
</ins><span class="cx">                 }
</span><del>-                if (!edCheckOpenTags(i)) {
-                        var URL = prompt(quicktagsL10n.enterURL, defaultValue);
-                        if (URL) {
-                                edButtons[i].tagStart = '<a href="' + URL + '">';
-                                edInsertTag(myField, i);
-                        }
-                }
-                else {
-                        edInsertTag(myField, i);
-                }
-        }
-}
</del><span class="cx">
</span><del>-function edInsertImage(myField) {
-        var myValue = prompt(quicktagsL10n.enterImageURL, 'http://');
-        if (myValue) {
-                myValue = '<img src="'
-                                + myValue
-                                + '" alt="' + prompt(quicktagsL10n.enterImageDescription, '')
-                                + '" />';
-                edInsertContent(myField, myValue);
-        }
-}
</del><ins>+                qt.instances[id] = t;
+        };
</ins><span class="cx">
</span><ins>+        qt.instances = {};
</ins><span class="cx">
</span><del>-// Allow multiple instances.
-// Name = unique value, id = textarea id, container = container div.
-// Can disable some buttons by passing comma delimited string as 4th param.
-var QTags = function(name, id, container, disabled) {
-        var t = this, cont = document.getElementById(container), i, tag, tb, html, sel;
</del><ins>+        qt.registerButton = function(id, btnClass) {
+                _customButtons[id] = btnClass;
+        };
</ins><span class="cx">
</span><del>-        t.Buttons = [];
-        t.Links = [];
-        t.OpenTags = [];
-        t.Canvas = document.getElementById(id);
</del><ins>+        qt.getInstance = function(id) {
+                return qt.instances[id];
+        };
</ins><span class="cx">
</span><del>-        if ( ! t.Canvas || ! cont )
-                return;
</del><ins>+        qt.insertContent = function(editor_id, content) {
+                var sel, startPos, endPos, scrollTop, text, ed = document.getElementById(editor_id);
</ins><span class="cx">
</span><del>-        disabled = ( typeof disabled != 'undefined' ) ? ','+disabled+',' : '';
</del><ins>+                if ( document.selection ) { //IE
+                        ed.focus();
+                        sel = document.selection.createRange();
+                        sel.text = content;
+                        ed.focus();
+                } else if ( ed.selectionStart || ed.selectionStart == '0' ) { // all other
+                        text = ed.value;
+                        startPos = ed.selectionStart;
+                        endPos = ed.selectionEnd;
+                        scrollTop = ed.scrollTop;
</ins><span class="cx">
</span><del>-        t.edShowButton = function(button, i) {
-                if ( disabled && (disabled.indexOf(','+button.display+',') != -1) )
-                        return '';
-                else if ( button.id == name+'_img' )
-                        return '<input type="button" id="' + button.id + '" accesskey="' + button.access + '" class="ed_button" onclick="edInsertImage('+name+'.Canvas);" value="' + button.display + '" />';
-                else if (button.id == name+'_link')
-                        return '<input type="button" id="' + button.id + '" accesskey="' + button.access + '" class="ed_button" onclick="'+name+'.edInsertLink('+i+');" value="'+button.display+'" />';
-                else
-                        return '<input type="button" id="' + button.id + '" accesskey="'+button.access+'" class="ed_button" onclick="'+name+'.edInsertTag('+i+');" value="'+button.display+'" />';
-        };
</del><ins>+                        ed.value = text.substring(0, startPos) + content + text.substring(endPos, text.length);
</ins><span class="cx">
</span><del>-        t.edAddTag = function(button) {
-                if ( t.Buttons[button].tagEnd != '' ) {
-                        t.OpenTags[t.OpenTags.length] = button;
-                        document.getElementById(t.Buttons[button].id).value = '/' + document.getElementById(t.Buttons[button].id).value;
</del><ins>+                        ed.focus();
+                        ed.selectionStart = startPos + content.length;
+                        ed.selectionEnd = startPos + content.length;
+                        ed.scrollTop = scrollTop;
+                } else {
+                        ed.value += content;
+                        ed.focus();
</ins><span class="cx">                 }
</span><span class="cx">         };
</span><span class="cx">
</span><del>-        t.edRemoveTag = function(button) {
-                for ( i = 0; i < t.OpenTags.length; i++ ) {
-                        if ( t.OpenTags[i] == button ) {
-                                t.OpenTags.splice(i, 1);
-                                document.getElementById(t.Buttons[button].id).value = document.getElementById(t.Buttons[button].id).value.replace('/', '');
-                        }
-                }
</del><ins>+        // a plain, dumb button
+        qt.Button = function(id, display, access, title) {
+                var t = this;
+                t.id = id;
+                t.display = display;
+                t.access = access;
+                t.title = title || '';
</ins><span class="cx">         };
</span><ins>+        qt.Button.prototype.html = function(idPrefix) {
+                var access = this.access ? ' accesskey="' + this.access + '"' : '';
+                return '<input type="button" id="' + idPrefix + this.id + '"' + access + ' class="ed_button" title="' + this.title + '" value="' + this.display + '" />';
+        };
+        qt.Button.prototype.callback = function(canvas) {};
</ins><span class="cx">
</span><del>-        t.edCheckOpenTags = function(button) {
-                tag = 0;
-                for ( var i = 0; i < t.OpenTags.length; i++ ) {
-                        if ( t.OpenTags[i] == button )
-                                tag++;
</del><ins>+        // a button that inserts HTML tag
+        qt.TagButton = function(id, display, tagStart, tagEnd, access, open, title) {
+                var t = this;
+                qt.Button.call(t, id, display, access, title);
+                t.tagStart = tagStart;
+                t.tagEnd = tagEnd;
+                t.open = open;
+        };
+        qt.TagButton.prototype = new qt.Button();
+        qt.TagButton.prototype.openTag = function(e, tb) {
+                var t = this;
+                if ( ! tb.openTags ) {
+                        tb.openTags = [];
</ins><span class="cx">                 }
</span><del>-                if ( tag > 0 ) return true; // tag found
-                else return false; // tag not found
</del><ins>+                if ( t.tagEnd ) {
+                        tb.openTags.push(t.id);
+                        e.value = '/' + e.value;
+                }
</ins><span class="cx">         };
</span><ins>+        qt.TagButton.prototype.closeTag = function(e, tb) {
+                var t = this,
+                        i = t.isOpen(tb);
</ins><span class="cx">
</span><del>-        this.edCloseAllTags = function() {
-                var count = t.OpenTags.length;
-                for ( var o = 0; o < count; o++ )
-                        t.edInsertTag(t.OpenTags[t.OpenTags.length - 1]);
-        };
</del><ins>+                if ( i !== false ) {
+                        tb.openTags.splice(i, 1);
+                }
</ins><span class="cx">
</span><del>-        this.edQuickLink = function(i, thisSelect) {
-                if ( i > -1 ) {
-                        var newWin = '', tempStr;
-                        if ( Links[i].newWin == 1 ) {
-                                newWin = ' target="_blank"';
</del><ins>+                e.value = t.display;
+        };
+        // whether a tag is open or not. Returns false if not open, or current open depth of the tag
+        qt.TagButton.prototype.isOpen = function (tb) {
+                var t = this, i = 0, ret = false;
+                if ( tb.openTags ) {
+                        while ( ret === false && i < tb.openTags.length ) {
+                                ret = tb.openTags[i] == t.id ? i : false;
+                                i ++;
</ins><span class="cx">                         }
</span><del>-                        tempStr = '<a href="' + Links[i].URL + '"' + newWin + '>'
-                         + Links[i].display
-                         + '</a>';
-                        thisSelect.selectedIndex = 0;
-                        edInsertContent(t.Canvas, tempStr);
</del><span class="cx">                 } else {
</span><del>-                        thisSelect.selectedIndex = 0;
</del><ins>+                        ret = false;
</ins><span class="cx">                 }
</span><ins>+                return ret;
</ins><span class="cx">         };
</span><ins>+        qt.TagButton.prototype.callback = function(element, canvas, toolbar) {
+                var t = this, startPos, endPos, cursorPos, scrollTop, v, l, r, i, sel;
</ins><span class="cx">
</span><del>-        // insertion code
-        t.edInsertTag = function(i) {
-                //IE support
</del><ins>+                v = canvas.value;
+
+                // IE support
</ins><span class="cx">                 if ( document.selection ) {
</span><del>-                        t.Canvas.focus();
-                 sel = document.selection.createRange();
</del><ins>+                        canvas.focus();
+                        sel = document.selection.createRange();
</ins><span class="cx">                         if ( sel.text.length > 0 ) {
</span><del>-                                sel.text = t.Buttons[i].tagStart + sel.text + t.Buttons[i].tagEnd;
</del><ins>+                                sel.text = t.tagStart + sel.text + t.tagEnd;
</ins><span class="cx">                         } else {
</span><del>-                                if ( ! t.edCheckOpenTags(i) || t.Buttons[i].tagEnd == '' ) {
-                                        sel.text = t.Buttons[i].tagStart;
-                                        t.edAddTag(i);
</del><ins>+                                if ( t.isOpen(toolbar) === false || t.tagEnd === '' ) {
+                                        sel.text = t.tagStart;
+                                        t.openTag(element, toolbar);
</ins><span class="cx">                                 } else {
</span><del>-                                        sel.text = t.Buttons[i].tagEnd;
-                                        t.edRemoveTag(i);
</del><ins>+                                        sel.text = t.tagEnd;
+                                        t.closeTag(element, toolbar);
</ins><span class="cx">                                 }
</span><span class="cx">                         }
</span><del>-                        t.Canvas.focus();
-                } else if ( t.Canvas.selectionStart || t.Canvas.selectionStart == '0' ) { //MOZILLA/NETSCAPE support
-                        var startPos = t.Canvas.selectionStart, endPos = t.Canvas.selectionEnd, cursorPos = endPos, scrollTop = t.Canvas.scrollTop;
-
</del><ins>+                        canvas.focus();
+                }
+                // moz, webkit, opera
+                else if ( canvas.selectionStart || canvas.selectionStart == '0' ) {
+                        startPos = canvas.selectionStart;
+                        endPos = canvas.selectionEnd;
+                        cursorPos = endPos;
+                        scrollTop = canvas.scrollTop;
+                        l = v.substring(0, startPos); // left of the selection
+                        r = v.substring(endPos, v.length); // right of the selection
+                        i = v.substring(startPos, endPos); // inside the selection
</ins><span class="cx">                         if ( startPos != endPos ) {
</span><del>-                                t.Canvas.value = t.Canvas.value.substring(0, startPos)
-                                 + t.Buttons[i].tagStart
-                                 + t.Canvas.value.substring(startPos, endPos)
-                                 + t.Buttons[i].tagEnd
-                                 + t.Canvas.value.substring(endPos, t.Canvas.value.length);
-                                cursorPos += t.Buttons[i].tagStart.length + t.Buttons[i].tagEnd.length;
</del><ins>+                                canvas.value = l + t.tagStart + i + t.tagEnd + r;
+                                if ( t.tagEnd === '' ) {
+                                        cursorPos = startPos;
+                                }
+                                cursorPos += t.tagStart.length + t.tagEnd.length;
</ins><span class="cx">                         } else {
</span><del>-                                if ( !t.edCheckOpenTags(i) || t.Buttons[i].tagEnd == '' ) {
-                                        t.Canvas.value = t.Canvas.value.substring(0, startPos)
-                                         + t.Buttons[i].tagStart
-                                         + t.Canvas.value.substring(endPos, t.Canvas.value.length);
-                                        t.edAddTag(i);
-                                        cursorPos = startPos + t.Buttons[i].tagStart.length;
</del><ins>+                                if ( t.isOpen(toolbar) === false || t.tagEnd === '' ) {
+                                        canvas.value = l + t.tagStart + r;
+                                        t.openTag(element, toolbar);
+                                        cursorPos = startPos + t.tagStart.length;
</ins><span class="cx">                                 } else {
</span><del>-                                        t.Canvas.value = t.Canvas.value.substring(0, startPos)
-                                         + t.Buttons[i].tagEnd
-                                         + t.Canvas.value.substring(endPos, t.Canvas.value.length);
-                                        t.edRemoveTag(i);
-                                        cursorPos = startPos + t.Buttons[i].tagEnd.length;
</del><ins>+                                        canvas.value = l + t.tagEnd + r;
+                                        cursorPos = startPos + t.tagEnd.length;
+                                        t.closeTag(element, toolbar);
</ins><span class="cx">                                 }
</span><span class="cx">                         }
</span><del>-                        t.Canvas.focus();
-                        t.Canvas.selectionStart = cursorPos;
-                        t.Canvas.selectionEnd = cursorPos;
-                        t.Canvas.scrollTop = scrollTop;
-                } else {
-                        if ( ! t.edCheckOpenTags(i) || t.Buttons[i].tagEnd == '' ) {
-                                t.Canvas.value += Buttons[i].tagStart;
-                                t.edAddTag(i);
</del><ins>+
+                        canvas.focus();
+                        canvas.selectionStart = cursorPos;
+                        canvas.selectionEnd = cursorPos;
+                        canvas.scrollTop = scrollTop;
+                }
+                // other browsers
+                else {
+                        if ( t.isOpen(toolbar) !== false || t.tagEnd === '' ) {
+                                canvas.value += t.tagStart;
+                                t.openTag(element, toolbar);
</ins><span class="cx">                         } else {
</span><del>-                                t.Canvas.value += Buttons[i].tagEnd;
-                                t.edRemoveTag(i);
</del><ins>+                                canvas.value += t.tagEnd;
+                                t.closeTag(element, toolbar);
</ins><span class="cx">                         }
</span><del>-                        t.Canvas.focus();
</del><ins>+                        canvas.focus();
</ins><span class="cx">                 }
</span><span class="cx">         };
</span><span class="cx">
</span><del>-        this.edInsertLink = function(i, defaultValue) {
</del><ins>+        // the spell button
+        qt.SpellButton = function() {
+                qt.Button.call(this, 'spell', quicktagsL10n.lookup, '', quicktagsL10n.dictionaryLookup);
+        };
+        qt.SpellButton.prototype = new qt.Button();
+        qt.SpellButton.prototype.callback = function(element, canvas, toolbar) {
+                var word = '', sel, startPos, endPos;
+
+                if ( document.selection ) {
+                        canvas.focus();
+                        sel = document.selection.createRange();
+                        if ( sel.text.length > 0 ) {
+                                word = sel.text;
+                        }
+                }
+                else if ( canvas.selectionStart || canvas.selectionStart == '0' ) {
+                        startPos = canvas.selectionStart;
+                        endPos = canvas.selectionEnd;
+                        if ( startPos != endPos ) {
+                                word = canvas.value.substring(startPos, endPos);
+                        }
+                }
+
+                if ( word === '' ) {
+                        word = prompt(quicktagsL10n.wordLookup, '');
+                }
+
+                if ( word !== null && /^\w[\w ]*$/.test(word)) {
+                        window.open('http://www.answers.com/' + encodeURIComponent(word));
+                }
+        };
+
+        // the close button
+        qt.CloseButton = function() {
+                qt.Button.call(this, 'close', quicktagsL10n.closeTags, '', quicktagsL10n.closeAllOpenTags);
+        };
+        qt.CloseButton.prototype = new qt.Button();
+        qt.CloseButton.prototype.callback = function(e, c, tb) {
+                var button, element, tbo = tb.openTags;
+                if ( tbo ) {
+                        while ( tbo.length > 0 ) {
+                                button = tb.getButton(tbo[tbo.length - 1]);
+                                element = document.getElementById(tb.name + '_' + button.id);
+                                button.callback.call(button, element, c, tb);
+                        }
+                }
+        };
+
+        qt.prototype.closeAllTags = function() {
+                var btn = this.getButton('close');
+                btn.callback.call(btn, '', this.canvas, this.toolbar);
+        };
+
+        // the link button
+        qt.LinkButton = function() {
+                qt.TagButton.call(this, 'link', 'link', '', '</a>', 'a');
+        };
+        qt.LinkButton.prototype = new qt.TagButton();
+        qt.LinkButton.prototype.callback = function(e, c, tb, defaultValue) {
+                var URL, t = this;
+
+                if ( typeof(wpLink) != 'undefined' ) {
+                        wpLink.open();
+                        return;
+                }
+
</ins><span class="cx">                 if ( ! defaultValue )
</span><span class="cx">                         defaultValue = 'http://';
</span><span class="cx">
</span><del>-                if ( ! t.edCheckOpenTags(i) ) {
-                        var URL = prompt(quicktagsL10n.enterURL, defaultValue);
</del><ins>+                if ( t.isOpen(tb) === false ) {
+                        URL = prompt(quicktagsL10n.enterURL, defaultValue);
</ins><span class="cx">                         if ( URL ) {
</span><del>-                                t.Buttons[i].tagStart = '<a href="' + URL + '">';
-                                t.edInsertTag(i);
</del><ins>+                                t.tagStart = '<a href="' + URL + '">';
+                                qt.TagButton.prototype.callback.call(t, e, c, tb);
</ins><span class="cx">                         }
</span><span class="cx">                 } else {
</span><del>-                        t.edInsertTag(i);
</del><ins>+                        qt.TagButton.prototype.callback.call(t, e, c, tb);
</ins><span class="cx">                 }
</span><span class="cx">         };
</span><span class="cx">
</span><del>-        this.edInsertImage = function() {
-                var myValue = prompt(quicktagsL10n.enterImageURL, 'http://');
-                if ( myValue ) {
-                        myValue = '<img src="'
-                                        + myValue
-                                        + '" alt="' + prompt(quicktagsL10n.enterImageDescription, '')
-                                        + '" />';
-                        edInsertContent(t.Canvas, myValue);
</del><ins>+        // the img button
+        qt.ImgButton = function() {
+                qt.TagButton.call(this, 'img', 'img', '', '', 'm', -1);
+        };
+        qt.ImgButton.prototype = new qt.TagButton();
+        qt.ImgButton.prototype.callback = function(e, c, tb, defaultValue) {
+                if ( ! defaultValue ) {
+                        defaultValue = 'http://';
</ins><span class="cx">                 }
</span><ins>+                var src = prompt(quicktagsL10n.enterImageURL, defaultValue), alt;
+                if ( src ) {
+                        alt = prompt(quicktagsL10n.enterImageDescription, '');
+                        this.tagStart = '<img src="' + src + '" alt="' + alt + '" />';
+                        qt.TagButton.prototype.callback.call(this, e, c, tb);
+                }
</ins><span class="cx">         };
</span><span class="cx">
</span><del>-        t.Buttons[t.Buttons.length] = new edButton(name+'_strong','b','<strong>','</strong>','b');
-        t.Buttons[t.Buttons.length] = new edButton(name+'_em','i','<em>','</em>','i');
-        t.Buttons[t.Buttons.length] = new edButton(name+'_link','link','','</a>','a'); // special case
-        t.Buttons[t.Buttons.length] = new edButton(name+'_block','b-quote','\n\n<blockquote>','</blockquote>\n\n','q');
-        t.Buttons[t.Buttons.length] = new edButton(name+'_del','del','<del datetime="' + datetime + '">','</del>','d');
-        t.Buttons[t.Buttons.length] = new edButton(name+'_ins','ins','<ins datetime="' + datetime + '">','</ins>','s');
-        t.Buttons[t.Buttons.length] = new edButton(name+'_img','img','','','m',-1); // special case
-        t.Buttons[t.Buttons.length] = new edButton(name+'_ul','ul','<ul>\n','</ul>\n\n','u');
-        t.Buttons[t.Buttons.length] = new edButton(name+'_ol','ol','<ol>\n','</ol>\n\n','o');
-        t.Buttons[t.Buttons.length] = new edButton(name+'_li','li','\t<li>','</li>\n','l');
-        t.Buttons[t.Buttons.length] = new edButton(name+'_code','code','<code>','</code>','c');
-        t.Buttons[t.Buttons.length] = new edButton(name+'_more','more','<!--more-->','','t',-1);
-//        t.Buttons[t.Buttons.length] = new edButton(name+'_next','page','<!--nextpage-->','','p',-1);
</del><ins>+        qt.FullscreenButton = function() {
+                qt.Button.call(this, 'fullscreen', quicktagsL10n.fullscreen, 'f', quicktagsL10n.toggleFullscreen);
+        };
+        qt.FullscreenButton.prototype = new qt.Button();
+        qt.FullscreenButton.prototype.callback = function(e, c) {
+                if ( c.id != 'content' || typeof(fullscreen) == 'undefined' )
+                        return;
</ins><span class="cx">
</span><del>-        tb = document.createElement('div');
-        tb.id = name+'_qtags';
</del><ins>+                fullscreen.on();
+        };
</ins><span class="cx">
</span><del>-        html = '<div id="'+name+'_toolbar">';
-        for (i = 0; i < t.Buttons.length; i++)
-                html += t.edShowButton(t.Buttons[i], i);
</del><ins>+        // ensure backward compatibility
+        edButtons = [
+                new qt.TagButton('strong','b','<strong>','</strong>','b'),
+                new qt.TagButton('em','i','<em>','</em>','i'),
+                new qt.LinkButton(), // special case
+                new qt.TagButton('block','b-quote','\n\n<blockquote>','</blockquote>\n\n','q'),
+                new qt.TagButton('del','del','<del datetime="' + _datetime + '">','</del>','d'),
+                new qt.TagButton('ins','ins','<ins datetime="' + _datetime + '">','</ins>','s'),
+                new qt.ImgButton(), // special case
+                new qt.TagButton('ul','ul','<ul>\n','</ul>\n\n','u'),
+                new qt.TagButton('ol','ol','<ol>\n','</ol>\n\n','o'),
+                new qt.TagButton('li','li','\t<li>','</li>\n','l'),
+                new qt.TagButton('code','code','<code>','</code>','c'),
+                new qt.TagButton('more','more','<!--more-->','','t',-1),
+                new qt.SpellButton(),
+                new qt.CloseButton()
+        ];
</ins><span class="cx">
</span><del>-        html += '<input type="button" id="'+name+'_ed_spell" class="ed_button" onclick="edSpell('+name+'.Canvas);" title="' + quicktagsL10n.dictionaryLookup + '" value="' + quicktagsL10n.lookup + '" />';
-        html += '<input type="button" id="'+name+'_ed_close" class="ed_button" onclick="'+name+'.edCloseAllTags();" title="' + quicktagsL10n.closeAllOpenTags + '" value="' + quicktagsL10n.closeTags + '" /></div>';
-
-        tb.innerHTML = html;
-        cont.parentNode.insertBefore(tb, cont);
-
-};
</del><ins>+        edButton = qt.TagButton;
+})();
</ins></span></pre></div>
<a id="trunkwpincludesjsquicktagsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/quicktags.js (18496 => 18497)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/quicktags.js        2011-08-03 01:54:29 UTC (rev 18496)
+++ trunk/wp-includes/js/quicktags.js        2011-08-03 10:11:12 UTC (rev 18497)
</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<0){c=c.substr(1,c.length)}while(c.length<a){c="0"+c}if(b<0){c="-"+c}return c}datetime=now.getUTCFullYear()+"-"+zeroise(now.getUTCMonth()+1,2)+"-"+zeroise(now.getUTCDate(),2)+"T"+zeroise(now.getUTCHours(),2)+":"+zeroise(now.getUTCMinutes(),2)+":"+zeroise(now.getUTCSeconds(),2)+"+00:00";edButtons[edButtons.length]=new edButton("ed_strong","b","<strong>","</strong>","b");edButtons[edButtons.length]=new edButton("ed_em","i","<em>","</em>","i");edButtons[edButtons.length]=new edButton("ed_link","li
nk","","</a>","a");edButtons[edButtons.length]=new edButton("ed_block","b-quote","\n\n<blockquote>","</blockquote>\n\n","q");edButtons[edButtons.length]=new edButton("ed_del","del",'<del datetime="'+datetime+'">',"</del>","d");edButtons[edButtons.length]=new edButton("ed_ins","ins",'<ins datetime="'+datetime+'">',"</ins>","s");edButtons[edButtons.length]=new edButton("ed_img","img","","","m",-1);edButtons[edButtons.length]=new edButton("ed_ul","ul","<ul>\n","</ul>\n\n","u");edButtons[edButtons.length]=new edButton("ed_ol","ol","<ol>\n","</ol>\n\n","o");edButtons[edButtons.length]=n
ew edButton("ed_li","li","\t<li>","</li>\n","l");edButtons[edButtons.length]=new edButton("ed_code","code","<code>","</code>","c");edButtons[edButtons.length]=new edButton("ed_more","more","<!--more-->","","t",-1);function edLink(){this.display="";this.URL="";this.newWin=0}edLinks[edLinks.length]=new edLink("WordPress","http://wordpress.org/");edLinks[edLinks.length]=new edLink("alexking.org","http://www.alexking.org/");function edShowButton(b,a){if(b.id=="ed_img"){document.write('<input type="button" id="'+b.id+'" accesskey="'+b.access+'" class="ed_button" onclick="edInsertImage(edCanvas);" value="'+b.display+'" />')}else{if(b.id=="ed_link"){document.wri
te('<input type="button" id="'+b.id+'" accesskey="'+b.access+'" class="ed_button" onclick="edInsertLink(edCanvas, '+a+');" value="'+b.display+'" />')}else{document.write('<input type="button" id="'+b.id+'" accesskey="'+b.access+'" class="ed_button" onclick="edInsertTag(edCanvas, '+a+');" value="'+b.display+'" />')}}}function edShowLinks(){var a='<select onchange="edQuickLink(this.options[this.selectedIndex].value, this);"><option value="-1" selected>'+quicktagsL10n.quickLinks+"</option>",b;for(b=0;b<edLinks.length;b++){a+='<option value="'+b+'">'+edLinks[b].display+"</option>"}a+="</select>";document.write(a)}function edAddTag(a){if(edButtons[a].tagEnd!=""){edOpenTags[edOpenTags.length]=a;document.getElementById(edButtons[a].id).value=&q
uot;/"+document.getElementById(edButtons[a].id).value}}function edRemoveTag(b){for(var a=0;a<edOpenTags.length;a++){if(edOpenTags[a]==b){edOpenTags.splice(a,1);document.getElementById(edButtons[b].id).value=document.getElementById(edButtons[b].id).value.replace("/","")}}}function edCheckOpenTags(c){var a=0,b;for(b=0;b<edOpenTags.length;b++){if(edOpenTags[b]==c){a++}}if(a>0){return true}else{return false}}function edCloseAllTags(){var a=edOpenTags.length,b;for(b=0;b<a;b++){edInsertTag(edCanvas,edOpenTags[edOpenTags.length-1])}}function edQuickLink(c,d){if(c>-1){var b="",a;if(edLinks[c].newWin==1){b=' target="_blank"'}a='<a href="'+edLinks[c].URL+'"'+b+">"+edLinks[c].display+"</a>";d.selectedIndex=0;edInsertContent(edCanvas,a)}else{d.selectedIndex=0}}function edSpell(c){var e="",d,b,a;if(document.selection){c.focus();d=document.selection.createRange();if(d.text.lengt
h>0){e=d.text}}else{if(c.selectionStart||c.selectionStart=="0"){b=c.selectionStart;a=c.selectionEnd;if(b!=a){e=c.value.substring(b,a)}}}if(e==""){e=prompt(quicktagsL10n.wordLookup,"")}if(e!==null&&/^\w[\w ]*$/.test(e)){window.open("http://www.answers.com/"+escape(e))}}function edToolbar(){document.write('<div id="ed_toolbar">');for(var a=0;a<edButtons.length;a++){edShowButton(edButtons[a],a)}document.write('<input type="button" id="ed_spell" class="ed_button" onclick="edSpell(edCanvas);" title="'+quicktagsL10n.dictionaryLookup+'" value="'+quicktagsL10n.lookup+'" />');document.write('<input type="button" id="ed_close" class="ed_button" onclick="edCloseAllTags();" title="'+quicktagsL10n.closeAllOpenTags+'" value="'+quicktagsL10n.closeTags+'" />');document.write('<input type=&
quot;button" id="ed_fullscreen" class="ed_button" onclick="fullscreen.on();" title="'+quicktagsL10n.toggleFullscreen+'" value="'+quicktagsL10n.fullscreen+'" />');document.write("</div>")}function edInsertTag(d,c){if(document.selection){d.focus();var e=document.selection.createRange();if(e.text.length>0){e.text=edButtons[c].tagStart+e.text+edButtons[c].tagEnd}else{if(!edCheckOpenTags(c)||edButtons[c].tagEnd==""){e.text=edButtons[c].tagStart;edAddTag(c)}else{e.text=edButtons[c].tagEnd;edRemoveTag(c)}}d.focus()}else{if(d.selectionStart||d.selectionStart=="0"){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==""){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==""){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=="0"){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("object"==typeof(wpLink)){wpLink.open()}
else{if(!b){b="http://"}if(!edCheckOpenTags(c)){var a=prompt(quicktagsL10n.enterURL,b);if(a){edButtons[c].tagStart='<a href="'+a+'">';edInsertTag(d,c)}}else{edInsertTag(d,c)}}}function edInsertImage(b){var a=prompt(quicktagsL10n.enterImageURL,"http://");if(a){a='<img src="'+a+'" alt="'+prompt(quicktagsL10n.enterImageDescription,"")+'" />';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!="undefined")?","+f+",":"";j.edShowButton=function(n,m){if(f&&(f.indexOf(","+n.display+",")!=-1)){return""}else{if(n.id==a+"_img"){return'<input type="button" id="'+n.id+'" accesskey="'+n.access+'" class="ed_button" onclick="edIn
sertImage('+a+'.Canvas);" value="'+n.display+'" />'}else{if(n.id==a+"_link"){return'<input type="button" id="'+n.id+'" accesskey="'+n.access+'" class="ed_button" onclick="'+a+".edInsertLink("+m+');" value="'+n.display+'" />'}else{return'<input type="button" id="'+n.id+'" accesskey="'+n.access+'" class="ed_button" onclick="'+a+".edInsertTag("+m+');" value="'+n.display+'" />'}}}};j.edAddTag=function(i){if(j.Buttons[i].tagEnd!=""){j.OpenTags[j.OpenTags.length]=i;document.getElementById(j.Buttons[i].id).value="/"+document.getElementById(j.Buttons[i].id).value}};j.edRemoveTag=function(i){for(g=0;g<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("/",&qu
ot;")}}};j.edCheckOpenTags=function(n){l=0;for(var m=0;m<j.OpenTags.length;m++){if(j.OpenTags[m]==n){l++}}if(l>0){return true}else{return false}};this.edCloseAllTags=function(){var i=j.OpenTags.length;for(var m=0;m<i;m++){j.edInsertTag(j.OpenTags[j.OpenTags.length-1])}};this.edQuickLink=function(o,p){if(o>-1){var n="",m;if(Links[o].newWin==1){n=' target="_blank"'}m='<a href="'+Links[o].URL+'"'+n+">"+Links[o].display+"</a>";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>0){d.text=j.Buttons[o].tagStart+d.text+j.Buttons[o].tagEnd}else{if(!j.edCheckOpenTags(o)||j.Buttons[o].tagEnd==""){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
=="0"){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==""){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==""){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="http://"}if(!j.edCheckOpenTags(o)){var m=prompt(quicktagsL10n.enterURL,n);if(m){j.Buttons[o].tagStart='<a href="'+m+'">';j.edInsertTag(o)}}else{j.edInsertTag(o)}};this.edInsertImage=function(){var i=prompt(quicktagsL10n.enterImageURL,"http://");if(i){i='<img src="'+i+'" alt="'+prompt(quicktagsL10n.enterImageDescription,"")+'" />';edInsertContent(j.Canvas,i)}};j.Buttons[j.Buttons.length]=new edButton(a+"_strong","b","<strong>","</strong>","b");j.Buttons[j.Buttons.length]=new edButton(a+"_em","i","<em>","</em>","i");j.Buttons[j.Buttons.length]=new edButton(a+"_link","link","","</a>","a");j.Buttons[j.Buttons.length]=new edButton(a+"_block","b-quote"
,"\n\n<blockquote>","</blockquote>\n\n","q");j.Buttons[j.Buttons.length]=new edButton(a+"_del","del",'<del datetime="'+datetime+'">',"</del>","d");j.Buttons[j.Buttons.length]=new edButton(a+"_ins","ins",'<ins datetime="'+datetime+'">',"</ins>","s");j.Buttons[j.Buttons.length]=new edButton(a+"_img","img","","","m",-1);j.Buttons[j.Buttons.length]=new edButton(a+"_ul","ul","<ul>\n","</ul>\n\n","u");j.Buttons[j.Buttons.length]=new edButton(a+"_ol","ol","<ol>\n","</ol>\n\n","o");j.Buttons[j.Buttons.length]=new edButton(a+"_li","li","\t<li>","</li>\n","l");j.Buttons[j.Buttons.length]=ne
w edButton(a+"_code","code","<code>","</code>","c");j.Buttons[j.Buttons.length]=new edButton(a+"_more","more","<!--more-->","","t",-1);e=document.createElement("div");e.id=a+"_qtags";h='<div id="'+a+'_toolbar">';for(g=0;g<j.Buttons.length;g++){h+=j.edShowButton(j.Buttons[g],g)}h+='<input type="button" id="'+a+'_ed_spell" class="ed_button" onclick="edSpell('+a+'.Canvas);" title="'+quicktagsL10n.dictionaryLookup+'" value="'+quicktagsL10n.lookup+'" />';h+='<input type="button" id="'+a+'_ed_close" class="ed_button" onclick="'+a+'.edCloseAllTags();" title="'+quicktagsL10n.closeAllOpenTags+'" value="'+quicktagsL10n.closeTags+'" /></div>';e.innerHTML=h;k.parentNode.insertBefore(e,k)};
</del><span class="cx">\ No newline at end of file
</span><ins>+var QTags,edButtons,edButton;function quicktags(a){return new QTags(a)}(function(){var c=function(h){var g,f,e;if(typeof jQuery!="undefined"){jQuery(document).ready(h)}else{g=c;g.funcs=[];g.ready=function(){if(!g.isReady){g.isReady=true;for(f=0;f<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("DOMContentLoaded",e,false);g.ready()};document.addEventListener("DOMContentLoaded",e,false);window.addEventListener("load",g.ready,false)}else{if(document.attachEvent){e=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",e);g.ready()}};document.attachEvent("onreadystatechange",e);window.attachEvent("onload",g.ready);(function(){try{document.documentElement.doScroll("left")}catch(i){setTimeout(arguments.callee,50);return}g.rea
dy()})()}}g.eventAttached=true}}},a=(function(){var e=new Date(),f;f=function(g){var h=g.toString();if(h.length<2){h="0"+h}return h};return e.getUTCFullYear()+"-"+f(e.getUTCMonth()+1)+"-"+f(e.getUTCDate())+"T"+f(e.getUTCHours())+":"+f(e.getUTCMinutes())+":"+f(e.getUTCSeconds())+"+00:00"})(),b={},d;d=QTags=function(j){if(typeof(j)=="string"){j={quicktags_id:j}}else{if(typeof(j)!="object"){return false}}var r=this,f=j.quicktags_id,p={},o={},h=document.getElementById(f),e="qt_"+f,n="",m,k,l,g,q;if(!f||!h){return false}r.name=e;r.id=f;for(m in edButtons){p[edButtons[m].id]=edButtons[m]}if(f=="content"&&adminpage&&(adminpage=="post-new-php"||adminpage=="post-php")){p.fullscreen=new d.FullscreenButton()}for(m in r._customButtons){p[m]=new r._customButtons[m]()}if(j.quicktags_buttons){l=j.quicktags_buttons.split(","
);for(m in l){g=l[m];if(p[g]){o[g]=p[g]}}}else{o=p}if(j.quicktags_disabled_buttons){l=j.quicktags_disabled_buttons.split(",");for(m in l){g=l[m];if(o[g]){delete (o[g])}}}for(m in o){n+=o[m].html(e+"_")}k=document.createElement("div");k.id=e+"_toolbar";k.className="quicktags-toolbar";h.parentNode.insertBefore(k,h);k.innerHTML=n;r.toolbar=k;q=function(u){u=u||window.event;var t=u.target||u.srcElement,s;if(/\s+ed_button\s+/.test(" "+t.className+" ")){r.canvas=h=document.getElementById(f);s=t.id.replace(e+"_","");if(o[s]){o[s].callback.call(o[s],t,h,r)}}};if(k.addEventListener){k.addEventListener("click",q,false)}else{if(k.attachEvent){k.attachEvent("onclick",q)}}d.instances[f]=r};d.instances={};d.registerButton=function(f,e){b[f]=e};d.getInstance=function(e){return d.instances[e]};d.insertContent=function(l,h){var i,g,f,j,k,e=document.getElementById(l);if(document.selec
tion){e.focus();i=document.selection.createRange();i.text=h;e.focus()}else{if(e.selectionStart||e.selectionStart=="0"){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()}}};d.Button=function(i,g,e,h){var f=this;f.id=i;f.display=g;f.access=e;f.title=h||""};d.Button.prototype.html=function(f){var e=this.access?' accesskey="'+this.access+'"':"";return'<input type="button" id="'+f+this.id+'"'+e+' class="ed_button" title="'+this.title+'" value="'+this.display+'" />'};d.Button.prototype.callback=function(e){};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.open
Tags=[]}if(g.tagEnd){f.openTags.push(g.id);h.value="/"+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&&g<e.openTags.length){f=e.openTags[g]==h.id?g:false;g++}}else{f=false}return f};d.TagButton.prototype.callback=function(o,j,q){var u=this,p,f,m,h,s,k,e,n,g;s=j.value;if(document.selection){j.focus();g=document.selection.createRange();if(g.text.length>0){g.text=u.tagStart+g.text+u.tagEnd}else{if(u.isOpen(q)===false||u.tagEnd===""){g.text=u.tagStart;u.openTag(o,q)}else{g.text=u.tagEnd;u.closeTag(o,q)}}j.focus()}else{if(j.selectionStart||j.selectionStart=="0"){p=j.selectionStart;f=j.selectionEnd;m=f;h=j.scrollTop;k=s.substring(0,p);e=s.substring(f,s.length);n=s.substring(p,f);if(p!=f){j.value=k+u.tagStart+n+u.tagEnd+e;if(u.tagEnd===""){m=p}m+=u
.tagStart.length+u.tagEnd.length}else{if(u.isOpen(q)===false||u.tagEnd===""){j.value=k+u.tagStart+e;u.openTag(o,q);m=p+u.tagStart.length}else{j.value=k+u.tagEnd+e;m=p+u.tagEnd.length;u.closeTag(o,q)}}j.focus();j.selectionStart=m;j.selectionEnd=m;j.scrollTop=h}else{if(u.isOpen(q)!==false||u.tagEnd===""){j.value+=u.tagStart;u.openTag(o,q)}else{j.value+=u.tagEnd;u.closeTag(o,q)}j.focus()}}};d.SpellButton=function(){d.Button.call(this,"spell",quicktagsL10n.lookup,"",quicktagsL10n.dictionaryLookup)};d.SpellButton.prototype=new d.Button();d.SpellButton.prototype.callback=function(h,g,i){var k="",j,f,e;if(document.selection){g.focus();j=document.selection.createRange();if(j.text.length>0){k=j.text}}else{if(g.selectionStart||g.selectionStart=="0"){f=g.selectionStart;e=g.selectionEnd;if(f!=e){k=g.value.substring(f,e)}}}if(k===""){k=prompt(quicktagsL10n.wordLookup,"")}if(k!==null&&/^\w[\w ]*$/.t
est(k)){window.open("http://www.answers.com/"+encodeURIComponent(k))}};d.CloseButton=function(){d.Button.call(this,"close",quicktagsL10n.closeTags,"",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>0){h=f.getButton(i[i.length-1]);g=document.getElementById(f.name+"_"+h.id);h.callback.call(h,g,k,f)}}};d.prototype.closeAllTags=function(){var e=this.getButton("close");e.callback.call(e,"",this.canvas,this.toolbar)};d.LinkButton=function(){d.TagButton.call(this,"link","link","","</a>","a")};d.LinkButton.prototype=new d.TagButton();d.LinkButton.prototype.callback=function(j,k,h,g){var f,i=this;if(typeof(wpLink)!="undefined"){wpLink.open();return}if(!g){g="http://"}if(i.isOpen(h)===false){f=prompt(quicktagsL10n.enterURL,g);if(f){i.t
agStart='<a href="'+f+'">';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,"img","img","","","m",-1)};d.ImgButton.prototype=new d.TagButton();d.ImgButton.prototype.callback=function(i,k,g,f){if(!f){f="http://"}var j=prompt(quicktagsL10n.enterImageURL,f),h;if(j){h=prompt(quicktagsL10n.enterImageDescription,"");this.tagStart='<img src="'+j+'" alt="'+h+'" />';d.TagButton.prototype.callback.call(this,i,k,g)}};d.FullscreenButton=function(){d.Button.call(this,"fullscreen",quicktagsL10n.fullscreen,"f",quicktagsL10n.toggleFullscreen)};d.FullscreenButton.prototype=new d.Button();d.FullscreenButton.prototype.callback=function(f,g){if(g.id!="content"||typeof(fullscreen)=="undefined"){return}fullscreen.on()};edButtons=[new d.TagButton("str
ong","b","<strong>","</strong>","b"),new d.TagButton("em","i","<em>","</em>","i"),new d.LinkButton(),new d.TagButton("block","b-quote","\n\n<blockquote>","</blockquote>\n\n","q"),new d.TagButton("del","del",'<del datetime="'+a+'">',"</del>","d"),new d.TagButton("ins","ins",'<ins datetime="'+a+'">',"</ins>","s"),new d.ImgButton(),new d.TagButton("ul","ul","<ul>\n","</ul>\n\n","u"),new d.TagButton("ol","ol","<ol>\n","</ol>\n\n","o"),new d.TagButton("li","li","\t<li>","</li>\n","l"),new d.TagButt
on("code","code","<code>","</code>","c"),new d.TagButton("more","more","<!--more-->","","t",-1),new d.SpellButton(),new d.CloseButton()];edButton=d.TagButton})();
</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 (18496 => 18497)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2011-08-03 01:54:29 UTC (rev 18496)
+++ trunk/wp-includes/script-loader.php        2011-08-03 10:11:12 UTC (rev 18497)
</span><span class="lines">@@ -67,9 +67,8 @@
</span><span class="cx">
</span><span class="cx">         $scripts->add( 'sack', "/wp-includes/js/tw-sack$suffix.js", false, '1.6.1', 1 );
</span><span class="cx">
</span><del>-        $scripts->add( 'quicktags', "/wp-includes/js/quicktags$suffix.js", false, '20110502', 1 );
</del><ins>+        $scripts->add( 'quicktags', "/wp-includes/js/quicktags$suffix.js", false, '20110802', 1 );
</ins><span class="cx">         $scripts->add_script_data( 'quicktags', 'quicktagsL10n', array(
</span><del>-                'quickLinks' => __('(Quick Links)'),
</del><span class="cx">                 'wordLookup' => __('Enter a word to look up:'),
</span><span class="cx">                 'dictionaryLookup' => esc_attr(__('Dictionary lookup')),
</span><span class="cx">                 'lookup' => esc_attr(__('lookup')),
</span><span class="lines">@@ -265,7 +264,7 @@
</span><span class="cx">
</span><span class="cx">                 $scripts->add( 'admin-custom-fields', "/wp-admin/js/custom-fields$suffix.js", array('wp-lists'), '20110429', 1 );
</span><span class="cx">
</span><del>-                $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags', 'jquery-query'), '20110602', 1 );
</del><ins>+                $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags', 'jquery-query'), '20110802', 1 );
</ins><span class="cx">                 $scripts->add_script_data( 'admin-comments', 'adminCommentsL10n', array(
</span><span class="cx">                         'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),
</span><span class="cx">                         'hotkeys_highlight_last' => isset($_GET['hotkeys_highlight_last']),
</span></span></pre>
</div>
</div>
</body>
</html>