From c721f308ce74b736acb5c28d1d2910d3a8459c41 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sat, 30 Apr 2011 02:15:08 +0000 Subject: [PATCH] Add quotes to [value="some"] selectors, see #16426 git-svn-id: https://develop.svn.wordpress.org/trunk@17777 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/js/comment.dev.js | 4 ++-- wp-admin/js/comment.js | 2 +- wp-admin/js/custom-fields.dev.js | 2 +- wp-admin/js/custom-fields.js | 2 +- wp-admin/js/edit-comments.dev.js | 10 +++++----- wp-admin/js/edit-comments.js | 2 +- wp-admin/js/image-edit.dev.js | 2 +- wp-admin/js/image-edit.js | 2 +- wp-admin/js/inline-edit-post.dev.js | 10 +++++----- wp-admin/js/inline-edit-post.js | 2 +- wp-admin/js/nav-menu.dev.js | 2 +- wp-admin/js/nav-menu.js | 2 +- wp-admin/js/post.dev.js | 8 ++++---- wp-admin/js/post.js | 2 +- wp-admin/js/tags.dev.js | 2 +- wp-admin/js/tags.js | 2 +- wp-admin/js/user-profile.dev.js | 2 +- wp-admin/js/user-profile.js | 2 +- wp-includes/js/wp-lists.dev.js | 14 +++++++------- wp-includes/js/wp-lists.js | 2 +- wp-includes/script-loader.php | 20 ++++++++++---------- 21 files changed, 48 insertions(+), 48 deletions(-) diff --git a/wp-admin/js/comment.dev.js b/wp-admin/js/comment.dev.js index acb1dd8653..a014a515fc 100644 --- a/wp-admin/js/comment.dev.js +++ b/wp-admin/js/comment.dev.js @@ -36,7 +36,7 @@ jQuery(document).ready( function($) { $('.edit-timestamp').show(); $('#timestamp').html( commentL10n.submittedOn + ' ' + - $( '#mm option[value=' + mm + ']' ).text() + ' ' + + $( '#mm option[value="' + mm + '"]' ).text() + ' ' + jj + ', ' + aa + ' @ ' + hh + ':' + @@ -44,4 +44,4 @@ jQuery(document).ready( function($) { ); return false; }); -}); \ No newline at end of file +}); diff --git a/wp-admin/js/comment.js b/wp-admin/js/comment.js index c05cb608d0..5816ebb16f 100644 --- a/wp-admin/js/comment.js +++ b/wp-admin/js/comment.js @@ -1 +1 @@ -jQuery(document).ready(function(b){var a=b("#timestamp").html();b(".edit-timestamp").click(function(){if(b("#timestampdiv").is(":hidden")){b("#timestampdiv").slideDown("normal");b(".edit-timestamp").hide()}return false});b(".cancel-timestamp").click(function(){b("#timestampdiv").slideUp("normal");b("#mm").val(b("#hidden_mm").val());b("#jj").val(b("#hidden_jj").val());b("#aa").val(b("#hidden_aa").val());b("#hh").val(b("#hidden_hh").val());b("#mn").val(b("#hidden_mn").val());b("#timestamp").html(a);b(".edit-timestamp").show();return false});b(".save-timestamp").click(function(){var g=b("#aa").val(),h=b("#mm").val(),d=b("#jj").val(),c=b("#hh").val(),f=b("#mn").val(),e=new Date(g,h-1,d,c,f);if(e.getFullYear()!=g||(1+e.getMonth())!=h||e.getDate()!=d||e.getMinutes()!=f){b(".timestamp-wrap","#timestampdiv").addClass("form-invalid");return false}else{b(".timestamp-wrap","#timestampdiv").removeClass("form-invalid")}b("#timestampdiv").slideUp("normal");b(".edit-timestamp").show();b("#timestamp").html(commentL10n.submittedOn+" "+b("#mm option[value="+h+"]").text()+" "+d+", "+g+" @ "+c+":"+f+" ");return false})}); \ No newline at end of file +jQuery(document).ready(function(b){var a=b("#timestamp").html();b(".edit-timestamp").click(function(){if(b("#timestampdiv").is(":hidden")){b("#timestampdiv").slideDown("normal");b(".edit-timestamp").hide()}return false});b(".cancel-timestamp").click(function(){b("#timestampdiv").slideUp("normal");b("#mm").val(b("#hidden_mm").val());b("#jj").val(b("#hidden_jj").val());b("#aa").val(b("#hidden_aa").val());b("#hh").val(b("#hidden_hh").val());b("#mn").val(b("#hidden_mn").val());b("#timestamp").html(a);b(".edit-timestamp").show();return false});b(".save-timestamp").click(function(){var g=b("#aa").val(),h=b("#mm").val(),d=b("#jj").val(),c=b("#hh").val(),f=b("#mn").val(),e=new Date(g,h-1,d,c,f);if(e.getFullYear()!=g||(1+e.getMonth())!=h||e.getDate()!=d||e.getMinutes()!=f){b(".timestamp-wrap","#timestampdiv").addClass("form-invalid");return false}else{b(".timestamp-wrap","#timestampdiv").removeClass("form-invalid")}b("#timestampdiv").slideUp("normal");b(".edit-timestamp").show();b("#timestamp").html(commentL10n.submittedOn+" "+b('#mm option[value="'+h+'"]').text()+" "+d+", "+g+" @ "+c+":"+f+" ");return false})}); \ No newline at end of file diff --git a/wp-admin/js/custom-fields.dev.js b/wp-admin/js/custom-fields.dev.js index 70be83a8c4..9eab214553 100644 --- a/wp-admin/js/custom-fields.dev.js +++ b/wp-admin/js/custom-fields.dev.js @@ -2,7 +2,7 @@ jQuery(document).ready( function($) { var before, addBefore, addAfter, delBefore; before = function() { - var nonce = $('#newmeta [name=_ajax_nonce]').val(), postId = $('#post_ID').val(); + var nonce = $('#newmeta [name="_ajax_nonce"]').val(), postId = $('#post_ID').val(); if ( !nonce || !postId ) { return false; } return [nonce,postId]; } diff --git a/wp-admin/js/custom-fields.js b/wp-admin/js/custom-fields.js index 48dad1e3aa..dbe2f4816e 100644 --- a/wp-admin/js/custom-fields.js +++ b/wp-admin/js/custom-fields.js @@ -1 +1 @@ -jQuery(document).ready(function(d){var c,b,e,a;c=function(){var g=d("#newmeta [name=_ajax_nonce]").val(),f=d("#post_ID").val();if(!g||!f){return false}return[g,f]};b=function(g){var f=c();if(!f){return false}g.data=g.data.replace(/_ajax_nonce=[a-f0-9]+/,"_ajax_nonce="+f[0])+"&post_id="+f[1];return g};e=function(j,i){var f=d("postid",j).text(),g;if(!f){return}d("#post_ID").attr("name","post_ID").val(f);g=d("#hiddenaction");if("post"==g.val()){g.val("postajaxpost")}};a=function(g){var f=c();if(!f){return false}g.data._ajax_nonce=f[0];g.data.post_id=f[1];return g};d("#the-list").wpList({addBefore:b,addAfter:e,delBefore:a}).find(".updatemeta, .deletemeta").attr("type","button")}); \ No newline at end of file +jQuery(document).ready(function(d){var c,b,e,a;c=function(){var g=d('#newmeta [name="_ajax_nonce"]').val(),f=d("#post_ID").val();if(!g||!f){return false}return[g,f]};b=function(g){var f=c();if(!f){return false}g.data=g.data.replace(/_ajax_nonce=[a-f0-9]+/,"_ajax_nonce="+f[0])+"&post_id="+f[1];return g};e=function(j,i){var f=d("postid",j).text(),g;if(!f){return}d("#post_ID").attr("name","post_ID").val(f);g=d("#hiddenaction");if("post"==g.val()){g.val("postajaxpost")}};a=function(g){var f=c();if(!f){return false}g.data._ajax_nonce=f[0];g.data.post_id=f[1];return g};d("#the-list").wpList({addBefore:b,addAfter:e,delBefore:a}).find(".updatemeta, .deletemeta").attr("type","button")}); \ No newline at end of file diff --git a/wp-admin/js/edit-comments.dev.js b/wp-admin/js/edit-comments.dev.js index b81b397978..87847b56d6 100644 --- a/wp-admin/js/edit-comments.dev.js +++ b/wp-admin/js/edit-comments.dev.js @@ -38,7 +38,7 @@ setCommentsList = function() { settings.data._per_page = perPageInput.val() || 0; settings.data._page = pageInput.val() || 0; settings.data._url = document.location.href; - settings.data.comment_status = $('input[name=comment_status]', '#comments-form').val(); + settings.data.comment_status = $('input[name="comment_status"]', '#comments-form').val(); if ( cl.indexOf(':trash=1') != -1 ) action = 'trash'; @@ -216,8 +216,8 @@ setCommentsList = function() { }; var refillTheExtraList = function(ev) { - // var args = $.query.get(), total_pages = listTable.get_total_pages(), per_page = $('input[name=_per_page]', '#comments-form').val(), r; - var args = $.query.get(), total_pages = $('.total-pages').text(), per_page = $('input[name=_per_page]', '#comments-form').val(), r; + // var args = $.query.get(), total_pages = listTable.get_total_pages(), per_page = $('input[name="_per_page"]', '#comments-form').val(), r; + var args = $.query.get(), total_pages = $('.total-pages').text(), per_page = $('input[name="_per_page"]', '#comments-form').val(), r; if (! args.paged) args.paged = 1; @@ -439,7 +439,7 @@ commentReply = { post.content = $('#replycontent').val(); post.id = post.comment_post_ID; post.comments_listing = this.comments_listing; - post.p = $('[name=p]').val(); + post.p = $('[name="p"]').val(); $.ajax({ type : 'POST', @@ -535,7 +535,7 @@ $(document).ready(function(){ make_bulk = function(value) { return function() { var scope = $('select[name="action"]'); - $('option[value='+value+']', scope).attr('selected', 'selected'); + $('option[value="' + value + '"]', scope).attr('selected', 'selected'); $('#doaction').click(); } }; diff --git a/wp-admin/js/edit-comments.js b/wp-admin/js/edit-comments.js index 365768556d..0e6335c021 100644 --- a/wp-admin/js/edit-comments.js +++ b/wp-admin/js/edit-comments.js @@ -1 +1 @@ -var theList,theExtraList,toggleWithKeyboard=false;(function(a){setCommentsList=function(){var d,f,i,m=0,h,j,e,l;d=a('input[name="_total"]',"#comments-form");f=a('input[name="_per_page"]',"#comments-form");i=a('input[name="_page"]',"#comments-form");h=function(o,n){var p=a("#"+n.element);if(p.is(".unapproved")){p.find("div.comment_status").html("0")}else{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("#"+n.element).is("."+n.dimClass)?1:-1;s=s+r;if(s<0){s=0}q.closest("#awaiting-mod")[0==s?"addClass":"removeClass"]("count-0");g(q,s);k()})};j=function(r,v){var x=a(r.target).attr("className"),o,p,q,u,w,t,s=false;r.data._total=d.val()||0;r.data._per_page=f.val()||0;r.data._page=i.val()||0;r.data._url=document.location.href;r.data.comment_status=a("input[name=comment_status]","#comments-form").val();if(x.indexOf(":trash=1")!=-1){s="trash"}else{if(x.indexOf(":spam=1")!=-1){s="spam"}}if(s){o=x.replace(/.*?comment-([0-9]+).*/,"$1");p=a("#comment-"+o);note=a("#"+s+"-undo-holder").html();p.find(".check-column :checkbox").attr("checked","");if(p.siblings("#replyrow").length&&commentReply.cid==o){commentReply.close()}if(p.is("tr")){q=p.children(":visible").length;t=a(".author strong",p).text();u=a(''+note+"")}else{t=a(".comment-author",p).text();u=a('")}p.before(u);a("strong","#undo-"+o).text(t+" ");w=a(".undo a","#undo-"+o);w.attr("href","comment.php?action=un"+s+"comment&c="+o+"&_wpnonce="+r.data._ajax_nonce);w.attr("className","delete:the-comment-list:comment-"+o+"::un"+s+"=1 vim-z vim-destructive");a(".avatar",p).clone().prependTo("#undo-"+o+" ."+s+"-undo-inside");w.click(function(){v.wpList.del(this);a("#undo-"+o).css({backgroundColor:"#ceb"}).fadeOut(350,function(){a(this).remove();a("#comment-"+o).css("backgroundColor","").fadeIn(300,function(){a(this).show()})});return false})}return r};e=function(n,o,p){if(o3){while(q.length>3){o=thousandsSeparator+q.substr(q.length-3)+o;q=q.substr(0,q.length-3)}q=q+o}p.html(q)}l=function(n,p){var u,q,s,w=a(p.target).parent().is("span.untrash"),o=a(p.target).parent().is("span.unspam"),v,t;function x(r){if(a(p.target).parent().is("span."+r)){return 1}else{if(a("#"+p.element).is("."+r)){return -1}}return 0}v=x("spam");t=x("trash");if(w){t=-1}if(o){v=-1}a("span.pending-count").each(function(){var r=a(this),z=c(r),y=a("#"+p.element).is(".unapproved");if(a(p.target).parent().is("span.unapprove")||((w||o)&&y)){z=z+1}else{if(y){z=z-1}}if(z<0){z=0}r.closest("#awaiting-mod")[0==z?"addClass":"removeClass"]("count-0");g(r,z);k()});a("span.spam-count").each(function(){var r=a(this),y=c(r)+v;g(r,y)});a("span.trash-count").each(function(){var r=a(this),y=c(r)+t;g(r,y)});if(a("#dashboard_right_now").length){s=t?-1*t:0;k(s)}else{u=d.val()?parseInt(d.val(),10):0;u=u-v-t;if(u<0){u=0}if(("object"==typeof n)&&mn){return}if(s){theExtraList.empty();o.number=Math.min(8,p)}else{o.number=1;o.offset=Math.min(8,p)-1}o.no_placeholder=true;o.paged++;if(true===o.comment_type){o.comment_type=""}o=a.extend(o,{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:o,success:function(r){theExtraList.get(0).wpList.add(r.rows)}})};theExtraList=a("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"});theList=a("#the-comment-list").wpList({alt:"",delBefore:j,dimAfter:h,delAfter:l,addColor:"none"}).bind("wpListDelEnd",function(o,n){var p=n.element.replace(/[^0-9]+/g,"");if(n.target.className.indexOf(":trash=1")!=-1||n.target.className.indexOf(":spam=1")!=-1){a("#undo-"+p).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","120px")}else{a("#replycontainer").resizable("destroy").css("height","120px")}this.cid=""}},open:function(b,d,k){var l=this,e,f,i,g,j=a("#comment-"+b);l.close();l.cid=b;e=a("#replyrow");f=a("#inline-"+b);i=l.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{a("#edithead, #savebtn",e).hide();a("#replyhead, #replybtn",e).show();j.after(e);a("#replyrow").fadeIn(300,function(){a(this).show()})}if(!a.browser.msie){a("#replycontainer").resizable({handles:"s",axis:"y",minHeight:80,stop:function(){a("#replycontainer").width("auto")}})}setTimeout(function(){var n,h,o,c,m;n=a("#replyrow").offset().top;h=n+a("#replyrow").height();o=window.pageYOffset||document.documentElement.scrollTop;c=document.documentElement.clientHeight||self.innerHeight||0;m=o+c;if(m-20]*?>/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")}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().attr("checked","");toggleWithKeyboard=false};d=function(f){return function(){var g=a('select[name="action"]');a("option[value="+f+"]",g).attr("selected","selected");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); \ No newline at end of file +var theList,theExtraList,toggleWithKeyboard=false;(function(a){setCommentsList=function(){var d,f,i,m=0,h,j,e,l;d=a('input[name="_total"]',"#comments-form");f=a('input[name="_per_page"]',"#comments-form");i=a('input[name="_page"]',"#comments-form");h=function(o,n){var p=a("#"+n.element);if(p.is(".unapproved")){p.find("div.comment_status").html("0")}else{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("#"+n.element).is("."+n.dimClass)?1:-1;s=s+r;if(s<0){s=0}q.closest("#awaiting-mod")[0==s?"addClass":"removeClass"]("count-0");g(q,s);k()})};j=function(r,v){var x=a(r.target).attr("className"),o,p,q,u,w,t,s=false;r.data._total=d.val()||0;r.data._per_page=f.val()||0;r.data._page=i.val()||0;r.data._url=document.location.href;r.data.comment_status=a('input[name="comment_status"]',"#comments-form").val();if(x.indexOf(":trash=1")!=-1){s="trash"}else{if(x.indexOf(":spam=1")!=-1){s="spam"}}if(s){o=x.replace(/.*?comment-([0-9]+).*/,"$1");p=a("#comment-"+o);note=a("#"+s+"-undo-holder").html();p.find(".check-column :checkbox").attr("checked","");if(p.siblings("#replyrow").length&&commentReply.cid==o){commentReply.close()}if(p.is("tr")){q=p.children(":visible").length;t=a(".author strong",p).text();u=a(''+note+"")}else{t=a(".comment-author",p).text();u=a('")}p.before(u);a("strong","#undo-"+o).text(t+" ");w=a(".undo a","#undo-"+o);w.attr("href","comment.php?action=un"+s+"comment&c="+o+"&_wpnonce="+r.data._ajax_nonce);w.attr("className","delete:the-comment-list:comment-"+o+"::un"+s+"=1 vim-z vim-destructive");a(".avatar",p).clone().prependTo("#undo-"+o+" ."+s+"-undo-inside");w.click(function(){v.wpList.del(this);a("#undo-"+o).css({backgroundColor:"#ceb"}).fadeOut(350,function(){a(this).remove();a("#comment-"+o).css("backgroundColor","").fadeIn(300,function(){a(this).show()})});return false})}return r};e=function(n,o,p){if(o3){while(q.length>3){o=thousandsSeparator+q.substr(q.length-3)+o;q=q.substr(0,q.length-3)}q=q+o}p.html(q)}l=function(n,p){var u,q,s,w=a(p.target).parent().is("span.untrash"),o=a(p.target).parent().is("span.unspam"),v,t;function x(r){if(a(p.target).parent().is("span."+r)){return 1}else{if(a("#"+p.element).is("."+r)){return -1}}return 0}v=x("spam");t=x("trash");if(w){t=-1}if(o){v=-1}a("span.pending-count").each(function(){var r=a(this),z=c(r),y=a("#"+p.element).is(".unapproved");if(a(p.target).parent().is("span.unapprove")||((w||o)&&y)){z=z+1}else{if(y){z=z-1}}if(z<0){z=0}r.closest("#awaiting-mod")[0==z?"addClass":"removeClass"]("count-0");g(r,z);k()});a("span.spam-count").each(function(){var r=a(this),y=c(r)+v;g(r,y)});a("span.trash-count").each(function(){var r=a(this),y=c(r)+t;g(r,y)});if(a("#dashboard_right_now").length){s=t?-1*t:0;k(s)}else{u=d.val()?parseInt(d.val(),10):0;u=u-v-t;if(u<0){u=0}if(("object"==typeof n)&&mn){return}if(s){theExtraList.empty();o.number=Math.min(8,p)}else{o.number=1;o.offset=Math.min(8,p)-1}o.no_placeholder=true;o.paged++;if(true===o.comment_type){o.comment_type=""}o=a.extend(o,{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:o,success:function(r){theExtraList.get(0).wpList.add(r.rows)}})};theExtraList=a("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"});theList=a("#the-comment-list").wpList({alt:"",delBefore:j,dimAfter:h,delAfter:l,addColor:"none"}).bind("wpListDelEnd",function(o,n){var p=n.element.replace(/[^0-9]+/g,"");if(n.target.className.indexOf(":trash=1")!=-1||n.target.className.indexOf(":spam=1")!=-1){a("#undo-"+p).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","120px")}else{a("#replycontainer").resizable("destroy").css("height","120px")}this.cid=""}},open:function(b,d,k){var l=this,e,f,i,g,j=a("#comment-"+b);l.close();l.cid=b;e=a("#replyrow");f=a("#inline-"+b);i=l.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{a("#edithead, #savebtn",e).hide();a("#replyhead, #replybtn",e).show();j.after(e);a("#replyrow").fadeIn(300,function(){a(this).show()})}if(!a.browser.msie){a("#replycontainer").resizable({handles:"s",axis:"y",minHeight:80,stop:function(){a("#replycontainer").width("auto")}})}setTimeout(function(){var n,h,o,c,m;n=a("#replyrow").offset().top;h=n+a("#replyrow").height();o=window.pageYOffset||document.documentElement.scrollTop;c=document.documentElement.clientHeight||self.innerHeight||0;m=o+c;if(m-20]*?>/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")}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().attr("checked","");toggleWithKeyboard=false};d=function(f){return function(){var g=a('select[name="action"]');a('option[value="'+f+'"]',g).attr("selected","selected");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); \ No newline at end of file diff --git a/wp-admin/js/image-edit.dev.js b/wp-admin/js/image-edit.dev.js index 0e43d5110c..d67d268ce5 100644 --- a/wp-admin/js/image-edit.dev.js +++ b/wp-admin/js/image-edit.dev.js @@ -64,7 +64,7 @@ imageEdit = { }, getTarget : function(postid) { - return $('input[name=imgedit-target-' + postid + ']:checked', '#imgedit-save-target-' + postid).val() || 'full'; + return $('input[name="imgedit-target-' + postid + '"]:checked', '#imgedit-save-target-' + postid).val() || 'full'; }, scaleChanged : function(postid, x) { diff --git a/wp-admin/js/image-edit.js b/wp-admin/js/image-edit.js index af3f503844..771717acfe 100644 --- a/wp-admin/js/image-edit.js +++ b/wp-admin/js/image-edit.js @@ -1 +1 @@ -var imageEdit;(function(a){imageEdit={iasapi:{},hold:{},postid:"",intval:function(b){return b|0},setDisabled:function(c,b){if(b){c.removeClass("disabled");a("input",c).removeAttr("disabled")}else{c.addClass("disabled");a("input",c).attr("disabled","disabled")}},init:function(g,e){var d=this,c=a("#image-editor-"+d.postid),b=d.intval(a("#imgedit-x-"+g).val()),f=d.intval(a("#imgedit-y-"+g).val());if(d.postid!=g&&c.length){d.close(d.postid)}d.hold.w=d.hold.ow=b;d.hold.h=d.hold.oh=f;d.hold.xy_ratio=b/f;d.hold.sizer=parseFloat(a("#imgedit-sizer-"+g).val());d.postid=g;a("#imgedit-response-"+g).empty();a('input[type="text"]',"#imgedit-panel-"+g).keypress(function(i){var h=i.keyCode;if(36this.hold.oh)||(c&&c>this.hold.ow)){g.css("visibility","visible")}else{g.css("visibility","hidden")}},getSelRatio:function(f){var b=this.hold.w,e=this.hold.h,d=this.intval(a("#imgedit-crop-width-"+f).val()),c=this.intval(a("#imgedit-crop-height-"+f).val());if(d&&c){return d+":"+c}if(b&&e){return b+":"+e}return"1:1"},filterHistory:function(j,f){var d=a("#imgedit-history-"+j).val(),b,h,e,c,g=[];if(d!=""){d=JSON.parse(d);b=this.intval(a("#imgedit-undone-"+j).val());if(b>0){while(b>0){d.pop();b--}}if(f){if(!d.length){this.hold.w=this.hold.ow;this.hold.h=this.hold.oh;return""}e=d[d.length-1];e=e.c||e.r||e.f||false;if(e){this.hold.w=e.fw;this.hold.h=e.fh}}for(h in d){c=d[h];if(c.hasOwnProperty("c")){g[h]={c:{x:c.c.x,y:c.c.y,w:c.c.w,h:c.c.h}}}else{if(c.hasOwnProperty("r")){g[h]={r:c.r.r}}else{if(c.hasOwnProperty("f")){g[h]={f:c.f.f}}}}}return JSON.stringify(g)}return""},refreshEditor:function(g,d,f){var c=this,e,b;c.toggleEditor(g,1);e={action:"imgedit-preview",_ajax_nonce:d,postid:g,history:c.filterHistory(g,1),rand:c.intval(Math.random()*1000000)};b=a('');b.load(function(){var i,h,k=a("#imgedit-crop-"+g),j=imageEdit;k.empty().append(b);i=Math.max(j.hold.w,j.hold.h);h=Math.max(a(b).width(),a(b).height());j.hold.sizer=i>h?h/i:1;j.initCrop(g,b,k);j.setCropSelection(g,0);if((typeof f!="unknown")&&f!=null){f()}if(a("#imgedit-history-"+g).val()&&a("#imgedit-undone-"+g).val()==0){a("input.imgedit-submit-btn","#imgedit-panel-"+g).removeAttr("disabled")}else{a("input.imgedit-submit-btn","#imgedit-panel-"+g).attr("disabled","disabled")}j.toggleEditor(g,0)}).attr("src",ajaxurl+"?"+a.param(e))},action:function(b,g,c){var j=this,e,i,f,d,k;if(j.notsaved(b)){return false}e={action:"image-editor",_ajax_nonce:g,postid:b};if("scale"==c){i=a("#imgedit-scale-width-"+b),f=a("#imgedit-scale-height-"+b),d=j.intval(i.val()),k=j.intval(f.val());if(d<1){i.focus();return false}else{if(k<1){f.focus();return false}}if(d==j.hold.ow||k==j.hold.oh){return false}e["do"]="scale";e.fwidth=d;e.fheight=k}else{if("restore"==c){e["do"]="restore"}else{return false}}j.toggleEditor(b,1);a.post(ajaxurl,e,function(h){a("#image-editor-"+b).empty().append(h);j.toggleEditor(b,0)})},save:function(f,b){var c,e=this.getTarget(f),d=this.filterHistory(f,0);if(""==d){return false}this.toggleEditor(f,1);c={action:"image-editor",_ajax_nonce:b,postid:f,history:d,target:e,"do":"save"};a.post(ajaxurl,c,function(h){var g=JSON.parse(h);if(g.error){a("#imgedit-response-"+f).html('

