Subversion Repositories DevTools

Rev

Rev 6788 | Rev 6879 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6788 Rev 6873
Line 1... Line 1...
1
<%
1
<%
2
'==========================================
2
'==========================================
3
'				Tab Menus
3
'				Tab Menus
4
'==========================================
4
'==========================================
5
 
5
 
6
'-------------- Tab Definition ---------------
-
 
7
'   L1e  |  Men  |  R1e  |  L2e  |  --  |  --  |  --  |  --  |  --  |
-
 
8
'   L1d  |  Mde  |  R1d  |  L2d  |  --  |  --  |  --  |  --  |  --  |
-
 
9
'   --   |  --   |  Ru1d |  --   |  --  |  --  |  --  |  --  |  --  |
-
 
10
'---------------------------------------------
-
 
11
 
-
 
12
'------------- Constants -------------
-
 
13
'------------- Variables -------------
-
 
14
Dim L1e, L1d, Men, Mde, R1e, R1d, Ru1d, L2e, L2d
-
 
15
Dim enItemStyle, deItemStyle
-
 
16
' Globals, that shouldn't be ... (just like the ones above)
-
 
17
Dim TabsCurrentSelection
-
 
18
'-------------------------------------
-
 
19
%>
-
 
20
<%
-
 
21
Private Sub Draw_First_Tab ( SSenable, SSitem, SSlink )
6
Private Sub Draw_Tab_LiEntry (SSenable, SSitem, SSlink)
22
    If SSenable Then
7
    Dim sClass : sClass = ""
23
		Response.write "<td>"& L1e &"</td>"
-
 
24
        Call Draw_Tab_Body (Men, enItemStyle, SSitem, SSlink)
-
 
25
	Else
-
 
26
		Response.write "<td>"& L1d &"</td>"
-
 
27
        Call Draw_Tab_Body (Mde, deItemStyle, SSitem, SSlink)
-
 
28
	End If
-
 
29
End Sub
-
 
30
 
-
 
31
 
-
 
32
Private Sub Draw_Middle_Tab ( SSenable, SSprevEnable, SSitem, SSlink )
-
 
33
	If SSenable Then
-
 
34
		Response.write "<td>"& Ru1d &"</td>"
-
 
35
		Response.write "<td>"& L2e &"</td>"
-
 
36
        Call Draw_Tab_Body (Men, enItemStyle, SSitem, SSlink)
-
 
37
	Else
-
 
38
		If SSprevEnable Then
-
 
39
			Response.write "<td>"& R1e &"</td>"
-
 
40
			Response.write "<td>"& L2d &"</td>"
-
 
41
            Call Draw_Tab_Body (Mde, deItemStyle, SSitem, SSlink)
-
 
42
		Else
-
 
43
			Response.write "<td>"& R1d &"</td>"
-
 
44
			Response.write "<td>"& L2d &"</td>"
-
 
45
            Call Draw_Tab_Body (Mde, deItemStyle, SSitem, SSlink)
-
 
46
		End If
-
 
47
	End If
-
 
48
End Sub
-
 
49
 
-
 
50
Private Sub Draw_Last_Tab ( SSenable, SSprevEnable, SSitem, SSlink )
-
 
51
	If SSenable Then
-
 
52
		Response.write "<td>"& Ru1d &"</td>"
-
 
53
		Response.write "<td>"& L2e &"</td>"
-
 
54
        Call Draw_Tab_Body (Men, enItemStyle, SSitem, SSlink)
-
 
55
		Response.write "<td>"& R1e &"</td>"
-
 
56
	Else
-
 
57
		If SSprevEnable Then
-
 
58
			Response.write "<td>"& R1e &"</td>"
-
 
59
			Response.write "<td>"& L2d &"</td>"
-
 
60
            Call Draw_Tab_Body (Mde, deItemStyle, SSitem, SSlink)
-
 
61
			Response.write "<td>"& R1d &"</td>"
-
 
62
		Else
-
 
63
			Response.write "<td>"& R1d &"</td>"
-
 
64
			Response.write "<td>"& L2d &"</td>"
-
 
65
            Call Draw_Tab_Body (Mde, deItemStyle, SSitem, SSlink)
-
 
66
			Response.write "<td>"& R1d &"</td>"
-
 
67
		End If
-
 
68
	End If
-
 
69
End Sub
-
 
70
 
-
 
