diff --git a/wp-includes/js/mce-view.js b/wp-includes/js/mce-view.js index 1065d69daa..9217b30373 100644 --- a/wp-includes/js/mce-view.js +++ b/wp-includes/js/mce-view.js @@ -47,8 +47,6 @@ window.wp = window.wp || {}; ''; }, render: function() { - var html = this.getHtml() || this.loadingPlaceholder(); - this.setContent( '

\u00a0

' + '
' + @@ -57,84 +55,79 @@ window.wp = window.wp || {}; '
' + '
' + '
' + - html + + ( this.getHtml() || this.loadingPlaceholder() ) + '
' + ( this.overlay ? '
' : '' ) + '' + '

\u00a0

', - function( self, editor, node ) { - $( self ).trigger( 'ready', [ editor, node ] ); - }, 'wrap' ); + + $( this ).trigger( 'ready' ); }, unbind: function() {}, - getNodes: function( callback ) { - var nodes = []; + getEditors: function( callback ) { + var editors = []; _.each( tinymce.editors, function( editor ) { if ( editor.plugins.wpview ) { - $( editor.getBody() ) - .find( '[data-wpview-text="' + this.encodedText + '"]' ) - .each( function ( i, node ) { - if ( callback ) { - callback( editor, node ); - } + if ( callback ) { + callback( editor ); + } - nodes.push( node ); - } ); + editors.push( editor ); } }, this ); + return editors; + }, + getNodes: function( callback ) { + var nodes = [], + self = this; + + this.getEditors( function( editor ) { + $( editor.getBody() ) + .find( '[data-wpview-text="' + self.encodedText + '"]' ) + .each( function ( i, node ) { + if ( callback ) { + callback( editor, node, $( node ).find( '.wpview-content' ).get( 0 ) ); + } + + nodes.push( node ); + } ); + } ); + return nodes; }, - setContent: function( html, callback, option ) { - var self = this; + setContent: function( html, option ) { + this.getNodes( function ( editor, node, content ) { + var el = ( option === 'wrap' || option === 'replace' ) ? node : content, + insert = html; - this.getNodes( function ( editor, element ) { - var contentWrap = $( element ).find( '.wpview-content' ), - wrap = element; - - if ( contentWrap.length && option !== 'wrap' ) { - element = contentWrap = contentWrap[0]; + if ( _.isString( insert ) ) { + insert = editor.dom.createFragment( insert ); } - if ( _.isString( html ) ) { - if ( option === 'replace' ) { - element = editor.dom.replace( editor.dom.createFragment( html ), wrap ); - } else { - editor.dom.setHTML( element, html ); - } + if ( option === 'replace' ) { + editor.dom.replace( insert, el ); } else { - if ( option === 'replace' ) { - element = editor.dom.replace( html, wrap ); - } else { - $( element ).empty().append( html ); - } - } - - if ( _.isFunction( callback ) ) { - callback( self, editor, $( element ).find( '.wpview-content' )[0] ); + el.innerHTML = ''; + el.appendChild( insert ); } } ); }, - /* jshint scripturl: true */ - createIframe: function ( content ) { + setIframes: function ( html ) { var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; - if ( content.indexOf( '' + '' + '' + - content + + html + '' + '' ); @@ -182,10 +175,9 @@ window.wp = window.wp || {}; } }); } else { - this.setContent( content ); + this.setContent( html ); } }, - setError: function( message, dashicon ) { this.setContent( '
' + @@ -507,28 +499,30 @@ window.wp = window.wp || {}; action: 'parse-media-shortcode', initialize: function( options ) { - this.shortcode = options.shortcode; - this.fetching = false; + var self = this; - _.bindAll( this, 'createIframe', 'setNode', 'fetch', 'pausePlayers' ); - $( this ).on( 'ready', this.setNode ); + this.shortcode = options.shortcode; + + _.bindAll( this, 'setIframes', 'setNodes', 'fetch', 'pausePlayers' ); + $( this ).on( 'ready', this.setNodes ); $( document ).on( 'media:edit', this.pausePlayers ); + + this.fetch(); + + this.getEditors( function( editor ) { + editor.on( 'hide', self.pausePlayers ); + }); }, - setNode: function ( event, editor ) { - editor.on( 'hide', this.pausePlayers ); - + setNodes: function () { if ( this.parsed ) { - this.createIframe( this.parsed ); - } else if ( ! this.fetching ) { - this.fetch(); + this.setIframes( this.parsed ); } }, fetch: function () { var self = this; - this.fetching = true; wp.ajax.send( this.action, { data: { @@ -537,13 +531,10 @@ window.wp = window.wp || {}; shortcode: this.shortcode.string() } } ) - .always( function() { - self.fetching = false; - } ) .done( function( response ) { if ( response ) { self.parsed = response; - self.createIframe( response ); + self.setIframes( response ); } } ) .fail( function( response ) { @@ -553,7 +544,7 @@ window.wp = window.wp || {}; self.setError( response.message, 'admin-media' ); } else { - self.setContent( '

' + self.original + '

', null, 'replace' ); + self.setContent( '

' + self.original + '

', 'replace' ); } } else if ( response && response.statusText ) { self.setError( response.statusText, 'admin-media' ); @@ -561,21 +552,9 @@ window.wp = window.wp || {}; } ); }, - /** - * Return parsed response - * - * @returns {string} - */ - getHtml: function() { - if ( ! this.parsed ) { - return ' '; - } - return this.parsed; - }, - pausePlayers: function() { - this.getNodes( function( editor, node ) { - var p, win = $( 'iframe', node ).get(0).contentWindow; + this.getNodes( function( editor, node, content ) { + var p, win = $( 'iframe', content ).get(0).contentWindow; if ( win && win.mejs ) { for ( p in win.mejs.players ) { @@ -586,8 +565,8 @@ window.wp = window.wp || {}; }, unsetPlayers: function() { - this.getNodes( function( editor, node ) { - var p, win = $( 'iframe', node ).get(0).contentWindow; + this.getNodes( function( editor, node, content ) { + var p, win = $( 'iframe', content ).get(0).contentWindow; if ( win && win.mejs ) { for ( p in win.mejs.players ) { @@ -679,8 +658,6 @@ window.wp = window.wp || {}; action: 'parse-embed', initialize: function( options ) { this.content = options.content; - this.fetching = false; - this.parsed = false; this.original = options.url || options.shortcode.string(); if ( options.url ) { @@ -691,20 +668,10 @@ window.wp = window.wp || {}; this.shortcode = options.shortcode; } - _.bindAll( this, 'createIframe', 'setNode', 'fetch' ); - $( this ).on( 'ready', this.setNode ); - }, + _.bindAll( this, 'setIframes', 'setNodes', 'fetch' ); + $( this ).on( 'ready', this.setNodes ); - /** - * Return parsed response - * - * @returns {string} - */ - getHtml: function() { - if ( ! this.parsed ) { - return ''; - } - return this.parsed; + this.fetch(); } } ), edit: function( node ) { diff --git a/wp-includes/js/mce-view.min.js b/wp-includes/js/mce-view.min.js index 3b08f07a3e..63aee624d8 100644 --- a/wp-includes/js/mce-view.min.js +++ b/wp-includes/js/mce-view.min.js @@ -1 +1 @@ -window.wp=window.wp||{},function(a){"use strict";var b={},c={},d=wp.media,e=["encodedText"];wp.mce=wp.mce||{},wp.mce.View=function(a){a=a||{},this.type=a.type,_.extend(this,_.pick(a,e)),this.initialize.apply(this,arguments)},_.extend(wp.mce.View.prototype,{initialize:function(){},getHtml:function(){return""},loadingPlaceholder:function(){return'
'},render:function(){var c=this.getHtml()||this.loadingPlaceholder();this.setContent('

 

'+(_.isFunction(b[this.type].edit)?'
':"")+'
'+c+"
"+(this.overlay?'
':"")+'

 

',function(b,c,d){a(b).trigger("ready",[c,d])},"wrap")},unbind:function(){},getNodes:function(b){var c=[];return _.each(tinymce.editors,function(d){d.plugins.wpview&&a(d.getBody()).find('[data-wpview-text="'+this.encodedText+'"]').each(function(a,e){b&&b(d,e),c.push(e)})},this),c},setContent:function(b,c,d){var e=this;this.getNodes(function(f,g){var h=a(g).find(".wpview-content"),i=g;h.length&&"wrap"!==d&&(g=h=h[0]),_.isString(b)?"replace"===d?g=f.dom.replace(f.dom.createFragment(b),i):f.dom.setHTML(g,b):"replace"===d?g=f.dom.replace(b,i):a(g).empty().append(b),_.isFunction(c)&&c(e,f,a(g).find(".wpview-content")[0])})},createIframe:function(b){var c=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;-1!==b.indexOf("'+b+""),g.close(),i=function(){f.contentWindow&&a(f).height(a(g.body).height())},c)new c(_.debounce(function(){i()},100)).observe(g.body,{attributes:!0,childList:!0,subtree:!0});else for(h=1;6>h;h++)setTimeout(i,700*h)}):this.setContent(b)},setError:function(a,b){this.setContent('

'+a+"

")}}),wp.mce.View.extend=Backbone.View.extend,wp.mce.views={register:function(a,c){var d={type:a,View:{},toView:function(a){var b=wp.shortcode.next(this.type,a);if(b)return{index:b.index,content:b.content,options:{shortcode:b.shortcode}}}};c=_.defaults(c,d),c.View=wp.mce.View.extend(c.View),b[a]=c},get:function(a){return b[a]},unregister:function(a){delete b[a]},unbind:function(){_.each(c,function(a){a.unbind()})},toViews:function(a){var c,d=[{content:a}];return _.each(b,function(a,b){c=d.slice(),d=[],_.each(c,function(c){var e,f=c.content;if(c.processed)return void d.push(c);for(;f&&(e=a.toView(f));)e.index&&d.push({content:f.substring(0,e.index)}),d.push({content:wp.mce.views.toView(b,e.content,e.options),processed:!0}),f=f.slice(e.index+e.content.length);f&&d.push({content:f})})}),_.pluck(d,"content").join("")},toView:function(a,b,d){var e,f,g=wp.mce.views.get(a),h=window.encodeURIComponent(b);return g?(wp.mce.views.getInstance(h)||(f=d,f.type=a,f.encodedText=h,e=new g.View(f),c[h]=e),wp.html.string({tag:"div",attrs:{"class":"wpview-wrap","data-wpview-text":h,"data-wpview-type":a},content:" "})):b},refreshView:function(a,b){var d,e,f,g=window.encodeURIComponent(b);f=wp.mce.views.getInstance(g),f||(e=a.toView(b),d=e.options,d.type=a.type,d.encodedText=g,f=new a.View(d),c[g]=f),wp.mce.views.render()},getInstance:function(a){return c[a]},render:function(){_.each(c,function(a){a.render()})},edit:function(b){var c=a(b).data("wpview-type"),d=wp.mce.views.get(c);d&&d.edit(b)}},wp.mce.views.register("gallery",{View:{template:d.template("editor-gallery"),postID:a("#post_ID").val(),initialize:function(a){this.shortcode=a.shortcode,this.fetch()},fetch:function(){this.attachments=wp.media.gallery.attachments(this.shortcode,this.postID),this.dfd=this.attachments.more().done(_.bind(this.render,this))},getHtml:function(){var a,b=this.shortcode.attrs.named,c=!1;return this.dfd&&"pending"===this.dfd.state()&&!this.attachments.length?"":(this.attachments.length&&(c=this.attachments.toJSON(),_.each(c,function(a){a.sizes&&(a.sizes.thumbnail?a.thumbnail=a.sizes.thumbnail:a.sizes.full&&(a.thumbnail=a.sizes.full))})),a={attachments:c,columns:b.columns?parseInt(b.columns,10):wp.media.galleryDefaults.columns},this.template(a))}},edit:function(b){var c,d,e=wp.media.gallery,f=this;d=window.decodeURIComponent(a(b).attr("data-wpview-text")),c=e.edit(d),c.state("gallery-edit").on("update",function(d){var g=e.shortcode(d).string();a(b).attr("data-wpview-text",window.encodeURIComponent(g)),wp.mce.views.refreshView(f,g),c.detach()})}}),wp.mce.av={View:{overlay:!0,action:"parse-media-shortcode",initialize:function(b){this.shortcode=b.shortcode,this.fetching=!1,_.bindAll(this,"createIframe","setNode","fetch","pausePlayers"),a(this).on("ready",this.setNode),a(document).on("media:edit",this.pausePlayers)},setNode:function(a,b){b.on("hide",this.pausePlayers),this.parsed?this.createIframe(this.parsed):this.fetching||this.fetch()},fetch:function(){var b=this;this.fetching=!0,wp.ajax.send(this.action,{data:{post_ID:a("#post_ID").val()||0,type:this.shortcode.tag,shortcode:this.shortcode.string()}}).always(function(){b.fetching=!1}).done(function(a){a&&(b.parsed=a,b.createIframe(a))}).fail(function(a){a&&a.message?"not-embeddable"===a.type&&"embed"===b.type||"not-ssl"===a.type?b.setError(a.message,"admin-media"):b.setContent("

"+b.original+"

",null,"replace"):a&&a.statusText&&b.setError(a.statusText,"admin-media")})},getHtml:function(){return this.parsed?this.parsed:" "},pausePlayers:function(){this.getNodes(function(b,c){var d,e=a("iframe",c).get(0).contentWindow;if(e&&e.mejs)for(d in e.mejs.players)e.mejs.players[d].pause()})},unsetPlayers:function(){this.getNodes(function(b,c){var d,e=a("iframe",c).get(0).contentWindow;if(e&&e.mejs)for(d in e.mejs.players)e.mejs.players[d].remove()})},unbind:function(){this.pausePlayers(),this.unsetPlayers()}},edit:function(b){var c,d,e,f=wp.media[this.type],g=this;a(document).trigger("media:edit"),d=window.decodeURIComponent(a(b).attr("data-wpview-text")),c=f.edit(d),c.on("close",function(){c.detach()}),e=function(d){var e=wp.media[g.type].shortcode(d).string();a(b).attr("data-wpview-text",window.encodeURIComponent(e)),wp.mce.views.refreshView(g,e),c.detach()},_.isArray(g.state)?_.each(g.state,function(a){c.state(a).on("update",e)}):c.state(g.state).on("update",e),c.open()}},wp.mce.views.register("video",_.extend({},wp.mce.av,{state:"video-details"})),wp.mce.views.register("audio",_.extend({},wp.mce.av,{state:"audio-details"})),wp.mce.views.register("playlist",_.extend({},wp.mce.av,{state:["playlist-edit","video-playlist-edit"]})),wp.mce.embedMixin={View:_.extend({},wp.mce.av.View,{overlay:!0,action:"parse-embed",initialize:function(b){this.content=b.content,this.fetching=!1,this.parsed=!1,this.original=b.url||b.shortcode.string(),this.shortcode=b.url?d.embed.shortcode({url:b.url}):b.shortcode,_.bindAll(this,"createIframe","setNode","fetch"),a(this).on("ready",this.setNode)},getHtml:function(){return this.parsed?this.parsed:""}}),edit:function(b){var c,e,f=d.embed,g=this,h="embedURL"===this.type;a(document).trigger("media:edit"),e=window.decodeURIComponent(a(b).attr("data-wpview-text")),c=f.edit(e,h),c.on("close",function(){c.detach()}),c.state("embed").props.on("change:url",function(a,b){b&&(c.state("embed").metadata=a.toJSON())}),c.state("embed").on("select",function(){var d;d=h?c.state("embed").metadata.url:f.shortcode(c.state("embed").metadata).string(),a(b).attr("data-wpview-text",window.encodeURIComponent(d)),wp.mce.views.refreshView(g,d),c.detach()}),c.open()}},wp.mce.views.register("embed",_.extend({},wp.mce.embedMixin)),wp.mce.views.register("embedURL",_.extend({},wp.mce.embedMixin,{toView:function(a){var b=/(?:^|

)(https?:\/\/[^\s"]+?)(?:<\/p>\s*|$)/gi,c=b.exec(tinymce.trim(a));if(c)return{index:c.index,content:c[0],options:{url:c[1]}}}}))}(jQuery); \ No newline at end of file +window.wp=window.wp||{},function(a){"use strict";var b={},c={},d=wp.media,e=["encodedText"];wp.mce=wp.mce||{},wp.mce.View=function(a){a=a||{},this.type=a.type,_.extend(this,_.pick(a,e)),this.initialize.apply(this,arguments)},_.extend(wp.mce.View.prototype,{initialize:function(){},getHtml:function(){return""},loadingPlaceholder:function(){return'

'},render:function(){this.setContent('

 

'+(_.isFunction(b[this.type].edit)?'
':"")+'
'+(this.getHtml()||this.loadingPlaceholder())+"
"+(this.overlay?'
':"")+'

 

',"wrap"),a(this).trigger("ready")},unbind:function(){},getEditors:function(a){var b=[];return _.each(tinymce.editors,function(c){c.plugins.wpview&&(a&&a(c),b.push(c))},this),b},getNodes:function(b){var c=[],d=this;return this.getEditors(function(e){a(e.getBody()).find('[data-wpview-text="'+d.encodedText+'"]').each(function(d,f){b&&b(e,f,a(f).find(".wpview-content").get(0)),c.push(f)})}),c},setContent:function(a,b){this.getNodes(function(c,d,e){var f="wrap"===b||"replace"===b?d:e,g=a;_.isString(g)&&(g=c.dom.createFragment(g)),"replace"===b?c.dom.replace(g,f):(f.innerHTML="",f.appendChild(g))})},setIframes:function(b){var c=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;-1!==b.indexOf("'+b+""),h.close(),j=function(){g.contentWindow&&a(g).height(a(h.body).height())},c)new c(_.debounce(function(){j()},100)).observe(h.body,{attributes:!0,childList:!0,subtree:!0});else for(i=1;6>i;i++)setTimeout(j,700*i)}):this.setContent(b)},setError:function(a,b){this.setContent('

'+a+"

")}}),wp.mce.View.extend=Backbone.View.extend,wp.mce.views={register:function(a,c){var d={type:a,View:{},toView:function(a){var b=wp.shortcode.next(this.type,a);if(b)return{index:b.index,content:b.content,options:{shortcode:b.shortcode}}}};c=_.defaults(c,d),c.View=wp.mce.View.extend(c.View),b[a]=c},get:function(a){return b[a]},unregister:function(a){delete b[a]},unbind:function(){_.each(c,function(a){a.unbind()})},toViews:function(a){var c,d=[{content:a}];return _.each(b,function(a,b){c=d.slice(),d=[],_.each(c,function(c){var e,f=c.content;if(c.processed)return void d.push(c);for(;f&&(e=a.toView(f));)e.index&&d.push({content:f.substring(0,e.index)}),d.push({content:wp.mce.views.toView(b,e.content,e.options),processed:!0}),f=f.slice(e.index+e.content.length);f&&d.push({content:f})})}),_.pluck(d,"content").join("")},toView:function(a,b,d){var e,f,g=wp.mce.views.get(a),h=window.encodeURIComponent(b);return g?(wp.mce.views.getInstance(h)||(f=d,f.type=a,f.encodedText=h,e=new g.View(f),c[h]=e),wp.html.string({tag:"div",attrs:{"class":"wpview-wrap","data-wpview-text":h,"data-wpview-type":a},content:" "})):b},refreshView:function(a,b){var d,e,f,g=window.encodeURIComponent(b);f=wp.mce.views.getInstance(g),f||(e=a.toView(b),d=e.options,d.type=a.type,d.encodedText=g,f=new a.View(d),c[g]=f),wp.mce.views.render()},getInstance:function(a){return c[a]},render:function(){_.each(c,function(a){a.render()})},edit:function(b){var c=a(b).data("wpview-type"),d=wp.mce.views.get(c);d&&d.edit(b)}},wp.mce.views.register("gallery",{View:{template:d.template("editor-gallery"),postID:a("#post_ID").val(),initialize:function(a){this.shortcode=a.shortcode,this.fetch()},fetch:function(){this.attachments=wp.media.gallery.attachments(this.shortcode,this.postID),this.dfd=this.attachments.more().done(_.bind(this.render,this))},getHtml:function(){var a,b=this.shortcode.attrs.named,c=!1;return this.dfd&&"pending"===this.dfd.state()&&!this.attachments.length?"":(this.attachments.length&&(c=this.attachments.toJSON(),_.each(c,function(a){a.sizes&&(a.sizes.thumbnail?a.thumbnail=a.sizes.thumbnail:a.sizes.full&&(a.thumbnail=a.sizes.full))})),a={attachments:c,columns:b.columns?parseInt(b.columns,10):wp.media.galleryDefaults.columns},this.template(a))}},edit:function(b){var c,d,e=wp.media.gallery,f=this;d=window.decodeURIComponent(a(b).attr("data-wpview-text")),c=e.edit(d),c.state("gallery-edit").on("update",function(d){var g=e.shortcode(d).string();a(b).attr("data-wpview-text",window.encodeURIComponent(g)),wp.mce.views.refreshView(f,g),c.detach()})}}),wp.mce.av={View:{overlay:!0,action:"parse-media-shortcode",initialize:function(b){var c=this;this.shortcode=b.shortcode,_.bindAll(this,"setIframes","setNodes","fetch","pausePlayers"),a(this).on("ready",this.setNodes),a(document).on("media:edit",this.pausePlayers),this.fetch(),this.getEditors(function(a){a.on("hide",c.pausePlayers)})},setNodes:function(){this.parsed&&this.setIframes(this.parsed)},fetch:function(){var b=this;wp.ajax.send(this.action,{data:{post_ID:a("#post_ID").val()||0,type:this.shortcode.tag,shortcode:this.shortcode.string()}}).done(function(a){a&&(b.parsed=a,b.setIframes(a))}).fail(function(a){a&&a.message?"not-embeddable"===a.type&&"embed"===b.type||"not-ssl"===a.type?b.setError(a.message,"admin-media"):b.setContent("

"+b.original+"

","replace"):a&&a.statusText&&b.setError(a.statusText,"admin-media")})},pausePlayers:function(){this.getNodes(function(b,c,d){var e,f=a("iframe",d).get(0).contentWindow;if(f&&f.mejs)for(e in f.mejs.players)f.mejs.players[e].pause()})},unsetPlayers:function(){this.getNodes(function(b,c,d){var e,f=a("iframe",d).get(0).contentWindow;if(f&&f.mejs)for(e in f.mejs.players)f.mejs.players[e].remove()})},unbind:function(){this.pausePlayers(),this.unsetPlayers()}},edit:function(b){var c,d,e,f=wp.media[this.type],g=this;a(document).trigger("media:edit"),d=window.decodeURIComponent(a(b).attr("data-wpview-text")),c=f.edit(d),c.on("close",function(){c.detach()}),e=function(d){var e=wp.media[g.type].shortcode(d).string();a(b).attr("data-wpview-text",window.encodeURIComponent(e)),wp.mce.views.refreshView(g,e),c.detach()},_.isArray(g.state)?_.each(g.state,function(a){c.state(a).on("update",e)}):c.state(g.state).on("update",e),c.open()}},wp.mce.views.register("video",_.extend({},wp.mce.av,{state:"video-details"})),wp.mce.views.register("audio",_.extend({},wp.mce.av,{state:"audio-details"})),wp.mce.views.register("playlist",_.extend({},wp.mce.av,{state:["playlist-edit","video-playlist-edit"]})),wp.mce.embedMixin={View:_.extend({},wp.mce.av.View,{overlay:!0,action:"parse-embed",initialize:function(b){this.content=b.content,this.original=b.url||b.shortcode.string(),this.shortcode=b.url?d.embed.shortcode({url:b.url}):b.shortcode,_.bindAll(this,"setIframes","setNodes","fetch"),a(this).on("ready",this.setNodes),this.fetch()}}),edit:function(b){var c,e,f=d.embed,g=this,h="embedURL"===this.type;a(document).trigger("media:edit"),e=window.decodeURIComponent(a(b).attr("data-wpview-text")),c=f.edit(e,h),c.on("close",function(){c.detach()}),c.state("embed").props.on("change:url",function(a,b){b&&(c.state("embed").metadata=a.toJSON())}),c.state("embed").on("select",function(){var d;d=h?c.state("embed").metadata.url:f.shortcode(c.state("embed").metadata).string(),a(b).attr("data-wpview-text",window.encodeURIComponent(d)),wp.mce.views.refreshView(g,d),c.detach()}),c.open()}},wp.mce.views.register("embed",_.extend({},wp.mce.embedMixin)),wp.mce.views.register("embedURL",_.extend({},wp.mce.embedMixin,{toView:function(a){var b=/(?:^|

)(https?:\/\/[^\s"]+?)(?:<\/p>\s*|$)/gi,c=b.exec(tinymce.trim(a));if(c)return{index:c.index,content:c[0],options:{url:c[1]}}}}))}(jQuery); \ No newline at end of file