Project

General

Profile

« Previous | Next » 

Revision 4388

added Scriptaculous effects to many of the ajax calls.
neat-o!

View differences:

lib/style/skins/first/search.js
175 175
	
176 176
	window.document.getElementById("iframeheaderclass").src = window.document.getElementById("iframeheaderclass").src;
177 177
	
178
	alert(count + ' Field selections saved.'); 
178
	//alert(count + ' Field selections saved.'); 
179 179
	
180 180
	return true;
181 181
		
lib/style/skins/first/index.jsp
42 42
	src="<%=STYLE_COMMON_URL%>/branding.js"></script>
43 43
<script language="Javascript" type="text/JavaScript"
44 44
	src="<%=STYLE_COMMON_URL%>/prototype-1.5.1.1/prototype.js">
45
</script>	
45
</script>
46
<script language="Javascript" type="text/JavaScript"
47
	src="<%=STYLE_COMMON_URL%>/effects.js">
48
</script>
46 49
<script language="Javascript">
47 50

  
48 51
		function browseAll() {
......
80 83
			
81 84
			//alert("queryString=" + queryString);
82 85
			
83
			callAjax(metacatURL, queryString, "first-assessment", "ajaxSearchResults");			
86
			callAjax(metacatURL, queryString, "first-assessment", "ajaxSearchResults");
87
			
88
			Effect.Appear('ajaxSearchResults', {duration: 1.5});		
84 89
		}
85 90
   </script>
86 91
</head>
......
91 96
      </script>
92 97

  
93 98
<table width="100%" border="0" cellspacing="20" cellpadding="0">
94
	<!--DWLayoutTable-->
95 99
	<tr>
100
		<th colspan="2">
101
			Search
102
		</th>
103
	</tr>		
104
	<tr>
96 105
		<td>
97 106
			<form method="POST" action="<%=SERVLET_URL%>" target="_top" id="searchForm">
98 107
			
99 108
			<table class="tables" cellpadding="8" cellspacing="0">
100 109
				<tr class="sectheader">
110

  
101 111
					<td class="borderbottom" align="left" colspan="2">
102
						<p align="center">Search Assessments</p>
112
						Any field:
113
						<input size="30" name="searchstring" type="text" value="" id="searchBox">
103 114
					</td>
115

  
104 116
				</tr>
105 117
				<tr>
106
					<td align="left">
118
					<td align="left" class="borderbottom">
107 119
							
108 120
						<input name="query" type="hidden"> 
109 121
						<input name="qformat" value="first" type="hidden"> 
110 122
						<input type="hidden" name="action" value="squery"> 								
111 123
						
112 124
						<table>
125
							
113 126
							<tr>
114
								<td>Any field:</td>
115
								<td><input size="14" name="searchstring" type="text" value="" id="searchBox"></td>
116
							</tr>
117
							<tr>
118
								<td colspan="2"><hr/></td>
119
							</tr>
120
							<tr>
121 127
								<td>Institution: </td>
122 128
								<td><input name="institution" id="institution" type="text" size="14"/></td>
123 129
							</tr>
......
135 141
							</tr>
136 142
						</table>
137 143
					</td>
138
					<td valign="bottom">
144
					<td valign="bottom" class="borderbottom">
139 145
						<table>	
140 146
							<tr>
141 147
								<td nowrap="nowrap">
......
150 156
								<td nowrap="nowrap">Match all</td>
151 157
							</tr>
152 158
							<tr>
159
								<td colspan="2">
160
									<input type="button" onclick="javascript:searchAssessments()" value="Search"/>
161
								</td>
162
							</tr>
153 163
						</table>
154 164
					</td>
155 165
				</tr>
156
				<tr class="sectheader">
157
					<td class="borderbottom" colspan="1">
158
						<!-- <input type="button" value="Browse all" onclick="browseAll()"/> -->
159
						(<a href="javascript:browseAll()">Browse All...</a>)
160
					</td>
161
					<td class="borderbottom" colspan="1">
162
						<input type="button" onclick="javascript:searchAssessments()" value="Search"/>
163
						<!--  <input value="Search" type="submit"> -->
164
					</td>
