Author |
Topic |
sr_erick
Senior Member
USA
1318 Posts |
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
|
Classicmotorcycling
Development Team Leader
Australia
2084 Posts |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 15 March 2005 : 07:05:53
|
Gimme a bit and I'll try and come up with something over lunch (GMT). Seem to remember someone doing this before but I can't find it now.
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 15 March 2005 : 08:27:34
|
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
Edited by - Shaggy on 15 March 2005 10:39:29 |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 15 March 2005 : 08:47:52
|
*sits patiently awaiting the bug reports! *
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 15 March 2005 : 10:41:16
|
Is that with or without the [url] tag? Figured the changes to edit_hrefs wouldn't work sraight off! Looks like the problem's being cused by this:
sLink.substring((iLLength-iHLength),iHLength)
Can't figure out why, though.
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 15 March 2005 : 11:03:06
|
Well, it's definitely that snippet above, then. Don't know why, even if it started trimming the right hand side from the wrong character (iLLength-iHLength), it should still only show iHLength characters from that point.
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 15 September 2005 : 05:32:55
|
If I may be so bold, I'd like to bump this topic once again.... I've noticed that FireFox seems to have some problems with wrapping long urls. In IE the url is wrapped at characters such as -, but in FireFox it's not...resulting in some odd looking layout.< |
portfolio - linkshrinker - oxle - twitter |
Edited by - MarcelG on 15 September 2005 14:08:08 |
|
|
Astralis
Senior Member
USA
1218 Posts |
Posted - 24 September 2005 : 01:53:30
|
I think this would be excellent. Long URLs are a pain when they stretch the page.< |
|
|
tribaliztic
Senior Member
Sweden
1532 Posts |
|
golfmann
Junior Member
United States
450 Posts |
Posted - 06 November 2005 : 07:52:46
|
I converted a format button (actually the teletype add on one) to put THIS code when clicked:
You then paste the long url in at the left ", manually, and can change 'Link' to any word, color, etc..
COULD it be possible to COMBINE these and instead of trimming at x number of spaces, place the url string inside this between the url=" "'s?
So IF under the length it's normal, over is that above, putting the word link, click here or whatever in there with the actual link embedded behind it?
just a thought... < |
Edited by - golfmann on 06 November 2005 08:08:24 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 07 November 2005 : 10:25:40
|
Been looking and looking and looking at this and still can't see where it's tripping up. All I can suggest is that ye try replacing my edited edit_hrefs function with the following:function edit_hrefs(sURL, iType) {
sOutput = new String(sURL);
iMLength = intMaxLinkLength;
iHLength = iMLength/2;
iLLength = parseInt(sOutput.length);
if(iLLength>=iMLength&&iType!=4)sLink=sOutput.substring(0,iHLength)+"..."+sOutput.substring((iLLength-iHLength),iHLength);
else sLink = sOutput;
if (iType == 1) {
sOutput = sOutput.replace(/\b(http\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
"<a href=\"$1\" target=\"_blank\">"+sLink+"<\/a>");
} else if (iType == 2) {
sOutput = sOutput.replace(/\b(https\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
"<a href=\"$1\" target=\"_blank\">"+sLink+"<\/a>");
} else if (iType == 3) {
sOutput = sOutput.replace(/\b(www\.[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
"<a href=\"http://$1\" target=\"_blank\">"+sLink+"<\/a>");
} else if (iType == 4) {
sOutput = sOutput.replace(/\b([\w+\-\'\#\%\.\_\,\$\!\+\*]+@[\w+\.?\-\'\#\%\~\_\.\;\,\$\!\+\*]+\.[\w+\.?\-\'\#\%\~\_\.\;\,\$\!\+\*]+)/gi,
"<a href=\"mailto\:$1\">$1<\/a>");
} else if (iType == 5) {
sOutput = sOutput.replace(/\b(ftp\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
"<a href=\"$1\" target=\"_blank\">"+sLink+"<\/a>");
} else if (iType == 6) {
sOutput = sOutput.replace(/\b(file\:\/\/\/[\w+\:\/\\]+[\w+\/\w+\.\:\/\\\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
"<a href=\"$1\" target=\"_blank\">"+sLink+"<\/a>");
}
return sOutput;
} If that doesn't work then maybe we should try looking at acheiving this with Gary's RegExp based edit_hrefs function.
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
Topic |
|