"+b.l10n.cheatin+"
")}});b.controlConstructor={color:b.ColorControl,upload:b.UploadControl,image:b.ImageControl};c(function(){b.settings=window._wpCustomizeSettings;b.l10n=window._wpCustomizeControlsL10n;if(!b.settings){return}if(!c.support.postMessage||(!c.support.cors&&b.settings.isCrossDomain)){return window.location=b.settings.url.fallback}var d=c(document.body),f=d.children(".wp-full-overlay"),h,i,g;c("#customize-controls").on("keydown",function(j){if(c(j.target).is("textarea")){return}if(13===j.which){j.preventDefault()}});i=new b.Previewer({container:"#customize-preview",form:"#customize-controls",previewUrl:b.settings.url.preview,allowedUrls:b.settings.url.allowed,signature:"WP_CUSTOMIZER_SIGNATURE"},{nonce:b.settings.nonce,query:function(){return{wp_customize:"on",theme:b.settings.theme.stylesheet,customized:JSON.stringify(b.get()),nonce:this.nonce.preview}},save:function(){var j=this,l=c.extend(this.query(),{action:"customize_save",nonce:this.nonce.save}),k=c.post(b.settings.url.ajax,l);b.trigger("save",k);d.addClass("saving");k.always(function(){d.removeClass("saving")});k.done(function(m){if("0"===m){j.preview.iframe.hide();j.login().done(function(){j.save();j.preview.iframe.show()});return}if("-1"===m){j.cheatin();return}b.trigger("saved")})}});i.bind("nonce",function(j){c.extend(this.nonce,j)});c.each(b.settings.settings,function(k,j){b.create(k,k,j.value,{transport:j.transport,previewer:i})});c.each(b.settings.controls,function(m,k){var j=b.controlConstructor[k.type]||b.Control,l;l=b.control.add(m,new j(m,{params:k,previewer:i}))});if(i.previewUrl()){i.refresh()}else{i.previewUrl(b.settings.url.home)}(function(){var l=new b.Values(),k=l.create("saved"),j=l.create("activated");l.bind("change",function(){var n=c("#save"),m=c(".back");if(!j()){n.val(b.l10n.activate).prop("disabled",false);m.text(b.l10n.cancel)}else{if(k()){n.val(b.l10n.saved).prop("disabled",true);m.text(b.l10n.close)}else{n.val(b.l10n.save).prop("disabled",false);m.text(b.l10n.cancel)}}});k(true);j(b.settings.theme.active);b.bind("change",function(){l("saved").set(false)});b.bind("saved",function(){l("saved").set(true);l("activated").set(true)});j.bind(function(m){if(m){b.trigger("activated")}});b.state=l}());c(".customize-section-title").bind("click keydown",function(k){if(k.type==="keydown"&&13!==k.which){return}var j=c(this).parents(".customize-section");if(j.hasClass("cannot-expand")){return}if("customize-section-title_tagline"===j.attr("id")){c(".wp-full-overlay-sidebar-content").scrollTop(0)}c(".customize-section").not(j).removeClass("open");j.toggleClass("open");k.preventDefault()});c("#save").click(function(j){i.save();j.preventDefault()}).keydown(function(j){if(9===j.which){return}if(13===j.which){i.save()}j.preventDefault()});c(".back").keydown(function(k){if(9===k.which){return}var j=c(this).attr("href");if(13===k.which){window.location=j}k.preventDefault()});c(".collapse-sidebar").on("click keydown",function(j){if(j.type==="keydown"&&13!==j.which){return}f.toggleClass("collapsed").toggleClass("expanded");j.preventDefault()});g=new b.Messenger({url:b.settings.url.parent,channel:"loader"});g.bind("back",function(){c(".back").on("click.back",function(j){j.preventDefault();g.send("close")})});b.bind("saved",function(){g.send("saved")});b.bind("activated",function(){if(g.targetWindow()){g.send("activated",b.settings.url.activated)}else{if(b.settings.url.activated){window.location=b.settings.url.activated}}});g.send("ready");c.each({background_image:{controls:["background_repeat","background_position_x","background_attachment"],callback:function(j){return !!j}},show_on_front:{controls:["page_on_front","page_for_posts"],callback:function(j){return"page"===j}},header_textcolor:{controls:["header_textcolor"],callback:function(j){return"blank"!==j}}},function(j,k){b(j,function(l){c.each(k.controls,function(m,n){b.control(n,function(p){var o=function(q){p.container.toggle(k.callback(q))};o(l.get());l.bind(o)})})})});b.control("display_header_text",function(k){var j="";k.elements[0].unsync(b("header_textcolor"));k.element=new b.Element(k.container.find("input"));k.element.set("blank"!==k.setting());k.element.bind(function(l){if(!l){j=b("header_textcolor").get()}k.setting.set(l?j:"blank")});k.setting.bind(function(l){k.element.set("blank"!==l)})});b.control("header_image",function(j){j.setting.bind(function(k){if(k===j.params.removed){j.settings.data.set(false)}});j.library.on("click","a",function(k){j.settings.data.set(c(this).data("customizeHeaderImageData"))});j.uploader.success=function(l){var k;b.ImageControl.prototype.success.call(j,l);k={attachment_id:l.get("id"),url:l.get("url"),thumbnail_url:l.get("url"),height:l.get("height"),width:l.get("width")};l.element.data("customizeHeaderImageData",k);j.settings.data.set(k)}});b.trigger("ready");var e=c(".back");e.focus();setTimeout(function(){e.focus()},200)})})(wp,jQuery); \ No newline at end of file +(function(a,c){var b=wp.customize;b.Setting=b.Value.extend({initialize:function(g,f,d){var e;b.Value.prototype.initialize.call(this,f,d);this.id=g;this.transport=this.transport||"refresh";this.bind(this.preview)},preview:function(){switch(this.transport){case"refresh":return this.previewer.refresh();case"postMessage":return this.previewer.send("setting",[this.id,this()])}}});b.Control=b.Class.extend({initialize:function(i,e){var g=this,d,h,f;this.params={};c.extend(this,e||{});this.id=i;this.selector="#customize-control-"+i.replace("]","").replace("[","-");this.container=c(this.selector);f=c.map(this.params.settings,function(j){return j});b.apply(b,f.concat(function(){var j;g.settings={};for(j in g.params.settings){g.settings[j]=b(g.params.settings[j])}g.setting=g.settings["default"]||null;g.ready()}));g.elements=[];d=this.container.find("[data-customize-setting-link]");h={};d.each(function(){var k=c(this),j;if(k.is(":radio")){j=k.prop("name");if(h[j]){return}h[j]=true;k=d.filter('[name="'+j+'"]')}b(k.data("customizeSettingLink"),function(m){var l=new b.Element(k);g.elements.push(l);l.sync(m);l.set(m())})})},ready:function(){},dropdownInit:function(){var f=this,e=this.container.find(".dropdown-status"),g=this.params,h=function(i){if(typeof i==="string"&&g.statuses&&g.statuses[i]){e.html(g.statuses[i]).show()}else{e.hide()}};var d=false;this.container.on("click keydown",".dropdown",function(i){if(i.type==="keydown"&&13!==i.which){return}i.preventDefault();if(!d){f.container.toggleClass("open")}if(f.container.hasClass("open")){f.container.parent().parent().find("li.library-selected").focus()}d=true;setTimeout(function(){d=false},400)});this.setting.bind(h);h(this.setting())}});b.ColorControl=b.Control.extend({ready:function(){var e=this,d=this.container.find(".color-picker-hex");d.val(e.setting()).wpColorPicker({change:function(g,f){e.setting.set(d.wpColorPicker("color"))},clear:function(){e.setting.set(false)}})}});b.UploadControl=b.Control.extend({ready:function(){var d=this;this.params.removed=this.params.removed||"";this.success=c.proxy(this.success,this);this.uploader=c.extend({container:this.container,browser:this.container.find(".upload"),dropzone:this.container.find(".upload-dropzone"),success:this.success,plupload:{},params:{}},this.uploader||{});if(d.params.extensions){d.uploader.plupload.filters=[{title:b.l10n.allowedFiles,extensions:d.params.extensions}]}if(d.params.context){d.uploader.params["post_data[context]"]=this.params.context}if(b.settings.theme.stylesheet){d.uploader.params["post_data[theme]"]=b.settings.theme.stylesheet}this.uploader=new wp.Uploader(this.uploader);this.remover=this.container.find(".remove");this.remover.on("click keydown",function(e){if(e.type==="keydown"&&13!==e.which){return}d.setting.set(d.params.removed);e.preventDefault()});this.removerVisibility=c.proxy(this.removerVisibility,this);this.setting.bind(this.removerVisibility);this.removerVisibility(this.setting.get())},success:function(d){this.setting.set(d.get("url"))},removerVisibility:function(d){this.remover.toggle(d!=this.params.removed)}});b.ImageControl=b.UploadControl.extend({ready:function(){var e=this,d;this.uploader={init:function(f){var h,g;if(this.supports.dragdrop){return}h=e.container.find(".upload-fallback");g=h.children().detach();this.browser.detach().empty().append(g);h.append(this.browser).show()}};b.UploadControl.prototype.ready.call(this);this.thumbnail=this.container.find(".preview-thumbnail img");this.thumbnailSrc=c.proxy(this.thumbnailSrc,this);this.setting.bind(this.thumbnailSrc);this.library=this.container.find(".library");this.tabs={};d=this.library.find(".library-content");this.library.children("ul").children("li").each(function(){var g=c(this),h=g.data("customizeTab"),f=d.filter('[data-customize-tab="'+h+'"]');e.tabs[h]={both:g.add(f),link:g,panel:f}});this.library.children("ul").on("click keydown","li",function(g){if(g.type==="keydown"&&13!==g.which){return}var h=c(this).data("customizeTab"),f=e.tabs[h];g.preventDefault();if(f.link.hasClass("library-selected")){return}e.selected.both.removeClass("library-selected");e.selected=f;e.selected.both.addClass("library-selected")});this.library.on("click keydown","a",function(f){if(f.type==="keydown"&&13!==f.which){return}var g=c(this).data("customizeImageValue");if(g){e.setting.set(g);f.preventDefault()}});if(this.tabs.uploaded){this.tabs.uploaded.target=this.library.find(".uploaded-target");if(!this.tabs.uploaded.panel.find(".thumbnail").length){this.tabs.uploaded.both.addClass("hidden")}}d.each(function(){var f=e.tabs[c(this).data("customizeTab")];if(!f.link.hasClass("hidden")){e.selected=f;f.both.addClass("library-selected");return false}});this.dropdownInit()},success:function(d){b.UploadControl.prototype.success.call(this,d);if(this.tabs.uploaded&&this.tabs.uploaded.target.length){this.tabs.uploaded.both.removeClass("hidden");d.element=c('').data("customizeImageValue",d.get("url")).append('').appendTo(this.tabs.uploaded.target)}},thumbnailSrc:function(d){if(/^(https?:)?\/\//.test(d)){this.thumbnail.prop("src",d).show()}else{this.thumbnail.hide()}}});b.defaultConstructor=b.Setting;b.control=new b.Values({defaultConstructor:b.Control});b.PreviewFrame=b.Messenger.extend({sensitivity:2000,initialize:function(g,f){var e=c.Deferred(),d=this;e.promise(this);this.container=g.container;this.signature=g.signature;c.extend(g,{channel:b.PreviewFrame.uuid()});b.Messenger.prototype.initialize.call(this,g,f);this.add("previewUrl",g.previewUrl);this.query=c.extend(g.query||{},{customize_messenger_channel:this.channel()});this.run(e)},run:function(e){var d=this,f=false,g=false;if(this._ready){this.unbind("ready",this._ready)}this._ready=function(){g=true;if(f){e.resolveWith(d)}};this.bind("ready",this._ready);this.request=c.ajax(this.previewUrl(),{type:"POST",data:this.query,xhrFields:{withCredentials:true}});this.request.fail(function(){e.rejectWith(d,["request failure"])});this.request.done(function(j){var i=d.request.getResponseHeader("Location"),h=d.signature,k;if(i&&i!=d.previewUrl()){e.rejectWith(d,["redirect",i]);return}if("0"===j){d.login(e);return}if("-1"===j){e.rejectWith(d,["cheatin"]);return}k=j.lastIndexOf(h);if(-1===k||k"+b.l10n.cheatin+"
")}});b.controlConstructor={color:b.ColorControl,upload:b.UploadControl,image:b.ImageControl};c(function(){b.settings=window._wpCustomizeSettings;b.l10n=window._wpCustomizeControlsL10n;if(!b.settings){return}if(!c.support.postMessage||(!c.support.cors&&b.settings.isCrossDomain)){return window.location=b.settings.url.fallback}var d=c(document.body),f=d.children(".wp-full-overlay"),h,i,g;c("#customize-controls").on("keydown",function(j){if(c(j.target).is("textarea")){return}if(13===j.which){j.preventDefault()}});i=new b.Previewer({container:"#customize-preview",form:"#customize-controls",previewUrl:b.settings.url.preview,allowedUrls:b.settings.url.allowed,signature:"WP_CUSTOMIZER_SIGNATURE"},{nonce:b.settings.nonce,query:function(){return{wp_customize:"on",theme:b.settings.theme.stylesheet,customized:JSON.stringify(b.get()),nonce:this.nonce.preview}},save:function(){var j=this,l=c.extend(this.query(),{action:"customize_save",nonce:this.nonce.save}),k=c.post(b.settings.url.ajax,l);b.trigger("save",k);d.addClass("saving");k.always(function(){d.removeClass("saving")});k.done(function(m){if("0"===m){j.preview.iframe.hide();j.login().done(function(){j.save();j.preview.iframe.show()});return}if("-1"===m){j.cheatin();return}b.trigger("saved")})}});i.bind("nonce",function(j){c.extend(this.nonce,j)});c.each(b.settings.settings,function(k,j){b.create(k,k,j.value,{transport:j.transport,previewer:i})});c.each(b.settings.controls,function(m,k){var j=b.controlConstructor[k.type]||b.Control,l;l=b.control.add(m,new j(m,{params:k,previewer:i}))});if(i.previewUrl()){i.refresh()}else{i.previewUrl(b.settings.url.home)}(function(){var l=new b.Values(),k=l.create("saved"),j=l.create("activated");l.bind("change",function(){var n=c("#save"),m=c(".back");if(!j()){n.val(b.l10n.activate).prop("disabled",false);m.text(b.l10n.cancel)}else{if(k()){n.val(b.l10n.saved).prop("disabled",true);m.text(b.l10n.close)}else{n.val(b.l10n.save).prop("disabled",false);m.text(b.l10n.cancel)}}});k(true);j(b.settings.theme.active);b.bind("change",function(){l("saved").set(false)});b.bind("saved",function(){l("saved").set(true);l("activated").set(true)});j.bind(function(m){if(m){b.trigger("activated")}});b.state=l}());c(".customize-section-title").bind("click keydown",function(k){if(k.type==="keydown"&&13!==k.which){return}var j=c(this).parents(".customize-section");if(j.hasClass("cannot-expand")){return}if("customize-section-title_tagline"===j.attr("id")){c(".wp-full-overlay-sidebar-content").scrollTop(0)}c(".customize-section").not(j).removeClass("open");j.toggleClass("open");k.preventDefault()});c("#save").click(function(j){i.save();j.preventDefault()}).keydown(function(j){if(9===j.which){return}if(13===j.which){i.save()}j.preventDefault()});c(".back").keydown(function(j){if(9===j.which){return}if(13===j.which){g.send("close")}j.preventDefault()});c(".collapse-sidebar").on("click keydown",function(j){if(j.type==="keydown"&&13!==j.which){return}f.toggleClass("collapsed").toggleClass("expanded");j.preventDefault()});g=new b.Messenger({url:b.settings.url.parent,channel:"loader"});g.bind("back",function(){c(".back").on("click.back",function(j){j.preventDefault();g.send("close")})});b.bind("saved",function(){g.send("saved")});b.bind("activated",function(){if(g.targetWindow()){g.send("activated",b.settings.url.activated)}else{if(b.settings.url.activated){window.location=b.settings.url.activated}}});g.send("ready");c.each({background_image:{controls:["background_repeat","background_position_x","background_attachment"],callback:function(j){return !!j}},show_on_front:{controls:["page_on_front","page_for_posts"],callback:function(j){return"page"===j}},header_textcolor:{controls:["header_textcolor"],callback:function(j){return"blank"!==j}}},function(j,k){b(j,function(l){c.each(k.controls,function(m,n){b.control(n,function(p){var o=function(q){p.container.toggle(k.callback(q))};o(l.get());l.bind(o)})})})});b.control("display_header_text",function(k){var j="";k.elements[0].unsync(b("header_textcolor"));k.element=new b.Element(k.container.find("input"));k.element.set("blank"!==k.setting());k.element.bind(function(l){if(!l){j=b("header_textcolor").get()}k.setting.set(l?j:"blank")});k.setting.bind(function(l){k.element.set("blank"!==l)})});b.control("header_image",function(j){j.setting.bind(function(k){if(k===j.params.removed){j.settings.data.set(false)}});j.library.on("click","a",function(k){j.settings.data.set(c(this).data("customizeHeaderImageData"))});j.uploader.success=function(l){var k;b.ImageControl.prototype.success.call(j,l);k={attachment_id:l.get("id"),url:l.get("url"),thumbnail_url:l.get("url"),height:l.get("height"),width:l.get("width")};l.element.data("customizeHeaderImageData",k);j.settings.data.set(k)}});b.trigger("ready");var e=c(".back");e.focus();setTimeout(function(){e.focus()},200)})})(wp,jQuery); \ No newline at end of file diff --git a/wp-admin/js/media-upload.min.js b/wp-admin/js/media-upload.min.js index 19c3fb8739..08860219a4 100644 --- a/wp-admin/js/media-upload.min.js +++ b/wp-admin/js/media-upload.min.js @@ -1 +1 @@ -var wpActiveEditor;function send_to_editor(c){var b,a=typeof(tinymce)!="undefined",f=typeof(QTags)!="undefined";if(!wpActiveEditor){if(a&&tinymce.activeEditor){b=tinymce.activeEditor;wpActiveEditor=b.id}else{if(!f){return false}}}else{if(a){if(tinymce.activeEditor&&(tinymce.activeEditor.id=="mce_fullscreen"||tinymce.activeEditor.id=="wp_mce_fullscreen")){b=tinymce.activeEditor}else{b=tinymce.get(wpActiveEditor)}}}if(b&&!b.isHidden()){if(tinymce.isIE&&b.windowManager.insertimagebookmark){b.selection.moveToBookmark(b.windowManager.insertimagebookmark)}if(c.indexOf("[caption")===0){if(b.wpSetImgCaption){c=b.wpSetImgCaption(c)}}else{if(c.indexOf("[gallery")===0){if(b.plugins.wpgallery){c=b.plugins.wpgallery._do_gallery(c)}}else{if(c.indexOf("[embed")===0){if(b.plugins.wordpress){c=b.plugins.wordpress._setEmbed(c)}}}}b.execCommand("mceInsertContent",false,c)}else{if(f){QTags.insertContent(c)}else{document.getElementById(wpActiveEditor).value+=c}}try{tb_remove()}catch(d){}}var tb_position;(function(a){tb_position=function(){var f=a("#TB_window"),e=a(window).width(),d=a(window).height(),c=(720(\d+)<\/pre>$/,"$1");if(a.match(/media-upload-error|error-div/)){b.html(a);return}else{jQuery(".percent",b).html(pluploadL10n.crunching)}prepareMediaItem(c,a);updateMediaForm();if(post_id&&b.hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(1*jQuery("#attachments-count").text()+1)}}function setResize(a){if(a){if(uploader.features.jpgresize){uploader.settings.resize={width:resize_width,height:resize_height,quality:100}}else{uploader.settings.multipart_params.image_resize=true}}else{delete (uploader.settings.resize);delete (uploader.settings.multipart_params.image_resize)}}function prepareMediaItem(c,a){var d=(typeof shortform=="undefined")?1:2,b=jQuery("#media-item-"+c.id);try{if(typeof topWin.tb_remove!="undefined"){topWin.jQuery("#TB_overlay").click(topWin.tb_remove)}}catch(g){}if(isNaN(a)||!a){b.append(a);prepareMediaItemInit(c)}else{b.load("async-upload.php",{attachment_id:a,fetch:d},function(){prepareMediaItemInit(c);updateMediaForm()})}}function prepareMediaItemInit(b){var a=jQuery("#media-item-"+b.id);jQuery(".thumbnail",a).clone().attr("class","pinkynail toggle").prependTo(a);jQuery(".filename.original",a).replaceWith(jQuery(".filename.new",a));jQuery("a.delete",a).click(function(){jQuery.ajax({url:ajaxurl,type:"post",success:deleteSuccess,error:deleteError,id:b.id,data:{id:this.id.replace(/[^0-9]/g,""),action:"trash-post",_ajax_nonce:this.href.replace(/^.*wpnonce=/,"")}});return false});jQuery("a.undo",a).click(function(){jQuery.ajax({url:ajaxurl,type:"post",id:b.id,data:{id:this.id.replace(/[^0-9]/g,""),action:"untrash-post",_ajax_nonce:this.href.replace(/^.*wpnonce=/,"")},success:function(d,e){var c=jQuery("#media-item-"+b.id);if(type=jQuery("#type-of-"+b.id).val()){jQuery("#"+type+"-counter").text(jQuery("#"+type+"-counter").text()-0+1)}if(post_id&&c.hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(jQuery("#attachments-count").text()-0+1)}jQuery(".filename .trashnotice",c).remove();jQuery(".filename .title",c).css("font-weight","normal");jQuery("a.undo",c).addClass("hidden");jQuery(".menu_order_input",c).show();c.css({backgroundColor:"#ceb"}).animate({backgroundColor:"#fff"},{queue:false,duration:500,complete:function(){jQuery(this).css({backgroundColor:""})}}).removeClass("undo")}});return false});jQuery("#media-item-"+b.id+".startopen").removeClass("startopen").addClass("open").find("slidetoggle").fadeIn()}function wpQueueError(a){jQuery("#media-upload-error").show().html('")}function wpFileError(b,a){itemAjaxError(b.id,a)}function itemAjaxError(e,c){var b=jQuery("#media-item-"+e),a=b.find(".filename").text(),d=b.data("last-err");if(d==e){return}b.html(''+a+"
'+pluploadL10n.dismiss+""+pluploadL10n.error_uploading.replace("%s",jQuery.trim(a))+" "+c+"").data("last-err",e)}function deleteSuccess(b,d){if(b=="-1"){return itemAjaxError(this.id,"You do not have permission. Has your session expired?")}if(b=="0"){return itemAjaxError(this.id,"Could not be deleted. Has it been deleted already?")}var c=this.id,a=jQuery("#media-item-"+c);if(type=jQuery("#type-of-"+c).val()){jQuery("#"+type+"-counter").text(jQuery("#"+type+"-counter").text()-1)}if(post_id&&a.hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(jQuery("#attachments-count").text()-1)}if(jQuery("form.type-form #media-items").children().length==1&&jQuery(".hidden","#media-items").length>0){jQuery(".toggle").toggle();jQuery(".slidetoggle").slideUp(200).siblings().removeClass("hidden")}jQuery(".toggle",a).toggle();jQuery(".slidetoggle",a).slideUp(200).siblings().removeClass("hidden");a.css({backgroundColor:"#faa"}).animate({backgroundColor:"#f4f4f4"},{queue:false,duration:500}).addClass("undo");jQuery(".filename:empty",a).remove();jQuery(".filename .title",a).css("font-weight","bold");jQuery(".filename",a).append(' '+pluploadL10n.deleted+" ").siblings("a.toggle").hide();jQuery(".filename",a).append(jQuery("a.undo",a).removeClass("hidden"));jQuery(".menu_order_input",a).hide();return}function deleteError(c,b,a){}function uploadComplete(){jQuery("#insert-gallery").prop("disabled",false)}function switchUploader(a){if(a){deleteUserSetting("uploader");jQuery(".media-upload-form").removeClass("html-uploader");if(typeof(uploader)=="object"){uploader.refresh()}}else{setUserSetting("uploader","1");jQuery(".media-upload-form").addClass("html-uploader")}}function dndHelper(a){var b=document.getElementById("dnd-helper");if(a){b.style.display="block"}else{b.style.display="none"}}function uploadError(d,f,c,e){var b=100*1024*1024,a;switch(f){case plupload.FAILED:wpFileError(d,pluploadL10n.upload_failed);break;case plupload.FILE_EXTENSION_ERROR:wpFileError(d,pluploadL10n.invalid_filetype);break;case plupload.FILE_SIZE_ERROR:uploadSizeError(e,d);break;case plupload.IMAGE_FORMAT_ERROR:wpFileError(d,pluploadL10n.not_an_image);break;case plupload.IMAGE_MEMORY_ERROR:wpFileError(d,pluploadL10n.image_memory_exceeded);break;case plupload.IMAGE_DIMENSIONS_ERROR:wpFileError(d,pluploadL10n.image_dimensions_exceeded);break;case plupload.GENERIC_ERROR:wpQueueError(pluploadL10n.upload_failed);break;case plupload.IO_ERROR:a=parseInt(e.settings.max_file_size,10);if(a>b&&d.size>b){wpFileError(d,pluploadL10n.big_upload_failed.replace("%1$s",'').replace("%2$s",""))}else{wpQueueError(pluploadL10n.io_error)}break;case plupload.HTTP_ERROR:wpQueueError(pluploadL10n.http_error);break;case plupload.INIT_ERROR:jQuery(".media-upload-form").addClass("html-uploader");break;case plupload.SECURITY_ERROR:wpQueueError(pluploadL10n.security_error);break;default:wpFileError(d,pluploadL10n.default_error)}}function uploadSizeError(a,b,d){var c;if(d){c=pluploadL10n.big_upload_queued.replace("%s",b.name)+" "+pluploadL10n.big_upload_failed.replace("%1$s",'').replace("%2$s","")}else{c=pluploadL10n.file_exceeds_size_limit.replace("%s",b.name)}jQuery("#media-items").append('");a.removeFile(b)}jQuery(document).ready(function(a){a(".media-upload-form").bind("click.uploader",function(f){var d=a(f.target),b,g;if(d.is('input[type="radio"]')){b=d.closest("tr");if(b.hasClass("align")){setUserSetting("align",d.val())}else{if(b.hasClass("image-size")){setUserSetting("imgsize",d.val())}}}else{if(d.is("button.button")){g=f.target.className||"";g=g.match(/url([^ '"]+)/);if(g&&g[1]){setUserSetting("urlbutton",g[1]);d.siblings(".urlfield").val(d.data("link-url"))}}else{if(d.is("a.dismiss")){d.parents(".media-item").fadeOut(200,function(){a(this).remove()})}else{if(d.is(".upload-flash-bypass a")||d.is("a.uploader-html")){a("#media-items, p.submit, span.big-file-warning").css("display","none");switchUploader(0);f.preventDefault()}else{if(d.is(".upload-html-bypass a")){a("#media-items, p.submit, span.big-file-warning").css("display","");switchUploader(1);f.preventDefault()}else{if(d.is("a.describe-toggle-on")){d.parent().addClass("open");d.siblings(".slidetoggle").fadeIn(250,function(){var i=a(window).scrollTop(),e=a(window).height(),k=a(this).offset().top,j=a(this).height(),c,l;if(e&&k&&j){c=k+j;l=i+e;if(c>l){if(c-l'+c+"
c&&f.size>c&&d.runtime!="html5"){uploadSizeError(d,f,true)}else{fileQueued(f)}});d.refresh();d.start()});uploader.bind("BeforeUpload",function(b,c){});uploader.bind("UploadFile",function(b,c){fileUploading(b,c)});uploader.bind("UploadProgress",function(b,c){uploadProgress(b,c)});uploader.bind("Error",function(b,c){uploadError(c.file,c.code,c.message,b);b.refresh()});uploader.bind("FileUploaded",function(b,d,c){uploadSuccess(d,c.response)});uploader.bind("UploadComplete",function(b,c){uploadComplete()})};if(typeof(wpUploaderInit)=="object"){uploader_init()}}); \ No newline at end of file +var topWin=window.dialogArguments||opener||parent||top,uploader,uploader_init;function fileDialogStart(){jQuery("#media-upload-error").empty()}function fileQueued(b){jQuery(".media-blank").remove();var a=jQuery("#media-items").children(),c=post_id||0;if(a.length==1){a.removeClass("open").find(".slidetoggle").slideUp(200)}jQuery("#media-items").append(' ");jQuery("#insert-gallery").prop("disabled",true)}function uploadStart(){try{if(typeof topWin.tb_remove!="undefined"){topWin.jQuery("#TB_overlay").unbind("click",topWin.tb_remove)}}catch(a){}return true}function uploadProgress(a,b){var c=jQuery("#media-item-"+b.id);jQuery(".bar",c).width((200*b.loaded)/b.size);jQuery(".percent",c).html(b.percent+"%")}function fileUploading(c,d){var b=100*1024*1024,a=parseInt(c.settings.max_file_size,10);if(a>b&&d.size>b){setTimeout(function(){var e;if(d.status<3&&d.loaded==0){wpFileError(d,pluploadL10n.big_upload_failed.replace("%1$s",'').replace("%2$s",""));c.stop();c.removeFile(d);c.start()}},10000)}}function updateMediaForm(){var a=jQuery("#media-items").children();if(a.length==1){a.addClass("open").find(".slidetoggle").show();jQuery(".insert-gallery").hide()}else{if(a.length>1){a.removeClass("open");jQuery(".insert-gallery").show()}}if(a.not(".media-blank").length>0){jQuery(".savebutton").show()}else{jQuery(".savebutton").hide()}}function uploadSuccess(c,a){var b=jQuery("#media-item-"+c.id);a=a.replace(/^0%'+b.name+"(\d+)<\/pre>$/,"$1");if(a.match(/media-upload-error|error-div/)){b.html(a);return}else{jQuery(".percent",b).html(pluploadL10n.crunching)}prepareMediaItem(c,a);updateMediaForm();if(post_id&&b.hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(1*jQuery("#attachments-count").text()+1)}}function setResize(a){if(a){if(uploader.features.jpgresize){uploader.settings.resize={width:resize_width,height:resize_height,quality:100}}else{uploader.settings.multipart_params.image_resize=true}}else{delete (uploader.settings.resize);delete (uploader.settings.multipart_params.image_resize)}}function prepareMediaItem(c,a){var d=(typeof shortform=="undefined")?1:2,b=jQuery("#media-item-"+c.id);if(d==2&&shortform>2){d=shortform}try{if(typeof topWin.tb_remove!="undefined"){topWin.jQuery("#TB_overlay").click(topWin.tb_remove)}}catch(g){}if(isNaN(a)||!a){b.append(a);prepareMediaItemInit(c)}else{b.load("async-upload.php",{attachment_id:a,fetch:d},function(){prepareMediaItemInit(c);updateMediaForm()})}}function prepareMediaItemInit(b){var a=jQuery("#media-item-"+b.id);jQuery(".thumbnail",a).clone().attr("class","pinkynail toggle").prependTo(a);jQuery(".filename.original",a).replaceWith(jQuery(".filename.new",a));jQuery("a.delete",a).click(function(){jQuery.ajax({url:ajaxurl,type:"post",success:deleteSuccess,error:deleteError,id:b.id,data:{id:this.id.replace(/[^0-9]/g,""),action:"trash-post",_ajax_nonce:this.href.replace(/^.*wpnonce=/,"")}});return false});jQuery("a.undo",a).click(function(){jQuery.ajax({url:ajaxurl,type:"post",id:b.id,data:{id:this.id.replace(/[^0-9]/g,""),action:"untrash-post",_ajax_nonce:this.href.replace(/^.*wpnonce=/,"")},success:function(d,e){var c=jQuery("#media-item-"+b.id);if(type=jQuery("#type-of-"+b.id).val()){jQuery("#"+type+"-counter").text(jQuery("#"+type+"-counter").text()-0+1)}if(post_id&&c.hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(jQuery("#attachments-count").text()-0+1)}jQuery(".filename .trashnotice",c).remove();jQuery(".filename .title",c).css("font-weight","normal");jQuery("a.undo",c).addClass("hidden");jQuery(".menu_order_input",c).show();c.css({backgroundColor:"#ceb"}).animate({backgroundColor:"#fff"},{queue:false,duration:500,complete:function(){jQuery(this).css({backgroundColor:""})}}).removeClass("undo")}});return false});jQuery("#media-item-"+b.id+".startopen").removeClass("startopen").addClass("open").find("slidetoggle").fadeIn()}function wpQueueError(a){jQuery("#media-upload-error").show().html('")}function wpFileError(b,a){itemAjaxError(b.id,a)}function itemAjaxError(e,c){var b=jQuery("#media-item-"+e),a=b.find(".filename").text(),d=b.data("last-err");if(d==e){return}b.html(''+a+"
'+pluploadL10n.dismiss+""+pluploadL10n.error_uploading.replace("%s",jQuery.trim(a))+" "+c+"").data("last-err",e)}function deleteSuccess(b,d){if(b=="-1"){return itemAjaxError(this.id,"You do not have permission. Has your session expired?")}if(b=="0"){return itemAjaxError(this.id,"Could not be deleted. Has it been deleted already?")}var c=this.id,a=jQuery("#media-item-"+c);if(type=jQuery("#type-of-"+c).val()){jQuery("#"+type+"-counter").text(jQuery("#"+type+"-counter").text()-1)}if(post_id&&a.hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(jQuery("#attachments-count").text()-1)}if(jQuery("form.type-form #media-items").children().length==1&&jQuery(".hidden","#media-items").length>0){jQuery(".toggle").toggle();jQuery(".slidetoggle").slideUp(200).siblings().removeClass("hidden")}jQuery(".toggle",a).toggle();jQuery(".slidetoggle",a).slideUp(200).siblings().removeClass("hidden");a.css({backgroundColor:"#faa"}).animate({backgroundColor:"#f4f4f4"},{queue:false,duration:500}).addClass("undo");jQuery(".filename:empty",a).remove();jQuery(".filename .title",a).css("font-weight","bold");jQuery(".filename",a).append(' '+pluploadL10n.deleted+" ").siblings("a.toggle").hide();jQuery(".filename",a).append(jQuery("a.undo",a).removeClass("hidden"));jQuery(".menu_order_input",a).hide();return}function deleteError(c,b,a){}function uploadComplete(){jQuery("#insert-gallery").prop("disabled",false)}function switchUploader(a){if(a){deleteUserSetting("uploader");jQuery(".media-upload-form").removeClass("html-uploader");if(typeof(uploader)=="object"){uploader.refresh()}}else{setUserSetting("uploader","1");jQuery(".media-upload-form").addClass("html-uploader")}}function dndHelper(a){var b=document.getElementById("dnd-helper");if(a){b.style.display="block"}else{b.style.display="none"}}function uploadError(d,f,c,e){var b=100*1024*1024,a;switch(f){case plupload.FAILED:wpFileError(d,pluploadL10n.upload_failed);break;case plupload.FILE_EXTENSION_ERROR:wpFileError(d,pluploadL10n.invalid_filetype);break;case plupload.FILE_SIZE_ERROR:uploadSizeError(e,d);break;case plupload.IMAGE_FORMAT_ERROR:wpFileError(d,pluploadL10n.not_an_image);break;case plupload.IMAGE_MEMORY_ERROR:wpFileError(d,pluploadL10n.image_memory_exceeded);break;case plupload.IMAGE_DIMENSIONS_ERROR:wpFileError(d,pluploadL10n.image_dimensions_exceeded);break;case plupload.GENERIC_ERROR:wpQueueError(pluploadL10n.upload_failed);break;case plupload.IO_ERROR:a=parseInt(e.settings.max_file_size,10);if(a>b&&d.size>b){wpFileError(d,pluploadL10n.big_upload_failed.replace("%1$s",'').replace("%2$s",""))}else{wpQueueError(pluploadL10n.io_error)}break;case plupload.HTTP_ERROR:wpQueueError(pluploadL10n.http_error);break;case plupload.INIT_ERROR:jQuery(".media-upload-form").addClass("html-uploader");break;case plupload.SECURITY_ERROR:wpQueueError(pluploadL10n.security_error);break;default:wpFileError(d,pluploadL10n.default_error)}}function uploadSizeError(a,b,d){var c;if(d){c=pluploadL10n.big_upload_queued.replace("%s",b.name)+" "+pluploadL10n.big_upload_failed.replace("%1$s",'').replace("%2$s","")}else{c=pluploadL10n.file_exceeds_size_limit.replace("%s",b.name)}jQuery("#media-items").append('");a.removeFile(b)}jQuery(document).ready(function(a){a(".media-upload-form").bind("click.uploader",function(f){var d=a(f.target),b,g;if(d.is('input[type="radio"]')){b=d.closest("tr");if(b.hasClass("align")){setUserSetting("align",d.val())}else{if(b.hasClass("image-size")){setUserSetting("imgsize",d.val())}}}else{if(d.is("button.button")){g=f.target.className||"";g=g.match(/url([^ '"]+)/);if(g&&g[1]){setUserSetting("urlbutton",g[1]);d.siblings(".urlfield").val(d.data("link-url"))}}else{if(d.is("a.dismiss")){d.parents(".media-item").fadeOut(200,function(){a(this).remove()})}else{if(d.is(".upload-flash-bypass a")||d.is("a.uploader-html")){a("#media-items, p.submit, span.big-file-warning").css("display","none");switchUploader(0);f.preventDefault()}else{if(d.is(".upload-html-bypass a")){a("#media-items, p.submit, span.big-file-warning").css("display","");switchUploader(1);f.preventDefault()}else{if(d.is("a.describe-toggle-on")){d.parent().addClass("open");d.siblings(".slidetoggle").fadeIn(250,function(){var i=a(window).scrollTop(),e=a(window).height(),k=a(this).offset().top,j=a(this).height(),c,l;if(e&&k&&j){c=k+j;l=i+e;if(c>l){if(c-l'+c+"
c&&f.size>c&&d.runtime!="html5"){uploadSizeError(d,f,true)}else{fileQueued(f)}});d.refresh();d.start()});uploader.bind("BeforeUpload",function(b,c){});uploader.bind("UploadFile",function(b,c){fileUploading(b,c)});uploader.bind("UploadProgress",function(b,c){uploadProgress(b,c)});uploader.bind("Error",function(b,c){uploadError(c.file,c.code,c.message,b);b.refresh()});uploader.bind("FileUploaded",function(b,d,c){uploadSuccess(d,c.response)});uploader.bind("UploadComplete",function(b,c){uploadComplete()})};if(typeof(wpUploaderInit)=="object"){uploader_init()}}); \ No newline at end of file diff --git a/wp-includes/version.php b/wp-includes/version.php index 1aa25138cb..0ff80d27b2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '3.5-beta3-22754'; +$wp_version = '3.5-beta3-22763'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.