165
				</tr>
166
				
166 167
			</table>
167 168
			</form>
168 169
			
169 170
		</td>
170 171
		<td colspan="1" valign="top">
171
			<div align="center">
172
			<div align="left">
172 173
				<p align="left">This tool allows you to search for Assessments either by keyword,
173 174
				or with a structured search that targets particular facets of an assessment.
174 175
				<br />
......
176 177
				You can use the '%' character as a wildcard in your searches (e.g.,
177 178
				'%biology%' would locate any phrase with the word biology embedded within it).
178 179
				</p>
180
				<a href="javascript:browseAll()">Browse All Assessments...</a>
179 181
			</div>
180 182
		</td>
181 183
	</tr>
182 184
	<tr>
183 185
		<td valign="top" colspan="2">	
184
			<div id="ajaxSearchResults">Search results...</div>
186
			<div id="ajaxSearchResults" style="display:none;">Search results...</div>
185 187
		</td>
186 188
	</tr>
187 189
</table>
lib/style/skins/first/header.jsp
38 38
<title>FIRST Data Repository</title>
39 39
<link rel="stylesheet" type="text/css"
40 40
	href="<%=STYLE_SKINS_URL%>/first/first.css"></link>
41
<script language="Javascript" type="text/JavaScript"
42
	src="<%=STYLE_COMMON_URL%>/prototype-1.5.1.1/prototype.js">
43
</script>		
44
<script language="Javascript" type="text/JavaScript"
45
	src="<%=STYLE_COMMON_URL%>/effects.js">
46
</script>
47
<script language="Javascript">
48
		
49
	function highlight() {
50
		//Effect.Pulsate('importantThings', { pulses: 1, duration: 2 });
51
		//Effect.Fade('importantThings');
52
		Effect.Shake('importantThings');
53
	}
54
</script>		
55
	
41 56
</head>
42 57

  
43
<body>
58
<body onload="highlight()">
44 59
<table width="100%" border="0" cellspacing="0" cellpadding="0">
45 60
	<tr valign="top">
46 61
		<td width="400">
......
77 92
						<a href="cart.jsp" target="_top">
78 93
							Cart 
79 94
						</a>	
80
							(Items: <%=docids.length %>, Fields: <%=fields.size() %>)
95
							<div id="importantThings">
96
								(Items: <%=docids.length %>, Fields: <%=fields.size() %>)
97
							</div>
81 98
					</td>
82 99
				</tr>
83 100
				<tr>
lib/style/skins/first/cart.jsp
44 44
<script language="Javascript" type="text/JavaScript"
45 45
	src="<%=STYLE_COMMON_URL%>/prototype-1.5.1.1/prototype.js">
46 46
</script>	
47
<script language="Javascript" type="text/JavaScript"
48
	src="<%=STYLE_COMMON_URL%>/effects.js">
49
</script>
47 50
<script language="Javascript">
48 51
		
49 52
		function listAssessments(){
......
59 62
			var queryString = 
60 63
				generateAssessmentListString(docids);
61 64
					
62
			callAjax(metacatURL, queryString, "first-assessment", "ajaxCartResults");			
65
			callAjax(metacatURL, queryString, "first-assessment", "ajaxCartResults");
66
			
67
			Effect.Appear('ajaxCartResults');
68
			//Effect.BlindDown('ajaxCartResults');
63 69
		}
70
		
64 71
   </script>
65 72
</head>
66 73
<body onload="listAssessments()">
......
72 79
<table width="100%" border="0" cellspacing="0" cellpadding="0">
73 80
	<tr>
74 81
		<th>
75
			Shopping Cart
82
			Cart
76 83
			<form method="POST" action="<%=SERVLET_URL%>" target="_top" id="searchForm">
77 84
				<input name="qformat" value="first-assessment" type="hidden"> 
78 85
				<input name="action" value="squery" type="hidden"> 	
......
103 110
	</tr>
104 111
	<tr>
105 112
		<td>
106
			<div id="ajaxCartResults">Loading Cart...</div>
113
			<div id="ajaxCartResults" style="display:none;">Loading Cart...</div>
107 114
		</td>
108 115
	</tr>
