I made the changes to smwfParseAttributesAfterTidyCallback() that you
suggested. Below is my patch in case anyone else is interested. Not sure if
I considered all the ramification of this change and I've only just started
to use it, so proceed with caution if you decide to use it as well! The
revision number is from my repository, so don't count on it for the version
used. I made this change against version 0.7.
Index: includes/SMW_Hooks.php
===================================================================
--- includes/SMW_Hooks.php (revision 73)
+++ includes/SMW_Hooks.php (working copy)
@@ -138,22 +138,17 @@
* escaped when inserted at an earlier stage.
*/
function smwfParseAttributesAfterTidyCallback($semanticLink) {
- // Here we read the data hosted in the "span"-container. A toolTip
- // is created to show the attribute values. To invoke the tooltip,
- // we have to use a javaScript function (createToolTip) which
writes
- // a toolTip (div-Tag) to the document. Since the script-Tag would
cause
- // a line break, we have to surround everything with a span-Tag.
+ // Here we read the data hosted in the "span"-container. A span
+ // is created to show the attribute values in parenthesis.
// if the tip is given as an array, we print each value as a line;
- if ((strstr(' = ', $semanticLink[1]) != -1) or (strstr(', ',
$semanticLink[1]))) {
- $tip = str_replace(array(' = ', ', '),'<br/>',
$semanticLink[1]);
+ if ((strstr(' = ', $semanticLink[1]) != -1)) {
+ $tip = str_replace(' = ',', ', $semanticLink[1]);
} else {
$tip = $semanticLink[1];
}
- $id = uniqid('SMW_'); // parameter needed up to PHP4
- $result = '<span><script type="text/javascript">/*<![CDATA[*/
createToolTip(\''.$id.'\', \''.$tip.'\');/*]]>*/</script>';
- $result .= '<a class="smwatr"
onmouseover="showToolTip(\''.$id.'\')"
onmouseout="hideToolTip()">'.$semanticLink[2].'</a></span>'; //no CamelCase
for onmouse... -> W3C Validator
-
+ $result = $semanticLink[2].' <span
class="conversion">('.$tip.')</span>';
+
return $result;
}
On 8/4/07, S Page <[EMAIL PROTECTED]> wrote:
>
> Bradley Holt wrote:
> > Is there a way to perform in an inline conversion (instead of, or in
> > conjunction with, the tool tip conversion)? I have a temperature field
> > in °C and I'd like to display it in both °C and °F. For example:
> >
> > 24.4°C (79.88°F)
>
> SMW 0.7 doesn't offer any way to control the appearance of attributes in
> text. You see the original value or the alternate text after the '|.
> It seems the philosophy of SMW is to retain the original text the author
> wrote inline, and only modify the property's appearance in tooltips, the
> factbox, and inline queries.
>
> However, by modifying the PHP code in smwfParserAfterTidyHook() or
> smwfParseAttributesAfterTidyCallback() you could change the steps that
> rewrite the HTML to add the tooltip, and do something else.
>
> --
> =S Page
>
--
Bradley Holt
[EMAIL PROTECTED]
(802) 922-1200
Found Line, Inc.
7 Kilburn Street
Burlington, VT 05401
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-user