diff --git a/wp-includes/js/media-models.min.js b/wp-includes/js/media-models.min.js index 4ce1e7ea2c..05321c3b0b 100644 --- a/wp-includes/js/media-models.min.js +++ b/wp-includes/js/media-models.min.js @@ -1 +1 @@ -window.wp=window.wp||{};(function(f){var d,c,a,e,b,g;g=wp.media=function(h){var i=g.view.MediaFrame,j;if(!i){return}h=_.defaults(h||{},{frame:"select"});if("select"===h.frame&&i.Select){j=new i.Select(h)}else{if("post"===h.frame&&i.Post){j=new i.Post(h)}}delete h.frame;return j};_.extend(g,{model:{},view:{},controller:{}});b=g.model.l10n=typeof _wpMediaModelsL10n==="undefined"?{}:_wpMediaModelsL10n;g.model.settings=b.settings||{};delete b.settings;e=function(i,h,j,k){if(_.isEqual(i,h)){return j===k?0:(j>k?-1:1)}else{return i>h?-1:1}};_.extend(g,{template:_.memoize(function(j){var i,h={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(k){i=i||_.template(f("#tmpl-"+j).html(),null,h);return i(k)}}),post:function(i,h){return g.ajax({data:_.isObject(i)?i:_.extend(h||{},{action:i})})},ajax:function(i,h){if(_.isObject(i)){h=i}else{h=h||{};h.data=_.extend(h.data||{},{action:i})}h=_.defaults(h||{},{type:"POST",url:g.model.settings.ajaxurl,context:this});return f.Deferred(function(j){if(h.success){j.done(h.success)}if(h.error){j.fail(h.error)}delete h.success;delete h.error;f.ajax(h).done(function(k){if(_.isObject(k)&&!_.isUndefined(k.success)){j[k.success?"resolveWith":"rejectWith"](this,[k.data])}else{j.rejectWith(this,[k])}}).fail(function(){j.rejectWith(this,arguments)})}).promise()},fit:function(l){var i=l.width,h=l.height,k=l.maxWidth,j=l.maxHeight,m;if(!_.isUndefined(k)&&!_.isUndefined(j)){m=(i/h>k/j)?"width":"height"}else{if(_.isUndefined(j)){m="width"}else{if(_.isUndefined(k)&&h>j){m="height"}}}if("width"===m&&i>k){return{width:k,height:Math.round(k*h/i)}}else{if("height"===m&&h>j){return{width:Math.round(j*i/h),height:j}}else{return{width:i,height:h}}}},truncate:function(h,j,i){j=j||30;i=i||"…";if(h.length<=j){return h}return h.substr(0,j/2)+i+h.substr(-1*j/2)}});d=g.model.Attachment=Backbone.Model.extend({sync:function(j,i,h){if(_.isUndefined(this.id)){return f.Deferred().rejectWith(this).promise()}if("read"===j){h=h||{};h.context=this;h.data=_.extend(h.data||{},{action:"get-attachment",id:this.id});return g.ajax(h)}else{if("update"===j){if(!this.get("nonces")||!this.get("nonces").update){return f.Deferred().rejectWith(this).promise()}h=h||{};h.context=this;h.data=_.extend(h.data||{},{action:"save-attachment",id:this.id,nonce:this.get("nonces").update,post_id:g.model.settings.post.id});if(h.changes){_.each(h.changes,function(l,k){h.changes[k]=this.get(k)},this);h.data.changes=h.changes;delete h.changes}return g.ajax(h)}else{if("delete"===j){h=h||{};h.context=this;h.data=_.extend(h.data||{},{action:"delete-post",id:this.id,_wpnonce:this.get("nonces")["delete"]});return g.ajax(h)}}}},parse:function(i,h){if(!i){return i}i.date=new Date(i.date);i.modified=new Date(i.modified);return i},saveCompat:function(j,i){var h=this;if(!this.get("nonces")||!this.get("nonces").update){return f.Deferred().rejectWith(this).promise()}return g.post("save-attachment-compat",_.defaults({id:this.id,nonce:this.get("nonces").update,post_id:g.model.settings.post.id},j)).done(function(m,k,l){h.set(h.parse(m,l),i)})}},{create:function(h){return c.all.push(h)},get:_.memoize(function(i,h){return c.all.push(h||{id:i})})});c=g.model.Attachments=Backbone.Collection.extend({model:d,initialize:function(i,h){h=h||{};this.props=new Backbone.Model();this.filters=h.filters||{};this.props.on("change",this._changeFilteredProps,this);this.props.on("change:order",this._changeOrder,this);this.props.on("change:orderby",this._changeOrderby,this);this.props.on("change:query",this._changeQuery,this);this.props.set(_.defaults(h.props||{}));if(h.observe){this.observe(h.observe)}},_changeOrder:function(i,h){if(this.comparator){this.sort()}},_changeOrderby:function(h,i){if(this.comparator&&this.comparator!==c.comparator){return}if(i&&"post__in"!==i){this.comparator=c.comparator}else{delete this.comparator}},_changeQuery:function(h,i){if(i){this.props.on("change",this._requery,this);this._requery()}else{this.props.off("change",this._requery,this)}},_changeFilteredProps:function(i,h){if(this.props.get("query")){return}var j=_.chain(h.changes).map(function(l,n){var m=c.filters[n],k=i.get(n);if(!m){return}if(k&&!this.filters[n]){this.filters[n]=m}else{if(!k&&this.filters[n]===m){delete this.filters[n]}else{return}}return true},this).any().value();if(!j){return}if(!this._source){this._source=new c(this.models)}this.reset(this._source.filter(this.validator,this))},validator:function(h){return _.all(this.filters,function(j,i){return !!j.call(this,h)},this)},validate:function(k,i){var j=this.validator(k),h=!!this.getByCid(k.cid);if(!j&&h){this.remove(k,i)}else{if(j&&!h){this.add(k,i)}}return this},validateAll:function(h,i){i=i||{};_.each(h.models,function(j){this.validate(j,{silent:true})},this);if(!i.silent){this.trigger("reset",this,i)}return this},observe:function(h){this.observers=this.observers||[];this.observers.push(h);h.on("add change remove",this._validateHandler,this);h.on("reset",this._validateAllHandler,this);this.validateAll(h);return this},unobserve:function(h){if(h){h.off(null,null,this);this.observers=_.without(this.observers,h)}else{_.each(this.observers,function(i){i.off(null,null,this)},this);delete this.observers}return this},_validateHandler:function(j,h,i){i=h===this.mirroring?i:{silent:i&&i.silent};return this.validate(j,i)},_validateAllHandler:function(h,i){return this.validateAll(h,i)},mirror:function(h){if(this.mirroring&&this.mirroring===h){return this}this.unmirror();this.mirroring=h;this.reset([],{silent:true});this.observe(h);return this},unmirror:function(){if(!this.mirroring){return}this.unobserve(this.mirroring);delete this.mirroring},more:function(j){var i=f.Deferred(),k=this.mirroring,h=this;if(!k||!k.more){return i.resolveWith(this).promise()}k.more(j).done(function(){if(this===h.mirroring){i.resolveWith(this)}});return i.promise()},hasMore:function(){return this.mirroring?this.mirroring.hasMore():false},parse:function(i,h){return _.map(i,function(j){var k=d.get(j.id);return k.set(k.parse(j,h))})},_requery:function(){if(this.props.get("query")){this.mirror(a.get(this.props.toJSON()))}},saveMenuOrder:function(){if("menuOrder"!==this.props.get("orderby")){return}var h=this.chain().filter(function(i){return !_.isUndefined(i.id)}).map(function(j,i){i=i+1;j.set("menuOrder",i);return[j.id,i]}).object().value();if(_.isEmpty(h)){return}return g.post("save-attachment-order",{nonce:g.model.settings.post.nonce,post_id:g.model.settings.post.id,attachments:h})}},{comparator:function(j,i,k){var l=this.props.get("orderby"),h=this.props.get("order")||"DESC",m=j.cid,n=i.cid;j=j.get(l);i=i.get(l);if("date"===l||"modified"===l){j=j||new Date();i=i||new Date()}if(k&&k.ties){m=n=null}return("DESC"===h)?e(j,i,m,n):e(i,j,n,m)},filters:{search:function(h){if(!this.props.get("search")){return true}return _.any(["title","filename","description","caption","name"],function(i){var j=h.get(i);return j&&-1!==j.search(this.props.get("search"))},this)},type:function(i){var h=this.props.get("type");return !h||-1!==h.indexOf(i.get("type"))},uploadedTo:function(i){var h=this.props.get("uploadedTo");if(_.isUndefined(h)){return true}return h===i.get("uploadedTo")}}});c.all=new c();g.query=function(h){return new c(null,{props:_.extend(_.defaults(h||{},{orderby:"date"}),{query:true})})};a=g.model.Query=c.extend({initialize:function(j,h){var i;h=h||{};c.prototype.initialize.apply(this,arguments);this.args=h.args;this._hasMore=true;this.created=new Date();this.filters.order=function(m){var l=this.props.get("orderby"),k=this.props.get("order");if(!this.comparator){return true}if(this.length){return 1!==this.comparator(m,this.last(),{ties:true})}else{if("DESC"===k&&("date"===l||"modified"===l)){return m.get(l)>=this.created}else{if("ASC"===k&&"menuOrder"===l){return m.get(l)===0}}}return false};i=["s","order","orderby","posts_per_page","post_mime_type","post_parent"];if(wp.Uploader&&_(this.args).chain().keys().difference(i).isEmpty().value()){this.observe(wp.Uploader.queue)}},hasMore:function(){return this._hasMore},more:function(h){var i=this;if(this._more&&"pending"===this._more.state()){return this._more}if(!this.hasMore()){return f.Deferred().resolveWith(this).promise()}h=h||{};h.add=true;return this._more=this.fetch(h).done(function(j){if(_.isEmpty(j)||-1===this.args.posts_per_page||j.lengthk?-1:1)}else{return i>h?-1:1}};_.extend(g,{template:_.memoize(function(j){var i,h={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(k){i=i||_.template(f("#tmpl-"+j).html(),null,h);return i(k)}}),post:function(i,h){return g.ajax({data:_.isObject(i)?i:_.extend(h||{},{action:i})})},ajax:function(i,h){if(_.isObject(i)){h=i}else{h=h||{};h.data=_.extend(h.data||{},{action:i})}h=_.defaults(h||{},{type:"POST",url:g.model.settings.ajaxurl,context:this});return f.Deferred(function(j){if(h.success){j.done(h.success)}if(h.error){j.fail(h.error)}delete h.success;delete h.error;f.ajax(h).done(function(k){if(_.isObject(k)&&!_.isUndefined(k.success)){j[k.success?"resolveWith":"rejectWith"](this,[k.data])}else{j.rejectWith(this,[k])}}).fail(function(){j.rejectWith(this,arguments)})}).promise()},fit:function(l){var i=l.width,h=l.height,k=l.maxWidth,j=l.maxHeight,m;if(!_.isUndefined(k)&&!_.isUndefined(j)){m=(i/h>k/j)?"width":"height"}else{if(_.isUndefined(j)){m="width"}else{if(_.isUndefined(k)&&h>j){m="height"}}}if("width"===m&&i>k){return{width:k,height:Math.round(k*h/i)}}else{if("height"===m&&h>j){return{width:Math.round(j*i/h),height:j}}else{return{width:i,height:h}}}},truncate:function(h,j,i){j=j||30;i=i||"…";if(h.length<=j){return h}return h.substr(0,j/2)+i+h.substr(-1*j/2)}});d=g.model.Attachment=Backbone.Model.extend({sync:function(j,i,h){if(_.isUndefined(this.id)){return f.Deferred().rejectWith(this).promise()}if("read"===j){h=h||{};h.context=this;h.data=_.extend(h.data||{},{action:"get-attachment",id:this.id});return g.ajax(h)}else{if("update"===j){if(!this.get("nonces")||!this.get("nonces").update){return f.Deferred().rejectWith(this).promise()}h=h||{};h.context=this;h.data=_.extend(h.data||{},{action:"save-attachment",id:this.id,nonce:this.get("nonces").update,post_id:g.model.settings.post.id});if(h.changes){_.each(h.changes,function(l,k){h.changes[k]=this.get(k)},this);h.data.changes=h.changes;delete h.changes}return g.ajax(h)}else{if("delete"===j){h=h||{};h.context=this;h.data=_.extend(h.data||{},{action:"delete-post",id:this.id,_wpnonce:this.get("nonces")["delete"]});return g.ajax(h)}}}},parse:function(i,h){if(!i){return i}i.date=new Date(i.date);i.modified=new Date(i.modified);return i},saveCompat:function(j,i){var h=this;if(!this.get("nonces")||!this.get("nonces").update){return f.Deferred().rejectWith(this).promise()}return g.post("save-attachment-compat",_.defaults({id:this.id,nonce:this.get("nonces").update,post_id:g.model.settings.post.id},j)).done(function(m,k,l){h.set(h.parse(m,l),i)})}},{create:function(h){return c.all.push(h)},get:_.memoize(function(i,h){return c.all.push(h||{id:i})})});c=g.model.Attachments=Backbone.Collection.extend({model:d,initialize:function(i,h){h=h||{};this.props=new Backbone.Model();this.filters=h.filters||{};this.props.on("change",this._changeFilteredProps,this);this.props.on("change:order",this._changeOrder,this);this.props.on("change:orderby",this._changeOrderby,this);this.props.on("change:query",this._changeQuery,this);this.props.set(_.defaults(h.props||{}));if(h.observe){this.observe(h.observe)}},_changeOrder:function(i,h){if(this.comparator){this.sort()}},_changeOrderby:function(h,i){if(this.comparator&&this.comparator!==c.comparator){return}if(i&&"post__in"!==i){this.comparator=c.comparator}else{delete this.comparator}},_changeQuery:function(h,i){if(i){this.props.on("change",this._requery,this);this._requery()}else{this.props.off("change",this._requery,this)}},_changeFilteredProps:function(i,h){if(this.props.get("query")){return}var j=_.chain(h.changes).map(function(l,n){var m=c.filters[n],k=i.get(n);if(!m){return}if(k&&!this.filters[n]){this.filters[n]=m}else{if(!k&&this.filters[n]===m){delete this.filters[n]}else{return}}return true},this).any().value();if(!j){return}if(!this._source){this._source=new c(this.models)}this.reset(this._source.filter(this.validator,this))},validator:function(h){return _.all(this.filters,function(j,i){return !!j.call(this,h)},this)},validate:function(k,i){var j=this.validator(k),h=!!this.getByCid(k.cid);if(!j&&h){this.remove(k,i)}else{if(j&&!h){this.add(k,i)}}return this},validateAll:function(h,i){i=i||{};_.each(h.models,function(j){this.validate(j,{silent:true})},this);if(!i.silent){this.trigger("reset",this,i)}return this},observe:function(h){this.observers=this.observers||[];this.observers.push(h);h.on("add change remove",this._validateHandler,this);h.on("reset",this._validateAllHandler,this);this.validateAll(h);return this},unobserve:function(h){if(h){h.off(null,null,this);this.observers=_.without(this.observers,h)}else{_.each(this.observers,function(i){i.off(null,null,this)},this);delete this.observers}return this},_validateHandler:function(j,h,i){i=h===this.mirroring?i:{silent:i&&i.silent};return this.validate(j,i)},_validateAllHandler:function(h,i){return this.validateAll(h,i)},mirror:function(h){if(this.mirroring&&this.mirroring===h){return this}this.unmirror();this.mirroring=h;this.reset([],{silent:true});this.observe(h);return this},unmirror:function(){if(!this.mirroring){return}this.unobserve(this.mirroring);delete this.mirroring},more:function(j){var i=f.Deferred(),k=this.mirroring,h=this;if(!k||!k.more){return i.resolveWith(this).promise()}k.more(j).done(function(){if(this===h.mirroring){i.resolveWith(this)}});return i.promise()},hasMore:function(){return this.mirroring?this.mirroring.hasMore():false},parse:function(i,h){return _.map(i,function(j){var k=d.get(j.id);return k.set(k.parse(j,h))})},_requery:function(){if(this.props.get("query")){this.mirror(a.get(this.props.toJSON()))}},saveMenuOrder:function(){if("menuOrder"!==this.props.get("orderby")){return}var h=this.chain().filter(function(i){return !_.isUndefined(i.id)}).map(function(j,i){i=i+1;j.set("menuOrder",i);return[j.id,i]}).object().value();if(_.isEmpty(h)){return}return g.post("save-attachment-order",{nonce:g.model.settings.post.nonce,post_id:g.model.settings.post.id,attachments:h})}},{comparator:function(j,i,k){var l=this.props.get("orderby"),h=this.props.get("order")||"DESC",m=j.cid,n=i.cid;j=j.get(l);i=i.get(l);if("date"===l||"modified"===l){j=j||new Date();i=i||new Date()}if(k&&k.ties){m=n=null}return("DESC"===h)?e(j,i,m,n):e(i,j,n,m)},filters:{search:function(h){if(!this.props.get("search")){return true}return _.any(["title","filename","description","caption","name"],function(i){var j=h.get(i);return j&&-1!==j.search(this.props.get("search"))},this)},type:function(i){var h=this.props.get("type");return !h||-1!==h.indexOf(i.get("type"))},uploadedTo:function(i){var h=this.props.get("uploadedTo");if(_.isUndefined(h)){return true}return h===i.get("uploadedTo")}}});c.all=new c();g.query=function(h){return new c(null,{props:_.extend(_.defaults(h||{},{orderby:"date"}),{query:true})})};a=g.model.Query=c.extend({initialize:function(j,h){var i;h=h||{};c.prototype.initialize.apply(this,arguments);this.args=h.args;this._hasMore=true;this.created=new Date();this.filters.order=function(m){var l=this.props.get("orderby"),k=this.props.get("order");if(!this.comparator){return true}if(this.length){return 1!==this.comparator(m,this.last(),{ties:true})}else{if("DESC"===k&&("date"===l||"modified"===l)){return m.get(l)>=this.created}else{if("ASC"===k&&"menuOrder"===l){return m.get(l)===0}}}return false};i=["s","order","orderby","posts_per_page","post_mime_type","post_parent"];if(wp.Uploader&&_(this.args).chain().keys().difference(i).isEmpty().value()){this.observe(wp.Uploader.queue)}},hasMore:function(){return this._hasMore},more:function(h){var i=this;if(this._more&&"pending"===this._more.state()){return this._more}if(!this.hasMore()){return f.Deferred().resolveWith(this).promise()}h=h||{};h.add=true;return this._more=this.fetch(h).done(function(j){if(_.isEmpty(j)||-1===this.args.posts_per_page||j.length';b='';if(getUserSetting("hidetb","0")=="1"){f.settings.wordpress_adv_hidden=0}f.onPostRender.add(function(){var k=f.controlManager.get(e);if(f.getParam("wordpress_adv_hidden",1)&&k){a.hide(k.id);j._resizeIframe(f,e,28)}});f.addCommand("WP_More",function(){f.execCommand("mceInsertContent",0,d)});f.addCommand("WP_Page",function(){f.execCommand("mceInsertContent",0,b)});f.addCommand("WP_Help",function(){f.windowManager.open({url:tinymce.baseURL+"/wp-mce-help.php",width:450,height:420,inline:1})});f.addCommand("WP_Adv",function(){var k=f.controlManager,l=k.get(e).id;if("undefined"==l){return}if(a.isHidden(l)){k.setActive("wp_adv",1);a.show(l);j._resizeIframe(f,e,-28);f.settings.wordpress_adv_hidden=0;setUserSetting("hidetb","1")}else{k.setActive("wp_adv",0);a.hide(l);j._resizeIframe(f,e,28);f.settings.wordpress_adv_hidden=1;setUserSetting("hidetb","0")}});f.addCommand("WP_Medialib",function(){if(typeof wp!=="undefined"&&wp.media&&wp.media.editor){wp.media.editor.open(f.id)}});f.addButton("wp_more",{title:"wordpress.wp_more_desc",cmd:"WP_More"});f.addButton("wp_page",{title:"wordpress.wp_page_desc",image:c+"/img/page.gif",cmd:"WP_Page"});f.addButton("wp_help",{title:"wordpress.wp_help_desc",cmd:"WP_Help"});f.addButton("wp_adv",{title:"wordpress.wp_adv_desc",cmd:"WP_Adv"});f.addButton("add_media",{title:"wordpress.add_media",image:c+"/img/image.gif",cmd:"WP_Medialib"});f.onBeforeExecCommand.add(function(r,q,u,p,l){var x=tinymce.DOM,m,k,t,w,v,s;if("mceFullScreen"==q){if("mce_fullscreen"!=r.id&&x.select("a.thickbox").length){r.settings.theme_advanced_buttons1+=",|,add_media"}}if("JustifyLeft"==q||"JustifyRight"==q||"JustifyCenter"==q){m=r.selection.getNode();if(m.nodeName=="IMG"){s=q.substr(7).toLowerCase();v="align"+s;k=r.dom.getParent(m,"dl.wp-caption");t=r.dom.getParent(m,"div.mceTemp");if(k&&t){w=r.dom.hasClass(k,v)?"alignnone":v;k.className=k.className.replace(/align[^ '"]+\s?/g,"");r.dom.addClass(k,w);if(w=="aligncenter"){r.dom.addClass(t,"mceIEcenter")}else{r.dom.removeClass(t,"mceIEcenter")}l.terminate=true;r.execCommand("mceRepaint")}else{if(r.dom.hasClass(m,v)){r.dom.addClass(m,"alignnone")}else{r.dom.removeClass(m,"alignnone")}}}}});f.onPreInit.add(function(k){var l="id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",m=l+"|abbr|axis|headers|scope|rowspan|colspan|char|charoff|align|valign|halign|nowrap|bgcolor|width|height";k.schema.addValidElements("table["+l+"|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor]");k.schema.addValidElements("tr["+l+"|align|char|charoff|valign|halign|bgcolor]");k.schema.addValidElements("td["+m+"],th["+m+"]");k.schema.addValidElements("a["+l+"|href|target|ping|rel|media|type|name]")});f.onInit.add(function(m){var l=m.getParam("body_class",""),k=m.getBody();if(l){l=l.split(" ")}else{l=[]}if(m.getParam("directionality","")=="rtl"){l.push("rtl")}if(tinymce.isIE9){l.push("ie9")}else{if(tinymce.isIE8){l.push("ie8")}else{if(tinymce.isIE7){l.push("ie7")}}}if(m.id!="wp_mce_fullscreen"&&m.id!="mce_fullscreen"){l.push("wp-editor")}else{if(m.id=="mce_fullscreen"){l.push("mce-fullscreen")}}tinymce.each(l,function(n){if(n){m.dom.addClass(k,n)}});m.onNodeChange.add(function(o,n,q){var p;if(q.nodeName=="IMG"){p=o.dom.getParent(q,"dl.wp-caption")}else{if(q.nodeName=="DIV"&&o.dom.hasClass(q,"mceTemp")){p=q.firstChild;if(!o.dom.hasClass(p,"wp-caption")){p=false}}}if(p){if(o.dom.hasClass(p,"alignleft")){n.setActive("justifyleft",1)}else{if(o.dom.hasClass(p,"alignright")){n.setActive("justifyright",1)}else{if(o.dom.hasClass(p,"aligncenter")){n.setActive("justifycenter",1)}}}}});m.onBeforeSetContent.add(function(n,p){if(p.content){p.content=p.content.replace(/

\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)( [^>]*)?>/gi,"<$1$2>");p.content=p.content.replace(/<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)>\s*<\/p>/gi,"")}})});if("undefined"!=typeof(jQuery)){f.onKeyUp.add(function(m,n){var l=n.keyCode||n.charCode;if(l==i){return}if(13==l||8==i||46==i){jQuery(document).triggerHandler("wpcountwords",[m.getContent({format:"raw"})])}i=l})}f.onSaveContent.addToTop(function(k,l){l.content=l.content.replace(/

(
|\u00a0|\uFEFF)?<\/p>/g,"

 

")});f.onSaveContent.add(function(k,l){if(k.getParam("wpautop",true)&&typeof(switchEditors)=="object"){if(k.isHidden()){l.content=l.element.value}else{l.content=switchEditors.pre_wpautop(l.content)}}});j._handleMoreBreak(f,c);g="alt+shift";f.addShortcut(g+"+c","justifycenter_desc","JustifyCenter");f.addShortcut(g+"+r","justifyright_desc","JustifyRight");f.addShortcut(g+"+l","justifyleft_desc","JustifyLeft");f.addShortcut(g+"+j","justifyfull_desc","JustifyFull");f.addShortcut(g+"+q","blockquote_desc","mceBlockQuote");f.addShortcut(g+"+u","bullist_desc","InsertUnorderedList");f.addShortcut(g+"+o","numlist_desc","InsertOrderedList");f.addShortcut(g+"+n","spellchecker.desc","mceSpellCheck");f.addShortcut(g+"+a","link_desc","WP_Link");f.addShortcut(g+"+s","unlink_desc","unlink");f.addShortcut(g+"+m","image_desc","WP_Medialib");f.addShortcut(g+"+z","wordpress.wp_adv_desc","WP_Adv");f.addShortcut(g+"+t","wordpress.wp_more_desc","WP_More");f.addShortcut(g+"+d","striketrough_desc","Strikethrough");f.addShortcut(g+"+h","help_desc","WP_Help");f.addShortcut(g+"+p","wordpress.wp_page_desc","WP_Page");f.addShortcut("ctrl+s","save_desc",function(){if("function"==typeof autosave){autosave()}});if(/\bwpfullscreen\b/.test(f.settings.plugins)){f.addShortcut(g+"+w","wordpress.wp_fullscreen_desc","wpFullScreen")}else{if(/\bfullscreen\b/.test(f.settings.plugins)){f.addShortcut(g+"+g","fullscreen.desc","mceFullScreen")}}f.onInit.add(function(k){tinymce.dom.Event.add(k.getWin(),"scroll",function(l){k.plugins.wordpress._hideButtons()});tinymce.dom.Event.add(k.getBody(),"dragstart",function(l){k.plugins.wordpress._hideButtons()})});f.onBeforeExecCommand.add(function(k,m,l,n){k.plugins.wordpress._hideButtons()});f.onSaveContent.add(function(k,l){k.plugins.wordpress._hideButtons()});f.onMouseDown.add(function(k,l){if(l.target.nodeName!="IMG"){k.plugins.wordpress._hideButtons()}});h=function(k){var l;if(k.target.id=="mceModalBlocker"||k.target.className=="ui-widget-overlay"){for(l in f.windowManager.windows){f.windowManager.close(null,l)}}};tinymce.dom.Event.remove(document.body,"click",h);tinymce.dom.Event.add(document.body,"click",h)},getInfo:function(){return{longname:"WordPress Plugin",author:"WordPress",authorurl:"http://wordpress.org",infourl:"http://wordpress.org",version:"3.0"}},_setEmbed:function(b){return b.replace(/\[embed\]([\s\S]+?)\[\/embed\][\s\u00a0]*/g,function(d,c){return''+c+''})},_getEmbed:function(b){return b.replace(/]+>/g,function(c){if(c.indexOf('class="wp-oembed')!=-1){var d=c.match(/alt="([^\"]+)"/);if(d[1]){c="[embed]"+d[1]+"[/embed]"}}return c})},_showButtons:function(f,d){var g=tinyMCE.activeEditor,i,h,b,j=tinymce.DOM,e,c;b=g.dom.getViewPort(g.getWin());i=j.getPos(g.getContentAreaContainer());h=g.dom.getPos(f);e=Math.max(h.x-b.x,0)+i.x;c=Math.max(h.y-b.y,0)+i.y;j.setStyles(d,{top:c+5+"px",left:e+5+"px",display:"block"})},_hideButtons:function(){var b=tinymce.DOM;b.hide(b.select("#wp_editbtns, #wp_gallerybtns"))},_resizeIframe:function(c,e,b){var d=c.getContentAreaContainer().firstChild;a.setStyle(d,"height",d.clientHeight+b);c.theme.deltaHeight+=b},_handleMoreBreak:function(c,d){var e,b;e='$1';b='';c.onPostRender.add(function(){if(c.theme.onResolveName){c.theme.onResolveName.add(function(f,g){if(g.node.nodeName=="IMG"){if(c.dom.hasClass(g.node,"mceWPmore")){g.name="wpmore"}if(c.dom.hasClass(g.node,"mceWPnextpage")){g.name="wppage"}}})}});c.onBeforeSetContent.add(function(f,g){if(g.content){g.content=g.content.replace(//g,e);g.content=g.content.replace(//g,b)}});c.onPostProcess.add(function(f,g){if(g.get){g.content=g.content.replace(/]+>/g,function(i){if(i.indexOf('class="mceWPmore')!==-1){var h,j=(h=i.match(/alt="(.*?)"/))?h[1]:"";i=""}if(i.indexOf('class="mceWPnextpage')!==-1){i=""}return i})}});c.onNodeChange.add(function(g,f,h){f.setActive("wp_page",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPnextpage"));f.setActive("wp_more",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPmore"))})}});tinymce.PluginManager.add("wordpress",tinymce.plugins.WordPress)})(); \ No newline at end of file +(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.WordPress",{init:function(f,c){var j=this,e=f.getParam("wordpress_adv_toolbar","toolbar2"),i=0,d,b,h,g;d='';b='';if(getUserSetting("hidetb","0")=="1"){f.settings.wordpress_adv_hidden=0}f.onPostRender.add(function(){var k=f.controlManager.get(e);if(f.getParam("wordpress_adv_hidden",1)&&k){a.hide(k.id);j._resizeIframe(f,e,28)}});f.addCommand("WP_More",function(){f.execCommand("mceInsertContent",0,d)});f.addCommand("WP_Page",function(){f.execCommand("mceInsertContent",0,b)});f.addCommand("WP_Help",function(){f.windowManager.open({url:tinymce.baseURL+"/wp-mce-help.php",width:450,height:420,inline:1})});f.addCommand("WP_Adv",function(){var k=f.controlManager,l=k.get(e).id;if("undefined"==l){return}if(a.isHidden(l)){k.setActive("wp_adv",1);a.show(l);j._resizeIframe(f,e,-28);f.settings.wordpress_adv_hidden=0;setUserSetting("hidetb","1")}else{k.setActive("wp_adv",0);a.hide(l);j._resizeIframe(f,e,28);f.settings.wordpress_adv_hidden=1;setUserSetting("hidetb","0")}});f.addCommand("WP_Medialib",function(){if(typeof wp!=="undefined"&&wp.media&&wp.media.editor){wp.media.editor.open(f.id)}});f.addButton("wp_more",{title:"wordpress.wp_more_desc",cmd:"WP_More"});f.addButton("wp_page",{title:"wordpress.wp_page_desc",image:c+"/img/page.gif",cmd:"WP_Page"});f.addButton("wp_help",{title:"wordpress.wp_help_desc",cmd:"WP_Help"});f.addButton("wp_adv",{title:"wordpress.wp_adv_desc",cmd:"WP_Adv"});f.addButton("add_media",{title:"wordpress.add_media",image:c+"/img/image.gif",cmd:"WP_Medialib"});f.onBeforeExecCommand.add(function(r,q,u,p,l){var x=tinymce.DOM,m,k,t,w,v,s;if("mceFullScreen"==q){if("mce_fullscreen"!=r.id&&x.select("a.thickbox").length){r.settings.theme_advanced_buttons1+=",|,add_media"}}if("JustifyLeft"==q||"JustifyRight"==q||"JustifyCenter"==q){m=r.selection.getNode();if(m.nodeName=="IMG"){s=q.substr(7).toLowerCase();v="align"+s;k=r.dom.getParent(m,"dl.wp-caption");t=r.dom.getParent(m,"div.mceTemp");if(k&&t){w=r.dom.hasClass(k,v)?"alignnone":v;k.className=k.className.replace(/align[^ '"]+\s?/g,"");r.dom.addClass(k,w);if(w=="aligncenter"){r.dom.addClass(t,"mceIEcenter")}else{r.dom.removeClass(t,"mceIEcenter")}l.terminate=true;r.execCommand("mceRepaint")}else{if(r.dom.hasClass(m,v)){r.dom.addClass(m,"alignnone")}else{r.dom.removeClass(m,"alignnone")}}}}});f.onPreInit.add(function(k){var l="id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",m=l+"|abbr|axis|headers|scope|rowspan|colspan|char|charoff|align|valign|halign|nowrap|bgcolor|width|height";k.schema.addValidElements("table["+l+"|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor]");k.schema.addValidElements("tr["+l+"|align|char|charoff|valign|halign|bgcolor]");k.schema.addValidElements("td["+m+"],th["+m+"]");k.schema.addValidElements("a["+l+"|href|target|ping|rel|media|type|name]")});f.onInit.add(function(m){var l=m.getParam("body_class",""),k=m.getBody();if(l){l=l.split(" ")}else{l=[]}if(m.getParam("directionality","")=="rtl"){l.push("rtl")}if(tinymce.isIE9){l.push("ie9")}else{if(tinymce.isIE8){l.push("ie8")}else{if(tinymce.isIE7){l.push("ie7")}}}if(m.id!="wp_mce_fullscreen"&&m.id!="mce_fullscreen"){l.push("wp-editor")}else{if(m.id=="mce_fullscreen"){l.push("mce-fullscreen")}}tinymce.each(l,function(n){if(n){m.dom.addClass(k,n)}});m.onNodeChange.add(function(o,n,q){var p;if(q.nodeName=="IMG"){p=o.dom.getParent(q,"dl.wp-caption")}else{if(q.nodeName=="DIV"&&o.dom.hasClass(q,"mceTemp")){p=q.firstChild;if(!o.dom.hasClass(p,"wp-caption")){p=false}}}if(p){if(o.dom.hasClass(p,"alignleft")){n.setActive("justifyleft",1)}else{if(o.dom.hasClass(p,"alignright")){n.setActive("justifyright",1)}else{if(o.dom.hasClass(p,"aligncenter")){n.setActive("justifycenter",1)}}}}});m.onBeforeSetContent.add(function(n,p){if(p.content){p.content=p.content.replace(/

\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)( [^>]*)?>/gi,"<$1$2>");p.content=p.content.replace(/<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)>\s*<\/p>/gi,"")}})});if("undefined"!=typeof(jQuery)){f.onKeyUp.add(function(m,n){var l=n.keyCode||n.charCode;if(l==i){return}if(13==l||8==i||46==i){jQuery(document).triggerHandler("wpcountwords",[m.getContent({format:"raw"})])}i=l})}f.onSaveContent.addToTop(function(k,l){l.content=l.content.replace(/

(
|\u00a0|\uFEFF)?<\/p>/g,"

 

")});f.onSaveContent.add(function(k,l){if(k.getParam("wpautop",true)&&typeof(switchEditors)=="object"){if(k.isHidden()){l.content=l.element.value}else{l.content=switchEditors.pre_wpautop(l.content)}}});j._handleMoreBreak(f,c);g="alt+shift";f.addShortcut(g+"+c","justifycenter_desc","JustifyCenter");f.addShortcut(g+"+r","justifyright_desc","JustifyRight");f.addShortcut(g+"+l","justifyleft_desc","JustifyLeft");f.addShortcut(g+"+j","justifyfull_desc","JustifyFull");f.addShortcut(g+"+q","blockquote_desc","mceBlockQuote");f.addShortcut(g+"+u","bullist_desc","InsertUnorderedList");f.addShortcut(g+"+o","numlist_desc","InsertOrderedList");f.addShortcut(g+"+n","spellchecker.desc","mceSpellCheck");f.addShortcut(g+"+a","link_desc","WP_Link");f.addShortcut(g+"+s","unlink_desc","unlink");f.addShortcut(g+"+m","image_desc","WP_Medialib");f.addShortcut(g+"+z","wordpress.wp_adv_desc","WP_Adv");f.addShortcut(g+"+t","wordpress.wp_more_desc","WP_More");f.addShortcut(g+"+d","striketrough_desc","Strikethrough");f.addShortcut(g+"+h","help_desc","WP_Help");f.addShortcut(g+"+p","wordpress.wp_page_desc","WP_Page");f.addShortcut("ctrl+s","save_desc",function(){if("function"==typeof autosave){autosave()}});if(/\bwpfullscreen\b/.test(f.settings.plugins)){f.addShortcut(g+"+w","wordpress.wp_fullscreen_desc","wpFullScreen")}else{if(/\bfullscreen\b/.test(f.settings.plugins)){f.addShortcut(g+"+g","fullscreen.desc","mceFullScreen")}}f.onInit.add(function(k){tinymce.dom.Event.add(k.getWin(),"scroll",function(l){k.plugins.wordpress._hideButtons()});tinymce.dom.Event.add(k.getBody(),"dragstart",function(l){k.plugins.wordpress._hideButtons()})});f.onBeforeExecCommand.add(function(k,m,l,n){k.plugins.wordpress._hideButtons()});f.onSaveContent.add(function(k,l){k.plugins.wordpress._hideButtons()});f.onMouseDown.add(function(k,l){if(l.target.nodeName!="IMG"){k.plugins.wordpress._hideButtons()}});f.onKeyDown.add(function(k,l){if(l.which==tinymce.VK.DELETE||l.which==tinymce.VK.BACKSPACE){k.plugins.wordpress._hideButtons()}});h=function(k){var l;if(k.target.id=="mceModalBlocker"||k.target.className=="ui-widget-overlay"){for(l in f.windowManager.windows){f.windowManager.close(null,l)}}};tinymce.dom.Event.remove(document.body,"click",h);tinymce.dom.Event.add(document.body,"click",h)},getInfo:function(){return{longname:"WordPress Plugin",author:"WordPress",authorurl:"http://wordpress.org",infourl:"http://wordpress.org",version:"3.0"}},_setEmbed:function(b){return b.replace(/\[embed\]([\s\S]+?)\[\/embed\][\s\u00a0]*/g,function(d,c){return''+c+''})},_getEmbed:function(b){return b.replace(/]+>/g,function(c){if(c.indexOf('class="wp-oembed')!=-1){var d=c.match(/alt="([^\"]+)"/);if(d[1]){c="[embed]"+d[1]+"[/embed]"}}return c})},_showButtons:function(f,d){var g=tinyMCE.activeEditor,i,h,b,j=tinymce.DOM,e,c;b=g.dom.getViewPort(g.getWin());i=j.getPos(g.getContentAreaContainer());h=g.dom.getPos(f);e=Math.max(h.x-b.x,0)+i.x;c=Math.max(h.y-b.y,0)+i.y;j.setStyles(d,{top:c+5+"px",left:e+5+"px",display:"block"})},_hideButtons:function(){var b=tinymce.DOM;b.hide(b.select("#wp_editbtns, #wp_gallerybtns"))},_resizeIframe:function(c,e,b){var d=c.getContentAreaContainer().firstChild;a.setStyle(d,"height",d.clientHeight+b);c.theme.deltaHeight+=b},_handleMoreBreak:function(c,d){var e,b;e='$1';b='';c.onPostRender.add(function(){if(c.theme.onResolveName){c.theme.onResolveName.add(function(f,g){if(g.node.nodeName=="IMG"){if(c.dom.hasClass(g.node,"mceWPmore")){g.name="wpmore"}if(c.dom.hasClass(g.node,"mceWPnextpage")){g.name="wppage"}}})}});c.onBeforeSetContent.add(function(f,g){if(g.content){g.content=g.content.replace(//g,e);g.content=g.content.replace(//g,b)}});c.onPostProcess.add(function(f,g){if(g.get){g.content=g.content.replace(/]+>/g,function(i){if(i.indexOf('class="mceWPmore')!==-1){var h,j=(h=i.match(/alt="(.*?)"/))?h[1]:"";i=""}if(i.indexOf('class="mceWPnextpage')!==-1){i=""}return i})}});c.onNodeChange.add(function(g,f,h){f.setActive("wp_page",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPnextpage"));f.setActive("wp_more",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPmore"))})}});tinymce.PluginManager.add("wordpress",tinymce.plugins.WordPress)})(); \ No newline at end of file diff --git a/wp-includes/js/tinymce/wp-tinymce.js.gz b/wp-includes/js/tinymce/wp-tinymce.js.gz index c91bad4f68..575843a2e9 100644 Binary files a/wp-includes/js/tinymce/wp-tinymce.js.gz and b/wp-includes/js/tinymce/wp-tinymce.js.gz differ diff --git a/wp-includes/version.php b/wp-includes/version.php index 9112719ef7..37045d4333 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '3.5-RC3-23043'; +$wp_version = '3.5-RC3-23047'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. @@ -18,7 +18,7 @@ $wp_db_version = 22441; * * @global string $tinymce_version */ -$tinymce_version = '357-22953'; +$tinymce_version = '357-23047'; /** * Holds the required PHP version