71
Private Sub Draw_Tab_Body(SSBg ,SSitemStyle, SSitem, SSlink )
-
 
72
    If SSitem = "SelectList" Then
8
    If SSenable Then sClass="current"
73
		Response.write "<td "& Mde &" nowrap class='body_txt_gray'>"
-
 
74
        Dim fp: Set fp = GetRef(SSlink)
-
 
75
        fp(TabsCurrentSelection)
-
 
76
        Set fp = Nothing
-
 
77
        Response.Write "</td>"
-
 
78
    ElseIf SSlink = "#" Then
9
    If SSlink = "#" Then
79
        Response.write "<td "& SSBg &" nowrap class='body_txt_gray'>"& SSitem &"</td>"
10
        Response.write "<li class='tabsText "& sClass &"'>"& SSitem &"</li>"
80
    Else
11
    Else
81
        Response.write "<td "& SSBg &" nowrap><a href='"& SSlink &"' class="& SSitemStyle &">"& SSitem &"</a></td>"
12
        Response.write "<li class='" & sClass & "'><a href='"& SSlink &"'>"& SSitem &"</a></li>"
82
    End If
13
    End If
83
End Sub
14
End Sub
84
 
15
 
-
 
16
'-------------------------------------------------
-
 
17
' Function:    GenStyle
-
 
18
' Description: Generate a local style sheet with a few options configured globally
-
 
19
'
-
 
20
Private Sub GenStyle (sfgColor, sbgColor)
-
 
21
%>
-
 
22
<style type="text/css">
-
 
23
.tabs {
-
 
24
  overflow: hidden;
-
 
25
  width: 100%;
-
 
26
  margin: 0;
-
 
27
  padding: 0;
-
 
28
  list-style: none;
-
 
29
  font-size: 11px;
-
 
30
  white-space: nowrap;
-
 
31
  height: 19px;
-
 
32
}
-
 
33
 
-
 
34
.tabs li {
-
 
35
  display: inline-block;
-
 
36
  margin: 0 3px 0 0;
-
 
37
  line-height: 17px;
-
 
38
}
-
 
39
 
-
 
40
.tabsText,
-
 
41
.tabs a {
-
 
42
  position: relative;
-
 
43
  background: #c2c3c2;
-
 
44
  padding: 1px .7em;
-
 
45
  float: left;
-
 
46
  text-decoration: none;
-
 
47
  color: black;
-
 
48
  border-radius: 5px 0 0 0;
-
 
49
  box-shadow: 0 2px 2px rgba(0,0,0,.5);
-
 
50
}
-
 
51
 
-
 
52
.tabs a:hover,
-
 
53
.tabs a:hover::after,
-
 
54
.tabs a:focus,
-
 
55
.tabs a:focus::after {
-
 
56
  background: <%=sbgColor%>;
-
 
57
  color: <%=sfgColor%>;
-
 
58
}
-
 
59
 
-
 
60
.tabs a:focus {
-
 
61
  outline: 0;
-
 
62
}
-
 
63
 
-
 
64
.tabsText::after,
-
 
65
.tabs a::after {
-
 
66
  content:'';
-
 
67
  position:absolute;
-
 
68
  z-index: 1;
-
 
69
  top: 0;
-
 
70
  right: -.5em;  
-
 
71
  bottom: 0;
-
 
72
  width: 1em;
-
 
73
  background: #c2c3c2;
-
 
74
  box-shadow: 2px 2px 2px rgba(0,0,0,.4);
-
 
75
  transform: skew(10deg);
-
 
76
  border-radius: 0 5px 0 0;  
-
 
77
}
-
 
78
 
-
 
79
.tabs .tabsText.current,
-
 
80
.tabs .tabsText.current::after,
-
 
81
.tabs .current a,
-
 
82
.tabs .current a::after {
-
 
83
  background: <%=sbgColor%>;
-
 
84
  color: <%=sfgColor%>;
-
 
85
  z-index: 3;
-
 
86
}
-
 
87
</style>
-
 
88
<%
-
 
89
End Sub
85
 
90
 
86
 
91
 
87
Sub Generate_Tab_Menu ( SSarray, SSselected, SScolorStyle )
92
Sub Generate_Tab_Menu ( SSarray, SSselected, SScolorStyle )
88
	Dim FirstTab, LastTab, enabled, prevEnabled, tempArray, i
93
	Dim FirstTab, LastTab, enabled, i
