WordPress.org

Make WordPress Core

Changeset 8552


Ignore:
Timestamp:
08/05/2008 05:14:18 PM (10 years ago)
Author:
ryan
Message:

Press This: Fix image insert in IE7, set textarea height. Props noael and zamoose. fixes #7387 #7310 for 2.6

Location:
branches/2.6/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/wp-admin/css/press-this.css

    r8316 r8552  
    55    padding: 0px;
    66}
     7
     8img { border: 0; }
    79/* Tabs */
    810@media projection , screen {
  • branches/2.6/wp-admin/press-this.php

    r8477 r8552  
    185185        $host = parse_url($uri);
    186186
    187         $pattern = '/<img ([^>]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif)[^<>\'\"]*)(\2)([^>\/]*)\/*>/is';
     187        $pattern = '/<img ([^>]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif))[^<>\'\"]*(\2)([^>\/]*)\/*>/is';
    188188        preg_match_all($pattern, $content, $matches);
    189 
     189       
    190190        if ( empty($matches[1]) ) return '';
    191191
    192192        $sources = array();
    193193        foreach ($matches[3] as $src) {
     194            // if no http in url
    194195            if(strpos($src, 'http') === false)
    195                 if(strpos($src, '../') === false && strpos($src, './') === false)
     196                // if it doesn't have a relative uri
     197                if( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === true)
    196198                    $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src);
    197199                else
    198                     $src = 'http://'.str_replace('//','/', $host['host'].'/'.$host['path'].'/'.$src);
    199 
     200                    $src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src);
     201           
    200202            $sources[] = clean_url($src);
    201203        }
     
    248250
    249251    function pick(img, desc) {
    250         if (img) { 
    251             length = jQuery('.photolist input').length;
     252        if (img) {
     253            if('object' == typeof jQuery('.photolist input') && jQuery('.photolist input').length != 0) length = jQuery('.photolist input').length;
    252254            if(length == 0) length = 1;
    253255            jQuery('.photolist').append('<input name="photo_src[' + length + ']" value="' + img +'" type="hidden"/>');
    254256            jQuery('.photolist').append('<input name="photo_description[' + length + ']" value="' + desc +'" type="hidden"/>');
    255             append_editor("\n\n" + '<p><img src="' + img +'" alt="' + desc + '" /></p>');
     257            append_editor("\n\n" + '<p><img src="' + img +'" alt="' + desc + '" class="aligncenter"/></p>');
    256258        }
    257259        tinyMCE.activeEditor.resizeToContent();
     
    268270
    269271    jQuery(document).ready(function() {
     272        jQuery('#extra_fields').html('<div class="photolist"></div><small id="photo_directions"><?php _e("Click images to select:") ?> <span><a href="#" id="photo_add_url" class="thickbox"><?php _e("Add from URL") ?> +</a></span></small><div class="titlewrap"><div id="img_container"></div></div>');
    270273        jQuery('#img_container').html(strtoappend);
    271274        jQuery('#photo_add_url').attr('href', '?ajax=thickbox_url&height=200&width=500');
     
    277280
    278281if($_REQUEST['ajax'] == 'photo') { ?>
    279         <div class="photolist"></div>
    280 
    281         <small id="photo_directions"><?php _e('Click images to select:') ?> <span><a href="#" id="photo_add_url" class="thickbox"><?php _e('Add from URL') ?> +</a></span></small>
    282 
    283         <div class="titlewrap">
    284             <div id="img_container"></div>
    285         </div>
     282
    286283<?php die;
    287284}
     
    324321                language : "<?php echo $language; ?>",
    325322                width: "100%",
     323                height: "300",
    326324                theme : "advanced",
    327325                theme_advanced_buttons1 : "bold,italic,underline,blockquote,separator,strikethrough,bullist,numlist,undo,redo,link,unlink",
     
    447445                jQuery('#extra_fields').show();
    448446                jQuery('#extra_fields').before('<h2 id="waiting"><img src="images/loading.gif" alt="" /><?php echo js_escape( __( 'Loading...' ) ); ?></h2>');
    449                 jQuery('#extra_fields').load('<?php echo clean_url($_SERVER['PHP_SELF']).'?ajax=photo&u='.attribute_escape($url); ?>');
    450447                jQuery.ajax({
    451448                    type: "GET",
     
    474471        <?php } elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) { ?>
    475472            show('video');
    476             <?php  } elseif ( preg_match("/flickr\.com/i", $url) ) { ?>
     473        <?php  } elseif ( preg_match("/flickr\.com/i", $url) ) { ?>
    477474            show('photo');
    478475        <?php } ?>
     
    507504            <h2 id="content_type"><label for="content"><?php _e('Post') ?></label></h2>
    508505            <div class="editor-container">
    509                 <textarea name="content" id="content" style="width:100%;" class="mceEditor"><?php if ($selection) { echo wp_richedit_pre($selection); } ?><a href="<?php echo $url ?>"><?php echo $title; ?></a>.</textarea>
     506                <textarea name="content" id="content" style="width:100%;" class="mceEditor" rows="15"><?php if ($selection) { echo wp_richedit_pre($selection); } ?><a href="<?php echo $url ?>"><?php echo $title; ?></a>.</textarea>
    510507            </div>
    511508        </div>
Note: See TracChangeset for help on using the changeset viewer.