Make WordPress Core

Changeset 694


Ignore:
Timestamp:
01/03/2004 12:13:11 AM (21 years ago)
Author:
michelvaldrighi
Message:

edit-form.php now included in bookmarklet.php, added #postdiv selector

Location:
trunk/wp-admin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/bookmarklet.php

    r628 r694  
    33
    44// accepts 'post_title' and 'content' as vars passed in. Add-on from Alex King
    5 
    6 function selected($selected, $current) {
    7     if ($selected == $current) echo ' selected="selected"';
    8 }
    95
    106$mode = 'bookmarklet';
     
    3127} else {
    3228
     29    $popuptitle = stripslashes($popuptitle);
     30    $text = stripslashes($text);
     31   
     32    /* big funky fixes for browsers' javascript bugs */
     33   
     34    if (($is_macIE) && (!isset($IEMac_bookmarklet_fix))) {
     35        $popuptitle = preg_replace($wp_macIE_correction["in"],$wp_macIE_correction["out"],$popuptitle);
     36        $text = preg_replace($wp_macIE_correction["in"],$wp_macIE_correction["out"],$text);
     37    }
     38   
     39    if (($is_winIE) && (!isset($IEWin_bookmarklet_fix))) {
     40        $popuptitle =  preg_replace("/\%u([0-9A-F]{4,4})/e",  "'&#'.base_convert('\\1',16,10).';'", $popuptitle);
     41        $text =  preg_replace("/\%u([0-9A-F]{4,4})/e",  "'&#'.base_convert('\\1',16,10).';'", $text);
     42    }
     43   
     44    if (($is_gecko) && (!isset($Gecko_bookmarklet_fix))) {
     45        $popuptitle = preg_replace($wp_gecko_correction["in"],$wp_gecko_correction["out"],$popuptitle);
     46        $text = preg_replace($wp_gecko_correction["in"],$wp_gecko_correction["out"],$text);
     47    }
     48   
     49    $post_title = $_REQUEST['post_title'];
     50    if (!empty($post_title)) {
     51        $post_title =  stripslashes($post_title);
     52    } else {
     53        $post_title = $popuptitle;
     54    }
     55   
     56    $content = $_REQUEST['content'];
     57    if (!empty($content)) {
     58        $content =  stripslashes($content);
     59    } else {
     60        $content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text";
     61    }
     62   
     63    /* /big funky fixes */
     64
    3365?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    3466<html xmlns="http://www.w3.org/1999/xhtml">
     
    3668<title>WordPress > Bookmarklet</title>
    3769<link rel="stylesheet" href="wp-admin.css" type="text/css" />
     70<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $admin_area_charset ?>" />
    3871<script type="text/javascript" language="javascript">
    3972<!--
     
    4679<style type="text/css">
    4780<!--
    48 body {
    49 }
    5081
    51 textarea,input,select {
    52     background-color: transparent;
    53     background-color: #cccccc;
    54     filter: alpha(opacity:80);
    55     -moz-opacity: .8;
     82#wpbookmarklet textarea,input,select {
    5683    border-width: 1px;
    5784    border-color: #cccccc;
     
    6188}
    6289
    63 .checkbox {
     90#wpbookmarklet .checkbox {
    6491    background-color: #ffffff;
    6592    border-width: 0px;
     
    6895}
    6996
    70 textarea {
     97#wpbookmarklet textarea {
    7198    font-family: Verdana, Geneva, Arial, Helvetica;
    7299    font-size: 0.9em;
    73100}
     101
     102#wpbookmarklet .wrap {
     103    border: 0px;
     104}
     105
     106#wpbookmarklet #postdiv {
     107    margin-bottom: 0.5em;
     108}
     109
     110#wpbookmarklet #titlediv {
     111    margin-bottom: 1em;
     112}
     113
    74114-->
    75115</style>
    76116</head>
    77 <body>
    78 <form name="post" action="post.php" method="POST">
    79 <input type="hidden" name="action" value="post" />
    80 <input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
    81 <input type="hidden" name="mode" value="bookmarklet" />
     117<body id="wpbookmarklet">
     118<h1 id="wphead"><a href="http://wordpress.org" rel="external">WordPress</a></h1>
    82119
    83 <div align="right">
    84 <?php
    85 
    86 $popuptitle = stripslashes($popuptitle);
    87 $text = stripslashes($text);
    88 
    89 
    90 /* big funky fixes for browsers' javascript bugs */
    91 
    92 if (($is_macIE) && (!isset($IEMac_bookmarklet_fix))) {
    93     $popuptitle = preg_replace($wp_macIE_correction["in"],$wp_macIE_correction["out"],$popuptitle);
    94     $text = preg_replace($wp_macIE_correction["in"],$wp_macIE_correction["out"],$text);
    95 }
    96 
    97 if (($is_winIE) && (!isset($IEWin_bookmarklet_fix))) {
    98     $popuptitle =  preg_replace("/\%u([0-9A-F]{4,4})/e",  "'&#'.base_convert('\\1',16,10).';'", $popuptitle);
    99     $text =  preg_replace("/\%u([0-9A-F]{4,4})/e",  "'&#'.base_convert('\\1',16,10).';'", $text);
    100 }
    101 
    102 if (($is_gecko) && (!isset($Gecko_bookmarklet_fix))) {
    103     $popuptitle = preg_replace($wp_gecko_correction["in"],$wp_gecko_correction["out"],$popuptitle);
    104     $text = preg_replace($wp_gecko_correction["in"],$wp_gecko_correction["out"],$text);
    105 }
    106 
    107 $post_title = $_REQUEST['post_title'];
    108 if (!empty($post_title)) {
    109     $post_title =  stripslashes($post_title);
    110 } else {
    111     $post_title = $popuptitle;
    112 }
    113 
    114 $content = $_REQUEST['content'];
    115 if (!empty($content)) {
    116     $content =  stripslashes($content);
    117 } else {
    118     $content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text";
    119 }
    120 
    121 /* /big funky fixes */
    122 
    123 
    124 ?>
    125 <table width="100%" cellpadding="8" cellspacing="0" width="415">
    126   <tr>
    127     <td width="40">&nbsp;</td>
    128     <td align="left" width="415">
    129       <table cellspacing="0" cellpadding="0">
    130         <td height="50" width="250" align="left" valign="bottom"><label>Title<br />
    131           <input type="text" name="post_title" size="20" tabindex="1" style="width: 215px;" value="<?php echo $post_title; ?>" /></label></td>
    132         <td width="165" align="left" valign="bottom"><b>Category</b><br /><?php dropdown_categories(); ?></td>
    133       </table>
    134     </td>
    135   </tr>
    136 
    137   <tr height="40">
    138     <td width="40">&nbsp;</td>
    139     <td align="left" width="415">
    140       <table cellspacing="0" cellpadding="0">
    141         <td height="50" width="150" align="left" valign="bottom">
    142           <label for="post_status">Post Status:</label>&nbsp;<br />
    143           <select name="post_status" id="post_status">
    144             <option value="publish"<?php selected($post_status, 'publish'); ?>>Publish</option>
    145                 <option value="draft"<?php selected($post_status, 'draft'); ?>>Draft</option>
    146                 <option value="private"<?php selected($post_status, 'private'); ?>>Private</option>
    147             </select>
    148         </td>
    149         <td height="50" width="250" align="left" valign="bottom">
    150           <label for="comment_status">Comments:</label>&nbsp;<br />
    151           <select name="comment_status" id="comment_status">
    152             <option value="open"<?php selected($comment_status, 'open'); ?>>Open</option>
    153                 <option value="closed"<?php selected($comment_status, 'closed'); ?>>Closed</option>
    154             </select>
    155         </td>
    156       </table>
    157     </td>
    158   </tr>
    159 
    160   <tr height="40">
    161     <td width="40">&nbsp;</td>
    162     <td align="left" width="415">
    163       <table cellspacing="0" cellpadding="0">
    164         <td height="50" width="100" align="left" valign="bottom">
    165           <label for="ping_status">Pings:</label><br />
    166           <select name="ping_status" id="ping_status">
    167             <option value="open"<?php selected($ping_status, 'open'); ?>>Open</option>
    168                 <option value="closed"<?php selected($ping_status, 'open'); ?>>Closed</option>
    169             </select>
    170         </td>
    171         <td height="50" width="250" align="left" valign="bottom">
    172           <label for="post_password">Post Password:</label><br />
    173           <input name="post_password" type="text" id="post_password" value="<?php echo $post_password ?>" />
    174         </td>
    175       </table>
    176     </td>
    177     </tr>
    178 
    179   <tr height="40">
    180     <td width="40">&nbsp;</td>
    181     <td width="415" align="left" height="40">
    182       <table width="415" cellpadding="0" cellspacing="0">
    183         <td align="left" valign="bottom"><b>Post</b></td>
    184         <td align="right" valign="bottom"><?php if ($use_quicktags) include("quicktags.php"); ?></td>
    185       </table>
    186 <?php
    187 if ((preg_match("/Nav/",$HTTP_USER_AGENT)) || (preg_match("/Mozilla\/4\.7/",$HTTP_USER_AGENT))) {
    188     $rows="6";
    189 } else {
    190     $rows="8";
    191 } ?>
    192 <?php
    193 // stuff to fix textism.com's WEIRD characters conflict with javascript on IE5Mac
    194 preg_match("/\%u[1-9A-F][1-9A-F][1-9A-F][1-9A-F]/is", $text, $stufftofix);
    195 // ... and so on. currently coding the fix
    196 ?>
    197       <textarea rows="<?php echo $rows ?>" cols="48" style="width:415px;" name="content" id="content" tabindex="2" class="postform"><?php echo $content ?></textarea><br />
    198 <?php
    199 if ($use_quicktags) {
    200 ?>
    201 <script language="JavaScript">
    202 <!--
    203 edCanvas = document.getElementById('content');
    204 //-->
    205 </script>
    206 <?php
    207 }
    208 ?>
    209       <table cellpadding="0" cellspacing="0">
    210         <td align="left" width="90"></td>
    211 <?php if ($pingback) { ?>
    212         <td align="left">
    213           <input type="checkbox" class="checkbox" name="post_pingback" value="1" checked="checked" tabindex="7" id="pingback" /><label for="pingback"> PingBack</label>
    214         </td>
    215 <?php } ?>
    216       </table>
    217 
    218 <?php if (0 /*$use_preview*/) { ?>
    219       <input type="button" value="preview" onClick="preview(this.form);" class="search" tabindex="8" />
    220 <?php } ?>
    221 
    222       <input type="submit" name="submit" value="Blog this !" class="search" tabindex="3" />
    223 
    224 
    225 <?php if ( ($use_fileupload) && ($user_level >= $fileupload_minlevel) && ((ereg(" ".$user_login." ", $fileupload_allowedusers)) || (trim($fileupload_allowedusers)=="")) ) { ?>
    226       <input type="button" value="upload a file" onClick="launchupload();" class="search" />
    227 <?php } ?>
    228 
    229       <script language="JavaScript" type="text/javascript">
    230       <!--
    231           window.focus();
    232           //document.blog.post_content.focus();
    233       //-->
    234       </script>
    235     </td>
    236   </tr>
    237 <?php if ($trackback) { ?>
    238   <tr>
    239     <td width="40">&nbsp;</td>
    240     <td width="415" align="left" height="40">
    241       <label for="trackback"><strong>TrackBack</strong> an <acronym title="Uniform Resource Locator">URL</acronym>:</label> (Separate multiple URLs with commas.)<br />
    242       <input type="text" name="trackback" style="width: 415px" />
    243     </td>
    244   </tr>
    245 <?php } ?>
    246 </table>
    247 
    248 </div>
    249 
    250 </form>
    251 
    252 </div>
     120<?php require('edit-form.php'); ?>
    253121
    254122</body>
  • trunk/wp-admin/edit-form-advanced.php

    r658 r694  
    9393</fieldset>
    9494
    95 <fieldset>
     95<fieldset id="postdiv">
    9696<legend><a href="http://wordpress.org/docs/reference/post/#post" title="Help with post field">Post</a></legend>
    9797        <div id="quicktags">
  • trunk/wp-admin/edit-form.php

    r670 r694  
    2626if ($use_trackback) {
    2727    $form_trackback = '<p><label for="trackback"><a href="http://wordpress.org/docs/reference/post/#trackback" title="Help on trackbacks"><strong>TrackBack</strong> an <acronym title="Uniform Resource Locator">URL</acronym></a>:</label> (Separate multiple <acronym title="Uniform Resource Locator">URL</acronym>s with spaces.)<br />
    28     <input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" /></p>';
     28    <input type="text" name="trackback_url" style="width: 360px" id="trackback" tabindex="7" /></p>';
    2929    if ('' != $pinged) {
    3030        $form_trackback .= '<p>Already pinged:</p><ul>';
     
    4545
    4646<form name="post" action="post.php" method="post" id="post">
     47
     48<?php
     49if ('bookmarklet' == $mode) {
     50    echo '<input type="hidden" name="mode" value="bookmarklet" />';
     51}
     52?>
    4753<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
    4854<input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' />
     
    7480
    7581<br />
    76 <fieldset style="clear:both">
     82<fieldset id="postdiv">
    7783<legend><a href="http://wordpress.org/docs/reference/post/#post" title="Help with post field">Post</a></legend>
    7884        <div id="quicktags">
    7985<?php
    80 if ($use_quicktags) {
     86if ($use_quicktags && 'bookmarklet' != $mode) {
    8187    echo '<a href="http://wordpress.org/docs/reference/post/#quicktags" title="Help with quicktags">Quicktags</a>: ';
    8288    include('quicktags.php');
     
    109115  <input name="saveasprivate" type="submit" id="saveasprivate" tabindex="10" value="Save as Private" />
    110116  <input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="Publish" />
    111   <input name="advanced" type="submit" id="advancededit" tabindex="7" value="Advanced Editing &raquo;" />
     117  <?php if ('bookmarklet' != $mode) {
     118      echo '<input name="advanced" type="submit" id="advancededit" tabindex="7" value="Advanced Editing &raquo;" />';
     119  } ?>
    112120  <input name="referredby" type="hidden" id="referredby" value="<?php echo $HTTP_SERVER_VARS['HTTP_REFERER']; ?>" />
    113121</p>
  • trunk/wp-admin/post.php

    r670 r694  
    678678<p>You can drag the following link to your links bar or add it to your bookmarks and when you "Press it" it will open up a popup window with information and a link to the site you're currently browsing so you can make a quick post about it. Try it out:</p>
    679679<p>
    680    <?php
     680
     681<?php
     682$bookmarklet_height= ($use_trackback) ? 460 : 420;
     683
    681684if ($is_NS4 || $is_gecko) {
    682685?>
    683     <a href="javascript:Q=document.selection?document.selection.createRange().text:document.getSelection();void(window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'<?php echo $bookmarklet_tbpb ?>&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'WordPress bookmarklet','scrollbars=no,width=480,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));">Press It
     686    <a href="javascript:Q=document.selection?document.selection.createRange().text:document.getSelection();void(window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'<?php echo $bookmarklet_tbpb ?>&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'WordPress bookmarklet','scrollbars=no,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));">Press It
    684687    - <?php echo $blogname ?></a>
    685688    <?php
    686689} else if ($is_winIE) {
    687690?>
    688     <a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;void(btw=window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'<?php echo $bookmarklet_tbpb ?>&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'bookmarklet','scrollbars=no,width=480,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));btw.focus();">Press it
     691    <a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;void(btw=window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'<?php echo $bookmarklet_tbpb ?>&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'bookmarklet','scrollbars=no,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));btw.focus();">Press it
    689692    - <?php echo $blogname ?></a>
    690693    <script type="text/javascript" language="JavaScript">
     
    702705} else if ($is_opera) {
    703706?>
    704     <a href="javascript:void(window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=no,width=480,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));">Press it
     707    <a href="javascript:void(window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=no,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));">Press it
    705708    - <?php echo $blogname ?></a>
    706709    <?php
    707710} else if ($is_macIE) {
    708711?>
    709     <a href="javascript:Q='';if(top.frames.length==0);void(btw=window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=no,width=480,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));btw.focus();">Press it
     712    <a href="javascript:Q='';if(top.frames.length==0);void(btw=window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=no,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));btw.focus();">Press it
    710713    - <?php echo $blogname ?></a>
    711714    <?php
  • trunk/wp-admin/wp-admin.css

    r670 r694  
    264264}
    265265
     266#postdiv {
     267    clear: both;
     268}
     269
    266270#poststatusdiv, #commentstatusdiv, #pingstatusdiv {
    267271    width: 6.5em;
Note: See TracChangeset for help on using the changeset viewer.