// ***** ------------------ ***** // ***** web_app_col.js ***** // ***** ------------------ ***** function chooseSchool(id) { var frm = document.forms['frmChooseSchool']; frm.elements['SCHOOL.CODE'].value = id; frm.submit(); } // --- perform upload and show progress --- $(document).ready(function() { var frm = $("#frmUploader"); if(frm.length == 1) { var bar = $(".bar"); var percent = $(".percent"); frm.ajaxForm({ beforeSend: function() { var percentVal = "0%"; bar.width(percentVal); percent.html(percentVal); $(".progress").show(); }, uploadProgress: function(event, position, total, percentComplete) { var percentVal = percentComplete + "%"; bar.width(percentVal) percent.html(percentVal); }, complete: function(xhr) { bar.width("100%") percent.html("100%"); var resp = $.trim(xhr.responseText); //THIS IS WHAT IS RETURNED BY ME IN THE PROCESS SUBROUTINE: "ERROR" OR "UPLOAD KEY|ORIG NAME" if(resp == "ERROR") { alert("Upload Failed!"); return; } // --- successful --- var arr = resp.split('|'); $("input[name='TRANSCRIPT.UPLOAD']").val(arr[0]); $("#divFileName").html('\\\\PsuServer\\Temp\\' + arr[1]); $("#uploadSection1").hide(); var objNote = $("#uploadSection2Note"); objNote.css("paddingTop", 20); objNote.html('Transcript successfully uploaded. Click Continue to associate it with your application.'); $("#uploadSection2").show(); }, error: function(msg) { alert("Upload Failed!"); } }); } }); $(document).on("click", "#btnRemoveUpload", function() { $("#uploadSection2").hide(); $("input[name='TRANSCRIPT.UPLOAD']").val(''); $("#frmUploader")[0].reset(); //jquery doesn't support reset but native javascript does $(".progress").hide(); var objNote = $("#uploadSection1Note"); objNote.css("paddingTop", 20); objNote.html('Click Continue to complete the removal, or upload a replacement.'); $("#uploadSection1").show(); }); $(document).on("click", "#btnUpload", function() { if($("#txtFile").val() == '') { alert('Browse for a Transcript'); return; } $("#frmUploader").submit(); }); $(document).on("click", "#btnViewUpload", function() { document.location.href='/web.app.col/download.transcript/' + $("input[name='TRANSCRIPT.UPLOAD']").val(); }); $(document).on("click", "#btnContinue", function(){ $("#frmPage").submit(); }); // ***** ------------------------------ ***** // ***** NoSpecialCharacterInput.js ***** // ***** ------------------------------ ***** // // // There are the charCodes we consider valid. // NOTE: These charCodes should match the codes on the // CONTROL.POINT VALID.CHARS.ARRAY record. That // record is used to construct the error information // when an invalid character is submitted to // our server. // // 58 is : // 38 is & // 32 is space // 45 is - // 40 is ( // 41 is ) // 47 is / // 39 is ' // 44 is , // 48 through 57 are digits 0,1,2,3,4,5,6,7,8,9 // 65 through 90 are upper case characters A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,X.Y,Z // 97 through 122 are4 lower case characters a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,x,y,z // // These are the keyCodes we consider valid. // keyCodes ARE DIFFERENT from charCodes!!! // var specialKeys = new Array(); specialKeys.push(8); //Backspace specialKeys.push(9); //Tab specialKeys.push(46); //Delete specialKeys.push(45); //Insert specialKeys.push(36); //Home specialKeys.push(35); //End specialKeys.push(37); //Left specialKeys.push(39); //Right function IsAlphaNumeric(e) { document.getElementById("SpecialCharsMsg").style.display = "none"; var keyCode = e.keyCode == 0 ? e.charCode : e.keyCode; // alert(keyCode); // alert(specialKeys.indexOf(e.keyCode)); // alert(e.charCode); // alert(e.keyCode); var ret = ((keyCode == 47 || keyCode == 39 || keyCode == 58 || keyCode == 38 || keyCode == 44 || keyCode == 32 || keyCode == 40 || keyCode == 41) || (keyCode >= 48 && keyCode <= 57) || (keyCode >= 65 && keyCode <= 90) || (keyCode >= 97 && keyCode <= 122) || (specialKeys.indexOf(e.keyCode) != -1 && e.charCode != e.keyCode)); document.getElementById("SpecialCharsMsg").style.display = ret ? "none" : "inline"; return ret; } // ***** -------------- ***** // ***** htmlDyn.js ***** // ***** -------------- ***** function updateAll(newCountry, objOldCountry, objState, objZip, config) { config = config.replace(/\~/g, "'"); config = config.replace(/\|/g, '"'); var oldCountry = objOldCountry[0].value; if (((oldCountry == 'USA') && (newCountry == 'USA')) || ((oldCountry != 'USA') && (newCountry != 'USA'))) { config += ' STATE.VALUE="' + objState[0].value + '"'; if(objZip != '') { var zip; if(newCountry == 'USA') { zip = objZip[0].value + '-' + objZip[1].value; } else { zip = objZip[0].value; } zip = zip.replace(/\"/g, '"'); config += ' ZIP.VALUE="' + zip + '"'; } } objOldCountry[0].value = newCountry; var url = '/ajax/htmlDyn?' + Math.random() + '&ACTION=6&COUNTRY=' + newCountry + '&CONFIG=' + escape(config); htmlList4Ajax(outputData, url); } function outputData(res) { var pieces = res.split('|'); var uniq = pieces[0]; //alert('stateLabel_' + uniq); document.getElementById('stateLabel_' + uniq).innerHTML = pieces[1]; document.getElementById('stateElement_' + uniq).innerHTML = pieces[2]; if(pieces.length > 3) { document.getElementById('zipLabel_' + uniq).innerHTML = pieces[3]; document.getElementById('zipElement_' + uniq).innerHTML = pieces[4]; } } // ***** --------------------------- ***** // ***** ajax.aw.html.list.v4.js ***** // ***** --------------------------- ***** /************************************************************************ * * Title: htmlList4Ajax() * Category: AJAX * File Name: ajax.js * WEB URL: * Created By: TAKE * Created Date: 2006-03-13 * Language: JavaScript * Description: Use AJAX(Asynchronous JavaScript + XML) * technology to download files and execute * callback function asynchronously. * * Syntax: htmlList4Ajax(sCallBack, URI, async) * * Parameters: sCallBack - callback function (no quotes) * URI - any URI where the source exists. * * Example: /example/ajax * * Browsers that support Ajax * -------------------------- * (Note that this is a general list, and support of Ajax * applications will depend on the features the browser supports.) * * Microsoft Internet Explorer version 5.0 and above, and browsers * based on it (Mac OS versions not supported) * Gecko-based browsers like Mozilla, Mozilla Firefox, SeaMonkey, * Epiphany, Galeon and Netscape version 7.1 and above * Browsers implementing the KHTML API version 3.2 and above, * including Konqueror version 3.2 and above, and Apple Safari * version 1.2 and above * Opera browsers version 8.0 and above, including Opera Mobile * Browser version 8.0 and above * (Reference: http://en.wikipedia.org/wiki/Ajax_%28programming%29) * * (Mac OS X 10.3 is required for the Apple Safari 1.2) * ***********************************************************************/ var AJAX_bPageLoaded = false; var AJAX_aCallBack = Array(); var AJAX_aRtnText = Array(); // --------------------------------------------------------- // function (htmlListAjax) // - your JavaScript program calls this function // --------------------------------------------------------- function htmlList4Ajax(sCallBack, sUri, bAsync, sParam) { var oAjax = createHttpRequest(); var sBrowser = getBrowser(); if (arguments[2] == null) { bAsync = true; } if (!sParam) { sParam = null; } // --- error messages --- var sError01 = ''; sError01 += 'ERROR: This function does not work on your browser\n\n'; sError01 += 'Please use one of the latest browsers. '; sError01 += 'Some PC compatible browsers: '; sError01 += 'IE5+, Netscape 7.1+, Firefox, etc. '; sError01 += 'MAC users are safe with Netscape or Firefox. '; sError01 += 'These are all free downloads!'; // --- unknown browser --- if (!oAjax) { alert(sError01); return false; } // --- callback function ------------------------------- // "oAjax.onload" is safer for opera, mozilla, konqueror // "oAjax.onload" does not work on IE // ----------------------------------------------------- switch (sBrowser) { case 'IE': oAjax.onreadystatechange = function(){ if (oAjax.readyState == 4 && oAjax.status == 200) { // --- session check --- var mixRtnValue = ''; if (oAjax.responseText.indexOf(" -1) { mixRtnValue = oAjax.responseXML; } else { mixRtnValue = oAjax.responseText; mixRtnValue = removeChar10(mixRtnValue); // see the definition if (mixRtnValue.indexOf('Log In Credentials')>-1){ mixRtnValue = 'ERROR: Session Timed Out.' } } if (sCallBack) { if (AJAX_bPageLoaded == true) { sCallBack(mixRtnValue); } else { AJAX_aCallBack.push(sCallBack); AJAX_aRtnText.push(mixRtnValue); } } } } break; default: oAjax.onload = function(){ // --- session check --- var mixRtnValue = ''; if (oAjax.responseText.indexOf(" -1) { var mixRtnValue = oAjax.responseXML; } else { var mixRtnValue = oAjax.responseText; mixRtnValue = removeChar10(mixRtnValue); // see the definition if (mixRtnValue.indexOf("Log In Credentials")>-1){ mixRtnValue = 'ERROR: Session Timed Out.' } } if (sCallBack) { sCallBack(mixRtnValue); } } break; } oAjax.open('POST', sUri, bAsync); oAjax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); oAjax.send(sParam); } function ajaxsubmit(sCallBack, sFormId, bAsync) { if (arguments[2] == null) { bAsync = true; } if (!sFormId) { sFormId = ''; } var aVar = Array(); var aVal = Array(); // --- input elements --- var cInput = document.getElementsByTagName('input'); for (var i=0; i