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 | Owned by: | 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)
Change History (23)
#1
@
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
#3
@
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.
#5
@
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:
↓ 7
@
16 years ago
Tag addition isn't working properly. There's no suggest and clicking Add does a page load.
#7
in reply to:
↑ 6
@
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
@
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:
↓ 11
@
16 years ago
Do styles needs to be inline? We lose caching of them, especially now that we have the gears cache.
#11
in reply to:
↑ 9
;
follow-up:
↓ 12
@
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
@
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
@
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.
#15
@
16 years ago
Either way sounds good to me. Whatever is cleanest or easiest assuming speed is comparable.
#16
@
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.
Press This enhancement diff.