Author: ito
Date: Mon Jan 25 09:35:52 2010
New Revision: 902748

URL: http://svn.apache.org/viewvc?rev=902748&view=rev
Log:
CLEREZZA-77: title added to panel tab

Modified:
    
incubator/clerezza/issues/CLEREZZA-77/org.apache.clerezza.web.resources.style/README.txt
    
incubator/clerezza/issues/CLEREZZA-77/org.apache.clerezza.web.resources.style/src/main/resources/org/apache/clerezza/web/resources/style/headed-page-template.ssp
    
incubator/clerezza/issues/CLEREZZA-77/org.apache.clerezza.web.resources.style/src/main/resources/org/apache/clerezza/web/resources/style/staticweb/scripts/panel.js

Modified: 
incubator/clerezza/issues/CLEREZZA-77/org.apache.clerezza.web.resources.style/README.txt
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-77/org.apache.clerezza.web.resources.style/README.txt?rev=902748&r1=902747&r2=902748&view=diff
==============================================================================
--- 
incubator/clerezza/issues/CLEREZZA-77/org.apache.clerezza.web.resources.style/README.txt
 (original)
+++ 
incubator/clerezza/issues/CLEREZZA-77/org.apache.clerezza.web.resources.style/README.txt
 Mon Jan 25 09:35:52 2010
@@ -2,10 +2,11 @@
 
 
 1. Add your panel tab to a page from type HeadedPage by using the 
ResultDocModifier. The
-first node of your panel tab must have an id, which identifies the tab.
+first node of your panel tab must have an id, which identifies the tab. A 
title of
+the panel tab could be set by adding a <h3>title</h3> to the first node.
 
 e.g.
-resultDocModifier.addNodes2Elem("tx-panel-detail", <div id="my-tab">My 
Tab</div>);
+resultDocModifier.addNodes2Elem("tx-panel-detail", <div id="my-tab"><h3>My Tab 
Title</h3>My Tab</div>);
 
 2. The id of the first node of your panel can be used as style information for
 the tab button and specifies the title of the tab button. The following snippet
@@ -14,11 +15,3 @@
 li.my-tab a {
        background-image:url(/path/images/panel/standard-tab.png);
 }
-
-3. Add a title to your panel tab by adding <h3>title</h3> to the node with id
-"tx-panel-title".
-
-e.g.
-resultDocModifier.addNodes2Elem("tx-panel-title", <h3>Digital Asset 
Manager</h3>);
-
-

Modified: 
incubator/clerezza/issues/CLEREZZA-77/org.apache.clerezza.web.resources.style/src/main/resources/org/apache/clerezza/web/resources/style/headed-page-template.ssp
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-77/org.apache.clerezza.web.resources.style/src/main/resources/org/apache/clerezza/web/resources/style/headed-page-template.ssp?rev=902748&r1=902747&r2=902748&view=diff
==============================================================================
--- 
incubator/clerezza/issues/CLEREZZA-77/org.apache.clerezza.web.resources.style/src/main/resources/org/apache/clerezza/web/resources/style/headed-page-template.ssp
 (original)
+++ 
incubator/clerezza/issues/CLEREZZA-77/org.apache.clerezza.web.resources.style/src/main/resources/org/apache/clerezza/web/resources/style/headed-page-template.ssp
 Mon Jan 25 09:35:52 2010
@@ -38,7 +38,7 @@
                </div>
                <div class="tx-panel" id="tx-panel">
                        <a href="#" class="tx-panel-open-close 
tx-icon-left-inverse" id="tx-panel-open-close">open/close</a>
-                       <div id="tx-panel-title"></div>
+                       <div id="tx-panel-title"><h3></h3></div>
                        <div class="tx-panel-window">
                                <div class="tx-tab" id="tx-panel-tab">
                                        <ol id="tx-tab-panel-ol">

Modified: 
incubator/clerezza/issues/CLEREZZA-77/org.apache.clerezza.web.resources.style/src/main/resources/org/apache/clerezza/web/resources/style/staticweb/scripts/panel.js
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-77/org.apache.clerezza.web.resources.style/src/main/resources/org/apache/clerezza/web/resources/style/staticweb/scripts/panel.js?rev=902748&r1=902747&r2=902748&view=diff
==============================================================================
--- 
incubator/clerezza/issues/CLEREZZA-77/org.apache.clerezza.web.resources.style/src/main/resources/org/apache/clerezza/web/resources/style/staticweb/scripts/panel.js
 (original)
+++ 
incubator/clerezza/issues/CLEREZZA-77/org.apache.clerezza.web.resources.style/src/main/resources/org/apache/clerezza/web/resources/style/staticweb/scripts/panel.js
 Mon Jan 25 09:35:52 2010
@@ -3,10 +3,17 @@
                $("#tx-panel").hide();
        } else {
                $("#tx-panel-detail").children().each(function() {
-                       var li = 
$("<li/>").addClass($(this).attr("id")).attr("title", $(this).attr("id"));
+                       var titleElem =  $("#" + $(this).attr("id") + " > 
h3:first");
+                       var title = $(this).attr("id");
+                       if(titleElem.length > 0) {
+                               titleElem.hide();
+                               title = titleElem.text();
+                       }
+                       var li = 
$("<li/>").addClass($(this).attr("id")).attr("title", title);
                        var aHref = $("<a/>").attr("href", "#").text("tab");
                        aHref.bind("click", function () {
                                if(!$(this).parent().hasClass("tx-active")) {
+                                       $("#tx-panel-title > 
h3").text($(this).parent().attr("title"));
                                        
$("#tx-panel-detail").children().each(function() {
                                                $(this).hide();
                                        });
@@ -24,6 +31,7 @@
                        $(this).hide();
                });
                $("#tx-tab-panel-ol").children(":first").each(function() {
+                       $("#tx-panel-title > h3").text($(this).attr("title"));
                        $(this).addClass("tx-active");
                });     
        }


Reply via email to