Subversion Repositories DevTools

Rev

Rev 6879 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%
2
'==========================================
3
'				Tab Menus
4
'==========================================
5
 
6873 dpurdie 6
Private Sub Draw_Tab_LiEntry (SSenable, SSitem, SSlink)
7
    Dim sClass : sClass = ""
8
    If SSenable Then sClass="current"
9
    If SSlink = "#" Then
10
        Response.write "<li class='tabsText "& sClass &"'>"& SSitem &"</li>"
7294 dpurdie 11
    ElseIf Left(SSlink,2) = "on" Then
12
        Response.write "<li class='pointer " & sClass & "' "& SSlink &"><a>"& SSitem &"</a></li>"
6873 dpurdie 13
    Else
14
        Response.write "<li class='" & sClass & "'><a href='"& SSlink &"'>"& SSitem &"</a></li>"
15
    End If
16
End Sub
119 ghuddy 17
 
6873 dpurdie 18
'-------------------------------------------------
19
' Function:    GenStyle
20
' Description: Generate a local style sheet with a few options configured globally
21
'
6879 dpurdie 22
Private Function GenStyle (sName, sfgColor, sbgColor)
23
Dim classPrefix : classPrefix = sName & "_"
24
GenStyle = classPrefix & "tabs"
119 ghuddy 25
%>
6873 dpurdie 26
<style type="text/css">
6879 dpurdie 27
.<%=classPrefix%>tabs {
6873 dpurdie 28
  overflow: hidden;
29
  width: 100%;
30
  margin: 0;
31
  padding: 0;
32
  list-style: none;
33
  font-size: 11px;
34
  white-space: nowrap;
35
  height: 19px;
36
}
119 ghuddy 37
 
6879 dpurdie 38
.<%=classPrefix%>tabs li {
6873 dpurdie 39
  display: inline-block;
40
  margin: 0 3px 0 0;
41
  line-height: 17px;
42
}
119 ghuddy 43
 
6879 dpurdie 44
.<%=classPrefix%>tabs .tabsText,
45
.<%=classPrefix%>tabs a {
6873 dpurdie 46
  position: relative;
47
  background: #c2c3c2;
48
  padding: 1px .7em;
49
  float: left;
50
  text-decoration: none;
51
  color: black;
52
  border-radius: 5px 0 0 0;
53
  box-shadow: 0 2px 2px rgba(0,0,0,.5);
54
}
119 ghuddy 55
 
6879 dpurdie 56
.<%=classPrefix%>tabs a:hover,
57
.<%=classPrefix%>tabs a:hover::after,
58
.<%=classPrefix%>tabs a:focus,
59
.<%=classPrefix%>tabs a:focus::after {
6873 dpurdie 60
  background: <%=sbgColor%>;
61
  color: <%=sfgColor%>;
62
}
119 ghuddy 63
 
6879 dpurdie 64
.<%=classPrefix%>tabs a:focus {
6873 dpurdie 65
  outline: 0;
66
}
67
 
6879 dpurdie 68
.<%=classPrefix%>tabs .tabsText::after,
69
.<%=classPrefix%>tabs a::after {
6873 dpurdie 70
  content:'';
71
  position:absolute;
72
  z-index: 1;
73
  top: 0;
74
  right: -.5em;  
75
  bottom: 0;
76
  width: 1em;
77
  background: #c2c3c2;
78
  box-shadow: 2px 2px 2px rgba(0,0,0,.4);
79
  transform: skew(10deg);
80
  border-radius: 0 5px 0 0;  
81
}
82
 
6879 dpurdie 83
.<%=classPrefix%>tabs .tabsText.current,
84
.<%=classPrefix%>tabs .tabsText.current::after,
85
.<%=classPrefix%>tabs .current a,
86
.<%=classPrefix%>tabs .current a::after {
6873 dpurdie 87
  background: <%=sbgColor%>;
88
  color: <%=sfgColor%>;
89
  z-index: 3;
90
}
91
</style>
92
<%
6879 dpurdie 93
End Function
119 ghuddy 94
 
6788 dpurdie 95
 
119 ghuddy 96
Sub Generate_Tab_Menu ( SSarray, SSselected, SScolorStyle )
6873 dpurdie 97
	Dim FirstTab, LastTab, enabled, i
6879 dpurdie 98
    Dim className
99
 
6873 dpurdie 100
    If SScolorStyle = "blue" Then
6879 dpurdie 101
        className = GenStyle (SScolorStyle, "white", "#003399")
102
    ElseIf SScolorStyle = "grey" Then
103
        className = GenStyle (SScolorStyle, "black", "#f2f0e4")
6873 dpurdie 104
    Else
6879 dpurdie 105
        className = GenStyle (SScolorStyle, "black", "#ffcc33")
6873 dpurdie 106
    End If
107
 
119 ghuddy 108
	FirstTab = LBound(SSarray)
109
	LastTab = UBound(SSarray)
6873 dpurdie 110
 
111
    ' With CSS only
112
    '
6879 dpurdie 113
	Response.write "<ul class="&className&">"
119 ghuddy 114
	For i = FirstTab To LastTab
6873 dpurdie 115
        Dim tempArray
6788 dpurdie 116
		tempArray = SSarray(i)
119 ghuddy 117
		enabled = FALSE
6879 dpurdie 118
        If isNumeric(SSselected)  Then 
119
            If Cint(SSselected) = i Then enabled = TRUE
120
        Else
121
		    If SSselected <> "" Then enabled = (tempArray(1) = SSselected)
122
        End If
6873 dpurdie 123
		Call Draw_Tab_LiEntry ( enabled, tempArray(0) & tempArray(1), tempArray(2) )
119 ghuddy 124
	Next
6873 dpurdie 125
	Response.write "</ul>"
119 ghuddy 126
End Sub
127
%>
128
 
129
 
130