<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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 #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#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>
<title>[15940] trunk: Internal linking, first pass.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/15940">15940</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-10-24 02:58:42 +0000 (Sun, 24 Oct 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Internal linking, first pass. props koopersmith, see <a href="http://trac.wordpress.org/ticket/11420">#11420</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminadminajaxphp">trunk/wp-admin/admin-ajax.php</a></li>
<li><a href="#trunkwpadmincsscolorsclassicdevcss">trunk/wp-admin/css/colors-classic.dev.css</a></li>
<li><a href="#trunkwpadmincsscolorsfreshdevcss">trunk/wp-admin/css/colors-fresh.dev.css</a></li>
<li><a href="#trunkwpadmincsswpadmindevcss">trunk/wp-admin/css/wp-admin.dev.css</a></li>
<li><a href="#trunkwpadminincludespostphp">trunk/wp-admin/includes/post.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/wp-includes/js/tinymce/plugins/wplink/</li>
<li><a href="#trunkwpincludesjstinymcepluginswplinkeditor_plugindevjs">trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js</a></li>
<li><a href="#trunkwpincludesjstinymcepluginswplinkeditor_pluginjs">trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.js</a></li>
<li>trunk/wp-includes/js/tinymce/plugins/wplink/js/</li>
<li><a href="#trunkwpincludesjstinymcepluginswplinkjswplinkjs">trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.js</a></li>
<li><a href="#trunkwpincludesjstinymcewpmcelinkincludesphp">trunk/wp-includes/js/tinymce/wp-mce-link-includes.php</a></li>
<li><a href="#trunkwpincludesjstinymcewpmcelinkphp">trunk/wp-includes/js/tinymce/wp-mce-link.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminadminajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin-ajax.php (15939 => 15940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-ajax.php        2010-10-23 20:52:49 UTC (rev 15939)
+++ trunk/wp-admin/admin-ajax.php        2010-10-24 02:58:42 UTC (rev 15940)
</span><span class="lines">@@ -1102,6 +1102,13 @@
</span><span class="cx"> 
</span><span class="cx">         exit;
</span><span class="cx">         break;
</span><ins>+case 'wp-link-ajax':
+        require_once ABSPATH . WPINC . '/js/tinymce/wp-mce-link-includes.php';
+
+        wp_link_ajax( $_POST );
+        
+        exit;
+        break;
</ins><span class="cx"> case 'menu-locations-save':
</span><span class="cx">         if ( ! current_user_can( 'edit_theme_options' ) )
</span><span class="cx">                 die('-1');
</span></span></pre></div>
<a id="trunkwpadmincsscolorsclassicdevcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/colors-classic.dev.css (15939 => 15940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/colors-classic.dev.css        2010-10-23 20:52:49 UTC (rev 15939)
+++ trunk/wp-admin/css/colors-classic.dev.css        2010-10-24 02:58:42 UTC (rev 15940)
</span><span class="lines">@@ -110,13 +110,16 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> div.tabs-panel,
</span><ins>+.wp-tabs-panel,
</ins><span class="cx"> ul.category-tabs li.tabs,
</span><del>-ul.add-menu-item-tabs li.tabs {
</del><ins>+ul.add-menu-item-tabs li.tabs,
+.wp-tab-active {
</ins><span class="cx">         border-color: #dfdfdf;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ul.category-tabs li.tabs,
</span><del>-ul.add-menu-item-tabs li.tabs {
</del><ins>+ul.add-menu-item-tabs li.tabs,
+.wp-tab-active {
</ins><span class="cx">         background-color: #f1f1f1;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -383,7 +386,8 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #side-sortables .category-tabs .tabs a,
</span><del>-#side-sortables .add-menu-item-tabs .tabs a {
</del><ins>+#side-sortables .add-menu-item-tabs .tabs a,
+.wp-tab-bar .wp-tab-active a {
</ins><span class="cx">         color: #333;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadmincsscolorsfreshdevcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/colors-fresh.dev.css (15939 => 15940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/colors-fresh.dev.css        2010-10-23 20:52:49 UTC (rev 15939)
+++ trunk/wp-admin/css/colors-fresh.dev.css        2010-10-24 02:58:42 UTC (rev 15940)
</span><span class="lines">@@ -110,13 +110,16 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> div.tabs-panel,
</span><ins>+.wp-tab-panel,
</ins><span class="cx"> ul.category-tabs li.tabs,
</span><del>-ul.add-menu-item-tabs li.tabs {
</del><ins>+ul.add-menu-item-tabs li.tabs,
+.wp-tab-active {
</ins><span class="cx">         border-color: #dfdfdf;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ul.category-tabs li.tabs,
</span><del>-ul.add-menu-item-tabs li.tabs {
</del><ins>+ul.add-menu-item-tabs li.tabs,
+.wp-tab-active {
</ins><span class="cx">         background-color: #f1f1f1;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -382,7 +385,8 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #side-sortables .category-tabs .tabs a,
</span><del>-#side-sortables .add-menu-item-tabs .tabs a {
</del><ins>+#side-sortables .add-menu-item-tabs .tabs a,
+.wp-tab-bar .wp-tab-active a {
</ins><span class="cx">         color: #333;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadmincsswpadmindevcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/wp-admin.dev.css (15939 => 15940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/wp-admin.dev.css        2010-10-23 20:52:49 UTC (rev 15939)
+++ trunk/wp-admin/css/wp-admin.dev.css        2010-10-24 02:58:42 UTC (rev 15940)
</span><span class="lines">@@ -2029,6 +2029,7 @@
</span><span class="cx">         text-decoration: none;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.wp-tab-panel,
</ins><span class="cx"> .categorydiv div.tabs-panel,
</span><span class="cx"> .customlinkdiv div.tabs-panel,
</span><span class="cx"> .posttypediv div.tabs-panel,
</span><span class="lines">@@ -2063,17 +2064,20 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #side-sortables .category-tabs li,
</span><del>-#side-sortables .add-menu-item-tabs li {
</del><ins>+#side-sortables .add-menu-item-tabs li,
+.wp-tab-bar li {
</ins><span class="cx">         display: inline;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #side-sortables .category-tabs a,
</span><del>-#side-sortables .add-menu-item-tabs a {
</del><ins>+#side-sortables .add-menu-item-tabs a,
+.wp-tab-bar a {
</ins><span class="cx">         text-decoration: none;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #side-sortables .category-tabs,
</span><del>-#side-sortables .add-menu-item-tabs {
</del><ins>+#side-sortables .add-menu-item-tabs,
+.wp-tab-bar {
</ins><span class="cx">         margin-bottom: 3px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2110,21 +2114,15 @@
</span><span class="cx">         margin-bottom: 0px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.categorydiv .tabs-panel,
-.customlinkdiv .tabs-panel,
-.posttypediv .tabs-panel,
-.taxonomydiv .tabs-panel {
-        border-width: 3px;
-        border-style: solid;
-}
-
</del><span class="cx"> ul.category-tabs,
</span><del>-ul.add-menu-item-tabs {
</del><ins>+ul.add-menu-item-tabs,
+ul.wp-tab-bar {
</ins><span class="cx">         margin-top: 12px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ul.category-tabs li.tabs,
</span><del>-ul.add-menu-item-tabs li.tabs {
</del><ins>+ul.add-menu-item-tabs li.tabs,
+.wp-tab-active {
</ins><span class="cx">         border-style: solid solid none;
</span><span class="cx">         border-width: 1px 1px 0;
</span><span class="cx"> }
</span><span class="lines">@@ -2137,7 +2135,8 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ul.category-tabs li,
</span><del>-ul.add-menu-item-tabs li {
</del><ins>+ul.add-menu-item-tabs li,
+ul.wp-tab-bar li {
</ins><span class="cx">         padding: 5px;
</span><span class="cx">         -moz-border-radius: 3px 3px 0 0;
</span><span class="cx">         -webkit-border-top-left-radius: 3px;
</span></span></pre></div>
<a id="trunkwpadminincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/post.php (15939 => 15940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/post.php        2010-10-23 20:52:49 UTC (rev 15939)
+++ trunk/wp-admin/includes/post.php        2010-10-24 02:58:42 UTC (rev 15940)
</span><span class="lines">@@ -1311,10 +1311,10 @@
</span><span class="cx">         $mce_spellchecker_languages = apply_filters('mce_spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv');
</span><span class="cx"> 
</span><span class="cx">         if ( $teeny ) {
</span><del>-                $plugins = apply_filters( 'teeny_mce_plugins', array('inlinepopups', 'media', 'fullscreen', 'wordpress') );
</del><ins>+                $plugins = apply_filters( 'teeny_mce_plugins', array('inlinepopups', 'media', 'fullscreen', 'wordpress', 'wplink') );
</ins><span class="cx">                 $ext_plugins = '';
</span><span class="cx">         } else {
</span><del>-                $plugins = array( 'inlinepopups', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen', 'wpeditimage', 'wpgallery', 'tabfocus' );
</del><ins>+                $plugins = array( 'inlinepopups', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen', 'wpeditimage', 'wpgallery', 'tabfocus', 'wplink' );
</ins><span class="cx"> 
</span><span class="cx">                 /*
</span><span class="cx">                 The following filter takes an associative array of external plugins for TinyMCE in the form 'plugin_name' =&gt; 'url'.
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswplinkeditor_plugindevjs"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js (0 => 15940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js                                (rev 0)
+++ trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.dev.js        2010-10-24 02:58:42 UTC (rev 15940)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+(function() {
+        tinymce.create('tinymce.plugins.wpLink', {
+                /**
+                 * Initializes the plugin, this will be executed after the plugin has been created.
+                 * This call is done before the editor instance has finished it's initialization so use the onInit event
+                 * of the editor instance to intercept that event.
+                 *
+                 * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
+                 * @param {string} url Absolute URL to where the plugin is located.
+                 */
+                init : function(ed, url) {
+                        // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
+                        ed.addCommand('WP_Link', function() {
+                                ed.windowManager.open({
+                                        file : tinymce.baseURL + '/wp-mce-link.php',
+                                        width : 320,
+                                        height : 340,
+                                        inline : 1
+                                }, {
+                                        plugin_url : url // Plugin absolute URL
+                                });
+                        });
+
+                        // Register example button
+                        ed.addButton('link', {
+                                title : ed.getLang('advanced.link_desc'),
+                                cmd : 'WP_Link'
+                        });
+                        
+                        ed.addShortcut('alt+shift+a', ed.getLang('advanced.link_desc'), 'WP_Link');
+
+                        // Add a node change handler, selects the button in the UI when a link is selected
+                        ed.onNodeChange.add(function(ed, cm, n) {
+                                cm.setActive('wplink', n.nodeName == 'A');
+                        });
+                },
+                /**
+                 * Returns information about the plugin as a name/value array.
+                 * The current keys are longname, author, authorurl, infourl and version.
+                 *
+                 * @return {Object} Name/value array containing information about the plugin.
+                 */
+                getInfo : function() {
+                        return {
+                                longname : 'WordPress Link Dialog',
+                                author : 'WordPress',
+                                authorurl : 'http://wordpress.org',
+                                infourl : '',
+                                version : &quot;1.0&quot;
+                        };
+                }
+        });
+
+        // Register plugin
+        tinymce.PluginManager.add('wplink', tinymce.plugins.wpLink);
+})();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswplinkeditor_pluginjs"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.js (0 => 15940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.js                                (rev 0)
+++ trunk/wp-includes/js/tinymce/plugins/wplink/editor_plugin.js        2010-10-24 02:58:42 UTC (rev 15940)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+(function(){tinymce.create(&quot;tinymce.plugins.wpLink&quot;,{init:function(a,b){a.addCommand(&quot;WP_Link&quot;,function(){a.windowManager.open({file:tinymce.baseURL+&quot;/wp-mce-link.php&quot;,width:320,height:340,inline:1},{plugin_url:b})});a.addButton(&quot;link&quot;,{title:a.getLang(&quot;advanced.link_desc&quot;),cmd:&quot;WP_Link&quot;});a.addShortcut(&quot;alt+shift+a&quot;,a.getLang(&quot;advanced.link_desc&quot;),&quot;WP_Link&quot;);a.onNodeChange.add(function(d,c,e){c.setActive(&quot;wplink&quot;,e.nodeName==&quot;A&quot;)})},getInfo:function(){return{longname:&quot;WordPress Link Dialog&quot;,author:&quot;WordPress&quot;,authorurl:&quot;http://wordpress.org&quot;,infourl:&quot;&quot;,version:&quot;1.0&quot;}}});tinymce.PluginManager.add(&quot;wplink&quot;,tinymce.plugins.wpLink)})();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswplinkjswplinkjs"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.js (0 => 15940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.js                                (rev 0)
+++ trunk/wp-includes/js/tinymce/plugins/wplink/js/wplink.js        2010-10-24 02:58:42 UTC (rev 15940)
</span><span class="lines">@@ -0,0 +1,296 @@
</span><ins>+(function($){
+        $.widget('wp.wpTabs', {
+                options: {},
+                _create: function() {
+                        var self = this,
+                                ul = this.element,
+                                lis = ul.children();
+                        
+                        this.active = lis.filter('.wp-tab-active');
+                        // Calculate panel IDs
+                        lis.each(function() {
+                                var panel = self._getPanel( $(this) );
+                                if ( self.active[0] == this )
+                                        panel.show();
+                                else
+                                        panel.hide();
+                        });
+                        
+                        ul.delegate('li', 'click.wpTabs', function(e) {
+                                var li = $(this);
+                                
+                                // Prevent any child link from redirecting the page.
+                                e.preventDefault();
+                                // Deactivate previous tab.
+                                self._getPanel( self.active ).hide();
+                                self.active.removeClass('wp-tab-active');
+                                self._trigger(&quot;hide&quot;, e, self.widget() );
+                                
+                                // Activate current tab.
+                                self.active = li.addClass('wp-tab-active');
+                                self._getPanel( self.active ).show();
+                                self._trigger(&quot;show&quot;, e, self.widget() );
+                        });
+                },
+                widget: function() {
+                        return {
+                                ul: this.element,
+                                tab: this.active,
+                                panel: this._getPanel( this.active )
+                        };
+                },
+                _setPanel: function( $el ) {
+                        var panel = $( '#' + $el.children('.wp-tab-for-id').val() );
+                        $el.data( 'wp-tab-panel', panel );
+                        return panel;
+                },
+                _getPanel: function( $el ) {
+                        var panel = $el.data('wp-tab-panel');
+                        return ( !panel || !panel.length ) ? this._setPanel( $el ) : panel;
+                }
+        });
+        // Create tab bars by default.
+        $(function(){
+                $('.wp-tab-bar').wpTabs();
+        });
+})(jQuery);
+
+(function($){        
+        var inputs = {}, panels, active, ed,
+        wpLink = {
+                init : function() {
+                        var e, etarget, eclass;
+                        // Init shared vars
+                        ed = tinyMCEPopup.editor;
+                        // Secondary options
+                        inputs.title = $('#link-title-field');
+                        // Advanced Options
+                        inputs.openInNewTab = $('#link-target-checkbox');
+                        // Types
+                        inputs.typeDropdown = $('#link-type');
+                        inputs.typeOptions = inputs.typeDropdown.find('option');
+                        
+                        panels = $('.link-panel');
+                        active = $('.link-panel-active');
+                        
+                        // Extract type names
+                        inputs.typeOptions.each( function(){
+                                var linkType = this.id.replace(/^link-option-id-/,''),
+                                        parts = linkType.split('-');
+                                $(this).data( 'link-type', {
+                                        full : linkType,
+                                        type : parts[0],
+                                        name : parts[1] || ''
+                                });
+                        });
+                        panels.each( function(){
+                                var linkType = this.id.replace(/^link-panel-id-/,''),
+                                        parts = linkType.split('-');
+                                $(this).data( 'link-type', {
+                                        full : linkType,
+                                        type : parts[0],
+                                        name : parts[1] || ''
+                                });
+                        });
+                        
+                        // Bind event handlers
+                        inputs.typeDropdown.change( wpLink.selectPanel );
+                        $('#wp-update').click( wpLink.update );
+                        $('#wp-cancel').click( function() { tinyMCEPopup.close(); } );
+                        $('.link-panel .wp-tab-bar').wpTabs('option', 'show', wpLink.maybeLoadPanel );
+                        $('.link-panel .wp-tab-panel').delegate('li', 'click', wpLink.selectInternalLink );
+                        $('.wp-tab-panel-pagelinks').delegate('a', 'click', wpLink.selectPageLink );
+                        $('.link-panel .link-search-field').keyup( wpLink.searchInternalLinks );
+                        
+                        // If link exists, select proper values.
+                        e = ed.dom.getParent(ed.selection.getNode(), 'A');
+                        if ( ! e )
+                                return;
+                        
+                        // @TODO: select proper panel/fill values when a link is edited
+                        active.find('input.url-field').val( e.href );
+                        inputs.title.val( ed.dom.getAttrib(e, 'title') );
+                        // Advanced Options
+                        
+                        if ( &quot;_blank&quot; == ed.dom.getAttrib(e, 'target') )
+                                inputs.openInNewTab.attr('checked','checked');
+                },
+                
+                update : function() {
+                        var el,
+                                ed = tinyMCEPopup.editor,
+                                attrs = {
+                                        title : inputs.title.val(),
+                                        target : inputs.openInNewTab.attr('checked') ? '_blank' : ''
+                                }, defaultContent, e, b;
+                        
+                        if ( active.hasClass('link-panel-custom') ) {
+                                attrs.href = active.find('input.url-field').val();
+                                defaultContent = attrs.href;
+                        } else {
+                                el = active.find('li.selected:visible');
+                                if ( !el.length )
+                                        return;
+                                
+                                attrs.href = el.children('input').val();
+                                defaultContent = el.text();
+                        }
+                        
+                        tinyMCEPopup.restoreSelection();
+                        e = ed.dom.getParent(ed.selection.getNode(), 'A');
+                        
+                        // If the values are empty...
+                        if ( ! attrs.href ) {
+                                // ...and nothing is selected, we should return
+                                if ( ed.selection.isCollapsed() ) {
+                                        tinyMCEPopup.close();
+                                        return;
+                                // ...and a link exists, we should unlink and return
+                                } else if ( e ) {
+                                        tinyMCEPopup.execCommand(&quot;mceBeginUndoLevel&quot;);
+                                        b = ed.selection.getBookmark();
+                                        ed.dom.remove(e, 1);
+                                        ed.selection.moveToBookmark(b);
+                                        tinyMCEPopup.execCommand(&quot;mceEndUndoLevel&quot;);
+                                        tinyMCEPopup.close();
+                                        return;
+                                }
+                        }
+                        
+                        tinyMCEPopup.execCommand(&quot;mceBeginUndoLevel&quot;);
+
+                        if (e == null) {
+                                ed.getDoc().execCommand(&quot;unlink&quot;, false, null);
+                                
+                                // If no selection exists, create a new link from scratch.
+                                if ( ed.selection.isCollapsed() ) {
+                                        var el = ed.dom.create('a', { href: &quot;#mce_temp_url#&quot; }, defaultContent);
+                                        ed.selection.setNode(el);
+                                // If a selection exists, wrap it in a link.
+                                } else {
+                                        tinyMCEPopup.execCommand(&quot;CreateLink&quot;, false, &quot;#mce_temp_url#&quot;, {skip_undo : 1});
+                                }
+
+                                tinymce.each(ed.dom.select(&quot;a&quot;), function(n) {
+                                        if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') {
+                                                e = n;
+                                                ed.dom.setAttribs(e, attrs);
+                                        }
+                                });
+                        } else {
+                                ed.dom.setAttribs(e, attrs);
+                        }
+
+                        // Don't move caret if selection was image
+                        if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') {
+                                ed.focus();
+                                ed.selection.select(e);
+                                ed.selection.collapse(0);
+                                tinyMCEPopup.storeSelection();
+                        }
+
+                        tinyMCEPopup.execCommand(&quot;mceEndUndoLevel&quot;);
+                        tinyMCEPopup.close();
+                },
+                
+                selectPanel : function( option ) {
+                        var sel = inputs.typeOptions.filter(':selected');
+                        
+                        if ( option.jquery ) {
+                                sel.removeAttr('selected');
+                                sel = option.attr('selected', 'selected');
+                        }
+                        
+                        active.removeClass('link-panel-active');
+                        active = $('#link-panel-id-' + sel.data('link-type').full ).addClass('link-panel-active');
+                        wpLink.maybeLoadPanel();
+                },
+                
+                maybeLoadPanel : function() {
+                        var panel = active.find('.wp-tab-panel:visible');
+                        if ( panel.length &amp;&amp; panel.find('.wp-tab-panel-loading').length )
+                                wpLink.linkPanelAJAX( panel );
+                },
+                
+                linkPanelAJAX : function( $panel, params, callback ) {
+                        if ( ! $panel.hasClass('wp-tab-panel') )
+                                $panel = $panel.parents('.wp-tab-panel');
+                        
+                        if ( ! $panel.length )
+                                return;
+                                
+                        var query = $panel.children('.wp-tab-panel-query').val();
+                        
+                        wpLink.linkAJAX( $panel, $.extend({
+                                preset : query,
+                                page : 'all' == query ? 1 : 0
+                        }, params), function(r, lt) {
+                                var pagelinks = $panel.children('.wp-tab-panel-pagelinks');
+                                
+                                // Set results
+                                $panel.children('ul').html( wpLink.generateListMarkup( r['results'], lt ) );
+                                
+                                // Handle page links
+                                if ( r['page_links'] )
+                                        pagelinks.html( r['page_links'] ).show();
+                                else
+                                        pagelinks.hide();
+                                // Run callback
+                                if ( callback )
+                                        callback(r, lt);
+                        })
+                },
+                
+                selectInternalLink : function() {
+                        var t = $(this);
+                        if ( t.hasClass('unselectable') )
+                                return;
+                        t.siblings('.selected').removeClass('selected');
+                        t.addClass('selected');
+                },
+                
+                selectPageLink : function(e) {
+                        var page = e.target.href.match(/page=(\d+)/);
+                        
+                        page = page ? page[1] : 1; // If there's no match, it's the first page.
+                        e.preventDefault(); // Prevent the link from redirecting.
+                        
+                        wpLink.linkPanelAJAX( $(this), { page : page });
+                },
+                
+                searchInternalLinks : function() {
+                        var t = $(this),
+                                waiting = t.siblings('img.waiting').show();
+                                
+                        wpLink.linkPanelAJAX( t, { title : t.val() }, function(){ waiting.hide(); });
+                },
+                
+                linkAJAX : function( el, params, callback ) {
+                        var linkType = el.parents('.link-panel').data('link-type');
+                        $.post( ajaxurl, $.extend({
+                                action : 'wp-link-ajax',
+                                type : linkType.type,
+                                name : linkType.name
+                        }, params ), function(r) {
+                                return callback(r, linkType); 
+                        }, &quot;json&quot; );
+                },
+                
+                generateListMarkup : function( results, linkType ) {
+                        var s = '';
+                        
+                        if ( ! results )
+                                return '&lt;li class=&quot;no-matches-found unselectable&quot;&gt;&lt;em&gt;' + wpLinkL10n.noMatchesFound + '&lt;/em&gt;&lt;/li&gt;';
+                        
+                        $.each( results, function() {
+                                s+= '&lt;li id=&quot;link-to-' + linkType.full + '-' + this['ID'] + '&quot;&gt;';
+                                s+= '&lt;input type=&quot;hidden&quot; value=&quot;' + this['permalink'] + '&quot; /&gt;';
+                                s+= this['title'] ? this['title'] : '&lt;em&gt;'+ wpLinkL10n.untitled + '&lt;/em&gt;';
+                                s+= '&lt;/li&gt;';
+                        });
+                        return s;
+                }
+        }
+        
+        $(document).ready( wpLink.init );
+})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjstinymcewpmcelinkincludesphp"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/tinymce/wp-mce-link-includes.php (0 => 15940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/wp-mce-link-includes.php                                (rev 0)
+++ trunk/wp-includes/js/tinymce/wp-mce-link-includes.php        2010-10-24 02:58:42 UTC (rev 15940)
</span><span class="lines">@@ -0,0 +1,214 @@
</span><ins>+&lt;?php
+/** @ignore */
+if ( ! defined('ABSPATH') )
+        require_once('../../../wp-load.php');
+        
+
+class WP_Tab_Bar {
+        var $tabs = array();
+        
+        var $selected = '';
+        
+        function add( $id, $label, $url='' ) {
+                array_push( $this-&gt;tabs, array(
+                        'label' =&gt; $label,
+                        'for' =&gt; $id,
+                        'url' =&gt; $url
+                ));
+        }
+        
+        function select( $id ) {
+                $this-&gt;selected = $id;
+        }
+        
+        function render( $echo=true ) {
+                if ( empty( $this-&gt;selected ) )
+                        $this-&gt;selected = $this-&gt;tabs[0]['for'];
+
+                $out = &quot;&lt;ul class='wp-tab-bar'&gt;&quot;;
+                foreach( $this-&gt;tabs as $tab ) {
+                        if ( !isset($tab['url']) )
+                                $tab['url'] = '';
+
+                        $out.= &quot;&lt;li class='&quot;;
+                        $out.= $this-&gt;selected == $tab['for'] ? 'wp-tab-active' : '';
+                        $out.= &quot;'&gt;&lt;input type='hidden' class='wp-tab-for-id' value='{$tab['for']}' /&gt;&quot;;
+                        $out.= &quot;&lt;a href='{$tab['url']}#{$tab['for']}'&gt;&quot;;
+                        $out.= &quot;{$tab['label']}&lt;/a&gt;&lt;/li&gt;&quot;;
+                }
+                $out.= &quot;&lt;/ul&gt;&quot;;
+
+                if ( $echo )
+                        echo $out;
+
+                return $out;
+        }
+}
+
+function wp_link_panel_custom() { ?&gt;
+        &lt;div id=&quot;link-panel-id-custom&quot; class=&quot;link-panel link-panel-custom link-panel-active&quot;&gt;
+                &lt;input type=&quot;hidden&quot; class=&quot;link-panel-type&quot; value=&quot;custom&quot; /&gt;
+                &lt;label&gt;
+                        &lt;span&gt;&lt;?php _e('URL:'); ?&gt;&lt;/span&gt;&lt;input class=&quot;url-field&quot; type=&quot;text&quot; /&gt;
+                &lt;/label&gt;
+        &lt;/div&gt;
+&lt;?php }
+
+function wp_link_panel_structure( $panel_type, $name, $queries ) {
+        $id = $panel_type . '-' . $name;
+        
+        ?&gt;
+        &lt;div id=&quot;link-panel-id-&lt;?php echo $id; ?&gt;&quot; class=&quot;link-panel link-panel-&lt;?php echo $panel_type; ?&gt;&quot;&gt;
+                &lt;!-- &lt;input type=&quot;hidden&quot; class=&quot;link-panel-type&quot; value=&quot;&lt;?php echo $panel_type; ?&gt;&quot; /&gt; --&gt;
+                &lt;!-- &lt;input type=&quot;hidden&quot; class=&quot;link-panel-id&quot; value=&quot;&quot; /&gt; --&gt;
+                &lt;?php
+                
+                $tb = new WP_Tab_Bar();
+                foreach( $queries as $i =&gt; $query ) {
+                        $queries[$i]['id'] = &quot;$id-{$query['preset']}&quot;;
+                        $tb-&gt;add( $queries[$i]['id'], $query['label'] );
+                }
+                $tb-&gt;render();
+
+                foreach( $queries as $query ): ?&gt;
+                        &lt;div id=&quot;&lt;?php echo $query['id']; ?&gt;&quot; class=&quot;wp-tab-panel&quot;&gt;
+                                &lt;input type=&quot;hidden&quot; class=&quot;wp-tab-panel-query&quot; value=&quot;&lt;?php echo $query['preset']; ?&gt;&quot; /&gt;
+                                
+                        &lt;?php if ( 'search' == $query['preset'] ): ?&gt;
+                                &lt;label for=&quot;&lt;?php echo $id; ?&gt;-search-field&quot; class=&quot;link-search-wrapper&quot;&gt;
+                                        &lt;span&gt;&lt;?php _e('Search:'); ?&gt;&lt;/span&gt;
+                                        &lt;input type=&quot;text&quot; id=&quot;&lt;?php echo $id; ?&gt;-search-field&quot; class=&quot;link-search-field&quot; /&gt;
+                                        &lt;img class=&quot;waiting&quot; src=&quot;&lt;?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?&gt;&quot; alt=&quot;&quot; /&gt;
+                                &lt;/label&gt;
+                                &lt;ul id=&quot;&lt;?php echo $id; ?&gt;-search-results&quot; class=&quot;link-search-results&quot;&gt;&lt;/ul&gt;
+                                
+                        &lt;?php else: ?&gt;
+                                &lt;div class=&quot;wp-tab-panel-pagelinks wp-tab-panel-pagelinks-top&quot;&gt;&lt;/div&gt;
+                                &lt;ul&gt;
+                                        &lt;li class=&quot;wp-tab-panel-loading unselectable&quot;&gt;&lt;em&gt;&lt;?php _e('Loading...'); ?&gt;&lt;/em&gt;&lt;/li&gt;
+                                &lt;/ul&gt;
+                                &lt;div class=&quot;wp-tab-panel-pagelinks wp-tab-panel-pagelinks-bottom&quot;&gt;&lt;/div&gt;
+                        &lt;?php endif; ?&gt;
+                        &lt;/div&gt;
+                &lt;?php endforeach; ?&gt;
+        &lt;/div&gt;
+&lt;?php }
+
+function wp_link_query_post_type( $pt_obj, $preset='all', $opts=array() ) {
+        $args_base = array(
+                'post_type' =&gt; $pt_obj-&gt;name,
+                'suppress_filters' =&gt; true,
+                'update_post_term_cache' =&gt; false,
+                'update_post_meta_cache' =&gt; false,
+                'post_status' =&gt; 'publish',
+        );
+        
+        switch( $preset ) {
+        case 'all':
+                $args = array_merge( $args_base, array(
+                        'order' =&gt; 'ASC',
+                        'orderby' =&gt; 'title',
+                        'posts_per_page' =&gt; 20,
+                ));
+                break;
+        case 'recent':
+                $args = array_merge( $args_base, array(
+                        'order' =&gt; 'DESC',
+                        'orderby' =&gt; 'post_date',
+                        'posts_per_page' =&gt; 15,
+                ));
+                break;
+        case 'search':
+                $args = array_merge( $args_base, array(
+                        's' =&gt; isset($opts['search']) ? $opts['search'] : '',
+                        'posts_per_page' =&gt; 10
+                ));
+                break;
+        }
+        
+        // Handle pages if a page number is specified.
+        if ( isset( $opts['pagenum'] ) &amp;&amp; isset( $args['posts_per_page'] ) ) {
+                $pages = array(
+                        'current' =&gt; $opts['pagenum'],
+                        'per_page' =&gt; $args['posts_per_page']
+                );
+                
+                if ( ! isset( $args['offset'] ) )
+                        $args['offset'] = 0 &lt; $opts['pagenum'] ? $args['posts_per_page'] * ( $opts['pagenum'] - 1 ) : 0;
+                $pages['offset'] = $args['offset'];
+        }
+        
+        // Allow args to be extended.
+        if ( isset( $opts['args'] ) )
+                $args = array_merge( $args, $opts['args'] );
+        
+        // Do main query.
+        $get_posts = new WP_Query;
+        $posts = $get_posts-&gt;query( $args );
+        // Check if any posts were found.
+        if ( ! $get_posts-&gt;post_count )
+                return false;
+        
+        // Build results.
+        $results = array();
+        foreach ( $posts as $post ) {
+                $results[] = array(
+                        'ID' =&gt; $post-&gt;ID,
+                        'title' =&gt; $post-&gt;post_title,
+                        'permalink' =&gt; get_permalink( $post-&gt;ID )
+                );
+        }
+        // Build response.
+        $resp = array(
+                'query' =&gt; $get_posts,
+                'objects' =&gt; $posts,
+                'results' =&gt; $results
+        );
+        
+        // Set remaining pages values.
+        if ( isset( $pages ) ) {
+                $pages['max'] = $resp['query']-&gt;max_num_pages;
+                $pages['page_links'] = paginate_links( array(
+                        'prev_text' =&gt; __('&amp;laquo;'),
+                        'next_text' =&gt; __('&amp;raquo;'),
+                        'total' =&gt; $pages['max'],
+                        'current' =&gt; $pages['current']
+                ));
+                $resp['pages'] = $pages;
+        }
+        
+        return $resp;
+}
+
+function wp_link_ajax( $request ) {
+        if ( !isset($request['type']) || !isset($request['name']) || !isset($request['preset']) )
+                die('-1');
+
+        // Run only presets we recognize.
+        if ( 'pt' != $request['type'] || ! in_array( $request['preset'], array('all','search','recent') ) )
+                die('-1');
+        // Searches must have a search term.
+        else if ( 'search' == $request['preset'] &amp;&amp; !isset($request['title']) )
+                die('-1');
+
+        $opts = array();
+        if ( 'search' == $request['preset'] ) {
+                $opts['search'] = $request['title'];
+        } else if ( ! empty( $request['page'] ) ) {
+                $opts['pagenum'] = $request['page'];
+        }
+                
+        if ( 'pt' == $request['type'] &amp;&amp; $obj = get_post_type_object($request['name']) )
+                $resp = wp_link_query_post_type( $obj, $request['preset'], $opts );
+
+        if ( ! isset( $resp ) )
+                die('0');
+
+        $json = array( 'results' =&gt; $resp['results'] );
+        if ( isset( $resp['pages'] ) &amp;&amp; !empty( $resp['pages']['page_links'] ) )
+                $json['page_links'] = $resp['pages']['page_links'];
+        
+        echo json_encode( $json );
+        echo &quot;\n&quot;;
+}
+?&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjstinymcewpmcelinkphp"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/tinymce/wp-mce-link.php (0 => 15940)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/wp-mce-link.php                                (rev 0)
+++ trunk/wp-includes/js/tinymce/wp-mce-link.php        2010-10-24 02:58:42 UTC (rev 15940)
</span><span class="lines">@@ -0,0 +1,204 @@
</span><ins>+&lt;?php
+if ( ! defined('ABSPATH') )
+        die();
+include './wp-mce-link-includes.php';
+header('Content-Type: text/html; charset=' . get_bloginfo('charset'));
+?&gt;
+&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &lt;?php language_attributes(); ?&gt;&gt;
+&lt;head&gt;
+&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;&lt;?php bloginfo('html_type'); ?&gt;; charset=&lt;?php echo get_bloginfo('charset'); ?&gt;&quot; /&gt;
+&lt;title&gt;&lt;?php _e('Insert/edit link') ?&gt;&lt;/title&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+//&lt;![CDATA[
+var ajaxurl = '&lt;?php echo admin_url('admin-ajax.php'); ?&gt;',
+        wpLinkL10n = {
+                untitled : '&lt;?php _e('Untitled'); ?&gt;',
+                noMatchesFound : '&lt;?php _e('No matches found.'); ?&gt;'
+        };
+//]]&gt;
+&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;tiny_mce_popup.js?ver=3223&quot;&gt;&lt;/script&gt;
+&lt;?php
+wp_print_scripts( array('jquery', 'jquery-ui-widget') );
+?&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;plugins/wplink/js/wplink.js?ver=20101023&quot;&gt;&lt;/script&gt;
+&lt;?php
+wp_admin_css( 'global', true );
+wp_admin_css( 'wp-admin', true );
+register_admin_color_schemes();
+wp_admin_css( 'colors', true );
+?&gt;
+&lt;style&gt;
+html, body {
+        background: #f1f1f1;
+}
+
+a:link, a:visited {
+        color: #21759B;
+}
+
+select {
+        height: 2em;
+}
+
+#link-header,
+#link-options,
+#link-advanced-options {
+        padding: 5px;
+        border-bottom: 1px solid #dfdfdf;
+}
+#link-type {
+        width: 140px;
+}
+
+.link-panel {
+        padding: 5px 5px 0;
+        display: none;
+}
+        .link-panel-active {
+                display: block;
+        }
+
+label input[type=&quot;text&quot;] {
+        width: 220px;
+}
+        .wp-tab-panel label input[type=&quot;text&quot;] {
+                float: left;
+                width: 200px;
+        }
+
+label span {
+        display: inline-block;
+        width: 80px;
+        text-align: right;
+        padding-right: 5px;
+}
+        .wp-tab-panel label span {
+                width: auto;
+                text-align: left;
+                float: left;
+                margin-top: 3px;
+        }
+        .link-search-wrapper {
+                padding: 5px;
+                border-bottom: solid 1px #dfdfdf;
+                display: block;
+                overflow: hidden;
+        }
+                .link-search-wrapper img.waiting {
+                        margin: 4px 1px 0 4px;
+                        float: left;
+                        display: none;
+                }
+
+#open-in-new-tab {
+        padding-left: 87px;
+}
+        #open-in-new-tab span {
+                width: auto;
+                margin-left: 10px;
+                font-size: 11px;
+        }
+
+.submitbox {
+        padding: 5px;
+        font-size: 11px;
+        overflow: auto;
+        height: 29px;
+}
+#wp-cancel {
+        line-height: 25px;
+        float: left;
+}
+#wp-update {
+        line-height: 23px;
+        float: right;
+}
+#wp-update a {
+        display: inline-block;
+}
+.wp-tab-active,
+.wp-tab-panel {
+        background: #fff;
+}
+        .wp-tab-panel {
+                height: 160px;
+                padding: 0;
+        }
+.wp-tab-panel li {
+        margin-bottom: 0;
+        border-bottom: 1px solid #dfdfdf;
+        color: #555;
+        padding: 4px 6px;
+        cursor: pointer;
+}
+        .wp-tab-panel li:hover {
+                background: #EAF2FA;
+                color: #333;
+        }
+        .wp-tab-panel li.selected {
+                background: #f1f1f1;
+                font-weight: bold;
+                color: #333;
+        }
+.wp-tab-panel-pagelinks {
+        display: none;
+        padding:4px 0;
+        margin:0 auto;
+        text-align:center;
+}
+        .wp-tab-panel-pagelinks-top {
+                border-bottom: 1px solid #dfdfdf;
+        }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;?php
+
+$pts = get_post_types( array( 'public' =&gt; true ), 'objects' );
+$queries = array(
+        array( 'preset' =&gt; 'all', 'label' =&gt; __('View All') ),
+        array( 'preset' =&gt; 'recent', 'label' =&gt; __('Most Recent') ),
+        array( 'preset' =&gt; 'search', 'label' =&gt; __('Search') )
+);
+
+?&gt;
+&lt;body id=&quot;post-body&quot;&gt;
+&lt;div id=&quot;link-header&quot;&gt;
+        &lt;label for=&quot;link-type&quot;&gt;
+                &lt;span&gt;&lt;strong&gt;&lt;?php _e('Link Type:'); ?&gt;&lt;/strong&gt;
+                &lt;/span&gt;&lt;select id=&quot;link-type&quot;&gt;
+                        &lt;option id=&quot;link-option-id-custom&quot; class=&quot;link-custom&quot;&gt;&lt;?php _e('External Link'); ?&gt;&lt;/option&gt;
+                &lt;?php
+                foreach ( $pts as $pt ) {
+                        echo &quot;&lt;option id='link-option-id-pt-$pt-&gt;name' class='link-option-pt'&gt;&quot;;
+                        echo $pt-&gt;labels-&gt;singular_name . '&lt;/option&gt;';
+                } ?&gt;
+                &lt;/select&gt;
+        &lt;/label&gt;
+&lt;/div&gt;
+&lt;div id=&quot;link-selector&quot;&gt;
+        &lt;?php
+        wp_link_panel_custom();
+        foreach( $pts as $pt )
+                wp_link_panel_structure('pt', $pt-&gt;name, $queries);
+        ?&gt;
+        &lt;div id=&quot;link-options&quot;&gt;
+                &lt;label for=&quot;link-title-field&quot;&gt;
+                        &lt;span&gt;&lt;?php _e('Description:'); ?&gt;&lt;/span&gt;&lt;input id=&quot;link-title-field&quot; type=&quot;text&quot; /&gt;
+                &lt;/label&gt;
+                &lt;label for=&quot;link-target-checkbox&quot; id=&quot;open-in-new-tab&quot;&gt;
+                        &lt;input type=&quot;checkbox&quot; id=&quot;link-target-checkbox&quot; /&gt;&lt;span&gt;&lt;?php _e('Open in new tab'); ?&gt;&lt;/span&gt;
+                &lt;/label&gt;
+        &lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&quot;submitbox&quot;&gt;
+        &lt;div id=&quot;wp-cancel&quot;&gt;
+                &lt;a class=&quot;submitdelete deletion&quot;&gt;&lt;?php _e('Cancel'); ?&gt;&lt;/a&gt;
+        &lt;/div&gt;
+        &lt;div id=&quot;wp-update&quot;&gt;
+                &lt;a class=&quot;button-primary&quot;&gt;&lt;?php _e('Update'); ?&gt;&lt;/a&gt;
+        &lt;/div&gt;
+&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre>
</div>
</div>

</body>
</html>