Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#6998 closed enhancement (fixed)

Press This: Make UI look more like admin area and fix relative URIs

Reported by: noel's profile noel Owned by: ryan's profile ryan
Milestone: 2.6 Priority: high
Severity: normal Version:
Component: Template Keywords:
Focuses: Cc:

Description

The Press This bookmarklet needed some formatting to get it looking more wordpress like. This is the first of many diffs coming.

I also modified the function used to get images from a uri so it would not mess up images with relative URIs.

Attachments (5)

press-this.diff (33.3 KB) - added by noel 16 years ago.
Press This enhancement diff.
press-this-parse_url.patch (531 bytes) - added by azaozz 16 years ago.
press-this-5-21-08-5pm.diff (20.1 KB) - added by noel 16 years ago.
moves stylesheet inline and attempts to fix tag area behavior.
press-this-menu-colors.patch (7.7 KB) - added by azaozz 16 years ago.
6998-css.diff (1.6 KB) - added by mdawaffe 16 years ago.
more specific selectors

Download all attachments as: .zip

Change History (23)

@noel
16 years ago

Press This enhancement diff.

#1 @DD32
16 years ago

I also modified the function used to get images from a uri so it would not mess up images with relative URIs.

Heres some code i currently use to determine the real URL of a relative url'd image, Not sure if it'll be of any use though.

function im_url_join($one, $two){
	//defaults:
	$port = "80";
	$scheme = $host = $path = '';
	$url = parse_url($one);
	extract($url);
	if( ! empty($query) )
		$query = "?$query";
	
	$port = ($port != 80) ? ':' . $port : '';
	
	if( substr($path, -1) != '/') //If path is to a file, direct back to a folder.
		$path = trailingslashit(rtrim(dirname($path),'\\'));
	
	if( strpos($two, '://') > -1 ) // http:// .../...jpg
		return $two;
	
	if( $two[0] == '/' ) //   /file.jpg
		return "{$scheme}://{$host}{$port}{$two}";
	
	if( substr($two,0, 3) == '../' ){
		$path = trailingslashit(rtrim(dirname($path),'\\'));
		$two = substr($two, 3);
		return im_url_join("{$scheme}://{$host}{$port}{$path}{$query}", $two);
	}
	return "{$scheme}://{$host}{$port}{$path}{$two}"; // simply file.jpg
}

Example:

$one = 'http://google.com/pagename/';
$two = '../images/image.jpg';
$return = 'http://google.com/images/image.jpg

#2 @ryan
16 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [7957]) Press This styling updates from noel. fixes #6998

#3 @azaozz
16 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Just a small correction: the parse_url "component" parameter is only php 5.1.2+, so the "Photo" tab fails on servers running php 4.

#4 @ryan
16 years ago

(In [7966]) Don't use php 5 only component parameter to parse_url. Props azaozz. see #6998

#5 @ryan
16 years ago

After the removal of all the TB CSS from the press-this css as part of another ticket, the "Visit:" link is floating high (in Mac FF2).

#6 follow-up: @ryan
16 years ago

Tag addition isn't working properly. There's no suggest and clicking Add does a page load.

@noel
16 years ago

moves stylesheet inline and attempts to fix tag area behavior.

#7 in reply to: ↑ 6 @noel
16 years ago

Replying to ryan:

Tag addition isn't working properly. There's no suggest and clicking Add does a page load.

Tag addition *still* doesn't work in Firefox if you switch tabs.

#8 @noel
16 years ago

When I said it doesn't work in Firefox, I meant to say "it doesn't work in Safari." :)

#9 follow-up: @ryan
16 years ago

Do styles needs to be inline? We lose caching of them, especially now that we have the gears cache.

#10 @ryan
16 years ago

(In [7983]) Press This fixes from noel. see #6998

#11 in reply to: ↑ 9 ; follow-up: @noel
16 years ago

Replying to ryan:

Do styles needs to be inline? We lose caching of them, especially now that we have the gears cache.

I think, regardless, that will speed things up - not everyone is utilizing gears either. No?

#12 in reply to: ↑ 11 @azaozz
16 years ago

Replying to noel:

Replying to ryan:

Do styles needs to be inline? We lose caching of them, especially now that we have the gears cache.

I think, regardless, that will speed things up - not everyone is utilizing gears either. No?

Without Gears the css files would already be cached in the browser, so it's faster. Also currently the menu colours aren't right when using colors-classic.

#13 @azaozz
16 years ago

The patch fixes the menu colours so they follow the colour theme selected.

The ajax loading of the tabs doesn't play well with TinyMCE and the tag suggest field. Each time a tab is switched, another instance of TinyMCE is initialized without removing the old one. The tag suggest doesn't seem to initialize at all.

Tested replacing the whole page instead of loading most of it with ajax. Seems to be at least as fast as now and a bit faster with Gears enabled. Perhaps we could do that.

Another option would be to load with ajax only the parts that are different between the four tabs. In TinyMCE we can add, append, replace, remove content easily. This way we won't have to reload and re-initialize TinyMCE, the tag suggest script and the categories list.

#14 @ryan
16 years ago

(In [7993]) Press This: Obey color scheme. Props azaozz. see #6998

#15 @ryan
16 years ago

Either way sounds good to me. Whatever is cleanest or easiest assuming speed is comparable.

#16 @mdawaffe
16 years ago

6998-css.diff

Make some of the color CSS selectors more specific so that the category tabs on the Write page don't get messed up.

@mdawaffe
16 years ago

more specific selectors

#17 @ryan
16 years ago

(In [8013]) Make some of the color CSS selectors more specific so that the category tabs on the Write page don't get messed up. Props mdawaffe. see #6998

#18 @ryan
16 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.