[MOBY-guts] biomoby commit
Eddie Kawas
kawas at dev.open-bio.org
Wed Dec 5 22:07:10 UTC 2007
kawas
Wed Dec 5 17:07:09 EST 2007
Update of /home/repository/moby/moby-live/Perl/scripts
In directory dev.open-bio.org:/tmp/cvs-serv23193/Perl/scripts
Modified Files:
AgentRDFValidator
Log Message:
fixed an ie7 bug that occurred when using the form on multiple pages
added code to disable the 'call agent' button while the agent is running
cleaned up the formatting
verified that the code works with firefox 2, opera 9.5 and ie7
moby-live/Perl/scripts AgentRDFValidator,1.3,1.4
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/scripts/AgentRDFValidator,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Perl/scripts/AgentRDFValidator 2007/12/04 18:03:16 1.3
+++ /home/repository/moby/moby-live/Perl/scripts/AgentRDFValidator 2007/12/05 22:07:09 1.4
@@ -185,21 +185,24 @@
if (value && value.replace(/ /g, "") != "") {
document.getElementById('output_div').style.visibility = 'visible';
// call agent via ajax and insert text here
- call_agent(location.href + "?url=" + value)
+ call_agent(location.href + "?url=" + value, value)
}else{
alert('please enter a valid url!')
}
return false;
}
var request = null;
-function call_agent(url){
+function call_agent(url, signatureURL){
if (!request) {
request = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("MSXML2.XMLHTTP.3.0");
} else {
request.abort();
request = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("MSXML2.XMLHTTP.3.0");
}
- modular_waiting(true,"Please wait while the agent processes your url ...");
+ if (document.getElementById("__submit__")) {
+ document.getElementById("__submit__").disabled = true;
+ }
+ modular_waiting(true,"Please wait while the agent processes your url ...<br/>" + signatureURL);
request.open("GET", url, true);
request.setRequestHeader("Content-Type", "text/plain");
@@ -208,20 +211,40 @@
if (request.responseText){
// update the div 'output'
if (document.getElementById("output").innerHTML) {
- document.getElementById('description_span').innerHTML = 'Results'
- document.getElementById("output").innerHTML = request.responseText;
- } else if (document.getElementById("output").textContent != null) {
- document.getElementById('description_span').textContent = 'Results'
- document.getElementById('output').textContent = request.responseText
- } else {
- document.getElementById('description_span').outerText = 'Results'
- var node = document.createElement( "pre" );
- node.innerText = request.responseText;
- document.getElementById('output').appendChild( node );
- }
+ // clear the old information
+ document.getElementById("output").innerHTML = "";
+ if (document.getElementById("description_span")) {
+ document.getElementById("description_span").innerHTML = 'Results for: ' + signatureURL + ''
+ }
+ var node = document.createElement( "pre" );
+ node.innerText = request.responseText;
+ document.getElementById('output').appendChild( node );
+ } else if (document.getElementById("output").textContent != null) {
+ // opera, firefox
+ if (document.getElementById("description_span")) {
+ document.getElementById('description_span').textContent = 'Results for: ' + signatureURL
+ }
+ document.getElementById('output').textContent = request.responseText
+ } else {
+ // ie7
+ if (document.getElementById("description_span")) {
+ document.getElementById('description_span').outerText = 'Results for: ' + signatureURL
+ }
+ var node = document.createElement( "pre" );
+ node.innerText = request.responseText;
+ document.getElementById('output').appendChild( node );
+ }
+ }
+ if (document.getElementById("__submit__")) {
+ document.getElementById("__submit__").disabled = false;
}
- modular_waiting(false)
- } else if (request.readyState == 4 && request.status != 200) { modular_waiting(false) }
+ modular_waiting(false)
+ } else if (request.readyState == 4 && request.status != 200) {
+ modular_waiting(false)
+ if (document.getElementById("__submit__")) {
+ document.getElementById("__submit__").disabled = false;
+ }
+ }
};
request.send(null);
}
@@ -243,7 +266,7 @@
Enter your URL to an RDF here:
<input name="url" tabindex="1" size="70" type="text" />
<br />
- <input tabindex="2" name=".submit" onclick="testAgent(document.url.url.value)" type="button" value="Call the agent" />
+ <input tabindex="2" name=".submit" id="__submit__" onclick="testAgent(document.url.url.value)" type="button" value="Call the agent" />
<div></div>
</form>
More information about the MOBY-guts
mailing list