Subversion Repositories DevTools

Rev

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