Javascript Tooltips, Popups, Captions - BoxOver  

Go Back   Javascript Tooltips, Popups, Captions - BoxOver > BoxOver > Bugs
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 11-12-2006, 09:20 PM
jamesm jamesm is offline
Junior Member
 
Join Date: Nov 2006
Posts: 7
Default Can't use [ and ] in tooltips

Is there a way to use these? Perhaps an escape character?

Thanks!
Reply With Quote
  #2  
Old 11-13-2006, 01:18 PM
olly olly is offline
Administrator
 
Join Date: Jul 2005
Posts: 82
Default Escape sequences

Hi James,

To use [ you must use [[ and for ] use ]] - this is the way I chose to escape them,

Code:
...header=[this text will be in the [[ header ]...
Will display

"this text will be in the [ header "
__________________
Javascript tooltips / popups
Reply With Quote
  #3  
Old 11-13-2006, 06:22 PM
jamesm jamesm is offline
Junior Member
 
Join Date: Nov 2006
Posts: 7
Default

hmmm

When I tried doing this:

[[x]]Example 1[[/x]]

it was displayed like this:

[x]Example 1[[/x]]

I tried:
[[x]]Example 1[/x]

but that was cut off at the first b.

Thanks!!
Reply With Quote
  #4  
Old 02-23-2007, 10:10 PM
Vindexus Vindexus is offline
Junior Member
 
Join Date: Nov 2006
Posts: 1
Default

I'm getting the same thing as well.

It appears that the code only displays [ for [[ and ] for ]] once, then doesn't do it again.

Edit: I think I found the code
Quote:
if(res)
return res[2].replace('[[','[').replace(']]',']');
If I recall correctly, JS only replaces ONCE with the .replace function.

Last edited by Vindexus : 02-23-2007 at 10:13 PM.
Reply With Quote
  #5  
Old 03-02-2007, 01:44 PM
keithleeds keithleeds is offline
Junior Member
 
Join Date: Mar 2007
Location: Oregon
Posts: 3
Send a message via Yahoo to keithleeds
Default a fix...

You're accurate, replace() only does one occurrence, by design. Standard regular expression syntax applies.

...replace(/[[/g, '[') and ...replace(/]]/g,']') should do the trick, appending the global option 'g'

-K
Reply With Quote
  #6  
Old 04-12-2007, 07:58 PM
Nocturnal Nocturnal is offline
Junior Member
 
Join Date: Apr 2007
Posts: 1
Default

That doesn't work for me. When I use multiple [[ and ]] pairs substitution doesn't catch them all, even with the /[[/g pattern. I'm not familiar enough with Javascript to suggest a fix yet. Should I come up with one I'll post it. I suspect that multiple [[ and/or ]] pairs messes up the initial regexp of the function getParam.

Why not escape [ and ] with a backslash? Or perhaps a &lbr; and &rbr;? I suppose we can do whatever we like because we have the source but I'm curious about the reasoning.

This minor issue aside I'm very happy with boxover, thanks for making it available!
Reply With Quote
  #7  
Old 08-10-2007, 09:43 AM
mirecxp mirecxp is offline
Junior Member
 
Join Date: Aug 2007
Posts: 1
Default

Still no solution for this ?
BoxOver is nice, but for me this is blocking for using it...
Reply With Quote
  #8  
Old 09-22-2007, 08:30 PM
Sirdude Sirdude is offline
Junior Member
 
Join Date: Sep 2007
Posts: 3
Cool Here's how i got it to work

It's really taking the above and putting it to work, but i figured i'd post it for anyone who cares

php code snippet:

Code:
$PostBody = str_replace("]", "&rbr;", str_replace("[", "&lbr;", $PostBody)); $Tooltip = "title=\"header=[Hi, this is a preview] body=[{$PostBody}]\"";
boxover.js tweak:

Code:
if(res) return res[2].replace(/&lbr;/g,'[').replace(/&rbr;/g,']'); else return '';
i used the &rbr and &lbr, so as to not jerk with the huge honking regex. This works fine.

Enjoy,
SD
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 08:03 AM.