Project

General

Profile

« Previous | Next » 

Revision 4495

pull out the IE/FF differences into common method that returns the document object for an iFrame (works with IE now!)

View differences:

lib/style/skins/first/search.js
503 503
		 });
504 504
		 
505 505
	 //alert("done calling ajax");
506
}
506
}
507
function getIframeDocument(iframeId) {
508
	//look up the document
509
	var iframe = window.document.getElementById(iframeId);
510
	var doc = null;
511
	if (iframe.contentDocument) {
512
		doc = iframe.contentDocument;
513
	}
514
	else {
515
		doc = iframe.contentWindow.document;
516
	}
517
	return doc;
518
}
lib/style/skins/first/cart.jsp
53 53
			var metacatURL = "<%=CONTEXT_URL%>/metacat";
54 54
		
55 55
			var docids = new Array();
56
			var objs = window.document.getElementById("iframeheaderclass").contentDocument.getElementsByName("@packageId");
56
			var doc = getIframeDocument("iframeheaderclass");
57
			var objs = doc.getElementsByName("@packageId");
57 58
			if (objs.length == 0) {
58 59
				return;
59 60
			}
lib/style/skins/first/first-assessment-resultset.xsl
61 61
			<![CDATA[
62 62
			downloadMergedResponseData = function(formId, fieldFormId) {
63 63
			
64
				//if (!areItemsSelected('docid')) {
65
				//	alert("Please select at least one dataset");
66
				//	return false;
67
				//}
68
								
69
				//transfer the assessmentItemId to this form
70
				//document.getElementById("questionId").value = document.getElementById("assessmentItemId").value;
71
				//alert("questionId: " + document.getElementById("questionId").value);
72
				
73 64
				var submitFormObj = document.getElementById(formId);
74 65
				submitFormObj.qformat.value = 'csv';
75 66
				submitFormObj.action.value = 'dataquery';
76 67
				
77 68
				//the form that holds the metadata field mappings - but in the header!
78 69
				var fieldFormObj = 
79
					window.document.getElementById("iframeheaderclass").contentDocument.getElementById(fieldFormId);
70
					getIframeDocument("iframeheaderclass").getElementById(fieldFormId);
80 71
				//alert("fieldFormObj: " + fieldFormObj);
81 72
				
82 73
				multipleAssessmentSearch(submitFormObj, fieldFormObj);
......
162 153
			}	
163 154
			isInCart = function(docid) {
164 155
		
165
				var iframe = window.document.getElementById("iframeheaderclass").contentDocument;
166
				var doc = iframe.contentDocument;
167
				if (!doc) {
168
					doc = iframe.contentWindow.document;
169
				}
156
				//look up the cart in the header
157
				var doc = getIframeDocument("iframeheaderclass");
170 158
				var objs = doc.getElementsByName("@packageId");
171 159
				
172
				//var objs = document.getElementsByName("@packageId");
173 160
				if (objs.length == 0) {
174 161
					return false;
175 162
				}
......
208 195
					hideDiv("ajaxDiv" + docid + "remove");
209 196
					showDiv("ajaxDiv" + docid + "add");
210 197
				}
211
			}	
198
			}
199
			
212 200
		 ]]>	
213 201
		</script>
214 202
        

Also available in: Unified diff