clearwing

changeset 199:7d1e74ec3235 1.2.3-genius

Fixing Redmine issue #1024
author Stelios <stv@roe.ac.uk>
date Thu Feb 02 16:42:11 2017 +0000 (2017-02-02)
parents f57cca168f00
children 3d6b7d8f3333
files src/static/js/adql_syntax/tap-autocomplete.js src/static/js/adql_syntax/tap-autocomplete.min.js src/static/js/adql_syntax/tap-hint.js src/static/js/adql_syntax/tap-hint.min.js
line diff
     1.1 --- a/src/static/js/adql_syntax/tap-autocomplete.js	Mon Jan 23 12:28:56 2017 +0000
     1.2 +++ b/src/static/js/adql_syntax/tap-autocomplete.js	Thu Feb 02 16:42:11 2017 +0000
     1.3 @@ -311,7 +311,7 @@
     1.4  		},
     1.5  		success: function(data) {
     1.6  
     1.7 -			if (data != "") {
     1.8 +			if (data) {
     1.9  				push_metadata_content_html(data);
    1.10  			}
    1.11  			if (_this.autocomplete_info)
    1.12 @@ -430,7 +430,7 @@
    1.13  		},
    1.14  		success: function(data) {
    1.15  
    1.16 -			if (data != "") {
    1.17 +			if (data) {
    1.18  				push_metadata_json(data);
    1.19  			}
    1.20  			if (_this.autocomplete_info)
     2.1 --- a/src/static/js/adql_syntax/tap-autocomplete.min.js	Mon Jan 23 12:28:56 2017 +0000
     2.2 +++ b/src/static/js/adql_syntax/tap-autocomplete.min.js	Thu Feb 02 16:42:11 2017 +0000
     2.3 @@ -1,1 +1,1 @@
     2.4 -var TapAutocomplete=function(a){return this.istap=!1,this.servicemode="TAP",a.textfieldid&&(this.textfieldid=a.textfieldid),a.textAreaElement?this.textAreaElement=a.textAreaElement:this.textAreaElement=document.getElementById(a.textfieldid),a.web_service_path&&(this.web_service_path=a.web_service_path),a.html_resource&&(this.html_resource=a.html_resource),a.tap_resource&&(this.tap_resource=a.tap_resource),a.autocomplete_info_id&&(this.autocomplete_info=a.autocomplete_info_id),a.autocomplete_loader_id&&(this.autocomplete_loader=a.autocomplete_loader_id),a.servicemode&&(this.servicemode=a.servicemode),a.initial_catalogues?this.initial_catalogues=a.initial_catalogues:this.initial_catalogues=[],a.jsontree&&(this.jsontree=a.jsontree),"tap"==this.servicemode.toLowerCase()&&(this.istap=!0),null==this.editor&&!jQuery(".CodeMirror").length>0&&(CodeMirror.commands.autocomplete=function(b){CodeMirror.tapHint(b,CodeMirror.adqlHint,{webServicePath:a.web_service_path,tapResource:a.tap_resource,servicemode:a.servicemode.toLowerCase(),autocompleteLoader:a.autocomplete_loader_id,autocompleteInfo:a.autocomplete_info_id,jsontree:a.jsontree})},this.editor=CodeMirror.fromTextArea(this.textAreaElement,{mode:"text/x-adql",lineNumbers:!0,lineWrapping:!0,matchBrackets:!0,indentWithTabs:!0,tabSize:4,indentUnit:4,extraKeys:{"Ctrl-Space":"autocomplete"}}),this.editor.setSize("100%","100%")),"undefined"==typeof this.editor.availableTags&&(this.editor.availableTags=["SELECT","FROM","ORDER BY","WHERE","TOP","IN","AND","OR","WITH","DESC","ASC","JOIN","AS","HAVING","ABS","GROUP","BY","INNER","OUTER","CROSS","LEFT","RIGHT","FULL","ON","USING","MIN","MAX","COUNT","DISTINCT","ALL","LIKE","ACOS","ASIN","ATAN","ATAN2","COS","SIN","TAN","COT","IS","NOT","NULL","NATURAL","EXISTS","BETWEEN","AREA","BOX","CENTROID","CIRCLE","CONTAINS","COORD1","COORD2","COORDSYS","DISTANCE","INTERSECTS","POINT","POLYGON","REGION"]),"tap"==a.servicemode.toLowerCase()?this.load_metadata_for_autocomplete(this.initial_catalogues):"vosi"==a.servicemode.toLowerCase()?this.load_metadata_from_html():"jsontree"==a.servicemode.toLowerCase()?this.load_metadata_from_jsontree(this.initial_catalogues):"gwt"==a.servicemode.toLowerCase()&&this.load_metadata_from_gwt(this.initial_catalogues),this};TapAutocomplete.prototype.push_metadata_content_html=function(a){var b=document.createElement("div");b.innerHTML=a;for(var c=b.getElementsByClassName("heading"),d=b.getElementsByClassName("expand"),e=0;e<c.length;e++)for(var f=jQuery.trim(jQuery(c[e]).justtext()),g=f.split("."),h=0;h<g.length;h++)this.editor.availableTags.push(g[h]);for(var e=0;e<d.length;e++)contains(this.editor.availableTags,d[e].innerHTML)||this.editor.availableTags.push(d[e].innerHTML)},TapAutocomplete.prototype.push_metadata_json=function(a){if(a.length>0)for(var b=0;b<a.length;b++)for(var c=jQuery.trim(a[b]),d=c.split("."),e=0;e<d.length;e++)this.editor.availableTags.push(d[e])},TapAutocomplete.prototype.run=function(){"tap"==this.servicemode.toLowerCase()?this.load_metadata_for_autocomplete():"vosi"==this.servicemode.toLowerCase()?this.load_metadata_from_html():"jsontree"==this.servicemode.toLowerCase()?this.load_metadata_from_jsontree():"gwt"==this.servicemode.toLowerCase()&&this.load_metadata_from_gwt(this.initial_catalogues)},TapAutocomplete.prototype.refresh=function(){null!=this.editor&&jQuery(".CodeMirror").length>0&&null!=this.servicemode&&(CodeMirror.commands.autocomplete=function(a){CodeMirror.tapHint(a,CodeMirror.adqlHint,{webServicePath:this.web_service_path,tapResource:this.tap_resource,servicemode:this.servicemode.toLowerCase(),jsontree:this.jsontree,autocompleteInfo:this.autocomplete_info,autocompleteLoader:this.autocomplete_loader})},"tap"==this.servicemode.toLowerCase()?this.load_metadata_for_autocomplete(this.initial_catalogues):"vosi"==this.servicemode.toLowerCase()?this.load_metadata_from_html():"jsontree"==this.servicemode.toLowerCase()?this.load_metadata_from_jsontree(this.initial_catalogues):"gwt"==this.servicemode.toLowerCase()&&this.load_metadata_from_gwt(this.initial_catalogues))},TapAutocomplete.prototype.load_catalogue_tables=function(a){"tap"==this.servicemode.toLowerCase()?this.load_metadata_for_autocomplete(a):"vosi"==this.servicemode.toLowerCase()?this.load_metadata_from_html():"jsontree"==params.servicemode.toLowerCase()?this.load_metadata_from_jsontree():"gwt"==params.servicemode.toLowerCase()&&this.load_metadata_from_gwt(this.initial_catalogues)},TapAutocomplete.prototype.load_metadata_from_html=function(){function a(a,b){for(var c=a.length;c--;)if(a[c]===b)return!0;return!1}function b(b){_this.editor.availableTags||(_this.editor.availableTags=[]);var c=document.createElement("div");c.innerHTML=b;for(var d=c.getElementsByClassName("heading"),e=c.getElementsByClassName("expand"),f=0;f<d.length;f++)for(var g=jQuery.trim(jQuery(d[f]).text()),h=g.split("."),i=0;i<h.length;i++)_this.editor.availableTags.push(h[i]);for(var f=0;f<e.length;f++)a(_this.editor.availableTags,e[f].innerHTML)||_this.editor.availableTags.push(e[f].innerHTML)}_this=this,_this.autocomplete_info&&jQuery("#"+_this.autocomplete_info).html("Loading catalogue metadata keywords for auto-complete"),_this.autocomplete_loader&&jQuery("#"+_this.autocomplete_loader).show(),jQuery.ajax({type:"POST",async:!1,dataType:"json",data:{resource:_this.html_resource,mode:"vosi"},url:_this.web_service_path,timeout:1e6,error:function(){_this.autocomplete_info&&jQuery("#"+_this.autocomplete_info).html("CTRL + Space to activate auto-complete"),_this.autocomplete_loader&&jQuery("#"+_this.autocomplete_loader).hide()},success:function(a){""!=a&&b(a),_this.autocomplete_info&&jQuery("#"+_this.autocomplete_info).html("CTRL + Space to activate auto-complete"),_this.autocomplete_loader&&jQuery("#"+_this.autocomplete_loader).hide()}})},TapAutocomplete.prototype.load_metadata_from_jsontree=function(a){function b(a,b){for(var c=a.length;c--;)if(a[c]===b)return!0;return!1}function c(c){if(c.length>0)for(var d=0;d<c.length;d++){if(a&&b(a,c[d].catalogue)){var e=c[d].tables.map(function(a){return a.name});_this.editor.availableTags=_this.editor.availableTags.concat(e)}_this.editor.availableTags.push(c[d].catalogue)}}_this=this,_this.autocomplete_info&&jQuery("#"+_this.autocomplete_info).html("Loading catalogue metadata keywords for auto-complete"),_this.autocomplete_loader&&jQuery("#"+_this.autocomplete_loader).show(),c(_this.jsontree)},TapAutocomplete.prototype.load_metadata_for_autocomplete=function(a){function b(a){if(a.length>0)for(var b=0;b<a.length;b++)for(var c=jQuery.trim(a[b]),d=c.split("."),e=0;e<d.length;e++)_this.editor.availableTags.push(d[e])}_this=this,a="undefined"==typeof a?[]:a,_this.autocomplete_info&&jQuery("#"+_this.autocomplete_info).html("Loading catalogue metadata keywords for auto-complete"),_this.autocomplete_loader&&jQuery("#"+_this.autocomplete_loader).show(),a=JSON.stringify(a),jQuery.ajax({type:"POST",dataType:"json",async:!1,data:{resource:_this.tap_resource,optional_catalogues:a,mode:"tap"},url:_this.web_service_path,timeout:1e6,error:function(a){_this.autocomplete_info&&jQuery("#"+_this.autocomplete_info).html("CTRL + Space to activate auto-complete"),_this.autocomplete_loader&&jQuery("#"+_this.autocomplete_loader).hide()},success:function(a){""!=a&&b(a),_this.autocomplete_info&&jQuery("#"+_this.autocomplete_info).html("CTRL + Space to activate auto-complete"),_this.autocomplete_loader&&jQuery("#"+_this.autocomplete_loader).hide()}})},TapAutocomplete.prototype.load_metadata_from_gwt=function(a){function b(a){if(a.length>0)for(var b=0;b<a.length;b++)for(var c=jQuery.trim(a[b]),d=c.split("."),e=0;e<d.length;e++)_this.editor.availableTags.push(d[e])}_this=this,a="undefined"==typeof a?[]:a,_this.autocomplete_info&&jQuery("#"+_this.autocomplete_info).html("Loading catalogue metadata keywords for auto-complete"),_this.autocomplete_loader&&jQuery("#"+_this.autocomplete_loader).show();var c=window.gacsGetByKeyword("");c&&b(c)},TapAutocomplete.prototype.focus=function(){null!=this.editor&&jQuery(".CodeMirror").length>0&&this.editor.focus()},TapAutocomplete.prototype.setValue=function(){null!=this.editor&&jQuery(".CodeMirror").length>0&&this.editor.setValue()},TapAutocomplete.prototype.getValue=function(){null!=this.editor&&jQuery(".CodeMirror").length>0&&this.editor.getValue()},TapAutocomplete.prototype.updateData=function(a){null!=this.editor&&jQuery(".CodeMirror").length>0};
     2.5 \ No newline at end of file
     2.6 +var TapAutocomplete=function(a){return this.istap=!1,this.servicemode="TAP",a.textfieldid&&(this.textfieldid=a.textfieldid),a.textAreaElement?this.textAreaElement=a.textAreaElement:this.textAreaElement=document.getElementById(a.textfieldid),a.web_service_path&&(this.web_service_path=a.web_service_path),a.html_resource&&(this.html_resource=a.html_resource),a.tap_resource&&(this.tap_resource=a.tap_resource),a.autocomplete_info_id&&(this.autocomplete_info=a.autocomplete_info_id),a.autocomplete_loader_id&&(this.autocomplete_loader=a.autocomplete_loader_id),a.servicemode&&(this.servicemode=a.servicemode),a.initial_catalogues?this.initial_catalogues=a.initial_catalogues:this.initial_catalogues=[],a.jsontree&&(this.jsontree=a.jsontree),"tap"==this.servicemode.toLowerCase()&&(this.istap=!0),null==this.editor&&!jQuery(".CodeMirror").length>0&&(CodeMirror.commands.autocomplete=function(b){CodeMirror.tapHint(b,CodeMirror.adqlHint,{webServicePath:a.web_service_path,tapResource:a.tap_resource,servicemode:a.servicemode.toLowerCase(),autocompleteLoader:a.autocomplete_loader_id,autocompleteInfo:a.autocomplete_info_id,jsontree:a.jsontree})},this.editor=CodeMirror.fromTextArea(this.textAreaElement,{mode:"text/x-adql",lineNumbers:!0,lineWrapping:!0,matchBrackets:!0,indentWithTabs:!0,tabSize:4,indentUnit:4,extraKeys:{"Ctrl-Space":"autocomplete"}})),"undefined"==typeof this.editor.availableTags&&(this.editor.availableTags=["SELECT","FROM","ORDER BY","WHERE","TOP","IN","AND","OR","WITH","DESC","ASC","JOIN","AS","HAVING","ABS","GROUP","BY","INNER","OUTER","CROSS","LEFT","RIGHT","FULL","ON","USING","MIN","MAX","COUNT","DISTINCT","ALL","LIKE","ACOS","ASIN","ATAN","ATAN2","COS","SIN","TAN","COT","IS","NOT","NULL","NATURAL","EXISTS","BETWEEN","AREA","BOX","CENTROID","CIRCLE","CONTAINS","COORD1","COORD2","COORDSYS","DISTANCE","INTERSECTS","POINT","POLYGON","REGION"]),"tap"==a.servicemode.toLowerCase()?this.load_metadata_for_autocomplete(this.initial_catalogues):"vosi"==a.servicemode.toLowerCase()?this.load_metadata_from_html():"jsontree"==a.servicemode.toLowerCase()?this.load_metadata_from_jsontree(this.initial_catalogues):"gwt"==a.servicemode.toLowerCase()&&this.load_metadata_from_gwt(this.initial_catalogues),this};TapAutocomplete.prototype.push_metadata_content_html=function(a){var b=document.createElement("div");b.innerHTML=a;for(var c=b.getElementsByClassName("heading"),d=b.getElementsByClassName("expand"),e=0;e<c.length;e++)for(var f=jQuery.trim(jQuery(c[e]).justtext()),g=f.split("."),h=0;h<g.length;h++)this.editor.availableTags.push(g[h]);for(var e=0;e<d.length;e++)contains(this.editor.availableTags,d[e].innerHTML)||this.editor.availableTags.push(d[e].innerHTML)},TapAutocomplete.prototype.push_metadata_json=function(a){if(a.length>0)for(var b=0;b<a.length;b++)for(var c=jQuery.trim(a[b]),d=c.split("."),e=0;e<d.length;e++)this.editor.availableTags.push(d[e])},TapAutocomplete.prototype.run=function(){"tap"==this.servicemode.toLowerCase()?this.load_metadata_for_autocomplete():"vosi"==this.servicemode.toLowerCase()?this.load_metadata_from_html():"jsontree"==this.servicemode.toLowerCase()?this.load_metadata_from_jsontree():"gwt"==this.servicemode.toLowerCase()&&this.load_metadata_from_gwt(this.initial_catalogues)},TapAutocomplete.prototype.refresh=function(){null!=this.editor&&jQuery(".CodeMirror").length>0&&null!=this.servicemode&&(CodeMirror.commands.autocomplete=function(a){CodeMirror.tapHint(a,CodeMirror.adqlHint,{webServicePath:this.web_service_path,tapResource:this.tap_resource,servicemode:this.servicemode.toLowerCase(),jsontree:this.jsontree,autocompleteInfo:this.autocomplete_info,autocompleteLoader:this.autocomplete_loader})},"tap"==this.servicemode.toLowerCase()?this.load_metadata_for_autocomplete(this.initial_catalogues):"vosi"==this.servicemode.toLowerCase()?this.load_metadata_from_html():"jsontree"==this.servicemode.toLowerCase()?this.load_metadata_from_jsontree(this.initial_catalogues):"gwt"==this.servicemode.toLowerCase()&&this.load_metadata_from_gwt(this.initial_catalogues))},TapAutocomplete.prototype.load_catalogue_tables=function(a){"tap"==this.servicemode.toLowerCase()?this.load_metadata_for_autocomplete(a):"vosi"==this.servicemode.toLowerCase()?this.load_metadata_from_html():"jsontree"==params.servicemode.toLowerCase()?this.load_metadata_from_jsontree():"gwt"==params.servicemode.toLowerCase()&&this.load_metadata_from_gwt(this.initial_catalogues)},TapAutocomplete.prototype.load_metadata_from_html=function(){function a(a,b){for(var c=a.length;c--;)if(a[c]===b)return!0;return!1}function b(b){_this.editor.availableTags||(_this.editor.availableTags=[]);var c=document.createElement("div");c.innerHTML=b;for(var d=c.getElementsByClassName("heading"),e=c.getElementsByClassName("expand"),f=0;f<d.length;f++)for(var g=jQuery.trim(jQuery(d[f]).text()),h=g.split("."),i=0;i<h.length;i++)_this.editor.availableTags.push(h[i]);for(var f=0;f<e.length;f++)a(_this.editor.availableTags,e[f].innerHTML)||_this.editor.availableTags.push(e[f].innerHTML)}_this=this,_this.autocomplete_info&&jQuery("#"+_this.autocomplete_info).html("Loading catalogue metadata keywords for auto-complete"),_this.autocomplete_loader&&jQuery("#"+_this.autocomplete_loader).show(),jQuery.ajax({type:"POST",async:!1,dataType:"json",data:{resource:_this.html_resource,mode:"vosi"},url:_this.web_service_path,timeout:1e6,error:function(){_this.autocomplete_info&&jQuery("#"+_this.autocomplete_info).html("CTRL + Space to activate auto-complete"),_this.autocomplete_loader&&jQuery("#"+_this.autocomplete_loader).hide()},success:function(a){a&&b(a),_this.autocomplete_info&&jQuery("#"+_this.autocomplete_info).html("CTRL + Space to activate auto-complete"),_this.autocomplete_loader&&jQuery("#"+_this.autocomplete_loader).hide()}})},TapAutocomplete.prototype.load_metadata_from_jsontree=function(a){function b(a,b){for(var c=a.length;c--;)if(a[c]===b)return!0;return!1}function c(c){if(c.length>0)for(var d=0;d<c.length;d++){if(a&&b(a,c[d].catalogue)){var e=c[d].tables.map(function(a){return a.name});_this.editor.availableTags=_this.editor.availableTags.concat(e)}_this.editor.availableTags.push(c[d].catalogue)}}_this=this,_this.autocomplete_info&&jQuery("#"+_this.autocomplete_info).html("Loading catalogue metadata keywords for auto-complete"),_this.autocomplete_loader&&jQuery("#"+_this.autocomplete_loader).show(),c(_this.jsontree)},TapAutocomplete.prototype.load_metadata_for_autocomplete=function(a){function b(a){if(a.length>0)for(var b=0;b<a.length;b++)for(var c=jQuery.trim(a[b]),d=c.split("."),e=0;e<d.length;e++)_this.editor.availableTags.push(d[e])}_this=this,a="undefined"==typeof a?[]:a,_this.autocomplete_info&&jQuery("#"+_this.autocomplete_info).html("Loading catalogue metadata keywords for auto-complete"),_this.autocomplete_loader&&jQuery("#"+_this.autocomplete_loader).show(),a=JSON.stringify(a),jQuery.ajax({type:"POST",dataType:"json",async:!1,data:{resource:_this.tap_resource,optional_catalogues:a,mode:"tap"},url:_this.web_service_path,timeout:1e6,error:function(a){_this.autocomplete_info&&jQuery("#"+_this.autocomplete_info).html("CTRL + Space to activate auto-complete"),_this.autocomplete_loader&&jQuery("#"+_this.autocomplete_loader).hide()},success:function(a){a&&b(a),_this.autocomplete_info&&jQuery("#"+_this.autocomplete_info).html("CTRL + Space to activate auto-complete"),_this.autocomplete_loader&&jQuery("#"+_this.autocomplete_loader).hide()}})},TapAutocomplete.prototype.load_metadata_from_gwt=function(a){function b(a){if(a.length>0)for(var b=0;b<a.length;b++)for(var c=jQuery.trim(a[b]),d=c.split("."),e=0;e<d.length;e++)_this.editor.availableTags.push(d[e])}_this=this,a="undefined"==typeof a?[]:a,_this.autocomplete_info&&jQuery("#"+_this.autocomplete_info).html("Loading catalogue metadata keywords for auto-complete"),_this.autocomplete_loader&&jQuery("#"+_this.autocomplete_loader).show();var c=window.gacsGetByKeyword("");c&&b(c)},TapAutocomplete.prototype.focus=function(){null!=this.editor&&jQuery(".CodeMirror").length>0&&this.editor.focus()},TapAutocomplete.prototype.setValue=function(){null!=this.editor&&jQuery(".CodeMirror").length>0&&this.editor.setValue()},TapAutocomplete.prototype.getValue=function(){null!=this.editor&&jQuery(".CodeMirror").length>0&&this.editor.getValue()},TapAutocomplete.prototype.updateData=function(a){null!=this.editor&&jQuery(".CodeMirror").length>0};
     2.7 \ No newline at end of file
     3.1 --- a/src/static/js/adql_syntax/tap-hint.js	Mon Jan 23 12:28:56 2017 +0000
     3.2 +++ b/src/static/js/adql_syntax/tap-hint.js	Thu Feb 02 16:42:11 2017 +0000
     3.3 @@ -411,7 +411,7 @@
     3.4          if (editor.autocompleteLoader) jQuery("#" + editor.autocompleteLoader).hide();
     3.5        },
     3.6        success: function(data) {
     3.7 -        if (data != "") {
     3.8 +        if (data) {
     3.9            pushMetadataJson(data, tags, parentText, keyword);
    3.10          }
    3.11  
     4.1 --- a/src/static/js/adql_syntax/tap-hint.min.js	Mon Jan 23 12:28:56 2017 +0000
     4.2 +++ b/src/static/js/adql_syntax/tap-hint.min.js	Thu Feb 02 16:42:11 2017 +0000
     4.3 @@ -1,1 +1,1 @@
     4.4 -!function(){function a(a,b){for(var c=0,d=a.length;c<d;++c)b(a[c])}function b(a,b){if(!Array.prototype.indexOf){for(var c=a.length;c--;)if(a[c].toUpperCase()===b.toUpperCase())return!0;return!1}var d=a.map(function(a){return a.toLowerCase()});return d.indexOf(b.toLowerCase())!=-1}function c(c,d,e,f,g,h){function i(a){0!=a.toLowerCase().indexOf(k.toLowerCase())||b(j,a)||j.push(a)}h="undefined"==typeof h?"":h;var j=[],k=c.string;if(d){for(var l=d.pop(),m=!1,n=0;n<g.jsontree.length&&($.each(g.jsontree[n],function(a,b){if("catalogue"==a.toLowerCase()){if(l.string==b){if(h){var c=g.jsontree[n].tables.filter(function(a){return 0==a.name.indexOf(h)});j=j.concat(c.map(function(a){return a.name}))}else j=j.concat(g.jsontree[n].tables.map(function(a){return a.name}));return m=!0,!1}}else if("tables"==a.toLowerCase())for(var d=0;d<g.jsontree[n].tables.length;d++)if(l.string==g.jsontree[n].tables[d].name)if(h){var c=g.jsontree[n].tables[d].columns.filter(function(a){return 0==a.indexOf(h)});j=j.concat(c)}else j=j.concat(g.jsontree[n].tables[d].columns)}),!m);n++);return j.sort()}return a(e,i),j.sort()}function d(c,d,e,f,h,i){function j(a){0!=a.toLowerCase().indexOf(l.toLowerCase())||b(k,a)||k.push(a)}i="undefined"==typeof i?"":i;var k=[],l=c.string;if(d){var m=d.pop();return g(m.string,l,k,h,i),k.sort()}return a(e,j),k.sort()}function e(c,d,e,f,g,i){function j(a){0!=a.toLowerCase().indexOf(l.toLowerCase())||b(k,a)||k.push(a)}i="undefined"==typeof i?"":i;var k=[],l=c.string;if(d){d.pop();return h(i,l,k,g,i),k.sort()}return h(i,l,k,g,i),a(e,j),k.sort()}function f(a,c,d,e){if(a.length>0)for(var f=0;f<a.length;f++)for(var g=jQuery.trim(a[f]),h=g.split("."),i=0;i<h.length;i++)0!=h[i].toLowerCase().indexOf(d.toLowerCase())||b(c,h[i])||h[i].toLowerCase()==e.toLowerCase()||c.push(h[i])}function g(a,b,c,d,e){e="undefined"==typeof e?"":e,d.autocompleteInfo&&jQuery("#"+d.autocompleteInfo).html("Loading catalogue metadata keywords for auto-complete"),d.autocompleteLoader&&jQuery("#"+d.autocompleteLoader).show(),jQuery.ajax({type:"POST",dataType:"json",async:!1,data:{keyword:a,optional_keyword:e,mode:"tap",resource:d.tapResource},url:d.webServicePath,timeout:1e6,error:function(){d.autocompleteInfo&&jQuery("#"+d.autocompleteInfo).html("CTRL + Space to activate auto-complete"),d.autocompleteLoader&&jQuery("#"+d.autocompleteLoader).hide()},success:function(e){""!=e&&f(e,c,b,a),d.autocompleteInfo&&jQuery("#"+d.autocompleteInfo).html("CTRL + Space to activate auto-complete"),d.autocompleteLoader&&jQuery("#"+d.autocompleteLoader).hide()}})}function h(a,b,c,d,e){if(e="undefined"==typeof e?"":e,d.autocompleteInfo&&jQuery("#"+d.autocompleteInfo).html("Loading catalogue metadata keywords for auto-complete"),d.autocompleteLoader&&jQuery("#"+d.autocompleteLoader).show(),e){var g=window.gacsGetByKeyword(e);g&&f(g,c,b,"")}else{var g=window.gacsGetByKeyword("");g&&f(g,c,b,"")}}function i(c,d,e,f){function g(a){0!=a.toLowerCase().indexOf(j.toLowerCase())||b(i,a)||i.push(a)}function h(b){"string"==typeof b?a(editor.availableTags,g):b instanceof Array?a(editor.availableTags,g):b instanceof Function&&a(editor.availableTags,g);for(var c in b)g(c)}var i=[],j=c.string;if(d){var k,l=d.pop();for(0===l.type.indexOf("variable")?(f&&f.additionalContext&&(k=f.additionalContext[l.string]),k=k||window[l.string]):"string"==l.type?k="":"atom"==l.type?k=1:"function"==l.type&&(null==window.jQuery||"$"!=l.string&&"jQuery"!=l.string||"function"!=typeof window.jQuery?null!=window._&&"_"==l.string&&"function"==typeof window._&&(k=window._()):k=window.jQuery());null!=k&&d.length;)k=k[d.pop().string];null!=k&&h(k)}else a(e,g);return i.sort()}function j(a){var b=a.doc.modeOption;return"sql"===b&&(b="text/x-sql"),CodeMirror.resolveMode(b).keywords}function k(a){return"string"==typeof a?a:a.text}function l(a,b){if(!a.slice)return a[b];for(var c=a.length-1;c>=0;c--)if(k(a[c])==b)return a[c]}function m(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function n(a,b){var c=a.length,d=k(b).substr(0,c);return a.toUpperCase()===d.toUpperCase()}function o(a,b,c,d){for(var e in c)c.hasOwnProperty(e)&&(c.slice&&(e=c[e]),n(b,e)&&a.push(d(e)))}function p(a){return"."==a.charAt(0)&&(a=a.substr(1)),a.replace(/`/g,"")}function q(a){for(var b=k(a).split("."),c=0;c<b.length;c++)b[c]="`"+b[c]+"`";var d=b.join(".");return"string"==typeof a?d:(a=m(a),a.text=d,a)}function r(a,b,c,d){for(var e=!1,f=[],g=b.start,h=!0;h;)h="."==b.string.charAt(0),e=e||"`"==b.string.charAt(0),g=b.start,f.unshift(p(b.string)),b=d.getTokenAt(A(a.line,b.start)),"."==b.string&&(h=!0,b=d.getTokenAt(A(a.line,b.start)));var i=f.join(".");o(c,i,y,function(a){return e?q(a):a}),o(c,i,z,function(a){return e?q(a):a}),i=f.pop();var j=f.join("."),k=!1;if(!l(y,j)){var m=j;j=v(j,d),j!==m&&(k=!0)}return j}function s(a,b){if(a)for(var c=/[,;]/g,d=a.split(" "),e=0;e<d.length;e++)b(d[e]?d[e].replace(c,""):"")}function t(a){return a.line+a.ch/Math.pow(10,6)}function u(a){return A(Math.floor(a),+a.toString().split(".").pop())}function v(a,b){for(var c=b.doc,d=c.getValue(),e=a.toUpperCase(),f="",g="",h=[],i={start:A(0,0),end:A(b.lastLine(),b.getLineHandle(b.lastLine()).length)},j=d.indexOf(B.QUERY_DIV);j!=-1;)h.push(c.posFromIndex(j)),j=d.indexOf(B.QUERY_DIV,j+1);h.unshift(A(0,0)),h.push(A(b.lastLine(),b.getLineHandle(b.lastLine()).text.length));for(var k=0,l=t(b.getCursor()),m=0;m<h.length;m++){var n=t(h[m]);if(l>k&&l<=n){i={start:u(k),end:u(n)};break}k=n}for(var o,p=c.getRange(i.start,i.end,!1),m=0;m<p.length;m++){var q=p[m];if(s(q,function(a){var b=a.toUpperCase();b===e&&o.toUpperCase()==B.ALIAS_KEYWORD.toUpperCase()&&(g=f),o=a,b!==B.ALIAS_KEYWORD&&(f=a)}),g)break}return g}function w(a,b,c,d){y=d&&d.tables||{};var e=d&&d.defaultTable;z=e&&l(y,e),b=b||j(a),table=null,e&&!z&&(z=v(e,a)),z=z||[],z.columns&&(z=z.columns);var f,g,h,i=a.getCursor(),k=[],m=a.getTokenAt(i);return m.end>i.ch&&(m.end=i.ch,m.string=m.string.slice(0,i.ch-m.start)),m.string.match(/^[.`\w@]\w*$/)?(h=m.string,f=m.start,g=m.end):(f=g=i.ch,h=""),"."!=h.charAt(0)&&"`"!=h.charAt(0)||(table=r(i,m,k,a)),table}function x(a,b,f,g){var h=a.getCursor(),j=f(a,h),k=j,l=null,m=w(a,b,f,g);for(/^[\w$_]*$/.test(j.string)||(j=k={start:h.ch,end:h.ch,string:"",state:j.state,type:"."==j.string?"property":null}),token_start_original=j.start,token_end_original=j.end,line_original=h.line,cur_temp={},cur_temp.line=h.line,cur_temp.ch=j.start,token_temp=f(a,cur_temp),"."==token_temp.string&&(l=j.string,j=k={start:cur_temp.ch,end:cur_temp.ch,string:"",state:token_temp,type:"."==token_temp.string?"property":null});"property"==k.type;){if(k=f(a,{line:h.line,ch:k.start}),"gwt"==a.servicemode.toLowerCase()&&(tableProp=f(a,{line:h.line,ch:k.start}),tempProp=f(a,{line:h.line,ch:tableProp.start}),"."==tempProp.string.trim()?(schemaProp=f(a,{line:h.line,ch:tableProp.start-1}),schemaProp.string&&(l=schemaProp.string+"."+tableProp.string+"."+l),m&&(l=m+"."+l)):l=m?m+"."+l:tableProp.string+"."+l),"."!=k.string)return;if(k=f(a,{line:h.line,ch:k.start}),")"==k.string){var n=1;do switch(k=f(a,{line:h.line,ch:k.start}),k.string){case")":n++;break;case"(":n--}while(n>0);if(k=f(a,{line:h.line,ch:k.start}),0!==k.type.indexOf("variable"))return;k.type="function"}if(!o)var o=[];o.push(k)}return"gwt"==a.servicemode.toLowerCase()&&(l||j.string&&(l=j.string)),"tap"!=a.servicemode.toLowerCase()?"jsontree"==a.servicemode.toLowerCase()?{list:c(j,o,b,g,a,l),from:{line:line_original,ch:token_start_original},to:{line:line_original,ch:token_end_original}}:"gwt"==a.servicemode.toLowerCase()?{list:e(j,o,b,g,a,l),from:{line:line_original,ch:token_start_original},to:{line:line_original,ch:token_end_original}}:{list:i(j,o,b,g),from:{line:line_original,ch:token_start_original},to:{line:line_original,ch:token_end_original}}:{list:d(j,o,b,g,a,l),from:{line:line_original,ch:token_start_original},to:{line:line_original,ch:token_end_original}}}CodeMirror.tapHint=function(a,b,c){function d(f){function g(b){a.replaceRange(b,k.from,k.to)}function h(){s||(s=!0,m.parentNode.removeChild(m))}function i(){g(l[n.selectedIndex]),h(),setTimeout(function(){a.focus()},50)}if(!a.somethingSelected()){var j=a.getTokenAt(a.getCursor());if(!e.closeOnTokenChange||null==f||j.start==f.start&&j.type==f.type){var k=b(a,c);if(k&&k.list.length){var l=k.list;if(e.completeSingle&&1==l.length)return g(l[0]),!0;var m=document.createElement("div");m.className="CodeMirror-completions";var n=m.appendChild(document.createElement("select"));window.opera||(n.multiple=!0);for(var o=0;o<l.length;++o){var p=n.appendChild(document.createElement("option"));p.appendChild(document.createTextNode(l[o]))}n.firstChild.selected=!0,n.size=Math.min(10,l.length);var q=a.cursorCoords(e.alignWithWord?k.from:null);m.style.left=q.left+"px",m.style.top=q.bottom+"px",document.body.appendChild(m);var r=window.innerWidth||Math.max(document.body.offsetWidth,document.documentElement.offsetWidth);r-q.left<n.clientWidth&&(m.style.left=q.left-n.clientWidth+"px"),l.length<=10&&(m.style.width=n.clientWidth-1+"px");var s=!1;return CodeMirror.on(n,"blur",h),CodeMirror.on(n,"keydown",function(b){var c=b.keyCode;13==c?(CodeMirror.e_stop(b),i()):27==c?(CodeMirror.e_stop(b),h(),a.focus()):38==c||40==c||33==c||34==c||CodeMirror.isModifierKey(b)||(h(),a.focus(),a.triggerOnKeyDown(b),e.closeOnBackspace&&8==c||setTimeout(function(){d(j)},50))}),CodeMirror.on(n,"dblclick",i),n.focus(),window.opera&&setTimeout(function(){s||n.focus()},100),!0}}}}var e=(CodeMirror.Pos,{}),f=CodeMirror.tapHint.defaults;c.tapResource&&(a.tapResource=c.tapResource),c.webServicePath&&(a.webServicePath=c.webServicePath),c.autocompleteLoader&&(a.autocompleteLoader=c.autocompleteLoader),c.autocompleteInfo&&(a.autocompleteInfo=c.autocompleteInfo),c.servicemode&&(a.servicemode=c.servicemode),c.jsontree&&(a.jsontree=c.jsontree),c.availableTags?a.availableTags=c.availableTags:a.availableTags||(a.availableTags=["SELECT","FROM","ORDER BY","WHERE","TOP","IN","AND","OR","WITH","DESC","ASC","JOIN","AS","HAVING","ABS","GROUP","BY","INNER","OUTER","CROSS","LEFT","RIGHT","FULL","ON","USING","MIN","MAX","COUNT","DISTINCT","ALL","LIKE","ACOS","ASIN","ATAN","ATAN2","COS","SIN","TAN","COT","IS","NOT","NULL","NATURAL","EXISTS","BETWEEN","AREA","BOX","CENTROID","CIRCLE","CONTAINS","COORD1","COORD2","COORDSYS","DISTANCE","INTERSECTS","POINT","POLYGON","REGION"]);for(var g in f)f.hasOwnProperty(g)&&(e[g]=(c&&c.hasOwnProperty(g)?c:f)[g]);return d()},CodeMirror.tapHint.defaults={closeOnBackspace:!0,closeOnTokenChange:!1,completeSingle:!0,alignWithWord:!0};var y,z,A=CodeMirror.Pos,B={QUERY_DIV:";",ALIAS_KEYWORD:"AS"};CodeMirror.adqlHint=function(a,b){return x(a,a.availableTags,function(a,b){return a.getTokenAt(b)},b)}}();
     4.5 \ No newline at end of file
     4.6 +!function(){function a(a,b){for(var c=0,d=a.length;c<d;++c)b(a[c])}function b(a,b){if(!Array.prototype.indexOf){for(var c=a.length;c--;)if(a[c].toUpperCase()===b.toUpperCase())return!0;return!1}var d=a.map(function(a){return a.toLowerCase()});return d.indexOf(b.toLowerCase())!=-1}function c(c,d,e,f,g,h){function i(a){0!=a.toLowerCase().indexOf(k.toLowerCase())||b(j,a)||j.push(a)}h="undefined"==typeof h?"":h;var j=[],k=c.string;if(d){for(var l=d.pop(),m=!1,n=0;n<g.jsontree.length&&($.each(g.jsontree[n],function(a,b){if("catalogue"==a.toLowerCase()){if(l.string==b){if(h){var c=g.jsontree[n].tables.filter(function(a){return 0==a.name.indexOf(h)});j=j.concat(c.map(function(a){return a.name}))}else j=j.concat(g.jsontree[n].tables.map(function(a){return a.name}));return m=!0,!1}}else if("tables"==a.toLowerCase())for(var d=0;d<g.jsontree[n].tables.length;d++)if(l.string==g.jsontree[n].tables[d].name)if(h){var c=g.jsontree[n].tables[d].columns.filter(function(a){return 0==a.indexOf(h)});j=j.concat(c)}else j=j.concat(g.jsontree[n].tables[d].columns)}),!m);n++);return j.sort()}return a(e,i),j.sort()}function d(c,d,e,f,h,i){function j(a){0!=a.toLowerCase().indexOf(l.toLowerCase())||b(k,a)||k.push(a)}i="undefined"==typeof i?"":i;var k=[],l=c.string;if(d){var m=d.pop();return g(m.string,l,k,h,i),k.sort()}return a(e,j),k.sort()}function e(c,d,e,f,g,i){function j(a){0!=a.toLowerCase().indexOf(l.toLowerCase())||b(k,a)||k.push(a)}i="undefined"==typeof i?"":i;var k=[],l=c.string;if(d){d.pop();return h(i,l,k,g,i),k.sort()}return h(i,l,k,g,i),a(e,j),k.sort()}function f(a,c,d,e){if(a.length>0)for(var f=0;f<a.length;f++)for(var g=jQuery.trim(a[f]),h=g.split("."),i=0;i<h.length;i++)0!=h[i].toLowerCase().indexOf(d.toLowerCase())||b(c,h[i])||h[i].toLowerCase()==e.toLowerCase()||c.push(h[i])}function g(a,b,c,d,e){e="undefined"==typeof e?"":e,d.autocompleteInfo&&jQuery("#"+d.autocompleteInfo).html("Loading catalogue metadata keywords for auto-complete"),d.autocompleteLoader&&jQuery("#"+d.autocompleteLoader).show(),jQuery.ajax({type:"POST",dataType:"json",async:!1,data:{keyword:a,optional_keyword:e,mode:"tap",resource:d.tapResource},url:d.webServicePath,timeout:1e6,error:function(){d.autocompleteInfo&&jQuery("#"+d.autocompleteInfo).html("CTRL + Space to activate auto-complete"),d.autocompleteLoader&&jQuery("#"+d.autocompleteLoader).hide()},success:function(e){e&&f(e,c,b,a),d.autocompleteInfo&&jQuery("#"+d.autocompleteInfo).html("CTRL + Space to activate auto-complete"),d.autocompleteLoader&&jQuery("#"+d.autocompleteLoader).hide()}})}function h(a,b,c,d,e){if(e="undefined"==typeof e?"":e,d.autocompleteInfo&&jQuery("#"+d.autocompleteInfo).html("Loading catalogue metadata keywords for auto-complete"),d.autocompleteLoader&&jQuery("#"+d.autocompleteLoader).show(),e){var g=window.gacsGetByKeyword(e);g&&f(g,c,b,"")}else{var g=window.gacsGetByKeyword("");g&&f(g,c,b,"")}}function i(c,d,e,f){function g(a){0!=a.toLowerCase().indexOf(j.toLowerCase())||b(i,a)||i.push(a)}function h(b){"string"==typeof b?a(editor.availableTags,g):b instanceof Array?a(editor.availableTags,g):b instanceof Function&&a(editor.availableTags,g);for(var c in b)g(c)}var i=[],j=c.string;if(d){var k,l=d.pop();for(0===l.type.indexOf("variable")?(f&&f.additionalContext&&(k=f.additionalContext[l.string]),k=k||window[l.string]):"string"==l.type?k="":"atom"==l.type?k=1:"function"==l.type&&(null==window.jQuery||"$"!=l.string&&"jQuery"!=l.string||"function"!=typeof window.jQuery?null!=window._&&"_"==l.string&&"function"==typeof window._&&(k=window._()):k=window.jQuery());null!=k&&d.length;)k=k[d.pop().string];null!=k&&h(k)}else a(e,g);return i.sort()}function j(a){var b=a.doc.modeOption;return"sql"===b&&(b="text/x-sql"),CodeMirror.resolveMode(b).keywords}function k(a){return"string"==typeof a?a:a.text}function l(a,b){if(!a.slice)return a[b];for(var c=a.length-1;c>=0;c--)if(k(a[c])==b)return a[c]}function m(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function n(a,b){var c=a.length,d=k(b).substr(0,c);return a.toUpperCase()===d.toUpperCase()}function o(a,b,c,d){for(var e in c)c.hasOwnProperty(e)&&(c.slice&&(e=c[e]),n(b,e)&&a.push(d(e)))}function p(a){return"."==a.charAt(0)&&(a=a.substr(1)),a.replace(/`/g,"")}function q(a){for(var b=k(a).split("."),c=0;c<b.length;c++)b[c]="`"+b[c]+"`";var d=b.join(".");return"string"==typeof a?d:(a=m(a),a.text=d,a)}function r(a,b,c,d){for(var e=!1,f=[],g=b.start,h=!0;h;)h="."==b.string.charAt(0),e=e||"`"==b.string.charAt(0),g=b.start,f.unshift(p(b.string)),b=d.getTokenAt(A(a.line,b.start)),"."==b.string&&(h=!0,b=d.getTokenAt(A(a.line,b.start)));var i=f.join(".");o(c,i,y,function(a){return e?q(a):a}),o(c,i,z,function(a){return e?q(a):a}),i=f.pop();var j=f.join("."),k=!1;if(!l(y,j)){var m=j;j=v(j,d),j!==m&&(k=!0)}return j}function s(a,b){if(a)for(var c=/[,;]/g,d=a.split(" "),e=0;e<d.length;e++)b(d[e]?d[e].replace(c,""):"")}function t(a){return a.line+a.ch/Math.pow(10,6)}function u(a){return A(Math.floor(a),+a.toString().split(".").pop())}function v(a,b){for(var c=b.doc,d=c.getValue(),e=a.toUpperCase(),f="",g="",h=[],i={start:A(0,0),end:A(b.lastLine(),b.getLineHandle(b.lastLine()).length)},j=d.indexOf(B.QUERY_DIV);j!=-1;)h.push(c.posFromIndex(j)),j=d.indexOf(B.QUERY_DIV,j+1);h.unshift(A(0,0)),h.push(A(b.lastLine(),b.getLineHandle(b.lastLine()).text.length));for(var k=0,l=t(b.getCursor()),m=0;m<h.length;m++){var n=t(h[m]);if(l>k&&l<=n){i={start:u(k),end:u(n)};break}k=n}for(var o,p=c.getRange(i.start,i.end,!1),m=0;m<p.length;m++){var q=p[m];if(s(q,function(a){var b=a.toUpperCase();b===e&&o.toUpperCase()==B.ALIAS_KEYWORD.toUpperCase()&&(g=f),o=a,b!==B.ALIAS_KEYWORD&&(f=a)}),g)break}return g}function w(a,b,c,d){y=d&&d.tables||{};var e=d&&d.defaultTable;z=e&&l(y,e),b=b||j(a),table=null,e&&!z&&(z=v(e,a)),z=z||[],z.columns&&(z=z.columns);var f,g,h,i=a.getCursor(),k=[],m=a.getTokenAt(i);return m.end>i.ch&&(m.end=i.ch,m.string=m.string.slice(0,i.ch-m.start)),m.string.match(/^[.`\w@]\w*$/)?(h=m.string,f=m.start,g=m.end):(f=g=i.ch,h=""),"."!=h.charAt(0)&&"`"!=h.charAt(0)||(table=r(i,m,k,a)),table}function x(a,b,f,g){var h=a.getCursor(),j=f(a,h),k=j,l=null,m=w(a,b,f,g);for(/^[\w$_]*$/.test(j.string)||(j=k={start:h.ch,end:h.ch,string:"",state:j.state,type:"."==j.string?"property":null}),token_start_original=j.start,token_end_original=j.end,line_original=h.line,cur_temp={},cur_temp.line=h.line,cur_temp.ch=j.start,token_temp=f(a,cur_temp),"."==token_temp.string&&(l=j.string,j=k={start:cur_temp.ch,end:cur_temp.ch,string:"",state:token_temp,type:"."==token_temp.string?"property":null});"property"==k.type;){if(k=f(a,{line:h.line,ch:k.start}),"gwt"==a.servicemode.toLowerCase()&&(tableProp=f(a,{line:h.line,ch:k.start}),tempProp=f(a,{line:h.line,ch:tableProp.start}),"."==tempProp.string.trim()?(schemaProp=f(a,{line:h.line,ch:tableProp.start-1}),schemaProp.string&&(l=schemaProp.string+"."+tableProp.string+"."+l),m&&(l=m+"."+l)):l=m?m+"."+l:tableProp.string+"."+l),"."!=k.string)return;if(k=f(a,{line:h.line,ch:k.start}),")"==k.string){var n=1;do switch(k=f(a,{line:h.line,ch:k.start}),k.string){case")":n++;break;case"(":n--}while(n>0);if(k=f(a,{line:h.line,ch:k.start}),0!==k.type.indexOf("variable"))return;k.type="function"}if(!o)var o=[];o.push(k)}return"gwt"==a.servicemode.toLowerCase()&&(l||j.string&&(l=j.string)),"tap"!=a.servicemode.toLowerCase()?"jsontree"==a.servicemode.toLowerCase()?{list:c(j,o,b,g,a,l),from:{line:line_original,ch:token_start_original},to:{line:line_original,ch:token_end_original}}:"gwt"==a.servicemode.toLowerCase()?{list:e(j,o,b,g,a,l),from:{line:line_original,ch:token_start_original},to:{line:line_original,ch:token_end_original}}:{list:i(j,o,b,g),from:{line:line_original,ch:token_start_original},to:{line:line_original,ch:token_end_original}}:{list:d(j,o,b,g,a,l),from:{line:line_original,ch:token_start_original},to:{line:line_original,ch:token_end_original}}}CodeMirror.tapHint=function(a,b,c){function d(f){function g(b){a.replaceRange(b,k.from,k.to)}function h(){s||(s=!0,m.parentNode.removeChild(m))}function i(){g(l[n.selectedIndex]),h(),setTimeout(function(){a.focus()},50)}if(!a.somethingSelected()){var j=a.getTokenAt(a.getCursor());if(!e.closeOnTokenChange||null==f||j.start==f.start&&j.type==f.type){var k=b(a,c);if(k&&k.list.length){var l=k.list;if(e.completeSingle&&1==l.length)return g(l[0]),!0;var m=document.createElement("div");m.className="CodeMirror-completions";var n=m.appendChild(document.createElement("select"));window.opera||(n.multiple=!0);for(var o=0;o<l.length;++o){var p=n.appendChild(document.createElement("option"));p.appendChild(document.createTextNode(l[o]))}n.firstChild.selected=!0,n.size=Math.min(10,l.length);var q=a.cursorCoords(e.alignWithWord?k.from:null);m.style.left=q.left+"px",m.style.top=q.bottom+"px",document.body.appendChild(m);var r=window.innerWidth||Math.max(document.body.offsetWidth,document.documentElement.offsetWidth);r-q.left<n.clientWidth&&(m.style.left=q.left-n.clientWidth+"px"),l.length<=10&&(m.style.width=n.clientWidth-1+"px");var s=!1;return CodeMirror.on(n,"blur",h),CodeMirror.on(n,"keydown",function(b){var c=b.keyCode;13==c?(CodeMirror.e_stop(b),i()):27==c?(CodeMirror.e_stop(b),h(),a.focus()):38==c||40==c||33==c||34==c||CodeMirror.isModifierKey(b)||(h(),a.focus(),a.triggerOnKeyDown(b),e.closeOnBackspace&&8==c||setTimeout(function(){d(j)},50))}),CodeMirror.on(n,"dblclick",i),n.focus(),window.opera&&setTimeout(function(){s||n.focus()},100),!0}}}}var e=(CodeMirror.Pos,{}),f=CodeMirror.tapHint.defaults;c.tapResource&&(a.tapResource=c.tapResource),c.webServicePath&&(a.webServicePath=c.webServicePath),c.autocompleteLoader&&(a.autocompleteLoader=c.autocompleteLoader),c.autocompleteInfo&&(a.autocompleteInfo=c.autocompleteInfo),c.servicemode&&(a.servicemode=c.servicemode),c.jsontree&&(a.jsontree=c.jsontree),c.availableTags?a.availableTags=c.availableTags:a.availableTags||(a.availableTags=["SELECT","FROM","ORDER BY","WHERE","TOP","IN","AND","OR","WITH","DESC","ASC","JOIN","AS","HAVING","ABS","GROUP","BY","INNER","OUTER","CROSS","LEFT","RIGHT","FULL","ON","USING","MIN","MAX","COUNT","DISTINCT","ALL","LIKE","ACOS","ASIN","ATAN","ATAN2","COS","SIN","TAN","COT","IS","NOT","NULL","NATURAL","EXISTS","BETWEEN","AREA","BOX","CENTROID","CIRCLE","CONTAINS","COORD1","COORD2","COORDSYS","DISTANCE","INTERSECTS","POINT","POLYGON","REGION"]);for(var g in f)f.hasOwnProperty(g)&&(e[g]=(c&&c.hasOwnProperty(g)?c:f)[g]);return d()},CodeMirror.tapHint.defaults={closeOnBackspace:!0,closeOnTokenChange:!1,completeSingle:!0,alignWithWord:!0};var y,z,A=CodeMirror.Pos,B={QUERY_DIV:";",ALIAS_KEYWORD:"AS"};CodeMirror.adqlHint=function(a,b){return x(a,a.availableTags,function(a,b){return a.getTokenAt(b)},b)}}();
     4.7 \ No newline at end of file