Subversion Repositories DevTools

Rev

Rev 6788 | Rev 6879 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%
'==========================================
'                               Tab Menus
'==========================================

Private Sub Draw_Tab_LiEntry (SSenable, SSitem, SSlink)
    Dim sClass : sClass = ""
    If SSenable Then sClass="current"
    If SSlink = "#" Then
        Response.write "<li class='tabsText "& sClass &"'>"& SSitem &"</li>"
    Else
        Response.write "<li class='" & sClass & "'><a href='"& SSlink &"'>"& SSitem &"</a></li>"
    End If
End Sub

'-------------------------------------------------
' Function:    GenStyle
' Description: Generate a local style sheet with a few options configured globally
'
Private Sub GenStyle (sfgColor, sbgColor)
%>
<style type="text/css">
.tabs {
  overflow: hidden;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 11px;
  white-space: nowrap;
  height: 19px;
}

.tabs li {
  display: inline-block;
  margin: 0 3px 0 0;
  line-height: 17px;
}

.tabsText,
.tabs a {
  position: relative;
  background: #c2c3c2;
  padding: 1px .7em;
  float: left;
  text-decoration: none;
  color: black;
  border-radius: 5px 0 0 0;
  box-shadow: 0 2px 2px rgba(0,0,0,.5);
}

.tabs a:hover,
.tabs a:hover::after,
.tabs a:focus,
.tabs a:focus::after {
  background: <%=sbgColor%>;
  color: <%=sfgColor%>;
}

.tabs a:focus {
  outline: 0;
}

.tabsText::after,
.tabs a::after {
  content:'';
  position:absolute;
  z-index: 1;
  top: 0;
  right: -.5em;  
  bottom: 0;
  width: 1em;
  background: #c2c3c2;
  box-shadow: 2px 2px 2px rgba(0,0,0,.4);
  transform: skew(10deg);
  border-radius: 0 5px 0 0;  
}

.tabs .tabsText.current,
.tabs .tabsText.current::after,
.tabs .current a,
.tabs .current a::after {
  background: <%=sbgColor%>;
  color: <%=sfgColor%>;
  z-index: 3;
}
</style>
<%
End Sub


Sub Generate_Tab_Menu ( SSarray, SSselected, SScolorStyle )
        Dim FirstTab, LastTab, enabled, i
        
    If SScolorStyle = "blue" Then
        Call GenStyle ("white", "#003399")
    Else
        Call GenStyle ("black", "#ffcc33")
    End If

        FirstTab = LBound(SSarray)
        LastTab = UBound(SSarray)

    ' With CSS only
    '
        Response.write "<ul class=tabs>"
        For i = FirstTab To LastTab
        Dim tempArray
                tempArray = SSarray(i)
                enabled = FALSE
                If SSselected <> "" Then enabled = (tempArray(1) = SSselected)
                Call Draw_Tab_LiEntry ( enabled, tempArray(0) & tempArray(1), tempArray(2) )
        Next
        Response.write "</ul>"
End Sub
%>