Page Index Toggle Pages: 1
Topic Tools
Normal Topic URL in LivePreview (Read 1,679 times)
Jet Li
Legacy Dev Team
Development Team
****
Offline



Posts: 6,588
Location: Hong Kong
Re: URL in LivePreview
Reply #5 - Jan 1st, 2010 at 12:55pm
Post Tools
New
yabbc.js
in CVS.
  

PM me for YaBB Installation Service
Back to top
WWWGTalkFacebook  
IP Logged
 
Captain John
Ex Member


Re: URL in LivePreview
Reply #4 - Dec 31st, 2009 at 8:47pm
Post Tools
need in CVS
  
Back to top
 
IP Logged
 
deti
Legacy Dev Team
Development Team
****
Offline



Posts: 2,650
Location: Prien am Chiemsee, Germany
Re: URL in LivePreview
Reply #3 - Jun 6th, 2009 at 7:35pm
Post Tools
New yabbfiles/yabbc.js in SVN.

Works. Thanks Carsten!!!
  

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
Back to top
WWW  
IP Logged
 
Carsten
Ex Member


Re: URL in LivePreview
Reply #2 - Jun 5th, 2009 at 9:12pm
Post Tools
hmm - not allowed to modify posts??

the first code added should be:

Code
Select All
	if(autolinkurls != 0) ubbcstr=ubbcstr.replace(/((http\:\/\/|www\.){1,}\S+?\.\S+)/ig, "[url]$1[/url]"); 


  
Back to top
 
IP Logged
 
Carsten
Ex Member


Re: URL in LivePreview
Reply #1 - Jun 5th, 2009 at 8:46pm
Post Tools
In yabbc.js find
Code
Select All
	ubbcstr=ubbcstr.replace(/\[url\]\s*www\.(\S+?)\s*\[\/url\]/ig, "<a href='http://www.$1' target='_blank'>www.$1</a>"); 


and add before
Code
Select All
	if(autolinkurls != 0) ubbcstr=ubbcstr.replace(/(([http\:\/\/]{0,})www\.\S+?\.\S+)/ig, "[url]$1[/url]"); 



Still in yabbc.js find
Code
Select All
	ubbcstr=ubbcstr.replace(/\[url\]\s*(\S+?)\s*\[\/url\]/ig, "<a href='$1' target='_blank'>$1</a>"); 


and add after
Code
Select All
	ubbcstr=ubbcstr.replace(/\[url\]|\[\/url\]/ig, ""); 



Not 'heavily' tested, but i think it'll work  Smiley
  
Back to top
 
IP Logged
 
deti
Legacy Dev Team
Development Team
****
Offline



Posts: 2,650
Location: Prien am Chiemsee, Germany
URL in LivePreview
Jun 5th, 2009 at 5:54pm
Post Tools
If I write an URL here in the message textfield
Quote:

and turn the LivePreview on, the URL isn't clickable as it is after I click on the "Preview" button. I must use the [url] tag to make it clickable in the LivePreview.

Carsten, can you please give a look at this? Thanks!
« Last Edit: Jun 5th, 2009 at 5:57pm by deti »  

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Topic Tools
 
  « Board Index ‹ Board  ^Top