TEXT 23
Ajax.js Guest on 11th July 2020 03:43:39 PM
  1. var platformAlerting=$("#eddioPlatformValue").val();function ra_expand(c){try{var a=document.getElementById(c).getAttribute("url");a=a+"&action=expand";document.getElementById(c).setAttribute("class","refine-item refine-item-open");$.ajax({url:a,type:"POST",timeout:500000,success:function(d){ra_action(c,d,"expand")},error:function(d){ra_error("expand",d)}})}catch(b){}}function ra_collapse(c){try{var a=document.getElementById(c).getAttribute("url");a=a+"&action=collapse";document.getElementById(c).setAttribute("class","refine-item");$.ajax({url:a,type:"POST",timeout:500000,success:function(d){ra_action(c,d,"collapse")},error:function(d){ra_error("collapse",d)}})}catch(b){}}function ra_more(b){var a=document.getElementById(b).getAttribute("url");a=a+"&action=more";dojo.io.bind({url:a,load:function(d,e,c){ra_action(b,e)},mimetype:"text/plain"})}function ra_action(g,c,b){try{var f=document.getElementById(g);document.getElementById("tmp_ajax").innerHTML=c;if(f!=null&&b=="expand"){var a=document.getElementById("tmp_"+g).innerHTML;if(a.length){f.innerHTML=a;f.style.display="";f.style.visiblility="visible";document.getElementById(g).setAttribute("class","refine-item refine-item-open")}}}catch(d){}}function ra_error(b,a){try{var c=document.getElementById("summary_navigation");if(c!=null){c.submit()}}catch(d){}}function ra_showRefinePanel(b){var a=document.getElementById(b).getAttribute("url");a=a+"&action=showRefinePanel";dojo.io.bind({url:a,load:function(d,e,c){ra_panel_action(b,e,"showRefinePanel")},mimetype:"text/plain"})}function ra_hideRefinePanel(b){var a=document.getElementById(b).getAttribute("url");a=a+"&action=hideRefinePanel";dojo.io.bind({url:a,load:function(d,e,c){ra_panel_action(b,e,"hideRefinePanel")},mimetype:"text/plain"})}function ra_panel_action(d,b,a){var c=document.getElementById(d);document.getElementById("tmp_ajax").innerHTML=b;if(c&&a=="show"){c.innerHTML=document.getElementById("tmp_"+d).innerHTML;c.getElementById(d).style.display="";c.getElementById(d).style.visiblility="visible"}}function daisy_action_clearall(a){var b="dojo url is "+a;dojo.io.bind({url:a,load:function(d,e,c){},mimetype:"text/plain"})}function simple_update_action(a){var b="dojo url is "+a;dojo.io.bind({url:a,encoding:"utf8",load:function(d,e,c){},mimetype:"text/plain"})}function saveForm(i){if(i==null){return false}var c=dojo.byId(i);if(c==null){return false}var b=null;b=c.getAttribute("auto_save_url");if(b==null){return false}if(!$.fn.placeholder.input){var f;if(i){f=document.forms[i];var a=$(".placeholder",f).each(function(){this.value=""})}}var d=document.forms[i].elements.SID.value;var j=document.forms[i].elements.product.value;var h=document.forms[i].elements.search_mode.value;b=b+"&SID="+d+"&product="+j+"&search_mode="+h;try{dojo.io.bind({url:b,encoding:"utf8",sync:false,formNode:c,mimetype:"text/plain"})}catch(g){return false}if(!$.fn.placeholder.input){var f;if(i){f=document.forms[i];var a=$(".placeholder",f).each(function(){this.value=$(this).attr("placeholder")})}}return false}function saveOutputForm(j){if(j==null){return false}var g=document.getElementById("saveToMenu").value;document.getElementById("saveToMenuDefault").value=g;var c=dojo.byId(j);if(c==null){return false}var b=null;b=c.getAttribute("auto_save_url");if(b==null){return false}if(!$.fn.placeholder.input){var f;if(j){f=document.forms[j];var a=$(".placeholder",f).each(function(){this.value=""})}}var d=document.forms[j].elements.SID.value;var k=document.forms[j].elements.product.value;var i=document.forms[j].elements.search_mode.value;b=b+"&SID="+d+"&product="+k+"&search_mode="+i;try{dojo.io.bind({url:b,encoding:"utf8",sync:false,formNode:c,mimetype:"text/plain"})}catch(h){return false}if(!$.fn.placeholder.input){var f;if(j){f=document.forms[j];var a=$(".placeholder",f).each(function(){this.value=$(this).attr("placeholder")})}}return false}function logAccessEvent(a){if(a==null){return false}$.ajax({type:"GET",url:a,success:function(b){},error:function(b){}});return false}function saveDCRForm(o){if(o==null){return false}var b=dojo.byId(o);if(b==null){return false}var a=null;a=b.getAttribute("auto_save_url");if(a==null){return false}var d=document.forms[o].elements.SID.value;var p=document.forms[o].elements.product.value;var l=document.forms[o].elements.search_mode.value;a=a+"&SID="+d+"&product="+p+"&search_mode="+l;var k=b.cloneNode(true);k.innerHTML=b.innerHTML;for(var g=0;g<k.elements.length;g++){var m=k.elements[g].value;var q=k.elements[g].type;if(typeof m=="undefined"){k.elements[g].value=""}if(q==null){k.elements[g].type="unknown"}}for(var g=0;g<k.elements.length;g++){var m=k.elements[g].value;var q=k.elements[g].type;var j=k.elements[g].checked;var f=k.elements[g].name;if(q=="radio"&&j==false){k.elements[g].name="ignore"}}try{dojo.io.bind({url:a,sync:false,formNode:k,mimetype:"text/plain"})}catch(h){return false}return false}function saveRadioForm(l){if(l==null){return false}var b=dojo.byId(l);if(b==null){return false}var a=null;a=b.getAttribute("auto_save_url");if(a==null){return false}var d=document.forms[l].elements.SID.value;var m=document.forms[l].elements.product.value;var k=document.forms[l].elements.search_mode.value;a=a+"&SID="+d+"&product="+m+"&search_mode="+k;for(var g=0;g<b.elements.length;g++){var o=b.elements[g].value;var p=b.elements[g].type;var j=b.elements[g].checked;var f=b.elements[g].name;if(typeof o=="undefined"){b.elements[g].value=""}if(p==null){b.elements[g].type="unknown"}if(p=="radio"){if(j==false&&(f!="period"&&f!="granularity")){b.elements[g].name="ignore"}}}try{dojo.io.bind({url:a,encoding:"utf8",sync:false,formNode:b,mimetype:"text/plain"})}catch(h){return false}return false}function postAsyncForm(c,b){var a=function(d){};formDataHandlerAction(c,a,b)}function formDataHandlerAction(j,m,d){if(m==null){m=function(e){document.write(e)}}var c=null;if(j!=null){c=dojo.byId(j)}if(c==null){return false}var b=null;if(d==null){d="url"}b=c.getAttribute(d);if(b==null||b.length<1){return false}var h;if(navigator.userAgent.indexOf("Safari")>0){h=c}else{var h=c.cloneNode(true);for(var f=0;f<h.elements.length;f++){var k=h.elements[f].value;var l=h.elements[f].type;if(typeof k=="undefined"){h.elements[f].value=""}if(l==null){h.elements[f].type="unknown"}}}var a=true;try{dojo.io.bind({url:b,encoding:"utf8",sync:true,formNode:h,mimetype:"text/plain",load:function(i,n,e){a=m(n)}})}catch(g){return false}return a}function postAsyncCheckboxForm(c,b){var a=function(d){};checkboxFormDataHandlerAction(c,a,b)}function checkboxFormDataHandlerActionAlt(h,l,d,c){if(l==null){l=function(e){document.write(e)}}var b=null;if(h!=null){b=dojo.byId(h)}if(b==null){return false}var a=null;if(d==null){d="url"}a=b.getAttribute(d);if(a==null||a.length<1){return false}if(navigator.userAgent.indexOf("Safari")>0){}else{for(var f=0;f<b.elements.length;f++){var j=b.elements[f].value;var k=b.elements[f].type;if(typeof j=="undefined"){b.elements[f].value=""}if(k==null){b.elements[f].type="unknown"}}}try{dojo.io.bind({url:a,encoding:"utf8",sync:c,formNode:b,mimetype:"text/plain",load:function(i,m,e){l(m)}})}catch(g){return false}return false}function checkboxFormDataHandlerAction(g,k,c){if(k==null){k=function(e){document.write(e)}}var b=null;if(g!=null){b=dojo.byId(g)}if(b==null){return false}var a=null;if(c==null){c="url"}a=b.getAttribute(c);if(a==null||a.length<1){return false}if(navigator.userAgent.indexOf("Safari")>0){}else{for(var d=0;d<b.elements.length;d++){var h=b.elements[d].value;var j=b.elements[d].type;if(typeof h=="undefined"){b.elements[d].value=""}if(j==null){b.elements[d].type="unknown"}}}try{dojo.io.bind({url:a,encoding:"utf8",sync:true,formNode:b,mimetype:"text/plain",load:function(i,l,e){k(l)}})}catch(f){return false}return false}function old_async_update_ml(){var b=null;var c=document.getElementById("ml_count");if(c){b=c.getAttribute("url")}if(b){var a=document.forms.summary_records_form;if(a){b+="&update_indicators=true"}debug_alert("async_update_ml sending URL "+b);dojo.io.bind({url:b,encoding:"utf8",load:function(e,f,d){handle_ml_data(f)},mimetype:"text/plain"})}}function simpleDataHandlerAction(a,b){if(b==null){b=function(c){document.write(c)}}if(a){dojo.io.bind({url:a,encoding:"utf8",load:function(d,e,c){b(e)},mimetype:"text/plain"})}}function subjectDataHandlerAction(a,b){if(b==null){b=function(c){document.write(c)}}if(a){dojo.io.bind({url:a,encoding:"utf8",load:function(d,e,c){b(e)},mimetype:"text/plain"})}}function chem_fullrec_navigation(a,b){if(a){dojo.io.bind({url:a,load:function(d,e,c){chem_fullrec_data_handler(e,b)},mimetype:"text/plain"})}}function saveFormElements(d){if(d==null){return false}var b=dojo.byId(d);if(b==null){return false}var a=null;a=b.getAttribute("auto_save_url");if(a==null){return false}try{dojo.io.bind({url:a,encoding:"utf8",sync:false,formNode:b,mimetype:"text/plain"})}catch(c){return false}return false}function addTitles(d,b,a,c){if($(b).is(":visible")){$(b).hide();$(a).attr("src",c+"/expand.gif")}else{$(b).load(d,function(f,e,g){if(e=="error"){location.reload()}else{$(b).show();$(a).attr("src",c+"/collapse.gif")}})}}function addResearchAreas(d,b,a,c){if($(b).is(":visible")){$(b).hide();$(a).attr("src",c+"/expand1.gif")}else{$.post(d,$("#expandDomain").serialize(),function(f,e,g){if(e=="error"){location.reload()}else{$(b).html(f);$(b).show();$(a).attr("src",c+"/collapse1.gif")}})}}function isValidEmail(a){var c=/^(([a-zA-Z0-9])(([a-zA-Z0-9])*(['\._-])?([a-zA-Z0-9]))*@(([a-zA-Z0-9\-])+(\.))+([a-zA-Z]{2,4})+( )*([,;])?( )*)+$/;a=$.trim(a);var b=new String(a);if(b.match(c)){return true}return false}function checkSaveFields(){var a=true;var b=$('input:text[name="email_address"]').val();if(!isValidEmail(b)){$("#pctAddErrorEmailDiv").show();return false}$("#pctAddErrorEmailDiv").hide();return a}function pct_overlay_close(){$("#pct_overlay").dialog("close")}function pct_confirmation_overlay_close(){$("#pct_confirmation_overlay").dialog("close")}function mlFirstUse_close(){$("#mlFirstUse").dialog("close")}function mlOpen_close(){$("#mlOpen").dialog("close")}function pct_error_overlay_close(){$("#pct_error_overlay").dialog("close")}function getPCTconfirmation(a){if(checkSaveFields()){$("#createCitAlert").hide();$("#createAlertImageDisabled").show();$.ajax({type:"POST",url:a,data:{SID:$("#SID").val(),email_address:$("#emailaddress").val(),email_format:$("#emailformat").val(),alert_status:$("#alertstatus").val(),overlay:"yes"},success:function(e){var b=e.Status;if(b=="Success"||e.errorMessage=="DUPLICATE.SEARCH.NAME"){$("#pct_overlay").dialog({close:function(){$("#createCitAlert").show();$("#createAlertImageDisabled").hide()}});pct_overlay_close();$("#rss_feed #rssURL").attr("href","javascript:openWindow('"+e.rss_url+"','_WOK_RSS_')");$("#pct_confirmation_overlay").dialog("open")}else{if(e.errorMessage=="OVER.MAX.GROUP.ALERTS.ALLOWED"){var c=$("#overMaxGroupAlertsAllowedMessage").val();alert(c);pct_overlay_close()}else{if(e.errorMessage=="OVER.MAX.USER.ALERTS.ALLOWED"){var d=$("#overMaxUserAlertsAllowedMessage").val();alert(d);pct_overlay_close()}else{$("#errorMessagePct").show();$("#pctCreateMessage").hide()}}}$("#createCitAlert").show();$("#createAlertImageDisabled").hide()},error:function(b){$("#errorMessagePct").show();$("#createCitAlert").show();$("#createAlertImageDisabled").hide();$("#pctCreateMessage").hide()}})}}function modifyPCTOverlayClose(a){$("#pct_overlay").dialog({close:function(){$(location).attr("href",a)}});$("#pct_confirmation_overlay").dialog({close:function(){$(location).attr("href",a)}})};

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.