WordPress/wp-includes/js/wp-lists.min.js
Aaron Jorbin 32be6f7bb7 Bump grunt-contrib-uglify from 1.0.1 to 2.0.0
Sets `screwIE8` to false as it is now enabled by default

Files Changed:
build/wp-admin/js/customize-nav-menus.min.js
build/wp-admin/js/customize-widgets.min.js
build/wp-includes/js/customize-loader.min.js

Changelog:
2016-07-19   v2.0.0   Update uglify-js to v2.7.0. screwIE8 is enabled by default.
2016-07-19   v1.0.2   Update grunt to ^1.0.0. Fix beautify when passed as an object. Fix docs about report values.

See #38199.


Built from https://develop.svn.wordpress.org/trunk@39117


git-svn-id: http://core.svn.wordpress.org/trunk@39059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 05:40:34 +00:00

1 line
7.2 KiB
JavaScript

!function(a){var b,c={add:"ajaxAdd",del:"ajaxDel",dim:"ajaxDim",process:"process",recolor:"recolor"};b={settings:{url:ajaxurl,type:"POST",response:"ajax-response",what:"",alt:"alternate",altOffset:0,addColor:"#ffff33",delColor:"#faafaa",dimAddColor:"#ffff33",dimDelColor:"#ff3333",confirm:null,addBefore:null,addAfter:null,delBefore:null,delAfter:null,dimBefore:null,dimAfter:null},nonce:function(b,c){var d=wpAjax.unserialize(b.attr("href")),e=a("#"+c.element);return c.nonce||d._ajax_nonce||e.find('input[name="_ajax_nonce"]').val()||d._wpnonce||e.find('input[name="_wpnonce"]').val()||0},parseData:function(b,c){var d,e=[];try{d=a(b).data("wp-lists")||"",d=d.match(new RegExp(c+":[\\S]+")),d&&(e=d[0].split(":"))}catch(f){}return e},pre:function(b,c,d){var e,f,g;return c=a.extend({},this.wpList.settings,{element:null,nonce:0,target:b.get(0)},c||{}),!(a.isFunction(c.confirm)&&(e=a("#"+c.element),"add"!==d&&(f=e.css("backgroundColor"),e.css("backgroundColor","#ff9966")),g=c.confirm.call(this,b,c,d,f),"add"!==d&&e.css("backgroundColor",f),!g))&&c},ajaxAdd:function(c,d){var e,f,g,h,i=this,j=a(c),k=b.parseData(j,"add");return d=d||{},d=b.pre.call(i,j,d,"add"),d.element=k[2]||j.prop("id")||d.element||null,d.addColor=k[3]?"#"+k[3]:d.addColor,!!d&&(j.is('[id="'+d.element+'-submit"]')?!d.element||(d.action="add-"+d.what,d.nonce=b.nonce(j,d),!!wpAjax.validateForm("#"+d.element)&&(d.data=a.param(a.extend({_ajax_nonce:d.nonce,action:d.action},wpAjax.unserialize(k[4]||""))),e=a("#"+d.element+" :input").not('[name="_ajax_nonce"], [name="_wpnonce"], [name="action"]'),f=a.isFunction(e.fieldSerialize)?e.fieldSerialize():e.serialize(),f&&(d.data+="&"+f),!(!a.isFunction(d.addBefore)||(d=d.addBefore(d)))||(!d.data.match(/_ajax_nonce=[a-f0-9]+/)||(d.success=function(c){return g=wpAjax.parseAjaxResponse(c,d.response,d.element),h=c,!(!g||g.errors)&&(!0===g||(a.each(g.responses,function(){b.add.call(i,this.data,a.extend({},d,{position:this.position||0,id:this.id||0,oldId:this.oldId||null}))}),i.wpList.recolor(),a(i).trigger("wpListAddEnd",[d,i.wpList]),void b.clear.call(i,"#"+d.element)))},d.complete=function(b,c){a.isFunction(d.addAfter)&&d.addAfter(h,a.extend({xml:b,status:c,parsed:g},d))},a.ajax(d),!1)))):!b.add.call(i,j,d))},ajaxDel:function(c,d){var e,f,g,h=this,i=a(c),j=b.parseData(i,"delete");return d=d||{},d=b.pre.call(h,i,d,"delete"),d.element=j[2]||d.element||null,d.delColor=j[3]?"#"+j[3]:d.delColor,!(!d||!d.element)&&(d.action="delete-"+d.what,d.nonce=b.nonce(i,d),d.data=a.extend({_ajax_nonce:d.nonce,action:d.action,id:d.element.split("-").pop()},wpAjax.unserialize(j[4]||"")),!(!a.isFunction(d.delBefore)||(d=d.delBefore(d,h)))||(!d.data._ajax_nonce||(e=a("#"+d.element),"none"!==d.delColor?e.css("backgroundColor",d.delColor).fadeOut(350,function(){h.wpList.recolor(),a(h).trigger("wpListDelEnd",[d,h.wpList])}):(h.wpList.recolor(),a(h).trigger("wpListDelEnd",[d,h.wpList])),d.success=function(b){if(f=wpAjax.parseAjaxResponse(b,d.response,d.element),g=b,!f||f.errors)return e.stop().stop().css("backgroundColor","#faa").show().queue(function(){h.wpList.recolor(),a(this).dequeue()}),!1},d.complete=function(b,c){a.isFunction(d.delAfter)&&e.queue(function(){d.delAfter(g,a.extend({xml:b,status:c,parsed:f},d))}).dequeue()},a.ajax(d),!1)))},ajaxDim:function(c,d){var e,f,g,h,i,j,k=this,l=a(c),m=b.parseData(l,"dim");return"none"!==l.parent().css("display")&&(d=d||{},d=b.pre.call(k,l,d,"dim"),d.element=m[2]||d.element||null,d.dimClass=m[3]||d.dimClass||null,d.dimAddColor=m[4]?"#"+m[4]:d.dimAddColor,d.dimDelColor=m[5]?"#"+m[5]:d.dimDelColor,!(d&&d.element&&d.dimClass)||(d.action="dim-"+d.what,d.nonce=b.nonce(l,d),d.data=a.extend({_ajax_nonce:d.nonce,action:d.action,id:d.element.split("-").pop(),dimClass:d.dimClass},wpAjax.unserialize(m[6]||"")),!(!a.isFunction(d.dimBefore)||(d=d.dimBefore(d)))||(e=a("#"+d.element),f=e.toggleClass(d.dimClass).is("."+d.dimClass),g=b.getColor(e),h=f?d.dimAddColor:d.dimDelColor,e.toggleClass(d.dimClass),"none"!==h?e.animate({backgroundColor:h},"fast").queue(function(){e.toggleClass(d.dimClass),a(this).dequeue()}).animate({backgroundColor:g},{complete:function(){a(this).css("backgroundColor",""),a(k).trigger("wpListDimEnd",[d,k.wpList])}}):a(k).trigger("wpListDimEnd",[d,k.wpList]),!d.data._ajax_nonce||(d.success=function(b){if(i=wpAjax.parseAjaxResponse(b,d.response,d.element),j=b,!0===i)return!0;if(!i||i.errors)return e.stop().stop().css("backgroundColor","#ff3333")[f?"removeClass":"addClass"](d.dimClass).show().queue(function(){k.wpList.recolor(),a(this).dequeue()}),!1;if("undefined"!=typeof i.responses[0].supplemental.comment_link){var c=l.find(".submitted-on"),g=c.find("a");""!==i.responses[0].supplemental.comment_link?c.html(a("<a></a>").text(c.text()).prop("href",i.responses[0].supplemental.comment_link)):g.length&&c.text(g.text())}},d.complete=function(b,c){a.isFunction(d.dimAfter)&&e.queue(function(){d.dimAfter(j,a.extend({xml:b,status:c,parsed:i},d))}).dequeue()},a.ajax(d),!1))))},getColor:function(b){return a(b).css("backgroundColor")||"#ffffff"},add:function(c,d){var e,f,g=a(this),h=a(c),i=!1;return"string"==typeof d&&(d={what:d}),d=a.extend({position:0,id:0,oldId:null},this.wpList.settings,d),!(!h.length||!d.what)&&(d.oldId&&(i=a("#"+d.what+"-"+d.oldId)),!d.id||d.id===d.oldId&&i&&i.length||a("#"+d.what+"-"+d.id).remove(),i&&i.length?(i.before(h),i.remove()):isNaN(d.position)?(e="after","-"===d.position.substr(0,1)&&(d.position=d.position.substr(1),e="before"),f=g.find("#"+d.position),1===f.length?f[e](h):g.append(h)):"comment"===d.what&&0!==a("#"+d.element).length||(d.position<0?g.prepend(h):g.append(h)),d.alt&&h.toggleClass(d.alt,(g.children(":visible").index(h[0])+d.altOffset)%2),"none"!==d.addColor&&h.css("backgroundColor",d.addColor).animate({backgroundColor:b.getColor(h)},{complete:function(){a(this).css("backgroundColor","")}}),g.each(function(a,b){b.wpList.process(h)}),h)},clear:function(b){var c,d,e=this,f=a(b);e.wpList&&f.parents("#"+e.id).length||f.find(":input").each(function(b,e){a(e).parents(".form-no-clear").length||(c=e.type.toLowerCase(),d=e.tagName.toLowerCase(),"text"===c||"password"===c||"textarea"===d?e.value="":"checkbox"===c||"radio"===c?e.checked=!1:"select"===d&&(e.selectedIndex=null))})},process:function(b){var c=this,d=a(b||document);d.on("submit",'form[data-wp-lists^="add:'+c.id+':"]',function(){return c.wpList.add(this)}),d.on("click",'a[data-wp-lists^="add:'+c.id+':"], input[data-wp-lists^="add:'+c.id+':"]',function(){return c.wpList.add(this)}),d.on("click",'[data-wp-lists^="delete:'+c.id+':"]',function(){return c.wpList.del(this)}),d.on("click",'[data-wp-lists^="dim:'+c.id+':"]',function(){return c.wpList.dim(this)})},recolor:function(){var b,c=this,d=[":even",":odd"];c.wpList.settings.alt&&(b=a(".list-item:visible",c),b.length||(b=a(c).children(":visible")),c.wpList.settings.altOffset%2&&d.reverse(),b.filter(d[0]).addClass(c.wpList.settings.alt).end(),b.filter(d[1]).removeClass(c.wpList.settings.alt))},init:function(){var a=this;a.wpList.process=function(b){a.each(function(){this.wpList.process(b)})},a.wpList.recolor=function(){a.each(function(){this.wpList.recolor()})}}},a.fn.wpList=function(d){return this.each(function(e,f){f.wpList={settings:a.extend({},b.settings,{what:b.parseData(f,"list")[1]||""},d)},a.each(c,function(a,c){f.wpList[a]=function(a,d){return b[c].call(f,a,d)}})}),b.init.call(this),this.wpList.process(),this}}(jQuery);