109 116
</table>
lib/style/skins/first/first-assessment-resultset.xsl
100 100
					{	method: 'post',
101 101
						parameters: Form.serialize(submitFormObj),
102 102
						evalScripts: true,
103
						onSuccess: function(transport) {alert('Cart changes saved: ' + operation); window.document.getElementById("iframeheaderclass").src=window.document.getElementById("iframeheaderclass").src;}, 
103
						onSuccess: function(transport) {
104
							//alert('Cart changes saved: ' + operation); 
105
							window.document.getElementById("iframeheaderclass").src=window.document.getElementById("iframeheaderclass").src;}, 
104 106
						onFailure: function(transport) {alert('failure making ajax call');}
105 107
					 });
106 108
								
......
141 143
				
142 144
			}
143 145
			hideDiv = function(divId) {
144
				Element.hide(divId);
146
				Effect.Fade(divId);
147
				//Element.hide(divId);
145 148
			}
146 149
			showDiv = function(divId) {
147
				Element.show(divId);
150
				Effect.Appear(divId)
151
				//Element.show(divId);
148 152
			}
149 153
		 ]]>	
150 154
		</script>
......
158 162
				
159 163
			Download Selected as:
160 164
			<a>
161
				<xsl:attribute name="href">#</xsl:attribute>
162
				<xsl:attribute name="onClick">javascript:downloadMergedResponseData('assessmentForm', 'fieldForm')</xsl:attribute>
165
				<xsl:attribute name="href">javascript:downloadMergedResponseData('assessmentForm', 'fieldForm')</xsl:attribute>
163 166
				<xsl:text>Datafile (.csv)</xsl:text>
164 167
			</a>
165 168
			<br/>
166 169
			Edit Cart:
167 170
			<a>
168
				<xsl:attribute name="href">#</xsl:attribute>
169
				<xsl:attribute name="onClick">javascript:editCart('assessmentForm', 'add')</xsl:attribute>
171
				<xsl:attribute name="href">javascript:editCart('assessmentForm', 'add')</xsl:attribute>
170 172
				<xsl:text>Add Selected</xsl:text>
171 173
			</a>
172 174
			/
173 175
			<a>
174
				<xsl:attribute name="href">#</xsl:attribute>
175
				<xsl:attribute name="onClick">javascript:editCart('assessmentForm', 'remove')</xsl:attribute>
176
				<xsl:attribute name="href">javascript:editCart('assessmentForm', 'remove')</xsl:attribute>
176 177
				<xsl:text>Remove Selected</xsl:text>
177 178
			</a>
178 179
			
......
320 321
					</tr>
321 322
					
322 323
					<tr>
323
						<td colspan="6">
324
						<td>
325
						</td>
326
						<td colspan="5">
327
							Details (
324 328
							<a>
325
								<xsl:attribute name="href">#</xsl:attribute>
326
								<xsl:attribute name="onClick">javascript:read('readForm', '<xsl:value-of select="./docid" />', '<xsl:value-of select="$divId" />')</xsl:attribute>
327
								<xsl:text>View</xsl:text>
329
								<xsl:attribute name="href">javascript:read('readForm', '<xsl:value-of select="./docid" />', '<xsl:value-of select="$divId" />')</xsl:attribute>
330
								<xsl:text>+</xsl:text>
328 331
							</a>
329 332
							/
330 333
							<a>
331
								<xsl:attribute name="href">#</xsl:attribute>
332
								<xsl:attribute name="onClick">javascript:hideDiv('<xsl:value-of select="$divId" />')</xsl:attribute>
333
								<xsl:text>Hide</xsl:text>
334
								<xsl:attribute name="href">javascript:hideDiv('<xsl:value-of select="$divId" />')</xsl:attribute>
335
								<xsl:text>-</xsl:text>
334 336
							</a>
335
							
336
							<div>
337
							)
338
						</td>	
339
					</tr>
340
					
341
					<tr>
342
						<td colspan="6">
343
							<div style="display:none;">
337 344
								<xsl:attribute name="id">
338 345
									<xsl:value-of select="$divId" />
339 346
								</xsl:attribute>

Also available in: Unified diff