|
From: S C. <sl...@us...> - 2008-05-16 21:57:18
|
Update of /cvsroot/strandmapservic/nsdl-client-project/web/js In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv18946/web/js Modified Files: nsdlclientsms.js Log Message: submit suggested resources using AAAS code. Add a tab that only shows aligned resources. If resources are aligned, default to new tab. Index: nsdlclientsms.js =================================================================== RCS file: /cvsroot/strandmapservic/nsdl-client-project/web/js/nsdlclientsms.js,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** nsdlclientsms.js 18 Apr 2008 21:43:25 -0000 1.7 --- nsdlclientsms.js 16 May 2008 21:57:13 -0000 1.8 *************** *** 17,22 **** SMSEvent.addListener(StrandMap,"onprintviewdisplay",onPrintViewDisplay); // Create the 'Resources' tab and set it's handler: ! resourcesTab = new InfoBubbleTab('Resources'); infoBubble.addTab(resourcesTab); SMSEvent.addListener(StrandMap,"onbenchmarkselect",resourcesTabCallback); --- 17,27 ---- SMSEvent.addListener(StrandMap,"onprintviewdisplay",onPrintViewDisplay); + // Create the aligned 'Resources' tab and set it's handler: + resourcesStrictTab = new InfoBubbleTab('Resources'); + infoBubble.addTab(resourcesStrictTab); + SMSEvent.addListener(StrandMap,"onbenchmarkselect",resourcesStrictTabCallback); + // Create the 'Resources' tab and set it's handler: ! resourcesTab = new InfoBubbleTab('Search Results'); infoBubble.addTab(resourcesTab); SMSEvent.addListener(StrandMap,"onbenchmarkselect",resourcesTabCallback); *************** *** 24,28 **** // Use the built-in tabs for displaying related benchmarks and nses standards: infoBubble.addBuiltinTab("nses","NSES Standards"); ! infoBubble.addBuiltinTab("relatedbenchmarks","Related benchmarks"); // When a benchmark is selected by the user, make sure the resourcesTab is displayed: --- 29,33 ---- // Use the built-in tabs for displaying related benchmarks and nses standards: infoBubble.addBuiltinTab("nses","NSES Standards"); ! infoBubble.addBuiltinTab("relatedbenchmarks","Related Benchmarks"); // When a benchmark is selected by the user, make sure the resourcesTab is displayed: *************** *** 51,55 **** numberOfStrands = 0; resourcesTab.setContent('Loading...'); ! getResources('strict'); } function recommendTabCallback() { --- 56,67 ---- numberOfStrands = 0; resourcesTab.setContent('Loading...'); ! getResources(''); ! } ! function resourcesStrictTabCallback(){ ! stdKeywords = ''; ! currentStrandCount = 0; ! numberOfStrands = 0; ! resourcesStrictTab.setContent('Loading...'); ! getResources('strict'); } function recommendTabCallback() { *************** *** 135,141 **** var grdloc = AAASCode.search(re); var newCode = AAASCode.substring(0,grdloc-1)+ '.' + AAASCode.substring(grdloc-1); ! var subCode = 'AAAS Benchmark ' + newCode.replace(re,'.'); ! ! return subCode; } --- 147,157 ---- var grdloc = AAASCode.search(re); var newCode = AAASCode.substring(0,grdloc-1)+ '.' + AAASCode.substring(grdloc-1); ! var subCode = newCode.replace(re,'.'); ! ! var re2 = new RegExp('a?b?$'); ! var paraloc = subCode.search(re2); ! var lastCode = subCode.substring(0,paraloc); ! ! return lastCode; } *************** *** 169,172 **** --- 185,189 ---- var resDescription = document.getElementById('description').value; var resAudience = document.getElementById('audience').value; + var AAASCode = "AAAS Benchmarks " + getAAASCode(recordJson); var asnID = '<asnID></asnID>'; // for now asnID var is not included in url; *************** *** 180,184 **** } ! var reqUrl = "bubble/recommenderProcessor.jsp?url="+ resUrl+ "&title="+resTitle+"&description="+ resDescription + "&id="+bmID + "&grades="+grades + "&stds=" + resStandards + "&subjects=" + subjects + "&audience=" + resAudience + "&asnID="; new Ajax.Request( --- 197,201 ---- } ! var reqUrl = "bubble/recommenderProcessor.jsp?url="+ resUrl+ "&title="+resTitle+"&description="+ resDescription + "&id="+bmID + "&grades="+grades + "&stds=" + resStandards + "&subjects=" + subjects + "&AAASCode=" + AAASCode + "&audience=" + resAudience + "&asnID="; new Ajax.Request( *************** *** 200,203 **** --- 217,222 ---- function processResponse(resourceID, resUrl, resTitle, resDescription, bmID, grades, resStandards, subjects, bmID, resAudience){ // check for confirm id, then send data via email + + var mailUrl = "bubble/mail.jsp?resourceID=" + resourceID + "&url="+ resUrl+ "&title="+resTitle+"&description="+ resDescription + "&id="+bmID + "&grades="+grades + "&stds=" + resStandards + "&subjects=" + subjects + "&bmID=" + bmID +"&audience=" + resAudience; new Ajax.Request( *************** *** 310,321 **** if(displaytype == 'strict'){ var recordJson = StrandMap.getSelectedBenchmarkRecordJson(); ! var AAASCode = recordJson.itemRecord.Data.AAASCode; ! var re = new RegExp('/[A-Z]*'); ! ! var grdloc = AAASCode.search(re); ! var newCode = AAASCode.substring(0,grdloc-1)+ '.' + AAASCode.substring(grdloc-1); ! var subCode = newCode.replace(re,'.'); var id = StrandMap.getSelectedBenchmarkId(); ! var reqUrl = "bubble/resourcesStrict.jsp?bmId="+ id + "&startingOffset=" + offset + "&displaytype="+displaytype+"&AAASCode="+AAASCode+"&subAAASCode="+subCode; } else { --- 329,335 ---- if(displaytype == 'strict'){ var recordJson = StrandMap.getSelectedBenchmarkRecordJson(); ! var AAASCodeMod = getAAASCode(recordJson); var id = StrandMap.getSelectedBenchmarkId(); ! var reqUrl = "bubble/resourcesStrict.jsp?bmId="+ id + "&startingOffset=" + offset + "&displaytype="+displaytype+"&AAASCodeMod="+AAASCodeMod; } else { *************** *** 505,511 **** var contentCheck = content.search(re); if(contentCheck > -1){ ! resourcesTab.setContent(content); } else { ! getResources(''); } }); --- 519,526 ---- var contentCheck = content.search(re); if(contentCheck > -1){ ! resourcesStrictTab.setContent(content); ! infoBubble.selectTab(resourcesStrictTab); } else { ! resourcesStrictTab.setContent('<p>There are no hand-aligned resources for this benchmark. Please look at the Search Results tab for possible relevant resources in the NSDL.</p>'); } }); |