Changeset 8303
- Timestamp:
- 07/09/2008 09:39:36 PM (16 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/press-this.css
r8256 r8303 89 89 } 90 90 91 /* Header */ 91 92 #wphead { 92 93 border-top: none; 93 }94 95 .button {96 font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;97 padding: 3px 5px;98 font-size: 12px;99 line-height: 1.5em;100 border-width: 1px;101 border-style: solid;102 -moz-border-radius: 3px;103 -khtml-border-radius: 3px;104 -webkit-border-radius: 3px;105 border-radius: 3px;106 cursor: pointer;107 margin-left: 5px;108 text-decoration: none;109 }110 111 .howto {112 font-size: 11px;113 }114 #newtag { width: 60%; padding: 3px; }115 116 #wphead {117 94 height: 2em; 118 95 padding-top: 8px; 96 } 97 98 .button { 99 font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; 100 padding: 3px 5px; 101 font-size: 12px; 102 line-height: 1.5em; 103 border-width: 1px; 104 border-style: solid; 105 -moz-border-radius: 3px; 106 -khtml-border-radius: 3px; 107 -webkit-border-radius: 3px; 108 border-radius: 3px; 109 cursor: pointer; 110 margin-left: 5px; 111 text-decoration: none; 112 } 113 114 .howto { 115 font-size: 11px; 116 font-style: italic; 117 display: block; 119 118 } 120 119 … … 133 132 134 133 #wphead #viewsite a { 135 font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, 136 sans-serif; 134 font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; 137 135 padding: 3px 4px; 138 136 display: block; … … 174 172 } 175 173 174 /* Editor/Main Column */ 175 176 div#container { 177 margin: 0; 178 min-width: 500px; 179 } 180 181 div#container form { 182 margin: 0px; 183 padding: 0px; 184 } 185 186 div#posting { 187 padding-left: 16px; 188 position: absolute; 189 z-index: 1; 190 width: 66%; 191 } 192 193 #post_title { 194 width: 99%; 195 } 196 176 197 .titlewrap { 177 198 border-style: solid; … … 179 200 padding: 2px 3px; 180 201 border-color: #CCCCCC; 181 }182 183 div#container {184 margin: 0;185 min-width: 500px;186 }187 188 div#posting {189 padding-left: 16px;190 position: absolute;191 z-index: 1;192 width: 66%;193 202 } 194 203 … … 200 209 } 201 210 202 div#container form {203 margin: 0px;204 padding: 0px;205 }206 207 div#categories {208 font-size: 85%;209 position: absolute;210 top: 50px;211 right: 16px;212 width: 27%;213 z-index: 2;214 }215 216 div#categories h2 {217 color: #333;218 font-size: 12px;219 margin: .5em 0 0 1em;220 padding: 0;221 }222 223 #categories-all {224 overflow: auto;225 padding: 1em;226 height: 15em;227 }228 229 #categories ul {230 list-style: none;231 padding: 0;232 margin: 0;233 }234 235 211 .editor-container { 236 212 border-width: 1px; … … 240 216 } 241 217 242 #tagsdiv #newtag { 243 margin-right: 5px; 244 width: 16em; 245 } 246 247 #tagchecklist { 248 padding-left: 1em; 249 margin-bottom: 1em; 250 font-size: 12px; 251 overflow: auto; 252 } 253 254 #tagchecklist strong { 255 position: absolute; 256 font-size: .75em; 257 } 258 259 #tagchecklist span { 260 margin-right: .5em; 261 margin-left: 10px; 262 display: block; 263 float: left; 264 font-size: 11px; 265 line-height: 1.8em; 266 white-space: nowrap; 267 cursor: default; 268 } 269 270 #tagchecklist span a { 271 margin: 6px 0pt 0pt -9px; 272 cursor: pointer; 273 width: 10px; 274 height: 10px; 275 display: block; 276 float: left; 277 text-indent: -9999px; 278 overflow: hidden; 279 position: absolute; 280 } 281 282 .howto { 283 font-style: italic; 284 display: block; 285 } 286 287 #post_title { 288 width: 99%; 218 /* Photo Styles */ 219 220 #photo_directions { 221 margin-top: .25em; 222 display: block; 223 position: relative; 224 } 225 226 #photo_directions span { 227 display: block; 228 position: absolute; 229 top: 0; 230 right: 3px; 231 } 232 233 #photo_saving { 234 margin-bottom: 8px; 289 235 } 290 236 … … 301 247 float: left; 302 248 } 249 303 250 #img_container img { 304 251 width: 75px; … … 315 262 #img_container a:hover, #img_container a:active { 316 263 border: 2px solid #000; 264 } 265 266 /* Submit Column */ 267 268 div#categories { 269 font-size: 85%; 270 position: absolute; 271 top: 50px; 272 right: 16px; 273 width: 27%; 274 z-index: 2; 275 } 276 277 div#categories h2 { 278 color: #333; 279 font-size: 12px; 280 margin: .5em 0 .5em 1em; 281 padding: 0; 282 } 283 284 #categories-all { 285 overflow: auto; 286 padding: 0 1em 1em 1em; 287 height: 15em; 288 } 289 290 #categories ul { 291 list-style: none; 292 padding: 0; 293 margin: 0; 294 } 295 296 #tagsdiv #newtag { 297 padding: 3px; 298 margin-right: 5px; 299 width: 16em; 300 } 301 302 #jaxtag { 303 clear: both; 304 padding-left: 1em; 305 } 306 307 #tagchecklist { 308 padding-left: 1em; 309 margin-bottom: 1em; 310 font-size: 12px; 311 overflow: auto; 312 } 313 314 #tagchecklist strong { 315 position: absolute; 316 font-size: .75em; 317 } 318 319 #tagchecklist span { 320 margin-right: .5em; 321 margin-left: 10px; 322 display: block; 323 float: left; 324 font-size: 11px; 325 line-height: 1.8em; 326 white-space: nowrap; 327 cursor: default; 328 } 329 330 #tagchecklist span a { 331 margin: 6px 0pt 0pt -9px; 332 cursor: pointer; 333 width: 10px; 334 height: 10px; 335 display: block; 336 float: left; 337 text-indent: -9999px; 338 overflow: hidden; 339 position: absolute; 317 340 } 318 341 .submit { … … 364 387 } 365 388 366 .hidden { 367 display: none; 368 } 369 389 /* Video Styles */ 370 390 .video_split #extra_fields { 371 391 width: 27%; … … 384 404 } 385 405 386 #jaxtag {387 clear: both;388 padding-left: 1em;389 }390 391 406 .ac_results { 392 407 padding: 0; … … 414 429 } 415 430 416 417 431 .photolist { 418 display: none;432 display: none; 419 433 } 420 434 421 435 #extra_fields small { 422 display: block;423 margin-top: .5em;424 padding-bottom: .25em;436 display: block; 437 margin-top: .5em; 438 padding-bottom: .25em; 425 439 } 426 440 427 441 #TB_ajaxContent #options { 428 position: absolute;429 top: 20px;430 right: 25px;431 padding: 5px;442 position: absolute; 443 top: 20px; 444 right: 25px; 445 padding: 5px; 432 446 } 433 447 #TB_ajaxContent h3 { 434 margin-bottom: .25em;448 margin-bottom: .25em; 435 449 } 436 450 … … 462 476 } 463 477 464 #photo_directions {465 margin-top: .25em;466 display: block;467 position: relative;468 }469 #photo_directions span {470 display: block;471 position: absolute;472 top: 0;473 right: 3px;474 }475 #photo_saving {476 margin-bottom: 8px;477 }478 479 478 #post_status { 480 479 margin-left: 10px; … … 483 482 } 484 483 484 /* Footer */ 485 485 486 #footer { 486 487 height: 65px; … … 507 508 } 508 509 510 511 /* Utility Classes */ 509 512 .centered { 510 513 text-align: center; 511 514 } 515 516 .hidden { 517 display: none; 518 } -
trunk/wp-admin/press-this.php
r8302 r8303 2 2 require_once('admin.php'); 3 3 4 if ( ! current_user_can('publish_posts') ) wp_die( __( 'Cheatin’ uh?' )); ?> 5 6 <?php 4 if ( ! current_user_can('publish_posts') ) wp_die( __( 'Cheatin’ uh?' ) ); 7 5 8 6 function preg_quote2($string) { 9 7 return str_replace('/', '\/', preg_quote($string)); 8 } 9 function aposfix($text) { 10 $translation_table[chr(34)] = '"'; 11 $translation_table[chr(38)] = '&'; 12 $translation_table[chr(39)] = '''; 13 return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($text, $translation_table)); 10 14 } 11 15 function press_it() { … … 31 35 32 36 foreach($_REQUEST['photo_src'] as $key => $image) { 33 #quote for matching37 // escape quote for matching 34 38 $quoted = preg_quote2($image); 35 39 … … 51 55 break; 52 56 } 53 #set the post_content57 // set the post_content 54 58 $quick['post_content'] = str_replace('<br />', "\n", preg_replace('/<\/?p>/','',$content)); 55 59 56 #error handling for $post60 // error handling for $post 57 61 if ( is_wp_error($post_ID)) { 58 62 wp_die($id); 59 63 wp_delete_post($post_ID); 60 #error handling for media_sideload64 // error handling for media_sideload 61 65 } elseif ( is_wp_error($upload)) { 62 66 wp_die($upload); … … 69 73 } 70 74 71 #For submitted posts.75 // For submitted posts. 72 76 if ( 'post' == $_REQUEST['action'] ) { 73 77 check_admin_referer('press-this'); $post_ID = press_it(); ?> 74 75 78 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 76 79 <html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>> … … 89 92 ?> 90 93 </head> 91 <body class="press-this"> 92 93 <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();"><?php _e('Close Window'); ?></a></p></div> 94 94 <body class="press-this"> 95 <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();"><?php _e('Close Window'); ?></a></p></div> 95 96 <div id="footer"> 96 97 <p><?php … … 100 101 ?></p> 101 102 </div> 102 <?php do_action('admin_footer', ''); ?> 103 103 <?php do_action('admin_footer', ''); ?> 104 104 </body> 105 105 </html> 106 106 <?php die; 107 }108 109 110 function aposfix($text) {111 $translation_table[chr(34)] = '"';112 $translation_table[chr(38)] = '&';113 $translation_table[chr(39)] = ''';114 return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($text, $translation_table));115 107 } 116 108 … … 179 171 if($_REQUEST['ajax'] == 'photo_images') { 180 172 function get_images_from_uri($uri) { 181 if( preg_match('/\.(jpg|jpe|jpeg|png|gif)/', $uri) && !strpos($uri,'blogger.com'))173 if( preg_match('/\.(jpg|jpe|jpeg|png|gif)/', $uri) && !strpos($uri,'blogger.com') ) 182 174 return "'".$uri."'"; 183 175 … … 212 204 213 205 if($_REQUEST['ajax'] == 'photo_js') { ?> 214 215 216 206 // gather images and load some default JS 217 218 207 var last = null 219 208 var img, img_tag, aspect, w, h, skip, i, strtoappend = ""; … … 258 247 jQuery('.photolist').append('<input name="photo_src[' + length + ']" value="' + img +'" type="hidden"/>'); 259 248 jQuery('.photolist').append('<input name="photo_description[' + length + ']" value="' + desc +'" type="hidden"/>'); 260 append_editor( '<img src="' + img +'" alt="' + desc + '" />');249 append_editor("\n\n" + '<p><img src="' + img +'" alt="' + desc + '" /></p>'); 261 250 } 262 251 tinyMCE.activeEditor.resizeToContent(); … … 278 267 }); 279 268 280 <?php die; } 269 <?php die; 270 } 281 271 282 272 if($_REQUEST['ajax'] == 'photo') { ?> … … 288 278 <div id="img_container"></div> 289 279 </div> 290 <?php die; } 280 <?php die; 281 } 291 282 ?> 292 283 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> … … 378 369 379 370 function set_editor(text) { 380 381 371 if(tinyMCE.activeEditor) tinyMCE.activeEditor.setContent(''); 382 372 if(tinyMCE.activeEditor) tinyMCE.execCommand('mceInsertContent' ,false, text); … … 400 390 <?php } else { ?> 401 391 set_editor("<a href='<?php echo $url ?>'><?php echo $title; ?></a>"); 402 <? } ?>392 <?php } ?> 403 393 return false; 404 394 break; … … 412 402 set_menu('video'); 413 403 set_title('<?php _e('Caption') ?>'); 414 415 404 jQuery('#extra_fields').show(); 416 405 jQuery('body').addClass('video_split'); … … 418 407 <?php 419 408 if ( preg_match("/youtube\.com\/watch/i", $url) ) { 420 list($domain, $video_id) = split("v=", $url); 421 $content = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/' . $video_id . '"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/' . $video_id . '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>'; ?> 409 list($domain, $video_id) = split("v=", $url); 410 $content = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/' . $video_id . '"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/' . $video_id . '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>'; 411 412 } elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) { 413 list($domain, $video_id) = split(".com/", $url); 414 $content = '<object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /> <embed src="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object>'; 422 415 423 <?php } elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) { 424 425 list($domain, $video_id) = split(".com/", $url); 426 $content = '<object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /> <embed src="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object>'; 427 428 if ( trim($selection) == '' ) 429 $selection = '<a href="http://www.vimeo.com/' . $video_id . '?pg=embed&sec=' . $video_id . '">' . $title . '</a> on <a href="http://vimeo.com?pg=embed&sec=' . $video_id . '">Vimeo</a>'; 416 if ( trim($selection) == '' ) 417 $selection = '<a href="http://www.vimeo.com/' . $video_id . '?pg=embed&sec=' . $video_id . '">' . $title . '</a> on <a href="http://vimeo.com?pg=embed&sec=' . $video_id . '">Vimeo</a>'; 418 430 419 } else { 431 420 $content = $selection; 432 } ?> 421 } 422 423 ?> 433 424 jQuery('#embed_code').prepend('<?php echo htmlentities($content); ?>'); 434 425 … … 444 435 <?php } else { ?> 445 436 set_editor("<a href='<?php echo $url ?>'><?php echo $title; ?></a>"); 446 <? } ?>437 <?php } ?> 447 438 jQuery('#extra_fields').show(); 448 439 jQuery('#extra_fields').before('<h2 id="waiting"><img src="images/loading.gif" alt="" /><?php echo js_escape( __( 'Loading...' ) ); ?></h2>'); … … 469 460 show(tab_name); 470 461 }); 471 472 462 // Set default tabs 473 463 <?php if ( preg_match("/youtube\.com\/watch/i", $url) ) { ?> … … 479 469 <?php } ?> 480 470 }); 481 471 482 472 </script> 483 473 </head>
Note: See TracChangeset
for help on using the changeset viewer.