From e6075fcd0e0529f550a70fb92515599e34b73013 Mon Sep 17 00:00:00 2001 From: michelvaldrighi Date: Sat, 3 Jan 2004 00:13:11 +0000 Subject: [PATCH] edit-form.php now included in bookmarklet.php, added #postdiv selector git-svn-id: http://svn.automattic.com/wordpress/trunk@694 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/bookmarklet.php | 244 ++++++++------------------------ wp-admin/edit-form-advanced.php | 2 +- wp-admin/edit-form.php | 16 ++- wp-admin/post.php | 13 +- wp-admin/wp-admin.css | 4 + 5 files changed, 81 insertions(+), 198 deletions(-) diff --git a/wp-admin/bookmarklet.php b/wp-admin/bookmarklet.php index addbd50bf..80e9d6849 100644 --- a/wp-admin/bookmarklet.php +++ b/wp-admin/bookmarklet.php @@ -3,10 +3,6 @@ // accepts 'post_title' and 'content' as vars passed in. Add-on from Alex King -function selected($selected, $current) { - if ($selected == $current) echo ' selected="selected"'; -} - $mode = 'bookmarklet'; $standalone = 1; @@ -30,11 +26,48 @@ window.close() } else { + $popuptitle = stripslashes($popuptitle); + $text = stripslashes($text); + + /* big funky fixes for browsers' javascript bugs */ + + if (($is_macIE) && (!isset($IEMac_bookmarklet_fix))) { + $popuptitle = preg_replace($wp_macIE_correction["in"],$wp_macIE_correction["out"],$popuptitle); + $text = preg_replace($wp_macIE_correction["in"],$wp_macIE_correction["out"],$text); + } + + if (($is_winIE) && (!isset($IEWin_bookmarklet_fix))) { + $popuptitle = preg_replace("/\%u([0-9A-F]{4,4})/e", "'&#'.base_convert('\\1',16,10).';'", $popuptitle); + $text = preg_replace("/\%u([0-9A-F]{4,4})/e", "'&#'.base_convert('\\1',16,10).';'", $text); + } + + if (($is_gecko) && (!isset($Gecko_bookmarklet_fix))) { + $popuptitle = preg_replace($wp_gecko_correction["in"],$wp_gecko_correction["out"],$popuptitle); + $text = preg_replace($wp_gecko_correction["in"],$wp_gecko_correction["out"],$text); + } + + $post_title = $_REQUEST['post_title']; + if (!empty($post_title)) { + $post_title = stripslashes($post_title); + } else { + $post_title = $popuptitle; + } + + $content = $_REQUEST['content']; + if (!empty($content)) { + $content = stripslashes($content); + } else { + $content = ''.$popuptitle.''."\n$text"; + } + + /* /big funky fixes */ + ?> WordPress > Bookmarklet + - -
- - - + +

WordPress

-
-'.$popuptitle.''."\n$text"; -} - -/* /big funky fixes */ - - -?> - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - -
Category
-
  - - - -
-  
- -
-  
- -
-
  - - - -
-
- -
-
- -
-
  - - - -
Post
- - -
- - - - - - - - -
- -
- - - - - - - - -= $fileupload_minlevel) && ((ereg(" ".$user_login." ", $fileupload_allowedusers)) || (trim($fileupload_allowedusers)=="")) ) { ?> - - - - -
  - (Separate multiple URLs with commas.)
- -
- -
- -
- - + -
+
Post
(Separate multiple URLs with spaces.)
-

'; +

'; if ('' != $pinged) { $form_trackback .= '

Already pinged:

    '; $already_pinged = explode("\n", trim($pinged)); @@ -44,6 +44,12 @@ $saveasdraft = ''; ?>
    + +'; +} +?> @@ -73,11 +79,11 @@ window.onload = focusit;

-
+
Post
Quicktags: '; include('quicktags.php'); } @@ -108,7 +114,9 @@ edCanvas = document.getElementById('content');

- + '; + } ?>

diff --git a/wp-admin/post.php b/wp-admin/post.php index becd6b98d..e5794017b 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -677,15 +677,18 @@ switch($action) {

WordPress bookmarklet

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:

- - Press It + Press It - - Press it + Press it -