Project

General

Profile

« Previous | Next » 

Revision 5704

include loadStats() method in branding.js to be reused more widely (with qformat parameter)

View differences:

lib/style/shared/eml-2/eml-distribution.xsl
152 152
			</span>
153 153
			<script language="JavaScript">
154 154
				if (window.loadStats) {
155
					loadStats('<xsl:value-of select="$divID" />', '<xsl:value-of select="$docID" />', '<xsl:value-of select="$contextURL" />/metacat');
155
					loadStats(
156
						'<xsl:value-of select="$divID" />', 
157
						'<xsl:value-of select="$docID" />', 
158
						'<xsl:value-of select="$contextURL" />/metacat', 
159
						'<xsl:value-of select="$qformat" />');
156 160
				}
157 161
			</script>
158 162
		</xsl:if>			
lib/style/shared/eml-2/eml-identifier.xsl
50 50
			<span id="stats"></span>
51 51
			<script language="JavaScript">
52 52
				if (window.loadStats) {
53
					loadStats('stats', '<xsl:value-of select="$packageID" />', '<xsl:value-of select="$contextURL" />/metacat');
53
					loadStats(
54
						'stats', 
55
						'<xsl:value-of select="$packageID" />', 
56
						'<xsl:value-of select="$contextURL" />/metacat',
57
						'<xsl:value-of select="$qformat" />');
54 58
				}
55 59
			</script>
56 60
          <xsl:if test="normalize-space(../@system)!=''">
lib/style/skins/semtools/search.js
85 85
    //alert("query: " + submitFormObj.query.value);
86 86

  
87 87
    return true;
88
}
89
function loadStats(divId, docId, url) {
90
	$("#" + divId).load(
91
		url, 
92
		{
93
			'action': "getlog",
94
			'docid': docId,
95
			'qformat': "semtools"
96
		},
97
		// call back function when loading finishes
98
		function(response, status, xhr) {
99
			//alert("callback for: " + divId + " selected node: " + selectedNodeId);
100
			// error
101
			if (status == "error") {
102
				var msg = "Sorry but there was an error: ";
103
				$("#error").html(msg + xhr.status + " " + xhr.statusText);
104
			}
105
		});
106
}
88
}
lib/style/skins/semtools/annotation-root.xsl
72 72
								<!-- stats -->
73 73
								<span id="annotationStats"></span>
74 74
								<script language="JavaScript">
75
									loadStats('annotationStats', '<xsl:value-of select="./@id" />', '<xsl:value-of select="$contextURL" />/metacat');
75
									loadStats(
76
										'annotationStats', 
77
										'<xsl:value-of select="./@id" />', 
78
										'<xsl:value-of select="$contextURL" />/metacat',
79
										'<xsl:value-of select="$qformat" />');
76 80
								</script>
77 81
								
78 82
							</td>	
lib/style/common/branding.js
284 284
  form_ref.action.value=action;
285 285
  form_ref.submit();
286 286
}
287

  
288
/**
289
* This uses jQuery to load access log information
290
**/
291
function loadStats(divId, docId, url, qformat) {
292
	$("#" + divId).load(
293
		url, 
294
		{
295
			'action': "getlog",
296
			'docid': docId,
297
			'qformat': qformat
298
		},
299
		// call back function when loading finishes
300
		function(response, status, xhr) {
301
			//alert("callback for: " + divId + " selected node: " + selectedNodeId);
302
			// error
303
			if (status == "error") {
304
				var msg = "Sorry but there was an error: ";
305
				$("#error").html(msg + xhr.status + " " + xhr.statusText);
306
			}
307
		});
308
}

Also available in: Unified diff