240
240
if(photostorage == false) {
241
241
var my_src = eval(
244
url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>",
244
url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>",
247
data: "ajax=photo_images&u=<?php echo urlencode($url); ?>",
247
data: "ajax=photo_images&u=<?php echo urlencode($url); ?>",
248
248
dataType : "script"
251
251
if(my_src.length == 0) {
252
252
var my_src = eval(
255
url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>",
255
url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>",
258
data: "ajax=photo_images&u=<?php echo urlencode($url); ?>",
258
data: "ajax=photo_images&u=<?php echo urlencode($url); ?>",
259
259
dataType : "script"
312
312
jQuery('#extra-fields').html('');
315
jQuery('#extra-fields').html('<div class="postbox"><h2>Add Photos <small id="photo_directions">(<?php _e("click images to select") ?>)</small></h2><ul class="actions"><li><a href="#" id="photo-add-url" class="thickbox button"><?php _e("Add from URL") ?> +</a></li></ul><div class="inside"><div class="titlewrap"><div id="img_container"></div></div><p id="options"><a href="#" class="close button"><?php _e('Cancel'); ?></a><a href="#" class="refresh button"><?php _e('Refresh'); ?></a></p></div>');
315
jQuery('#extra-fields').html('<div class="postbox"><h2><?php _e( 'Add Photos' ); ?> <small id="photo_directions">(<?php _e("click images to select") ?>)</small></h2><ul class="actions"><li><a href="#" id="photo-add-url" class="thickbox button"><?php _e("Add from URL") ?> +</a></li></ul><div class="inside"><div class="titlewrap"><div id="img_container"></div></div><p id="options"><a href="#" class="close button"><?php _e('Cancel'); ?></a><a href="#" class="refresh button"><?php _e('Refresh'); ?></a></p></div>');
316
316
jQuery('#img_container').html(strtoappend);
332
332
wp_enqueue_style( 'press-this-ie');
333
333
wp_enqueue_style( 'colors' );
334
334
wp_enqueue_script( 'post' );
335
wp_enqueue_script( 'editor' );
337
336
<script type="text/javascript">
347
346
do_action('admin_print_styles');
348
347
do_action('admin_print_scripts');
349
348
do_action('admin_head');
351
if ( user_can_richedit() ) {
352
wp_tiny_mce( true, array( 'height' => '370' ) );
353
add_action( 'admin_print_footer_scripts', 'wp_tiny_mce_preload_dialogs', 30 );
356
350
<script type="text/javascript">
357
351
function insert_plain_editor(text) {
372
366
function append_editor(text) {
373
367
if ( '' != text && tinyMCE.activeEditor && ! tinyMCE.activeEditor.isHidden()) {
374
368
tinyMCE.execCommand('mceSetContent', false, tinyMCE.activeEditor.getContent({format : 'raw'}) + '<p>' + text + '</p>');
375
tinyMCE.execCommand('mceCleanup');
377
370
insert_plain_editor(text);
420
413
jQuery('#photo-add-url').attr('href', '?ajax=photo_thickbox_url&height=200&width=500');
421
tb_init('#extra-fields .thickbox');
422
414
jQuery('#waiting').hide();
423
415
jQuery('#extra-fields').show();
450
442
window.resizeTo(720,540);
451
443
// set button actions
452
jQuery('#photo_button').click(function() { show('photo'); return false; });
444
jQuery('#photo_button').click(function() { show('photo'); return false; });
453
445
jQuery('#video_button').click(function() { show('video'); return false; });
455
447
<?php if ( preg_match("/youtube\.com\/watch/i", $url) ) { ?>
471
463
<body class="press-this wp-admin">
472
<div id="wphead"></div>
465
if ( user_can_richedit() ) {
466
wp_tiny_mce( true, array( 'height' => '370' ) );
473
469
<form action="press-this.php?action=post" method="post">
474
470
<div id="poststuff" class="metabox-holder">
475
471
<div id="side-info-column">
476
472
<div class="sleeve">
477
<h1 id="viewsite"><a href="<?php echo get_option('home'); ?>/" target="_blank"><?php bloginfo('name'); ?> › <?php _e('Press This') ?></a></span></h1>
479
473
<?php wp_nonce_field('press-this') ?>
480
474
<input type="hidden" name="post_type" id="post_type" value="text"/>
481
475
<input type="hidden" name="autosave" id="autosave" />
485
479
<!-- This div holds the photo metadata -->
486
480
<div class="photolist"></div>
488
<div id="submitdiv" class="stuffbox">
482
<div id="submitdiv" class="postbox">
483
<div class="handlediv" title="<?php _e( 'Click to toggle' ); ?>"><br /></div>
484
<h3 class="hndle"><?php _e('Press This') ?></h3>
489
485
<div class="inside">
486
<p id="publishing-actions">
492
488
submit_button( __( 'Save Draft' ), 'button', 'draft', false, array( 'id' => 'save' ) );
493
489
if ( current_user_can('publish_posts') ) {
585
581
<div class="tagchecklist"></div>
587
<p class="tagcloud-link"><a href="#titlediv" class="tagcloud-link" id="link-post_tag"><?php _e('Choose from the most used tags in Post Tags'); ?></a></p>
583
<p class="tagcloud-link"><a href="#titlediv" class="tagcloud-link" id="link-post_tag"><?php _e('Choose from the most used tags'); ?></a></p>
592
588
<div class="posting">
591
<img id="header-logo" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" alt="" width="16" height="16" />
592
<h1 id="site-heading">
593
<a href="<?php echo get_option('home'); ?>/" target="_blank">
594
<span id="site-title"><?php bloginfo('name'); ?></span>
593
599
<?php if ( isset($posted) && intval($posted) ) { $post_ID = intval($posted); ?>
594
600
<div id="message" class="updated"><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="<?php echo get_edit_post_link( $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>
603
609
<div id="extra-fields" style="display: none"></div>
605
611
<div class="postdivrich">
606
<ul id="actions" class="actions">
608
<li id="photo_button">
609
Add: <?php if ( current_user_can('upload_files') ) { ?><a title="<?php _e('Insert an Image'); ?>" href="#">
610
<img alt="<?php _e('Insert an Image'); ?>" src="<?php echo esc_url( admin_url( 'images/media-button-image.gif?ver=20100531' ) ); ?>"/></a>
613
<li id="video_button">
614
<a title="<?php _e('Embed a Video'); ?>" href="#"><img alt="<?php _e('Embed a Video'); ?>" src="<?php echo esc_url( admin_url( 'images/media-button-video.gif?ver=20100531' ) ); ?>"/></a>
616
<?php if ( user_can_richedit() ) { ?>
618
<?php wp_print_scripts( 'quicktags' ); ?>
619
<?php add_filter('the_editor_content', 'wp_richedit_pre'); ?>
612
<div id="editor-toolbar">
613
<?php if ( user_can_richedit() ) :
614
wp_print_scripts( 'quicktags' );
615
add_filter('the_editor_content', 'wp_richedit_pre'); ?>
620
616
<a id="edButtonHTML" onclick="switchEditors.go('content', 'html');"><?php _e('HTML'); ?></a>
621
617
<a id="edButtonPreview" class="active" onclick="switchEditors.go('content', 'tinymce');"><?php _e('Visual'); ?></a>
622
618
<div class="zerosize"><input accesskey="e" type="button" onclick="switchEditors.go('content')" /></div>
621
<div id="media-buttons">
625
if ( current_user_can('upload_files') ) : ?>
626
<a id="photo_button" title="<?php _e('Insert an Image'); ?>" href="#">
627
<img alt="<?php _e('Insert an Image'); ?>" src="<?php echo esc_url( admin_url( 'images/media-button-image.gif?ver=20100531' ) ); ?>"/></a><?php
629
?><a id="video_button" title="<?php _e('Embed a Video'); ?>" href="#"><img alt="<?php _e('Embed a Video'); ?>" src="<?php echo esc_url( admin_url( 'images/media-button-video.gif?ver=20100531' ) ); ?>"/></a>
626
632
<div id="quicktags"></div>
627
633
<div class="editor-container">
628
634
<textarea name="content" id="content" style="width:100%;" class="theEditor" rows="15"><?php