'+g.error+"

");imageEdit.close(f);return}if(g.fw&&g.fh){a("#media-dims-"+f).html(g.fw+" × "+g.fh)}if(g.thumbnail){a(".thumbnail","#thumbnail-head-"+f).attr("src",""+g.thumbnail)}if(g.msg){a("#imgedit-response-"+f).html('

'+g.msg+"

")}imageEdit.close(f)})},open:function(h,d){var f,e=a("#image-editor-"+h),c=a("#media-head-"+h),b=a("#imgedit-open-btn-"+h),g=b.siblings("img");b.attr("disabled","disabled");g.css("visibility","visible");f={action:"image-editor",_ajax_nonce:d,postid:h,"do":"open"};e.load(ajaxurl,f,function(){e.fadeIn("fast");c.fadeOut("fast",function(){b.removeAttr("disabled");g.css("visibility","hidden")})})},imgLoaded:function(d){var b=a("#image-preview-"+d),c=a("#imgedit-crop-"+d);this.initCrop(d,b,c);this.setCropSelection(d,0);this.toggleEditor(d,0)},initCrop:function(g,e,c){var b=this,d=a("#imgedit-sel-width-"+g),f=a("#imgedit-sel-height-"+g);b.iasapi=a(e).imgAreaSelect({parent:c,instance:true,handles:true,keys:true,minWidth:3,minHeight:3,onInit:function(h,i){c.children().mousedown(function(m){var k=false,l,j;if(m.shiftKey){l=b.iasapi.getSelection();j=b.getSelRatio(g);k=(l&&l.width&&l.height)?l.width+":"+l.height:j}b.iasapi.setOptions({aspectRatio:k})})},onSelectStart:function(h,i){imageEdit.setDisabled(a("#imgedit-crop-sel-"+g),1)},onSelectEnd:function(h,i){imageEdit.setCropSelection(g,i)},onSelectChange:function(h,j){var i=imageEdit.hold.sizer;d.val(imageEdit.round(j.width/i));f.val(imageEdit.round(j.height/i))}})},setCropSelection:function(g,f){var e,b=a("#imgedit-minthumb-"+g).val()||"128:128",d=this.hold.sizer;b=b.split(":");f=f||0;if(!f||(f.width<3&&f.height<3)){this.setDisabled(a(".imgedit-crop","#imgedit-panel-"+g),0);this.setDisabled(a("#imgedit-crop-sel-"+g),0);a("#imgedit-sel-width-"+g).val("");a("#imgedit-sel-height-"+g).val("");a("#imgedit-selection-"+g).val("");return false}if(f.width<(b[0]*d)&&f.height<(b[1]*d)){this.setDisabled(a(".imgedit-crop","#imgedit-panel-"+g),0);a("#imgedit-selection-"+g).val("");return false}e={x:f.x1,y:f.y1,w:f.width,h:f.height};this.setDisabled(a(".imgedit-crop","#imgedit-panel-"+g),1);a("#imgedit-selection-"+g).val(JSON.stringify(e))},close:function(c,b){b=b||false;if(b&&this.notsaved(c)){return false}this.iasapi={};this.hold={};a("#image-editor-"+c).fadeOut("fast",function(){a("#media-head-"+c).fadeIn("fast");a(this).empty()})},notsaved:function(e){var c=a("#imgedit-history-"+e).val(),d=(c!="")?JSON.parse(c):new Array(),b=this.intval(a("#imgedit-undone-"+e).val());if(b0){g.pop();b--}f.val(0);g.push(i);e.val(JSON.stringify(g));c.refreshEditor(h,d,function(){c.setDisabled(a("#image-undo-"+h),true);c.setDisabled(a("#image-redo-"+h),false)})},rotate:function(d,e,c,b){if(a(b).hasClass("disabled")){return false}this.addStep({r:{r:d,fw:this.hold.h,fh:this.hold.w}},e,c)},flip:function(d,e,c,b){if(a(b).hasClass("disabled")){return false}this.addStep({f:{f:d,fw:this.hold.w,fh:this.hold.h}},e,c)},crop:function(g,e,c){var f=a("#imgedit-selection-"+g).val(),b=this.intval(a("#imgedit-sel-width-"+g).val()),d=this.intval(a("#imgedit-sel-height-"+g).val());if(a(c).hasClass("disabled")||f==""){return false}f=JSON.parse(f);if(f.w>0&&f.h>0&&b>0&&d>0){f.fw=b;f.fh=d;this.addStep({c:f},g,e)}},undo:function(g,e){var d=this,c=a("#image-undo-"+g),f=a("#imgedit-undone-"+g),b=d.intval(f.val())+1;if(c.hasClass("disabled")){return}f.val(b);d.refreshEditor(g,e,function(){var h=a("#imgedit-history-"+g),i=(h.val()!="")?JSON.parse(h.val()):new Array();d.setDisabled(a("#image-redo-"+g),true);d.setDisabled(c,b0)})},setNumSelection:function(c){var g,k=a("#imgedit-sel-width-"+c),j=a("#imgedit-sel-height-"+c),o=this.intval(k.val()),m=this.intval(j.val()),i=a("#image-preview-"+c),p=i.height(),h=i.width(),b=this.hold.sizer,f,n,e,l,d=this.iasapi;if(o<1){k.val("");return false}if(m<1){j.val("");return false}if(o&&m&&(g=d.getSelection())){e=g.x1+Math.round(o*b);l=g.y1+Math.round(m*b);f=g.x1;n=g.y1;if(e>h){f=0;e=h;k.val(Math.round(e/b))}if(l>p){n=0;l=p;j.val(Math.round(l/b))}d.setSelection(f,n,e,l);d.update();this.setCropSelection(c,d.getSelection())}},round:function(b){var c;b=Math.round(b);if(this.hold.sizer>0.6){return b}c=b.toString().slice(-1);if("1"==c){return b-1}else{if("9"==c){return b+1}}return b},setRatioSelection:function(j,i,d){var f,e,b=this.intval(a("#imgedit-crop-width-"+j).val()),g=this.intval(a("#imgedit-crop-height-"+j).val()),c=a("#image-preview-"+j).height();if(!this.intval(a(d).val())){a(d).val("");return}if(b&&g){this.iasapi.setOptions({aspectRatio:b+":"+g});if(f=this.iasapi.getSelection(true)){e=Math.ceil(f.y1+((f.x2-f.x1)/(b/g)));if(e>c){e=c;if(i){a("#imgedit-crop-height-"+j).val("")}else{a("#imgedit-crop-width-"+j).val("")}}this.iasapi.setSelection(f.x1,f.y1,f.x2,e);this.iasapi.update()}}}}})(jQuery); \ No newline at end of file +var imageEdit;(function(a){imageEdit={iasapi:{},hold:{},postid:"",intval:function(b){return b|0},setDisabled:function(c,b){if(b){c.removeClass("disabled");a("input",c).removeAttr("disabled")}else{c.addClass("disabled");a("input",c).attr("disabled","disabled")}},init:function(g,e){var d=this,c=a("#image-editor-"+d.postid),b=d.intval(a("#imgedit-x-"+g).val()),f=d.intval(a("#imgedit-y-"+g).val());if(d.postid!=g&&c.length){d.close(d.postid)}d.hold.w=d.hold.ow=b;d.hold.h=d.hold.oh=f;d.hold.xy_ratio=b/f;d.hold.sizer=parseFloat(a("#imgedit-sizer-"+g).val());d.postid=g;a("#imgedit-response-"+g).empty();a('input[type="text"]',"#imgedit-panel-"+g).keypress(function(i){var h=i.keyCode;if(36this.hold.oh)||(c&&c>this.hold.ow)){g.css("visibility","visible")}else{g.css("visibility","hidden")}},getSelRatio:function(f){var b=this.hold.w,e=this.hold.h,d=this.intval(a("#imgedit-crop-width-"+f).val()),c=this.intval(a("#imgedit-crop-height-"+f).val());if(d&&c){return d+":"+c}if(b&&e){return b+":"+e}return"1:1"},filterHistory:function(j,f){var d=a("#imgedit-history-"+j).val(),b,h,e,c,g=[];if(d!=""){d=JSON.parse(d);b=this.intval(a("#imgedit-undone-"+j).val());if(b>0){while(b>0){d.pop();b--}}if(f){if(!d.length){this.hold.w=this.hold.ow;this.hold.h=this.hold.oh;return""}e=d[d.length-1];e=e.c||e.r||e.f||false;if(e){this.hold.w=e.fw;this.hold.h=e.fh}}for(h in d){c=d[h];if(c.hasOwnProperty("c")){g[h]={c:{x:c.c.x,y:c.c.y,w:c.c.w,h:c.c.h}}}else{if(c.hasOwnProperty("r")){g[h]={r:c.r.r}}else{if(c.hasOwnProperty("f")){g[h]={f:c.f.f}}}}}return JSON.stringify(g)}return""},refreshEditor:function(g,d,f){var c=this,e,b;c.toggleEditor(g,1);e={action:"imgedit-preview",_ajax_nonce:d,postid:g,history:c.filterHistory(g,1),rand:c.intval(Math.random()*1000000)};b=a('');b.load(function(){var i,h,k=a("#imgedit-crop-"+g),j=imageEdit;k.empty().append(b);i=Math.max(j.hold.w,j.hold.h);h=Math.max(a(b).width(),a(b).height());j.hold.sizer=i>h?h/i:1;j.initCrop(g,b,k);j.setCropSelection(g,0);if((typeof f!="unknown")&&f!=null){f()}if(a("#imgedit-history-"+g).val()&&a("#imgedit-undone-"+g).val()==0){a("input.imgedit-submit-btn","#imgedit-panel-"+g).removeAttr("disabled")}else{a("input.imgedit-submit-btn","#imgedit-panel-"+g).attr("disabled","disabled")}j.toggleEditor(g,0)}).attr("src",ajaxurl+"?"+a.param(e))},action:function(b,g,c){var j=this,e,i,f,d,k;if(j.notsaved(b)){return false}e={action:"image-editor",_ajax_nonce:g,postid:b};if("scale"==c){i=a("#imgedit-scale-width-"+b),f=a("#imgedit-scale-height-"+b),d=j.intval(i.val()),k=j.intval(f.val());if(d<1){i.focus();return false}else{if(k<1){f.focus();return false}}if(d==j.hold.ow||k==j.hold.oh){return false}e["do"]="scale";e.fwidth=d;e.fheight=k}else{if("restore"==c){e["do"]="restore"}else{return false}}j.toggleEditor(b,1);a.post(ajaxurl,e,function(h){a("#image-editor-"+b).empty().append(h);j.toggleEditor(b,0)})},save:function(f,b){var c,e=this.getTarget(f),d=this.filterHistory(f,0);if(""==d){return false}this.toggleEditor(f,1);c={action:"image-editor",_ajax_nonce:b,postid:f,history:d,target:e,"do":"save"};a.post(ajaxurl,c,function(h){var g=JSON.parse(h);if(g.error){a("#imgedit-response-"+f).html('