89
	
-
 
90
	Select Case LCase(SScolorStyle)
-
 
91
		Case "orange"
-
 
92
			enItemStyle = "tabItemSelect"
-
 
93
			deItemStyle = "tabItem"
-
 
94
			L1e	= "<img src='images/tb_lorange.gif' width='11' height='19'>"
-
 
95
			L1d = "<img src='images/tb_l2gray.gif' width='11' height='19'>"
-
 
96
			Men	= "background='images/tb_morange.gif'"
-
 
97
			Mde	= "background='images/tb_mgray.gif'"
-
 
98
			R1e	= "<img src='images/tb_rorange.gif' width='10' height='19'>"
-
 
99
			R1d	= "<img src='images/tb_rgray.gif' width='10' height='19'>"
-
 
100
			Ru1d= "<img src='images/tb_rugray.gif' width='10' height='19'>"
-
 
101
			L2e	= "<img src='images/tb_roorange.gif' width='8' height='19'>"
-
 
102
			L2d = "<img src='images/tb_lgray.gif' width='10' height='19'>"
-
 
103
		Case "blue" 
-
 
104
			enItemStyle = "tabItemSelect2"
-
 
105
			deItemStyle = "tabItem"
-
 
106
			L1e	= "<img src='images/tb_lblue.gif' width='11' height='19'>"
-
 
107
			L1d = "<img src='images/tb_l2gray.gif' width='11' height='19'>"
-
 
108
			Men	= "background='images/tb_mblue.gif'"
-
 
109
			Mde	= "background='images/tb_mgray.gif'"
-
 
110
			R1e	= "<img src='images/tb_rblue.gif' width='10' height='19'>"
-
 
111
			R1d	= "<img src='images/tb_rgray.gif' width='10' height='19'>"
-
 
112
			Ru1d= "<img src='images/tb_rugrayb.gif' width='10' height='19'>"
-
 
113
			L2e	= "<img src='images/tb_roblue.gif' width='8' height='19'>"
-
 
114
			L2d = "<img src='images/tb_lgray.gif' width='10' height='19'>"
-
 
115
	End Select 
-
 
116
	
94
	
-
 
95
    If SScolorStyle = "blue" Then
-
 
96
        Call GenStyle ("white", "#003399")
-
 
97
    Else
-
 
98
        Call GenStyle ("black", "#ffcc33")
-
 
99
    End If
-
 
100
 
117
	FirstTab = LBound(SSarray)
101
	FirstTab = LBound(SSarray)
118
	LastTab = UBound(SSarray)
102
	LastTab = UBound(SSarray)
119
	enabled = false
-
 
120
	
103
 
121
	Response.write "<table width='1' border='0' cellspacing='0' cellpadding='0'><tr>"
104
    ' With CSS only
122
	
105
    '
-
 
106
	Response.write "<ul class=tabs>"
123
	For i = FirstTab To LastTab
107
	For i = FirstTab To LastTab
-
 
108
        Dim tempArray
124
		tempArray = SSarray(i)
109
		tempArray = SSarray(i)
125
		prevEnabled = enabled
-
 
126
		
-
 
127
		enabled = FALSE
110
		enabled = FALSE
128
        TabsCurrentSelection = SSselected 
-
 
129
		If SSselected <> "" Then enabled = (tempArray(1) = SSselected)
111
		If SSselected <> "" Then enabled = (tempArray(1) = SSselected)
130
		Select Case i
-
 
131
		Case FirstTab
-
 
132
			Call Draw_First_Tab  ( enabled,              tempArray(0) & tempArray(1), tempArray(2) )
-
 
133
		Case LastTab
-
 
134
			Call Draw_Last_Tab   ( enabled, prevEnabled, tempArray(0) & tempArray(1), tempArray(2) )
112
		Call Draw_Tab_LiEntry ( enabled, tempArray(0) & tempArray(1), tempArray(2) )
135
		Case Else
-
 
136
			Call Draw_Middle_Tab ( enabled, prevEnabled, tempArray(0) & tempArray(1), tempArray(2) )
-
 
137
		End Select
-
 
138
		
-
 
139
	Next
113
	Next
140
	
-
 
141
	Response.write "</tr></table>"
114
	Response.write "</ul>"
142
	
-
 
143
End Sub
115
End Sub
144
%>
116
%>
145
 
117
 
146
 
118
 
147
 
119