Changeset 694
- Timestamp:
- 01/03/2004 12:13:11 AM (21 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/bookmarklet.php
r628 r694 3 3 4 4 // 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 }9 5 10 6 $mode = 'bookmarklet'; … … 31 27 } else { 32 28 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 33 65 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 34 66 <html xmlns="http://www.w3.org/1999/xhtml"> … … 36 68 <title>WordPress > Bookmarklet</title> 37 69 <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 ?>" /> 38 71 <script type="text/javascript" language="javascript"> 39 72 <!-- … … 46 79 <style type="text/css"> 47 80 <!-- 48 body {49 }50 81 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 { 56 83 border-width: 1px; 57 84 border-color: #cccccc; … … 61 88 } 62 89 63 .checkbox {90 #wpbookmarklet .checkbox { 64 91 background-color: #ffffff; 65 92 border-width: 0px; … … 68 95 } 69 96 70 textarea {97 #wpbookmarklet textarea { 71 98 font-family: Verdana, Geneva, Arial, Helvetica; 72 99 font-size: 0.9em; 73 100 } 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 74 114 --> 75 115 </style> 76 116 </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> 82 119 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"> </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"> </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> <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> <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"> </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"> </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"> </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'); ?> 253 121 254 122 </body> -
trunk/wp-admin/edit-form-advanced.php
r658 r694 93 93 </fieldset> 94 94 95 <fieldset >95 <fieldset id="postdiv"> 96 96 <legend><a href="http://wordpress.org/docs/reference/post/#post" title="Help with post field">Post</a></legend> 97 97 <div id="quicktags"> -
trunk/wp-admin/edit-form.php
r670 r694 26 26 if ($use_trackback) { 27 27 $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>'; 29 29 if ('' != $pinged) { 30 30 $form_trackback .= '<p>Already pinged:</p><ul>'; … … 45 45 46 46 <form name="post" action="post.php" method="post" id="post"> 47 48 <?php 49 if ('bookmarklet' == $mode) { 50 echo '<input type="hidden" name="mode" value="bookmarklet" />'; 51 } 52 ?> 47 53 <input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" /> 48 54 <input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' /> … … 74 80 75 81 <br /> 76 <fieldset style="clear:both">82 <fieldset id="postdiv"> 77 83 <legend><a href="http://wordpress.org/docs/reference/post/#post" title="Help with post field">Post</a></legend> 78 84 <div id="quicktags"> 79 85 <?php 80 if ($use_quicktags ) {86 if ($use_quicktags && 'bookmarklet' != $mode) { 81 87 echo '<a href="http://wordpress.org/docs/reference/post/#quicktags" title="Help with quicktags">Quicktags</a>: '; 82 88 include('quicktags.php'); … … 109 115 <input name="saveasprivate" type="submit" id="saveasprivate" tabindex="10" value="Save as Private" /> 110 116 <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 »" /> 117 <?php if ('bookmarklet' != $mode) { 118 echo '<input name="advanced" type="submit" id="advancededit" tabindex="7" value="Advanced Editing »" />'; 119 } ?> 112 120 <input name="referredby" type="hidden" id="referredby" value="<?php echo $HTTP_SERVER_VARS['HTTP_REFERER']; ?>" /> 113 121 </p> -
trunk/wp-admin/post.php
r670 r694 678 678 <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> 679 679 <p> 680 <?php 680 681 <?php 682 $bookmarklet_height= ($use_trackback) ? 460 : 420; 683 681 684 if ($is_NS4 || $is_gecko) { 682 685 ?> 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 It686 <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 684 687 - <?php echo $blogname ?></a> 685 688 <?php 686 689 } else if ($is_winIE) { 687 690 ?> 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 it691 <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 689 692 - <?php echo $blogname ?></a> 690 693 <script type="text/javascript" language="JavaScript"> … … 702 705 } else if ($is_opera) { 703 706 ?> 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 it707 <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 705 708 - <?php echo $blogname ?></a> 706 709 <?php 707 710 } else if ($is_macIE) { 708 711 ?> 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 it712 <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 710 713 - <?php echo $blogname ?></a> 711 714 <?php -
trunk/wp-admin/wp-admin.css
r670 r694 264 264 } 265 265 266 #postdiv { 267 clear: both; 268 } 269 266 270 #poststatusdiv, #commentstatusdiv, #pingstatusdiv { 267 271 width: 6.5em;
Note: See TracChangeset
for help on using the changeset viewer.