From 2b4f2fd621e9b1ee16bc36f6b45382ceaa4dce93 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 28 May 2008 18:18:44 +0000 Subject: [PATCH] Press this reorg. Remove old bookmarklet. Props noel. see #7049 git-svn-id: http://svn.automattic.com/wordpress/trunk@8007 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/bookmarklet.php | 107 -------- wp-admin/css/press-this.css | 53 ++-- wp-admin/press-this.php | 469 ++++++++++++++++-------------------- 3 files changed, 219 insertions(+), 410 deletions(-) delete mode 100644 wp-admin/bookmarklet.php diff --git a/wp-admin/bookmarklet.php b/wp-admin/bookmarklet.php deleted file mode 100644 index 8618458daf..0000000000 --- a/wp-admin/bookmarklet.php +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - -post_title = stripslashes($post_title); -else - $post->post_title = $popuptitle; - - -$content = wp_specialchars($_REQUEST['content']); -$popupurl = clean_url($_REQUEST['popupurl']); -if ( !empty($content) ) { - $post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) ); -} else { - $post->post_content = ''.$popuptitle.''."\n$text"; -} - -/* /big funky fixes */ - -?> - - -<?php bloginfo('name') ?> › Bookmarklet — WordPress - - - - - - - - - - - - - - diff --git a/wp-admin/css/press-this.css b/wp-admin/css/press-this.css index c71076735c..f9533eebbe 100644 --- a/wp-admin/css/press-this.css +++ b/wp-admin/css/press-this.css @@ -3,7 +3,7 @@ body { margin: 0px; padding: 0px; } - +/* Tabs */ @media projection , screen { .ui-tabs-hide { display: none; @@ -16,16 +16,6 @@ body { } } -/* Skin */ -div.ui-tabs-panel { - border: none; - width: 100%; - height: auto; - margin: 0; - padding: 0; - position: relative; -} - .ui-tabs-nav { list-style: none; border-bottom: 1px solid #C6D9E9; @@ -34,6 +24,16 @@ div.ui-tabs-panel { margin-top: -2em; } +/* Additional IE specific bug fixes... */ +* html .ui-tabs-nav { /* auto clear, @ IE 6 & IE 7 Quirks Mode */ + display: inline-block; +} + +* :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)... */ + display: inline-block; +} + .ui-tabs-nav:after { /* clearing without presentational markup, IE gets extra treatment */ display: block; @@ -77,39 +77,16 @@ div.ui-tabs-panel { -webkit-border-top-right-radius: 4px; border-style: solid; border-width: 1px; -} - -.ui-tabs-nav .ui-tabs-selected a { background: white; border-bottom-width: 2px; margin-top: -2px; } -.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... */ +.ui-tabs-nav a:hover,.ui-tabs-nav a:focus,.ui-tabs-nav a:active, +.ui-tabs-nav .ui-tabs-selected a:link,.ui-tabs-nav .ui-tabs-selected a:visited { cursor: pointer; } -.ui-tabs-nav a:hover,.ui-tabs-nav a:focus,.ui-tabs-nav a:active,.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... */ - cursor: pointer; -} - -.ui-tabs-loading em { - padding: 0 0 0 20px; - background: url(../images/loading.gif) no-repeat 0 50%; -} - -/* Additional IE specific bug fixes... */ -* html .ui-tabs-nav { /* auto clear, @ IE 6 & IE 7 Quirks Mode */ - display: inline-block; -} - -* :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)... */ - display: inline-block; -} - #wphead { border-top: none; } @@ -212,7 +189,7 @@ div#container form { div#categories { font-size: 85%; position: absolute; - top: 1.9em; + right: 16px; width: 27%; z-index: 2; @@ -308,7 +285,7 @@ div#categories h2 { } .submitbox { - width: 180px; + width: 100%; float: right; } diff --git a/wp-admin/press-this.php b/wp-admin/press-this.php index a14cf8a828..89de839913 100644 --- a/wp-admin/press-this.php +++ b/wp-admin/press-this.php @@ -19,24 +19,19 @@ function press_it() { $content = ''; switch ( $_REQUEST['post_type'] ) { - case 'regular': + case 'text': $content = $_REQUEST['content']; - if ($_REQUEST['content2']) - $content .= $_REQUEST['content2']; - break; case 'quote': - $content = '
' . $_REQUEST['content']; - if ($_REQUEST['content2']) { - $content .= '
- '; - $content = $content . $_REQUEST['content2']; - } + $content = $_REQUEST['content']; break; case 'photo': + +// http_post_data(); + if ($_REQUEST['photo_link']) - $content = ''; + $content = ''; $content .= ''; @@ -49,11 +44,9 @@ function press_it() { break; case "video": - list($garbage,$video_id) = split("v=", $_REQUEST['content']); - $content = ''; - if ($_REQUEST['content2']) - $content .= "\n" . $_REQUEST['content2']; - break; + $content = $_REQUEST['content']; + + break; } $quick['post_content'] = $content; @@ -95,6 +88,9 @@ function category_div() { function get_images_from_uri($uri) { $content = wp_remote_fopen($uri); + $uri = str_replace(basename($uri), '', $uri); + $host = parse_url($uri); + if ( false === $content ) return ''; $pattern = '/]+src=[\'"]([^\'" >]+?)[\'" >]/is'; @@ -102,23 +98,42 @@ function get_images_from_uri($uri) { if ( empty($matches[1]) ) return ''; $sources = array(); + foreach ($matches[1] as $src) { if ( false !== strpos($src, '&') ) continue; - - $host = parse_url($_GET['u']); - - if (strpos($src, 'http://') === false) { - $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src); - } + $src = 'http://'.str_replace('//','/', $host['host'].'/'.$host['path'].'/'.$src); $sources[] = $src; } return "'" . implode("','", $sources) . "'"; } -function press_this_js_init() { ?> - + + > + + + <?php _e('Press This') ?> + + + + - - @@ -227,206 +330,57 @@ if ( empty($_GET['tab']) ) { -
-
- - - - -
+ - +
-

+

- + +
+ -

-
- -
- -
- -

-
- -
- - -
-
-
-
- - -

+

- -
- - - -
- -
- - - -
- - - -
-

-
- -
- -

-
- -
- - -
- -
- - - -
- - - -
-

-
- -
- -

-
-
- -

-
- -
- + +
- -
- - - -
- - - -
- -

-
- -
- + + @@ -436,22 +390,7 @@ exit;

- - -

(optional)') ?>

- -
- -
- - -
- - - \ No newline at end of file + + + + \ No newline at end of file