Make WordPress Core

Changeset 18570


Ignore:
Timestamp:
08/19/2011 01:14:56 AM (15 years ago)
Author:
azaozz
Message:

Fix Press This editors, see #17144

Location:
trunk
Files:
6 edited

Legend:

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

    r18406 r18570  
    1 body{font-size:13px;font-family:sans-serif;color:#333;margin:0;padding:0;min-width:675px;min-height:400px;}img{border:none;}#wphead{height:32px;margin-right:5px;margin-bottom:5px;}#header-logo{float:left;margin:7px 7px 0;-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;user-select:none;}#wphead h1{font:normal 16px Georgia,"Times New Roman","Bitstream Charter",Times,serif;padding:6px 0 0;margin:0;float:left;}#wphead h1 a{text-decoration:none;}#wphead h1 a:hover{text-decoration:underline;}.tagchecklist span a{background:transparent url(../images/xit.gif) no-repeat 0 0;}#edButtonPreview,#edButtonHTML{height:18px;margin:5px 5px 0 0;padding:4px 5px 2px;float:right;cursor:pointer;border-width:1px;border-style:solid;-moz-border-radius:3px 3px 0 0;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;}#poststuff #edButtonHTML{margin-right:15px;}#media-buttons{cursor:default;padding:8px 8px 0;}#media-buttons a{cursor:pointer;padding:0 0 5px 10px;}#media-buttons img,#submitpost #ajax-loading,#submitpost .ajax-loading{vertical-align:middle;}.howto{margin-top:2px;margin-bottom:3px;font-size:12px;font-style:italic;display:block;}input.text{outline-color:-moz-use-text-color;outline-style:none;outline-width:medium;width:100%;}#message{-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}div#poststuff{margin:0 10px 10px;}#poststuff #editor-toolbar{height:30px;}div.zerosize{border:0 none;height:0;margin:0;overflow:hidden;padding:0;width:0;}.posting{margin-right:212px;position:relative;}#side-info-column{float:right;width:200px;position:relative;right:0;}#side-info-column .sleeve{padding-top:5px;}#poststuff .inside{font-size:12px;margin:8px;}#submitdiv .inside{margin:0;}#submitdiv .inside p{padding:5px 8px;margin:0;}#submitdiv #publishing-actions{padding-left:6px;border-bottom:1px solid #dfdfdf;-webkit-box-shadow:0 1px 0 #fff;-moz-box-shadow:0 1px 0 #fff;box-shadow:0 1px 0 #fff;}#publish{float:right;}#poststuff h2,#poststuff h3{font-size:13px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-weight:normal;line-height:1;margin:0;padding:7px 9px;border-width:0 0 1px 0;border-style:solid;}#poststuff h2{border-color:#dfdfdf;}#tagsdiv-post_tag h3,#categorydiv h3{cursor:pointer;}h3.tb{text-shadow:0 1px 0 #fff;font-weight:bold;font-size:12px;margin-left:5px;}#TB_window{border:1px solid #333;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.postbox,.stuffbox{margin-bottom:10px;border-width:1px;border-style:solid;line-height:1;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.postbox:hover .handlediv,.stuffbox:hover .handlediv{background:transparent url(../images/arrows.png) no-repeat 6px 7px;}.postbox .handlediv{float:right;width:27px;height:30px;cursor:pointer;}#title,.tbtitle{font-family:sans-serif;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border-style:solid;border-width:1px;font-size:1.7em;outline:none;padding:3px 4px;border-color:#dfdfdf;}.tbtitle{font-size:12px;padding:3px;}#title{width:97%;}.editor-container{-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:1px solid #ccc;background-color:#fff;}.actions{float:right;margin:-19px 0 0;}#extra-fields .actions{margin:-23px -7px 0 0;}.actions li{float:left;list-style:none;margin-right:10px;}#extra-fields .button{margin-right:5px;padding:3px 6px;border-radius:10px;-webkit-border-radius:10px;-khtml-border-radius:10px;-moz-border-radius:10px;}#photo_saving{margin:0 8px 8px;vertical-align:middle;}#img_container_container{overflow:auto;}#extra-fields{margin-top:10px;position:relative;}#waiting{margin-top:10px;}#extra-fields .postbox{margin-bottom:5px;}#extra-fields .titlewrap{padding:0;overflow:auto;height:100px;}#img_container a{display:block;float:left;overflow:hidden;vertical-align:center;}#img_container img,#img_container a{width:68px;height:68px;}#img_container img{border:none;background-color:#f4f4f4;cursor:pointer;}#img_container a,#img_container a:link,#img_container a:visited{border:1px solid #ccc;display:block;position:relative;}#img_container a:hover,#img_container a:active{border-color:#000;z-index:1000;border-width:2px;margin:-1px;}#embed-code{width:100%;height:98px;}.wp-hidden-children .wp-hidden-child{display:none;}.category-add input{width:94%;font-family:sans-serif;font-size:12px;margin:1px;}select{width:100%;-x-system-font:none;border-style:solid;border-width:1px;font-family:sans-serif;font-size:12px;height:2em;line-height:20px;padding:2px;margin:1px;vertical-align:top;}.category-add input.category-add-sumbit{width:auto;}.categorydiv div.tabs-panel,#linkcategorydiv div.tabs-panel{height:100px;overflow:auto;padding:.5em .9em;border-style:solid;border-width:1px;}.category-tabs li{display:inline;padding-right:8px;}.category-tabs a{text-decoration:none;}.categorydiv ul,#linkcategorydiv ul{list-style:none;padding:0;margin:0;}.inline-editor ul.cat-checklist ul,.categorydiv ul.categorychecklist ul,#linkcategorydiv ul.categorychecklist ul{margin-left:18px;}ul.categorychecklist li{margin:0;padding:0;line-height:19px;}.categorydiv .tabs-panel{border-width:3px;border-style:solid;}ul.category-tabs{margin-top:12px;margin-bottom:5px;}ul.category-tabs li.tabs{border-style:solid solid none;border-width:1px 1px 0;}ul.category-tabs li{padding:5px 8px;-moz-border-radius:3px 3px 0 0;-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px;}.screen-reader-text{display:none;}.tagsdiv .newtag{margin-right:5px;}.jaxtag{clear:both;margin:0;}.tagadd{margin-left:3px;}.tagchecklist{margin-top:3px;margin-bottom:1em;font-size:12px;overflow:auto;}.tagchecklist strong{position:absolute;font-size:.75em;}.tagchecklist span{margin-right:.5em;margin-left:10px;display:block;float:left;font-size:12px;line-height:1.8em;white-space:nowrap;cursor:default;}.tagchecklist span a{margin:6px 0 0 -9px;cursor:pointer;width:10px;height:10px;display:block;float:left;text-indent:-9999px;overflow:hidden;position:absolute;}#content{margin:5px 0;padding:0 5px;border:0 none;height:365px;width:97%!important;font-family:Consolas,Monaco,monospace;font-size:13px;line-height:19px;background:transparent;}* html .postdivrich{zoom:1;}#saving{display:inline;vertical-align:middle;}.submit input,.button,.button-primary,.button-secondary,.button-highlighted,#postcustomstuff .submit input{font-family:sans-serif;text-decoration:none;font-size:12px!important;line-height:16px;padding:2px 8px;margin:2px;cursor:pointer;border-width:1px;border-style:solid;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;}.button-primary{background:#21759B url(../images/button-grad.png) repeat-x scroll left top;border-color:#21759B;color:#fff;}.ac_results{padding:0;margin:0;list-style:none;position:absolute;z-index:10000;display:none;border-width:1px;border-style:solid;}.ac_results li{padding:2px 5px;white-space:nowrap;text-align:left;}.ac_over{cursor:pointer;}.ac_match{text-decoration:underline;}#TB_ajaxContent #options{position:absolute;top:20px;right:25px;padding:5px;}#TB_ajaxContent h3{margin-bottom:.25em;}.updated{margin:10px 0;padding:0;border-width:1px;border-style:solid;width:99%;}.updated p,.error p{margin:.6em 0;padding:0 .6em;}.error a{text-decoration:underline;}.updated a{text-decoration:none;padding-bottom:2px;}#post_status{margin-left:10px;margin-bottom:1em;display:block;}#footer{height:65px;display:block;width:640px;padding:10px 0 0 60px;margin:0;position:absolute;bottom:0;font-size:12px;}#footer p{margin:0;padding:7px 0;}#footer p a{text-decoration:none;}#footer p a:hover{text-decoration:underline;}.centered{text-align:center;}.hidden{display:none;}.postbox input[type="text"],.postbox textarea,.stuffbox input[type="text"],.stuffbox textarea{border-width:1px;border-style:solid;}.taghint{color:#aaa;margin:-17px 0 0 7px;visibility:hidden;}input.newtag ~ div.taghint{visibility:visible;}input.newtag:focus ~ div.taghint{visibility:hidden;}#mce_fullscreen_container{background:#fff;}
     1body{font-size:13px;font-family:sans-serif;color:#333;margin:0;padding:0;min-width:675px;min-height:400px;}img{border:none;}#wphead{height:32px;margin-right:5px;margin-bottom:5px;}#header-logo{float:left;margin:7px 7px 0;-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;user-select:none;}#wphead h1{font:normal 16px Georgia,"Times New Roman","Bitstream Charter",Times,serif;padding:6px 0 0;margin:0;float:left;}#wphead h1 a{text-decoration:none;}#wphead h1 a:hover{text-decoration:underline;}.tagchecklist span a{background:transparent url(../images/xit.gif) no-repeat 0 0;}#edButtonPreview,#edButtonHTML{height:18px;margin:5px 5px 0 0;padding:4px 5px 2px;float:right;cursor:pointer;border-width:1px;border-style:solid;-moz-border-radius:3px 3px 0 0;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;}#poststuff #edButtonHTML{margin-right:15px;}#media-buttons{cursor:default;padding:8px 8px 0;}#media-buttons a{cursor:pointer;padding:0 0 5px 10px;}#media-buttons img,#submitpost #ajax-loading,#submitpost .ajax-loading{vertical-align:middle;}.howto{margin-top:2px;margin-bottom:3px;font-size:12px;font-style:italic;display:block;}input.text{outline-color:-moz-use-text-color;outline-style:none;outline-width:medium;width:100%;}#message{-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}div#poststuff{margin:0 10px 10px;}#poststuff #editor-toolbar{height:30px;}div.zerosize{border:0 none;height:0;margin:0;overflow:hidden;padding:0;width:0;}.posting{margin-right:212px;position:relative;}#side-info-column{float:right;width:200px;position:relative;right:0;}#side-info-column .sleeve{padding-top:5px;}#poststuff .inside{font-size:12px;margin:8px;}#submitdiv .inside{margin:0;}#submitdiv .inside p{padding:5px 8px;margin:0;}#submitdiv #publishing-actions{padding-left:6px;border-bottom:1px solid #dfdfdf;-webkit-box-shadow:0 1px 0 #fff;-moz-box-shadow:0 1px 0 #fff;box-shadow:0 1px 0 #fff;}#publish{float:right;}#poststuff h2,#poststuff h3{font-size:13px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-weight:normal;line-height:1;margin:0;padding:7px 9px;border-width:0 0 1px 0;border-style:solid;}#poststuff h2{border-color:#dfdfdf;}#tagsdiv-post_tag h3,#categorydiv h3{cursor:pointer;}h3.tb{text-shadow:0 1px 0 #fff;font-weight:bold;font-size:12px;margin-left:5px;}#TB_window{border:1px solid #333;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.postbox,.stuffbox{margin-bottom:10px;border-width:1px;border-style:solid;line-height:1;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.postbox:hover .handlediv,.stuffbox:hover .handlediv{background:transparent url(../images/arrows.png) no-repeat 6px 7px;}.postbox .handlediv{float:right;width:27px;height:30px;cursor:pointer;}#title,.tbtitle{font-family:sans-serif;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border-style:solid;border-width:1px;font-size:1.7em;outline:none;padding:3px 4px;border-color:#dfdfdf;}.tbtitle{font-size:12px;padding:3px;}#title{width:97%;}.editor-container{-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:1px solid #ccc;background-color:#fff;}.actions{float:right;margin:-19px 0 0;}#extra-fields .actions{margin:-23px -7px 0 0;}.actions li{float:left;list-style:none;margin-right:10px;}#extra-fields .button{margin-right:5px;padding:3px 6px;border-radius:10px;-webkit-border-radius:10px;-khtml-border-radius:10px;-moz-border-radius:10px;}#photo_saving{margin:0 8px 8px;vertical-align:middle;}#img_container_container{overflow:auto;}#extra-fields{margin-top:10px;position:relative;}#waiting{margin-top:10px;}#extra-fields .postbox{margin-bottom:5px;}#extra-fields .titlewrap{padding:0;overflow:auto;height:100px;}#img_container a{display:block;float:left;overflow:hidden;vertical-align:center;}#img_container img,#img_container a{width:68px;height:68px;}#img_container img{border:none;background-color:#f4f4f4;cursor:pointer;}#img_container a,#img_container a:link,#img_container a:visited{border:1px solid #ccc;display:block;position:relative;}#img_container a:hover,#img_container a:active{border-color:#000;z-index:1000;border-width:2px;margin:-1px;}#embed-code{width:100%;height:98px;}.wp-hidden-children .wp-hidden-child{display:none;}.category-add input{width:94%;font-family:sans-serif;font-size:12px;margin:1px;}select{width:100%;-x-system-font:none;border-style:solid;border-width:1px;font-family:sans-serif;font-size:12px;height:2em;line-height:20px;padding:2px;margin:1px;vertical-align:top;}.category-add input.category-add-sumbit{width:auto;}.categorydiv div.tabs-panel,#linkcategorydiv div.tabs-panel{height:100px;overflow:auto;padding:.5em .9em;border-style:solid;border-width:1px;}.category-tabs li{display:inline;padding-right:8px;}.category-tabs a{text-decoration:none;}.categorydiv ul,#linkcategorydiv ul{list-style:none;padding:0;margin:0;}.inline-editor ul.cat-checklist ul,.categorydiv ul.categorychecklist ul,#linkcategorydiv ul.categorychecklist ul{margin-left:18px;}ul.categorychecklist li{margin:0;padding:0;line-height:19px;}.categorydiv .tabs-panel{border-width:3px;border-style:solid;}ul.category-tabs{margin-top:12px;margin-bottom:5px;}ul.category-tabs li.tabs{border-style:solid solid none;border-width:1px 1px 0;}ul.category-tabs li{padding:5px 8px;-moz-border-radius:3px 3px 0 0;-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px;}.screen-reader-text{display:none;}.tagsdiv .newtag{margin-right:5px;}.jaxtag{clear:both;margin:0;}.tagadd{margin-left:3px;}.tagchecklist{margin-top:3px;margin-bottom:1em;font-size:12px;overflow:auto;}.tagchecklist strong{position:absolute;font-size:.75em;}.tagchecklist span{margin-right:.5em;margin-left:10px;display:block;float:left;font-size:12px;line-height:1.8em;white-space:nowrap;cursor:default;}.tagchecklist span a{margin:6px 0 0 -9px;cursor:pointer;width:10px;height:10px;display:block;float:left;text-indent:-9999px;overflow:hidden;position:absolute;}#content{margin:5px 0;padding:0 5px;border:0 none;height:357px;font-family:Consolas,Monaco,monospace;font-size:13px;line-height:19px;background:transparent;}#saving{display:inline;vertical-align:middle;}.submit input,.button,.button-primary,.button-secondary,.button-highlighted,#postcustomstuff .submit input{font-family:sans-serif;text-decoration:none;font-size:12px!important;line-height:16px;padding:2px 8px;margin:2px;cursor:pointer;border-width:1px;border-style:solid;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;}.button-primary{background:#21759B url(../images/button-grad.png) repeat-x scroll left top;border-color:#21759B;color:#fff;}.ac_results{padding:0;margin:0;list-style:none;position:absolute;z-index:10000;display:none;border-width:1px;border-style:solid;}.ac_results li{padding:2px 5px;white-space:nowrap;text-align:left;}.ac_over{cursor:pointer;}.ac_match{text-decoration:underline;}#TB_ajaxContent #options{position:absolute;top:20px;right:25px;padding:5px;}#TB_ajaxContent h3{margin-bottom:.25em;}.updated{margin:10px 0;padding:0;border-width:1px;border-style:solid;width:99%;}.updated p,.error p{margin:.6em 0;padding:0 .6em;}.error a{text-decoration:underline;}.updated a{text-decoration:none;padding-bottom:2px;}#post_status{margin-left:10px;margin-bottom:1em;display:block;}#footer{height:65px;display:block;width:640px;padding:10px 0 0 60px;margin:0;position:absolute;bottom:0;font-size:12px;}#footer p{margin:0;padding:7px 0;}#footer p a{text-decoration:none;}#footer p a:hover{text-decoration:underline;}.centered{text-align:center;}.hidden{display:none;}.postbox input[type="text"],.postbox textarea,.stuffbox input[type="text"],.stuffbox textarea{border-width:1px;border-style:solid;}.taghint{color:#aaa;margin:-17px 0 0 7px;visibility:hidden;}input.newtag ~ div.taghint{visibility:visible;}input.newtag:focus ~ div.taghint{visibility:hidden;}#mce_fullscreen_container{background:#fff;}#photo-add-url-div input[type="text"]{width:300px;}
  • trunk/wp-admin/css/press-this.dev.css

    r18406 r18570  
    506506        padding: 0 5px;
    507507        border: 0 none;
    508         height: 365px;
    509         width: 97% !important;
     508        height: 357px;
    510509        font-family: Consolas, Monaco, monospace;
    511510        font-size: 13px;
    512511        line-height: 19px;
    513512        background: transparent;
    514 }
    515 
    516 * html .postdivrich {
    517         zoom: 1;
    518513}
    519514
     
    677672        background: #fff;
    678673}
     674
     675#photo-add-url-div input[type="text"] {
     676        width: 300px;
     677}
     678
  • trunk/wp-admin/edit-form-advanced.php

    r18498 r18570  
    267267<div id="postdivrich" class="postarea">
    268268
    269 <?php wp_editor($post->post_content, 'content'); ?>
     269<?php wp_editor($post->post_content, 'content', array('dfw' => true) ); ?>
    270270
    271271<table id="post-status-info" cellspacing="0"><tbody><tr>
  • trunk/wp-admin/press-this.php

    r18530 r18570  
    2727 */
    2828function press_it() {
    29         // define some basic variables
    30         $quick = array();
    31         $quick['post_status'] = 'draft'; // set as draft first
    32         $quick['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : null;
    33         $quick['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : null;
    34         $quick['post_title'] = ( trim($_POST['title']) != '' ) ? $_POST['title'] : '  ';
    35         $quick['post_content'] = isset($_POST['post_content']) ? $_POST['post_content'] : '';
    36 
    37         // insert the post with nothing in it, to get an ID
    38         $post_ID = wp_insert_post($quick, true);
    39         if ( is_wp_error($post_ID) )
    40                 wp_die($post_ID);
    41 
    42         $content = isset($_POST['content']) ? $_POST['content'] : '';
     29
     30        $post = get_default_post_to_edit('post', true);
     31        $post_ID = $post['ID'];
     32        $post['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : null;
     33        $post['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : null;
     34        $post['post_title'] = isset($_POST['title']) ? $_POST['title'] : '';
     35        $post['post_content'] = isset($_POST['post_content']) ? $_POST['post_content'] : '';
    4336
    4437        $upload = false;
     
    5851        // set the post_content and status
    5952        if ( isset( $_POST['publish'] ) && current_user_can( 'publish_posts' ) )
    60                 $quick['post_status'] = 'publish';
     53                $post['post_status'] = 'publish';
    6154        elseif ( isset( $_POST['review'] ) )
    62                 $quick['post_status'] = 'pending';
     55                $post['post_status'] = 'pending';
    6356        else
    64                 $quick['post_status'] = 'draft';
    65         $quick['post_content'] = $content;
     57                $post['post_status'] = 'draft';
     58
    6659        // error handling for media_sideload
    6760        if ( is_wp_error($upload) ) {
     
    8174                }
    8275
    83                 $quick['ID'] = $post_ID;
    84                 wp_update_post($quick);
     76                wp_update_post($post);
    8577        }
     78
    8679        return $post_ID;
    8780}
     
    9083if ( isset($_REQUEST['action']) && 'post' == $_REQUEST['action'] ) {
    9184        check_admin_referer('press-this');
    92         $post_ID = press_it();
    93         $posted =  $post_ID;
     85        $posted = $post_ID = press_it();
    9486} else {
    9587        $post_ID = 0;
     
    164156
    165157                        <p id="options"><a href="#" class="select button"><?php _e('Insert Image'); ?></a> <a href="#" class="cancel button"><?php _e('Cancel'); ?></a></p>
    166                         <?php break;
    167 
    168                 case 'photo_thickbox_url': ?>
    169                         <script type="text/javascript" charset="utf-8">
    170                                 /* <![CDATA[ */
    171                                 jQuery('.cancel').click(function() {
    172                                         tb_remove();
    173                                 });
    174 
    175                                 jQuery('.select').click(function() {
    176                                         image_selector();
    177                                 });
    178                                 /* ]]> */
    179                         </script>
    180                         <h3 class="tb"><label for="this_photo"><?php _e('URL') ?></label></h3>
    181                         <div class="titlediv">
    182                                 <div class="titlewrap">
    183                                         <input id="this_photo" name="this_photo" class="tbtitle text" onkeypress="if(event.keyCode==13) image_selector();" />
    184                                 </div>
    185                         </div>
    186                         <h3 class="tb"><label for="photo_description"><?php _e('Description') ?></label></h3>
    187                         <div id="titlediv">
    188                                 <div class="titlewrap">
    189                                         <input id="this_photo_description" name="photo_description" class="tbtitle text" onkeypress="if(event.keyCode==13) image_selector();" value="<?php echo esc_attr($title);?>"/>
    190                                 </div>
    191                         </div>
    192 
    193                         <p id="options"><a href="#" class="select"><?php _e('Insert Image'); ?></a> | <a href="#" class="cancel"><?php _e('Cancel'); ?></a></p>
    194158                        <?php break;
    195159        case 'photo_images':
     
    313277                        return false;
    314278                }
    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>');
     279                        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="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>');
    316280                        jQuery('#img_container').html(strtoappend);
    317281                <?php break;
     
    328292
    329293<?php
    330         add_thickbox();
    331294        wp_enqueue_style( 'press-this' );
    332295        wp_enqueue_style( 'press-this-ie');
     
    350313        <script type="text/javascript">
    351314        function insert_plain_editor(text) {
    352                 edCanvas = document.getElementById('content');
    353                 edInsertContent(edCanvas, text);
     315                edInsertContent(text);
    354316        }
    355317        function set_editor(text) {
     
    411373                                                show('photo');
    412374                                        });
    413                                         jQuery('#photo-add-url').attr('href', '?ajax=photo_thickbox_url&height=200&width=500');
     375                                        jQuery('#photo-add-url').click(function(){
     376                                                var form = jQuery('#photo-add-url-div').clone();
     377                                                jQuery('#img_container').empty().append( form.show() );
     378                                        });
    414379                                        jQuery('#waiting').hide();
    415380                                        jQuery('#extra-fields').show();
     
    440405        jQuery(document).ready(function($) {
    441406                //resize screen
    442                 window.resizeTo(720,540);
     407                window.resizeTo(720,580);
    443408                // set button actions
    444409                jQuery('#photo_button').click(function() { show('photo'); return false; });
     
    462427</head>
    463428<body class="press-this wp-admin">
    464 <?php
    465 if ( user_can_richedit() ) {
    466         wp_tiny_mce( true, array( 'height' => '370' ) );
    467 }
    468 ?>
    469429<form action="press-this.php?action=post" method="post">
    470430<div id="poststuff" class="metabox-holder">
     
    565525
    566526                        <div id="tagsdiv-post_tag" class="postbox">
    567                                 <div class="handlediv" title="<?php _e( 'Click to toggle' ); ?>">
    568                                         <br/>
    569                                 </div>
     527                                <div class="handlediv" title="<?php _e( 'Click to toggle' ); ?>"><br /></div>
    570528                                <h3><span><?php _e('Post Tags'); ?></span></h3>
    571529                                <div class="inside">
     
    597555                </div>
    598556
    599                 <?php if ( isset($posted) && intval($posted) ) { $post_ID = intval($posted); ?>
    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>
     557                <?php
     558                if ( isset($posted) && intval($posted) ) {
     559                        $post_ID = intval($posted); ?>
     560                        <div id="message" class="updated">
     561                        <p><strong><?php _e('Your post has been saved.'); ?></strong>
     562                        <a onclick="window.opener.location.replace(this.href); window.close();" href="<?php echo get_permalink($post_ID); ?>"><?php _e('View post'); ?></a>
     563                        | <a href="<?php echo get_edit_post_link( $post_ID ); ?>" onclick="window.opener.location.replace(this.href); window.close();"><?php _e('Edit Post'); ?></a>
     564                        | <a href="#" onclick="window.close();"><?php _e('Close Window'); ?></a></p>
     565                        </div>
    601566                <?php } ?>
    602567
     
    610575
    611576                <div class="postdivrich">
    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'); ?>
    616                                         <a id="edButtonHTML" onclick="switchEditors.go('content', 'html');"><?php _e('HTML'); ?></a>
    617                                         <a id="edButtonPreview" class="active" onclick="switchEditors.go('content', 'tinymce');"><?php _e('Visual'); ?></a>
    618                                         <div class="zerosize"><input accesskey="e" type="button" onclick="switchEditors.go('content')" /></div>
    619                                 <?php endif; ?>
    620 
    621                                 <div id="media-buttons">
    622                                         <?php
    623                                         _e( 'Add:' );
    624 
    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
    628                                         endif;
    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>
    630                                 </div>
    631                         </div>
    632                         <div id="quicktags"></div>
    633                         <div class="editor-container">
    634                                 <textarea name="content" id="content" style="width:100%;" class="theEditor" rows="15"><?php
    635                                         if ( $selection )
    636                                                 echo wp_richedit_pre($selection);
    637                                         if ( $url ) {
    638                                                 echo '<p>';
    639                                                 if ( $selection )
    640                                                         _e('via ');
    641                                                 printf( "<a href='%s'>%s</a>.</p>", esc_url( $url ), esc_html( $title ) );
    642                                         }
    643                                 ?></textarea>
    644                         </div>
     577                <?php
     578
     579                $editor_settings = array(
     580                        'teeny' => true,
     581                        'textarea_rows' => '15'
     582                );
     583
     584                $content = '';
     585                if ( $selection )
     586                        $content .=  $selection;
     587
     588                if ( $url ) {
     589                        $content .= '<p>';
     590                       
     591                        if ( $selection )
     592                                $content .= __('via ');
     593                       
     594                        $content .= sprintf( "<a href='%s'>%s</a>.</p>", esc_url( $url ), esc_html( $title ) );
     595                }
     596
     597                remove_action( 'media_buttons', 'media_buttons' );
     598                add_action( 'media_buttons', 'press_this_media_buttons' );
     599                function press_this_media_buttons() {
     600                        _e( 'Add:' );
     601
     602                        if ( current_user_can('upload_files') ) {
     603                                ?>
     604                                <a id="photo_button" title="<?php _e('Insert an Image'); ?>" href="#">
     605                                <img alt="<?php _e('Insert an Image'); ?>" src="<?php echo esc_url( admin_url( 'images/media-button-image.gif?ver=20100531' ) ); ?>"/></a>
     606                                <?php
     607                        }
     608                        ?>
     609                        <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>
     610                        <?php
     611                }
     612
     613                wp_editor( $content, 'content', $editor_settings );
     614               
     615                ?>
    645616                </div>
    646617        </div>
    647618</div>
    648619</form>
    649 <?php do_action('admin_print_footer_scripts'); ?>
     620<div id="photo-add-url-div" style="display:none;">
     621        <table><tr>
     622        <td><label for="this_photo"><?php _e('URL') ?></label></td>
     623        <td><input type="text" id="this_photo" name="this_photo" class="tbtitle text" onkeypress="if(event.keyCode==13) image_selector();" /></td>
     624        </tr><tr>
     625        <td><label for="this_photo_description"><?php _e('Description') ?></label></td>
     626        <td><input type="text" id="this_photo_description" name="photo_description" class="tbtitle text" onkeypress="if(event.keyCode==13) image_selector();" value="<?php echo esc_attr($title);?>"/></td>
     627        </tr><tr>
     628        <td><input type="button" class="button" onclick="image_selector()" value="<?php _e('Insert Image'); ?>" /></td>
     629        </tr></table>
     630</div>
     631<?php
     632do_action('admin_footer');
     633do_action('admin_print_footer_scripts');
     634?>
    650635<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
    651636</body>
  • trunk/wp-includes/class-wp-editor.php

    r18519 r18570  
    4949                        'editor_class' => '', // add extra class(es) to the editor textarea
    5050                        'teeny' => false, // output the minimal editor config used in Press This
     51                        'dfw' => false, // replace the default fullscreen with DFW (needs specific css)
    5152                        'tinymce' => true, // load TinyMCE, can be used to pass settings directly to TinyMCE using an array()
    5253                        'quicktags' => true // load Quicktags, can be used to pass settings directly to Quicktags using an array()
     
    228229
    229230                                        $plugins = array_unique( apply_filters('tiny_mce_plugins', $plugins) );
    230 
    231                                         if ( 'content' == $editor_id ) // enable DFW only on Add/Edit Post screens for now
    232                                                 $plugins[] = 'wpfullscreen';
    233 
    234                                         $this->plugins = $plugins;
    235 
    236                                         /*
    237                                         The following filter allows localization scripts to change the languages displayed in the spellchecker's drop-down menu.
    238                                         By default it uses Google's spellchecker API, but can be configured to use PSpell/ASpell if installed on the server.
    239                                         The + sign marks the default language. More information:
    240                                         http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker
    241                                         */
    242                                         $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');
    243 
    244                                         $this->first_init = array(
    245                                                 'mode' => 'exact',
    246                                                 'width' => '100%',
    247                                                 'theme' => 'advanced',
    248                                                 'skin' => 'wp_theme',
    249                                                 'language' => $this->mce_locale,
    250                                                 'spellchecker_languages' => $mce_spellchecker_languages,
    251                                                 'theme_advanced_toolbar_location' => 'top',
    252                                                 'theme_advanced_toolbar_align' => 'left',
    253                                                 'theme_advanced_statusbar_location' => 'bottom',
    254                                                 'theme_advanced_resizing' => true,
    255                                                 'theme_advanced_resize_horizontal' => false,
    256                                                 'dialog_type' => 'modal',
    257                                                 'formats' => "{
    258                                                         alignleft : [
    259                                                                 {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}},
    260                                                                 {selector : 'img,table', classes : 'alignleft'}
    261                                                         ],
    262                                                         aligncenter : [
    263                                                                 {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}},
    264                                                                 {selector : 'img,table', classes : 'aligncenter'}
    265                                                         ],
    266                                                         alignright : [
    267                                                                 {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}},
    268                                                                 {selector : 'img,table', classes : 'alignright'}
    269                                                         ],
    270                                                         strikethrough : {inline : 'del'}
    271                                                 }",
    272                                                 'relative_urls' => false,
    273                                                 'remove_script_host' => false,
    274                                                 'convert_urls' => false,
    275                                                 'remove_linebreaks' => true,
    276                                                 'gecko_spellcheck' => true,
    277                                                 'keep_styles' => false,
    278                                                 'entities' => '38,amp,60,lt,62,gt',
    279                                                 'accessibility_focus' => true,
    280                                                 'tabfocus_elements' => 'major-publishing-actions',
    281                                                 'media_strict' => false,
    282                                                 'paste_remove_styles' => true,
    283                                                 'paste_remove_spans' => true,
    284                                                 'paste_strip_class_attributes' => 'all',
    285                                                 'paste_text_use_dialog' => true,
    286                                                 'extended_valid_elements' => 'article[*],aside[*],audio[*],canvas[*],command[*],datalist[*],details[*],embed[*],figcaption[*],figure[*],footer[*],header[*],hgroup[*],keygen[*],mark[*],meter[*],nav[*],output[*],progress[*],section[*],source[*],summary,time[*],video[*],wbr',
    287                                                 'wpeditimage_disable_captions' => $no_captions,
    288                                                 'wp_fullscreen_content_css' => "$this->baseurl/plugins/wpfullscreen/css/wp-fullscreen.css",
    289                                                 'plugins' => implode( ',', $plugins )
    290                                         );
    291 
    292                                         // load editor_style.css if the current theme supports it
    293                                         if ( ! empty( $editor_styles ) && is_array( $editor_styles ) ) {
    294                                                 $mce_css = array();
    295                                                 $style_uri = get_stylesheet_directory_uri();
    296                                                 if ( ! is_child_theme() ) {
    297                                                         foreach ( $editor_styles as $file )
     231                                }
     232
     233                                if ( $settings['dfw'] )
     234                                        $plugins[] = 'wpfullscreen';
     235
     236                                $this->plugins = $plugins;
     237
     238                                /*
     239                                The following filter allows localization scripts to change the languages displayed in the spellchecker's drop-down menu.
     240                                By default it uses Google's spellchecker API, but can be configured to use PSpell/ASpell if installed on the server.
     241                                The + sign marks the default language. More information:
     242                                http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker
     243                                */
     244                                $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');
     245
     246                                $this->first_init = array(
     247                                        'mode' => 'exact',
     248                                        'width' => '100%',
     249                                        'theme' => 'advanced',
     250                                        'skin' => 'wp_theme',
     251                                        'language' => $this->mce_locale,
     252                                        'spellchecker_languages' => $mce_spellchecker_languages,
     253                                        'theme_advanced_toolbar_location' => 'top',
     254                                        'theme_advanced_toolbar_align' => 'left',
     255                                        'theme_advanced_statusbar_location' => 'bottom',
     256                                        'theme_advanced_resizing' => true,
     257                                        'theme_advanced_resize_horizontal' => false,
     258                                        'dialog_type' => 'modal',
     259                                        'formats' => "{
     260                                                alignleft : [
     261                                                        {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}},
     262                                                        {selector : 'img,table', classes : 'alignleft'}
     263                                                ],
     264                                                aligncenter : [
     265                                                        {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}},
     266                                                        {selector : 'img,table', classes : 'aligncenter'}
     267                                                ],
     268                                                alignright : [
     269                                                        {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}},
     270                                                        {selector : 'img,table', classes : 'alignright'}
     271                                                ],
     272                                                strikethrough : {inline : 'del'}
     273                                        }",
     274                                        'relative_urls' => false,
     275                                        'remove_script_host' => false,
     276                                        'convert_urls' => false,
     277                                        'remove_linebreaks' => true,
     278                                        'gecko_spellcheck' => true,
     279                                        'keep_styles' => false,
     280                                        'entities' => '38,amp,60,lt,62,gt',
     281                                        'accessibility_focus' => true,
     282                                        'tabfocus_elements' => 'major-publishing-actions',
     283                                        'media_strict' => false,
     284                                        'paste_remove_styles' => true,
     285                                        'paste_remove_spans' => true,
     286                                        'paste_strip_class_attributes' => 'all',
     287                                        'paste_text_use_dialog' => true,
     288                                        'extended_valid_elements' => 'article[*],aside[*],audio[*],canvas[*],command[*],datalist[*],details[*],embed[*],figcaption[*],figure[*],footer[*],header[*],hgroup[*],keygen[*],mark[*],meter[*],nav[*],output[*],progress[*],section[*],source[*],summary,time[*],video[*],wbr',
     289                                        'wpeditimage_disable_captions' => $no_captions,
     290                                        'wp_fullscreen_content_css' => "$this->baseurl/plugins/wpfullscreen/css/wp-fullscreen.css",
     291                                        'plugins' => implode( ',', $plugins )
     292                                );
     293
     294                                // load editor_style.css if the current theme supports it
     295                                if ( ! empty( $editor_styles ) && is_array( $editor_styles ) ) {
     296                                        $mce_css = array();
     297                                        $style_uri = get_stylesheet_directory_uri();
     298                                        if ( ! is_child_theme() ) {
     299                                                foreach ( $editor_styles as $file )
     300                                                        $mce_css[] = "$style_uri/$file";
     301                                        } else {
     302                                                $style_dir    = get_stylesheet_directory();
     303                                                $template_uri = get_template_directory_uri();
     304                                                $template_dir = get_template_directory();
     305                                                foreach ( $editor_styles as $file ) {
     306                                                        if ( file_exists( "$template_dir/$file" ) )
     307                                                                $mce_css[] = "$template_uri/$file";
     308                                                        if ( file_exists( "$style_dir/$file" ) )
    298309                                                                $mce_css[] = "$style_uri/$file";
    299                                                 } else {
    300                                                         $style_dir    = get_stylesheet_directory();
    301                                                         $template_uri = get_template_directory_uri();
    302                                                         $template_dir = get_template_directory();
    303                                                         foreach ( $editor_styles as $file ) {
    304                                                                 if ( file_exists( "$template_dir/$file" ) )
    305                                                                         $mce_css[] = "$template_uri/$file";
    306                                                                 if ( file_exists( "$style_dir/$file" ) )
    307                                                                         $mce_css[] = "$style_uri/$file";
    308                                                         }
    309310                                                }
    310                                                 $mce_css = implode( ',', $mce_css );
    311                                         } else {
    312                                                 $mce_css = '';
    313311                                        }
    314 
    315                                         $mce_css = trim( apply_filters( 'mce_css', $mce_css ), ' ,' );
    316 
    317                                         if ( ! empty($mce_css) )
    318                                                 $this->first_init['content_css'] = $mce_css;
     312                                        $mce_css = implode( ',', $mce_css );
     313                                } else {
     314                                        $mce_css = '';
    319315                                }
     316
     317                                $mce_css = trim( apply_filters( 'mce_css', $mce_css ), ' ,' );
     318
     319                                if ( ! empty($mce_css) )
     320                                        $this->first_init['content_css'] = $mce_css;
    320321                        }
    321322
    322323                        if ( $settings['teeny'] ) {
    323                                 $mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold, italic, underline, blockquote, separator, strikethrough, bullist, numlist,justifyleft, justifycenter, justifyright, undo, redo, link, unlink, fullscreen'), $editor_id );
     324                                $mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'separator', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id );
    324325                                $mce_buttons_2 = $mce_buttons_3 = $mce_buttons_4 = array();
    325326                        } else {
    326                                 $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'wp_more', '|', 'spellchecker', 'fullscreen', 'wp_fullscreen', 'wp_adv' ), $editor_id);
     327                                $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'wp_more', '|', 'spellchecker', 'fullscreen', 'wp_adv' ), $editor_id);
    327328                                $mce_buttons_2 = apply_filters('mce_buttons_2', array( 'formatselect', 'underline', 'justifyfull', 'forecolor', '|', 'pastetext', 'pasteword', 'removeformat', '|', 'charmap', '|', 'outdent', 'indent', '|', 'undo', 'redo', 'wp_help' ), $editor_id);
    328329                                $mce_buttons_3 = apply_filters('mce_buttons_3', array(), $editor_id);
     
    330331                        }
    331332
    332                         if ( 'content' == $editor_id )
    333                                 $arg = array('fullscreen');
    334                         else
    335                                 $arg = array('wp_fullscreen');
    336 
    337                         $_buttons = compact('mce_buttons', 'mce_buttons_2', 'mce_buttons_3', 'mce_buttons_4');
    338                         foreach ( $_buttons as $key => $val ) {
    339                                 $_buttons[$key] = array_diff( $val, $arg );
    340                         }
    341 
    342                         extract($_buttons, EXTR_OVERWRITE);
     333                        if ( $settings['dfw'] ) {
     334                                function replace_fullscreen(&$val) {
     335                                        if ( $val == 'fullscreen' )
     336                                                $val = 'wp_fullscreen';
     337                                }
     338
     339                                array_walk($mce_buttons, 'replace_fullscreen');
     340                                array_walk($mce_buttons_2, 'replace_fullscreen');
     341                                array_walk($mce_buttons_3, 'replace_fullscreen');
     342                                array_walk($mce_buttons_4, 'replace_fullscreen');
     343                        }
    343344
    344345                        $mceInit = array (
  • trunk/wp-includes/script-loader.php

    r18553 r18570  
    425425        $styles->add( 'install', "/wp-admin/css/install$suffix.css", array(), '20110707' ); // Readme as well
    426426        $styles->add( 'theme-editor', "/wp-admin/css/theme-editor$suffix.css", array(), '20110602' );
    427         $styles->add( 'press-this', "/wp-admin/css/press-this$suffix.css", array(), '20110707' );
     427        $styles->add( 'press-this', "/wp-admin/css/press-this$suffix.css", array(), '20110818' );
    428428        $styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20090514' );
    429429        $styles->add( 'login', "/wp-admin/css/login$suffix.css", array(), '20110610' );
Note: See TracChangeset for help on using the changeset viewer.