<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[13855] trunk/wp-admin:
Display the list of Terms in a non-hierarchical taxonomy on the Post Edit page even if they cannot modify them
.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13855">13855</a></dd>
<dt>Author</dt> <dd>dd32</dd>
<dt>Date</dt> <dd>2010-03-28 02:37:10 +0000 (Sun, 28 Mar 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Display the list of Terms in a non-hierarchical taxonomy on the Post Edit page even if they cannot modify them. See <a href="http://trac.wordpress.org/ticket/12035">#12035</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesmetaboxesphp">trunk/wp-admin/includes/meta-boxes.php</a></li>
<li><a href="#trunkwpadminjspostdevjs">trunk/wp-admin/js/post.dev.js</a></li>
<li><a href="#trunkwpadminjspostjs">trunk/wp-admin/js/post.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesmetaboxesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/meta-boxes.php (13854 => 13855)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/meta-boxes.php        2010-03-28 02:07:31 UTC (rev 13854)
+++ trunk/wp-admin/includes/meta-boxes.php        2010-03-28 02:37:10 UTC (rev 13855)
</span><span class="lines">@@ -246,29 +246,35 @@
</span><span class="cx"> function post_tags_meta_box($post, $box) {
</span><span class="cx">         $tax_name = esc_attr(substr($box['id'], 8));
</span><span class="cx">         $taxonomy = get_taxonomy($tax_name);
</span><del>-        if ( !current_user_can($taxonomy->assign_cap) ) // @todo: Display the terms, do not edit.
-                return;
</del><span class="cx">         $helps = isset( $taxonomy->helps ) ? esc_attr( $taxonomy->helps ) : esc_attr__('Separate tags with commas.');
</span><span class="cx">         $help_hint = isset( $taxonomy->help_hint ) ? $taxonomy->help_hint : __('Add new tag');
</span><span class="cx">         $help_nojs = isset( $taxonomy->help_nojs ) ? $taxonomy->help_nojs : __('Add or remove tags');
</span><span class="cx">         $help_cloud = isset( $taxonomy->help_cloud ) ? $taxonomy->help_cloud : __('Choose from the most used tags in %s');
</span><ins>+        
+        $disabled = !current_user_can($taxonomy->assign_cap) ? 'disabled="disabled"' : '';
</ins><span class="cx"> ?>
</span><span class="cx"> <div class="tagsdiv" id="<?php echo $tax_name; ?>">
</span><span class="cx">         <div class="jaxtag">
</span><span class="cx">         <div class="nojs-tags hide-if-js">
</span><span class="cx">         <p><?php echo $help_nojs; ?></p>
</span><del>-        <textarea name="<?php echo "tax_input[$tax_name]"; ?>" class="the-tags" id="tax-input[<?php echo $tax_name; ?>]"><?php echo esc_attr(get_terms_to_edit( $post->ID, $tax_name )); ?></textarea></div>
-
</del><ins>+        <textarea name="<?php echo "tax_input[$tax_name]"; ?>" class="the-tags" id="tax-input[<?php echo $tax_name; ?>]" <?php echo $disabled; ?>><?php echo esc_attr(get_terms_to_edit( $post->ID, $tax_name )); ?></textarea></div>
+         <?php if ( current_user_can($taxonomy->assign_cap) ) : ?>
</ins><span class="cx">         <div class="ajaxtag hide-if-no-js">
</span><span class="cx">                 <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label>
</span><span class="cx">                 <div class="taghint"><?php echo $help_hint; ?></div>
</span><span class="cx">                 <input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
</span><span class="cx">                 <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" />
</span><del>-        </div></div>
</del><ins>+        </div>
</ins><span class="cx">         <p class="howto"><?php echo $helps; ?></p>
</span><ins>+        <?php endif; ?>
+        </div>
</ins><span class="cx">         <div class="tagchecklist"></div>
</span><span class="cx"> </div>
</span><ins>+<?php if ( current_user_can($taxonomy->assign_cap) ) : ?>
</ins><span class="cx"> <p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php printf( $help_cloud, $box['title'] ); ?></a></p>
</span><ins>+<?php else : ?>
+<p><em><?php _e('You cannot modify this Taxonomy.'); ?></em></p>
+<?php endif; ?>
</ins><span class="cx"> <?php
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -307,7 +313,9 @@
</span><span class="cx">                                 <?php wp_terms_checklist($post->ID, array( 'taxonomy' => $taxonomy, 'popular_cats' => $popular_ids ) ) ?>
</span><span class="cx">                         </ul>
</span><span class="cx">                 </div>
</span><del>-
</del><ins>+        <?php if ( !current_user_can($tax->assign_cap) ) : ?>
+        <p><em><?php _e('You cannot modify this Taxonomy.'); ?></em></p>
+        <?php endif; ?>
</ins><span class="cx">         <?php if ( current_user_can($tax->edit_cap) ) : ?>
</span><span class="cx">                         <div id="<?php echo $taxonomy; ?>-adder" class="wp-hidden-children">
</span><span class="cx">                                 <h4><a id="<?php echo $taxonomy; ?>-add-toggle" href="#<?php echo $taxonomy; ?>-add" class="hide-if-no-js" tabindex="3"><?php printf( __( '+ Add New %s' ), $tax->singular_label ); ?></a></h4>
</span></span></pre></div>
<a id="trunkwpadminjspostdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/post.dev.js (13854 => 13855)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/post.dev.js        2010-03-28 02:07:31 UTC (rev 13854)
+++ trunk/wp-admin/js/post.dev.js        2010-03-28 02:37:10 UTC (rev 13855)
</span><span class="lines">@@ -41,6 +41,8 @@
</span><span class="cx">                 if ( !thetags.length )
</span><span class="cx">                         return;
</span><span class="cx">
</span><ins>+                var disabled = thetags.attr('disabled');
+
</ins><span class="cx">                 current_tags = thetags.val().split(',');
</span><span class="cx">                 tagchecklist.empty();
</span><span class="cx">
</span><span class="lines">@@ -50,9 +52,13 @@
</span><span class="cx">                         val = $.trim(val);
</span><span class="cx">                         if ( !val.match(/^\s+$/) && '' != val ) {
</span><span class="cx">                                 button_id = id + '-check-num-' + key;
</span><del>-                                 txt = '<span><a id="' + button_id + '" class="ntdelbutton">X</a>&nbsp;' + val + '</span> ';
</del><ins>+                                if ( disabled )
+                                         txt = '<span>' + val + '</span> ';
+                                else
+                                         txt = '<span><a id="' + button_id + '" class="ntdelbutton">X</a>&nbsp;' + val + '</span> ';
</ins><span class="cx">                                  tagchecklist.append(txt);
</span><del>-                                 $( '#' + button_id ).click( function(){ tagBox.parseTags(this); });
</del><ins>+                                if ( ! disabled )
+                                         $( '#' + button_id ).click( function(){ tagBox.parseTags(this); });
</ins><span class="cx">                         }
</span><span class="cx">                 });
</span><span class="cx">         },
</span></span></pre></div>
<a id="trunkwpadminjspostjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/post.js (13854 => 13855)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/post.js        2010-03-28 02:07:31 UTC (rev 13854)
+++ trunk/wp-admin/js/post.js        2010-03-28 02:37:10 UTC (rev 13855)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var tagBox,commentsBox,editPermalink,makeSlugeditClickable,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail;function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&&jQuery.inArray(d,c)==-1){c.push(d)}});return c}(function(a){tagBox={clean:function(b){return b.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,"")},parseTags:function(e){var h=e.id,b=h.split("-check-num-")[1],d=a(e).closest(".tagsdiv"),g=d.find(".the-tags"),c=g.val().split(","),f=[];delete c[b];a.each(c,function(i,j){j=a.trim(j);if(j){f.push(j)}});g.val(this.clean(f.join(",")));this.quickClicks(d);return false},quickClicks:function(c){var e=a(".the-tags",c),d=a(".tagchecklist",c),b;if(!e.length){return}b=e.val().split(",");d.empty();a.each(b,function(h,i){var f,g,j=a(c).attr("id");i=a.trim(i);if(!i.match(/^\s+$/)&&""!=i){g=j+"-check-num-"+h;f='<span><a id="'+g+'" class="ntdelbutton">X</a>&nbsp;'+i+"</span> ";d.append(f);a("#"+g).click(function(){tagBox.parseTags(this)})}})},flushTags:function(e,b,g){b=b||false;var i,c=a(".the-tags",e),h=a("input.newtag",e),d;i=b?a(b).text():h.val();tagsval=c.val();d=tagsval?tagsval+","+i:i;d=this.clean(d);d=array_unique_noempty(d.split(",")).join(",");c.val(d);this.quickClicks(e);if(!b){h.val("")}if("undefined"==typeof(g)){h.focus()}return false},get:function(c){var b=c.substr(c.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0==e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){tagBox.flushTags(a(this).closest(".inside").children(".tagsdiv"),this);return false});a("#"+c).after(e)})},init:function(){var b=this,c=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)});a("input.tagadd",c).click(function(){b.flushTags(a(this).closest(".tagsdiv"))});a("div.taghint",c).click(function(){a(this).css("visibility","hidden").siblings(".newtag").focus()});a("input.newtag",c).blur(function(){if(this.value==""){a(this).siblings(".taghint").css("visibility","")}}).focus(function(){a(this).siblings(".taghint").css("visibility","hidden")}).keyup(function(d){if(13==d.which){tagBox.flushTags(a(this).closest(".tagsdiv"));return false}}).keypress(function(d){if(13==d.which){d.preventDefault();return false}}).each(function(){var d=a(this).closest("div.tagsdiv").attr("id");a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+d,{delay:500,minchars:2,multiple:true,multipleSep:", "})});a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,false,1)})});a("a.tagcloud-link").click(function(){tagBox.get(a(this).attr("id"));a(this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false})}};commentsBox={st:0,get:function(d,c){var b=this.st,e;if(!c){c=20}this.st+=c;this.total=d;a("#commentsdiv img.waiting").show();e={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),post_ID:a("#post_ID").val(),start:b,num:c};a.post(ajaxurl,e,function(f){f=wpAjax.parseAjaxResponse(f);a("#commentsdiv .widefat").show();a("#commentsdiv img.waiting").hide();if("object"==typeof f&&f.responses[0]){a("#the-comment-list").append(f.responses[0].data);theList=theExtraList=null;a("a[className*=':']").unbind();setCommentsList();if(commentsBox.st>commentsBox.total){a("#show-comments").hide()}else{a("#show-comments").html(postL10n.showcomm)}return}else{if(1==f){a("#show-comments").parent().html(postL10n.endcomm);return}}a("#the-comment-list").append('<tr><td colspan="2">'+wpAjax.broken+"</td></tr>")});return false}};WPSetThumbnailHTML=function(b){a(".inside","#postimagediv").html(b)};WPSetThumbnailID=function(c){var b=a("input[value=_thumbnail_id]","#list-table");if(b.size()>0){a("#meta\\["+b.attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(c)}};WPRemoveThumbnail=function(){a.post(ajaxurl,{action:"set-post-thumbnail",post_id:a("#post_ID").val(),thumbnail_id:-1,cookie:encodeURIComponent(document.cookie)},function(b){if(b=="0"){alert(setPostThumbnailL10n.error)}else{WPSetThumbnailHTML(b)}})}})(jQuery);jQuery(document).ready(function(e){var b,a,f="";postboxes.add_postbox_toggles(pagenow);if(e("#tagsdiv-post_tag").length){tagBox.init()}else{e("#side-sortables, #normal-sortables, #advanced-sortables").children("div.postbox").each(function(){if(this.id.indexOf("tagsdiv-")===0){tagBox.init();return false}})}e(".categorydiv").each(function(){var l=e(this).attr("id"),h=false,k,m,j,g,i;j=l.split("-");j.shift();g=j.join("-");i=g+"_tab";if(g=="category"){i="cats"}e("a","#"+g+"-tabs").click(function(){var n=e(this).attr("href");e(this).parent().addClass("tabs").siblings("li").removeClass("tabs");e("#"+g+"-tabs").siblings(".tabs-panel").hide();e(n).show();if("#"+g+"-all"==n){deleteUserSetting(i)}else{setUserSetting(i,"pop")}return false});if(getUserSetting(i)){e('a[href="#'+g+'-pop"]',"#"+g+"-tabs").click()}e("#new"+g).one("focus",function(){e(this).val("").removeClass("form-input-tip")});e("#"+g+"-add-submit").click(function(){e("#new"+g).focus()});k=function(){if(h){return}h=true;var n=jQuery(this),p=n.is(":checked"),o=n.val().toString();e("#in-"+g+"-"+o+", #in-"+g+"-category-"+o).attr("checked",p);h=false};catAddBefore=function(n){if(!e("#new"+g).val()){return false}n.data+="&"+e(":checked","#"+g+"checklist").serialize();return n};m=function(q,p){var o,n=e("#new"+g+"_parent");if("undefined"!=p.parsed.responses[0]&&(o=p.parsed.responses[0].supplemental.newcat_parent)){n.before(o);n.remove()}};e("#"+g+"checklist").wpList({alt:"",response:g+"-ajax-response",addBefore:catAddBefore,addAfter:m});e("#"+g+"-add-toggle").click(function(){e("#"+g+"-adder").toggleClass("wp-hidden-children");e('a[href="#'+g+'-all"]',"#"+g+"-tabs").click();return false});e("#"+g+"checklist li.popular-category :checkbox, #"+g+"checklist-pop :checkbox").live("click",function(){var n=e(this),p=n.is(":checked"),o=n.val();if(o&&n.parents("#taxonomy-"+g).length){e("#in-"+g+"-"+o+", #in-popular-"+g+"-"+o).attr("checked",p)}})});if(e("#postcustom").length){e("#the-list").wpList({addAfter:function(g,h){e("table#list-table").show();if(typeof(autosave_update_post_ID)!="undefined"){autosave_update_post_ID(h.parsed.responses[0].supplemental.postid)}},addBefore:function(g){g.data+="&post_id="+e("#post_ID").val();return g}})}if(e("#submitdiv").length){b=e("#timestamp").html();a=e("#post-visibility-display").html();function d(){var g=e("#post-visibility-select");if(e("input:radio:checked",g).val()!="public"){e("#sticky").attr("checked",false);e("#sticky-span").hide()}else{e("#sticky-span").show()}if(e("input:radio:checked",g).val()!="password"){e("#password-span").hide()}else{e("#password-span").show()}}function c(){var n,o,h,q,p=e("#post_status"),i=e("option[value=publish]",p),g=e("#aa").val(),l=e("#mm").val(),m=e("#jj").val(),k=e("#hh").val(),j=e("#mn").val();n=new Date(g,l-1,m,k,j);o=new Date(e("#hidden_aa").val(),e("#hidden_mm").val()-1,e("#hidden_jj").val(),e("#hidden_hh").val(),e("#hidden_mn").val());h=new Date(e("#cur_aa").val(),e("#cur_mm").val()-1,e("#cur_jj").val(),e("#cur_hh").val(),e("#cur_mn").val());if(n.getFullYear()!=g||(1+n.getMonth())!=l||n.getDate()!=m||n.getMinutes()!=j){e(".timestamp-wrap","#timestampdiv").addClass("form-invalid");return false}else{e(".timestamp-wrap","#timestampdiv").removeClass("form-invalid")}if(n>h&&e("#original_post_status").val()!="future"){q=postL10n.publishOnFuture;e("#publish").val(postL10n.schedule)}else{if(n<=h&&e("#original_post_status").val()!="publish"){q=postL10n.publishOn;e("#publish").val(postL10n.publish)}else{q=postL10n.publishOnPast;if(page){e("#publish").val(postL10n.updatePage)}else{e("#publish").val(postL10n.updatePost)}}}if(o.toUTCString()==n.toUTCString()){e("#timestamp").html(b)}else{e("#timestamp").html(q+" <b>"+e("option[value="+e("#mm").val()+"]","#mm").text()+" "+m+", "+g+" @ "+k+":"+j+"</b> ")}if(e("input:radio:checked","#post-visibility-select").val()=="private"){if(page){e("#publish").val(postL10n.updatePage)}else{e("#publish").val(postL10n.updatePost)}if(i.length==0){p.append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}else{i.html(postL10n.privatelyPublished)}e("option[value=publish]",p).attr("selected",true);e(".edit-post-status","#misc-publishing-actions").hide()}else{if(e("#original_post_status").val()=="future"||e("#original_post_status").val()=="draft"){if(i.length){i.remove();p.val(e("#hidden_post_status").val())}}else{i.html(postL10n.published)}if(p.is(":hidden")){e(".edit-post-status","#misc-publishing-actions").show()}}e("#post-status-display").html(e("option:selected",p).text());if(e("option:selected",p).val()=="private"||e("option:selected",p).val()=="publish"){e("#save-post").hide()}else{e("#save-post").show();if(e("option:selected",p).val()=="pending"){e("#save-post").show().val(postL10n.savePending)}else{e("#save-post").show().val(postL10n.saveDraft)}}return true}e(".edit-visibility","#visibility").click(function(){if(e("#post-visibility-select").is(":hidden")){d();e("#post-visibility-select").slideDown("normal");e(this).hide()}return false});e(".cancel-post-visibility","#post-visibility-select").click(function(){e("#post-visibility-select").slideUp("normal");e("#visibility-radio-"+e("#hidden-post-visibility").val()).attr("checked",true);e("#post_password").val(e("#hidden_post_password").val());e("#sticky").attr("checked",e("#hidden-post-sticky").attr("checked"));e("#post-visibility-display").html(a);e(".edit-visibility","#visibility").show();c();return false});e(".save-post-visibility","#post-visibility-select").click(function(){var g=e("#post-visibility-select");g.slideUp("normal");e(".edit-visibility","#visibility").show();c();if(e("input:radio:checked",g).val()!="public"){e("#sticky").attr("checked",false)}if(true==e("#sticky").attr("checked")){f="Sticky"}else{f=""}e("#post-visibility-display").html(postL10n[e("input:radio:checked",g).val()+f]);return false});e("input:radio","#post-visibility-select").change(function(){d()});e("#timestampdiv").siblings("a.edit-timestamp").click(function(){if(e("#timestampdiv").is(":hidden")){e("#timestampdiv").slideDown("normal");e(this).hide()}return false});e(".cancel-timestamp","#timestampdiv").click(function(){e("#timestampdiv").slideUp("normal");e("#mm").val(e("#hidden_mm").val());e("#jj").val(e("#hidden_jj").val());e("#aa").val(e("#hidden_aa").val());e("#hh").val(e("#hidden_hh").val());e("#mn").val(e("#hidden_mn").val());e("#timestampdiv").siblings("a.edit-timestamp").show();c();return false});e(".save-timestamp","#timestampdiv").click(function(){if(c()){e("#timestampdiv").slideUp("normal");e("#timestampdiv").siblings("a.edit-timestamp").show()}return false});e("#post-status-select").siblings("a.edit-post-status").click(function(){if(e("#post-status-select").is(":hidden")){e("#post-status-select").slideDown("normal");e(this).hide()}return false});e(".save-post-status","#post-status-select").click(function(){e("#post-status-select").slideUp("normal");e("#post-status-select").siblings("a.edit-post-status").show();c();return false});e(".cancel-post-status","#post-status-select").click(function(){e("#post-status-select").slideUp("normal");e("#post_status").val(e("#hidden_post_status").val());e("#post-status-select").siblings("a.edit-post-status").show();c();return false})}if(e("#edit-slug-box").length){editPermalink=function(g){var h,l=0,k=e("#editable-post-name"),m=k.html(),p=e("#post_name"),q=p.html(),n=e("#edit-slug-buttons"),o=n.html(),j=e("#editable-post-name-full").html();e("#view-post-btn").hide();n.html('<a href="#" class="save button">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+"</a>");n.children(".save").click(function(){var i=k.children("input").val();e.post(ajaxurl,{action:"sample-permalink",post_id:g,new_slug:i,new_title:e("#title").val(),samplepermalinknonce:e("#samplepermalinknonce").val()},function(r){e("#edit-slug-box").html(r);n.html(o);p.attr("value",i);makeSlugeditClickable();e("#view-post-btn").show()});return false});e(".cancel","#edit-slug-buttons").click(function(){e("#view-post-btn").show();k.html(m);n.html(o);p.attr("value",q);return false});for(h=0;h<j.length;++h){if("%"==j.charAt(h)){l++}}slug_value=(l>j.length/4)?"":j;k.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children("input").keypress(function(r){var i=r.keyCode||0;if(13==i){n.children(".save").click();return false}if(27==i){n.children(".cancel").click();return false}p.attr("value",this.value)}).focus()};makeSlugeditClickable=function(){e("#editable-post-name").click(function(){e("#edit-slug-buttons").children(".edit-slug").click()})};makeSlugeditClickable()}});
</del><span class="cx">\ No newline at end of file
</span><ins>+var tagBox,commentsBox,editPermalink,makeSlugeditClickable,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail;function array_unique_noempty(a){var out=[];jQuery.each(a,function(key,val){val=jQuery.trim(val);if(val&&jQuery.inArray(val,out)==-1){out.push(val)}});return out}(function($){tagBox={clean:function(tags){return tags.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,"")},parseTags:function(el){var id=el.id,num=id.split("-check-num-")[1],taxbox=$(el).closest(".tagsdiv"),thetags=taxbox.find(".the-tags"),current_tags=thetags.val().split(","),new_tags=[];delete current_tags[num];$.each(current_tags,function(key,val){val=$.trim(val);if(val){new_tags.push(val)}});thetags.val(this.clean(new_tags.join(",")));this.quickClicks(taxbox);return false},quickClicks:function(el){var thetags=$(".the-tags",el),tagchecklist=$(".tagchecklist",el),current_tags;if(!thetags.length){return}var disabled=thetags.attr("disabled");current_tags=thetags.val().split(",");tagchecklist.empty();$.each(current_tags,function(key,val){var txt,button_id,id=$(el).attr("id");val=$.trim(val);if(!val.match(/^\s+$/)&&""!=val){button_id=id+"-check-num-"+key;if(disabled){txt="<span>"+val+"</span> "}else{txt='<span><a id="'+button_id+'" class="ntdelbutton">X</a>&nbsp;'+val+"</span> "}tagchecklist.append(txt);if(!disabled){$("#"+button_id).click(function(){tagBox.parseTags(this)})}}})},flushTags:function(el,a,f){a=a||false;var text,tags=$(".the-tags",el),newtag=$("input.newtag",el),newtags;text=a?$(a).text():newtag.val();tagsval=tags.val();newtags=tagsval?tagsval+","+text:text;newtags=this.clean(newtags);newtags=array_unique_noempty(newtags.split(",")).join(",");tags.val(newtags);this.quickClicks(el);if(!a){newtag.val("")}if("undefined"==typeof(f)){newtag.focus()}return false},get:function(id){var tax=id.substr(id.indexOf("-")+1);$.post(ajaxurl,{action:"get-tagcloud",tax:tax},function(r,stat){if(0==r||"success"!=stat){r=wpAjax.broken}r=$('<p id="tagcloud-'+tax+'" class="the-tagcloud">'+r+"</p>");$("a",r).click(function(){tagBox.flushTags($(this).closest(".inside").children(".tagsdiv"),this);return false});$("#"+id).after(r)})},init:function(){var t=this,ajaxtag=$("div.ajaxtag");$(".tagsdiv").each(function(){tagBox.quickClicks(this)});$("input.tagadd",ajaxtag).click(function(){t.flushTags($(this).closest(".tagsdiv"))});$("div.taghint",ajaxtag).click(function(){$(this).css("visibility","hidden").siblings(".newtag").focus()});$("input.newtag",ajaxtag).blur(function(){if(this.value==""){$(this).siblings(".taghint").css("visibility","")}}).focus(function(){$(this).siblings(".taghint").css("visibility","hidden")}).keyup(function(e){if(13==e.which){tagBox.flushTags($(this).closest(".tagsdiv"));return false}}).keypress(function(e){if(13==e.which){e.preventDefault();return false}}).each(function(){var tax=$(this).closest("div.tagsdiv").attr("id");$(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+tax,{delay:500,minchars:2,multiple:true,multipleSep:", "})});$("#post").submit(function(){$("div.tagsdiv").each(function(){tagBox.flushTags(this,false,1)})});$("a.tagcloud-link").click(function(){tagBox.get($(this).attr("id"));$(this).unbind().click(function(){$(this).siblings(".the-tagcloud").toggle();return false});return false})}};commentsBox={st:0,get:function(total,num){var st=this.st,data;if(!num){num=20}this.st+=num;this.total=total;$("#commentsdiv img.waiting").show();data={action:"get-comments",mode:"single",_ajax_nonce:$("#add_comment_nonce").val(),post_ID:$("#post_ID").val(),start:st,num:num};$.post(ajaxurl,data,function(r){r=wpAjax.parseAjaxResponse(r);$("#commentsdiv .widefat").show();$("#commentsdiv img.waiting").hide();if("object"==typeof r&&r.responses[0]){$("#the-comment-list").append(r.responses[0].data);theList=theExtraList=null;$("a[className*=':']").unbind();setCommentsList();if(commentsBox.st>commentsBox.total){$("#show-comments").hide()}else{$("#show-comments").html(postL10n.showcomm)}return}else{if(1==r){$("#show-comments").parent().html(postL10n.endcomm);return}}$("#the-comment-list").append('<tr><td colspan="2">'+wpAjax.broken+"</td></tr>")});return false}};WPSetThumbnailHTML=function(html){$(".inside","#postimagediv").html(html)};WPSetThumbnailID=function(id){var field=$("input[value=_thumbnail_id]","#list-table");if(field.size()>0){$("#meta\\["+field.attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(id)}};WPRemoveThumbnail=function(){$.post(ajaxurl,{action:"set-post-thumbnail",post_id:$("#post_ID").val(),thumbnail_id:-1,cookie:encodeURIComponent(document.cookie)},function(str){if(str=="0"){alert(setPostThumbnailL10n.error)}else{WPSetThumbnailHTML(str)}})}})(jQuery);jQuery(document).ready(function($){var stamp,visibility,sticky="";postboxes.add_postbox_toggles(pagenow);if($("#tagsdiv-post_tag").length){tagBox.init()}else{$("#side-sortables, #normal-sortables, #advanced-sortables").children("div.postbox").each(function(){if(this.id.indexOf("tagsdiv-")===0){tagBox.init();return false}})}$(".categorydiv").each(function(){var this_id=$(this).attr("id"),noSyncChecks=false,syncChecks,catAddAfter,taxonomyParts,taxonomy,settingName;taxonomyParts=this_id.split("-");taxonomyParts.shift();taxonomy=taxonomyParts.join("-");settingName=taxonomy+"_tab";if(taxonomy=="category"){settingName="cats"}$("a","#"+taxonomy+"-tabs").click(function(){var t=$(this).attr("href");$(this).parent().addClass("tabs").siblings("li").removeClass("tabs");$("#"+taxonomy+"-tabs").siblings(".tabs-panel").hide();$(t).show();if("#"+taxonomy+"-all"==t){deleteUserSetting(settingName)}else{setUserSetting(settingName,"pop")}return false});if(getUserSetting(settingName)){$('a[href="#'+taxonomy+'-pop"]',"#"+taxonomy+"-tabs").click()}$("#new"+taxonomy).one("focus",function(){$(this).val("").removeClass("form-input-tip")});$("#"+taxonomy+"-add-submit").click(function(){$("#new"+taxonomy).focus()});syncChecks=function(){if(noSyncChecks){return}noSyncChecks=true;var th=jQuery(this),c=th.is(":checked"),id=th.val().toString();$("#in-"+taxonomy+"-"+id+", #in-"+taxonomy+"-category-"+id).attr("checked",c);noSyncChecks=false};catAddBefore=function(s){if(!$("#new"+taxonomy).val()){return false}s.data+="&"+$(":checked","#"+taxonomy+"checklist").serialize();return s};catAddAfter=function(r,s){var sup,drop=$("#new"+taxonomy+"_parent");if("undefined"!=s.parsed.responses[0]&&(sup=s.parsed.responses[0].supplemental.newcat_parent)){drop.before(sup);drop.remove()}};$("#"+taxonomy+"checklist").wpList({alt:"",response:taxonomy+"-ajax-response",addBefore:catAddBefore,addAfter:catAddAfter});$("#"+taxonomy+"-add-toggle").click(function(){$("#"+taxonomy+"-adder").toggleClass("wp-hidden-children");$('a[href="#'+taxonomy+'-all"]',"#"+taxonomy+"-tabs").click();return false});$("#"+taxonomy+"checklist li.popular-category :checkbox, #"+taxonomy+"checklist-pop :checkbox").live("click",function(){var t=$(this),c=t.is(":checked"),id=t.val();if(id&&t.parents("#taxonomy-"+taxonomy).length){$("#in-"+taxonomy+"-"+id+", #in-popular-"+taxonomy+"-"+id).attr("checked",c)}})});if($("#postcustom").length){$("#the-list").wpList({addAfter:function(xml,s){$("table#list-table").show();if(typeof(autosave_update_post_ID)!="undefined"){autosave_update_post_ID(s.parsed.responses[0].supplemental.postid)}},addBefore:function(s){s.data+="&post_id="+$("#post_ID").val();return s}})}if($("#submitdiv").length){stamp=$("#timestamp").html();visibility=$("#post-visibility-display").html();function updateVisibility(){var pvSelect=$("#post-visibility-select");if($("input:radio:checked",pvSelect).val()!="public"){$("#sticky").attr("checked",false);$("#sticky-span").hide()}else{$("#sticky-span").show()}if($("input:radio:checked",pvSelect).val()!="password"){$("#password-span").hide()}else{$("#password-span").show()}}function updateText(){var attemptedDate,originalDate,currentDate,publishOn,postStatus=$("#post_status"),optPublish=$("option[value=publish]",postStatus),aa=$("#aa").val(),mm=$("#mm").val(),jj=$("#jj").val(),hh=$("#hh").val(),mn=$("#mn").val();attemptedDate=new Date(aa,mm-1,jj,hh,mn);originalDate=new Date($("#hidden_aa").val(),$("#hidden_mm").val()-1,$("#hidden_jj").val(),$("#hidden_hh").val(),$("#hidden_mn").val());currentDate=new Date($("#cur_aa").val(),$("#cur_mm").val()-1,$("#cur_jj").val(),$("#cur_hh").val(),$("#cur_mn").val());if(attemptedDate.getFullYear()!=aa||(1+attemptedDate.getMonth())!=mm||attemptedDate.getDate()!=jj||attemptedDate.getMinutes()!=mn){$(".timestamp-wrap","#timestampdiv").addClass("form-invalid");return false}else{$(".timestamp-wrap","#timestampdiv").removeClass("form-invalid")}if(attemptedDate>currentDate&&$("#original_post_status").val()!="future"){publishOn=postL10n.publishOnFuture;$("#publish").val(postL10n.schedule)}else{if(attemptedDate<=currentDate&&$("#original_post_status").val()!="publish"){publishOn=postL10n.publishOn;$("#publish").val(postL10n.publish)}else{publishOn=postL10n.publishOnPast;if(page){$("#publish").val(postL10n.updatePage)}else{$("#publish").val(postL10n.updatePost)}}}if(originalDate.toUTCString()==attemptedDate.toUTCString()){$("#timestamp").html(stamp)}else{$("#timestamp").html(publishOn+" <b>"+$("option[value="+$("#mm").val()+"]","#mm").text()+" "+jj+", "+aa+" @ "+hh+":"+mn+"</b> ")}if($("input:radio:checked","#post-visibility-select").val()=="private"){if(page){$("#publish").val(postL10n.updatePage)}else{$("#publish").val(postL10n.updatePost)}if(optPublish.length==0){postStatus.append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}else{optPublish.html(postL10n.privatelyPublished)}$("option[value=publish]",postStatus).attr("selected",true);$(".edit-post-status","#misc-publishing-actions").hide()}else{if($("#original_post_status").val()=="future"||$("#original_post_status").val()=="draft"){if(optPublish.length){optPublish.remove();postStatus.val($("#hidden_post_status").val())}}else{optPublish.html(postL10n.published)}if(postStatus.is(":hidden")){$(".edit-post-status","#misc-publishing-actions").show()}}$("#post-status-display").html($("option:selected",postStatus).text());if($("option:selected",postStatus).val()=="private"||$("option:selected",postStatus).val()=="publish"){$("#save-post").hide()}else{$("#save-post").show();if($("option:selected",postStatus).val()=="pending"){$("#save-post").show().val(postL10n.savePending)}else{$("#save-post").show().val(postL10n.saveDraft)}}return true}$(".edit-visibility","#visibility").click(function(){if($("#post-visibility-select").is(":hidden")){updateVisibility();$("#post-visibility-select").slideDown("normal");$(this).hide()}return false});$(".cancel-post-visibility","#post-visibility-select").click(function(){$("#post-visibility-select").slideUp("normal");$("#visibility-radio-"+$("#hidden-post-visibility").val()).attr("checked",true);$("#post_password").val($("#hidden_post_password").val());$("#sticky").attr("checked",$("#hidden-post-sticky").attr("checked"));$("#post-visibility-display").html(visibility);$(".edit-visibility","#visibility").show();updateText();return false});$(".save-post-visibility","#post-visibility-select").click(function(){var pvSelect=$("#post-visibility-select");pvSelect.slideUp("normal");$(".edit-visibility","#visibility").show();updateText();if($("input:radio:checked",pvSelect).val()!="public"){$("#sticky").attr("checked",false)}if(true==$("#sticky").attr("checked")){sticky="Sticky"}else{sticky=""}$("#post-visibility-display").html(postL10n[$("input:radio:checked",pvSelect).val()+sticky]);return false});$("input:radio","#post-visibility-select").change(function(){updateVisibility()});$("#timestampdiv").siblings("a.edit-timestamp").click(function(){if($("#timestampdiv").is(":hidden")){$("#timestampdiv").slideDown("normal");$(this).hide()}return false});$(".cancel-timestamp","#timestampdiv").click(function(){$("#timestampdiv").slideUp("normal");$("#mm").val($("#hidden_mm").val());$("#jj").val($("#hidden_jj").val());$("#aa").val($("#hidden_aa").val());$("#hh").val($("#hidden_hh").val());$("#mn").val($("#hidden_mn").val());$("#timestampdiv").siblings("a.edit-timestamp").show();updateText();return false});$(".save-timestamp","#timestampdiv").click(function(){if(updateText()){$("#timestampdiv").slideUp("normal");$("#timestampdiv").siblings("a.edit-timestamp").show()}return false});$("#post-status-select").siblings("a.edit-post-status").click(function(){if($("#post-status-select").is(":hidden")){$("#post-status-select").slideDown("normal");$(this).hide()}return false});$(".save-post-status","#post-status-select").click(function(){$("#post-status-select").slideUp("normal");$("#post-status-select").siblings("a.edit-post-status").show();updateText();return false});$(".cancel-post-status","#post-status-select").click(function(){$("#post-status-select").slideUp("normal");$("#post_status").val($("#hidden_post_status").val());$("#post-status-select").siblings("a.edit-post-status").show();updateText();return false})}if($("#edit-slug-box").length){editPermalink=function(post_id){var i,c=0,e=$("#editable-post-name"),revert_e=e.html(),real_slug=$("#post_name"),revert_slug=real_slug.html(),b=$("#edit-slug-buttons"),revert_b=b.html(),full=$("#editable-post-name-full").html();$("#view-post-btn").hide();b.html('<a href="#" class="save button">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+"</a>");b.children(".save").click(function(){var new_slug=e.children("input").val();$.post(ajaxurl,{action:"sample-permalink",post_id:post_id,new_slug:new_slug,new_title:$("#title").val(),samplepermalinknonce:$("#samplepermalinknonce").val()},function(data){$("#edit-slug-box").html(data);b.html(revert_b);real_slug.attr("value",new_slug);makeSlugeditClickable();$("#view-post-btn").show()});return false});$(".cancel","#edit-slug-buttons").click(function(){$("#view-post-btn").show();e.html(revert_e);b.html(revert_b);real_slug.attr("value",revert_slug);return false});for(i=0;i<full.length;++i){if("%"==full.charAt(i)){c++}}slug_value=(c>full.length/4)?"":full;e.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children("input").keypress(function(e){var key=e.keyCode||0;if(13==key){b.children(".save").click();return false}if(27==key){b.children(".cancel").click();return false}real_slug.attr("value",this.value)}).focus()};makeSlugeditClickable=function(){$("#editable-post-name").click(function(){$("#edit-slug-buttons").children(".edit-slug").click()})};makeSlugeditClickable()}});
</ins><span class="cx">\ No newline at end of file
</span></span></pre>
</div>
</div>
</body>
</html>