+ Reply to Thread
Results 1 to 2 of 2

Thread: Adding tooltips on content text

  1. #1
    Join Date
    Sep 2007
    Location
    Cape Town, South Africa
    Posts
    123

    Default Adding tooltips on content text

    Is there a way of using tooltips on content text without disabling safe-html? Is there an extension function perhaps?
    Psa 33:5 He loves righteousness and justice; the earth is full of the steadfast love of the LORD

  2. #2
    Join Date
    Sep 2007
    Location
    Cape Town, South Africa
    Posts
    123

    Default

    Here's what i've got so far. This will allow you to add tooltips with editor/safe-html setting = to false. Which is not what my original post was about, but I thought people should know this.

    1) Make 'customscripts' directory

    Code:
    sudo mkdir /var/www/deki-hayes/customscripts
    2) Download the javascript files here http://www.walterzorn.com/scripts/wz_tooltip.zip


    3) Extract the js files to 'customscripts' dir

    Code:
    sudo unzip -u wz_tooltip.zip -d /var/www/deki-hayes/customscripts
    4) Change owner to www-data

    Code:
    sudo chown -R www-data /var/www/deki-hayes/customscripts
    5) Tell apache not to rewrite the customscripts path

    Code:
    sudo nano /etc/apache2/sites-enabled/deki
    a) Add the following line just after RewriteCond %{REQUEST_URI} !/(@api|editor|skins|config)/ and save the file

    Code:
    RewriteCond %{REQUEST_URI} !/(customscripts/|customscripts)
    6) Restart apache and dekihost

    Code:
    sudo /etc/init.d/apache2 restart
    sudo /etc/init.d/dekihost restart
    7) Embed the script in a wiki page

    Code:
    {{  unsafe.script("http://192.168.1.15/customscripts/wz_tooltip.js")  }}
    8) Call the tooltip function in wiki page

    Code:
    <a onmouseover="Tip('Place tooltip text here')"> This will display the tooltip</a>
    9) You can also display a tooltip with html tables in it

    Code:
    <a onmouseover="Tip('
    <table border=\'0\' cellspacing=\'5\'>
      <tr>
        <th colspan=\'2\' style=\'font-size:8pt;background:#ffcccc;\'>HTML table in tooltip<\/th>
      <\/tr>
      <tr>
        <td style=\'font-size:8pt;background:#ffffff;\'>Row 2, Cell 1<\/td>
        <td style=\'font-size:8pt;background:#ffffff;\'>Row 2, Cell 2<\/td>
      <\/tr>
      <tr>
        <td style=\'font-size:8pt;background:#ffffff;\'>Row 3, Cell 1<\/td>
        <td style=\'font-size:8pt;background:#ffffff;\'>Row 3, Cell 2<\/td>
      <\/tr>
    <\/table>
     ')This will display a tooltip with an html table in it</a>
    Psa 33:5 He loves righteousness and justice; the earth is full of the steadfast love of the LORD

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts