jvelociter (SVN) wrote:
  Author: jvelociter
 Date: 2009-02-25 09:48:03 +0100 (Wed, 25 Feb 2009)
 New Revision: 17031
 Modified:
platform/web/branches/xwiki-web-1.8/standard/src/main/webapp/resources/js/xwiki/xwiki.js
 Log:
 XWIKI-3223 Display extended tooltip information when a Macro fails to render in HTML
 Modified:
platform/web/branches/xwiki-web-1.8/standard/src/main/webapp/resources/js/xwiki/xwiki.js
 ===================================================================
 ---
platform/web/branches/xwiki-web-1.8/standard/src/main/webapp/resources/js/xwiki/xwiki.js
2009-02-25 08:47:39 UTC (rev 17030)
 +++
platform/web/branches/xwiki-web-1.8/standard/src/main/webapp/resources/js/xwiki/xwiki.js
2009-02-25 08:48:03 UTC (rev 17031)
 @@ -7,6 +7,22 @@
  var XWiki = {};
  /**
 + * Add click listeners on all rendereing error messages to let the user read the
detailed error description.
 + */
 +document.observe("dom:loaded", function() {
 +    $$('[class="xwikirenderingerror"]').each(function(error) {
 +        if(error.nextSibling.innerHTML !== "" &&
error.nextSibling.hasClassName("xwikirenderingerrordescription")) {
 +            error.style.cursor="pointer";
 +            error.title =
"$msg.get('platform.core.rendering.error.readTechnicalInformation')";
 +            Event.observe(error, "click", function(event){
 +                   toggleClass(event.element().nextSibling,'hidden'); 
 This is not so efficient, as a new function object is created for each
 error block.
  
Also, instead of toggleClass, consider using:
event.element().next().toggleClassName('hidden');
--
Sergiu Dumitriu