Author: vmassol
Date: 2008-02-02 10:27:09 +0100 (Sat, 02 Feb 2008)
New Revision: 7274
Modified:
xwiki-platform/skins/trunk/albatross/src/main/resources/albatross/macros.vm
xwiki-platform/skins/trunk/toucan/src/main/resources/toucan/macros.vm
Log:
XWIKI-2053: Provide CSS hooks to allow to style Panels selectively
* Fix bug introduced in previous commit where this would fail if the paneldoc
was null (which apparently can happen if the panels are displayed inside a page
such as for stats);
Modified:
xwiki-platform/skins/trunk/albatross/src/main/resources/albatross/macros.vm
===================================================================
--- xwiki-platform/skins/trunk/albatross/src/main/resources/albatross/macros.vm
2008-02-02 00:29:29 UTC (rev 7273)
+++ xwiki-platform/skins/trunk/albatross/src/main/resources/albatross/macros.vm
2008-02-02 09:27:09 UTC (rev 7274)
@@ -11,7 +11,11 @@
#set($expanded = $xwiki.getUserPreferenceFromCookie($cookieName))
## Note: We pass the Panel name as an HTML class attribute so that it's
possible to style
## the Panels selectively using CSS.
-<div class="panel $expanded $util.convertToAlphaNumeric($paneldoc.name)">
+#set ($specialClassAttribute = "")
+#if ($paneldoc != "")
+ #set ($specialClassAttribute = $util.convertToAlphaNumeric($paneldoc.name))
+#end
+<div class="panel $expanded $specialClassAttribute">
<h5 class="xwikipaneltitle" onclick="if(eltHasClass(this.parentNode,
'expanded')) createCookie('$cookieName','collapsed', ''); else
eraseCookie('$cookieName'); togglePanelVisibility(this.parentNode);">$title</h5>
<div class="xwikipanelcontents">
#end
@@ -19,7 +23,11 @@
#macro(panelhiddenheader $title)
## Note: We pass the Panel name as an HTML class attribute so that it's
possible to style
## the Panels selectively using CSS.
-<div class="panel expanded $util.convertToAlphaNumeric($paneldoc.name)">
+#set ($specialClassAttribute = "")
+#if ($paneldoc != "")
+ #set ($specialClassAttribute = $util.convertToAlphaNumeric($paneldoc.name))
+#end
+<div class="panel expanded $specialClassAttribute">
<h5 class="xwikipaneltitle hidden"
onclick="togglePanelVisibility(this.parentNode);">$title</h5>
<div class="xwikipanelcontents">
#end
@@ -30,7 +38,11 @@
#set($expanded = $xwiki.getUserPreferenceFromCookie($cookieName))
## Note: We pass the Panel name as an HTML class attribute so that it's
possible to style
## the Panels selectively using CSS.
-<div class="large panel $expanded $util.convertToAlphaNumeric($paneldoc.name)">
+#set ($specialClassAttribute = "")
+#if ($paneldoc != "")
+ #set ($specialClassAttribute = $util.convertToAlphaNumeric($paneldoc.name))
+#end
+<div class="large panel $expanded $specialClassAttribute">
<h5 class="xwikipaneltitle" onclick="if(eltHasClass(this.parentNode,
'expanded')) createCookie('$cookieName','collapsed', ''); else
eraseCookie('$cookieName'); togglePanelVisibility(this.parentNode);">$title</h5>
<div class="xwikipanelcontents">
#end
Modified: xwiki-platform/skins/trunk/toucan/src/main/resources/toucan/macros.vm
===================================================================
--- xwiki-platform/skins/trunk/toucan/src/main/resources/toucan/macros.vm
2008-02-02 00:29:29 UTC (rev 7273)
+++ xwiki-platform/skins/trunk/toucan/src/main/resources/toucan/macros.vm
2008-02-02 09:27:09 UTC (rev 7274)
@@ -11,7 +11,11 @@
#set($expanded = $xwiki.getUserPreferenceFromCookie($cookieName))
## Note: We pass the Panel name as an HTML class attribute so that it's
possible to style
## the Panels selectively using CSS.
-<div class="panel $expanded $util.convertToAlphaNumeric($paneldoc.name)">
+#set ($specialClassAttribute = "")
+#if ($paneldoc != "")
+ #set ($specialClassAttribute = $util.convertToAlphaNumeric($paneldoc.name))
+#end
+<div class="panel $expanded $specialClassAttribute">
<h5 class="xwikipaneltitle" onclick="if(eltHasClass(this.parentNode,
'expanded')) createCookie('$cookieName','collapsed', ''); else
eraseCookie('$cookieName'); togglePanelVisibility(this.parentNode);">$title</h5>
<div class="xwikipanelcontents">
#end
@@ -19,7 +23,11 @@
#macro(panelhiddenheader $title)
## Note: We pass the Panel name as an HTML class attribute so that it's
possible to style
## the Panels selectively using CSS.
-<div class="panel expanded $util.convertToAlphaNumeric($paneldoc.name)">
+#set ($specialClassAttribute = "")
+#if ($paneldoc != "")
+ #set ($specialClassAttribute = $util.convertToAlphaNumeric($paneldoc.name))
+#end
+<div class="panel expanded $specialClassAttribute">
<h5 class="xwikipaneltitle hidden"
onclick="togglePanelVisibility(this.parentNode);">$title</h5>
<div class="xwikipanelcontents">
#end
@@ -30,7 +38,11 @@
#set($expanded = $xwiki.getUserPreferenceFromCookie($cookieName))
## Note: We pass the Panel name as an HTML class attribute so that it's
possible to style
## the Panels selectively using CSS.
-<div class="large panel $expanded $util.convertToAlphaNumeric($paneldoc.name)">
+#set ($specialClassAttribute = "")
+#if ($paneldoc != "")
+ #set ($specialClassAttribute = $util.convertToAlphaNumeric($paneldoc.name))
+#end
+<div class="large panel $expanded $specialClassAttribute">
<h5 class="xwikipaneltitle" onclick="if(eltHasClass(this.parentNode,
'expanded')) createCookie('$cookieName','collapsed', ''); else
eraseCookie('$cookieName'); togglePanelVisibility(this.parentNode);">$title</h5>
<div class="xwikipanelcontents">
#end
_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications