Changeset 8128
- Timestamp:
- 06/19/2008 05:03:23 PM (17 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/press-this.css
r8113 r8128 450 450 padding-bottom: 2px; 451 451 } 452 453 #photo_directions { 454 margin-top: .25em; 455 display: block; 456 position: relative; 457 } 458 #photo_directions span { 459 display: block; 460 position: absolute; 461 top: 0; 462 right: 3px; 463 } 452 464 #photo_saving { 453 465 margin-bottom: 8px; … … 459 471 display: block; 460 472 } 473 474 #footer { 475 height: 65px; 476 display: block; 477 width: 640px; 478 padding: 10px 0 0 60px; 479 margin: 0; 480 position: absolute; 481 bottom: 0; 482 font-size: 12px; 483 } 484 485 #footer p { 486 margin: 0; 487 padding: 7px 0; 488 } 489 490 #footer p a { 491 text-decoration: none; 492 } 493 494 #footer p a:hover { 495 text-decoration: underline; -
trunk/wp-admin/press-this.php
r8113 r8128 80 80 <body class="press-this"> 81 81 <div id="message" class="updated fade"><p><strong><?php _e('Your post has been saved.'); ?></strong> <a onclick="window.opener.location.replace(this.href); window.close();" href="<?php echo get_permalink( $post_ID); ?>"><?php _e('View post'); ?></a> | <a href="post.php?action=edit&post=<?php echo $post_ID; ?>" onclick="window.opener.location.replace(this.href); window.close();"><?php _e('Edit post'); ?></a> | <a href="#" onclick="window.close();">Close Window</a></p></div> 82 83 <div id="footer"> 84 <p><?php 85 do_action('in_admin_footer', ''); 86 $upgrade = apply_filters( 'update_footer', '' ); 87 echo __('Thank you for creating with <a href="http://wordpress.org/">WordPress</a>'); 88 ?></p> 89 </div> 90 <?php do_action('admin_footer', ''); ?> 91 82 92 </body> 83 93 </html> … … 85 95 } 86 96 97 98 function aposfix($text) { 99 $translation_table[chr(34)] = '"'; 100 $translation_table[chr(38)] = '&'; 101 $translation_table[chr(39)] = '''; 102 return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($text, $translation_table)); 103 } 104 87 105 // Ajax Requests 88 106 $title = wp_specialchars(stripslashes($_GET['t'])); 89 $selection = trim(str_replace('\\n', "<br />", wp_specialchars(js_escape($_GET['s'])))); 107 108 $selection = str_replace("\n", "<br />", aposfix( stripslashes($_GET['s']) ) ); 90 109 $url = clean_url($_GET['u']); 91 110 $image = $_GET['i']; 111 92 112 if($_REQUEST['ajax'] == 'thickbox') { ?> 93 <script type="text/javascript" charset="utf-8">94 jQuery('.cancel').click(function() {95 tb_remove();96 });97 98 function image_selector() {99 desc = jQuery('#this_photo_description').val();100 src = jQuery('#this_photo').val();101 pick(src, desc);102 tb_remove();103 return false;104 }105 106 jQuery('.select').click(function() {107 image_selector();108 });109 </script>110 113 <h3 id="title"><label for="post_title"><?php _e('Description') ?></label></h3> 111 114 <div class="titlewrap"> … … 114 117 115 118 <p><input type="hidden" name="this_photo" value="<?php echo $image; ?>" id="this_photo" /> 116 <a href="#" class="select" rel="<?php echo $image; ?>"><img src="<?php echo $image; ?>" width="475" alt="Click to insert." title="Click to insert." /></a></p>117 118 <p id="options"><a href="#" class="select" rel="<?php echo $image; ?>">Insert Image</a> | <a href="#" class="cancel">Cancel</a></p>119 <a href="#" class="select"><img src="<?php echo $image; ?>" width="475" alt="Click to insert." title="Click to insert." /></a></p> 120 121 <p id="options"><a href="#" class="select">Insert Image</a> | <a href="#" class="cancel">Cancel</a></p> 119 122 <?php die; 120 123 } 121 124 125 if($_REQUEST['ajax'] == 'thickbox_url') { ?> 126 <h3 id="title"><label for="post_title"><?php _e('URL') ?></label></h3> 127 <div class="titlewrap"> 128 <input id="this_photo" name="this_photo" class="text" onkeypress="if(event.keyCode==13) image_selector();" /> 129 </div> 130 131 132 <h3 id="title"><label for="post_title"><?php _e('Description') ?></label></h3> 133 <div class="titlewrap"> 134 <input id="this_photo_description" name="photo_description" class="text" onkeypress="if(event.keyCode==13) image_selector();" value="<?php echo attribute_escape($title);?>"/> 135 </div> 136 137 <p id="options"><a href="#" class="select">Insert Image</a> | <a href="#" class="cancel">Cancel</a></p> 138 <?php die; 139 } 122 140 123 141 if($_REQUEST['ajax'] == 'video') { ?> … … 131 149 if($_REQUEST['ajax'] == 'photo_images') { 132 150 function get_images_from_uri($uri) { 133 if(preg_match('/\.(jpg|png|gif)/', $uri) )151 if(preg_match('/\.(jpg|png|gif)/', $uri) && !strpos($uri,'blogger.com')) 134 152 return "'".$uri."'"; 135 153 136 154 $content = wp_remote_fopen($uri); 137 155 if ( false === $content ) return ''; … … 164 182 165 183 if($_REQUEST['ajax'] == 'photo_js') { ?> 166 167 var last = null 184 185 tb_init('a.thickbox, area.thickbox, input.thickbox'); //pass where to apply thickbox 186 187 function image_selector() { 188 desc = jQuery('#this_photo_description').val(); 189 src = jQuery('#this_photo').val(); 190 pick(src, desc); 191 tb_remove(); 192 return false; 193 } 194 195 jQuery(document).ready(function() { 196 jQuery('#this_photo').focus(); 197 198 jQuery('.cancel').click(function() { 199 tb_remove(); 200 }); 201 202 jQuery('.select').click(function() { 203 image_selector(); 204 }); 205 206 jQuery('#photo_add_url').attr('href', '?ajax=thickbox_url&height=200&width=500'); 207 208 }); 209 168 210 169 211 function pick(img, desc) { … … 174 216 jQuery('.photolist').append('<input name="photo_description[' + length + ']" value="' + desc +'" type="hidden"/>'); 175 217 append_editor('<img src="' + img +'" alt="' + desc + '" />'); } 218 tinyMCE.activeEditor.resizeToContent(); 176 219 return false; 177 220 } 178 221 222 var last = null 179 223 var my_src, img, img_tag, aspect, w, h, skip, i, strtoappend = ""; 180 181 224 var my_src = eval( 182 225 jQuery.ajax({ … … 190 233 191 234 for (i = 0; i < my_src.length; i++) { 192 img = new Image(); 193 img.src = my_src[i]; 194 img_attr = 'id="img' + i; 195 skip = false; 235 img = new Image(); img.src = my_src[i]; img_attr = 'id="img' + i; skip = false; 196 236 197 237 if (img.width && img.height) { 198 if (img.width * img.height < 2500) skip = true; 238 if (img.width * img.height < 2500) 239 skip = true; 199 240 aspect = img.width / img.height; 200 241 scale = (aspect > 1) ? (75 / img.width) : (75 / img.height); … … 213 254 214 255 } 215 216 256 jQuery('#img_container').html(strtoappend); 217 218 tb_init('a.thickbox, area.thickbox, input.thickbox'); //pass where to apply thickbox219 257 220 258 <?php die; } … … 222 260 if($_REQUEST['ajax'] == 'photo') { ?> 223 261 <div class="photolist"></div> 224 <small><?php _e('Click images to select:') ?></small> 262 263 <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> 264 225 265 <div class="titlewrap"> 226 266 <div id="img_container"></div> … … 324 364 } 325 365 function set_title(title) { jQuery("#content_type").text(title); } 326 function reset_height() { 327 tinyMCE.height = '170px'; 328 } 366 329 367 function show(tab_name) { 330 368 jQuery('body').removeClass('video_split'); … … 332 370 switch(tab_name) { 333 371 case 'text' : 334 reset_height();335 jQuery('.editor-container').show();336 jQuery('#content_type').show();337 372 set_menu('text'); 338 set_title('<?php _e(' Text') ?>');373 set_title('<?php _e('Post') ?>'); 339 374 340 375 return false; 341 376 break; 342 377 case 'quote' : 343 reset_height();344 jQuery('.editor-container').show();345 jQuery('#content_type').show();346 378 set_menu('quote'); 347 379 set_title('<?php _e('Quote') ?>'); 348 set_editor("<blockquote><p><?php echo $selection; ?> </p><p><cite><a href='<?php echo $url; ?>'><?php echo $title; ?></a></cite> </p></blockquote>"); 349 380 set_editor("<blockquote><p><?php echo $selection; ?> </p><p><cite><a href='<?php echo $url; ?>'><?php echo $title; ?> </a> </cite> </p></blockquote>"); 350 381 return false; 351 382 break; 352 383 case 'video' : 353 reset_height(); 354 jQuery('.editor-container').show(); 355 jQuery('#content_type').show(); 384 356 385 set_menu('video'); 357 386 set_title('<?php _e('Caption') ?>'); … … 359 388 jQuery('#extra_fields').show(); 360 389 jQuery('body').addClass('video_split'); 361 362 363 390 jQuery('#extra_fields').load('<?php echo clean_url($_SERVER['PHP_SELF']); ?>', { ajax: 'video', s: '<?php echo attribute_escape($selection); ?>'}, function() { 364 391 … … 378 405 } ?> 379 406 jQuery('#embed_code').prepend('<?php echo htmlentities($content); ?>'); 407 380 408 set_editor("<?php echo $title; ?>"); 381 382 409 }); 383 384 410 385 411 return false; … … 387 413 388 414 case 'photo' : 389 reset_height();390 415 set_menu('photo'); 391 416 set_title('Post');
Note: See TracChangeset
for help on using the changeset viewer.