In-Line Comments


It can be useful for multiple authors to be able to leave notes & comments for each other within the body of text (this happens in various word processors for example). This action is a simple commenting system that allows authors to leave notes within the body of the text. I've also modified the file (colours & indicator letter) to provide in-line "Help" information.

This action takes advantage of the wonderful little tooltip script written by Walter Zorn and available at http://www.walterzorn.com/tooltip/tooltip_e.htm

Place the tooltip script (with it's original name wz_tooltip.js) in the wiki root in a directory called scripts. Make sure to copy the .htaccess file from eg. the action folder to prevent RewriteRules from applying, or see http://wush.net/trac/wikka/browser/branches/1.1.6.2/css/.htaccess

Place the following code, in a file called tag.php, in the actions directory...
<?php
//       tag.php V1.0 copyright by G. M. Bowen & Andrew Somerville for use in wikka wiki as part of a SSHRC research project.
//  Released under GPL.
//  Useage: {{tag comment="This is a comment on this part of the paragraph!"}}
//  REQUIRES Walter Zorn's wz_tooltip.js to be placed in a directory called "scripts" in the wikka root directory
//  Note to users....there's LOTS of room for modifying this tooltip for your own uses. I've only used a few of the available features....see the original site.

echo '<span onmouseover="'.
        'this.T_FONTCOLOR=\'#000066\';'.
        'this.T_BORDERWIDTH=1;'.
        'this.T_WIDTH=\'225\';'.
        'this.T_BGCOLOR=\'#e6ecff\';'. 
        'this.T_FONTSIZE=\'12px\';'.
        'this.T_PADDING=\'5\';'.
        'this.T_TITLE=\'Comment...\';'.
        'return escape(\'' . strip_tags($comment). '\')"><sup><strong><span class=\'exttail\'>T</span></strong></sup></span>';

echo "<script language=\"JavaScript\" type=\"text/javascript\" src=\"./scripts/wz_tooltip.js\"></script>"; 
?>


I've modified and updated this handy gadget to work with Walter Zorn's latest tooltip v5.31 (the tag.php v1.0 above only works with the older tooltip version 3.45), and also added a link parameter so that clicking on the tag leads to a page that can be referenced in the tooltip. Playing around with the settings in wz_tooltip.js is worth it to make the tooltip look the way you like it.

<?php
//  tag.php v2.0 copyright by Axel Mulder for use in wikka wiki.
//  Released under GPL.
//  Useage: {{tag comment="This is a brief comment - for more info please go to WikkaPage by clicking on the link of this tag." link="WikkaPage" name="Tag name"}}
//  REQUIRES Walter Zorn's wz_tooltip.js v5.31 or higher to be placed in a directory called "scripts" in the wikka root directory
//  Make sure to copy the .htaccess file from eg. the action folder to prevent RewriteRules from applying, or see http://wush.net/trac/wikka/browser/branches/1.1.6.2/css/.htaccess
//  Note to users....there's LOTS of room for modifying this tooltip for your own uses. I've only used a few of the available features....see the original site.

if ($name == '') $name = 'Note';
if ($link == '') $link = $this->Href("",$tag,"");

echo '<span onmouseover="Tip(\'' . $comment . '\')" onmouseout="UnTip()"><sup><strong><span class=\'exttail\'><a href=\'' . $link . '\'>' . $name . '</a></span></strong></sup></span>';

echo "<script type=\"text/javascript\" src=\"./scripts/wz_tooltip.js\"></script>";
?>


/AxelMulder


CategoryUserContributions
There are 3 comments on this page. [Show comments]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki