From 873dd6bedf82f0900c87d8c1352cfde0674849cc Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 17 Jun 2008 19:36:29 +0000 Subject: [PATCH] Press This changes from noel. see #6813 git-svn-id: https://develop.svn.wordpress.org/trunk@8113 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/css/press-this.css | 8 ++- wp-admin/images/loading-publish.gif | Bin 0 -> 1849 bytes wp-admin/press-this.php | 107 ++++++++++++---------------- 3 files changed, 53 insertions(+), 62 deletions(-) create mode 100644 wp-admin/images/loading-publish.gif diff --git a/wp-admin/css/press-this.css b/wp-admin/css/press-this.css index 8e712e7730..31fbd66d33 100644 --- a/wp-admin/css/press-this.css +++ b/wp-admin/css/press-this.css @@ -111,7 +111,7 @@ text-decoration: none; .howto { font-size: 11px; } -#newtag { padding: 3px; } +#newtag { width: 60%; padding: 3px; } #wphead { height: 2em; @@ -451,4 +451,10 @@ margin-bottom: .25em; } #photo_saving { margin-bottom: 8px; +} + +#post_status { +margin-left: 10px; +margin-bottom: 1em; +display: block; } \ No newline at end of file diff --git a/wp-admin/images/loading-publish.gif b/wp-admin/images/loading-publish.gif new file mode 100644 index 0000000000000000000000000000000000000000..fc1baf55512a96cb6f7925c136015becaa6d6e6a GIT binary patch literal 1849 zcmb8wYfw{X8VB&hIq%6iIhW)Rk%mZ}5P~KlG2s@XSob7c1xf=|Xt|U`3~MOVKt-}G zBDo+0!%Zm`tMyXaqF@Vn>6M6)8EqMNW!ACN+YDCP(bjEYcRST-ce@F*F!``w_WAgH zc;DarpZA$Jdux_%qnUvi=${ajm6i4T-Mhwuf}>qsWhEsu@4fftz(Anm8y&qnGvlz^ z_te$>bo;i~;rMlK?)KEw#Oc$}|5Gvl7Ns{>%zG?5#ZA^dyTs-iv%Pk=dFKY}3)Q=! zm`4C20>{PtP8MWtdpccj%uL*%LBawpW$>0D5<;8AVi@Med^-$h81QTQ-jSSW&)jwY zsNnn+^BD40hSSe{$BLi36rsQW%)?&e5WD!kWV_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 literal 0 HcmV?d00001 diff --git a/wp-admin/press-this.php b/wp-admin/press-this.php index a7d159b969..a3d6360934 100644 --- a/wp-admin/press-this.php +++ b/wp-admin/press-this.php @@ -6,7 +6,7 @@ if ( ! current_user_can('publish_posts') ) wp_die( __( 'Cheatin’ uh?' )); ', "\n", preg_replace('/<\/?p>/','',$content)); #error handling for $post if ( is_wp_error($post_ID) ) { @@ -57,30 +57,6 @@ function press_it() { return $post_ID; } - -function category_div() { ?> -
-
-
-
-

-
-
    - -
-
-

-

-
- -
-

- - -

-
- @@ -110,8 +86,8 @@ if ( 'post' == $_REQUEST['action'] ) { // Ajax Requests $title = wp_specialchars(stripslashes($_GET['t'])); -$selection = trim(wp_specialchars(str_replace("\n", ' ',stripslashes($_GET['s'])))); -$url = $_GET['u']; +$selection = trim(str_replace('\\n', "
", wp_specialchars(js_escape($_GET['s'])))); +$url = clean_url($_GET['u']); $image = $_GET['i']; if($_REQUEST['ajax'] == 'thickbox') { ?>

@@ -154,33 +129,29 @@ if($_REQUEST['ajax'] == 'video') { ?> } if($_REQUEST['ajax'] == 'photo_images') { - error_log('photo images'); function get_images_from_uri($uri) { if(preg_match('/\.(jpg|png|gif)/', $uri)) return "'".$uri."'"; - + $content = wp_remote_fopen($uri); - $host = parse_url($uri); - if ( false === $content ) return ''; + $host = parse_url($uri); + $pattern = '/]*)src=(\"|\')(.+?)(\2)([^>\/]*)\/*>/is'; preg_match_all($pattern, $content, $matches); - if ( empty($matches[1]) ) { error_log('empty'); return ''; }; + + if ( empty($matches[1]) ) return ''; + $sources = array(); - foreach ($matches[3] as $src) { - error_log($src); - #if ( false !== strpos($src, '&') ) continue; - if(strpos($src, 'http') === false) { - if(strpos($src, '../') === false && strpos($src, './') === false) { - $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src); - } else { - $src = 'http://'.str_replace('//','/', $host['host'].'/'.$host['path'].'/'.$src); - } - } - - $sources[] = $src; + if(strpos($src, 'http') === false) + if(strpos($src, '../') === false && strpos($src, './') === false) + $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src); + else + $src = 'http://'.str_replace('//','/', $host['host'].'/'.$host['path'].'/'.$src); + + $sources[] = $src; } return "'" . implode("','", $sources) . "'"; } @@ -226,11 +197,8 @@ if($_REQUEST['ajax'] == 'photo_js') { ?> if (img.width && img.height) { if (img.width * img.height < 2500) skip = true; aspect = img.width / img.height; - if (aspect > 1) { // Image is wide - scale = 75 / img.width; - } else { // Image is tall or square - scale = 75 / img.height; - } + scale = (aspect > 1) ? (75 / img.width) : (75 / img.height); + if (scale < 1) { w = parseInt(img.width * scale); h = parseInt(img.height * scale); @@ -252,15 +220,12 @@ if($_REQUEST['ajax'] == 'photo_js') { ?> -
-
> @@ -317,7 +282,8 @@ if($_REQUEST['ajax'] == 'photo') { ?> accessibility_focus : false, tab_focus : ":next", plugins : "safari,inlinepopups", - entities : "38,amp,60,lt,62,gt" + entities : "38,amp,60,lt,62,gt", + force_p_newlines : true }); @@ -349,6 +315,7 @@ if($_REQUEST['ajax'] == 'photo') { ?> jQuery("#post_type").val(type); } function set_editor(text) { + if(tinyMCE.activeEditor) tinyMCE.activeEditor.setContent(''); if(tinyMCE.activeEditor) tinyMCE.execCommand('mceInsertContent' ,false, text); } @@ -369,11 +336,7 @@ if($_REQUEST['ajax'] == 'photo') { ?> jQuery('#content_type').show(); set_menu('text'); set_title(''); - - set_editor(''.$selection.'

'; ?>'); - - set_editor(''.$title.'

'; ?>'); - + return false; break; case 'quote' : @@ -499,7 +462,29 @@ if($_REQUEST['ajax'] == 'photo') { ?>
- +
+
+
+
+

+
+
    + +
+
+

+

+
+
+ + +

+ + +

+
+ +