<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[22004] trunk/wp-includes: Add JavaScript methods for handling shortcodes.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/22004">22004</a></dd>
<dt>Author</dt> <dd>koopersmith</dd>
<dt>Date</dt> <dd>2012-09-26 01:00:08 +0000 (Wed, 26 Sep 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add JavaScript methods for handling shortcodes.

Adds `wp.shortcode`, a set of methods used for parsing shortcodes out of content. Also adds a default set of shortcode properties to `wp.mce.view`.

fixes <a href="http://core.trac.wordpress.org/ticket/21996">#21996</a>, see <a href="http://core.trac.wordpress.org/ticket/21812">#21812</a>, <a href="http://core.trac.wordpress.org/ticket/21813">#21813</a>, <a href="http://core.trac.wordpress.org/ticket/21815">#21815</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesjsmceviewjs">trunk/wp-includes/js/mce-view.js</a></li>
<li><a href="#trunkwpincludesjstinymcethemesadvancedskinswp_themecontentcss">trunk/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkwpincludesjsshortcodejs">trunk/wp-includes/js/shortcode.js</a></li>
<li><a href="#trunkwpincludesjsshortcodeminjs">trunk/wp-includes/js/shortcode.min.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesjsmceviewjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/mce-view.js (22003 => 22004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/mce-view.js        2012-09-25 23:42:53 UTC (rev 22003)
+++ trunk/wp-includes/js/mce-view.js        2012-09-26 01:00:08 UTC (rev 22004)
</span><span class="lines">@@ -1,3 +1,4 @@
</span><ins>+// Ensure the global `wp` object exists.
</ins><span class="cx"> if ( typeof wp === 'undefined' )
</span><span class="cx">         var wp = {};
</span><span class="cx"> 
</span><span class="lines">@@ -5,45 +6,94 @@
</span><span class="cx">         var views = {},
</span><span class="cx">                 instances = {};
</span><span class="cx"> 
</span><del>-        wp.mce = {};
</del><ins>+        // Create the `wp.mce` object if necessary.
+        wp.mce = wp.mce || {};
</ins><span class="cx"> 
</span><ins>+        // wp.mce.view
+        // -----------
+        //
+        // A set of utilities that simplifies adding custom UI within a TinyMCE editor.
+        // At its core, it serves as a series of converters, transforming text to a
+        // custom UI, and back again.
</ins><span class="cx">         wp.mce.view = {
</span><ins>+                // ### defaults
</ins><span class="cx">                 // The default properties used for the objects in `wp.mce.view.add()`.
</span><span class="cx">                 defaults: {
</span><span class="cx">                         view: Backbone.View,
</span><span class="cx">                         text: function( instance ) {
</span><span class="cx">                                 return instance.options.original;
</span><ins>+                        },
+
+                        toView: function( content ) {
+                                if ( ! this.pattern )
+                                        return;
+
+                                this.pattern.lastIndex = 0;
+                                var match = this.pattern.exec( content );
+
+                                if ( ! match )
+                                        return;
+
+                                return {
+                                        index:   match.index,
+                                        content: match[0],
+                                        options: {
+                                                original: match[0],
+                                                results:  _.toArray( arguments )
+                                        }
+                                };
</ins><span class="cx">                         }
</span><span class="cx">                 },
</span><span class="cx"> 
</span><ins>+                shortcode: {
+                        view: Backbone.View,
+                        text: function( instance ) {
+                                return instance.options.shortcode.text();
+                        },
+
+                        toView: function( content ) {
+                                var match = wp.shortcode.next( this.tag, content );
+
+                                if ( ! match )
+                                        return;
+
+                                return {
+                                        index:   match.index,
+                                        content: match.content,
+                                        options: {
+                                                shortcode: match.shortcode
+                                        }
+                                };
+                        }
+                },
+
+                // ### add( id, options )
</ins><span class="cx">                 // Registers a new TinyMCE view.
</span><span class="cx">                 //
</span><span class="cx">                 // Accepts a unique `id` and an `options` object.
</span><span class="cx">                 //
</span><span class="cx">                 // `options` accepts the following properties:
</span><span class="cx">                 //
</span><del>-                // `pattern` is the regular expression used to scan the content and
</del><ins>+                // * `pattern` is the regular expression used to scan the content and
</ins><span class="cx">                 // detect matching views.
</span><span class="cx">                 //
</span><del>-                // `view` is a `Backbone.View` constructor. If a plain object is
</del><ins>+                // * `view` is a `Backbone.View` constructor. If a plain object is
</ins><span class="cx">                 // provided, it will automatically extend the parent constructor
</span><span class="cx">                 // (usually `Backbone.View`). Views are instantiated when the `pattern`
</span><span class="cx">                 // is successfully matched. The instance's `options` object is provided
</span><span class="cx">                 // with the `original` matched value, the match `results` including
</span><span class="cx">                 // capture groups, and the `viewType`, which is the constructor's `id`.
</span><span class="cx">                 //
</span><del>-                // `extend` an existing view by passing in its `id`. The current
</del><ins>+                // * `extend` an existing view by passing in its `id`. The current
</ins><span class="cx">                 // view will inherit all properties from the parent view, and if
</span><span class="cx">                 // `view` is set to a plain object, it will extend the parent `view`
</span><span class="cx">                 // constructor.
</span><span class="cx">                 //
</span><del>-                // `text` is a method that accepts an instance of the `view`
</del><ins>+                // * `text` is a method that accepts an instance of the `view`
</ins><span class="cx">                 // constructor and transforms it into a text representation.
</span><span class="cx">                 add: function( id, options ) {
</span><del>-                        var parent;
-
</del><span class="cx">                         // Fetch the parent view or the default options.
</span><del>-                        parent = options.extend ? wp.mce.view.get( options.extend ) : wp.mce.view.defaults;
</del><ins>+                        var parent = options.extend ? wp.mce.view.get( options.extend ) : wp.mce.view.defaults;
</ins><span class="cx"> 
</span><span class="cx">                         // Extend the `options` object with the parent's properties.
</span><span class="cx">                         _.defaults( options, parent );
</span><span class="lines">@@ -58,52 +108,93 @@
</span><span class="cx">                         views[ id ] = options;
</span><span class="cx">                 },
</span><span class="cx"> 
</span><ins>+                // ### get( id )
</ins><span class="cx">                 // Returns a TinyMCE view options object.
</span><span class="cx">                 get: function( id ) {
</span><span class="cx">                         return views[ id ];
</span><span class="cx">                 },
</span><span class="cx"> 
</span><ins>+                // ### remove( id )
</ins><span class="cx">                 // Unregisters a TinyMCE view.
</span><span class="cx">                 remove: function( id ) {
</span><span class="cx">                         delete views[ id ];
</span><span class="cx">                 },
</span><span class="cx"> 
</span><ins>+                // ### toViews( content )
</ins><span class="cx">                 // Scans a `content` string for each view's pattern, replacing any
</span><span class="cx">                 // matches with wrapper elements, and creates a new view instance for
</span><span class="cx">                 // every match.
</span><span class="cx">                 //
</span><span class="cx">                 // To render the views, call `wp.mce.view.render( scope )`.
</span><span class="cx">                 toViews: function( content ) {
</span><ins>+                        var pieces = [ { content: content } ],
+                                current;
+
</ins><span class="cx">                         _.each( views, function( view, viewType ) {
</span><del>-                                if ( ! view.pattern )
-                                        return;
</del><ins>+                                current = pieces.slice();
+                                pieces  = [];
</ins><span class="cx"> 
</span><del>-                                // Scan for matches.
-                                content = content.replace( view.pattern, function( match ) {
-                                        var instance, id, tag;
</del><ins>+                                _.each( current, function( piece ) {
+                                        var remaining = piece.content,
+                                                result;
</ins><span class="cx"> 
</span><del>-                                        // Create a new view instance.
-                                        instance = new view.view({
-                                                original: match,
-                                                results:  _.toArray( arguments ),
-                                                viewType: viewType
-                                        });
</del><ins>+                                        // Ignore processed pieces, but retain their location.
+                                        if ( piece.processed ) {
+                                                pieces.push( piece );
+                                                return;
+                                        }
</ins><span class="cx"> 
</span><del>-                                        // Use the view's `id` if it already exists. Otherwise,
-                                        // create a new `id`.
-                                        id = instance.el.id = instance.el.id || _.uniqueId('__wpmce-');
-                                        instances[ id ] = instance;
</del><ins>+                                        // Iterate through the string progressively matching views
+                                        // and slicing the string as we go.
+                                        while ( remaining &amp;&amp; (result = view.toView( remaining )) ) {
+                                                // Any text before the match becomes an unprocessed piece.
+                                                if ( result.index )
+                                                        pieces.push({ content: remaining.substring( 0, result.index ) });
</ins><span class="cx"> 
</span><del>-                                        // If the view is a span, wrap it in a span.
-                                        tag = 'span' === instance.tagName ? 'span' : 'div';
</del><ins>+                                                // Add the processed piece for the match.
+                                                pieces.push({
+                                                        content:   wp.mce.view.toView( viewType, result.options ),
+                                                        processed: true
+                                                });
</ins><span class="cx"> 
</span><del>-                                        return '&lt;' + tag + ' class=&quot;wp-view-wrap&quot; data-wp-view=&quot;' + id + '&quot; contenteditable=&quot;false&quot;&gt;&lt;/' + tag + '&gt;';
</del><ins>+                                                // Update the remaining content.
+                                                remaining = remaining.slice( result.index + result.content.length );
+                                        }
+
+                                        // There are no additional matches. If any content remains,
+                                        // add it as an unprocessed piece.
+                                        if ( remaining )
+                                                pieces.push({ content: remaining });
</ins><span class="cx">                                 });
</span><span class="cx">                         });
</span><span class="cx"> 
</span><del>-                        return content;
</del><ins>+                        return _.pluck( pieces, 'content' ).join('');
</ins><span class="cx">                 },
</span><span class="cx"> 
</span><ins>+                toView: function( viewType, options ) {
+                        var view = wp.mce.view.get( viewType ),
+                                instance, id, tag;
+
+                        if ( ! view )
+                                return '';
+
+                        // Create a new view instance.
+                        instance = new view.view( _.extend( options || {}, {
+                                viewType: viewType
+                        }) );
+
+                        // Use the view's `id` if it already exists. Otherwise,
+                        // create a new `id`.
+                        id = instance.el.id = instance.el.id || _.uniqueId('__wpmce-');
+                        instances[ id ] = instance;
+
+                        // If the view is a span, wrap it in a span.
+                        tag = 'span' === instance.tagName ? 'span' : 'div';
+
+                        return '&lt;' + tag + ' class=&quot;wp-view-wrap&quot; data-wp-view=&quot;' + id + '&quot; contenteditable=&quot;false&quot;&gt;&lt;/' + tag + '&gt;';
+                },
+
+                // ### render( scope )
</ins><span class="cx">                 // Renders any view instances inside a DOM node `scope`.
</span><span class="cx">                 //
</span><span class="cx">                 // View instances are detected by the presence of wrapper elements.
</span><span class="lines">@@ -130,6 +221,7 @@
</span><span class="cx">                         });
</span><span class="cx">                 },
</span><span class="cx"> 
</span><ins>+                // ### toText( content )
</ins><span class="cx">                 // Scans an HTML `content` string and replaces any view instances with
</span><span class="cx">                 // their respective text representations.
</span><span class="cx">                 toText: function( content ) {
</span><span class="lines">@@ -145,4 +237,4 @@
</span><span class="cx">                 }
</span><span class="cx">         };
</span><span class="cx"> 
</span><del>-}(jQuery));
</del><span class="cx">\ No newline at end of file
</span><ins>+}(jQuery));
</ins></span></pre></div>
<a id="trunkwpincludesjsshortcodejs"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/shortcode.js (0 => 22004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/shortcode.js                                (rev 0)
+++ trunk/wp-includes/js/shortcode.js        2012-09-26 01:00:08 UTC (rev 22004)
</span><span class="lines">@@ -0,0 +1,215 @@
</span><ins>+// Utility functions for parsing and handling shortcodes in Javascript.
+
+// Ensure the global `wp` object exists.
+if ( typeof wp === 'undefined' )
+        var wp = {};
+
+(function(){
+        wp.shortcode = {
+                // ### Find the next matching shortcode
+                //
+                // Given a shortcode `tag`, a block of `text, and an optional starting
+                // `index`, returns the next matching shortcode or `undefined`.
+                //
+                // Shortcodes are formatted as an object that contains the match
+                // `content`, the matching `index`, and the parsed `shortcode` object.
+                next: function( tag, text, index ) {
+                        var re = wp.shortcode.regexp( tag ),
+                                match, result;
+
+                        re.lastIndex = index || 0;
+                        match = re.exec( text );
+
+                        if ( ! match )
+                                return;
+
+                        // If we matched an escaped shortcode, try again.
+                        if ( match[1] === '[' &amp;&amp; match[6] === ']' )
+                                return wp.shortcode.next( tag, text, re.lastIndex );
+
+                        result = {
+                                index:     match.index,
+                                content:   match[0],
+                                shortcode: new wp.shortcode.Match( match )
+                        };
+
+                        // If we matched a leading `[`, strip it from the match
+                        // and increment the index accordingly.
+                        if ( match[1] ) {
+                                result.match = result.match.slice( 1 );
+                                result.index++;
+                        }
+
+                        // If we matched a trailing `]`, strip it from the match.
+                        if ( match[6] )
+                                result.match = result.match.slice( 0, -1 );
+
+                        return result;
+                },
+
+                // ### Replace matching shortcodes in a block of text.
+                //
+                // Accepts a shortcode `tag`, content `text` to scan, and a `callback`
+                // to process the shortcode matches and return a replacement string.
+                // Returns the `text` with all shortcodes replaced.
+                //
+                // Shortcode matches are objects that contain the shortcode `tag`,
+                // a shortcode `attrs` object, the `content` between shortcode tags,
+                // and a boolean flag to indicate if the match was a `single` tag.
+                replace: function( tag, text, callback ) {
+                        return text.replace( wp.shortcode.regexp( tag ), function( match, left, tag, attrs, closing, content, right, offset ) {
+                                // If both extra brackets exist, the shortcode has been
+                                // properly escaped.
+                                if ( left === '[' &amp;&amp; right === ']' )
+                                        return match;
+
+                                // Create the match object and pass it through the callback.
+                                var result = callback( new wp.shortcode.Match( arguments ) );
+
+                                // Make sure to return any of the extra brackets if they
+                                // weren't used to escape the shortcode.
+                                return result ? left + result + right : match;
+                        });
+                },
+
+                // ### Generate a shortcode RegExp.
+                //
+                // The base regex is functionally equivalent to the one found in
+                // `get_shortcode_regex()` in `wp-includes/shortcodes.php`.
+                //
+                // Capture groups:
+                //
+                // 1. An extra `[` to allow for escaping shortcodes with double `[[]]`
+                // 2. The shortcode name
+                // 3. The shortcode argument list
+                // 4. The self closing `/`
+                // 5. The content of a shortcode when it wraps some content.
+                // 6. An extra `]` to allow for escaping shortcodes with double `[[]]`
+                regexp: _.memoize( function( tag ) {
+                        return new RegExp( '\\[(\\[?)(' + tag + ')\\b([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)\\[\\/\\2\\])?)(\\]?)', 'g' );
+                }),
+
+
+                // ### Parse shortcode attributes.
+                //
+                // Shortcodes accept many types of attributes. These can chiefly be
+                // divided into named and numeric attributes:
+                //
+                // Named attributes are assigned on a key/value basis, while numeric
+                // attributes are treated as an array.
+                //
+                // Named attributes can be formatted as either `name=&quot;value&quot;`,
+                // `name='value'`, or `name=value`. Numeric attributes can be formatted
+                // as `&quot;value&quot;` or just `value`.
+                attrs: _.memoize( function( text ) {
+                        var named   = {},
+                                numeric = [],
+                                pattern, match;
+
+                        // This regular expression is reused from `shortcode_parse_atts()`
+                        // in `wp-includes/shortcodes.php`.
+                        //
+                        // Capture groups:
+                        //
+                        // 1. An attribute name, that corresponds to...
+                        // 2. a value in double quotes.
+                        // 3. An attribute name, that corresponds to...
+                        // 4. a value in single quotes.
+                        // 5. An attribute name, that corresponds to...
+                        // 6. an unquoted value.
+                        // 7. A numeric attribute in double quotes.
+                        // 8. An unquoted numeric attribute.
+                        pattern = /(\w+)\s*=\s*&quot;([^&quot;]*)&quot;(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'&quot;]+)(?:\s|$)|&quot;([^&quot;]*)&quot;(?:\s|$)|(\S+)(?:\s|$)/g;
+
+                        // Map zero-width spaces to actual spaces.
+                        text = text.replace( /[\u00a0\u200b]/g, ' ' );
+
+                        // Match and normalize attributes.
+                        while ( (match = pattern.exec( text )) ) {
+                                if ( match[1] ) {
+                                        named[ match[1].toLowerCase() ] = match[2];
+                                } else if ( match[3] ) {
+                                        named[ match[3].toLowerCase() ] = match[4];
+                                } else if ( match[5] ) {
+                                        named[ match[5].toLowerCase() ] = match[6];
+                                } else if ( match[7] ) {
+                                        numeric.push( match[7] );
+                                } else if ( match[8] ) {
+                                        numeric.push( match[8] );
+                                }
+                        }
+
+                        return {
+                                named:   named,
+                                numeric: numeric
+                        };
+                })
+        };
+
+
+        // Shortcode Matches
+        // -----------------
+        //
+        // Shortcode matches are generated automatically when using
+        // `wp.shortcode.next()` and `wp.shortcode.replace()`. These two methods
+        // should handle most shortcode needs.
+        //
+        // Accepts a `match` object from calling `regexp.exec()` on a `RegExp`
+        // generated by `wp.shortcode.regexp()`. `match` can also be set to the
+        // `arguments` from a callback passed to `regexp.replace()`.
+        wp.shortcode.Match = function( match ) {
+                this.tag     = match[2];
+                this.attrs   = wp.shortcode.attrs( match[3] );
+                this.single  = !! match[4];
+                this.content = match[5];
+        };
+
+        _.extend( wp.shortcode.Match.prototype, {
+                // ### Get a shortcode attribute.
+                //
+                // Automatically detects whether `attr` is named or numeric and routes
+                // it accordingly.
+                get: function( attr ) {
+                        return this.attrs[ _.isNumber( attr ) ? 'numeric' : 'named' ][ attr ];
+                },
+
+                // ### Set a shortcode attribute.
+                //
+                // Automatically detects whether `attr` is named or numeric and routes
+                // it accordingly.
+                set: function( attr, value ) {
+                        this.attrs[ _.isNumber( attr ) ? 'numeric' : 'named' ][ attr ] = value;
+                        return this;
+                },
+
+                // ### Transform the shortcode match into text.
+                text: function() {
+                        var text    = '[' + this.tag;
+
+                        _.each( this.attrs.numeric, function( value ) {
+                                if ( /\s/.test( value ) )
+                                        text += ' &quot;' + value + '&quot;';
+                                else
+                                        text += ' ' + value;
+                        });
+
+                        _.each( this.attrs.named, function( value, name ) {
+                                text += ' ' + name + '=&quot;' + value + '&quot;';
+                        });
+
+                        // If the tag is marked as singular, self-close the tag and
+                        // ignore any additional content.
+                        if ( this.single )
+                                return text + ' /]';
+
+                        // Complete the opening tag.
+                        text += ']';
+
+                        if ( this.content )
+                                text += this.content;
+
+                        // Add the closing tag.
+                        return text + '[/' + this.tag + ']';
+                }
+        });
+}());
</ins></span></pre></div>
<a id="trunkwpincludesjstinymcethemesadvancedskinswp_themecontentcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css (22003 => 22004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css        2012-09-25 23:42:53 UTC (rev 22003)
+++ trunk/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css        2012-09-26 01:00:08 UTC (rev 22004)
</span><span class="lines">@@ -142,6 +142,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /* WordPress TinyMCE Previews */
</span><del>-div.wp-preview-wrap {
-        display: inline;
</del><ins>+div.wp-view-wrap,
+div.wp-view {
+        display: inline-block;
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (22003 => 22004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2012-09-25 23:42:53 UTC (rev 22003)
+++ trunk/wp-includes/script-loader.php        2012-09-26 01:00:08 UTC (rev 22004)
</span><span class="lines">@@ -322,7 +322,8 @@
</span><span class="cx">                 'selectMediaMultiple' =&gt; __( 'Select one or more media files:' ),
</span><span class="cx">         ) );
</span><span class="cx"> 
</span><del>-        $scripts-&gt;add( 'mce-view', &quot;/wp-includes/js/mce-view$suffix.js&quot;, array( 'backbone', 'jquery' ), false, 1 );
</del><ins>+        $scripts-&gt;add( 'shortcode', &quot;/wp-includes/js/shortcode$suffix.js&quot;, array( 'underscore' ), false, 1 );
+        $scripts-&gt;add( 'mce-view', &quot;/wp-includes/js/mce-view$suffix.js&quot;, array( 'shortcode', 'backbone', 'jquery' ), false, 1 );
</ins><span class="cx"> 
</span><span class="cx">         if ( is_admin() ) {
</span><span class="cx">                 $scripts-&gt;add( 'ajaxcat', &quot;/wp-admin/js/cat$suffix.js&quot;, array( 'wp-lists' ) );
</span></span></pre>
</div>
</div>

</body>
</html>