Subversion Repositories DevTools

Rev

Rev 6879 | 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>"
    ElseIf Left(SSlink,2) = "on" Then
        Response.write "<li class='pointer " & sClass & "' "& SSlink &"><a>"& SSitem &"</a></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 Function GenStyle (sName, sfgColor, sbgColor)
Dim classPrefix : classPrefix = sName & "_"
GenStyle = classPrefix & "tabs"
%>
<style type="text/css">
.<%=classPrefix%>tabs {
  overflow: hidden;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 11px;
  white-space: nowrap;
  height: 19px;
}

.<%=classPrefix%>tabs li {
  display: inline-block;
  margin: 0 3px 0 0;
  line-height: 17px;
}

.<%=classPrefix%>tabs .tabsText,
.<%=classPrefix%>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);
}

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

.<%=classPrefix%>tabs a:focus {
  outline: 0;
}

.<%=classPrefix%>tabs .tabsText::after,
.<%=classPrefix%>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;  
}

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


Sub Generate_Tab_Menu ( SSarray, SSselected, SScolorStyle )
        Dim FirstTab, LastTab, enabled, i
    Dim className

    If SScolorStyle = "blue" Then
        className = GenStyle (SScolorStyle, "white", "#003399")
    ElseIf SScolorStyle = "grey" Then
        className = GenStyle (SScolorStyle, "black", "#f2f0e4")
    Else
        className = GenStyle (SScolorStyle, "black", "#ffcc33")
    End If

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

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