Changeset 3441

Show
Ignore:
Timestamp:
12/08/11 15:15:33
Author:
johnsa
Message:

public client: more updates to subscriptions tree widget in the bedework theme (as set in the theme settings)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/deployment/webpublic/webapp/resources/demoskins/MainCampus/de_DE/strings.xsl

    r3431 r3441  
    9797  <xsl:variable name="bwStr-LCol-CalendarViews">Kalender Ansicht</xsl:variable> 
    9898  <xsl:variable name="bwStr-LCol-Calendars">Kalender</xsl:variable> 
     99  <xsl:variable name="bwStr-LCol-All">Alles</xsl:variable> 
    99100  <xsl:variable name="bwStr-LCol-FilterOnCalendars">FILTER AUF KALENDER:</xsl:variable> 
    100101  <xsl:variable name="bwStr-LCol-ViewAllCalendars">Ansicht aller Kalender</xsl:variable> 
  • trunk/deployment/webpublic/webapp/resources/demoskins/MainCampus/default/strings.xsl

    r3431 r3441  
    9797  <xsl:variable name="bwStr-LCol-CalendarViews">Calendar Views</xsl:variable> 
    9898  <xsl:variable name="bwStr-LCol-Calendars">Calendars</xsl:variable> 
     99  <xsl:variable name="bwStr-LCol-All">All</xsl:variable> 
    99100  <xsl:variable name="bwStr-LCol-FilterOnCalendars">FILTER ON CALENDARS:</xsl:variable> 
    100101  <xsl:variable name="bwStr-LCol-ViewAllCalendars">View All Calendars</xsl:variable> 
  • trunk/deployment/webpublic/webapp/resources/demoskins/MainCampus/es_ES/strings.xsl

    r3431 r3441  
    9797  <xsl:variable name="bwStr-LCol-CalendarViews">Vistas de Agenda</xsl:variable> 
    9898  <xsl:variable name="bwStr-LCol-Calendars">Agendas</xsl:variable> 
     99  <xsl:variable name="bwStr-LCol-All">Todas</xsl:variable> 
    99100  <xsl:variable name="bwStr-LCol-FilterOnCalendars">FILTRAR AGENDAS:</xsl:variable> 
    100101  <xsl:variable name="bwStr-LCol-ViewAllCalendars">Ver Todas las Agendas</xsl:variable> 
  • trunk/deployment/webpublic/webapp/resources/demoskins/MainCampus/themes/bedeworkTheme/javascript/bedework.js

    r3439 r3441  
    5656  linkWindow.focus(); 
    5757} 
    58 // Using the subscriptions tree for navigation (as defined in themeSettings.xsl). 
    59 // Get them and load them onto the page. 
    60 function loadSubscriptions(containerId,setSelectionAction,curPath) { 
    61   var feederUrl = '/feeder/calendar/fetchPublicCalendars.do?skinName=widget-json-cals&setappvar=setSelectionAction(' + setSelectionAction + ')';  
    62   $.getJSON(feederUrl, function(data) { 
    63     var subsTree = '<ul>' + buildSubsTree(data.bwCals.calendars,true,curPath) + '</ul>'; 
    64     $(containerId).html(subsTree); 
    65     $("#subsTree .subsTreeToggle").click(function() { 
    66       $(this).parent("li").children("ul").toggle("fast"); 
    67     }); 
    68   }); 
    69 } 
    70 function buildSubsTree(calObj,isRoot,curPath) { 
    71   var subsTreeHtml = ""; 
    72    
    73   $.each(calObj,function(i) { 
    74     if (this.calType < 2) { // show only calendars and folders 
    75       if (isRoot) { 
    76         subsTreeHtml += '<li><a href="' + this.calendarLink + '">All</a>'; 
    77       } else { 
    78         // build the child tree 
    79         if(this.children != undefined) { 
    80           //alert(curPath + "\n" + decodeURI(this.virtualPath) + "\n" + curPath.indexOf(decodeURI(this.virtualPath))); 
    81           // see if we have the selected item 
    82           var itemClass = ""; 
    83           if (curPath == decodeURI(this.virtualPath)) { 
    84             itemClass = ' class="hasChildren selected open"'; 
    85           } else if (curPath.indexOf(decodeURI(this.virtualPath)) > -1) { 
    86             itemClass = ' class="hasChildren selectedPath open"'; 
    87           } else { 
    88             itemClass = ' class="hasChildren closed"'; 
    89           } 
    90           subsTreeHtml += '<li'+ itemClass +'><span class="subsTreeToggle">+</span>'; 
    91         } else { 
    92           var itemClass = ""; 
    93           if (curPath == decodeURI(this.virtualPath)) { 
    94             itemClass = ' class="selected"'; 
    95           } 
    96           subsTreeHtml += '<li'+ itemClass +'>'; 
    97         } 
    98         subsTreeHtml += '<a href="' + this.calendarLink + '">' + this.name + '</a>'; 
    99       } 
    100       if(this.children != undefined) { 
    101         subsTreeHtml += "<ul>"; 
    102         subsTreeHtml += buildSubsTree(this.children,false,curPath); 
    103         subsTreeHtml += "</ul>"; 
    104       } 
    105       subsTreeHtml += "</li>"; 
    106     } 
    107   }); 
    108    
    109   return(subsTreeHtml); 
    110 } 
    11158 
    11259// topLink is defined in themeSettings.xsl 
  • trunk/deployment/webpublic/webapp/resources/demoskins/MainCampus/themes/bedeworkTheme/subscriptions.xsl

    r3439 r3441  
    2727      <h3><xsl:copy-of select="$bwStr-LCol-Calendars"/></h3> 
    2828    </div> 
    29     <div id="subsTree">&#160;</div> 
     29    <div id="subsTree"> 
     30      <ul> 
     31        <xsl:apply-templates select="/bedework/myCalendars/calendars/calendar" mode="subsTree"> 
     32          <xsl:with-param name="isRoot">true</xsl:with-param> 
     33        </xsl:apply-templates> 
     34      </ul> 
     35    </div> 
    3036     
    3137    <script type="text/javascript"> 
    3238            $(document).ready(function(){ 
    33               // get the subscriptions/calendars and load them into the tree 
    34               loadSubscriptions("#subsTree","<xsl:value-of select="$setSelection"/>","<xsl:value-of select="/bedework/selectionState/collection/virtualpath"/>"); 
     39                    $("#subsTree .subsTreeToggle").click(function() { 
     40                      $(this).parent("li").children("ul").toggle("fast"); 
     41                    }); 
    3542            }); 
    3643          </script> 
    3744  </xsl:template> 
    3845 
     46  <xsl:template match="calendar" mode="subsTree"> 
     47    <xsl:param name="isRoot"/> 
     48    <xsl:variable name="curPath"><xsl:call-template name="escapeJson"><xsl:with-param name="string"><xsl:value-of select="/bedework/selectionState/collection/virtualpath"/></xsl:with-param></xsl:call-template></xsl:variable> 
     49    <xsl:variable name="virtualPath"><xsl:call-template name="escapeJson"><xsl:with-param name="string">/user<xsl:for-each select="ancestor-or-self::calendar/name">/<xsl:value-of select="."/></xsl:for-each></xsl:with-param></xsl:call-template></xsl:variable> 
     50    <xsl:variable name="encVirtualPath"><xsl:call-template name="url-encode"><xsl:with-param name="str" select="$virtualPath"/></xsl:call-template></xsl:variable> 
     51    <xsl:variable name="summary" select="summary"/> 
     52    <xsl:variable name="itemId" select="generate-id(path)"/> 
     53    <xsl:variable name="folderState">closed</xsl:variable> 
     54    <li id="{$itemId}"> 
     55      <xsl:if test="calendar and not($isRoot = 'true')"> 
     56              <xsl:attribute name="class"> 
     57                <xsl:choose> 
     58                  <xsl:when test="$virtualPath = $curPath">hasChildren selected <xsl:value-of select="$folderState"/></xsl:when> 
     59                  <xsl:when test="contains($curPath,$virtualPath)">hasChildren selectedPath open</xsl:when> 
     60                  <xsl:otherwise>hasChildren <xsl:value-of select="$folderState"/></xsl:otherwise> 
     61                </xsl:choose> 
     62              </xsl:attribute> 
     63              <span class="subsTreeToggle">+</span> 
     64            </xsl:if> 
     65            <xsl:if test="not(calendar) and $virtualPath = $curPath"> 
     66              <xsl:attribute name="class">selected</xsl:attribute> 
     67            </xsl:if> 
     68            <xsl:choose> 
     69              <xsl:when test="$isRoot = 'true'"> 
     70                <a href="{$setSelection}&amp;setappvar=curCollection()"> 
     71                  <xsl:copy-of select="$bwStr-LCol-All"/> 
     72                </a> 
     73              </xsl:when> 
     74              <xsl:otherwise> 
     75                <a href="{$setSelection}&amp;virtualPath={$encVirtualPath}&amp;setappvar=curCollection({$summary})"> 
     76                  <xsl:value-of select="summary"/> 
     77                </a> 
     78              </xsl:otherwise>         
     79            </xsl:choose> 
     80            <xsl:if test="calendar[(calType &lt; 2) and (name != 'calendar')]"><!-- the test for "calendar" isn't good --> 
     81              <ul> 
     82                <xsl:apply-templates select="calendar[(calType &lt; 2) and (name != 'calendar')]" mode="subsTree"> 
     83                  <xsl:with-param name="isRoot">false</xsl:with-param> 
     84                </xsl:apply-templates> 
     85              </ul> 
     86            </xsl:if> 
     87    </li> 
     88  </xsl:template> 
    3989</xsl:stylesheet> 
  • trunk/deployment/webpublic/webapp/resources/demoskins/MainCampus/themes/bedeworkTheme/themeSettings.xsl

    r3439 r3441  
    6161  <!-- "Subscriptions" provide the full hierarchy of calendars within a calendar suite. 
    6262       These are presented with an explorer-like navigation paradigm.  This listing 
    63        is managed in the "Calendar Suite" tab of the admin web client. By default,  
     63       is managed in the "Calendar Suite" tab of the admin web client. By deafault,  
    6464       the top level subscriptions will be shown with all folders closed. Generating  
    6565       the subscriptions listing requires a second request to the server (an ajax call).  -->