var hideHeader=false; var appUrl="https://asp-prod1.crk.umn.edu/csms"; var appUrl_login="https://asp-prod1.crk.umn.edu/csms/login.aspx"; var appUrl_logout="https://asp-prod1.crk.umn.edu/csms/logout.aspx"; var appUrl_profileAdd=""; var appUrl_profileEdit="https://onestop2.umn.edu/personaldemographics/viewGeneralInfo.do?institution=UMNTC#name"; var appUser=null; /*--- Start File:D:\UMC-Apps\Web-Apps\CSMS\Releases\current\scripts\..\scripts\common.js ---*/ var publicWebserviceUrl = appUrl + "/webservice.asmx"; var flashVersion = "9.0.28"; //var loaderFunctions = []; var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; var isIE7 = (navigator.appVersion.indexOf("MSIE 7") != -1) ? true : false; var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false; var isChrome = (navigator.userAgent.indexOf("Chrome") != -1) ? true : false; var isSafari = (navigator.userAgent.indexOf("Safari") != -1) ? true : false; var bodyNode; Array.prototype.remove = function(item) { for(var i=0;i -1) this.location = this.location.substring(0,queryStartIndex); qs=document.location.search.substring(1,location.search.length); } if (qs.length == 0) return; qs = qs.replace(/\+/g, ' '); var args = qs.split('&'); // parse out name/value pairs separated via & // split out each name=value pair for (var i=0;i -1) { this.params[name] = null; this.names.removeAt(index); } } function indexOfParams(name) { for(var i=0;i -1) return true; return false; } function Querystring_get(key, _default) { // This silly looking line changes UNDEFINED to NULL //if (default_ == null) default_ = null; var value=""; if(isNaN(key)) value=this.params[key]; else value=this.params[this.names[key]]; if (value==null) value=_default; return value; } this.serializeQuery = function() { var valueString = ""; for(var i=0;i0) { for(var i=0;i 0 && title.length > 0) break; } if(value.length > 0 && title.length > 0) { option.writeAttribute("value",value); option.update(title); } element.appendChild(option); } } } DataTable.Columns = function() { var items = []; this.getByColumnName = function(name) { name = name.toLowerCase(); for(var index=0;index 0) { th.addClassName(controls_className); } else th.setStyle({width:"145px"}); tr_header.appendChild(th); //controls column header (empty) } for(var thIndex=0;thIndex 0) td.addClassName(controls_className); else td.setStyle({width:"145px"}); td.appendChild(new Element("span").addClassName("update_marker").setStyle({display:"inline-block", width:"8px"})); //td.appendChild(new Element("input", {type:"checkbox"}).observe("change",select_row.bind(new Row_Selector_Object(tr, fields)))); if(actions["update_action"] != null) { button_update = new Element("input", {type:"button", value:"Update"}); td.appendChild(button_update); } if(actions["delete_action"] != null) { button_delete = new Element("input", {type:"button", value:"Delete"}); td.appendChild(button_delete); } tr.appendChild(td); } for(var colIndex=0;colIndex 0) { button_update.observe("click", actions["update_action"].bind(fields, done_updating.bind(tr))); } if(button_delete != null && fields.keys().length > 0) { button_delete.observe("click", actions["delete_action"].bind(fields, done_deleting.bind(tr))); } tbody.appendChild(tr); } this.table_element.appendChild(tbody); function done_deleting() { var tr = this; Element.remove(tr); } function done_updating() { var tr = this; tr.select(".update_marker")[0].update(""); var row_status = new Element("div", {style:"position:absolute;text-align:center;padding-top:4px;"}); row_status.appendChild(new Element("span", {style:"padding:0 20px;background-color:#FBFFC5;border:solid 1px #BCBF92;font-weight:600;font-size:13px;letter-spacing:1px;"}).update("Updated!")); Position.clone(tr,row_status); tr.up().appendChild(row_status); function start_effect() { new Effect.Highlight(tr, {duration:1.5}); new Effect.Puff(row_status, {duration:1.5}); function done() { Element.remove(row_status); tr.writeAttribute("style",""); } setTimeout(done,2000); } setTimeout(start_effect,250); } function set_update_marker() { var tr = this; tr.select(".update_marker")[0].update("*"); } } /* function getPages() { if(this.items > 0 && this.pageSize > 0) return Math.ceil(this.items/this.pageSize); return 1; } function select_row() { var hasItem = false; for(var index=0;index 0) div.appear({duration:2}); else div.fade({duration:2}); } function redirectToLogin() { if(appUrl_login == null || appUrl_login.length == 0) return; if(appUrl_login.indexOf("?") == -1) appUrl_login += "?"; window.location.href = appUrl_login + "&desturl=" + escape(window.location.href); } function redirectToLogout() { if(appUrl_logout == null || appUrl_logout.length == 0) return; if(appUrl_logout.indexOf("?") == -1) appUrl_logout += "?"; window.location.href = appUrl_logout + "&desturl=" + escape(window.location.href); } function getNodeValue(parentNode,nodeName) //mark for depreciation { var value = ""; try { value = Element.cleanWhitespace(parentNode.getElementsByTagName(nodeName)[0]).firstChild.data; }catch(e) { try{ value = (parentNode.getElementsByTagName(nodeName)[0]).firstChild.data; }catch(e){} } if(typeof trim == "function") value = trim(value); return value; } function getFlashMovie(name) { //if(isIE) //alert($(window.document.getElementById(name))); //return $(name); return $(window.document[name]); } function getBodyNode() { if(bodyNode == null) { try { bodyNode = $$("body")[0]; }catch(err){} } return bodyNode; } /*function global_init() { if(bodyNode == null) { bodyNode = $$("body")[0]; } if(loaderFunctions.length == 0) return; for(var i=0;i 0) src += "&width=" + newWidth; } if(newHeight != null) { src = src.replace(/(&)?height=\w*/ig,""); if(newHeight > 0) src += "&height=" + newHeight; } if(scaleType != null) { src = src.replace(/(&)?scaleType=\w*/ig,""); if(scaleType.length > 0) src += "&scaleType=" + scaleType; } if(showBorder != null) { src = src.replace(/(&)?showBorder=\w*/ig,""); if(showBorder) src += "&showBorder=1"; } return src; } MediaManager.resizeNodeMediaImages = function(node, newWidth, newHeight, scaleType, showBorder) { var imageNodes = node.getElementsBySelector("img"); for(var imageIndex=0;imageIndex left && mouseX < (left + width)) { if(mouseY > top && mouseY < (top + height)) { //window.status = "hit"; return true; } } //window.status = mouseX + ";" + mouseY + ";[" + left + "," + top + "," + (left + width) + "," + (top + height) + "]"; return false; } var XMLUtils = {}; XMLUtils.getNodeAttribute = function(node, name) { if(node == null) return null; var atts = node.attributes; if(atts == null || atts.length == 0) return null; var att = atts.getNamedItem(name); if(att == null) return null; return att.value; } XMLUtils.getNodeValue = function(node) { if(node == null) return null; var node = Element.cleanWhitespace(node); if(node == null) return null; if(node.firstChild == null) return null; return node.firstChild.data; } XMLUtils.getNodeByName = function(parentNode, nodeName) { nodeName = nodeName.toLowerCase(); parentNode = Element.cleanWhitespace(parentNode); for(var i=0;i 0) { Element.remove(node.firstChild); } } var MathX = {}; MathX.round = function(number, dec) { return Math.round(number*Math.pow(10,dec))/Math.pow(10,dec); } XMLUtils.requestData = function(url, formValues, success_action, error_action) { if(error_action == null) { error_action = function(msg) { alert("An error occurred: " + msg); } } new Ajax.Request(url, {method:'POST', parameters:formValues, onSuccess:parseResponse}); function parseResponse(response) { if(response.status == 200) { var parser = new XmlParser(); parser.load(response); var msg = parser.status; if(parser.isSuccess) { if(success_action != null) { success_action(parser.dataTable, {page:parser.page, pageSize:parser.pageSize, items:parser.items}); } } else { error_action(msg); } } else if(response.status == 0) { if(confirm("You have been logged out, refresh page to re-login?")) { window.location.reload(); } return; } else { alert("An unknown error has occurred."); } } } /*--- End File ---*/ /*--- Start File:D:\UMC-Apps\Web-Apps\CSMS\Releases\current\scripts\..\layouts\current\scripts\common.js ---*/ function public_master_init() { var loginSection = $("loginSection"); var logoutSection = $("logoutSection"); var loginInfoSection = $("loginInfoSection"); loginSection.setStyle({display:"inline"}); if(appUser != null && appUser["username"] != null) { loginSection.setStyle({display:"none"}); var loginUsernameHtml = appUser["username"]; if(appUrl_profileEdit.length > 0) loginUsernameHtml = "" + loginUsernameHtml + ""; $("loginUsername").update(loginUsernameHtml); logoutSection.setStyle({display:"inline"}); loginInfoSection.setStyle({display:"inline"}); $("loginUserGroup").update("(" + appUser["userGroupTitle"] + ")"); } } /*--- End File ---*/ /*--- Start File:D:\UMC-Apps\Web-Apps\CSMS\Releases\current\scripts\..\app\scripts\common.js ---*/  function onFormFieldValidate(source, args) { args.IsValid = false; if($(source.controltovalidate).tagName.toLowerCase() == "select") { if(args.Value > 0) args.IsValid = true; } else { if(args.Value.length > 0) args.IsValid = true; } } /*--- End File ---*/