'+g.error+"

");imageEdit.close(f);return}if(g.fw&&g.fh){a("#media-dims-"+f).html(g.fw+" × "+g.fh)}if(g.thumbnail){a(".thumbnail","#thumbnail-head-"+f).attr("src",""+g.thumbnail)}if(g.msg){a("#imgedit-response-"+f).html('

'+g.msg+"

")}imageEdit.close(f)})},open:function(h,d){var f,e=a("#image-editor-"+h),c=a("#media-head-"+h),b=a("#imgedit-open-btn-"+h),g=b.siblings("img");b.attr("disabled","disabled");g.css("visibility","visible");f={action:"image-editor",_ajax_nonce:d,postid:h,"do":"open"};e.load(ajaxurl,f,function(){e.fadeIn("fast");c.fadeOut("fast",function(){b.removeAttr("disabled");g.css("visibility","hidden")})})},imgLoaded:function(d){var b=a("#image-preview-"+d),c=a("#imgedit-crop-"+d);this.initCrop(d,b,c);this.setCropSelection(d,0);this.toggleEditor(d,0)},initCrop:function(g,e,c){var b=this,d=a("#imgedit-sel-width-"+g),f=a("#imgedit-sel-height-"+g);b.iasapi=a(e).imgAreaSelect({parent:c,instance:true,handles:true,keys:true,minWidth:3,minHeight:3,onInit:function(h,i){c.children().mousedown(function(m){var k=false,l,j;if(m.shiftKey){l=b.iasapi.getSelection();j=b.getSelRatio(g);k=(l&&l.width&&l.height)?l.width+":"+l.height:j}b.iasapi.setOptions({aspectRatio:k})})},onSelectStart:function(h,i){imageEdit.setDisabled(a("#imgedit-crop-sel-"+g),1)},onSelectEnd:function(h,i){imageEdit.setCropSelection(g,i)},onSelectChange:function(h,j){var i=imageEdit.hold.sizer;d.val(imageEdit.round(j.width/i));f.val(imageEdit.round(j.height/i))}})},setCropSelection:function(g,f){var e,b=a("#imgedit-minthumb-"+g).val()||"128:128",d=this.hold.sizer;b=b.split(":");f=f||0;if(!f||(f.width<3&&f.height<3)){this.setDisabled(a(".imgedit-crop","#imgedit-panel-"+g),0);this.setDisabled(a("#imgedit-crop-sel-"+g),0);a("#imgedit-sel-width-"+g).val("");a("#imgedit-sel-height-"+g).val("");a("#imgedit-selection-"+g).val("");return false}if(f.width<(b[0]*d)&&f.height<(b[1]*d)){this.setDisabled(a(".imgedit-crop","#imgedit-panel-"+g),0);a("#imgedit-selection-"+g).val("");return false}e={x:f.x1,y:f.y1,w:f.width,h:f.height};this.setDisabled(a(".imgedit-crop","#imgedit-panel-"+g),1);a("#imgedit-selection-"+g).val(JSON.stringify(e))},close:function(c,b){b=b||false;if(b&&this.notsaved(c)){return false}this.iasapi={};this.hold={};a("#image-editor-"+c).fadeOut("fast",function(){a("#media-head-"+c).fadeIn("fast");a(this).empty()})},notsaved:function(e){var c=a("#imgedit-history-"+e).val(),d=(c!="")?JSON.parse(c):new Array(),b=this.intval(a("#imgedit-undone-"+e).val());if(b0){g.pop();b--}f.val(0);g.push(i);e.val(JSON.stringify(g));c.refreshEditor(h,d,function(){c.setDisabled(a("#image-undo-"+h),true);c.setDisabled(a("#image-redo-"+h),false)})},rotate:function(d,e,c,b){if(a(b).hasClass("disabled")){return false}this.addStep({r:{r:d,fw:this.hold.h,fh:this.hold.w}},e,c)},flip:function(d,e,c,b){if(a(b).hasClass("disabled")){return false}this.addStep({f:{f:d,fw:this.hold.w,fh:this.hold.h}},e,c)},crop:function(g,e,c){var f=a("#imgedit-selection-"+g).val(),b=this.intval(a("#imgedit-sel-width-"+g).val()),d=this.intval(a("#imgedit-sel-height-"+g).val());if(a(c).hasClass("disabled")||f==""){return false}f=JSON.parse(f);if(f.w>0&&f.h>0&&b>0&&d>0){f.fw=b;f.fh=d;this.addStep({c:f},g,e)}},undo:function(g,e){var d=this,c=a("#image-undo-"+g),f=a("#imgedit-undone-"+g),b=d.intval(f.val())+1;if(c.hasClass("disabled")){return}f.val(b);d.refreshEditor(g,e,function(){var h=a("#imgedit-history-"+g),i=(h.val()!="")?JSON.parse(h.val()):new Array();d.setDisabled(a("#image-redo-"+g),true);d.setDisabled(c,b0)})},setNumSelection:function(c){var g,k=a("#imgedit-sel-width-"+c),j=a("#imgedit-sel-height-"+c),o=this.intval(k.val()),m=this.intval(j.val()),i=a("#image-preview-"+c),p=i.height(),h=i.width(),b=this.hold.sizer,f,n,e,l,d=this.iasapi;if(o<1){k.val("");return false}if(m<1){j.val("");return false}if(o&&m&&(g=d.getSelection())){e=g.x1+Math.round(o*b);l=g.y1+Math.round(m*b);f=g.x1;n=g.y1;if(e>h){f=0;e=h;k.val(Math.round(e/b))}if(l>p){n=0;l=p;j.val(Math.round(l/b))}d.setSelection(f,n,e,l);d.update();this.setCropSelection(c,d.getSelection())}},round:function(b){var c;b=Math.round(b);if(this.hold.sizer>0.6){return b}c=b.toString().slice(-1);if("1"==c){return b-1}else{if("9"==c){return b+1}}return b},setRatioSelection:function(j,i,d){var f,e,b=this.intval(a("#imgedit-crop-width-"+j).val()),g=this.intval(a("#imgedit-crop-height-"+j).val()),c=a("#image-preview-"+j).height();if(!this.intval(a(d).val())){a(d).val("");return}if(b&&g){this.iasapi.setOptions({aspectRatio:b+":"+g});if(f=this.iasapi.getSelection(true)){e=Math.ceil(f.y1+((f.x2-f.x1)/(b/g)));if(e>c){e=c;if(i){a("#imgedit-crop-height-"+j).val("")}else{a("#imgedit-crop-width-"+j).val("")}}this.iasapi.setSelection(f.x1,f.y1,f.x2,e);this.iasapi.update()}}}}})(jQuery); \ No newline at end of file diff --git a/wp-admin/js/inline-edit-post.dev.js b/wp-admin/js/inline-edit-post.dev.js index 96b36fed5f..2fdf74f9c6 100644 --- a/wp-admin/js/inline-edit-post.dev.js +++ b/wp-admin/js/inline-edit-post.dev.js @@ -32,7 +32,7 @@ inlineEditPost = { return inlineEditPost.revert(); }); - $('#inline-edit .inline-edit-private input[value=private]').click( function(){ + $('#inline-edit .inline-edit-private input[value="private"]').click( function(){ var pw = $('input.inline-edit-password-input'); if ( $(this).attr('checked') ) { pw.val('').attr('disabled', 'disabled'); @@ -109,7 +109,7 @@ inlineEditPost = { $('#bulk-titles a').click(function(){ var id = $(this).attr('id').substr(1); - $('table.widefat input[value="'+id+'"]').attr('checked', ''); + $('table.widefat input[value="' + id + '"]').attr('checked', ''); $('#ttle'+id).remove(); }); @@ -142,7 +142,7 @@ inlineEditPost = { // populate the data rowData = $('#inline_'+id); - if ( !$(':input[name="post_author"] option[value=' + $('.post_author', rowData).text() + ']', editRow).val() ) { + if ( !$(':input[name="post_author"] option[value="' + $('.post_author', rowData).text() + '"]', editRow).val() ) { // author no longer has edit caps, so we need to add them to the list of authors $(':input[name="post_author"]', editRow).prepend(''); } @@ -151,7 +151,7 @@ inlineEditPost = { } for ( var f = 0; f < fields.length; f++ ) { - $(':input[name="'+fields[f]+'"]', editRow).val( $('.'+fields[f], rowData).text() ); + $(':input[name="' + fields[f] + '"]', editRow).val( $('.'+fields[f], rowData).text() ); } if ( $('.comment_status', rowData).text() == 'open' ) @@ -193,7 +193,7 @@ inlineEditPost = { } // remove the current page and children from the parent dropdown - pageOpt = $('select[name="post_parent"] option[value="'+id+'"]', editRow); + pageOpt = $('select[name="post_parent"] option[value="' + id + '"]', editRow); if ( pageOpt.length > 0 ) { pageLevel = pageOpt[0].className.split('-')[1]; nextPage = pageOpt; diff --git a/wp-admin/js/inline-edit-post.js b/wp-admin/js/inline-edit-post.js index e8a7750ca6..7c9782c25e 100644 --- a/wp-admin/js/inline-edit-post.js +++ b/wp-admin/js/inline-edit-post.js @@ -1 +1 @@ -(function(a){inlineEditPost={init:function(){var c=this,d=a("#inline-edit"),b=a("#bulk-edit");c.type=a("table.widefat").hasClass("pages")?"page":"post";c.what="#post-";d.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});b.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});a("a.cancel",d).click(function(){return inlineEditPost.revert()});a("a.save",d).click(function(){return inlineEditPost.save(this)});a("td",d).keydown(function(f){if(f.which==13){return inlineEditPost.save(this)}});a("a.cancel",b).click(function(){return inlineEditPost.revert()});a("#inline-edit .inline-edit-private input[value=private]").click(function(){var e=a("input.inline-edit-password-input");if(a(this).attr("checked")){e.val("").attr("disabled","disabled")}else{e.attr("disabled","")}});a("a.editinline").live("click",function(){inlineEditPost.edit(this);return false});a("#bulk-title-div").parents("fieldset").after(a("#inline-edit fieldset.inline-edit-categories").clone()).siblings("fieldset:last").prepend(a("#inline-edit label.inline-edit-tags").clone());a("span.catshow").click(function(){a(this).hide().next().show().parent().next().addClass("cat-hover")});a("span.cathide").click(function(){a(this).hide().prev().show().parent().next().removeClass("cat-hover")});a('select[name="_status"] option[value="future"]',b).remove();a("#doaction, #doaction2").click(function(f){var g=a(this).attr("id").substr(2);if(a('select[name="'+g+'"]').val()=="edit"){f.preventDefault();c.setBulk()}else{if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}}});a("#post-query-submit").click(function(f){if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}})},toggle:function(c){var b=this;a(b.what+b.getId(c)).css("display")=="none"?b.revert():b.edit(c)},setBulk:function(){var e="",d=this.type,b,f=true;this.revert();a("#bulk-edit td").attr("colspan",a(".widefat:first thead th:visible").length);a("table.widefat tbody").prepend(a("#bulk-edit"));a("#bulk-edit").addClass("inline-editor").show();a('tbody th.check-column input[type="checkbox"]').each(function(g){if(a(this).attr("checked")){f=false;var h=a(this).val(),c;c=a("#inline_"+h+" .post_title").text()||inlineEditL10n.notitle;e+='
X'+c+"
"}});if(f){return this.revert()}a("#bulk-titles").html(e);a("#bulk-titles a").click(function(){var c=a(this).attr("id").substr(1);a('table.widefat input[value="'+c+'"]').attr("checked","");a("#ttle"+c).remove()});if("post"==d){b="post_tag";a('tr.inline-editor textarea[name="tags_input"]').suggest("admin-ajax.php?action=ajax-tag-search&tax="+b,{delay:500,minchars:2,multiple:true,multipleSep:", "})}},edit:function(b){var o=this,j,d,g,n,i,h,m,l,c=true,p,e;o.revert();if(typeof(b)=="object"){b=o.getId(b)}j=["post_title","post_name","post_author","_status","jj","mm","aa","hh","mn","ss","post_password"];if(o.type=="page"){j.push("post_parent","menu_order","page_template")}d=a("#inline-edit").clone(true);a("td",d).attr("colspan",a(".widefat:first thead th:visible").length);if(a(o.what+b).hasClass("alternate")){a(d).addClass("alternate")}a(o.what+b).hide().after(d);g=a("#inline_"+b);if(!a(':input[name="post_author"] option[value='+a(".post_author",g).text()+"]",d).val()){a(':input[name="post_author"]',d).prepend('")}if(a(':input[name="post_author"] option',d).length==1){a("label.inline-edit-author",d).hide()}for(var k=0;k0){m=h[0].className.split("-")[1];l=h;while(c){l=l.next("option");if(l.length==0){break}p=l[0].className.split("-")[1];if(p<=m){c=false}else{l.remove();l=h}}h.remove()}a(d).attr("id","edit-"+b).addClass("inline-editor").show();a(".ptitle",d).focus();return false},save:function(e){var d,b,c=a(".post_status_page").val()||"";if(typeof(e)=="object"){e=this.getId(e)}a("table.widefat .inline-edit-save .waiting").show();d={action:"inline-save",post_type:typenow,post_ID:e,edit_date:"true",post_status:c};b=a("#edit-"+e+" :input").serialize();d=b+"&"+a.param(d);a.post("admin-ajax.php",d,function(f){a("table.widefat .inline-edit-save .waiting").hide();if(f){if(-1!=f.indexOf("]*?>/g,"");a("#edit-"+e+" .inline-edit-save").append(''+f+"")}}else{a("#edit-"+e+" .inline-edit-save").append(''+inlineEditL10n.error+"")}},"html");return false},revert:function(){var b=a("table.widefat tr.inline-editor").attr("id");if(b){a("table.widefat .inline-edit-save .waiting").hide();if("bulk-edit"==b){a("table.widefat #bulk-edit").removeClass("inline-editor").hide();a("#bulk-titles").html("");a("#inlineedit").append(a("#bulk-edit"))}else{a("#"+b).remove();b=b.substr(b.lastIndexOf("-")+1);a(this.what+b).show()}}return false},getId:function(c){var d=a(c).closest("tr").attr("id"),b=d.split("-");return b[b.length-1]}};a(document).ready(function(){inlineEditPost.init()})})(jQuery); \ No newline at end of file +(function(a){inlineEditPost={init:function(){var c=this,d=a("#inline-edit"),b=a("#bulk-edit");c.type=a("table.widefat").hasClass("pages")?"page":"post";c.what="#post-";d.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});b.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});a("a.cancel",d).click(function(){return inlineEditPost.revert()});a("a.save",d).click(function(){return inlineEditPost.save(this)});a("td",d).keydown(function(f){if(f.which==13){return inlineEditPost.save(this)}});a("a.cancel",b).click(function(){return inlineEditPost.revert()});a('#inline-edit .inline-edit-private input[value="private"]').click(function(){var e=a("input.inline-edit-password-input");if(a(this).attr("checked")){e.val("").attr("disabled","disabled")}else{e.attr("disabled","")}});a("a.editinline").live("click",function(){inlineEditPost.edit(this);return false});a("#bulk-title-div").parents("fieldset").after(a("#inline-edit fieldset.inline-edit-categories").clone()).siblings("fieldset:last").prepend(a("#inline-edit label.inline-edit-tags").clone());a("span.catshow").click(function(){a(this).hide().next().show().parent().next().addClass("cat-hover")});a("span.cathide").click(function(){a(this).hide().prev().show().parent().next().removeClass("cat-hover")});a('select[name="_status"] option[value="future"]',b).remove();a("#doaction, #doaction2").click(function(f){var g=a(this).attr("id").substr(2);if(a('select[name="'+g+'"]').val()=="edit"){f.preventDefault();c.setBulk()}else{if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}}});a("#post-query-submit").click(function(f){if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}})},toggle:function(c){var b=this;a(b.what+b.getId(c)).css("display")=="none"?b.revert():b.edit(c)},setBulk:function(){var e="",d=this.type,b,f=true;this.revert();a("#bulk-edit td").attr("colspan",a(".widefat:first thead th:visible").length);a("table.widefat tbody").prepend(a("#bulk-edit"));a("#bulk-edit").addClass("inline-editor").show();a('tbody th.check-column input[type="checkbox"]').each(function(g){if(a(this).attr("checked")){f=false;var h=a(this).val(),c;c=a("#inline_"+h+" .post_title").text()||inlineEditL10n.notitle;e+='
X'+c+"
"}});if(f){return this.revert()}a("#bulk-titles").html(e);a("#bulk-titles a").click(function(){var c=a(this).attr("id").substr(1);a('table.widefat input[value="'+c+'"]').attr("checked","");a("#ttle"+c).remove()});if("post"==d){b="post_tag";a('tr.inline-editor textarea[name="tags_input"]').suggest("admin-ajax.php?action=ajax-tag-search&tax="+b,{delay:500,minchars:2,multiple:true,multipleSep:", "})}},edit:function(b){var o=this,j,d,g,n,i,h,m,l,c=true,p,e;o.revert();if(typeof(b)=="object"){b=o.getId(b)}j=["post_title","post_name","post_author","_status","jj","mm","aa","hh","mn","ss","post_password"];if(o.type=="page"){j.push("post_parent","menu_order","page_template")}d=a("#inline-edit").clone(true);a("td",d).attr("colspan",a(".widefat:first thead th:visible").length);if(a(o.what+b).hasClass("alternate")){a(d).addClass("alternate")}a(o.what+b).hide().after(d);g=a("#inline_"+b);if(!a(':input[name="post_author"] option[value="'+a(".post_author",g).text()+'"]',d).val()){a(':input[name="post_author"]',d).prepend('")}if(a(':input[name="post_author"] option',d).length==1){a("label.inline-edit-author",d).hide()}for(var k=0;k0){m=h[0].className.split("-")[1];l=h;while(c){l=l.next("option");if(l.length==0){break}p=l[0].className.split("-")[1];if(p<=m){c=false}else{l.remove();l=h}}h.remove()}a(d).attr("id","edit-"+b).addClass("inline-editor").show();a(".ptitle",d).focus();return false},save:function(e){var d,b,c=a(".post_status_page").val()||"";if(typeof(e)=="object"){e=this.getId(e)}a("table.widefat .inline-edit-save .waiting").show();d={action:"inline-save",post_type:typenow,post_ID:e,edit_date:"true",post_status:c};b=a("#edit-"+e+" :input").serialize();d=b+"&"+a.param(d);a.post("admin-ajax.php",d,function(f){a("table.widefat .inline-edit-save .waiting").hide();if(f){if(-1!=f.indexOf("]*?>/g,"");a("#edit-"+e+" .inline-edit-save").append(''+f+"")}}else{a("#edit-"+e+" .inline-edit-save").append(''+inlineEditL10n.error+"")}},"html");return false},revert:function(){var b=a("table.widefat tr.inline-editor").attr("id");if(b){a("table.widefat .inline-edit-save .waiting").hide();if("bulk-edit"==b){a("table.widefat #bulk-edit").removeClass("inline-editor").hide();a("#bulk-titles").html("");a("#inlineedit").append(a("#bulk-edit"))}else{a("#"+b).remove();b=b.substr(b.lastIndexOf("-")+1);a(this.what+b).show()}}return false},getId:function(c){var d=a(c).closest("tr").attr("id"),b=d.split("-");return b[b.length-1]}};a(document).ready(function(){inlineEditPost.init()})})(jQuery); \ No newline at end of file diff --git a/wp-admin/js/nav-menu.dev.js b/wp-admin/js/nav-menu.dev.js index d58d6b2735..acfe93dd5e 100644 --- a/wp-admin/js/nav-menu.dev.js +++ b/wp-admin/js/nav-menu.dev.js @@ -461,7 +461,7 @@ var wpNavMenu; var loc = $('#nav-menu-theme-locations'), params = {}; params['action'] = 'menu-locations-save'; params['menu-settings-column-nonce'] = $('#menu-settings-column-nonce').val(); - loc.find('input[type=submit]').click(function() { + loc.find('input[type="submit"]').click(function() { loc.find('select').each(function() { params[this.name] = $(this).val(); }); diff --git a/wp-admin/js/nav-menu.js b/wp-admin/js/nav-menu.js index 09248e1fa7..f5eac411e8 100644 --- a/wp-admin/js/nav-menu.js +++ b/wp-admin/js/nav-menu.js @@ -1 +1 @@ -var wpNavMenu;(function(b){var a=wpNavMenu={options:{menuItemDepthPerLevel:30,globalMaxDepth:11},menuList:undefined,targetList:undefined,menusChanged:false,isRTL:!!("undefined"!=typeof isRtl&&isRtl),negateIfRTL:("undefined"!=typeof isRtl&&isRtl)?-1:1,init:function(){a.menuList=b("#menu-to-edit");a.targetList=a.menuList;this.jQueryExtensions();this.attachMenuEditListeners();this.setupInputWithDefaultTitle();this.attachQuickSearchListeners();this.attachThemeLocationsListeners();this.attachTabsPanelListeners();this.attachUnsavedChangesListener();if(a.menuList.length){this.initSortables()}this.initToggles();this.initTabManager()},jQueryExtensions:function(){b.fn.extend({menuItemDepth:function(){var c=a.isRTL?this.eq(0).css("margin-right"):this.eq(0).css("margin-left");return a.pxToDepth(c&&-1!=c.indexOf("px")?c.slice(0,-2):0)},updateDepthClass:function(d,c){return this.each(function(){var e=b(this);c=c||e.menuItemDepth();b(this).removeClass("menu-item-depth-"+c).addClass("menu-item-depth-"+d)})},shiftDepthClass:function(c){return this.each(function(){var d=b(this),e=d.menuItemDepth();b(this).removeClass("menu-item-depth-"+e).addClass("menu-item-depth-"+(e+c))})},childMenuItems:function(){var c=b();this.each(function(){var d=b(this),f=d.menuItemDepth(),e=d.next();while(e.length&&e.menuItemDepth()>f){c=c.add(e);e=e.next()}});return c},updateParentMenuItemDBId:function(){return this.each(function(){var e=b(this),c=e.find(".menu-item-data-parent-id"),f=e.menuItemDepth(),d=e.prev();if(f==0){c.val(0)}else{while(!d[0]||!d[0].className||-1==d[0].className.indexOf("menu-item")||(d.menuItemDepth()!=f-1)){d=d.prev()}c.val(d.find(".menu-item-data-db-id").val())}})},hideAdvancedMenuItemFields:function(){return this.each(function(){var c=b(this);b(".hide-column-tog").not(":checked").each(function(){c.find(".field-"+b(this).val()).addClass("hidden-field")})})},addSelectedToMenu:function(c){if(0==b("#menu-to-edit").length){return false}return this.each(function(){var e=b(this),d={},g=e.find(".tabs-panel-active .categorychecklist li input:checked"),f=new RegExp("menu-item\\[([^\\]]*)");c=c||a.addMenuItemToBottom;if(!g.length){return false}e.find("img.waiting").show();b(g).each(function(){var i=b(this),h=f.exec(i.attr("name")),j="undefined"==typeof h[1]?0:parseInt(h[1],10);if(this.className&&-1!=this.className.indexOf("add-to-top")){c=a.addMenuItemToTop}d[j]=i.closest("li").getItemData("add-menu-item",j)});a.addItemToMenu(d,c,function(){g.removeAttr("checked");e.find("img.waiting").hide()})})},getItemData:function(f,g){f=f||"menu-item";var d={},e,c=["menu-item-db-id","menu-item-object-id","menu-item-object","menu-item-parent-id","menu-item-position","menu-item-type","menu-item-title","menu-item-url","menu-item-description","menu-item-attr-title","menu-item-target","menu-item-classes","menu-item-xfn"];if(!g&&f=="menu-item"){g=this.find(".menu-item-data-db-id").val()}if(!g){return d}this.find("input").each(function(){var h;e=c.length;while(e--){if(f=="menu-item"){h=c[e]+"["+g+"]"}else{if(f=="add-menu-item"){h="menu-item["+g+"]["+c[e]+"]"}}if(this.name&&h==this.name){d[c[e]]=this.value}}});return d},setItemData:function(c,d,e){d=d||"menu-item";if(!e&&d=="menu-item"){e=b(".menu-item-data-db-id",this).val()}if(!e){return this}this.find("input").each(function(){var f=b(this),g;b.each(c,function(h,i){if(d=="menu-item"){g=h+"["+e+"]"}else{if(d=="add-menu-item"){g="menu-item["+e+"]["+h+"]"}}if(g==f.attr("name")){f.val(i)}})});return this}})},initToggles:function(){postboxes.add_postbox_toggles("nav-menus");columns.useCheckboxesForHidden();columns.checked=function(c){b(".field-"+c).removeClass("hidden-field")};columns.unchecked=function(c){b(".field-"+c).addClass("hidden-field")};a.menuList.hideAdvancedMenuItemFields()},initSortables:function(){var p=0,e,t,d,l,o,f,c,i,s,m=a.menuList.offset().left,h=b("body"),q,n=r();m+=a.isRTL?a.menuList.width():0;a.menuList.sortable({handle:".menu-item-handle",placeholder:"sortable-placeholder",start:function(A,z){var u,x,w,v,y;if(a.isRTL){z.item[0].style.right="auto"}s=z.item.children(".menu-item-transport");e=z.item.menuItemDepth();j(z,e);w=(z.item.next()[0]==z.placeholder[0])?z.item.next():z.item;v=w.childMenuItems();s.append(v);u=s.outerHeight();u+=(u>0)?(z.placeholder.css("margin-top").slice(0,-2)*1):0;u+=z.helper.outerHeight();i=u;u-=2;z.placeholder.height(u);q=e;v.each(function(){var B=b(this).menuItemDepth();q=(B>q)?B:q});x=z.helper.find(".menu-item-handle").outerWidth();x+=a.depthToPx(q-e);x-=2;z.placeholder.width(x);y=z.placeholder.next();y.css("margin-top",i+"px");z.placeholder.detach();b(this).sortable("refresh");z.item.after(z.placeholder);y.css("margin-top",0);k(z)},stop:function(x,w){var v,u=p-e;v=s.children().insertAfter(w.item);if(u!=0){w.item.updateDepthClass(p);v.shiftDepthClass(u);g(u)}a.registerChange();w.item.updateParentMenuItemDBId();w.item[0].style.top=0;if(a.isRTL){w.item[0].style.left="auto";w.item[0].style.right=0}a.refreshMenuTabs(true)},change:function(v,u){if(!u.placeholder.parent().hasClass("menu")){(l.length)?l.after(u.placeholder):a.menuList.prepend(u.placeholder)}k(u)},sort:function(w,v){var y=v.helper.offset(),u=a.isRTL?y.left+v.helper.width():y.left,x=a.negateIfRTL*a.pxToDepth(u-m);if(x>d||y.topc){o.after(v.placeholder);k(v);b(this).sortable("refreshPositions")}}});function k(u){var v;l=u.placeholder.prev();o=u.placeholder.next();if(l[0]==u.item[0]){l=l.prev()}if(o[0]==u.item[0]){o=o.next()}f=(l.length)?l.offset().top+l.height():0;c=(o.length)?o.offset().top+o.height()/3:0;t=(o.length)?o.menuItemDepth():0;if(l.length){d=((v=l.menuItemDepth()+1)>a.options.globalMaxDepth)?a.options.globalMaxDepth:v}else{d=0}}function j(u,v){u.placeholder.updateDepthClass(v,p);p=v}function r(){if(!h[0].className){return 0}var u=h[0].className.match(/menu-max-depth-(\d+)/);return u&&u[1]?parseInt(u[1]):0}function g(u){var v,w=n;if(u===0){return}else{if(u>0){v=q+u;if(v>n){w=v}}else{if(u<0&&q==n){while(!b(".menu-item-depth-"+w,a.menuList).length&&w>0){w--}}}}h.removeClass("menu-max-depth-"+n).addClass("menu-max-depth-"+w);n=w}},attachMenuEditListeners:function(){var c=this;b("#update-nav-menu").bind("click",function(d){if(d.target&&d.target.className){if(-1!=d.target.className.indexOf("item-edit")){return c.eventOnClickEditLink(d.target)}else{if(-1!=d.target.className.indexOf("menu-save")){return c.eventOnClickMenuSave(d.target)}else{if(-1!=d.target.className.indexOf("menu-delete")){return c.eventOnClickMenuDelete(d.target)}else{if(-1!=d.target.className.indexOf("item-delete")){return c.eventOnClickMenuItemDelete(d.target)}else{if(-1!=d.target.className.indexOf("item-cancel")){return c.eventOnClickCancelLink(d.target)}}}}}}})},setupInputWithDefaultTitle:function(){var c="input-with-default-title";b("."+c).each(function(){var f=b(this),e=f.attr("title"),d=f.val();f.data(c,e);if(""==d){f.val(e)}else{if(e==d){return}else{f.removeClass(c)}}}).focus(function(){var d=b(this);if(d.val()==d.data(c)){d.val("").removeClass(c)}}).blur(function(){var d=b(this);if(""==d.val()){d.addClass(c).val(d.data(c))}})},attachThemeLocationsListeners:function(){var d=b("#nav-menu-theme-locations"),c={};c.action="menu-locations-save";c["menu-settings-column-nonce"]=b("#menu-settings-column-nonce").val();d.find("input[type=submit]").click(function(){d.find("select").each(function(){c[this.name]=b(this).val()});d.find(".waiting").show();b.post(ajaxurl,c,function(e){d.find(".waiting").hide()});return false})},attachQuickSearchListeners:function(){var c;b(".quick-search").keypress(function(f){var d=b(this);if(13==f.which){a.updateQuickSearchResults(d);return false}if(c){clearTimeout(c)}c=setTimeout(function(){a.updateQuickSearchResults(d)},400)}).attr("autocomplete","off")},updateQuickSearchResults:function(d){var c,g,e=2,f=d.val();if(f.length0?0:s;r[c]=s+"px";j.animate(r,100,"linear")}if(t>e){l.add(d).hide()}else{l.add(d).show()}};b.fn.extend({makeTabVisible:function(){var u=this.eq(0),v,s,r={},q=0;if(!u.length){return this}v=u.offset().left;s=v+u.outerWidth();if(s>o){q=o-s}else{if(v=f)?true:false}});m.each(function(){e+=b(this).outerWidth(true)});i.padding=0;i[p]=(-1*e)+"px";j.css(i);l=b('');d=b('');h.wrap('