Make WordPress Core

Changeset 7957


Ignore:
Timestamp:
05/20/2008 04:37:54 PM (17 years ago)
Author:
ryan
Message:

Press This styling updates from noel. fixes #6998

Location:
trunk/wp-admin
Files:
2 edited

Legend:

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

    r7932 r7957  
    1 /* jquery tabs css */
    2 
    3 /* Caution! Ensure accessibility in print and other media types... */
    4 @media projection, screen { /* Use class for showing/hiding tab content, so that visibility can be better controlled in different media types... */
    5     .ui-tabs-hide {
    6         display: none;
    7     }
    8 }
    9 
    10 /* Hide useless elements in print layouts... */
    11 @media print {
    12     .ui-tabs-nav {
    13         display: none;
    14     }
    15 }
    16 
    17 /* Skin */
    18 .ui-tabs-nav, .ui-tabs-panel {
    19     font-family: "Trebuchet MS", Trebuchet, Verdana, Helvetica, Arial, sans-serif;
    20     font-size: 12px;
    21 }
    22 .ui-tabs-nav {
    23     list-style: none;
    24     margin: 0;
    25     padding: 0 0 0 4px;
    26 }
    27 .ui-tabs-nav:after { /* clearing without presentational markup, IE gets extra treatment */
    28     display: block;
    29     clear: both;
    30     content: " ";
    31 }
    32 .ui-tabs-nav li {
    33     float: left;
    34     margin: 0 0 0 1px;
    35     min-width: 84px; /* be nice to Opera */
    36 }
    37 .ui-tabs-nav a, .ui-tabs-nav a span {
    38     display: block;
    39     padding: 0 10px;
    40     background: url(../images/tab.png) no-repeat;
    41 }
    42 .ui-tabs-nav a {
    43     margin: 1px 0 0; /* position: relative makes opacity fail for disabled tab in IE */
    44     padding-left: 0;
    45     color: #27537a;
    46     font-weight: bold;
    47     line-height: 1.2;
    48     text-align: center;
    49     text-decoration: none;
    50     white-space: nowrap; /* required in IE 6 */   
    51     outline: 0; /* prevent dotted border in Firefox */
    52 }
    53 .ui-tabs-nav .ui-tabs-selected a {
    54     position: relative;
    55     top: 1px;
    56     z-index: 2;
    57     margin-top: 0;
    58     color: #000;
    59 }
    60 .ui-tabs-nav a span {
    61     width: 64px; /* IE 6 treats width as min-width */
    62     min-width: 64px;
    63     height: 18px; /* IE 6 treats height as min-height */
    64     min-height: 18px;
    65     padding-top: 6px;
    66     padding-right: 0;
    67 }
    68 *>.ui-tabs-nav a span { /* hide from IE 6 */
    69     width: auto;
    70     height: auto;
    71 }
    72 .ui-tabs-nav .ui-tabs-selected a span {
    73     padding-bottom: 1px;
    74 }
    75 .ui-tabs-nav .ui-tabs-selected a, .ui-tabs-nav a:hover, .ui-tabs-nav a:focus, .ui-tabs-nav a:active {
    76     background-position: 100% -150px;
    77 }
    78 .ui-tabs-nav a, .ui-tabs-nav .ui-tabs-disabled a:hover, .ui-tabs-nav .ui-tabs-disabled a:focus, .ui-tabs-nav .ui-tabs-disabled a:active {
    79     background-position: 100% -100px;
    80 }
    81 .ui-tabs-nav .ui-tabs-selected a span, .ui-tabs-nav a:hover span, .ui-tabs-nav a:focus span, .ui-tabs-nav a:active span {
    82     background-position: 0 -50px;
    83 }
    84 .ui-tabs-nav a span, .ui-tabs-nav .ui-tabs-disabled a:hover span, .ui-tabs-nav .ui-tabs-disabled a:focus span, .ui-tabs-nav .ui-tabs-disabled a:active span {
    85     background-position: 0 0;
    86 }
    87 .ui-tabs-nav .ui-tabs-selected a:link, .ui-tabs-nav .ui-tabs-selected a:visited, .ui-tabs-nav .ui-tabs-disabled a:link, .ui-tabs-nav .ui-tabs-disabled a:visited { /* @ Opera, use pseudo classes otherwise it confuses cursor... */
    88     cursor: text;
    89 }
    90 .ui-tabs-nav a:hover, .ui-tabs-nav a:focus, .ui-tabs-nav a:active,
    91 .ui-tabs-nav .ui-tabs-unselect a:hover, .ui-tabs-nav .ui-tabs-unselect a:focus, .ui-tabs-nav .ui-tabs-unselect a:active { /* @ Opera, we need to be explicit again here now... */
    92     cursor: pointer;
    93 }
    94 .ui-tabs-disabled {
    95     opacity: .4;
    96     filter: alpha(opacity=40);
    97 }
    98 .ui-tabs-panel {
    99     border-top: 1px solid #97a5b0;
    100     padding: 1em 8px;
    101     background: #fff; /* declare background color for container to avoid distorted fonts in IE while fading */
    102 }
    103 .ui-tabs-loading em {
    104     padding: 0 0 0 20px;
    105     background: url(../images/loading.gif) no-repeat 0 50%;
    106 }
    107 
    108 /* Additional IE specific bug fixes... */
    109 * html .ui-tabs-nav { /* auto clear, @ IE 6 & IE 7 Quirks Mode */
    110     display: inline-block;
    111 }
    112 *:first-child+html .ui-tabs-nav  { /* @ IE 7 Standards Mode - do not group selectors, otherwise IE 6 will ignore complete rule (because of the unknown + combinator)... */
    113     display: inline-block;
    114 }
    115 
    116 /* end jquery tabs css */
    117 /* jquery thickbox css */
    118 /* ----------------------------------------------------------------------------------------------------------------*/
     1
    1192/* ---------->>> global settings needed for thickbox <<<-----------------------------------------------------------*/
    120 /* ----------------------------------------------------------------------------------------------------------------*/
    1213*{padding: 0; margin: 0;}
    1224
    123 /* ----------------------------------------------------------------------------------------------------------------*/
    1245/* ---------->>> thickbox specific link and font settings <<<------------------------------------------------------*/
    125 /* ----------------------------------------------------------------------------------------------------------------*/
    1266#TB_window {
    127     font: 12px Arial, Helvetica, sans-serif;
    128     color: #333333;
    1297}
    1308
    1319#TB_secondLine {
    132     font: 10px Arial, Helvetica, sans-serif;
    133     color:#666666;
    134 }
    135 
    136 #TB_window a:link {color: #666666;}
    137 #TB_window a:visited {color: #666666;}
    138 #TB_window a:hover {color: #000;}
    139 #TB_window a:active {color: #666666;}
    140 #TB_window a:focus{color: #666666;}
    141 
    142 /* ----------------------------------------------------------------------------------------------------------------*/
    143 /* ---------->>> thickbox settings <<<-----------------------------------------------------------------------------*/
    144 /* ----------------------------------------------------------------------------------------------------------------*/
     10}
     11
    14512#TB_overlay {
    14613    position: fixed;
     
    278145
    279146/* quickpost css */
     147
     148
     149
     150
     151body {
     152font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
     153}
     154/* jquery tabs css */
     155
     156/* Caution! Ensure accessibility in print and other media types... */
     157@media projection, screen { /* Use class for showing/hiding tab content, so that visibility can be better controlled in different media types... */
     158    .ui-tabs-hide {
     159        display: none;
     160    }
     161}
     162
     163/* Hide useless elements in print layouts... */
     164@media print {
     165    .ui-tabs-nav {
     166        display: none;
     167    }
     168}
     169
     170/* Skin */
     171div.ui-tabs-panel {
     172border: none;
     173width: 100%;
     174height: auto;
     175margin: 0;
     176padding: 0;
     177position: relative;
     178}
     179.ui-tabs-nav {
     180    list-style: none;
     181    border-bottom: 1px solid #C6D9E9;
     182    padding-left: 8px;
     183    margin-bottom: .5em;
     184    margin-top: -2em;
     185
     186}
     187.ui-tabs-nav:after { /* clearing without presentational markup, IE gets extra treatment */
     188    display: block;
     189    clear: both;
     190    content: " ";
     191}
     192.ui-tabs-nav li {
     193    float: left;
     194    margin: 0;
     195    height: 2em;
     196    line-height: 2em;
     197}
     198.ui-tabs-nav a, .ui-tabs-nav a span {
     199    display: block;
     200}
     201.ui-tabs-nav a {
     202    margin: 1px 0 0; /* position: relative makes opacity fail for disabled tab in IE */
     203    padding-left: 0;
     204    color: #27537a;
     205    font-weight: bold;
     206    line-height: 2em;
     207    text-align: center;
     208    text-decoration: none;
     209    white-space: nowrap; /* required in IE 6 */   
     210    outline: 0; /* prevent dotted border in Firefox */
     211    padding: 0 1em;
     212}
     213.ui-tabs-nav .ui-tabs-selected a {
     214    position: relative;
     215    top: 1px;
     216    z-index: 2;
     217    margin-top: 0;
     218    -moz-border-radius-topleft:4px;
     219    -moz-border-radius-topright:4px;
     220    -webkit-border-top-left-radius: 4px;
     221    -webkit-border-top-right-radius: 4px;
     222    border-style:solid;
     223    border-width:1px;
     224    border-color:#C6D9E9 rgb(198, 217, 233) rgb(255, 255, 255);
     225    color:#D54E21;
     226   
     227}
     228
     229.ui-tabs-nav .ui-tabs-selected a {
     230background: white;
     231border-bottom-width:2px;
     232margin-top: -2px;
     233}
     234
     235.ui-tabs-nav .ui-tabs-selected a:link, .ui-tabs-nav .ui-tabs-selected a:visited, .ui-tabs-nav .ui-tabs-disabled a:link, .ui-tabs-nav .ui-tabs-disabled a:visited {
     236/* @ Opera, use pseudo classes otherwise it confuses cursor... */
     237    cursor: pointer;
     238
     239}
     240.ui-tabs-nav a:hover, .ui-tabs-nav a:focus, .ui-tabs-nav a:active,
     241.ui-tabs-nav .ui-tabs-unselect a:hover, .ui-tabs-nav .ui-tabs-unselect a:focus, .ui-tabs-nav .ui-tabs-unselect a:active {
     242/* @ Opera, we need to be explicit again here now... */
     243    cursor: pointer;
     244}
     245.ui-tabs-loading em {
     246    padding: 0 0 0 20px;
     247    background: url(../images/loading.gif) no-repeat 0 50%;
     248}
     249
     250/* Additional IE specific bug fixes... */
     251* html .ui-tabs-nav { /* auto clear, @ IE 6 & IE 7 Quirks Mode */
     252    display: inline-block;
     253}
     254*:first-child+html .ui-tabs-nav  { /* @ IE 7 Standards Mode - do not group selectors, otherwise IE 6 will ignore complete rule (because of the unknown + combinator)... */
     255    display: inline-block;
     256}
     257
     258#wphead {
     259border-top: none;
     260}
     261.submit input {
     262}
     263
     264#wphead {
     265    height: 2em;
     266    padding-top: 8px;
     267}
     268
     269#wphead #viewsite {
     270    position: absolute;
     271    margin-top: 12px;
     272    margin-left: 10px;
     273}
     274
     275#viewsite {
     276    position: relative;
     277    right: 8px;
     278    top: 6px;
     279    margin: 0 !important;
     280}
     281#wphead #viewsite a {
     282    font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
     283    padding: 3px 4px;
     284    display: block;
     285    letter-spacing: normal;
     286    border-width: 1px;
     287    border-style: solid;
     288    -moz-border-radius: 3px;
     289    -khtml-border-radius: 3px;
     290    -webkit-border-radius: 3px;
     291    border-radius: 3px;
     292    text-decoration: none;
     293}
     294
     295#previewview {
     296    padding-top: 8px !important;
     297    padding-bottom: 8px !important;
     298}
     299h1 {
     300    font-size: .75em;
     301    line-height: 2.666em;
     302    top: .5em;
     303    right: 0;
     304    margin: 0 !important;
     305    padding: 0 !important;
     306    width:236px;
     307    background: none;
     308}
     309
     310
     311input.text {
     312    border:0pt none;
     313    outline-color:-moz-use-text-color;
     314    outline-style:none;
     315    outline-width:medium;
     316    padding:0pt;
     317    width:100%;
     318    border-style:solid;
     319    color:#333333;
     320}
     321.titlewrap {
     322    border-style:solid;
     323    border-width:1px;
     324    padding:2px 3px;
     325    border-color:#CCCCCC;
     326}
    280327div#container {
    281     background-color: #fff;
    282     padding: 0px 15px 0px 15px;
     328
     329    margin: 0;
     330    min-width: 500px;
    283331   
    284332}
    285333
    286 div#container h2 {
    287     margin: 15px 0px 0px 0px;
    288     font-size: 15px;
    289 }
    290 
    291 div#container h2 span.optional {
    292     font-size: 10px;
    293     color: #bbb;
    294     font-style: italic;
    295     font-weight: normal;
     334div#posting {
     335    padding-left: 16px;
     336    position:absolute;
     337    z-index:1;
     338    width: 66%;
     339}
     340
     341div#posting h2 {
     342    margin: .5em 0 .25em 0 ;
     343    font-size: 12px;
     344    padding: 3px;
     345    background: ;
    296346}
    297347
     
    302352
    303353div#categories {
    304   float:right;
    305     width:30%;
    306     padding: 0px 5px 0px 5px;
    307 }
    308 
    309 div#posting {
    310   float:left;
    311   width:65%;
    312     padding: 0px 5px 0px 5px;
    313 }
    314 
    315 textarea, input.text {
    316     font: Normal 12px 'Lucida Grande', Verdana, Helvetica, sans-serif;
    317     border: solid 1px #ccc;
    318     background-color: #f4f4f4;
    319 }
    320 
    321 input.text {
    322     width: 99%;
    323     padding: 3px;
    324 }
    325 
    326 body {
    327     background-color: #fff;
    328     margin: 0px;
    329     padding: 5px;
    330     font: Normal 13px 'Lucida Grande', Verdana, Helvetica, sans-serif;
    331 }
    332 
    333 a {
    334     color: #007BFF;
     354    font-size: 85%;
     355    position: absolute;
     356    top: 1.9em;
     357    right: 16px;
     358    width: 27%;
     359    z-index: 2;
     360}
     361div#categories h2 {
     362    font-size: 12px;
     363    margin: 0;
     364    padding: 0;
    335365}
    336366
    337367#categories-all {
    338368    overflow: auto;
    339     height: 30em;   
     369    padding: 1em;
     370    height: 20em;
    340371}
    341372
     
    350381    border-color: #ccc;
    351382    border-style: solid;
     383    margin-bottom: 1em;
    352384}
    353385
     
    396428}
    397429
     430#post_title {
     431    width: 99%;
     432}
     433
    398434/* end quickpost css */
     435#img_container {
     436    background-color: #fff;
     437    margin-top:10px; overflow:auto; height:100px;
     438}
     439#img_container img {
     440    width:          75px;
     441    height:         75px;
     442    padding:        2px;
     443    background-color: #f4f4f4;
     444    margin-right:   7px;
     445    margin-bottom:  7px;
     446    cursor:         pointer;
     447}
     448
     449.submitbox {
     450    width: 180px;
     451    float: right;
     452}
     453
     454
     455.submitbox .submit {
     456    text-align: left;
     457    padding: 12px 10px 10px 10px;
     458    font-size: 11px;
     459}
     460
     461.submit {
     462    border-top: 1px solid #ccc;
     463    padding: 1.5em 0 0 0;
     464    margin: 10px 0 0 0;
     465    -moz-border-radius-bottomleft: 3px;
     466    -khtml-border-bottom-left-radius: 3px;
     467    -webkit-border-bottom-left-radius: 3px;
     468    border-bottom-left-radius: 3px;
     469    -moz-border-radius-bottomright: 3px;
     470    -khtml-border-bottom-right-radius: 3px;
     471    -webkit-border-bottom-right-radius: 3px;
     472    border-bottom-right-radius: 3px;
     473}
     474.submitbox .submit a:hover {
     475    border-bottom-width: 1px;
     476    border-bottom-style: solid;
     477}
     478
     479.submitbox .submit input {
     480    margin-bottom: 8px;
     481    margin-right: 3px;
     482    padding: 6px 4px;
     483    border: none;
     484    cursor: pointer;
     485}
     486
     487.submitbox #previewview {
     488    padding: 15px 10px;
     489    -moz-border-radius-topleft: 3px;
     490    -khtml-border-top-left-radius: 3px;
     491    -webkit-border-top-left-radius: 3px;
     492    border-top-left-radius: 3px;
     493    -moz-border-radius-topright: 3px;
     494    -khtml-border-top-right-radius: 3px;
     495    -webkit-border-top-right-radius: 3px;
     496    border-top-right-radius: 3px;
     497}
     498
  • trunk/wp-admin/press-this.php

    r7946 r7957  
    22require_once('admin.php');
    33
    4 if ( ! current_user_can('publish_posts') )
    5     wp_die( __( 'Cheatin&#8217; uh?' ));
     4if ( ! current_user_can('publish_posts') ) wp_die( __( 'Cheatin&#8217; uh?' ));
     5
     6if ( 'post' == $_REQUEST['action'] ) {
     7    check_admin_referer('press-this');
     8    $post_ID = press_it(); ?>
     9        <script>if(confirm("<?php _e('Your post is saved. Do you want to view the post?') ?>")) {window.opener.location.replace("<?php echo get_permalink($post_ID);?>");}window.close();</script>
     10<?php
     11die;
     12}
    613
    714function press_it() {
     
    1623            $content = $_REQUEST['content'];
    1724            if ($_REQUEST['content2'])
    18                 $content .= '<p>' . $_REQUEST['content2'];
     25                $content .= '<p>' . $_REQUEST['content2']; 
    1926            break;
    2027
     
    2330            if ($_REQUEST['content2']) {
    2431                $content .= '</blockquote>';
    25                 $content = $content . '<p>' . $_REQUEST['content2'];
     32                $content = $content . '<p>' . $_REQUEST['content2'].'</p>';
    2633            }
    2734            break;
     
    2936        case 'photo':
    3037            if ($_REQUEST['photo_link'])
    31                 $content = '<a href="' . $_REQUEST['photo_link'] . '" target="_new">';
    32 
    33             $content .= '<img src="' . $_REQUEST['photo_src'] . '" style="float:left;padding:5px;">';
     38                $content = '<p><a href="' . $_REQUEST['photo_link'] . '" target="_new">';
     39
     40            $content .= '<img src="' . $_REQUEST['photo_src'] . '" alt=""/>';
    3441
    3542            if ($_REQUEST['photo_link'])
    36                 $content .= '</a>';
     43                $content .= '</a></p>';
    3744
    3845            if ($_REQUEST['content'])
    39                 $content = $content . '<br clear="all">' . $_REQUEST['content'];
     46                $content = $content . $_REQUEST['content'];
    4047
    4148            break;
     
    4451            $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>';
    4552            if ($_REQUEST['content2'])
    46                 $content .= '</br><p>' . $_REQUEST['content2'] . '</p>';
    47             break;
     53                $content .= '<p>' . $_REQUEST['content2'] . '</p>';
     54            break;             
    4855    }
    4956
     
    5865}
    5966
    60 function tag_div() {
    61 ?>
    62     <h2><?php _e('Tags') ?></h2>
    63     <div id="tagsdiv">
     67function tag_div() { ?>
     68    <p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" /></p>
     69    <div id="tagchecklist"></div>
     70<?php
     71}
     72
     73function category_div() {
     74?>
     75<div id="categories">
     76    <div class="submitbox" id="submitpost">
     77        <div id="previewview">  <h2><?php _e('Categories') ?></h2></div>
    6478        <div class="inside">
    65             <p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" /></p>
    66 <div id="tagchecklist"></div>
     79            <div id="categories-all">
     80                <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
     81                    <?php wp_category_checklist() ?>
     82                </ul>
     83            </div>
    6784        </div>
    68     </div>
    69 <?php
    70 }
    71 
    72 function category_div() {
    73 ?>
    74                 <div id="categories">
    75                     <h2><?php _e('Categories') ?></h2>
    76                     <div id="categories-all">
    77                         <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
    78                         <?php wp_category_checklist() ?>
    79                         </ul>
    80                     </div>
    81                 </div>
     85        <p class="submit">         
     86        <input type="submit" value="<?php _e('Publish') ?>" onclick="document.getElementById('photo_saving').style.display = '';"/>
     87        <img src="/images/bookmarklet_loader.gif" alt="" id="photo_saving" style="width:16px; height:16px; vertical-align:-4px; display:none;"/>
     88        </p>
     89    </div> 
    8290<?php
    8391}
    8492
    8593function get_images_from_uri($uri) {
     94
    8695    $content = wp_remote_fopen($uri);
    87     if ( false === $content )
    88         return '';
     96    if ( false === $content ) return '';
    8997
    9098    $pattern = '/<img[^>]+src=[\'"]([^\'" >]+?)[\'" >]/is';
    9199    preg_match_all($pattern, $content, $matches);
    92     if ( empty($matches[1]) )
    93         return '';
    94 
    95     /*
    96     $from_host = parse_url($uri);
    97     $from_host = $from_host['host'];
    98     $from_host = explode('.', $from_host);
    99     $count = count($from_host);
    100     $from_host = $from_host[$count - 2] . '.' . $from_host[$count - 1];
    101     */
    102 
     100    if ( empty($matches[1]) ) return '';
     101   
    103102    $sources = array();
    104103    foreach ($matches[1] as $src) {
    105104        if ( false !== strpos($src, '&') )
    106105            continue;
    107 
    108         /*
    109         $img_host = parse_url($src);
    110         $img_host = $img_host['host'];
    111         if ( false === strpos($img_host, $from_host) )
    112             continue;
    113         */
    114 
     106       
     107        $host = parse_url($_GET['u'], PHP_URL_HOST);
     108       
     109        if (strpos($src, 'http://') === false) {
     110            $src = 'http://'.str_replace('//','/', $host.'/'.$src);
     111        }
     112       
    115113        $sources[] = $src;
    116114    }
     
    118116}
    119117
    120 function press_this_js_init() {
    121     if ( user_can_richedit() ) {
    122         $language = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) );
    123     ?>
     118function press_this_js_init() { ?>
     119    <?php if ( user_can_richedit() ) {
     120        $language = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) );
     121        // Add TinyMCE languages
     122        @include_once( dirname(__FILE__).'/../wp-includes/js/tinymce/langs/wp-langs.php' );
     123        if ( isset($strings) ) echo $strings; ?>
     124            (function() {
     125                var base = tinymce.baseURL, sl = tinymce.ScriptLoader, ln = "<?php echo $language; ?>";
     126
     127                sl.markDone(base + '/langs/' + ln + '.js');
     128                sl.markDone(base + '/themes/advanced/langs/' + ln + '.js');
     129                sl.markDone(base + '/themes/advanced/langs/' + ln + '_dlg.js');
     130            })();
     131           
    124132            tinyMCE.init({
    125133                mode: "textareas",
     
    148156            });
    149157    <?php } ?>
     158
    150159        jQuery('#tags-input').hide();
     160
    151161        tag_update_quickclicks();
     162
    152163        // add the quickadd form
    153164        jQuery('#jaxtag').prepend('<span id="ajaxtag"><input type="text" name="newtag" id="newtag" class="form-input-tip" size="16" autocomplete="off" value="'+postL10n.addTag+'" /><input type="button" class="button" id="tagadd" value="' + postL10n.add + '" tabindex="3" /><input type="hidden"/><input type="hidden"/><span class="howto">'+postL10n.separate+'</span></span>');
     165       
    154166        jQuery('#tagadd').click( tag_flush_to_text );
    155167        jQuery('#newtag').focus(function() {
     
    171183$title = wp_specialchars(stripslashes($_GET['t']));
    172184$selection = wp_specialchars(stripslashes($_GET['s']));
    173 $url = clean_url($_GET['u']);
     185$url = clean_url($_GET['u']);                         
    174186
    175187if ( empty($_GET['tab']) ) {
     
    179191<head>
    180192    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
    181     <title><?php _e('Quick Post') ?></title>
    182 
     193    <title><?php _e('Press This') ?></title>
    183194    <script type="text/javascript" src="../wp-includes/js/tinymce/tiny_mce.js"></script>
    184 
    185195<?php
    186196    wp_enqueue_script('jquery-ui-tabs');
    187197    wp_enqueue_script('thickbox');
    188198    wp_enqueue_script('post');
    189     do_action('admin_print_scripts'); do_action('admin_head');
     199    do_action('admin_print_scripts');
     200    do_action('admin_head');
    190201    wp_admin_css('css/press-this');
    191202    wp_admin_css( 'css/colors' );
    192203?>
    193204    <script type="text/javascript">
    194     <?php if ( user_can_richedit() ) {
    195         $language = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) );
    196         // Add TinyMCE languages
    197         @include_once( dirname(__FILE__).'/../wp-includes/js/tinymce/langs/wp-langs.php' );
    198         if ( isset($strings) ) echo $strings;
    199     ?>
    200 
    201             (function() {
    202                 var base = tinymce.baseURL, sl = tinymce.ScriptLoader, ln = "<?php echo $language; ?>";
    203 
    204                 sl.markDone(base + '/langs/' + ln + '.js');
    205                 sl.markDone(base + '/themes/advanced/langs/' + ln + '.js');
    206                 sl.markDone(base + '/themes/advanced/langs/' + ln + '_dlg.js');
    207             })();
    208 
    209             tinyMCE.init({
    210                 mode: "textareas",
    211                 editor_selector: "mceEditor",
    212                 language : "<?php echo $language; ?>",
    213                 width: "100%",
    214                 theme : "advanced",
    215                 theme_advanced_buttons1 : "bold,italic,underline,blockquote,separator,strikethrough,bullist,numlist,undo,redo,link,unlink",
    216                 theme_advanced_buttons2 : "",
    217                 theme_advanced_buttons3 : "",
    218                 theme_advanced_toolbar_location : "top",
    219                 theme_advanced_toolbar_align : "left",
    220                 theme_advanced_statusbar_location : "bottom",
    221                 theme_advanced_resizing : true,
    222                 theme_advanced_resize_horizontal : false,
    223                 skin : "wp_theme",
    224                 dialog_type : "modal",
    225                 relative_urls : false,
    226                 remove_script_host : false,
    227                 convert_urls : false,
    228                 apply_source_formatting : false,
    229                 remove_linebreaks : true,
    230                 accessibility_focus : false,
    231                 tab_focus : ":next",
    232                 plugins : "safari,inlinepopups"
    233             });
    234     <?php } ?>
    235205
    236206    jQuery(document).ready(function() {
    237     <?php if ( preg_match("/youtube\.com\/watch/i", $_GET['u']) ) { ?>
     207    <?php if ( preg_match("/youtube\.com\/watch/i", $url) ) { ?>
    238208        jQuery('#container > ul').tabs({ selected: 3 });
    239     <?php } elseif ( preg_match("/flickr\.com/i", $_GET['u']) ) { ?>
     209    <?php } elseif ( preg_match("/flickr\.com/i", $url) ) { ?>
    240210        jQuery('#container > ul').tabs({ selected: 1 });
    241211    <?php } else { ?>
     
    247217</head>
    248218<body>
    249 
    250 <?php
    251     if ( 'post' == $_REQUEST['action'] ) {
    252         check_admin_referer('press-this');
    253         $post_ID = press_it();
    254 ?>
    255         <script>if(confirm("<?php _e('Your post is saved. Do you want to view the post?') ?>")) {window.opener.location.replace("<?php echo get_permalink($post_ID);?>");}window.close();</script>
    256         </body></html>
    257 <?php
    258         die;
    259     }
    260 ?>
     219<div id="wphead">
     220<h1><span id="viewsite"><a href="<?php echo get_option('home'); ?>/">Visit: <?php bloginfo('name'); ?></a></span></h1>
     221</div>
    261222    <div id="container">
    262223        <ul>
    263             <li><a href="<?php echo clean_url(add_query_arg('tab', 'text', stripslashes($_SERVER['REQUEST_URI']))) ?>"><span><?php _e('Text/Link') ?></span></a></li>
    264             <li><a href="<?php echo clean_url(add_query_arg('tab', 'photo', stripslashes($_SERVER['REQUEST_URI']))) ?>"><span><?php _e('Photo') ?></span></a></li>
    265             <li><a href="<?php echo clean_url(add_query_arg('tab', 'quote', stripslashes($_SERVER['REQUEST_URI']))) ?>"><span><?php _e('Quote') ?></span></a></li>
    266             <li><a href="<?php echo clean_url(add_query_arg('tab', 'video', stripslashes($_SERVER['REQUEST_URI']))) ?>"><span><?php _e('Video') ?></span></a></li>
     224            <li><a href="<?php echo clean_url(add_query_arg('tab', 'text', stripslashes($_SERVER['REQUEST_URI']))) ?>"><?php _e('Text') ?></a></li>
     225            <li><a href="<?php echo clean_url(add_query_arg('tab', 'photo', stripslashes($_SERVER['REQUEST_URI']))) ?>"><?php _e('Photo') ?></a></li>
     226            <li><a href="<?php echo clean_url(add_query_arg('tab', 'quote', stripslashes($_SERVER['REQUEST_URI']))) ?>"><?php _e('Quote') ?></a></li>
     227            <li><a href="<?php echo clean_url(add_query_arg('tab', 'video', stripslashes($_SERVER['REQUEST_URI']))) ?>"><?php _e('Video') ?></a></li>
    267228        </ul>
     229       
    268230    </div>
    269 
    270231</body>
    271232</html>
    272 <?php
    273 exit;
    274 } elseif ( 'photo' == $_GET['tab'] ) {
    275 ?>
     233<?php exit; } elseif ( 'photo' == $_GET['tab'] ) { ?>
    276234    <script type="text/javascript">
    277235        <?php press_this_js_init(); ?>
     
    286244                return false;
    287245            }
     246           
    288247            jQuery(document).ready(function() {
    289248                var img, img_tag, aspect, w, h, skip, i, strtoappend = "";
     
    318277                    }
    319278                }
     279               
    320280                jQuery('#img_container').html(strtoappend);
    321281
     
    323283            });
    324284    </script>
    325 
    326285            <form action="press-this.php?action=post" method="post" id="photo_form">
    327286                <?php wp_nonce_field('press-this') ?>
     
    329288                <input type="hidden" name="post_type" value="photo"/>
    330289                <div id="posting">
    331                     <h2><?php _e('Post Title') ?></h2>
     290                   
     291                    <h2><?php _e('Title') ?></h2>
     292                    <div class="titlewrap">
    332293                    <input name="post_title" id="post_title" class="text" value="<?php echo attribute_escape($title);?>"/>
    333 
     294                    </div>
     295                   
     296                    <h2><?php _e('Photo URL') ?></h2>
     297                    <div class="titlewrap">
     298                    <input name="photo_src" id="photo_src" class="text" onkeydown="pick(0);"/>
     299                    </div>
     300                   
     301                    <h2><?php _e('Link Photo to following URL') ?></h2><?php _e('(leave blank to leave the photo unlinked)') ?>
     302                    <div class="titlewrap">
     303                    <input name="photo_link" id="photo_link" class="text" value="<?php echo attribute_escape($url);?>"/>
     304                    </div>
     305                   
     306                    <small>Click images to select:</small>
     307                    <div class="titlewrap">
     308                    <div id="img_container">
     309                    </div>
     310                    </div>
     311                   
     312                   
    334313                    <h2><?php _e('Caption') ?></h2>
    335314                    <div class="editor-container">
    336                         <textarea name="content" id="photo_post_two" style="height:130px;width:100%;" class="mceEditor"><?php echo $selection;?>
    337                         <br>&lt;a href="<?php echo $url;?>"&gt;<?php echo $title;?>&lt;/a&gt;</textarea>
    338                     </div>
    339 
    340                     <h2><?php _e('Photo URL') ?></h2>
    341                     <input name="photo_src" id="photo_src" class="text" onkeydown="pick(0);"/>
    342 
    343                     <style type="text/css">
    344                         #img_container img {
    345                             width:          75px;
    346                             height:         75px;
    347                             padding:        2px;
    348                             background-color: #f4f4f4;
    349                             margin-right:   7px;
    350                             margin-bottom:  7px;
    351                             cursor:         pointer;
    352                         }
    353                     </style>
    354                     <div id="img_container" style="border:solid 1px #ccc; background-color:#f4f4f4; padding:5px; width:370px; margin-top:10px; overflow:auto; height:100px;">
    355                     </div>
    356 
    357                     <h2><?php _e('Link Photo to following URL') ?></h2><?php _e('(leave blank to leave the photo unlinked)') ?>
    358                     <input name="photo_link" id="photo_link" class="text" value="<?php echo attribute_escape($url);?>"/>
     315                        <textarea name="content" id="photo_post_two" style="" class="mceEditor"><?php echo $selection;?>
     316                        &lt;a href="<?php echo attribute_escape($url);?>"&gt;<?php echo $title;?>&lt;/a&gt;</textarea>
     317                    </div>
    359318
    360319                    <?php tag_div(); ?>
    361 
    362                     <div>
    363                         <input type="submit" value="<?php _e('Create Photo') ?>" style="margin-top:15px;"   onclick="document.getElementById('photo_saving').style.display = '';"/>&nbsp;&nbsp;
    364 
    365                         <a href="#" onclick="if (confirm('<?php _e('Are you sure?') ?>')) { self.close(); } else { return false; }" style="color:#007BFF;"><?php _e('Cancel') ?></a>&nbsp;&nbsp;
    366                         <img src="/images/bookmarklet_loader.gif" alt="" id="photo_saving" style="width:16px; height:16px; vertical-align:-4px; display:none;"/>
    367                     </div>
     320                   
    368321                </div>
    369                 <?php category_div() ?>
     322                    <?php category_div() ?>
    370323            </form>
    371324<?php
     
    382335                <input type="hidden" name="post_type" value="regular"/>
    383336                <div id="posting">
    384                     <h2><?php _e('Post Title') ?></h2>
     337                    <h2><?php _e('Title') ?></h2>
     338                    <div class="titlewrap">
    385339                    <input name="post_title" id="post_title" class="text" value="<?php echo attribute_escape($title);?>"/>
    386 
     340                    </div>
     341                   
    387342                    <h2><?php _e('Post') ?></h2>
    388343                    <div class="editor-container">
    389                         <textarea name="content" id="regular_post_two" style="height:170px;width:100%;" class="mceEditor"><?php echo $selection;?><br>&lt;a href="<?php echo $url;?>"&gt;<?php echo $title;?>&lt;/a&gt;</textarea>
    390                     </div>
     344                        <textarea name="content" id="regular_post_two" style="height:170px;width:100%;" class="mceEditor"><?php echo $selection;?>&lt;a href="<?php echo $url;?>"&gt;<?php echo $title;?>&lt;/a&gt;</textarea>
     345                    </div>       
    391346
    392347                    <?php tag_div(); ?>
    393 
    394                     <div>
    395                         <input type="submit" value="<?php _e('Create Post') ?>" style="margin-top:15px;" onclick="document.getElementById('regular_saving').style.display = '';"/>&nbsp;&nbsp;
    396                         <a href="#" onclick="if (confirm('<?php _e('Are you sure?') ?>')) { self.close(); } else { return false; }" style="color:#007BFF;"><?php _e('Cancel') ?></a>&nbsp;&nbsp;
    397                         <img src="/images/bookmarklet_loader.gif" alt="" id="regular_saving" style="width:16px; height:16px; vertical-align:-4px; display:none;"/>
    398                     </div>
     348       
    399349                </div>
    400350                <?php category_div() ?>
     
    413363                <input type="hidden" name="post_type" value="quote"/>
    414364                <div id="posting">
    415                     <h2><?php _e('Post Title') ?></h2>
     365                    <h2><?php _e('Title') ?></h2>
     366                    <div class="titlewrap">
    416367                    <input name="post_title" id="post_title" class="text" value="<?php echo attribute_escape(sprintf(__('Quote by %s'), $title)); ?>"/>
    417 
     368                    </div>
     369                   
    418370                    <h2><?php _e('Quote') ?></h2>
    419371                    <div class="editor-container">
     
    423375                    <h2><?php _e('Source <span class="optional">(optional)</span>') ?></h2>
    424376                    <div class="editor-container">
    425                         <textarea name="content2" id="quote_post_two" style="height:130px;width:100%;" class="mceEditor"><br>&lt;a href="<?php echo $url;?>"&gt;<?php echo $title;?>&lt;/a&gt;</textarea>
     377                        <textarea name="content2" id="quote_post_two" style="height:130px;width:100%;" class="mceEditor"><cite>&lt;a href="<?php echo $url;?>"&gt;<?php echo $title;?>&lt;/a&gt;</cite></textarea>
    426378                    </div>
    427379
    428380                    <?php tag_div(); ?>
    429 
    430                     <div>
    431                         <input type="submit" value="<?php echo attribute_escape(__('Create Quote')) ?>" style="margin-top:15px;" onclick="document.getElementById('quote_saving').style.display = '';"/>&nbsp;&nbsp;
    432                         <a href="#" onclick="if (confirm('<?php _e('Are you sure?') ?>')) { self.close(); } else { return false; }" style="color:#007BFF;"><?php _e('Cancel') ?></a>&nbsp;&nbsp;
    433                         <img src="/images/bookmarklet_loader.gif" alt="" id="quote_saving" style="width:16px; height:16px; vertical-align:-4px; display:none;"/>
    434                     </div>
    435381                </div>
    436382                <?php category_div() ?>
     
    449395                <input type="hidden" name="post_type" value="video"/>
    450396                <div id="posting">
    451                     <h2><?php _e('Post Title') ?></h2>
     397               
     398                    <h2><?php _e('Video Title') ?></h2>
     399                <div class="titlewrap">
    452400                    <input name="post_title" id="post_title" class="text" value="<?php echo attribute_escape($title);?>"/>
    453 
    454                     <?php
     401                </div>
     402                    <?php 
    455403                    if ( preg_match("/youtube\.com\/watch/i", $url) ) {
    456404                        list($domain, $video_id) = split("v=", $url);
    457405                    ?>
    458406                    <input type="hidden" name="content" value="<?php echo attribute_escape($url); ?>" />
    459                     <img src="http://img.youtube.com/vi/<?php echo $video_id; ?>/default.jpg" align="right" style="border:solid 1px #aaa;" width="130" height="97"/><br clear="all" />
     407                    <img src="http://img.youtube.com/vi/<?php echo $video_id; ?>/default.jpg" align="right" style="border:solid 1px #aaa;" width="130" height="97"/>
    460408                    <?php } else { ?>
     409                   
    461410                    <h2><?php _e('Embed Code') ?></h2>
    462411                    <textarea name="content" id="video_post_one" style="height:80px;width:100%;"></textarea>
     
    466415
    467416                    <div class="editor-container">
    468                         <textarea name="content2" id="video_post_two" style="height:130px;width:100%;" class="mceEditor"><?php echo $selection;?><br>&lt;a href="<?php echo $url;?>"&gt;<?php echo $title;?>&lt;/a&gt;</textarea>
     417                        <textarea name="content2" id="video_post_two" style="height:130px;width:100%;" class="mceEditor"><?php echo $selection; ?> &lt;a href="<?php echo $url; ?>"&gt;<?php echo $title;?>&lt;/a&gt;</textarea>
    469418                    </div>
    470419
    471420                    <?php tag_div(); ?>
    472 
    473                     <div>
    474                         <input type="submit" value="<?php _e('Create Video') ?>" style="margin-top:15px;" onclick="document.getElementById('video_saving').style.display = '';"/>&nbsp;&nbsp;
    475                         <a href="#" onclick="if (confirm('<?php _e('Are you sure?') ?>')) { self.close(); } else { return false; }" style="color:#007BFF;"><?php _e('Cancel'); ?></a>&nbsp;&nbsp;
    476                         <img src="/images/bookmarklet_loader.gif" alt="" id="video_saving" style="width:16px; height:16px; vertical-align:-4px; display:none;"/>
    477                     </div>
    478421                </div>
    479422                <?php category_div() ?>
     
    482425exit;
    483426}
    484 ?>
     427?>         
Note: See TracChangeset for help on using the changeset viewer.